summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-10-02 10:02:12 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-10-02 14:00:10 +0200
commit5f6b8b18dc16d290382187693861404e9a405b34 (patch)
treeedf559fae1f34049bc0ca642e6e7a063392c11c3 /sc
parentcb7e14bf370647a3fe618492ff79d0202c64c71f (diff)
tdf#161986 speedup ODS with large merged range
reduces load time from 90s to 25s Change-Id: I7523776e5f4e2c4dc8645ccdf303e51178a9848a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174376 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx7
-rw-r--r--sc/source/filter/xml/xmlsubti.cxx5
-rw-r--r--sc/source/filter/xml/xmlsubti.hxx1
3 files changed, 13 insertions, 0 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 0de47dcfbe5e..911586eb2683 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1269,6 +1269,13 @@ void ScXMLTableRowCellContext::AddTextAndValueCell( const ScAddress& rCellPos,
rTables.AddColumn(false);
}
}
+ // if nothing else useful can happen in the loop, just exit early
+ if (i != 0 && bIsEmpty && rCurrentPos.Row() != 0)
+ {
+ rCurrentPos.SetCol( rCellPos.Col() + nColsRepeated - 1 );
+ rTables.AddColumns(nColsRepeated - i - 1);
+ break;
+ }
}
}
}
diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx
index aa48f37833b3..0d865721b930 100644
--- a/sc/source/filter/xml/xmlsubti.cxx
+++ b/sc/source/filter/xml/xmlsubti.cxx
@@ -179,6 +179,11 @@ void ScMyTables::AddColumn(bool bIsCovered)
rImport.GetStylesImportHelper()->InsertCol(maCurrentCellPos.Col(), maCurrentCellPos.Tab());
}
+void ScMyTables::AddColumns(sal_Int32 nRepeat)
+{
+ maCurrentCellPos.SetCol( maCurrentCellPos.Col() + nRepeat );
+}
+
void ScMyTables::DeleteTable()
{
ScXMLImport::MutexGuard aGuard(rImport);
diff --git a/sc/source/filter/xml/xmlsubti.hxx b/sc/source/filter/xml/xmlsubti.hxx
index b0c6e7457224..49e148b3db16 100644
--- a/sc/source/filter/xml/xmlsubti.hxx
+++ b/sc/source/filter/xml/xmlsubti.hxx
@@ -73,6 +73,7 @@ public:
void AddRow();
void SetRowStyle(const OUString& rCellStyleName);
void AddColumn(bool bIsCovered);
+ void AddColumns(sal_Int32 nRepeat);
void FixupOLEs() { aFixupOLEs.FixupOLEs(); }
static bool IsOLE(const css::uno::Reference< css::drawing::XShape >& rShape)
{ return ScMyOLEFixer::IsOLE(rShape); }