summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-06-20 17:39:40 +0900
committerXisco Fauli <xiscofauli@libreoffice.org>2023-06-21 08:54:11 +0200
commit6e75e18782051d174cb198e129a4d68fe0af9a33 (patch)
treecd9a4ef6924976a00a7f6cfd2584f83bb06ccfcc
parent3ba4bbcd13dda662832de8cb603b725a66cb53f0 (diff)
sd: fix setting theme for notes master
Notes master also needs a theme set or the document will not load properly. For now we don't save the theme for the notes master on import, so we can only set the default "LibreOffice" theme instead. Change-Id: Ia9e5db53d4e1a4ca06b10d147cc879475166dfd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153314 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit b13733de130e2f1ca029315e977dc01bd196b05b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153344 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx22
1 files changed, 17 insertions, 5 deletions
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 023f29dc82c6..88f1d4f541ab 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -66,6 +66,7 @@
#include <svx/svdpage.hxx>
#include <svx/unoapi.hxx>
#include <svx/svdogrp.hxx>
+#include <svx/ColorSets.hxx>
#include <sdmod.hxx>
#include <sdpage.hxx>
@@ -2044,12 +2045,23 @@ void PowerPointExport::WriteNotesMaster()
"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml");
// write theme per master
- WriteTheme(mnMasterPages, nullptr);
+ // TODO: Need to implement theme support for note master, so the
+ // note master has his own theme associated.
- // add implicit relation to the presentation theme
- addRelation(pFS->getOutputStream(),
- oox::getRelationship(Relationship::THEME),
- Concat2View("../theme/theme" + OUString::number(mnMasterPages + 1) + ".xml"));
+ // For now just use the default theme
+ auto const* pDefaultColorSet = svx::ColorSets::get().getColorSet(u"LibreOffice");
+ if (pDefaultColorSet)
+ {
+ auto pTheme = std::make_shared<model::Theme>("Office Theme");
+ pTheme->setColorSet(std::make_shared<model::ColorSet>(*pDefaultColorSet));
+
+ WriteTheme(mnMasterPages, pTheme.get());
+
+ // add implicit relation to the presentation theme
+ addRelation(pFS->getOutputStream(),
+ oox::getRelationship(Relationship::THEME),
+ Concat2View("../theme/theme" + OUString::number(mnMasterPages + 1) + ".xml"));
+ }
pFS->startElementNS(XML_p, XML_notesMaster, PNMSS);