include/oox/drawingml/theme.hxx               |    8 +++++---
 oox/source/drawingml/themeelementscontext.cxx |   17 ++++++++++++-----
 2 files changed, 17 insertions(+), 8 deletions(-)

New commits:
commit 0f107b93ef4f0542de4effa0a5e1149fb2e5c6f1
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Mon Dec 12 21:41:50 2022 +0900
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Sun Jan 15 09:31:19 2023 +0000

    oox: rename name variables that are imported into oox::Theme
    
    Rename names for font scheme and format scheme in oox::Theme so
    it is easier to know for what they are used for.
    
    Change-Id: I83e2978c407ab7f264de4a161575b086bc5efc03
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143993
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>
    (cherry picked from commit cffe7884342f249e82780a46f9aba4213e9dd378)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145385
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/include/oox/drawingml/theme.hxx b/include/oox/drawingml/theme.hxx
index 6222a4264451..a554fc618657 100644
--- a/include/oox/drawingml/theme.hxx
+++ b/include/oox/drawingml/theme.hxx
@@ -57,8 +57,9 @@ class TextFont;
 class OOX_DLLPUBLIC Theme
 {
 public:
-    void                     setStyleName( const OUString& rStyleName ) { 
maStyleName = rStyleName; }
-    void setThemeName(const OUString& rThemeName) { maThemeName = rThemeName; }
+    void setThemeName(OUString const& rName) { maThemeName = rName; }
+    void setFormatSchemeName(OUString const& rName) { maFormatSchemeName = 
rName; }
+    void setFontSchemeName(OUString const& rName) { maFontSchemeName = rName; }
 
     ClrScheme&               getClrScheme() { return maClrScheme; }
     const ClrScheme&         getClrScheme() const { return maClrScheme; }
@@ -101,8 +102,9 @@ public:
     void addTheme(const css::uno::Reference<css::drawing::XDrawPage>& 
xDrawPage) const;
 
 private:
-    OUString            maStyleName;
     OUString            maThemeName;
+    OUString            maFontSchemeName;
+    OUString            maFormatSchemeName;
     ClrScheme           maClrScheme;
     FillStyleList       maFillStyleList;
     FillStyleList       maBgFillStyleList;
diff --git a/oox/source/drawingml/themeelementscontext.cxx 
b/oox/source/drawingml/themeelementscontext.cxx
index 0922c4b61939..2be1e7702f27 100644
--- a/oox/source/drawingml/themeelementscontext.cxx
+++ b/oox/source/drawingml/themeelementscontext.cxx
@@ -214,17 +214,24 @@ ContextHandlerRef ThemeElementsContext::onCreateContext( 
sal_Int32 nElement, con
     switch( nElement )
     {
         case A_TOKEN( clrScheme ):  // CT_ColorScheme
+        {
             if (rAttribs.hasAttribute(XML_name))
-            {
                 
mrTheme.getClrScheme().SetName(rAttribs.getString(XML_name).get());
-            }
-            return new clrSchemeContext( *this, mrTheme.getClrScheme() );
+            return new clrSchemeContext(*this, mrTheme.getClrScheme());
+        }
         case A_TOKEN( fontScheme ): // CT_FontScheme
-            return new FontSchemeContext( *this, mrTheme.getFontScheme() );
+        {
+            if (rAttribs.hasAttribute(XML_name))
+                mrTheme.setFontSchemeName(rAttribs.getString(XML_name).get());
+            return new FontSchemeContext(*this, mrTheme.getFontScheme());
+        }
 
         case A_TOKEN( fmtScheme ):  // CT_StyleMatrix
-            mrTheme.setStyleName( rAttribs.getString( XML_name ).get() );
+        {
+            if (rAttribs.hasAttribute(XML_name))
+                
mrTheme.setFormatSchemeName(rAttribs.getString(XML_name).get());
             return this;
+        }
 
         case A_TOKEN( fillStyleLst ):   // CT_FillStyleList
             return new FillStyleListContext( *this, mrTheme.getFillStyleList() 
);

Reply via email to