From 29c32bf317d57e6b9d7895e2cbdfcc0c9d8bbb56 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 8 Dec 2024 19:41:44 +0200 Subject: [PATCH] make conversion operator explicit so less invisible behaviour Change-Id: I497763cb4be554ddbd00831458f162d9d975742e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178115 Reviewed-by: Noel Grandin Tested-by: Jenkins --- sw/inc/pagedesc.hxx | 2 +- sw/source/core/undo/SwUndoPageDesc.cxx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index a7769da69218..f2da66539b96 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -395,7 +395,7 @@ public: OUString const & GetName() const; - operator SwPageDesc() const; // #i7983# + explicit operator SwPageDesc() const; // #i7983# }; namespace sw { diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx index c97318d2030e..51cac584daf4 100644 --- a/sw/source/core/undo/SwUndoPageDesc.cxx +++ b/sw/source/core/undo/SwUndoPageDesc.cxx @@ -231,7 +231,7 @@ void SwUndoPageDesc::UndoImpl(::sw::UndoRedoContext &) // Move (header/footer)content node responsibility from new page descriptor to old one again. if( m_bExchange ) ExchangeContentNodes( m_aNew.m_PageDesc, m_aOld.m_PageDesc ); - m_pDoc->ChgPageDesc(m_aOld.GetName(), m_aOld); + m_pDoc->ChgPageDesc(m_aOld.GetName(), SwPageDesc(m_aOld)); ExitHeaderFooterEdit(); } @@ -240,7 +240,7 @@ void SwUndoPageDesc::RedoImpl(::sw::UndoRedoContext &) // Move (header/footer)content node responsibility from old page descriptor to new one again. if( m_bExchange ) ExchangeContentNodes( m_aOld.m_PageDesc, m_aNew.m_PageDesc ); - m_pDoc->ChgPageDesc(m_aNew.GetName(), m_aNew); + m_pDoc->ChgPageDesc(m_aNew.GetName(), SwPageDesc(m_aNew)); ExitHeaderFooterEdit(); } @@ -280,7 +280,7 @@ void SwUndoPageDescCreate::UndoImpl(::sw::UndoRedoContext &) void SwUndoPageDescCreate::DoImpl() { - SwPageDesc aPageDesc = m_aNew; + SwPageDesc aPageDesc(m_aNew); m_pDoc->MakePageDesc(m_aNew.GetName(), &aPageDesc, false); } @@ -320,7 +320,7 @@ SwUndoPageDescDelete::~SwUndoPageDescDelete() void SwUndoPageDescDelete::UndoImpl(::sw::UndoRedoContext &) { - SwPageDesc aPageDesc = m_aOld; + SwPageDesc aPageDesc(m_aOld); m_pDoc->MakePageDesc(m_aOld.GetName(), &aPageDesc, false); }