summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMalte Timmermann <mt@openoffice.org>2001-10-17 11:34:49 +0000
committerMalte Timmermann <mt@openoffice.org>2001-10-17 11:34:49 +0000
commit2cac524593b0449f905fd20c081fa719bbc6fc9a (patch)
treec88a6b3cf8e30d27595564560933b2260cdc55c2 /svx
parent65514b5285fb6be798fb11c8b431d10b306ae3a1 (diff)
#90866# calc height when paragraphs become visible...
Diffstat (limited to 'svx')
-rw-r--r--svx/source/editeng/impedit2.cxx102
-rw-r--r--svx/source/editeng/impedit3.cxx10
2 files changed, 58 insertions, 54 deletions
diff --git a/svx/source/editeng/impedit2.cxx b/svx/source/editeng/impedit2.cxx
index 1cee0b9830fd..c79c7e8a01e9 100644
--- a/svx/source/editeng/impedit2.cxx
+++ b/svx/source/editeng/impedit2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impedit2.cxx,v $
*
- * $Revision: 1.47 $
+ * $Revision: 1.48 $
*
- * last change: $Author: mt $ $Date: 2001-10-11 12:52:58 $
+ * last change: $Author: mt $ $Date: 2001-10-17 12:34:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2935,68 +2935,68 @@ EditSelection ImpEditEngine::InsertText( uno::Reference< datatransfer::XTransfer
Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion )
{
- DBG_ASSERT( pPortion->IsVisible(), "Wozu GetInvalidYOffset() bei einem unsichtbaren Absatz?" );
-
Range aRange( 0, 0 );
- const SvxULSpaceItem& rULSpace = (const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE );
- const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL );
- USHORT nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX )
- ? GetYValue( rLSItem.GetInterLineSpace() ) : 0;
-
- // erst von vorne...
- USHORT nFirstInvalid = 0xFFFF;
- USHORT nLine;
- for ( nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ )
+ if ( pPortion->IsVisible() )
{
- EditLine* pL = pPortion->GetLines().GetObject( nLine );
- if ( pL->IsInvalid() )
+ const SvxULSpaceItem& rULSpace = (const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE );
+ const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL );
+ USHORT nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX )
+ ? GetYValue( rLSItem.GetInterLineSpace() ) : 0;
+
+ // erst von vorne...
+ USHORT nFirstInvalid = 0xFFFF;
+ USHORT nLine;
+ for ( nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ )
{
- nFirstInvalid = nLine;
- break;
+ EditLine* pL = pPortion->GetLines().GetObject( nLine );
+ if ( pL->IsInvalid() )
+ {
+ nFirstInvalid = nLine;
+ break;
+ }
+ if ( nLine && !aStatus.IsOutliner() ) // nicht die erste Zeile
+ aRange.Min() += nSBL;
+ aRange.Min() += pL->GetHeight();
}
- if ( nLine && !aStatus.IsOutliner() ) // nicht die erste Zeile
- aRange.Min() += nSBL;
- aRange.Min() += pL->GetHeight();
- }
- DBG_ASSERT( nFirstInvalid != 0xFFFF, "Keine ungueltige Zeile gefunden in GetInvalidYOffset(1)" );
+ DBG_ASSERT( nFirstInvalid != 0xFFFF, "Keine ungueltige Zeile gefunden in GetInvalidYOffset(1)" );
- // Abgleichen und weiter...
- aRange.Max() = aRange.Min();
- aRange.Max() += pPortion->GetFirstLineOffset();
- if ( nFirstInvalid != 0 ) // Nur wenn nicht die erste Zeile ungueltig
- aRange.Min() = aRange.Max();
+ // Abgleichen und weiter...
+ aRange.Max() = aRange.Min();
+ aRange.Max() += pPortion->GetFirstLineOffset();
+ if ( nFirstInvalid != 0 ) // Nur wenn nicht die erste Zeile ungueltig
+ aRange.Min() = aRange.Max();
- USHORT nLastInvalid = pPortion->GetLines().Count()-1;
- for ( nLine = nFirstInvalid; nLine < pPortion->GetLines().Count(); nLine++ )
- {
- EditLine* pL = pPortion->GetLines().GetObject( nLine );
- if ( pL->IsValid() )
+ USHORT nLastInvalid = pPortion->GetLines().Count()-1;
+ for ( nLine = nFirstInvalid; nLine < pPortion->GetLines().Count(); nLine++ )
{
- nLastInvalid = nLine;
- break;
+ EditLine* pL = pPortion->GetLines().GetObject( nLine );
+ if ( pL->IsValid() )
+ {
+ nLastInvalid = nLine;
+ break;
+ }
+
+ if ( nLine && !aStatus.IsOutliner() )
+ aRange.Max() += nSBL;
+ aRange.Max() += pL->GetHeight();
}
- if ( nLine && !aStatus.IsOutliner() )
- aRange.Max() += nSBL;
- aRange.Max() += pL->GetHeight();
- }
+ // MT 07/00 SBL kann jetzt kleiner 100% sein => ggf. die Zeile davor neu ausgeben.
+ if( ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) &&
+ ( rLSItem.GetPropLineSpace() < 100 ) )
+ {
+ EditLine* pL = pPortion->GetLines().GetObject( nFirstInvalid );
+ long n = pL->GetTxtHeight() * ( 100 - rLSItem.GetPropLineSpace() );
+ n /= 100;
+ aRange.Min() -= n;
+ aRange.Max() += n;
+ }
- // MT 07/00 SBL kann jetzt kleiner 100% sein => ggf. die Zeile davor neu ausgeben.
- if( ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) &&
- ( rLSItem.GetPropLineSpace() < 100 ) )
- {
- EditLine* pL = pPortion->GetLines().GetObject( nFirstInvalid );
- long n = pL->GetTxtHeight() * ( 100 - rLSItem.GetPropLineSpace() );
- n /= 100;
- aRange.Min() -= n;
- aRange.Max() += n;
+ if ( ( nLastInvalid == pPortion->GetLines().Count()-1 ) && ( !aStatus.IsOutliner() ) )
+ aRange.Max() += GetYValue( rULSpace.GetLower() );
}
-
- if ( ( nLastInvalid == pPortion->GetLines().Count()-1 ) && ( !aStatus.IsOutliner() ) )
- aRange.Max() += GetYValue( rULSpace.GetLower() );
-
return aRange;
}
diff --git a/svx/source/editeng/impedit3.cxx b/svx/source/editeng/impedit3.cxx
index bf75d6120580..d39797bb7a65 100644
--- a/svx/source/editeng/impedit3.cxx
+++ b/svx/source/editeng/impedit3.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: impedit3.cxx,v $
*
- * $Revision: 1.51 $
+ * $Revision: 1.52 $
*
- * last change: $Author: mt $ $Date: 2001-10-11 12:52:58 $
+ * last change: $Author: mt $ $Date: 2001-10-17 12:34:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -2963,7 +2963,7 @@ void ImpEditEngine::ShowParagraph( sal_uInt16 nParagraph, sal_Bool bShow )
if ( bShow && ( pPPortion->IsInvalid() || !pPPortion->nHeight ) )
{
- if ( GetUpdateMode() && !GetTextRanger() )
+ if ( !GetTextRanger() )
{
if ( pPPortion->IsInvalid() )
{
@@ -2973,11 +2973,15 @@ void ImpEditEngine::ShowParagraph( sal_uInt16 nParagraph, sal_Bool bShow )
GetRefDevice()->SetFont( aOldFont );
}
else
+ {
CalcHeight( pPPortion );
+ }
nCurTextHeight += pPPortion->GetHeight();
}
else
+ {
nCurTextHeight = 0x7fffffff;
+ }
}
pPPortion->SetMustRepaint( sal_True );