summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2019-10-25 11:46:18 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2019-10-28 08:54:51 +0100
commitd73871584f646cbf02467871fcfc7039ad985ff3 (patch)
tree3213987ecbbd721537a4139b4b1dd6c77aaf5ab7
parent0615f3bc125d2d02d11d336e1d0b1c204c91f432 (diff)
jsdialogs: make possible to set .uno:FontColor
Change-Id: I5ece252d3b7e9dca7c97395c70be6ea4863d7545 Reviewed-on: https://gerrit.libreoffice.org/81498 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
-rw-r--r--include/sfx2/sfxsids.hrc1
-rw-r--r--sw/sdi/swriter.sdi1
-rw-r--r--sw/source/uibase/shells/textsh1.cxx18
3 files changed, 19 insertions, 1 deletions
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 33da857c096f..2eb4d579838e 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -565,6 +565,7 @@ class SvxSearchItem;
#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_CHAR_COLOR2_STR (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 (SID_SVX_START + 1062)
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 3f96725b5bf8..0119bd185d33 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -1280,6 +1280,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)
[
AutoUpdate = TRUE,
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 57b37a1d7ef6..0ae64618e9a0 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1174,9 +1174,25 @@ void SwTextShell::Execute(SfxRequest &rReq)
case SID_ATTR_CHAR_COLOR2:
{
+ Color aSet;
+ OUString sColor;
+ const SfxPoolItem* pColorStringItem = nullptr;
+ bool bHasItem = false;
+
if(pItem)
{
- Color aSet = static_cast<const SvxColorItem*>(pItem)->GetValue();
+ aSet = static_cast<const SvxColorItem*>(pItem)->GetValue();
+ bHasItem = true;
+ }
+ else if(SfxItemState::SET == pArgs->GetItemState(SID_ATTR_CHAR_COLOR2_STR, false, &pColorStringItem))
+ {
+ sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue();
+ aSet = Color(sColor.toInt32(16));
+ bHasItem = true;
+ }
+
+ if (bHasItem)
+ {
SwEditWin& rEditWin = GetView().GetEditWin();
rEditWin.SetWaterCanTextColor(aSet);
SwApplyTemplate* pApply = rEditWin.GetApplyTemplate();