summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalte Timmermann <mt@openoffice.org>2001-06-27 08:22:27 +0000
committerMalte Timmermann <mt@openoffice.org>2001-06-27 08:22:27 +0000
commiteec0ead9f9ecce1abfcefce0d618ac79f36f7ae3 (patch)
tree05e66c20afa1d94bb6430e3390aa0347b874fdb5
parent8b9fee04828d6cf7c0dd09d4c539a6903122af6f (diff)
#88771# Check remaining width before decrompression
-rw-r--r--svx/source/editeng/impedit3.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/svx/source/editeng/impedit3.cxx b/svx/source/editeng/impedit3.cxx
index 00dfc111915d..4d1b0f28bc16 100644
--- a/svx/source/editeng/impedit3.cxx
+++ b/svx/source/editeng/impedit3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impedit3.cxx,v $
*
- * $Revision: 1.38 $
+ * $Revision: 1.39 $
*
- * last change: $Author: mt $ $Date: 2001-06-22 13:15:09 $
+ * last change: $Author: mt $ $Date: 2001-06-27 09:22:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -994,11 +994,10 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY )
}
// And now check for Compression:
- if ( GetAsianCompressionMode() )
+ if ( pPortion->GetLen() && GetAsianCompressionMode() )
bCompressedChars |= ImplCalcAsianCompression( pNode, pPortion, nTmpPos, (long*)pLine->GetCharPosArray().GetData() + (nTmpPos-pLine->GetStart()), 10000, FALSE );
- nTmpWidth += pPortion->GetSize().Width();;
-
+ nTmpWidth += pPortion->GetSize().Width();
if( bScriptSpace && ( nTmpWidth < nXWidth ) && IsScriptChange( EditPaM( pNode, nTmpPos+pPortion->GetLen() ) ) )
{
@@ -1258,8 +1257,11 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY )
if ( bCompressedChars )
{
long nRemainingWidth = nMaxLineWidth - aTextSize.Width();
- ImplExpandCompressedPortions( pLine, pParaPortion, nRemainingWidth );
- aTextSize = pLine->CalcTextSize( *pParaPortion );
+ if ( nRemainingWidth > 0 )
+ {
+ ImplExpandCompressedPortions( pLine, pParaPortion, nRemainingWidth );
+ aTextSize = pLine->CalcTextSize( *pParaPortion );
+ }
}
if ( pLine->IsHangingPunctuation() )