Commit Graph
5644 Commits
Author SHA1 Message Date
Stephan Bergmann 13b7905ba1 Remove misleading comment
...that had been added with 33fa50e119 "Drop some
pointless assertions" back in 2011, but is no longer meaningful now that this is
a proper assert since 6e35794cad "terminate
XDesktop properly in unit tests"

Change-Id: Id8592df03f2a4c070af3cc691a0aa65ba8c2c061
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160675
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-12-13 20:48:27 +01:00
Caolán McNamara 15ff0c3828 cid#1545975 COPY_INSTEAD_OF_MOVE
and

cid#1545955 COPY_INSTEAD_OF_MOVE
cid#1545954 COPY_INSTEAD_OF_MOVE
cid#1545952 COPY_INSTEAD_OF_MOVE
cid#1545948 COPY_INSTEAD_OF_MOVE
cid#1545943 COPY_INSTEAD_OF_MOVE
cid#1545935 COPY_INSTEAD_OF_MOVE
cid#1545930 COPY_INSTEAD_OF_MOVE
cid#1545928 COPY_INSTEAD_OF_MOVE
cid#1545925 COPY_INSTEAD_OF_MOVE
cid#1545922 COPY_INSTEAD_OF_MOVE

Change-Id: I28d830504337f417829c675b1eb9c763b83b30c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160522
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-10 11:57:35 +01:00
Caolán McNamara 5d3d7cd656 cid#1546281 COPY_INSTEAD_OF_MOVE
and

cid#1546278 COPY_INSTEAD_OF_MOVE
cid#1546276 COPY_INSTEAD_OF_MOVE
cid#1546247 COPY_INSTEAD_OF_MOVE
cid#1546244 COPY_INSTEAD_OF_MOVE
cid#1546243 COPY_INSTEAD_OF_MOVE
cid#1546220 COPY_INSTEAD_OF_MOVE
cid#1546209 COPY_INSTEAD_OF_MOVE
cid#1546207 COPY_INSTEAD_OF_MOVE
cid#1546206 COPY_INSTEAD_OF_MOVE
cid#1546205 COPY_INSTEAD_OF_MOVE
cid#1546197 COPY_INSTEAD_OF_MOVE
cid#1546180 COPY_INSTEAD_OF_MOVE
cid#1546172 COPY_INSTEAD_OF_MOVE
cid#1546165 COPY_INSTEAD_OF_MOVE
cid#1546164 COPY_INSTEAD_OF_MOVE
cid#1546158 COPY_INSTEAD_OF_MOVE
cid#1546151 COPY_INSTEAD_OF_MOVE
cid#1546135 COPY_INSTEAD_OF_MOVE
cid#1546132 COPY_INSTEAD_OF_MOVE
cid#1546129 COPY_INSTEAD_OF_MOVE
cid#1546128 COPY_INSTEAD_OF_MOVE
cid#1546122 COPY_INSTEAD_OF_MOVE
cid#1546117 COPY_INSTEAD_OF_MOVE
cid#1546113 COPY_INSTEAD_OF_MOVE
cid#1546106 COPY_INSTEAD_OF_MOVE
cid#1546099 COPY_INSTEAD_OF_MOVE
cid#1546091 COPY_INSTEAD_OF_MOVE
cid#1546085 COPY_INSTEAD_OF_MOVE
cid#1546069 COPY_INSTEAD_OF_MOVE
cid#1546063 COPY_INSTEAD_OF_MOVE
cid#1546062 COPY_INSTEAD_OF_MOVE
cid#1546058 COPY_INSTEAD_OF_MOVE
cid#1546056 COPY_INSTEAD_OF_MOVE
cid#1546051 COPY_INSTEAD_OF_MOVE
cid#1546040 COPY_INSTEAD_OF_MOVE
cid#1546030 COPY_INSTEAD_OF_MOVE
cid#1546028 COPY_INSTEAD_OF_MOVE
cid#1546015 COPY_INSTEAD_OF_MOVE
cid#1546001 COPY_INSTEAD_OF_MOVE

Change-Id: Ib954c92a300fc323b29f27880fdf8bc46ed98862
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160520
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-10 11:57:12 +01:00
Caolán McNamara d516400618 cid#1546422 COPY_INSTEAD_OF_MOVE
and

cid#1546416 COPY_INSTEAD_OF_MOVE
cid#1546415 COPY_INSTEAD_OF_MOVE
cid#1546391 COPY_INSTEAD_OF_MOVE
cid#1546390 COPY_INSTEAD_OF_MOVE
cid#1546317 COPY_INSTEAD_OF_MOVE
cid#1546252 COPY_INSTEAD_OF_MOVE
cid#1546251 COPY_INSTEAD_OF_MOVE
cid#1546249 COPY_INSTEAD_OF_MOVE
cid#1546243 COPY_INSTEAD_OF_MOVE
cid#1546195 COPY_INSTEAD_OF_MOVE
cid#1546193 COPY_INSTEAD_OF_MOVE
cid#1546137 COPY_INSTEAD_OF_MOVE
cid#1545738 COPY_INSTEAD_OF_MOVE
cid#1545782 COPY_INSTEAD_OF_MOVE

Change-Id: I10d5091aa72b682371764b8a18cc5062e272c031
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160285
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-12-04 10:48:59 +01:00
Noel Grandin 29fc0ec993 Split the *Bitmap::CopyPixel functions
into the two entire separate cases they want to handle, there is
no reason to mix the two different cases like this.

Change-Id: I38e99e7ad6168a84e7a744f61407887825158902
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160248
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-12-03 17:39:43 +01:00
Mike Kaganski 6ea42a1166 tdf#158396: show DocumentTitle when set in MediaDescriptor
Change-Id: Ic89de9e7d83c7c96eb1b2cc51798d354b38f86d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159904
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-11-27 12:54:34 +01:00
Mike Kaganski 9ada569e6e Simplify a bit
Change-Id: I1609b9dfc047ad55bbaeee369b643d654903866e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159903
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-11-27 11:36:17 +01:00
Noel Grandin baafd5aca2 loplugin:fieldcast in LayoutManager
Change-Id: I3fc7a2c690344ee6934111cdffc0b23ff2537b44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159841
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-23 08:14:10 +01:00
Noel Grandin 89945d7192 loplugin:fieldcast in LayoutManager
Change-Id: Ib0b56703cd6782d850ab5960a7fa53d15eb443a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159840
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-23 08:14:02 +01:00
Julien Nabet 4bbd9853af c++20: use std::erase(_if) instead of std::remove(_if)+erase (part 4)
Change-Id: I6af5501e3fde07024dcc74f00c8fd69bd369d8d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159613
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2023-11-18 18:38:36 +01:00
Noel Grandin 28756e84e4 loplugin:fieldcast in framework::AddonsToolBarWrapper
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-10 12:36:48 +01:00
Noel Grandin e88c98f81c loplugin:fieldcast in framework::MenuBarManager::MenuItemHandler
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-10 12:36:41 +01:00
Noel Grandin 86441791e2 loplugin:fieldcast in framework::MenuBarWrapper
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-10 12:35:17 +01:00
Noel Grandin ba1c844fe8 loplugin:fieldcast in framework::StatusBarWrapper
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-10 09:53:17 +01:00
Noel Grandin 11a97db6c8 loplugin:fieldcast in framework::ToolBarWrapper
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-11-10 09:53:09 +01:00
Stephan Bergmann bd6fb0cd3e Extended loplugin:ostr: Rewrite some O[U]StringLiteral -> O[U]String
...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-23 11:04:42 +02:00
Stephan Bergmann 64c47c92d0 Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: framework
Change-Id: I0f17c569eddcdc30bfca4cdcd25cb05cf783ec23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158200
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-20 07:06:17 +02:00
Stephan Bergmann b946842a74 Clean up the remaining uses of OUStringConstExpr, and drop it
Change-Id: I30b2ac77b58e2ae1d1e997a0c830c513542b973d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158101
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-18 11:26:44 +02:00
Gökay Şatır ca74511985 Add NUMBERSIGN key handler.
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-14 21:51:43 +02:00
Stephan Bergmann e0c33ec15f loplugin:ostr: automatic rewrite
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
2023-10-07 00:47:20 +02:00
Andreas Heinisch 71cae3a219 tdf#155698 - Start Center: Retain pinned items when clearing the list
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-25 14:15:37 +02:00
Adam Seskunas b1b002c293 tdf#147021 use std::size instead of SAL_N_ELEMENTS
Change-Id: Ibc6c83f950890ac9b7a754cc49973736fa81dcb8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156364
Tested-by: Jenkins
Reviewed-by: Hossein <hossein@libreoffice.org>
2023-09-04 15:50:51 +02:00
Noel Grandin 7ffa7e56c0 loplugin: new global analysis locking2
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-19 17:40:47 +02:00
Justin Luth 918cd8cbf3 VCLSession: avoid null dereferences
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-15 19:04:45 +02:00
Andrea Gelmini e6007b3be1 Fix typo
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-12 10:55:07 +02:00
Justin Luth f1c3526dee tdf#137878 autorecovery: reduce "file not found" pop-ups
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-12 01:36:13 +02:00
Justin Luth 3b81780ae9 autorecovery: add some documentation
Change-Id: I9a037e263ecdc374df9450ee9a066468dc6ab5e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155426
Reviewed-by: Justin Luth <jluth@mail.com>
Tested-by: Jenkins
2023-08-11 00:11:06 +02:00
Justin Luth c3cb2f956d partial Revert "tdf#144512 autorecovery: always wait for user idle...
... 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-10 22:23:03 +02:00
Justin Luth 90b23d0b45 tdf#144512 autorecovery: always wait for user idle with timed save
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-09 12:13:44 +02:00
Justin Luth c3cf88f73e tdf#144512 autorecovery: only wait once for user idle
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-09 04:10:48 +02:00
Justin Luth ceeb48b33b tdf#57414 autorecovery: ignoreClosing during Emergency/SessionSave
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-07 18:15:47 +02:00
Justin Luth 63bb760acc tdf#57414 autorecovery: avoid unnecessary storeToRecoveryFile
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-07 17:43:54 +02:00
Justin Luth f5d6888bd1 tdf#57414 autorecovery: don't store unmodified docs in RecoveryList
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-07 17:43:10 +02:00
Justin Luth 9fffac2011 tdf#57414 autorecovery: not in RecoveryList? always delete tmp files
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-07 17:41:36 +02:00
Justin Luth 9e0f13b2c4 tdf#57414 autorecovery: don't always add every file to RecoveryList
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-07 17:40:06 +02:00
Justin Luth db9fa6da9d related tdf#57414 autosave: try harder to know when !IsModified
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-07 17:17:47 +02:00
Justin Luth eef0c5d4d4 tdf#71550 autorecovery: use osl::File::Remove when isEmptyFileUrl
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-03 03:37:42 +02:00
Justin Luth fe55282c02 tdf#144512 autorecovery: don't delay autosave on shutdown
Change-Id: I98ee31369aa46c4e3aeb405ec11a1ef197c31fe0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155165
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2023-08-02 23:32:15 +02:00
Justin Luth f080ef9daf tdf#65509 autorecovery: don't UserAutoSave during EmergencySave
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-02 19:15:52 +02:00
Noel Grandin b6b26421a1 split Point/Size/Rectangle into AbsoluteScreenPixel* types
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-02 08:13:15 +02:00
Justin Luth d16d86685a tdf#57414 autorecovery: if no recovery doc, remove from RecoveryList
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-08-01 03:10:44 +02:00
Balazs Varga 630303ad8e tdf#104382 - Menus should be disabled when they have no enabled submenus
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>
2023-07-28 09:22:49 +02:00
Rafael Lima 6fa4e5965b tdf#149318 Set HID for menus that have sub menus
This patch fixes the following issue when pressing F1 while hovering on a menu entry that has submenus:
1) Place the mouse over a menu entry that has submenus (f.i. in Draw go to Format - Table)
2) A submenu will appear, however leave the mouse over "Table"
3) Press F1... the help ID used will be "slot:0" because LO is trying to find the help ID of the selected entry in the submenu, but since none is selected, then the generic "slot:0" value is used.

