summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/drawingml/theme.cxx15
-rw-r--r--oox/source/drawingml/themefragmenthandler.cxx6
-rw-r--r--oox/source/ppt/presentationfragmenthandler.cxx6
3 files changed, 26 insertions, 1 deletions
diff --git a/oox/source/drawingml/theme.cxx b/oox/source/drawingml/theme.cxx
index 036779d21711..be9f199ff8f8 100644
--- a/oox/source/drawingml/theme.cxx
+++ b/oox/source/drawingml/theme.cxx
@@ -20,6 +20,12 @@
#include <oox/drawingml/theme.hxx>
#include <oox/token/tokens.hxx>
#include <drawingml/textcharacterproperties.hxx>
+#include <com/sun/star/beans/PropertyValues.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <comphelper/propertyvalue.hxx>
+
+using namespace com::sun::star;
namespace oox::drawingml {
@@ -97,6 +103,15 @@ const TextFont* Theme::resolveFont( const OUString& rName ) const
return nullptr;
}
+void Theme::addTheme(const css::uno::Reference<css::drawing::XDrawPage>& xDrawPage) const
+{
+ beans::PropertyValues aValues = {
+ comphelper::makePropertyValue("Name", maThemeName),
+ };
+ uno::Reference<beans::XPropertySet> xPropertySet(xDrawPage, uno::UNO_QUERY);
+ xPropertySet->setPropertyValue("Theme", uno::makeAny(aValues));
+}
+
} // namespace oox::drawingml
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/source/drawingml/themefragmenthandler.cxx b/oox/source/drawingml/themefragmenthandler.cxx
index 5c5d4a6ab07a..5ab0ee1e6b21 100644
--- a/oox/source/drawingml/themefragmenthandler.cxx
+++ b/oox/source/drawingml/themefragmenthandler.cxx
@@ -21,6 +21,7 @@
#include <drawingml/objectdefaultcontext.hxx>
#include <oox/drawingml/theme.hxx>
#include <oox/token/namespaces.hxx>
+#include <oox/helper/attributelist.hxx>
#include <drawingml/themeelementscontext.hxx>
using namespace ::oox::core;
@@ -37,7 +38,7 @@ ThemeFragmentHandler::~ThemeFragmentHandler()
{
}
-ContextHandlerRef ThemeFragmentHandler::onCreateContext( sal_Int32 nElement, const AttributeList& )
+ContextHandlerRef ThemeFragmentHandler::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs)
{
// CT_OfficeStyleSheet
switch( getCurrentElement() )
@@ -46,7 +47,10 @@ ContextHandlerRef ThemeFragmentHandler::onCreateContext( sal_Int32 nElement, con
switch( nElement )
{
case A_TOKEN( theme ):
+ {
+ mrTheme.setThemeName(rAttribs.getString(XML_name).get());
return this;
+ }
}
break;
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 5d5c3a594009..a088bf04636e 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -378,6 +378,12 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage
rFilter.importFragment( new LayoutFragmentHandler( rFilter, aLayoutFragmentPath, pMasterPersistPtr ) );
pMasterPersistPtr->createBackground( rFilter );
pMasterPersistPtr->createXShapes( rFilter );
+
+ oox::drawingml::ThemePtr pTheme = pMasterPersistPtr->getTheme();
+ if (pTheme)
+ {
+ pTheme->addTheme(pMasterPersistPtr->getPage());
+ }
}
}
}