summaryrefslogtreecommitdiff
path: root/xmloff/source
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff/source')
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx9
-rw-r--r--xmloff/source/style/XMLThemeContext.cxx8
2 files changed, 10 insertions, 7 deletions
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index bc7d5e6ad35d..c237fe12470b 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -74,6 +74,7 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/util/Color.hpp>
#include <docmodel/uno/UnoTheme.hxx>
+#include <docmodel/theme/Theme.hxx>
#include <o3tl/enumrange.hxx>
using namespace ::com::sun::star;
@@ -2383,13 +2384,13 @@ void SdXMLExport::ExportThemeElement(const uno::Reference<drawing::XDrawPage>& x
if (!pUnoTheme)
return;
- auto const& rTheme = pUnoTheme->getTheme();
+ auto pTheme = pUnoTheme->getTheme();
- if (!rTheme.GetName().isEmpty())
- AddAttribute(XML_NAMESPACE_LO_EXT, XML_NAME, rTheme.GetName());
+ if (!pTheme->GetName().isEmpty())
+ AddAttribute(XML_NAMESPACE_LO_EXT, XML_NAME, pTheme->GetName());
SvXMLElementExport aTheme(*this, XML_NAMESPACE_LO_EXT, XML_THEME, true, true);
- auto* pColorSet = rTheme.GetColorSet();
+ auto* pColorSet = pTheme->GetColorSet();
if (!pColorSet->getName().isEmpty())
AddAttribute(XML_NAMESPACE_LO_EXT, XML_NAME, pColorSet->getName());
SvXMLElementExport aColorTable(*this, XML_NAMESPACE_LO_EXT, XML_COLOR_TABLE, true, true);
diff --git a/xmloff/source/style/XMLThemeContext.cxx b/xmloff/source/style/XMLThemeContext.cxx
index 8a9a5cdbc558..e35aed99c46f 100644
--- a/xmloff/source/style/XMLThemeContext.cxx
+++ b/xmloff/source/style/XMLThemeContext.cxx
@@ -26,6 +26,7 @@
#include <comphelper/sequence.hxx>
#include <docmodel/uno/UnoTheme.hxx>
+#include <docmodel/theme/Theme.hxx>
using namespace css;
using namespace xmloff::token;
@@ -35,6 +36,7 @@ XMLThemeContext::XMLThemeContext(SvXMLImport& rImport,
css::uno::Reference<css::drawing::XDrawPage> const& xPage)
: SvXMLImportContext(rImport)
, m_xPage(xPage)
+ , mpTheme(new model::Theme)
{
for (const auto& rAttribute : sax_fastparser::castToFastAttributeList(xAttrList))
{
@@ -43,7 +45,7 @@ XMLThemeContext::XMLThemeContext(SvXMLImport& rImport,
case XML_ELEMENT(LO_EXT, XML_NAME):
{
OUString aName = rAttribute.toString();
- maTheme.SetName(aName);
+ mpTheme->SetName(aName);
break;
}
}
@@ -53,7 +55,7 @@ XMLThemeContext::XMLThemeContext(SvXMLImport& rImport,
XMLThemeContext::~XMLThemeContext()
{
uno::Reference<beans::XPropertySet> xPropertySet(m_xPage, uno::UNO_QUERY);
- uno::Reference<util::XTheme> xTheme(new UnoTheme(maTheme));
+ auto xTheme = model::theme::createXTheme(mpTheme);
xPropertySet->setPropertyValue("Theme", uno::Any(xTheme));
}
@@ -62,7 +64,7 @@ uno::Reference<xml::sax::XFastContextHandler> SAL_CALL XMLThemeContext::createFa
{
if (nElement == XML_ELEMENT(LO_EXT, XML_COLOR_TABLE))
{
- return new XMLColorTableContext(GetImport(), xAttribs, maTheme);
+ return new XMLColorTableContext(GetImport(), xAttribs, *mpTheme);
}
return nullptr;