[Libreoffice-commits] core.git: include/svx officecfg/registry sd/inc sd/sdi svx/sdi sw/sdi sw/source sw/uiconfig

Gulsah Kose gulsah.1004 at gmail.com
Mon Oct 10 23:10:25 UTC 2016


 include/svx/svxids.hrc                                                   |    3 +
 officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu |    8 ----
 officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu     |    8 ++++
 sd/inc/app.hrc                                                           |    1 
 sd/sdi/sdraw.sdi                                                         |   18 ---------
 svx/sdi/svx.sdi                                                          |   19 ++++++++++
 sw/sdi/viewsh.sdi                                                        |    5 ++
 sw/source/core/frmedt/feshview.cxx                                       |   10 +++++
 sw/source/uibase/ribbar/conrect.cxx                                      |    4 ++
 sw/source/uibase/uiview/viewdraw.cxx                                     |    1 
 sw/source/uibase/uiview/viewstat.cxx                                     |    1 
 sw/uiconfig/swriter/toolbar/arrowsbar.xml                                |    2 +
 12 files changed, 52 insertions(+), 28 deletions(-)

New commits:
commit e2f6c7f0d0cc14f851d7028ff846c5dc658a81c6
Author: Gulsah Kose <gulsah.1004 at gmail.com>
Date:   Sun Oct 9 22:00:16 2016 +0300

    tdf#101390 Add "Dimesion Line" command to the writer arrowsbox.
    
    Change-Id: I238bc37871c029d547b21ce7c8ef3cb0c0ff95b8
    Signed-off-by: Gulsah Kose <gulsah.1004 at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/29669
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>

diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index a6e058f..b3fa887 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -998,9 +998,10 @@
 #define SID_DRAWTBX_ARROWS                              ( SID_SVX_START + 1164 )
 #define SID_LINE_ARROW_START                            ( SID_SVX_START + 1165 )
 #define SID_LINE_ARROW_END                              ( SID_SVX_START + 1166 )
+#define SID_DRAW_MEASURELINE                            ( SID_SVX_START + 1167 )
 
 // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
-#define SID_SVX_FIRSTFREE                               ( SID_LINE_ARROW_END + 1 )
+#define SID_SVX_FIRSTFREE                               ( SID_DRAW_MEASURELINE + 1 )
 
 // Overflow check for slot IDs
 
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index eda008cc..0e4e083 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -858,14 +858,6 @@
           <value xml:lang="en-US">~Layer</value>
         </prop>
       </node>
-      <node oor:name=".uno:MeasureLine" oor:op="replace">
-        <prop oor:name="Label" oor:type="xs:string">
-          <value xml:lang="en-US">Dimension Line</value>
-        </prop>
-        <prop oor:name="Properties" oor:type="xs:int">
-          <value>1</value>
-        </prop>
-      </node>
       <node oor:name=".uno:MasterPage" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">~Master</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 8870417..b18a5e6 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -2024,6 +2024,14 @@
           <value>1</value>
         </prop>
       </node>
+      <node oor:name=".uno:MeasureLine" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">Dimension Line</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
+      </node>
       <node oor:name=".uno:GrafMode" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Image mode</value>
diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc
index 9a97d9f..2bf7839 100644
--- a/sd/inc/app.hrc
+++ b/sd/inc/app.hrc
@@ -104,7 +104,6 @@
 #define SID_MODIFYLAYER                     (SID_SD_START+45)
 #define SID_PAGEMODE                        (SID_SD_START+46)
 #define SID_LAYERMODE                       (SID_SD_START+47)
-#define SID_DRAW_MEASURELINE                (SID_SD_START+48)
 #define SID_STARTAPP                        (SID_SD_START+49)
 #define SID_MASTERPAGE                      (SID_SD_START+50)
 // Navigation between slides
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi
index afc8ee8..bbaf03a 100644
--- a/sd/sdi/sdraw.sdi
+++ b/sd/sdi/sdraw.sdi
@@ -2509,24 +2509,6 @@ SfxVoidItem MeasureAttributes SID_MEASURE_DLG
     GroupId = GID_FORMAT;
 ]
 
-SfxBoolItem MeasureLine SID_DRAW_MEASURELINE
-
-[
-    AutoUpdate = TRUE,
-    FastCall = FALSE,
-    ReadOnlyDoc = FALSE,
-    Toggle = FALSE,
-    Container = FALSE,
-    RecordAbsolute = FALSE,
-    RecordPerItem;
-
-
-    AccelConfig = TRUE,
-    MenuConfig = TRUE,
-    ToolBoxConfig = TRUE,
-    GroupId = GID_DRAWING;
-]
-
 SfxVoidItem MirrorHorz SID_HORIZONTAL
 ()
 [
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 72ea78b..0693af6 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -5319,6 +5319,25 @@ SfxVoidItem LeftRightParaMargin_Vertical SID_ATTR_PARA_LRSPACE_VERTICAL
 ]
 
 
