summaryrefslogtreecommitdiff
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
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>
-rw-r--r--include/sfx2/sfxsids.hrc2
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx39
-rw-r--r--sc/source/ui/view/editsh.cxx16
-rw-r--r--sc/source/ui/view/formatsh.cxx47
-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
-rw-r--r--svx/sdi/svx.sdi16
-rw-r--r--sw/sdi/swriter.sdi4
-rw-r--r--sw/source/uibase/shells/basesh.cxx22
-rw-r--r--sw/source/uibase/shells/drawdlg.cxx35
-rw-r--r--sw/source/uibase/shells/drwtxtex.cxx38
-rw-r--r--sw/source/uibase/shells/textsh1.cxx18
14 files changed, 30 insertions, 304 deletions
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index a0289c0881ab..e911e1d0d65d 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -598,7 +598,7 @@ class SvxZoomItem;
#define SID_ATTR_CHAR_COLOR_BACKGROUND (SID_SVX_START + 489)
#define SID_ATTR_CHAR_COLOR_BACKGROUND_EXT (SID_SVX_START + 490)
#define SID_ATTR_CHAR_COLOR2 (SID_SVX_START + 537)
-#define SID_ATTR_COLOR_STR TypedWhichId<SfxStringItem>(SID_SVX_START + 540)
+
#define SID_COMP_BIBLIOGRAPHY (SID_SVX_START + 880)
#define SID_ADDRESS_DATA_SOURCE (SID_SVX_START + 934)
#define SID_OPEN_SMARTTAGOPTIONS TypedWhichId<SfxBoolItem>(SID_SVX_START + 1062)
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 53273c77c7cc..568218da662b 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -68,10 +68,8 @@ SFX_IMPL_INTERFACE(ScDrawShell, SfxShell)
namespace
{
- void lcl_convertStringArguments(sal_uInt16 nSlot, SfxItemSet& rArgs)
+ void lcl_convertStringArguments(SfxItemSet& rArgs)
{
- Color aColor;
-
if (const SvxDoubleItem* pWidthItem = rArgs.GetItemIfSet(SID_ATTR_LINE_WIDTH_ARG, false))
{
double fValue = pWidthItem->GetValue();
@@ -82,39 +80,6 @@ namespace
XLineWidthItem aItem(nValue);
rArgs.Put(aItem);
}
- else if (const SfxStringItem* pColorItem = rArgs.GetItemIfSet(SID_ATTR_COLOR_STR, false))
- {
- OUString sColor = pColorItem->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);
- rArgs.Put(aLineColorItem);
- break;
- }
-
- case SID_ATTR_FILL_COLOR:
- {
- XFillColorItem aFillColorItem(OUString(), aColor);
- rArgs.Put(aFillColorItem);
- break;
- }
-
- case SID_ATTR_SHADOW_COLOR:
- {
- XColorItem aItem(SDRATTR_SHADOWCOLOR, aColor);
- rArgs.Put(aItem);
- break;
- }
- }
- }
if (const SfxStringItem* pJSON = rArgs.GetItemIfSet(SID_FILL_GRADIENT_JSON, false))
{
XGradient aGradient = XGradient::fromJSON(pJSON->GetValue());
@@ -290,7 +255,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
if( pView->AreObjectsMarked() )
{
SfxItemSet aNewArgs = rReq.GetArgs()->CloneAsValue();
- lcl_convertStringArguments( rReq.GetSlot(), aNewArgs );
+ lcl_convertStringArguments(aNewArgs);
pView->SetAttrToMarked( aNewArgs, false );
}
else
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 2b36efa11ec8..52566f45d7b8 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -968,21 +968,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
{
if (pArgs)
{
- if ( const SfxStringItem* pColorStringItem = pArgs->GetItemIfSet( SID_ATTR_COLOR_STR, false ) )
- {
- Color aColor;
- OUString sColor = pColorStringItem->GetValue();
- if ( sColor == "transparent" )
- aColor = COL_TRANSPARENT;
- else
- aColor = Color( ColorTransparency, sColor.toInt32( 16 ) );
-
- aSet.Put( SvxColorItem( aColor, EE_CHAR_COLOR ) );
- }
- else
- {
- aSet.Put( pArgs->Get( pArgs->GetPool()->GetWhich( nSlot ) ) );
- }
+ aSet.Put( pArgs->Get( pArgs->GetPool()->GetWhich( nSlot ) ) );
rBindings.Invalidate( nSlot );
}
}
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 5513c9d76b75..15a705c0f53a 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1628,27 +1628,6 @@ void ScFormatShell::ExecuteTextAttr( SfxRequest& rReq )
}
-namespace
-{
- bool lcl_getColorFromStr(const SfxItemSet *pArgs, Color &rColor)
- {
- const SfxStringItem* pColorStringItem = nullptr;
-
- if (pArgs && (pColorStringItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_STR, false)))
- {
- OUString sColor;
- sColor = pColorStringItem->GetValue();
-
- if (sColor == "transparent")
- rColor = COL_TRANSPARENT;
- else
- rColor = Color(ColorTransparency, sColor.toInt32(16));
- return true;
- }
- return false;
- }
-}
-
void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
{
ScTabViewShell* pTabViewShell = GetViewData().GetViewShell();
@@ -1792,18 +1771,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
case SID_ATTR_CHAR_COLOR:
case SID_SCATTR_PROTECTION :
{
- Color aColor;
- if (lcl_getColorFromStr(pNewAttrs, aColor))
- {
- SvxColorItem aColorItem(pTabViewShell->GetSelectionPattern()->
- GetItem( ATTR_FONT_COLOR ) );
- aColorItem.SetValue(aColor);
- pTabViewShell->ApplyAttr(aColorItem, false);
- }
- else
- {
- pTabViewShell->ApplyAttr( pNewAttrs->Get( pNewAttrs->GetPool()->GetWhich( nSlot) ), false);
- }
+ pTabViewShell->ApplyAttr( pNewAttrs->Get( pNewAttrs->GetPool()->GetWhich( nSlot) ), false);
rBindings.Invalidate( nSlot );
rBindings.Update( nSlot );
@@ -1871,9 +1839,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
{
::editeng::SvxBorderLine* pDefLine = pTabViewShell->GetDefaultFrameLine();
- Color aColor;
- if (!lcl_getColorFromStr(pNewAttrs, aColor))
- aColor = pNewAttrs->Get( SID_FRAME_LINECOLOR ).GetValue();
+ Color aColor = pNewAttrs->Get( SID_FRAME_LINECOLOR ).GetValue();
// Update default line
if ( pDefLine )
@@ -1983,13 +1949,8 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
// ATTR_BACKGROUND (=SID_ATTR_BRUSH) has to be set to two IDs:
case SID_BACKGROUND_COLOR:
{
- Color aColor;
-
- if (!lcl_getColorFromStr(pNewAttrs, aColor))
- {
- const SvxColorItem& rNewColorItem = pNewAttrs->Get( SID_BACKGROUND_COLOR );
- aColor = rNewColorItem.GetValue();
- }
+ const SvxColorItem& rNewColorItem = pNewAttrs->Get( SID_BACKGROUND_COLOR );
+ Color aColor = rNewColorItem.GetValue();
SvxBrushItem aBrushItem(
pTabViewShell->GetSelectionPattern()->GetItem( ATTR_BACKGROUND ) );
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;
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index f2e040712566..82c5700db86b 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -408,7 +408,7 @@ SfxVoidItem TableDesign SID_TABLEDESIGN
]
SvxColorItem BackgroundColor SID_BACKGROUND_COLOR
-(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem BackgroundColor SID_BACKGROUND_COLOR)
+(SvxColorItem BackgroundColor SID_BACKGROUND_COLOR)
[
AutoUpdate = TRUE,
@@ -1506,7 +1506,7 @@ SfxVoidItem ClearOutline SID_OUTLINE_DELETEALL
SvxColorItem Color SID_ATTR_CHAR_COLOR
-(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem Color SID_ATTR_CHAR_COLOR, SfxInt16Item ColorThemeIndex SID_ATTR_COLOR_THEME_INDEX, SfxInt16Item ColorLumMod SID_ATTR_COLOR_LUM_MOD, SfxInt16Item ColorLumOff SID_ATTR_COLOR_LUM_OFF)
+(SvxColorItem Color SID_ATTR_CHAR_COLOR, SfxInt16Item ColorThemeIndex SID_ATTR_COLOR_THEME_INDEX, SfxInt16Item ColorLumMod SID_ATTR_COLOR_LUM_MOD, SfxInt16Item ColorLumOff SID_ATTR_COLOR_LUM_OFF)
[
AutoUpdate = TRUE,
FastCall = FALSE,
@@ -1524,7 +1524,7 @@ SvxColorItem Color SID_ATTR_CHAR_COLOR
]
SvxColorItem CharBackColor SID_ATTR_CHAR_BACK_COLOR
-(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem CharBackColor SID_ATTR_CHAR_BACK_COLOR)
+(SvxColorItem CharBackColor SID_ATTR_CHAR_BACK_COLOR)
[
AutoUpdate = TRUE,
FastCall = FALSE,
@@ -2798,7 +2798,7 @@ XFillBitmapItem FillPageBitmap SID_ATTR_PAGE_BITMAP
]
XFillColorItem FillColor SID_ATTR_FILL_COLOR
-(SfxStringItem ColorString SID_ATTR_COLOR_STR, XFillColorItem FillColor SID_ATTR_FILL_COLOR, SfxInt16Item ColorThemeIndex SID_ATTR_COLOR_THEME_INDEX, SfxInt16Item ColorLumMod SID_ATTR_COLOR_LUM_MOD, SfxInt16Item ColorLumOff SID_ATTR_COLOR_LUM_OFF)
+(XFillColorItem FillColor SID_ATTR_FILL_COLOR, SfxInt16Item ColorThemeIndex SID_ATTR_COLOR_THEME_INDEX, SfxInt16Item ColorLumMod SID_ATTR_COLOR_LUM_MOD, SfxInt16Item ColorLumOff SID_ATTR_COLOR_LUM_OFF)
[
AutoUpdate = TRUE,
FastCall = FALSE,
@@ -2816,7 +2816,7 @@ XFillColorItem FillColor SID_ATTR_FILL_COLOR
]
XFillColorItem FillPageColor SID_ATTR_PAGE_COLOR
-(SfxStringItem ColorString SID_ATTR_COLOR_STR)
+(XFillColorItem FillColor SID_ATTR_PAGE_COLOR)
[
/* flags: */
AutoUpdate = TRUE,
@@ -5677,7 +5677,7 @@ SfxVoidItem ArrowsToolbox SID_DRAWTBX_ARROWS
]
SvxColorItem FrameLineColor SID_FRAME_LINECOLOR
-(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem FrameLineColor SID_FRAME_LINECOLOR)
+(SvxColorItem FrameLineColor SID_FRAME_LINECOLOR)
[
AutoUpdate = TRUE,
FastCall = FALSE,
@@ -7874,7 +7874,7 @@ SdrOnOffItem FillShadow SID_ATTR_FILL_SHADOW
]
XColorItem FillShadowColor SID_ATTR_SHADOW_COLOR
-(SfxStringItem ColorString SID_ATTR_COLOR_STR)
+
[
AutoUpdate = TRUE,
@@ -9118,7 +9118,7 @@ SvxWordLineModeItem WordMode SID_ATTR_CHAR_WORDLINEMODE
XLineColorItem XLineColor SID_ATTR_LINE_COLOR
-(SfxStringItem ColorString SID_ATTR_COLOR_STR, XLineColorItem XLineColor SID_ATTR_LINE_COLOR)
+(XLineColorItem XLineColor SID_ATTR_LINE_COLOR)
[
AutoUpdate = TRUE,
FastCall = FALSE,
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index ebd54c064402..e14bf9d88da8 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -378,7 +378,7 @@ SfxVoidItem AutoSum FN_TABLE_AUTOSUM
]
SvxColorItem BackColor SID_ATTR_CHAR_COLOR_BACKGROUND // deprecated - use CHAR_BACK_COLOR
-(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem BackColor SID_ATTR_CHAR_COLOR_BACKGROUND)
+(SvxColorItem BackColor SID_ATTR_CHAR_COLOR_BACKGROUND)
[
AutoUpdate = TRUE,
@@ -1281,7 +1281,7 @@ SfxBoolItem Fields FN_VIEW_FIELDS
]
SvxColorItem FontColor SID_ATTR_CHAR_COLOR2
-(SfxStringItem ColorString SID_ATTR_COLOR_STR, SvxColorItem FontColor SID_ATTR_CHAR_COLOR2)
+(SvxColorItem FontColor SID_ATTR_CHAR_COLOR2)
[
AutoUpdate = TRUE,
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index 81eaec0f7c41..5f69c6a495a0 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -2599,32 +2599,12 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq)
case SID_BACKGROUND_COLOR:
case SID_TABLE_CELL_BACKGROUND_COLOR:
{
- const SfxPoolItem* pColorStringItem = nullptr;
bool bIsTransparent = false;
aBrushItem->SetGraphicPos(GPOS_NONE);
sal_uInt16 nSlotId = (nSlot == SID_BACKGROUND_COLOR) ? SID_BACKGROUND_COLOR : SID_TABLE_CELL_BACKGROUND_COLOR;
- if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem))
- {
- OUString sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue();
- if (sColor == "transparent")
- {
- bIsTransparent = true;
- }
- else
- {
- Color aColor(ColorTransparency, sColor.toInt32(16));
-
- aBrushItem->SetColor(aColor);
-
- SvxColorItem aNewColorItem(nSlotId);
- aNewColorItem.SetValue(aColor);
-
- GetView().GetViewFrame()->GetBindings().SetState(aNewColorItem);
- }
- }
- else if (pArgs)
+ if (pArgs)
{
const SvxColorItem& rNewColorItem = static_cast<const SvxColorItem&>(pArgs->Get(nSlotId));
const Color& rNewColor = rNewColorItem.GetValue();
diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx
index dd60a34b449e..abd247d18504 100644
--- a/sw/source/uibase/shells/drawdlg.cxx
+++ b/sw/source/uibase/shells/drawdlg.cxx
@@ -221,38 +221,9 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
namespace
{
- void lcl_convertStringArguments(sal_uInt16 nSlot, const std::unique_ptr<SfxItemSet>& pArgs)
+ void lcl_convertStringArguments(const std::unique_ptr<SfxItemSet>& pArgs)
{
- Color aColor;
- const SfxPoolItem* pItem = nullptr;
-
- 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;
- }
- }
- }
- else if (const SvxDoubleItem* pWidthItem = pArgs->GetItemIfSet(SID_ATTR_LINE_WIDTH_ARG, false))
+ if (const SvxDoubleItem* pWidthItem = pArgs->GetItemIfSet(SID_ATTR_LINE_WIDTH_ARG, false))
{
double fValue = pWidthItem->GetValue();
// FIXME: different units...
@@ -286,7 +257,7 @@ void SwDrawShell::ExecDrawAttrArgs(SfxRequest const & rReq)
if(pView->AreObjectsMarked())
{
std::unique_ptr<SfxItemSet> pNewArgs = pArgs->Clone();
- lcl_convertStringArguments(rReq.GetSlot(), pNewArgs);
+ lcl_convertStringArguments(pNewArgs);
pView->SetAttrToMarked(*pNewArgs, false);
}
else
diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx
index c84ee7bd9af4..59cec89aac8c 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -82,42 +82,6 @@
using namespace ::com::sun::star;
-namespace
-{
- void lcl_convertStringArguments(sal_uInt16 nSlot, SfxItemSet& rArgs)
- {
- Color aColor;
- OUString sColor;
- const SfxStringItem* pItem = rArgs.GetItemIfSet(SID_ATTR_COLOR_STR, false);
- if (!pItem)
- return;
-
- sColor = pItem->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);
- rArgs.Put(aColorItem);
- break;
- }
-
- case SID_ATTR_CHAR_BACK_COLOR:
- {
- SvxColorItem pBackgroundItem(aColor, EE_CHAR_BKGCOLOR);
- rArgs.Put(pBackgroundItem);
- break;
- }
- }
- }
-}
-
void SwDrawTextShell::Execute( SfxRequest &rReq )
{
SwWrtShell &rSh = GetShell();
@@ -638,8 +602,6 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
}
if (nEEWhich && pNewAttrs)
{
- lcl_convertStringArguments(nSlot, *pNewAttrs);
-
aNewAttr.Put(pNewAttrs->Get(nWhich).CloneSetWhich(nEEWhich));
}
else if (nEEWhich == EE_CHAR_COLOR)
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 3501ef777167..cf07ca3e2c74 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1344,7 +1344,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
case SID_ATTR_CHAR_COLOR2:
{
Color aSet;
- const SfxStringItem* pColorStringItem = nullptr;
bool bHasItem = false;
if(pItem)
@@ -1352,12 +1351,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
aSet = static_cast<const SvxColorItem*>(pItem)->GetValue();
bHasItem = true;
}
- else if (pArgs && (pColorStringItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_STR, false)))
- {
- OUString sColor = pColorStringItem->GetValue();
- aSet = Color(ColorTransparency, sColor.toInt32(16));
- bHasItem = true;
- }
if (bHasItem)
{
@@ -1381,17 +1374,8 @@ void SwTextShell::Execute(SfxRequest &rReq)
case SID_ATTR_CHAR_COLOR_EXT:
{
Color aSet;
- const SfxStringItem* pColorStringItem = nullptr;
- if (pArgs && (pColorStringItem = pArgs->GetItemIfSet(SID_ATTR_COLOR_STR, false)))
- {
- OUString sColor = pColorStringItem->GetValue();
- if (sColor == "transparent")
- aSet = COL_TRANSPARENT;
- else
- aSet = Color(ColorTransparency, sColor.toInt32(16));
- }
- else if (pItem)
+ if (pItem)
aSet = static_cast<const SvxColorItem*>(pItem)->GetValue();
else
aSet = COL_TRANSPARENT;