summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-06-26 09:02:31 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2015-06-27 01:08:20 +0000
commit6cef4a01e0ef59cd025cf3ee3e5d93eb0a89dda1 (patch)
tree8a742bd9b046bb4076a2e99a9cb020dacb83957b /writerfilter/source
parent1802e4c903a0597c9cb5c2ef752fe68486e197b1 (diff)
tdf#89890 DOCX import: fix too large num pic bullet
Reading SwWW8ImplReader::CoreLoad()'s "update graphic bullet information" block, it turns out that the numbering picture bullet's height should be independent from the supplied bitmap, and only its aspect ratio should be respected. (cherry picked from commit eab89b7f024a8c86decdcb3362c40c40a7df37df) Change-Id: I1300aa0397a8098df2a3170af795fbba47fd2a9e Reviewed-on: https://gerrit.libreoffice.org/16502 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'writerfilter/source')
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 481dbdf317ea..b19b8618b2f7 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -887,6 +887,20 @@ void ListsManager::lcl_sprm( Sprm& rSprm )
case NS_ooxml::LN_CT_NumPicBullet_pict:
{
uno::Reference<drawing::XShape> xShape = m_rDMapper.PopPendingShape();
+
+ // Respect only the aspect ratio of the picture, not its size.
+ awt::Size aPrefSize = xShape->getSize();
+ // See SwDefBulletConfig::InitFont(), default height is 14.
+ const int nFontHeight = 14;
+ // Point -> mm100.
+ const int nHeight = nFontHeight * 35;
+ if (aPrefSize.Height * aPrefSize.Width != 0)
+ {
+ int nWidth = (nHeight * aPrefSize.Width) / aPrefSize.Height;
+ awt::Size aSize(nWidth, nHeight);
+ xShape->setSize(aSize);
+ }
+
m_pCurrentNumPicBullet->SetShape(xShape);
}
break;