[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
Thu Oct 31 19:24:35 UTC 2019
include/sfx2/sfxsids.hrc | 2 +-
sw/sdi/swriter.sdi | 3 ++-
sw/source/uibase/shells/textsh1.cxx | 17 +++++++++++++++--
3 files changed, 18 insertions(+), 4 deletions(-)
New commits:
commit 5219cb0ca6ebade6521db3f2c625e9641085a3b4
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Oct 28 09:51:32 2019 +0100
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Thu Oct 31 20:23:53 2019 +0100
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 at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/81593
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 09778730add3..558a303fb573 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -556,7 +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_ATTR_COLOR_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 b7f7866ced96..af23a1819212 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,
@@ -1298,7 +1299,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 d27f414c4c97..46868deff1be 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1173,7 +1173,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));
@@ -1201,7 +1201,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);
More information about the Libreoffice-commits
mailing list