Kaydet (Commit) 12870341 authored tarafından Caolán McNamara's avatar Caolán McNamara

ByteString -> rtl::OStringBuffer

üst 347738ea
...@@ -53,11 +53,9 @@ ________________________________________________________________________________ ...@@ -53,11 +53,9 @@ ________________________________________________________________________________
/*_________________________________________________________________________________________________________________ /*_________________________________________________________________________________________________________________
U2B( SUNICODEVALUE ) U2B( SUNICODEVALUE )
B2U( SASCIIVALUE ) B2U( SASCIIVALUE )
U2B_ENC( SUNICODEVALUE, AENCODING )
B2U_ENC( SASCIIVALUE, AENCODING )
Use it to convert unicode strings to ascii values and reverse ... Use it to convert unicode strings to ascii values and reverse ...
We use UTF8 as default textencoding. If you will change this use U2B_ENC and B2U_ENC! We use UTF8 as default textencoding.
_________________________________________________________________________________________________________________*/ _________________________________________________________________________________________________________________*/
#define U2B( SUNICODEVALUE ) \ #define U2B( SUNICODEVALUE ) \
...@@ -66,16 +64,6 @@ ________________________________________________________________________________ ...@@ -66,16 +64,6 @@ ________________________________________________________________________________
#define B2U( SASCIIVALUE ) \ #define B2U( SASCIIVALUE ) \
::rtl::OStringToOUString( SASCIIVALUE, RTL_TEXTENCODING_UTF8 ) ::rtl::OStringToOUString( SASCIIVALUE, RTL_TEXTENCODING_UTF8 )
#define U2B_ENC( SUNICODEVALUE, AENCODING ) \
::rtl::OUStringToOString( SUNICODEVALUE, AENCODING )
#define B2U_ENC( SASCIIVALUE, AENCODING ) \
::rtl::OStringToOUString( SASCIIVALUE, AENCODING )
//*****************************************************************************************************************
// end of file
//*****************************************************************************************************************
#endif // #ifndef __FRAMEWORK_MACROS_GENERIC_HXX_ #endif // #ifndef __FRAMEWORK_MACROS_GENERIC_HXX_
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -297,7 +297,7 @@ void PersistentWindowState::implst_setWindowStateOnConfig(const css::uno::Refere ...@@ -297,7 +297,7 @@ void PersistentWindowState::implst_setWindowStateOnConfig(const css::uno::Refere
{ {
sal_uLong nMask = WINDOWSTATE_MASK_ALL; sal_uLong nMask = WINDOWSTATE_MASK_ALL;
nMask &= ~(WINDOWSTATE_MASK_MINIMIZED); nMask &= ~(WINDOWSTATE_MASK_MINIMIZED);
sWindowState = B2U_ENC( sWindowState = rtl::OStringToOUString(
((SystemWindow*)pWindow)->GetWindowState(nMask), ((SystemWindow*)pWindow)->GetWindowState(nMask),
RTL_TEXTENCODING_UTF8); RTL_TEXTENCODING_UTF8);
} }
...@@ -341,7 +341,7 @@ void PersistentWindowState::implst_setWindowStateOnWindow(const css::uno::Refere ...@@ -341,7 +341,7 @@ void PersistentWindowState::implst_setWindowStateOnWindow(const css::uno::Refere
::rtl::OUString sOldWindowState = ::rtl::OStringToOUString( pSystemWindow->GetWindowState(), RTL_TEXTENCODING_ASCII_US ); ::rtl::OUString sOldWindowState = ::rtl::OStringToOUString( pSystemWindow->GetWindowState(), RTL_TEXTENCODING_ASCII_US );
if ( sOldWindowState != sWindowState ) if ( sOldWindowState != sWindowState )
pSystemWindow->SetWindowState(U2B_ENC(sWindowState,RTL_TEXTENCODING_UTF8)); pSystemWindow->SetWindowState(rtl::OUStringToOString(sWindowState,RTL_TEXTENCODING_UTF8));
// <- SOLAR SAFE ------------------------ // <- SOLAR SAFE ------------------------
} }
......
...@@ -72,7 +72,7 @@ static ::rtl::OUString getWindowState(const css::uno::Reference< css::awt::XWind ...@@ -72,7 +72,7 @@ static ::rtl::OUString getWindowState(const css::uno::Reference< css::awt::XWind
if (!xWindow.is()) if (!xWindow.is())
return ::rtl::OUString(); return ::rtl::OUString();
ByteString sWindowState; rtl::OString sWindowState;
// SOLAR SAFE -> ---------------------------- // SOLAR SAFE -> ----------------------------
{ {
SolarMutexGuard aSolarGuard; SolarMutexGuard aSolarGuard;
...@@ -88,7 +88,7 @@ static ::rtl::OUString getWindowState(const css::uno::Reference< css::awt::XWind ...@@ -88,7 +88,7 @@ static ::rtl::OUString getWindowState(const css::uno::Reference< css::awt::XWind
} }
// <- SOLAR SAFE ---------------------------- // <- SOLAR SAFE ----------------------------
return B2U_ENC(sWindowState,RTL_TEXTENCODING_UTF8); return rtl::OStringToOUString(sWindowState,RTL_TEXTENCODING_UTF8);
} }
//----------------------------------------------- //-----------------------------------------------
...@@ -116,7 +116,7 @@ static void setWindowState(const css::uno::Reference< css::awt::XWindow >& xWind ...@@ -116,7 +116,7 @@ static void setWindowState(const css::uno::Reference< css::awt::XWindow >& xWind
) )
) )
{ {
((SystemWindow*)pWindow)->SetWindowState(U2B_ENC(sWindowState,RTL_TEXTENCODING_UTF8)); ((SystemWindow*)pWindow)->SetWindowState(OUStringToOString(sWindowState,RTL_TEXTENCODING_UTF8));
} }
// <- SOLAR SAFE ---------------------------- // <- SOLAR SAFE ----------------------------
......
...@@ -93,6 +93,8 @@ ...@@ -93,6 +93,8 @@
#include <rtl/instance.hxx> #include <rtl/instance.hxx>
#include <unotools/cmdoptions.hxx> #include <unotools/cmdoptions.hxx>
#include <rtl/strbuf.hxx>
#include <algorithm> #include <algorithm>
#include <boost/bind.hpp> #include <boost/bind.hpp>
...@@ -2313,11 +2315,11 @@ throw (RuntimeException) ...@@ -2313,11 +2315,11 @@ throw (RuntimeException)
RTL_LOGFILE_TRACE1( "framework (cd100003) ::LayoutManager::lock lockCount=%d", nLockCount ); RTL_LOGFILE_TRACE1( "framework (cd100003) ::LayoutManager::lock lockCount=%d", nLockCount );
#ifdef DBG_UTIL #ifdef DBG_UTIL
ByteString aStr("LayoutManager::lock "); rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("LayoutManager::lock "));
aStr += ByteString::CreateFromInt32((long)this); aStr.append(reinterpret_cast<sal_Int64>(this));
aStr += " - "; aStr.append(RTL_CONSTASCII_STRINGPARAM(" - "));
aStr += ByteString::CreateFromInt32(nLockCount); aStr.append(nLockCount);
OSL_TRACE( aStr.GetBuffer() ); OSL_TRACE(aStr.getStr());
#endif #endif
Any a( nLockCount ); Any a( nLockCount );
...@@ -2335,11 +2337,11 @@ throw (RuntimeException) ...@@ -2335,11 +2337,11 @@ throw (RuntimeException)
RTL_LOGFILE_TRACE1( "framework (cd100003) ::LayoutManager::unlock lockCount=%d", nLockCount ); RTL_LOGFILE_TRACE1( "framework (cd100003) ::LayoutManager::unlock lockCount=%d", nLockCount );
#ifdef DBG_UTIL #ifdef DBG_UTIL
ByteString aStr("LayoutManager::unlock "); rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("LayoutManager::unlock "));
aStr += ByteString::CreateFromInt32((long)this); aStr.append(reinterpret_cast<sal_Int64>(this));
aStr += " - "; aStr.append(RTL_CONSTASCII_STRINGPARAM(" - "));
aStr += ByteString::CreateFromInt32(nLockCount); aStr.append(nLockCount);
OSL_TRACE( aStr.GetBuffer() ); OSL_TRACE(aStr.getStr());
#endif #endif
// conform to documentation: unlock with lock count == 0 means force a layout // conform to documentation: unlock with lock count == 0 means force a layout
......
...@@ -1794,7 +1794,7 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw ...@@ -1794,7 +1794,7 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw
return; return;
SystemWindow* pSystemWindow = (SystemWindow*)pWindowCheck; SystemWindow* pSystemWindow = (SystemWindow*)pWindowCheck;
pSystemWindow->SetWindowState(U2B_ENC(sWindowState,RTL_TEXTENCODING_UTF8)); pSystemWindow->SetWindowState(rtl::OUStringToOString(sWindowState,RTL_TEXTENCODING_UTF8));
// <- SOLAR SAFE // <- SOLAR SAFE
} }
} }
......
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