sc_ucalc: move copypaste tests to their own module
in order to split sc_ucalc monster into smaller modules While at it, fix the clang-format issues in sc/qa/unit/ucalc_copypaste.cxx Change-Id: Ifd3af351f4b880da29e1f48c4852ac65fcd3276e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115696 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
parent
9090dc1f3b
commit
a78770c193
7 changed files with 6960 additions and 6819 deletions
14
sc/CppunitTest_sc_ucalc_copypaste.mk
Normal file
14
sc/CppunitTest_sc_ucalc_copypaste.mk
Normal file
|
@ -0,0 +1,14 @@
|
|||
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
||||
#*************************************************************************
|
||||
#
|
||||
# This file is part of the LibreOffice project.
|
||||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
#
|
||||
#*************************************************************************
|
||||
|
||||
$(eval $(call sc_ucalc_test,_copypaste))
|
||||
|
||||
# vim: set noet sw=4 ts=4:
|
|
@ -41,6 +41,7 @@ $(eval $(call gb_Module_add_check_targets,sc,\
|
|||
$(if $(and $(filter $(COM),MSC),$(MERGELIBS)),, \
|
||||
CppunitTest_sc_ucalc) \
|
||||
CppunitTest_sc_ucalc_condformat \
|
||||
CppunitTest_sc_ucalc_copypaste \
|
||||
CppunitTest_sc_ucalc_pivottable \
|
||||
CppunitTest_sc_ucalc_sharedformula \
|
||||
CppunitTest_sc_ucalc_sort \
|
||||
|
|
|
@ -979,6 +979,22 @@ void pasteOneCellFromClip(ScDocument* pDestDoc, const ScRange& rDestRange, ScDoc
|
|||
rDestRange.aEnd.Col(), rDestRange.aEnd.Row());
|
||||
}
|
||||
|
||||
ScDocShell* findLoadedDocShellByName(std::u16string_view rName)
|
||||
{
|
||||
ScDocShell* pShell = static_cast<ScDocShell*>(SfxObjectShell::GetFirst(checkSfxObjectShell<ScDocShell>, false));
|
||||
while (pShell)
|
||||
{
|
||||
SfxMedium* pMedium = pShell->GetMedium();
|
||||
if (pMedium)
|
||||
{
|
||||
OUString aName = pMedium->GetName();
|
||||
if (aName == rName)
|
||||
return pShell;
|
||||
}
|
||||
pShell = static_cast<ScDocShell*>(SfxObjectShell::GetNext(*pShell, checkSfxObjectShell<ScDocShell>, false));
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool insertRangeNames(
|
||||
ScDocument* pDoc, ScRangeName* pNames, const RangeNameDef* p, const RangeNameDef* pEnd)
|
||||
|
|
|
@ -252,7 +252,7 @@ SCQAHELPER_DLLPUBLIC ScUndoPaste* createUndoPaste(ScDocShell& rDocSh, const ScRa
|
|||
SCQAHELPER_DLLPUBLIC void pasteOneCellFromClip(ScDocument* pDestDoc, const ScRange& rDestRange,
|
||||
ScDocument* pClipDoc,
|
||||
InsertDeleteFlags eFlags = InsertDeleteFlags::ALL);
|
||||
|
||||
SCQAHELPER_DLLPUBLIC ScDocShell* findLoadedDocShellByName(std::u16string_view rName);
|
||||
SCQAHELPER_DLLPUBLIC ScRange insertRangeData(ScDocument* pDoc, const ScAddress& rPos,
|
||||
const std::vector<std::vector<const char*>>& rData);
|
||||
SCQAHELPER_DLLPUBLIC bool insertRangeNames(ScDocument* pDoc, ScRangeName* pNames, const RangeNameDef* p,
|
||||
|
|
6661
sc/qa/unit/ucalc.cxx
6661
sc/qa/unit/ucalc.cxx
File diff suppressed because it is too large
Load diff
|
@ -22,8 +22,6 @@ class ScUndoCut;
|
|||
class Test : public test::BootstrapFixture
|
||||
{
|
||||
public:
|
||||
static ScDocShell* findLoadedDocShellByName(std::u16string_view rName);
|
||||
|
||||
/**
|
||||
* Enable or disable expand reference options which controls how
|
||||
* references in formula are expanded when inserting rows or columns.
|
||||
|
@ -226,72 +224,6 @@ public:
|
|||
void testAutoFilterTimeValue();
|
||||
void testAdvancedFilter();
|
||||
void testTdf98642();
|
||||
void testCopyPaste();
|
||||
void testCopyPasteAsLink();
|
||||
void testCopyPasteTranspose();
|
||||
void testCopyPasteSpecialAsLinkTranspose();
|
||||
void testCopyPasteSpecialAsLinkFilteredTranspose();
|
||||
void testCopyPasteSpecialMultiRangeColAsLinkTranspose();
|
||||
void testCopyPasteSpecialMultiRangeColAsLinkFilteredTranspose();
|
||||
void testCopyPasteSpecialMultiRangeRowAsLinkTranspose();
|
||||
void testCopyPasteSpecialMultiRangeRowAsLinkFilteredTranspose();
|
||||
void testCopyPasteSpecialAllAsLinkTranspose();
|
||||
void testCopyPasteSpecialAllAsLinkFilteredTranspose();
|
||||
void testCopyPasteSpecial();
|
||||
void testCopyPasteSpecialFiltered();
|
||||
void testCopyPasteSpecialIncludeFiltered();
|
||||
void testCopyPasteSpecialFilteredIncludeFiltered();
|
||||
void testCopyPasteSpecialTranspose();
|
||||
void testCopyPasteSpecialTransposeIncludeFiltered();
|
||||
void testCopyPasteSpecialFilteredTranspose();
|
||||
void testCopyPasteSpecialMergedCellsTranspose();
|
||||
void testCopyPasteSpecialMergedCellsFilteredTranspose();
|
||||
void testCopyPasteSpecialMultiRangeCol();
|
||||
void testCopyPasteSpecialMultiRangeColFiltered();
|
||||
void testCopyPasteSpecialMultiRangeColIncludeFiltered();
|
||||
void testCopyPasteSpecialMultiRangeColFilteredIncludeFiltered();
|
||||
void testCopyPasteSpecialMultiRangeColTranspose();
|
||||
void testCopyPasteSpecialMultiRangeColFilteredTranspose();
|
||||
void testCopyPasteSpecialMultiRangeColFilteredIncludeFilteredTranspose();
|
||||
void testCopyPasteSpecialMultiRangeRow();
|
||||
void testCopyPasteSpecialMultiRangeRowFiltered();
|
||||
void testCopyPasteSpecialMultiRangeRowIncludeFiltered();
|
||||
void testCopyPasteSpecialMultiRangeRowFilteredIncludeFiltered();
|
||||
void testCopyPasteSpecialMultiRangeRowTranspose();
|
||||
void testCopyPasteSpecialMultiRangeRowFilteredTranspose();
|
||||
void testCopyPasteSpecialMultiRangeRowFilteredIncludeFilteredTranspose();
|
||||
void testCopyPasteSpecialSkipEmpty();
|
||||
void testCopyPasteSpecialSkipEmptyFiltered();
|
||||
void testCopyPasteSpecialSkipEmptyIncludeFiltered();
|
||||
void testCopyPasteSpecialSkipEmptyFilteredIncludeFiltered();
|
||||
void testCopyPasteSpecialSkipEmptyTranspose();
|
||||
void testCopyPasteSpecialSkipEmptyTransposeIncludeFiltered();
|
||||
void testCopyPasteSpecialSkipEmptyFilteredTranspose();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeCol();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeColFiltered();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeColIncludeFiltered();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeColFilteredIncludeFiltered();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeColTranspose();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeColFilteredTranspose();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeColFilteredIncludeFilteredTranspose();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeRow();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeRowFiltered();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeRowIncludeFiltered();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredIncludeFiltered();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeRowTranspose();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredTranspose();
|
||||
void testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredIncludeFilteredTranspose();
|
||||
void testCopyPasteMultiRange();
|
||||
void testCopyPasteSkipEmpty();
|
||||
void testCopyPasteSkipEmpty2();
|
||||
void testCutPasteRefUndo();
|
||||
void testCutPasteGroupRefUndo();
|
||||
void testMoveRefBetweenSheets();
|
||||
void testUndoCut();
|
||||
void testMoveBlock();
|
||||
void testCopyPasteRelativeFormula();
|
||||
void testCopyPasteRepeatOneFormula();
|
||||
void testCopyPasteMixedReferenceFormula();
|
||||
void testMergedCells();
|
||||
void testUpdateReference();
|
||||
void testSearchCells();
|
||||
|
@ -333,9 +265,6 @@ public:
|
|||
void testTdf64001();
|
||||
void testAutoFill();
|
||||
void testAutoFillSimple();
|
||||
void testCopyPasteFormulas();
|
||||
void testCopyPasteFormulasExternalDoc();
|
||||
void testCopyPasteReferencesExternalDoc(); // tdf#106456
|
||||
|
||||
void testFindAreaPosVertical();
|
||||
void testFindAreaPosColRight();
|
||||
|
@ -533,72 +462,6 @@ public:
|
|||
CPPUNIT_TEST(testAutoFilterTimeValue);
|
||||
CPPUNIT_TEST(testAdvancedFilter);
|
||||
CPPUNIT_TEST(testTdf98642);
|
||||
CPPUNIT_TEST(testCopyPaste);
|
||||
CPPUNIT_TEST(testCopyPasteAsLink);
|
||||
CPPUNIT_TEST(testCopyPasteTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialAsLinkTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialAllAsLinkTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColAsLinkTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColAsLinkFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowAsLinkTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowAsLinkFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialAsLinkFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialAllAsLinkFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMergedCellsTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMergedCellsFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecial);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialFilteredIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialTransposeIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeCol);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColFilteredIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeColFilteredIncludeFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRow);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowFilteredIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialMultiRangeRowFilteredIncludeFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmpty);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyFilteredIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyTransposeIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeCol);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeColFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeColIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeColFilteredIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeColTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeColFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeColFilteredIncludeFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRow);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRowFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRowIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredIncludeFiltered);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRowTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteSpecialSkipEmptyMultiRangeRowFilteredIncludeFilteredTranspose);
|
||||
CPPUNIT_TEST(testCopyPasteMultiRange);
|
||||
CPPUNIT_TEST(testCopyPasteSkipEmpty);
|
||||
CPPUNIT_TEST(testCopyPasteSkipEmpty2);
|
||||
CPPUNIT_TEST(testCutPasteRefUndo);
|
||||
CPPUNIT_TEST(testCutPasteGroupRefUndo);
|
||||
CPPUNIT_TEST(testMoveRefBetweenSheets);
|
||||
CPPUNIT_TEST(testUndoCut);
|
||||
CPPUNIT_TEST(testMoveBlock);
|
||||
CPPUNIT_TEST(testCopyPasteRelativeFormula);
|
||||
CPPUNIT_TEST(testCopyPasteRepeatOneFormula);
|
||||
CPPUNIT_TEST(testCopyPasteMixedReferenceFormula);
|
||||
CPPUNIT_TEST(testMergedCells);
|
||||
CPPUNIT_TEST(testUpdateReference);
|
||||
CPPUNIT_TEST(testSearchCells);
|
||||
|
@ -611,9 +474,6 @@ public:
|
|||
CPPUNIT_TEST(testTdf64001);
|
||||
CPPUNIT_TEST(testAutoFill);
|
||||
CPPUNIT_TEST(testAutoFillSimple);
|
||||
CPPUNIT_TEST(testCopyPasteFormulas);
|
||||
CPPUNIT_TEST(testCopyPasteFormulasExternalDoc);
|
||||
CPPUNIT_TEST(testCopyPasteReferencesExternalDoc);
|
||||
CPPUNIT_TEST(testFindAreaPosVertical);
|
||||
CPPUNIT_TEST(testFindAreaPosColRight);
|
||||
CPPUNIT_TEST(testShiftCells);
|
||||
|
@ -655,23 +515,6 @@ public:
|
|||
private:
|
||||
ScDocShellRef m_xDocShell;
|
||||
ScDocument* m_pDoc;
|
||||
|
||||
void executeCopyPasteSpecial(bool bApplyFilter, bool bIncludedFiltered, bool bAsLink,
|
||||
bool bTranspose, bool bMultiRangeSelection, bool bSkipEmpty,
|
||||
ScClipParam::Direction eDirection, bool bCalcAll,
|
||||
InsertDeleteFlags aFlags);
|
||||
void checkCopyPasteSpecial(bool bSkipEmpty);
|
||||
void checkCopyPasteSpecialFiltered(bool bSkipEmpty);
|
||||
void checkCopyPasteSpecialTranspose(bool bSkipEmpty);
|
||||
void checkCopyPasteSpecialFilteredTranspose(bool bSkipEmpty);
|
||||
void checkCopyPasteSpecialMultiRangeCol(bool bSkipEmpty);
|
||||
void checkCopyPasteSpecialMultiRangeColFiltered(bool bSkipEmpty);
|
||||
void checkCopyPasteSpecialMultiRangeColTranspose(bool bSkipEmpty);
|
||||
void checkCopyPasteSpecialMultiRangeColFilteredTranspose(bool bSkipEmpty);
|
||||
void checkCopyPasteSpecialMultiRangeRow(bool bSkipEmpty);
|
||||
void checkCopyPasteSpecialMultiRangeRowFiltered(bool bSkipEmpty);
|
||||
void checkCopyPasteSpecialMultiRangeRowTranspose(bool bSkipEmpty);
|
||||
void checkCopyPasteSpecialMultiRangeRowFilteredTranspose(bool bSkipEmpty);
|
||||
};
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
|
6928
sc/qa/unit/ucalc_copypaste.cxx
Normal file
6928
sc/qa/unit/ucalc_copypaste.cxx
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue