summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorDennis Francis <dennisfrancis.in@gmail.com>2016-04-16 00:04:45 +0530
committerEike Rathke <erack@redhat.com>2016-04-19 16:50:09 +0000
commit219d1f3385907f8bb375b626b0a35f8239fa1550 (patch)
tree80efb572ea27d8c6e6b93ea846f6e66adf314c42 /sc
parent563638f2e52b8ea6408422de7861ad82594b9842 (diff)
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@libreoffice.org> Reviewed-by: Joel Madero <joel.madero@gmail.com> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/appoptio.cxx43
1 files changed, 25 insertions, 18 deletions
diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx
index cbc3c19a3e8c..9ce684ffb7bb 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 ) );