Description: The file crashes when copying the selected document fragment not from the beginning of the line with the transition to the next paragraph, if was open the "Accessibility check" tab. It looks like the problem is in lines like this: SwWrtShell* pWrtShell = rDocument.GetDocShell()->GetWrtShell(); In the problematic case, rDocument.GetDocShell() returns nullptr, which causes the program to crash when calling GetWrtShell(). Perhaps the code needs an additional check for nullptr, as is done here, a little lower: SwDocShell* pShell = pDoc->GetDocShell(); if (!pShell) return; Steps to Reproduce: 1. Open the file.odt or .docx 2. Open the "Accessibility check" tab 3. Select several paragraphs of the text, starting not from the beginning of the line 4. Try to copy the selected text Actual Results: The file is crashing Expected Results: The text is being copied Reproducible: Always User Profile Reset: No Additional Info: Previously, we wrote in the related PR: Bug tdf#162889, but decided to create a new one, because there is no promotion. First repro on master: Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 245a20b6093237fc247f9515e37dc70556448812 CPU threads: 12; OS: Linux 6.6; UI render: default; VCL: gtk3 Locale: ru-RU (ru_RU.UTF-8); UI: en-US Calc: CL threaded
Created attachment 197166 [details] Playback Steps
Most reported crash at the moment, Increasing importance
My take on it: https://gerrit.libreoffice.org/c/core/+/175338
(In reply to Xisco Faulí from comment #3) > My take on it: https://gerrit.libreoffice.org/c/core/+/175338 Thanks a lot Xisco for fixing it.
(In reply to Balázs Varga (allotropia) from comment #4) > (In reply to Xisco Faulí from comment #3) > > My take on it: https://gerrit.libreoffice.org/c/core/+/175338 > > Thanks a lot Xisco for fixing it. Hi Balázs, I'm very sorry I didn't realize the ticket was already assigned to you. I hope i'm not stepping on your toes on this...
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c796878e6af0fc7c886e813a0010d9402312eb5c tdf#163543: check GetDocShell() It will be available in 25.2.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.
Xisco Fauli committed a patch related to this issue. It has been pushed to "libreoffice-24-8": https://git.libreoffice.org/core/commit/e827d051971a331c16bca8a58ab1c921736810ee tdf#163543: check GetDocShell() It will be available in 24.8.3. 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.