[Libreoffice-commits] core.git: sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Fri Nov 7 12:18:10 PST 2014
sw/qa/extras/ooxmlexport/data/table-rtl.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 10 ++++++++++
writerfilter/source/dmapper/DomainMapperTableManager.cxx | 7 +++++++
3 files changed, 17 insertions(+)
New commits:
commit dce20aa0e7df0cf43c2ec3b04c4cb5a405b6fd9b
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Nov 7 21:09:26 2014 +0100
writerfilter: handle ooxml:CT_TblPrBase_bidiVisual
Change-Id: I619a6b161e5ed7e902406b288552b06fe7da487e
diff --git a/sw/qa/extras/ooxmlexport/data/table-rtl.docx b/sw/qa/extras/ooxmlexport/data/table-rtl.docx
new file mode 100644
index 0000000..90fba0b
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/table-rtl.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 11ba954..c06ed65 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -15,6 +15,7 @@
#include <com/sun/star/text/FontEmphasis.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/XTextRangeCompare.hpp>
+#include <com/sun/star/text/WritingMode2.hpp>
#include <string>
@@ -503,6 +504,15 @@ DECLARE_OOXMLEXPORT_TEST(testPageBreakBefore, "page-break-before.docx")
CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, getProperty<style::BreakType>(getParagraph(2), "BreakType"));
}
+DECLARE_OOXMLEXPORT_TEST(testTableRtl, "table-rtl.docx")
+{
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ // This was text::WritingMode2::LR_TB, i.e. direction of the table was ignored.
+ CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>(xTable, "WritingMode"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 15f4397..51cfd9b 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -463,6 +463,13 @@ bool DomainMapperTableManager::sprm(Sprm & rSprm)
case NS_ooxml::LN_CT_TblPrBase_tblCellSpacing:
// To-Do: Not yet preserved
break;
+ case NS_ooxml::LN_CT_TblPrBase_bidiVisual:
+ {
+ TablePropertyMapPtr pPropMap(new TablePropertyMap());
+ pPropMap->Insert(PROP_WRITING_MODE, uno::makeAny(nIntValue ? text::WritingMode2::RL_TB : text::WritingMode2::LR_TB));
+ insertTableProps(pPropMap);
+ break;
+ }
default:
bRet = false;
More information about the Libreoffice-commits
mailing list