From d26c425dae763e3b48316ec958a2f71367044c21 Mon Sep 17 00:00:00 2001 From: Paris Oplopoios Date: Fri, 24 Feb 2023 00:41:06 +0200 Subject: [PATCH] Move _canonicalViewId out of Session Signed-off-by: Paris Oplopoios Change-Id: I9c06440ed47eb217e973d2f530f2c3646d55d85b --- common/Session.hpp | 12 ------------ kit/ChildSession.hpp | 8 ++++++++ wsd/ClientSession.hpp | 11 +++++++++++ 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/common/Session.hpp b/common/Session.hpp index c82575c53..b1d7003b1 100644 --- a/common/Session.hpp +++ b/common/Session.hpp @@ -246,15 +246,6 @@ public: const std::string& getJailedFilePathAnonym() const { return _jailedFilePathAnonym; } - int getCanonicalViewId() { return _canonicalViewId; } - // Only called by kit. - void setCanonicalViewId(int viewId) { _canonicalViewId = viewId; } - // Only called by wsd. - template void createCanonicalViewId(SessionMap &map) - { - _canonicalViewId = map.createCanonicalId(_watermarkText); - } - const std::string& getDeviceFormFactor() const { return _deviceFormFactor; } const std::string& getSpellOnline() const { return _spellOnline; } @@ -367,9 +358,6 @@ private: /// Timezone of the user. std::string _timezone; - /// the canonical id unique to the set of rendering properties of this session - int _canonicalViewId; - /// The form factor of the device where the client is running: desktop, tablet, mobile. std::string _deviceFormFactor; diff --git a/kit/ChildSession.hpp b/kit/ChildSession.hpp index 494f68d01..a7bf39076 100644 --- a/kit/ChildSession.hpp +++ b/kit/ChildSession.hpp @@ -262,6 +262,11 @@ public: _docManager = nullptr; } + // Only called by kit. + void setCanonicalViewId(int viewId) { _canonicalViewId = viewId; } + + int getCanonicalViewId() { return _canonicalViewId; } + private: bool loadDocument(const StringVector& tokens); @@ -379,6 +384,9 @@ private: /// stores wopi url for export as operation std::string _exportAsWopiUrl; + + /// the canonical id unique to the set of rendering properties of this session + int _canonicalViewId; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/wsd/ClientSession.hpp b/wsd/ClientSession.hpp index 68e24405e..d829338ce 100644 --- a/wsd/ClientSession.hpp +++ b/wsd/ClientSession.hpp @@ -254,6 +254,15 @@ public: /// Process an SVG to replace embedded file:/// media URIs with public http URLs. std::string processSVGContent(const std::string& svg); + int getCanonicalViewId() { return _canonicalViewId; } + + // Only called by wsd. + template + void createCanonicalViewId(SessionMap &map) + { + _canonicalViewId = map.createCanonicalId(getWatermarkText()); + } + private: std::shared_ptr client_from_this() { @@ -406,6 +415,8 @@ private: // Saves time from setting/fetching user info multiple times using zotero API bool _isZoteroUserInfoSet = false; + /// the canonical id unique to the set of rendering properties of this session + int _canonicalViewId; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */