An assert is failing without this: ucrtbased.dll!abort() Line 61 at minkernel\crts\ucrt\src\appcrt\startup\abort.cpp(61) ucrtbased.dll!common_assert_to_stderr<wchar_t>(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number) Line 187 at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(187) ucrtbased.dll!common_assert<wchar_t>(const wchar_t * const expression, const wchar_t * const file_name, const unsigned int line_number, void * const return_address) Line 420 at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(420) ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t * file_name, unsigned int line_number) Line 444 at minkernel\crts\ucrt\src\appcrt\startup\assert.cpp(444) vcllo.dll!VclBuilder::get<FixedImage>(const rtl::OString & sID) Line 446 at C:\cygwin\home\user\lode\dev\core\include\vcl\builder.hxx(446) vcllo.dll!VclBuilder::VclBuilder(vcl::Window * pParent, const rtl::OUString & sUIDir, const rtl::OUString & sUIFile, const rtl::OString & sID, const com::sun:⭐:uno::Reference<com::sun:⭐:frame::XFrame> & rFrame, bool bLegacy) Line 698 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\builder.cxx(698) vcllo.dll!SalInstanceBuilder::SalInstanceBuilder(vcl::Window * pParent, const rtl::OUString & rUIRoot, const rtl::OUString & rUIFile) Line 4995 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\salvtables.cxx(4995) vcllo.dll!SalInstance::CreateBuilder(weld::Widget * pParent, const rtl::OUString & rUIRoot, const rtl::OUString & rUIFile) Line 5260 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\salvtables.cxx(5260) vcllo.dll!Application::CreateBuilder(weld::Widget * pParent, const rtl::OUString & rUIFile) Line 146 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\builder.cxx(146) vcllo.dll!weld::GenericDialogController::GenericDialogController(weld::Widget * pParent, const rtl::OUString & rUIFile, const rtl::OString & rDialogId) Line 5347 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\salvtables.cxx(5347) sduilo.dll!SvxBulletAndPositionDlg::SvxBulletAndPositionDlg(weld::Window * pWindow, const SfxItemSet & rSet, sd::View * pView) Line 117 at C:\cygwin\home\user\lode\dev\core\sd\source\ui\dlg\BulletAndPositionDlg.cxx(117) sduilo.dll!std::make_unique<SvxBulletAndPositionDlg,weld::Window * &,SfxItemSet const &,sd::View * &,0>(weld::Window * & <_Args_0>, const SfxItemSet & <_Args_1>, sd::View * & <_Args_2>) Line 2042 at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\include\memory(2042) sduilo.dll!SdAbstractDialogFactory_Impl::CreateSvxBulletAndPositionDlg(weld::Window * pParent, const SfxItemSet * pAttr, sd::View * pView) Line 387 at C:\cygwin\home\user\lode\dev\core\sd\source\ui\dlg\sddlgfact.cxx(387) sdlo.dll!sd::FuBulletAndPosition::DoExecute(SfxRequest & rReq) Line 92 at C:\cygwin\home\user\lode\dev\core\sd\source\ui\func\fuolbull.cxx(92) sdlo.dll!sd::FuBulletAndPosition::Create(sd::ViewShell * pViewSh, sd::Window * pWin, sd::View * pView, SdDrawDocument * pDoc, SfxRequest & rReq) Line 57 at C:\cygwin\home\user\lode\dev\core\sd\source\ui\func\fuolbull.cxx(57) sdlo.dll!sd::DrawViewShell::FuTemporary(SfxRequest & rReq) Line 1447 at C:\cygwin\home\user\lode\dev\core\sd\source\ui\view\drviews2.cxx(1447) sdlo.dll!SfxStubDrawViewShellFuTemporary(SfxShell * pShell, SfxRequest & rReq) Line 1514 at C:\cygwin\home\user\lode\dev\core\workdir\SdiTarget\sd\sdi\sdslots.hxx(1514) sfxlo.dll!SfxShell::CallExec(void(*)(SfxShell *, SfxRequest &) pFunc, SfxRequest & rReq) Line 197 at C:\cygwin\home\user\lode\dev\core\include\sfx2\shell.hxx(197) sfxlo.dll!SfxDispatcher::Call_Impl(SfxShell & rShell, const SfxSlot & rSlot, SfxRequest & rReq, bool bRecord) Line 360 at C:\cygwin\home\user\lode\dev\core\sfx2\source\control\dispatch.cxx(360) sfxlo.dll!SfxDispatcher::Execute_(SfxShell & rShell, const SfxSlot & rSlot, SfxRequest & rReq, SfxCallMode eCallMode) Line 857 at C:\cygwin\home\user\lode\dev\core\sfx2\source\control\dispatch.cxx(857) sfxlo.dll!SfxBindings::Execute_Impl(SfxRequest & aReq, const SfxSlot * pSlot, SfxShell * pShell) Line 1066 at C:\cygwin\home\user\lode\dev\core\sfx2\source\control\bindings.cxx(1066) sfxlo.dll!SfxDispatchController_Impl::dispatch(const com::sun:⭐:util::URL & aURL, const com::sun:⭐:uno::Sequence<com::sun:⭐🫘:PropertyValue> & aArgs, const com::sun:⭐:uno::Reference<com::sun:⭐:frame::XDispatchResultListener> & rListener) Line 757 at C:\cygwin\home\user\lode\dev\core\sfx2\source\control\unoctitm.cxx(757) sfxlo.dll!SfxOfficeDispatch::dispatch(const com::sun:⭐:util::URL & aURL, const com::sun:⭐:uno::Sequence<com::sun:⭐🫘:PropertyValue> & aArgs) Line 226 at C:\cygwin\home\user\lode\dev\core\sfx2\source\control\unoctitm.cxx(226) fwklo.dll!framework::MenuBarManager::Select(Menu * pMenu) Line 896 at C:\cygwin\home\user\lode\dev\core\framework\source\uielement\menubarmanager.cxx(896) fwklo.dll!framework::MenuBarManager::LinkStubSelect(void * instance, Menu * data) Line 832 at C:\cygwin\home\user\lode\dev\core\framework\source\uielement\menubarmanager.cxx(832) vcllo.dll!Link<Menu *,bool>::Call(Menu * data) Line 84 at C:\cygwin\home\user\lode\dev\core\include\tools\link.hxx(84) vcllo.dll!Menu::Select() Line 362 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\menu.cxx(362) vcllo.dll!Menu::ImplCallSelect(void * __formal) Line 2150 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\menu.cxx(2150) vcllo.dll!Menu::LinkStubImplCallSelect(void * instance, void * data) Line 2146 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\menu.cxx(2146) vcllo.dll!Link<void *,void>::Call(void * data) Line 84 at C:\cygwin\home\user\lode\dev\core\include\tools\link.hxx(84) vcllo.dll!ImplHandleUserEvent(ImplSVEvent * pSVEvent) Line 1961 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\winproc.cxx(1961) vcllo.dll!ImplWindowFrameProc(vcl::Window * _pWindow, SalEvent nEvent, const void * pEvent) Line 2512 at C:\cygwin\home\user\lode\dev\core\vcl\source\window\winproc.cxx(2512) vcllo.dll!SalFrame::CallCallback(SalEvent nEvent, const void * pEvent) Line 294 at C:\cygwin\home\user\lode\dev\core\vcl\inc\salframe.hxx(294) vclplug_winlo.dll!ImplHandleUserEvent(HWND__ * hWnd, __int64 lParam) Line 4080 at C:\cygwin\home\user\lode\dev\core\vcl\win\window\salframe.cxx(4080) vclplug_winlo.dll!SalFrameWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam, bool & rDef) Line 5733 at C:\cygwin\home\user\lode\dev\core\vcl\win\window\salframe.cxx(5733) vclplug_winlo.dll!SalFrameWndProcW(HWND__ * hWnd, unsigned int nMsg, unsigned __int64 wParam, __int64 lParam) Line 5840 at C:\cygwin\home\user\lode\dev\core\vcl\win\window\salframe.cxx(5840) user32.dll!UserCallWinProcCheckWow() user32.dll!CallWindowProcW() opengl32.dll!wglWndProc() user32.dll!UserCallWinProcCheckWow() user32.dll!DispatchMessageWorker() vclplug_winlo.dll!ImplSalDispatchMessage(const tagMSG * pMsg) Line 410 at C:\cygwin\home\user\lode\dev\core\vcl\win\app\salinst.cxx(410) vclplug_winlo.dll!ImplSalYield(bool bWait, bool bHandleAllCurrentEvents) Line 441 at C:\cygwin\home\user\lode\dev\core\vcl\win\app\salinst.cxx(441) vclplug_winlo.dll!WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) Line 512 at C:\cygwin\home\user\lode\dev\core\vcl\win\app\salinst.cxx(512) vcllo.dll!ImplYield(bool i_bWait, bool i_bAllEvents) Line 457 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svapp.cxx(457) vcllo.dll!Application::Yield() Line 522 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svapp.cxx(522) vcllo.dll!Application::Execute() Line 438 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svapp.cxx(438) sofficeapp.dll!desktop::Desktop::Main() Line 1621 at C:\cygwin\home\user\lode\dev\core\desktop\source\app\app.cxx(1621) vcllo.dll!ImplSVMain() Line 203 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svmain.cxx(203) vcllo.dll!SVMain() Line 238 at C:\cygwin\home\user\lode\dev\core\vcl\source\app\svmain.cxx(238) sofficeapp.dll!soffice_main() Line 170 at C:\cygwin\home\user\lode\dev\core\desktop\source\app\sofficemain.cxx(170) soffice.bin!sal_main() Line 48 at C:\cygwin\home\user\lode\dev\core\desktop\source\app\main.c(48) soffice.bin!main(int argc, char * * argv) Line 47 at C:\cygwin\home\user\lode\dev\core\desktop\source\app\main.c(47) soffice.bin!invoke_main() Line 79 at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(79) soffice.bin!__scrt_common_main_seh() Line 288 at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288) soffice.bin!__scrt_common_main() Line 331 at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(331) soffice.bin!mainCRTStartup() Line 17 at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp(17) kernel32.dll!BaseThreadInitThunk() ntdll.dll!RtlUserThreadStart() because the images are added with empty ids, get into the same slot of m_pParserState->m_aStockMap, and then in VclBuilder::VclBuilder's block labeled "fill in any stock icons in surviving images", get<FixedImage> is called with that empty id, finding another control not having an id, then failing dynamic_cast it to FixedImage. Change-Id: Ie2f48ea0753998e8ed6590c45a3d916339c1fc13 Reviewed-on: https://gerrit.libreoffice.org/73531 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
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 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 2017
- macOS:
- Runtime: 10.10
- Build: 10.13.2 + Xcode 9.3
- Linux:
- Runtime: RHEL 6 or CentOS 6
- Build: either GCC 7.0.0; or Clang 5.0.2 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
If you want to use Clang with the LibreOffice compiler plugins, the minimal version of Clang is 5.0.2. 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
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
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.