Skip to content

Commit 2fca6e1

Browse files
author
mhugent
committed
automatically append pdf and svg suffixes (#ticket 2776)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13628 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 518a268 commit 2fca6e1

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/app/composer/qgscomposer.cpp

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,15 @@ void QgsComposer::on_mActionExportAsPDF_triggered()
472472
if ( result != QDialog::Accepted ) return;
473473

474474
QString myOutputFileNameQString = myQFileDialog->selectedFiles().first();
475-
if ( myOutputFileNameQString == "" ) return;
475+
if ( myOutputFileNameQString == "" )
476+
{
477+
return;
478+
}
479+
480+
if ( !myOutputFileNameQString.endsWith( ".pdf", Qt::CaseInsensitive ) )
481+
{
482+
myOutputFileNameQString.append( ".pdf" );
483+
}
476484

477485
myQSettings.setValue( "/UI/lastSaveAsPdfFile", myOutputFileNameQString );
478486

@@ -736,7 +744,15 @@ void QgsComposer::on_mActionExportAsSVG_triggered()
736744
if ( result != QDialog::Accepted ) return;
737745

738746
QString myOutputFileNameQString = myQFileDialog->selectedFiles().first();
739-
if ( myOutputFileNameQString == "" ) return;
747+
if ( myOutputFileNameQString == "" )
748+
{
749+
return;
750+
}
751+
752+
if ( !myOutputFileNameQString.endsWith( ".svg", Qt::CaseInsensitive ) )
753+
{
754+
myOutputFileNameQString.append( ".svg" );
755+
}
740756

741757
myQSettings.setValue( "/UI/lastSaveAsSvgFile", myOutputFileNameQString );
742758

0 commit comments

Comments
 (0)