sc/inc/unonames.hxx             |    1 +
 sc/source/ui/unoobj/confuno.cxx |   14 ++++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit d19f877be396bb69e1ae0ee5535e193e3feb35e1
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Tue Jan 4 21:39:20 2022 +0900
Commit:     Aron Budea <aron.bu...@collabora.com>
CommitDate: Tue Jun 6 13:03:48 2023 +0200

    sc: fix crash with document properties dialog
    
    "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 <qui...@gmail.com>
    (cherry picked from commit 88d8c9af7140ec25dfbcd9323b870a2da7b6f7e0)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152558
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Aron Budea <aron.bu...@collabora.com>

diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 36ab650e918b..848053ba4542 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -574,6 +574,7 @@
 #define SC_UNO_UPDTEMPL             "UpdateFromTemplate"
 #define SC_UNO_FILTERED_RANGE_SELECTION       "FilteredRangeSelection"
 #define SC_UNO_VISAREASCREEN        "VisibleAreaOnScreen"
+#define SC_UNO_IMAGE_PREFERRED_DPI  "ImagePreferredDPI"
 
 /*Stampit enable/disable print cancel */
 #define SC_UNO_ALLOWPRINTJOBCANCEL  "AllowPrintJobCancel"
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index ba081d5e2433..95c6fe64c9e8 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -89,6 +89,7 @@ static const SfxItemPropertyMapEntry* 
lcl_GetConfigPropertyMap()
         {u"" SC_UNO_EMBED_FONT_SCRIPT_LATIN,   0,  cppu::UnoType<bool>::get(), 
0, 0},
         {u"" SC_UNO_EMBED_FONT_SCRIPT_ASIAN,   0,  cppu::UnoType<bool>::get(), 
0, 0},
         {u"" SC_UNO_EMBED_FONT_SCRIPT_COMPLEX, 0,  cppu::UnoType<bool>::get(), 
0, 0},
+        {u"" SC_UNO_IMAGE_PREFERRED_DPI,       0,  
cppu::UnoType<sal_Int32>::get(), 0, 0},
         {u"" SC_UNO_SYNTAXSTRINGREF, 0,  cppu::UnoType<sal_Int16>::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<sal_Int32>())
+        {
+            rDoc.SetImagePreferredDPI(aValue.get<sal_Int32>());
+        }
+    }
     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();

Reply via email to