[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/inc sc/qa sc/source
sc/inc/column.hxx|2 sc/inc/document.hxx |2 sc/inc/table.hxx |2 sc/qa/unit/tiledrendering/tiledrendering.cxx | 66 --- sc/source/core/data/column3.cxx | 54 +++--- sc/source/core/data/documen3.cxx |8 +-- sc/source/core/data/table3.cxx |4 - sc/source/ui/app/inputhdl.cxx| 44 ++ sc/source/ui/view/gridwin.cxx|2 9 files changed, 64 insertions(+), 120 deletions(-) New commits: commit 1e033fe1f270e7a76cb8821af9ceb1c096403442 Author: Dennis Francis AuthorDate: Mon Oct 11 16:27:57 2021 +0530 Commit: Dennis Francis CommitDate: Tue Oct 12 09:59:57 2021 +0200 calc: revert changes in autoinput This is a combination of 4 commits. Revert "autocomplete: allow cycling through possible matches" This reverts commit 299227ad81d4a44556fda8cca7b8b79219ba7e6c. Revert "tdf#142214: autoinput: remove search/entry count limits" This reverts commit ebff4e5181b102e5184277f57fda32fcce60431f. Revert "tdf#142214: unit-tests for new behaviour of auto-complete" This reverts commit 06c360d4d27ab0dadfdcd5f9d4f0c87288d3cb75. Revert "tdf#142214: show autocompletion only if there is..." This reverts commit f8039c6d645acb015a6c4e45000bbfd1311bfea3. Change-Id: Ief45d79d3a0ffac79d57e590c984d09aa9c38fc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123381 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas Reviewed-by: Jan Holesovsky diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 72527a76cd9e..07b8f061bd88 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -538,7 +538,7 @@ public: sc::ColumnBlockConstPosition& rBlockPos, SCROW nStartRow, SCROW nEndRow, ScFilterEntries& rFilterEntries, bool bFiltering ); -bool GetDataEntries( SCROW nRow, std::set& rStrings) const; +bool GetDataEntries( SCROW nRow, std::set& rStrings, bool bLimit ) const; void UpdateInsertTabAbs(SCTAB nNewPos); boolTestTabRefAbs(SCTAB nTable) const; diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 7c798cf08674..61770da26d71 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -2095,7 +2095,7 @@ public: ScFilterEntries& rFilterEntries ); void GetDataEntries( SCCOL nCol, SCROW nRow, SCTAB nTab, - std::vector& rStrings, bool bValidation = false ); + std::vector& rStrings, bool bLimit = false ); void GetFormulaEntries( ScTypedCaseStrSet& rStrings ); bool HasAutoFilter( SCCOL nCol, SCROW nRow, SCTAB nTab ); diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index c3ba8d112e9d..a4e41a7bc318 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -963,7 +963,7 @@ public: void GetFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, ScFilterEntries& rFilterEntries, bool bFiltering = false); void GetFilteredFilterEntries(SCCOL nCol, SCROW nRow1, SCROW nRow2, const ScQueryParam& rParam, ScFilterEntries& rFilterEntries, bool bFiltering ); [[nodiscard]] -bool GetDataEntries(SCCOL nCol, SCROW nRow, std::set& rStrings); +bool GetDataEntries(SCCOL nCol, SCROW nRow, std::set& rStrings, bool bLimit); boolHasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const; boolHasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const; diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 8a722c2b8a29..ed35b29e7a63 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -47,7 +47,6 @@ #include #include #include -#include using namespace css; @@ -114,7 +113,6 @@ public: void testSpellOnlineRenderParameter(); void testPasteIntoWrapTextCell(); void testSortAscendingDescending(); -void testAutoInputExactMatch(); void testMoveShapeHandle(); void testEditCursorBounds(); void testTextSelectionBounds(); @@ -166,7 +164,6 @@ public: CPPUNIT_TEST(testSpellOnlineRenderParameter); CPPUNIT_TEST(testPasteIntoWrapTextCell); CPPUNIT_TEST(testSortAscendingDescending); -CPPUNIT_TEST(testAutoInputExactMatch); CPPUNIT_TEST(testMoveShapeHandle); CPPUNIT_TEST(testEditCursorBounds); CPPUNIT_TEST(testTextSelectionBounds); @@ -2634,69 +2631,6 @@ void ScTiledRenderingTest::testSortAscendingDescending() CPPUNIT_ASSERT_EQUAL(OString("rows"), aView.m_sInvalidateSheetGeometry); } -void lcl_typeCharsInCell(const std::string& aStr, SCCOL nCol, SCROW nRow, ScTabViewShell* pView, ScModelObj* pModelObj) -{ -pView->SetCursor(nCo
[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/inc sc/qa sc/source
sc/inc/column.hxx| 17 - sc/inc/document.hxx | 23 - sc/inc/sortparam.hxx | 69 sc/inc/table.hxx | 24 + sc/qa/unit/ucalc_sort.cxx|8 sc/source/core/data/column2.cxx | 81 ++--- sc/source/core/data/document.cxx |5 sc/source/core/data/sortparam.cxx| 41 +- sc/source/core/data/table1.cxx | 56 ++- sc/source/core/data/table3.cxx | 338 +++ sc/source/filter/xml/XMLExportDatabaseRanges.cxx |2 sc/source/ui/app/transobj.cxx| 22 + sc/source/ui/dbgui/tpsort.cxx| 12 sc/source/ui/docshell/dbdocfun.cxx | 64 +++- sc/source/ui/undo/undosort.cxx | 15 - sc/source/ui/unoobj/datauno.cxx |4 sc/source/ui/view/cellsh2.cxx| 12 sc/source/ui/view/gridwin.cxx|6 18 files changed, 518 insertions(+), 281 deletions(-) New commits: commit fff92a72443842dda94a36fba753673066aeb399 Author: Eike Rathke AuthorDate: Sun Sep 12 20:15:01 2021 +0200 Commit: Mike Kaganski CommitDate: Wed Sep 15 18:54:15 2021 +0200 Resolves: tdf#144135 Rework Sort with area extras Since commit 774a61afa9fc281290e7bfad4e28c05978b82d73 CommitDate: Wed Apr 14 08:46:03 2021 +0200 tdf#126678 - Consider "Include formats" option during sort a sheet formatted with visible attributes like cell background colour up to the end if for Sort all columns and/or rows are selected lead to an excessive memory allocation and slow execution time if it didn't get killed by the operating system before due to memory exhaustion. The same could had happened already before if graphics or comments were to be included that could had resulted in a similar large range. However, cell formats across sheets are more likely. This changes the strategy how the to be sorted data range is determined (range only with data) and additional area extras ranges without data that are only to be rearranged. Those are then processed in chunks (limited to ~512MB per chunk). Cell formats that are identical within one column's rows range do not even need to be covered as they are not rearranged, in the best case leading to all trailing formats' ranges being excluded from the sort. Additionally optimize the cell gathering of formats, graphics and comments such that for the area extras they are only collected if actually requested. The overall performance gain is in an order of magnitudes even if some extras are to be collected. Change-Id: If3abbaeaa615aaff7d88a82a5b3fc7ac633d770d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122013 Reviewed-by: Eike Rathke Tested-by: Jenkins (cherry picked from commit 0a9b68c9f9880655576e3220d8b70064b367dbee) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121981 Reviewed-by: Mike Kaganski diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 20ae065c1613..72527a76cd9e 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -218,19 +218,16 @@ public: // data only: boolIsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const; SCSIZE GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const; -boolHasDataAt(SCROW nRow, bool bConsiderCellNotes = false, - bool bConsiderCellDrawObjects = false, bool bConsiderCellFormats = false) const; -boolHasDataAt(sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow, - bool bConsiderCellNotes = false, bool bConsiderCellDrawObjects = false, - bool bConsiderCellFormats = false) const; -boolHasDataAt(sc::ColumnBlockPosition& rBlockPos, SCROW nRow, bool bConsiderCellNotes = false, - bool bConsiderCellDrawObjects = false, bool bConsiderCellFormats = false); +boolHasDataAt( SCROW nRow, ScDataAreaExtras* pDataAreaExtras = nullptr ) const; +boolHasDataAt( sc::ColumnBlockConstPosition& rBlockPos, SCROW nRow, + ScDataAreaExtras* pDataAreaExtras = nullptr ) const; +boolHasDataAt( sc::ColumnBlockPosition& rBlockPos, SCROW nRow, + ScDataAreaExtras* pDataAreaExtras = nullptr ); +voidGetDataExtrasAt( SCROW nRow, ScDataAreaExtras& rDataAreaExtras ) const; boolHasVisibleDataAt(SCROW nRow) const; SCROW GetFirstDataPos() const; SCROW GetLastDataPos() const; -SCROW GetLastDataPos(SCROW nLastRow, bool bConsiderCellNotes = false, - bool bConsiderCellDrawObjects = false, -
[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/inc sc/qa sc/source
sc/inc/dbdata.hxx|8 ++-- sc/qa/unit/uicalc/uicalc.cxx | 26 + sc/source/core/tool/dbdata.cxx | 77 ++- sc/source/core/tool/refupdat.cxx | 10 - 4 files changed, 74 insertions(+), 47 deletions(-) New commits: commit 957d1e977d25385151c99e401124ad58217e53dd Author: Tünde Tóth AuthorDate: Wed Jul 21 16:04:37 2021 +0200 Commit: Xisco Fauli CommitDate: Tue Aug 17 16:02:17 2021 +0200 tdf#126926 sc DBData: delete the database range if some part of the reference became invalid. Change-Id: I4b10af46e92a0a1ba9b6eb5e49df1d3f9a4be6a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119354 Tested-by: Jenkins Reviewed-by: Eike Rathke (cherry picked from commit 0c0444c44107f1a18f23dd0833d462d8dbf56569) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120235 Reviewed-by: Xisco Fauli diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index c1e714fc3e9f..8ecd2faf602f 100644 --- a/sc/inc/dbdata.hxx +++ b/sc/inc/dbdata.hxx @@ -208,10 +208,9 @@ public: voidSetModified(bool bMod) { bModified = bMod; } voidUpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos ); -voidUpdateReference(const ScDocument* pDoc, UpdateRefMode eUpdateRefMode, -SCCOL nCol1, SCROW nRow1, SCTAB nTab1, -SCCOL nCol2, SCROW nRow2, SCTAB nTab2, -SCCOL nDx, SCROW nDy, SCTAB nDz); +boolUpdateReference(const ScDocument* pDoc, UpdateRefMode eUpdateRefMode, SCCOL nCol1, +SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, +SCCOL nDx, SCROW nDy, SCTAB nDz); void ExtendDataArea(const ScDocument& rDoc); void CalcSaveFilteredCount(SCSIZE nNonFilteredRowCount); @@ -296,6 +295,7 @@ public: void deleteOnTab(SCTAB nTab); ScDBData* getByRange(const ScRange& rRange); void insert(ScDBData* p); +void erase(const iterator& itr); bool empty() const; bool has( const ScDBData* p ) const; bool operator== (const AnonDBs& r) const; diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 432d4d600771..7e089d16dc82 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -1675,6 +1675,32 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126540_GridToggleModifiesTheDocument) CPPUNIT_ASSERT(pDocSh->IsModified()); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126926) +{ +mxComponent = loadFromDesktop("private:factory/scalc"); +ScModelObj* pModelObj = dynamic_cast(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(pDBData)); +CPPUNIT_ASSERT(bInserted); + +goToCell("A1:B1"); + +dispatchCommand(mxComponent, ".uno:DeleteColumns", {}); + +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/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index ba68d1aa0d8a..4e38b2aaa676 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -586,7 +586,7 @@ void ScDBData::UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos) } -void ScDBData::UpdateReference(const ScDocument* pDoc, UpdateRefMode eUpdateRefMode, +bool ScDBData::UpdateReference(const ScDocument* pDoc, UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, SCCOL nDx, SCROW nDy, SCTAB nDz) @@ -601,10 +601,13 @@ void ScDBData::UpdateReference(const ScDocument* pDoc, UpdateRefMode eUpdateRefM theTab2 = theTab1; SCCOL nOldCol1 = theCol1, nOldCol2 = theCol2; -bool bDoUpdate = ScRefUpdate::Update( pDoc, eUpdateRefMode, -nCol1,nRow1,nTab1, nCol2,nRow2,nTab2, nDx,nDy,nDz, -theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 ) != UR_NOTHING; -if (bDoUpdate) +ScRefUpdateRes eRet += ScRefUpdate::Update(pDoc, eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, + nDy, nDz, theCol1, theRow1, theTab1, theCol2, theRow2, theTab2); + +bool bDoUpdate = eRet != UR_NOTHING; + +if (bDoUpdate && eRet != UR_INVALID) { // MoveTo() invalidates column names via SetArea(); adj
[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/inc sc/qa sc/source
sc/inc/queryentry.hxx|3 sc/inc/typedstrdata.hxx |9 +- sc/qa/uitest/autofilter/autofilter.py| 73 ++- sc/source/core/data/column3.cxx |9 +- sc/source/core/data/table3.cxx | 32 +- sc/source/core/tool/queryentry.cxx |2 sc/source/core/tool/typedstrdata.cxx | 37 +++ sc/source/filter/xml/XMLExportDatabaseRanges.cxx | 34 +- sc/source/filter/xml/xmlfilti.cxx| 21 +- sc/source/ui/cctrl/checklistmenu.cxx |4 - sc/source/ui/dbgui/filtdlg.cxx |1 sc/source/ui/inc/checklistmenu.hxx |6 - sc/source/ui/unoobj/datauno.cxx |6 - sc/source/ui/view/gridwin.cxx| 20 -- 14 files changed, 122 insertions(+), 135 deletions(-) New commits: commit 3069df790cca2917e5aedd87bac1af65f9605d51 Author: Balazs Varga AuthorDate: Fri Jul 2 09:40:32 2021 +0200 Commit: Xisco Fauli CommitDate: Thu Jul 8 09:50:09 2021 +0200 tdf#142910 sc filter: fix "greater than" or "smaller than" etc Filter "greater than" or "smaller than" (>, <, >=, <=) conditions according to the cell number format. Regression from commit: d5c2584bf36d21580db677b231c57f99f49aa2cb (Related: tdf#140968 avoid duplicated filter values) Follow-up to commit: 1f755525189884e4b2824889a6b9dea8933402db (tdf#142402 sc UI: store formatted values in standard filter) Clean-up for commit: d5c2584bf36d21580db677b231c57f99f49aa2cb (Related: tdf#140968 avoid duplicated filter values) Change-Id: I1284892398c9964ca5407b4d617a617f20341107 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118272 Tested-by: Jenkins Tested-by: László Németh Reviewed-by: László Németh Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118593 diff --git a/sc/inc/queryentry.hxx b/sc/inc/queryentry.hxx index 1855744f78f7..94ea761c1239 100644 --- a/sc/inc/queryentry.hxx +++ b/sc/inc/queryentry.hxx @@ -48,10 +48,9 @@ struct SC_DLLPUBLIC ScQueryEntry doublemfVal; svl::SharedString maString; bool mbMatchEmpty; -bool mbFormattedValue; Color maColor; -Item() : meType(ByValue), mfVal(0.0), mbMatchEmpty(false), mbFormattedValue(false) {} +Item() : meType(ByValue), mfVal(0.0), mbMatchEmpty(false) {} bool operator== (const Item& r) const; }; diff --git a/sc/inc/typedstrdata.hxx b/sc/inc/typedstrdata.hxx index 50a7effea87e..7c7b1c7e45d4 100644 --- a/sc/inc/typedstrdata.hxx +++ b/sc/inc/typedstrdata.hxx @@ -24,14 +24,14 @@ public: Header = 4 }; -ScTypedStrData( const OUString& rStr, double nVal = 0.0, StringType eType = Standard, -bool bDate = false, bool mbIsFormatted = false, bool bDuplicated = false ); +ScTypedStrData( const OUString& rStr, double fVal = 0.0, double fRVal = 0.0, StringType eType = Standard, +bool bDate = false ); bool IsDate() const { return mbIsDate;} const OUString& GetString() const { return maStrValue;} StringType GetStringType() const { return meStrType;} double GetValue() const { return mfValue; } -bool IsDuplicated() const { return mbIsDuplicated; } +double GetRoundedValue() const { return mfRoundedValue; } struct LessCaseSensitive { @@ -58,10 +58,9 @@ public: private: OUString maStrValue; double mfValue; +double mfRoundedValue; // rounded value by format code StringType meStrType; bool mbIsDate; -bool mbIsFormatted; // true if the cell value is a formatted filter value -bool mbIsDuplicated; // true if the cell has a formatted filter value and has at least one duplicate formatted value. }; class FindTypedStrData diff --git a/sc/qa/uitest/autofilter/autofilter.py b/sc/qa/uitest/autofilter/autofilter.py index 060ada717844..7c8078c702c5 100644 --- a/sc/qa/uitest/autofilter/autofilter.py +++ b/sc/qa/uitest/autofilter/autofilter.py @@ -469,20 +469,8 @@ class AutofilterTest(UITestCase): xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") -xGridWin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"})) -xFloatWindow = self.xUITest.getFloatWindow() -#Choose Standard Filter... button -xMenu = xFloatWindow.getChild("menu") - -xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"})) -xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"})) -xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"})) -xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"})) -xMenu.executeAction("TYPE", mkPropertyValues({"KEYCODE":"DOWN"})) -