xmloff/inc/XMLThemeContext.hxx          |    5 +++--
 xmloff/source/style/XMLThemeContext.cxx |   11 ++++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)

New commits:
commit ca120667c3855fbfc1e3579d4cf4ed0e3b93770a
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Mon Sep 4 12:06:06 2023 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Tue Sep 5 13:23:32 2023 +0200

    xmloff: rename m_aObject in XMLThemeContext and clarify
    
    Clarify what m_aObject is in the theme import (XMLThemeContext)
    and rename to a better name. It is refering to an object that has
    the "Theme" property, which is usually found in on XPage (master
    page) or XModel, but technically could be any object that has the
    property (for getting and setting the XTheme type).
    
    Change-Id: If15a8c42a0c516cd0566f4ee9e81f7315ef1651e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156511
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

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));
     }

Reply via email to