summaryrefslogtreecommitdiffstats
path: root/sw/qa/extras/ooxmlexport
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:29:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 09:29:03 +0000
commit5a7157d319477830426797532e02ac39d3b859f4 (patch)
tree3773f5ce209bee14a5643e98672e0f3828c71434 /sw/qa/extras/ooxmlexport
parentReleasing progress-linux version 4:24.2.0-3~progress7.99u1. (diff)
downloadlibreoffice-5a7157d319477830426797532e02ac39d3b859f4.tar.xz
libreoffice-5a7157d319477830426797532e02ac39d3b859f4.zip
Merging upstream version 4:24.2.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sw/qa/extras/ooxmlexport')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf153909_followTextFlow.docxbin0 -> 23909 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf159207_footerFramePrBorder.docxbin0 -> 17262 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport19.cxx1
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport21.cxx68
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport8.cxx6
5 files changed, 75 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf153909_followTextFlow.docx b/sw/qa/extras/ooxmlexport/data/tdf153909_followTextFlow.docx
new file mode 100644
index 0000000000..712e37acea
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf153909_followTextFlow.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf159207_footerFramePrBorder.docx b/sw/qa/extras/ooxmlexport/data/tdf159207_footerFramePrBorder.docx
new file mode 100644
index 0000000000..7a4c54cc5c
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf159207_footerFramePrBorder.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
index 0c1d1a25fb..d6193305e9 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
@@ -609,6 +609,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf97371, "tdf97371.docx")
tools::Long nDiff = std::abs(pShape->GetSnapRect().Top() - pTextBox->GetSnapRect().Top());
// The top of the two shapes were 410 and 3951, now it should be 3950 and 3951.
CPPUNIT_ASSERT(nDiff < 10);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(tools::Long(3900), pShape->GetSnapRect().Top(), 100);
}
CPPUNIT_TEST_FIXTURE(Test, testTdf99140)
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
new file mode 100644
index 0000000000..cdcdfe7785
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/.
+ */
+
+#include <swmodeltestbase.hxx>
+
+#include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/text/XDocumentIndex.hpp>
+#include <com/sun/star/text/XTextTable.hpp>
+#include <com/sun/star/style/LineSpacing.hpp>
+#include <com/sun/star/style/LineSpacingMode.hpp>
+
+#include <pam.hxx>
+#include <unotxdoc.hxx>
+#include <docsh.hxx>
+
+namespace
+{
+class Test : public SwModelTestBase
+{
+public:
+ Test()
+ : SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text")
+ {
+ }
+};
+
+DECLARE_OOXMLEXPORT_TEST(testTdf153909_followTextFlow, "tdf153909_followTextFlow.docx")
+{
+ // Although MSO's UI reports "layoutInCell" for the rectangle, it isn't specified or honored
+ CPPUNIT_ASSERT(!getProperty<bool>(getShape(1), "IsFollowingTextFlow"));
+
+ // Given a table with a rectangle anchored in it (wrap-through) that appears above the table...
+ xmlDocUniquePtr pDump = parseLayoutDump();
+ sal_Int32 nRectBottom
+ = getXPath(pDump, "//anchored/SwAnchoredDrawObject/bounds"_ostr, "bottom"_ostr).toInt32();
+ sal_Int32 nTableTop = getXPath(pDump, "//tab/row/infos/bounds"_ostr, "top"_ostr).toInt32();
+ // The entire table must be below the rectangle
+ CPPUNIT_ASSERT(nTableTop > nRectBottom);
+}
+
+CPPUNIT_TEST_FIXTURE(Test, testTdf159207_footerFramePrBorder)
+{
+ loadFromFile(u"tdf159207_footerFramePrBorder.docx"); // re-imports as editeng Frame/Shape
+
+ // given a doc with footer paragraphs frame (with a top border, but no left border)
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(),
+ uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xFrame0(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+ auto aBorder = getProperty<table::BorderLine2>(xFrame0, "LeftBorder");
+ sal_uInt32 nBorderWidth
+ = aBorder.OuterLineWidth + aBorder.InnerLineWidth + aBorder.LineDistance;
+ // Without patch it failed with Expected 0, Actual 26
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Left border:", static_cast<sal_uInt32>(0), nBorderWidth);
+
+ // TODO: there SHOULD BE a top border, and even if loaded, it would be lost on re-import...
+}
+
+} // end of anonymous namespace
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
index 10fd87ebec..0ea69e6988 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx
@@ -173,6 +173,12 @@ after they are loaded.
CPPUNIT_ASSERT_EQUAL( OUString( "Black" ), descr1 );
CPPUNIT_ASSERT_EQUAL( OUString( "Red" ), descr2 );
CPPUNIT_ASSERT_EQUAL( OUString( "Green" ), descr3 );
+
+ // tdf#139915/tdf#159157 This was 826, but it should be -826
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-826), getProperty<sal_Int32>(image1, "VertOrientPosition"));
+ sal_Int16 nExpected = text::RelOrientation::TEXT_LINE;
+ CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int16>(image1, "VertOrientRelation"));
+
}
DECLARE_OOXMLEXPORT_TEST(testN750255, "n750255.docx")