Steps to reproduce 1) From any LO app, open the Basic IDE (Tools - Macros - Edit Macros) 2) Create a new dialog (Dialog - Organize Dialogs - New) 3) Open the newly created dialog by double-clicking it in the Object Catalog 4) Insert a button with default settings (to do that, use the control toolbar; press the "Button" tool while holding the Ctrl key) 5) The new control will be created in the middle of the dialog 6) Now try to drag this control to position it anywhere else 7) CRASH Problem happens in: Version: 7.6.4.1 (X86_64) / LibreOffice Community Build ID: 60(Build:1) CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb) Locale: pt-BR (pt_BR.UTF-8); UI: en-US Ubuntu package version: 4:7.6.4-0ubuntu0.23.10.1 Calc: threaded
Created attachment 192020 [details] Backtrace This problem also happens in the current master. Here's a backtrace using "make debugrun" Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 7850a7deb59b890c73dfd52bd5aced6a538e6349 CPU threads: 16; OS: Linux 6.5; UI render: default; VCL: kf5 (cairo+xcb) Locale: pt-BR (pt_BR.UTF-8); UI: en-US Calc: CL threaded
Created attachment 192021 [details] bt On pc Debian x86-64 with master sources updated today, I could reproduce this. I also noticed this log on console: warn:legacy.tools:64615:64615:basctl/source/dlged/dlgedobj.cxx:143: lcl_getDlgEdForm: no form!
With this patch, it doesn't crash and the button moves: diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx index 5b87393e51bc..74e8fde38488 100644 --- a/basctl/source/dlged/dlgedobj.cxx +++ b/basctl/source/dlged/dlgedobj.cxx @@ -931,7 +931,8 @@ void DlgEdObj::NbcMove( const Size& rSize ) StartListening(); // dialog model changed - GetDlgEdForm()->GetDlgEditor().SetDialogModelChanged(); + if (GetDlgEdForm()) + GetDlgEdForm()->GetDlgEditor().SetDialogModelChanged(); } void DlgEdObj::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract) @@ -948,7 +949,8 @@ void DlgEdObj::NbcResize(const Point& rRef, const Fraction& xFract, const Fracti StartListening(); // dialog model changed - GetDlgEdForm()->GetDlgEditor().SetDialogModelChanged(); + if (GetDlgEdForm()) + GetDlgEdForm()->GetDlgEditor().SetDialogModelChanged(); } bool DlgEdObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) (I can also resize it) Now, as often, perhaps I'm just hiding the real pb.
(In reply to Julien Nabet from comment #3) > Now, as often, perhaps I'm just hiding the real pb. So... the real problem is that the object does not have a parent form upon creation. The patch below fixes the problem: diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx index 2eb099718b5b..a91a6511bd50 100644 --- a/basctl/source/dlged/dlged.cxx +++ b/basctl/source/dlged/dlged.cxx @@ -620,6 +620,8 @@ void DlgEditor::CreateDefaultObject() // set default property values pDlgEdObj->SetDefaults(); + // set the form to which the new object belongs + pDlgEdObj->SetDlgEdForm(pDlgEdForm.get()); // insert object into drawing page SdrPageView* pPageView = pDlgEdView->GetSdrPageView(); I'll publish it on Gerrit.
Proposed patch here: https://gerrit.libreoffice.org/c/core/+/162217
Rafael Lima committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c4e5b1b934fc3c59fb35ae6c02a0ddf8501a6d28 tdf#159247 Fix crash while adding control with default properties (Dialog Editor) It will be available in 24.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Rafael Lima committed a patch related to this issue. It has been pushed to "libreoffice-24-2": https://git.libreoffice.org/core/commit/8472ffa70887b8f68d7e8f17faef377a83b0695e tdf#159247 Fix crash while adding control with default properties (Dialog Editor) It will be available in 24.2.1. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Rafael Lima committed a patch related to this issue. It has been pushed to "libreoffice-7-6": https://git.libreoffice.org/core/commit/3fd80b31eb997847e04571b21ec512928a70bf81 tdf#159247 Fix crash while adding control with default properties (Dialog Editor) It will be available in 7.6.5. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.