@@ -27,12 +27,28 @@ QgsComposerFrame::~QgsComposerFrame()
2727
2828bool QgsComposerFrame::writeXML ( QDomElement& elem, QDomDocument & doc ) const
2929{
30- return false ; // _writeXML( element, doc );
30+ QDomElement frameElem = doc.createElement ( " ComposerFrame" );
31+ frameElem.setAttribute ( " sectionX" , QString::number ( mSection .x () ) );
32+ frameElem.setAttribute ( " sectionY" , QString::number ( mSection .y () ) );
33+ frameElem.setAttribute ( " sectionWidth" , QString::number ( mSection .width () ) );
34+ frameElem.setAttribute ( " sectionHeight" , QString::number ( mSection .height () ) );
35+ elem.appendChild ( frameElem );
36+ return _writeXML ( frameElem, doc );
3137}
3238
3339bool QgsComposerFrame::readXML ( const QDomElement& itemElem, const QDomDocument& doc )
3440{
35- return false ; // _readXML( element, doc )
41+ double x = itemElem.attribute ( " sectionX" ).toDouble ();
42+ double y = itemElem.attribute ( " sectionY" ).toDouble ();
43+ double width = itemElem.attribute ( " sectionWidth" ).toDouble ();
44+ double height = itemElem.attribute ( " sectionHeight" ).toDouble ();
45+ mSection = QRectF ( x, y, width, height );
46+ QDomElement composerItem = itemElem.firstChildElement ( " ComposerItem" );
47+ if ( composerItem.isNull () )
48+ {
49+ return false ;
50+ }
51+ return _readXML ( composerItem, doc );
3652}
3753
3854void QgsComposerFrame::paint ( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
0 commit comments