From 36fb328d48684d56329339d59753fa53e4b132ed Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 17 Sep 2010 08:23:35 +0200 Subject: dba34a: remove comphelper/optionalvalue.hxx, and the only client it had (replaced with boost/optional.hpp) --- cppcanvas/inc/cppcanvas/renderer.hxx | 18 +++++------ cppcanvas/source/mtfrenderer/implrenderer.cxx | 46 +++++++++++++-------------- cppcanvas/source/mtfrenderer/textaction.cxx | 20 ++++++------ 3 files changed, 42 insertions(+), 42 deletions(-) (limited to 'cppcanvas') diff --git a/cppcanvas/inc/cppcanvas/renderer.hxx b/cppcanvas/inc/cppcanvas/renderer.hxx index 780a27f31503..0b8bb43d7e3e 100644 --- a/cppcanvas/inc/cppcanvas/renderer.hxx +++ b/cppcanvas/inc/cppcanvas/renderer.hxx @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include #include @@ -109,16 +109,16 @@ namespace cppcanvas struct Parameters { /// Optionally forces the fill color attribute for all actions - ::comphelper::OptionalValue< Color::IntSRGBA > maFillColor; + ::boost::optional< Color::IntSRGBA > maFillColor; /// Optionally forces the line color attribute for all actions - ::comphelper::OptionalValue< Color::IntSRGBA > maLineColor; + ::boost::optional< Color::IntSRGBA > maLineColor; /// Optionally forces the text color attribute for all actions - ::comphelper::OptionalValue< Color::IntSRGBA > maTextColor; + ::boost::optional< Color::IntSRGBA > maTextColor; /// Optionally forces the given fontname for all text actions - ::comphelper::OptionalValue< ::rtl::OUString > maFontName; + ::boost::optional< ::rtl::OUString > maFontName; /** Optionally transforms all text output actions with the given matrix (in addition to the overall canvas @@ -128,16 +128,16 @@ namespace cppcanvas rect coordinate system, i.e. the metafile is assumed to be contained in the unit rect. */ - ::comphelper::OptionalValue< ::basegfx::B2DHomMatrix > maTextTransformation; + ::boost::optional< ::basegfx::B2DHomMatrix > maTextTransformation; /// Optionally forces the given font weight for all text actions - ::comphelper::OptionalValue< sal_Int8 > maFontWeight; + ::boost::optional< sal_Int8 > maFontWeight; /// Optionally forces the given font letter form (italics etc.) for all text actions - ::comphelper::OptionalValue< sal_Int8 > maFontLetterForm; + ::boost::optional< sal_Int8 > maFontLetterForm; /// Optionally forces underlining for all text actions - ::comphelper::OptionalValue< bool > maFontUnderline; + ::boost::optional< bool > maFontUnderline; }; }; diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 1423cd42ed93..006d55a01de6 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -831,8 +831,8 @@ namespace cppcanvas { rendering::FontRequest aFontRequest; - if( rParms.mrParms.maFontName.isValid() ) - aFontRequest.FontDescription.FamilyName = rParms.mrParms.maFontName.getValue(); + if( rParms.mrParms.maFontName.is_initialized() ) + aFontRequest.FontDescription.FamilyName = *rParms.mrParms.maFontName; else aFontRequest.FontDescription.FamilyName = rFont.GetName(); @@ -843,12 +843,12 @@ namespace cppcanvas // TODO(F2): improve vclenum->panose conversion aFontRequest.FontDescription.FontDescription.Weight = - rParms.mrParms.maFontWeight.isValid() ? - rParms.mrParms.maFontWeight.getValue() : + rParms.mrParms.maFontWeight.is_initialized() ? + *rParms.mrParms.maFontWeight : ::canvas::tools::numeric_cast( ::basegfx::fround( rFont.GetWeight() ) ); aFontRequest.FontDescription.FontDescription.Letterform = - rParms.mrParms.maFontLetterForm.isValid() ? - rParms.mrParms.maFontLetterForm.getValue() : + rParms.mrParms.maFontLetterForm.is_initialized() ? + *rParms.mrParms.maFontLetterForm : (rFont.GetItalic() == ITALIC_NONE) ? 0 : 9; LanguageType aLang = rFont.GetLanguage(); @@ -1445,7 +1445,7 @@ namespace cppcanvas break; case META_LINECOLOR_ACTION: - if( !rParms.maLineColor.isValid() ) + if( !rParms.maLineColor.is_initialized() ) { setStateColor( static_cast(pCurrAct), getState( rStates ).isLineColorSet, @@ -1455,7 +1455,7 @@ namespace cppcanvas break; case META_FILLCOLOR_ACTION: - if( !rParms.maFillColor.isValid() ) + if( !rParms.maFillColor.is_initialized() ) { setStateColor( static_cast(pCurrAct), getState( rStates ).isFillColorSet, @@ -1466,7 +1466,7 @@ namespace cppcanvas case META_TEXTCOLOR_ACTION: { - if( !rParms.maTextColor.isValid() ) + if( !rParms.maTextColor.is_initialized() ) { // Text color is set unconditionally, thus, no // use of setStateColor here @@ -1486,7 +1486,7 @@ namespace cppcanvas break; case META_TEXTFILLCOLOR_ACTION: - if( !rParms.maTextColor.isValid() ) + if( !rParms.maTextColor.is_initialized() ) { setStateColor( static_cast(pCurrAct), getState( rStates ).isTextFillColorSet, @@ -1496,7 +1496,7 @@ namespace cppcanvas break; case META_TEXTLINECOLOR_ACTION: - if( !rParms.maTextColor.isValid() ) + if( !rParms.maTextColor.is_initialized() ) { setStateColor( static_cast(pCurrAct), getState( rStates ).isTextLineColorSet, @@ -1526,8 +1526,8 @@ namespace cppcanvas // TODO(Q2): define and use appropriate enumeration types rState.textReliefStyle = (sal_Int8)rFont.GetRelief(); rState.textOverlineStyle = (sal_Int8)rFont.GetOverline(); - rState.textUnderlineStyle = rParms.maFontUnderline.isValid() ? - (rParms.maFontUnderline.getValue() ? (sal_Int8)UNDERLINE_SINGLE : (sal_Int8)UNDERLINE_NONE) : + rState.textUnderlineStyle = rParms.maFontUnderline.is_initialized() ? + (*rParms.maFontUnderline ? (sal_Int8)UNDERLINE_SINGLE : (sal_Int8)UNDERLINE_NONE) : (sal_Int8)rFont.GetUnderline(); rState.textStrikeoutStyle = (sal_Int8)rFont.GetStrikeout(); rState.textEmphasisMarkStyle = (sal_Int8)rFont.GetEmphasisMark(); @@ -2946,28 +2946,28 @@ namespace cppcanvas getState( aStateStack ).textLineColor = pColor->getDeviceColor( 0x000000FF ); // apply overrides from the Parameters struct - if( rParams.maFillColor.isValid() ) + if( rParams.maFillColor.is_initialized() ) { getState( aStateStack ).isFillColorSet = true; - getState( aStateStack ).fillColor = pColor->getDeviceColor( rParams.maFillColor.getValue() ); + getState( aStateStack ).fillColor = pColor->getDeviceColor( *rParams.maFillColor ); } - if( rParams.maLineColor.isValid() ) + if( rParams.maLineColor.is_initialized() ) { getState( aStateStack ).isLineColorSet = true; - getState( aStateStack ).lineColor = pColor->getDeviceColor( rParams.maLineColor.getValue() ); + getState( aStateStack ).lineColor = pColor->getDeviceColor( *rParams.maLineColor ); } - if( rParams.maTextColor.isValid() ) + if( rParams.maTextColor.is_initialized() ) { getState( aStateStack ).isTextFillColorSet = true; getState( aStateStack ).isTextLineColorSet = true; getState( aStateStack ).textColor = getState( aStateStack ).textFillColor = - getState( aStateStack ).textLineColor = pColor->getDeviceColor( rParams.maTextColor.getValue() ); + getState( aStateStack ).textLineColor = pColor->getDeviceColor( *rParams.maTextColor ); } - if( rParams.maFontName.isValid() || - rParams.maFontWeight.isValid() || - rParams.maFontLetterForm.isValid() || - rParams.maFontUnderline.isValid() ) + if( rParams.maFontName.is_initialized() || + rParams.maFontWeight.is_initialized() || + rParams.maFontLetterForm.is_initialized() || + rParams.maFontUnderline.is_initialized() ) { ::cppcanvas::internal::OutDevState& rState = getState( aStateStack ); diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx index bc4cf6688ca3..56ce197b7e8e 100644 --- a/cppcanvas/source/mtfrenderer/textaction.cxx +++ b/cppcanvas/source/mtfrenderer/textaction.cxx @@ -2069,7 +2069,7 @@ namespace cppcanvas rCanvas->getUNOCanvas()->getDevice(), aResultingPolyPolygon ) ); - if( rParms.maTextTransformation.isValid() ) + if( rParms.maTextTransformation.is_initialized() ) { return ActionSharedPtr( new OutlineAction( @@ -2085,7 +2085,7 @@ namespace cppcanvas rVDev, rCanvas, rState, - rParms.maTextTransformation.getValue() ) ); + *rParms.maTextTransformation ) ); } else { @@ -2186,7 +2186,7 @@ namespace cppcanvas rShadowColor == aEmptyColor ) { // nope - if( rParms.maTextTransformation.isValid() ) + if( rParms.maTextTransformation.is_initialized() ) { return ActionSharedPtr( new TextAction( aStartPoint, @@ -2195,7 +2195,7 @@ namespace cppcanvas nLen, rCanvas, rState, - rParms.maTextTransformation.getValue() ) ); + *rParms.maTextTransformation ) ); } else { @@ -2211,7 +2211,7 @@ namespace cppcanvas else { // at least one of the effects requested - if( rParms.maTextTransformation.isValid() ) + if( rParms.maTextTransformation.is_initialized() ) return ActionSharedPtr( new EffectTextAction( aStartPoint, aReliefOffset, @@ -2224,7 +2224,7 @@ namespace cppcanvas rVDev, rCanvas, rState, - rParms.maTextTransformation.getValue() ) ); + *rParms.maTextTransformation ) ); else return ActionSharedPtr( new EffectTextAction( aStartPoint, @@ -2250,7 +2250,7 @@ namespace cppcanvas rShadowColor == aEmptyColor ) { // nope - if( rParms.maTextTransformation.isValid() ) + if( rParms.maTextTransformation.is_initialized() ) return ActionSharedPtr( new TextArrayAction( aStartPoint, rText, @@ -2259,7 +2259,7 @@ namespace cppcanvas aCharWidths, rCanvas, rState, - rParms.maTextTransformation.getValue() ) ); + *rParms.maTextTransformation ) ); else return ActionSharedPtr( new TextArrayAction( aStartPoint, @@ -2273,7 +2273,7 @@ namespace cppcanvas else { // at least one of the effects requested - if( rParms.maTextTransformation.isValid() ) + if( rParms.maTextTransformation.is_initialized() ) return ActionSharedPtr( new EffectTextArrayAction( aStartPoint, aReliefOffset, @@ -2287,7 +2287,7 @@ namespace cppcanvas rVDev, rCanvas, rState, - rParms.maTextTransformation.getValue() ) ); + *rParms.maTextTransformation ) ); else return ActionSharedPtr( new EffectTextArrayAction( aStartPoint, -- cgit From 4d41dd2a2b24d447647e2130dc6aa021cc3fb687 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Mon, 10 Jan 2011 15:02:07 +0100 Subject: removetooltypes01: #i112600# remove tooltypes from cppcanvas --- cppcanvas/source/inc/implrenderer.hxx | 2 +- cppcanvas/source/mtfrenderer/implrenderer.cxx | 46 +++++++++++++-------------- cppcanvas/source/mtfrenderer/mtftools.cxx | 4 +-- cppcanvas/source/mtfrenderer/textaction.cxx | 16 +++++----- cppcanvas/source/wrapper/vclfactory.cxx | 4 +-- 5 files changed, 36 insertions(+), 36 deletions(-) (limited to 'cppcanvas') diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx index 8c1f7941abc4..c3613af135a9 100644 --- a/cppcanvas/source/inc/implrenderer.hxx +++ b/cppcanvas/source/inc/implrenderer.hxx @@ -134,7 +134,7 @@ namespace cppcanvas bool isActionContained( GDIMetaFile& rMtf, const char* pCommentString, - USHORT nType ) const; + sal_uInt16 nType ) const; void createGradientAction( const ::PolyPolygon& rPoly, const ::Gradient& rGradient, diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 006d55a01de6..2d92d3acab13 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -143,7 +143,7 @@ namespace } void pushState( ::cppcanvas::internal::VectorOfOutDevStates& rStates, - USHORT nFlags ) + sal_uInt16 nFlags ) { rStates.push_back( getState( rStates ) ); getState( rStates ).pushFlags = nFlags; @@ -447,7 +447,7 @@ namespace // translate characters to local preference sal_Unicode cChar = getLocalizedChar( *pBegin, eTextLanguage ); if( cChar != *pBegin ) - rStr.SetChar( sal::static_int_cast(pBegin - pBase), cChar ); + rStr.SetChar( sal::static_int_cast(pBegin - pBase), cChar ); } } } @@ -522,7 +522,7 @@ namespace cppcanvas bool ImplRenderer::isActionContained( GDIMetaFile& rMtf, const char* pCommentString, - USHORT nType ) const + sal_uInt16 nType ) const { ENSURE_OR_THROW( pCommentString, "ImplRenderer::isActionContained(): NULL string given" ); @@ -531,7 +531,7 @@ namespace cppcanvas // at least _one_ call to GDIMetaFile::NextAction() is // executed - ULONG nPos( 1 ); + sal_uIntPtr nPos( 1 ); MetaAction* pCurrAct; while( (pCurrAct=rMtf.NextAction()) != NULL ) @@ -582,7 +582,7 @@ namespace cppcanvas // decide, whether this gradient can be rendered natively // by the canvas, or must be emulated via VCL gradient // action extraction. - const USHORT nSteps( rGradient.GetSteps() ); + const sal_uInt16 nSteps( rGradient.GetSteps() ); if( // step count is infinite, can use native canvas // gradients here @@ -607,17 +607,17 @@ namespace cppcanvas // ---------------------------- // scale color coefficients with gradient intensities - const USHORT nStartIntensity( rGradient.GetStartIntensity() ); + const sal_uInt16 nStartIntensity( rGradient.GetStartIntensity() ); ::Color aVCLStartColor( rGradient.GetStartColor() ); - aVCLStartColor.SetRed( (UINT8)(aVCLStartColor.GetRed() * nStartIntensity / 100) ); - aVCLStartColor.SetGreen( (UINT8)(aVCLStartColor.GetGreen() * nStartIntensity / 100) ); - aVCLStartColor.SetBlue( (UINT8)(aVCLStartColor.GetBlue() * nStartIntensity / 100) ); + aVCLStartColor.SetRed( (sal_uInt8)(aVCLStartColor.GetRed() * nStartIntensity / 100) ); + aVCLStartColor.SetGreen( (sal_uInt8)(aVCLStartColor.GetGreen() * nStartIntensity / 100) ); + aVCLStartColor.SetBlue( (sal_uInt8)(aVCLStartColor.GetBlue() * nStartIntensity / 100) ); - const USHORT nEndIntensity( rGradient.GetEndIntensity() ); + const sal_uInt16 nEndIntensity( rGradient.GetEndIntensity() ); ::Color aVCLEndColor( rGradient.GetEndColor() ); - aVCLEndColor.SetRed( (UINT8)(aVCLEndColor.GetRed() * nEndIntensity / 100) ); - aVCLEndColor.SetGreen( (UINT8)(aVCLEndColor.GetGreen() * nEndIntensity / 100) ); - aVCLEndColor.SetBlue( (UINT8)(aVCLEndColor.GetBlue() * nEndIntensity / 100) ); + aVCLEndColor.SetRed( (sal_uInt8)(aVCLEndColor.GetRed() * nEndIntensity / 100) ); + aVCLEndColor.SetGreen( (sal_uInt8)(aVCLEndColor.GetGreen() * nEndIntensity / 100) ); + aVCLEndColor.SetBlue( (sal_uInt8)(aVCLEndColor.GetBlue() * nEndIntensity / 100) ); uno::Reference xColorSpace( rParms.mrCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace()); @@ -1531,9 +1531,9 @@ namespace cppcanvas (sal_Int8)rFont.GetUnderline(); rState.textStrikeoutStyle = (sal_Int8)rFont.GetStrikeout(); rState.textEmphasisMarkStyle = (sal_Int8)rFont.GetEmphasisMark(); - rState.isTextEffectShadowSet = (rFont.IsShadow() != FALSE); - rState.isTextWordUnderlineSet = (rFont.IsWordLineMode() != FALSE); - rState.isTextOutlineModeSet = (rFont.IsOutline() != FALSE); + rState.isTextEffectShadowSet = (rFont.IsShadow() != sal_False); + rState.isTextWordUnderlineSet = (rFont.IsWordLineMode() != sal_False); + rState.isTextOutlineModeSet = (rFont.IsOutline() != sal_False); } break; @@ -1695,7 +1695,7 @@ namespace cppcanvas // Handle drawing layer fills else if( pAct->GetComment().Equals( "XPATHFILL_SEQ_BEGIN" ) ) { - const BYTE* pData = pAct->GetData(); + const sal_uInt8* pData = pAct->GetData(); if ( pData ) { SvMemoryStream aMemStm( (void*)pData, pAct->GetDataSize(), STREAM_READ ); @@ -2496,7 +2496,7 @@ namespace cppcanvas pAct->GetPoint(), sText, pAct->GetIndex(), - pAct->GetLen() == (USHORT)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(), + pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(), NULL, rFactoryParms, bSubsettableActions ); @@ -2515,7 +2515,7 @@ namespace cppcanvas pAct->GetPoint(), sText, pAct->GetIndex(), - pAct->GetLen() == (USHORT)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(), + pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(), pAct->GetDXArray(), rFactoryParms, bSubsettableActions ); @@ -2590,7 +2590,7 @@ namespace cppcanvas if( rVDev.GetDigitLanguage()) convertToLocalizedNumerals ( sText,rVDev.GetDigitLanguage() ); - const USHORT nLen( pAct->GetLen() == (USHORT)STRING_LEN ? + const sal_uInt16 nLen( pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen() ); // #i70897# Nothing to do, actually... @@ -2611,7 +2611,7 @@ namespace cppcanvas // Last entry of pDXArray contains total width of the text sal_Int32* p=pDXArray.get(); - for( USHORT i=1; i<=nLen; ++i ) + for( sal_uInt16 i=1; i<=nLen; ++i ) { // calc ratio for every array entry, to // distribute rounding errors 'evenly' @@ -2626,7 +2626,7 @@ namespace cppcanvas pAct->GetPoint(), sText, pAct->GetIndex(), - pAct->GetLen() == (USHORT)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(), + pAct->GetLen() == (sal_uInt16)STRING_LEN ? pAct->GetText().Len() - pAct->GetIndex() : pAct->GetLen(), pDXArray.get(), rFactoryParms, bSubsettableActions ); @@ -2901,7 +2901,7 @@ namespace cppcanvas VectorOfOutDevStates aStateStack; VirtualDevice aVDev; - aVDev.EnableOutput( FALSE ); + aVDev.EnableOutput( sal_False ); // Setup VDev for state tracking and mapping // ========================================= diff --git a/cppcanvas/source/mtfrenderer/mtftools.cxx b/cppcanvas/source/mtfrenderer/mtftools.cxx index 2d165eca4d38..9860f1d1cd7d 100644 --- a/cppcanvas/source/mtfrenderer/mtftools.cxx +++ b/cppcanvas/source/mtfrenderer/mtftools.cxx @@ -306,14 +306,14 @@ namespace cppcanvas TextLineInfo createTextLineInfo( const ::VirtualDevice& rVDev, const ::cppcanvas::internal::OutDevState& rState ) { - const BOOL bOldMode( rVDev.IsMapModeEnabled() ); + const sal_Bool bOldMode( rVDev.IsMapModeEnabled() ); // #i68512# Force metric regeneration with mapmode enabled // (prolly OutDev bug) rVDev.GetFontMetric(); // will restore map mode below - const_cast< ::VirtualDevice& >(rVDev).EnableMapMode( FALSE ); + const_cast< ::VirtualDevice& >(rVDev).EnableMapMode( sal_False ); const ::FontMetric aMetric = rVDev.GetFontMetric(); diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx index 56ce197b7e8e..30aecef24206 100644 --- a/cppcanvas/source/mtfrenderer/textaction.cxx +++ b/cppcanvas/source/mtfrenderer/textaction.cxx @@ -212,8 +212,8 @@ namespace cppcanvas ::boost::scoped_array< sal_Int32 > pCharWidths( new sal_Int32[nLen] ); rVDev.GetTextArray( rText, pCharWidths.get(), - static_cast(nStartPos), - static_cast(nLen) ); + static_cast(nStartPos), + static_cast(nLen) ); return setupDXArray( pCharWidths.get(), nLen, rState ); } @@ -287,8 +287,8 @@ namespace cppcanvas { // TODO(F2): use correct scale direction const ::basegfx::B2DSize aSize( rVDev.GetTextWidth( rStringContext.Text, - static_cast(rStringContext.StartPosition), - static_cast(rStringContext.Length) ), + static_cast(rStringContext.StartPosition), + static_cast(rStringContext.Length) ), 0 ); return (rState.mapModeTransform * aSize).getX(); @@ -1994,10 +1994,10 @@ namespace cppcanvas ::basegfx::B2DPolyPolygon aResultingPolyPolygon; PolyPolyVector aVCLPolyPolyVector; const bool bHaveOutlines( rVDev.GetTextOutlines( aVCLPolyPolyVector, rText, - static_cast(nStartPos), - static_cast(nStartPos), - static_cast(nLen), - TRUE, 0, pDXArray ) ); + static_cast(nStartPos), + static_cast(nStartPos), + static_cast(nLen), + sal_True, 0, pDXArray ) ); rVDev.SetFont(aOrigFont); if( !bHaveOutlines ) diff --git a/cppcanvas/source/wrapper/vclfactory.cxx b/cppcanvas/source/wrapper/vclfactory.cxx index 7983f081b2a9..bc80afaa92cd 100644 --- a/cppcanvas/source/wrapper/vclfactory.cxx +++ b/cppcanvas/source/wrapper/vclfactory.cxx @@ -295,7 +295,7 @@ namespace cppcanvas if( !pSpriteCanvas ) return SpriteSharedPtr(); - const USHORT nBitmaps( rAnim.Count() ); + const sal_uInt16 nBitmaps( rAnim.Count() ); uno::Sequence< uno::Reference< rendering::XBitmap > > aBitmapSequence( nBitmaps ); uno::Reference< rendering::XBitmap >* pBitmaps = aBitmapSequence.getArray(); @@ -310,7 +310,7 @@ namespace cppcanvas for( i=0; i Date: Thu, 13 Jan 2011 16:25:57 +0100 Subject: calc65: #i116318# Fixed the painting of axial gradients. --- cppcanvas/source/mtfrenderer/implrenderer.cxx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'cppcanvas') diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 1423cd42ed93..592aa6e41ba9 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -682,10 +682,23 @@ namespace cppcanvas case GRADIENT_AXIAL: { - basegfx::tools::createLinearODFGradientInfo(aGradInfo, + // Adapt the border so that it is suitable + // for the axial gradient. An axial + // gradient consists of two linear + // gradients. Each of those covers half + // of the total size. In order to + // compensate for the condensed display of + // the linear gradients, we have to + // enlarge the area taken up by the actual + // gradient (1-fBorder). After that we + // have to turn the result back into a + // border value, hence the second (left + // most 1-... + const double fAxialBorder (1-2*(1-fBorder)); + basegfx::tools::createAxialODFGradientInfo(aGradInfo, aBounds, nSteps, - fBorder, + fAxialBorder, fRotation); // map odf to svg gradient orientation - x // instead of y direction -- cgit