[Libreoffice-commits] core.git: Branch 'feature/emfplusprimitiveparser' - drawinglayer/source emfio/CppunitTest_emfio.mk emfio/qa include/vcl

Armin Le Grand Armin.Le.Grand at cib.de
Thu Jun 22 16:10:01 UTC 2017


 drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx |   19 +++++++++++--
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx    |   12 ++++----
 drawinglayer/source/tools/emfphelperdata.hxx               |    6 ----
 drawinglayer/source/tools/wmfemfhelper.cxx                 |   12 --------
 emfio/CppunitTest_emfio.mk                                 |    1 
 emfio/qa/cppunit/EmfImportTest.cxx                         |   11 ++-----
 include/vcl/dibtools.hxx                                   |    2 -
 7 files changed, 29 insertions(+), 34 deletions(-)

New commits:
commit 66b823d169b116566ece6b65c0b63699f220ddec
Author: Armin Le Grand <Armin.Le.Grand at cib.de>
Date:   Thu Jun 22 18:10:16 2017 +0200

    emfplus: finetuning, UnitTest, not active by default
    
    Change-Id: Ie085ad2610a306c7f9c44551114041d0950d1af5

diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
index 99d9e700e390..14940439f6f7 100644
--- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx
@@ -1727,10 +1727,9 @@ namespace drawinglayer
                 }
                 case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D :
                 {
-                    static bool bUseMetaFilePrimitiveDecomposition(true);
                     const primitive2d::MetafilePrimitive2D& aMetafile = static_cast< const primitive2d::MetafilePrimitive2D& >(rCandidate);
 
-                    if(bUseMetaFilePrimitiveDecomposition && !aMetafile.getMetaFile().GetUseCanvas())
+                    if(!aMetafile.getMetaFile().GetUseCanvas())
                     {
                         // Use new Metafile decomposition.
                         // TODO EMF+ stuffed into METACOMMENT support required
@@ -1738,8 +1737,24 @@ namespace drawinglayer
                     }
                     else
                     {
+#ifdef DBG_UTIL
+                        // switch to test EMFPlus-enhanced MetafileDecomposition, don't do
+                        // this by default in debug mode
+                        static bool bTestEMFPDecomposition(false);
+
+                        if (bTestEMFPDecomposition)
+                        {
+                            process(rCandidate);
+                        }
+                        else
+                        {
+                            // direct draw of MetaFile
+                            RenderMetafilePrimitive2D(aMetafile);
+                        }
+#else // DBG_UTIL
                         // direct draw of MetaFile, use default processing
                         RenderMetafilePrimitive2D(aMetafile);
+#endif // DBG_UTIL
                     }
 
                     break;
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index de9b7ad2f6b6..842240bf317d 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -868,11 +868,13 @@ namespace drawinglayer
                     else
                     {
 #ifdef DBG_UTIL
-                        // switch to test EMFPlus-enhanced MetafileDecomposition
-                        static bool bTestEMFPDecomposition(true);
-                        // switch to show the new visualization color.-changed behind
-                        // the original output vor visual testing
-                        static bool bUseChangedColorObject(true);
+                        // switch to test EMFPlus-enhanced MetafileDecomposition, don't do
+                        // this by default in debug mode
+                        static bool bTestEMFPDecomposition(false);
+
+                        // switch to show the new visualization color changed behind
+                        // the original output vor visual testing, also not by default in debug mode
+                        static bool bUseChangedColorObject(false);
 
                         if (bTestEMFPDecomposition)
                         {
diff --git a/drawinglayer/source/tools/emfphelperdata.hxx b/drawinglayer/source/tools/emfphelperdata.hxx
index a700df8dac6c..67f423436fa4 100644
--- a/drawinglayer/source/tools/emfphelperdata.hxx
+++ b/drawinglayer/source/tools/emfphelperdata.hxx
@@ -25,8 +25,6 @@
 #include <tools/stream.hxx>
 #include <basegfx/point/b2dpoint.hxx>
 #include <basegfx/vector/b2dsize.hxx>
-//#include <com/sun/star/rendering/XCanvasFont.hpp>
-//#include <com/sun/star/rendering/TextDirection.hpp>
 
 // predefines
 class SvStream;
@@ -252,10 +250,6 @@ namespace emfplushelper
         // readers
         void ReadRectangle(SvStream& s, float& x, float& y, float &width, float& height, bool bCompressed = false);
         bool readXForm(SvStream& rIn, basegfx::B2DHomMatrix& rTarget);
-
-        /// data holders access
-//        wmfemfhelper::TargetHolders& getTargetHolders() const { return mrTargetHolders; }
-//        wmfemfhelper::PropertyHolders& getPropertyHolders() const { return mrPropertyHolders; }
     };
 }
 
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index 4c7a298b912f..f10c05724f60 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -18,16 +18,9 @@
  */
 
 #include <wmfemfhelper.hxx>
-
-//#include <basegfx/tools/canvastools.hxx>
-//#include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
-//#include <basegfx/color/bcolor.hxx>
 #include <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
 #include <vcl/lineinfo.hxx>
-//#include <drawinglayer/attribute/lineattribute.hxx>
-//#include <drawinglayer/attribute/strokeattribute.hxx>
 #include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
-//#include <vcl/metaact.hxx>
 #include <drawinglayer/primitive2d/transformprimitive2d.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
@@ -37,24 +30,19 @@
 #include <vcl/salbtype.hxx>
 #include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
 #include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
-//#include <vcl/svapp.hxx>
 #include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
 #include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
 #include <drawinglayer/primitive2d/maskprimitive2d.hxx>
 #include <basegfx/polygon/b2dpolygonclipper.hxx>
 #include <drawinglayer/primitive2d/invertprimitive2d.hxx>
 #include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
-//#include <drawinglayer/primitive2d/fillgraphicprimitive2d.hxx>
 #include <drawinglayer/primitive2d/wallpaperprimitive2d.hxx>
-//#include <drawinglayer/primitive2d/textprimitive2d.hxx>
 #include <drawinglayer/primitive2d/textlayoutdevice.hxx>
 #include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx>
-//#include <i18nlangtag/languagetag.hxx>
 #include <drawinglayer/primitive2d/textlineprimitive2d.hxx>
 #include <drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx>
 #include <drawinglayer/primitive2d/epsprimitive2d.hxx>
 #include <tools/fract.hxx>
-//#include <numeric>
 #include <vcl/gradient.hxx>
 #include <vcl/hatch.hxx>
 #include <emfplushelper.hxx>
diff --git a/emfio/CppunitTest_emfio.mk b/emfio/CppunitTest_emfio.mk
index 8214bc87e794..e785ac45b6e5 100644
--- a/emfio/CppunitTest_emfio.mk
+++ b/emfio/CppunitTest_emfio.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_CppunitTest_use_libraries,emfio,\
     unotest \
     tl \
     vcl \
+    utl \
 ))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,emfio,\
