diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-29 16:14:52 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-30 10:49:19 +0200 |
commit | 9ab64dc48a6a61edce6ff3724093162ca1cf8331 (patch) | |
tree | 7b27c9ea039671ddb133eb4f141862a2611dee29 /sc/source/core/data/documen2.cxx | |
parent | cefad27ee85486b01cf600c08371a651787dadc2 (diff) |
pass ScSheetLimits around
instead of MAXROW, MAXCOL. In preparation for more conversion work that
needs to be done to make jumbo sheets work.
Change-Id: I4698b8fe111e060ae2a965afc7276b7e7bfb482a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95153
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/core/data/documen2.cxx')
-rw-r--r-- | sc/source/core/data/documen2.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index cc45c83c30d4..ac89e288bda1 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -91,6 +91,15 @@ using namespace com::sun::star; const sal_uInt16 ScDocument::nSrcVer = SC_CURRENT_VERSION; +static ScSheetLimits* CreateSheetLimits() +{ + const ScDefaultsOptions& rOpt = SC_MOD()->GetDefaultsOptions(); + if (rOpt.GetInitJumboSheets()) + return new ScSheetLimits(MAXCOL_JUMBO, MAXROW_JUMBO); + else + return new ScSheetLimits(MAXCOL, MAXROW); +} + ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) : mpCellStringPool(std::make_shared<svl::SharedStringPool>(*ScGlobal::getCharClassPtr())), mpDocLinkMgr(new sc::DocumentLinkManager(pDocShell)), @@ -101,13 +110,13 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) : mpPrinter( nullptr ), mpVirtualDevice_100th_mm( nullptr ), pFormatExchangeList( nullptr ), - mxSheetLimits(new ScSheetLimits(MAXCOL, MAXROW)), + mxSheetLimits(CreateSheetLimits()), pFormulaTree( nullptr ), pEOFormulaTree( nullptr ), pFormulaTrack( nullptr ), pEOFormulaTrack( nullptr ), pPreviewCellStyle( nullptr ), - maPreviewSelection(MAXROW, MAXCOL), + maPreviewSelection(*mxSheetLimits), nUnoObjectId( 0 ), nRangeOverflowType( 0 ), aCurTextWidthCalcPos(MaxCol(),0,0), @@ -170,12 +179,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) : mbDocShellRecalc(false), mnMutationGuardFlags(0) { - const ScDefaultsOptions& rOpt = SC_MOD()->GetDefaultsOptions(); - if (rOpt.GetInitJumboSheets()) - { - mxSheetLimits = new ScSheetLimits(MAXCOL_JUMBO, MAXROW_JUMBO); - } - maPreviewSelection = { MaxRow(), MaxCol() }; + maPreviewSelection = { *mxSheetLimits }; aCurTextWidthCalcPos = { MaxCol(), 0, 0 }; SetStorageGrammar( formula::FormulaGrammar::GRAM_STORAGE_DEFAULT); |