summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 5035cd31a858..2b754ce08ddf 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) )
{