[Libreoffice-commits] core.git: include/sfx2 sw/sdi sw/source
Szymon Kłos (via logerrit)
logerrit at kemper.freedesktop.org
Mon Oct 28 10:03:46 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 aa77830c2ca3dd4f4d81ac14c795230fab653b6b
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: Mon Oct 28 11:03:08 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>
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 2eb4d579838e..2e1dbf6ff748 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -565,7 +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_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 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);
More information about the Libreoffice-commits
mailing list