diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2018-12-11 19:47:25 +0300 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-12-14 11:42:44 +0100 |
commit | 0932e4bb9a4e4a25be092dcf87a0119d1894ac30 (patch) | |
tree | 5cbec163bad58a354b39b9816bf55757b6998c29 /oox | |
parent | 44416a16f40167cf9a60ff6fc7990a07df4e7d7b (diff) |
sw: support for saving into .dotx file
Template format now supported not only for import, but for
export too.
Change-Id: I9fb9da14c4d6466b6979fa37fb2c0359ce5
Reviewed-on: https://gerrit.libreoffice.org/64947
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/core/filterbase.cxx | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index c19905417114..9b52bff85f84 100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/task/XStatusIndicator.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/supportsservice.hxx> +#include <comphelper/documentconstants.hxx> #include <unotools/mediadescriptor.hxx> #include <osl/mutex.hxx> #include <osl/diagnose.h> @@ -150,6 +151,8 @@ struct FilterBaseImpl bool mbExportVBA; + bool mbExportTemplate; + /// @throws RuntimeException explicit FilterBaseImpl( const Reference< XComponentContext >& rxContext ); @@ -163,7 +166,8 @@ FilterBaseImpl::FilterBaseImpl( const Reference< XComponentContext >& rxContext meDirection( FILTERDIRECTION_UNKNOWN ), meVersion( ECMA_DIALECT ), mxComponentContext( rxContext, UNO_SET_THROW ), - mbExportVBA(false) + mbExportVBA(false), + mbExportTemplate(false) { } @@ -421,10 +425,8 @@ void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs ) { Sequence<css::beans::PropertyValue> aSeq; rArgs[0] >>= aSeq; - sal_Int32 nLen = aSeq.getLength(); - for (sal_Int32 i = 0; i < nLen; ++i) + for (const auto& rVal : aSeq) { - css::beans::PropertyValue& rVal = aSeq[i]; if (rVal.Name == "UserData") { css::uno::Sequence<OUString> aUserDataSeq; @@ -438,6 +440,12 @@ void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs ) } } } + else if (rVal.Name == "Flags") + { + sal_Int32 nFlags; + rVal.Value >>= nFlags; + mxImpl->mbExportTemplate = bool(static_cast<SfxFilterFlags>(nFlags) & SfxFilterFlags::TEMPLATE); + } } } } @@ -581,6 +589,11 @@ bool FilterBase::exportVBA() const return mxImpl->mbExportVBA; } +bool FilterBase::isExportTemplate() const +{ + return mxImpl->mbExportTemplate; +} + } // namespace core } // namespace oox |