summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2015-04-02 13:42:11 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2015-04-09 23:24:42 +0000
commit6322ef95c9d3128ede01d45f1542c6ad03cac392 (patch)
tree0b0c69be7070aa459698a33d429ad2e04ca46b43 /oox
parent0dbc0f95d2d0a8ded4ee98e7cd07f217537305c2 (diff)
tdf#90403 PPTX import: use real table size
PowerPoint ignores a:ext cx and cy value of p:xfrm, and uses real table width and height. PowerPoint 2010 saves files where cx and cy contains good values, but I found files in the wild whose cx and cy values did not match to actual table width and height, and there was a visible difference between rendering of Impress and PowerPoint. Reviewed-on: https://gerrit.libreoffice.org/15123 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com> (cherry picked from commit 037fe3671cbdad51f52d2f69f72f47f463dba7c2) Conflicts: oox/source/drawingml/shape.cxx sd/qa/unit/import-tests.cxx Change-Id: I3f80c0cea4cac46763d449f918bb78dca1a6562d Reviewed-on: https://gerrit.libreoffice.org/15133 Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/shape.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 265eea978097..4a56c9e518a0 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -416,6 +416,23 @@ Reference< XShape > Shape::createAndInsert(
bool bIsEmbMedia = false;
SAL_INFO("oox.drawingml", OSL_THIS_FUNC << " id: " << msId);
+ // tdf#90403 PowerPoint ignores a:ext cx and cy values of p:xfrm, and uses real table width and height
+ if ( mpTablePropertiesPtr.get() && rServiceName == "com.sun.star.drawing.TableShape" )
+ {
+ maSize.Width = 0;
+ for( std::vector< sal_Int32 >::const_iterator aTableColIter(mpTablePropertiesPtr->getTableGrid().begin());
+ aTableColIter != mpTablePropertiesPtr->getTableGrid().end(); aTableColIter++ )
+ {
+ maSize.Width += *aTableColIter;
+ }
+ maSize.Height = 0;
+ for( std::vector< ::oox::drawingml::table::TableRow >::const_iterator aTableRowIter(mpTablePropertiesPtr->getTableRows().begin());
+ aTableRowIter != mpTablePropertiesPtr->getTableRows().end(); aTableRowIter++ )
+ {
+ maSize.Height += (*aTableRowIter).getHeight();
+ }
+ }
+
awt::Rectangle aShapeRectHmm( maPosition.X / 360, maPosition.Y / 360, maSize.Width / 360, maSize.Height / 360 );
OUString aServiceName;