Files
libreoffice/sw/source/core/layout/calcmove.cxx

2047 lines
79 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 sw34bf06: #o12311627# use <rtl_random> methods to create unique ids for list styles and list ids http://svn.apache.org/viewvc?view=revision&revision=1172112 sw34bf06 #i114725#,#i115828# - method <SwDoc::ClearDoc()> - clear list structures completely http://svn.apache.org/viewvc?view=revision&revision=1172122 i#118572 - remove ui string and help content regarding usage of Java Mail in Writer's Mail Merge as Java Mail is not used. http://svn.apache.org/viewvc?view=revision&revision=1197035 Patches contributed by Mathias Bauer cws mba34issues01: #i117718#: provide filter name in case storage of medium does not allow to detect one http://svn.apache.org/viewvc?view=revision&revision=1172350 cws mba34issues01: #i117721#: directly provide parameters retrieved from SfxMedium http://svn.apache.org/viewvc?view=revision&revision=1172353 gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 cws mba34issues01: #i117723#: convert assertion into trace http://svn.apache.org/viewvc?view=revision&revision=1172355 cws mba34issues01: #i117699#: keep layout alive until swdoc dies http://svn.apache.org/viewvc?view=revision&revision=1172362 cws mba34issues01: #i117943#: missing color attributes in RTF clipboard http://svn.apache.org/viewvc?view=revision&revision=1172363 Patch contributed by Henning Brinkmann imported patch i#103878 http://svn.apache.org/viewvc?view=revision&revision=1172109 Patches contributed by Michael Stahl sw34bf06: #i117955#: WW8 export: disable storing of section breaks in endnotes http://svn.apache.org/viewvc?view=revision&revision=1172119 Patch contributed by imacat Fixed the Asian language work count. http://svn.apache.org/viewvc?view=revision&revision=1241345 Patch contributed by Pedro Giffuni i#20878 - Add comment with BZ issue for reference. http://svn.apache.org/viewvc?view=revision&revision=1244517 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 add writerperfect dependency.
2011-03-31 10:05:04 +02:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2000-09-18 23:08:29 +00:00
#include "rootfrm.hxx"
#include "pagefrm.hxx"
#include "cntfrm.hxx"
#include "viewsh.hxx"
#include "doc.hxx"
#include "viewimp.hxx"
#include "viewopt.hxx"
2000-09-18 23:08:29 +00:00
#include "swtypes.hxx"
#include "dflyobj.hxx"
#include "dcontact.hxx"
#include "flyfrm.hxx"
#include "frmtool.hxx"
#include "txtftn.hxx"
#include "fmtftn.hxx"
#include <editeng/ulspitem.hxx>
#include <editeng/keepitem.hxx>
2000-09-18 23:08:29 +00:00
#include <vcl/outdev.hxx>
#include <fmtfsize.hxx>
#include <fmtanchr.hxx>
#include <fmtclbl.hxx>
2000-09-18 23:08:29 +00:00
#include "tabfrm.hxx"
#include "ftnfrm.hxx"
#include "txtfrm.hxx"
#include "pagedesc.hxx"
#include "ftninfo.hxx"
#include "sectfrm.hxx"
#include "dbg_lay.hxx"
// #i28701#
#include <sortedobjs.hxx>
#include <layouter.hxx>
// #i36347#
#include <flyfrms.hxx>
#include <ndtxt.hxx>
2000-09-18 23:08:29 +00:00
//------------------------------------------------------------------------
// Move methods
2000-09-18 23:08:29 +00:00
//------------------------------------------------------------------------
/*************************************************************************
|*
|* SwCntntFrm::ShouldBwdMoved()
|*
|* Description Return value tells whether the Frm should be moved.
2000-09-18 23:08:29 +00:00
|*
|*************************************************************************/
sal_Bool SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, sal_Bool, sal_Bool & )
2000-09-18 23:08:29 +00:00
{
if ( (SwFlowFrm::IsMoveBwdJump() || !IsPrevObjMove()))
{
// Floating back a frm uses a bit of time unfortunately.
// The most common case is the following: The Frm wants to float to
// somewhere where the FixSize is the same that the Frm itself has already.
// In that case it's pretty easy to check if the Frm has enough space
// for its VarSize. If this is NOT the case, we already know that
// we don't need to move.
// The Frm checks itself whether it has enough space - respecting the fact
// that it could possibly split itself if needed.
// If, however, the FixSize differs from the Frm or Flys are involved
// (either in the old or the new position), checking is pointless,
// and we have to move the Frm just to see what happens - if there's
// some space available to do it, that is.
// The FixSize of the containers of Cntnts is always the width.
// If we moved more than one sheet back (for example jumping over empty
// pages), we have to move either way. Otherwise, if the Frm doesn't fit
// into the page, empty pages wouldn't be respected anymore.
sal_uInt8 nMoveAnyway = 0;
2000-09-18 23:08:29 +00:00
SwPageFrm * const pNewPage = pNewUpper->FindPageFrm();
SwPageFrm *pOldPage = FindPageFrm();
if ( SwFlowFrm::IsMoveBwdJump() )
return sal_True;
2000-09-18 23:08:29 +00:00
if( IsInFtn() && IsInSct() )
{
SwFtnFrm* pFtn = FindFtnFrm();
SwSectionFrm* pMySect = pFtn->FindSctFrm();
if( pMySect && pMySect->IsFtnLock() )
{
SwSectionFrm *pSect = pNewUpper->FindSctFrm();
while( pSect && pSect->IsInFtn() )
pSect = pSect->GetUpper()->FindSctFrm();
OSL_ENSURE( pSect, "Escaping footnote" );
2000-09-18 23:08:29 +00:00
if( pSect != pMySect )
return sal_False;
2000-09-18 23:08:29 +00:00
}
}
SWRECTFN( this )
2001-11-14 13:40:22 +00:00
SWRECTFNX( pNewUpper )
if( Abs( (pNewUpper->Prt().*fnRectX->fnGetWidth)() -
(GetUpper()->Prt().*fnRect->fnGetWidth)() ) > 1 ) {
// In this case, only a _WouldFit with test move is possible
nMoveAnyway = 2;
}
// OD 2004-05-26 #i25904# - do *not* move backward,
// if <nMoveAnyway> equals 3 and no space is left in new upper.
nMoveAnyway |= BwdMoveNecessary( pOldPage, Frm() );
2000-09-18 23:08:29 +00:00
{
const IDocumentSettingAccess* pIDSA = pNewPage->GetFmt()->getIDocumentSettingAccess();
2000-09-18 23:08:29 +00:00
SwTwips nSpace = 0;
SwRect aRect( pNewUpper->Prt() );
aRect.Pos() += pNewUpper->Frm().Pos();
const SwFrm *pPrevFrm = pNewUpper->Lower();
while ( pPrevFrm )
{
SwTwips nNewTop = (pPrevFrm->Frm().*fnRectX->fnGetBottom)();
// OD 2004-03-01 #106629#:
// consider lower spacing of last frame in a table cell
{
// check, if last frame is inside table and if it includes
// its lower spacing.
if ( !pPrevFrm->GetNext() && pPrevFrm->IsInTab() &&
pIDSA->get(IDocumentSettingAccess::ADD_PARA_SPACING_TO_TABLE_CELLS) )
{
const SwFrm* pLastFrm = pPrevFrm;
// if last frame is a section, take its last content
if ( pPrevFrm->IsSctFrm() )
{
pLastFrm = static_cast<const SwSectionFrm*>(pPrevFrm)->FindLastCntnt();
if ( pLastFrm &&
pLastFrm->FindTabFrm() != pPrevFrm->FindTabFrm() )
{
pLastFrm = pLastFrm->FindTabFrm();
}
}
if ( pLastFrm )
{
SwBorderAttrAccess aAccess( SwFrm::GetCache(), pLastFrm );
const SwBorderAttrs& rAttrs = *aAccess.Get();
nNewTop -= rAttrs.GetULSpace().GetLower();
}
}
}
(aRect.*fnRectX->fnSetTop)( nNewTop );
2000-09-18 23:08:29 +00:00
pPrevFrm = pPrevFrm->GetNext();
}
nMoveAnyway |= BwdMoveNecessary( pNewPage, aRect);
//determine space left in new upper frame
nSpace = (aRect.*fnRectX->fnGetHeight)();
const ViewShell *pSh = pNewUpper->getRootFrm()->GetCurrShell();
if ( IsInFtn() ||
(pSh && pSh->GetViewOptions()->getBrowseMode()) ||
pNewUpper->IsCellFrm() ||
( pNewUpper->IsInSct() && ( pNewUpper->IsSctFrm() ||
( pNewUpper->IsColBodyFrm() &&
!pNewUpper->GetUpper()->GetPrev() &&
!pNewUpper->GetUpper()->GetNext() ) ) ) )
nSpace += pNewUpper->Grow( LONG_MAX, sal_True );
if ( nMoveAnyway < 3 )
{
2000-09-18 23:08:29 +00:00
if ( nSpace )
{
// Do not notify footnotes which are stuck to the paragraph:
// This would require extremely confusing code, taking into
// account the widths
// and Flys, that in turn influence the footnotes, ...
// _WouldFit can only be used if the width is the same and
// ONLY self-anchored Flys are present.
// _WouldFit can also be used if ONLY Flys anchored
// somewhere else are present.
// In this case, the width doesn't even matter,
// because we're running a TestFormat in the new upper.
const sal_uInt8 nBwdMoveNecessaryResult =
BwdMoveNecessary( pNewPage, aRect);
const bool bObjsInNewUpper( nBwdMoveNecessaryResult == 2 ||
nBwdMoveNecessaryResult == 3 );
return _WouldFit( nSpace, pNewUpper, nMoveAnyway == 2,
bObjsInNewUpper );
2000-09-18 23:08:29 +00:00
}
// It's impossible for _WouldFit to return a usable result if
// we have a fresh multi-column section - so we really have to
// float back
2000-09-18 23:08:29 +00:00
else if( pNewUpper->IsInSct() && pNewUpper->IsColBodyFrm() &&
2001-11-14 13:40:22 +00:00
!(pNewUpper->Prt().*fnRectX->fnGetWidth)() &&
2000-09-18 23:08:29 +00:00
( pNewUpper->GetUpper()->GetPrev() ||
pNewUpper->GetUpper()->GetNext() ) )
return sal_True;
2000-09-18 23:08:29 +00:00
else
return sal_False; // No space. No sense in floating back
2000-09-18 23:08:29 +00:00
}
else
{
// OD 2004-05-26 #i25904# - check for space left in new upper
if ( nSpace )
return sal_True;
else
return sal_False;
}
2000-09-18 23:08:29 +00:00
}
}
return sal_False;
2000-09-18 23:08:29 +00:00
}
//------------------------------------------------------------------------
// Calc methods
2000-09-18 23:08:29 +00:00
//------------------------------------------------------------------------
/*************************************************************************
|*
|* SwFrm::Prepare()
|*
|* Description: Prepares the Frm for "formatting" (MakeAll()).
|* This method serves to save stack space: To calculate the position
|* of the Frm we have to make sure that the positions of Upper and Prev
|* respectively are valid. This may require a recursive call (a loop
|* would be quite expensive, as it's not required very often).
|* Every call of MakeAll requires around 500 bytes on the stack - you
|* easily see where this leads. _Prepare requires only a little bit of
|* stack space, so the recursive call should not be a problem here.
|* Another advantage is that one nice day, _Prepare and with it
|* the formatting of predecessors could be avoided. Then it could
|* probably be possible to jump "quickly" to the document's end.
2000-09-18 23:08:29 +00:00
|*
|*************************************************************************/
// Two little friendships form a secret society
2000-09-18 23:08:29 +00:00
inline void PrepareLock( SwFlowFrm *pTab )
{
pTab->LockJoin();
}
inline void PrepareUnlock( SwFlowFrm *pTab )
{
pTab->UnlockJoin();
}
// hopefully, one day this function simply will return 'false'
static bool lcl_IsCalcUpperAllowed( const SwFrm& rFrm )
{
return !rFrm.GetUpper()->IsSctFrm() &&
!rFrm.GetUpper()->IsFooterFrm() &&
// #i23129#, #i36347# - no format of upper Writer fly frame
!rFrm.GetUpper()->IsFlyFrm() &&
!( rFrm.GetUpper()->IsTabFrm() && rFrm.GetUpper()->GetUpper()->IsInTab() ) &&
!( rFrm.IsTabFrm() && rFrm.GetUpper()->IsInTab() );
}
2000-09-18 23:08:29 +00:00
void SwFrm::PrepareMake()
{
StackHack aHack;
if ( GetUpper() )
{
if ( lcl_IsCalcUpperAllowed( *this ) )
2000-09-18 23:08:29 +00:00
GetUpper()->Calc();
OSL_ENSURE( GetUpper(), ":-( Layout unstable (Upper gone)." );
2000-09-18 23:08:29 +00:00
if ( !GetUpper() )
return;
const bool bCnt = IsCntntFrm();
const bool bTab = IsTabFrm();
sal_Bool bNoSect = IsInSct();
sal_Bool bOldTabLock = sal_False, bFoll = sal_False;
2000-09-18 23:08:29 +00:00
SwFlowFrm* pThis = bCnt ? (SwCntntFrm*)this : NULL;
if ( bTab )
{
pThis = (SwTabFrm*)this;
bOldTabLock = ((SwTabFrm*)this)->IsJoinLocked();
::PrepareLock( (SwTabFrm*)this );
bFoll = pThis->IsFollow();
}
else if( IsSctFrm() )
{
pThis = (SwSectionFrm*)this;
bFoll = pThis->IsFollow();
bNoSect = sal_False;
2000-09-18 23:08:29 +00:00
}
else if ( bCnt && sal_True == (bFoll = pThis->IsFollow()) &&
2000-09-18 23:08:29 +00:00
GetPrev() )
{
2011-07-25 14:07:58 +05:30
//Do not follow the chain when we need only one instance
const SwTxtFrm* pMaster = ((SwCntntFrm*)this)->FindMaster();
if ( pMaster && pMaster->IsLocked() )
2000-09-18 23:08:29 +00:00
{
MakeAll();
return;
}
}
// #i44049# - no format of previous frame, if current
// frame is a table frame and its previous frame wants to keep with it.
const bool bFormatPrev = !bTab ||
!GetPrev() ||
!GetPrev()->GetAttrSet()->GetKeep().GetValue();
if ( bFormatPrev )
2000-09-18 23:08:29 +00:00
{
SwFrm *pFrm = GetUpper()->Lower();
while ( pFrm != this )
2000-09-18 23:08:29 +00:00
{
OSL_ENSURE( pFrm, ":-( Layout unstable (this not found)." );
if ( !pFrm )
return; //Oioioioi ...
2000-09-18 23:08:29 +00:00
if ( !pFrm->IsValid() )
{
// A small interference that hopefully improves on the stability:
// If I'm Follow AND neighbor of a Frm before me, it would delete
// me when formatting. This as you can see could easily become a
// confusing situation that we want to avoid.
if ( bFoll && pFrm->IsFlowFrm() &&
(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;
}
// With CntntFrms, the chain may be broken while walking through
// it. Therefore we have to figure out the follower in a bit more
// complicated way. However, I'll HAVE to get back to myself
// sometime again.
pFrm = pFrm->FindNext();
// If we started out in a SectionFrm, it might have happened that
// we landed in a Section Follow via the MakeAll calls.
// FindNext only gives us the SectionFrm, not it's content - we
// won't find ourselves anymore!
if( bNoSect && pFrm && pFrm->IsSctFrm() )
{
SwFrm* pCnt = ((SwSectionFrm*)pFrm)->ContainsAny();
if( pCnt )
pFrm = pCnt;
}
2000-09-18 23:08:29 +00:00
}
OSL_ENSURE( GetUpper(), "Layout unstable (Upper gone II)." );
if ( !GetUpper() )
return;
2000-09-18 23:08:29 +00:00
if ( lcl_IsCalcUpperAllowed( *this ) )
GetUpper()->Calc();
2000-09-18 23:08:29 +00:00
OSL_ENSURE( GetUpper(), "Layout unstable (Upper gone III)." );
}
2000-09-18 23:08:29 +00:00
if ( bTab && !bOldTabLock )
::PrepareUnlock( (SwTabFrm*)this );
}
MakeAll();
}
void SwFrm::OptPrepareMake()
{
// #i23129#, #i36347# - no format of upper Writer fly frame
if ( GetUpper() && !GetUpper()->IsFooterFrm() &&
!GetUpper()->IsFlyFrm() )
2000-09-18 23:08:29 +00:00
{
GetUpper()->Calc();
OSL_ENSURE( GetUpper(), ":-( Layout unstable (Upper gone)." );
2000-09-18 23:08:29 +00:00
if ( !GetUpper() )
return;
}
if ( GetPrev() && !GetPrev()->IsValid() )
PrepareMake();
else
{
StackHack aHack;
MakeAll();
}
}
void SwFrm::PrepareCrsr()
{
StackHack aHack;
if( GetUpper() && !GetUpper()->IsSctFrm() )
{
GetUpper()->PrepareCrsr();
GetUpper()->Calc();
OSL_ENSURE( GetUpper(), ":-( Layout unstable (Upper gone)." );
2000-09-18 23:08:29 +00:00
if ( !GetUpper() )
return;
const bool bCnt = IsCntntFrm();
const bool bTab = IsTabFrm();
sal_Bool bNoSect = IsInSct();
2000-09-18 23:08:29 +00:00
sal_Bool bOldTabLock = sal_False, bFoll;
2000-09-18 23:08:29 +00:00
SwFlowFrm* pThis = bCnt ? (SwCntntFrm*)this : NULL;
if ( bTab )
{
bOldTabLock = ((SwTabFrm*)this)->IsJoinLocked();
::PrepareLock( (SwTabFrm*)this );
pThis = (SwTabFrm*)this;
}
else if( IsSctFrm() )
{
pThis = (SwSectionFrm*)this;
bNoSect = sal_False;
2000-09-18 23:08:29 +00:00
}
bFoll = pThis && pThis->IsFollow();
SwFrm *pFrm = GetUpper()->Lower();
while ( pFrm != this )
{
OSL_ENSURE( pFrm, ":-( Layout unstable (this not found)." );
2000-09-18 23:08:29 +00:00
if ( !pFrm )
return; //Oioioioi ...
if ( !pFrm->IsValid() )
{
// A small interference that hopefully improves on the stability:
// If I'm Follow AND neighbor of a Frm before me, it would delete
// me when formatting. This as you can see could easily become a
// confusing situation that we want to avoid.
2000-09-18 23:08:29 +00:00
if ( bFoll && pFrm->IsFlowFrm() &&
(SwFlowFrm::CastFlowFrm(pFrm))->IsAnFollow( pThis ) )
break;
pFrm->MakeAll();
}
// With CntntFrms, the chain may be broken while walking through
// it. Therefore we have to figure out the follower in a bit more
// complicated way. However, I'll HAVE to get back to myself
// sometime again.
2000-09-18 23:08:29 +00:00
pFrm = pFrm->FindNext();
if( bNoSect && pFrm && pFrm->IsSctFrm() )
{
SwFrm* pCnt = ((SwSectionFrm*)pFrm)->ContainsAny();
if( pCnt )
pFrm = pCnt;
}
}
OSL_ENSURE( GetUpper(), "Layout unstable (Upper gone II)." );
2000-09-18 23:08:29 +00:00
if ( !GetUpper() )
return;
GetUpper()->Calc();
OSL_ENSURE( GetUpper(), "Layout unstable (Upper gone III)." );
2000-09-18 23:08:29 +00:00
if ( bTab && !bOldTabLock )
::PrepareUnlock( (SwTabFrm*)this );
}
Calc();
}
/*************************************************************************
|*
|* SwFrm::MakePos()
|*
|*************************************************************************/
// Here we return GetPrev(); however we will ignore empty SectionFrms
static SwFrm* lcl_Prev( SwFrm* pFrm, bool bSectPrv = true )
2000-09-18 23:08:29 +00:00
{
SwFrm* pRet = pFrm->GetPrev();
if( !pRet && pFrm->GetUpper() && pFrm->GetUpper()->IsSctFrm() &&
bSectPrv && !pFrm->IsColumnFrm() )
pRet = pFrm->GetUpper()->GetPrev();
while( pRet && pRet->IsSctFrm() &&
!((SwSectionFrm*)pRet)->GetSection() )
pRet = pRet->GetPrev();
return pRet;
}
static SwFrm* lcl_NotHiddenPrev( SwFrm* pFrm )
2000-09-18 23:08:29 +00:00
{
SwFrm *pRet = pFrm;
do
{
pRet = lcl_Prev( pRet );
} while ( pRet && pRet->IsTxtFrm() && ((SwTxtFrm*)pRet)->IsHiddenNow() );
return pRet;
}
void SwFrm::MakePos()
{
if ( !mbValidPos )
2000-09-18 23:08:29 +00:00
{
mbValidPos = sal_True;
bool bUseUpper = false;
2000-09-18 23:08:29 +00:00
SwFrm* pPrv = lcl_Prev( this );
2002-10-17 13:10:00 +00:00
if ( pPrv &&
( !pPrv->IsCntntFrm() ||
( ((SwCntntFrm*)pPrv)->GetFollow() != this ) )
)
2000-09-18 23:08:29 +00:00
{
2002-10-17 13:10:00 +00:00
if ( !StackHack::IsLocked() &&
( !IsInSct() || IsSctFrm() ) &&
!pPrv->IsSctFrm() &&
!pPrv->GetAttrSet()->GetKeep().GetValue()
)
{
pPrv->Calc(); // This may cause Prev to vanish!
2002-10-17 13:10:00 +00:00
}
2000-09-18 23:08:29 +00:00
else if ( pPrv->Frm().Top() == 0 )
2002-10-17 13:10:00 +00:00
{
bUseUpper = true;
2002-10-17 13:10:00 +00:00
}
2000-09-18 23:08:29 +00:00
}
pPrv = lcl_Prev( this, false );
sal_uInt16 nMyType = GetType();
SWRECTFN( ( IsCellFrm() && GetUpper() ? GetUpper() : this ) )
2000-09-18 23:08:29 +00:00
if ( !bUseUpper && pPrv )
2002-10-17 13:10:00 +00:00
{
maFrm.Pos( pPrv->Frm().Pos() );
if( FRM_NEIGHBOUR & nMyType )
{
sal_Bool bR2L = IsRightToLeft();
if( bR2L )
(maFrm.*fnRect->fnSetPosX)( (maFrm.*fnRect->fnGetLeft)() -
(maFrm.*fnRect->fnGetWidth)() );
else
(maFrm.*fnRect->fnSetPosX)( (maFrm.*fnRect->fnGetLeft)() +
(pPrv->Frm().*fnRect->fnGetWidth)() );
// cells may now leave their uppers
if( bVert && FRM_CELL & nMyType && !mbReverse )
maFrm.Pos().X() -= maFrm.Width() -pPrv->Frm().Width();
}
else if( bVert && FRM_NOTE_VERT & nMyType )
{
if( mbReverse )
maFrm.Pos().X() += pPrv->Frm().Width();
else
2009-03-04 16:19:59 +00:00
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
{
2009-03-04 16:19:59 +00:00
if ( bVertL2R )
maFrm.Pos().X() += pPrv->Frm().Width();
2009-03-04 16:19:59 +00:00
else
maFrm.Pos().X() -= maFrm.Width();
}
}
2001-08-29 09:47:32 +00:00
else
maFrm.Pos().Y() += pPrv->Frm().Height();
2000-09-18 23:08:29 +00:00
}
else if ( GetUpper() )
{
// OD 15.10.2002 #103517# - add safeguard for <SwFooterFrm::Calc()>
// If parent frame is a footer frame and its <ColLocked()>, then
// do *not* calculate it.
// NOTE: Footer frame is <ColLocked()> during its
// <FormatSize(..)>, which is called from <Format(..)>, which
// is called from <MakeAll()>, which is called from <Calc()>.
// #i56850#
// - no format of upper Writer fly frame, which is anchored
// at-paragraph or at-character.
if ( !GetUpper()->IsTabFrm() &&
!( IsTabFrm() && GetUpper()->IsInTab() ) &&
!GetUpper()->IsSctFrm() &&
!dynamic_cast<SwFlyAtCntFrm*>(GetUpper()) &&
2002-10-17 13:10:00 +00:00
!( GetUpper()->IsFooterFrm() &&
GetUpper()->IsColLocked() )
)
{
GetUpper()->Calc();
}
pPrv = lcl_Prev( this, false );
2000-09-18 23:08:29 +00:00
if ( !bUseUpper && pPrv )
2002-10-17 13:10:00 +00:00
{
maFrm.Pos( pPrv->Frm().Pos() );
if( FRM_NEIGHBOUR & nMyType )
{
sal_Bool bR2L = IsRightToLeft();
if( bR2L )
(maFrm.*fnRect->fnSetPosX)( (maFrm.*fnRect->fnGetLeft)() -
(maFrm.*fnRect->fnGetWidth)() );
else
(maFrm.*fnRect->fnSetPosX)( (maFrm.*fnRect->fnGetLeft)() +
(pPrv->Frm().*fnRect->fnGetWidth)() );
// cells may now leave their uppers
if( bVert && FRM_CELL & nMyType && !mbReverse )
maFrm.Pos().X() -= maFrm.Width() -pPrv->Frm().Width();
}
else if( bVert && FRM_NOTE_VERT & nMyType )
{
if( mbReverse )
maFrm.Pos().X() += pPrv->Frm().Width();
else
maFrm.Pos().X() -= maFrm.Width();
}
2001-08-29 09:47:32 +00:00
else
maFrm.Pos().Y() += pPrv->Frm().Height();
2000-09-18 23:08:29 +00:00
}
else
{
maFrm.Pos( GetUpper()->Frm().Pos() );
maFrm.Pos() += GetUpper()->Prt().Pos();
if( FRM_NEIGHBOUR & nMyType && IsRightToLeft() )
{
if( bVert )
maFrm.Pos().Y() += GetUpper()->Prt().Height()
- maFrm.Height();
else
maFrm.Pos().X() += GetUpper()->Prt().Width()
- maFrm.Width();
}
2009-03-04 16:19:59 +00:00
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
else if( bVert && !bVertL2R && FRM_NOTE_VERT & nMyType && !mbReverse )
maFrm.Pos().X() -= maFrm.Width() - GetUpper()->Prt().Width();
2000-09-18 23:08:29 +00:00
}
}
else
maFrm.Pos().X() = maFrm.Pos().Y() = 0;
2009-03-04 16:19:59 +00:00
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
if( IsBodyFrm() && bVert && !bVertL2R && !mbReverse && GetUpper() )
maFrm.Pos().X() += GetUpper()->Prt().Width() - maFrm.Width();
mbValidPos = sal_True;
2000-09-18 23:08:29 +00:00
}
}
/*************************************************************************
|*
|* SwPageFrm::MakeAll()
|*
|*************************************************************************/
// #i28701# - new type <SwSortedObjs>
static void lcl_CheckObjects( SwSortedObjs* pSortedObjs, SwFrm* pFrm, long& rBot )
2000-09-18 23:08:29 +00:00
{
// And then there can be paragraph anchored frames that sit below their paragraph.
2000-09-18 23:08:29 +00:00
long nMax = 0;
for ( sal_uInt16 i = 0; i < pSortedObjs->Count(); ++i )
2000-09-18 23:08:29 +00:00
{
// #i28701# - consider changed type of <SwSortedObjs>
// entries.
SwAnchoredObject* pObj = (*pSortedObjs)[i];
2000-09-18 23:08:29 +00:00
long nTmp = 0;
if ( pObj->ISA(SwFlyFrm) )
2000-09-18 23:08:29 +00:00
{
SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pObj);
2012-03-21 23:26:30 +01:00
if( pFly->Frm().Top() != FAR_AWAY &&
2000-09-18 23:08:29 +00:00
( pFrm->IsPageFrm() ? pFly->IsFlyLayFrm() :
( pFly->IsFlyAtCntFrm() &&
( pFrm->IsBodyFrm() ? pFly->GetAnchorFrm()->IsInDocBody() :
pFly->GetAnchorFrm()->IsInFtn() ) ) ) )
2000-09-18 23:08:29 +00:00
{
nTmp = pFly->Frm().Bottom();
}
}
else
nTmp = pObj->GetObjRect().Bottom();
2000-09-18 23:08:29 +00:00
nMax = Max( nTmp, nMax );
}
++nMax; // Lower edge vs. height!
2000-09-18 23:08:29 +00:00
rBot = Max( rBot, nMax );
}
void SwPageFrm::MakeAll()
{
PROTOCOL_ENTER( this, PROT_MAKEALL, 0, 0 )
const SwRect aOldRect( Frm() ); // Adjust root size
const SwLayNotify aNotify( this ); // takes care of the notification in the dtor
2000-09-18 23:08:29 +00:00
SwBorderAttrAccess *pAccess = 0;
const SwBorderAttrs*pAttrs = 0;
while ( !mbValidPos || !mbValidSize || !mbValidPrtArea )
2000-09-18 23:08:29 +00:00
{
if ( !mbValidPos )
2000-09-18 23:08:29 +00:00
{
// PAGES01
mbValidPos = sal_True; // positioning of the pages is taken care of by the root frame
2000-09-18 23:08:29 +00:00
}
if ( !mbValidSize || !mbValidPrtArea )
2000-09-18 23:08:29 +00:00
{
if ( IsEmptyPage() )
{
Frm().Width( 0 ); Prt().Width( 0 );
Frm().Height( 0 ); Prt().Height( 0 );
Prt().Left( 0 ); Prt().Top( 0 );
mbValidSize = mbValidPrtArea = sal_True;
2000-09-18 23:08:29 +00:00
}
else
{
if ( !pAccess )
{
pAccess = new SwBorderAttrAccess( SwFrm::GetCache(), this );
pAttrs = pAccess->Get();
}
// In BrowseView, we use fixed settings
ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( pSh && pSh->GetViewOptions()->getBrowseMode() )
2000-09-18 23:08:29 +00:00
{
const Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() );
const long nTop = pAttrs->CalcTopLine() + aBorder.Height();
const long nBottom = pAttrs->CalcBottomLine()+ aBorder.Height();
long nWidth = GetUpper() ? ((SwRootFrm*)GetUpper())->GetBrowseWidth() : 0;
if ( nWidth < pSh->GetBrowseWidth() )
nWidth = pSh->GetBrowseWidth();
nWidth += + 2 * aBorder.Width();
2000-09-18 23:08:29 +00:00
nWidth = Max( nWidth, 2L * aBorder.Width() + 4L*MM50 );
Frm().Width( nWidth );
SwLayoutFrm *pBody = FindBodyCont();
if ( pBody && pBody->Lower() && pBody->Lower()->IsColumnFrm() )
{
// Columns have a fixed height
2000-09-18 23:08:29 +00:00
Frm().Height( pAttrs->GetSize().Height() );
}
else
{
// In pages without columns, the content defines the size.
2000-09-18 23:08:29 +00:00
long nBot = Frm().Top() + nTop;
SwFrm *pFrm = Lower();
while ( pFrm )
{
long nTmp = 0;
SwFrm *pCnt = ((SwLayoutFrm*)pFrm)->ContainsAny();
while ( pCnt && (pCnt->GetUpper() == pFrm ||
((SwLayoutFrm*)pFrm)->IsAnLower( pCnt )))
{
nTmp += pCnt->Frm().Height();
if( pCnt->IsTxtFrm() &&
((SwTxtFrm*)pCnt)->IsUndersized() )
nTmp += ((SwTxtFrm*)pCnt)->GetParHeight()
- pCnt->Prt().Height();
else if( pCnt->IsSctFrm() &&
((SwSectionFrm*)pCnt)->IsUndersized() )
nTmp += ((SwSectionFrm*)pCnt)->Undersize();
pCnt = pCnt->FindNext();
}
// OD 29.10.2002 #97265# - consider invalid body frame properties
if ( pFrm->IsBodyFrm() &&
( !pFrm->GetValidSizeFlag() ||
!pFrm->GetValidPrtAreaFlag() ) &&
( pFrm->Frm().Height() < pFrm->Prt().Height() )
)
{
nTmp = Min( nTmp, pFrm->Frm().Height() );
}
else
{
// OD 30.10.2002 #97265# - assert invalid lower property
OSL_ENSURE( !(pFrm->Frm().Height() < pFrm->Prt().Height()),
"SwPageFrm::MakeAll(): Lower with frame height < printing height" );
nTmp += pFrm->Frm().Height() - pFrm->Prt().Height();
}
2000-09-18 23:08:29 +00:00
if ( !pFrm->IsBodyFrm() )
nTmp = Min( nTmp, pFrm->Frm().Height() );
nBot += nTmp;
// Here we check whether paragraph anchored objects
// protrude outside the Body/FtnCont.
2000-09-18 23:08:29 +00:00
if( pSortedObjs && !pFrm->IsHeaderFrm() &&
!pFrm->IsFooterFrm() )
lcl_CheckObjects( pSortedObjs, pFrm, nBot );
pFrm = pFrm->GetNext();
}
nBot += nBottom;
// And the page anchored ones
2000-09-18 23:08:29 +00:00
if ( pSortedObjs )
lcl_CheckObjects( pSortedObjs, this, nBot );
nBot -= Frm().Top();
// #i35143# - If second page frame
// exists, the first page doesn't have to fulfill the
// visible area.
if ( !GetPrev() && !GetNext() )
{
2000-09-18 23:08:29 +00:00
nBot = Max( nBot, pSh->VisArea().Height() );
}
// #i35143# - Assure, that the page
// doesn't exceed the defined browse height.
Frm().Height( Min( nBot, BROWSE_HEIGHT ) );
2000-09-18 23:08:29 +00:00
}
Prt().Left ( pAttrs->CalcLeftLine() + aBorder.Width() );
Prt().Top ( nTop );
Prt().Width( Frm().Width() - ( Prt().Left()
+ pAttrs->CalcRightLine() + aBorder.Width() ) );
Prt().Height( Frm().Height() - (nTop + nBottom) );
mbValidSize = mbValidPrtArea = sal_True;
2000-09-18 23:08:29 +00:00
}
else
{ // Set FixSize. For pages, this is not done from Upper, but from
// the attribute.
2000-09-18 23:08:29 +00:00
Frm().SSize( pAttrs->GetSize() );
Format( pAttrs );
}
}
}
} //while ( !mbValidPos || !mbValidSize || !mbValidPrtArea )
2000-09-18 23:08:29 +00:00
delete pAccess;
// PAGES01
if ( Frm() != aOldRect && GetUpper() )
static_cast<SwRootFrm*>(GetUpper())->CheckViewLayout( 0, 0 );
2000-09-18 23:08:29 +00:00
OSL_ENSURE( !GetUpper() || GetUpper()->Prt().Width() >= maFrm.Width(),
"Upper (Root) must be wide enough to contain the widest page");
2000-09-18 23:08:29 +00:00
}
/*************************************************************************
|*
|* SwLayoutFrm::MakeAll()
|*
|*************************************************************************/
void SwLayoutFrm::MakeAll()
{
PROTOCOL_ENTER( this, PROT_MAKEALL, 0, 0 )
// takes care of the notification in the dtor
2000-09-18 23:08:29 +00:00
const SwLayNotify aNotify( this );
sal_Bool bVert = IsVertical();
2009-03-04 16:19:59 +00:00
//Badaa: 2008-04-18 * Support for Classical Mongolian Script (SCMS) joint with Jiayanmin
SwRectFn fnRect = ( IsNeighbourFrm() == bVert )? fnRectHori : ( IsVertLR() ? fnRectVertL2R : fnRectVert );
2000-09-18 23:08:29 +00:00
SwBorderAttrAccess *pAccess = 0;
const SwBorderAttrs*pAttrs = 0;
while ( !mbValidPos || !mbValidSize || !mbValidPrtArea )
2000-09-18 23:08:29 +00:00
{
if ( !mbValidPos )
2000-09-18 23:08:29 +00:00
MakePos();
if ( GetUpper() )
{
// NEW TABLES
if ( IsLeaveUpperAllowed() )
2000-09-18 23:08:29 +00:00
{
if ( !mbValidSize )
mbValidPrtArea = sal_False;
}
else
{
if ( !mbValidSize )
{
// Set FixSize; VarSize is set by Format() after calculating the PrtArea
mbValidPrtArea = sal_False;
SwTwips nPrtWidth = (GetUpper()->Prt().*fnRect->fnGetWidth)();
if( bVert && ( IsBodyFrm() || IsFtnContFrm() ) )
{
SwFrm* pNxt = GetPrev();
while( pNxt && !pNxt->IsHeaderFrm() )
pNxt = pNxt->GetPrev();
if( pNxt )
nPrtWidth -= pNxt->Frm().Height();
pNxt = GetNext();
while( pNxt && !pNxt->IsFooterFrm() )
pNxt = pNxt->GetNext();
if( pNxt )
nPrtWidth -= pNxt->Frm().Height();
}
const long nDiff = nPrtWidth - (Frm().*fnRect->fnGetWidth)();
if( IsNeighbourFrm() && IsRightToLeft() )
(Frm().*fnRect->fnSubLeft)( nDiff );
else
(Frm().*fnRect->fnAddRight)( nDiff );
}
else
{
// Don't leave your upper
const SwTwips nDeadLine = (GetUpper()->*fnRect->fnGetPrtBottom)();
if( (Frm().*fnRect->fnOverStep)( nDeadLine ) )
mbValidSize = sal_False;
}
2000-09-18 23:08:29 +00:00
}
}
if ( !mbValidSize || !mbValidPrtArea )
2000-09-18 23:08:29 +00:00
{
if ( !pAccess )
{
pAccess = new SwBorderAttrAccess( SwFrm::GetCache(), this );
pAttrs = pAccess->Get();
}
Format( pAttrs );
}
} //while ( !mbValidPos || !mbValidSize || !mbValidPrtArea )
2011-11-17 22:13:42 +04:00
delete pAccess;
2000-09-18 23:08:29 +00:00
}
/*************************************************************************
|*
|* SwCntntFrm::MakePrtArea()
|*
|*************************************************************************/
bool SwTxtNode::IsCollapse() const
{
if (GetDoc()->get( IDocumentSettingAccess::COLLAPSE_EMPTY_CELL_PARA )
&& GetTxt().isEmpty())
{
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101 Conflicts: starmath/inc/applicat.hxx starmath/inc/dialog.hxx starmath/inc/document.hxx starmath/inc/edit.hxx starmath/inc/format.hxx starmath/inc/node.hxx starmath/inc/parse.hxx starmath/inc/rect.hxx starmath/inc/smdll.hxx starmath/inc/smmod.hxx starmath/inc/starmath.hrc starmath/inc/symbol.hxx starmath/inc/toolbox.hxx starmath/inc/utility.hxx starmath/inc/view.hxx starmath/prj/build.lst starmath/qa/cppunit/version.map starmath/sdi/smslots.sdi starmath/source/accessibility.cxx starmath/source/cfgitem.cxx starmath/source/cfgitem.hxx starmath/source/config.cxx starmath/source/dialog.cxx starmath/source/document.cxx starmath/source/edit.cxx starmath/source/format.cxx starmath/source/makefile.mk starmath/source/math_pch.cxx starmath/source/mathmlexport.cxx starmath/source/mathmlimport.cxx starmath/source/mathtype.cxx starmath/source/node.cxx starmath/source/parse.cxx starmath/source/rect.cxx starmath/source/register.cxx starmath/source/smdetect.cxx starmath/source/smdll.cxx starmath/source/smmod.cxx starmath/source/smres.src starmath/source/symbol.cxx starmath/source/toolbox.cxx starmath/source/unomodel.cxx starmath/source/utility.cxx starmath/source/view.cxx sw/JunitTest_sw_unoapi.mk sw/Library_swd.mk sw/Makefile sw/inc/IDocumentFieldsAccess.hxx sw/inc/IDocumentSettingAccess.hxx sw/inc/IDocumentUndoRedo.hxx sw/inc/IShellCursorSupplier.hxx sw/inc/SwUndoField.hxx sw/inc/acmplwrd.hxx sw/inc/authfld.hxx sw/inc/bparr.hxx sw/inc/calbck.hxx sw/inc/calc.hxx sw/inc/ccoll.hxx sw/inc/cellatr.hxx sw/inc/cellfml.hxx sw/inc/chpfld.hxx sw/inc/cmdid.h sw/inc/crsrsh.hxx sw/inc/crstate.hxx sw/inc/dbfld.hxx sw/inc/dbmgr.hxx sw/inc/dcontact.hxx sw/inc/ddefld.hxx sw/inc/doc.hxx sw/inc/docary.hxx sw/inc/docsh.hxx sw/inc/docstat.hxx sw/inc/docstyle.hxx sw/inc/docufld.hxx sw/inc/editsh.hxx sw/inc/errhdl.hxx sw/inc/expfld.hxx sw/inc/fchrfmt.hxx sw/inc/fesh.hxx sw/inc/fldbas.hxx sw/inc/flddat.hxx sw/inc/flddropdown.hxx sw/inc/flypos.hxx sw/inc/fmtanchr.hxx sw/inc/fmtautofmt.hxx sw/inc/fmtclds.hxx sw/inc/fmtcnct.hxx sw/inc/fmtcol.hxx sw/inc/fmtfsize.hxx sw/inc/fmtftn.hxx sw/inc/fmtftntx.hxx sw/inc/fmthdft.hxx sw/inc/fmtinfmt.hxx sw/inc/fmtline.hxx sw/inc/fmtornt.hxx sw/inc/fmtpdsc.hxx sw/inc/fmtruby.hxx sw/inc/fmtsrnd.hxx sw/inc/fmturl.hxx sw/inc/fmtwrapinfluenceonobjpos.hxx sw/inc/format.hxx sw/inc/frmatr.hxx sw/inc/frmfmt.hxx sw/inc/grfatr.hxx sw/inc/helpid.h sw/inc/hintids.hxx sw/inc/hints.hxx sw/inc/htmltbl.hxx sw/inc/inetfld.hxx sw/inc/io.hxx sw/inc/iodetect.hxx sw/inc/itabenum.hxx sw/inc/ndarr.hxx sw/inc/ndgrf.hxx sw/inc/ndindex.hxx sw/inc/ndnotxt.hxx sw/inc/ndole.hxx sw/inc/ndtxt.hxx sw/inc/ndtyp.hxx sw/inc/node.hxx sw/inc/numrule.hxx sw/inc/pagedesc.hxx sw/inc/pagepreviewlayout.hxx sw/inc/pam.hxx sw/inc/paratr.hxx sw/inc/poolfmt.awk sw/inc/poolfmt.hxx sw/inc/printdata.hxx sw/inc/reffld.hxx sw/inc/shellio.hxx sw/inc/shellres.hxx sw/inc/swabstdlg.hxx sw/inc/swatrset.hxx sw/inc/swerror.h sw/inc/swprtopt.hxx sw/inc/swtable.hxx sw/inc/swtypes.hxx sw/inc/tblafmt.hxx sw/inc/tgrditem.hxx sw/inc/tox.hxx sw/inc/undobj.hxx sw/inc/unocoll.hxx sw/inc/unoframe.hxx sw/inc/unoprnms.hxx sw/inc/usrfld.hxx sw/inc/viewopt.hxx sw/inc/viewsh.hxx sw/inc/viscrs.hxx sw/prj/build.lst sw/qa/complex/accessibility/makefile.mk sw/qa/core/Test-BigPtrArray.cxx sw/qa/core/makefile.mk sw/sdi/makefile.mk sw/source/core/access/makefile.mk sw/source/core/access/textmarkuphelper.cxx sw/source/core/attr/calbck.cxx sw/source/core/attr/cellatr.cxx sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx sw/source/core/attr/format.cxx sw/source/core/attr/hints.cxx sw/source/core/bastyp/calc.cxx sw/source/core/bastyp/init.cxx sw/source/core/bastyp/makefile.mk sw/source/core/bastyp/swcache.cxx sw/source/core/crsr/bookmrk.cxx sw/source/core/crsr/callnk.cxx sw/source/core/crsr/crsrsh.cxx sw/source/core/crsr/crstrvl.cxx sw/source/core/crsr/findattr.cxx sw/source/core/crsr/findcoll.cxx sw/source/core/crsr/makefile.mk sw/source/core/crsr/pam.cxx sw/source/core/crsr/swcrsr.cxx sw/source/core/crsr/trvltbl.cxx sw/source/core/crsr/unocrsr.cxx sw/source/core/crsr/viscrs.cxx sw/source/core/doc/acmplwrd.cxx sw/source/core/doc/doc.cxx sw/source/core/doc/docbm.cxx sw/source/core/doc/doccomp.cxx sw/source/core/doc/docdesc.cxx sw/source/core/doc/docdraw.cxx sw/source/core/doc/docedt.cxx sw/source/core/doc/docfld.cxx sw/source/core/doc/docfly.cxx sw/source/core/doc/docfmt.cxx sw/source/core/doc/docftn.cxx sw/source/core/doc/docglbl.cxx sw/source/core/doc/docglos.cxx sw/source/core/doc/doclay.cxx sw/source/core/doc/docnew.cxx sw/source/core/doc/docnum.cxx sw/source/core/doc/docredln.cxx sw/source/core/doc/docruby.cxx sw/source/core/doc/docsort.cxx sw/source/core/doc/docstat.cxx sw/source/core/doc/doctxm.cxx sw/source/core/doc/fmtcol.cxx sw/source/core/doc/gctable.cxx sw/source/core/doc/htmltbl.cxx sw/source/core/doc/makefile.mk sw/source/core/doc/number.cxx sw/source/core/doc/poolfmt.cxx sw/source/core/doc/tblafmt.cxx sw/source/core/doc/tblcpy.cxx sw/source/core/doc/tblrwcl.cxx sw/source/core/docnode/makefile.mk sw/source/core/docnode/ndcopy.cxx sw/source/core/docnode/ndnum.cxx sw/source/core/docnode/ndsect.cxx sw/source/core/docnode/ndtbl.cxx sw/source/core/docnode/ndtbl1.cxx sw/source/core/docnode/node.cxx sw/source/core/docnode/node2lay.cxx sw/source/core/docnode/nodes.cxx sw/source/core/docnode/section.cxx sw/source/core/docnode/swbaslnk.cxx sw/source/core/draw/dcontact.cxx sw/source/core/draw/dflyobj.cxx sw/source/core/draw/drawdoc.cxx sw/source/core/draw/dview.cxx sw/source/core/draw/makefile.mk sw/source/core/edit/autofmt.cxx sw/source/core/edit/edattr.cxx sw/source/core/edit/eddel.cxx sw/source/core/edit/edfcol.cxx sw/source/core/edit/edfld.cxx sw/source/core/edit/edfldexp.cxx sw/source/core/edit/edfmt.cxx sw/source/core/edit/edglss.cxx sw/source/core/edit/editsh.cxx sw/source/core/edit/edlingu.cxx sw/source/core/edit/ednumber.cxx sw/source/core/edit/edsect.cxx sw/source/core/edit/edtab.cxx sw/source/core/edit/edtox.cxx sw/source/core/edit/edundo.cxx sw/source/core/edit/makefile.mk sw/source/core/except/dbgloop.cxx sw/source/core/except/errhdl.cxx sw/source/core/fields/authfld.cxx sw/source/core/fields/cellfml.cxx sw/source/core/fields/chpfld.cxx sw/source/core/fields/dbfld.cxx sw/source/core/fields/ddefld.cxx sw/source/core/fields/ddetbl.cxx sw/source/core/fields/docufld.cxx sw/source/core/fields/expfld.cxx sw/source/core/fields/fldbas.cxx sw/source/core/fields/flddat.cxx sw/source/core/fields/flddropdown.cxx sw/source/core/fields/macrofld.cxx sw/source/core/fields/makefile.mk sw/source/core/fields/reffld.cxx sw/source/core/fields/scrptfld.cxx sw/source/core/fields/tblcalc.cxx sw/source/core/fields/usrfld.cxx sw/source/core/frmedt/fecopy.cxx sw/source/core/frmedt/fedesc.cxx sw/source/core/frmedt/fefly1.cxx sw/source/core/frmedt/feshview.cxx sw/source/core/frmedt/fetab.cxx sw/source/core/frmedt/fews.cxx sw/source/core/frmedt/makefile.mk sw/source/core/frmedt/tblsel.cxx sw/source/core/graphic/grfatr.cxx sw/source/core/inc/SwUndoFmt.hxx sw/source/core/inc/SwUndoTOXChange.hxx sw/source/core/inc/anchoredobjectposition.hxx sw/source/core/inc/dbgloop.hxx sw/source/core/inc/drawfont.hxx sw/source/core/inc/flowfrm.hxx sw/source/core/inc/frame.hxx sw/source/core/inc/frmtool.hxx sw/source/core/inc/layact.hxx sw/source/core/inc/layfrm.hxx sw/source/core/inc/notxtfrm.hxx sw/source/core/inc/rolbck.hxx sw/source/core/inc/rootfrm.hxx sw/source/core/inc/scriptinfo.hxx sw/source/core/inc/swblocks.hxx sw/source/core/inc/swcache.hxx sw/source/core/inc/tabfrm.hxx sw/source/core/inc/txmsrt.hxx sw/source/core/inc/undoflystrattr.hxx sw/source/core/inc/viewimp.hxx sw/source/core/layout/atrfrm.cxx sw/source/core/layout/calcmove.cxx sw/source/core/layout/dbg_lay.cxx sw/source/core/layout/findfrm.cxx sw/source/core/layout/flowfrm.cxx sw/source/core/layout/fly.cxx sw/source/core/layout/flycnt.cxx sw/source/core/layout/flyincnt.cxx sw/source/core/layout/flylay.cxx sw/source/core/layout/frmtool.cxx sw/source/core/layout/ftnfrm.cxx sw/source/core/layout/layact.cxx sw/source/core/layout/laycache.cxx sw/source/core/layout/makefile.mk sw/source/core/layout/objectformatter.cxx sw/source/core/layout/pagechg.cxx sw/source/core/layout/pagedesc.cxx sw/source/core/layout/paintfrm.cxx sw/source/core/layout/sectfrm.cxx sw/source/core/layout/tabfrm.cxx sw/source/core/layout/trvlfrm.cxx sw/source/core/layout/unusedf.cxx sw/source/core/layout/wsfrm.cxx sw/source/core/makefile.mk sw/source/core/objectpositioning/anchoredobjectposition.cxx sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx sw/source/core/objectpositioning/makefile.mk sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx sw/source/core/ole/ndole.cxx sw/source/core/para/makefile.mk sw/source/core/para/paratr.cxx sw/source/core/sw3io/makefile.mk sw/source/core/sw3io/sw3convert.cxx sw/source/core/swg/SwXMLTextBlocks.cxx sw/source/core/swg/makefile.mk sw/source/core/swg/swblocks.cxx sw/source/core/table/swnewtable.cxx sw/source/core/table/swtable.cxx sw/source/core/text/EnhancedPDFExportHelper.cxx sw/source/core/text/atrstck.cxx sw/source/core/text/frmcrsr.cxx sw/source/core/text/frmform.cxx sw/source/core/text/itrcrsr.cxx sw/source/core/text/itrform2.cxx sw/source/core/text/makefile.mk sw/source/core/text/porlay.cxx sw/source/core/text/pormulti.cxx sw/source/core/text/txtfld.cxx sw/source/core/text/txtfrm.cxx sw/source/core/text/txtio.cxx sw/source/core/tox/makefile.mk sw/source/core/tox/txmsrt.cxx sw/source/core/txtnode/fmtatr2.cxx sw/source/core/txtnode/fntcache.cxx sw/source/core/txtnode/fntcap.cxx sw/source/core/txtnode/makefile.mk sw/source/core/txtnode/ndhints.cxx sw/source/core/txtnode/ndtxt.cxx sw/source/core/txtnode/swfont.cxx sw/source/core/txtnode/thints.cxx sw/source/core/txtnode/txtatr2.cxx sw/source/core/txtnode/txtedt.cxx sw/source/core/undo/SwUndoField.cxx sw/source/core/undo/SwUndoPageDesc.cxx sw/source/core/undo/SwUndoTOXChange.cxx sw/source/core/undo/docundo.cxx sw/source/core/undo/makefile.mk sw/source/core/undo/rolbck.cxx sw/source/core/undo/unbkmk.cxx sw/source/core/undo/undel.cxx sw/source/core/undo/undobj.cxx sw/source/core/undo/undobj1.cxx sw/source/core/undo/unfmco.cxx sw/source/core/undo/unins.cxx sw/source/core/undo/unnum.cxx sw/source/core/undo/unoutl.cxx sw/source/core/undo/unredln.cxx sw/source/core/undo/unsect.cxx sw/source/core/undo/unsort.cxx sw/source/core/undo/unspnd.cxx sw/source/core/undo/untbl.cxx sw/source/core/unocore/makefile.mk sw/source/core/unocore/swunohelper.cxx sw/source/core/unocore/unobkm.cxx sw/source/core/unocore/unocoll.cxx sw/source/core/unocore/unocrsrhelper.cxx sw/source/core/unocore/unodraw.cxx sw/source/core/unocore/unofield.cxx sw/source/core/unocore/unoframe.cxx sw/source/core/unocore/unomap.cxx sw/source/core/unocore/unoprnms.cxx sw/source/core/unocore/unoredlines.cxx sw/source/core/unocore/unosett.cxx sw/source/core/unocore/unosrch.cxx sw/source/core/unocore/unostyle.cxx sw/source/core/unocore/unotbl.cxx sw/source/core/view/vdraw.cxx sw/source/core/view/viewimp.cxx sw/source/core/view/viewpg.cxx sw/source/core/view/viewsh.cxx sw/source/core/view/vnew.cxx sw/source/core/view/vprint.cxx sw/source/filter/ascii/ascatr.cxx sw/source/filter/ascii/makefile.mk sw/source/filter/ascii/wrtasc.cxx sw/source/filter/basflt/fltini.cxx sw/source/filter/basflt/iodetect.cxx sw/source/filter/basflt/makefile.mk sw/source/filter/html/SwAppletImpl.cxx sw/source/filter/html/css1atr.cxx sw/source/filter/html/htmlatr.cxx sw/source/filter/html/htmlbas.cxx sw/source/filter/html/htmlcss1.cxx sw/source/filter/html/htmlfly.cxx sw/source/filter/html/htmlftn.cxx sw/source/filter/html/htmlgrin.cxx sw/source/filter/html/htmlnum.cxx sw/source/filter/html/htmlplug.cxx sw/source/filter/html/htmltab.cxx sw/source/filter/html/makefile.mk sw/source/filter/html/parcss1.cxx sw/source/filter/html/svxcss1.cxx sw/source/filter/html/swhtml.cxx sw/source/filter/inc/msfilter.hxx sw/source/filter/inc/wrtswtbl.hxx sw/source/filter/rtf/makefile.mk sw/source/filter/rtf/rtffly.cxx sw/source/filter/rtf/rtfnum.cxx sw/source/filter/rtf/rtftbl.cxx sw/source/filter/rtf/swparrtf.cxx sw/source/filter/rtf/swparrtf.hxx sw/source/filter/writer/makefile.mk sw/source/filter/writer/writer.cxx sw/source/filter/writer/wrt_fn.cxx sw/source/filter/writer/wrtswtbl.cxx sw/source/filter/ww1/fltshell.cxx sw/source/filter/ww1/makefile.mk sw/source/filter/ww1/w1class.cxx sw/source/filter/ww1/w1class.hxx sw/source/filter/ww1/w1filter.cxx sw/source/filter/ww1/w1par.cxx sw/source/filter/ww1/w1sprm.cxx sw/source/filter/ww1/w1struct.hxx sw/source/filter/ww8/README-rtf.txt sw/source/filter/ww8/attributeoutputbase.hxx sw/source/filter/ww8/docxattributeoutput.cxx sw/source/filter/ww8/docxattributeoutput.hxx sw/source/filter/ww8/docxexport.cxx sw/source/filter/ww8/docxexport.hxx sw/source/filter/ww8/docxexportfilter.cxx sw/source/filter/ww8/dump/dump8.cxx sw/source/filter/ww8/dump/dump8a.cxx sw/source/filter/ww8/dump/msvbasic.cxx sw/source/filter/ww8/dump/msvbasic.hxx sw/source/filter/ww8/dump/ww8darr.cxx sw/source/filter/ww8/dump/ww8darr.hxx sw/source/filter/ww8/dump/ww8dout.cxx sw/source/filter/ww8/dump/ww8dout.hxx sw/source/filter/ww8/dump/ww8scan.cxx sw/source/filter/ww8/dump/ww8scan.hxx sw/source/filter/ww8/dump/ww8struc.hxx sw/source/filter/ww8/makefile.mk sw/source/filter/ww8/rtfattributeoutput.cxx sw/source/filter/ww8/rtfattributeoutput.hxx sw/source/filter/ww8/rtfexport.cxx sw/source/filter/ww8/rtfexport.hxx sw/source/filter/ww8/rtfexportfilter.cxx sw/source/filter/ww8/rtfexportfilter.hxx sw/source/filter/ww8/rtfimportfilter.cxx sw/source/filter/ww8/rtfimportfilter.hxx sw/source/filter/ww8/rtfsdrexport.cxx sw/source/filter/ww8/rtfsdrexport.hxx sw/source/filter/ww8/writerhelper.cxx sw/source/filter/ww8/writerwordglue.cxx sw/source/filter/ww8/wrtw8esh.cxx sw/source/filter/ww8/wrtw8nds.cxx sw/source/filter/ww8/wrtw8num.cxx sw/source/filter/ww8/wrtw8sty.cxx sw/source/filter/ww8/wrtww8.cxx sw/source/filter/ww8/wrtww8.hxx sw/source/filter/ww8/wrtww8gr.cxx sw/source/filter/ww8/ww8atr.cxx sw/source/filter/ww8/ww8attributeoutput.hxx sw/source/filter/ww8/ww8graf.cxx sw/source/filter/ww8/ww8graf.hxx sw/source/filter/ww8/ww8graf2.cxx sw/source/filter/ww8/ww8par.cxx sw/source/filter/ww8/ww8par.hxx sw/source/filter/ww8/ww8par2.cxx sw/source/filter/ww8/ww8par3.cxx sw/source/filter/ww8/ww8par5.cxx sw/source/filter/ww8/ww8par6.cxx sw/source/filter/ww8/ww8scan.cxx sw/source/filter/ww8/ww8scan.hxx sw/source/filter/ww8/ww8struc.hxx sw/source/filter/xml/makefile.mk sw/source/filter/xml/xmlimpit.cxx sw/source/filter/xml/xmltble.cxx sw/source/filter/xml/xmltbli.cxx sw/source/ui/app/appenv.cxx sw/source/ui/app/apphdl.cxx sw/source/ui/app/applab.cxx sw/source/ui/app/appopt.cxx sw/source/ui/app/docsh.cxx sw/source/ui/app/docsh2.cxx sw/source/ui/app/docshini.cxx sw/source/ui/app/docst.cxx sw/source/ui/app/docstyle.cxx sw/source/ui/app/makefile.mk sw/source/ui/app/mn.src sw/source/ui/app/swmodul1.cxx sw/source/ui/cctrl/makefile.mk sw/source/ui/cctrl/swlbox.cxx sw/source/ui/chrdlg/break.cxx sw/source/ui/chrdlg/ccoll.cxx sw/source/ui/chrdlg/chardlg.cxx sw/source/ui/chrdlg/drpcps.cxx sw/source/ui/chrdlg/makefile.mk sw/source/ui/chrdlg/numpara.cxx sw/source/ui/chrdlg/pardlg.cxx sw/source/ui/chrdlg/swuiccoll.cxx sw/source/ui/config/barcfg.cxx sw/source/ui/config/caption.cxx sw/source/ui/config/cfgitems.cxx sw/source/ui/config/fontcfg.cxx sw/source/ui/config/mailconfigpage.cxx sw/source/ui/config/makefile.mk sw/source/ui/config/modcfg.cxx sw/source/ui/config/optcomp.cxx sw/source/ui/config/optload.cxx sw/source/ui/config/optpage.cxx sw/source/ui/config/prtopt.cxx sw/source/ui/config/uinums.cxx sw/source/ui/config/usrpref.cxx sw/source/ui/config/viewopt.cxx sw/source/ui/dbui/dbinsdlg.cxx sw/source/ui/dbui/dbmgr.cxx sw/source/ui/dbui/dbtree.cxx sw/source/ui/dbui/makefile.mk sw/source/ui/dbui/mmaddressblockpage.cxx sw/source/ui/dbui/mmdocselectpage.cxx sw/source/ui/dbui/mmoutputpage.cxx sw/source/ui/dbui/swdbtoolsclient.cxx sw/source/ui/dialog/abstract.cxx sw/source/ui/dialog/ascfldlg.cxx sw/source/ui/dialog/macassgn.cxx sw/source/ui/dialog/makefile.mk sw/source/ui/dialog/regionsw.cxx sw/source/ui/dialog/swdlgfact.cxx sw/source/ui/dialog/swdlgfact.hxx sw/source/ui/dialog/uiregionsw.cxx sw/source/ui/dochdl/gloshdl.cxx sw/source/ui/dochdl/makefile.mk sw/source/ui/dochdl/swdtflvr.cxx sw/source/ui/docvw/PostItMgr.cxx sw/source/ui/docvw/SidebarWin.cxx sw/source/ui/docvw/edtdd.cxx sw/source/ui/docvw/edtwin.cxx sw/source/ui/docvw/edtwin2.cxx sw/source/ui/docvw/edtwin3.cxx sw/source/ui/docvw/makefile.mk sw/source/ui/docvw/romenu.cxx sw/source/ui/docvw/romenu.hxx sw/source/ui/docvw/srcedtw.cxx sw/source/ui/envelp/envfmt.cxx sw/source/ui/envelp/envimg.cxx sw/source/ui/envelp/envlop1.cxx sw/source/ui/envelp/envprt.cxx sw/source/ui/envelp/label1.cxx sw/source/ui/envelp/labfmt.cxx sw/source/ui/envelp/labprt.cxx sw/source/ui/envelp/mailmrge.cxx sw/source/ui/envelp/makefile.mk sw/source/ui/fldui/flddb.cxx sw/source/ui/fldui/flddinf.cxx sw/source/ui/fldui/flddok.cxx sw/source/ui/fldui/fldedt.cxx sw/source/ui/fldui/fldfunc.cxx sw/source/ui/fldui/fldmgr.cxx sw/source/ui/fldui/fldpage.cxx sw/source/ui/fldui/fldref.cxx sw/source/ui/fldui/fldtdlg.cxx sw/source/ui/fldui/fldvar.cxx sw/source/ui/fldui/fldwrap.cxx sw/source/ui/fldui/inpdlg.cxx sw/source/ui/fldui/makefile.mk sw/source/ui/fmtui/makefile.mk sw/source/ui/fmtui/tmpdlg.cxx sw/source/ui/frmdlg/colmgr.cxx sw/source/ui/frmdlg/column.cxx sw/source/ui/frmdlg/cption.cxx sw/source/ui/frmdlg/frmdlg.cxx sw/source/ui/frmdlg/frmmgr.cxx sw/source/ui/frmdlg/frmpage.cxx sw/source/ui/frmdlg/makefile.mk sw/source/ui/frmdlg/wrap.cxx sw/source/ui/globdoc/makefile.mk sw/source/ui/inc/bmpwin.hxx sw/source/ui/inc/colmgr.hxx sw/source/ui/inc/column.hxx sw/source/ui/inc/envimg.hxx sw/source/ui/inc/envlop.hxx sw/source/ui/inc/frmpage.hxx sw/source/ui/inc/inputwin.hxx sw/source/ui/inc/javaedit.hxx sw/source/ui/inc/num.hxx sw/source/ui/inc/optpage.hxx sw/source/ui/inc/regionsw.hxx sw/source/ui/inc/split.hxx sw/source/ui/inc/swlbox.hxx sw/source/ui/inc/swmn_tmpl.hrc sw/source/ui/inc/swuiidxmrk.hxx sw/source/ui/inc/tabsh.hxx sw/source/ui/inc/toxmgr.hxx sw/source/ui/inc/uiitems.hxx sw/source/ui/inc/view.hxx sw/source/ui/inc/workctrl.hxx sw/source/ui/inc/wrap.hxx sw/source/ui/inc/wrtsh.hxx sw/source/ui/index/cnttab.cxx sw/source/ui/index/makefile.mk sw/source/ui/index/toxmgr.cxx sw/source/ui/lingu/hhcwrp.cxx sw/source/ui/lingu/makefile.mk sw/source/ui/lingu/olmenu.cxx sw/source/ui/misc/bookmark.cxx sw/source/ui/misc/docfnote.cxx sw/source/ui/misc/glosbib.cxx sw/source/ui/misc/glosdoc.cxx sw/source/ui/misc/glshell.cxx sw/source/ui/misc/insfnote.cxx sw/source/ui/misc/linenum.cxx sw/source/ui/misc/makefile.mk sw/source/ui/misc/num.cxx sw/source/ui/misc/numberingtypelistbox.cxx sw/source/ui/misc/outline.cxx sw/source/ui/misc/pgfnote.cxx sw/source/ui/misc/pggrid.cxx sw/source/ui/misc/redlndlg.cxx sw/source/ui/misc/srtdlg.cxx sw/source/ui/misc/swmodalredlineacceptdlg.cxx sw/source/ui/ribbar/conarc.cxx sw/source/ui/ribbar/drawbase.cxx sw/source/ui/ribbar/inputwin.cxx sw/source/ui/ribbar/inputwin.src sw/source/ui/ribbar/makefile.mk sw/source/ui/ribbar/tbxanchr.cxx sw/source/ui/ribbar/workctrl.cxx sw/source/ui/ribbar/workctrl.src sw/source/ui/shells/annotsh.cxx sw/source/ui/shells/basesh.cxx sw/source/ui/shells/beziersh.cxx sw/source/ui/shells/drawdlg.cxx sw/source/ui/shells/drwbassh.cxx sw/source/ui/shells/drwtxtex.cxx sw/source/ui/shells/drwtxtsh.cxx sw/source/ui/shells/frmsh.cxx sw/source/ui/shells/grfsh.cxx sw/source/ui/shells/grfshex.cxx sw/source/ui/shells/makefile.mk sw/source/ui/shells/tabsh.cxx sw/source/ui/shells/textfld.cxx sw/source/ui/shells/textglos.cxx sw/source/ui/shells/textsh.cxx sw/source/ui/shells/textsh1.cxx sw/source/ui/shells/txtattr.cxx sw/source/ui/shells/txtcrsr.cxx sw/source/ui/shells/txtnum.cxx sw/source/ui/table/convert.cxx sw/source/ui/table/instable.cxx sw/source/ui/table/makefile.mk sw/source/ui/table/swtablerep.cxx sw/source/ui/table/tabledlg.cxx sw/source/ui/table/tablemgr.cxx sw/source/ui/table/tablepg.hxx sw/source/ui/table/tautofmt.cxx sw/source/ui/uiview/formatclipboard.cxx sw/source/ui/uiview/makefile.mk sw/source/ui/uiview/pview.cxx sw/source/ui/uiview/pview.src sw/source/ui/uiview/scroll.cxx sw/source/ui/uiview/srcview.cxx sw/source/ui/uiview/swcli.cxx sw/source/ui/uiview/uivwimp.cxx sw/source/ui/uiview/view.cxx sw/source/ui/uiview/view1.cxx sw/source/ui/uiview/view2.cxx sw/source/ui/uiview/viewcoll.cxx sw/source/ui/uiview/viewdlg2.cxx sw/source/ui/uiview/viewling.cxx sw/source/ui/uiview/viewmdi.cxx sw/source/ui/uiview/viewport.cxx sw/source/ui/uiview/viewprt.cxx sw/source/ui/uiview/viewsrch.cxx sw/source/ui/uiview/viewtab.cxx sw/source/ui/uno/SwXDocumentSettings.cxx sw/source/ui/uno/SwXPrintPreviewSettings.cxx sw/source/ui/uno/SwXPrintPreviewSettings.hxx sw/source/ui/uno/unoatxt.cxx sw/source/ui/uno/unomod.cxx sw/source/ui/uno/unotxdoc.cxx sw/source/ui/uno/unotxvw.cxx sw/source/ui/utlui/attrdesc.cxx sw/source/ui/utlui/content.cxx sw/source/ui/utlui/glbltree.cxx sw/source/ui/utlui/initui.cxx sw/source/ui/utlui/makefile.mk sw/source/ui/utlui/navipi.cxx sw/source/ui/utlui/navipi.src sw/source/ui/utlui/numfmtlb.cxx sw/source/ui/utlui/prcntfld.cxx sw/source/ui/utlui/uiitems.cxx sw/source/ui/utlui/uitool.cxx sw/source/ui/utlui/unotools.cxx sw/source/ui/utlui/viewlayoutctrl.cxx sw/source/ui/utlui/zoomctrl.cxx sw/source/ui/vba/makefile.mk sw/source/ui/vba/service.cxx sw/source/ui/web/makefile.mk sw/source/ui/wrtsh/makefile.mk sw/source/ui/wrtsh/wrtsh1.cxx sw/source/ui/wrtsh/wrtsh2.cxx sw/source/ui/wrtsh/wrtsh4.cxx sw/source/ui/wrtsh/wrtundo.cxx sw/util/hidother.src sw/util/makefile.mk sw/util/msword.map
2011-03-14 16:51:14 +00:00
sal_uLong nIdx=GetIndex();
const SwEndNode *pNdBefore=GetNodes()[nIdx-1]->GetEndNode();
const SwEndNode *pNdAfter=GetNodes()[nIdx+1]->GetEndNode();
// The paragraph is collapsed only if the NdAfter is the end of a cell
bool bInTable = this->FindTableNode( ) != NULL;
Merge commit 'ooo/DEV300_m103' Conflicts: sw/inc/calbck.hxx sw/inc/crsrsh.hxx sw/inc/dcontact.hxx sw/inc/doc.hxx sw/inc/docufld.hxx sw/inc/editsh.hxx sw/inc/expfld.hxx sw/inc/fchrfmt.hxx sw/inc/fmtcol.hxx sw/inc/fmthdft.hxx sw/inc/fmtpdsc.hxx sw/inc/format.hxx sw/inc/frmfmt.hxx sw/inc/ndhints.hxx sw/inc/ndtxt.hxx sw/inc/node.hxx sw/inc/numrule.hxx sw/inc/paratr.hxx sw/inc/swtable.hxx sw/inc/unocrsr.hxx sw/inc/unofield.hxx sw/inc/unoframe.hxx sw/inc/unoport.hxx sw/inc/unostyle.hxx sw/inc/usrfld.hxx sw/inc/viewopt.hxx sw/inc/viewsh.hxx sw/source/core/access/accframebase.cxx sw/source/core/access/accmap.cxx sw/source/core/access/accnotextframe.cxx sw/source/core/access/accpara.cxx sw/source/core/access/accpara.hxx sw/source/core/attr/calbck.cxx sw/source/core/crsr/callnk.cxx sw/source/core/crsr/crsrsh.cxx sw/source/core/doc/acmplwrd.cxx sw/source/core/doc/doc.cxx sw/source/core/doc/docdesc.cxx sw/source/core/doc/docdraw.cxx sw/source/core/doc/docfly.cxx sw/source/core/doc/docfmt.cxx sw/source/core/doc/doclay.cxx sw/source/core/doc/docnew.cxx sw/source/core/doc/docnum.cxx sw/source/core/doc/doctxm.cxx sw/source/core/doc/fmtcol.cxx sw/source/core/doc/htmltbl.cxx sw/source/core/doc/number.cxx sw/source/core/docnode/ndsect.cxx sw/source/core/docnode/ndtbl.cxx sw/source/core/docnode/node.cxx sw/source/core/docnode/node2lay.cxx sw/source/core/docnode/section.cxx sw/source/core/docnode/swbaslnk.cxx sw/source/core/draw/dcontact.cxx sw/source/core/draw/dview.cxx sw/source/core/edit/autofmt.cxx sw/source/core/edit/editsh.cxx sw/source/core/edit/edlingu.cxx sw/source/core/fields/authfld.cxx sw/source/core/fields/dbfld.cxx sw/source/core/fields/docufld.cxx sw/source/core/fields/expfld.cxx sw/source/core/fields/reffld.cxx sw/source/core/fields/tblcalc.cxx sw/source/core/frmedt/fefly1.cxx sw/source/core/frmedt/feshview.cxx sw/source/core/frmedt/tblsel.cxx sw/source/core/inc/flyfrm.hxx sw/source/core/inc/prevwpage.hxx sw/source/core/inc/rolbck.hxx sw/source/core/inc/txtfrm.hxx sw/source/core/layout/atrfrm.cxx sw/source/core/layout/findfrm.cxx sw/source/core/layout/flowfrm.cxx sw/source/core/layout/fly.cxx sw/source/core/layout/flycnt.cxx sw/source/core/layout/flylay.cxx sw/source/core/layout/frmtool.cxx sw/source/core/layout/hffrm.cxx sw/source/core/layout/pagechg.cxx sw/source/core/layout/pagedesc.cxx sw/source/core/layout/paintfrm.cxx sw/source/core/layout/sectfrm.cxx sw/source/core/layout/ssfrm.cxx sw/source/core/layout/tabfrm.cxx sw/source/core/layout/wsfrm.cxx sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx sw/source/core/table/swtable.cxx sw/source/core/text/EnhancedPDFExportHelper.cxx sw/source/core/text/inftxt.cxx sw/source/core/text/porfld.cxx sw/source/core/text/txtdrop.cxx sw/source/core/text/txtfly.cxx sw/source/core/text/txtfrm.cxx sw/source/core/text/txtio.cxx sw/source/core/text/txttab.cxx sw/source/core/tox/tox.cxx sw/source/core/txtnode/atrflyin.cxx sw/source/core/txtnode/fmtatr2.cxx sw/source/core/txtnode/ndtxt.cxx sw/source/core/undo/SwUndoPageDesc.cxx sw/source/core/undo/undraw.cxx sw/source/core/unocore/unochart.cxx sw/source/core/unocore/unocoll.cxx sw/source/core/unocore/unodraw.cxx sw/source/core/unocore/unofield.cxx sw/source/core/unocore/unoframe.cxx sw/source/core/unocore/unoftn.cxx sw/source/core/unocore/unoidx.cxx sw/source/core/unocore/unoobj2.cxx sw/source/core/unocore/unoparagraph.cxx sw/source/core/unocore/unoport.cxx sw/source/core/unocore/unoportenum.cxx sw/source/core/unocore/unoredline.cxx sw/source/core/unocore/unoredlines.cxx sw/source/core/unocore/unorefmk.cxx sw/source/core/unocore/unosect.cxx sw/source/core/unocore/unosett.cxx sw/source/core/unocore/unostyle.cxx sw/source/core/unocore/unotbl.cxx sw/source/core/unocore/unotext.cxx sw/source/core/view/viewimp.cxx sw/source/core/view/viewpg.cxx sw/source/core/view/viewsh.cxx sw/source/core/view/vnew.cxx sw/source/core/view/vprint.cxx sw/source/filter/ww8/rtfexport.cxx sw/source/filter/ww8/rtfexport.hxx sw/source/filter/ww8/wrtw8nds.cxx sw/source/filter/ww8/wrtww8gr.cxx sw/source/filter/xml/XMLRedlineImportHelper.cxx sw/source/ui/app/apphdl.cxx sw/source/ui/app/docsh.cxx sw/source/ui/app/docsh2.cxx sw/source/ui/app/swmodul1.cxx sw/source/ui/config/viewopt.cxx sw/source/ui/fldui/fldpage.cxx sw/source/ui/uiview/srcview.cxx sw/source/ui/uiview/view.cxx sw/source/ui/uno/unotxdoc.cxx sw/source/ui/vba/wordvbahelper.cxx sw/source/ui/wrtsh/wrtsh1.cxx
2011-03-23 17:00:12 +01:00
SwSortedObjs* pObjs = this->getLayoutFrm( GetDoc()->GetCurrentLayout() )->GetDrawObjs( );
sal_uInt32 nObjs = ( pObjs != NULL ) ? pObjs->Count( ) : 0;
if ( pNdBefore!=NULL && pNdAfter!=NULL && nObjs == 0 && bInTable ) {
return true;
} else {
return false;
}
} else
return false;
}
bool SwFrm::IsCollapse() const
{
if (IsTxtFrm()) {
const SwTxtFrm *pTxtFrm=(SwTxtFrm*)this;
const SwTxtNode *pTxtNode=pTxtFrm->GetTxtNode();
if (pTxtNode && pTxtNode->IsCollapse()) {
return true;
} else {
return false;
}
} else {
return false;
}
}
2000-09-18 23:08:29 +00:00
sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
2000-09-18 23:08:29 +00:00
{
sal_Bool bSizeChgd = sal_False;
2000-09-18 23:08:29 +00:00
if ( !mbValidPrtArea )
2000-09-18 23:08:29 +00:00
{
mbValidPrtArea = sal_True;
2000-09-18 23:08:29 +00:00
SWRECTFN( this )
const bool bTxtFrm = IsTxtFrm();
2001-08-29 09:47:32 +00:00
SwTwips nUpper = 0;
if ( bTxtFrm && ((SwTxtFrm*)this)->IsHiddenNow() )
{
if ( ((SwTxtFrm*)this)->HasFollow() )
((SwTxtFrm*)this)->JoinFrm();
if( (Prt().*fnRect->fnGetHeight)() )
2001-08-29 09:47:32 +00:00
((SwTxtFrm*)this)->HideHidden();
Prt().Pos().X() = Prt().Pos().Y() = 0;
(Prt().*fnRect->fnSetWidth)( (Frm().*fnRect->fnGetWidth)() );
(Prt().*fnRect->fnSetHeight)( 0 );
nUpper = -( (Frm().*fnRect->fnGetHeight)() );
2001-08-29 09:47:32 +00:00
}
else
{
// Simplification: CntntFrms are always variable in height!
2001-08-29 09:47:32 +00:00
// At the FixSize, the surrounding Frame enforces the size;
// the borders are simply subtracted.
2001-08-29 09:47:32 +00:00
const long nLeft = rAttrs.CalcLeft( this );
const long nRight = ((SwBorderAttrs&)rAttrs).CalcRight( this );
(this->*fnRect->fnSetXMargins)( nLeft, nRight );
2001-08-29 09:47:32 +00:00
ViewShell *pSh = getRootFrm()->GetCurrShell();
SwTwips nWidthArea;
if( pSh && 0!=(nWidthArea=(pSh->VisArea().*fnRect->fnGetWidth)()) &&
GetUpper()->IsPageBodyFrm() && // but not for BodyFrms in Columns
pSh->GetViewOptions()->getBrowseMode() )
2001-08-29 09:47:32 +00:00
{
// Do not protrude the edge of the visible area. The page may be
// wider, because there may be objects with excess width
// (RootFrm::ImplCalcBrowseWidth())
2001-08-29 09:47:32 +00:00
long nMinWidth = 0;
for (sal_uInt16 i = 0; GetDrawObjs() && i < GetDrawObjs()->Count();++i)
2001-08-29 09:47:32 +00:00
{
// #i28701# - consider changed type of
// <SwSortedObjs> entries
SwAnchoredObject* pObj = (*GetDrawObjs())[i];
const SwFrmFmt& rFmt = pObj->GetFrmFmt();
const sal_Bool bFly = pObj->ISA(SwFlyFrm);
2012-03-21 23:26:30 +01:00
if ((bFly && (FAR_AWAY == pObj->GetObjRect().Width()))
2010-09-30 15:39:16 +01:00
|| rFmt.GetFrmSize().GetWidthPercent())
{
2001-08-29 09:47:32 +00:00
continue;
2010-09-30 15:39:16 +01:00
}
2001-08-29 09:47:32 +00:00
if ( FLY_AS_CHAR == rFmt.GetAnchor().GetAnchorId() )
{
2001-08-29 09:47:32 +00:00
nMinWidth = Max( nMinWidth,
bFly ? rFmt.GetFrmSize().GetWidth()
: pObj->GetObjRect().Width() );
}
2001-08-29 09:47:32 +00:00
}
const Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() );
long nWidth = nWidthArea - 2 * ( IsVertical() ? aBorder.Height() : aBorder.Width() );
nWidth -= (Prt().*fnRect->fnGetLeft)();
2001-08-29 09:47:32 +00:00
nWidth -= rAttrs.CalcRightLine();
nWidth = Max( nMinWidth, nWidth );
(Prt().*fnRect->fnSetWidth)( Min( nWidth,
(Prt().*fnRect->fnGetWidth)() ) );
2001-08-29 09:47:32 +00:00
}
if ( (Prt().*fnRect->fnGetWidth)() <= MINLAY )
2001-08-29 09:47:32 +00:00
{
// The PrtArea should already be at least MINLAY wide, matching the
// minimal values of the UI
(Prt().*fnRect->fnSetWidth)( Min( long(MINLAY),
(Frm().*fnRect->fnGetWidth)() ) );
SwTwips nTmp = (Frm().*fnRect->fnGetWidth)() -
(Prt().*fnRect->fnGetWidth)();
if( (Prt().*fnRect->fnGetLeft)() > nTmp )
(Prt().*fnRect->fnSetLeft)( nTmp );
2001-08-29 09:47:32 +00:00
}
// The following rules apply for VarSize:
// 1. The first entry of a chain has no top border
// 2. There is never a bottom border
// 3. The top border is the maximum of the distance
// of Prev downwards and our own distance upwards
// Those three rules apply when calculating spacings
// that are given by UL- and LRSpace. There might be a spacing
// in all directions however; this may be caused by borders
// and / or shadows.
// 4. The spacing for TextFrms corresponds to the interline lead,
// at a minimum.
2001-08-29 09:47:32 +00:00
nUpper = CalcUpperSpace( &rAttrs, NULL );
SwTwips nLower = CalcLowerSpace( &rAttrs );
2010-10-04 16:56:11 +01:00
if (IsCollapse()) {
nUpper=0;
nLower=0;
}
(Prt().*fnRect->fnSetPosY)( (!bVert || mbReverse) ? nUpper : nLower);
nUpper += nLower;
nUpper -= (Frm().*fnRect->fnGetHeight)() -
(Prt().*fnRect->fnGetHeight)();
2001-08-29 09:47:32 +00:00
}
// If there's a difference between old and new size, call Grow() or
// Shrink() respectively.
2001-08-29 09:47:32 +00:00
if ( nUpper )
{
if ( nUpper > 0 )
2001-10-19 09:25:19 +00:00
GrowFrm( nUpper );
2001-08-29 09:47:32 +00:00
else
2001-10-19 09:25:19 +00:00
ShrinkFrm( -nUpper );
bSizeChgd = sal_True;
2001-08-29 09:47:32 +00:00
}
2000-09-18 23:08:29 +00:00
}
return bSizeChgd;
}
/*************************************************************************
|*
|* SwCntntFrm::MakeAll()
|*
|*************************************************************************/
#define STOP_FLY_FORMAT 10
// - loop prevention
const int cnStopFormat = 15;
2000-09-18 23:08:29 +00:00
inline void ValidateSz( SwFrm *pFrm )
{
if ( pFrm )
{
pFrm->mbValidSize = sal_True;
pFrm->mbValidPrtArea = sal_True;
2000-09-18 23:08:29 +00:00
}
}
void SwCntntFrm::MakeAll()
{
OSL_ENSURE( GetUpper(), "no Upper?" );
OSL_ENSURE( IsTxtFrm(), "MakeAll(), NoTxt" );
2000-09-18 23:08:29 +00:00
if ( !IsFollow() && StackHack::IsLocked() )
return;
if ( IsJoinLocked() )
return;
OSL_ENSURE( !((SwTxtFrm*)this)->IsSwapped(), "Calculation of a swapped frame" );
2001-08-29 09:47:32 +00:00
2000-09-18 23:08:29 +00:00
StackHack aHack;
if ( ((SwTxtFrm*)this)->IsLocked() )
{
OSL_FAIL( "Format for locked TxtFrm." );
2000-09-18 23:08:29 +00:00
return;
}
LockJoin();
long nFormatCount = 0;
// - loop prevention
int nConsequetiveFormatsWithoutChange = 0;
2000-09-18 23:08:29 +00:00
PROTOCOL_ENTER( this, PROT_MAKEALL, 0, 0 )
#ifdef DBG_UTIL
const SwDoc *pDoc = GetAttrSet()->GetDoc();
if( pDoc )
{
static bool bWarned = false;
if( pDoc->InXMLExport() )
{
2012-04-24 11:05:51 +02:00
SAL_WARN_IF( !bWarned, "sw", "Formatting during XML-export!" );
bWarned = true;
}
else
bWarned = false;
}
#endif
// takes care of the notification in the dtor
2000-09-18 23:08:29 +00:00
SwCntntNotify *pNotify = new SwCntntNotify( this );
// as long as bMakePage is true, a new page can be created (exactly once)
bool bMakePage = true;
// bMovedBwd gets set to true when the frame flows backwards
bool bMovedBwd = false;
// as long as bMovedFwd is false, the Frm may flow backwards (until
// it has been moved forward once)
bool bMovedFwd = false;
sal_Bool bFormatted = sal_False; // For the widow/orphan rules, we encourage the
// last CntntFrm of a chain to format. This only
// needs to happen once. Every time the Frm is
// moved, the flag will have to be reset.
bool bMustFit = false; // Once the emergency brake is pulled,
// no other prepares will be triggered
bool bFitPromise = false; // If a paragraph didn't fit, but promises
// with WouldFit that it would adjust accordingly,
// this flag is set. If it turns out that it
// didn't keep it's promise, we can act in a
// controlled fashion.
bool bMoveable;
const sal_Bool bFly = IsInFly();
const sal_Bool bTab = IsInTab();
const sal_Bool bFtn = IsInFtn();
const sal_Bool bSct = IsInSct();
Point aOldFrmPos; // This is so we can compare with the last pos
Point aOldPrtPos; // and determine whether it makes sense to Prepare
2000-09-18 23:08:29 +00:00
SwBorderAttrAccess aAccess( SwFrm::GetCache(), this );
const SwBorderAttrs &rAttrs = *aAccess.Get();
// OD 2004-02-26 #i25029#
if ( !IsFollow() && rAttrs.JoinedWithPrev( *(this) ) )
{
pNotify->SetBordersJoinedWithPrev();
}
const sal_Bool bKeep = IsKeep( rAttrs.GetAttrSet() );
2000-09-18 23:08:29 +00:00
SwSaveFtnHeight *pSaveFtn = 0;
if ( bFtn )
{
SwFtnFrm *pFtn = FindFtnFrm();
SwSectionFrm* pSct = pFtn->FindSctFrm();
if ( !((SwTxtFrm*)pFtn->GetRef())->IsLocked() )
{
SwFtnBossFrm* pBoss = pFtn->GetRef()->FindFtnBossFrm(
pFtn->GetAttr()->GetFtn().IsEndNote() );
if( !pSct || pSct->IsColLocked() || !pSct->Growable() )
pSaveFtn = new SwSaveFtnHeight( pBoss,
((SwTxtFrm*)pFtn->GetRef())->GetFtnLine( pFtn->GetAttr() ) );
2000-09-18 23:08:29 +00:00
}
}
//
if ( GetUpper()->IsSctFrm() &&
HasFollow() &&
GetFollow()->GetFrm() == GetNext() )
{
dynamic_cast<SwTxtFrm*>(this)->JoinFrm();
}
// #i28701# - move master forward, if it has to move,
// because of its object positioning.
if ( !static_cast<SwTxtFrm*>(this)->IsFollow() )
{
sal_uInt32 nToPageNum = 0L;
const bool bMoveFwdByObjPos = SwLayouter::FrmMovedFwdByObjPos(
*(GetAttrSet()->GetDoc()),
*(static_cast<SwTxtFrm*>(this)),
nToPageNum );
// #i58182#
// Also move a paragraph forward, which is the first one inside a table cell.
if ( bMoveFwdByObjPos &&
FindPageFrm()->GetPhyPageNum() < nToPageNum &&
( lcl_Prev( this ) ||
GetUpper()->IsCellFrm() ||
( GetUpper()->IsSctFrm() &&
GetUpper()->GetUpper()->IsCellFrm() ) ) &&
IsMoveable() )
{
bMovedFwd = true;
MoveFwd( bMakePage, sal_False );
}
}
// If a Follow sits next to it's Master and doesn't fit, we know it can
// be moved right now.
if ( lcl_Prev( this ) && ((SwTxtFrm*)this)->IsFollow() && IsMoveable() )
2000-09-18 23:08:29 +00:00
{
bMovedFwd = true;
// OD 2004-03-02 #106629# - If follow frame is in table, it's master
// will be the last in the current table cell. Thus, invalidate the
// printing area of the master,
if ( IsInTab() )
{
lcl_Prev( this )->InvalidatePrt();
}
MoveFwd( bMakePage, sal_False );
2000-09-18 23:08:29 +00:00
}
// OD 08.11.2002 #104840# - check footnote content for forward move.
// If a content of a footnote is on a prior page/column as its invalid
// reference, it can be moved forward.
if ( bFtn && !mbValidPos )
{
SwFtnFrm* pFtn = FindFtnFrm();
SwCntntFrm* pRefCnt = pFtn ? pFtn->GetRef() : 0;
if ( pRefCnt && !pRefCnt->IsValid() )
{
SwFtnBossFrm* pFtnBossOfFtn = pFtn->FindFtnBossFrm();
SwFtnBossFrm* pFtnBossOfRef = pRefCnt->FindFtnBossFrm();
//<loop of movefwd until condition held or no move>
if ( pFtnBossOfFtn && pFtnBossOfRef &&
pFtnBossOfFtn != pFtnBossOfRef &&
pFtnBossOfFtn->IsBefore( pFtnBossOfRef ) )
{
bMovedFwd = true;
MoveFwd( bMakePage, sal_False );
}
}
}
2001-11-14 13:40:22 +00:00
SWRECTFN( this )
while ( !mbValidPos || !mbValidSize || !mbValidPrtArea )
2000-09-18 23:08:29 +00:00
{
// - loop prevention
SwRect aOldFrm_StopFormat( Frm() );
SwRect aOldPrt_StopFormat( Prt() );
if ( (bMoveable = IsMoveable()) )
2000-09-18 23:08:29 +00:00
{
SwFrm *pPre = GetIndPrev();
if ( CheckMoveFwd( bMakePage, bKeep, bMovedBwd ) )
{
2001-11-14 13:40:22 +00:00
SWREFRESHFN( this )
bMovedFwd = true;
2000-09-18 23:08:29 +00:00
if ( bMovedBwd )
{
// While flowing back, the Upper was encouraged to
// completely re-paint itself. We can skip this now after
// flowing back and forth.
2000-09-18 23:08:29 +00:00
GetUpper()->ResetCompletePaint();
// The predecessor was invalidated, so this is obsolete as well now.
OSL_ENSURE( pPre, "missing old Prev" );
2000-09-18 23:08:29 +00:00
if( !pPre->IsSctFrm() )
::ValidateSz( pPre );
}
bMoveable = IsMoveable();
}
}
aOldFrmPos = (Frm().*fnRect->fnGetPos)();
aOldPrtPos = (Prt().*fnRect->fnGetPos)();
2001-09-14 09:59:33 +00:00
if ( !mbValidPos )
2001-09-14 09:59:33 +00:00
MakePos();
//Set FixSize. VarSize is being adjusted by Format().
if ( !mbValidSize )
{
2011-04-18 12:37:38 -03:00
// #125452#
// invalidate printing area flag, if the following conditions are hold:
// - current frame width is 0.
// - current printing area width is 0.
// - frame width is adjusted to a value greater than 0.
// - printing area flag is sal_True.
// Thus, it's assured that the printing area is adjusted, if the
// frame area width changes its width from 0 to something greater
// than 0.
// Note: A text frame can be in such a situation, if the format is
// triggered by method call <SwCrsrShell::SetCrsr()> after
// loading the document.
const SwTwips nNewFrmWidth = (GetUpper()->Prt().*fnRect->fnGetWidth)();
if ( mbValidPrtArea && nNewFrmWidth > 0 &&
(Frm().*fnRect->fnGetWidth)() == 0 &&
(Prt().*fnRect->fnGetWidth)() == 0 )
{
mbValidPrtArea = sal_False;
}
(Frm().*fnRect->fnSetWidth)( nNewFrmWidth );
}
if ( !mbValidPrtArea )
2001-09-14 09:59:33 +00:00
{
const long nOldW = (Prt().*fnRect->fnGetWidth)();
// #i34730# - keep current frame height
const SwTwips nOldH = (Frm().*fnRect->fnGetHeight)();
2001-09-14 09:59:33 +00:00
MakePrtArea( rAttrs );
2001-11-20 14:01:33 +00:00
if ( nOldW != (Prt().*fnRect->fnGetWidth)() )
2001-09-14 09:59:33 +00:00
Prepare( PREP_FIXSIZE_CHG );
// #i34730# - check, if frame height has changed.
// If yes, send a PREP_ADJUST_FRM and invalidate the size flag to
// force a format. The format will check in its method
// <SwTxtFrm::CalcPreps()>, if the already formatted lines still
// fit and if not, performs necessary actions.
// #i40150# - no check, if frame is undersized.
if ( mbValidSize && !IsUndersized() &&
nOldH != (Frm().*fnRect->fnGetHeight)() )
{
2011-04-18 12:37:38 -03:00
// #115759# - no PREP_ADJUST_FRM and size
// invalidation, if height decreases only by the additional
// lower space as last content of a table cell and an existing
// follow containing one line exists.
const SwTwips nHDiff = nOldH - (Frm().*fnRect->fnGetHeight)();
const bool bNoPrepAdjustFrm =
nHDiff > 0 && IsInTab() && GetFollow() &&
( 1 == static_cast<SwTxtFrm*>(GetFollow())->GetLineCount( STRING_LEN ) || (static_cast<SwTxtFrm*>(GetFollow())->Frm().*fnRect->fnGetWidth)() < 0 ) &&
GetFollow()->CalcAddLowerSpaceAsLastInTableCell() == nHDiff;
if ( !bNoPrepAdjustFrm )
{
Prepare( PREP_ADJUST_FRM );
mbValidSize = sal_False;
}
}
2001-09-14 09:59:33 +00:00
}
2000-09-18 23:08:29 +00:00
// To make the widow and orphan rules work, we need to notify the CntntFrm.
// Criteria:
// - It needs to be movable (otherwise, splitting doesn't make sense)
// - It needs to overlap with the lower edge of the PrtArea of the Upper
2000-09-18 23:08:29 +00:00
if ( !bMustFit )
{
sal_Bool bWidow = sal_True;
2001-12-12 13:44:09 +00:00
const SwTwips nDeadLine = (GetUpper()->*fnRect->fnGetPrtBottom)();
2001-09-14 09:59:33 +00:00
if ( bMoveable && !bFormatted && ( GetFollow() ||
( (Frm().*fnRect->fnOverStep)( nDeadLine ) ) ) )
2001-09-14 09:59:33 +00:00
{
Prepare( PREP_WIDOWS_ORPHANS, 0, sal_False );
mbValidSize = bWidow = sal_False;
2001-09-14 09:59:33 +00:00
}
if( (Frm().*fnRect->fnGetPos)() != aOldFrmPos ||
(Prt().*fnRect->fnGetPos)() != aOldPrtPos )
2000-09-18 23:08:29 +00:00
{
// In this Prepare, an _InvalidateSize() might happen.
// mbValidSize becomes sal_False and Format() gets called.
Prepare( PREP_POS_CHGD, (const void*)&bFormatted, sal_False );
2000-09-18 23:08:29 +00:00
if ( bWidow && GetFollow() )
{ Prepare( PREP_WIDOWS_ORPHANS, 0, sal_False );
mbValidSize = sal_False;
2000-09-18 23:08:29 +00:00
}
}
}
if ( !mbValidSize )
{
mbValidSize = bFormatted = sal_True;
++nFormatCount;
if( nFormatCount > STOP_FLY_FORMAT )
SetFlyLock( sal_True );
// - loop prevention
// No format any longer, if <cnStopFormat> consequetive formats
// without change occur.
if ( nConsequetiveFormatsWithoutChange <= cnStopFormat )
{
Format();
}
#if OSL_DEBUG_LEVEL > 0
else
{
OSL_FAIL( "debug assertion: <SwCntntFrm::MakeAll()> - format of text frame suppressed by fix b6448963" );
}
#endif
2000-09-18 23:08:29 +00:00
}
// If this is the first one in a chain, check if this can flow
// backwards (if this is movable at all).
// To prevent oscillations/loops, check that this has not just
// flowed forwards.
sal_Bool bDummy;
if ( !lcl_Prev( this ) &&
!bMovedFwd &&
( bMoveable || ( bFly && !bTab ) ) &&
( !bFtn || !GetUpper()->FindFtnFrm()->GetPrev() )
&& MoveBwd( bDummy ) )
2000-09-18 23:08:29 +00:00
{
2001-11-14 13:40:22 +00:00
SWREFRESHFN( this )
bMovedBwd = true;
bFormatted = sal_False;
2002-08-19 08:57:30 +00:00
if ( bKeep && bMoveable )
2000-09-18 23:08:29 +00:00
{
if( CheckMoveFwd( bMakePage, sal_False, bMovedBwd ) )
2000-09-18 23:08:29 +00:00
{
bMovedFwd = true;
2000-09-18 23:08:29 +00:00
bMoveable = IsMoveable();
2001-11-14 13:40:22 +00:00
SWREFRESHFN( this )
2000-09-18 23:08:29 +00:00
}
Point aOldPos = (Frm().*fnRect->fnGetPos)();
2001-09-14 09:59:33 +00:00
MakePos();
if( aOldPos != (Frm().*fnRect->fnGetPos)() )
2001-09-14 09:59:33 +00:00
{
Prepare( PREP_POS_CHGD, (const void*)&bFormatted, sal_False );
if ( !mbValidSize )
2001-09-14 09:59:33 +00:00
{
(Frm().*fnRect->fnSetWidth)( (GetUpper()->
Prt().*fnRect->fnGetWidth)() );
if ( !mbValidPrtArea )
2001-09-14 09:59:33 +00:00
{
const long nOldW = (Prt().*fnRect->fnGetWidth)();
MakePrtArea( rAttrs );
if( nOldW != (Prt().*fnRect->fnGetWidth)() )
Prepare( PREP_FIXSIZE_CHG, 0, sal_False );
2001-09-14 09:59:33 +00:00
}
if( GetFollow() )
Prepare( PREP_WIDOWS_ORPHANS, 0, sal_False );
mbValidSize = bFormatted = sal_True;
2001-09-14 09:59:33 +00:00
Format();
}
}
2001-11-22 16:51:47 +00:00
SwFrm *pNxt = HasFollow() ? NULL : FindNext();
2000-09-18 23:08:29 +00:00
while( pNxt && pNxt->IsSctFrm() )
{ // Leave empty sections out, go into the other ones.
2000-09-18 23:08:29 +00:00
if( ((SwSectionFrm*)pNxt)->GetSection() )
{
SwFrm* pTmp = ((SwSectionFrm*)pNxt)->ContainsAny();
if( pTmp )
{
pNxt = pTmp;
break;
}
}
pNxt = pNxt->FindNext();
}
if ( pNxt )
{
pNxt->Calc();
if( mbValidPos && !GetIndNext() )
2000-09-18 23:08:29 +00:00
{
SwSectionFrm *pSct = FindSctFrm();
if( pSct && !pSct->GetValidSizeFlag() )
{
SwSectionFrm* pNxtSct = pNxt->FindSctFrm();
if( pNxtSct && pSct->IsAnFollow( pNxtSct ) )
mbValidPos = sal_False;
2000-09-18 23:08:29 +00:00
}
else
mbValidPos = sal_False;
2000-09-18 23:08:29 +00:00
}
}
}
}
// In footnotes, the TxtFrm may validate itself, which can lead to the
// situation that it's position is wrong despite being "valid".
if ( mbValidPos )
2000-09-18 23:08:29 +00:00
{
// #i59341#
// Workaround for inadequate layout algorithm:
// suppress invalidation and calculation of position, if paragraph
// has formatted itself at least STOP_FLY_FORMAT times and
// has anchored objects.
// Thus, the anchored objects get the possibility to format itself
// and this probably solve the layout loop.
if ( bFtn &&
nFormatCount <= STOP_FLY_FORMAT &&
!GetDrawObjs() )
{
mbValidPos = sal_False;
2000-09-18 23:08:29 +00:00
MakePos();
aOldFrmPos = (Frm().*fnRect->fnGetPos)();
aOldPrtPos = (Prt().*fnRect->fnGetPos)();
2000-09-18 23:08:29 +00:00
}
}
// - loop prevention
{
if ( aOldFrm_StopFormat == Frm() &&
aOldPrt_StopFormat == Prt() )
{
++nConsequetiveFormatsWithoutChange;
}
else
{
nConsequetiveFormatsWithoutChange = 0;
}
}
// Yet again an invalid value? Repeat from the start...
if ( !mbValidPos || !mbValidSize || !mbValidPrtArea )
2000-09-18 23:08:29 +00:00
continue;
// Done?
// Attention: because height == 0, it's better to use Top()+Height() instead of
// Bottom(). This might happen with undersized TextFrms on the lower edge of a
// multi-column section
const long nPrtBottom = (GetUpper()->*fnRect->fnGetPrtBottom)();
const long nBottomDist = (Frm().*fnRect->fnBottomDist)( nPrtBottom );
if( nBottomDist >= 0 )
2000-09-18 23:08:29 +00:00
{
2002-08-19 08:57:30 +00:00
if ( bKeep && bMoveable )
2000-09-18 23:08:29 +00:00
{
// We make sure the successor will be formatted the same.
// This way, we keep control until (almost) everything is stable,
// allowing us to avoid endless loops caused by ever repeating
// retries.
//
// bMoveFwdInvalid is required for #38407#. This was originally solved
// in flowfrm.cxx rev 1.38, but broke the above schema and
// preferred to play towers of hanoi (#43669#).
2001-11-22 16:51:47 +00:00
SwFrm *pNxt = HasFollow() ? NULL : FindNext();
// For sections we prefer the content, because it can change
// the page if required.
2000-09-18 23:08:29 +00:00
while( pNxt && pNxt->IsSctFrm() )
{
if( ((SwSectionFrm*)pNxt)->GetSection() )
{
pNxt = ((SwSectionFrm*)pNxt)->ContainsAny();
break;
}
pNxt = pNxt->FindNext();
}
if ( pNxt )
{
const bool bMoveFwdInvalid = 0 != GetIndNext();
const bool bNxtNew =
2001-09-14 09:59:33 +00:00
( 0 == (pNxt->Prt().*fnRect->fnGetHeight)() ) &&
(!pNxt->IsTxtFrm() ||!((SwTxtFrm*)pNxt)->IsHiddenNow());
2000-09-18 23:08:29 +00:00
pNxt->Calc();
2000-09-18 23:08:29 +00:00
if ( !bMovedBwd &&
((bMoveFwdInvalid && !GetIndNext()) ||
bNxtNew) )
{
if( bMovedFwd )
pNotify->SetInvaKeep();
bMovedFwd = false;
}
2000-09-18 23:08:29 +00:00
}
}
continue;
}
// I don't fit into my parents, so it's time to make changes
// as constructively as possible.
2000-09-18 23:08:29 +00:00
//If I'm NOT allowed to leave the parent Frm, I've got a problem.
// Following Arthur Dent, we do the only thing that you can do with
// an unsolvable problem: We ignore it with all our power.
2000-09-18 23:08:29 +00:00
if ( !bMoveable || IsUndersized() )
{
if( !bMoveable && IsInTab() )
{
2001-12-12 13:44:09 +00:00
long nDiff = -(Frm().*fnRect->fnBottomDist)(
(GetUpper()->*fnRect->fnGetPrtBottom)() );
long nReal = GetUpper()->Grow( nDiff );
2000-09-18 23:08:29 +00:00
if( nReal )
continue;
}
break;
}
// If there's no way I can make myself fit into my Upper, the situation
// could still probably be mitigated by splitting up.
// This situation arises with freshly created Follows that had been moved
// to the next page but is still too big for it - ie. needs to be split
// as well.
//
// If I'm unable to split (WouldFit()) and can't be fitted, I'm going
// to tell my TxtFrm part that, if possible, we still need to split despite
// the "don't split" attribute.
bool bMoveOrFit = false;
bool bDontMoveMe = !GetIndPrev();
2000-09-18 23:08:29 +00:00
if( bDontMoveMe && IsInSct() )
{
SwFtnBossFrm* pBoss = FindFtnBossFrm();
bDontMoveMe = !pBoss->IsInSct() ||
( !pBoss->Lower()->GetNext() && !pBoss->GetPrev() );
}
// Finally, we are able to split table rows. Therefore, bDontMoveMe
// can be set to false:
if( bDontMoveMe && IsInTab() &&
0 != const_cast<SwCntntFrm*>(this)->GetNextCellLeaf( MAKEPAGE_NONE ) )
bDontMoveMe = false;
2001-09-14 09:59:33 +00:00
if ( bDontMoveMe && (Frm().*fnRect->fnGetHeight)() >
(GetUpper()->Prt().*fnRect->fnGetHeight)() )
{
if ( !bFitPromise )
{
SwTwips nTmp = (GetUpper()->Prt().*fnRect->fnGetHeight)() -
(Prt().*fnRect->fnGetTop)();
sal_Bool bSplit = !IsFwdMoveAllowed();
if ( nTmp > 0 && WouldFit( nTmp, bSplit, sal_False ) )
2000-09-18 23:08:29 +00:00
{
Prepare( PREP_WIDOWS_ORPHANS, 0, sal_False );
mbValidSize = sal_False;
bFitPromise = true;
2000-09-18 23:08:29 +00:00
continue;
}
2011-03-14 21:17:00 +01:00
/* --------------------------------------------------
* In earlier days, we never tried to fit TextFrms in
* frames and sections using bMoveOrFit by ignoring
* its attributes (Widows, Keep).
* This should have been done at least for column frames;
* as it must be tried anyway with linked frames and sections.
* Exception: If we sit in FormatWidthCols, we must not ignore
* the attributes.
2000-09-18 23:08:29 +00:00
* --------------------------------------------------*/
else if ( !bFtn && bMoveable &&
( !bFly || !FindFlyFrm()->IsColLocked() ) &&
( !bSct || !FindSctFrm()->IsColLocked() ) )
bMoveOrFit = true;
2000-09-18 23:08:29 +00:00
}
#if OSL_DEBUG_LEVEL > 0
2000-09-18 23:08:29 +00:00
else
{
OSL_FAIL( "+TxtFrm didn't respect WouldFit promise." );
2000-09-18 23:08:29 +00:00
}
#endif
}
// Let's see if I can find some space somewhere...
// footnotes in the neighbourhood are moved into _MoveFtnCntFwd
2000-09-18 23:08:29 +00:00
SwFrm *pPre = GetIndPrev();
SwFrm *pOldUp = GetUpper();
/* MA 13. Oct. 98: What is this supposed to be!?
* AMA 14. Dec 98: If a column section can't find any space for its first ContentFrm, it should be
* moved not only to the next column, but probably even to the next page, creating
* a section-follow there.
2000-09-18 23:08:29 +00:00
*/
if( IsInSct() && bMovedFwd && bMakePage && pOldUp->IsColBodyFrm() &&
pOldUp->GetUpper()->GetUpper()->IsSctFrm() &&
( pPre || pOldUp->GetUpper()->GetPrev() ) &&
((SwSectionFrm*)pOldUp->GetUpper()->GetUpper())->MoveAllowed(this) )
{
bMovedFwd = false;
}
2000-09-18 23:08:29 +00:00
const sal_Bool bCheckForGrownBody = pOldUp->IsBodyFrm();
const long nOldBodyHeight = (pOldUp->Frm().*fnRect->fnGetHeight)();
if ( !bMovedFwd && !MoveFwd( bMakePage, sal_False ) )
bMakePage = false;
2001-11-14 13:40:22 +00:00
SWREFRESHFN( this )
// If MoveFwd moves the paragraph to the next page, a following
// paragraph, which contains footnotes can can cause the old upper
2011-12-01 23:41:42 +02:00
// frame to grow. In this case we explicitly allow a new check
// for MoveBwd. Robust: We also check the bMovedBwd flag again.
// If pOldUp was a footnote frame, it has been deleted inside MoveFwd.
// Therefore we only check for growing body frames.
if ( bCheckForGrownBody && ! bMovedBwd && pOldUp != GetUpper() &&
(pOldUp->Frm().*fnRect->fnGetHeight)() > nOldBodyHeight )
{
bMovedFwd = false;
}
else
{
bMovedFwd = true;
}
bFormatted = sal_False;
2000-09-18 23:08:29 +00:00
if ( bMoveOrFit && GetUpper() == pOldUp )
{
// FME 2007-08-30 #i81146# new loop control
if ( nConsequetiveFormatsWithoutChange <= cnStopFormat )
{
Prepare( PREP_MUST_FIT, 0, sal_False );
mbValidSize = sal_False;
bMustFit = true;
continue;
}
#if OSL_DEBUG_LEVEL > 0
OSL_FAIL( "LoopControl in SwCntntFrm::MakeAll" );
#endif
2000-09-18 23:08:29 +00:00
}
if ( bMovedBwd && GetUpper() )
{ // Retire invalidations that have become useless.
2000-09-18 23:08:29 +00:00
GetUpper()->ResetCompletePaint();
if( pPre && !pPre->IsSctFrm() )
::ValidateSz( pPre );
}
} //while ( !mbValidPos || !mbValidSize || !mbValidPrtArea )
2000-09-18 23:08:29 +00:00
// NEW: Looping Louie (Light). Should not be applied in balanced sections.
// Should only be applied if there is no better solution!
LOOPING_LOUIE_LIGHT( bMovedFwd && bMovedBwd && !IsInBalancedSection() &&
(
2011-04-18 12:37:38 -03:00
// #118572#
( bFtn && !FindFtnFrm()->GetRef()->IsInSct() ) ||
// #i33887#
( IsInSct() && bKeep )
// ... add your conditions here ...
),
static_cast<SwTxtFrm&>(*this) );
2011-11-17 22:13:42 +04:00
delete pSaveFtn;
2000-09-18 23:08:29 +00:00
UnlockJoin();
if ( bMovedFwd || bMovedBwd )
pNotify->SetInvaKeep();
// OD 2004-02-26 #i25029#
if ( bMovedFwd )
{
pNotify->SetInvalidatePrevPrtArea();
}
2000-09-18 23:08:29 +00:00
delete pNotify;
SetFlyLock( sal_False );
2000-09-18 23:08:29 +00:00
}
/*************************************************************************
|*
|* SwCntntFrm::_WouldFit()
|*
|*************************************************************************/
void MakeNxt( SwFrm *pFrm, SwFrm *pNxt )
{
// fix(25455): Validate, otherwise this leads to a recursion.
// The first try, cancelling with pFrm = 0 if !Valid, leads to a problem, as
// the Keep may not be considered properly anymore (27417).
const sal_Bool bOldPos = pFrm->GetValidPosFlag();
const sal_Bool bOldSz = pFrm->GetValidSizeFlag();
const sal_Bool bOldPrt = pFrm->GetValidPrtAreaFlag();
pFrm->mbValidPos = pFrm->mbValidPrtArea = pFrm->mbValidSize = sal_True;
2000-09-18 23:08:29 +00:00
// fix(29272): Don't call MakeAll - there, pFrm might be invalidated again, and
// we recursively end up in here again.
2000-09-18 23:08:29 +00:00
if ( pNxt->IsCntntFrm() )
{
SwCntntNotify aNotify( (SwCntntFrm*)pNxt );
SwBorderAttrAccess aAccess( SwFrm::GetCache(), pNxt );
const SwBorderAttrs &rAttrs = *aAccess.Get();
if ( !pNxt->GetValidSizeFlag() )
2001-09-14 09:59:33 +00:00
{
if( pNxt->IsVertical() )
pNxt->Frm().Height( pNxt->GetUpper()->Prt().Height() );
else
2002-10-17 13:10:00 +00:00
pNxt->Frm().Width( pNxt->GetUpper()->Prt().Width() );
2001-09-14 09:59:33 +00:00
}
2000-09-18 23:08:29 +00:00
((SwCntntFrm*)pNxt)->MakePrtArea( rAttrs );
pNxt->Format( &rAttrs );
}
else
{
SwLayNotify aNotify( (SwLayoutFrm*)pNxt );
SwBorderAttrAccess aAccess( SwFrm::GetCache(), pNxt );
const SwBorderAttrs &rAttrs = *aAccess.Get();
if ( !pNxt->GetValidSizeFlag() )
2001-09-14 09:59:33 +00:00
{
if( pNxt->IsVertical() )
pNxt->Frm().Height( pNxt->GetUpper()->Prt().Height() );
else
2002-10-17 13:10:00 +00:00
pNxt->Frm().Width( pNxt->GetUpper()->Prt().Width() );
2001-09-14 09:59:33 +00:00
}
2000-09-18 23:08:29 +00:00
pNxt->Format( &rAttrs );
}
pFrm->mbValidPos = bOldPos;
pFrm->mbValidSize = bOldSz;
pFrm->mbValidPrtArea = bOldPrt;
2000-09-18 23:08:29 +00:00
}
// This routine checks whether there are no other FtnBosses
// between the pFrm's FtnBoss and the pNxt's FtnBoss.
2000-09-18 23:08:29 +00:00
static bool lcl_IsNextFtnBoss( const SwFrm *pFrm, const SwFrm* pNxt )
2000-09-18 23:08:29 +00:00
{
OSL_ENSURE( pFrm && pNxt, "lcl_IsNextFtnBoss: No Frames?" );
2000-09-18 23:08:29 +00:00
pFrm = pFrm->FindFtnBossFrm();
pNxt = pNxt->FindFtnBossFrm();
// If pFrm is a last column, we use the page instead.
2000-09-18 23:08:29 +00:00
while( pFrm && pFrm->IsColumnFrm() && !pFrm->GetNext() )
pFrm = pFrm->GetUpper()->FindFtnBossFrm();
// If pNxt is a first column, we use the page instead.
2000-09-18 23:08:29 +00:00
while( pNxt && pNxt->IsColumnFrm() && !pNxt->GetPrev() )
pNxt = pNxt->GetUpper()->FindFtnBossFrm();
// So.. now pFrm and pNxt are either two adjacent pages or columns.
2000-09-18 23:08:29 +00:00
return ( pFrm && pNxt && pFrm->GetNext() == pNxt );
}
//
sal_Bool SwCntntFrm::_WouldFit( SwTwips nSpace,
SwLayoutFrm *pNewUpper,
sal_Bool bTstMove,
const bool bObjsInNewUpper )
2000-09-18 23:08:29 +00:00
{
// To have the footnote select it's place carefully, it needs
// to be moved in any case if there is at least one page/column
// between the footnote and the new Upper.
2000-09-18 23:08:29 +00:00
SwFtnFrm* pFtnFrm = 0;
if ( IsInFtn() )
{
if( !lcl_IsNextFtnBoss( pNewUpper, this ) )
return sal_True;
2000-09-18 23:08:29 +00:00
pFtnFrm = FindFtnFrm();
}
sal_Bool bRet;
sal_Bool bSplit = !pNewUpper->Lower();
2000-09-18 23:08:29 +00:00
SwCntntFrm *pFrm = this;
const SwFrm *pTmpPrev = pNewUpper->Lower();
if( pTmpPrev && pTmpPrev->IsFtnFrm() )
pTmpPrev = ((SwFtnFrm*)pTmpPrev)->Lower();
while ( pTmpPrev && pTmpPrev->GetNext() )
pTmpPrev = pTmpPrev->GetNext();
2000-09-18 23:08:29 +00:00
do
{
// #i46181#
SwTwips nSecondCheck = 0;
SwTwips nOldSpace = nSpace;
sal_Bool bOldSplit = bSplit;
2000-09-18 23:08:29 +00:00
if ( bTstMove || IsInFly() || ( IsInSct() &&
( pFrm->GetUpper()->IsColBodyFrm() || ( pFtnFrm &&
pFtnFrm->GetUpper()->GetUpper()->IsColumnFrm() ) ) ) )
{
// This is going to get a bit insidious now. If you're faint of heart,
// you'd better look away here. If a Fly contains columns, then the Cntnts
// are movable, except ones in the last column (see SwFrm::IsMoveable()).
// Of course they're allowed to float back. WouldFit() only returns a usable
// value if the Frm is movable. To fool WouldFit() into believing there's
// a movable Frm, I'm just going to hang it somewhere else for the time.
// The same procedure applies for column sections to make SwSectionFrm::Growable()
// return the proper value.
// Within footnotes, we may even need to put the SwFtnFrm somewhere else, if
// there's no SwFtnFrm there.
2000-09-18 23:08:29 +00:00
SwFrm* pTmpFrm = pFrm->IsInFtn() && !pNewUpper->FindFtnFrm() ?
(SwFrm*)pFrm->FindFtnFrm() : pFrm;
SwLayoutFrm *pUp = pTmpFrm->GetUpper();
SwFrm *pOldNext = pTmpFrm->GetNext();
pTmpFrm->Remove();
pTmpFrm->InsertBefore( pNewUpper, 0 );
if ( pFrm->IsTxtFrm() &&
( bTstMove ||
((SwTxtFrm*)pFrm)->HasFollow() ||
( !((SwTxtFrm*)pFrm)->HasPara() &&
!((SwTxtFrm*)pFrm)->IsEmpty()
)
)
)
2000-09-18 23:08:29 +00:00
{
bTstMove = sal_True;
bRet = ((SwTxtFrm*)pFrm)->TestFormat( pTmpPrev, nSpace, bSplit );
2000-09-18 23:08:29 +00:00
}
else
bRet = pFrm->WouldFit( nSpace, bSplit, sal_False );
2000-09-18 23:08:29 +00:00
pTmpFrm->Remove();
pTmpFrm->InsertBefore( pUp, pOldNext );
}
else
{
bRet = pFrm->WouldFit( nSpace, bSplit, sal_False );
nSecondCheck = !bSplit ? 1 : 0;
}
2000-09-18 23:08:29 +00:00
SwBorderAttrAccess aAccess( SwFrm::GetCache(), pFrm );
const SwBorderAttrs &rAttrs = *aAccess.Get();
// Sad but true: We need to consider the spacing in our calculation.
// This already happened in TestFormat.
2000-09-18 23:08:29 +00:00
if ( bRet && !bTstMove )
{
SwTwips nUpper;
if ( pTmpPrev )
2000-09-18 23:08:29 +00:00
{
nUpper = CalcUpperSpace( NULL, pTmpPrev );
// in balanced columned section frames we do not want the
// common border
sal_Bool bCommonBorder = sal_True;
if ( pFrm->IsInSct() && pFrm->GetUpper()->IsColBodyFrm() )
{
const SwSectionFrm* pSct = pFrm->FindSctFrm();
bCommonBorder = pSct->GetFmt()->GetBalancedColumns().GetValue();
}
// #i46181#
nSecondCheck = ( 1 == nSecondCheck &&
pFrm == this &&
IsTxtFrm() &&
bCommonBorder &&
!static_cast<const SwTxtFrm*>(this)->IsEmpty() ) ?
nUpper :
0;
nUpper += bCommonBorder ?
rAttrs.GetBottomLine( *(pFrm) ) :
rAttrs.CalcBottomLine();
2000-09-18 23:08:29 +00:00
}
else
2001-09-14 09:59:33 +00:00
{
// #i46181#
nSecondCheck = 0;
2001-09-14 09:59:33 +00:00
if( pFrm->IsVertical() )
nUpper = pFrm->Frm().Width() - pFrm->Prt().Width();
else
2002-10-17 13:10:00 +00:00
nUpper = pFrm->Frm().Height() - pFrm->Prt().Height();
2001-09-14 09:59:33 +00:00
}
2000-09-18 23:08:29 +00:00
nSpace -= nUpper;
2000-09-18 23:08:29 +00:00
if ( nSpace < 0 )
{
bRet = sal_False;
// #i46181#
if ( nSecondCheck > 0 )
{
// The following code is intended to solve a (rare) problem
// causing some frames not to move backward:
// SwTxtFrm::WouldFit() claims that the whole paragraph
// fits into the given space and subtracts the height of
// all lines from nSpace. nSpace - nUpper is not a valid
// indicator if the frame should be allowed to move backward.
// We do a second check with the original remaining space
// reduced by the required upper space:
nOldSpace -= nSecondCheck;
const bool bSecondRet = nOldSpace >= 0 && pFrm->WouldFit( nOldSpace, bOldSplit, sal_False );
if ( bSecondRet && bOldSplit && nOldSpace >= 0 )
{
bRet = sal_True;
bSplit = sal_True;
}
}
}
2000-09-18 23:08:29 +00:00
}
// OD 2004-03-01 #106629# - also consider lower spacing in table cells
if ( bRet && IsInTab() &&
pNewUpper->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::ADD_PARA_SPACING_TO_TABLE_CELLS) )
{
nSpace -= rAttrs.GetULSpace().GetLower();
if ( nSpace < 0 )
{
bRet = sal_False;
}
}
if ( bRet && !bSplit && pFrm->IsKeep( rAttrs.GetAttrSet() ) )
2000-09-18 23:08:29 +00:00
{
if( bTstMove )
{
2000-09-18 23:08:29 +00:00
while( pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->HasFollow() )
{
2000-09-18 23:08:29 +00:00
pFrm = ((SwTxtFrm*)pFrm)->GetFollow();
}
// OD 11.04.2003 #108824# - If last follow frame of <this> text
// frame isn't valid, a formatting of the next content frame
// doesn't makes sense. Thus, return sal_True.
if ( IsAnFollow( pFrm ) && !pFrm->IsValid() )
{
OSL_FAIL( "Only a warning for task 108824:/n<SwCntntFrm::_WouldFit(..) - follow not valid!" );
return sal_True;
}
}
2000-09-18 23:08:29 +00:00
SwFrm *pNxt;
if( 0 != (pNxt = pFrm->FindNext()) && pNxt->IsCntntFrm() &&
( !pFtnFrm || ( pNxt->IsInFtn() &&
pNxt->FindFtnFrm()->GetAttr() == pFtnFrm->GetAttr() ) ) )
{
// TestFormat(?) does not like paragraph- or character anchored objects.
//
// current solution for the test formatting doesn't work, if
// objects are present in the remaining area of the new upper
if ( bTstMove &&
( pNxt->GetDrawObjs() || bObjsInNewUpper ) )
{
return sal_True;
}
2000-09-18 23:08:29 +00:00
if ( !pNxt->IsValid() )
MakeNxt( pFrm, pNxt );
// Little trick: if the next has a predecessor, then the paragraph
// spacing has been calculated already, and we don't need to re-calculate
// it in an expensive way.
2000-09-18 23:08:29 +00:00
if( lcl_NotHiddenPrev( pNxt ) )
pTmpPrev = 0;
2000-09-18 23:08:29 +00:00
else
{
if( pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsHiddenNow() )
pTmpPrev = lcl_NotHiddenPrev( pFrm );
2000-09-18 23:08:29 +00:00
else
pTmpPrev = pFrm;
2000-09-18 23:08:29 +00:00
}
pFrm = (SwCntntFrm*)pNxt;
}
else
pFrm = 0;
}
else
pFrm = 0;
} while ( bRet && pFrm );
return bRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */