diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-07-02 17:33:03 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-07-10 15:23:59 +0000 |
commit | c65aa400296a1a1b59b43223bdac030c749e51e3 (patch) | |
tree | 96ae1b59eebebf43fcac375d4e194637dbbe6532 /writerfilter/source/dmapper/DomainMapperTableHandler.cxx | |
parent | 6d21e5425690732a3254722add7023ace4d3c537 (diff) |
bnc#865381 DOCX import: handle w:jc=center inside w:textDirection=btLr
(cherry picked from commit 3325e0f206ce864730468c3556ce06760042c157)
Reviewed-on: https://gerrit.libreoffice.org/10049
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Change-Id: I102c70429457515b34e74cb8e82e1417e6276d1d
Reviewed-on: https://gerrit.libreoffice.org/10046
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
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 57bbd32388f9..a8650a52d86d 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_DMAPPER_TABLE_HANDLER dmapper_logger->endElement(); |