include/vcl/weld.hxx             |   14 ++++++++++++--
 sd/source/ui/unoidl/unomodel.cxx |   33 ++++++++++++++++++---------------
 2 files changed, 30 insertions(+), 17 deletions(-)

New commits:
commit 34dfea68f77bf54ff45e32bf0e5ce6a4088ba8f8
Author:     Michael Weghorn <[email protected]>
AuthorDate: Mon Nov 17 09:49:14 2025 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Mon Nov 17 11:54:13 2025 +0100

    tdf#130857 weld: Block signals in SpinButton::set_value
    
    As is the case in other weld methods, signals about
    SpinButton value changes are not supposed to be
    emitted when the change happens programatically
    and not by manual user interaction.
    
    Therefore, disable notify events in that method
    and return early in weld::SpinButton::signal_value_changed
    when signals are currently blocked.
    
    See also
    
        commit c0e7bf13239fadcb2db434ee80cd7d212646748f
        Author: Michael Weghorn <[email protected]>
        Date:   Tue Oct 21 21:24:25 2025 +0200
    
            tdf#130857 qt weld: Don't call Entry::signal_changed while blocked
    
    for a similar earlier change.
    
    The vcl implementation doesn't emit the signal
    and the GTK implementation of the called
    GtkInstanceSpinButton::set_floating_point_value
    already explicitly blocked signals, so no change
    in behavior is expected for these.
    
    For the Qt implementation, signals would prevously
    be emitted, causing a crash in a WIP branch
    declaring support for the dialog that can be triggered
    as follows:
    
    * start Writer
    * in "Tools" -> "Customize" add a menu entry for
      the "Drop Caps" command and close dialog using "OK"
    * trigger the newly added "Drop Caps" menu entry
      to open the dialog
    
    Backtrace:
    
        Thread 1 received signal SIGABRT, Aborted.
        __pthread_kill_implementation (threadid=<optimized out>, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
        warning: 44     ./nptl/pthread_kill.c: No such file or directory
        (rr) bt
        #0  __pthread_kill_implementation (threadid=<optimized out>, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
        #1  0x00007f70a109e9ff in __pthread_kill_internal (threadid=<optimized 
out>, signo=6) at ./nptl/pthread_kill.c:89
        #2  0x00007f70a1049cc2 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
        #3  0x00007f70a10324ac in __GI_abort () at ./stdlib/abort.c:73
        #4  0x00007f70a1032420 in __assert_fail_base (fmt=<optimized out>, 
assertion=<optimized out>, file=<optimized out>, line=234, function=<optimized 
out>) at ./assert/assert.c:118
        #5  0x00007f705dc5dcd3 in SwDropCapsPict::UpdatePaintSettings 
(this=0x55d0ec09aac8) at 
/home/michi/development/git/libreoffice/sw/source/ui/chrdlg/drpcps.cxx:234
        #6  0x00007f705dc5e371 in SwDropCapsPict::SetLines 
(this=0x55d0ec09aac8, nL=3 '') at 
/home/michi/development/git/libreoffice/sw/source/ui/chrdlg/drpcps.cxx:81
        #7  0x00007f705dc62475 in SwDropCapsPage::ModifyEntry 
(this=0x55d0ec09aa20, rEdit=...) at 
/home/michi/development/git/libreoffice/sw/source/ui/chrdlg/drpcps.cxx:681
        #8  0x00007f705dc61ce4 in SwDropCapsPage::ValueChangedHdl 
(this=0x55d0ec09aa20, rEdit=...) at 
/home/michi/development/git/libreoffice/sw/source/ui/chrdlg/drpcps.cxx:695
        #9  0x00007f705dc6096d in SwDropCapsPage::LinkStubValueChangedHdl 
(instance=0x55d0ec09aa20, data=...) at 
/home/michi/development/git/libreoffice/sw/source/ui/chrdlg/drpcps.cxx:693
        #10 0x00007f708f0f43a1 in Link<weld::SpinButton&, void>::Call 
(this=0x55d0ec0adf60, data=...) at include/tools/link.hxx:105
        #11 0x00007f708f0f3d5c in weld::SpinButton::signal_value_changed 
