sc: rowcol: tdf#50916 convert mark data structures
Change-Id: I9b706c9bcc2925f72cc024142ffe72af5ddea82a Reviewed-on: https://gerrit.libreoffice.org/82419 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
parent
33d966ecc1
commit
a8a064d11c
@ -43,12 +43,13 @@ class ScMarkArray
|
|||||||
SCSIZE nCount;
|
SCSIZE nCount;
|
||||||
SCSIZE nLimit;
|
SCSIZE nLimit;
|
||||||
std::unique_ptr<ScMarkEntry[]> pData;
|
std::unique_ptr<ScMarkEntry[]> pData;
|
||||||
|
SCROW mnMaxRow;
|
||||||
|
|
||||||
friend class ScMarkArrayIter;
|
friend class ScMarkArrayIter;
|
||||||
friend class ScDocument; // for FillInfo
|
friend class ScDocument; // for FillInfo
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ScMarkArray();
|
ScMarkArray(SCROW nMaxRow);
|
||||||
ScMarkArray( ScMarkArray&& rArray ) noexcept;
|
ScMarkArray( ScMarkArray&& rArray ) noexcept;
|
||||||
ScMarkArray( const ScMarkArray& rArray );
|
ScMarkArray( const ScMarkArray& rArray );
|
||||||
~ScMarkArray();
|
~ScMarkArray();
|
||||||
|
@ -59,11 +59,13 @@ private:
|
|||||||
ScRangeList aBottomEnvelope; // list of ranges in the bottom envelope of the multi selection
|
ScRangeList aBottomEnvelope; // list of ranges in the bottom envelope of the multi selection
|
||||||
ScRangeList aLeftEnvelope; // list of ranges in the left envelope of the multi selection
|
ScRangeList aLeftEnvelope; // list of ranges in the left envelope of the multi selection
|
||||||
ScRangeList aRightEnvelope; // list of ranges in the right envelope of the multi selection
|
ScRangeList aRightEnvelope; // list of ranges in the right envelope of the multi selection
|
||||||
|
SCROW mnMaxRow;
|
||||||
|
SCCOL mnMaxCol;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ScMarkData();
|
ScMarkData(SCROW nMaxRow, SCCOL nMaxCol);
|
||||||
ScMarkData(const ScMarkData& rData);
|
ScMarkData(const ScMarkData& rData);
|
||||||
ScMarkData(const ScRangeList& rList);
|
ScMarkData(SCROW nMaxRow, SCCOL nMaxCol, const ScRangeList& rList);
|
||||||
~ScMarkData();
|
~ScMarkData();
|
||||||
|
|
||||||
ScMarkData& operator=(const ScMarkData& rData);
|
ScMarkData& operator=(const ScMarkData& rData);
|
||||||
|
@ -34,11 +34,13 @@ private:
|
|||||||
typedef std::vector<ScMarkArray> MapType;
|
typedef std::vector<ScMarkArray> MapType;
|
||||||
MapType aMultiSelContainer;
|
MapType aMultiSelContainer;
|
||||||
ScMarkArray aRowSel;
|
ScMarkArray aRowSel;
|
||||||
|
SCROW mnMaxRow;
|
||||||
|
SCCOL mnMaxCol;
|
||||||
|
|
||||||
friend class ScMultiSelIter;
|
friend class ScMultiSelIter;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ScMultiSel();
|
ScMultiSel(SCROW nMaxRow, SCCOL nMaxCol);
|
||||||
ScMultiSel( const ScMultiSel& rMultiSel );
|
ScMultiSel( const ScMultiSel& rMultiSel );
|
||||||
~ScMultiSel();
|
~ScMultiSel();
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ void ScCopyPasteTest::testCopyPasteXLS()
|
|||||||
ScRefFlags nRes = aSrcRange.Parse("B2:C5", &rDoc, rDoc.GetAddressConvention());
|
ScRefFlags nRes = aSrcRange.Parse("B2:C5", &rDoc, rDoc.GetAddressConvention());
|
||||||
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
|
CPPUNIT_ASSERT_MESSAGE("Failed to parse.", (nRes & ScRefFlags::VALID));
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aSrcRange);
|
aMark.SetMarkArea(aSrcRange);
|
||||||
|
|
||||||
pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange);
|
pViewShell->GetViewData().GetMarkData().SetMarkArea(aSrcRange);
|
||||||
|
@ -135,7 +135,7 @@ void Test::testSimpleMark( const ScRange& rRange, const ScRange& rSelectionCover
|
|||||||
const ScRangeList& rLeftEnvelope, const ScRangeList& rRightEnvelope,
|
const ScRangeList& rLeftEnvelope, const ScRangeList& rRightEnvelope,
|
||||||
const ScRangeList& rTopEnvelope, const ScRangeList& rBottomEnvelope )
|
const ScRangeList& rTopEnvelope, const ScRangeList& rBottomEnvelope )
|
||||||
{
|
{
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
CPPUNIT_ASSERT( !aMark.IsMarked() && !aMark.IsMultiMarked() );
|
CPPUNIT_ASSERT( !aMark.IsMarked() && !aMark.IsMultiMarked() );
|
||||||
|
|
||||||
aMark.SetMarkArea( rRange );
|
aMark.SetMarkArea( rRange );
|
||||||
@ -240,8 +240,8 @@ void Test::testSimpleMark_Row()
|
|||||||
void Test::testMultiMark( const MultiMarkTestData& rMarksData )
|
void Test::testMultiMark( const MultiMarkTestData& rMarksData )
|
||||||
{
|
{
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
ScMultiSel aMultiSel;
|
ScMultiSel aMultiSel(MAXROW, MAXCOL);
|
||||||
CPPUNIT_ASSERT( !aMark.IsMarked() && !aMark.IsMultiMarked() );
|
CPPUNIT_ASSERT( !aMark.IsMarked() && !aMark.IsMultiMarked() );
|
||||||
CPPUNIT_ASSERT_EQUAL( SCCOL(0), aMultiSel.GetMultiSelectionCount() );
|
CPPUNIT_ASSERT_EQUAL( SCCOL(0), aMultiSel.GetMultiSelectionCount() );
|
||||||
CPPUNIT_ASSERT( !aMultiSel.HasAnyMarks() );
|
CPPUNIT_ASSERT( !aMultiSel.HasAnyMarks() );
|
||||||
@ -817,7 +817,7 @@ void Test::testMultiMark_NegativeMarking()
|
|||||||
|
|
||||||
void Test::testInsertTabBeforeSelected()
|
void Test::testInsertTabBeforeSelected()
|
||||||
{
|
{
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
aMark.InsertTab(0);
|
aMark.InsertTab(0);
|
||||||
CPPUNIT_ASSERT_EQUAL(SCTAB(1), aMark.GetSelectCount());
|
CPPUNIT_ASSERT_EQUAL(SCTAB(1), aMark.GetSelectCount());
|
||||||
@ -826,7 +826,7 @@ void Test::testInsertTabBeforeSelected()
|
|||||||
|
|
||||||
void Test::testInsertTabAfterSelected()
|
void Test::testInsertTabAfterSelected()
|
||||||
{
|
{
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
aMark.InsertTab(1);
|
aMark.InsertTab(1);
|
||||||
CPPUNIT_ASSERT_EQUAL(SCTAB(1), aMark.GetSelectCount());
|
CPPUNIT_ASSERT_EQUAL(SCTAB(1), aMark.GetSelectCount());
|
||||||
@ -835,7 +835,7 @@ void Test::testInsertTabAfterSelected()
|
|||||||
|
|
||||||
void Test::testDeleteTabBeforeSelected()
|
void Test::testDeleteTabBeforeSelected()
|
||||||
{
|
{
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(1);
|
aMark.SelectOneTable(1);
|
||||||
aMark.DeleteTab(0);
|
aMark.DeleteTab(0);
|
||||||
CPPUNIT_ASSERT_EQUAL(SCTAB(1), aMark.GetSelectCount());
|
CPPUNIT_ASSERT_EQUAL(SCTAB(1), aMark.GetSelectCount());
|
||||||
@ -844,7 +844,7 @@ void Test::testDeleteTabBeforeSelected()
|
|||||||
|
|
||||||
void Test::testDeleteTabAfterSelected()
|
void Test::testDeleteTabAfterSelected()
|
||||||
{
|
{
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
aMark.DeleteTab(1);
|
aMark.DeleteTab(1);
|
||||||
CPPUNIT_ASSERT_EQUAL(SCTAB(1), aMark.GetSelectCount());
|
CPPUNIT_ASSERT_EQUAL(SCTAB(1), aMark.GetSelectCount());
|
||||||
@ -863,14 +863,14 @@ void Test::testScMarkArraySearch()
|
|||||||
{
|
{
|
||||||
// empty
|
// empty
|
||||||
{
|
{
|
||||||
ScMarkArray ar;
|
ScMarkArray ar(MAXROW);
|
||||||
testScMarkArraySearch_check(ar, -1, false, 0);
|
testScMarkArraySearch_check(ar, -1, false, 0);
|
||||||
testScMarkArraySearch_check(ar, 100, false, 0);
|
testScMarkArraySearch_check(ar, 100, false, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// one range
|
// one range
|
||||||
{
|
{
|
||||||
ScMarkArray ar;
|
ScMarkArray ar(MAXROW);
|
||||||
ar.SetMarkArea(10, 20, true);
|
ar.SetMarkArea(10, 20, true);
|
||||||
|
|
||||||
// 0-9,10-20,21+
|
// 0-9,10-20,21+
|
||||||
@ -891,7 +891,7 @@ void Test::testScMarkArraySearch()
|
|||||||
|
|
||||||
// three ranges
|
// three ranges
|
||||||
{
|
{
|
||||||
ScMarkArray ar;
|
ScMarkArray ar(MAXROW);
|
||||||
ar.SetMarkArea(10, 20, true);
|
ar.SetMarkArea(10, 20, true);
|
||||||
ar.SetMarkArea(21, 30, true);
|
ar.SetMarkArea(21, 30, true);
|
||||||
ar.SetMarkArea(50, 100, true);
|
ar.SetMarkArea(50, 100, true);
|
||||||
@ -912,7 +912,7 @@ void Test::testScMarkArraySearch()
|
|||||||
|
|
||||||
// three single-row ranges
|
// three single-row ranges
|
||||||
{
|
{
|
||||||
ScMarkArray ar;
|
ScMarkArray ar(MAXROW);
|
||||||
ar.SetMarkArea(4, 4, true);
|
ar.SetMarkArea(4, 4, true);
|
||||||
ar.SetMarkArea(6, 6, true);
|
ar.SetMarkArea(6, 6, true);
|
||||||
ar.SetMarkArea(8, 8, true);
|
ar.SetMarkArea(8, 8, true);
|
||||||
@ -932,7 +932,7 @@ void Test::testScMarkArraySearch()
|
|||||||
|
|
||||||
// one range
|
// one range
|
||||||
{
|
{
|
||||||
ScMarkArray ar;
|
ScMarkArray ar(MAXROW);
|
||||||
ar.SetMarkArea(10, MAXROW, true);
|
ar.SetMarkArea(10, MAXROW, true);
|
||||||
|
|
||||||
// 0-10,11+
|
// 0-10,11+
|
||||||
|
@ -104,7 +104,7 @@ ScUndoCut* ScParallelismTest::cutToClip(ScDocShell& rDocSh, const ScRange& rRang
|
|||||||
ScDocument* pSrcDoc = &rDocSh.GetDocument();
|
ScDocument* pSrcDoc = &rDocSh.GetDocument();
|
||||||
|
|
||||||
ScClipParam aClipParam(rRange, true);
|
ScClipParam aClipParam(rRange, true);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(rRange);
|
aMark.SetMarkArea(rRange);
|
||||||
pSrcDoc->CopyToClip(aClipParam, pClipDoc, &aMark, false, false);
|
pSrcDoc->CopyToClip(aClipParam, pClipDoc, &aMark, false, false);
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ ScUndoCut* ScParallelismTest::cutToClip(ScDocShell& rDocSh, const ScRange& rRang
|
|||||||
|
|
||||||
void ScParallelismTest::pasteFromClip(ScDocument* pDestDoc, const ScRange& rDestRange, ScDocument* pClipDoc)
|
void ScParallelismTest::pasteFromClip(ScDocument* pDestDoc, const ScRange& rDestRange, ScDocument* pClipDoc)
|
||||||
{
|
{
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(rDestRange);
|
aMark.SetMarkArea(rDestRange);
|
||||||
pDestDoc->CopyFromClip(rDestRange, aMark, InsertDeleteFlags::ALL, nullptr, pClipDoc);
|
pDestDoc->CopyFromClip(rDestRange, aMark, InsertDeleteFlags::ALL, nullptr, pClipDoc);
|
||||||
}
|
}
|
||||||
@ -884,7 +884,7 @@ void ScParallelismTest::testFormulaGroupsInCyclesAndWithSelfReference()
|
|||||||
m_pDoc->SetAutoCalc(true);
|
m_pDoc->SetAutoCalc(true);
|
||||||
|
|
||||||
const ScRange aChangeRange(1, 1, 0, 1, 4, 0); // B2:B5
|
const ScRange aChangeRange(1, 1, 0, 1, 4, 0); // B2:B5
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
|
|
||||||
// Set up clip document.
|
// Set up clip document.
|
||||||
|
@ -798,7 +798,7 @@ void ScFiltersTest::testFormulaDepDeleteContentsODS()
|
|||||||
// Delete D2:D5.
|
// Delete D2:D5.
|
||||||
ScDocFunc& rFunc = xDocSh->GetDocFunc();
|
ScDocFunc& rFunc = xDocSh->GetDocFunc();
|
||||||
ScRange aRange(3,1,0,3,4,0);
|
ScRange aRange(3,1,0,3,4,0);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aRange);
|
aMark.SetMarkArea(aRange);
|
||||||
aMark.MarkToMulti();
|
aMark.MarkToMulti();
|
||||||
bool bGood = rFunc.DeleteContents(aMark, InsertDeleteFlags::ALL, true, true);
|
bool bGood = rFunc.DeleteContents(aMark, InsertDeleteFlags::ALL, true, true);
|
||||||
@ -2832,7 +2832,7 @@ void ScFiltersTest::testOptimalHeightReset()
|
|||||||
|
|
||||||
// delete content of A1
|
// delete content of A1
|
||||||
ScRange aDelRange(0,0,0,0,0,0);
|
ScRange aDelRange(0,0,0,0,0,0);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aDelRange);
|
aMark.SetMarkArea(aDelRange);
|
||||||
bool bRet = rFunc.DeleteContents( aMark, InsertDeleteFlags::ALL, false, true );
|
bool bRet = rFunc.DeleteContents( aMark, InsertDeleteFlags::ALL, false, true );
|
||||||
CPPUNIT_ASSERT_MESSAGE("DeleteContents failed", bRet);
|
CPPUNIT_ASSERT_MESSAGE("DeleteContents failed", bRet);
|
||||||
|
@ -366,7 +366,7 @@ void Test::testRangeList()
|
|||||||
|
|
||||||
void Test::testMarkData()
|
void Test::testMarkData()
|
||||||
{
|
{
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(MAXROW, MAXCOL);
|
||||||
|
|
||||||
// Empty mark. Nothing is selected.
|
// Empty mark. Nothing is selected.
|
||||||
std::vector<sc::ColRowSpan> aSpans = aMarkData.GetMarkedRowSpans();
|
std::vector<sc::ColRowSpan> aSpans = aMarkData.GetMarkedRowSpans();
|
||||||
@ -599,7 +599,7 @@ void Test::testSelectionFunction()
|
|||||||
ScRangeList aRanges;
|
ScRangeList aRanges;
|
||||||
aRanges.push_back(ScRange(1,1,0,1,7,0)); // B2:B8
|
aRanges.push_back(ScRange(1,1,0,1,7,0)); // B2:B8
|
||||||
aRanges.push_back(ScRange(3,1,0,3,7,0)); // D2:D8
|
aRanges.push_back(ScRange(3,1,0,3,7,0)); // D2:D8
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.MarkFromRangeList(aRanges, true);
|
aMark.MarkFromRangeList(aRanges, true);
|
||||||
|
|
||||||
struct Check
|
struct Check
|
||||||
@ -658,7 +658,7 @@ void Test::testSelectionFunction()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make sure that when no selection is present, use the current cursor position.
|
// Make sure that when no selection is present, use the current cursor position.
|
||||||
ScMarkData aEmpty;
|
ScMarkData aEmpty(MAXROW, MAXCOL);
|
||||||
|
|
||||||
{
|
{
|
||||||
// D3 (numeric cell containing 5.)
|
// D3 (numeric cell containing 5.)
|
||||||
@ -747,7 +747,7 @@ void Test::testMarkedCellIteration()
|
|||||||
m_pDoc->SetFormula(ScAddress(2,2,0), "=SUM(1,2,3)", m_pDoc->GetGrammar());
|
m_pDoc->SetFormula(ScAddress(2,2,0), "=SUM(1,2,3)", m_pDoc->GetGrammar());
|
||||||
|
|
||||||
// Select A1:C5.
|
// Select A1:C5.
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(MAXROW, MAXCOL);
|
||||||
aMarkData.SetMarkArea(ScRange(0,0,0,2,4,0));
|
aMarkData.SetMarkArea(ScRange(0,0,0,2,4,0));
|
||||||
aMarkData.MarkToMulti(); // TODO : we shouldn't have to do this.
|
aMarkData.MarkToMulti(); // TODO : we shouldn't have to do this.
|
||||||
|
|
||||||
@ -1881,7 +1881,7 @@ void Test::testMatrixComparisonWithErrors()
|
|||||||
|
|
||||||
// Create a matrix formula in B3:B4 referencing A1:A2 and doing a greater
|
// Create a matrix formula in B3:B4 referencing A1:A2 and doing a greater
|
||||||
// than comparison on it's values. Error value must be propagated.
|
// than comparison on it's values. Error value must be propagated.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(1, 2, 1, 3, aMark, "=A1:A2>0");
|
m_pDoc->InsertMatrixFormula(1, 2, 1, 3, aMark, "=A1:A2>0");
|
||||||
|
|
||||||
@ -1899,7 +1899,7 @@ void Test::testMatrixConditionalBooleanResult()
|
|||||||
|
|
||||||
// Create matrix formulas in A1:B1,A2:B2,A3:B3,A4:B4 producing mixed
|
// Create matrix formulas in A1:B1,A2:B2,A3:B3,A4:B4 producing mixed
|
||||||
// boolean and numeric results in an unformatted area.
|
// boolean and numeric results in an unformatted area.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula( 0,0, 1,0, aMark, "=IF({1,0};TRUE();42)"); // {TRUE,42}
|
m_pDoc->InsertMatrixFormula( 0,0, 1,0, aMark, "=IF({1,0};TRUE();42)"); // {TRUE,42}
|
||||||
m_pDoc->InsertMatrixFormula( 0,1, 1,1, aMark, "=IF({0,1};TRUE();42)"); // {42,1} aim for {42,TRUE}
|
m_pDoc->InsertMatrixFormula( 0,1, 1,1, aMark, "=IF({0,1};TRUE();42)"); // {42,1} aim for {42,TRUE}
|
||||||
@ -1931,7 +1931,7 @@ void Test::testEnterMixedMatrix()
|
|||||||
m_pDoc->SetValue(1, 1, 0, val);
|
m_pDoc->SetValue(1, 1, 0, val);
|
||||||
|
|
||||||
// Create a matrix range in A4:B5 referencing A1:B2.
|
// Create a matrix range in A4:B5 referencing A1:B2.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(0, 3, 1, 4, aMark, "=A1:B2");
|
m_pDoc->InsertMatrixFormula(0, 3, 1, 4, aMark, "=A1:B2");
|
||||||
|
|
||||||
@ -1958,7 +1958,7 @@ void Test::testMatrixEditable()
|
|||||||
|
|
||||||
// A3:A4 is a matrix.
|
// A3:A4 is a matrix.
|
||||||
ScRange aMatRange(0,2,0,0,3,0);
|
ScRange aMatRange(0,2,0,0,3,0);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aMatRange);
|
aMark.SetMarkArea(aMatRange);
|
||||||
m_pDoc->InsertMatrixFormula(0, 2, 0, 3, aMark, "=TRANSPOSE(A1:B1)");
|
m_pDoc->InsertMatrixFormula(0, 2, 0, 3, aMark, "=TRANSPOSE(A1:B1)");
|
||||||
|
|
||||||
@ -3340,7 +3340,7 @@ void Test::testCopyPaste()
|
|||||||
ScDocumentUniquePtr pUndoDoc(new ScDocument(SCDOCMODE_UNDO));
|
ScDocumentUniquePtr pUndoDoc(new ScDocument(SCDOCMODE_UNDO));
|
||||||
pUndoDoc->InitUndo(m_pDoc, 1, 1, true, true);
|
pUndoDoc->InitUndo(m_pDoc, 1, 1, true, true);
|
||||||
std::unique_ptr<ScUndoPaste> pUndo(createUndoPaste(getDocShell(), aRange, std::move(pUndoDoc)));
|
std::unique_ptr<ScUndoPaste> pUndo(createUndoPaste(getDocShell(), aRange, std::move(pUndoDoc)));
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aRange);
|
aMark.SetMarkArea(aRange);
|
||||||
m_pDoc->CopyFromClip(aRange, aMark, InsertDeleteFlags::ALL, nullptr, &aClipDoc);
|
m_pDoc->CopyFromClip(aRange, aMark, InsertDeleteFlags::ALL, nullptr, &aClipDoc);
|
||||||
|
|
||||||
@ -3466,7 +3466,7 @@ void Test::testCopyPasteAsLink()
|
|||||||
copyToClip(m_pDoc, aRange, &aClipDoc);
|
copyToClip(m_pDoc, aRange, &aClipDoc);
|
||||||
|
|
||||||
aRange = ScRange(1,1,1,1,3,1); // Paste to B2:B4 on Sheet2.
|
aRange = ScRange(1,1,1,1,3,1); // Paste to B2:B4 on Sheet2.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aRange);
|
aMark.SetMarkArea(aRange);
|
||||||
// Paste range as link.
|
// Paste range as link.
|
||||||
m_pDoc->CopyFromClip(aRange, aMark, InsertDeleteFlags::CONTENTS, nullptr, &aClipDoc, true, true);
|
m_pDoc->CopyFromClip(aRange, aMark, InsertDeleteFlags::CONTENTS, nullptr, &aClipDoc, true, true);
|
||||||
@ -3525,7 +3525,7 @@ void Test::testCopyPasteTranspose()
|
|||||||
aNewClipDoc.TransposeClip(pTransClip.get(), InsertDeleteFlags::ALL, false);
|
aNewClipDoc.TransposeClip(pTransClip.get(), InsertDeleteFlags::ALL, false);
|
||||||
|
|
||||||
ScRange aDestRange(3,1,1,3,3,1);//target: Sheet2.D2:D4
|
ScRange aDestRange(3,1,1,3,3,1);//target: Sheet2.D2:D4
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aDestRange);
|
aMark.SetMarkArea(aDestRange);
|
||||||
m_pDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::ALL, nullptr, pTransClip.get());
|
m_pDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::ALL, nullptr, pTransClip.get());
|
||||||
pTransClip.reset();
|
pTransClip.reset();
|
||||||
@ -3580,7 +3580,7 @@ void Test::testCopyPasteMultiRange()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
|
|
||||||
// Copy A2:B2, A4:B4, and A6:B6 to clipboard.
|
// Copy A2:B2, A4:B4, and A6:B6 to clipboard.
|
||||||
@ -3677,7 +3677,7 @@ void Test::testCopyPasteSkipEmpty()
|
|||||||
ScRange aSrcRange(0,0,0,0,4,0);
|
ScRange aSrcRange(0,0,0,0,4,0);
|
||||||
ScRange aDestRange(1,0,0,1,4,0);
|
ScRange aDestRange(1,0,0,1,4,0);
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aDestRange);
|
aMark.SetMarkArea(aDestRange);
|
||||||
|
|
||||||
// Put some texts in B1:B5.
|
// Put some texts in B1:B5.
|
||||||
@ -3810,7 +3810,7 @@ void Test::testCopyPasteSkipEmpty2()
|
|||||||
|
|
||||||
// Paste to A3 with the skip empty option set. This used to freeze. (fdo#77735)
|
// Paste to A3 with the skip empty option set. This used to freeze. (fdo#77735)
|
||||||
ScRange aDestRange(0,2,0,2,2,0);
|
ScRange aDestRange(0,2,0,2,2,0);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aDestRange);
|
aMark.SetMarkArea(aDestRange);
|
||||||
m_pDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::ALL, nullptr, &aClipDoc, false, false, true, true);
|
m_pDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::ALL, nullptr, &aClipDoc, false, false, true, true);
|
||||||
|
|
||||||
@ -3834,7 +3834,7 @@ void Test::testCutPasteRefUndo()
|
|||||||
// A2 references B2.
|
// A2 references B2.
|
||||||
m_pDoc->SetString(ScAddress(0,1,0), "=B2");
|
m_pDoc->SetString(ScAddress(0,1,0), "=B2");
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
|
|
||||||
// Set up clip document for cutting of B2.
|
// Set up clip document for cutting of B2.
|
||||||
@ -3911,7 +3911,7 @@ void Test::testCutPasteGroupRefUndo()
|
|||||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("Initial formula failure", OUString::createFromAscii(aDataCheck[i][1]), aString);
|
CPPUNIT_ASSERT_EQUAL_MESSAGE("Initial formula failure", OUString::createFromAscii(aDataCheck[i][1]), aString);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
|
|
||||||
// Set up clip document.
|
// Set up clip document.
|
||||||
@ -4034,7 +4034,7 @@ void Test::testUndoCut()
|
|||||||
CPPUNIT_ASSERT_EQUAL(111.0, m_pDoc->GetValue(0,3,0));
|
CPPUNIT_ASSERT_EQUAL(111.0, m_pDoc->GetValue(0,3,0));
|
||||||
|
|
||||||
// Select A1:A3.
|
// Select A1:A3.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
ScRange aRange(0,0,0,0,2,0);
|
ScRange aRange(0,0,0,0,2,0);
|
||||||
aMark.SetMarkArea(aRange);
|
aMark.SetMarkArea(aRange);
|
||||||
aMark.MarkToMulti();
|
aMark.MarkToMulti();
|
||||||
@ -4148,7 +4148,7 @@ void Test::testCopyPasteRelativeFormula()
|
|||||||
// Select and copy B3:B4 to the clipboard.
|
// Select and copy B3:B4 to the clipboard.
|
||||||
ScRange aRange(1,2,0,1,3,0);
|
ScRange aRange(1,2,0,1,3,0);
|
||||||
ScClipParam aClipParam(aRange, false);
|
ScClipParam aClipParam(aRange, false);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aRange);
|
aMark.SetMarkArea(aRange);
|
||||||
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
||||||
m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark, false, false);
|
m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark, false, false);
|
||||||
@ -4203,7 +4203,7 @@ void Test::testCopyPasteRepeatOneFormula()
|
|||||||
m_pDoc->InsertTab(0, "Test");
|
m_pDoc->InsertTab(0, "Test");
|
||||||
|
|
||||||
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
|
|
||||||
// Insert values in A1:B10.
|
// Insert values in A1:B10.
|
||||||
for (SCROW i = 0; i < 10; ++i)
|
for (SCROW i = 0; i < 10; ++i)
|
||||||
@ -4359,7 +4359,7 @@ void Test::testMergedCells()
|
|||||||
m_pDoc->ExtendMerge( 1, 1, nEndCol, nEndRow, 0);
|
m_pDoc->ExtendMerge( 1, 1, nEndCol, nEndRow, 0);
|
||||||
CPPUNIT_ASSERT_MESSAGE("did not merge cells", nEndCol == 3 && nEndRow == 3);
|
CPPUNIT_ASSERT_MESSAGE("did not merge cells", nEndCol == 3 && nEndRow == 3);
|
||||||
ScRange aRange(0,2,0,MAXCOL,2,0);
|
ScRange aRange(0,2,0,MAXCOL,2,0);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aRange);
|
aMark.SetMarkArea(aRange);
|
||||||
getDocShell().GetDocFunc().InsertCells(aRange, &aMark, INS_INSROWS_BEFORE, true, true);
|
getDocShell().GetDocFunc().InsertCells(aRange, &aMark, INS_INSROWS_BEFORE, true, true);
|
||||||
m_pDoc->ExtendMerge(1, 1, nEndCol, nEndRow, 0);
|
m_pDoc->ExtendMerge(1, 1, nEndCol, nEndRow, 0);
|
||||||
@ -4546,7 +4546,7 @@ void Test::testSearchCells()
|
|||||||
SvxSearchItem aItem(SID_SEARCH_ITEM);
|
SvxSearchItem aItem(SID_SEARCH_ITEM);
|
||||||
aItem.SetSearchString("A");
|
aItem.SetSearchString("A");
|
||||||
aItem.SetCommand(SvxSearchCmd::FIND_ALL);
|
aItem.SetCommand(SvxSearchCmd::FIND_ALL);
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(MAXROW, MAXCOL);
|
||||||
aMarkData.SelectOneTable(0);
|
aMarkData.SelectOneTable(0);
|
||||||
SCCOL nCol = 0;
|
SCCOL nCol = 0;
|
||||||
SCROW nRow = 0;
|
SCROW nRow = 0;
|
||||||
@ -4686,7 +4686,7 @@ void Test::testAutoFill()
|
|||||||
|
|
||||||
m_pDoc->SetValue(0,0,0,1);
|
m_pDoc->SetValue(0,0,0,1);
|
||||||
|
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(MAXROW, MAXCOL);
|
||||||
aMarkData.SelectTable(0, true);
|
aMarkData.SelectTable(0, true);
|
||||||
|
|
||||||
m_pDoc->Fill( 0, 0, 0, 0, nullptr, aMarkData, 5);
|
m_pDoc->Fill( 0, 0, 0, 0, nullptr, aMarkData, 5);
|
||||||
@ -4806,7 +4806,7 @@ void Test::testAutoFillSimple()
|
|||||||
m_pDoc->SetValue(0, 0, 0, 1);
|
m_pDoc->SetValue(0, 0, 0, 1);
|
||||||
m_pDoc->SetString(0, 1, 0, "=10");
|
m_pDoc->SetString(0, 1, 0, "=10");
|
||||||
|
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(MAXROW, MAXCOL);
|
||||||
aMarkData.SelectTable(0, true);
|
aMarkData.SelectTable(0, true);
|
||||||
|
|
||||||
m_pDoc->Fill( 0, 0, 0, 1, nullptr, aMarkData, 6, FILL_TO_BOTTOM, FILL_AUTO);
|
m_pDoc->Fill( 0, 0, 0, 1, nullptr, aMarkData, 6, FILL_TO_BOTTOM, FILL_AUTO);
|
||||||
@ -4896,13 +4896,13 @@ void Test::testCopyPasteFormulasExternalDoc()
|
|||||||
|
|
||||||
ScRange aRange(0,0,0,0,5,0);
|
ScRange aRange(0,0,0,0,5,0);
|
||||||
ScClipParam aClipParam(aRange, false);
|
ScClipParam aClipParam(aRange, false);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aRange);
|
aMark.SetMarkArea(aRange);
|
||||||
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
||||||
m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark, false, false);
|
m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark, false, false);
|
||||||
|
|
||||||
aRange = ScRange(1,1,1,1,6,1);
|
aRange = ScRange(1,1,1,1,6,1);
|
||||||
ScMarkData aMarkData2;
|
ScMarkData aMarkData2(MAXROW, MAXCOL);
|
||||||
aMarkData2.SetMarkArea(aRange);
|
aMarkData2.SetMarkArea(aRange);
|
||||||
rExtDoc.CopyFromClip(aRange, aMarkData2, InsertDeleteFlags::ALL, nullptr, &aClipDoc);
|
rExtDoc.CopyFromClip(aRange, aMarkData2, InsertDeleteFlags::ALL, nullptr, &aClipDoc);
|
||||||
|
|
||||||
@ -4951,13 +4951,13 @@ void Test::testCopyPasteReferencesExternalDoc()
|
|||||||
|
|
||||||
ScRange aRange(0,2,0,0,5,0);
|
ScRange aRange(0,2,0,0,5,0);
|
||||||
ScClipParam aClipParam(aRange, false);
|
ScClipParam aClipParam(aRange, false);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aRange);
|
aMark.SetMarkArea(aRange);
|
||||||
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
||||||
m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark, false, false);
|
m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMark, false, false);
|
||||||
|
|
||||||
aRange = ScRange(0,0,0,0,3,0);
|
aRange = ScRange(0,0,0,0,3,0);
|
||||||
ScMarkData aMarkData2;
|
ScMarkData aMarkData2(MAXROW, MAXCOL);
|
||||||
aMarkData2.SetMarkArea(aRange);
|
aMarkData2.SetMarkArea(aRange);
|
||||||
rExtDoc.CopyFromClip(aRange, aMarkData2, InsertDeleteFlags::ALL, nullptr, &aClipDoc);
|
rExtDoc.CopyFromClip(aRange, aMarkData2, InsertDeleteFlags::ALL, nullptr, &aClipDoc);
|
||||||
|
|
||||||
@ -5258,7 +5258,7 @@ void Test::testNoteDeleteRow()
|
|||||||
|
|
||||||
// Delete row 2.
|
// Delete row 2.
|
||||||
ScDocFunc& rDocFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rDocFunc = getDocShell().GetDocFunc();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
rDocFunc.DeleteCells(ScRange(0,1,0,MAXCOL,1,0), &aMark, DelCellCmd::CellsUp, true);
|
rDocFunc.DeleteCells(ScRange(0,1,0,MAXCOL,1,0), &aMark, DelCellCmd::CellsUp, true);
|
||||||
|
|
||||||
@ -5362,7 +5362,7 @@ void Test::testNoteLifeCycle()
|
|||||||
|
|
||||||
ScClipParam aClipParam(aPos, false);
|
ScClipParam aClipParam(aPos, false);
|
||||||
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(MAXROW, MAXCOL);
|
||||||
aMarkData.SelectOneTable(0);
|
aMarkData.SelectOneTable(0);
|
||||||
m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMarkData, false, true);
|
m_pDoc->CopyToClip(aClipParam, &aClipDoc, &aMarkData, false, true);
|
||||||
|
|
||||||
@ -5497,7 +5497,7 @@ void Test::testNoteCopyPaste()
|
|||||||
pNote->SetText(aPos, "Note2");
|
pNote->SetText(aPos, "Note2");
|
||||||
|
|
||||||
// Copy B2:B4 to clipboard.
|
// Copy B2:B4 to clipboard.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
ScRange aCopyRange(1,1,0,1,3,0);
|
ScRange aCopyRange(1,1,0,1,3,0);
|
||||||
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
||||||
@ -5988,7 +5988,7 @@ void Test::testDeleteContents()
|
|||||||
|
|
||||||
// Delete D2:D6.
|
// Delete D2:D6.
|
||||||
ScRange aRange(3,1,0,3,5,0);
|
ScRange aRange(3,1,0,3,5,0);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
aMark.SetMarkArea(aRange);
|
aMark.SetMarkArea(aRange);
|
||||||
|
|
||||||
@ -6019,7 +6019,7 @@ void Test::testTransliterateText()
|
|||||||
m_pDoc->SetString(ScAddress(0,2,0), "Oscar");
|
m_pDoc->SetString(ScAddress(0,2,0), "Oscar");
|
||||||
|
|
||||||
// Change them to uppercase.
|
// Change them to uppercase.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(ScRange(0,0,0,0,2,0));
|
aMark.SetMarkArea(ScRange(0,0,0,0,2,0));
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
rFunc.TransliterateText(
|
rFunc.TransliterateText(
|
||||||
@ -6396,7 +6396,7 @@ void Test::testCopyPasteMatrixFormula()
|
|||||||
m_pDoc->SetValue(ScAddress(3,2,0), 11.0); // D3
|
m_pDoc->SetValue(ScAddress(3,2,0), 11.0); // D3
|
||||||
|
|
||||||
// Insert matrix formula to A1
|
// Insert matrix formula to A1
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(0, 0, 0, 0, aMark, "=COUNTIF(ISBLANK(B1:D1);TRUE())");
|
m_pDoc->InsertMatrixFormula(0, 0, 0, 0, aMark, "=COUNTIF(ISBLANK(B1:D1);TRUE())");
|
||||||
m_pDoc->CalcAll();
|
m_pDoc->CalcAll();
|
||||||
@ -6480,7 +6480,7 @@ void Test::testUndoDataAnchor()
|
|||||||
//pDrawLayer->BeginCalcUndo(false);
|
//pDrawLayer->BeginCalcUndo(false);
|
||||||
// Insert a new row at row 3.
|
// Insert a new row at row 3.
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
rFunc.InsertCells(ScRange( 0, aOldStart.Row() - 1, 0, MAXCOL, aOldStart.Row(), 0 ), &aMark, INS_INSROWS_BEFORE, true, true);
|
rFunc.InsertCells(ScRange( 0, aOldStart.Row() - 1, 0, MAXCOL, aOldStart.Row(), 0 ), &aMark, INS_INSROWS_BEFORE, true, true);
|
||||||
|
|
||||||
@ -6680,7 +6680,7 @@ void Test::printRange(ScDocument* pDoc, const ScRange& rRange, const char* pCapt
|
|||||||
|
|
||||||
void Test::clearRange(ScDocument* pDoc, const ScRange& rRange)
|
void Test::clearRange(ScDocument* pDoc, const ScRange& rRange)
|
||||||
{
|
{
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(MAXROW, MAXCOL);
|
||||||
aMarkData.SetMarkArea(rRange);
|
aMarkData.SetMarkArea(rRange);
|
||||||
pDoc->DeleteArea(
|
pDoc->DeleteArea(
|
||||||
rRange.aStart.Col(), rRange.aStart.Row(),
|
rRange.aStart.Col(), rRange.aStart.Row(),
|
||||||
@ -6698,7 +6698,7 @@ ScUndoCut* Test::cutToClip(ScDocShell& rDocSh, const ScRange& rRange, ScDocument
|
|||||||
ScDocument* pSrcDoc = &rDocSh.GetDocument();
|
ScDocument* pSrcDoc = &rDocSh.GetDocument();
|
||||||
|
|
||||||
ScClipParam aClipParam(rRange, true);
|
ScClipParam aClipParam(rRange, true);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(rRange);
|
aMark.SetMarkArea(rRange);
|
||||||
pSrcDoc->CopyToClip(aClipParam, pClipDoc, &aMark, false, false);
|
pSrcDoc->CopyToClip(aClipParam, pClipDoc, &aMark, false, false);
|
||||||
|
|
||||||
@ -6730,21 +6730,21 @@ ScUndoCut* Test::cutToClip(ScDocShell& rDocSh, const ScRange& rRange, ScDocument
|
|||||||
void Test::copyToClip(ScDocument* pSrcDoc, const ScRange& rRange, ScDocument* pClipDoc)
|
void Test::copyToClip(ScDocument* pSrcDoc, const ScRange& rRange, ScDocument* pClipDoc)
|
||||||
{
|
{
|
||||||
ScClipParam aClipParam(rRange, false);
|
ScClipParam aClipParam(rRange, false);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(rRange);
|
aMark.SetMarkArea(rRange);
|
||||||
pSrcDoc->CopyToClip(aClipParam, pClipDoc, &aMark, false, false);
|
pSrcDoc->CopyToClip(aClipParam, pClipDoc, &aMark, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::pasteFromClip(ScDocument* pDestDoc, const ScRange& rDestRange, ScDocument* pClipDoc)
|
void Test::pasteFromClip(ScDocument* pDestDoc, const ScRange& rDestRange, ScDocument* pClipDoc)
|
||||||
{
|
{
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(rDestRange);
|
aMark.SetMarkArea(rDestRange);
|
||||||
pDestDoc->CopyFromClip(rDestRange, aMark, InsertDeleteFlags::ALL, nullptr, pClipDoc);
|
pDestDoc->CopyFromClip(rDestRange, aMark, InsertDeleteFlags::ALL, nullptr, pClipDoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Test::pasteOneCellFromClip(ScDocument* pDestDoc, const ScRange& rDestRange, ScDocument* pClipDoc, InsertDeleteFlags eFlags)
|
void Test::pasteOneCellFromClip(ScDocument* pDestDoc, const ScRange& rDestRange, ScDocument* pClipDoc, InsertDeleteFlags eFlags)
|
||||||
{
|
{
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(rDestRange);
|
aMark.SetMarkArea(rDestRange);
|
||||||
sc::CopyFromClipContext aCxt(*pDestDoc, nullptr, pClipDoc, eFlags, false, false);
|
sc::CopyFromClipContext aCxt(*pDestDoc, nullptr, pClipDoc, eFlags, false, false);
|
||||||
aCxt.setDestRange(rDestRange.aStart.Col(), rDestRange.aStart.Row(),
|
aCxt.setDestRange(rDestRange.aStart.Col(), rDestRange.aStart.Row(),
|
||||||
@ -6757,7 +6757,7 @@ void Test::pasteOneCellFromClip(ScDocument* pDestDoc, const ScRange& rDestRange,
|
|||||||
ScUndoPaste* Test::createUndoPaste(ScDocShell& rDocSh, const ScRange& rRange, ScDocumentUniquePtr pUndoDoc)
|
ScUndoPaste* Test::createUndoPaste(ScDocShell& rDocSh, const ScRange& rRange, ScDocumentUniquePtr pUndoDoc)
|
||||||
{
|
{
|
||||||
ScDocument& rDoc = rDocSh.GetDocument();
|
ScDocument& rDoc = rDocSh.GetDocument();
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(MAXROW, MAXCOL);
|
||||||
aMarkData.SetMarkArea(rRange);
|
aMarkData.SetMarkArea(rRange);
|
||||||
std::unique_ptr<ScRefUndoData> pRefUndoData(new ScRefUndoData(&rDoc));
|
std::unique_ptr<ScRefUndoData> pRefUndoData(new ScRefUndoData(&rDoc));
|
||||||
|
|
||||||
@ -7004,7 +7004,7 @@ void Test::testProtectedSheetEditByRow()
|
|||||||
|
|
||||||
// Try to delete row 3. It should fail.
|
// Try to delete row 3. It should fail.
|
||||||
ScRange aRow3(0,2,0,MAXCOL,2,0);
|
ScRange aRow3(0,2,0,MAXCOL,2,0);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
bool bDeleted = rDocFunc.DeleteCells(aRow3, &aMark, DelCellCmd::Rows, true);
|
bool bDeleted = rDocFunc.DeleteCells(aRow3, &aMark, DelCellCmd::Rows, true);
|
||||||
CPPUNIT_ASSERT_MESSAGE("deletion of row 3 should fail.", !bDeleted);
|
CPPUNIT_ASSERT_MESSAGE("deletion of row 3 should fail.", !bDeleted);
|
||||||
@ -7042,7 +7042,7 @@ void Test::testProtectedSheetEditByRow()
|
|||||||
|
|
||||||
{
|
{
|
||||||
// Insert matrix into B2:C3.
|
// Insert matrix into B2:C3.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(1);
|
aMark.SelectOneTable(1);
|
||||||
m_pDoc->InsertMatrixFormula(1, 1, 2, 2, aMark, "={1;2|3;4}");
|
m_pDoc->InsertMatrixFormula(1, 1, 2, 2, aMark, "={1;2|3;4}");
|
||||||
|
|
||||||
@ -7080,7 +7080,7 @@ void Test::testProtectedSheetEditByColumn()
|
|||||||
|
|
||||||
// Try to delete column C. It should fail.
|
// Try to delete column C. It should fail.
|
||||||
ScRange aCol3(2,0,0,2,MAXROW,0);
|
ScRange aCol3(2,0,0,2,MAXROW,0);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
bool bDeleted = rDocFunc.DeleteCells(aCol3, &aMark, DelCellCmd::Cols, true);
|
bool bDeleted = rDocFunc.DeleteCells(aCol3, &aMark, DelCellCmd::Cols, true);
|
||||||
CPPUNIT_ASSERT_MESSAGE("deletion of column 3 should fail.", !bDeleted);
|
CPPUNIT_ASSERT_MESSAGE("deletion of column 3 should fail.", !bDeleted);
|
||||||
@ -7118,7 +7118,7 @@ void Test::testProtectedSheetEditByColumn()
|
|||||||
|
|
||||||
{
|
{
|
||||||
// Insert matrix into B2:C3.
|
// Insert matrix into B2:C3.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(1);
|
aMark.SelectOneTable(1);
|
||||||
m_pDoc->InsertMatrixFormula(1, 1, 2, 2, aMark, "={1;2|3;4}");
|
m_pDoc->InsertMatrixFormula(1, 1, 2, 2, aMark, "={1;2|3;4}");
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ void Test::testCopyPasteSkipEmptyConditionalFormatting()
|
|||||||
ScRange aDestRange(0,0,0,1,2,0);
|
ScRange aDestRange(0,0,0,1,2,0);
|
||||||
ScRange aSrcRange(3,3,0,5,4,0);
|
ScRange aSrcRange(3,3,0,5,4,0);
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(aDestRange);
|
aMark.SetMarkArea(aDestRange);
|
||||||
|
|
||||||
m_pDoc->SetValue(0,0,0,1);
|
m_pDoc->SetValue(0,0,0,1);
|
||||||
|
@ -1260,7 +1260,7 @@ void Test::testFormulaCompilerImplicitIntersection1ParamNoChange()
|
|||||||
{
|
{
|
||||||
if (rCase.bMatrixFormula)
|
if (rCase.bMatrixFormula)
|
||||||
{
|
{
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
SCCOL nColStart = rCase.aCellAddress.Col();
|
SCCOL nColStart = rCase.aCellAddress.Col();
|
||||||
SCROW nRowStart = rCase.aCellAddress.Row();
|
SCROW nRowStart = rCase.aCellAddress.Row();
|
||||||
@ -2241,7 +2241,7 @@ void Test::testFormulaRefUpdateInsertRows()
|
|||||||
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(1,4,0)));
|
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(1,4,0)));
|
||||||
|
|
||||||
// Insert rows over rows 1:2.
|
// Insert rows over rows 1:2.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
rFunc.InsertCells(ScRange(0,0,0,m_pDoc->MaxCol(),1,0), &aMark, INS_INSROWS_BEFORE, false, true);
|
rFunc.InsertCells(ScRange(0,0,0,m_pDoc->MaxCol(),1,0), &aMark, INS_INSROWS_BEFORE, false, true);
|
||||||
@ -2396,7 +2396,7 @@ void Test::testFormulaRefUpdateInsertColumns()
|
|||||||
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(2,3,0)));
|
CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(2,3,0)));
|
||||||
|
|
||||||
// Insert columns over A:B.
|
// Insert columns over A:B.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
rFunc.InsertCells(ScRange(0,0,0,1,m_pDoc->MaxRow(),0), &aMark, INS_INSCOLS_BEFORE, false, true);
|
rFunc.InsertCells(ScRange(0,0,0,1,m_pDoc->MaxRow(),0), &aMark, INS_INSCOLS_BEFORE, false, true);
|
||||||
@ -2994,7 +2994,7 @@ void Test::testFormulaRefUpdateDeleteContent()
|
|||||||
|
|
||||||
// Delete B2.
|
// Delete B2.
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(ScAddress(1,1,0));
|
aMark.SetMarkArea(ScAddress(1,1,0));
|
||||||
rFunc.DeleteContents(aMark, InsertDeleteFlags::CONTENTS, true, true);
|
rFunc.DeleteContents(aMark, InsertDeleteFlags::CONTENTS, true, true);
|
||||||
|
|
||||||
@ -3034,7 +3034,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftLeft()
|
|||||||
CPPUNIT_ASSERT_EQUAL(15.0, m_pDoc->GetValue(aPos));
|
CPPUNIT_ASSERT_EQUAL(15.0, m_pDoc->GetValue(aPos));
|
||||||
|
|
||||||
// Delete columns D:E (middle of the reference).
|
// Delete columns D:E (middle of the reference).
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
bool bDeleted = rFunc.DeleteCells(ScRange(3,0,0,4,m_pDoc->MaxRow(),0), &aMark, DelCellCmd::CellsLeft, true);
|
bool bDeleted = rFunc.DeleteCells(ScRange(3,0,0,4,m_pDoc->MaxRow(),0), &aMark, DelCellCmd::CellsLeft, true);
|
||||||
@ -3169,7 +3169,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftLeft2()
|
|||||||
funcCheckOriginal();
|
funcCheckOriginal();
|
||||||
|
|
||||||
// Delete Column A.
|
// Delete Column A.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
bool bDeleted = rFunc.DeleteCells(ScRange(0,0,0,0,m_pDoc->MaxRow(),0), &aMark, DelCellCmd::CellsLeft, true);
|
bool bDeleted = rFunc.DeleteCells(ScRange(0,0,0,0,m_pDoc->MaxRow(),0), &aMark, DelCellCmd::CellsLeft, true);
|
||||||
@ -3208,7 +3208,7 @@ void Test::testFormulaRefUpdateDeleteAndShiftUp()
|
|||||||
CPPUNIT_ASSERT_EQUAL(15.0, m_pDoc->GetValue(aPos));
|
CPPUNIT_ASSERT_EQUAL(15.0, m_pDoc->GetValue(aPos));
|
||||||
|
|
||||||
// Delete rows 4:5 (middle of the reference).
|
// Delete rows 4:5 (middle of the reference).
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
bool bDeleted = rFunc.DeleteCells(ScRange(0,3,0,m_pDoc->MaxCol(),4,0), &aMark, DelCellCmd::CellsUp, true);
|
bool bDeleted = rFunc.DeleteCells(ScRange(0,3,0,m_pDoc->MaxCol(),4,0), &aMark, DelCellCmd::CellsUp, true);
|
||||||
@ -3549,7 +3549,7 @@ void Test::testFormulaRefUpdateNameExpandRef()
|
|||||||
|
|
||||||
// Insert a new row at row 4, which should expand the named range to A1:A4.
|
// Insert a new row at row 4, which should expand the named range to A1:A4.
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
rFunc.InsertCells(ScRange(0,3,0,m_pDoc->MaxCol(),3,0), &aMark, INS_INSROWS_BEFORE, false, true);
|
rFunc.InsertCells(ScRange(0,3,0,m_pDoc->MaxCol(),3,0), &aMark, INS_INSROWS_BEFORE, false, true);
|
||||||
ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
|
ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
|
||||||
@ -3663,7 +3663,7 @@ void Test::testFormulaRefUpdateNameExpandRef2()
|
|||||||
|
|
||||||
// Insert a new row at row 4, which should expand the named range to A1:A4.
|
// Insert a new row at row 4, which should expand the named range to A1:A4.
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
|
|
||||||
// Insert a new column at column 3, which should expand the named
|
// Insert a new column at column 3, which should expand the named
|
||||||
@ -3708,7 +3708,7 @@ void Test::testFormulaRefUpdateNameDeleteRow()
|
|||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
|
|
||||||
// Delete row 3.
|
// Delete row 3.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
rFunc.DeleteCells(ScRange(0,2,0,m_pDoc->MaxCol(),2,0), &aMark, DelCellCmd::CellsUp, true);
|
rFunc.DeleteCells(ScRange(0,2,0,m_pDoc->MaxCol(),2,0), &aMark, DelCellCmd::CellsUp, true);
|
||||||
|
|
||||||
@ -3773,7 +3773,7 @@ void Test::testFormulaRefUpdateNameDeleteRow()
|
|||||||
|
|
||||||
m_pDoc->InsertTab(1, "test2");
|
m_pDoc->InsertTab(1, "test2");
|
||||||
|
|
||||||
ScMarkData aMark2;
|
ScMarkData aMark2(MAXROW, MAXCOL);
|
||||||
aMark2.SelectOneTable(1);
|
aMark2.SelectOneTable(1);
|
||||||
rFunc.DeleteCells(ScRange(0,2,1,m_pDoc->MaxCol(),2,1), &aMark2, DelCellCmd::CellsUp, true);
|
rFunc.DeleteCells(ScRange(0,2,1,m_pDoc->MaxCol(),2,1), &aMark2, DelCellCmd::CellsUp, true);
|
||||||
|
|
||||||
@ -4094,7 +4094,7 @@ void Test::testFormulaRefUpdateValidity()
|
|||||||
CPPUNIT_ASSERT_MESSAGE("Initial list is incorrect.", bGood);
|
CPPUNIT_ASSERT_MESSAGE("Initial list is incorrect.", bGood);
|
||||||
|
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
|
|
||||||
// Insert a new column at Column B, to move the list from C2:C4 to D2:D4.
|
// Insert a new column at Column B, to move the list from C2:C4 to D2:D4.
|
||||||
@ -4218,7 +4218,7 @@ void Test::testMultipleOperations()
|
|||||||
aParam.aRefFormulaCell = ScRefAddress(1,0,0);
|
aParam.aRefFormulaCell = ScRefAddress(1,0,0);
|
||||||
aParam.aRefFormulaEnd = aParam.aRefFormulaCell;
|
aParam.aRefFormulaEnd = aParam.aRefFormulaCell;
|
||||||
aParam.aRefColCell = ScRefAddress(0,0,0);
|
aParam.aRefColCell = ScRefAddress(0,0,0);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SetMarkArea(ScRange(0,2,0,1,4,0)); // Select A3:B5.
|
aMark.SetMarkArea(ScRange(0,2,0,1,4,0)); // Select A3:B5.
|
||||||
m_pDoc->InsertTableOp(aParam, 0, 2, 1, 4, aMark);
|
m_pDoc->InsertTableOp(aParam, 0, 2, 1, 4, aMark);
|
||||||
CPPUNIT_ASSERT_EQUAL(20.0, m_pDoc->GetValue(1,2,0));
|
CPPUNIT_ASSERT_EQUAL(20.0, m_pDoc->GetValue(1,2,0));
|
||||||
@ -4303,7 +4303,7 @@ void Test::testFuncCOUNT()
|
|||||||
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(aPos));
|
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(aPos));
|
||||||
|
|
||||||
// Matrix in C1.
|
// Matrix in C1.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(2, 0, 2, 0, aMark, "=COUNT(SEARCH(\"a\";{\"a\";\"b\";\"a\"}))");
|
m_pDoc->InsertMatrixFormula(2, 0, 2, 0, aMark, "=COUNT(SEARCH(\"a\";{\"a\";\"b\";\"a\"}))");
|
||||||
// Check that the #VALUE! error of "a" not found in "b" is not counted.
|
// Check that the #VALUE! error of "a" not found in "b" is not counted.
|
||||||
@ -4408,7 +4408,7 @@ void Test::testFuncROW()
|
|||||||
|
|
||||||
// Insert a new row at row 4.
|
// Insert a new row at row 4.
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
rFunc.InsertCells(ScRange(0,3,0,m_pDoc->MaxCol(),3,0), &aMark, INS_INSROWS_BEFORE, false, true);
|
rFunc.InsertCells(ScRange(0,3,0,m_pDoc->MaxCol(),3,0), &aMark, INS_INSROWS_BEFORE, false, true);
|
||||||
ASSERT_FORMULA_EQUAL(*m_pDoc, ScAddress(0,1,0), "ROW(A6)", "Wrong formula!");
|
ASSERT_FORMULA_EQUAL(*m_pDoc, ScAddress(0,1,0), "ROW(A6)", "Wrong formula!");
|
||||||
@ -4620,7 +4620,7 @@ void Test::testFuncMIN()
|
|||||||
m_pDoc->SetValue(ScAddress(1,1,0), 2.0);
|
m_pDoc->SetValue(ScAddress(1,1,0), 2.0);
|
||||||
|
|
||||||
// Matrix in C1:C2.
|
// Matrix in C1:C2.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(2, 0, 2, 1, aMark, "=MIN(IF(A1:A2=\"c\";B1:B2))");
|
m_pDoc->InsertMatrixFormula(2, 0, 2, 1, aMark, "=MIN(IF(A1:A2=\"c\";B1:B2))");
|
||||||
|
|
||||||
@ -4832,7 +4832,7 @@ void Test::testFuncCOUNTIF()
|
|||||||
// Another test case adopted from tdf#99291, empty array elements should
|
// Another test case adopted from tdf#99291, empty array elements should
|
||||||
// not match empty cells, but cells with 0.
|
// not match empty cells, but cells with 0.
|
||||||
clearSheet(m_pDoc, 0);
|
clearSheet(m_pDoc, 0);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(0,0, 0,1, aMark, "=COUNTIF(B1:B5;C1:C2)");
|
m_pDoc->InsertMatrixFormula(0,0, 0,1, aMark, "=COUNTIF(B1:B5;C1:C2)");
|
||||||
// As we will be testing for 0.0 values, check that formulas are actually present.
|
// As we will be testing for 0.0 values, check that formulas are actually present.
|
||||||
@ -4870,7 +4870,7 @@ void Test::testFuncIF()
|
|||||||
CPPUNIT_ASSERT_EQUAL(OUString("not two"), m_pDoc->GetString(ScAddress(0,0,0)));
|
CPPUNIT_ASSERT_EQUAL(OUString("not two"), m_pDoc->GetString(ScAddress(0,0,0)));
|
||||||
|
|
||||||
// Test nested IF in array/matrix if the nested IF condition is a scalar.
|
// Test nested IF in array/matrix if the nested IF condition is a scalar.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(0,2, 1,2, aMark, "=IF({1;0};IF(1;23);42)");
|
m_pDoc->InsertMatrixFormula(0,2, 1,2, aMark, "=IF({1;0};IF(1;23);42)");
|
||||||
// Results must be 23 and 42.
|
// Results must be 23 and 42.
|
||||||
@ -4987,7 +4987,7 @@ void Test::testFuncIFERROR()
|
|||||||
|
|
||||||
// Create a matrix range in last two rows of the range above, actual data
|
// Create a matrix range in last two rows of the range above, actual data
|
||||||
// of the placeholders.
|
// of the placeholders.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(0, 20 + nRows-2, 0, 20 + nRows-1, aMark, "=IFERROR(3*A11:A12;1998)");
|
m_pDoc->InsertMatrixFormula(0, 20 + nRows-2, 0, 20 + nRows-1, aMark, "=IFERROR(3*A11:A12;1998)");
|
||||||
|
|
||||||
@ -5170,7 +5170,7 @@ void Test::testFuncLEN()
|
|||||||
// Leave A1:A3 empty, and insert an array of LEN in B1:B3 that references
|
// Leave A1:A3 empty, and insert an array of LEN in B1:B3 that references
|
||||||
// these empty cells.
|
// these empty cells.
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(1, 0, 1, 2, aMark, "=LEN(A1:A3)");
|
m_pDoc->InsertMatrixFormula(1, 0, 1, 2, aMark, "=LEN(A1:A3)");
|
||||||
|
|
||||||
@ -6118,7 +6118,7 @@ void Test::testFormulaDepTrackingDeleteRow()
|
|||||||
|
|
||||||
// Delete row 2.
|
// Delete row 2.
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
rFunc.DeleteCells(ScRange(0,1,0,m_pDoc->MaxCol(),1,0), &aMark, DelCellCmd::CellsUp, true);
|
rFunc.DeleteCells(ScRange(0,1,0,m_pDoc->MaxCol(),1,0), &aMark, DelCellCmd::CellsUp, true);
|
||||||
|
|
||||||
@ -6176,7 +6176,7 @@ void Test::testFormulaDepTrackingDeleteCol()
|
|||||||
|
|
||||||
// Delete column A. A1, B1, A3:A4 and B3:B4 should all show #REF!.
|
// Delete column A. A1, B1, A3:A4 and B3:B4 should all show #REF!.
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
rFunc.DeleteCells(ScRange(0,0,0,0,m_pDoc->MaxRow(),0), &aMark, DelCellCmd::CellsLeft, true);
|
rFunc.DeleteCells(ScRange(0,0,0,0,m_pDoc->MaxRow(),0), &aMark, DelCellCmd::CellsLeft, true);
|
||||||
|
|
||||||
@ -6261,7 +6261,7 @@ void Test::testFormulaMatrixResultUpdate()
|
|||||||
// Set a numeric value to A1.
|
// Set a numeric value to A1.
|
||||||
m_pDoc->SetValue(ScAddress(0,0,0), 11.0);
|
m_pDoc->SetValue(ScAddress(0,0,0), 11.0);
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(1, 0, 1, 0, aMark, "=A1");
|
m_pDoc->InsertMatrixFormula(1, 0, 1, 0, aMark, "=A1");
|
||||||
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(ScAddress(1,0,0)));
|
CPPUNIT_ASSERT_EQUAL(11.0, m_pDoc->GetValue(ScAddress(1,0,0)));
|
||||||
@ -6633,7 +6633,7 @@ void Test::testExternalRefFunctions()
|
|||||||
FormulaError nErr = pFC->GetErrCode();
|
FormulaError nErr = pFC->GetErrCode();
|
||||||
CPPUNIT_ASSERT_EQUAL_MESSAGE("huge external range reference expected to yield FormulaError::MatrixSize", int(FormulaError::MatrixSize), static_cast<int>(nErr));
|
CPPUNIT_ASSERT_EQUAL_MESSAGE("huge external range reference expected to yield FormulaError::MatrixSize", int(FormulaError::MatrixSize), static_cast<int>(nErr));
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(0,0,0,0, aMark, "'file:///extdata.fake'#Data.B1:AMJ1048575");
|
m_pDoc->InsertMatrixFormula(0,0,0,0, aMark, "'file:///extdata.fake'#Data.B1:AMJ1048575");
|
||||||
pFC = m_pDoc->GetFormulaCell( ScAddress(0,0,0));
|
pFC = m_pDoc->GetFormulaCell( ScAddress(0,0,0));
|
||||||
@ -6890,7 +6890,7 @@ void Test::testFuncFORMULA()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Matrix in D4:D6, no intersection with B1:B3
|
// Matrix in D4:D6, no intersection with B1:B3
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(3, 3, 3, 5, aMark, "=FORMULA(B1:B3)");
|
m_pDoc->InsertMatrixFormula(3, 3, 3, 5, aMark, "=FORMULA(B1:B3)");
|
||||||
for (size_t i=0; i < SAL_N_ELEMENTS(aChecks); ++i)
|
for (size_t i=0; i < SAL_N_ELEMENTS(aChecks); ++i)
|
||||||
@ -6906,7 +6906,7 @@ void Test::testFuncTableRef()
|
|||||||
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
|
sc::AutoCalcSwitch aACSwitch(*m_pDoc, true); // turn on auto calc.
|
||||||
|
|
||||||
m_pDoc->InsertTab(0, "Sheet1");
|
m_pDoc->InsertTab(0, "Sheet1");
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
ScDocFunc& rDocFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rDocFunc = getDocShell().GetDocFunc();
|
||||||
|
|
||||||
@ -8120,7 +8120,7 @@ void Test::testFormulaErrorPropagation()
|
|||||||
|
|
||||||
m_pDoc->InsertTab(0, "Sheet1");
|
m_pDoc->InsertTab(0, "Sheet1");
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
ScAddress aPos, aPos2;
|
ScAddress aPos, aPos2;
|
||||||
const OUString aTRUE("TRUE");
|
const OUString aTRUE("TRUE");
|
||||||
@ -8213,7 +8213,7 @@ public:
|
|||||||
std::function<double(SCROW )> const & lExpected ) const
|
std::function<double(SCROW )> const & lExpected ) const
|
||||||
{
|
{
|
||||||
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
|
|
||||||
ScAddress aPos(nColumn, m_nStart1, 0);
|
ScAddress aPos(nColumn, m_nStart1, 0);
|
||||||
m_pDoc->SetString(aPos, rFormula);
|
m_pDoc->SetString(aPos, rFormula);
|
||||||
@ -8334,7 +8334,7 @@ void Test::testTdf97587()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
ScDocument aClipDoc(SCDOCMODE_CLIP);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
|
|
||||||
ScAddress aPos(1, 0, 0);
|
ScAddress aPos(1, 0, 0);
|
||||||
m_pDoc->SetString(aPos, "=SUM(A1:A10)");
|
m_pDoc->SetString(aPos, "=SUM(A1:A10)");
|
||||||
@ -8372,7 +8372,7 @@ void Test::testMatConcat()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(0, 12, 9, 21, aMark, "=A1:J10&A1:J10");
|
m_pDoc->InsertMatrixFormula(0, 12, 9, 21, aMark, "=A1:J10&A1:J10");
|
||||||
|
|
||||||
@ -8435,7 +8435,7 @@ void Test::testMatConcatReplication()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(0, 12, 9, 21, aMark, "=A1:J10&A1:J1");
|
m_pDoc->InsertMatrixFormula(0, 12, 9, 21, aMark, "=A1:J10&A1:J1");
|
||||||
|
|
||||||
@ -8607,7 +8607,7 @@ void Test::testFuncSUMIFS()
|
|||||||
|
|
||||||
insertRangeData(m_pDoc, ScAddress(0,0,0), aData);
|
insertRangeData(m_pDoc, ScAddress(0,0,0), aData);
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
// Matrix formula in C8:C10 with SUMIFS
|
// Matrix formula in C8:C10 with SUMIFS
|
||||||
m_pDoc->InsertMatrixFormula(2, 7, 2, 9, aMark, "=SUMIFS(B1:B7;A1:A7;A9:A11)");
|
m_pDoc->InsertMatrixFormula(2, 7, 2, 9, aMark, "=SUMIFS(B1:B7;A1:A7;A9:A11)");
|
||||||
@ -8768,7 +8768,7 @@ void Test::testFuncRefListArraySUBTOTAL()
|
|||||||
m_pDoc->SetValue(0,5,0, 32.0); // A6
|
m_pDoc->SetValue(0,5,0, 32.0); // A6
|
||||||
|
|
||||||
// Matrix in B7:B9, individual SUM of A2:A3, A3:A4 and A4:A5
|
// Matrix in B7:B9, individual SUM of A2:A3, A3:A4 and A4:A5
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
m_pDoc->InsertMatrixFormula(1, 6, 1, 8, aMark, "=SUBTOTAL(9;OFFSET(A1;ROW(1:3);0;2))");
|
m_pDoc->InsertMatrixFormula(1, 6, 1, 8, aMark, "=SUBTOTAL(9;OFFSET(A1;ROW(1:3);0;2))");
|
||||||
ScAddress aPos(1,6,0);
|
ScAddress aPos(1,6,0);
|
||||||
@ -8888,7 +8888,7 @@ void Test::testFuncJumpMatrixArrayIF()
|
|||||||
}; // A7:B9
|
}; // A7:B9
|
||||||
insertRangeData(m_pDoc, ScAddress(0,6,0), aData);
|
insertRangeData(m_pDoc, ScAddress(0,6,0), aData);
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
|
|
||||||
// Matrix in C10, summing B7,B9
|
// Matrix in C10, summing B7,B9
|
||||||
@ -8917,7 +8917,7 @@ void Test::testFuncJumpMatrixArrayOFFSET()
|
|||||||
};
|
};
|
||||||
insertRangeData(m_pDoc, ScAddress(0,0,0), aData); // A1:A3
|
insertRangeData(m_pDoc, ScAddress(0,0,0), aData); // A1:A3
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
|
|
||||||
// Matrix in C5:C7, COLUMN()-3 here offsets by 0 but the entire expression
|
// Matrix in C5:C7, COLUMN()-3 here offsets by 0 but the entire expression
|
||||||
|
@ -675,7 +675,7 @@ void Test::testSharedFormulasRefUpdateRangeDeleteRow()
|
|||||||
|
|
||||||
// Delete row 3. This will merge the two formula groups.
|
// Delete row 3. This will merge the two formula groups.
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
rFunc.DeleteCells(ScRange(0,2,0,MAXCOL,2,0), &aMark, DelCellCmd::Rows, true);
|
rFunc.DeleteCells(ScRange(0,2,0,MAXCOL,2,0), &aMark, DelCellCmd::Rows, true);
|
||||||
|
|
||||||
@ -788,7 +788,7 @@ void Test::testSharedFormulasRefUpdateExternal()
|
|||||||
|
|
||||||
// Delete rows 1 and 2. This should not change the references in the formula cells below.
|
// Delete rows 1 and 2. This should not change the references in the formula cells below.
|
||||||
ScDocFunc& rDocFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rDocFunc = getDocShell().GetDocFunc();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
rDocFunc.DeleteCells(ScRange(0,0,0,MAXCOL,1,0), &aMark, DelCellCmd::CellsUp, true);
|
rDocFunc.DeleteCells(ScRange(0,0,0,MAXCOL,1,0), &aMark, DelCellCmd::CellsUp, true);
|
||||||
|
|
||||||
@ -902,7 +902,7 @@ void Test::testSharedFormulasInsertRow()
|
|||||||
|
|
||||||
// Insert a new row at row 3.
|
// Insert a new row at row 3.
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
rFunc.InsertCells(ScRange(0,2,0,MAXCOL,2,0), &aMark, INS_INSROWS_BEFORE, true, true);
|
rFunc.InsertCells(ScRange(0,2,0,MAXCOL,2,0), &aMark, INS_INSROWS_BEFORE, true, true);
|
||||||
|
|
||||||
@ -1023,7 +1023,7 @@ void Test::testSharedFormulasDeleteColumns()
|
|||||||
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
|
FormulaGrammarSwitch aFGSwitch(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH_XL_R1C1);
|
||||||
|
|
||||||
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
ScDocFunc& rFunc = getDocShell().GetDocFunc();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
|
|
||||||
// First, test a single cell case. A value in B1 and formula in C1.
|
// First, test a single cell case. A value in B1 and formula in C1.
|
||||||
@ -2262,7 +2262,7 @@ void Test::testSharedFormulaUpdateOnReplacement()
|
|||||||
|
|
||||||
// Set up an undo object for deleting A4.
|
// Set up an undo object for deleting A4.
|
||||||
ScRange aUndoRange(0,3,0,0,3,0);
|
ScRange aUndoRange(0,3,0,0,3,0);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
aMark.SetMultiMarkArea(aUndoRange);
|
aMark.SetMultiMarkArea(aUndoRange);
|
||||||
ScDocumentUniquePtr pUndoDoc(new ScDocument(SCDOCMODE_UNDO));
|
ScDocumentUniquePtr pUndoDoc(new ScDocument(SCDOCMODE_UNDO));
|
||||||
@ -2404,7 +2404,7 @@ void Test::testSharedFormulaDeleteTopCell()
|
|||||||
CPPUNIT_ASSERT_EQUAL( 3.0, m_pDoc->GetValue( ScAddress(0,1,0)));
|
CPPUNIT_ASSERT_EQUAL( 3.0, m_pDoc->GetValue( ScAddress(0,1,0)));
|
||||||
|
|
||||||
// Delete cell A1.
|
// Delete cell A1.
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
getDocShell().GetDocFunc().DeleteCell( ScAddress(0,0,0), aMark, InsertDeleteFlags::CONTENTS, false);
|
getDocShell().GetDocFunc().DeleteCell( ScAddress(0,0,0), aMark, InsertDeleteFlags::CONTENTS, false);
|
||||||
// Check it's gone.
|
// Check it's gone.
|
||||||
@ -2439,7 +2439,7 @@ void Test::testSharedFormulaCutCopyMoveIntoRef()
|
|||||||
const ScAddress aOrgPos(0,0,0);
|
const ScAddress aOrgPos(0,0,0);
|
||||||
insertRangeData( m_pDoc, aOrgPos, aData);
|
insertRangeData( m_pDoc, aOrgPos, aData);
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
|
|
||||||
// Set up clip document.
|
// Set up clip document.
|
||||||
@ -2486,7 +2486,7 @@ void Test::testSharedFormulaCutCopyMoveIntoRef()
|
|||||||
aPos.IncRow();
|
aPos.IncRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
|
|
||||||
// Set up clip document.
|
// Set up clip document.
|
||||||
@ -2553,7 +2553,7 @@ void Test::testSharedFormulaCutCopyMoveWithRef()
|
|||||||
const ScAddress aOrgPos(0,0,0);
|
const ScAddress aOrgPos(0,0,0);
|
||||||
insertRangeData( m_pDoc, aOrgPos, aData);
|
insertRangeData( m_pDoc, aOrgPos, aData);
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
|
|
||||||
ScAddress aPos( ScAddress::UNINITIALIZED);
|
ScAddress aPos( ScAddress::UNINITIALIZED);
|
||||||
@ -2647,7 +2647,7 @@ void Test::testSharedFormulaCutCopyMoveWithinRun()
|
|||||||
aPos.IncRow();
|
aPos.IncRow();
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(MAXROW, MAXCOL);
|
||||||
aMark.SelectOneTable(0);
|
aMark.SelectOneTable(0);
|
||||||
|
|
||||||
// Set up clip document.
|
// Set up clip document.
|
||||||
|
@ -2231,7 +2231,7 @@ ScRangeList ScConditionalFormatList::GetCombinedRange() const
|
|||||||
void ScConditionalFormatList::RemoveFromDocument(ScDocument* pDoc) const
|
void ScConditionalFormatList::RemoveFromDocument(ScDocument* pDoc) const
|
||||||
{
|
{
|
||||||
ScRangeList aRange = GetCombinedRange();
|
ScRangeList aRange = GetCombinedRange();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(pDoc->MaxRow(), pDoc->MaxCol());
|
||||||
aMark.MarkFromRangeList(aRange, true);
|
aMark.MarkFromRangeList(aRange, true);
|
||||||
sal_uInt16 const pItems[2] = { sal_uInt16(ATTR_CONDITIONAL),0};
|
sal_uInt16 const pItems[2] = { sal_uInt16(ATTR_CONDITIONAL),0};
|
||||||
pDoc->ClearSelectionItems(pItems, aMark);
|
pDoc->ClearSelectionItems(pItems, aMark);
|
||||||
|
@ -105,6 +105,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) :
|
|||||||
pFormulaTrack( nullptr ),
|
pFormulaTrack( nullptr ),
|
||||||
pEOFormulaTrack( nullptr ),
|
pEOFormulaTrack( nullptr ),
|
||||||
pPreviewCellStyle( nullptr ),
|
pPreviewCellStyle( nullptr ),
|
||||||
|
maPreviewSelection(MAXROW, MAXCOL),
|
||||||
nUnoObjectId( 0 ),
|
nUnoObjectId( 0 ),
|
||||||
nRangeOverflowType( 0 ),
|
nRangeOverflowType( 0 ),
|
||||||
aCurTextWidthCalcPos(MaxCol(),0,0),
|
aCurTextWidthCalcPos(MaxCol(),0,0),
|
||||||
|
@ -24,9 +24,10 @@
|
|||||||
|
|
||||||
#include <osl/diagnose.h>
|
#include <osl/diagnose.h>
|
||||||
|
|
||||||
ScMarkArray::ScMarkArray() :
|
ScMarkArray::ScMarkArray(SCROW nMaxRow) :
|
||||||
nCount( 0 ),
|
nCount( 0 ),
|
||||||
nLimit( 0 )
|
nLimit( 0 ),
|
||||||
|
mnMaxRow( nMaxRow )
|
||||||
{
|
{
|
||||||
// special case "no marks" with pData = NULL
|
// special case "no marks" with pData = NULL
|
||||||
}
|
}
|
||||||
@ -56,7 +57,7 @@ void ScMarkArray::Reset( bool bMarked, SCSIZE nNeeded )
|
|||||||
nLimit = nNeeded;
|
nLimit = nNeeded;
|
||||||
nCount = 1;
|
nCount = 1;
|
||||||
pData.reset( new ScMarkEntry[nNeeded] );
|
pData.reset( new ScMarkEntry[nNeeded] );
|
||||||
pData[0].nRow = MAXROW;
|
pData[0].nRow = mnMaxRow;
|
||||||
pData[0].bMarked = bMarked;
|
pData[0].bMarked = bMarked;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +112,7 @@ void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, bool bMarked )
|
|||||||
{
|
{
|
||||||
if (ValidRow(nStartRow) && ValidRow(nEndRow))
|
if (ValidRow(nStartRow) && ValidRow(nEndRow))
|
||||||
{
|
{
|
||||||
if ((nStartRow == 0) && (nEndRow == MAXROW))
|
if ((nStartRow == 0) && (nEndRow == mnMaxRow))
|
||||||
{
|
{
|
||||||
Reset(bMarked);
|
Reset(bMarked);
|
||||||
}
|
}
|
||||||
@ -143,7 +144,7 @@ void ScMarkArray::SetMarkArea( SCROW nStartRow, SCROW nEndRow, bool bMarked )
|
|||||||
}
|
}
|
||||||
|
|
||||||
SCSIZE ni; // number of entries in beginning
|
SCSIZE ni; // number of entries in beginning
|
||||||
SCSIZE nInsert; // insert position (MAXROW+1 := no insert)
|
SCSIZE nInsert; // insert position (mnMaxRow+1 := no insert)
|
||||||
bool bCombined = false;
|
bool bCombined = false;
|
||||||
bool bSplit = false;
|
bool bSplit = false;
|
||||||
if ( nStartRow > 0 )
|
if ( nStartRow > 0 )
|
||||||
@ -254,7 +255,7 @@ void ScMarkArray::Set( const std::vector<ScMarkEntry> & rMarkEntries )
|
|||||||
nLimit = nCount;
|
nLimit = nCount;
|
||||||
pData.reset( new ScMarkEntry[nLimit] );
|
pData.reset( new ScMarkEntry[nLimit] );
|
||||||
memcpy(pData.get(), rMarkEntries.data(), sizeof(ScMarkEntry) * rMarkEntries.size());
|
memcpy(pData.get(), rMarkEntries.data(), sizeof(ScMarkEntry) * rMarkEntries.size());
|
||||||
pData[nCount-1] = ScMarkEntry{MAXROW, false};
|
pData[nCount-1] = ScMarkEntry{mnMaxRow, false};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ScMarkArray::IsAllMarked( SCROW nStartRow, SCROW nEndRow ) const
|
bool ScMarkArray::IsAllMarked( SCROW nStartRow, SCROW nEndRow ) const
|
||||||
@ -279,7 +280,7 @@ bool ScMarkArray::HasOneMark( SCROW& rStartRow, SCROW& rEndRow ) const
|
|||||||
if ( pData[0].bMarked )
|
if ( pData[0].bMarked )
|
||||||
{
|
{
|
||||||
rStartRow = 0;
|
rStartRow = 0;
|
||||||
rEndRow = MAXROW;
|
rEndRow = mnMaxRow;
|
||||||
bRet = true;
|
bRet = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -293,7 +294,7 @@ bool ScMarkArray::HasOneMark( SCROW& rStartRow, SCROW& rEndRow ) const
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
rStartRow = pData[0].nRow + 1;
|
rStartRow = pData[0].nRow + 1;
|
||||||
rEndRow = MAXROW;
|
rEndRow = mnMaxRow;
|
||||||
}
|
}
|
||||||
bRet = true;
|
bRet = true;
|
||||||
}
|
}
|
||||||
@ -335,6 +336,7 @@ ScMarkArray& ScMarkArray::operator=( const ScMarkArray& rOther )
|
|||||||
pData.reset();
|
pData.reset();
|
||||||
|
|
||||||
nCount = nLimit = rOther.nCount;
|
nCount = nLimit = rOther.nCount;
|
||||||
|
mnMaxRow = rOther.mnMaxRow;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -343,6 +345,7 @@ ScMarkArray& ScMarkArray::operator=(ScMarkArray&& rOther) noexcept
|
|||||||
nCount = rOther.nCount;
|
nCount = rOther.nCount;
|
||||||
nLimit = rOther.nLimit;
|
nLimit = rOther.nLimit;
|
||||||
pData = std::move( rOther.pData );
|
pData = std::move( rOther.pData );
|
||||||
|
mnMaxRow = rOther.mnMaxRow;
|
||||||
rOther.nCount = 0;
|
rOther.nCount = 0;
|
||||||
rOther.nLimit = 0;
|
rOther.nLimit = 0;
|
||||||
return *this;
|
return *this;
|
||||||
@ -398,7 +401,7 @@ SCROW ScMarkArray::GetMarkEnd( SCROW nRow, bool bUp ) const
|
|||||||
|
|
||||||
void ScMarkArray::Shift(SCROW nStartRow, long nOffset)
|
void ScMarkArray::Shift(SCROW nStartRow, long nOffset)
|
||||||
{
|
{
|
||||||
if (!pData || nOffset == 0 || nStartRow > MAXROW)
|
if (!pData || nOffset == 0 || nStartRow > mnMaxRow)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (size_t i=0; i < nCount; ++i)
|
for (size_t i=0; i < nCount; ++i)
|
||||||
@ -412,9 +415,9 @@ void ScMarkArray::Shift(SCROW nStartRow, long nOffset)
|
|||||||
{
|
{
|
||||||
rEntry.nRow = 0;
|
rEntry.nRow = 0;
|
||||||
}
|
}
|
||||||
else if (rEntry.nRow > MAXROW)
|
else if (rEntry.nRow > mnMaxRow)
|
||||||
{
|
{
|
||||||
rEntry.nRow = MAXROW;
|
rEntry.nRow = mnMaxRow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,9 +32,11 @@
|
|||||||
#include <mdds/flat_segment_tree.hpp>
|
#include <mdds/flat_segment_tree.hpp>
|
||||||
|
|
||||||
|
|
||||||
ScMarkData::ScMarkData() :
|
ScMarkData::ScMarkData(SCROW nMaxRow, SCCOL nMaxCol) :
|
||||||
maTabMarked(),
|
maTabMarked(),
|
||||||
aMultiSel()
|
aMultiSel(nMaxRow, nMaxCol),
|
||||||
|
mnMaxRow(nMaxRow),
|
||||||
|
mnMaxCol(nMaxCol)
|
||||||
{
|
{
|
||||||
ResetMark();
|
ResetMark();
|
||||||
}
|
}
|
||||||
@ -47,7 +49,9 @@ ScMarkData::ScMarkData(const ScMarkData& rData) :
|
|||||||
aTopEnvelope( rData.aTopEnvelope ),
|
aTopEnvelope( rData.aTopEnvelope ),
|
||||||
aBottomEnvelope( rData.aBottomEnvelope ),
|
aBottomEnvelope( rData.aBottomEnvelope ),
|
||||||
aLeftEnvelope( rData.aLeftEnvelope ),
|
aLeftEnvelope( rData.aLeftEnvelope ),
|
||||||
aRightEnvelope( rData.aRightEnvelope )
|
aRightEnvelope( rData.aRightEnvelope ),
|
||||||
|
mnMaxRow( rData.mnMaxRow ),
|
||||||
|
mnMaxCol( rData.mnMaxCol )
|
||||||
{
|
{
|
||||||
bMarked = rData.bMarked;
|
bMarked = rData.bMarked;
|
||||||
bMultiMarked = rData.bMultiMarked;
|
bMultiMarked = rData.bMultiMarked;
|
||||||
@ -73,6 +77,8 @@ ScMarkData& ScMarkData::operator=(const ScMarkData& rData)
|
|||||||
|
|
||||||
maTabMarked = rData.maTabMarked;
|
maTabMarked = rData.maTabMarked;
|
||||||
aMultiSel = rData.aMultiSel;
|
aMultiSel = rData.aMultiSel;
|
||||||
|
mnMaxRow = rData.mnMaxRow;
|
||||||
|
mnMaxCol = rData.mnMaxCol;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
@ -305,10 +311,10 @@ bool ScMarkData::IsColumnMarked( SCCOL nCol ) const
|
|||||||
|
|
||||||
if ( bMarked && !bMarkIsNeg &&
|
if ( bMarked && !bMarkIsNeg &&
|
||||||
aMarkRange.aStart.Col() <= nCol && aMarkRange.aEnd.Col() >= nCol &&
|
aMarkRange.aStart.Col() <= nCol && aMarkRange.aEnd.Col() >= nCol &&
|
||||||
aMarkRange.aStart.Row() == 0 && aMarkRange.aEnd.Row() == MAXROW )
|
aMarkRange.aStart.Row() == 0 && aMarkRange.aEnd.Row() == mnMaxRow )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if ( bMultiMarked && aMultiSel.IsAllMarked( nCol, 0, MAXROW ) )
|
if ( bMultiMarked && aMultiSel.IsAllMarked( nCol, 0, mnMaxRow ) )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -320,7 +326,7 @@ bool ScMarkData::IsRowMarked( SCROW nRow ) const
|
|||||||
//TODO: GetMarkRowRanges for completely marked rows
|
//TODO: GetMarkRowRanges for completely marked rows
|
||||||
|
|
||||||
if ( bMarked && !bMarkIsNeg &&
|
if ( bMarked && !bMarkIsNeg &&
|
||||||
aMarkRange.aStart.Col() == 0 && aMarkRange.aEnd.Col() == MAXCOL &&
|
aMarkRange.aStart.Col() == 0 && aMarkRange.aEnd.Col() == mnMaxCol &&
|
||||||
aMarkRange.aStart.Row() <= nRow && aMarkRange.aEnd.Row() >= nRow )
|
aMarkRange.aStart.Row() <= nRow && aMarkRange.aEnd.Row() >= nRow )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@ -359,7 +365,10 @@ void ScMarkData::MarkFromRangeList( const ScRangeList& rList, bool bReset )
|
|||||||
/**
|
/**
|
||||||
Optimise the case of constructing from a range list, speeds up import.
|
Optimise the case of constructing from a range list, speeds up import.
|
||||||
*/
|
*/
|
||||||
ScMarkData::ScMarkData(const ScRangeList& rList)
|
ScMarkData::ScMarkData(SCROW nMaxRow, SCCOL nMaxCol, const ScRangeList& rList)
|
||||||
|
: aMultiSel(nMaxRow, nMaxCol),
|
||||||
|
mnMaxRow(nMaxRow),
|
||||||
|
mnMaxCol(nMaxCol)
|
||||||
{
|
{
|
||||||
ResetMark();
|
ResetMark();
|
||||||
|
|
||||||
@ -470,7 +479,7 @@ std::vector<sc::ColRowSpan> ScMarkData::GetMarkedRowSpans() const
|
|||||||
typedef mdds::flat_segment_tree<SCCOLROW, bool> SpansType;
|
typedef mdds::flat_segment_tree<SCCOLROW, bool> SpansType;
|
||||||
|
|
||||||
ScRangeList aRanges = GetMarkedRanges();
|
ScRangeList aRanges = GetMarkedRanges();
|
||||||
SpansType aSpans(0, MAXROW+1, false);
|
SpansType aSpans(0, mnMaxRow+1, false);
|
||||||
SpansType::const_iterator itPos = aSpans.begin();
|
SpansType::const_iterator itPos = aSpans.begin();
|
||||||
|
|
||||||
for (size_t i = 0, n = aRanges.size(); i < n; ++i)
|
for (size_t i = 0, n = aRanges.size(); i < n; ++i)
|
||||||
@ -493,7 +502,7 @@ std::vector<sc::ColRowSpan> ScMarkData::GetMarkedColSpans() const
|
|||||||
{
|
{
|
||||||
// Use segment tree to merge marked with multi marked.
|
// Use segment tree to merge marked with multi marked.
|
||||||
typedef mdds::flat_segment_tree<SCCOLROW, bool> SpansType;
|
typedef mdds::flat_segment_tree<SCCOLROW, bool> SpansType;
|
||||||
SpansType aSpans(0, MAXCOL+1, false);
|
SpansType aSpans(0, mnMaxCol+1, false);
|
||||||
SpansType::const_iterator itPos = aSpans.begin();
|
SpansType::const_iterator itPos = aSpans.begin();
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -577,7 +586,7 @@ bool ScMarkData::IsAllMarked( const ScRange& rRange ) const
|
|||||||
SCROW nEndRow = rRange.aEnd.Row();
|
SCROW nEndRow = rRange.aEnd.Row();
|
||||||
bool bOk = true;
|
bool bOk = true;
|
||||||
|
|
||||||
if ( nStartCol == 0 && nEndCol == MAXCOL )
|
if ( nStartCol == 0 && nEndCol == mnMaxCol )
|
||||||
return aMultiSel.IsRowRangeMarked( nStartRow, nEndRow );
|
return aMultiSel.IsRowRangeMarked( nStartRow, nEndRow );
|
||||||
|
|
||||||
for (SCCOL nCol=nStartCol; nCol<=nEndCol && bOk; nCol++)
|
for (SCCOL nCol=nStartCol; nCol<=nEndCol && bOk; nCol++)
|
||||||
@ -690,13 +699,13 @@ void ScMarkData::GetSelectionCover( ScRange& rRange )
|
|||||||
SCCOL nStartCol = aMultiRange.aStart.Col(), nEndCol = aMultiRange.aEnd.Col();
|
SCCOL nStartCol = aMultiRange.aStart.Col(), nEndCol = aMultiRange.aEnd.Col();
|
||||||
PutInOrder( nStartCol, nEndCol );
|
PutInOrder( nStartCol, nEndCol );
|
||||||
nStartCol = ( nStartCol == 0 ) ? nStartCol : nStartCol - 1;
|
nStartCol = ( nStartCol == 0 ) ? nStartCol : nStartCol - 1;
|
||||||
nEndCol = ( nEndCol == MAXCOL ) ? nEndCol : nEndCol + 1;
|
nEndCol = ( nEndCol == mnMaxCol ) ? nEndCol : nEndCol + 1;
|
||||||
std::unique_ptr<ScFlatBoolRowSegments> pPrevColMarkedRows;
|
std::unique_ptr<ScFlatBoolRowSegments> pPrevColMarkedRows;
|
||||||
std::unique_ptr<ScFlatBoolRowSegments> pCurColMarkedRows;
|
std::unique_ptr<ScFlatBoolRowSegments> pCurColMarkedRows;
|
||||||
std::unordered_map<SCROW,ScFlatBoolColSegments> aRowToColSegmentsInTopEnvelope;
|
std::unordered_map<SCROW,ScFlatBoolColSegments> aRowToColSegmentsInTopEnvelope;
|
||||||
std::unordered_map<SCROW,ScFlatBoolColSegments> aRowToColSegmentsInBottomEnvelope;
|
std::unordered_map<SCROW,ScFlatBoolColSegments> aRowToColSegmentsInBottomEnvelope;
|
||||||
ScFlatBoolRowSegments aNoRowsMarked;
|
ScFlatBoolRowSegments aNoRowsMarked;
|
||||||
aNoRowsMarked.setFalse( 0, MAXROW );
|
aNoRowsMarked.setFalse( 0, mnMaxRow );
|
||||||
|
|
||||||
bool bPrevColUnMarked = false;
|
bool bPrevColUnMarked = false;
|
||||||
|
|
||||||
@ -707,7 +716,7 @@ void ScMarkData::GetSelectionCover( ScRange& rRange )
|
|||||||
if ( !bCurColUnMarked )
|
if ( !bCurColUnMarked )
|
||||||
{
|
{
|
||||||
pCurColMarkedRows.reset( new ScFlatBoolRowSegments() );
|
pCurColMarkedRows.reset( new ScFlatBoolRowSegments() );
|
||||||
pCurColMarkedRows->setFalse( 0, MAXROW );
|
pCurColMarkedRows->setFalse( 0, mnMaxRow );
|
||||||
ScMultiSelIter aMultiIter( aMultiSel, nCol );
|
ScMultiSelIter aMultiIter( aMultiSel, nCol );
|
||||||
ScFlatBoolRowSegments::ForwardIterator aPrevItr(
|
ScFlatBoolRowSegments::ForwardIterator aPrevItr(
|
||||||
pPrevColMarkedRows ? *pPrevColMarkedRows
|
pPrevColMarkedRows ? *pPrevColMarkedRows
|
||||||
@ -796,7 +805,7 @@ void ScMarkData::GetSelectionCover( ScRange& rRange )
|
|||||||
lcl_AddRanges( rRange, aAddRange ); // Top envelope
|
lcl_AddRanges( rRange, aAddRange ); // Top envelope
|
||||||
aRowToColSegmentsInTopEnvelope[nTop - 1].setTrue( nCol, nCol );
|
aRowToColSegmentsInTopEnvelope[nTop - 1].setTrue( nCol, nCol );
|
||||||
}
|
}
|
||||||
if( nBottom < MAXROW )
|
if( nBottom < mnMaxRow )
|
||||||
{
|
{
|
||||||
ScRange aAddRange(nCol, nBottom + 1, aMultiRange.aStart.Tab(),
|
ScRange aAddRange(nCol, nBottom + 1, aMultiRange.aStart.Tab(),
|
||||||
nCol, nBottom + 1, aMultiRange.aStart.Tab());
|
nCol, nBottom + 1, aMultiRange.aStart.Tab());
|
||||||
@ -805,7 +814,7 @@ void ScMarkData::GetSelectionCover( ScRange& rRange )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while( nTopPrev <= MAXROW && nBottomPrev <= MAXROW && ( nCol > nStartCol ) )
|
while( nTopPrev <= mnMaxRow && nBottomPrev <= mnMaxRow && ( nCol > nStartCol ) )
|
||||||
{
|
{
|
||||||
bool bRangeMarked;
|
bool bRangeMarked;
|
||||||
const bool bHasValue = aPrevItr1.getValue( nTopPrev, bRangeMarked );
|
const bool bHasValue = aPrevItr1.getValue( nTopPrev, bRangeMarked );
|
||||||
@ -833,7 +842,7 @@ void ScMarkData::GetSelectionCover( ScRange& rRange )
|
|||||||
bool bRangeMarked = false;
|
bool bRangeMarked = false;
|
||||||
ScFlatBoolRowSegments::ForwardIterator aPrevItr(
|
ScFlatBoolRowSegments::ForwardIterator aPrevItr(
|
||||||
pPrevColMarkedRows ? *pPrevColMarkedRows : aNoRowsMarked);
|
pPrevColMarkedRows ? *pPrevColMarkedRows : aNoRowsMarked);
|
||||||
while( nTopPrev <= MAXROW && nBottomPrev <= MAXROW )
|
while( nTopPrev <= mnMaxRow && nBottomPrev <= mnMaxRow )
|
||||||
{
|
{
|
||||||
const bool bHasValue = aPrevItr.getValue(nTopPrev, bRangeMarked);
|
const bool bHasValue = aPrevItr.getValue(nTopPrev, bRangeMarked);
|
||||||
assert(bHasValue); (void)bHasValue;
|
assert(bHasValue); (void)bHasValue;
|
||||||
@ -909,12 +918,12 @@ void ScMarkData::GetSelectionCover( ScRange& rRange )
|
|||||||
aTopEnvelope.push_back( ScRange( nCol1, nRow1 - 1, nTab1, nCol2, nRow1 - 1, nTab2 ) );
|
aTopEnvelope.push_back( ScRange( nCol1, nRow1 - 1, nTab1, nCol2, nRow1 - 1, nTab2 ) );
|
||||||
--nRow1New;
|
--nRow1New;
|
||||||
}
|
}
|
||||||
if( nCol2 < MAXCOL )
|
if( nCol2 < mnMaxCol )
|
||||||
{
|
{
|
||||||
aRightEnvelope.push_back( ScRange( nCol2 + 1, nRow1, nTab1, nCol2 + 1, nRow2, nTab2 ) );
|
aRightEnvelope.push_back( ScRange( nCol2 + 1, nRow1, nTab1, nCol2 + 1, nRow2, nTab2 ) );
|
||||||
++nCol2New;
|
++nCol2New;
|
||||||
}
|
}
|
||||||
if( nRow2 < MAXROW )
|
if( nRow2 < mnMaxRow )
|
||||||
{
|
{
|
||||||
aBottomEnvelope.push_back( ScRange( nCol1, nRow2 + 1, nTab1, nCol2, nRow2 + 1, nTab2 ) );
|
aBottomEnvelope.push_back( ScRange( nCol1, nRow2 + 1, nTab1, nCol2, nRow2 + 1, nTab2 ) );
|
||||||
++nRow2New;
|
++nRow2New;
|
||||||
|
@ -26,14 +26,19 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
ScMultiSel::ScMultiSel()
|
ScMultiSel::ScMultiSel(SCROW nMaxRow, SCCOL nMaxCol)
|
||||||
|
: aRowSel(nMaxRow),
|
||||||
|
mnMaxRow(nMaxRow),
|
||||||
|
mnMaxCol(nMaxCol)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMultiSel::ScMultiSel( const ScMultiSel& rOther )
|
ScMultiSel::ScMultiSel( const ScMultiSel& rOther )
|
||||||
|
: aRowSel(rOther.aRowSel)
|
||||||
{
|
{
|
||||||
aRowSel = rOther.aRowSel;
|
|
||||||
aMultiSelContainer = rOther.aMultiSelContainer;
|
aMultiSelContainer = rOther.aMultiSelContainer;
|
||||||
|
mnMaxRow = rOther.mnMaxRow;
|
||||||
|
mnMaxCol = rOther.mnMaxCol;
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMultiSel::~ScMultiSel()
|
ScMultiSel::~ScMultiSel()
|
||||||
@ -44,6 +49,8 @@ ScMultiSel& ScMultiSel::operator=(const ScMultiSel& rOther)
|
|||||||
{
|
{
|
||||||
aRowSel = rOther.aRowSel;
|
aRowSel = rOther.aRowSel;
|
||||||
aMultiSelContainer = rOther.aMultiSelContainer;
|
aMultiSelContainer = rOther.aMultiSelContainer;
|
||||||
|
mnMaxRow = rOther.mnMaxRow;
|
||||||
|
mnMaxCol = rOther.mnMaxCol;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +182,7 @@ SCROW ScMultiSel::GetNextMarked( SCCOL nCol, SCROW nRow, bool bUp ) const
|
|||||||
|
|
||||||
void ScMultiSel::MarkAllCols( SCROW nStartRow, SCROW nEndRow )
|
void ScMultiSel::MarkAllCols( SCROW nStartRow, SCROW nEndRow )
|
||||||
{
|
{
|
||||||
aMultiSelContainer.resize(MAXCOL+1);
|
aMultiSelContainer.resize(MAXCOL+1, ScMarkArray(mnMaxRow));
|
||||||
for ( SCCOL nCol = MAXCOL; nCol >= 0; --nCol )
|
for ( SCCOL nCol = MAXCOL; nCol >= 0; --nCol )
|
||||||
{
|
{
|
||||||
aMultiSelContainer[nCol].SetMarkArea( nStartRow, nEndRow, true );
|
aMultiSelContainer[nCol].SetMarkArea( nStartRow, nEndRow, true );
|
||||||
@ -233,7 +240,7 @@ void ScMultiSel::SetMarkArea( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, S
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (nEndCol >= static_cast<SCCOL>(aMultiSelContainer.size()))
|
if (nEndCol >= static_cast<SCCOL>(aMultiSelContainer.size()))
|
||||||
aMultiSelContainer.resize(nEndCol+1);
|
aMultiSelContainer.resize(nEndCol+1, ScMarkArray(mnMaxRow));
|
||||||
for ( SCCOL nColIter = nEndCol; nColIter >= nStartCol; --nColIter )
|
for ( SCCOL nColIter = nEndCol; nColIter >= nStartCol; --nColIter )
|
||||||
aMultiSelContainer[nColIter].SetMarkArea( nStartRow, nEndRow, bMark );
|
aMultiSelContainer[nColIter].SetMarkArea( nStartRow, nEndRow, bMark );
|
||||||
}
|
}
|
||||||
@ -295,7 +302,7 @@ void ScMultiSel::Set( ScRangeList const & rList )
|
|||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
aMultiSelContainer.resize(nMaxCol+1);
|
aMultiSelContainer.resize(nMaxCol+1, ScMarkArray(mnMaxRow));
|
||||||
for (SCCOL nCol = 0; nCol<=nMaxCol; ++nCol)
|
for (SCCOL nCol = 0; nCol<=nMaxCol; ++nCol)
|
||||||
if (!aMarkEntriesPerCol[nCol].empty())
|
if (!aMarkEntriesPerCol[nCol].empty())
|
||||||
{
|
{
|
||||||
@ -320,7 +327,7 @@ bool ScMultiSel::IsRowRangeMarked( SCROW nStartRow, SCROW nEndRow ) const
|
|||||||
ScMarkArray ScMultiSel::GetMarkArray( SCCOL nCol ) const
|
ScMarkArray ScMultiSel::GetMarkArray( SCCOL nCol ) const
|
||||||
{
|
{
|
||||||
ScMultiSelIter aMultiIter( *this, nCol );
|
ScMultiSelIter aMultiIter( *this, nCol );
|
||||||
ScMarkArray aMarkArray;
|
ScMarkArray aMarkArray(mnMaxRow);
|
||||||
SCROW nTop, nBottom;
|
SCROW nTop, nBottom;
|
||||||
while( aMultiIter.Next( nTop, nBottom ) )
|
while( aMultiIter.Next( nTop, nBottom ) )
|
||||||
aMarkArray.SetMarkArea( nTop, nBottom, true );
|
aMarkArray.SetMarkArea( nTop, nBottom, true );
|
||||||
@ -366,7 +373,7 @@ void ScMultiSel::ShiftCols(SCCOL nStartCol, long nColOffset)
|
|||||||
nDestCol = MAXCOL;
|
nDestCol = MAXCOL;
|
||||||
}
|
}
|
||||||
if (nDestCol >= static_cast<SCCOL>(aMultiSelContainer.size()))
|
if (nDestCol >= static_cast<SCCOL>(aMultiSelContainer.size()))
|
||||||
aMultiSelContainer.resize(nDestCol);
|
aMultiSelContainer.resize(nDestCol, ScMarkArray(mnMaxRow));
|
||||||
aMultiSelContainer[nDestCol] = aSourceArray;
|
aMultiSelContainer[nDestCol] = aSourceArray;
|
||||||
++nCol;
|
++nCol;
|
||||||
}
|
}
|
||||||
@ -382,7 +389,7 @@ void ScMultiSel::ShiftCols(SCCOL nStartCol, long nColOffset)
|
|||||||
rNewCol = rStartPos;
|
rNewCol = rStartPos;
|
||||||
rNewCol.Intersect(rPrevPos);
|
rNewCol.Intersect(rPrevPos);
|
||||||
if (nStartCol + nColOffset >= static_cast<SCCOL>(aNewMultiSel.aMultiSelContainer.size()))
|
if (nStartCol + nColOffset >= static_cast<SCCOL>(aNewMultiSel.aMultiSelContainer.size()))
|
||||||
aNewMultiSel.aMultiSelContainer.resize(nStartCol + nColOffset);
|
aNewMultiSel.aMultiSelContainer.resize(nStartCol + nColOffset, ScMarkArray(mnMaxRow));
|
||||||
for (long i = 1; i < nColOffset; ++i)
|
for (long i = 1; i < nColOffset; ++i)
|
||||||
aMultiSelContainer[nStartCol + i] = rNewCol;
|
aMultiSelContainer[nStartCol + i] = rNewCol;
|
||||||
}
|
}
|
||||||
@ -418,7 +425,7 @@ ScMultiSelIter::ScMultiSelIter( const ScMultiSel& rMultiSel, SCCOL nCol ) :
|
|||||||
if (bHasMarks1 && bHasMarks2)
|
if (bHasMarks1 && bHasMarks2)
|
||||||
{
|
{
|
||||||
pRowSegs.reset( new ScFlatBoolRowSegments);
|
pRowSegs.reset( new ScFlatBoolRowSegments);
|
||||||
pRowSegs->setFalse( 0, MAXROW );
|
pRowSegs->setFalse( 0, rMultiSel.mnMaxRow );
|
||||||
{
|
{
|
||||||
ScMarkArrayIter aMarkIter( &rMultiSel.aRowSel );
|
ScMarkArrayIter aMarkIter( &rMultiSel.aRowSel );
|
||||||
SCROW nTop, nBottom;
|
SCROW nTop, nBottom;
|
||||||
|
@ -1429,7 +1429,7 @@ const ScRangeList* ScTable::GetScenarioRanges() const
|
|||||||
if (!pScenarioRanges)
|
if (!pScenarioRanges)
|
||||||
{
|
{
|
||||||
const_cast<ScTable*>(this)->pScenarioRanges.reset(new ScRangeList);
|
const_cast<ScTable*>(this)->pScenarioRanges.reset(new ScRangeList);
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(pDocument->MaxRow(), pDocument->MaxCol());
|
||||||
MarkScenarioIn( aMark, ScScenarioFlags::NONE ); // always
|
MarkScenarioIn( aMark, ScScenarioFlags::NONE ); // always
|
||||||
aMark.FillRangeListWithMarks( pScenarioRanges.get(), false );
|
aMark.FillRangeListWithMarks( pScenarioRanges.get(), false );
|
||||||
}
|
}
|
||||||
|
@ -1835,7 +1835,7 @@ void ScChangeActionContent::PutValueToDoc(
|
|||||||
aRange.aEnd.IncCol( nC-1 );
|
aRange.aEnd.IncCol( nC-1 );
|
||||||
if ( nR > 1 )
|
if ( nR > 1 )
|
||||||
aRange.aEnd.IncRow( nR-1 );
|
aRange.aEnd.IncRow( nR-1 );
|
||||||
ScMarkData aDestMark;
|
ScMarkData aDestMark(pDoc->MaxRow(), pDoc->MaxCol());
|
||||||
aDestMark.SelectOneTable( aPos.Tab() );
|
aDestMark.SelectOneTable( aPos.Tab() );
|
||||||
aDestMark.SetMarkArea( aRange );
|
aDestMark.SetMarkArea( aRange );
|
||||||
pDoc->InsertMatrixFormula( aPos.Col(), aPos.Row(),
|
pDoc->InsertMatrixFormula( aPos.Col(), aPos.Row(),
|
||||||
|
@ -1276,6 +1276,7 @@ XclExpXct::XclExpXct( const XclExpRoot& rRoot, const OUString& rTabName,
|
|||||||
sal_uInt16 nSBTab, ScExternalRefCache::TableTypeRef const & xCacheTable ) :
|
sal_uInt16 nSBTab, ScExternalRefCache::TableTypeRef const & xCacheTable ) :
|
||||||
XclExpRoot( rRoot ),
|
XclExpRoot( rRoot ),
|
||||||
mxCacheTable( xCacheTable ),
|
mxCacheTable( xCacheTable ),
|
||||||
|
maUsedCells( MAXROW, MAXCOL ),
|
||||||
maBoundRange( ScAddress::INITIALIZE_INVALID ),
|
maBoundRange( ScAddress::INITIALIZE_INVALID ),
|
||||||
maTabName( rTabName ),
|
maTabName( rTabName ),
|
||||||
mnSBTab( nSBTab )
|
mnSBTab( nSBTab )
|
||||||
|
@ -564,7 +564,7 @@ bool ScAccessibleCell::IsDropdown() const
|
|||||||
if ( nTab+1<nTabCount && mpDoc->IsScenario(nTab+1) && !mpDoc->IsScenario(nTab) )
|
if ( nTab+1<nTabCount && mpDoc->IsScenario(nTab+1) && !mpDoc->IsScenario(nTab) )
|
||||||
{
|
{
|
||||||
SCTAB i;
|
SCTAB i;
|
||||||
ScMarkData aMarks;
|
ScMarkData aMarks(mpDoc->MaxRow(), mpDoc->MaxCol());
|
||||||
for (i=nTab+1; i<nTabCount && mpDoc->IsScenario(i); i++)
|
for (i=nTab+1; i<nTabCount && mpDoc->IsScenario(i); i++)
|
||||||
mpDoc->MarkScenario( i, nTab, aMarks, false, ScScenarioFlags::ShowFrame );
|
mpDoc->MarkScenario( i, nTab, aMarks, false, ScScenarioFlags::ShowFrame );
|
||||||
ScRangeList aRanges;
|
ScRangeList aRanges;
|
||||||
|
@ -646,7 +646,7 @@ ScDocShell* ScTransferObj::GetSourceDocShell()
|
|||||||
|
|
||||||
ScMarkData ScTransferObj::GetSourceMarkData() const
|
ScMarkData ScTransferObj::GetSourceMarkData() const
|
||||||
{
|
{
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(m_pDoc->MaxRow(), m_pDoc->MaxCol());
|
||||||
ScCellRangesBase* pRangesObj = comphelper::getUnoTunnelImplementation<ScCellRangesBase>( m_xDragSourceRanges );
|
ScCellRangesBase* pRangesObj = comphelper::getUnoTunnelImplementation<ScCellRangesBase>( m_xDragSourceRanges );
|
||||||
if (pRangesObj)
|
if (pRangesObj)
|
||||||
{
|
{
|
||||||
@ -671,7 +671,7 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
|
|||||||
pDocSh->DoInitNew();
|
pDocSh->DoInitNew();
|
||||||
|
|
||||||
ScDocument& rDestDoc = pDocSh->GetDocument();
|
ScDocument& rDestDoc = pDocSh->GetDocument();
|
||||||
ScMarkData aDestMark;
|
ScMarkData aDestMark(rDestDoc.MaxRow(), rDestDoc.MaxCol());
|
||||||
aDestMark.SelectTable( 0, true );
|
aDestMark.SelectTable( 0, true );
|
||||||
|
|
||||||
rDestDoc.SetDocOptions( m_pDoc->GetDocOptions() ); // #i42666#
|
rDestDoc.SetDocOptions( m_pDoc->GetDocOptions() ); // #i42666#
|
||||||
|
@ -237,7 +237,7 @@ void ScDBDataManager::WriteToDoc(ScDocument& rDoc)
|
|||||||
SCROW nRowSize = std::min<SCROW>(aDestRange.aEnd.Row() - aDestRange.aStart.Row(), nEndRow);
|
SCROW nRowSize = std::min<SCROW>(aDestRange.aEnd.Row() - aDestRange.aStart.Row(), nEndRow);
|
||||||
aDestRange.aEnd.SetRow(aDestRange.aStart.Row() + nRowSize);
|
aDestRange.aEnd.SetRow(aDestRange.aStart.Row() + nRowSize);
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(mpDoc->MaxRow(), mpDoc->MaxCol());
|
||||||
aMark.SelectTable(0, true);
|
aMark.SelectTable(0, true);
|
||||||
mpDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::CONTENTS, nullptr, &rDoc);
|
mpDoc->CopyFromClip(aDestRange, aMark, InsertDeleteFlags::CONTENTS, nullptr, &rDoc);
|
||||||
ScDocShell* pDocShell = static_cast<ScDocShell*>(mpDoc->GetDocumentShell());
|
ScDocShell* pDocShell = static_cast<ScDocShell*>(mpDoc->GetDocumentShell());
|
||||||
|
@ -374,7 +374,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
|
|||||||
{
|
{
|
||||||
ScRange const & rTokenRange( aSourceRanges[nRange]);
|
ScRange const & rTokenRange( aSourceRanges[nRange]);
|
||||||
SCTAB nSrcTab = rTokenRange.aStart.Tab();
|
SCTAB nSrcTab = rTokenRange.aStart.Tab();
|
||||||
ScMarkData aSourceMark;
|
ScMarkData aSourceMark(rSrcDoc.MaxRow(), rSrcDoc.MaxCol());
|
||||||
aSourceMark.SelectOneTable( nSrcTab ); // selecting for CopyToClip
|
aSourceMark.SelectOneTable( nSrcTab ); // selecting for CopyToClip
|
||||||
aSourceMark.SetMarkArea( rTokenRange );
|
aSourceMark.SetMarkArea( rTokenRange );
|
||||||
|
|
||||||
@ -394,7 +394,7 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const OUString& rNewFilter,
|
|||||||
|
|
||||||
aNewTokenRange.aEnd.SetCol( aNewTokenRange.aStart.Col() + (rTokenRange.aEnd.Col() - rTokenRange.aStart.Col()) );
|
aNewTokenRange.aEnd.SetCol( aNewTokenRange.aStart.Col() + (rTokenRange.aEnd.Col() - rTokenRange.aStart.Col()) );
|
||||||
aNewTokenRange.aEnd.SetRow( aNewTokenRange.aStart.Row() + (rTokenRange.aEnd.Row() - rTokenRange.aStart.Row()) );
|
aNewTokenRange.aEnd.SetRow( aNewTokenRange.aStart.Row() + (rTokenRange.aEnd.Row() - rTokenRange.aStart.Row()) );
|
||||||
ScMarkData aDestMark;
|
ScMarkData aDestMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aDestMark.SelectOneTable( nDestTab );
|
aDestMark.SelectOneTable( nDestTab );
|
||||||
aDestMark.SetMarkArea( aNewTokenRange );
|
aDestMark.SetMarkArea( aNewTokenRange );
|
||||||
rDoc.CopyFromClip( aNewTokenRange, aDestMark, InsertDeleteFlags::ALL, nullptr, &aClipDoc, false );
|
rDoc.CopyFromClip( aNewTokenRange, aDestMark, InsertDeleteFlags::ALL, nullptr, &aClipDoc, false );
|
||||||
|
@ -837,7 +837,7 @@ bool ScDBDocFunc::Query( SCTAB nTab, const ScQueryParam& rQueryParam,
|
|||||||
aOldForm.aEnd.SetRow( aOldDest.aEnd.Row() );
|
aOldForm.aEnd.SetRow( aOldDest.aEnd.Row() );
|
||||||
rDoc.FitBlock( aOldForm, aNewForm, false );
|
rDoc.FitBlock( aOldForm, aNewForm, false );
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMark.SelectOneTable(nDestTab);
|
aMark.SelectOneTable(nDestTab);
|
||||||
SCROW nFStartY = aLocalParam.nRow1 + ( aLocalParam.bHasHeader ? 1 : 0 );
|
SCROW nFStartY = aLocalParam.nRow1 + ( aLocalParam.bHasHeader ? 1 : 0 );
|
||||||
|
|
||||||
|
@ -471,7 +471,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
|
|||||||
pUndoDBData.reset(new ScDBData( *pDBData ));
|
pUndoDBData.reset(new ScDBData( *pDBData ));
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMarkData aNewMark;
|
ScMarkData aNewMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aNewMark.SelectOneTable( nTab );
|
aNewMark.SelectOneTable( nTab );
|
||||||
|
|
||||||
if (bRecord)
|
if (bRecord)
|
||||||
@ -535,7 +535,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam,
|
|||||||
nEndCol+nFormulaCols, nEndRow, nTab,
|
nEndCol+nFormulaCols, nEndRow, nTab,
|
||||||
InsertDeleteFlags::ATTRIB, false, rDoc);
|
InsertDeleteFlags::ATTRIB, false, rDoc);
|
||||||
// fill formulas
|
// fill formulas
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMark.SelectOneTable(nTab);
|
aMark.SelectOneTable(nTab);
|
||||||
|
|
||||||
sal_uLong nProgCount = nFormulaCols;
|
sal_uLong nProgCount = nFormulaCols;
|
||||||
|
@ -1184,7 +1184,7 @@ void ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
|
|||||||
aPattern.GetItemSet().ClearItem( ATTR_HOR_JUSTIFY ); // wasn't removed above if no edit object
|
aPattern.GetItemSet().ClearItem( ATTR_HOR_JUSTIFY ); // wasn't removed above if no edit object
|
||||||
if ( aPattern.GetItemSet().Count() > 0 )
|
if ( aPattern.GetItemSet().Count() > 0 )
|
||||||
{
|
{
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMark.SelectTable( rPos.Tab(), true );
|
aMark.SelectTable( rPos.Tab(), true );
|
||||||
aMark.SetMarkArea( ScRange( rPos ) );
|
aMark.SetMarkArea( ScRange( rPos ) );
|
||||||
ApplyAttributes( aMark, aPattern, bApi );
|
ApplyAttributes( aMark, aPattern, bApi );
|
||||||
@ -1740,7 +1740,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
|
|||||||
if (bRecord && !rDoc.IsUndoEnabled())
|
if (bRecord && !rDoc.IsUndoEnabled())
|
||||||
bRecord = false;
|
bRecord = false;
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
if (pTabMark)
|
if (pTabMark)
|
||||||
aMark = *pTabMark;
|
aMark = *pTabMark;
|
||||||
else
|
else
|
||||||
@ -2245,7 +2245,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
|
|||||||
if (!rDoc.IsUndoEnabled())
|
if (!rDoc.IsUndoEnabled())
|
||||||
bRecord = false;
|
bRecord = false;
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
if (pTabMark)
|
if (pTabMark)
|
||||||
aMark = *pTabMark;
|
aMark = *pTabMark;
|
||||||
else
|
else
|
||||||
@ -2827,7 +2827,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
|
|||||||
|
|
||||||
ScDocumentUniquePtr pClipDoc(new ScDocument(SCDOCMODE_CLIP));
|
ScDocumentUniquePtr pClipDoc(new ScDocument(SCDOCMODE_CLIP));
|
||||||
|
|
||||||
ScMarkData aSourceMark;
|
ScMarkData aSourceMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
for (nTab=nStartTab; nTab<=nEndTab; nTab++)
|
for (nTab=nStartTab; nTab<=nEndTab; nTab++)
|
||||||
aSourceMark.SelectTable( nTab, true ); // select source
|
aSourceMark.SelectTable( nTab, true ); // select source
|
||||||
aSourceMark.SetMarkArea( rSource );
|
aSourceMark.SetMarkArea( rSource );
|
||||||
@ -2948,7 +2948,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
|
|||||||
bool bSourceHeight = false; // adjust heights?
|
bool bSourceHeight = false; // adjust heights?
|
||||||
if (bCut)
|
if (bCut)
|
||||||
{
|
{
|
||||||
ScMarkData aDelMark; // only for tables
|
ScMarkData aDelMark(rDoc.MaxRow(), rDoc.MaxCol()); // only for tables
|
||||||
for (nTab=nStartTab; nTab<=nEndTab; nTab++)
|
for (nTab=nStartTab; nTab<=nEndTab; nTab++)
|
||||||
{
|
{
|
||||||
rDoc.DeleteAreaTab( nStartCol,nStartRow, nOldEndCol,nOldEndRow, nTab, InsertDeleteFlags::ALL );
|
rDoc.DeleteAreaTab( nStartCol,nStartRow, nOldEndCol,nOldEndRow, nTab, InsertDeleteFlags::ALL );
|
||||||
@ -2983,7 +2983,7 @@ bool ScDocFunc::MoveBlock( const ScRange& rSource, const ScAddress& rDestPos,
|
|||||||
|
|
||||||
ScRange aPasteDest( nDestCol, nDestRow, nDestTab, nDestEndCol, nDestEndRow, nDestEndTab );
|
ScRange aPasteDest( nDestCol, nDestRow, nDestTab, nDestEndCol, nDestEndRow, nDestEndTab );
|
||||||
|
|
||||||
ScMarkData aDestMark;
|
ScMarkData aDestMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
for (nTab=nDestTab; nTab<=nDestEndTab; nTab++)
|
for (nTab=nDestTab; nTab<=nDestEndTab; nTab++)
|
||||||
aDestMark.SelectTable( nTab, true ); // select destination
|
aDestMark.SelectTable( nTab, true ); // select destination
|
||||||
aDestMark.SetMarkArea( aPasteDest );
|
aDestMark.SetMarkArea( aPasteDest );
|
||||||
@ -3733,7 +3733,7 @@ bool ScDocFunc::SetWidthOrHeight(
|
|||||||
|
|
||||||
if (bRecord)
|
if (bRecord)
|
||||||
{
|
{
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMark.SelectOneTable( nTab );
|
aMark.SelectOneTable( nTab );
|
||||||
rDocShell.GetUndoManager()->AddUndoAction(
|
rDocShell.GetUndoManager()->AddUndoAction(
|
||||||
std::make_unique<ScUndoWidthOrHeight>(
|
std::make_unique<ScUndoWidthOrHeight>(
|
||||||
@ -4169,7 +4169,7 @@ bool ScDocFunc::AutoFormat( const ScRange& rRange, const ScMarkData* pTabMark,
|
|||||||
bool bRecord = true;
|
bool bRecord = true;
|
||||||
if (!rDoc.IsUndoEnabled())
|
if (!rDoc.IsUndoEnabled())
|
||||||
bRecord = false;
|
bRecord = false;
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
if (pTabMark)
|
if (pTabMark)
|
||||||
aMark = *pTabMark;
|
aMark = *pTabMark;
|
||||||
else
|
else
|
||||||
@ -4283,7 +4283,7 @@ bool ScDocFunc::EnterMatrix( const ScRange& rRange, const ScMarkData* pTabMark,
|
|||||||
SCROW nEndRow = rRange.aEnd.Row();
|
SCROW nEndRow = rRange.aEnd.Row();
|
||||||
SCTAB nEndTab = rRange.aEnd.Tab();
|
SCTAB nEndTab = rRange.aEnd.Tab();
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
if (pTabMark)
|
if (pTabMark)
|
||||||
aMark = *pTabMark;
|
aMark = *pTabMark;
|
||||||
else
|
else
|
||||||
@ -4370,7 +4370,7 @@ bool ScDocFunc::TabOp( const ScRange& rRange, const ScMarkData* pTabMark,
|
|||||||
if (bRecord && !rDoc.IsUndoEnabled())
|
if (bRecord && !rDoc.IsUndoEnabled())
|
||||||
bRecord = false;
|
bRecord = false;
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
if (pTabMark)
|
if (pTabMark)
|
||||||
aMark = *pTabMark;
|
aMark = *pTabMark;
|
||||||
else
|
else
|
||||||
@ -4514,7 +4514,7 @@ bool ScDocFunc::FillSimple( const ScRange& rRange, const ScMarkData* pTabMark,
|
|||||||
if (!rDoc.IsUndoEnabled())
|
if (!rDoc.IsUndoEnabled())
|
||||||
bRecord = false;
|
bRecord = false;
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
if (pTabMark)
|
if (pTabMark)
|
||||||
aMark = *pTabMark;
|
aMark = *pTabMark;
|
||||||
else
|
else
|
||||||
@ -4627,7 +4627,7 @@ bool ScDocFunc::FillSeries( const ScRange& rRange, const ScMarkData* pTabMark,
|
|||||||
if (!rDoc.IsUndoEnabled())
|
if (!rDoc.IsUndoEnabled())
|
||||||
bRecord = false;
|
bRecord = false;
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
if (pTabMark)
|
if (pTabMark)
|
||||||
aMark = *pTabMark;
|
aMark = *pTabMark;
|
||||||
else
|
else
|
||||||
@ -4760,7 +4760,7 @@ bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
|
|||||||
if (bRecord && !rDoc.IsUndoEnabled())
|
if (bRecord && !rDoc.IsUndoEnabled())
|
||||||
bRecord = false;
|
bRecord = false;
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
if (pTabMark)
|
if (pTabMark)
|
||||||
aMark = *pTabMark;
|
aMark = *pTabMark;
|
||||||
else
|
else
|
||||||
@ -5439,7 +5439,7 @@ void ScDocFunc::ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd
|
|||||||
|
|
||||||
aFormula = aFormula.copy(1, aFormula.getLength()-2);
|
aFormula = aFormula.copy(1, aFormula.getLength()-2);
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMark.SetMarkArea( rOldRange );
|
aMark.SetMarkArea( rOldRange );
|
||||||
aMark.SelectTable( nTab, true );
|
aMark.SelectTable( nTab, true );
|
||||||
ScRange aNewRange( rOldRange.aStart, rNewEnd );
|
ScRange aNewRange( rOldRange.aStart, rNewEnd );
|
||||||
|
@ -1602,7 +1602,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
|
|||||||
m_aDocument.GetCellArea( nTab, nEndCol, nEndRow );
|
m_aDocument.GetCellArea( nTab, nEndCol, nEndRow );
|
||||||
aColWidthRange.aEnd.SetCol( nEndCol );
|
aColWidthRange.aEnd.SetCol( nEndCol );
|
||||||
aColWidthRange.aEnd.SetRow( nEndRow );
|
aColWidthRange.aEnd.SetRow( nEndRow );
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(m_aDocument.MaxRow(), m_aDocument.MaxCol());
|
||||||
aMark.SetMarkArea( aColWidthRange );
|
aMark.SetMarkArea( aColWidthRange );
|
||||||
aMark.MarkToMulti();
|
aMark.MarkToMulti();
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ void ScDocShell::UpdatePendingRowHeights( SCTAB nUpdateTab, bool bBefore )
|
|||||||
if ( nUpdateTab >= nTabCount )
|
if ( nUpdateTab >= nTabCount )
|
||||||
nUpdateTab = nTabCount-1; // nUpdateTab is inclusive
|
nUpdateTab = nTabCount-1; // nUpdateTab is inclusive
|
||||||
|
|
||||||
ScMarkData aUpdateSheets;
|
ScMarkData aUpdateSheets(m_aDocument.MaxRow(), m_aDocument.MaxCol());
|
||||||
SCTAB nTab;
|
SCTAB nTab;
|
||||||
for (nTab=0; nTab<=nUpdateTab; ++nTab)
|
for (nTab=0; nTab<=nUpdateTab; ++nTab)
|
||||||
if ( m_aDocument.IsPendingRowHeights( nTab ) )
|
if ( m_aDocument.IsPendingRowHeights( nTab ) )
|
||||||
@ -681,7 +681,7 @@ void ScDocShell::UseScenario( SCTAB nTab, const OUString& rName, bool bRecord )
|
|||||||
if ( m_aDocument.TestCopyScenario( nSrcTab, nTab ) ) // test cell protection
|
if ( m_aDocument.TestCopyScenario( nSrcTab, nTab ) ) // test cell protection
|
||||||
{
|
{
|
||||||
ScDocShellModificator aModificator( *this );
|
ScDocShellModificator aModificator( *this );
|
||||||
ScMarkData aScenMark;
|
ScMarkData aScenMark(m_aDocument.MaxRow(), m_aDocument.MaxCol());
|
||||||
m_aDocument.MarkScenario( nSrcTab, nTab, aScenMark );
|
m_aDocument.MarkScenario( nSrcTab, nTab, aScenMark );
|
||||||
ScRange aMultiRange;
|
ScRange aMultiRange;
|
||||||
aScenMark.GetMultiMarkArea( aMultiRange );
|
aScenMark.GetMultiMarkArea( aMultiRange );
|
||||||
|
@ -258,7 +258,7 @@ void ScImportExport::EndPaste(bool bAutoRowHeight)
|
|||||||
ScDocumentUniquePtr pRedoDoc(new ScDocument( SCDOCMODE_UNDO ));
|
ScDocumentUniquePtr pRedoDoc(new ScDocument( SCDOCMODE_UNDO ));
|
||||||
pRedoDoc->InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() );
|
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;
|
ScMarkData aDestMark(pRedoDoc->MaxRow(), pRedoDoc->MaxCol());
|
||||||
aDestMark.SetMarkArea(aRange);
|
aDestMark.SetMarkArea(aRange);
|
||||||
pDocSh->GetUndoManager()->AddUndoAction(
|
pDocSh->GetUndoManager()->AddUndoAction(
|
||||||
std::make_unique<ScUndoPaste>(pDocSh, aRange, aDestMark, std::move(pUndoDoc), std::move(pRedoDoc), InsertDeleteFlags::ALL, nullptr));
|
std::make_unique<ScUndoPaste>(pDocSh, aRange, aDestMark, std::move(pUndoDoc), std::move(pRedoDoc), InsertDeleteFlags::ALL, nullptr));
|
||||||
@ -1935,7 +1935,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
|
|||||||
pDoc->CheckLinkFormulaNeedingCheck(*xCode);
|
pDoc->CheckLinkFormulaNeedingCheck(*xCode);
|
||||||
if ( ch == 'M' )
|
if ( ch == 'M' )
|
||||||
{
|
{
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(pDoc->MaxRow(), pDoc->MaxCol());
|
||||||
aMark.SelectTable( aPos.Tab(), true );
|
aMark.SelectTable( aPos.Tab(), true );
|
||||||
pDoc->InsertMatrixFormula( nCol, nRow, nRefCol,
|
pDoc->InsertMatrixFormula( nCol, nRow, nRefCol,
|
||||||
nRefRow, aMark, EMPTY_OUSTRING, xCode.get() );
|
nRefRow, aMark, EMPTY_OUSTRING, xCode.get() );
|
||||||
|
@ -160,7 +160,7 @@ void FuText::StopEditMode()
|
|||||||
|
|
||||||
// Make sure the former area of the note anchor is invalidated.
|
// Make sure the former area of the note anchor is invalidated.
|
||||||
ScRangeList aRangeList(aNotePos);
|
ScRangeList aRangeList(aNotePos);
|
||||||
ScMarkData aMarkData(aRangeList);
|
ScMarkData aMarkData(rDoc.MaxRow(), rDoc.MaxCol(), aRangeList);
|
||||||
rViewShell.UpdateSelectionArea(aMarkData);
|
rViewShell.UpdateSelectionArea(aMarkData);
|
||||||
}
|
}
|
||||||
else if( bNewNote || bDeleteNote )
|
else if( bNewNote || bDeleteNote )
|
||||||
|
@ -1251,11 +1251,11 @@ static void lcl_DoDragObject( ScDocShell* pSrcShell, const OUString& rName, ScCo
|
|||||||
|
|
||||||
static void lcl_DoDragCells( ScDocShell* pSrcShell, const ScRange& rRange, ScDragSrc nFlags, vcl::Window* pWin )
|
static void lcl_DoDragCells( ScDocShell* pSrcShell, const ScRange& rRange, ScDragSrc nFlags, vcl::Window* pWin )
|
||||||
{
|
{
|
||||||
ScMarkData aMark;
|
ScDocument& rSrcDoc = pSrcShell->GetDocument();
|
||||||
|
ScMarkData aMark(rSrcDoc.MaxRow(), rSrcDoc.MaxCol());
|
||||||
aMark.SelectTable( rRange.aStart.Tab(), true );
|
aMark.SelectTable( rRange.aStart.Tab(), true );
|
||||||
aMark.SetMarkArea( rRange );
|
aMark.SetMarkArea( rRange );
|
||||||
|
|
||||||
ScDocument& rSrcDoc = pSrcShell->GetDocument();
|
|
||||||
if ( !rSrcDoc.HasSelectedBlockMatrixFragment( rRange.aStart.Col(), rRange.aStart.Row(),
|
if ( !rSrcDoc.HasSelectedBlockMatrixFragment( rRange.aStart.Col(), rRange.aStart.Row(),
|
||||||
rRange.aEnd.Col(), rRange.aEnd.Row(),
|
rRange.aEnd.Col(), rRange.aEnd.Row(),
|
||||||
aMark ) )
|
aMark ) )
|
||||||
|
@ -465,7 +465,7 @@ void ScUndoDeleteCells::DoChange( const bool bUndo )
|
|||||||
aWorkRange.aEnd.SetCol(rDoc.MaxCol());
|
aWorkRange.aEnd.SetCol(rDoc.MaxCol());
|
||||||
if ( eCmd==DelCellCmd::Rows || eCmd==DelCellCmd::CellsUp )
|
if ( eCmd==DelCellCmd::Rows || eCmd==DelCellCmd::CellsUp )
|
||||||
aWorkRange.aEnd.SetRow(rDoc.MaxRow());
|
aWorkRange.aEnd.SetRow(rDoc.MaxRow());
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMarkData.SelectOneTable( aWorkRange.aStart.Tab() );
|
aMarkData.SelectOneTable( aWorkRange.aStart.Tab() );
|
||||||
ScPatternAttr aPattern( rDoc.GetPool() );
|
ScPatternAttr aPattern( rDoc.GetPool() );
|
||||||
aPattern.GetItemSet().Put( ScMergeFlagAttr() );
|
aPattern.GetItemSet().Put( ScMergeFlagAttr() );
|
||||||
@ -1083,7 +1083,7 @@ void ScUndoPaste::DoChange(bool bUndo)
|
|||||||
ScRange& rDrawRange = aDrawRanges[i];
|
ScRange& rDrawRange = aDrawRanges[i];
|
||||||
rDoc.ExtendMerge(rDrawRange, true); // only needed for single sheet (text/rtf etc.)
|
rDoc.ExtendMerge(rDrawRange, true); // only needed for single sheet (text/rtf etc.)
|
||||||
ScRangeList aRangeList(rDrawRange);
|
ScRangeList aRangeList(rDrawRange);
|
||||||
ScMarkData aData(aRangeList);
|
ScMarkData aData(rDoc.MaxRow(), rDoc.MaxCol(), aRangeList);
|
||||||
if (bPaintAll)
|
if (bPaintAll)
|
||||||
{
|
{
|
||||||
rDrawRange.aStart.SetCol(0);
|
rDrawRange.aStart.SetCol(0);
|
||||||
@ -1408,7 +1408,7 @@ void ScUndoDragDrop::Redo()
|
|||||||
of drawing undo actions. */
|
of drawing undo actions. */
|
||||||
|
|
||||||
SCTAB nTab;
|
SCTAB nTab;
|
||||||
ScMarkData aSourceMark;
|
ScMarkData aSourceMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
for (nTab=aSrcRange.aStart.Tab(); nTab<=aSrcRange.aEnd.Tab(); nTab++)
|
for (nTab=aSrcRange.aStart.Tab(); nTab<=aSrcRange.aEnd.Tab(); nTab++)
|
||||||
aSourceMark.SelectTable( nTab, true );
|
aSourceMark.SelectTable( nTab, true );
|
||||||
|
|
||||||
@ -1427,7 +1427,7 @@ void ScUndoDragDrop::Redo()
|
|||||||
PaintArea( aSrcPaintRange, nExtFlags );
|
PaintArea( aSrcPaintRange, nExtFlags );
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMarkData aDestMark;
|
ScMarkData aDestMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
for (nTab=aDestRange.aStart.Tab(); nTab<=aDestRange.aEnd.Tab(); nTab++)
|
for (nTab=aDestRange.aStart.Tab(); nTab<=aDestRange.aEnd.Tab(); nTab++)
|
||||||
aDestMark.SelectTable( nTab, true );
|
aDestMark.SelectTable( nTab, true );
|
||||||
|
|
||||||
@ -1917,7 +1917,7 @@ void ScUndoEnterMatrix::Redo()
|
|||||||
|
|
||||||
ScDocument& rDoc = pDocShell->GetDocument();
|
ScDocument& rDoc = pDocShell->GetDocument();
|
||||||
|
|
||||||
ScMarkData aDestMark;
|
ScMarkData aDestMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aDestMark.SelectOneTable( aBlockRange.aStart.Tab() );
|
aDestMark.SelectOneTable( aBlockRange.aStart.Tab() );
|
||||||
aDestMark.SetMarkArea( aBlockRange );
|
aDestMark.SetMarkArea( aBlockRange );
|
||||||
|
|
||||||
@ -2365,7 +2365,7 @@ void ScUndoBorder::Undo()
|
|||||||
BeginUndo();
|
BeginUndo();
|
||||||
|
|
||||||
ScDocument& rDoc = pDocShell->GetDocument();
|
ScDocument& rDoc = pDocShell->GetDocument();
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMarkData.MarkFromRangeList(*xRanges, false);
|
aMarkData.MarkFromRangeList(*xRanges, false);
|
||||||
xUndoDoc->CopyToDocument(aBlockRange, InsertDeleteFlags::ATTRIB, true, rDoc, &aMarkData);
|
xUndoDoc->CopyToDocument(aBlockRange, InsertDeleteFlags::ATTRIB, true, rDoc, &aMarkData);
|
||||||
pDocShell->PostPaint( aBlockRange, PaintPartFlags::Grid, SC_PF_LINES | SC_PF_TESTMERGE );
|
pDocShell->PostPaint( aBlockRange, PaintPartFlags::Grid, SC_PF_LINES | SC_PF_TESTMERGE );
|
||||||
@ -2384,7 +2384,7 @@ void ScUndoBorder::Redo()
|
|||||||
ScRange const & rRange = (*xRanges)[i];
|
ScRange const & rRange = (*xRanges)[i];
|
||||||
SCTAB nTab = rRange.aStart.Tab();
|
SCTAB nTab = rRange.aStart.Tab();
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMark.SetMarkArea( rRange );
|
aMark.SetMarkArea( rRange );
|
||||||
aMark.SelectTable( nTab, true );
|
aMark.SelectTable( nTab, true );
|
||||||
|
|
||||||
|
@ -859,7 +859,7 @@ void ScUndoAutoFormat::Redo()
|
|||||||
sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, pVirtDev);
|
sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, pVirtDev);
|
||||||
for (SCTAB nTab=nStartZ; nTab<=nEndZ; nTab++)
|
for (SCTAB nTab=nStartZ; nTab<=nEndZ; nTab++)
|
||||||
{
|
{
|
||||||
ScMarkData aDestMark;
|
ScMarkData aDestMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aDestMark.SelectOneTable( nTab );
|
aDestMark.SelectOneTable( nTab );
|
||||||
aDestMark.SetMarkArea( ScRange( nStartX, nStartY, nTab, nEndX, nEndY, nTab ) );
|
aDestMark.SetMarkArea( ScRange( nStartX, nStartY, nTab, nEndX, nEndY, nTab ) );
|
||||||
aDestMark.MarkToMulti();
|
aDestMark.MarkToMulti();
|
||||||
|
@ -1070,7 +1070,7 @@ void ScHelperFunctions::ApplyBorder( ScDocShell* pDocShell, const ScRangeList& r
|
|||||||
rDoc.CopyToDocument(rRange, InsertDeleteFlags::ATTRIB, false, *pUndoDoc);
|
rDoc.CopyToDocument(rRange, InsertDeleteFlags::ATTRIB, false, *pUndoDoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMark.SetMarkArea( rRange );
|
aMark.SetMarkArea( rRange );
|
||||||
aMark.SelectTable( nTab, true );
|
aMark.SelectTable( nTab, true );
|
||||||
|
|
||||||
@ -1211,7 +1211,7 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange,
|
|||||||
|
|
||||||
if ( pUndoDoc )
|
if ( pUndoDoc )
|
||||||
{
|
{
|
||||||
ScMarkData aDestMark;
|
ScMarkData aDestMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aDestMark.SelectOneTable( nTab );
|
aDestMark.SelectOneTable( nTab );
|
||||||
rDocShell.GetUndoManager()->AddUndoAction(
|
rDocShell.GetUndoManager()->AddUndoAction(
|
||||||
std::make_unique<ScUndoPaste>(
|
std::make_unique<ScUndoPaste>(
|
||||||
@ -1308,7 +1308,7 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange,
|
|||||||
|
|
||||||
if ( pUndoDoc )
|
if ( pUndoDoc )
|
||||||
{
|
{
|
||||||
ScMarkData aDestMark;
|
ScMarkData aDestMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aDestMark.SelectOneTable( nTab );
|
aDestMark.SelectOneTable( nTab );
|
||||||
rDocShell.GetUndoManager()->AddUndoAction(
|
rDocShell.GetUndoManager()->AddUndoAction(
|
||||||
std::make_unique<ScUndoPaste>( &rDocShell,
|
std::make_unique<ScUndoPaste>( &rDocShell,
|
||||||
@ -1522,7 +1522,7 @@ const ScMarkData* ScCellRangesBase::GetMarkData()
|
|||||||
{
|
{
|
||||||
if (!pMarkData)
|
if (!pMarkData)
|
||||||
{
|
{
|
||||||
pMarkData.reset( new ScMarkData(aRanges) );
|
pMarkData.reset( new ScMarkData(GetDocument()->MaxRow(), GetDocument()->MaxCol(), aRanges) );
|
||||||
}
|
}
|
||||||
return pMarkData.get();
|
return pMarkData.get();
|
||||||
}
|
}
|
||||||
@ -2450,7 +2450,7 @@ void ScCellRangesBase::GetOnePropertyValue( const SfxItemPropertySimpleEntry* pE
|
|||||||
SvxBoxInfoItem aInner(ATTR_BORDER_INNER);
|
SvxBoxInfoItem aInner(ATTR_BORDER_INNER);
|
||||||
|
|
||||||
ScDocument& rDoc = pDocShell->GetDocument();
|
ScDocument& rDoc = pDocShell->GetDocument();
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMark.SetMarkArea( rFirst );
|
aMark.SetMarkArea( rFirst );
|
||||||
aMark.SelectTable( rFirst.aStart.Tab(), true );
|
aMark.SelectTable( rFirst.aStart.Tab(), true );
|
||||||
rDoc.GetSelectionFrame( aMark, aOuter, aInner );
|
rDoc.GetSelectionFrame( aMark, aOuter, aInner );
|
||||||
@ -3412,7 +3412,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryContentC
|
|||||||
{
|
{
|
||||||
ScDocument& rDoc = pDocShell->GetDocument();
|
ScDocument& rDoc = pDocShell->GetDocument();
|
||||||
|
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
|
|
||||||
// select matching cells
|
// select matching cells
|
||||||
for ( size_t i = 0, nCount = aRanges.size(); i < nCount; ++i )
|
for ( size_t i = 0, nCount = aRanges.size(); i < nCount; ++i )
|
||||||
@ -3501,7 +3501,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryFormulaC
|
|||||||
{
|
{
|
||||||
ScDocument& rDoc = pDocShell->GetDocument();
|
ScDocument& rDoc = pDocShell->GetDocument();
|
||||||
|
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
|
|
||||||
// select matching cells
|
// select matching cells
|
||||||
for ( size_t i = 0, nCount = aRanges.size(); i < nCount; ++i )
|
for ( size_t i = 0, nCount = aRanges.size(); i < nCount; ++i )
|
||||||
@ -3555,7 +3555,7 @@ uno::Reference<sheet::XSheetCellRanges> ScCellRangesBase::QueryDifferences_Impl(
|
|||||||
size_t nRangeCount = aRanges.size();
|
size_t nRangeCount = aRanges.size();
|
||||||
size_t i;
|
size_t i;
|
||||||
ScDocument& rDoc = pDocShell->GetDocument();
|
ScDocument& rDoc = pDocShell->GetDocument();
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
|
|
||||||
SCCOLROW nCmpPos = bColumnDiff ? static_cast<SCCOLROW>(aCompare.Row) : static_cast<SCCOLROW>(aCompare.Column);
|
SCCOLROW nCmpPos = bColumnDiff ? static_cast<SCCOLROW>(aCompare.Row) : static_cast<SCCOLROW>(aCompare.Column);
|
||||||
|
|
||||||
@ -3685,7 +3685,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryPreceden
|
|||||||
bFound = false;
|
bFound = false;
|
||||||
|
|
||||||
// aMarkData uses aNewRanges, not aRanges, so GetMarkData can't be used
|
// aMarkData uses aNewRanges, not aRanges, so GetMarkData can't be used
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMarkData.MarkFromRangeList( aNewRanges, false );
|
aMarkData.MarkFromRangeList( aNewRanges, false );
|
||||||
aMarkData.MarkToMulti(); // needed for IsAllMarked
|
aMarkData.MarkToMulti(); // needed for IsAllMarked
|
||||||
|
|
||||||
@ -3734,7 +3734,7 @@ uno::Reference<sheet::XSheetCellRanges> SAL_CALL ScCellRangesBase::queryDependen
|
|||||||
bFound = false;
|
bFound = false;
|
||||||
|
|
||||||
// aMarkData uses aNewRanges, not aRanges, so GetMarkData can't be used
|
// aMarkData uses aNewRanges, not aRanges, so GetMarkData can't be used
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMarkData.MarkFromRangeList( aNewRanges, false );
|
aMarkData.MarkFromRangeList( aNewRanges, false );
|
||||||
aMarkData.MarkToMulti(); // needed for IsAllMarked
|
aMarkData.MarkToMulti(); // needed for IsAllMarked
|
||||||
|
|
||||||
@ -4168,7 +4168,7 @@ void SAL_CALL ScCellRangesObj::removeRangeAddress( const table::CellRangeAddress
|
|||||||
aNotSheetRanges.push_back( rRanges[ i ] );
|
aNotSheetRanges.push_back( rRanges[ i ] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(GetDocument()->MaxRow(), GetDocument()->MaxCol());
|
||||||
aMarkData.MarkFromRangeList( aSheetRanges, false );
|
aMarkData.MarkFromRangeList( aSheetRanges, false );
|
||||||
ScRange aRange(static_cast<SCCOL>(rRange.StartColumn),
|
ScRange aRange(static_cast<SCCOL>(rRange.StartColumn),
|
||||||
static_cast<SCROW>(rRange.StartRow),
|
static_cast<SCROW>(rRange.StartRow),
|
||||||
@ -4321,7 +4321,7 @@ static bool lcl_FindRangeOrEntry( const ScNamedEntryArr_Impl& rNamedEntries,
|
|||||||
if ( (nParse & ( ScRefFlags::VALID | ScRefFlags::TAB_3D ))
|
if ( (nParse & ( ScRefFlags::VALID | ScRefFlags::TAB_3D ))
|
||||||
== ( ScRefFlags::VALID | ScRefFlags::TAB_3D ))
|
== ( ScRefFlags::VALID | ScRefFlags::TAB_3D ))
|
||||||
{
|
{
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(pDocSh->GetDocument().MaxRow(), pDocSh->GetDocument().MaxCol());
|
||||||
aMarkData.MarkFromRangeList( rRanges, false );
|
aMarkData.MarkFromRangeList( rRanges, false );
|
||||||
aMarkData.MarkToMulti(); // needed for IsAllMarked
|
aMarkData.MarkToMulti(); // needed for IsAllMarked
|
||||||
if ( aMarkData.IsAllMarked( aCellRange ) )
|
if ( aMarkData.IsAllMarked( aCellRange ) )
|
||||||
@ -4339,7 +4339,7 @@ static bool lcl_FindRangeOrEntry( const ScNamedEntryArr_Impl& rNamedEntries,
|
|||||||
// test if named entry is contained in rRanges
|
// test if named entry is contained in rRanges
|
||||||
|
|
||||||
const ScRange& rComp = rNamedEntry.GetRange();
|
const ScRange& rComp = rNamedEntry.GetRange();
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(pDocSh->GetDocument().MaxRow(), pDocSh->GetDocument().MaxCol());
|
||||||
aMarkData.MarkFromRangeList( rRanges, false );
|
aMarkData.MarkFromRangeList( rRanges, false );
|
||||||
aMarkData.MarkToMulti(); // needed for IsAllMarked
|
aMarkData.MarkToMulti(); // needed for IsAllMarked
|
||||||
if ( aMarkData.IsAllMarked( rComp ) )
|
if ( aMarkData.IsAllMarked( rComp ) )
|
||||||
@ -4388,7 +4388,7 @@ void SAL_CALL ScCellRangesObj::removeByName( const OUString& aName )
|
|||||||
}
|
}
|
||||||
if ( bValid )
|
if ( bValid )
|
||||||
{
|
{
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(GetDocument()->MaxRow(), GetDocument()->MaxCol());
|
||||||
aMarkData.MarkFromRangeList( rRanges, false );
|
aMarkData.MarkFromRangeList( rRanges, false );
|
||||||
|
|
||||||
for ( size_t i = 0, nDiffCount = aDiff.size(); i < nDiffCount; i++ )
|
for ( size_t i = 0, nDiffCount = aDiff.size(); i < nDiffCount; i++ )
|
||||||
@ -4881,7 +4881,7 @@ void ScCellRangeObj::SetArrayFormula_Impl(const OUString& rFormula,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// empty string -> erase array formula
|
// empty string -> erase array formula
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(GetDocument()->MaxRow(), GetDocument()->MaxCol());
|
||||||
aMark.SetMarkArea( aRange );
|
aMark.SetMarkArea( aRange );
|
||||||
aMark.SelectTable( aRange.aStart.Tab(), true );
|
aMark.SelectTable( aRange.aStart.Tab(), true );
|
||||||
pDocSh->GetDocFunc().DeleteContents( aMark, InsertDeleteFlags::CONTENTS, true, true );
|
pDocSh->GetDocFunc().DeleteContents( aMark, InsertDeleteFlags::CONTENTS, true, true );
|
||||||
@ -4956,7 +4956,7 @@ void SAL_CALL ScCellRangeObj::setArrayTokens( const uno::Sequence<sheet::Formula
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// empty sequence -> erase array formula
|
// empty sequence -> erase array formula
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(pDocSh->GetDocument().MaxRow(), pDocSh->GetDocument().MaxCol());
|
||||||
aMark.SetMarkArea( aRange );
|
aMark.SetMarkArea( aRange );
|
||||||
aMark.SelectTable( aRange.aStart.Tab(), true );
|
aMark.SelectTable( aRange.aStart.Tab(), true );
|
||||||
pDocSh->GetDocFunc().DeleteContents( aMark, InsertDeleteFlags::CONTENTS, true, true );
|
pDocSh->GetDocFunc().DeleteContents( aMark, InsertDeleteFlags::CONTENTS, true, true );
|
||||||
@ -7689,7 +7689,7 @@ void SAL_CALL ScTableSheetObj::addRanges( const uno::Sequence<table::CellRangeAd
|
|||||||
|
|
||||||
if (rDoc.IsScenario(nTab))
|
if (rDoc.IsScenario(nTab))
|
||||||
{
|
{
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMarkData.SelectTable( nTab, true );
|
aMarkData.SelectTable( nTab, true );
|
||||||
|
|
||||||
for (const table::CellRangeAddress& rRange : rScenRanges)
|
for (const table::CellRangeAddress& rRange : rScenRanges)
|
||||||
@ -8732,7 +8732,7 @@ void ScCellsEnumeration::CheckPos_Impl()
|
|||||||
{
|
{
|
||||||
if (!pMark)
|
if (!pMark)
|
||||||
{
|
{
|
||||||
pMark.reset( new ScMarkData );
|
pMark.reset( new ScMarkData(rDoc.MaxRow(), rDoc.MaxCol()) );
|
||||||
pMark->MarkFromRangeList(aRanges, false);
|
pMark->MarkFromRangeList(aRanges, false);
|
||||||
pMark->MarkToMulti(); // needed for GetNextMarkedCell
|
pMark->MarkToMulti(); // needed for GetNextMarkedCell
|
||||||
}
|
}
|
||||||
@ -8756,7 +8756,7 @@ void ScCellsEnumeration::Advance_Impl()
|
|||||||
OSL_ENSURE(!bAtEnd,"too much Advance_Impl");
|
OSL_ENSURE(!bAtEnd,"too much Advance_Impl");
|
||||||
if (!pMark)
|
if (!pMark)
|
||||||
{
|
{
|
||||||
pMark.reset( new ScMarkData );
|
pMark.reset( new ScMarkData(pDocShell->GetDocument().MaxRow(), pDocShell->GetDocument().MaxCol()) );
|
||||||
pMark->MarkFromRangeList( aRanges, false );
|
pMark->MarkFromRangeList( aRanges, false );
|
||||||
pMark->MarkToMulti(); // needed for GetNextMarkedCell
|
pMark->MarkToMulti(); // needed for GetNextMarkedCell
|
||||||
}
|
}
|
||||||
|
@ -338,7 +338,7 @@ void SAL_CALL ScCellCursorObj::gotoNext()
|
|||||||
aOneRange.PutInOrder();
|
aOneRange.PutInOrder();
|
||||||
ScAddress aCursor(aOneRange.aStart); // always use start of block
|
ScAddress aCursor(aOneRange.aStart); // always use start of block
|
||||||
|
|
||||||
ScMarkData aMark; // not used with bMarked=FALSE
|
ScMarkData aMark(GetDocument()->MaxRow(), GetDocument()->MaxCol()); // not used with bMarked=FALSE
|
||||||
SCCOL nNewX = aCursor.Col();
|
SCCOL nNewX = aCursor.Col();
|
||||||
SCROW nNewY = aCursor.Row();
|
SCROW nNewY = aCursor.Row();
|
||||||
SCTAB nTab = aCursor.Tab();
|
SCTAB nTab = aCursor.Tab();
|
||||||
@ -360,7 +360,7 @@ void SAL_CALL ScCellCursorObj::gotoPrevious()
|
|||||||
aOneRange.PutInOrder();
|
aOneRange.PutInOrder();
|
||||||
ScAddress aCursor(aOneRange.aStart); // always use start of block
|
ScAddress aCursor(aOneRange.aStart); // always use start of block
|
||||||
|
|
||||||
ScMarkData aMark; // not used with bMarked=FALSE
|
ScMarkData aMark(GetDocument()->MaxRow(), GetDocument()->MaxCol()); // not used with bMarked=FALSE
|
||||||
SCCOL nNewX = aCursor.Col();
|
SCCOL nNewX = aCursor.Col();
|
||||||
SCROW nNewY = aCursor.Row();
|
SCROW nNewY = aCursor.Row();
|
||||||
SCTAB nTab = aCursor.Tab();
|
SCTAB nTab = aCursor.Tab();
|
||||||
|
@ -1572,7 +1572,7 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount(const uno::Any& aSelection,
|
|||||||
static_cast< sheet::XSpreadsheetDocument* >(this) );
|
static_cast< sheet::XSpreadsheetDocument* >(this) );
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(GetDocument()->MaxRow(), GetDocument()->MaxCol());
|
||||||
ScPrintSelectionStatus aStatus;
|
ScPrintSelectionStatus aStatus;
|
||||||
OUString aPagesStr;
|
OUString aPagesStr;
|
||||||
bool bRenderToGraphic = false;
|
bool bRenderToGraphic = false;
|
||||||
@ -1662,7 +1662,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32
|
|||||||
static_cast< sheet::XSpreadsheetDocument* >(this) );
|
static_cast< sheet::XSpreadsheetDocument* >(this) );
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(pDocShell->GetDocument().MaxRow(), pDocShell->GetDocument().MaxCol());
|
||||||
ScPrintSelectionStatus aStatus;
|
ScPrintSelectionStatus aStatus;
|
||||||
OUString aPagesStr;
|
OUString aPagesStr;
|
||||||
// #i115266# if FillRenderMarkData fails, keep nTotalPages at 0, but still handle getRenderer(0) below
|
// #i115266# if FillRenderMarkData fails, keep nTotalPages at 0, but still handle getRenderer(0) below
|
||||||
@ -1910,7 +1910,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
|
|||||||
static_cast< sheet::XSpreadsheetDocument* >(this) );
|
static_cast< sheet::XSpreadsheetDocument* >(this) );
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(pDocShell->GetDocument().MaxRow(), pDocShell->GetDocument().MaxCol());
|
||||||
ScPrintSelectionStatus aStatus;
|
ScPrintSelectionStatus aStatus;
|
||||||
OUString aPagesStr;
|
OUString aPagesStr;
|
||||||
bool bRenderToGraphic = false;
|
bool bRenderToGraphic = false;
|
||||||
@ -3086,7 +3086,7 @@ void ScModelObj::NotifyChanges( const OUString& rOperation, const ScRangeList& r
|
|||||||
//! separate method with ScMarkData? Then change HasChangesListeners back.
|
//! separate method with ScMarkData? Then change HasChangesListeners back.
|
||||||
if ( rOperation == "cell-change" && pDocShell )
|
if ( rOperation == "cell-change" && pDocShell )
|
||||||
{
|
{
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(pDocShell->GetDocument().MaxRow(), pDocShell->GetDocument().MaxCol());
|
||||||
aMarkData.MarkFromRangeList( rRanges, false );
|
aMarkData.MarkFromRangeList( rRanges, false );
|
||||||
ScDocument& rDoc = pDocShell->GetDocument();
|
ScDocument& rDoc = pDocShell->GetDocument();
|
||||||
SCTAB nTabCount = rDoc.GetTableCount();
|
SCTAB nTabCount = rDoc.GetTableCount();
|
||||||
@ -4454,7 +4454,7 @@ void SAL_CALL ScAnnotationsObj::removeByIndex( sal_Int32 nIndex )
|
|||||||
ScAddress aPos;
|
ScAddress aPos;
|
||||||
if ( GetAddressByIndex_Impl( nIndex, aPos ) )
|
if ( GetAddressByIndex_Impl( nIndex, aPos ) )
|
||||||
{
|
{
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(pDocShell->GetDocument().MaxRow(), pDocShell->GetDocument().MaxCol());
|
||||||
aMarkData.SelectTable( aPos.Tab(), true );
|
aMarkData.SelectTable( aPos.Tab(), true );
|
||||||
aMarkData.SetMultiMarkArea( ScRange(aPos) );
|
aMarkData.SetMultiMarkArea( ScRange(aPos) );
|
||||||
|
|
||||||
@ -4585,7 +4585,7 @@ void SAL_CALL ScScenariosObj::addNewByName( const OUString& aName,
|
|||||||
SolarMutexGuard aGuard;
|
SolarMutexGuard aGuard;
|
||||||
if ( pDocShell )
|
if ( pDocShell )
|
||||||
{
|
{
|
||||||
ScMarkData aMarkData;
|
ScMarkData aMarkData(pDocShell->GetDocument().MaxRow(), pDocShell->GetDocument().MaxCol());
|
||||||
aMarkData.SelectTable( nTab, true );
|
aMarkData.SelectTable( nTab, true );
|
||||||
|
|
||||||
for (const table::CellRangeAddress& rRange : aRanges)
|
for (const table::CellRangeAddress& rRange : aRanges)
|
||||||
|
@ -142,7 +142,7 @@ static bool lcl_CopyData( ScDocument* pSrcDoc, const ScRange& rSrcRange,
|
|||||||
nDestTab ) );
|
nDestTab ) );
|
||||||
|
|
||||||
ScDocumentUniquePtr pClipDoc(new ScDocument( SCDOCMODE_CLIP ));
|
ScDocumentUniquePtr pClipDoc(new ScDocument( SCDOCMODE_CLIP ));
|
||||||
ScMarkData aSourceMark;
|
ScMarkData aSourceMark(pSrcDoc->MaxRow(), pSrcDoc->MaxCol());
|
||||||
aSourceMark.SelectOneTable( nSrcTab ); // for CopyToClip
|
aSourceMark.SelectOneTable( nSrcTab ); // for CopyToClip
|
||||||
aSourceMark.SetMarkArea( rSrcRange );
|
aSourceMark.SetMarkArea( rSrcRange );
|
||||||
ScClipParam aClipParam(rSrcRange, false);
|
ScClipParam aClipParam(rSrcRange, false);
|
||||||
@ -157,7 +157,7 @@ static bool lcl_CopyData( ScDocument* pSrcDoc, const ScRange& rSrcRange,
|
|||||||
pClipDoc->ApplyPatternAreaTab( 0,0, pClipDoc->MaxCol(), pClipDoc->MaxRow(), nSrcTab, aPattern );
|
pClipDoc->ApplyPatternAreaTab( 0,0, pClipDoc->MaxCol(), pClipDoc->MaxRow(), nSrcTab, aPattern );
|
||||||
}
|
}
|
||||||
|
|
||||||
ScMarkData aDestMark;
|
ScMarkData aDestMark(pDestDoc->MaxRow(), pDestDoc->MaxCol());
|
||||||
aDestMark.SelectOneTable( nDestTab );
|
aDestMark.SelectOneTable( nDestTab );
|
||||||
aDestMark.SetMarkArea( aNewRange );
|
aDestMark.SetMarkArea( aNewRange );
|
||||||
pDestDoc->CopyFromClip( aNewRange, aDestMark, InsertDeleteFlags::ALL & ~InsertDeleteFlags::FORMULA, nullptr, pClipDoc.get(), false );
|
pDestDoc->CopyFromClip( aNewRange, aDestMark, InsertDeleteFlags::ALL & ~InsertDeleteFlags::FORMULA, nullptr, pClipDoc.get(), false );
|
||||||
|
@ -5280,7 +5280,7 @@ ScVbaRange::setStyle( const uno::Any& _style )
|
|||||||
uno::Reference< excel::XRange >
|
uno::Reference< excel::XRange >
|
||||||
ScVbaRange::PreviousNext( bool bIsPrevious )
|
ScVbaRange::PreviousNext( bool bIsPrevious )
|
||||||
{
|
{
|
||||||
ScMarkData markedRange;
|
ScMarkData markedRange(getScDocument().MaxRow(), getScDocument().MaxCol());
|
||||||
ScRange refRange;
|
ScRange refRange;
|
||||||
RangeHelper thisRange( mxRange );
|
RangeHelper thisRange( mxRange );
|
||||||
|
|
||||||
|
@ -498,7 +498,8 @@ void ScVbaWorksheets::PrintPreview( const css::uno::Any& /*EnableChanges*/ )
|
|||||||
{
|
{
|
||||||
ScPreviewShell* pPrvShell = static_cast< ScPreviewShell* >( pShell );
|
ScPreviewShell* pPrvShell = static_cast< ScPreviewShell* >( pShell );
|
||||||
ScPreview* pPrvView = pPrvShell->GetPreview();
|
ScPreview* pPrvView = pPrvShell->GetPreview();
|
||||||
ScMarkData aMarkData;
|
const ScDocument& rDoc = *pViewShell->GetViewData().GetDocument();
|
||||||
|
ScMarkData aMarkData(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
sal_Int32 nElems = getCount();
|
sal_Int32 nElems = getCount();
|
||||||
for ( sal_Int32 nItem = 1; nItem <= nElems; ++nItem )
|
for ( sal_Int32 nItem = 1; nItem <= nElems; ++nItem )
|
||||||
{
|
{
|
||||||
|
@ -2401,7 +2401,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
|
|||||||
ScViewData* pData = GetViewData();
|
ScViewData* pData = GetViewData();
|
||||||
ScMarkData& rMark = pData->GetMarkData();
|
ScMarkData& rMark = pData->GetMarkData();
|
||||||
ScDocument* pDoc = pData->GetDocument();
|
ScDocument* pDoc = pData->GetDocument();
|
||||||
ScMarkData aNewMark;
|
ScMarkData aNewMark(pDoc->MaxRow(), pDoc->MaxCol());
|
||||||
ScRangeList aRangeList;
|
ScRangeList aRangeList;
|
||||||
|
|
||||||
for (auto const& rTab : rMark.GetSelectedTabs())
|
for (auto const& rTab : rMark.GetSelectedTabs())
|
||||||
|
@ -5385,7 +5385,7 @@ bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScenRang
|
|||||||
|
|
||||||
//! cache the Ranges in Table!!!!
|
//! cache the Ranges in Table!!!!
|
||||||
|
|
||||||
ScMarkData aMarks;
|
ScMarkData aMarks(pDoc->MaxRow(), pDoc->MaxCol());
|
||||||
for (SCTAB i=nTab+1; i<nTabCount && pDoc->IsScenario(i); i++)
|
for (SCTAB i=nTab+1; i<nTabCount && pDoc->IsScenario(i); i++)
|
||||||
pDoc->MarkScenario( i, nTab, aMarks, false, ScScenarioFlags::ShowFrame );
|
pDoc->MarkScenario( i, nTab, aMarks, false, ScScenarioFlags::ShowFrame );
|
||||||
ScRangeList aRanges;
|
ScRangeList aRanges;
|
||||||
|
@ -198,7 +198,7 @@ static void lcl_DrawScenarioFrames( OutputDevice* pDev, ScViewData* pViewData, S
|
|||||||
|
|
||||||
//! cache the ranges in table!!!!
|
//! cache the ranges in table!!!!
|
||||||
|
|
||||||
ScMarkData aMarks;
|
ScMarkData aMarks(pDoc->MaxRow(), pDoc->MaxCol());
|
||||||
for (SCTAB i=nTab+1; i<nTabCount && pDoc->IsScenario(i); i++)
|
for (SCTAB i=nTab+1; i<nTabCount && pDoc->IsScenario(i); i++)
|
||||||
pDoc->MarkScenario( i, nTab, aMarks, false, ScScenarioFlags::ShowFrame );
|
pDoc->MarkScenario( i, nTab, aMarks, false, ScScenarioFlags::ShowFrame );
|
||||||
ScRangeListRef xRanges = new ScRangeList;
|
ScRangeListRef xRanges = new ScRangeList;
|
||||||
|
@ -732,7 +732,7 @@ ScSplitPos ScViewDataTable::SanitizeWhichActive() const
|
|||||||
ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) :
|
ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) :
|
||||||
nPPTX(0.0),
|
nPPTX(0.0),
|
||||||
nPPTY(0.0),
|
nPPTY(0.0),
|
||||||
mpMarkData(new ScMarkData),
|
mpMarkData(new ScMarkData(pDocSh->GetDocument().MaxRow(), pDocSh->GetDocument().MaxCol()) ),
|
||||||
pDocShell ( pDocSh ),
|
pDocShell ( pDocSh ),
|
||||||
pDoc ( nullptr ),
|
pDoc ( nullptr ),
|
||||||
pView ( pViewSh ),
|
pView ( pViewSh ),
|
||||||
|
@ -142,7 +142,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow,
|
|||||||
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);
|
ScRange aMarkRange(nStartCol, nStartRow, nTab, nStartCol, nEndRow, nTab);
|
||||||
ScMarkData aDestMark;
|
ScMarkData aDestMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aDestMark.SetMarkArea( aMarkRange );
|
aDestMark.SetMarkArea( aMarkRange );
|
||||||
pDocSh->GetUndoManager()->AddUndoAction(
|
pDocSh->GetUndoManager()->AddUndoAction(
|
||||||
std::make_unique<ScUndoPaste>( pDocSh, aMarkRange, aDestMark,
|
std::make_unique<ScUndoPaste>( pDocSh, aMarkRange, aDestMark,
|
||||||
|
@ -139,7 +139,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
|
|||||||
if (!rSrcDoc.HasTable(nSrcTab))
|
if (!rSrcDoc.HasTable(nSrcTab))
|
||||||
nSrcTab = 0;
|
nSrcTab = 0;
|
||||||
|
|
||||||
ScMarkData aSrcMark;
|
ScMarkData aSrcMark(rSrcDoc.MaxRow(), rSrcDoc.MaxCol());
|
||||||
aSrcMark.SelectOneTable( nSrcTab ); // for CopyToClip
|
aSrcMark.SelectOneTable( nSrcTab ); // for CopyToClip
|
||||||
ScDocumentUniquePtr pClipDoc(new ScDocument( SCDOCMODE_CLIP ));
|
ScDocumentUniquePtr pClipDoc(new ScDocument( SCDOCMODE_CLIP ));
|
||||||
|
|
||||||
|
@ -213,7 +213,7 @@ void ScViewFunc::DoAutoAttributes( SCCOL nCol, SCROW nRow, SCTAB nTab,
|
|||||||
if ( !pSource->GetItem(ATTR_MERGE).IsMerged() )
|
if ( !pSource->GetItem(ATTR_MERGE).IsMerged() )
|
||||||
{
|
{
|
||||||
ScRange aRange( nCol, nRow, nTab, nCol, nRow, nTab );
|
ScRange aRange( nCol, nRow, nTab, nCol, nRow, nTab );
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(rDoc.MaxRow(), rDoc.MaxCol());
|
||||||
aMark.SetMarkArea( aRange );
|
aMark.SetMarkArea( aRange );
|
||||||
|
|
||||||
ScDocFunc &rFunc = GetViewData().GetDocFunc();
|
ScDocFunc &rFunc = GetViewData().GetDocFunc();
|
||||||
@ -552,7 +552,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
|
|||||||
const sal_uInt32 nFormat = pFormatter->GetStandardFormat( SvNumFormatType::NUMBER, nLang);
|
const sal_uInt32 nFormat = pFormatter->GetStandardFormat( SvNumFormatType::NUMBER, nLang);
|
||||||
ScPatternAttr aPattern( pDoc->GetPool());
|
ScPatternAttr aPattern( pDoc->GetPool());
|
||||||
aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_VALUE_FORMAT, nFormat));
|
aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_VALUE_FORMAT, nFormat));
|
||||||
ScMarkData aMark;
|
ScMarkData aMark(pDoc->MaxRow(), pDoc->MaxCol());
|
||||||
aMark.SelectTable( i, true);
|
aMark.SelectTable( i, true);
|
||||||
aMark.SetMarkArea( ScRange( aPos));
|
aMark.SetMarkArea( ScRange( aPos));
|
||||||
rFunc.ApplyAttributes( aMark, aPattern, false);
|
rFunc.ApplyAttributes( aMark, aPattern, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user