Merge to XFA: Fix windows-specific usage of CFX_WideStr::operator LPCWSTR().
authorTom Sepez <tsepez@chromium.org>
Mon, 27 Apr 2015 20:22:54 +0000 (13:22 -0700)
committerTom Sepez <tsepez@chromium.org>
Mon, 27 Apr 2015 20:22:54 +0000 (13:22 -0700)
Original Review URL: https://codereview.chromium.org/1103343002

R=brucedawson@chromium.org
TBR=brucedawson@chromium.org

Review URL: https://codereview.chromium.org/1105253002

core/include/fxge/fx_ge_win32.h
core/src/fpdfdoc/doc_form.cpp
core/src/fxcrt/fx_basic_util.cpp
fpdfsdk/src/fsdk_baseform.cpp

index 311d355..d39a807 100644 (file)
@@ -38,7 +38,7 @@ public:
 
     static CFX_DIBitmap* LoadFromFile(FX_LPCSTR filename)
     {
-        return LoadFromFile(CFX_WideString::FromLocal(filename));
+        return LoadFromFile(CFX_WideString::FromLocal(filename).c_str());
     }
 
     static CFX_DIBitmap* LoadDIBitmap(WINDIB_Open_Args_ args);
index bb2c3a1..87887d7 100644 (file)
@@ -468,7 +468,7 @@ CPDF_Font* CPDF_InterForm::AddSystemFont(const CPDF_Document* pDocument, CFX_Wid
     if (iCharSet == 1) {
         iCharSet = GetNativeCharSet();
     }
-    HFONT hFont = ::CreateFontW(0, 0, 0, 0, 0, 0, 0, 0, iCharSet, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, csFontName);
+    HFONT hFont = ::CreateFontW(0, 0, 0, 0, 0, 0, 0, 0, iCharSet, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, csFontName.c_str());
     if (hFont != NULL) {
         LOGFONTA lf;
         memset(&lf, 0, sizeof(LOGFONTA));
index 272d43e..be736f1 100644 (file)
@@ -353,9 +353,9 @@ void* FX_OpenFolder(FX_LPCWSTR path)
         return NULL;
     }
 #ifdef _FX_WINAPI_PARTITION_DESKTOP_
-    pData->m_Handle = FindFirstFileW(CFX_WideString(path) + L"/*.*", &pData->m_FindData);
+    pData->m_Handle = FindFirstFileW((CFX_WideString(path) + L"/*.*").c_str(), &pData->m_FindData);
 #else
-    pData->m_Handle = FindFirstFileExW(CFX_WideString(path) + L"/*.*", FindExInfoStandard, &pData->m_FindData, FindExSearchNameMatch, NULL, 0);
+    pData->m_Handle = FindFirstFileExW((CFX_WideString(path) + L"/*.*").c_str(), FindExInfoStandard, &pData->m_FindData, FindExSearchNameMatch, NULL, 0);
 #endif
     if (pData->m_Handle == INVALID_HANDLE_VALUE) {
         delete pData;
index f989394..976d276 100644 (file)
@@ -2630,7 +2630,7 @@ CPDF_Stream* CPDFSDK_InterForm::LoadImageFromFile(const CFX_WideString& sFile)
 
        CPDF_Stream* pRetStream = NULL;
 
-       if (CFX_DIBitmap* pBmp = CFX_WindowsDIB::LoadFromFile(sFile))
+       if (CFX_DIBitmap* pBmp = CFX_WindowsDIB::LoadFromFile(sFile.c_str()))
        {
                int nWidth = pBmp->GetWidth();
                int nHeight = pBmp->GetHeight();