summaryrefslogtreecommitdiff
path: root/emfio
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-14 15:48:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-14 20:39:00 +0200
commit1c3929a0a1645e802ee18f9c3d3d380375500c72 (patch)
tree842d6867a8c67837b15d2ff666e1ad1dd694b401 /emfio
parent9693b491295336955f7ce8359284b67a82ecf28f (diff)
loplugin:flatten in embeddedobj,emfio
Change-Id: Ibaf5e1a4db1088322cf8c5e127d328b140406197 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92196 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'emfio')
-rw-r--r--emfio/source/reader/emfreader.cxx32
-rw-r--r--emfio/source/reader/mtftools.cxx422
-rw-r--r--emfio/source/reader/wmfreader.cxx64
3 files changed, 259 insertions, 259 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index e29ec1b39132..35a5f020d0fa 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -624,26 +624,26 @@ namespace emfio
return;
// taking the amount of points of each polygon, retrieving the total number of points
- if ( mpInputStream->good() &&
+ if ( !(mpInputStream->good() &&
( nNumberOfPolylines < SAL_MAX_UINT32 / sizeof( sal_uInt16 ) ) &&
- ( nNumberOfPolylines * sizeof( sal_uInt16 ) ) <= ( nEndPos - mpInputStream->Tell() )
+ ( nNumberOfPolylines * sizeof( sal_uInt16 ) ) <= ( nEndPos - mpInputStream->Tell() ))
)
+ return;
+
+ std::unique_ptr< sal_uInt32[] > pnPolylinePointCount( new sal_uInt32[ nNumberOfPolylines ] );
+ for ( sal_uInt32 i = 0; i < nNumberOfPolylines && mpInputStream->good(); i++ )
{
- std::unique_ptr< sal_uInt32[] > pnPolylinePointCount( new sal_uInt32[ nNumberOfPolylines ] );
- for ( sal_uInt32 i = 0; i < nNumberOfPolylines && mpInputStream->good(); i++ )
- {
- sal_uInt32 nPoints;
- mpInputStream->ReadUInt32( nPoints );
- SAL_INFO("emfio", "\t\t\tPoint " << i << " of " << nNumberOfPolylines << ": " << nPoints);
- pnPolylinePointCount[ i ] = nPoints;
- }
+ sal_uInt32 nPoints;
+ mpInputStream->ReadUInt32( nPoints );
+ SAL_INFO("emfio", "\t\t\tPoint " << i << " of " << nNumberOfPolylines << ": " << nPoints);
+ pnPolylinePointCount[ i ] = nPoints;
+ }
- // Get polyline points:
- for ( sal_uInt32 i = 0; ( i < nNumberOfPolylines ) && mpInputStream->good(); i++ )
- {
- tools::Polygon aPolygon = ReadPolygon<T>(0, pnPolylinePointCount[i], nNextPos);
- DrawPolyLine(aPolygon, false, mbRecordPath);
- }
+ // Get polyline points:
+ for ( sal_uInt32 i = 0; ( i < nNumberOfPolylines ) && mpInputStream->good(); i++ )
+ {
+ tools::Polygon aPolygon = ReadPolygon<T>(0, pnPolylinePointCount[i], nNextPos);
+ DrawPolyLine(aPolygon, false, mbRecordPath);
}
}
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index 15ede2bf6d40..cc2fddcf4796 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -675,31 +675,31 @@ namespace emfio
void MtfTools::ImplDrawClippedPolyPolygon( const tools::PolyPolygon& rPolyPoly )
{
- if ( rPolyPoly.Count() )
+ if ( !rPolyPoly.Count() )
+ return;
+
+ ImplSetNonPersistentLineColorTransparenz();
+ if ( rPolyPoly.Count() == 1 )
{
- ImplSetNonPersistentLineColorTransparenz();
- if ( rPolyPoly.Count() == 1 )
+ if ( rPolyPoly.IsRect() )
+ mpGDIMetaFile->AddAction( new MetaRectAction( rPolyPoly.GetBoundRect() ) );
+ else
{
- if ( rPolyPoly.IsRect() )
- mpGDIMetaFile->AddAction( new MetaRectAction( rPolyPoly.GetBoundRect() ) );
- else
+ tools::Polygon aPoly( rPolyPoly[ 0 ] );
+ sal_uInt16 nCount = aPoly.GetSize();
+ if ( nCount )
{
- tools::Polygon aPoly( rPolyPoly[ 0 ] );
- sal_uInt16 nCount = aPoly.GetSize();
- if ( nCount )
+ if ( aPoly[ nCount - 1 ] != aPoly[ 0 ] )
{
- if ( aPoly[ nCount - 1 ] != aPoly[ 0 ] )
- {
- Point aPoint( aPoly[ 0 ] );
- aPoly.Insert( nCount, aPoint );
- }
- mpGDIMetaFile->AddAction( new MetaPolygonAction( aPoly ) );
+ Point aPoint( aPoly[ 0 ] );
+ aPoly.Insert( nCount, aPoint );
}
+ mpGDIMetaFile->AddAction( new MetaPolygonAction( aPoly ) );
}
}
- else
- mpGDIMetaFile->AddAction( new MetaPolyPolygonAction( rPolyPoly ) );
}
+ else
+ mpGDIMetaFile->AddAction( new MetaPolyPolygonAction( rPolyPoly ) );
}
void MtfTools::CreateObject( std::unique_ptr<GDIObj> pObject )
@@ -736,39 +736,39 @@ namespace emfio
void MtfTools::CreateObjectIndexed( sal_Int32 nIndex, std::unique_ptr<GDIObj> pObject )
{
- if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
+ if ( ( nIndex & ENHMETA_STOCK_OBJECT ) != 0 )
+ return;
+
+ nIndex &= 0xffff; // safety check: do not allow index to be > 65535
+ if ( pObject )
{
- nIndex &= 0xffff; // safety check: do not allow index to be > 65535
- if ( pObject )
+ const auto pLineStyle = dynamic_cast<WinMtfLineStyle*>(pObject.get());
+ const auto pFontStyle = dynamic_cast<WinMtfFontStyle*>(pObject.get());
+ if ( pFontStyle )
{
- const auto pLineStyle = dynamic_cast<WinMtfLineStyle*>(pObject.get());
- const auto pFontStyle = dynamic_cast<WinMtfFontStyle*>(pObject.get());
- if ( pFontStyle )
- {
- if (pFontStyle->aFont.GetFontHeight() == 0)
- pFontStyle->aFont.SetFontHeight(423);
- ImplMap(pFontStyle->aFont);
- }
- else if ( pLineStyle )
- {
- Size aSize(pLineStyle->aLineInfo.GetWidth(), 0);
- pLineStyle->aLineInfo.SetWidth( ImplMap(aSize).Width() );
+ if (pFontStyle->aFont.GetFontHeight() == 0)
+ pFontStyle->aFont.SetFontHeight(423);
+ ImplMap(pFontStyle->aFont);
+ }
+ else if ( pLineStyle )
+ {
+ Size aSize(pLineStyle->aLineInfo.GetWidth(), 0);
+ pLineStyle->aLineInfo.SetWidth( ImplMap(aSize).Width() );
- if ( pLineStyle->aLineInfo.GetStyle() == LineStyle::Dash )
- {
- aSize.AdjustWidth(1 );
- long nDotLen = ImplMap( aSize ).Width();
- pLineStyle->aLineInfo.SetDistance( nDotLen );
- pLineStyle->aLineInfo.SetDotLen( nDotLen );
- pLineStyle->aLineInfo.SetDashLen( nDotLen * 3 );
- }
+ if ( pLineStyle->aLineInfo.GetStyle() == LineStyle::Dash )
+ {
+ aSize.AdjustWidth(1 );
+ long nDotLen = ImplMap( aSize ).Width();
+ pLineStyle->aLineInfo.SetDistance( nDotLen );
+ pLineStyle->aLineInfo.SetDotLen( nDotLen );
+ pLineStyle->aLineInfo.SetDashLen( nDotLen * 3 );
}
}
- if ( o3tl::make_unsigned(nIndex) >= mvGDIObj.size() )
- ImplResizeObjectArry( nIndex + 16 );
-
- mvGDIObj[ nIndex ] = std::move(pObject);
}
+ if ( o3tl::make_unsigned(nIndex) >= mvGDIObj.size() )
+ ImplResizeObjectArry( nIndex + 16 );
+
+ mvGDIObj[ nIndex ] = std::move(pObject);
}
void MtfTools::CreateObject()
@@ -933,54 +933,54 @@ namespace emfio
void MtfTools::UpdateClipRegion()
{
- if (mbClipNeedsUpdate)
- {
- mbClipNeedsUpdate = false;
- mbComplexClip = false;
+ if (!mbClipNeedsUpdate)
+ return;
- mpGDIMetaFile->AddAction( new MetaPopAction() ); // taking the original clipregion
- mpGDIMetaFile->AddAction( new MetaPushAction( PushFlags::CLIPREGION ) );
+ mbClipNeedsUpdate = false;
+ mbComplexClip = false;
- // skip for 'no clipping at all' case
- if( !maClipPath.isEmpty() )
- {
- const basegfx::B2DPolyPolygon& rClipPoly( maClipPath.getClipPath() );
+ mpGDIMetaFile->AddAction( new MetaPopAction() ); // taking the original clipregion
+ mpGDIMetaFile->AddAction( new MetaPushAction( PushFlags::CLIPREGION ) );
- mbComplexClip = rClipPoly.count() > 1
- || !basegfx::utils::isRectangle(rClipPoly);
+ // skip for 'no clipping at all' case
+ if( maClipPath.isEmpty() )
+ return;
- static bool bEnableComplexClipViaRegion = getenv("SAL_WMF_COMPLEXCLIP_VIA_REGION") != nullptr;
+ const basegfx::B2DPolyPolygon& rClipPoly( maClipPath.getClipPath() );
- if (bEnableComplexClipViaRegion)
- {
- //this makes cases like tdf#45820 work in reasonable time, and I feel in theory should
- //be just fine. In practice I see the output is different so needs work before its the
- //default, but for file fuzzing it should be good enough
- if (mbComplexClip)
- {
- mpGDIMetaFile->AddAction(
- new MetaISectRegionClipRegionAction(
- vcl::Region(rClipPoly)));
- mbComplexClip = false;
- }
- else
- {
- mpGDIMetaFile->AddAction(
- new MetaISectRectClipRegionAction(
- vcl::unotools::rectangleFromB2DRectangle(
- rClipPoly.getB2DRange())));
- }
- }
- else
- {
- //normal case
- mpGDIMetaFile->AddAction(
- new MetaISectRectClipRegionAction(
- vcl::unotools::rectangleFromB2DRectangle(
- rClipPoly.getB2DRange())));
- }
+ mbComplexClip = rClipPoly.count() > 1
+ || !basegfx::utils::isRectangle(rClipPoly);
+
+ static bool bEnableComplexClipViaRegion = getenv("SAL_WMF_COMPLEXCLIP_VIA_REGION") != nullptr;
+
+ if (bEnableComplexClipViaRegion)
+ {
+ //this makes cases like tdf#45820 work in reasonable time, and I feel in theory should
+ //be just fine. In practice I see the output is different so needs work before its the
+ //default, but for file fuzzing it should be good enough
+ if (mbComplexClip)
+ {
+ mpGDIMetaFile->AddAction(
+ new MetaISectRegionClipRegionAction(
+ vcl::Region(rClipPoly)));
+ mbComplexClip = false;
+ }
+ else
+ {
+ mpGDIMetaFile->AddAction(
+ new MetaISectRectClipRegionAction(
+ vcl::unotools::rectangleFromB2DRectangle(
+ rClipPoly.getB2DRange())));
}
}
+ else
+ {
+ //normal case
+ mpGDIMetaFile->AddAction(
+ new MetaISectRectClipRegionAction(
+ vcl::unotools::rectangleFromB2DRectangle(
+ rClipPoly.getB2DRange())));
+ }
}
void MtfTools::ImplSetNonPersistentLineColorTransparenz()
@@ -1063,34 +1063,34 @@ namespace emfio
void MtfTools::StrokeAndFillPath( bool bStroke, bool bFill )
{
- if ( maPathObj.Count() )
+ if ( !maPathObj.Count() )
+ return;
+
+ UpdateClipRegion();
+ UpdateLineStyle();
+ UpdateFillStyle();
+ if ( bFill )
{
- UpdateClipRegion();
- UpdateLineStyle();
- UpdateFillStyle();
- if ( bFill )
+ if ( !bStroke )
{
- if ( !bStroke )
- {
- mpGDIMetaFile->AddAction( new MetaPushAction( PushFlags::LINECOLOR ) );
- mpGDIMetaFile->AddAction( new MetaLineColorAction( Color(), false ) );
- }
- if ( maPathObj.Count() == 1 )
- mpGDIMetaFile->AddAction( new MetaPolygonAction( maPathObj.GetObject( 0 ) ) );
- else
- mpGDIMetaFile->AddAction( new MetaPolyPolygonAction( maPathObj ) );
-
- if ( !bStroke )
- mpGDIMetaFile->AddAction( new MetaPopAction() );
+ mpGDIMetaFile->AddAction( new MetaPushAction( PushFlags::LINECOLOR ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( Color(), false ) );
}
+ if ( maPathObj.Count() == 1 )
+ mpGDIMetaFile->AddAction( new MetaPolygonAction( maPathObj.GetObject( 0 ) ) );
else
- {
- sal_uInt16 i, nCount = maPathObj.Count();
- for ( i = 0; i < nCount; i++ )
- mpGDIMetaFile->AddAction( new MetaPolyLineAction( maPathObj[ i ], maLineStyle.aLineInfo ) );
- }
- ClearPath();
+ mpGDIMetaFile->AddAction( new MetaPolyPolygonAction( maPathObj ) );
+
+ if ( !bStroke )
+ mpGDIMetaFile->AddAction( new MetaPopAction() );
}
+ else
+ {
+ sal_uInt16 i, nCount = maPathObj.Count();
+ for ( i = 0; i < nCount; i++ )
+ mpGDIMetaFile->AddAction( new MetaPolyLineAction( maPathObj[ i ], maLineStyle.aLineInfo ) );
+ }
+ ClearPath();
}
void MtfTools::DrawPixel( const Point& rSource, const Color& rColor )
@@ -1380,51 +1380,51 @@ namespace emfio
UpdateClipRegion();
sal_uInt16 nPoints = rPolygon.GetSize();
- if (nPoints >= 1)
+ if (nPoints < 1)
+ return;
+
+ ImplMap( rPolygon );
+ if ( bTo )
{
- ImplMap( rPolygon );
- if ( bTo )
- {
- rPolygon[ 0 ] = maActPos;
- maActPos = rPolygon[ rPolygon.GetSize() - 1 ];
- }
- if ( bRecordPath )
- maPathObj.AddPolyLine( rPolygon );
- else
- {
- UpdateLineStyle();
- mpGDIMetaFile->AddAction( new MetaPolyLineAction( rPolygon, maLineStyle.aLineInfo ) );
- }
+ rPolygon[ 0 ] = maActPos;
+ maActPos = rPolygon[ rPolygon.GetSize() - 1 ];
+ }
+ if ( bRecordPath )
+ maPathObj.AddPolyLine( rPolygon );
+ else
+ {
+ UpdateLineStyle();
+ mpGDIMetaFile->AddAction( new MetaPolyLineAction( rPolygon, maLineStyle.aLineInfo ) );
}
}
void MtfTools::DrawPolyBezier( tools::Polygon rPolygon, bool bTo, bool bRecordPath )
{
sal_uInt16 nPoints = rPolygon.GetSize();
- if ( ( nPoints >= 4 ) && ( ( ( nPoints - 4 ) % 3 ) == 0 ) )
- {
- UpdateClipRegion();
+ if ( !(( nPoints >= 4 ) && ( ( ( nPoints - 4 ) % 3 ) == 0 )) )
+ return;
- ImplMap( rPolygon );
- if ( bTo )
- {
- rPolygon[ 0 ] = maActPos;
- maActPos = rPolygon[ nPoints - 1 ];
- }
- sal_uInt16 i;
- for ( i = 0; ( i + 2 ) < nPoints; )
- {
- rPolygon.SetFlags( i++, PolyFlags::Normal );
- rPolygon.SetFlags( i++, PolyFlags::Control );
- rPolygon.SetFlags( i++, PolyFlags::Control );
- }
- if ( bRecordPath )
- maPathObj.AddPolyLine( rPolygon );
- else
- {
- UpdateLineStyle();
- mpGDIMetaFile->AddAction( new MetaPolyLineAction( rPolygon, maLineStyle.aLineInfo ) );
- }
+ UpdateClipRegion();
+
+ ImplMap( rPolygon );
+ if ( bTo )
+ {
+ rPolygon[ 0 ] = maActPos;
+ maActPos = rPolygon[ nPoints - 1 ];
+ }
+ sal_uInt16 i;
+ for ( i = 0; ( i + 2 ) < nPoints; )
+ {
+ rPolygon.SetFlags( i++, PolyFlags::Normal );
+ rPolygon.SetFlags( i++, PolyFlags::Control );
+ rPolygon.SetFlags( i++, PolyFlags::Control );
+ }
+ if ( bRecordPath )
+ maPathObj.AddPolyLine( rPolygon );
+ else
+ {
+ UpdateLineStyle();
+ mpGDIMetaFile->AddAction( new MetaPolyLineAction( rPolygon, maLineStyle.aLineInfo ) );
}
}
@@ -1892,22 +1892,22 @@ namespace emfio
void MtfTools::SetDevExt( const Size& rSize ,bool regular)
{
- if ( rSize.Width() && rSize.Height() )
+ if ( !(rSize.Width() && rSize.Height()) )
+ return;
+
+ switch( mnMapMode )
{
- switch( mnMapMode )
+ case MM_ISOTROPIC :
+ case MM_ANISOTROPIC :
{
- case MM_ISOTROPIC :
- case MM_ANISOTROPIC :
- {
- mnDevWidth = rSize.Width();
- mnDevHeight = rSize.Height();
- }
- }
- if (regular)
- {
- mbIsMapDevSet=true;
+ mnDevWidth = rSize.Width();
+ mnDevHeight = rSize.Height();
}
}
+ if (regular)
+ {
+ mbIsMapDevSet=true;
+ }
}
void MtfTools::ScaleDevExt(double fX, double fY)
@@ -1950,21 +1950,21 @@ namespace emfio
void MtfTools::SetWinExt(const Size& rSize, bool bIsEMF)
{
- if (rSize.Width() && rSize.Height())
+ if (!(rSize.Width() && rSize.Height()))
+ return;
+
+ switch( mnMapMode )
{
- switch( mnMapMode )
+ case MM_ISOTROPIC :
+ case MM_ANISOTROPIC :
{
- case MM_ISOTROPIC :
- case MM_ANISOTROPIC :
+ mnWinExtX = rSize.Width();
+ mnWinExtY = rSize.Height();
+ if (bIsEMF)
{
- mnWinExtX = rSize.Width();
- mnWinExtY = rSize.Height();
- if (bIsEMF)
- {
- SetDevByWin();
- }
- mbIsMapWinSet = true;
+ SetDevByWin();
}
+ mbIsMapWinSet = true;
}
}
}
@@ -2146,50 +2146,50 @@ namespace emfio
void MtfTools::Pop()
{
// Get the latest data from the stack
- if( !mvSaveStack.empty() )
- {
- // Backup the current data on the stack
- std::shared_ptr<SaveStruct>& pSave( mvSaveStack.back() );
-
- maLineStyle = pSave->aLineStyle;
- maFillStyle = pSave->aFillStyle;
-
- maFont = pSave->aFont;
- maTextColor = pSave->aTextColor;
- mnTextAlign = pSave->nTextAlign;
- mnTextLayoutMode = pSave->nTextLayoutMode;
- mnBkMode = pSave->nBkMode;
- mnGfxMode = pSave->nGfxMode;
- mnMapMode = pSave->nMapMode;
- maBkColor = pSave->aBkColor;
- mbFillStyleSelected = pSave->bFillStyleSelected;
-
- maActPos = pSave->aActPos;
- maXForm = pSave->aXForm;
- meRasterOp = pSave->eRasterOp;
-
- mnWinOrgX = pSave->nWinOrgX;
- mnWinOrgY = pSave->nWinOrgY;
- mnWinExtX = pSave->nWinExtX;
- mnWinExtY = pSave->nWinExtY;
- mnDevOrgX = pSave->nDevOrgX;
- mnDevOrgY = pSave->nDevOrgY;
- mnDevWidth = pSave->nDevWidth;
- mnDevHeight = pSave->nDevHeight;
-
- maPathObj = pSave->maPathObj;
- if ( ! ( maClipPath == pSave->maClipPath ) )
- {
- maClipPath = pSave->maClipPath;
- mbClipNeedsUpdate = true;
- }
- if ( meLatestRasterOp != meRasterOp )
- {
- mpGDIMetaFile->AddAction( new MetaRasterOpAction( meRasterOp ) );
- meLatestRasterOp = meRasterOp;
- }
- mvSaveStack.pop_back();
+ if( mvSaveStack.empty() )
+ return;
+
+ // Backup the current data on the stack
+ std::shared_ptr<SaveStruct>& pSave( mvSaveStack.back() );
+
+ maLineStyle = pSave->aLineStyle;
+ maFillStyle = pSave->aFillStyle;
+
+ maFont = pSave->aFont;
+ maTextColor = pSave->aTextColor;
+ mnTextAlign = pSave->nTextAlign;
+ mnTextLayoutMode = pSave->nTextLayoutMode;
+ mnBkMode = pSave->nBkMode;
+ mnGfxMode = pSave->nGfxMode;
+ mnMapMode = pSave->nMapMode;
+ maBkColor = pSave->aBkColor;
+ mbFillStyleSelected = pSave->bFillStyleSelected;
+
+ maActPos = pSave->aActPos;
+ maXForm = pSave->aXForm;
+ meRasterOp = pSave->eRasterOp;
+
+ mnWinOrgX = pSave->nWinOrgX;
+ mnWinOrgY = pSave->nWinOrgY;
+ mnWinExtX = pSave->nWinExtX;
+ mnWinExtY = pSave->nWinExtY;
+ mnDevOrgX = pSave->nDevOrgX;
+ mnDevOrgY = pSave->nDevOrgY;
+ mnDevWidth = pSave->nDevWidth;
+ mnDevHeight = pSave->nDevHeight;
+
+ maPathObj = pSave->maPathObj;
+ if ( ! ( maClipPath == pSave->maClipPath ) )
+ {
+ maClipPath = pSave->maClipPath;
+ mbClipNeedsUpdate = true;
+ }
+ if ( meLatestRasterOp != meRasterOp )
+ {
+ mpGDIMetaFile->AddAction( new MetaRasterOpAction( meRasterOp ) );
+ meLatestRasterOp = meRasterOp;
}
+ mvSaveStack.pop_back();
}
void MtfTools::AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile )
diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx
index e09061185541..1d67f5c52e98 100644
--- a/emfio/source/reader/wmfreader.cxx
+++ b/emfio/source/reader/wmfreader.cxx
@@ -1813,39 +1813,39 @@ namespace emfio
bRet = false;
}
- if (bRet)
+ if (!bRet)
+ return;
+
+ if (aWinExt)
{
- if (aWinExt)
- {
- rPlaceableBound = tools::Rectangle(aWinOrg, *aWinExt);
- SAL_INFO("vcl.wmf", "Window dimension "
- " t: " << rPlaceableBound.Left() << " l: " << rPlaceableBound.Top()
- << " b: " << rPlaceableBound.Right() << " r: " << rPlaceableBound.Bottom());
- }
- else if (aViewportExt)
- {
- rPlaceableBound = tools::Rectangle(aViewportOrg, *aViewportExt);
- SAL_INFO("vcl.wmf", "Viewport dimension "
- " t: " << rPlaceableBound.Left() << " l: " << rPlaceableBound.Top()
- << " b: " << rPlaceableBound.Right() << " r: " << rPlaceableBound.Bottom());
- }
- else if (bBoundsDetermined)
- {
- rPlaceableBound = aBound;
- SAL_INFO("vcl.wmf", "Determined dimension "
- " t: " << rPlaceableBound.Left() << " l: " << rPlaceableBound.Top()
- << " b: " << rPlaceableBound.Right() << " r: " << rPlaceableBound.Bottom());
- }
- else
- {
- rPlaceableBound.SetLeft( 0 );
- rPlaceableBound.SetTop( 0 );
- rPlaceableBound.SetRight( aMaxWidth );
- rPlaceableBound.SetBottom( aMaxWidth );
- SAL_INFO("vcl.wmf", "Default dimension "
- " t: " << rPlaceableBound.Left() << " l: " << rPlaceableBound.Top()
- << " b: " << rPlaceableBound.Right() << " r: " << rPlaceableBound.Bottom());
- }
+ rPlaceableBound = tools::Rectangle(aWinOrg, *aWinExt);
+ SAL_INFO("vcl.wmf", "Window dimension "
+ " t: " << rPlaceableBound.Left() << " l: " << rPlaceableBound.Top()
+ << " b: " << rPlaceableBound.Right() << " r: " << rPlaceableBound.Bottom());
+ }
+ else if (aViewportExt)
+ {
+ rPlaceableBound = tools::Rectangle(aViewportOrg, *aViewportExt);
+ SAL_INFO("vcl.wmf", "Viewport dimension "
+ " t: " << rPlaceableBound.Left() << " l: " << rPlaceableBound.Top()
+ << " b: " << rPlaceableBound.Right() << " r: " << rPlaceableBound.Bottom());
+ }
+ else if (bBoundsDetermined)
+ {
+ rPlaceableBound = aBound;
+ SAL_INFO("vcl.wmf", "Determined dimension "
+ " t: " << rPlaceableBound.Left() << " l: " << rPlaceableBound.Top()
+ << " b: " << rPlaceableBound.Right() << " r: " << rPlaceableBound.Bottom());
+ }
+ else
+ {
+ rPlaceableBound.SetLeft( 0 );
+ rPlaceableBound.SetTop( 0 );
+ rPlaceableBound.SetRight( aMaxWidth );
+ rPlaceableBound.SetBottom( aMaxWidth );
+ SAL_INFO("vcl.wmf", "Default dimension "
+ " t: " << rPlaceableBound.Left() << " l: " << rPlaceableBound.Top()
+ << " b: " << rPlaceableBound.Right() << " r: " << rPlaceableBound.Bottom());
}
}