diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-09 22:36:22 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-10 09:28:39 +0000 |
commit | 5dbd8286f4623015d6012d20ad24c301e57ca96f (patch) | |
tree | 6db4a82962dd7436aa4dae33c59a5a47559103bf | |
parent | 180dcdecac80e87f4984024c24f4beeef9dbf766 (diff) |
ByteString->rtl::OString
-rw-r--r-- | sot/source/sdstor/stgole.cxx | 6 | ||||
-rw-r--r-- | sot/source/sdstor/storinfo.cxx | 7 | ||||
-rw-r--r-- | svtools/inc/svtools/transfer.hxx | 2 | ||||
-rw-r--r-- | svtools/source/filter/filter2.cxx | 54 | ||||
-rw-r--r-- | svtools/source/misc/transfer.cxx | 31 | ||||
-rw-r--r-- | svtools/source/misc/transfer2.cxx | 4 | ||||
-rw-r--r-- | svx/source/gallery2/galobj.cxx | 4 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap2.cxx | 4 | ||||
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 18 |
9 files changed, 65 insertions, 65 deletions
diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx index 8ae6af18f7b7..091704614574 100644 --- a/sot/source/sdstor/stgole.cxx +++ b/sot/source/sdstor/stgole.cxx @@ -153,14 +153,14 @@ sal_Bool StgCompObjStream::Store() if( GetError() != SVSTREAM_OK ) return sal_False; Seek( 0L ); - ByteString aAsciiUserName( aUserName, RTL_TEXTENCODING_MS_1252 ); + rtl::OString aAsciiUserName(rtl::OUStringToOString(aUserName, RTL_TEXTENCODING_MS_1252)); *this << (sal_Int16) 1 // Version? << (sal_Int16) -2 // 0xFFFE = Byte Order Indicator << (sal_Int32) 0x0A03 // Windows 3.10 << (sal_Int32) -1L << aClsId // Class ID - << (sal_Int32) (aAsciiUserName.Len() + 1) - << (const char *)aAsciiUserName.GetBuffer() + << (sal_Int32) (aAsciiUserName.getLength() + 1) + << (const char *)aAsciiUserName.getStr() << (sal_uInt8) 0; // string terminator WriteClipboardFormat( *this, nCbFormat ); *this << (sal_Int32) 0; // terminator diff --git a/sot/source/sdstor/storinfo.cxx b/sot/source/sdstor/storinfo.cxx index 5f1768b8e7ef..4d609cb6eeea 100644 --- a/sot/source/sdstor/storinfo.cxx +++ b/sot/source/sdstor/storinfo.cxx @@ -82,9 +82,10 @@ void WriteClipboardFormat( SvStream & rStm, sal_uLong nFormat ) aCbFmt = SotExchange::GetFormatName( nFormat ); if( aCbFmt.Len() ) { - ByteString aAsciiCbFmt( aCbFmt, RTL_TEXTENCODING_ASCII_US ); - rStm << (sal_Int32) (aAsciiCbFmt.Len() + 1); - rStm << (const char *)aAsciiCbFmt.GetBuffer(); + rtl::OString aAsciiCbFmt(rtl::OUStringToOString(aCbFmt, + RTL_TEXTENCODING_ASCII_US)); + rStm << (sal_Int32) (aAsciiCbFmt.getLength() + 1); + rStm << (const char *)aAsciiCbFmt.getStr(); rStm << (sal_uInt8) 0; } else if( nFormat ) diff --git a/svtools/inc/svtools/transfer.hxx b/svtools/inc/svtools/transfer.hxx index 3b0d961a3623..b62a8130f82d 100644 --- a/svtools/inc/svtools/transfer.hxx +++ b/svtools/inc/svtools/transfer.hxx @@ -569,7 +569,7 @@ public: void CopyString( sal_uInt16 nFmt, const String& rStr ); void CopyAny( sal_uInt16 nFmt, const ::com::sun::star::uno::Any& rAny ); - void CopyByteString( sal_uLong nFormatId, const ByteString& rStr ); + void CopyByteString( sal_uLong nFormatId, const rtl::OString& rStr ); void CopyAnyData( sal_uLong nFormatId, const sal_Char* pData, sal_uLong nLen ); sal_Bool HasAnyData() const; diff --git a/svtools/source/filter/filter2.cxx b/svtools/source/filter/filter2.cxx index b973c9bdb3b0..f8347c5d825f 100644 --- a/svtools/source/filter/filter2.cxx +++ b/svtools/source/filter/filter2.cxx @@ -1318,38 +1318,38 @@ sal_Bool GraphicDescriptor::ImpDetectSVG( SvStream& /*rStm*/, sal_Bool /*bExtend String GraphicDescriptor::GetImportFormatShortName( sal_uInt16 nFormat ) { - ByteString aKeyName; + const char *pKeyName = 0; switch( nFormat ) { - case( GFF_BMP ) : aKeyName = "bmp"; break; - case( GFF_GIF ) : aKeyName = "gif"; break; - case( GFF_JPG ) : aKeyName = "jpg"; break; - case( GFF_PCD ) : aKeyName = "pcd"; break; - case( GFF_PCX ) : aKeyName = "pcx"; break; - case( GFF_PNG ) : aKeyName = "png"; break; - case( GFF_XBM ) : aKeyName = "xbm"; break; - case( GFF_XPM ) : aKeyName = "xpm"; break; - case( GFF_PBM ) : aKeyName = "pbm"; break; - case( GFF_PGM ) : aKeyName = "pgm"; break; - case( GFF_PPM ) : aKeyName = "ppm"; break; - case( GFF_RAS ) : aKeyName = "ras"; break; - case( GFF_TGA ) : aKeyName = "tga"; break; - case( GFF_PSD ) : aKeyName = "psd"; break; - case( GFF_EPS ) : aKeyName = "eps"; break; - case( GFF_TIF ) : aKeyName = "tif"; break; - case( GFF_DXF ) : aKeyName = "dxf"; break; - case( GFF_MET ) : aKeyName = "met"; break; - case( GFF_PCT ) : aKeyName = "pct"; break; - case( GFF_SGF ) : aKeyName = "sgf"; break; - case( GFF_SGV ) : aKeyName = "sgv"; break; - case( GFF_SVM ) : aKeyName = "svm"; break; - case( GFF_WMF ) : aKeyName = "wmf"; break; - case( GFF_EMF ) : aKeyName = "emf"; break; - case( GFF_SVG ) : aKeyName = "svg"; break; + case( GFF_BMP ) : pKeyName = "bmp"; break; + case( GFF_GIF ) : pKeyName = "gif"; break; + case( GFF_JPG ) : pKeyName = "jpg"; break; + case( GFF_PCD ) : pKeyName = "pcd"; break; + case( GFF_PCX ) : pKeyName = "pcx"; break; + case( GFF_PNG ) : pKeyName = "png"; break; + case( GFF_XBM ) : pKeyName = "xbm"; break; + case( GFF_XPM ) : pKeyName = "xpm"; break; + case( GFF_PBM ) : pKeyName = "pbm"; break; + case( GFF_PGM ) : pKeyName = "pgm"; break; + case( GFF_PPM ) : pKeyName = "ppm"; break; + case( GFF_RAS ) : pKeyName = "ras"; break; + case( GFF_TGA ) : pKeyName = "tga"; break; + case( GFF_PSD ) : pKeyName = "psd"; break; + case( GFF_EPS ) : pKeyName = "eps"; break; + case( GFF_TIF ) : pKeyName = "tif"; break; + case( GFF_DXF ) : pKeyName = "dxf"; break; + case( GFF_MET ) : pKeyName = "met"; break; + case( GFF_PCT ) : pKeyName = "pct"; break; + case( GFF_SGF ) : pKeyName = "sgf"; break; + case( GFF_SGV ) : pKeyName = "sgv"; break; + case( GFF_SVM ) : pKeyName = "svm"; break; + case( GFF_WMF ) : pKeyName = "wmf"; break; + case( GFF_EMF ) : pKeyName = "emf"; break; + case( GFF_SVG ) : pKeyName = "svg"; break; } - return String( aKeyName, RTL_TEXTENCODING_ASCII_US ); + return rtl::OUString::createFromAscii(pKeyName); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index 71763b95915a..9e45b8955b60 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -446,7 +446,7 @@ Any SAL_CALL TransferableHelper::getTransferData( const DataFlavor& rFlavor ) th #ifdef DEBUG if( maAny.hasValue() && ::com::sun::star::uno::TypeClass_STRING != maAny.getValueType().getTypeClass() ) - fprintf( stderr, "TransferableHelper delivers sequence of data [ %s ]\n", ByteString( String( rFlavor.MimeType), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); + fprintf( stderr, "TransferableHelper delivers sequence of data [ %s ]\n", rtl::OUStringToOString(rFlavor.MimeType, RTL_TEXTENCODING_ASCII_US).getStr() ); #endif } catch( const ::com::sun::star::uno::Exception& ) @@ -667,7 +667,7 @@ void TransferableHelper::AddFormat( const DataFlavor& rFlavor ) #ifdef DEBUG fprintf( stderr, "TransferableHelper exchanged objectdescriptor [ %s ]\n", - ByteString( String( aIter->MimeType), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); + rtl::OUStringToOString(aIter->MimeType, RTL_TEXTENCODING_ASCII_US).getStr() ); #endif } @@ -780,12 +780,11 @@ sal_Bool TransferableHelper::SetString( const ::rtl::OUString& rString, const Da SotExchange::GetFormatDataFlavor( FORMAT_FILE, aFileFlavor ) && TransferableDataHelper::IsEqual( aFileFlavor, rFlavor ) ) { - const String aString( rString ); - const ByteString aByteStr( aString, osl_getThreadTextEncoding() ); - Sequence< sal_Int8 > aSeq( aByteStr.Len() + 1 ); + const rtl::OString aByteStr(rtl::OUStringToOString(rString, osl_getThreadTextEncoding())); + Sequence< sal_Int8 > aSeq( aByteStr.getLength() + 1 ); - rtl_copyMemory( aSeq.getArray(), aByteStr.GetBuffer(), aByteStr.Len() ); - aSeq[ aByteStr.Len() ] = 0; + rtl_copyMemory( aSeq.getArray(), aByteStr.getStr(), aByteStr.getLength() ); + aSeq[ aByteStr.getLength() ] = 0; maAny <<= aSeq; } else @@ -900,9 +899,9 @@ sal_Bool TransferableHelper::SetINetBookmark( const INetBookmark& rBmk, case( SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR ): { - ByteString sURL( rBmk.GetURL(), eSysCSet ); - Sequence< sal_Int8 > aSeq( sURL.Len() ); - memcpy( aSeq.getArray(), sURL.GetBuffer(), sURL.Len() ); + rtl::OString sURL(rtl::OUStringToOString(rBmk.GetURL(), eSysCSet)); + Sequence< sal_Int8 > aSeq( sURL.getLength() ); + memcpy( aSeq.getArray(), sURL.getStr(), sURL.getLength() ); maAny <<= aSeq; } break; @@ -912,8 +911,8 @@ sal_Bool TransferableHelper::SetINetBookmark( const INetBookmark& rBmk, Sequence< sal_Int8 > aSeq( 2048 ); memset( aSeq.getArray(), 0, 2048 ); - strcpy( reinterpret_cast< char* >( aSeq.getArray() ), ByteString( rBmk.GetURL(), eSysCSet).GetBuffer() ); - strcpy( reinterpret_cast< char* >( aSeq.getArray() ) + 1024, ByteString( rBmk.GetDescription(), eSysCSet ).GetBuffer() ); + strcpy( reinterpret_cast< char* >( aSeq.getArray() ), rtl::OUStringToOString(rBmk.GetURL(), eSysCSet).getStr() ); + strcpy( reinterpret_cast< char* >( aSeq.getArray() ) + 1024, rtl::OUStringToOString(rBmk.GetDescription(), eSysCSet).getStr() ); maAny <<= aSeq; } @@ -2106,11 +2105,11 @@ sal_Bool TransferableDataHelper::GetFileList( { if( aFlavor.MimeType.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "text/uri-list" )) ) > -1 ) { - ByteString aByteString; + rtl::OString aDiskString; - while( xStm->ReadLine( aByteString ) ) - if( aByteString.Len() && aByteString.GetChar( 0 ) != '#' ) - rFileList.AppendFile( String( aByteString, RTL_TEXTENCODING_UTF8 ) ); + while( xStm->ReadLine( aDiskString ) ) + if( aDiskString.getLength() && aDiskString[0] != '#' ) + rFileList.AppendFile( rtl::OStringToOUString(aDiskString, RTL_TEXTENCODING_UTF8) ); bRet = sal_True; } diff --git a/svtools/source/misc/transfer2.cxx b/svtools/source/misc/transfer2.cxx index fe8921061f8f..d8ffe9ec9697 100644 --- a/svtools/source/misc/transfer2.cxx +++ b/svtools/source/misc/transfer2.cxx @@ -511,9 +511,9 @@ void TransferDataContainer::CopyAnyData( sal_uLong nFormatId, // ----------------------------------------------------------------------------- void TransferDataContainer::CopyByteString( sal_uLong nFormatId, - const ByteString& rStr ) + const rtl::OString& rStr ) { - CopyAnyData( nFormatId, rStr.GetBuffer(), rStr.Len() ); + CopyAnyData( nFormatId, rStr.getStr(), rStr.getLength() ); } // ----------------------------------------------------------------------------- diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index d86553ace8c8..928e060e338e 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -208,8 +208,8 @@ const String SgaObject::GetTitle() const if ( aReturnValue.GetToken( 0, ':' ).EqualsAscii( "private" ) && aResourceName.Len() && ( nResId > 0 ) && ( nResId < 0x10000 ) ) { - ByteString aMgrName( aResourceName, RTL_TEXTENCODING_UTF8 ); - ResMgr* pResMgr = ResMgr::CreateResMgr( aMgrName.GetBuffer(), + rtl::OString aMgrName(rtl::OUStringToOString(aResourceName, RTL_TEXTENCODING_UTF8)); + ResMgr* pResMgr = ResMgr::CreateResMgr( aMgrName.getStr(), Application::GetSettings().GetUILocale() ); if ( pResMgr ) { diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 8e597f71330a..1dcee2b356b6 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1529,8 +1529,8 @@ bool SvxGraphicObject::setPropertyValueImpl( const ::rtl::OUString& rName, const // graphic manager url aURL = aURL.copy( sizeof( UNO_NAME_GRAPHOBJ_URLPREFIX ) - 1 ); String aTmpStr(aURL); - ByteString aUniqueID( aTmpStr, RTL_TEXTENCODING_UTF8 ); - GraphicObject aGrafObj( aUniqueID ); + rtl::OString aUniqueID(rtl::OUStringToOString(aTmpStr, RTL_TEXTENCODING_UTF8)); + GraphicObject aGrafObj(aUniqueID); // #101808# since loading a graphic can cause a reschedule of the office // it is possible that our shape is removed while where in this diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index f7330dc40ec3..7a2f20a3dd22 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -29,6 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" #include <sal/macros.h> +#include <rtl/strbuf.hxx> #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -115,8 +116,7 @@ public: SvXMLGraphicInputStream::SvXMLGraphicInputStream( const ::rtl::OUString& rGraphicId ) { - String aGraphicId( rGraphicId ); - GraphicObject aGrfObject( ByteString( aGraphicId, RTL_TEXTENCODING_ASCII_US ) ); + GraphicObject aGrfObject( rtl::OUStringToOString(rGraphicId, RTL_TEXTENCODING_ASCII_US) ); maTmp.EnableKillingFile(); @@ -584,8 +584,7 @@ sal_Bool SvXMLGraphicHelper::ImplWriteGraphic( const ::rtl::OUString& rPictureSt const ::rtl::OUString& rGraphicId, bool bUseGfxLink ) { - String aGraphicId( rGraphicId ); - GraphicObject aGrfObject( ByteString( aGraphicId, RTL_TEXTENCODING_ASCII_US ) ); + GraphicObject aGrfObject( rtl::OUStringToOString(rGraphicId, RTL_TEXTENCODING_ASCII_US) ); sal_Bool bRet = sal_False; if( aGrfObject.GetType() != GRAPHIC_NONE ) @@ -709,7 +708,7 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s else { const String aGraphicObjectId( aPictureStreamName ); - const ByteString aAsciiObjectID( aGraphicObjectId, RTL_TEXTENCODING_ASCII_US ); + const rtl::OString aAsciiObjectID(rtl::OUStringToOString(aGraphicObjectId, RTL_TEXTENCODING_ASCII_US)); const GraphicObject aGrfObject( aAsciiObjectID ); if( aGrfObject.GetType() != GRAPHIC_NONE ) { @@ -802,10 +801,11 @@ void SvXMLGraphicHelper::ImplInsertGraphicURL( const ::rtl::OUString& rURLStr, s #if OSL_DEBUG_LEVEL > 0 else { - ByteString sMessage = "graphic object with ID '"; - sMessage += aAsciiObjectID; - sMessage += "' has an unknown type"; - OSL_ENSURE( false, sMessage.GetBuffer() ); + rtl::OStringBuffer sMessage( + RTL_CONSTASCII_STRINGPARAM("graphic object with ID '")); + sMessage.append(aAsciiObjectID). + append(RTL_CONSTASCII_STRINGPARAM("' has an unknown type")); + OSL_ENSURE( false, sMessage.getStr() ); } #endif } |