diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2012-01-04 17:31:52 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2012-01-04 17:38:20 +0100 |
commit | 58c4853f5489d8e23ae7aabdb544cde80a711ece (patch) | |
tree | 4726c126e4fda4762d9980bd6d91026804cb8f16 /sw/source | |
parent | 362b694a48695f64b99712822a94d427ef376762 (diff) |
Page Break: fix remaining indicator in some cases
When creating a new page without using a page break, before a page
break, there was a remaining indicator. These are now checked and
removed to avoid such cases.
Diffstat (limited to 'sw/source')
-rwxr-xr-x | sw/source/core/layout/paintfrm.cxx | 15 | ||||
-rw-r--r-- | sw/source/ui/docvw/FrameControlsManager.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/inc/FrameControlsManager.hxx | 1 |
3 files changed, 17 insertions, 7 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index dd0c0a72c36e..074a54aad479 100755 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -3341,15 +3341,16 @@ void SwPageFrm::PaintBreak( ) const if ( pFirstFrm && pFirstFrm->IsTabFrm() ) pFlowFrm = static_cast< const SwTabFrm* >( pFirstFrm ); - if ( pFlowFrm && pFlowFrm->IsPageBreak( sal_True ) ) + SwWrtShell* pWrtSh = dynamic_cast< SwWrtShell* >( pGlobalShell ); + if ( pWrtSh ) { - SwWrtShell* pWrtSh = dynamic_cast< SwWrtShell* >( pGlobalShell ); - if ( pWrtSh ) - { - SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin(); - SwFrameControlsManager& rMngr = rEditWin.GetFrameControlsManager(); + SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin(); + SwFrameControlsManager& rMngr = rEditWin.GetFrameControlsManager(); + + if ( pFlowFrm && pFlowFrm->IsPageBreak( sal_True ) ) rMngr.SetPageBreakControl( this ); - } + else + rMngr.RemoveControlsByType( PageBreak, this ); } } SwLayoutFrm::PaintBreak( ); diff --git a/sw/source/ui/docvw/FrameControlsManager.cxx b/sw/source/ui/docvw/FrameControlsManager.cxx index 40527a64b237..b2621325b360 100644 --- a/sw/source/ui/docvw/FrameControlsManager.cxx +++ b/sw/source/ui/docvw/FrameControlsManager.cxx @@ -122,6 +122,14 @@ void SwFrameControlsManager::RemoveControls( const SwFrm* pFrm ) } } +void SwFrameControlsManager::RemoveControlsByType( FrameControlType eType, const SwFrm* pFrm ) +{ + vector< SwFrameControlPtr >& aVect = m_aControls[eType]; + aVect.erase( remove_if( aVect.begin(), + aVect.end(), + FramePredicate( pFrm ) ), aVect.end() ); +} + void SwFrameControlsManager::HideControls( FrameControlType eType ) { diff --git a/sw/source/ui/inc/FrameControlsManager.hxx b/sw/source/ui/inc/FrameControlsManager.hxx index ec78b1d06aca..06e618ce8fcb 100644 --- a/sw/source/ui/inc/FrameControlsManager.hxx +++ b/sw/source/ui/inc/FrameControlsManager.hxx @@ -61,6 +61,7 @@ class SwFrameControlsManager std::vector< SwFrameControlPtr >& GetControls( FrameControlType eType ); void AddControl( FrameControlType eType, SwFrameControlPtr pControl ); void RemoveControls( const SwFrm* pFrm ); + void RemoveControlsByType( FrameControlType eType, const SwFrm* pFrm ); void HideControls( FrameControlType eType ); void SetReadonlyControls( bool bReadonly ); |