summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2024-04-28 13:09:34 +0200
committerJulien Nabet <serval2412@yahoo.fr>2024-04-28 13:11:21 +0200
commit5158104b9294ab85ab7a675b5b627469e303c345 (patch)
tree195a5e99cea2c8ec6d9bae19cb56f488d75bb6fa
parentf49d74edf76097d014ed891d0025cb2e9b197c5a (diff)
Revert "tdf#160827: fix crash when retrieving _MarkAsFinal value (docx)"
As Noel advised in https://gerrit.libreoffice.org/c/core/+/166724, it's better to test type this way: getValueType() == cppu::UnoType<bool>::get() This reverts commit f49d74edf76097d014ed891d0025cb2e9b197c5a. Change-Id: Ic148b27761141d1020b63eeba8044fd545bab2d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166797 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--sfx2/source/doc/objstor.cxx8
1 files changed, 1 insertions, 7 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 441641d1c65c..720e939e3885 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2741,13 +2741,7 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
uno::Reference<beans::XPropertySetInfo> xPropertySetInfo = xPropertySet->getPropertySetInfo();
if (xPropertySetInfo.is() && xPropertySetInfo->hasPropertyByName("_MarkAsFinal"))
{
- Any anyMarkAsFinal = xPropertySet->getPropertyValue("_MarkAsFinal");
- const OUString strValueTypeName = anyMarkAsFinal.getValueTypeName();
-
- if (
- ( (strValueTypeName == "boolean") && (anyMarkAsFinal.get<bool>()) ) ||
- ( (strValueTypeName == "string") && (anyMarkAsFinal.get<OUString>() == "true") )
- )
+ if (xPropertySet->getPropertyValue("_MarkAsFinal").get<bool>())
{
uno::Reference< lang::XMultiServiceFactory > xFactory(GetModel(), uno::UNO_QUERY);
uno::Reference< beans::XPropertySet > xSettings(xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY);