[Libreoffice-commits] online.git: loolwsd.xml.in wsd/Storage.cpp

mert (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 25 12:10:22 UTC 2019


 loolwsd.xml.in  |    1 +
 wsd/Storage.cpp |    4 ++++
 2 files changed, 5 insertions(+)

New commits:
commit 8ca7391f0593228ff7d41074bd5a5e09fe0a0918
Author:     mert <mert.tumer at collabora.com>
AuthorDate: Mon Nov 25 15:03:49 2019 +0300
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Mon Nov 25 13:10:05 2019 +0100

    Added an option to override watermark texts
    
    in loolwsd.xml. If set, watermarks will be the same
    as entered for all the views instead of per view
    watermarks sent in CheckFileInfo
    
    Change-Id: I0943520423abc2567f44920f8679057b3cfbf01f
    Reviewed-on: https://gerrit.libreoffice.org/83666
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/loolwsd.xml.in b/loolwsd.xml.in
index 79a930d7f..0ebe62e79 100644
--- a/loolwsd.xml.in
+++ b/loolwsd.xml.in
@@ -109,6 +109,7 @@
 
     <watermark>
       <opacity desc="Opacity of on-screen watermark from 0.0 to 1.0" type="double" default="0.2"></opacity>
+      <text desc="Watermark text to be displayed on the document if entered" type="string"></text>
     </watermark>
 
     <storage desc="Backend storage">
diff --git a/wsd/Storage.cpp b/wsd/Storage.cpp
index 45198ad77..efe0fc130 100644
--- a/wsd/Storage.cpp
+++ b/wsd/Storage.cpp
@@ -672,6 +672,10 @@ std::unique_ptr<WopiStorage::WOPIFileInfo> WopiStorage::getWOPIFileInfo(const Au
     if (supportsLocks)
         lockCtx.initSupportsLocks();
 
+    std::string overrideWatermarks = LOOLWSD::getConfigValue<std::string>("watermark.text", "");
+    if (!overrideWatermarks.empty())
+        watermarkText = overrideWatermarks;
+
     return std::unique_ptr<WopiStorage::WOPIFileInfo>(new WOPIFileInfo(
         {userId, obfuscatedUserId, userName, userExtraInfo, watermarkText, templateSaveAs, templateSource,
          canWrite, postMessageOrigin, hidePrintOption, hideSaveOption, hideExportOption,


More information about the Libreoffice-commits mailing list