sc/source/ui/view/cellsh2.cxx | 49 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+)
New commits: commit db61167cdfdde69d115338be7d50447e81b43616 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Mon Mar 14 21:55:59 2022 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Mar 28 12:00:06 2022 +0200 tdf#147761 record sort command in macros fixes regression introduced in: commit 70b81e74d2a14308e1897d840c681404225d328a author Szymon Kłos <szymon.k...@collabora.com> Tue Jul 21 11:40:22 2020 +0200 SfxRequest's Done method records the action. It has to be called. Change-Id: I32529fa11febca3d3829b4afd2cd4e6dd359bf74 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131484 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> (cherry picked from commit eca978841816f833616b4c2334e65aa976a9fb61) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131587 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 0bed3b16141f..8ff829326597 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -526,6 +526,55 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) // subtotal when needed new pTabViewShell->UISort( rOutParam ); + + SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); + if (pViewFrm) + { + SfxRequest aRequest(pViewFrm, SID_SORT); + + if ( rOutParam.bInplace ) + { + aRequest.AppendItem( SfxBoolItem( SID_SORT_BYROW, + rOutParam.bByRow ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_HASHEADER, + rOutParam.bHasHeader ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_CASESENS, + rOutParam.bCaseSens ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_NATURALSORT, + rOutParam.bNaturalSort ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_INCCOMMENTS, + rOutParam.aDataAreaExtras.mbCellNotes ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_INCIMAGES, + rOutParam.aDataAreaExtras.mbCellDrawObjects ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_ATTRIBS, + rOutParam.aDataAreaExtras.mbCellFormats ) ); + sal_uInt16 nUser = rOutParam.bUserDef ? ( rOutParam.nUserIndex + 1 ) : 0; + aRequest.AppendItem( SfxUInt16Item( SID_SORT_USERDEF, nUser ) ); + if ( rOutParam.maKeyState[0].bDoSort ) + { + aRequest.AppendItem( SfxInt32Item( FN_PARAM_1, + rOutParam.maKeyState[0].nField + 1 ) ); + aRequest.AppendItem( SfxBoolItem( FN_PARAM_2, + rOutParam.maKeyState[0].bAscending ) ); + } + if ( rOutParam.maKeyState[1].bDoSort ) + { + aRequest.AppendItem( SfxInt32Item( FN_PARAM_3, + rOutParam.maKeyState[1].nField + 1 ) ); + aRequest.AppendItem( SfxBoolItem( FN_PARAM_4, + rOutParam.maKeyState[1].bAscending ) ); + } + if ( rOutParam.maKeyState[2].bDoSort ) + { + aRequest.AppendItem( SfxInt32Item( FN_PARAM_5, + rOutParam.maKeyState[2].nField + 1 ) ); + aRequest.AppendItem( SfxBoolItem( FN_PARAM_6, + rOutParam.maKeyState[2].bAscending ) ); + } + } + + aRequest.Done(); + } } else {