diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-04 22:34:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-06 22:08:37 +0000 |
commit | 88072f1292facfcb586e4f8b8c9eb61f9d80e02c (patch) | |
tree | d9bd63c5d5111427ae767cc3722d11a5af634d10 /sfx2 | |
parent | 778ef20d74ce499e4e0c4b0e3e4506b44938b975 (diff) |
make sfx2 ByteString free
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appcfg.cxx | 13 | ||||
-rw-r--r-- | sfx2/source/appl/appuno.cxx | 54 | ||||
-rw-r--r-- | sfx2/source/appl/impldde.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 23 | ||||
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/dialog/dockwin.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 9 |
7 files changed, 64 insertions, 60 deletions
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx index ec9fb2d5d054..aef541793047 100644 --- a/sfx2/source/appl/appcfg.cxx +++ b/sfx2/source/appl/appcfg.cxx @@ -70,6 +70,7 @@ #include <vcl/toolbox.hxx> #include <unotools/localfilehelper.hxx> #include <comphelper/processfactory.hxx> +#include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> #include <sfx2/app.hxx> @@ -152,9 +153,9 @@ IMPL_LINK(SfxEventAsyncer_Impl, TimerHdl, Timer*, pAsyncTimer) #ifdef DBG_UTIL if (!xRef.Is()) { - ByteString aTmp( "SfxEvent: "); - aTmp += ByteString( String( aHint.GetEventName() ), RTL_TEXTENCODING_UTF8 ); - OSL_TRACE( "%s", aTmp.GetBuffer() ); + rtl::OStringBuffer aTmp(RTL_CONSTASCII_STRINGPARAM("SfxEvent: ")); + aTmp.append(rtl::OUStringToOString(aHint.GetEventName(), RTL_TEXTENCODING_UTF8)); + OSL_TRACE( "%s", aTmp.getStr() ); } #endif SFX_APP()->Broadcast( aHint ); @@ -911,9 +912,9 @@ void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, bool bSynchron #ifdef DBG_UTIL if (!pDoc) { - ByteString aTmp( "SfxEvent: "); - aTmp += ByteString( String( rEventHint.GetEventName() ), RTL_TEXTENCODING_UTF8 ); - OSL_TRACE( "%s", aTmp.GetBuffer() ); + rtl::OStringBuffer aTmp(RTL_CONSTASCII_STRINGPARAM("SfxEvent: ")); + aTmp.append(rtl::OUStringToOString(rEventHint.GetEventName(), RTL_TEXTENCODING_UTF8)); + OSL_TRACE( "%s", aTmp.getStr() ); } #endif Broadcast(rEventHint); diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 8fb93d2aaa85..ac994e112b67 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -243,9 +243,9 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque #ifdef DBG_UTIL else { - ByteString aStr( "Property not convertable: "); - aStr += pSlot->pUnoName; - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Property not convertable: ")); + aStr.append(pSlot->pUnoName); + OSL_FAIL( aStr.getStr() ); } #endif } @@ -253,9 +253,9 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else if ( nSubCount == 0 ) { // for a simple property there can be only one parameter and its name *must* match - ByteString aStr( "Property name does not match: "); - aStr += ByteString( aName, RTL_TEXTENCODING_UTF8 ); - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Property name does not match: ")); + aStr.append(rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8)); + OSL_FAIL( aStr.getStr() ); } #endif else @@ -295,9 +295,9 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque #ifdef DBG_UTIL else { - ByteString aDbgStr( "Property not convertable: "); - aDbgStr += pSlot->pUnoName; - OSL_FAIL( aDbgStr.GetBuffer() ); + rtl::OStringBuffer aDbgStr(RTL_CONSTASCII_STRINGPARAM("Property not convertable: ")); + aDbgStr.append(pSlot->pUnoName); + OSL_FAIL( aDbgStr.getStr() ); } #endif break; @@ -308,9 +308,9 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if ( nSub >= nSubCount ) { // there was a parameter with a name that didn't match to any of the members - ByteString aStr( "Property name does not match: "); - aStr += ByteString( String(rPropValue.Name), RTL_TEXTENCODING_UTF8 ); - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Property name does not match: ")); + aStr.append(rtl::OUStringToOString(rPropValue.Name, RTL_TEXTENCODING_UTF8)); + OSL_FAIL( aStr.getStr() ); } #endif } @@ -336,9 +336,9 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if ( !pItem ) { #ifdef DBG_UTIL - ByteString aStr( "No creator method for argument: "); - aStr += rArg.pName; - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("No creator method for argument: ")); + aStr.append(rArg.pName); + OSL_FAIL( aStr.getStr() ); #endif return; } @@ -366,9 +366,9 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque #ifdef DBG_UTIL else { - ByteString aStr( "Property not convertable: "); - aStr += rArg.pName; - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Property not convertable: ")); + aStr.append(rArg.pName); + OSL_FAIL( aStr.getStr() ); } #endif break; @@ -395,9 +395,9 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque #ifdef DBG_UTIL else { - ByteString aStr( "Property not convertable: "); - aStr += rArg.pName; - OSL_FAIL( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("Property not convertable: ")); + aStr.append(rArg.pName); + OSL_FAIL( aStr.getStr() ); } #endif } @@ -432,9 +432,9 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque // ... but it was not convertable bRet = sal_False; #ifdef DBG_UTIL - ByteString aDbgStr( "Property not convertable: "); - aDbgStr += rArg.pName; - OSL_FAIL( aDbgStr.GetBuffer() ); + rtl::OStringBuffer aDbgStr(RTL_CONSTASCII_STRINGPARAM("Property not convertable: ")); + aDbgStr.append(rArg.pName); + OSL_FAIL( aDbgStr.getStr() ); #endif } @@ -908,9 +908,9 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque if ( nFoundArgs == nCount ) { // except for the "special" slots: assure that every argument was convertable - ByteString aStr( "MacroPlayer: Some properties didn't match to any formal argument for slot: "); - aStr += pSlot->pUnoName; - DBG_WARNING( aStr.GetBuffer() ); + rtl::OStringBuffer aStr(RTL_CONSTASCII_STRINGPARAM("MacroPlayer: Some properties didn't match to any formal argument for slot: ")); + aStr.append(pSlot->pUnoName); + DBG_WARNING( aStr.getStr() ); } #endif } diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx index 2d423978619c..d5c2ddf0b227 100644 --- a/sfx2/source/appl/impldde.cxx +++ b/sfx2/source/appl/impldde.cxx @@ -42,6 +42,7 @@ #include <vcl/button.hxx> #include <vcl/msgbox.hxx> #include <sot/exchange.hxx> +#include <rtl/strbuf.hxx> #include <rtl/ustring.hxx> #include "dde.hrc" @@ -261,11 +262,11 @@ sal_Bool SvDDEObject::Connect( SvBaseLink * pSvLink ) // Server not up, try once more to start it. if( !bInWinExec ) { - ByteString aCmdLine( sServer, RTL_TEXTENCODING_ASCII_US ); - aCmdLine.Append( ".exe " ); - aCmdLine.Append( ByteString( sTopic, RTL_TEXTENCODING_ASCII_US ) ); + rtl::OStringBuffer aCmdLine(rtl::OUStringToOString(sServer, RTL_TEXTENCODING_ASCII_US)); + aCmdLine.append(RTL_CONSTASCII_STRINGPARAM(".exe ")); + aCmdLine.append(rtl::OUStringToOString(sTopic, RTL_TEXTENCODING_ASCII_US)); - if( WinExec( aCmdLine.GetBuffer(), SW_SHOWMINIMIZED ) < 32 ) + if( WinExec( aCmdLine.getStr(), SW_SHOWMINIMIZED ) < 32 ) nError = DDELINK_ERROR_APP; else { diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 6e37c166e47c..ff92bf9d7966 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -81,6 +81,7 @@ #include <sfx2/sfxuno.hxx> #include <vcl/svapp.hxx> #include <sfx2/frame.hxx> +#include <rtl/strbuf.hxx> #include <rtl/string.hxx> using namespace ::com::sun::star::beans; @@ -631,7 +632,7 @@ XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow String sModuleName = GetHelpModuleName_Impl(); String sHelpText = pImp->GetHelpText( aCommandURL, sModuleName ); - ByteString aNewHelpId; + rtl::OString aNewHelpId; if ( pWindow && !sHelpText.Len() ) { @@ -640,7 +641,7 @@ XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow while ( pParent ) { aNewHelpId = pParent->GetHelpId(); - sHelpText = pImp->GetHelpText( String( aNewHelpId, RTL_TEXTENCODING_UTF8 ), sModuleName ); + sHelpText = pImp->GetHelpText( rtl::OStringToOUString(aNewHelpId, RTL_TEXTENCODING_UTF8), sModuleName ); if ( sHelpText.Len() > 0 ) pParent = NULL; else @@ -648,7 +649,7 @@ XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow } if ( bIsDebug && !sHelpText.Len() ) - aNewHelpId.Erase(); + aNewHelpId = rtl::OString(); } // add some debug information? @@ -658,10 +659,10 @@ XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow sHelpText += String( sModuleName ); sHelpText += DEFINE_CONST_UNICODE(": "); sHelpText += aCommandURL; - if ( aNewHelpId.Len() ) + if ( aNewHelpId.getLength() ) { sHelpText += DEFINE_CONST_UNICODE(" - "); - sHelpText += String( aNewHelpId, RTL_TEXTENCODING_UTF8 ); + sHelpText += String(rtl::OStringToOUString(aNewHelpId, RTL_TEXTENCODING_UTF8)); } } @@ -762,8 +763,8 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S Window* pParent = pWindow->GetParent(); while ( pParent ) { - ByteString aHelpId = pParent->GetHelpId(); - aHelpURL = CreateHelpURL( String( aHelpId, RTL_TEXTENCODING_UTF8 ), aHelpModuleName ); + rtl::OString aHelpId = pParent->GetHelpId(); + aHelpURL = CreateHelpURL( rtl::OStringToOUString(aHelpId, RTL_TEXTENCODING_UTF8), aHelpModuleName ); if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) break; else @@ -813,9 +814,9 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S return sal_False; #ifdef DBG_UTIL - ByteString aTmp("SfxHelp: HelpId = "); - aTmp += ByteString( aHelpURL, RTL_TEXTENCODING_UTF8 ); - OSL_TRACE( aTmp.GetBuffer() ); + rtl::OStringBuffer aTmp(RTL_CONSTASCII_STRINGPARAM("SfxHelp: HelpId = ")); + aTmp.append(rtl::OUStringToOString(aHelpURL, RTL_TEXTENCODING_UTF8)); + OSL_TRACE( aTmp.getStr() ); #endif pHelpWindow->SetHelpURL( aHelpURL ); @@ -857,7 +858,7 @@ void SfxHelp::OpenHelpAgent( const rtl::OString& sHelpId ) try { URL aURL; - aURL.Complete = CreateHelpURL_Impl( String( ByteString(sHelpId), RTL_TEXTENCODING_UTF8 ), GetHelpModuleName_Impl() ); + aURL.Complete = CreateHelpURL_Impl( rtl::OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), GetHelpModuleName_Impl() ); Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer")) ), UNO_QUERY ); xTrans->parseStrict(aURL); diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index 84e9a8a6d1a0..b23e6a88e105 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -61,7 +61,7 @@ using namespace ::rtl; class SfxModelessDialog_Impl : public SfxListener { public: - ByteString aWinState; + rtl::OString aWinState; SfxChildWindow* pMgr; sal_Bool bConstructed; void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); @@ -85,7 +85,7 @@ void SfxModelessDialog_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint ) class SfxFloatingWindow_Impl : public SfxListener { public: - ByteString aWinState; + rtl::OString aWinState; SfxChildWindow* pMgr; sal_Bool bConstructed; Timer aMoveTimer; @@ -239,7 +239,7 @@ void SfxModelessDialog::StateChanged( StateChangedType nStateChange ) { if ( nStateChange == STATE_CHANGE_INITSHOW ) { - if ( pImp->aWinState.Len() ) + if ( pImp->aWinState.getLength() ) { SetWindowState( pImp->aWinState ); } @@ -636,7 +636,7 @@ void SfxFloatingWindow::StateChanged( StateChangedType nStateChange ) if ( nStateChange == STATE_CHANGE_INITSHOW ) { // FloatingWindows are not centered by default - if ( pImp->aWinState.Len() ) + if ( pImp->aWinState.getLength() ) SetWindowState( pImp->aWinState ); pImp->bConstructed = sal_True; } diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index a79099fd260c..e1a835b63aa5 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -462,7 +462,7 @@ friend class SfxDockingWindow; sal_uInt16 nDockPos; sal_Bool bNewLine; sal_Bool bDockingPrevented; - ByteString aWinState; + rtl::OString aWinState; SfxChildAlignment GetLastAlignment() const { return eLastAlignment; } @@ -607,7 +607,7 @@ void SfxDockingWindow::ToggleFloatingMode() if (IsFloatingMode()) { SetAlignment(SFX_ALIGN_NOALIGNMENT); - if ( pImp->aWinState.Len() ) + if ( pImp->aWinState.getLength() ) GetFloatingWindow()->SetWindowState( pImp->aWinState ); else GetFloatingWindow()->SetOutputSizePixel( GetFloatingSize() ); @@ -1123,7 +1123,7 @@ void SfxDockingWindow::Initialize(SfxChildWinInfo *pInfo) SetFloatingMode( bFloatMode ); if ( bFloatMode ) { - if ( pImp->aWinState.Len() ) + if ( pImp->aWinState.getLength() ) GetFloatingWindow()->SetWindowState( pImp->aWinState ); else GetFloatingWindow()->SetOutputSizePixel( GetFloatingSize() ); @@ -1202,7 +1202,7 @@ void SfxDockingWindow::Initialize_Impl() if ( pFloatWin ) { // initialize floating window - if ( !pImp->aWinState.Len() ) + if ( !pImp->aWinState.getLength() ) // window state never set before, get if from defaults pImp->aWinState = pFloatWin->GetWindowState(); diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 35b2f6223c17..0a647687dfb4 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -100,6 +100,7 @@ #include "filedlgimpl.hxx" #include <helpid.hrc> #include <sfxlocal.hrc> +#include <rtl/strbuf.hxx> //----------------------------------------------------------------------------- @@ -279,7 +280,7 @@ OUString FileDialogHelper_Impl::handleHelpRequested( const FilePickerEvent& aEve OUString aHelpText; Help* pHelp = Application::GetHelp(); if ( pHelp ) - aHelpText = String( pHelp->GetHelpText( String( ByteString(sHelpId), RTL_TEXTENCODING_UTF8), NULL ) ); + aHelpText = String( pHelp->GetHelpText( rtl::OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8), NULL ) ); return aHelpText; } @@ -1796,9 +1797,9 @@ void FileDialogHelper_Impl::addFilter( const OUString& rFilterName, catch( const IllegalArgumentException& ) { #ifdef DBG_UTIL - ByteString aMsg( "Could not append Filter" ); - aMsg += ByteString( String( rFilterName ), RTL_TEXTENCODING_UTF8 ); - DBG_ERRORFILE( aMsg.GetBuffer() ); + rtl::OStringBuffer aMsg(RTL_CONSTASCII_STRINGPARAM("Could not append Filter")); + aMsg.append(rtl::OUStringToOString(rFilterName, RTL_TEXTENCODING_UTF8)); + DBG_ERRORFILE( aMsg.getStr() ); #endif } } |