diff options
-rw-r--r-- | svx/sdi/svx.sdi | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/drawdlg.cxx | 31 |
2 files changed, 31 insertions, 2 deletions
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 489ae6af30e9..09c127c2340f 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -8828,7 +8828,7 @@ SvxWordLineModeItem WordMode SID_ATTR_CHAR_WORDLINEMODE XLineColorItem XLineColor SID_ATTR_LINE_COLOR - +(SfxStringItem Color SID_ATTR_COLOR_STR, XLineColorItem XLineColor SID_ATTR_LINE_COLOR) [ AutoUpdate = TRUE, FastCall = FALSE, 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); } |