https://bugs.documentfoundation.org/show_bug.cgi?id=135457

            Bug ID: 135457
           Summary: CRASH in a BASIC macro
           Product: LibreOffice
           Version: 7.1.0.0.alpha0+ Master
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: BASIC
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

Created attachment 163960
  --> https://bugs.documentfoundation.org/attachment.cgi?id=163960&action=edit
Some fields to convert to text by macro

When the following BASIC code is executed on the attached document, LibreOffice
crashes:

Sub FieldsToText
  fields = ThisComponent.getTextFields.CreateEnumeration
  Dim map()
  While fields.hasMoreElements
    field = fields.nextElement
    ReDim Preserve map(LBound(map) To UBound(map) + 1)
    map(UBound(map)) = Array(field, field.getPresentation(false))
  Wend
  For i = LBound(map) To UBound(map)
    a = map(i)(0).getAnchor
    If Not (a Is Nothing) Then
      map(i)(0).getAnchor.setString(map(i)(1))
    End If
  Next i
End Sub

Tested with Version: 7.1.0.0.alpha0+ (x64)
Build ID: ed3ccdbde9ace7d2e3d67a9cc83a189cfaf1cad9
CPU threads: 12; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL

The crash seems related to undo data.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to