summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmloff/inc/XMLThemeContext.hxx5
-rw-r--r--xmloff/source/style/XMLThemeContext.cxx11
2 files changed, 9 insertions, 7 deletions
diff --git a/xmloff/inc/XMLThemeContext.hxx b/xmloff/inc/XMLThemeContext.hxx
index f8ee08d5d4e8..c3056fa74216 100644
--- a/xmloff/inc/XMLThemeContext.hxx
+++ b/xmloff/inc/XMLThemeContext.hxx
@@ -24,13 +24,14 @@ class Theme;
/// Imports the theme
class XMLThemeContext : public SvXMLImportContext
{
- css::uno::Reference<css::uno::XInterface> m_xObject;
+ // Any UNO object that has the "Theme" property - usually XPage (master page) or XModel
+ css::uno::Reference<css::uno::XInterface> m_xObjectWithThemeProperty;
std::shared_ptr<model::Theme> mpTheme;
public:
XMLThemeContext(SvXMLImport& rImport,
css::uno::Reference<css::xml::sax::XFastAttributeList> const& xAttrList,
- css::uno::Reference<css::uno::XInterface> const& xObject);
+ css::uno::Reference<css::uno::XInterface> const& xObjectWithThemeProperty);
~XMLThemeContext();
css::uno::Reference<css::xml::sax::XFastContextHandler> SAL_CALL createFastChildContext(
diff --git a/xmloff/source/style/XMLThemeContext.cxx b/xmloff/source/style/XMLThemeContext.cxx
index 5c210c7a48dc..564d934ff8fb 100644
--- a/xmloff/source/style/XMLThemeContext.cxx
+++ b/xmloff/source/style/XMLThemeContext.cxx
@@ -31,11 +31,11 @@
using namespace css;
using namespace xmloff::token;
-XMLThemeContext::XMLThemeContext(SvXMLImport& rImport,
- const uno::Reference<xml::sax::XFastAttributeList>& xAttrList,
- css::uno::Reference<css::uno::XInterface> const& xObject)
+XMLThemeContext::XMLThemeContext(
+ SvXMLImport& rImport, const uno::Reference<xml::sax::XFastAttributeList>& xAttrList,
+ css::uno::Reference<css::uno::XInterface> const& xObjectWithThemeProperty)
: SvXMLImportContext(rImport)
- , m_xObject(xObject)
+ , m_xObjectWithThemeProperty(xObjectWithThemeProperty)
, mpTheme(new model::Theme)
{
for (const auto& rAttribute : sax_fastparser::castToFastAttributeList(xAttrList))
@@ -56,7 +56,8 @@ XMLThemeContext::~XMLThemeContext()
{
if (mpTheme && mpTheme->getColorSet())
{
- uno::Reference<beans::XPropertySet> xPropertySet(m_xObject, uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(m_xObjectWithThemeProperty,
+ uno::UNO_QUERY);
auto xTheme = model::theme::createXTheme(mpTheme);
xPropertySet->setPropertyValue("Theme", uno::Any(xTheme));
}