svx/source/sdr/contact/objectcontactofpageview.cxx |   36 +++++++++++----------
 1 file changed, 20 insertions(+), 16 deletions(-)

New commits:
commit 4fde49387eeecc35d1ead6305b1fe1e30e09cccc
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Jan 30 13:44:49 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Jan 30 13:26:10 2023 +0000

    tdf#152726 Pasting Selection to Sheet as BMP Image, button test is larger
    
    regression from
    
        commit 720e4258ab5f00287098ff945a184bfb43911841
        Author: Noel Grandin <n...@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.gran...@collabora.co.uk>

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)
             {

Reply via email to