From e443216ce2eeb2d4c7463bb019eed32f5ca4ad1c Mon Sep 17 00:00:00 2001
From: Caolán McNamara <caolanm@redhat.com>
Date: Mon, 26 Mar 2012 10:18:32 +0100
Subject: readUnicodeString can just return the string

seeing as no-one checks the return value, we don't need
the intermediate temporary string
---
 svl/inc/svl/cntwall.hxx       | 10 +++---
 svl/inc/svl/httpcook.hxx      |  8 ++---
 svl/inc/svl/itempool.hxx      |  4 +--
 svl/inc/svl/poolitem.hxx      | 13 +++----
 svl/inc/svl/urihelper.hxx     | 13 ++++---
 svl/source/inc/poolio.hxx     |  4 +--
 svl/source/items/cntwall.cxx  |  4 +--
 svl/source/items/ctypeitm.cxx |  3 +-
 svl/source/items/itempool.cxx |  8 ++---
 svl/source/items/macitem.cxx  |  4 +--
 svl/source/items/poolio.cxx   | 14 ++++----
 svl/source/items/poolitem.cxx | 17 ++++-----
 svl/source/items/sfontitm.cxx |  4 +--
 svl/source/items/slstitm.cxx  |  2 +-
 svl/source/items/stritem.cxx  |  3 +-
 svl/source/misc/urihelper.cxx | 80 +++++++++++++++++++++----------------------
 16 files changed, 90 insertions(+), 101 deletions(-)

(limited to 'svl')

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: */
-- 
cgit