[Libreoffice-commits] core.git: sc/inc sc/source sd/source starmath/source sw/source

Ilhan Yesil ilhanyesil at gmx.de
Fri Jun 1 07:53:01 UTC 2018


 sc/inc/unonames.hxx                          |    1 +
 sc/source/ui/unoobj/confuno.cxx              |   11 ++++++++++-
 sd/source/ui/unoidl/UnoDocumentSettings.cxx  |   18 +++++++++++++++++-
 starmath/source/unomodel.cxx                 |   26 +++++++++++++++++++++-----
 sw/source/uibase/uno/SwXDocumentSettings.cxx |   16 ++++++++++++++--
 5 files changed, 63 insertions(+), 9 deletions(-)

New commits:
commit 2ded7acd61cf01a7c50d770b17605252738ed684
Author: Ilhan Yesil <ilhanyesil at gmx.de>
Date:   Wed Apr 11 15:44:11 2018 +0200

    tdf#87995 Missing setting for save thumbnail in settings.xml.
    
    If the user unchecks "Save preview picture with this document" in the
    dialog field and saves the document, the appropriate flag is now
    written to settings.xml by introducing the setting named
    "SaveThumbnail".
    
    Change-Id: I4916b4149a9494dd1891c0e05cb9a985ba0a9121
    Reviewed-on: https://gerrit.libreoffice.org/52768
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index a2a407ee5fdc..07d2864ed4fd 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -562,6 +562,7 @@
 #define SC_UNO_PRINTERSETUP         "PrinterSetup"
 #define SC_UNO_PRINTERPAPER         "PrinterPaperFromSetup"
 #define SC_UNO_APPLYDOCINF          "ApplyUserData"
+#define SC_UNO_SAVE_THUMBNAIL       "SaveThumbnail"
 #define SC_UNO_CHARCOMP             "CharacterCompressionType"
 #define SC_UNO_ASIANKERN            "IsKernAsianPunctuation"
 #define SC_UNO_VISAREA              "VisibleArea"
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index d892bba47647..042c548eae74 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -71,7 +71,8 @@ static const SfxItemPropertyMapEntry* lcl_GetConfigPropertyMap()
         {OUString(SC_UNO_PRINTERNAME),  0,  cppu::UnoType<OUString>::get(),    0, 0},
         {OUString(SC_UNO_PRINTERSETUP), 0,  cppu::UnoType<uno::Sequence<sal_Int8>>::get(), 0, 0},
         {OUString(SC_UNO_PRINTERPAPER), 0,  cppu::UnoType<bool>::get(),              0, 0},
-        {OUString(SC_UNO_APPLYDOCINF),  0,  cppu::UnoType<bool>::get(),              0, 0},
+        {OUString(SC_UNO_APPLYDOCINF),  0,  cppu::UnoType<bool>::get(),              0, 0 },
+        {OUString(SC_UNO_SAVE_THUMBNAIL),  0,  cppu::UnoType<bool>::get(),              0, 0 },
         {OUString(SC_UNO_FORBIDDEN),    0,  cppu::UnoType<i18n::XForbiddenCharacters>::get(), beans::PropertyAttribute::READONLY, 0},
         {OUString(SC_UNO_CHARCOMP),     0,  cppu::UnoType<sal_Int16>::get(),        0, 0},
         {OUString(SC_UNO_ASIANKERN),    0,  cppu::UnoType<bool>::get(),              0, 0},
@@ -272,6 +273,12 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
         if ( aValue >>= bTmp )
             pDocShell->SetUseUserData( bTmp );
     }
+    else if ( aPropertyName == SC_UNO_SAVE_THUMBNAIL)
+    {
+        bool bTmp = true;
+        if (aValue >>= bTmp)
+            pDocShell->SetUseThumbnailSave( bTmp );
+    }
     else if ( aPropertyName == SC_UNO_FORBIDDEN )
     {
         //  read-only - should not be set
@@ -492,6 +499,8 @@ uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPr
     }
     else if ( aPropertyName == SC_UNO_APPLYDOCINF )
         aRet <<= pDocShell->IsUseUserData();
