summaryrefslogtreecommitdiff
path: root/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-05-22 11:34:01 +0200
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-06-19 13:50:23 +0200
commitebd25b53f8416340391429921232a8b0fbb1f331 (patch)
tree51eae379c2f9deced679af44ffc8db218da812bc /writerfilter/source/dmapper/DomainMapperTableHandler.cxx
parent666482ebbd1f459bf8ace91c9374590b1bfaa978 (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 (cherry picked from commit 33e392e7d4fbfc61480751311e7187a5730acc78)
Diffstat (limited to 'writerfilter/source/dmapper/DomainMapperTableHandler.cxx')
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableHandler.cxx20
1 files changed, 17 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index a3bdb71b715b..3b5aa4c6743e 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -779,9 +779,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)));