diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/filter/eppt/eppt.cxx | 7 | ||||
-rw-r--r-- | sd/qa/unit/uiimpress.cxx | 7 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-epptooxml.cxx | 1 | ||||
-rw-r--r-- | sd/source/ui/docshell/docshell.cxx | 1 | ||||
-rw-r--r-- | sd/source/ui/func/fuconstr.cxx | 1 | ||||
-rw-r--r-- | sd/source/ui/func/fupage.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 16 |
8 files changed, 24 insertions, 19 deletions
diff --git a/sd/qa/filter/eppt/eppt.cxx b/sd/qa/filter/eppt/eppt.cxx index 738539c5eff7..6c73ccec5c2b 100644 --- a/sd/qa/filter/eppt/eppt.cxx +++ b/sd/qa/filter/eppt/eppt.cxx @@ -16,6 +16,7 @@ #include <test/xmldocptr.hxx> #include <docmodel/uno/UnoTheme.hxx> +#include <docmodel/theme/Theme.hxx> using namespace ::com::sun::star; @@ -61,7 +62,7 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeExport) xDrawPagesSupplier->getDrawPages()->getByIndex(0), uno::UNO_QUERY); uno::Reference<beans::XPropertySet> xMasterPage(xDrawPage->getMasterPage(), uno::UNO_QUERY); - model::Theme aTheme("mytheme"); + auto pTheme = std::make_shared<model::Theme>("mytheme"); std::unique_ptr<model::ColorSet> pColorSet(new model::ColorSet("mycolorscheme")); pColorSet->add(model::ThemeColorType::Dark1, 0x1); pColorSet->add(model::ThemeColorType::Light1, 0x2); @@ -75,9 +76,9 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeExport) pColorSet->add(model::ThemeColorType::Accent6, 0xa); pColorSet->add(model::ThemeColorType::Hyperlink, 0xb); pColorSet->add(model::ThemeColorType::FollowedHyperlink, 0xc); - aTheme.SetColorSet(std::move(pColorSet)); + pTheme->SetColorSet(std::move(pColorSet)); - xMasterPage->setPropertyValue("Theme", uno::Any(model::theme::createXTheme(aTheme))); + xMasterPage->setPropertyValue("Theme", uno::Any(model::theme::createXTheme(pTheme))); // When exporting to PPTX: save("Impress Office Open XML"); diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index d9f71fcbb7a1..9c295a531b8c 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -46,6 +46,7 @@ #include <comphelper/propertyvalue.hxx> #include <comphelper/sequenceashashmap.hxx> #include <docmodel/uno/UnoTheme.hxx> +#include <docmodel/theme/Theme.hxx> #include <drawdoc.hxx> #include <DrawDocShell.hxx> @@ -1151,7 +1152,7 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testThemeShapeInsert) uno::Reference<beans::XPropertySet> xMasterPage(xMasterPageTarget->getMasterPage(), uno::UNO_QUERY); - model::Theme aTheme("mytheme"); + auto pTheme = std::make_shared<model::Theme>("mytheme"); std::unique_ptr<model::ColorSet> pColorSet(new model::ColorSet("mycolorscheme")); pColorSet->add(model::ThemeColorType::Dark1, 0x0); pColorSet->add(model::ThemeColorType::Light1, 0x1); @@ -1165,9 +1166,9 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testThemeShapeInsert) pColorSet->add(model::ThemeColorType::Accent6, 0x9); pColorSet->add(model::ThemeColorType::Hyperlink, 0xa); pColorSet->add(model::ThemeColorType::FollowedHyperlink, 0xb); - aTheme.SetColorSet(std::move(pColorSet)); + pTheme->SetColorSet(std::move(pColorSet)); - xMasterPage->setPropertyValue("Theme", uno::Any(model::theme::createXTheme(aTheme))); + xMasterPage->setPropertyValue("Theme", uno::Any(model::theme::createXTheme(pTheme))); // When inserting a shape: uno::Sequence<beans::PropertyValue> aArgs = { diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index f857f10bec7f..dd555514650a 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -56,6 +56,7 @@ #include <comphelper/diagnose_ex.hxx> #include <oox/export/utils.hxx> +#include <docmodel/theme/Theme.hxx> #include "pptx-animations.hxx" #include "../ppt/pptanimations.hxx" diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx index 3aacb189f826..fd564bcc8f4a 100644 --- a/sd/source/ui/docshell/docshell.cxx +++ b/sd/source/ui/docshell/docshell.cxx @@ -61,6 +61,7 @@ #include <comphelper/lok.hxx> #include <DrawViewShell.hxx> #include <sdpage.hxx> +#include <docmodel/theme/Theme.hxx> using namespace sd; #define ShellClass_DrawDocShell diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx index eee7094a78f8..3f3085b60d20 100644 --- a/sd/source/ui/func/fuconstr.cxx +++ b/sd/source/ui/func/fuconstr.cxx @@ -29,6 +29,7 @@ #include <svx/xflclit.hxx> #include <svx/xlineit0.hxx> #include <svx/xlnclit.hxx> +#include <docmodel/theme/Theme.hxx> #include <app.hrc> #include <strings.hrc> diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 7416916f01e7..27a794124b0c 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -48,6 +48,7 @@ #include <editeng/pbinitem.hxx> #include <sfx2/opengrf.hxx> #include <sal/log.hxx> +#include <docmodel/theme/Theme.hxx> #include <strings.hrc> #include <sdpage.hxx> @@ -573,8 +574,8 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs ) auto it = pGrabBag->GetGrabBag().find("Theme"); if (it != pGrabBag->GetGrabBag().end()) { - std::unique_ptr<model::Theme> pTheme = model::Theme::FromAny(it->second); - pMasterPage->getSdrPageProperties().SetTheme(std::move(pTheme)); + std::shared_ptr<model::Theme> pTheme = model::Theme::FromAny(it->second); + pMasterPage->getSdrPageProperties().SetTheme(pTheme); } else { diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index ca741e9bb53f..e5a231d4d405 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -131,6 +131,7 @@ #include <tools/json_writer.hxx> #include <tools/UnitConversion.hxx> #include <svx/ColorSets.hxx> +#include <docmodel/theme/Theme.hxx> #include <app.hrc> @@ -1283,8 +1284,8 @@ void SAL_CALL SdXImpressDocument::setPropertyValue( const OUString& aPropertyNam case WID_MODEL_THEME: { SdrModel& rModel = getSdrModelFromUnoModel(); - std::unique_ptr<model::Theme> pTheme = model::Theme::FromAny(aValue); - rModel.setTheme(std::move(pTheme)); + std::shared_ptr<model::Theme> pTheme = model::Theme::FromAny(aValue); + rModel.setTheme(pTheme); } break; default: diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 65008effaa12..87508052da87 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -76,6 +76,7 @@ #include <tools/debug.hxx> #include <tools/stream.hxx> #include <docmodel/uno/UnoTheme.hxx> +#include <docmodel/theme/Theme.hxx> #include <o3tl/string_view.hxx> using ::com::sun::star::animations::XAnimationNode; @@ -984,8 +985,7 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName if (aValue >>= xTheme) { auto& rUnoTheme = dynamic_cast<UnoTheme&>(*xTheme); - std::unique_ptr<model::Theme> pTheme(new model::Theme(rUnoTheme.getTheme())); - pPage->getSdrPageProperties().SetTheme(std::move(pTheme)); + pPage->getSdrPageProperties().SetTheme(rUnoTheme.getTheme()); } break; } @@ -993,8 +993,8 @@ void SAL_CALL SdGenericDrawPage::setPropertyValue( const OUString& aPropertyName case WID_PAGE_THEME_UNO_REPRESENTATION: { SdrPage* pPage = GetPage(); - std::unique_ptr<model::Theme> pTheme = model::Theme::FromAny(aValue); - pPage->getSdrPageProperties().SetTheme(std::move(pTheme)); + std::shared_ptr<model::Theme> pTheme = model::Theme::FromAny(aValue); + pPage->getSdrPageProperties().SetTheme(pTheme); break; } @@ -1316,9 +1316,9 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) { SdrPage* pPage = GetPage(); css::uno::Reference<css::util::XTheme> xTheme; - auto const& pTheme = pPage->getSdrPageProperties().GetTheme(); + auto pTheme = pPage->getSdrPageProperties().GetTheme(); if (pTheme) - xTheme = new UnoTheme(*pTheme); + xTheme = model::theme::createXTheme(pTheme); aAny <<= xTheme; break; } @@ -1326,11 +1326,9 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) case WID_PAGE_THEME_UNO_REPRESENTATION: { SdrPage* pPage = GetPage(); - auto const& pTheme = pPage->getSdrPageProperties().GetTheme(); + auto pTheme = pPage->getSdrPageProperties().GetTheme(); if (pTheme) - { pTheme->ToAny(aAny); - } else { beans::PropertyValues aValues; |