sc/source/core/data/table1.cxx             |   16 +++++++++-------
 scripting/source/vbaevents/eventhelper.cxx |   22 +++++++++++-----------
 2 files changed, 20 insertions(+), 18 deletions(-)

New commits:
commit 6931a596350086d52ba32bf8a84cb36fbfdb34d6
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Mar 28 13:17:50 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Mar 28 17:44:21 2024 +0100

    tdf#160399 speed up print preview
    
    takes time from 11s to 5s for me
    
    Change-Id: Ic874b9168f9caaf697007e586df8499a849ccfd6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165460
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 0a2fc33df217..1764d400e44a 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -2091,17 +2091,19 @@ void ScTable::ExtendPrintArea( OutputDevice* pDev,
         else
         {
             // These columns are visible.  Check for empty columns.
-            for (SCCOL j = i; j <= nLastCol; ++j)
+            SCCOL nEmptyCount = 0;
+            SCCOL j = i;
+            for (; j <= nLastCol; ++j)
             {
                 if ( j >= aCol.size() )
-                {
-                    aSkipCols.setTrue( j, rDocument.MaxCol() );
                     break;
-                }
-                if (aCol[j].GetCellCount() == 0)
-                    // empty
-                    aSkipCols.setTrue(j,j);
+                if (aCol[j].GetCellCount() == 0) // empty
+                    nEmptyCount++;
             }
+            if (nEmptyCount)
+                aSkipCols.setTrue(i,i+nEmptyCount);
+            if ( j >= aCol.size() )
+                aSkipCols.setTrue( j, rDocument.MaxCol() );
         }
         i = nLastCol;
     }
commit 02b5bf515dfc29dc72075d355a07e6497a88b57c
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Mar 27 11:14:15 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Mar 28 17:44:07 2024 +0100

    convert EventListener to comphelper::WeakComponentImplHelper
    
    Change-Id: I3c83fabae8e2fc6a32fe92a596ed93ebc00140fa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165443
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/scripting/source/vbaevents/eventhelper.cxx 
b/scripting/source/vbaevents/eventhelper.cxx
index 9f4bdc1f72fe..0efc50085040 100644
--- a/scripting/source/vbaevents/eventhelper.cxx
+++ b/scripting/source/vbaevents/eventhelper.cxx
@@ -21,8 +21,9 @@
 #include <sal/log.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/uno3.hxx>
+#include <comphelper/compbase.hxx>
 #include <comphelper/proparrhlp.hxx>
-#include <comphelper/propertycontainer.hxx>
+#include <comphelper/propertycontainer2.hxx>
 #include <comphelper/diagnose_ex.hxx>
 
 #include <ooo/vba/XVBAToOOEventDescGen.hpp>
@@ -518,7 +519,7 @@ private:
 
 }
 
-typedef ::cppu::WeakImplHelper< XScriptListener, util::XCloseListener, 
lang::XInitialization, css::lang::XServiceInfo > EventListener_BASE;
+typedef ::comphelper::WeakImplHelper< XScriptListener, util::XCloseListener, 
lang::XInitialization, css::lang::XServiceInfo > EventListener_BASE;
 
 #define EVENTLSTNR_PROPERTY_ID_MODEL         1
 constexpr OUStringLiteral EVENTLSTNR_PROPERTY_MODEL = u"Model";
@@ -526,8 +527,7 @@ constexpr OUStringLiteral EVENTLSTNR_PROPERTY_MODEL = 
u"Model";
 namespace {
 
 class EventListener : public EventListener_BASE
-    ,public ::comphelper::OMutexAndBroadcastHelper
-    ,public ::comphelper::OPropertyContainer
+    ,public ::comphelper::OPropertyContainer2
     ,public ::comphelper::OPropertyArrayUsageHelper< EventListener >
 {
 
@@ -535,7 +535,7 @@ public:
     EventListener();
     // XEventListener
     virtual void SAL_CALL disposing(const lang::EventObject& Source) override;
-    using cppu::OPropertySetHelper::disposing;
+    using comphelper::OPropertySetHelper::disposing;
 
     // XScriptListener
     virtual void SAL_CALL firing(const ScriptEvent& evt) override;
@@ -552,7 +552,7 @@ public:
 
     // XTypeProvider
     DECLARE_XTYPEPROVIDER()
-    virtual void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const 
css::uno::Any& rValue ) override
+    virtual void setFastPropertyValueImpl( std::unique_lock<std::mutex>& 
rGuard, sal_Int32 nHandle, const css::uno::Any& rValue ) override
     {
         if ( nHandle == EVENTLSTNR_PROPERTY_ID_MODEL )
         {
@@ -573,7 +573,7 @@ public:
                 }
             }
         }
-        OPropertyContainer::setFastPropertyValue( nHandle, rValue );
+        OPropertyContainer2::setFastPropertyValueImpl( rGuard, nHandle, rValue 
);
         if ( nHandle == EVENTLSTNR_PROPERTY_ID_MODEL )
             setShellFromModel();
     }
@@ -595,7 +595,7 @@ public:
 
 protected:
     // OPropertySetHelper
-    virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(  ) override;
+    virtual ::cppu::IPropertyArrayHelper& getInfoHelper(  ) override;
 
     // OPropertyArrayUsageHelper
     virtual ::cppu::IPropertyArrayHelper* createArrayHelper(  ) const override;
@@ -613,7 +613,7 @@ private:
 }
 
 EventListener::EventListener() :
-OPropertyContainer(GetBroadcastHelper()), m_bDocClosed(false), mpShell( 
nullptr )
+m_bDocClosed(false), mpShell( nullptr )
 {
     registerProperty( EVENTLSTNR_PROPERTY_MODEL, EVENTLSTNR_PROPERTY_ID_MODEL,
         beans::PropertyAttribute::TRANSIENT, &m_xModel, 
cppu::UnoType<decltype(m_xModel)>::get() );
@@ -689,11 +689,11 @@ EventListener::initialize( const Sequence< Any >& 
aArguments )
 
 // XInterface
 
-IMPLEMENT_FORWARD_XINTERFACE2( EventListener, EventListener_BASE, 
OPropertyContainer )
+IMPLEMENT_FORWARD_XINTERFACE2( EventListener, EventListener_BASE, 
comphelper::OPropertyContainer2 )
 
 // XTypeProvider
 
-IMPLEMENT_FORWARD_XTYPEPROVIDER2( EventListener, EventListener_BASE, 
OPropertyContainer )
+IMPLEMENT_FORWARD_XTYPEPROVIDER2( EventListener, EventListener_BASE, 
comphelper::OPropertyContainer2 )
 
 // OPropertySetHelper
 

Reply via email to