diff options
author | Charu Tyagi <charu.tyagi@ericsson.com> | 2015-03-25 10:13:35 +0530 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-31 12:33:01 +0200 |
commit | 50a0ddb99d53f86b571acc0373f0d2b4ec6d611a (patch) | |
tree | 93b3f897bfd152d0e20de39baee897830b76fe70 /sw | |
parent | 08983ca2872d83685547cb5c05467ad21a27d834 (diff) |
fdo#87441-Send document as Email removes invisible content
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, plus trivial
modifications for -Werror,-Wlogical-op-parentheses and loplugin:bodynotinblock
Change-Id: I149681b3743eaf96e98419bd568f88b451e9ba01
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index f264775577ba..c36bd1c900ac 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -115,6 +115,9 @@ #include <com/sun/star/script/vba/VBAEventId.hpp> #include <editeng/acorrcfg.hxx> #include <SwStyleNameMapper.hxx> +#include <com/sun/star/beans/PropertyValue.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/configuration/theDefaultProvider.hpp> #include <sfx2/fcontnr.hxx> @@ -130,6 +133,9 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; using namespace ::com::sun::star; using namespace ::sfx2; +using com::sun::star::container::XNameAccess; +using com::sun::star::beans::PropertyValue; +using namespace com::sun::star::configuration; // create DocInfo (virtual) SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog( @@ -835,7 +841,26 @@ void SwDocShell::Execute(SfxRequest& rReq) mpWrtShell->StartAllAction(); mpDoc->getIDocumentFieldsAccess().UpdateFlds( NULL, false ); mpDoc->getIDocumentLinksAdministration().EmbedAllLinks(); - mpDoc->RemoveInvisibleContent(); + OUString aConfigRoot = "org.openoffice.Office.Common/ExternalMailer"; + + PropertyValue aProperty; + aProperty.Name = "nodepath"; + aProperty.Value = makeAny( aConfigRoot ); + + Sequence< Any > aArgumentList( 1 ); + aArgumentList[0] = makeAny( aProperty ); + uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xConfigurationProvider; + m_xConfigurationProvider = theDefaultProvider::get(xContext); + Reference< XNameAccess > xNameAccess = + Reference< XNameAccess > (m_xConfigurationProvider->createInstanceWithArguments( + OUString("com.sun.star.configuration.ConfigurationAccess"), + aArgumentList ), + UNO_QUERY ); + bool bRemoveInvisible; + xNameAccess->getByName("Hidden") >>= bRemoveInvisible; + if(bRemoveInvisible) + mpDoc->RemoveInvisibleContent(); if(mpWrtShell) mpWrtShell->EndAllAction(); } |