To fix this problem, this patch assigns a Help ID for the submenu (not for its entries) so that when no entry is focused, then the submenu HID is used.

IMPORTANT: note that pressing F1 on menus only work with gen and win. Due to bug 156376 pressing F1 on menus does not work with kf5 and gtk3 (yet).

Change-Id: I717e7669faac47a12c929129c0de98dee7f44439
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154862
Tested-by: Jenkins
Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-07-26 13:25:10 +02:00
Justin Luth 97e5f7be67 tdf#65509 autosave: apply UserAutoSave without restarting
Now that I know there is a config listener running in AutoRecovery,
listen for the config change and apply it immediately
instead of requesting the user to do a restart.

Change-Id: I69912c0e95c04cc1a5e680d5e8c59b15e94efb05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154664
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2023-07-20 11:48:48 +02:00
Mike Kaganski 514cc22875 Use correct configuration
I introduced it in commit 79113484ca
by mistake, when rebased on 3c41b32562.

Change-Id: Ia3ba91cda9e54d9434b6d79bf78afd13f2b20d5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154619
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-07-19 20:26:48 +02:00
Mike Kaganski 79113484ca [API CHANGE] tdf#144512: keep autosave interval separately for each document
Maybe this would make a better UX, as the request suggests ... or maybe not.

css::document::XDocumentRecovery2 is introduced for this, allowing to query
the document dirty state duration.

Change-Id: I25997788bc5da261f7e4131616ab8d4a245de380
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154505
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-07-18 19:15:33 +02:00
Mike Kaganski 3c41b32562 tdf#156308: Restore use of /org.openoffice.Office.Recovery/AutoSave
... instead of respective values from /org.openoffice.Office.Common/Save/Document

The history of the problem:

d0f9685d2c (2004-11-26)
  made SvtSaveOptions use org.openoffice.Office.Recovery/AutoSave,
  *in addition* to org.openoffice.Office.Common/Save/Document/*,
  as "forward AutoSave/AutoSaveTime to new config location" part
  of i#27726; at this point, org.openoffice.Office.Recovery/AutoSave/*
  took precedence (they were read last).

8e6031e126 (2004-11-26)
  implemented autorecovery.cxx, already reading
  org.openoffice.Office.Recovery/AutoSave/*

d5b9283985 (2021-07-25)
  made SvxSaveTabPage and SfxApplication::SetOptions_Impl use
  officecfg::Office::Common::Save::Document::* instead of
  SvtSaveOptions.

134f40136a (2021-07-25)
  dropped SvtSaveOptions_Impl::ImplCommit, and its saving of
  officecfg::Office::Recovery::AutoSave::* (which likely
  detached officecfg::Office::Recovery::AutoSave from
  officecfg::Office::Common::Save::Document, making UI edits
  not stored to the former).

aeb8a0076c (2022-05-23)
  made AutoRecovery::implts_readAutoSaveConfig read
  officecfg::Office::Common::Save::Document::* instead of
  proper officecfg::Office::Recovery::AutoSave::*.

This change restores the intended use, and deprecates corresponding
values in /org.openoffice.Office.Common/Save/Document.

Change-Id: I33d48e3945326c80d356bfc930ed8a7f042c982b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154500
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-07-17 21:14:24 +02:00
Mike Kaganski 8362ec6646 Small simplification
Change-Id: I36bbdb48f0fa0d81e7ba294e9ac01b0d187e4800
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154462
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-07-17 18:40:16 +02:00
Justin Luth 65db5b6a34 tdf#71550 autosave: remove empty, new file on failed autosave
before throwing and losing any control.

Change-Id: I2340c6f08bae116f3c1a390bccca2075c047a737
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154446
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2023-07-14 22:21:02 +02:00
Justin Luth d36ae6786e tdf#65509 apply new AutoRecovery timeInterval without restarting
Another option would be to listen for config changes I guess.

However, this alternative method of setting the timer interval
(which I assume is related to Impress slideshows, but couldn't reproduce)
is basically never used.

At worst (in case this alternative method sets a non-zero time)
it will be the same as before where a restart is needed to
gain the new time.

I'm not worried about having the user wait for the current
timer to run out (in 10 minutes based on the default state)
before their new time kicks in.

Change-Id: Iaa2b9e3e0912918ae29aaf262b5d7f51924b8147
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154365
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
2023-07-13 00:51:10 +02:00