summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2012-01-04 17:31:52 +0100
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2012-01-04 17:38:20 +0100
commit58c4853f5489d8e23ae7aabdb544cde80a711ece (patch)
tree4726c126e4fda4762d9980bd6d91026804cb8f16
parent362b694a48695f64b99712822a94d427ef376762 (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.
-rwxr-xr-xsw/source/core/layout/paintfrm.cxx15
-rw-r--r--sw/source/ui/docvw/FrameControlsManager.cxx8
-rw-r--r--sw/source/ui/inc/FrameControlsManager.hxx1
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 );