Return-Path: X-Original-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 847F2D546 for ; Thu, 21 Jun 2012 05:26:12 +0000 (UTC) Received: (qmail 58943 invoked by uid 500); 21 Jun 2012 05:26:12 -0000 Delivered-To: apmail-incubator-ooo-commits-archive@incubator.apache.org Received: (qmail 58825 invoked by uid 500); 21 Jun 2012 05:26:11 -0000 Mailing-List: contact ooo-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-commits@incubator.apache.org Received: (qmail 58803 invoked by uid 99); 21 Jun 2012 05:26:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jun 2012 05:26:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jun 2012 05:26:09 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3AD9B23889BF; Thu, 21 Jun 2012 05:25:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1352412 - /incubator/ooo/trunk/main/sc/source/filter/excel/excform.cxx Date: Thu, 21 Jun 2012 05:25:49 -0000 To: ooo-commits@incubator.apache.org From: leiw@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120621052549.3AD9B23889BF@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: leiw Date: Thu Jun 21 05:25:48 2012 New Revision: 1352412 URL: http://svn.apache.org/viewvc?rev=1352412&view=rev Log: #i119942 - Last agrument of formula should not be removed Patch by: Zhang Lu Review by: Wang Lei Modified: incubator/ooo/trunk/main/sc/source/filter/excel/excform.cxx Modified: incubator/ooo/trunk/main/sc/source/filter/excel/excform.cxx URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/filter/excel/excform.cxx?rev=1352412&r1=1352411&r2=1352412&view=diff ============================================================================== --- incubator/ooo/trunk/main/sc/source/filter/excel/excform.cxx (original) +++ incubator/ooo/trunk/main/sc/source/filter/excel/excform.cxx Thu Jun 21 05:25:48 2012 @@ -1525,6 +1525,37 @@ sal_Bool ExcelToSc::GetAbsRefs( ScRangeL return rRangeList.Count() != 0; } +static DefTokenId missArgForZeroList[] = { + ocCount, + ocCount2, + ocAverage, + ocMin, + ocMinA, + ocMax, + ocMaxA, + ocStDev, + ocStDevA, + ocVar, + ocVarP, + ocAveDev, + ocKurt, + ocSchiefe, + ocVarPA, + ocVarA, + ocDevSq +}; + +#define missArgForZeroCount sizeof(missArgForZeroList)/sizeof(DefTokenId) + + +sal_Bool lcl_isInMissArgForZeroList(DefTokenId id) +{ + for(short index = 0; index < missArgForZeroCount; index++) + if(missArgForZeroList[index] == id) + return sal_True; + return sal_False; + +} void ExcelToSc::DoMulArgs( DefTokenId eId, sal_uInt8 nAnz, sal_uInt8 nMinParamCount ) { TokenId eParam[ 256 ]; @@ -1575,7 +1606,7 @@ void ExcelToSc::DoMulArgs( DefTokenId eI nSkipEnd = 0; // letzten Parameter bei Bedarf weglassen // Joost-Spezialfaelle - else if( eId == ocIf ) + else if( eId == ocIf || lcl_isInMissArgForZeroList(eId)) { sal_uInt16 nNullParam = 0; for( nLauf = 0 ; nLauf < nAnz ; nLauf++ )