[Libreoffice-commits] core.git: 4 commits - sw/qa sw/source writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Jun 3 07:21:09 PDT 2014


 sw/qa/extras/odfexport/data/textbox-rounded-corners.odt |binary
 sw/qa/extras/odfexport/odfexport.cxx                    |   15 +++++
 sw/source/core/doc/textboxhelper.cxx                    |    4 +
 sw/source/core/unocore/unoframe.cxx                     |    6 +-
 writerfilter/source/ooxml/todo.xsl                      |   46 ----------------
 5 files changed, 24 insertions(+), 47 deletions(-)

New commits:
commit 183721a9b2f2847b1cdeb7286a07f631359cae6d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jun 3 15:55:45 2014 +0200

    writerfilter: remove unused todo.xsl
    
    Change-Id: Icd0ab345619fea029a63bafae9077a72cccc9852

diff --git a/writerfilter/source/ooxml/todo.xsl b/writerfilter/source/ooxml/todo.xsl
deleted file mode 100644
index 62155de..0000000
--- a/writerfilter/source/ooxml/todo.xsl
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
--->
-
-<xsl:stylesheet version="1.0" 
-	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-	xmlns:rng="http://relaxng.org/ns/structure/1.0">
-
-<xsl:output method="xml" indent="yes"/>
-
-<xsl:template match="/">
-    <todo>
-    <xsl:for-each select="/stage3">
-        <xsl:for-each select="attribute|element">
-            <xsl:choose>
-                <xsl:when test="@qname and @resource='Properties' and not(file)">
-                    <xsl:copy-of select="."/>
-                </xsl:when>
-                <xsl:when test="@qname and file/status[number(@done) < 100 and number(@planned) > 0]">
-                    <xsl:copy>
-                        <xsl:copy-of select="@*"/>
-                        <xsl:copy-of select="file[status[number(@done) < 100 and number(@planned) > 0]]"/>
-                    </xsl:copy>
-                </xsl:when>
-            </xsl:choose>
-        </xsl:for-each>
-    </xsl:for-each>
-    </todo>
-</xsl:template>
-
-</xsl:stylesheet>
\ No newline at end of file
commit 2cbd2abf1c26639edde6e0f9823e349b6edfab79
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jun 3 15:02:57 2014 +0200

    ODF loext:text-box import/export testcase
    
    There is a lot more to test here, but for now just test that we can have
    tables and rounded corners at the same time.
    
    Change-Id: Ia9a4877202d1d040209f49a428b83633c58fc7c7

diff --git a/sw/qa/extras/odfexport/data/textbox-rounded-corners.odt b/sw/qa/extras/odfexport/data/textbox-rounded-corners.odt
new file mode 100644
index 0000000..3851850
Binary files /dev/null and b/sw/qa/extras/odfexport/data/textbox-rounded-corners.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 1284435..b5010bf 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -364,6 +364,21 @@ DECLARE_ODFEXPORT_TEST(testShapeRelsize, "shape-relsize.odt")
     CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xShape, "RelativeHeightRelation"));
 }
 
+DECLARE_ODFEXPORT_TEST(testTextboxRoundedCorners, "textbox-rounded-corners.odt")
+{
+    uno::Reference<drawing::XShape> xShape = getShape(1);
+    comphelper::SequenceAsHashMap aCustomShapeGeometry = comphelper::SequenceAsHashMap(getProperty< uno::Sequence<beans::PropertyValue> >(xShape, "CustomShapeGeometry"));
+
+    // Test that the shape is a rounded rectangle.
+    CPPUNIT_ASSERT_EQUAL(OUString("round-rectangle"), aCustomShapeGeometry["Type"].get<OUString>());
+
+    // The shape text should start with a table, with "a" in its A1 cell.
+    uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
+    uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1, xText), uno::UNO_QUERY);
+    uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY);
+    CPPUNIT_ASSERT_EQUAL(OUString("a"), xCell->getString());
+}
+
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();
commit 445b58a829ecc3868b79997480958571312cbc4a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jun 3 15:35:22 2014 +0200

    SwTextBoxHelper::queryInterface: handle css::text::XTextRange as well
    
    Change-Id: If56d7cab269a76062ee75bb1a9484f154b72c4d7

diff --git a/sw/source/core/doc/textboxhelper.cxx b/sw/source/core/doc/textboxhelper.cxx
index b732af1..e2b7d12 100644
--- a/sw/source/core/doc/textboxhelper.cxx
+++ b/sw/source/core/doc/textboxhelper.cxx
@@ -202,6 +202,10 @@ uno::Any SwTextBoxHelper::queryInterface(SwFrmFmt* pShape, const uno::Type& rTyp
     {
         lcl_queryInterface<text::XText>(pShape, aRet);
     }
+    else if (rType == cppu::UnoType<css::text::XTextRange>::get())
+    {
+        lcl_queryInterface<text::XTextRange>(pShape, aRet);
+    }
 
 
     return aRet;
commit fbb3db64de22a7fd0e14dce5e14e3b690285afdb
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jun 3 14:55:13 2014 +0200

    SwXFrame::setPropertyValue: ignore setting ZOrder on TextBoxes
    
    The ZOrder of a TextBox should be the ZOrder of the shape + 1, don't
    allow setting it to something custom.
    
    Change-Id: I17439aa9e494ae62ab80e178a8c5d90cea030351

diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 8479853..9803ef1 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -58,6 +58,7 @@
 #include <ndole.hxx>
 #include <frmfmt.hxx>
 #include <frame.hxx>
+#include <textboxhelper.hxx>
 #include <unotextrange.hxx>
 #include <unotextcursor.hxx>
 #include <unoparagraph.hxx>
@@ -1674,7 +1675,10 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno::
         {
             sal_Int32 nZOrder = - 1;
             aValue >>= nZOrder;
-            if( nZOrder >= 0)
+
+            // Don't set an explicit ZOrder on TextBoxes.
+            std::list<SwFrmFmt*> aTextBoxes = SwTextBoxHelper::findTextBoxes(pDoc);
+            if( nZOrder >= 0 && std::find(aTextBoxes.begin(), aTextBoxes.end(), pFmt) == aTextBoxes.end())
             {
                 SdrObject* pObject =
                     GetOrCreateSdrObject( (SwFlyFrmFmt&)*pFmt );


More information about the Libreoffice-commits mailing list