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

Matteo Casalin matteo.casalin at yahoo.com
Sun Mar 2 11:18:37 PST 2014


 editeng/source/editeng/editdoc.cxx        |  111 ++++++++----------------------
 editeng/source/editeng/editdoc.hxx        |   22 ++---
 editeng/source/editeng/impedit4.cxx       |    4 -
 sw/inc/undobj.hxx                         |   32 ++++----
 sw/source/core/doc/doc.cxx                |    2 
 sw/source/core/docnode/ndcopy.cxx         |    8 +-
 sw/source/core/edit/autofmt.cxx           |   61 ++++++----------
 sw/source/core/inc/UndoCore.hxx           |    2 
 sw/source/core/inc/layact.hxx             |    9 --
 sw/source/core/inc/txmsrt.hxx             |   19 ++---
 sw/source/core/inc/viewimp.hxx            |   55 +++++---------
 sw/source/core/layout/fly.cxx             |    4 -
 sw/source/core/layout/flylay.cxx          |    4 -
 sw/source/core/layout/layact.cxx          |   15 ----
 sw/source/core/layout/sectfrm.cxx         |    2 
 sw/source/core/layout/tabfrm.cxx          |    4 -
 sw/source/core/text/inftxt.cxx            |    2 
 sw/source/core/tox/txmsrt.cxx             |    9 +-
 sw/source/core/undo/rolbck.cxx            |    2 
 sw/source/core/undo/undel.cxx             |   19 ++---
 sw/source/core/undo/undobj.cxx            |  111 ++++++++++++------------------
 sw/source/core/undo/undobj1.cxx           |   12 +--
 sw/source/core/undo/unins.cxx             |    6 -
 sw/source/core/undo/unmove.cxx            |    4 -
 sw/source/core/undo/unovwr.cxx            |   15 +---
 sw/source/core/undo/unredln.cxx           |    6 -
 sw/source/core/undo/untblk.cxx            |   12 +--
 sw/source/core/view/pagepreviewlayout.cxx |    4 -
 sw/source/core/view/vdraw.cxx             |    8 +-
 sw/source/core/view/viewimp.cxx           |   31 ++++----
 sw/source/core/view/viewsh.cxx            |   10 +-
 sw/source/filter/basflt/shellio.cxx       |    2 
 32 files changed, 245 insertions(+), 362 deletions(-)

New commits:
commit c94f12a3893f79c73a12d330dd0e01dde64da170
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sun Mar 2 15:44:07 2014 +0100

    nOrigTxtStt is never read
    
    Change-Id: I9ace298d66aaaa46cecdeacfc633144715535e50

diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 481d2af..1043dcf 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -1391,7 +1391,6 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
     // replace bullet character with defined one
     const OUString& rStr = m_pCurTxtNd->GetTxt();
     sal_Int32 nTxtStt = 0;
-    const sal_Int32 nOrigTxtStt = 0;
     const sal_Unicode* pFndBulletChr;
     if( m_aFlags.bChgEnumNum &&
         2 < rStr.getLength() &&
@@ -1587,7 +1586,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
         }
         else
             m_aDelPam.GetPoint()->nContent.Assign( m_pCurTxtNd,
-                        bChgEnum ? (nTxtStt - nOrigTxtStt) : 0 );
+                        bChgEnum ? nTxtStt : 0 );
         m_aDelPam.SetMark();
 
         if( bChgBullet )
@@ -1596,7 +1595,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel )
         while( nTxtStt < rStr.getLength() && IsSpace( rStr[ nTxtStt ] ))
             nTxtStt++;
 
-        m_aDelPam.GetPoint()->nContent = nTxtStt - nOrigTxtStt;
+        m_aDelPam.GetPoint()->nContent = nTxtStt;
         DeleteSel( m_aDelPam );
 
         if( !m_aFlags.bSetNumRule )
commit d0feb9d89d32d5562360c021ec0bebe36602507e
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sun Mar 2 02:12:18 2014 +0100

    Rework SwAutoFormat::IsBlanksInString
    
    The old code was convoluted and suffered the following issues:
    * Relied on OUStrings being zero-terminated, which is not granted
    * Systematically missed the end of string, accessing unrelated
      memory, in case there was just a single trailing space
    
    Change-Id: I98dd0f94a8f48f40c467a02dfd01c7866266d9d4

diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index f2b672f..481d2af 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -405,26 +405,22 @@ sal_Bool SwAutoFormat::IsEnumericChar( const SwTxtNode& rNd ) const
 
 sal_Bool SwAutoFormat::IsBlanksInString( const SwTxtNode& rNd ) const
 {
-    // Search more that 5 blanks/tabs in the string.
+    // Search more than 5 consecutive blanks/tabs in the string.
     OUString sTmp( DelLeadingBlanks(rNd.GetTxt()) );
-    const sal_Unicode* pTmp = sTmp.getStr();
-    while( *pTmp )
+    const sal_Int32 nLen = sTmp.getLength();
+    sal_Int32 nIdx = 0;
+    while (nIdx < nLen)
     {
-        if( IsSpace( *pTmp ) )
-        {
-            if( IsSpace( *++pTmp ))     // 2 spaces after each other
-            {
-                const sal_Unicode* pStt = pTmp;
-                while( *pTmp && IsSpace( *++pTmp ))
-                    ;
-                if( 5 <= pTmp - pStt )
-                    return sal_True;
-            }
-            else
-                ++pTmp;
-        }
-        else
-            ++pTmp;
+        // Skip non-blanks
+        while (nIdx < nLen && !IsSpace(sTmp[nIdx])) ++nIdx;
+        if (nIdx == nLen)
+            return sal_False;
+        // Then count consecutive blanks
+        const sal_Int32 nFirst = nIdx;
+        while (nIdx < nLen && IsSpace(sTmp[nIdx])) ++nIdx;
+        // And exit if enough consecutive blanks were found
+        if (nIdx-nFirst > 5)
+            return sal_True;
     }
     return sal_False;
 }
commit e9ac4088d932992c58ac0328ff0fd4b43cda338e
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sun Mar 2 01:29:00 2014 +0100

    Avoid consecutive OUString appends and a temporary
    
    Change-Id: Iee8998a4947a253f869fefb7bde316e3d3b4129b

diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index e3ee221..f2b672f 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -383,8 +383,7 @@ sal_Bool SwAutoFormat::IsFastFullLine( const SwTxtNode& rNd ) const
 sal_Bool SwAutoFormat::IsEnumericChar( const SwTxtNode& rNd ) const
 {
     const OUString& rTxt = rNd.GetTxt();
-    OUString sTmp( rTxt );
-    sal_Int32 nBlnks = GetLeadingBlanks( sTmp );
+    sal_Int32 nBlnks = GetLeadingBlanks( rTxt );
     const sal_Int32 nLen = rTxt.getLength() - nBlnks;
     if( !nLen )
         return sal_False;
@@ -939,8 +938,8 @@ CHECK_ROMAN_5:
             {
                 eScan |= CHG;
                 if( pPreFix )
-                    (*pPreFix += OUString((sal_Unicode)1))
-                              += OUString::number( nStart );
+                    *pPreFix += OUString((sal_Unicode)1)
+                              + OUString::number( nStart );
             }
             eScan &= ~NO_DELIM;     // remove Delim
             eScan |= DELIM;         // add Digit
@@ -957,7 +956,7 @@ CHECK_ROMAN_5:
         return USHRT_MAX;
 
     if( (NO_DELIM & eScan) && pPreFix )     // do not forget the last one
-        (*pPreFix += OUString((sal_Unicode)1)) += OUString::number( nStart );
+        *pPreFix += OUString((sal_Unicode)1) + OUString::number( nStart );
 
     rPos = nPos;
     return nDigitLvl;       // 0 .. 9 (MAXLEVEL - 1)
commit aa5b337bff8d9c8c07f2c67a043bef4f07fccb79
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sun Mar 2 01:09:04 2014 +0100

    Add EditPaM::operator !() and simplify EditSelection::IsInvalid
    
    Change-Id: Id47d77e63eff2267f5e4112b88dfb90c3ec95bd8

diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index f44898e..aa82606 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1212,13 +1212,6 @@ EditSelection& EditSelection::operator = ( const EditPaM& rPaM )
     return *this;
 }
 
-bool EditSelection::IsInvalid() const
-{
-    EditPaM aEmptyPaM;
-
-    return ( aStartPaM == aEmptyPaM ) || ( aEndPaM == aEmptyPaM );
-}
-
 void EditSelection::Adjust( const EditDoc& rNodes )
 {
     DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index out of range in Adjust(1)" );
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index a73de4a..4dc702b 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -332,6 +332,7 @@ public:
     EditPaM&    operator = ( const EditPaM& rPaM );
     friend bool operator == ( const EditPaM& r1, const EditPaM& r2 );
     friend bool operator != ( const EditPaM& r1, const EditPaM& r2 );
+    bool operator !() const { return !pNode && !nIndex; }
 };
 
 #define PORTIONKIND_TEXT        0
@@ -711,7 +712,7 @@ public:
     const EditPaM&  Max() const         { return aEndPaM; }
 
     bool            HasRange() const    { return aStartPaM != aEndPaM; }
-    bool            IsInvalid() const;
+    bool            IsInvalid() const { return !aStartPaM || !aEndPaM; }
     bool            DbgIsBuggy( EditDoc& rDoc );
 
     void            Adjust( const EditDoc& rNodes );
commit 95412052fadffb323d21eba1c1d54c9803baabd2
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sun Mar 2 00:25:49 2014 +0100

    sal_Bool to bool and some optimizations
    
    Change-Id: I6a42b78caaff962368b83def8e291d6b6c50abb1

diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 3ee2d5d..f44898e 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1212,17 +1212,11 @@ EditSelection& EditSelection::operator = ( const EditPaM& rPaM )
     return *this;
 }
 
-sal_Bool EditSelection::IsInvalid() const
+bool EditSelection::IsInvalid() const
 {
     EditPaM aEmptyPaM;
 
-    if ( aStartPaM == aEmptyPaM )
-        return sal_True;
-
-    if ( aEndPaM == aEmptyPaM )
-        return sal_True;
-
-    return sal_False;
+    return ( aStartPaM == aEmptyPaM ) || ( aEndPaM == aEmptyPaM );
 }
 
 void EditSelection::Adjust( const EditDoc& rNodes )
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index 1ff1979..a73de4a 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -710,8 +710,8 @@ public:
     const EditPaM&  Min() const         { return aStartPaM; }
     const EditPaM&  Max() const         { return aEndPaM; }
 
-    sal_Bool            HasRange() const    { return aStartPaM != aEndPaM; }
-    sal_Bool            IsInvalid() const;
+    bool            HasRange() const    { return aStartPaM != aEndPaM; }
+    bool            IsInvalid() const;
     bool            DbgIsBuggy( EditDoc& rDoc );
 
     void            Adjust( const EditDoc& rNodes );
commit 3ebec5e576c851b8a5da939297b20d3c6107aab3
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sun Mar 2 00:21:49 2014 +0100

    Return value of EditSelection::Adjust is never used
    
    Change-Id: I32770f34819cf737beeef4d22a26538d9ac357a5

diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index c5a4918..3ee2d5d 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1225,7 +1225,7 @@ sal_Bool EditSelection::IsInvalid() const
     return sal_False;
 }
 
-sal_Bool EditSelection::Adjust( const EditDoc& rNodes )
+void EditSelection::Adjust( const EditDoc& rNodes )
 {
     DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index out of range in Adjust(1)" );
     DBG_ASSERT( aEndPaM.GetIndex() <= aEndPaM.GetNode()->Len(), "Index out of range in Adjust(2)" );
@@ -1239,11 +1239,9 @@ sal_Bool EditSelection::Adjust( const EditDoc& rNodes )
     DBG_ASSERT( nStartNode != SAL_MAX_INT32, "Node out of range in Adjust(1)" );
     DBG_ASSERT( nEndNode != SAL_MAX_INT32, "Node out of range in Adjust(2)" );
 
-    sal_Bool bSwap = sal_False;
-    if ( nStartNode > nEndNode )
-        bSwap = sal_True;
-    else if ( ( nStartNode == nEndNode ) && ( aStartPaM.GetIndex() > aEndPaM.GetIndex() ) )
-        bSwap = sal_True;
+    const bool bSwap = ( nStartNode > nEndNode ) ||
+                       ( ( nStartNode == nEndNode ) &&
+                         ( aStartPaM.GetIndex() > aEndPaM.GetIndex() ) );
 
     if ( bSwap )
     {
@@ -1251,8 +1249,6 @@ sal_Bool EditSelection::Adjust( const EditDoc& rNodes )
         aStartPaM = aEndPaM;
         aEndPaM = aTmpPaM;
     }
-
-    return bSwap;
 }
 
 bool operator == ( const EditPaM& r1, const EditPaM& r2 )
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index fb490ad..1ff1979 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -714,7 +714,7 @@ public:
     sal_Bool            IsInvalid() const;
     bool            DbgIsBuggy( EditDoc& rDoc );
 
-    sal_Bool            Adjust( const EditDoc& rNodes );
+    void            Adjust( const EditDoc& rNodes );
 
     EditSelection&  operator = ( const EditPaM& r );
     bool            operator == ( const EditSelection& r ) const
commit 7cfccf98c18f5402b9e4a0e1e01937a36837e19d
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Mar 1 23:27:23 2014 +0100

    sal_Bool to bool, with some optimizations
    
    Change-Id: Ia1c73cf97e93a999147ce82ebb18767743adf2fc

diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index ebbd68d..c5a4918 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1174,26 +1174,16 @@ void EditPaM::SetNode(ContentNode* p)
     pNode = p;
 }
 
-sal_Bool EditPaM::DbgIsBuggy( EditDoc& rDoc )
+bool EditPaM::DbgIsBuggy( EditDoc& rDoc )
 {
-    if ( !pNode )
-        return sal_True;
-    if ( rDoc.GetPos( pNode ) >= rDoc.Count() )
-        return sal_True;
-    if ( nIndex > pNode->Len() )
-        return sal_True;
-
-    return sal_False;
+    return !pNode ||
+           rDoc.GetPos( pNode ) >= rDoc.Count() ||
+           nIndex > pNode->Len();
 }
 
-sal_Bool EditSelection::DbgIsBuggy( EditDoc& rDoc )
+bool EditSelection::DbgIsBuggy( EditDoc& rDoc )
 {
-    if ( aStartPaM.DbgIsBuggy( rDoc ) )
-        return sal_True;
-    if ( aEndPaM.DbgIsBuggy( rDoc ) )
-        return sal_True;
-
-    return sal_False;
+    return aStartPaM.DbgIsBuggy( rDoc ) || aEndPaM.DbgIsBuggy( rDoc );
 }
 
 EditSelection::EditSelection()
@@ -1265,15 +1255,10 @@ sal_Bool EditSelection::Adjust( const EditDoc& rNodes )
     return bSwap;
 }
 
-sal_Bool operator == ( const EditPaM& r1,  const EditPaM& r2  )
+bool operator == ( const EditPaM& r1, const EditPaM& r2 )
 {
-    if ( r1.GetNode() != r2.GetNode() )
-        return sal_False;
-
-    if ( r1.GetIndex() != r2.GetIndex() )
-        return sal_False;
-
-    return sal_True;
+    return ( r1.GetNode() == r2.GetNode() ) &&
+           ( r1.GetIndex() == r2.GetIndex() );
 }
 
 EditPaM& EditPaM::operator = ( const EditPaM& rPaM )
@@ -1283,7 +1268,7 @@ EditPaM& EditPaM::operator = ( const EditPaM& rPaM )
     return *this;
 }
 
-sal_Bool operator != ( const EditPaM& r1,  const EditPaM& r2  )
+bool operator != ( const EditPaM& r1, const EditPaM& r2 )
 {
     return !( r1 == r2 );
 }
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index 1d793f0..fb490ad 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -327,11 +327,11 @@ public:
     sal_Int32  GetIndex() const         { return nIndex; }
     void       SetIndex( sal_Int32 n )  { nIndex = n; }
 
-    sal_Bool            DbgIsBuggy( EditDoc& rDoc );
+    bool       DbgIsBuggy( EditDoc& rDoc );
 
     EditPaM&    operator = ( const EditPaM& rPaM );
-    friend sal_Bool operator == ( const EditPaM& r1,  const EditPaM& r2  );
-    friend sal_Bool operator != ( const EditPaM& r1,  const EditPaM& r2  );
+    friend bool operator == ( const EditPaM& r1, const EditPaM& r2 );
+    friend bool operator != ( const EditPaM& r1, const EditPaM& r2 );
 };
 
 #define PORTIONKIND_TEXT        0
@@ -712,15 +712,14 @@ public:
 
     sal_Bool            HasRange() const    { return aStartPaM != aEndPaM; }
     sal_Bool            IsInvalid() const;
-    sal_Bool            DbgIsBuggy( EditDoc& rDoc );
+    bool            DbgIsBuggy( EditDoc& rDoc );
 
     sal_Bool            Adjust( const EditDoc& rNodes );
 
     EditSelection&  operator = ( const EditPaM& r );
-    sal_Bool            operator == ( const EditSelection& r ) const
-                    { return ( ( aStartPaM == r.aStartPaM ) && ( aEndPaM == r.aEndPaM ) )
-                            ? sal_True : sal_False; }
-    sal_Bool            operator != ( const EditSelection& r ) const { return !( r == *this ); }
+    bool            operator == ( const EditSelection& r ) const
+                    { return ( aStartPaM == r.aStartPaM ) && ( aEndPaM == r.aEndPaM ); }
+    bool            operator != ( const EditSelection& r ) const { return !( r == *this ); }
 };
 
 
commit b39275d483e5b1b79c0c7aaaf915fde9ca15857e
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Mar 1 23:26:00 2014 +0100

    Use EditSelection::HasRange
    
    Change-Id: I6be00dc99e40bb190647cd5007431d4cca750024

diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 9201c71..06a94e5 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1958,7 +1958,7 @@ bool ImpEditEngine::SpellSentence(EditView& rEditView,
     pSpellInfo->aLastSpellContentSelections.clear();
     rToFill.clear();
     //if no selection previously exists the range is extended to the end of the object
-    if(aCurSel.Min() == aCurSel.Max())
+    if (!aCurSel.HasRange())
     {
         ContentNode* pLastNode = aEditDoc.GetObject( aEditDoc.Count()-1);
         aCurSel.Max() = EditPaM(pLastNode, pLastNode->Len());
@@ -2034,7 +2034,7 @@ void ImpEditEngine::AddPortionIterated(
                             Reference< XSpellAlternatives > xAlt,
                                 ::svx::SpellPortions& rToFill)
 {
-    if(rSel.Min() != rSel.Max())
+    if (rSel.HasRange())
     {
         if(xAlt.is())
         {
commit 7e9df2ba484a29c74ee5ccd04972712ecb98802e
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Mar 1 22:25:58 2014 +0100

    Avoid temporaries just used as return value
    
    Change-Id: I4b7fc7103cac3acd5561754fc15b7f7b40c041fe

diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index d987734..ebbd68d 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2194,8 +2194,7 @@ EditPaM EditDoc::Clear()
 
     SetModified(false);
 
-    EditPaM aPaM( pNode, 0 );
-    return aPaM;
+    return EditPaM( pNode, 0 );
 }
 
 void EditDoc::ClearSpellErrors()
@@ -2231,8 +2230,7 @@ EditPaM EditDoc::RemoveText()
 
     SetModified(true);
 
-    EditPaM aPaM( pNode, 0 );
-    return aPaM;
+    return EditPaM( pNode, 0 );
 }
 
 EditPaM EditDoc::InsertText( EditPaM aPaM, const OUString& rStr )
commit 4f27cf97e6216994a971c2748bb544e85b023ff3
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Mar 1 22:20:36 2014 +0100

    Use existing method instead of hand-writing
    
    Change-Id: If28620d1e0c8b719e2d0de41831e52b238113308

diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 1ac0444..d987734 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1565,11 +1565,7 @@ void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool,
             // Move all attributes in the current node (this)
             CharAttribList::AttribsType::iterator it = rPrevAttribs.begin() + nAttr;
             aCharAttribList.InsertAttrib(rPrevAttribs.release(it).release());
-
-            DBG_ASSERT( pAttrib->GetStart() >= nCut, "Start < nCut!" );
-            DBG_ASSERT( pAttrib->GetEnd() >= nCut, "End < nCut!" );
-            pAttrib->GetStart() = pAttrib->GetStart() - nCut;
-            pAttrib->GetEnd() = pAttrib->GetEnd() - nCut;
+            pAttrib->MoveBackward( nCut );
             nAttr--;
         }
         nAttr++;
commit c694a34261540c579c763e9d249cd5eeb5a1f34a
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Mar 1 21:09:25 2014 +0100

    EditLine::CalcTextSize - nIndex is updated but never read
    
    Change-Id: Iec96535e154e0467fe5e89264782efa30837bff9

diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 9f06e17..1ac0444 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1062,8 +1062,6 @@ Size EditLine::CalcTextSize( ParaPortion& rParaPortion )
     Size aTmpSz;
     TextPortion* pPortion;
 
-    sal_Int32 nIndex = GetStart();
-
     DBG_ASSERT( rParaPortion.GetTextPortions().Count(), "GetTextSize before CreatePortions !" );
 
     for ( sal_Int32 n = nStartPortion; n <= nEndPortion; n++ )
@@ -1087,7 +1085,6 @@ Size EditLine::CalcTextSize( ParaPortion& rParaPortion )
             }
             break;
         }
-        nIndex = nIndex + pPortion->GetLen();
     }
 
     SetHeight( (sal_uInt16)aSz.Height() );
commit 3b7d6284e5a2731b93608c71a4a126f120f3c025
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Mar 1 20:52:48 2014 +0100

    Avoid a check and use plain arithmetic
    
    Change-Id: Ie475a6f7d523d5aa6c0ef1952adce56caeac347b

diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 78124b8..9f06e17 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2182,11 +2182,8 @@ sal_uLong EditDoc::GetTextLen() const
             const EditCharAttrib& rAttr = rAttrs[--nAttr];
             if (rAttr.Which() == EE_FEATURE_FIELD)
             {
-                sal_Int32 nFieldLen = static_cast<const EditCharAttribField&>(rAttr).GetFieldValue().getLength();
-                if ( !nFieldLen )
-                    nLen--;
-                else
-                    nLen += nFieldLen-1;
+                nLen += static_cast<const EditCharAttribField&>(rAttr).GetFieldValue().getLength();
+                --nLen; // Standalone, to avoid corner cases when previous getLength() returns 0
             }
         }
     }
commit a90760a056056fdf1fc4dbdb6464f2a84b0fc617
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Mar 1 20:20:59 2014 +0100

    Use OUStringBuffer instead of rtl_uString in EditDoc::GetText
    
    Change-Id: I292c2b726de3e6c27f05fdf7612fe057ae9f94ad

diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 86a9548..78124b8 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -55,6 +55,8 @@
 #include <editeng/eerdll.hxx>
 #include <eerdll2.hxx>
 
+#include <rtl/ustrbuf.hxx>
+
 #include <tools/stream.hxx>
 #include <tools/debug.hxx>
 #include <tools/shl.hxx>
@@ -2082,33 +2084,26 @@ OUString EditDoc::GetSepStr( LineEnd eEnd )
 
 OUString EditDoc::GetText( LineEnd eEnd ) const
 {
-    sal_uLong nLen = GetTextLen();
-    sal_Int32 nNodes = Count();
+    const sal_Int32 nNodes = Count();
     if (nNodes == 0)
         return OUString();
 
-    OUString aSep = EditDoc::GetSepStr( eEnd );
-    sal_Int32 nSepSize = aSep.getLength();
+    const OUString aSep = EditDoc::GetSepStr( eEnd );
+    const sal_Int32 nSepSize = aSep.getLength();
+    const sal_uLong nLen = GetTextLen() + (nNodes - 1)*nSepSize;
 
-    if ( nSepSize )
-        nLen += (nNodes - 1) * nSepSize;
+    OUStringBuffer aBuffer(nLen + 16); // leave some slack
 
-    rtl_uString* newStr = rtl_uString_alloc(nLen);
-    sal_Unicode* pCur = newStr->buffer;
-    sal_Int32 nLastNode = nNodes-1;
     for ( sal_Int32 nNode = 0; nNode < nNodes; nNode++ )
     {
-        OUString aTmp( GetParaAsString( GetObject(nNode) ) );
-        memcpy( pCur, aTmp.getStr(), aTmp.getLength() * sizeof(sal_Unicode) );
-        pCur += aTmp.getLength();
-        if ( nSepSize && ( nNode != nLastNode ) )
+        if ( nSepSize && nNode>0 )
         {
-            memcpy( pCur, aSep.getStr(), nSepSize * sizeof(sal_Unicode ) );
-            pCur += nSepSize;
+            aBuffer.append(aSep);
         }
+        aBuffer.append(GetParaAsString( GetObject(nNode) ));
     }
-    assert(pCur - newStr->buffer == newStr->length);
-    return OUString(newStr, SAL_NO_ACQUIRE);
+
+    return aBuffer.makeStringAndClear();
 }
 
 OUString EditDoc::GetParaAsString( sal_Int32 nNode ) const
commit 0ea119318a9102e145ad007811759281afbe7305
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Mar 1 18:56:12 2014 +0100

    Use mutable instead of casting this
    
    Change-Id: Ifdf6334af72637b1c18a9ea2bd2be317d5ae8b20

diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 5a71889..e3ee221 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -96,9 +96,9 @@ class SwAutoFormat
     SwDoc* m_pDoc;
     SwTxtNode* m_pCurTxtNd;     // the current TextNode
     SwTxtFrm* m_pCurTxtFrm;     // frame of the current TextNode
-    boost::scoped_ptr<CharClass> m_pCharClass; // Character classification
     sal_uLong m_nEndNdIdx;      // for the percentage-display
-    LanguageType m_eCharClassLang;
+    mutable boost::scoped_ptr<CharClass> m_pCharClass; // Character classification
+    mutable LanguageType m_eCharClassLang;
 
     sal_uInt16 m_nLastHeadLvl, m_nLastCalcHeadLvl;
     sal_uInt16 m_nRedlAutoFmtSeqId;
@@ -136,13 +136,12 @@ class SwAutoFormat
     bool m_bMoreLines : 1;
 
     // ------------- private methods -----------------------------
-    void _GetCharClass( LanguageType eLang );
     CharClass& GetCharClass( LanguageType eLang ) const
     {
         if( !m_pCharClass || eLang != m_eCharClassLang )
         {
-            SwAutoFormat* pThis = (SwAutoFormat*)this;
-            pThis->_GetCharClass( eLang );
+            m_pCharClass.reset( new CharClass( LanguageTag( eLang ) ) );
+            m_eCharClassLang = eLang;
         }
         return *m_pCharClass;
     }
@@ -254,12 +253,6 @@ SwTxtFrm* SwAutoFormat::GetFrm( const SwTxtNode& rTxtNd ) const
     return ((SwTxtFrm*)pFrm)->GetFormatted();
 }
 
-void SwAutoFormat::_GetCharClass( LanguageType eLang )
-{
-    m_pCharClass.reset( new CharClass( LanguageTag( eLang ) ) );
-    m_eCharClassLang = eLang;
-}
-
 void SwAutoFormat::_SetRedlineTxt( sal_uInt16 nActionId )
 {
     OUString sTxt;
commit 778e65cc2a35c0aa1dee73f23007709b89703bb9
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Mar 1 18:26:36 2014 +0100

    Bail out early and avoid temporaries
    
    Change-Id: Iee0f72995c59c03189c6e187c7e24f9247ff844d

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 0fcdf5c..2e75e42 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -1085,39 +1085,33 @@ bool SwUndo::HasHiddenRedlines( const SwRedlineSaveDatas& rSData )
 bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr,
                         const SwRedlineSaveDatas& rCheck, bool bCurrIsEnd )
 {
-    bool bRet = false;
-    size_t n;
+    if( rCurr.size() != rCheck.size() )
+        return false;
 
-    if( rCurr.size() == rCheck.size() )
+    for( size_t n = 0; n < rCurr.size(); ++n )
     {
-        bRet = true;
-        for( n = 0; n < rCurr.size(); ++n )
+        const SwRedlineSaveData& rSet = *rCurr[ n ];
+        const SwRedlineSaveData& rGet = *rCheck[ n ];
+        if( rSet.nSttNode != rGet.nSttNode ||
+            rSet.GetMvSttIdx() || rGet.GetMvSttIdx() ||
+            ( bCurrIsEnd ? rSet.nSttCntnt != rGet.nEndCntnt
+                            : rSet.nEndCntnt != rGet.nSttCntnt ) ||
+            !rGet.CanCombine( rSet ) )
         {
-            const SwRedlineSaveData& rSet = *rCurr[ n ];
-            const SwRedlineSaveData& rGet = *rCheck[ n ];
-            if( rSet.nSttNode != rGet.nSttNode ||
-                rSet.GetMvSttIdx() || rGet.GetMvSttIdx() ||
-                ( bCurrIsEnd ? rSet.nSttCntnt != rGet.nEndCntnt
-                             : rSet.nEndCntnt != rGet.nSttCntnt ) ||
-                !rGet.CanCombine( rSet ) )
-            {
-                bRet = false;
-                break;
-            }
+            return false;
         }
+    }
 
-        if( bRet )
-            for( n = 0; n < rCurr.size(); ++n )
-            {
-                SwRedlineSaveData& rSet = *rCurr[ n ];
-                const SwRedlineSaveData& rGet = *rCheck[ n ];
-                if( bCurrIsEnd )
-                    rSet.nSttCntnt = rGet.nSttCntnt;
-                else
-                    rSet.nEndCntnt = rGet.nEndCntnt;
-            }
+    for( size_t n = 0; n < rCurr.size(); ++n )
+    {
+        SwRedlineSaveData& rSet = *rCurr[ n ];
+        const SwRedlineSaveData& rGet = *rCheck[ n ];
+        if( bCurrIsEnd )
+            rSet.nSttCntnt = rGet.nSttCntnt;
+        else
+            rSet.nEndCntnt = rGet.nEndCntnt;
     }
-    return bRet;
+    return true;
 }
 
 // #111827#
@@ -1125,27 +1119,19 @@ OUString ShortenString(const OUString & rStr, sal_Int32 nLength, const OUString
 {
     assert(nLength - rFillStr.getLength() >= 2);
 
-    OUString aResult;
-
     if (rStr.getLength() <= nLength)
-        aResult = rStr;
-    else
-    {
-        sal_Int32 nTmpLength = nLength - rFillStr.getLength();
-        if ( nTmpLength < 2 )
-            nTmpLength = 2;
+        return rStr;
 
-        nLength = nTmpLength;
+    nLength -= rFillStr.getLength();
+    if ( nLength < 2 )
+        nLength = 2;
 
-        const sal_Int32 nFrontLen = nLength - nLength / 2;
-        const sal_Int32 nBackLen = nLength - nFrontLen;
+    const sal_Int32 nFrontLen = nLength - nLength / 2;
+    const sal_Int32 nBackLen = nLength - nFrontLen;
 
-        aResult += rStr.copy(0, nFrontLen);
-        aResult += rFillStr;
-        aResult += rStr.copy(rStr.getLength() - nBackLen, nBackLen);
-    }
-
-    return aResult;
+    return rStr.copy(0, nFrontLen)
+           + rFillStr
+           + rStr.copy(rStr.getLength() - nBackLen);
 }
 
 bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos,
commit 990a6328d1e033a8a8335020da6064b5636a24cb
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Mar 1 17:38:49 2014 +0100

    D'oh! I forgot something in commit 3e43a891e89aa6eb8eeecd9d3528f2a002371646
    
    Change-Id: I2bd3c13eccd94dfb06d2245dd68e97f08c50cbdb

diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx
index f102c53..306943f 100644
--- a/sw/source/core/inc/txmsrt.hxx
+++ b/sw/source/core/inc/txmsrt.hxx
@@ -153,7 +153,7 @@ struct SwTOXSortTabBase
 
 private:
     mutable bool bValidTxt;
-    TextAndReading m_aSort;
+    mutable TextAndReading m_aSort;
 
     virtual TextAndReading GetText_Impl() const = 0;
 };
@@ -164,7 +164,7 @@ inline TextAndReading SwTOXSortTabBase::GetTxt() const
     {
         // 'this' is 'SwTOXSortTabBase const*', so the virtual
         // mechanism will call the derived class' GetText_Impl
-        GetText_Impl();
+        m_aSort = GetText_Impl();
         bValidTxt = true;
     }
     return m_aSort;
commit 387b9122b049202164ba34a942e04c54a3b00120
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Mar 1 14:32:34 2014 +0100

    Do not use heap for two temporaries
    
    Change-Id: I49750170fbe68159fc5555ca686344857156c18d

diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index 1091d1f..8a57372 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -482,14 +482,13 @@ sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
         return sal_False;
 
     {
-        SwRedlineSaveDatas* pTmpSav = new SwRedlineSaveDatas;
-        if( !FillSaveData( rDelPam, *pTmpSav, false ))
-            delete pTmpSav, pTmpSav = 0;
-
-        bool bOk = ( !pRedlSaveData && !pTmpSav ) ||
-                   ( pRedlSaveData && pTmpSav &&
-                SwUndo::CanRedlineGroup( *pRedlSaveData, *pTmpSav, bBackSp ));
-        delete pTmpSav;
+        SwRedlineSaveDatas aTmpSav;
+        const bool bSaved = FillSaveData( rDelPam, aTmpSav, false );
+
+        bool bOk = ( !pRedlSaveData && !bSaved ) ||
+                   ( pRedlSaveData && bSaved &&
+                SwUndo::CanRedlineGroup( *pRedlSaveData, aTmpSav, bBackSp ));
+        // aTmpSav.DeleteAndDestroyAll();
         if( !bOk )
             return sal_False;
 
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index 8ef86d5..336fc32 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -121,18 +121,17 @@ sal_Bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
         return sal_False;
 
     {
-        SwRedlineSaveDatas* pTmpSav = new SwRedlineSaveDatas;
+        SwRedlineSaveDatas aTmpSav;
         SwPaM aPam( rPos.nNode, rPos.nContent.GetIndex(),
                     rPos.nNode, rPos.nContent.GetIndex()+1 );
 
-        if( !FillSaveData( aPam, *pTmpSav, false ))
-            delete pTmpSav, pTmpSav = 0;
+        const bool bSaved = FillSaveData( aPam, aTmpSav, false );
 
-        bool bOk = ( !pRedlSaveData && !pTmpSav ) ||
-                   ( pRedlSaveData && pTmpSav &&
-                        SwUndo::CanRedlineGroup( *pRedlSaveData, *pTmpSav,
+        bool bOk = ( !pRedlSaveData && !bSaved ) ||
+                   ( pRedlSaveData && bSaved &&
+                        SwUndo::CanRedlineGroup( *pRedlSaveData, aTmpSav,
                             nSttCntnt > rPos.nContent.GetIndex() ));
-        delete pTmpSav;
+        // aTmpSav.DeleteAndDestroyAll();
         if( !bOk )
             return sal_False;
 
commit baed26b0c520e7d312f02d7d9990720d96942a94
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Mar 1 11:34:13 2014 +0100

    sal_uInt16 to size_t
    
    Change-Id: If3cbea546716b7476e362e9b19f4656b27ff34a2

diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 7baec1c..0fcdf5c 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -560,7 +560,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark,
             const bool bDelFwrd = rMark.nNode.GetIndex() <= rPoint.nNode.GetIndex();
             SwFlyFrmFmt* pFmt;
             const SwFmtAnchor* pAnchor;
-            sal_uInt16 n = rSpzArr.size();
+            size_t n = rSpzArr.size();
             const SwPosition* pAPos;
 
             while( n && !rSpzArr.empty() )
@@ -1061,7 +1061,7 @@ void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData )
     rDoc.SetRedlineMode_intern( (RedlineMode_t)(( eOld & ~nsRedlineMode_t::REDLINE_IGNORE) | nsRedlineMode_t::REDLINE_ON ));
     SwPaM aPam( rDoc.GetNodes().GetEndOfContent() );
 
-    for( sal_uInt16 n = rSData.size(); n; )
+    for( size_t n = rSData.size(); n; )
         rSData[ --n ]->RedlineToDoc( aPam );
 
 #if OSL_DEBUG_LEVEL > 0
@@ -1076,7 +1076,7 @@ void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData )
 
 bool SwUndo::HasHiddenRedlines( const SwRedlineSaveDatas& rSData )
 {
-    for( sal_uInt16 n = rSData.size(); n; )
+    for( size_t n = rSData.size(); n; )
         if( rSData[ --n ]->GetMvSttIdx() )
             return true;
     return false;
@@ -1086,7 +1086,7 @@ bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr,
                         const SwRedlineSaveDatas& rCheck, bool bCurrIsEnd )
 {
     bool bRet = false;
-    sal_uInt16 n;
+    size_t n;
 
     if( rCurr.size() == rCheck.size() )
     {
commit f46d23e242d6dd4c856392006ef21a86b1ea3a4f
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Sat Mar 1 00:28:30 2014 +0100

    sal_Bool to bool
    
    Change-Id: Ie04d9314f66bcda8e1c7939248af79a15fbdaaeb

diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 19889a9..1dcd5ca 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -57,12 +57,12 @@ protected:
     mutable OUString * pComment;
 
     void RemoveIdxFromSection( SwDoc&, sal_uLong nSttIdx, sal_uLong* pEndIdx = 0 );
-    void RemoveIdxFromRange( SwPaM& rPam, sal_Bool bMoveNext );
+    void RemoveIdxFromRange( SwPaM& rPam, bool bMoveNext );
     void RemoveIdxRel( sal_uLong, const SwPosition& );
 
-    static sal_Bool CanRedlineGroup( SwRedlineSaveDatas& rCurr,
+    static bool CanRedlineGroup( SwRedlineSaveDatas& rCurr,
                                 const SwRedlineSaveDatas& rCheck,
-                                sal_Bool bCurrIsEnd );
+                                bool bCurrIsEnd );
 
     /**
        Returns the rewriter for this object.
@@ -114,11 +114,11 @@ public:
     bool IsDelBox() const;
 
     // Save and set Redline data.
-    static sal_Bool FillSaveData( const SwPaM& rRange, SwRedlineSaveDatas& rSData,
-                            sal_Bool bDelRange = sal_True );
-    static sal_Bool FillSaveDataForFmt( const SwPaM& , SwRedlineSaveDatas& );
+    static bool FillSaveData( const SwPaM& rRange, SwRedlineSaveDatas& rSData,
+                              bool bDelRange = true );
+    static bool FillSaveDataForFmt( const SwPaM& , SwRedlineSaveDatas& );
     static void SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData );
-    static sal_Bool HasHiddenRedlines( const SwRedlineSaveDatas& rSData );
+    static bool HasHiddenRedlines( const SwRedlineSaveDatas& rSData );
 };
 
 typedef sal_uInt16 DelCntntType;
@@ -161,8 +161,8 @@ protected:
     // a range can be spanned for Undo/Redo. (In this case the SPoint
     // is before the manipulated range!!)
     // The flag indicates if there is content before the SPoint.
-    sal_Bool MovePtBackward( SwPaM& rPam );
-    void MovePtForward( SwPaM& rPam, sal_Bool bMvBkwrd );
+    bool MovePtBackward( SwPaM& rPam );
+    void MovePtForward( SwPaM& rPam, bool bMvBkwrd );
 
     // Before moving stuff into UndoNodes-Array care has to be taken that
     // the content-bearing attributes are removed from the nodes-array.
@@ -211,7 +211,7 @@ public:
     SwUndRng( const SwPaM& );
 
     void SetValues( const SwPaM& rPam );
-    void SetPaM( SwPaM&, sal_Bool bCorrToCntnt = sal_False ) const;
+    void SetPaM( SwPaM&, bool bCorrToCntnt = false ) const;
     SwPaM & AddUndoRedoPaM(
         ::sw::UndoRedoContext &, bool const bCorrToCntnt = false) const;
 };
@@ -225,7 +225,7 @@ class SwUndoInserts : public SwUndo, public SwUndRng, private SwUndoSaveCntnt
     std::vector<SwFrmFmt*>* pFrmFmts;
     ::std::vector< ::boost::shared_ptr<SwUndoInsLayFmt> > m_FlyUndos;
     SwRedlineData* pRedlData;
-    sal_Bool bSttWasTxtNd;
+    bool bSttWasTxtNd;
 protected:
     sal_uLong nNdDiff;
     /// start of Content in UndoNodes for Redo
@@ -241,8 +241,8 @@ public:
     virtual void RepeatImpl( ::sw::RepeatContext & );
 
     // Set destination range after reading.
-    void SetInsertRange( const SwPaM&, sal_Bool bScanFlys = sal_True,
-                        sal_Bool bSttWasTxtNd = sal_True );
+    void SetInsertRange( const SwPaM&, bool bScanFlys = true,
+                         bool bSttWasTxtNd = true );
 };
 
 class SwUndoInsDoc : public SwUndoInserts
@@ -264,7 +264,7 @@ protected:
     sal_uLong nNdPgPos;
     sal_Int32 nCntPos;         // Page at/in paragraph.
     sal_uInt16 nRndId;
-    sal_Bool bDelFmt;           // Delete saved format.
+    bool bDelFmt;           // Delete saved format.
 
     void InsFly(::sw::UndoRedoContext & rContext, bool bShowSel = true);
     void DelFly( SwDoc* );
@@ -298,7 +298,7 @@ public:
 
 class SwUndoDelLayFmt : public SwUndoFlyBase
 {
-    sal_Bool bShowSelFrm;
+    bool bShowSelFrm;
 public:
     SwUndoDelLayFmt( SwFrmFmt* pFormat );
 
@@ -307,7 +307,7 @@ public:
 
     void RedoForRollback();
 
-    void ChgShowSel( sal_Bool bNew ) { bShowSelFrm = bNew; }
+    void ChgShowSel( bool bNew ) { bShowSelFrm = bNew; }
 
     virtual SwRewriter GetRewriter() const;
 
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index b982138..b31918f 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -2565,7 +2565,7 @@ void SwDoc::AppendUndoForInsertFromDB( const SwPaM& rPam, sal_Bool bIsTable )
     else if( rPam.HasMark() )
     {
         SwUndoCpyDoc* pUndo = new SwUndoCpyDoc( rPam );
-        pUndo->SetInsertRange( rPam, sal_False );
+        pUndo->SetInsertRange( rPam, false );
         GetIDocumentUndoRedo().AppendUndo( pUndo );
     }
 }
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 2f0e373..4ec8d2c 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -912,7 +912,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
                         ( (pDestTxtNd && !pDestTxtNd->GetTxt().getLength()) ||
                           ( !bOneNode && !rPos.nContent.GetIndex() ) );
     bool bCopyBookmarks = true;
-    sal_Bool bStartIsTxtNode = 0 != pSttTxtNd;
+    bool bStartIsTxtNode = 0 != pSttTxtNd;
 
     // #i104585# copy outline num rule to clipboard (for ASCII filter)
     if (pDoc->IsClipBoard() && GetOutlineNumRule())
@@ -1094,7 +1094,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
             else if( rPos.nContent.GetIndex() )
             {   // Insertion in the middle of a text node, it has to be split
                 // (and joined from undo)
-                bStartIsTxtNode = sal_True;
+                bStartIsTxtNode = true;
 
                 const sal_Int32 nCntntEnd = pEnd->nContent.GetIndex();
                 {
@@ -1151,7 +1151,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
                 // will ensure that this node will be deleted during Undo
                 // using JoinNext.
                 OSL_ENSURE( !bStartIsTxtNode, "Oops, undo may be instable now." );
-                bStartIsTxtNode = sal_True;
+                bStartIsTxtNode = true;
             }
 
             // Save numrule at destination
@@ -1294,7 +1294,7 @@ bool SwDoc::CopyImpl( SwPaM& rPam, SwPosition& rPos,
     // If Undo is enabled, store the inserted area
     if (pDoc->GetIDocumentUndoRedo().DoesUndo())
     {
-        pUndo->SetInsertRange( *pCopyPam, sal_True, bStartIsTxtNode );
+        pUndo->SetInsertRange( *pCopyPam, true, bStartIsTxtNode );
     }
 
     if( pCpyRange )
diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx
index bb37fc7..5f85dda 100644
--- a/sw/source/core/inc/UndoCore.hxx
+++ b/sw/source/core/inc/UndoCore.hxx
@@ -159,7 +159,7 @@ class SwUndoSetFlyFmt : public SwUndo, public SwClient
     sal_uLong nOldNode, nNewNode;
     sal_Int32 nOldCntnt, nNewCntnt;
     sal_uInt16 nOldAnchorTyp, nNewAnchorTyp;
-    sal_Bool bAnchorChgd;
+    bool bAnchorChgd;
 
     void PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem );
     void Modify( const SfxPoolItem*, const SfxPoolItem* );
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index d7d8140..cca8bf0 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -543,7 +543,7 @@ SwHistoryTxtFlyCnt::SwHistoryTxtFlyCnt( SwFrmFmt* const pFlyFmt )
     , m_pUndo( new SwUndoDelLayFmt( pFlyFmt ) )
 {
     OSL_ENSURE( pFlyFmt, "SwHistoryTxtFlyCnt: no Format" );
-    m_pUndo->ChgShowSel( sal_False );
+    m_pUndo->ChgShowSel( false );
 }
 
 SwHistoryTxtFlyCnt::~SwHistoryTxtFlyCnt()
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index c69a31a..1091d1f 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -483,7 +483,7 @@ sal_Bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam )
 
     {
         SwRedlineSaveDatas* pTmpSav = new SwRedlineSaveDatas;
-        if( !FillSaveData( rDelPam, *pTmpSav, sal_False ))
+        if( !FillSaveData( rDelPam, *pTmpSav, false ))
             delete pTmpSav, pTmpSav = 0;
 
         bool bOk = ( !pRedlSaveData && !pTmpSav ) ||
@@ -956,7 +956,7 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext)
 
     if( pRedlSaveData )
     {
-        bool bSuccess = FillSaveData(rPam, *pRedlSaveData, sal_True);
+        const bool bSuccess = FillSaveData(rPam, *pRedlSaveData, true);
         OSL_ENSURE(bSuccess,
             "SwUndoDelete::Redo: used to have redline data, but now none?");
         if (!bSuccess)
@@ -968,7 +968,7 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext)
     if( !bDelFullPara )
     {
         SwUndRng aTmpRng( rPam );
-        RemoveIdxFromRange( rPam, sal_False );
+        RemoveIdxFromRange( rPam, false );
         aTmpRng.SetPaM( rPam );
 
         if( !bJoinNext )           // then restore selection from bottom to top
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 35cd84f..7baec1c 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -47,7 +47,6 @@ public:
         const SwPosition& rSttPos,
         const SwPosition& rEndPos,
         SwRangeRedline& rRedl );
-
     ~SwRedlineSaveData();
 
     void RedlineToDoc( SwPaM& rPam );
@@ -92,7 +91,7 @@ void SwUndRng::SetValues( const SwPaM& rPam )
     nSttCntnt = pStt->nContent.GetIndex();
 }
 
-void SwUndRng::SetPaM( SwPaM & rPam, sal_Bool bCorrToCntnt ) const
+void SwUndRng::SetPaM( SwPaM & rPam, bool bCorrToCntnt ) const
 {
     rPam.DeleteMark();
     rPam.GetPoint()->nNode = nSttNode;
@@ -138,7 +137,7 @@ void SwUndo::RemoveIdxFromSection( SwDoc& rDoc, sal_uLong nSttIdx,
     rDoc.CorrAbs( aIdx, aEndIdx, aPos, sal_True );
 }
 
-void SwUndo::RemoveIdxFromRange( SwPaM& rPam, sal_Bool bMoveNext )
+void SwUndo::RemoveIdxFromRange( SwPaM& rPam, bool bMoveNext )
 {
     const SwPosition* pEnd = rPam.End();
     if( bMoveNext )
@@ -431,20 +430,20 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx,
 // can span an area for a Undo/Redo. (The Point is then positioned in front of
 // the area to manipulate!)
 // The flag indicates if there is still content in front of Point.
-sal_Bool SwUndoSaveCntnt::MovePtBackward( SwPaM& rPam )
+bool SwUndoSaveCntnt::MovePtBackward( SwPaM& rPam )
 {
     rPam.SetMark();
     if( rPam.Move( fnMoveBackward ))
-        return sal_True;
+        return true;
 
     // If there is no content onwards, set Point simply to the previous position
     // (Node and Content, so that Content will be detached!)
     rPam.GetPoint()->nNode--;
     rPam.GetPoint()->nContent.Assign( 0, 0 );
-    return sal_False;
+    return false;
 }
 
-void SwUndoSaveCntnt::MovePtForward( SwPaM& rPam, sal_Bool bMvBkwrd )
+void SwUndoSaveCntnt::MovePtForward( SwPaM& rPam, bool bMvBkwrd )
 {
     // Was there content before this position?
     if( bMvBkwrd )
@@ -848,7 +847,7 @@ void SwUndoSaveSection::SaveSection(
     }
 
     pRedlSaveData = new SwRedlineSaveDatas;
-    if( !SwUndo::FillSaveData( aPam, *pRedlSaveData, sal_True ))
+    if( !SwUndo::FillSaveData( aPam, *pRedlSaveData, true ))
         delete pRedlSaveData, pRedlSaveData = 0;
 
     nStartPos = rRange.aStart.GetIndex();
@@ -994,10 +993,10 @@ void SwRedlineSaveData::RedlineToDoc( SwPaM& rPam )
     rDoc.SetRedlineMode_intern( eOld );
 }
 
-sal_Bool SwUndo::FillSaveData(
+bool SwUndo::FillSaveData(
     const SwPaM& rRange,
     SwRedlineSaveDatas& rSData,
-    sal_Bool bDelRange )
+    bool bDelRange )
 {
     rSData.DeleteAndDestroyAll();
 
@@ -1026,7 +1025,7 @@ sal_Bool SwUndo::FillSaveData(
     return !rSData.empty();
 }
 
-sal_Bool SwUndo::FillSaveDataForFmt(
+bool SwUndo::FillSaveDataForFmt(
     const SwPaM& rRange,
     SwRedlineSaveDatas& rSData )
 {
@@ -1075,23 +1074,23 @@ void SwUndo::SetSaveData( SwDoc& rDoc, const SwRedlineSaveDatas& rSData )
     rDoc.SetRedlineMode_intern( eOld );
 }
 
-sal_Bool SwUndo::HasHiddenRedlines( const SwRedlineSaveDatas& rSData )
+bool SwUndo::HasHiddenRedlines( const SwRedlineSaveDatas& rSData )
 {
     for( sal_uInt16 n = rSData.size(); n; )
         if( rSData[ --n ]->GetMvSttIdx() )
-            return sal_True;
-    return sal_False;
+            return true;
+    return false;
 }
 
-sal_Bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr,
-                        const SwRedlineSaveDatas& rCheck, sal_Bool bCurrIsEnd )
+bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr,
+                        const SwRedlineSaveDatas& rCheck, bool bCurrIsEnd )
 {
-    sal_Bool bRet = sal_False;
+    bool bRet = false;
     sal_uInt16 n;
 
     if( rCurr.size() == rCheck.size() )
     {
-        bRet = sal_True;
+        bRet = true;
         for( n = 0; n < rCurr.size(); ++n )
         {
             const SwRedlineSaveData& rSet = *rCurr[ n ];
@@ -1102,7 +1101,7 @@ sal_Bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr,
                              : rSet.nEndCntnt != rGet.nSttCntnt ) ||
                 !rGet.CanCombine( rSet ) )
             {
-                bRet = sal_False;
+                bRet = false;
                 break;
             }
         }
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index 68d27ce..ca00c41 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -142,12 +142,12 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm)
     case FLY_AT_PAGE:
         break;
     }
-    bDelFmt =  sal_False;
+    bDelFmt =  false;
 }
 
 void SwUndoFlyBase::DelFly( SwDoc* pDoc )
 {
-    bDelFmt = sal_True;                 // delete Format in DTOR
+    bDelFmt = true;                 // delete Format in DTOR
     pFrmFmt->DelFrms();                 // destroy Frms
 
     // all Uno objects should now log themselves off
@@ -225,7 +225,7 @@ SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, sal_uLong nNodeIdx, sal_Int
 {
     const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor();
     nRndId = static_cast<sal_uInt16>(rAnchor.GetAnchorId());
-    bDelFmt = sal_False;
+    bDelFmt = false;
     switch( nRndId )
     {
     case FLY_AT_PAGE:
@@ -391,7 +391,7 @@ lcl_GetSwUndoId(SwFrmFmt *const pFrmFmt)
 
 SwUndoDelLayFmt::SwUndoDelLayFmt( SwFrmFmt* pFormat )
     : SwUndoFlyBase( pFormat, lcl_GetSwUndoId(pFormat) )
-    , bShowSelFrm( sal_True )
+    , bShowSelFrm( true )
 {
     SwDoc* pDoc = pFormat->GetDoc();
     DelFly( pDoc );
@@ -456,7 +456,7 @@ SwUndoSetFlyFmt::SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt )
                                 rFlyFmt.GetAttrSet().GetRanges() )),
     nOldNode( 0 ), nNewNode( 0 ),
     nOldCntnt( 0 ), nNewCntnt( 0 ),
-    nOldAnchorTyp( 0 ), nNewAnchorTyp( 0 ), bAnchorChgd( sal_False )
+    nOldAnchorTyp( 0 ), nNewAnchorTyp( 0 ), bAnchorChgd( false )
 {
 }
 
@@ -633,7 +633,7 @@ void SwUndoSetFlyFmt::PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem )
             // only keep the first change
             OSL_ENSURE( !bAnchorChgd, "multiple changes of an anchor are not allowed!" );
 
-            bAnchorChgd = sal_True;
+            bAnchorChgd = true;
 
             const SwFmtAnchor* pAnchor = (SwFmtAnchor*)pItem;
             switch( nOldAnchorTyp = static_cast<sal_uInt16>(pAnchor->GetAnchorId()) )
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index 0a14799..31db7c8 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -256,7 +256,7 @@ void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext)
                         aPaM.GetPoint()->nContent.GetIndex(),
                         aPaM.GetMark()->nContent.GetIndex());
                 }
-                RemoveIdxFromRange( aPaM, sal_False );
+                RemoveIdxFromRange( aPaM, false );
                 pTxt = new OUString( pTxtNode->GetTxt().copy(nCntnt-nLen, nLen) );
                 pTxtNode->EraseText( aPaM.GetPoint()->nContent, nLen );
             }
@@ -265,7 +265,7 @@ void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext)
                 aPaM.Move(fnMoveBackward);
                 if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ))
                     pTmpDoc->DeleteRedline( aPaM, true, USHRT_MAX );
-                RemoveIdxFromRange( aPaM, sal_False );
+                RemoveIdxFromRange( aPaM, false );
             }
 
             nNd = aPaM.GetPoint()->nNode.GetIndex();
@@ -329,7 +329,7 @@ void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & rContext)
 
         if( nLen )
         {
-            sal_Bool bMvBkwrd = MovePtBackward( *pPam );
+            const bool bMvBkwrd = MovePtBackward( *pPam );
 
             if( pTxt )
             {
diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx
index 29b53c0..45ad54c 100644
--- a/sw/source/core/undo/unmove.cxx
+++ b/sw/source/core/undo/unmove.cxx
@@ -197,7 +197,7 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext)
             // #i17764# if redlines are to be moved, we may not remove them
             // before pDoc->Move gets a chance to handle them
             if( ! bMoveRedlines )
-                RemoveIdxFromRange( aPam, sal_False );
+                RemoveIdxFromRange( aPam, false );
 
             SwPosition aPos( *pDoc->GetNodes()[ nInsPosNode] );
             SwCntntNode* pCNd = aPos.nNode.GetNode().GetCntntNode();
@@ -286,7 +286,7 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext)
                                         nMvDestCntnt ));
 
         DelFtn( aPam );
-        RemoveIdxFromRange( aPam, sal_False );
+        RemoveIdxFromRange( aPam, false );
 
         aIdx = aPam.Start()->nNode;
         sal_Bool bJoinTxt = aIdx.GetNode().IsTxtNode();
diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx
index 3648132..8ef86d5 100644
--- a/sw/source/core/undo/unovwr.cxx
+++ b/sw/source/core/undo/unovwr.cxx
@@ -49,7 +49,7 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos,
         SwPaM aPam( rPos.nNode, rPos.nContent.GetIndex(),
                     rPos.nNode, rPos.nContent.GetIndex()+1 );
         pRedlSaveData = new SwRedlineSaveDatas;
-        if( !FillSaveData( aPam, *pRedlSaveData, sal_False ))
+        if( !FillSaveData( aPam, *pRedlSaveData, false ))
             delete pRedlSaveData, pRedlSaveData = 0;
     }
 
@@ -125,7 +125,7 @@ sal_Bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos,
         SwPaM aPam( rPos.nNode, rPos.nContent.GetIndex(),
                     rPos.nNode, rPos.nContent.GetIndex()+1 );
 
-        if( !FillSaveData( aPam, *pTmpSav, sal_False ))
+        if( !FillSaveData( aPam, *pTmpSav, false ))
             delete pTmpSav, pTmpSav = 0;
 
         bool bOk = ( !pRedlSaveData && !pTmpSav ) ||
diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx
index 465fd68..86f0ec8 100644
--- a/sw/source/core/undo/unredln.cxx
+++ b/sw/source/core/undo/unredln.cxx
@@ -58,7 +58,7 @@ SwUndoRedline::SwUndoRedline( SwUndoId nUsrId, const SwPaM& rRange )
     sal_uLong nEndExtra = rDoc.GetNodes().GetEndOfExtras().GetIndex();
 
     mpRedlSaveData = new SwRedlineSaveDatas;
-    if( !FillSaveData( rRange, *mpRedlSaveData, sal_False ))
+    if( !FillSaveData( rRange, *mpRedlSaveData, false ))
         delete mpRedlSaveData, mpRedlSaveData = 0;
     else
     {
@@ -116,7 +116,7 @@ void SwUndoRedline::RedoImpl(::sw::UndoRedoContext & rContext)
     if( mpRedlSaveData && mbHiddenRedlines )
     {
         sal_uLong nEndExtra = pDoc->GetNodes().GetEndOfExtras().GetIndex();
-        FillSaveData(rPam, *mpRedlSaveData, sal_False );
+        FillSaveData(rPam, *mpRedlSaveData, false );
 
         nEndExtra -= pDoc->GetNodes().GetEndOfExtras().GetIndex();
         nSttNode -= nEndExtra;
@@ -379,7 +379,7 @@ SwUndoCompDoc::SwUndoCompDoc( const SwRangeRedline& rRedl )
     }
 
     pRedlSaveData = new SwRedlineSaveDatas;
-    if( !FillSaveData( rRedl, *pRedlSaveData, sal_False ))
+    if( !FillSaveData( rRedl, *pRedlSaveData, false ))
         delete pRedlSaveData, pRedlSaveData = 0;
 }
 
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index b7bbbc7..df62334 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -34,7 +34,7 @@
 SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
     : SwUndo( nUndoId ), SwUndRng( rPam ),
     pTxtFmtColl( 0 ), pLastNdColl(0), pFrmFmts( 0 ), pRedlData( 0 ),
-    bSttWasTxtNd( sal_True ), nNdDiff( 0 ), nSetPos( 0 )
+    bSttWasTxtNd( true ), nNdDiff( 0 ), nSetPos( 0 )
 {
     pHistory = new SwHistory;
     SwDoc* pDoc = (SwDoc*)rPam.GetDoc();
@@ -76,8 +76,8 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam )
 }
 
 // set destination after reading input
-void SwUndoInserts::SetInsertRange( const SwPaM& rPam, sal_Bool bScanFlys,
-                                    sal_Bool bSttIsTxtNd )
+void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys,
+                                    bool bSttIsTxtNd )
 {
     const SwPosition* pTmpPos = rPam.End();
     nEndNode = pTmpPos->nNode.GetIndex();
@@ -95,7 +95,7 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, sal_Bool bScanFlys,
         if( !bSttIsTxtNd )      // if a table selection is added ...
         {
             ++nSttNode;         // ... than the CopyPam is not fully correct
-            bSttWasTxtNd = sal_False;
+            bSttWasTxtNd = false;
         }
     }
 
@@ -166,7 +166,7 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext)
                 pLastNdColl = pTxtNd->GetTxtColl();
         }
 
-        RemoveIdxFromRange( *pPam, sal_False );
+        RemoveIdxFromRange( *pPam, false );
         SetPaM(*pPam);
 
         // are there Footnotes or CntntFlyFrames in text?
@@ -256,7 +256,7 @@ void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & rContext)
     // retrieve start position for rollback
     if( ( nSttNode != nEndNode || nSttCntnt != nEndCntnt ) && m_pUndoNodeIndex)
     {
-        sal_Bool bMvBkwrd = MovePtBackward( *pPam );
+        const bool bMvBkwrd = MovePtBackward( *pPam );
 
         // re-insert content again (first detach m_pUndoNodeIndex!)
         sal_uLong const nMvNd = m_pUndoNodeIndex->GetIndex();
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index 0d2b443..5f1f937 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -307,7 +307,7 @@ sal_uLong SwReader::Read( const Reader& rOptions )
         if( bSaveUndo )
         {
             pDoc->SetRedlineMode_intern( eOld );
-            pUndo->SetInsertRange( *pUndoPam, sal_False );
+            pUndo->SetInsertRange( *pUndoPam, false );
             // UGLY: temp. enable undo
             pDoc->GetIDocumentUndoRedo().DoUndo(true);
             pDoc->GetIDocumentUndoRedo().AppendUndo( pUndo );
commit 04deb742f6bddf2881ab6c088ca212500d4931a1
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Fri Feb 28 00:37:25 2014 +0100

    Don't use tricks to get normal C++ features
    
    * Use "mutable" to allow modification of a flag, maintaining logical constness
    * No need to explicitly cast this to the base type inside a base class method
    
    Change-Id: I50c015ba977d93e82331c97259d9f9fb774bb198

diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx
index bd8300c..f102c53 100644
--- a/sw/source/core/inc/txmsrt.hxx
+++ b/sw/source/core/inc/txmsrt.hxx
@@ -152,7 +152,7 @@ struct SwTOXSortTabBase
     inline const ::com::sun::star::lang::Locale& GetLocale() const;
 
 private:
-    bool bValidTxt;
+    mutable bool bValidTxt;
     TextAndReading m_aSort;
 
     virtual TextAndReading GetText_Impl() const = 0;
@@ -162,9 +162,10 @@ inline TextAndReading SwTOXSortTabBase::GetTxt() const
 {
     if( !bValidTxt )
     {
-        SwTOXSortTabBase* pThis = (SwTOXSortTabBase*)this;
-        pThis->m_aSort = pThis->GetText_Impl();
-        pThis->bValidTxt = true;
+        // 'this' is 'SwTOXSortTabBase const*', so the virtual
+        // mechanism will call the derived class' GetText_Impl
+        GetText_Impl();
+        bValidTxt = true;
     }
     return m_aSort;
 }
commit 0d5652ab10721082f81d11df92ae69e7bce59856
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Thu Feb 27 08:58:26 2014 +0100

    sal_Bool to bool
    
    Change-Id: If63bfcfe4e16dd9232f3ef6fa29fadd0a6d01653

diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx
index ed11c7e..bd8300c 100644
--- a/sw/source/core/inc/txmsrt.hxx
+++ b/sw/source/core/inc/txmsrt.hxx
@@ -46,9 +46,9 @@ struct SwTOXSource
 {
     const SwCntntNode* pNd;
     sal_Int32 nPos;
-    sal_Bool bMainEntry;
+    bool bMainEntry;
 
-    SwTOXSource( const SwCntntNode* pNode, sal_Int32 n, sal_Bool bMain )
+    SwTOXSource( const SwCntntNode* pNode, sal_Int32 n, bool bMain )
         : pNd(pNode), nPos(n), bMainEntry(bMain)
     {
     }
@@ -109,10 +109,10 @@ public:
     OUString GetIndexKey( const TextAndReading& rTaR,
                         const ::com::sun::star::lang::Locale& rLcl ) const;
 
-    OUString GetFollowingText( sal_Bool bMorePages ) const;
+    OUString GetFollowingText( bool bMorePages ) const;
 
     OUString ToUpper( const OUString& rStr, sal_Int32 nPos ) const;
-    inline sal_Bool IsNumeric( const OUString& rStr ) const;
+    inline bool IsNumeric( const OUString& rStr ) const;
 };
 
 /*--------------------------------------------------------------------
@@ -152,7 +152,7 @@ struct SwTOXSortTabBase
     inline const ::com::sun::star::lang::Locale& GetLocale() const;
 
 private:
-    sal_Bool bValidTxt;
+    bool bValidTxt;
     TextAndReading m_aSort;
 
     virtual TextAndReading GetText_Impl() const = 0;
@@ -164,7 +164,7 @@ inline TextAndReading SwTOXSortTabBase::GetTxt() const
     {
         SwTOXSortTabBase* pThis = (SwTOXSortTabBase*)this;
         pThis->m_aSort = pThis->GetText_Impl();
-        pThis->bValidTxt = sal_True;
+        pThis->bValidTxt = true;
     }
     return m_aSort;
 }
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 36701c0..13dd345 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -104,7 +104,7 @@ OUString SwTOXInternational::ToUpper( const OUString& rStr, sal_Int32 nPos ) con
     return pCharClass->uppercase( rStr, nPos, 1 );
 }
 
-inline sal_Bool SwTOXInternational::IsNumeric( const OUString& rStr ) const
+inline bool SwTOXInternational::IsNumeric( const OUString& rStr ) const
 {
     return pCharClass->isNumeric( rStr );
 }
@@ -124,7 +124,7 @@ OUString SwTOXInternational::GetIndexKey( const TextAndReading& rTaR,
     return pIndexWrapper->GetIndexKey( rTaR.sText, rTaR.sReading, rLocale );
 }
 
-OUString SwTOXInternational::GetFollowingText( sal_Bool bMorePages ) const
+OUString SwTOXInternational::GetFollowingText( bool bMorePages ) const
 {
     return pIndexWrapper->GetFollowingText( bMorePages );
 }
@@ -138,7 +138,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd,
                                     const SwTOXInternational* pInter,
                                     const lang::Locale* pLocale )
     : pTOXNd( 0 ), pTxtMark( pMark ), pTOXIntl( pInter ),
-    nPos( 0 ), nCntPos( 0 ), nType( static_cast<sal_uInt16>(nTyp) ), bValidTxt( sal_False )
+    nPos( 0 ), nCntPos( 0 ), nType( static_cast<sal_uInt16>(nTyp) ), bValidTxt( false )
 {
     if ( pLocale )
         aLocale = *pLocale;
@@ -148,8 +148,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd,
         sal_Int32 n = 0;
         if( pTxtMark )
             n = *pTxtMark->GetStart();
-        SwTOXSource aTmp( pNd, n,
-                    pTxtMark ? pTxtMark->GetTOXMark().IsMainEntry() : sal_False );
+        SwTOXSource aTmp( pNd, n, pTxtMark && pTxtMark->GetTOXMark().IsMainEntry() );
         aTOXSources.push_back(aTmp);
 
         nPos = pNd->GetIndex();
commit b5143005653c1c505a6f648519f0d54f8b152dde
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Thu Feb 27 00:08:21 2014 +0100

    pProgress is always NULL
    
    Change-Id: I278103075582a0f0a5cde7b749db408c5912f82e

diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index 5d3f254..dade560 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -30,8 +30,6 @@ class SwTabFrm;
 class SwViewImp;
 class SwCntntNode;
 class SwWait;
-// #i28701#
-class SfxProgress;
 
 // The usage of LayAction is always the same:
 
@@ -57,8 +55,6 @@ class SwLayAction
 
     SwWait *pWait;
 
-    SfxProgress * pProgress;
-
     //Wenn ein Absatz - oder was auch immer - bei der Formatierung mehr
     //als eine Seite rueckwaerts floss traegt er seine neue Seitennummer
     //hier ein. Die Steuerung der InternalAction kann dann geeignet reagieren.
@@ -159,8 +155,6 @@ public:
 
     void SetAgain()         { bAgain = sal_True; }
     void SetUpdateExpFlds() {bUpdateExpFlds = sal_True; }
-    void SetProgress(SfxProgress * _pProgress = NULL)
-    { pProgress = _pProgress; }
 
     inline void SetCheckPageNum( sal_uInt16 nNew );
     inline void SetCheckPageNumDirect( sal_uInt16 nNew ) { nCheckPageNum = nNew; }
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index b484a74..bfadb99 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -60,7 +60,6 @@
 #include <fmtsrnd.hxx>
 #include <fmtanchr.hxx>
 #include <tools/shl.hxx>
-#include <sfx2/progress.hxx>
 #include <docsh.hxx>
 
 #include "swmodule.hxx"
@@ -117,7 +116,6 @@ static void BreakPoint()
     { \
         if ( IsReschedule() )  \
         { \
-            if (pProgress) pProgress->Reschedule(); \
             ::RescheduleProgress( pImp->GetShell()->GetDoc()->GetDocShell() ); \
         } \
     }
@@ -311,7 +309,6 @@ SwLayAction::SwLayAction( SwRootFrm *pRt, SwViewImp *pI ) :
     pImp( pI ),
     pOptTab( 0 ),
     pWait( 0 ),
-    pProgress(NULL),
     nPreInvaPage( USHRT_MAX ),
     nStartTicks( Ticks() ),
     nInputType( 0 ),
commit 7f7e8673d382037b1e1851122a1aa5251976232d
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Wed Feb 26 23:52:09 2014 +0100

    bStopPrt is always false
    
    Change-Id: I14559b1360ae9f845e0054c5125f1280d9786dff

diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index b778d67..5d3f254 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -143,8 +143,7 @@ public:
     sal_Bool IsIdle()               const       { return bIdle;  }
     sal_Bool IsReschedule()         const       { return bReschedule;  }
     bool IsPaintExtraData()     const       { return bPaintExtraData;}
-    sal_Bool IsStopPrt()          const;
-    sal_Bool IsInterrupt()        const { return IsInput() || IsStopPrt(); }
+    sal_Bool IsInterrupt()        const { return IsInput(); }
 
     sal_uInt16 GetInputType()    const { return nInputType; }
 #endif
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index 0147c5a..564248d 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -85,27 +85,12 @@ class SwViewImp
     bool bResetHdlHiddenPaint : 1;//  -- "" --
     bool bSmoothUpdate : 1; //Meber fuer SmoothScroll
     bool bStopSmooth : 1;
-    bool bStopPrt : 1; // Stop Printing
 
     sal_uInt16 nRestoreActions  ; //Die Anzahl der zu restaurierenden Actions (UNO)
     SwRect aSmoothRect;
 
     SwPagePreviewLayout* mpPgPreviewLayout;
 
-    /**
-       Returns if printer shall be stopped.
-
-       @retval true The printer shall be stopped.
-       @retval false else
-    */
-    bool IsStopPrt() { return bStopPrt; }
-
-    /**
-       Resets signal for stopping printing.
-
-    */
-    void ResetStopPrt() { bStopPrt = false; }
-
     void SetFirstVisPage();     //Neue Ermittlung der ersten sichtbaren Seite
 
     void StartAction();         //Henkel Anzeigen und verstecken.
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 1420c83..b484a74 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -741,7 +741,7 @@ void SwLayAction::InternalAction()
             pPg = pPg ? (SwPageFrm*)pPg->GetPrev() : pPage;
 
         // set flag for interrupt content formatting
-        mbFormatCntntOnInterrupt = IsInput() && !IsStopPrt();
+        mbFormatCntntOnInterrupt = IsInput();
         long nBottom = rVis.Bottom();
         // #i42586# - format current page, if idle action is active
         // This is an optimization for the case that the interrupt is created by
@@ -1921,16 +1921,6 @@ sal_Bool SwLayAction::_FormatFlyCntnt( const SwFlyFrm *pFly )
     return !(IsInterrupt() && !mbFormatCntntOnInterrupt);
 }
 
-sal_Bool SwLayAction::IsStopPrt() const
-{
-    sal_Bool bResult = sal_False;
-
-    if (pImp != NULL && pProgress != NULL)
-        bResult = pImp->IsStopPrt();
-
-    return bResult;
-}
-
 sal_Bool SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob )
 {
     OSL_ENSURE( pCnt->IsTxtFrm(), "NoTxt neighbour of Txt" );
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 1bcf8e01..511b2c4 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -102,7 +102,6 @@ SwViewImp::SwViewImp( SwViewShell *pParent ) :
     bResetHdlHiddenPaint( false ),
     bSmoothUpdate( false ),
     bStopSmooth( false ),
-    bStopPrt( false ),
     nRestoreActions( 0 ),
     // OD 12.12.2002 #103492#
     mpPgPreviewLayout( 0 )
commit 2d7ece16a2dcc3c9af46b7a39c2ed36f00203f36
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Wed Feb 26 23:33:08 2014 +0100

    sal_Bool to bool
    
    Change-Id: Iad75baebdf868cdd2ad13d23299385564277010e

diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index a5b7395..0147c5a 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -81,13 +81,11 @@ class SwViewImp
     mutable const SdrObject * pSdrObjCached;
     mutable OUString sSdrObjCachedComment;
 
-    sal_Bool bFirstPageInvalid  :1; //Pointer auf erste Seite ungueltig?
-
-    sal_Bool bResetHdlHiddenPaint:1;//  -- "" --
-
-    sal_Bool bSmoothUpdate      :1; //Meber fuer SmoothScroll
-    sal_Bool bStopSmooth        :1;
-    sal_Bool bStopPrt           :1; // Stop Printing
+    bool bFirstPageInvalid : 1; //Pointer auf erste Seite ungueltig?
+    bool bResetHdlHiddenPaint : 1;//  -- "" --
+    bool bSmoothUpdate : 1; //Meber fuer SmoothScroll
+    bool bStopSmooth : 1;
+    bool bStopPrt : 1; // Stop Printing
 
     sal_uInt16 nRestoreActions  ; //Die Anzahl der zu restaurierenden Actions (UNO)
     SwRect aSmoothRect;
@@ -97,16 +95,16 @@ class SwViewImp
     /**
        Returns if printer shall be stopped.
 
-       @retval sal_True The printer shall be stopped.
-       @retval sal_False else
+       @retval true The printer shall be stopped.
+       @retval false else
     */
-    sal_Bool IsStopPrt() { return bStopPrt; }
+    bool IsStopPrt() { return bStopPrt; }
 
     /**
        Resets signal for stopping printing.
 
     */
-    void ResetStopPrt() { bStopPrt = sal_False; }
+    void ResetStopPrt() { bStopPrt = false; }
 
     void SetFirstVisPage();     //Neue Ermittlung der ersten sichtbaren Seite
 
@@ -167,14 +165,14 @@ public:
     //Verwaltung zur ersten sichtbaren Seite
     inline const SwPageFrm *GetFirstVisPage() const;
     inline       SwPageFrm *GetFirstVisPage();
-    void SetFirstVisPageInvalid() { bFirstPageInvalid = sal_True; }
+    void SetFirstVisPageInvalid() { bFirstPageInvalid = true; }
 
-    sal_Bool AddPaintRect( const SwRect &rRect );
+    bool AddPaintRect( const SwRect &rRect );
     SwRegionRects *GetRegion()      { return pRegion; }
     void DelRegion();
 
     // neues Interface fuer StarView Drawing
-    inline sal_Bool HasDrawView()       const { return 0 != pDrawView; }
+    bool  HasDrawView()             const { return 0 != pDrawView; }
           SwDrawView* GetDrawView()       { return pDrawView; }
     const SwDrawView* GetDrawView() const { return pDrawView; }
           SdrPageView*GetPageView()       { return pSdrPageView; }
@@ -202,12 +200,12 @@ public:
     //gepaintet wird oder nicht.
 
     // Interface Drawing
-    sal_Bool IsDragPossible( const Point &rPoint );
+    bool IsDragPossible( const Point &rPoint );
     void NotifySizeChg( const Size &rNewSz );
 
     //SS Fuer die Lay- bzw. IdleAction und verwandtes
-    sal_Bool  IsAction() const                   { return pLayAct  != 0; }
-    sal_Bool  IsIdleAction() const               { return pIdleAct != 0; }
+    bool  IsAction() const                   { return pLayAct  != 0; }
+    bool  IsIdleAction() const               { return pIdleAct != 0; }
           SwLayAction &GetLayAction()        { return *pLayAct; }
     const SwLayAction &GetLayAction() const  { return *pLayAct; }
           SwLayIdle   &GetIdleAction()       { return *pIdleAct;}
@@ -216,10 +214,10 @@ public:
     //Wenn eine Aktion laueft wird diese gebeten zu pruefen ob es
     //an der zeit ist den WaitCrsr einzuschalten.
     void CheckWaitCrsr();
-    sal_Bool IsCalcLayoutProgress() const;  //Fragt die LayAction wenn vorhanden.
-    //sal_True wenn eine LayAction laeuft, dort wird dann auch das Flag fuer
+    bool IsCalcLayoutProgress() const;  //Fragt die LayAction wenn vorhanden.
+    //true wenn eine LayAction laeuft, dort wird dann auch das Flag fuer
     //ExpressionFields gesetzt.
-    sal_Bool IsUpdateExpFlds();
+    bool IsUpdateExpFlds();
 
     void    SetRestoreActions(sal_uInt16 nSet){nRestoreActions = nSet;}
     sal_uInt16  GetRestoreActions() const{return nRestoreActions;}
@@ -232,7 +230,7 @@ public:
     }
 
     // Is this view accessible?
-    sal_Bool IsAccessible() const { return pAccMap != 0; }
+    bool IsAccessible() const { return pAccMap != 0; }
 
     inline SwAccessibleMap& GetAccessibleMap();
 
@@ -241,9 +239,9 @@ public:
 
     // Remove a frame from the accessible view
     void DisposeAccessible( const SwFrm *pFrm, const SdrObject *pObj,
-                            sal_Bool bRecursive );
+                            bool bRecursive );
     inline void DisposeAccessibleFrm( const SwFrm *pFrm,
-                               sal_Bool bRecursive=sal_False );
+                               bool bRecursive = false );
     inline void DisposeAccessibleObj( const SdrObject *pObj );
 
     // Move a frame's position in the accessible view
@@ -267,7 +265,7 @@ public:
     void InvalidateAccessibleCursorPosition( const SwFrm *pFrm );
 
     // Invalidate editable state for all accessible frames
-    void InvalidateAccessibleEditableState( sal_Bool bAllShells=sal_True,
+    void InvalidateAccessibleEditableState( bool bAllShells = true,
                                                const SwFrm *pFrm=0 );
 
     // Invalidate frame's relation set (for chained frames)
@@ -310,14 +308,14 @@ inline SwAccessibleMap& SwViewImp::GetAccessibleMap()
 }
 
 inline void SwViewImp::DisposeAccessibleFrm( const SwFrm *pFrm,
-                               sal_Bool bRecursive )
+                               bool bRecursive )
 {
     DisposeAccessible( pFrm, 0, bRecursive );
 }
 
 inline void SwViewImp::DisposeAccessibleObj( const SdrObject *pObj )
 {
-    DisposeAccessible( 0, pObj, sal_False );
+    DisposeAccessible( 0, pObj, false );
 }
 
 inline void SwViewImp::MoveAccessibleFrm( const SwFrm *pFrm,
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 8dc757f..df97a35 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -245,7 +245,7 @@ SwFlyFrm::~SwFlyFrm()
             {
                 // Lowers aren't disposed already, so we have to do a recursive
                 // dispose
-                pVSh->Imp()->DisposeAccessibleFrm( this, sal_True );
+                pVSh->Imp()->DisposeAccessibleFrm( this, true );
             }
         }
     }