+    else if ( aPropertyName == SC_UNO_SAVE_THUMBNAIL )
+        aRet <<= pDocShell->IsUseThumbnailSave();
     else if ( aPropertyName == SC_UNO_FORBIDDEN )
     {
         aRet <<= uno::Reference<i18n::XForbiddenCharacters>(new ScForbiddenCharsObj( pDocShell ));
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 8a3d19ace163..f2aed578ff89 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -135,7 +135,7 @@ enum SdDocumentSettingsPropertyHandles
     HANDLE_SCALE_DOM, HANDLE_TABSTOP, HANDLE_PRINTPAGENAME, HANDLE_PRINTDATE, HANDLE_PRINTTIME,
     HANDLE_PRINTHIDENPAGES, HANDLE_PRINTFITPAGE, HANDLE_PRINTTILEPAGE, HANDLE_PRINTBOOKLET, HANDLE_PRINTBOOKLETFRONT,
     HANDLE_PRINTBOOKLETBACK, HANDLE_PRINTQUALITY, HANDLE_COLORTABLEURL, HANDLE_DASHTABLEURL, HANDLE_LINEENDTABLEURL, HANDLE_HATCHTABLEURL,
-    HANDLE_GRADIENTTABLEURL, HANDLE_BITMAPTABLEURL, HANDLE_FORBIDDENCHARS, HANDLE_APPLYUSERDATA, HANDLE_PAGENUMFMT,
+    HANDLE_GRADIENTTABLEURL, HANDLE_BITMAPTABLEURL, HANDLE_FORBIDDENCHARS, HANDLE_APPLYUSERDATA, HANDLE_SAVETHUMBNAIL, HANDLE_PAGENUMFMT,
     HANDLE_PRINTERNAME, HANDLE_PRINTERJOB, HANDLE_PRINTERPAPERSIZE, HANDLE_PARAGRAPHSUMMATION, HANDLE_CHARCOMPRESS, HANDLE_ASIANPUNCT,
     HANDLE_UPDATEFROMTEMPLATE, HANDLE_PRINTER_INDEPENDENT_LAYOUT
     // #i33095#
@@ -192,6 +192,7 @@ enum SdDocumentSettingsPropertyHandles
 
             { OUString("ForbiddenCharacters"),   HANDLE_FORBIDDENCHARS,      cppu::UnoType<XForbiddenCharacters>::get(),    0, 0 },
             { OUString("ApplyUserData"),         HANDLE_APPLYUSERDATA,       cppu::UnoType<bool>::get(),                0,  0 },
+            { OUString("SaveThumbnail"),         HANDLE_SAVETHUMBNAIL,       cppu::UnoType<bool>::get(),                0,  0 },
 
             { OUString("PageNumberFormat"),      HANDLE_PAGENUMFMT,          ::cppu::UnoType<sal_Int32>::get(),    0,  0 },
             { OUString("ParagraphSummation"),    HANDLE_PARAGRAPHSUMMATION,  cppu::UnoType<bool>::get(),                0,  0 },
@@ -467,6 +468,18 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries,
                     }
                 }
                 break;
+            case HANDLE_SAVETHUMBNAIL:
+                {
+                    bool bSaveThumbnail = false;
+                    if (*pValues >>= bSaveThumbnail)
+                    {
+                         bChanged = (bSaveThumbnail != pDocSh->IsUseThumbnailSave());
+                         pDocSh->SetUseThumbnailSave(bSaveThumbnail);
+                         bOk = true;
+                    }
+                }
+                break;
+
             case HANDLE_PRINTDRAWING:
                 if( *pValues >>= bValue )
                 {
@@ -1047,6 +1060,9 @@ DocumentSettings::_getPropertyValues(
             case HANDLE_APPLYUSERDATA:
                 *pValue <<= pDocSh->IsUseUserData();
                 break;
+            case HANDLE_SAVETHUMBNAIL:
+                *pValue <<= pDocSh->IsUseThumbnailSave();
+                break;
             case HANDLE_PRINTDRAWING:
                 *pValue <<= aPrintOpts.IsDraw();
                 break;
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 0afc6093de15..1c66e2b44825 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -214,6 +214,7 @@ enum SmModelPropertyHandles
     HANDLE_PRINTER_NAME,
     HANDLE_PRINTER_SETUP,
     HANDLE_SYMBOLS,
+    HANDLE_SAVE_THUMBNAIL,
     HANDLE_USED_SYMBOLS,
     HANDLE_BASIC_LIBRARIES,
     HANDLE_RUNTIME_UID,
@@ -286,15 +287,16 @@ static rtl::Reference<PropertySetInfo> lcl_createModelPropertyInfo ()
         { OUString("RelativeSymbolPrimaryHeight")      , HANDLE_RELATIVE_SYMBOL_PRIMARY_HEIGHT     ,  ::cppu::UnoType<sal_Int16>::get(),                                     PROPERTY_NONE,  DIS_ORNAMENTSIZE      },
         { OUString("RelativeUpperLimitDistance")       , HANDLE_RELATIVE_UPPER_LIMIT_DISTANCE      ,  ::cppu::UnoType<sal_Int16>::get(),                                     PROPERTY_NONE,  DIS_UPPERLIMIT        },
         { OUString("RightMargin")                      , HANDLE_RIGHT_MARGIN                       ,  ::cppu::UnoType<sal_Int16>::get(),                                     PROPERTY_NONE,  DIS_RIGHTSPACE        },
-        { OUString("RuntimeUID")                       , HANDLE_RUNTIME_UID                        ,  cppu::UnoType<OUString>::get(),                      PropertyAttribute::READONLY,  0       },
-        { OUString("Symbols")                          , HANDLE_SYMBOLS                            ,  cppu::UnoType<Sequence < SymbolDescriptor >>::get(),                PROPERTY_NONE,  0                     },
-        { OUString("UserDefinedSymbolsInUse")          , HANDLE_USED_SYMBOLS                       ,  cppu::UnoType<Sequence < SymbolDescriptor >>::get(),                PropertyAttribute::READONLY,  0       },
+        { OUString("RuntimeUID")                       , HANDLE_RUNTIME_UID                        ,  cppu::UnoType<OUString>::get(),                                        PropertyAttribute::READONLY,  0       },
+        { OUString("SaveThumbnail")                    , HANDLE_SAVE_THUMBNAIL                     ,  cppu::UnoType<bool>::get(),                                            PROPERTY_NONE,  0                     },
+        { OUString("Symbols")                          , HANDLE_SYMBOLS                            ,  cppu::UnoType<Sequence < SymbolDescriptor >>::get(),                   PROPERTY_NONE,  0                     },
+        { OUString("UserDefinedSymbolsInUse")          , HANDLE_USED_SYMBOLS                       ,  cppu::UnoType<Sequence < SymbolDescriptor >>::get(),                   PropertyAttribute::READONLY,  0       },
         { OUString("TopMargin")                        , HANDLE_TOP_MARGIN                         ,  ::cppu::UnoType<sal_Int16>::get(),                                     PROPERTY_NONE,  DIS_TOPSPACE          },
         // #i33095# Security Options
-        { OUString("LoadReadonly")                     , HANDLE_LOAD_READONLY                      ,  cppu::UnoType<bool>::get(),                                                 PROPERTY_NONE,  0                     },
+        { OUString("LoadReadonly")                     , HANDLE_LOAD_READONLY                      ,  cppu::UnoType<bool>::get(),                                            PROPERTY_NONE,  0                     },
         // #i972#
         { OUString("BaseLine")                         , HANDLE_BASELINE                           ,  ::cppu::UnoType<sal_Int16>::get(),                                     PROPERTY_NONE,  0                     },
-        { OUString("InteropGrabBag")                   , HANDLE_INTEROP_GRAB_BAG                   ,  cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get(),       PROPERTY_NONE,  0                     },
+        { OUString("InteropGrabBag")                   , HANDLE_INTEROP_GRAB_BAG                   ,  cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get(),           PROPERTY_NONE,  0                     },
         { OUString(), 0, css::uno::Type(), 0, 0 }
     };
     return rtl::Reference<PropertySetInfo>( new PropertySetInfo ( aModelPropertyInfoMap ) );
@@ -668,6 +670,15 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any*
             case HANDLE_INTEROP_GRAB_BAG:
                 setGrabBagItem(*pValues);
             break;
+            case HANDLE_SAVE_THUMBNAIL:
+            {
+                if ((*pValues).getValueType() != cppu::UnoType<bool>::get())
+                    throw IllegalArgumentException();
+                bool bThumbnail = false;
+                if (*pValues >>= bThumbnail)
+                    pDocSh->SetUseThumbnailSave(bThumbnail);
+            }
+            break;
         }
     }
 
@@ -882,6 +893,11 @@ void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValu
             case HANDLE_INTEROP_GRAB_BAG:
                 getGrabBagItem(*pValue);
             break;
+            case HANDLE_SAVE_THUMBNAIL:
+            {
+                *pValue <<= pDocSh->IsUseThumbnailSave();
+            }
+            break;
         }
     }
 }
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index 281bee24a542..02282603ac4d 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -78,6 +78,7 @@ enum SwDocumentSettingsPropertyHandles
     HANDLE_IS_KERN_ASIAN_PUNCTUATION,
     HANDLE_CHARACTER_COMPRESSION_TYPE,
     HANDLE_APPLY_USER_DATA,
+    HANDLE_SAVE_THUMBNAIL,
     HANDLE_SAVE_GLOBAL_DOCUMENT_LINKS,
     HANDLE_CURRENT_DATABASE_DATA_SOURCE,
     HANDLE_CURRENT_DATABASE_COMMAND,
@@ -155,7 +156,8 @@ static MasterPropertySetInfo * lcl_createSettingsInfo()
         { OUString("PrinterPaperFromSetup"),      HANDLE_PRINTER_PAPER,                   cppu::UnoType<bool>::get(),           0},
         { OUString("IsKernAsianPunctuation"),     HANDLE_IS_KERN_ASIAN_PUNCTUATION,       cppu::UnoType<bool>::get(),           0},
         { OUString("CharacterCompressionType"),   HANDLE_CHARACTER_COMPRESSION_TYPE,      cppu::UnoType<sal_Int16>::get(),             0},
-        { OUString("ApplyUserData"),              HANDLE_APPLY_USER_DATA,                 cppu::UnoType<bool>::get(),           0},
+        { OUString("ApplyUserData"),              HANDLE_APPLY_USER_DATA,                 cppu::UnoType<bool>::get(),           0 },
+        { OUString("SaveThumbnail"),              HANDLE_SAVE_THUMBNAIL,                  cppu::UnoType<bool>::get(),           0 },
         { OUString("SaveGlobalDocumentLinks"),    HANDLE_SAVE_GLOBAL_DOCUMENT_LINKS,      cppu::UnoType<bool>::get(),           0},
         { OUString("CurrentDatabaseDataSource"),  HANDLE_CURRENT_DATABASE_DATA_SOURCE,    cppu::UnoType<OUString>::get(),          0},
         { OUString("CurrentDatabaseCommand"),     HANDLE_CURRENT_DATABASE_COMMAND,        cppu::UnoType<OUString>::get(),          0},
@@ -481,7 +483,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
         break;
         case HANDLE_APPLY_USER_DATA:
         {
-            mpDocSh->SetUseUserData( *o3tl::doAccess<bool>(rValue) );
+            mpDocSh->SetUseUserData(*o3tl::doAccess<bool>(rValue));
+        }
+        break;
+        case HANDLE_SAVE_THUMBNAIL:
+        {
+            mpDocSh->SetUseThumbnailSave(*o3tl::doAccess<bool>(rValue));
         }
         break;
         case HANDLE_SAVE_GLOBAL_DOCUMENT_LINKS:
@@ -1012,6 +1019,11 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
             rValue <<= mpDocSh->IsUseUserData();
         }
         break;
+        case HANDLE_SAVE_THUMBNAIL:
+        {
+            rValue <<= mpDocSh->IsUseThumbnailSave();
+        }
+        break;
         case HANDLE_CHARACTER_COMPRESSION_TYPE:
         {
             rValue <<= static_cast < sal_Int16 > (mpDoc->getIDocumentSettingAccess().getCharacterCompressionType());


More information about the Libreoffice-commits mailing list