sc/qa/unit/copy_paste_test.cxx | 4 sc/source/ui/Accessibility/AccessibleText.cxx | 2 sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx | 4 sc/source/ui/StatisticsDialogs/ChiSquareTestDialog.cxx | 4 sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx | 4 sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx | 4 sc/source/ui/StatisticsDialogs/FTestDialog.cxx | 4 sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx | 4 sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx | 4 sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx | 4 sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx | 8 sc/source/ui/StatisticsDialogs/RegressionDialog.cxx | 4 sc/source/ui/StatisticsDialogs/SamplingDialog.cxx | 24 sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx | 8 sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx | 8 sc/source/ui/StatisticsDialogs/TTestDialog.cxx | 4 sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx | 18 sc/source/ui/StatisticsDialogs/ZTestDialog.cxx | 4 sc/source/ui/app/client.cxx | 4 sc/source/ui/app/inputhdl.cxx | 70 +- sc/source/ui/app/inputwin.cxx | 8 sc/source/ui/app/scmod.cxx | 4 sc/source/ui/app/seltrans.cxx | 18 sc/source/ui/app/transobj.cxx | 3 sc/source/ui/condformat/condformatdlg.cxx | 4 sc/source/ui/condformat/condformateasydlg.cxx | 2 sc/source/ui/dbgui/PivotLayoutDialog.cxx | 2 sc/source/ui/dbgui/dbnamdlg.cxx | 2 sc/source/ui/dbgui/filtdlg.cxx | 2 sc/source/ui/dbgui/sfiltdlg.cxx | 2 sc/source/ui/dialogs/SparklineDataRangeDialog.cxx | 2 sc/source/ui/dialogs/SparklineDialog.cxx | 2 sc/source/ui/docshell/docfunc.cxx | 2 sc/source/ui/docshell/docsh.cxx | 2 sc/source/ui/docshell/docsh3.cxx | 2 sc/source/ui/docshell/docsh4.cxx | 2 sc/source/ui/docshell/docsh6.cxx | 2 sc/source/ui/docshell/externalrefmgr.cxx | 4 sc/source/ui/drawfunc/drawsh2.cxx | 2 sc/source/ui/drawfunc/drawsh5.cxx | 20 sc/source/ui/drawfunc/drtxtob.cxx | 4 sc/source/ui/drawfunc/drtxtob1.cxx | 2 sc/source/ui/drawfunc/fudraw.cxx | 2 sc/source/ui/drawfunc/fuins2.cxx | 18 sc/source/ui/drawfunc/fusel.cxx | 4 sc/source/ui/drawfunc/fusel2.cxx | 4 sc/source/ui/drawfunc/futext3.cxx | 8 sc/source/ui/formdlg/formula.cxx | 2 sc/source/ui/inc/AnalysisOfVarianceDialog.hxx | 2 sc/source/ui/inc/ChiSquareTestDialog.hxx | 2 sc/source/ui/inc/DescriptiveStatisticsDialog.hxx | 2 sc/source/ui/inc/ExponentialSmoothingDialog.hxx | 2 sc/source/ui/inc/FTestDialog.hxx | 2 sc/source/ui/inc/FourierAnalysisDialog.hxx | 2 sc/source/ui/inc/MatrixComparisonGenerator.hxx | 2 sc/source/ui/inc/MovingAverageDialog.hxx | 2 sc/source/ui/inc/RegressionDialog.hxx | 2 sc/source/ui/inc/SamplingDialog.hxx | 6 sc/source/ui/inc/StatisticsInputOutputDialog.hxx | 2 sc/source/ui/inc/StatisticsTwoVariableDialog.hxx | 2 sc/source/ui/inc/TTestDialog.hxx | 2 sc/source/ui/inc/TableFillingAndNavigationTools.hxx | 4 sc/source/ui/inc/ZTestDialog.hxx | 2 sc/source/ui/inc/datastreamdlg.hxx | 4 sc/source/ui/inc/inputhdl.hxx | 4 sc/source/ui/inc/namedefdlg.hxx | 2 sc/source/ui/inc/optsolver.hxx | 4 sc/source/ui/inc/sharedocdlg.hxx | 2 sc/source/ui/inc/viewdata.hxx | 6 sc/source/ui/miscdlgs/acredlin.cxx | 38 - sc/source/ui/miscdlgs/crnrdlg.cxx | 6 sc/source/ui/miscdlgs/datafdlg.cxx | 14 sc/source/ui/miscdlgs/datastreamdlg.cxx | 10 sc/source/ui/miscdlgs/highred.cxx | 2 sc/source/ui/miscdlgs/instbdlg.cxx | 2 sc/source/ui/miscdlgs/optsolver.cxx | 24 sc/source/ui/miscdlgs/sharedocdlg.cxx | 17 sc/source/ui/namedlg/namedefdlg.cxx | 8 sc/source/ui/undo/undocell.cxx | 2 sc/source/ui/unoobj/dispuno.cxx | 2 sc/source/ui/unoobj/docuno.cxx | 4 sc/source/ui/unoobj/viewuno.cxx | 74 +- sc/source/ui/view/SparklineShell.cxx | 2 sc/source/ui/view/auditsh.cxx | 2 sc/source/ui/view/cellsh.cxx | 24 sc/source/ui/view/cellsh1.cxx | 38 - sc/source/ui/view/cellsh2.cxx | 23 sc/source/ui/view/cellsh3.cxx | 4 sc/source/ui/view/dbfunc.cxx | 64 +- sc/source/ui/view/dbfunc3.cxx | 96 +-- sc/source/ui/view/drawvie3.cxx | 4 sc/source/ui/view/drawvie4.cxx | 36 - sc/source/ui/view/drawview.cxx | 23 sc/source/ui/view/editsh.cxx | 12 sc/source/ui/view/formatsh.cxx | 8 sc/source/ui/view/gridwin.cxx | 140 ++-- sc/source/ui/view/gridwin2.cxx | 22 sc/source/ui/view/gridwin4.cxx | 16 sc/source/ui/view/pgbrksh.cxx | 2 sc/source/ui/view/pivotsh.cxx | 10 sc/source/ui/view/printfun.cxx | 3 sc/source/ui/view/select.cxx | 10 sc/source/ui/view/spelldialog.cxx | 2 sc/source/ui/view/spelleng.cxx | 4 sc/source/ui/view/tabcont.cxx | 12 sc/source/ui/view/tabview.cxx | 15 sc/source/ui/view/tabview2.cxx | 22 sc/source/ui/view/tabview3.cxx | 17 sc/source/ui/view/tabview4.cxx | 6 sc/source/ui/view/tabview5.cxx | 8 sc/source/ui/view/tabvwsh3.cxx | 28 sc/source/ui/view/tabvwsh4.cxx | 110 +-- sc/source/ui/view/tabvwsh5.cxx | 6 sc/source/ui/view/tabvwsh9.cxx | 2 sc/source/ui/view/tabvwsha.cxx | 97 +-- sc/source/ui/view/tabvwshb.cxx | 36 - sc/source/ui/view/tabvwshd.cxx | 6 sc/source/ui/view/tabvwshf.cxx | 24 sc/source/ui/view/tabvwshh.cxx | 2 sc/source/ui/view/viewdata.cxx | 19 sc/source/ui/view/viewfun2.cxx | 290 +++++----- sc/source/ui/view/viewfun3.cxx | 126 ++-- sc/source/ui/view/viewfun4.cxx | 52 - sc/source/ui/view/viewfun5.cxx | 8 sc/source/ui/view/viewfun6.cxx | 62 +- sc/source/ui/view/viewfun7.cxx | 8 sc/source/ui/view/viewfunc.cxx | 271 ++++----- 127 files changed, 1188 insertions(+), 1166 deletions(-)
New commits: commit 30af0dfd29c1e3c70ae30e2123b7549323870c12 Author: Xisco Fauli <[email protected]> AuthorDate: Fri Nov 28 12:39:33 2025 +0100 Commit: Christian Lohmaier <[email protected]> CommitDate: Mon Dec 1 13:07:17 2025 +0100 tdf#168850, tdf#167075, tdf#169554: Revert "ScViewData: pass ScDocShell by ref" This reverts commit d8ab8992bd35aedfc1d2b0debebab0d623aa8d09 Unfortunately I had to revert the fix for tdf#167075 in ea940b7985921883f8f75009186cae24846b1bd4 "tdf#169554: Revert "tdf#167075: init doc shell before pasting as png/bmp (take 2)"" because of tdf#169554, which I can't reproduce, so reverting the original commit that introduced tdf#167075 It also fixes other similar issues reported in Bugzilla Change-Id: I9fc4fac447a8779b3cde21987771792f718067b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194769 Reviewed-by: Christian Lohmaier <[email protected]> Tested-by: Jenkins diff --git a/sc/qa/unit/copy_paste_test.cxx b/sc/qa/unit/copy_paste_test.cxx index 50e2693ec3e7..b1691fc23d5d 100644 --- a/sc/qa/unit/copy_paste_test.cxx +++ b/sc/qa/unit/copy_paste_test.cxx @@ -458,8 +458,8 @@ void ScCopyPasteTest::testTdf88782_autofillLinearNumbersInMergedCells() // merge the yellow cells ScCellMergeOption aMergeOptions(9, 11, 10, 13); //J12:K14 aMergeOptions.maTabs.insert(0); - ScDocShell& rDocSh = pViewShell->GetViewData().GetDocShell(); - rDocSh.GetDocFunc().MergeCells(aMergeOptions, false, true, true, false); + ScDocShell* pDocSh = pViewShell->GetViewData().GetDocShell(); + pDocSh->GetDocFunc().MergeCells(aMergeOptions, false, true, true, false); // fillauto numbers, these areas contain mostly merged cells pViewShell->FillAuto(FILL_TO_BOTTOM, 1, 8, 3, 14, 7); // B9:D15 -> B9:D22 diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index db1fb175a3ec..3df9a2d0bcbb 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -653,7 +653,7 @@ ScDocShell* ScAccessibleCellTextData::GetDocShell(ScTabViewShell* pViewShell) { ScDocShell* pDocSh = nullptr; if (pViewShell) - pDocSh = &pViewShell->GetViewData().GetDocShell(); + pDocSh = pViewShell->GetViewData().GetDocShell(); return pDocSh; } diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx index ee8e93a054f0..acfab698b601 100644 --- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx @@ -538,9 +538,9 @@ void ScAnalysisOfVarianceDialog::AnovaTwoFactor(AddressWalkerWriter& output, For } } -ScRange ScAnalysisOfVarianceDialog::ApplyOutput(ScDocShell& rDocShell) +ScRange ScAnalysisOfVarianceDialog::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter output(mOutputAddress, rDocShell, mDocument, + AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar(formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(&mDocument); diff --git a/sc/source/ui/StatisticsDialogs/ChiSquareTestDialog.cxx b/sc/source/ui/StatisticsDialogs/ChiSquareTestDialog.cxx index 32505d6c2269..5c1ada025aa8 100644 --- a/sc/source/ui/StatisticsDialogs/ChiSquareTestDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/ChiSquareTestDialog.cxx @@ -37,9 +37,9 @@ TranslateId ScChiSquareTestDialog::GetUndoNameId() return STR_CHI_SQUARE_TEST; } -ScRange ScChiSquareTestDialog::ApplyOutput(ScDocShell& rDocShell) +ScRange ScChiSquareTestDialog::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter aOutput(mOutputAddress, rDocShell, mDocument, + AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(&mDocument); diff --git a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx index c1e298ef53f7..d82d7fa0e957 100644 --- a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx @@ -68,9 +68,9 @@ TranslateId ScDescriptiveStatisticsDialog::GetUndoNameId() return STR_DESCRIPTIVE_STATISTICS_UNDO_NAME; } -ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell& rDocShell) +ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter aOutput(mOutputAddress, rDocShell, mDocument, + AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(&mDocument); diff --git a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx index b610ab580cdd..d7fe7c872167 100644 --- a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx @@ -41,9 +41,9 @@ TranslateId ScExponentialSmoothingDialog::GetUndoNameId() return STR_EXPONENTIAL_SMOOTHING_UNDO_NAME; } -ScRange ScExponentialSmoothingDialog::ApplyOutput(ScDocShell& rDocShell) +ScRange ScExponentialSmoothingDialog::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter output(mOutputAddress, rDocShell, mDocument, + AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(&mDocument); diff --git a/sc/source/ui/StatisticsDialogs/FTestDialog.cxx b/sc/source/ui/StatisticsDialogs/FTestDialog.cxx index a4e527dab9b3..68834bea55db 100644 --- a/sc/source/ui/StatisticsDialogs/FTestDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/FTestDialog.cxx @@ -39,9 +39,9 @@ TranslateId ScFTestDialog::GetUndoNameId() return STR_FTEST_UNDO_NAME; } -ScRange ScFTestDialog::ApplyOutput(ScDocShell& rDocShell) +ScRange ScFTestDialog::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter aOutput(mOutputAddress, rDocShell, mDocument, + AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar(formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(&mDocument); diff --git a/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx b/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx index 5092d0426b90..94564358b9f0 100644 --- a/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/FourierAnalysisDialog.cxx @@ -51,10 +51,10 @@ void ScFourierAnalysisDialog::Close() TranslateId ScFourierAnalysisDialog::GetUndoNameId() { return STR_FOURIER_ANALYSIS_UNDO_NAME; } -ScRange ScFourierAnalysisDialog::ApplyOutput(ScDocShell& rDocShell) +ScRange ScFourierAnalysisDialog::ApplyOutput(ScDocShell* pDocShell) { getOptions(); - AddressWalkerWriter aOutput(mOutputAddress, rDocShell, mDocument, + AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(&mDocument); diff --git a/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx b/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx index a90c95369e7e..f2059ff822a8 100644 --- a/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx +++ b/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx @@ -55,9 +55,9 @@ TranslateId ScMatrixComparisonGenerator::GetUndoNameId() return STR_CORRELATION_UNDO_NAME; } -ScRange ScMatrixComparisonGenerator::ApplyOutput(ScDocShell& rDocShell) +ScRange ScMatrixComparisonGenerator::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter output(mOutputAddress, rDocShell, mDocument, + AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(&mDocument); diff --git a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx index 246103a7ad62..4cbe9343e200 100644 --- a/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx @@ -42,9 +42,9 @@ TranslateId ScMovingAverageDialog::GetUndoNameId() return STR_MOVING_AVERAGE_UNDO_NAME; } -ScRange ScMovingAverageDialog::ApplyOutput(ScDocShell& rDocShell) +ScRange ScMovingAverageDialog::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter output(mOutputAddress, rDocShell, mDocument, + AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(&mDocument); diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx index 6d953affb021..8ab3a384a098 100644 --- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx @@ -254,8 +254,8 @@ void ScRandomNumberGeneratorDialog::GenerateNumbers(DIST& distribution, std::mt1 OUString aDistributionName = ScResId(pDistributionStringId); aUndo = aUndo.replaceAll("%1", aDistributionName); - ScDocShell& rDocShell = mrViewData.GetDocShell(); - SfxUndoManager* pUndoManager = rDocShell.GetUndoManager(); + ScDocShell* pDocShell = mrViewData.GetDocShell(); + SfxUndoManager* pUndoManager = pDocShell->GetUndoManager(); pUndoManager->EnterListAction( aUndo, aUndo, 0, mrViewData.GetViewShell()->GetViewShellId() ); SCROW nRowStart = maInputRange.aStart.Row(); @@ -284,13 +284,13 @@ void ScRandomNumberGeneratorDialog::GenerateNumbers(DIST& distribution, std::mt1 aVals.push_back(distribution(seed)); } - rDocShell.GetDocFunc().SetValueCells(aPos, aVals, true); + pDocShell->GetDocFunc().SetValueCells(aPos, aVals, true); } } pUndoManager->LeaveListAction(); - rDocShell.PostPaint( maInputRange, PaintPartFlags::Grid ); + pDocShell->PostPaint( maInputRange, PaintPartFlags::Grid ); } IMPL_LINK_NOARG( ScRandomNumberGeneratorDialog, OkClicked, weld::Button&, void ) diff --git a/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx b/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx index 3613eda61d05..b75412947d96 100644 --- a/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/RegressionDialog.cxx @@ -171,9 +171,9 @@ TranslateId ScRegressionDialog::GetUndoNameId() return STR_REGRESSION_UNDO_NAME; } -ScRange ScRegressionDialog::ApplyOutput(ScDocShell& rDocShell) +ScRange ScRegressionDialog::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter aOutput(mOutputAddress, rDocShell, mDocument, + AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(&mDocument); aTemplate.autoReplaceUses3D(mbUse3DAddresses); diff --git a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx index cacbf772bf20..c6a807ddf3f8 100644 --- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx @@ -170,7 +170,7 @@ void ScSamplingDialog::SetReference( const ScRange& rReferenceRange, ScDocument& mxButtonOk->set_sensitive(mInputRange.IsValid() && mOutputAddress.IsValid()); } -ScRange ScSamplingDialog::PerformPeriodicSampling(ScDocShell& rDocShell) +ScRange ScSamplingDialog::PerformPeriodicSampling(ScDocShell* pDocShell) { ScAddress aStart = mInputRange.aStart; ScAddress aEnd = mInputRange.aEnd; @@ -193,7 +193,7 @@ ScRange ScSamplingDialog::PerformPeriodicSampling(ScDocShell& rDocShell) if (i % aPeriod == aPeriod - 1 ) // Sample the last of period { double aValue = mDocument.GetValue(ScAddress(inCol, inRow, inTab)); - rDocShell.GetDocFunc().SetValueCell(ScAddress(outCol, outRow, outTab), aValue, true); + pDocShell->GetDocFunc().SetValueCell(ScAddress(outCol, outRow, outTab), aValue, true); outRow++; } i++; @@ -206,7 +206,7 @@ ScRange ScSamplingDialog::PerformPeriodicSampling(ScDocShell& rDocShell) return ScRange(mOutputAddress, ScAddress(outTab, outRow, outTab) ); } -ScRange ScSamplingDialog::PerformRandomSampling(ScDocShell& rDocShell) +ScRange ScSamplingDialog::PerformRandomSampling(ScDocShell* pDocShell) { ScAddress aStart = mInputRange.aStart; ScAddress aEnd = mInputRange.aEnd; @@ -273,7 +273,7 @@ ScRange ScSamplingDialog::PerformRandomSampling(ScDocShell& rDocShell) } const double fValue = mDocument.GetValue( ScAddress(inCol, nRandom, inTab) ); - rDocShell.GetDocFunc().SetValueCell(ScAddress(outCol, outRow, outTab), fValue, true); + pDocShell->GetDocFunc().SetValueCell(ScAddress(outCol, outRow, outTab), fValue, true); outRow++; } outCol++; @@ -284,7 +284,7 @@ ScRange ScSamplingDialog::PerformRandomSampling(ScDocShell& rDocShell) return ScRange(mOutputAddress, ScAddress(outTab, outRow, outTab) ); } -ScRange ScSamplingDialog::PerformRandomSamplingKeepOrder(ScDocShell& rDocShell) +ScRange ScSamplingDialog::PerformRandomSamplingKeepOrder(ScDocShell* pDocShell) { ScAddress aStart = mInputRange.aStart; ScAddress aEnd = mInputRange.aEnd; @@ -317,7 +317,7 @@ ScRange ScSamplingDialog::PerformRandomSamplingKeepOrder(ScDocShell& rDocShell) else { double aValue = mDocument.GetValue( ScAddress(inCol, inRow, inTab) ); - rDocShell.GetDocFunc().SetValueCell(ScAddress(outCol, outRow, outTab), aValue, true); + pDocShell->GetDocFunc().SetValueCell(ScAddress(outCol, outRow, outTab), aValue, true); inRow++; outRow++; } @@ -333,8 +333,8 @@ ScRange ScSamplingDialog::PerformRandomSamplingKeepOrder(ScDocShell& rDocShell) void ScSamplingDialog::PerformSampling() { OUString aUndo(ScResId(STR_SAMPLING_UNDO_NAME)); - ScDocShell& rDocShell = mViewData.GetDocShell(); - SfxUndoManager* pUndoManager = rDocShell.GetUndoManager(); + ScDocShell* pDocShell = mViewData.GetDocShell(); + SfxUndoManager* pUndoManager = pDocShell->GetUndoManager(); ScRange aModifiedRange; @@ -343,17 +343,17 @@ void ScSamplingDialog::PerformSampling() if (mxRandomMethodRadio->get_active()) { if (mxKeepOrder->get_sensitive() && mxKeepOrder->get_active()) - aModifiedRange = PerformRandomSamplingKeepOrder(rDocShell); + aModifiedRange = PerformRandomSamplingKeepOrder(pDocShell); else - aModifiedRange = PerformRandomSampling(rDocShell); + aModifiedRange = PerformRandomSampling(pDocShell); } else if (mxPeriodicMethodRadio->get_active()) { - aModifiedRange = PerformPeriodicSampling(rDocShell); + aModifiedRange = PerformPeriodicSampling(pDocShell); } pUndoManager->LeaveListAction(); - rDocShell.PostPaint(aModifiedRange, PaintPartFlags::Grid); + pDocShell->PostPaint(aModifiedRange, PaintPartFlags::Grid); } sal_Int64 ScSamplingDialog::GetPopulationSize() const diff --git a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx index badba7855b70..cff235681f1e 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx @@ -281,14 +281,14 @@ IMPL_LINK_NOARG( ScStatisticsInputOutputDialog, RefInputModifyHandler, formula:: void ScStatisticsInputOutputDialog::CalculateInputAndWriteToOutput() { OUString aUndo(ScResId(GetUndoNameId())); - ScDocShell& rDocShell = mViewData.GetDocShell(); - SfxUndoManager* pUndoManager = rDocShell.GetUndoManager(); + ScDocShell* pDocShell = mViewData.GetDocShell(); + SfxUndoManager* pUndoManager = pDocShell->GetUndoManager(); pUndoManager->EnterListAction( aUndo, aUndo, 0, mViewData.GetViewShell()->GetViewShellId() ); - ScRange aOutputRange = ApplyOutput(rDocShell); + ScRange aOutputRange = ApplyOutput(pDocShell); pUndoManager->LeaveListAction(); - rDocShell.PostPaint( aOutputRange, PaintPartFlags::Grid ); + pDocShell->PostPaint( aOutputRange, PaintPartFlags::Grid ); } bool ScStatisticsInputOutputDialog::InputRangesValid() diff --git a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx index 7b495a876b1f..c0fcbc751dbc 100644 --- a/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx @@ -323,14 +323,14 @@ IMPL_LINK_NOARG( ScStatisticsTwoVariableDialog, RefInputModifyHandler, formula:: void ScStatisticsTwoVariableDialog::CalculateInputAndWriteToOutput() { OUString aUndo(ScResId(GetUndoNameId())); - ScDocShell& rDocShell = mViewData.GetDocShell(); - SfxUndoManager* pUndoManager = rDocShell.GetUndoManager(); + ScDocShell* pDocShell = mViewData.GetDocShell(); + SfxUndoManager* pUndoManager = pDocShell->GetUndoManager(); pUndoManager->EnterListAction( aUndo, aUndo, 0, mViewData.GetViewShell()->GetViewShellId() ); - ScRange aOutputRange = ApplyOutput(rDocShell); + ScRange aOutputRange = ApplyOutput(pDocShell); pUndoManager->LeaveListAction(); - rDocShell.PostPaint( aOutputRange, PaintPartFlags::Grid ); + pDocShell->PostPaint( aOutputRange, PaintPartFlags::Grid ); } bool ScStatisticsTwoVariableDialog::InputRangesValid() diff --git a/sc/source/ui/StatisticsDialogs/TTestDialog.cxx b/sc/source/ui/StatisticsDialogs/TTestDialog.cxx index b354f4ee02a8..7f57ebebdb35 100644 --- a/sc/source/ui/StatisticsDialogs/TTestDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/TTestDialog.cxx @@ -39,9 +39,9 @@ TranslateId ScTTestDialog::GetUndoNameId() return STR_TTEST_UNDO_NAME; } -ScRange ScTTestDialog::ApplyOutput(ScDocShell& rDocShell) +ScRange ScTTestDialog::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter aOutput(mOutputAddress, rDocShell, mDocument, + AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(&mDocument); diff --git a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx index 502d467cc5b8..d109fb537fbd 100644 --- a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx +++ b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx @@ -154,17 +154,17 @@ void AddressWalker::push(SCCOL aRelativeCol, SCROW aRelativeRow, SCTAB aRelative mAddressStack.push_back(mCurrentAddress); } -AddressWalkerWriter::AddressWalkerWriter(const ScAddress& aInitialAddress, ScDocShell& rDocShell, ScDocument& rDocument, +AddressWalkerWriter::AddressWalkerWriter(const ScAddress& aInitialAddress, ScDocShell* pDocShell, ScDocument& rDocument, formula::FormulaGrammar::Grammar eGrammar ) : AddressWalker(aInitialAddress), - mrDocShell(rDocShell), + mpDocShell(pDocShell), mrDocument(rDocument), meGrammar(eGrammar) {} void AddressWalkerWriter::writeFormula(const OUString& aFormula) { - mrDocShell.GetDocFunc().SetFormulaCell(mCurrentAddress, + mpDocShell->GetDocFunc().SetFormulaCell(mCurrentAddress, new ScFormulaCell(mrDocument, mCurrentAddress, aFormula, meGrammar), true); } @@ -174,7 +174,7 @@ void AddressWalkerWriter::writeFormulas(const std::vector<OUString>& rFormulas) if (!nLength) return; - const size_t nMaxLen = mrDocShell.GetDocument().MaxRow() - mCurrentAddress.Row() + 1; + const size_t nMaxLen = mpDocShell->GetDocument().MaxRow() - mCurrentAddress.Row() + 1; // If not done already, trim the length to fit. if (nLength > nMaxLen) nLength = nMaxLen; @@ -187,7 +187,7 @@ void AddressWalkerWriter::writeFormulas(const std::vector<OUString>& rFormulas) aAddr.IncRow(1); } - mrDocShell.GetDocFunc().SetFormulaCells(mCurrentAddress, aFormulaCells, true); + mpDocShell->GetDocFunc().SetFormulaCells(mCurrentAddress, aFormulaCells, true); } void AddressWalkerWriter::writeMatrixFormula(const OUString& aFormula, SCCOL nCols, SCROW nRows) @@ -199,12 +199,12 @@ void AddressWalkerWriter::writeMatrixFormula(const OUString& aFormula, SCCOL nCo aRange.aEnd.IncCol(nCols - 1); if (nRows > 1) aRange.aEnd.IncRow(nRows - 1); - mrDocShell.GetDocFunc().EnterMatrix(aRange, nullptr, nullptr, aFormula, false, false, OUString(), meGrammar ); + mpDocShell->GetDocFunc().EnterMatrix(aRange, nullptr, nullptr, aFormula, false, false, OUString(), meGrammar ); } void AddressWalkerWriter::writeString(const OUString& aString) { - mrDocShell.GetDocFunc().SetStringCell(mCurrentAddress, aString, true); + mpDocShell->GetDocFunc().SetStringCell(mCurrentAddress, aString, true); } void AddressWalkerWriter::writeString(const char* aCharArray) @@ -223,12 +223,12 @@ void AddressWalkerWriter::writeBoldString(const OUString& aString) aItemSet.Put(aJustify); rEngine.QuickSetAttribs(aItemSet, ESelection(0, 0, 0, aString.getLength()) ); std::unique_ptr<EditTextObject> pEditText(rEngine.CreateTextObject()); - mrDocShell.GetDocFunc().SetEditCell(mCurrentAddress, *pEditText, true); + mpDocShell->GetDocFunc().SetEditCell(mCurrentAddress, *pEditText, true); } void AddressWalkerWriter::writeValue(double aValue) { - mrDocShell.GetDocFunc().SetValueCell(mCurrentAddress, aValue, true); + mpDocShell->GetDocFunc().SetValueCell(mCurrentAddress, aValue, true); } // Applies a column header format to the current cell and subsequent (nCols - 1) columns diff --git a/sc/source/ui/StatisticsDialogs/ZTestDialog.cxx b/sc/source/ui/StatisticsDialogs/ZTestDialog.cxx index 0966af0aaf1b..627c1cf65006 100644 --- a/sc/source/ui/StatisticsDialogs/ZTestDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/ZTestDialog.cxx @@ -39,9 +39,9 @@ TranslateId ScZTestDialog::GetUndoNameId() return STR_ZTEST_UNDO_NAME; } -ScRange ScZTestDialog::ApplyOutput(ScDocShell& rDocShell) +ScRange ScZTestDialog::ApplyOutput(ScDocShell* pDocShell) { - AddressWalkerWriter aOutput(mOutputAddress, rDocShell, mDocument, + AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); FormulaTemplate aTemplate(&mDocument); diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx index a13372ca9bdf..5c44bc077e83 100644 --- a/sc/source/ui/app/client.cxx +++ b/sc/source/ui/app/client.cxx @@ -168,7 +168,7 @@ void ScClient::ObjectAreaChanged() pDrawObj->setSuppressSetVisAreaSize(false); // set document modified (SdrModel::SetChanged is not used) - pViewSh->GetViewData().GetDocShell().SetDrawModified(); + pViewSh->GetViewData().GetDocShell()->SetDrawModified(); pViewSh->ScrollToObject(pDrawObj); } @@ -232,7 +232,7 @@ void ScClient::ViewChanged() pDrawObj->SetLogicRect( aLogicRect ); // set document modified (SdrModel::SetChanged is not used) - pViewSh->GetViewData().GetDocShell().SetDrawModified(); + pViewSh->GetViewData().GetDocShell()->SetDrawModified(); } } } diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 5c0a718a5ba6..ea59d4e44105 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -362,8 +362,8 @@ void ScInputHandler::InitRangeFinder( const OUString& rFormula ) DeleteRangeFinder(); if (!pActiveViewSh || !ScModule::get()->GetInputOptions().GetRangeFinder()) return; - ScDocShell& rDocSh = pActiveViewSh->GetViewData().GetDocShell(); - ScDocument& rDoc = rDocSh.GetDocument(); + ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell(); + ScDocument& rDoc = pDocSh->GetDocument(); const sal_Unicode cSheetSep = rDoc.GetSheetSeparator(); OUString aDelimiters = ScEditUtil::ModifyDelimiters(u" !~%\" "_ustr); @@ -458,7 +458,7 @@ handle_r1c1: if (!nCount) { mpEditEngine->SetUpdateLayout( false ); - pRangeFindList.reset(new ScRangeFindList( rDocSh.GetTitle() )); + pRangeFindList.reset(new ScRangeFindList( pDocSh->GetTitle() )); } Color nColor = pRangeFindList->Insert( ScRangeFindData( aRange, nFlags, aSel)); @@ -479,11 +479,11 @@ handle_r1c1: { mpEditEngine->SetUpdateLayout( true ); - rDocSh.Broadcast( SfxHint( SfxHintId::ScShowRangeFinder ) ); + pDocSh->Broadcast( SfxHint( SfxHintId::ScShowRangeFinder ) ); } } -ReferenceMark ScInputHandler::GetReferenceMark( const ScViewData& rViewData, ScDocShell& rDocSh, +ReferenceMark ScInputHandler::GetReferenceMark( const ScViewData& rViewData, ScDocShell* pDocSh, tools::Long nX1, tools::Long nX2, tools::Long nY1, tools::Long nY2, tools::Long nTab, const Color& rColor ) { @@ -495,7 +495,7 @@ ReferenceMark ScInputHandler::GetReferenceMark( const ScViewData& rViewData, ScD { SCCOL nCol1 = nX1, nCol2 = nX2; SCROW nRow1 = nY1, nRow2 = nY2; - ScDocument& rDoc = rDocSh.GetDocument(); + ScDocument& rDoc = pDocSh->GetDocument(); PutInOrder(nCol1, nCol2); PutInOrder(nRow1, nRow2); @@ -524,11 +524,11 @@ ReferenceMark ScInputHandler::GetReferenceMark( const ScViewData& rViewData, ScD Fraction aZoomY = rViewData.GetZoomY(); ScTableInfo aTabInfo(nY1, nY2, true); - rDocSh.GetDocument().FillInfo( aTabInfo, nX1, nY1, nX2, nY2, + pDocSh->GetDocument().FillInfo( aTabInfo, nX1, nY1, nX2, nY2, nTab, nPPTX, nPPTY, false, false ); ScOutputData aOutputData( nullptr, OUTTYPE_WINDOW, aTabInfo, - &( rDocSh.GetDocument() ), nTab, + &( pDocSh->GetDocument() ), nTab, nScrX, nScrY, nX1, nY1, nX2, nY2, nPPTX, nPPTY, @@ -550,7 +550,7 @@ void ScInputHandler::UpdateLokReferenceMarks() return; ScViewData& rViewData = pShell->GetViewData(); - ScDocShell& rDocSh = rViewData.GetDocShell(); + ScDocShell* pDocSh = rViewData.GetDocShell(); ScRangeFindList* pRangeFinder = GetRangeFindList(); if ( !pRangeFinder && !rViewData.IsRefMode() ) @@ -577,7 +577,7 @@ void ScInputHandler::UpdateLokReferenceMarks() PutInOrder(nX1, nX2); PutInOrder(nY1, nY2); - aReferenceMarks[0] = ScInputHandler::GetReferenceMark( rViewData, rDocSh, + aReferenceMarks[0] = ScInputHandler::GetReferenceMark( rViewData, pDocSh, nX1, nX2, nY1, nY2, nTab, aRefColor ); } @@ -587,7 +587,7 @@ void ScInputHandler::UpdateLokReferenceMarks() aReferenceMarks.resize( nCount ); if ( nCount && pRangeFinder && !pRangeFinder->IsHidden() && - pRangeFinder->GetDocName() == rDocSh.GetTitle() ) + pRangeFinder->GetDocName() == pDocSh->GetTitle() ) { for (sal_uInt16 i = 0; i < nCount - nAdditionalMarks; i++) { @@ -601,7 +601,7 @@ void ScInputHandler::UpdateLokReferenceMarks() tools::Long nY2 = aRef.aEnd.Row(); tools::Long nTab = aRef.aStart.Tab(); - aReferenceMarks[i + nAdditionalMarks] = ScInputHandler::GetReferenceMark( rViewData, rDocSh, + aReferenceMarks[i + nAdditionalMarks] = ScInputHandler::GetReferenceMark( rViewData, pDocSh, nX1, nX2, nY1, nY2, nTab, rData.nColor ); @@ -706,9 +706,9 @@ void ScInputHandler::DeleteRangeFinder() ScTabViewShell* pPaintView = pRefViewSh ? pRefViewSh : pActiveViewSh; if ( pRangeFindList && pPaintView ) { - ScDocShell& rDocSh = pActiveViewSh->GetViewData().GetDocShell(); + ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell(); pRangeFindList->SetHidden(true); - rDocSh.Broadcast( SfxHint( SfxHintId::ScShowRangeFinder ) ); // Steal + pDocSh->Broadcast( SfxHint( SfxHintId::ScShowRangeFinder ) ); // Steal pRangeFindList.reset(); } } @@ -925,7 +925,7 @@ void ScInputHandler::ImplCreateEditEngine() // we cannot create a properly initialised EditEngine until we have a document assert( pActiveViewSh ); - ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell().GetDocument(); + ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument(); mpEditEngine = std::make_unique<ScFieldEditEngine>(&rDoc, rDoc.GetEnginePool(), rDoc.GetEditPool()); mpEditEngine->SetWordDelimiters( ScEditUtil::ModifyDelimiters( mpEditEngine->GetWordDelimiters() ) ); UpdateRefDevice(); // also sets MapMode @@ -1014,7 +1014,7 @@ void ScInputHandler::GetFormulaData() if ( !pActiveViewSh ) return; - ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell().GetDocument(); + ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument(); if ( pFormulaData ) pFormulaData->clear(); @@ -1130,9 +1130,9 @@ void ScInputHandler::ShowArgumentsTip( OUString& rSelText ) if ( !pActiveViewSh ) return; - ScDocShell& rDocSh = pActiveViewSh->GetViewData().GetDocShell(); + ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell(); const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep); - const sal_Unicode cSheetSep = rDocSh.GetDocument().GetSheetSeparator(); + const sal_Unicode cSheetSep = pDocSh->GetDocument().GetSheetSeparator(); FormulaHelper aHelper(ScGlobal::GetStarCalcFunctionMgr()); bool bFound = false; while( !bFound ) @@ -1861,7 +1861,7 @@ void ScTabViewShell::LOKSendFormulabarUpdate(const EditView* pActiveView, maSendFormulabarUpdate.m_nTimeStamp = now; ScViewData& rViewData = this->GetViewData(); - const ScDocument& rDoc = rViewData.GetDocShell().GetDocument(); + const ScDocument& rDoc = rViewData.GetDocShell()->GetDocument(); const ScPatternAttr* pPattern = rDoc.GetPattern(rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetRefTabNo()); if (pPattern) @@ -1957,7 +1957,7 @@ void ScInputHandler::FormulaPreview() OUString aPart = pActiveView->GetSelected(); if (aPart.isEmpty()) aPart = mpEditEngine->GetText(0); - ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell().GetDocument(); + ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument(); aValue = lcl_Calculate( aPart, rDoc, aCursorPos ); } @@ -2089,7 +2089,7 @@ void ScInputHandler::GetColData() if ( !pActiveViewSh ) return; - ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell().GetDocument(); + ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument(); if ( pColumnData ) pColumnData->clear(); @@ -2432,7 +2432,7 @@ void ScInputHandler::UpdateAdjust( sal_Unicode cTyped ) bNumber = (cTyped>='0' && cTyped<='9'); // Only ciphers are numbers else if ( pActiveViewSh ) { - ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell().GetDocument(); + ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument(); bNumber = ( rDoc.GetCellType( aCursorPos ) == CELLTYPE_VALUE ); } eSvxAdjust = bNumber ? SvxAdjust::Right : SvxAdjust::Left; @@ -2512,7 +2512,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn if (pActiveViewSh) { - ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell().GetDocument(); + ScDocument& rDoc = pActiveViewSh->GetViewData().GetDocShell()->GetDocument(); if (!rDoc.ValidCol(aCursorPos.Col())) return false; @@ -2540,7 +2540,7 @@ bool ScInputHandler::StartTable( sal_Unicode cTyped, bool bFromCommand, bool bIn // activation is requested (double-click or F2) or a click in input // line. bool bShowError = (!bInputActivated || !aTester.GetMessageId() || aTester.GetMessageId() != STR_PROTECTIONERR) && - !pActiveViewSh->GetViewData().GetDocShell().IsReadOnly(); + !pActiveViewSh->GetViewData().GetDocShell()->IsReadOnly(); if (bShowError) { eMode = SC_INPUT_NONE; @@ -3050,7 +3050,7 @@ void ScInputHandler::SetMode( ScInputMode eNewMode, const OUString* pInitText, S { if (StartTable(0, false, eMode == SC_INPUT_TABLE, pTopEngine)) { - pActiveViewSh->GetViewData().GetDocShell().PostEditView(*mpEditEngine, aCursorPos); + pActiveViewSh->GetViewData().GetDocShell()->PostEditView(*mpEditEngine, aCursorPos); } } @@ -3577,12 +3577,12 @@ void ScInputHandler::CancelHandler() } } -bool ScInputHandler::IsModalMode( const SfxObjectShell& rDocSh ) +bool ScInputHandler::IsModalMode( const SfxObjectShell* pDocSh ) { // References to unnamed document; that doesn't work return bFormulaMode && pRefViewSh - && pRefViewSh->GetViewData().GetDocument().GetDocumentShell() != &rDocSh - && !rDocSh.HasName(); + && pRefViewSh->GetViewData().GetDocument().GetDocumentShell() != pDocSh + && !pDocSh->HasName(); } void ScInputHandler::AddRefEntry() @@ -3966,7 +3966,7 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false if (bNewView ) // Create anew { if (pActiveViewSh) - pActiveViewSh->GetViewData().GetDocShell().PostEditView(*mpEditEngine, aCursorPos); + pActiveViewSh->GetViewData().GetDocShell()->PostEditView(*mpEditEngine, aCursorPos); UpdateActiveView(); if (eMode==SC_INPUT_NONE) if (pTableView || pTopView) @@ -4089,8 +4089,8 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false // right away at the start of the edit, so that the content is // saved even when the user leaves the document before hitting // Enter - if (comphelper::LibreOfficeKit::isActive() && bSetModified && pActiveViewSh && !pActiveViewSh->GetViewData().GetDocShell().IsModified()) - pActiveViewSh->GetViewData().GetDocShell().SetModified(); + if (comphelper::LibreOfficeKit::isActive() && bSetModified && pActiveViewSh && !pActiveViewSh->GetViewData().GetDocShell()->IsModified()) + pActiveViewSh->GetViewData().GetDocShell()->SetModified(); InvalidateAttribs(); //! in DataChanged? } @@ -4200,7 +4200,7 @@ void ScInputHandler::InputCommand( const CommandEvent& rCEvt ) { if (bNewView) // create new edit view { - pActiveViewSh->GetViewData().GetDocShell().PostEditView(*mpEditEngine, aCursorPos); + pActiveViewSh->GetViewData().GetDocShell()->PostEditView(*mpEditEngine, aCursorPos); UpdateActiveView(); if (eMode==SC_INPUT_NONE) if (pTableView || pTopView) @@ -4324,8 +4324,8 @@ void ScInputHandler::NotifyChange( const ScInputHdlState* pState, const EditTextObject* pData = pState->GetEditData(); OUString aString = pState->GetString(); bool bTxtMod = false; - ScDocShell& rDocSh = pActiveViewSh->GetViewData().GetDocShell(); - ScDocument& rDoc = rDocSh.GetDocument(); + ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell(); + ScDocument& rDoc = pDocSh->GetDocument(); aCursorPos = pState->GetPos(); @@ -4563,7 +4563,7 @@ void ScInputHandler::InputChanged( const EditView* pView, bool bFromNotify ) { ScViewData& rViewData = pActiveViewSh->GetViewData(); if ( bNewView ) - rViewData.GetDocShell().PostEditView(*mpEditEngine, aCursorPos); + rViewData.GetDocShell()->PostEditView(*mpEditEngine, aCursorPos); rViewData.EditGrowY(); rViewData.EditGrowX(); diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 315f190c5666..79f5f62e202d 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1534,7 +1534,7 @@ void ScTextWnd::InitEditEngine() ScDocShell* pDocSh = nullptr; if ( mpViewShell ) { - pDocSh = &mpViewShell->GetViewData().GetDocShell(); + pDocSh = mpViewShell->GetViewData().GetDocShell(); ScDocument& rDoc = mpViewShell->GetViewData().GetDocument(); pNew = std::make_unique<ScFieldEditEngine>(&rDoc, rDoc.GetEnginePool(), rDoc.GetEditPool()); } @@ -2603,8 +2603,8 @@ void ScPosWnd::DoEnter() if ( pViewSh ) { ScViewData& rViewData = pViewSh->GetViewData(); - ScDocShell& rDocShell = rViewData.GetDocShell(); - ScDocument& rDoc = rDocShell.GetDocument(); + ScDocShell* pDocShell = rViewData.GetDocShell(); + ScDocument& rDoc = pDocShell->GetDocument(); ScNameInputType eType = lcl_GetInputType( aText ); if ( eType == SC_NAME_INPUT_BAD_NAME || eType == SC_NAME_INPUT_BAD_SELECTION ) @@ -2625,7 +2625,7 @@ void ScPosWnd::DoEnter() ScRangeData* pNew = new ScRangeData( rDoc, aText, aContent, aCursor ); if ( aNewRanges.insert(pNew) ) { - rDocShell.GetDocFunc().ModifyRangeNames( aNewRanges ); + pDocShell->GetDocFunc().ModifyRangeNames( aNewRanges ); pViewSh->UpdateInputHandler(true); } } diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index a4b22c473b76..bfca56475ba6 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -1662,14 +1662,14 @@ bool ScModule::IsModalMode(SfxObjectShell* pDocSh) // in LOK case when no ChildWindow for this view was detected -> fallback ScInputHandler* pHdl = GetInputHdl(); if ( pHdl ) - bIsModal = pHdl->IsModalMode(*pDocSh); + bIsModal = pHdl->IsModalMode(pDocSh); } } else if (pDocSh) { ScInputHandler* pHdl = GetInputHdl(); if ( pHdl ) - bIsModal = pHdl->IsModalMode(*pDocSh); + bIsModal = pHdl->IsModalMode(pDocSh); } return bIsModal; diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx index 94275e8771cc..1382b769c1ca 100644 --- a/sc/source/ui/app/seltrans.cxx +++ b/sc/source/ui/app/seltrans.cxx @@ -262,11 +262,11 @@ void ScSelectionTransferObj::CreateCellData() // similar to ScViewFunctionSet::BeginDrag if ( aNewMark.IsMarked() && !aNewMark.IsMultiMarked() ) { - ScDocShell& rDocSh = rViewData.GetDocShell(); + ScDocShell* pDocSh = rViewData.GetDocShell(); const ScRange& aSelRange = aNewMark.GetMarkArea(); ScDocShellRef aDragShellRef; - if ( rDocSh.GetDocument().HasOLEObjectsInArea( aSelRange, &aNewMark ) ) + if ( pDocSh->GetDocument().HasOLEObjectsInArea( aSelRange, &aNewMark ) ) { aDragShellRef = new ScDocShell; // DocShell needs a Ref immediately aDragShellRef->DoInitNew(); @@ -284,8 +284,8 @@ void ScSelectionTransferObj::CreateCellData() if ( bCopied ) { TransferableObjectDescriptor aObjDesc; - rDocSh.FillTransferableObjectDescriptor( aObjDesc ); - aObjDesc.maDisplayName = rDocSh.GetMedium()->GetURLObject().GetURLNoPass(); + pDocSh->FillTransferableObjectDescriptor( aObjDesc ); + aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass(); // maSize is set in ScTransferObj ctor rtl::Reference<ScTransferObj> xTransferObj = new ScTransferObj( std::move(pClipDoc), std::move(aObjDesc) ); @@ -295,7 +295,7 @@ void ScSelectionTransferObj::CreateCellData() xTransferObj->SetDrawPersist(aDragShellRef); // keep persist for ole objects alive - xTransferObj->SetDragSource( &rDocSh, aNewMark ); + xTransferObj->SetDragSource( pDocSh, aNewMark ); mxCellData = std::move(xTransferObj); } @@ -330,14 +330,14 @@ void ScSelectionTransferObj::CreateDrawData() ScDrawLayer::SetGlobalDrawPersist(nullptr); ScViewData& rViewData = pView->GetViewData(); - ScDocShell& rDocSh = rViewData.GetDocShell(); + ScDocShell* pDocSh = rViewData.GetDocShell(); TransferableObjectDescriptor aObjDesc; - rDocSh.FillTransferableObjectDescriptor( aObjDesc ); - aObjDesc.maDisplayName = rDocSh.GetMedium()->GetURLObject().GetURLNoPass(); + pDocSh->FillTransferableObjectDescriptor( aObjDesc ); + aObjDesc.maDisplayName = pDocSh->GetMedium()->GetURLObject().GetURLNoPass(); // maSize is set in ScDrawTransferObj ctor - rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( std::move(pModel), rDocSh, std::move(aObjDesc) ); + rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( std::move(pModel), *pDocSh, std::move(aObjDesc) ); pTransferObj->SetDrawPersist(aDragShellRef); // keep persist for ole objects alive pTransferObj->SetDragSource( pDrawView ); // copies selection diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index fa451562b077..9ed376dd7f35 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -100,9 +100,6 @@ void ScTransferObj::GetAreaSize( const ScDocument& rDoc, SCTAB nTab1, SCTAB nTab void ScTransferObj::PaintToDev( OutputDevice* pDev, ScDocument& rDoc, double nPrintFactor, const ScRange& rBlock ) { - if (!rDoc.GetDocumentShell()) - return; - tools::Rectangle aBound( Point(), pDev->GetOutputSize() ); //! use size from clip area? ScViewData aViewData(rDoc); diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 8c8000c712c6..c10f514144cf 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -625,11 +625,11 @@ void ScCondFormatDlg::OkPressed() if(pFormat) { auto& rRangeList = pFormat->GetRange(); - mrViewData.GetDocShell().GetDocFunc().ReplaceConditionalFormat(mnKey, + mrViewData.GetDocShell()->GetDocFunc().ReplaceConditionalFormat(mnKey, std::move(pFormat), maPos.Tab(), rRangeList); } else - mrViewData.GetDocShell().GetDocFunc().ReplaceConditionalFormat(mnKey, + mrViewData.GetDocShell()->GetDocFunc().ReplaceConditionalFormat(mnKey, nullptr, maPos.Tab(), ScRangeList()); } else diff --git a/sc/source/ui/condformat/condformateasydlg.cxx b/sc/source/ui/condformat/condformateasydlg.cxx index 78bec5d75f58..208ae7f110c5 100644 --- a/sc/source/ui/condformat/condformateasydlg.cxx +++ b/sc/source/ui/condformat/condformateasydlg.cxx @@ -270,7 +270,7 @@ IMPL_LINK(ConditionalFormatEasyDialog, ButtonPressed, weld::Button&, rButton, vo pFormat->AddEntry(pEntry.release()); pFormat->SetRange(aRange); auto& rRangeList = pFormat->GetRange(); - mrViewData.GetDocShell().GetDocFunc().ReplaceConditionalFormat( + mrViewData.GetDocShell()->GetDocFunc().ReplaceConditionalFormat( 0, std::move(pFormat), maPosition.Tab(), rRangeList); } m_xDialog->response(RET_OK); diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx index e7ec2f9e5bb4..d91343f925f9 100644 --- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx +++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx @@ -506,7 +506,7 @@ void ScPivotLayoutDialog::ApplyChanges() } if (pDPObj) { - ScDBDocFunc aFunc( mrViewData.GetDocShell() ); + ScDBDocFunc aFunc( *(mrViewData.GetDocShell() )); aFunc.RemovePivotTable( *pDPObj, true, false); mrViewData.GetView()->CursorPosChanged(); } diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx index c0d681382688..3b05ca1b371e 100644 --- a/sc/source/ui/dbgui/dbnamdlg.cxx +++ b/sc/source/ui/dbgui/dbnamdlg.cxx @@ -376,7 +376,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, OkBtnHdl, weld::Button&, void) // be created at this point: if (!bInvalid) { - ScDBDocFunc aFunc(m_rViewData.GetDocShell()); + ScDBDocFunc aFunc(*m_rViewData.GetDocShell()); aFunc.ModifyAllDBData(aLocalDbCol, aRemoveList); response(RET_OK); } diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index d5f6f3d090c6..67d8850f8005 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -399,7 +399,7 @@ void ScFilterDlg::Init() void ScFilterDlg::Close() { - rViewData.GetDocShell().CancelAutoDBRange(); + rViewData.GetDocShell()->CancelAutoDBRange(); DoClose( ScFilterDlgWrapper::GetChildWindowId() ); } diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx index 9df10b9d9003..f2b1225e38e8 100644 --- a/sc/source/ui/dbgui/sfiltdlg.cxx +++ b/sc/source/ui/dbgui/sfiltdlg.cxx @@ -178,7 +178,7 @@ void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet ) void ScSpecialFilterDlg::Close() { - rViewData.GetDocShell().CancelAutoDBRange(); + rViewData.GetDocShell()->CancelAutoDBRange(); DoClose( ScSpecialFilterDlgWrapper::GetChildWindowId() ); } diff --git a/sc/source/ui/dialogs/SparklineDataRangeDialog.cxx b/sc/source/ui/dialogs/SparklineDataRangeDialog.cxx index 9f59d8aced38..607f5624072b 100644 --- a/sc/source/ui/dialogs/SparklineDataRangeDialog.cxx +++ b/sc/source/ui/dialogs/SparklineDataRangeDialog.cxx @@ -193,7 +193,7 @@ void SparklineDataRangeDialog::perform() { ScRangeList aList{ maDataRange }; - auto& rDocFunc = mrViewData.GetDocShell().GetDocFunc(); + auto& rDocFunc = mrViewData.GetDocShell()->GetDocFunc(); rDocFunc.ChangeSparkline(mpSparkline, mrViewData.GetTabNo(), aList); } diff --git a/sc/source/ui/dialogs/SparklineDialog.cxx b/sc/source/ui/dialogs/SparklineDialog.cxx index 5ce8d2f6c3da..ad092b6659e2 100644 --- a/sc/source/ui/dialogs/SparklineDialog.cxx +++ b/sc/source/ui/dialogs/SparklineDialog.cxx @@ -534,7 +534,7 @@ void SparklineDialog::perform() maAttributes.setColorFirst(mxColorFirst->GetSelectedEntry().getComplexColor()); maAttributes.setColorLast(mxColorLast->GetSelectedEntry().getComplexColor()); - auto& rDocFunc = mrViewData.GetDocShell().GetDocFunc(); + auto& rDocFunc = mrViewData.GetDocShell()->GetDocFunc(); if (mpSparklineGroup) { diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index d5444001390f..44ec675b1246 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1150,7 +1150,7 @@ bool ScDocFunc::SetFormulaCells( const ScAddress& rPos, std::vector<ScFormulaCel void ScDocFunc::NotifyInputHandler( const ScAddress& rPos ) { ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell(); - if ( !(pViewSh && &pViewSh->GetViewData().GetDocShell() == &rDocShell) ) + if ( !(pViewSh && pViewSh->GetViewData().GetDocShell() == &rDocShell) ) return; ScInputHandler* pInputHdl = ScModule::get()->GetInputHdl(); diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index c0fe9740f0e0..47ac98459ffc 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -249,7 +249,7 @@ std::shared_ptr<model::ColorSet> ScDocShell::GetThemeColors() void ScDocShell::DoEnterHandler() { ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell(); - if (pViewSh && &pViewSh->GetViewData().GetDocShell() == this) + if (pViewSh && pViewSh->GetViewData().GetDocShell() == this) ScModule::get()->InputEnterHandler(); } diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 3583984ec4ea..701240a7b553 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -83,7 +83,7 @@ void ScDocShell::PostEditView( ScEditEngineDefaulter& rEditEngine, const ScAddre // Test: only active ViewShell ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell(); - if (pViewSh && &pViewSh->GetViewData().GetDocShell() == this) + if (pViewSh && pViewSh->GetViewData().GetDocShell() == this) { ScEditViewHint aHint(rEditEngine, rCursorPos); pViewSh->Notify( *this, aHint ); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 230327f357d3..db07a6b93cbf 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2824,7 +2824,7 @@ ScTabViewShell* ScDocShell::GetBestViewShell( bool bOnlyVisible ) { ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell(); // wrong Doc? - if( pViewSh && &pViewSh->GetViewData().GetDocShell() != this ) + if( pViewSh && pViewSh->GetViewData().GetDocShell() != this ) pViewSh = nullptr; if( !pViewSh ) { diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 1a06ccdbf17c..23c86bcd089c 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -124,7 +124,7 @@ void ScDocShell::SetVisAreaOrSize( const tools::Rectangle& rVisArea ) ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell(); if (pViewSh) { - if (&pViewSh->GetViewData().GetDocShell() == this) + if (pViewSh->GetViewData().GetDocShell() == this) pViewSh->UpdateOleZoom(); } } diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index d931e01c5d61..02dac4f20886 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -1493,8 +1493,8 @@ void ScExternalRefLink::Closed() if (!pViewData) return ERROR_GENERAL; - ScDocShell& rDocShell = pViewData->GetDocShell(); - ScDocShellModificator aMod(rDocShell); + ScDocShell* pDocShell = pViewData->GetDocShell(); + ScDocShellModificator aMod(*pDocShell); pMgr->switchSrcFile(mnFileId, aFile, aFilter); aMod.SetDocumentModified(); } diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx index 4bf32a50815d..579b55a63f23 100644 --- a/sc/source/ui/drawfunc/drawsh2.cxx +++ b/sc/source/ui/drawfunc/drawsh2.cxx @@ -70,7 +70,7 @@ ScDrawShell::ScDrawShell( ScViewData& rData ) : pFrame->GetFrame().GetController(), vcl::EnumContext::Context::Cell); SetPool( &rViewData.GetScDrawView()->GetModel().GetItemPool() ); - SfxUndoManager* pMgr = rViewData.GetSfxDocShell().GetUndoManager(); + SfxUndoManager* pMgr = rViewData.GetSfxDocShell()->GetUndoManager(); SetUndoManager( pMgr ); if ( !rViewData.GetDocument().IsUndoEnabled() ) { diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index 1cdb33ee05fe..f16dcb308c80 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -183,7 +183,7 @@ void ScDrawShell::ExecuteHLink( const SfxRequest& rReq ) xPropSet->setPropertyValue( sPropLabel, uno::Any(rName) ); } - OUString aTmp = INetURLObject::GetAbsURL( rViewData.GetDocShell().GetMedium()->GetBaseURL(), rURL ); + OUString aTmp = INetURLObject::GetAbsURL( rViewData.GetDocShell()->GetMedium()->GetBaseURL(), rURL ); xPropSet->setPropertyValue( sPropTargetURL, uno::Any(aTmp) ); if( !rTarget.isEmpty() && xInfo->hasPropertyByName( sPropTargetFrame ) ) @@ -197,7 +197,7 @@ void ScDrawShell::ExecuteHLink( const SfxRequest& rReq ) } //! Undo ??? - rViewData.GetDocShell().SetDocumentModified(); + rViewData.GetDocShell()->SetDocumentModified(); bDone = true; } } @@ -514,7 +514,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) { if (nResult == RET_OK) { - ScDocShell& rDocSh = rViewData.GetDocShell(); + ScDocShell* pDocSh = rViewData.GetDocShell(); OUString aNewName = pDlg->GetName(); if (aNewName != pSelected->GetName()) @@ -543,8 +543,8 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) if(!aPersistName.isEmpty()) { - rDocSh.GetUndoManager()->AddUndoAction( - std::make_unique<ScUndoRenameObject>(rDocSh, aPersistName, pSelected->GetName(), aNewName)); + pDocSh->GetUndoManager()->AddUndoAction( + std::make_unique<ScUndoRenameObject>(*pDocSh, aPersistName, pSelected->GetName(), aNewName)); } } @@ -553,8 +553,8 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) } // ChartListenerCollectionNeedsUpdate is needed for Navigator update - rDocSh.GetDocument().SetChartListenerCollectionNeedsUpdate( true ); - rDocSh.SetDrawModified(); + pDocSh->GetDocument().SetChartListenerCollectionNeedsUpdate( true ); + pDocSh->SetDrawModified(); } pDlg->disposeOnce(); } @@ -589,7 +589,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) { if (nResult == RET_OK) { - ScDocShell& rDocSh = rViewData.GetDocShell(); + ScDocShell* pDocSh = rViewData.GetDocShell(); // handle Title and Description pSelected->SetTitle(pDlg->GetTitle()); @@ -597,8 +597,8 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) pSelected->SetDecorative(pDlg->IsDecorative()); // ChartListenerCollectionNeedsUpdate is needed for Navigator update - rDocSh.GetDocument().SetChartListenerCollectionNeedsUpdate( true ); - rDocSh.SetDrawModified(); + pDocSh->GetDocument().SetChartListenerCollectionNeedsUpdate( true ); + pDocSh->SetDrawModified(); } pDlg->disposeOnce(); } diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 0b416b6b1bb4..9a25b43753bd 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -119,7 +119,7 @@ ScDrawTextObjectBar::ScDrawTextObjectBar(ScViewData& rData) : SetPool( mrViewData.GetScDrawView()->GetDefaultAttr().GetPool() ); // At the switching-over the UndoManager is changed to edit mode - SfxUndoManager* pMgr = mrViewData.GetSfxDocShell().GetUndoManager(); + SfxUndoManager* pMgr = mrViewData.GetSfxDocShell()->GetUndoManager(); SetUndoManager( pMgr ); if ( !mrViewData.GetDocument().IsUndoEnabled() ) { @@ -924,7 +924,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) { const sal_uInt16 nEEWhich = GetPool().GetWhichIDFromSlotID(nSlot); const std::optional<NamedColor> oColor - = mrViewData.GetDocShell().GetRecentColor(nSlot); + = mrViewData.GetDocShell()->GetRecentColor(nSlot); if (oColor.has_value()) { const model::ComplexColor aCol = (*oColor).getComplexColor(); diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx index 4f5727918d44..69cab28cfc6f 100644 --- a/sc/source/ui/drawfunc/drtxtob1.cxx +++ b/sc/source/ui/drawfunc/drtxtob1.cxx @@ -43,7 +43,7 @@ bool ScDrawTextObjectBar::ExecuteCharDlg( const SfxItemSet& rArgs, ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScCharDlg( mrViewData.GetDialogParent(), &rArgs, - &mrViewData.GetSfxDocShell(), true)); + mrViewData.GetSfxDocShell(), true)); if (nSlot == SID_CHAR_DLG_EFFECT) { pDlg->SetCurPageId(u"fonteffects"_ustr); diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index e352fce10c89..fdfd25cfbd75 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -434,7 +434,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) nY = 0; } - bool bReadOnly = rViewData.GetDocShell().IsReadOnly(); + bool bReadOnly = rViewData.GetDocShell()->IsReadOnly(); if(!rKEvt.GetKeyCode().IsMod1() && !bReadOnly) { diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index cec343f4bc60..b5c00aa00d90 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -83,8 +83,8 @@ namespace void lcl_ChartInit(const uno::Reference <embed::XEmbeddedObject>& xObj, ScViewData* pViewData, const OUString& rRangeParam, bool bRangeIsPivotTable) { - ScDocShell& rDocShell = pViewData->GetDocShell(); - ScDocument& rScDoc = rDocShell.GetDocument(); + ScDocShell* pDocShell = pViewData->GetDocShell(); + ScDocument& rScDoc = pDocShell->GetDocument(); OUString aRangeString(rRangeParam); @@ -142,7 +142,7 @@ void lcl_ChartInit(const uno::Reference <embed::XEmbeddedObject>& xObj, ScViewDa xReceiver->attachDataProvider(xDataProvider); - uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( getXWeak(rDocShell.GetModel()), uno::UNO_QUERY ); + uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( getXWeak(pDocShell->GetModel()), uno::UNO_QUERY ); xReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier ); // Same behavior as with old chart: Always assume data series in columns @@ -524,8 +524,8 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV } ScViewData& rData = rViewSh.GetViewData(); - ScDocShell& rScDocSh = rData.GetDocShell(); - ScDocument& rScDoc = rScDocSh.GetDocument(); + ScDocShell* pScDocSh = rData.GetDocShell(); + ScDocument& rScDoc = pScDocSh->GetDocument(); bool bUndo (rScDoc.IsUndoEnabled()); if( pReqArgs ) @@ -566,14 +566,14 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV { if (bUndo) { - rScDocSh.GetUndoManager()->AddUndoAction( - std::make_unique<ScUndoInsertTab>( rScDocSh, nNewTab, + pScDocSh->GetUndoManager()->AddUndoAction( + std::make_unique<ScUndoInsertTab>( *pScDocSh, nNewTab, true/*bAppend*/, aTabName ) ); } - rScDocSh.Broadcast( ScTablesHint( SC_TAB_INSERTED, nNewTab ) ); + pScDocSh->Broadcast( ScTablesHint( SC_TAB_INSERTED, nNewTab ) ); rViewSh.SetTabNo( nNewTab, true ); - rScDocSh.PostPaintExtras(); //! done afterwards ??? + pScDocSh->PostPaintExtras(); //! done afterwards ??? } else { diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx index d6b95662c2d4..92da2fbd24d4 100644 --- a/sc/source/ui/drawfunc/fusel.cxx +++ b/sc/source/ui/drawfunc/fusel.cxx @@ -543,8 +543,8 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) if ( bCopy && pPage ) { - ScDocShell& rDocShell = rViewData.GetDocShell(); - ScModelObj* pModelObj = rDocShell.GetModel(); + ScDocShell* pDocShell = rViewData.GetDocShell(); + ScModelObj* pModelObj = ( pDocShell ? pDocShell->GetModel() : nullptr ); if ( pModelObj ) { SCTAB nTab = rViewData.GetTabNo(); diff --git a/sc/source/ui/drawfunc/fusel2.cxx b/sc/source/ui/drawfunc/fusel2.cxx index 7dc045256f9b..cc9a1478ceb4 100644 --- a/sc/source/ui/drawfunc/fusel2.cxx +++ b/sc/source/ui/drawfunc/fusel2.cxx @@ -121,8 +121,8 @@ bool FuSelection::IsNoteCaptionClicked( const Point& rPos ) const const ScViewData& rViewData = rViewShell.GetViewData(); ScDocument& rDoc = rViewData.GetDocument(); SCTAB nTab = rViewData.GetTabNo(); - ScDocShell& rDocSh = rViewData.GetDocShell(); - bool bProtectDoc = rDoc.IsTabProtected( nTab ) || rDocSh.IsReadOnly(); + ScDocShell* pDocSh = rViewData.GetDocShell(); + bool bProtectDoc = rDoc.IsTabProtected( nTab ) || (pDocSh && pDocSh->IsReadOnly()); // search the last object (on top) in the object list SdrObjListIter aIter( pPageView->GetObjList(), SdrIterMode::DeepNoGroups, true ); diff --git a/sc/source/ui/drawfunc/futext3.cxx b/sc/source/ui/drawfunc/futext3.cxx index 999ade29e55c..1de6900e4320 100644 --- a/sc/source/ui/drawfunc/futext3.cxx +++ b/sc/source/ui/drawfunc/futext3.cxx @@ -62,8 +62,8 @@ void FuText::StopEditMode() OSL_ENSURE( pNote && (pNote->GetCaption() == pObject), "FuText::StopEditMode - missing or invalid cell note" ); } - ScDocShell& rDocShell = rViewData.GetDocShell(); - SfxUndoManager* pUndoMgr = rDoc.IsUndoEnabled() ? rDocShell.GetUndoManager() : nullptr; + ScDocShell* pDocShell = rViewData.GetDocShell(); + SfxUndoManager* pUndoMgr = rDoc.IsUndoEnabled() ? pDocShell->GetUndoManager() : nullptr; if (pUndoMgr && !pUndoMgr->GetMaxUndoActionCount()) // tdf#134308 if max undo is 0, treat as if no undo pUndoMgr = nullptr; bool bNewNote = false; @@ -85,7 +85,7 @@ void FuText::StopEditMode() // create a "insert note" undo action if needed if( bNewNote ) - pUndoMgr->AddUndoAction( std::make_unique<ScUndoReplaceNote>( rDocShell, aNotePos, pNote->GetNoteData(), true, std::move(pCalcUndo) ) ); + pUndoMgr->AddUndoAction( std::make_unique<ScUndoReplaceNote>( *pDocShell, aNotePos, pNote->GetNoteData(), true, std::move(pCalcUndo) ) ); else pUndoMgr->AddUndoAction( std::move(pCalcUndo) ); } @@ -139,7 +139,7 @@ void FuText::StopEditMode() // delete note from document (removes caption, but does not delete it) rDoc.ReleaseNote(aNotePos); // create undo action for removed note - pUndoMgr->AddUndoAction( std::make_unique<ScUndoReplaceNote>( rDocShell, aNotePos, aNoteData, false, pDrawLayer->GetCalcUndo() ) ); + pUndoMgr->AddUndoAction( std::make_unique<ScUndoReplaceNote>( *pDocShell, aNotePos, aNoteData, false, pDrawLayer->GetCalcUndo() ) ); } else { diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 826facdf49c7..a07712a3ba52 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -120,7 +120,7 @@ ScFormulaDlg::ScFormulaDlg(SfxBindings* pB, SfxChildWindow* pCW, SCTAB nTab = rViewData.GetTabNo(); m_CursorPos = ScAddress( nCol, nRow, nTab ); - m_pViewShell->InitFormEditData(rViewData.GetDocShell()); // create new + m_pViewShell->InitFormEditData(*rViewData.GetDocShell()); // create new pData = m_pViewShell->GetFormEditData(); pData->SetInputHandler(pInputHdl); diff --git a/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx b/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx index b620db2929ce..35c53e72778f 100644 --- a/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx +++ b/sc/source/ui/inc/AnalysisOfVarianceDialog.hxx @@ -55,7 +55,7 @@ public: protected: virtual TranslateId GetUndoNameId() override; - virtual ScRange ApplyOutput(ScDocShell& rDocShell) override; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/ChiSquareTestDialog.hxx b/sc/source/ui/inc/ChiSquareTestDialog.hxx index 4813ae207327..20e7d696c95f 100644 --- a/sc/source/ui/inc/ChiSquareTestDialog.hxx +++ b/sc/source/ui/inc/ChiSquareTestDialog.hxx @@ -25,7 +25,7 @@ public: protected: virtual TranslateId GetUndoNameId() override; - virtual ScRange ApplyOutput(ScDocShell& rDocShell) override; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/DescriptiveStatisticsDialog.hxx b/sc/source/ui/inc/DescriptiveStatisticsDialog.hxx index 1cf80291fa7d..dd2488450beb 100644 --- a/sc/source/ui/inc/DescriptiveStatisticsDialog.hxx +++ b/sc/source/ui/inc/DescriptiveStatisticsDialog.hxx @@ -25,7 +25,7 @@ public: protected: virtual TranslateId GetUndoNameId() override; - virtual ScRange ApplyOutput(ScDocShell& rDocShell) override; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/ExponentialSmoothingDialog.hxx b/sc/source/ui/inc/ExponentialSmoothingDialog.hxx index ceb16891a572..54b877167805 100644 --- a/sc/source/ui/inc/ExponentialSmoothingDialog.hxx +++ b/sc/source/ui/inc/ExponentialSmoothingDialog.hxx @@ -31,7 +31,7 @@ public: protected: virtual TranslateId GetUndoNameId() override; - virtual ScRange ApplyOutput(ScDocShell& rDocShell) override; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/FTestDialog.hxx b/sc/source/ui/inc/FTestDialog.hxx index 71fb8dcd28b1..efd477ce08bb 100644 --- a/sc/source/ui/inc/FTestDialog.hxx +++ b/sc/source/ui/inc/FTestDialog.hxx @@ -25,7 +25,7 @@ public: protected: virtual TranslateId GetUndoNameId() override; - virtual ScRange ApplyOutput(ScDocShell& rDocShell) override; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/FourierAnalysisDialog.hxx b/sc/source/ui/inc/FourierAnalysisDialog.hxx index 1427a27c472d..f839b274e4d8 100644 --- a/sc/source/ui/inc/FourierAnalysisDialog.hxx +++ b/sc/source/ui/inc/FourierAnalysisDialog.hxx @@ -42,7 +42,7 @@ public: protected: virtual TranslateId GetUndoNameId() override; - virtual ScRange ApplyOutput(ScDocShell& rDocShell) override; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) override; virtual bool InputRangesValid() override; private: diff --git a/sc/source/ui/inc/MatrixComparisonGenerator.hxx b/sc/source/ui/inc/MatrixComparisonGenerator.hxx index c38f9dd24b6b..ab1e51d7a9b4 100644 --- a/sc/source/ui/inc/MatrixComparisonGenerator.hxx +++ b/sc/source/ui/inc/MatrixComparisonGenerator.hxx @@ -27,7 +27,7 @@ public: protected: virtual TranslateId GetUndoNameId() override; - virtual ScRange ApplyOutput(ScDocShell& rDocShell) override; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) override; virtual OUString getLabel() = 0; virtual OUString getTemplate() = 0; diff --git a/sc/source/ui/inc/MovingAverageDialog.hxx b/sc/source/ui/inc/MovingAverageDialog.hxx index 08f400b709c7..216b67c8b400 100644 --- a/sc/source/ui/inc/MovingAverageDialog.hxx +++ b/sc/source/ui/inc/MovingAverageDialog.hxx @@ -32,7 +32,7 @@ public: protected: virtual TranslateId GetUndoNameId() override; - virtual ScRange ApplyOutput(ScDocShell& rDocShell) override; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/RegressionDialog.hxx b/sc/source/ui/inc/RegressionDialog.hxx index 38f98a1a261d..f3783c36c91d 100644 --- a/sc/source/ui/inc/RegressionDialog.hxx +++ b/sc/source/ui/inc/RegressionDialog.hxx @@ -40,7 +40,7 @@ public: protected: virtual TranslateId GetUndoNameId() override; - virtual ScRange ApplyOutput(ScDocShell& rDocShell) override; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) override; virtual bool InputRangesValid() override; private: diff --git a/sc/source/ui/inc/SamplingDialog.hxx b/sc/source/ui/inc/SamplingDialog.hxx index b9f8c3aa1f36..e561092a80f1 100644 --- a/sc/source/ui/inc/SamplingDialog.hxx +++ b/sc/source/ui/inc/SamplingDialog.hxx @@ -71,9 +71,9 @@ private: sal_Int64 GetPopulationSize() const; void LimitSampleSizeAndPeriod(); - ScRange PerformRandomSampling(ScDocShell& rDocShell); - ScRange PerformRandomSamplingKeepOrder(ScDocShell& rDocShell); - ScRange PerformPeriodicSampling(ScDocShell& rDocShell); + ScRange PerformRandomSampling(ScDocShell* pDocShell); + ScRange PerformRandomSamplingKeepOrder(ScDocShell* pDocShell); + ScRange PerformPeriodicSampling(ScDocShell* pDocShell); DECL_LINK( ButtonClicked, weld::Button&, void ); DECL_LINK( GetEditFocusHandler, formula::RefEdit&, void ); diff --git a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx index ca596ae12e8a..e831772c8451 100644 --- a/sc/source/ui/inc/StatisticsInputOutputDialog.hxx +++ b/sc/source/ui/inc/StatisticsInputOutputDialog.hxx @@ -36,7 +36,7 @@ public: protected: void CalculateInputAndWriteToOutput(); - virtual ScRange ApplyOutput(ScDocShell& rDocShell) = 0; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) = 0; virtual TranslateId GetUndoNameId() = 0; virtual bool InputRangesValid(); void ValidateDialogInput(); diff --git a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx index dde63e9c8ced..150a57420913 100644 --- a/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx +++ b/sc/source/ui/inc/StatisticsTwoVariableDialog.hxx @@ -35,7 +35,7 @@ public: protected: void CalculateInputAndWriteToOutput(); - virtual ScRange ApplyOutput(ScDocShell& rDocShell) = 0; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) = 0; virtual TranslateId GetUndoNameId() = 0; virtual bool InputRangesValid(); void ValidateDialogInput(); diff --git a/sc/source/ui/inc/TTestDialog.hxx b/sc/source/ui/inc/TTestDialog.hxx index 234054ec6ba3..0ed370dce2d4 100644 --- a/sc/source/ui/inc/TTestDialog.hxx +++ b/sc/source/ui/inc/TTestDialog.hxx @@ -25,7 +25,7 @@ public: protected: virtual TranslateId GetUndoNameId() override; - virtual ScRange ApplyOutput(ScDocShell& rDocShell) override; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx index 4171d413fb90..0e678e3f4482 100644 --- a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx +++ b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx @@ -71,12 +71,12 @@ public: class AddressWalkerWriter : public AddressWalker { - ScDocShell& mrDocShell; + ScDocShell* mpDocShell; ScDocument& mrDocument; formula::FormulaGrammar::Grammar meGrammar; public: - AddressWalkerWriter(const ScAddress& aInitialAddress, ScDocShell& rDocShell, ScDocument& rDocument, + AddressWalkerWriter(const ScAddress& aInitialAddress, ScDocShell* pDocShell, ScDocument& rDocument, formula::FormulaGrammar::Grammar eGrammar ); void writeFormula(const OUString& aFormula); diff --git a/sc/source/ui/inc/ZTestDialog.hxx b/sc/source/ui/inc/ZTestDialog.hxx index d0a19c657cc9..2476c38f32a7 100644 --- a/sc/source/ui/inc/ZTestDialog.hxx +++ b/sc/source/ui/inc/ZTestDialog.hxx @@ -25,7 +25,7 @@ public: protected: virtual TranslateId GetUndoNameId() override; - virtual ScRange ApplyOutput(ScDocShell& rDocShell) override; + virtual ScRange ApplyOutput(ScDocShell* pDocShell) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/datastreamdlg.hxx b/sc/source/ui/inc/datastreamdlg.hxx index 5d15d4a25cd5..5f1f7eec49e8 100644 --- a/sc/source/ui/inc/datastreamdlg.hxx +++ b/sc/source/ui/inc/datastreamdlg.hxx @@ -23,7 +23,7 @@ class DataStream; class DataStreamDlg : public weld::GenericDialogController { - ScDocShell& m_rDocShell; + ScDocShell* m_pDocShell; std::unique_ptr<SvtURLBox> m_xCbUrl; std::unique_ptr<weld::Button> m_xBtnBrowse; @@ -50,7 +50,7 @@ class DataStreamDlg : public weld::GenericDialogController ScRange GetStartRange(); public: - DataStreamDlg(ScDocShell& rDocShell, weld::Window* pParent); + DataStreamDlg(ScDocShell* pDocShell, weld::Window* pParent); virtual ~DataStreamDlg() override; void Init(const DataStream& rStrm); diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx index 0f8ff07e31db..26d03efd39b6 100644 --- a/sc/source/ui/inc/inputhdl.hxx +++ b/sc/source/ui/inc/inputhdl.hxx @@ -272,7 +272,7 @@ public: /// Returns true if there is a partial autocomplete suggestion. bool HasPartialComplete() const { return mbPartialPrefix; }; - bool IsModalMode( const SfxObjectShell& rDocSh ); + bool IsModalMode( const SfxObjectShell* pDocSh ); void ForgetLastPattern(); @@ -291,7 +291,7 @@ public: void SetDocumentDisposing( bool b ); - static ReferenceMark GetReferenceMark( const ScViewData& rViewData, ScDocShell& rDocSh, + static ReferenceMark GetReferenceMark( const ScViewData& rViewData, ScDocShell* pDocSh, tools::Long nX1, tools::Long nX2, tools::Long nY1, tools::Long nY2, tools::Long nTab, const Color& rColor ); diff --git a/sc/source/ui/inc/namedefdlg.hxx b/sc/source/ui/inc/namedefdlg.hxx index 0007a3322768..63afb02645e3 100644 --- a/sc/source/ui/inc/namedefdlg.hxx +++ b/sc/source/ui/inc/namedefdlg.hxx @@ -23,7 +23,7 @@ class ScNameDefDlg : public ScAnyRefDlgController private: bool mbUndo; //if true we need to add an undo action after creating a range name ScDocument& mrDoc; - ScDocShell& mrDocShell; + ScDocShell* mpDocShell; ScAddress maCursorPos; OUString maStrInfoDefault; diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx index a26c63b26bff..35570f7d09d4 100644 --- a/sc/source/ui/inc/optsolver.hxx +++ b/sc/source/ui/inc/optsolver.hxx @@ -52,7 +52,7 @@ class ScOptSolverDlg : public ScAnyRefDlgController { public: ScOptSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent, - ScDocShell& rDocSh, const ScAddress& aCursorPos ); + ScDocShell* pDocSh, const ScAddress& aCursorPos ); virtual ~ScOptSolverDlg() override; virtual void SetReference( const ScRange& rRef, ScDocument& rDoc ) override; @@ -64,7 +64,7 @@ private: OUString maInputError; OUString maConditionError; - ScDocShell& mrDocShell; + ScDocShell* mpDocShell; ScDocument& mrDoc; const SCTAB mnCurTab; bool mbDlgLostFocus; diff --git a/sc/source/ui/inc/sharedocdlg.hxx b/sc/source/ui/inc/sharedocdlg.hxx index 967e15e98759..ba83b1787b84 100644 --- a/sc/source/ui/inc/sharedocdlg.hxx +++ b/sc/source/ui/inc/sharedocdlg.hxx @@ -32,7 +32,7 @@ private: OUString m_aStrUnknownUser; OUString m_aStrExclusiveAccess; - ScDocShell& mrDocShell; + ScDocShell* mpDocShell; std::unique_ptr<weld::CheckButton> m_xCbShare; std::unique_ptr<weld::Label> m_xFtWarning; diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 1dcc8453cf57..ead20715b29b 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -275,7 +275,7 @@ private: ScMarkData maMarkData; ScMarkData maHighlightData; ScViewDataTable* pThisTab; // Data of the displayed sheet - ScDocShell& mrDocShell; + ScDocShell* pDocShell; ScDocument& mrDoc; ScTabViewShell* pView; std::unique_ptr<EditView> pEditView[4]; // Belongs to the window @@ -353,11 +353,11 @@ public: ScViewData( ScDocument& rDoc ); ~ScViewData() COVERITY_NOEXCEPT_FALSE; - ScDocShell& GetDocShell() const { return mrDocShell; } + ScDocShell* GetDocShell() const { return pDocShell; } ScDocFunc& GetDocFunc() const; SC_DLLPUBLIC ScDBFunc* GetView() const; ScTabViewShell* GetViewShell() const { return pView; } - SfxObjectShell& GetSfxDocShell() const { return mrDocShell; } + SfxObjectShell* GetSfxDocShell() const { return pDocShell; } SfxBindings& GetBindings(); // from ViewShell's ViewFrame SC_DLLPUBLIC SfxDispatcher& GetDispatcher(); // from ViewShell's ViewFrame diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index e056fdad1569..a137609d2f94 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -865,11 +865,11 @@ IMPL_LINK( ScAcceptChgDlg, RejectHandle, SvxTPView*, pRef, void ) } return false; }); - ScDocShell& rDocSh=pViewData->GetDocShell(); - rDocSh.PostPaintExtras(); - rDocSh.PostPaintGridAll(); - rDocSh.GetUndoManager()->Clear(); - rDocSh.SetDocumentModified(); + ScDocShell* pDocSh=pViewData->GetDocShell(); + pDocSh->PostPaintExtras(); + pDocSh->PostPaintGridAll(); + pDocSh->GetUndoManager()->Clear(); + pDocSh->SetDocumentModified(); ClearView(); UpdateView(); } @@ -905,10 +905,10 @@ IMPL_LINK( ScAcceptChgDlg, AcceptHandle, SvxTPView*, pRef, void ) } return false; }); - ScDocShell& rDocSh=pViewData->GetDocShell(); - rDocSh.PostPaintExtras(); - rDocSh.PostPaintGridAll(); - rDocSh.SetDocumentModified(); + ScDocShell* pDocSh=pViewData->GetDocShell(); + pDocSh->PostPaintExtras(); + pDocSh->PostPaintGridAll(); + pDocSh->SetDocumentModified(); ClearView(); UpdateView(); } @@ -967,11 +967,11 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, RejectAllHandle, SvxTPView*, void) pViewData->SetTabNo(0); - ScDocShell& rDocSh=pViewData->GetDocShell(); - rDocSh.PostPaintExtras(); - rDocSh.PostPaintGridAll(); - rDocSh.GetUndoManager()->Clear(); - rDocSh.SetDocumentModified(); + ScDocShell* pDocSh=pViewData->GetDocShell(); + pDocSh->PostPaintExtras(); + pDocSh->PostPaintGridAll(); + pDocSh->GetUndoManager()->Clear(); + pDocSh->SetDocumentModified(); ClearView(); UpdateView(); } @@ -993,10 +993,10 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, AcceptAllHandle, SvxTPView*, void) else pChanges->AcceptAll(); - ScDocShell& rDocSh=pViewData->GetDocShell(); - rDocSh.PostPaintExtras(); - rDocSh.PostPaintGridAll(); - rDocSh.SetDocumentModified(); + ScDocShell* pDocSh=pViewData->GetDocShell(); + pDocSh->PostPaintExtras(); + pDocSh->PostPaintGridAll(); + pDocSh->SetDocumentModified(); ClearView(); UpdateView(); } @@ -1614,7 +1614,7 @@ IMPL_LINK(ScAcceptChgDlg, CommandHdl, const CommandEvent&, rCEvt, bool) if (pEntryData) { ScChangeAction* pScChangeAction = static_cast<ScChangeAction*>(pEntryData->pData); - pViewData->GetDocShell().ExecuteChangeCommentDialog(pScChangeAction, m_xDialog.get(), false); + pViewData->GetDocShell()->ExecuteChangeCommentDialog(pScChangeAction, m_xDialog.get(), false); } } } diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx b/sc/source/ui/miscdlgs/crnrdlg.cxx index c0a1c3a8a9bb..d7ada538ff0d 100644 --- a/sc/source/ui/miscdlgs/crnrdlg.cxx +++ b/sc/source/ui/miscdlgs/crnrdlg.cxx @@ -486,9 +486,9 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, OkBtnHdl, weld::Button&, void) rDoc.GetRowNameRangesRef() = xRowNameRanges; // changed ranges need to take effect rDoc.CompileColRowNameFormula(); - ScDocShell& rDocShell = m_rViewData.GetDocShell(); - rDocShell.PostPaint(ScRange(0, 0, 0, rDoc.MaxCol(), rDoc.MaxRow(), MAXTAB), PaintPartFlags::Grid); - rDocShell.SetDocumentModified(); + ScDocShell* pDocShell = m_rViewData.GetDocShell(); + pDocShell->PostPaint(ScRange(0, 0, 0, rDoc.MaxCol(), rDoc.MaxRow(), MAXTAB), PaintPartFlags::Grid); + pDocShell->SetDocumentModified(); response(RET_OK); } diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx index 6490cdc3b5b2..fb7a95ea1f84 100644 --- a/sc/source/ui/miscdlgs/datafdlg.cxx +++ b/sc/source/ui/miscdlgs/datafdlg.cxx @@ -230,7 +230,7 @@ IMPL_LINK( ScDataFormDlg, Impl_DataModifyHdl, weld::Entry&, rEdit, void) IMPL_LINK_NOARG(ScDataFormDlg, Impl_NewHdl, weld::Button&, void) { ScViewData& rViewData = pTabViewShell->GetViewData(); - ScDocShell& rDocSh = rViewData.GetDocShell(); + ScDocShell* pDocSh = rViewData.GetDocShell(); if ( !pDoc ) return; @@ -249,8 +249,8 @@ IMPL_LINK_NOARG(ScDataFormDlg, Impl_NewHdl, weld::Button&, void) } SetButtonState(); FillCtrls(); - rDocSh.SetDocumentModified(); - rDocSh.PostPaintGridAll(); + pDocSh->SetDocumentModified(); + pDocSh->PostPaintGridAll(); } IMPL_LINK_NOARG(ScDataFormDlg, Impl_PrevHdl, weld::Button&, void) @@ -288,7 +288,7 @@ IMPL_LINK_NOARG(ScDataFormDlg, Impl_RestoreHdl, weld::Button&, void) IMPL_LINK_NOARG(ScDataFormDlg, Impl_DeleteHdl, weld::Button&, void) { ScViewData& rViewData = pTabViewShell->GetViewData(); - ScDocShell& rDocSh = rViewData.GetDocShell(); + ScDocShell* pDocSh = rViewData.GetDocShell(); if (!pDoc) return; @@ -297,11 +297,11 @@ IMPL_LINK_NOARG(ScDataFormDlg, Impl_DeleteHdl, weld::Button&, void) nEndRow--; SetButtonState(); - rDocSh.GetUndoManager()->Clear(); + pDocSh->GetUndoManager()->Clear(); FillCtrls(); - rDocSh.SetDocumentModified(); - rDocSh.PostPaintGridAll(); + pDocSh->SetDocumentModified(); + pDocSh->PostPaintGridAll(); } IMPL_LINK_NOARG(ScDataFormDlg, Impl_CloseHdl, weld::Button&, void) diff --git a/sc/source/ui/miscdlgs/datastreamdlg.cxx b/sc/source/ui/miscdlgs/datastreamdlg.cxx index dff87e51722f..f56ebc0fb694 100644 --- a/sc/source/ui/miscdlgs/datastreamdlg.cxx +++ b/sc/source/ui/miscdlgs/datastreamdlg.cxx @@ -17,10 +17,10 @@ namespace sc { -DataStreamDlg::DataStreamDlg(ScDocShell& rDocShell, weld::Window* pParent) +DataStreamDlg::DataStreamDlg(ScDocShell* pDocShell, weld::Window* pParent) : GenericDialogController(pParent, u"modules/scalc/ui/datastreams.ui"_ustr, u"DataStreamDialog"_ustr) - , m_rDocShell(rDocShell) + , m_pDocShell(pDocShell) , m_xCbUrl(new SvtURLBox(m_xBuilder->weld_combo_box(u"url"_ustr))) , m_xBtnBrowse(m_xBuilder->weld_button(u"browse"_ustr)) , m_xRBValuesInLine(m_xBuilder->weld_radio_button(u"valuesinline"_ustr)) @@ -95,7 +95,7 @@ void DataStreamDlg::UpdateEnable() ScRange DataStreamDlg::GetStartRange() { OUString aStr = m_xEdRange->get_text(); - ScDocument& rDoc = m_rDocShell.GetDocument(); + ScDocument& rDoc = m_pDocShell->GetDocument(); ScRange aRange; ScRefFlags nRes = aRange.Parse(aStr, rDoc, rDoc.GetAddressConvention()); if (((nRes & ScRefFlags::VALID) == ScRefFlags::ZERO) || !aRange.IsValid()) @@ -115,7 +115,7 @@ ScRange DataStreamDlg::GetStartRange() void DataStreamDlg::Init(const DataStream& rStrm) { m_xCbUrl->set_entry_text(rStrm.GetURL()); - ScDocument& rDoc = m_rDocShell.GetDocument(); + ScDocument& rDoc = m_pDocShell->GetDocument(); ScRange aRange = rStrm.GetRange(); ScRange aTopRange = aRange; @@ -166,7 +166,7 @@ void DataStreamDlg::StartStream() DataStream::MoveType eMove = m_xRBRangeDown->get_active() ? DataStream::RANGE_DOWN : DataStream::MOVE_DOWN; - DataStream* pStream = DataStream::Set(&m_rDocShell, rURL, aStartRange, nLimit, eMove); + DataStream* pStream = DataStream::Set(m_pDocShell, rURL, aStartRange, nLimit, eMove); pStream->SetRefreshOnEmptyLine(m_xCBRefreshOnEmpty->get_active()); DataStream::MakeToolbarVisible(); pStream->StartImport(); diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx index 476a8d62b25e..e207c2b5cf79 100644 --- a/sc/source/ui/miscdlgs/highred.cxx +++ b/sc/source/ui/miscdlgs/highred.cxx @@ -214,7 +214,7 @@ IMPL_LINK_NOARG(ScHighlightChgDlg, OKBtnHdl, weld::Button&, void) aChangeViewSet.SetTheRangeList(aLocalRangeList); aChangeViewSet.AdjustDateMode( rDoc ); rDoc.SetChangeViewSettings(aChangeViewSet); - m_rViewData.GetDocShell().PostPaintGridAll(); + m_rViewData.GetDocShell()->PostPaintGridAll(); response(RET_OK); } diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx index 1945b9ce9470..3dfa986be326 100644 --- a/sc/source/ui/miscdlgs/instbdlg.cxx +++ b/sc/source/ui/miscdlgs/instbdlg.cxx @@ -93,7 +93,7 @@ void ScInsertTableDlg::Init_Impl( bool bFromFile ) m_xEdName->set_sensitive(false); } - bool bShared = rViewData.GetDocShell().IsDocShared(); + bool bShared = rViewData.GetDocShell() && rViewData.GetDocShell()->IsDocShared(); if ( !bFromFile || bShared ) { diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx index f4224c3a152e..cde2774153bc 100644 --- a/sc/source/ui/miscdlgs/optsolver.cxx +++ b/sc/source/ui/miscdlgs/optsolver.cxx @@ -138,13 +138,13 @@ IMPL_LINK(ScCursorRefEdit, KeyInputHdl, const KeyEvent&, rKEvt, bool) } ScOptSolverDlg::ScOptSolverDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent, - ScDocShell& rDocSh, const ScAddress& aCursorPos) + ScDocShell* pDocSh, const ScAddress& aCursorPos) : ScAnyRefDlgController(pB, pCW, pParent, u"modules/scalc/ui/solverdlg.ui"_ustr, u"SolverDialog"_ustr) , maInputError(ScResId(STR_INVALIDINPUT)) , maConditionError(ScResId(STR_INVALIDCONDITION)) - , mrDocShell(rDocSh) - , mrDoc(rDocSh.GetDocument()) + , mpDocShell(pDocSh) + , mrDoc(pDocSh->GetDocument()) , mnCurTab(aCursorPos.Tab()) , mbDlgLostFocus(false) , nScrollPos(0) @@ -948,7 +948,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal ReadConditions(); - rtl::Reference<ScModelObj> xDocument( mrDocShell.GetModel() ); + rtl::Reference<ScModelObj> xDocument( mpDocShell->GetModel() ); ScRange aObjRange; if ( !ParseRef( aObjRange, m_xEdObjectiveCell->GetText(), false ) ) @@ -1153,15 +1153,15 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal uno::Sequence<double> aSolution = xSolver->getSolution(); if ( aSolution.getLength() == nVarCount ) { - mrDocShell.LockPaint(); - ScDocFunc &rFunc = mrDocShell.GetDocFunc(); + mpDocShell->LockPaint(); + ScDocFunc &rFunc = mpDocShell->GetDocFunc(); for (nVarPos=0; nVarPos<nVarCount; ++nVarPos) { ScAddress aCellPos; ScUnoConversion::FillScAddress(aCellPos, aVariables[nVarPos]); rFunc.SetValueCell(aCellPos, aSolution[nVarPos], false); } - mrDocShell.UnlockPaint(); + mpDocShell->UnlockPaint(); } //! else error? @@ -1190,15 +1190,15 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal if ( bRestore ) // restore old values { - mrDocShell.LockPaint(); - ScDocFunc &rFunc = mrDocShell.GetDocFunc(); + mpDocShell->LockPaint(); + ScDocFunc &rFunc = mpDocShell->GetDocFunc(); for (nVarPos=0; nVarPos<nVarCount; ++nVarPos) { ScAddress aCellPos; ScUnoConversion::FillScAddress( aCellPos, aVariables[nVarPos] ); rFunc.SetValueCell(aCellPos, aOldValues[nVarPos], false); } - mrDocShell.UnlockPaint(); + mpDocShell->UnlockPaint(); } // Generate sensitivity report if user wants it @@ -1236,7 +1236,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal } // Insert new sheet to the document and start writing the report - ScDocFunc &rFunc = mrDocShell.GetDocFunc(); + ScDocFunc &rFunc = mpDocShell->GetDocFunc(); rFunc.InsertTable(mnCurTab + 1, sNewTabName, false, false); SCTAB nReportTab; if (!mrDoc.GetTable(sNewTabName, nReportTab)) @@ -1248,7 +1248,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal // Used to input data in the new sheet ScAddress aOutputAddress(0, 0, nReportTab); ScAddress::Details mAddressDetails(mrDoc, aOutputAddress); - AddressWalkerWriter aOutput(aOutputAddress, mrDocShell, mrDoc, + AddressWalkerWriter aOutput(aOutputAddress, mpDocShell, mrDoc, formula::FormulaGrammar::mergeToGrammar(formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); aOutput.writeBoldString(ScResId(STR_SENSITIVITY_TITLE)); aOutput.newLine(); diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx index cff5871f6e89..072e83562707 100644 --- a/sc/source/ui/miscdlgs/sharedocdlg.cxx +++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx @@ -55,11 +55,13 @@ ScShareDocumentDlg::ScShareDocumentDlg(weld::Window* pParent, ScViewData& rViewD , m_aStrNoUserData(ScResId(STR_NO_USER_DATA_AVAILABLE)) , m_aStrUnknownUser(ScResId(STR_UNKNOWN_USER_CONFLICT)) , m_aStrExclusiveAccess(ScResId(STR_EXCLUSIVE_ACCESS)) - , mrDocShell(rViewData.GetDocShell()) + , mpDocShell(rViewData.GetDocShell()) , m_xCbShare(m_xBuilder->weld_check_button(u"share"_ustr)) , m_xFtWarning(m_xBuilder->weld_label(u"warning"_ustr)) , m_xLbUsers(m_xBuilder->weld_tree_view(u"users"_ustr)) { + OSL_ENSURE( mpDocShell, "ScShareDocumentDlg CTOR: mpDocShell is null!" ); + std::vector<int> aWidths { o3tl::narrowing<int>(m_xLbUsers->get_approximate_digit_width() * 25) @@ -69,7 +71,7 @@ ScShareDocumentDlg::ScShareDocumentDlg(weld::Window* pParent, ScViewData& rViewD m_xLbUsers->set_size_request(-1, m_xLbUsers->get_height_rows(9)); m_xLbUsers->connect_size_allocate(LINK(this, ScShareDocumentDlg, SizeAllocated)); - bool bIsDocShared = mrDocShell.IsDocShared(); + bool bIsDocShared = mpDocShell && mpDocShell->IsDocShared(); m_xCbShare->set_active(bIsDocShared); m_xCbShare->connect_toggled( LINK( this, ScShareDocumentDlg, ToggleHandle ) ); m_xFtWarning->set_sensitive(bIsDocShared); @@ -95,11 +97,16 @@ bool ScShareDocumentDlg::IsShareDocumentChecked() const void ScShareDocumentDlg::UpdateView() { - if ( mrDocShell.IsDocShared() ) + if ( !mpDocShell ) + { + return; + } + + if ( mpDocShell->IsDocShared() ) { try { - ::svt::ShareControlFile aControlFile( mrDocShell.GetSharedFileURL() ); + ::svt::ShareControlFile aControlFile( mpDocShell->GetSharedFileURL() ); std::vector<LockFileEntry> aUsersData = aControlFile.GetUsersData(); sal_Int32 nLength = aUsersData.size(); @@ -185,7 +192,7 @@ void ScShareDocumentDlg::UpdateView() } aUser += " " + m_aStrExclusiveAccess; - uno::Reference<document::XDocumentProperties> xDocProps = mrDocShell.GetModel()->getDocumentProperties(); + uno::Reference<document::XDocumentProperties> xDocProps = mpDocShell->GetModel()->getDocumentProperties(); util::DateTime uDT(xDocProps->getModificationDate()); DateTime aDateTime(uDT); diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx index 93edb5b83adb..09ed2ebf5304 100644 --- a/sc/source/ui/namedlg/namedefdlg.cxx +++ b/sc/source/ui/namedlg/namedefdlg.cxx @@ -30,7 +30,7 @@ ScNameDefDlg::ScNameDefDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* : ScAnyRefDlgController( pB, pCW, pParent, u"modules/scalc/ui/definename.ui"_ustr, u"DefineNameDialog"_ustr) , mbUndo( bUndo ) , mrDoc(rViewData.GetDocument()) - , mrDocShell ( rViewData.GetDocShell() ) + , mpDocShell ( rViewData.GetDocShell() ) , maCursorPos( aCursorPos ) , maGlobalNameStr ( ScResId(STR_GLOBAL_SCOPE) ) , maErrInvalidNameStr( ScResId(STR_ERR_NAME_INVALID)) @@ -267,15 +267,15 @@ void ScNameDefDlg::AddPushed() assert( pNewEntry); // undo of no insertion smells fishy if (pNewEntry) - mrDocShell.GetUndoManager()->AddUndoAction( - std::make_unique<ScUndoAddRangeData>( mrDocShell, pNewEntry, nTab) ); + mpDocShell->GetUndoManager()->AddUndoAction( + std::make_unique<ScUndoAddRangeData>( *mpDocShell, pNewEntry, nTab) ); // set table stream invalid, otherwise RangeName won't be saved if no other // call invalidates the stream if (nTab != -1) mrDoc.SetStreamValid(nTab, false); SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreasChanged ) ); - mrDocShell.SetDocumentModified(); + mpDocShell->SetDocumentModified(); Close(); } else diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx index ac2619b9ff13..0f164a174e2d 100644 --- a/sc/source/ui/undo/undocell.cxx +++ b/sc/source/ui/undo/undocell.cxx @@ -632,7 +632,7 @@ void ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget) { ScTabViewShell& rViewShell = pViewTarget->GetViewShell(); ScViewData& rViewData = rViewShell.GetViewData(); - rViewData.GetDocShell().SetPrintZoom( rViewData.GetTabNo(), nNewScale, nNewPages ); + rViewData.GetDocShell()->SetPrintZoom( rViewData.GetTabNo(), nNewScale, nNewPages ); } } diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx index 92ce0ca562a4..536d271d643f 100644 --- a/sc/source/ui/unoobj/dispuno.cxx +++ b/sc/source/ui/unoobj/dispuno.cxx @@ -211,7 +211,7 @@ void SAL_CALL ScDispatch::dispatch( const util::URL& aURL, ScViewData& rViewData = pViewShell->GetViewData(); ScAddress aPos( rViewData.GetCurX(), rViewData.GetCurY(), rViewData.GetTabNo() ); - ScDBDocFunc aFunc( rViewData.GetDocShell() ); + ScDBDocFunc aFunc( *rViewData.GetDocShell() ); aFunc.DoImportUno( aPos, aArgs ); bDone = true; } diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index d6e2a9d0769d..6763b6ecb414 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -1068,8 +1068,8 @@ bool ScModelObj::isMimeTypeSupported() static void lcl_sendLOKDocumentBackground(const ScViewData* pViewData) { - ScDocShell& rDocSh = pViewData->GetDocShell(); - ScDocument& rDoc = rDocSh.GetDocument(); + ScDocShell* pDocSh = pViewData->GetDocShell(); + ScDocument& rDoc = pDocSh->GetDocument(); const SfxPoolItem& rItem(rDoc.getCellAttributeHelper().getDefaultCellAttribute().GetItem(ATTR_BACKGROUND)); const SvxBrushItem& rBackground = static_cast<const SvxBrushItem&>(rItem); const Color& rColor = rBackground.GetColor(); diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index f505ae7606d6..f88710e4355f 100644 -e ... etc. - the rest is truncated
