[Libreoffice-commits] .: sw/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Wed Jan 4 08:38:23 PST 2012


 sw/source/core/layout/paintfrm.cxx          |   15 ++++++++-------
 sw/source/ui/docvw/FrameControlsManager.cxx |    8 ++++++++
 sw/source/ui/inc/FrameControlsManager.hxx   |    1 +
 3 files changed, 17 insertions(+), 7 deletions(-)

New commits:
commit 58c4853f5489d8e23ae7aabdb544cde80a711ece
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Wed Jan 4 17:31:52 2012 +0100

    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.

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index dd0c0a7..074a54a 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 40527a6..b262132 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 ec78b1d..06e618c 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 );
 


More information about the Libreoffice-commits mailing list