[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/sfx2 sw/sdi sw/source
Szymon Kłos (via logerrit)
logerrit at kemper.freedesktop.org
Mon Oct 28 08:02:36 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 6b604833df4295b965a499b999b9bba3ed73ef73
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 09:01:52 2019 +0100
jsdialogs: make possible to set .uno:FontColor
Change-Id: I5ece252d3b7e9dca7c97395c70be6ea4863d7545
Reviewed-on: https://gerrit.libreoffice.org/81516
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index ece766088ab2..09778730add3 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -556,6 +556,7 @@ class SfxDocumentInfoItem;
#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 5f03b7d9799c..b7f7866ced96 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -1298,6 +1298,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 830a04d86471..d27f414c4c97 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1163,9 +1163,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