From 632290663a9d2bc722ddfb96aec049d7362204d6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 14 Mar 2013 22:35:43 -0400 Subject: Call CellStorageModified() *after* the text widths get modified. So that I can put some integrity check code in there to test the integrity of cell storage. Change-Id: I0cc141ea74c27db1a014390b7abf807220e7be9f --- sc/source/core/data/column.cxx | 18 +++++++++--------- sc/source/core/data/column3.cxx | 16 +++++++--------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 682afc66d116..e778f964483d 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -852,7 +852,6 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2) be performed (but keep broadcasters and notes at old position). */ maItems[nIndex1].pCell = pCell2; maItems[nIndex2].pCell = pCell1; - CellStorageModified(); SvtBroadcaster* pBC2 = pCell2->ReleaseBroadcaster(); pCell1->TakeBroadcaster( pBC2 ); @@ -863,6 +862,7 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2) unsigned short nVal2 = maTextWidths.get(nRow2); maTextWidths.set(nRow1, nVal2); maTextWidths.set(nRow2, nVal1); + CellStorageModified(); } else { @@ -874,19 +874,18 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2) { // insert dummy note cell (without note) containing old broadcaster maItems[nIndex1].pCell = pDummyCell; - CellStorageModified(); } else { // remove ColEntry at old position maItems.erase( maItems.begin() + nIndex1 ); - CellStorageModified(); } // Empty text width at the cell 1 position. For now, we don't // transfer the old value to the cell 2 position since Insert() is // quite complicated. maTextWidths.set_empty(nRow1, nRow1); + CellStorageModified(); // insert ColEntry at new position. Insert( nRow2, pCell1 ); @@ -1013,14 +1012,14 @@ void ScColumn::SwapCell( SCROW nRow, ScColumn& rCol) pFmlaCell2->UpdateReference(URM_MOVE, aRange, -dx, 0, 0); } - CellStorageModified(); - rCol.CellStorageModified(); - // Swap the text widths. unsigned short nVal1 = maTextWidths.get(nRow); unsigned short nVal2 = rCol.maTextWidths.get(nRow); maTextWidths.set(nRow, nVal2); rCol.maTextWidths.set(nRow, nVal1); + + CellStorageModified(); + rCol.CellStorageModified(); } else { @@ -1037,8 +1036,9 @@ void ScColumn::SwapCell( SCROW nRow, ScColumn& rCol) pFmlaCell1->UpdateReference(URM_MOVE, aRange, dx, 0, 0); } - CellStorageModified(); maTextWidths.set_empty(nRow, nRow); + CellStorageModified(); + // We don't transfer the text width to the destination column because // of Insert()'s complexity. @@ -1189,8 +1189,8 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize ) pDocument->SetAutoCalc( bOldAutoCalc ); - CellStorageModified(); maTextWidths.insert_empty(nStartRow, nSize); + CellStorageModified(); } @@ -1691,8 +1691,8 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol) if (bErased) { - CellStorageModified(); maTextWidths.set_empty(nStartRow, nEndRow); + CellStorageModified(); } } } diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 57b5370dcfef..cc25641893a2 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -88,17 +88,16 @@ void ScColumn::Insert( SCROW nRow, ScBaseCell* pNewCell ) } pOldCell->Delete(); maItems[nIndex].pCell = pNewCell; - CellStorageModified(); } else { maItems.insert(maItems.begin() + nIndex, ColEntry()); maItems[nIndex].pCell = pNewCell; maItems[nIndex].nRow = nRow; - CellStorageModified(); } maTextWidths.set(nRow, TEXTWIDTH_DIRTY); + CellStorageModified(); } // When we insert from the Clipboard we still have wrong (old) References! // First they are rewired in CopyBlockFromClip via UpdateReference and the @@ -142,8 +141,8 @@ void ScColumn::Append( SCROW nRow, ScBaseCell* pCell ) maItems.back().pCell = pCell; maItems.back().nRow = nRow; - CellStorageModified(); maTextWidths.set(nRow, TEXTWIDTH_DIRTY); + CellStorageModified(); } @@ -156,7 +155,6 @@ void ScColumn::Delete( SCROW nRow ) ScBaseCell* pCell = maItems[nIndex].pCell; ScNoteCell* pNoteCell = new ScNoteCell; maItems[nIndex].pCell = pNoteCell; // Dummy for Interpret - CellStorageModified(); pDocument->Broadcast( ScHint( SC_HINT_DYING, ScAddress( nCol, nRow, nTab ), pCell ) ); if ( SvtBroadcaster* pBC = pCell->ReleaseBroadcaster() ) @@ -167,13 +165,13 @@ void ScColumn::Delete( SCROW nRow ) { pNoteCell->Delete(); maItems.erase( maItems.begin() + nIndex); - CellStorageModified(); // Should we free memory here (delta)? It'll be slower! } pCell->EndListeningTo( pDocument ); pCell->Delete(); maTextWidths.set_empty(nRow, nRow); + CellStorageModified(); } } @@ -191,8 +189,8 @@ void ScColumn::DeleteAtIndex( SCSIZE nIndex ) pCell->EndListeningTo( pDocument ); pCell->Delete(); - CellStorageModified(); maTextWidths.set_empty(nRow, nRow); + CellStorageModified(); } @@ -202,8 +200,8 @@ void ScColumn::FreeAll() maItems[i].pCell->Delete(); maItems.clear(); - CellStorageModified(); maTextWidths.clear(); + CellStorageModified(); } @@ -502,8 +500,8 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe if (bRemoved) nShift += maItems.size() - nStartSegment; maItems.erase(maItems.end() - nShift, maItems.end()); - CellStorageModified(); maTextWidths.set_empty(nStartRow, nEndRow); + CellStorageModified(); } // *** delete all formula cells *** @@ -1430,8 +1428,8 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, pOldCell->Delete(); maItems[i].pCell = pNewCell; // Replace + maTextWidths.set(nRow, TEXTWIDTH_DIRTY); CellStorageModified(); - SetTextWidth(nRow, TEXTWIDTH_DIRTY); if ( pNewCell->GetCellType() == CELLTYPE_FORMULA ) { -- cgit ice-7-4+backports LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-08-24Resolves: tdf#162597 'ok' in chart range dialog doesn't commit datarangeCaolán McNamara
so nothing happens. since: commit 4965b055b5998dc345ecaeb80fc8c3874b19e2a5 CommitDate: Fri Feb 16 12:08:55 2024 +0100 Chart: Make Data Range Dialog Async async conversion missed that there is a DataSourceDialog::run override so the use of asyncRun means the body of that isn't run. To keep things simple we can add an explicit 'ok' handler and move the special dialog ok code into that instead, so all the existing asyncRun's used with this dialog run the same code originally called in the previous non-async case. Change-Id: Ibdb4b764b1a1e48c01ee1528bc260f694e840221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172336 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-05-07loplugin:ostr in chart2Noel Grandin
Change-Id: I2985b6793a776639214a25bf9732c000b9026bfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167236 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
2024-04-09tdf#146619 Drop unused 'using namespace' in: chart2/Gabor Kelemen
Change-Id: I632d0dda0e62e5b1bf0956e731ab5ed6417db1ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165688 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2024-03-27tdf#146619 Remove unused #includes from C/C++ filesRafał Dobrakowski
'chart2' module was cleaned. Change-Id: Ib4cdb3c8a21d0ed47f4970894d416327df5e68a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164864 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2023-04-20Run clang-tidy with misc-unused-using-decls on modules [a-c]*Gabor Kelemen
To remove unneeded using declarations. Via the simple script: for i in $(find $dirname -name "*cxx" -o -name "*hxx" ); do clang-tidy-12 --checks="-*,misc-unused-using-decls" "$i"; done Change-Id: I95871cc0ae6f22a9684bae9d14ef0475aea17abb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150608 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2023-04-02Avoid conversions between OUString and OString in VCLMike Kaganski
Standardize on OUString, which is the main internal string class. Convert from/to OUString only when communicating with respective external APIs. Removes about 200 conversions from the code. Change-Id: I96ecee7c6fd271bb76639220e96d69d2964bed26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149930 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-21move getTemplate inside chart2::DiagramNoel Grandin
Change-Id: I05da4e4a9acb2683633eda42cf18d740913c2e37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149180 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-23Recheck module chart2 with IWYUGabor Kelemen
See tdf#42949 for motivation Change-Id: Id4cdca3eed8618c289f30913d506f8f2bd46f0bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133112 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-02-17loplugin:unusedfieldsNoel Grandin
Change-Id: I07ec409ea3663e789b6505dbfc999666525ed97f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130062 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-25use more concrete types in chart2, DiagramNoel Grandin
Change-Id: I40cd39d0878dc56e4e86e05149c9744cb563d745 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128942 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-21Removed duplicated includesAndrea Gelmini
Change-Id: I9f8350f44952692a9efef297792a2326086d3d91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128704 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-01-20use more concrete types in chart2, ChartModelNoel Grandin
Change-Id: Ie38d941f855978b04995162040d8871a2577255c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128641 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-19use more concrete types in chart2, ChartTypeTemplateNoel Grandin
and return data using a little struct rather than std::pair, to make the call sites read a little better. Change-Id: Ieb6fc24e053f50823789167ed0112aa04a083725 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128613 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-01-19use more concrete types in chart2, ChartTypeTemplateNoel Grandin
Change-Id: I1bfbc81ca0d44efc669e5bc2b525cfa8b51be1ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128561 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>