summaryrefslogtreecommitdiff
path: root/vcl/source/filter/wmf
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-05-15 13:52:21 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-07-19 21:10:29 +0200
commit14e326516512e3999ca3f7217e5b2a0f1730ca35 (patch)
treee5fef6e447298516ab13a720b4aad3b33bb82d3c /vcl/source/filter/wmf
parent56f24911ce90f1ad9f56c72d9c87840ea94eb590 (diff)
fdo#78603 mixup (Left->Top) in Rectangle construction
Conflicts: vcl/source/filter/wmf/winwmf.cxx Change-Id: I7fa566e036508d43b153c7983dc89fc6660718e7
Diffstat (limited to 'vcl/source/filter/wmf')
-rw-r--r--vcl/source/filter/wmf/winwmf.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index e02606e20b8c..6438b8f9ce9e 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -1152,6 +1152,21 @@ sal_Bool WMFReader::ReadHeader()
{
pWMF->Seek( nStrmPos + 18 ); // set the streampos to the start of the metaactions
GetPlaceableBound( aPlaceableBound, pWMF );
+
+ // The image size is not known so normalize the calculated bounds so that the
+ // resulting image is not too big
+ const long aMaxWidth = 1024;
+ const double fMaxWidth = static_cast<double>(aMaxWidth);
+ if (aPlaceableBound.GetWidth() > aMaxWidth)
+ {
+ double fRatio = aPlaceableBound.GetWidth() / fMaxWidth;
+
+ aPlaceableBound = Rectangle(
+ aPlaceableBound.Left() / fRatio,
+ aPlaceableBound.Top() / fRatio,
+ aPlaceableBound.Right() / fRatio,
+ aPlaceableBound.Bottom() / fRatio);
+ }
}
pWMF->Seek( nStrmPos );