[Libreoffice-commits] core.git: officecfg/registry sc/source

Dennis Francis dennisfrancis.in at gmail.com
Tue Apr 19 16:50:32 UTC 2016


 officecfg/registry/schema/org/openoffice/Office/Calc.xcs |    4 -
 sc/source/core/tool/appoptio.cxx                         |   43 ++++++++-------
 2 files changed, 27 insertions(+), 20 deletions(-)

New commits:
commit 219d1f3385907f8bb375b626b0a35f8239fa1550
Author: Dennis Francis <dennisfrancis.in at gmail.com>
Date:   Sat Apr 16 00:04:45 2016 +0530

    tdf#99329 : By default show sum and average statusbar functions...
    
    and correctly handle the non-default profiles from <= 5.1.*.
    
    Change-Id: If230364a81774e43836956eb38fb8257ddf176b2
    Reviewed-on: https://gerrit.libreoffice.org/24118
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Joel Madero <joel.madero at gmail.com>
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
index 8e068a8..bd17f4a 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs
@@ -400,7 +400,7 @@
             <desc>Selects a set of functions that are calculated for the selected cells, and which show the results in the status bar.</desc>
             <label>Statusbar Functions</label>
           </info>
-          <value>0</value>
+          <value>514</value>
         </prop>
         <prop oor:name="StatusbarFunction" oor:type="xs:int" oor:nillable="false">
           <!-- OldPath: Calc/Layout -->
@@ -447,7 +447,7 @@
               </info>
             </enumeration>
           </constraints>
-          <value>9</value>
+          <value>1</value>
         </prop>
         <prop oor:name="TabbarInlineWithScrollbar" oor:type="xs:boolean" oor:nillable="false">
           <info>
diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx
index cbc3c19..9ce684f 100644
--- a/sc/source/core/tool/appoptio.cxx
+++ b/sc/source/core/tool/appoptio.cxx
@@ -255,6 +255,14 @@ static void lcl_GetSortList( Any& rDest )
 #define SCCOMPATOPT_KEY_BINDING     0
 #define SCCOMPATOPT_COUNT           1
 
+// Default value of Layout/Other/StatusbarMultiFunction
+#define SCLAYOUTOPT_STATUSBARMULTI_DEFAULTVAL         514
+// Default value of Layout/Other/StatusbarFunction
+#define SCLAYOUTOPT_STATUSBAR_DEFAULTVAL              1
+// Legacy default value of Layout/Other/StatusbarFunction
+// prior to multiple statusbar functions feature addition
+#define SCLAYOUTOPT_STATUSBAR_DEFAULTVAL_LEGACY       9
+
 static sal_uInt32 lcl_ConvertStatusBarFuncSetToSingle( sal_uInt32 nFuncSet )
 {
     if ( !nFuncSet )
@@ -401,8 +409,9 @@ ScAppCfg::ScAppCfg() :
     OSL_ENSURE(aValues.getLength() == aNames.getLength(), "GetProperties failed");
     if(aValues.getLength() == aNames.getLength())
     {
-        bool bStatusBarFuncSingleFound = false;
-        bool bStatusBarFuncMultiFound = false;
+        sal_uInt32 nStatusBarFuncSingle = 0;
+        sal_uInt32 nStatusBarFuncMulti = 0;
+        sal_uInt32 nUIntValTmp = 0;
         for(int nProp = 0; nProp < aNames.getLength(); nProp++)
         {
             OSL_ENSURE(pValues[nProp].hasValue(), "property value missing");
@@ -414,10 +423,12 @@ ScAppCfg::ScAppCfg() :
                         if (pValues[nProp] >>= nIntVal) SetAppMetric( (FieldUnit) nIntVal );
                         break;
                     case SCLAYOUTOPT_STATUSBAR:
-                        bStatusBarFuncSingleFound = true;
+                        if ( pValues[SCLAYOUTOPT_STATUSBAR] >>= nUIntValTmp )
+                            nStatusBarFuncSingle = nUIntValTmp;
                         break;
                     case SCLAYOUTOPT_STATUSBARMULTI:
-                        bStatusBarFuncMultiFound = true;
+                        if ( pValues[SCLAYOUTOPT_STATUSBARMULTI] >>= nUIntValTmp )
+                            nStatusBarFuncMulti = nUIntValTmp;
                         break;
                     case SCLAYOUTOPT_ZOOMVAL:
                         if (pValues[nProp] >>= nIntVal) SetZoom( (sal_uInt16) nIntVal );
@@ -432,22 +443,18 @@ ScAppCfg::ScAppCfg() :
             }
         }
 
-        sal_uInt32 nUIntVal = 0;
-        if ( bStatusBarFuncMultiFound )
-        {
-            if ( pValues[SCLAYOUTOPT_STATUSBARMULTI] >>= nUIntVal )
-                SetStatusFunc( nUIntVal );
-        }
-        else if ( bStatusBarFuncSingleFound )
+        if ( nStatusBarFuncMulti != SCLAYOUTOPT_STATUSBARMULTI_DEFAULTVAL )
+            SetStatusFunc( nStatusBarFuncMulti );
+        else if ( nStatusBarFuncSingle != SCLAYOUTOPT_STATUSBAR_DEFAULTVAL &&
+                  nStatusBarFuncSingle != SCLAYOUTOPT_STATUSBAR_DEFAULTVAL_LEGACY )
         {
-            if ( pValues[SCLAYOUTOPT_STATUSBAR] >>= nUIntVal )
-            {
-                if ( nUIntVal )
-                    SetStatusFunc( 1 << nUIntVal );
-                else
-                    SetStatusFunc( 0 );
-            }
+            if ( nStatusBarFuncSingle )
+                SetStatusFunc( 1 << nStatusBarFuncSingle );
+            else
+                SetStatusFunc( 0 );
         }
+        else
+            SetStatusFunc( SCLAYOUTOPT_STATUSBARMULTI_DEFAULTVAL );
     }
     aLayoutItem.SetCommitLink( LINK( this, ScAppCfg, LayoutCommitHdl ) );
 


More information about the Libreoffice-commits mailing list