summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2019-10-31 07:45:40 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2019-11-01 09:09:56 +0100
commite5a9832fc0f437ed48bafb9e897fd88820211ff7 (patch)
treeb35a9c1d907bdd4e7e6bb82eef4fb5640548fa26 /sw/source
parentc1131547367d90b3fabb7a333187426a1b82c83b (diff)
jsdialogs: .uno:XLineColor with string argument
Change-Id: Ic06aaef076d101d90bf76461e2b3a97580ad311f Reviewed-on: https://gerrit.libreoffice.org/81821 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit 51f6b20a0c8c3b2830547e4400cf4c513e9d9c00) Reviewed-on: https://gerrit.libreoffice.org/81828 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/uibase/shells/drawdlg.cxx31
1 files changed, 30 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx
index 7cc72c5e4ae9..5a9bebc85659 100644
--- a/sw/source/uibase/shells/drawdlg.cxx
+++ b/sw/source/uibase/shells/drawdlg.cxx
@@ -33,6 +33,8 @@
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
#include <memory>
+#include <svl/stritem.hxx>
+#include <svx/xlnclit.hxx>
void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
{
@@ -197,6 +199,29 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
pDoc->SetChanged();
}
+namespace
+{
+ void lcl_convertStringArguments(std::unique_ptr<SfxItemSet>& pArgs)
+ {
+ Color aColor;
+ OUString sColor;
+ const SfxPoolItem* pColorStringItem = nullptr;
+
+ if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem))
+ {
+ sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue();
+
+ if (sColor == "transparent")
+ aColor = COL_TRANSPARENT;
+ else
+ aColor = Color(sColor.toInt32(16));
+
+ XLineColorItem aLineColorItem(OUString(), aColor);
+ pArgs->Put(aLineColorItem);
+ }
+ }
+}
+
void SwDrawShell::ExecDrawAttrArgs(SfxRequest const & rReq)
{
SwWrtShell* pSh = &GetShell();
@@ -210,7 +235,11 @@ void SwDrawShell::ExecDrawAttrArgs(SfxRequest const & rReq)
if (pArgs)
{
if(pView->AreObjectsMarked())
- pView->SetAttrToMarked(*rReq.GetArgs(), false);
+ {
+ std::unique_ptr<SfxItemSet> pNewArgs = pArgs->Clone();
+ lcl_convertStringArguments(pNewArgs);
+ pView->SetAttrToMarked(*pNewArgs, false);
+ }
else
pView->SetDefaultAttr(*rReq.GetArgs(), false);
}