include/sfx2/titledockwin.hxx       |    6 ------
 sfx2/source/dialog/titledockwin.cxx |   18 +++---------------
 2 files changed, 3 insertions(+), 21 deletions(-)

New commits:
commit 7280d3b62c0326554a0d2b14f218b5282562b2cf
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Tue Jun 1 11:56:32 2021 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Wed Sep 8 10:33:21 2021 +0200

    do not use delayed layout in TitledDockingWindow
    
    The layout is only performed in Paint(), so if something uses
    geometry before that happens (may happen with tiled rendering),
    then is not up to date. I don't see why delay it anyway, there
    seems to be usually just one resize, and only during init I see
    two of them, which can presumably be fixed if needed.
    
    Change-Id: I7133f3c6be41bc6480f86d1053b455d42c40b9ba
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116529
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>
    (cherry picked from commit 2f961c7a811bdff66a94c20573798d58b565195a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120242
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/include/sfx2/titledockwin.hxx b/include/sfx2/titledockwin.hxx
index 976c4bb9f665..cb2d73542bac 100644
--- a/include/sfx2/titledockwin.hxx
+++ b/include/sfx2/titledockwin.hxx
@@ -73,7 +73,6 @@ namespace sfx2
         DECL_LINK( OnToolboxItemSelected, ToolBox*, void );
 
         void    impl_layout();
-        void    impl_scheduleLayout();
 
     private:
         OUString            m_sTitle;
@@ -86,11 +85,6 @@ namespace sfx2
         */
         SvBorder            m_aBorder;
 
-        /** Remember that a layout is pending, i.e. Resize() has been called
-            since the last Paint().
-        */
-        bool                m_bLayoutPending;
-
         /** Height of the title bar.  Calculated in impl_layout().
         */
         int                 m_nTitleBarHeight;
diff --git a/sfx2/source/dialog/titledockwin.cxx 
b/sfx2/source/dialog/titledockwin.cxx
index 7483ee8d193d..a56530ed8924 100644
--- a/sfx2/source/dialog/titledockwin.cxx
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -39,7 +39,6 @@ namespace sfx2
         ,m_aToolbox( VclPtr<ToolBox>::Create(this) )
         ,m_aContentWindow( VclPtr<vcl::Window>::Create(this, WB_DIALOGCONTROL) 
)
         ,m_aBorder( 3, 1, 3, 3 )
-        ,m_bLayoutPending( false )
         ,m_nTitleBarHeight(0)
     {
         SetBackground( Wallpaper() );
@@ -83,20 +82,12 @@ namespace sfx2
     void TitledDockingWindow::Resize()
     {
         SfxDockingWindow::Resize();
-        impl_scheduleLayout();
-    }
-
-
-    void TitledDockingWindow::impl_scheduleLayout()
-    {
-        m_bLayoutPending = true;
+        impl_layout();
     }
 
 
     void TitledDockingWindow::impl_layout()
     {
-        m_bLayoutPending = false;
-
         m_aToolbox->ShowItem( 1, !IsFloatingMode() );
 
         const Size aToolBoxSize( m_aToolbox->CalcWindowSizePixel() );
@@ -143,9 +134,6 @@ namespace sfx2
     {
         const StyleSettings& rStyleSettings = 
rRenderContext.GetSettings().GetStyleSettings();
 
-        if (m_bLayoutPending)
-            impl_layout();
-
         SfxDockingWindow::Paint(rRenderContext, i_rArea);
 
         rRenderContext.Push(PushFlags::FONT | PushFlags::FILLCOLOR | 
PushFlags::LINECOLOR);
@@ -240,7 +228,7 @@ namespace sfx2
         switch ( i_nType )
         {
             case StateChangedType::InitShow:
-                impl_scheduleLayout();
+                impl_layout();
                 break;
             default:;
         }
@@ -260,7 +248,7 @@ namespace sfx2
             case DataChangedEventType::FONTS:
             case DataChangedEventType::FONTSUBSTITUTION:
             {
-                impl_scheduleLayout();
+                impl_layout();
                 Invalidate();
             }
             break;

Reply via email to