[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - editeng/source include/editeng

Noel Grandin noel at peralex.com
Mon Nov 21 10:24:57 UTC 2016


 editeng/source/editeng/editeng.cxx  |    4 ++--
 editeng/source/editeng/editundo.cxx |    2 +-
 editeng/source/editeng/impedit.hxx  |    2 +-
 editeng/source/editeng/impedit3.cxx |    6 +++++-
 include/editeng/editeng.hxx         |    2 +-
 5 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 4e29dfdd4f95101a1ceff36f735bb0d2eef4d919
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Oct 24 14:12:12 2016 +0200

    tdf#103334 - EDITING: Undo on bullet point style
    
    I have checked the normal model and the editing model after UNDO, and
    all seems to be well, this is purely a rendering/lack-of-invalidation
    issue.
    
    The extra invalidation I add here is restricted to the UNDO case to
    prevent tripping up a LOK unit test
    (SdTiledRenderingTest::testCursorViews).
    
    I confess to not having followed the invalidation logic all the way to
    see why exactly it makes the bug go away.
    
    Reviewed-on: https://gerrit.libreoffice.org/30225
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
    (cherry picked from commit ee33745ced5ae12f9ae7735fac16a7298ccae474)
    
    Change-Id: I34f7d84526462665b1ec09aba966c98cd4e8795f
    Reviewed-on: https://gerrit.libreoffice.org/30425
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index c3bb938..1715212 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -740,9 +740,9 @@ void EditEngine::SetUndoMode(bool b)
     pImpEditEngine->SetUndoMode(b);
 }
 
-void EditEngine::FormatAndUpdate(EditView* pCurView)
+void EditEngine::FormatAndUpdate(EditView* pCurView, bool bCalledFromUndo)
 {
-    pImpEditEngine->FormatAndUpdate(pCurView);
+    pImpEditEngine->FormatAndUpdate(pCurView, bCalledFromUndo);
 }
 
 void EditEngine::Undo(EditView* pView)
diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx
index faea53b..f900867 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -77,7 +77,7 @@ bool EditUndoManager::Undo()
 
     aNewSel.Min() = aNewSel.Max();
     mpEditEngine->GetActiveView()->GetImpEditView()->SetEditSelection( aNewSel );
-    mpEditEngine->FormatAndUpdate( mpEditEngine->GetActiveView() );
+    mpEditEngine->FormatAndUpdate( mpEditEngine->GetActiveView(), true );
 
     return bDone;
 }
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 15a4339..6cea107 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -853,7 +853,7 @@ public:
     void            SetNotifyHdl( const Link<EENotify&,void>& rLink )     { aNotifyHdl = rLink; }
     const Link<EENotify&,void>&   GetNotifyHdl() const            { return aNotifyHdl; }
 
-    void            FormatAndUpdate( EditView* pCurView = nullptr );
+    void            FormatAndUpdate( EditView* pCurView = nullptr, bool bCalledFromUndo = false );
     inline void     IdleFormatAndUpdate( EditView* pCurView = nullptr );
 
     svtools::ColorConfig& GetColorConfig();
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 4d8f674..1e748c4 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4026,7 +4026,7 @@ EditSelection* ImpEditEngine::SelectParagraph( sal_Int32 nPara )
     return pSel;
 }
 
-void ImpEditEngine::FormatAndUpdate( EditView* pCurView )
+void ImpEditEngine::FormatAndUpdate( EditView* pCurView, bool bCalledFromUndo )
 {
     if ( bDowning )
         return ;
@@ -4035,6 +4035,10 @@ void ImpEditEngine::FormatAndUpdate( EditView* pCurView )
         IdleFormatAndUpdate( pCurView );
     else
     {
+        if (bCalledFromUndo)
+            // in order to make bullet points that have had their styles changed, redraw themselves
+            for ( sal_Int32 nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ )
+                GetParaPortions()[nPortion]->MarkInvalid( 0, 0 );
         FormatDoc();
         UpdateViews( pCurView );
     }
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index e5b5e94..382d3d4 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -599,7 +599,7 @@ public:
     const ViewsType& GetEditViews() const;
 
     void SetUndoMode(bool b);
-    void FormatAndUpdate(EditView* pCurView = nullptr);
+    void FormatAndUpdate(EditView* pCurView = nullptr, bool bCalledFromUndo = false);
 
     void Undo(EditView* pView);
     void Redo(EditView* pView);


More information about the Libreoffice-commits mailing list