summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/CppunitTest_sw_ooxmlimport.mk1
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf97371.docxbin0 -> 18800 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx15
3 files changed, 16 insertions, 0 deletions
diff --git a/sw/CppunitTest_sw_ooxmlimport.mk b/sw/CppunitTest_sw_ooxmlimport.mk
index 4074255a7cf3..dbcead9598c3 100644
--- a/sw/CppunitTest_sw_ooxmlimport.mk
+++ b/sw/CppunitTest_sw_ooxmlimport.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_ooxmlimport, \
sw \
tl \
vcl \
+ svxcore \
$(gb_UWINAPI) \
))
diff --git a/sw/qa/extras/ooxmlimport/data/tdf97371.docx b/sw/qa/extras/ooxmlimport/data/tdf97371.docx
new file mode 100644
index 000000000000..87e67ddf877b
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf97371.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 14ddf51297cc..2fe18f889cc5 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -74,10 +74,12 @@
#include <comphelper/sequenceashashmap.hxx>
#include <com/sun/star/text/GraphicCrop.hpp>
#include <swtypes.hxx>
+#include <drawdoc.hxx>
#include <tools/datetimeutils.hxx>
#include <oox/drawingml/drawingmltypes.hxx>
#include <unotools/streamwrap.hxx>
#include <comphelper/propertysequence.hxx>
+#include <svx/svdpage.hxx>
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
#include <bordertest.hxx>
@@ -3064,6 +3066,19 @@ DECLARE_OOXMLIMPORT_TEST(testTdf95213, "tdf95213.docx")
CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, getProperty<float>(xStyle, "CharWeight"));
}
+DECLARE_OOXMLIMPORT_TEST(testTdf97371, "tdf97371.docx")
+{
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument *>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+ SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+ SdrPage* pPage = pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
+ SdrObject* pShape = pPage->GetObj(0);
+ SdrObject* pTextBox = pPage->GetObj(1);
+ 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);
+}
+
// base class to supply a helper method for testHFLinkToPrev
class testHFBase : public Test
{