Kaydet (Commit) 7933b269 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Reintroduce Win_GetShortPathName()

Change-Id: Id15d1d4d9b7fb9bb2a0a5f52b5ec1928c38bd27b
üst 2c66056b
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment