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/ui/unoobj | |
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/ui/unoobj')
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 658ad00c7b91..b7c11adfedba 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -762,7 +762,7 @@ void Chart2Positioner::createPositionMap() if (bExternal) rCol[ nInsRow ].reset(new ScExternalSingleRefToken(nFileId, aTabName, aCellData)); else - rCol[ nInsRow ].reset(new ScSingleRefToken(mpDoc, aCellData)); + rCol[ nInsRow ].reset(new ScSingleRefToken(mpDoc->GetSheetLimits(), aCellData)); } } } @@ -921,12 +921,12 @@ private: if (bExternal) rStart.reset(new ScExternalSingleRefToken(nFileId, aTabName, aData.Ref1)); else - rStart.reset(new ScSingleRefToken(pDoc, aData.Ref1)); + rStart.reset(new ScSingleRefToken(pDoc->GetSheetLimits(), aData.Ref1)); if (bExternal) rEnd.reset(new ScExternalSingleRefToken(nFileId, aTabName, aData.Ref2)); else - rEnd.reset(new ScSingleRefToken(pDoc, aData.Ref2)); + rEnd.reset(new ScSingleRefToken(pDoc->GetSheetLimits(), aData.Ref2)); return true; } @@ -1292,7 +1292,7 @@ bool lcl_addUpperLeftCornerIfMissing(const ScDocument* pDoc, vector<ScTokenRef>& } else { - ScTokenRef pCorner(new ScSingleRefToken(pDoc, aData)); + ScTokenRef pCorner(new ScSingleRefToken(pDoc->GetSheetLimits(), aData)); ScRefTokenHelper::join(pDoc, rRefTokens, pCorner, ScAddress()); } } @@ -1312,7 +1312,7 @@ bool lcl_addUpperLeftCornerIfMissing(const ScDocument* pDoc, vector<ScTokenRef>& } else { - ScTokenRef pCorner(new ScDoubleRefToken(pDoc, r)); + ScTokenRef pCorner(new ScDoubleRefToken(pDoc->GetSheetLimits(), r)); ScRefTokenHelper::join(pDoc, rRefTokens, pCorner, ScAddress()); } } |