Files
odfstudio/sc
Stephan Bergmann da6eea908e Fix heap-use-after-free
...as uncovered by 448426998cc561414ec250d0dc7f0a72ea10c757 "lsan:fix leak of
VbaEventsHelperBase instances" in UITest_calc_tests9,

> ==3008693==ERROR: AddressSanitizer: heap-use-after-free on address 0x7c90789fc488 at pc 0x7b70220491ba bp 0x7ffc8e6e67a0 sp 0x7ffc8e6e6798
> READ of size 8 at 0x7c90789fc488 thread T0
>  #0 in osl::Mutex::release() at include/osl/mutex.hxx:77:37
>  #1 in osl::Guard<osl::Mutex>::~Guard() at include/osl/mutex.hxx:146:17
>  #2 in ScVbaEventListener::processWindowResizeEvent(void*) at sc/source/ui/vba/vbaeventshelper.cxx:515:1
>  #3 in ScVbaEventListener::LinkStubprocessWindowResizeEvent(void*, void*) at sc/source/ui/vba/vbaeventshelper.cxx:478:32
>  #4 in Link<void*, void>::Call(void*) const at include/tools/link.hxx:105:45
>  #5 in ImplHandleUserEvent(ImplSVEvent*) at vcl/source/window/winproc.cxx:2311:30
>  #6 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at vcl/source/window/winproc.cxx:2868:13
>  #7 in SalFrame::CallCallback(SalEvent, void const*) const at vcl/inc/salframe.hxx:310:29
>  #8 in SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) at vcl/headless/svpinst.cxx:289:22
>  #9 in non-virtual thunk to SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) at vcl/headless/svpinst.cxx
>  #10 in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const at vcl/source/app/salusereventlist.cxx:119:58
>  #11 in SalUserEventList::DispatchUserEvents(bool) at vcl/source/app/salusereventlist.cxx:120:13
>  #12 in SvpSalInstance::ImplYield(bool, bool) at vcl/headless/svpinst.cxx:442:22
>  #13 in SvpSalInstance::DoYield(bool, bool) at vcl/headless/svpinst.cxx:519:21
>  #14 in InnerYield(bool, bool) at vcl/source/app/svapp.cxx:389:48
>  #15 in Application::Yield() at vcl/source/app/svapp.cxx:502:5
>  #16 in Application::Execute() at vcl/source/app/svapp.cxx:364:13
>  #17 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1681:13
>
> 0x7c90789fc488 is located 72 bytes inside of 264-byte region [0x7c90789fc440,0x7c90789fc548)
> freed by thread T0 here:
>  #0 in free at ~/github.com/llvm/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:51:3
>  #1 in rtl_freeMemory at sal/rtl/alloc_global.cxx:43:5
>  #2 in cppu::OWeakObject::operator delete(void*) at include/cppuhelper/weak.hxx:88:11
>  #3 in ScVbaEventListener::~ScVbaEventListener() at sc/source/ui/vba/vbaeventshelper.cxx:120:7
>  #4 in cppu::OWeakObject::release() at cppuhelper/source/weak.cxx:230:9
>  #5 in cppu::WeakImplHelper<com::sun::star::awt::XTopWindowListener, com::sun::star::awt::XWindowListener, com::sun::star::frame::XBorderResizeListener, com::sun::star::util::XChangesListener>::release() at include/cppuhelper/implbase.hxx:115:66
>  #6 in ScVbaEventListener::processWindowResizeEvent(void*) at sc/source/ui/vba/vbaeventshelper.cxx:514:5

Signed-off-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Change-Id: I150e2b0da80aa816c3c4b9650ee92d0604e14790
(cherry-picked from commit I150e2b0da80aa816c3c4b9650ee92d0604e14790)
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2310
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205024
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2026-05-10 15:14:33 +02:00
..
2026-02-04 14:02:17 +01:00
2026-05-10 15:14:33 +02:00
…
2024-11-28 12:38:02 +01:00
2024-11-28 12:38:02 +01:00
2026-03-04 12:37:18 +01:00
2026-03-04 12:37:18 +01:00
…
2026-02-04 14:02:17 +01:00
2025-05-13 09:23:06 +02:00

Spreadsheet Application Code

You can dump some information in a dbgutil build:

Shortcuts

CTRL+SHIFT+F12

Dumps the column width of the first 20 columns.

CTRL+SHIFT+F11

Dumps the graphic objects and their position and size in pixel.

CTRL+SHIFT+F6

Dumps the SfxItemSet representing the cell properties' of the current selection as a xml file. The file will be named dump.xml

The Cache Format

ScDocument::StoreTabToCache allows storing the content (not the formatting) of a table to a binary cache format.

The format is column orientated which allows quick serialization of the table.

  • Header:

    • Number of Columns: 64 bit unsigned integer
  • Column:

    • Column Index: 64 bit unsigned integer
    • Column Size: 64 bit unsigned integer
    • For each cell type block a new ColumnBlock
  • ColumnBlock:

    • Start Row: 64 bit unsigned integer
    • Block Size: 64 bit unsigned integer
    • Type: 8 bit unsigned integer
      • 0 : empty
      • 1 : numeric
        • for each cell: 64 bit IEEE 754 double precision value
      • 2 : string
        • for each cell: 32 bit signed string length followed by string length bytes of the string (UTF-8)
      • 3 : formula
        • for each cell: 32 bit signed string length followed by the formula in R1C1 notation as a string

Functions Supporting Wildcards or Regular Expressions

As this comes up every now and then, and rather should be documented in an extra list of the Help system, functions that support Wildcards or Regular Expressions and depend on the setting under Tools -> Options -> Calc -> Calculate are those that in ODF OpenFormula (ODFF) are defined to depend on the HOST-USE-REGULAR-EXPRESSIONS or HOST-USE-WILDCARDS properties, see ODF v1.3 part4 3.4 Host-Defined Behaviors https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part4-formula/OpenDocument-v1.3-os-part4-formula.html#__RefHeading__1017868_715980110

  • Array Functions
    • CHOOSECOLS
    • CHOOSEROWS
    • DROP
    • EXPAND
    • HSTACK
    • VSTACK
    • TAKE
    • TEXTSPLIT
    • TOCOL
    • TOROW
    • WRAPCOLS
    • WRAPROWS
  • Database Functions
    • DAVERAGE
    • DCOUNT
    • DCOUNTA
    • DGET
    • DMAX
    • DMIN
    • DPRODUCT
    • DSTDEV
    • DSTDEVP
    • DSUM
    • DVAR
    • DVARP
  • Information Functions
    • COUNTIF
    • COUNTIFS
  • Lambda Functions
    • LET
  • Lookup Functions
    • HLOOKUP
    • LOOKUP
    • MATCH
    • XMATCH
    • VLOOKUP
    • XLOOKUP
    • FILTER
    • SORT
    • SORTBY
    • UNIQUE
  • Mathematical Functions
    • RANDARRAY
    • SEQUENCE
    • SUMIF
    • SUMIFS
  • Statistical Functions
    • AVERAGEIF
    • AVERAGEIFS
  • Text Functions
    • SEARCH