[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Tue Aug 23 04:54:28 PDT 2011


 sw/source/core/inc/cntfrm.hxx     |   10 ++++++++++
 sw/source/core/inc/flowfrm.hxx    |   12 +++++++++++-
 sw/source/core/inc/sectfrm.hxx    |    4 ++++
 sw/source/core/inc/tabfrm.hxx     |    4 ++++
 sw/source/core/layout/flowfrm.cxx |   15 ++++++---------
 sw/source/core/text/xmldump.cxx   |   25 +++++++++++++++++++++++++
 6 files changed, 60 insertions(+), 10 deletions(-)

New commits:
commit 68b27b713285ddee7b44bb9f57e01066e28eb1b1
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Tue Aug 23 11:36:42 2011 +0200

    cherry-picked core:cc3d0d and fixed a few things

diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx
index 898715b..5aab722 100644
--- a/sw/source/core/inc/cntfrm.hxx
+++ b/sw/source/core/inc/cntfrm.hxx
@@ -84,6 +84,8 @@ public:
 
     inline const SwCntntFrm *GetFollow() const;
     inline		 SwCntntFrm *GetFollow();
+    inline const SwCntntFrm *GetPrecede() const;
+    inline       SwCntntFrm *GetPrecede();
     SwTxtFrm* FindMaster() const;
 
         //Layoutabhaengiges Cursortravelling
@@ -147,6 +149,14 @@ inline SwCntntFrm *SwCntntFrm::GetFollow()
 {
     return (SwCntntFrm*)SwFlowFrm::GetFollow();
 }
+inline const SwCntntFrm *SwCntntFrm::GetPrecede() const
+{
+    return (const SwCntntFrm*)SwFlowFrm::GetPrecede();
+}
+inline SwCntntFrm *SwCntntFrm::GetPrecede()
+{
+    return (SwCntntFrm*)SwFlowFrm::GetPrecede();
+}
 
 #endif
 
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index da3e5ca..bc9557a 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -115,6 +115,7 @@ class SwFlowFrm
 protected:
 
     SwFlowFrm *pFollow;
+    SwFlowFrm *pPrecede;
 
     sal_Bool bIsFollow	:1;	//Ist's ein Follow
     sal_Bool bLockJoin	:1;	//Join (und damit deleten) verboten wenn sal_True!
@@ -171,7 +172,10 @@ public:
     const  SwFlowFrm *GetFollow() const	   { return pFollow;   }
            SwFlowFrm *GetFollow()	   	   { return pFollow;   }
            sal_Bool  	  IsAnFollow( const SwFlowFrm *pFlow ) const;
-    inline void   	  SetFollow( SwFlowFrm *pNew ) { pFollow = pNew; }
+    inline void       SetFollow( SwFlowFrm *pNew );
+
+    const  SwFlowFrm *GetPrecede() const   { return pPrecede;   }
+           SwFlowFrm *GetPrecede()         { return pPrecede;   }
 
     sal_Bool IsJoinLocked() const { return bLockJoin; }
     sal_Bool IsAnyJoinLocked() const { return bLockJoin || HasLockedFollow(); }
@@ -249,6 +253,12 @@ inline sal_Bool SwFlowFrm::IsFwdMoveAllowed()
     return rThis.GetIndPrev() != 0;
 }
 
+inline void SwFlowFrm::SetFollow( SwFlowFrm *pNew )
+{
+    pFollow = pNew;
+    if ( pFollow != NULL )
+        pFollow->pPrecede = this;
+}
 
 #endif
 
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index f9f7a2e..20f68f6 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -128,6 +128,10 @@ public:
 
     bool IsBalancedSection() const;
 
+#if OSL_DEBUG_LEVEL > 1
+    virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
+#endif
+
     DECL_FIXEDMEMPOOL_NEWDEL(SwSectionFrm)
 };
 
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index a81b25b..8e2e507 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -216,6 +216,10 @@ public:
     sal_uInt16 GetBottomLineSize() const;
     // <-- collapsing
 
+#if OSL_DEBUG_LEVEL > 1
+    virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer);
+#endif
+
     DECL_FIXEDMEMPOOL_NEWDEL(SwTabFrm)
 };
 
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 9ba8202..51cb49b 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -81,7 +81,8 @@ sal_Bool SwFlowFrm::bMoveBwdJump = sal_False;
 
 SwFlowFrm::SwFlowFrm( SwFrm &rFrm ) :
     rThis( rFrm ),
-    pFollow( 0 )
+    pFollow( 0 ),
+    pPrecede( 0 )
 {
     bLockJoin = bIsFollow = bCntntLock = bOwnFtnNum =
         bFtnLock = bFlyLock = sal_False;
@@ -691,16 +692,12 @@ SwTxtFrm* SwCntntFrm::FindMaster() const
 {
     OSL_ENSURE( IsFollow(), "SwCntntFrm::FindMaster(): !IsFollow" );
 
-    const SwCntntFrm* pCnt = GetPrevCntntFrm();
+    const SwCntntFrm* pPrec = GetPrecede();
 
-    while ( pCnt )
+    if ( pPrec && pPrec->HasFollow() && pPrec->GetFollow() == this )
     {
-        if ( pCnt->HasFollow() && pCnt->GetFollow() == this )
-        {
-            OSL_ENSURE( pCnt->IsTxtFrm(), "NoTxtFrm with follow found" );
-            return (SwTxtFrm*)pCnt;
-        }
-        pCnt = pCnt->GetPrevCntntFrm();
+        OSL_ENSURE( pPrec->IsTxtFrm(), "NoTxtFrm with follow found" );
+        return ( SwTxtFrm* )pPrec;
     }
 
     OSL_FAIL( "Follow ist lost in Space." );
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 3209fba..2d76660 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -29,6 +29,8 @@
 #include "precompiled_sw.hxx"
 
 #include "frame.hxx"
+#include "sectfrm.hxx"
+#include "tabfrm.hxx"
 #include "txtfrm.hxx"
 #include "porlin.hxx"
 #include "porlay.hxx"
@@ -311,6 +313,29 @@ void SwTxtFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
     SwFrm::dumpAsXmlAttributes( writer );
     if ( HasFollow() )
         xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%p", GetFollow() );
+
+    if ( pPrecede != NULL )
+        xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%p", (SwTxtFrm*)pPrecede );
+}
+
+void SwSectionFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
+{
+    SwFrm::dumpAsXmlAttributes( writer );
+    if ( HasFollow() )
+        xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%p", GetFollow() );
+
+    if ( pPrecede != NULL )
+        xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%p", (SwSectionFrm*)pPrecede );
+}
+
+void SwTabFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
+{
+    SwFrm::dumpAsXmlAttributes( writer );
+    if ( HasFollow() )
+        xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%p", GetFollow() );
+
+    if ( pPrecede != NULL )
+        xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%p", (SwTabFrm*)pPrecede );
 }
 
 #endif


More information about the Libreoffice-commits mailing list