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

Caolán McNamara caolanm at redhat.com
Wed Oct 2 08:49:23 PDT 2013


 sw/source/core/doc/docdraw.cxx     |    8 
 sw/source/core/doc/docedt.cxx      |    2 
 sw/source/core/doc/docglbl.cxx     |   54 +++---
 sw/source/core/doc/doclay.cxx      |    2 
 sw/source/core/doc/docnew.cxx      |    4 
 sw/source/core/doc/docredln.cxx    |    2 
 sw/source/core/doc/number.cxx      |    4 
 sw/source/core/docnode/node.cxx    |    9 -
 sw/source/core/inc/UndoManager.hxx |    6 
 sw/source/core/undo/docundo.cxx    |   14 -
 sw/source/filter/ww8/ww8atr.cxx    |  317 ++++++++++++++++++-------------------
 sw/source/filter/ww8/ww8par2.cxx   |   10 -
 sw/source/filter/ww8/ww8par5.cxx   |    3 
 sw/source/ui/app/docsh2.cxx        |    2 
 sw/source/ui/index/cnttab.cxx      |   56 +++---
 sw/source/ui/misc/outline.cxx      |   10 -
 sw/source/ui/uiview/view2.cxx      |    6 
 17 files changed, 248 insertions(+), 261 deletions(-)

New commits:
commit d66af0955d917d509192ca5892f2504edc41c1ec
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Oct 2 16:32:05 2013 +0100

    murder an auto_ptr
    
    Change-Id: I46b07d117e5e452dbd2e50e0d4a04e6713e25945
    Reviewed-on: https://gerrit.libreoffice.org/6112
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 605b9b8..d4ba831 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -185,10 +185,8 @@ SwDoc::SwDoc()
     mpAttrPool(new SwAttrPool(this)),
     mpMarkManager(new ::sw::mark::MarkManager(*this)),
     m_pMetaFieldManager(new ::sw::MetaFieldManager()),
-    SAL_WNODEPRECATED_DECLARATIONS_PUSH
     m_pUndoManager(new ::sw::UndoManager(
-            ::std::auto_ptr<SwNodes>(new SwNodes(this)), *this, *this, *this)),
-    SAL_WNODEPRECATED_DECLARATIONS_POP
+            boost::shared_ptr<SwNodes>(new SwNodes(this)), *this, *this, *this)),
     mpDfltFrmFmt( new SwFrmFmt( GetAttrPool(), sFrmFmtStr, 0 ) ),
     mpEmptyPageFmt( new SwFrmFmt( GetAttrPool(), sEmptyPageStr, mpDfltFrmFmt ) ),
     mpColumnContFmt( new SwFrmFmt( GetAttrPool(), sColumnCntStr, mpDfltFrmFmt ) ),
diff --git a/sw/source/core/inc/UndoManager.hxx b/sw/source/core/inc/UndoManager.hxx
index c470a68..bf0ac20 100644
--- a/sw/source/core/inc/UndoManager.hxx
+++ b/sw/source/core/inc/UndoManager.hxx
@@ -21,7 +21,7 @@
 #define SW_UNDO_MANAGER_HXX
 
 #include <IDocumentUndoRedo.hxx>
-#include <memory>
+#include <boost/shared_ptr.hpp>
 #include <svx/sdrundomanager.hxx>
 
 class IDocumentDrawModelAccess;
