From 26f6ae4122fcce6bafa71c064f5e645c39022082 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 07:03:13 +0200 Subject: Adding upstream version 4:24.2.3. Signed-off-by: Daniel Baumann --- sfx2/source/doc/objserv.cxx | 6 +++++- sfx2/source/doc/objstor.cxx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'sfx2/source/doc') diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index fedbfb205d..90ef2ee232 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -453,6 +453,10 @@ static void sendErrorToLOK(ErrCodeMsg error) if (error.GetCode().GetClass() == ErrCodeClass::NONE) return; + SfxViewShell* pNotifier = SfxViewShell::Current(); + if (!pNotifier) + return; + boost::property_tree::ptree aTree; aTree.put("code", error); aTree.put("kind", ""); @@ -465,7 +469,7 @@ static void sendErrorToLOK(ErrCodeMsg error) std::stringstream aStream; boost::property_tree::write_json(aStream, aTree); - SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, OString(aStream.str())); + pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_ERROR, OString(aStream.str())); } namespace diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 17ee6bf621..a6aaee75ea 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2428,7 +2428,11 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium, uno::Reference xPropertySetInfo = xPropertySet->getPropertySetInfo(); if (xPropertySetInfo.is() && xPropertySetInfo->hasPropertyByName("_MarkAsFinal")) { - if (xPropertySet->getPropertyValue("_MarkAsFinal").get()) + Any anyMarkAsFinal = xPropertySet->getPropertyValue("_MarkAsFinal"); + if ( + ( (anyMarkAsFinal.getValueType() == cppu::UnoType::get()) && (anyMarkAsFinal.get()) ) || + ( (anyMarkAsFinal.getValueType() == cppu::UnoType::get()) && (anyMarkAsFinal.get() == "true") ) + ) { uno::Reference< lang::XMultiServiceFactory > xFactory(GetModel(), uno::UNO_QUERY); uno::Reference< beans::XPropertySet > xSettings(xFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY); -- cgit v1.2.3