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

Matteo Casalin matteo.casalin at yahoo.com
Wed Aug 14 14:22:19 PDT 2013


 sw/inc/doc.hxx                               |    2 -
 sw/inc/fmtftn.hxx                            |   31 ++++++++-------
 sw/inc/txtftn.hxx                            |    4 +-
 sw/source/core/doc/docdesc.cxx               |    2 -
 sw/source/core/doc/docftn.cxx                |   12 +++---
 sw/source/core/doc/ftnidx.cxx                |   31 ++++++++-------
 sw/source/core/layout/ftnfrm.cxx             |    6 ++-
 sw/source/core/txtnode/atrftn.cxx            |   53 ++++++++++++---------------
 sw/source/core/txtnode/ndtxt.cxx             |    4 +-
 sw/source/filter/ascii/ascatr.cxx            |    2 -
 sw/source/filter/html/htmlftn.cxx            |    4 +-
 sw/source/filter/ww8/docxattributeoutput.cxx |    2 -
 sw/source/filter/ww8/rtfattributeoutput.cxx  |    2 -
 sw/source/filter/ww8/wrtw8sty.cxx            |    2 -
 sw/source/filter/ww8/ww8atr.cxx              |    4 +-
 sw/source/filter/ww8/ww8par2.cxx             |    2 -
 sw/source/ui/docvw/edtwin2.cxx               |    4 +-
 sw/source/ui/misc/insfnote.cxx               |    2 -
 18 files changed, 88 insertions(+), 81 deletions(-)

New commits:
commit cafcf33915fe30af693a94f4224fedd5cb9f9a55
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Wed Aug 14 09:40:53 2013 +0200

    String to OUString + prefix names of data members
    
    Change-Id: Ic0cd2bdfde8c6ba915e89a346bcccd6fef1ca267
    Reviewed-on: https://gerrit.libreoffice.org/5404
    Reviewed-by: Tor Lillqvist <tml at iki.fi>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 3e23690..aa69928 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -1099,7 +1099,7 @@ public:
           SwFtnIdxs& GetFtnIdxs()       { return *mpFtnIdxs; }
     const SwFtnIdxs& GetFtnIdxs() const { return *mpFtnIdxs; }
     /// change footnotes in area
