Kaydet (Commit) a85317c6 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

fdo#77089 if available, use ext. dimensions for non-placable WMF

Change-Id: Idcfaa127ed6abed40d6eec7f81fbbfb36658cc91
üst 0a1e297a
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#include <osl/endian.h> #include <osl/endian.h>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/dibtools.hxx> #include <vcl/dibtools.hxx>
#include <boost/scoped_array.hpp>
// MS Windows defines // MS Windows defines
...@@ -1129,19 +1128,22 @@ bool WMFReader::ReadHeader() ...@@ -1129,19 +1128,22 @@ bool WMFReader::ReadHeader()
else else
{ {
nUnitsPerInch = 96; nUnitsPerInch = 96;
pWMF->Seek( nStrmPos + 18 ); // set the streampos to the start of the metaactions if ( pExternalHeader != NULL && ( pExternalHeader->mapMode == MM_ISOTROPIC || pExternalHeader->mapMode == MM_ANISOTROPIC ) )
GetPlaceableBound( aPlaceableBound, pWMF );
pWMF->Seek( nStrmPos );
if ( pExternalHeader != NULL && ( pExternalHeader->mapMode == MM_ISOTROPIC
|| pExternalHeader->mapMode == MM_ANISOTROPIC ) )
{ {
// #n417818#: If we have an external header then overwrite the bounds! // #n417818#: If we have an external header then overwrite the bounds!
Rectangle aExtRect(0, 0, Rectangle aExtRect(0, 0,
pExternalHeader->xExt*567*nUnitsPerInch/1440/1000, (double) pExternalHeader->xExt * 567 * nUnitsPerInch / 1440000,
pExternalHeader->yExt*567*nUnitsPerInch/1440/1000); (double) pExternalHeader->yExt * 567 * nUnitsPerInch / 1440000);
GetWinExtMax( aExtRect, aPlaceableBound, pExternalHeader->mapMode ); aPlaceableBound = aExtRect;
pOut->SetMapMode( pExternalHeader->mapMode ); 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() ); pOut->SetWinOrg( aPlaceableBound.TopLeft() );
...@@ -1352,6 +1354,22 @@ bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pStm ) ...@@ -1352,6 +1354,22 @@ bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pStm )
} }
break; 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 : case W_META_SETMAPMODE :
pStm->ReadInt16( nMapMode ); pStm->ReadInt16( nMapMode );
break; break;
...@@ -1409,7 +1427,7 @@ bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pStm ) ...@@ -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"); SAL_WARN_IF(!bRecordOk, "vcl.filter", "polypolygon record has more polygons than we can handle");
bRecordOk &= pStm->good(); bRecordOk = bRecordOk && pStm->good();
if (!bRecordOk) if (!bRecordOk)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment