sd/source/ui/view/drviews1.cxx |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 3217f0d4b368a96b30909e2aa7d4afc9a985a88b
Author:     Jaume Pujantell <jaume.pujant...@collabora.com>
AuthorDate: Tue Jul 15 17:02:32 2025 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Jul 16 10:53:16 2025 +0200

    lokit pdfium: send empty link data
    
    This is a follow-up to b307d3f997eee3014697734f04ad99b4f3ef50ae.
    Send and empty status if there are no links so online knows to erase the
    link data.
    
    Change-Id: I7695ed87f7e0c19338b0f42ad3c860035ffd0d76
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187926
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index e7d5f387da1e..447945a0c29b 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -803,19 +803,22 @@ namespace
 {
 void notifyLinkAnnotations(SfxViewShell* pViewShell, SdPage* pPage)
 {
-    if (!pViewShell || !pPage || !pPage->hasLinkAnnotations())
+    if (!pViewShell || !pPage)
         return;
     ::tools::JsonWriter jsonWriter;
     jsonWriter.put("commandName", "PageLinks");
     {
-        auto jsonLinks = jsonWriter.startArray("links");
-        for (const auto& link : pPage->getLinkAnnotations())
+        auto jsonState = jsonWriter.startNode("state");
         {
-            auto jsonLink = jsonWriter.startStruct();
-            std::stringstream ss;
-            ss << link.first;
-            jsonWriter.put("rectangle", ss.str());
-            jsonWriter.put("uri", link.second);
+            auto jsonLinks = jsonWriter.startArray("links");
+            for (const auto& link : pPage->getLinkAnnotations())
+            {
+                auto jsonLink = jsonWriter.startStruct();
+                std::stringstream ss;
+                ss << link.first;
+                jsonWriter.put("rectangle", ss.str());
+                jsonWriter.put("uri", link.second);
+            }
         }
     }
     OString aPayload = jsonWriter.finishAndGetAsOString();

Reply via email to