[Libreoffice-commits] core.git: sd/source

Szymon Kłos (via logerrit) logerrit at kemper.freedesktop.org
Fri Nov 8 11:37:24 UTC 2019


 sd/source/ui/view/drviews2.cxx |   30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

New commits:
commit 240581f7d7172d8ed1e5fa38a114b102fe626e25
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Nov 8 11:13:11 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Nov 8 12:36:20 2019 +0100

    jsdialog: apply .uno:LineWidth in Impress
    
    Change-Id: I7b9a3e5d6af5ccf9e9be28c5a1460fbf8553ff08
    Reviewed-on: https://gerrit.libreoffice.org/82275
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/82281
    Tested-by: Jenkins

diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index caa352e3b152..cb25ccad181d 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -80,6 +80,13 @@
 #include <svx/svxids.hrc>
 #include <svx/sdtfsitm.hxx>
 #include <svx/sdmetitm.hxx>
+#include <svx/xfillit0.hxx>
+#include <svx/xflclit.hxx>
+#include <svx/xlineit0.hxx>
+#include <svx/xlnedwit.hxx>
+#include <svx/xlnstwit.hxx>
+#include <svx/xlnwtit.hxx>
+#include <svx/chrtitem.hxx>
 
 #include <tools/diagnose_ex.h>
 
@@ -530,6 +537,25 @@ public:
     }
 };
 
+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);
+        }
+    }
+}
+
 /**
  * SfxRequests for temporary actions
  */
@@ -615,7 +641,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
         {
             if( rReq.GetArgs() )
             {
-                mpDrawView->SetAttributes(*rReq.GetArgs());
+                std::unique_ptr<SfxItemSet> pNewArgs = rReq.GetArgs()->Clone();
+                lcl_convertStringArguments(pNewArgs);
+                mpDrawView->SetAttributes(*pNewArgs);
                 rReq.Done();
             }
             else


More information about the Libreoffice-commits mailing list