sw/inc/viewsh.hxx                 |    5 ---
 sw/source/core/doc/htmltbl.cxx    |    4 +-
 sw/source/core/inc/rootfrm.hxx    |    2 -
 sw/source/core/layout/pagechg.cxx |    5 ---
 sw/source/core/view/viewsh.cxx    |   61 --------------------------------------
 sw/source/core/view/vnew.cxx      |    6 +--
 sw/source/filter/html/swhtml.cxx  |    3 -
 7 files changed, 7 insertions(+), 79 deletions(-)

New commits:
commit 669b95e6c99f9fc0ade7c23322b7142ef497133b
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue May 16 20:58:05 2023 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri May 19 09:59:18 2023 +0200

    Related: tdf#155349 drop SetEndActionByVirDev from the html import
    
    EndActionByVirDev only arises in the non-mainstream use html web document 
case and precedes the introduction of DoubleBuffer. It would be helpful to have 
one less corner case to consider.
    
    Change-Id: Ibb9064cf5b37b1806f90c24ad9fbf84a8e37c0c3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151854
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 3c8bc31b88c0..656e47347c02 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -137,8 +137,6 @@ class SW_DLLPUBLIC SwViewShell : public 
sw::Ring<SwViewShell>
     bool  mbFrameView       :1;  // If true it is a  (HTML-)Frame.
     bool  mbEnableSmooth    :1;  // Disable SmoothScroll, e.g. for drag
                                     // of scrollbars.
-    bool  mbEndActionByVirDev:1; // Paints from EndAction always via virtual 
device
-                                    // (e.g. when browsing).
     bool      mbShowHeaderSeparator:1; ///< Flag to say that we are showing 
the header control
     bool      mbShowFooterSeparator:1; ///< Flag to say that we are showing 
the footer control
     bool      mbHeaderFooterEdit:1;  ///< Flag to say that we are editing 
header or footer (according to the bShow(Header|Footer)Separator above)
@@ -204,9 +202,6 @@ public:
     bool ActionPend() const { return mnStartAction != 0; }
     bool IsInEndAction() const { return mbInEndAction; }
 
-    void SetEndActionByVirDev( bool b ) { mbEndActionByVirDev = b; }
-    bool IsEndActionByVirDev() const    { return mbEndActionByVirDev; }
-
     // The ActionCount for all Shells is temporarily set to zero and then
     // restored at the RootFrame via UNO.
     void    SetRestoreActions(sal_uInt16 nSet);
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index ffa1a63267e2..4711a123ad0f 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -1684,8 +1684,8 @@ void SwHTMLTableLayout::Resize_( sal_uInt16 nAbsAvail, 
bool bRecalc )
     // Else we can set the widths, in which we have to run Pass 2 in each case.
     SetWidths( true, nAbsAvail );
 
-    if ( pRoot && pRoot->IsCallbackActionEnabled() )
-        pRoot->EndAllAction( true );    //True per VirDev (browsing is calmer)
+    if (pRoot && pRoot->IsCallbackActionEnabled())
+        pRoot->EndAllAction();
 }
 
 IMPL_LINK_NOARG( SwHTMLTableLayout, DelayedResize_Impl, Timer*, void )
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 0caf4012862d..80e104c9c63b 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -223,7 +223,7 @@ public:
      * automatically in the EndAllAction.
      */
     void StartAllAction();
-    void EndAllAction( bool bVirDev = false );
+    void EndAllAction();
 
     /**
      * Certain UNO Actions (e.g. table cursor) require that all Actions are 
reset temporarily
diff --git a/sw/source/core/layout/pagechg.cxx 
b/sw/source/core/layout/pagechg.cxx
index c38201a5ed9d..6f11380fc030 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1929,15 +1929,13 @@ void SwRootFrame::StartAllAction()
         }
 }
 
-void SwRootFrame::EndAllAction( bool bVirDev )
+void SwRootFrame::EndAllAction()
 {
     if ( !GetCurrShell() )
         return;
 
     for(SwViewShell& rSh : GetCurrShell()->GetRingContainer())
     {
-        const bool bOldEndActionByVirDev = rSh.IsEndActionByVirDev();
-        rSh.SetEndActionByVirDev( bVirDev );
         if ( auto pCursorShell = dynamic_cast<SwCursorShell*>( &rSh) )
         {
             pCursorShell->EndAction();
@@ -1947,7 +1945,6 @@ void SwRootFrame::EndAllAction( bool bVirDev )
         }
         else
             rSh.EndAction();
-        rSh.SetEndActionByVirDev( bOldEndActionByVirDev );
     }
 }
 
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index a6197e994c51..16717f4e540d 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -337,71 +337,12 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
                 oRegion->LimitToOrigin();
                 oRegion->Compress( SwRegionRects::CompressFuzzy );
 
-                ScopedVclPtr<VirtualDevice> pVout;
                 while ( !oRegion->empty() )
                 {
                     SwRect aRect( oRegion->back() );
                     oRegion->pop_back();
 
-                    bool bPaint = true;
-                    if ( IsEndActionByVirDev() )
-                    {
-                        //create virtual device and set.
-                        if ( !pVout )
-                            pVout = VclPtr<VirtualDevice>::Create( *GetOut() );
-                        MapMode aMapMode( GetOut()->GetMapMode() );
-                        pVout->SetMapMode( aMapMode );
-
-                        bool bSizeOK = true;
-
-                        tools::Rectangle aTmp1( aRect.SVRect() );
-                        aTmp1 = GetOut()->LogicToPixel( aTmp1 );
-                        tools::Rectangle aTmp2( GetOut()->PixelToLogic( aTmp1 
) );
-                        if ( aTmp2.Left() > aRect.Left() )
-                            aTmp1.SetLeft( std::max( tools::Long(0), 
aTmp1.Left() - 1 ) );
-                        if ( aTmp2.Top() > aRect.Top() )
-                            aTmp1.SetTop( std::max<tools::Long>( 0, 
aTmp1.Top() - 1 ) );
-                        aTmp1.AdjustRight(1 );
-                        aTmp1.AdjustBottom(1 );
-                        aTmp1 = GetOut()->PixelToLogic( aTmp1 );
-                        aRect = SwRect( aTmp1 );
-
-                        const Size aTmp( pVout->GetOutputSize() );
-                        if ( aTmp.Height() < aRect.Height() ||
-                             aTmp.Width()  < aRect.Width() )
-                        {
-                            bSizeOK = pVout->SetOutputSize( aRect.SSize() );
-                        }
-                        if ( bSizeOK )
-                        {
-                            bPaint = false;
-
-                            // --> OD 2007-07-26 #i79947#
-                            // #i72754# start Pre/PostPaint encapsulation 
before mpOut is changed to the buffering VDev
-                            const vcl::Region aRepaintRegion(aRect.SVRect());
-                            DLPrePaint2(aRepaintRegion);
-                            // <--
-
-                            OutputDevice  *pOld = GetOut();
-                            pVout->SetLineColor( pOld->GetLineColor() );
-                            pVout->SetFillColor( pOld->GetFillColor() );
-                            Point aOrigin( aRect.Pos() );
-                            aOrigin.setX( -aOrigin.X() ); aOrigin.setY( 
-aOrigin.Y() );
-                            aMapMode.SetOrigin( aOrigin );
-                            pVout->SetMapMode( aMapMode );
-
-                            mpOut = pVout.get();
-                            if ( bPaintsFromSystem )
-                                PaintDesktop(*mpOut, aRect);
-                            pCurrentLayout->PaintSwFrame( *mpOut, aRect );
-                            pOld->DrawOutDev( aRect.Pos(), aRect.SSize(),
-                                              aRect.Pos(), aRect.SSize(), 
*pVout );
-                            mpOut = pOld;
-
-                            // #i72754# end Pre/PostPaint encapsulation when 
mpOut is back and content is painted
-                            DLPostPaint2(true);
-                        }
-                    }
+                    const bool bPaint = true;
                     if ( bPaint )
                     {
                         if (GetWin()->SupportsDoubleBuffering())
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index b841134cc21a..0d097f0a9475 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -168,8 +168,7 @@ SwViewShell::SwViewShell( SwDoc& rDocument, vcl::Window 
*pWindow,
     // <SwDrawContact::Changed> during construction of <SwViewShell> instance
     mbInConstructor = true;
 
-    mbPaintInProgress = mbViewLocked = mbInEndAction = mbFrameView =
-    mbEndActionByVirDev = false;
+    mbPaintInProgress = mbViewLocked = mbInEndAction = mbFrameView = false;
     mbPaintWorks = mbEnableSmooth = true;
     mbPreview = 0 !=( VSHELLFLAG_ISPREVIEW & nFlags );
 
@@ -238,8 +237,7 @@ SwViewShell::SwViewShell( SwViewShell& rShell, vcl::Window 
*pWindow,
     mbInConstructor = true;
 
     mbPaintWorks = mbEnableSmooth = true;
-    mbPaintInProgress = mbViewLocked = mbInEndAction = mbFrameView =
-    mbEndActionByVirDev = false;
+    mbPaintInProgress = mbViewLocked = mbInEndAction = mbFrameView = false;
     mbPreview = 0 !=( VSHELLFLAG_ISPREVIEW & nFlags );
 
     if( nFlags & VSHELLFLAG_SHARELAYOUT )
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index cfc4a6df2b98..e32eb6e85ce3 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -2683,10 +2683,7 @@ SwViewShell *SwHTMLParser::CallEndAction( bool 
bChkAction, bool bChkPtr )
         // Already scrolled?, then make sure that the view doesn't move!
         const bool bOldLock = m_pActionViewShell->IsViewLocked();
         m_pActionViewShell->LockView( true );
-        const bool bOldEndActionByVirDev = 
m_pActionViewShell->IsEndActionByVirDev();
-        m_pActionViewShell->SetEndActionByVirDev( true );
         pEditShell->EndAction();
-        m_pActionViewShell->SetEndActionByVirDev( bOldEndActionByVirDev );
         m_pActionViewShell->LockView( bOldLock );
 
         // bChkJumpMark is only set when the object was also found

Reply via email to