@@ -35,7 +35,7 @@ class UndoManager
     , public SdrUndoManager
 {
 public:
-    UndoManager(::std::auto_ptr<SwNodes> pUndoNodes,
+    UndoManager(boost::shared_ptr<SwNodes> pUndoNodes,
         IDocumentDrawModelAccess & rDrawModelAccess,
         IDocumentRedlineAccess & rRedlineAccess,
         IDocumentState & rState);
@@ -90,7 +90,7 @@ private:
     IDocumentState & m_rState;
 
     /// Undo nodes array: content not currently in document
-    ::std::auto_ptr<SwNodes> m_pUndoNodes;
+    boost::shared_ptr<SwNodes> m_xUndoNodes;
 
     bool m_bGroupUndo       : 1;    // TRUE: Undo grouping enabled
     bool m_bDrawUndo        : 1;    // TRUE: Draw Undo enabled
diff --git a/sw/source/core/undo/docundo.cxx b/sw/source/core/undo/docundo.cxx
index cbe642c..3e690e4 100644
--- a/sw/source/core/undo/docundo.cxx
+++ b/sw/source/core/undo/docundo.cxx
@@ -48,40 +48,38 @@ using namespace ::com::sun::star;
 
 namespace sw {
 
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-UndoManager::UndoManager(::std::auto_ptr<SwNodes> pUndoNodes,
+UndoManager::UndoManager(boost::shared_ptr<SwNodes> xUndoNodes,
             IDocumentDrawModelAccess & rDrawModelAccess,
             IDocumentRedlineAccess & rRedlineAccess,
             IDocumentState & rState)
     :   m_rDrawModelAccess(rDrawModelAccess)
     ,   m_rRedlineAccess(rRedlineAccess)
     ,   m_rState(rState)
-    ,   m_pUndoNodes(pUndoNodes)
+    ,   m_xUndoNodes(xUndoNodes)
     ,   m_bGroupUndo(true)
     ,   m_bDrawUndo(true)
     ,   m_bLockUndoNoModifiedPosition(false)
     ,   m_UndoSaveMark(MARK_INVALID)
 {
-    OSL_ASSERT(m_pUndoNodes.get());
+    OSL_ASSERT(m_xUndoNodes.get());
     // writer expects it to be disabled initially
     // Undo is enabled by SwEditShell constructor
     SdrUndoManager::EnableUndo(false);
 }
-SAL_WNODEPRECATED_DECLARATIONS_POP
 
 SwNodes const& UndoManager::GetUndoNodes() const
 {
-    return *m_pUndoNodes;
+    return *m_xUndoNodes;
 }
 
 SwNodes      & UndoManager::GetUndoNodes()
 {
-    return *m_pUndoNodes;
+    return *m_xUndoNodes;
 }
 
 bool UndoManager::IsUndoNodes(SwNodes const& rNodes) const
 {
-    return & rNodes == m_pUndoNodes.get();
+    return & rNodes == m_xUndoNodes.get();
 }
 
 void UndoManager::DoUndo(bool const bDoUndo)
commit 0dfaa5ff93a1dc1bffd8dbe49a00941e99113fbb
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date:   Sun Sep 29 18:57:46 2013 +0200

    fix format for code consistency
    
    Conflicts:
    	sw/source/core/doc/docglbl.cxx
    	sw/source/filter/ww8/ww8par2.cxx
    
    Change-Id: I8deb4ecf2714f29d53e0653ecaeabac251e9f071
    Reviewed-on: https://gerrit.libreoffice.org/6082
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 110fcc8..ae3cd34 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -499,10 +499,10 @@ _ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
     }
     else if( RES_DRAWFRMFMT == pFmt->Which() )
     {
-            // See if there is an SdrObject for it
-            SwDrawContact* pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement( *pFrmFmt );
-            if( pContact )
-                nOrdNum = pContact->GetMaster()->GetOrdNum();
+        // See if there is an SdrObject for it
+        SwDrawContact* pContact = SwIterator<SwDrawContact,SwFmt>::FirstElement( *pFrmFmt );
+        if( pContact )
+            nOrdNum = pContact->GetMaster()->GetOrdNum();
     }
     else {
         OSL_ENSURE( !this, "what is that for a format?" );
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 09cbd16..c8aaaad 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -1725,7 +1725,7 @@ bool SwDoc::DeleteRangeImplImpl(SwPaM & rPam)
 
                     if( !pEndTxtNode->Len() )
                     {
-                // METADATA: remove reference if empty (consider node deleted)
+                        // METADATA: remove reference if empty (consider node deleted)
                         pEndTxtNode->RemoveMetadataReference();
                     }
                 }
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 6920b48..94bc975 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -160,38 +160,38 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const String& rPath, bool bOutline, c
     SwNodePtr pStartNd;
 
     if ( !bOutline) {
-    if( pSplitColl )
-    {
-        // If it isn't a OutlineNumbering, then use an own array and collect the Nodes.
-        if( pSplitColl->GetAttrOutlineLevel() == 0 )
+        if( pSplitColl )
         {
-            pOutlNds = new SwOutlineNodes;
-            SwIterator<SwTxtNode,SwFmtColl> aIter( *pSplitColl );
-            for( SwTxtNode* pTNd = aIter.First(); pTNd; pTNd = aIter.Next() )
-                if( pTNd->GetNodes().IsDocNodes() )
-                    pOutlNds->insert( pTNd );
-
-            if( pOutlNds->empty() )
+            // If it isn't a OutlineNumbering, then use an own array and collect the Nodes.
+            if( pSplitColl->GetAttrOutlineLevel() == 0 )
             {
-                delete pOutlNds;
-                return false;
+                pOutlNds = new SwOutlineNodes;
+                SwIterator<SwTxtNode,SwFmtColl> aIter( *pSplitColl );
+                for( SwTxtNode* pTNd = aIter.First(); pTNd; pTNd = aIter.Next() )
+                    if( pTNd->GetNodes().IsDocNodes() )
+                        pOutlNds->insert( pTNd );
+
+                if( pOutlNds->empty() )
+                {
+                    delete pOutlNds;
+                    return false;
+                }
             }
         }
-    }
-    else
-    {
-        // Look for the 1st level OutlineTemplate
-        const SwTxtFmtColls& rFmtColls =*GetTxtFmtColls();
-        for( sal_uInt16 n = rFmtColls.size(); n; )
-            if ( rFmtColls[ --n ]->GetAttrOutlineLevel() == 1 )
-            {
-                pSplitColl = rFmtColls[ n ];
-                break;
-            }
+        else
+        {
+            // Look for the 1st level OutlineTemplate
+            const SwTxtFmtColls& rFmtColls =*GetTxtFmtColls();
+            for( sal_uInt16 n = rFmtColls.size(); n; )
+                if ( rFmtColls[ --n ]->GetAttrOutlineLevel() == 1 )
+                {
+                    pSplitColl = rFmtColls[ n ];
+                    break;
+                }
 
-        if( !pSplitColl )
-            return false;
-    }
+            if( !pSplitColl )
+                return false;
+        }
     }
 
     const SfxFilter* pFilter;
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 0012b53..5b214e0 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -554,7 +554,7 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
         {
         case ND_GRFNODE:        sName = GetUniqueGrfName();     break;
         case ND_OLENODE:        sName = GetUniqueOLEName();     break;
-        default:                sName = GetUniqueFrameName();       break;
+        default:                sName = GetUniqueFrameName();   break;
         }
     SwFlyFrmFmt* pFmt = MakeFlyFrmFmt( sName, pFrmFmt );
 
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 4fb60c0..85225cc 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -2645,7 +2645,7 @@ bool SwRedlineTbl::InsertWithValidRanges( SwRedline* p, sal_uInt16* pInsPos )
                     if( pC )
                         pNew->GetPoint()->nContent.Assign( pC, 0 );
                     pTab = pNew->GetPoint()->nNode.GetNode().StartOfSectionNode()->FindTableNode();
-                }while( pTab ); // If there is another table we have to repeat our step backwards
+                } while( pTab ); // If there is another table we have to repeat our step backwards
             }
 
             if( *pNew->GetPoint() > *pEnd )
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index ffd471b..726c884 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -376,8 +376,8 @@ SwNumRule::SwNumRule( const OUString& rNm,
                       const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode,
                       SwNumRuleType eType,
                       sal_Bool bAutoFlg )
