diff options
author | Eike Rathke <erack@redhat.com> | 2015-12-17 15:12:06 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-12-17 15:14:43 +0100 |
commit | 4eea9f214682008052424479a4b1f8cf90a79132 (patch) | |
tree | dc22d6d9e765da9072cb60ed01f8a9b9ec4b8064 /formula | |
parent | db1e34aecd4290623a74b9bbeb602e072b1a49ec (diff) |
handle varargs with first required and subsequent optional, tdf#71459 related
Change-Id: I56c66f516ba2a2e12cab4848c8c352315f27b3bb
Diffstat (limited to 'formula')
-rw-r--r-- | formula/source/ui/dlg/FormulaHelper.cxx | 1 | ||||
-rw-r--r-- | formula/source/ui/dlg/parawin.cxx | 20 |
2 files changed, 13 insertions, 8 deletions
diff --git a/formula/source/ui/dlg/FormulaHelper.cxx b/formula/source/ui/dlg/FormulaHelper.cxx index 1e296f710709..b2ff0c4eb90a 100644 --- a/formula/source/ui/dlg/FormulaHelper.cxx +++ b/formula/source/ui/dlg/FormulaHelper.cxx @@ -45,6 +45,7 @@ namespace formula virtual OUString getSignature() const override { return OUString(); } virtual OString getHelpId() const override { return ""; } virtual sal_uInt32 getParameterCount() const override { return 0; } + virtual sal_uInt32 getVarArgsStart() const override { return 0; } virtual OUString getParameterName(sal_uInt32 ) const override { return OUString(); } virtual OUString getParameterDescription(sal_uInt32 ) const override { return OUString(); } virtual bool isParameterOptional(sal_uInt32 ) const override { return false; } diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx index e32d257fdd8c..ee094724321b 100644 --- a/formula/source/ui/dlg/parawin.cxx +++ b/formula/source/ui/dlg/parawin.cxx @@ -136,8 +136,9 @@ void ParaWin::UpdateArgDesc( sal_uInt16 nArg ) aVisibleArgMapping[nPos] : aVisibleArgMapping.back()); aArgDesc = pFuncDesc->getParameterDescription(nRealArg); aArgName = pFuncDesc->getParameterName(nRealArg); - if ( nArg >= nFix ) - aArgName += OUString::number( nArg-nFix+1 ); + sal_uInt16 nVarArgsStart = pFuncDesc->getVarArgsStart(); + if ( nArg >= nVarArgsStart ) + aArgName += OUString::number( nArg-nVarArgsStart+1 ); aArgName += " "; aArgName += (nArg > nFix || pFuncDesc->isParameterOptional(nRealArg)) ? m_sOptional : m_sRequired ; @@ -154,8 +155,9 @@ void ParaWin::UpdateArgDesc( sal_uInt16 nArg ) aVisibleArgMapping[nPos] : aVisibleArgMapping.back()); aArgDesc = pFuncDesc->getParameterDescription(nRealArg); aArgName = pFuncDesc->getParameterName(nRealArg); - if ( nArg >= nFix ) - aArgName += OUString::number( (nArg-nFix)/2 + 1 ); + sal_uInt16 nVarArgsStart = pFuncDesc->getVarArgsStart(); + if ( nArg >= nVarArgsStart ) + aArgName += OUString::number( (nArg-nVarArgsStart)/2 + 1 ); aArgName += " "; aArgName += (nArg > (nFix+1) || pFuncDesc->isParameterOptional(nRealArg)) ? m_sOptional : m_sRequired ; @@ -188,10 +190,11 @@ void ParaWin::UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i ) SetArgNameFont( i, (nArg > nFix || pFuncDesc->isParameterOptional(nRealArg)) ? aFntLight : aFntBold ); - if ( nArg >= nFix ) + sal_uInt16 nVarArgsStart = pFuncDesc->getVarArgsStart(); + if ( nArg >= nVarArgsStart ) { OUString aArgName( pFuncDesc->getParameterName(nRealArg) ); - aArgName += OUString::number(nArg-nFix+1); + aArgName += OUString::number(nArg-nVarArgsStart+1); SetArgName( i, aArgName ); } else @@ -210,10 +213,11 @@ void ParaWin::UpdateArgInput( sal_uInt16 nOffset, sal_uInt16 i ) SetArgNameFont( i, (nArg > (nFix+1) || pFuncDesc->isParameterOptional(nRealArg)) ? aFntLight : aFntBold ); - if ( nArg >= nFix ) + sal_uInt16 nVarArgsStart = pFuncDesc->getVarArgsStart(); + if ( nArg >= nVarArgsStart ) { OUString aArgName( pFuncDesc->getParameterName(nRealArg) ); - aArgName += OUString::number( (nArg-nFix)/2 + 1 ); + aArgName += OUString::number( (nArg-nVarArgsStart)/2 + 1 ); SetArgName( i, aArgName ); } else |