[Libreoffice-commits] core.git: include/sfx2 sw/sdi sw/source
Szymon Kłos (via logerrit)
logerrit at kemper.freedesktop.org
Mon Oct 28 07:55:41 UTC 2019
include/sfx2/sfxsids.hrc | 1 +
sw/sdi/swriter.sdi | 1 +
sw/source/uibase/shells/textsh1.cxx | 18 +++++++++++++++++-
3 files changed, 19 insertions(+), 1 deletion(-)
New commits:
commit d73871584f646cbf02467871fcfc7039ad985ff3
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Oct 25 11:46:18 2019 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Oct 28 08:54:51 2019 +0100
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 at collabora.com>
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();
More information about the Libreoffice-commits
mailing list