Limit the scope of m_aMutex lock to what is necessary. As observed by Jan-Marek Glogowski: [Switching to thread 198 (Thread 0x2aab44e5b700 (LWP 46847))] 3 osl_acquireMutex(oslMutexImpl*) (pMutex=0x1e59d10) at sal/osl/unx/mutex.cxx:97 4 osl::Mutex::acquire() (this=0x1ebbe28) at include/osl/mutex.hxx:56 5 osl::Guard<osl::Mutex>::Guard(osl::Mutex&, bool) (this=0x2aab44e56198, rT=..., bAquire=true) at include/osl/mutex.hxx:135 6 dbaccess::ODatabaseContext::getElementNames() (this=0x1ebbd90) at dbaccess/source/core/dataaccess/databasecontext.cxx:661 7 non-virtual thunk to dbaccess::ODatabaseContext::getElementNames() () at dbaccess/source/core/dataaccess/databasecontext.cxx:659 8 dbaui::SbaTableQueryBrowser::initializeTreeModel() (this=0xb174890) at dbaccess/source/ui/browser/unodatbr.cxx:2086 9 dbaui::SbaTableQueryBrowser::impl_initialize() (this=0xb174890) at dbaccess/source/ui/browser/unodatbr.cxx:3201 10 dbaui::OGenericUnoController::initialize(com::sun:⭐:uno::Sequence<com::sun:⭐:uno::Any> const&) (this=0xb174890, aArguments=uno::Sequence of length 9 = {...}) at dbaccess/source/ui/browser/genericcontroller.cxx:299 11 DBContentLoader::load(com::sun:⭐:uno::Reference<com::sun:⭐:frame::XFrame> const&, rtl::OUString const&, com::sun:⭐:uno::Sequence<com::sun:⭐🫘:PropertyValue> const&, com::sun:⭐:uno::Reference<com::sun:⭐:frame::XLoadEventListener> const&) (this=0xb1730a0, rFrame=uno::Reference to ((anonymous namespace)::Frame *) 0xb162690, rURL=".component:DB/DataSourceBrowser", rArgs=uno::Sequence of length 8 = {...}, rListener=uno::Reference to (framework::LoadEnvListener *) 0xb174228) at dbaccess/source/ui/browser/dbloader.cxx:270 12 framework::LoadEnv::impl_loadContent() (this=0xb16f5b8) at framework/source/loadenv/loadenv.cxx:1077 13 framework::LoadEnv::startLoading() (this=0xb16f5b8) at framework/source/loadenv/loadenv.cxx:372 [Switching to thread 196 (Thread 0x2aab4565f700 (LWP 42841))] 3 osl_acquireMutex(oslMutexImpl*) (pMutex=0x773cd0) at sal/osl/unx/mutex.cxx:97 4 osl::Mutex::acquire() (this=0x77b4a8) at include/osl/mutex.hxx:56 5 comphelper::GenericSolarMutex::doAcquire(unsigned int) (this=0x77b4a0, nLockCount=1) at comphelper/source/misc/solarmutex.cxx:61 6 comphelper::SolarMutex::acquire(unsigned int) (this=0x77b4a0, nLockCount=1) at include/comphelper/solarmutex.hxx:74 7 osl::ClearableGuard<comphelper::SolarMutex>::ClearableGuard(comphelper::SolarMutex&) (this=0x2aab4565d478, t=...) at include/osl/mutex.hxx:170 8 osl::ResettableGuard<comphelper::SolarMutex>::ResettableGuard(comphelper::SolarMutex&) (this=0x2aab4565d478, rT=...) at include/osl/mutex.hxx:215 9 SolarMutexResettableGuard::SolarMutexResettableGuard() (this=0x2aab4565d478) at include/vcl/svapp.hxx:1416 10 dbaccess::ModelMethodGuard::ModelMethodGuard(dbaccess::ModelDependentComponent const&) (this=0x2aab4565d478, _component=...) at dbaccess/source/core/dataaccess/ModelImpl.hxx:587 11 dbaccess::ODatabaseSource::getDatabaseDocument() (this=0x281d690) at dbaccess/source/core/dataaccess/datasource.cxx:1300 12 non-virtual thunk to dbaccess::ODatabaseSource::getDatabaseDocument() () at dbaccess/source/core/dataaccess/datasource.cxx:1298 13 dbaccess::ODatabaseContext::registerObject(rtl::OUString const&, com::sun:⭐:uno::Reference<com::sun:⭐:uno::XInterface> const&) (this=0x1ebbd90, _rName="MyFactory", _rxObject=uno::Reference to (dbaccess::ODatabaseSource *) 0x281d708) at dbaccess/source/core/dataaccess/databasecontext.cxx:433 14 gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) (pThis=0x1ebbdf8, nVtableIndex=4, pRegisterReturn=0x0, pReturnTypeRef=0x781090, bSimpleReturn=true, pStack=0x2aab4565d810, nStack=0, pGPR=0x2aab4565db30, pFPR=0x2aab4565daf0) at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:77 Change-Id: I06e91d9c4e193c97f98f29f6b73eaf01b12922c0
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 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 important bits of code
Each module should have a README
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. |
Finding out more
Beyond this, you can read the README
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.freenode.net -
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.