From 3a2a430ae8e2c1647c18d8904477949f6e2e7941 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Wed, 20 Dec 2017 11:30:36 +0100 Subject: tdf#98931 Consider cell-anchored images when sorting This makes images/draw objects anchored to cells move as any other content when sorting cells. Works for sorting rows and columns. Also fixes a bug where notes attached to cells were not sorted when sorting columns. Change-Id: Id9a56a15f776d5adbe382a9bca167bff48b69a0c Reviewed-on: https://gerrit.libreoffice.org/46838 Tested-by: Jenkins Reviewed-by: Thorsten Behrens Reviewed-by: Eike Rathke Tested-by: Eike Rathke --- sc/inc/column.hxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'sc/inc/column.hxx') diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index ff65fbc3b3a0..67dbda8dc8dd 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -29,6 +29,7 @@ #include "mtvelements.hxx" #include #include +#include #include "attarray.hxx" #include @@ -226,11 +227,13 @@ public: // data only: bool IsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const; SCSIZE GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const; - bool HasDataAt(SCROW nRow) const; + bool HasDataAt(SCROW nRow, bool bConsiderCellNotes=false, + bool bConsiderCellDrawObjects=false) const; bool HasVisibleDataAt(SCROW nRow) const; SCROW GetFirstDataPos() const; SCROW GetLastDataPos() const; - SCROW GetLastDataPos( SCROW nLastRow ) const; + SCROW GetLastDataPos( SCROW nLastRow, bool bConsiderCellNotes=false, + bool bConsiderCellDrawObjects=false ) const; bool GetPrevDataPos(SCROW& rRow) const; bool GetNextDataPos(SCROW& rRow) const; void FindDataAreaPos(SCROW& rRow, bool bDown) const; // (without Broadcaster) @@ -626,6 +629,10 @@ public: void UpdateNoteCaptions( SCROW nRow1, SCROW nRow2 ); + void UpdateDrawObjects( std::vector>& pObjects, SCROW nRowStart, SCROW nRowEnd ); + void UpdateDrawObjectsForRow( std::vector& pObjects, SCCOL nTargetCol, SCROW nTargetRow ); + bool IsDrawObjectsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const; + void InterpretDirtyCells( SCROW nRow1, SCROW nRow2 ); static void JoinNewFormulaCell( const sc::CellStoreType::position_type& aPos, ScFormulaCell& rCell ); -- cgit