summaryrefslogtreecommitdiff
path: root/svx
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:58:18 +0000
commit95d9af25550174ad1436c16f9ec6aebad7f8425b (patch)
tree11857d518fe018069d57b4565ce10a4dc272398c /svx
parentc85107bc4ab93e2cdc9db1700577ec3f462d9fe9 (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/+/146322 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx')
-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 e4cec99e5e53..9d47bab76dd2 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -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)
{