diff options
author | Henry Castro <hcastro@collabora.com> | 2023-09-25 16:23:20 -0400 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-10-10 09:30:46 +0200 |
commit | fa834e64e927efca00c9c47edfee58f0714c4fd4 (patch) | |
tree | 456b5a4a878986271887bdf9e05b62ac45c81e98 /desktop/source | |
parent | 4a5fb05d5e2448453477ce14862a8cf9846ecb49 (diff) |
lok: fix getting SID_DOC_READONLY slot property
Unfortunately, the property is not always set when
import XLSX documents.
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: If501734704174b92b3589b61a019ba973592c331
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157259
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157736
Tested-by: Jenkins
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/lib/init.cxx | 11 |
1 files changed, 1 insertions, 10 deletions
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); |