[Libreoffice-commits] core.git: cui/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 21 11:11:37 UTC 2018


 cui/source/options/personalization.cxx |    7 ++-----
 cui/source/options/personalization.hxx |    8 +++++---
 2 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit 356db87a6b622722d0d04ee3e17730a96865770a
Author:     Muhammet Kara <muhammet.kara at pardus.org.tr>
AuthorDate: Thu Sep 20 19:24:56 2018 +0300
Commit:     Muhammet Kara <muhammet.kara at pardus.org.tr>
CommitDate: Fri Sep 21 13:11:12 2018 +0200

    Make use of the already defined constants for personas
    
    Change-Id: I7bba01f03fb5cf327e9ff4f21314859857033acd
    Reviewed-on: https://gerrit.libreoffice.org/60834
    Tested-by: Jenkins
    Reviewed-by: Muhammet Kara <muhammet.kara at pardus.org.tr>

diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index fde5872aeaf2..27c0b2e836f4 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -38,9 +38,6 @@
 #include <ucbhelper/content.hxx>
 #include <comphelper/simplefileaccessinteraction.hxx>
 
-#define MAX_RESULTS 9
-#define MAX_DEFAULT_PERSONAS 3
-
 using namespace com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::ucb;
@@ -205,7 +202,7 @@ IMPL_LINK( SelectPersonaDialog, SelectPersona, Button*, pButton, void )
     if( m_pSearchThread.is() )
         m_pSearchThread->StopExecution();
 
-    for( sal_Int32 index = 0; index < 9; index++ )
+    for( sal_Int32 index = 0; index < MAX_RESULTS; index++ )
     {
         if( pButton == m_vResultList[index] )
         {
@@ -533,7 +530,7 @@ IMPL_LINK( SvxPersonalizationTabPage, ForceSelect, Button*, pButton, void )
 IMPL_LINK( SvxPersonalizationTabPage, DefaultPersona, Button*, pButton, void )
 {
     m_pDefaultPersona->Check();
-    for( sal_Int32 nIndex = 0; nIndex < 3; nIndex++ )
+    for( sal_Int32 nIndex = 0; nIndex < MAX_DEFAULT_PERSONAS; nIndex++ )
     {
         if( pButton == m_vDefaultPersonaImages[nIndex] )
             m_aPersonaSettings = m_vDefaultPersonaSettings[nIndex];
diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx
index aae43240ea80..b1b91d917f25 100644
--- a/cui/source/options/personalization.hxx
+++ b/cui/source/options/personalization.hxx
@@ -18,7 +18,9 @@
 #include <array>
 #include <atomic>
 
-#define CATEGORYCOUNT 6    // Number of persona categories
+#define CATEGORYCOUNT 6         // Number of persona categories
+#define MAX_RESULTS 9           // Maximum number of search results
+#define MAX_DEFAULT_PERSONAS 3  // Maximum number of default personas
 
 class FixedText;
 class SearchAndParseThread;
@@ -32,7 +34,7 @@ private:
     VclPtr<RadioButton> m_pDefaultPersona;             ///< Use the built-in bitmap
     VclPtr<RadioButton> m_pOwnPersona;                 ///< Use the user-defined bitmap
     VclPtr<PushButton> m_pSelectPersona;               ///< Let the user select in the 'own' case
-    VclPtr<PushButton> m_vDefaultPersonaImages[3];     ///< Buttons to show the default persona images
+    VclPtr<PushButton> m_vDefaultPersonaImages[MAX_DEFAULT_PERSONAS];     ///< Buttons to show the default persona images
     VclPtr<PushButton> m_pExtensionPersonaPreview;     ///< Buttons to show the last 3 personas installed via extensions
     VclPtr<ListBox> m_pPersonaList;                    ///< The ListBox to show the list of installed personas
     OUString m_aPersonaSettings;                       ///< Header and footer images + color to be set in the settings.
@@ -83,7 +85,7 @@ private:
     VclPtr<Edit> m_pEdit;                                   ///< The input line for the search term
     VclPtr<PushButton> m_pSearchButton;                     ///< The search button
     VclPtr<FixedText> m_pProgressLabel;                     ///< The label for showing progress of search
-    VclPtr<PushButton> m_vResultList[9];                    ///< List of buttons to show search results
+    VclPtr<PushButton> m_vResultList[MAX_RESULTS];                    ///< List of buttons to show search results
     VclPtr<PushButton> m_vSearchSuggestions[CATEGORYCOUNT]; ///< List of buttons for the search suggestions
     VclPtr<PushButton> m_pOkButton;                         ///< The OK button
     VclPtr<PushButton> m_pCancelButton;                     ///< The Cancel button


More information about the Libreoffice-commits mailing list