summaryrefslogtreecommitdiff
path: root/cppcanvas
diff options
context:
space:
mode:
Diffstat (limited to 'cppcanvas')
-rw-r--r--cppcanvas/Library_cppcanvas.mk1
-rw-r--r--cppcanvas/source/inc/tools.hxx4
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx10
-rw-r--r--cppcanvas/source/tools/tools.cxx4
-rw-r--r--cppcanvas/source/wrapper/implcanvas.cxx6
-rw-r--r--cppcanvas/source/wrapper/implcanvas.hxx2
-rw-r--r--cppcanvas/source/wrapper/implcolor.cxx53
-rw-r--r--cppcanvas/source/wrapper/implcolor.hxx51
-rw-r--r--cppcanvas/source/wrapper/implpolypolygon.cxx6
-rw-r--r--cppcanvas/source/wrapper/implpolypolygon.hxx6
10 files changed, 14 insertions, 129 deletions
diff --git a/cppcanvas/Library_cppcanvas.mk b/cppcanvas/Library_cppcanvas.mk
index 62611a4ee808..d60c75606fb3 100644
--- a/cppcanvas/Library_cppcanvas.mk
+++ b/cppcanvas/Library_cppcanvas.mk
@@ -71,7 +71,6 @@ $(eval $(call gb_Library_add_exception_objects,cppcanvas,\
cppcanvas/source/wrapper/implbitmap \
cppcanvas/source/wrapper/implbitmapcanvas \
cppcanvas/source/wrapper/implcanvas \
- cppcanvas/source/wrapper/implcolor \
cppcanvas/source/wrapper/implcustomsprite \
cppcanvas/source/wrapper/implfont \
cppcanvas/source/wrapper/implpolypolygon \
diff --git a/cppcanvas/source/inc/tools.hxx b/cppcanvas/source/inc/tools.hxx
index 80ded934203f..80a238881790 100644
--- a/cppcanvas/source/inc/tools.hxx
+++ b/cppcanvas/source/inc/tools.hxx
@@ -27,9 +27,9 @@ namespace cppcanvas
{
namespace tools
{
- css::uno::Sequence< double > intSRGBAToDoubleSequence( Color::IntSRGBA );
+ css::uno::Sequence< double > intSRGBAToDoubleSequence( IntSRGBA );
- Color::IntSRGBA doubleSequenceToIntSRGBA( const css::uno::Sequence< double >& rColor );
+ IntSRGBA doubleSequenceToIntSRGBA( const css::uno::Sequence< double >& rColor );
}
}
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index f5e59ed6359c..144246de2e2f 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -2902,14 +2902,12 @@ namespace cppcanvas
tools::calcLogic2PixelAffineTransform( aStateStack.getState().mapModeTransform,
*aVDev.get() );
- ColorSharedPtr pColor( getCanvas()->createColor() );
-
{
::cppcanvas::internal::OutDevState& rState = aStateStack.getState();
// setup default text color to black
rState.textColor =
rState.textFillColor =
- rState.textLineColor = pColor->getDeviceColor( 0x000000FF );
+ rState.textLineColor = tools::intSRGBAToDoubleSequence( 0x000000FF );
}
// apply overrides from the Parameters struct
@@ -2917,13 +2915,13 @@ namespace cppcanvas
{
::cppcanvas::internal::OutDevState& rState = aStateStack.getState();
rState.isFillColorSet = true;
- rState.fillColor = pColor->getDeviceColor( *rParams.maFillColor );
+ rState.fillColor = tools::intSRGBAToDoubleSequence( *rParams.maFillColor );
}
if( rParams.maLineColor.is_initialized() )
{
::cppcanvas::internal::OutDevState& rState = aStateStack.getState();
rState.isLineColorSet = true;
- rState.lineColor = pColor->getDeviceColor( *rParams.maLineColor );
+ rState.lineColor = tools::intSRGBAToDoubleSequence( *rParams.maLineColor );
}
if( rParams.maTextColor.is_initialized() )
{
@@ -2932,7 +2930,7 @@ namespace cppcanvas
rState.isTextLineColorSet = true;
rState.textColor =
rState.textFillColor =
- rState.textLineColor = pColor->getDeviceColor( *rParams.maTextColor );
+ rState.textLineColor = tools::intSRGBAToDoubleSequence( *rParams.maTextColor );
}
if( rParams.maFontName.is_initialized() ||
rParams.maFontWeight.is_initialized() ||
diff --git a/cppcanvas/source/tools/tools.cxx b/cppcanvas/source/tools/tools.cxx
index 6bf9c55433c4..de0e0d1c5169 100644
--- a/cppcanvas/source/tools/tools.cxx
+++ b/cppcanvas/source/tools/tools.cxx
@@ -27,7 +27,7 @@ namespace cppcanvas
{
namespace tools
{
- uno::Sequence< double > intSRGBAToDoubleSequence( Color::IntSRGBA aColor )
+ uno::Sequence< double > intSRGBAToDoubleSequence( IntSRGBA aColor )
{
uno::Sequence< double > aRes( 4 );
@@ -39,7 +39,7 @@ namespace cppcanvas
return aRes;
}
- Color::IntSRGBA doubleSequenceToIntSRGBA( const uno::Sequence< double >& rColor )
+ IntSRGBA doubleSequenceToIntSRGBA( const uno::Sequence< double >& rColor )
{
return makeColor( static_cast<sal_uInt8>( 255*rColor[0] + .5 ),
static_cast<sal_uInt8>( 255*rColor[1] + .5 ),
diff --git a/cppcanvas/source/wrapper/implcanvas.cxx b/cppcanvas/source/wrapper/implcanvas.cxx
index 23d055e2b9f6..68a4cb28750c 100644
--- a/cppcanvas/source/wrapper/implcanvas.cxx
+++ b/cppcanvas/source/wrapper/implcanvas.cxx
@@ -29,7 +29,6 @@
#include <cppcanvas/polypolygon.hxx>
#include "implfont.hxx"
-#include "implcolor.hxx"
#include "implcanvas.hxx"
@@ -84,11 +83,6 @@ namespace cppcanvas
return !maClipPolyPolygon ? nullptr : &(*maClipPolyPolygon);
}
- ColorSharedPtr ImplCanvas::createColor() const
- {
- return ColorSharedPtr( new ImplColor( getUNOCanvas()->getDevice() ) );
- }
-
CanvasSharedPtr ImplCanvas::clone() const
{
return CanvasSharedPtr( new ImplCanvas( *this ) );
diff --git a/cppcanvas/source/wrapper/implcanvas.hxx b/cppcanvas/source/wrapper/implcanvas.hxx
index d1162d605ea4..b71f2311f67b 100644
--- a/cppcanvas/source/wrapper/implcanvas.hxx
+++ b/cppcanvas/source/wrapper/implcanvas.hxx
@@ -60,8 +60,6 @@ namespace cppcanvas
virtual void setClip() override;
virtual ::basegfx::B2DPolyPolygon const* getClip() const override;
- virtual ColorSharedPtr createColor() const override;
-
virtual CanvasSharedPtr clone() const override;
virtual void clear() const override;
diff --git a/cppcanvas/source/wrapper/implcolor.cxx b/cppcanvas/source/wrapper/implcolor.cxx
deleted file mode 100644
index a22fffe39c47..000000000000
--- a/cppcanvas/source/wrapper/implcolor.cxx
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- 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 <implcolor.hxx>
-#include <tools.hxx>
-#include <osl/diagnose.h>
-
-using namespace ::com::sun::star;
-
-namespace cppcanvas
-{
- namespace internal
- {
-
- ImplColor::ImplColor( const uno::Reference< rendering::XGraphicDevice >& rDevice ) :
- mxDevice( rDevice )
- {
- OSL_ENSURE( mxDevice.is(), "ImplColor::ImplColor(): Invalid graphic device" );
- }
-
- ImplColor::~ImplColor()
- {
- }
-
- uno::Sequence< double > ImplColor::getDeviceColor( Color::IntSRGBA aSRGBA ) const
- {
- OSL_ENSURE( mxDevice.is(), "ImplColor::getDeviceColor(): Invalid graphic device" );
-
- // TODO(F1): Color space handling
- return tools::intSRGBAToDoubleSequence( aSRGBA );
- }
-
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppcanvas/source/wrapper/implcolor.hxx b/cppcanvas/source/wrapper/implcolor.hxx
deleted file mode 100644
index a53834c3228c..000000000000
--- a/cppcanvas/source/wrapper/implcolor.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- 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_WRAPPER_IMPLCOLOR_HXX
-#define INCLUDED_CPPCANVAS_SOURCE_WRAPPER_IMPLCOLOR_HXX
-
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/rendering/XGraphicDevice.hpp>
-#include <cppcanvas/color.hxx>
-
-/* Definition of Color class */
-
-namespace cppcanvas
-{
- namespace internal
- {
- class ImplColor : public Color
- {
- public:
- explicit ImplColor( const css::uno::Reference<
- css::rendering::XGraphicDevice >& rDevice );
- virtual ~ImplColor() override;
-
- virtual css::uno::Sequence< double > getDeviceColor( IntSRGBA aSRGBA ) const override;
-
- private:
- css::uno::Reference< css::rendering::XGraphicDevice > mxDevice;
- };
-
- }
-}
-
-#endif // INCLUDED_CPPCANVAS_SOURCE_WRAPPER_IMPLCOLOR_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppcanvas/source/wrapper/implpolypolygon.cxx b/cppcanvas/source/wrapper/implpolypolygon.cxx
index 16e29abc541a..d59d5eb3448e 100644
--- a/cppcanvas/source/wrapper/implpolypolygon.cxx
+++ b/cppcanvas/source/wrapper/implpolypolygon.cxx
@@ -62,19 +62,19 @@ namespace cppcanvas
{
}
- void ImplPolyPolygon::setRGBAFillColor( Color::IntSRGBA aColor )
+ void ImplPolyPolygon::setRGBAFillColor( IntSRGBA aColor )
{
maFillColor = tools::intSRGBAToDoubleSequence( aColor );
mbFillColorSet = true;
}
- void ImplPolyPolygon::setRGBALineColor( Color::IntSRGBA aColor )
+ void ImplPolyPolygon::setRGBALineColor( IntSRGBA aColor )
{
maStrokeColor = tools::intSRGBAToDoubleSequence( aColor );
mbStrokeColorSet = true;
}
- Color::IntSRGBA ImplPolyPolygon::getRGBALineColor() const
+ IntSRGBA ImplPolyPolygon::getRGBALineColor() const
{
return tools::doubleSequenceToIntSRGBA( maStrokeColor );
}
diff --git a/cppcanvas/source/wrapper/implpolypolygon.hxx b/cppcanvas/source/wrapper/implpolypolygon.hxx
index 431561a6b3d8..d6747cdd5374 100644
--- a/cppcanvas/source/wrapper/implpolypolygon.hxx
+++ b/cppcanvas/source/wrapper/implpolypolygon.hxx
@@ -48,9 +48,9 @@ namespace cppcanvas
virtual ~ImplPolyPolygon() override;
- virtual void setRGBAFillColor( Color::IntSRGBA ) override;
- virtual void setRGBALineColor( Color::IntSRGBA ) override;
- virtual Color::IntSRGBA getRGBALineColor() const override;
+ virtual void setRGBAFillColor( IntSRGBA ) override;
+ virtual void setRGBALineColor( IntSRGBA ) override;
+ virtual IntSRGBA getRGBALineColor() const override;
virtual void setStrokeWidth( const double& rStrokeWidth ) override;
virtual double getStrokeWidth() const override;