summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-01-30 13:44:49 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-02-01 10:59:18 +0000
commit9828ab81ccb6ae03824ba61c35ebcdf12f53700a (patch)
tree8604ad096cb06e44309a924b86a37a3cbf59d960
parentfc16fb483ef505f1c4808c5eaadf851e550b49cb (diff)
tdf#152726 Pasting Selection to Sheet as BMP Image, button test is larger
regression from commit 720e4258ab5f00287098ff945a184bfb43911841 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> (cherry picked from commit 4fde49387eeecc35d1ead6305b1fe1e30e09cccc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146323 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--svx/source/sdr/contact/objectcontactofpageview.cxx36
1 files changed, 20 insertions, 16 deletions
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 983cea746035..31b8b949ea24 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -217,25 +217,12 @@ namespace sdr::contact
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
@@ -271,9 +258,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)
{