diff options
-rw-r--r-- | sw/qa/extras/ww8export/data/tdf80635_marginRightRTL.doc | bin | 0 -> 25088 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/data/tdf80635_pageRightRTL.doc | bin | 0 -> 25088 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export2.cxx | 22 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 8 |
4 files changed, 29 insertions, 1 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf80635_marginRightRTL.doc b/sw/qa/extras/ww8export/data/tdf80635_marginRightRTL.doc Binary files differnew file mode 100644 index 000000000000..6e509a1907e5 --- /dev/null +++ b/sw/qa/extras/ww8export/data/tdf80635_marginRightRTL.doc diff --git a/sw/qa/extras/ww8export/data/tdf80635_pageRightRTL.doc b/sw/qa/extras/ww8export/data/tdf80635_pageRightRTL.doc Binary files differnew file mode 100644 index 000000000000..71f9adf4a8b5 --- /dev/null +++ b/sw/qa/extras/ww8export/data/tdf80635_pageRightRTL.doc diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx index b477b03bbeaa..4672b750baa3 100644 --- a/sw/qa/extras/ww8export/ww8export2.cxx +++ b/sw/qa/extras/ww8export/ww8export2.cxx @@ -252,6 +252,28 @@ DECLARE_WW8EXPORT_TEST(testTdf116570_exportFootnote, "tdf116570_exportFootnote.o CPPUNIT_ASSERT_EQUAL_MESSAGE( "Number of paragraphs in first footnote", 2, getParagraphs(xFootnoteText) ); } +DECLARE_WW8EXPORT_TEST(testTdf80635_pageRightRTL, "tdf80635_pageRightRTL.doc") +{ + // tdf#80635 - transfer the float orientation to the table. + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Horizontal Orientation", text::HoriOrientation::LEFT_AND_WIDTH, getProperty<sal_Int16>(xTable, "HoriOrient")); + //CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table Indent", long(3500), getProperty<long>(xTable, "LeftMargin"), 100); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Did you fix me? Text probably should wrap here", 2, getPages() ); + // If so, replace test with the table set to a greater preferred width so that the text shouldn't wrap +} + +DECLARE_WW8EXPORT_TEST(testTdf80635_marginRTL, "tdf80635_marginRightRTL.doc") +{ + // tdf#80635 - transfer the float orientation to the table. + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + if ( !mbExported ) + CPPUNIT_ASSERT_EQUAL_MESSAGE("Horizontal Orientation", text::HoriOrientation::RIGHT, getProperty<sal_Int16>(xTable, "HoriOrient")); +} + DECLARE_WW8EXPORT_TEST(testTdf107773, "tdf107773.doc") { uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 3b1615793482..775dae384f6d 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -2428,7 +2428,13 @@ void WW8TabDesc::CreateSwTable() if ( m_pIo->m_xSFlyPara && !m_pIo->m_xSFlyPara->pFlyFormat ) { // Get the table orientation from the fly - if ( m_pIo->m_xSFlyPara->eHAlign == text::HoriOrientation::CENTER ) + // Do we also need to check m_pIo->m_xSFlyPara->bToggelPos/IsPosToggle()? [Probably not - layout-only concern] + const bool bAdjustMargin = m_pIo->m_xSFlyPara->eHRel == text::RelOrientation::PAGE_FRAME || m_pIo->m_xSFlyPara->nXPos; + const bool bIsInsideMargin = m_bIsBiDi ? m_pIo->m_xSFlyPara->eHAlign == text::HoriOrientation::RIGHT + : m_pIo->m_xSFlyPara->eHAlign == text::HoriOrientation::LEFT; + if ( bIsInsideMargin && bAdjustMargin ) + m_eOri = text::HoriOrientation::LEFT_AND_WIDTH; + else if ( m_pIo->m_xSFlyPara->eHAlign != text::HoriOrientation::NONE ) m_eOri = m_pIo->m_xSFlyPara->eHAlign; } |