diff options
author | Frank Meies <fme@openoffice.org> | 2001-04-18 11:22:09 +0000 |
---|---|---|
committer | Frank Meies <fme@openoffice.org> | 2001-04-18 11:22:09 +0000 |
commit | 6bc38a22571351da0ad751b80d2b6af689388a6d (patch) | |
tree | e48a35a31dff5b9f175a8fd7e0aadefbdf3e86a2 | |
parent | 53a7e8ca1621b8a334be480c46efaa8a38e5b18d (diff) |
Fix: Misspelled words in rotated portions
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 74 |
1 files changed, 58 insertions, 16 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 8379e5de7385..7e5f2bfebb4c 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fntcache.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: fme $ $Date: 2001-04-09 10:44:17 $ + * last change: $Author: fme $ $Date: 2001-04-18 12:22:09 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -964,8 +964,25 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; if ( bColSave ) rInf.GetOut().SetLineColor( *pWaveCol ); - long nX = rInf.GetPos().X() + pKernArray[ USHORT(rInf.GetLen()-1) ]; - Point aEnd( nX, rInf.GetPos().Y() ); + Point aEnd; + long nKernVal = pKernArray[ USHORT( rInf.GetLen() - 1 ) ]; + + switch ( GetFont()->GetOrientation() ) + { + case 0 : + aEnd.X() = rInf.GetPos().X() + nKernVal; + aEnd.Y() = rInf.GetPos().Y(); + break; + case 900 : + aEnd.X() = rInf.GetPos().X(); + aEnd.Y() = rInf.GetPos().Y() - nKernVal; + break; + case 2700 : + aEnd.X() = rInf.GetPos().X(); + aEnd.Y() = rInf.GetPos().Y() + nKernVal; + break; + } + rInf.GetOut().DrawWaveLine( rInf.GetPos(), aEnd, nWave ); if ( bColSave ) @@ -1004,22 +1021,47 @@ static sal_Char __READONLY_DATA sDoubleSpace[] = " "; do { nStart -= rInf.GetIdx(); - Point aStart = nStart ? - Point( rInf.GetPos().X() + pKernArray[ USHORT(nStart-1) ], - rInf.GetPos().Y() ) : rInf.GetPos(); - nStart += nWrLen; - long nX = rInf.GetPos().X() + pKernArray[ USHORT(nStart-1) ]; - if( nStart < nCnt - && CH_BLANK == rInf.GetText().GetChar( rInf.GetIdx() + nStart ) ) + Point aStart( rInf.GetPos() ); + Point aEnd; + short nBlank = 0; + const xub_StrLen nEnd = nStart + nWrLen; + + if( nEnd < nCnt + && CH_BLANK == rInf.GetText().GetChar( rInf.GetIdx() + nEnd ) ) { - if( nStart + 1 == nCnt ) - nX -= rInf.GetSpace(); + if( nEnd + 1 == nCnt ) + nBlank -= rInf.GetSpace(); else - nX -= nHalfSpace; + nBlank -= nHalfSpace; } - Point aEnd( nX, rInf.GetPos().Y() ); + + // determine start, end and length of wave line + long nKernStart = nStart ? + pKernArray[ USHORT( nStart - 1 ) ] : + 0; + long nKernEnd = pKernArray[ USHORT( nEnd - 1 ) ]; + + switch ( GetFont()->GetOrientation() ) + { + case 0 : + aStart.X() += nKernStart; + aEnd.X() = nBlank + rInf.GetPos().X() + nKernEnd; + aEnd.Y() = rInf.GetPos().Y(); + break; + case 900 : + aStart.Y() -= nKernStart; + aEnd.X() = rInf.GetPos().X(); + aEnd.Y() = nBlank + rInf.GetPos().Y() - nKernEnd; + break; + case 2700 : + aStart.Y() += nKernStart; + aEnd.X() = rInf.GetPos().X(); + aEnd.Y() = nBlank + rInf.GetPos().Y() + nKernEnd; + break; + } + rInf.GetOut().DrawWaveLine( aStart, aEnd, nWave ); - nStart += rInf.GetIdx(); + nStart = nEnd + rInf.GetIdx(); nWrLen = rInf.GetIdx() + rInf.GetLen() - nStart; } while( nWrLen && rInf.GetWrong()->Check( nStart, nWrLen ) ); |