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 ...@@ -209,8 +209,6 @@ void GraphicHelper::SaveShapeAsGraphic( const Reference< drawing::XShape >& xSha
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
Reference< XPropertySet > xShapeSet( xShape, UNO_QUERY_THROW ); Reference< XPropertySet > xShapeSet( xShape, UNO_QUERY_THROW );
OUString aMimeType;
SvtPathOptions aPathOpt; SvtPathOptions aPathOpt;
OUString sGraphicPath( aPathOpt.GetGraphicPath() ); OUString sGraphicPath( aPathOpt.GetGraphicPath() );
...@@ -227,6 +225,7 @@ void GraphicHelper::SaveShapeAsGraphic( const Reference< drawing::XShape >& xSha ...@@ -227,6 +225,7 @@ void GraphicHelper::SaveShapeAsGraphic( const Reference< drawing::XShape >& xSha
GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
Reference<XFilterManager> xFilterManager( xFilePicker, UNO_QUERY ); Reference<XFilterManager> xFilterManager( xFilePicker, UNO_QUERY );
const OUString aDefaultMimeType("image/png");
OUString aDefaultFormatName; OUString aDefaultFormatName;
sal_uInt16 nCount = rGraphicFilter.GetExportFormatCount(); sal_uInt16 nCount = rGraphicFilter.GetExportFormatCount();
...@@ -238,14 +237,12 @@ void GraphicHelper::SaveShapeAsGraphic( const Reference< drawing::XShape >& xSha ...@@ -238,14 +237,12 @@ void GraphicHelper::SaveShapeAsGraphic( const Reference< drawing::XShape >& xSha
const OUString aFilterMimeType( rGraphicFilter.GetExportFormatMediaType( i ) ); const OUString aFilterMimeType( rGraphicFilter.GetExportFormatMediaType( i ) );
xFilterManager->appendFilter( aExportFormatName, rGraphicFilter.GetExportWildcard( i ) ); xFilterManager->appendFilter( aExportFormatName, rGraphicFilter.GetExportWildcard( i ) );
aMimeTypeMap[ aExportFormatName ] = aFilterMimeType; aMimeTypeMap[ aExportFormatName ] = aFilterMimeType;
if( aMimeType == aFilterMimeType ) if( aDefaultMimeType == aFilterMimeType )
aDefaultFormatName = aExportFormatName; aDefaultFormatName = aExportFormatName;
} }
if( aDefaultFormatName.getLength() == 0 ) if( !aDefaultFormatName.isEmpty() )
aDefaultFormatName = "PNG - Portable Network Graphic"; xFilterManager->setCurrentFilter( aDefaultFormatName );
xFilterManager->setCurrentFilter( aDefaultFormatName );
// execute dialog // 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