desktop/source/lib/init.cxx |   11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

New commits:
commit fa834e64e927efca00c9c47edfee58f0714c4fd4
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Mon Sep 25 16:23:20 2023 -0400
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Oct 10 09:30:46 2023 +0200

    lok: fix getting SID_DOC_READONLY slot property
    
    Unfortunately, the property is not always set when
    import XLSX documents.
    
    Signed-off-by: Henry Castro <hcas...@collabora.com>
    Change-Id: If501734704174b92b3589b61a019ba973592c331
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157259
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157736
    Tested-by: Jenkins

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 52ca105d09b9..a2399b125b94 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5982,18 +5982,9 @@ static char* getDocReadOnly(LibreOfficeKitDocument* 
pThis)
     if (!pObjectShell)
         return nullptr;
 
-    SfxMedium* pMedium = pObjectShell->GetMedium();
-    if (!pMedium)
-        return nullptr;
-
-    bool bDocReadOnly = false;
-    if (const SfxBoolItem* pReadOnlyItem =
-        pMedium->GetItemSet().GetItem(SID_DOC_READONLY, false))
-        bDocReadOnly = pReadOnlyItem->GetValue();
-
     boost::property_tree::ptree aTree;
     aTree.put("commandName", ".uno:ReadOnly");
-    aTree.put("success", bDocReadOnly);
+    aTree.put("success", pObjectShell->IsLoadReadonly());
 
     std::stringstream aStream;
     boost::property_tree::write_json(aStream, aTree);

Reply via email to