mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-27 19:50:27 +00:00
add flags to selectively choose the page parts to serialize
svn path=/trunk/KDE/kdegraphics/okular/; revision=884438
This commit is contained in:
parent
3462b4f53a
commit
a5252a9115
|
@ -770,7 +770,7 @@ void PagePrivate::restoreLocalContents( const QDomNode & pageNode )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PagePrivate::saveLocalContents( QDomNode & parentNode, QDomDocument & document ) const
|
void PagePrivate::saveLocalContents( QDomNode & parentNode, QDomDocument & document, PageItems what ) const
|
||||||
{
|
{
|
||||||
// only add a node if there is some stuff to write into
|
// only add a node if there is some stuff to write into
|
||||||
if ( m_page->m_annotations.isEmpty() && formfields.isEmpty() )
|
if ( m_page->m_annotations.isEmpty() && formfields.isEmpty() )
|
||||||
|
@ -794,7 +794,7 @@ void PagePrivate::saveLocalContents( QDomNode & parentNode, QDomDocument & docum
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// add annotations info if has got any
|
// add annotations info if has got any
|
||||||
if ( !m_page->m_annotations.isEmpty() )
|
if ( ( what & AnnotationPageItems ) && !m_page->m_annotations.isEmpty() )
|
||||||
{
|
{
|
||||||
// create the annotationList
|
// create the annotationList
|
||||||
QDomElement annotListElement = document.createElement( "annotationList" );
|
QDomElement annotListElement = document.createElement( "annotationList" );
|
||||||
|
@ -822,7 +822,7 @@ void PagePrivate::saveLocalContents( QDomNode & parentNode, QDomDocument & docum
|
||||||
}
|
}
|
||||||
|
|
||||||
// add forms info if has got any
|
// add forms info if has got any
|
||||||
if ( !formfields.isEmpty() )
|
if ( ( what & FormFieldPageItems ) && !formfields.isEmpty() )
|
||||||
{
|
{
|
||||||
// create the formList
|
// create the formList
|
||||||
QDomElement formListElement = document.createElement( "forms" );
|
QDomElement formListElement = document.createElement( "forms" );
|
||||||
|
|
|
@ -37,6 +37,15 @@ class PageTransition;
|
||||||
class RotationJob;
|
class RotationJob;
|
||||||
class TextPage;
|
class TextPage;
|
||||||
|
|
||||||
|
enum PageItem
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
AnnotationPageItems = 0x01,
|
||||||
|
FormFieldPageItems = 0x02,
|
||||||
|
AllPageItems = 0xff
|
||||||
|
};
|
||||||
|
Q_DECLARE_FLAGS(PageItems, PageItem)
|
||||||
|
|
||||||
class PagePrivate
|
class PagePrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -54,7 +63,7 @@ class PagePrivate
|
||||||
/**
|
/**
|
||||||
* Saves the local contents (e.g. annotations) of the page.
|
* Saves the local contents (e.g. annotations) of the page.
|
||||||
*/
|
*/
|
||||||
void saveLocalContents( QDomNode & parentNode, QDomDocument & document ) const;
|
void saveLocalContents( QDomNode & parentNode, QDomDocument & document, PageItems what = AllPageItems ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modifies an existing annotation by replacing it with a new @p annotation.
|
* Modifies an existing annotation by replacing it with a new @p annotation.
|
||||||
|
@ -126,4 +135,6 @@ class PagePrivate
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Q_DECLARE_OPERATORS_FOR_FLAGS(Okular::PageItems)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue