include/svx/fmview.hxx             |    3 -
 include/svx/svdpntv.hxx            |    9 +----
 svx/source/form/fmview.cxx         |    5 +--
 svx/source/svdraw/svdpntv.cxx      |   16 +++-------
 sw/source/core/inc/viewimp.hxx     |   19 -----------
 sw/source/core/layout/paintfrm.cxx |   59 ++++++++++++++++++++++++++-----------
 sw/source/core/view/viewimp.cxx    |   24 ---------------
 sw/source/core/view/viewsh.cxx     |    3 -
 8 files changed, 56 insertions(+), 82 deletions(-)

New commits:
commit e5bc823ad47872cda353ae5965dc8a6e793128a7
Author:     Thorsten Behrens <[email protected]>
AuthorDate: Tue Dec 10 17:15:53 2024 +0100
Commit:     Thorsten Behrens <[email protected]>
CommitDate: Tue Dec 10 17:15:53 2024 +0100

    Revert "tdf#161341 show/hide controls/shapes/pictures in view/print"
    
    This reverts commit f367783ed89739cfbd6d55103638e40134f429e2.

diff --git a/include/svx/fmview.hxx b/include/svx/fmview.hxx
index 0dfc5628b810..e601047eff00 100644
--- a/include/svx/fmview.hxx
+++ b/include/svx/fmview.hxx
@@ -140,8 +140,7 @@ public:
      void RemoveControlContainer(const css::uno::Reference< 
css::awt::XControlContainer >& xCC);
 
     virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut) override;
-    virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool 
bPaintFormLayer,
-        sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr) 
override;
+    virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool 
bPaintFormLayer) override;
 
     SVX_DLLPRIVATE const OutputDevice* GetActualOutDev() const {return 
mpActualOutDev;}
     SVX_DLLPRIVATE bool checkUnMarkAll(const css::uno::Reference< 
css::uno::XInterface >& _xSource);
diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index c3c866fbeeb9..8665262f0508 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -354,8 +354,7 @@ public:
     // This means: the SdrPaintWindow is no longer safe after this closing 
call.
     virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut);
     void DoCompleteRedraw(SdrPaintWindow& rPaintWindow, const vcl::Region& 
rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr);
-    virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool 
bPaintFormLayer,
-        sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr);
+    virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool 
bPaintFormLayer);
 
 
     // Used for the other applications basctl/sc/sw which call DrawLayer at 
PageViews
@@ -365,14 +364,12 @@ public:
 
     // Used when the region passed to BeginDrawLayers needs to be changed
     void UpdateDrawLayersRegion(const OutputDevice* pOut, const vcl::Region& 
rReg);
-    void EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer,
-        sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr);
+    void EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer);
 
 protected:
 
     // Used to paint the form layer after the PreRender device is flushed 
(painted) to the window.
-    void ImpFormLayerDrawing( SdrPaintWindow& rPaintWindow,
-        sdr::contact::ViewObjectContactRedirector* pRedirector = nullptr );
+    void ImpFormLayerDrawing( SdrPaintWindow& rPaintWindow );
 
     static vcl::Region OptimizeDrawLayersRegion(const OutputDevice* pOut, 
const vcl::Region& rReg, bool bDisableIntersect);
 
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index 3f878a3fed05..a26895653833 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -437,10 +437,9 @@ SdrPaintWindow* 
FmFormView::BeginCompleteRedraw(OutputDevice* pOut)
 }
 
 
-void FmFormView::EndCompleteRedraw( SdrPaintWindow& rPaintWindow, bool 
bPaintFormLayer,
-        sdr::contact::ViewObjectContactRedirector* pRedirector )
+void FmFormView::EndCompleteRedraw( SdrPaintWindow& rPaintWindow, bool 
bPaintFormLayer )
 {
-    E3dView::EndCompleteRedraw( rPaintWindow, bPaintFormLayer, pRedirector );
+    E3dView::EndCompleteRedraw( rPaintWindow, bPaintFormLayer );
     m_pImpl->resumeTabOrderUpdate();
 }
 
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 058f26d60e4e..ea8af4045878 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -606,8 +606,7 @@ void SdrPaintView::DoCompleteRedraw(SdrPaintWindow& 
rPaintWindow, const vcl::Reg
     }
 }
 
-void SdrPaintView::EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool 
bPaintFormLayer,
-        sdr::contact::ViewObjectContactRedirector* pRedirector)
+void SdrPaintView::EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool 
bPaintFormLayer)
 {
     std::unique_ptr<SdrPaintWindow> pPaintWindow;
     if (comphelper::LibreOfficeKit::isActive() && 
rPaintWindow.getTemporaryTarget())
@@ -629,7 +628,7 @@ void SdrPaintView::EndCompleteRedraw(SdrPaintWindow& 
rPaintWindow, bool bPaintFo
         // In the LOK case control rendering is performed through 
LokControlHandler
         if(!comphelper::LibreOfficeKit::isActive() && bPaintFormLayer)
         {
-            ImpFormLayerDrawing(rPaintWindow, pRedirector);
+            ImpFormLayerDrawing(rPaintWindow);
         }
 
         // look for active TextEdit. As long as this cannot be painted to a 
VDev,
@@ -698,11 +697,10 @@ SdrPaintWindow* 
SdrPaintView::BeginDrawLayers(OutputDevice* pOut, const vcl::Reg
     return pPaintWindow;
 }
 
-void SdrPaintView::EndDrawLayers(SdrPaintWindow& rPaintWindow, bool 
bPaintFormLayer,
-    sdr::contact::ViewObjectContactRedirector* pRedirector)
+void SdrPaintView::EndDrawLayers(SdrPaintWindow& rPaintWindow, bool 
bPaintFormLayer)
 {
     // #i74769# use EndCompleteRedraw() as common base
-    EndCompleteRedraw(rPaintWindow, bPaintFormLayer, pRedirector);
+    EndCompleteRedraw(rPaintWindow, bPaintFormLayer);
 
     if(mpPageView)
     {
@@ -757,8 +755,7 @@ vcl::Region SdrPaintView::OptimizeDrawLayersRegion(const 
OutputDevice* pOut, con
 }
 
 
-void SdrPaintView::ImpFormLayerDrawing( SdrPaintWindow& rPaintWindow,
-        sdr::contact::ViewObjectContactRedirector* pRedirector )
+void SdrPaintView::ImpFormLayerDrawing( SdrPaintWindow& rPaintWindow )
 {
     if(!mpPageView)
         return;
@@ -774,8 +771,7 @@ void SdrPaintView::ImpFormLayerDrawing( SdrPaintWindow& 
rPaintWindow,
         // BUFFERED use GetTargetOutputDevice() now, it may be targeted to 
VDevs, too
         // need to set PreparedPageWindow to make DrawLayer use the correct 
ObjectContact
         mpPageView->setPreparedPageWindow(pKnownTarget);
-        mpPageView->DrawLayer(nControlLayerId, 
&rPaintWindow.GetTargetOutputDevice(),
-        pRedirector);
+        mpPageView->DrawLayer(nControlLayerId, 
&rPaintWindow.GetTargetOutputDevice());
         mpPageView->setPreparedPageWindow(nullptr);
     }
 }
diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx
index b3bae4b0000a..1c30fe6b9ad9 100644
--- a/sw/source/core/inc/viewimp.hxx
+++ b/sw/source/core/inc/viewimp.hxx
@@ -21,7 +21,6 @@
 
 #include <tools/color.hxx>
 #include <svx/svdtypes.hxx>
-#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
 #include <swrect.hxx>
 #include <swregion.hxx>
 #include <memory>
@@ -46,24 +45,8 @@ class SwPagePreviewLayout;
 struct PreviewPage;
 class SwTextFrame;
 // --> OD #i76669#
-//namespace sdr::contact { class ViewObjectContactRedirector; }
+namespace sdr::contact { class ViewObjectContactRedirector; }
 // <--
-class SwViewObjectContactRedirector : public 
sdr::contact::ViewObjectContactRedirector
-{
-    private:
-        const SwViewShell& mrViewShell;
-
-    public:
-        explicit SwViewObjectContactRedirector( const SwViewShell& rSh )
-            : mrViewShell( rSh )
-        {};
-
-        virtual void createRedirectedPrimitive2DSequence(
-                                const sdr::contact::ViewObjectContact& 
rOriginal,
-                                const sdr::contact::DisplayInfo& rDisplayInfo,
-                                
drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) override;
-};
-
 
 class SwViewShellImp
 {
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index a041b413ba16..abe0a0c41ba6 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -29,7 +29,6 @@
 #include <editeng/shaditem.hxx>
 #include <svx/ctredlin.hxx>
 #include <svx/framelink.hxx>
-#include <svx/svdouno.hxx>
 #include <drawdoc.hxx>
 #include <tgrditem.hxx>
 #include <calbck.hxx>
@@ -74,6 +73,7 @@
 #include <swfont.hxx>
 
 #include <svx/sdr/primitive2d/sdrframeborderprimitive2d.hxx>
+#include <svx/sdr/contact/viewobjectcontactredirector.hxx>
 #include <svx/sdr/contact/viewobjectcontact.hxx>
 #include <svx/sdr/contact/viewcontact.hxx>
 #include <DocumentSettingManager.hxx>
@@ -3217,6 +3217,47 @@ void SwTabFramePainter::Insert( SwLineEntry& rNew, bool 
bHori )
         pLineSet->insert( rNew );
 }
 
+/**
+ * FUNCTIONS USED FOR COLLAPSING TABLE BORDER LINES END
+ * --> OD #i76669#
+ */
+namespace
+{
+    class SwViewObjectContactRedirector : public 
sdr::contact::ViewObjectContactRedirector
+    {
+        private:
+            const SwViewShell& mrViewShell;
+
+        public:
+            explicit SwViewObjectContactRedirector( const SwViewShell& rSh )
+                : mrViewShell( rSh )
+            {};
+
+            virtual void createRedirectedPrimitive2DSequence(
+                                    const sdr::contact::ViewObjectContact& 
rOriginal,
+                                    const sdr::contact::DisplayInfo& 
rDisplayInfo,
+                                    
drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) override
+            {
+                bool bPaint( true );
+
+                SdrObject* pObj = 
rOriginal.GetViewContact().TryToGetSdrObject();
+                if ( pObj )
+                {
+                    bPaint = SwFlyFrame::IsPaint( pObj, &mrViewShell );
+                }
+
+                if ( !bPaint )
+                {
+                    return;
+                }
+
+                
sdr::contact::ViewObjectContactRedirector::createRedirectedPrimitive2DSequence(
+                                                        rOriginal, 
rDisplayInfo, rVisitor );
+            }
+    };
+
+} // end of anonymous namespace
+// <--
 
 /**
  * Paint once for every visible page which is touched by Rect
@@ -4129,13 +4170,6 @@ bool SwFlyFrame::IsBackgroundTransparent() const
     return bBackgroundTransparent;
 };
 
-static void lcl_PaintReplacement( const SwRect &rRect, const SwViewShell &rSh )
-{
-    const BitmapEx& rBmp = 
const_cast<SwViewShell&>(rSh).GetReplacementBitmap(false);
-    vcl::Font aFont(rSh.GetOut()->GetFont() );
-    Graphic::DrawEx(*rSh.GetOut(), OUString(), aFont, rBmp, rRect.Pos(), 
rRect.SSize());
-}
-
 bool SwFlyFrame::IsPaint( SdrObject *pObj, const SwViewShell *pSh )
 {
     SdrObjUserCall *pUserCall = GetUserCall(pObj);
@@ -4143,15 +4177,6 @@ bool SwFlyFrame::IsPaint( SdrObject *pObj, const 
SwViewShell *pSh )
     if ( nullptr == pUserCall )
         return true;
 
-    if ( pSh && ((!pSh->GetViewOptions()->IsDraw()
-             && (dynamic_cast<SdrUnoObj*>(pObj) || 
dynamic_cast<SdrAttrObj*>(pObj) || dynamic_cast<SwFlyDrawObj*>(pObj)))
-        || (!pSh->GetViewOptions()->IsGraphic() && 
dynamic_cast<SwVirtFlyDrawObj*>(pObj)) )
-         )
-    {
-        SwRect rBoundRect = GetBoundRectOfAnchoredObj( pObj );
-        lcl_PaintReplacement( rBoundRect, *pSh );
-        return false;
-    }
     assert(pObj);
 
     //Attribute dependent, don't paint for printer or Preview
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index ee9f8028c7a1..3f427ed77316 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -38,8 +38,6 @@
 #include <drawdoc.hxx>
 #include <prevwpage.hxx>
 #include <sfx2/viewsh.hxx>
-#include <svx/sdr/contact/viewobjectcontact.hxx>
-#include <svx/sdr/contact/viewcontact.hxx>
 
 void SwViewShellImp::Init( const SwViewOption *pNewOpt )
 {
@@ -527,26 +525,4 @@ void SwViewShellImp::FireAccessibleEvents()
 }
 #endif // ENABLE_WASM_STRIP_ACCESSIBILITY
 
-void SwViewObjectContactRedirector::createRedirectedPrimitive2DSequence(
-                        const sdr::contact::ViewObjectContact& rOriginal,
-                        const sdr::contact::DisplayInfo& rDisplayInfo,
-                        
drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor)
-{
-    bool bPaint( true );
-
-    SdrObject* pObj = rOriginal.GetViewContact().TryToGetSdrObject();
-    if ( pObj )
-    {
-        bPaint = SwFlyFrame::IsPaint( pObj, &mrViewShell );
-    }
-
-    if ( !bPaint )
-    {
-        return;
-    }
-
-    
sdr::contact::ViewObjectContactRedirector::createRedirectedPrimitive2DSequence(
-                                            rOriginal, rDisplayInfo, rVisitor 
);
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index ec1242781921..c4d9a551807c 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -251,8 +251,7 @@ void SwViewShell::DLPostPaint2(bool bPaintFormLayer)
         }
 
         // #i74769# use SdrPaintWindow now direct
-        SwViewObjectContactRedirector aSwRedirector(*this);
-        Imp()->GetDrawView()->EndDrawLayers(*mpTargetPaintWindow, 
bPaintFormLayer, &aSwRedirector);
+        Imp()->GetDrawView()->EndDrawLayers(*mpTargetPaintWindow, 
bPaintFormLayer);
         mpTargetPaintWindow = nullptr;
     }
 }

Reply via email to