diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-08-23 11:36:42 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-08-23 11:36:42 +0200 |
commit | 68b27b713285ddee7b44bb9f57e01066e28eb1b1 (patch) | |
tree | 71a280ddc9d30a62bc0cabaee0a3c34689c159b1 | |
parent | db129557dc8b24b3a6e2ab9bfce8748cb592b450 (diff) |
cherry-picked core:cc3d0d and fixed a few things
-rw-r--r-- | sw/source/core/inc/cntfrm.hxx | 10 | ||||
-rw-r--r-- | sw/source/core/inc/flowfrm.hxx | 12 | ||||
-rw-r--r-- | sw/source/core/inc/sectfrm.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/inc/tabfrm.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/layout/flowfrm.cxx | 15 | ||||
-rw-r--r-- | sw/source/core/text/xmldump.cxx | 25 |
6 files changed, 60 insertions, 10 deletions
diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx index 898715b20c..5aab722e30 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 da3e5ca130..bc9557a052 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 f9f7a2ed89..20f68f601f 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 a81b25b744..8e2e507d0e 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 9ba82022bd..51cb49b12c 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 3209fbadac..2d76660a8a 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 |