sc/source/ui/docshell/dbdocfun.cxx | 2 +- sc/source/ui/docshell/docsh5.cxx | 11 ++++++----- sc/source/ui/inc/docsh.hxx | 2 +- sc/source/ui/undo/undobase.cxx | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-)
New commits: commit 015578db97bec8926441a9440de6067937f63143 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Wed May 10 14:54:27 2017 +0200 partial revert of "loplugin:checkunusedparams in sc(part4)" <erAck> noelgrandin: actually that "also fix bug in ScDocShell::DBAreaDeleted" with 4d047221945b34a9023d852bbd19a2a24a7f54c3 wasn't a bug because the aDocument.RemoveFlagsTab() call with ScMF::Auto removes the AutoFilter which is in the first row of the DB-Area <erAck> noelgrandin: now it unnecessarily processes the entire range <noelgrandin> erAck, does that also apply to the PostPaint call? <erAck> noelgrandin: should so, as only the row with the AF-buttons needs to be repainted <noelgrandin> erAck, will revert that part Change-Id: I29b9ee4e1b6517a01bf67f8efc09217d9df453a5 diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 54de8108b568..cce0b5f4e6ad 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -256,7 +256,7 @@ void ScDBDocFunc::ModifyAllDBData( const ScDBCollection& rNewColl, const std::ve const ScAddress& rStart = iter->aStart; const ScAddress& rEnd = iter->aEnd; rDocShell.DBAreaDeleted( - rStart.Tab(), rStart.Col(), rStart.Row(), rEnd.Col(), rEnd.Row()); + rStart.Tab(), rStart.Col(), rStart.Row(), rEnd.Col()); } if (bRecord) diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index f69cbeb66f5c..d247d39ab25d 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -96,11 +96,12 @@ bool ScDocShell::IsEditable() const return !IsReadOnly() || aDocument.IsImportingXML() || aDocument.IsChangeReadOnlyEnabled(); } -void ScDocShell::DBAreaDeleted( SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 ) +void ScDocShell::DBAreaDeleted( SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2 ) { ScDocShellModificator aModificator( *this ); - aDocument.RemoveFlagsTab( nX1, nY1, nX2, nY2, nTab, ScMF::Auto ); - PostPaint( nX1, nY1, nTab, nX2, nY2, nTab, PaintPartFlags::Grid ); + // the auto-filter is in the first row of the area + aDocument.RemoveFlagsTab( nX1, nY1, nX2, nY1, nTab, ScMF::Auto ); + PostPaint( nX1, nY1, nTab, nX2, nY1, nTab, PaintPartFlags::Grid ); // No SetDocumentModified, as the unnamed database range might have to be restored later. // The UNO hint is broadcast directly instead, to keep UNO objects in valid state. aDocument.BroadcastUno( SfxHint( SfxHintId::DataChanged ) ); @@ -254,7 +255,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe nStartCol <= nOldY2 && nOldY1 <= nEndCol) bHasHeader = true; - DBAreaDeleted( nOldTab, nOldX1, nOldY1, nOldX2, nOldY2 ); + DBAreaDeleted( nOldTab, nOldX1, nOldY1, nOldX2 ); pNoNameData->SetSortParam( ScSortParam() ); // reset parameter pNoNameData->SetQueryParam( ScQueryParam() ); @@ -365,7 +366,7 @@ void ScDocShell::CancelAutoDBRange() SCROW nRangeY2; SCTAB nRangeTab; pDBData->GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 ); - DBAreaDeleted( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 ); + DBAreaDeleted( nRangeTab, nRangeX1, nRangeY1, nRangeX2 ); *pDBData = *pOldAutoDBRange; // restore old settings diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index ca86aa8b2ac1..43204614e26d 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -282,7 +282,7 @@ public: void UpdateOle( const ScViewData* pViewData, bool bSnapSize = false); bool IsOle(); - void DBAreaDeleted( SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 ); + void DBAreaDeleted( SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2 ); ScDBData* GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGetDBSelection eSel ); ScDBData* GetAnonymousDBData(const ScRange& rRange); ScDBData* GetOldAutoDBRange(); // has to be deleted by caller! diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index af9849a509a6..71b8751f396d 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -549,7 +549,7 @@ void ScDBFuncUndo::EndUndo() SCROW nRangeY2; SCTAB nRangeTab; pNoNameData->GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 ); - pDocShell->DBAreaDeleted( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 ); + pDocShell->DBAreaDeleted( nRangeTab, nRangeX1, nRangeY1, nRangeX2 ); *pNoNameData = *pAutoDBRange; @@ -582,7 +582,7 @@ void ScDBFuncUndo::BeginRedo() SCROW nRangeY2; SCTAB nRangeTab; pNoNameData->GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 ); - pDocShell->DBAreaDeleted( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 ); + pDocShell->DBAreaDeleted( nRangeTab, nRangeX1, nRangeY1, nRangeX2 ); pNoNameData->SetSortParam( ScSortParam() ); pNoNameData->SetQueryParam( ScQueryParam() ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits