tdf#170399 Revert LoadEnv changes from "tdf#41777 Add window size ...

... and position for each document"

The changes to LoadEnv in

    commit 8ce2cf3973ecd428eb8d0290930791ee1c771626
    Date:   Mon May 12 01:29:55 2025 +0700

        tdf#41777 Add window size and position for each document

to create new frames when loading existing documents from
the start center and close the backing window cause
crashes for the tdf#170399 scenario of starting the template manager
from the start center and then editing a template by selecting
the "Edit" entry from its context menu.

Revert the changes to that class for now, to fix the crashes.

In a quick test with the gen VCL plugin, this causes documents
opened from the start center to no longer be restored in the
position that they were in previously, while opening documents
directly (i.e. not from start center) still results in them
getting restored at the previous location. (Tested with two
different documents that were saved and closed in different
locations on the screen and both were restored at their
original location.)

This partially reverts commit 8ce2cf3973ecd428eb8d0290930791ee1c771626.

Backtrace for the gen VCL plugin without this commit in place:

    warn:legacy.osl:835647:835647:vcl/source/window/window.cxx:307: Window ( 14VclDrawingArea()) with live SystemWindows destroyed:  18MenuFloatingWindow()
    Window ( 14VclDrawingArea()) with live SystemWindows destroyed:  18MenuFloatingWindow()

    Thread 1 "soffice.bin" received signal SIGABRT, Aborted.
    __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    ⚠ warning: 44  ./nptl/pthread_kill.c: No such file or directory
    (gdb) bt
    #0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
    #1  0x00007ffff769749f in __pthread_kill_internal (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:89
    #2  0x00007ffff7640942 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
    #3  0x00007ffff76284ac in __GI_abort () at ./stdlib/abort.c:77
    #4  0x00007fffee2339db in SalAbort (rErrorText="Window ( 14VclDrawingArea()) with live SystemWindows destroyed:  18MenuFloatingWindow()", bDumpCore=true) at /home/michi/development/git/libreoffice/vcl/source/app/salplug.cxx:403
    #5  0x00007fffee2ff4b1 in Application::Abort (rErrorText="Window ( 14VclDrawingArea()) with live SystemWindows destroyed:  18MenuFloatingWindow()") at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:300
    #6  0x00007fffedc25c54 in vcl::Window::dispose (this=0x5555573055d0) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:308
    #7  0x00007fffedc9e1c6 in Control::dispose (this=0x5555573055d0) at /home/michi/development/git/libreoffice/vcl/source/control/ctrl.cxx:62
    #8  0x00007fffedea0d53 in VclReferenceBase::disposeOnce (this=0x555557305890) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #9  0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear (this=0x7ffffffe72d0) at include/vcl/vclptr.hxx:208
    #10 0x00007ffff0069f57 in UnoWrapper::WindowDestroyed (this=0x5555568aaf90, pWindow=0x555557168d30) at /home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:250
    #11 0x00007fffedc24eca in vcl::Window::dispose (this=0x555557168d30) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
    #12 0x00007fffedea0d53 in VclReferenceBase::disposeOnce (this=0x555557168d80) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #13 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear (this=0x7ffffffe8798) at include/vcl/vclptr.hxx:208
    #14 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x5555577d6d80) at /home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
    #15 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed (this=0x5555568aaf90, pWindow=0x5555573c4dd0) at /home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
    #16 0x00007fffedc24eca in vcl::Window::dispose (this=0x5555573c4dd0) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
    #17 0x00007fffedafd800 in VclScrolledWindow::dispose (this=0x5555573c4dd0) at /home/michi/development/git/libreoffice/vcl/source/window/layout.cxx:1926
    #18 0x00007fffedea0d53 in VclReferenceBase::disposeOnce (this=0x5555573c4e48) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #19 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear (this=0x7ffffffe9eb8) at include/vcl/vclptr.hxx:208
    #20 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x55555788b020) at /home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
    #21 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed (this=0x5555568aaf90, pWindow=0x555557722300) at /home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
    #22 0x00007fffedc24eca in vcl::Window::dispose (this=0x555557722300) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
    #23 0x00007fffedea0d53 in VclReferenceBase::disposeOnce (this=0x555557722350) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #24 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear (this=0x7ffffffeb5b8) at include/vcl/vclptr.hxx:208
    #25 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x5555577a9df0) at /home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
    #26 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed (this=0x5555568aaf90, pWindow=0x55555772fe50) at /home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
    #27 0x00007fffedc24eca in vcl::Window::dispose (this=0x55555772fe50) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
    #28 0x00007fffedafb566 in VclFrame::dispose (this=0x55555772fe50) at /home/michi/development/git/libreoffice/vcl/source/window/layout.cxx:1493
    #29 0x00007fffedea0d53 in VclReferenceBase::disposeOnce (this=0x55555772fea8) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #30 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear (this=0x7ffffffeccd8) at include/vcl/vclptr.hxx:208
    #31 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x5555577c1ac0) at /home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
    #32 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed (this=0x5555568aaf90, pWindow=0x5555572db4d0) at /home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
    #33 0x00007fffedc24eca in vcl::Window::dispose (this=0x5555572db4d0) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
    #34 0x00007fffedea0d53 in VclReferenceBase::disposeOnce (this=0x5555572db520) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #35 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear (this=0x7ffffffee3d8) at include/vcl/vclptr.hxx:208
    #36 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x5555577c5650) at /home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
    #37 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed (this=0x5555568aaf90, pWindow=0x5555576ebfe0) at /home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
    #38 0x00007fffedc24eca in vcl::Window::dispose (this=0x5555576ebfe0) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
    #39 0x00007fffedea0d53 in VclReferenceBase::disposeOnce (this=0x5555576ec030) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #40 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear (this=0x7ffffffefad8) at include/vcl/vclptr.hxx:208
    #41 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x5555577c8d10) at /home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
    #42 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed (this=0x5555568aaf90, pWindow=0x555557806110) at /home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
    #43 0x00007fffedc24eca in vcl::Window::dispose (this=0x555557806110) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
    #44 0x00007fffedbc4b04 in SystemWindow::dispose (this=0x555557806110) at /home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:119
    #45 0x00007fffeda8e38c in Dialog::dispose (this=0x555557806110) at /home/michi/development/git/libreoffice/vcl/source/window/dialog.cxx:632
    #46 0x00007fffedea0d53 in VclReferenceBase::disposeOnce (this=0x5555578061f0) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #47 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear (this=0x7fffffff1338) at include/vcl/vclptr.hxx:208
    #48 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x555557897d70) at /home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
    #49 0x00007ffff0069ec2 in UnoWrapper::WindowDestroyed (this=0x5555568aaf90, pWindow=0x5555578924d0) at /home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:244
    #50 0x00007fffedc24eca in vcl::Window::dispose (this=0x5555578924d0) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
    #51 0x00007fffed9c1dc4 in ImplBorderWindow::dispose (this=0x5555578924d0) at /home/michi/development/git/libreoffice/vcl/source/window/brdwin.cxx:1615
    #52 0x00007fffedea0d53 in VclReferenceBase::disposeOnce (this=0x555557892530) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #53 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear (this=0x7fffffff2b68) at include/vcl/vclptr.hxx:208
    #54 0x00007ffff006a6a7 in UnoWrapper::WindowDestroyed (this=0x5555568aaf90, pWindow=0x555556ef0dc0) at /home/michi/development/git/libreoffice/toolkit/source/helper/unowrapper.cxx:308
    #55 0x00007fffedc24eca in vcl::Window::dispose (this=0x555556ef0dc0) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:217
    #56 0x00007fffedbc4b04 in SystemWindow::dispose (this=0x555556ef0dc0) at /home/michi/development/git/libreoffice/vcl/source/window/syswin.cxx:119
    #57 0x00007fffedc596c1 in WorkWindow::dispose (this=0x555556ef0dc0) at /home/michi/development/git/libreoffice/vcl/source/window/wrkwin.cxx:127
    #58 0x00007fffedea0d53 in VclReferenceBase::disposeOnce (this=0x555556ef0e80) at /home/michi/development/git/libreoffice/vcl/source/outdev/vclreferencebase.cxx:38
    #59 0x00007fffefd29a75 in VclPtr<vcl::Window>::disposeAndClear (this=0x7fffffff40e8) at include/vcl/vclptr.hxx:208
    #60 0x00007fffefd1c382 in VCLXWindow::dispose (this=0x5555570cde30) at /home/michi/development/git/libreoffice/toolkit/source/awt/vclxwindow.cxx:905
    #61 0x00007ffff49f5fd9 in (anonymous namespace)::XFrameImpl::disposing (this=0x555556dd1610) at /home/michi/development/git/libreoffice/framework/source/services/frame.cxx:2184
    #62 0x00007ffff573a1f0 in cppu::WeakComponentImplHelperBase::dispose (this=0x555556dd1610) at /home/michi/development/git/libreoffice/cppuhelper/source/implbase.cxx:104
    #63 0x00007ffff4a02ba5 in cppu::PartialWeakComponentImplHelper<com::sun::star::lang::XServiceInfo, com::sun::star::frame::XFrame2, com::sun::star::awt::XWindowListener, com::sun::star::awt::XTopWindowListener, com::sun::star::awt::XFocusListener, com::sun::star::document::XActionLockable, com::sun::star::util::XCloseable, com::sun::star::frame::XComponentLoader, com::sun::star::frame::XTitle, com::sun::star::frame::XTitleChangeBroadcaster, com::sun::star::beans::XPropertySet, com::sun::star::beans::XPropertySetInfo>::dispose (this=0x555556dd1610) at include/cppuhelper/compbase.hxx:90
    #64 0x00007ffff49fb4d5 in (anonymous namespace)::XFrameImpl::close (this=0x555556dd1610, bDeliverOwnership=0 '\000') at /home/michi/development/git/libreoffice/framework/source/services/frame.cxx:1731
    #65 0x00007ffff4829850 in framework::pattern::frame::closeIt (xResource=uno::Reference to ((anonymous namespace)::XFrameImpl *) 0x555556dd1680) at framework/source/inc/pattern/frame.hxx:57
    #66 0x00007ffff49b92fd in framework::LoadEnv::impl_reactForLoadingState (this=0x7fffffff57b8) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:1655
    #67 0x00007ffff49b8cf6 in framework::LoadEnv::impl_setResult (this=0x7fffffff57b8, bResult=true) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:537
    #68 0x00007ffff49b8b31 in framework::LoadEnv::impl_loadContent (this=0x7fffffff57b8) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:1184
    #69 0x00007ffff49b5c85 in framework::LoadEnv::start (this=0x7fffffff57b8) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:417
    #70 0x00007ffff49b3982 in framework::LoadEnv::startLoading
        (this=0x7fffffff57b8, sURL="file:///home/michi/development/git/libreoffice/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott", lMediaDescriptor=uno::Sequence of length 3 = {...}, xBaseFrame=uno::Reference to (framework::Desktop *) 0x5555568ac098, sTarget="_default", nSearchFlags=0, eFeature=LoadEnvFeatures::WorkWithUI) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:313
    #71 0x00007ffff49b2282 in framework::LoadEnv::loadComponentFromURL
        (xLoader=uno::Reference to (framework::Desktop *) 0x5555568ac0a8, xContext=uno::Reference to (cppu::(anonymous namespace)::ComponentContext *) 0x55555559d808, sURL="file:///home/michi/development/git/libreoffice/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott", sTarget="_default", nSearchFlags=0, lArgs=uno::Sequence of length 3 = {...}) at /home/michi/development/git/libreoffice/framework/source/loadenv/loadenv.cxx:169
    #72 0x00007ffff49e45d2 in framework::Desktop::loadComponentFromURL
        (this=0x5555568ac030, sURL="file:///home/michi/development/git/libreoffice/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott", sTargetFrameName="_default", nSearchFlags=0, lArguments=uno::Sequence of length 3 = {...}) at /home/michi/development/git/libreoffice/framework/source/services/desktop.cxx:594
    #73 0x00007ffff49e4734 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&) ()
        at /home/michi/development/git/libreoffice/instdir/program/libfwklo.so
    #74 0x00007ffff3c6ef72 in SfxTemplateManagerDlg::EditTemplateHdl (this=0x7fffffffa218, rTemplatePath="file:///home/michi/development/git/libreoffice/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott")
        at /home/michi/development/git/libreoffice/sfx2/source/doc/templatedlg.cxx:715
    #75 0x00007ffff3c67eed in SfxTemplateManagerDlg::LinkStubEditTemplateHdl (instance=0x7fffffffa218, data="file:///home/michi/development/git/libreoffice/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott")
        at /home/michi/development/git/libreoffice/sfx2/source/doc/templatedlg.cxx:704
    #76 0x00007ffff36af081 in Link<rtl::OUString const&, void>::Call (this=0x7fffffffa520, data="file:///home/michi/development/git/libreoffice/instdir/share/template/common/officorr/Modern_business_letter_sans_serif.ott")
        at include/tools/link.hxx:105
    #77 0x00007ffff382c9ab in TemplateDlgLocalView::ContextMenuSelectHdl (this=0x7fffffffa320, rIdent=u"edit") at /home/michi/development/git/libreoffice/sfx2/source/control/templatedlglocalview.cxx:154
    #78 0x00007ffff382c66a in TemplateDlgLocalView::createContextMenu (this=0x7fffffffa320, bIsDefault=false, bIsBuiltIn=true, bIsSingleSel=true, rDefaultImg="res/odt_16_8.png")
        at /home/michi/development/git/libreoffice/sfx2/source/control/templatedlglocalview.cxx:140
    #79 0x00007ffff3c6e710 in SfxTemplateManagerDlg::CreateContextMenuHdl (this=0x7fffffffa218, pItem=0x55555788ca90) at /home/michi/development/git/libreoffice/sfx2/source/doc/templatedlg.cxx:680
    #80 0x00007ffff3c67e5d in SfxTemplateManagerDlg::LinkStubCreateContextMenuHdl (instance=0x7fffffffa218, data=0x55555788ca90) at /home/michi/development/git/libreoffice/sfx2/source/doc/templatedlg.cxx:649
    #81 0x00007ffff381bce1 in Link<TemplateViewItem*, void>::Call (this=0x7fffffffa4e0, data=0x55555788ca90) at include/tools/link.hxx:105
    #82 0x00007ffff3816e34 in TemplateLocalView::Command (this=0x7fffffffa320, rCEvt=...) at /home/michi/development/git/libreoffice/sfx2/source/control/templatelocalview.cxx:718
    #83 0x00007fffee228e11 in weld::CustomWeld::DoCommand (this=0x55555779d480, rPos=...) at /home/michi/development/git/libreoffice/vcl/source/app/customweld.cxx:102
    #84 0x00007fffee228b1d in weld::CustomWeld::LinkStubDoCommand (instance=0x55555779d480, data=...) at /home/michi/development/git/libreoffice/vcl/source/app/customweld.cxx:100
    #85 0x00007fffeda99ed6 in Link<CommandEvent const&, bool>::Call (this=0x555557703ef0, data=...) at include/tools/link.hxx:105
    #86 0x00007fffee2813f1 in weld::Widget::signal_command (this=0x555557703ee0, rCEvt=...) at include/vcl/weld/weld.hxx:109
    #87 0x00007fffee247e74 in SalInstanceWidget::CommandHdl (this=0x555557703eb0, rEvent=...) at /home/michi/development/git/libreoffice/vcl/source/app/salvtables.cxx:819
    #88 0x00007fffee244ccd in SalInstanceWidget::LinkStubCommandHdl (instance=0x555557703eb0, data=...) at /home/michi/development/git/libreoffice/vcl/source/app/salvtables.cxx:817
    #89 0x00007fffeda99ed6 in Link<CommandEvent const&, bool>::Call (this=0x5555577f1080, data=...) at include/tools/link.hxx:105
    #90 0x00007fffedc2f524 in vcl::Window::Command (this=0x5555573055d0, rCEvt=...) at /home/michi/development/git/libreoffice/vcl/source/window/window.cxx:1933
    #91 0x00007fffedc4df45 in ImplCallCommand (pChild=..., nEvt=CommandEventId::ContextMenu, pData=0x0, bMouse=true, pPos=0x7fffffff7950) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:258
    #92 0x00007fffedc4d68c in ImplHandleMouseEvent (xWindow=..., nSVEvent=NotifyEventType::MOUSEBUTTONDOWN, bMouseLeave=false, nX=125, nY=130, nMsgTime=71004093, nCode=4, nMode=MouseEventModifiers::NONE)
        at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:827
    #93 0x00007fffedc51581 in ImplHandleSalMouseButtonDown (pWindow=0x5555578924d0, pEvent=0x7fffffff8998) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2367
    #94 0x00007fffedc501f1 in ImplWindowFrameProc (_pWindow=0x5555578924d0, nEvent=SalEvent::MouseButtonDown, pEvent=0x7fffffff8998) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2705
    #95 0x00007fffe6215dcc in SalFrame::CallCallback (this=0x555557805e30, nEvent=SalEvent::MouseButtonDown, pEvent=0x7fffffff8998) at vcl/inc/salframe.hxx:310
    #96 0x00007fffe62be199 in X11SalFrame::HandleMouseEvent (this=0x555557805e30, pEvent=0x7fffffff8e68) at /home/michi/development/git/libreoffice/vcl/unx/generic/window/salframe.cxx:2575
    #97 0x00007fffe62c1e97 in X11SalFrame::Dispatch (this=0x555557805e30, pEvent=0x7fffffff8e68) at /home/michi/development/git/libreoffice/vcl/unx/generic/window/salframe.cxx:3642
    #98 0x00007fffe6231f7b in SalX11Display::Dispatch (this=0x555556884440, pEvent=0x7fffffff8e68) at /home/michi/development/git/libreoffice/vcl/unx/generic/app/saldisp.cxx:1966
    #99 0x00007fffe6231802 in SalX11Display::Yield (this=0x555556884440) at /home/michi/development/git/libreoffice/vcl/unx/generic/app/saldisp.cxx:1865
    #100 0x00007fffe62267df in DisplayYield (fd=5, data=0x555556884440) at /home/michi/development/git/libreoffice/vcl/unx/generic/app/saldisp.cxx:317
    #101 0x00007fffe622235c in (anonymous namespace)::YieldEntry::HandleNextEvent (this=0x7fffe63191e8 <yieldTable+200>) at /home/michi/development/git/libreoffice/vcl/unx/generic/app/saldata.cxx:559
    #102 0x00007fffe6222261 in SalXLib::Yield (this=0x5555555a3b00, bWait=true, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/unx/generic/app/saldata.cxx:751
    #103 0x00007fffe623f29d in X11SalInstance::DoYield (this=0x5555555a1ba0, bWait=true, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/unx/generic/app/salinst.cxx:189
    #104 0x00007fffee300306 in InnerYield (i_bWait=true, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:389
    #105 0x00007fffee2ffb8f in Application::Yield () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:502
    #106 0x00007fffeda927db in Dialog::Execute (this=0x555557806110) at /home/michi/development/git/libreoffice/vcl/source/window/dialog.cxx:1079
    #107 0x00007fffee2505ee in SalInstanceDialog::run (this=0x5555575f5100) at /home/michi/development/git/libreoffice/vcl/source/app/salvtables.cxx:1859
    #108 0x00007fffee6b4c6e in weld::DialogController::run (this=0x7fffffffa218) at /home/michi/development/git/libreoffice/vcl/source/weld/DialogController.cxx:16
    #109 0x00007ffff3c68a94 in SfxTemplateManagerDlg::run (this=0x7fffffffa218) at /home/michi/development/git/libreoffice/sfx2/source/doc/templatedlg.cxx:262
    #110 0x00007ffff36578af in SfxApplication::NewDocExec_Impl (this=0x555556dbccf0, rReq=...) at /home/michi/development/git/libreoffice/sfx2/source/appl/appopen.cxx:473
    #111 0x00007ffff3650dd5 in SfxStubSfxApplicationNewDocExec_Impl (pShell=0x555556dbccf0, rReq=...) at workdir/SdiTarget/sfx2/sdi/sfxslots.hxx:1310
    #112 0x00007ffff37aa26e in SfxDispatcher::Call_Impl (this=0x555556979a30, rShell=..., rSlot=..., rReq=..., bRecord=true) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:256
    #113 0x00007ffff37b0156 in SfxDispatcher::PostMsgHandler (this=0x555556979a30, pReq=std::unique_ptr<SfxRequest> = {...}) at /home/michi/development/git/libreoffice/sfx2/source/control/dispatch.cxx:997
    #114 0x00007ffff3ca5458 in SfxHintPoster::DoEvent_Impl (this=0x555556db3930, pPostedHint=0x5555576ed980) at /home/michi/development/git/libreoffice/sfx2/source/notify/hintpost.cxx:74
    #115 0x00007ffff3ca539d in SfxHintPoster::LinkStubDoEvent_Impl (instance=0x555556db3930, data=0x5555576ed980) at /home/michi/development/git/libreoffice/sfx2/source/notify/hintpost.cxx:54
    #116 0x00007fffedc583f1 in Link<void*, void>::Call (this=0x5555577cabb8, data=0x5555576ed980) at include/tools/link.hxx:105
    #117 0x00007fffedc53d11 in ImplHandleUserEvent (pSVEvent=0x5555577cabb0) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2314
    #118 0x00007fffedc50c3f in ImplWindowFrameProc (_pWindow=0x555556db2f40, nEvent=SalEvent::UserEvent, pEvent=0x5555577cabb0) at /home/michi/development/git/libreoffice/vcl/source/window/winproc.cxx:2871
    #119 0x00007fffee830cbc in SalFrame::CallCallback (this=0x555556b048a0, nEvent=SalEvent::UserEvent, pEvent=0x5555577cabb0) at vcl/inc/salframe.hxx:310
    #120 0x00007fffee85721f in SalGenericDisplay::ProcessEvent (this=0x555556884440, aEvent=...) at /home/michi/development/git/libreoffice/vcl/unx/generic/app/gendisp.cxx:66
    #121 0x00007fffee234c9d in SalUserEventList::DispatchUserEvents(bool)::$_0::operator()() const (this=0x7fffffffb390) at /home/michi/development/git/libreoffice/vcl/source/app/salusereventlist.cxx:119
    #122 0x00007fffee234b6b in SalUserEventList::DispatchUserEvents (this=0x555556884440, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/salusereventlist.cxx:120
    #123 0x00007fffee857175 in SalGenericDisplay::DispatchInternalEvent (this=0x555556884440, bHandleAllCurrentEvent=false) at /home/michi/development/git/libreoffice/vcl/unx/generic/app/gendisp.cxx:51
    #124 0x00007fffe6231784 in SalX11Display::Yield (this=0x555556884440) at /home/michi/development/git/libreoffice/vcl/unx/generic/app/saldisp.cxx:1856
    #125 0x00007fffe62267df in DisplayYield (fd=5, data=0x555556884440) at /home/michi/development/git/libreoffice/vcl/unx/generic/app/saldisp.cxx:317
    #126 0x00007fffe622235c in (anonymous namespace)::YieldEntry::HandleNextEvent (this=0x7fffe63191e8 <yieldTable+200>) at /home/michi/development/git/libreoffice/vcl/unx/generic/app/saldata.cxx:559
    #127 0x00007fffe6221bc9 in SalXLib::Yield (this=0x5555555a3b00, bWait=true, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/unx/generic/app/saldata.cxx:655
    #128 0x00007fffe623f29d in X11SalInstance::DoYield (this=0x5555555a1ba0, bWait=true, bHandleAllCurrentEvents=false) at /home/michi/development/git/libreoffice/vcl/unx/generic/app/salinst.cxx:189
    #129 0x00007fffee300306 in InnerYield (i_bWait=true, i_bAllEvents=false) at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:389
    #130 0x00007fffee2ffb8f in Application::Yield () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:502
    #131 0x00007fffee2ff970 in Application::Execute () at /home/michi/development/git/libreoffice/vcl/source/app/svapp.cxx:364
    #132 0x00007ffff7b228b5 in desktop::Desktop::Main (this=0x7fffffffd550) at /home/michi/development/git/libreoffice/desktop/source/app/app.cxx:1681
    #133 0x00007fffee329376 in ImplSVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:230
    #134 0x00007fffee32ae99 in SVMain () at /home/michi/development/git/libreoffice/vcl/source/app/svmain.cxx:248
    #135 0x00007ffff7b9c86a in soffice_main () at /home/michi/development/git/libreoffice/desktop/source/app/sofficemain.cxx:122
    #136 0x0000555555555a2d in sal_main () at /home/michi/development/git/libreoffice/desktop/source/app/main.c:51
    #137 0x0000555555555a07 in main (argc=1, argv=0x7fffffffd758) at /home/michi/development/git/libreoffice/desktop/source/app/main.c:49

Change-Id: I06da3836405b46671785824fbcee8db863048685
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197637
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit ab7a187b28ac1f40d47552d2ce05811dfa03fe59)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197720
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
1 file changed
tree: 6ca884e7ecd597e6575ae82543093cb97ff608d3
  1. .config/
  2. .cspell/
  3. .git-hooks/
  4. .github/
  5. .vscode/
  6. android/
  7. animations/
  8. apple_remote/
  9. avmedia/
  10. basctl/
  11. basegfx/
  12. basic/
  13. bean/
  14. bin/
  15. binaryurp/
  16. bridges/
  17. canvas/
  18. chart2/
  19. cli_ure/
  20. codemaker/
  21. comphelper/
  22. compilerplugins/
  23. config_host/
  24. configmgr/
  25. connectivity/
  26. cppcanvas/
  27. cppu/
  28. cppuhelper/
  29. cpputools/
  30. cui/
  31. dbaccess/
  32. desktop/
  33. distro-configs/
  34. docmodel/
  35. drawinglayer/
  36. editeng/
  37. embeddedobj/
  38. embedserv/
  39. emfio/
  40. eventattacher/
  41. extensions/
  42. external/
  43. extras/
  44. filter/
  45. forms/
  46. formula/
  47. fpicker/
  48. framework/
  49. helpcompiler/
  50. hwpfilter/
  51. i18nlangtag/
  52. i18npool/
  53. i18nutil/
  54. icon-themes/
  55. idl/
  56. idlc/
  57. include/
  58. instsetoo_native/
  59. io/
  60. ios/
  61. javaunohelper/
  62. jurt/
  63. jvmaccess/
  64. jvmfwk/
  65. l10ntools/
  66. librelogo/
  67. libreofficekit/
  68. lingucomponent/
  69. linguistic/
  70. lotuswordpro/
  71. m4/
  72. msicreator/
  73. net_ure/
  74. nlpsolver/
  75. o3tl/
  76. odk/
  77. offapi/
  78. officecfg/
  79. oovbaapi/
  80. oox/
  81. opencl/
  82. osx/
  83. package/
  84. pch/
  85. postprocess/
  86. pyuno/
  87. qadevOOo/
  88. readlicense_oo/
  89. registry/
  90. remotebridges/
  91. reportbuilder/
  92. reportdesign/
  93. ridljar/
  94. rust_uno/
  95. sal/
  96. salhelper/
  97. sax/
  98. sc/
  99. scaddins/
  100. sccomp/
  101. schema/
  102. scp2/
  103. scripting/
  104. sd/
  105. sdext/
  106. setup_native/
  107. sfx2/
  108. shell/
  109. slideshow/
  110. smoketest/
  111. solenv/
  112. soltools/
  113. sot/
  114. starmath/
  115. static/
  116. stoc/
  117. store/
  118. svgio/
  119. svl/
  120. svtools/
  121. svx/
  122. sw/
  123. swext/
  124. sysui/
  125. test/
  126. testtools/
  127. toolkit/
  128. tools/
  129. ucb/
  130. ucbhelper/
  131. udkapi/
  132. uitest/
  133. UnoControls/
  134. unodevtools/
  135. unoidl/
  136. unoil/
  137. unotest/
  138. unotools/
  139. unoxml/
  140. ure/
  141. uui/
  142. vbahelper/
  143. vcl/
  144. winaccessibility/
  145. wizards/
  146. writerperfect/
  147. xmlhelp/
  148. xmloff/
  149. xmlreader/
  150. xmlscript/
  151. xmlsecurity/
  152. .buckconfig
  153. .buckversion
  154. .clang-format
  155. .editorconfig
  156. .git-blame-ignore-revs
  157. .gitattributes
  158. .gitignore
  159. .gitmodules
  160. .gitpod.dockerfile
  161. .gitpod.yml
  162. .gitreview
  163. antivirusDetection.vbs
  164. autogen.sh
  165. BUCK
  166. config.guess
  167. config.sub
  168. config_host.mk.in
  169. config_host_lang.mk.in
  170. configure.ac
  171. COPYING
  172. COPYING.LGPL
  173. COPYING.MPL
  174. cpp.hint
  175. download.lst
  176. g
  177. install-sh
  178. install_deps.sh
  179. leak-suppress.txt
  180. Library_merged.mk
  181. logerrit
  182. Makefile.fetch
  183. Makefile.gbuild
  184. Makefile.in
  185. README.cross
  186. README.help.md
  187. README.md
  188. README.Solaris
  189. README.yrs
  190. Repository.mk
  191. RepositoryExternal.mk
  192. RepositoryFixes.mk
  193. RepositoryModule_build.mk
  194. RepositoryModule_host.mk
  195. sanitize-ubsan-excludelist
  196. setup.cfg
  197. TEMPLATE.SOURCECODE.HEADER
  198. tsan-suppress.txt
README.md

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:
  • 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.1.8. 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:

ModuleDescription
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

ModuleDescription
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:

ModuleDescription
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.