summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-08-12 04:03:57 +0900
committerMike Kaganski <mike.kaganski@collabora.com>2023-08-28 12:43:11 +0200
commitc0ba7ba97ce440eff77526e48e3dfbafacc1cdad (patch)
treedef0753d418bed7f839540ed0d1e36d391734d3e /svx
parent6c8df0fe62ffc62fbe0c228e0928179a0fd2a4e4 (diff)
sd: add ThemeDialog to Impress/Draw, refactor ThemeColorChanger
Add "Theme" menu action, which starts the common ThemeDialog. Add Impress/Draw specific ThemeColorChanger and remove the one in svx, so that only the interface and common function remain. Rename the svx ThemeColorChanger files to THemeColorChangerCommon. Change-Id: Ibf07a443cadf0452747ab6685f65df37b145c984 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155682 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit ad873064b0135e4e00389cd38c7de688286c1fa1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156159 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/Library_svxcore.mk2
-rw-r--r--svx/source/svdraw/svdpage.cxx18
-rw-r--r--svx/source/theme/ThemeColorChangerCommon.cxx (renamed from svx/source/theme/ThemeColorChanger.cxx)39
3 files changed, 4 insertions, 55 deletions
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index b2386326301d..456be06af7fa 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -429,7 +429,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
svx/source/table/tablerows \
svx/source/table/tableundo \
svx/source/table/viewcontactoftableobj \
- svx/source/theme/ThemeColorChanger \
+ svx/source/theme/ThemeColorChangerCommon \
svx/source/theme/ThemeColorPaletteManager \
svx/source/tbxctrls/extrusioncontrols \
svx/source/tbxctrls/fontworkgallery \
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index dd8ac4c53fec..7caed6bbfc58 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -45,7 +45,6 @@
#include <svx/svdundo.hxx>
#include <svx/xfillit0.hxx>
#include <svx/fmdpage.hxx>
-#include <svx/theme/ThemeColorChanger.hxx>
#include <svx/ColorSets.hxx>
#include <sdr/contact/viewcontactofsdrpage.hxx>
@@ -1308,23 +1307,6 @@ void SdrPageProperties::SetTheme(std::shared_ptr<model::Theme> const& pTheme)
return;
mpTheme = pTheme;
-
- if (mpTheme && mpTheme->getColorSet() && mpSdrPage->IsMasterPage())
- {
- SdrModel& rModel = mpSdrPage->getSdrModelFromSdrPage();
- sal_uInt16 nPageCount = rModel.GetPageCount();
- for (sal_uInt16 nPage = 0; nPage < nPageCount; ++nPage)
- {
- SdrPage* pPage = rModel.GetPage(nPage);
- if (!pPage->TRG_HasMasterPage() || &pPage->TRG_GetMasterPage() != mpSdrPage)
- {
- continue;
- }
-
- svx::ThemeColorChanger aChanger(pPage);
- aChanger.apply(mpTheme->getColorSet());
- }
- }
}
std::shared_ptr<model::Theme> const& SdrPageProperties::GetTheme() const
diff --git a/svx/source/theme/ThemeColorChanger.cxx b/svx/source/theme/ThemeColorChangerCommon.cxx
index 7e7ba984729d..db78e1c343b1 100644
--- a/svx/source/theme/ThemeColorChanger.cxx
+++ b/svx/source/theme/ThemeColorChangerCommon.cxx
@@ -7,11 +7,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <svx/theme/ThemeColorChanger.hxx>
+#include <svx/theme/ThemeColorChangerCommon.hxx>
#include <sal/config.h>
-#include <svx/svdpage.hxx>
-#include <svx/svditer.hxx>
#include <editeng/unoprnms.hxx>
#include <docmodel/uno/UnoComplexColor.hxx>
#include <docmodel/theme/ColorSet.hxx>
@@ -24,9 +22,7 @@
using namespace css;
-namespace svx
-{
-namespace theme
+namespace svx::theme
{
namespace
{
@@ -126,35 +122,6 @@ void updateSdrObject(model::ColorSet const& rColorSet, SdrObject* pObject)
updateLineColorSet(rColorSet, xShapeProps);
}
-} // end theme
-
-ThemeColorChanger::ThemeColorChanger(SdrPage* pPage)
- : mpPage(pPage)
-{
-}
-
-ThemeColorChanger::~ThemeColorChanger() = default;
-
-void ThemeColorChanger::apply(std::shared_ptr<model::ColorSet> const& pColorSet)
-{
- for (size_t nObject = 0; nObject < mpPage->GetObjCount(); ++nObject)
- {
- SdrObject* pObject = mpPage->GetObj(nObject);
- theme::updateSdrObject(*pColorSet, pObject);
-
- // update child objects
- SdrObjList* pList = pObject->GetSubList();
- if (pList)
- {
- SdrObjListIter aIter(pList, SdrIterMode::DeepWithGroups);
- while (aIter.IsMore())
- {
- theme::updateSdrObject(*pColorSet, aIter.Next());
- }
- }
- }
-}
-
-} // end svx namespace
+} // end svx::theme namespace
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */