summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlexport
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras/ooxmlexport')
-rw-r--r--sw/qa/extras/ooxmlexport/data/btlr-textbox.docxbin0 -> 15965 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx18
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/btlr-textbox.docx b/sw/qa/extras/ooxmlexport/data/btlr-textbox.docx
new file mode 100644
index 000000000000..181d305eac95
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/btlr-textbox.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index e392644f0de3..c754acafc9ed 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -13,9 +13,11 @@
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
+#include <editeng/frmdiritem.hxx>
#include <IDocumentSettingAccess.hxx>
#include <editsh.hxx>
+#include <frmatr.hxx>
class Test : public SwModelTestBase
{
@@ -75,6 +77,22 @@ DECLARE_OOXMLEXPORT_TEST(testTbrlTextbox, "tbrl-textbox.docx")
aGeometry["TextPreRotateAngle"].get<sal_Int32>());
}
+DECLARE_OOXMLEXPORT_TEST(testBtlrShape, "btlr-textbox.docx")
+{
+ SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
+ CPPUNIT_ASSERT(pTextDoc);
+ SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
+ const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
+ CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rFormats.size());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(RES_DRAWFRMFMT), rFormats[0]->Which());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt16>(RES_FLYFRMFMT), rFormats[1]->Which());
+ // Without the accompanying fix in place, this test would have failed with 'Expected: 5, Actual:
+ // 4', i.e. the textbox inherited its writing direction instead of having an explicit btlr
+ // value.
+ CPPUNIT_ASSERT_EQUAL(SvxFrameDirection::Vertical_LR_BT,
+ rFormats[1]->GetAttrSet().GetFrameDir().GetValue());
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf124637_sectionMargin, "tdf124637_sectionMargin.docx")
{
uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);