@@ -798,7 +798,7 @@ void SwFlyFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
             {
                 SwRootFrm* pLayout = getRootFrm();
                 if( pLayout && pLayout->IsAnyShellAccessible() )
-                pSh->Imp()->InvalidateAccessibleEditableState( sal_True, this );
+                pSh->Imp()->InvalidateAccessibleEditableState( true, this );
             }
             break;
             }
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index d61010b..ce7e0e9 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -670,7 +670,7 @@ void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
         static_cast< SwRootFrm * >( GetUpper() )->GetCurrShell() )
     {
         static_cast< SwRootFrm * >( GetUpper() )->GetCurrShell()->Imp()
-                                  ->DisposeAccessibleFrm( pToRemove, sal_True );
+                                  ->DisposeAccessibleFrm( pToRemove, true );
     }
 
     // #i28701# - use new method <SetPageFrm(..)>
@@ -706,7 +706,7 @@ void SwPageFrm::MoveFly( SwFlyFrm *pToMove, SwPageFrm *pDest )
         static_cast< SwRootFrm * >( GetUpper() )->GetCurrShell() )
     {
         static_cast< SwRootFrm * >( GetUpper() )->GetCurrShell()->Imp()
-                                  ->DisposeAccessibleFrm( pToMove, sal_True );
+                                  ->DisposeAccessibleFrm( pToMove, true );
     }
 
     // The FlyColl might be gone already, because the page's dtor is being executed.
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index d98fb0d..bcc5d10 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2403,7 +2403,7 @@ void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew
             {
                 SwViewShell *pSh = getRootFrm()->GetCurrShell();
                 if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
-                    pSh->Imp()->InvalidateAccessibleEditableState( sal_True, this );
+                    pSh->Imp()->InvalidateAccessibleEditableState( true, this );
             }
             break;
 
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 5cd6643..385a98d 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -4450,7 +4450,7 @@ SwCellFrm::~SwCellFrm()
         if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
             pRootFrm->GetCurrShell() )
         {
-            pRootFrm->GetCurrShell()->Imp()->DisposeAccessibleFrm( this, sal_True );
+            pRootFrm->GetCurrShell()->Imp()->DisposeAccessibleFrm( this, true );
         }
 
         pMod->Remove( this );           // remove,
