[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/svx svx/sdi sw/source

Szymon Kłos (via logerrit) logerrit at kemper.freedesktop.org
Thu Nov 7 15:49:10 UTC 2019


 include/svx/svxids.hrc              |    1 +
 svx/sdi/svx.sdi                     |    2 +-
 sw/source/uibase/shells/drawdlg.cxx |   18 +++++++++++++++---
 3 files changed, 17 insertions(+), 4 deletions(-)

New commits:
commit b7793572647f147278a2f8bf23ccd06f17c7e155
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Nov 7 15:53:49 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Thu Nov 7 16:48:29 2019 +0100

    jsdialog: consume .uno:LineWidth double value
    
    Change-Id: Iaf09dd11ae4fd6b3d9ebeabac790f0cfe73fec17
    Reviewed-on: https://gerrit.libreoffice.org/82226
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 8b6dd9b5a699..06c8902dadbf 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -326,6 +326,7 @@ class SfxStringItem;
 #define SID_DIALOG_TESTMODE                             ( SID_SVX_START + 200 )
 #define SID_FRAME_LINESTYLE                             TypedWhichId<SvxLineItem>( SID_SVX_START + 201 )
 #define SID_FRAME_LINECOLOR                             TypedWhichId<SvxColorItem>( SID_SVX_START + 202 )
+#define SID_ATTR_LINE_WIDTH_ARG                         ( SID_SVX_START + 203 )
 #define SID_SEARCHDLG_SEARCHSTRINGS                     ( SID_SVX_START + 215 )
 #define SID_SEARCHDLG_REPLACESTRINGS                    ( SID_SVX_START + 216 )
 #define SID_ATTR_TABLE                                  ( SID_SVX_START + 217 )
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 2a9794185910..339a8e9b6d8e 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -5618,7 +5618,7 @@ SvxLineItem LineStyle SID_FRAME_LINESTYLE
 
 
 XLineWidthItem LineWidth SID_ATTR_LINE_WIDTH
-
+(SvxDoubleItem Width SID_ATTR_LINE_WIDTH_ARG, XLineWidthItem LineWidth SID_ATTR_LINE_WIDTH)
 [
     AutoUpdate = TRUE,
     FastCall = FALSE,
diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx
index 5a9bebc85659..5de7f6d0dbbf 100644
--- a/sw/source/uibase/shells/drawdlg.cxx
+++ b/sw/source/uibase/shells/drawdlg.cxx
@@ -35,6 +35,8 @@
 #include <memory>
 #include <svl/stritem.hxx>
 #include <svx/xlnclit.hxx>
+#include <svx/chrtitem.hxx>
+#include <svx/xlnwtit.hxx>
 
 void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
 {
@@ -205,11 +207,11 @@ namespace
     {
         Color aColor;
         OUString sColor;
-        const SfxPoolItem* pColorStringItem = nullptr;
+        const SfxPoolItem* pItem = nullptr;
 
-        if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem))
+        if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pItem))
         {
-            sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue();
+            sColor = static_cast<const SfxStringItem*>(pItem)->GetValue();
 
             if (sColor == "transparent")
                 aColor = COL_TRANSPARENT;
@@ -219,6 +221,16 @@ namespace
             XLineColorItem aLineColorItem(OUString(), aColor);
             pArgs->Put(aLineColorItem);
         }
+        else 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);
+        }
     }
 }
 


More information about the Libreoffice-commits mailing list