Test repository to check push and ssh key
Find a file
Michael Weghorn 6c5257b680 wina11y: Slightly clean up WinResIDGenerator
Changes:

* drop the optional `maxNum` param for the
  constructor, it's never set to anything
  different than the default value
* store negative number in member (renamed
  from `max` to `m_nMin`) instead of storing
  positive number and inverting that when returning
  it in `ResIDGenerator::GenerateNewResID`
* Use -1 as the first resource ID instead of -2.

Also, add a comment that negative child IDs
are used because it's common to use such ones
to indicate unique resource IDs in
IAccessible2.

Quoting James Teh's comment on an NVDA
pull request of mine [1]:

> The use of negative child ids doesn't fit well into the IAccessible
> spec, but it has been done by IAccessible2 for a very long time and
> should be considered standard for all intents and purposes. A negative
> child id should be treated as a unique id, while a positive child id
> should be treated as a child index.
>
> That said, as noted in #13277 (comment), IAccessible2 elements are
> always full IAccessible objects, not "simple elements". Thus, anything
> that returns an accessible (including accSelection) really should return
> an object pointer. In the case of accSelection, this means VT_DISPATCH
> for a single selection or VT_UNKNOWN and iEnumVARIANT (with VT_DISPATCH
> elements) for multiple selection.
>
> In short, NVDA supporting negative child ids returned from accSelection
> isn't necessarily "wrong", but ideally, LibreOffice would be fixed to
> return full objects.

The latter (returning full objects) has already been addressed in

    commit 00c0ee8cf0
    Author: Michael Weghorn <m.weghorn@posteo.de>
    Date:   Mon Jan 31 07:41:14 2022 +0000

        tdf#147083 wina11y: Return a11y object instead of child ID

but a unique ID is still relevant, s. e.g. the documentation
of `IAccessible2::uniqueID` [2], which also mentions potential
ways to implement unique IDs:

> One means of implementing this would be to create a factory with a 32
> bit number generator and a reuse pool. The number generator would emit
> numbers starting at 1. Each time an object's life cycle ended, its
> number would be saved into a reuse pool. The number generator would be
> used whenever the reuse pool was empty.
>
> Another way to create a unique ID is to generate it from a pointer
> value, e.g. an object's address. That would be unique because no two
> active objects can use the same allocated memory space.

The first approach is what the LO implementation currently does,
except that negative numbers are used.

[1] https://github.com/nvaccess/nvda/pull/13277#issuecomment-1024622871
[2] https://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/interface_i_accessible2.html#aac1342376cf195a6a6e9ee3b7e30ae3b

Change-Id: I6c0a6c4a4e3a69396205fe2d69cd66af6525a273
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131927
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2022-03-22 13:26:54 +01:00
.git-hooks
.github
.vscode Fix typos 2022-03-13 19:17:37 +01:00
accessibility a11y: Leave cell vector handling to AccessibleGridControlTable 2022-03-09 17:47:24 +01:00
android
animations
apple_remote
avmedia Simplify CoCreateInstance / CoGetClassObject with COMReference 2022-03-22 09:01:58 +01:00
basctl tdf#114441 Convert sal_uLong to other types 2022-03-18 21:06:56 +01:00
basegfx ofz#45878 add a way to set some limit on hugely complex clips 2022-03-21 17:35:37 +01:00
basic new loplugin:trivialconstructor 2022-03-14 07:36:13 +01:00
bean
bin ofz#45581 and ofz#45574 suppress Integer-overflow 2022-03-16 22:34:10 +01:00
binaryurp
bridges Drop some debug code 2022-03-08 13:57:22 +01:00
canvas
chart2 chart a11y: Drop bSendGlobally param from AccessibleBase::BroadcastAccEvent 2022-03-18 13:21:00 +01:00
cli_ure
codemaker
comphelper Simplify ConfigurationWrapper singleton construction a bit 2022-03-11 09:49:03 +01:00
compilerplugins Win/X11OpenGLDeviceInfo don't need a common base class 2022-03-22 11:41:54 +01:00
config_host
configmgr
connectivity Simplify CoCreateInstance / CoGetClassObject with COMReference 2022-03-22 09:01:58 +01:00
cppcanvas
cppu
cppuhelper Simplify a static array iteration 2022-03-18 11:49:54 +01:00
cpputools
cui tdf#114441 Convert sal_uLong to other types 2022-03-18 21:06:56 +01:00
dbaccess tdf#147997: MySQL/MariaDB for dialog for direct connection 2022-03-16 19:47:09 +01:00
desktop Send Calc Insert Headers and Footers state change to LOK 2022-03-14 19:59:32 +01:00
dictionaries@5314824424
distro-configs
drawinglayer new loplugin:trivialdestructor 2022-03-11 09:06:06 +01:00
editeng tdf#145614 Convert #define to enum or constexpr 2022-03-18 16:30:29 +01:00
embeddedobj tdf#147589 In document with OLE link, don't show temp-file is in use 2022-03-21 10:25:03 +01:00
embedserv
emfio -Werror,-Wdeprecated-enum-enum-conversion 2022-03-15 22:23:24 +01:00
eventattacher
extensions Simplify CoCreateInstance / CoGetClassObject with COMReference 2022-03-22 09:01:58 +01:00
external reduce down to the part and config we are using and move to tools 2022-03-19 22:56:05 +01:00
extras
filter Simplify GetOOXMLPresetGeometry and GETVMLShapeType 2022-03-15 06:19:53 +01:00
forms new loplugin:trivialconstructor 2022-03-14 07:36:13 +01:00
formula
fpicker Simplify CoCreateInstance / CoGetClassObject with COMReference 2022-03-22 09:01:58 +01:00
framework loplugin:constparams 2022-03-11 10:05:39 +01:00
helpcompiler
helpcontent2@b79af43f87 Update git submodules 2022-03-21 18:16:04 +01:00
hwpfilter ofz#45816 Direct-leak 2022-03-21 13:25:27 +01:00
i18nlangtag
i18npool tdf#147905 calc PROPER function doesn't like mulithreading 2022-03-12 21:16:48 +01:00
i18nutil
icon-themes Colibre: tdf#148029 Remove dark area in dark variant 2022-03-21 15:37:45 +01:00
idl
idlc
include OpenGLHelper::GetDigest is only used on Windows 2022-03-22 09:24:50 +01:00
instsetoo_native
io
ios
javaunohelper
jurt
jvmaccess new loplugin:trivialdestructor 2022-03-11 09:06:06 +01:00
jvmfwk Allow for java.version consisting of four dotted segments 2022-03-15 13:46:06 +01:00
l10ntools
librelogo
libreofficekit
lingucomponent
linguistic
lotuswordpro tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macro 2022-03-16 09:13:23 +01:00
m4
nlpsolver
o3tl
odk Fix typos 2022-03-13 19:17:37 +01:00
offapi
officecfg Related tdf#114286: put duplicates commands in GenericCommands (SplitCell) 2022-03-21 18:22:17 +01:00
onlineupdate
oovbaapi
oox tdf#147766 Export empty lines as line with noFill 2022-03-17 08:05:06 +01:00
opencl
osx
package no need to have duplicate m_bIsRoot fields 2022-03-17 08:17:50 +01:00
pch
postprocess
pyuno change default Calc number of columns to 16384 (tdf#50916) 2022-03-09 08:25:44 +01:00
qadevOOo
readlicense_oo ofz#45373 and ofz#45362 fix ubsan issues 2022-03-09 21:21:08 +01:00
registry
remotebridges
reportbuilder
reportdesign loplugin:constparams 2022-03-11 10:05:39 +01:00
ridljar
sal tdf#145614 Convert #define to enum or constexpr 2022-03-22 08:37:17 +01:00
salhelper
sax tdf#133603 increase cache size in CachedOutputStream 2022-03-18 12:53:08 +01:00
sc sc: support sparkline bar colors, add markers to sparkline lines 2022-03-22 08:44:44 +01:00
scaddins
sccomp
schema sd theme: add ODP import/export for shape fill color 2022-03-18 08:07:02 +01:00
scp2
scripting Remove special-casing Windows stderr handling 2022-03-20 16:37:30 +01:00
sd WeldEditView: Just pass new Size object as param 2022-03-18 15:28:44 +01:00
sdext
setup_native
sfx2 tdf#111924 - Special characters: don't lose focus on context menu 2022-03-18 19:57:01 +01:00
shell
slideshow loplugin:constparams 2022-03-11 10:05:39 +01:00
smoketest
solenv reduce down to the part and config we are using and move to tools 2022-03-19 22:56:05 +01:00
soltools
sot
starmath new loplugin:trivialconstructor 2022-03-14 07:36:13 +01:00
static
stoc tdf#148063: Avoid dereferencing potentially bad user-supplied TypeDescription 2022-03-18 15:33:50 +01:00
store
svgio
svl new loplugin:trivialdestructor 2022-03-11 09:06:06 +01:00
svtools
svx WeldEditView: Just pass new Size object as param 2022-03-18 15:28:44 +01:00
sw sw clearing breaks: add HTML filter 2022-03-22 12:38:43 +01:00
swext
sysui
test
testtools
toolkit
tools add system-libfixmath 2022-03-20 22:26:29 +01:00
translations@149fb7cb5f
ucb loplugin:constparams 2022-03-11 10:05:39 +01:00
ucbhelper
udkapi
uitest tdf#128610: math: add UItest 2022-03-14 15:25:08 +01:00
UnoControls
unodevtools
unoidl
unoil
unotest
unotools tdf#133603 cache languagetag in FontSubstConfiguration 2022-03-18 09:59:04 +01:00
unoxml
ure
uui
vbahelper
vcl loplugin:loopvartoosmall 2022-03-22 11:57:36 +01:00
winaccessibility wina11y: Slightly clean up WinResIDGenerator 2022-03-22 13:26:54 +01:00
wizards ScriptForge - (SF_Form) fix use of BaseForm 2022-03-16 09:44:59 +01:00
writerfilter tdf#104390: rtf import: init default font for entire state stack 2022-03-22 09:38:07 +01:00
writerperfect
xmerge
xmlhelp
xmloff sd theme: add ODP import/export for shape fill color 2022-03-18 08:07:02 +01:00
xmlreader
xmlscript
xmlsecurity
.buckconfig
.buckversion
.clang-format
.editorconfig
.git-blame-ignore-revs
.gitattributes
.gitignore
.gitmodules
.gitpod.dockerfile
.gitpod.yml
.gitreview
antivirusDetection.vbs
autogen.sh
BUCK
config.guess
config.sub
config_host.mk.in
config_host_lang.mk.in
configure.ac add system-libfixmath 2022-03-20 22:26:29 +01:00
COPYING
COPYING.LGPL
COPYING.MPL
download.lst external: update pdfium to 4933 2022-03-17 11:22:48 +01:00
g
hardened_runtime.xcent.in
install-sh
install_deps.sh
leak-suppress.txt
Library_merged.mk
lo.xcent
logerrit
Makefile.fetch
Makefile.gbuild
Makefile.in
README.cross
README.help.md
README.md
README.Solaris
Repository.mk
RepositoryExternal.mk
RepositoryFixes.mk
RepositoryModule_build.mk
RepositoryModule_host.mk
sanitize-ubsan-excludelist
setup.cfg
TEMPLATE.SOURCECODE.HEADER
tsan-suppress.txt

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 here and here. 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 7
    • Build: Cygwin + Visual Studio 2019 version 16.5
  • macOS:
    • Runtime: 10.13
    • Build: 11.0 + Xcode 12.5
  • Linux:
    • Runtime: RHEL 7 or CentOS 7
    • Build: either GCC 7.0.0; or Clang 8.0.1 with libstdc++ 7.3.0
  • 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 r19c and SDK 22.6.2
  • Emscripten / WASM:
    • Runtime: a browser with SharedMemory support (threads + atomics)
    • Build: Qt 5.15 with Qt supported Emscripten 1.39.8
    • See README.wasm

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.