Re: [dev] Speeding up generation of Calc document

2005-08-28 Thread Christian Junker
Hi Matthias,

also consider using css::document::XActionLockable to improve performance.
See 
http://api.openoffice.org/docs/common/ref/com/sun/star/document/XActionLockable.html

2005/8/22, Matthias Benkmann [EMAIL PROTECTED]:
 Hi,
 
 I need to create a large Calc document from scratch via UNO. Calling
 setFormula() for all the cells is pretty slow (about 1.5ms per Cell on
 my 2800MHz computer). By introducing un/lockControllers() calls I've
 managed to reduce the time to about 0.5ms, but when generating a large
 document this is still painfully slow.
 
 Does anyone have a suggestion for speeding the code up further?
 
 I've noticed that while lockControllers() disables the synchronous
 screen updates of the table itself, every call to setFormula() results
 in the formula being displayed in the Formula bar. So there still
 seems to be a lot of event processing going on. Is there anything else
 I can do aside from lockControllers() to reduce event processing even
 further? Note that disabling the Formula bar in View/Toolbars does not
 give a very significant speed up.
 
 Matthias
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
Best Regards
Christian Junker

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [dev] Speeding up generation of Calc document

2005-08-22 Thread Kohei Yoshida
Hi Matthias,

On 8/22/05, Matthias Benkmann [EMAIL PROTECTED] wrote:
 Hi,
 
 I need to create a large Calc document from scratch via UNO. Calling
 setFormula() for all the cells is pretty slow (about 1.5ms per Cell on
 my 2800MHz computer). By introducing un/lockControllers() calls I've
 managed to reduce the time to about 0.5ms, but when generating a large
 document this is still painfully slow.

If all you need is to fill a large numbe of cells at once, take a look
into setDataArray() - a member function of XCellRangeData:

http://api.openoffice.org/docs/common/ref/com/sun/star/sheet/XCellRangeData.html

Because the actual speed up is pretty considerable by switching to
using this method, I use it in all situations where
setFormula/setValue calls inside a loop would otherwise be needed.

HTH,

Kohei

-- 
Kohei Yoshida
OpenOffice.org Calc contributor
http://kohei.us/ooo/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]