/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * 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 .
*/ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/table/XCellRange.hpp> #include <com/sun/star/beans/XIntrospectionAccess.hpp> #include <com/sun/star/sheet/XFunctionAccess.hpp> #include <com/sun/star/sheet/XCellRangeAddressable.hpp> #include <ooo/vba/excel/XRange.hpp>
#if 0 // MATCH function should alwayse return a double value, but currently if the first argument is XCellRange, MATCH function returns an array instead of a double value. Don't know why? // To fix this issue in safe, current solution is to convert this array to a double value just for MATCH function.
OUString aUpper( FunctionName.toAsciiUpperCase() );
ScCompiler aCompiler( NULL, ScAddress() );
OpCode eOp = aCompiler.GetEnglishOpCode( aUpper ); if( eOp == ocMatch )
{ double fVal = 0.0; if( aRet >>= fVal ) return aRet;
uno::Sequence< uno::Sequence< uno::Any > > aSequence; if( !( ( aRet >>= aSequence ) && ( aSequence.getLength() > 0 ) &&
( aSequence[0].getLength() > 0 ) && ( aSequence[0][0] >>= fVal ) ) ) throw uno::RuntimeException();
aRet <<= fVal;
} #endif
sal_Bool SAL_CALL
ScVbaWSFunction::hasMethod(const OUString& Name)
{ bool bIsFound = false; try
{ // the function name contained in the com.sun.star.sheet.FunctionDescription service is alwayse localized. // but the function name used in WorksheetFunction is a programmatic name (seems English). // So m_xNameAccess->hasByName( Name ) may fail to find name when a function name has a localized name. if( ScCompiler::IsEnglishSymbol( Name ) )
bIsFound = true;
} catch( uno::Exception& /*e*/ )
{ // failed to find name
} return bIsFound;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.