lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx | 23 ++++++++++++++++++ 1 file changed, 23 insertions(+)
New commits: commit 7933b269ba4c5a49dd394eef15e98c55a19038ef Author: Tor Lillqvist <t...@collabora.com> Date: Fri May 23 13:12:05 2014 +0300 Reintroduce Win_GetShortPathName() Change-Id: Id15d1d4d9b7fb9bb2a0a5f52b5ec1928c38bd27b diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx index 9f7028b..94abeb9 100644 --- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx @@ -507,6 +507,29 @@ Reference < XHyphenatedWord > SAL_CALL Hyphenator::queryAlternativeSpelling( return NULL; } +#if defined(WNT) +static OString Win_GetShortPathName( const OUString &rLongPathName ) +{ + OString aRes; + + sal_Unicode aShortBuffer[1024] = {0}; + sal_Int32 nShortBufSize = SAL_N_ELEMENTS( aShortBuffer ); + + // use the version of 'GetShortPathName' that can deal with Unicode... + sal_Int32 nShortLen = GetShortPathNameW( + reinterpret_cast<LPCWSTR>( rLongPathName.getStr() ), + reinterpret_cast<LPWSTR>( aShortBuffer ), + nShortBufSize ); + + if (nShortLen < nShortBufSize) // conversion successful? + aRes = OString( OU2ENC( OUString( aShortBuffer, nShortLen ), osl_getThreadTextEncoding()) ); + else + OSL_FAIL( "Win_GetShortPathName: buffer to short" ); + + return aRes; +} +#endif //defined(WNT) + Reference< XPossibleHyphens > SAL_CALL Hyphenator::createPossibleHyphens( const OUString& aWord, const ::com::sun::star::lang::Locale& aLocale, const ::com::sun::star::beans::PropertyValues& aProperties ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits