[Libreoffice-commits] core.git: sw/source

Thomas Arnhold thomas at arnhold.org
Tue Sep 10 10:09:13 PDT 2013


 sw/source/core/text/itratr.cxx           |   24 ++++++-------
 sw/source/core/text/porfld.cxx           |    8 ++--
 sw/source/core/text/porlay.cxx           |   26 +++++++-------
 sw/source/core/text/txtdrop.cxx          |    2 -
 sw/source/core/text/txtfld.cxx           |   56 +++++++++++++------------------
 sw/source/core/txtnode/atrfld.cxx        |    4 +-
 sw/source/core/txtnode/ndtxt.cxx         |   13 +++----
 sw/source/ui/sidebar/PageSizeControl.cxx |   30 +++++++---------
 8 files changed, 76 insertions(+), 87 deletions(-)

New commits:
commit 114efed42daa7de5e7d650cb713ba91c0c3117bd
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Mon Sep 9 15:15:00 2013 +0200

    String to OUString
    
    Change-Id: If859505c52b7166e9e586008b40a6aff3a2ccf3c
    Reviewed-on: https://gerrit.libreoffice.org/5893
    Reviewed-by: Andrzej J.R. Hunt <andrzej at ahunt.org>
    Tested-by: Andrzej J.R. Hunt <andrzej at ahunt.org>

diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 347c196..74bf883 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -374,7 +374,7 @@ public:
     void NewWord() { nWordAdd = nWordWidth = 0; }
 };
 
-static sal_Bool lcl_MinMaxString( SwMinMaxArgs& rArg, SwFont* pFnt, const XubString &rTxt,
+static sal_Bool lcl_MinMaxString( SwMinMaxArgs& rArg, SwFont* pFnt, const OUString &rTxt,
     xub_StrLen nIdx, xub_StrLen nEnd )
 {
     sal_Bool bRet = sal_False;
@@ -385,7 +385,7 @@ static sal_Bool lcl_MinMaxString( SwMinMaxArgs& rArg, SwFont* pFnt, const XubStr
         LanguageType eLang = pFnt->GetLanguage();
         if( g_pBreakIt->GetBreakIter().is() )
         {
-            bClear = CH_BLANK == rTxt.GetChar( nStop );
+            bClear = CH_BLANK == rTxt[ nStop ];
             Boundary aBndry( g_pBreakIt->GetBreakIter()->getWordBoundary( rTxt, nIdx,
                              g_pBreakIt->GetLocale( eLang ),
                              WordType::DICTIONARY_WORD, sal_True ) );
@@ -399,13 +399,13 @@ static sal_Bool lcl_MinMaxString( SwMinMaxArgs& rArg, SwFont* pFnt, const XubStr
         }
         else
         {
-            while( nStop < nEnd && CH_BLANK != rTxt.GetChar( nStop ) )
+            while( nStop < nEnd && CH_BLANK != rTxt[ nStop ] )
                 ++nStop;
             bClear = nStop == nIdx;
             if ( bClear )
             {
                 rArg.NewWord();
-                while( nStop < nEnd && CH_BLANK == rTxt.GetChar( nStop ) )
+                while( nStop < nEnd && CH_BLANK == rTxt[ nStop ] )
                     ++nStop;
             }
         }
@@ -762,18 +762,18 @@ void SwTxtNode::GetMinMaxSize( sal_uLong nIndex, sal_uLong& rMin, sal_uLong &rMa
                     }
                     case RES_TXTATR_FTN :
                     {
-                        const XubString aTxt = pHint->GetFtn().GetNumStr();
+                        const OUString aTxt = pHint->GetFtn().GetNumStr();
                         if( lcl_MinMaxString( aArg, aIter.GetFnt(), aTxt, 0,
-                            aTxt.Len() ) )
+                            aTxt.getLength() ) )
                             nAdd = 20;
                         break;
                     }
                     case RES_TXTATR_FIELD :
                     {
                         SwField *pFld = (SwField*)pHint->GetFld().GetFld();
-                        const String aTxt = pFld->ExpandField(true);
+                        const OUString aTxt = pFld->ExpandField(true);
                         if( lcl_MinMaxString( aArg, aIter.GetFnt(), aTxt, 0,
-                            aTxt.Len() ) )
+                            aTxt.getLength() ) )
                             nAdd = 20;
                         break;
                     }
