[Libreoffice-commits] core.git: 17 commits - basic/source extensions/source sc/inc sc/source sot/source starmath/inc starmath/source sw/source xmlhelp/source

Caolán McNamara caolanm at redhat.com
Thu Oct 3 05:10:59 PDT 2013


 basic/source/runtime/stdobj.cxx                  |    8 -
 extensions/source/scanner/sanedlg.cxx            |    6 -
 sc/inc/addincol.hxx                              |    2 
 sc/inc/address.hxx                               |    8 -
 sc/inc/autonamecache.hxx                         |    2 
 sc/inc/compiler.hxx                              |   12 +-
 sc/inc/dptabres.hxx                              |    2 
 sc/inc/global.hxx                                |   10 -
 sc/source/core/data/dptabres.cxx                 |    4 
 sc/source/core/data/global.cxx                   |    6 -
 sc/source/core/data/table4.cxx                   |   55 ++++-----
 sc/source/core/inc/cellkeytranslator.hxx         |    2 
 sc/source/core/inc/interpre.hxx                  |    2 
 sc/source/core/tool/address.cxx                  |   32 ++---
 sc/source/core/tool/compiler.cxx                 |  130 +++++++++++------------
 sc/source/core/tool/interpr2.cxx                 |    4 
 sc/source/core/tool/interpr4.cxx                 |   10 -
 sc/source/filter/excel/xecontent.cxx             |    8 -
 sc/source/filter/excel/xename.cxx                |    2 
 sc/source/filter/excel/xepage.cxx                |    2 
 sc/source/filter/excel/xestream.cxx              |   10 -
 sc/source/filter/excel/xestring.cxx              |   20 ---
 sc/source/filter/excel/xihelper.cxx              |    6 -
 sc/source/filter/inc/xestream.hxx                |    2 
 sc/source/filter/inc/xestring.hxx                |   21 ---
 sc/source/filter/inc/xihelper.hxx                |    2 
 sc/source/ui/app/inputhdl.cxx                    |   20 +--
 sc/source/ui/dbgui/csvgrid.cxx                   |    4 
 sc/source/ui/docshell/docsh8.cxx                 |   15 +-
 sc/source/ui/docshell/impex.cxx                  |   36 +++---
 sc/source/ui/inc/crnrdlg.hxx                     |    2 
 sc/source/ui/inc/csvgrid.hxx                     |    2 
 sc/source/ui/inc/impex.hxx                       |    4 
 sc/source/ui/inc/inputhdl.hxx                    |    2 
 sc/source/ui/inc/pvfundlg.hxx                    |    2 
 sot/source/sdstor/ucbstorage.cxx                 |    9 -
 starmath/inc/cursor.hxx                          |    3 
 starmath/inc/visitors.hxx                        |    9 +
 starmath/source/caret.cxx                        |    3 
 starmath/source/cursor.cxx                       |    7 -
 starmath/source/visitors.cxx                     |    5 
 sw/source/core/doc/tblcpy.cxx                    |    3 
 sw/source/core/doc/tblrwcl.cxx                   |   37 +++---
 sw/source/core/text/itrform2.cxx                 |   11 +
 sw/source/core/unocore/unotext.cxx               |    2 
 sw/source/filter/html/htmlbas.cxx                |    8 -
 sw/source/filter/xml/xmlimpit.cxx                |   66 +++++++----
 sw/source/ui/docvw/romenu.cxx                    |    2 
 xmlhelp/source/cxxhelp/provider/databases.cxx    |   41 -------
 xmlhelp/source/cxxhelp/provider/databases.hxx    |    6 -
 xmlhelp/source/cxxhelp/provider/urlparameter.cxx |    8 -
 51 files changed, 296 insertions(+), 379 deletions(-)

New commits:
commit 301058b7eeb31360ee3ffef76523cbd1d3e4fc62
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 12:32:26 2013 +0100

    CID#705757 leaks on early return
    
    also CID#705756, CID#705755 and CID#705754
    
    Change-Id: Ie02bb10049dc680199dfa6c218b6b1f92927e4a4

diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx
index 6d57f45..5e1dabf 100644
--- a/sw/source/filter/xml/xmlimpit.cxx
+++ b/sw/source/filter/xml/xmlimpit.cxx
@@ -222,6 +222,34 @@ SvXMLImportItemMapper::finished(SfxItemSet &, SvXMLUnitConverter const&) const
     // nothing to do here
 }
 
+struct BoxHolder : private boost::noncopyable
+{
+    SvxBorderLine* pTop;
+    SvxBorderLine* pBottom;
+    SvxBorderLine* pLeft;
+    SvxBorderLine* pRight;
+
+    BoxHolder(SvxBoxItem* pBox)
+    {
+        pTop    = pBox->GetTop() == NULL ?
+            NULL : new SvxBorderLine( *pBox->GetTop() );
+        pBottom = pBox->GetBottom() == NULL ?
+            NULL : new SvxBorderLine( *pBox->GetBottom() );
+        pLeft   = pBox->GetLeft() == NULL ?
+            NULL : new SvxBorderLine( *pBox->GetLeft() );
+        pRight  = pBox->GetRight() == NULL ?
+            NULL : new SvxBorderLine( *pBox->GetRight() );
+    }
+
+    ~BoxHolder()
+    {
+        delete pTop;
+        delete pBottom;
+        delete pLeft;
+        delete pRight;
+    }
+};
+
 
 
 // put an XML-string value into an item
