Kaydet (Commit) 762c5234 authored tarafından Armin Le Grand's avatar Armin Le Grand Kaydeden (comit) Thorsten Behrens

emfplus: finetuning, UnitTest, not active by default

Change-Id: Ie085ad2610a306c7f9c44551114041d0950d1af5
üst 34a0cb05
...@@ -1710,10 +1710,9 @@ namespace drawinglayer ...@@ -1710,10 +1710,9 @@ namespace drawinglayer
} }
case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D : case PRIMITIVE2D_ID_METAFILEPRIMITIVE2D :
{ {
static bool bUseMetaFilePrimitiveDecomposition(true);
const primitive2d::MetafilePrimitive2D& aMetafile = static_cast< const primitive2d::MetafilePrimitive2D& >(rCandidate); const primitive2d::MetafilePrimitive2D& aMetafile = static_cast< const primitive2d::MetafilePrimitive2D& >(rCandidate);
if(bUseMetaFilePrimitiveDecomposition && !aMetafile.getMetaFile().GetUseCanvas()) if(!aMetafile.getMetaFile().GetUseCanvas())
{ {
// Use new Metafile decomposition. // Use new Metafile decomposition.
// TODO EMF+ stuffed into METACOMMENT support required // TODO EMF+ stuffed into METACOMMENT support required
...@@ -1721,8 +1720,24 @@ namespace drawinglayer ...@@ -1721,8 +1720,24 @@ namespace drawinglayer
} }
else 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 // direct draw of MetaFile, use default processing
RenderMetafilePrimitive2D(aMetafile); RenderMetafilePrimitive2D(aMetafile);
#endif // DBG_UTIL
} }
break; break;
......
...@@ -505,11 +505,13 @@ namespace drawinglayer ...@@ -505,11 +505,13 @@ namespace drawinglayer
else else
{ {
#ifdef DBG_UTIL #ifdef DBG_UTIL
// switch to test EMFPlus-enhanced MetafileDecomposition // switch to test EMFPlus-enhanced MetafileDecomposition, don't do
static bool bTestEMFPDecomposition(true); // this by default in debug mode
// switch to show the new visualization color.-changed behind static bool bTestEMFPDecomposition(false);
// the original output vor visual testing
static bool bUseChangedColorObject(true); // 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) if (bTestEMFPDecomposition)
{ {
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
#include <tools/stream.hxx> #include <tools/stream.hxx>
#include <basegfx/point/b2dpoint.hxx> #include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dsize.hxx> #include <basegfx/vector/b2dsize.hxx>
//#include <com/sun/star/rendering/XCanvasFont.hpp>
//#include <com/sun/star/rendering/TextDirection.hpp>
// predefines // predefines
class SvStream; class SvStream;
...@@ -252,10 +250,6 @@ namespace emfplushelper ...@@ -252,10 +250,6 @@ namespace emfplushelper
// readers // readers
void ReadRectangle(SvStream& s, float& x, float& y, float &width, float& height, bool bCompressed = false); void ReadRectangle(SvStream& s, float& x, float& y, float &width, float& height, bool bCompressed = false);
bool readXForm(SvStream& rIn, basegfx::B2DHomMatrix& rTarget); bool readXForm(SvStream& rIn, basegfx::B2DHomMatrix& rTarget);
/// data holders access
// wmfemfhelper::TargetHolders& getTargetHolders() const { return mrTargetHolders; }
// wmfemfhelper::PropertyHolders& getPropertyHolders() const { return mrPropertyHolders; }
}; };
} }
......
...@@ -18,16 +18,9 @@ ...@@ -18,16 +18,9 @@
*/ */
#include <wmfemfhelper.hxx> #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 <drawinglayer/primitive2d/pointarrayprimitive2d.hxx>
#include <vcl/lineinfo.hxx> #include <vcl/lineinfo.hxx>
//#include <drawinglayer/attribute/lineattribute.hxx>
//#include <drawinglayer/attribute/strokeattribute.hxx>
#include <drawinglayer/primitive2d/polygonprimitive2d.hxx> #include <drawinglayer/primitive2d/polygonprimitive2d.hxx>
//#include <vcl/metaact.hxx>
#include <drawinglayer/primitive2d/transformprimitive2d.hxx> #include <drawinglayer/primitive2d/transformprimitive2d.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx>
#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx> #include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
...@@ -37,24 +30,19 @@ ...@@ -37,24 +30,19 @@
#include <vcl/salbtype.hxx> #include <vcl/salbtype.hxx>
#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx> #include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx> #include <drawinglayer/primitive2d/fillgradientprimitive2d.hxx>
//#include <vcl/svapp.hxx>
#include <drawinglayer/primitive2d/transparenceprimitive2d.hxx> #include <drawinglayer/primitive2d/transparenceprimitive2d.hxx>
#include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx> #include <drawinglayer/primitive2d/fillhatchprimitive2d.hxx>
#include <drawinglayer/primitive2d/maskprimitive2d.hxx> #include <drawinglayer/primitive2d/maskprimitive2d.hxx>
#include <basegfx/polygon/b2dpolygonclipper.hxx> #include <basegfx/polygon/b2dpolygonclipper.hxx>
#include <drawinglayer/primitive2d/invertprimitive2d.hxx> #include <drawinglayer/primitive2d/invertprimitive2d.hxx>
#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx> #include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
//#include <drawinglayer/primitive2d/fillgraphicprimitive2d.hxx>
#include <drawinglayer/primitive2d/wallpaperprimitive2d.hxx> #include <drawinglayer/primitive2d/wallpaperprimitive2d.hxx>
//#include <drawinglayer/primitive2d/textprimitive2d.hxx>
#include <drawinglayer/primitive2d/textlayoutdevice.hxx> #include <drawinglayer/primitive2d/textlayoutdevice.hxx>
#include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx> #include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx>
//#include <i18nlangtag/languagetag.hxx>
#include <drawinglayer/primitive2d/textlineprimitive2d.hxx> #include <drawinglayer/primitive2d/textlineprimitive2d.hxx>
#include <drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx> #include <drawinglayer/primitive2d/textstrikeoutprimitive2d.hxx>
#include <drawinglayer/primitive2d/epsprimitive2d.hxx> #include <drawinglayer/primitive2d/epsprimitive2d.hxx>
#include <tools/fract.hxx> #include <tools/fract.hxx>
//#include <numeric>
#include <vcl/gradient.hxx> #include <vcl/gradient.hxx>
#include <vcl/hatch.hxx> #include <vcl/hatch.hxx>
#include <emfplushelper.hxx> #include <emfplushelper.hxx>
......
...@@ -39,6 +39,7 @@ $(eval $(call gb_CppunitTest_use_libraries,emfio,\ ...@@ -39,6 +39,7 @@ $(eval $(call gb_CppunitTest_use_libraries,emfio,\
unotest \ unotest \
tl \ tl \
vcl \ vcl \
utl \
)) ))
$(eval $(call gb_CppunitTest_add_exception_objects,emfio,\ $(eval $(call gb_CppunitTest_add_exception_objects,emfio,\
......
...@@ -63,8 +63,9 @@ Primitive2DSequence Test::parseEmf(const char* aSource) ...@@ -63,8 +63,9 @@ Primitive2DSequence Test::parseEmf(const char* aSource)
Sequence<sal_Int8> aData(pBuffer.get(), nSize + 1); Sequence<sal_Int8> aData(pBuffer.get(), nSize + 1);
Reference<XInputStream> aInputStream(new comphelper::SequenceInputStream(aData)); 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) void Test::checkRectPrimitive(Primitive2DSequence& rPrimitive)
...@@ -74,16 +75,10 @@ void Test::checkRectPrimitive(Primitive2DSequence& rPrimitive) ...@@ -74,16 +75,10 @@ void Test::checkRectPrimitive(Primitive2DSequence& rPrimitive)
CPPUNIT_ASSERT (pDocument); 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", "color", "#00cc00"); // rect background color
// assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor", "height", "100"); // rect background height // 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", "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() void Test::testWorking()
......
...@@ -64,7 +64,7 @@ bool VCL_DLLPUBLIC WriteDIBBitmapEx( ...@@ -64,7 +64,7 @@ bool VCL_DLLPUBLIC WriteDIBBitmapEx(
const BitmapEx& rSource, const BitmapEx& rSource,
SvStream& rOStm); SvStream& rOStm);
// needed for emfio migration // needed in emfio for emf/wmf migration
sal_uInt32 VCL_DLLPUBLIC getDIBV5HeaderSize(); sal_uInt32 VCL_DLLPUBLIC getDIBV5HeaderSize();
#endif // INCLUDED_VCL_DIBTOOLS_HXX #endif // INCLUDED_VCL_DIBTOOLS_HXX
......
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