From b7eeb8b03035dd0be715fa90bcbd8b151bc99871 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Thu, 31 Oct 2019 11:49:22 +0100 Subject: jsdialogs: .uno:XFillColor with string argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7f078fc66cecacccd4473495f96e4e2dbfd89d14 Reviewed-on: https://gerrit.libreoffice.org/81832 Tested-by: Jenkins Reviewed-by: Szymon Kłos --- sw/source/uibase/shells/drawdlg.cxx | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'sw') diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx index 2c5a923e5983..a16ac67c016b 100644 --- a/sw/source/uibase/shells/drawdlg.cxx +++ b/sw/source/uibase/shells/drawdlg.cxx @@ -36,6 +36,7 @@ #include #include #include +#include void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) { @@ -204,7 +205,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) namespace { - void lcl_convertStringArguments(std::unique_ptr& pArgs) + void lcl_convertStringArguments(sal_uInt16 nSlot, std::unique_ptr& pArgs) { Color aColor; OUString sColor; @@ -219,8 +220,22 @@ namespace else aColor = Color(sColor.toInt32(16)); - XLineColorItem aLineColorItem(OUString(), aColor); - pArgs->Put(aLineColorItem); + switch (nSlot) + { + case SID_ATTR_LINE_COLOR: + { + XLineColorItem aLineColorItem(OUString(), aColor); + pArgs->Put(aLineColorItem); + break; + } + + case SID_ATTR_FILL_COLOR: + { + XFillColorItem aFillColorItem(OUString(), aColor); + pArgs->Put(aFillColorItem); + break; + } + } } } } @@ -240,7 +255,7 @@ void SwDrawShell::ExecDrawAttrArgs(SfxRequest const & rReq) if(pView->AreObjectsMarked()) { std::unique_ptr pNewArgs = pArgs->Clone(); - lcl_convertStringArguments(pNewArgs); + lcl_convertStringArguments(rReq.GetSlot(), pNewArgs); pView->SetAttrToMarked(*pNewArgs, false); } else -- cgit