sc/source/ui/inc/acredlin.hxx      |    4 ++--
 sc/source/ui/miscdlgs/acredlin.cxx |   37 ++++++++++++-------------------------
 sc/source/ui/view/reffact.cxx      |    4 ++--
 svl/source/crypto/cryptosign.cxx   |    8 --------
 4 files changed, 16 insertions(+), 37 deletions(-)

New commits:
commit 1e072d02b1ec3f7dc2976042eb7fd46d7b776f95
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Wed Apr 30 12:39:04 2025 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Apr 30 15:43:02 2025 +0200

    ScAcceptChgDlg: pass ScViewData by ref
    
    to ensure it's not nullptr
    
    Change-Id: I462633d583c7be3f249427f103215bc76d1c0d45
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184821
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins

diff --git a/sc/source/ui/inc/acredlin.hxx b/sc/source/ui/inc/acredlin.hxx
index f939b92052e5..71d21e455c4f 100644
--- a/sc/source/ui/inc/acredlin.hxx
+++ b/sc/source/ui/inc/acredlin.hxx
@@ -151,10 +151,10 @@ class ScAcceptChgDlg final : public 
SfxModelessDialogController
 
 public:
     ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
-                   ScViewData* ptrViewData);
+                   ScViewData& rViewData);
     virtual ~ScAcceptChgDlg() override;
 
-    void            ReInit(ScViewData* ptrViewData);
+    void            ReInit(ScViewData& rViewData);
 
     void            Initialize (SfxChildWinInfo* pInfo);
     virtual void    FillInfo(SfxChildWinInfo&) const override;
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx 
b/sc/source/ui/miscdlgs/acredlin.cxx
index 66f1b4a1a830..c71bb08d33a2 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -68,13 +68,13 @@ ScRedlinData::~ScRedlinData()
 
 
 ScAcceptChgDlg::ScAcceptChgDlg(SfxBindings* pB, SfxChildWindow* pCW, 
weld::Window* pParent,
-    ScViewData* ptrViewData)
+    ScViewData& rViewData)
     : SfxModelessDialogController(pB, pCW, pParent,
         u"svx/ui/acceptrejectchangesdialog.ui"_ustr, 
u"AcceptRejectChangesDialog"_ustr)
     , aSelectionIdle( "ScAcceptChgDlg  aSelectionIdle" )
     , aReOpenIdle("ScAcceptChgDlg ReOpenIdle")
-    , pViewData( ptrViewData )
-    , pDoc( &ptrViewData->GetDocument() )
+    , pViewData( &rViewData )
+    , pDoc( &rViewData.GetDocument() )
     , aStrInsertCols(ScResId(STR_CHG_INSERT_COLS))
     , aStrInsertRows(ScResId(STR_CHG_INSERT_ROWS))
     , aStrInsertTabs(ScResId(STR_CHG_INSERT_TABS))
@@ -154,13 +154,10 @@ ScAcceptChgDlg::~ScAcceptChgDlg()
     }
 }
 
-void ScAcceptChgDlg::ReInit(ScViewData* ptrViewData)
+void ScAcceptChgDlg::ReInit(ScViewData& rViewData)
 {
-    pViewData=ptrViewData;
-    if (pViewData)
-        pDoc = &ptrViewData->GetDocument();
-    else
-        pDoc = nullptr;
+    pViewData = &rViewData;
+    pDoc = &rViewData.GetDocument();
 
     bNoSelection=false;
     bIgnoreMsg=false;
@@ -172,18 +169,13 @@ void ScAcceptChgDlg::ReInit(ScViewData* ptrViewData)
     ClearView();
     UpdateView();
 
-    if ( pDoc )
-    {
-        ScChangeTrack* pChanges = pDoc->GetChangeTrack();
-        if ( pChanges )
-            pChanges->SetModifiedLink( LINK( this, ScAcceptChgDlg, 
ChgTrackModHdl ) );
-    }
+    ScChangeTrack* pChanges = pDoc->GetChangeTrack();
+    if ( pChanges )
+        pChanges->SetModifiedLink( LINK( this, ScAcceptChgDlg, ChgTrackModHdl 
) );
 }
 
 void ScAcceptChgDlg::Init()
 {
-    OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found!" );
-
     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
 
     if(pChanges!=nullptr)
@@ -731,12 +723,9 @@ void ScAcceptChgDlg::UpdateView()
 
     bUseColor = bFilterFlag;
 
-    if(pDoc!=nullptr)
-    {
-        pChanges=pDoc->GetChangeTrack();
-        if(pChanges!=nullptr)
-            pScChangeAction=pChanges->GetFirst();
-    }
+    pChanges=pDoc->GetChangeTrack();
+    if(pChanges!=nullptr)
+        pScChangeAction=pChanges->GetFirst();
     bool bTheFlag = false;
 
     while(pScChangeAction!=nullptr)
@@ -929,7 +918,6 @@ IMPL_LINK( ScAcceptChgDlg, AcceptHandle, SvxTPView*, pRef, 
void )
 
 void ScAcceptChgDlg::RejectFiltered()
 {
-    if(pDoc==nullptr) return;
     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
     const ScChangeAction* pScChangeAction=nullptr;
 
@@ -949,7 +937,6 @@ void ScAcceptChgDlg::RejectFiltered()
 }
 void ScAcceptChgDlg::AcceptFiltered()
 {
-    if(pDoc==nullptr) return;
     ScChangeTrack* pChanges=pDoc->GetChangeTrack();
     const ScChangeAction* pScChangeAction=nullptr;
 
diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx
index bf08a5d2fe4c..e0d59484182e 100644
--- a/sc/source/ui/view/reffact.cxx
+++ b/sc/source/ui/view/reffact.cxx
@@ -225,7 +225,7 @@ ScAcceptChgDlgWrapper::ScAcceptChgDlgWrapper(vcl::Window* 
pParentP,
     OSL_ENSURE( pViewShell, "missing view shell :-(" );
     if (pViewShell)
     {
-        auto xDlg = std::make_shared<ScAcceptChgDlg>(pBindings, this, 
pParentP->GetFrameWeld(), &pViewShell->GetViewData());
+        auto xDlg = std::make_shared<ScAcceptChgDlg>(pBindings, this, 
pParentP->GetFrameWeld(), pViewShell->GetViewData());
         SetController(xDlg);
         pInfo->nFlags = SfxChildWindowFlags::NEVERHIDE;
         xDlg->Initialize( pInfo );
@@ -244,7 +244,7 @@ void ScAcceptChgDlgWrapper::ReInitDlg()
 
     if (GetController() && pViewShell)
     {
-        
static_cast<ScAcceptChgDlg*>(GetController().get())->ReInit(&pViewShell->GetViewData());
+        
static_cast<ScAcceptChgDlg*>(GetController().get())->ReInit(pViewShell->GetViewData());
     }
 }
 
commit 4b71a526ec6e3ceb4aca8694df4cb64f85412c9c
Author:     Juraj Ĺ arinay <ju...@sarinay.com>
AuthorDate: Thu Jan 16 21:51:42 2025 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Apr 30 15:42:47 2025 +0200

    Do not add a second copy of signer's certificate to CMS SignedData.
    
    Signer's certificate is included in the chain we add as a result of
    NSS_CMSSignerInfo_IncludeCerts(). There is no need to call
    NSS_CMSSignedData_AddCertificate().
    
    Change-Id: I5cbb4c268a79910ea33b06b58e32f40194ca39c8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180515
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/svl/source/crypto/cryptosign.cxx b/svl/source/crypto/cryptosign.cxx
index 3f56377bf903..f0df59708c25 100644
--- a/svl/source/crypto/cryptosign.cxx
+++ b/svl/source/crypto/cryptosign.cxx
@@ -683,14 +683,6 @@ NSSCMSMessage *CreateCMSMessage(const PRTime* time,
         return nullptr;
     }
 
-    if (NSS_CMSSignedData_AddCertificate(*cms_sd, cert) != SECSuccess)
-    {
-        SAL_WARN("svl.crypto", "NSS_CMSSignedData_AddCertificate failed");
-        NSS_CMSSignedData_Destroy(*cms_sd);
-        NSS_CMSMessage_Destroy(result);
-        return nullptr;
-    }
-
     if (NSS_CMSSignedData_AddSignerInfo(*cms_sd, *cms_signer) != SECSuccess)
     {
         SAL_WARN("svl.crypto", "NSS_CMSSignedData_AddSignerInfo failed");

Reply via email to