Calc AddIn - check for empty cell in parameter list (4.4.3.2)

Lars Callenbach lars.callenbach at gmx.de
Sat Jun 27 14:32:05 PDT 2015


In an addin function of calc I would like to test whether a parameter is
provided - and not empty. Uno::Any seems to be the appropriate data type
(hasValue function is provided). Unfortunately the following code always
returns 1 (str.hasValue()==TRUE) even if the cell is empty. How can I
check for empty cells (in order to provide default values)?

Best regards,
   Lars 

-----
// XSomething implementation
OUString MyService2Impl::methodOne( Any const & str )
    throw (RuntimeException)
{
if(str.hasValue()) {
	std::cerr << "1 " << str.hasValue() << std::endl; 
} else {
	std::cerr << "2 " << (str != Any()) << std::endl; 
}
...
-----



More information about the LibreOffice mailing list