From 6b604833df4295b965a499b999b9bba3ed73ef73 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Fri, 25 Oct 2019 11:46:18 +0200 Subject: jsdialogs: make possible to set .uno:FontColor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5ece252d3b7e9dca7c97395c70be6ea4863d7545 Reviewed-on: https://gerrit.libreoffice.org/81516 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos --- sw/source/uibase/shells/textsh1.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'sw/source') 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(pItem)->GetValue(); + aSet = static_cast(pItem)->GetValue(); + bHasItem = true; + } + else if(SfxItemState::SET == pArgs->GetItemState(SID_ATTR_CHAR_COLOR2_STR, false, &pColorStringItem)) + { + sColor = static_cast(pColorStringItem)->GetValue(); + aSet = Color(sColor.toInt32(16)); + bHasItem = true; + } + + if (bHasItem) + { SwEditWin& rEditWin = GetView().GetEditWin(); rEditWin.SetWaterCanTextColor(aSet); SwApplyTemplate* pApply = rEditWin.GetApplyTemplate(); -- cgit