[Libreoffice-commits] core.git: Branch 'distro/vector/vector-5.4' - svx/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Jul 30 08:00:46 UTC 2018


 svx/source/unodraw/UnoGraphicExporter.cxx |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit 770afb4868a08cd6952500a39aec7d4d7bdcd595
Author:     Miklos Vajna <vmiklos at collabora.co.uk>
AuthorDate: Fri Jul 27 15:23:18 2018 +0200
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Mon Jul 30 09:50:43 2018 +0200

    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.
    
    (cherry picked from commit b197a4488adcf37b5460f5f7a5edc8adff0edabb)
    
    Conflicts:
            svx/source/unodraw/UnoGraphicExporter.cxx
    
    Change-Id: I4f51bc685a97141eb0fdeae5e4afed26787b1fb8

diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 17eabdd5c360..2d9bd17bfb67 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -112,6 +112,8 @@ namespace {
         Fraction    maScaleX;
         Fraction    maScaleY;
 
+        TriState meAntiAliasing = TRISTATE_INDET;
+
         explicit ExportSettings( SdrModel* pDoc );
     };
 
@@ -582,6 +584,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++;
             }
@@ -1013,7 +1021,14 @@ sal_Bool SAL_CALL GraphicExporter::filter( const Sequence< PropertyValue >& aDes
     // create the output stuff
     Graphic aGraphic;
 
+    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);
     sal_uInt16 nStatus = GetGraphic( aSettings, aGraphic, bVectorType ) ? GRFILTER_OK : GRFILTER_FILTERERROR;
+    if (aSettings.meAntiAliasing != TRISTATE_INDET)
+        aOptions.SetAntiAliasing(bAntiAliasing);
 
     if( nStatus == GRFILTER_OK )
     {


More information about the Libreoffice-commits mailing list