sc/qa/unit/uicalc/uicalc.cxx | 27 +++++++++++++++++++++++++++ sc/source/core/tool/refupdat.cxx | 2 -- 2 files changed, 27 insertions(+), 2 deletions(-)
New commits: commit d9650695d30bcd1a885636984881603ed64ad6df Author: Tünde Tóth <[email protected]> AuthorDate: Wed Apr 26 15:31:46 2023 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Fri Apr 28 15:05:31 2023 +0200 tdf#152577 sc DBData: fix regression of database ranges Regression from commit 0c0444c44107f1a18f23dd0833d462d8dbf56569 "tdf#126926 sc DBData: delete the database range". Change-Id: I04923decdc768770f98763e60cd295400d15c769 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151065 Tested-by: Jenkins Tested-by: László Németh <[email protected]> Reviewed-by: László Németh <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151121 diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 042be6d569be..ac3fa2888b32 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -3144,6 +3144,33 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testUnallocatedColumnsAttributes) CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeight()); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf152577) +{ + mxComponent = loadFromDesktop("private:factory/scalc"); + ScModelObj* pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get()); + CPPUNIT_ASSERT(pModelObj); + ScDocument* pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + insertStringToCell(*pModelObj, "A1", "1"); + insertStringToCell(*pModelObj, "A2", "2"); + insertStringToCell(*pModelObj, "B1", "3"); + insertStringToCell(*pModelObj, "B2", "4"); + + ScDBData* pDBData = new ScDBData("testDB", 0, 0, 0, 1, 1); + bool bInserted + = pDoc->GetDBCollection()->getNamedDBs().insert(std::unique_ptr<ScDBData>(pDBData)); + CPPUNIT_ASSERT(bInserted); + + insertNewSheet(*pDoc); + uno::Sequence<beans::PropertyValue> aArgs( + comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(2)) } })); + dispatchCommand(mxComponent, ".uno:Remove", aArgs); + + ScDBCollection* pDBs = pDoc->GetDBCollection(); + CPPUNIT_ASSERT(!pDBs->empty()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx index 3fce7c714423..ef0902aab3f4 100644 --- a/sc/source/core/tool/refupdat.cxx +++ b/sc/source/core/tool/refupdat.cxx @@ -291,8 +291,6 @@ ScRefUpdateRes ScRefUpdate::Update( const ScDocument* pDoc, UpdateRefMode eUpdat eRet = UR_INVALID; theTab2 = theTab1; } - else if (bCut2 && theTab2 == 0) - eRet = UR_INVALID; else if ( bCut1 || bCut2 ) eRet = UR_UPDATED; if ( bExp )
