[Libreoffice-commits] core.git: sc/source
Szymon Kłos (via logerrit)
logerrit at kemper.freedesktop.org
Fri Nov 8 13:28:16 UTC 2019
sc/source/ui/drawfunc/drawsh.cxx | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
New commits:
commit ca92ab3fbe78e9f2f8f127106a17fe61e16f2ba1
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 14:27:06 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>
(cherry picked from commit 695745c8bf947409b731e2feeac615ee25d41b01)
Reviewed-on: https://gerrit.libreoffice.org/82283
Tested-by: Jenkins
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 79508cc5f949..decc6798466f 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -53,10 +53,30 @@
#include <sfx2/viewsh.hxx>
#include <com/sun/star/util/XModifiable.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,
@@ -201,7 +221,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