summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-24 18:46:48 +0200
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2014-04-24 22:51:16 +0200
commita85317c67f870917231e82eb29fd5023e55b87de (patch)
treec6e9a9648ab43db9b5e0eea0a8e1fe150eb6f325 /vcl
parent0a1e297ac23ae79ce9d511b4fd6bd0d8276a2e25 (diff)
fdo#77089 if available, use ext. dimensions for non-placable WMF
Change-Id: Idcfaa127ed6abed40d6eec7f81fbbfb36658cc91
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/wmf/winwmf.cxx38
1 files changed, 28 insertions, 10 deletions
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index ba08ed539517..47f48c348020 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -26,7 +26,6 @@
#include <osl/endian.h>
#include <vcl/svapp.hxx>
#include <vcl/dibtools.hxx>
-#include <boost/scoped_array.hpp>
// MS Windows defines
@@ -1129,19 +1128,22 @@ bool WMFReader::ReadHeader()
else
{
nUnitsPerInch = 96;
- pWMF->Seek( nStrmPos + 18 ); // set the streampos to the start of the metaactions
- GetPlaceableBound( aPlaceableBound, pWMF );
- pWMF->Seek( nStrmPos );
- if ( pExternalHeader != NULL && ( pExternalHeader->mapMode == MM_ISOTROPIC
- || pExternalHeader->mapMode == MM_ANISOTROPIC ) )
+ if ( pExternalHeader != NULL && ( pExternalHeader->mapMode == MM_ISOTROPIC || pExternalHeader->mapMode == MM_ANISOTROPIC ) )
{
// #n417818#: If we have an external header then overwrite the bounds!
Rectangle aExtRect(0, 0,
- pExternalHeader->xExt*567*nUnitsPerInch/1440/1000,
- pExternalHeader->yExt*567*nUnitsPerInch/1440/1000);
- GetWinExtMax( aExtRect, aPlaceableBound, pExternalHeader->mapMode );
+ (double) pExternalHeader->xExt * 567 * nUnitsPerInch / 1440000,
+ (double) pExternalHeader->yExt * 567 * nUnitsPerInch / 1440000);
+ aPlaceableBound = aExtRect;
pOut->SetMapMode( pExternalHeader->mapMode );
}
+ else
+ {
+ pWMF->Seek( nStrmPos + 18 ); // set the streampos to the start of the metaactions
+ GetPlaceableBound( aPlaceableBound, pWMF );
+ }
+
+ pWMF->Seek( nStrmPos );
}
pOut->SetWinOrg( aPlaceableBound.TopLeft() );
@@ -1352,6 +1354,22 @@ bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pStm )
}
break;
+ case W_META_SETVIEWPORTORG:
+ {
+ Point aWinOrg;
+ aWinOrg = ReadYX();
+ rPlaceableBound.SetPos( aWinOrg );
+ }
+ break;
+
+ case W_META_SETVIEWPORTEXT:
+ {
+ sal_Int16 nWidth(0), nHeight(0);
+ pStm->ReadInt16( nHeight ).ReadInt16( nWidth );
+ rPlaceableBound.SetSize( Size( nWidth, nHeight ) );
+ }
+ break;
+
case W_META_SETMAPMODE :
pStm->ReadInt16( nMapMode );
break;
@@ -1409,7 +1427,7 @@ bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pStm )
SAL_WARN_IF(!bRecordOk, "vcl.filter", "polypolygon record has more polygons than we can handle");
- bRecordOk &= pStm->good();
+ bRecordOk = bRecordOk && pStm->good();
if (!bRecordOk)
{