summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-02-25 23:07:20 +0900
committerTomaž Vajngerl <quikee@gmail.com>2023-04-08 07:56:27 +0200
commitdad60bd52a25c1997d3724361ea81c0fe99b1872 (patch)
tree19e1e2067f00754789b347569a48be4aa7ab8af5 /sc
parent4f347ebabad6355014889f0a81b107dc774590fe (diff)
oox: add model::Theme to oox::Theme and remove createSvxTheme
This is the start of the change where oox::Theme is only a holder of model::Theme and not a oox structure. This is probably the easiest way how to refactor that. In this commit only prepare that and make the code work the same as it did before. Change-Id: I926a35fd0db383ddb182dc83b36411b2d40b8530 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147692 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/oox/workbookfragment.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 685b9e91ea4f..076dbe24b63f 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -349,9 +349,17 @@ void WorkbookFragment::finalizeImport()
// read the theme substream
OUString aThemeFragmentPath = getFragmentPathFromFirstTypeFromOfficeDoc( u"theme" );
- model::Theme aTheme;
+ auto& rOoxTheme = getTheme();
+
+ auto pTheme = rOoxTheme.oox::drawingml::Theme::getTheme(); // needed full name here because a conflict with WorkbookHelper and Theme in ThemeBuffer
+ if (!pTheme)
+ {
+ pTheme = std::make_shared<model::Theme>();
+ rOoxTheme.setTheme(pTheme);
+ }
+
if( !aThemeFragmentPath.isEmpty() )
- importOoxFragment(new ThemeFragmentHandler(getFilter(), aThemeFragmentPath, getTheme(), aTheme));
+ importOoxFragment(new ThemeFragmentHandler(getFilter(), aThemeFragmentPath, rOoxTheme, *pTheme));
xGlobalSegment->setPosition( 0.25 );
// read the styles substream (requires finalized theme buffer)