diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-07-02 17:33:03 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-07-02 18:06:33 +0200 |
commit | 3325e0f206ce864730468c3556ce06760042c157 (patch) | |
tree | 29be7cf9d89a59fbb58759260d27fe3c1e9217f5 /writerfilter/source/dmapper/DomainMapperTableHandler.cxx | |
parent | ffef410b1251a5daceb9d8cdeed2b8b2eedb8f32 (diff) |
bnc#865381 DOCX import: handle w:jc=center inside w:textDirection=btLr
Change-Id: I102c70429457515b34e74cb8e82e1417e6276d1d
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapperTableHandler.cxx')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 16b367cceda7..8243bf62fcc1 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -28,6 +28,8 @@ #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/RelOrientation.hpp> #include <com/sun/star/text/SizeType.hpp> +#include <com/sun/star/text/VertOrientation.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> #include <dmapperLoggers.hxx> #include <TablePositionHandler.hxx> @@ -826,6 +828,21 @@ CellPropertyValuesSeq_t DomainMapperTableHandler::endTableGetCellProperties(Tabl } aCellIterator->get()->erase(PROP_HORIZONTAL_MERGE); } + + // Cell direction is not an UNO Property, either. + const PropertyMap::const_iterator aCellDirectionIter = aCellIterator->get()->find(PROP_CELL_DIRECTION); + if (aCellDirectionIter != aCellIterator->get()->end()) + { + if (aCellDirectionIter->second.getValue().get<sal_Int32>() == 3) + { + // btLr, so map ParagraphAdjust_CENTER to VertOrientation::CENTER. + uno::Reference<beans::XPropertySet> xPropertySet((*m_pTableSeq)[nRow][nCell][0], uno::UNO_QUERY); + if (xPropertySet->getPropertyValue("ParaAdjust").get<sal_Int16>() == style::ParagraphAdjust_CENTER) + aCellIterator->get()->Insert(PROP_VERT_ORIENT, uno::makeAny(text::VertOrientation::CENTER)); + } + aCellIterator->get()->erase(PROP_CELL_DIRECTION); + } + pSingleCellProperties[nCell] = aCellIterator->get()->GetPropertyValues(); #ifdef DEBUG_DOMAINMAPPER dmapper_logger->endElement(); |