diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-13 15:59:51 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-13 19:41:59 +0100 |
commit | 113444f59dc7690850919155b9b164b1a686bbe7 (patch) | |
tree | 90828ec324aabf60236f0785178c60144c2b4975 /sc/source/core/data/documen2.cxx | |
parent | 3b8e554b69de349a20d10ec90b27ab71a013b464 (diff) |
sc: rowcol: tdf#50916 create ScSheetLimits to hold by rtl::Reference
ScTokenArray sometimes outlives the ScDocument that created it, which
means it accesses dead data when it tries to validate columns and rows.
So create the ScSheetLimits class, which ScTokenArray can hold by
reference counted pointer.
Change-Id: Ic5771734fe4962d12f024fc1b29232124c14208a
Reviewed-on: https://gerrit.libreoffice.org/85117
Tested-by: Jenkins
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'sc/source/core/data/documen2.cxx')
-rw-r--r-- | sc/source/core/data/documen2.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index a779371f83b7..af09ab3f21c7 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -100,8 +100,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) : mpPrinter( nullptr ), mpVirtualDevice_100th_mm( nullptr ), pFormatExchangeList( nullptr ), - mnMaxCol(MAXCOL), - mnMaxRow(MAXROW), + mxSheetLimits(new ScSheetLimits(MAXCOL, MAXROW)), pFormulaTree( nullptr ), pEOFormulaTree( nullptr ), pFormulaTrack( nullptr ), @@ -173,10 +172,9 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) : const ScDefaultsOptions& rOpt = SC_MOD()->GetDefaultsOptions(); if (rOpt.GetInitJumboSheets()) { - mnMaxCol = 16384; - mnMaxRow = 16 * 1000 * 1000; + mxSheetLimits = new ScSheetLimits(16384, 16 * 1000 * 1000); } - maPreviewSelection = { mnMaxRow, mnMaxCol }; + maPreviewSelection = { MaxRow(), MaxCol() }; aCurTextWidthCalcPos = { MaxCol(), 0, 0 }; SetStorageGrammar( formula::FormulaGrammar::GRAM_STORAGE_DEFAULT); |