summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-08-31 08:11:18 +0200
committerTomaž Vajngerl <quikee@gmail.com>2023-09-01 07:29:02 +0200
commit70663f464b24f223c4174681b9a469d9f554bcee (patch)
tree4edc9645201768665d48c7b54fb0b33e216f9261 /svx/source
parentd88779fc86385dde1215fd28b78a69eacc6b4f97 (diff)
sd: set the theme for all master pages
It can be annoying for the user to set the theme one by one for each master page. The reason for this is that in MSO the master slide (which contains the theme) has multiple layouts, which are converted to master pages in LO. As LO doesn't group master pages together the theme is defined on each master page, so it is needed to change each master page one by one. Change-Id: I94d75246ca012bbbb005ab376446c0941b8f57ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156361 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/theme/ThemeColorChangerCommon.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/svx/source/theme/ThemeColorChangerCommon.cxx b/svx/source/theme/ThemeColorChangerCommon.cxx
index 44f041f5f3b0..446943100101 100644
--- a/svx/source/theme/ThemeColorChangerCommon.cxx
+++ b/svx/source/theme/ThemeColorChangerCommon.cxx
@@ -104,13 +104,8 @@ bool updateEditEngTextSections(model::ColorSet const& rColorSet, SdrObject* pObj
bool updateObjectAttributes(model::ColorSet const& rColorSet, SdrObject& rObject,
SfxUndoManager* pUndoManager)
{
- if (pUndoManager)
- {
- pUndoManager->AddUndoAction(
- rObject.getSdrModelFromSdrObject().GetSdrUndoFactory().CreateUndoAttrObject(
- rObject, true, true));
- }
bool bChanged = false;
+
auto aItemSet = rObject.GetMergedItemSet();
if (const XFillColorItem* pItem = aItemSet.GetItemIfSet(XATTR_FILLCOLOR, false))
@@ -151,6 +146,13 @@ bool updateObjectAttributes(model::ColorSet const& rColorSet, SdrObject& rObject
}
if (bChanged)
{
+ const bool bUndo = pUndoManager && pUndoManager->IsInListAction();
+ if (bUndo)
+ {
+ pUndoManager->AddUndoAction(
+ rObject.getSdrModelFromSdrObject().GetSdrUndoFactory().CreateUndoAttrObject(
+ rObject));
+ }
rObject.SetMergedItemSetAndBroadcast(aItemSet);
}
return bChanged;
@@ -164,10 +166,9 @@ void updateSdrObject(model::ColorSet const& rColorSet, SdrObject* pObject, SdrVi
{
if (!pObject)
return;
-
+ updateObjectAttributes(rColorSet, *pObject, pUndoManager);
if (pView)
updateEditEngTextSections(rColorSet, pObject, *pView);
- updateObjectAttributes(rColorSet, *pObject, pUndoManager);
}
} // end svx::theme namespace