Files
odfstudio/android/source/src/java
Michael Weghorn a1abf2c865 tdf#139350 android: Add param to allow a "real" "Save As"
So far, LOKitTileProvider's 'saveDocumentAs' method
was always saving a copy of the current document
(or doing an export), but was not continuing to use
the newly saved doc afterwards.

Add an additional parameter 'takeOwnership' to the
method to specify whether to do so.

In other words,

* the 'takeOwnership=false' case continues to
  do what was done previously, it basically does what
  "File" -> "Save a Copy" or "File" -> "Export"
  does in the desktop version

* the 'takeOwnership=true' case now basically does the
  same as "File" -> "Save As" in the desktop version
  (except that the path is already known in the
  Android case)

This essentially forwards the "TakeOwnership"
param to LibreOfficeKit, which was originally
added there in

    commit a121074cbd
    Date:   Wed Feb 10 13:26:50 2016 +0100

        lok: Introduce a "TakeOwnership" filter option for saveAs().

        It is consumed by the saveAs() itself, and when provided, the document
        identity changes to the provided pUrl - meaning that '.uno:ModifiedStatus' is
        triggered as with the "Save As..." in the UI.

        This mode must not be used when saving to PNG or PDF.

        Change-Id: I11b5aa814476a8dcab9eac5202bd052828ebbd96

This also adds a new 'SAVE_COPY_AS' event type to save a
copy without taking ownership, and switches all uses of the
'SAVE_AS' event to that new one for now. (So the behavior
remains unchanged, but the terminology is hopefully clearer.)

Except for one instance in LOKitTileProver::saveDocument (where
the cached version of the document is written to the original
URI, if present), all other places are left with the previous
behaviour in this commit.
Further changes will be done in follow-up commits.

Change-Id: I11996cd7276a6c6f2774535cd3e53cb997c8cd4e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113375
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-03-31 06:57:53 +02:00
..