summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/rightToLeftParagraph.pptxbin0 -> 31841 bytes
-rw-r--r--sd/qa/unit/export-tests.cxx37
2 files changed, 37 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/rightToLeftParagraph.pptx b/sd/qa/unit/data/pptx/rightToLeftParagraph.pptx
new file mode 100644
index 000000000000..8c3a46c8b985
--- /dev/null
+++ b/sd/qa/unit/data/pptx/rightToLeftParagraph.pptx
Binary files differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 8472ce189c19..56e4c6bc1c2f 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -58,6 +58,7 @@
#include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
+ #include <com/sun/star/text/WritingMode2.hpp>
#include <svx/svdotable.hxx>
#include <com/sun/star/table/XTable.hpp>
#include <com/sun/star/table/XMergeableCell.hpp>
@@ -91,6 +92,7 @@ public:
void testBulletStartNumber();
void testLineStyle();
void testCellLeftAndRightMargin();
+ void testRightToLeftParaghraph();
#if !defined WNT
void testBnc822341();
@@ -118,6 +120,8 @@ public:
CPPUNIT_TEST(testBulletStartNumber);
CPPUNIT_TEST(testLineStyle);
CPPUNIT_TEST(testCellLeftAndRightMargin);
+ CPPUNIT_TEST(testRightToLeftParaghraph);
+
#if !defined WNT
CPPUNIT_TEST(testBnc822341);
#endif
@@ -836,6 +840,39 @@ void SdExportTest::testLineStyle()
}
+void SdExportTest::testRightToLeftParaghraph()
+{
+ ::sd::DrawDocShellRef xDocShRef = loadURL(getURLFromSrc("/sd/qa/unit/data/pptx/rightToLeftParagraph.pptx"), PPTX);
+
+ xDocShRef = saveAndReload( xDocShRef, PPTX );
+
+ uno::Reference< drawing::XDrawPagesSupplier > xDoc(
+ xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW );
+
+ uno::Reference< drawing::XDrawPage > xPage(
+ xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
+
+ uno::Reference< beans::XPropertySet > xShape(
+ xPage->getByIndex(0), uno::UNO_QUERY );
+ CPPUNIT_ASSERT_MESSAGE( "no shape", xShape.is() );
+
+ // Get first paragraph
+ uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
+ CPPUNIT_ASSERT_MESSAGE( "not a text shape", xText.is() );
+ uno::Reference<container::XEnumerationAccess> paraEnumAccess;
+ paraEnumAccess.set(xText, uno::UNO_QUERY);
+ uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
+ uno::Reference<text::XTextRange> const xParagraph(paraEnum->nextElement(),
+ uno::UNO_QUERY_THROW);
+ uno::Reference< beans::XPropertySet > xPropSet( xParagraph, uno::UNO_QUERY_THROW );
+
+ sal_Int16 nWritingMode = 0;
+ xPropSet->getPropertyValue( "WritingMode" ) >>= nWritingMode;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong paragraph WritingMode", text::WritingMode2::RL_TB, nWritingMode);
+
+ xDocShRef->DoClose();
+}
+
#if !defined WNT
void SdExportTest::testBnc822341()