+SfxBoolItem MeasureLine SID_DRAW_MEASURELINE
+
+[
+    AutoUpdate = TRUE,
+    FastCall = FALSE,
+    ReadOnlyDoc = FALSE,
+    Toggle = FALSE,
+    Container = FALSE,
+    RecordAbsolute = FALSE,
+    RecordPerItem;
+
+
+    AccelConfig = TRUE,
+    MenuConfig = TRUE,
+    ToolBoxConfig = TRUE,
+    GroupId = GID_DRAWING;
+]
+
+
 SfxBoolItem Line SID_DRAW_LINE
 
 [
diff --git a/sw/sdi/viewsh.sdi b/sw/sdi/viewsh.sdi
index e93cad9..56a2d6e 100644
--- a/sw/sdi/viewsh.sdi
+++ b/sw/sdi/viewsh.sdi
@@ -117,6 +117,11 @@ interface TextEditView : BaseTextEditView
         ExecMethod = ExecDraw ;
         StateMethod = GetDrawState ;
     ]
+    SID_DRAW_MEASURELINE
+    [
+        ExecMethod = ExecDraw ;
+        StateMethod = GetDrawState ;
+    ]
     SID_DRAWTBX_ARROWS
     [
         StateMethod = GetDrawState ;
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 5adc6cd..0a84b47 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -36,6 +36,7 @@
 #include <svx/xlnedwit.hxx>
 #include <svx/xlnedit.hxx>
 #include <svx/xlnstit.hxx>
+#include <svx/svdomeas.hxx>
 #include <sfx2/app.hxx>
 #include <editeng/boxitem.hxx>
 #include <editeng/opaqitem.hxx>
@@ -2918,6 +2919,9 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const
         }
         pObj->SetLogicRect(aRect);
 
+        Point aStart = aRect.TopLeft();
+        Point aEnd = aRect.BottomRight();
+
         if(dynamic_cast<const SdrCircObj*>( pObj) !=  nullptr)
         {
             SfxItemSet aAttr(pDrawModel->GetItemPool());
@@ -3021,6 +3025,12 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const
 
             static_cast<SdrPathObj*>(pObj)->SetPathPoly(aPoly);
         }
+        else if(dynamic_cast<const SdrMeasureObj*>( pObj) !=  nullptr)
+        {
+                sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2);
+                static_cast<SdrMeasureObj*>(pObj)->SetPoint(Point(aStart.X(), nYMiddle), 0);
+                static_cast<SdrMeasureObj*>(pObj)->SetPoint(Point(aEnd.X(), nYMiddle), 1);
+        }
         else if(dynamic_cast<const SdrCaptionObj*>( pObj) !=  nullptr)
         {
             bool bVerticalText = ( SID_DRAW_TEXT_VERTICAL == nSlotId ||
diff --git a/sw/source/uibase/ribbar/conrect.cxx b/sw/source/uibase/ribbar/conrect.cxx
index cc12af7..2e0542f 100644
--- a/sw/source/uibase/ribbar/conrect.cxx
+++ b/sw/source/uibase/ribbar/conrect.cxx
@@ -170,6 +170,10 @@ void ConstRectangle::Activate(const sal_uInt16 nSlotId)
         m_pWin->SetSdrDrawMode(OBJ_LINE);
         break;
 
+    case SID_DRAW_MEASURELINE:
+        m_pWin->SetSdrDrawMode(OBJ_MEASURE);
+        break;
+
     case SID_DRAW_RECT:
         m_pWin->SetSdrDrawMode(OBJ_RECT);
         break;
diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx
index 5325d2f..750caf8 100644
--- a/sw/source/uibase/uiview/viewdraw.cxx
+++ b/sw/source/uibase/uiview/viewdraw.cxx
@@ -253,6 +253,7 @@ void SwView::ExecDraw(SfxRequest& rReq)
         case SID_LINE_SQUARE_ARROW:
         case SID_LINE_ARROWS:
         case SID_DRAW_LINE:
+        case SID_DRAW_MEASURELINE:
         case SID_DRAW_RECT:
         case SID_DRAW_ELLIPSE:
         case SID_DRAW_TEXT:
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index 07edb05..1de3fc7 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -502,6 +502,7 @@ void SwView::GetDrawState(SfxItemSet &rSet)
         case SID_LINE_CIRCLE_ARROW:
         case SID_LINE_SQUARE_ARROW:
         case SID_LINE_ARROWS:
+        case SID_DRAW_MEASURELINE:
         case SID_DRAW_RECT:
         case SID_DRAW_ELLIPSE:
         case SID_DRAW_XPOLYGON_NOFILL:
diff --git a/sw/uiconfig/swriter/toolbar/arrowsbar.xml b/sw/uiconfig/swriter/toolbar/arrowsbar.xml
index 5ec4d8a..cfe177a 100644
--- a/sw/uiconfig/swriter/toolbar/arrowsbar.xml
+++ b/sw/uiconfig/swriter/toolbar/arrowsbar.xml
@@ -27,4 +27,6 @@
  <toolbar:toolbaritem xlink:href=".uno:LineArrowCircle"/>
  <toolbar:toolbaritem xlink:href=".uno:LineArrowSquare"/>
  <toolbar:toolbaritem xlink:href=".uno:Line"/>
+ <toolbar:toolbarbreak/>
+ <toolbar:toolbaritem xlink:href=".uno:MeasureLine"/>
 </toolbar:toolbar>


More information about the Libreoffice-commits mailing list