-    : maTxtNodeList(),
-      maParagraphStyleList(),
+  : maTxtNodeList(),
+    maParagraphStyleList(),
     pNumRuleMap(0),
     sName( rNm ),
     eRuleType( eType ),
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index c5d61cb..e98377f 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1859,7 +1859,6 @@ SwOLENodes* SwCntntNode::CreateOLENodesArray( const SwFmtColl& rColl, bool bOnly
  */
 const IDocumentSettingAccess* SwNode::getIDocumentSettingAccess() const { return GetDoc(); }
 const IDocumentDeviceAccess* SwNode::getIDocumentDeviceAccess() const { return GetDoc(); }
-const IDocumentMarkAccess* SwNode::getIDocumentMarkAccess() const { return GetDoc()->getIDocumentMarkAccess(); }
 const IDocumentRedlineAccess* SwNode::getIDocumentRedlineAccess() const { return GetDoc(); }
 const IDocumentStylePoolAccess* SwNode::getIDocumentStylePoolAccess() const { return GetDoc(); }
 const IDocumentLineNumberAccess* SwNode::getIDocumentLineNumberAccess() const { return GetDoc(); }
@@ -1871,12 +1870,10 @@ IDocumentLinksAdministration* SwNode::getIDocumentLinksAdministration() { return
 const IDocumentFieldsAccess* SwNode::getIDocumentFieldsAccess() const { return GetDoc(); }
 IDocumentFieldsAccess* SwNode::getIDocumentFieldsAccess() { return GetDoc(); }
 IDocumentContentOperations* SwNode::getIDocumentContentOperations() { return GetDoc(); }
+IDocumentListItems& SwNode::getIDocumentListItems() { return *GetDoc(); } // #i83479#
+
+const IDocumentMarkAccess* SwNode::getIDocumentMarkAccess() const { return GetDoc()->getIDocumentMarkAccess(); }
 IStyleAccess& SwNode::getIDocumentStyleAccess() { return GetDoc()->GetIStyleAccess(); }
-// #i83479#
-IDocumentListItems& SwNode::getIDocumentListItems()
-{
-    return *GetDoc();
-}
 
 sal_Bool SwNode::IsInRedlines() const
 {
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index c627e98..6e21e56 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2116,189 +2116,184 @@ void AttributeOutputBase::StartTOX( const SwSection& rSect )
                          sStr.AppendAscii( sEntryEnd );
                     }
 
-                if( nsSwTOXElement::TOX_OUTLINELEVEL & pTOX->GetCreateType() )
-                {
-                    const int nMinLvl = nTOXLvl;
-
-                    if ( nMinLvl > 0 )
+                    if( nsSwTOXElement::TOX_OUTLINELEVEL & pTOX->GetCreateType() )
                     {
-                        int nTmpLvl = nMinLvl;
-                        if (nTmpLvl > WW8ListManager::nMaxLevel)
-                            nTmpLvl = WW8ListManager::nMaxLevel;
+                        const int nMinLvl = nTOXLvl;
 
-                        sStr.AppendAscii( "\\o \"1-" );
-                        sStr += OUString::number( nTmpLvl );
-                        sStr.AppendAscii(sEntryEnd);
+                        if ( nMinLvl > 0 )
+                        {
+                            int nTmpLvl = nMinLvl;
+                            if (nTmpLvl > WW8ListManager::nMaxLevel)
+                                nTmpLvl = WW8ListManager::nMaxLevel;
 
+                            sStr.AppendAscii( "\\o \"1-" );
+                            sStr += OUString::number( nTmpLvl );
+                            sStr.AppendAscii(sEntryEnd);
+                        }
                     }
 
-                }
+                    if( nsSwTOXElement::TOX_OUTLINELEVEL & pTOX->GetCreateType() )
+                    {
+                        // Take the TOC value of the max level to evaluate to as
+                        // the starting point for the \o flag, but reduce it to the
+                        // value of the highest outline level filled by a *standard*
+                        // Heading 1 - 9 style because \o "Builds a table of
+                        // contents from paragraphs formatted with built-in heading
+                        // styles". And afterward fill in any outline styles left
+                        // uncovered by that range to the \t flag
+                        //
+                        // i.e. for
+                        // Heading 1
+                        // Heading 2
+                        // custom-style
+                        // Heading 4
+                        // output
+                        // \o 1-2 \tcustom-style,3,Heading 3,4
+
+                        // Search over all the outline styles used and figure out
+                        // what is the minimum outline level (if any) filled by a
+                        // non-standard style for that level, i.e. ignore headline
+                        // styles 1-9 and find the lowest valid outline level
+                        sal_uInt8 nPosOfLowestNonStandardLvl = MAXLEVEL;
+                        const SwTxtFmtColls& rColls = *GetExport().pDoc->GetTxtFmtColls();
+                        for( n = rColls.size(); n; )
+                        {
+                            const SwTxtFmtColl* pColl = rColls[ --n ];
+                            sal_uInt16 nPoolId = pColl->GetPoolFmtId();
+                            if (
+                                //Is a Non-Standard Outline Style
+                                (RES_POOLCOLL_HEADLINE1 > nPoolId || RES_POOLCOLL_HEADLINE9 < nPoolId) &&
+                                //Has a valid outline level
+                                (pColl->IsAssignedToListLevelOfOutlineStyle()) &&
+                                // Is less than the lowest known non-standard level
+                                (pColl->GetAssignedOutlineStyleLevel() < nPosOfLowestNonStandardLvl)
+                               )
+                            {
+                                nPosOfLowestNonStandardLvl = ::sal::static_int_cast<sal_uInt8>(pColl->GetAssignedOutlineStyleLevel());
+                            }
+                        }
 
+                        sal_uInt8 nMaxMSAutoEvaluate = nPosOfLowestNonStandardLvl < nTOXLvl ? nPosOfLowestNonStandardLvl : (sal_uInt8)nTOXLvl;
 
-        if( nsSwTOXElement::TOX_OUTLINELEVEL & pTOX->GetCreateType() )
-                  {
-            // Take the TOC value of the max level to evaluate to as
-            // the starting point for the \o flag, but reduce it to the
-            // value of the highest outline level filled by a *standard*
-            // Heading 1 - 9 style because \o "Builds a table of
-            // contents from paragraphs formatted with built-in heading
-            // styles". And afterward fill in any outline styles left
-            // uncovered by that range to the \t flag
-            //
-            // i.e. for
-            // Heading 1
-            // Heading 2
-            // custom-style
-            // Heading 4
-            // output
-            // \o 1-2 \tcustom-style,3,Heading 3,4
-
-            // Search over all the outline styles used and figure out
-            // what is the minimum outline level (if any) filled by a
-            // non-standard style for that level, i.e. ignore headline
-            // styles 1-9 and find the lowest valid outline level
-            sal_uInt8 nPosOfLowestNonStandardLvl = MAXLEVEL;
-            const SwTxtFmtColls& rColls = *GetExport().pDoc->GetTxtFmtColls();
-            for( n = rColls.size(); n; )
-                      {
-            const SwTxtFmtColl* pColl = rColls[ --n ];
-            sal_uInt16 nPoolId = pColl->GetPoolFmtId();
-            if (
-                //Is a Non-Standard Outline Style
-                (RES_POOLCOLL_HEADLINE1 > nPoolId || RES_POOLCOLL_HEADLINE9 < nPoolId) &&
-                //Has a valid outline level
-                (pColl->IsAssignedToListLevelOfOutlineStyle()) &&
-                // Is less than the lowest known non-standard level
-                (pColl->GetAssignedOutlineStyleLevel() < nPosOfLowestNonStandardLvl)
-                            )
-                          {
-                              nPosOfLowestNonStandardLvl = ::sal::static_int_cast<sal_uInt8>(pColl->GetAssignedOutlineStyleLevel());
-                          }
-                      }
-
-            sal_uInt8 nMaxMSAutoEvaluate = nPosOfLowestNonStandardLvl < nTOXLvl ? nPosOfLowestNonStandardLvl : (sal_uInt8)nTOXLvl;
-
-            //output \o 1-X where X is the highest normal outline style to be included in the toc
-            if ( nMaxMSAutoEvaluate )
-              {
-            if (nMaxMSAutoEvaluate > WW8ListManager::nMaxLevel)
-              nMaxMSAutoEvaluate = WW8ListManager::nMaxLevel;
-
-            sStr.AppendAscii( "\\o \"1-" );
-            sStr += OUString::number( nMaxMSAutoEvaluate );
-            sStr.AppendAscii(sEntryEnd);
-                      }
-
-            //collect up any other styles in the writer TOC which will
-            //not already appear in the MS TOC and place then into the
-            //\t option
-            if( nMaxMSAutoEvaluate < nTOXLvl )
-                      {
-            // collect this templates into the \t otion
-            for( n = rColls.size(); n;)
-                          {
-                const SwTxtFmtColl* pColl = rColls[ --n ];
-                if (!pColl->IsAssignedToListLevelOfOutlineStyle())
-                  continue;
-                sal_uInt8 nTestLvl =  ::sal::static_int_cast<sal_uInt8>(pColl->GetAssignedOutlineStyleLevel());
-                if (nTestLvl < nTOXLvl && nTestLvl >= nMaxMSAutoEvaluate)
-                  {
-                if( sTOption.Len() )
-                  sTOption += ',';
-                (( sTOption += pColl->GetName() ) += ',' )
-                  += OUString::number( nTestLvl + 1 );
-                  }
-              }
-              }
-                  }
-
-                if( nsSwTOXElement::TOX_TEMPLATE & pTOX->GetCreateType() )
-                    // #i99641# - Consider additional styles regardless of TOX-outlinelevel
-                    for( n = 0; n < MAXLEVEL; ++n )
-                    {
-                        const String& rStyles = pTOX->GetStyleNames( n );
-                        if( rStyles.Len() )
+                        //output \o 1-X where X is the highest normal outline style to be included in the toc
+                        if ( nMaxMSAutoEvaluate )
                         {
-                            sal_Int32 nPos = 0;
-                            String sLvl = OUString(',');
-                            sLvl += OUString::number( n + 1 );
-                            do {
-                                String sStyle( rStyles.GetToken( 0,
-                                            TOX_STYLE_DELIMITER, nPos ));
-                                if( sStyle.Len() )
+                            if (nMaxMSAutoEvaluate > WW8ListManager::nMaxLevel)
+                              nMaxMSAutoEvaluate = WW8ListManager::nMaxLevel;
+
+                            sStr.AppendAscii( "\\o \"1-" );
+                            sStr += OUString::number( nMaxMSAutoEvaluate );
+                            sStr.AppendAscii(sEntryEnd);
+                        }
+
+                        //collect up any other styles in the writer TOC which will
+                        //not already appear in the MS TOC and place then into the
+                        //\t option
+                        if( nMaxMSAutoEvaluate < nTOXLvl )
+                        {
+                            // collect this templates into the \t otion
+                            for( n = rColls.size(); n;)
+                            {
+                                const SwTxtFmtColl* pColl = rColls[ --n ];
+                                if (!pColl->IsAssignedToListLevelOfOutlineStyle())
+                                    continue;
+                                sal_uInt8 nTestLvl =  ::sal::static_int_cast<sal_uInt8>(pColl->GetAssignedOutlineStyleLevel());
+                                if (nTestLvl < nTOXLvl && nTestLvl >= nMaxMSAutoEvaluate)
                                 {
-                                    SwTxtFmtColl* pColl = GetExport().pDoc->FindTxtFmtCollByName(sStyle);
-                                    if (!pColl || !pColl->IsAssignedToListLevelOfOutlineStyle() || pColl->GetAssignedOutlineStyleLevel() < nTOXLvl)
-                                    {
-                                        if( sTOption.Len() )
-                                            sTOption += ',';
-                                        ( sTOption += sStyle ) += sLvl;
-                                    }
+                                    if( sTOption.Len() )
+                                        sTOption += ',';
+                                    (( sTOption += pColl->GetName() ) += ',' ) += OUString::number( nTestLvl + 1 );
                                 }
-                            } while( -1 != nPos );
+                            }
                         }
                     }
 
-                {
-                    String aFillTxt;
-                    sal_uInt8 nNoPgStt = MAXLEVEL, nNoPgEnd = MAXLEVEL;
-                    bool bFirstFillTxt = true, bOnlyText = true;
-                    for( n = 0; n < nTOXLvl; ++n )
-                    {
-                        String aTxt;
-                        int nRet = ::lcl_CheckForm( pTOX->GetTOXForm(),
-                                                    static_cast< sal_uInt8 >(n+1), aTxt );
-                        if( 1 == nRet )
+                    if( nsSwTOXElement::TOX_TEMPLATE & pTOX->GetCreateType() )
+                        // #i99641# - Consider additional styles regardless of TOX-outlinelevel
+                        for( n = 0; n < MAXLEVEL; ++n )
                         {
-                            bOnlyText = false;
-                            if( MAXLEVEL == nNoPgStt )
-                                nNoPgStt = static_cast< sal_uInt8 >(n+1);
+                            const String& rStyles = pTOX->GetStyleNames( n );
+                            if( rStyles.Len() )
+                            {
+                                sal_Int32 nPos = 0;
+                                String sLvl = OUString(',');
+                                sLvl += OUString::number( n + 1 );
+                                do {
+                                    String sStyle( rStyles.GetToken( 0, TOX_STYLE_DELIMITER, nPos ));
+                                    if( sStyle.Len() )
+                                    {
+                                        SwTxtFmtColl* pColl = GetExport().pDoc->FindTxtFmtCollByName(sStyle);
+                                        if (!pColl || !pColl->IsAssignedToListLevelOfOutlineStyle() || pColl->GetAssignedOutlineStyleLevel() < nTOXLvl)
+                                        {
+                                            if( sTOption.Len() )
+                                                sTOption += ',';
+                                            ( sTOption += sStyle ) += sLvl;
+                                        }
+                                    }
+                                } while( -1 != nPos );
+                            }
                         }
-                        else
+
                         {
-                            if( MAXLEVEL != nNoPgStt &&
-                                MAXLEVEL == nNoPgEnd )
-                                nNoPgEnd = sal_uInt8(n);
+                            String aFillTxt;
+                            sal_uInt8 nNoPgStt = MAXLEVEL, nNoPgEnd = MAXLEVEL;
+                            bool bFirstFillTxt = true, bOnlyText = true;
+                            for( n = 0; n < nTOXLvl; ++n )
+                            {
+                                String aTxt;
+                                int nRet = ::lcl_CheckForm( pTOX->GetTOXForm(),
+                                                            static_cast< sal_uInt8 >(n+1), aTxt );
+                                if( 1 == nRet )
+                                {
+                                    bOnlyText = false;
+                                    if( MAXLEVEL == nNoPgStt )
+                                        nNoPgStt = static_cast< sal_uInt8 >(n+1);
+                                }
+                                else
+                                {
+                                    if( MAXLEVEL != nNoPgStt &&
+                                        MAXLEVEL == nNoPgEnd )
+                                        nNoPgEnd = sal_uInt8(n);
 
-                            bOnlyText = bOnlyText && 3 == nRet;
-                            if( 3 == nRet || 4 == nRet )
+                                    bOnlyText = bOnlyText && 3 == nRet;
+                                    if( 3 == nRet || 4 == nRet )
+                                    {
+                                        if( bFirstFillTxt )
+                                            aFillTxt = aTxt;
+                                        else if( aFillTxt != aTxt )
+                                            aFillTxt.Erase();
+                                        bFirstFillTxt = false;
+                                    }
+                                }
+                            }
+                            if( MAXLEVEL != nNoPgStt )
                             {
-                                if( bFirstFillTxt )
-                                    aFillTxt = aTxt;
-                                else if( aFillTxt != aTxt )
-                                    aFillTxt.Erase();
-                                bFirstFillTxt = false;
+                                if (WW8ListManager::nMaxLevel < nNoPgEnd)
+                                    nNoPgEnd = WW8ListManager::nMaxLevel;
+                                sStr.AppendAscii( "\\n " );
+                                sStr += OUString::number( nNoPgStt );
+                                sStr += '-';
+                                sStr += OUString::number( nNoPgEnd  );
+                                sStr += ' ';
+                            }
+                            if( bOnlyText )
+                            {
+                                sStr.AppendAscii( "\\p \"" );
+                                sStr += aFillTxt;
+                                sStr.AppendAscii(sEntryEnd);
                             }
                         }
-                    }
-                    if( MAXLEVEL != nNoPgStt )
-                    {
-                        if (WW8ListManager::nMaxLevel < nNoPgEnd)
-                            nNoPgEnd = WW8ListManager::nMaxLevel;
-                        sStr.AppendAscii( "\\n " );
-                        sStr += OUString::number( nNoPgStt );
-                        sStr += '-';
-                        sStr += OUString::number( nNoPgEnd  );
-                        sStr += ' ';
-                    }
-                    if( bOnlyText )
-                    {
-                        sStr.AppendAscii( "\\p \"" );
-                        sStr += aFillTxt;
-                        sStr.AppendAscii(sEntryEnd);
-                    }
-                }
 
-                if( sTOption.Len() )
-                {
-                    sStr.AppendAscii( "\\t \"" );
-                    sStr += sTOption;
-                    sStr.AppendAscii(sEntryEnd);
-                }
+                        if( sTOption.Len() )
+                        {
+                            sStr.AppendAscii( "\\t \"" );
+                            sStr += sTOption;
+                            sStr.AppendAscii(sEntryEnd);
+                        }
 
-                if (lcl_IsHyperlinked(pTOX->GetTOXForm(), nTOXLvl))
-                    sStr.AppendAscii("\\h");
-            }
+                        if (lcl_IsHyperlinked(pTOX->GetTOXForm(), nTOXLvl))
+                            sStr.AppendAscii("\\h");
+                    }
             break;
             }
         }
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 3e4d83a..ca9cb50 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -2034,7 +2034,7 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) :
 
         nStartCp = aRes.nEndPos;
     }
