Kaydet (Commit) 75fa6175 authored tarafından David Tardon's avatar David Tardon

ensure the default export filter is really available

Change-Id: Ie9b8a25d8d33c6211c43277f4d3b4cdbd79f5783
üst 89321e31
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment