[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sc/source
Szymon Kłos (via logerrit)
logerrit at kemper.freedesktop.org
Fri Nov 8 11:24:00 UTC 2019
sc/source/ui/drawfunc/drawsh.cxx | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
New commits:
commit 695745c8bf947409b731e2feeac615ee25d41b01
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Nov 8 11:37:57 2019 +0100
Commit: Szymon Kłos <szymon.klos at 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 <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at 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();
More information about the Libreoffice-commits
mailing list