summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2020-10-19 22:33:21 +0800
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-20 08:08:42 +0200
commitaa99b57cdc8cb3763aa935ed84e7d80c4e56a172 (patch)
tree23ffc3ceaaf190e82e422fc3c90ca732e286a3d1
parent0839bfaf75d3a1bc78b63c71f28a763b1b39f979 (diff)
tdf#137594 prevent converting unallocated columns.
Check col against GetAllocatedColumnsCount() instead of MaxCol(). This prevents allocating a new column just for converting an empty cell. Change-Id: I5c8dcfffc2661ab9c4fd9c2c53ed389e57351517 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104528 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/ui/view/spelleng.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx
index d9fdc3bb4e68..bb4c1f1ddf85 100644
--- a/sc/source/ui/view/spelleng.cxx
+++ b/sc/source/ui/view/spelleng.cxx
@@ -153,7 +153,7 @@ bool ScConversionEngineBase::FindNextConversionCell()
bLoop = false;
mbFinished = true;
}
- else if( nNewCol > mrDoc.MaxCol() )
+ else if( nNewCol >= mrDoc.GetAllocatedColumnsCount(mnStartTab) )
{
// no more cells in the sheet - try to restart at top of sheet
@@ -178,6 +178,7 @@ bool ScConversionEngineBase::FindNextConversionCell()
}
else
{
+ // GetPattern may implicitly allocates the column if not exists,
pPattern = mrDoc.GetPattern( nNewCol, nNewRow, mnStartTab );
if( pPattern && (pPattern != pLastPattern) )
{