diff options
Diffstat (limited to 'oox')
-rw-r--r-- | oox/qa/unit/drawingml.cxx | 9 | ||||
-rw-r--r-- | oox/source/drawingml/shape.cxx | 1 | ||||
-rw-r--r-- | oox/source/drawingml/theme.cxx | 9 | ||||
-rw-r--r-- | oox/source/export/ThemeExport.cxx | 1 |
4 files changed, 11 insertions, 9 deletions
diff --git a/oox/qa/unit/drawingml.cxx b/oox/qa/unit/drawingml.cxx index 994006e76113..c468fd126584 100644 --- a/oox/qa/unit/drawingml.cxx +++ b/oox/qa/unit/drawingml.cxx @@ -32,6 +32,7 @@ #include <docmodel/uno/UnoThemeColor.hxx> #include <docmodel/uno/UnoTheme.hxx> +#include <docmodel/theme/Theme.hxx> #include <comphelper/sequenceashashmap.hxx> @@ -383,13 +384,13 @@ CPPUNIT_TEST_FIXTURE(OoxDrawingmlTest, testPptxTheme) CPPUNIT_ASSERT(xTheme.is()); auto* pUnoTheme = dynamic_cast<UnoTheme*>(xTheme.get()); CPPUNIT_ASSERT(pUnoTheme); - auto const& rTheme = pUnoTheme->getTheme(); + auto pTheme = pUnoTheme->getTheme(); - CPPUNIT_ASSERT_EQUAL(OUString("Office Theme"), rTheme.GetName()); - CPPUNIT_ASSERT_EQUAL(OUString("Office"), rTheme.GetColorSet()->getName()); + CPPUNIT_ASSERT_EQUAL(OUString("Office Theme"), pTheme->GetName()); + CPPUNIT_ASSERT_EQUAL(OUString("Office"), pTheme->GetColorSet()->getName()); CPPUNIT_ASSERT_EQUAL(Color(0x954F72), - rTheme.GetColorSet()->getColor(model::ThemeColorType::FollowedHyperlink)); + pTheme->GetColorSet()->getColor(model::ThemeColorType::FollowedHyperlink)); // Check the reference to that theme: uno::Reference<drawing::XShapes> xDrawPageShapes(xDrawPage, uno::UNO_QUERY); diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index e3923c1b647d..41d2befad1a7 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -110,6 +110,7 @@ #include <sal/log.hxx> #include <svx/sdtaitm.hxx> #include <oox/drawingml/diagram/diagram.hxx> +#include <docmodel/theme/Theme.hxx> #include <i18nlangtag/languagetag.hxx> #include <i18nlangtag/mslangid.hxx> diff --git a/oox/source/drawingml/theme.cxx b/oox/source/drawingml/theme.cxx index f4ebe63e00e2..b108d8106322 100644 --- a/oox/source/drawingml/theme.cxx +++ b/oox/source/drawingml/theme.cxx @@ -109,9 +109,10 @@ const TextFont* Theme::resolveFont( std::u16string_view rName ) const return nullptr; } -std::unique_ptr<model::Theme> Theme::createSvxTheme() const +std::shared_ptr<model::Theme> Theme::createSvxTheme() const { - auto pTheme = std::make_unique<model::Theme>(maThemeName); + auto pTheme = std::make_shared<model::Theme>(maThemeName); + auto pColorSet = std::make_unique<model::ColorSet>(maClrScheme.GetName()); maClrScheme.fill(*pColorSet); pTheme->SetColorSet(std::move(pColorSet)); @@ -184,9 +185,7 @@ void Theme::addTheme(const css::uno::Reference<css::drawing::XDrawPage>& xDrawPa if (!pPage) return; - std::unique_ptr<model::Theme> pTheme = createSvxTheme(); - - pPage->getSdrPageProperties().SetTheme(std::move(pTheme)); + pPage->getSdrPageProperties().SetTheme(createSvxTheme()); } } // namespace oox::drawingml diff --git a/oox/source/export/ThemeExport.cxx b/oox/source/export/ThemeExport.cxx index 6733a70b2057..3abc2cb1adb6 100644 --- a/oox/source/export/ThemeExport.cxx +++ b/oox/source/export/ThemeExport.cxx @@ -13,6 +13,7 @@ #include <oox/token/properties.hxx> #include <oox/token/tokens.hxx> #include <oox/export/utils.hxx> +#include <docmodel/theme/Theme.hxx> #include <sax/fshelper.hxx> #include <sax/fastattribs.hxx> #include <unordered_map> |