tdf#152726 Pasting Selection to Sheet as BMP Image, button test is larger

regression from

    commit 720e4258ab
    Author: Noel Grandin <noel@peralex.com>
    Date:   Fri Aug 20 11:30:35 2021 +0200
use Primitive2DDecompositionVisitor in ViewObjectContact
(tdf#105575)

Revert the relevant piece, no idea what the underlying problem is. I
suspect something is being tricksy and using settings from the current
OutputDevice even though the point of the drawinglayer
getPrimitive2DSequenceHierarchy is supposedly to be independant of that.

Change-Id: I3026ff2ba5ce3751a4e4ebdf15954aae548493c6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146352
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2023-01-30 13:44:49 +02:00
parent 41043667d7
commit 4fde49387e

View File

@@ -216,25 +216,12 @@ namespace sdr::contact
aNewViewInformation2D.setViewTime(fCurrentTime);
updateViewInformation2D(aNewViewInformation2D);
// if there is something to show, use a primitive processor to render it. There
// is a choice between VCL and Canvas processors currently. The decision is made in
// createProcessor2DFromOutputDevice and takes into account things like the
// Target is a MetaFile, a VDev or something else. The Canvas renderer is triggered
// currently using the shown boolean. Canvas is not yet the default.
// prepare OutputDevice (historical stuff, maybe soon removed)
rDisplayInfo.ClearGhostedDrawMode(); // reset, else the VCL-paint with the processor will not do the right thing
pOutDev->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default); // reset, default is no BiDi/RTL
// create renderer
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
drawinglayer::processor2d::createProcessor2DFromOutputDevice(
rTargetOutDev, getViewInformation2D()));
drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence;
#if HAVE_FEATURE_DESKTOP || defined( ANDROID )
// get whole Primitive2DContainer; this will already make use of updated ViewInformation2D
// and may use the MapMode from the Target OutDev in the DisplayInfo
rDrawPageVOContact.getPrimitive2DSequenceHierarchy(rDisplayInfo, *pProcessor2D);
rDrawPageVOContact.getPrimitive2DSequenceHierarchy(rDisplayInfo, xPrimitiveSequence);
#else
// Hmm, !HAVE_FEATURE_DESKTOP && !ANDROID means iOS,
// right? But does it makes sense to use a different code
@@ -270,9 +257,26 @@ namespace sdr::contact
if (bGetHierarchy)
// get whole Primitive2DContainer; this will already make use of updated ViewInformation2D
// and may use the MapMode from the Target OutDev in the DisplayInfo
rDrawPageVOContact.getPrimitive2DSequenceHierarchy(rDisplayInfo, *pProcessor2D);
rDrawPageVOContact.getPrimitive2DSequenceHierarchy(rDisplayInfo, xPrimitiveSequence);
#endif
// if there is something to show, use a primitive processor to render it. There
// is a choice between VCL and Canvas processors currently. The decision is made in
// createProcessor2DFromOutputDevice and takes into account things like the
// Target is a MetaFile, a VDev or something else. The Canvas renderer is triggered
// currently using the shown boolean. Canvas is not yet the default.
if(!xPrimitiveSequence.empty())
{
// prepare OutputDevice (historical stuff, maybe soon removed)
rDisplayInfo.ClearGhostedDrawMode(); // reset, else the VCL-paint with the processor will not do the right thing
pOutDev->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default); // reset, default is no BiDi/RTL
// create renderer
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor2D(
drawinglayer::processor2d::createProcessor2DFromOutputDevice(
rTargetOutDev, getViewInformation2D()));
pProcessor2D->process(xPrimitiveSequence);
}
// #114359# restore old ClipReghion
if(bClipRegionPushed)
{