summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Duerr <hdu@openoffice.org>2002-02-26 12:18:51 +0000
committerHerbert Duerr <hdu@openoffice.org>2002-02-26 12:18:51 +0000
commitec70d6e9c07740efa951f7ba5425451f6a7e8107 (patch)
treeb9f47288712e400979a5e58ac3e72f474bb117e9
parent4f4d4d17a1f4657d11b17168d5469fd8c5abe380 (diff)
#97942# CTL support extended for PSPRINT
-rwxr-xr-xvcl/source/gdi/sallayout.cxx35
1 files changed, 24 insertions, 11 deletions
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 7b8bc230f1c0..8c9813942775 100755
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sallayout.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hdu $ $Date: 2002-02-18 09:08:18 $
+ * last change: $Author: hdu $ $Date: 2002-02-26 13:18:51 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -114,6 +114,7 @@ SalLayout::SalLayout( const ImplLayoutArgs& rArgs )
mnFirstCharIndex( rArgs.mnFirstCharIndex ),
mnEndCharIndex( rArgs.mnEndCharIndex ),
maDrawPosition( rArgs.maDrawPosition ),
+ mnUnitsPerPixel( 1 ),
mnOrientation( rArgs.mnOrientation )
{}
@@ -333,7 +334,6 @@ void GenericSalLayout::ApplyDXArray( const long* pDXArray )
pTouched[ n ] = 1;
long nNewDelta = (n <= 0) ? 0 : pDXArray[ n-1 ];
-fprintf(stderr,"move p%d %d->%d\n",n,pG->maLinearPos.X(),nNewDelta);//###
nNewDelta += nBasePointX - pG->maLinearPos.X();
nDelta = nNewDelta;
}
@@ -395,7 +395,8 @@ int GenericSalLayout::GetTextBreak( long nMaxWidth ) const
// -----------------------------------------------------------------------
-int GenericSalLayout::GetNextGlyphs( int nLen, long* pGlyphs, Point& rPos, int& nStart ) const
+int GenericSalLayout::GetNextGlyphs( int nLen, long* pGlyphs, Point& rPos,
+ int& nStart, sal_Int32* pXOffset ) const
{
const GlyphItem* pG = mpGlyphItems + nStart;
@@ -415,27 +416,39 @@ int GenericSalLayout::GetNextGlyphs( int nLen, long* pGlyphs, Point& rPos, int&
if( nStart >= mnGlyphCount )
return 0;
- // calculate absolute position
- rPos = GetDrawPosition( pG->maLinearPos - maBasePoint );
+ // calculate absolute position in pixel units
+ Point aRelativePos = pG->maLinearPos - maBasePoint;
+ aRelativePos.X() /= mnUnitsPerPixel;
+ aRelativePos.Y() /= mnUnitsPerPixel;
+ rPos = GetDrawPosition( aRelativePos );
// find more glyphs which can be merged into one drawing instruction
int nCount = 0;
while( nCount < nLen )
{
*(pGlyphs++) = pG->mnGlyphIndex;
+ if( pXOffset )
+ *(pXOffset++) = pG->maLinearPos.X();
++nCount;
if( ++nStart >= mnGlyphCount )
break;
- Point aNewPos = pG->maLinearPos;
+ Point aOldPos = pG->maLinearPos;
++pG;
- int n = pG->mnCharIndex;
- if( (n < mnFirstCharIndex) || (n >= mnEndCharIndex) )
+
+ // stop when baseline changes
+ if( aOldPos.Y() != pG->maLinearPos.Y() )
break;
- aNewPos += Point( pG->mnWidth, 0 );
- if( aNewPos != pG->maLinearPos )
+ // stop when x-position is unexpected
+ if( !pXOffset )
+ if( aOldPos.X() + pG->mnWidth != pG->maLinearPos.X() )
+ break;
+
+ // stop when no longer in string
+ int n = pG->mnCharIndex;
+ if( (n < mnFirstCharIndex) || (n >= mnEndCharIndex) )
break;
}