-    while( 1 );
+    while(true);
 
     if( bOk )
     {
@@ -2557,9 +2557,9 @@ void WW8TabDesc::MergeCells()
                             bMerge = true;
                         else
                         {
-                        //If it's a hori merge only, and the only things in
-                        //it are invalid cells then its already taken care
-                        //of, so don't merge.
+                            //If it's a hori merge only, and the only things in
+                            //it are invalid cells then it's already taken care
+                            //of, so don't merge.
                             for (sal_uInt16 i2 = i+1; i2 < pActBand->nWwCols; i2++ )
                                 if (pActBand->pTCs[ i2 ].bMerged &&
                                     !pActBand->pTCs[ i2 ].bFirstMerged  )
@@ -4081,7 +4081,7 @@ Word2CHPX ReadWord2Chpx(SvStream &rSt, sal_Size nOffset, sal_uInt8 nSize)
 
     sal_uInt8 nCount=0;
 
-    while (1)
+    while (true)
     {
         sal_uInt8 nFlags8;
         rSt >> nFlags8;
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index d62c32a..ad36694 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -659,7 +659,8 @@ void WW8FieldEntry::SetBookmarkCode(OUString bookmarkCode)
 }
 
 
-::sw::mark::IFieldmark::parameter_map_t& WW8FieldEntry::getParameters() {
+::sw::mark::IFieldmark::parameter_map_t& WW8FieldEntry::getParameters()
+{
     return maParams;
 }
 
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 346cb47..6422f0c 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -145,7 +145,7 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog(
 
 // Disable "multiple layout"
 
-void    SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView )
+void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView )
 {
     GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet );
     UpdateFontList();
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index dd1225c..091fb23 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -167,7 +167,7 @@ class SwEntryBrowseBox : public SwEntryBrowseBox_Base
     bool    bModified;
 
 
-    void                        SetModified() {bModified = true;}
+    void                            SetModified() {bModified = true;}
 
 protected:
     virtual sal_Bool                SeekRow( long nRow );
@@ -180,14 +180,14 @@ protected:
 
 public:
     SwEntryBrowseBox(Window* pParent, VclBuilderContainer* pBuilder);
-    void    ReadEntries(SvStream& rInStr);
-    void    WriteEntries(SvStream& rOutStr);
+    void                            ReadEntries(SvStream& rInStr);
+    void                            WriteEntries(SvStream& rOutStr);
 
     sal_Bool                        IsModified()const;
 
     virtual OUString GetCellText( long nRow, sal_uInt16 nColumn ) const;
-    virtual void Resize();
-    virtual Size GetOptimalSize() const;
+    virtual void                    Resize();
+    virtual Size                    GetOptimalSize() const;
 };
 
 class SwAutoMarkDlg_Impl : public ModalDialog
@@ -349,7 +349,7 @@ SwMultiTOXTabDialog::~SwMultiTOXTabDialog()
     delete pExampleFrame;
 }
 