-    bool SetCurFtn( const SwPaM& rPam, const String& rNumStr,
+    bool SetCurFtn( const SwPaM& rPam, const OUString& rNumStr,
                     sal_uInt16 nNumber, bool bIsEndNote );
 
     /** Operations on the content of the document e.g.
diff --git a/sw/inc/fmtftn.hxx b/sw/inc/fmtftn.hxx
index f6af20e..a1d3109 100644
--- a/sw/inc/fmtftn.hxx
+++ b/sw/inc/fmtftn.hxx
@@ -19,7 +19,7 @@
 #ifndef _FMTFTN_HXX
 #define _FMTFTN_HXX
 
-#include <tools/string.hxx>
+#include <rtl/ustring.hxx>
 #include <svl/poolitem.hxx>
 #include "swdllapi.h"
 
@@ -31,9 +31,9 @@ class SwTxtFtn;
 class SW_DLLPUBLIC SwFmtFtn: public SfxPoolItem
 {
     friend class SwTxtFtn;
-    SwTxtFtn* pTxtAttr;     ///< My TextAttribute.
-    String  aNumber;        ///< User-defined 'Number'.
-    sal_uInt16  nNumber;    ///< Automatische Nummerierung
+    SwTxtFtn* m_pTxtAttr;   ///< My TextAttribute.
+    OUString m_aNumber;     ///< User-defined 'Number'.
+    sal_uInt16 m_nNumber;   ///< Automatische Nummerierung
     bool    m_bEndNote;     ///< Is it an End note?
 
     /// Protected CopyCtor.
@@ -48,24 +48,27 @@ public:
     virtual int             operator==( const SfxPoolItem& ) const;
     virtual SfxPoolItem*    Clone( SfxItemPool* pPool = 0 ) const;
 
-    const String &GetNumStr() const { return aNumber; }
-    const sal_uInt16 &GetNumber() const { return nNumber; }
-          bool    IsEndNote() const { return m_bEndNote;}
+    OUString   GetNumStr() const { return m_aNumber; }
+    sal_uInt16 GetNumber() const { return m_nNumber; }
+    bool       IsEndNote() const { return m_bEndNote;}
 
-    void SetNumStr( const String& rStr )    { aNumber = rStr; }
-    void SetNumber( sal_uInt16 nNo )            { nNumber = nNo; }
+    void SetNumStr( const OUString& rStr ) { m_aNumber = rStr; }
+    void SetNumber( sal_uInt16 nNo )       { m_nNumber = nNo; }
     void SetEndNote( bool b );
 
     void SetNumber( const SwFmtFtn& rFtn )
-        { nNumber = rFtn.nNumber; aNumber = rFtn.aNumber; }
+    {
+        m_nNumber = rFtn.m_nNumber;
+        m_aNumber = rFtn.m_aNumber;
+    }
 
-    const SwTxtFtn *GetTxtFtn() const   { return pTxtAttr; }
-          SwTxtFtn *GetTxtFtn()         { return pTxtAttr; }
+    const SwTxtFtn *GetTxtFtn() const   { return m_pTxtAttr; }
+          SwTxtFtn *GetTxtFtn()         { return m_pTxtAttr; }
 
-    void GetFtnText( String& rStr ) const;
+    void GetFtnText( OUString& rStr ) const;
 
     /// Returns string to be displayed of footnote / endnote.
-    String GetViewNumStr( const SwDoc& rDoc, sal_Bool bInclStrs = sal_False ) const;
+    OUString GetViewNumStr( const SwDoc& rDoc, sal_Bool bInclStrs = sal_False ) const;
 };
 
 
diff --git a/sw/inc/txtftn.hxx b/sw/inc/txtftn.hxx
index 63a097b..9dc60a2 100644
--- a/sw/inc/txtftn.hxx
+++ b/sw/inc/txtftn.hxx
@@ -20,13 +20,13 @@
 #define _TXTFTN_HXX
 
 #include <txatbase.hxx>
-#include <tools/string.hxx>
 
 class SwNodeIndex;
 class SwTxtNode;
 class SwNodes;
 class SwDoc;
 class SwFrm;
+class OUString;
 
 // ATT_FTN **********************************************************
 
@@ -42,7 +42,7 @@ public:
 
     inline SwNodeIndex *GetStartNode() const { return m_pStartNode; }
     void SetStartNode( const SwNodeIndex *pNode, sal_Bool bDelNodes = sal_True );
-    void SetNumber( const sal_uInt16 nNumber, const String* = 0 );
+    void SetNumber( const sal_uInt16 nNumber, const OUString &sNumStr );
     void CopyFtn(SwTxtFtn & rDest, SwTxtNode & rDestNode) const;
 
     // Get and set TxtNode pointer.
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 6d2cfdc..e1a0e25 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -321,7 +321,7 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
         {
             SwTxtFtn *pTxtFtn = rFtnIdxs[ nPos ];
             const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
-            pTxtFtn->SetNumber( rFtn.GetNumber(), &rFtn.GetNumStr());
+            pTxtFtn->SetNumber(rFtn.GetNumber(), rFtn.GetNumStr());
         }
     }
 
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index e539302..d50ff9c 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -201,7 +201,7 @@ void SwEndNoteInfo::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
             const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
             if ( rFtn.IsEndNote() == m_bEndNote )
             {
-                pTxtFtn->SetNumber( rFtn.GetNumber(), &rFtn.GetNumStr());
+                pTxtFtn->SetNumber(rFtn.GetNumber(), rFtn.GetNumStr());
             }
         }
     }
@@ -302,7 +302,7 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
                         SwTxtFtn *pTxtFtn = rFtnIdxs[ nPos ];
                         const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
                         if ( !rFtn.IsEndNote() )
-                            pTxtFtn->SetNumber( rFtn.GetNumber(), &rFtn.GetNumStr());
+                            pTxtFtn->SetNumber(rFtn.GetNumber(), rFtn.GetNumStr());
                     }
                 }
             }
@@ -372,7 +372,7 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
                     SwTxtFtn *pTxtFtn = rFtnIdxs[ nPos ];
                     const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
                     if ( rFtn.IsEndNote() )
-                        pTxtFtn->SetNumber( rFtn.GetNumber(), &rFtn.GetNumStr());
+                        pTxtFtn->SetNumber(rFtn.GetNumber(), rFtn.GetNumStr());
                 }
             }
         }   //swmod 080219
@@ -394,7 +394,7 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
     }
 }
 
-bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
+bool SwDoc::SetCurFtn( const SwPaM& rPam, const OUString& rNumStr,
                        sal_uInt16 nNumber, bool bIsEndNote )
 {
     SwFtnIdxs& rFtnArr = GetFtnIdxs();
@@ -438,7 +438,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
                     pUndo->GetHistory().Add( *pTxtFtn );
                 }
 
-                pTxtFtn->SetNumber( nNumber, &rNumStr );
+                pTxtFtn->SetNumber( nNumber, rNumStr );
                 if( rFtn.IsEndNote() != bIsEndNote )
                 {
                     ((SwFmtFtn&)rFtn).SetEndNote( bIsEndNote );
@@ -469,7 +469,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
                     pUndo->GetHistory().Add( *pTxtFtn );
                 }
 
-                pTxtFtn->SetNumber( nNumber, &rNumStr );
+                pTxtFtn->SetNumber( nNumber, rNumStr );
                 if( rFtn.IsEndNote() != bIsEndNote )
                 {
                     ((SwFmtFtn&)rFtn).SetEndNote( bIsEndNote );
diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx
index 6836313..721021c 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -100,10 +100,11 @@ void SwFtnIdxs::UpdateFtn( const SwNodeIndex& rStt )
                 break;
 
             const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
-            if( !rFtn.GetNumStr().Len() && !rFtn.IsEndNote() &&
+            if( rFtn.GetNumStr().isEmpty() && !rFtn.IsEndNote() &&
                 !SwUpdFtnEndNtAtEnd::FindSectNdWithEndAttr( *pTxtFtn ))
-                pTxtFtn->SetNumber( rFtnInfo.nFtnOffset + nFtnNo++,
-                                    &rFtn.GetNumStr() );
+            {
+                pTxtFtn->SetNumber( rFtnInfo.nFtnOffset + nFtnNo++, rFtn.GetNumStr() );
+            }
         }
     }
 
@@ -121,7 +122,7 @@ void SwFtnIdxs::UpdateFtn( const SwNodeIndex& rStt )
             break;
 
         const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
-        if( !rFtn.GetNumStr().Len() )
+        if( rFtn.GetNumStr().isEmpty() )
         {
             if( !aNumArr.ChkNumber( *pTxtFtn ) )
             {
@@ -138,7 +139,7 @@ void SwFtnIdxs::UpdateFtn( const SwNodeIndex& rStt )
     {
         pTxtFtn = (*this)[ nPos ];
         const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
-        if( !rFtn.GetNumStr().Len() )
+        if( rFtn.GetNumStr().isEmpty() )
         {
             sal_uInt16 nSectNo = aNumArr.ChkNumber( *pTxtFtn );
             if( !nSectNo && ( rFtn.IsEndNote() || !bEndNoteOnly ))
@@ -148,7 +149,7 @@ void SwFtnIdxs::UpdateFtn( const SwNodeIndex& rStt )
 
             if( nSectNo )
             {
-                pTxtFtn->SetNumber( nSectNo, &rFtn.GetNumStr() );
+                pTxtFtn->SetNumber( nSectNo, rFtn.GetNumStr() );
             }
         }
     }
@@ -189,10 +190,11 @@ void SwFtnIdxs::UpdateAllFtn()
 
                     // Endnotes are per-document only
                     const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
-                    if( !rFtn.IsEndNote() && !rFtn.GetNumStr().Len() &&
+                    if( !rFtn.IsEndNote() && rFtn.GetNumStr().isEmpty() &&
                         !SwUpdFtnEndNtAtEnd::FindSectNdWithEndAttr( *pTxtFtn ))
-                        pTxtFtn->SetNumber( rFtnInfo.nFtnOffset + nNo++,
-                                            &rFtn.GetNumStr() );
+                    {
+                        pTxtFtn->SetNumber( rFtnInfo.nFtnOffset + nNo++, rFtn.GetNumStr() );
+                    }
                 }
                 if( nFtnIdx >= size() )
                     break;          // ok, everything is updated
@@ -205,10 +207,11 @@ void SwFtnIdxs::UpdateAllFtn()
             // Endnotes are per-document
             pTxtFtn = (*this)[ nFtnIdx ];
             const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
-            if( !rFtn.IsEndNote() && !rFtn.GetNumStr().Len() &&
+            if( !rFtn.IsEndNote() && rFtn.GetNumStr().isEmpty() &&
                 !SwUpdFtnEndNtAtEnd::FindSectNdWithEndAttr( *pTxtFtn ))
-                pTxtFtn->SetNumber( rFtnInfo.nFtnOffset + nNo++,
-                                    &rFtn.GetNumStr() );
+            {
+                pTxtFtn->SetNumber( rFtnInfo.nFtnOffset + nNo++, rFtn.GetNumStr() );
+            }
         }
 
     }
@@ -220,7 +223,7 @@ void SwFtnIdxs::UpdateAllFtn()
     {
         pTxtFtn = (*this)[ nPos ];
         const SwFmtFtn &rFtn = pTxtFtn->GetFtn();
-        if( !rFtn.GetNumStr().Len() )
+        if( rFtn.GetNumStr().isEmpty() )
         {
             sal_uInt16 nSectNo = aNumArr.ChkNumber( *pTxtFtn );
             if( !nSectNo && ( rFtn.IsEndNote() || !bEndNoteOnly ))
@@ -230,7 +233,7 @@ void SwFtnIdxs::UpdateAllFtn()
 
             if( nSectNo )
             {
-                pTxtFtn->SetNumber( nSectNo, &rFtn.GetNumStr() );
+                pTxtFtn->SetNumber( nSectNo, rFtn.GetNumStr() );
             }
         }
     }
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index ff798b5..185cbc1 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -2652,10 +2652,12 @@ void SwPageFrm::UpdateFtnNum()
                 {
                     SwTxtFtn* pTxtFtn = pFtn->GetAttr();
                     if( !pTxtFtn->GetFtn().IsEndNote() &&
-                         !pTxtFtn->GetFtn().GetNumStr().Len() &&
+                         pTxtFtn->GetFtn().GetNumStr().isEmpty() &&
                          !pFtn->GetMaster() &&
                          (pTxtFtn->GetFtn().GetNumber() != ++nNum) )
-                        pTxtFtn->SetNumber( nNum );
+                    {
+                        pTxtFtn->SetNumber( nNum, OUString() );
+                    }
                     if ( pFtn->GetNext() )
                         pFtn = (SwFtnFrm*)pFtn->GetNext();
                     else
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 2b79b0a..be89814 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -121,8 +121,8 @@ namespace {
 
 SwFmtFtn::SwFmtFtn( bool bEndNote )
     : SfxPoolItem( RES_TXTATR_FTN ),
-    pTxtAttr( 0 ),
-    nNumber( 0 ),
+    m_pTxtAttr( 0 ),
+    m_nNumber( 0 ),
     m_bEndNote( bEndNote )
 {
 }
@@ -131,8 +131,8 @@ SwFmtFtn::SwFmtFtn( bool bEndNote )
 int SwFmtFtn::operator==( const SfxPoolItem& rAttr ) const
 {
     OSL_ENSURE( SfxPoolItem::operator==( rAttr ), "keine gleichen Attribute" );
-    return nNumber  == ((SwFmtFtn&)rAttr).nNumber &&
-           aNumber  == ((SwFmtFtn&)rAttr).aNumber &&
+    return m_nNumber  == ((SwFmtFtn&)rAttr).m_nNumber &&
+           m_aNumber  == ((SwFmtFtn&)rAttr).m_aNumber &&
            m_bEndNote == ((SwFmtFtn&)rAttr).m_bEndNote;
 }
 
@@ -140,8 +140,8 @@ int SwFmtFtn::operator==( const SfxPoolItem& rAttr ) const
 SfxPoolItem* SwFmtFtn::Clone( SfxItemPool* ) const
 {
     SwFmtFtn* pNew  = new SwFmtFtn;
-    pNew->aNumber   = aNumber;
-    pNew->nNumber   = nNumber;
+    pNew->m_aNumber = m_aNumber;
+    pNew->m_nNumber = m_nNumber;
     pNew->m_bEndNote = m_bEndNote;
     return pNew;
 }
@@ -163,11 +163,11 @@ SwFmtFtn::~SwFmtFtn()
 }
 
 
-void SwFmtFtn::GetFtnText( XubString& rStr ) const
+void SwFmtFtn::GetFtnText( OUString& rStr ) const
 {
-    if( pTxtAttr->GetStartNode() )
+    if( m_pTxtAttr->GetStartNode() )
     {
-        SwNodeIndex aIdx( *pTxtAttr->GetStartNode(), 1 );
+        SwNodeIndex aIdx( *m_pTxtAttr->GetStartNode(), 1 );
         SwCntntNode* pCNd = aIdx.GetNode().GetTxtNode();
         if( !pCNd )
             pCNd = aIdx.GetNodes().GoNext( &aIdx );
@@ -178,7 +178,7 @@ void SwFmtFtn::GetFtnText( XubString& rStr ) const
             ++aIdx;
             while ( !aIdx.GetNode().IsEndNode() ) {
                 if ( aIdx.GetNode().IsTxtNode() )
-                    rStr += OUString("  ") + ((SwTxtNode*)(aIdx.GetNode().GetTxtNode()))->GetExpandTxt();
+                    rStr += "  " + ((SwTxtNode*)(aIdx.GetNode().GetTxtNode()))->GetExpandTxt();
                 ++aIdx;
             }
         }
@@ -186,16 +186,16 @@ void SwFmtFtn::GetFtnText( XubString& rStr ) const
 }
 
     // returnt den anzuzeigenden String der Fuss-/Endnote
-XubString SwFmtFtn::GetViewNumStr( const SwDoc& rDoc, sal_Bool bInclStrings ) const
+OUString SwFmtFtn::GetViewNumStr( const SwDoc& rDoc, sal_Bool bInclStrings ) const
 {
-    XubString sRet( GetNumStr() );
-    if( !sRet.Len() )
+    OUString sRet( GetNumStr() );
+    if( sRet.isEmpty() )
     {
         // dann ist die Nummer von Interesse, also ueber die Info diese
         // besorgen.
         bool bMakeNum = true;
-        const SwSectionNode* pSectNd = pTxtAttr
-                    ? SwUpdFtnEndNtAtEnd::FindSectNdWithEndAttr( *pTxtAttr )
+        const SwSectionNode* pSectNd = m_pTxtAttr
+                    ? SwUpdFtnEndNtAtEnd::FindSectNdWithEndAttr( *m_pTxtAttr )
                     : 0;
 
         if( pSectNd )
@@ -212,8 +212,7 @@ XubString SwFmtFtn::GetViewNumStr( const SwDoc& rDoc, sal_Bool bInclStrings ) co
                 sRet = rFtnEnd.GetSwNumType().GetNumStr( GetNumber() );
                 if( bInclStrings )
                 {
-                    sRet.Insert( rFtnEnd.GetPrefix(), 0 );
-                    sRet += rFtnEnd.GetSuffix();
+                    sRet = rFtnEnd.GetPrefix() + sRet + rFtnEnd.GetSuffix();
                 }
             }
         }
@@ -228,8 +227,7 @@ XubString SwFmtFtn::GetViewNumStr( const SwDoc& rDoc, sal_Bool bInclStrings ) co
             sRet = pInfo->aFmt.GetNumStr( GetNumber() );
             if( bInclStrings )
             {
-                sRet.Insert( pInfo->GetPrefix(), 0 );
-                sRet += pInfo->GetSuffix();
+                sRet = pInfo->GetPrefix() + sRet + pInfo->GetSuffix();
             }
         }
     }
@@ -246,7 +244,7 @@ SwTxtFtn::SwTxtFtn( SwFmtFtn& rAttr, xub_StrLen nStartPos )
     , m_pTxtNode( 0 )
     , m_nSeqNo( USHRT_MAX )
 {
-    rAttr.pTxtAttr = this;
+    rAttr.m_pTxtAttr = this;
     SetHasDummyChar(true);
 }
 
@@ -327,15 +325,14 @@ void SwTxtFtn::SetStartNode( const SwNodeIndex *pNewNode, sal_Bool bDelNode )
 }
 
 
-void SwTxtFtn::SetNumber( const sal_uInt16 nNewNum, const XubString* pStr )
+void SwTxtFtn::SetNumber( const sal_uInt16 nNewNum, const OUString &sNumStr )
 {
     SwFmtFtn& rFtn = (SwFmtFtn&)GetFtn();
-    if( pStr && pStr->Len() )
-        rFtn.aNumber = *pStr;
-    else
+
+    rFtn.m_aNumber = sNumStr;
+    if ( sNumStr.isEmpty() )
     {
-        rFtn.nNumber = nNewNum;
-        rFtn.aNumber = aEmptyStr;
+        rFtn.m_nNumber = nNewNum;
     }
 
     OSL_ENSURE( m_pTxtNode, "SwTxtFtn: where is my TxtNode?" );
@@ -392,9 +389,9 @@ void SwTxtFtn::CopyFtn(SwTxtFtn & rDest, SwTxtNode & rDestNode) const
     }
 
     // also copy user defined number string
-    if( GetFtn().aNumber.Len() )
+    if( !GetFtn().m_aNumber.isEmpty() )
     {
-        const_cast<SwFmtFtn &>(rDest.GetFtn()).aNumber = GetFtn().aNumber;
+        const_cast<SwFmtFtn &>(rDest.GetFtn()).m_aNumber = GetFtn().m_aNumber;
     }
 }
 
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index a46bb1b..33952c0 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -2933,7 +2933,7 @@ Replace0xFF(SwTxtNode const& rNode, OUStringBuffer & rTxt, sal_Int32 & rTxtStt,
                         {
                             const SwFmtFtn& rFtn = pAttr->GetFtn();
                             OUString sExpand;
-                            if( rFtn.GetNumStr().Len() )
+                            if( !rFtn.GetNumStr().isEmpty() )
                                 sExpand = rFtn.GetNumStr();
                             else if( rFtn.IsEndNote() )
                                 sExpand = rNode.GetDoc()->GetEndNoteInfo().aFmt.
@@ -3091,7 +3091,7 @@ sal_Bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx,
                         {
                             const SwFmtFtn& rFtn = pHt->GetFtn();
                             XubString sExpand;
-                            if( rFtn.GetNumStr().Len() )
+                            if( !rFtn.GetNumStr().isEmpty() )
                                 sExpand = rFtn.GetNumStr();
                             else if( rFtn.IsEndNote() )
                                 sExpand = GetDoc()->GetEndNoteInfo().aFmt.
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index d620c2b..87a4000 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -117,7 +117,7 @@ bool SwASC_AttrIter::OutAttr( xub_StrLen nSwPos )
                 case RES_TXTATR_FTN:
                     {
                         const SwFmtFtn& rFtn = pHt->GetFtn();
-                        if( rFtn.GetNumStr().Len() )
+                        if( !rFtn.GetNumStr().isEmpty() )
                             sOut = rFtn.GetNumStr();
                         else if( rFtn.IsEndNote() )
                             sOut = rWrt.pDoc->GetEndNoteInfo().aFmt.
diff --git a/sw/source/filter/html/htmlftn.cxx b/sw/source/filter/html/htmlftn.cxx
index b6278fd..b62fa48 100644
--- a/sw/source/filter/html/htmlftn.cxx
+++ b/sw/source/filter/html/htmlftn.cxx
@@ -307,7 +307,7 @@ Writer& OutHTML_SwFmtFtn( Writer& rWrt, const SfxPoolItem& rHt )
     rWrt.Strm() << sOut.makeStringAndClear().getStr();
     HTMLOutFuncs::Out_String( rWrt.Strm(), sFtnName, rHTMLWrt.eDestEnc, &rHTMLWrt.aNonConvertableCharacters );
     sOut.append(OOO_STRING_SVTOOLS_HTML_FTN_symbol).append('\"');
-    if( rFmtFtn.GetNumStr().Len() )
+    if( !rFmtFtn.GetNumStr().isEmpty() )
         sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_sdfixed);
     sOut.append('>');
     rWrt.Strm() << sOut.makeStringAndClear().getStr();
@@ -409,7 +409,7 @@ void SwHTMLWriter::OutFootEndNotes()
 String SwHTMLWriter::GetFootEndNoteSym( const SwFmtFtn& rFmtFtn )
 {
     const SwEndNoteInfo * pInfo = 0;
-    if( rFmtFtn.GetNumStr().Len() == 0 )
+    if( rFmtFtn.GetNumStr().isEmpty() )
         pInfo = rFmtFtn.IsEndNote() ? &pDoc->GetEndNoteInfo()
                                     : &pDoc->GetFtnInfo();
 
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 7ea8024..a6904ce 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4249,7 +4249,7 @@ void DocxAttributeOutput::FootnoteEndnoteReference()
     sal_Int32 nToken = pFootnote->IsEndNote()? XML_endnoteReference: XML_footnoteReference;
 
     // write it
-    if ( pFootnote->GetNumStr().Len() == 0 )
+    if ( pFootnote->GetNumStr().isEmpty() )
     {
         // autonumbered
         m_pSerializer->singleElementNS( XML_w, nToken,
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 254adb2..89c3ecd 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -2394,7 +2394,7 @@ void RtfAttributeOutput::TextCharFormat( const SwFmtCharFmt& rCharFmt )
 
 void RtfAttributeOutput::WriteTextFootnoteNumStr(const SwFmtFtn& rFootnote)
 {
-    if (!rFootnote.GetNumStr().Len())
+    if (rFootnote.GetNumStr().isEmpty())
         m_aRun->append(OOO_STRING_SVTOOLS_RTF_CHFTN);
     else
         m_aRun->append(msfilter::rtfutil::OutString(rFootnote.GetNumStr(), m_rExport.eCurrentEncoding));
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 5afe2d8..9f29d91 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -2358,7 +2358,7 @@ void WW8_WrPlcSubDoc::WriteGenericPlc( WW8Export& rWrt, sal_uInt8 nTTyp,
             {
                 const SwFmtFtn* pFtn = (SwFmtFtn*)aCntnt[ i ];
                 SwWW8Writer::WriteShort( *rWrt.pTableStrm,
-                        pFtn->GetNumStr().Len() ? 0 : ++nNo );
+                        !pFtn->GetNumStr().isEmpty() ? 0 : ++nNo );
             }
         }
     }
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index f1daac9..2133eb5 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3091,7 +3091,7 @@ void WW8AttributeOutput::ParaVerticalAlign( const SvxParaVertAlignItem& rAlign )
 void WW8Export::WriteFtnBegin( const SwFmtFtn& rFtn, ww::bytes* pOutArr )
 {
     ww::bytes aAttrArr;
-    bool bAutoNum = !rFtn.GetNumStr().Len();    // Auto-Nummer
+    const bool bAutoNum = rFtn.GetNumStr().isEmpty();    // Auto-Nummer
     if( bAutoNum )
     {
         if( bWrtWW8 )
@@ -3139,7 +3139,7 @@ void WW8Export::WriteFtnBegin( const SwFmtFtn& rFtn, ww::bytes* pOutArr )
         WriteChar( 0x02 );              // Auto-Nummer-Zeichen
     else
         // User-Nummerierung
-        OutSwString( rFtn.GetNumStr(), 0, rFtn.GetNumStr().Len(),
+        OutSwString( rFtn.GetNumStr(), 0, rFtn.GetNumStr().getLength(),
                         IsUnicode(), RTL_TEXTENCODING_MS_1252 );
 
     if( pOutArr )
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 8626adc..c824182 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -334,7 +334,7 @@ sal_uInt16 SwWW8ImplReader::End_Ftn()
         // If no automatic numbering use the following char from the main text
         // as the footnote number
         if (!rDesc.mbAutoNum)
-            ((SwTxtFtn*)pFN)->SetNumber(0, &sChar);
+            ((SwTxtFtn*)pFN)->SetNumber(0, sChar);
 
         /*
             Delete the footnote char from the footnote if its at the beginning
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index a96cdc0..9d7f844 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -237,7 +237,9 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
                 if( aCntntAtPos.pFndTxtAttr && aCntntAtPos.aFnd.pAttr )
                 {
                     const SwFmtFtn* pFtn = (SwFmtFtn*)aCntntAtPos.aFnd.pAttr;
-                    pFtn->GetFtnText( sTxt );
+                    OUString sTmp;
+                    pFtn->GetFtnText( sTmp );
+                    sTxt = sTmp;
                     sTxt.Insert( SW_RESSTR( pFtn->IsEndNote()
                                     ? STR_ENDNOTE : STR_FTNNOTE ), 0 );
                     bBalloon = sal_True;
diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx
index 8a848c3..cddb20f 100644
--- a/sw/source/ui/misc/insfnote.cxx
+++ b/sw/source/ui/misc/insfnote.cxx
@@ -223,7 +223,7 @@ void SwInsFootNoteDlg::Init()
 
     if( rSh.GetCurFtn( &aFtnNote ))
     {
-        if(aFtnNote.GetNumStr().Len())
+        if (!aFtnNote.GetNumStr().isEmpty())
         {
             sNumStr = aFtnNote.GetNumStr();
 


More information about the Libreoffice-commits mailing list