Kaydet (Commit) 5209f21b authored tarafından Eike Rathke's avatar Eike Rathke

Resolves: tdf#117372 preserve preselected sort area, if so, then extend or not

Previously if an entire column was selected, the top data row was
taken and then that X,Y position used to extend to the data area.
Else the current view's X,Y was used to extend to the data area.

Now keep a selection and use current X,Y only if there is no area
selected.

Change-Id: I19ce52bc2ebf4813b779600a4738ed1f82643aa7
Reviewed-on: https://gerrit.libreoffice.org/55348Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst c25b63b4
......@@ -151,7 +151,15 @@ static bool lcl_GetSortParam( const ScViewData* pData, const ScSortParam& rSortP
SCSIZE nCount = pDoc->GetEmptyLinesInBlock( rSortParam.nCol1, rSortParam.nRow1, nTab,
rSortParam.nCol2, rSortParam.nRow2, nTab, eFillDir );
aExternalRange = ScRange( rSortParam.nCol1,
::std::min( rSortParam.nRow1 + sal::static_int_cast<SCROW>( nCount ), MAXROW), nTab );
::std::min( rSortParam.nRow1 + sal::static_int_cast<SCROW>( nCount ), MAXROW), nTab,
rSortParam.nCol2, rSortParam.nRow2, nTab);
aExternalRange.PutInOrder();
}
else if (rSortParam.nCol1 != rSortParam.nCol2 || rSortParam.nRow1 != rSortParam.nRow2)
{
// Preserve a preselected area.
aExternalRange = ScRange( rSortParam.nCol1, rSortParam.nRow1, nTab, rSortParam.nCol2, rSortParam.nRow2, nTab);
aExternalRange.PutInOrder();
}
else
aExternalRange = ScRange( pData->GetCurX(), pData->GetCurY(), nTab );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment