[Libreoffice-commits] .: 32 commits - basctl/source desktop/source editeng/source sal/inc sc/source sfx2/source svl/inc svl/qa svl/source svtools/source svx/source sw/source xmloff/inc xmloff/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Nov 27 21:33:23 PST 2012


 basctl/source/basicide/baside2b.cxx                                   |   14 
 desktop/source/deployment/manager/dp_manager.cxx                      |    2 
 desktop/source/deployment/registry/component/dp_component.cxx         |   12 
 desktop/source/deployment/registry/configuration/dp_configuration.cxx |   10 
 desktop/source/deployment/registry/executable/dp_executable.cxx       |    6 
 desktop/source/deployment/registry/help/dp_help.cxx                   |    7 
 desktop/source/deployment/registry/package/dp_package.cxx             |   42 
 desktop/source/deployment/registry/script/dp_script.cxx               |    8 
 desktop/source/deployment/registry/sfwk/dp_sfwk.cxx                   |    6 
 editeng/source/misc/svxacorr.cxx                                      |    7 
 sal/inc/rtl/ustrbuf.hxx                                               |   30 
 sal/inc/rtl/ustring.hxx                                               |   24 
 sc/source/core/tool/interpr1.cxx                                      |   22 
 sc/source/filter/excel/xestyle.cxx                                    |    6 
 sc/source/filter/excel/xistyle.cxx                                    |    6 
 sc/source/filter/lotus/tool.cxx                                       |    4 
 sc/source/ui/docshell/docsh8.cxx                                      |    6 
 sc/source/ui/view/viewfunc.cxx                                        |   23 
 sfx2/source/bastyp/sfxhtml.cxx                                        |    9 
 svl/inc/svl/PasswordHelper.hxx                                        |   10 
 svl/inc/svl/adrparse.hxx                                              |   15 
 svl/inc/svl/inettype.hxx                                              |   48 
 svl/inc/svl/restrictedpaths.hxx                                       |    9 
 svl/inc/svl/urihelper.hxx                                             |   57 
 svl/inc/svl/urlfilter.hxx                                             |    9 
 svl/inc/svl/zforlist.hxx                                              |  247 
 svl/inc/svl/zformat.hxx                                               |  113 
 svl/qa/unit/svl.cxx                                                   |    2 
 svl/qa/unit/test_URIHelper.cxx                                        |    8 
 svl/source/misc/PasswordHelper.cxx                                    |   21 
 svl/source/misc/adrparse.cxx                                          |  618 +-
 svl/source/misc/inettype.cxx                                          |  284 
 svl/source/misc/restrictedpaths.cxx                                   |   50 
 svl/source/misc/urihelper.cxx                                         |  156 
 svl/source/numbers/numfmuno.cxx                                       |  415 -
 svl/source/numbers/zforfind.cxx                                       | 2918 +++++-----
 svl/source/numbers/zforfind.hxx                                       |  340 -
 svl/source/numbers/zforlist.cxx                                       | 1431 ++--
 svl/source/numbers/zformat.cxx                                        | 1509 ++---
 svtools/source/contnr/DocumentInfoPreview.cxx                         |   13 
 svtools/source/contnr/fileview.cxx                                    |   12 
 svtools/source/control/fmtfield.cxx                                   |    4 
 svtools/source/svhtml/parhtml.cxx                                     |   13 
 svx/source/items/numfmtsh.cxx                                         |   15 
 sw/source/core/fields/fldbas.cxx                                      |   20 
 sw/source/core/inc/SwXMLBlockImport.hxx                               |    1 
 sw/source/core/swg/SwXMLSectionList.cxx                               |    2 
 sw/source/filter/ww8/writerwordglue.cxx                               |    6 
 sw/source/filter/ww8/ww8par5.cxx                                      |   10 
 sw/source/ui/dbui/dbinsdlg.cxx                                        |    6 
 sw/source/ui/shells/tabsh.cxx                                         |    4 
 sw/source/ui/utlui/numfmtlb.cxx                                       |   10 
 xmloff/inc/xmloff/xmlimp.hxx                                          |  101 
 xmloff/source/chart/SchXMLAxisContext.cxx                             |  107 
 xmloff/source/draw/shapeexport.cxx                                    |  118 
 xmloff/source/draw/shapeexport4.cxx                                   |   73 
 xmloff/source/style/styleexp.cxx                                      |   20 
 xmloff/source/style/xmlnumfe.cxx                                      |   13 
 xmloff/source/style/xmlnumfi.cxx                                      |   98 
 xmloff/source/style/xmlnumi.cxx                                       |    9 
 xmloff/source/style/xmlstyle.cxx                                      |   44 
 xmloff/source/text/txtimp.cxx                                         |  181 
 62 files changed, 5013 insertions(+), 4371 deletions(-)

New commits:
commit c617be8307033394bde4255c05b72dbd01ae0056
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Tue Nov 27 22:58:50 2012 -0600

    remove legacy String svl's Put*Entry family of function and convert users
    
    Change-Id: Iebf4017ce4c2c48389716eac1bbf7f386ac7a296

diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 655594c..5b3354a 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1340,10 +1340,10 @@ String GetNumberFormatCode(XclRoot& rRoot, const sal_uInt16 nScNumFmt, SvNumberF
             LanguageType eLang = pEntry->GetLanguage();
             if( eLang != LANGUAGE_ENGLISH_US )
             {
-                xub_StrLen nCheckPos;
+                sal_Int32 nCheckPos;
                 short nType = NUMBERFORMAT_DEFINED;
                 sal_uInt32 nKey;
-                String aTemp( pEntry->GetFormatstring() );
+                OUString aTemp( pEntry->GetFormatstring() );
                 xFormatter->PutandConvertEntry( aTemp, nCheckPos, nType, nKey, eLang, LANGUAGE_ENGLISH_US );
                 OSL_ENSURE( nCheckPos == 0, "XclExpNumFmtBuffer::WriteFormatRecord - format code not convertible" );
                 pEntry = xFormatter->GetEntry( nKey );
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 760cf4a..dd24da4 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -659,14 +659,14 @@ void XclImpNumFmtBuffer::CreateScFormats()
         const XclNumFmt& rNumFmt = aIt->second;
 
         // insert/convert the Excel number format
-        xub_StrLen nCheckPos;
+        sal_Int32 nCheckPos;
         short nType = NUMBERFORMAT_DEFINED;
         sal_uInt32 nKey;
         if( rNumFmt.maFormat.Len() )
         {
-            String aFormat( rNumFmt.maFormat );
+            OUString aFormat( rNumFmt.maFormat );
             rFormatter.PutandConvertEntry( aFormat, nCheckPos,
-                nType, nKey, LANGUAGE_ENGLISH_US, rNumFmt.meLanguage );
+                                           nType, nKey, LANGUAGE_ENGLISH_US, rNumFmt.meLanguage );
         }
         else
             nKey = rFormatter.GetFormatIndex( rNumFmt.meOffset, rNumFmt.meLanguage );
diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx
index b1b3b2d..96f4e60 100644
--- a/sc/source/filter/lotus/tool.cxx
+++ b/sc/source/filter/lotus/tool.cxx
@@ -203,7 +203,7 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt )
     // neues Format erzeugen
     sal_uInt8       nL, nH; // Low-/High-Nibble
     sal_uInt8       nForm = nFormat;
-    String          aFormString;
+    OUString          aFormString;
     sal_Int16       eType = NUMBERFORMAT_ALL;
     sal_uInt32      nIndex1;
     sal_uInt32      nHandle;
@@ -373,7 +373,7 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt )
         nHandle = pFormTable->GetFormatIndex( eIndexTableOffset, eLanguage);
     else
     {
-        xub_StrLen  nDummy;
+        sal_Int32  nDummy;
         pFormTable->PutEntry( aFormString, nDummy, eType, nHandle, eLanguage );
     }
 
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index f93c255..efbeeb3 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -282,13 +282,13 @@ static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales
         pOldEntry->GetFormatSpecialInfo(bThousand, bNegRed, nPrecision, nLeading);
 
         nPrecision = static_cast<sal_uInt16>(rScales[i]);
-        String aNewPicture = pFormatter->GenerateFormat(nOldFormat, eLang,
-                                   bThousand, bNegRed, nPrecision, nLeading);
+        OUString aNewPicture = pFormatter->GenerateFormat(nOldFormat, eLang,
+                                                          bThousand, bNegRed, nPrecision, nLeading);
 
         sal_uInt32 nNewFormat = pFormatter->GetEntryKey(aNewPicture, eLang);
         if (nNewFormat == NUMBERFORMAT_ENTRY_NOT_FOUND)
         {
-            xub_StrLen nErrPos = 0;
+            sal_Int32 nErrPos = 0;
             short nNewType = 0;
             bool bOk = pFormatter->PutEntry(
                 aNewPicture, nErrPos, nNewType, nNewFormat, eLang);
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index f695475..cd3e2f5 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2614,8 +2614,8 @@ void ScViewFunc::SetNumFmtByStr( const String& rCode )
     {
         //  enter new
 
-        String      aFormat = rCode;    // will be changed
-        xub_StrLen  nErrPos = 0;
+        OUString    aFormat = rCode;    // will be changed
+        sal_Int32   nErrPos = 0;
         short       nType   = 0;        //! ???
         bOk = pFormatter->PutEntry( aFormat, nErrPos, nType, nNumberFormat, eLanguage );
     }
@@ -2724,13 +2724,14 @@ void ScViewFunc::ChangeNumFmtDecimals( sal_Bool bIncrement )
 
     if (!bError)
     {
-        String aNewPicture = pFormatter->GenerateFormat(nOldFormat, eLanguage,
-                                    bThousand, bNegRed, nPrecision, nLeading);
+        OUString aNewPicture = pFormatter->GenerateFormat(nOldFormat, eLanguage,
+                                                          bThousand, bNegRed,
+                                                          nPrecision, nLeading);
 
         nNewFormat = pFormatter->GetEntryKey( aNewPicture, eLanguage );
         if ( nNewFormat == NUMBERFORMAT_ENTRY_NOT_FOUND )
         {
-            xub_StrLen nErrPos = 0;
+            sal_Int32 nErrPos = 0;
             short nNewType = 0;
             sal_Bool bOk = pFormatter->PutEntry( aNewPicture, nErrPos,
                                                 nNewType, nNewFormat, eLanguage );
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
index 8bc4946..66be8a6 100644
--- a/sfx2/source/bastyp/sfxhtml.cxx
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -335,8 +335,7 @@ double SfxHTMLParser::GetTableDataOptionsValNum( sal_uInt32& nNumForm,
         SvNumberFormatter& rFormatter )
 {
     LanguageType eParseLang = (LanguageType )aNumStr.ToInt32();
-    sal_uInt32 nParseForm =
-        rFormatter.GetFormatForLanguageIfBuiltIn( 0, eParseLang );
+    sal_uInt32 nParseForm = rFormatter.GetFormatForLanguageIfBuiltIn( 0, eParseLang );
     double fVal;
     rFormatter.IsNumberFormat( aValStr, nParseForm, fVal );
     if ( comphelper::string::getTokenCount(aNumStr, ';') > 2 )
@@ -344,14 +343,14 @@ double SfxHTMLParser::GetTableDataOptionsValNum( sal_uInt32& nNumForm,
         eNumLang = (LanguageType)aNumStr.GetToken( 1, ';' ).ToInt32();
         xub_StrLen nPos = aNumStr.Search( ';' );
         nPos = aNumStr.Search( ';', nPos + 1 );
-        String aFormat( aNumStr.Copy( nPos + 1 ) );
-        xub_StrLen nCheckPos;
+        OUString aFormat( aNumStr.Copy( nPos + 1 ) );
+        sal_Int32 nCheckPos;
         short nType;
         if ( eNumLang != LANGUAGE_SYSTEM )
             rFormatter.PutEntry( aFormat, nCheckPos, nType, nNumForm, eNumLang );
         else
             rFormatter.PutandConvertEntry( aFormat, nCheckPos, nType, nNumForm,
-                eParseLang, eNumLang );
+                                           eParseLang, eNumLang );
     }
     else
     {
diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx
index 2b2d258..b20d89c 100644
--- a/svl/inc/svl/zforlist.hxx
+++ b/svl/inc/svl/zforlist.hxx
@@ -389,19 +389,12 @@ public:
             nType contains the type of the format.
             nKey contains the index key of the format.
      */
-    bool PutEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey,
-                   LanguageType eLnge = LANGUAGE_DONTKNOW );
-
     bool PutEntry( OUString& rString, sal_Int32& nCheckPos, short& nType, sal_uInt32& nKey,
                    LanguageType eLnge = LANGUAGE_DONTKNOW );
 
     /** Same as <method>PutEntry</method> but the format code string is
          considered to be of language/country eLnge and is converted to
         language/country eNewLnge */
-    bool PutandConvertEntry( String& rString, xub_StrLen& nCheckPos,
-                             short& nType, sal_uInt32& nKey,
-                             LanguageType eLnge, LanguageType eNewLnge );
-
     bool PutandConvertEntry( OUString& rString, sal_Int32& nCheckPos,
                              short& nType, sal_uInt32& nKey,
                              LanguageType eLnge, LanguageType eNewLnge );
@@ -414,10 +407,6 @@ public:
                                    short& nType, sal_uInt32& nKey,
                                    LanguageType eLnge, LanguageType eNewLnge );
 
-    bool PutandConvertEntrySystem( String& rString, xub_StrLen& nCheckPos,
-                                   short& nType, sal_uInt32& nKey,
-                                   LanguageType eLnge, LanguageType eNewLnge );
-
     /** Similar to <method>PutEntry</method> and
         <method>PutandConvertEntry</method> or
         <method>PutandConvertEntrySystem</method>, the format code string
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 8592eba..0440835 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -562,36 +562,6 @@ bool SvNumberFormatter::PutEntry(OUString& rString,
     return bCheck;
 }
 
-bool SvNumberFormatter::PutEntry(String& rString, xub_StrLen& nCheckPos,
-                                 short& nType, sal_uInt32& nKey,
-                                 LanguageType eLnge)
-{
-    // Wrapper to allow String to be used.
-    OUString aStr(rString);
-    sal_Int32 nPos = (nCheckPos == (xub_StrLen)0xFFFF) ? -1  : (sal_Int32)nCheckPos;
-    bool bRet = PutEntry(aStr, nPos, nType, nKey, eLnge);
-    rString = aStr;
-    nCheckPos = nPos < 0 ? (xub_StrLen)0xFFFF : (xub_StrLen)nPos;
-    return bRet;
-}
-
-bool SvNumberFormatter::PutandConvertEntry(String& rString,
-                                           xub_StrLen& nCheckPos,
-                                           short& nType,
-                                           sal_uInt32& nKey,
-                                           LanguageType eLnge,
-                                           LanguageType eNewLnge)
-{
-    bool bRes;
-    if (eNewLnge == LANGUAGE_DONTKNOW)
-        eNewLnge = IniLnge;
-
-    pFormatScanner->SetConvertMode(eLnge, eNewLnge);
-    bRes = PutEntry(rString, nCheckPos, nType, nKey, eLnge);
-    pFormatScanner->SetConvertMode(false);
-    return bRes;
-}
-
 bool SvNumberFormatter::PutandConvertEntry(OUString& rString,
                                            sal_Int32& nCheckPos,
                                            short& nType,
@@ -628,24 +598,6 @@ bool SvNumberFormatter::PutandConvertEntrySystem(OUString& rString,
     return bRes;
 }
 
-bool SvNumberFormatter::PutandConvertEntrySystem(String& rString,
-                                                 xub_StrLen& nCheckPos,
-                                                 short& nType,
-                                                 sal_uInt32& nKey,
-                                                 LanguageType eLnge,
-                                                 LanguageType eNewLnge)
-{
-    bool bRes;
-    if (eNewLnge == LANGUAGE_DONTKNOW)
-    {
-        eNewLnge = IniLnge;
-    }
-    pFormatScanner->SetConvertMode(eLnge, eNewLnge, true);
-    bRes = PutEntry(rString, nCheckPos, nType, nKey, eLnge);
-    pFormatScanner->SetConvertMode(false);
-    return bRes;
-}
-
 sal_uInt32 SvNumberFormatter::GetIndexPuttingAndConverting( String & rString, LanguageType eLnge,
                                                             LanguageType eSysLnge, short & rType,
                                                             bool & rNewInserted, xub_StrLen & rCheckPos )
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index 375a3f6..181bc71 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -667,9 +667,9 @@ sal_Bool FormattedField::SetFormat(const OUString& rFormatString, LanguageType e
     sal_uInt32 nNewKey = ImplGetFormatter()->TestNewString(rFormatString, eLang);
     if (nNewKey == NUMBERFORMAT_ENTRY_NOT_FOUND)
     {
-        sal_uInt16 nCheckPos;
+        sal_Int32 nCheckPos;
         short nType;
-        XubString rFormat(rFormatString);
+        OUString rFormat(rFormatString);
         if (!ImplGetFormatter()->PutEntry(rFormat, nCheckPos, nType, nNewKey, eLang))
             return sal_False;
         DBG_ASSERT(nNewKey != NUMBERFORMAT_ENTRY_NOT_FOUND, "FormattedField::SetFormatString : PutEntry returned an invalid key !");
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 9ba7e2a..7e72d33 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -252,9 +252,14 @@ bool SvxNumberFormatShell::AddFormat( String& rFormat,  xub_StrLen& rErrPos,
     }
     else // neues Format
     {
-        bInserted = pFormatter->PutEntry( rFormat, rErrPos,
+        OUString sTemp(rFormat);
+        sal_Int32 nPos;
+        bInserted = pFormatter->PutEntry( sTemp, nPos,
                                           nCurCategory, nAddKey,
                                           eCurLanguage );
+        rErrPos = (nPos >= 0) ? (xub_StrLen)nPos : 0xFFFF;
+        rFormat = sTemp;
+
         if (bInserted)
         {
             // May be sorted under a different locale if LCID was parsed.
diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx
index b8cafaa..d542331 100644
--- a/sw/source/core/fields/fldbas.cxx
+++ b/sw/source/core/fields/fldbas.cxx
@@ -474,7 +474,7 @@ String SwValueFieldType::ExpandValue( const double& rVal,
     if (rVal >= DBL_MAX)        // FehlerString fuer Calculator
         return ViewShell::GetShellRes()->aCalc_Error;
 
-    String sExpand;
+    OUString sExpand;
     SvNumberFormatter* pFormatter = pDoc->GetNumberFormatter();
     Color* pCol = 0;
 
@@ -484,7 +484,7 @@ String SwValueFieldType::ExpandValue( const double& rVal,
     if( nFmt < SV_COUNTRY_LANGUAGE_OFFSET && LANGUAGE_SYSTEM != nFmtLng )
     {
         short nType = NUMBERFORMAT_DEFINED;
-        xub_StrLen nDummy;
+        sal_Int32 nDummy;
 
         const SvNumberformat* pEntry = pFormatter->GetEntry(nFmt);
 
@@ -496,7 +496,7 @@ String SwValueFieldType::ExpandValue( const double& rVal,
             if (nNewFormat == nFmt)
             {
                 // Warscheinlich benutzerdefiniertes Format
-                String sFmt(pEntry->GetFormatstring());
+                OUString sFmt(pEntry->GetFormatstring());
 
                 pFormatter->PutandConvertEntry(sFmt, nDummy, nType, nFmt,
                                         pEntry->GetLanguage(), nFmtLng );
@@ -512,9 +512,7 @@ String SwValueFieldType::ExpandValue( const double& rVal,
         String sValue;
         DoubleToString(sValue, rVal, nFmtLng);
         OUString sTempIn(sValue);
-        OUString sTempOut(sExpand);
-        pFormatter->GetOutputString(sTempIn, nFmt, sTempOut, &pCol);
-        sExpand = sTempOut;
+        pFormatter->GetOutputString(sTempIn, nFmt, sExpand, &pCol);
     }
     else
     {
@@ -608,13 +606,13 @@ sal_uInt32 SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt
         {
             // Warscheinlich benutzerdefiniertes Format
             short nType = NUMBERFORMAT_DEFINED;
-            xub_StrLen nDummy;
+            sal_Int32 nDummy;
 
-            String sFmt(pEntry->GetFormatstring());
+            OUString sFmt(pEntry->GetFormatstring());
 
             sal_uInt32 nFormat = nFmt;
             pFormatter->PutandConvertEntry(sFmt, nDummy, nType,
-                                nFormat, pEntry->GetLanguage(), nLng);
+                                           nFormat, pEntry->GetLanguage(), nLng);
             nFmt = nFormat;
         }
         else
@@ -654,8 +652,8 @@ void SwValueField::SetLanguage( sal_uInt16 nLng )
                 {
                     // Warscheinlich benutzerdefiniertes Format
                     short nType = NUMBERFORMAT_DEFINED;
-                    xub_StrLen nDummy;
-                    String sFmt( pEntry->GetFormatstring() );
+                    sal_Int32 nDummy;
+                    OUString sFmt( pEntry->GetFormatstring() );
                     pFormatter->PutandConvertEntry( sFmt, nDummy, nType,
                                                     nNewFormat,
                                                     pEntry->GetLanguage(),
diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx
index a515b2c..2e08a76 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -734,7 +734,7 @@ namespace sw
             sal_uInt16 nDocLang)
         {
             // tell the Formatter about the new entry
-            sal_uInt16 nCheckPos = 0;
+            sal_Int32 nCheckPos = 0;
             short  nType = NUMBERFORMAT_DEFINED;
             sal_uInt32  nKey = 0;
 
@@ -949,7 +949,9 @@ namespace sw
             if (bHijri)
                 rParams.Insert(rtl::OUString("[~hijri]"), 0);
 
-            pFormatter->PutEntry(rParams, nCheckPos, nType, nKey, rLang);
+            OUString sTemp(rParams);
+            pFormatter->PutEntry(sTemp, nCheckPos, nType, nKey, rLang);
+            rParams = sTemp;
 
             return nKey;
         }
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 037c4be..1075590 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -633,12 +633,14 @@ short SwWW8ImplReader::GetTimeDatePara(String& rStr, sal_uInt32& rFormat,
         if (bHijri)
             sParams.Insert(rtl::OUString("[~hijri]"), 0);
 
-        sal_uInt16 nCheckPos = 0;
-        sal_Int16 nType = NUMBERFORMAT_DEFINED;
+        sal_Int32 nCheckPos = 0;
+        short nType = NUMBERFORMAT_DEFINED;
         rFormat = 0;
 
-        pFormatter->PutandConvertEntry(sParams, nCheckPos, nType, rFormat,
-            LANGUAGE_ENGLISH_US, rLang);
+        OUString sTemp(sParams);
+        pFormatter->PutandConvertEntry(sTemp, nCheckPos, nType, rFormat,
+                                       LANGUAGE_ENGLISH_US, rLang);
+        sParams = sTemp;
 
         return bHasTime ? NUMBERFORMAT_DATETIME : NUMBERFORMAT_DATE;
     }
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 076a8dd..1198fb7 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1850,12 +1850,10 @@ void SwInsertDBColAutoPilot::Load()
                                                                     rGet.eUsrNumFmtLng );
                             if( NUMBERFORMAT_ENTRY_NOT_FOUND == rSet.nUsrNumFmt )
                             {
-                                xub_StrLen nCheckPos;
+                                sal_Int32 nCheckPos;
                                 short nType;
-                                String sTmpFmt = rGet.sUsrNumFmt;
-                                rNFmtr.PutEntry( sTmpFmt, nCheckPos, nType,
+                                rNFmtr.PutEntry( rGet.sUsrNumFmt, nCheckPos, nType,
                                                 rSet.nUsrNumFmt, rGet.eUsrNumFmtLng );
-                                rGet.sUsrNumFmt = sTmpFmt;
                             }
                         }
                         break;
diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx
index 56c788f..defbad8 100644
--- a/sw/source/ui/shells/tabsh.cxx
+++ b/sw/source/ui/shells/tabsh.cxx
@@ -1443,12 +1443,12 @@ void SwTableShell::ExecNumberFormat(SfxRequest& rReq)
         if( pItem )
         {
             //  Index fuer String bestimmen
-            String aCode( ((const SfxStringItem*)pItem)->GetValue() );
+            OUString aCode( ((const SfxStringItem*)pItem)->GetValue() );
             nNumberFormat = pFormatter->GetEntryKey( aCode, eLang );
             if( NUMBERFORMAT_ENTRY_NOT_FOUND == nNumberFormat )
             {
                 //  neu eintragen
-                xub_StrLen nErrPos;
+                sal_Int32 nErrPos;
                 short nType;
                 if( !pFormatter->PutEntry( aCode, nErrPos, nType,
                                             nNumberFormat, eLang ))
commit ae0fa7cc62e1f57d22e68b2ef45086aeb1dfe41c
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Tue Nov 27 07:00:28 2012 -0600

    String=>OUString in svl's inettype and fall-out
    
    Change-Id: I7d64d117183738b86d1869ed629d73675de9c679

diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx
index 8f469ed..ba67f9e 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -1001,7 +1001,7 @@ Reference<deployment::XPackage> PackageManagerImpl::getDeployedPackage_(
 {
     if (ignoreAlienPlatforms)
     {
-        String type, subType;
+        OUString type, subType;
         INetContentTypeParameterList params;
         if (INetContentTypes::parse( data.mediaType, type, subType, &params ))
         {
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index 163ac40..5d7082a 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -679,11 +679,11 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
                 static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) );
     }
 
-    String type, subType;
+    OUString type, subType;
     INetContentTypeParameterList params;
     if (INetContentTypes::parse( mediaType, type, subType, &params ))
     {
-        if (type.EqualsIgnoreCaseAscii("application"))
+        if (type.equalsIgnoreAsciiCaseAscii("application"))
         {
             OUString name;
             if (!bRemoved)
@@ -692,7 +692,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
                 name = StrTitle::getTitle( ucbContent );
             }
 
-            if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.uno-component"))
+            if (subType.equalsIgnoreAsciiCaseAscii("vnd.sun.star.uno-component"))
             {
                 // xxx todo: probe and evaluate component xml description
 
@@ -738,8 +738,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
                     }
                 }
             }
-            else if (subType.EqualsIgnoreCaseAscii(
-                         "vnd.sun.star.uno-components"))
+            else if (subType.equalsIgnoreAsciiCaseAscii("vnd.sun.star.uno-components"))
             {
                 INetContentTypeParameter const * param = params.find(
                     rtl::OString(RTL_CONSTASCII_STRINGPARAM("platform")));
@@ -749,8 +748,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
                         identifier);
                 }
             }
-            else if (subType.EqualsIgnoreCaseAscii(
-                         "vnd.sun.star.uno-typelibrary"))
+            else if (subType.equalsIgnoreAsciiCaseAscii( "vnd.sun.star.uno-typelibrary"))
             {
                 INetContentTypeParameter const * param = params.find(
                     rtl::OString(RTL_CONSTASCII_STRINGPARAM("type")));
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
index e53e3e2..4fa4763 100644
--- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx
+++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx
@@ -330,11 +330,11 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
                 static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) );
     }
 
-    String type, subType;
+    OUString type, subType;
     INetContentTypeParameterList params;
     if (INetContentTypes::parse( mediaType, type, subType, &params ))
     {
-        if (type.EqualsIgnoreCaseAscii("application"))
+        if (type.equalsIgnoreAsciiCaseAscii("application"))
         {
             OUString name;
             if (!bRemoved)
@@ -344,15 +344,13 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
             }
 
             ::ucbhelper::Content ucbContent( url, xCmdEnv, m_xComponentContext );
-            if (subType.EqualsIgnoreCaseAscii(
-                    "vnd.sun.star.configuration-data"))
+            if (subType.equalsIgnoreAsciiCaseAscii( "vnd.sun.star.configuration-data"))
             {
                 return new PackageImpl(
                     this, url, name, m_xConfDataTypeInfo, false /* data file */,
                     bRemoved, identifier);
             }
-            else if (subType.EqualsIgnoreCaseAscii(
-                         "vnd.sun.star.configuration-schema")) {
+            else if (subType.equalsIgnoreAsciiCaseAscii( "vnd.sun.star.configuration-schema")) {
                 return new PackageImpl(
                     this, url, name, m_xConfSchemaTypeInfo, true /* schema file */,
                     bRemoved, identifier);
diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx
index 5aba0f6..18cf752 100644
--- a/desktop/source/deployment/registry/executable/dp_executable.cxx
+++ b/desktop/source/deployment/registry/executable/dp_executable.cxx
@@ -169,11 +169,11 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
             static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) );
     }
 
-    String type, subType;
+    OUString type, subType;
     INetContentTypeParameterList params;
     if (INetContentTypes::parse( mediaType, type, subType, &params ))
     {
-        if (type.EqualsIgnoreCaseAscii("application"))
+        if (type.equalsIgnoreAsciiCaseAscii("application"))
         {
             OUString name;
             if (!bRemoved)
@@ -182,7 +182,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
                     url, xCmdEnv, getComponentContext() );
                 name = StrTitle::getTitle( ucbContent );
             }
-            if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.executable"))
+            if (subType.equalsIgnoreAsciiCaseAscii("vnd.sun.star.executable"))
             {
                 return new BackendImpl::ExecutablePackageImpl(
                     this, url, name,  m_xExecutableTypeInfo, bRemoved,
diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx
index 9a72be8..c31b1de 100644
--- a/desktop/source/deployment/registry/help/dp_help.cxx
+++ b/desktop/source/deployment/registry/help/dp_help.cxx
@@ -183,11 +183,11 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
             StrCannotDetectMediaType::get() + url,
             static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) );
 
-    String type, subType;
+    OUString type, subType;
     INetContentTypeParameterList params;
     if (INetContentTypes::parse( mediaType_, type, subType, &params ))
     {
-        if (type.EqualsIgnoreCaseAscii("application"))
+        if (type.equalsIgnoreAsciiCaseAscii("application"))
         {
             OUString name;
             if (!bRemoved)
@@ -197,8 +197,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
                 name = StrTitle::getTitle( ucbContent );
             }
 
-            if (subType.EqualsIgnoreCaseAscii(
-                    "vnd.sun.star.help"))
+            if (subType.equalsIgnoreAsciiCaseAscii( "vnd.sun.star.help"))
             {
                 return new PackageImpl(
                     this, url, name, m_xHelpTypeInfo, bRemoved,
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx
index 36a4a49..3e2615b 100644
--- a/desktop/source/deployment/registry/package/dp_package.cxx
+++ b/desktop/source/deployment/registry/package/dp_package.cxx
@@ -416,11 +416,11 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
                 static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) );
     }
 
-    String type, subType;
+    OUString type, subType;
     INetContentTypeParameterList params;
     if (INetContentTypes::parse( mediaType, type, subType, &params ))
     {
-        if (type.EqualsIgnoreCaseAscii("application"))
+        if (type.equalsIgnoreAsciiCaseAscii("application"))
         {
 
             //In case a XPackage is created for a removed extension, we cannot
@@ -432,13 +432,14 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
                     url, xCmdEnv, getComponentContext() );
                 name = StrTitle::getTitle( ucbContent );
             }
-            if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.package-bundle")) {
+            if (subType.equalsIgnoreAsciiCaseAscii("vnd.sun.star.package-bundle"))
+            {
                 return new PackageImpl(
                     this, url, name, m_xBundleTypeInfo, false, bRemoved,
                     identifier);
             }
