summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-31 10:53:32 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-03-31 12:33:02 +0200
commitbc1e32d6b8f5df9cf55a110bfcf3331a6756673e (patch)
tree5c35e22e4ed9dd4eee1f42662d99b63e6b1da73c /sw
parent735616a6ddfe34c2ba4694c659c71a834f6935a1 (diff)
Better only call RestoreInvisibleContent if previously removed
Change-Id: I229db9567771a4967065d81fa99fee2c23dbcb3e
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/docsh.hxx4
-rw-r--r--sw/source/uibase/app/docsh2.cxx9
-rw-r--r--sw/source/uibase/app/docshini.cxx9
3 files changed, 16 insertions, 6 deletions
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx
index 66084a488295..52db8674484b 100644
--- a/sw/inc/docsh.hxx
+++ b/sw/inc/docsh.hxx
@@ -80,6 +80,10 @@ class SW_DLLPUBLIC SwDocShell: public SfxObjectShell, public SfxListener
sal_Int16 mnUpdateDocMode; ///< contains the com::sun::star::document::UpdateDocMode
bool bIsATemplate; ///< prevent nested calls of UpdateFontList
+ bool mbRemovedInvisibleContent;
+ ///< whether SID_MAIL_PREPAREEXPORT removed content that
+ ///< SID_MAIL_EXPORT_FINISHED needs to restore
+
/// Methods for access to doc.
SAL_DLLPRIVATE void AddLink();
SAL_DLLPRIVATE void RemoveLink();
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index c97402734f00..75baf6cb5782 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -837,7 +837,9 @@ void SwDocShell::Execute(SfxRequest& rReq)
mpDoc->getIDocumentFieldsAccess().UpdateFlds( NULL, false );
mpDoc->getIDocumentLinksAdministration().EmbedAllLinks();
- if(officecfg::Office::Common::ExternalMailer::Hidden::get())
+ mbRemovedInvisibleContent
+ = officecfg::Office::Common::ExternalMailer::Hidden::get();
+ if(mbRemovedInvisibleContent)
mpDoc->RemoveInvisibleContent();
if(mpWrtShell)
mpWrtShell->EndAllAction();
@@ -848,8 +850,9 @@ void SwDocShell::Execute(SfxRequest& rReq)
{
if(mpWrtShell)
mpWrtShell->StartAllAction();
- //try to undo the removal of invisible content
- mpDoc->RestoreInvisibleContent();
+ //try to undo any removal of invisible content
+ if(mbRemovedInvisibleContent)
+ mpDoc->RestoreInvisibleContent();
if(mpWrtShell)
mpWrtShell->EndAllAction();
}
diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx
index ac75cce580ad..cd5c68213488 100644
--- a/sw/source/uibase/app/docshini.cxx
+++ b/sw/source/uibase/app/docshini.cxx
@@ -328,7 +328,8 @@ SwDocShell::SwDocShell( SfxObjectCreateMode eMode ) :
mpWrtShell( 0 ),
mpOLEChildList( 0 ),
mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
- bIsATemplate(false)
+ bIsATemplate(false),
+ mbRemovedInvisibleContent(false)
{
Init_Impl();
}
@@ -343,7 +344,8 @@ SwDocShell::SwDocShell( const sal_uInt64 i_nSfxCreationFlags ) :
mpWrtShell( 0 ),
mpOLEChildList( 0 ),
mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
- bIsATemplate(false)
+ bIsATemplate(false),
+ mbRemovedInvisibleContent(false)
{
Init_Impl();
}
@@ -358,7 +360,8 @@ SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ):
mpWrtShell( 0 ),
mpOLEChildList( 0 ),
mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG),
- bIsATemplate(false)
+ bIsATemplate(false),
+ mbRemovedInvisibleContent(false)
{
Init_Impl();
}