sfx2/source/doc/objstor.cxx |    8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

New commits:
commit 5158104b9294ab85ab7a675b5b627469e303c345
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sun Apr 28 13:09:34 2024 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Sun Apr 28 13:11:21 2024 +0200

    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 <serval2...@yahoo.fr>
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

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);

Reply via email to