diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2022-03-14 21:55:59 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-03-17 14:48:16 +0100 |
commit | 15eaef1fbabc9cb5f91238c6bb2e4f312c938117 (patch) | |
tree | e2e51902dd2f0c1c932d85ed64ab1ed048e15b20 /sc | |
parent | 639a610b9e04c4374d168185099ae5baa7454f6f (diff) |
tdf#147761 record sort command in macros
fixes regression introduced in:
commit 70b81e74d2a14308e1897d840c681404225d328a
author Szymon Kłos <szymon.klos@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/+/131564
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Mert Tumer <mert.tumer@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/cellsh2.cxx | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index f71b8f3678e4..e61f948847ff 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -529,6 +529,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.bIncludeComments ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_INCIMAGES, + rOutParam.bIncludeGraphicObjects ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_ATTRIBS, + rOutParam.bIncludePattern ) ); + 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 { |