wsd/DocumentBroker.cpp | 18 ++++++++---------- wsd/DocumentBroker.hpp | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-)
New commits: commit 2f703dc5ae14875910053b22bf8d806a18257a65 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> AuthorDate: Thu Apr 9 10:37:33 2020 -0400 Commit: Ashod Nakashian <ashnak...@gmail.com> CommitDate: Fri Apr 17 02:36:39 2020 +0200 wsd: _isModified -> isModified() Change-Id: I70e35dfede8ae37603bc26cb800223a369ae5e8f Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92099 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp index 8c342c4c3..f79cbbbd4 100644 --- a/wsd/DocumentBroker.cpp +++ b/wsd/DocumentBroker.cpp @@ -432,7 +432,7 @@ void DocumentBroker::pollThread() _poll->continuePolling() << ", ShutdownRequestFlag: " << SigUtil::getShutdownRequestFlag() << ", TerminationFlag: " << SigUtil::getTerminationFlag() << ", closeReason: " << _closeReason << ". Flushing socket."); - if (_isModified) + if (isModified()) { std::stringstream state; dumpState(state); @@ -739,9 +739,8 @@ bool DocumentBroker::load(const std::shared_ptr<ClientSession>& session, const s ", Actual: " << fileInfo.getModifiedTime()); _documentChangedInStorage = true; - std::string message = "close: documentconflict"; - if (_isModified) - message = "error: cmd=storage kind=documentconflict"; + const std::string message = isModified() ? "error: cmd=storage kind=documentconflict" + : "close: documentconflict"; session->sendTextFrame(message); broadcastMessage(message); @@ -1090,9 +1089,8 @@ bool DocumentBroker::saveToStorageInternal(const std::string& sessionId, bool su { LOG_ERR("PutFile says that Document changed in storage"); _documentChangedInStorage = true; - std::string message = "close: documentconflict"; - if (_isModified) - message = "error: cmd=storage kind=documentconflict"; + const std::string message + = isModified() ? "error: cmd=storage kind=documentconflict" : "close: documentconflict"; broadcastMessage(message); } @@ -1160,7 +1158,7 @@ bool DocumentBroker::autoSave(const bool force, const bool dontSaveIfUnmodified) LOG_TRC("autoSave(): forceful? " << force); if (_sessions.empty() || _storage == nullptr || !_isLoaded || - !_childProcess->isAlive() || (!_isModified && !force)) + !_childProcess->isAlive() || (!isModified() && !force)) { // Nothing to do. LOG_TRC("Nothing to autosave [" << _docKey << "]."); @@ -1186,7 +1184,7 @@ bool DocumentBroker::autoSave(const bool force, const bool dontSaveIfUnmodified) dontSaveIfUnmodified, /*isAutosave=*/false, /*isExitSave=*/true); } - else if (_isModified) + else if (isModified()) { const std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); const std::chrono::milliseconds::rep inactivityTimeMs = std::chrono::duration_cast<std::chrono::milliseconds>(now - _lastActivityTime).count(); @@ -2377,7 +2375,7 @@ void DocumentBroker::dumpState(std::ostream& os) now - _threadStart).count() << "s"; os << "\n sent: " << sent; os << "\n recv: " << recv; - os << "\n modified?: " << _isModified; + os << "\n modified?: " << isModified(); os << "\n jail id: " << _jailId; os << "\n filename: " << LOOLWSD::anonymizeUrl(_filename); os << "\n public uri: " << _uriPublic.toString(); diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp index d270f53b0..42fc82bbb 100644 --- a/wsd/DocumentBroker.hpp +++ b/wsd/DocumentBroker.hpp @@ -313,7 +313,7 @@ private: /// True if we know the doc is modified or /// if there has been activity from a client after we last *requested* saving, /// since there are race conditions vis-a-vis user activity while saving. - bool isPossiblyModified() const { return _isModified || (_lastSaveRequestTime < _lastActivityTime); } + bool isPossiblyModified() const { return isModified() || (_lastSaveRequestTime < _lastActivityTime); } /// True iff there is at least one non-readonly session other than the given. /// Since only editable sessions can save, we need to use the last to _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits