Set back the autogenerated annotation unique name on saving

The the original unique name was empty. Otherwise we can't find the annotation after save/reload because the annotation name is still empty and a new random id is assigned
remotes/origin/dont-use-docdata-for-annots-and-forms
Albert Astals Cid 8 years ago committed by Albert Astals Cid
parent 210a6ced5a
commit 055f2db76d
  1. 12
      generators/poppler/generator_pdf.cpp

@ -1717,6 +1717,18 @@ bool PDFGenerator::save( const QString &fileName, SaveOptions options, QString *
pdfConv->setPDFOptions( pdfConv->pdfOptions() | Poppler::PDFConverter::WithChanges );
QMutexLocker locker( userMutex() );
QHashIterator<Okular::Annotation*, Poppler::Annotation*> it( annotationsHash );
while ( it.hasNext() )
{
it.next();
if ( it.value()->uniqueName().isEmpty() )
{
it.value()->setUniqueName( it.key()->uniqueName() );
}
}
bool success = pdfConv->convert();
if (!success)
{

Loading…
Cancel
Save