summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
diff options
context:
space:
mode:
authorVinaya Mandke <vinaya.mandke@synerzip.com>2014-04-04 15:07:52 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-04-14 08:49:58 +0200
commitc1e563f6efd09cd3463f1b92a3022ae288c92087 (patch)
tree79b4290ea72ee188905702050566757c29a64c56 /writerfilter/source/dmapper/DomainMapperTableHandler.cxx
parent8a3eeff238d97d9d5ae548193e32c8b00a22219e (diff)
fdo#76741 [DOCX] Table Alignment and width type
There are two issue related to table in the saved(exported) file - the table alignment in saved file is "left" instead of "center" - the table width type in properties is "auto" instead of "dxa" In the issue file alignment was specified in w:tblpXSpec="center" and so were missed at import. Added support to fetch HORI_ORIENT from frame properties if its not set in Table Properties The ::GetTablePageSize returns 0 if the table width is FIXED. Modified it to return the tableWidth in such case. Conflicts: writerfilter/source/dmapper/DomainMapperTableHandler.cxx Reviewed on: https://gerrit.libreoffice.org/8846 Change-Id: I02a3af5e9d8ef3746c4d6bec0a07a24e01cc12a4
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapperTableHandler.cxx')
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx18
1 files changed, 17 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 336514b78438..0292c58fa12e 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -307,6 +307,20 @@ bool lcl_extractTableBorderProperty(PropertyMapPtr pTableProperties, const Prope
}
+bool lcl_extractHoriOrient(uno::Sequence<beans::PropertyValue>& rFrameProperties, sal_Int32& nHoriOrient)
+{
+ // Shifts the frame left by the given value.
+ for (sal_Int32 i = 0; i < rFrameProperties.getLength(); ++i)
+ {
+ if (rFrameProperties[i].Name == "HoriOrient")
+ {
+ nHoriOrient = rFrameProperties[i].Value.get<sal_Int32>();
+ return true;
+ }
+ }
+ return false;
+}
+
void lcl_DecrementHoriOrientPosition(uno::Sequence<beans::PropertyValue>& rFrameProperties, sal_Int32 nAmount)
{
// Shifts the frame left by the given value.
@@ -543,7 +557,9 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
}
sal_Int32 nHoriOrient = text::HoriOrientation::LEFT_AND_WIDTH;
- m_aTableProperties->getValue( TablePropertyMap::HORI_ORIENT, nHoriOrient ) ;
+ // Fetch Horizontal Orientation in rFrameProperties if not set in m_aTableProperties
+ if ( !m_aTableProperties->getValue( TablePropertyMap::HORI_ORIENT, nHoriOrient ) )
+ lcl_extractHoriOrient( rFrameProperties, nHoriOrient );
m_aTableProperties->Insert( PROP_HORI_ORIENT, uno::makeAny( sal_Int16(nHoriOrient) ) );
//fill default value - if not available
const PropertyMap::const_iterator aRepeatIter =