From 88d8c9af7140ec25dfbcd9323b870a2da7b6f7e0 Mon Sep 17 00:00:00 2001 From: Tomaž Vajngerl Date: Tue, 4 Jan 2022 21:39:20 +0900 Subject: sc: fix crash with document properties dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "ImagePreferredDPI" property was added for impress and writer, but it was not handled in calc, so it document properties dialog crashed (exception because of a non existent property). Change-Id: I9eb3f6aa7cf6d8ab48930b3071b993e073117688 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127942 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- sc/source/ui/unoobj/confuno.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sc/source/ui/unoobj/confuno.cxx') diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index 9fa7ca85a25b..c71f2f28fd04 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -89,6 +89,7 @@ static const SfxItemPropertyMapEntry* lcl_GetConfigPropertyMap() { SC_UNO_EMBED_FONT_SCRIPT_LATIN, 0, cppu::UnoType::get(), 0, 0}, { SC_UNO_EMBED_FONT_SCRIPT_ASIAN, 0, cppu::UnoType::get(), 0, 0}, { SC_UNO_EMBED_FONT_SCRIPT_COMPLEX, 0, cppu::UnoType::get(), 0, 0}, + { SC_UNO_IMAGE_PREFERRED_DPI, 0, cppu::UnoType::get(), 0, 0}, { SC_UNO_SYNTAXSTRINGREF, 0, cppu::UnoType::get(), 0, 0}, { u"", 0, css::uno::Type(), 0, 0 } }; @@ -396,7 +397,13 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( rDoc.SetCalcConfig( aCalcConfig ); } } - + else if (aPropertyName == SC_UNO_IMAGE_PREFERRED_DPI) + { + if (aValue.has()) + { + rDoc.SetImagePreferredDPI(aValue.get()); + } + } else { ScGridOptions aGridOpt(aViewOpt.GetGridOptions()); @@ -599,7 +606,10 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPr } } } - + else if (aPropertyName == SC_UNO_IMAGE_PREFERRED_DPI) + { + aRet <<= rDoc.GetImagePreferredDPI(); + } else { const ScGridOptions& aGridOpt = aViewOpt.GetGridOptions(); -- cgit