summaryrefslogtreecommitdiff
path: root/framework
AgeCommit message (Collapse)Author
2023-11-10loplugin:fieldcast in framework::AddonsToolBarWrapperNoel Grandin
Change-Id: I1fc692581acc805d6c84156d6df57093cf9dff93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159281 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-10loplugin:fieldcast in framework::MenuBarManager::MenuItemHandlerNoel Grandin
Change-Id: I5a98f1bc5783bbd78ba6596ced9bb77cd3037f95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159280 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-10loplugin:fieldcast in framework::MenuBarWrapperNoel Grandin
Change-Id: I7e44ad4db77db5fe4de543f47ffc4b8127e0ebea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159255 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-10loplugin:fieldcast in framework::StatusBarWrapperNoel Grandin
Change-Id: I10198364323ed1886f6f356c964fc68bab8627e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159254 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-10loplugin:fieldcast in framework::ToolBarWrapperNoel Grandin
Change-Id: I4158b4c0b5ce57cca5a2a0978ac951274202c159 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159253 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-10-23Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]StringStephan Bergmann
...in include files. This is a mix of automatic rewriting in include files and manual fixups (mostly addressing loplugin:redundantfcast) in source files that include those. Change-Id: I1f3cc1e67b9cabd2e9d61a4d9e9a01e587ea35cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158337 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-20Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: frameworkStephan Bergmann
Change-Id: I0f17c569eddcdc30bfca4cdcd25cb05cf783ec23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158200 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-18Clean up the remaining uses of OUStringConstExpr, and drop itStephan Bergmann
Change-Id: I30b2ac77b58e2ae1d1e997a0c830c513542b973d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158101 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-14Add NUMBERSIGN key handler.Gökay Şatır
German keyboard layout has number sign key. Users can print number sign without using modification keys. So this key can be assigned a shortcut. Subscript is assigned to CTRL + NUMBERSIGN. Below PR is used as reference when adding the new key handler: https://gerrit.libreoffice.org/c/core/+/86713 Signed-off-by: Gökay Şatır <gokaysatir@collabora.com> Change-Id: I340dc47764e9200d2477f8db740a629f62f48004 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157554 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit 1db8f6d484b884301a7d3673f4d05478e28cd853) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157959 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-12Make NC_ constexpr-friendlyStephan Bergmann
...by moving the char8_t -> char reinterpret_cast out of any potential constexpr paths into a new TranslateId::getId. And demonstrate constexpr'ability by making the aCategories var in OApplicationIconControl::Fill (dbaccess/source/ui/app/AppIconControl.cxx) constexpr. (And there might be more such cases that could now be made constexpr.) Change-Id: I0b4e3292faf8f6b901f9b9e934e1aa6bf0f583ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157862 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-11Drop o3tl::span, can use C++20 std::span directly nowStephan Bergmann
Change-Id: Ic21ff7bf48f07f7277979d52e99d2c5c268de83f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157825 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-11make CppunitTest_framework_dispatch reliableCaolán McNamara
the appearance of 2 interceptions is reproducible for me on linux with make CppunitTest_framework_dispatch VALGRIND=memcheck 1st time #1 (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:139 #2 non-virtual thunk to (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:0 #3 framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:87 #4 non-virtual thunk to framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:0 #5 (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:2329 #6 non-virtual thunk to (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:0 #7 framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/framework/source/services/dispatchhelper.cxx:110 #8 non-virtual thunk to framework::DispatchHelper::executeDispatch(com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/framework/source/services/dispatchhelper.cxx:0 #9 unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/unotest/source/cpp/macros_test.cxx:94 #10 (anonymous namespace)::testInterception::TestBody() at core/framework/qa/cppunit/dispatchtest.cxx:172 2nd time #1 (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:139 #2 non-virtual thunk to (anonymous namespace)::MyInterceptor::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/qa/cppunit/dispatchtest.cxx:0 #3 framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:87 #4 non-virtual thunk to framework::InterceptionHelper::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/dispatch/interceptionhelper.cxx:0 #5 (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:2329 #6 non-virtual thunk to (anonymous namespace)::XFrameImpl::queryDispatch(com::sun::star::util::URL const&, rtl::OUString const&, int) at core/framework/source/services/frame.cxx:0 #7 SfxStateCache::GetSlotServer(SfxDispatcher&, com::sun::star::uno::Reference<com::sun::star::frame::XDispatchProvider> const&) at core/sfx2/source/control/statcach.cxx:263 #8 SfxBindings::UpdateSlotServer_Impl() at core/sfx2/source/control/bindings.cxx:1083 #9 SfxBindings::NextJob_Impl(Timer const*) at core/sfx2/source/control/bindings.cxx:1254 #10 SfxBindings::NextJob(Timer*) at core/sfx2/source/control/bindings.cxx:1222 #11 SfxBindings::LinkStubNextJob(void*, Timer*) at core/sfx2/source/control/bindings.cxx:1219 #12 Link<Timer*, void>::Call(Timer*) const at core/include/tools/link.hxx:111 #13 Timer::Invoke() at core/vcl/source/app/timer.cxx:76 #14 Scheduler::CallbackTaskScheduling() at core/vcl/source/app/scheduler.cxx:480 #15 SalTimer::CallCallback() at core/vcl/inc/saltimer.hxx:55 #16 SvpSalInstance::CheckTimeout(bool) at core/vcl/headless/svpinst.cxx:161 #17 SvpSalInstance::ImplYield(bool, bool) at core/vcl/headless/svpinst.cxx:399 #18 SvpSalInstance::DoYield(bool, bool) at core/vcl/headless/svpinst.cxx:471 #19 ImplYield(bool, bool) at core/vcl/source/app/svapp.cxx:377 #20 Scheduler::ProcessEventsToIdle() at core/vcl/source/app/svapp.cxx:407 #21 unotest::MacrosTest::dispatchCommand(com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at core/unotest/source/cpp/macros_test.cxx:95 #22 (anonymous namespace)::testInterception::TestBody() at core/framework/qa/cppunit/dispatchtest.cxx:172 setting bold/italic will invalidate the slot for the property and timer starts to update the normal listeners to those properties which might kick in on a slower run. Change-Id: Ib37e61c0fbed463f8974d476158e54a0160a2c92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157798 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-09-25tdf#155698 - Start Center: Retain pinned items when clearing the listAndreas Heinisch
Change-Id: Ife54845e020977cdb80a7fcc1fa63333afc17b32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157169 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
2023-09-25tdf#146150 Use dispatch cmd for the corresponding SIDapurvapriyadarshi
Change-Id: I0d987a8b10f2c69192d080b534a1d6aa71a6cf4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157105 Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
2023-09-04tdf#147021 use std::size instead of SAL_N_ELEMENTSAdam Seskunas
Change-Id: Ibc6c83f950890ac9b7a754cc49973736fa81dcb8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156364 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2023-08-27tdf#45904: Remove old SwXReferenceMarks Java testanfanite396
Change-Id: I8830e54fdba98d3cfd1e2844e7faf02e55e7d0ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156044 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-25tdf#45904: Remove old SwXParagraphEnumeration Java testanfanite396
Change-Id: Ia8b639e016971e389d24d4468492af902d1dc35b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156042 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-25tdf#45904: Remove old SwXFootnotes Java testanfanite396
Change-Id: I7444b8521b560c91d2908d14330a3c6d6ff420cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156041 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-25tdf#45904: Remove old SwXFieldEnumeration Java testanfanite396
Change-Id: I5bbefc7c1c5ac9ebd88669ac328bba28183b76ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156033 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-25tdf#45904: Remove old SwXDocumentIndexes Java testanfanite396
Change-Id: I93556b3c56887b424dd8720d752986563a0fa807 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156032 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-25tdf#45904: Remove old SwXStyleFamilies Java testanfanite396
Change-Id: I3057e4a2fcf1b057d35050bfeb7c22fbad19325b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156045 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-25tdf#45904: Move SwXTextEmbeddedObjects Java tests to C++anfanite396
Change-Id: I05ad9e264162e3fb97ebea814f59ed44bf23056a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156050 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-25tdf#45904: Remove old SwXReferenceMark Java testanfanite396
Change-Id: I81acf617726b7e7e5b5510b0d6d7677c7d08aba5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156043 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-25tdf#45904: Move SwXTextFieldMasters Java tests to C++anfanite396
Change-Id: Ifa185b24fe49f2c88e4d3687a09ebce5987503a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156051 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-23tdf#45904: Remove old SwXBookmark Java testanfanite396
Change-Id: If17818329b805a03b975e105ea97f7c6cc16d1a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155767 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-23tdf#45904: Move SwXTextTables Java tests to C++anfanite396
Change-Id: I3946e68ce5c8a9611c243e427bc94c277c0a5456 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155810 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-23tdf#45904: Move SwXTextSections Java tests to C++anfanite396
Change-Id: I24f7098f71a126790a177715a85fcea2724cb4aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155808 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-21Move SwXTextFieldTypes Java tests to C++anfanite396
Change-Id: I77ca9bc6cd0db626df826e2084514d34becf39bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154208 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-21tdf#45904: Remove old SwXBookmarks Java testanfanite396
Change-Id: Ie8d66b74192d1741922a7728934317859821fa00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155745 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-19loplugin: new global analysis locking2Noel Grandin
look for methods where we don't need to guard access to the field, because the field is never modified Change-Id: I62c33cc3f52881557515765d3733c4afc78547aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155836 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-15VCLSession: avoid null dereferencesJustin Luth
Found while I was (mis)using XSessionManagerListener2 in https://gerrit.libreoffice.org/c/core/+/155460 But I think these are valid anyway. Certainly one is when it is checked in the try clause but not in the catch clause. Change-Id: Ia3f7211e4a4c86dd503ffe1b04e5b5c13227218e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155719 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-08-12Fix typoAndrea Gelmini
Change-Id: Id2c317c44e6bc4e2c9d0d0e7fd830b6b414e8c75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155624 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-08-12tdf#137878 autorecovery: reduce "file not found" pop-upsJustin Luth
For a DOCX file, there were four of them during a recovery if the file was on a USB or renamed or whatever. Now there aren't any. Change-Id: I5cbad6e4ed1a1bc1d3b8e805a6b493f4ee61ec68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155567 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-11autorecovery: add some documentationJustin Luth
Change-Id: I9a037e263ecdc374df9450ee9a066468dc6ab5e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155426 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-08-10partial Revert "tdf#144512 autorecovery: always wait for user idle...Justin Luth
... with timed save" in order to restore useful comments This reverts 24.2 commit 75d7464e7eb94df1ad9904ad750b27d99d91abc5, where the ResettableMutexGuard's safety is cancelled by a g.clear() // } /* SAFE */ and re-instated with a g.reset() // /* SAFE */ { Thanks Mike for explaining the obvious to me. Change-Id: I98016a50221b734a38d14bce0a958c6af9e57944 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155514 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-08-09tdf#144512 autorecovery: always wait for user idle with timed saveJustin Luth
Only the "active" document was waiting for a user idle. But that doesn't make sense because the background apps still lock the foreground app during file save. So all timed backups should wait for a user idle period before starting their recovery / autosave. Once an idle loop is triggered, no autosave will ever run again until an idle timeout occurs! So a busy user who switches from one doc to another without ever pausing still wouldn't ever get a backup - even from the background docs! Without this patch, only the first modified documents (if backgrounded within 10 minutes) would ever get a recovery save. So in pretty much every case this patch makes sense AFAICS. Change-Id: I6e9e04aa2e50895e53826b427cb52c129da43701 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155459 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-08-09tdf#144512 autorecovery: only wait once for user idleJustin Luth
If we currently are in a user idle state, then don't delay any recovery / autosave's until a future idle timeout. Change-Id: Ie3953bb7456370d046b76a4cad816498dbfc85e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155462 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-08-07tdf#57414 autorecovery: ignoreClosing during Emergency/SessionSaveJustin Luth
Unmodified documents were losing the enties from RecoveryList when implts_deregisterDocument was triggered, which prevented the Session recovery from being able to reload them. Change-Id: I991a9821105aca81ec596b28341ef4335b817439 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155380 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-08-07tdf#57414 autorecovery: avoid unnecessary storeToRecoveryFileJustin Luth
With a successful UserAutoBackup, the document is fully saved, and the recoveryInfo entry is removed. So just avoid the recovery that would just be deleted anyway. Change-Id: I3cc9fe2730640df48f450f900f33afc2df7f020a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155273 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-08-07tdf#57414 autorecovery: don't store unmodified docs in RecoveryListJustin Luth
When a document is successfully saved (manually), it is removed from RecoveryList (implts_markDocumentAsSaved) and all of the temporary recovery files are removed from the user's backup folder. If the document is automatically saved (UserAutoSave) successfully, it doesn't need to remain in the RecoveryList either. storeToRecoveryFile can benefit from knowing if it will be removed, so determine whether to bRemoveIt just prior to that call. Change-Id: I2cb30b426e600cfe34987a091acaf8826316ede5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155272 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-08-07tdf#57414 autorecovery: not in RecoveryList? always delete tmp filesJustin Luth
In all but one case, the storeToRecoveryFiles were deleted when the entry was removed from the RecoveryList (and likely it should have been removed in that case as well, since the program could not open that file anyway). So, move that function into the flushConfig function to ensure that recovery files are not orphaned in the backup folder. If the URLs are not cleared, and the recovery tries to load the non-existing file, then LO will assert (or maybe crash). (For implts_markDocumentAsSaved, it does the deletefiles/flushCOnfig outside of the SAFE area, but updates m_lDocCache with *pIt = aInfo inside the SAFE area, so those deletefiles/clears cannot be cleaned up.) (implts_cleanUpWorkingEntry and implts_deregisterDocument both remove the m_lDocCache entry competely, so it was not necessary to clear the URLs in those two cases.) Change-Id: I765f3a815f28082495a7f286a8b28b977e0cad75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155118 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-08-07tdf#57414 autorecovery: don't always add every file to RecoveryListJustin Luth
There is no need to recover documents that are not modified, and certainly not if there is no storeToRecoveryFile. This specifically is nice for read-only files, new files, or e-mailed files that have just been opened for viewing. registerDocument: A just opened file has nothing to recover, so wait until it has storeToRecoveryFile'd. - Emergency and Session pre-register all documents via implts_persistAllActiveViewNames, so no problem here. resetHandleStates: shouldn't add, just update the existing states saveOneDoc: shouldn't add before storeToRecoveryFile, only after. Change-Id: I4a935ee325af6469b25c5bf3d2860c4065d9130d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154490 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-08-07related tdf#57414 autosave: try harder to know when !IsModifiedJustin Luth
The cache that holds document status did: -saveDocs: for each cached document status: -creates a copy of the cached status -call saveOneDoc: given the copy [-updateModifiedState should get called, updating the cache itself] -saveOneDoc: flushConfig writes copy to RecoveryList (as modified) -cache is updated with the results from saveOneDoc (*pIt = aInfo) Now, it is easily possible that saveOneDoc changed the status from modified, to not modified, wouldn't you think (if UserAutoSave)? But since the copy was never updated, it reported as modified still! storeToRecoveryFile can benefit from knowing the real modified status, so do the update just prior to that call. Change-Id: Iee1ddd0bf7bee25d5ba3e7abb1ac6713295906af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154683 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
2023-08-03tdf#71550 autorecovery: use osl::File::Remove when isEmptyFileUrlJustin Luth
Mike K suggested I just use the simpler, faster function in this case. Change-Id: I0f7f6611f12f88cd1daa4104b58eb44365a44ae3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155271 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-08-02tdf#144512 autorecovery: don't delay autosave on shutdownJustin Luth
Change-Id: I98ee31369aa46c4e3aeb405ec11a1ef197c31fe0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155165 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-08-02tdf#65509 autorecovery: don't UserAutoSave during EmergencySaveJustin Luth
Saving overtop of the working document during a crash save does not sound like a safe thing to do. However, an ODF recovery export is attempted which will preserve unsaved modifications, so avoiding this save should not cause data loss. Change-Id: Ie993042b4c99d5dfb816727d4bfae5bca694d72f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155166 Tested-by: Justin Luth <jluth@mail.com> Reviewed-by: Justin Luth <jluth@mail.com>
2023-08-02split Point/Size/Rectangle into AbsoluteScreenPixel* typesNoel Grandin
to attempt to make it obvious in code what kind of coordinate system we are dealing with. The idea is that by doing this, the compile-time type checking will flush out inconsistencies between different code. I started with vcl::Window::OutputToAbsoluteScreenPixel and worked outwards from there. Change-Id: Ia967d7a0bb38886695f3a761b85c8b9340ddb1c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154676 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-01tdf#57414 autorecovery: if no recovery doc, remove from RecoveryListJustin Luth
The document has just been saved (perhaps manually, perhaps automatically) and so the recovery ODF files are being removed. So remove from RecoveryList since there is nothing recoverable at this point. Sure the document is open, and perhaps there is even a modification already, but if there are no recovery files available, then why display it to the user? Change-Id: I309cd7df573c960f75c2240c8b5cf171fc1d95be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155059 Tested-by: Justin Luth <jluth@mail.com> Reviewed-by: Justin Luth <jluth@mail.com>
2023-07-28tdf#104382 - Menus should be disabled when they have no enabled submenusBalazs Varga
Disable menu elements if they only have disabled submenu elemets. TODO: GTK3 Change-Id: I83cdc58846afd61719ceeba9f993df894ce6fd01 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154938 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>