...given that with 513bfbd476 "Writer: Adapt
'SvxAutoFormat'" an instance of derived class SwBoxAutoFormat can be deleted
through a base pointer to SvxAutoFormatDataField via the dtor of TableStyle,
witness CppunitTest_chart2_geometry failing now with
> ==3389764==ERROR: AddressSanitizer: new-delete-type-mismatch on 0x512001532ec0 in thread T0:
> object passed to delete has wrong type:
> size of the allocated type: 288 bytes;
> size of the deallocated type: 264 bytes.
> #0 0x55be493fb2c8 in operator delete(void*, unsigned long) /home/tdf/lode/packages/llvm-llvmorg-18.1.8.src/compiler-rt/lib/asan/asan_new_delete.cpp:155:3
> #1 0x7fae0ed86fba in std::default_delete<SvxAutoFormatDataField>::operator()(SvxAutoFormatDataField*) const /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/unique_ptr.h:99:2
> #2 0x7fae0ed78c5e in std::unique_ptr<SvxAutoFormatDataField, std::default_delete<SvxAutoFormatDataField>>::~unique_ptr() /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/unique_ptr.h:404:4
> #3 0x7fae0ed729ec in TableStyle::~TableStyle() /include/svx/TableStylesParser.hxx:34:8
> #4 0x7fae0ed85e3c in std::pair<rtl::OUString const, TableStyle>::~pair() /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_iterator.h:2992:12
> #5 0x7fae0ed85de0 in void std::destroy_at<std::pair<rtl::OUString const, TableStyle>>(std::pair<rtl::OUString const, TableStyle>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_construct.h:88:15
> #6 0x7fae0ed85b59 in void std::allocator_traits<std::allocator<std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>>>::destroy<std::pair<rtl::OUString const, TableStyle>>(std::allocator<std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>>&, std::pair<rtl::OUString const, TableStyle>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/alloc_traits.h:560:4
> #7 0x7fae0ed85b59 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_destroy_node(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:625:2
> #8 0x7fae0ed85a70 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_drop_node(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:633:2
> #9 0x7fae0ed85764 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_erase(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:1938:4
> #10 0x7fae0ed85711 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_erase(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:1936:4
> #11 0x7fae0ed85711 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_erase(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:1936:4
> #12 0x7fae0ed85711 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_erase(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:1936:4
> #13 0x7fae0ed85711 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_erase(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:1936:4
> #14 0x7fae0ed85711 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_erase(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:1936:4
> #15 0x7fae0ed85711 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_erase(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:1936:4
> #16 0x7fae0ed85711 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_erase(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:1936:4
> #17 0x7fae0ed85711 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_erase(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:1936:4
> #18 0x7fae0ed85711 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_erase(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:1936:4
> #19 0x7fae0ed85711 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_erase(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:1936:4
> #20 0x7fae0ed85711 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::_M_erase(std::_Rb_tree_node<std::pair<rtl::OUString const, TableStyle>>*) /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:1936:4
> #21 0x7fae0ed85644 in std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, TableStyle>, std::_Select1st<std::pair<rtl::OUString const, TableStyle>>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::~_Rb_tree() /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_tree.h:986:9
> #22 0x7fae0ed85598 in std::__cxx1998::map<rtl::OUString, TableStyle, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::~map() /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/bits/stl_map.h:314:22
> #23 0x7fae0ed7212c in std::__debug::map<rtl::OUString, TableStyle, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, TableStyle>>>::~map() /opt/rh/gcc-toolset-13/root/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/debug/map.h:136:22
> #24 0x7fae0ed4e0f8 in SvxTableStylesImport::~SvxTableStylesImport() /svx/source/table/tablestylesparser.cxx:99:45
> #25 0x7fae0ed4e158 in SvxTableStylesImport::~SvxTableStylesImport() /svx/source/table/tablestylesparser.cxx:99:45
> #26 0x7fae922b9c06 in cppu::OWeakObject::release() /cppuhelper/source/weak.cxx:230:9
> #27 0x7fae0ed7f452 in cppu::WeakImplHelper<com::sun::star::xml::sax::XFastDocumentHandler, com::sun::star::lang::XServiceInfo, com::sun::star::lang::XInitialization, com::sun::star::document::XImporter, com::sun::star::document::XFilter, com::sun::star::xml::sax::XFastParser>::release() /include/cppuhelper/implbase.hxx:115:66
> #28 0x7fae0ed24883 in rtl::Reference<SvxTableStylesImport>::~Reference() /include/rtl/ref.hxx:126:22
> #29 0x7fae0ed1e242 in SvxAutoFormat::Load(bool) /svx/source/table/tableautofmt.cxx:467:5
> #30 0x7fae2ce0fd46 in SwTableAutoFormatTable::SwTableAutoFormatTable() /sw/source/core/doc/tblafmt.cxx:619:5
> #31 0x7fae2d19f93c in SwDoc::GetTableStyles() /sw/source/core/docnode/ndtbl.cxx:4190:34
> #32 0x7fae2bd89c48 in SwDoc::GetTableStyles() const /sw/inc/doc.hxx:1278:42
> #33 0x7fae307bf50c in int StyleFamilyEntry::GetCountOrName<(SfxStyleFamily)64>(SwDoc const&, UIName*, int) /sw/source/core/unocore/unostyle.cxx:355:37
> #34 0x7fae3089b343 in StyleFamilyEntry::getCountOrName(SwDoc const&, UIName*, int) const /sw/source/core/unocore/unostyle.cxx:198:99
> #35 0x7fae307c0bd4 in SwXStyleFamily::GetCountOrName(UIName*, int) /sw/source/core/unocore/unostyle.cxx:596:21
> #36 0x7fae307c2e98 in SwXStyleFamily::getCount() /sw/source/core/unocore/unostyle.cxx:621:12
> #37 0x7fadfb3c84d4 in SvXMLExport::collectDataStyles(bool) /xmloff/source/core/xmlexp.cxx:1890:35
> #38 0x7fae317803f5 in SwXMLExport::ExportStyles_(bool) /sw/source/filter/xml/xmlfmte.cxx:176:5
> #39 0x7fadfb3b1dfa in SvXMLExport::ImplExportStyles() /xmloff/source/core/xmlexp.cxx:1108:9
> #40 0x7fadfb3bb56c in SvXMLExport::exportDoc(xmloff::token::XMLTokenEnum) /xmloff/source/core/xmlexp.cxx:1425:13
> #41 0x7fae31714b6e in SwXMLExport::exportDoc(xmloff::token::XMLTokenEnum) /sw/source/filter/xml/xmlexp.cxx:313:33
> #42 0x7fadfb3a7fd7 in SvXMLExport::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /xmloff/source/core/xmlexp.cxx:843:9
> #43 0x7fae316f9836 in SwXMLWriter::WriteThroughComponent(com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, char const*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sw/source/filter/xml/wrtxml.cxx:584:28
> #44 0x7fae316f68c4 in SwXMLWriter::WriteThroughComponent(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, char const*, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, char const*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sw/source/filter/xml/wrtxml.cxx:527:16
> #45 0x7fae316f1d99 in SwXMLWriter::Write_(SfxItemSet const*) /sw/source/filter/xml/wrtxml.cxx:375:10
> #46 0x7fae316f6e17 in SwXMLWriter::WriteMedium(SfxMedium&) /sw/source/filter/xml/wrtxml.cxx:471:12
> #47 0x7fae316152e7 in StgWriter::Write(SwPaM&, com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&, rtl::OUString const*, SfxMedium*) /sw/source/filter/writer/writer.cxx:507:33
> #48 0x7fae316f731b in SwXMLWriter::Write(SwPaM&, SfxMedium&, rtl::OUString const*) /sw/source/filter/xml/wrtxml.cxx:478:47
> #49 0x7fae30cd9952 in SwWriter::Write(tools::SvRef<Writer> const&, rtl::OUString const*) /sw/source/filter/basflt/shellio.cxx:870:28
> #50 0x7fae31a5d121 in SwDocShell::SaveAs(SfxMedium&) /sw/source/uibase/app/docsh.cxx:544:21
> #51 0x7fae176b7e1f in SfxObjectShell::SaveAsOwnFormat(SfxMedium&) /sfx2/source/doc/objstor.cxx:3587:16
> #52 0x7fae17677b2b in SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) /sfx2/source/doc/objstor.cxx:1827:23
> #53 0x7fae176b379f in SfxObjectShell::PreDoSaveAs_Impl(rtl::OUString const&, rtl::OUString const&, SfxItemSet const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objstor.cxx:3337:39
> #54 0x7fae176ab60b in SfxObjectShell::CommonSaveAs_Impl(INetURLObject const&, rtl::OUString const&, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objstor.cxx:3125:20
> #55 0x7fae175f1171 in SfxObjectShell::APISaveAs_Impl(std::basic_string_view<char16_t, std::char_traits<char16_t>>, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/objserv.cxx:324:19
> #56 0x7fae17896d73 in SfxBaseModel::impl_store(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, bool) /sfx2/source/doc/sfxbasemodel.cxx:3233:42
> #57 0x7fae1789d804 in SfxBaseModel::storeToURL(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1816:13
> #58 0x7fae12eb6dee in UnoApiTest::save(TestFilter, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, char const*) /test/source/unoapi_test.cxx:364:16
> #59 0x7fae6010ab6f in Chart2GeometryTest::testTdf135366LabelExport() /chart2/qa/extras/chart2geometry.cxx:443:5
>
> 0x512001532ec0 is located 0 bytes inside of 288-byte region [0x512001532ec0,0x512001532fe0)
> allocated by thread T0 here:
> #0 0x55be493fa3c8 in operator new(unsigned long) /home/tdf/lode/packages/llvm-llvmorg-18.1.8.src/compiler-rt/lib/asan/asan_new_delete.cpp:86:3
> #1 0x7fae2ce2e959 in SwTableAutoFormatTable::GetDefaultField() /sw/inc/tblafmt.hxx:190:58
> #2 0x7fae0ed55953 in SvxCellStyleContext::SvxCellStyleContext(SvXMLImport&, SvxTableStylesContext&, SvxTableStylesImport&) /svx/source/table/tablestylesparser.cxx:254:38
> #3 0x7fae0ed4face in SvxTableStylesContext::CreateStyleStyleChildContext(XmlStyleFamily, int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) /svx/source/table/tablestylesparser.cxx:157:30
> #4 0x7fadfc323bf9 in SvXMLStylesContext::CreateStyleChildContext(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) /xmloff/source/style/xmlstyle.cxx:407:19
> #5 0x7fae0ed4f7fd in SvxTableStylesContext::CreateStyleChildContext(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) /svx/source/table/tablestylesparser.cxx:148:32
> #6 0x7fadfc32c9d4 in SvXMLStylesContext::createFastChildContext(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) /xmloff/source/style/xmlstyle.cxx:760:33
> #7 0x7fadfb4b0646 in SvXMLImport::startFastElement(int, com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> const&) /xmloff/source/core/xmlimp.cxx:1000:30
> #8 0x7fae721217cb in (anonymous namespace)::Entity::startElement((anonymous namespace)::Event const*) /sax/source/fastparser/fastparser.cxx:473:27
> #9 0x7fae7210b1d3 in sax_fastparser::FastSaxParserImpl::consume((anonymous namespace)::EventList&) /sax/source/fastparser/fastparser.cxx:1021:25
> #10 0x7fae72108798 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:863:22
> #11 0x7fae72128c00 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1492:13
> #12 0x7fadfb4a27a4 in SvXMLImport::parseStream(com::sun::star::xml::sax::InputSource const&) /xmloff/source/core/xmlimp.cxx:723:15
> #13 0x7fae0ed1e203 in SvxAutoFormat::Load(bool) /svx/source/table/tableautofmt.cxx:465:18
> #14 0x7fae2ce0fd46 in SwTableAutoFormatTable::SwTableAutoFormatTable() /sw/source/core/doc/tblafmt.cxx:619:5
> #15 0x7fae2d19f93c in SwDoc::GetTableStyles() /sw/source/core/docnode/ndtbl.cxx:4190:34
> #16 0x7fae2bd89c48 in SwDoc::GetTableStyles() const /sw/inc/doc.hxx:1278:42
> #17 0x7fae307bf50c in int StyleFamilyEntry::GetCountOrName<(SfxStyleFamily)64>(SwDoc const&, UIName*, int) /sw/source/core/unocore/unostyle.cxx:355:37
> #18 0x7fae3089b343 in StyleFamilyEntry::getCountOrName(SwDoc const&, UIName*, int) const /sw/source/core/unocore/unostyle.cxx:198:99
> #19 0x7fae307c0bd4 in SwXStyleFamily::GetCountOrName(UIName*, int) /sw/source/core/unocore/unostyle.cxx:596:21
> #20 0x7fae307c2e98 in SwXStyleFamily::getCount() /sw/source/core/unocore/unostyle.cxx:621:12
> #21 0x7fadfb3c84d4 in SvXMLExport::collectDataStyles(bool) /xmloff/source/core/xmlexp.cxx:1890:35
> #22 0x7fae317803f5 in SwXMLExport::ExportStyles_(bool) /sw/source/filter/xml/xmlfmte.cxx:176:5
> #23 0x7fadfb3b1dfa in SvXMLExport::ImplExportStyles() /xmloff/source/core/xmlexp.cxx:1108:9
> #24 0x7fadfb3bb56c in SvXMLExport::exportDoc(xmloff::token::XMLTokenEnum) /xmloff/source/core/xmlexp.cxx:1425:13
> #25 0x7fae31714b6e in SwXMLExport::exportDoc(xmloff::token::XMLTokenEnum) /sw/source/filter/xml/xmlexp.cxx:313:33
> #26 0x7fadfb3a7fd7 in SvXMLExport::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /xmloff/source/core/xmlexp.cxx:843:9
> #27 0x7fae316f9836 in SwXMLWriter::WriteThroughComponent(com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, char const*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sw/source/filter/xml/wrtxml.cxx:584:28
> #28 0x7fae316f68c4 in SwXMLWriter::WriteThroughComponent(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, char const*, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, char const*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sw/source/filter/xml/wrtxml.cxx:527:16
> #29 0x7fae316f1d99 in SwXMLWriter::Write_(SfxItemSet const*) /sw/source/filter/xml/wrtxml.cxx:375:10
(<https://ci.libreoffice.org/job/lo_ubsan/3811/>)
Change-Id: I3b724d633eaf2cc4a3622d65ab83380a17027f06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198749
Reviewed-by: Stephan Bergmann <stephan.bergmann@collabora.com>
Tested-by: Jenkins
LibreOffice
LibreOffice is an integrated office suite based on copyleft licenses and compatible with most document formats and standards. Libreoffice is backed by The Document Foundation, which represents a large independent community of enterprises, developers and other volunteers moved by the common goal of bringing to the market the best software for personal productivity. LibreOffice is open source, and free to download, use and distribute.
A quick overview of the LibreOffice code structure.
Overview
You can develop for LibreOffice in one of two ways, one recommended and one much less so. First the somewhat less recommended way: it is possible to use the SDK to develop an extension, for which you can read the API docs and Developers Guide. This re-uses the (extremely generic) UNO APIs that are also used by macro scripting in StarBasic.
The best way to add a generally useful feature to LibreOffice is to work on the code base however. Overall this way makes it easier to compile and build your code, it avoids any arbitrary limitations of our scripting APIs, and in general is far more simple and intuitive - if you are a reasonably able C++ programmer.
The Build Chain and Runtime Baselines
These are the current minimal operating system and compiler versions to run and compile LibreOffice, also used by the TDF builds:
- Windows:
- Runtime: Windows 10
- Build: wsl-as-helper + Visual Studio 2022
- macOS:
- Runtime: 11
- Build: 13 or later + Xcode 14.3 or later (using latest version available for a given version of macOS)
- Linux:
- Runtime: RHEL 9 or CentOS 9 and comparable
- Build: either GCC 12; or Clang 18 with libstdc++ 11
- iOS (only for LibreOfficeKit):
- Runtime: 14.5 (only support for newer i devices == 64 bit)
- Build: Xcode 12.5 and iPhone SDK 14.5
- Android:
- Build: NDK 27 and SDK 30.0.3
- Emscripten / WASM:
- Runtime: a browser with SharedMemory support (threads + atomics)
- Build: Qt 5.15 with Qt supported Emscripten 1.39.8
- See README.wasm
Java is required for building many parts of LibreOffice. In TDF Wiki article Development/Java, the exact modules that depend on Java are listed.
The baseline for Java is Java Development Kit (JDK) Version 17 or later.
The baseline for Python is version 3.11. It follows the version available in SUSE Linux Enterprise Desktop and the Maintenance Support version of Red Hat Enterprise Linux.
If you want to use Clang with the LibreOffice compiler plugins, the minimal version of Clang is 18. Since Xcode doesn't provide the compiler plugin headers, you have to compile your own Clang to use them on macOS.
You can find the TDF configure switches in the distro-configs/ directory.
To setup your initial build environment on Windows and macOS, we provide the LibreOffice Development Environment (LODE) scripts.
For more information see the build instructions for your platform in the TDF wiki.
The Important Bits of Code
Each module should have a README.md file inside it which has some
degree of documentation for that module; patches are most welcome to
improve those. We have those turned into a web page here:
However, there are two hundred modules, many of them of only peripheral interest for a specialist audience. So - where is the good stuff, the code that is most useful. Here is a quick overview of the most important ones:
| Module | Description |
|---|---|
| sal/ | this provides a simple System Abstraction Layer |
| tools/ | this provides basic internal types: Rectangle, Color etc. |
| vcl/ | this is the widget toolkit library and one rendering abstraction |
| framework/ | UNO framework, responsible for building toolbars, menus, status bars, and the chrome around the document using widgets from VCL, and XML descriptions from /uiconfig/ files |
| sfx2/ | legacy core framework used by Writer/Calc/Draw: document model / load/save / signals for actions etc. |
| svx/ | drawing model related helper code, including much of Draw/Impress |
Then applications
| Module | Description |
|---|---|
| desktop/ | this is where the main() for the application lives, init / bootstrap. the name dates back to an ancient StarOffice that also drew a desktop |
| sw/ | Writer |
| sc/ | Calc |
| sd/ | Draw / Impress |
There are several other libraries that are helpful from a graphical perspective:
| Module | Description |
|---|---|
| basegfx/ | algorithms and data-types for graphics as used in the canvas |
| canvas/ | new (UNO) canvas rendering model with various backends |
| cppcanvas/ | C++ helper classes for using the UNO canvas |
| drawinglayer/ | View code to render drawable objects and break them down into primitives we can render more easily. |
Rules for #include Directives (C/C++)
Use the "..." form if and only if the included file is found next to the
including file. Otherwise, use the <...> form. (For further details, see the
mail Re: C[++]: Normalizing include syntax ("" vs
<>).)
The UNO API include files should consistently use double quotes, for the benefit of external users of this API.
loplugin:includeform (compilerplugins/clang/includeform.cxx) enforces these rules.
Finding Out More
Beyond this, you can read the README.md files, send us patches, ask
on the mailing list libreoffice@lists.freedesktop.org (no subscription
required) or poke people on IRC #libreoffice-dev on irc.libera.chat -
we're a friendly and generally helpful mob. We know the code can be
hard to get into at first, and so there are no silly questions.
SAST Tools
PVS-Studio - static analyzer for C, C++, C#, and Java code.