Ignore:
Timestamp:
Jan 3, 2010, 7:13:32 PM (12 years ago)
Author:
rbri
Message:

DJVU plugin: djvulibre updated to version 3.5.22

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libdjvu/DjVuMessage.cpp

    r206 r280  
    5454//C- +------------------------------------------------------------------
    5555//
    56 // $Id: DjVuMessage.cpp,v 1.19 2007/03/25 20:48:30 leonb Exp $
    57 // $Name: release_3_5_19 $
     56// $Id: DjVuMessage.cpp,v 1.24 2008/01/27 17:32:56 leonb Exp $
     57// $Name: release_3_5_22 $
    5858
    5959#ifdef HAVE_CONFIG_H
     
    7878#ifdef WIN32
    7979# include <tchar.h>
    80 # include <atlbase.h>
    8180# include <windows.h>
    8281# include <winreg.h>
     
    122121// directory names for searching messages
    123122#ifdef AUTOCONF
    124 // !!! ER !!! static const char DjVuDataDir[] = DIR_DATADIR "/djvu/osi";
     123static const char DjVuDataDir[] = DIR_DATADIR "/djvu/osi";
     124#endif /* AUTOCONF */
    125125static const char ModuleDjVuDir[] ="share/djvu/osi";
    126 #else /* !AUTOCONF */
    127 static const char ModuleDjVuDir[] ="profiles";
    128 #endif /* !AUTOCONF */
     126static const char ProfilesDjVuDir[] ="profiles";
    129127static const char LocalDjVuDir[] =".DjVu";      // relative to ${HOME}
    130128#ifdef LT_DEFAULT_PREFIX
     
    152150{
    153151  GURL retval;
    154    // To do:  This needs to be shared with SetProfile.cpp
    155152  LPCTSTR path = registrypath;
    156 
    157153  HKEY hKey = 0;
    158   // MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,argv[1],strlen(argv[1])+1,wszSrcFile,sizeof(wszSrcFile));
    159154  if (RegOpenKeyEx(hParentKey, path, 0,
    160               KEY_READ, &hKey) == ERROR_SUCCESS )
     155                   KEY_READ, &hKey) == ERROR_SUCCESS )
    161156  {
    162     TCHAR path[1024];
    163     // Success
    164     TCHAR *szPathValue = path;
    165     LPCTSTR lpszEntry = (LPCTSTR &)TEXT("");
    166     DWORD dwCount = (sizeof(path)/sizeof(TCHAR))-1;
     157    CHAR path[1024];
     158    CHAR *szPathValue = path;
     159    LPCSTR lpszEntry = "";
     160    DWORD dwCount = (sizeof(path)/sizeof(CHAR))-1;
    167161    DWORD dwType;
    168 
    169     LONG lResult = RegQueryValueEx(hKey, lpszEntry, NULL,
    170              &dwType, (LPBYTE) szPathValue, &dwCount);
    171 
     162    LONG lResult = RegQueryValueExA(hKey, lpszEntry, NULL,
     163                        &dwType, (LPBYTE)szPathValue, &dwCount);
    172164    RegCloseKey(hKey);
    173 
    174165    if ((lResult == ERROR_SUCCESS))
    175166    {
    176167      szPathValue[dwCount] = 0;
    177       USES_CONVERSION;
    178       retval=GURL::Filename::Native(T2CA(path));
     168      retval=GURL::Filename::Native(path);
    179169    }
    180170  }
    181 //  if (hKey)  RegCloseKey(hKey);
    182171  return retval;
    183172}
     
    187176{
    188177  const GUTF8String cwd(GOS::cwd());
    189   TCHAR path[1024];
    190   DWORD dwCount = (sizeof(path)/sizeof(TCHAR))-1;
    191   GetModuleFileName(0, path, dwCount);
    192   USES_CONVERSION;
    193   GURL retval=GURL::Filename::Native(T2CA(path)).base();
     178  CHAR path[1024];
     179  DWORD dwCount = (sizeof(path)/sizeof(CHAR))-1;
     180  GetModuleFileNameA(0, path, dwCount);
     181  GURL retval=GURL::Filename::Native(path).base();
    194182  GOS::cwd(cwd);
    195183  return retval;
     
    293281#endif
    294282      appendPath(mpath,pathsmap,paths);
     283      appendPath(GURL::UTF8(ModuleDjVuDir,mpath),pathsmap,paths);
     284      appendPath(GURL::UTF8(ProfilesDjVuDir,mpath),pathsmap,paths);
    295285      mpath=mpath.base();
    296286      appendPath(GURL::UTF8(ModuleDjVuDir,mpath),pathsmap,paths);
     287      appendPath(GURL::UTF8(ProfilesDjVuDir,mpath),pathsmap,paths);
    297288      mpath=mpath.base();
    298289      appendPath(GURL::UTF8(ModuleDjVuDir,mpath),pathsmap,paths);
     290      appendPath(GURL::UTF8(ProfilesDjVuDir,mpath),pathsmap,paths);
    299291      mpath=mpath.base();
    300292      appendPath(GURL::UTF8(ModuleDjVuDir,mpath),pathsmap,paths);
     293      appendPath(GURL::UTF8(ProfilesDjVuDir,mpath),pathsmap,paths);
    301294    }
    302295#endif
    303296#if defined(AUTOCONF)
    304     // ER !!! GURL dpath = GURL::Filename::UTF8(DjVuDataDir);
    305     // !!! appendPath(dpath,pathsmap,paths);
     297    GURL dpath = GURL::Filename::UTF8(DjVuDataDir);
     298    appendPath(dpath,pathsmap,paths);
    306299#endif
    307300#ifdef WIN32
Note: See TracChangeset for help on using the changeset viewer.