summaryrefslogtreecommitdiff
path: root/svx/source/styles
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/styles')
-rw-r--r--svx/source/styles/ColorSets.cxx48
1 files changed, 34 insertions, 14 deletions
diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx
index 97c79b58bcc6..5dcd089fd4ba 100644
--- a/svx/source/styles/ColorSets.cxx
+++ b/svx/source/styles/ColorSets.cxx
@@ -65,33 +65,53 @@ void UpdateTextPortionColorSet(const uno::Reference<beans::XPropertySet>& xPorti
uno::makeAny(static_cast<sal_Int32>(aColor)));
}
-void UpdateSdrObject(svx::Theme* pTheme, SdrObject* pObject)
+void UpdateFillColorSet(const uno::Reference<beans::XPropertySet>& xShape, svx::ColorSet& rColorSet)
{
- svx::ColorSet* pColorSet = pTheme->GetColorSet();
- if (!pColorSet)
+ if (!xShape->getPropertySetInfo()->hasPropertyByName(UNO_NAME_FILLCOLOR_THEME))
{
return;
}
- uno::Reference<text::XTextRange> xShape(pObject->getUnoShape(), uno::UNO_QUERY);
- if (!xShape.is())
+ sal_Int16 nFillColorTheme = -1;
+ xShape->getPropertyValue(UNO_NAME_FILLCOLOR_THEME) >>= nFillColorTheme;
+ if (nFillColorTheme < 0 || nFillColorTheme > 11)
+ {
+ return;
+ }
+
+ Color aColor = rColorSet.getColor(nFillColorTheme);
+ xShape->setPropertyValue(UNO_NAME_FILLCOLOR, uno::makeAny(static_cast<sal_Int32>(aColor)));
+}
+
+void UpdateSdrObject(svx::Theme* pTheme, SdrObject* pObject)
+{
+ svx::ColorSet* pColorSet = pTheme->GetColorSet();
+ if (!pColorSet)
{
- // E.g. group shapes have no text.
return;
}
- uno::Reference<container::XEnumerationAccess> xText(xShape->getText(), uno::UNO_QUERY);
- uno::Reference<container::XEnumeration> xParagraphs = xText->createEnumeration();
- while (xParagraphs->hasMoreElements())
+ uno::Reference<drawing::XShape> xShape = pObject->getUnoShape();
+ uno::Reference<text::XTextRange> xShapeText(xShape, uno::UNO_QUERY);
+ if (xShapeText.is())
{
- uno::Reference<container::XEnumerationAccess> xParagraph(xParagraphs->nextElement(), uno::UNO_QUERY);
- uno::Reference<container::XEnumeration> xPortions = xParagraph->createEnumeration();
- while (xPortions->hasMoreElements())
+ // E.g. group shapes have no text.
+ uno::Reference<container::XEnumerationAccess> xText(xShapeText->getText(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xParagraphs = xText->createEnumeration();
+ while (xParagraphs->hasMoreElements())
{
- uno::Reference<beans::XPropertySet> xPortion(xPortions->nextElement(), uno::UNO_QUERY);
- UpdateTextPortionColorSet(xPortion, *pColorSet);
+ uno::Reference<container::XEnumerationAccess> xParagraph(xParagraphs->nextElement(), uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> xPortions = xParagraph->createEnumeration();
+ while (xPortions->hasMoreElements())
+ {
+ uno::Reference<beans::XPropertySet> xPortion(xPortions->nextElement(), uno::UNO_QUERY);
+ UpdateTextPortionColorSet(xPortion, *pColorSet);
+ }
}
}
+
+ uno::Reference<beans::XPropertySet> xShapeProps(xShape, uno::UNO_QUERY);
+ UpdateFillColorSet(xShapeProps, *pColorSet);
}
}
>git hooks: update the change-id part of commit-msgMiklos Vajna 2019-12-03Don't count terminating newline when determining line lengthStephan Bergmann 2019-06-05git-hooks: show length of first line if it's too longMiklos Vajna 2019-02-13Remove unhelpful "Check for whitespace in front of *'s" from .git-hooksStephan Bergmann 2018-11-22git hooks: Tell what to do in another problematic submodules case.Jan Holesovsky 2018-11-22git hooks: Check that you are not committing to submodules by accident.Jan Holesovsky 2018-10-03Add Python files to pre-commit hook checksThorsten Behrens 2018-05-22Restore .git-hooks/commit-msg accidentally removed earlierTor Lillqvist 2018-05-22tdf#117342 - Add Karasa Jaga to LibreOffice coreRizal Muttaqin 2018-02-09clang-format: improve error message when CI failsMiklos Vajna 2018-01-15git pre-commit hook: catch copy&pasted author identityMiklos Vajna 2017-12-15clang-format: restore lost warning on touching formatted file without checkMiklos Vajna 2017-12-13clang-format: ignore not staged hunksMiklos Vajna 2017-11-21git-hooks: fix pre-commit in submodulesMiklos Vajna 2017-11-20clang-format: enforce coding style via JenkinsMiklos Vajna 2017-11-16git-hooks: mention download link for clang-format when warning about itMiklos Vajna 2017-11-16Warn when commit touches new files, but no suitable clang-format is foundStephan Bergmann 2017-11-13First look for clang-format in CLANG_FORMT env varStephan Bergmann 2017-11-13clang-format: standardize on 5.0.0Miklos Vajna 2017-11-03Enforce coding style with clang-format for new codeMiklos Vajna 2017-10-30git-hooks: don't complain about large .ui filesMichael Stahl 2017-09-20pre-commit-hook: Also check xsl files for whitespace and tabsSamuel Mehrbrodt 2017-09-11insist in a domain in .ui filesCaolán McNamara 2017-09-11disallow .ui translatable entries without context at checkinCaolán McNamara