-void    SwMultiTOXTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
+void SwMultiTOXTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
 {
     if (nId == m_nBackGroundId)
     {
@@ -373,7 +373,7 @@ void    SwMultiTOXTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
     }
 }
 
-short   SwMultiTOXTabDialog::Ok()
+short SwMultiTOXTabDialog::Ok()
 {
     short nRet = SfxTabDialog::Ok();
     SwTOXDescription& rDesc = GetTOXDescription(eCurrentTOXType);
@@ -412,7 +412,7 @@ SwForm* SwMultiTOXTabDialog::GetForm(CurTOXType eType)
     return pFormArr[nIndex];
 }
 
-SwTOXDescription&   SwMultiTOXTabDialog::GetTOXDescription(CurTOXType eType)
+SwTOXDescription& SwMultiTOXTabDialog::GetTOXDescription(CurTOXType eType)
 {
     sal_uInt16 nIndex = eType.GetFlatIndex();
     if(!pDescArr[nIndex])
@@ -1000,7 +1000,7 @@ static CurTOXType lcl_UserData2TOXTypes(sal_uInt16 nData)
     return eRet;
 }
 
-void    SwTOXSelectTabPage::ApplyTOXDescription()
+void SwTOXSelectTabPage::ApplyTOXDescription()
 {
     SwMultiTOXTabDialog* pTOXDlg = (SwMultiTOXTabDialog*)GetTabDialog();
     const CurTOXType aCurType = pTOXDlg->GetCurrentTOXType();
@@ -1146,7 +1146,7 @@ void SwTOXSelectTabPage::FillTOXDescription()
                 nContentOptions |= nsSwTOXElement::TOX_GRAPHIC;
         }
         break;
