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

Miklos Vajna vmiklos at collabora.co.uk
Thu Dec 21 08:26:11 UTC 2017


 sw/source/core/undo/SwUndoPageDesc.cxx |  114 ---------------------------------
 1 file changed, 114 deletions(-)

New commits:
commit bf8e8cf11bc0d60ab80f5b3420dc424aec2fa626
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Dec 20 21:32:07 2017 +0100

    sw: remove DebugHeaderFooterContent() in SwUndoPageDesc
    
    No longer builds, and the plain node array output in gdb / doc model xml
    dump is comparable functionality.
    
    Change-Id: Ia51dc8c707b4827aa54b9d27f3b66e5e6539a530
    Reviewed-on: https://gerrit.libreoffice.org/46862
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx
index 10602da49624..0178cd0ff5bd 100644
--- a/sw/source/core/undo/SwUndoPageDesc.cxx
+++ b/sw/source/core/undo/SwUndoPageDesc.cxx
@@ -28,73 +28,6 @@
 #include <fmtcntnt.hxx>
 #include <fmthdft.hxx>
 
-#if OSL_DEBUG_LEVEL > 1
-#include <ndindex.hxx>
-#endif
-
-#if OSL_DEBUG_LEVEL > 1
-// Pure debug help function to have a quick look at the header/footer attributes.
-void DebugHeaderFooterContent( const SwPageDesc& rPageDesc )
-{
-    sal_uLong nHeaderMaster = ULONG_MAX;
-    sal_uLong nHeaderLeft = ULONG_MAX;
-    sal_uLong nFooterMaster = ULONG_MAX;
-    sal_uLong nFooterLeft = ULONG_MAX;
-
-    SwFormatHeader& rHead = (SwFormatHeader&)rPageDesc.GetMaster().GetHeader();
-    SwFormatFooter& rFoot = (SwFormatFooter&)rPageDesc.GetMaster().GetFooter();
-    SwFormatHeader& rLeftHead = (SwFormatHeader&)rPageDesc.GetLeft().GetHeader();
-    SwFormatFooter& rLeftFoot = (SwFormatFooter&)rPageDesc.GetLeft().GetFooter();
-    if( rHead.IsActive() )
-    {
-        SwFrameFormat* pHeaderFormat = rHead.GetHeaderFormat();
-        if( pHeaderFormat )
-        {
-            const SwFormatContent* pContent = &pHeaderFormat->GetContent();
-            if( pContent->GetContentIdx() )
-                nHeaderMaster = pContent->GetContentIdx()->GetIndex();
-            else
-                nHeaderMaster = 0;
-        }
-        SwFrameFormat* pLeftHeaderFormat = rLeftHead.GetHeaderFormat();
-        if( pLeftHeaderFormat )
-        {
-            const SwFormatContent* pLeftContent = &pLeftHeaderFormat->GetContent();
-            if( pLeftContent->GetContentIdx() )
-                nHeaderLeft = pLeftContent->GetContentIdx()->GetIndex();
-            else
-                nHeaderLeft = 0;
-        }
-    }
-    if( rFoot.IsActive() )
-    {
-        SwFrameFormat* pFooterFormat = rFoot.GetFooterFormat();
-        if( pFooterFormat )
-        {
-            const SwFormatContent* pContent = &pFooterFormat->GetContent();
-            if( pContent->GetContentIdx() )
-                nFooterMaster = pContent->GetContentIdx()->GetIndex();
-            else
-                nFooterMaster = 0;
-        }
-        SwFrameFormat* pLeftFooterFormat = rLeftFoot.GetFooterFormat();
-        if( pLeftFooterFormat )
-        {
-            const SwFormatContent* pLeftContent = &pLeftFooterFormat->GetContent();
-            if( pLeftContent->GetContentIdx() )
-                nFooterLeft = pLeftContent->GetContentIdx()->GetIndex();
-            else
-                nFooterLeft = 0;
-        }
-    }
-
-    (void)nHeaderMaster;
-    (void)nHeaderLeft;
-    (void)nFooterMaster;
-    (void)nFooterLeft;
-}
-#endif
-
 SwUndoPageDesc::SwUndoPageDesc(const SwPageDesc & _aOld,
                                const SwPageDesc & _aNew,
                                SwDoc * _pDoc)
