summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2019-10-28 09:51:32 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2019-10-28 11:03:08 +0100
commitaa77830c2ca3dd4f4d81ac14c795230fab653b6b (patch)
tree5c0ad78262dcbbbcd29cae639115f6d12e78a61f /sw
parent294b01d19b858dd476a429c8717e912ea316bfeb (diff)
jsdialogs: make possible to set .uno:BackColor
Change-Id: I2fd9a70b54f211dbfe9bb58102e17afd38516d5d Reviewed-on: https://gerrit.libreoffice.org/81587 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/sdi/swriter.sdi3
-rw-r--r--sw/source/uibase/shells/textsh1.cxx17
2 files changed, 17 insertions, 3 deletions
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 0119bd185d33..8316bd9c8bd5 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -378,6 +378,7 @@ SfxVoidItem AutoSum FN_TABLE_AUTOSUM
]
SvxColorItem BackColor SID_ATTR_CHAR_COLOR_BACKGROUND
+(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem BackColor SID_ATTR_CHAR_COLOR_BACKGROUND)
[
AutoUpdate = TRUE,
@@ -1280,7 +1281,7 @@ SfxBoolItem Fields FN_VIEW_FIELDS
]
SvxColorItem FontColor SID_ATTR_CHAR_COLOR2
-(SfxStringItem Color SID_ATTR_CHAR_COLOR2_STR, SvxColorItem FontColor SID_ATTR_CHAR_COLOR2)
+(SfxStringItem Color SID_ATTR_COLOR_STR, SvxColorItem FontColor SID_ATTR_CHAR_COLOR2)
[
AutoUpdate = TRUE,
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 0ae64618e9a0..173805a5ae85 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1184,7 +1184,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
aSet = static_cast<const SvxColorItem*>(pItem)->GetValue();
bHasItem = true;
}
- else if(SfxItemState::SET == pArgs->GetItemState(SID_ATTR_CHAR_COLOR2_STR, false, &pColorStringItem))
+ else if(SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem))
{
sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue();
aSet = Color(sColor.toInt32(16));
@@ -1212,7 +1212,20 @@ void SwTextShell::Execute(SfxRequest &rReq)
case SID_ATTR_CHAR_COLOR_BACKGROUND_EXT:
case SID_ATTR_CHAR_COLOR_EXT:
{
- Color aSet = pItem ? static_cast<const SvxColorItem*>(pItem)->GetValue() : COL_TRANSPARENT;
+ Color aSet;
+ OUString sColor;
+ const SfxPoolItem* pColorStringItem = nullptr;
+
+ if (pItem)
+ {
+ aSet = pItem ? static_cast<const SvxColorItem*>(pItem)->GetValue() : COL_TRANSPARENT;
+ }
+ else if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem))
+ {
+ sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue();
+ aSet = Color(sColor.toInt32(16));
+ }
+
SwEditWin& rEdtWin = GetView().GetEditWin();
if (nSlot != SID_ATTR_CHAR_COLOR_EXT)
rEdtWin.SetWaterCanTextBackColor(aSet);