Hi
Can someone in the know tell me where the following code goes wrong? Kspread wont load the file, oo.o will but shows a blank sheet.
content.xml shows an empty document like this:
The code executes all the way through because the final debug statement is printed.
Cheers
And the code:
KSpread::Doc *ksdoc = new KSpread::Doc();
KSpread::Sheet *sht = ksdoc->map()->createSheet();
sht->setSheetName(doc->title());
sht->setText(0,0,"Hello");
sht->setText(1,1,"There");
///=============================
KoStore* store = KoStore::createStore( "/home/piggz/kexitest.ods", KoStore::Write);
if ( store->bad() )
{
delete store;
return;
}
kDebug() <<"Saving to OASIS format";
// Tell KoStore not to touch the file names
store->disallowNameExpansion();
KoOdfWriteStore odfStore( store );
KoXmlWriter* manifestWriter = odfStore.manifestWriter( ksdoc->mimeType() );
KoEmbeddedDocumentSaver embeddedSaver;
KoDocument::SavingContext documentContext( odfStore, embeddedSaver );
if ( !ksdoc->saveOdf( documentContext ) )
{
kDebug() <<"saveOdf failed";
delete store;
return;
}
// Save embedded objects
if ( !embeddedSaver.saveEmbeddedDocuments( documentContext ) )
{
kDebug() <<"save embedded documents failed";
delete store;
return ;
}
// Write out manifest file
if ( !odfStore.closeManifestWriter() )
{
kDebug() << "Error while trying to write 'META-INF/manifest.xml'. Partition full?";
delete store;
return;
}
if ( !store->finalize() )
{
delete store;
return;
}
kDebug() << "SAVED OK" << endl;
delete store;
delete doc;
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel