sfx2: fix mysterious -Werror=shadow

GCC 14 now mysteriously finds a -Wshadow here but not in the many other
SfxChildWindow subclass member functions that have a parameter named
"pParent":

  sw/source/uibase/sidebar/QuickFindPanel.cxx: In constructor ‘sw::sidebar::QuickFindPanelWrapper::QuickFindPanelWrapper(vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo*)’:
  sw/source/uibase/sidebar/QuickFindPanel.cxx:115:59: error: declaration of ‘pParent’ shadows a member of ‘sw::sidebar::QuickFindPanelWrapper’ [-Werror=shadow]
  115 | QuickFindPanelWrapper::QuickFindPanelWrapper(vcl::Window* pParent, sal_uInt16 nId,
      |                                              ~~~~~~~~~~~~~^~~~~~~
  In file included from include/sfx2/quickfind.hxx:13,
                 from sw/source/uibase/inc/QuickFindPanel.hxx:13,
                 from sw/source/uibase/sidebar/QuickFindPanel.cxx:11:
  include/sfx2/childwin.hxx:102:32: note: shadowed declaration is here
  102 |     VclPtr<vcl::Window>        pParent;         // parent window ( Topwindow )
      |                                ^~~~~~~

Change-Id: I98228f312308ee69a17af34bb31a5d4109b06ad9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189017
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
(cherry picked from commit a8c445bb1ecf5a68c3925e3ab19d08f0b44644c9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193750
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@collabora.com>
This commit is contained in:
Michael Stahl
2025-11-10 19:22:41 +01:00
parent f2f320b98b
commit 6c6c5227f3
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -98,7 +98,7 @@ extern SFX2_DLLPUBLIC bool ParentIsFloatingWindow(const vcl::Window *pParent);
class SFX2_DLLPUBLIC SfxChildWindow
{
VclPtr<vcl::Window> pParent; // parent window ( Topwindow )
VclPtr<vcl::Window> m_pParent; // parent window (Topwindow)
VclPtr<vcl::Window> pWindow; // actual contents
std::unique_ptr< SfxChildWindow_Impl> pImpl; // Implementation data
std::shared_ptr<SfxDialogController> xController; // actual contents
@@ -124,7 +124,7 @@ public:
std::shared_ptr<SfxDialogController>& GetController() { return xController; }
const std::shared_ptr<SfxDialogController>& GetController() const { return xController; }
vcl::Window* GetParent() const
{ return pParent; }
{ return m_pParent; }
SfxChildAlignment GetAlignment() const
{ return eChildAlignment; }
void SetAlignment(SfxChildAlignment eAlign);
+2 -2
View File
@@ -144,8 +144,8 @@ bool GetSplitSizeFromString( std::u16string_view rStr, Size& rSize )
return false;
}
SfxChildWindow::SfxChildWindow(vcl::Window *pParentWindow, sal_uInt16 nId)
: pParent(pParentWindow)
SfxChildWindow::SfxChildWindow(vcl::Window *const pParent, sal_uInt16 nId)
: m_pParent(pParent)
, pImpl(new SfxChildWindow_Impl)
, eChildAlignment(SfxChildAlignment::NOALIGNMENT)
, nType(nId)