@@ -410,14 +438,7 @@ bool SvXMLImportItemMapper::PutXMLValue(
             OSL_ENSURE( pBox != NULL, "Wrong WHich-ID" );
 
             /** copy SvxBorderLines */
-            SvxBorderLine* pTop    = pBox->GetTop() == NULL ?
-                                NULL : new SvxBorderLine( *pBox->GetTop() );
-            SvxBorderLine* pBottom = pBox->GetBottom() == NULL ?
-                                NULL : new SvxBorderLine( *pBox->GetBottom() );
-            SvxBorderLine* pLeft   = pBox->GetLeft() == NULL ?
-                                NULL : new SvxBorderLine( *pBox->GetLeft() );
-            SvxBorderLine* pRight  = pBox->GetRight() == NULL ?
-                                NULL : new SvxBorderLine( *pBox->GetRight() );
+            BoxHolder aBoxes(pBox);
 
             sal_Int32 nTemp;
 
@@ -471,25 +492,25 @@ bool SvXMLImportItemMapper::PutXMLValue(
                         return false;
 
                     if( TOP_BORDER == nMemberId || ALL_BORDER == nMemberId )
-                        sw_frmitems_setXMLBorder( pTop,
+                        sw_frmitems_setXMLBorder( aBoxes.pTop,
                                                    bHasStyle, nStyle,
                                                    bHasWidth, nWidth, nNamedWidth,
                                                    bHasColor, aColor );
 
                     if( BOTTOM_BORDER == nMemberId || ALL_BORDER == nMemberId )
-                        sw_frmitems_setXMLBorder( pBottom,
+                        sw_frmitems_setXMLBorder( aBoxes.pBottom,
                                                    bHasStyle, nStyle,
                                                    bHasWidth, nWidth, nNamedWidth,
                                                    bHasColor, aColor );
 
                     if( LEFT_BORDER == nMemberId || ALL_BORDER == nMemberId )
-                        sw_frmitems_setXMLBorder( pLeft,
+                        sw_frmitems_setXMLBorder( aBoxes.pLeft,
                                                    bHasStyle, nStyle,
                                                    bHasWidth, nWidth, nNamedWidth,
                                                    bHasColor, aColor );
 
                     if( RIGHT_BORDER == nMemberId || ALL_BORDER == nMemberId )
-                        sw_frmitems_setXMLBorder( pRight,
+                        sw_frmitems_setXMLBorder( aBoxes.pRight,
                                                    bHasStyle, nStyle,
                                                    bHasWidth, nWidth, nNamedWidth,
                                                    bHasColor, aColor );
@@ -529,28 +550,28 @@ bool SvXMLImportItemMapper::PutXMLValue(
 
                     if( TOP_BORDER_LINE_WIDTH == nMemberId ||
                         ALL_BORDER_LINE_WIDTH == nMemberId )
-                        sw_frmitems_setXMLBorder( pTop, nWidth,
+                        sw_frmitems_setXMLBorder( aBoxes.pTop, nWidth,
                                 static_cast< sal_uInt16 >( nOutWidth ),
                                 static_cast< sal_uInt16 >( nInWidth ),
                                 static_cast< sal_uInt16 >( nDistance ) );
 
                     if( BOTTOM_BORDER_LINE_WIDTH == nMemberId ||
                         ALL_BORDER_LINE_WIDTH == nMemberId )
-                        sw_frmitems_setXMLBorder( pBottom, nWidth,
+                        sw_frmitems_setXMLBorder( aBoxes.pBottom, nWidth,
                                 static_cast< sal_uInt16 >( nOutWidth ),
                                 static_cast< sal_uInt16 >( nInWidth ),
                                 static_cast< sal_uInt16 >( nDistance ) );
 
                     if( LEFT_BORDER_LINE_WIDTH == nMemberId ||
                         ALL_BORDER_LINE_WIDTH == nMemberId )
-                        sw_frmitems_setXMLBorder( pLeft, nWidth,
+                        sw_frmitems_setXMLBorder( aBoxes.pLeft, nWidth,
                                 static_cast< sal_uInt16 >( nOutWidth ),
                                 static_cast< sal_uInt16 >( nInWidth ),
                                 static_cast< sal_uInt16 >( nDistance ) );
 
                     if( RIGHT_BORDER_LINE_WIDTH == nMemberId ||
                         ALL_BORDER_LINE_WIDTH == nMemberId )
-                        sw_frmitems_setXMLBorder( pRight, nWidth,
+                        sw_frmitems_setXMLBorder( aBoxes.pRight, nWidth,
                                 static_cast< sal_uInt16 >( nOutWidth ),
                                 static_cast< sal_uInt16 >( nInWidth ),
                                 static_cast< sal_uInt16 >( nDistance ) );
@@ -558,15 +579,10 @@ bool SvXMLImportItemMapper::PutXMLValue(
                 break;
             }
 
-            pBox->SetLine( pTop,    BOX_LINE_TOP    );
-            pBox->SetLine( pBottom, BOX_LINE_BOTTOM );
-            pBox->SetLine( pLeft,   BOX_LINE_LEFT   );
-            pBox->SetLine( pRight,  BOX_LINE_RIGHT  );
-
-            delete pTop;
-            delete pBottom;
-            delete pLeft;
-            delete pRight;
+            pBox->SetLine( aBoxes.pTop,    BOX_LINE_TOP    );
+            pBox->SetLine( aBoxes.pBottom, BOX_LINE_BOTTOM );
+            pBox->SetLine( aBoxes.pLeft,   BOX_LINE_LEFT   );
+            pBox->SetLine( aBoxes.pRight,  BOX_LINE_RIGHT  );
 
             bOk = true;
         }
commit 17d42fdfdf1428b1e48dfab9f71a759b8c767ec4
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 12:28:15 2013 +0100

    CID#705761 pItem leaks
    
    Change-Id: I46ea45c9b6ab35842c3f2747984f2def385326fd

diff --git a/sw/source/ui/docvw/romenu.cxx b/sw/source/ui/docvw/romenu.cxx
index 9a1c3c7..3717572 100644
--- a/sw/source/ui/docvw/romenu.cxx
+++ b/sw/source/ui/docvw/romenu.cxx
@@ -204,6 +204,7 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) :
     Check( MN_READONLY_COPY,            SID_COPY,           rDis );
     if(eState < SFX_ITEM_AVAILABLE)
         EnableItem( MN_READONLY_COPY, sal_False );
+    delete pState;
 
     eState = pVFrame->GetBindings().QueryState( SID_EDITDOC, pState );
     if (
@@ -213,6 +214,7 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) :
     {
         EnableItem( MN_READONLY_EDITDOC, sal_False );
     }
+    delete pState;
 
     if ( !sURL.Len() )
     {
commit a29062a4782456f98d41f871631947ea60a65213
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 12:20:04 2013 +0100

    CID#705646 leak on error path
    
    Change-Id: I3b701f47bbd4141127e209673a4ce9335d68ca2a

diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index f13f652..885f07f 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -231,11 +231,10 @@ void SaneDlg::InitFields()
                     }
                     maReslBox.InsertValue( (long)pDouble[1] );
                 }
-                if( pDouble )
-                    delete [] pDouble;
             }
             else
                 maReslBox.Enable( sal_False );
+            delete [] pDouble;
         }
     }
     else
commit 20a48f8a681a18ac8d8dafbb3ecde85a61707911
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 12:17:57 2013 +0100

    CID#705647 leak on error path
    
    Change-Id: I6e52bfb34e7c4be0d17dfa7849d4a96248aa49b4

diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index d5e78f8..f13f652 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -1337,7 +1337,10 @@ sal_Bool SaneDlg::SetAdjustedNumericalValue(
     double* pValues = NULL;
     int nValues;
     if( ( nValues = mrSane.GetRange( nOption, pValues ) ) < 0 )
+    {
+        delete [] pValues;
         return sal_False;
+    }
 
 #if OSL_DEBUG_LEVEL > 1
     fprintf( stderr, "SaneDlg::SetAdjustedNumericalValue( \"%s\", %lg ) ",
commit 8f5e4f2f8f26b308e88ecf1a15be8e213e373bc3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 12:12:20 2013 +0100

    CID#705740 leak on error case
    
    Change-Id: Ia7013e37eed224e7f07a789a89de625c8cbec9ab

diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index f66faa9..55a4b3b 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -928,7 +928,10 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes,
                     sal::static_int_cast< sal_uInt16 >(
                         pLine->GetTabBoxes().size() - nSttBox ) <
                     pFLine->GetBoxes().size() )
+                {
+                    delete pInsFLine;
                     return sal_False;
+                }
 
                 // Test for nesting
                 for( nBx = 0; nBx < pFLine->GetBoxes().size(); ++nBx )
commit 9cdb972db4eb2314eab7f4dca08b44a113cc3d4d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 12:07:35 2013 +0100

    CID#705741 more leaks on early return
    
    Change-Id: I58e01473f1ab3045b203baad643ae0225140511e

diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index c469393..96bf52e 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -3456,7 +3456,7 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType,
     const SwFmtFrmSize& rSz = GetFrmFmt()->GetFrmSize();
     const SvxLRSpaceItem& rLR = GetFrmFmt()->GetLRSpace();
 
-    _FndBox* pFndBox = 0;                // for insertion/deletion
+    boost::scoped_ptr<_FndBox> xFndBox;                // for insertion/deletion
     SwTableSortBoxes aTmpLst;       // for Undo
     bool bBigger,
         bRet = false,
@@ -3560,8 +3560,8 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType,
             {
                 if( bInsDel )
                 {
-                    pFndBox = ::lcl_SaveInsDelData( aParam, ppUndo,
-                                                    aTmpLst, nDistStt );
+                    xFndBox.reset(::lcl_SaveInsDelData( aParam, ppUndo,
+                                                    aTmpLst, nDistStt));
                     if (aParam.bBigger &&
                         aParam.m_Boxes.size() == m_TabSortContentBoxes.size())
                     {
@@ -3763,8 +3763,8 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType,
                 if( bInsDel )
                 {
                     aParam1.bBigger = !aParam.bBigger;
-                    pFndBox = ::lcl_SaveInsDelData( aParam, ppUndo,
-                                                    aTmpLst, nDistStt );
+                    xFndBox.reset(::lcl_SaveInsDelData( aParam, ppUndo,
+                                                    aTmpLst, nDistStt));
                     if( ppUndo )
                         *ppUndo = aParam.CreateUndo(
                                         aParam.bBigger ? UNDO_TABLE_DELBOX
@@ -3877,7 +3877,7 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType,
                 if( bInsDel )
                 {
                     aParam1.bBigger = !aParam.bBigger;
-                    pFndBox = ::lcl_SaveInsDelData( aParam, ppUndo, aTmpLst, nDistStt );
+                    xFndBox.reset(::lcl_SaveInsDelData( aParam, ppUndo, aTmpLst, nDistStt ));
                     if( ppUndo )
                         *ppUndo = aParam.CreateUndo(
                                         aParam.bBigger ? UNDO_TABLE_DELBOX
@@ -3904,20 +3904,20 @@ bool SwTable::SetColWidth( SwTableBox& rAktBox, sal_uInt16 eType,
 
     }
 
-    if( pFndBox )
+    if( xFndBox )
     {
         // Clean up the structure of all Lines
         GCLines();
 
         // Update Layout
-        if( !bBigger || pFndBox->AreLinesToRestore( *this ) )
-            pFndBox->MakeFrms( *this );
+        if( !bBigger || xFndBox->AreLinesToRestore( *this ) )
+            xFndBox->MakeFrms( *this );
 
         // TL_CHART2: it is currently unclear if sth has to be done here.
         // The function name hints that nothing needs to be done, on the other
         // hand there is a case where sth gets deleted.  :-(
 
-        delete pFndBox;
+        xFndBox.reset();
 
         if( ppUndo && *ppUndo )
         {
commit 11d9403b53a15f01e58654b4b50a92ff6a7a4f3c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 12:03:03 2013 +0100

    rtl_ustr_hashCode_WithLength -> OUString:hashCode
    
    Change-Id: I67b703446cd83540ebc24ea373c5b2d7e80fb496

diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 81f1bf6..e4ad435 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -3998,7 +3998,7 @@ size_t ScDPResultVisibilityData::MemberHash::operator() (const ScDPItemData& r)
     if (r.IsValue())
         return static_cast<size_t>(::rtl::math::approxFloor(r.GetValue()));
     else
-        return rtl_ustr_hashCode_WithLength(r.GetString().getStr(), r.GetString().getLength());
+        return r.GetString().hashCode();
 }
 SCROW ScDPResultMember::GetDataId( ) const
 {
commit 0f7e24bfae103b0e9492ce423e0262cc8104e461
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 12:01:40 2013 +0100

    unused StringHashCode
    
    Change-Id: I72b882292f62c4a2b4999fa3e553db3c617e03f4

diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx
index 34d4582..e058f01 100644
--- a/basic/source/runtime/stdobj.cxx
+++ b/basic/source/runtime/stdobj.cxx
@@ -65,14 +65,6 @@ struct Methods {
     sal_uInt16      nHash;
 };
 
-struct StringHashCode
-{
-    size_t operator()( const OUString& rStr ) const
-    {
-        return rtl_ustr_hashCode_WithLength( rStr.getStr(), rStr.getLength() );
-    }
-};
-
 static Methods aMethods[] = {
 
 { "Abs",            SbxDOUBLE,    1 | _FUNCTION, RTLNAME(Abs),0             },
commit 5ad89b740b2f5da76c8e4239d2336a522d41785c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 11:53:00 2013 +0100

    CID#705742 leak on early return
    
    Change-Id: I77e2f0a9298c20b56bc8f18d2d1e7a80fb94f44f

diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index be7ee31..c469393 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -50,6 +50,7 @@
 #include <tblrwcl.hxx>
 #include <unochart.hxx>
 #include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
 #include <boost/foreach.hpp>
 #include <switerator.hxx>
 
@@ -4191,7 +4192,7 @@ bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
     while( pBaseLine->GetUpper() )
         pBaseLine = pBaseLine->GetUpper()->GetUpper();
 
-    _FndBox* pFndBox = 0;                // for insertion/deletion
+    boost::scoped_ptr<_FndBox> xFndBox;                // for insertion/deletion
     SwTableSortBoxes aTmpLst;       // for Undo
     bool bBigger,
         bRet = false,
@@ -4269,7 +4270,7 @@ bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
                                                     aParam, 0, true );
                         }
 
-                        pFndBox = ::lcl_SaveInsDelData( aParam, ppUndo, aTmpLst );
+                        xFndBox.reset(::lcl_SaveInsDelData( aParam, ppUndo, aTmpLst ));
 
                         // delete complete table when last row is deleted
                         if( !bBigger &&
@@ -4356,7 +4357,7 @@ bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
                             ::lcl_InsDelSelLine( (*pLines)[ nBaseLinePos ],
                                                     aParam, 0, true );
                         }
-                        pFndBox = ::lcl_SaveInsDelData( aParam, ppUndo, aTmpLst );
+                        xFndBox.reset(::lcl_SaveInsDelData( aParam, ppUndo, aTmpLst ));
                         if( ppUndo )
                             *ppUndo = aParam.CreateUndo(
                                         bBigger ? UNDO_TABLE_INSROW
@@ -4401,25 +4402,25 @@ bool SwTable::SetRowHeight( SwTableBox& rAktBox, sal_uInt16 eType,
                                         nRelDiff, ppUndo );
 
                     eTblChgMode = eOld;
-                    pFndBox = 0;
+                    xFndBox.reset();
                 }
             }
         }
         break;
     }
 
-    if( pFndBox )
+    if( xFndBox )
     {
         // then clean up the structure of all Lines
         GCLines();
 
         // Update Layout
-        if( bBigger || pFndBox->AreLinesToRestore( *this ) )
-            pFndBox->MakeFrms( *this );
+        if( bBigger || xFndBox->AreLinesToRestore( *this ) )
+            xFndBox->MakeFrms( *this );
 
         // TL_CHART2: it is currently unclear if sth has to be done here.
 
-        delete pFndBox;
+        xFndBox.reset();
 
         if( ppUndo && *ppUndo )
         {
commit dbec763c672ae5a08b6fb6763e87e41a5ec14ca9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 11:49:09 2013 +0100

    de-GetBuffer calc
    
    Change-Id: I6bb013cc32d5b363dd08738543b1fb834d39f516

diff --git a/sc/inc/addincol.hxx b/sc/inc/addincol.hxx
index 0a689bb..8c08672 100644
--- a/sc/inc/addincol.hxx
+++ b/sc/inc/addincol.hxx
@@ -40,7 +40,7 @@ class SfxObjectShell;
 class ScUnoAddInFuncData;
 class ScFuncDesc;
 
-typedef ::boost::unordered_map< OUString, const ScUnoAddInFuncData*, ScStringHashCode, ::std::equal_to< OUString > > ScAddInHashMap;
+typedef ::boost::unordered_map< OUString, const ScUnoAddInFuncData*, OUStringHash > ScAddInHashMap;
 
 enum ScAddInArgumentType
 {
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index cc756d6..e361746 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -283,7 +283,7 @@ public:
     inline void GetVars( SCCOL& nColP, SCROW& nRowP, SCTAB& nTabP ) const
     { nColP = nCol; nRowP = nRow; nTabP = nTab; }
 
-    SC_DLLPUBLIC sal_uInt16 Parse( const String&, ScDocument* = NULL,
+    SC_DLLPUBLIC sal_uInt16 Parse( const OUString&, ScDocument* = NULL,
                   const Details& rDetails = detailsOOOa1,
                   ExternalInfo* pExtInfo = NULL,
                   const ::com::sun::star::uno::Sequence<
@@ -447,7 +447,7 @@ public:
     inline bool In( const ScAddress& ) const;   ///< is Address& in Range?
     inline bool In( const ScRange& ) const;     ///< is Range& in Range?
 
-    SC_DLLPUBLIC sal_uInt16 Parse( const String&, ScDocument* = NULL,
+    SC_DLLPUBLIC sal_uInt16 Parse( const OUString&, ScDocument* = NULL,
                   const ScAddress::Details& rDetails = ScAddress::detailsOOOa1,
                   ScAddress::ExternalInfo* pExtInfo = NULL,
                   const ::com::sun::star::uno::Sequence<
@@ -455,9 +455,9 @@ public:
 
     SC_DLLPUBLIC sal_uInt16 ParseAny( const String&, ScDocument* = NULL,
                      const ScAddress::Details& rDetails = ScAddress::detailsOOOa1 );
-    SC_DLLPUBLIC sal_uInt16 ParseCols( const String&, ScDocument* = NULL,
+    SC_DLLPUBLIC sal_uInt16 ParseCols( const OUString&, ScDocument* = NULL,
                      const ScAddress::Details& rDetails = ScAddress::detailsOOOa1 );
-    SC_DLLPUBLIC sal_uInt16 ParseRows( const String&, ScDocument* = NULL,
+    SC_DLLPUBLIC sal_uInt16 ParseRows( const OUString&, ScDocument* = NULL,
                      const ScAddress::Details& rDetails = ScAddress::detailsOOOa1 );
 
     /** Parse an Excel style reference up to and including the sheet name
diff --git a/sc/inc/autonamecache.hxx b/sc/inc/autonamecache.hxx
index 981631d..8a53702 100644
--- a/sc/inc/autonamecache.hxx
+++ b/sc/inc/autonamecache.hxx
@@ -26,7 +26,7 @@
 #include "global.hxx"
 
 typedef ::std::vector< ScAddress > ScAutoNameAddresses;
-typedef ::boost::unordered_map< String, ScAutoNameAddresses, ScStringHashCode, ::std::equal_to< String > > ScAutoNameHashMap;
+typedef ::boost::unordered_map< OUString, ScAutoNameAddresses, OUStringHash > ScAutoNameHashMap;
 
 /**  Cache for faster lookup of automatic names during CompileXML
      (during CompileXML, no document content is changed). */
diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 4943bd7..fe75caf 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -235,8 +235,8 @@ public:
                                  const ScComplexRefData&    rRef,
                                  bool bSingleRef ) const = 0;
         virtual ::com::sun::star::i18n::ParseResult
-                    parseAnyToken( const String& rFormula,
-                                   xub_StrLen nSrcPos,
+                    parseAnyToken( const OUString& rFormula,
+                                   sal_Int32 nSrcPos,
                                    const CharClass* pCharClass) const = 0;
 
         /**
@@ -245,7 +245,7 @@ public:
          *
          * @return true on successful parse, or false otherwise.
          */
-        virtual bool parseExternalName( const String& rSymbol, String& rFile, String& rName,
+        virtual bool parseExternalName( const OUString& rSymbol, String& rFile, String& rName,
                 const ScDocument* pDoc,
                 const ::com::sun::star::uno::Sequence<
                     const ::com::sun::star::sheet::ExternalLinkInfo > * pExternalLinks ) const = 0;
@@ -312,8 +312,8 @@ private:
     ::com::sun::star::uno::Sequence< const ::com::sun::star::sheet::ExternalLinkInfo > maExternalLinks;
 
     sal_Unicode cSymbol[MAXSTRLEN];                 // current Symbol
-    String      aFormula;                           // formula source code
-    xub_StrLen  nSrcPos;                            // tokenizer position (source code)
+    OUString    aFormula;                           // formula source code
+    sal_Int32   nSrcPos;                            // tokenizer position (source code)
     mutable ScRawTokenRef pRawToken;
 
     const CharClass*    pCharClass;         // which character classification is used for parseAnyToken
@@ -335,7 +335,7 @@ private:
     bool IsOpCode( const OUString&, bool bInArray );
     bool IsOpCode2( const String& );
     bool IsString();
-    bool IsReference( const String& );
+    bool IsReference( const OUString& );
     bool IsSingleReference( const String& );
     bool IsPredetectedReference(const OUString&);
     bool IsDoubleReference( const String& );
diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx
index cffd0c8..4017fe1 100644
--- a/sc/inc/dptabres.hxx
+++ b/sc/inc/dptabres.hxx
@@ -681,7 +681,7 @@ private:
         size_t operator()(const ScDPItemData& r) const;
     };
     typedef ::boost::unordered_set<ScDPItemData, MemberHash> VisibleMemberType;
-    typedef ::boost::unordered_map<OUString, VisibleMemberType, ScStringHashCode> DimMemberType;
+    typedef ::boost::unordered_map<OUString, VisibleMemberType, OUStringHash> DimMemberType;
     DimMemberType maDimensions;
 
     ScDPSource* mpSource;
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index ee9317a..3fec756 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -448,14 +448,6 @@ struct ScImportParam
     bool            operator==  ( const ScImportParam& r ) const;
 };
 
-struct ScStringHashCode
-{
-    size_t operator()( const String& rStr ) const
-    {
-        return rtl_ustr_hashCode_WithLength( rStr.GetBuffer(), rStr.Len() );
-    }
-};
-
 class ScDocument;
 class ScDocShell;
 class ScDocShellRef;
@@ -663,7 +655,7 @@ SC_DLLPUBLIC    static void             EraseQuotes( OUString& rString, sal_Unic
         if cChar==cQuote the first cQuote character from nStart on is found.
         @returns offset if found, else STRING_NOTFOUND
      */
-SC_DLLPUBLIC    static xub_StrLen       FindUnquoted( const String& rString, sal_Unicode cChar, xub_StrLen nStart = 0, sal_Unicode cQuote = '\'' );
+SC_DLLPUBLIC    static xub_StrLen       FindUnquoted( const OUString& rString, sal_Unicode cChar, xub_StrLen nStart = 0, sal_Unicode cQuote = '\'' );
 
     /** Finds an unquoted instance of cChar in null-terminated pString. Same
         semantics as FindUnquoted( const String&, ...)
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 3a2ea7c..81f1bf6 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -3949,7 +3949,7 @@ void ScDPResultVisibilityData::addVisibleMember(const OUString& rDimName, const
 
 void ScDPResultVisibilityData::fillFieldFilters(vector<ScDPFilteredCache::Criterion>& rFilters) const
 {
-    typedef boost::unordered_map<String, long, ScStringHashCode> FieldNameMapType;
+    typedef boost::unordered_map<OUString, long, OUStringHash> FieldNameMapType;
     FieldNameMapType aFieldNames;
     ScDPTableData* pData = mpSource->GetData();
     long nColumnCount = pData->GetColumnCount();
diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 04e02de..6ccd42d 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -850,10 +850,10 @@ void ScGlobal::EraseQuotes( OUString& rString, sal_Unicode cQuote, bool bUnescap
     }
 }
 
-xub_StrLen ScGlobal::FindUnquoted( const String& rString, sal_Unicode cChar, xub_StrLen nStart, sal_Unicode cQuote )
+xub_StrLen ScGlobal::FindUnquoted( const OUString& rString, sal_Unicode cChar, xub_StrLen nStart, sal_Unicode cQuote )
 {
-    const sal_Unicode* const pStart = rString.GetBuffer();
-    const sal_Unicode* const pStop = pStart + rString.Len();
+    const sal_Unicode* const pStart = rString.getStr();
+    const sal_Unicode* const pStop = pStart + rString.getLength();
     const sal_Unicode* p = pStart + nStart;
     bool bQuoted = false;
     while (p < pStop)
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 339ae4a..3a84fcb 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -72,40 +72,40 @@ extern sal_uInt16 nScFillModeMouseModifier;     // global.cxx
 
 namespace {
 
-short lcl_DecompValueString( String& aValue, sal_Int32& nVal, sal_uInt16* pMinDigits = NULL )
+short lcl_DecompValueString( OUString& rValue, sal_Int32& nVal, sal_uInt16* pMinDigits = NULL )
 {
-    if ( !aValue.Len() )
+    if ( rValue.isEmpty() )
     {
         nVal = 0;
         return 0;
     }
-    const sal_Unicode* p = aValue.GetBuffer();
-    xub_StrLen nNeg = 0;
-    xub_StrLen nNum = 0;
+    const sal_Unicode* p = rValue.getStr();
+    sal_Int32 nNeg = 0;
+    sal_Int32 nNum = 0;
     if ( p[nNum] == '-' )
         nNum = nNeg = 1;
     while ( p[nNum] && CharClass::isAsciiNumeric( OUString(p[nNum]) ) )
         nNum++;
 
     sal_Unicode cNext = p[nNum];            // 0 if at the end
-    sal_Unicode cLast = p[aValue.Len()-1];
+    sal_Unicode cLast = p[rValue.getLength()-1];
 
     // #i5550# If there are numbers at the beginning and the end,
     // prefer the one at the beginning only if it's followed by a space.
     // Otherwise, use the number at the end, to enable things like IP addresses.
     if ( nNum > nNeg && ( cNext == 0 || cNext == ' ' || !CharClass::isAsciiNumeric(OUString(cLast)) ) )
     {   // number at the beginning
-        nVal = aValue.Copy( 0, nNum ).ToInt32();
+        nVal = rValue.copy( 0, nNum ).toInt32();
         //  any number with a leading zero sets the minimum number of digits
         if ( p[nNeg] == '0' && pMinDigits && ( nNum - nNeg > *pMinDigits ) )
             *pMinDigits = nNum - nNeg;
-        aValue.Erase( 0, nNum );
+        rValue = rValue.copy(nNum);
         return -1;
     }
     else
     {
         nNeg = 0;
-        xub_StrLen nEnd = nNum = aValue.Len() - 1;
+        sal_Int32 nEnd = nNum = rValue.getLength() - 1;
         while ( nNum && CharClass::isAsciiNumeric( OUString(p[nNum]) ) )
             nNum--;
         if ( p[nNum] == '-' )
@@ -115,11 +115,11 @@ short lcl_DecompValueString( String& aValue, sal_Int32& nVal, sal_uInt16* pMinDi
         }
         if ( nNum < nEnd - nNeg )
         {   // number at the end
-            nVal = aValue.Copy( nNum + 1 ).ToInt32();
+            nVal = rValue.copy( nNum + 1 ).toInt32();
             //  any number with a leading zero sets the minimum number of digits
             if ( p[nNum+1+nNeg] == '0' && pMinDigits && ( nEnd - nNum - nNeg > *pMinDigits ) )
                 *pMinDigits = nEnd - nNum - nNeg;
-            aValue.Erase( nNum + 1 );
+            rValue = rValue.copy(0, nNum + 1);
             return 1;
         }
     }
@@ -378,16 +378,12 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
             //  -> longest number defines rMinDigits
 
             sal_Int32 nVal1;
-            String aString = aStr;
-            short nFlag1 = lcl_DecompValueString( aString, nVal1, &rMinDigits );
-            aStr = aString;
+            short nFlag1 = lcl_DecompValueString( aStr, nVal1, &rMinDigits );
             if ( nFlag1 )
             {
                 sal_Int32 nVal2;
                 GetString( nCol+nAddX, nRow+nAddY, aStr );
-                aString = aStr;
-                short nFlag2 = lcl_DecompValueString( aString, nVal2, &rMinDigits );
-                aStr = aString;
+                short nFlag2 = lcl_DecompValueString( aStr, nVal2, &rMinDigits );
                 if ( nFlag1 == nFlag2 )
                 {
                     rInc = (double)nVal2 - (double)nVal1;
@@ -401,9 +397,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
                         if ( eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT )
                         {
                             aStr = aCell.getString(pDocument);
-                            aString = aStr;
-                            nFlag2 = lcl_DecompValueString( aString, nVal2, &rMinDigits );
-                            aStr = aString;
+                            nFlag2 = lcl_DecompValueString( aStr, nVal2, &rMinDigits );
                             if ( nFlag1 == nFlag2 )
                             {
                                 double nDiff = (double)nVal2 - (double)nVal1;
@@ -428,8 +422,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
         {
             //  call DecompValueString to set rMinDigits
             sal_Int32 nDummy;
-            String aString = aStr;
-            lcl_DecompValueString( aString, nDummy, &rMinDigits );
+            lcl_DecompValueString( aStr, nDummy, &rMinDigits );
         }
     }
 }
@@ -765,7 +758,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
             sal_uInt16 nCellDigits = 0;
             short nHeadNoneTail = 0;
             sal_Int32 nStringValue = 0;
-            String aValue;
+            OUString aValue;
             ScCellValue aSrcCell;
             CellType eCellType = CELLTYPE_NONE;
             bool bIsOrdinalSuffix = false;
@@ -803,7 +796,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
                                         nHeadNoneTail = lcl_DecompValueString(
                                                 aValue, nStringValue, &nCellDigits );
 
-                                        bIsOrdinalSuffix = aValue.Equals(
+                                        bIsOrdinalSuffix = aValue.equals(
                                                 ScGlobal::GetOrdinalSuffix( nStringValue));
                                     }
                                     break;
@@ -930,7 +923,7 @@ void ScTable::FillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
 
 String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW nEndY )
 {
-    String aValue;
+    OUString aValue;
 
     SCCOL nCol1 = rSource.aStart.Col();
     SCROW nRow1 = rSource.aStart.Row();
@@ -1049,10 +1042,10 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n
                             short nFlag = lcl_DecompValueString( aValue, nVal, &nCellDigits );
                             if ( nFlag < 0 )
                             {
-                                if (aValue.Equals( ScGlobal::GetOrdinalSuffix( nVal)))
+                                if (aValue.equals( ScGlobal::GetOrdinalSuffix( nVal)))
                                     aValue = ScGlobal::GetOrdinalSuffix( nVal + nDelta);
 
-                                aValue.Insert( lcl_ValueString( nVal + nDelta, nCellDigits ), 0 );
+                                aValue = lcl_ValueString( nVal + nDelta, nCellDigits ) + aValue;
                             }
                             else if ( nFlag > 0 )
                                 aValue += lcl_ValueString( nVal + nDelta, nCellDigits );
@@ -1141,10 +1134,10 @@ String ScTable::GetAutoFillPreview( const ScRange& rSource, SCCOL nEndX, SCROW n
                 {
                     if ( nHeadNoneTail < 0 )
                     {
-                        if (aValue.Equals( ScGlobal::GetOrdinalSuffix( nVal)))
+                        if (aValue.equals( ScGlobal::GetOrdinalSuffix( nVal)))
                             aValue = ScGlobal::GetOrdinalSuffix( (sal_Int32)nStart );
 
-                        aValue.Insert( lcl_ValueString( (sal_Int32)nStart, nMinDigits ), 0 );
+                        aValue = lcl_ValueString( (sal_Int32)nStart, nMinDigits ) + aValue;
                     }
                     else
                         aValue += lcl_ValueString( (sal_Int32)nStart, nMinDigits );
@@ -1583,7 +1576,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
                     if ( nMaxValue <= (double)LONG_MIN )
                         nMaxValue = (double)LONG_MIN + 1;
                 }
-                String aValue;
+                OUString aValue;
                 if (eCellType == CELLTYPE_STRING)
                     aValue = *aSrcCell.mpString;
                 else
@@ -1599,7 +1592,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
                     bool bError = false;
                     bool bOverflow = false;
 
-                    bool bIsOrdinalSuffix = aValue.Equals( ScGlobal::GetOrdinalSuffix(
+                    bool bIsOrdinalSuffix = aValue.equals( ScGlobal::GetOrdinalSuffix(
                                 (sal_Int32)nStartVal));
 
                     rInner = nIStart;
diff --git a/sc/source/core/inc/cellkeytranslator.hxx b/sc/source/core/inc/cellkeytranslator.hxx
index 9802196..d1ac330 100644
--- a/sc/source/core/inc/cellkeytranslator.hxx
+++ b/sc/source/core/inc/cellkeytranslator.hxx
@@ -40,7 +40,7 @@ struct ScCellKeyword
     ScCellKeyword(const sal_Char* pName, OpCode eOpCode, const ::com::sun::star::lang::Locale& rLocale);
 };
 
-typedef ::boost::unordered_map< String, ::std::list<ScCellKeyword>, ScStringHashCode, ::std::equal_to<String> > ScCellKeywordHashMap;
+typedef ::boost::unordered_map< OUString, ::std::list<ScCellKeyword>, OUStringHash > ScCellKeywordHashMap;
 
 /** Translate cell function keywords.
 
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index dfa5532..1ab3186 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -189,7 +189,7 @@ void ReplaceCell( ScAddress& );     // for TableOp
 void ReplaceCell( SCCOL& rCol, SCROW& rRow, SCTAB& rTab );  // for TableOp
 bool IsTableOpInRange( const ScRange& );
 sal_uLong GetCellNumberFormat( const ScAddress& rPos, ScRefCellValue& rCell );
-double ConvertStringToValue( const String& );
+double ConvertStringToValue( const OUString& );
 double GetCellValue( const ScAddress&, ScRefCellValue& rCell );
 double GetCellValueOrZero( const ScAddress&, ScRefCellValue& rCell );
 double GetValueCellValue( const ScAddress&, double fOrig );
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index bf6beb3..5d080ba 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1310,12 +1310,12 @@ bool ConvertDoubleRef( ScDocument* pDoc, const String& rRefString, SCTAB nDefTab
     return bRet;
 }
 
-sal_uInt16 ScAddress::Parse( const String& r, ScDocument* pDoc,
+sal_uInt16 ScAddress::Parse( const OUString& r, ScDocument* pDoc,
                          const Details& rDetails,
                          ExternalInfo* pExtInfo,
                          const uno::Sequence< const sheet::ExternalLinkInfo > * pExternalLinks )
 {
-    return lcl_ScAddress_Parse( r.GetBuffer(), pDoc, *this, rDetails, pExtInfo, pExternalLinks );
+    return lcl_ScAddress_Parse( r.getStr(), pDoc, *this, rDetails, pExtInfo, pExternalLinks );
 }
 
 bool ScRange::Intersects( const ScRange& r ) const
@@ -1443,12 +1443,12 @@ lcl_ScRange_Parse_OOo( ScRange &aRange, const String& r, ScDocument* pDoc, ScAdd
     return nRes1;
 }
 
-sal_uInt16 ScRange::Parse( const String& r, ScDocument* pDoc,
+sal_uInt16 ScRange::Parse( const OUString& r, ScDocument* pDoc,
                        const ScAddress::Details& rDetails,
                        ScAddress::ExternalInfo* pExtInfo,
                        const uno::Sequence< const sheet::ExternalLinkInfo > * pExternalLinks )
 {
-    if ( r.Len() <= 0 )
+    if (r.isEmpty())
         return 0;
 
     switch (rDetails.eConv)
@@ -1459,11 +1459,11 @@ sal_uInt16 ScRange::Parse( const String& r, ScDocument* pDoc,
 
     case formula::FormulaGrammar::CONV_XL_A1:
     case formula::FormulaGrammar::CONV_XL_OOX:
-        return lcl_ScRange_Parse_XL_A1( *this, r.GetBuffer(), pDoc, false, pExtInfo,
+        return lcl_ScRange_Parse_XL_A1( *this, r.getStr(), pDoc, false, pExtInfo,
                 (rDetails.eConv == formula::FormulaGrammar::CONV_XL_OOX ? pExternalLinks : NULL) );
 
     case formula::FormulaGrammar::CONV_XL_R1C1:
-        return lcl_ScRange_Parse_XL_R1C1( *this, r.GetBuffer(), pDoc, rDetails, false, pExtInfo );
+        return lcl_ScRange_Parse_XL_R1C1( *this, r.getStr(), pDoc, rDetails, false, pExtInfo );
     }
 }
 
@@ -1486,15 +1486,15 @@ sal_uInt16 ScRange::ParseAny( const String& r, ScDocument* pDoc,
 }
 
 // Parse only full row references
-sal_uInt16 ScRange::ParseCols( const String& rStr, ScDocument* pDoc,
+sal_uInt16 ScRange::ParseCols( const OUString& rStr, ScDocument* pDoc,
                            const ScAddress::Details& rDetails )
 {
-    const sal_Unicode* p = rStr.GetBuffer();
-    sal_uInt16 nRes = 0, ignored = 0;
-
-    if( NULL == p )
+    if (rStr.isEmpty())
         return 0;
 
+    const sal_Unicode* p = rStr.getStr();
+    sal_uInt16 nRes = 0, ignored = 0;
+
     (void)pDoc; // make compiler shutup we may need this later
 
     switch (rDetails.eConv)
@@ -1545,15 +1545,15 @@ sal_uInt16 ScRange::ParseCols( const String& rStr, ScDocument* pDoc,
 }
 
 // Parse only full row references
-sal_uInt16 ScRange::ParseRows( const String& rStr, ScDocument* pDoc,
+sal_uInt16 ScRange::ParseRows( const OUString& rStr, ScDocument* pDoc,
                            const ScAddress::Details& rDetails )
 {
-    const sal_Unicode* p = rStr.GetBuffer();
-    sal_uInt16 nRes = 0, ignored = 0;
-
-    if( NULL == p )
+    if (rStr.isEmpty())
         return 0;
 
+    const sal_Unicode* p = rStr.getStr();
+    sal_uInt16 nRes = 0, ignored = 0;
+
     (void)pDoc; // make compiler shutup we may need this later
 
     switch (rDetails.eConv)
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index bf04a4a..e278d6c 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -437,7 +437,7 @@ static bool lcl_isValidQuotedText( const String& rFormula, xub_StrLen nSrcPos, P
 }
 
 static bool lcl_parseExternalName(
-        const String& rSymbol,
+        const OUString& rSymbol,
         String& rFile,
         String& rName,
         const sal_Unicode cSep,
@@ -446,12 +446,12 @@ static bool lcl_parseExternalName(
 {
     /* TODO: future versions will have to support sheet-local names too, thus
      * return a possible sheet name as well. */
-    const sal_Unicode* const pStart = rSymbol.GetBuffer();
+    const sal_Unicode* const pStart = rSymbol.getStr();
     const sal_Unicode* p = pStart;
-    xub_StrLen nLen = rSymbol.Len();
+    sal_Int32 nLen = rSymbol.getLength();
     sal_Unicode cPrev = 0;
     String aTmpFile, aTmpName;
-    xub_StrLen i = 0;
+    sal_Int32 i = 0;
     bool bInName = false;
     if (cSep == '!')
     {
@@ -481,7 +481,7 @@ static bool lcl_parseExternalName(
                 // quote.
                 cPrev = c;
                 ++i; ++p;
-                for (xub_StrLen j = i; j < nLen; ++j, ++p)
+                for (sal_Int32 j = i; j < nLen; ++j, ++p)
                 {
                     c = *p;
                     if (c == '\'')
@@ -676,8 +676,8 @@ struct Convention_A1 : public ScCompiler::Convention
     static void MakeColStr( OUStringBuffer& rBuffer, SCCOL nCol );
     static void MakeRowStr( OUStringBuffer& rBuffer, SCROW nRow );
 
-    ParseResult parseAnyToken( const String& rFormula,
-                               xub_StrLen nSrcPos,
+    ParseResult parseAnyToken( const OUString& rFormula,
+                               sal_Int32 nSrcPos,
                                const CharClass* pCharClass) const
     {
         ParseResult aRet;
@@ -841,7 +841,7 @@ struct ConventionOOO_A1 : public Convention_A1
         return sal_Unicode(0);
     }
 
-    virtual bool parseExternalName( const String& rSymbol, String& rFile, String& rName,
+    virtual bool parseExternalName( const OUString& rSymbol, String& rFile, String& rName,
             const ScDocument* pDoc,
             const ::com::sun::star::uno::Sequence<
                 const ::com::sun::star::sheet::ExternalLinkInfo > * pExternalLinks ) const
@@ -1121,7 +1121,7 @@ struct ConventionXL
         return sal_Unicode(0);
     }
 
-    static bool parseExternalName( const String& rSymbol, String& rFile, String& rName,
+    static bool parseExternalName( const OUString& rSymbol, String& rFile, String& rName,
             const ScDocument* pDoc,
             const ::com::sun::star::uno::Sequence<
                 const ::com::sun::star::sheet::ExternalLinkInfo > * pExternalLinks )
@@ -1145,15 +1145,15 @@ struct ConventionXL
 
         rBuffer.append(sal_Unicode('['));
         rBuffer.append(sal_Unicode('\''));
-        String aFullName;
+        OUString aFullName;
         if (bEncodeUrl)
             aFullName = rFullName;
         else
             aFullName = INetURLObject::decode(rFullName, INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS);
 
-        const sal_Unicode* pBuf = aFullName.GetBuffer();
-        xub_StrLen nLen = aFullName.Len();
-        for (xub_StrLen i = 0; i < nLen; ++i)
+        const sal_Unicode* pBuf = aFullName.getStr();
+        sal_Int32 nLen = aFullName.getLength();
+        for (sal_Int32 i = 0; i < nLen; ++i)
         {
             const sal_Unicode c = pBuf[i];
             if (c == sal_Unicode('\''))
@@ -1183,12 +1183,12 @@ struct ConventionXL
         }
     }
 
-    static void parseExternalDocName( const String& rFormula, xub_StrLen& rSrcPos )
+    static void parseExternalDocName( const OUString& rFormula, sal_Int32& rSrcPos )
     {
-        xub_StrLen nLen = rFormula.Len();
-        const sal_Unicode* p = rFormula.GetBuffer();
+        sal_Int32 nLen = rFormula.getLength();
+        const sal_Unicode* p = rFormula.getStr();
         sal_Unicode cPrev = 0;
-        for (xub_StrLen i = rSrcPos; i < nLen; ++i)
+        for (sal_Int32 i = rSrcPos; i < nLen; ++i)
         {
             sal_Unicode c = p[i];
             if (i == rSrcPos)
@@ -1313,8 +1313,8 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL
         }
     }
 
-    virtual ParseResult parseAnyToken( const String& rFormula,
-                                       xub_StrLen nSrcPos,
+    virtual ParseResult parseAnyToken( const OUString& rFormula,
+                                       sal_Int32 nSrcPos,
                                        const CharClass* pCharClass) const
     {
         ParseResult aRet;
@@ -1335,7 +1335,7 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL
         return ConventionXL::getSpecialSymbol(eSymType);
     }
 
-    virtual bool parseExternalName( const String& rSymbol, String& rFile, String& rName,
+    virtual bool parseExternalName( const OUString& rSymbol, String& rFile, String& rName,
             const ScDocument* pDoc,
             const ::com::sun::star::uno::Sequence<
                 const ::com::sun::star::sheet::ExternalLinkInfo > * pExternalLinks ) const
@@ -1503,8 +1503,8 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL
         }
     }
 
-    ParseResult parseAnyToken( const String& rFormula,
-                               xub_StrLen nSrcPos,
+    ParseResult parseAnyToken( const OUString& rFormula,
+                               sal_Int32 nSrcPos,
                                const CharClass* pCharClass) const
     {
         ConventionXL::parseExternalDocName(rFormula, nSrcPos);
@@ -1528,7 +1528,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL
         return ConventionXL::getSpecialSymbol(eSymType);
     }
 
-    virtual bool parseExternalName( const String& rSymbol, String& rFile, String& rName,
+    virtual bool parseExternalName( const OUString& rSymbol, String& rFile, String& rName,
             const ScDocument* pDoc,
             const ::com::sun::star::uno::Sequence<
                 const ::com::sun::star::sheet::ExternalLinkInfo > * pExternalLinks ) const
@@ -1797,7 +1797,7 @@ xub_StrLen ScCompiler::NextSymbol(bool bInArray)
 {
     cSymbol[MAXSTRLEN-1] = 0;       // Stopper
     sal_Unicode* pSym = cSymbol;
-    const sal_Unicode* const pStart = aFormula.GetBuffer();
+    const sal_Unicode* const pStart = aFormula.getStr();
     const sal_Unicode* pSrc = pStart + nSrcPos;
     bool bi18n = false;
     sal_Unicode c = *pSrc;
@@ -2311,8 +2311,8 @@ Label_MaskStateMachine:
     }
     if ( bi18n )
     {
-        nSrcPos = sal::static_int_cast<xub_StrLen>( nSrcPos + nSpaces );
-        String aSymbol;
+        nSrcPos = nSrcPos + nSpaces;
+        OUStringBuffer aSymbol;
         mnRangeOpPosInSymbol = -1;
         sal_uInt16 nErr = 0;
         do
@@ -2320,7 +2320,7 @@ Label_MaskStateMachine:
             bi18n = false;
             // special case  (e.g. $'sheetname' in OOO A1)
             if ( pStart[nSrcPos] == cSheetPrefix && pStart[nSrcPos+1] == '\'' )
-                aSymbol += pStart[nSrcPos++];
+                aSymbol.append(pStart[nSrcPos++]);
 
             ParseResult aRes = pConv->parseAnyToken( aFormula, nSrcPos, pCharClass );
 
@@ -2329,13 +2329,13 @@ Label_MaskStateMachine:
             if ( aRes.EndPos <= nSrcPos )
             {   // ?!?
                 SetError( nErr = errIllegalChar );
-                nSrcPos = aFormula.Len();
-                aSymbol.Erase();
+                nSrcPos = aFormula.getLength();
+                aSymbol.truncate(0);
             }
             else
             {
-                aSymbol.Append( pStart + nSrcPos, (xub_StrLen)aRes.EndPos - nSrcPos );
-                nSrcPos = (xub_StrLen) aRes.EndPos;
+                aSymbol.append( pStart + nSrcPos, aRes.EndPos - nSrcPos);
+                nSrcPos = aRes.EndPos;
                 c = pStart[nSrcPos];
                 if ( aRes.TokenType & KParseType::SINGLE_QUOTE_NAME )
                 {   // special cases (e.g. 'sheetname'. or 'filename'# in OOO A1)
@@ -2344,25 +2344,25 @@ Label_MaskStateMachine:
                 // One range operator restarts parsing for second reference.
                 if (c == ':' && mnRangeOpPosInSymbol < 0)
                 {
-                    mnRangeOpPosInSymbol = aSymbol.Len();
+                    mnRangeOpPosInSymbol = aSymbol.getLength();
                     bi18n = true;
                 }
                 if ( bi18n )
-                    aSymbol += pStart[nSrcPos++];
+                    aSymbol.append(pStart[nSrcPos++]);
             }
         } while ( bi18n && !nErr );
-        xub_StrLen nLen = aSymbol.Len();
+        sal_Int32 nLen = aSymbol.getLength();
         if ( nLen >= MAXSTRLEN )
         {
             SetError( errStringOverflow );
             nLen = MAXSTRLEN-1;
         }
-        lcl_UnicodeStrNCpy( cSymbol, aSymbol.GetBuffer(), nLen );
+        lcl_UnicodeStrNCpy( cSymbol, aSymbol.getStr(), nLen );
         pSym = &cSymbol[nLen];
     }
     else
     {
-        nSrcPos = sal::static_int_cast<xub_StrLen>( pSrc - pStart );
+        nSrcPos = pSrc - pStart;
         *pSym = 0;
     }
     if (mnRangeOpPosInSymbol >= 0 && mnRangeOpPosInSymbol == (pSym-1) - &cSymbol[0])
@@ -2436,7 +2436,7 @@ bool ScCompiler::IsOpCode( const OUString& rName, bool bInArray )
     }
     if (!bFound)
     {
-        String aIntName;
+        OUString aIntName;
         if (mxSymbols->hasExternals())
         {
             // If symbols are set by filters get mapping to exact name.
@@ -2447,7 +2447,7 @@ bool ScCompiler::IsOpCode( const OUString& rName, bool bInArray )
                 if (ScGlobal::GetAddInCollection()->GetFuncData( (*iExt).second))
                     aIntName = (*iExt).second;
             }
-            if (!aIntName.Len())
+            if (aIntName.isEmpty())
             {
                 // If that isn't found we might continue with rName lookup as a
                 // last resort by just falling through to FindFunction(), but
@@ -2456,7 +2456,7 @@ bool ScCompiler::IsOpCode( const OUString& rName, bool bInArray )
                 return false;
             }
         }
-        if (!aIntName.Len())
+        if (aIntName.isEmpty())
         {
             // Old (deprecated) addins first for legacy.
             if (ScGlobal::GetFuncCollection()->findByName(cSymbol))
@@ -2471,10 +2471,10 @@ bool ScCompiler::IsOpCode( const OUString& rName, bool bInArray )
                 aIntName = ScGlobal::GetAddInCollection()->FindFunction(
                         rName, !mxSymbols->isEnglish());
         }
-        if (aIntName.Len())
+        if (!aIntName.isEmpty())
         {
             ScRawToken aToken;
-            aToken.SetExternal( aIntName.GetBuffer() );     // international name
+            aToken.SetExternal( aIntName.getStr() );     // international name
             pRawToken = aToken.Clone();
             bFound = true;
         }
@@ -2533,7 +2533,7 @@ bool ScCompiler::IsValue( const String& rSym )
 
         if (nType == NUMBERFORMAT_LOGICAL)
         {
-            const sal_Unicode* p = aFormula.GetBuffer() + nSrcPos;
+            const sal_Unicode* p = aFormula.getStr() + nSrcPos;
             while( *p == ' ' )
                 p++;
             if (*p == '(')
@@ -2720,10 +2720,10 @@ bool ScCompiler::IsSingleReference( const String& rName )
     return ( nFlags & SCA_VALID ) != 0;
 }
 
-bool ScCompiler::IsReference( const String& rName )
+bool ScCompiler::IsReference( const OUString& rName )
 {
     // Has to be called before IsValue
-    sal_Unicode ch1 = rName.GetChar(0);
+    sal_Unicode ch1 = rName[0];
     sal_Unicode cDecSep = ( mxSymbols->isEnglish() ? '.' :
         ScGlobal::pLocaleData->getNumDecimalSep()[0] );
     if ( ch1 == cDecSep )
@@ -2744,7 +2744,7 @@ bool ScCompiler::IsReference( const String& rName )
                     break;      // may be 3:3, continue as usual
                 return false;
             }
-            sal_Unicode const * const pTabSep = rName.GetBuffer() + nPos;
+            sal_Unicode const * const pTabSep = rName.getStr() + nPos;
             sal_Unicode ch2 = pTabSep[1];   // maybe a column identifier
             if ( !(ch2 == '$' || rtl::isAsciiAlpha( ch2 )) )
                 return false;
@@ -2761,7 +2761,7 @@ bool ScCompiler::IsReference( const String& rName )
                 // and would produce wrong formulas if the conditions here are met.
                 // If you can live with these restrictions you may remove the
                 // check and return an unconditional FALSE.
-                String aTabName( rName.Copy( 0, nPos ) );
+                String aTabName( rName.copy( 0, nPos ) );
                 SCTAB nTab;
                 if ( !pDoc->GetTable( aTabName, nTab ) )
                     return false;
@@ -2787,7 +2787,7 @@ bool ScCompiler::IsReference( const String& rName )
         while (cSymbol[++nLen])
             ;
         cSymbol[mnRangeOpPosInSymbol] = 0;
-        nSrcPos -= static_cast<xub_StrLen>(nLen - mnRangeOpPosInSymbol);
+        nSrcPos -= (nLen - mnRangeOpPosInSymbol);
         mnRangeOpPosInSymbol = -1;
         mbRewind = true;
         return true;    // end all checks
@@ -2802,7 +2802,7 @@ bool ScCompiler::IsReference( const String& rName )
             case FormulaGrammar::CONV_XL_A1:
             case FormulaGrammar::CONV_XL_R1C1:
             case FormulaGrammar::CONV_XL_OOX:
-                if (rName.GetChar(0) == '\'' && IsDoubleReference( rName))
+                if (rName[0] == '\'' && IsDoubleReference( rName))
                     return true;
                 break;
             default:
@@ -3361,7 +3361,7 @@ void ScCompiler::AutoCorrectParsedSymbol()
                 bColons = false;
             if ( nRefs && nRefs <= 2 )
             {   // reference twisted? 4A => A4 etc.
-                String aTab[2], aRef[2];
+                OUString aTab[2], aRef[2];
                 const ScAddress::Details aDetails( pConv->meConv, aPos );
                 if ( nRefs == 2 )
                 {
@@ -3376,18 +3376,18 @@ void ScCompiler::AutoCorrectParsedSymbol()
                 sal_uInt16 nMask = SCA_VALID | SCA_VALID_COL | SCA_VALID_ROW;
                 for ( int j=0; j<nRefs; j++ )
                 {
-                    xub_StrLen nTmp = 0;
-                    xub_StrLen nDotPos = STRING_NOTFOUND;
-                    while ( (nTmp = aRef[j].Search( '.', nTmp )) != STRING_NOTFOUND )
+                    sal_Int32 nTmp = 0;
+                    sal_Int32 nDotPos = -1;
+                    while ( (nTmp = aRef[j].indexOf( '.', nTmp )) != -1 )
                         nDotPos = nTmp++;      // the last one counts
-                    if ( nDotPos != STRING_NOTFOUND )
+                    if ( nDotPos != -1 )
                     {
-                        aTab[j] = aRef[j].Copy( 0, nDotPos + 1 );  // with '.'
-                        aRef[j].Erase( 0, nDotPos + 1 );
+                        aTab[j] = aRef[j].copy( 0, nDotPos + 1 );  // with '.'
+                        aRef[j] = aRef[j].copy( nDotPos + 1 );
                     }
                     String aOld( aRef[j] );
                     String aStr2;
-                    const sal_Unicode* p = aRef[j].GetBuffer();
+                    const sal_Unicode* p = aRef[j].getStr();
                     while ( *p && CharClass::isAsciiNumeric( OUString(*p) ) )
                         aStr2 += *p++;
                     aRef[j] = OUString( p );
@@ -3417,7 +3417,7 @@ void ScCompiler::AutoCorrectParsedSymbol()
     }
 }
 
-static inline bool lcl_UpperAsciiOrI18n( String& rUpper, const OUString& rOrg, FormulaGrammar::Grammar eGrammar )
+static inline bool lcl_UpperAsciiOrI18n( OUString& rUpper, const OUString& rOrg, FormulaGrammar::Grammar eGrammar )
 {
     if (FormulaGrammar::isODFF( eGrammar ))
     {
@@ -3482,7 +3482,7 @@ bool ScCompiler::NextNewToken( bool bInArray )
          * #REF!.#REF!#REF! parts. In case of reading ODF that is all
          * handled by IsPredetectedReference(), this case here remains for
          * manual/API input. */
-        String aBad( aFormula.Copy( nSrcPos-1 ) );
+        OUString aBad( aFormula.copy( nSrcPos-1 ) );
         eLastOp = pArr->AddBad( aBad )->GetOpCode();
         return false;
     }
@@ -3506,7 +3506,7 @@ bool ScCompiler::NextNewToken( bool bInArray )
     if ( bMayBeFuncName )
     {
         // a function name must be followed by a parenthesis
-        const sal_Unicode* p = aFormula.GetBuffer() + nSrcPos;
+        const sal_Unicode* p = aFormula.getStr() + nSrcPos;
         while( *p == ' ' )
             p++;
         bMayBeFuncName = ( *p == '(' );
@@ -3515,7 +3515,7 @@ bool ScCompiler::NextNewToken( bool bInArray )
     // Italian ARCTAN.2 resulted in #REF! => IsOpcode() before
     // IsReference().
 
-    String aUpper;
+    OUString aUpper;
 
     do
     {
@@ -3536,7 +3536,7 @@ bool ScCompiler::NextNewToken( bool bInArray )
                 return true;
         }
 
-        aUpper.Erase();
+        aUpper = "";
         bool bAsciiUpper = false;
         if (bMayBeFuncName)
         {
@@ -3563,7 +3563,7 @@ bool ScCompiler::NextNewToken( bool bInArray )
             return true;
         }
 
-        if (!aUpper.Len())
+        if (aUpper.isEmpty())
             bAsciiUpper = lcl_UpperAsciiOrI18n( aUpper, aOrg, meGrammar);
 
         // IsBoolean() before IsValue() to catch inline bools without the kludge
@@ -3609,7 +3609,7 @@ bool ScCompiler::NextNewToken( bool bInArray )
     // the interpreter.
     aUpper = ScGlobal::pCharClass->lowercase( aUpper );
     ScRawToken aToken;
-    aToken.SetString( aUpper.GetBuffer() );
+    aToken.SetString( aUpper.getStr() );
     aToken.NewOpCode( ocBad );
     pRawToken = aToken.Clone();
     if ( bAutoCorrect )
@@ -3668,14 +3668,14 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula )
         aCorrectedSymbol = "";
     }
     sal_uInt8 nForced = 0;   // ==formula forces recalc even if cell is not visible
-    if( aFormula.GetChar(nSrcPos) == '=' )
+    if( aFormula[nSrcPos] == '=' )
     {
         nSrcPos++;
         nForced++;
         if ( bAutoCorrect )
             aCorrectedFormula += "=";
     }
-    if( aFormula.GetChar(nSrcPos) == '=' )
+    if( aFormula[nSrcPos] == '=' )
     {
         nSrcPos++;
         nForced++;
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index c914396..bec70aa 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -2225,12 +2225,12 @@ void ScInterpreter::ScDecimal()
     if ( MustHaveParamCount( GetByte(), 2 ) )
     {
         double fBase = ::rtl::math::approxFloor( GetDouble() );
-        String aStr( GetString() );
+        OUString aStr( GetString() );
         if ( !nGlobalError && 2 <= fBase && fBase <= 36 )
         {
             double fVal = 0.0;
             int nBase = (int) fBase;
-            const sal_Unicode* p = aStr.GetBuffer();
+            const sal_Unicode* p = aStr.getStr();
             while ( *p == ' ' || *p == '\t' )
                 p++;        // strip leading white space
             if ( nBase == 16 )
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 7288613..a49e650 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -218,7 +218,7 @@ sal_uInt16 ScInterpreter::GetCellErrCode( const ScRefCellValue& rCell )
     into account; minutes and seconds are limited to the value 59 as well.
  */
 
-double ScInterpreter::ConvertStringToValue( const String& rStr )
+double ScInterpreter::ConvertStringToValue( const OUString& rStr )
 {
 #if 1
     // We keep this code until we provide a friendly way to convert string
@@ -237,12 +237,12 @@ double ScInterpreter::ConvertStringToValue( const String& rStr )
         // containing only spaces, be on par in these cases with what was
         // accepted in OOo and is in AOO (see also the else branch below) and
         // convert to 0 to prevent interoperability nightmares.
-        if (!rStr.Len())
+        if (rStr.isEmpty())
             return fValue;
-        else if (rStr.GetChar(0) == ' ')
+        else if (rStr[0] == ' ')
         {
-            const sal_Unicode* p = rStr.GetBuffer() + 1;
-            const sal_Unicode* const pStop = p - 1 + rStr.Len();
+            const sal_Unicode* p = rStr.getStr() + 1;
+            const sal_Unicode* const pStop = p - 1 + rStr.getLength();
             while (p < pStop && *p == ' ')
                 ++p;
             if (p == pStop)
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index d738c01..46ccfd0 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -358,14 +358,14 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, const SvxURLField& rU
     {
         sal_uInt16 nLevel;
         bool bRel;
-        String aFileName( BuildFileName( nLevel, bRel, rUrl, rRoot ) );
+        OUString aFileName( BuildFileName( nLevel, bRel, rUrl, rRoot ) );
 
         if( eProtocol == INET_PROT_SMB )
         {
             // #n382718# (and #n261623#) Convert smb notation to '\\'
             aFileName = aUrlObj.GetMainURL( INetURLObject::NO_DECODE );
-            aFileName = OUString( aFileName.GetBuffer() + 4 ); // skip the 'smb:' part
-            aFileName.SearchAndReplaceAll( '/', '\\' );
+            aFileName = aFileName.copy(4); // skip the 'smb:' part
+            aFileName = aFileName.replace('/', '\\');
         }
 
         if( !bRel )
@@ -1576,7 +1576,7 @@ XclExpDV::XclExpDV( const XclExpRoot& rRoot, sal_uLong nScHandle ) :
                             sFormulaBuf.append( (sal_Unicode) ',' );
                         }
                         mxString1->Append( aToken );
-                        sFormulaBuf.append( XclXmlUtils::ToOUString( aToken ) );
+                        sFormulaBuf.append( aToken );
                     }
                     ::set_flag( mnFlags, EXC_DV_STRINGLIST );
 
diff --git a/sc/source/filter/excel/xename.cxx b/sc/source/filter/excel/xename.cxx
index 1461161..b18542c 100644
--- a/sc/source/filter/excel/xename.cxx
+++ b/sc/source/filter/excel/xename.cxx
@@ -328,7 +328,7 @@ void XclExpName::SaveXml( XclExpXmlStream& rStrm )
             // OOXTODO: XML_workbookParameter, "",
             // OOXTODO: XML_xlm, "",
             FSEND );
-    rWorkbook->writeEscaped( XclXmlUtils::ToOUString( msSymbol ) );
+    rWorkbook->writeEscaped( msSymbol );
     rWorkbook->endElement( XML_definedName );
 }
 
diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx
index 4092eb8..06649eb 100644
--- a/sc/source/filter/excel/xepage.cxx
+++ b/sc/source/filter/excel/xepage.cxx
@@ -58,7 +58,7 @@ void XclExpHeaderFooter::SaveXml( XclExpXmlStream& rStrm )
     sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
     sal_Int32 nElement = GetRecId() == EXC_ID_HEADER ?  XML_oddHeader : XML_oddFooter;
     rWorksheet->startElement( nElement, FSEND );
-    rWorksheet->writeEscaped( XclXmlUtils::ToOUString( maHdrString ) );
+    rWorksheet->writeEscaped( maHdrString );
     rWorksheet->endElement( nElement );
 }
 
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 06b58ab..7c67f77 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -744,11 +744,6 @@ OString XclXmlUtils::ToOString( const OUString& s )
     return OUStringToOString( s, RTL_TEXTENCODING_UTF8  );
 }
 
-OString XclXmlUtils::ToOString( const String& s )
-{
-    return OString( s.GetBuffer(), s.Len(), RTL_TEXTENCODING_UTF8 );
-}
-
 OString XclXmlUtils::ToOString( const ScAddress& rAddress )
 {
     OUString sAddress(rAddress.Format(SCA_VALID, NULL, ScAddress::Details( FormulaGrammar::CONV_XL_A1)));
@@ -838,11 +833,6 @@ OUString XclXmlUtils::ToOUString( const ScfUInt16Vec& rBuf, sal_Int32 nStart, sa
     return (nLength > 0) ? OUString( &rBuf[nStart], nLength ) : OUString();
 }
 
-OUString XclXmlUtils::ToOUString( const String& s )
-{
-    return OUString( s.GetBuffer(), s.Len() );
-}
-
 OUString XclXmlUtils::ToOUString(
     ScDocument& rDocument, const ScAddress& rAddress, const ScTokenArray* pTokenArray,
     const FormulaCompiler::OpCodeMapPtr & xOpCodeMap )
diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx
index b1cc1af..edd5208 100644
--- a/sc/source/filter/excel/xestring.cxx
+++ b/sc/source/filter/excel/xestring.cxx
@@ -103,11 +103,6 @@ XclExpString::XclExpString( XclStrFlags nFlags, sal_uInt16 nMaxLen )
     Init( 0, nFlags, nMaxLen, true );
 }
 
-XclExpString::XclExpString( const String& rString, XclStrFlags nFlags, sal_uInt16 nMaxLen )
-{
-    Assign( rString, nFlags, nMaxLen );
-}
-
 XclExpString::XclExpString( const OUString& rString, XclStrFlags nFlags, sal_uInt16 nMaxLen )
 {
     Assign( rString, nFlags, nMaxLen );
@@ -115,11 +110,6 @@ XclExpString::XclExpString( const OUString& rString, XclStrFlags nFlags, sal_uIn
 
 // assign ---------------------------------------------------------------------
 
-void XclExpString::Assign( const String& rString, XclStrFlags nFlags, sal_uInt16 nMaxLen )
-{
-    Build( rString.GetBuffer(), rString.Len(), nFlags, nMaxLen );
-}
-
 void XclExpString::Assign( const OUString& rString, XclStrFlags nFlags, sal_uInt16 nMaxLen )
 {
     Build( rString.getStr(), rString.getLength(), nFlags, nMaxLen );
@@ -131,7 +121,7 @@ void XclExpString::Assign( sal_Unicode cChar, XclStrFlags nFlags, sal_uInt16 nMa
 }
 
 void XclExpString::AssignByte(
-        const String& rString, rtl_TextEncoding eTextEnc, XclStrFlags nFlags, sal_uInt16 nMaxLen )
+        const OUString& rString, rtl_TextEncoding eTextEnc, XclStrFlags nFlags, sal_uInt16 nMaxLen )
 {
     // length may differ from length of rString
     OString aByteStr(OUStringToOString(rString, eTextEnc));
@@ -140,14 +130,14 @@ void XclExpString::AssignByte(
 
 // append ---------------------------------------------------------------------
 
-void XclExpString::Append( const String& rString )
+void XclExpString::Append( const OUString& rString )
 {
-    BuildAppend( rString.GetBuffer(), rString.Len() );
+    BuildAppend( rString.getStr(), rString.getLength() );
 }
 
-void XclExpString::AppendByte( const String& rString, rtl_TextEncoding eTextEnc )
+void XclExpString::AppendByte( const OUString& rString, rtl_TextEncoding eTextEnc )
 {
-    if( rString.Len() > 0 )
+    if (!rString.isEmpty())
     {
         // length may differ from length of rString
         OString aByteStr(OUStringToOString(rString, eTextEnc));
diff --git a/sc/source/filter/excel/xihelper.cxx b/sc/source/filter/excel/xihelper.cxx
index db721e2..ea41c8c 100644
--- a/sc/source/filter/excel/xihelper.cxx
+++ b/sc/source/filter/excel/xihelper.cxx
@@ -276,7 +276,7 @@ XclImpHFConverter::~XclImpHFConverter()
 {
 }
 
-void XclImpHFConverter::ParseString( const String& rHFString )
+void XclImpHFConverter::ParseString( const OUString& rHFString )
 {
     // edit engine objects
     mrEE.SetText( EMPTY_STRING );
@@ -301,8 +301,8 @@ void XclImpHFConverter::ParseString( const String& rHFString )
         xlPSHeight          /// Read font height ('&' is followed by num. digits, reads until non-digit).
     } eState = xlPSText;
 
-    const sal_Unicode* pChar = rHFString.GetBuffer();
-    const sal_Unicode* pNull = pChar + rHFString.Len(); // pointer to teminating null char
+    const sal_Unicode* pChar = rHFString.getStr();
+    const sal_Unicode* pNull = pChar + rHFString.getLength(); // pointer to teminating null char
     while( *pChar )
     {
         switch( eState )
diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx
index ba759ae..a6c371e 100644
--- a/sc/source/filter/inc/xestream.hxx
+++ b/sc/source/filter/inc/xestream.hxx
@@ -275,7 +275,6 @@ public:
     static OString ToOString( const Color& rColor );
     static OString ToOString( const OUString& s );
     static OString ToOString( const ScfUInt16Vec& rBuffer );
-    static OString ToOString( const String& s );
     static OString ToOString( const ScAddress& rRange );
     static OString ToOString( const ScRange& rRange );
     static OString ToOString( const ScRangeList& rRangeList );
@@ -286,7 +285,6 @@ public:
 
     static OUString ToOUString( const char* s );
     static OUString ToOUString( const ScfUInt16Vec& rBuffer, sal_Int32 nStart = 0, sal_Int32 nLength = -1 );
-    static OUString ToOUString( const String& s );
     static OUString ToOUString( ScDocument& rDocument, const ScAddress& rAddress,
                                 const ScTokenArray* pTokenArray, const ScCompiler::OpCodeMapPtr & xOpCodeMap );
     static OUString ToOUString( const XclExpString& s );
diff --git a/sc/source/filter/inc/xestring.hxx b/sc/source/filter/inc/xestring.hxx
index de23884..f4a7e24 100644
--- a/sc/source/filter/inc/xestring.hxx
+++ b/sc/source/filter/inc/xestring.hxx
@@ -58,13 +58,6 @@ public:
         @param nFlags  Modifiers for string export.
         @param nMaxLen  The maximum number of characters to store in this string. */
     explicit            XclExpString(
-                            const String& rString,
-                            XclStrFlags nFlags = EXC_STR_DEFAULT,
-                            sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
-    /** Constructs an unformatted BIFF8 Unicode string.
-        @param nFlags  Modifiers for string export.
-        @param nMaxLen  The maximum number of characters to store in this string. */
-    explicit            XclExpString(
                             const OUString& rString,
                             XclStrFlags nFlags = EXC_STR_DEFAULT,
                             sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
@@ -75,14 +68,6 @@ public:
         @param nFlags  Modifiers for string export.
         @param nMaxLen  The maximum number of characters to store in this string. */
     void                Assign(
-                            const String& rString,
-                            XclStrFlags nFlags = EXC_STR_DEFAULT,
-                            sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
-
-    /** Assigns an unformatted string, converts this object to a BIFF8 Unicode string.
-        @param nFlags  Modifiers for string export.
-        @param nMaxLen  The maximum number of characters to store in this string. */
-    void                Assign(
                             const OUString& rString,
                             XclStrFlags nFlags = EXC_STR_DEFAULT,
                             sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
@@ -99,7 +84,7 @@ public:
         @param nFlags  Modifiers for string export.
         @param nMaxLen  The maximum number of characters to store in this string. */
     void                AssignByte(
-                            const String& rString,
+                            const OUString& rString,
                             rtl_TextEncoding eTextEnc,
                             XclStrFlags nFlags = EXC_STR_DEFAULT,
                             sal_uInt16 nMaxLen = EXC_STR_MAXLEN );
@@ -108,11 +93,11 @@ public:
 
     /** Appends a string. Uses the string flags used in constructor or last Assign().
         @descr  This object must be a BIFF8 Unicode string. */
-    void                Append( const String& rString );
+    void                Append( const OUString& rString );
 
     /** Appends a string. Uses the string flags used in constructor or last Assign().
         @descr  This object must be a BIFF2-BIFF7 byte string. */
-    void                AppendByte( const String& rString, rtl_TextEncoding eTextEnc );
+    void                AppendByte( const OUString& rString, rtl_TextEncoding eTextEnc );
     /** Appends a character. Uses the string flags used in constructor or last Assign().
         @descr  This object must be a BIFF2-BIFF7 byte string. */
     void                AppendByte( sal_Unicode cChar, rtl_TextEncoding eTextEnc );
diff --git a/sc/source/filter/inc/xihelper.hxx b/sc/source/filter/inc/xihelper.hxx
index 5884aae..0727f26 100644
--- a/sc/source/filter/inc/xihelper.hxx
+++ b/sc/source/filter/inc/xihelper.hxx
@@ -163,7 +163,7 @@ public:
                         ~XclImpHFConverter();
 
     /** Parses the passed string and creates three new edit engine text objects. */
-    void                ParseString( const String& rHFString );
+    void                ParseString( const OUString& rHFString );
 
     /** Creates a ScPageHFItem and inserts it into the passed item set. */
     void                FillToItemSet( SfxItemSet& rItemSet, sal_uInt16 nWhichId ) const;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 3ce1a6c..365c6a0 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -192,7 +192,7 @@ void removeChars(OUString& rStr, sal_Unicode c)
 
 }
 
-void ScInputHandler::InitRangeFinder( const String& rFormula )
+void ScInputHandler::InitRangeFinder( const OUString& rFormula )
 {
     DeleteRangeFinder();
     ScDocShell* pDocSh = pActiveViewSh->GetViewData()->GetDocShell();
@@ -212,10 +212,10 @@ void ScInputHandler::InitRangeFinder( const String& rFormula )
     if ( nDot != STRING_NOTFOUND )
         aDelimiters = aDelimiters.replaceAt( nDot, 1 , "");               // Delimiter ohne Punkt
 
-    const sal_Unicode* pChar = rFormula.GetBuffer();
-    xub_StrLen nLen = rFormula.Len();
-    xub_StrLen nPos = 0;
-    xub_StrLen nStart = 0;
+    const sal_Unicode* pChar = rFormula.getStr();
+    sal_Int32 nLen = rFormula.getLength();
+    sal_Int32 nPos = 0;
+    sal_Int32 nStart = 0;
     sal_uInt16 nCount = 0;
     ScRange aRange;
     while ( nPos < nLen && nCount < RANGEFIND_MAX )
@@ -252,7 +252,7 @@ handle_r1c1:
 
         if ( nPos > nStart )
         {
-            String aTest = rFormula.Copy( nStart, nPos-nStart );
+            String aTest = rFormula.copy( nStart, nPos-nStart );
             const ScAddress::Details aAddrDetails( pDoc, aCursorPos );
             sal_uInt16 nFlags = aRange.ParseAny( aTest, pDoc, aAddrDetails );
             if ( nFlags & SCA_VALID )
@@ -395,11 +395,11 @@ static void lcl_RemoveLineEnd(OUString& rStr)
     removeChars(rStr, sal_Unicode('\n'));
 }
 
-xub_StrLen lcl_MatchParenthesis( const String& rStr, xub_StrLen nPos )
+xub_StrLen lcl_MatchParenthesis( const OUString& rStr, xub_StrLen nPos )
 {
     int nDir;
     sal_Unicode c1, c2 = 0;
-    c1 = rStr.GetChar( nPos );
+    c1 = rStr[nPos];
     switch ( c1 )
     {
     case '(' :
@@ -439,8 +439,8 @@ xub_StrLen lcl_MatchParenthesis( const String& rStr, xub_StrLen nPos )
     }
     if ( !nDir )
         return STRING_NOTFOUND;
-    xub_StrLen nLen = rStr.Len();
-    const sal_Unicode* p0 = rStr.GetBuffer();
+    xub_StrLen nLen = rStr.getLength();
+    const sal_Unicode* p0 = rStr.getStr();
     const sal_Unicode* p;
     const sal_Unicode* p1;
     sal_uInt16 nQuotes = 0;
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 3418d53..f4b9674 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -718,7 +718,7 @@ void ScCsvGrid::DoSelectAction( sal_uInt32 nColIndex, sal_uInt16 nModifier )
 
 void ScCsvGrid::ImplSetTextLineSep(
         sal_Int32 nLine, const OUString& rTextLine,
-        const String& rSepChars, sal_Unicode cTextSep, bool bMergeSep )
+        const OUString& rSepChars, sal_Unicode cTextSep, bool bMergeSep )
 {
     if( nLine < GetFirstVisLine() ) return;
 
@@ -730,7 +730,7 @@ void ScCsvGrid::ImplSetTextLineSep(
 
     // scan for separators
     String aCellText;
-    const sal_Unicode* pSepChars = rSepChars.GetBuffer();
+    const sal_Unicode* pSepChars = rSepChars.getStr();
     const sal_Unicode* pChar = rTextLine.getStr();
     sal_uInt32 nColIx = 0;
 
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index da29f00..d9a13e6 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -514,7 +514,7 @@ void lcl_GetColumnTypes(
         sal_Int32 nFieldLen = 0;
         sal_Int32 nPrecision = 0;
         sal_Int32 nDbType = sdbc::DataType::SQLNULL;
-        String aFieldName;
+        OUString aFieldName;
         OUString aString;
 
         // Feldname[,Type[,Width[,Prec]]]
@@ -580,11 +580,11 @@ void lcl_GetColumnTypes(
             // weitere nur alphanumerisch und Unterstrich erlaubt,
             // "_DBASELOCK" ist reserviert (obsolet weil erstes Zeichen kein Buchstabe),
             // keine doppelten Namen.
-            if ( !IsAsciiAlpha( aFieldName.GetChar(0) ) )
-                aFieldName.Insert( 'N', 0 );
+            if ( !IsAsciiAlpha( aFieldName[0] ) )
+                aFieldName = "N" + aFieldName;
             String aTmpStr;
             sal_Unicode c;
-            for ( const sal_Unicode* p = aFieldName.GetBuffer(); ( c = *p ) != 0; p++ )
+            for ( const sal_Unicode* p = aFieldName.getStr(); ( c = *p ) != 0; p++ )
             {
                 if ( IsAsciiAlpha( c ) || IsAsciiDigit( c ) || c == '_' )
                     aTmpStr += c;
@@ -592,8 +592,8 @@ void lcl_GetColumnTypes(
                     aTmpStr += '_';
             }
             aFieldName = aTmpStr;
-            if ( aFieldName.Len() > 10 )
-                aFieldName.Erase( 10 );
+            if ( aFieldName.getLength() > 10 )
+                aFieldName = aFieldName.copy(0,  10);
 
             if (!aFieldNames.insert(aFieldName).second)
             {   // doppelter Feldname, numerisch erweitern
@@ -612,8 +612,7 @@ void lcl_GetColumnTypes(
         }
         else
         {
-            aFieldName = 'N';
-            aFieldName += OUString::number(nCol+1);
+            aFieldName = "N" + OUString::number(nCol+1);
         }
 
         if ( !bTypeDefined )
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 5557f9b..a41d3c4 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -490,17 +490,17 @@ bool ScImportExport::ExportStream( SvStream& rStrm, const String& rBaseURL, sal_
 }
 
 
-void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const String& rString, bool bZero )
+void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const OUString& rString, bool bZero )
 {
     rtl_TextEncoding eEnc = rStrm.GetStreamCharSet();
     if ( eEnc == RTL_TEXTENCODING_UNICODE )
     {
         if ( !IsEndianSwap( rStrm ) )
-            rStrm.Write( rString.GetBuffer(), rString.Len() * sizeof(sal_Unicode) );
+            rStrm.Write( rString.getStr(), rString.getLength() * sizeof(sal_Unicode) );
         else
         {
-            const sal_Unicode* p = rString.GetBuffer();
-            const sal_Unicode* const pStop = p + rString.Len();
+            const sal_Unicode* p = rString.getStr();
+            const sal_Unicode* const pStop = p + rString.getLength();
             while ( p < pStop )
             {
                 rStrm << *p;
@@ -859,7 +859,7 @@ static void lcl_WriteString( SvStream& rStrm, String& rString, sal_Unicode cQuot
     ScImportExport::WriteUnicodeOrByteString( rStrm, rString );
 }
 
-static inline void lcl_WriteSimpleString( SvStream& rStrm, const String& rString )
+static inline void lcl_WriteSimpleString( SvStream& rStrm, const OUString& rString )
 {
     ScImportExport::WriteUnicodeOrByteString( rStrm, rString );
 }
@@ -1275,8 +1275,8 @@ bool ScImportExport::ExtText2Doc( SvStream& rStrm )
     SCTAB nTab = aRange.aStart.Tab();
 
     bool    bFixed              = pExtOptions->IsFixedLen();
-    const String& rSeps         = pExtOptions->GetFieldSeps();
-    const sal_Unicode* pSeps    = rSeps.GetBuffer();
+    const OUString& rSeps       = pExtOptions->GetFieldSeps();
+    const sal_Unicode* pSeps    = rSeps.getStr();
     bool    bMerge              = pExtOptions->IsMergeSeps();
     sal_uInt16  nInfoCount      = pExtOptions->GetInfoCount();
     const sal_Int32* pColStart  = pExtOptions->GetColStart();
@@ -1556,10 +1556,10 @@ namespace {
  * @param rStr string to inspect.
  * @param cSep separator character.
  */
-bool hasLineBreaksOrSeps( const String& rStr, sal_Unicode cSep )
+bool hasLineBreaksOrSeps( const OUString& rStr, sal_Unicode cSep )
 {
-    const sal_Unicode* p = rStr.GetBuffer();
-    for (xub_StrLen i = 0, n = rStr.Len(); i < n; ++i, ++p)
+    const sal_Unicode* p = rStr.getStr();
+    for (sal_Int32 i = 0, n = rStr.getLength(); i < n; ++i, ++p)
     {
         sal_Unicode c = *p;
         if (c == cSep)
@@ -1710,7 +1710,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
 
     while( bOk )
     {
-        String aLine;
+        OUString aLine;
         String aText;
         OString aByteLine;
         SCCOL nCol = nStartCol;
@@ -1725,7 +1725,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
             aLine = OStringToOUString(aByteLine, rStrm.GetStreamCharSet());
             if( rStrm.IsEof() )
                 break;
-            const sal_Unicode* p = aLine.GetBuffer();
+            const sal_Unicode* p = aLine.getStr();
             sal_Unicode cTag = *p++;
             if( cTag == 'C' )       // Content
             {
@@ -1787,7 +1787,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
                                 else
                                 {
                                     double fVal = rtl_math_uStringToDouble( p,
-                                            aLine.GetBuffer() + aLine.Len(),
+                                            aLine.getStr() + aLine.getLength(),
                                             cDecSep, cGrpSep, NULL, NULL );
                                     pDoc->SetValue( nCol, nRow, aRange.aStart.Tab(), fVal );
                                 }
@@ -1917,10 +1917,10 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
             }
             else if( cTag == 'I' && *p == 'D' )
             {
-                aLine.Erase( 0, 4 );
-                if (aLine.EqualsAscii( "CALCOOO32" ))
+                aLine = aLine.copy(4);
+                if (aLine == "CALCOOO32")
                     eVersion = SYLK_OOO32;
-                else if (aLine.EqualsAscii( "SCALC3" ))
+                else if (aLine == "SCALC3")
                     eVersion = SYLK_SCALC3;
                 bMyDoc = (eVersion <= SYLK_OWN);
             }
@@ -2291,14 +2291,14 @@ static inline const sal_Unicode* lcl_UnicodeStrChr( const sal_Unicode* pStr,
 }
 
 OUString ReadCsvLine( SvStream &rStream, bool bEmbeddedLineBreak,
-        const String& rFieldSeparators, sal_Unicode cFieldQuote )
+        const OUString& rFieldSeparators, sal_Unicode cFieldQuote )
 {
     OUString aStr;
     rStream.ReadUniOrByteStringLine(aStr, rStream.GetStreamCharSet(), nArbitraryLineLengthLimit);
 
     if (bEmbeddedLineBreak)
     {
-        const sal_Unicode* pSeps = rFieldSeparators.GetBuffer();
+        const sal_Unicode* pSeps = rFieldSeparators.getStr();
 
         QuoteType eQuoteState = FIELDEND_QUOTE;
         bool bFieldStart = true;
diff --git a/sc/source/ui/inc/crnrdlg.hxx b/sc/source/ui/inc/crnrdlg.hxx
index b7f522c..dd1077b 100644
--- a/sc/source/ui/inc/crnrdlg.hxx
+++ b/sc/source/ui/inc/crnrdlg.hxx
@@ -67,7 +67,7 @@ private:
     ScRangePairListRef  xColNameRanges;
     ScRangePairListRef  xRowNameRanges;
 
-    typedef ::boost::unordered_map< String, ScRange, ScStringHashCode, ::std::equal_to<String> > NameRangeMap;
+    typedef ::boost::unordered_map< OUString, ScRange, OUStringHash > NameRangeMap;
     NameRangeMap    aRangeMap;
     ScViewData*     pViewData;
     ScDocument*     pDoc;
diff --git a/sc/source/ui/inc/csvgrid.hxx b/sc/source/ui/inc/csvgrid.hxx
index 717fd42..2486ba3 100644
--- a/sc/source/ui/inc/csvgrid.hxx
+++ b/sc/source/ui/inc/csvgrid.hxx
@@ -269,7 +269,7 @@ public:
     /** Fills all cells of a line with the passed text (separators mode). */
     void                        ImplSetTextLineSep(
                                     sal_Int32 nLine, const OUString& rTextLine,
-                                    const String& rSepChars, sal_Unicode cTextSep, bool bMergeSep );
+                                    const OUString& rSepChars, sal_Unicode cTextSep, bool bMergeSep );
     /** Fills all cells of a line with the passed text (fixed width mode). */
     void                        ImplSetTextLineFix( sal_Int32 nLine, const OUString& rTextLine );
 
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index fef8300..8ef517b 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -108,7 +108,7 @@ public:
     static const sal_Unicode* ScanNextFieldFromString( const sal_Unicode* p,
             String& rField, sal_Unicode cStr, const sal_Unicode* pSeps,
             bool bMergeSeps, bool& rbIsQuoted, bool& rbOverflowCell );
-    static  void    WriteUnicodeOrByteString( SvStream& rStrm, const String& rString, bool bZero = false );
+    static  void    WriteUnicodeOrByteString( SvStream& rStrm, const OUString& rString, bool bZero = false );
     static  void    WriteUnicodeOrByteEndl( SvStream& rStrm );
     static  inline  bool    IsEndianSwap( const SvStream& rStrm );
 
@@ -234,7 +234,7 @@ public:
 
   */
 SC_DLLPUBLIC OUString ReadCsvLine( SvStream &rStream, bool bEmbeddedLineBreak,
-        const String& rFieldSeparators, sal_Unicode cFieldQuote );
+        const OUString& rFieldSeparators, sal_Unicode cFieldQuote );
 
 #endif
 
diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx
index 0f0ac6e..ec80c85 100644
--- a/sc/source/ui/inc/inputhdl.hxx
+++ b/sc/source/ui/inc/inputhdl.hxx
@@ -253,7 +253,7 @@ public:
     Size            GetTextSize();      // in 1/100mm
 
                     // actually private, public for SID_INPUT_SUM
-    void            InitRangeFinder( const String& rFormula );
+    void            InitRangeFinder(const OUString& rFormula);
 
     static void     SetAutoComplete(bool bSet)  { bAutoComplete = bSet; }
 };
diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx
index c02cb5c..6efd087 100644
--- a/sc/source/ui/inc/pvfundlg.hxx
+++ b/sc/source/ui/inc/pvfundlg.hxx
@@ -233,7 +233,7 @@ private:
     CancelButton        maBtnCancel;
     HelpButton          maBtnHelp;
 
-    typedef ::boost::unordered_map<String, long, ScStringHashCode> DimNameIndexMap;
+    typedef ::boost::unordered_map<OUString, long, OUStringHash> DimNameIndexMap;
     DimNameIndexMap     maNameIndexMap;
     ScDPObject&         mrDPObj;
 };
commit 5f4d8386a889b329eb19248dc0ee62198c3bf8ca
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 11:46:56 2013 +0100

    CID#705745 mem leak on early exit
    
    Change-Id: I12e3037ede0c07c0a2ff8e6f2f620b70ba11b1e0

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 0b9074f..ab5a623 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -20,6 +20,7 @@
 
 #include "hintids.hxx"
 
+#include <boost/scoped_ptr.hpp>
 #include <com/sun/star/i18n/ScriptType.hpp>
 #include <editeng/lspcitem.hxx>
 #include <txtflcnt.hxx>
@@ -1512,10 +1513,10 @@ xub_StrLen SwTxtFormatter::FormatLine( const xub_StrLen nStartPos )
     // fly positioning can make it necessary format a line several times
     // for this, we have to keep a copy of our rest portion
     SwLinePortion* pFld = GetInfo().GetRest();
-    SwFldPortion* pSaveFld = 0;
+    boost::scoped_ptr<SwFldPortion> xSaveFld;
 
     if ( pFld && pFld->InFldGrp() && !pFld->IsFtnPortion() )
-        pSaveFld = new SwFldPortion( *((SwFldPortion*)pFld) );
+        xSaveFld.reset(new SwFldPortion( *((SwFldPortion*)pFld) ));
 
     // for an optimal repaint rectangle, we want to compare fly portions
     // before and after the BuildPortions call
@@ -1614,8 +1615,8 @@ xub_StrLen SwTxtFormatter::FormatLine( const xub_StrLen nStartPos )
                 }
 
                 // set original rest portion
-                if ( pSaveFld )
-                    GetInfo().SetRest( new SwFldPortion( *pSaveFld ) );
+                if ( xSaveFld )
+                    GetInfo().SetRest( new SwFldPortion( *xSaveFld ) );
 
                 pCurr->SetLen( 0 );
                 pCurr->Width(0);
@@ -1660,7 +1661,7 @@ xub_StrLen SwTxtFormatter::FormatLine( const xub_StrLen nStartPos )
     GetInfo().GetParaPortion()->GetReformat()->LeftMove( GetInfo().GetIdx() );
 
     // delete master copy of rest portion
-    delete pSaveFld;
+    xSaveFld.reset();
 
     xub_StrLen nNewStart = nStartPos + pCurr->GetLen();
 
commit e17c91d1ff5c39b9b541b4d1bfb291c419fc76b5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 11:35:53 2013 +0100

    CID#705749 mem leak
    
    Change-Id: I8626e60d802b1c966667867d8c59ececff0a4255

diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 888d87c..5107e86 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1886,6 +1886,8 @@ void SwXText::Impl::ConvertCell(
 
         SwPaM aNewEndPaM(pCorrectedRange->aEnd, nEndLen);
         aEndCellPam = aNewEndPaM;
+
+        delete pCorrectedRange;
     }
 
     /** check the nodes between start and end
commit f65450ce21909ba4a697ccae28f5f000e6fa4eef
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 11:23:06 2013 +0100

    CID#705750 fix leak
    
    Change-Id: I9254b18e0acac6a730ee4150c295018b4d88948f

diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx
index 7d64f2a..f691549 100644
--- a/sw/source/filter/html/htmlbas.cxx
+++ b/sw/source/filter/html/htmlbas.cxx
@@ -322,7 +322,7 @@ void SwHTMLWriter::OutBasicBodyEvents()
     if( !pDocSh )
         return;
 
-    SvxMacroTableDtor *pDocTable = new SvxMacroTableDtor;
+    SvxMacroTableDtor aDocTable;
 
     uno::Reference< document::XEventsSupplier > xSup( pDocSh->GetModel(), uno::UNO_QUERY );
     uno::Reference < container::XNameReplace > xEvents = xSup->getEvents();
@@ -331,13 +331,13 @@ void SwHTMLWriter::OutBasicBodyEvents()
         SvxMacro* pMacro = SfxEventConfiguration::ConvertToMacro( xEvents->getByName( OUString::createFromAscii(aEventNames[i]) ), pDocSh, sal_True );
         if ( pMacro )
         {
-            pDocTable->Insert( aBodyEventTable[i].nEvent, *pMacro );
+            aDocTable.Insert( aBodyEventTable[i].nEvent, *pMacro );
             delete pMacro;
         }
     }
 
-    if( pDocTable && !pDocTable->empty() )
-        HTMLOutFuncs::Out_Events( Strm(), *pDocTable, aBodyEventTable,
+    if( !aDocTable.empty() )
+        HTMLOutFuncs::Out_Events( Strm(), aDocTable, aBodyEventTable,
                                   bCfgStarBasic, eDestEnc, &aNonConvertableCharacters );
 }
 
commit 6e132589cb9095530662f5d71f5d78dfc8962d5b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 11:17:11 2013 +0100

    CID#735395 potential memory leak
    
    Change-Id: Ica07e23920d751757ab5d14d5216615d5fcdbfd9

diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx
index 9f15e05..82c98e4 100644
--- a/starmath/inc/cursor.hxx
+++ b/starmath/inc/cursor.hxx
@@ -90,8 +90,7 @@ public:
 
     ~SmCursor(){
         SetClipboard();
-        if(pGraph)
-            delete pGraph;
+        delete pGraph;
         pGraph = NULL;
     }
 
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index 3e74c53..7d45223 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -318,7 +318,7 @@ class SmCaretPosGraphBuildingVisitor : public SmVisitor
 public:
     /** Builds a caret position graph for pRootNode */
     SmCaretPosGraphBuildingVisitor( SmNode* pRootNode );
-    virtual ~SmCaretPosGraphBuildingVisitor() {}
+    virtual ~SmCaretPosGraphBuildingVisitor();
     void Visit( SmTableNode* pNode );
     void Visit( SmBraceNode* pNode );
     void Visit( SmBracebodyNode* pNode );
@@ -346,8 +346,11 @@ public:
     void Visit( SmRootSymbolNode* pNode );
     void Visit( SmRectangleNode* pNode );
     void Visit( SmVerticalBraceNode* pNode );
-    SmCaretPosGraph* Graph( ){
-        return pGraph;
+    SmCaretPosGraph* takeGraph()
+    {
+        SmCaretPosGraph *pRet = pGraph;
+        pGraph = 0;
+        return pRet;
     }
 private:
     SmCaretPosGraphEntry* pRightMost;
diff --git a/starmath/source/caret.cxx b/starmath/source/caret.cxx
index 524ae9e..9f9e8f6 100644
--- a/starmath/source/caret.cxx
+++ b/starmath/source/caret.cxx
@@ -39,8 +39,7 @@ SmCaretPosGraphEntry* SmCaretPosGraph::Add(SmCaretPosGraphEntry entry){
 }
 
 SmCaretPosGraph::~SmCaretPosGraph(){
-    if(pNext)
-        delete pNext;
+    delete pNext;
     pNext = NULL;
 }
 
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index 81b1f59..e00ca81 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -120,10 +120,9 @@ void SmCursor::BuildGraph(){
         anchor = NULL;
         position = NULL;
     }
-    pGraph = NULL;
 
     //Build the new graph
-    pGraph = SmCaretPosGraphBuildingVisitor(pTree).Graph();
+    pGraph = SmCaretPosGraphBuildingVisitor(pTree).takeGraph();
 
     //Restore anchor and position pointers
     if(_anchor.IsValid() || _position.IsValid()){
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx
index 941739c..93ea409 100644
--- a/starmath/source/visitors.cxx
+++ b/starmath/source/visitors.cxx
@@ -990,6 +990,11 @@ SmCaretPosGraphBuildingVisitor::SmCaretPosGraphBuildingVisitor( SmNode* pRootNod
         pRootNode->Accept(this);
 }
 
+SmCaretPosGraphBuildingVisitor::~SmCaretPosGraphBuildingVisitor()
+{
+    delete pGraph;
+}
+
 void SmCaretPosGraphBuildingVisitor::Visit( SmLineNode* pNode ){
     SmNodeIterator it( pNode );
     while( it.Next( ) ){
commit 327701f66251dc56933727cf9a9febc79f4dc8c0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 10:40:53 2013 +0100

    CID#736482 fix leak
    
    Change-Id: I51c1e553339810f7de61c2c4a506482339829b31

diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index ce86a32..81b1f59 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -1194,8 +1194,10 @@ void SmCursor::Copy(){
     }
 
     //Set clipboard
-    if(pList->size() > 0)
+    if (pList->size() > 0)
         SetClipboard(pList);
+    else
+        delete pList;
 }
 
 void SmCursor::Paste() {
commit 9af3b8b4ff2e9e013b77a20775c151a2ec0e978f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 10:32:28 2013 +0100

    CID#705780 seeing as this is irredeemably wrong remove it
    
    This is catastrophically wrong, just appear to be lucky that
    this code path is never called, so remove it entirely rather
    than mess around fixing it
    
    Change-Id: I4a8a443ed20b7e11cd9cc69b3d66d28087f09db8

diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index b961caf..dd97078 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -1051,47 +1051,6 @@ Reference< XHierarchicalNameAccess > Databases::findJarFileForPath
     return xNA;
 }
 
-void Databases::popupDocument( URLParameter* urlPar,char **buffer,int *byteCount )
-{
-    const char* pop1 =
-        " <html>                                                                "
-        " <head>                                                                "
-        " <help:css-file-link xmlns:help=\"http://openoffice.org/2000/help\"/>  "
-        " </head>                                                               "
-        " <body>                                                                "
-        " <help:popup-cut Id=\"";
-    const sal_Int32 l1 = strlen( pop1 );
-
-    const char* pop3 = "\" Eid=\"";
-    const sal_Int32 l3 = strlen( pop3 );
-
-    const char* pop5 =
-        "\" xmlns:help=\"http://openoffice.org/2000/help\"></help:popup-cut>  "
-        " </body>                                                             "
-        " </html>";
-    const sal_Int32 l5 = strlen( pop5 );
-    sal_Int32 l2,l4;
-
-    OUString val = urlPar->get_id();
-    OString pop2O( val.getStr(),l2 = val.getLength(),RTL_TEXTENCODING_UTF8 );
-    const char* pop2 = pop2O.getStr();
-
-    val = urlPar->get_eid();
-    OString pop4O( val.getStr(),l4 = val.getLength(),RTL_TEXTENCODING_UTF8 );
-    const char* pop4 = pop4O.getStr();
-
-    (*byteCount) = l1 + l2 + l3 + l4 + l5;
-
-    *buffer = new char[ 1+*byteCount ];
-
-    memcpy( *buffer,pop1,l1 );
-    memcpy( *buffer+l1,pop2,l2 );
-    memcpy( *buffer+(l1+l2),pop3,l3 );
-    memcpy( *buffer+(l1+l2+l3),pop4,l4 );
-    memcpy( *buffer+(l1+l2+l3+l4),pop5,l5 );
-    (*buffer)[*byteCount] = 0;
-}
-
 void Databases::changeCSS(const OUString& newStyleSheet)
 {
     m_aCSS = newStyleSheet.toAsciiLowerCase();
diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx
index 46e04fd..56423cf 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.hxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.hxx
@@ -202,12 +202,6 @@ namespace chelp {
         //                                            // of XCollator
 
         /**
-         *  Returns a copy of the popupfile
-         */
-
-        void popupDocument( URLParameter* urlPar,char **buffer,int *byteCount );
-
-        /**
          *  Returns the cascading stlye sheet used to format the HTML-output.
          *  First try is language directory, second try is main installation directory.
          */
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index 8cc8cf8..6ea5304 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -794,13 +794,7 @@ helpRead(void * context, char * buffer, int len) {
 
 static int
 zipRead(void * context, char * buffer, int len) {
-    if( !ugblData->m_pInitial->get_eid().isEmpty() )
-    {
-        ugblData->m_pDatabases->popupDocument( ugblData->m_pInitial,&buffer,&len);
-        return len;
-    }
-    else
-        return helpRead(context, buffer, len);
+    return helpRead(context, buffer, len);
 }
 
 static int
commit 7f0acedf9b5a7544f88af426d7ed3cf0e58176dd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 3 09:30:46 2013 +0100

    CID#441342 potential resource leak
    
    Change-Id: Ia39e8c53427347088aa8d58ae1220950f191cd91

diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 0e428da..b0801e3 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -43,6 +43,7 @@
 #include <com/sun/star/packages/manifest/ManifestReader.hpp>
 #include <com/sun/star/ucb/InteractiveIOException.hpp>
 
+#include <boost/scoped_ptr.hpp>
 #include <rtl/digest.h>
 #include <tools/ref.hxx>
 #include <tools/debug.hxx>
@@ -2139,15 +2140,15 @@ sal_Int16 UCBStorage_Impl::Commit()
             {
                 UCBStorageElement_Impl* pElement = m_aChildrenList[ i ];
                 ::ucbhelper::Content* pContent = pElement->GetContent();
-                bool bDeleteContent = false;
+                boost::scoped_ptr< ::ucbhelper::Content > xDeleteContent;

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list