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.
This commit is contained in:
Jens-Heiner Rechtien
2009-01-05 17:49:45 +00:00
parent 347a162274
commit a99237ba49
25 changed files with 1391 additions and 806 deletions

View File

@@ -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();

View File

@@ -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

View File

@@ -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,

View File

@@ -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;

View File

@@ -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 )