[Libreoffice-commits] core.git: formula/source: get rid of unnecessary warning

Eike Rathke erack at redhat.com
Tue Aug 27 07:20:32 PDT 2013


Hi Winfried,

On Tuesday, 2013-08-27 06:48:28 -0700, Winfried Donkers wrote:

> commit e5321437322fd812b93fee266af309e782479488
> Author: Winfried Donkers <winfrieddonkers at libreoffice.org>
> Date:   Thu Aug 22 17:03:58 2013 +0200
> 
>     get rid of unnecessary warning
>     
>     A value of 0 for Opcode eOp produces a debug assertion that is
>     not in place as opcode with value does exist (ocPush, SC_OPCODE_PUSH).
> 
> --- a/formula/source/core/api/FormulaCompiler.cxx
> +++ b/formula/source/core/api/FormulaCompiler.cxx
> @@ -488,8 +488,8 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
>  
>  void FormulaCompiler::OpCodeMap::putOpCode( const String & rStr, const OpCode eOp )
>  {
> -    DBG_ASSERT( 0 < eOp && sal_uInt16(eOp) < mnSymbols, "OpCodeMap::putOpCode: OpCode out of range");
> -    if (0 < eOp && sal_uInt16(eOp) < mnSymbols)
> +    DBG_ASSERT( sal_uInt16(eOp) < mnSymbols, "OpCodeMap::putOpCode: OpCode out of range");
> +    if (sal_uInt16(eOp) < mnSymbols)
>      {

When did you encounter that warning?
Putting ocPush into an OpCodeMap probably indicates an error, as ocPush
is not an operator or function that maps to any string. An ocPush is
always used with a cell reference, fixed value or function result.
Unless there is a compelling reason for this change I suggest to revert it.

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key ID: 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
For key transition see http://erack.de/key-transition-2013-01-10.txt.asc
Support the FSFE, care about Free Software! https://fsfe.org/support/?erack
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20130827/c912dc38/attachment.pgp>


More information about the LibreOffice mailing list