summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-09-25 06:39:40 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-09-25 06:43:05 +0200
commitc52982e7410dc8457b0496ece681ff06f1d3596d (patch)
tree14391d21aff0684c9cb3763c29ec415c712a4863 /oox
parent14c521c879514006af72193c7f6546d954626f73 (diff)
better OOXML VBA export
Change-Id: If02aa26e974b0f16b45c5476234c6425fd128ae4
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/filterbase.cxx34
1 files changed, 33 insertions, 1 deletions
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index f56397e2525a..9c7383a44c53 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -148,6 +148,8 @@ struct FilterBaseImpl
Reference< XInteractionHandler > mxInteractionHandler;
Reference< XShape > mxParentShape;
+ bool mbExportVBA;
+
explicit FilterBaseImpl( const Reference< XComponentContext >& rxContext ) throw( RuntimeException );
void setDocumentModel( const Reference< XComponent >& rxComponent ) throw( IllegalArgumentException );
@@ -159,7 +161,8 @@ FilterBaseImpl::FilterBaseImpl( const Reference< XComponentContext >& rxContext
meDirection( FILTERDIRECTION_UNKNOWN ),
meVersion( ECMA_DIALECT ),
mxComponentContext( rxContext, UNO_SET_THROW ),
- mxComponentFactory( rxContext->getServiceManager(), UNO_SET_THROW )
+ mxComponentFactory( rxContext->getServiceManager(), UNO_SET_THROW ),
+ mbExportVBA(false)
{
}
@@ -417,6 +420,30 @@ void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs ) throw( Exce
catch( Exception& )
{
}
+
+ if (rArgs.getLength() >= 1)
+ {
+ Sequence<css::beans::PropertyValue> aSeq;
+ rArgs[0] >>= aSeq;
+ sal_Int32 nLen = aSeq.getLength();
+ for (sal_Int32 i = 0; i < nLen; ++i)
+ {
+ css::beans::PropertyValue& rVal = aSeq[i];
+ if (rVal.Name == "UserData")
+ {
+ css::uno::Sequence<OUString> aUserDataSeq;
+ rVal.Value >>= aUserDataSeq;
+ sal_Int32 nUserDataSeqLen = aUserDataSeq.getLength();
+ for (sal_Int32 j = 0; j < nUserDataSeqLen; ++j)
+ {
+ if (aUserDataSeq[j] == "macro-enabled")
+ {
+ mxImpl->mbExportVBA = true;
+ }
+ }
+ }
+ }
+ }
}
// com.sun.star.document.XImporter interface
@@ -553,6 +580,11 @@ GraphicHelper* FilterBase::implCreateGraphicHelper() const
return new GraphicHelper( mxImpl->mxComponentContext, mxImpl->mxTargetFrame, mxImpl->mxStorage );
}
+bool FilterBase::exportVBA() const
+{
+ return mxImpl->mbExportVBA;
+}
+
} // namespace core
} // namespace oox