diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-05 17:49:45 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-05 17:49:45 +0000 |
commit | a99237ba49d1d84dcff274f8baca46b4e7f940aa (patch) | |
tree | b6cd12d7cbc0c0a22e058cfe4b16d47b10c6d367 /cppcanvas | |
parent | 347a1622743363ae11cd12bc00d5827c5c952f79 (diff) |
CWS-TOOLING: integrate CWS overline3
2008-12-11 15:24:46 +0100 fredrikh r265314 : i97099
2008-12-11 15:20:37 +0100 fredrikh r265313 : i97099
2008-12-11 15:18:00 +0100 fredrikh r265312 : i97099
2008-12-11 15:17:00 +0100 fredrikh r265311 : i97099
2008-12-11 15:13:20 +0100 fredrikh r265309 : i97144
2008-12-11 15:06:24 +0100 fredrikh r265306 : i97099
2008-11-24 10:41:42 +0100 fme r264213 : #i5991# Overline support
2008-11-24 10:39:53 +0100 fme r264212 : #i5991# Overline support
2008-11-24 10:02:13 +0100 fme r264209 : #5991# Overline support
2008-11-24 10:01:26 +0100 fme r264208 : #5991# Overline support
2008-11-24 09:59:11 +0100 fme r264207 : #5991# Overline support
2008-11-24 09:57:11 +0100 fme r264206 : #5991# Overline support
2008-11-14 10:36:44 +0100 fme r263667 : CWS-TOOLING: rebase CWS overline3 to trunk@263288 (milestone: DEV300:m35)
2008-11-13 16:12:13 +0100 fme r263649 : #i5991# migrate CWS overline3 to SVN.
Diffstat (limited to 'cppcanvas')
-rw-r--r-- | cppcanvas/source/mtfrenderer/implrenderer.cxx | 4 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/mtftools.cxx | 112 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/mtftools.hxx | 17 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/outdevstate.hxx | 4 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/textaction.cxx | 8 |
5 files changed, 134 insertions, 11 deletions
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 25c4657a3391..e50026b21b27 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: implrenderer.cxx,v $ - * $Revision: 1.26 $ + * $Revision: 1.25.4.2 $ * * This file is part of OpenOffice.org. * @@ -200,6 +200,7 @@ namespace aCalculatedNewState.xFont = rNewState.xFont; aCalculatedNewState.fontRotation = rNewState.fontRotation; aCalculatedNewState.textReliefStyle = rNewState.textReliefStyle; + aCalculatedNewState.textOverlineStyle = rNewState.textOverlineStyle; aCalculatedNewState.textUnderlineStyle = rNewState.textUnderlineStyle; aCalculatedNewState.textStrikeoutStyle = rNewState.textStrikeoutStyle; aCalculatedNewState.textEmphasisMarkStyle = rNewState.textEmphasisMarkStyle; @@ -1636,6 +1637,7 @@ 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) : (sal_Int8)rFont.GetUnderline(); diff --git a/cppcanvas/source/mtfrenderer/mtftools.cxx b/cppcanvas/source/mtfrenderer/mtftools.cxx index baf39cc0c13e..e4e227955da6 100644 --- a/cppcanvas/source/mtfrenderer/mtftools.cxx +++ b/cppcanvas/source/mtfrenderer/mtftools.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: mtftools.cxx,v $ - * $Revision: 1.14 $ + * $Revision: 1.14.6.1 $ * * This file is part of OpenOffice.org. * @@ -308,7 +308,7 @@ namespace cppcanvas return true; } - // create underline/strikeout line info struct + // create overline/underline/strikeout line info struct TextLineInfo createTextLineInfo( const ::VirtualDevice& rVDev, const ::cppcanvas::internal::OutDevState& rState ) { @@ -325,8 +325,11 @@ namespace cppcanvas TextLineInfo aTextInfo( (aMetric.GetDescent() + 2) / 4.0, + ((aMetric.GetIntLeading() + 1.5) / 3.0), + (aMetric.GetIntLeading() / 2.0) - aMetric.GetAscent(), aMetric.GetDescent() / 2.0, (aMetric.GetIntLeading() - aMetric.GetAscent()) / 3.0, + rState.textOverlineStyle, rState.textUnderlineStyle, rState.textStrikeoutStyle ); @@ -397,6 +400,111 @@ namespace cppcanvas // fill the polypolygon with all text lines ::basegfx::B2DPolyPolygon aTextLinesPolyPoly; + switch( rTextLineInfo.mnOverlineStyle ) + { + case UNDERLINE_NONE: // nothing to do + // FALLTHROUGH intended + case UNDERLINE_DONTKNOW: + break; + + case UNDERLINE_SMALLWAVE: // TODO(F3): NYI + // FALLTHROUGH intended + case UNDERLINE_WAVE: // TODO(F3): NYI + // FALLTHROUGH intended + case UNDERLINE_SINGLE: + appendRect( + aTextLinesPolyPoly, + rStartPos, + 0, + rTextLineInfo.mnOverlineOffset, + rLineWidth, + rTextLineInfo.mnOverlineOffset + rTextLineInfo.mnOverlineHeight ); + break; + + case UNDERLINE_BOLDDOTTED: // TODO(F3): NYI + // FALLTHROUGH intended + case UNDERLINE_BOLDDASH: // TODO(F3): NYI + // FALLTHROUGH intended + case UNDERLINE_BOLDLONGDASH: // TODO(F3): NYI + // FALLTHROUGH intended + case UNDERLINE_BOLDDASHDOT: // TODO(F3): NYI + // FALLTHROUGH intended + case UNDERLINE_BOLDDASHDOTDOT:// TODO(F3): NYI + // FALLTHROUGH intended + case UNDERLINE_BOLDWAVE: // TODO(F3): NYI + // FALLTHROUGH intended + case UNDERLINE_BOLD: + appendRect( + aTextLinesPolyPoly, + rStartPos, + 0, + rTextLineInfo.mnOverlineOffset - rTextLineInfo.mnOverlineHeight, + rLineWidth, + rTextLineInfo.mnOverlineOffset + rTextLineInfo.mnOverlineHeight ); + break; + + case UNDERLINE_DOUBLEWAVE: // TODO(F3): NYI + // FALLTHROUGH intended + case UNDERLINE_DOUBLE: + appendRect( + aTextLinesPolyPoly, + rStartPos, + 0, + rTextLineInfo.mnOverlineOffset - rTextLineInfo.mnOverlineHeight * 2.0 , + rLineWidth, + rTextLineInfo.mnOverlineOffset - rTextLineInfo.mnOverlineHeight ); + + appendRect( + aTextLinesPolyPoly, + rStartPos, + 0, + rTextLineInfo.mnOverlineOffset + rTextLineInfo.mnOverlineHeight, + rLineWidth, + rTextLineInfo.mnOverlineOffset + rTextLineInfo.mnOverlineHeight * 2.0 ); + break; + + case UNDERLINE_DASHDOTDOT: // TODO(F3): NYI + // FALLTHROUGH intended + case UNDERLINE_DOTTED: + appendDashes( + aTextLinesPolyPoly, + rStartPos.getX(), + rStartPos.getY() + rTextLineInfo.mnOverlineOffset, + rLineWidth, + rTextLineInfo.mnOverlineHeight, + rTextLineInfo.mnOverlineHeight, + 2*rTextLineInfo.mnOverlineHeight ); + break; + + case UNDERLINE_DASHDOT: // TODO(F3): NYI + // FALLTHROUGH intended + case UNDERLINE_DASH: + appendDashes( + aTextLinesPolyPoly, + rStartPos.getX(), + rStartPos.getY() + rTextLineInfo.mnOverlineOffset, + rLineWidth, + rTextLineInfo.mnOverlineHeight, + 3*rTextLineInfo.mnOverlineHeight, + 6*rTextLineInfo.mnOverlineHeight ); + break; + + case UNDERLINE_LONGDASH: + appendDashes( + aTextLinesPolyPoly, + rStartPos.getX(), + rStartPos.getY() + rTextLineInfo.mnOverlineOffset, + rLineWidth, + rTextLineInfo.mnOverlineHeight, + 6*rTextLineInfo.mnOverlineHeight, + 12*rTextLineInfo.mnOverlineHeight ); + break; + + default: + ENSURE_OR_THROW( false, + "::cppcanvas::internal::createTextLinesPolyPolygon(): Unexpected overline case" ); + } + switch( rTextLineInfo.mnUnderlineStyle ) { case UNDERLINE_NONE: // nothing to do diff --git a/cppcanvas/source/mtfrenderer/mtftools.hxx b/cppcanvas/source/mtfrenderer/mtftools.hxx index b9234bb178d7..d44272342ee9 100644 --- a/cppcanvas/source/mtfrenderer/mtftools.hxx +++ b/cppcanvas/source/mtfrenderer/mtftools.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: mtftools.hxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.16.1 $ * * This file is part of OpenOffice.org. * @@ -208,21 +208,30 @@ namespace cppcanvas struct TextLineInfo { TextLineInfo( const double& rLineHeight, + const double& rOverlineHeight, + const double& rOverlineOffset, const double& rUnderlineOffset, const double& rStrikeoutOffset, + sal_Int8 nOverlineStyle, sal_Int8 nUnderlineStyle, sal_Int8 nStrikeoutStyle ) : mnLineHeight( rLineHeight ), + mnOverlineHeight( rOverlineHeight ), + mnOverlineOffset( rOverlineOffset ), mnUnderlineOffset( rUnderlineOffset ), mnStrikeoutOffset( rStrikeoutOffset ), + mnOverlineStyle( nOverlineStyle ), mnUnderlineStyle( nUnderlineStyle ), mnStrikeoutStyle( nStrikeoutStyle ) { } double mnLineHeight; + double mnOverlineHeight; + double mnOverlineOffset; double mnUnderlineOffset; double mnStrikeoutOffset; + sal_Int8 mnOverlineStyle; sal_Int8 mnUnderlineStyle; sal_Int8 mnStrikeoutStyle; }; @@ -240,16 +249,16 @@ namespace cppcanvas const ::cppcanvas::internal::OutDevState& rState ); /** Create a poly-polygon representing the given combination - of strikeout and underline. + of overline, strikeout and underline. @param rStartOffset Offset in X direction, where the underline starts @param rLineWidth - Width of the line of text to underline/strikeout + Width of the line of text to overline/strikeout/underline @param rTextLineInfo - Common info needed for strikeout/underline generation + Common info needed for overline/strikeout/underline generation */ ::basegfx::B2DPolyPolygon createTextLinesPolyPolygon( const double& rStartOffset, const double& rLineWidth, diff --git a/cppcanvas/source/mtfrenderer/outdevstate.hxx b/cppcanvas/source/mtfrenderer/outdevstate.hxx index a100db70d145..b1eee1ab6f2e 100644 --- a/cppcanvas/source/mtfrenderer/outdevstate.hxx +++ b/cppcanvas/source/mtfrenderer/outdevstate.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: outdevstate.hxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.16.1 $ * * This file is part of OpenOffice.org. * @@ -87,6 +87,7 @@ namespace cppcanvas textAlignment(0), // TODO(Q2): Synchronize with implrenderer // and possibly new rendering::TextAlignment textReliefStyle(RELIEF_NONE), + textOverlineStyle(UNDERLINE_NONE), textUnderlineStyle(UNDERLINE_NONE), textStrikeoutStyle(STRIKEOUT_NONE), textReferencePoint(ALIGN_BASELINE), @@ -127,6 +128,7 @@ namespace cppcanvas sal_Int8 textDirection; sal_Int8 textAlignment; sal_Int8 textReliefStyle; + sal_Int8 textOverlineStyle; sal_Int8 textUnderlineStyle; sal_Int8 textStrikeoutStyle; TextAlign textReferencePoint; diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx index 66bf728418c1..f1191e6e57f3 100644 --- a/cppcanvas/source/mtfrenderer/textaction.cxx +++ b/cppcanvas/source/mtfrenderer/textaction.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: textaction.cxx,v $ - * $Revision: 1.22 $ + * $Revision: 1.22.4.1 $ * * This file is part of OpenOffice.org. * @@ -2183,7 +2183,8 @@ namespace cppcanvas if( !pDXArray && !bSubsettable ) { // effects, or not? - if( !rState.textUnderlineStyle && + if( !rState.textOverlineStyle && + !rState.textUnderlineStyle && !rState.textStrikeoutStyle && rReliefColor == aEmptyColor && rShadowColor == aEmptyColor ) @@ -2246,7 +2247,8 @@ namespace cppcanvas else { // DX array necessary - any effects? - if( !rState.textUnderlineStyle && + if( !rState.textOverlineStyle && + !rState.textUnderlineStyle && !rState.textStrikeoutStyle && rReliefColor == aEmptyColor && rShadowColor == aEmptyColor ) |