[api-dev] XCell methods getValue and getError

2009-02-13 Thread Petteri Larjos
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hello,

I am using UNO C++ API and need help with XCell interface (again).

How I can set cell value to empty? I tried xCell-setFormula(OUString())
but xCell-getType() does not return CellContentType_EMPTY after that. Any
ideas?

I also need set cell to '#N/A'. How I can set error codes? I tried to
xCell-setValue(NAN) but it gives '#NUM!'.


Thank you very much!

Regards,
petteri
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkmVhP8ACgkQ3dz7EBdslBKmtQCZAXJcyJOQsGcDhcqr6RlDPp9D
D2gAn07TmhyoPH3g/41K88vL3k7oCr1o
=kw3p
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] XCell methods getValue and getError

2009-02-13 Thread Bernard Marcelly

Message de Petteri Larjos  date 2009-02-13 15:34 :


I am using UNO C++ API and need help with XCell interface (again).

How I can set cell value to empty? I tried xCell-setFormula(OUString())
but xCell-getType() does not return CellContentType_EMPTY after that. Any
ideas?

I also need set cell to '#N/A'. How I can set error codes? I tried to
xCell-setValue(NAN) but it gives '#NUM!'.



Hi,
Answers are in Basic.

' setting cell to empty
myCell.setString()
' setting cell to NA
myCell.setFormula(=NA())

Remark: the subject of your mail has no relation with the question.

Regards
  Bernard


-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] XCell methods getValue and getError

2008-12-18 Thread Oliver Brinzing
Hi Daniel,

please forgive me for asking but i changed the code to:

final CellContentType type = xCell.getType();

if (type == CellContentType.FORMULA)  {
   final Object obj = getPropertyValue(xCell, FormulaResultType);

  [...]
}

my debugger tells me obj is a CellContentType:

objcom.sun.star.table.cellcontentt...@1612600
  m_value 1

AnyConverter.toInt(obj) will fail too ...

Oliver

-- 

GnuPG key 0xCFD04A45: 8822 057F 4956 46D3 352C 1A06 4E2C AB40 CFD0 4A45



signature.asc
Description: OpenPGP digital signature


Re: [api-dev] XCell methods getValue and getError

2008-12-18 Thread Daniel Rentz

Oliver Brinzing schrieb:

Hi Daniel,

please forgive me for asking but i changed the code to:


Forgive me for believing the API documentation and not checking the 
implementation. :-) You are right, and Calc is wrong. Sigh.



Daniel

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org



Re: [api-dev] XCell methods getValue and getError

2008-12-17 Thread Daniel Rentz

Hello,

Petteri Larjos schrieb:


Question 2
com.sun.star.table.xcell method getError() returns long value. How do I get
error string which corresponds with getError() value?


The corresponding error text is application dependent. There is 
currently no way to get it from the error code. Maybe this list helps, 
it shows the mapping that Calc uses internally:


503 = #NUM!
519 = #VALUE!
521 = #NULL!
524 = #REF!
525 = #NAME?
532 = #DIV/0!
32767 = #N/A

Don't know if the last code really works but it is defined this way.


Regards
Daniel

-
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org