Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Save composer pictures absolute / relative depending on project setting
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11733 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Sep 29, 2009
1 parent aa7fa27 commit 0936864
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/composer/qgscomposerpicture.cpp
Expand Up @@ -17,6 +17,7 @@
/* $Id$ */

#include "qgscomposerpicture.h"
#include "qgsproject.h"
#include <QDomDocument>
#include <QDomElement>
#include <QFileInfo>
Expand Down Expand Up @@ -209,7 +210,7 @@ bool QgsComposerPicture::writeXML( QDomElement& elem, QDomDocument & doc ) const
return false;
}
QDomElement composerPictureElem = doc.createElement( "ComposerPicture" );
composerPictureElem.setAttribute( "file", mSourceFile.fileName() );
composerPictureElem.setAttribute( "file", QgsProject::instance()->writePath( mSourceFile.fileName() ) );
composerPictureElem.setAttribute( "rotation", QString::number( mRotation ) );
_writeXML( composerPictureElem, doc );
elem.appendChild( composerPictureElem );
Expand All @@ -233,7 +234,7 @@ bool QgsComposerPicture::readXML( const QDomElement& itemElem, const QDomDocumen
mDefaultSvgSize = QSize( 0, 0 );
mCachedDpi = 0;

QString fileName = itemElem.attribute( "file" );
QString fileName = QgsProject::instance()->readPath( itemElem.attribute( "file" ) );
setPictureFile( fileName );

mRotation = itemElem.attribute( "rotation" ).toDouble();
Expand Down

0 comments on commit 0936864

Please sign in to comment.