summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-10-24 14:12:12 +0200
committerAndras Timar <andras.timar@collabora.com>2016-11-21 10:24:35 +0000
commit4e29dfdd4f95101a1ceff36f735bb0d2eef4d919 (patch)
tree86280fe437bb22982c0b294814c3fb7443508841 /editeng
parentbe2de90a0f32fb6054691cdba4ef533f236a1072 (diff)
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@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit ee33745ced5ae12f9ae7735fac16a7298ccae474) Change-Id: I34f7d84526462665b1ec09aba966c98cd4e8795f Reviewed-on: https://gerrit.libreoffice.org/30425 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editeng.cxx4
-rw-r--r--editeng/source/editeng/editundo.cxx2
-rw-r--r--editeng/source/editeng/impedit.hxx2
-rw-r--r--editeng/source/editeng/impedit3.cxx6
4 files changed, 9 insertions, 5 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index c3bb938d900c..17152125fb60 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 faea53b4acea..f900867d7f5d 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 15a433901933..6cea1073f0a8 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 4d8f67403d95..1e748c4c801d 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 );
}