-            else if (subType.EqualsIgnoreCaseAscii(
-                         "vnd.sun.star.legacy-package-bundle")) {
+            else if (subType.equalsIgnoreAsciiCaseAscii( "vnd.sun.star.legacy-package-bundle"))
+            {
                 return new PackageImpl(
                     this, url, name, m_xLegacyBundleTypeInfo, true, bRemoved,
                     identifier);
@@ -1311,17 +1312,15 @@ Sequence< Reference<deployment::XPackage> > BackendImpl::PackageImpl::getBundle(
             const Reference<deployment::XPackageTypeInfo> xPackageType(
                 (*iPos)->getPackageType() );
             OSL_ASSERT( xPackageType.is() );
-            if (xPackageType.is()) {
+            if (xPackageType.is())
+            {
                 const OUString mediaType( xPackageType->getMediaType() );
-                String type, subType;
+                OUString type, subType;
                 INetContentTypeParameterList params;
-                if (INetContentTypes::parse(
-                        mediaType, type, subType, &params ) &&
-                    type.EqualsIgnoreCaseAscii("application") &&
-                    (subType.EqualsIgnoreCaseAscii(
-                        "vnd.sun.star.uno-component") ||
-                     subType.EqualsIgnoreCaseAscii(
-                         "vnd.sun.star.configuration-data")))
+                if (INetContentTypes::parse( mediaType, type, subType, &params ) &&
+                    type.equalsIgnoreAsciiCaseAscii("application") &&
+                    (subType.equalsIgnoreAsciiCaseAscii( "vnd.sun.star.uno-component") ||
+                     subType.equalsIgnoreAsciiCaseAscii( "vnd.sun.star.configuration-data")))
                 {
                     --upper_end;
                     pret[ upper_end ] = *iPos;
@@ -1352,12 +1351,8 @@ inline bool isBundle_( OUString const & mediaType )
 {
     // xxx todo: additional parsing?
     return !mediaType.isEmpty() &&
-        (mediaType.matchIgnoreAsciiCaseAsciiL(
-            RTL_CONSTASCII_STRINGPARAM(
-                "application/vnd.sun.star.package-bundle") ) ||
-         mediaType.matchIgnoreAsciiCaseAsciiL(
-             RTL_CONSTASCII_STRINGPARAM(
-                 "application/vnd.sun.star.legacy-package-bundle") ));
+        (mediaType.matchIgnoreAsciiCase( "application/vnd.sun.star.package-bundle") ||
+         mediaType.matchIgnoreAsciiCase( "application/vnd.sun.star.legacy-package-bundle"));
 }
 
 //______________________________________________________________________________
@@ -1456,7 +1451,7 @@ void BackendImpl::PackageImpl::scanBundle(
         if ( fullPath.isEmpty() || mediaType.isEmpty() || mediaType == "text/xml" )// opt: exclude common text/xml
             continue;
 
-        String type, subType;
+        OUString type, subType;
         INetContentTypeParameterList params;
         if (! INetContentTypes::parse( mediaType, type, subType, &params ))
             continue;
@@ -1468,9 +1463,8 @@ void BackendImpl::PackageImpl::scanBundle(
         const OUString url( makeURL( packageRootURL, fullPath ) );
 
         // check for bundle description:
-        if (type.EqualsIgnoreCaseAscii("application") &&
-            subType.EqualsIgnoreCaseAscii(
-                "vnd.sun.star.package-bundle-description"))
+        if (type.equalsIgnoreAsciiCaseAscii("application") &&
+            subType.equalsIgnoreAsciiCaseAscii( "vnd.sun.star.package-bundle-description"))
         {
             // check locale:
             param = params.find(rtl::OString(RTL_CONSTASCII_STRINGPARAM("locale")));
diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx
index a8f8c09..3f061f1 100644
--- a/desktop/source/deployment/registry/script/dp_script.cxx
+++ b/desktop/source/deployment/registry/script/dp_script.cxx
@@ -245,11 +245,11 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
                 static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) );
     }
 
-    String type, subType;
+    OUString type, subType;
     INetContentTypeParameterList params;
     if (INetContentTypes::parse( mediaType, type, subType, &params ))
     {
-        if (type.EqualsIgnoreCaseAscii("application"))
+        if (type.equalsIgnoreAsciiCaseAscii("application"))
         {
             OUString dialogURL( makeURL( url, OUSTR("dialog.xlb") ) );
             if (! create_ucb_content(
@@ -257,7 +257,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
                 dialogURL = OUString();
             }
 
-            if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.basic-library"))
+            if (subType.equalsIgnoreAsciiCaseAscii("vnd.sun.star.basic-library"))
             {
                 OUString scriptURL( makeURL( url, OUSTR("script.xlb")));
                 if (! create_ucb_content(
@@ -269,7 +269,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
                     this, url, xCmdEnv, scriptURL,
                     dialogURL, bRemoved, identifier);
             }
-            else if (subType.EqualsIgnoreCaseAscii(
+            else if (subType.equalsIgnoreAsciiCaseAscii(
                          "vnd.sun.star.dialog-library")) {
                 return new PackageImpl(
                     this, url, xCmdEnv,
diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
index 7445cfa..f28b12c 100644
--- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
+++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
@@ -219,13 +219,13 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_(
                 static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) );
     }
 
-    String type, subType;
+    OUString type, subType;
     INetContentTypeParameterList params;
     if (INetContentTypes::parse( mediaType, type, subType, &params ))
     {
-        if (type.EqualsIgnoreCaseAscii("application"))
+        if (type.equalsIgnoreAsciiCaseAscii("application"))
         {
-            if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.framework-script"))
+            if (subType.equalsIgnoreAsciiCaseAscii("vnd.sun.star.framework-script"))
             {
                 OUString lang = OUString("Script");
                 OUString sParcelDescURL = makeURL(
diff --git a/svl/inc/svl/inettype.hxx b/svl/inc/svl/inettype.hxx
index d7078cc..9764528 100644
--- a/svl/inc/svl/inettype.hxx
+++ b/svl/inc/svl/inettype.hxx
@@ -34,21 +34,15 @@
 #define CONTENT_TYPE_STR_APP_VND_CHART "application/vnd.stardivision.chart"
 #define CONTENT_TYPE_STR_APP_VND_DRAW "application/vnd.stardivision.draw"
 #define CONTENT_TYPE_STR_APP_VND_IMAGE "application/vnd.stardivision.image"
-#define CONTENT_TYPE_STR_APP_VND_IMPRESSPACKED \
-    "application/vnd.stardivision.impress-packed"
-#define CONTENT_TYPE_STR_APP_VND_IMPRESS \
-    "application/vnd.stardivision.impress"
+#define CONTENT_TYPE_STR_APP_VND_IMPRESSPACKED "application/vnd.stardivision.impress-packed"
+#define CONTENT_TYPE_STR_APP_VND_IMPRESS "application/vnd.stardivision.impress"
 #define CONTENT_TYPE_STR_APP_VND_MAIL "application/vnd.stardivision.mail"
 #define CONTENT_TYPE_STR_APP_VND_MATH "application/vnd.stardivision.math"
 #define CONTENT_TYPE_STR_APP_VND_NEWS "application/vnd.stardivision.news"
-#define CONTENT_TYPE_STR_APP_VND_OUTTRAY \
-    "application/vnd.stardivision.outtray"
-#define CONTENT_TYPE_STR_APP_VND_TEMPLATE \
-    "application/vnd.stardivision.template"
-#define CONTENT_TYPE_STR_APP_VND_WRITER_GLOBAL \
-    "application/vnd.stardivision.writer-global"
-#define CONTENT_TYPE_STR_APP_VND_WRITER_WEB \
-    "application/vnd.stardivision.writer-web"
+#define CONTENT_TYPE_STR_APP_VND_OUTTRAY "application/vnd.stardivision.outtray"
+#define CONTENT_TYPE_STR_APP_VND_TEMPLATE "application/vnd.stardivision.template"
+#define CONTENT_TYPE_STR_APP_VND_WRITER_GLOBAL "application/vnd.stardivision.writer-global"
+#define CONTENT_TYPE_STR_APP_VND_WRITER_WEB "application/vnd.stardivision.writer-web"
 #define CONTENT_TYPE_STR_APP_VND_WRITER "application/vnd.stardivision.writer"
 #define CONTENT_TYPE_STR_APP_FRAMESET "application/x-frameset"
 #define CONTENT_TYPE_STR_APP_GALLERY_THEME "application/x-gallery-theme"
@@ -119,7 +113,6 @@
 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_IMPRESS "application/vnd.sun.xml.impress"
 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_DRAW "application/vnd.sun.xml.draw"
 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_CHART "application/vnd.sun.xml.chart"
-
 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_MATH "application/vnd.sun.xml.math"
 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_WRITER_GLOBAL "application/vnd.sun.xml.writer-global"
 #define CONTENT_TYPE_STR_APP_VND_SUN_XML_IMPRESSPACKED "application/vnd.sun.xml.impress-packed"
@@ -256,28 +249,23 @@ enum INetContentType
 class SVL_DLLPUBLIC INetContentTypes
 {
 public:
-    static INetContentType RegisterContentType(UniString const & rTypeName,
-                                               UniString const &
-                                                   rPresentation,
-                                               UniString const * pExtension
-                                                   = 0,
-                                               UniString const *
-                                                   pSystemFileType = 0);
+    static INetContentType RegisterContentType(OUString const & rTypeName,
+                                               OUString const & rPresentation,
+                                               OUString const * pExtension = 0,
+                                               OUString const * pSystemFileType = 0);
 
-    static INetContentType GetContentType(UniString const & rTypeName);
+    static INetContentType GetContentType(OUString const & rTypeName);
 
     static rtl::OUString GetContentType(INetContentType eTypeID);
 
-    static UniString GetPresentation(INetContentType eTypeID,
-                                     const ::com::sun::star::lang::Locale& aLocale);
+    static OUString GetPresentation(INetContentType eTypeID,
+                                    const ::com::sun::star::lang::Locale& aLocale);
 
-    static INetContentType GetContentType4Extension(UniString const &
-                                                        rExtension);
+    static INetContentType GetContentType4Extension(OUString const & rExtension);
 
-    static INetContentType GetContentTypeFromURL(UniString const & rURL);
+    static INetContentType GetContentTypeFromURL(OUString const & rURL);
 
-    static bool GetExtensionFromURL(UniString const & rURL,
-                                    UniString & rExtension);
+    static bool GetExtensionFromURL(OUString const & rURL, OUString & rExtension);
 
     /** Parse the body of an RFC 2045 Content-Type header field.
 
@@ -306,8 +294,8 @@ public:
         @return  True if the syntax of the field body is correct.  If false is
         returned, none of the output parameters will be modified!
      */
-    static bool parse(UniString const & rMediaType, UniString & rType,
-                      UniString & rSubType,
+    static bool parse(OUString const & rMediaType, OUString & rType,
+                      OUString & rSubType,
                       INetContentTypeParameterList * pParameters = 0);
 };
 
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index 5bbe31c..b9f8bf3 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -40,15 +40,15 @@ struct MediaTypeEntry
 //============================================================================
 struct TypeIDMapEntry
 {
-    UniString m_aTypeName;
-    UniString m_aPresentation;
-    UniString m_aSystemFileType;
+    OUString m_aTypeName;
+    OUString m_aPresentation;
+    OUString m_aSystemFileType;
 };
 
 //============================================================================
 struct TypeNameMapEntry
 {
-    UniString m_aExtension;
+    OUString m_aExtension;
     INetContentType m_eTypeID;
 
     TypeNameMapEntry():
@@ -67,8 +67,8 @@ struct ExtensionMapEntry
 //============================================================================
 class Registration
 {
-    typedef boost::ptr_map<UniString, TypeNameMapEntry>  TypeNameMap;
-    typedef boost::ptr_map<UniString, ExtensionMapEntry> ExtensionMap;
+    typedef boost::ptr_map<OUString, TypeNameMapEntry>  TypeNameMap;
+    typedef boost::ptr_map<OUString, ExtensionMapEntry> ExtensionMap;
     typedef std::map<INetContentType, TypeIDMapEntry*>   TypeIDMap;
 
     TypeIDMap    m_aTypeIDMap;    // map ContentType to TypeID
@@ -83,23 +83,20 @@ public:
 public:
     static inline TypeIDMapEntry * getEntry(INetContentType eTypeID);
 
-    static TypeNameMapEntry * getExtensionEntry(UniString const & rTypeName);
+    static TypeNameMapEntry * getExtensionEntry(OUString const & rTypeName);
 
-    static INetContentType RegisterContentType(UniString const & rTypeName,
-                                               UniString const &
-                                                   rPresentation,
-                                               UniString const * pExtension,
-                                               UniString const *
-                                                   pSystemFileType);
+    static INetContentType RegisterContentType(OUString const & rTypeName,
+                                               OUString const & rPresentation,
+                                               OUString const * pExtension,
+                                               OUString const * pSystemFileType);
 
-    static INetContentType GetContentType(UniString const & rTypeName);
+    static INetContentType GetContentType(OUString const & rTypeName);
 
-    static rtl::OUString GetContentType(INetContentType eTypeID);
+    static OUString GetContentType(INetContentType eTypeID);
 
-    static UniString GetPresentation(INetContentType eTypeID);
+    static OUString GetPresentation(INetContentType eTypeID);
 
-    static INetContentType GetContentType4Extension(UniString const &
-                                                        rExtension);
+    static INetContentType GetContentType4Extension(OUString const & rExtension);
 
 };
 
@@ -122,7 +119,7 @@ inline TypeIDMapEntry * Registration::getEntry(INetContentType eTypeID)
 }
 
 //============================================================================
-MediaTypeEntry const * seekEntry(UniString const & rTypeName,
+MediaTypeEntry const * seekEntry(OUString const & rTypeName,
                                  MediaTypeEntry const * pMap, sal_Size nSize);
 
 //============================================================================
@@ -522,11 +519,10 @@ Registration::~Registration()
 
 //============================================================================
 // static
-TypeNameMapEntry * Registration::getExtensionEntry(UniString const &
-                                                       rTypeName)
+TypeNameMapEntry * Registration::getExtensionEntry(OUString const & rTypeName)
 {
-    UniString aTheTypeName = rTypeName;
-    aTheTypeName.ToLowerAscii();
+    OUString aTheTypeName = rTypeName;
+    aTheTypeName.toAsciiLowerCase();
     Registration &rRegistration = theRegistration::get();
     TypeNameMap::iterator it = rRegistration.m_aTypeNameMap.find(aTheTypeName);
     if (it != rRegistration.m_aTypeNameMap.end())
@@ -536,23 +532,19 @@ TypeNameMapEntry * Registration::getExtensionEntry(UniString const &
 
 //============================================================================
 // static
-INetContentType Registration::RegisterContentType(UniString const & rTypeName,
-                                                  UniString const &
-                                                      rPresentation,
-                                                  UniString const *
-                                                      pExtension,
-                                                  UniString const *
-                                                      pSystemFileType)
+INetContentType Registration::RegisterContentType(OUString const & rTypeName,
+                                                  OUString const & rPresentation,
+                                                  OUString const * pExtension,
+                                                  OUString const * pSystemFileType)
 {
     Registration &rRegistration = theRegistration::get();
 
     DBG_ASSERT(GetContentType(rTypeName) == CONTENT_TYPE_UNKNOWN,
                "Registration::RegisterContentType(): Already registered");
 
-    INetContentType eTypeID
-        = INetContentType(rRegistration.m_nNextDynamicID++);
-    UniString aTheTypeName = rTypeName;
-    aTheTypeName.ToLowerAscii();
+    INetContentType eTypeID = INetContentType(rRegistration.m_nNextDynamicID++);
+    OUString aTheTypeName = rTypeName;
+    aTheTypeName.toAsciiLowerCase();
 
     TypeIDMapEntry * pTypeIDMapEntry = new TypeIDMapEntry;
     pTypeIDMapEntry->m_aTypeName = aTheTypeName;
@@ -579,12 +571,12 @@ INetContentType Registration::RegisterContentType(UniString const & rTypeName,
 
 //============================================================================
 // static
-INetContentType Registration::GetContentType(UniString const & rTypeName)
+INetContentType Registration::GetContentType(OUString const & rTypeName)
 {
     Registration &rRegistration = theRegistration::get();
 
-    UniString aTheTypeName = rTypeName;
-    aTheTypeName.ToLowerAscii();
+    OUString aTheTypeName = rTypeName;
+    aTheTypeName.toAsciiLowerCase();
     TypeNameMap::iterator it = rRegistration.m_aTypeNameMap.find(aTheTypeName);
     return it != rRegistration.m_aTypeNameMap.end()
         ? it->second->m_eTypeID
@@ -593,19 +585,19 @@ INetContentType Registration::GetContentType(UniString const & rTypeName)
 
 //============================================================================
 // static
-rtl::OUString Registration::GetContentType(INetContentType eTypeID)
+OUString Registration::GetContentType(INetContentType eTypeID)
 {
     Registration &rRegistration = theRegistration::get();
 
     TypeIDMap::iterator pEntry = rRegistration.m_aTypeIDMap.find( eTypeID );
     if( pEntry != rRegistration.m_aTypeIDMap.end() )
         return pEntry->second->m_aTypeName;
-    return rtl::OUString();
+    return OUString();
 }
 
 //============================================================================
 // static
-UniString Registration::GetPresentation(INetContentType eTypeID)
+OUString Registration::GetPresentation(INetContentType eTypeID)
 {
     Registration &rRegistration = theRegistration::get();
 
@@ -613,13 +605,12 @@ UniString Registration::GetPresentation(INetContentType eTypeID)
     if( pEntry != rRegistration.m_aTypeIDMap.end() )
         return pEntry->second->m_aPresentation;
     else
-        return  UniString();
+        return  OUString();
 }
 
 //============================================================================
 // static
-INetContentType Registration::GetContentType4Extension(UniString const &
-                                                           rExtension)
+INetContentType Registration::GetContentType4Extension(OUString const & rExtension)
 {
     Registration &rRegistration = theRegistration::get();
 
@@ -638,7 +629,7 @@ INetContentType Registration::GetContentType4Extension(UniString const &
 namespace
 {
 
-MediaTypeEntry const * seekEntry(UniString const & rTypeName,
+MediaTypeEntry const * seekEntry(OUString const & rTypeName,
                                  MediaTypeEntry const * pMap, sal_Size nSize)
 {
 #if defined DBG_UTIL
@@ -655,7 +646,7 @@ MediaTypeEntry const * seekEntry(UniString const & rTypeName,
     {
         sal_Size nMiddle = (nLow + nHigh) / 2;
         MediaTypeEntry const * pEntry = pMap + nMiddle;
-        switch (rTypeName.CompareIgnoreCaseToAscii(pEntry->m_pTypeName))
+        switch (rTypeName.compareToIgnoreAsciiCaseAscii(pEntry->m_pTypeName))
         {
             case COMPARE_LESS:
                 nHigh = nMiddle;
@@ -675,14 +666,10 @@ MediaTypeEntry const * seekEntry(UniString const & rTypeName,
 }
 
 //static
-INetContentType INetContentTypes::RegisterContentType(UniString const &
-                                                          rTypeName,
-                                                      UniString const &
-                                                          rPresentation,
-                                                      UniString const *
-                                                          pExtension,
-                                                      UniString const *
-                                                          pSystemFileType)
+INetContentType INetContentTypes::RegisterContentType(OUString const & rTypeName,
+                                                      OUString const & rPresentation,
+                                                      OUString const * pExtension,
+                                                      OUString const * pSystemFileType)
 {
     INetContentType eTypeID = GetContentType(rTypeName);
     if (eTypeID == CONTENT_TYPE_UNKNOWN)
@@ -694,15 +681,14 @@ INetContentType INetContentTypes::RegisterContentType(UniString const &
         TypeIDMapEntry * pTypeEntry = Registration::getEntry(eTypeID);
         if (pTypeEntry)
         {
-            if (rPresentation.Len() != 0)
+            if (!rPresentation.isEmpty())
                 pTypeEntry->m_aPresentation = rPresentation;
             if (pSystemFileType)
                 pTypeEntry->m_aSystemFileType = *pSystemFileType;
         }
         if (pExtension)
         {
-            TypeNameMapEntry * pEntry
-                = Registration::getExtensionEntry(rTypeName);
+            TypeNameMapEntry * pEntry = Registration::getExtensionEntry(rTypeName);
             if (pEntry)
                 pEntry->m_aExtension = *pExtension;
         }
@@ -712,57 +698,53 @@ INetContentType INetContentTypes::RegisterContentType(UniString const &
 
 //============================================================================
 // static
-INetContentType INetContentTypes::GetContentType(UniString const & rTypeName)
+INetContentType INetContentTypes::GetContentType(OUString const & rTypeName)
 {
-    UniString aType;
-    UniString aSubType;
+    OUString aType;
+    OUString aSubType;
     if (parse(rTypeName, aType, aSubType))
     {
-        aType += '/';
+        aType += "/";
         aType += aSubType;
         MediaTypeEntry const * pEntry = seekEntry(aType, aStaticTypeNameMap,
                                                   CONTENT_TYPE_LAST + 1);
-        return pEntry ? pEntry->m_eTypeID :
-                        Registration::GetContentType(aType);
+        return pEntry ? pEntry->m_eTypeID : Registration::GetContentType(aType);
     }
     else
-        return
-            rTypeName.EqualsIgnoreCaseAscii(CONTENT_TYPE_STR_X_STARMAIL) ?
-                CONTENT_TYPE_X_STARMAIL : CONTENT_TYPE_UNKNOWN;
+        return rTypeName.equalsIgnoreAsciiCaseAscii(CONTENT_TYPE_STR_X_STARMAIL) ?
+            CONTENT_TYPE_X_STARMAIL : CONTENT_TYPE_UNKNOWN;
             // the content type "x-starmail" has no sub type
 }
 
 //============================================================================
 //static
-rtl::OUString INetContentTypes::GetContentType(INetContentType eTypeID)
+OUString INetContentTypes::GetContentType(INetContentType eTypeID)
 {
     static sal_Char const * aMap[CONTENT_TYPE_LAST + 1];
     static bool bInitialized = false;
     if (!bInitialized)
     {
         for (sal_Size i = 0; i <= CONTENT_TYPE_LAST; ++i)
-            aMap[aStaticTypeNameMap[i].m_eTypeID]
-                = aStaticTypeNameMap[i].m_pTypeName;
+            aMap[aStaticTypeNameMap[i].m_eTypeID] = aStaticTypeNameMap[i].m_pTypeName;
         aMap[CONTENT_TYPE_UNKNOWN] = CONTENT_TYPE_STR_APP_OCTSTREAM;
         aMap[CONTENT_TYPE_TEXT_PLAIN] = CONTENT_TYPE_STR_TEXT_PLAIN
                                             "; charset=iso-8859-1";
         bInitialized = true;
     }
 
-    rtl::OUString aTypeName = eTypeID <= CONTENT_TYPE_LAST ?
-                              rtl::OUString::createFromAscii(aMap[eTypeID]) :
-                              Registration::GetContentType(eTypeID);
+    OUString aTypeName = eTypeID <= CONTENT_TYPE_LAST ? OUString::createFromAscii(aMap[eTypeID])
+                                                      : Registration::GetContentType(eTypeID);
     if (aTypeName.isEmpty())
     {
         OSL_FAIL("INetContentTypes::GetContentType(): Bad ID");
-        return rtl::OUString(CONTENT_TYPE_STR_APP_OCTSTREAM);
+        return OUString(CONTENT_TYPE_STR_APP_OCTSTREAM);
     }
     return aTypeName;
 }
 
 //============================================================================
 //static
-UniString INetContentTypes::GetPresentation(INetContentType eTypeID,
+OUString INetContentTypes::GetPresentation(INetContentType eTypeID,
                                             const ::com::sun::star::lang::Locale& aLocale)
 {
     sal_uInt16 nResID = sal_uInt16();
@@ -770,8 +752,8 @@ UniString INetContentTypes::GetPresentation(INetContentType eTypeID,
         nResID = aStaticResourceIDMap[eTypeID];
     else
     {
-        UniString aPresentation = Registration::GetPresentation(eTypeID);
-        if (aPresentation.Len() == 0)
+        OUString aPresentation = Registration::GetPresentation(eTypeID);
+        if (aPresentation.isEmpty())
             nResID = STR_SVT_MIMETYPE_APP_OCTSTREAM;
         else
             return aPresentation;
@@ -781,38 +763,34 @@ UniString INetContentTypes::GetPresentation(INetContentType eTypeID,
 
 //============================================================================
 //static
-INetContentType INetContentTypes::GetContentType4Extension(UniString const &
-                                                               rExtension)
+INetContentType INetContentTypes::GetContentType4Extension(OUString const & rExtension)
 {
     MediaTypeEntry const * pEntry = seekEntry(rExtension, aStaticExtensionMap,
-                                              sizeof aStaticExtensionMap
-                                                  / sizeof (MediaTypeEntry));
+                                              sizeof aStaticExtensionMap / sizeof (MediaTypeEntry));
     if (pEntry)
         return pEntry->m_eTypeID;
-    INetContentType eTypeID
-        = Registration::GetContentType4Extension(rExtension);
-    return eTypeID == CONTENT_TYPE_UNKNOWN ? CONTENT_TYPE_APP_OCTSTREAM :
-                                             eTypeID;
+    INetContentType eTypeID = Registration::GetContentType4Extension(rExtension);
+    return eTypeID == CONTENT_TYPE_UNKNOWN ? CONTENT_TYPE_APP_OCTSTREAM
+                                           : eTypeID;
 }
 
 //============================================================================
 //static
-INetContentType INetContentTypes::GetContentTypeFromURL(UniString const &
-                                                            rURL)
+INetContentType INetContentTypes::GetContentTypeFromURL(OUString const & rURL)
 {
     INetContentType eTypeID = CONTENT_TYPE_UNKNOWN;
-    UniString aToken = rURL.GetToken(0, ':');
-    if (aToken.Len() != 0)
+    OUString aToken = rURL.getToken(0, ':');
+    if (!aToken.isEmpty())
     {
-        if (aToken.EqualsIgnoreCaseAscii(INETTYPE_URL_PROT_FILE))
-            if (rURL.GetChar(rURL.Len() - 1) == '/') // folder
-                if (rURL.Len() > RTL_CONSTASCII_LENGTH("file:///"))
+        if (aToken.equalsIgnoreAsciiCaseAscii(INETTYPE_URL_PROT_FILE))
+            if (rURL[ rURL.getLength() - 1 ] == (sal_Unicode)'/') // folder
+                if (rURL.getLength() > RTL_CONSTASCII_LENGTH("file:///"))
                     if (WildCard("*/{*}/").Matches(rURL)) // special folder
                         eTypeID = CONTENT_TYPE_X_CNT_FSYSSPECIALFOLDER;
                     else
                         // drive? -> "file:///?|/"
-                        if (rURL.Len() == 11
-                            && rURL.GetChar(rURL.Len() - 2) == '|')
+                        if (rURL.getLength() == 11
+                            && rURL[ rURL.getLength() - 2 ] == '|')
                         {
                             // Drives need further processing, because of
                             // dynamic type according to underlying volume,
@@ -826,72 +804,80 @@ INetContentType INetContentTypes::GetContentTypeFromURL(UniString const &
             {
                 //@@@
             }
-        else if (aToken.EqualsIgnoreCaseAscii(INETTYPE_URL_PROT_HTTP)
-                 || aToken.EqualsIgnoreCaseAscii(INETTYPE_URL_PROT_HTTPS))
+        else if (aToken.equalsIgnoreAsciiCaseAscii(INETTYPE_URL_PROT_HTTP)
+                 || aToken.equalsIgnoreAsciiCaseAscii(INETTYPE_URL_PROT_HTTPS))
             eTypeID = CONTENT_TYPE_TEXT_HTML;
-        else if (aToken.EqualsIgnoreCaseAscii(INETTYPE_URL_PROT_PRIVATE))
+        else if (aToken.equalsIgnoreAsciiCaseAscii(INETTYPE_URL_PROT_PRIVATE))
         {
-            UniString aSecondPart = rURL.GetToken(1, ':');
-            aToken = aSecondPart.GetToken(0, '/');
-            if (aToken.EqualsAscii(INETTYPE_URL_SUB_FACTORY))
+            OUString aSecondPart = rURL.getToken(1, ':');
+            aToken = aSecondPart.getToken(0, '/');
+            if (aToken.equalsAscii(INETTYPE_URL_SUB_FACTORY))
             {
-                aToken = aSecondPart.GetToken(1, '/');
-                if (aToken.EqualsAscii(INETTYPE_URL_SSUB_SWRITER))
+                aToken = aSecondPart.getToken(1, '/');
+                if (aToken.equalsAscii(INETTYPE_URL_SSUB_SWRITER))
                 {
-                    aToken = aSecondPart.GetToken(2, '/');
-                    eTypeID = aToken.EqualsAscii(INETTYPE_URL_SSSUB_WEB) ?
+                    aToken = aSecondPart.getToken(2, '/');
+                    eTypeID = aToken.equalsAscii(INETTYPE_URL_SSSUB_WEB) ?
                                   CONTENT_TYPE_APP_VND_WRITER_WEB :
-                              aToken.EqualsAscii(INETTYPE_URL_SSSUB_GLOB) ?
+                              aToken.equalsAscii(INETTYPE_URL_SSSUB_GLOB) ?
                                   CONTENT_TYPE_APP_VND_WRITER_GLOBAL :
                                   CONTENT_TYPE_APP_VND_WRITER;
                 }
-                else if (aToken.EqualsAscii(INETTYPE_URL_SSUB_SCALC))
+                else if (aToken.equalsAscii(INETTYPE_URL_SSUB_SCALC))
                     eTypeID = CONTENT_TYPE_APP_VND_CALC;
-                else if (aToken.EqualsAscii(INETTYPE_URL_SSUB_SDRAW))
+                else if (aToken.equalsAscii(INETTYPE_URL_SSUB_SDRAW))
                     eTypeID = CONTENT_TYPE_APP_VND_DRAW;
-                else if (aToken.EqualsAscii(INETTYPE_URL_SSUB_SIMPRESS))
+                else if (aToken.equalsAscii(INETTYPE_URL_SSUB_SIMPRESS))
                     eTypeID = CONTENT_TYPE_APP_VND_IMPRESS;
-                else if (aToken.EqualsAscii(INETTYPE_URL_SSUB_SCHART))
+                else if (aToken.equalsAscii(INETTYPE_URL_SSUB_SCHART))
                     eTypeID = CONTENT_TYPE_APP_VND_CHART;
-                else if (aToken.EqualsAscii(INETTYPE_URL_SSUB_SIMAGE))
+                else if (aToken.equalsAscii(INETTYPE_URL_SSUB_SIMAGE))
                     eTypeID = CONTENT_TYPE_APP_VND_IMAGE;
-                else if (aToken.EqualsAscii(INETTYPE_URL_SSUB_SMATH))
+                else if (aToken.equalsAscii(INETTYPE_URL_SSUB_SMATH))
                     eTypeID = CONTENT_TYPE_APP_VND_MATH;
-                else if (aToken.EqualsAscii(INETTYPE_URL_SSUB_FRAMESET))
+                else if (aToken.equalsAscii(INETTYPE_URL_SSUB_FRAMESET))
                     eTypeID = CONTENT_TYPE_APP_FRAMESET;
             }
-            else if (aToken.EqualsAscii(INETTYPE_URL_SUB_HELPID))
+            else if (aToken.equalsAscii(INETTYPE_URL_SUB_HELPID))
                 eTypeID = CONTENT_TYPE_APP_STARHELP;
         }
-        else if (aToken.EqualsIgnoreCaseAscii(INETTYPE_URL_PROT_COMPONENT))
+        else if (aToken.equalsIgnoreAsciiCaseAscii(INETTYPE_URL_PROT_COMPONENT))
         {
-            aToken = rURL.GetToken(1, ':'); // aToken now equals ss / *
-            aToken = aToken.GetToken(0, '/');
-              if (aToken.EqualsAscii(INETTYPE_URL_SSUB_SS))
-                  eTypeID = rURL.SearchAscii(INETTYPE_URL_SCHED_CMB)
-                              == STRING_NOTFOUND
-                          && rURL.SearchAscii(INETTYPE_URL_SCHED_FORM)
-                                 == STRING_NOTFOUND ?
-                              CONTENT_TYPE_APP_SCHEDULE :
-                          rURL.SearchAscii(INETTYPE_URL_SCHED_TASK)
-                                  == STRING_NOTFOUND ?
-                              CONTENT_TYPE_APP_SCHEDULE_EVT :
-                              CONTENT_TYPE_APP_SCHEDULE_TASK;
+            aToken = rURL.getToken(1, ':'); // aToken now equals ss / *
+            aToken = aToken.getToken(0, '/');
+            if (aToken.equalsAscii(INETTYPE_URL_SSUB_SS))
+            {
+                if(rURL.indexOf(INETTYPE_URL_SCHED_CMB) < 0 && rURL.indexOf(INETTYPE_URL_SCHED_FORM) < 0)
+                {
+                    eTypeID = CONTENT_TYPE_APP_SCHEDULE;
+                }
+                else
+                {
+                    if( rURL.indexOf(INETTYPE_URL_SCHED_TASK) < 0)
+                    {
+                        eTypeID = CONTENT_TYPE_APP_SCHEDULE_EVT;
+                    }
+                    else
+                    {
+                        eTypeID = CONTENT_TYPE_APP_SCHEDULE_TASK;
+                    }
+                }
+            }
         }
-        else if (aToken.EqualsIgnoreCaseAscii(INETTYPE_URL_PROT_MAILTO))
+        else if (aToken.equalsIgnoreAsciiCaseAscii(INETTYPE_URL_PROT_MAILTO))
             eTypeID = CONTENT_TYPE_APP_VND_OUTTRAY;
-        else if (aToken.EqualsIgnoreCaseAscii(INETTYPE_URL_PROT_MACRO))
+        else if (aToken.equalsIgnoreAsciiCaseAscii(INETTYPE_URL_PROT_MACRO))
             eTypeID = CONTENT_TYPE_APP_MACRO;
-        else if (aToken.EqualsIgnoreCaseAscii(INETTYPE_URL_PROT_DATA))
+        else if (aToken.equalsIgnoreAsciiCaseAscii(INETTYPE_URL_PROT_DATA))
         {
-            UniString aSecondPart = rURL.GetToken(1, ':');
-            aToken = aSecondPart.GetToken(0, ',');
+            OUString aSecondPart = rURL.getToken(1, ':');
+            aToken = aSecondPart.getToken(0, ',');
             eTypeID = GetContentType(aToken);
         }
     }
     if (eTypeID == CONTENT_TYPE_UNKNOWN)
     {
-        UniString aExtension;
+        OUString aExtension;
         if (GetExtensionFromURL(rURL, aExtension))
             eTypeID = GetContentType4Extension(aExtension);
     }
@@ -900,26 +886,26 @@ INetContentType INetContentTypes::GetContentTypeFromURL(UniString const &
 
 //============================================================================
 //static
-bool INetContentTypes::GetExtensionFromURL(UniString const & rURL,
-                                           UniString & rExtension)
+bool INetContentTypes::GetExtensionFromURL(OUString const & rURL,
+                                           OUString & rExtension)
 {
-    xub_StrLen nSlashPos = 0;
-    xub_StrLen i = 0;
-    while (i != STRING_NOTFOUND)
+    sal_Int32 nSlashPos = 0;
+    sal_Int32 i = 0;
+    while (i >= 0)
     {
         nSlashPos = i;
-        i = rURL.Search('/', i + 1);
+        i = rURL.indexOf((sal_Unicode)'/', i + 1);
     }
     if (nSlashPos != 0)
     {
-        xub_StrLen nLastDotPos = i = rURL.Search('.', nSlashPos);
-        while (i != STRING_NOTFOUND)
+        sal_Int32 nLastDotPos = i = rURL.indexOf((sal_Unicode)'.', nSlashPos);
+        while (i >= 0)
         {
             nLastDotPos = i;
-            i = rURL.Search('.', i + 1);
+            i = rURL.indexOf((sal_Unicode)'.', i + 1);
         }
-        if (nLastDotPos != STRING_NOTFOUND)
-            rExtension = rURL.Copy(nLastDotPos + 1);
+        if (nLastDotPos >- 0)
+            rExtension = rURL.copy(nLastDotPos + 1);
         return true;
     }
     return false;
@@ -927,12 +913,12 @@ bool INetContentTypes::GetExtensionFromURL(UniString const & rURL,
 
 //============================================================================
 // static
-bool INetContentTypes::parse(UniString const & rMediaType,
-                             UniString & rType, UniString & rSubType,
+bool INetContentTypes::parse(OUString const & rMediaType,
+                             OUString & rType, OUString & rSubType,
                              INetContentTypeParameterList * pParameters)
 {
-    sal_Unicode const * p = rMediaType.GetBuffer();
-    sal_Unicode const * pEnd = p + rMediaType.Len();
+    sal_Unicode const * p = rMediaType.getStr();
+    sal_Unicode const * pEnd = p + rMediaType.getLength();
 
     p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd);
     sal_Unicode const * pToken = p;
@@ -944,9 +930,9 @@ bool INetContentTypes::parse(UniString const & rMediaType,
     }
     if (p == pToken)
         return false;
-    rType = rtl::OUString(pToken, p - pToken);
+    rType = OUString(pToken, p - pToken);
     if (bDowncase)
-        rType.ToLowerAscii();
+        rType.toAsciiLowerCase();
 
     p = INetMIME::skipLinearWhiteSpaceComment(p, pEnd);
     if (p == pEnd || *p++ != '/')
@@ -962,9 +948,9 @@ bool INetContentTypes::parse(UniString const & rMediaType,
     }
     if (p == pToken)
         return false;
-    rSubType = rtl::OUString(pToken, p - pToken);
+    rSubType = OUString(pToken, p - pToken);
     if (bDowncase)
-        rSubType.ToLowerAscii();
+        rSubType.toAsciiLowerCase();
 
     return INetMIME::scanParameters(p, pEnd, pParameters) == pEnd;
 }
diff --git a/svtools/source/contnr/DocumentInfoPreview.cxx b/svtools/source/contnr/DocumentInfoPreview.cxx
index b538cba..379355b 100644
--- a/svtools/source/contnr/DocumentInfoPreview.cxx
+++ b/svtools/source/contnr/DocumentInfoPreview.cxx
@@ -91,11 +91,14 @@ void ODocumentInfoPreview::fill(
         insertNonempty(
             DI_SIZE, CreateExactSizeText(utl::UCBContentHelper::GetSize(rURL)));
         INetContentType eTypeID = INetContentTypes::GetContentTypeFromURL(rURL);
-        insertNonempty(
-            DI_MIMETYPE,
-            (eTypeID == CONTENT_TYPE_APP_OCTSTREAM
-             ? SvFileInformationManager::GetDescription(INetURLObject(rURL))
-             : INetContentTypes::GetPresentation(eTypeID, m_aLocale)));
+        if(eTypeID == CONTENT_TYPE_APP_OCTSTREAM)
+        {
+            insertNonempty( DI_MIMETYPE, SvFileInformationManager::GetDescription(INetURLObject(rURL)));
+        }
+        else
+        {
+            insertNonempty( DI_MIMETYPE, INetContentTypes::GetPresentation(eTypeID, m_aLocale));
+        }
     }
 
     // User-defined (custom) properties:
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index 5fae26d..68232e5 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -2247,19 +2247,16 @@ bool HTMLParser::ParseMetaOptions(
 
 rtl_TextEncoding HTMLParser::GetEncodingByMIME( const String& rMime )
 {
-    String sType;
-    String sSubType;
+    OUString sType;
+    OUString sSubType;
     INetContentTypeParameterList aParameters;
     if (INetContentTypes::parse(rMime, sType, sSubType, &aParameters))
     {
-        const INetContentTypeParameter * pCharset
-            = aParameters.find("charset");
+        const INetContentTypeParameter * pCharset = aParameters.find("charset");
         if (pCharset != 0)
         {
-            rtl::OString sValue(rtl::OUStringToOString(pCharset->m_sValue,
-                RTL_TEXTENCODING_ASCII_US));
-            return GetExtendedCompatibilityTextEncoding(
-                    rtl_getTextEncodingFromMimeCharset( sValue.getStr() ) );
+            OString sValue(rtl::OUStringToOString(pCharset->m_sValue, RTL_TEXTENCODING_ASCII_US));
+            return GetExtendedCompatibilityTextEncoding( rtl_getTextEncodingFromMimeCharset( sValue.getStr() ) );
         }
     }
     return RTL_TEXTENCODING_DONTKNOW;
commit e55f0825c39c2d4f6991f40bcebadaef4f75337f
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Tue Nov 27 07:00:04 2012 -0600

    OUString has a matchIgnoreAsciiCase but no compareTo version of it
    
    Change-Id: Ie02dc3511e262a3b13df38ddbe0b3136f291ac9e

diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index 3930f9d..aeb2b79 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -525,6 +525,30 @@ public:
     }
 
     /**
+      Perform a ASCII lowercase comparison of two strings.
+
+      Compare teh two string with uppercase ASCII
+      character values between 65 and 90 (ASCII A-Z) are interpreted as
+      values between 97 and 122 (ASCII a-z).
+      This function can't be used for language specific comparison.
+
+      @param    str         the object to be compared.
+      @return   0 - if both strings are equal
+                < 0 - if this string is less than the string argument
+                > 0 - if this string is greater than the string argument
+    */
+    sal_Int32 compareToIgnoreAsciiCase( const OUString & str ) const SAL_THROW(())
+    {
+        if ( pData->length != str.pData->length )
+            return sal_False;
+        if ( pData == str.pData )
+            return sal_True;
+        return rtl_ustr_compareIgnoreAsciiCase_WithLength( pData->buffer, pData->length,
+                                                           str.pData->buffer, str.pData->length );
+    }
+
+
+    /**
      @overload
      This function accepts an ASCII string literal as its argument.
      @since LibreOffice 3.6
commit c33019b36d613f951787ce9836e34d74bfbd6a1b
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Tue Nov 27 02:35:09 2012 -0600

    String->OUString in svl urifilter and restrictedpaths
    
    Change-Id: If11b8752c3aa21554c3ee06de07d63639695e284

diff --git a/svl/inc/svl/adrparse.hxx b/svl/inc/svl/adrparse.hxx
index f788b03..063ba11 100644
--- a/svl/inc/svl/adrparse.hxx
+++ b/svl/inc/svl/adrparse.hxx
@@ -21,21 +21,20 @@
 #define _ADRPARSE_HXX
 
 #include "svl/svldllapi.h"
-#include <tools/string.hxx>
 #include <vector>
 
 //============================================================================
 struct SvAddressEntry_Impl
 {
-    rtl::OUString m_aAddrSpec;
-    rtl::OUString m_aRealName;
+    OUString m_aAddrSpec;
+    OUString m_aRealName;
 
     SvAddressEntry_Impl()
     {
     }
 
-    SvAddressEntry_Impl(const rtl::OUString& rTheAddrSpec,
-                        const rtl::OUString& rTheRealName)
+    SvAddressEntry_Impl(const OUString& rTheAddrSpec,
+                        const OUString& rTheRealName)
         : m_aAddrSpec(rTheAddrSpec)
         , m_aRealName(rTheRealName)
     {
@@ -55,19 +54,19 @@ class SVL_DLLPUBLIC SvAddressParser
     bool m_bHasFirst;
 
 public:
-    SvAddressParser(const rtl::OUString& rInput);
+    SvAddressParser(const OUString& rInput);
 
     ~SvAddressParser();
 
     sal_Int32 Count() const { return m_bHasFirst ? m_aRest.size() + 1 : 0; }
 
-    const rtl::OUString& GetEmailAddress(sal_Int32 nIndex) const
+    const OUString& GetEmailAddress(sal_Int32 nIndex) const
     {
         return nIndex == 0 ? m_aFirst.m_aAddrSpec :
                              m_aRest[ nIndex - 1 ]->m_aAddrSpec;
     }
 
-    const rtl::OUString& GetRealName(sal_Int32 nIndex) const
+    const OUString& GetRealName(sal_Int32 nIndex) const
     {
         return nIndex == 0 ? m_aFirst.m_aRealName :
                              m_aRest[ nIndex - 1 ]->m_aRealName;
diff --git a/svl/inc/svl/restrictedpaths.hxx b/svl/inc/svl/restrictedpaths.hxx
index 92ece85..85326a5 100644
--- a/svl/inc/svl/restrictedpaths.hxx
+++ b/svl/inc/svl/restrictedpaths.hxx
@@ -22,7 +22,6 @@
 
 #include <svl/urlfilter.hxx>
 #include <svl/svldllapi.h>
-#include <tools/string.hxx>
 
 #include <vector>
 
@@ -31,7 +30,7 @@ namespace svt
     class SVL_DLLPUBLIC RestrictedPaths : public IUrlFilter
     {
     private:
-        ::std::vector< String >     m_aUnrestrictedURLs;
+        ::std::vector< OUString >     m_aUnrestrictedURLs;
         bool                        m_bFilterIsEnabled;
 
     public:
@@ -39,7 +38,7 @@ namespace svt
         virtual ~RestrictedPaths();
 
         inline bool hasFilter() const { return !m_aUnrestrictedURLs.empty(); }
-        inline const ::std::vector< String >& getFilter() const { return m_aUnrestrictedURLs; }
+        inline const ::std::vector< OUString >& getFilter() const { return m_aUnrestrictedURLs; }
 
         inline void enableFilter( bool _bEnable ) { m_bFilterIsEnabled = _bEnable; }
         inline bool isFilterEnabled() const { return m_bFilterIsEnabled; }
@@ -53,7 +52,7 @@ namespace svt
 
             <p>If no "access restriction" is effective, this method always returns <TRUE/>.</p>
         */
-        virtual bool                isUrlAllowed( const String& _rURL ) const;
+        virtual bool                isUrlAllowed( const OUString& _rURL ) const;
 
         /** checks URL access permissions
 
@@ -66,7 +65,7 @@ namespace svt
 
             <p>If no "access restriction" is effective, this method always returns <TRUE/>.</p>
         */
-        bool                        isUrlAllowed( const String& _rURL, bool allowParents ) const;
+        bool                        isUrlAllowed( const OUString& _rURL, bool allowParents ) const;
     };
 
 }   // namespace svt
diff --git a/svl/inc/svl/urlfilter.hxx b/svl/inc/svl/urlfilter.hxx
index 9e13d43..abcf0fd 100644
--- a/svl/inc/svl/urlfilter.hxx
+++ b/svl/inc/svl/urlfilter.hxx
@@ -20,7 +20,6 @@
 #ifndef SVTOOLS_URL_FILTER_HXX
 #define SVTOOLS_URL_FILTER_HXX
 
-#include <tools/string.hxx>
 #include <tools/wldcrd.hxx>
 #include <functional>
 #include <vector>
@@ -29,7 +28,7 @@
 class IUrlFilter
 {
 public:
-    virtual bool isUrlAllowed( const String& _rURL ) const = 0;
+    virtual bool isUrlAllowed( const OUString& _rURL ) const = 0;
 
 protected:
     virtual inline ~IUrlFilter() = 0;
@@ -40,16 +39,16 @@ inline IUrlFilter::~IUrlFilter() {}
 struct FilterMatch : public ::std::unary_function< bool, WildCard >
 {
 private:
-    const String&   m_rCompareString;
+    const OUString&   m_rCompareString;
 public:
-    FilterMatch( const String& _rCompareString ) : m_rCompareString( _rCompareString ) { }
+    FilterMatch( const OUString& _rCompareString ) : m_rCompareString( _rCompareString ) { }
 
     bool operator()( const WildCard& _rMatcher )
     {
         return _rMatcher.Matches( m_rCompareString ) ? true : false;
     }
 
-    static void createWildCardFilterList(const String& _rFilterList,::std::vector< WildCard >& _rFilters);
+    static void createWildCardFilterList(const OUString& _rFilterList,::std::vector< WildCard >& _rFilters);
 };
 
 #endif // SVTOOLS_URL_FILTER_HXX
diff --git a/svl/source/misc/adrparse.cxx b/svl/source/misc/adrparse.cxx
index fd5553e..b8914ea 100644
--- a/svl/source/misc/adrparse.cxx
+++ b/svl/source/misc/adrparse.cxx
@@ -106,14 +106,14 @@ class SvAddressParser_Impl
 
     bool readToken();
 
-    static rtl::OUString reparse(sal_Unicode const * pBegin,
-                             sal_Unicode const * pEnd, bool bAddrSpec);
+    static OUString reparse(sal_Unicode const * pBegin,
+                            sal_Unicode const * pEnd, bool bAddrSpec);
 
-    static rtl::OUString reparseComment(sal_Unicode const * pBegin,
-                                    sal_Unicode const * pEnd);
+    static OUString reparseComment(sal_Unicode const * pBegin,
+                                   sal_Unicode const * pEnd);
 
 public:
-    SvAddressParser_Impl(SvAddressParser * pParser, const rtl::OUString& rIn);
+    SvAddressParser_Impl(SvAddressParser * pParser, const OUString& rIn);
 };
 
 inline void SvAddressParser_Impl::resetRealNameAndFirstComment()
@@ -229,7 +229,7 @@ bool SvAddressParser_Impl::readToken()
             m_pCurTokenContentBegin = 0;
             m_pCurTokenContentEnd = 0;
             bool bEscaped = false;
-            xub_StrLen nLevel = 0;
+            int nLevel = 0;
             for (;;)
             {
                 if (m_pInputPos >= m_pInputEnd)
@@ -318,112 +318,112 @@ bool SvAddressParser_Impl::readToken()
 
 //============================================================================
 // static
-rtl::OUString SvAddressParser_Impl::reparse(sal_Unicode const * pBegin,
-    sal_Unicode const * pEnd, bool bAddrSpec)
+OUString SvAddressParser_Impl::reparse(sal_Unicode const * pBegin,
+                                       sal_Unicode const * pEnd, bool bAddrSpec)
 {
-    rtl::OUStringBuffer aResult;
+    OUStringBuffer aResult;
     TokenType eMode = TOKEN_ATOM;
     bool bEscaped = false;
     bool bEndsWithSpace = false;
-    xub_StrLen nLevel = 0;
+    int nLevel = 0;
     while (pBegin < pEnd)
     {
         sal_Unicode cChar = *pBegin++;
         switch (eMode)
         {
-            case TOKEN_QUOTED:
-                if (bEscaped)
-                {
+        case TOKEN_QUOTED:
+            if (bEscaped)
+            {
+                aResult.append(cChar);
+                bEscaped = false;
+            }
+            else if (cChar == '"')
+            {
+                if (bAddrSpec)
                     aResult.append(cChar);
-                    bEscaped = false;
-                }
-                else if (cChar == '"')
-                {
-                    if (bAddrSpec)
-                        aResult.append(cChar);
-                    eMode = TOKEN_ATOM;
-                }
-                else if (cChar == '\\')
-                {
-                    if (bAddrSpec)
-                        aResult.append(cChar);
-                    bEscaped = true;
-                }
-                else
+                eMode = TOKEN_ATOM;
+            }
+            else if (cChar == '\\')
+            {
+                if (bAddrSpec)
                     aResult.append(cChar);
-                break;
+                bEscaped = true;
+            }
+            else
+                aResult.append(cChar);
+            break;
 
-            case TOKEN_DOMAIN:
-                if (bEscaped)
-                {
+        case TOKEN_DOMAIN:
+            if (bEscaped)
+            {
+                aResult.append(cChar);
+                bEscaped = false;
+            }
+            else if (cChar == ']')
+            {
+                aResult.append(cChar);
+                eMode = TOKEN_ATOM;
+            }
+            else if (cChar == '\\')
+            {
+                if (bAddrSpec)
                     aResult.append(cChar);
-                    bEscaped = false;
+                bEscaped = true;
+            }
+            else
+                aResult.append(cChar);
+            break;
+
+        case TOKEN_COMMENT:
+            if (bEscaped)
+                bEscaped = false;
+            else if (cChar == '(')
+                ++nLevel;
+            else if (cChar == ')')
+                if (nLevel)
+                    --nLevel;
+                else
+                    eMode = TOKEN_ATOM;
+            else if (cChar == '\\')
+                bEscaped = true;
+            break;
+
+        case TOKEN_ATOM:
+            if (cChar <= ' ' || cChar == 0x7F) // DEL
+            {
+                if (!bAddrSpec && !bEndsWithSpace)
+                {
+                    aResult.append(' ');
+                    bEndsWithSpace = true;
                 }
-                else if (cChar == ']')
+            }
+            else if (cChar == '(')
+            {
+                if (!bAddrSpec && !bEndsWithSpace)
                 {
-                    aResult.append(cChar);
-                    eMode = TOKEN_ATOM;
+                    aResult.append(' ');
+                    bEndsWithSpace = true;
                 }
-                else if (cChar == '\\')
+                eMode = TOKEN_COMMENT;
+            }
+            else
+            {
+                bEndsWithSpace = false;
+                if (cChar == '"')
                 {
                     if (bAddrSpec)
                         aResult.append(cChar);
-                    bEscaped = true;
-                }
-                else
-                    aResult.append(cChar);
-                break;
-
-            case TOKEN_COMMENT:
-                if (bEscaped)
-                    bEscaped = false;
-                else if (cChar == '(')
-                    ++nLevel;
-                else if (cChar == ')')
-                    if (nLevel)
-                        --nLevel;
-                    else
-                        eMode = TOKEN_ATOM;
-                else if (cChar == '\\')
-                    bEscaped = true;
-                break;
-
-            case TOKEN_ATOM:
-                if (cChar <= ' ' || cChar == 0x7F) // DEL
-                {
-                    if (!bAddrSpec && !bEndsWithSpace)
-                    {
-                        aResult.append(' ');
-                        bEndsWithSpace = true;
-                    }
+                    eMode = TOKEN_QUOTED;
                 }
-                else if (cChar == '(')
+                else if (cChar == '[')
                 {
-                    if (!bAddrSpec && !bEndsWithSpace)
-                    {
-                        aResult.append(' ');
-                        bEndsWithSpace = true;
-                    }
-                    eMode = TOKEN_COMMENT;
+                    aResult.append(cChar);
+                    eMode = TOKEN_QUOTED;
                 }
                 else
-                {
-                    bEndsWithSpace = false;
-                    if (cChar == '"')
-                    {
-                        if (bAddrSpec)
-                            aResult.append(cChar);
-                        eMode = TOKEN_QUOTED;
-                    }
-                    else if (cChar == '[')
-                    {
-                        aResult.append(cChar);
-                        eMode = TOKEN_QUOTED;
-                    }
-                    else
-                        aResult.append(cChar);
-                }
-                break;
+                    aResult.append(cChar);
+            }
+            break;
         }
     }
     return aResult.makeStringAndClear();
@@ -431,10 +431,10 @@ rtl::OUString SvAddressParser_Impl::reparse(sal_Unicode const * pBegin,
 
 //============================================================================
 // static
-rtl::OUString SvAddressParser_Impl::reparseComment(sal_Unicode const * pBegin,
-    sal_Unicode const * pEnd)
+OUString SvAddressParser_Impl::reparseComment(sal_Unicode const * pBegin,
+                                              sal_Unicode const * pEnd)
 {
-    rtl::OUStringBuffer aResult;
+    OUStringBuffer aResult;
     while (pBegin < pEnd)
     {
         sal_Unicode cChar = *pBegin++;
@@ -447,7 +447,7 @@ rtl::OUString SvAddressParser_Impl::reparseComment(sal_Unicode const * pBegin,
 
 //============================================================================
 SvAddressParser_Impl::SvAddressParser_Impl(SvAddressParser * pParser,
-                                           const rtl::OUString& rInput)
+                                           const OUString& rInput)
 {
     m_pInputPos = rInput.getStr();
     m_pInputEnd = m_pInputPos + rInput.getLength();
@@ -469,272 +469,258 @@ SvAddressParser_Impl::SvAddressParser_Impl(SvAddressParser * pParser,
         }
         switch (m_nCurToken)
         {
-            case TOKEN_QUOTED:
-                if (m_pAddrSpec->m_eLastElem != ELEMENT_END)
-                {
-                    if (m_pAddrSpec->m_bAtFound
-                        || m_pAddrSpec->m_eLastElem <= ELEMENT_DELIM)
-                        m_pAddrSpec->reset();
-                    addTokenToAddrSpec(ELEMENT_ITEM);
-                }
-                if (!m_bRealNameFinished && m_eState != AFTER_LESS)
+        case TOKEN_QUOTED:
+            if (m_pAddrSpec->m_eLastElem != ELEMENT_END)
+            {
+                if (m_pAddrSpec->m_bAtFound
+                    || m_pAddrSpec->m_eLastElem <= ELEMENT_DELIM)
+                    m_pAddrSpec->reset();
+                addTokenToAddrSpec(ELEMENT_ITEM);
+            }
+            if (!m_bRealNameFinished && m_eState != AFTER_LESS)
+            {
+                if (m_bCurTokenReparse)
                 {
-                    if (m_bCurTokenReparse)
-                    {
-                        if (!m_pRealNameBegin)
-                            m_pRealNameBegin = m_pCurTokenBegin;
-                        m_pRealNameEnd = m_pCurTokenEnd;
-                        m_bRealNameReparse = true;
-                    }
-                    else if (m_bRealNameReparse)
-                        m_pRealNameEnd = m_pCurTokenEnd;
-                    else if (!m_pRealNameBegin)
-                    {
+                    if (!m_pRealNameBegin)
                         m_pRealNameBegin = m_pCurTokenBegin;
-                        m_pRealNameContentBegin = m_pCurTokenContentBegin;
-                        m_pRealNameEnd = m_pRealNameContentEnd
-                            = m_pCurTokenContentEnd;
-                    }
-                    else
-                    {
-                        m_pRealNameEnd = m_pCurTokenEnd;
-                        m_bRealNameReparse = true;
-                    }
+                    m_pRealNameEnd = m_pCurTokenEnd;
+                    m_bRealNameReparse = true;
                 }
-                m_eType = TOKEN_ATOM;
-                break;
-
-            case TOKEN_DOMAIN:
-                if (m_pAddrSpec->m_eLastElem != ELEMENT_END)
+                else if (m_bRealNameReparse)
+                    m_pRealNameEnd = m_pCurTokenEnd;
+                else if (!m_pRealNameBegin)
                 {
-                    if (m_pAddrSpec->m_bAtFound
-                        && m_pAddrSpec->m_eLastElem == ELEMENT_DELIM)
-                        addTokenToAddrSpec(ELEMENT_ITEM);
-                    else
-                        m_pAddrSpec->reset();
+                    m_pRealNameBegin = m_pCurTokenBegin;
+                    m_pRealNameContentBegin = m_pCurTokenContentBegin;
+                    m_pRealNameEnd = m_pRealNameContentEnd = m_pCurTokenContentEnd;
                 }
-                addTokenToRealName();
-                m_eType = TOKEN_ATOM;
-                break;
-
-            case TOKEN_COMMENT:
-                if (!m_bRealNameFinished && m_eState != AFTER_LESS
-                    && !m_pFirstCommentBegin && m_pCurTokenContentBegin)
+                else
                 {
-                    m_pFirstCommentBegin = m_pCurTokenContentBegin;
-                    m_pFirstCommentEnd = m_pCurTokenContentEnd;
-                    m_bFirstCommentReparse = m_bCurTokenReparse;
+                    m_pRealNameEnd = m_pCurTokenEnd;
+                    m_bRealNameReparse = true;
                 }
-                m_eType = TOKEN_ATOM;
-                break;
+            }
+            m_eType = TOKEN_ATOM;
+            break;
 
-            case TOKEN_ATOM:
-                if (m_pAddrSpec->m_eLastElem != ELEMENT_END)
-                {
-                    if (m_pAddrSpec->m_eLastElem != ELEMENT_DELIM)
-                        m_pAddrSpec->reset();
+        case TOKEN_DOMAIN:
+            if (m_pAddrSpec->m_eLastElem != ELEMENT_END)
+            {
+                if (m_pAddrSpec->m_bAtFound && m_pAddrSpec->m_eLastElem == ELEMENT_DELIM)
                     addTokenToAddrSpec(ELEMENT_ITEM);
-                }
-                addTokenToRealName();
+                else
+                    m_pAddrSpec->reset();
+            }
+            addTokenToRealName();
+            m_eType = TOKEN_ATOM;
+            break;
+
+        case TOKEN_COMMENT:
+            if (!m_bRealNameFinished && m_eState != AFTER_LESS
+                && !m_pFirstCommentBegin && m_pCurTokenContentBegin)
+            {
+                m_pFirstCommentBegin = m_pCurTokenContentBegin;
+                m_pFirstCommentEnd = m_pCurTokenContentEnd;
+                m_bFirstCommentReparse = m_bCurTokenReparse;
+            }
+            m_eType = TOKEN_ATOM;
+            break;
+
+        case TOKEN_ATOM:
+            if (m_pAddrSpec->m_eLastElem != ELEMENT_END)
+            {
+                if (m_pAddrSpec->m_eLastElem != ELEMENT_DELIM)
+                    m_pAddrSpec->reset();
+                addTokenToAddrSpec(ELEMENT_ITEM);
+            }
+            addTokenToRealName();
+            break;
+
+        case '(':
+            m_eType = TOKEN_COMMENT;
+            break;
+
+        case ')':
+        case '\\':
+        case ']':
+            m_pAddrSpec->finish();
+            addTokenToRealName();
+            break;
+
+        case '<':
+            switch (m_eState)
+            {
+            case BEFORE_COLON:
+            case BEFORE_LESS:
+                m_aOuterAddrSpec.finish();
+                if (m_pRealNameBegin)
+                    m_bRealNameFinished = true;
+                m_pAddrSpec = &m_aInnerAddrSpec;
+                m_eState = AFTER_LESS;
                 break;
 
-            case '(':
-                m_eType = TOKEN_COMMENT;
+            case AFTER_LESS:
+                m_aInnerAddrSpec.finish();
                 break;
 
-            case ')':
-            case '\\':
-            case ']':
-                m_pAddrSpec->finish();
+            case AFTER_GREATER:
+                m_aOuterAddrSpec.finish();
                 addTokenToRealName();
                 break;
+            }
+            break;
 
-            case '<':
-                switch (m_eState)
+        case '>':
+            if (m_eState == AFTER_LESS)
+            {
+                m_aInnerAddrSpec.finish();
+                if (m_aInnerAddrSpec.isValid())
+                    m_aOuterAddrSpec.m_eLastElem = ELEMENT_END;
+                m_pAddrSpec = &m_aOuterAddrSpec;
+                m_eState = AFTER_GREATER;
+            }
+            else
+            {
+                m_aOuterAddrSpec.finish();
+                addTokenToRealName();
+            }
+            break;
+
+        case '@':
+            if (m_pAddrSpec->m_eLastElem != ELEMENT_END)
+            {
+                if (!m_pAddrSpec->m_bAtFound
+                    && m_pAddrSpec->m_eLastElem == ELEMENT_ITEM)
                 {
-                    case BEFORE_COLON:
-                    case BEFORE_LESS:
-                        m_aOuterAddrSpec.finish();
-                        if (m_pRealNameBegin)
-                            m_bRealNameFinished = true;
-                        m_pAddrSpec = &m_aInnerAddrSpec;
-                        m_eState = AFTER_LESS;
-                        break;
-
-                    case AFTER_LESS:
-                        m_aInnerAddrSpec.finish();
-                        break;
-
-                    case AFTER_GREATER:
-                        m_aOuterAddrSpec.finish();
-                        addTokenToRealName();
-                        break;
+                    addTokenToAddrSpec(ELEMENT_DELIM);
+                    m_pAddrSpec->m_bAtFound = true;
                 }
-                break;
+                else
+                    m_pAddrSpec->reset();
+            }
+            addTokenToRealName();
+            break;
 
-            case '>':
-                if (m_eState == AFTER_LESS)
+        case ',':
+        case ';':
+            if (m_eState == AFTER_LESS)
+                if (m_nCurToken == ',')
                 {
+                    if (m_aInnerAddrSpec.m_eLastElem != ELEMENT_END)
+                        m_aInnerAddrSpec.reset();
+                }
+                else
                     m_aInnerAddrSpec.finish();
-                    if (m_aInnerAddrSpec.isValid())
-                        m_aOuterAddrSpec.m_eLastElem = ELEMENT_END;
+            else
+            {
+                if(m_aInnerAddrSpec.isValid() || (!m_aOuterAddrSpec.isValid() && m_aInnerAddrSpec.isPoorlyValid()))
+                {
+                    m_pAddrSpec = &m_aInnerAddrSpec;
+                }
+                else if(m_aOuterAddrSpec.isPoorlyValid())
+                {
                     m_pAddrSpec = &m_aOuterAddrSpec;
-                    m_eState = AFTER_GREATER;
                 }
                 else
                 {
-                    m_aOuterAddrSpec.finish();
-                    addTokenToRealName();
+                    m_pAddrSpec = 0;
                 }
-                break;
 
-            case '@':
-                if (m_pAddrSpec->m_eLastElem != ELEMENT_END)
+                if (m_pAddrSpec)
                 {
-                    if (!m_pAddrSpec->m_bAtFound
-                        && m_pAddrSpec->m_eLastElem == ELEMENT_ITEM)
+                    OUString aTheAddrSpec;
+                    if (m_pAddrSpec->m_bReparse)
+                        aTheAddrSpec = reparse(m_pAddrSpec->m_pBegin, m_pAddrSpec->m_pEnd, true);
+                    else
                     {
-                        addTokenToAddrSpec(ELEMENT_DELIM);
-                        m_pAddrSpec->m_bAtFound = true;
+                        sal_Int32 nLen = ( m_pAddrSpec->m_pEnd - m_pAddrSpec->m_pBegin);
+                        if (nLen == rInput.getLength())
+                            aTheAddrSpec = rInput;
+                        else
+                            aTheAddrSpec = rInput.copy( (m_pAddrSpec->m_pBegin - rInput.getStr()),
+                                                        nLen);
                     }
-                    else
-                        m_pAddrSpec->reset();
-                }
-                addTokenToRealName();
-                break;
-
-            case ',':
-            case ';':
-                if (m_eState == AFTER_LESS)
-                    if (m_nCurToken == ',')
+                    OUString aTheRealName;
+                    if (!m_pRealNameBegin ||
+                        (m_pAddrSpec == &m_aOuterAddrSpec &&
+                         m_pRealNameBegin == m_aOuterAddrSpec.m_pBegin &&
+                         m_pRealNameEnd == m_aOuterAddrSpec.m_pEnd &&
+                         m_pFirstCommentBegin))
                     {
-                        if (m_aInnerAddrSpec.m_eLastElem
-                             != ELEMENT_END)
-                            m_aInnerAddrSpec.reset();
+                        if (!m_pFirstCommentBegin)
+                            aTheRealName = aTheAddrSpec;
+                        else if (m_bFirstCommentReparse)
+                            aTheRealName = reparseComment(m_pFirstCommentBegin,
+                                                          m_pFirstCommentEnd);
+                        else
+                            aTheRealName = rInput.copy( (m_pFirstCommentBegin - rInput.getStr()),
+                                                        (m_pFirstCommentEnd - m_pFirstCommentBegin));
                     }
+                    else if (m_bRealNameReparse)
+                        aTheRealName = reparse(m_pRealNameBegin, m_pRealNameEnd, false);
                     else
-                        m_aInnerAddrSpec.finish();
-                else
-                {
-                    m_pAddrSpec = m_aInnerAddrSpec.isValid()
-                                  || (!m_aOuterAddrSpec.isValid()
-                                         && m_aInnerAddrSpec.isPoorlyValid()) ?
-                                      &m_aInnerAddrSpec :
-                                  m_aOuterAddrSpec.isPoorlyValid() ?
-                                      &m_aOuterAddrSpec : 0;
-                    if (m_pAddrSpec)
                     {
-                        rtl::OUString aTheAddrSpec;
-                        if (m_pAddrSpec->m_bReparse)
-                            aTheAddrSpec = reparse(m_pAddrSpec->m_pBegin,
-                                                   m_pAddrSpec->m_pEnd, true);
+                        sal_Int32 nLen = (m_pRealNameContentEnd - m_pRealNameContentBegin);
+                        if (nLen == rInput.getLength())
+                            aTheRealName = rInput;
                         else
-                        {
-                            sal_Int32 nLen = (
-                                    m_pAddrSpec->m_pEnd
-                                    - m_pAddrSpec->m_pBegin);
-                            if (nLen == rInput.getLength())
-                                aTheAddrSpec = rInput;
-                            else
-                                aTheAddrSpec
-                                    = rInput.copy(
-                                        (m_pAddrSpec->m_pBegin
-                                            - rInput.getStr()),
-                                        nLen);
-                        }
-                        rtl::OUString aTheRealName;
-                        if (!m_pRealNameBegin
-                            || (m_pAddrSpec == &m_aOuterAddrSpec
-                               && m_pRealNameBegin
-                                      == m_aOuterAddrSpec.m_pBegin
-                               && m_pRealNameEnd == m_aOuterAddrSpec.m_pEnd
-                               && m_pFirstCommentBegin))
-                            if (!m_pFirstCommentBegin)
-                                aTheRealName = aTheAddrSpec;
-                            else if (m_bFirstCommentReparse)
-                                aTheRealName
-                                    = reparseComment(m_pFirstCommentBegin,
-                                                     m_pFirstCommentEnd);
-                            else
-                                aTheRealName
-                                    = rInput.copy(
-                                        (m_pFirstCommentBegin
-                                         - rInput.getStr()),
-                                        (m_pFirstCommentEnd
-                                         - m_pFirstCommentBegin));
-                        else if (m_bRealNameReparse)
-                            aTheRealName = reparse(m_pRealNameBegin,

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list