@@ -4966,7 +4966,7 @@ void SwCellFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
     {
         SwViewShell *pSh = getRootFrm()->GetCurrShell();
         if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
-            pSh->Imp()->InvalidateAccessibleEditableState( sal_True, this );
+            pSh->Imp()->InvalidateAccessibleEditableState( true, this );
     }
 
     if ( bAttrSetChg &&
diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx
index 9e56b1b..da212ef 100644
--- a/sw/source/core/view/pagepreviewlayout.cxx
+++ b/sw/source/core/view/pagepreviewlayout.cxx
@@ -1046,7 +1046,7 @@ bool SwPagePreviewLayout::Paint( const Rectangle  _aOutRect ) const
     // prepare paint
     if ( maPreviewPages.size() > 0 )
     {
-        mrParentViewShell.Imp()->bFirstPageInvalid = sal_False;
+        mrParentViewShell.Imp()->bFirstPageInvalid = false;
         mrParentViewShell.Imp()->pFirstVisPage =
                 const_cast<SwPageFrm*>(maPreviewPages[0]->pPage);
     }
@@ -1195,7 +1195,7 @@ void SwPagePreviewLayout::Repaint( const Rectangle _aInvalidCoreRect ) const
     // prepare paint
     if ( maPreviewPages.size() > 0 )
     {
-        mrParentViewShell.Imp()->bFirstPageInvalid = sal_False;
+        mrParentViewShell.Imp()->bFirstPageInvalid = false;
         mrParentViewShell.Imp()->pFirstVisPage =
                 const_cast<SwPageFrm*>(maPreviewPages[0]->pPage);
     }
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index 6873a05..a04021b 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -72,7 +72,7 @@ void SwViewImp::LockPaint()
     }
     else
     {
-        bResetHdlHiddenPaint = sal_False;
+        bResetHdlHiddenPaint = false;
     }
 }
 
@@ -154,15 +154,15 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID,
 
 #define FUZZY_EDGE 400
 
-sal_Bool SwViewImp::IsDragPossible( const Point &rPoint )
+bool SwViewImp::IsDragPossible( const Point &rPoint )
 {
     if ( !HasDrawView() )
-        return sal_False;
+        return false;
 
     const SdrMarkList &rMrkList = GetDrawView()->GetMarkedObjectList();
 
     if( !rMrkList.GetMarkCount() )
-        return sal_False;
+        return false;
 
     SdrObject *pO = rMrkList.GetMark(rMrkList.GetMarkCount()-1)->GetMarkedSdrObj();
 
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 8527687..1bcf8e01 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -98,13 +98,15 @@ SwViewImp::SwViewImp( SwViewShell *pParent ) :
     pIdleAct( 0 ),
     pAccMap( 0 ),
     pSdrObjCached(NULL),
+    bFirstPageInvalid( true ),
+    bResetHdlHiddenPaint( false ),
+    bSmoothUpdate( false ),
+    bStopSmooth( false ),
+    bStopPrt( false ),
     nRestoreActions( 0 ),
     // OD 12.12.2002 #103492#
     mpPgPreviewLayout( 0 )
 {
-    bResetHdlHiddenPaint =
-    bSmoothUpdate = bStopSmooth = bStopPrt = sal_False;
-    bFirstPageInvalid = sal_True;
 }
 
 SwViewImp::~SwViewImp()
@@ -131,16 +133,16 @@ void SwViewImp::DelRegion()
     DELETEZ(pRegion);
 }
 
-sal_Bool SwViewImp::AddPaintRect( const SwRect &rRect )
+bool SwViewImp::AddPaintRect( const SwRect &rRect )
 {
     if ( rRect.IsOver( pSh->VisArea() ) )
     {
         if ( !pRegion )
             pRegion = new SwRegionRects( pSh->VisArea() );
         (*pRegion) -= rRect;
-        return sal_True;
+        return true;
     }
-    return sal_False;
+    return false;
 }
 
 void SwViewImp::CheckWaitCrsr()
@@ -149,21 +151,19 @@ void SwViewImp::CheckWaitCrsr()
         pLayAct->CheckWaitCrsr();
 }
 
-sal_Bool SwViewImp::IsCalcLayoutProgress() const
+bool SwViewImp::IsCalcLayoutProgress() const
 {
-    if ( pLayAct )
-        return pLayAct->IsCalcLayout();
-    return sal_False;
+    return pLayAct && pLayAct->IsCalcLayout();
 }
 
-sal_Bool SwViewImp::IsUpdateExpFlds()
+bool SwViewImp::IsUpdateExpFlds()
 {
     if ( pLayAct && pLayAct->IsCalcLayout() )
     {
         pLayAct->SetUpdateExpFlds();
-        return sal_True;
+        return true;
     }
-     return sal_False;
+    return false;
 }
 
 void SwViewImp::SetFirstVisPage()
@@ -199,7 +199,7 @@ void SwViewImp::SetFirstVisPage()
         }
         pFirstVisPage = pPage ? pPage : (SwPageFrm*)pSh->GetLayout()->Lower();
     }
-    bFirstPageInvalid = sal_False;
+    bFirstPageInvalid = false;
 }
 
 void SwViewImp::MakeDrawView()
@@ -288,7 +288,7 @@ void SwViewImp::UpdateAccessible()
 
 void SwViewImp::DisposeAccessible( const SwFrm *pFrm,
                                    const SdrObject *pObj,
-                                   sal_Bool bRecursive )
+                                   bool bRecursive )
 {
     OSL_ENSURE( !pFrm || pFrm->IsAccessibleFrm(), "frame is not accessible" );
     SwViewShell *pVSh = GetShell();
@@ -353,7 +353,7 @@ void SwViewImp::InvalidateAccessibleCursorPosition( const SwFrm *pFrm )
         GetAccessibleMap().InvalidateCursorPosition( pFrm );
 }
 
-void SwViewImp::InvalidateAccessibleEditableState( sal_Bool bAllShells,
+void SwViewImp::InvalidateAccessibleEditableState( bool bAllShells,
                                                       const SwFrm *pFrm )
 {
     if( bAllShells )
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 87545b5..7659f76 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1176,7 +1176,7 @@ sal_Bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *p
 
     if(bSmoothScrollAllowed)
     {
-        Imp()->bStopSmooth = sal_False;
+        Imp()->bStopSmooth = false;
 
         const SwRect aOldVis( VisArea() );
 
@@ -1320,9 +1320,9 @@ sal_Bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *p
                         Imp()->aSmoothRect.Top( VisArea().Bottom() + lScroll - aPixSz.Height());
                     }
 
-                    Imp()->bSmoothUpdate = sal_True;
+                    Imp()->bSmoothUpdate = true;
                     GetWin()->Update();
-                    Imp()->bSmoothUpdate = sal_False;
+                    Imp()->bSmoothUpdate = false;
 
                     if(!Imp()->bStopSmooth)
                     {
@@ -1621,7 +1621,7 @@ void SwViewShell::Paint(const Rectangle &rRect)
         {
             SwRect aTmp( rRect );
             if ( !Imp()->aSmoothRect.IsInside( aTmp ) )
-                Imp()->bStopSmooth = sal_True;
+                Imp()->bStopSmooth = true;
             else
             {
                 Imp()->aSmoothRect = aTmp;
@@ -2226,7 +2226,7 @@ void SwViewShell::SetReadonlyOption(sal_Bool bSet)
         else if ( GetWin() )
             GetWin()->Invalidate();
         if( Imp()->IsAccessible() )
-            Imp()->InvalidateAccessibleEditableState( sal_False );
+            Imp()->InvalidateAccessibleEditableState( false );
     }
 }
 
commit a8155e3d77817453b2df85d5ac3e652eb901d203
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Wed Feb 26 23:18:01 2014 +0100

    sal_Bool to bool
    
    Change-Id: Ib1db475feea0f8fdbb724273cc368f41d39e50c8

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 2a2d4fa..a797fb5 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -586,7 +586,7 @@ void SwTxtPaintInfo::_DrawText( const OUString &rText, const SwLinePortion &rPor
     if ( ! IsMulti() )
         nComp = GetKanaComp();
 
-    sal_Bool bCfgIsAutoGrammar = sal_False;
+    bool bCfgIsAutoGrammar = false;
     SvtLinguConfig().GetProperty( UPN_IS_GRAMMAR_AUTO ) >>= bCfgIsAutoGrammar;
     const bool bBullet = OnWin() && GetOpt().IsBlank() && IsNoSymbol();
     const bool bTmpWrong = bWrong && OnWin() && GetOpt().IsOnlineSpell();


More information about the Libreoffice-commits mailing list