diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-09-14 21:59:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-09-15 11:23:36 +0100 |
commit | 1cbaa2a61090fab9e0b24ac3f18395ced92e984f (patch) | |
tree | aeec560ea28171dcd23c151ebda31de574d96056 /vcl | |
parent | 365a13d3c5fdc7713a37bd29046cbddc1248d5d0 (diff) |
ByteString->rtl::OString[Buffer]
Diffstat (limited to 'vcl')
-rwxr-xr-x | vcl/source/app/dbggui.cxx | 40 | ||||
-rw-r--r-- | vcl/source/control/button.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/quickselectionengine.cxx | 2 | ||||
-rw-r--r-- | vcl/source/helper/strhelper.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 28 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 18 |
6 files changed, 53 insertions, 42 deletions
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx index d32fd848b45d..6e76706d87ba 100755 --- a/vcl/source/app/dbggui.cxx +++ b/vcl/source/app/dbggui.cxx @@ -610,7 +610,7 @@ DbgWindow::DbgWindow() : SetOutputSizePixel( Size( 600, 480 ) ); if ( pData->aDbgWinState ) { - ByteString aState( pData->aDbgWinState ); + rtl::OString aState( pData->aDbgWinState ); SetWindowState( aState ); } @@ -624,11 +624,11 @@ DbgWindow::DbgWindow() : sal_Bool DbgWindow::Close() { // remember window position - ByteString aState( GetWindowState() ); + rtl::OString aState( GetWindowState() ); DbgData* pData = DbgGetData(); - size_t nCopy = (sizeof( pData->aDbgWinState ) < size_t(aState.Len() + 1U )) - ? sizeof( pData->aDbgWinState ) : size_t(aState.Len() + 1U ); - strncpy( pData->aDbgWinState, aState.GetBuffer(), nCopy ); + size_t nCopy = (sizeof( pData->aDbgWinState ) < size_t(aState.getLength() + 1U )) + ? sizeof( pData->aDbgWinState ) : size_t(aState.getLength() + 1U ); + strncpy( pData->aDbgWinState, aState.getStr(), nCopy ); pData->aDbgWinState[ sizeof( pData->aDbgWinState ) - 1 ] = 0; // and save for next session DbgSaveData( *pData ); @@ -1194,11 +1194,11 @@ IMPL_LINK( DbgDialog, ClickHdl, Button*, pButton ) aData.nWarningOut = ImplGetChannelId( maWarningBox, 0 ); aData.nErrorOut = ImplGetChannelId( maErrorBox, mnErrorOff ); - strncpy( aData.aDebugName, ByteString( maDebugName.GetText(), RTL_TEXTENCODING_UTF8 ).GetBuffer(), sizeof( aData.aDebugName ) ); - strncpy( aData.aInclClassFilter, ByteString( maInclClassFilter.GetText(), RTL_TEXTENCODING_UTF8 ).GetBuffer(), sizeof( aData.aInclClassFilter ) ); - strncpy( aData.aExclClassFilter, ByteString( maExclClassFilter.GetText(), RTL_TEXTENCODING_UTF8 ).GetBuffer(), sizeof( aData.aExclClassFilter ) ); - strncpy( aData.aInclFilter, ByteString( maInclFilter.GetText(), RTL_TEXTENCODING_UTF8 ).GetBuffer(), sizeof( aData.aInclFilter ) ); - strncpy( aData.aExclFilter, ByteString( maExclFilter.GetText(), RTL_TEXTENCODING_UTF8 ).GetBuffer(), sizeof( aData.aExclFilter ) ); + strncpy( aData.aDebugName, rtl::OUStringToOString(maDebugName.GetText(), RTL_TEXTENCODING_UTF8).getStr(), sizeof( aData.aDebugName ) ); + strncpy( aData.aInclClassFilter, rtl::OUStringToOString(maInclClassFilter.GetText(), RTL_TEXTENCODING_UTF8).getStr(), sizeof( aData.aInclClassFilter ) ); + strncpy( aData.aExclClassFilter, rtl::OUStringToOString(maExclClassFilter.GetText(), RTL_TEXTENCODING_UTF8).getStr(), sizeof( aData.aExclClassFilter ) ); + strncpy( aData.aInclFilter, rtl::OUStringToOString(maInclFilter.GetText(), RTL_TEXTENCODING_UTF8).getStr(), sizeof( aData.aInclFilter ) ); + strncpy( aData.aExclFilter, rtl::OUStringToOString(maExclFilter.GetText(), RTL_TEXTENCODING_UTF8).getStr(), sizeof( aData.aExclFilter ) ); aData.aDebugName[sizeof( aData.aDebugName )-1] = '\0'; aData.aInclClassFilter[sizeof( aData.aInclClassFilter )-1] = '\0'; aData.aExclClassFilter[sizeof( aData.aExclClassFilter )-1] = '\0'; @@ -1524,7 +1524,7 @@ void DbgDialogTest( Window* pWindow ) DbgOutTypef( DBG_OUT_ERROR, "%s should have a mnemonic char (~): %s", pClass, - ByteString( aErrorText, RTL_TEXTENCODING_UTF8 ).GetBuffer() ); + rtl::OUStringToOString(aErrorText, RTL_TEXTENCODING_UTF8).getStr() ); // check text width int aWidth=0; @@ -1547,7 +1547,7 @@ void DbgDialogTest( Window* pWindow ) DbgOutTypef( DBG_OUT_ERROR, "%s exceeds window width: %s", pClass, - ByteString( aErrorText, RTL_TEXTENCODING_UTF8 ).GetBuffer() ); + rtl::OUStringToOString(aErrorText, RTL_TEXTENCODING_UTF8).getStr() ); } } @@ -1556,7 +1556,7 @@ void DbgDialogTest( Window* pWindow ) if ( pChild->GetSizePixel().Width() < pChild->GetTextWidth( aText ) ) DbgOutTypef( DBG_OUT_ERROR, "FixedLine exceeds window width: %s", - ByteString( aErrorText, RTL_TEXTENCODING_UTF8 ).GetBuffer() ); + rtl::OUStringToOString(aErrorText, RTL_TEXTENCODING_UTF8).getStr() ); } if ( pChild->GetType() == WINDOW_FIXEDTEXT ) @@ -1566,7 +1566,7 @@ void DbgDialogTest( Window* pWindow ) { DbgOutTypef( DBG_OUT_ERROR, "FixedText greater than one line, but WordBreak is not set: %s", - ByteString( aErrorText, RTL_TEXTENCODING_UTF8 ).GetBuffer() ); + rtl::OUStringToOString(aErrorText, RTL_TEXTENCODING_UTF8).getStr() ); } if ( pChild->IsVisible() ) @@ -1584,7 +1584,7 @@ void DbgDialogTest( Window* pWindow ) { DbgOutTypef( DBG_OUT_ERROR, "FixedText exceeds window width: %s", - ByteString( aErrorText, RTL_TEXTENCODING_UTF8 ).GetBuffer() ); + rtl::OUStringToOString(aErrorText, RTL_TEXTENCODING_UTF8).getStr() ); } } @@ -1614,13 +1614,13 @@ void DbgDialogTest( Window* pWindow ) { DbgOutTypef( DBG_OUT_ERROR, "Labels befor Fields (Edit,ListBox,...) should have a mnemonic char (~): %s", - ByteString( aErrorText, RTL_TEXTENCODING_UTF8 ).GetBuffer() ); + rtl::OUStringToOString(aErrorText, RTL_TEXTENCODING_UTF8).getStr() ); } if ( !pTempChild->IsEnabled() && pChild->IsEnabled() ) { DbgOutTypef( DBG_OUT_ERROR, "Labels befor Fields (Edit,ListBox,...) should be disabled, when the field is disabled: %s", - ByteString( aErrorText, RTL_TEXTENCODING_UTF8 ).GetBuffer() ); + rtl::OUStringToOString(aErrorText, RTL_TEXTENCODING_UTF8).getStr() ); } } } @@ -1712,7 +1712,7 @@ void DbgDialogTest( Window* pWindow ) { DbgOutTypef( DBG_OUT_ERROR, "No Max-Value is set: %s", - ByteString( aErrorText, RTL_TEXTENCODING_UTF8 ).GetBuffer() ); + rtl::OUStringToOString(aErrorText, RTL_TEXTENCODING_UTF8).getStr() ); } if ( (pChild->GetType() == WINDOW_RADIOBUTTON) || @@ -1755,7 +1755,7 @@ void DbgDialogTest( Window* pWindow ) { DbgOutTypef( DBG_OUT_ERROR, "Possible wrong childorder for dialogcontrol: %s", - ByteString( aErrorText, RTL_TEXTENCODING_UTF8 ).GetBuffer() ); + rtl::OUStringToOString(aErrorText, RTL_TEXTENCODING_UTF8).getStr() ); } aTabPos = aNewPos; } @@ -1767,7 +1767,7 @@ void DbgDialogTest( Window* pWindow ) { DbgOutTypef( DBG_OUT_ERROR, "Window overlaps with sibling window: %s", - ByteString( aErrorText, RTL_TEXTENCODING_UTF8 ).GetBuffer() ); + rtl::OUStringToOString(aErrorText, RTL_TEXTENCODING_UTF8).getStr() ); } } pRectAry[i] = aChildRect; diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 103c9a51f383..52eb43ee56ad 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -164,8 +164,8 @@ XubString Button::GetStandardText( StandardButtonType eButton ) } else { - ByteString aT( aResIdAry[(sal_uInt16)eButton].pDefText ); - aText = String( aT, RTL_TEXTENCODING_ASCII_US ); + rtl::OString aT( aResIdAry[(sal_uInt16)eButton].pDefText ); + aText = rtl::OStringToOUString(aT, RTL_TEXTENCODING_ASCII_US); } return aText; } diff --git a/vcl/source/control/quickselectionengine.cxx b/vcl/source/control/quickselectionengine.cxx index ee479d27ab20..aed84b38c1f1 100644 --- a/vcl/source/control/quickselectionengine.cxx +++ b/vcl/source/control/quickselectionengine.cxx @@ -134,7 +134,7 @@ namespace vcl if ( ( c >= 32 ) && ( c != 127 ) && !_keyEvent.GetKeyCode().IsMod2() ) { m_pData->sCurrentSearchString += c; - OSL_TRACE( "QuickSelectionEngine::HandleKeyEvent: searching for %s", ByteString( m_pData->sCurrentSearchString, RTL_TEXTENCODING_UTF8 ).GetBuffer() ); + OSL_TRACE( "QuickSelectionEngine::HandleKeyEvent: searching for %s", rtl::OUStringToOString(m_pData->sCurrentSearchString, RTL_TEXTENCODING_UTF8).getStr() ); if ( m_pData->sCurrentSearchString.Len() == 1 ) { // first character in the search -> remmeber diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx index c192431e87e6..f80b08cdee27 100644 --- a/vcl/source/helper/strhelper.cxx +++ b/vcl/source/helper/strhelper.cxx @@ -220,8 +220,7 @@ rtl::OString GetCommandLineToken(int nToken, const rtl::OString& rLine) *pLeap = 0; - ByteString aRet( pBuffer ); - return aRet; + return rtl::OString(pBuffer); } int GetCommandLineTokenCount( const String& rLine ) diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 6a3331d5cbc4..f4e5622d1d8e 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -35,6 +35,8 @@ #include <window.h> #include <brdwin.hxx> +#include <rtl/strbuf.hxx> + #include <vcl/svapp.hxx> #include <vcl/event.hxx> #include <vcl/wrkwin.hxx> @@ -55,19 +57,21 @@ #ifdef DBG_UTIL -static ByteString ImplGetDialogText( Dialog* pDialog ) +static rtl::OString ImplGetDialogText( Dialog* pDialog ) { - ByteString aErrorStr( pDialog->GetText(), RTL_TEXTENCODING_UTF8 ); + rtl::OStringBuffer aErrorStr(rtl::OUStringToOString( + pDialog->GetText(), RTL_TEXTENCODING_UTF8)); if ( (pDialog->GetType() == WINDOW_MESSBOX) || (pDialog->GetType() == WINDOW_INFOBOX) || (pDialog->GetType() == WINDOW_WARNINGBOX) || (pDialog->GetType() == WINDOW_ERRORBOX) || (pDialog->GetType() == WINDOW_QUERYBOX) ) { - aErrorStr += ", "; - aErrorStr += ByteString( ((MessBox*)pDialog)->GetMessText(), RTL_TEXTENCODING_UTF8 ); + aErrorStr.append(", "); + aErrorStr.append(rtl::OUStringToOString( + ((MessBox*)pDialog)->GetMessText(), RTL_TEXTENCODING_UTF8)); } - return aErrorStr; + return aErrorStr.makeStringAndClear(); } #endif @@ -590,9 +594,10 @@ sal_Bool Dialog::ImplStartExecuteModal() if ( mbInExecute ) { #ifdef DBG_UTIL - ByteString aErrorStr( "Dialog::StartExecuteModal() is called in Dialog::StartExecuteModal(): " ); - aErrorStr += ImplGetDialogText( this ); - OSL_FAIL( aErrorStr.GetBuffer() ); + rtl::OStringBuffer aErrorStr; + aErrorStr.append(RTL_CONSTASCII_STRINGPARAM("Dialog::StartExecuteModal() is called in Dialog::StartExecuteModal(): ")); + aErrorStr.append(ImplGetDialogText(this)); + OSL_FAIL(aErrorStr.getStr()); #endif return sal_False; } @@ -600,9 +605,10 @@ sal_Bool Dialog::ImplStartExecuteModal() if ( Application::IsDialogCancelEnabled() ) { #ifdef DBG_UTIL - ByteString aErrorStr( "Dialog::StartExecuteModal() is called in a none UI application: " ); - aErrorStr += ImplGetDialogText( this ); - OSL_FAIL( aErrorStr.GetBuffer() ); + rtl::OStringBuffer aErrorStr; + aErrorStr.append(RTL_CONSTASCII_STRINGPARAM("Dialog::StartExecuteModal() is called in a none UI application: ")); + aErrorStr.append(ImplGetDialogText(this)); + OSL_FAIL(aErrorStr.getStr()); #endif return sal_False; } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 2d99e550e167..d0646e09a8d8 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -97,6 +97,7 @@ #include "com/sun/star/accessibility/AccessibleRole.hpp" #include <sal/macros.h> +#include <rtl/strbuf.hxx> #include <set> #include <typeinfo> @@ -4351,12 +4352,17 @@ Window::~Window() } if ( bError ) { - ByteString aTempStr( "Window (" ); - aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 ); - aTempStr += ") with living SystemWindow(s) destroyed: "; - aTempStr += aErrorStr; - OSL_FAIL( aTempStr.GetBuffer() ); - GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed! + rtl::OStringBuffer aTempStr; + aTempStr.append(RTL_CONSTASCII_STRINGPARAM("Window (")); + aTempStr.append(rtl::OUStringToOString(GetText(), + RTL_TEXTENCODING_UTF8)); + aTempStr.append(RTL_CONSTASCII_STRINGPARAM( + ") with living SystemWindow(s) destroyed: ")); + aTempStr.append(aErrorStr); + OSL_FAIL(aTempStr.getStr()); + // abort in non-pro version, this must be fixed! + GetpApp()->Abort(rtl::OStringToOUString( + aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); } bError = sal_False; |