2010-10-12 15:59:00 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-30 12:23:25 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2004-03-08 10:49:13 +00:00
|
|
|
|
|
|
|
#include "parclass.hxx"
|
|
|
|
#include "token.hxx"
|
|
|
|
#include "global.hxx"
|
|
|
|
#include "callform.hxx"
|
|
|
|
#include "addincol.hxx"
|
2008-03-07 10:17:33 +00:00
|
|
|
#include "funcdesc.hxx"
|
2004-03-08 10:49:13 +00:00
|
|
|
#include <unotools/charclass.hxx>
|
2011-03-11 12:45:16 +01:00
|
|
|
#include <osl/diagnose.h>
|
2010-12-03 13:59:12 +00:00
|
|
|
#include <sal/macros.h>
|
2004-03-08 10:49:13 +00:00
|
|
|
#include <string.h>
|
|
|
|
|
2016-03-05 00:23:12 +05:30
|
|
|
#if DEBUG_SC_PARCLASSDOC
|
2004-03-08 10:49:13 +00:00
|
|
|
// the documentation thingy
|
2008-01-10 12:14:16 +00:00
|
|
|
#include <com/sun/star/sheet/FormulaLanguage.hpp>
|
2011-01-16 17:45:09 +01:00
|
|
|
#include <rtl/strbuf.hxx>
|
2004-03-08 10:49:13 +00:00
|
|
|
#include "compiler.hxx"
|
2013-10-22 15:58:57 +03:00
|
|
|
#include "sc.hrc"
|
2004-03-08 10:49:13 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Following assumptions are made:
|
|
|
|
* - OpCodes not specified at all will have at least one and only parameters of
|
|
|
|
* type Value, no check is done on the count of parameters => no Bounds type
|
|
|
|
* is returned.
|
2012-12-15 00:06:28 +01:00
|
|
|
* - For OpCodes with a variable number of parameters the type(s) of the last
|
|
|
|
* repeated parameter(s) specified determine(s) the type(s) of all following
|
|
|
|
* parameters.
|
2004-03-08 10:49:13 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
const ScParameterClassification::RawData ScParameterClassification::pRawData[] =
|
|
|
|
{
|
2012-12-15 00:06:28 +01:00
|
|
|
// { OpCode, {{ Type, ... }, nRepeatLast }},
|
|
|
|
|
2004-03-08 10:49:13 +00:00
|
|
|
// IF() and CHOOSE() are somewhat special, since the ScJumpMatrix is
|
|
|
|
// created inside those functions and ConvertMatrixParameters() is not
|
|
|
|
// called for them.
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocIf, {{ Array, Reference, Reference }, 0 }},
|
2013-01-11 16:50:48 +01:00
|
|
|
{ ocIfError, {{ Array, Reference }, 0 }},
|
|
|
|
{ ocIfNA, {{ Array, Reference }, 0 }},
|
2015-01-12 19:56:39 +01:00
|
|
|
{ ocChoose, {{ Array, Reference }, 1 }},
|
2004-03-08 10:49:13 +00:00
|
|
|
// Other specials.
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocOpen, {{ Bounds }, 0 }},
|
|
|
|
{ ocClose, {{ Bounds }, 0 }},
|
|
|
|
{ ocSep, {{ Bounds }, 0 }},
|
|
|
|
{ ocNoName, {{ Bounds }, 0 }},
|
|
|
|
{ ocStop, {{ Bounds }, 0 }},
|
|
|
|
{ ocUnion, {{ Reference, Reference }, 0 }},
|
|
|
|
{ ocRange, {{ Reference, Reference }, 0 }},
|
2004-03-08 10:49:13 +00:00
|
|
|
// Functions with Value parameters only but not in resource.
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocBackSolver, {{ Value, Value, Value }, 0 }},
|
|
|
|
{ ocTableOp, {{ Value, Value, Value, Value, Value }, 0 }},
|
2004-03-08 10:49:13 +00:00
|
|
|
// Operators and functions.
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocAdd, {{ Array, Array }, 0 }},
|
|
|
|
{ ocAmpersand, {{ Array, Array }, 0 }},
|
|
|
|
{ ocAnd, {{ Reference }, 1 }},
|
|
|
|
{ ocAreas, {{ Reference }, 0 }},
|
|
|
|
{ ocAveDev, {{ Reference }, 1 }},
|
|
|
|
{ ocAverage, {{ Reference }, 1 }},
|
|
|
|
{ ocAverageA, {{ Reference }, 1 }},
|
|
|
|
{ ocAverageIf, {{ Reference, Value, Reference }, 0 }},
|
|
|
|
{ ocAverageIfs, {{ Reference, Reference, Value }, 2 }},
|
|
|
|
{ ocCell, {{ Value, Reference }, 0 }},
|
|
|
|
{ ocColumn, {{ Reference }, 0 }},
|
|
|
|
{ ocColumns, {{ Reference }, 1 }},
|
|
|
|
{ ocCorrel, {{ ForceArray, ForceArray }, 0 }},
|
|
|
|
{ ocCount, {{ Reference }, 1 }},
|
|
|
|
{ ocCount2, {{ Reference }, 1 }},
|
|
|
|
{ ocCountEmptyCells, {{ Reference }, 0 }},
|
|
|
|
{ ocCountIf, {{ Reference, Value }, 0 }},
|
|
|
|
{ ocCountIfs, {{ Reference, Value }, 2 }},
|
|
|
|
{ ocCovar, {{ ForceArray, ForceArray }, 0 }},
|
2013-10-30 19:46:23 +01:00
|
|
|
{ ocCovarianceP, {{ ForceArray, ForceArray }, 0 }},
|
|
|
|
{ ocCovarianceS, {{ ForceArray, ForceArray }, 0 }},
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocDBAverage, {{ Reference, Reference, Reference }, 0 }},
|
|
|
|
{ ocDBCount, {{ Reference, Reference, Reference }, 0 }},
|
|
|
|
{ ocDBCount2, {{ Reference, Reference, Reference }, 0 }},
|
|
|
|
{ ocDBGet, {{ Reference, Reference, Reference }, 0 }},
|
|
|
|
{ ocDBMax, {{ Reference, Reference, Reference }, 0 }},
|
|
|
|
{ ocDBMin, {{ Reference, Reference, Reference }, 0 }},
|
|
|
|
{ ocDBProduct, {{ Reference, Reference, Reference }, 0 }},
|
|
|
|
{ ocDBStdDev, {{ Reference, Reference, Reference }, 0 }},
|
|
|
|
{ ocDBStdDevP, {{ Reference, Reference, Reference }, 0 }},
|
|
|
|
{ ocDBSum, {{ Reference, Reference, Reference }, 0 }},
|
|
|
|
{ ocDBVar, {{ Reference, Reference, Reference }, 0 }},
|
|
|
|
{ ocDBVarP, {{ Reference, Reference, Reference }, 0 }},
|
|
|
|
{ ocDevSq, {{ Reference }, 1 }},
|
|
|
|
{ ocDiv, {{ Array, Array }, 0 }},
|
|
|
|
{ ocEqual, {{ Array, Array }, 0 }},
|
|
|
|
{ ocForecast, {{ Value, ForceArray, ForceArray }, 0 }},
|
2015-07-24 18:22:20 +02:00
|
|
|
{ ocFormula, {{ Reference }, 0 }},
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocFrequency, {{ Reference, Reference }, 0 }},
|
|
|
|
{ ocFTest, {{ ForceArray, ForceArray }, 0 }},
|
|
|
|
{ ocGeoMean, {{ Reference }, 1 }},
|
|
|
|
{ ocGCD, {{ Reference }, 1 }},
|
|
|
|
{ ocGreater, {{ Array, Array }, 0 }},
|
|
|
|
{ ocGreaterEqual, {{ Array, Array }, 0 }},
|
|
|
|
{ ocGrowth, {{ Reference, Reference, Reference, Value }, 0 }},
|
|
|
|
{ ocHarMean, {{ Reference }, 1 }},
|
2015-07-21 16:09:34 +02:00
|
|
|
{ ocHLookup, {{ Value, ReferenceOrForceArray, Value, Value }, 0 }},
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocIRR, {{ Reference, Value }, 0 }},
|
|
|
|
{ ocIndex, {{ Reference, Value, Value, Value }, 0 }},
|
|
|
|
{ ocIntercept, {{ ForceArray, ForceArray }, 0 }},
|
|
|
|
{ ocIntersect, {{ Reference, Reference }, 0 }},
|
|
|
|
{ ocIsRef, {{ Reference }, 0 }},
|
|
|
|
{ ocLCM, {{ Reference }, 1 }},
|
|
|
|
{ ocKurt, {{ Reference }, 1 }},
|
|
|
|
{ ocLarge, {{ Reference, Value }, 0 }},
|
|
|
|
{ ocLess, {{ Array, Array }, 0 }},
|
|
|
|
{ ocLessEqual, {{ Array, Array }, 0 }},
|
|
|
|
{ ocLookup, {{ Value, ReferenceOrForceArray, ReferenceOrForceArray }, 0 }},
|
2015-07-21 16:09:34 +02:00
|
|
|
{ ocMatch, {{ Value, ReferenceOrForceArray, Value }, 0 }},
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocMatDet, {{ ForceArray }, 0 }},
|
|
|
|
{ ocMatInv, {{ ForceArray }, 0 }},
|
|
|
|
{ ocMatMult, {{ ForceArray, ForceArray }, 0 }},
|
|
|
|
{ ocMatTrans, {{ Array }, 0 }}, // strange, but Xcl doesn't force MatTrans array
|
|
|
|
{ ocMatValue, {{ Reference, Value, Value }, 0 }},
|
|
|
|
{ ocMax, {{ Reference }, 1 }},
|
|
|
|
{ ocMaxA, {{ Reference }, 1 }},
|
|
|
|
{ ocMedian, {{ Reference }, 1 }},
|
|
|
|
{ ocMin, {{ Reference }, 1 }},
|
|
|
|
{ ocMinA, {{ Reference }, 1 }},
|
|
|
|
{ ocMIRR, {{ Reference, Value, Value }, 0 }},
|
|
|
|
{ ocModalValue, {{ ForceArray }, 1 }},
|
2014-02-02 12:37:39 +01:00
|
|
|
{ ocModalValue_MS, {{ ForceArray }, 1 }},
|
|
|
|
{ ocModalValue_Multi,{{ ForceArray }, 1 }},
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocMul, {{ Array, Array }, 0 }},
|
|
|
|
{ ocMultiArea, {{ Reference }, 1 }},
|
|
|
|
{ ocNPV, {{ Value, Reference }, 1 }},
|
|
|
|
{ ocNeg, {{ Array }, 0 }},
|
|
|
|
{ ocNegSub, {{ Array }, 0 }},
|
|
|
|
{ ocNot, {{ Array }, 0 }},
|
|
|
|
{ ocNotEqual, {{ Array, Array }, 0 }},
|
|
|
|
{ ocOffset, {{ Reference, Value, Value, Value, Value }, 0 }},
|
|
|
|
{ ocOr, {{ Reference }, 1 }},
|
|
|
|
{ ocPearson, {{ ForceArray, ForceArray }, 0 }},
|
|
|
|
{ ocPercentile, {{ Reference, Value }, 0 }},
|
2014-02-26 11:08:12 +01:00
|
|
|
{ ocPercentile_Exc, {{ Reference, Value }, 0 }},
|
|
|
|
{ ocPercentile_Inc, {{ Reference, Value }, 0 }},
|
2014-01-30 17:13:56 +01:00
|
|
|
{ ocPercentrank, {{ Reference, Value, Value }, 0 }},
|
2014-02-26 11:08:12 +01:00
|
|
|
{ ocPercentrank_Exc, {{ Reference, Value, Value }, 0 }},
|
|
|
|
{ ocPercentrank_Inc, {{ Reference, Value, Value }, 0 }},
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocPow, {{ Array, Array }, 0 }},
|
|
|
|
{ ocPower, {{ Array, Array }, 0 }},
|
|
|
|
{ ocProb, {{ ForceArray, ForceArray, Value, Value }, 0 }},
|
|
|
|
{ ocProduct, {{ Reference }, 1 }},
|
|
|
|
{ ocQuartile, {{ Reference, Value }, 0 }},
|
2014-02-26 11:08:12 +01:00
|
|
|
{ ocQuartile_Exc, {{ Reference, Value }, 0 }},
|
|
|
|
{ ocQuartile_Inc, {{ Reference, Value }, 0 }},
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocRank, {{ Value, Reference, Value }, 0 }},
|
2014-02-26 11:08:12 +01:00
|
|
|
{ ocRank_Avg, {{ Value, Reference, Value }, 0 }},
|
|
|
|
{ ocRank_Eq, {{ Value, Reference, Value }, 0 }},
|
2015-10-07 22:23:51 +02:00
|
|
|
{ ocLinest, {{ ForceArray, ForceArray, Value, Value }, 0 }},
|
|
|
|
{ ocLogest, {{ ForceArray, ForceArray, Value, Value }, 0 }},
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocRow, {{ Reference }, 0 }},
|
|
|
|
{ ocRows, {{ Reference }, 1 }},
|
|
|
|
{ ocRSQ, {{ ForceArray, ForceArray }, 0 }},
|
2015-01-12 20:23:29 +01:00
|
|
|
{ ocSkew, {{ Reference }, 1 }},
|
2013-02-06 19:09:00 +01:00
|
|
|
{ ocSkewp, {{ Reference }, 1 }},
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocSlope, {{ ForceArray, ForceArray }, 0 }},
|
|
|
|
{ ocSmall, {{ Reference, Value }, 0 }},
|
|
|
|
{ ocStDev, {{ Reference }, 1 }},
|
|
|
|
{ ocStDevA, {{ Reference }, 1 }},
|
|
|
|
{ ocStDevP, {{ Reference }, 1 }},
|
|
|
|
{ ocStDevPA, {{ Reference }, 1 }},
|
2013-10-30 19:53:48 +01:00
|
|
|
{ ocStDevP_MS, {{ Reference }, 1 }},
|
|
|
|
{ ocStDevS, {{ Reference }, 1 }},
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocSTEYX, {{ ForceArray, ForceArray }, 0 }},
|
|
|
|
{ ocSub, {{ Array, Array }, 0 }},
|
|
|
|
{ ocSubTotal, {{ Value, Reference }, 1 }},
|
|
|
|
{ ocSum, {{ Reference }, 1 }},
|
|
|
|
{ ocSumIf, {{ Reference, Value, Reference }, 0 }},
|
|
|
|
{ ocSumIfs, {{ Reference, Reference, Value }, 2 }},
|
|
|
|
{ ocSumProduct, {{ ForceArray }, 1 }},
|
|
|
|
{ ocSumSQ, {{ Reference }, 1 }},
|
|
|
|
{ ocSumX2MY2, {{ ForceArray, ForceArray }, 0 }},
|
|
|
|
{ ocSumX2DY2, {{ ForceArray, ForceArray }, 0 }},
|
|
|
|
{ ocSumXMY2, {{ ForceArray, ForceArray }, 0 }},
|
2015-03-03 14:51:57 +01:00
|
|
|
{ ocSheet, {{ Reference }, 0 }},
|
|
|
|
{ ocSheets, {{ Reference }, 1 }},
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocTrend, {{ Reference, Reference, Reference, Value }, 0 }},
|
|
|
|
{ ocTrimMean, {{ Reference, Value }, 0 }},
|
|
|
|
{ ocTTest, {{ ForceArray, ForceArray, Value, Value }, 0 }},
|
|
|
|
{ ocVar, {{ Reference }, 1 }},
|
|
|
|
{ ocVarA, {{ Reference }, 1 }},
|
|
|
|
{ ocVarP, {{ Reference }, 1 }},
|
|
|
|
{ ocVarPA, {{ Reference }, 1 }},
|
2013-10-29 17:30:42 +01:00
|
|
|
{ ocVarP_MS, {{ Reference }, 1 }},
|
|
|
|
{ ocVarS, {{ Reference }, 1 }},
|
2015-07-21 16:09:34 +02:00
|
|
|
{ ocVLookup, {{ Value, ReferenceOrForceArray, Value, Value }, 0 }},
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocXor, {{ Reference }, 1 }},
|
|
|
|
{ ocZTest, {{ Reference, Value, Value }, 0 }},
|
2014-02-02 12:37:39 +01:00
|
|
|
{ ocZTest_MS, {{ Reference, Value, Value }, 0 }},
|
2014-05-12 12:02:11 +02:00
|
|
|
{ ocNetWorkdays, {{ Value, Value, Reference, Reference }, 0 }},
|
2014-03-27 13:33:15 +01:00
|
|
|
{ ocNetWorkdays_MS, {{ Value, Value, Value, Reference }, 0 }},
|
|
|
|
{ ocWorkday_MS, {{ Value, Value, Value, Reference }, 0 }},
|
2014-04-17 21:58:26 +02:00
|
|
|
{ ocAggregate, {{ Value, Value, Reference }, 1 }},
|
2016-01-30 10:14:05 +01:00
|
|
|
{ ocForecast_ETS_ADD, {{ ForceArray, ForceArray, ForceArray, Value, Value, Value }, 0 }},
|
|
|
|
{ ocForecast_ETS_MUL, {{ ForceArray, ForceArray, ForceArray, Value, Value, Value }, 0 }},
|
|
|
|
{ ocForecast_ETS_PIA, {{ ForceArray, ForceArray, ForceArray, Value, Value, Value, Value }, 0 }},
|
|
|
|
{ ocForecast_ETS_PIM, {{ ForceArray, ForceArray, ForceArray, Value, Value, Value, Value }, 0 }},
|
|
|
|
{ ocForecast_ETS_SEA, {{ ForceArray, ForceArray, Value, Value }, 0 }},
|
|
|
|
{ ocForecast_ETS_STA, {{ ForceArray, ForceArray, ForceArray, Value, Value, Value }, 0 }},
|
|
|
|
{ ocForecast_ETS_STM, {{ ForceArray, ForceArray, ForceArray, Value, Value, Value }, 0 }},
|
2004-03-08 10:49:13 +00:00
|
|
|
// Excel doubts:
|
2012-06-26 20:51:22 +02:00
|
|
|
// ocN, ocT: Excel says (and handles) Reference, error? This means no
|
|
|
|
// position dependent SingleRef if DoubleRef, and no array calculation,
|
|
|
|
// just the upper left corner. We never did that for ocT and now also not
|
|
|
|
// for ocN (position dependent intersection worked before but array
|
|
|
|
// didn't). No specifics in ODFF, so the general rule applies. Gnumeric
|
|
|
|
// does the same.
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocN, {{ Value }, 0 }},
|
|
|
|
{ ocT, {{ Value }, 0 }},
|
2004-03-08 10:49:13 +00:00
|
|
|
// The stopper.
|
2012-12-15 00:06:28 +01:00
|
|
|
{ ocNone, {{ Bounds }, 0 } }
|
2004-03-08 10:49:13 +00:00
|
|
|
};
|
|
|
|
|
2015-11-10 10:22:39 +01:00
|
|
|
ScParameterClassification::RunData * ScParameterClassification::pData = nullptr;
|
2004-03-08 10:49:13 +00:00
|
|
|
|
|
|
|
void ScParameterClassification::Init()
|
|
|
|
{
|
|
|
|
if ( pData )
|
|
|
|
return;
|
|
|
|
pData = new RunData[ SC_OPCODE_LAST_OPCODE_ID + 1 ];
|
|
|
|
memset( pData, 0, sizeof(RunData) * (SC_OPCODE_LAST_OPCODE_ID + 1));
|
|
|
|
|
|
|
|
// init from specified static data above
|
2016-05-06 10:14:38 +02:00
|
|
|
for (const auto & i : pRawData)
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
2016-05-06 10:14:38 +02:00
|
|
|
const RawData* pRaw = &i;
|
2004-03-08 10:49:13 +00:00
|
|
|
if ( pRaw->eOp > SC_OPCODE_LAST_OPCODE_ID )
|
|
|
|
{
|
2011-05-21 13:29:51 +02:00
|
|
|
OSL_ENSURE( pRaw->eOp == ocNone, "RawData OpCode error");
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
RunData* pRun = &pData[ pRaw->eOp ];
|
2016-03-05 00:23:12 +05:30
|
|
|
SAL_WARN_IF(pRun->aData.nParam[0] != Unknown, "sc.core", "already assigned: " << (int)pRaw->eOp);
|
2004-03-08 10:49:13 +00:00
|
|
|
memcpy( &(pRun->aData), &(pRaw->aData), sizeof(CommonData));
|
|
|
|
// fill 0-initialized fields with real values
|
2012-12-15 00:06:28 +01:00
|
|
|
if ( pRun->aData.nRepeatLast )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
2011-09-01 16:18:52 +01:00
|
|
|
for ( sal_Int32 j=0; j < CommonData::nMaxParams; ++j )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
|
|
|
if ( pRun->aData.nParam[j] )
|
2011-01-17 13:20:22 +01:00
|
|
|
pRun->nMinParams = sal::static_int_cast<sal_uInt8>( j+1 );
|
2012-12-15 00:06:28 +01:00
|
|
|
else if (j >= pRun->aData.nRepeatLast)
|
|
|
|
pRun->aData.nParam[j] = pRun->aData.nParam[j - pRun->aData.nRepeatLast];
|
2004-03-08 10:49:13 +00:00
|
|
|
else
|
2012-12-15 00:06:28 +01:00
|
|
|
{
|
2015-03-13 18:20:18 +01:00
|
|
|
SAL_INFO(
|
|
|
|
"sc.core",
|
|
|
|
"bad classification: eOp " << +pRaw->eOp
|
|
|
|
<< ", repeated param " << j
|
|
|
|
<< " negative offset");
|
2012-12-15 00:06:28 +01:00
|
|
|
pRun->aData.nParam[j] = Unknown;
|
|
|
|
}
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-09-01 16:18:52 +01:00
|
|
|
for ( sal_Int32 j=0; j < CommonData::nMaxParams; ++j )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
|
|
|
if ( !pRun->aData.nParam[j] )
|
|
|
|
{
|
|
|
|
if ( j == 0 || pRun->aData.nParam[j-1] != Bounds )
|
2011-01-17 13:20:22 +01:00
|
|
|
pRun->nMinParams = sal::static_int_cast<sal_uInt8>( j );
|
2004-03-08 10:49:13 +00:00
|
|
|
pRun->aData.nParam[j] = Bounds;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( !pRun->nMinParams &&
|
|
|
|
pRun->aData.nParam[CommonData::nMaxParams-1] != Bounds)
|
|
|
|
pRun->nMinParams = CommonData::nMaxParams;
|
|
|
|
}
|
2016-05-06 10:14:38 +02:00
|
|
|
for (ScParameterClassification::Type & j : pRun->aData.nParam)
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
2016-05-06 10:14:38 +02:00
|
|
|
if ( j == ForceArray || j == ReferenceOrForceArray )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
|
|
|
pRun->bHasForceArray = true;
|
|
|
|
break; // for
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-05 00:23:12 +05:30
|
|
|
#if DEBUG_SC_PARCLASSDOC
|
2004-03-08 10:49:13 +00:00
|
|
|
GenerateDocumentation();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScParameterClassification::Exit()
|
|
|
|
{
|
|
|
|
delete [] pData;
|
2015-11-10 10:22:39 +01:00
|
|
|
pData = nullptr;
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ScParameterClassification::Type ScParameterClassification::GetParameterType(
|
2011-01-17 13:20:22 +01:00
|
|
|
const formula::FormulaToken* pToken, sal_uInt16 nParameter)
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
|
|
|
OpCode eOp = pToken->GetOpCode();
|
|
|
|
switch ( eOp )
|
|
|
|
{
|
|
|
|
case ocExternal:
|
|
|
|
return GetExternalParameterType( pToken, nParameter);
|
|
|
|
case ocMacro:
|
|
|
|
return Reference;
|
2007-02-27 11:17:38 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
// added to avoid warnings
|
|
|
|
}
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
2008-01-10 12:14:16 +00:00
|
|
|
if ( 0 <= (short)eOp && eOp <= SC_OPCODE_LAST_OPCODE_ID )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
2012-12-15 00:06:28 +01:00
|
|
|
sal_uInt8 nRepeat;
|
|
|
|
Type eType;
|
2004-03-08 10:49:13 +00:00
|
|
|
if ( nParameter < CommonData::nMaxParams )
|
2012-12-15 00:06:28 +01:00
|
|
|
eType = pData[eOp].aData.nParam[nParameter];
|
|
|
|
else if ( (nRepeat = pData[eOp].aData.nRepeatLast) > 0 )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
2012-12-15 00:06:28 +01:00
|
|
|
// The usual case is 1 repeated parameter, we don't need to
|
|
|
|
// calculate that on each call.
|
|
|
|
sal_uInt16 nParam = (nRepeat > 1 ?
|
|
|
|
(pData[eOp].nMinParams -
|
|
|
|
((nParameter - pData[eOp].nMinParams) % nRepeat)) :
|
|
|
|
pData[eOp].nMinParams);
|
|
|
|
return pData[eOp].aData.nParam[nParam];
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
|
|
|
else
|
2012-12-15 00:06:28 +01:00
|
|
|
eType = Bounds;
|
|
|
|
return eType == Unknown ? Value : eType;
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
|
|
|
return Unknown;
|
|
|
|
}
|
|
|
|
|
|
|
|
ScParameterClassification::Type
|
CWS-TOOLING: integrate CWS frmdlg
2008-12-18 09:13:09 +0100 oj r265667 : merge from odff05
2008-12-18 07:58:16 +0100 oj r265658 : #i94555# patch from <regina>, ODFF:
Add GAMMA, CHISQDIST, CHISQINV.
Make the 'cumulative' parameter of GAMMADIST optional.
Adapt the domain of CHIDIST to allow negative x.
Remove the constraint "degrees of freedom < 1.0E5" from CHIDIST and CHIINV.
Plus a mechanism to write the now optional parameter of GAMMADIST to PODF and
ODFF if omitted, for backwards compatibility.
2008-12-15 14:06:11 +0100 oj r265490 : CWS-TOOLING: rebase CWS frmdlg to trunk@264807 (milestone: DEV300:m37)
2008-12-15 13:55:28 +0100 oj r265488 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:55:07 +0100 oj r265487 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:48 +0100 oj r265486 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:36 +0100 oj r265485 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:24 +0100 oj r265484 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:48:11 +0100 oj r265483 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:31:12 +0100 oj r265479 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:13:58 +0100 oj r265477 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:10:09 +0100 oj r265476 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:05:11 +0100 oj r265475 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:47:17 +0100 oj r265467 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:46:19 +0100 oj r265466 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:45:47 +0100 oj r265465 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 07:35:07 +0100 oj r265458 : add dependency to formula
2008-12-15 07:34:24 +0100 oj r265457 : add dependency to formula
2008-12-12 13:22:00 +0100 msc r265413 : #i97089#
2008-12-12 13:20:25 +0100 msc r265412 : #i97089#
2008-12-12 12:35:12 +0100 msc r265406 : #i97089#
2008-12-12 12:34:16 +0100 msc r265405 : #i97089#
2008-12-12 12:33:05 +0100 msc r265404 : #i97089#
2008-12-12 12:31:11 +0100 msc r265403 : #i97089#
2008-12-08 11:59:10 +0100 oj r264981 : insert RTL_LOG
2008-12-08 11:50:17 +0100 oj r264980 : some small changes
2008-12-05 12:57:57 +0100 oj r264902 : eof changed
2008-12-05 12:56:46 +0100 oj r264901 : eof changed
2008-12-05 12:28:47 +0100 oj r264899 : wrong var used
2008-12-05 10:08:57 +0100 oj r264890 : token order reversed
2008-12-04 13:49:22 +0100 oc r264843 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:45:27 +0100 oc r264842 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:42:54 +0100 oc r264841 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:37:41 +0100 oc r264840 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:34:11 +0100 oc r264839 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 12:35:31 +0100 oj r264835 : new help ids for struct and function tabpage
2008-12-04 12:00:35 +0100 oj r264828 : set explicit help id
2008-12-03 14:53:27 +0100 oj r264786 : #i96845# change ref button
2008-12-03 14:51:49 +0100 oj r264785 : #i96845# change ref button
2008-12-03 08:51:57 +0100 oj r264746 : convert dos to unix lineends
2008-12-03 08:50:45 +0100 oj r264745 : convert dos to unix lineends
2008-12-03 08:50:05 +0100 oj r264744 : convert dos to unix lineends
2008-12-02 12:28:33 +0100 oj r264686 : clear help text when new helpid is set
2008-12-02 12:28:02 +0100 oj r264685 : set help id for listbox category
2008-12-02 07:15:56 +0100 oj r264655 : remove define to auto generate help ids
2008-12-01 14:36:43 +0100 oj r264604 : use temp var
2008-12-01 14:18:31 +0100 oj r264601 : moved ScJumpToken to formula
2008-12-01 14:18:11 +0100 oj r264600 : moved ScJumpToken to formula
2008-12-01 14:14:35 +0100 oj r264599 : moved ScJumpToken from sc
2008-12-01 10:48:51 +0100 oj r264589 : change quickhelptext from Shrink to Select
2008-12-01 10:28:41 +0100 oj r264588 : fix opcode data, has to be Any.Void
2008-11-28 11:16:48 +0100 oj r264532 : add help ids
2008-11-28 10:16:56 +0100 oj r264529 : set help id
2008-11-28 10:16:43 +0100 oj r264528 : set help id
2008-11-26 13:55:04 +0100 oj r264381 : #94535# use of optional instead of deleting a string myself and some small changes
2008-11-26 09:53:20 +0100 oj r264346 : compile error with debug/without debug
2008-11-25 07:41:28 +0100 oj r264271 : put static into the method which make use of them
2008-11-24 08:16:07 +0100 oj r264196 : removed not needed classes for op code
2008-11-24 08:13:44 +0100 oj r264195 : removed not needed classes for op code
2008-11-21 14:05:53 +0100 oj r264135 : make GetOpCode inline
2008-11-21 12:35:27 +0100 oj r264124 : hold symbols
2008-11-20 09:27:27 +0100 oj r264028 : merged code from DEV300_m35 which got lost
2008-11-19 20:42:12 +0100 oj r264022 : more changes for formula dialog remove
2008-11-19 20:37:41 +0100 oj r264021 : removed unused var
2008-11-19 20:35:35 +0100 oj r264020 : some more changes at token
2008-11-19 10:59:47 +0100 oj r263967 : deleted
2008-11-19 10:58:24 +0100 oj r263966 : add forui and for res files
2008-11-18 15:27:36 +0100 oj r263777 : unused para removed
2008-11-18 15:23:23 +0100 oj r263775 : add insert button to add field dlg
2008-11-18 13:39:53 +0100 oj r263764 : enable the formula dialog as well for conditional print as for conditional formatting
2008-11-18 12:03:25 +0100 oj r263760 : rename isRef in IsRef
2008-11-17 11:46:16 +0100 oj r263711 : patches for function handling
2008-11-17 11:36:22 +0100 oj r263710 : add new for forui and res file
2008-11-17 09:21:12 +0100 oj r263704 : patches for some resource for libformula
2008-11-15 12:45:30 +0100 oj r263701 : changes for formula editor extraction
2008-11-07 08:23:27 +0100 oj r263416 : merge from DEV300:m35
2008-11-07 08:22:35 +0100 oj r263415 : merge from DEV300:m35
2008-11-07 08:22:16 +0100 oj r263414 : merge from DEV300:m35
2008-11-07 08:21:41 +0100 oj r263413 : merge from DEV300:m35
2008-11-07 08:21:31 +0100 oj r263412 : merge from DEV300:m35
2008-11-07 08:20:38 +0100 oj r263411 : merge from DEV300:m35
2008-11-07 08:20:00 +0100 oj r263410 : merge from DEV300:m35
2008-11-07 08:18:50 +0100 oj r263409 : merge from DEV300:m35
2008-11-07 08:18:19 +0100 oj r263408 : merge from DEV300:m35
2008-11-07 08:10:27 +0100 oj r263407 : merge from DEV300:m35
2008-10-21 07:43:46 +0200 oj r262560 : some compile errors resolved
2008-10-17 16:40:01 +0200 oj r262291 : dep for 1st target
2008-10-07 10:08:39 +0200 oj r262077 : copy
2008-10-07 09:45:31 +0200 oj r262076 : #i94535#
2008-10-07 09:44:26 +0200 oj r262075 : #i94535# new base class
2008-10-07 09:43:21 +0200 oj r262074 : moved to formula
2008-10-07 09:41:51 +0200 oj r262073 : new images
2008-10-07 09:03:01 +0200 oj r262072 : new ids for formula
2008-10-02 08:46:27 +0200 oj r262024 : #i94535# move the formula compiler to formula
2008-10-02 08:08:54 +0200 oj r262023 : #i94535#
2008-10-02 08:06:28 +0200 oj r262022 : #i94535#
2008-10-02 08:05:52 +0200 oj r262021 : #i94535#
2008-10-01 17:15:29 +0200 oj r262014 : #i94535#
2008-10-01 17:12:40 +0200 oj r262013 : new module formula
2008-10-01 17:04:55 +0200 oj r262012 : #i94535#
2008-10-01 16:49:03 +0200 oj r262010 : #i94535#
2008-10-01 16:46:59 +0200 oj r262009 : #i94535#
2009-01-08 10:47:13 +00:00
|
|
|
ScParameterClassification::GetExternalParameterType( const formula::FormulaToken* pToken,
|
2011-01-17 13:20:22 +01:00
|
|
|
sal_uInt16 nParameter)
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
|
|
|
Type eRet = Unknown;
|
|
|
|
// similar to ScInterpreter::ScExternal()
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aFuncName = ScGlobal::pCharClass->uppercase( pToken->GetExternal());
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
2015-08-12 12:50:11 +02:00
|
|
|
const LegacyFuncData* pLegacyFuncData = ScGlobal::GetLegacyFuncCollection()->findByName(aFuncName);
|
|
|
|
if (pLegacyFuncData)
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
2015-08-12 12:50:11 +02:00
|
|
|
if ( nParameter >= pLegacyFuncData->GetParamCount() )
|
2012-02-06 21:22:29 -05:00
|
|
|
eRet = Bounds;
|
|
|
|
else
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
2015-08-12 12:50:11 +02:00
|
|
|
switch ( pLegacyFuncData->GetParamType( nParameter) )
|
2012-02-06 21:22:29 -05:00
|
|
|
{
|
2014-10-08 10:00:07 +02:00
|
|
|
case ParamType::PTR_DOUBLE:
|
|
|
|
case ParamType::PTR_STRING:
|
2012-02-06 21:22:29 -05:00
|
|
|
eRet = Value;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
eRet = Reference;
|
|
|
|
// also array types are created using an area reference
|
|
|
|
}
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
2012-02-06 21:22:29 -05:00
|
|
|
return eRet;
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
|
|
|
}
|
2012-02-06 21:22:29 -05:00
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString aUnoName =
|
2012-02-06 21:22:29 -05:00
|
|
|
ScGlobal::GetAddInCollection()->FindFunction(aFuncName, false);
|
|
|
|
|
|
|
|
if (!aUnoName.isEmpty())
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
|
|
|
// the relevant parts of ScUnoAddInCall without having to create one
|
|
|
|
const ScUnoAddInFuncData* pFuncData =
|
2006-08-04 11:12:30 +00:00
|
|
|
ScGlobal::GetAddInCollection()->GetFuncData( aUnoName, true ); // need fully initialized data
|
2004-03-08 10:49:13 +00:00
|
|
|
if ( pFuncData )
|
|
|
|
{
|
|
|
|
long nCount = pFuncData->GetArgumentCount();
|
|
|
|
if ( nCount <= 0 )
|
|
|
|
eRet = Bounds;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
const ScAddInArgDesc* pArgs = pFuncData->GetArguments();
|
|
|
|
if ( nParameter >= nCount &&
|
|
|
|
pArgs[nCount-1].eType == SC_ADDINARG_VARARGS )
|
|
|
|
eRet = Value;
|
|
|
|
// last arg is sequence, optional "any"s, we simply can't
|
|
|
|
// determine the type
|
|
|
|
if ( eRet == Unknown )
|
|
|
|
{
|
|
|
|
if ( nParameter >= nCount )
|
|
|
|
eRet = Bounds;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch ( pArgs[nParameter].eType )
|
|
|
|
{
|
|
|
|
case SC_ADDINARG_INTEGER:
|
|
|
|
case SC_ADDINARG_DOUBLE:
|
|
|
|
case SC_ADDINARG_STRING:
|
|
|
|
eRet = Value;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
eRet = Reference;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return eRet;
|
|
|
|
}
|
|
|
|
|
2016-03-05 00:23:12 +05:30
|
|
|
#if DEBUG_SC_PARCLASSDOC
|
2004-03-08 10:49:13 +00:00
|
|
|
|
|
|
|
// add remaining functions, all Value parameters
|
|
|
|
void ScParameterClassification::MergeArgumentsFromFunctionResource()
|
|
|
|
{
|
|
|
|
ScFunctionList* pFuncList = ScGlobal::GetStarCalcFunctionList();
|
|
|
|
for ( const ScFuncDesc* pDesc = pFuncList->First(); pDesc;
|
|
|
|
pDesc = pFuncList->Next() )
|
|
|
|
{
|
|
|
|
if ( pDesc->nFIndex > SC_OPCODE_LAST_OPCODE_ID ||
|
|
|
|
pData[pDesc->nFIndex].aData.nParam[0] != Unknown )
|
|
|
|
continue; // not an internal opcode or already done
|
|
|
|
|
|
|
|
RunData* pRun = &pData[ pDesc->nFIndex ];
|
2011-08-29 15:50:44 +01:00
|
|
|
sal_uInt16 nArgs = pDesc->GetSuppressedArgCount();
|
2012-12-14 23:40:18 +01:00
|
|
|
if ( nArgs >= PAIRED_VAR_ARGS )
|
|
|
|
{
|
|
|
|
nArgs -= PAIRED_VAR_ARGS - 2;
|
2012-12-15 00:06:28 +01:00
|
|
|
pRun->aData.nRepeatLast = 2;
|
2012-12-14 23:40:18 +01:00
|
|
|
}
|
|
|
|
else if ( nArgs >= VAR_ARGS )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
|
|
|
nArgs -= VAR_ARGS - 1;
|
2012-12-15 00:06:28 +01:00
|
|
|
pRun->aData.nRepeatLast = 1;
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
|
|
|
if ( nArgs > CommonData::nMaxParams )
|
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
OStringBuffer aBuf;
|
2011-01-16 17:45:09 +01:00
|
|
|
aBuf.append("ScParameterClassification::Init: too many arguments in listed function: ");
|
2013-04-07 12:06:47 +02:00
|
|
|
aBuf.append(OUStringToOString(*(pDesc->pFuncName), RTL_TEXTENCODING_UTF8));
|
2011-01-16 17:45:09 +01:00
|
|
|
aBuf.append(": ");
|
2011-11-04 16:06:26 +01:00
|
|
|
aBuf.append(sal_Int32(nArgs));
|
2011-03-12 11:28:41 +01:00
|
|
|
OSL_FAIL( aBuf.getStr());
|
2012-12-15 00:06:28 +01:00
|
|
|
nArgs = CommonData::nMaxParams - 1;
|
|
|
|
pRun->aData.nRepeatLast = 1;
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
2011-01-17 13:20:22 +01:00
|
|
|
pRun->nMinParams = static_cast< sal_uInt8 >( nArgs );
|
2011-09-01 16:18:52 +01:00
|
|
|
for ( sal_Int32 j=0; j < nArgs; ++j )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
|
|
|
pRun->aData.nParam[j] = Value;
|
|
|
|
}
|
2012-12-15 00:06:28 +01:00
|
|
|
if ( pRun->aData.nRepeatLast )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
2011-09-01 16:18:52 +01:00
|
|
|
for ( sal_Int32 j = nArgs; j < CommonData::nMaxParams; ++j )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
|
|
|
pRun->aData.nParam[j] = Value;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-09-01 16:18:52 +01:00
|
|
|
for ( sal_Int32 j = nArgs; j < CommonData::nMaxParams; ++j )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
|
|
|
pRun->aData.nParam[j] = Bounds;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScParameterClassification::GenerateDocumentation()
|
|
|
|
{
|
|
|
|
static const sal_Char aEnvVarName[] = "OOO_CALC_GENPARCLASSDOC";
|
|
|
|
if ( !getenv( aEnvVarName) )
|
|
|
|
return;
|
|
|
|
MergeArgumentsFromFunctionResource();
|
CWS-TOOLING: integrate CWS frmdlg
2008-12-18 09:13:09 +0100 oj r265667 : merge from odff05
2008-12-18 07:58:16 +0100 oj r265658 : #i94555# patch from <regina>, ODFF:
Add GAMMA, CHISQDIST, CHISQINV.
Make the 'cumulative' parameter of GAMMADIST optional.
Adapt the domain of CHIDIST to allow negative x.
Remove the constraint "degrees of freedom < 1.0E5" from CHIDIST and CHIINV.
Plus a mechanism to write the now optional parameter of GAMMADIST to PODF and
ODFF if omitted, for backwards compatibility.
2008-12-15 14:06:11 +0100 oj r265490 : CWS-TOOLING: rebase CWS frmdlg to trunk@264807 (milestone: DEV300:m37)
2008-12-15 13:55:28 +0100 oj r265488 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:55:07 +0100 oj r265487 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:48 +0100 oj r265486 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:36 +0100 oj r265485 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:24 +0100 oj r265484 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:48:11 +0100 oj r265483 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:31:12 +0100 oj r265479 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:13:58 +0100 oj r265477 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:10:09 +0100 oj r265476 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:05:11 +0100 oj r265475 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:47:17 +0100 oj r265467 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:46:19 +0100 oj r265466 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:45:47 +0100 oj r265465 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 07:35:07 +0100 oj r265458 : add dependency to formula
2008-12-15 07:34:24 +0100 oj r265457 : add dependency to formula
2008-12-12 13:22:00 +0100 msc r265413 : #i97089#
2008-12-12 13:20:25 +0100 msc r265412 : #i97089#
2008-12-12 12:35:12 +0100 msc r265406 : #i97089#
2008-12-12 12:34:16 +0100 msc r265405 : #i97089#
2008-12-12 12:33:05 +0100 msc r265404 : #i97089#
2008-12-12 12:31:11 +0100 msc r265403 : #i97089#
2008-12-08 11:59:10 +0100 oj r264981 : insert RTL_LOG
2008-12-08 11:50:17 +0100 oj r264980 : some small changes
2008-12-05 12:57:57 +0100 oj r264902 : eof changed
2008-12-05 12:56:46 +0100 oj r264901 : eof changed
2008-12-05 12:28:47 +0100 oj r264899 : wrong var used
2008-12-05 10:08:57 +0100 oj r264890 : token order reversed
2008-12-04 13:49:22 +0100 oc r264843 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:45:27 +0100 oc r264842 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:42:54 +0100 oc r264841 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:37:41 +0100 oc r264840 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:34:11 +0100 oc r264839 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 12:35:31 +0100 oj r264835 : new help ids for struct and function tabpage
2008-12-04 12:00:35 +0100 oj r264828 : set explicit help id
2008-12-03 14:53:27 +0100 oj r264786 : #i96845# change ref button
2008-12-03 14:51:49 +0100 oj r264785 : #i96845# change ref button
2008-12-03 08:51:57 +0100 oj r264746 : convert dos to unix lineends
2008-12-03 08:50:45 +0100 oj r264745 : convert dos to unix lineends
2008-12-03 08:50:05 +0100 oj r264744 : convert dos to unix lineends
2008-12-02 12:28:33 +0100 oj r264686 : clear help text when new helpid is set
2008-12-02 12:28:02 +0100 oj r264685 : set help id for listbox category
2008-12-02 07:15:56 +0100 oj r264655 : remove define to auto generate help ids
2008-12-01 14:36:43 +0100 oj r264604 : use temp var
2008-12-01 14:18:31 +0100 oj r264601 : moved ScJumpToken to formula
2008-12-01 14:18:11 +0100 oj r264600 : moved ScJumpToken to formula
2008-12-01 14:14:35 +0100 oj r264599 : moved ScJumpToken from sc
2008-12-01 10:48:51 +0100 oj r264589 : change quickhelptext from Shrink to Select
2008-12-01 10:28:41 +0100 oj r264588 : fix opcode data, has to be Any.Void
2008-11-28 11:16:48 +0100 oj r264532 : add help ids
2008-11-28 10:16:56 +0100 oj r264529 : set help id
2008-11-28 10:16:43 +0100 oj r264528 : set help id
2008-11-26 13:55:04 +0100 oj r264381 : #94535# use of optional instead of deleting a string myself and some small changes
2008-11-26 09:53:20 +0100 oj r264346 : compile error with debug/without debug
2008-11-25 07:41:28 +0100 oj r264271 : put static into the method which make use of them
2008-11-24 08:16:07 +0100 oj r264196 : removed not needed classes for op code
2008-11-24 08:13:44 +0100 oj r264195 : removed not needed classes for op code
2008-11-21 14:05:53 +0100 oj r264135 : make GetOpCode inline
2008-11-21 12:35:27 +0100 oj r264124 : hold symbols
2008-11-20 09:27:27 +0100 oj r264028 : merged code from DEV300_m35 which got lost
2008-11-19 20:42:12 +0100 oj r264022 : more changes for formula dialog remove
2008-11-19 20:37:41 +0100 oj r264021 : removed unused var
2008-11-19 20:35:35 +0100 oj r264020 : some more changes at token
2008-11-19 10:59:47 +0100 oj r263967 : deleted
2008-11-19 10:58:24 +0100 oj r263966 : add forui and for res files
2008-11-18 15:27:36 +0100 oj r263777 : unused para removed
2008-11-18 15:23:23 +0100 oj r263775 : add insert button to add field dlg
2008-11-18 13:39:53 +0100 oj r263764 : enable the formula dialog as well for conditional print as for conditional formatting
2008-11-18 12:03:25 +0100 oj r263760 : rename isRef in IsRef
2008-11-17 11:46:16 +0100 oj r263711 : patches for function handling
2008-11-17 11:36:22 +0100 oj r263710 : add new for forui and res file
2008-11-17 09:21:12 +0100 oj r263704 : patches for some resource for libformula
2008-11-15 12:45:30 +0100 oj r263701 : changes for formula editor extraction
2008-11-07 08:23:27 +0100 oj r263416 : merge from DEV300:m35
2008-11-07 08:22:35 +0100 oj r263415 : merge from DEV300:m35
2008-11-07 08:22:16 +0100 oj r263414 : merge from DEV300:m35
2008-11-07 08:21:41 +0100 oj r263413 : merge from DEV300:m35
2008-11-07 08:21:31 +0100 oj r263412 : merge from DEV300:m35
2008-11-07 08:20:38 +0100 oj r263411 : merge from DEV300:m35
2008-11-07 08:20:00 +0100 oj r263410 : merge from DEV300:m35
2008-11-07 08:18:50 +0100 oj r263409 : merge from DEV300:m35
2008-11-07 08:18:19 +0100 oj r263408 : merge from DEV300:m35
2008-11-07 08:10:27 +0100 oj r263407 : merge from DEV300:m35
2008-10-21 07:43:46 +0200 oj r262560 : some compile errors resolved
2008-10-17 16:40:01 +0200 oj r262291 : dep for 1st target
2008-10-07 10:08:39 +0200 oj r262077 : copy
2008-10-07 09:45:31 +0200 oj r262076 : #i94535#
2008-10-07 09:44:26 +0200 oj r262075 : #i94535# new base class
2008-10-07 09:43:21 +0200 oj r262074 : moved to formula
2008-10-07 09:41:51 +0200 oj r262073 : new images
2008-10-07 09:03:01 +0200 oj r262072 : new ids for formula
2008-10-02 08:46:27 +0200 oj r262024 : #i94535# move the formula compiler to formula
2008-10-02 08:08:54 +0200 oj r262023 : #i94535#
2008-10-02 08:06:28 +0200 oj r262022 : #i94535#
2008-10-02 08:05:52 +0200 oj r262021 : #i94535#
2008-10-01 17:15:29 +0200 oj r262014 : #i94535#
2008-10-01 17:12:40 +0200 oj r262013 : new module formula
2008-10-01 17:04:55 +0200 oj r262012 : #i94535#
2008-10-01 16:49:03 +0200 oj r262010 : #i94535#
2008-10-01 16:46:59 +0200 oj r262009 : #i94535#
2009-01-08 10:47:13 +00:00
|
|
|
ScAddress aAddress;
|
|
|
|
ScCompiler aComp(NULL,aAddress);
|
2015-10-27 14:20:54 +02:00
|
|
|
ScCompiler::OpCodeMapPtr xMap( aComp.GetOpCodeMap(css::sheet::FormulaLanguage::ENGLISH));
|
2008-01-10 12:14:16 +00:00
|
|
|
if (!xMap)
|
|
|
|
return;
|
2004-03-08 10:49:13 +00:00
|
|
|
fflush( stderr);
|
2008-01-10 12:14:16 +00:00
|
|
|
size_t nCount = xMap->getSymbolCount();
|
|
|
|
for ( size_t i=0; i<nCount; ++i )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
2008-01-10 12:14:16 +00:00
|
|
|
OpCode eOp = OpCode(i);
|
2013-09-19 10:01:31 +01:00
|
|
|
if ( !xMap->getSymbol(eOp).isEmpty() )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
2015-05-23 17:31:22 +02:00
|
|
|
SAL_INFO("sc.core", "GenerateDocumentation, env var name: " << aEnvVarName);
|
2013-04-07 12:06:47 +02:00
|
|
|
OStringBuffer aStr(OUStringToOString(xMap->getSymbol(eOp), RTL_TEXTENCODING_UTF8));
|
2011-12-23 22:48:59 +00:00
|
|
|
aStr.append('(');
|
CWS-TOOLING: integrate CWS frmdlg
2008-12-18 09:13:09 +0100 oj r265667 : merge from odff05
2008-12-18 07:58:16 +0100 oj r265658 : #i94555# patch from <regina>, ODFF:
Add GAMMA, CHISQDIST, CHISQINV.
Make the 'cumulative' parameter of GAMMADIST optional.
Adapt the domain of CHIDIST to allow negative x.
Remove the constraint "degrees of freedom < 1.0E5" from CHIDIST and CHIINV.
Plus a mechanism to write the now optional parameter of GAMMADIST to PODF and
ODFF if omitted, for backwards compatibility.
2008-12-15 14:06:11 +0100 oj r265490 : CWS-TOOLING: rebase CWS frmdlg to trunk@264807 (milestone: DEV300:m37)
2008-12-15 13:55:28 +0100 oj r265488 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:55:07 +0100 oj r265487 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:48 +0100 oj r265486 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:36 +0100 oj r265485 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:24 +0100 oj r265484 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:48:11 +0100 oj r265483 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:31:12 +0100 oj r265479 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:13:58 +0100 oj r265477 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:10:09 +0100 oj r265476 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:05:11 +0100 oj r265475 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:47:17 +0100 oj r265467 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:46:19 +0100 oj r265466 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:45:47 +0100 oj r265465 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 07:35:07 +0100 oj r265458 : add dependency to formula
2008-12-15 07:34:24 +0100 oj r265457 : add dependency to formula
2008-12-12 13:22:00 +0100 msc r265413 : #i97089#
2008-12-12 13:20:25 +0100 msc r265412 : #i97089#
2008-12-12 12:35:12 +0100 msc r265406 : #i97089#
2008-12-12 12:34:16 +0100 msc r265405 : #i97089#
2008-12-12 12:33:05 +0100 msc r265404 : #i97089#
2008-12-12 12:31:11 +0100 msc r265403 : #i97089#
2008-12-08 11:59:10 +0100 oj r264981 : insert RTL_LOG
2008-12-08 11:50:17 +0100 oj r264980 : some small changes
2008-12-05 12:57:57 +0100 oj r264902 : eof changed
2008-12-05 12:56:46 +0100 oj r264901 : eof changed
2008-12-05 12:28:47 +0100 oj r264899 : wrong var used
2008-12-05 10:08:57 +0100 oj r264890 : token order reversed
2008-12-04 13:49:22 +0100 oc r264843 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:45:27 +0100 oc r264842 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:42:54 +0100 oc r264841 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:37:41 +0100 oc r264840 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:34:11 +0100 oc r264839 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 12:35:31 +0100 oj r264835 : new help ids for struct and function tabpage
2008-12-04 12:00:35 +0100 oj r264828 : set explicit help id
2008-12-03 14:53:27 +0100 oj r264786 : #i96845# change ref button
2008-12-03 14:51:49 +0100 oj r264785 : #i96845# change ref button
2008-12-03 08:51:57 +0100 oj r264746 : convert dos to unix lineends
2008-12-03 08:50:45 +0100 oj r264745 : convert dos to unix lineends
2008-12-03 08:50:05 +0100 oj r264744 : convert dos to unix lineends
2008-12-02 12:28:33 +0100 oj r264686 : clear help text when new helpid is set
2008-12-02 12:28:02 +0100 oj r264685 : set help id for listbox category
2008-12-02 07:15:56 +0100 oj r264655 : remove define to auto generate help ids
2008-12-01 14:36:43 +0100 oj r264604 : use temp var
2008-12-01 14:18:31 +0100 oj r264601 : moved ScJumpToken to formula
2008-12-01 14:18:11 +0100 oj r264600 : moved ScJumpToken to formula
2008-12-01 14:14:35 +0100 oj r264599 : moved ScJumpToken from sc
2008-12-01 10:48:51 +0100 oj r264589 : change quickhelptext from Shrink to Select
2008-12-01 10:28:41 +0100 oj r264588 : fix opcode data, has to be Any.Void
2008-11-28 11:16:48 +0100 oj r264532 : add help ids
2008-11-28 10:16:56 +0100 oj r264529 : set help id
2008-11-28 10:16:43 +0100 oj r264528 : set help id
2008-11-26 13:55:04 +0100 oj r264381 : #94535# use of optional instead of deleting a string myself and some small changes
2008-11-26 09:53:20 +0100 oj r264346 : compile error with debug/without debug
2008-11-25 07:41:28 +0100 oj r264271 : put static into the method which make use of them
2008-11-24 08:16:07 +0100 oj r264196 : removed not needed classes for op code
2008-11-24 08:13:44 +0100 oj r264195 : removed not needed classes for op code
2008-11-21 14:05:53 +0100 oj r264135 : make GetOpCode inline
2008-11-21 12:35:27 +0100 oj r264124 : hold symbols
2008-11-20 09:27:27 +0100 oj r264028 : merged code from DEV300_m35 which got lost
2008-11-19 20:42:12 +0100 oj r264022 : more changes for formula dialog remove
2008-11-19 20:37:41 +0100 oj r264021 : removed unused var
2008-11-19 20:35:35 +0100 oj r264020 : some more changes at token
2008-11-19 10:59:47 +0100 oj r263967 : deleted
2008-11-19 10:58:24 +0100 oj r263966 : add forui and for res files
2008-11-18 15:27:36 +0100 oj r263777 : unused para removed
2008-11-18 15:23:23 +0100 oj r263775 : add insert button to add field dlg
2008-11-18 13:39:53 +0100 oj r263764 : enable the formula dialog as well for conditional print as for conditional formatting
2008-11-18 12:03:25 +0100 oj r263760 : rename isRef in IsRef
2008-11-17 11:46:16 +0100 oj r263711 : patches for function handling
2008-11-17 11:36:22 +0100 oj r263710 : add new for forui and res file
2008-11-17 09:21:12 +0100 oj r263704 : patches for some resource for libformula
2008-11-15 12:45:30 +0100 oj r263701 : changes for formula editor extraction
2008-11-07 08:23:27 +0100 oj r263416 : merge from DEV300:m35
2008-11-07 08:22:35 +0100 oj r263415 : merge from DEV300:m35
2008-11-07 08:22:16 +0100 oj r263414 : merge from DEV300:m35
2008-11-07 08:21:41 +0100 oj r263413 : merge from DEV300:m35
2008-11-07 08:21:31 +0100 oj r263412 : merge from DEV300:m35
2008-11-07 08:20:38 +0100 oj r263411 : merge from DEV300:m35
2008-11-07 08:20:00 +0100 oj r263410 : merge from DEV300:m35
2008-11-07 08:18:50 +0100 oj r263409 : merge from DEV300:m35
2008-11-07 08:18:19 +0100 oj r263408 : merge from DEV300:m35
2008-11-07 08:10:27 +0100 oj r263407 : merge from DEV300:m35
2008-10-21 07:43:46 +0200 oj r262560 : some compile errors resolved
2008-10-17 16:40:01 +0200 oj r262291 : dep for 1st target
2008-10-07 10:08:39 +0200 oj r262077 : copy
2008-10-07 09:45:31 +0200 oj r262076 : #i94535#
2008-10-07 09:44:26 +0200 oj r262075 : #i94535# new base class
2008-10-07 09:43:21 +0200 oj r262074 : moved to formula
2008-10-07 09:41:51 +0200 oj r262073 : new images
2008-10-07 09:03:01 +0200 oj r262072 : new ids for formula
2008-10-02 08:46:27 +0200 oj r262024 : #i94535# move the formula compiler to formula
2008-10-02 08:08:54 +0200 oj r262023 : #i94535#
2008-10-02 08:06:28 +0200 oj r262022 : #i94535#
2008-10-02 08:05:52 +0200 oj r262021 : #i94535#
2008-10-01 17:15:29 +0200 oj r262014 : #i94535#
2008-10-01 17:12:40 +0200 oj r262013 : new module formula
2008-10-01 17:04:55 +0200 oj r262012 : #i94535#
2008-10-01 16:49:03 +0200 oj r262010 : #i94535#
2008-10-01 16:46:59 +0200 oj r262009 : #i94535#
2009-01-08 10:47:13 +00:00
|
|
|
formula::FormulaByteToken aToken( eOp);
|
2011-01-17 13:20:22 +01:00
|
|
|
sal_uInt8 nParams = GetMinimumParameters( eOp);
|
2004-03-08 10:49:13 +00:00
|
|
|
// preset parameter count according to opcode value, with some
|
|
|
|
// special handling
|
2008-03-07 10:17:33 +00:00
|
|
|
if ( eOp < SC_OPCODE_STOP_DIV )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
|
|
|
switch ( eOp )
|
|
|
|
{
|
|
|
|
case ocIf:
|
|
|
|
aToken.SetByte(3);
|
|
|
|
break;
|
2013-01-07 15:34:32 +01:00
|
|
|
case ocIfError:
|
|
|
|
case ocIfNA:
|
2015-01-12 19:56:39 +01:00
|
|
|
case ocChoose:
|
2004-03-08 10:49:13 +00:00
|
|
|
aToken.SetByte(2);
|
|
|
|
break;
|
|
|
|
case ocPercentSign:
|
|
|
|
aToken.SetByte(1);
|
|
|
|
break;
|
2007-04-26 06:39:05 +00:00
|
|
|
default:;
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
|
|
|
}
|
2008-03-07 10:17:33 +00:00
|
|
|
else if ( eOp < SC_OPCODE_STOP_ERRORS )
|
|
|
|
aToken.SetByte(0);
|
|
|
|
else if ( eOp < SC_OPCODE_STOP_BIN_OP )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
|
|
|
switch ( eOp )
|
|
|
|
{
|
|
|
|
case ocAnd:
|
|
|
|
case ocOr:
|
|
|
|
aToken.SetByte(1); // (r1)AND(r2) --> AND( r1, ...)
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
aToken.SetByte(2);
|
|
|
|
}
|
|
|
|
}
|
2008-03-07 10:17:33 +00:00
|
|
|
else if ( eOp < SC_OPCODE_STOP_UN_OP )
|
2004-03-08 10:49:13 +00:00
|
|
|
aToken.SetByte(1);
|
2008-03-07 10:17:33 +00:00
|
|
|
else if ( eOp < SC_OPCODE_STOP_NO_PAR )
|
2004-03-08 10:49:13 +00:00
|
|
|
aToken.SetByte(0);
|
2008-03-07 10:17:33 +00:00
|
|
|
else if ( eOp < SC_OPCODE_STOP_1_PAR )
|
2004-03-08 10:49:13 +00:00
|
|
|
aToken.SetByte(1);
|
|
|
|
else
|
|
|
|
aToken.SetByte( nParams);
|
|
|
|
// compare (this is a mere test for opcode order Div, BinOp, UnOp,
|
|
|
|
// NoPar, 1Par, ...) and override parameter count with
|
|
|
|
// classification
|
|
|
|
if ( nParams != aToken.GetByte() )
|
2015-05-21 22:49:50 +02:00
|
|
|
SAL_WARN("sc.core", "(parameter count differs, token Byte: " << aToken.GetByte() << " classification: " << nParams << ") ");
|
2004-03-08 10:49:13 +00:00
|
|
|
aToken.SetByte( nParams);
|
|
|
|
if ( nParams != aToken.GetParamCount() )
|
2015-05-21 22:49:50 +02:00
|
|
|
SAL_WARN("sc.core", "(parameter count differs, token ParamCount: " << aToken.GetParamCount() << " classification: " << nParams << ") ");
|
2011-01-17 13:20:22 +01:00
|
|
|
for ( sal_uInt16 j=0; j < nParams; ++j )
|
2004-03-08 10:49:13 +00:00
|
|
|
{
|
|
|
|
if ( j > 0 )
|
2011-12-23 22:48:59 +00:00
|
|
|
aStr.append(',');
|
2004-03-08 10:49:13 +00:00
|
|
|
Type eType = GetParameterType( &aToken, j);
|
|
|
|
switch ( eType )
|
|
|
|
{
|
|
|
|
case Value :
|
2011-12-27 03:37:37 +01:00
|
|
|
aStr.append(" Value");
|
2004-03-08 10:49:13 +00:00
|
|
|
break;
|
|
|
|
case Reference :
|
2011-12-27 03:37:37 +01:00
|
|
|
aStr.append(" Reference");
|
2004-03-08 10:49:13 +00:00
|
|
|
break;
|
|
|
|
case Array :
|
2011-12-27 03:37:37 +01:00
|
|
|
aStr.append(" Array");
|
2004-03-08 10:49:13 +00:00
|
|
|
break;
|
|
|
|
case ForceArray :
|
2011-12-27 03:37:37 +01:00
|
|
|
aStr.append(" ForceArray");
|
2004-03-08 10:49:13 +00:00
|
|
|
break;
|
2009-09-11 18:55:06 +00:00
|
|
|
case ReferenceOrForceArray :
|
2011-12-27 03:37:37 +01:00
|
|
|
aStr.append(" ReferenceOrForceArray");
|
2009-09-11 18:55:06 +00:00
|
|
|
break;
|
2004-03-08 10:49:13 +00:00
|
|
|
case Bounds :
|
2011-12-27 03:37:37 +01:00
|
|
|
aStr.append(" (Bounds, classification error?)");
|
2004-03-08 10:49:13 +00:00
|
|
|
break;
|
|
|
|
default:
|
2011-12-27 03:37:37 +01:00
|
|
|
aStr.append(" (???, classification error?)");
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( HasRepeatParameters( eOp) )
|
2011-12-27 03:37:37 +01:00
|
|
|
aStr.append(", ...");
|
2004-03-08 10:49:13 +00:00
|
|
|
if ( nParams )
|
2011-12-23 22:48:59 +00:00
|
|
|
aStr.append(' ');
|
|
|
|
aStr.append(')');
|
2004-03-08 10:49:13 +00:00
|
|
|
switch ( eOp )
|
|
|
|
{
|
2015-01-09 13:43:55 +01:00
|
|
|
case ocRRI:
|
2011-12-27 03:37:37 +01:00
|
|
|
aStr.append(" // RRI in English resource, but ZGZ in English-only section");
|
2004-03-08 10:49:13 +00:00
|
|
|
break;
|
|
|
|
case ocMultiArea:
|
2011-12-27 03:37:37 +01:00
|
|
|
aStr.append(" // e.g. combined first parameter of INDEX() function, not a real function");
|
2004-03-08 10:49:13 +00:00
|
|
|
break;
|
|
|
|
case ocBackSolver:
|
2011-12-27 03:37:37 +01:00
|
|
|
aStr.append(" // goal seek via menu, not a real function");
|
2004-03-08 10:49:13 +00:00
|
|
|
break;
|
|
|
|
case ocTableOp:
|
2011-12-27 03:37:37 +01:00
|
|
|
aStr.append(" // MULTIPLE.OPERATIONS in English resource, but TABLE in English-only section");
|
2004-03-08 10:49:13 +00:00
|
|
|
break;
|
|
|
|
case ocNoName:
|
2011-12-27 03:37:37 +01:00
|
|
|
aStr.append(" // error function, not a real function");
|
2004-03-08 10:49:13 +00:00
|
|
|
break;
|
2007-04-26 06:39:05 +00:00
|
|
|
default:;
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
2015-05-23 17:31:22 +02:00
|
|
|
SAL_INFO( "sc.core", "" << aStr.getStr() << "\n");
|
2004-03-08 10:49:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
fflush( stdout);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // OSL_DEBUG_LEVEL
|
CWS-TOOLING: integrate CWS frmdlg
2008-12-18 09:13:09 +0100 oj r265667 : merge from odff05
2008-12-18 07:58:16 +0100 oj r265658 : #i94555# patch from <regina>, ODFF:
Add GAMMA, CHISQDIST, CHISQINV.
Make the 'cumulative' parameter of GAMMADIST optional.
Adapt the domain of CHIDIST to allow negative x.
Remove the constraint "degrees of freedom < 1.0E5" from CHIDIST and CHIINV.
Plus a mechanism to write the now optional parameter of GAMMADIST to PODF and
ODFF if omitted, for backwards compatibility.
2008-12-15 14:06:11 +0100 oj r265490 : CWS-TOOLING: rebase CWS frmdlg to trunk@264807 (milestone: DEV300:m37)
2008-12-15 13:55:28 +0100 oj r265488 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:55:07 +0100 oj r265487 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:48 +0100 oj r265486 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:36 +0100 oj r265485 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:54:24 +0100 oj r265484 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:48:11 +0100 oj r265483 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:31:12 +0100 oj r265479 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:13:58 +0100 oj r265477 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:10:09 +0100 oj r265476 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 13:05:11 +0100 oj r265475 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:47:17 +0100 oj r265467 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:46:19 +0100 oj r265466 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 10:45:47 +0100 oj r265465 : CWS-TOOLING: do not delete this file, it's needed for 'cws rebase -C'
CWS: frmdlg
New MWS: DEV300
New milestone: m37
2008-12-15 07:35:07 +0100 oj r265458 : add dependency to formula
2008-12-15 07:34:24 +0100 oj r265457 : add dependency to formula
2008-12-12 13:22:00 +0100 msc r265413 : #i97089#
2008-12-12 13:20:25 +0100 msc r265412 : #i97089#
2008-12-12 12:35:12 +0100 msc r265406 : #i97089#
2008-12-12 12:34:16 +0100 msc r265405 : #i97089#
2008-12-12 12:33:05 +0100 msc r265404 : #i97089#
2008-12-12 12:31:11 +0100 msc r265403 : #i97089#
2008-12-08 11:59:10 +0100 oj r264981 : insert RTL_LOG
2008-12-08 11:50:17 +0100 oj r264980 : some small changes
2008-12-05 12:57:57 +0100 oj r264902 : eof changed
2008-12-05 12:56:46 +0100 oj r264901 : eof changed
2008-12-05 12:28:47 +0100 oj r264899 : wrong var used
2008-12-05 10:08:57 +0100 oj r264890 : token order reversed
2008-12-04 13:49:22 +0100 oc r264843 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:45:27 +0100 oc r264842 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:42:54 +0100 oc r264841 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:37:41 +0100 oc r264840 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 13:34:11 +0100 oc r264839 : #i96688: Adapt autotests because of outsourced functionwizard
2008-12-04 12:35:31 +0100 oj r264835 : new help ids for struct and function tabpage
2008-12-04 12:00:35 +0100 oj r264828 : set explicit help id
2008-12-03 14:53:27 +0100 oj r264786 : #i96845# change ref button
2008-12-03 14:51:49 +0100 oj r264785 : #i96845# change ref button
2008-12-03 08:51:57 +0100 oj r264746 : convert dos to unix lineends
2008-12-03 08:50:45 +0100 oj r264745 : convert dos to unix lineends
2008-12-03 08:50:05 +0100 oj r264744 : convert dos to unix lineends
2008-12-02 12:28:33 +0100 oj r264686 : clear help text when new helpid is set
2008-12-02 12:28:02 +0100 oj r264685 : set help id for listbox category
2008-12-02 07:15:56 +0100 oj r264655 : remove define to auto generate help ids
2008-12-01 14:36:43 +0100 oj r264604 : use temp var
2008-12-01 14:18:31 +0100 oj r264601 : moved ScJumpToken to formula
2008-12-01 14:18:11 +0100 oj r264600 : moved ScJumpToken to formula
2008-12-01 14:14:35 +0100 oj r264599 : moved ScJumpToken from sc
2008-12-01 10:48:51 +0100 oj r264589 : change quickhelptext from Shrink to Select
2008-12-01 10:28:41 +0100 oj r264588 : fix opcode data, has to be Any.Void
2008-11-28 11:16:48 +0100 oj r264532 : add help ids
2008-11-28 10:16:56 +0100 oj r264529 : set help id
2008-11-28 10:16:43 +0100 oj r264528 : set help id
2008-11-26 13:55:04 +0100 oj r264381 : #94535# use of optional instead of deleting a string myself and some small changes
2008-11-26 09:53:20 +0100 oj r264346 : compile error with debug/without debug
2008-11-25 07:41:28 +0100 oj r264271 : put static into the method which make use of them
2008-11-24 08:16:07 +0100 oj r264196 : removed not needed classes for op code
2008-11-24 08:13:44 +0100 oj r264195 : removed not needed classes for op code
2008-11-21 14:05:53 +0100 oj r264135 : make GetOpCode inline
2008-11-21 12:35:27 +0100 oj r264124 : hold symbols
2008-11-20 09:27:27 +0100 oj r264028 : merged code from DEV300_m35 which got lost
2008-11-19 20:42:12 +0100 oj r264022 : more changes for formula dialog remove
2008-11-19 20:37:41 +0100 oj r264021 : removed unused var
2008-11-19 20:35:35 +0100 oj r264020 : some more changes at token
2008-11-19 10:59:47 +0100 oj r263967 : deleted
2008-11-19 10:58:24 +0100 oj r263966 : add forui and for res files
2008-11-18 15:27:36 +0100 oj r263777 : unused para removed
2008-11-18 15:23:23 +0100 oj r263775 : add insert button to add field dlg
2008-11-18 13:39:53 +0100 oj r263764 : enable the formula dialog as well for conditional print as for conditional formatting
2008-11-18 12:03:25 +0100 oj r263760 : rename isRef in IsRef
2008-11-17 11:46:16 +0100 oj r263711 : patches for function handling
2008-11-17 11:36:22 +0100 oj r263710 : add new for forui and res file
2008-11-17 09:21:12 +0100 oj r263704 : patches for some resource for libformula
2008-11-15 12:45:30 +0100 oj r263701 : changes for formula editor extraction
2008-11-07 08:23:27 +0100 oj r263416 : merge from DEV300:m35
2008-11-07 08:22:35 +0100 oj r263415 : merge from DEV300:m35
2008-11-07 08:22:16 +0100 oj r263414 : merge from DEV300:m35
2008-11-07 08:21:41 +0100 oj r263413 : merge from DEV300:m35
2008-11-07 08:21:31 +0100 oj r263412 : merge from DEV300:m35
2008-11-07 08:20:38 +0100 oj r263411 : merge from DEV300:m35
2008-11-07 08:20:00 +0100 oj r263410 : merge from DEV300:m35
2008-11-07 08:18:50 +0100 oj r263409 : merge from DEV300:m35
2008-11-07 08:18:19 +0100 oj r263408 : merge from DEV300:m35
2008-11-07 08:10:27 +0100 oj r263407 : merge from DEV300:m35
2008-10-21 07:43:46 +0200 oj r262560 : some compile errors resolved
2008-10-17 16:40:01 +0200 oj r262291 : dep for 1st target
2008-10-07 10:08:39 +0200 oj r262077 : copy
2008-10-07 09:45:31 +0200 oj r262076 : #i94535#
2008-10-07 09:44:26 +0200 oj r262075 : #i94535# new base class
2008-10-07 09:43:21 +0200 oj r262074 : moved to formula
2008-10-07 09:41:51 +0200 oj r262073 : new images
2008-10-07 09:03:01 +0200 oj r262072 : new ids for formula
2008-10-02 08:46:27 +0200 oj r262024 : #i94535# move the formula compiler to formula
2008-10-02 08:08:54 +0200 oj r262023 : #i94535#
2008-10-02 08:06:28 +0200 oj r262022 : #i94535#
2008-10-02 08:05:52 +0200 oj r262021 : #i94535#
2008-10-01 17:15:29 +0200 oj r262014 : #i94535#
2008-10-01 17:12:40 +0200 oj r262013 : new module formula
2008-10-01 17:04:55 +0200 oj r262012 : #i94535#
2008-10-01 16:49:03 +0200 oj r262010 : #i94535#
2008-10-01 16:46:59 +0200 oj r262009 : #i94535#
2009-01-08 10:47:13 +00:00
|
|
|
|
2010-10-12 15:59:00 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|