summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-09-07 16:18:53 +0200
committerMichael Stahl <mstahl@redhat.com>2015-09-07 16:49:59 +0200
commit779b547ca6271156a59965569fa44fbeb3f63ce5 (patch)
tree45ddfbd99d9104fa523063d3a6c65f1a50ef2f2f
parent93067f37cf22aa119db5878c4345fea500cbbb42 (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
-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 0f824c8de827..6aa4b79030e7 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -1777,6 +1777,9 @@ bool SwDocStyleSheet::FillStyleSheet(
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 );
@@ -1804,6 +1807,7 @@ bool SwDocStyleSheet::FillStyleSheet(
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 );
@@ -1827,6 +1831,7 @@ bool SwDocStyleSheet::FillStyleSheet(
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 );
@@ -1846,6 +1851,7 @@ bool SwDocStyleSheet::FillStyleSheet(
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 );
@@ -1874,6 +1880,7 @@ bool SwDocStyleSheet::FillStyleSheet(
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 );
@@ -1946,7 +1953,10 @@ bool SwDocStyleSheet::FillStyleSheet(
SetMask( _nMask );
}
if( bDeleteInfo && bFillOnlyInfo )
+ {
+ ::sw::UndoGuard const ug(rDoc.GetIDocumentUndoRedo());
::lcl_DeleteInfoStyles( static_cast< sal_uInt16 >(nFamily), aDelArr, rDoc );
+ }
return bRet;
}