summaryrefslogtreecommitdiff
path: root/sfx2/source/appl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-11-04 22:34:15 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-06 22:08:37 +0000
commit88072f1292facfcb586e4f8b8c9eb61f9d80e02c (patch)
treed9bd63c5d5111427ae767cc3722d11a5af634d10 /sfx2/source/appl
parent778ef20d74ce499e4e0c4b0e3e4506b44938b975 (diff)
make sfx2 ByteString free
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r--sfx2/source/appl/appcfg.cxx13
-rw-r--r--sfx2/source/appl/appuno.cxx54
-rw-r--r--sfx2/source/appl/impldde.cxx9
-rw-r--r--sfx2/source/appl/sfxhelp.cxx23
4 files changed, 51 insertions, 48 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);