diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2022-08-29 08:40:14 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-11-09 21:49:09 +0100 |
commit | 4c0e5d0be02ba25be0e8b4748fbf0060491de93c (patch) | |
tree | 2e4ec300992613f19e81d30db262bf23a360d9ef /sfx2 | |
parent | 875c27dc7975de9b007a215fe1d6f171b4ef090e (diff) |
lok: masterpage: introduce EditMode setter and getter for ViewShell
Change-Id: I74d3307aab8fc038bd2409b5f10a2d08db885223
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138957
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142472
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/lokhelper.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/view/viewsh.cxx | 5 |
2 files changed, 14 insertions, 1 deletions
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index b168538fe0c8..c631aa8d6257 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -125,6 +125,12 @@ int SfxLokHelper::createView(int nDocId) return -1; } +void SfxLokHelper::setEditMode(int nMode, vcl::ITiledRenderable* pDoc) +{ + DisableCallbacks dc; + pDoc->setEditMode(nMode); +} + void SfxLokHelper::destroyView(int nId) { const SfxApplication* pApp = SfxApplication::Get(); @@ -359,6 +365,7 @@ static OString lcl_generateJSON(const SfxViewShell* pView, const boost::property boost::property_tree::ptree aMessageProps = rTree; aMessageProps.put("viewId", SfxLokHelper::getView(pView)); aMessageProps.put("part", pView->getPart()); + aMessageProps.put("mode", pView->getEditMode()); std::stringstream aStream; boost::property_tree::write_json(aStream, aMessageProps, false /* pretty */); const std::string aString = aStream.str(); @@ -370,7 +377,8 @@ static inline OString lcl_generateJSON(const SfxViewShell* pView, int nViewId, s { assert(pView != nullptr && "pView must be valid"); return OString::Concat("{ \"viewId\": \"") + OString::number(nViewId) - + "\", \"part\": \"" + OString::number(pView->getPart()) + "\", \"" + rKey + "\": \"" + + "\", \"part\": \"" + OString::number(pView->getPart()) + "\", \"mode\": \"" + + OString::number(pView->getEditMode()) + "\", \"" + rKey + "\": \"" + lcl_sanitizeJSONAsValue(rPayload) + "\" }"; } diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index 1363d07c1eb5..c21790aa9be5 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1617,6 +1617,11 @@ int SfxViewShell::getPart() const return 0; } +int SfxViewShell::getEditMode() const +{ + return 0; +} + ViewShellId SfxViewShell::GetViewShellId() const { return pImpl->m_nViewShellId; |