[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - writerfilter/source
Cédric Bosdonnat
cedric.bosdonnat at free.fr
Thu Jun 13 05:08:32 PDT 2013
writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 20 ++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
New commits:
commit 33e392e7d4fbfc61480751311e7187a5730acc78
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Wed May 22 11:34:01 2013 +0200
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
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index 2a5f503..41d2c04 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)));
More information about the Libreoffice-commits
mailing list