include/vcl/weld.hxx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
New commits: commit b87eae151aa7a9dbeca6b8f09ffd366f367ba0bc Author: Stephan Bergmann <stephan.bergm...@collabora.com> AuthorDate: Thu Jul 31 10:16:27 2025 +0200 Commit: Stephan Bergmann <stephan.bergm...@collabora.com> CommitDate: Thu Jul 31 14:19:22 2025 +0200 Fix use of incomplete type weld::Button ...after 668fa8bde1263a7f4f2c2c8ddf1bff2f396f93ce "tdf#130857 weld: Implement Dialog::set_default_response in base class", > In file included from vcl/source/accessibility/vclxaccessiblecomponent.cxx:23: > In file included from workdir/UnoApiHeadersTarget/offapi/normal/com/sun/star/accessibility/AccessibleRelationType.hpp:8: > In file included from include/com/sun/star/uno/Type.hxx:31: > In file included from include/com/sun/star/uno/Type.h:28: > In file included from include/rtl/ustring.hxx:45: > In file included from include/rtl/string.hxx:51: > In file included from include/rtl/stringconcat.hxx:22: > In file included from ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.0/../../../../include/c++/16.0.0/memory:80: > ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.0/../../../../include/c++/16.0.0/bits/unique_ptr.h:91:16: error: invalid application of 'sizeof' to an incomplete type 'weld::Button' > 91 | static_assert(sizeof(_Tp)>0, > | ^~~~~~~~~~~ > ~/gcc/inst/lib/gcc/x86_64-pc-linux-gnu/16.0.0/../../../../include/c++/16.0.0/bits/unique_ptr.h:399:4: note: in instantiation of member function 'std::default_delete<weld::Button>::operator()' requested here > 399 | get_deleter()(std::move(__ptr)); > | ^ > include/vcl/weld.hxx:668:49: note: in instantiation of member function 'std::unique_ptr<weld::Button>::~unique_ptr' requested here > 668 | std::unique_ptr<weld::Button> pButton = weld_button_for_response(nResponse); > | ^ > include/vcl/weld.hxx:624:7: note: forward declaration of 'weld::Button' > 624 | class Button; > | ^ (There appears to be no corresponding weld.cxx in vcl, so for simplicity keep the definition of the virtual function inline in weld.hxx.) Change-Id: I21efa2cfca389931f5bf90ae08fe57eb1233a301 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188647 Reviewed-by: Stephan Bergmann <stephan.bergm...@collabora.com> Tested-by: Jenkins diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index eff338581ab4..31aa0dbaab16 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -663,11 +663,7 @@ public: virtual void change_default_button(weld::Button* pOld, weld::Button* pNew) = 0; virtual bool is_default_button(const weld::Button* pCandidate) const = 0; - virtual void set_default_response(int nResponse) - { - std::unique_ptr<weld::Button> pButton = weld_button_for_response(nResponse); - change_default_button(nullptr, pButton.get()); - } + virtual inline void set_default_response(int nResponse); // shrink the dialog down to shown just these widgets virtual void collapse(weld::Widget* pEdit, weld::Widget* pButton) = 0; @@ -2947,6 +2943,12 @@ public: virtual Dialog* getDialog() override; SAL_DLLPRIVATE virtual ~AssistantController() override; }; + +void Dialog::set_default_response(int nResponse) +{ + std::unique_ptr<weld::Button> pButton = weld_button_for_response(nResponse); + change_default_button(nullptr, pButton.get()); +} } #endif