Kaydet (Commit) b197a448 authored tarafından Miklos Vajna's avatar Miklos Vajna

svx UnoGraphicExporter: allow a custom AA just for that particular export

This has an effect for text only since the cairo text renderer no longer
ignores the "disable AA" requests.

To use it, instantiate com.sun.star.drawing.GraphicExportFilter, call
its filter() method with an argument that has a FilterData, which has an
AntiAliasing sub-key with a boolean value.

Change-Id: I4f51bc685a97141eb0fdeae5e4afed26787b1fb8
Reviewed-on: https://gerrit.libreoffice.org/58194Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins
üst 36e1f6eb
......@@ -108,6 +108,8 @@ namespace {
Fraction maScaleX;
Fraction maScaleY;
TriState meAntiAliasing = TRISTATE_INDET;
explicit ExportSettings(const SdrModel* pSdrModel);
};
......@@ -584,6 +586,12 @@ void GraphicExporter::ParseSettings( const Sequence< PropertyValue >& aDescripto
if( pDataValues->Value >>= nVal )
rSettings.maScaleY = Fraction( rSettings.maScaleY.GetNumerator(), nVal );
}
else if (pDataValues->Name == "AntiAliasing")
{
bool bAntiAliasing;
if (pDataValues->Value >>= bAntiAliasing)
rSettings.meAntiAliasing = bAntiAliasing ? TRISTATE_TRUE : TRISTATE_FALSE;
}
pDataValues++;
}
......@@ -1020,7 +1028,16 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes
ErrCode nStatus = ERRCODE_NONE;
if (!maGraphic)
{
SvtOptionsDrawinglayer aOptions;
bool bAntiAliasing = aOptions.IsAntiAliasing();
if (aSettings.meAntiAliasing != TRISTATE_INDET)
// This is safe to do globally as we own the solar mutex.
aOptions.SetAntiAliasing(aSettings.meAntiAliasing == TRISTATE_TRUE);
nStatus = GetGraphic( aSettings, aGraphic, bVectorType ) ? ERRCODE_NONE : ERRCODE_GRFILTER_FILTERERROR;
if (aSettings.meAntiAliasing != TRISTATE_INDET)
aOptions.SetAntiAliasing(bAntiAliasing);
}
if( nStatus == ERRCODE_NONE )
{
......
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