@@ -106,11 +39,6 @@ SwUndoPageDesc::SwUndoPageDesc(const SwPageDesc & _aOld,
 {
     OSL_ENSURE(nullptr != pDoc, "no document?");
 
-#if OSL_DEBUG_LEVEL > 1
-    DebugHeaderFooterContent( aOld.m_PageDesc );
-    DebugHeaderFooterContent( aNew.m_PageDesc );
-#endif
-
     /*
     The page description changes.
     If there are no header/footer content changes like header on/off or change from shared content
@@ -189,10 +117,6 @@ SwUndoPageDesc::SwUndoPageDesc(const SwPageDesc & _aOld,
         // After this exchange method the old page description will point to zero,
         // the new one will point to the node position of the original content nodes.
         ExchangeContentNodes( aOld.m_PageDesc, aNew.m_PageDesc );
-#if OSL_DEBUG_LEVEL > 1
-        DebugHeaderFooterContent( aOld.m_PageDesc );
-        DebugHeaderFooterContent( aNew.m_PageDesc );
-#endif
     }
 }
 
@@ -213,12 +137,6 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
         rDest.GetMaster().GetAttrSet().GetItemState( RES_HEADER, false, &pItem );
         SfxPoolItem *pNewItem = pItem->Clone();
         SwFrameFormat* pNewFormat = static_cast<SwFormatHeader*>(pNewItem)->GetHeaderFormat();
-#if OSL_DEBUG_LEVEL > 1
-        const SwFormatContent& rSourceContent = rSourceHead.GetHeaderFormat()->GetContent();
-        (void)rSourceContent;
-        const SwFormatContent& rDestContent = rDestHead.GetHeaderFormat()->GetContent();
-        (void)rDestContent;
-#endif
         pNewFormat->SetFormatAttr( rSourceHead.GetHeaderFormat()->GetContent() );
         delete pNewItem;
 
@@ -237,12 +155,6 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
             rDest.GetLeft().GetAttrSet().GetItemState( RES_HEADER, false, &pItem );
             pNewItem = pItem->Clone();
             pNewFormat = static_cast<SwFormatHeader*>(pNewItem)->GetHeaderFormat();
-#if OSL_DEBUG_LEVEL > 1
-            const SwFormatContent& rSourceContent1 = rSourceLeftHead.GetHeaderFormat()->GetContent();
-            (void)rSourceContent1;
-            const SwFormatContent& rDestContent1 = rDest.GetLeft().GetHeader().GetHeaderFormat()->GetContent();
-            (void)rDestContent1;
-#endif
             pNewFormat->SetFormatAttr( rSourceLeftHead.GetHeaderFormat()->GetContent() );
             delete pNewItem;
             rSource.GetLeft().GetAttrSet().GetItemState( RES_HEADER, false, &pItem );
@@ -258,12 +170,6 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
             rDest.GetFirstMaster().GetAttrSet().GetItemState( RES_HEADER, false, &pItem );
             pNewItem = pItem->Clone();
             pNewFormat = static_cast<SwFormatHeader*>(pNewItem)->GetHeaderFormat();
-#if OSL_DEBUG_LEVEL > 1
-            const SwFormatContent& rSourceContent1 = rSourceFirstMasterHead.GetHeaderFormat()->GetContent();
-            (void)rSourceContent1;
-            const SwFormatContent& rDestContent1 = rDest.GetFirstMaster().GetHeader().GetHeaderFormat()->GetContent();
-            (void)rDestContent1;
-#endif
             pNewFormat->SetFormatAttr( rSourceFirstMasterHead.GetHeaderFormat()->GetContent() );
             delete pNewItem;
             rSource.GetFirstMaster().GetAttrSet().GetItemState( RES_HEADER, false, &pItem );
@@ -286,12 +192,6 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
     pNewFormat->SetFormatAttr( rSourceFoot.GetFooterFormat()->GetContent() );
     delete pNewItem;
 
-#if OSL_DEBUG_LEVEL > 1
-    const SwFormatContent& rFooterSourceContent = rSourceFoot.GetFooterFormat()->GetContent();
-    (void)rFooterSourceContent;
-    const SwFormatContent& rFooterDestContent = rDestFoot.GetFooterFormat()->GetContent();
-    (void)rFooterDestContent;
-#endif
     rSource.GetMaster().GetAttrSet().GetItemState( RES_FOOTER, false, &pItem );
     pNewItem = pItem->Clone();
     pNewFormat = static_cast<SwFormatFooter*>(pNewItem)->GetFooterFormat();
@@ -301,13 +201,6 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
     if( !rDest.IsFooterShared() )
     {
         const SwFormatFooter& rSourceLeftFoot = rSource.GetLeft().GetFooter();
-#if OSL_DEBUG_LEVEL > 1
-        const SwFormatContent& rFooterSourceContent2 = rSourceLeftFoot.GetFooterFormat()->GetContent();
-        const SwFormatContent& rFooterDestContent2 =
-            rDest.GetLeft().GetFooter().GetFooterFormat()->GetContent();
-        (void)rFooterSourceContent2;
-        (void)rFooterDestContent2;
-#endif
         rDest.GetLeft().GetAttrSet().GetItemState( RES_FOOTER, false, &pItem );
         pNewItem = pItem->Clone();
         pNewFormat = static_cast<SwFormatFooter*>(pNewItem)->GetFooterFormat();
@@ -323,13 +216,6 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes
         return;
 
     const SwFormatFooter& rSourceFirstMasterFoot = rSource.GetFirstMaster().GetFooter();
-#if OSL_DEBUG_LEVEL > 1
-    const SwFormatContent& rFooterSourceContent2 = rSourceFirstMasterFoot.GetFooterFormat()->GetContent();
-    const SwFormatContent& rFooterDestContent2 =
-        rDest.GetFirstMaster().GetFooter().GetFooterFormat()->GetContent();
-    (void)rFooterSourceContent2;
-    (void)rFooterDestContent2;
-#endif
     rDest.GetFirstMaster().GetAttrSet().GetItemState( RES_FOOTER, false, &pItem );
     pNewItem = pItem->Clone();
     pNewFormat = static_cast<SwFormatFooter*>(pNewItem)->GetFooterFormat();


More information about the Libreoffice-commits mailing list