Kaydet (Commit) 7795907f authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:constmethod in drawinglayer

Change-Id: I6a33765f6589fc2941162eb2dcaa4e0a2d9e46e1
Reviewed-on: https://gerrit.libreoffice.org/44214Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 0d4891b6
...@@ -195,9 +195,9 @@ namespace cppcanvas ...@@ -195,9 +195,9 @@ namespace cppcanvas
/* EMF+ */ /* EMF+ */
static void ReadRectangle (SvStream& s, float& x, float& y, float &width, float& height, bool bCompressed = false); 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); static void ReadPoint (SvStream& s, float& x, float& y, sal_uInt32 flags);
void MapToDevice (double &x, double &y); void MapToDevice (double &x, double &y) const;
::basegfx::B2DPoint Map (double ix, double iy); ::basegfx::B2DPoint Map (double ix, double iy) const;
::basegfx::B2DSize MapSize (double iwidth, double iheight); ::basegfx::B2DSize MapSize (double iwidth, double iheight) const;
void GraphicStatePush (GraphicStateMap& map, sal_Int32 index, OutDevState const & rState); void GraphicStatePush (GraphicStateMap& map, sal_Int32 index, OutDevState const & rState);
void GraphicStatePop (GraphicStateMap& map, sal_Int32 index, OutDevState& rState); void GraphicStatePop (GraphicStateMap& map, sal_Int32 index, OutDevState& rState);
......
...@@ -251,14 +251,14 @@ namespace cppcanvas ...@@ -251,14 +251,14 @@ namespace cppcanvas
s.ReadFloat( x ).ReadFloat( y ); s.ReadFloat( x ).ReadFloat( y );
} }
void ImplRenderer::MapToDevice (double& x, double& y) void ImplRenderer::MapToDevice (double& x, double& y) const
{ {
// TODO: other units // TODO: other units
x = 100*nMmX*x/nPixX; x = 100*nMmX*x/nPixX;
y = 100*nMmY*y/nPixY; y = 100*nMmY*y/nPixY;
} }
::basegfx::B2DPoint ImplRenderer::Map (double ix, double iy) ::basegfx::B2DPoint ImplRenderer::Map (double ix, double iy) const
{ {
double x, y; double x, y;
...@@ -276,7 +276,7 @@ namespace cppcanvas ...@@ -276,7 +276,7 @@ namespace cppcanvas
return ::basegfx::B2DPoint (x, y); return ::basegfx::B2DPoint (x, y);
} }
::basegfx::B2DSize ImplRenderer::MapSize (double iwidth, double iheight) ::basegfx::B2DSize ImplRenderer::MapSize (double iwidth, double iheight) const
{ {
double w, h; double w, h;
......
...@@ -75,7 +75,7 @@ namespace drawinglayer ...@@ -75,7 +75,7 @@ namespace drawinglayer
bool HitTestProcessor2D::checkHairlineHitWithTolerance( bool HitTestProcessor2D::checkHairlineHitWithTolerance(
const basegfx::B2DPolygon& rPolygon, const basegfx::B2DPolygon& rPolygon,
double fDiscreteHitTolerance) double fDiscreteHitTolerance) const
{ {
basegfx::B2DPolygon aLocalPolygon(rPolygon); basegfx::B2DPolygon aLocalPolygon(rPolygon);
aLocalPolygon.transform(getViewInformation2D().getObjectToViewTransformation()); aLocalPolygon.transform(getViewInformation2D().getObjectToViewTransformation());
...@@ -103,7 +103,7 @@ namespace drawinglayer ...@@ -103,7 +103,7 @@ namespace drawinglayer
bool HitTestProcessor2D::checkFillHitWithTolerance( bool HitTestProcessor2D::checkFillHitWithTolerance(
const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::B2DPolyPolygon& rPolyPolygon,
double fDiscreteHitTolerance) double fDiscreteHitTolerance) const
{ {
bool bRetval(false); bool bRetval(false);
basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolyPolygon); basegfx::B2DPolyPolygon aLocalPolyPolygon(rPolyPolygon);
......
...@@ -282,7 +282,7 @@ namespace drawinglayer ...@@ -282,7 +282,7 @@ namespace drawinglayer
void VclMetafileProcessor2D::impConvertFillGradientAttributeToVCLGradient( void VclMetafileProcessor2D::impConvertFillGradientAttributeToVCLGradient(
Gradient& o_rVCLGradient, Gradient& o_rVCLGradient,
const attribute::FillGradientAttribute& rFiGrAtt, const attribute::FillGradientAttribute& rFiGrAtt,
bool bIsTransparenceGradient) bool bIsTransparenceGradient) const
{ {
if(bIsTransparenceGradient) if(bIsTransparenceGradient)
{ {
......
...@@ -78,7 +78,7 @@ namespace drawinglayer ...@@ -78,7 +78,7 @@ namespace drawinglayer
void impConvertFillGradientAttributeToVCLGradient( void impConvertFillGradientAttributeToVCLGradient(
Gradient& o_rVCLGradient, Gradient& o_rVCLGradient,
const attribute::FillGradientAttribute& rFiGrAtt, const attribute::FillGradientAttribute& rFiGrAtt,
bool bIsTransparenceGradient); bool bIsTransparenceGradient) const;
void impStartSvtGraphicFill(SvtGraphicFill const * pSvtGraphicFill); void impStartSvtGraphicFill(SvtGraphicFill const * pSvtGraphicFill);
void impEndSvtGraphicFill(SvtGraphicFill* pSvtGraphicFill); void impEndSvtGraphicFill(SvtGraphicFill* pSvtGraphicFill);
SvtGraphicStroke* impTryToCreateSvtGraphicStroke( SvtGraphicStroke* impTryToCreateSvtGraphicStroke(
......
...@@ -317,7 +317,7 @@ namespace drawinglayer ...@@ -317,7 +317,7 @@ namespace drawinglayer
} }
} }
void DefaultProcessor3D::impRenderPolygonHairlinePrimitive3D(const primitive3d::PolygonHairlinePrimitive3D& rPrimitive) void DefaultProcessor3D::impRenderPolygonHairlinePrimitive3D(const primitive3d::PolygonHairlinePrimitive3D& rPrimitive) const
{ {
basegfx::B3DPolygon aHairline(rPrimitive.getB3DPolygon()); basegfx::B3DPolygon aHairline(rPrimitive.getB3DPolygon());
...@@ -342,7 +342,7 @@ namespace drawinglayer ...@@ -342,7 +342,7 @@ namespace drawinglayer
} }
} }
void DefaultProcessor3D::impRenderPolyPolygonMaterialPrimitive3D(const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive) void DefaultProcessor3D::impRenderPolyPolygonMaterialPrimitive3D(const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive) const
{ {
basegfx::B3DPolyPolygon aFill(rPrimitive.getB3DPolyPolygon()); basegfx::B3DPolyPolygon aFill(rPrimitive.getB3DPolyPolygon());
basegfx::BColor aObjectColor(rPrimitive.getMaterial().getColor()); basegfx::BColor aObjectColor(rPrimitive.getMaterial().getColor());
......
...@@ -101,7 +101,7 @@ private: ...@@ -101,7 +101,7 @@ private:
} }
} }
double decideColorAndOpacity(basegfx::BColor& rColor) double decideColorAndOpacity(basegfx::BColor& rColor) const
{ {
// init values with full opacity and material color // init values with full opacity and material color
OSL_ENSURE(nullptr != mpCurrentMaterial, "CurrentMaterial not set (!)"); OSL_ENSURE(nullptr != mpCurrentMaterial, "CurrentMaterial not set (!)");
......
...@@ -33,10 +33,10 @@ namespace emfplushelper ...@@ -33,10 +33,10 @@ namespace emfplushelper
void Read(SvMemoryStream &s); void Read(SvMemoryStream &s);
bool Bold() { return fontFlags & 0x1; } bool Bold() const { return fontFlags & 0x1; }
bool Italic() { return fontFlags & 0x2; } bool Italic() const { return fontFlags & 0x2; }
bool Underline(){ return fontFlags & 0x4; } bool Underline() const { return fontFlags & 0x4; }
bool Strikeout(){ return fontFlags & 0x8; } bool Strikeout() const { return fontFlags & 0x8; }
}; };
} }
......
...@@ -283,19 +283,19 @@ namespace emfplushelper ...@@ -283,19 +283,19 @@ namespace emfplushelper
maMapTransform *= basegfx::utils::createScaleB2DHomMatrix(maBaseTransform.get(0, 0), maBaseTransform.get(1, 1)); maMapTransform *= basegfx::utils::createScaleB2DHomMatrix(maBaseTransform.get(0, 0), maBaseTransform.get(1, 1));
} }
::basegfx::B2DPoint EmfPlusHelperData::Map(double ix, double iy) ::basegfx::B2DPoint EmfPlusHelperData::Map(double ix, double iy) const
{ {
// map in one step using complete MapTransform (see mappingChanged) // map in one step using complete MapTransform (see mappingChanged)
return maMapTransform * ::basegfx::B2DPoint(ix, iy); return maMapTransform * ::basegfx::B2DPoint(ix, iy);
} }
::basegfx::B2DSize EmfPlusHelperData::MapSize(double iwidth, double iheight) ::basegfx::B2DSize EmfPlusHelperData::MapSize(double iwidth, double iheight) const
{ {
// map in one step using complete MapTransform (see mappingChanged) // map in one step using complete MapTransform (see mappingChanged)
return maMapTransform * ::basegfx::B2DSize(iwidth, iheight); return maMapTransform * ::basegfx::B2DSize(iwidth, iheight);
} }
::basegfx::BColor EmfPlusHelperData::EMFPGetBrushColorOrARGBColor(sal_uInt16 flags, sal_uInt32 brushIndexOrColor){ ::basegfx::BColor EmfPlusHelperData::EMFPGetBrushColorOrARGBColor(sal_uInt16 flags, sal_uInt32 brushIndexOrColor) const {
basegfx::BColor color; basegfx::BColor color;
if (flags & 0x8000) // we use a color if (flags & 0x8000) // we use a color
{ {
......
...@@ -241,7 +241,7 @@ namespace emfplushelper ...@@ -241,7 +241,7 @@ namespace emfplushelper
void EMFPPlusFillPolygon(const ::basegfx::B2DPolyPolygon& polygon, bool isColor, sal_uInt32 brushIndexOrColor); void EMFPPlusFillPolygon(const ::basegfx::B2DPolyPolygon& polygon, bool isColor, sal_uInt32 brushIndexOrColor);
// helper functions // helper functions
::basegfx::BColor EMFPGetBrushColorOrARGBColor(sal_uInt16 flags, sal_uInt32 brushIndexOrColor); ::basegfx::BColor EMFPGetBrushColorOrARGBColor(sal_uInt16 flags, sal_uInt32 brushIndexOrColor) const;
public: public:
EmfPlusHelperData( EmfPlusHelperData(
...@@ -255,8 +255,8 @@ namespace emfplushelper ...@@ -255,8 +255,8 @@ namespace emfplushelper
const drawinglayer::geometry::ViewInformation2D& rViewInformation); const drawinglayer::geometry::ViewInformation2D& rViewInformation);
// mappers // mappers
::basegfx::B2DPoint Map(double ix, double iy); ::basegfx::B2DPoint Map(double ix, double iy) const;
::basegfx::B2DSize MapSize(double iwidth, double iheight); ::basegfx::B2DSize MapSize(double iwidth, double iheight) const;
// readers // readers
static void ReadRectangle(SvStream& s, float& x, float& y, float &width, float& height, bool bCompressed = false); static void ReadRectangle(SvStream& s, float& x, float& y, float &width, float& height, bool bCompressed = false);
......
...@@ -46,16 +46,16 @@ namespace emfplushelper ...@@ -46,16 +46,16 @@ namespace emfplushelper
void Read(SvMemoryStream &s); void Read(SvMemoryStream &s);
// flags table from MS-EMFPLUS doc // flags table from MS-EMFPLUS doc
bool DirectionRightToLeft() { return stringFormatFlags & 0x00000001;} bool DirectionRightToLeft() const { return stringFormatFlags & 0x00000001;}
bool DirectionVertical() { return stringFormatFlags & 0x00000002;} bool DirectionVertical() const { return stringFormatFlags & 0x00000002;}
bool NoFitBlackBox() { return stringFormatFlags & 0x00000004;} bool NoFitBlackBox() const { return stringFormatFlags & 0x00000004;}
bool DisplayFormatControl() { return stringFormatFlags & 0x00000020;} bool DisplayFormatControl() const { return stringFormatFlags & 0x00000020;}
bool NoFontFallback() { return stringFormatFlags & 0x00000400;} bool NoFontFallback() const { return stringFormatFlags & 0x00000400;}
bool MeasureTrailingSpaces(){ return stringFormatFlags & 0x00000800;} bool MeasureTrailingSpaces() const { return stringFormatFlags & 0x00000800;}
bool NoWrap() { return stringFormatFlags & 0x00001000;} bool NoWrap() const { return stringFormatFlags & 0x00001000;}
bool LineLimit() { return stringFormatFlags & 0x00002000;} bool LineLimit() const { return stringFormatFlags & 0x00002000;}
bool NoClip() { return stringFormatFlags & 0x00004000;} bool NoClip() const { return stringFormatFlags & 0x00004000;}
bool BypassGDI() { return stringFormatFlags & 0x80000000;} bool BypassGDI() const { return stringFormatFlags & 0x80000000;}
}; };
} }
......
...@@ -62,10 +62,10 @@ namespace drawinglayer ...@@ -62,10 +62,10 @@ namespace drawinglayer
void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) override; void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) override;
bool checkHairlineHitWithTolerance( bool checkHairlineHitWithTolerance(
const basegfx::B2DPolygon& rPolygon, const basegfx::B2DPolygon& rPolygon,
double fDiscreteHitTolerance); double fDiscreteHitTolerance) const;
bool checkFillHitWithTolerance( bool checkFillHitWithTolerance(
const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::B2DPolyPolygon& rPolyPolygon,
double fDiscreteHitTolerance); double fDiscreteHitTolerance) const;
void check3DHit(const primitive2d::ScenePrimitive2D& rCandidate); void check3DHit(const primitive2d::ScenePrimitive2D& rCandidate);
public: public:
......
...@@ -107,8 +107,8 @@ namespace drawinglayer ...@@ -107,8 +107,8 @@ namespace drawinglayer
void impRenderHatchTexturePrimitive3D(const primitive3d::HatchTexturePrimitive3D& rPrimitive); void impRenderHatchTexturePrimitive3D(const primitive3d::HatchTexturePrimitive3D& rPrimitive);
void impRenderBitmapTexturePrimitive3D(const primitive3d::BitmapTexturePrimitive3D& rPrimitive); void impRenderBitmapTexturePrimitive3D(const primitive3d::BitmapTexturePrimitive3D& rPrimitive);
void impRenderModifiedColorPrimitive3D(const primitive3d::ModifiedColorPrimitive3D& rModifiedCandidate); void impRenderModifiedColorPrimitive3D(const primitive3d::ModifiedColorPrimitive3D& rModifiedCandidate);
void impRenderPolygonHairlinePrimitive3D(const primitive3d::PolygonHairlinePrimitive3D& rPrimitive); void impRenderPolygonHairlinePrimitive3D(const primitive3d::PolygonHairlinePrimitive3D& rPrimitive) const;
void impRenderPolyPolygonMaterialPrimitive3D(const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive); void impRenderPolyPolygonMaterialPrimitive3D(const primitive3d::PolyPolygonMaterialPrimitive3D& rPrimitive) const;
void impRenderTransformPrimitive3D(const primitive3d::TransformPrimitive3D& rTransformCandidate); void impRenderTransformPrimitive3D(const primitive3d::TransformPrimitive3D& rTransformCandidate);
......
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