summaryrefslogtreecommitdiff
path: root/sfx2/source/doc
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-09-26 11:28:57 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-09-30 11:23:41 +0200
commit362a21d3a129b90149f6ef645c127f5e86e0ba61 (patch)
tree8583cb29b33de56e4489cb8950d2714a1fb2957e /sfx2/source/doc
parent81ce629c9e8a4fc26ded9d49157e3f3263991e03 (diff)
Use explicit function names for fooA/fooW WinAPI; prefer fooW
We should only use generic foo function name when it takes params that are also dependent on UNICODE define, like LoadCursor( nullptr, IDC_ARROW ) where IDC_ARROW is defined in MSVC headers synchronised with LoadCursor definition. We should always use Unicode API for any file paths operations, because otherwise we will get "?" for any character in path that is not in current non-unicode codepage, which will result in failed file operations. Change-Id: I3a7f453ca0f893002d8a9764318919709fd8b633 Reviewed-on: https://gerrit.libreoffice.org/42935 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r--sfx2/source/doc/graphhelp.cxx3
-rw-r--r--sfx2/source/doc/guisaveas.cxx2
-rw-r--r--sfx2/source/doc/syspathw32.cxx2
3 files changed, 3 insertions, 4 deletions
diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index eb8ad7ffe736..02664519ee8a 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -88,7 +88,6 @@ void* GraphicHelper::getEnhMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta )
OUString aMetaFile = aTempFile.GetFileName();
OUString aMetaURL = aTempFile.GetURL();
- OString aWinFile = OUStringToOString( aMetaFile, osl_getThreadTextEncoding() );
SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aMetaURL, StreamMode::STD_READWRITE );
if ( pStream )
@@ -99,7 +98,7 @@ void* GraphicHelper::getEnhMetaFileFromGDI_Impl( const GDIMetaFile* pGDIMeta )
delete pStream;
if ( !nFailed )
- pResult = GetEnhMetaFileA( aWinFile.getStr() );
+ pResult = GetEnhMetaFileW( SAL_W(aMetaFile.getStr()) );
}
}
#else
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 548ccd30d161..86a02dc5dd8f 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1195,7 +1195,7 @@ OUString ModelData_Impl::GetRecommendedDir( const OUString& aSuggestedDir )
if( SUCCEEDED(hRes) )
{
OUString sTempINetFiles;
- if( osl::FileBase::getFileURLFromSystemPath(reinterpret_cast<sal_Unicode*>(sPath), sTempINetFiles) == osl::FileBase::E_None )
+ if( osl::FileBase::getFileURLFromSystemPath(SAL_U(sPath), sTempINetFiles) == osl::FileBase::E_None )
bIsInTempPath = !sTempINetFiles.isEmpty() && sLocationURL.startsWith( sTempINetFiles );
}
}
diff --git a/sfx2/source/doc/syspathw32.cxx b/sfx2/source/doc/syspathw32.cxx
index c190a7e159bd..ea6e13c078ba 100644
--- a/sfx2/source/doc/syspathw32.cxx
+++ b/sfx2/source/doc/syspathw32.cxx
@@ -61,7 +61,7 @@ static bool SHGetSpecialFolderW32( int nFolderID, WCHAR* pszFolder, int nSize )
bool GetUserTemplateLocation(sal_Unicode* pFolder, int nSize)
{
#ifdef _WIN32
- return SHGetSpecialFolderW32( CSIDL_TEMPLATES, reinterpret_cast<LPWSTR>(pFolder), nSize );
+ return SHGetSpecialFolderW32( CSIDL_TEMPLATES, SAL_W(pFolder), nSize );
#else
(void)pFolder;
(void)nSize;