Skip to content

Commit 58dc079

Browse files
author
mhugent
committed
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
1 parent 130e774 commit 58dc079

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/app/composer/qgscomposer.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,19 +1098,18 @@ void QgsComposer::readXML( const QDomDocument& doc )
10981098
{
10991099
return;
11001100
}
1101-
readXML( composerNodeList.at( 0 ).toElement(), doc );
1101+
readXML( composerNodeList.at( 0 ).toElement(), doc, true );
11021102
}
11031103

1104-
void QgsComposer::readXML( const QDomElement& composerElem, const QDomDocument& doc )
1104+
void QgsComposer::readXML( const QDomElement& composerElem, const QDomDocument& doc, bool fromTemplate )
11051105
{
1106-
// Create action to select this window
1107-
delete mWindowAction;
1108-
mWindowAction = new QAction( windowTitle(), this );
1109-
connect( mWindowAction, SIGNAL( triggered() ), this, SLOT( activate() ) );
1110-
1111-
if ( composerElem.hasAttribute( "title" ) )
1106+
// Set title only if reading from project file
1107+
if ( !fromTemplate )
11121108
{
1113-
setTitle( composerElem.attribute( "title", tr( "Composer" ) ) );
1109+
if ( composerElem.hasAttribute( "title" ) )
1110+
{
1111+
setTitle( composerElem.attribute( "title", tr( "Composer" ) ) );
1112+
}
11141113
}
11151114

11161115
//delete composer view and composition

src/app/composer/qgscomposer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
231231

232232
//! Sets state from Dom document
233233
void readXML( const QDomDocument& doc );
234-
void readXML( const QDomElement& composerElem, const QDomDocument& doc );
234+
void readXML( const QDomElement& composerElem, const QDomDocument& doc, bool fromTemplate = false );
235235

236236
void setSelectionTool();
237237

0 commit comments

Comments
 (0)