-        case  TOX_INDEX:
+        case TOX_INDEX:
         {
             nContentOptions = nsSwTOXElement::TOX_MARK;
 
@@ -1255,7 +1255,7 @@ void SwTOXSelectTabPage::Reset( const SfxItemSet& )
         m_pTypeLB->Enable(sal_False);
     }
 
-    if (!m_bWaitingInitialSettings)
+    if(!m_bWaitingInitialSettings)
     {
         // save current values into the proper TOXDescription
         FillTOXDescription();
@@ -1527,13 +1527,13 @@ public:
     void    AdjustSize();
 };
 
-void    SwTOXEdit::RequestHelp( const HelpEvent& rHEvt )
+void SwTOXEdit::RequestHelp( const HelpEvent& rHEvt )
 {
     if(!m_pParent->CreateQuickHelp(this, aFormToken, rHEvt))
         Edit::RequestHelp(rHEvt);
 }
 
-void    SwTOXEdit::KeyInput( const KeyEvent& rKEvt )
+void SwTOXEdit::KeyInput( const KeyEvent& rKEvt )
 {
     const Selection& rSel = GetSelection();
     sal_Int32 nTextLen = GetText().getLength();
@@ -1585,8 +1585,8 @@ public:
     {
     }
 
-    virtual void    KeyInput( const KeyEvent& rKEvt );
-    virtual void    RequestHelp( const HelpEvent& rHEvt );
+    virtual void KeyInput( const KeyEvent& rKEvt );
+    virtual void RequestHelp( const HelpEvent& rHEvt );
 
     bool IsNextControl() const          {return bNextControl;}
     void SetPrevNextLink(const Link& rLink) {aPrevNextControlLink = rLink;}
@@ -1661,7 +1661,7 @@ public:
         }
 };
 
