fdo#78149: set the ViewPort even when painting to a MetaFile
ObjectContactOfPageView::DoProcessDisplay() has a special case for
painting to MetaFiles, and does not set the ViewPort from the passed-in
RedrawArea unless it's a printing or PDF export, with the result
that for a plain MetaFile all fly-frames in a Writer document
are painted, whether visible or not.
Since e2eda70f2746f08376d8cdf5e5360df217335aef now calls
GetPreviewMetaFile() after every document load, this issue is more
visible.
Since there is no obvious reason to ever ignore a passed RedrawArea,
simply always use it for the ViewPort, not just when printing.
Change-Id: I256710f1476181f567069b45a2a494b0d2064d6b
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index cefbd96..864e730 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -175,12 +175,14 @@ namespace sdr
// create ViewRange
if(isOutputToRecordingMetaFile())
{
if(isOutputToPDFFile() || isOutputToPrinter())
if (!rDisplayInfo.GetRedrawArea().IsEmpty())
{
// #i98402# if it's a PDF export, set the ClipRegion as ViewRange. This is
// mainly because SW does not use DrawingLayer Page-Oriented and if not doing this,
// all existing objects will be collected as primitives and processed.
// OD 2009-03-05 #i99876# perform the same also for SW on printing.
// fdo#78149 same thing also needed for plain MetaFile
// export, so why not do it always
const Rectangle aLogicClipRectangle(rDisplayInfo.GetRedrawArea().GetBoundRect());
aViewRange = basegfx::B2DRange(