Fallback behavior for generators that support forms but can't save them natively

(there is no such generator at the moment)
remotes/origin/dont-use-docdata-for-annots-and-forms
Fabio D'Urso 12 years ago
parent 57c9cae257
commit 48a23fc443
  1. 13
      core/document.cpp

@ -4285,7 +4285,8 @@ bool Document::saveDocumentArchive( const QString &fileName )
// If the generator can save annotations natively, do it
KTemporaryFile modifiedFile;
bool annotationsSavedNatively = false;
if ( d->canAddAnnotationsNatively() )
bool formsSavedNatively = false;
if ( d->canAddAnnotationsNatively() || canSaveChanges( SaveFormsCapability ) )
{
if ( !modifiedFile.open() )
return false;
@ -4296,7 +4297,8 @@ bool Document::saveDocumentArchive( const QString &fileName )
if ( saveChanges( modifiedFile.fileName(), &errorText ) )
{
docPath = modifiedFile.fileName(); // Save this instead of the original file
annotationsSavedNatively = true;
annotationsSavedNatively = d->canAddAnnotationsNatively();
formsSavedNatively = canSaveChanges( SaveFormsCapability );
}
else
{
@ -4305,8 +4307,13 @@ bool Document::saveDocumentArchive( const QString &fileName )
}
}
PageItems saveWhat = None;
if ( !annotationsSavedNatively )
saveWhat |= AnnotationPageItems;
if ( !formsSavedNatively )
saveWhat |= FormFieldPageItems;
KTemporaryFile metadataFile;
PageItems saveWhat = annotationsSavedNatively ? None : AnnotationPageItems;
if ( !d->savePageDocumentInfo( &metadataFile, saveWhat ) )
return false;

Loading…
Cancel
Save