lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx | 30 +++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-)
New commits: commit c317f1bd7ddeb653e9c845472a6f6c79e8369171 Author: Tor Lillqvist <t...@collabora.com> Date: Fri May 23 14:29:50 2014 +0300 Try to fix Windows build Change-Id: Ib73cc86f9f14397b296324e14562278b5f8a2144 (cherry picked from commit 8928a4f6dcacb1357d3b9b1a7a29cc62fede87d9) diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx index 94abeb9..72fd23d 100644 --- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx @@ -17,6 +17,11 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#if defined(WNT) +#include <prewin.h> +#include <postwin.h> +#endif + #include <com/sun/star/uno/Reference.h> #include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp> commit 31d8ef3bd815a329a587a72cc76abe56bd86ceaa Author: Tor Lillqvist <t...@collabora.com> Date: Fri May 23 13:12:05 2014 +0300 Reintroduce Win_GetShortPathName() Change-Id: Id15d1d4d9b7fb9bb2a0a5f52b5ec1928c38bd27b (cherry picked from commit 7933b269ba4c5a49dd394eef15e98c55a19038ef) 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 ) commit 19943d663b3ac09d02b9c8f994c8fdc9a6f4b210 Author: Tor Lillqvist <t...@collabora.com> Date: Fri May 23 12:31:16 2014 +0300 Fix typo Change-Id: I7ee0eecc36659ac8ee9a62698923a90e96b7f302 (cherry picked from commit f98eab9fa1d6bc78fd70d2014c8b31da556b4ef9) diff --git a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx index 86b0d5e..9f7028b 100644 --- a/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx +++ b/lingucomponent/source/hyphenator/hyphen/hyphenimp.cxx @@ -288,7 +288,7 @@ Reference< XHyphenatedWord > SAL_CALL Hyphenator::hyphenate( const OUString& aWo #if defined(WNT) // Hyphen waits UTF-8 encoded paths with \\?\ long path prefix. - OString sTmp = OUStringToOString(dicpath, RTL_TEXTENCODING_UTF8); + OString sTmp = OUStringToOString(dictpath, RTL_TEXTENCODING_UTF8); #else OString sTmp( OU2ENC( dictpath, osl_getThreadTextEncoding() ) ); #endif _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits