summaryrefslogtreecommitdiff
path: root/desktop/source/lib/init.cxx
diff options
context:
space:
mode:
authorGabriel Masei <gabriel.masei@1and1.ro>2020-09-02 19:22:23 +0300
committerJan Holesovsky <kendy@collabora.com>2020-09-21 16:57:35 +0200
commit2d4e43ef8c6f563087330c180b18ef83a1fad207 (patch)
tree7f0a8aaf991c5685e7f6398564dc27ead9a2cde5 /desktop/source/lib/init.cxx
parent5d3eaa832a79695bcf122918997b32f4d3881500 (diff)
lok: remove .uno:ModifiedStatus message from deduplication mechanism
This fixes the following issue in Online: When a save is performed while a cell is still edited the save icon does not reflect the correct state of the document: it shows that the document is dirty although it is not. This is generated by two facts: 1. The status cache is avoided when sending the -dirty- status right after the cell editing is finished. Because the cache has an old value of -false- for ModifiedStatus, the notification that is sent after saving, with -false- value, is ignored. We should not avoid the status cache. 2. Because there is a mechanism that keeps only the last notification value for a status change in the queue that keeps messages that were not sent yet (deduplication), the .uno:ModifiedStatus message with a value of -true- that is enqueued right after the cell edit is finished is replaced by the same message with a value of -false- that is enqueued after the save is finished. This happens if the flush mechanism doesn't occur between them. Change-Id: I3348bf230ba53a154c29e7d8ab064df7694adeae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103053 Reviewed-by: Gabriel Masei <gabriel.masei@1and1.ro> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'desktop/source/lib/init.cxx')
-rw-r--r--desktop/source/lib/init.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index eaba422a3e4a..2dffed0204b5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1584,11 +1584,16 @@ void CallbackFlushHandler::queue(const int type, const char* data)
if (pos != std::string::npos)
{
const std::string name = payload.substr(0, pos + 1);
- removeAll(
- [type, &name] (const queue_type::value_type& elem) {
- return (elem.Type == type) && (elem.PayloadString.compare(0, name.size(), name) == 0);
- }
- );
+ // This is needed because otherwise it creates some problems when
+ // a save occurs while a cell is still edited in Calc.
+ if (name != ".uno:ModifiedStatus=")
+ {
+ removeAll(
+ [type, &name] (const queue_type::value_type& elem) {
+ return (elem.Type == type) && (elem.PayloadString.compare(0, name.size(), name) == 0);
+ }
+ );
+ }
}
}
break;