diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-05-22 11:34:01 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-06-13 14:05:09 +0200 |
commit | 33e392e7d4fbfc61480751311e7187a5730acc78 (patch) | |
tree | 0e404ae79583e123c06bbfc1a3c97510c72b2310 /writerfilter/source/dmapper/DomainMapperTableHandler.cxx | |
parent | 83b785e1924e418f98167205cd1b20054feffe3f (diff) |
n#816593: Floating table width import fix: adjust the frame width
(cherry picked from commit 9f4c8a8bca06b4c2a916a51909367b453fc41a8b)
Conflicts:
sw/qa/extras/ooxmlimport/data/table_width.docx
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Change-Id: I8212bc5981418f6cbd514bf5002e6a5dbdf53152
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapperTableHandler.cxx')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 2a5f5031072f..41d2c045daf0 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -774,9 +774,23 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel) if (xTable.is() && xStart.is() && xEnd.is()) { uno::Reference<beans::XPropertySet> xTableProperties(xTable, uno::UNO_QUERY); - aFrameProperties.realloc(aFrameProperties.getLength() + 1); - aFrameProperties[aFrameProperties.getLength() - 1].Name = "Width"; - aFrameProperties[aFrameProperties.getLength() - 1].Value = xTableProperties->getPropertyValue("Width"); + sal_Bool bIsRelative = sal_False; + xTableProperties->getPropertyValue("IsWidthRelative") >>= bIsRelative; + if (!bIsRelative) + { + aFrameProperties.realloc(aFrameProperties.getLength() + 1); + aFrameProperties[aFrameProperties.getLength() - 1].Name = "Width"; + aFrameProperties[aFrameProperties.getLength() - 1].Value = xTableProperties->getPropertyValue("Width"); + } + else + { + aFrameProperties.realloc(aFrameProperties.getLength() + 1); + aFrameProperties[aFrameProperties.getLength() - 1].Name = "FrameWidthPercent"; + aFrameProperties[aFrameProperties.getLength() - 1].Value = xTableProperties->getPropertyValue("RelativeWidth"); + + // Applying the relative width to the frame, needs to have the table width to be 100% of the frame width + xTableProperties->setPropertyValue("RelativeWidth", uno::makeAny(sal_Int16(100))); + } // A non-zero left margin would move the table out of the frame, move the frame itself instead. xTableProperties->setPropertyValue("LeftMargin", uno::makeAny(sal_Int32(0))); |