(this=0x55d0ec0adf58) at include/vcl/weld.hxx:2191
        #12 0x00007f708f0ef9bd in QtInstanceSpinButton::handleValueChanged 
(this=0x55d0ec0add40) at vcl/qt6/../qt5/QtInstanceSpinButton.cxx:128
        #13 0x00007f708f0f4791 in 
QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, 
void, void (QtInstanceSpinButton::*)()>::call(void (QtInstanceSpinButton::*)(), 
QtInstanceSpinButton*, void**)::{lambda()#1}::operator()() const 
(this=0x7fff3b9f8d50) at 
/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:127
        #14 0x00007f708f0f46c9 in 
QtPrivate::FunctorCallBase::call_internal<void, 
QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, 
void, void (QtInstanceSpinButton::*)()>::call(void (QtInstanceSpinButton::*)(), 
QtInstanceSpinButton*, void**)::{lambda()#1}>(void**, 
QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, 
void, void (QtInstanceSpinButton::*)()>::call(void (QtInstanceSpinButton::*)(), 
QtInstanceSpinButton*, void**)::{lambda()#1}&&) (args=0x7fff3b9f9130, fn=...) 
at 
/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:65
        #15 0x00007f708f0f45fb in 
QtPrivate::FunctorCall<std::integer_sequence<unsigned long>, QtPrivate::List<>, 
void, void (QtInstanceSpinButton::*)()>::call(void (QtInstanceSpinButton::*)(), 
QtInstanceSpinButton*, void**)
            (f=(void (QtInstanceSpinButton::*)(class QtInstanceSpinButton * 
const)) 0x7f708f0ef980 <QtInstanceSpinButton::handleValueChanged()>, 
o=0x55d0ec0add40, arg=0x7fff3b9f9130)
            at 
/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:126
        #16 0x00007f708f0f457d in QtPrivate::FunctionPointer<void 
(QtInstanceSpinButton::*)()>::call<QtPrivate::List<>, void>(void 
(QtInstanceSpinButton::*)(), QtInstanceSpinButton*, void**)
            (f=(void (QtInstanceSpinButton::*)(class QtInstanceSpinButton * 
const)) 0x7f708f0ef980 <QtInstanceSpinButton::handleValueChanged()>, 
o=0x55d0ec0add40, arg=0x7fff3b9f9130)
            at 
/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:174
        #17 0x00007f708f0f44a6 in QtPrivate::QCallableObject<void 
(QtInstanceSpinButton::*)(), QtPrivate::List<>, void>::impl(int, 
QtPrivate::QSlotObjectBase*, QObject*, void**, bool*)
            (which=1, this_=0x55d0ec0ae290, r=0x55d0ec0add40, a=0x7fff3b9f9130, 
ret=0x0) at 
/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobjectdefs_impl.h:545
        #18 0x00007f708dee9782 in QtPrivate::QSlotObjectBase::call 
(this=0x55d0ec0ae290, r=0x55d0ec0add40, a=0x7fff3b9f9130) at 
qtbase/src/corelib/kernel/qobjectdefs_impl.h:461
        #19 0x00007f708e115512 in doActivate<false> (sender=0x55d0ec15b6b0, 
signal_index=9, argv=0x7fff3b9f9130) at 
/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4356
        #20 0x00007f708e10bbd3 in QMetaObject::activate (sender=0x55d0ec15b6b0, 
m=0x7f708cb80c68 <QDoubleSpinBox::staticMetaObject>, local_signal_index=0, 
argv=0x7fff3b9f9130)
            at 
/home/michi/development/git/qt5/qtbase/src/corelib/kernel/qobject.cpp:4416
        #21 0x00007f708c132c3b in QMetaObject::activate<void, double> 
(sender=0x55d0ec15b6b0, mo=0x7f708cb80c68 <QDoubleSpinBox::staticMetaObject>, 
local_signal_index=0, ret=0x0, args=@0x7fff3b9f9170: 3)
            at qtbase/src/corelib/kernel/qobjectdefs.h:319
        #22 0x00007f708c3aae5a in QDoubleSpinBox::valueChanged 
(this=0x55d0ec15b6b0, _t1=3) at 
qtbase/src/widgets/Widgets_autogen/include/moc_qspinbox.cpp:367
        #23 0x00007f708c3aadc0 in QDoubleSpinBoxPrivate::emitSignals 
(this=0x55d0ec169960, ep=EmitIfChanged, old=...) at 
/home/michi/development/git/qt5/qtbase/src/widgets/widgets/qspinbox.cpp:1196
        #24 0x00007f708c39b76d in QAbstractSpinBoxPrivate::setValue 
(this=0x55d0ec169960, val=..., ep=EmitIfChanged, doUpdate=true) at 
/home/michi/development/git/qt5/qtbase/src/widgets/widgets/qabstractspinbox.cpp:1780
        #25 0x00007f708c3a8b64 in QDoubleSpinBox::setValue 
(this=0x55d0ec15b6b0, value=3) at 
/home/michi/development/git/qt5/qtbase/src/widgets/widgets/qspinbox.cpp:666
        #26 0x00007f708f0f2054 in 
QtInstanceSpinButton::set_floating_point_value(double)::$_0::operator()() const 
(this=0x7fff3b9f9478) at vcl/qt6/../qt5/QtInstanceSpinButton.cxx:55
        #27 0x00007f708f0f2025 in std::__invoke_impl<void, 
QtInstanceSpinButton::set_floating_point_value(double)::$_0&>(std::__invoke_other,
 QtInstanceSpinButton::set_floating_point_value(double)::$_0&) (__f=...)
            at 
/usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/bits/invoke.h:63
        #28 0x00007f708f0f1fd5 in std::__invoke_r<void, 
QtInstanceSpinButton::set_floating_point_value(double)::$_0&>(QtInstanceSpinButton::set_floating_point_value(double)::$_0&)
 (__fn=...)
            at 
/usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/bits/invoke.h:113
        #29 0x00007f708f0f1eed in std::_Function_handler<void(), 
QtInstanceSpinButton::set_floating_point_value(double)::$_0>::_M_invoke 
(__functor=...) at 
/usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/bits/std_function.h:292
        #30 0x00007f708f0304be in std::function<void()>::operator() 
(this=0x7fff3b9f9478) at 
/usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/bits/std_function.h:593
        #31 0x00007f708f0275ff in QtInstance::RunInMainThread 
(this=0x55d0e42bd490, func=...) at vcl/qt6/../qt5/QtInstance.cxx:206
        #32 0x00007f708f0f07db in 
QtInstanceSpinButton::set_floating_point_value (this=0x55d0ec0add40, fValue=3) 
at vcl/qt6/../qt5/QtInstanceSpinButton.cxx:55
        #33 0x00007f705dc57d2a in weld::SpinButton::set_value 
(this=0x55d0ec0adf58, value=3) at include/vcl/weld.hxx:2236
        #34 0x00007f705dc61381 in SwDropCapsPage::Reset (this=0x55d0ec09aa20, 
rSet=0x7fff3b9f9d90) at 
/home/michi/development/git/libreoffice/sw/source/ui/chrdlg/drpcps.cxx:556
        #35 0x00007f709d2c05e0 in SfxSingleTabDialogController::SetTabPage 
(this=0x55d0ec1cea30, xTabPage=std::unique_ptr<SfxTabPage> = {...}) at 
/home/michi/development/git/libreoffice/sfx2/source/dialog/basedlgs.cxx:273
        #36 0x00007f705dc5f949 in SwDropCapsDlg::SwDropCapsDlg 
(this=0x55d0ec1cea30, pParent=0x55d0eadee790, rSet=SfxItemSet of pool 
0x55d0e5c65a80 with parent 0x0 and Which ranges: [(71, 71), (180, 180)])
        [...]
    
    Change-Id: I498831292c05ebfd3a96955c3e2908f6c095dd48
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194097
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index a6b3e022533e..850b7321ddbb 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2188,7 +2188,12 @@ class VCL_DLLPUBLIC SpinButton : virtual public Entry
     }
 
 protected:
-    void signal_value_changed() { m_aValueChangedHdl.Call(*this); }
+    void signal_value_changed()
+    {
+        if (notify_events_disabled())
+            return;
+        m_aValueChangedHdl.Call(*this);
+    }
 
     /** If a custom value formatter was set via <a>set_value_formatter</a>,
      *  that one gets called to create a text representation of the value
@@ -2233,7 +2238,12 @@ protected:
     virtual void get_floating_point_increments(double& rStep, double& rPage) 
const = 0;
 
 public:
-    void set_value(sal_Int64 value) { 
set_floating_point_value(convert_value_to_double(value)); }
+    void set_value(sal_Int64 value)
+    {
+        disable_notify_events();
+        set_floating_point_value(convert_value_to_double(value));
+        enable_notify_events();
+    }
 
     sal_Int64 get_value() const { return 
convert_double_to_value(get_floating_point_value()); }
 
commit 5151649ec7a575cf6a7e382da005191f0250f42c
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Oct 13 12:39:09 2025 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Nov 17 11:54:03 2025 +0100

    abandon early if slide has no page
    
    which can only happen if the slide is disposing/disposed
    
    Change-Id: I8fd72bff93f72e4a9c5ed827905c58db2a56fdb2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192282
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194100
    Tested-by: Jenkins

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 772d41f64c2b..b1809543b825 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -4637,10 +4637,16 @@ OString SdXImpressDocument::getPresentationInfo(bool 
bAllyState) const
         for (sal_Int32 i = 0; i < nSlideCount; ++i)
         {
             SdGenericDrawPage* pSlide(xDrawPages->getDrawPageByIndex(i));
+            SdPage* pPage = SdPage::getImplementation(pSlide);
+            if (!pPage)
+            {
+                SAL_WARN("sd", "slide: " << i << " is disposed, skipping");
+                continue;
+            }
+
             bool bIsVisible = true; // default visible
             pSlide->getPropertyValue("Visible") >>= bIsVisible;
 
-            SdPage* pPage = SdPage::getImplementation(pSlide);
             if (!bIsVisible)
             {
                 auto aSlideNode = aJsonWriter.startStruct();
@@ -4658,21 +4664,18 @@ OString SdXImpressDocument::getPresentationInfo(bool 
bAllyState) const
                 aJsonWriter.put("index", i);
                 aJsonWriter.put("uniqueID", pPage->GetUniqueID());
 
-                if (pPage)
-                {
-                    auto aName = 
SdDrawPage::getPageApiNameFromUiName(pPage->GetName());
-                    aJsonWriter.put("name", aName);
+                auto aName = 
SdDrawPage::getPageApiNameFromUiName(pPage->GetName());
+                aJsonWriter.put("name", aName);
 
-                    if (bAllyState)
+                if (bAllyState)
+                {
+                    OUStringBuffer aHtml;
+                    SdrOutliner* pOutliner = mpDoc->GetInternalOutliner();
+                    if (pOutliner)
                     {
-                        OUStringBuffer aHtml;
-                        SdrOutliner* pOutliner = mpDoc->GetInternalOutliner();
-                        if (pOutliner)
-                        {
-                            SdHTMLFilter::ExportPage(pOutliner, pPage, aHtml);
-                            aJsonWriter.put("a11y", 
aHtml.makeStringAndClear());
-                            pOutliner->Clear();
-                        }
+                        SdHTMLFilter::ExportPage(pOutliner, pPage, aHtml);
+                        aJsonWriter.put("a11y", aHtml.makeStringAndClear());
+                        pOutliner->Clear();
                     }
                 }
 
@@ -4680,7 +4683,7 @@ OString SdXImpressDocument::getPresentationInfo(bool 
bAllyState) const
                 aJsonWriter.put("empty", bIsDrawPageEmpty);
 
                 // Notes
-                SdPage* pNotesPage = pPage ? 
mpDoc->GetSdPage((pPage->GetPageNum() - 1) >> 1, PageKind::Notes) : nullptr;
+                SdPage* pNotesPage = mpDoc->GetSdPage((pPage->GetPageNum() - 
1) >> 1, PageKind::Notes);
                 if (pNotesPage)
                 {
                     SdrObject* pItObj = nullptr;

Reply via email to