-void    SwTOXButton::KeyInput( const KeyEvent& rKEvt )
+void SwTOXButton::KeyInput( const KeyEvent& rKEvt )
 {
     bool bCall = false;
     KeyCode aCode = rKEvt.GetKeyCode();
@@ -1687,7 +1687,7 @@ void    SwTOXButton::KeyInput( const KeyEvent& rKEvt )
         PushButton::KeyInput(rKEvt);
 }
 
-void    SwTOXButton::RequestHelp( const HelpEvent& rHEvt )
+void SwTOXButton::RequestHelp( const HelpEvent& rHEvt )
 {
     if(!m_pParent->CreateQuickHelp(this, aFormToken, rHEvt))
         Button::RequestHelp(rHEvt);
@@ -1708,7 +1708,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwIdxTreeListBox(Window *pP
     return new SwIdxTreeListBox(pParent, nWinStyle);
 }
 
-void    SwIdxTreeListBox::RequestHelp( const HelpEvent& rHEvt )
+void SwIdxTreeListBox::RequestHelp( const HelpEvent& rHEvt )
 {
     if( rHEvt.GetMode() & HELPMODE_QUICK )
     {
@@ -1921,7 +1921,7 @@ SwTOXEntryTabPage::~SwTOXEntryTabPage()
 {
 }
 
-sal_Bool    SwTOXEntryTabPage::FillItemSet( SfxItemSet& )
+sal_Bool SwTOXEntryTabPage::FillItemSet( SfxItemSet& )
 {
     // nothing to do
     return sal_True;
@@ -2637,7 +2637,7 @@ SwTokenWindow::~SwTokenWindow()
     }
 }
 
-void    SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
+void SwTokenWindow::SetForm(SwForm& rForm, sal_uInt16 nL)
 {
     SetActiveControl(0);
     bValid = sal_True;
@@ -2802,9 +2802,7 @@ Control*    SwTokenWindow::InsertItem(const String& rText, const SwFormToken& rT
     return pRet;
 }
 
-void    SwTokenWindow::InsertAtSelection(
-            const String& rText,
-            const SwFormToken& rToken)
+void SwTokenWindow::InsertAtSelection(const String& rText, const SwFormToken& rToken)
 {
     OSL_ENSURE(pActiveCtrl, "no active control!");
 
@@ -3538,7 +3536,7 @@ void SwTOXStylesTabPage::ActivatePage( const SfxItemSet& )
     EnableSelectHdl(m_pParaLayLB);
 }
 
-int     SwTOXStylesTabPage::DeactivatePage( SfxItemSet* /*pSet*/  )
+int SwTOXStylesTabPage::DeactivatePage( SfxItemSet* /*pSet*/  )
 {
     GetForm() = *m_pCurrentForm;
     return LEAVE_PAGE;
@@ -3776,7 +3774,7 @@ Size SwEntryBrowseBox::GetOptimalSize() const
     return aSize;
 }
 
-sal_Bool    SwEntryBrowseBox::SeekRow( long nRow )
+sal_Bool SwEntryBrowseBox::SeekRow( long nRow )
 {
     nCurrentRow = nRow;
     return sal_True;
@@ -3802,7 +3800,7 @@ OUString SwEntryBrowseBox::GetCellText(long nRow, sal_uInt16 nColumn) const
     return *pRet;
 }
 
-void    SwEntryBrowseBox::PaintCell(OutputDevice& rDev,
+void SwEntryBrowseBox::PaintCell(OutputDevice& rDev,
                                 const Rectangle& rRect, sal_uInt16 nColumnId) const
 {
     String sPaint = GetCellText( nCurrentRow, nColumnId );
@@ -3859,7 +3857,7 @@ sal_Bool SwEntryBrowseBox::SaveModified()
     return sal_True;
 }
 
-void    SwEntryBrowseBox::InitController(
+void SwEntryBrowseBox::InitController(
                 ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol)
 {
     String rTxt = GetCellText( nRow, nCol );
@@ -3878,7 +3876,7 @@ void    SwEntryBrowseBox::InitController(
      }
 }
 
-void    SwEntryBrowseBox::ReadEntries(SvStream& rInStr)
+void SwEntryBrowseBox::ReadEntries(SvStream& rInStr)
 {
     AutoMarkEntry* pToInsert = 0;
     rtl_TextEncoding  eTEnc = osl_getThreadTextEncoding();
@@ -3930,7 +3928,7 @@ void    SwEntryBrowseBox::ReadEntries(SvStream& rInStr)
     RowInserted(0, aEntryArr.size() + 1, sal_True);
 }
 
-void    SwEntryBrowseBox::WriteEntries(SvStream& rOutStr)
+void SwEntryBrowseBox::WriteEntries(SvStream& rOutStr)
 {
     //check if the current controller is modified
     sal_uInt16 nCol = GetCurColumnId();
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 3436f8e..e9cc4c6 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -806,7 +806,7 @@ void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell)
     Update();
 }
 
-void    SwOutlineSettingsTabPage::ActivatePage(const SfxItemSet& )
+void SwOutlineSettingsTabPage::ActivatePage(const SfxItemSet& )
 {
     nActLevel = SwOutlineTabDialog::GetActNumLevel();
     if(nActLevel != USHRT_MAX)
@@ -816,18 +816,18 @@ void    SwOutlineSettingsTabPage::ActivatePage(const SfxItemSet& )
     LevelHdl(m_pLevelLB);
 }
 
-int     SwOutlineSettingsTabPage::DeactivatePage(SfxItemSet*)
+int SwOutlineSettingsTabPage::DeactivatePage(SfxItemSet*)
 {
     SwOutlineTabDialog::SetActNumLevel(nActLevel);
     return LEAVE_PAGE;
 }
 
-sal_Bool    SwOutlineSettingsTabPage::FillItemSet( SfxItemSet&  )
+sal_Bool SwOutlineSettingsTabPage::FillItemSet( SfxItemSet&  )
 {
     return sal_True;
 }
 
-void    SwOutlineSettingsTabPage::Reset( const SfxItemSet& rSet )
+void SwOutlineSettingsTabPage::Reset( const SfxItemSet& rSet )
 {
     ActivatePage(rSet);
 }
@@ -896,7 +896,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeNumberingPreview(Window *pP
 /*--------------------------------------------------
     paint numbering's preview
 --------------------------------------------------*/
-void    NumberingPreview::Paint( const Rectangle& /*rRect*/ )
+void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
 {
     Size aSize(PixelToLogic(GetOutputSizePixel()));
     Rectangle aRect(Point(0,0), aSize);
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index e0cd59d..8651176 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -2078,9 +2078,9 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe
 
     switch( nSlotId )
     {
-        case SID_DOCUMENT_MERGE:                            break;
-        case SID_DOCUMENT_COMPARE:      bCompare = sal_True;    break;
-        case SID_INSERTDOC:             bInsert = sal_True;     break;
+        case SID_DOCUMENT_MERGE:                        break;
+        case SID_DOCUMENT_COMPARE: bCompare = sal_True; break;
+        case SID_INSERTDOC:        bInsert = sal_True;  break;
 
         default:
             OSL_ENSURE( !this, "unknown SlotId!" );


More information about the Libreoffice-commits mailing list