https://bugs.documentfoundation.org/show_bug.cgi?id=167935
Bug ID: 167935
Summary: Prevent different paths to the same document by use of
realpath
Product: LibreOffice
Version: 26.2.0.0 alpha0+ master
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: enhancement
Priority: medium
Component: Writer
Assignee: [email protected]
Reporter: [email protected]
LibreOffice stores the way you open a document in its elephant memory
~/.config/libreoffice/4/user/registrymodifications.xcu. If you open a file via
a desktop link, the link itself is memorized there, not the file, to which the
link points!
If you open a file by doubleclicking on it in the file browser or by the dialog
File>Open, the path to the document is taken is also memorized in LibreOffice’s
elephant memory ~/.config/libreoffice/4/user/registrymodifications.xcu.
When opening one and the same file more than once in different ways, the
editing windows to it don’t know from each other. When saving the second of
such two parallel sessions, an error message
“The file has been changed since it was last opened for editing in
LibreOffice …”
is flagged. This situation is completely different from creating a second
parallel window by *Window>New Window*, which is a very useful function to open
an additional view into the same document. With this one, editing in either of
those windows is reflected in all other parallel windows opened this way.
The different handling of links to documents may cause data loss if one just
ignores the error message mentioned before.
It also affects the section for *Recent files* in LibreOffice’s elephant memory
~/.config/libreoffice/4/user/registrymodifications.xcu.
I propose to feed the path of each to be opened document first through the well
known function realpath, before LibreOffice actually does anything with the
path to any document. realpath returns a normalized path to the file to be
opened. In case of a link, it returns the path to the target instead of the
path to the link. The normalized path from realpath should be compared to
already open paths and dealt with like now – preventing that different paths
are not recognized as pointing to the same target. As an alternative and since
the operation *Window>New Window* is not known to all users (many don’t even
know its existence), on a trial to open an already open file more than once, a
question
“The requested file is already open. Do you want another view into this
document? N/Y”
might be asked.
--
You are receiving this mail because:
You are the assignee for the bug.