[Libreoffice-commits] core.git: sc/source sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 23 23:48:05 UTC 2018


 sc/source/ui/drawfunc/fuconrec.cxx |    4 +++-
 sw/source/core/frmedt/feshview.cxx |   14 ++++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit b576d593cd702560f84ac28d8a17905e5e7b8353
Author:     Maxim Monastirsky <momonasmon at gmail.com>
AuthorDate: Thu Aug 23 10:06:46 2018 +0300
Commit:     Maxim Monastirsky <momonasmon at gmail.com>
CommitDate: Fri Aug 24 01:47:41 2018 +0200

    Explicitly set line ends for measure lines
    
    So they won't be lost on file export
    
    Change-Id: I7da183e4b392fd9f3019b1f3029db15a56eff84d
    Reviewed-on: https://gerrit.libreoffice.org/59483
    Tested-by: Jenkins
    Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>

diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index e07367d4af88..7d141be71fca 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -222,7 +222,8 @@ void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, const SdrObject& rObj, sal
          nSlotId == SID_LINE_ARROW_CIRCLE     ||
          nSlotId == SID_LINE_CIRCLE_ARROW     ||
          nSlotId == SID_LINE_ARROW_SQUARE     ||
-         nSlotId == SID_LINE_SQUARE_ARROW )
+         nSlotId == SID_LINE_SQUARE_ARROW     ||
+         nSlotId == SID_DRAW_MEASURELINE )
     {
 
         // set attributes of line start and ends
@@ -276,6 +277,7 @@ void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, const SdrObject& rObj, sal
         switch (nSlotId)
         {
             case SID_LINE_ARROWS:
+            case SID_DRAW_MEASURELINE:
             {
                 // connector with arrow ends
                 rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_ARROW), aArrow));
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 37a526d855e2..30543a47b605 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -904,7 +904,8 @@ void SwFEShell::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj, sal_uInt1
           nSlotId == SID_LINE_ARROW_CIRCLE     ||
           nSlotId == SID_LINE_CIRCLE_ARROW     ||
           nSlotId == SID_LINE_ARROW_SQUARE     ||
-          nSlotId == SID_LINE_SQUARE_ARROW) )
+          nSlotId == SID_LINE_SQUARE_ARROW     ||
+          nSlotId == SID_DRAW_MEASURELINE) )
         return;
 
     // set attributes of line start and ends
@@ -958,6 +959,7 @@ void SwFEShell::SetLineEnds(SfxItemSet& rAttr, SdrObject const & rObj, sal_uInt1
     switch (nSlotId)
     {
         case SID_LINE_ARROWS:
+        case SID_DRAW_MEASURELINE:
         {
             // connector with arrow ends
             rAttr.Put(XLineStartItem(SvxResId(RID_SVXSTR_ARROW), aArrow));
@@ -3086,9 +3088,13 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const
         }
         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);
+            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);
+
+            SfxItemSet aAttr(pObj->getSdrModelFromSdrObject().GetItemPool());
+            SetLineEnds(aAttr, *pObj, nSlotId);
+            pObj->SetMergedItemSet(aAttr);
         }
         else if(dynamic_cast<const SdrCaptionObj*>( pObj) !=  nullptr)
         {


More information about the Libreoffice-commits mailing list