[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - 2 commits - sw/qa sw/source writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Wed Oct 8 08:23:45 PDT 2014


 sw/qa/core/data/rtf/pass/fdo84536.rtf       |   16 +++++++++++
 sw/source/core/uibase/docvw/edtwin.cxx      |   38 +++++++++++++++-------------
 writerfilter/source/rtftok/rtfsdrimport.cxx |    5 ++-
 3 files changed, 41 insertions(+), 18 deletions(-)

New commits:
commit 1eba4cd1e95d13d256378cdf736c00a36d1fdea3
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Oct 1 16:45:03 2014 +0200

    fdo#84536 RTF import: don't try to rotate TextFrames
    
    Regression from 818d80eb0cee65d1bcc4fdb74b32a7c42cc1336e (RTF import:
    support shapes inside tables, 2013-06-28).
    
    (cherry picked from commit 53b9a9bc7c84738545b5c7b791cea1e3d6a16c72)
    
    Change-Id: I05eb2f4f2e3467e35f96b280e3a79f69906a56de
    Reviewed-on: https://gerrit.libreoffice.org/11746
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/core/data/rtf/pass/fdo84536.rtf b/sw/qa/core/data/rtf/pass/fdo84536.rtf
new file mode 100644
index 0000000..a8eaacf
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/fdo84536.rtf
@@ -0,0 +1,16 @@
+{\rtf1
+{\shp
+{\*\shpinst\shpleft0\shptop0\shpright10557\shpbottom2639\shpfhdr0\shpbxmargin\shpbxignore\shpbymargin\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz2\shplid2054
+{\sp
+{\sn shapeType}
+{\sv 202}
+}
+{\sp
+{\sn rotation}
+{\sv -2949120}
+}
+{\shptxt hello\par}
+}
+}
+\par
+}
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index 19353fb..3d62a447 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -15,6 +15,7 @@
 #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
 #include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
 #include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/table/BorderLine2.hpp>
 #include <com/sun/star/text/HoriOrientation.hpp>
 #include <com/sun/star/text/RelOrientation.hpp>
@@ -195,7 +196,9 @@ void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> xShape, const O
         // See DffPropertyReader::Fix16ToAngle(): in RTF, positive rotation angles are clockwise, we have them as counter-clockwise.
         // Additionally, RTF type is 0..360*2^16, our is 0..360*100.
         sal_Int32 nRotation = aValue.toInt32()*100/65536;
-        xPropertySet->setPropertyValue("RotateAngle", uno::makeAny(sal_Int32(NormAngle360(nRotation * -1))));
+        uno::Reference<lang::XServiceInfo> xServiceInfo(xShape, uno::UNO_QUERY);
+        if (!xServiceInfo->supportsService("com.sun.star.text.TextFrame"))
+            xPropertySet->setPropertyValue("RotateAngle", uno::makeAny(sal_Int32(NormAngle360(nRotation * -1))));
     }
 
     if (nHoriOrient != 0 && xPropertySet.is())
commit fd41d725b596968e04fc4788a4481d7dc7e488df
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Oct 6 23:37:18 2014 +0200

    fdo#79604: sw: fix clicking on hyper-links in Draw objects
    
    The URL is dispatched in MouseButtonUp(), but this relies on
    MouseButtonDown() not selecting the drawing object when the cursor is
    over an URL field.
    
    (probably regression from commit 7e2f98d0a0c4a0f36a94353a256e7cc5caa3113b
     and commit 5ed14025645200c77249da364870f5772c01df17)
    
    Change-Id: Ib1504baff5d1fffd6ce53b41d3ff726d8e4d5c9d
    (cherry picked from commit 5284e44ed0594a79b0cc22090a9a82b19962f6c2)
    Reviewed-on: https://gerrit.libreoffice.org/11834
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/uibase/docvw/edtwin.cxx b/sw/source/core/uibase/docvw/edtwin.cxx
index d4294af..e35b688 100644
--- a/sw/source/core/uibase/docvw/edtwin.cxx
+++ b/sw/source/core/uibase/docvw/edtwin.cxx
@@ -3114,8 +3114,27 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
             case MOUSE_LEFT + KEY_MOD2:
             {
 
+                // fdo#79604: first, check if a link has been clicked - do not
+                // select fly in this case!
+                if (1 == nNumberOfClicks)
+                {
+                    UpdatePointer( aDocPos, rMEvt.GetModifier() );
+                    SwEditWin::m_nDDStartPosY = aDocPos.Y();
+                    SwEditWin::m_nDDStartPosX = aDocPos.X();
+
+                    // hit an URL in DrawText object?
+                    if (bExecHyperlinks && pSdrView)
+                    {
+                        SdrViewEvent aVEvt;
+                        pSdrView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
+
+                        if (aVEvt.eEvent == SDREVENT_EXECUTEURL)
+                            bExecDrawTextLink = true;
+                    }
+                }
+
                 bool bHandledFlyClick = false;
-                if ( nNumberOfClicks == nNbFlyClicks )
+                if (!bExecDrawTextLink && nNumberOfClicks == nNbFlyClicks)
                 {
                     bHandledFlyClick = true;
                     // only try to select frame, if pointer already was
@@ -3238,22 +3257,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
                 switch ( nNumberOfClicks )
                 {
                     case 1:
-                    {
-                        UpdatePointer( aDocPos, rMEvt.GetModifier() );
-                        SwEditWin::m_nDDStartPosY = aDocPos.Y();
-                        SwEditWin::m_nDDStartPosX = aDocPos.X();
-
-                        // hit an URL in DrawText object?
-                        if (bExecHyperlinks && pSdrView)
-                        {
-                            SdrViewEvent aVEvt;
-                            pSdrView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
-
-                            if (aVEvt.eEvent == SDREVENT_EXECUTEURL)
-                                bExecDrawTextLink = true;
-                        }
                         break;
-                    }
                     case 2:
                     {
                         bFrmDrag = false;
@@ -3650,7 +3654,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
 
                     bNoInterrupt = bTmpNoInterrupt;
                 }
-                if ( !bOverURLGrf && !bOnlyText )
+                if (!bOverURLGrf && !bExecDrawTextLink && !bOnlyText)
                 {
                     const int nSelType = rSh.GetSelectionType();
                     // Check in general, if an object is selectable at given position.


More information about the Libreoffice-commits mailing list