Kaydet (Commit) 217ad59a authored tarafından Bartosz Kosiorek's avatar Bartosz Kosiorek Kaydeden (comit) Noel Grandin

tdf#111486 Removed not used EMF+ code

Change-Id: I708876fecab1bd6b0c37892efa9c4ab180457d6b
Reviewed-on: https://gerrit.libreoffice.org/64366
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 74e12819
......@@ -50,20 +50,11 @@ $(eval $(call gb_Library_use_libraries,cppcanvas,\
$(eval $(call gb_Library_add_exception_objects,cppcanvas,\
cppcanvas/source/mtfrenderer/bitmapaction \
cppcanvas/source/mtfrenderer/cachedprimitivebase \
cppcanvas/source/mtfrenderer/emfpbrush \
cppcanvas/source/mtfrenderer/emfpcustomlinecap \
cppcanvas/source/mtfrenderer/emfpfont \
cppcanvas/source/mtfrenderer/emfpimage \
cppcanvas/source/mtfrenderer/emfplus \
cppcanvas/source/mtfrenderer/emfppen \
cppcanvas/source/mtfrenderer/emfppath \
cppcanvas/source/mtfrenderer/emfpregion \
cppcanvas/source/mtfrenderer/implrenderer \
cppcanvas/source/mtfrenderer/lineaction \
cppcanvas/source/mtfrenderer/mtftools \
cppcanvas/source/mtfrenderer/pointaction \
cppcanvas/source/mtfrenderer/polypolyaction \
cppcanvas/source/mtfrenderer/emfpstringformat \
cppcanvas/source/mtfrenderer/textaction \
cppcanvas/source/mtfrenderer/textlineshelper \
cppcanvas/source/mtfrenderer/transparencygroupaction \
......
......@@ -196,15 +196,6 @@ namespace cppcanvas
// (externally not visible)
typedef std::vector< MtfAction > ActionVector;
/* EMF+ */
static void ReadRectangle (SvStream& s, float& x, float& y, float &width, float& height, bool bCompressed = false);
static void ReadPoint (SvStream& s, float& x, float& y, sal_uInt32 flags);
void MapToDevice (double &x, double &y) const;
::basegfx::B2DPoint Map (double ix, double iy) const;
::basegfx::B2DSize MapSize (double iwidth, double iheight) const;
void GraphicStatePush (GraphicStateMap& map, sal_Int32 index, OutDevState const & rState);
void GraphicStatePop (GraphicStateMap& map, sal_Int32 index, OutDevState& rState);
private:
ImplRenderer(const ImplRenderer&) = delete;
ImplRenderer& operator=( const ImplRenderer& ) = delete;
......@@ -257,20 +248,6 @@ namespace cppcanvas
void processObjectRecord(SvMemoryStream& rObjectStream, sal_uInt16 flags, sal_uInt32 dataSize, bool bUseWholeStream = false);
/* EMF+ */
void processEMFPlus( MetaCommentAction const * pAct, const ActionFactoryParameters& rFactoryParms, OutDevState& rState, const CanvasSharedPtr& rCanvas );
double setFont(css::rendering::FontRequest& aFontRequest, sal_uInt8 fontObjectId, const ActionFactoryParameters& rParms, OutDevState& rState );
/// Render LineCap, like the start or end arrow of a polygon.
/// @return how much we should shorten the original polygon.
double EMFPPlusDrawLineCap(const ::basegfx::B2DPolygon& rPolygon, double fPolyLength,
const ::basegfx::B2DPolyPolygon& rLineCap, bool isFilled, bool bStart,
const css::rendering::StrokeAttributes& rAttributes,
const ActionFactoryParameters& rParms, OutDevState& rState);
void EMFPPlusDrawPolygon (const ::basegfx::B2DPolyPolygon & polygon, const ActionFactoryParameters& rParms, OutDevState& rState, const CanvasSharedPtr& rCanvas, sal_uInt32 penIndex);
void EMFPPlusFillPolygon (::basegfx::B2DPolyPolygon const & polygon, const ActionFactoryParameters& rParms, OutDevState& rState, const CanvasSharedPtr& rCanvas, bool isColor, sal_uInt32 brushIndexOrColor);
ActionVector maActions;
/* EMF+ */
......
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPBRUSH_HXX
#define INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPBRUSH_HXX
namespace cppcanvas
{
namespace internal
{
enum EmfPlusHatchStyle
{
HatchStyleHorizontal = 0x00000000,
HatchStyleVertical = 0x00000001,
HatchStyleForwardDiagonal = 0x00000002,
HatchStyleBackwardDiagonal = 0x00000003,
HatchStyleLargeGrid = 0x00000004,
HatchStyleDiagonalCross = 0x00000005,
HatchStyle05Percent = 0x00000006,
HatchStyle10Percent = 0x00000007,
HatchStyle20Percent = 0x00000008,
HatchStyle25Percent = 0x00000009,
HatchStyle30Percent = 0x0000000A,
HatchStyle40Percent = 0x0000000B,
HatchStyle50Percent = 0x0000000C,
HatchStyle60Percent = 0x0000000D,
HatchStyle70Percent = 0x0000000E,
HatchStyle75Percent = 0x0000000F,
HatchStyle80Percent = 0x00000010,
HatchStyle90Percent = 0x00000011,
HatchStyleLightDownwardDiagonal = 0x00000012,
HatchStyleLightUpwardDiagonal = 0x00000013,
HatchStyleDarkDownwardDiagonal = 0x00000014,
HatchStyleDarkUpwardDiagonal = 0x00000015,
HatchStyleWideDownwardDiagonal = 0x00000016,
HatchStyleWideUpwardDiagonal = 0x00000017,
HatchStyleLightVertical = 0x00000018,
HatchStyleLightHorizontal = 0x00000019,
HatchStyleNarrowVertical = 0x0000001A,
HatchStyleNarrowHorizontal = 0x0000001B,
HatchStyleDarkVertical = 0x0000001C,
HatchStyleDarkHorizontal = 0x0000001D,
HatchStyleDashedDownwardDiagonal = 0x0000001E,
HatchStyleDashedUpwardDiagonal = 0x0000001F,
HatchStyleDashedHorizontal = 0x00000020,
HatchStyleDashedVertical = 0x00000021,
HatchStyleSmallConfetti = 0x00000022,
HatchStyleLargeConfetti = 0x00000023,
HatchStyleZigZag = 0x00000024,
HatchStyleWave = 0x00000025,
HatchStyleDiagonalBrick = 0x00000026,
HatchStyleHorizontalBrick = 0x00000027,
HatchStyleWeave = 0x00000028,
HatchStylePlaid = 0x00000029,
HatchStyleDivot = 0x0000002A,
HatchStyleDottedGrid = 0x0000002B,
HatchStyleDottedDiamond = 0x0000002C,
HatchStyleShingle = 0x0000002D,
HatchStyleTrellis = 0x0000002E,
HatchStyleSphere = 0x0000002F,
HatchStyleSmallGrid = 0x00000030,
HatchStyleSmallCheckerBoard = 0x00000031,
HatchStyleLargeCheckerBoard = 0x00000032,
HatchStyleOutlinedDiamond = 0x00000033,
HatchStyleSolidDiamond = 0x00000034
};
enum EmfPlusBrushType
{
BrushTypeSolidColor = 0x00000000,
BrushTypeHatchFill = 0x00000001,
BrushTypeTextureFill = 0x00000002,
BrushTypePathGradient = 0x00000003,
BrushTypeLinearGradient = 0x00000004
};
struct EMFPPath;
struct EMFPBrush : public EMFPObject
{
::Color solidColor;
sal_uInt32 type;
sal_uInt32 additionalFlags;
/* linear gradient */
sal_Int32 wrapMode;
float areaX, areaY, areaWidth, areaHeight;
::Color secondColor; // first color is stored in solidColor;
XForm brush_transformation;
bool hasTransformation;
sal_Int32 blendPoints;
std::unique_ptr<float[]> blendPositions;
float* blendFactors;
sal_Int32 colorblendPoints;
std::unique_ptr<float[]> colorblendPositions;
std::unique_ptr<::Color[]> colorblendColors;
sal_Int32 surroundColorsNumber;
std::unique_ptr<::Color[]> surroundColors;
std::unique_ptr<EMFPPath> path;
EmfPlusHatchStyle hatchStyle;
EMFPBrush();
virtual ~EMFPBrush() override;
sal_uInt32 GetType() const { return type; }
const ::Color& GetColor() const { return solidColor; }
void Read(SvStream& s, ImplRenderer const & rR);
};
}
}
#endif // INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPBRUSH_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <com/sun/star/rendering/PathCapType.hpp>
#include <com/sun/star/rendering/PathJoinType.hpp>
#include <com/sun/star/rendering/TexturingMode.hpp>
#include <com/sun/star/rendering/XCanvas.hpp>
#include <basegfx/utils/canvastools.hxx>
#include <basegfx/utils/gradienttools.hxx>
#include <basegfx/utils/tools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dsize.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2drectangle.hxx>
#include <basegfx/polygon/b2dlinegeometry.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <sal/log.hxx>
#include <vcl/canvastools.hxx>
#include <implrenderer.hxx>
#include "emfpcustomlinecap.hxx"
#include "emfppath.hxx"
#include "emfppen.hxx"
using namespace ::com::sun::star;
using namespace ::basegfx;
namespace cppcanvas
{
namespace internal
{
const sal_uInt32 EmfPlusCustomLineCapDataTypeDefault = 0x00000000;
const sal_uInt32 EmfPlusCustomLineCapDataTypeAdjustableArrow = 0x00000001;
const sal_uInt32 EmfPlusCustomLineCapDataFillPath = 0x00000001;
const sal_uInt32 EmfPlusCustomLineCapDataLinePath = 0x00000002;
EMFPCustomLineCap::EMFPCustomLineCap()
: EMFPObject()
, type(0)
, strokeStartCap(0)
, strokeEndCap(0)
, strokeJoin(0)
, miterLimit(0.0)
, mbIsFilled(false)
{
}
void EMFPCustomLineCap::SetAttributes(rendering::StrokeAttributes& aAttributes)
{
aAttributes.StartCapType = EMFPPen::lcl_convertStrokeCap(strokeStartCap);
aAttributes.EndCapType = EMFPPen::lcl_convertStrokeCap(strokeEndCap);
aAttributes.JoinType = EMFPPen::lcl_convertLineJoinType(strokeJoin);
aAttributes.MiterLimit = miterLimit;
}
void EMFPCustomLineCap::ReadPath(SvStream& s, ImplRenderer const & rR, bool bFill)
{
sal_Int32 pathLength;
s.ReadInt32(pathLength);
SAL_INFO("cppcanvas.emf", "EMF+\t\tpath length: " << pathLength);
sal_uInt32 pathHeader;
sal_Int32 pathPoints, pathFlags;
s.ReadUInt32(pathHeader).ReadInt32(pathPoints).ReadInt32(pathFlags);
SAL_INFO("cppcanvas.emf", "EMF+\t\tpath (custom cap line path)");
SAL_INFO("cppcanvas.emf", "EMF+\t\theader: 0x" << std::hex << pathHeader << " points: " << std::dec << pathPoints << " additional flags: 0x" << std::hex << pathFlags << std::dec);
EMFPPath path(pathPoints);
path.Read(s, pathFlags, rR);
polygon = path.GetPolygon(rR, false);
mbIsFilled = bFill;
// transformation to convert the path to what LibreOffice
// expects
B2DHomMatrix aMatrix;
aMatrix.scale(1.0, -1.0);
polygon.transform(aMatrix);
};
void EMFPCustomLineCap::Read(SvStream& s, ImplRenderer const & rR)
{
sal_uInt32 header;
s.ReadUInt32(header).ReadUInt32(type);
SAL_INFO("cppcanvas.emf", "EMF+\t\tcustom cap");
SAL_INFO("cppcanvas.emf", "EMF+\t\theader: 0x" << std::hex << header << " type: " << type << std::dec);
if (type == EmfPlusCustomLineCapDataTypeDefault)
{
sal_uInt32 customLineCapDataFlags, baseCap;
float baseInset;
float widthScale;
float fillHotSpotX, fillHotSpotY, strokeHotSpotX, strokeHotSpotY;
s.ReadUInt32(customLineCapDataFlags).ReadUInt32(baseCap).ReadFloat(baseInset)
.ReadUInt32(strokeStartCap).ReadUInt32(strokeEndCap).ReadUInt32(strokeJoin)
.ReadFloat(miterLimit).ReadFloat(widthScale)
.ReadFloat(fillHotSpotX).ReadFloat(fillHotSpotY).ReadFloat(strokeHotSpotX).ReadFloat(strokeHotSpotY);
SAL_INFO("cppcanvas.emf", "EMF+\t\tcustomLineCapDataFlags: 0x" << std::hex << customLineCapDataFlags);
SAL_INFO("cppcanvas.emf", "EMF+\t\tbaseCap: 0x" << std::hex << baseCap);
SAL_INFO("cppcanvas.emf", "EMF+\t\tbaseInset: " << baseInset);
SAL_INFO("cppcanvas.emf", "EMF+\t\tstrokeStartCap: 0x" << std::hex << strokeStartCap);
SAL_INFO("cppcanvas.emf", "EMF+\t\tstrokeEndCap: 0x" << std::hex << strokeEndCap);
SAL_INFO("cppcanvas.emf", "EMF+\t\tstrokeJoin: 0x" << std::hex << strokeJoin);
SAL_INFO("cppcanvas.emf", "EMF+\t\tmiterLimit: " << miterLimit);
SAL_INFO("cppcanvas.emf", "EMF+\t\twidthScale: " << widthScale);
if (customLineCapDataFlags & EmfPlusCustomLineCapDataFillPath)
{
ReadPath(s, rR, true);
}
if (customLineCapDataFlags & EmfPlusCustomLineCapDataLinePath)
{
ReadPath(s, rR, false);
}
}
else if (type == EmfPlusCustomLineCapDataTypeAdjustableArrow)
{
// TODO only reads the data, does not use them [I've had
// no test document to be able to implement it]
sal_Int32 width, height, middleInset, fillState, lineStartCap;
sal_Int32 lineEndCap, lineJoin, widthScale;
float fillHotSpotX, fillHotSpotY, lineHotSpotX, lineHotSpotY;
s.ReadInt32(width).ReadInt32(height).ReadInt32(middleInset).ReadInt32(fillState).ReadInt32(lineStartCap)
.ReadInt32(lineEndCap).ReadInt32(lineJoin).ReadFloat(miterLimit).ReadInt32(widthScale)
.ReadFloat(fillHotSpotX).ReadFloat(fillHotSpotY).ReadFloat(lineHotSpotX).ReadFloat(lineHotSpotY);
SAL_INFO("cppcanvas.emf", "EMF+\t\tTODO - actually read EmfPlusCustomLineCapArrowData object (section 2.2.2.12)");
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPCUSTOMLINECAP_HXX
#define INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPCUSTOMLINECAP_HXX
namespace cppcanvas
{
namespace internal
{
struct EMFPCustomLineCap : public EMFPObject
{
sal_uInt32 type;
sal_uInt32 strokeStartCap, strokeEndCap, strokeJoin;
float miterLimit;
basegfx::B2DPolyPolygon polygon;
bool mbIsFilled;
EMFPCustomLineCap();
void SetAttributes(com::sun::star::rendering::StrokeAttributes& aAttributes);
void ReadPath(SvStream& s, ImplRenderer const & rR, bool bFill);
void Read(SvStream& s, ImplRenderer const & rR);
};
}
}
#endif // INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPCUSTOMLINECAP_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <com/sun/star/rendering/PathCapType.hpp>
#include <com/sun/star/rendering/PathJoinType.hpp>
#include <com/sun/star/rendering/TexturingMode.hpp>
#include <com/sun/star/rendering/XCanvas.hpp>
#include <basegfx/utils/canvastools.hxx>
#include <basegfx/utils/gradienttools.hxx>
#include <basegfx/utils/tools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dsize.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2drectangle.hxx>
#include <basegfx/polygon/b2dlinegeometry.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <sal/log.hxx>
#include <vcl/canvastools.hxx>
#include <implrenderer.hxx>
#include "emfpfont.hxx"
namespace cppcanvas
{
namespace internal
{
void EMFPFont::Read(SvMemoryStream &s)
{
sal_uInt32 header;
sal_uInt32 reserved;
sal_uInt32 length;
s.ReadUInt32(header).ReadFloat(emSize).ReadUInt32(sizeUnit).ReadInt32(fontFlags).ReadUInt32(reserved).ReadUInt32(length);
SAL_WARN_IF((header >> 12) != 0xdbc01, "cppcanvas.emf", "Invalid header - not 0xdbc01");
SAL_INFO("cppcanvas.emf", "EMF+\tfont\nEMF+\theader: 0x" << std::hex << (header >> 12) << " version: 0x" << (header & 0x1fff) << " size: " << std::dec << emSize << " unit: 0x" << std::hex << sizeUnit << std::dec);
SAL_INFO("cppcanvas.emf", "EMF+\tflags: 0x" << std::hex << fontFlags << " reserved: 0x" << reserved << " length: 0x" << std::hex << length << std::dec);
if (length > 0 && length < 0x4000)
{
rtl_uString *pStr = rtl_uString_alloc(length);
sal_Unicode *chars = pStr->buffer;
for (sal_uInt32 i = 0; i < length; ++i)
s.ReadUtf16(chars[i]);
family = OUString(pStr, SAL_NO_ACQUIRE);
SAL_INFO("cppcanvas.emf", "EMF+\tfamily: " << family);
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPFONT_HXX
#define INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPFONT_HXX
namespace cppcanvas
{
namespace internal
{
struct EMFPFont : public EMFPObject
{
float emSize;
sal_uInt32 sizeUnit;
sal_Int32 fontFlags;
OUString family;
void Read(SvMemoryStream &s);
};
}
}
#endif // INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPFONT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <com/sun/star/rendering/PathCapType.hpp>
#include <com/sun/star/rendering/PathJoinType.hpp>
#include <com/sun/star/rendering/TexturingMode.hpp>
#include <com/sun/star/rendering/XCanvas.hpp>
#include <basegfx/utils/canvastools.hxx>
#include <basegfx/utils/gradienttools.hxx>
#include <basegfx/utils/tools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dsize.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2drectangle.hxx>
#include <basegfx/polygon/b2dlinegeometry.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <vcl/canvastools.hxx>
#include <implrenderer.hxx>
#include <vcl/graphicfilter.hxx>
#include "emfpimage.hxx"
#include <sal/log.hxx>
namespace cppcanvas
{
namespace internal
{
void EMFPImage::Read(SvMemoryStream &s, sal_uInt32 dataSize, bool bUseWholeStream)
{
sal_uInt32 header, bitmapType;
s.ReadUInt32(header).ReadUInt32(type);
SAL_INFO("cppcanvas.emf", "EMF+\timage\nEMF+\theader: 0x" << std::hex << header << " type: " << type << std::dec);
if (type == 1) { // bitmap
s.ReadInt32(width).ReadInt32(height).ReadInt32(stride).ReadInt32(pixelFormat).ReadUInt32(bitmapType);
SAL_INFO("cppcanvas.emf", "EMF+\tbitmap width: " << width << " height: " << height << " stride: " << stride << " pixelFormat: 0x" << std::hex << pixelFormat << std::dec);
if ((bitmapType != 0) || (width == 0)) { // non native formats
GraphicFilter filter;
filter.ImportGraphic(graphic, OUString(), s);
SAL_INFO("cppcanvas.emf", "EMF+\tbitmap width: " << graphic.GetSizePixel().Width() << " height: " << graphic.GetSizePixel().Height());
}
}
else if (type == 2) { // metafile
sal_Int32 mfType, mfSize;
s.ReadInt32(mfType).ReadInt32(mfSize);
if (bUseWholeStream)
dataSize = s.remainingSize();
else
dataSize -= 16;
SAL_INFO("cppcanvas.emf", "EMF+\tmetafile type: " << mfType << " dataSize: " << mfSize << " real size calculated from record dataSize: " << dataSize);
GraphicFilter filter;
// workaround buggy metafiles, which have wrong mfSize set (n#705956 for example)
SvMemoryStream mfStream(const_cast<char *>(static_cast<char const *>(s.GetData()) + s.Tell()), dataSize, StreamMode::READ);
filter.ImportGraphic(graphic, OUString(), mfStream);
// debug code - write the stream to debug file /tmp/emf-stream.emf
#if OSL_DEBUG_LEVEL > 1
mfStream.Seek(0);
static sal_Int32 emfp_debug_stream_number = 0;
OUString emfp_debug_filename = "/tmp/emf-embedded-stream" +
OUString::number(emfp_debug_stream_number++) + ".emf";
SvFileStream file(emfp_debug_filename, StreamMode::WRITE | StreamMode::TRUNC);
mfStream.WriteStream(file);
file.Flush();
file.Close();
#endif
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPIMAGE_HXX
#define INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPIMAGE_HXX
namespace cppcanvas
{
namespace internal
{
struct EMFPImage : public EMFPObject
{
sal_uInt32 type;
sal_Int32 width;
sal_Int32 height;
sal_Int32 stride;
sal_Int32 pixelFormat;
Graphic graphic;
void Read(SvMemoryStream &s, sal_uInt32 dataSize, bool bUseWholeStream);
};
}
}
#endif // INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPIMAGE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <com/sun/star/rendering/PathCapType.hpp>
#include <com/sun/star/rendering/PathJoinType.hpp>
#include <com/sun/star/rendering/TexturingMode.hpp>
#include <com/sun/star/rendering/XCanvas.hpp>
#include <basegfx/utils/canvastools.hxx>
#include <basegfx/utils/gradienttools.hxx>
#include <basegfx/utils/tools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dsize.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2drectangle.hxx>
#include <basegfx/polygon/b2dlinegeometry.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <sal/log.hxx>
#include <vcl/canvastools.hxx>
#include <implrenderer.hxx>
#include "emfppath.hxx"
using namespace ::com::sun::star;
using namespace ::basegfx;
namespace cppcanvas
{
namespace internal
{
EMFPPath::EMFPPath (sal_Int32 _nPoints, bool bLines)
{
if( _nPoints<0 || sal_uInt32(_nPoints)>SAL_MAX_INT32/(2*sizeof(float)) )
_nPoints = SAL_MAX_INT32/(2*sizeof(float));
nPoints = _nPoints;
pPoints.reset( new float [nPoints*2] );
if (!bLines)
pPointTypes.reset( new sal_uInt8 [_nPoints] );
}
EMFPPath::~EMFPPath ()
{
}
// TODO: remove rR argument when debug code is no longer needed
void EMFPPath::Read (SvStream& s, sal_uInt32 pathFlags, ImplRenderer const & rR)
{
for (int i = 0; i < nPoints; i ++) {
if (pathFlags & 0x800) {
// EMFPlusPointR: points are stored in EMFPlusInteger7 or
// EMFPlusInteger15 objects, see section 2.2.2.21/22
// If 0x800 bit is set, the 0x4000 bit is undefined and must be ignored
SAL_WARN("cppcanvas.emf", "EMF+\t\t TODO - parse EMFPlusPointR object (section 2.2.1.6)");
} else if (pathFlags & 0x4000) {
// EMFPlusPoint: stored in signed short 16bit integer format
sal_Int16 x, y;
s.ReadInt16( x ).ReadInt16( y );
SAL_INFO ("cppcanvas.emf", "EMF+\t EMFPlusPoint [x,y]: " << x << "," << y);
pPoints [i*2] = x;
pPoints [i*2 + 1] = y;
} else {
// EMFPlusPointF: stored in Single (float) format
s.ReadFloat( pPoints [i*2] ).ReadFloat( pPoints [i*2 + 1] );
SAL_INFO ("cppcanvas.emf", "EMF+\t EMFPlusPointF [x,y]: " << pPoints [i*2] << "," << pPoints [i*2 + 1]);
}
}
if (pPointTypes)
for (int i = 0; i < nPoints; i ++) {
s.ReadUChar( pPointTypes [i] );
SAL_INFO ("cppcanvas.emf", "EMF+\tpoint type: " << static_cast<int>(pPointTypes [i]));
}
aPolygon.clear ();
#if OSL_DEBUG_LEVEL > 1
const ::basegfx::B2DRectangle aBounds (::basegfx::utils::getRange (GetPolygon (rR)));
SAL_INFO ("cppcanvas.emf",
"EMF+\tpolygon bounding box: " << aBounds.getMinX () << "," << aBounds.getMinY () << aBounds.getWidth () << "x" << aBounds.getHeight () << " (mapped)");
#else
(void) rR; // avoid warnings
#endif
}
::basegfx::B2DPolyPolygon& EMFPPath::GetPolygon (ImplRenderer const & rR, bool bMapIt, bool bAddLineToCloseShape)
{
::basegfx::B2DPolygon polygon;
aPolygon.clear ();
int last_normal = 0, p = 0;
::basegfx::B2DPoint prev, mapped;
bool hasPrev = false;
for (int i = 0; i < nPoints; i ++) {
if (p && pPointTypes && (pPointTypes [i] == 0)) {
aPolygon.append (polygon);
last_normal = i;
p = 0;
polygon.clear ();
}
if (bMapIt)
mapped = rR.Map (pPoints [i*2], pPoints [i*2 + 1]);
else
mapped = ::basegfx::B2DPoint (pPoints [i*2], pPoints [i*2 + 1]);
if (pPointTypes) {
if ((pPointTypes [i] & 0x07) == 3) {
if (((i - last_normal )% 3) == 1) {
polygon.setNextControlPoint (p - 1, mapped);
SAL_INFO ("cppcanvas.emf", "polygon append next: " << p - 1 << " mapped: " << mapped.getX () << "," << mapped.getY ());
continue;
} else if (((i - last_normal) % 3) == 2) {
prev = mapped;
hasPrev = true;
continue;
}
} else
last_normal = i;
}
polygon.append (mapped);
SAL_INFO ("cppcanvas.emf", "polygon append point: " << pPoints [i*2] << "," << pPoints [i*2 + 1] << " mapped: " << mapped.getX () << ":" << mapped.getY ());
if (hasPrev) {
polygon.setPrevControlPoint (p, prev);
SAL_INFO ("cppcanvas.emf", "polygon append prev: " << p << " mapped: " << prev.getX () << "," << prev.getY ());
hasPrev = false;
}
p ++;
if (pPointTypes && (pPointTypes [i] & 0x80)) { // closed polygon
polygon.setClosed (true);
aPolygon.append (polygon);
SAL_INFO ("cppcanvas.emf", "close polygon");
last_normal = i + 1;
p = 0;
polygon.clear ();
}
}
// Draw an extra line between the last point and the first point, to close the shape.
if (bAddLineToCloseShape) {
if (bMapIt)
polygon.append (rR.Map (pPoints [0], pPoints [1]) );
else
polygon.append (::basegfx::B2DPoint (pPoints [0], pPoints [1]) );
}
if (polygon.count ()) {
aPolygon.append (polygon);
#if OSL_DEBUG_LEVEL > 1
for (unsigned int i=0; i<aPolygon.count(); i++) {
polygon = aPolygon.getB2DPolygon(i);
SAL_INFO ("cppcanvas.emf", "polygon: " << i);
for (unsigned int j=0; j<polygon.count(); j++) {
::basegfx::B2DPoint point = polygon.getB2DPoint(j);
SAL_INFO ("cppcanvas.emf", "point: " << point.getX() << "," << point.getY());
if (polygon.isPrevControlPointUsed(j)) {
point = polygon.getPrevControlPoint(j);
SAL_INFO ("cppcanvas.emf", "prev: " << point.getX() << "," << point.getY());
}
if (polygon.isNextControlPointUsed(j)) {
point = polygon.getNextControlPoint(j);
SAL_INFO ("cppcanvas.emf", "next: " << point.getX() << "," << point.getY());
}
}
}
#endif
}
return aPolygon;
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPPATH_HXX
#define INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPPATH_HXX
#include <memory>
namespace cppcanvas
{
namespace internal
{
struct EMFPPath : public EMFPObject
{
::basegfx::B2DPolyPolygon aPolygon;
sal_Int32 nPoints;
std::unique_ptr<float[]> pPoints;
std::unique_ptr<sal_uInt8[]> pPointTypes;
EMFPPath(sal_Int32 _nPoints, bool bLines = false);
virtual ~EMFPPath() override;
// TODO: remove rR argument when debug code is no longer needed
void Read(SvStream& s, sal_uInt32 pathFlags, ImplRenderer const & rR);
::basegfx::B2DPolyPolygon& GetPolygon(ImplRenderer const & rR, bool bMapIt = true, bool bAddLineToCloseShape = false);
};
}
}
#endif // INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPPATH_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPPEN_HXX
#define INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPPEN_HXX
#include "emfpbrush.hxx"
#include <vector>
namespace cppcanvas
{
namespace internal
{
const sal_uInt32 EmfPlusLineCapTypeSquare = 0x00000001;
const sal_uInt32 EmfPlusLineCapTypeRound = 0x00000002;
const sal_uInt32 EmfPlusLineJoinTypeMiter = 0x00000000;
const sal_uInt32 EmfPlusLineJoinTypeBevel = 0x00000001;
const sal_uInt32 EmfPlusLineJoinTypeRound = 0x00000002;
const sal_uInt32 EmfPlusLineJoinTypeMiterClipped = 0x00000003;
struct EMFPCustomLineCap;
struct EMFPPen : public EMFPBrush
{
XForm pen_transformation; //TODO: This isn't used
float penWidth;
sal_Int32 startCap;
sal_Int32 endCap;
sal_Int32 lineJoin;
float mitterLimit;
sal_Int32 dashStyle;
sal_Int32 dashCap;
float dashOffset;
std::vector<float> dashPattern;
sal_Int32 alignment;
std::vector<float> compoundArray;
sal_Int32 customStartCapLen;
std::unique_ptr<EMFPCustomLineCap> customStartCap;
sal_Int32 customEndCapLen;
std::unique_ptr<EMFPCustomLineCap> customEndCap;
EMFPPen();
virtual ~EMFPPen() override;
void SetStrokeWidth(com::sun::star::rendering::StrokeAttributes& rStrokeAttributes, ImplRenderer const & rR, const OutDevState& rState);
void SetStrokeAttributes(com::sun::star::rendering::StrokeAttributes& rStrokeAttributes);
void Read(SvStream& s, ImplRenderer const & rR);
static sal_Int8 lcl_convertStrokeCap(sal_uInt32 nEmfStroke);
static sal_Int8 lcl_convertLineJoinType(sal_uInt32 nEmfLineJoin);
};
}
}
#endif // INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPPEN_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <com/sun/star/rendering/PathCapType.hpp>
#include <com/sun/star/rendering/PathJoinType.hpp>
#include <com/sun/star/rendering/TexturingMode.hpp>
#include <com/sun/star/rendering/XCanvas.hpp>
#include <basegfx/utils/canvastools.hxx>
#include <basegfx/utils/gradienttools.hxx>
#include <basegfx/utils/tools.hxx>
#include <basegfx/numeric/ftools.hxx>
#include <basegfx/point/b2dpoint.hxx>
#include <basegfx/vector/b2dsize.hxx>
#include <basegfx/range/b2drange.hxx>
#include <basegfx/range/b2drectangle.hxx>
#include <basegfx/polygon/b2dlinegeometry.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <sal/log.hxx>
#include <vcl/canvastools.hxx>
#include <implrenderer.hxx>
#include "emfpregion.hxx"
using namespace ::com::sun::star;
using namespace ::basegfx;
namespace cppcanvas
{
namespace internal
{
EMFPRegion::EMFPRegion()
: parts(0)
, initialState(0)
{
}
EMFPRegion::~EMFPRegion()
{
}
void EMFPRegion::Read(SvStream& s)
{
sal_uInt32 header;
s.ReadUInt32(header).ReadInt32(parts);
SAL_INFO("cppcanvas.emf", "EMF+\tregion");
SAL_INFO("cppcanvas.emf", "EMF+\theader: 0x" << std::hex << header << " parts: " << parts << std::dec);
if (parts) {
if (parts<0 || sal_uInt32(parts)>SAL_MAX_INT32 / sizeof(sal_Int32))
parts = SAL_MAX_INT32 / sizeof(sal_Int32);
combineMode.reset( new sal_Int32[parts] );
for (int i = 0; i < parts; i++) {
s.ReadInt32(combineMode[i]);
SAL_INFO("cppcanvas.emf", "EMF+\tcombine mode [" << i << "]: 0x" << std::hex << combineMode[i] << std::dec);
}
}
s.ReadInt32(initialState);
SAL_INFO("cppcanvas.emf", "EMF+\tinitial state: 0x" << std::hex << initialState << std::dec);
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPREGION_HXX
#define INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPREGION_HXX
namespace cppcanvas
{
namespace internal
{
struct EMFPRegion : public EMFPObject
{
sal_Int32 parts;
std::unique_ptr<sal_Int32[]> combineMode;
sal_Int32 initialState;
EMFPRegion();
virtual ~EMFPRegion() override;
void Read(SvStream& s);
};
}
}
#endif // INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPREGION_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <com/sun/star/rendering/XCanvas.hpp>
#include <vcl/canvastools.hxx>
#include <implrenderer.hxx>
#include <sal/log.hxx>
#include "emfpstringformat.hxx"
namespace cppcanvas
{
namespace internal
{
EMFPStringFormat::EMFPStringFormat()
: header(0)
, stringFormatFlags(0)
, language(0)
, stringAlignment(0)
, lineAlign(0)
, digitSubstitution(0)
, digitLanguage(0)
, firstTabOffset(0.0)
, hotkeyPrefix(0)
, leadingMargin(0.0)
, trailingMargin(0.0)
, tracking(0.0)
, trimming(0)
, tabStopCount(0)
, rangeCount(0)
{
}
void EMFPStringFormat::Read(SvMemoryStream &s)
{
s.ReadUInt32(header).ReadUInt32(stringFormatFlags).ReadUInt32(language);
s.ReadUInt32(stringAlignment).ReadUInt32(lineAlign).ReadUInt32(digitSubstitution).ReadUInt32(digitLanguage);
s.ReadFloat(firstTabOffset).ReadInt32(hotkeyPrefix).ReadFloat(leadingMargin).ReadFloat(trailingMargin).ReadFloat(tracking);
s.ReadInt32(trimming).ReadInt32(tabStopCount).ReadInt32(rangeCount);
SAL_WARN_IF((header >> 12) != 0xdbc01, "cppcanvas.emf", "Invalid header - not 0xdbc01");
SAL_INFO("cppcanvas.emf", "EMF+\t string format\nEMF+\theader: 0x" << std::hex << (header >> 12) << " version: 0x" << (header & 0x1fff) << " StringFormatFlags: " << std::dec << stringFormatFlags << " Language: " << language);
SAL_INFO("cppcanvas.emf", "EMF+\t StringAlignment: " << stringAlignment << " LineAlign: " << lineAlign << " DigitSubstitution: " << digitSubstitution << " DigitLanguage: " << digitLanguage);
SAL_INFO("cppcanvas.emf", "EMF+\t FirstTabOffset: " << firstTabOffset << " HotkeyPrefix: " << hotkeyPrefix << " LeadingMargin: " << leadingMargin << " TrailingMargin: " << trailingMargin << " Tracking: " << tracking);
SAL_INFO("cppcanvas.emf", "EMF+\t Trimming: " << trimming << " TabStopCount: " << tabStopCount << " RangeCount: " << rangeCount);
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPSTRINGFORMAT_HXX
#define INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPSTRINGFORMAT_HXX
namespace cppcanvas
{
namespace internal
{
struct EMFPStringFormat : public EMFPObject
{
sal_uInt32 header;
sal_uInt32 stringFormatFlags;
sal_uInt32 language;
sal_uInt32 stringAlignment;
sal_uInt32 lineAlign;
sal_uInt32 digitSubstitution;
sal_uInt32 digitLanguage;
float firstTabOffset;
sal_Int32 hotkeyPrefix;
float leadingMargin;
float trailingMargin;
float tracking;
sal_Int32 trimming;
sal_Int32 tabStopCount;
sal_Int32 rangeCount;
EMFPStringFormat();
void Read(SvMemoryStream &s);
};
}
}
#endif // INCLUDED_CPPCANVAS_SOURCE_MTFRENDERER_EMFPSTRINGFORMAT_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -1789,18 +1789,7 @@ namespace cppcanvas
}
// Handle drawing layer fills
else if( pAct->GetComment() == "EMF_PLUS" ) {
static int count = -1, limit = 0x7fffffff;
if (count == -1) {
count = 0;
if (char *env = getenv ("EMF_PLUS_LIMIT")) {
limit = atoi (env);
SAL_INFO ("cppcanvas.emf", "EMF+ records limit: " << limit);
}
}
SAL_INFO ("cppcanvas.emf", "EMF+ passed to canvas mtf renderer, size: " << pAct->GetDataSize ());
if (count < limit)
processEMFPlus( pAct, rFactoryParms, rStates.getState(), rCanvas );
count ++;
SAL_WARN ("cppcanvas.emf", "EMF+ code was refactored and removed");
} else if( pAct->GetComment() == "EMF_PLUS_HEADER_INFO" ) {
SAL_INFO ("cppcanvas.emf", "EMF+ passed to canvas mtf renderer - header info, size: " << pAct->GetDataSize ());
......
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