summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-10-24 14:12:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-31 06:04:58 +0000
commitee33745ced5ae12f9ae7735fac16a7298ccae474 (patch)
tree086da25f3d1a629e57956931d998edd0e42d761c /editeng
parent49909dca5856aada5340d44f03a271d38e038039 (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. Change-Id: I34f7d84526462665b1ec09aba966c98cd4e8795f 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>
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 a6128729a660..bde286a10b72 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -741,9 +741,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 1e09ce6e0160..90ea9ba1c788 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 1771aac97ebb..b76fa58b749b 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -859,7 +859,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 );
svtools::ColorConfig& GetColorConfig();
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 1d62eba9c4ed..81ef5db095b8 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4022,7 +4022,7 @@ EditSelection* ImpEditEngine::SelectParagraph( sal_Int32 nPara )
return pSel;
}
-void ImpEditEngine::FormatAndUpdate( EditView* pCurView )
+void ImpEditEngine::FormatAndUpdate( EditView* pCurView, bool bCalledFromUndo )
{
if ( bDowning )
return ;
@@ -4031,6 +4031,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 );
}