summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-01-02 19:16:54 +0000
committerCaolán McNamara <caolanm@redhat.com>2023-01-04 14:05:46 +0000
commitbd5cc6a50f2acdabc1c93bd49ce52c79a70c2144 (patch)
tree732a2735087656511f65fb0f9b3fa9396c48e373 /sd
parentef533553559fe09b4afab651fc692885d1acf4ed (diff)
Related: tdf#150339 remove SID_ATTR_COLOR_STR
re: https://gerrit.libreoffice.org/c/core/+/144866 "ColorString is not needed anymore (we used that in LOK previously)." Change-Id: I50a2f0e2ad254afb8ede33b05c89ae40bfeb4d3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144967 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/uiimpress.cxx7
-rw-r--r--sd/source/ui/view/drtxtob1.cxx38
-rw-r--r--sd/source/ui/view/drviews2.cxx27
-rw-r--r--sd/source/ui/view/drviews7.cxx25
4 files changed, 7 insertions, 90 deletions
diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx
index 0235cada8194..f01f8e25108e 100644
--- a/sd/qa/unit/uiimpress.cxx
+++ b/sd/qa/unit/uiimpress.cxx
@@ -756,10 +756,9 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testPageFillColor)
// Set FillPageColor
- uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence({
- { "ColorString", uno::Any(OUString("ff0000")) },
- }));
-
+ uno::Sequence<beans::PropertyValue> aPropertyValues = {
+ comphelper::makePropertyValue("FillColor", static_cast<sal_Int32>(0xff0000)),
+ };
dispatchCommand(mxComponent, ".uno:FillPageColor", aPropertyValues);
SdPage* pPage = pViewShell->getCurrentPage();
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index 86b7a698aa95..6282b750aa06 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -66,43 +66,6 @@
#include <memory>
-namespace
-{
- void lcl_convertStringArguments(sal_uInt16 nSlot, const std::unique_ptr<SfxItemSet>& pArgs)
- {
- Color aColor;
- OUString sColor;
- const SfxPoolItem* pColorStringItem = nullptr;
-
- if (SfxItemState::SET != pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem))
- return;
-
- sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue();
-
- if (sColor == "transparent")
- aColor = COL_TRANSPARENT;
- else
- aColor = Color(ColorTransparency, sColor.toInt32(16));
-
- switch (nSlot)
- {
- case SID_ATTR_CHAR_COLOR:
- {
- SvxColorItem aColorItem(aColor, EE_CHAR_COLOR);
- pArgs->Put(aColorItem);
- break;
- }
-
- case SID_ATTR_CHAR_BACK_COLOR:
- {
- SvxColorItem pBackgroundItem(aColor, EE_CHAR_BKGCOLOR);
- pArgs->Put(pBackgroundItem);
- break;
- }
- }
- }
-}
-
namespace sd {
/**
@@ -811,7 +774,6 @@ void TextObjectBar::Execute( SfxRequest &rReq )
}
std::unique_ptr<SfxItemSet> pNewArgs = pArgs->Clone();
- lcl_convertStringArguments(nSlot, pNewArgs);
// Merge the color parameters to the color itself.
std::unique_ptr<SvxColorItem> pColorItem;
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index cd575c493423..b2c2803a2438 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -545,7 +545,6 @@ public:
void lcl_convertStringArguments(sal_uInt16 nSlot, const std::unique_ptr<SfxItemSet>& pArgs)
{
- Color aColor;
const SfxPoolItem* pItem = nullptr;
if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_LINE_WIDTH_ARG, false, &pItem))
@@ -558,32 +557,6 @@ public:
XLineWidthItem aItem(nValue);
pArgs->Put(aItem);
}
- if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pItem))
- {
- OUString sColor = static_cast<const SfxStringItem*>(pItem)->GetValue();
-
- if (sColor == "transparent")
- aColor = COL_TRANSPARENT;
- else
- aColor = Color(ColorTransparency, sColor.toInt32(16));
-
- switch (nSlot)
- {
- case SID_ATTR_LINE_COLOR:
- {
- XLineColorItem aLineColorItem(OUString(), aColor);
- pArgs->Put(aLineColorItem);
- break;
- }
-
- case SID_ATTR_FILL_COLOR:
- {
- XFillColorItem aFillColorItem(OUString(), aColor);
- pArgs->Put(aFillColorItem);
- break;
- }
- }
- }
if (SfxItemState::SET == pArgs->GetItemState(SID_FILL_GRADIENT_JSON, false, &pItem))
{
const SfxStringItem* pJSON = static_cast<const SfxStringItem*>(pItem);
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index b7968a638ce5..141112bf9f9b 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1799,28 +1799,11 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
case SID_ATTR_PAGE_COLOR:
{
- if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pItem))
- {
- Color aColor;
- OUString sColor;
-
- sColor = static_cast<const SfxStringItem*>(pItem)->GetValue();
-
- if (sColor == "transparent")
- aColor = COL_TRANSPARENT;
- else
- aColor = Color(ColorTransparency, sColor.toInt32(16));
-
- XFillColorItem aColorItem(OUString(), aColor);
- rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_SOLID ) );
- rPageProperties.PutItem( aColorItem );
- }
+ rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_SOLID ) );
+ if (const XFillColorItem* pColorItem = static_cast<const XFillColorItem*>(pArgs->GetItem(SID_ATTR_PAGE_COLOR)))
+ rPageProperties.PutItem(XFillColorItem("", pColorItem->GetColorValue()));
else
- {
- XFillColorItem aColorItem( pArgs->Get( XATTR_FILLCOLOR ) );
- rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_SOLID ) );
- rPageProperties.PutItem( aColorItem );
- }
+ rPageProperties.PutItem(pArgs->Get(XATTR_FILLCOLOR));
}
break;