diff options
-rw-r--r-- | include/sfx2/sfxsids.hrc | 2 | ||||
-rw-r--r-- | sw/sdi/swriter.sdi | 3 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh1.cxx | 17 |
3 files changed, 18 insertions, 4 deletions
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); |