Commit 48a23fc4 authored by Fabio D'Urso's avatar Fabio D'Urso

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

(there is no such generator at the moment)
parent 57c9cae2
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment