sc/source/ui/view/cellsh2.cxx |   49 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

New commits:
commit 15eaef1fbabc9cb5f91238c6bb2e4f312c938117
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Mon Mar 14 21:55:59 2022 +0100
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Thu Mar 17 14:48:16 2022 +0100

    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/+/131564
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Mert Tumer <mert.tu...@collabora.com>

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
                                 {

Reply via email to