Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't read composer title from template. Fixes bug #2311
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12612 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Dec 24, 2009
1 parent 130e774 commit 58dc079
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -1098,19 +1098,18 @@ void QgsComposer::readXML( const QDomDocument& doc )
{
return;
}
readXML( composerNodeList.at( 0 ).toElement(), doc );
readXML( composerNodeList.at( 0 ).toElement(), doc, true );
}

void QgsComposer::readXML( const QDomElement& composerElem, const QDomDocument& doc )
void QgsComposer::readXML( const QDomElement& composerElem, const QDomDocument& doc, bool fromTemplate )
{
// Create action to select this window
delete mWindowAction;
mWindowAction = new QAction( windowTitle(), this );
connect( mWindowAction, SIGNAL( triggered() ), this, SLOT( activate() ) );

if ( composerElem.hasAttribute( "title" ) )
// Set title only if reading from project file
if ( !fromTemplate )
{
setTitle( composerElem.attribute( "title", tr( "Composer" ) ) );
if ( composerElem.hasAttribute( "title" ) )
{
setTitle( composerElem.attribute( "title", tr( "Composer" ) ) );
}
}

//delete composer view and composition
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposer.h
Expand Up @@ -231,7 +231,7 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase

//! Sets state from Dom document
void readXML( const QDomDocument& doc );
void readXML( const QDomElement& composerElem, const QDomDocument& doc );
void readXML( const QDomElement& composerElem, const QDomDocument& doc, bool fromTemplate = false );

void setSelectionTool();

Expand Down

0 comments on commit 58dc079

Please sign in to comment.