27#include <document.hxx>
46 SAL_WARN_IF( nCnt > 128,
"sc.filter",
"-LotusToSc::DoFunc(): Too many (128)!" );
53 static constexpr std::string_view s(
"@<<@123>>");
57 sal_Int32
n =
t.indexOf(s);
59 t =
t.copy(
n + s.size());
69 t =
"#UNKNOWN FUNC NAME#";
91 SAL_WARN_IF( nCnt < 2,
"sc.filter",
"+LotusToSc::DoFunc(): ocIndex needs at least 2 parameters!" );
93 eParam[ 0 ] = eParam[ 1 ];
100 SAL_WARN_IF( nCnt != 2,
"sc.filter",
"+LotusToSc::DoFunc(): ocIRR needs 2 parameters!" );
102 eParam[ 0 ] = eParam[ 1 ];
136 "*LotusToSc::DoFunc(): ZINS() needs 3 parameters!" );
138 eParam[ 3 ] = eParam[ 0 ];
139 eParam[ 0 ] = eParam[ 2 ];
147 "*LotusToSc::DoFunc(): TERM() or CTERM() need 3 parameters!" );
149 if ( pExtString == std::string_view(
"TERM") )
153 eParam[ 3 ] = eParam[ 1 ];
161 eParam[ 1 ] = eParam[ 0 ];
163 eParam[ 3 ] = eParam[ 2 ];
174 eParam[ 0 ] = eParam[ 1 ];
175 eParam[ 1 ] = eParam[ 2 ];
193 sal_Int16 nLast = nCnt - 1;
198 SAL_WARN_IF( nCnt != 3,
"sc.filter",
"+LotusToSc::DoFunc(): ocPMT needs 3 parameters!" );
203 aPool << eParam[ 1 ];
217 aPool << eParam[ nLast ];
219 for( nPass = nLast - 1 ; nPass >= 0 ; nPass-- )
331 SAL_WARN(
"sc.filter",
"LotusToSc::ReadSRD short read");
337 rSRD.
SetColRel( ( nRelBit & 0x01 ) != 0 );
338 rSRD.
SetRowRel( ( nRelBit & 0x02 ) != 0 );
339 rSRD.
SetTabRel( ( ( nRelBit & 0x04) != 0 ) || !b3D );
379 rtl_TextEncoding e,
bool b)
394 const char* pExtName =
nullptr;
440 eType = pIndexToType( nOc );
465 DoFunc( eOc, nCnt, pExtName );
489 sal_uInt16 nCol(0), nRow(0);
514 sal_uInt16 nColS(0), nRowS(0), nColE(0), nRowE(0);
580 sal_uInt16 nRngIndex;
581 if( rRangeNameBufferWK3.
FindRel( aTmp, nRngIndex ) )
585 OUString aText =
"NRREF " + aTmp;
593 sal_uInt16 nRngIndex;
594 if( rRangeNameBufferWK3.
FindAbs( aTmp, nRngIndex ) )
598 OUString aText =
"ABSNREF " + aTmp;
622 sal_uInt16 nStrLen(0);
626 if (nStrLen > nMaxEntries)
627 nStrLen = nMaxEntries;
631 std::vector<char>
aBuffer(nStrLen + 1);
667 SAL_WARN(
"sc.filter",
"*LotusToSc::Convert(): unknown enum!" );
1742 static const char* pNames[ 256 ] =
2009 if (rTest ==
"FACT")
2011 else if (rTest ==
"ISEMPTY")
2013 else if (rTest ==
"DEGTORAD")
2015 else if (rTest ==
"RADTODEG")
2017 else if (rTest ==
"SIGN")
2019 else if (rTest ==
"ACOSH")
2021 else if (rTest ==
"ACOTH")
2023 else if (rTest ==
"ASINH")
2025 else if (rTest ==
"ATANH")
2027 else if (rTest ==
"COSH")
2029 else if (rTest ==
"COTH")
2031 else if (rTest ==
"SINH")
2033 else if (rTest ==
"TANH")
2035 else if (rTest ==
"EVEN")
2037 else if (rTest ==
"ODD")
2039 else if (rTest ==
"ACOT")
2041 else if (rTest ==
"COT")
2043 else if (rTest ==
"TRUNC")
2045 else if (rTest ==
"GEOMEAN")
2047 else if (rTest ==
"HARMEAN")
2049 else if (rTest ==
"CORREL")
2051 else if (rTest ==
"MEDIAN")
2053 else if (rTest ==
"COV")
2055 else if (rTest ==
"SKEWNESS")
2057 else if (rTest ==
"CHITEST")
2059 else if (rTest ==
"FTEST")
2061 else if (rTest ==
"AVEDEV")
2063 else if (rTest ==
"PRODUCT")
2065 else if (rTest ==
"PERMUT")
2067 else if (rTest ==
"GAMMALN")
2069 else if (rTest ==
"POISSON")
2071 else if (rTest ==
"NORMAL")
2073 else if (rTest ==
"CRITBINOMIAL")
2075 else if (rTest ==
"TERM")
2077 else if (rTest ==
"CTERM")
2079 else if (rTest ==
"SUMIF")
2081 else if (rTest ==
"COUNTIF")
2083 else if (rTest ==
"DPURECOUNT")
2085 else if (rTest ==
"CSC")
2087 else if (rTest ==
"CSCH")
2089 else if (rTest ==
"LARGE")
2091 else if (rTest ==
"SMALL")
2093 else if (rTest ==
"MODULO")
2095 else if (rTest ==
"ROUNDDOWN")
2097 else if (rTest ==
"ROUNDUP")
2099 else if (rTest ==
"SEC")
2101 else if (rTest ==
"SECH")
void Read(sal_uInt8 &nByte)
void Ignore(const tools::Long nSeekRel)
LR_ID GetIndex(SCCOL nCol, SCROW nRow)
virtual void Convert(std::unique_ptr< ScTokenArray > &rpErg, sal_Int32 &nRest) override
static FUNC_TYPE IndexToTypeWK123(sal_uInt8)
static FUNC_TYPE IndexToType(sal_uInt8)
void NegToken(TokenId &rParam)
void ReadSRD(const ScDocument &rDoc, ScSingleRefData &rSRD, sal_uInt8 nFlags)
void IncToken(TokenId &rParam)
void ReadCRD(const ScDocument &rDoc, ScComplexRefData &rCRD, sal_uInt8 nFlags)
rtl_TextEncoding eSrcChar
void DecToken(TokenId &rParam)
void LotusRelToScRel(sal_uInt16 nCol, sal_uInt16 nRow, ScSingleRefData &rSRD)
void DoFunc(DefTokenId eOc, sal_uInt8 nCnt, const char *pExtName)
static DefTokenId IndexToToken(sal_uInt8)
LotusToSc(LotusContext &rContext, SvStream &aStr, svl::SharedStringPool &rSPool, rtl_TextEncoding eSrc, bool b)
static DefTokenId IndexToTokenWK123(sal_uInt8)
LotusContext & m_rContext
bool FindAbs(std::u16string_view rRef, sal_uInt16 &rIndex)
bool FindRel(const OUString &rRef, sal_uInt16 &rIndex)
ScSheetLimits & GetSheetLimits() const
std::size_t ReadBytes(void *pData, std::size_t nSize)
sal_uInt64 SeekRel(sal_Int64 nPos)
sal_uInt64 remainingSize()
std::unique_ptr< ScTokenArray > GetTokenArray(const ScDocument &rDoc, const TokenId &rId)
bool HasMoreTokens() const
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
OString stripEnd(const OString &rIn, char c)
std::unique_ptr< RangeNameBufferWK3 > pRngNmBffWK3
LotusRangeList maRangeNames
Complex reference (a range) into the sheet.
Single reference (one address) into the sheet.
void SetAbsCol(SCCOL nVal)
void SetAddress(const ScSheetLimits &rLimits, const ScAddress &rAddr, const ScAddress &rPos)
void SetRowRel(bool bVal)
void SetTabRel(bool bVal)
void SetRelRow(SCROW nVal)
void SetRelTab(SCTAB nVal)
void SetAbsRow(SCROW nVal)
void SetRelCol(SCCOL nVal)
void SetFlag3D(bool bVal)
void SetColRel(bool bVal)
const Reference< XComponentContext > & m_rContext
std::unique_ptr< char[]> aBuffer