@@ -965,8 +965,8 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd
             {
                 case RES_TXTATR_FTN :
                 {
-                    const XubString aTxt = pHint->GetFtn().GetNumStr();
-                    SwDrawTextInfo aDrawInf( pSh, *pOut, 0, aTxt, 0, aTxt.Len() );
+                    const OUString aTxt = pHint->GetFtn().GetNumStr();
+                    SwDrawTextInfo aDrawInf( pSh, *pOut, 0, aTxt, 0, aTxt.getLength() );
 
                     nProWidth += aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width();
                     break;
@@ -974,8 +974,8 @@ sal_uInt16 SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd
                 case RES_TXTATR_FIELD :
                 {
                     SwField *pFld = (SwField*)pHint->GetFld().GetFld();
-                    String const aTxt = pFld->ExpandField(true);
-                    SwDrawTextInfo aDrawInf( pSh, *pOut, 0, aTxt, 0, aTxt.Len() );
+                    OUString const aTxt = pFld->ExpandField(true);
+                    SwDrawTextInfo aDrawInf( pSh, *pOut, 0, aTxt, 0, aTxt.getLength() );
 
                     nProWidth += aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width();
                     break;
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index c6e49c6..ac70559 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -374,12 +374,12 @@ sal_Bool SwFldPortion::Format( SwTxtFormatInfo &rInf )
             if ( IsQuoVadisPortion() )
                 nNextOfst = nNextOfst + ((SwQuoVadisPortion*)this)->GetContTxt().getLength();
 
-            XubString aNew( aExpand, nNextOfst, STRING_LEN );
+            OUString aNew( aExpand.copy( nNextOfst ) );
             aExpand = aExpand.copy( 0, nNextOfst );
 
             // These characters should not be contained in the follow
             // field portion. They are handled via the HookChar mechanism.
-            switch( aNew.GetChar( 0 ))
+            switch( aNew[0] )
             {
                 case CH_BREAK  : bFull = sal_True;
                             // kein break;
@@ -399,7 +399,7 @@ sal_Bool SwFldPortion::Format( SwTxtFormatInfo &rInf )
                 case CH_TXTATR_BREAKWORD:
                 case CH_TXTATR_INWORD:
                 {
-                    aNew.Erase( 0, 1 );
+                    aNew = aNew.copy( 1 );
                     ++nNextOfst;
                     break;
                 }
@@ -410,7 +410,7 @@ sal_Bool SwFldPortion::Format( SwTxtFormatInfo &rInf )
             // we have to build a follow field portion (without font),
             // otherwise the HookChar mechanism would not work.
             SwFldPortion *pFld = Clone( aNew );
-            if( aNew.Len() && !pFld->GetFont() )
+            if( !aNew.isEmpty() && !pFld->GetFont() )
             {
                 SwFont *pNewFnt = new SwFont( *rInf.GetFont() );
                 pFld->SetFont( pNewFnt );
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index e676d1a..2d04234 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -118,11 +118,11 @@ static bool lcl_ConnectToPrev( sal_Unicode cCh, sal_Unicode cPrevCh )
 /*************************************************************************
  * lcl_HasStrongLTR
  *************************************************************************/
-static  bool lcl_HasStrongLTR ( const String& rTxt, xub_StrLen nStart, xub_StrLen nEnd )
+static  bool lcl_HasStrongLTR ( const OUString& rTxt, xub_StrLen nStart, xub_StrLen nEnd )
  {
      for ( xub_StrLen nCharIdx = nStart; nCharIdx < nEnd; ++nCharIdx )
      {
-         const UCharDirection nCharDir = u_charDirection ( rTxt.GetChar ( nCharIdx ));
+         const UCharDirection nCharDir = u_charDirection ( rTxt[ nCharIdx ] );
          if ( nCharDir == U_LEFT_TO_RIGHT ||
               nCharDir == U_LEFT_TO_RIGHT_EMBEDDING ||
               nCharDir == U_LEFT_TO_RIGHT_OVERRIDE )
@@ -264,12 +264,12 @@ void SwLineLayout::CreateSpaceAdd( const long nInit )
  * in [nStt, nEnd[
  *************************************************************************/
 
-static bool lcl_HasOnlyBlanks( const XubString& rTxt, xub_StrLen nStt, xub_StrLen nEnd )
+static bool lcl_HasOnlyBlanks( const OUString& rTxt, xub_StrLen nStt, xub_StrLen nEnd )
 {
     bool bBlankOnly = true;
     while ( nStt < nEnd )
     {
-        const sal_Unicode cChar = rTxt.GetChar( nStt++ );
+        const sal_Unicode cChar = rTxt[ nStt++ ];
         if ( ' ' != cChar && 0x3000 != cChar )
         {
             bBlankOnly = false;
@@ -996,25 +996,25 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
             // the search has to be performed on a per word base
             while ( aScanner.NextWord() )
             {
-                const XubString& rWord = aScanner.GetWord();
+                const OUString& rWord = aScanner.GetWord();
 
-                xub_StrLen nIdx = 0;
-                xub_StrLen nKashidaPos = STRING_LEN;
+                sal_Int32 nIdx = 0;
+                sal_Int32 nKashidaPos = -1;
                 sal_Unicode cCh;
                 sal_Unicode cPrevCh = 0;
 
                 sal_uInt16 nPriorityLevel = 7; // 0..6 = level found
                                            // 7 not found
 
-                xub_StrLen nWordLen = rWord.Len();
+                sal_Int32 nWordLen = rWord.getLength();
 
                 // ignore trailing vowel chars
-                while( nWordLen && isTransparentChar( rWord.GetChar( nWordLen - 1 )))
+                while( nWordLen && isTransparentChar( rWord[ nWordLen - 1 ] ))
                     --nWordLen;
 
                 while (nIdx < nWordLen)
                 {
-                    cCh = rWord.GetChar( nIdx );
+                    cCh = rWord[ nIdx ];
 
                     // 1. Priority:
                     // after user inserted kashida
@@ -1029,7 +1029,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
                     if (nPriorityLevel >= 1 && nIdx < nWordLen - 1)
                     {
                         if( isSeenOrSadChar( cCh )
-                         && (rWord.GetChar( nIdx+1 ) != 0x200C) ) // #i98410#: prevent ZWNJ expansion
+                         && (rWord[ nIdx+1 ] != 0x200C) ) // #i98410#: prevent ZWNJ expansion
                         {
                             nKashidaPos  = aScanner.GetBegin() + nIdx;
                             nPriorityLevel = 1;
@@ -1082,7 +1082,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
                         if ( isBaaChar ( cCh )) // Bah
                         {
                             // check if next character is Reh, Yeh or Alef Maksura
-                            sal_Unicode cNextCh = rWord.GetChar( nIdx + 1 );
+                            sal_Unicode cNextCh = rWord[ nIdx + 1 ];
                             if ( isRehChar ( cNextCh ) || isYehChar ( cNextCh ))
                            {
                                 SAL_WARN_IF( 0 == cPrevCh, "sw.core", "No previous character" );
@@ -1146,7 +1146,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, sal_Bool bRTL )
                    ++nIdx;
                 } // end of current word
 
-                if ( STRING_LEN != nKashidaPos )
+                if ( -1 != nKashidaPos )
                 {
                     aKashida.insert( aKashida.begin() + nCntKash, nKashidaPos);
                     nCntKash++;
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 7bc63b0..63f2ac4 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -720,7 +720,7 @@ void SwTxtPainter::PaintDropPortion()
 class SwDropCapCache
 {
     long aMagicNo[ DROP_CACHE_SIZE ];
-    XubString aTxt[ DROP_CACHE_SIZE ];
+    OUString aTxt[ DROP_CACHE_SIZE ];
     sal_uInt16 aFactor[ DROP_CACHE_SIZE ];
     KSHORT aWishedHeight[ DROP_CACHE_SIZE ];
     short aDescent[ DROP_CACHE_SIZE ];
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 4f65c69..f830594 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -106,24 +106,18 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
         case RES_COMBINED_CHARS:
             {
                 if( bName )
-                {
-                    String const sName( pFld->GetFieldName() );
-                    pRet = new SwFldPortion(sName);
-                }
+                    pRet = new SwFldPortion( pFld->GetFieldName() );
                 else
-                {
-                    String const sContent( pFld->ExpandField(bInClipboard) );
-                    pRet = new SwCombinedPortion(sContent);
-                }
+                    pRet = new SwCombinedPortion( pFld->ExpandField(bInClipboard) );
             }
             break;
 
         case RES_HIDDENTXTFLD:
             {
-                String const str( (bName)
+                OUString const aStr( (bName)
                         ? pFld->GetFieldName()
                         : pFld->ExpandField(bInClipboard) );
-                pRet = new SwHiddenPortion(str);
+                pRet = new SwHiddenPortion(aStr);
             }
             break;
 
@@ -134,10 +128,10 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
                                         &((SwTxtFld*)pHint)->GetTxtNode() );
             }
             {
-                String const str( (bName)
+                OUString const aStr( (bName)
                         ? pFld->GetFieldName()
                         : pFld->ExpandField(bInClipboard) );
-                pRet = new SwFldPortion( str );
+                pRet = new SwFldPortion( aStr );
             }
             break;
 
@@ -147,10 +141,10 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
                 ((SwDocStatField*)pFld)->ChangeExpansion( pFrame );
             }
             {
-                String const str( (bName)
+                OUString const aStr( (bName)
                         ? pFld->GetFieldName()
                         : pFld->ExpandField(bInClipboard) );
-                pRet = new SwFldPortion( str );
+                pRet = new SwFldPortion( aStr );
             }
             break;
 
@@ -174,10 +168,10 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
                                             bVirt, nNumFmt > -1 ? &nNumFmt : 0);
             }
             {
-                String const str( (bName)
+                OUString const aStr( (bName)
                         ? pFld->GetFieldName()
                         : pFld->ExpandField(bInClipboard) );
-                pRet = new SwFldPortion( str );
+                pRet = new SwFldPortion( aStr );
             }
             break;
         }
@@ -199,10 +193,10 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
                 }
             }
             {
-                String const str( (bName)
+                OUString const aStr( (bName)
                         ? pFld->GetFieldName()
                         : pFld->ExpandField(bInClipboard) );
-                pRet = new SwFldPortion( str );
+                pRet = new SwFldPortion( aStr );
             }
             break;
         }
@@ -214,10 +208,10 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
                 pDBFld->ChgBodyTxtFlag( ::lcl_IsInBody( pFrame ) );
             }
             {
-                String const str( (bName)
+                OUString const aStr( (bName)
                         ? pFld->GetFieldName()
                         : pFld->ExpandField(bInClipboard) );
-                pRet = new SwFldPortion(str);
+                pRet = new SwFldPortion(aStr);
             }
             break;
         }
@@ -227,10 +221,10 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
                 ((SwRefPageGetField*)pFld)->ChangeExpansion( pFrame, (SwTxtFld*)pHint );
             }
             {
-                String const str( (bName)
+                OUString const aStr( (bName)
                         ? pFld->GetFieldName()
                         : pFld->ExpandField(bInClipboard) );
-                pRet = new SwFldPortion(str);
+                pRet = new SwFldPortion(aStr);
             }
             break;
 
@@ -243,10 +237,10 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
 
         default:
             {
-                String const str( (bName)
+                OUString const aStr( (bName)
                         ? pFld->GetFieldName()
                         : pFld->ExpandField(bInClipboard) );
-                pRet = new SwFldPortion(str);
+                pRet = new SwFldPortion(aStr);
             }
     }
 
@@ -259,10 +253,10 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
             pTmpFnt->SetDiffFnt( &pChFmt->GetAttrSet(), pFrm->GetTxtNode()->getIDocumentSettingAccess() );
         }
         {
-            String const str( (bName)
+            OUString const aStr( (bName)
                     ? pFld->GetFieldName()
                     : pFld->ExpandField(bInClipboard) );
-            pRet = new SwFldPortion(str, pTmpFnt, bPlaceHolder);
+            pRet = new SwFldPortion(aStr, pTmpFnt, bPlaceHolder);
         }
     }
 
@@ -376,7 +370,7 @@ SwLinePortion *SwTxtFormatter::NewExtraPortion( SwTxtFormatInfo &rInf )
     }
     if( !pRet )
     {
-        const XubString aNothing;
+        const OUString aNothing;
         pRet = new SwFldPortion( aNothing );
         rInf.SetLen( 1 );
     }
@@ -491,10 +485,10 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
             }
             else
             {
-                XubString aTxt( pTxtNd->GetNumString() );
-                if ( aTxt.Len() > 0 )
+                OUString aTxt( pTxtNd->GetNumString() );
+                if ( !aTxt.isEmpty() )
                 {
-                    aTxt.Insert( pTxtNd->GetLabelFollowedBy() );
+                    aTxt += pTxtNd->GetLabelFollowedBy();
                 }
 
                 // 7974: Nicht nur eine Optimierung...
@@ -502,7 +496,7 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
                 // erhalten. Die nachfolgende Textportion wird im BreakLine
                 // in das BreakCut laufen, obwohl rInf.GetLast()->GetFlyPortion()
                 // vorliegt!
-                if( aTxt.Len() )
+                if( !aTxt.isEmpty() )
                 {
                     //
                     // Build a new numbering font basing on the current paragraph font:
diff --git a/sw/source/core/txtnode/atrfld.cxx b/sw/source/core/txtnode/atrfld.cxx
index e6734e4..51c43ba 100644
--- a/sw/source/core/txtnode/atrfld.cxx
+++ b/sw/source/core/txtnode/atrfld.cxx
@@ -164,7 +164,7 @@ void SwFmtFld::SwClientNotify( const SwModify&, const SfxHint& rHint )
         pPaM->GetPoint()->nNode = rTxtNode;
         pPaM->GetPoint()->nContent.Assign( (SwTxtNode*)&rTxtNode, *pTxtAttr->GetStart() );
 
-        String const aEntry( GetFld()->ExpandField( pDoc->IsClipBoard() ) );
+        OUString const aEntry( GetFld()->ExpandField( pDoc->IsClipBoard() ) );
         pPaM->SetMark();
         pPaM->Move( fnMoveForward );
         pDoc->DeleteRange( *pPaM );
@@ -310,7 +310,7 @@ void SwTxtFld::Expand() const
     OSL_ENSURE( m_pTxtNode, "SwTxtFld: where is my TxtNode?" );
 
     const SwField* pFld = GetFld().GetFld();
-    XubString aNewExpand(
+    OUString aNewExpand(
         pFld->ExpandField(m_pTxtNode->GetDoc()->IsClipBoard()) );
 
     if( aNewExpand == m_aExpand )
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index f22047e..750a649 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2978,8 +2978,7 @@ OUString SwTxtNode::GetExpandTxt(  const xub_StrLen nIdx,
     Replace0xFF(*this, aTxt, nTxtStt, aTxt.getLength(), true);
     if( bWithNum )
     {
-        XubString aListLabelStr = GetNumString();
-        if ( aListLabelStr.Len() > 0 )
+        if ( !GetNumString().isEmpty() )
         {
             if ( bAddSpaceAfterListLabelStr )
             {
@@ -3090,7 +3089,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
                         if ( bWithFtn )
                         {
                             const SwFmtFtn& rFtn = pHt->GetFtn();
-                            XubString sExpand;
+                            OUString sExpand;
                             if( !rFtn.GetNumStr().isEmpty() )
                                 sExpand = rFtn.GetNumStr();
                             else if( rFtn.IsEndNote() )
@@ -3099,7 +3098,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
                             else
                                 sExpand = GetDoc()->GetFtnInfo().aFmt.
                                                 GetNumStr( rFtn.GetNumber() );
-                            if( sExpand.Len() )
+                            if( !sExpand.isEmpty() )
                             {
                                 ++aDestIdx;     // insert behind
                                 SvxEscapementItem aItem(
@@ -3110,7 +3109,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
                                 OUString const ins( rDestNd.InsertText(sExpand,
                                   aDestIdx,
                                   IDocumentContentOperations::INS_EMPTYEXPAND));
-                                SAL_INFO_IF(ins.getLength() != sExpand.Len(),
+                                SAL_INFO_IF(ins.getLength() != sExpand.getLength(),
                                         "sw.core", "GetExpandTxt lossage");
                                 aDestIdx = nInsPos + nAttrStartIdx;
                                 nInsPos = nInsPos + ins.getLength();
@@ -3439,9 +3438,9 @@ void SwTxtNode::ReplaceText( const SwIndex& rStart, const xub_StrLen nDelLen,
         m_Text = m_Text.replaceAt(rStart.GetIndex(), nLen - 1, "");
         Update( rStart, nLen - 1, true );
 
-        XubString aTmpTxt(sInserted); aTmpTxt.Erase( 0, 1 );
+        OUString aTmpTxt( sInserted.copy(1) );
         m_Text = m_Text.replaceAt(rStart.GetIndex(), 0, aTmpTxt);
-        Update( rStart, aTmpTxt.Len(), false );
+        Update( rStart, aTmpTxt.getLength(), false );
     }
     else
     {
diff --git a/sw/source/ui/sidebar/PageSizeControl.cxx b/sw/source/ui/sidebar/PageSizeControl.cxx
index ca77f91..09a4793 100644
--- a/sw/source/ui/sidebar/PageSizeControl.cxx
+++ b/sw/source/ui/sidebar/PageSizeControl.cxx
@@ -64,19 +64,19 @@ PageSizeControl::PageSizeControl(
 
     sal_uInt16 nSelectedItem = 0;
     {
-        XubString aMetricStr;
+        OUString aMetricStr;
         {
-            const XubString aText = maWidthHeightField.GetText();
-            for (short i = aText.Len() - 1; i >= 0; i--)
+            const OUString aText = maWidthHeightField.GetText();
+            for (short i = aText.getLength() - 1; i >= 0; i--)
             {
-                sal_Unicode c = aText.GetChar(i);
+                sal_Unicode c = aText[i];
                 if ( INetMIME::isAlpha(c) || (c == '\'') || (c == '\"') || (c == '%') )
                 {
-                    aMetricStr.Insert(c, 0);
+                    aMetricStr = OUString(c) + aMetricStr;
                 }
                 else
                 {
-                    if (aMetricStr.Len())
+                    if (!aMetricStr.isEmpty())
                     {
                         break;
                     }
@@ -85,9 +85,9 @@ PageSizeControl::PageSizeControl(
         }
 
         const LocaleDataWrapper& localeDataWrapper = maWidthHeightField.GetLocaleDataWrapper();
-        String WidthStr;
-        String HeightStr;
-        String ItemText2;
+        OUString aWidthStr;
+        OUString aHeightStr;
+        OUString aItemText2;
         for ( ::std::vector< Paper >::size_type nPaperIdx = 0;
               nPaperIdx < maPaperList.size();
               ++nPaperIdx )
@@ -98,28 +98,24 @@ PageSizeControl::PageSizeControl(
                 Swap( aPaperSize );
             }
             maWidthHeightField.SetValue( maWidthHeightField.Normalize( aPaperSize.Width() ), FUNIT_TWIP );
-            WidthStr = localeDataWrapper.getNum(
+            aWidthStr = localeDataWrapper.getNum(
                 maWidthHeightField.GetValue(),
                 maWidthHeightField.GetDecimalDigits(),
                 maWidthHeightField.IsUseThousandSep(),
                 maWidthHeightField.IsShowTrailingZeros() );
 
             maWidthHeightField.SetValue( maWidthHeightField.Normalize( aPaperSize.Height() ), FUNIT_TWIP);
-            HeightStr = localeDataWrapper.getNum(
+            aHeightStr = localeDataWrapper.getNum(
                 maWidthHeightField.GetValue(),
                 maWidthHeightField.GetDecimalDigits(),
                 maWidthHeightField.IsUseThousandSep(),
                 maWidthHeightField.IsShowTrailingZeros() );
 
-            ItemText2 = WidthStr;
-            ItemText2 += OUString(" x ");
-            ItemText2 += HeightStr;
-            ItemText2 += OUString(" ");
-            ItemText2 += aMetricStr;
+            aItemText2 = aWidthStr + " x " + aHeightStr + " " + aMetricStr;
 
             mpSizeValueSet->AddItem(
                 SvxPaperInfo::GetName( maPaperList[ nPaperIdx ] ),
-                ItemText2,
+                aItemText2,
                 0 );
 
             if ( maPaperList[ nPaperIdx ] == mePaper )


More information about the Libreoffice-commits mailing list