sc/source/filter/excel/xistyle.cxx |    6 +++---
 sc/source/filter/inc/xistyle.hxx   |    7 ++-----
 2 files changed, 5 insertions(+), 8 deletions(-)

New commits:
commit bdc8d3dec0beb167c40e6d0eea02c3b401e5117d
Author:     Noel Grandin <[email protected]>
AuthorDate: Mon Jun 24 16:27:17 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Jun 25 10:17:46 2024 +0200

    tdf#161210 speed up XLS load
    
    flatten XclImpXFRangeColumn a litte, no need to allocate this separately
    
    Change-Id: Ic33131626b41ca19b964387b3d7f6e74cefdd91c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169505
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sc/source/filter/excel/xistyle.cxx 
b/sc/source/filter/excel/xistyle.cxx
index 8c29ece09885..5eeff7e19a91 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -1904,7 +1904,7 @@ void XclImpXFRangeBuffer::SetXF( const ScAddress& rScPos, 
sal_uInt16 nXFIndex, X
     if( maColumns.size() <= nIndex )
         maColumns.resize( nIndex + 1 );
     if( !maColumns[ nIndex ] )
-        maColumns[ nIndex ] = std::make_shared<XclImpXFRangeColumn>();
+        maColumns[ nIndex ].emplace();
     // remember all Boolean cells, they will get 'Standard' number format
     maColumns[ nIndex ]->SetXF( nScRow, XclImpXFIndex( nXFIndex, eMode == 
xlXFModeBoolCell ) );
 
@@ -1953,7 +1953,7 @@ void XclImpXFRangeBuffer::SetColumnDefXF( SCCOL nScCol, 
sal_uInt16 nXFIndex )
     if( maColumns.size() <= nIndex )
         maColumns.resize( nIndex + 1 );
     OSL_ENSURE( !maColumns[ nIndex ], "XclImpXFRangeBuffer::SetColumnDefXF - 
default column of XFs already has values" );
-    maColumns[ nIndex ] = std::make_shared<XclImpXFRangeColumn>();
+    maColumns[ nIndex ].emplace();
     maColumns[ nIndex ]->SetDefaultXF( XclImpXFIndex( nXFIndex ), GetRoot());
 }
 
@@ -1996,7 +1996,7 @@ void XclImpXFRangeBuffer::Finalize()
     SCCOL pendingColStart = -1;
     SCCOL pendingColEnd = -1;
     SCCOL nScCol = 0;
-    for( const auto& rxColumn : maColumns )
+    for( auto& rxColumn : maColumns )
     {
         // apply all cell styles of an existing column
         if( rxColumn )
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index 963beb2ab609..ff56c5d1d370 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -22,6 +22,7 @@
 #include <tools/solar.h>
 #include <vector>
 #include <memory>
+#include <optional>
 #include <rangelst.hxx>
 #include "xlstyle.hxx"
 #include "xiroot.hxx"
@@ -565,10 +566,6 @@ inline bool XclImpXFRange::Contains( SCROW nScRow ) const
 class XclImpXFRangeColumn
 {
 public:
-    /** make noncopyable */
-    XclImpXFRangeColumn(const XclImpXFRangeColumn&) = delete;
-    const XclImpXFRangeColumn& operator=(const XclImpXFRangeColumn&) = delete;
-
     typedef std::vector< XclImpXFRange > IndexList;
 
     explicit     XclImpXFRangeColumn() {}
@@ -660,7 +657,7 @@ private:
 
 private:
 
-    std::vector< std::shared_ptr< XclImpXFRangeColumn > >
+    std::vector< std::optional<XclImpXFRangeColumn> >
                         maColumns;        /// Array of column XF index buffers.
     std::vector< std::pair< XclRange, OUString > >
                         maHyperlinks;     /// Maps URLs to hyperlink cells.

Reply via email to