diff --git a/emfio/qa/cppunit/EmfImportTest.cxx b/emfio/qa/cppunit/EmfImportTest.cxx
index f315fc8937d0..ccef93ce673f 100644
--- a/emfio/qa/cppunit/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/EmfImportTest.cxx
@@ -63,8 +63,9 @@ Primitive2DSequence Test::parseEmf(const char* aSource)
 
     Sequence<sal_Int8> aData(pBuffer.get(), nSize + 1);
     Reference<XInputStream> aInputStream(new comphelper::SequenceInputStream(aData));
+    css::uno::Sequence< css::beans::PropertyValue > aEmptyValues;
 
-    return xEmfParser->getDecomposition(aInputStream, aPath);
+    return xEmfParser->getDecomposition(aInputStream, aPath, aEmptyValues);
 }
 
 void Test::checkRectPrimitive(Primitive2DSequence& rPrimitive)
@@ -74,16 +75,10 @@ void Test::checkRectPrimitive(Primitive2DSequence& rPrimitive)
 
     CPPUNIT_ASSERT (pDocument);
 
-    // emfio: add examples
+    // emfio: add examples (later)
     // assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "color", "#00cc00"); // rect background color
     // assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "height", "100"); // rect background height
     // assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "width", "100"); // rect background width
-    // assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "minx", "10");
-    // assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "miny", "10");
-    // assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "maxx", "110");
-    // assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "maxy", "110");
-    // assertXPath(pDocument, "/primitive2D/transform/polypolygonstroke/line", "color", "#ff0000"); // rect stroke color
-    // assertXPath(pDocument, "/primitive2D/transform/polypolygonstroke/line", "width", "3"); // rect stroke width
 }
 
 void Test::testWorking()
diff --git a/include/vcl/dibtools.hxx b/include/vcl/dibtools.hxx
index fcb3f3671616..0e4bf060ce71 100644
--- a/include/vcl/dibtools.hxx
+++ b/include/vcl/dibtools.hxx
@@ -64,7 +64,7 @@ bool VCL_DLLPUBLIC WriteDIBBitmapEx(
     const BitmapEx& rSource,
     SvStream& rOStm);
 
-// needed for emfio migration
+// needed in emfio for emf/wmf migration
 sal_uInt32 VCL_DLLPUBLIC getDIBV5HeaderSize();
 
 #endif // INCLUDED_VCL_DIBTOOLS_HXX


More information about the Libreoffice-commits mailing list