Kaydet (Commit) 156b5a15 authored tarafından Alex Henrie's avatar Alex Henrie Kaydeden (comit) Jan Holesovsky

Do not convert SVGs to JPEGs when editing with external tool

This patch adds support for opening SVGs in the user's default SVG
viewer/editor. If the image cannot be exported to SVG directly, it is
exported as PNG instead. In no case will an SVG or an unrecognized
format be lossy-converted to JPEG.

Change-Id: I46dc8548c3cfb4d24a4a0078d4e3d7eee8367b1c
üst 09110b31
...@@ -100,7 +100,7 @@ void ExternalToolEdit::Edit( GraphicObject* pGraphicObject ) ...@@ -100,7 +100,7 @@ void ExternalToolEdit::Edit( GraphicObject* pGraphicObject )
//Write Graphic to the Temp File //Write Graphic to the Temp File
GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();
sal_uInt16 nFilter(rGraphicFilter.GetExportFormatNumber(fExtension)); sal_uInt16 nFilter(rGraphicFilter.GetExportFormatNumberForShortName(fExtension));
OUString aFilter(rGraphicFilter.GetExportFormatShortName(nFilter)); OUString aFilter(rGraphicFilter.GetExportFormatShortName(nFilter));
......
...@@ -84,6 +84,9 @@ void GraphicHelper::GetPreferredExtension( OUString& rExtension, const Graphic& ...@@ -84,6 +84,9 @@ void GraphicHelper::GetPreferredExtension( OUString& rExtension, const Graphic&
case GFX_LINK_TYPE_NATIVE_BMP: case GFX_LINK_TYPE_NATIVE_BMP:
aExtension = "bmp"; aExtension = "bmp";
break; break;
case GFX_LINK_TYPE_NATIVE_SVG:
aExtension = "svg";
break;
default: default:
break; break;
} }
......
...@@ -231,7 +231,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam ...@@ -231,7 +231,7 @@ sal_uInt16 XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileNam
if( GRFILTER_FORMAT_NOTFOUND == nFilter ) if( GRFILTER_FORMAT_NOTFOUND == nFilter )
{ {
nFilter = rFilter.GetExportFormatNumberForShortName( FORMAT_JPG ); nFilter = rFilter.GetExportFormatNumberForShortName( FORMAT_PNG );
if( GRFILTER_FORMAT_NOTFOUND == nFilter ) if( GRFILTER_FORMAT_NOTFOUND == nFilter )
nFilter = rFilter.GetExportFormatNumberForShortName( FORMAT_BMP ); nFilter = rFilter.GetExportFormatNumberForShortName( FORMAT_BMP );
......
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