summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2020-11-30 17:58:46 +0100
committerLászló Németh <nemeth@numbertext.org>2020-11-30 18:09:25 +0100
commit210ec3ef966b2f9206e9e52781f4cb9d2ed46300 (patch)
tree80643463295fe9ed8b2da5f85d9aee820d5d2799 /sc
parent93ab6a682d19bc1cc1b4e5913b6fc16f054ef2d8 (diff)
Revert "tdf#138483 sc: update red circles after merging cells"
This reverts commit 3741b90abe478fb04db88207b496a5238df35bb8. Reason for revert: error: invalid use of incomplete type ‘const class ScMergeFlagAttr’ Change-Id: I5acb47a1edb4821c441944c879dc314156358ed9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106828 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/ods/updateCircleInMergedCell.odsbin8689 -> 0 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx35
-rw-r--r--sc/source/core/tool/detfunc.cxx9
-rw-r--r--sc/source/ui/docshell/docfunc.cxx8
-rw-r--r--sc/source/ui/inc/docfunc.hxx3
5 files changed, 4 insertions, 51 deletions
diff --git a/sc/qa/unit/data/ods/updateCircleInMergedCell.ods b/sc/qa/unit/data/ods/updateCircleInMergedCell.ods
deleted file mode 100644
index 93be82487e22..000000000000
--- a/sc/qa/unit/data/ods/updateCircleInMergedCell.ods
+++ /dev/null
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 2ef3cf4fb326..9c087549ec3e 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -65,8 +65,6 @@
#include <stlpool.hxx>
#include <hints.hxx>
#include <detfunc.hxx>
-#include <cellmergeoption.hxx>
-#include <undoblk.hxx>
#include <orcusfilters.hxx>
#include <filter.hxx>
@@ -104,7 +102,6 @@ public:
virtual void tearDown() override;
//ods, xls, xlsx filter tests
- void testUpdateCircleInMergedCellODS();
void testDeleteCircleInMergedCellODS();
void testBooleanFormatXLSX();
void testBasicCellContentODS();
@@ -295,7 +292,6 @@ public:
void testDeleteCirclesInRowAndCol();
CPPUNIT_TEST_SUITE(ScFiltersTest);
- CPPUNIT_TEST(testUpdateCircleInMergedCellODS);
CPPUNIT_TEST(testDeleteCircleInMergedCellODS);
CPPUNIT_TEST(testBooleanFormatXLSX);
CPPUNIT_TEST(testBasicCellContentODS);
@@ -530,37 +526,6 @@ void testRangeNameImpl(const ScDocument& rDoc)
}
-void ScFiltersTest::testUpdateCircleInMergedCellODS()
-{
- ScDocShellRef xDocSh = loadDoc("updateCircleInMergedCell.", FORMAT_ODS);
- CPPUNIT_ASSERT_MESSAGE("Failed to load updateCircleInMergedCell.ods", xDocSh.is());
-
- ScDocument& rDoc = xDocSh->GetDocument();
- rDoc.EnableChangeReadOnly(true);
-
- ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
- SdrPage* pPage = pDrawLayer->GetPage(0);
- CPPUNIT_ASSERT_MESSAGE("draw page for sheet 1 should exist.", pPage);
-
- // There should be four circle objects!
- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), pPage->GetObjCount());
-
- ScCellMergeOption aCellMergeOption(0,0,1,1); // A1:B2
- aCellMergeOption.maTabs.insert(0);
- xDocSh->GetDocFunc().MergeCells(aCellMergeOption, false, true, true, false);
-
- // There should be a circle object!
- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), pPage->GetObjCount());
-
- std::unique_ptr<ScUndoRemoveMerge> pUndoRemoveMerge;
- xDocSh->GetDocFunc().UnmergeCells(aCellMergeOption, true, pUndoRemoveMerge.get());
-
- // There should be four circle objects!
- CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), pPage->GetObjCount());
-
- xDocSh->DoClose();
-}
-
void ScFiltersTest::testDeleteCircleInMergedCellODS()
{
ScDocShellRef xDocSh = loadDoc("deleteCircleInMergedCell.", FORMAT_ODS);
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index f2d8f8254d20..be4d3e01e02c 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -1382,15 +1382,13 @@ bool ScDetectiveFunc::MarkInvalid(bool& rOverflow)
if ( bMarkEmpty )
for ( nRow = nNextRow; nRow < nCellRow && nInsCount < SC_DET_MAXCIRCLE; nRow++ )
{
- if(!pPattern->GetItem(ATTR_MERGE_FLAG).IsOverlapped())
- DrawCircle( nCol, nRow, aData );
+ DrawCircle( nCol, nRow, aData );
++nInsCount;
}
ScRefCellValue aCell = aCellIter.getRefCellValue();
if (!pData->IsDataValid(aCell, aCellIter.GetPos()))
{
- if(!pPattern->GetItem(ATTR_MERGE_FLAG).IsOverlapped())
- DrawCircle( nCol, nCellRow, aData );
+ DrawCircle( nCol, nCellRow, aData );
++nInsCount;
}
nNextRow = nCellRow + 1;
@@ -1398,8 +1396,7 @@ bool ScDetectiveFunc::MarkInvalid(bool& rOverflow)
if ( bMarkEmpty )
for ( nRow = nNextRow; nRow <= nRow2 && nInsCount < SC_DET_MAXCIRCLE; nRow++ )
{
- if(!pPattern->GetItem(ATTR_MERGE_FLAG).IsOverlapped())
- DrawCircle(nCol, nRow, aData);
+ DrawCircle( nCol, nRow, aData );
++nInsCount;
}
}
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index e05513039d9e..755a563cc43a 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -5027,10 +5027,6 @@ bool ScDocFunc::MergeCells( const ScCellMergeOption& rOption, bool bContents, bo
rDoc.SetDirty(aRange, true);
}
- bool bDone = ScDetectiveFunc(rDoc, nTab).DeleteAll( ScDetectiveDelete::Circles );
- if(bDone)
- DetectiveMarkInvalid(nTab);
-
bNeedContentsUndo |= bNeedContents;
}
@@ -5116,10 +5112,6 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, bool bRecord, Sc
if ( !AdjustRowHeight( aExtended ) )
rDocShell.PostPaint( aExtended, PaintPartFlags::Grid );
-
- bool bDone = ScDetectiveFunc(rDoc, nTab).DeleteAll( ScDetectiveDelete::Circles );
- if(bDone)
- DetectiveMarkInvalid(nTab);
}
if (bRecord)
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index f7b518ef7f35..1984c0da440a 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -195,8 +195,7 @@ public:
MergeCells( const ScCellMergeOption& rOption, bool bContents,
bool bRecord, bool bApi, bool bEmptyMergedCells = false );
bool UnmergeCells( const ScRange& rRange, bool bRecord, ScUndoRemoveMerge* pUndoRemoveMerge );
- SC_DLLPUBLIC bool
- UnmergeCells( const ScCellMergeOption& rOption, bool bRecord, ScUndoRemoveMerge* pUndoRemoveMerge );
+ bool UnmergeCells( const ScCellMergeOption& rOption, bool bRecord, ScUndoRemoveMerge* pUndoRemoveMerge );
// takes ownership of pNewRanges, nTab = -1 for local range names
void SetNewRangeNames( std::unique_ptr<ScRangeName> pNewRanges, bool bModifyDoc, SCTAB nTab );