[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.3' - 4 commits - sc/source svx/source sw/qa sw/source

Henry Castro hcastro at collabora.com
Thu May 28 06:52:02 PDT 2015


 dev/null                               |binary
 sc/source/core/data/drwlayer.cxx       |   59 +++++++++++++++++++++++++++++++++
 svx/source/svdraw/svdoashp.cxx         |    1 
 sw/qa/extras/htmlexport/htmlexport.cxx |   18 ----------
 sw/source/filter/html/wrthtml.cxx      |   17 ++-------
 5 files changed, 64 insertions(+), 31 deletions(-)

New commits:
commit 9722c6c17537b9f0b341486f0f4a46a99a15b786
Author: Henry Castro <hcastro at collabora.com>
Date:   Fri Apr 24 16:55:01 2015 -0400

    Resolves tdf#67712 form controls and draw objects
    
    anchored to cell but changes position after reopening
    
    Also included tdf#68797 "FILEOPEN lost position of lines
    anchored to cell". It was marked as duplicate but the
    step to reproduce are different.
    
    Conflicts:
    	sc/qa/unit/subsequent_filters-test.cxx
    
    Conflicts:
    	sc/qa/unit/subsequent_export-test.cxx
    
    Reviewed-on: https://gerrit.libreoffice.org/15523
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit 487880b6882ec01c1b4679eae60bec484272a86b)
    
    Conflicts:
    	sc/qa/unit/subsequent_export-test.cxx
    
    Change-Id: Ia1c4010f118749256077a0ecad6ca16b867d22f7

diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 073508a..c67f305 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -27,6 +27,7 @@
 #include <com/sun/star/embed/ElementModes.hpp>
 #include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
 #include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <basegfx/matrix/b2dhommatrixtools.hxx>
 
 #include "scitems.hxx"
 #include <editeng/eeitem.hxx>
@@ -119,6 +120,14 @@ void ScUndoObjData::Undo()
         pData->maStart = aOldStt;
         pData->maEnd = aOldEnd;
     }
+
+    // Undo also an untransformed anchor
+    pData = ScDrawLayer::GetNonRotatedObjData( pObj );
+    if (pData)
+    {
+        pData->maStart = aOldStt;
+        pData->maEnd = aOldEnd;
+    }
 }
 
 void ScUndoObjData::Redo()
@@ -130,6 +139,14 @@ void ScUndoObjData::Redo()
         pData->maStart = aNewStt;
         pData->maEnd = aNewEnd;
     }
+
+    // Redo also an untransformed anchor
+    pData = ScDrawLayer::GetNonRotatedObjData( pObj );
+    if (pData)
+    {
+        pData->maStart = aNewStt;
+        pData->maEnd = aNewEnd;
+    }
 }
 
 ScTabDeletedHint::ScTabDeletedHint( SCTAB nTabNo ) :
@@ -499,6 +516,15 @@ void ScDrawLayer::MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SC
             {
                 if ( pObj->ISA( SdrRectObj ) && pData->maStart.IsValid() && pData->maEnd.IsValid() )
                     pData->maStart.PutInOrder( pData->maEnd );
+
+                // Update also an untransformed anchor thats what we stored ( and still do ) to xml
+                ScDrawObjData* pNoRotatedAnchor = GetNonRotatedObjData( pObj, false );
+                if ( pNoRotatedAnchor )
+                {
+                    pNoRotatedAnchor->maStart = pData->maStart;
+                    pNoRotatedAnchor->maEnd = pData->maEnd;
+                }
+
                 AddCalcUndo( new ScUndoObjData( pObj, aOldStt, aOldEnd, pData->maStart, pData->maEnd ) );
                 RecalcPos( pObj, *pData, bNegativePage, bUpdateNoteCaptionPos );
             }
@@ -763,6 +789,39 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati
         ScDrawObjData& rNoRotatedAnchor = *GetNonRotatedObjData( pObj, true );
         if (rData.maLastRect.IsEmpty())
         {
+            // Every shape it is saved with an negative offset relative to cell
+            if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
+            {
+                double fRotate(0.0);
+                double fShearX(0.0);
+
+                Point aPoint;
+                Rectangle aRect;
+
+                basegfx::B2DTuple aScale;
+                basegfx::B2DTuple aTranslate;
+                basegfx::B2DPolyPolygon aPolyPolygon;
+                basegfx::B2DHomMatrix aOriginalMatrix;
+
+                aRect = pDoc->GetMMRect(nCol1, nRow1, nCol1 , nRow1, nTab1);
+
+                if (bNegativePage)
+                    aPoint.X() = aRect.Right();
+                else
+                    aPoint.X() = aRect.Left();
+                aPoint.Y() = aRect.Top();
+
+                pObj->TRGetBaseGeometry(aOriginalMatrix, aPolyPolygon);
+                aOriginalMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
+                aTranslate += ::basegfx::B2DTuple(aPoint.X(), aPoint.Y());
+                aOriginalMatrix = basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix(
+                    aScale,
+                    fShearX,
+                    fRotate,
+                    aTranslate);
+                pObj->TRSetBaseGeometry(aOriginalMatrix, aPolyPolygon);
+            }
+
             // It's confusing ( but blame that we persist the anchor in terms of unrotated shape )
             // that the initial anchor we get here is in terms of an unrotated shape ( if the shape is rotated )
             // we need to save the old anchor ( for persisting ) and also track any resize or repositions that happen.
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 8f7b0e2..aaad69a 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -2984,6 +2984,7 @@ void SdrObjCustomShape::TRSetBaseGeometry(const basegfx::B2DHomMatrix& rMatrix,
     }
 
     // reset object shear and rotations
+    fObjectRotation = 0.0;
     aGeo.nDrehWink = 0;
     aGeo.RecalcSinCos();
     aGeo.nShearWink = 0;
commit f26a56cda481854e1104cd58b20ab550f68e8980
Author: Andras Timar <andras.timar at collabora.com>
Date:   Thu May 28 11:35:55 2015 +0200

    Revert "tdf#76291 write encoded URL as href in html output"
    
    This reverts commit 98dbb5bac6c4933fd41afc1259dfaa17fc0678ca.

diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 3c84e78..daab896 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -79,7 +79,6 @@
 #include <rtl/strbuf.hxx>
 #include <IDocumentSettingAccess.hxx>
 #include <xmloff/odffields.hxx>
-#include <tools/urlobj.hxx>
 
 #define MAX_INDENT_LEVEL 20
 
@@ -1146,7 +1145,7 @@ void SwHTMLWriter::OutImplicitMark( const OUString& rMark,
     }
 }
 
-void SwHTMLWriter::convertHyperlinkHRefValue( const OUString& rURL )
+void SwHTMLWriter::OutHyperlinkHRefValue( const OUString& rURL )
 {
     OUString sURL( rURL );
     sal_Int32 nPos = sURL.lastIndexOf( cMarkSeparator );
@@ -1168,14 +1167,10 @@ void SwHTMLWriter::convertHyperlinkHRefValue( const OUString& rURL )
             }
         }
     }
-    INetURLObject aURL( sURL );
-    return URIHelper::simpleNormalizedMakeRelative( GetBaseURL(), aURL.GetMainURL( INetURLObject::NO_DECODE ) );
-}
 
-void SwHTMLWriter::OutHyperlinkHRefValue( const OUString& rURL )
-{
-    OUString sURL = convertHyperlinkHRefValue(rURL);
-    HTMLOutFuncs::Out_String( Strm(), sURL, eDestEnc, &aNonConvertableCharacters );
+    sURL = URIHelper::simpleNormalizedMakeRelative( GetBaseURL(), sURL);
+    HTMLOutFuncs::Out_String( Strm(), sURL, eDestEnc,
+                              &aNonConvertableCharacters );
 }
 
 void SwHTMLWriter::OutBackground( const SvxBrushItem *pBrushItem, bool bGraphic )
commit 16c8e7b4ec816e01ec8b55dfacdec00d87b492fb
Author: Andras Timar <andras.timar at collabora.com>
Date:   Thu May 28 11:35:46 2015 +0200

    Revert "tdf#90905 fix for url encoding in internal urls"
    
    This reverts commit 88c8441a73c1b7f2269b0ef92d21c56d901a1d2e.

diff --git a/sw/qa/extras/htmlexport/data/tdf90905.odt b/sw/qa/extras/htmlexport/data/tdf90905.odt
deleted file mode 100644
index cab8a04..0000000
Binary files a/sw/qa/extras/htmlexport/data/tdf90905.odt and /dev/null differ
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index 3201cdc..a377195 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -183,15 +183,6 @@ DECLARE_HTMLEXPORT_TEST(testExportCheckboxRadioButtonState, "checkbox-radiobutto
 }
 #endif
 
-DECLARE_HTMLEXPORT_TEST(testExportInternalUrl, "tdf90905.odt")
-{
-    htmlDocPtr pDoc = parseHtml(maTempFile);
-    CPPUNIT_ASSERT(pDoc);
-
-    // Internal url should be valid
-    assertXPath(pDoc, "/html/body/p/a", "href", "#0.0.1.Text|outline");
-}
-
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 24f51ed..3c84e78 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -1168,12 +1168,8 @@ void SwHTMLWriter::convertHyperlinkHRefValue( const OUString& rURL )
             }
         }
     }
-    else
-    {
-        INetURLObject aURL(sURL);
-        sURL = aURL.GetMainURL(INetURLObject::NO_DECODE);
-    }
-    return URIHelper::simpleNormalizedMakeRelative( GetBaseURL(), sURL );
+    INetURLObject aURL( sURL );
+    return URIHelper::simpleNormalizedMakeRelative( GetBaseURL(), aURL.GetMainURL( INetURLObject::NO_DECODE ) );
 }
 
 void SwHTMLWriter::OutHyperlinkHRefValue( const OUString& rURL )
commit fecbdd161931822989c56565d23c74b38453cf58
Author: Andras Timar <andras.timar at collabora.com>
Date:   Thu May 28 11:29:20 2015 +0200

    Revert "tdf#76291 unit test for html export href encoding"
    
    This reverts commit 44f7f938f1269189c0927e9e10d5044b8dc029cb.

diff --git a/sw/qa/extras/htmlexport/data/tdf76291.odt b/sw/qa/extras/htmlexport/data/tdf76291.odt
deleted file mode 100644
index 68588c8..0000000
Binary files a/sw/qa/extras/htmlexport/data/tdf76291.odt and /dev/null differ
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index d51f7fe..3201cdc 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -181,15 +181,6 @@ DECLARE_HTMLEXPORT_TEST(testExportCheckboxRadioButtonState, "checkbox-radiobutto
     assertXPath(pDoc, "/html/body/form/p[4]/input", "type", "radio");
     // FIXME not in 4.3 assertXPathNoAttribute(pDoc, "/html/body/form/p[4]/input", "checked");
 }
-
-DECLARE_HTMLEXPORT_TEST(testExportUrlEncoding, "tdf76291.odt")
-{
-    htmlDocPtr pDoc = parseHtml(maTempFile);
-    CPPUNIT_ASSERT(pDoc);
-
-    // Test URI encoded hyperlink with Chinese characters
-    assertXPath(pDoc, "/html/body/p/a", "href", "http://www.youtube.com/results?search_query=%E7%B2%B5%E8%AA%9Emv&sm=12");
-}
 #endif
 
 DECLARE_HTMLEXPORT_TEST(testExportInternalUrl, "tdf90905.odt")


More information about the Libreoffice-commits mailing list