diff options
author | Dennis Francis <dennisfrancis.in@gmail.com> | 2016-04-16 00:04:45 +0530 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-04-19 16:50:09 +0000 |
commit | 219d1f3385907f8bb375b626b0a35f8239fa1550 (patch) | |
tree | 80efb572ea27d8c6e6b93ea846f6e66adf314c42 | |
parent | 563638f2e52b8ea6408422de7861ad82594b9842 (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>
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/Calc.xcs | 4 | ||||
-rw-r--r-- | sc/source/core/tool/appoptio.cxx | 43 |
2 files changed, 27 insertions, 20 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Calc.xcs b/officecfg/registry/schema/org/openoffice/Office/Calc.xcs index 8e068a878dba..bd17f4aa8153 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 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 ) ); |