summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Weissenbacher <p.weissenbacher@gmail.com>2014-11-08 15:20:57 +0100
committerNoel Grandin <noelgrandin@gmail.com>2014-11-11 11:44:52 +0000
commit7ed6b9a3c31cd79f88c0d6b29fa76366d7fe8992 (patch)
tree2e6db1ccc977c0338ae9f17066ef4a66714f11cf
parentda2d24a28504d2a3e6fa147e205ffbf30b1112ea (diff)
fdo#39468 Translate German comments - sw/source/core/text
Change-Id: I8f94931ab8e55e8e330350c92251fa8737bfe730 Reviewed-on: https://gerrit.libreoffice.org/12308 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--sw/source/core/text/txtdrop.cxx42
-rw-r--r--sw/source/core/text/txtfld.cxx47
-rw-r--r--sw/source/core/text/txtfly.cxx12
-rw-r--r--sw/source/core/text/txtfrm.cxx357
-rw-r--r--sw/source/core/text/txttab.cxx52
5 files changed, 275 insertions, 235 deletions
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index 7d1271f2c0d8..eeb8e669d086 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -41,9 +41,11 @@
using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star;
-// Calculates if a drop caps portion intersects with a fly
-// The width and height of the drop caps portion are passed as arguments,
-// the position is calculated from the values in rInf
+/**
+ * Calculates if a drop caps portion intersects with a fly
+ * The width and height of the drop caps portion are passed as arguments,
+ * the position is calculated from the values in rInf
+ */
static bool lcl_IsDropFlyInter( const SwTxtFormatInfo &rInf,
sal_uInt16 nWidth, sal_uInt16 nHeight )
{
@@ -88,14 +90,14 @@ SwDropSave::~SwDropSave()
pInf->Y( nY );
}
-// SwDropPortionPart DTor
+/// SwDropPortionPart DTor
SwDropPortionPart::~SwDropPortionPart()
{
delete pFollow;
delete pFnt;
}
-// SwDropPortion CTor, DTor
+/// SwDropPortion CTor, DTor
SwDropPortion::SwDropPortion( const sal_uInt16 nLineCnt,
const sal_uInt16 nDrpHeight,
const sal_uInt16 nDrpDescent,
@@ -119,7 +121,7 @@ SwDropPortion::~SwDropPortion()
pBlink->Delete( this );
}
-// nWishLen = 0 indicates that we want a whole word
+/// nWishLen = 0 indicates that we want a whole word
sal_Int32 SwTxtNode::GetDropLen( sal_Int32 nWishLen ) const
{
sal_Int32 nEnd = GetTxt().getLength();
@@ -166,9 +168,11 @@ sal_Int32 SwTxtNode::GetDropLen( sal_Int32 nWishLen ) const
return i;
}
-// If a dropcap is found the return value is true otherwise false. The
-// drop cap sizes passed back by reference are font height, drop height
-// and drop descent.
+/**
+ * If a dropcap is found the return value is true otherwise false. The
+ * drop cap sizes passed back by reference are font height, drop height
+ * and drop descent.
+ */
bool SwTxtNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescent) const
{
rFontHeight = 0;
@@ -237,7 +241,7 @@ bool SwTxtNode::GetDropSize(int& rFontHeight, int& rDropHeight, int& rDropDescen
return true;
}
-// Manipulate the width, otherwise the chars are being stretched
+/// Manipulate the width, otherwise the chars are being stretched
void SwDropPortion::PaintTxt( const SwTxtPaintInfo &rInf ) const
{
OSL_ENSURE( nDropHeight && pPart && nLines != 1, "Drop Portion painted twice" );
@@ -456,12 +460,12 @@ void SwTxtFormatter::CalcDropHeight( const sal_uInt16 nLines )
}
if ( !Next() )
{
- nDropLns++; // Fix: 11356
+ nDropLns++;
break;
}
}
- // In der letzten Zeile plumpsen wir auf den Zeilenascent!
+ // We hit the line ascent when reaching the last line!
nDropHght = nDropHght - nHeight;
nDropHght = nDropHght + nAscent;
Top();
@@ -481,8 +485,10 @@ void SwTxtFormatter::CalcDropHeight( const sal_uInt16 nLines )
}
}
-// We assume hat the font height doesn't change and that at first there
-// are at least as many lines, as the DropCap-setting claims
+/**
+ * We assume hat the font height doesn't change and that at first there
+ * are at least as many lines, as the DropCap-setting claims
+ */
void SwTxtFormatter::GuessDropHeight( const sal_uInt16 nLines )
{
OSL_ENSURE( nLines, "GuessDropHeight: Give me more Lines!" );
@@ -984,22 +990,22 @@ bool SwDropPortion::Format( SwTxtFormatInfo &rInf )
// reset my length
SetLen( rInf.GetLen() );
- // 7631, 7633: bei Ueberlappungen mit Flys ist Schluss.
+ // Quit when Flys are overlapping
if( ! bFull )
bFull = lcl_IsDropFlyInter( rInf, Width(), nDropHeight );
if( bFull )
{
- // Durch FormatTxt kann nHeight auf 0 gesetzt worden sein
+ // FormatTxt could have caused nHeight to be 0
if ( !Height() )
Height( rInf.GetTxtHeight() );
- // Jetzt noch einmal der ganze Spass
+ // And now for another round
nDropHeight = nLines = 0;
delete pPart;
pPart = NULL;
- // meanwhile use normal formatting
+ // Meanwhile use normal formatting
bFull = SwTxtPortion::Format( rInf );
}
else
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 465c74c43b30..9c3935336411 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -190,7 +190,7 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
}
else if( !pExpFld->IsInBodyTxt() )
{
- // war vorher anders, also erst expandieren, dann umsetzen!!
+ // Was something else previously, thus: expand first, then convert it!
pExpFld->ChangeExpansion(*pFrame,
*static_txtattr_cast<SwTxtFld const*>(pHint));
pExpFld->ChgBodyTxtFlag( true );
@@ -313,15 +313,15 @@ static SwFldPortion * lcl_NewMetaPortion(SwTxtAttr & rHint, const bool bPrefix)
return new SwFldPortion( fix );
}
-/** Try to create a new portion with zero length, for an end of a hint
- (where there is no CH_TXTATR). Because there may be multiple hint ends at a
- given index, m_nHintEndIndex is used to keep track of the already created
- portions. But the portions created here may actually be deleted again,
- due to Underflow. In that case, m_nHintEndIndex must be decremented,
- so the portion will be created again on the next line.
+/**
+ * Try to create a new portion with zero length, for an end of a hint
+ * (where there is no CH_TXTATR). Because there may be multiple hint ends at a
+ * given index, m_nHintEndIndex is used to keep track of the already created
+ * portions. But the portions created here may actually be deleted again,
+ * due to Underflow. In that case, m_nHintEndIndex must be decremented,
+ * so the portion will be created again on the next line.
*/
-SwExpandPortion *
-SwTxtFormatter::TryNewNoLengthPortion(SwTxtFormatInfo & rInfo)
+SwExpandPortion * SwTxtFormatter::TryNewNoLengthPortion(SwTxtFormatInfo & rInfo)
{
if (pHints)
{
@@ -406,9 +406,11 @@ SwLinePortion *SwTxtFormatter::NewExtraPortion( SwTxtFormatInfo &rInf )
return pRet;
}
-// OOXML spec says that w:rPr inside w:pPr specifies formatting for the paragraph mark symbol (i.e. the control
-// character than can be configured to be shown). However, in practice MSO also uses it as direct formatting
-// for numbering in that paragraph. I don't know if the problem is in the spec or in MSWord.
+/**
+ * OOXML spec says that w:rPr inside w:pPr specifies formatting for the paragraph mark symbol (i.e. the control
+ * character than can be configured to be shown). However, in practice MSO also uses it as direct formatting
+ * for numbering in that paragraph. I don't know if the problem is in the spec or in MSWord.
+ */
static void checkApplyParagraphMarkFormatToNumbering( SwFont* pNumFnt, SwTxtFormatInfo& rInf, const IDocumentSettingAccess* pIDSA )
{
SwTxtNode* node = rInf.GetTxtFrm()->GetTxtNode();
@@ -442,7 +444,7 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
const SwTxtNode* pTxtNd = GetTxtFrm()->GetTxtNode();
const SwNumRule* pNumRule = pTxtNd->GetNumRule();
- // hat ein "gueltige" Nummer ?
+ // Has a "valid" number?
if( pTxtNd->IsNumbered() && pTxtNd->IsCountedInList())
{
int nLevel = pTxtNd->GetActualListLevel();
@@ -477,9 +479,9 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
}
else
{
- // Der SwFont wird dynamisch angelegt und im CTOR uebergeben,
- // weil das CharFmt nur einen SV-Font zurueckliefert.
- // Im Dtor vom SwNumberPortion wird der SwFont deletet.
+ // The SwFont is created dynamically and passed in the ctor,
+ // as the CharFmt only returns an SV-Font.
+ // In the dtor of SwNumberPortion, the SwFont is deleted.
SwFont *pNumFnt = 0;
const SwAttrSet* pFmt = rNumFmt.GetCharFmt() ?
&rNumFmt.GetCharFmt()->GetAttrSet() :
@@ -491,7 +493,6 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
const vcl::Font *pFmtFnt = rNumFmt.GetBulletFont();
// Build a new bullet font basing on the current paragraph font:
-
pNumFnt = new SwFont( &rInf.GetCharAttr(), pIDSA );
// #i53199#
@@ -514,7 +515,6 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
// Apply the explicit attributes from the character style
// associated with the numering to the new bullet font.
-
if( pFmt )
pNumFnt->SetDiffFnt( pFmt, pIDSA );
@@ -549,16 +549,14 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
aTxt += pTxtNd->GetLabelFollowedBy();
}
- // 7974: Nicht nur eine Optimierung...
- // Eine Numberportion ohne Text wird die Breite von 0
- // erhalten. Die nachfolgende Textportion wird im BreakLine
- // in das BreakCut laufen, obwohl rInf.GetLast()->GetFlyPortion()
- // vorliegt!
+ // Not just an optimization ...
+ // A number portion without text will be assigned a width of 0.
+ // The succeeding text portion will flow into the BreakCut in the BreakLine,
+ // although we have rInf.GetLast()->GetFlyPortion()!
if( !aTxt.isEmpty() )
{
// Build a new numbering font basing on the current paragraph font:
-
pNumFnt = new SwFont( &rInf.GetCharAttr(), pIDSA );
// #i53199#
@@ -573,7 +571,6 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
// Apply the explicit attributes from the character style
// associated with the numering to the new bullet font.
-
if( pFmt )
pNumFnt->SetDiffFnt( pFmt, pIDSA );
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index 3693e0892cf7..43d837341ea2 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -208,10 +208,10 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt,
const long nXPos, const bool bRight )
{
SwRect aRet;
- sal_uInt16 nPos = 0; // Suche im Cache ...
+ sal_uInt16 nPos = 0; // Search in the Cache
while( nPos < GetCount() && pObj != pSdrObj[ nPos ] )
++nPos;
- if( GetCount() == nPos ) // nicht gefunden
+ if( GetCount() == nPos ) // Not found
{
if( nObjCnt == POLY_CNT )
{
@@ -398,7 +398,7 @@ SwRect SwTxtFly::_GetFrm( const SwRect &rRect, bool bTop ) const
if( bTop )
(aRet.*fnRect->fnSetTop)( (rRect.*fnRect->fnGetTop)() );
- // 8110: Do not always adapt the bottom
+ // Do not always adapt the bottom
const SwTwips nRetBottom = (aRet.*fnRect->fnGetBottom)();
const SwTwips nRectBottom = (rRect.*fnRect->fnGetBottom)();
if ( (*fnRect->fnYDiff)( nRetBottom, nRectBottom ) > 0 ||
@@ -655,8 +655,10 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
}
}
-// #i26945# - change first parameter
-// Now it's the <SwAnchoredObject> instance of the floating screen object
+/**
+ * #i26945# - change first parameter
+ * Now it's the <SwAnchoredObject> instance of the floating screen object
+ */
bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
const bool bInFtn,
const bool bInFooterOrHeader )
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 49aa5ca22e75..c83eb5e2bbb5 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -79,7 +79,7 @@
TYPEINIT1( SwTxtFrm, SwCntntFrm );
-// Switches width and height of the text frame
+/// Switches width and height of the text frame
void SwTxtFrm::SwapWidthAndHeight()
{
if ( ! bIsSwapped )
@@ -112,8 +112,10 @@ void SwTxtFrm::SwapWidthAndHeight()
bIsSwapped = ! bIsSwapped;
}
-// Calculates the coordinates of a rectangle when switching from
-// horizontal to vertical layout.
+/**
+ * Calculates the coordinates of a rectangle when switching from
+ * horizontal to vertical layout.
+ */
void SwTxtFrm::SwitchHorizontalToVertical( SwRect& rRect ) const
{
// calc offset inside frame
@@ -148,8 +150,10 @@ void SwTxtFrm::SwitchHorizontalToVertical( SwRect& rRect ) const
rRect.Height( nWidth );
}
-// Calculates the coordinates of a point when switching from
-// horizontal to vertical layout.
+/**
+ * Calculates the coordinates of a point when switching from
+ * horizontal to vertical layout.
+ */
void SwTxtFrm::SwitchHorizontalToVertical( Point& rPoint ) const
{
// calc offset inside frame
@@ -169,8 +173,10 @@ void SwTxtFrm::SwitchHorizontalToVertical( Point& rPoint ) const
rPoint.Y() = Frm().Top() + nOfstX;
}
-// Calculates the a limit value when switching from
-// horizontal to vertical layout.
+/**
+ * Calculates the a limit value when switching from
+ * horizontal to vertical layout.
+ */
long SwTxtFrm::SwitchHorizontalToVertical( long nLimit ) const
{
Point aTmp( 0, nLimit );
@@ -178,14 +184,15 @@ long SwTxtFrm::SwitchHorizontalToVertical( long nLimit ) const
return aTmp.X();
}
-// Calculates the coordinates of a rectangle when switching from
-// vertical to horizontal layout.
+/**
+ * Calculates the coordinates of a rectangle when switching from
+ * vertical to horizontal layout.
+ */
void SwTxtFrm::SwitchVerticalToHorizontal( SwRect& rRect ) const
{
long nOfstX;
// calc offset inside frame
-
if ( IsVertLR() )
nOfstX = rRect.Left() - Frm().Left();
else
@@ -207,14 +214,15 @@ void SwTxtFrm::SwitchVerticalToHorizontal( SwRect& rRect ) const
rRect.Height( nHeight );
}
-// Calculates the coordinates of a point when switching from
-// vertical to horizontal layout.
+/**
+ * Calculates the coordinates of a point when switching from
+ * vertical to horizontal layout.
+ */
void SwTxtFrm::SwitchVerticalToHorizontal( Point& rPoint ) const
{
long nOfstX;
// calc offset inside frame
-
if ( IsVertLR() )
nOfstX = rPoint.X() - Frm().Left();
else
@@ -232,8 +240,10 @@ void SwTxtFrm::SwitchVerticalToHorizontal( Point& rPoint ) const
rPoint.Y() = Frm().Top() + nOfstX;
}
-// Calculates the a limit value when switching from
-// vertical to horizontal layout.
+/**
+ * Calculates the a limit value when switching from
+ * vertical to horizontal layout.
+ */
long SwTxtFrm::SwitchVerticalToHorizontal( long nLimit ) const
{
Point aTmp( nLimit, 0 );
@@ -418,8 +428,7 @@ bool SwTxtFrm::IsHiddenNow() const
{
SwFrmSwapper aSwapper( this, true );
- if( !Frm().Width() && IsValid() && GetUpper()->IsValid() )
- // invalid when stack overflows (StackHack)!
+ if( !Frm().Width() && IsValid() && GetUpper()->IsValid() ) // invalid when stack overflows (StackHack)!
{
// OSL_FAIL( "SwTxtFrm::IsHiddenNow: thin frame" );
return true;
@@ -445,7 +454,7 @@ bool SwTxtFrm::IsHiddenNow() const
return false;
}
-// removes Textfrm's attachments, when it's hidden
+/// Removes Textfrm's attachments, when it's hidden
void SwTxtFrm::HideHidden()
{
OSL_ENSURE( !GetFollow() && IsHiddenNow(),
@@ -486,14 +495,16 @@ void SwTxtFrm::HideFootnotes( sal_Int32 nStart, sal_Int32 nEnd )
}
}
-// #120729# - hotfix
-// as-character anchored graphics, which are used for a graphic bullet list.
-// As long as these graphic bullet list aren't imported, do not hide a
-// at-character anchored object, if
-// (a) the document is an imported WW8 document -
-// checked by checking certain compatibility options -,
-// (b) the paragraph is the last content in the document and
-// (c) the anchor character is an as-character anchored graphic.
+/**
+ * #120729# - hotfix
+ * as-character anchored graphics, which are used for a graphic bullet list.
+ * As long as these graphic bullet list aren't imported, do not hide a
+ * at-character anchored object, if
+ * (a) the document is an imported WW8 document -
+ * checked by checking certain compatibility options -
+ * (b) the paragraph is the last content in the document and
+ * (c) the anchor character is an as-character anchored graphic.
+ */
bool sw_HideObj( const SwTxtFrm& _rFrm,
const RndStdIds _eAnchorType,
const sal_Int32 _nObjAnchorPos,
@@ -544,16 +555,17 @@ bool sw_HideObj( const SwTxtFrm& _rFrm,
return bRet;
}
-/** method to hide/show objects
-
- OD 2004-01-15 #110582#
- method hides respectively shows objects, which are anchored at paragraph,
- at/as a character of the paragraph, corresponding to the paragraph and
- paragraph portion visibility.
-
- - is called from HideHidden() - should hide objects in hidden paragraphs and
- - from _Format() - should hide/show objects in partly visible paragraphs
-*/
+/**
+ * Hide/show objects
+ * OD 2004-01-15 #110582#
+ *
+ * Method hides respectively shows objects, which are anchored at paragraph,
+ * at/as a character of the paragraph, corresponding to the paragraph and
+ * paragraph portion visibility.
+ *
+ * - is called from HideHidden() - should hide objects in hidden paragraphs and
+ * - from _Format() - should hide/show objects in partly visible paragraphs
+ */
void SwTxtFrm::HideAndShowObjects()
{
if ( GetDrawObjs() )
@@ -632,10 +644,12 @@ void SwTxtFrm::HideAndShowObjects()
}
}
-// Returns the first possible break point in the current line.
-// This method is used in SwTxtFrm::Format() to decide whether the previous
-// line has to be formatted as well.
-// nFound is <= nEndLine.
+/**
+ * Returns the first possible break point in the current line.
+ * This method is used in SwTxtFrm::Format() to decide whether the previous
+ * line has to be formatted as well.
+ * nFound is <= nEndLine.
+ */
sal_Int32 SwTxtFrm::FindBrk( const OUString &rTxt,
const sal_Int32 nStart,
const sal_Int32 nEnd ) const
@@ -666,8 +680,8 @@ bool SwTxtFrm::IsIdxInside( const sal_Int32 nPos, const sal_Int32 nLen ) const
if( nLen != COMPLETE_STRING && GetOfst() > nPos + nLen ) // the range preceded us
return false;
- if( !GetFollow() ) // the range doesn't precede us,
- return true; // nobody follows us.
+ if( !GetFollow() ) // the range doesn't precede us,
+ return true; // nobody follows us.
const sal_Int32 nMax = GetFollow()->GetOfst();
@@ -753,7 +767,7 @@ void SwTxtFrm::CalcLineSpace()
aNewSize.Height() = (aLine.Y() - Frm().Top()) + aLine.GetLineHeight();
SwTwips nDelta = aNewSize.Height() - Prt().Height();
- // 4291: underflow with free-flying frames
+ // Underflow with free-flying frames
if( aInf.GetTxtFly().IsOn() )
{
SwRect aTmpFrm( Frm() );
@@ -869,8 +883,10 @@ static void lcl_ModifyOfst( SwTxtFrm* pFrm, sal_Int32 nPos, sal_Int32 nLen )
}
}
-// Related: fdo#56031 filter out attribute changes that don't matter for
-// humans/a11y to stop flooding the destination mortal with useless noise
+/**
+ * Related: fdo#56031 filter out attribute changes that don't matter for
+ * humans/a11y to stop flooding the destination mortal with useless noise
+ */
static bool isA11yRelevantAttribute(sal_uInt16 nWhich)
{
return nWhich != RES_CHRATR_RSID;
@@ -936,7 +952,7 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
{
if( !nLen )
{
- // 6969: refresh NumPortions even when line is empty!
+ // Refresh NumPortions even when line is empty!
if( nPos )
InvalidateSize();
else
@@ -988,12 +1004,12 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
nLen = ((SwUpdateAttr*)pNew)->getEnd() - nPos;
if( IsIdxInside( nPos, nLen ) )
{
- // Es muss in jedem Fall neu formatiert werden,
- // auch wenn der invalidierte Bereich null ist.
- // Beispiel: leere Zeile, 14Pt einstellen !
+ // We need to reformat anyways, even if the invalidated
+ // area is NULL.
+ // E.g.: empty line, set 14 pt!
// if( !nLen ) nLen = 1;
- // 6680: FtnNummern muessen formatiert werden.
+ // FtnNummbers need to be formatted
if( !nLen )
nLen = 1;
@@ -1277,7 +1293,7 @@ void SwTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
}
break;
- // 6870: process SwDocPosUpdate
+ // Process SwDocPosUpdate
case RES_DOCPOS_UPDATE:
{
if( pOld && pNew )
@@ -1360,7 +1376,7 @@ void SwTxtFrm::PrepWidows( const sal_uInt16 nNeed, bool bNotify )
sal_uInt16 nHave = nNeed;
- // Wir geben ein paar Zeilen ab und schrumpfen im CalcPreps()
+ // We yield a few lines and shrink in CalcPreps()
SWAP_IF_NOT_SWAPPED( this )
SwTxtSizeInfo aInf( this );
@@ -1373,13 +1389,13 @@ void SwTxtFrm::PrepWidows( const sal_uInt16 nNeed, bool bNotify )
--nHave;
nTmpLen = aLine.GetCurr()->GetLen();
}
- // In dieser Ecke tummelten sich einige Bugs: 7513, 7606.
- // Wenn feststeht, dass Zeilen abgegeben werden koennen,
- // muss der Master darueber hinaus die Widow-Regel ueberpruefen.
+
+ // If it's certain that we can yield lines, the Master needs
+ // to check the widow rule
if( !nHave )
{
bool bSplit = true;
- if( !IsFollow() ) // only a master decides about orphans
+ if( !IsFollow() ) // only a master decides about orphans
{
const WidowsAndOrphans aWidOrp( this );
bSplit = ( aLine.GetLineNr() >= aWidOrp.GetOrphansLines() &&
@@ -1441,15 +1457,15 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
switch ( ePrep )
{
case PREP_BOSS_CHGD:
- SetInvalidVert( true ); // Test
+ SetInvalidVert( true ); // Test
case PREP_WIDOWS_ORPHANS:
case PREP_WIDOWS:
case PREP_FTN_GONE : return;
case PREP_POS_CHGD :
{
- // Auch in (spaltigen) Bereichen ist ein InvalidateSize notwendig,
- // damit formatiert wird und ggf. das bUndersized gesetzt wird.
+ // We also need an InvalidateSize for Areas (with and without columns),
+ // so that we format and bUndersized is set (if needed)
if( IsInFly() || IsInSct() )
{
SwTwips nTmpBottom = GetUpper()->Frm().Top() +
@@ -1457,11 +1473,11 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
if( nTmpBottom < Frm().Bottom() )
break;
}
- // are there any free-flying frames on this page?
+ // Are there any free-flying frames on this page?
SwTxtFly aTxtFly( this );
if( aTxtFly.IsOn() )
{
- // does any free-flying frame overlap?
+ // Does any free-flying frame overlap?
if ( aTxtFly.Relax() || IsUndersized() )
break;
}
@@ -1485,7 +1501,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
if( !HasPara() && PREP_MUST_FIT != ePrep )
{
- SetInvalidVert( true ); // Test
+ SetInvalidVert( true ); // Test
OSL_ENSURE( !IsLocked(), "SwTxtFrm::Prepare: three of a perfect pair" );
if ( bNotify )
InvalidateSize();
@@ -1494,7 +1510,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
return;
}
- // get object from cache while locking
+ // Get object from cache while locking
SwTxtLineAccess aAccess( this );
SwParaPortion *pPara = aAccess.GetPara();
@@ -1504,7 +1520,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
Prt().Height(0);
_InvalidatePrt();
_InvalidateSize();
- /* no break here */
+ /* no break here */
case PREP_ADJUST_FRM : pPara->SetPrepAdjust();
if( IsFtnNumFrm() != pPara->IsFtnNum() ||
IsUndersized() )
@@ -1515,7 +1531,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
}
break;
case PREP_MUST_FIT : pPara->SetPrepMustFit();
- /* no break here */
+ /* no break here */
case PREP_WIDOWS_ORPHANS : pPara->SetPrepAdjust();
break;
@@ -1532,17 +1548,16 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
SwTxtFtn *pFtn = (SwTxtFtn *)pVoid;
if( IsInFtn() )
{
- // am I the first TxtFrm of a footnote?
+ // Am I the first TxtFrm of a footnote?
if( !GetPrev() )
- // Wir sind also ein TxtFrm der Fussnote, die
- // die Fussnotenzahl zur Anzeige bringen muss.
- // Oder den ErgoSum-Text...
+ // So we're a TxtFrm of the footnote, which has
+ // to display the footnote number or the ErgoSum text
InvalidateRange( SwCharRange( 0, 1 ), 1);
if( !GetNext() )
{
- // Wir sind der letzte Ftn, jetzt muessten die
- // QuoVadis-Texte geupdated werden.
+ // We're the last Ftn; we need to update the
+ // QuoVadis texts now
const SwFtnInfo &rFtnInfo = GetNode()->GetDoc()->GetFtnInfo();
if( !pPara->UpdateQuoVadis( rFtnInfo.aQuoVadis ) )
{
@@ -1555,7 +1570,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
}
else
{
- // we are the TxtFrm _with_ the footnote
+ // We are the TxtFrm _with_ the footnote
const sal_Int32 nPos = pFtn->GetStart();
InvalidateRange( SwCharRange( nPos, 1 ), 1);
}
@@ -1563,7 +1578,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
}
case PREP_BOSS_CHGD :
{
- // Test
+ // Test
{
SetInvalidVert( false );
bool bOld = IsVertical();
@@ -1587,7 +1602,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
if( lcl_ErgoVadis( this, nPos, PREP_ERGOSUM ) )
InvalidateRange( SwCharRange( nPos, 1 ), 0 );
}
- // 4739: if we have a page number field, we must invalidate those spots
+ // If we have a page number field, we must invalidate those spots
SwpHints *pHints = GetTxtNode()->GetpSwpHints();
if( pHints )
{
@@ -1603,10 +1618,10 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
if( nStart >= nEnd )
break;
- // 4029: wenn wir zurueckfliessen und eine Ftn besitzen, so
- // fliesst die Ftn in jedem Fall auch mit. Damit sie nicht im
- // Weg steht, schicken wir uns ein ADJUST_FRM.
- // pVoid != 0 bedeutet MoveBwd()
+ // If we're flowing back and own a Ftn, the Ftn also flows
+ // with us. So that it doesn't obstruct us, we send ourselves
+ // a ADJUST_FRM.
+ // pVoid != 0 means MoveBwd()
const sal_uInt16 nWhich = pHt->Which();
if( RES_TXTATR_FIELD == nWhich ||
(HasFtn() && pVoid && RES_TXTATR_FTN == nWhich))
@@ -1632,7 +1647,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
InvalidatePrt();
}
- // if we don't overlap with anybody:
+ // If we don't overlap with anybody:
// did any free-flying frame overlapped _before_ the position change?
bool bFormat = pPara->HasFly();
if( !bFormat )
@@ -1664,11 +1679,11 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
}
if( !bFormat )
{
- // are there any free-flying frames on this page?
+ // Are there any free-flying frames on this page?
SwTxtFly aTxtFly( this );
if( aTxtFly.IsOn() )
{
- // does any free-flying frame overlap?
+ // Does any free-flying frame overlap?
bFormat = aTxtFly.Relax() || IsUndersized();
}
}
@@ -1690,15 +1705,16 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
{
if( GetTxtNode()->GetSwAttrSet().GetRegister().GetValue() )
Prepare( PREP_REGISTER, 0, bNotify );
- // Durch Positionsverschiebungen mit Ftns muessen die
- // Frames neu adjustiert werden.
+
+ // The Frames need to be readjusted, which caused by changes
+ // in position
else if( HasFtn() )
{
Prepare( PREP_ADJUST_FRM, 0, bNotify );
_InvalidateSize();
}
else
- return; // damit kein SetPrep() erfolgt.
+ return; // So that there's no SetPrep()
}
break;
}
@@ -1707,7 +1723,8 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
{
pPara->SetPrepAdjust();
CalcLineSpace();
- // possible that pPara was deleted above; retrieve it again
+
+ // It's possible that pPara was deleted above; retrieve it again
pPara = aAccess.GetPara();
InvalidateSize();
_InvalidatePrt();
@@ -1723,16 +1740,16 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
break;
case PREP_FTN_GONE :
{
- // Wenn ein Follow uns ruft, weil eine Fussnote geloescht wird, muss unsere
- // letzte Zeile formatiert werden, damit ggf. die erste Zeile des Follows
- // hochrutschen kann, die extra auf die naechste Seite gerutscht war, um mit
- // der Fussnote zusammen zu sein, insbesondere bei spaltigen Bereichen.
+ // If a Follow is calling us, because a footnote is being deleted, our last
+ // line has to be formatted, so that the first line of the Follow can flow up.
+ // Which had flowed to the next page to be together with the footnote (this is
+ // especially true for areas with columns)
OSL_ENSURE( GetFollow(), "PREP_FTN_GONE darf nur vom Follow gerufen werden" );
sal_Int32 nPos = GetFollow()->GetOfst();
- if( IsFollow() && GetOfst() == nPos ) // falls wir gar keine Textmasse besitzen,
- FindMaster()->Prepare( PREP_FTN_GONE ); // rufen wir das Prepare unseres Masters
+ if( IsFollow() && GetOfst() == nPos ) // If we don't have a mass of text, we call our
+ FindMaster()->Prepare( PREP_FTN_GONE ); // Master's Prepare
if( nPos )
- --nPos; // das Zeichen vor unserem Follow
+ --nPos; // The char preceding our Follow
InvalidateRange( SwCharRange( nPos, 1 ), 0 );
return;
}
@@ -1780,19 +1797,21 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
else
_InvalidateSize();
}
- return; // no SetPrep() happened
+ return; // no SetPrep() happened
}
}
if( pPara )
pPara->SetPrep();
}
-// Small Helper class:
-// Prepares a test format.
-// The frame is changed in size and position, its SwParaPortion is moved aside
-// and a new one is created.
-// To achieve this, run formatting with bTestFormat flag set.
-// In the destructor the TxtFrm is reset to its original state.
+/**
+ * Small Helper class:
+ * Prepares a test format.
+ * The frame is changed in size and position, its SwParaPortion is moved aside
+ * and a new one is created.
+ * To achieve this, run formatting with bTestFormat flag set.
+ * In the destructor the TxtFrm is reset to its original state.
+ */
class SwTestFormat
{
SwTxtFrm *pFrm;
@@ -1874,17 +1893,18 @@ bool SwTxtFrm::TestFormat( const SwFrm* pPrv, SwTwips &rMaxHeight, bool &bSplit
return SwTxtFrm::WouldFit( rMaxHeight, bSplit, true );
}
-/* SwTxtFrm::WouldFit()
- * true: wenn ich aufspalten kann.
- * Es soll und braucht nicht neu formatiert werden.
- * Wir gehen davon aus, dass bereits formatiert wurde und dass
- * die Formatierungsdaten noch aktuell sind.
- * Wir gehen davon aus, dass die Framebreiten des evtl. Masters und
- * Follows gleich sind. Deswegen wird kein FindBreak() mit FindOrphans()
- * gerufen.
- * Die benoetigte Hoehe wird von nMaxHeight abgezogen!
+/**
+ * We should not and don't need to reformat.
+ * We assume that we already formatted and that the formatting
+ * data is still current.
+ *
+ * We also assume that the frame width of the Master and Follow
+ * are the same. That's why we're not calling FindBreak() for
+ * FindOrphans().
+ * The required height is coming from nMaxHeight.
+ *
+ * @returns true if I can split
*/
-
bool SwTxtFrm::WouldFit( SwTwips &rMaxHeight, bool &bSplit, bool bTst )
{
OSL_ENSURE( ! IsVertical() || ! IsSwapped(),
@@ -1915,16 +1935,15 @@ bool SwTxtFrm::WouldFit( SwTwips &rMaxHeight, bool &bSplit, bool bTst )
}
}
- // In sehr unguenstigen Faellen kann GetPara immer noch 0 sein.
- // Dann returnen wir true, um auf der neuen Seite noch einmal
- // anformatiert zu werden.
+ // GetPara can still be 0 in edge cases
+ // We return true in order to be reformatted on the new Page
OSL_ENSURE( HasPara() || IsHiddenNow(), "WouldFit: GetFormatted() and then !HasPara()" );
if( !HasPara() || ( !(Frm().*fnRect->fnGetHeight)() && IsHiddenNow() ) )
return true;
- // Da das Orphan-Flag nur sehr fluechtig existiert, wird als zweite
- // Bedingung ueberprueft, ob die Rahmengroesse durch CalcPreps
- // auf riesengross gesetzt wird, um ein MoveFwd zu erzwingen.
+ // Because the Orphan flag only exists for a short moment, we also check
+ // whether the Framesize is set to very huge by CalcPreps, in order to
+ // force a MoveFwd
if( IsWidow() || ( bVert ?
( 0 == Frm().Left() ) :
( LONG_MAX - 20000 < Frm().Bottom() ) ) )
@@ -1932,11 +1951,10 @@ bool SwTxtFrm::WouldFit( SwTwips &rMaxHeight, bool &bSplit, bool bTst )
SetWidow(false);
if ( GetFollow() )
{
- // Wenn wir hier durch eine Widow-Anforderung unseres Follows gelandet
- // sind, wird ueberprueft, ob es ueberhaupt einen Follow mit einer
- // echten Hoehe gibt, andernfalls (z.B. in neu angelegten SctFrms)
- // ignorieren wir das IsWidow() und pruefen doch noch, ob wir
- // genung Platz finden.
+ // If we've ended up here due to a Widow request by our Follow, we check
+ // whether there's a Follow with a real height at all.
+ // Else (e.g. for newly created SctFrms) we ignore the IsWidow() and
+ // still check if we can find enough room
if( ( ( ! bVert && LONG_MAX - 20000 >= Frm().Bottom() ) ||
( bVert && 0 < Frm().Left() ) ) &&
( GetFollow()->IsVertical() ?
@@ -1992,8 +2010,8 @@ sal_uInt16 SwTxtFrm::GetParHeight() const
"SwTxtFrm::GetParHeight with swapped frame" );
if( !HasPara() )
- { // Fuer nichtleere Absaetze ist dies ein Sonderfall, da koennen wir
- // bei UnderSized ruhig nur 1 Twip mehr anfordern.
+ { // For non-empty paragraphs this is a special case
+ // For UnderSized we can simply just ask 1 Twip more
sal_uInt16 nRet = (sal_uInt16)Prt().SSize().Height();
if( IsUndersized() )
{
@@ -2005,11 +2023,15 @@ sal_uInt16 SwTxtFrm::GetParHeight() const
return nRet;
}
- // FME, OD 08.01.2004 #i11859# - refactoring and improve code
+ // TODO: Refactor and improve code
const SwLineLayout* pLineLayout = GetPara();
sal_uInt16 nHeight = pLineLayout ? pLineLayout->GetRealHeight() : 0;
- if( GetOfst() && !IsFollow() ) // Ist dieser Absatz gescrollt? Dann ist unsere
- nHeight *= 2; // bisherige Hoehe mind. eine Zeilenhoehe zu gering
+
+ // Is this paragraph scrolled? Our height until now is at least
+ // one line height too low then
+ if( GetOfst() && !IsFollow() )
+ nHeight *= 2;
+
// OD 2004-03-04 #115793#
while ( pLineLayout && pLineLayout->GetNext() )
{
@@ -2020,23 +2042,26 @@ sal_uInt16 SwTxtFrm::GetParHeight() const
return nHeight;
}
-// returns this _always_ in the formated state!
+/**
+ * @returns this _always_ in the formatted state!
+ */
SwTxtFrm* SwTxtFrm::GetFormatted( bool bForceQuickFormat )
{
SWAP_IF_SWAPPED( this )
- // Kann gut sein, dass mir der IdleCollector mir die gecachten
- // Informationen entzogen hat. Calc() ruft unser Format.
- // Nicht bei leeren Absaetzen!
+ // The IdleCollector could've removed my cached information
+ // Calc() calls our format
+ // Not for empty paragraphs
if( !HasPara() && !(IsValid() && IsEmpty()) )
{
// Calc() must be called, because frame position can be wrong
const bool bFormat = GetValidSizeFlag();
Calc();
- // Es kann durchaus sein, dass Calc() das Format()
- // nicht anstiess (weil wir einst vom Idle-Zerstoerer
- // aufgefordert wurden unsere Formatinformationen wegzuschmeissen).
- // 6995: Optimierung mit FormatQuick()
+
+ // It could be that Calc() did not trigger Format(), because
+ // we've been asked by the IdleCollector to throw away our
+ // format information
+ // Optimization with FormatQuick()
if( bFormat && !FormatQuick( bForceQuickFormat ) )
Format();
}
@@ -2097,11 +2122,12 @@ SwTwips SwTxtFrm::CalcFitToContent()
return nMax;
}
-/** simulate format for a list item paragraph, whose list level attributes
- are in LABEL_ALIGNMENT mode, in order to determine additional first
- line offset for the real text formatting due to the value of label
- adjustment attribute of the list level.
-*/
+/**
+ * Simulate format for a list item paragraph, whose list level attributes
+ * are in LABEL_ALIGNMENT mode, in order to determine additional first
+ * line offset for the real text formatting due to the value of label
+ * adjustment attribute of the list level.
+ */
void SwTxtFrm::CalcAdditionalFirstLineOffset()
{
if ( IsLocked() )
@@ -2174,26 +2200,28 @@ void SwTxtFrm::CalcAdditionalFirstLineOffset()
}
}
-/** determine height of last line for the calculation of the proportional line
- spacing
-
- OD 08.01.2004 #i11859#
- OD 2004-03-17 #i11860# - method <GetHeightOfLastLineForPropLineSpacing()>
- replace by method <_CalcHeightOfLastLine()>. Height of last line will be
- stored in new member <mnHeightOfLastLine> and can be accessed via method
- <GetHeightOfLastLine()>
- OD 2005-05-20 #i47162# - introduce new optional parameter <_bUseFont>
- in order to force the usage of the former algorithm to determine the
- height of the last line, which uses the font.
-*/
+/**
+ * Determine the height of the last line for the calculation of
+ * the proportional line spacing
+ *
+ * Height of last line will be stored in new member
+ * mnHeightOfLastLine and can be accessed via method
+ * GetHeightOfLastLine()
+ *
+ * @param _bUseFont force the usage of the former algorithm to
+ * determine the height of the last line, which
+ * uses the font
+ */
void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
{
// #i71281#
// invalidate printing area, if height of last line changes
const SwTwips mnOldHeightOfLastLine( mnHeightOfLastLine );
+
// determine output device
SwViewShell* pVsh = getRootFrm()->GetCurrShell();
OSL_ENSURE( pVsh, "<SwTxtFrm::_GetHeightOfLastLineForPropLineSpacing()> - no SwViewShell" );
+
// #i78921# - make code robust, according to provided patch
// There could be no <SwViewShell> instance in the case of loading a binary
// StarOffice file format containing an embedded Writer document.
@@ -2216,7 +2244,6 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
}
// determine height of last line
-
if ( _bUseFont || pIDSA->get(IDocumentSettingAccess::OLD_LINE_SPACING ) )
{
// former determination of last line height for proprotional line
@@ -2314,15 +2341,15 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
}
}
-// OD 07.01.2004 #i11859# - change return data type
-// add default parameter <_bNoPropLineSpacing> to control, if the
-// value of a proportional line spacing is returned or not
-// OD 07.01.2004 - trying to describe purpose of method:
-// Method returns the value of the inter line spacing for a text frame.
-// Such a value exists for proportional line spacings ("1,5 Lines",
-// "Double", "Proportional" and for leading line spacing ("Leading").
-// By parameter <_bNoPropLineSpace> (default value false) it can be
-// controlled, if the value of a proportional line spacing is returned.
+/**
+ * Method returns the value of the inter line spacing for a text frame.
+ * Such a value exists for proportional line spacings ("1,5 Lines",
+ * "Double", "Proportional" and for leading line spacing ("Leading").
+ *
+ * @param _bNoPropLineSpacing (default = false) control whether the
+ * value of a proportional line spacing is
+ * returned or not
+ */
long SwTxtFrm::GetLineSpace( const bool _bNoPropLineSpace ) const
{
long nRet = 0;
@@ -2340,7 +2367,7 @@ long SwTxtFrm::GetLineSpace( const bool _bNoPropLineSpace ) const
break;
}
- // OD 2004-03-17 #i11860# - use method <GetHeightOfLastLine()>
+ // OD 2004-03-17 #i11860# - use method GetHeightOfLastLine()
nRet = GetHeightOfLastLine();
long nTmp = nRet;
@@ -2545,7 +2572,9 @@ const SwScriptInfo* SwTxtFrm::GetScriptInfo() const
return pPara ? &pPara->GetScriptInfo() : 0;
}
-// Helper function for SwTxtFrm::CalcBasePosForFly()
+/**
+ * Helper function for SwTxtFrm::CalcBasePosForFly()
+ */
static SwTwips lcl_CalcFlyBasePos( const SwTxtFrm& rFrm, SwRect aFlyRect,
SwTxtFly& rTxtFly )
{
@@ -2643,7 +2672,9 @@ void SwTxtFrm::CalcBaseOfstForFly()
mnFlyAnchorOfstNoWrap = nRet2 - nLeft;
}
-/* repaint all text frames of the given text node */
+/**
+ * Repaint all text frames of the given text node
+ */
void SwTxtFrm::repaintTextFrames( const SwTxtNode& rNode )
{
SwIterator<SwTxtFrm,SwTxtNode> aIter( rNode );
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index ad07e61f089d..144bb86ba882 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -35,12 +35,14 @@
#include <porfld.hxx>
#include <boost/scoped_ptr.hpp>
-//#i24363# tab stops relative to indent
-/* Return the first tab stop that is > nSearchPos.
+/**
+ * #i24363# tab stops relative to indent
+ *
+ * Return the first tab stop that is > nSearchPos.
* If the tab stop is outside the print area, we
- * return 0 if it is not the first tab stop.*/
-const SvxTabStop *SwLineInfo::GetTabStop( const SwTwips nSearchPos,
- const SwTwips nRight ) const
+ * return 0 if it is not the first tab stop.
+ */
+const SvxTabStop *SwLineInfo::GetTabStop( const SwTwips nSearchPos, const SwTwips nRight ) const
{
for( sal_uInt16 i = 0; i < pRuler->Count(); ++i )
{
@@ -81,8 +83,7 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
: pFrm->Frm().Left() +
( bTabsRelativeToIndent ? GetTabLeft() : 0 );
- // nLinePos: The absolute position, where we started the line formatting.
-
+ // The absolute position, where we started the line formatting
SwTwips nLinePos = GetLeftMargin();
if ( bRTL )
{
@@ -91,16 +92,14 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
nLinePos = aPoint.X();
}
- // nTabPos: The current position, relative to the line start.
-
+ // The current position, relative to the line start
SwTwips nTabPos = rInf.GetLastTab() ? rInf.GetLastTab()->GetTabPos() : 0;
if( nTabPos < rInf.X() )
{
nTabPos = rInf.X();
}
- // nCurrentAbsPos: The current position in absolute coordinates.
-
+ // The current position in absolute coordinates
const SwTwips nCurrentAbsPos = bRTL ?
nLinePos - nTabPos :
nLinePos + nTabPos;
@@ -121,8 +120,7 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
SwTwips nNextPos = 0;
// #i24363# tab stops relative to indent
- // nSearchPos: The current position relative to the tabs origin.
-
+ // nSearchPos: The current position relative to the tabs origin
const SwTwips nSearchPos = bRTL ?
nTabLeft - nCurrentAbsPos :
nCurrentAbsPos - nTabLeft;
@@ -131,7 +129,6 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
// any hard set tab stops:
// Note: If there are no user defined tab stops, there is always a
// default tab stop.
-
const SvxTabStop* pTabStop = aLineInf.GetTabStop( nSearchPos, nMyRight );
if ( pTabStop )
{
@@ -170,6 +167,7 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
nNextPos = ( nCount < 0 || ( !nCount && nSearchPos <= 0 ) )
? ( nCount * nDefTabDist )
: ( ( nCount + 1 ) * nDefTabDist );
+
// --> FME 2004-09-21 #117919 Minimum tab stop width is 1 or 51 twips:
const SwTwips nMinimumTabWidth = pFrm->GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::TAB_COMPAT) ? 0 : 50;
if( ( bRTL && nTabLeft - nNextPos >= nCurrentAbsPos - nMinimumTabWidth ) ||
@@ -292,7 +290,9 @@ SwTabPortion *SwTxtFormatter::NewTabPortion( SwTxtFormatInfo &rInf, bool bAuto )
return pTabPor;
}
-// Die Basisklasse wird erstmal ohne alles initialisiert.
+/**
+ * The base class is initialized without setting anything
+ */
SwTabPortion::SwTabPortion( const sal_uInt16 nTabPosition, const sal_Unicode cFillChar, const bool bAutoTab )
: SwFixPortion( 0, 0 ), nTabPos(nTabPosition), cFill(cFillChar), bAutoTabStop( bAutoTab )
{
@@ -497,7 +497,9 @@ bool SwTabPortion::PostFormat( SwTxtFormatInfo &rInf )
return rInf.Width() <= rInf.X();
}
-// Ex: LineIter::DrawTab()
+/**
+ * Ex: LineIter::DrawTab()
+ */
void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const
{
#if OSL_DEBUG_LEVEL > 1
@@ -551,15 +553,16 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const
rInf.DrawTab( *this );
}
- // 6842: Tabs should be underlined at once.
+ // Tabs should be underlined at once
if( rInf.GetFont()->IsPaintBlank() )
{
- // tabs with filling / filled tabs
+ // Tabs with filling/filled tabs
const sal_uInt16 nCharWidth = rInf.GetTxtSize(OUString(' ')).Width();
- // robust:
+
+ // Robust:
if( nCharWidth )
{
- // 6864: always with kerning, also on printer!
+ // Always with kerning, also on printer!
sal_uInt16 nChar = Width() / nCharWidth;
OUStringBuffer aBuf;
comphelper::string::padToLength(aBuf, nChar, ' ');
@@ -570,16 +573,17 @@ void SwTabPortion::Paint( const SwTxtPaintInfo &rInf ) const
// Display fill characters
if( IsFilled() )
{
- // tabs with filling / filled tabs
+ // Tabs with filling/filled tabs
const sal_uInt16 nCharWidth = rInf.GetTxtSize(OUString(cFill)).Width();
OSL_ENSURE( nCharWidth, "!SwTabPortion::Paint: sophisticated tabchar" );
- // robust:
+
+ // Robust:
if( nCharWidth )
{
- // 6864: always with kerning, also on printer!
+ // Always with kerning, also on printer!
sal_uInt16 nChar = Width() / nCharWidth;
if ( cFill == '_' )
- ++nChar; // to avoid gaps (Bug 13430)
+ ++nChar; // to avoid gaps
OUStringBuffer aBuf;
comphelper::string::padToLength(aBuf, nChar, cFill);
rInf.DrawText(aBuf.makeStringAndClear(), *this, 0, nChar, true);