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

New commits:
commit 8041a8e725bcd803c32eb08a9d2600a38a006d73
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Mon Sep 25 16:23:20 2023 -0400
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Sep 27 16:11:50 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>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 817062ad55fa..5ad95cfd1632 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5954,19 +5954,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 =
-        SfxItemSet::GetItem<SfxBoolItem>(pMedium->GetItemSet(),
-                                         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