summaryrefslogtreecommitdiff
path: root/svx/source/core/graphichelper.cxx
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2015-01-30 13:59:24 +0100
committerDavid Tardon <dtardon@redhat.com>2015-01-30 14:03:22 +0100
commit75fa61754122cf44a6bd6ac4a0efb44918b1305b (patch)
treeefcbef3ef733b1d105d949e42735b677a262b385 /svx/source/core/graphichelper.cxx
parent89321e312b4a1be22becbead67b1d25b058c623b (diff)
ensure the default export filter is really available
Change-Id: Ie9b8a25d8d33c6211c43277f4d3b4cdbd79f5783
Diffstat (limited to 'svx/source/core/graphichelper.cxx')
-rw-r--r--svx/source/core/graphichelper.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx
index 04b93c09d2ea..5cd4e4074c3b 100644
--- a/svx/source/core/graphichelper.cxx
+++ b/svx/source/core/graphichelper.cxx
@@ -209,8 +209,6 @@ void GraphicHelper::SaveShapeAsGraphic( const Reference< drawing::XShape >& xSha
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
Reference< XPropertySet > xShapeSet( xShape, UNO_QUERY_THROW );
- OUString aMimeType;
-
SvtPathOptions aPathOpt;
OUString sGraphicPath( aPathOpt.GetGraphicPath() );
@@ -227,6 +225,7 @@ void GraphicHelper::SaveShapeAsGraphic( const Reference< drawing::XShape >& xSha
GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
Reference<XFilterManager> xFilterManager( xFilePicker, UNO_QUERY );
+ const OUString aDefaultMimeType("image/png");
OUString aDefaultFormatName;
sal_uInt16 nCount = rGraphicFilter.GetExportFormatCount();
@@ -238,14 +237,12 @@ void GraphicHelper::SaveShapeAsGraphic( const Reference< drawing::XShape >& xSha
const OUString aFilterMimeType( rGraphicFilter.GetExportFormatMediaType( i ) );
xFilterManager->appendFilter( aExportFormatName, rGraphicFilter.GetExportWildcard( i ) );
aMimeTypeMap[ aExportFormatName ] = aFilterMimeType;
- if( aMimeType == aFilterMimeType )
+ if( aDefaultMimeType == aFilterMimeType )
aDefaultFormatName = aExportFormatName;
}
- if( aDefaultFormatName.getLength() == 0 )
- aDefaultFormatName = "PNG - Portable Network Graphic";
-
- xFilterManager->setCurrentFilter( aDefaultFormatName );
+ if( !aDefaultFormatName.isEmpty() )
+ xFilterManager->setCurrentFilter( aDefaultFormatName );
// execute dialog