22#include <com/sun/star/lang/XMultiServiceFactory.hpp>
23#include <com/sun/star/lang/XComponent.hpp>
24#include <osl/diagnose.h>
69 if( (rTokenData.getLength() >= 6) && (rTokenData[ 0 ] ==
'\'') )
72 sal_Int32 nExclamPos = rTokenData.lastIndexOf(
'!' );
73 if( (1 < nExclamPos) && (nExclamPos + 1 < rTokenData.getLength()) && (rTokenData[ nExclamPos - 1 ] ==
'\'') )
76 sal_Int32 nFileSep = rTokenData.lastIndexOf(
'\\', nExclamPos - 2 );
80 sal_Int32 nDirSep = rTokenData.lastIndexOf(
'\\', nFileSep - 1 );
82 if( (nDirSep > 0) && rTokenData.matchIgnoreAsciiCase(
"\\LIBRARY\\", nDirSep ) )
85 OUString aFuncName = rTokenData.copy( nExclamPos + 1 ).toAsciiUpperCase();
90 OUString aLibName = rTokenData.copy( nFileSep + 1, nExclamPos - nFileSep - 2 );
112 return "com.sun.star.comp.oox.xls.FormulaParser";
122 return {
"com.sun.star.sheet.FilterFormulaParser" };
129 OSL_ENSURE( rArgs.hasElements(),
"OOXMLFormulaParser::initialize - missing arguments" );
130 if( !rArgs.hasElements() )
139 return "http://schemas.microsoft.com/office/excel/formula";
145 const OUString& rFormula,
const CellAddress& rReferencePos )
149 Reference< XMultiServiceFactory > xModelFactory(
mxComponent, UNO_QUERY_THROW );
150 mxParserImpl = std::make_shared<OOXMLFormulaParserImpl>( xModelFactory );
153 ScAddress(rReferencePos.Column, rReferencePos.Row, rReferencePos.Sheet) );
157 const Sequence< FormulaToken >& ,
const CellAddress& )
166extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
168 css::uno::Sequence<css::uno::Any>
const &)
A wrapper around the FormulaParser service provided by the Calc document.
ApiTokenSequence parseFormula(const OUString &rFormula, const ScAddress &rRefPos)
Calls the XFormulaParser::parseFormula() function of the API parser.
static FunctionLibraryType getFuncLibTypeFromLibraryName(std::u16string_view rLibraryName)
Returns the library type associated with the passed URL of a function library (function add-in).
const FunctionInfo * getFuncInfoFromOoxFuncName(const OUString &rFuncName) const
Returns the function info for an OOXML function name, or 0 on error.
Provides access to API op-codes for all available formula tokens and to function info structs for all...
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Represents information for a spreadsheet function.
FunctionLibraryType meFuncLibType
Programmatic function name for external functions.