diff options
25 files changed, 132 insertions, 140 deletions
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index c90e0f2e036c..446d5cad9c33 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -213,7 +213,7 @@ DlgEditor::DlgEditor( const ::com::sun::star::uno::Reference< ::com::sun::star:: SdrLayerAdmin& rAdmin = pDlgEdModel->GetLayerAdmin(); rAdmin.NewLayer( rAdmin.GetControlLayerName() ); - rAdmin.NewLayer( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ) ); + rAdmin.NewLayer( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HiddenLayer")) ); pDlgEdPage = new DlgEdPage( *pDlgEdModel ); pDlgEdModel->InsertPage( pDlgEdPage ); @@ -270,7 +270,7 @@ void DlgEditor::SetWindow( Window* pWindow_ ) pDlgEdView = new DlgEdView( pDlgEdModel, pWindow_, this ); pDlgEdView->ShowSdrPage(pDlgEdView->GetModel()->GetPage(0)); - pDlgEdView->SetLayerVisible( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ), sal_False ); + pDlgEdView->SetLayerVisible( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HiddenLayer")), sal_False ); pDlgEdView->SetMoveSnapOnlyTopLeft( sal_True ); pDlgEdView->SetWorkArea( Rectangle( Point( 0, 0 ), pDlgEdPage->GetSize() ) ); diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx index 4c92728e57d7..53e58df99221 100644 --- a/cppcanvas/source/mtfrenderer/emfplus.cxx +++ b/cppcanvas/source/mtfrenderer/emfplus.cxx @@ -748,17 +748,19 @@ namespace cppcanvas filter.ImportGraphic (graphic, String (), mfStream); // debug code - write the stream to debug file /tmp/emf-stream.emf - EMFP_DEBUG(mfStream.Seek(0); - static int emfp_debug_stream_numnber = 0; - UniString emfp_debug_filename = UniString::CreateFromAscii( "/tmp/emf-embedded-stream" ); - emfp_debug_filename.Append( UniString::CreateFromInt32( emfp_debug_stream_numnber++ )); - emfp_debug_filename.Append( UniString::CreateFromAscii( ".emf" )); - - SvFileStream file( emfp_debug_filename, STREAM_WRITE | STREAM_TRUNC ); - - mfStream >> file; - file.Flush(); - file.Close()); + EMFP_DEBUG( + mfStream.Seek(0); + static int emfp_debug_stream_numnber = 0; + rtl::OUString emfp_debug_filename("/tmp/emf-embedded-stream"); + emfp_debug_filename += rtl::OUString::valueOf(emfp_debug_stream_numnber++); + emfp_debug_filename += rtl::OUString(".emf"); + + SvFileStream file( emfp_debug_filename, STREAM_WRITE | STREAM_TRUNC ); + + mfStream >> file; + file.Flush(); + file.Close() + ); } } }; @@ -766,33 +768,33 @@ namespace cppcanvas struct EMFPFont : public EMFPObject { sal_uInt32 version; - float emSize; - sal_uInt32 sizeUnit; - sal_Int32 fontFlags; - rtl::OUString family; + float emSize; + sal_uInt32 sizeUnit; + sal_Int32 fontFlags; + rtl::OUString family; void Read (SvMemoryStream &s) { sal_uInt32 header; - sal_uInt32 reserved; - sal_uInt32 length; + sal_uInt32 reserved; + sal_uInt32 length; s >> header >> emSize >> sizeUnit >> fontFlags >> reserved >> length; - OSL_ASSERT( ( header >> 12 ) == 0xdbc01 ); + OSL_ASSERT( ( header >> 12 ) == 0xdbc01 ); EMFP_DEBUG (printf ("EMF+\tfont\nEMF+\theader: 0x%08x version: 0x%08x size: %f unit: 0x%08x\n",(unsigned int) header >> 12, (unsigned int)header & 0x1fff, emSize, (unsigned int)sizeUnit)); EMFP_DEBUG (printf ("EMF+\tflags: 0x%08x reserved: 0x%08x length: 0x%08x\n", (unsigned int)fontFlags, (unsigned int)reserved, (unsigned int)length)); - if( length > 0 && length < 0x4000 ) { - sal_Unicode *chars = (sal_Unicode *) alloca( sizeof( sal_Unicode ) * length ); + if( length > 0 && length < 0x4000 ) { + sal_Unicode *chars = (sal_Unicode *) alloca( sizeof( sal_Unicode ) * length ); - for( sal_uInt32 i = 0; i < length; i++ ) - s >> chars[ i ]; + for( sal_uInt32 i = 0; i < length; i++ ) + s >> chars[ i ]; - family = ::rtl::OUString( chars, length ); - EMFP_DEBUG (printf ("EMF+\tfamily: %s\n", rtl::OUStringToOString( family, RTL_TEXTENCODING_UTF8).getStr())); - } + family = ::rtl::OUString( chars, length ); + EMFP_DEBUG (printf ("EMF+\tfamily: %s\n", rtl::OUStringToOString( family, RTL_TEXTENCODING_UTF8).getStr())); + } } }; @@ -893,7 +895,7 @@ namespace cppcanvas rState.isFillColorSet = true; rState.isLineColorSet = false; - SET_FILL_COLOR(brushIndexOrColor); + SET_FILL_COLOR(brushIndexOrColor); pPolyAction = ActionSharedPtr ( internal::PolyPolyActionFactory::createPolyPolyAction( localPolygon, rParms.mrCanvas, rState ) ); diff --git a/cui/source/inc/dialmgr.hxx b/cui/source/inc/dialmgr.hxx index 29d3eef8bf69..9737fbb6419a 100644 --- a/cui/source/inc/dialmgr.hxx +++ b/cui/source/inc/dialmgr.hxx @@ -34,9 +34,9 @@ // forward --------------------------------------------------------------- -#define CUI_MGR() (*CuiResMgr::GetResMgr()) +#define CUI_MGR() (*CuiResMgr::GetResMgr()) #define CUI_RES(i) ResId(i,CUI_MGR()) -#define CUI_RESSTR(i) UniString(ResId(i,CUI_MGR())) +#define CUI_RESSTR(i) ResId::toString(ResId(i,CUI_MGR())) class ResMgr; struct CuiResMgr diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index a2340aa5499b..2963f1209744 100644 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -601,7 +601,7 @@ sal_Bool EdtAutoCorrDoc::SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, { SfxItemPool* pPool = &pImpEE->GetEditDoc().GetItemPool(); while ( pPool->GetSecondaryPool() && - !pPool->GetName().EqualsAscii( "EditEngineItemPool" ) ) + !pPool->GetName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EditEngineItemPool")) ) { pPool = pPool->GetSecondaryPool(); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index e8c2c1b2f0f5..5a23d6236fc3 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -169,12 +169,14 @@ EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, EditSelection aSel ) // The SvRTF parser expects the Which-mapping passed on in the pool, not // dependant on a secondary. SfxItemPool* pPool = &aEditDoc.GetItemPool(); - while ( pPool->GetSecondaryPool() && !pPool->GetName().EqualsAscii( "EditEngineItemPool" ) ) + while (pPool->GetSecondaryPool() && !pPool->GetName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EditEngineItemPool"))) { pPool = pPool->GetSecondaryPool(); } - DBG_ASSERT( pPool && pPool->GetName().EqualsAscii( "EditEngineItemPool" ), "ReadRTF: no EditEnginePool!" ); + + DBG_ASSERT(pPool && pPool->GetName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EditEngineItemPool")), + "ReadRTF: no EditEnginePool!"); EditRTFParserRef xPrsr = new EditRTFParser( rInput, aSel, *pPool, this ); SvParserState eState = xPrsr->CallParser(); diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index c2dbce821897..3cca643ea635 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -4108,7 +4108,7 @@ SvxBrushItem::SvxBrushItem( const CntWallpaperItem& rItem, sal_uInt16 _nWhich ) { aColor = rItem.GetColor(); - if( rItem.GetBitmapURL().Len() ) + if (!rItem.GetBitmapURL().isEmpty()) { pStrLink = new String( rItem.GetBitmapURL() ); SetGraphicPos( WallpaperStyle2GraphicPos((WallpaperStyle)rItem.GetStyle() ) ); diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index 36986d1c2efb..d7736d1c7878 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -1197,7 +1197,7 @@ SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) const SfxItemPool *pPool = SfxItemPool::GetStoringPool(); const bool bStoreDefTabs = pPool - && pPool->GetName().EqualsAscii("SWG") + && pPool->GetName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SWG")) && ::IsDefaultItem( this ); const short nTabs = Count(); diff --git a/svl/inc/svl/cntwall.hxx b/svl/inc/svl/cntwall.hxx index 5e7828641c8f..8e3bfd14a710 100644 --- a/svl/inc/svl/cntwall.hxx +++ b/svl/inc/svl/cntwall.hxx @@ -40,9 +40,9 @@ class SvStream; class SVL_DLLPUBLIC CntWallpaperItem : public SfxPoolItem { private: - UniString _aURL; + rtl::OUString _aURL; Color _nColor; - sal_uInt16 _nStyle; + sal_uInt16 _nStyle; public: TYPEINFO(); @@ -64,13 +64,13 @@ public: virtual bool PutValue ( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); - void SetBitmapURL( const UniString& rURL ) { _aURL = rURL; } + void SetBitmapURL( const rtl::OUString& rURL ) { _aURL = rURL; } void SetColor( Color nColor ) { _nColor = nColor; } void SetStyle( sal_uInt16 nStyle ) { _nStyle = nStyle; } - const UniString& GetBitmapURL() const { return _aURL; } + const rtl::OUString& GetBitmapURL() const { return _aURL; } Color GetColor() const { return _nColor; } - sal_uInt16 GetStyle() const { return _nStyle; } + sal_uInt16 GetStyle() const { return _nStyle; } }; //////////////////////////////////////////////////////////////////////////////// diff --git a/svl/inc/svl/httpcook.hxx b/svl/inc/svl/httpcook.hxx index 40bf4e408015..2da2668c09a4 100644 --- a/svl/inc/svl/httpcook.hxx +++ b/svl/inc/svl/httpcook.hxx @@ -106,10 +106,10 @@ struct CntHTTPCookie void read (SvStream& rStrm, bool bUnicode) { - SfxPoolItem::readUnicodeString(rStrm, m_aName, bUnicode); - SfxPoolItem::readUnicodeString(rStrm, m_aValue, bUnicode); - SfxPoolItem::readUnicodeString(rStrm, m_aDomain, bUnicode); - SfxPoolItem::readUnicodeString(rStrm, m_aPath, bUnicode); + m_aName = SfxPoolItem::readUnicodeString(rStrm, bUnicode); + m_aValue = SfxPoolItem::readUnicodeString(rStrm, bUnicode); + m_aDomain = SfxPoolItem::readUnicodeString(rStrm, bUnicode); + m_aPath = SfxPoolItem::readUnicodeString(rStrm, bUnicode); sal_uInt32 nValue = 0; rStrm >> nValue; diff --git a/svl/inc/svl/itempool.hxx b/svl/inc/svl/itempool.hxx index 91389cfa69f7..15e88e91e0c1 100644 --- a/svl/inc/svl/itempool.hxx +++ b/svl/inc/svl/itempool.hxx @@ -144,7 +144,7 @@ protected: public: SfxItemPool( const SfxItemPool &rPool, sal_Bool bCloneStaticDefaults = sal_False ); - SfxItemPool( const UniString &rName, + SfxItemPool( const rtl::OUString &rName, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxItemInfo *pItemInfos, SfxPoolItem **pDefaults = 0, @@ -173,7 +173,7 @@ public: const IntlWrapper * pIntlWrapper = 0 ) const; virtual SfxItemPool* Clone() const; - const UniString& GetName() const; + const rtl::OUString& GetName() const; virtual const SfxPoolItem& Put( const SfxPoolItem&, sal_uInt16 nWhich = 0 ); virtual void Remove( const SfxPoolItem& ); diff --git a/svl/inc/svl/poolitem.hxx b/svl/inc/svl/poolitem.hxx index 3e4173279859..bcc96c1ac2d8 100644 --- a/svl/inc/svl/poolitem.hxx +++ b/svl/inc/svl/poolitem.hxx @@ -245,7 +245,7 @@ public: @return True if the string was successfuly read and reconstructed. */ - static bool readByteString(SvStream & rStream, UniString & rString); + static rtl::OUString readByteString(SvStream & rStream); /** Write a byte string representation of a Unicode string into a stream. @@ -255,7 +255,7 @@ public: @param rString Some Unicode string. */ static void writeByteString(SvStream & rStream, - UniString const & rString); + const rtl::OUString& rString); /** Read in a Unicode string from either a streamed Unicode or byte string representation. @@ -263,15 +263,12 @@ public: @param rStream Some (input) stream. If bUnicode is false, its Stream/TargetCharSets must be set to correct values! - @param rString On success, returns the reconstructed Unicode string. - @param bUnicode Whether to read in a stream Unicode (true) or byte string (false) representation. - @return True if the string was successfuly read and reconstructed. + @return On success, returns the reconstructed Unicode string. */ - static bool readUnicodeString(SvStream & rStream, UniString & rString, - bool bUnicode); + static rtl::OUString readUnicodeString(SvStream & rStream, bool bUnicode); /** Write a Unicode string representation of a Unicode string into a stream. @@ -281,7 +278,7 @@ public: @param rString Some Unicode string. */ static void writeUnicodeString(SvStream & rStream, - UniString const & rString); + const rtl::OUString& rString); private: SfxPoolItem& operator=( const SfxPoolItem& ); // n.i.!! diff --git a/svl/inc/svl/urihelper.hxx b/svl/inc/svl/urihelper.hxx index 61be9f6c831d..087222f5fc4d 100644 --- a/svl/inc/svl/urihelper.hxx +++ b/svl/inc/svl/urihelper.hxx @@ -43,7 +43,6 @@ namespace com { namespace sun { namespace star { } } } namespace rtl { class OUString; } class CharClass; -class UniString; //============================================================================ namespace URIHelper { @@ -61,9 +60,9 @@ namespace URIHelper { existence (see URIHelper::GetMaybeFileHdl), or use bCheckFileExists = false if you want to generate file URLs without checking for their existence. */ -SVL_DLLPUBLIC UniString +SVL_DLLPUBLIC rtl::OUString SmartRel2Abs(INetURLObject const & rTheBaseURIRef, - UniString const & rTheRelURIRef, + rtl::OUString const & rTheRelURIRef, Link const & rMaybeFileHdl = Link(), bool bCheckFileExists = true, bool bIgnoreFragment = false, @@ -133,8 +132,8 @@ SVL_DLLPUBLIC rtl::OUString simpleNormalizedMakeRelative( rtl::OUString const & baseUriReference, rtl::OUString const & uriReference); //============================================================================ -SVL_DLLPUBLIC UniString -FindFirstURLInText(UniString const & rText, +SVL_DLLPUBLIC rtl::OUString +FindFirstURLInText(rtl::OUString const & rText, xub_StrLen & rBegin, xub_StrLen & rEnd, CharClass const & rCharClass, @@ -170,8 +169,8 @@ FindFirstURLInText(UniString const & rText, @return The input URI with any password component removed. */ -SVL_DLLPUBLIC UniString -removePassword(UniString const & rURI, +SVL_DLLPUBLIC rtl::OUString +removePassword(rtl::OUString const & rURI, INetURLObject::EncodeMechanism eEncodeMechanism = INetURLObject::WAS_ENCODED, INetURLObject::DecodeMechanism eDecodeMechanism diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx index 7c2cfc6ca9dc..d59792ec285f 100644 --- a/svl/source/inc/poolio.hxx +++ b/svl/source/inc/poolio.hxx @@ -77,7 +77,7 @@ struct SfxItemPool_Impl SfxBroadcaster aBC; std::vector<SfxPoolItemArray_Impl*> maPoolItems; std::vector<SfxItemPoolUser*> maSfxItemPoolUsers; /// ObjectUser section - UniString aName; + rtl::OUString aName; SfxPoolItem** ppPoolDefaults; SfxPoolItem** ppStaticDefaults; SfxItemPool* mpMaster; @@ -98,7 +98,7 @@ struct SfxItemPool_Impl bool bStreaming; // in Load() bzw. Store() bool mbPersistentRefCounts; - SfxItemPool_Impl( SfxItemPool* pMaster, const UniString& rName, sal_uInt16 nStart, sal_uInt16 nEnd ) + SfxItemPool_Impl( SfxItemPool* pMaster, const rtl::OUString& rName, sal_uInt16 nStart, sal_uInt16 nEnd ) : maPoolItems(nEnd - nStart + 1, static_cast<SfxPoolItemArray_Impl*>(NULL)) , aName(rName) , ppPoolDefaults(new SfxPoolItem* [nEnd - nStart + 1]) diff --git a/svl/source/items/cntwall.cxx b/svl/source/items/cntwall.cxx index 76660e07a15e..3eb89d8b7abe 100644 --- a/svl/source/items/cntwall.cxx +++ b/svl/source/items/cntwall.cxx @@ -54,7 +54,7 @@ CntWallpaperItem::CntWallpaperItem( sal_uInt16 which, SvStream& rStream, sal_uIn { // Okay, data were stored by CntWallpaperItem. - readUnicodeString(rStream, _aURL, nVersion >= 1); + _aURL = readUnicodeString(rStream, nVersion >= 1); // !!! Color stream operators do not work - they discard any // transparency info !!! _nColor.Read( rStream, sal_True ); @@ -76,7 +76,7 @@ CntWallpaperItem::CntWallpaperItem( sal_uInt16 which, SvStream& rStream, sal_uIn } // Read SfxWallpaperItem's string member _aURL. - readUnicodeString(rStream, _aURL, false); + _aURL = readUnicodeString(rStream, false); // "Read" SfxWallpaperItem's string member _aFilter. read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStream); diff --git a/svl/source/items/ctypeitm.cxx b/svl/source/items/ctypeitm.cxx index d34c1db6a32e..bb8fc9400e90 100644 --- a/svl/source/items/ctypeitm.cxx +++ b/svl/source/items/ctypeitm.cxx @@ -83,8 +83,7 @@ SfxPoolItem* CntContentTypeItem::Create( SvStream& rStream, { // CntContentTypeItem used to be derived from CntStringItem, so take that // into account: - UniString aValue; - readUnicodeString(rStream, aValue, nItemVersion >= 1); + rtl::OUString aValue = readUnicodeString(rStream, nItemVersion >= 1); sal_uInt32 nMagic = 0; rStream >> nMagic; if (nMagic == CNTSTRINGITEM_STREAM_MAGIC) diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index 7de7e80c4be0..ff495f2da3e7 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -103,10 +103,10 @@ SfxBroadcaster& SfxItemPool::BC() SfxItemPool::SfxItemPool ( - UniString const & rName, /* Name des Pools zur Idetifikation + const rtl::OUString& rName, /* Name des Pools zur Idetifikation im File-Format */ - sal_uInt16 nStartWhich, /* erste Which-Id des Pools */ - sal_uInt16 nEndWhich, /* letzte Which-Id des Pools */ + sal_uInt16 nStartWhich, /* erste Which-Id des Pools */ + sal_uInt16 nEndWhich, /* letzte Which-Id des Pools */ const SfxItemInfo* pInfos, /* SID-Map und Item-Flags */ SfxPoolItem** pDefaults, /* Pointer auf statische Defaults, wird direkt vom Pool referenziert, @@ -452,7 +452,7 @@ void SfxItemPool::SetDefaultMetric( SfxMapUnit eNewMetric ) pImp->eDefMetric = eNewMetric; } -const UniString& SfxItemPool::GetName() const +const rtl::OUString& SfxItemPool::GetName() const { return pImp->aName; } diff --git a/svl/source/items/macitem.cxx b/svl/source/items/macitem.cxx index c2c41016a381..32bbad885730 100644 --- a/svl/source/items/macitem.cxx +++ b/svl/source/items/macitem.cxx @@ -142,8 +142,8 @@ SvStream& SvxMacroTableDtor::Read( SvStream& rStrm, sal_uInt16 nVersion ) sal_uInt16 nCurKey, eType = STARBASIC; String aLibName, aMacName; rStrm >> nCurKey; - SfxPoolItem::readByteString(rStrm, aLibName); - SfxPoolItem::readByteString(rStrm, aMacName); + aLibName = SfxPoolItem::readByteString(rStrm); + aMacName = SfxPoolItem::readByteString(rStrm); if( SVX_MACROTBL_VERSION40 <= nVersion ) rStrm >> eType; diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index 02eb7f41f748..92e1d7edadd2 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.cxx @@ -559,7 +559,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) // Einzel-Header int bOwnPool = sal_True; - UniString aExternName; + rtl::OUString aExternName; { // Header-Record suchen SfxMiniRecordReader aPoolHeaderRec( &rStream, SFX_ITEMPOOL_REC_HEADER ); @@ -571,7 +571,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) // Header-lesen rStream >> pImp->nLoadingVersion; - SfxPoolItem::readByteString(rStream, aExternName); + aExternName = SfxPoolItem::readByteString(rStream); bOwnPool = aExternName == pImp->aName; //! solange wir keine fremden Pools laden k"onnen @@ -714,7 +714,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream) // wenn nicht own-Pool, dann kein Name if ( aExternName != pImp->aName ) - pImp->aName.Erase(); + pImp->aName = rtl::OUString(); pImp->bStreaming = sal_False; return rStream; @@ -743,10 +743,10 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) } sal_uInt32 nAttribSize(0); int bOwnPool = sal_True; - UniString aExternName; + rtl::OUString aExternName; if ( pImp->nMajorVer > 1 || pImp->nMinorVer >= 2 ) rStream >> pImp->nLoadingVersion; - SfxPoolItem::readByteString(rStream, aExternName); + aExternName = SfxPoolItem::readByteString(rStream); bOwnPool = aExternName == pImp->aName; pImp->bStreaming = sal_True; @@ -1020,7 +1020,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream) } if ( aExternName != pImp->aName ) - pImp->aName.Erase(); + pImp->aName = rtl::OUString(); pImp->bStreaming = sal_False; return rStream; @@ -1092,7 +1092,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate // auf jeden Fall aufgel"ost werden. if ( !pRefPool ) pRefPool = this; - bool bResolvable = pRefPool->GetName().Len() > 0; + bool bResolvable = !pRefPool->GetName().isEmpty(); if ( !bResolvable ) { // Bei einem anders aufgebauten Pool im Stream, mu\s die SlotId diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index 05ed277832b4..c1275fc22b87 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.cxx @@ -185,34 +185,29 @@ SvStream& SfxPoolItem::Store(SvStream &rStream, sal_uInt16 ) const //============================================================================ // static -bool SfxPoolItem::readByteString(SvStream & rStream, UniString & rString) +rtl::OUString SfxPoolItem::readByteString(SvStream& rStream) { - rString = rStream.ReadUniOrByteString(rStream.GetStreamCharSet()); - return rStream.GetError() == ERRCODE_NONE; + return rStream.ReadUniOrByteString(rStream.GetStreamCharSet()); } //============================================================================ // static -void SfxPoolItem::writeByteString(SvStream & rStream, - UniString const & rString) +void SfxPoolItem::writeByteString(SvStream & rStream, const rtl::OUString& rString) { rStream.WriteUniOrByteString(rString, rStream.GetStreamCharSet()); } //============================================================================ // static -bool SfxPoolItem::readUnicodeString(SvStream & rStream, UniString & rString, - bool bUnicode) +rtl::OUString SfxPoolItem::readUnicodeString(SvStream & rStream, bool bUnicode) { - rString = rStream.ReadUniOrByteString(bUnicode ? RTL_TEXTENCODING_UCS2 : + return rStream.ReadUniOrByteString(bUnicode ? RTL_TEXTENCODING_UCS2 : rStream.GetStreamCharSet()); - return rStream.GetError() == ERRCODE_NONE; } //============================================================================ // static -void SfxPoolItem::writeUnicodeString(SvStream & rStream, - UniString const & rString) +void SfxPoolItem::writeUnicodeString(SvStream & rStream, const rtl::OUString& rString) { rStream.WriteUniOrByteString(rString, RTL_TEXTENCODING_UCS2); } diff --git a/svl/source/items/sfontitm.cxx b/svl/source/items/sfontitm.cxx index 0013671dd5e3..1077c939a201 100644 --- a/svl/source/items/sfontitm.cxx +++ b/svl/source/items/sfontitm.cxx @@ -77,8 +77,8 @@ SfxPoolItem * SfxFontItem::Create(SvStream & rStream, sal_uInt16) const SfxFontItem * pItem = new SfxFontItem(Which()); { VersionCompat aFontCompat(rStream, STREAM_READ); - readByteString(rStream, pItem->m_aName); - readByteString(rStream, pItem->m_aStyleName); + pItem->m_aName = readByteString(rStream); + pItem->m_aStyleName = readByteString(rStream); rStream >> pItem->m_aSize; sal_Int16 nCharSet = 0; rStream >> nCharSet; diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx index 7b86ab309b80..d12ab3e0f5a6 100644 --- a/svl/source/items/slstitm.cxx +++ b/svl/source/items/slstitm.cxx @@ -102,7 +102,7 @@ SfxStringListItem::SfxStringListItem( sal_uInt16 which, SvStream& rStream ) : String aStr; for( i=0; i < nEntryCount; i++ ) { - readByteString(rStream, aStr); + aStr = readByteString(rStream); pImp->aList.push_back(aStr); } } diff --git a/svl/source/items/stritem.cxx b/svl/source/items/stritem.cxx index a5fed052866a..e4d36a2a023b 100644 --- a/svl/source/items/stritem.cxx +++ b/svl/source/items/stritem.cxx @@ -41,8 +41,7 @@ TYPEINIT1_AUTOFACTORY(SfxStringItem, CntUnencodedStringItem) SfxStringItem::SfxStringItem(sal_uInt16 which, SvStream & rStream): CntUnencodedStringItem(which) { - UniString aValue; - readByteString(rStream, aValue); + UniString aValue = readByteString(rStream); SetValue(aValue); } diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index 00ca51a10dbf..d8485dbebbbb 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -71,9 +71,9 @@ using namespace com::sun::star; // //============================================================================ -UniString +rtl::OUString URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef, - UniString const & rTheRelURIRef, + rtl::OUString const & rTheRelURIRef, Link const & rMaybeFileHdl, bool bCheckFileExists, bool bIgnoreFragment, @@ -84,7 +84,7 @@ URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef, INetURLObject::FSysStyle eStyle) { // Backwards compatibility: - if (rTheRelURIRef.Len() != 0 && rTheRelURIRef.GetChar(0) == '#') + if (!rTheRelURIRef.isEmpty() && rTheRelURIRef[0] == '#') return rTheRelURIRef; INetURLObject aAbsURIRef; @@ -508,8 +508,8 @@ sal_uInt32 scanDomain(UniString const & rStr, xub_StrLen * pPos, } -UniString -URIHelper::FindFirstURLInText(UniString const & rText, +rtl::OUString +URIHelper::FindFirstURLInText(rtl::OUString const & rText, xub_StrLen & rBegin, xub_StrLen & rEnd, CharClass const & rCharClass, @@ -517,8 +517,8 @@ URIHelper::FindFirstURLInText(UniString const & rText, rtl_TextEncoding eCharset, INetURLObject::FSysStyle eStyle) { - if (!(rBegin <= rEnd && rEnd <= rText.Len())) - return UniString(); + if (!(rBegin <= rEnd && rEnd <= rText.getLength())) + return rtl::OUString(); // Search for the first substring of [rBegin..rEnd[ that matches any of the // following productions (for which the appropriate style bit is set in @@ -588,7 +588,7 @@ URIHelper::FindFirstURLInText(UniString const & rText, bool bBoundary2 = true; for (xub_StrLen nPos = rBegin; nPos != rEnd; nPos = nextChar(rText, nPos)) { - sal_Unicode c = rText.GetChar(nPos); + sal_Unicode c = rText[nPos]; if (bBoundary1) { if (INetMIME::isAlpha(c)) @@ -599,13 +599,13 @@ URIHelper::FindFirstURLInText(UniString const & rText, rEnd)); if (eScheme == INET_PROT_FILE) // 2nd { - while (rText.GetChar(i++) != ':') ; + while (rText[i++] != ':') ; xub_StrLen nPrefixEnd = i; xub_StrLen nUriEnd = i; while (i != rEnd && checkWChar(rCharClass, rText, &i, &nUriEnd, true, true)) ; - if (i != nPrefixEnd && rText.GetChar(i) == '#') + if (i != nPrefixEnd && rText[i] == '#') { ++i; while (i != rEnd @@ -629,12 +629,12 @@ URIHelper::FindFirstURLInText(UniString const & rText, } else if (eScheme != INET_PROT_NOT_VALID) // 1st { - while (rText.GetChar(i++) != ':') ; + while (rText[i++] != ':') ; xub_StrLen nPrefixEnd = i; xub_StrLen nUriEnd = i; while (i != rEnd && checkWChar(rCharClass, rText, &i, &nUriEnd)) ; - if (i != nPrefixEnd && rText.GetChar(i) == '#') + if (i != nPrefixEnd && rText[i] == '#') { ++i; while (i != rEnd @@ -642,7 +642,7 @@ URIHelper::FindFirstURLInText(UniString const & rText, } if (nUriEnd != nPrefixEnd && (isBoundary1(rCharClass, rText, nUriEnd, rEnd) - || rText.GetChar(nUriEnd) == '\\')) + || rText[nUriEnd] == '\\')) { INetURLObject aUri(UniString(rText, nPos, nUriEnd - nPos), @@ -662,37 +662,37 @@ URIHelper::FindFirstURLInText(UniString const & rText, i = nPos; sal_uInt32 nLabels = scanDomain(rText, &i, rEnd); if (nLabels >= 3 - && rText.GetChar(nPos + 3) == '.' - && (((rText.GetChar(nPos) == 'w' - || rText.GetChar(nPos) == 'W') - && (rText.GetChar(nPos + 1) == 'w' - || rText.GetChar(nPos + 1) == 'W') - && (rText.GetChar(nPos + 2) == 'w' - || rText.GetChar(nPos + 2) == 'W')) - || ((rText.GetChar(nPos) == 'f' - || rText.GetChar(nPos) == 'F') - && (rText.GetChar(nPos + 1) == 't' - || rText.GetChar(nPos + 1) == 'T') - && (rText.GetChar(nPos + 2) == 'p' - || rText.GetChar(nPos + 2) == 'P')))) + && rText[nPos + 3] == '.' + && (((rText[nPos] == 'w' + || rText[nPos] == 'W') + && (rText[nPos + 1] == 'w' + || rText[nPos + 1] == 'W') + && (rText[nPos + 2] == 'w' + || rText[nPos + 2] == 'W')) + || ((rText[nPos] == 'f' + || rText[nPos] == 'F') + && (rText[nPos + 1] == 't' + || rText[nPos + 1] == 'T') + && (rText[nPos + 2] == 'p' + || rText[nPos + 2] == 'P')))) // (note that rText.GetChar(nPos + 3) is guaranteed to be // valid) { xub_StrLen nUriEnd = i; - if (i != rEnd && rText.GetChar(i) == '/') + if (i != rEnd && rText[i] == '/') { nUriEnd = ++i; while (i != rEnd && checkWChar(rCharClass, rText, &i, &nUriEnd)) ; } - if (i != rEnd && rText.GetChar(i) == '#') + if (i != rEnd && rText[i] == '#') { ++i; while (i != rEnd && checkWChar(rCharClass, rText, &i, &nUriEnd)) ; } if (isBoundary1(rCharClass, rText, nUriEnd, rEnd) - || rText.GetChar(nUriEnd) == '\\') + || rText[nUriEnd] == '\\') { INetURLObject aUri(UniString(rText, nPos, nUriEnd - nPos), @@ -709,9 +709,9 @@ URIHelper::FindFirstURLInText(UniString const & rText, } if ((eStyle & INetURLObject::FSYS_DOS) != 0 && rEnd - nPos >= 3 - && rText.GetChar(nPos + 1) == ':' - && (rText.GetChar(nPos + 2) == '/' - || rText.GetChar(nPos + 2) == '\\')) // 7th, 8th + && rText[nPos + 1] == ':' + && (rText[nPos + 2] == '/' + || rText[nPos + 2] == '\\')) // 7th, 8th { i = nPos + 3; xub_StrLen nUriEnd = i; @@ -736,12 +736,12 @@ URIHelper::FindFirstURLInText(UniString const & rText, } } else if ((eStyle & INetURLObject::FSYS_DOS) != 0 && rEnd - nPos >= 2 - && rText.GetChar(nPos) == '\\' - && rText.GetChar(nPos + 1) == '\\') // 6th + && rText[nPos] == '\\' + && rText[nPos + 1] == '\\') // 6th { xub_StrLen i = nPos + 2; sal_uInt32 nLabels = scanDomain(rText, &i, rEnd); - if (nLabels >= 1 && i != rEnd && rText.GetChar(i) == '\\') + if (nLabels >= 1 && i != rEnd && rText[i] == '\\') { xub_StrLen nUriEnd = ++i; while (i != rEnd @@ -771,7 +771,7 @@ URIHelper::FindFirstURLInText(UniString const & rText, bool bDot = false; for (xub_StrLen i = nPos + 1; i != rEnd; ++i) { - sal_Unicode c2 = rText.GetChar(i); + sal_Unicode c2 = rText[i]; if (INetMIME::isAtomChar(c2)) bDot = false; else if (bDot) @@ -807,7 +807,7 @@ URIHelper::FindFirstURLInText(UniString const & rText, bBoundary2 = isBoundary2(rCharClass, rText, nPos, rEnd); } rBegin = rEnd; - return UniString(); + return rtl::OUString(); } //============================================================================ @@ -816,8 +816,8 @@ URIHelper::FindFirstURLInText(UniString const & rText, // //============================================================================ -UniString -URIHelper::removePassword(UniString const & rURI, +rtl::OUString +URIHelper::removePassword(rtl::OUString const & rURI, INetURLObject::EncodeMechanism eEncodeMechanism, INetURLObject::DecodeMechanism eDecodeMechanism, rtl_TextEncoding eCharset) @@ -825,7 +825,7 @@ URIHelper::removePassword(UniString const & rURI, INetURLObject aObj(rURI, eEncodeMechanism, eCharset); return aObj.HasError() ? rURI : - String(aObj.GetURLNoPass(eDecodeMechanism, eCharset)); + aObj.GetURLNoPass(eDecodeMechanism, eCharset); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/svx/dialmgr.hxx b/svx/inc/svx/dialmgr.hxx index 2dbe32f32303..41c4028c0637 100644 --- a/svx/inc/svx/dialmgr.hxx +++ b/svx/inc/svx/dialmgr.hxx @@ -43,8 +43,7 @@ struct SVX_DLLPUBLIC DialogsResMgr #define DIALOG_MGR() (*DialogsResMgr::GetResMgr()) #define SVX_RES(i) ResId(i,DIALOG_MGR()) -#define SVX_RESSTR(i) UniString(ResId(i,DIALOG_MGR())) -#define SVX_RESSSTR(i) String(ResId(i,DIALOG_MGR())) +#define SVX_RESSTR(i) ResId::toString(ResId(i,DIALOG_MGR())) #endif diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 5d64d15210f6..4035d585b333 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -5503,7 +5503,7 @@ static LRESULT ImplHandleIMEReconvertString( HWND hWnd, LPARAM lParam ) LPRECONVERTSTRING pReconvertString = (LPRECONVERTSTRING) lParam; LRESULT nRet = 0; SalSurroundingTextRequestEvent aEvt; - aEvt.maText = UniString(); + aEvt.maText = rtl::OUString(); aEvt.mnStart = aEvt.mnEnd = 0; UINT nImeProps = ImmGetProperty( GetKeyboardLayout( 0 ), IGP_SETCOMPSTR ); @@ -5557,7 +5557,7 @@ static LRESULT ImplHandleIMEConfirmReconvertString( HWND hWnd, LPARAM lParam ) WinSalFrame* pFrame = GetWindowPtr( hWnd ); LPRECONVERTSTRING pReconvertString = (LPRECONVERTSTRING) lParam; SalSurroundingTextRequestEvent aEvt; - aEvt.maText = UniString(); + aEvt.maText = rtl::OUString(); aEvt.mnStart = aEvt.mnEnd = 0; pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt ); |