sc/source/ui/Accessibility/AccessibleCsvControl.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit e8aec9a7c33b827be06bad5155b4d820924885c0 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Wed Jun 4 08:03:26 2025 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Wed Jun 4 10:16:46 2025 +0200 Fix a failed assertion Seen when interacting with CSV import dialog, and selecting fixed width: ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t * file_name, unsigned int line_number) Line 444 sclo.dll!rtl::OUStringBuffer::subView(long beginIndex, long count) Line 1671 sclo.dll!ScAccessibleCsvRuler::getText() Line 424 winaccessibility.dll!AccObject::SetValue(com::sun::star::uno::Any pAny) Line 379 winaccessibility.dll!AccObject::UpdateValue() Line 349 winaccessibility.dll!AccObject::UpdateAccessibleInfoFromUnoToMSAA() Line 759 winaccessibility.dll!AccObjectWinManager::InsertAccObj(com::sun::star::accessibility::XAccessible * pXAcc, com::sun::star::accessibility::XAccessible * pParentXAcc, HWND__ * pWnd) Line 683 winaccessibility.dll!AccEventListener::HandleChildChangedEvent(com::sun::star::uno::Any oldValue, com::sun::star::uno::Any newValue) Line 108 winaccessibility.dll!AccEventListener::notifyEvent(const com::sun::star::accessibility::AccessibleEventObject & aEvent) Line 63 winaccessibility.dll!AccContainerEventListener::notifyEvent(const com::sun::star::accessibility::AccessibleEventObject & aEvent) Line 94 comphelper.dll!comphelper::AccessibleEventNotifier::addEvent(const unsigned long _nClient, const com::sun::star::accessibility::AccessibleEventObject & _rEvent) Line 256 comphelper.dll!comphelper::OAccessibleComponentHelper::NotifyAccessibleEvent(const short _nEventId, const com::sun::star::uno::Any & _rOldValue, const com::sun::star::uno::Any & _rNewValue, long nIndexHint) Line 126 vcllo.dll!VCLXAccessibleComponent::ProcessWindowChildEvent(const VclWindowEvent & rVclWindowEvent) Line 155 vcllo.dll!VCLXAccessibleComponent::WindowChildEventListener(VclWindowEvent & rEvent) Line 114 vcllo.dll!VCLXAccessibleComponent::LinkStubWindowChildEventListener(void * instance, VclWindowEvent & data) Line 104 vcllo.dll!Link<VclWindowEvent &,void>::Call(VclWindowEvent & data) Line 105 vcllo.dll!vcl::Window::CallEventListeners(VclEventId nEvent, void * pData) Line 299 vcllo.dll!vcl::Window::ImplSetReallyVisible() Line 1329 vcllo.dll!vcl::Window::Show(bool bVisible, ShowFlags nFlags) Line 2338 vcllo.dll!SalInstanceWidget::show() Line 404 vcllo.dll!weld::CustomWidgetController::Show() Line 65 sclo.dll!ScCsvTableBox::InitControls() Line 118 sclo.dll!ScCsvTableBox::Refresh() Line 77 sclo.dll!ScCsvTableBox::SetFixedWidthMode() Line 104 scuilo.dll!ScImportAsciiDlg::RbSepFix() Line 882 scuilo.dll!ScImportAsciiDlg::RbSepFixHdl(weld::Toggleable & rButton) Line 891 scuilo.dll!ScImportAsciiDlg::LinkStubRbSepFixHdl(void * instance, weld::Toggleable & data) Line 887 vcllo.dll!Link<weld::Toggleable &,void>::Call(weld::Toggleable & data) Line 105 vcllo.dll!weld::Toggleable::signal_toggled() Line 1595 vcllo.dll!SalInstanceRadioButton::ToggleHdl(RadioButton & __formal) Line 3195 Change-Id: I168fb05d91d42ccde22fa718787c22089d54d2cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186159 Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Tested-by: Jenkins diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index af0fb44c256a..9852d4897e85 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -421,7 +421,9 @@ OUString SAL_CALL ScAccessibleCsvRuler::getText() { SolarMutexGuard aGuard; ensureAlive(); - return OUString(maBuffer.subView( 0, implGetTextLength() )); + // OUStringBuffer.subView asserts on count being not more than available characters; + // better use u16string_view::substr, which allows count greater than available + return OUString(std::u16string_view(maBuffer).substr(0, implGetTextLength())); } OUString SAL_CALL ScAccessibleCsvRuler::getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex )