summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-09-07 16:18:53 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-09-08 07:51:16 +0000
commit1805b7549cd240009bf67eba3a030e19b4f6f046 (patch)
tree25c446e683da695fbee786f86978123fe214d187
parent969ba5fe88c2f817f2121bb26f2d472cff891399 (diff)
tdf#90991: sw: fix style preview creating undo objects
SwDocStyleSheet::FillStyleSheet() already takes care to remove all temporarily created styles, so assume that works and suppress the creation of user-visible Undo objects. Change-Id: I748f0e8304c42e767b331ebd22be0290b9c0d89d (cherry picked from commit 779b547ca6271156a59965569fa44fbeb3f63ce5) Reviewed-on: https://gerrit.libreoffice.org/18382 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/source/uibase/app/docstyle.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index bb0f62f0b6a7..016b1a101371 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -1727,6 +1727,9 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType )
bPhysical = 0 != pCharFormat;
if( bFillOnlyInfo && !bPhysical )
{
+ // create style (plus all needed parents) and clean it up
+ // later - without affecting the undo/redo stack
+ ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo());
bDeleteInfo = true;
::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc );
pCharFormat = lcl_FindCharFormat(rDoc, aName, this, true );
@@ -1754,6 +1757,7 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType )
bPhysical = 0 != pColl;
if( bFillOnlyInfo && !bPhysical )
{
+ ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo());
bDeleteInfo = true;
::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc );
pColl = lcl_FindParaFormat(rDoc, aName, this, true );
@@ -1777,6 +1781,7 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType )
bPhysical = 0 != pFrameFormat;
if( bFillOnlyInfo && bPhysical )
{
+ ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo());
bDeleteInfo = true;
::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc );
pFrameFormat = lcl_FindFrameFormat(rDoc, aName, this, true );
@@ -1796,6 +1801,7 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType )
bPhysical = 0 != pDesc;
if( bFillOnlyInfo && !pDesc )
{
+ ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo());
bDeleteInfo = true;
::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc );
pDesc = lcl_FindPageDesc( rDoc, aName, this, true );
@@ -1824,6 +1830,7 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType )
bPhysical = 0 != pNumRule;
if( bFillOnlyInfo && !pNumRule )
{
+ ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo());
bDeleteInfo = true;
::lcl_SaveStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc );
pNumRule = lcl_FindNumRule( rDoc, aName, this, true );
@@ -1890,7 +1897,10 @@ bool SwDocStyleSheet::FillStyleSheet( FillStyleType eFType )
SetMask( _nMask );
}
if( bDeleteInfo && bFillOnlyInfo )
+ {
+ ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo());
::lcl_DeleteInfoStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc );
+ }
return bRet;
}