I've been searching and trying for days without success, so I finally try to ask here.
My problem is the following:
I get data from an arduino over serial port, and automatically feed them into a xcalc spreadsheet.
That works fine, but since the spreadsheet uses a diagram to display the data graphically and there are around 150 rows filled, it takes forever until the operation is completed.
Thats why I start to play around with the lockControllers method to avoid screen updating, but what I achieved is not enough.
Now, I can supress the update of filling in data into the rows, but still the diagram graph is being updated while the document is feeded with data. So there is no gain in speed of the overall operation.
What I want is that not only the screen updating while data feeding into the rows is suppressed, but also the diagram update. So that finally there is no update until all data is transferred into the document.
I give a code snippet here that works for the part described. If someone can give me advice, I would be grateful.
Code: Select all
Reference < XComponentLoader > xComponentLoader( xMultiComponentFactoryServer->createInstanceWithContext(
OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop" ) ),
xComponentContext ), UNO_QUERY );
/* Loads a component specified by an URL into the specified new or existing
frame.
*/
OUString sAbsoluteDocUrl, sWorkingDir, sDocPathUrl, sArgDocUrl;
rtl_getAppCommandArg(0, &sArgDocUrl.pData);
osl_getProcessWorkingDir(&sWorkingDir.pData);
osl::FileBase::getFileURLFromSystemPath( sArgDocUrl, sDocPathUrl);
osl::FileBase::getAbsoluteFileURL( sWorkingDir, sDocPathUrl, sAbsoluteDocUrl);
Reference< XComponent > xComponent = xComponentLoader->loadComponentFromURL( sAbsoluteDocUrl, OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") ), 0, Sequence < ::com::sun::star::beans::PropertyValue >() );
Reference< XController > xController( xComponent, UNO_QUERY );
//.... some other code ....
Reference< XModel > xModel( xComponent, UNO_QUERY );
if( xModel.is() ) {
xModel->lockControllers();
printf("locking Controllers\n");
}
else printf("FAILED: locking Controllers\n");
Gaivota