[Libreoffice-commits] core.git: 4 commits - sw/source
Philipp Riemer
ruderphilipp at gmail.com
Sun Feb 16 20:23:58 CET 2014
sw/source/core/layout/calcmove.cxx | 3
sw/source/core/layout/colfrm.cxx | 6
sw/source/core/layout/dbg_lay.cxx | 60 ----
sw/source/core/layout/flowfrm.cxx | 3
sw/source/core/layout/fly.cxx | 10
sw/source/core/layout/flycnt.cxx | 1
sw/source/core/layout/frmtool.cxx | 275 +++++++-----------
sw/source/core/layout/ftnfrm.cxx | 546 +++++++++++++++++--------------------
sw/source/core/layout/layact.cxx | 8
sw/source/core/layout/laycache.cxx | 3
sw/source/core/layout/newfrm.cxx | 4
sw/source/core/layout/pagechg.cxx | 356 +++++++++---------------
sw/source/core/layout/paintfrm.cxx | 292 +++++++++----------
sw/source/core/layout/sectfrm.cxx | 11
14 files changed, 667 insertions(+), 911 deletions(-)
New commits:
commit 69d0280e70868785f46a603090e4694be2ac4d24
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Sun Feb 16 20:18:51 2014 +0100
deleted code that was commented out in sw/source/core/layout/
Change-Id: Id1acb0ef8a668c61cdfd852040f44023b37bda37
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index c7373f7..b428fe1 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -310,9 +310,6 @@ void SwFrm::PrepareMake()
(SwFlowFrm::CastFlowFrm(pFrm))->IsAnFollow( pThis ) )
break;
- //MA: 24. Mar. 94, Calc would run into a _Prepare again and cause the whole chain to
- // be run again.
- // pFrm->Calc();
pFrm->MakeAll();
if( IsSctFrm() && !((SwSectionFrm*)this)->GetSection() )
break;
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 045a877..deded70 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -1434,7 +1434,6 @@ void SwFlyAtCntFrm::RegisterAtCorrectPage()
}
// #i26791#
-//void SwFlyAtCntFrm::MakeFlyPos()
void SwFlyAtCntFrm::MakeObjPos()
{
// if fly frame position is valid, nothing is to do. Thus, return
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 22442d8..f15cbf14 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -866,8 +866,6 @@ SwCntntNotify::~SwCntntNotify()
if ( pFESh && pNd->IsOLESizeInvalid() )
{
pNd->SetOLESizeInvalid( sal_False );
- //TODO/LATER: needs OnDocumentPrinterChanged
- //xObj->OnDocumentPrinterChanged( pNd->GetDoc()->getPrinter( false ) );
pFESh->CalcAndSetScale( xObj ); // create client
}
}
@@ -1030,8 +1028,6 @@ void AppendObjs( const SwFrmFmts *pTbl, sal_uLong nIndex,
SwDrawVirtObj* pDrawVirtObj = pNew->AddVirtObj();
pFrm->AppendDrawObj( *(pNew->GetAnchoredObj( pDrawVirtObj )) );
- // for repaint, use new ActionChanged()
- // pDrawVirtObj->SendRepaintBroadcast();
pDrawVirtObj->ActionChanged();
}
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 9fc3823..1420c83 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1483,14 +1483,7 @@ sal_Bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
pFly->Invalidate();
else
pFly->Validate();
-/*
- //mba: it's unclear why we should invalidate always, so I remove it
- //Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
- if ( IsPaint() && bAddRect && pFly->Frm().Top() > 0 && pFly->Frm().Left() > 0 )
- pImp->GetShell()->AddPaintRect( pFly->Frm() );
- pFly->Invalidate();
-*/
bAddRect = false;
pFly->ResetCompletePaint();
}
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index d679feb..a8cf7d8 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -498,9 +498,7 @@ void SwRootFrm::Init( SwFrmFmt* pFmt )
if ( pMd )
{
// Disable "multiple layout"
- pDrawPage = pMd->GetPage(0); //pMd->AllocPage( FALSE );
- //pMd->InsertPage( pDrawPage );
- // end of disabling
+ pDrawPage = pMd->GetPage(0);
pDrawPage->SetSize( Frm().SSize() );
}
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 7537c9d..412def1 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -713,10 +713,6 @@ SwPageDesc *SwPageFrm::FindPageDesc()
return pDoc->GetFtnInfo().GetPageDesc( *pDoc );
}
- //6.
- //if ( GetFmt()->GetDoc()->IsHTMLMode() )
- // return GetFmt()->GetDoc()->GetPageDescFromPool( RES_POOLPAGE_HTML );
-
SwPageDesc *pRet = 0;
//5.
@@ -1145,13 +1141,6 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, sal_Bool bNotifyFields, SwPageFrm
else
bEmpty = false;
-//MA 21. Jun. 95: Kann zu testzwecken 'rein, ist aber bei zyklen durchaus
-//moeglich: Ein paar Seiten, auf der ersten 'erste Seite' anwenden,
-//rechte als folge der ersten, linke als folge der rechten, rechte als
-//folge der linken.
-// OSL_ENSURE( pPg->GetPageDesc() == pPg->FindPageDesc(),
-// "Seite mit falschem Descriptor." );
-
pPg = (SwPageFrm*)pPg->GetNext();
}
#endif
commit c6a842ebc8bed02ff0678f3ed6d47e4bb2e6e6cd
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Sun Feb 16 20:17:53 2014 +0100
fdo#62475 - remove visual noise
Change-Id: I36e970c2ed13c50e5f6cebf95aa36ca8194a01ce
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 44152e7..ae3320d 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -672,11 +672,10 @@ SwTabFrm* SwTabFrm::FindMaster( bool bFirstMaster ) const
{
if ( bFirstMaster )
{
- //
// Optimization. This makes code like this obsolete:
// while ( pTab->IsFollow() )
// pTab = pTab->FindMaster();
- //
+
if ( !pTab->IsFollow() )
{
SwTabFrm* pNxt = pTab;
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 0dbd773..22442d8 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1714,6 +1714,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
}
else
bSplit = sal_False;
+
::_InsertCnt( pUpper, pDoc, rSttIdx.GetIndex(), sal_False,
nEndIdx, pPrv );
// OD 23.06.2003 #108784# - correction: append objects doesn't
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 64367c6..9fc3823 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1332,7 +1332,6 @@ sal_Bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, sal_Bool bAddRect )
for ( i = 0; i < aRegion.size(); ++i )
pImp->GetShell()->AddPaintRect( aRegion[i] );
}
-
}
else
{
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index bc7bf85..2121354 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -55,7 +55,6 @@
#include <set>
-
using namespace ::com::sun::star;
/*
@@ -934,7 +933,6 @@ void SwLayHelper::_CheckFlyCache( SwPageFrm* pPage )
SwSortedObjs &rObjs = *pPage->GetSortedObjs();
sal_uInt16 nPgNum = pPage->GetPhyPageNum();
- //
// NOTE: Here we do not use the absolute ordnums but
// relative ordnums for the objects on this page.
@@ -1123,7 +1121,6 @@ bool SwLayCacheIoImpl::OpenRec( sal_uInt8 cType )
}
// Close record
-
bool SwLayCacheIoImpl::CloseRec( sal_uInt8 )
{
bool bRes = true;
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index f04ace5..7537c9d 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1599,7 +1599,6 @@ void SwRootFrm::ImplCalcBrowseWidth()
break;
default:
break;
-
}
nBrowseWidth = std::max( nBrowseWidth, nWidth );
}
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index a4653ed..4eaa93c 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3514,7 +3514,6 @@ static drawinglayer::primitive2d::Primitive2DSequence lcl_CreateDashedIndicatorP
aSeq[0] = drawinglayer::primitive2d::Primitive2DReference( pPlainLine );
-
// Dashed line in twips
aStrokePattern.push_back( 40 );
aStrokePattern.push_back( 40 );
@@ -3611,7 +3610,6 @@ void SwColumnFrm::PaintBreak( ) const
basegfx::BColor aLineColor = SwViewOption::GetPageBreakColor().getBColor();
-
drawinglayer::primitive2d::Primitive2DSequence aSeq =
lcl_CreateDashedIndicatorPrimitive( aStart, aEnd, aLineColor );
aSeq.realloc( aSeq.getLength( ) + 1 );
@@ -6816,7 +6814,6 @@ void SwLayoutFrm::PaintSubsidiaryLines( const SwPageFrm *pPage,
( IsCellFrm() && IsCoveredCell() ) )
return;
}
- // <-- collapsing
const bool bFlys = pPage->GetSortedObjs() ? true : false;
commit aba99b4ae4b87d242302b39cb53ec5b0443d5c04
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Sun Feb 16 20:15:58 2014 +0100
work on existing comments
- (un)doxygenize
- move to right position
- /** */ => /// if only one line
Change-Id: I786953b7f6c83d384b0685c7dc2e5f98d4152b50
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index e7f4ce0..8dc757f 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -1957,11 +1957,9 @@ sal_Bool SwFlyFrm::IsLowerOf( const SwLayoutFrm* pUpperFrm ) const
return sal_False;
}
-/**
- * TODO: Implement SwFlyFrm::Cut()
- */
void SwFlyFrm::Cut()
{
+ // TODO: Implement SwFlyFrm::Cut()
}
void SwFrm::AppendFly( SwFlyFrm *pNew )
@@ -2199,8 +2197,7 @@ void SwFrm::InvalidateObjs( const bool _bInvaPosOnly,
else
{
pAnchoredObj->InvalidateObjPos();
- } // end of distinction between writer fly frames and drawing objects
-
+ }
} // end of loop on objects, which are connected to the frame
}
}
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index a1ae9cd..0dbd773 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -3375,8 +3375,7 @@ void GetSpacingValuesOfFrm( const SwFrm& rFrm,
}
}
-/** method to get the content of the table cell, skipping content from nested tables
-*/
+/// get the content of the table cell, skipping content from nested tables
const SwCntntFrm* GetCellCntnt( const SwLayoutFrm& rCell )
{
const SwCntntFrm* pCntnt = rCell.ContainsCntnt();
@@ -3399,8 +3398,7 @@ const SwCntntFrm* GetCellCntnt( const SwLayoutFrm& rCell )
return pCntnt;
}
-/** Can be used to check if a frame has been deleted
- */
+/// Can be used to check if a frame has been deleted
bool SwDeletionChecker::HasBeenDeleted()
{
if ( !mpFrm || !mpRegIn )
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index d969b8e..a4653ed 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1648,37 +1648,6 @@ static void lcl_SubtractFlys( const SwFrm *pFrm, const SwPageFrm *pPage,
//---------------- Output for BrushItem ----------------
-/** lcl_DrawGraphicBackgrd - local help method to draw a background for a graphic
-
- Under certain circumstances we have to draw a background for a graphic.
- This method takes care of the conditions and draws the background with the
- corresponding color.
- Method introduced for bug fix #103876# in order to optimize drawing tiled
- background graphics. Previously, this code was integrated in method
- <lcl_DrawGraphic>.
- Method implemented as a inline, checking the conditions and calling method
- method <lcl_implDrawGraphicBackgrd(..)> for the intrinsic drawing.
-
- @param _rBackgrdBrush
- background brush contain the color the background has to be drawn.
-
- @param _pOut
- output device the background has to be drawn in.
-
- @param _rPaintRect
- paint retangle in the output device, which has to be drawn with the background.
- rectangle have to be aligned by method ::SwAlignRect
-
- @param _rGraphicObj
- graphic object, for which the background has to be drawn. Used for checking
- the transparency of its bitmap, its type and if the graphic is drawn transparent
-
- @param _bNumberingGraphic
- boolean indicating that graphic is used as a numbering.
-
- @param _bBackgrdAlreadyDrawn
- boolean (optional; default: false) indicating, if the background is already drawn.
-*/
static void lcl_implDrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
OutputDevice* _pOut,
const SwRect& _rAlignedPaintRect,
@@ -1728,6 +1697,37 @@ static void lcl_implDrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
}
}
+/** lcl_DrawGraphicBackgrd - local help method to draw a background for a graphic
+
+ Under certain circumstances we have to draw a background for a graphic.
+ This method takes care of the conditions and draws the background with the
+ corresponding color.
+ Method introduced for bug fix #103876# in order to optimize drawing tiled
+ background graphics. Previously, this code was integrated in method
+ <lcl_DrawGraphic>.
+ Method implemented as a inline, checking the conditions and calling method
+ method <lcl_implDrawGraphicBackgrd(..)> for the intrinsic drawing.
+
+ @param _rBackgrdBrush
+ background brush contain the color the background has to be drawn.
+
+ @param _pOut
+ output device the background has to be drawn in.
+
+ @param _rAlignedPaintRect
+ paint retangle in the output device, which has to be drawn with the background.
+ rectangle have to be aligned by method ::SwAlignRect
+
+ @param _rGraphicObj
+ graphic object, for which the background has to be drawn. Used for checking
+ the transparency of its bitmap, its type and if the graphic is drawn transparent
+
+ @param _bNumberingGraphic
+ boolean indicating that graphic is used as a numbering.
+
+ @param _bBackgrdAlreadyDrawn
+ boolean (optional; default: false) indicating, if the background is already drawn.
+*/
static inline void lcl_DrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
OutputDevice* _pOut,
const SwRect& _rAlignedPaintRect,
@@ -1735,10 +1735,10 @@ static inline void lcl_DrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
bool _bNumberingGraphic,
bool _bBackgrdAlreadyDrawn = false )
{
- /// draw background with background color, if
- /// (1) graphic is not used as a numbering AND
- /// (2) background is not already drawn AND
- /// (3) intrinsic graphic is transparent OR intrinsic graphic doesn't exists
+ // draw background with background color, if
+ // (1) graphic is not used as a numbering AND
+ // (2) background is not already drawn AND
+ // (3) intrinsic graphic is transparent OR intrinsic graphic doesn't exists
if ( !_bNumberingGraphic &&
!_bBackgrdAlreadyDrawn &&
( _rGraphicObj.IsTransparent() || _rGraphicObj.GetType() == GRAPHIC_NONE )
@@ -1748,29 +1748,29 @@ static inline void lcl_DrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
}
}
-/// Note: the transparency of the background graphic
-/// is saved in SvxBrushItem.GetGraphicObject(<shell>).GetAttr().Set/GetTransparency()
-/// and is considered in the drawing of the graphic.
-/// Thus, to provide transparent background graphic for text frames nothing
-/// has to be coded.
-/// Use align rectangle for drawing graphic
-/// Pixel-align coordinations for drawing graphic.
-/// Outsource code for drawing background of the graphic
-/// with a background color in method <lcl_DrawGraphicBackgrd>
-/// Also, change type of <bGrfNum> and <bClip> from <sal_Bool> to <bool>.
+// Note: the transparency of the background graphic
+// is saved in SvxBrushItem.GetGraphicObject(<shell>).GetAttr().Set/GetTransparency()
+// and is considered in the drawing of the graphic.
+// Thus, to provide transparent background graphic for text frames nothing
+// has to be coded.
+// Use align rectangle for drawing graphic
+/ Pixel-align coordinations for drawing graphic.
+// Outsource code for drawing background of the graphic
+// with a background color in method <lcl_DrawGraphicBackgrd>
+// Also, change type of <bGrfNum> and <bClip> from <sal_Bool> to <bool>.
static void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut,
SwViewShell &rSh, const SwRect &rGrf, const SwRect &rOut,
bool bClip, bool bGrfNum,
bool bBackgrdAlreadyDrawn = false )
- /// add parameter <bBackgrdAlreadyDrawn> to indicate
- /// that the background is already drawn.
+ // add parameter <bBackgrdAlreadyDrawn> to indicate
+ // that the background is already drawn.
{
- /// Calculate align rectangle from parameter <rGrf> and use aligned
- /// rectangle <aAlignedGrfRect> in the following code
+ // Calculate align rectangle from parameter <rGrf> and use aligned
+ // rectangle <aAlignedGrfRect> in the following code
SwRect aAlignedGrfRect = rGrf;
::SwAlignRect( aAlignedGrfRect, &rSh );
- /// Change type from <sal_Bool> to <bool>.
+ // Change type from <sal_Bool> to <bool>.
const bool bNotInside = bClip && !rOut.IsInside( aAlignedGrfRect );
if ( bNotInside )
{
@@ -1778,15 +1778,15 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut,
pOut->IntersectClipRegion( rOut.SVRect() );
}
- /// No Link here, we want to load the graphic synchronously!
+ // No Link here, we want to load the graphic synchronously!
((SvxBrushItem&)rBrush).SetDoneLink( Link() );
GraphicObject *pGrf = (GraphicObject*)rBrush.GetGraphicObject();
- /// Outsource drawing of background with a background color
+ // Outsource drawing of background with a background color
::lcl_DrawGraphicBackgrd( rBrush, pOut, aAlignedGrfRect, *pGrf, bGrfNum, bBackgrdAlreadyDrawn );
- /// Because for drawing a graphic left-top-corner and size coordinations are
- /// used, these coordinations have to be determined on pixel level.
+ // Because for drawing a graphic left-top-corner and size coordinations are
+ // used, these coordinations have to be determined on pixel level.
::SwAlignGrfRect( &aAlignedGrfRect, *pOut );
if (pGrf->GetGraphic().getSvgData().get())
@@ -1801,7 +1801,7 @@ static void lcl_DrawGraphic( const SvxBrushItem& rBrush, OutputDevice *pOut,
if ( bNotInside )
pOut->Pop();
-} // end of method <lcl_DrawGraphic>
+}
void DrawGraphic( const SvxBrushItem *pBrush,
const XFillStyleItem* pFillStyleItem,
@@ -1811,8 +1811,8 @@ void DrawGraphic( const SvxBrushItem *pBrush,
const SwRect &rOut,
const sal_uInt8 nGrfNum,
const sal_Bool bConsiderBackgroundTransparency )
- /// Add 6th parameter to indicate that method should
- /// consider background transparency, saved in the color of the brush item
+ // Add 6th parameter to indicate that method should
+ // consider background transparency, saved in the color of the brush item
{
SwViewShell &rSh = *pGlobalShell;
bool bReplaceGrfNum = GRFNUM_REPLACE == nGrfNum;
@@ -1904,12 +1904,12 @@ void DrawGraphic( const SvxBrushItem *pBrush,
case GPOS_AREA:
aGrf = rOrg;
- /// In spite the fact that the background graphic have to fill the complete
- /// area, it has been checked, if the graphic will completely fill out
- /// the region to be painted <rOut> and thus, nothing has to be retouched.
- /// For example, this is the case for a fly frame without a background
- /// brush positioned on the border of the page and inherited the
- /// background brush from the page.
+ // In spite the fact that the background graphic have to fill the complete
+ // area, it has been checked, if the graphic will completely fill out
+ // the region to be painted <rOut> and thus, nothing has to be retouched.
+ // For example, this is the case for a fly frame without a background
+ // brush positioned on the border of the page and inherited the
+ // background brush from the page.
bRetouche = !rOut.IsInside( aGrf );
break;
@@ -2020,22 +2020,22 @@ void DrawGraphic( const SvxBrushItem *pBrush,
}
}
- /// to get color of brush, check background color against COL_TRANSPARENT ("no fill"/"auto fill")
- /// instead of checking, if transparency is not set.
+ // to get color of brush, check background color against COL_TRANSPARENT ("no fill"/"auto fill")
+ // instead of checking, if transparency is not set.
const Color aColor( pBrush &&
( !(pBrush->GetColor() == COL_TRANSPARENT) ||
bFlyMetafile )
? pBrush->GetColor()
: aGlobalRetoucheColor );
- /// determine, if background region have to be
- /// drawn transparent.
- /// background region has to be drawn transparent, if
- /// background transparency have to be considered
- /// AND
- /// ( background color is transparent OR
- /// background graphic is transparent and background color is "no fill"
- /// )
+ // determine, if background region have to be
+ // drawn transparent.
+ // background region has to be drawn transparent, if
+ // background transparency have to be considered
+ // AND
+ // ( background color is transparent OR
+ // background graphic is transparent and background color is "no fill"
+ // )
enum DrawStyle {
Default,
@@ -2063,9 +2063,9 @@ void DrawGraphic( const SvxBrushItem *pBrush,
pOutDev->SetDrawMode( 0 );
}
- /// OD 06.08.2002 #99657# - if background region have to be drawn
- /// transparent, set only the RGB values of the background color as
- /// the fill color for the output device.
+ // OD 06.08.2002 #99657# - if background region have to be drawn
+ // transparent, set only the RGB values of the background color as
+ // the fill color for the output device.
switch (eDrawStyle)
{
case Transparent:
@@ -2086,22 +2086,22 @@ void DrawGraphic( const SvxBrushItem *pBrush,
// restore draw mode
pOutDev->SetDrawMode( nOldDrawMode );
- /// OD 02.09.2002 #99657#
+ // OD 02.09.2002 #99657#
switch (eDrawStyle)
{
case Transparent:
{
- /// background region have to be drawn transparent.
- /// Thus, create a poly-polygon from the region and draw it with
- /// the corresponding transparency precent.
+ // background region have to be drawn transparent.
+ // Thus, create a poly-polygon from the region and draw it with
+ // the corresponding transparency precent.
PolyPolygon aDrawPoly( rOut.SVRect() );
if ( aGrf.HasArea() )
{
if ( !bGrfIsTransparent )
{
- /// substract area of background graphic from draw area
- /// OD 08.10.2002 #103898# - consider only that part of the
- /// graphic area that is overlapping with draw area.
+ // substract area of background graphic from draw area
+ // OD 08.10.2002 #103898# - consider only that part of the
+ // graphic area that is overlapping with draw area.
SwRect aTmpGrf = aGrf;
aTmpGrf.Intersection( rOut );
if ( aTmpGrf.HasArea() )
@@ -2113,15 +2113,15 @@ void DrawGraphic( const SvxBrushItem *pBrush,
else
bGrfBackgrdAlreadyDrawn = true;
}
- /// calculate transparency percent:
- /// ( <transparency value[0x01..0xFF]>*100 + 0x7F ) / 0xFF
- /// If there is a background graphic with a background color "no fill"/"auto fill",
- /// the transparency value is taken from the background graphic,
- /// otherwise take the transparency value from the color.
+ // calculate transparency percent:
+ // ( <transparency value[0x01..0xFF]>*100 + 0x7F ) / 0xFF
+ // If there is a background graphic with a background color "no fill"/"auto fill",
+ // the transparency value is taken from the background graphic,
+ // otherwise take the transparency value from the color.
sal_Int8 nTransparencyPercent = static_cast<sal_Int8>(
(( bTransparentGrfWithNoFillBackgrd ? nGrfTransparency : aColor.GetTransparency()
)*100 + 0x7F)/0xFF);
- /// draw poly-polygon transparent
+ // draw poly-polygon transparent
pOutDev->DrawTransparent( aDrawPoly, nTransparencyPercent );
break;
@@ -2139,7 +2139,7 @@ void DrawGraphic( const SvxBrushItem *pBrush,
aRegion -= aGrf;
else
bGrfBackgrdAlreadyDrawn = true;
- /// loop rectangles of background region, which has to be drawn
+ // loop rectangles of background region, which has to be drawn
for( sal_uInt16 i = 0; i < aRegion.size(); ++i )
{
pOutDev->DrawRect( aRegion[i].SVRect() );
@@ -2150,8 +2150,8 @@ void DrawGraphic( const SvxBrushItem *pBrush,
}
if( bDraw && aGrf.IsOver( rOut ) )
- /// OD 02.09.2002 #99657#
- /// add parameter <bGrfBackgrdAlreadyDrawn>
+ // OD 02.09.2002 #99657#
+ // add parameter <bGrfBackgrdAlreadyDrawn>
lcl_DrawGraphic( *pBrush, pOutDev, rSh, aGrf, rOut, true, bGrfNum,
bGrfBackgrdAlreadyDrawn );
@@ -2175,45 +2175,45 @@ void DrawGraphic( const SvxBrushItem *pBrush,
*/
static void lcl_AdjustRectToPixelSize( SwRect& io_aSwRect, const OutputDevice &aOut )
{
- /// local constant object of class <Size> to determine number of Twips
- /// representing a pixel.
+ // local constant object of class <Size> to determine number of Twips
+ // representing a pixel.
const Size aTwipToPxSize( aOut.PixelToLogic( Size( 1,1 )) );
- /// local object of class <Rectangle> in Twip coordinates
- /// calculated from given rectangle aligned to pixel centers.
+ // local object of class <Rectangle> in Twip coordinates
+ // calculated from given rectangle aligned to pixel centers.
const Rectangle aPxCenterRect = aOut.PixelToLogic(
aOut.LogicToPixel( io_aSwRect.SVRect() ) );
- /// local constant object of class <Rectangle> representing given rectangle
- /// in pixel.
+ // local constant object of class <Rectangle> representing given rectangle
+ // in pixel.
const Rectangle aOrgPxRect = aOut.LogicToPixel( io_aSwRect.SVRect() );
- /// calculate adjusted rectangle from pixel centered rectangle.
- /// Due to rounding differences <aPxCenterRect> doesn't exactly represents
- /// the Twip-centers. Thus, adjust borders by half of pixel width/height plus 1.
- /// Afterwards, adjust calculated Twip-positions of the all borders.
+ // calculate adjusted rectangle from pixel centered rectangle.
+ // Due to rounding differences <aPxCenterRect> doesn't exactly represents
+ // the Twip-centers. Thus, adjust borders by half of pixel width/height plus 1.
+ // Afterwards, adjust calculated Twip-positions of the all borders.
Rectangle aSizedRect = aPxCenterRect;
aSizedRect.Left() -= (aTwipToPxSize.Width()/2 + 1);
aSizedRect.Right() += (aTwipToPxSize.Width()/2 + 1);
aSizedRect.Top() -= (aTwipToPxSize.Height()/2 + 1);
aSizedRect.Bottom() += (aTwipToPxSize.Height()/2 + 1);
- /// adjust left()
+ // adjust left()
while ( (aOut.LogicToPixel(aSizedRect)).Left() < aOrgPxRect.Left() )
{
++aSizedRect.Left();
}
- /// adjust right()
+ // adjust right()
while ( (aOut.LogicToPixel(aSizedRect)).Right() > aOrgPxRect.Right() )
{
--aSizedRect.Right();
}
- /// adjust top()
+ // adjust top()
while ( (aOut.LogicToPixel(aSizedRect)).Top() < aOrgPxRect.Top() )
{
++aSizedRect.Top();
}
- /// adjust bottom()
+ // adjust bottom()
while ( (aOut.LogicToPixel(aSizedRect)).Bottom() > aOrgPxRect.Bottom() )
{
--aSizedRect.Bottom();
@@ -2226,25 +2226,25 @@ static void lcl_AdjustRectToPixelSize( SwRect& io_aSwRect, const OutputDevice &a
Rectangle aTestNewPxRect = aOut.LogicToPixel( aSizedRect );
OSL_ENSURE( aTestOrgPxRect == aTestNewPxRect,
"Error in lcl_AlignRectToPixelSize(..): Adjusted rectangle has incorrect position or size");
- /// check Left()
+ // check Left()
--aSizedRect.Left();
aTestNewPxRect = aOut.LogicToPixel( aSizedRect );
OSL_ENSURE( aTestOrgPxRect.Left() >= (aTestNewPxRect.Left()+1),
"Error in lcl_AlignRectToPixelSize(..): Left() not correct adjusted");
++aSizedRect.Left();
- /// check Right()
+ // check Right()
++aSizedRect.Right();
aTestNewPxRect = aOut.LogicToPixel( aSizedRect );
OSL_ENSURE( aTestOrgPxRect.Right() <= (aTestNewPxRect.Right()-1),
"Error in lcl_AlignRectToPixelSize(..): Right() not correct adjusted");
--aSizedRect.Right();
- /// check Top()
+ // check Top()
--aSizedRect.Top();
aTestNewPxRect = aOut.LogicToPixel( aSizedRect );
OSL_ENSURE( aTestOrgPxRect.Top() >= (aTestNewPxRect.Top()+1),
"Error in lcl_AlignRectToPixelSize(..): Top() not correct adjusted");
++aSizedRect.Top();
- /// check Bottom()
+ // check Bottom()
++aSizedRect.Bottom();
aTestNewPxRect = aOut.LogicToPixel( aSizedRect );
OSL_ENSURE( aTestOrgPxRect.Bottom() <= (aTestNewPxRect.Bottom()-1),
@@ -3120,24 +3120,24 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c
if(OUTDEV_WINDOW == pGlobalShell->GetOut()->GetOutDevType())
{
- /// OD 27.09.2002 #103636# - changed method SwLayVout::Enter(..)
- /// 2nd parameter is no longer <const> and will be set to the
- /// rectangle the virtual output device is calculated from <aPaintRect>,
- /// if the virtual output is used.
+ // OD 27.09.2002 #103636# - changed method SwLayVout::Enter(..)
+ // 2nd parameter is no longer <const> and will be set to the
+ // rectangle the virtual output device is calculated from <aPaintRect>,
+ // if the virtual output is used.
pVout->Enter( pSh, aPaintRect, !bNoVirDev );
- /// OD 27.09.2002 #103636# - adjust paint rectangle to pixel size
- /// Thus, all objects overlapping on pixel level with the unadjusted
- /// paint rectangle will be considered in the paint.
+ // OD 27.09.2002 #103636# - adjust paint rectangle to pixel size
+ // Thus, all objects overlapping on pixel level with the unadjusted
+ // paint rectangle will be considered in the paint.
lcl_AdjustRectToPixelSize( aPaintRect, *(pSh->GetOut()) );
}
// maybe this can be put in the above scope. Since we are not sure, just leave it ATM
pVout->SetOrgRect( aPaintRect );
- /// OD 29.08.2002 #102450#
- /// determine background color of page for <PaintLayer> method
- /// calls, paint <hell> or <heaven>
+ // OD 29.08.2002 #102450#
+ // determine background color of page for <PaintLayer> method
+ // calls, paint <hell> or <heaven>
const Color aPageBackgrdColor = pPage->GetDrawBackgrdColor();
pPage->PaintBaBo( aPaintRect, pPage, sal_True );
@@ -3191,7 +3191,7 @@ void SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) c
if ( pSh->Imp()->HasDrawView() )
{
- /// OD 29.08.2002 #102450# - add 3rd parameter
+ // OD 29.08.2002 #102450# - add 3rd parameter
// OD 09.12.2002 #103045# - add 4th parameter for horizontal text direction.
pSh->Imp()->PaintLayer( pSh->GetDoc()->GetHeavenId(),
pPrintData,
@@ -4218,7 +4218,7 @@ static void lcl_PaintShadow( const SwRect& rRect, SwRect& rOutRect,
{
if ( bDrawFullShadowRectangle )
{
- /// OD 06.08.2002 #99657# - draw full shadow rectangle
+ // OD 06.08.2002 #99657# - draw full shadow rectangle
aOut.Top( rOutRect.Top() + nHeight );
aOut.Left( rOutRect.Left() + nWidth );
aRegion.push_back( aOut );
@@ -4255,7 +4255,7 @@ static void lcl_PaintShadow( const SwRect& rRect, SwRect& rOutRect,
{
if ( bDrawFullShadowRectangle )
{
- /// OD 06.08.2002 #99657# - draw full shadow rectangle
+ // OD 06.08.2002 #99657# - draw full shadow rectangle
aOut.Bottom( rOutRect.Bottom() - nHeight );
aOut.Right( rOutRect.Right() - nWidth );
aRegion.push_back( aOut );
@@ -4292,7 +4292,7 @@ static void lcl_PaintShadow( const SwRect& rRect, SwRect& rOutRect,
{
if ( bDrawFullShadowRectangle )
{
- /// OD 06.08.2002 #99657# - draw full shadow rectangle
+ // OD 06.08.2002 #99657# - draw full shadow rectangle
aOut.Bottom( rOutRect.Bottom() - nHeight);
aOut.Left( rOutRect.Left() + nWidth );
aRegion.push_back( aOut );
@@ -4329,7 +4329,7 @@ static void lcl_PaintShadow( const SwRect& rRect, SwRect& rOutRect,
{
if ( bDrawFullShadowRectangle )
{
- /// OD 06.08.2002 #99657# - draw full shadow rectangle
+ // OD 06.08.2002 #99657# - draw full shadow rectangle
aOut.Top( rOutRect.Top() + nHeight );
aOut.Right( rOutRect.Right() - nWidth );
aRegion.push_back( aOut );
@@ -4430,12 +4430,12 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect,
}
}
- /// OD 23.08.2002 #99657# - determine, if full shadow rectangle have to
- /// be drawn or only two shadow rectangles beside the frame.
- /// draw full shadow rectangle, if frame background is drawn transparent.
- /// Status Quo:
- /// SwLayoutFrm can have transparent drawn backgrounds. Thus,
- /// "asked" their frame format.
+ // OD 23.08.2002 #99657# - determine, if full shadow rectangle have to
+ // be drawn or only two shadow rectangles beside the frame.
+ // draw full shadow rectangle, if frame background is drawn transparent.
+ // Status Quo:
+ // SwLayoutFrm can have transparent drawn backgrounds. Thus,
+ // "asked" their frame format.
const bool bDrawFullShadowRectangle =
( IsLayoutFrm() &&
(static_cast<const SwLayoutFrm*>(this))->GetFmt()->IsBackgroundTransparent()
@@ -5289,6 +5289,7 @@ void SwFrm::PaintBorder( const SwRect& rRect, const SwPageFrm *pPage,
rAttrs.SetGetCacheLine( sal_False );
}
}
+
/* Special implementation because of the footnote line.
|* Currently only the top frame needs to be taken into account.
|* Other lines and shadows are set aside.
@@ -6237,8 +6238,8 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
const SvxBrushItem* pItem;
const XFillStyleItem* pFillStyleItem;
const XFillGradientItem* pFillGradientItem;
- /// OD 05.09.2002 #102912#
- /// temporary background brush for a fly frame without a background brush
+ // OD 05.09.2002 #102912#
+ // temporary background brush for a fly frame without a background brush
SvxBrushItem* pTmpBackBrush = 0;
const Color* pCol;
SwRect aOrigBackRect;
@@ -6327,10 +6328,10 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
if ( pPage->GetSortedObjs() )
::lcl_SubtractFlys( this, pPage, aRect, aRegion );
- /// OD 06.08.2002 #99657# - determine, if background transparency
- /// have to be considered for drawing.
- /// --> Status Quo: background transparency have to be
- /// considered for fly frames
+ // OD 06.08.2002 #99657# - determine, if background transparency
+ // have to be considered for drawing.
+ // --> Status Quo: background transparency have to be
+ // considered for fly frames
const sal_Bool bConsiderBackgroundTransparency = IsFlyFrm();
if (!pFillStyleItem || pFillStyleItem->GetValue() != XFILL_GRADIENT || !pFillGradientItem)
{
@@ -6342,10 +6343,10 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
if( !aRegion[i].HasArea() )
continue;
}
- /// OD 06.08.2002 #99657# - add 6th parameter to indicate, if
- /// background transparency have to be considered
- /// Set missing 5th parameter to the default value GRFNUM_NO
- /// - see declaration in /core/inc/frmtool.hxx.
+ // OD 06.08.2002 #99657# - add 6th parameter to indicate, if
+ // background transparency have to be considered
+ // Set missing 5th parameter to the default value GRFNUM_NO
+ // - see declaration in /core/inc/frmtool.hxx.
if (IsTxtFrm() || !bOnlyTxtBackground)
::DrawGraphic( pItem, pFillStyleItem, pFillGradientItem, pOut, aOrigBackRect, aRegion[i], GRFNUM_NO,
bConsiderBackgroundTransparency );
@@ -6364,8 +6365,8 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
bLowMode = bLowerMode ? sal_True : sal_False;
}
- /// OD 05.09.2002 #102912#
- /// delete temporary background brush.
+ // OD 05.09.2002 #102912#
+ // delete temporary background brush.
delete pTmpBackBrush;
//Now process lower and his neighbour.
@@ -7352,7 +7353,7 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
if ( pFly->IsFlyInCntFrm() )
pFly->Paint( aOut );
pLines->PaintLines( &aDev );
- /// OD 30.08.2002 #102450# - add 3rd parameter
+ // OD 30.08.2002 #102450# - add 3rd parameter
pImp->PaintLayer( pIDDMA->GetHeavenId(), 0, aOut, &aPageBackgrdColor,
(pFlyPage->IsRightToLeft() ? true : false),
&aSwRedirector );
commit 5d6abb55d21891dec1f079c993452b2bca93ca1f
Author: Philipp Riemer <ruderphilipp at gmail.com>
Date: Sun Feb 16 20:11:48 2014 +0100
fdo#39468: Translate German comments in sw/source/core/layout/
Change-Id: Ia0a8443c6989d7938e479a88e3899fb611106544
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index 34d8baa..a6317ce 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -57,14 +57,14 @@ SwColumnFrm::~SwColumnFrm()
static void lcl_RemoveColumns( SwLayoutFrm *pCont, sal_uInt16 nCnt )
{
OSL_ENSURE( pCont && pCont->Lower() && pCont->Lower()->IsColumnFrm(),
- "Keine Spalten zu entfernen." );
+ "no columns to remove." );
SwColumnFrm *pColumn = (SwColumnFrm*)pCont->Lower();
sw_RemoveFtns( pColumn, sal_True, sal_True );
while ( pColumn->GetNext() )
{
OSL_ENSURE( pColumn->GetNext()->IsColumnFrm(),
- "Nachbar von ColFrm kein ColFrm." );
+ "neighbor of ColumnFrame is no ColumnFrame." );
pColumn = (SwColumnFrm*)pColumn->GetNext();
}
for ( sal_uInt16 i = 0; i < nCnt; ++i )
@@ -275,7 +275,7 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
OSL_ENSURE( Lower() && Lower()->IsLayoutFrm() &&
((SwLayoutFrm*)Lower())->Lower() &&
((SwLayoutFrm*)Lower())->Lower()->IsLayoutFrm(),
- "Gesucht: Spaltenbody (Tod oder Lebend)." ); // ColumnFrms jetzt mit BodyFrm
+ "no column body." ); // ColumnFrms contain BodyFrms
::RestoreCntnt( pSave, (SwLayoutFrm*)((SwLayoutFrm*)Lower())->Lower(), 0, true );
}
}
diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx
index 4f46272..b756e5a 100644
--- a/sw/source/core/layout/dbg_lay.cxx
+++ b/sw/source/core/layout/dbg_lay.cxx
@@ -42,7 +42,6 @@
* directory. The file contains lines with FrmId, function group and additional
* information.
*
- * Was genau protokolliert wird, kann auf folgende Arten eingestellt werden:
* What exactly is going to be logged, can be defined as follows:
* 1. The static variable SwProtocol::nRecord contains the function groups
* which shall be logged.
@@ -55,63 +54,19 @@
* The member nTypes can be set to values like FRM_PAGE or FRM_SECTION and
* may be combined using binary OR. The default values is 0xFFFF - meaning
* all frame types.
-
- * 3. In der SwImplProtocol-Klasse gibt es einen ArrayPointer auf FrmIds, die zu ueberwachen sind.
- * Ist der Pointer Null, so werden alle Frames protokolliert, ansonsten nur Frames,
- * die in dem Array vermerkt sind.
-
* 3. The SwImplProtocol class contains an ArrayPointer to FrmIds which need to be
* tracked. If the pointer is null, all frames will be logged; otherwise
* only frames of linked from the array will be logged.
*
- * Eine Aufzeichnung in Gang zu setzen, erfordert entweder Codemanipulation, z.B. in
- * SwProtocol::Init() einen anderen Default fuer nRecord setzen oder Debuggermanipulation.
- * Im Debugger gibt verschiedene, sich anbietende Stellen:
-
* Code changes are needed to start logging; either change the default of nRecord
* in SwProtocol::Init() or change the debugger. There are several possible
* places in the debugger:
-
- * 1. In SwProtocol::Init() einen Breakpoint setzen und dort nRecord manipulieren, ggf.
- * FrmIds eintragen, dann beginnt die Aufzeichnung bereits beim Programmstart.
-
* 1. Set a breakpoint in SwProtocol::Init() and manipulate nRecord there, set
- FrmIds accordingly then start logging during program start.
-
- * 2. Waehrend des Programmlaufs einen Breakpoint vor irgendein PROTOCOL oder PROTOCOL_ENTER-
- * Makro setzen, dann am SwProtocol::nRecord das unterste Bit setzen (PROT_INIT). Dies
- * bewirkt, dass die Funktionsgruppe des folgenden Makros aktiviert und in Zukunft
- * protokolliert wird.
-
+ * FrmIds accordingly then start logging during program start.
* 2. Set a breakpoint before any PROTOCOL or PROTOCOL_ENTER macro during
- program execution, then set the lowest bit (PROT_INIT) of
- SwProtocol::nRecord. This activates the function group of the following
- macro and causes it to be logged in the future.
-
- * 3. Spezialfall von 2.: Wenn man 2. in der Methode SwRootFrm::Paint(..) anwendet, werden
- * die Aufzeichnungseinstellung aus der Datei "dbg_lay.ini" ausgelesen!
- * In dieser INI-Datei kann es Kommentarzeilen geben, diese beginnen mit '#', dann
- * sind die Sektionen "[frmid]", "[frmtype]" und "[record]" relevant.
- * Nach [frmid] koennen die FrameIds der zu protokollierenden Frames folgen. Gibt es
- * dort keine Eintraege, werden alle Frames aufgezeichnet.
- * Nach [frmtype] koennen FrameTypen folgen, die aufgezeichnet werden sollen, da der
- * Default hier allerdings USHRT_MAX ist, werden sowieso alle aufgezeichnet. Man kann
- * allerdings auch Typen entfernen, in dem man ein '!' vor den Wert setzt, z.B.
- * !0xC000 nimmt die SwCntntFrms aus der Aufzeichnung heraus.
- * Nach [record] folgen die Funktionsgruppen, die aufgezeichnet werden sollen, Default
- * ist hier 0, also keine. Auch hier kann man mit einem vorgestellten '!' Funktionen
- * wieder entfernen.
- * Hier mal ein Beispiel fuer eine INI-Datei:
- * ------------------------------------------
- * #Funktionen: Alle, ausser PRTAREA
- * [record] 0xFFFFFFE !0x200
- * [frmid]
- * #folgende FrmIds:
- * 1 2 12 13 14 15
- * #keine Layoutframes ausser ColumnFrms
- * [frmtype] !0x3FFF 0x4
- * ------------------------------------------
- *
+ * program execution, then set the lowest bit (PROT_INIT) of
+ * SwProtocol::nRecord. This activates the function group of the following
+ * macro and causes it to be logged in the future.
* 3. There's a special case for 2: If one uses 2. in SwRootFrm::Paint(..),
* the log settings are taken from the file "dbg_lay.ini"!
* In this INI-file you can have comment lines starting with a '#'.
@@ -136,16 +91,11 @@
* #no layout frames, except ColumnFrms
* [frmtype] !0x3FFF 0x4
* ------------------------------------------
-
- * Wenn die Aufzeichnung erstmal laeuft, kann man in SwImplProtocol::_Record(...) mittels
- * Debugger vielfaeltige Manipulationen vornehmen, z.B. bezueglich FrameTypen oder FrmIds.
*
-
* As soon as the logging is in process, one can manipulate many things in
* SwImplProtocol::_Record(...) using a debugger, especially concerning
* frame types and FrmIds.
-
- * --------------------------------------------------*/
+ */
#include "dbg_lay.hxx"
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 8f792d3..e7f4ce0 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -258,7 +258,6 @@ SwFlyFrm::~SwFlyFrm()
// OD 2004-01-19 #110582#
DeleteCnt();
- //Tschuess sagen.
if ( GetAnchorFrm() )
AnchorFrm()->RemoveFly( this );
}
@@ -1935,7 +1934,7 @@ Size SwFlyFrm::ChgSize( const Size& aNewSize )
SwFmtFrmSize aSz( pFmt->GetFrmSize() );
aSz.SetWidth( aAdjustedNewSize.Width() );
aSz.SetHeight( aAdjustedNewSize.Height() );
- // uebers Doc fuers Undo!
+ // go via the Doc for UNDO
pFmt->GetDoc()->SetAttr( aSz, *pFmt );
return aSz.GetSize();
}
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index bed1e14..a1ae9cd 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -498,13 +498,10 @@ SwLayNotify::~SwLayNotify()
{
pLay->ChgLowersProp( aPrt.SSize() );
}
- //Wenn die PrtArea gewachsen ist, so ist es moeglich, dass die
- //Kette der Untergeordneten einen weiteren Frm aufnehmen kann,
- //mithin muss also der 'moeglicherweise passende' Invalidiert werden.
- //Das invalidieren lohnt nur, wenn es sich beim mir bzw. meinen
- //Uppers um eine Moveable-Section handelt.
- //Die PrtArea ist gewachsen, wenn die Breite oder die Hoehe groesser
- //geworden ist.
+ // If the PrtArea has been extended, it might be possible that the chain of parts
+ // can take another frame. As a result, the "possible right one" needs to be
+ // invalidated. This only pays off if this or its Uppers are moveable sections.
+ // A PrtArea has been extended if width or height are larger than before.
if ( (pLay->Prt().Height() > aPrt.Height() ||
pLay->Prt().Width() > aPrt.Width()) &&
(pLay->IsMoveable() || pLay->IsFlyFrm()) )
@@ -871,7 +868,7 @@ SwCntntNotify::~SwCntntNotify()
pNd->SetOLESizeInvalid( sal_False );
//TODO/LATER: needs OnDocumentPrinterChanged
//xObj->OnDocumentPrinterChanged( pNd->GetDoc()->getPrinter( false ) );
- pFESh->CalcAndSetScale( xObj );//Client erzeugen lassen.
+ pFESh->CalcAndSetScale( xObj ); // create client
}
}
//dito animated graphics
@@ -1516,16 +1513,15 @@ void _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
break;
++nIndex;
- // Der Endnode wird nicht mehr mitgenommen, es muss vom
- // Aufrufenden (Section/MakeFrms()) sichergestellt sein, dass das Ende
- // des Bereichs vor dem EndIndex liegt!
+ // Do not consider the end node. The caller (section/MakeFrms()) has to ensure that the end
+ // of this area is positioned before EndIndex!
if ( nEndIndex && nIndex >= nEndIndex )
break;
}
if ( pActualSection )
{
- //Kann passieren, dass noch eine leere (Follow-)Section uebrig geblieben ist.
+ // Might happen that an empty (Follow-)Section is left over.
if ( !(pLay = pActualSection->GetSectionFrm())->ContainsCntnt() )
{
pLay->Remove();
@@ -1534,7 +1530,7 @@ void _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
delete pActualSection;
}
- if ( bPages ) //Jetzt noch die Flys verbinden lassen.
+ if ( bPages ) // let the Flys connect to each other
{
if ( !bDontCreateObjects )
AppendAllObjs( pTbl, pLayout );
@@ -1586,24 +1582,22 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
else
bOldFtn = sal_True;
SwSectionFrm* pSct = pUpper->FindSctFrm();
- // Es sind innerhalb von Fussnoten nur die Bereiche interessant,
- // die in den Fussnoten liegen, nicht etwa die (spaltigen) Bereiche,
- // in denen die Fussnoten(Container) liegen.
+ // Inside of footnotes only those areas are interesting that are inside of them. But
+ // not the ones (e.g. column areas) in which are the footnote containers positioned.
// #109767# Table frame is in section, insert section in cell frame.
if( pSct && ((pFtnFrm && !pSct->IsInFtn()) || pUpper->IsCellFrm()) )
pSct = NULL;
if( pSct )
- { // damit der SectionFrm nicht zerstoert wird durch pTmp->MoveFwd()
+ { // to prevent pTmp->MoveFwd from destroying the SectionFrm
bOldLock = pSct->IsColLocked();
pSct->ColLock();
}
else
bOldLock = sal_True;
- // Wenn pFrm sich nicht bewegen kann, koennen wir auch niemanden
- // auf die naechste Seite schieben. Innerhalb eines Rahmens auch
- // nicht ( in der 1. Spalte eines Rahmens waere pFrm Moveable()! )
- // Auch in spaltigen Bereichen in Tabellen waere pFrm Moveable.
+ // If pFrm cannot be moved, it is not possible to move it to the next page. This applies
+ // also for frames (in the first column of a frame pFrm is moveable) and column
+ // sections of tables (also here pFrm is moveable).
bool bMoveNext = nEndIdx - rSttIdx.GetIndex() > 120;
bool bAllowMove = !pFrm->IsInFly() && pFrm->IsMoveable() &&
(!pFrm->IsInTab() || pFrm->IsTabFrm() );
@@ -1616,13 +1610,12 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
if ( bApres )
{
- // Wir wollen, dass der Rest der Seite leer ist, d.h.
- // der naechste muss auf die naechste Seite wandern.
- // Dieser kann auch in der naechsten Spalte stehen!
+ // The rest of this page should be empty. Thus, the following one has to move to
+ // the next page (it might also be located in the following column).
OSL_ENSURE( !pTmp->HasFollow(), "Follows forbidden" );
pPrev = pFrm;
- // Wenn unser umgebender SectionFrm einen Next besitzt,
- // so soll dieser ebenfalls gemoved werden!
+ // If the surrounding SectionFrm has a "next" one,
+ // so this one needs to be moved as well.
pMove = pFrm->GetIndNext();
SwColumnFrm* pCol = (SwColumnFrm*)pFrm->FindColFrm();
if( pCol )
@@ -1630,16 +1623,13 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
do
{
if( pCol && !pMove )
- { // Bisher haben wir keinen Nachfolger gefunden
- // jetzt gucken wir in die naechste Spalte
+ { // No successor so far, look into the next column
pMove = pCol->ContainsAny();
if( pCol->GetNext() )
pCol = (SwColumnFrm*)pCol->GetNext();
else if( pCol->IsInSct() )
- { // Wenn es keine naechste Spalte gibt, wir aber
- // innerhalb eines spaltigen Bereichs sind,
- // koennte es noch ausserhalb des Bereich
- // (Seiten-)Spalten geben
+ { // If there is no following column but we are in a column frame,
+ // there might be (page) columns outside of it.
pCol = (SwColumnFrm*)pCol->FindSctFrm()->FindColFrm();
if( pCol )
pCol = (SwColumnFrm*)pCol->GetNext();
@@ -1647,8 +1637,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
else
pCol = NULL;
}
- // Falls hier verschrottete SectionFrms herumgammeln,
- // muessen diese uebersprungen werden.
+ // skip invalid SectionFrms
while( pMove && pMove->IsSctFrm() &&
!((SwSectionFrm*)pMove)->GetSection() )
pMove = pMove->GetNext();
@@ -1675,8 +1664,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
else
{
OSL_ENSURE( !pTmp->IsFollow(), "Follows really forbidden" );
- // Bei Bereichen muss natuerlich der Inhalt auf die Reise
- // geschickt werden.
+ // move the _content_ of a section frame
if( pMove->IsSctFrm() )
{
while( pMove && pMove->IsSctFrm() &&
@@ -1694,9 +1682,8 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
if( pTmp )
{
SwFrm* pOldUp = pTmp->GetFrm()->GetUpper();
- // MoveFwd==sal_True bedeutet, dass wir auf der gleichen
- // Seite geblieben sind, wir wollen aber die Seite wechseln,
- // sofern dies moeglich ist
+ // MoveFwd==sal_True means that we are still on the same page.
+ // But since we want to move if possible!
sal_Bool bTmpOldLock = pTmp->IsJoinLocked();
pTmp->LockJoin();
while( pTmp->MoveFwd( sal_True, sal_False, sal_True ) )
@@ -1715,12 +1702,10 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
{
sal_Bool bSplit;
SwFrm* pPrv = bApres ? pFrm : pFrm->GetPrev();
- // Wenn in einen SectionFrm ein anderer eingefuegt wird,
- // muss dieser aufgebrochen werden
+ // If the section frame is inserted into another one, it must be split.
if( pSct && rSttIdx.GetNode().IsSectionNode() )
{
bSplit = pSct->SplitSect( pFrm, bApres );
- // Wenn pSct nicht aufgespalten werden konnte
if( !bSplit && !bApres )
{
pUpper = pSct->GetUpper();
@@ -1740,8 +1725,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
AppendAllObjs( pTbl, pUpper );
}
- // Wenn nichts eingefuegt wurde, z.B. ein ausgeblendeter Bereich,
- // muss das Splitten rueckgaengig gemacht werden
+ // If nothing was added (e.g. a hidden section), the split must be reversed.
if( bSplit && pSct && pSct->GetNext()
&& pSct->GetNext()->IsSctFrm() )
pSct->MergeNext( (SwSectionFrm*)pSct->GetNext() );
@@ -1758,9 +1742,8 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
if( !bOldLock )
{
pSct->ColUnlock();
- // Zum Beispiel beim Einfuegen von gelinkten Bereichen,
- // die wiederum Bereiche enthalten, kann pSct jetzt leer sein
- // und damit ruhig zerstoert werden.
+ // pSct might be empty (e.g. when inserting linked section containing further
+ // sections) and can be destroyed in such cases.
if( !pSct->ContainsCntnt() )
{
pSct->DelEmpty( sal_True );
@@ -1798,10 +1781,9 @@ SwBorderAttrs::SwBorderAttrs( const SwModify *pMod, const SwFrm *pConstructor )
rLR = SvxLRSpaceItem ( RES_LR_SPACE );
}
- //Achtung: Die USHORTs fuer die gecache'ten Werte werden absichtlich
- //nicht initialisiert!
+ // Caution: The USHORTs for the cached values are not initialized by intention!
- //Muessen alle einmal berechnet werden:
+ // everything needs to be calculated at least once:
bTopLine = bBottomLine = bLeftLine = bRightLine =
bTop = bBottom = bLine = sal_True;
@@ -1819,13 +1801,10 @@ SwBorderAttrs::~SwBorderAttrs()
((SwModify*)pOwner)->SetInCache( sal_False );
}
-/*
-|* Die Calc-Methoden errechnen zusaetzlich zu den
-|* von den Attributen vorgegebenen Groessen einen Sicherheitsabstand.
-|* der Sicherheitsabstand wird nur einkalkuliert, wenn Umrandung und/oder
-|* Schatten im Spiel sind; er soll vermeiden, dass aufgrund der
-|* groben physikalischen Gegebenheiten Raender usw. uebermalt werden.
-|*/
+/* All calc methods calculate a safety distance in addition to the values given by the attributes.
+ * This safety distance is only added when working with borders and/or shadows to prevent that
+ * e.g. borders are painted over.
+ */
void SwBorderAttrs::_CalcTop()
{
@@ -1932,12 +1911,10 @@ long SwBorderAttrs::CalcLeft( const SwFrm *pCaller ) const
return nLeft;
}
-/*
-|* Beschreibung Berechnung der Groessen fuer Umrandung und Schatten.
-|* Es kann auch ohne Linien ein Abstand erwuenscht sein,
-|* dieser wird dann nicht vom Attribut sondern hier
-|* beruecksichtigt (bBorderDist, z.B. fuer Zellen).
-|*/
+/* Calculated values for borders and shadows.
+ * It might be that a distance is wanted even without lines. This will be
+ * considered here and not by the attribute (e.g. bBorderDist for cells).
+ */
void SwBorderAttrs::_CalcTopLine()
{
@@ -1982,21 +1959,15 @@ void SwBorderAttrs::_IsLine()
bLine = sal_False;
}
-/*
-|* Die Umrandungen benachbarter Absaetze werden nach folgendem
-|* Algorithmus zusammengefasst:
-|*
-|* 1. Die Umrandung oben faellt weg, wenn der Vorgaenger dieselbe
-|* Umrandung oben aufweist und 3. Zutrifft.
-|* Zusaetzlich muss der Absatz mindestens rechts oder links oder
-|* unten eine Umrandung haben.
-|* 2. Die Umrandung unten faellt weg, wenn der Nachfolger dieselbe
-|* Umrandung untern aufweist und 3. Zustrifft.
-|* Zusaetzlich muss der Absatz mindestens rechts oder links oder
-|* oben eine Umrandung haben.
-|* 3. Die Umrandungen links und rechts vor Vorgaenger bzw. Nachfolger
-|* sind identisch.
-|*/
+/* The borders of neighboring paragraphs are condensed by following algorithm:
+ *
+ * 1. No top border if the predecessor has the same top border and (3) applies.
+ * In addition, the paragraph needs to have a border at at least one side (left/right/bottom).
+ * 2. No bottom border if the successor has the same bottom border and (3) applies.
+ * In addition, the paragraph needs to have a border at at least one side (left/right/top).
+ * 3. The borders on the left and right side are identical between the current and the
+ * pre-/succeeding paragraph.
+ */
inline bool CmpLines( const editeng::SvxBorderLine *pL1, const editeng::SvxBorderLine *pL2 )
{
@@ -2202,7 +2173,7 @@ const SdrObject *SwOrderIter::Top()
if ( pObjs->Count() )
{
sal_uInt32 nTopOrd = 0;
- (*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
+ (*pObjs)[0]->GetDrawObj()->GetOrdNum(); // force updating
for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SdrObject* pObj = (*pObjs)[i]->GetDrawObj();
@@ -2229,7 +2200,7 @@ const SdrObject *SwOrderIter::Bottom()
const SwSortedObjs *pObjs = pPage->GetSortedObjs();
if ( pObjs->Count() )
{
- (*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
+ (*pObjs)[0]->GetDrawObj()->GetOrdNum(); // force updating
for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SdrObject* pObj = (*pObjs)[i]->GetDrawObj();
@@ -2257,7 +2228,7 @@ const SdrObject *SwOrderIter::Next()
const SwSortedObjs *pObjs = pPage->GetSortedObjs();
if ( pObjs->Count() )
{
- (*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
+ (*pObjs)[0]->GetDrawObj()->GetOrdNum(); // force updating
for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SdrObject* pObj = (*pObjs)[i]->GetDrawObj();
@@ -2285,7 +2256,7 @@ const SdrObject *SwOrderIter::Prev()
if ( pObjs->Count() )
{
sal_uInt32 nOrd = 0;
- (*pObjs)[0]->GetDrawObj()->GetOrdNum(); //Aktualisieren erzwingen!
+ (*pObjs)[0]->GetDrawObj()->GetOrdNum(); // force updating
for ( sal_uInt16 i = 0; i < pObjs->Count(); ++i )
{
const SdrObject* pObj = (*pObjs)[i]->GetDrawObj();
@@ -2303,24 +2274,19 @@ const SdrObject *SwOrderIter::Prev()
return pCurrent;
}
-//Unterstruktur eines LayoutFrms fuer eine Aktion aufheben und wieder
-//restaurieren.
-//Neuer Algorithmus: Es ist unuetz jeden Nachbarn einzeln zu betrachten und
-//die Pointer sauber zu setzen (Upper, Nachbarn, usw.)
-//Es reicht vollkommen jeweils eine Einzelkette zu loesen, und mit dem
-//Letzen der Einzelkette nachzuschauen ob noch eine weitere Kette
-//angeheangt werden muss. Es brauchen nur die Pointer korrigiert werden,
-//die zur Verkettung notwendig sind. So koennen Beipspielsweise die Pointer
-//auf die Upper auf den alten Uppern stehenbleiben. Korrigiert werden die
-//Pointer dann im RestoreCntnt. Zwischenzeitlich ist sowieso jeder Zugriff
-//verboten.
-//Unterwegs werden die Flys bei der Seite abgemeldet.
-
+/// Keep and restore the substructure of a layout frame for an action.
+// New algorithm:
+// Do not look at each neighbor one by one to set all pointers correctly.
+// It is sufficient to detach a part of a chain and check if another chain needs to be added
+// when attaching it again. Only the pointers necessary for the chain connection need to be
+// adjusted. The correction happens in RestoreCntnt(). In between all access is restricted.
+// During this action, the Flys are detached from the page.
+//
// #115759# - 'remove' also drawing object from page and
// at-fly anchored objects from page
static void lcl_RemoveObjsFromPage( SwFrm* _pFrm )
{
- OSL_ENSURE( _pFrm->GetDrawObjs(), "Keine DrawObjs fuer lcl_RemoveFlysFromPage." );
+ OSL_ENSURE( _pFrm->GetDrawObjs(), "no DrawObjs in lcl_RemoveObjsFromPage." );
SwSortedObjs &rObjs = *_pFrm->GetDrawObjs();
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
@@ -2393,7 +2359,7 @@ SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart )
pSav = pSav->GetUpper();
if( pSav->IsInSct() )
- { // Jetzt wird der oberste Bereich gesucht, der innerhalb von pLay ist.
+ { // search the upmost section inside of pLay
SwFrm* pSect = pLay->FindSctFrm();
SwFrm *pTmp = pSav;
do
@@ -2410,9 +2376,9 @@ SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart )
do
{
if( bGo )
- pFloat->GetUpper()->pLower = 0; //Die Teilkette ausklinken.
+ pFloat->GetUpper()->pLower = 0; // detach the chain part
- //Das Ende der Teilkette suchen, unterwegs die Flys abmelden.
+ // search the end of the chain part, remove Flys on the way
do
{
if( bGo )
@@ -2435,7 +2401,7 @@ SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart )
}
}
else {
- OSL_ENSURE( !pFloat, "Neuer Float-Frame?" );
+ OSL_ENSURE( !pFloat, "new FloatFrame?" );
}
}
if ( pFloat->GetNext() )
@@ -2455,7 +2421,7 @@ SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart )
} while ( pFloat );
- //Die naechste Teilkette suchen und die Ketten miteinander verbinden.
+ // search next chain part and connect both chains
SwFrm *pTmp = pFloat->FindNext();
if( bGo )
pFloat->mpUpper = NULL;
@@ -2469,7 +2435,7 @@ SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart )
if ( pTmp && bGo )
{
- pFloat->mpNext = pTmp; //Die beiden Ketten verbinden.
+ pFloat->mpNext = pTmp; // connect both chains
pFloat->mpNext->mpPrev = pFloat;
}
pFloat = pTmp;
@@ -2483,7 +2449,7 @@ SwFrm *SaveCntnt( SwLayoutFrm *pLay, SwFrm *pStart )
// anchored objects to page
static void lcl_AddObjsToPage( SwFrm* _pFrm, SwPageFrm* _pPage )
{
- OSL_ENSURE( _pFrm->GetDrawObjs(), "Keine DrawObjs fuer lcl_AddFlysToPage." );
+ OSL_ENSURE( _pFrm->GetDrawObjs(), "no DrawObjs in lcl_AddObjsToPage." );
SwSortedObjs &rObjs = *_pFrm->GetDrawObjs();
for ( sal_uInt16 i = 0; i < rObjs.Count(); ++i )
{
@@ -2535,20 +2501,19 @@ static void lcl_AddObjsToPage( SwFrm* _pFrm, SwPageFrm* _pPage )
void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bGrow )
{
- OSL_ENSURE( pSav && pParent, "Kein Save oder Parent fuer Restore." );
+ OSL_ENSURE( pSav && pParent, "no Save or Parent provided for RestoreCntnt." );
SWRECTFN( pParent )
- //Wenn es bereits FlowFrms unterhalb des neuen Parent gibt, so wird die
- //Kette, beginnend mit pSav, hinter dem letzten angehaengt.
- //Die Teile werden kurzerhand insertet und geeignet invalidiert.
- //Unterwegs werden die Flys der CntntFrms bei der Seite angemeldet.
+ // If there are already FlowFrms below the new parent, so add the chain (starting with pSav)
+ // after the last one. The parts are inserted and invalidated if needed.
+ // On the way, the Flys of the CntntFrms are registered at the page.
SwPageFrm *pPage = pParent->FindPageFrm();
if ( pPage )
- pPage->InvalidatePage( pPage ); //Invalides Layout anmelden.
+ pPage->InvalidatePage( pPage );
- //Vorgaenger festellen und die Verbindung herstellen bzw. initialisieren.
+ // determine predecessor and establish connection or initialize
pSav->mpPrev = pSibling;
SwFrm* pNxt;
if ( pSibling )
@@ -2556,27 +2521,26 @@ void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bGro
pNxt = pSibling->mpNext;
pSibling->mpNext = pSav;
pSibling->_InvalidatePrt();
- ((SwCntntFrm*)pSibling)->InvalidatePage( pPage );//Invaliden Cntnt anmelden.
+ ((SwCntntFrm*)pSibling)->InvalidatePage( pPage );
if ( ((SwCntntFrm*)pSibling)->GetFollow() )
pSibling->Prepare( PREP_CLEAR, 0, sal_False );
}
else
{ pNxt = pParent->pLower;
pParent->pLower = pSav;
- pSav->mpUpper = pParent; //Schon mal setzen, sonst ist fuer das
- //invalidate der Parent (z.B. ein Fly) nicht klar.
- //Invaliden Cntnt anmelden.
+ pSav->mpUpper = pParent; // set here already, so that it is explicit when invalidating
+
if ( pSav->IsCntntFrm() )
((SwCntntFrm*)pSav)->InvalidatePage( pPage );
else
- { // pSav koennte auch ein leerer SectFrm sein
+ { // pSav might be an empty SectFrm
SwCntntFrm* pCnt = pParent->ContainsCntnt();
if( pCnt )
pCnt->InvalidatePage( pPage );
}
}
- //Der Parent muss entsprechend gegrow'ed werden.
+ // the parent needs to grow appropiately
SwTwips nGrowVal = 0;
SwFrm* pLast;
do
@@ -2584,12 +2548,12 @@ void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bGro
nGrowVal += (pSav->Frm().*fnRect->fnGetHeight)();
pSav->_InvalidateAll();
- //Jetzt die Flys anmelden, fuer TxtFrms gleich geeignet invalidieren.
+ // register Flys, if TxtFrms than also invalidate appropriately
if ( pSav->IsCntntFrm() )
{
if ( pSav->IsTxtFrm() &&
((SwTxtFrm*)pSav)->GetCacheIdx() != USHRT_MAX )
- ((SwTxtFrm*)pSav)->Init(); //Ich bin sein Freund.
+ ((SwTxtFrm*)pSav)->Init(); // I am its friend
if ( pPage && pSav->GetDrawObjs() )
::lcl_AddObjsToPage( (SwCntntFrm*)pSav, pPage );
@@ -2603,7 +2567,7 @@ void RestoreCntnt( SwFrm *pSav, SwLayoutFrm *pParent, SwFrm *pSibling, bool bGro
::lcl_AddObjsToPage( pBlub, pPage );
if( pBlub->IsTxtFrm() && ((SwTxtFrm*)pBlub)->HasFtn() &&
((SwTxtFrm*)pBlub)->GetCacheIdx() != USHRT_MAX )
- ((SwTxtFrm*)pBlub)->Init(); //Ich bin sein Freund.
+ ((SwTxtFrm*)pBlub)->Init(); // I am its friend
pBlub = pBlub->GetNextCntntFrm();
} while ( pBlub && ((SwLayoutFrm*)pSav)->IsAnLower( pBlub ));
}
@@ -2651,8 +2615,7 @@ SwPageFrm * InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
}
}
SwFrmFmt *pFmt(bOdd ? rDesc.GetRightFmt(bFirst) : rDesc.GetLeftFmt(bFirst));
- //Wenn ich kein FrmFmt fuer die Seite gefunden habe, muss ich eben
- //eine Leerseite einfuegen.
+ // If there is no FrmFmt for this page, add an empty page
if ( !pFmt )
{
pFmt = bOdd ? rDesc.GetLeftFmt() : rDesc.GetRightFmt();
@@ -2675,10 +2638,9 @@ SwPageFrm * InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
return pRet;
}
-/* Die beiden folgenden Methoden durchsuchen rekursiv
-|* eine Layoutstruktur und melden alle FlyFrms, die einen beliebigen Frm
-|* innerhalb der Struktur als Anker haben bei der Seite an.
-|*/
+/* The following two methods search the layout structure recursively and
+ * register all Flys at the page that have a Frm in this structure as an anchor.
+ */
static void lcl_Regist( SwPageFrm *pPage, const SwFrm *pAnch )
{
@@ -2689,7 +2651,7 @@ static void lcl_Regist( SwPageFrm *pPage, const SwFrm *pAnch )
if ( pObj->ISA(SwFlyFrm) )
{
SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pObj);
- //Ggf. ummelden, nicht anmelden wenn bereits bekannt.
+ // register (not if already known)
// #i28701# - use new method <GetPageFrm()>
SwPageFrm *pPg = pFly->IsFlyFreeFrm()
? pFly->GetPageFrm() : pFly->FindPageFrm();
@@ -2740,13 +2702,13 @@ void RegistFlys( SwPageFrm *pPage, const SwLayoutFrm *pLay )
}
}
-/// Benachrichtigt den Hintergrund je nach der Veraenderung zwischen altem und neuem Rechteck.
+/// Notify the background based on the difference between old and new rectangle
void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld,
const SwRect* pOldPrt )
{
const SwRect aFrm( pFly->GetObjRectWithSpaces() );
if ( rOld.Pos() != aFrm.Pos() )
- { //Positionsaenderung, alten und neuen Bereich invalidieren
+ { // changed position, invalidate old and new area
if ( rOld.HasArea() &&
rOld.Left()+pFly->GetFmt()->GetLRSpace().GetLeft() < FAR_AWAY )
{
@@ -2755,10 +2717,8 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld,
pFly->NotifyBackground( pFly->FindPageFrm(), aFrm, PREP_FLY_ARRIVE );
}
else if ( rOld.SSize() != aFrm.SSize() )
- { //Groessenaenderung, den Bereich der Verlassen wurde bzw. jetzt
- //ueberdeckt wird invalidieren.
- //Der Einfachheit halber wird hier bewusst jeweils ein Twip
- //unnoetig invalidiert.
+ { // changed size, invalidate the area that was left or is now overlapped
+ // For simplicity, we purposely invalidate a Twip even if not needed.
SwViewShell *pSh = pFly->getRootFrm()->GetCurrShell();
if( pSh && rOld.HasArea() )
@@ -2886,9 +2846,7 @@ void Notify_Background( const SdrObject* pObj,
const PrepareHint eHint,
const sal_Bool bInva )
{
-
- //Wenn der Frm gerade erstmalig sinnvoll positioniert wurde, braucht der
- //alte Bereich nicht benachrichtigt werden.
+ // If the frame was positioned correctly for the first time, do not inform the old area
if ( eHint == PREP_FLY_LEAVE && rRect.Top() == FAR_AWAY )
return;
@@ -2916,12 +2874,11 @@ void Notify_Background( const SdrObject* pObj,
if( PREP_FLY_ARRIVE != eHint )
lcl_CheckFlowBack( pArea, rRect );
- //Es reagieren sowieso nur die auf den Anker folgenden auf den Fly, also
- //brauchen diese nicht abgeklappert werden.
- //Ausnahme sind ist natuerlich das LEAVE, denn der Fly koennte ja von
- //"oben" kommen.
- // Wenn der Anker auf der vorhergehenden Seite liegt, muss ebenfalls
- // die gesamte Seite abgearbeitet werden. (47722)
+ // Only the Flys following this anchor are reacting. Thus, those do not
+ // need to be processed.
+ // An exception is LEAVE, since the Fly might come "from above".
+ // If the anchor is positioned on the previous page, the whole page
+ // needs to be processed (47722).
// OD 2004-05-13 #i28701# - If the wrapping style has to be considered
// on the object positioning, the complete area has to be processed,
// because content frames before the anchor frame also have to consider
@@ -3006,11 +2963,9 @@ void Notify_Background( const SdrObject* pObj,
pFly->InvalidateSize();
}
}
- //Flys, die ueber mir liegen muessen/mussten evtl.
- //ausweichen, wenn sie eine automatische Ausrichtung haben.
- //das ist unabhaengig von meinem Attribut, weil dies sich
- //gerade geaendert haben kann und eben deshalb
- //umformatiert wurde.
+ // Flys above myself might sidestep if they have an automatic
+ // alignment. This happens independently of my attributes since
+ // this might have been changed as well.
else if ( pFly->IsFlyAtCntFrm() &&
pObj->GetOrdNumDirect() <
pFly->GetVirtDrawObj()->GetOrdNumDirect() &&
@@ -3039,8 +2994,8 @@ void Notify_Background( const SdrObject* pObj,
}
}
-/// liefert bei absatzgebundenen Objekten den Upper des Ankers. Falls es sich dabei um
-/// verkettete Rahmen oder Fussnoten handelt, wird ggf. der "virtuelle" Upper ermittelt.
+/// Provides the Upper of an anchor in paragraph-bound objects. If the latter
+/// is a chained border or a footnote, the "virtual" Upper might be returne.
const SwFrm* GetVirtualUpper( const SwFrm* pFrm, const Point& rPos )
{
if( pFrm->IsTxtFrm() )
@@ -3104,10 +3059,9 @@ bool Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj )
return false;
}
+/// provides the area of a frame in that no Fly from another area can overlap
const SwFrm *FindKontext( const SwFrm *pFrm, sal_uInt16 nAdditionalKontextTyp )
{
- //Liefert die Umgebung des Frm in die kein Fly aus einer anderen
- //Umgebung hineinragen kann.
const sal_uInt16 nTyp = FRM_ROOT | FRM_HEADER | FRM_FOOTER | FRM_FTNCONT |
FRM_FTN | FRM_FLY |
FRM_TAB | FRM_ROW | FRM_CELL |
@@ -3168,9 +3122,7 @@ static SwTwips lcl_CalcCellRstHeight( SwLayoutFrm *pCell )
if ( nFlyAdd )
nHeight += nFlyAdd;
- //Der Border will natuerlich auch mitspielen, er kann leider nicht
- //aus PrtArea und Frm errechnet werden, da diese in beliebiger
- //Kombination ungueltig sein koennen.
+ // The border cannot be calculated based on PrtArea and Frm, since both can be invalid.
SwBorderAttrAccess aAccess( SwFrm::GetCache(), pCell );
const SwBorderAttrs &rAttrs = *aAccess.Get();
nHeight += rAttrs.CalcTop() + rAttrs.CalcBottom();
@@ -3309,8 +3261,7 @@ SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, sal_uInt1
break;
}
- // bei Flys ggfs. ueber den Parent gehen wenn sie selbst
- // nocht nicht "formatiert" sind
+ // for Flys go via the parent if the Fly is not yet "formatted"
if( !bCalcFrm && nFrmType & FRM_FLY &&
((SwFlyFrm*)pTmpFrm)->GetAnchorFrm() &&
FAR_AWAY == pTmpFrm->Frm().Pos().getX() &&
@@ -3337,8 +3288,7 @@ SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, sal_uInt1
}
else
{
- // Wenn kein pPoint angegeben ist, dann reichen
- // wir irgendeinen raus: den ersten!
+ // if no pPoint is provided, take the first one
pMinFrm = pTmpFrm;
break;
}
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 5fc4f50..e1ac1b3 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -36,8 +36,8 @@
#define ENDNOTE 0x80000000
-/// Sucht die Position des Attributes im FtnArray am Dokument, dort stehen die Fussnoten
-/// gluecklicherweise nach ihrem Index sortiert.
+/// Search the position of an attribute in the FtnArray at the document,
+/// because all footnotes are located there, ordered by their index.
static sal_uLong lcl_FindFtnPos( const SwDoc *pDoc, const SwTxtFtn *pAttr )
{
const SwFtnIdxs &rFtnIdxs = pDoc->GetFtnIdxs();
@@ -63,9 +63,8 @@ sal_Bool SwFtnFrm::operator<( const SwTxtFtn* pTxtFtn ) const
lcl_FindFtnPos( pDoc, pTxtFtn );
}
-/// setzt pBoss auf den naechsten SwFtnBossFrm, das kann entweder eine Spalte oder eine
-/// Seite (ohne Spalten) sein. Wenn die Seite dabei gewechselt wird enthaelt pPage die
-/// neue Seite und die Funktion liefert sal_True.
+/// Set pBoss to the next SwFtnBossFrm, this might be a column or a page (w/o columns).
+/// If this includes a page change, pPage contains the new page and returns TRUE.
static sal_Bool lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
sal_Bool bDontLeave )
{
@@ -107,7 +106,7 @@ static sal_Bool lcl_NextFtnBoss( SwFtnBossFrm* &rpBoss, SwPageFrm* &rpPage,
return sal_True;
}
-/// liefert die Spaltennummer, wenn pBoss eine Spalte ist, sonst eine Null (bei Seiten).
+/// @returns column number if pBoss is a column, otherwise 0.
static sal_uInt16 lcl_ColumnNum( const SwFrm* pBoss )
{
sal_uInt16 nRet = 0;
@@ -142,8 +141,8 @@ SwFtnContFrm::SwFtnContFrm( SwFrmFmt *pFmt, SwFrm* pSib ):
mnType = FRMC_FTNCONT;
}
-/// lcl_Undersize(..) klappert einen SwFrm und dessen Inneres ab
-/// und liefert die Summe aller TxtFrm-Vergroesserungswuensche
+/// Visits pFrm and its content and returns the sum of all TxtFrm resize requests
+/// E.g. for column sections when those do not yet have the max. size.
static long lcl_Undersize( const SwFrm* pFrm )
{
long nRet = 0;
@@ -152,7 +151,7 @@ static long lcl_Undersize( const SwFrm* pFrm )
{
if( ((SwTxtFrm*)pFrm)->IsUndersized() )
{
- // Dieser TxtFrm waere gern ein bisschen groesser
+ // Does this TxtFrm would like to be a little bit bigger?
nRet = ((SwTxtFrm*)pFrm)->GetParHeight() -
(pFrm->Prt().*fnRect->fnGetHeight)();
if( nRet < 0 )
@@ -171,11 +170,10 @@ static long lcl_Undersize( const SwFrm* pFrm )
return nRet;
}
-/// "Formatiert" den Frame.
-/// Die Fixsize wird hier nicht eingestellt.
+/// "format" the frame (Fixsize is not set here).
void SwFtnContFrm::Format( const SwBorderAttrs * )
{
- //GesamtBorder ermitteln, es gibt nur einen Abstand nach oben.
+ // calculate total border, only one distance to the top
const SwPageFrm* pPage = FindPageFrm();
const SwPageFtnInfo &rInf = pPage->GetPageDesc()->GetFtnInfo();
const SwTwips nBorder = rInf.GetTopDist() + rInf.GetBottomDist() +
@@ -204,19 +202,15 @@ void SwFtnContFrm::Format( const SwBorderAttrs * )
Grow( LONG_MAX, sal_False );
else
{
- //Die Groesse in der VarSize wird durch den Inhalt plus den
- //Raendern bestimmt.
+ // VarSize is determined based on the content plus the borders
SwTwips nRemaining = 0;
SwFrm *pFrm = pLower;
while ( pFrm )
- { // lcl_Undersize(..) beruecksichtigt (rekursiv) TxtFrms, die gerne
- // groesser waeren. Diese entstehen insbesondere in spaltigen Rahmen,
- // wenn diese noch nicht ihre maximale Groesse haben.
- nRemaining += (pFrm->Frm().*fnRect->fnGetHeight)()
- + lcl_Undersize( pFrm );
+ {
+ nRemaining += (pFrm->Frm().*fnRect->fnGetHeight)() + lcl_Undersize( pFrm );
pFrm = pFrm->GetNext();
}
- //Jetzt noch den Rand addieren
+ // add the own border
nRemaining += nBorder;
SwTwips nDiff;
@@ -238,9 +232,8 @@ void SwFtnContFrm::Format( const SwBorderAttrs * )
else if ( nDiff < 0 )
{
Grow( -nDiff );
- //Es kann passieren, dass weniger Platz zur Verfuegung steht,
- //als der bereits der Border benoetigt - die Groesse der
- //PrtArea wird dann negativ.
+ // It might happen that there is less space available than the border
+ // requires. In those cases the size of PrtArea will be negative.
SwTwips nPrtHeight = (Prt().*fnRect->fnGetHeight)();
if( nPrtHeight < 0 )
{
@@ -256,15 +249,12 @@ void SwFtnContFrm::Format( const SwBorderAttrs * )
SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
{
- //Keine Pruefung ob FixSize oder nicht, die FtnContainer sind immer bis
- //zur Maximalhoehe variabel.
- //Wenn die Maximalhoehe LONG_MAX ist, so nehmen wir uns soviel Platz wie eben
- //moeglich.
- //Wenn die Seite eine spezielle Fussnotenseite ist, so nehmen wir uns auch
- //soviel Platz wie eben moeglich.
+ // No check if FixSize since FtnContainer are variable up to their max. height.
+ // If the max. height is LONG_MAX, take as much space as needed.
+ // If the page is a special footnote page, take also as much as possible.
#if OSL_DEBUG_LEVEL > 1
if ( !GetUpper() || !GetUpper()->IsFtnBossFrm() )
- { OSL_ENSURE( !this, "Keine FtnBoss." );
+ { OSL_ENSURE( !this, "no FtnBoss." );
return 0;
}
#endif
@@ -300,7 +290,7 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
if ( nDist <= 0 )
return 0L;
}
- //Der FtnBoss will bezueglich des MaxWerts auch noch mitreden.
+ // FtnBoss also influences the max value
if( !IsInSct() )
{
const SwTwips nMax = pBoss->GetVarSpace();
@@ -311,8 +301,7 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
}
}
else if( nDist > (GetPrev()->Frm().*fnRect->fnGetHeight)() )
- //aber mehr als der Body kann koennen und wollen wir nun auch wieder
- //nicht herausruecken.
+ // do not use more space than the body has
nDist = (GetPrev()->Frm().*fnRect->fnGetHeight)();
long nAvail = 0;
@@ -372,15 +361,13 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, sal_Bool bTst, sal_Bool )
if ( nReal != nDist )
{
nDist -= nReal;
- //Den masslosen Wunsch koennen wir leider nur in Grenzen erfuellen.
Frm().SSize().Height() -= nDist;
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
if( IsVertical() && !IsVertLR() && !IsReverse() )
Frm().Pos().X() += nDist;
}
- //Nachfolger braucht nicht invalidiert werden, denn wir wachsen
- //immer nach oben.
+ // growing happends upwards, so successors to not need to be invalidated
if( nReal )
{
_InvalidateSize();
@@ -495,10 +482,10 @@ void SwFtnFrm::Cut()
else if ( GetPrev() )
GetPrev()->SetRetouche();
- //Erst removen, dann Upper Shrinken.
+ // first move then shrink Upper
SwLayoutFrm *pUp = GetUpper();
- //Verkettung korrigieren.
+ // correct chaining
SwFtnFrm *pFtn = (SwFtnFrm*)this;
if ( pFtn->GetFollow() )
pFtn->GetFollow()->SetMaster( pFtn->GetMaster() );
@@ -507,12 +494,12 @@ void SwFtnFrm::Cut()
pFtn->SetFollow( 0 );
pFtn->SetMaster( 0 );
- // Alle Verbindungen kappen.
+ // cut all connections
Remove();
if ( pUp )
{
- //Die letzte Fussnote nimmt ihren Container mit.
+ // the last footnote takes the container along
if ( !pUp->Lower() )
{
SwPageFrm *pPage = pUp->FindPageFrm();
@@ -525,8 +512,8 @@ void SwFtnFrm::Cut()
SwSectionFrm* pSect = pUp->FindSctFrm();
pUp->Cut();
delete pUp;
- // Wenn der letzte Fussnotencontainer aus einem spaltigen Bereich verschwindet,
- // so kann dieser, falls er keinen Follow besitzt, zusammenschrumpfen.
+ // If the last footnote container was removed from a column
+ // section without a Follow, then this section can be shrinked.
if( pSect && !pSect->ToMaximize( sal_False ) && !pSect->IsColLocked() )
pSect->_InvalidateSize();
}
@@ -541,14 +528,14 @@ void SwFtnFrm::Cut()
void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
{
- OSL_ENSURE( pParent, "Kein Parent fuer Paste." );
- OSL_ENSURE( pParent->IsLayoutFrm(), "Parent ist CntntFrm." );
- OSL_ENSURE( pParent != this, "Bin selbst der Parent." );
- OSL_ENSURE( pSibling != this, "Bin mein eigener Nachbar." );
+ OSL_ENSURE( pParent, "no parent in Paste." );
+ OSL_ENSURE( pParent->IsLayoutFrm(), "Parent is CntntFrm." );
+ OSL_ENSURE( pParent != this, "I am my own parent." );
+ OSL_ENSURE( pSibling != this, "I am my own sibling." );
OSL_ENSURE( !GetPrev() && !GetNext() && !GetUpper(),
- "Bin noch irgendwo angemeldet." );
+ "I am still somewhere registered." );
- //In den Baum einhaengen.
+ // insert into tree structure
InsertBefore( (SwLayoutFrm*)pParent, pSibling );
SWRECTFN( this )
@@ -562,11 +549,11 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
if( (Frm().*fnRect->fnGetHeight)() )
pParent->Grow( (Frm().*fnRect->fnGetHeight)() );
- //Wenn mein Vorgaenger mein Master ist und/oder wenn mein Nachfolger mein
- //Follow ist so kann ich deren Inhalt uebernehmen und sie vernichten.
+ // If the predecessor is the master and/or the successor is the Follow,
+ // then take their content and destroy them.
if ( GetPrev() && GetPrev() == GetMaster() )
{ OSL_ENSURE( SwFlowFrm::CastFlowFrm( GetPrev()->GetLower() ),
- "Fussnote ohne Inhalt?" );
+ "Footnote without content?" );
(SwFlowFrm::CastFlowFrm( GetPrev()->GetLower()))->
MoveSubTree( this, GetLower() );
SwFrm *pDel = GetPrev();
@@ -575,7 +562,7 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
}
if ( GetNext() && GetNext() == GetFollow() )
{ OSL_ENSURE( SwFlowFrm::CastFlowFrm( GetNext()->GetLower() ),
- "Fussnote ohne Inhalt?" );
+ "Footnote without content?" );
(SwFlowFrm::CastFlowFrm( GetNext()->GetLower()))->MoveSubTree( this );
SwFrm *pDel = GetNext();
pDel->Cut();
@@ -586,7 +573,7 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
if ( GetPrev() )
{
OSL_ENSURE( lcl_FindFtnPos( pDoc, ((SwFtnFrm*)GetPrev())->GetAttr() ) <=
- lcl_FindFtnPos( pDoc, GetAttr() ), "Prev ist not FtnPrev" );
+ lcl_FindFtnPos( pDoc, GetAttr() ), "Prev is not FtnPrev" );
}
if ( GetNext() )
{
@@ -598,21 +585,20 @@ void SwFtnFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
InvalidateNxtFtnCnts( pPage );
}
-/// Liefert das naechste LayoutBlatt in den das Frame gemoved werden kann.
-/// Neue Seiten werden nur dann erzeugt, wenn der Parameter sal_True ist.
+/// Return the next layout leaf in that the frame can be moved.
SwLayoutFrm *SwFrm::GetNextFtnLeaf( MakePageType eMakePage )
{
SwFtnBossFrm *pOldBoss = FindFtnBossFrm();
SwPageFrm* pOldPage = pOldBoss->FindPageFrm();
SwPageFrm* pPage;
SwFtnBossFrm *pBoss = pOldBoss->IsColumnFrm() ?
- (SwFtnBossFrm*)pOldBoss->GetNext() : 0; // naechste Spalte, wenn vorhanden
+ (SwFtnBossFrm*)pOldBoss->GetNext() : 0; // next column, if existing
if( pBoss )
pPage = NULL;
else
{
if( pOldBoss->GetUpper()->IsSctFrm() )
- { // Das kann nur in einem spaltigen Bereich sein
+ { // this can only be in a column area
SwLayoutFrm* pNxt = pOldBoss->GetNextSctLeaf( eMakePage );
if( pNxt )
{
@@ -625,39 +611,37 @@ SwLayoutFrm *SwFrm::GetNextFtnLeaf( MakePageType eMakePage )
}
else
{
- // naechste Seite
+ // next page
pPage = (SwPageFrm*)pOldPage->GetNext();
- // Leerseiten ueberspringen
+ // skip empty pages
if( pPage && pPage->IsEmptyPage() )
pPage = (SwPageFrm*)pPage->GetNext();
pBoss = pPage;
}
}
- // Was haben wir jetzt?
- // pBoss != NULL, pPage==NULL => pBoss ist die auf der gleichen Seite folgende Spalte
- // pBoss != NULL, pPage!=NULL => pBoss und pPage sind die folgende Seite (Empty uebersprungen)
- // pBoss == NULL => pPage == NULL, es gibt keine folgende Seite
+ // What do we have until here?
+ // pBoss != NULL, pPage==NULL => pBoss is the next column on the same page
+ // pBoss != NULL, pPage!=NULL => pBoss and pPage are the following page (empty pages skipped)
+ // pBoss == NULL => pPage == NULL, so there are no following pages
- //Wenn die Fussnote bereits einen Follow hat brauchen wir nicht zu suchen.
- //Wenn allerdings zwischen Ftn und Follow unerwuenschte Leerseiten/spalten
- //herumlungern, so legen wir auf der naechstbesten Seite/Spalte einen weiteren
- //Follow an, der Rest wird sich schon finden.
+ // If the footnote has already a Follow we do not need to search.
+ // However, if there are unwanted empty columns/pages between Ftn and Follow,
+ // create another Follow on the next best column/page and the rest will sort itself out.
SwFtnFrm *pFtn = FindFtnFrm();
if ( pFtn && pFtn->GetFollow() )
{
SwFtnBossFrm* pTmpBoss = pFtn->GetFollow()->FindFtnBossFrm();
- // Folgende Faelle werden hier erkannt und akzeptiert
- // 1. Die FtnBosse sind benachbarte Seiten oder benachbarte Spalten
- // 2. Der neue ist die erste Spalte der benachbarten Seite
- // 3. Der neue ist die erste Spalte in einem Bereich in der naechsten Spalte/Seite
+ // Following cases will be handled:
+ // 1. both "FtnBoss"es are neighboring columns/pages
+ // 2. the new one is the first column of a neighboring page
+ // 3. the new one is the first column in a section of the next page
while( pTmpBoss != pBoss && pTmpBoss && !pTmpBoss->GetPrev() )
pTmpBoss = pTmpBoss->GetUpper()->FindFtnBossFrm();
if( pTmpBoss == pBoss )
return pFtn->GetFollow();
}
- // Wenn wir keinen pBoss gefunden haben oder es sich um eine "falsche" Seite handelt,
- // muss eine neue Seite her
+ // If no pBoss could be found or it is a "wrong" page, we need a new page.
if ( !pBoss || ( pPage && pPage->IsEndNotePage() && !pOldPage->IsEndNotePage() ) )
{
if ( eMakePage == MAKEPAGE_APPEND || eMakePage == MAKEPAGE_INSERT )
@@ -669,13 +653,13 @@ SwLayoutFrm *SwFrm::GetNextFtnLeaf( MakePageType eMakePage )
return 0;
}
if( pBoss->IsPageFrm() )
- { // Wenn wir auf einer spaltigen Seite gelandet sind,
- // gehen wir in die erste Spalte
+ {
+ // If this page has columns, then go to the first one
SwLayoutFrm* pLay = pBoss->FindBodyCont();
if( pLay && pLay->Lower() && pLay->Lower()->IsColumnFrm() )
pBoss = (SwFtnBossFrm*)pLay->Lower();
}
- //Seite/Spalte gefunden, da schummeln wir uns doch gleich mal 'rein
+ // found column/page - add myself
SwFtnContFrm *pCont = pBoss->FindFtnCont();
if ( !pCont && pBoss->GetMaxFtnHeight() &&
( eMakePage == MAKEPAGE_APPEND || eMakePage == MAKEPAGE_INSERT ) )
@@ -683,11 +667,11 @@ SwLayoutFrm *SwFrm::GetNextFtnLeaf( MakePageType eMakePage )
return pCont;
}
-/// Liefert das vorhergehende LayoutBlatt in das der Frame gemoved werden kann.
+/// Get the preceeding layout leaf in that the frame can be moved.
SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
{
- //Der Vorgaenger fuer eine Fussnote ist falls moeglich der Master
- //in der Fussnoteneigenen Verkettung.
+ // The predecessor of a footnote is (if possible)
+ // the master of the chain of the footnote.
SwFtnFrm *pFtn = FindFtnFrm();
SwLayoutFrm *pRet = pFtn->GetMaster();
@@ -695,7 +679,7 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
SwPageFrm *pOldPage = pOldBoss->FindPageFrm();
if ( !pOldBoss->GetPrev() && !pOldPage->GetPrev() )
- return pRet; // es gibt weder eine Spalte noch eine Seite vor uns
+ return pRet; // there is neither a predecessor column nor page
if ( !pRet )
{
@@ -713,9 +697,8 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
const sal_uInt16 nNum = pStop->GetPhyPageNum();
- //Wenn die Fussnoten am Dokumentende angezeigt werden, so verlassen wir
- //die Entsprechenden Seiten nicht.
- //Selbiges gilt analog fuer die Endnotenseiten.
+ // Do not leave the corresponding page if the footnote should
+ // be shown at the document ending or the footnote is an endnote.
const sal_Bool bEndNote = pOldPage->IsEndNotePage();
const sal_Bool bFtnEndDoc = pOldPage->IsFtnPage();
SwFtnBossFrm* pNxtBoss = pOldBoss;
@@ -725,8 +708,8 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
do
{
if( pNxtBoss->IsColumnFrm() && pNxtBoss->GetPrev() )
- pNxtBoss = (SwFtnBossFrm*)pNxtBoss->GetPrev(); // eine Spalte zurueck
- else // oder eine Seite zurueck
+ pNxtBoss = (SwFtnBossFrm*)pNxtBoss->GetPrev(); // one column backwards
+ else // one page backwards
{
SwLayoutFrm* pBody = 0;
if( pSect )
@@ -753,12 +736,11 @@ SwLayoutFrm *SwFrm::GetPrevFtnLeaf( MakePageType eMakeFtn )
SwPageFrm* pPage = (SwPageFrm*)pNxtBoss->FindPageFrm()->GetPrev();
if( !pPage || pPage->GetPhyPageNum() < nNum ||
bEndNote != pPage->IsEndNotePage() || bFtnEndDoc != pPage->IsFtnPage() )
- return NULL; // Keine in Frage kommende Seite mehr gefunden
+ return NULL; // no further pages found
pNxtBoss = pPage;
pBody = pPage->FindBodyCont();
}
- // Die vorherige Seite haben wir nun, ggf. sollten wir in die letzte Spalte
- // der Seite wechseln
+ // We have the previous page, we might need to find the last column of it
if( pBody )
{
if ( pBody->Lower() && pBody->Lower()->IsColumnFrm() )
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list