diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-08-21 21:11:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-08-21 21:58:56 +0100 |
commit | 264466bd604d7613aa0a5e4b34c149ad66414580 (patch) | |
tree | 05e634ebb87dc610543ef62c6eb65241487266f5 | |
parent | fdcec8131e6e2c5eb9df243c34f34f7742b975bc (diff) |
coverity#1371453 try silence Wrapper object use after free
Change-Id: I707debb1dab694b3de2942e1c8b9a1bd7ec2d283
27 files changed, 311 insertions, 310 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index bfef7e49ecce..b2f97534cc77 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1494,17 +1494,17 @@ public: // don't use anymore: void CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, - InsertDeleteFlags nFlags, bool bMarked, ScDocument* pDestDoc, + InsertDeleteFlags nFlags, bool bMarked, ScDocument& rDestDoc, const ScMarkData* pMarks = nullptr, bool bColRowFlags = true); void UndoToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, - InsertDeleteFlags nFlags, bool bMarked, ScDocument* pDestDoc); + InsertDeleteFlags nFlags, bool bMarked, ScDocument& rDestDoc); void CopyToDocument(const ScRange& rRange, - InsertDeleteFlags nFlags, bool bMarked, ScDocument* pDestDoc, + InsertDeleteFlags nFlags, bool bMarked, ScDocument& rDestDoc, const ScMarkData* pMarks = nullptr, bool bColRowFlags = true); void UndoToDocument(const ScRange& rRange, - InsertDeleteFlags nFlags, bool bMarked, ScDocument* pDestDoc); + InsertDeleteFlags nFlags, bool bMarked, ScDocument& rDestDoc); void CopyScenario( SCTAB nSrcTab, SCTAB nDestTab, bool bNewScenario = false ); bool TestCopyScenario( SCTAB nSrcTab, SCTAB nDestTab ) const; diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index c61574cc0277..19c9460d0785 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -3419,7 +3419,7 @@ void Test::testCopyPasteSkipEmpty() // Create undo document. ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO); pUndoDoc->InitUndo(m_pDoc, 0, 0); - m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::ALL, false, pUndoDoc, &aMark); + m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::ALL, false, *pUndoDoc, &aMark); // Paste clipboard content onto A1:A5 but skip empty cells. bool bSkipEmpty = true; @@ -3428,7 +3428,7 @@ void Test::testCopyPasteSkipEmpty() // Create redo document. ScDocument* pRedoDoc = new ScDocument(SCDOCMODE_UNDO); pRedoDoc->InitUndo(m_pDoc, 0, 0); - m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::ALL, false, pRedoDoc, &aMark); + m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::ALL, false, *pRedoDoc, &aMark); // Create an undo object for this. ScRefUndoData* pRefUndoData = new ScRefUndoData(m_pDoc); @@ -3620,7 +3620,7 @@ void Test::testUndoCut() // Set up an undo object for cutting A1:A3. ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO); pUndoDoc->InitUndo(m_pDoc, 0 ,0); - m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL, false, pUndoDoc); + m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL, false, *pUndoDoc); ASSERT_DOUBLES_EQUAL( 1.0, pUndoDoc->GetValue(ScAddress(0,0,0))); ASSERT_DOUBLES_EQUAL( 10.0, pUndoDoc->GetValue(ScAddress(0,1,0))); ASSERT_DOUBLES_EQUAL(100.0, pUndoDoc->GetValue(ScAddress(0,2,0))); @@ -5427,7 +5427,7 @@ void Test::testDeleteContents() std::unique_ptr<ScDocument> pUndoDoc(new ScDocument(SCDOCMODE_UNDO)); pUndoDoc->InitUndo(m_pDoc, 0, 0); - m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::CONTENTS, false, pUndoDoc.get(), &aMark); + m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::CONTENTS, false, *pUndoDoc, &aMark); ScUndoDeleteContents aUndo(&getDocShell(), aMark, aRange, std::move(pUndoDoc), false, InsertDeleteFlags::CONTENTS, true); clearRange(m_pDoc, aRange); diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx index f77208b2eb7c..8ddbd6464fcb 100644 --- a/sc/qa/unit/ucalc_condformat.cxx +++ b/sc/qa/unit/ucalc_condformat.cxx @@ -66,7 +66,7 @@ void Test::testCopyPasteSkipEmptyConditionalFormatting() // Create undo document. ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO); pUndoDoc->InitUndo(m_pDoc, 0, 0); - m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::CONTENTS, false, pUndoDoc, &aMark); + m_pDoc->CopyToDocument(aDestRange, InsertDeleteFlags::CONTENTS, false, *pUndoDoc, &aMark); // Paste clipboard content onto A1:A5 but skip empty cells. bool bSkipEmpty = true; diff --git a/sc/qa/unit/ucalc_sharedformula.cxx b/sc/qa/unit/ucalc_sharedformula.cxx index 15db4f6a11c4..e9833a23238a 100644 --- a/sc/qa/unit/ucalc_sharedformula.cxx +++ b/sc/qa/unit/ucalc_sharedformula.cxx @@ -1340,7 +1340,7 @@ void Test::testSharedFormulasCopyPaste() ScRange aRange(1,0,0,1,9,0); // B1:B10 ScDocument* pUndoDoc = new ScDocument(SCDOCMODE_UNDO); pUndoDoc->InitUndo(m_pDoc, 0, 0, true, true); - m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::CONTENTS, false, pUndoDoc); + m_pDoc->CopyToDocument(aRange, InsertDeleteFlags::CONTENTS, false, *pUndoDoc); std::unique_ptr<ScUndoPaste> pUndo(createUndoPaste(getDocShell(), aRange, pUndoDoc)); // First, make sure the formula cells are shared in the undo document. @@ -1842,7 +1842,7 @@ void Test::testSharedFormulaUpdateOnReplacement() aMark.SetMultiMarkArea(aUndoRange); std::unique_ptr<ScDocument> pUndoDoc(new ScDocument(SCDOCMODE_UNDO)); pUndoDoc->InitUndo(m_pDoc, 0, 0); - m_pDoc->CopyToDocument(aUndoRange, InsertDeleteFlags::CONTENTS, false, pUndoDoc.get(), &aMark); + m_pDoc->CopyToDocument(aUndoRange, InsertDeleteFlags::CONTENTS, false, *pUndoDoc, &aMark); ScUndoDeleteContents aUndo(&getDocShell(), aMark, aUndoRange, std::move(pUndoDoc), false, InsertDeleteFlags::CONTENTS, true); // Delete A4. diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index fd485737e5ca..2b1130336982 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2015,79 +2015,79 @@ bool ScDocument::IsCutMode() void ScDocument::CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, - InsertDeleteFlags nFlags, bool bOnlyMarked, ScDocument* pDestDoc, + InsertDeleteFlags nFlags, bool bOnlyMarked, ScDocument& rDestDoc, const ScMarkData* pMarks, bool bColRowFlags ) { PutInOrder( nCol1, nCol2 ); PutInOrder( nRow1, nRow2 ); PutInOrder( nTab1, nTab2 ); - if( pDestDoc->aDocName.isEmpty() ) - pDestDoc->aDocName = aDocName; + if (rDestDoc.aDocName.isEmpty()) + rDestDoc.aDocName = aDocName; if (ValidTab(nTab1) && ValidTab(nTab2)) { - sc::CopyToDocContext aCxt(*pDestDoc); - bool bOldAutoCalc = pDestDoc->GetAutoCalc(); - pDestDoc->SetAutoCalc( false ); // avoid multiple calculations - SCTAB nMinSizeBothTabs = static_cast<SCTAB>(std::min(maTabs.size(), pDestDoc->maTabs.size())); + sc::CopyToDocContext aCxt(rDestDoc); + bool bOldAutoCalc = rDestDoc.GetAutoCalc(); + rDestDoc.SetAutoCalc( false ); // avoid multiple calculations + SCTAB nMinSizeBothTabs = static_cast<SCTAB>(std::min(maTabs.size(), rDestDoc.maTabs.size())); for (SCTAB i = nTab1; i <= nTab2 && i < nMinSizeBothTabs; i++) { - if (maTabs[i] && pDestDoc->maTabs[i]) + if (maTabs[i] && rDestDoc.maTabs[i]) maTabs[i]->CopyToTable(aCxt, nCol1, nRow1, nCol2, nRow2, nFlags, - bOnlyMarked, pDestDoc->maTabs[i], pMarks, + bOnlyMarked, rDestDoc.maTabs[i], pMarks, false, bColRowFlags ); } - pDestDoc->SetAutoCalc( bOldAutoCalc ); + rDestDoc.SetAutoCalc(bOldAutoCalc); } } void ScDocument::UndoToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, - InsertDeleteFlags nFlags, bool bOnlyMarked, ScDocument* pDestDoc) + InsertDeleteFlags nFlags, bool bOnlyMarked, ScDocument& rDestDoc) { PutInOrder( nCol1, nCol2 ); PutInOrder( nRow1, nRow2 ); PutInOrder( nTab1, nTab2 ); if (ValidTab(nTab1) && ValidTab(nTab2)) { - sc::AutoCalcSwitch aACSwitch(*pDestDoc, false); // avoid multiple calculations + sc::AutoCalcSwitch aACSwitch(rDestDoc, false); // avoid multiple calculations if (nTab1 > 0) - CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, InsertDeleteFlags::FORMULA, false, pDestDoc ); + CopyToDocument(0, 0, 0, MAXCOL, MAXROW, nTab1-1, InsertDeleteFlags::FORMULA, false, rDestDoc); - sc::CopyToDocContext aCxt(*pDestDoc); - OSL_ASSERT( nTab2 < static_cast<SCTAB>(maTabs.size()) && nTab2 < static_cast<SCTAB>(pDestDoc->maTabs.size())); + sc::CopyToDocContext aCxt(rDestDoc); + OSL_ASSERT( nTab2 < static_cast<SCTAB>(maTabs.size()) && nTab2 < static_cast<SCTAB>(rDestDoc.maTabs.size())); for (SCTAB i = nTab1; i <= nTab2; i++) { - if (maTabs[i] && pDestDoc->maTabs[i]) + if (maTabs[i] && rDestDoc.maTabs[i]) maTabs[i]->UndoToTable(aCxt, nCol1, nRow1, nCol2, nRow2, nFlags, - bOnlyMarked, pDestDoc->maTabs[i]); + bOnlyMarked, rDestDoc.maTabs[i]); } if (nTab2 < MAXTAB) - CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,MAXTAB, InsertDeleteFlags::FORMULA, false, pDestDoc ); + CopyToDocument(0, 0, nTab2+1, MAXCOL, MAXROW, MAXTAB, InsertDeleteFlags::FORMULA, false, rDestDoc); } } void ScDocument::CopyToDocument(const ScRange& rRange, - InsertDeleteFlags nFlags, bool bOnlyMarked, ScDocument* pDestDoc, + InsertDeleteFlags nFlags, bool bOnlyMarked, ScDocument& rDestDoc, const ScMarkData* pMarks, bool bColRowFlags) { ScRange aNewRange = rRange; aNewRange.PutInOrder(); - if( pDestDoc->aDocName.isEmpty() ) - pDestDoc->aDocName = aDocName; + if (rDestDoc.aDocName.isEmpty()) + rDestDoc.aDocName = aDocName; - sc::AutoCalcSwitch aACSwitch(*pDestDoc, false); // avoid multiple calculations + sc::AutoCalcSwitch aACSwitch(rDestDoc, false); // avoid multiple calculations - sc::CopyToDocContext aCxt(*pDestDoc); + sc::CopyToDocContext aCxt(rDestDoc); aCxt.setStartListening(false); - SCTAB nMinSizeBothTabs = static_cast<SCTAB>(std::min(maTabs.size(), pDestDoc->maTabs.size())); + SCTAB nMinSizeBothTabs = static_cast<SCTAB>(std::min(maTabs.size(), rDestDoc.maTabs.size())); for (SCTAB i = aNewRange.aStart.Tab(); i <= aNewRange.aEnd.Tab() && i < nMinSizeBothTabs; i++) { ScTable* pTab = FetchTable(i); - ScTable* pDestTab = pDestDoc->FetchTable(i); + ScTable* pDestTab = rDestDoc.FetchTable(i); if (!pTab || !pDestTab) continue; @@ -2096,11 +2096,11 @@ void ScDocument::CopyToDocument(const ScRange& rRange, nFlags, bOnlyMarked, pDestTab, pMarks, false, bColRowFlags); } - pDestDoc->StartAllListeners(aNewRange); + rDestDoc.StartAllListeners(aNewRange); } void ScDocument::UndoToDocument(const ScRange& rRange, - InsertDeleteFlags nFlags, bool bOnlyMarked, ScDocument* pDestDoc) + InsertDeleteFlags nFlags, bool bOnlyMarked, ScDocument& rDestDoc) { sc::AutoCalcSwitch aAutoCalcSwitch(*this, false); @@ -2109,21 +2109,21 @@ void ScDocument::UndoToDocument(const ScRange& rRange, SCTAB nTab1 = aNewRange.aStart.Tab(); SCTAB nTab2 = aNewRange.aEnd.Tab(); - sc::CopyToDocContext aCxt(*pDestDoc); + sc::CopyToDocContext aCxt(rDestDoc); if (nTab1 > 0) - CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTab1-1, InsertDeleteFlags::FORMULA, false, pDestDoc ); + CopyToDocument(0, 0, 0, MAXCOL, MAXROW, nTab1-1, InsertDeleteFlags::FORMULA, false, rDestDoc); - SCTAB nMinSizeBothTabs = static_cast<SCTAB>(std::min(maTabs.size(), pDestDoc->maTabs.size())); + SCTAB nMinSizeBothTabs = static_cast<SCTAB>(std::min(maTabs.size(), rDestDoc.maTabs.size())); for (SCTAB i = nTab1; i <= nTab2 && i < nMinSizeBothTabs; i++) { - if (maTabs[i] && pDestDoc->maTabs[i]) + if (maTabs[i] && rDestDoc.maTabs[i]) maTabs[i]->UndoToTable(aCxt, aNewRange.aStart.Col(), aNewRange.aStart.Row(), aNewRange.aEnd.Col(), aNewRange.aEnd.Row(), - nFlags, bOnlyMarked, pDestDoc->maTabs[i]); + nFlags, bOnlyMarked, rDestDoc.maTabs[i]); } if (nTab2 < static_cast<SCTAB>(maTabs.size())) - CopyToDocument( 0,0,nTab2+1, MAXCOL,MAXROW,maTabs.size(), InsertDeleteFlags::FORMULA, false, pDestDoc ); + CopyToDocument(0, 0 , nTab2+1, MAXCOL, MAXROW, maTabs.size(), InsertDeleteFlags::FORMULA, false, rDestDoc); } void ScDocument::CopyToClip(const ScClipParam& rClipParam, diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index e7e7caf244c7..5f03fe96a4e2 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -747,8 +747,8 @@ bool ScTable::ReplaceAllStyle( if (pReplaceStyle) { if (pUndoDoc) - pDocument->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, - InsertDeleteFlags::ATTRIB, true, pUndoDoc, &rMark ); + pDocument->CopyToDocument(0, 0 ,nTab, MAXCOL,MAXROW,nTab, + InsertDeleteFlags::ATTRIB, true, *pUndoDoc, &rMark); ApplySelectionStyle( *pReplaceStyle, rMark ); } else diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index d973e2d50cbe..5329d7cfac52 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -328,17 +328,17 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter, if ( nNewEndX != nOldEndX || nNewEndY != nOldEndY ) // Bereich veraendert? { pUndoDoc->InitUndo( &rDoc, 0, rDoc.GetTableCount()-1 ); - rDoc.CopyToDocument( 0,0,0,MAXCOL,MAXROW,MAXTAB, - InsertDeleteFlags::FORMULA, false, pUndoDoc ); // alle Formeln + rDoc.CopyToDocument(0, 0, 0, MAXCOL, MAXROW, MAXTAB, + InsertDeleteFlags::FORMULA, false, *pUndoDoc); // alle Formeln } else pUndoDoc->InitUndo( &rDoc, nDestTab, nDestTab ); // nur Zieltabelle - rDoc.CopyToDocument( aOldRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, pUndoDoc ); + rDoc.CopyToDocument(aOldRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pUndoDoc); } else // ohne Einfuegen { pUndoDoc->InitUndo( &rDoc, nDestTab, nDestTab ); // nur Zieltabelle - rDoc.CopyToDocument( aMaxRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, pUndoDoc ); + rDoc.CopyToDocument(aMaxRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pUndoDoc); } } @@ -404,7 +404,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter, { ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO ); pRedoDoc->InitUndo( &rDoc, nDestTab, nDestTab ); - rDoc.CopyToDocument( aNewRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, pRedoDoc ); + rDoc.CopyToDocument(aNewRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pRedoDoc); pImpl->m_pDocSh->GetUndoManager()->AddUndoAction( new ScUndoUpdateAreaLink( pImpl->m_pDocSh, diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 983f29d431b0..3dac972d1ec0 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -358,21 +358,21 @@ bool ScDBDocFunc::RepeatDB( const OUString& rDBName, bool bApi, bool bIsUnnamed, pTable->GetRowArray().GetRange( nOutStartRow, nOutEndRow ); pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true ); - rDoc.CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, - nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, - InsertDeleteFlags::NONE, false, pUndoDoc ); - rDoc.CopyToDocument( 0, static_cast<SCROW>(nOutStartRow), - nTab, MAXCOL, static_cast<SCROW>(nOutEndRow), nTab, - InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument(static_cast<SCCOL>(nOutStartCol), 0, + nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, + InsertDeleteFlags::NONE, false, *pUndoDoc); + rDoc.CopyToDocument(0, static_cast<SCROW>(nOutStartRow), + nTab, MAXCOL, static_cast<SCROW>(nOutEndRow), nTab, + InsertDeleteFlags::NONE, false, *pUndoDoc); } else pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true ); // Datenbereich sichern - incl. Filter-Ergebnis - rDoc.CopyToDocument( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab, InsertDeleteFlags::ALL, false, pUndoDoc ); + rDoc.CopyToDocument(0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::ALL, false, *pUndoDoc); // alle Formeln wegen Referenzen - rDoc.CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, InsertDeleteFlags::FORMULA, false, pUndoDoc ); + rDoc.CopyToDocument(0, 0, 0, MAXCOL, MAXROW, nTabCount-1, InsertDeleteFlags::FORMULA, false, *pUndoDoc); // DB- und andere Bereiche ScRangeName* pDocRange = rDoc.GetRangeName(); @@ -735,22 +735,22 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam, if (bCopy) { pUndoDoc->InitUndo( &rDoc, nDestTab, nDestTab, false, true ); - rDoc.CopyToDocument( aLocalParam.nCol1, aLocalParam.nRow1, nDestTab, - aLocalParam.nCol2, aLocalParam.nRow2, nDestTab, - InsertDeleteFlags::ALL, false, pUndoDoc ); + rDoc.CopyToDocument(aLocalParam.nCol1, aLocalParam.nRow1, nDestTab, + aLocalParam.nCol2, aLocalParam.nRow2, nDestTab, + InsertDeleteFlags::ALL, false, *pUndoDoc); // Attribute sichern, falls beim Filtern mitkopiert if (pDestData) { - rDoc.CopyToDocument( aOldDest, InsertDeleteFlags::ALL, false, pUndoDoc ); + rDoc.CopyToDocument(aOldDest, InsertDeleteFlags::ALL, false, *pUndoDoc); pOld = &aOldDest; } } else { pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true ); - rDoc.CopyToDocument( 0, rQueryParam.nRow1, nTab, MAXCOL, rQueryParam.nRow2, nTab, - InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument(0, rQueryParam.nRow1, nTab, MAXCOL, rQueryParam.nRow2, nTab, + InsertDeleteFlags::NONE, false, *pUndoDoc); } ScDBCollection* pDocDB = rDoc.GetDBCollection(); @@ -778,7 +778,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam, pAttribDoc = new ScDocument( SCDOCMODE_UNDO ); pAttribDoc->InitUndo( &rDoc, nDestTab, nDestTab, false, true ); - rDoc.CopyToDocument( aAttribRange, InsertDeleteFlags::ATTRIB, false, pAttribDoc ); + rDoc.CopyToDocument(aAttribRange, InsertDeleteFlags::ATTRIB, false, *pAttribDoc); } if ( bDoSize ) @@ -839,7 +839,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam, { ScRange aHdrRange = aAttribRange; aHdrRange.aEnd.SetRow( aHdrRange.aStart.Row() ); - pAttribDoc->CopyToDocument( aHdrRange, InsertDeleteFlags::ATTRIB, false, &rDoc ); + pAttribDoc->CopyToDocument(aHdrRange, InsertDeleteFlags::ATTRIB, false, rDoc); } // Daten @@ -1026,19 +1026,19 @@ void ScDBDocFunc::DoSubTotals( SCTAB nTab, const ScSubTotalParam& rParam, pTable->GetRowArray().GetRange( nOutStartRow, nOutEndRow ); pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true ); - rDoc.CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); - rDoc.CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument(static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); + rDoc.CopyToDocument(0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); } else pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, bOldFilter ); // Datenbereich sichern - incl. Filter-Ergebnis - rDoc.CopyToDocument( 0,rParam.nRow1+1,nTab, MAXCOL,rParam.nRow2,nTab, - InsertDeleteFlags::ALL, false, pUndoDoc ); + rDoc.CopyToDocument(0, rParam.nRow1+1,nTab, MAXCOL,rParam.nRow2,nTab, + InsertDeleteFlags::ALL, false, *pUndoDoc); // alle Formeln wegen Referenzen - rDoc.CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, - InsertDeleteFlags::FORMULA, false, pUndoDoc ); + rDoc.CopyToDocument(0, 0, 0, MAXCOL,MAXROW,nTabCount-1, + InsertDeleteFlags::FORMULA, false, *pUndoDoc); // DB- und andere Bereiche ScRangeName* pDocRange = rDoc.GetRangeName(); @@ -1158,7 +1158,7 @@ void createUndoDoc(std::unique_ptr<ScDocument>& pUndoDoc, ScDocument* pDoc, cons SCTAB nTab = rRange.aStart.Tab(); pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); pUndoDoc->InitUndo(pDoc, nTab, nTab); - pDoc->CopyToDocument(rRange, InsertDeleteFlags::ALL, false, pUndoDoc.get()); + pDoc->CopyToDocument(rRange, InsertDeleteFlags::ALL, false, *pUndoDoc); } bool checkNewOutputRange(ScDPObject& rDPObj, ScDocShell& rDocShell, ScRange& rNewOut, bool bApi) diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index 7d02ce3b3d24..33ca862a8d7b 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -434,9 +434,9 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, SCCOL nMinEndCol = std::min( rParam.nCol2, nEndCol ); // not too much nMinEndCol = sal::static_int_cast<SCCOL>( nMinEndCol + nFormulaCols ); // only if column count unchanged pImportDoc->DeleteAreaTab( 0,0, MAXCOL,MAXROW, nTab, InsertDeleteFlags::ATTRIB ); - rDoc.CopyToDocument( rParam.nCol1, rParam.nRow1, nTab, - nMinEndCol, rParam.nRow1, nTab, - InsertDeleteFlags::ATTRIB, false, pImportDoc ); + rDoc.CopyToDocument(rParam.nCol1, rParam.nRow1, nTab, + nMinEndCol, rParam.nRow1, nTab, + InsertDeleteFlags::ATTRIB, false, *pImportDoc); SCROW nDataStartRow = rParam.nRow1+1; for (SCCOL nCopyCol=rParam.nCol1; nCopyCol<=nMinEndCol; nCopyCol++) @@ -484,17 +484,17 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, InsertDeleteFlags nCopyFlags = InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE; // nFormulaCols is set only if column count is unchanged - rDoc.CopyToDocument( rParam.nCol1, rParam.nRow1, nTab, - nEndCol+nFormulaCols, nEndRow, nTab, - nCopyFlags, false, pUndoDoc ); + rDoc.CopyToDocument(rParam.nCol1, rParam.nRow1, nTab, + nEndCol+nFormulaCols, nEndRow, nTab, + nCopyFlags, false, *pUndoDoc); if ( rParam.nCol2 > nEndCol ) - rDoc.CopyToDocument( nEndCol+1, rParam.nRow1, nTab, - nUndoEndCol, nUndoEndRow, nTab, - nCopyFlags, false, pUndoDoc ); + rDoc.CopyToDocument(nEndCol+1, rParam.nRow1, nTab, + nUndoEndCol, nUndoEndRow, nTab, + nCopyFlags, false, *pUndoDoc); if ( rParam.nRow2 > nEndRow ) - rDoc.CopyToDocument( rParam.nCol1, nEndRow+1, nTab, - nUndoEndCol+nFormulaCols, nUndoEndRow, nTab, - nCopyFlags, false, pUndoDoc ); + rDoc.CopyToDocument(rParam.nCol1, nEndRow+1, nTab, + nUndoEndCol+nFormulaCols, nUndoEndRow, nTab, + nCopyFlags, false, *pUndoDoc); } // move new data @@ -526,8 +526,8 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, rDoc.SetAutoCalc( false ); // outside of the loop for (SCCOL nCopyCol = rParam.nCol1; nCopyCol <= nEndCol; nCopyCol++) { - pImportDoc->CopyToDocument( nCopyCol, rParam.nRow1, nTab, nCopyCol, nEndRow, nTab, - InsertDeleteFlags::ALL, false, &rDoc ); + pImportDoc->CopyToDocument(nCopyCol, rParam.nRow1, nTab, nCopyCol, nEndRow, nTab, + InsertDeleteFlags::ALL, false, rDoc); pImportDoc->DeleteAreaTab( nCopyCol, rParam.nRow1, nCopyCol, nEndRow, nTab, InsertDeleteFlags::CONTENTS ); } rDoc.SetAutoCalc( bOldAutoCalc ); @@ -535,9 +535,9 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, if (nFormulaCols > 0) // copy formulas { if (bKeepFormat) // formats for formulas - pImportDoc->CopyToDocument( nEndCol+1, rParam.nRow1, nTab, - nEndCol+nFormulaCols, nEndRow, nTab, - InsertDeleteFlags::ATTRIB, false, &rDoc ); + pImportDoc->CopyToDocument(nEndCol+1, rParam.nRow1, nTab, + nEndCol+nFormulaCols, nEndRow, nTab, + InsertDeleteFlags::ATTRIB, false, rDoc); // fill formulas ScMarkData aMark; aMark.SelectOneTable(nTab); @@ -577,9 +577,9 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, pImportDoc = nullptr; if (nFormulaCols > 0) // include filled formulas for redo - rDoc.CopyToDocument( rParam.nCol1, rParam.nRow1, nTab, - nEndCol+nFormulaCols, nEndRow, nTab, - InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, pRedoDoc ); + rDoc.CopyToDocument(rParam.nCol1, rParam.nRow1, nTab, + nEndCol+nFormulaCols, nEndRow, nTab, + InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pRedoDoc); ScDBData* pRedoDBData = pDBData ? new ScDBData( *pDBData ) : nullptr; diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index b72da3a7a935..ccbbe56d5fc2 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -749,7 +749,7 @@ bool ScDocFunc::TransliterateText( const ScMarkData& rMark, sal_Int32 nType, ScRange aCopyRange = aMarkRange; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::CONTENTS, true, pUndoDoc, &aMultiMark ); + rDoc.CopyToDocument(aCopyRange, InsertDeleteFlags::CONTENTS, true, *pUndoDoc, &aMultiMark); rDocShell.GetUndoManager()->AddUndoAction( new ScUndoTransliterate( &rDocShell, aMultiMark, pUndoDoc, nType ) ); @@ -1343,7 +1343,7 @@ bool ScDocFunc::ApplyAttributes( const ScMarkData& rMark, const ScPatternAttr& r { ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, aMultiRange.aStart.Tab(), aMultiRange.aEnd.Tab() ); - rDoc.CopyToDocument( aMultiRange, InsertDeleteFlags::ATTRIB, bMulti, pUndoDoc, &rMark ); + rDoc.CopyToDocument(aMultiRange, InsertDeleteFlags::ATTRIB, bMulti, *pUndoDoc, &rMark); rDocShell.GetUndoManager()->AddUndoAction( new ScUndoSelectionAttr( @@ -1419,7 +1419,7 @@ bool ScDocFunc::ApplyStyle( const ScMarkData& rMark, const OUString& rStyleName, ScRange aCopyRange = aMultiRange; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, bMulti, pUndoDoc, &rMark ); + rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, bMulti, *pUndoDoc, &rMark ); rDocShell.GetUndoManager()->AddUndoAction( new ScUndoSelectionStyle( @@ -2380,7 +2380,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, nScenarioCount ++; rDoc.CopyToDocument( nUndoStartCol, nUndoStartRow, *itr, nUndoEndCol, nUndoEndRow, *itr+nScenarioCount, - InsertDeleteFlags::ALL | InsertDeleteFlags::NOCAPTIONS, false, pUndoDoc ); + InsertDeleteFlags::ALL | InsertDeleteFlags::NOCAPTIONS, false, *pUndoDoc ); } pRefUndoDoc = new ScDocument( SCDOCMODE_UNDO ); @@ -2441,7 +2441,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, pUndoDoc->AddUndoTab( 0, nTabCount-1 ); // kopieren mit bColRowFlags=false (#54194#) - pRefUndoDoc->CopyToDocument(0,0,0,MAXCOL,MAXROW,MAXTAB,InsertDeleteFlags::FORMULA,false,pUndoDoc,nullptr,false); + pRefUndoDoc->CopyToDocument(0,0,0,MAXCOL,MAXROW,MAXTAB,InsertDeleteFlags::FORMULA,false,*pUndoDoc,nullptr,false); delete pRefUndoDoc; SCTAB* pTabs = new SCTAB[nSelCount]; @@ -2739,14 +2739,14 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos, if (bCut) { rDoc.CopyToDocument( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab, - nUndoFlags, false, pUndoDoc ); + nUndoFlags, false, *pUndoDoc ); } if ( nDestTab != nStartTab ) pUndoDoc->AddUndoTab( nDestTab, nDestEndTab, bWholeCols, bWholeRows ); rDoc.CopyToDocument( nDestCol, nDestRow, nDestTab, nDestEndCol, nDestEndRow, nDestEndTab, - nUndoFlags, false, pUndoDoc ); + nUndoFlags, false, *pUndoDoc ); rDoc.BeginDrawUndo(); } @@ -3090,7 +3090,7 @@ bool ScDocFunc::DeleteTable( SCTAB nTab, bool bRecord, bool /* bApi */ ) pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true ); // nur nTab mit Flags pUndoDoc->AddUndoTab( 0, nCount-1 ); // alle Tabs fuer Referenzen - rDoc.CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::ALL,false, pUndoDoc ); + rDoc.CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::ALL,false, *pUndoDoc ); OUString aOldName; rDoc.GetName( nTab, aOldName ); pUndoDoc->RenameTab( nTab, aOldName, false ); @@ -3444,12 +3444,12 @@ bool ScDocFunc::SetWidthOrHeight( if (bWidth) { pUndoDoc->InitUndo( &rDoc, nTab, nTab, true ); - rDoc.CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab, static_cast<SCCOL>(nEnd), MAXROW, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab, static_cast<SCCOL>(nEnd), MAXROW, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc ); } else { pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true ); - rDoc.CopyToDocument( 0, static_cast<SCROW>(nStart), nTab, MAXCOL, static_cast<SCROW>(nEnd), nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument( 0, static_cast<SCROW>(nStart), nTab, MAXCOL, static_cast<SCROW>(nEnd), nTab, InsertDeleteFlags::NONE, false, *pUndoDoc ); } aUndoRanges = rRanges; @@ -3881,7 +3881,7 @@ void ScDocFunc::ClearItems( const ScMarkData& rMark, const sal_uInt16* pWhich, b ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, nStartTab, nEndTab ); - rDoc.CopyToDocument( aMarkRange, InsertDeleteFlags::ATTRIB, true, pUndoDoc, &aMultiMark ); + rDoc.CopyToDocument( aMarkRange, InsertDeleteFlags::ATTRIB, true, *pUndoDoc, &aMultiMark ); rDocShell.GetUndoManager()->AddUndoAction( new ScUndoClearItems( &rDocShell, aMultiMark, pUndoDoc, pWhich ) ); @@ -3927,7 +3927,7 @@ bool ScDocFunc::ChangeIndent( const ScMarkData& rMark, bool bIncrement, bool bAp ScRange aCopyRange = aMarkRange; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, true, pUndoDoc, &rMark ); + rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, true, *pUndoDoc, &rMark ); rDocShell.GetUndoManager()->AddUndoAction( new ScUndoIndent( &rDocShell, rMark, pUndoDoc, bIncrement ) ); @@ -4009,13 +4009,13 @@ bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark, ScRange aCopyRange = rRange; aCopyRange.aStart.SetTab(0); aCopyRange.aStart.SetTab(nTabCount-1); - rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, false, pUndoDoc, &aMark ); + rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, false, *pUndoDoc, &aMark ); if (bSize) { rDoc.CopyToDocument( nStartCol,0,0, nEndCol,MAXROW,nTabCount-1, - InsertDeleteFlags::NONE, false, pUndoDoc, &aMark ); + InsertDeleteFlags::NONE, false, *pUndoDoc, &aMark ); rDoc.CopyToDocument( 0,nStartRow,0, MAXCOL,nEndRow,nTabCount-1, - InsertDeleteFlags::NONE, false, pUndoDoc, &aMark ); + InsertDeleteFlags::NONE, false, *pUndoDoc, &aMark ); } rDoc.BeginDrawUndo(); } @@ -4106,7 +4106,7 @@ bool ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark, //! auch bei Undo selektierte Tabellen beruecksichtigen pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, nStartTab, nEndTab ); - rDoc.CopyToDocument( rRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, pUndoDoc ); + rDoc.CopyToDocument( rRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pUndoDoc ); } // use TokenArray if given, string (and flags) otherwise @@ -4191,7 +4191,7 @@ bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark, //! auch bei Undo selektierte Tabellen beruecksichtigen ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, nStartTab, nEndTab ); - rDoc.CopyToDocument( rRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, pUndoDoc ); + rDoc.CopyToDocument( rRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, *pUndoDoc ); rDocShell.GetUndoManager()->AddUndoAction( new ScUndoTabOp( &rDocShell, @@ -4370,7 +4370,7 @@ bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark, ScRange aCopyRange = aDestArea; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::AUTOFILL, false, pUndoDoc, &aMark ); + rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::AUTOFILL, false, *pUndoDoc, &aMark ); } sal_uLong nProgCount; @@ -4486,7 +4486,7 @@ bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark, rDoc.CopyToDocument( aDestArea.aStart.Col(), aDestArea.aStart.Row(), 0, aDestArea.aEnd.Col(), aDestArea.aEnd.Row(), nTabCount-1, - InsertDeleteFlags::AUTOFILL, false, pUndoDoc, &aMark ); + InsertDeleteFlags::AUTOFILL, false, *pUndoDoc, &aMark ); } if (aDestArea.aStart.Col() <= aDestArea.aEnd.Col() && @@ -4641,7 +4641,7 @@ bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e rDoc.CopyToDocument( aDestArea.aStart.Col(), aDestArea.aStart.Row(), 0, aDestArea.aEnd.Col(), aDestArea.aEnd.Row(), nTabCount-1, - InsertDeleteFlags::AUTOFILL, false, pUndoDoc, &aMark ); + InsertDeleteFlags::AUTOFILL, false, *pUndoDoc, &aMark ); } sal_uLong nProgCount; @@ -4743,7 +4743,7 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo } // note captions are collected by drawing undo rDoc.CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab, - InsertDeleteFlags::ALL|InsertDeleteFlags::NOCAPTIONS, false, pUndoDoc ); + InsertDeleteFlags::ALL|InsertDeleteFlags::NOCAPTIONS, false, *pUndoDoc ); if( bHasNotes ) rDoc.BeginDrawUndo(); } @@ -4837,7 +4837,7 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, bool bRecord ) pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo(&rDoc, *rOption.maTabs.begin(), *rOption.maTabs.rbegin()); } - rDoc.CopyToDocument(aExtended, InsertDeleteFlags::ATTRIB, false, pUndoDoc); + rDoc.CopyToDocument(aExtended, InsertDeleteFlags::ATTRIB, false, *pUndoDoc); } const SfxPoolItem& rDefAttr = rDoc.GetPool()->GetDefaultItem( ATTR_MERGE ); @@ -5136,8 +5136,8 @@ bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, bool bApi ) { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, nTab, nTab ); - rDoc.CopyToDocument( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab, - InsertDeleteFlags::ALL, false, pUndoDoc ); + rDoc.CopyToDocument(nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab, + InsertDeleteFlags::ALL, false, *pUndoDoc); rDoc.BeginDrawUndo(); // wegen Hoehenanpassung } @@ -5182,8 +5182,8 @@ bool ScDocFunc::InsertNameList( const ScAddress& rStartPos, bool bApi ) { ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO ); pRedoDoc->InitUndo( &rDoc, nTab, nTab ); - rDoc.CopyToDocument( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab, - InsertDeleteFlags::ALL, false, pRedoDoc ); + rDoc.CopyToDocument(nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab, + InsertDeleteFlags::ALL, false, *pRedoDoc); rDocShell.GetUndoManager()->AddUndoAction( new ScUndoListNames( &rDocShell, @@ -5362,9 +5362,9 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor aCompleteRange.ExtendTo(pOldFormat->GetRange().Combine()); } - rDoc.CopyToDocument( aCompleteRange.aStart.Col(),aCompleteRange.aStart.Row(),nTab, - aCompleteRange.aEnd.Col(),aCompleteRange.aEnd.Row(),nTab, - InsertDeleteFlags::ALL, false, pUndoDoc ); + rDoc.CopyToDocument(aCompleteRange.aStart.Col(),aCompleteRange.aStart.Row(),nTab, + aCompleteRange.aEnd.Col(),aCompleteRange.aEnd.Row(),nTab, + InsertDeleteFlags::ALL, false, *pUndoDoc); } std::unique_ptr<ScRange> pRepaintRange; @@ -5397,9 +5397,9 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor { ScDocument* pRedoDoc = new ScDocument(SCDOCMODE_UNDO); pRedoDoc->InitUndo( &rDoc, nTab, nTab ); - rDoc.CopyToDocument( aCompleteRange.aStart.Col(),aCompleteRange.aStart.Row(),nTab, - aCompleteRange.aEnd.Col(),aCompleteRange.aEnd.Row(),nTab, - InsertDeleteFlags::ALL, false, pRedoDoc ); + rDoc.CopyToDocument(aCompleteRange.aStart.Col(),aCompleteRange.aStart.Row(),nTab, + aCompleteRange.aEnd.Col(),aCompleteRange.aEnd.Row(),nTab, + InsertDeleteFlags::ALL, false, *pRedoDoc); rDocShell.GetUndoManager()->AddUndoAction( new ScUndoConditionalFormat(&rDocShell, pUndoDoc, pRedoDoc, aCompleteRange)); } diff --git a/sc/source/ui/docshell/docfuncutil.cxx b/sc/source/ui/docshell/docfuncutil.cxx index 86d82d910bd1..1eede21b952d 100644 --- a/sc/source/ui/docshell/docfuncutil.cxx +++ b/sc/source/ui/docshell/docfuncutil.cxx @@ -69,7 +69,7 @@ std::unique_ptr<ScDocument> DocFuncUtil::createDeleteContentsUndoDoc( nUndoDocFlags |= InsertDeleteFlags::CONTENTS; // copy all cells with their notes // do not copy note captions to undo document nUndoDocFlags |= InsertDeleteFlags::NOCAPTIONS; - rDoc.CopyToDocument(aCopyRange, nUndoDocFlags, bOnlyMarked, pUndoDoc.get(), &rMark); + rDoc.CopyToDocument(aCopyRange, nUndoDocFlags, bOnlyMarked, *pUndoDoc, &rMark); return pUndoDoc; } diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index a438bda934dd..4778dc103e99 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -564,21 +564,21 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, bool bRecord ) pUndoDoc->InitUndo( &aDocument, 0, nTabCount-1, false, true ); // Zeilenstatus - aDocument.CopyToDocument( 0,0,nDestTab, MAXCOL,MAXROW,nDestTab, - InsertDeleteFlags::NONE, false, pUndoDoc ); + aDocument.CopyToDocument(0, 0, nDestTab, MAXCOL, MAXROW, nDestTab, + InsertDeleteFlags::NONE, false, *pUndoDoc); // alle Formeln - aDocument.CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, - InsertDeleteFlags::FORMULA, false, pUndoDoc ); + aDocument.CopyToDocument(0, 0, 0, MAXCOL, MAXROW, nTabCount-1, + InsertDeleteFlags::FORMULA, false, *pUndoDoc); // komplette Ausgangszeilen - aDocument.CopyToDocument( 0,aDestArea.nRowStart,nDestTab, - MAXCOL,aDestArea.nRowEnd,nDestTab, - InsertDeleteFlags::ALL, false, pUndoDoc ); + aDocument.CopyToDocument(0, aDestArea.nRowStart, nDestTab, + MAXCOL,aDestArea.nRowEnd, nDestTab, + InsertDeleteFlags::ALL, false, *pUndoDoc); // alten Ausgabebereich if (pDestData) - aDocument.CopyToDocument( aOldDest, InsertDeleteFlags::ALL, false, pUndoDoc ); + aDocument.CopyToDocument(aOldDest, InsertDeleteFlags::ALL, false, *pUndoDoc); GetUndoManager()->AddUndoAction( new ScUndoConsolidate( this, aDestArea, rParam, pUndoDoc, @@ -589,13 +589,13 @@ void ScDocShell::DoConsolidate( const ScConsolidateParam& rParam, bool bRecord ) ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &aDocument, aDestArea.nTab, aDestArea.nTab ); - aDocument.CopyToDocument( aDestArea.nColStart, aDestArea.nRowStart, aDestArea.nTab, - aDestArea.nColEnd, aDestArea.nRowEnd, aDestArea.nTab, - InsertDeleteFlags::ALL, false, pUndoDoc ); + aDocument.CopyToDocument(aDestArea.nColStart, aDestArea.nRowStart, aDestArea.nTab, + aDestArea.nColEnd, aDestArea.nRowEnd, aDestArea.nTab, + InsertDeleteFlags::ALL, false, *pUndoDoc); // alten Ausgabebereich if (pDestData) - aDocument.CopyToDocument( aOldDest, InsertDeleteFlags::ALL, false, pUndoDoc ); + aDocument.CopyToDocument(aOldDest, InsertDeleteFlags::ALL, false, *pUndoDoc); GetUndoManager()->AddUndoAction( new ScUndoConsolidate( this, aDestArea, rParam, pUndoDoc, @@ -678,8 +678,9 @@ void ScDocShell::UseScenario( SCTAB nTab, const OUString& rName, bool bRecord ) ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &aDocument, nTab,nEndTab ); // auch alle Szenarien // angezeigte Tabelle: - aDocument.CopyToDocument( nStartCol,nStartRow,nTab, - nEndCol,nEndRow,nTab, InsertDeleteFlags::ALL,true, pUndoDoc, &aScenMark ); + aDocument.CopyToDocument(nStartCol, nStartRow, nTab, + nEndCol, nEndRow, nTab, InsertDeleteFlags::ALL, + true, *pUndoDoc, &aScenMark); // Szenarien for (SCTAB i=nTab+1; i<=nEndTab; i++) { @@ -693,8 +694,8 @@ void ScDocShell::UseScenario( SCTAB nTab, const OUString& rName, bool bRecord ) pUndoDoc->SetActiveScenario( i, bActive ); // Bei Zurueckkopier-Szenarios auch Inhalte if ( nScenFlags & ScScenarioFlags::TwoWay ) - aDocument.CopyToDocument( 0,0,i, MAXCOL,MAXROW,i, - InsertDeleteFlags::ALL,false, pUndoDoc ); + aDocument.CopyToDocument(0, 0, i, MAXCOL, MAXROW, i, + InsertDeleteFlags::ALL, false, *pUndoDoc ); } GetUndoManager()->AddUndoAction( diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index a6df957c4cb9..0b63cc1189b6 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -231,7 +231,7 @@ bool ScImportExport::StartPaste() { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() ); - pDoc->CopyToDocument( aRange, InsertDeleteFlags::ALL | InsertDeleteFlags::NOCAPTIONS, false, pUndoDoc ); + pDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL | InsertDeleteFlags::NOCAPTIONS, false, *pUndoDoc); } return true; } @@ -246,7 +246,7 @@ void ScImportExport::EndPaste(bool bAutoRowHeight) { ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO ); pRedoDoc->InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() ); - pDoc->CopyToDocument( aRange, InsertDeleteFlags::ALL | InsertDeleteFlags::NOCAPTIONS, false, pRedoDoc ); + pDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL | InsertDeleteFlags::NOCAPTIONS, false, *pRedoDoc); ScMarkData aDestMark; aDestMark.SetMarkArea(aRange); pDocSh->GetUndoManager()->AddUndoAction( @@ -2162,7 +2162,7 @@ bool ScImportExport::Dif2Doc( SvStream& rStrm ) { InsertDeleteFlags nFlags = InsertDeleteFlags::ALL & ~InsertDeleteFlags::STYLES; pDoc->DeleteAreaTab( aRange, nFlags ); - pImportDoc->CopyToDocument( aRange, nFlags, false, pDoc ); + pImportDoc->CopyToDocument(aRange, nFlags, false, *pDoc); EndPaste(); } diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx index 076590274291..ce3410e56709 100644 --- a/sc/source/ui/docshell/olinefun.cxx +++ b/sc/source/ui/docshell/olinefun.cxx @@ -221,8 +221,8 @@ bool ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, bool bRecord ) ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true ); - rDoc.CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); - rDoc.CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument(nStartCol, 0, nTab, nEndCol, MAXROW, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); + rDoc.CopyToDocument(0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); ScOutlineTable* pUndoTab = new ScOutlineTable( *pTable ); @@ -285,8 +285,8 @@ void ScOutlineDocFunc::AutoOutline( const ScRange& rRange, bool bRecord ) pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true ); - rDoc.CopyToDocument( nOutStartCol, 0, nTab, nOutEndCol, MAXROW, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); - rDoc.CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument(nOutStartCol, 0, nTab, nOutEndCol, MAXROW, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); + rDoc.CopyToDocument(0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); } // einblenden @@ -336,14 +336,14 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel if (bColumns) { pUndoDoc->InitUndo( &rDoc, nTab, nTab, true ); - rDoc.CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab, - static_cast<SCCOL>(nEnd), MAXROW, nTab, InsertDeleteFlags::NONE, false, - pUndoDoc ); + rDoc.CopyToDocument(static_cast<SCCOL>(nStart), 0, nTab, + static_cast<SCCOL>(nEnd), MAXROW, nTab, InsertDeleteFlags::NONE, false, + *pUndoDoc); } else { pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true ); - rDoc.CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument(0, nStart, nTab, MAXCOL, nEnd, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); } rDocShell.GetUndoManager()->AddUndoAction( @@ -435,8 +435,8 @@ bool ScOutlineDocFunc::ShowMarkedOutlines( const ScRange& rRange, bool bRecord ) ScOutlineTable* pUndoTab = new ScOutlineTable( *pTable ); ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true ); - rDoc.CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); - rDoc.CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument(nStartCol, 0, nTab, nEndCol, MAXROW, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); + rDoc.CopyToDocument(0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); rDocShell.GetUndoManager()->AddUndoAction( new ScUndoOutlineBlock( &rDocShell, @@ -549,10 +549,10 @@ bool ScOutlineDocFunc::HideMarkedOutlines( const ScRange& rRange, bool bRecord ) ScOutlineTable* pUndoTab = new ScOutlineTable( *pTable ); ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true ); - rDoc.CopyToDocument( static_cast<SCCOL>(nEffStartCol), 0, nTab, - static_cast<SCCOL>(nEffEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, - false, pUndoDoc ); - rDoc.CopyToDocument( 0, nEffStartRow, nTab, MAXCOL, nEffEndRow, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument(static_cast<SCCOL>(nEffStartCol), 0, nTab, + static_cast<SCCOL>(nEffEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, + false, *pUndoDoc); + rDoc.CopyToDocument(0, nEffStartRow, nTab, MAXCOL, nEffEndRow, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); rDocShell.GetUndoManager()->AddUndoAction( new ScUndoOutlineBlock( &rDocShell, @@ -619,14 +619,14 @@ bool ScOutlineDocFunc::ShowOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel if (bColumns) { pUndoDoc->InitUndo( &rDoc, nTab, nTab, true ); - rDoc.CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab, - static_cast<SCCOL>(nEnd), MAXROW, nTab, InsertDeleteFlags::NONE, false, - pUndoDoc ); + rDoc.CopyToDocument(static_cast<SCCOL>(nStart), 0, nTab, + static_cast<SCCOL>(nEnd), MAXROW, nTab, InsertDeleteFlags::NONE, false, + *pUndoDoc); } else { pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true ); - rDoc.CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument(0, nStart, nTab, MAXCOL, nEnd, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); } rDocShell.GetUndoManager()->AddUndoAction( @@ -703,14 +703,14 @@ bool ScOutlineDocFunc::HideOutline( SCTAB nTab, bool bColumns, sal_uInt16 nLevel if (bColumns) { pUndoDoc->InitUndo( &rDoc, nTab, nTab, true ); - rDoc.CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab, - static_cast<SCCOL>(nEnd), MAXROW, nTab, InsertDeleteFlags::NONE, false, - pUndoDoc ); + rDoc.CopyToDocument(static_cast<SCCOL>(nStart), 0, nTab, + static_cast<SCCOL>(nEnd), MAXROW, nTab, InsertDeleteFlags::NONE, false, + *pUndoDoc); } else { pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, true ); - rDoc.CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument(0, nStart, nTab, MAXCOL, nEnd, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); } rDocShell.GetUndoManager()->AddUndoAction( diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index c5a29f3fc80b..78869f91db5b 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -234,7 +234,7 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter, pUndoDoc->AddUndoTab( nTab, nTab, true, true ); bFirst = false; ScRange aRange(0,0,nTab,MAXCOL,MAXROW,nTab); - rDoc.CopyToDocument(aRange, InsertDeleteFlags::ALL, false, pUndoDoc); + rDoc.CopyToDocument(aRange, InsertDeleteFlags::ALL, false, *pUndoDoc); pUndoDoc->TransferDrawPage( &rDoc, nTab, nTab ); pUndoDoc->SetLink( nTab, nMode, aFileName, aFilterName, aOptions, aTabName, GetRefreshDelay() ); diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index 6d59c1d18970..5602bed8c6ef 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -477,7 +477,7 @@ void ScMoveUndo::UndoRef() { ScDocument& rDoc = pDocShell->GetDocument(); ScRange aRange(0,0,0, MAXCOL,MAXROW,pRefUndoDoc->GetTableCount()-1); - pRefUndoDoc->CopyToDocument( aRange, InsertDeleteFlags::FORMULA, false, &rDoc, nullptr, false ); + pRefUndoDoc->CopyToDocument(aRange, InsertDeleteFlags::FORMULA, false, rDoc, nullptr, false); if (pRefUndoData) pRefUndoData->DoUndo( &rDoc, (eMode == SC_UNDO_REFFIRST) ); // HACK: ScDragDropUndo is the only one with REFFIRST. diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index fe6a3bca3652..a79c621287af 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -406,8 +406,8 @@ void ScUndoDeleteCells::DoChange( const bool bUndo ) // if Undo, restore references for( i=0; i<nCount && bUndo; i++ ) { - pRefUndoDoc->CopyToDocument( aEffRange.aStart.Col(), aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Col(), aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i], - InsertDeleteFlags::ALL | InsertDeleteFlags::NOCAPTIONS, false, &rDoc ); + pRefUndoDoc->CopyToDocument(aEffRange.aStart.Col(), aEffRange.aStart.Row(), pTabs[i], aEffRange.aEnd.Col(), aEffRange.aEnd.Row(), pTabs[i]+pScenarios[i], + InsertDeleteFlags::ALL | InsertDeleteFlags::NOCAPTIONS, false, rDoc); } ScRange aWorkRange( aEffRange ); @@ -667,10 +667,10 @@ void ScUndoDeleteMulti::Undo() SCCOLROW nStart = it->mnStart; SCCOLROW nEnd = it->mnEnd; if (mbRows) - pRefUndoDoc->CopyToDocument( 0,nStart,nTab, MAXCOL,nEnd,nTab, InsertDeleteFlags::ALL,false, &rDoc ); + pRefUndoDoc->CopyToDocument(0, nStart, nTab, MAXCOL, nEnd, nTab, InsertDeleteFlags::ALL, false, rDoc); else - pRefUndoDoc->CopyToDocument( static_cast<SCCOL>(nStart),0,nTab, - static_cast<SCCOL>(nEnd),MAXROW,nTab, InsertDeleteFlags::ALL,false, &rDoc ); + pRefUndoDoc->CopyToDocument(static_cast<SCCOL>(nStart),0,nTab, + static_cast<SCCOL>(nEnd), MAXROW, nTab, InsertDeleteFlags::ALL, false, rDoc); } ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack(); @@ -771,7 +771,7 @@ void ScUndoCut::DoChange( const bool bUndo ) ScRange aCopyRange = aExtendedRange; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - pUndoDoc->CopyToDocument( aCopyRange, nUndoFlags, false, &rDoc ); + pUndoDoc->CopyToDocument(aCopyRange, nUndoFlags, false, rDoc); ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack(); if ( pChangeTrack ) pChangeTrack->Undo( nStartChangeAction, nEndChangeAction ); @@ -931,7 +931,7 @@ void ScUndoPaste::DoChange(bool bUndo) ScRange aCopyRange = *maBlockRanges[i]; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - rDoc.CopyToDocument( aCopyRange, nUndoFlags, false, pRedoDoc ); + rDoc.CopyToDocument(aCopyRange, nUndoFlags, false, *pRedoDoc); bRedoFilled = true; } } @@ -956,7 +956,7 @@ void ScUndoPaste::DoChange(bool bUndo) ScRange aRange = *maBlockRanges[i]; aRange.aStart.SetTab(nFirstSelected); aRange.aEnd.SetTab(nFirstSelected); - pRedoDoc->UndoToDocument(aRange, nUndoFlags, false, &rDoc); + pRedoDoc->UndoToDocument(aRange, nUndoFlags, false, rDoc); ScMarkData::iterator itr = aMarkData.begin(), itrEnd = aMarkData.end(); for (; itr != itrEnd && *itr < nTabCount; ++itr) { @@ -965,7 +965,7 @@ void ScUndoPaste::DoChange(bool bUndo) aRange.aStart.SetTab(*itr); aRange.aEnd.SetTab(*itr); - pRedoDoc->CopyToDocument( aRange, nUndoFlags, false, &rDoc ); + pRedoDoc->CopyToDocument(aRange, nUndoFlags, false, rDoc); } } } @@ -991,7 +991,7 @@ void ScUndoPaste::DoChange(bool bUndo) { aRange.aStart.SetTab(*itr); aRange.aEnd.SetTab(*itr); - pUndoDoc->UndoToDocument(aRange, nUndoFlags, false, &rDoc); + pUndoDoc->UndoToDocument(aRange, nUndoFlags, false, rDoc); } } } @@ -1234,7 +1234,7 @@ void ScUndoDragDrop::DoUndo( ScRange aRange ) InsertDeleteFlags nDelFlags = nUndoFlags | InsertDeleteFlags::FORGETCAPTIONS; rDoc.DeleteAreaTab( aRange, nDelFlags ); - pRefUndoDoc->CopyToDocument( aRange, nUndoFlags, false, &rDoc ); + pRefUndoDoc->CopyToDocument(aRange, nUndoFlags, false, rDoc); if ( rDoc.HasAttrib( aRange, HASATTR_MERGED ) ) rDoc.ExtendMerge( aRange, true ); @@ -1457,7 +1457,7 @@ void ScUndoListNames::DoChange( ScDocument* pSrcDoc ) const ScDocument& rDoc = pDocShell->GetDocument(); rDoc.DeleteAreaTab( aBlockRange, InsertDeleteFlags::ALL ); - pSrcDoc->CopyToDocument( aBlockRange, InsertDeleteFlags::ALL, false, &rDoc ); + pSrcDoc->CopyToDocument(aBlockRange, InsertDeleteFlags::ALL, false, rDoc); pDocShell->PostPaint( aBlockRange, PAINT_GRID ); pDocShell->PostDataChanged(); ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); @@ -1523,7 +1523,7 @@ void ScUndoConditionalFormat::DoChange(ScDocument* pSrcDoc) ScDocument& rDoc = pDocShell->GetDocument(); rDoc.DeleteAreaTab( maRange, InsertDeleteFlags::ALL ); - pSrcDoc->CopyToDocument( maRange, InsertDeleteFlags::ALL, false, &rDoc ); + pSrcDoc->CopyToDocument(maRange, InsertDeleteFlags::ALL, false, rDoc); pDocShell->PostPaint( maRange, PAINT_GRID ); pDocShell->PostDataChanged(); ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); @@ -1581,7 +1581,7 @@ void ScUndoUseScenario::Undo() ScDocument& rDoc = pDocShell->GetDocument(); rDoc.DeleteSelection( InsertDeleteFlags::ALL, aMarkData ); - pUndoDoc->CopyToDocument( aRange, InsertDeleteFlags::ALL, true, &rDoc, &aMarkData ); + pUndoDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL, true, rDoc, &aMarkData); // scenario table bool bFrame = false; @@ -1603,7 +1603,7 @@ void ScUndoUseScenario::Undo() if ( nScenFlags & ScScenarioFlags::TwoWay ) { rDoc.DeleteAreaTab( 0,0, MAXCOL,MAXROW, i, InsertDeleteFlags::ALL ); - pUndoDoc->CopyToDocument( 0,0,i, MAXCOL,MAXROW,i, InsertDeleteFlags::ALL,false, &rDoc ); + pUndoDoc->CopyToDocument(0,0,i, MAXCOL,MAXROW,i, InsertDeleteFlags::ALL,false, rDoc); } if ( nScenFlags & ScScenarioFlags::ShowFrame ) bFrame = true; @@ -1703,7 +1703,7 @@ void ScUndoSelectionStyle::DoChange( const bool bUndo ) ScRange aCopyRange = aWorkRange; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - pUndoDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, true, &rDoc, &aMarkData ); + pUndoDoc->CopyToDocument(aCopyRange, InsertDeleteFlags::ATTRIB, true, rDoc, &aMarkData); } else // if Redo, then reapply style { @@ -1807,7 +1807,7 @@ void ScUndoEnterMatrix::Undo() ScDocument& rDoc = pDocShell->GetDocument(); rDoc.DeleteAreaTab( aBlockRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE ); - pUndoDoc->CopyToDocument( aBlockRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, &rDoc ); + pUndoDoc->CopyToDocument(aBlockRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, rDoc); pDocShell->PostPaint( aBlockRange, PAINT_GRID ); pDocShell->PostDataChanged(); ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); @@ -1893,7 +1893,7 @@ void ScUndoIndent::Undo() ScRange aCopyRange = aBlockRange; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - pUndoDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, true, &rDoc, &aMarkData ); + pUndoDoc->CopyToDocument(aCopyRange, InsertDeleteFlags::ATTRIB, true, rDoc, &aMarkData); pDocShell->PostPaint( aBlockRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE ); EndUndo(); @@ -1949,7 +1949,7 @@ void ScUndoTransliterate::Undo() ScRange aCopyRange = aBlockRange; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - pUndoDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::CONTENTS, true, &rDoc, &aMarkData ); + pUndoDoc->CopyToDocument(aCopyRange, InsertDeleteFlags::CONTENTS, true, rDoc, &aMarkData); pDocShell->PostPaint( aBlockRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE ); EndUndo(); @@ -2010,7 +2010,7 @@ void ScUndoClearItems::Undo() BeginUndo(); ScDocument& rDoc = pDocShell->GetDocument(); - pUndoDoc->CopyToDocument( aBlockRange, InsertDeleteFlags::ATTRIB, true, &rDoc, &aMarkData ); + pUndoDoc->CopyToDocument(aBlockRange, InsertDeleteFlags::ATTRIB, true, rDoc, &aMarkData); pDocShell->PostPaint( aBlockRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE ); EndUndo(); @@ -2067,7 +2067,7 @@ void ScUndoRemoveBreaks::Undo() ScDocument& rDoc = pDocShell->GetDocument(); ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); - pUndoDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::NONE, false, &rDoc ); + pUndoDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::NONE, false, rDoc); if (pViewShell) pViewShell->UpdatePageBreakData( true ); pDocShell->PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_GRID ); @@ -2142,7 +2142,7 @@ void ScUndoRemoveMerge::Undo() // There is no need to extend merge area because it's already been extended. ScRange aRange = maOption.getSingleRange(*itr); rDoc.DeleteAreaTab(aRange, InsertDeleteFlags::ATTRIB); - pUndoDoc->CopyToDocument(aRange, InsertDeleteFlags::ATTRIB, false, &rDoc); + pUndoDoc->CopyToDocument(aRange, InsertDeleteFlags::ATTRIB, false, rDoc); bool bDidPaint = false; if ( pViewShell ) @@ -2272,7 +2272,7 @@ void ScUndoBorder::Undo() ScDocument& rDoc = pDocShell->GetDocument(); ScMarkData aMarkData; aMarkData.MarkFromRangeList( *pRanges, false ); - pUndoDoc->CopyToDocument( aBlockRange, InsertDeleteFlags::ATTRIB, true, &rDoc, &aMarkData ); + pUndoDoc->CopyToDocument(aBlockRange, InsertDeleteFlags::ATTRIB, true, rDoc, &aMarkData); pDocShell->PostPaint( aBlockRange, PAINT_GRID, SC_PF_LINES | SC_PF_TESTMERGE ); EndUndo(); diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx index e4319494f534..8022ba606ed9 100644 --- a/sc/source/ui/undo/undoblk2.cxx +++ b/sc/source/ui/undo/undoblk2.cxx @@ -100,16 +100,16 @@ void ScUndoWidthOrHeight::Undo() { if (bWidth) // Width { - pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, *itr, - static_cast<SCCOL>(nEnd), MAXROW, *itr, InsertDeleteFlags::NONE, - false, &rDoc ); + pUndoDoc->CopyToDocument(static_cast<SCCOL>(nStart), 0, *itr, + static_cast<SCCOL>(nEnd), MAXROW, *itr, InsertDeleteFlags::NONE, + false, rDoc); rDoc.UpdatePageBreaks( *itr ); pDocShell->PostPaint( static_cast<SCCOL>(nPaintStart), 0, *itr, MAXCOL, MAXROW, *itr, PAINT_GRID | PAINT_TOP ); } else // Height { - pUndoDoc->CopyToDocument( 0, nStart, *itr, MAXCOL, nEnd, *itr, InsertDeleteFlags::NONE, false, &rDoc ); + pUndoDoc->CopyToDocument(0, nStart, *itr, MAXCOL, nEnd, *itr, InsertDeleteFlags::NONE, false, rDoc); rDoc.UpdatePageBreaks( *itr ); pDocShell->PostPaint( 0, nPaintStart, *itr, MAXCOL, MAXROW, *itr, PAINT_GRID | PAINT_LEFT ); } diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 6d29e11c2b78..2c7fa64bc6d2 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -134,7 +134,7 @@ void ScUndoDeleteContents::DoChange( const bool bUndo ) aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - pUndoDoc->CopyToDocument( aCopyRange, nUndoFlags, bMulti, &rDoc, &aMarkData ); + pUndoDoc->CopyToDocument(aCopyRange, nUndoFlags, bMulti, rDoc, &aMarkData); DoSdrUndoAction( pDrawUndo, &rDoc ); @@ -284,7 +284,7 @@ void ScUndoFillTable::DoChange( const bool bUndo ) rDoc.DeleteSelectionTab( *itr, InsertDeleteFlags::ALL, aMarkData ); else rDoc.DeleteAreaTab( aWorkRange, InsertDeleteFlags::ALL ); - pUndoDoc->CopyToDocument( aWorkRange, InsertDeleteFlags::ALL, bMulti, &rDoc, &aMarkData ); + pUndoDoc->CopyToDocument(aWorkRange, InsertDeleteFlags::ALL, bMulti, rDoc, &aMarkData); } ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack(); @@ -406,7 +406,7 @@ void ScUndoSelectionAttr::DoChange( const bool bUndo ) SCTAB nTabCount = rDoc.GetTableCount(); aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - pUndoDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, bMulti, &rDoc, &aMarkData ); + pUndoDoc->CopyToDocument(aCopyRange, InsertDeleteFlags::ATTRIB, bMulti, rDoc, &aMarkData); } else // only for Redo { @@ -538,7 +538,7 @@ void ScUndoAutoFill::Undo() sal_uInt16 nExtFlags = 0; pDocShell->UpdatePaintExt( nExtFlags, aWorkRange ); rDoc.DeleteAreaTab( aWorkRange, InsertDeleteFlags::AUTOFILL ); - pUndoDoc->CopyToDocument( aWorkRange, InsertDeleteFlags::AUTOFILL, false, &rDoc ); + pUndoDoc->CopyToDocument(aWorkRange, InsertDeleteFlags::AUTOFILL, false, rDoc); // Actually we'd only need to broadcast the cells inserted during // CopyToDocument(), as DeleteAreaTab() broadcasts deleted cells. For @@ -702,7 +702,7 @@ void ScUndoMerge::DoChange( bool bUndo ) const if (bUndo && mpUndoDoc) { rDoc.DeleteAreaTab( aRange, InsertDeleteFlags::CONTENTS|InsertDeleteFlags::NOCAPTIONS ); - mpUndoDoc->CopyToDocument( aRange, InsertDeleteFlags::ALL|InsertDeleteFlags::NOCAPTIONS, false, &rDoc ); + mpUndoDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL|InsertDeleteFlags::NOCAPTIONS, false, rDoc); } // redo -> merge contents again @@ -795,7 +795,7 @@ void ScUndoAutoFormat::Undo() ScRange aCopyRange = aBlockRange; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - pUndoDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, false, &rDoc, &aMarkData ); + pUndoDoc->CopyToDocument(aCopyRange, InsertDeleteFlags::ATTRIB, false, rDoc, &aMarkData); // cell heights and widths (InsertDeleteFlags::NONE) if (bSize) @@ -808,9 +808,9 @@ void ScUndoAutoFormat::Undo() SCTAB nEndZ = aBlockRange.aEnd.Tab(); pUndoDoc->CopyToDocument( nStartX, 0, 0, nEndX, MAXROW, nTabCount-1, - InsertDeleteFlags::NONE, false, &rDoc, &aMarkData ); + InsertDeleteFlags::NONE, false, rDoc, &aMarkData ); pUndoDoc->CopyToDocument( 0, nStartY, 0, MAXCOL, nEndY, nTabCount-1, - InsertDeleteFlags::NONE, false, &rDoc, &aMarkData ); + InsertDeleteFlags::NONE, false, rDoc, &aMarkData ); pDocShell->PostPaint( 0, 0, nStartZ, MAXCOL, MAXROW, nEndZ, PAINT_GRID | PAINT_LEFT | PAINT_TOP, SC_PF_LINES ); } @@ -989,7 +989,7 @@ void ScUndoReplace::Undo() InsertDeleteFlags nUndoFlags = (pSearchItem->GetPattern()) ? InsertDeleteFlags::ATTRIB : InsertDeleteFlags::CONTENTS; pUndoDoc->CopyToDocument( 0, 0, 0, MAXCOL, MAXROW, MAXTAB, - nUndoFlags, false, &rDoc, nullptr, false ); // without row flags + nUndoFlags, false, rDoc, nullptr, false ); // without row flags pDocShell->PostPaintGridAll(); } else if (pSearchItem->GetPattern() && @@ -1130,7 +1130,7 @@ void ScUndoTabOp::Undo() ScDocument& rDoc = pDocShell->GetDocument(); rDoc.DeleteAreaTab( aRange,InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE ); - pUndoDoc->CopyToDocument( aRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, &rDoc ); + pUndoDoc->CopyToDocument( aRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, rDoc ); pDocShell->PostPaint( aRange, PAINT_GRID, nExtFlags ); pDocShell->PostDataChanged(); ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); @@ -1233,7 +1233,7 @@ void ScUndoConversion::DoChange( ScDocument* pRefDoc, const ScAddress& rCursorPo bool bMulti = aMarkData.IsMultiMarked(); pRefDoc->CopyToDocument( 0, 0, 0, MAXCOL, MAXROW, nTabCount-1, - InsertDeleteFlags::CONTENTS, bMulti, &rDoc, &aMarkData ); + InsertDeleteFlags::CONTENTS, bMulti, rDoc, &aMarkData ); pDocShell->PostPaintGridAll(); } else @@ -1318,7 +1318,7 @@ void ScUndoRefConversion::DoChange( ScDocument* pRefDoc) SCTAB nTabCount = rDoc.GetTableCount(); aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - pRefDoc->CopyToDocument( aCopyRange, nFlags, bMulti, &rDoc, &aMarkData ); + pRefDoc->CopyToDocument( aCopyRange, nFlags, bMulti, rDoc, &aMarkData ); pDocShell->PostPaint( aRange, PAINT_GRID); pDocShell->PostDataChanged(); ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); @@ -1398,7 +1398,7 @@ void ScUndoRefreshLink::Undo() else pRedoDoc->AddUndoTab( nTab, nTab, true, true ); bFirst = false; - rDoc.CopyToDocument(aRange, InsertDeleteFlags::ALL, false, pRedoDoc); + rDoc.CopyToDocument(aRange, InsertDeleteFlags::ALL, false, *pRedoDoc); pRedoDoc->SetLink( nTab, rDoc.GetLinkMode(nTab), rDoc.GetLinkDoc(nTab), @@ -1410,7 +1410,7 @@ void ScUndoRefreshLink::Undo() } rDoc.DeleteAreaTab( aRange,InsertDeleteFlags::ALL ); - pUndoDoc->CopyToDocument( aRange, InsertDeleteFlags::ALL, false, &rDoc ); + pUndoDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL, false, rDoc); rDoc.SetLink( nTab, pUndoDoc->GetLinkMode(nTab), pUndoDoc->GetLinkDoc(nTab), pUndoDoc->GetLinkFlt(nTab), pUndoDoc->GetLinkOpt(nTab), pUndoDoc->GetLinkTab(nTab), @@ -1438,7 +1438,7 @@ void ScUndoRefreshLink::Redo() ScRange aRange(0,0,nTab,MAXCOL,MAXROW,nTab); rDoc.DeleteAreaTab( aRange, InsertDeleteFlags::ALL ); - pRedoDoc->CopyToDocument( aRange, InsertDeleteFlags::ALL, false, &rDoc ); + pRedoDoc->CopyToDocument(aRange, InsertDeleteFlags::ALL, false, rDoc); rDoc.SetLink( nTab, pRedoDoc->GetLinkMode(nTab), pRedoDoc->GetLinkDoc(nTab), @@ -1659,13 +1659,13 @@ void ScUndoUpdateAreaLink::DoChange( const bool bUndo ) const { rDoc.FitBlock( aNewRange, aOldRange ); rDoc.DeleteAreaTab( aOldRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE ); - pUndoDoc->UndoToDocument( aOldRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, &rDoc ); + pUndoDoc->UndoToDocument( aOldRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, rDoc ); } else { ScRange aCopyRange( aOldRange.aStart, ScAddress(nEndX,nEndY,nEndZ) ); rDoc.DeleteAreaTab( aCopyRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE ); - pUndoDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, &rDoc ); + pUndoDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, rDoc ); } } else @@ -1674,13 +1674,13 @@ void ScUndoUpdateAreaLink::DoChange( const bool bUndo ) const { rDoc.FitBlock( aOldRange, aNewRange ); rDoc.DeleteAreaTab( aNewRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE ); - pRedoDoc->CopyToDocument( aNewRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, &rDoc ); + pRedoDoc->CopyToDocument( aNewRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, rDoc ); } else { ScRange aCopyRange( aOldRange.aStart, ScAddress(nEndX,nEndY,nEndZ) ); rDoc.DeleteAreaTab( aCopyRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE ); - pRedoDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, &rDoc ); + pRedoDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, rDoc ); } } diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx index d85d32cf9b6f..c23439899b3b 100644 --- a/sc/source/ui/undo/undodat.cxx +++ b/sc/source/ui/undo/undodat.cxx @@ -97,10 +97,10 @@ void ScUndoDoOutline::Undo() // Original column/row status if (bColumns) - pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab, - static_cast<SCCOL>(nEnd), MAXROW, nTab, InsertDeleteFlags::NONE, false, &rDoc); + pUndoDoc->CopyToDocument(static_cast<SCCOL>(nStart), 0, nTab, + static_cast<SCCOL>(nEnd), MAXROW, nTab, InsertDeleteFlags::NONE, false, rDoc); else - pUndoDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, InsertDeleteFlags::NONE, false, &rDoc ); + pUndoDoc->CopyToDocument(0, nStart, nTab, MAXCOL, nEnd, nTab, InsertDeleteFlags::NONE, false, rDoc); pViewShell->UpdateScrollBars(); @@ -261,10 +261,10 @@ void ScUndoOutlineLevel::Undo() // Original column/row status if (bColumns) - pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStart), 0, nTab, - static_cast<SCCOL>(nEnd), MAXROW, nTab, InsertDeleteFlags::NONE, false, &rDoc); + pUndoDoc->CopyToDocument(static_cast<SCCOL>(nStart), 0, nTab, + static_cast<SCCOL>(nEnd), MAXROW, nTab, InsertDeleteFlags::NONE, false, rDoc); else - pUndoDoc->CopyToDocument( 0, nStart, nTab, MAXCOL, nEnd, nTab, InsertDeleteFlags::NONE, false, &rDoc ); + pUndoDoc->CopyToDocument(0, nStart, nTab, MAXCOL, nEnd, nTab, InsertDeleteFlags::NONE, false, rDoc); rDoc.UpdatePageBreaks( nTab ); @@ -360,9 +360,9 @@ void ScUndoOutlineBlock::Undo() pUndoTable->GetRowArray().ExtendBlock( nLevel, nStartRow, nEndRow ); } - pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStartCol), 0, nTab, - static_cast<SCCOL>(nEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, &rDoc ); - pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, &rDoc ); + pUndoDoc->CopyToDocument(static_cast<SCCOL>(nStartCol), 0, nTab, + static_cast<SCCOL>(nEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, rDoc); + pUndoDoc->CopyToDocument(0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, rDoc); rDoc.UpdatePageBreaks( nTab ); @@ -450,8 +450,8 @@ void ScUndoRemoveAllOutlines::Undo() SCROW nStartRow = aBlockStart.Row(); SCROW nEndRow = aBlockEnd.Row(); - pUndoDoc->CopyToDocument( nStartCol, 0, nTab, nEndCol, MAXROW, nTab, InsertDeleteFlags::NONE, false, &rDoc ); - pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, &rDoc ); + pUndoDoc->CopyToDocument(nStartCol, 0, nTab, nEndCol, MAXROW, nTab, InsertDeleteFlags::NONE, false, rDoc); + pUndoDoc->CopyToDocument(0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, rDoc); rDoc.UpdatePageBreaks( nTab ); @@ -539,10 +539,10 @@ void ScUndoAutoOutline::Undo() pUndoTable->GetColArray().GetRange( nStartCol, nEndCol ); pUndoTable->GetRowArray().GetRange( nStartRow, nEndRow ); - pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStartCol), 0, nTab, - static_cast<SCCOL>(nEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, - &rDoc); - pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, &rDoc ); + pUndoDoc->CopyToDocument(static_cast<SCCOL>(nStartCol), 0, nTab, + static_cast<SCCOL>(nEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, + rDoc); + pUndoDoc->CopyToDocument(0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, rDoc); pViewShell->UpdateScrollBars(); } @@ -656,10 +656,10 @@ void ScUndoSubTotals::Undo() pUndoTable->GetColArray().GetRange( nStartCol, nEndCol ); pUndoTable->GetRowArray().GetRange( nStartRow, nEndRow ); - pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStartCol), 0, nTab, - static_cast<SCCOL>(nEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, - &rDoc); - pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, &rDoc ); + pUndoDoc->CopyToDocument(static_cast<SCCOL>(nStartCol), 0, nTab, + static_cast<SCCOL>(nEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, + rDoc); + pUndoDoc->CopyToDocument(0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, rDoc); pViewShell->UpdateScrollBars(); } @@ -672,9 +672,9 @@ void ScUndoSubTotals::Undo() rDoc.DeleteAreaTab( 0,aParam.nRow1+1, MAXCOL,aParam.nRow2, nTab, InsertDeleteFlags::ALL ); pUndoDoc->CopyToDocument( 0, aParam.nRow1+1, nTab, MAXCOL, aParam.nRow2, nTab, - InsertDeleteFlags::NONE, false, &rDoc ); // Flags + InsertDeleteFlags::NONE, false, rDoc ); // Flags pUndoDoc->UndoToDocument( 0, aParam.nRow1+1, nTab, MAXCOL, aParam.nRow2, nTab, - InsertDeleteFlags::ALL, false, &rDoc ); + InsertDeleteFlags::ALL, false, rDoc ); ScUndoUtil::MarkSimpleBlock( pDocShell, aParam.nCol1,aParam.nRow1,nTab, aParam.nCol2,aParam.nRow2,nTab ); @@ -804,19 +804,19 @@ void ScUndoQuery::Undo() pUndoDoc->CopyToDocument( aQueryParam.nDestCol, aQueryParam.nDestRow, aQueryParam.nDestTab, nDestEndCol, nDestEndRow, aQueryParam.nDestTab, - InsertDeleteFlags::ALL, false, &rDoc ); + InsertDeleteFlags::ALL, false, rDoc ); // Attributes are always copied (#49287#) // rest of the old range if ( bDestArea && !bDoSize ) { rDoc.DeleteAreaTab( aOldDest, InsertDeleteFlags::ALL ); - pUndoDoc->CopyToDocument( aOldDest, InsertDeleteFlags::ALL, false, &rDoc ); + pUndoDoc->CopyToDocument(aOldDest, InsertDeleteFlags::ALL, false, rDoc); } } else - pUndoDoc->CopyToDocument( 0, aQueryParam.nRow1, nTab, MAXCOL, aQueryParam.nRow2, nTab, - InsertDeleteFlags::NONE, false, &rDoc ); + pUndoDoc->CopyToDocument(0, aQueryParam.nRow1, nTab, MAXCOL, aQueryParam.nRow2, nTab, + InsertDeleteFlags::NONE, false, rDoc); if (pUndoDB) rDoc.SetDBCollection( new ScDBCollection( *pUndoDB ), true ); @@ -1097,9 +1097,9 @@ void ScUndoImportData::Undo() rDoc.SetAutoCalc( false ); // outside of the loop for (SCCOL nCopyCol = nCol1; nCopyCol <= nCol2; nCopyCol++) { - rDoc.CopyToDocument( nCopyCol,nRow1,nTab, nCopyCol,nRow2,nTab, - InsertDeleteFlags::CONTENTS & ~InsertDeleteFlags::NOTE, false, pRedoDoc ); - rDoc.DeleteAreaTab( nCopyCol,nRow1, nCopyCol,nRow2, nTab, InsertDeleteFlags::CONTENTS & ~InsertDeleteFlags::NOTE ); + rDoc.CopyToDocument(nCopyCol,nRow1,nTab, nCopyCol,nRow2,nTab, + InsertDeleteFlags::CONTENTS & ~InsertDeleteFlags::NOTE, false, *pRedoDoc); + rDoc.DeleteAreaTab(nCopyCol,nRow1, nCopyCol,nRow2, nTab, InsertDeleteFlags::CONTENTS & ~InsertDeleteFlags::NOTE); } rDoc.SetAutoCalc( bOldAutoCalc ); bRedoFilled = true; @@ -1126,9 +1126,9 @@ void ScUndoImportData::Undo() rDoc.DeleteAreaTab( aImportParam.nCol1,aImportParam.nRow1, nEndCol,nEndRow, nTab, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE ); - pUndoDoc->CopyToDocument( aImportParam.nCol1,aImportParam.nRow1,nTab, - nEndCol+nFormulaCols,nEndRow,nTab, - InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, &rDoc ); + pUndoDoc->CopyToDocument(aImportParam.nCol1,aImportParam.nRow1,nTab, + nEndCol+nFormulaCols,nEndRow,nTab, + InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, rDoc); if (pCurrentData) { @@ -1189,14 +1189,14 @@ void ScUndoImportData::Redo() rDoc.DeleteAreaTab( aNew.aStart.Col(), aNew.aStart.Row(), aNew.aEnd.Col(), aNew.aEnd.Row(), nTab, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE ); - pRedoDoc->CopyToDocument( aNew, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, &rDoc ); // including formulas + pRedoDoc->CopyToDocument(aNew, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, rDoc); // including formulas } else { rDoc.DeleteAreaTab( aImportParam.nCol1,aImportParam.nRow1, nEndCol,nEndRow, nTab, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE ); - pRedoDoc->CopyToDocument( aImportParam.nCol1,aImportParam.nRow1,nTab, - nEndCol,nEndRow,nTab, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, &rDoc ); + pRedoDoc->CopyToDocument(aImportParam.nCol1,aImportParam.nRow1,nTab, + nEndCol,nEndRow,nTab, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, rDoc); } if (pCurrentData) @@ -1344,10 +1344,10 @@ void ScUndoRepeatDB::Undo() pUndoTable->GetColArray().GetRange( nStartCol, nEndCol ); pUndoTable->GetRowArray().GetRange( nStartRow, nEndRow ); - pUndoDoc->CopyToDocument( static_cast<SCCOL>(nStartCol), 0, nTab, - static_cast<SCCOL>(nEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, - &rDoc ); - pUndoDoc->CopyToDocument( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, &rDoc ); + pUndoDoc->CopyToDocument(static_cast<SCCOL>(nStartCol), 0, nTab, + static_cast<SCCOL>(nEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, + rDoc); + pUndoDoc->CopyToDocument(0, nStartRow, nTab, MAXCOL, nEndRow, nTab, InsertDeleteFlags::NONE, false, rDoc); pViewShell->UpdateScrollBars(); } @@ -1358,10 +1358,10 @@ void ScUndoRepeatDB::Undo() rDoc.DeleteAreaTab( 0, aBlockStart.Row(), MAXCOL, aBlockEnd.Row(), nTab, InsertDeleteFlags::ALL ); - pUndoDoc->CopyToDocument( 0, aBlockStart.Row(), nTab, MAXCOL, aBlockEnd.Row(), nTab, - InsertDeleteFlags::NONE, false, &rDoc ); // Flags - pUndoDoc->UndoToDocument( 0, aBlockStart.Row(), nTab, MAXCOL, aBlockEnd.Row(), nTab, - InsertDeleteFlags::ALL, false, &rDoc ); + pUndoDoc->CopyToDocument(0, aBlockStart.Row(), nTab, MAXCOL, aBlockEnd.Row(), nTab, + InsertDeleteFlags::NONE, false, rDoc); // Flags + pUndoDoc->UndoToDocument(0, aBlockStart.Row(), nTab, MAXCOL, aBlockEnd.Row(), nTab, + InsertDeleteFlags::ALL, false, rDoc); ScUndoUtil::MarkSimpleBlock( pDocShell, aBlockStart.Col(),aBlockStart.Row(),nTab, aBlockEnd.Col(),aBlockEnd.Row(),nTab ); @@ -1462,13 +1462,13 @@ void ScUndoDataPilot::Undo() { aNewRange = pNewDPObject->GetOutRange(); rDoc.DeleteAreaTab( aNewRange, InsertDeleteFlags::ALL ); - pNewUndoDoc->CopyToDocument( aNewRange, InsertDeleteFlags::ALL, false, &rDoc ); + pNewUndoDoc->CopyToDocument(aNewRange, InsertDeleteFlags::ALL, false, rDoc); } if ( pOldDPObject && pOldUndoDoc ) { aOldRange = pOldDPObject->GetOutRange(); rDoc.DeleteAreaTab( aOldRange, InsertDeleteFlags::ALL ); - pOldUndoDoc->CopyToDocument( aOldRange, InsertDeleteFlags::ALL, false, &rDoc ); + pOldUndoDoc->CopyToDocument(aOldRange, InsertDeleteFlags::ALL, false, rDoc); } // update objects in collection @@ -1615,19 +1615,19 @@ void ScUndoConsolidate::Undo() rDoc.SetOutlineTable( nTab, pUndoTab ); // Row status - pUndoDoc->CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::NONE, false, &rDoc ); + pUndoDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::NONE, false, rDoc); // Data and references rDoc.DeleteAreaTab( 0,aDestArea.nRowStart, MAXCOL,aDestArea.nRowEnd, nTab, InsertDeleteFlags::ALL ); - pUndoDoc->UndoToDocument( 0, aDestArea.nRowStart, nTab, - MAXCOL, aDestArea.nRowEnd, nTab, - InsertDeleteFlags::ALL, false, &rDoc ); + pUndoDoc->UndoToDocument(0, aDestArea.nRowStart, nTab, + MAXCOL, aDestArea.nRowEnd, nTab, + InsertDeleteFlags::ALL, false, rDoc); // Original range if (pUndoData) { rDoc.DeleteAreaTab(aOldRange, InsertDeleteFlags::ALL); - pUndoDoc->CopyToDocument(aOldRange, InsertDeleteFlags::ALL, false, &rDoc); + pUndoDoc->CopyToDocument(aOldRange, InsertDeleteFlags::ALL, false, rDoc); } pDocShell->PostPaint( 0,aDestArea.nRowStart,nTab, MAXCOL,MAXROW,nTab, @@ -1638,14 +1638,14 @@ void ScUndoConsolidate::Undo() rDoc.DeleteAreaTab( aDestArea.nColStart,aDestArea.nRowStart, aDestArea.nColEnd,aDestArea.nRowEnd, nTab, InsertDeleteFlags::ALL ); pUndoDoc->CopyToDocument( aDestArea.nColStart, aDestArea.nRowStart, nTab, - aDestArea.nColEnd, aDestArea.nRowEnd, nTab, - InsertDeleteFlags::ALL, false, &rDoc ); + aDestArea.nColEnd, aDestArea.nRowEnd, nTab, + InsertDeleteFlags::ALL, false, rDoc); // Original range if (pUndoData) { rDoc.DeleteAreaTab(aOldRange, InsertDeleteFlags::ALL); - pUndoDoc->CopyToDocument(aOldRange, InsertDeleteFlags::ALL, false, &rDoc); + pUndoDoc->CopyToDocument(aOldRange, InsertDeleteFlags::ALL, false, rDoc); } SCCOL nEndX = aDestArea.nColEnd; @@ -1905,7 +1905,7 @@ void ScUndoDataForm::DoChange( const bool bUndo ) ScRange aCopyRange = aBlockRange; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::VALUE, false, pRedoDoc ); + rDoc.CopyToDocument(aCopyRange, InsertDeleteFlags::VALUE, false, *pRedoDoc); bRedoFilled = true; } diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx index 216070b93c51..351842ae20b1 100644 --- a/sc/source/ui/undo/undotab.cxx +++ b/sc/source/ui/undo/undotab.cxx @@ -313,7 +313,7 @@ void ScUndoDeleteTab::Undo() bDrawIsInUndo = false; if (bOk) { - pRefUndoDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::ALL,false, &rDoc ); + pRefUndoDoc->CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::ALL,false, rDoc); OUString aOldName; pRefUndoDoc->GetName( nTab, aOldName ); @@ -921,7 +921,7 @@ void ScUndoImportTab::Undo() { SCTAB nTabPos=nTab+i; - rDoc.CopyToDocument(0,0,nTabPos, MAXCOL,MAXROW,nTabPos, InsertDeleteFlags::ALL,false, pRedoDoc ); + rDoc.CopyToDocument(0,0,nTabPos, MAXCOL,MAXROW,nTabPos, InsertDeleteFlags::ALL,false, *pRedoDoc); rDoc.GetName( nTabPos, aOldName ); pRedoDoc->RenameTab( nTabPos, aOldName, false ); pRedoDoc->SetTabBgColor( nTabPos, rDoc.GetTabBgColor(nTabPos) ); @@ -978,7 +978,7 @@ void ScUndoImportTab::Redo() for (i=0; i<nCount; i++) // then copy into inserted sheets { SCTAB nTabPos=nTab+i; - pRedoDoc->CopyToDocument(0,0,nTabPos, MAXCOL,MAXROW,nTabPos, InsertDeleteFlags::ALL,false, &rDoc ); + pRedoDoc->CopyToDocument(0,0,nTabPos, MAXCOL,MAXROW,nTabPos, InsertDeleteFlags::ALL,false, rDoc); rDoc.SetTabBgColor( nTabPos, pRedoDoc->GetTabBgColor(nTabPos) ); if ( pRedoDoc->IsScenario(nTabPos) ) diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 63b82daedbb3..58e5541088c1 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -1063,7 +1063,7 @@ void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& r pUndoDoc->InitUndo( &rDoc, nTab, nTab ); else pUndoDoc->AddUndoTab( nTab, nTab ); - rDoc.CopyToDocument( aRange, InsertDeleteFlags::ATTRIB, false, pUndoDoc ); + rDoc.CopyToDocument(aRange, InsertDeleteFlags::ATTRIB, false, *pUndoDoc); } ScMarkData aMark; @@ -1123,7 +1123,7 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange, { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, nTab, nTab ); - rDoc.CopyToDocument( rRange, InsertDeleteFlags::CONTENTS|InsertDeleteFlags::NOCAPTIONS, false, pUndoDoc ); + rDoc.CopyToDocument(rRange, InsertDeleteFlags::CONTENTS|InsertDeleteFlags::NOCAPTIONS, false, *pUndoDoc); } rDoc.DeleteAreaTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, InsertDeleteFlags::CONTENTS ); @@ -1262,7 +1262,7 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange, { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, nTab, nTab ); - rDoc.CopyToDocument( rRange, InsertDeleteFlags::CONTENTS, false, pUndoDoc ); + rDoc.CopyToDocument(rRange, InsertDeleteFlags::CONTENTS, false, *pUndoDoc); } rDoc.DeleteAreaTab( nStartCol, nStartRow, nEndCol, nEndRow, nTab, InsertDeleteFlags::CONTENTS ); @@ -7126,7 +7126,7 @@ void SAL_CALL ScTableSheetObj::removeAllManualPageBreaks() throw(uno::RuntimeExc { ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true ); - rDoc.CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::NONE, false, *pUndoDoc); pDocSh->GetUndoManager()->AddUndoAction( new ScUndoRemoveBreaks( pDocSh, nTab, pUndoDoc ) ); } diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 26916f85d4e4..5b049d98caa5 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -431,19 +431,19 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, bool bRecord, pTable->GetRowArray().GetRange( nOutStartRow, nOutEndRow ); pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true ); - rDoc.CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); - rDoc.CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc ); + rDoc.CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc ); } else pUndoDoc->InitUndo( &rDoc, nTab, nTab, false, bOldFilter ); // record data range - including filter results rDoc.CopyToDocument( 0,rParam.nRow1+1,nTab, MAXCOL,rParam.nRow2,nTab, - InsertDeleteFlags::ALL, false, pUndoDoc ); + InsertDeleteFlags::ALL, false, *pUndoDoc ); // all formulas for reference rDoc.CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, - InsertDeleteFlags::FORMULA, false, pUndoDoc ); + InsertDeleteFlags::FORMULA, false, *pUndoDoc ); // data base and othe ranges ScRangeName* pDocRange = rDoc.GetRangeName(); @@ -2126,17 +2126,17 @@ void ScDBFunc::RepeatDB( bool bRecord ) pTable->GetRowArray().GetRange( nOutStartRow, nOutEndRow ); pUndoDoc->InitUndo( pDoc, nTab, nTab, true, true ); - pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); - pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + pDoc->CopyToDocument( static_cast<SCCOL>(nOutStartCol), 0, nTab, static_cast<SCCOL>(nOutEndCol), MAXROW, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc ); + pDoc->CopyToDocument( 0, nOutStartRow, nTab, MAXCOL, nOutEndRow, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc ); } else pUndoDoc->InitUndo( pDoc, nTab, nTab, false, true ); // Record data range - including filter results - pDoc->CopyToDocument( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab, InsertDeleteFlags::ALL, false, pUndoDoc ); + pDoc->CopyToDocument( 0,nStartRow,nTab, MAXCOL,nEndRow,nTab, InsertDeleteFlags::ALL, false, *pUndoDoc ); // all formulas for reference - pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, InsertDeleteFlags::FORMULA, false, pUndoDoc ); + pDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, InsertDeleteFlags::FORMULA, false, *pUndoDoc ); // data base and other ranges ScRangeName* pDocRange = pDoc->GetRangeName(); diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index c9d38d2a999f..85f969e87a95 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -863,7 +863,7 @@ void ScViewFunc::RemoveManualBreaks() { ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, nTab, nTab, true, true ); - rDoc.CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument( 0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::NONE, false, *pUndoDoc ); pDocSh->GetUndoManager()->AddUndoAction( new ScUndoRemoveBreaks( pDocSh, nTab, pUndoDoc ) ); } @@ -1484,7 +1484,7 @@ void ScViewFunc::FillTab( InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool pUndoDoc->AddUndoTab( i, i ); aMarkRange.aStart.SetTab( i ); aMarkRange.aEnd.SetTab( i ); - rDoc.CopyToDocument( aMarkRange, InsertDeleteFlags::ALL, bMulti, pUndoDoc ); + rDoc.CopyToDocument( aMarkRange, InsertDeleteFlags::ALL, bMulti, *pUndoDoc ); } } @@ -2258,7 +2258,7 @@ bool ScViewFunc::DeleteTables(const vector<SCTAB> &TheTabs, bool bRecord ) else pUndoDoc->AddUndoTab( nTab,nTab, true,true ); // incl. column/fow flags - rDoc.CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::ALL,false, pUndoDoc ); + rDoc.CopyToDocument(0,0,nTab, MAXCOL,MAXROW,nTab, InsertDeleteFlags::ALL,false, *pUndoDoc ); rDoc.GetName( nTab, aOldName ); pUndoDoc->RenameTab( nTab, aOldName, false ); if (rDoc.IsLinked(nTab)) diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 6507eaa3a40d..b1db59642e1c 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -120,7 +120,7 @@ void ScViewFunc::CutToClip() ScRange aCopyRange = aRange; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(pDoc->GetTableCount()-1); - pDoc->CopyToDocument( aCopyRange, (InsertDeleteFlags::ALL & ~InsertDeleteFlags::OBJECTS) | InsertDeleteFlags::NOCAPTIONS, false, pUndoDoc ); + pDoc->CopyToDocument( aCopyRange, (InsertDeleteFlags::ALL & ~InsertDeleteFlags::OBJECTS) | InsertDeleteFlags::NOCAPTIONS, false, *pUndoDoc ); pDoc->BeginDrawUndo(); } @@ -1228,7 +1228,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, // all sheets - CopyToDocument skips those that don't exist in pUndoDoc SCTAB nTabCount = pDoc->GetTableCount(); pDoc->CopyToDocument( nStartCol, nStartRow, 0, nUndoEndCol, nUndoEndRow, nTabCount-1, - nUndoFlags, false, pUndoDoc ); + nUndoFlags, false, *pUndoDoc ); if ( bCutMode ) { @@ -1262,8 +1262,8 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, { pMixDoc.reset(new ScDocument( SCDOCMODE_UNDO )); pMixDoc->InitUndo( pDoc, nStartTab, nEndTab ); - pDoc->CopyToDocument( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab, - InsertDeleteFlags::CONTENTS, false, pMixDoc.get() ); + pDoc->CopyToDocument(nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab, + InsertDeleteFlags::CONTENTS, false, *pMixDoc); } } @@ -1372,7 +1372,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, pUndoDoc->AddUndoTab( 0, nTabCount-1 ); pRefUndoDoc->DeleteArea( nStartCol, nStartRow, nEndCol, nEndRow, aFilteredMark, InsertDeleteFlags::ALL ); pRefUndoDoc->CopyToDocument( 0,0,0, MAXCOL,MAXROW,nTabCount-1, - InsertDeleteFlags::FORMULA, false, pUndoDoc ); + InsertDeleteFlags::FORMULA, false, *pUndoDoc ); delete pRefUndoDoc; } @@ -1522,7 +1522,7 @@ bool ScViewFunc::PasteMultiRangesFromClip( { pUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); pUndoDoc->InitUndoSelected(pDoc, aMark, false, bRowInfo); - pDoc->CopyToDocument(aMarkedRange, nUndoFlags, false, pUndoDoc.get(), &aMark); + pDoc->CopyToDocument(aMarkedRange, nUndoFlags, false, *pUndoDoc, &aMark); } ::std::unique_ptr<ScDocument> pMixDoc; @@ -1532,7 +1532,7 @@ bool ScViewFunc::PasteMultiRangesFromClip( { pMixDoc.reset(new ScDocument(SCDOCMODE_UNDO)); pMixDoc->InitUndoSelected(pDoc, aMark); - pDoc->CopyToDocument(aMarkedRange, InsertDeleteFlags::CONTENTS, false, pMixDoc.get(), &aMark); + pDoc->CopyToDocument(aMarkedRange, InsertDeleteFlags::CONTENTS, false, *pMixDoc, &aMark); } } @@ -1676,7 +1676,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges( for (size_t i = 0, n = aRanges.size(); i < n; ++i) { pDoc->CopyToDocument( - *aRanges[i], nUndoFlags, false, pUndoDoc.get(), &aMark); + *aRanges[i], nUndoFlags, false, *pUndoDoc, &aMark); } } @@ -1690,7 +1690,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges( for (size_t i = 0, n = aRanges.size(); i < n; ++i) { pDoc->CopyToDocument( - *aRanges[i], InsertDeleteFlags::CONTENTS, false, pMixDoc.get(), &aMark); + *aRanges[i], InsertDeleteFlags::CONTENTS, false, *pMixDoc, &aMark); } } } @@ -1954,7 +1954,7 @@ void ScViewFunc::DataFormPutData( SCROW nCurrentRow , { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndoSelected( pDoc , rMark , bColInfo , bRowInfo ); - pDoc->CopyToDocument( aUserRange , InsertDeleteFlags::VALUE , false , pUndoDoc ); + pDoc->CopyToDocument( aUserRange , InsertDeleteFlags::VALUE , false, *pUndoDoc ); } sal_uInt16 nExtFlags = 0; pDocSh->UpdatePaintExt( nExtFlags, nStartCol, nStartRow, nStartTab , nEndCol, nEndRow, nEndTab ); // content before the change diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 01f9325e1aab..96d77357e466 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -116,7 +116,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow, { pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); pUndoDoc->InitUndo( &rDoc, nTab, nTab ); - rDoc.CopyToDocument( nStartCol,nStartRow,nTab, nStartCol,nEndRow,nTab, InsertDeleteFlags::ALL, false, pUndoDoc ); + rDoc.CopyToDocument( nStartCol,nStartRow,nTab, nStartCol,nEndRow,nTab, InsertDeleteFlags::ALL, false, *pUndoDoc ); } SCROW nRow = nStartRow; @@ -137,7 +137,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow, { ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO ); pRedoDoc->InitUndo( &rDoc, nTab, nTab ); - rDoc.CopyToDocument( nStartCol,nStartRow,nTab, nStartCol,nEndRow,nTab, InsertDeleteFlags::ALL|InsertDeleteFlags::NOCAPTIONS, false, pRedoDoc ); + rDoc.CopyToDocument( nStartCol,nStartRow,nTab, nStartCol,nEndRow,nTab, InsertDeleteFlags::ALL|InsertDeleteFlags::NOCAPTIONS, false, *pRedoDoc ); ScRange aMarkRange(nStartCol, nStartRow, nTab, nStartCol, nEndRow, nTab); ScMarkData aDestMark; @@ -221,7 +221,7 @@ void ScViewFunc::DoRefConversion() ScRange aCopyRange = aMarkRange; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - pDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ALL, bMulti, pUndoDoc, &rMark ); + pDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ALL, bMulti, *pUndoDoc, &rMark ); } ScRangeListRef xRanges; @@ -282,7 +282,7 @@ void ScViewFunc::DoRefConversion() ScRange aCopyRange = aMarkRange; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - pDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ALL, bMulti, pRedoDoc, &rMark ); + pDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ALL, bMulti, *pRedoDoc, &rMark ); pDocSh->GetUndoManager()->AddUndoAction( new ScUndoRefConversion( pDocSh, diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 1ce3e29996ea..f64a6328c73c 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1052,7 +1052,7 @@ void ScViewFunc::ApplyPatternLines( const ScPatternAttr& rAttr, const SvxBoxItem ScRange aCopyRange = aMarkRangeWithEnvelope; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - pDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, bCopyOnlyMarked, pUndoDoc, &aFuncMark ); + pDoc->CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, bCopyOnlyMarked, *pUndoDoc, &aFuncMark ); pDocSh->GetUndoManager()->AddUndoAction( new ScUndoSelectionAttr( @@ -1160,7 +1160,7 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, bool bCursor for (; itr != itrEnd; ++itr) if (*itr != nStartTab) pUndoDoc->AddUndoTab( *itr, *itr ); - rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, bMulti, pUndoDoc, &aFuncMark ); + rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, bMulti, *pUndoDoc, &aFuncMark ); aFuncMark.MarkToMulti(); @@ -1337,7 +1337,7 @@ void ScViewFunc::SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet ) ScRange aCopyRange = aMarkRange; aCopyRange.aStart.SetTab(0); aCopyRange.aEnd.SetTab(nTabCount-1); - rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, true, pUndoDoc, &aFuncMark ); + rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, true, *pUndoDoc, &aFuncMark ); aFuncMark.MarkToMulti(); OUString aName = pStyleSheet->GetName(); @@ -1368,7 +1368,7 @@ void ScViewFunc::SetStyleSheetToMarked( SfxStyleSheet* pStyleSheet ) pUndoDoc->AddUndoTab( *itr, *itr ); ScRange aCopyRange( nCol, nRow, 0, nCol, nRow, nTabCount-1 ); - rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, false, pUndoDoc ); + rDoc.CopyToDocument( aCopyRange, InsertDeleteFlags::ATTRIB, false, *pUndoDoc ); ScRange aMarkRange ( nCol, nRow, nTab ); ScMarkData aUndoMark = aFuncMark; @@ -1653,17 +1653,17 @@ void ScViewFunc::DeleteMulti( bool bRows ) SCCOLROW nStart = rSpan.mnStart; SCCOLROW nEnd = rSpan.mnEnd; if (bRows) - rDoc.CopyToDocument( 0,nStart,nTab, MAXCOL,nEnd,nTab, InsertDeleteFlags::ALL,false,pUndoDoc ); + rDoc.CopyToDocument( 0,nStart,nTab, MAXCOL,nEnd,nTab, InsertDeleteFlags::ALL,false,*pUndoDoc ); else rDoc.CopyToDocument( static_cast<SCCOL>(nStart),0,nTab, static_cast<SCCOL>(nEnd),MAXROW,nTab, - InsertDeleteFlags::ALL,false,pUndoDoc ); + InsertDeleteFlags::ALL,false,*pUndoDoc ); } // all Formulas because of references SCTAB nTabCount = rDoc.GetTableCount(); pUndoDoc->AddUndoTab( 0, nTabCount-1 ); - rDoc.CopyToDocument( 0,0,0, MAXCOL,MAXROW,MAXTAB, InsertDeleteFlags::FORMULA,false,pUndoDoc ); + rDoc.CopyToDocument( 0,0,0, MAXCOL,MAXROW,MAXTAB, InsertDeleteFlags::FORMULA,false,*pUndoDoc ); pUndoData = new ScRefUndoData( &rDoc ); @@ -1899,7 +1899,7 @@ void ScViewFunc::SetWidthOrHeight( pUndoDoc->AddUndoTab( *itr, *itr, true ); rDoc.CopyToDocument( static_cast<SCCOL>(nStart), 0, *itr, static_cast<SCCOL>(nEnd), MAXROW, *itr, InsertDeleteFlags::NONE, - false, pUndoDoc ); + false, *pUndoDoc ); } else { @@ -1907,7 +1907,7 @@ void ScViewFunc::SetWidthOrHeight( pUndoDoc->InitUndo( &rDoc, *itr, *itr, false, true ); else pUndoDoc->AddUndoTab( *itr, *itr, false, true ); - rDoc.CopyToDocument( 0, nStart, *itr, MAXCOL, nEnd, *itr, InsertDeleteFlags::NONE, false, pUndoDoc ); + rDoc.CopyToDocument( 0, nStart, *itr, MAXCOL, nEnd, *itr, InsertDeleteFlags::NONE, false, *pUndoDoc ); } } |