Stephan Bergmann 17d2a10303 external/libeot: Silence invalid-shift-base
...as seen during CppunitTest_sd_font_embedding_tests,

> src/EOT.c:15:68: runtime error: left shift of 160 by 24 places cannot be represented in type 'int'
>     #0 0x7f0b39e71791 in EOTreadU32LE (/instdir/program/libvcllo.so+0xbbb0791)
>     #1 0x7f0b39e73882 in EOTfillMetadataSpecifyingVersion (/instdir/program/libvcllo.so+0xbbb2882)
>     #2 0x7f0b39e754a6 in EOTfillMetadata (/instdir/program/libvcllo.so+0xbbb44a6)
>     #3 0x7f0b39e7129e in EOT2ttf_buffer (/instdir/program/libvcllo.so+0xbbb029e)
>     #4 0x7f0b35eb77d9 in EmbeddedFontsHelper::addEmbeddedFont(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&, std::basic_string_view<char16_t, std::char_traits<char16_t> >, std::__debug::vector<unsigned char, std::allocator<unsigned char> > const&, bool, bool) /vcl/source/gdi/embeddedfontshelper.cxx:120:13
>     #5 0x7f0acf649034 in oox::ppt::EmbeddedFontListContext::onEndElement() /oox/source/ppt/EmbeddedFontListContext.cxx:96:30
>     #6 0x7f0ace1879d4 in oox::core::ContextHandler2Helper::implEndElement(int) /oox/source/core/contexthandler2.cxx:124:9
>     #7 0x7f0ace2287c6 in oox::core::FragmentHandler2::endFastElement(int) /oox/source/core/fragmenthandler2.cxx:91:5
>     #8 0x7f0b07f340ca in (anonymous namespace)::Entity::endElement() /sax/source/fastparser/fastparser.cxx:515:27
>     #9 0x7f0b07f33a98 in sax_fastparser::FastSaxParserImpl::callbackEndElement() /sax/source/fastparser/fastparser.cxx:1340:17
>     #10 0x7f0b07f23a24 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) /sax/source/fastparser/fastparser.cxx:339:18
>     #11 0x7f0b4391eb84 in xmlParseEndTag2 /workdir/UnpackedTarball/libxml2/parser.c:9632:2
>     #12 0x7f0b438d0124 in xmlParseTryOrFinish /workdir/UnpackedTarball/libxml2/parser.c:11374:14
>     #13 0x7f0b438c4f6c in xmlParseChunk /workdir/UnpackedTarball/libxml2/parser.c:11640:5
>     #14 0x7f0b07f1e811 in sax_fastparser::FastSaxParserImpl::parse() /sax/source/fastparser/fastparser.cxx:1091:21
>     #15 0x7f0b07f18318 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:895:9
>     #16 0x7f0b07f39a50 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1479:13
>     #17 0x7f0ace1b2541 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) /oox/source/core/fastparser.cxx:121:15
>     #18 0x7f0ace1b2cd8 in oox::core::FastParser::parseStream(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, rtl::OUString const&) /oox/source/core/fastparser.cxx:129:5
>     #19 0x7f0ace2871ce in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&, oox::core::FastParser&) /oox/source/core/xmlfilterbase.cxx:421:21
>     #20 0x7f0ace285a1d in oox::core::XmlFilterBase::importFragment(rtl::Reference<oox::core::FragmentHandler> const&) /oox/source/core/xmlfilterbase.cxx:351:12
>     #21 0x7f0acf65bbb2 in oox::ppt::PowerPointImport::importDocument() /oox/source/ppt/pptimport.cxx:109:17
>     #22 0x7f0ace1c54ab in oox::core::FilterBase::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /oox/source/core/filterbase.cxx:486:49
>     #23 0x7f0acf65f687 in oox::ppt::PowerPointImport::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /oox/source/ppt/pptimport.cxx:214:24
>     #24 0x7f0af938ff1a in SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) /sfx2/source/doc/objstor.cxx:2685:34
>     #25 0x7f0b01e1acd1 in sd::DrawDocShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) /sd/source/ui/docshell/docshel4.cxx:458:39
>     #26 0x7f0af9342ab1 in SfxObjectShell::DoLoad(SfxMedium*) /sfx2/source/doc/objstor.cxx:768:23
>     #27 0x7f0af95d3e84 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1986:36
>     #28 0x7f0af9e36f00 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) /sfx2/source/view/frmload.cxx:771:28
>     #29 0x7f0ac5b19f36 in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1180:37
>     #30 0x7f0ac5b10dd2 in framework::LoadEnv::start() /framework/source/loadenv/loadenv.cxx:415:20
>     #31 0x7f0ac5b09292 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures) /framework/source/loadenv/loadenv.cxx:311:5
>     #32 0x7f0ac5b04674 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/loadenv/loadenv.cxx:167:14
>     #33 0x7f0ac5bd9348 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx:594:16
>     #34 0x7f0ac5bd96c6 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx
>     #35 0x7f0adc8e6a09 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /unotest/source/cpp/macros_test.cxx:72:62
>     #36 0x7f0af3eb9f62 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /test/source/unoapi_test.cxx:125:19
>     #37 0x7f0af3eb9098 in UnoApiTest::loadFromURL(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:107:5
>     #38 0x7f0af3eba994 in UnoApiTest::loadFromFile(std::basic_string_view<char16_t, std::char_traits<char16_t> >, char const*) /test/source/unoapi_test.cxx:132:5
>     #39 0x7f0b0e518798 in SdModelTestBase::createSdImpressDoc(char const*, char const*) /sd/qa/unit/sdmodeltestbase.hxx:54:13
>     #40 0x7f0b0e50fa7d in testRoundtripEmbeddedFontsPPTX::TestBody() /sd/qa/unit/FontEmbeddingTest.cxx:49:5

(<https://ci.libreoffice.org/job/lo_ubsan/3555/>)

Change-Id: I0fed461981c812a10ee88ea44629afe6c76525ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185086
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2025-05-09 11:51:17 +02:00
2025-03-10 14:18:35 +01:00
2025-05-03 14:18:34 +02:00
…
2025-05-08 22:50:45 +02:00
2024-10-17 20:25:15 +02:00
2025-05-07 08:42:29 +02:00
2025-05-09 09:03:14 +02:00
2025-05-08 22:51:46 +02:00
2025-05-01 22:27:07 +02:00
2025-05-09 10:15:15 +02:00
2025-05-01 22:29:09 +02:00
2025-05-07 19:49:55 +02:00
2025-03-14 09:54:11 +01:00
2024-12-26 21:59:24 +01:00
…
…
2025-01-17 12:29:08 +01:00
…
2025-04-30 17:00:24 +02:00
2025-05-08 08:31:36 +02:00
…
…
2025-05-08 11:20:59 +02:00
2025-04-29 19:16:57 +02:00
2025-05-08 22:51:02 +02:00
2025-05-05 11:12:22 +02:00
2025-04-08 15:49:09 +02:00
2025-03-10 14:18:35 +01:00
2025-04-17 19:49:21 +02:00
2024-12-04 11:39:50 +01:00
2025-04-30 20:56:07 +02:00
2025-05-08 08:31:36 +02:00
2025-05-08 22:49:09 +02:00
2025-03-31 13:18:12 +02:00
2025-05-07 16:36:29 +02:00
2025-03-10 14:18:35 +01:00
…
2024-12-18 14:49:14 +01:00
2025-05-09 09:35:52 +02:00
2025-03-10 14:18:35 +01:00
…
2025-05-09 06:55:09 +02:00
…
2011-01-11 21:49:39 +00:00
…
2025-05-09 08:09:02 +02:00
…
2024-07-11 13:04:30 +02:00

LibreOffice

Coverity Scan Build Status CII Best Practices Translation status

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: Cygwin + Visual Studio 2019 version 16.10
  • macOS:
    • Runtime: 10.15 (11 for aarch64)
    • Build: 12 + Xcode 14.2 or later (using latest version available for a given version of macOS)
  • Linux:
    • Runtime: RHEL 8 or CentOS 8 and comparable
    • Build: either GCC 12; or Clang 12 with libstdc++ 10
  • iOS (only for LibreOfficeKit):
    • Runtime: 11.4 (only support for newer i devices == 64 bit)
    • Build: Xcode 9.3 and iPhone SDK 11.4
  • 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 12.0.1. 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:

https://docs.libreoffice.org/

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.

S
Description
Dépôt d'ODFStudio
Readme
2.1 GiB
Languages
C++ 82.6%
Java 5.1%
Rich Text Format 2.3%
Python 2%
PostScript 1.9%
Other 5.6%