sc/source/ui/drawfunc/drawsh.cxx | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-)
New commits: commit 695745c8bf947409b731e2feeac615ee25d41b01 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Fri Nov 8 11:37:57 2019 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Fri Nov 8 12:23:11 2019 +0100 jsdialog: apply .uno:LineWidth in Calc Change-Id: I2d3bc18d7e687547ec840840111af83b171499c7 Reviewed-on: https://gerrit.libreoffice.org/82278 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index f4aee82d783f..3de59aae93d7 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -59,10 +59,30 @@ #include <com/sun/star/util/XModifiable.hpp> #include <com/sun/star/frame/XFrame.hpp> #include <memory> - +#include <svx/xlnwtit.hxx> +#include <svx/chrtitem.hxx> SFX_IMPL_INTERFACE(ScDrawShell, SfxShell) +namespace +{ + void lcl_convertStringArguments(std::unique_ptr<SfxItemSet>& pArgs) + { + const SfxPoolItem* pItem = nullptr; + + if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_LINE_WIDTH_ARG, false, &pItem)) + { + double fValue = static_cast<const SvxDoubleItem*>(pItem)->GetValue(); + // FIXME: different units... + int nPow = 100; + int nValue = fValue * nPow; + + XLineWidthItem aItem(nValue); + pArgs->Put(aItem); + } + } +} + void ScDrawShell::InitInterface_Impl() { GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, @@ -207,7 +227,11 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) } if( pView->AreObjectsMarked() ) - pView->SetAttrToMarked( *rReq.GetArgs(), false ); + { + std::unique_ptr<SfxItemSet> pNewArgs = rReq.GetArgs()->Clone(); + lcl_convertStringArguments( pNewArgs ); + pView->SetAttrToMarked( *pNewArgs, false ); + } else pView->SetDefaultAttr( *rReq.GetArgs(), false); pView->InvalidateAttribs(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits