summaryrefslogtreecommitdiff
path: root/sw/source/core/text
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2012-03-08 17:06:29 +0100
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2012-03-08 17:07:53 +0100
commit1483c90ddc4a9f47b9a7da2d65da12f3e71cee60 (patch)
treee3424326aae83a5c2c99f6128b624a3a41109a32 /sw/source/core/text
parente500deff4c2bc0d29626684039519a326388a778 (diff)
sw: SwTxtFrm formatting, cleaned up useless debug code and translated comments
Diffstat (limited to 'sw/source/core/text')
-rw-r--r--sw/source/core/text/frmform.cxx49
-rw-r--r--sw/source/core/text/txtfly.cxx36
2 files changed, 19 insertions, 66 deletions
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index e417e84f7521..1d1d44453136 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1772,26 +1772,6 @@ void SwTxtFrm::_Format( SwParaPortion *pPara )
void SwTxtFrm::Format( const SwBorderAttrs * )
{
-#if OSL_DEBUG_LEVEL > 1
- const XubString aXXX = GetTxtNode()->GetTxt();
- const SwTwips nDbgY = Frm().Top();
- (void)nDbgY;
- const SwPageFrm *pDbgPage = FindPageFrm();
- const MSHORT nDbgPageNr = pDbgPage->GetPhyPageNum();
- (void)nDbgPageNr;
- // Um zu gucken, ob es einen Ftn-Bereich gibt.
- const SwFrm *pDbgFtnCont = (const SwFrm*)(FindPageFrm()->FindFtnCont());
- (void)pDbgFtnCont;
-
- // nStopAt laesst sich vom CV bearbeiten.
- static MSHORT nStopAt = 0;
- if( nStopAt == GetFrmId() )
- {
- int i = GetFrmId();
- (void)i;
- }
-#endif
-
SWRECTFN( this )
CalcAdditionalFirstLineOffset();
@@ -1951,35 +1931,8 @@ void SwTxtFrm::Format( const SwBorderAttrs * )
if ( pPara )
pPara->SetPrepMustFit( sal_False );
-#if OSL_DEBUG_LEVEL > 1
- // Hier ein Instrumentarium, um ungewoehnlichen Master/Follow-Kombinationen,
- // insbesondere bei Fussnoten, auf die Schliche zu kommen
- if( IsFollow() || GetFollow() )
- {
- SwTxtFrm *pTmpFrm = IsFollow() ? FindMaster() : this;
- const SwPageFrm *pTmpPage = pTmpFrm->FindPageFrm();
- MSHORT nPgNr = pTmpPage->GetPhyPageNum();
- MSHORT nLast;
- MSHORT nDummy = 0; // nur zum Breakpoint setzen
- while( pTmpFrm->GetFollow() )
- {
- pTmpFrm = pTmpFrm->GetFollow();
- nLast = nPgNr;
- pTmpPage = pTmpFrm->FindPageFrm();
- nPgNr = pTmpPage->GetPhyPageNum();
- if( nLast > nPgNr )
- ++nDummy; // schon fast eine Assertion wert
- else if( nLast == nPgNr )
- ++nDummy; // bei Spalten voellig normal, aber sonst!?
- else if( nLast < nPgNr - 1 )
- ++nDummy; // kann schon mal temporaer vorkommen
- }
- }
-#endif
-
CalcBaseOfstForFly();
- // OD 2004-03-17 #i11860#
- _CalcHeightOfLastLine();
+ _CalcHeightOfLastLine(); // #i11860#
}
/*************************************************************************
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 0fc70b8619f9..a3b4630b6bb4 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -2013,16 +2013,16 @@ void SwTxtFly::CalcLeftMargin( SwRect &rFly,
(rFly.*fnRect->fnSetLeft)( nLeft );
}
-/*************************************************************************
- * SwTxtFly::FlyToRect()
- *
- * IN: dokumentglobal (rRect)
- * OUT: dokumentglobal (return-Wert)
- * Liefert zu einem SwFlyFrm das von ihm in Anspruch genommene Rechteck
- * unter Beruecksichtigung der eingestellten Attribute fuer den Abstand
- * zum Text zurueck.
- *************************************************************************/
// #i68520#
+/**
+ Computes the bounds of an anchored object. This takes the
+ object wrapping and contour into account.
+
+ @param pAnchoredObj the object for which to get the bounds
+ @param rLine the bounds of the line to format
+
+ @return the flying object bounds
+ */
SwRect SwTxtFly::AnchoredObjToRect( const SwAnchoredObject* pAnchoredObj,
const SwRect &rLine ) const
{
@@ -2044,15 +2044,15 @@ SwRect SwTxtFly::AnchoredObjToRect( const SwAnchoredObject* pAnchoredObj,
// des Rahmens waechst.
SwAnchoredObjList::size_type nFlyPos = GetPos( pAnchoredObj );
- // Bei LEFT und RIGHT vergroessern wir das Rechteck.
- // Hier gibt es einige Probleme, wenn mehrere Frames zu sehen sind.
- // Zur Zeit wird nur der einfachste Fall angenommen:
- // LEFT bedeutet, dass der Text links vom Frame fliessen soll,
- // d.h. der Frame blaeht sich bis zum rechten Rand der Printarea
- // oder bis zum naechsten Frame auf.
- // Bei RIGHT ist es umgekehrt.
- // Ansonsten wird immer der eingestellte Abstand zwischen Text
- // und Frame aufaddiert.
+ // LEFT and RIGHT, we grow the rectangle.
+ // We have some problems, when several frames are to be seen.
+ // At the moment, only the easier case is assumed:
+ // + LEFT means that the text muss flaw on the left of the frame,
+ // that is that the trame expands to the right edge of the
+ // print area or to the the next frame.
+ // + RIGHT is the opposite.
+ // Otherwise the set distance between text and frame is always
+ // added up.
switch( _GetSurroundForTextWrap( pAnchoredObj ) )
{
case SURROUND_LEFT :