diff options
Diffstat (limited to 'sw/source/core/docnode/ndsect.cxx')
-rw-r--r-- | sw/source/core/docnode/ndsect.cxx | 55 |
1 files changed, 19 insertions, 36 deletions
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index d61ad4f0b763..278f0d15c8d1 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - +#include <svl/smplhint.hxx> #include <hintids.hxx> #include <sfx2/linkmgr.hxx> #include <svl/itemiter.hxx> @@ -573,7 +573,7 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, sal_Bool bDelNodes ) { SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt ); - pFmt->Modify( &aMsgHint, &aMsgHint ); + pFmt->ModifyNotification( &aMsgHint, &aMsgHint ); } // A ClearRedo could result in a rekursive call of this function and delete some section @@ -786,7 +786,7 @@ void lcl_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd ) // Werden die Nodes nicht geloescht mussen sie bei den Seiten // abmeldet (Frms loeschen) werden, denn sonst bleiben sie // stehen (Undo loescht sie nicht!) - pSrch->DelFrms(); + pSrch->DelFrms(0); ++nPos; } @@ -796,7 +796,7 @@ void lcl_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd ) // Werden die Nodes nicht geloescht mussen sie bei den Seiten // abmeldet (Frms loeschen) werden, denn sonst bleiben sie // stehen (Undo loescht sie nicht!) - pSrch->DelFrms(); + pSrch->DelFrms(0); } } } @@ -921,7 +921,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, // Hier bietet sich als Optimierung an, vorhandene Frames nicht zu // zerstoeren und wieder neu anzulegen, sondern nur umzuhaengen. sal_Bool bInsFrm = bCreateFrms && !pSectNd->GetSection().IsHidden() && - GetDoc()->GetRootFrm(); + GetDoc()->GetCurrentViewShell(); //swmod 071108//swmod 071225 SwNode2Layout *pNode2Layout = NULL; if( bInsFrm ) { @@ -1066,22 +1066,8 @@ SwFrm* SwClearDummies( SwFrm* pFrm ) SwSectionNode::~SwSectionNode() { - { - SwClientIter aIter( *(m_pSection->GetFmt()) ); - SwClient *pLast = aIter.GoStart(); - while ( pLast ) - { - if ( pLast->IsA( TYPE(SwFrm) ) ) - { - SwSectionFrm *pSectFrm = (SwSectionFrm*)pLast; - SwSectionFrm::MoveCntntAndDelete( pSectFrm, sal_True ); - pLast = aIter.GoStart(); - } - else - pLast = aIter++; - } - } - + // mba: test if iteration works as clients will be removed in callback + m_pSection->GetFmt()->CallSwClientNotify( SfxSimpleHint( SFX_HINT_DYING ) ); SwSectionFmt* pFmt = m_pSection->GetFmt(); if( pFmt ) { @@ -1094,10 +1080,10 @@ SwSectionNode::~SwSectionNode() } -SwFrm *SwSectionNode::MakeFrm() +SwFrm *SwSectionNode::MakeFrm( SwFrm *pSib ) { m_pSection->m_Data.SetHiddenFlag(false); - return new SwSectionFrm( *m_pSection ); + return new SwSectionFrm( *m_pSection, pSib ); } //Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom @@ -1107,7 +1093,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) { // also nehme meinen nachfolgenden oder vorhergehenden ContentFrame: SwNodes& rNds = GetNodes(); - if( rNds.IsDocNodes() && rNds.GetDoc()->GetRootFrm() ) + if( rNds.IsDocNodes() && rNds.GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225 { if( GetSection().IsHidden() || IsCntntHidden() ) { @@ -1129,7 +1115,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) while( 0 != (pFrm = aNode2Layout.NextFrm()) ) { ASSERT( pFrm->IsSctFrm(), "Depend von Section keine Section." ); - pNew = rIdx.GetNode().GetCntntNode()->MakeFrm(); + pNew = rIdx.GetNode().GetCntntNode()->MakeFrm( pFrm ); SwSectionNode* pS = rIdx.GetNode().FindSectionNode(); // --> OD 2008-06-23 #156927# @@ -1152,7 +1138,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) bool bInitNewSect = false; if( pS ) { - SwSectionFrm *pSct = new SwSectionFrm( pS->GetSection() ); + SwSectionFrm *pSct = new SwSectionFrm( pS->GetSection(), pFrm ); // OD 14.11.2002 #104684# - prepare <Init()> of new section frame. bInitNewSect = true; SwLayoutFrm* pUp = pSct; @@ -1169,7 +1155,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) // and relation CONTENT_FLOWS_TO for previous paragraph will change. if ( pNew->IsTxtFrm() ) { - ViewShell* pViewShell( pNew->GetShell() ); + ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { @@ -1196,7 +1182,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) // and relation CONTENT_FLOWS_TO for previous paragraph will change. if ( pNew->IsTxtFrm() ) { - ViewShell* pViewShell( pNew->GetShell() ); + ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { @@ -1338,7 +1324,7 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c // dann kopiere auch noch die Links/Server if( pNewSect->IsLinkType() ) // den Link eintragen - pNewSect->CreateLink( pDoc->GetRootFrm() ? CREATE_CONNECT + pNewSect->CreateLink( pDoc->GetCurrentViewShell() ? CREATE_CONNECT //swmod 071108//swmod 071225 : CREATE_NONE ); // falls als Server aus dem Undo kopiert wird, wieder eintragen @@ -1393,7 +1379,7 @@ void SwSectionNode::NodesArrChgd() if( !rNds.IsDocNodes() ) { SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt ); - pFmt->Modify( &aMsgHint, &aMsgHint ); + pFmt->ModifyNotification( &aMsgHint, &aMsgHint ); } pFmt->LockModify(); @@ -1420,12 +1406,9 @@ void SwSectionNode::NodesArrChgd() { ASSERT( pDoc == GetDoc(), "verschieben in unterschiedliche Documente?" ); - if (m_pSection->IsLinkType()) - { - m_pSection->CreateLink( pDoc->GetRootFrm() ? CREATE_CONNECT - : CREATE_NONE ); - } - + if( m_pSection->IsLinkType() ) // den Link austragen + m_pSection->CreateLink( pDoc->GetCurrentViewShell() ? CREATE_CONNECT //swmod 071108 + : CREATE_NONE );//swmod 071225 if (m_pSection->IsServer()) { pDoc->GetLinkManager().InsertServer( m_pSection->GetObject() ); |