tdf#114245 : Let both ScDocument::CopyToDocument()...
methods use delayed-grouping introduced in commit
169a1b5421
avoid possible expensive repetitive formula group changes (tdf#102364)
The drag-drop move takes around 6-7 seconds now.
Change-Id: I0916719ffca2072b7cf86b4f99518316cfdd99fa
Reviewed-on: https://gerrit.libreoffice.org/72338
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Tested-by: Jenkins
This commit is contained in:
@@ -2063,25 +2063,10 @@ void ScDocument::CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
|
|||||||
InsertDeleteFlags nFlags, bool bOnlyMarked, ScDocument& rDestDoc,
|
InsertDeleteFlags nFlags, bool bOnlyMarked, ScDocument& rDestDoc,
|
||||||
const ScMarkData* pMarks, bool bColRowFlags )
|
const ScMarkData* pMarks, bool bColRowFlags )
|
||||||
{
|
{
|
||||||
PutInOrder( nCol1, nCol2 );
|
|
||||||
PutInOrder( nRow1, nRow2 );
|
|
||||||
PutInOrder( nTab1, nTab2 );
|
|
||||||
if (rDestDoc.aDocName.isEmpty())
|
|
||||||
rDestDoc.aDocName = aDocName;
|
|
||||||
if (ValidTab(nTab1) && ValidTab(nTab2))
|
if (ValidTab(nTab1) && ValidTab(nTab2))
|
||||||
{
|
{
|
||||||
sc::CopyToDocContext aCxt(rDestDoc);
|
ScRange aThisRange(nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
|
||||||
bool bOldAutoCalc = rDestDoc.GetAutoCalc();
|
CopyToDocument(aThisRange, nFlags, bOnlyMarked, rDestDoc, pMarks, bColRowFlags);
|
||||||
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] && rDestDoc.maTabs[i])
|
|
||||||
maTabs[i]->CopyToTable(aCxt, nCol1, nRow1, nCol2, nRow2, nFlags,
|
|
||||||
bOnlyMarked, rDestDoc.maTabs[i].get(), pMarks,
|
|
||||||
false, bColRowFlags, /*bGlobalNamesToLocal*/false, /*bCopyCaptions*/true );
|
|
||||||
}
|
|
||||||
rDestDoc.SetAutoCalc(bOldAutoCalc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user