diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-02-25 19:12:23 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-04-08 07:56:19 +0200 |
commit | 4f347ebabad6355014889f0a81b107dc774590fe (patch) | |
tree | 377e010ec06cf3aed7caf5d04cddf28518fbc676 /docmodel | |
parent | ad5756f0529a80fbb537979bcfd9de7a83a69805 (diff) |
use shared_ptr for model::Theme instead of unique_ptr
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 <quikee@gmail.com>
Diffstat (limited to 'docmodel')
-rw-r--r-- | docmodel/source/uno/UnoTheme.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
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 <cppuhelper/queryinterface.hxx> #include <o3tl/enumrange.hxx> #include <comphelper/sequence.hxx> +#include <docmodel/theme/Theme.hxx> using namespace css; -OUString UnoTheme::getName() { return maTheme.GetName(); } +OUString UnoTheme::getName() { return mpTheme->GetName(); } css::uno::Sequence<sal_Int32> UnoTheme::getColorSet() { std::vector<sal_Int32> aColorScheme(12); - auto* pColorSet = maTheme.GetColorSet(); + auto* pColorSet = mpTheme->GetColorSet(); if (pColorSet) { size_t i = 0; @@ -40,9 +41,9 @@ css::uno::Sequence<sal_Int32> UnoTheme::getColorSet() namespace model::theme { -uno::Reference<util::XTheme> createXTheme(model::Theme const& rTheme) +uno::Reference<util::XTheme> createXTheme(std::shared_ptr<model::Theme> const& pTheme) { - return new UnoTheme(rTheme); + return new UnoTheme(pTheme); } } // end model::theme |