From 4f347ebabad6355014889f0a81b107dc774590fe Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Sat, 25 Feb 2023 19:12:23 +0900 Subject: use shared_ptr for model::Theme instead of unique_ptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also change other cases to use the shared_ptr so there is no need to do copies and replace some of docmodel/theme/Theme.hxximports with forward declarations. Change-Id: I4588cb25e05e5f3e535011fffb68a8075b05aecc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147691 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- docmodel/source/uno/UnoTheme.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'docmodel') diff --git a/docmodel/source/uno/UnoTheme.cxx b/docmodel/source/uno/UnoTheme.cxx index 80d2735be47b..30d3f827fea2 100644 --- a/docmodel/source/uno/UnoTheme.cxx +++ b/docmodel/source/uno/UnoTheme.cxx @@ -13,15 +13,16 @@ #include #include #include +#include using namespace css; -OUString UnoTheme::getName() { return maTheme.GetName(); } +OUString UnoTheme::getName() { return mpTheme->GetName(); } css::uno::Sequence UnoTheme::getColorSet() { std::vector aColorScheme(12); - auto* pColorSet = maTheme.GetColorSet(); + auto* pColorSet = mpTheme->GetColorSet(); if (pColorSet) { size_t i = 0; @@ -40,9 +41,9 @@ css::uno::Sequence UnoTheme::getColorSet() namespace model::theme { -uno::Reference createXTheme(model::Theme const& rTheme) +uno::Reference createXTheme(std::shared_ptr const& pTheme) { - return new UnoTheme(rTheme); + return new UnoTheme(pTheme); } } // end model::theme -- cgit