From koffice-devel Tue Dec 25 09:57:13 2007 From: Thorsten Zachmann Date: Tue, 25 Dec 2007 09:57:13 +0000 To: koffice-devel Subject: koffice/libs/main Message-Id: <1198576633.668738.7355.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=koffice-devel&m=119857664203747 SVN commit 752724 by zachmann: o Save embedded objects. I have removed the old support for saving embedded objects via the KoDocumentChild. As far as I see that code is not used anywhere right now. There are some parts in kspread still using it but the code is never reached. For saving embedded objects (KoDocuments) use the KoEmbeddedDocumentSaver. It is part of the KoShapeSavingContext. You get the embedded saver by the embeddedSaver() method. The method embedDocument( KoXmlWriter &writer, KoDocument * doc ) add the xlink attributes to the current xml element. This function is called from the saveOdf of the shape that embedds a document. The actual saving of the embedded document is done by KoDocument. If you have questions on how to do the saving in the shape just send me a mail and I try to answer it. CCMAIL: koffice-devel@kde.org M +5 -5 KoDocument.cpp M +5 -0 KoDocumentChild.cpp --- trunk/koffice/libs/main/KoDocument.cpp #752723:752724 @@ -1055,9 +1055,9 @@ } // Save embedded objects - if ( !saveChildrenOdf( documentContext ) ) + if ( !embeddedSaver.saveEmbeddedDocuments( documentContext ) ) { - kDebug(30003) <<"saveChildrenOasis failed"; + kDebug(30003) <<"save embedded documents failed"; delete store; return false; } @@ -2056,15 +2056,15 @@ if ( !saveOdf( documentContext ) ) { - kDebug(30003) <<"saveOasis failed"; + kDebug(30003) <<"saveOdf failed"; delete store; return false; } // Save embedded objects - if ( !saveChildrenOdf( documentContext ) ) + if ( !embeddedSaver.saveEmbeddedDocuments( documentContext ) ) { - kDebug(30003) <<"saveChildrenOasis failed"; + kDebug(30003) <<"save embedded documents failed"; delete store; return false; } --- trunk/koffice/libs/main/KoDocumentChild.cpp #752723:752724 @@ -385,6 +385,8 @@ bool KoDocumentChild::saveOdf( KoDocument::SavingContext & documentContext ) { + kDebug(30003) << "use KoEmbeddedDocumentSaver"; + Q_ASSERT( false ); KoStore * store = documentContext.odfStore.store(); QString path; if ( d->m_doc->isStoredExtern() ) @@ -443,6 +445,9 @@ void KoDocumentChild::saveOasisAttributes( KoXmlWriter &xmlWriter, const QString& name ) { + kDebug(30003) << "use KoEmbeddedDocumentSaver"; + Q_ASSERT( false ); + if ( !d->m_doc->isStoredExtern() ) { // set URL in document so that KoDocument::saveChildrenOasis will save _______________________________________________ koffice-devel mailing list koffice-devel@kde.org https://mail.kde.org/mailman/listinfo/koffice-devel