summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/access/accdoc.cxx8
-rw-r--r--sw/source/core/access/accfrmobj.cxx4
-rw-r--r--sw/source/core/crsr/callnk.cxx10
-rw-r--r--sw/source/core/crsr/callnk.hxx3
-rw-r--r--sw/source/core/crsr/crsrsh.cxx52
-rw-r--r--sw/source/core/crsr/crstrvl.cxx44
-rw-r--r--sw/source/core/crsr/crstrvl1.cxx2
-rw-r--r--sw/source/core/crsr/pam.cxx10
-rw-r--r--sw/source/core/crsr/swcrsr.cxx41
-rw-r--r--sw/source/core/crsr/trvlfnfl.cxx2
-rw-r--r--sw/source/core/crsr/trvltbl.cxx14
-rw-r--r--sw/source/core/crsr/unocrsr.cxx6
-rw-r--r--sw/source/core/crsr/viscrs.cxx16
-rwxr-xr-xsw/source/core/doc/doc.cxx115
-rw-r--r--sw/source/core/doc/docbm.cxx2
-rw-r--r--sw/source/core/doc/docchart.cxx6
-rw-r--r--sw/source/core/doc/doccorr.cxx6
-rw-r--r--sw/source/core/doc/docdesc.cxx93
-rw-r--r--sw/source/core/doc/docdraw.cxx33
-rw-r--r--sw/source/core/doc/docedt.cxx10
-rw-r--r--sw/source/core/doc/docfld.cxx8
-rw-r--r--sw/source/core/doc/docfly.cxx16
-rw-r--r--sw/source/core/doc/docfmt.cxx9
-rw-r--r--sw/source/core/doc/docftn.cxx35
-rw-r--r--sw/source/core/doc/doclay.cxx83
-rw-r--r--sw/source/core/doc/docnew.cxx20
-rw-r--r--sw/source/core/doc/docredln.cxx8
-rw-r--r--sw/source/core/doc/doctxm.cxx36
-rw-r--r--sw/source/core/doc/ftnidx.cxx8
-rw-r--r--sw/source/core/doc/htmltbl.cxx11
-rw-r--r--sw/source/core/doc/lineinfo.cxx23
-rw-r--r--sw/source/core/doc/notxtfrm.cxx16
-rw-r--r--sw/source/core/doc/poolfmt.cxx2
-rw-r--r--sw/source/core/doc/swserv.cxx2
-rw-r--r--sw/source/core/doc/visiturl.cxx2
-rw-r--r--sw/source/core/docnode/ndsect.cxx31
-rw-r--r--sw/source/core/docnode/ndtbl.cxx18
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx10
-rw-r--r--sw/source/core/docnode/node.cxx35
-rw-r--r--sw/source/core/docnode/node2lay.cxx8
-rw-r--r--sw/source/core/docnode/nodes.cxx4
-rw-r--r--sw/source/core/draw/dcontact.cxx21
-rw-r--r--sw/source/core/draw/dflyobj.cxx7
-rw-r--r--sw/source/core/draw/dpage.cxx2
-rw-r--r--sw/source/core/draw/dview.cxx22
-rw-r--r--sw/source/core/edit/autofmt.cxx2
-rw-r--r--sw/source/core/edit/edattr.cxx2
-rw-r--r--sw/source/core/edit/eddel.cxx2
-rw-r--r--sw/source/core/edit/editsh.cxx16
-rw-r--r--sw/source/core/edit/edlingu.cxx4
-rw-r--r--sw/source/core/edit/edsect.cxx2
-rw-r--r--sw/source/core/edit/edundo.cxx12
-rw-r--r--sw/source/core/fields/authfld.cxx4
-rw-r--r--sw/source/core/fields/cellfml.cxx2
-rw-r--r--sw/source/core/fields/ddefld.cxx2
-rw-r--r--sw/source/core/fields/ddetbl.cxx2
-rw-r--r--sw/source/core/fields/docufld.cxx12
-rw-r--r--sw/source/core/fields/reffld.cxx8
-rw-r--r--sw/source/core/frmedt/fecopy.cxx2
-rw-r--r--sw/source/core/frmedt/fedesc.cxx4
-rw-r--r--sw/source/core/frmedt/fefly1.cxx22
-rw-r--r--sw/source/core/frmedt/feflyole.cxx2
-rw-r--r--sw/source/core/frmedt/feshview.cxx14
-rw-r--r--sw/source/core/frmedt/fetab.cxx2
-rw-r--r--sw/source/core/frmedt/fews.cxx16
-rw-r--r--sw/source/core/frmedt/tblsel.cxx49
-rw-r--r--sw/source/core/graphic/ndgrf.cxx4
-rw-r--r--sw/source/core/inc/bodyfrm.hxx2
-rw-r--r--sw/source/core/inc/cellfrm.hxx2
-rw-r--r--sw/source/core/inc/cntfrm.hxx2
-rw-r--r--sw/source/core/inc/colfrm.hxx2
-rw-r--r--sw/source/core/inc/flyfrm.hxx3
-rw-r--r--sw/source/core/inc/flyfrms.hxx8
-rw-r--r--sw/source/core/inc/frame.hxx18
-rw-r--r--sw/source/core/inc/frmtool.hxx3
-rw-r--r--sw/source/core/inc/ftnboss.hxx2
-rw-r--r--sw/source/core/inc/ftnfrm.hxx4
-rw-r--r--sw/source/core/inc/hffrm.hxx6
-rw-r--r--sw/source/core/inc/layfrm.hxx2
-rw-r--r--sw/source/core/inc/notxtfrm.hxx2
-rw-r--r--sw/source/core/inc/pagefrm.hxx2
-rw-r--r--sw/source/core/inc/rootfrm.hxx5
-rw-r--r--sw/source/core/inc/rowfrm.hxx2
-rw-r--r--sw/source/core/inc/sectfrm.hxx2
-rw-r--r--sw/source/core/inc/tabfrm.hxx2
-rw-r--r--sw/source/core/inc/txtfrm.hxx2
-rw-r--r--sw/source/core/layout/atrfrm.cxx18
-rw-r--r--sw/source/core/layout/calcmove.cxx13
-rw-r--r--sw/source/core/layout/colfrm.cxx12
-rw-r--r--sw/source/core/layout/findfrm.cxx16
-rw-r--r--sw/source/core/layout/flowfrm.cxx28
-rw-r--r--sw/source/core/layout/fly.cxx75
-rw-r--r--sw/source/core/layout/flycnt.cxx7
-rw-r--r--sw/source/core/layout/flyincnt.cxx4
-rw-r--r--sw/source/core/layout/flylay.cxx18
-rw-r--r--sw/source/core/layout/flypos.cxx2
-rw-r--r--sw/source/core/layout/frmtool.cxx87
-rw-r--r--sw/source/core/layout/ftnfrm.cxx63
-rw-r--r--sw/source/core/layout/hffrm.cxx24
-rw-r--r--sw/source/core/layout/layact.cxx32
-rw-r--r--sw/source/core/layout/laycache.cxx22
-rw-r--r--sw/source/core/layout/newfrm.cxx46
-rw-r--r--sw/source/core/layout/pagechg.cxx101
-rw-r--r--sw/source/core/layout/pagedesc.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx38
-rw-r--r--sw/source/core/layout/sectfrm.cxx53
-rw-r--r--sw/source/core/layout/ssfrm.cxx10
-rw-r--r--sw/source/core/layout/tabfrm.cxx57
-rw-r--r--sw/source/core/layout/trvlfrm.cxx16
-rw-r--r--sw/source/core/layout/wsfrm.cxx108
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx14
-rw-r--r--sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx8
-rw-r--r--sw/source/core/ole/ndole.cxx2
-rw-r--r--sw/source/core/table/swnewtable.cxx2
-rw-r--r--sw/source/core/text/blink.cxx2
-rw-r--r--sw/source/core/text/frmcrsr.cxx14
-rw-r--r--sw/source/core/text/frmform.cxx8
-rw-r--r--sw/source/core/text/frmpaint.cxx11
-rw-r--r--sw/source/core/text/inftxt.cxx8
-rw-r--r--sw/source/core/text/itratr.cxx23
-rw-r--r--sw/source/core/text/porfld.cxx16
-rw-r--r--sw/source/core/text/porfly.cxx3
-rw-r--r--sw/source/core/text/porrst.cxx13
-rw-r--r--sw/source/core/text/redlnitr.cxx4
-rw-r--r--sw/source/core/text/txtfld.cxx2
-rw-r--r--sw/source/core/text/txtfly.cxx15
-rw-r--r--sw/source/core/text/txtfrm.cxx29
-rw-r--r--sw/source/core/text/txtftn.cxx5
-rw-r--r--sw/source/core/text/txtio.cxx5
-rw-r--r--sw/source/core/tox/txmsrt.cxx2
-rw-r--r--sw/source/core/txtnode/SwGrammarContact.cxx2
-rw-r--r--sw/source/core/txtnode/atrflyin.cxx5
-rw-r--r--sw/source/core/txtnode/atrftn.cxx11
-rw-r--r--sw/source/core/txtnode/fntcache.cxx9
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx16
-rw-r--r--sw/source/core/txtnode/txtedt.cxx2
-rw-r--r--sw/source/core/undo/rolbck.cxx2
-rw-r--r--sw/source/core/undo/unattr.cxx2
-rw-r--r--sw/source/core/undo/undobj1.cxx3
-rw-r--r--sw/source/core/undo/undraw.cxx3
-rw-r--r--sw/source/core/undo/unins.cxx2
-rw-r--r--sw/source/core/unocore/unocrsrhelper.cxx2
-rw-r--r--sw/source/core/unocore/unodraw.cxx12
-rw-r--r--sw/source/core/unocore/unoflatpara.cxx2
-rw-r--r--sw/source/core/unocore/unoobj2.cxx12
-rw-r--r--sw/source/core/view/vdraw.cxx2
-rw-r--r--sw/source/core/view/viewimp.cxx8
-rwxr-xr-x[-rw-r--r--]sw/source/core/view/viewpg.cxx1
-rwxr-xr-xsw/source/core/view/viewsh.cxx102
-rw-r--r--sw/source/core/view/vnew.cxx42
-rwxr-xr-xsw/source/core/view/vprint.cxx32
151 files changed, 1360 insertions, 1120 deletions
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx
index e0d3945e0a51..713a58f1b247 100644
--- a/sw/source/core/access/accdoc.cxx
+++ b/sw/source/core/access/accdoc.cxx
@@ -66,10 +66,10 @@ using lang::IndexOutOfBoundsException;
// SwAccessiblePreview
//
-SwAccessibleDocumentBase::SwAccessibleDocumentBase ( SwAccessibleMap* pInitMap ) :
- SwAccessibleContext( pInitMap, AccessibleRole::DOCUMENT,
- pInitMap->GetShell()->getIDocumentLayoutAccess()->GetRootFrm() ),
- mxParent( pInitMap->GetShell()->GetWin()->GetAccessibleParentWindow()->GetAccessible() ),
+SwAccessibleDocumentBase::SwAccessibleDocumentBase ( SwAccessibleMap *_pMap ) :
+ SwAccessibleContext( _pMap, AccessibleRole::DOCUMENT,
+ _pMap->GetShell()->GetLayout() ),//swmod 071107//swmod 071225
+ mxParent( _pMap->GetShell()->GetWin()->GetAccessibleParentWindow()->GetAccessible() ),
mpChildWin( 0 )
{
}
diff --git a/sw/source/core/access/accfrmobj.cxx b/sw/source/core/access/accfrmobj.cxx
index 47b4007c1496..66f41e2d7ec1 100644
--- a/sw/source/core/access/accfrmobj.cxx
+++ b/sw/source/core/access/accfrmobj.cxx
@@ -356,7 +356,7 @@ const SwFrm* SwAccessibleChild::GetParent( const sal_Bool bInPagePreview ) const
if( bInPagePreview )
pParent = pFly->FindPageFrm();
else
- pParent = pFly->FindRootFrm();
+ pParent = pFly->getRootFrm();
}
}
else
@@ -392,7 +392,7 @@ const SwFrm* SwAccessibleChild::GetParent( const sal_Bool bInPagePreview ) const
if( bInPagePreview )
pParent = pContact->GetAnchorFrm()->FindPageFrm();
else
- pParent = pContact->GetAnchorFrm()->FindRootFrm();
+ pParent = pContact->GetAnchorFrm()->getRootFrm();
}
}
}
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index bf06a19d83b0..333adb0f3275 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -69,7 +69,7 @@ SwCallLink::SwCallLink( SwCrsrShell & rSh )
bHasSelection = ( *pCrsr->GetPoint() != *pCrsr->GetMark() );
if( ND_TEXTNODE & nNdTyp )
- nLeftFrmPos = SwCallLink::GetFrm( (SwTxtNode&)rNd, nCntnt,
+ nLeftFrmPos = SwCallLink::getLayoutFrm( rShell.GetLayout(), (SwTxtNode&)rNd, nCntnt,
!rShell.ActionPend() );
else
{
@@ -124,7 +124,7 @@ SwCallLink::~SwCallLink()
{
// nur wenn mit Left/right getravellt, dann Text-Hints pruefen
// und sich nicht der Frame geaendert hat (Spalten!)
- if( nLeftFrmPos == SwCallLink::GetFrm( (SwTxtNode&)*pCNd, nAktCntnt,
+ if( nLeftFrmPos == SwCallLink::getLayoutFrm( rShell.GetLayout(), (SwTxtNode&)*pCNd, nAktCntnt,
!rShell.ActionPend() ) &&
(( nCmp = nCntnt ) + 1 == nAktCntnt || // Right
nCntnt -1 == ( nCmp = nAktCntnt )) ) // Left
@@ -191,7 +191,7 @@ SwCallLink::~SwCallLink()
const SwFrm* pFrm;
const SwFlyFrm *pFlyFrm;
- if( !rShell.ActionPend() && 0 != ( pFrm = pCNd->GetFrm(0,0,FALSE) ) &&
+ if( !rShell.ActionPend() && 0 != ( pFrm = pCNd->getLayoutFrm(rShell.GetLayout(),0,0,FALSE) ) &&
0 != ( pFlyFrm = pFrm->FindFlyFrm() ) && !rShell.IsTableMode() )
{
const SwNodeIndex* pIndex = pFlyFrm->GetFmt()->GetCntnt().GetCntntIdx();
@@ -204,9 +204,9 @@ SwCallLink::~SwCallLink()
}
}
-long SwCallLink::GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm )
+long SwCallLink::getLayoutFrm( const SwRootFrm* pRoot, SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm )
{
- SwTxtFrm* pFrm = (SwTxtFrm*)rNd.GetFrm(0,0,bCalcFrm), *pNext = pFrm;
+ SwTxtFrm* pFrm = (SwTxtFrm*)rNd.getLayoutFrm(pRoot,0,0,bCalcFrm), *pNext = pFrm;
if ( pFrm && !pFrm->IsHiddenNow() )
{
if( pFrm->HasFollow() )
diff --git a/sw/source/core/crsr/callnk.hxx b/sw/source/core/crsr/callnk.hxx
index f85e0c5db123..dcedf0b13137 100644
--- a/sw/source/core/crsr/callnk.hxx
+++ b/sw/source/core/crsr/callnk.hxx
@@ -31,6 +31,7 @@
class SwCrsrShell;
class SwTxtNode;
+class SwRootFrm;
class SwCallLink
{
@@ -48,7 +49,7 @@ public:
bool bAktSelection );
~SwCallLink();
- static long GetFrm( SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm );
+ static long getLayoutFrm( const SwRootFrm*, SwTxtNode& rNd, xub_StrLen nCntPos, BOOL bCalcFrm );
};
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 9af115269cd8..6a5d6bdb7590 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -186,8 +186,8 @@ SwPaM* SwCrsrShell::GetCrsr( BOOL bMakeTblCrsr ) const
const SwCntntNode* pCNd;
if( pTblCrsr->GetPoint()->nNode.GetIndex() &&
pTblCrsr->GetMark()->nNode.GetIndex() &&
- 0 != ( pCNd = pTblCrsr->GetCntntNode() ) && pCNd->GetFrm() &&
- 0 != ( pCNd = pTblCrsr->GetCntntNode(FALSE) ) && pCNd->GetFrm())
+ 0 != ( pCNd = pTblCrsr->GetCntntNode() ) && pCNd->getLayoutFrm( GetLayout() ) &&
+ 0 != ( pCNd = pTblCrsr->GetCntntNode(FALSE) ) && pCNd->getLayoutFrm( GetLayout() ) )
{
SwShellTableCrsr* pTC = (SwShellTableCrsr*)pTblCrsr;
GetLayout()->MakeTblCrsrs( *pTC );
@@ -215,7 +215,7 @@ void SwCrsrShell::StartAction()
nAktNdTyp = rNd.GetNodeType();
bAktSelection = *pCurCrsr->GetPoint() != *pCurCrsr->GetMark();
if( ND_TEXTNODE & nAktNdTyp )
- nLeftFrmPos = SwCallLink::GetFrm( (SwTxtNode&)rNd, nAktCntnt, TRUE );
+ nLeftFrmPos = SwCallLink::getLayoutFrm( GetLayout(), (SwTxtNode&)rNd, nAktCntnt, TRUE );
else
nLeftFrmPos = 0;
}
@@ -307,6 +307,7 @@ if( GetWin() )
USHORT nParm = SwCrsrShell::CHKRANGE;
if ( !bIdleEnd )
nParm |= SwCrsrShell::SCROLLWIN;
+ if( !IsViewLocked() )
UpdateCrsr( nParm, bIdleEnd ); // Cursor-Aenderungen anzeigen
{
@@ -583,7 +584,7 @@ BOOL SwCrsrShell::MovePage( SwWhichPage fnWhichPage, SwPosPage fnPosPage )
SwCrsrSaveState aSaveState( *pCurCrsr );
Point& rPt = pCurCrsr->GetPtPos();
SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->
- GetFrm( &rPt, pCurCrsr->GetPoint() );
+ getLayoutFrm( GetLayout(), &rPt, pCurCrsr->GetPoint(), FALSE );
if( pFrm && TRUE == ( bRet = GetFrmInPage( pFrm, fnWhichPage,
fnPosPage, pCurCrsr ) ) &&
!pCurCrsr->IsSelOvr( nsSwCursorSelOverFlags::SELOVER_TOGGLE |
@@ -629,7 +630,7 @@ SwFrm* lcl_IsInHeaderFooter( const SwNodeIndex& rIdx, Point& rPt )
SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode();
if( pCNd )
{
- pFrm = pCNd->GetFrm( &rPt, 0, FALSE )->GetUpper();
+ pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &rPt, 0, FALSE )->GetUpper();
while( pFrm && !pFrm->IsHeaderFrm() && !pFrm->IsFooterFrm() )
pFrm = pFrm->IsFlyFrm() ? ((SwFlyFrm*)pFrm)->AnchorFrm()
: pFrm->GetUpper();
@@ -715,10 +716,10 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, BOOL bOnlyText, bool bBlock )
else if( aPos.nNode.GetNode().IsCntntNode() )
{
// im gleichen Frame gelandet?
- SwFrm* pOld = ((SwCntntNode&)aPos.nNode.GetNode()).GetFrm(
- &aCharRect.Pos(), 0, FALSE );
- SwFrm* pNew = ((SwCntntNode&)aPos.nNode.GetNode()).GetFrm(
- &aPt, 0, FALSE );
+ SwFrm* pOld = ((SwCntntNode&)aPos.nNode.GetNode()).getLayoutFrm(
+ GetLayout(), &aCharRect.Pos(), 0, FALSE );
+ SwFrm* pNew = ((SwCntntNode&)aPos.nNode.GetNode()).getLayoutFrm(
+ GetLayout(), &aPt, 0, FALSE );
if( pNew == pOld )
return bRet;
}
@@ -1248,7 +1249,7 @@ void SwCrsrShell::UpdateCrsrPos()
Size aOldSz( GetDocSize() );
SwCntntNode *pCNode = pShellCrsr->GetCntntNode();
SwCntntFrm *pFrm = pCNode ?
- pCNode->GetFrm( &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint() ) :0;
+ pCNode->getLayoutFrm( GetLayout(), &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), FALSE ) :0;
if( !pFrm || (pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsHiddenNow()) )
{
SwCrsrMoveState aTmpState( MV_NONE );
@@ -1385,7 +1386,7 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
}
SwCntntFrm *pTblFrm = pPos->nNode.GetNode().GetCntntNode()->
- GetFrm( &aTmpPt, pPos );
+ getLayoutFrm( GetLayout(), &aTmpPt, pPos, FALSE );
ASSERT( pTblFrm, "Tabelle Crsr nicht im Content ??" );
@@ -1402,7 +1403,8 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
// Second check if mark is in repeated headline:
if ( !bInRepeatedHeadline )
{
- SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( FALSE )->GetFrm( &aTmpMk, pITmpCrsr->GetMark() );
+ SwCntntFrm* pMarkTblFrm = pITmpCrsr->GetCntntNode( FALSE )->
+ getLayoutFrm( GetLayout(), &aTmpMk, pITmpCrsr->GetMark(), FALSE );
ASSERT( pMarkTblFrm, "Tabelle Crsr nicht im Content ??" );
if ( pMarkTblFrm )
@@ -1615,8 +1617,8 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
BOOL bAgainst;
do {
bAgainst = FALSE;
- pFrm = pShellCrsr->GetCntntNode()->GetFrm(
- &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint() );
+ pFrm = pShellCrsr->GetCntntNode()->getLayoutFrm( GetLayout(),
+ &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), FALSE );
// ist der Frm nicht mehr vorhanden, dann muss das gesamte Layout
// erzeugt werden, weil ja mal hier einer vorhanden war !!
if ( !pFrm )
@@ -1624,8 +1626,8 @@ void SwCrsrShell::UpdateCrsr( USHORT eFlags, BOOL bIdleEnd )
do
{
CalcLayout();
- pFrm = pShellCrsr->GetCntntNode()->GetFrm(
- &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint() );
+ pFrm = pShellCrsr->GetCntntNode()->getLayoutFrm( GetLayout(),
+ &pShellCrsr->GetPtPos(), pShellCrsr->GetPoint(), FALSE );
} while( !pFrm );
}
else if ( Imp()->IsIdleAction() )
@@ -1811,7 +1813,7 @@ void SwCrsrShell::RefreshBlockCursor()
ASSERT( pBlockCrsr, "Don't call me without a block cursor" );
SwShellCrsr &rBlock = pBlockCrsr->getShellCrsr();
Point aPt = rBlock.GetPtPos();
- SwCntntFrm* pFrm = rBlock.GetCntntNode()->GetFrm( &aPt, rBlock.GetPoint() );
+ SwCntntFrm* pFrm = rBlock.GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, rBlock.GetPoint(), FALSE );
Point aMk;
if( pBlockCrsr->getEndPoint() && pBlockCrsr->getStartPoint() )
{
@@ -2129,13 +2131,13 @@ SwCntntFrm *SwCrsrShell::GetCurrFrm( const BOOL bCalcFrm ) const
const USHORT* pST = &nStartAction;
++(*((USHORT*)pST));
const Size aOldSz( GetDocSize() );
- pRet = pNd->GetFrm( &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint() );
+ pRet = pNd->getLayoutFrm( GetLayout(), &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint() );
--(*((USHORT*)pST));
if( aOldSz != GetDocSize() )
((SwCrsrShell*)this)->SizeChgNotify();
}
else
- pRet = pNd->GetFrm( &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint(), FALSE);
+ pRet = pNd->getLayoutFrm( GetLayout(), &pCurCrsr->GetPtPos(), pCurCrsr->GetPoint(), FALSE);
}
return pRet;
}
@@ -2315,7 +2317,7 @@ BOOL SwCrsrShell::SetVisCrsr( const Point &rPt )
pSectNd->GetSection().IsProtectFlag())) )
return FALSE;
- SwCntntFrm *pFrm = pTxtNd->GetFrm( &aPt, &aPos );
+ SwCntntFrm *pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt, &aPos );
if ( Imp()->IsIdleAction() )
pFrm->PrepareCrsr();
SwRect aTmp( aCharRect );
@@ -2768,7 +2770,7 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText )
SwCntntNode* pCNd = rNdIdx.GetNode().GetCntntNode();
const SwCntntFrm * pFrm;
- if( pCNd && 0 != (pFrm = pCNd->GetFrm(0,pCurCrsr->GetPoint(),FALSE)) &&
+ if( pCNd && 0 != (pFrm = pCNd->getLayoutFrm( GetLayout(),0,pCurCrsr->GetPoint(),FALSE)) &&
!IsReadOnlyAvailable() && pFrm->IsProtected() &&
nNdIdx < rNds.GetEndOfExtras().GetIndex() )
{
@@ -2884,7 +2886,7 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText )
if( bOk && rNdIdx.GetIndex() < rNds.GetEndOfExtras().GetIndex() )
{
// Teste mal auf Fly - kann auch noch geschuetzt sein!!
- if( 0 == (pFrm = pCNd->GetFrm(0,0,FALSE)) ||
+ if( 0 == (pFrm = pCNd->getLayoutFrm( GetLayout(),0,0,FALSE)) ||
( !IsReadOnlyAvailable() && pFrm->IsProtected() ) ||
( bOnlyText && pCNd->IsNoTxtNode() ) )
{
@@ -2916,7 +2918,7 @@ BOOL SwCrsrShell::FindValidCntntNode( BOOL bOnlyText )
// falls Cursor im versteckten Bereich ist, auf jedenfall schon mal
// verschieben!!
- if( !pCNd || !pCNd->GetFrm(0,0,FALSE) )
+ if( !pCNd || !pCNd->getLayoutFrm( GetLayout(),0,0,FALSE) )
{
SwCrsrMoveState aTmpState( MV_NONE );
aTmpState.bSetInReadOnly = IsReadOnlyAvailable();
@@ -3305,7 +3307,7 @@ String SwCrsrShell::GetCrsrDescr() const
SwRect SwCrsrShell::GetRectOfCurrentChar()
{
- SwCntntFrm* pFrm = pCurCrsr->GetCntntNode()->GetFrm( 0, pCurCrsr->GetPoint(), FALSE );
+ SwCntntFrm* pFrm = pCurCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), 0, pCurCrsr->GetPoint(), FALSE );
SwRect aRet;
SwCrsrMoveState aTmpState( MV_NONE );
aTmpState.bRealHeight = TRUE;
@@ -3494,7 +3496,7 @@ void SwCrsrShell::GetSmartTagTerm( const Point& rPt, SwRect& rSelectRect,
SwCrsrMoveState aState;
aState.bRealWidth = TRUE;
SwCntntNode* pCntntNode = pCrsr->GetCntntNode();
- SwCntntFrm *pCntntFrame = pCntntNode->GetFrm( &rPt, pCrsr->GetPoint(), FALSE);
+ SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), &rPt, pCrsr->GetPoint(), FALSE);
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
rContent = nWordEnd;
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 249500b95f98..2641b323b166 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -94,7 +94,7 @@ BOOL SwCrsrShell::GotoNextNum()
// dann versuche den Cursor auf die Position zu setzen,
// auf halber Heohe vom Char-SRectangle
Point aPt( pCurCrsr->GetPtPos() );
- SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->GetFrm( &aPt,
+ SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), &aPt,
pCurCrsr->GetPoint() );
pFrm->GetCharRect( aCharRect, *pCurCrsr->GetPoint() );
pFrm->Calc();
@@ -134,7 +134,7 @@ BOOL SwCrsrShell::GotoPrevNum()
// dann versuche den Cursor auf die Position zu setzen,
// auf halber Heohe vom Char-SRectangle
Point aPt( pCurCrsr->GetPtPos() );
- SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->GetFrm( &aPt,
+ SwCntntFrm * pFrm = pCurCrsr->GetCntntNode()->getLayoutFrm( GetLayout(), &aPt,
pCurCrsr->GetPoint() );
pFrm->GetCharRect( aCharRect, *pCurCrsr->GetPoint() );
pFrm->Calc();
@@ -278,7 +278,7 @@ BOOL SwCrsrShell::SetCrsrInHdFt( USHORT nDescNo, BOOL bInHeader )
const SwFrm* pFrm;
Point aPt( pCurCrsr->GetPtPos() );
- if( pCNd && 0 != ( pFrm = pCNd->GetFrm( &aPt, 0, FALSE ) ))
+ if( pCNd && 0 != ( pFrm = pCNd->getLayoutFrm( GetLayout(), &aPt, 0, FALSE ) ))
{
// dann kann der Cursor ja auch hinein gesetzt werden
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen, evt. Link callen
@@ -329,7 +329,7 @@ BOOL SwCrsrShell::GotoNextTOXBase( const String* pName )
const SwCntntFrm* pCFrm;
if( pCNd &&
pCNd->EndOfSectionIndex() <= pSectNd->EndOfSectionIndex() &&
- 0 != ( pCFrm = pCNd->GetFrm() ) &&
+ 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout() ) ) &&
( IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
{
pFnd = pCNd;
@@ -379,7 +379,7 @@ BOOL SwCrsrShell::GotoPrevTOXBase( const String* pName )
const SwCntntFrm* pCFrm;
if( pCNd &&
pCNd->EndOfSectionIndex() <= pSectNd->EndOfSectionIndex() &&
- 0 != ( pCFrm = pCNd->GetFrm() ) &&
+ 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout() ) ) &&
( IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
{
pFnd = pCNd;
@@ -432,7 +432,7 @@ BOOL SwCrsrShell::GotoTOXMarkBase()
const SwCntntFrm* pCFrm;
if( pCNd &&
pCNd->EndOfSectionIndex() < pSectNd->EndOfSectionIndex() &&
- 0 != ( pCFrm = pCNd->GetFrm() ) &&
+ 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout() ) ) &&
( IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
{
SwCallLink aLk( *this ); // Crsr-Moves ueberwachen,
@@ -480,7 +480,7 @@ BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors )
if( rPos.nNode < GetDoc()->GetNodes().GetEndOfExtras() )
// auch beim Einsammeln wird nur der erste Frame benutzt!
- aCurGEF.SetBodyPos( *rPos.nNode.GetNode().GetCntntNode()->GetFrm(
+ aCurGEF.SetBodyPos( *rPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(),
&aPt, &rPos, FALSE ) );
{
@@ -500,7 +500,7 @@ BOOL SwCrsrShell::GotoNxtPrvTblFormula( BOOL bNext, BOOL bOnlyErrors )
const SwCntntFrm* pCFrm;
SwNodeIndex aIdx( *pTBox->GetSttNd() );
const SwCntntNode* pCNd = GetDoc()->GetNodes().GoNext( &aIdx );
- if( pCNd && 0 != ( pCFrm = pCNd->GetFrm( &aPt, 0, FALSE ) ) &&
+ if( pCNd && 0 != ( pCFrm = pCNd->getLayoutFrm( GetLayout(), &aPt, 0, FALSE ) ) &&
(IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
{
_SetGetExpFld aCmp( *pTBox );
@@ -551,7 +551,7 @@ BOOL SwCrsrShell::GotoNxtPrvTOXMark( BOOL bNext )
if( rPos.nNode.GetIndex() < GetDoc()->GetNodes().GetEndOfExtras().GetIndex() )
// auch beim Einsammeln wird nur der erste Frame benutzt!
aCurGEF.SetBodyPos( *rPos.nNode.GetNode().
- GetCntntNode()->GetFrm( &aPt, &rPos, FALSE ) );
+ GetCntntNode()->getLayoutFrm( GetLayout(), &aPt, &rPos, FALSE ) );
{
const SfxPoolItem* pItem;
@@ -565,7 +565,7 @@ BOOL SwCrsrShell::GotoNxtPrvTOXMark( BOOL bNext )
RES_TXTATR_TOXMARK, n ) ) &&
0 != (pTxtTOX = ((SwTOXMark*)pItem)->GetTxtTOXMark() ) &&
( pTxtNd = &pTxtTOX->GetTxtNode())->GetNodes().IsDocNodes() &&
- 0 != ( pCFrm = pTxtNd->GetFrm( &aPt, 0, FALSE )) &&
+ 0 != ( pCFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt, 0, FALSE )) &&
( IsReadOnlyAvailable() || !pCFrm->IsProtected() ))
{
SwNodeIndex aNdIndex( *pTxtNd ); // UNIX benoetigt dieses Obj.
@@ -643,7 +643,7 @@ void lcl_MakeFldLst( _SetGetExpFlds& rLst, const SwFieldType& rFldType,
{
SwCntntFrm* pCFrm;
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
- if( 0 != ( pCFrm = rTxtNode.GetFrm( &aPt, 0, FALSE )) &&
+ if( 0 != ( pCFrm = rTxtNode.getLayoutFrm( rTxtNode.GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE )) &&
( bInReadOnly || !pCFrm->IsProtected() ))
{
_SetGetExpFld* pNew = new _SetGetExpFld(
@@ -728,7 +728,7 @@ BOOL SwCrsrShell::MoveFldType( const SwFieldType* pFldType, BOOL bNext,
{
// auch beim Einsammeln wird nur der erste Frame benutzt!
Point aPt;
- aSrch.SetBodyPos( *pTNd->GetFrm( &aPt, &rPos, FALSE ) );
+ aSrch.SetBodyPos( *pTNd->getLayoutFrm( GetLayout(), &aPt, &rPos, FALSE ) );
}
BOOL bFound = aSrtLst.Seek_Entry( &aSrch, &nPos );
@@ -1113,7 +1113,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_SMARTTAG;
// rCntntAtPos.pFndTxtAttr = pTxtAttr;
- if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
+ if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
}
}
@@ -1133,7 +1133,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
if( pFld )
{
- if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
+ if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
if( bSetCrsr )
@@ -1231,7 +1231,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.pFndTxtAttr = pTxtAttr;
rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
- if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
+ if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
}
}
@@ -1299,7 +1299,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.pFndTxtAttr = pTxtAttr;
rCntntAtPos.aFnd.pAttr = &pTxtAttr->GetAttr();
- if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
+ if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
}
}
@@ -1336,7 +1336,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.eCntntAtPos = SwContentAtPos::SW_INETATTR;
rCntntAtPos.pFndTxtAttr = pTxtAttr;
- if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
+ if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
}
}
@@ -1352,7 +1352,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
rCntntAtPos.pFndTxtAttr = 0;
bRet = TRUE;
- if( pFldRect && 0 != ( pFrm = pTxtNd->GetFrm( &aPt ) ) )
+ if( pFldRect && 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt ) ) )
pFrm->GetCharRect( *pFldRect, aPos, &aTmpState );
}
}
@@ -1383,7 +1383,7 @@ BOOL SwCrsrShell::GetContentAtPos( const Point& rPt,
#endif
)
{
- SwFrm* pF = pTxtNd->GetFrm( &aPt );
+ SwFrm* pF = pTxtNd->getLayoutFrm( GetLayout(), &aPt );
if( pF )
{
// dann aber den CellFrame
@@ -1591,7 +1591,7 @@ BOOL SwContentAtPos::IsInProtectSect() const
const SwCntntFrm* pFrm;
return pNd && ( pNd->IsInProtectSect() ||
- ( 0 != ( pFrm = pNd->GetFrm(0,0,FALSE)) &&
+ ( 0 != ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), 0,0,FALSE)) &&
pFrm->IsProtected() ));
}
bool SwContentAtPos::IsInRTLText()const
@@ -2101,7 +2101,7 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext )
{
const SwCntntNode* pCNd = aCurPos.GetNodeFromCntnt()->GetCntntNode();
SwCntntFrm* pFrm;
- if( pCNd && 0 != ( pFrm = pCNd->GetFrm( &aPt )) )
+ if( pCNd && 0 != ( pFrm = pCNd->getLayoutFrm( GetLayout(), &aPt )) )
aCurPos.SetBodyPos( *pFrm );
}
@@ -2123,7 +2123,7 @@ BOOL SwCrsrShell::SelectNxtPrvHyperlink( BOOL bNext )
_SetGetExpFld aPos( aTmpPos.nNode, rAttr );
SwCntntFrm* pFrm;
if( pTxtNd->GetIndex() < nBodySttNdIdx &&
- 0 != ( pFrm = pTxtNd->GetFrm( &aPt )) )
+ 0 != ( pFrm = pTxtNd->getLayoutFrm( GetLayout(), &aPt )) )
aPos.SetBodyPos( *pFrm );
if( bNext
diff --git a/sw/source/core/crsr/crstrvl1.cxx b/sw/source/core/crsr/crstrvl1.cxx
index fcdcd99241f4..9ffa1f720f30 100644
--- a/sw/source/core/crsr/crstrvl1.cxx
+++ b/sw/source/core/crsr/crstrvl1.cxx
@@ -91,7 +91,7 @@ BOOL SwCrsrShell::GoStartSentence()
BOOL SwCrsrShell::SelectWord( const Point* pPt )
{
- return pCurCrsr->SelectWord( pPt );
+ return pCurCrsr->SelectWord( this, pPt );
}
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index ec30b5aefbe0..a79203c13ece 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -640,7 +640,7 @@ USHORT SwPaM::GetPageNum( BOOL bAtPoint, const Point* pLayPos )
const SwPosition* pPos = bAtPoint ? m_pPoint : m_pMark;
if( 0 != ( pNd = pPos->nNode.GetNode().GetCntntNode() ) &&
- 0 != ( pCFrm = pNd->GetFrm( pLayPos, pPos, FALSE )) &&
+ 0 != ( pCFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), pLayPos, pPos, FALSE )) &&
0 != ( pPg = pCFrm->FindPageFrm() ))
return pPg->GetPhyPageNum();
return 0;
@@ -683,7 +683,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
const SwCntntFrm *pFrm;
if( 0 != ( pNd = GetPoint()->nNode.GetNode().GetCntntNode() ))
- pFrm = pNd->GetFrm( &aTmpPt, GetPoint(), FALSE );
+ pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetPoint(), FALSE );
else
pFrm = 0;
@@ -711,7 +711,7 @@ BOOL SwPaM::HasReadonlySel( bool bFormView ) const
if( !bRet && HasMark() && GetPoint()->nNode != GetMark()->nNode )
{
if( 0 != ( pNd = GetMark()->nNode.GetNode().GetCntntNode() ))
- pFrm = pNd->GetFrm( &aTmpPt, GetMark(), FALSE );
+ pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, GetMark(), FALSE );
else
pFrm = 0;
@@ -868,7 +868,7 @@ SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove,
{
if(
(
- 0 == ( pFrm = pNd->GetFrm()) ||
+ 0 == ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout() ) ) ||
( !bInReadOnly && pFrm->IsProtected() ) ||
(pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsHiddenNow())
) ||
@@ -905,7 +905,7 @@ SwCntntNode* GetNode( SwPaM & rPam, BOOL& rbFirst, SwMoveFn fnMove,
{
// nur in der AutoTextSection koennen Node stehen, die
// nicht angezeigt werden !!
- if( 0 == ( pFrm = pNd->GetFrm()) ||
+ if( 0 == ( pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout() ) ) ||
( !bInReadOnly && pFrm->IsProtected() ) ||
( pFrm->IsTxtFrm() &&
((SwTxtFrm*)pFrm)->IsHiddenNow() ) )
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index d8286d007395..8c536698288b 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -31,10 +31,8 @@
#include <hintids.hxx>
#include <editeng/protitem.hxx>
-
#include <com/sun/star/i18n/WordType.hdl>
#include <com/sun/star/i18n/CharType.hdl>
-
#include <unotools/charclass.hxx>
#include <svl/ctloptions.hxx>
#include <swmodule.hxx>
@@ -53,14 +51,13 @@
#include <scriptinfo.hxx>
#include <crstate.hxx>
#include <docsh.hxx>
+#include <viewsh.hxx>
#include <frmatr.hxx>
#include <breakit.hxx>
#include <crsskip.hxx>
#include <vcl/msgbox.hxx>
#include <mdiexp.hxx> // ...Percent()
-#ifndef _STATSTR_HRC
#include <statstr.hrc> // ResId fuer Statusleiste
-#endif
#include <redline.hxx> // SwRedline
@@ -351,7 +348,7 @@ BOOL SwCursor::IsSelOvr( int eFlags )
const SwNode* pNd = &GetPoint()->nNode.GetNode();
if( pNd->IsCntntNode() && !dynamic_cast<SwUnoCrsr*>(this) )
{
- const SwCntntFrm* pFrm = ((SwCntntNode*)pNd)->GetFrm();
+ const SwCntntFrm* pFrm = ((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() );
if( pFrm && pFrm->IsValid() && 0 == pFrm->Frm().Height() &&
0 != ( nsSwCursorSelOverFlags::SELOVER_CHANGEPOS & eFlags ) )
{
@@ -368,7 +365,7 @@ BOOL SwCursor::IsSelOvr( int eFlags )
if( !pFrm )
{
bGoNxt = !bGoNxt;
- pFrm = ((SwCntntNode*)pNd)->GetFrm();
+ pFrm = ((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() );
while ( pFrm && 0 == pFrm->Frm().Height() )
{
pFrm = bGoNxt ? pFrm->GetNextCntntFrm()
@@ -425,7 +422,7 @@ BOOL SwCursor::IsSelOvr( int eFlags )
const SwTableNode* pPtNd = pNd->FindTableNode();
if( (pNd = &GetMark()->nNode.GetNode())->IsCntntNode() &&
- !((SwCntntNode*)pNd)->GetFrm() && !dynamic_cast<SwUnoCrsr*>(this) )
+ !((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() ) && !dynamic_cast<SwUnoCrsr*>(this) )
{
DeleteMark();
RestoreSavePos();
@@ -696,7 +693,7 @@ BOOL SwCursor::IsAtValidPos( BOOL bPoint ) const
const SwPosition* pPos = bPoint ? GetPoint() : GetMark();
const SwNode* pNd = &pPos->nNode.GetNode();
- if( pNd->IsCntntNode() && !((SwCntntNode*)pNd)->GetFrm() &&
+ if( pNd->IsCntntNode() && !((SwCntntNode*)pNd)->getLayoutFrm( pDoc->GetCurrentLayout() ) &&
!dynamic_cast<const SwUnoCrsr*>(this) )
{
return FALSE;
@@ -1176,9 +1173,9 @@ BOOL SwCursor::GoPrevWord()
return GoPrevWordWT( WordType::ANYWORD_IGNOREWHITESPACES );
}
-BOOL SwCursor::SelectWord( const Point* pPt )
+BOOL SwCursor::SelectWord( ViewShell* pViewShell, const Point* pPt )
{
- return SelectWordWT( WordType::ANYWORD_IGNOREWHITESPACES, pPt );
+ return SelectWordWT( pViewShell, WordType::ANYWORD_IGNOREWHITESPACES, pPt );
}
BOOL SwCursor::IsStartWordWT( sal_Int16 nWordType ) const
@@ -1354,20 +1351,20 @@ BOOL SwCursor::GoPrevWordWT( sal_Int16 nWordType )
return bRet;
}
-BOOL SwCursor::SelectWordWT( sal_Int16 nWordType, const Point* pPt )
+BOOL SwCursor::SelectWordWT( ViewShell* pViewShell, sal_Int16 nWordType, const Point* pPt )
{
SwCrsrSaveState aSave( *this );
BOOL bRet = FALSE;
BOOL bForward = TRUE;
DeleteMark();
- SwRootFrm* pLayout;
- if( pPt && 0 != (pLayout = GetDoc()->GetRootFrm()) )
+ const SwRootFrm* pLayout = pViewShell->GetLayout();
+ if( pPt && 0 != pLayout )
{
// set the cursor to the layout position
Point aPt( *pPt );
pLayout->GetCrsrOfst( GetPoint(), aPt );
- }
+ } //swmod 071107//swmod 071225
const SwTxtNode* pTxtNd = GetNode()->GetTxtNode();
if( pTxtNd && pBreakIt->GetBreakIter().is() )
@@ -1515,7 +1512,7 @@ SwCursor::DoSetBidiLevelLeftRight(
// for visual cursor travelling (used in bidi layout)
// we first have to convert the logic to a visual position
Point aPt;
- pSttFrm = rTNd.GetFrm( &aPt, GetPoint() );
+ pSttFrm = rTNd.getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
if( pSttFrm )
{
BYTE nCrsrLevel = GetCrsrBidiLevel();
@@ -1654,7 +1651,7 @@ BOOL SwCursor::LeftRight( BOOL bLeft, USHORT nCnt, USHORT nMode,
if ( &rTmpNode != &rNode && rTmpNode.IsTxtNode() )
{
Point aPt;
- const SwCntntFrm* pEndFrm = ((SwTxtNode&)rTmpNode).GetFrm( &aPt, GetPoint() );
+ const SwCntntFrm* pEndFrm = ((SwTxtNode&)rTmpNode).getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
if ( pEndFrm )
{
if ( ! pEndFrm->IsRightToLeft() != ! pSttFrm->IsRightToLeft() )
@@ -1723,7 +1720,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt,
Point aPt;
if( pPt )
aPt = *pPt;
- SwCntntFrm* pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() );
+ SwCntntFrm* pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
if( pFrm )
{
@@ -1761,7 +1758,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt,
const SwNode* pEndNd = pTblNd->EndOfSectionNode();
GetPoint()->nNode = *pEndNd;
pTblCrsr->Move( fnMoveBackward, fnGoNode );
- pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() );
+ pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
}
}
@@ -1770,7 +1767,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt,
: pFrm->UnitDown( this, nUpDownX, bInReadOnly ) ) &&
CheckNodesRange( aOldPos.nNode, GetPoint()->nNode, bChkRange ))
{
- pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() );
+ pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
--nCnt;
}
@@ -1781,7 +1778,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt,
{
// dann versuche den Cursor auf die Position zu setzen,
// auf halber Heohe vom Char-Rectangle
- pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() );
+ pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
SwCrsrMoveState eTmpState( MV_UPDOWN );
eTmpState.bSetInReadOnly = bInReadOnly;
SwRect aTmpRect;
@@ -1814,7 +1811,7 @@ BOOL SwCursor::UpDown( BOOL bUp, USHORT nCnt,
BOOL SwCursor::LeftRightMargin( BOOL bLeft, BOOL bAPI )
{
Point aPt;
- SwCntntFrm * pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() );
+ SwCntntFrm * pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
// calculate cursor bidi level
if ( pFrm )
@@ -1828,7 +1825,7 @@ BOOL SwCursor::IsAtLeftRightMargin( BOOL bLeft, BOOL bAPI ) const
{
BOOL bRet = FALSE;
Point aPt;
- SwCntntFrm * pFrm = GetCntntNode()->GetFrm( &aPt, GetPoint() );
+ SwCntntFrm * pFrm = GetCntntNode()->getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, GetPoint() );
if( pFrm )
{
SwPaM aPam( *GetPoint() );
diff --git a/sw/source/core/crsr/trvlfnfl.cxx b/sw/source/core/crsr/trvlfnfl.cxx
index 3edf3718eabe..82c9b56a2489 100644
--- a/sw/source/core/crsr/trvlfnfl.cxx
+++ b/sw/source/core/crsr/trvlfnfl.cxx
@@ -95,7 +95,7 @@ BOOL SwCrsrShell::GotoFtnTxt()
_GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode() : NULL;
if( pTxtNd )
{
- const SwFrm *pFrm = pTxtNd->GetFrm( &_GetCrsr()->GetSttPos(),
+ const SwFrm *pFrm = pTxtNd->getLayoutFrm( GetLayout(), &_GetCrsr()->GetSttPos(),
_GetCrsr()->Start() );
const SwFtnBossFrm* pFtnBoss;
sal_Bool bSkip = pFrm && pFrm->IsInFtn();
diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx
index d9a887e61ad9..e76994ba09fe 100644
--- a/sw/source/core/crsr/trvltbl.cxx
+++ b/sw/source/core/crsr/trvltbl.cxx
@@ -194,7 +194,7 @@ BOOL SwCrsrShell::_SelTblRowOrCol( bool bRow, bool bRowSimple )
const SwShellCrsr *pCrsr = _GetCrsr();
const SwFrm* pStartFrm = pFrm;
const SwCntntNode *pCNd = pCrsr->GetCntntNode( FALSE );
- const SwFrm* pEndFrm = pCNd ? pCNd->GetFrm( &pCrsr->GetMkPos() ) : 0;
+ const SwFrm* pEndFrm = pCNd ? pCNd->getLayoutFrm( GetLayout(), &pCrsr->GetMkPos() ) : 0;
if ( bRow )
{
@@ -381,7 +381,7 @@ bool lcl_FindNextCell( SwNodeIndex& rIdx, BOOL bInReadOnly )
if ( !pCNd )
return false;
- SwCntntFrm* pFrm = pCNd->GetFrm();
+ SwCntntFrm* pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() );
if ( 0 == pFrm || pCNd->FindTableNode() != pTblNd ||
(!bInReadOnly && pFrm->IsProtected() ) )
@@ -413,7 +413,7 @@ bool lcl_FindNextCell( SwNodeIndex& rIdx, BOOL bInReadOnly )
return false;
// check if we have found a suitable table cell:
- pFrm = pCNd->GetFrm();
+ pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() );
if ( 0 != pFrm && pCNd->FindTableNode() == pTblNd &&
(bInReadOnly || !pFrm->IsProtected() ) )
@@ -455,7 +455,7 @@ bool lcl_FindPrevCell( SwNodeIndex& rIdx, BOOL bInReadOnly )
if ( !pCNd )
return false;
- SwCntntFrm* pFrm = pCNd->GetFrm();
+ SwCntntFrm* pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() );
if( 0 == pFrm || pCNd->FindTableNode() != pTblNd ||
(!bInReadOnly && pFrm->IsProtected() ))
@@ -476,7 +476,7 @@ bool lcl_FindPrevCell( SwNodeIndex& rIdx, BOOL bInReadOnly )
if ( !pCNd )
return false;
- pFrm = pCNd->GetFrm();
+ pFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() );
if( 0 != pFrm && pCNd->FindTableNode() == pTblNd &&
(bInReadOnly || !pFrm->IsProtected() ) )
@@ -747,7 +747,7 @@ String SwCrsrShell::GetBoxNms() const
if( IsTableMode() )
{
SwCntntNode *pCNd = pTblCrsr->Start()->nNode.GetNode().GetCntntNode();
- pFrm = pCNd ? pCNd->GetFrm() : 0;
+ pFrm = pCNd ? pCNd->getLayoutFrm( GetLayout() ) : 0;
if( !pFrm )
return sNm;
@@ -769,7 +769,7 @@ String SwCrsrShell::GetBoxNms() const
}
SwCntntNode* pCNd = pPos->nNode.GetNode().GetCntntNode();
- pFrm = pCNd ? pCNd->GetFrm() : 0;
+ pFrm = pCNd ? pCNd->getLayoutFrm( GetLayout() ) : 0;
if( pFrm )
{
diff --git a/sw/source/core/crsr/unocrsr.cxx b/sw/source/core/crsr/unocrsr.cxx
index a4e0d6f79785..065855acb49d 100644
--- a/sw/source/core/crsr/unocrsr.cxx
+++ b/sw/source/core/crsr/unocrsr.cxx
@@ -252,9 +252,9 @@ void SwUnoTableCrsr::MakeBoxSels()
const SwCntntNode* pCNd;
bool bMakeTblCrsrs = true;
if( GetPoint()->nNode.GetIndex() && GetMark()->nNode.GetIndex() &&
- 0 != ( pCNd = GetCntntNode() ) && pCNd->GetFrm() &&
- 0 != ( pCNd = GetCntntNode(FALSE) ) && pCNd->GetFrm() )
- bMakeTblCrsrs = GetDoc()->GetRootFrm()->MakeTblCrsrs( *this );
+ 0 != ( pCNd = GetCntntNode() ) && pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) &&
+ 0 != ( pCNd = GetCntntNode(FALSE) ) && pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) )
+ bMakeTblCrsrs = GetDoc()->GetCurrentLayout()->MakeTblCrsrs( *this ); //swmod 080218
if ( !bMakeTblCrsrs )
{
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 16bf730b33a7..6f9f488fcb3d 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -454,7 +454,7 @@ void SwVisCrsr::_SetPosAndShow()
if( rNode.IsTxtNode() )
{
const SwTxtNode& rTNd = *rNode.GetTxtNode();
- const SwFrm* pFrm = rTNd.GetFrm( 0, 0, FALSE );
+ const SwFrm* pFrm = rTNd.getLayoutFrm( pCrsrShell->GetLayout(), 0, 0, FALSE );
if ( pFrm )
{
const SwScriptInfo* pSI = ((SwTxtFrm*)pFrm)->GetScriptInfo();
@@ -745,11 +745,11 @@ void SwShellCrsr::FillRects()
// die neuen Rechtecke berechnen
if( HasMark() &&
GetPoint()->nNode.GetNode().IsCntntNode() &&
- GetPoint()->nNode.GetNode().GetCntntNode()->GetFrm() &&
+ GetPoint()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) &&
(GetMark()->nNode == GetPoint()->nNode ||
(GetMark()->nNode.GetNode().IsCntntNode() &&
- GetMark()->nNode.GetNode().GetCntntNode()->GetFrm() ) ))
- GetDoc()->GetRootFrm()->CalcFrmRects( *this, GetShell()->IsTableMode() );
+ GetMark()->nNode.GetNode().GetCntntNode()->getLayoutFrm( GetShell()->GetLayout() ) ) ))
+ GetShell()->GetLayout()->CalcFrmRects( *this, GetShell()->IsTableMode() ); //swmod 071107//swmod 071225
}
@@ -822,7 +822,7 @@ short SwShellCrsr::MaxReplaceArived()
// eine SSelection kann erzeugt werden
SvUShorts aArr;
USHORT nActCnt;
- ViewShell *pShell = GetDoc()->GetRootFrm()->GetCurrShell(),
+ ViewShell *pShell = const_cast< SwCrsrShell* >( GetShell() ),
*pSh = pShell;
do {
for( nActCnt = 0; pSh->ActionPend(); ++nActCnt )
@@ -839,7 +839,7 @@ short SwShellCrsr::MaxReplaceArived()
for( nActCnt = aArr[n]; nActCnt--; )
pSh->StartAction();
pSh = (ViewShell*)pSh->GetNext();
- }
+ } //swmod 071107//swmod 071225
}
else
// ansonsten aus dem Basic, und dann auf RET_YES schalten
@@ -952,7 +952,7 @@ void SwShellTableCrsr::FillRects()
if( !pCNd )
continue;
- SwFrm* pFrm = pCNd->GetFrm( &GetSttPos() );
+ SwFrm* pFrm = pCNd->getLayoutFrm( GetShell()->GetLayout(), &GetSttPos() );
while( pFrm && !pFrm->IsCellFrm() )
pFrm = pFrm->GetUpper();
@@ -988,7 +988,7 @@ BOOL SwShellTableCrsr::IsInside( const Point& rPt ) const
if( !pCNd )
continue;
- SwFrm* pFrm = pCNd->GetFrm( &GetPtPos() );
+ SwFrm* pFrm = pCNd->getLayoutFrm( GetShell()->GetLayout(), &GetPtPos() );
while( pFrm && !pFrm->IsCellFrm() )
pFrm = pFrm->GetUpper();
ASSERT( pFrm, "Node nicht in einer Tabelle" );
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 7f2b92979f57..fd5b7ab1dc12 100755
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -108,6 +108,7 @@
#include <SwUndoFmt.hxx>
#include <unocrsr.hxx>
#include <docsh.hxx>
+#include <viewopt.hxx>
#include <docfld.hxx> // _SetGetExpFld
#include <docufld.hxx> // SwPostItField
#include <viewsh.hxx>
@@ -196,7 +197,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
// <--
// COMPATIBILITY FLAGS END
- case BROWSE_MODE: return mbBrowseMode;
+ case BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the ViewShell has to be asked!
case HTML_MODE: return mbHTMLMode;
case GLOBAL_DOCUMENT: return mbIsGlobalDoc;
case GLOBAL_DOCUMENT_SAVE_LINKS: return mbGlblDocSaveLinks;
@@ -319,8 +320,8 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
// <--
// COMPATIBILITY FLAGS END
- case BROWSE_MODE:
- mbBrowseMode = value;
+ case BROWSE_MODE: //can be used temporary (load/save) when no ViewShell is avaiable
+ mbLastBrowseMode = value;
break;
case HTML_MODE:
mbHTMLMode = value;
@@ -360,7 +361,7 @@ const i18n::ForbiddenCharacters*
}
void SwDoc::setForbiddenCharacters(/*[in]*/ USHORT nLang,
- /*[in]*/ const i18n::ForbiddenCharacters& rFChars )
+ /*[in]*/ const com::sun::star::i18n::ForbiddenCharacters& rFChars )
{
if( !xForbiddenCharsTable.isValid() )
{
@@ -377,12 +378,14 @@ void SwDoc::setForbiddenCharacters(/*[in]*/ USHORT nLang,
pDrawModel->ReformatAllTextObjects();
}
- if( pLayout && !mbInReading )
+ SwRootFrm* pTmpRoot = GetCurrentLayout();
+ if( pTmpRoot && !mbInReading )
{
- pLayout->StartAllAction();
- pLayout->InvalidateAllCntnt();
- pLayout->EndAllAction();
- }
+ pTmpRoot->StartAllAction();
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(), std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_SIZE));
+ pTmpRoot->EndAllAction();
+ }//swmod 080310
SetModified();
}
@@ -446,12 +449,14 @@ void SwDoc::setCharacterCompressionType( /*[in]*/SwCharCompressType n )
pDrawModel->ReformatAllTextObjects();
}
- if( pLayout && !mbInReading )
+ SwRootFrm* pTmpRoot = GetCurrentLayout();
+ if( pTmpRoot && !mbInReading )
{
- pLayout->StartAllAction();
- pLayout->InvalidateAllCntnt();
- pLayout->EndAllAction();
- }
+ pTmpRoot->StartAllAction();
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(), std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_SIZE));
+ pTmpRoot->EndAllAction();
+ }//swmod 080310
SetModified();
}
}
@@ -1198,15 +1203,12 @@ static sal_Int32 lcl_GetPaperBin( const SwPageFrm *pStartFrm )
void SwDoc::CalculatePagesForPrinting(
+ const SwRootFrm& rLayout,
/* out */ SwRenderData &rData,
const SwPrintUIOptions &rOptions,
bool bIsPDFExport,
sal_Int32 nDocPageCount )
{
- DBG_ASSERT( pLayout, "no layout present" );
- if (!pLayout)
- return;
-
const sal_Int32 nContent = rOptions.getIntValue( "PrintContent", 0 );
const bool bPrintSelection = nContent == 2;
@@ -1223,7 +1225,7 @@ void SwDoc::CalculatePagesForPrinting(
aMulti.SetTotalRange( Range( 0, RANGE_MAX ) );
aMulti.Select( aPages );
- const SwPageFrm *pStPage = (SwPageFrm*)pLayout->Lower();
+ const SwPageFrm *pStPage = dynamic_cast<const SwPageFrm*>( rLayout.Lower() );
const SwFrm *pEndPage = pStPage;
USHORT nFirstPageNo = 0;
@@ -1420,7 +1422,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
{
// get the correct number of current pages for the post-it document
rData.m_pPostItShell->CalcLayout();
- const sal_Int32 nPages = rData.m_pPostItDoc->GetPageCount();
+ const sal_Int32 nPages = rData.m_pPostItShell->GetPageCount();
aPostItLastStartPageNum[ nPhyPageNum ] = nPages;
}
}
@@ -1428,7 +1430,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
// format post-it doc to get correct number of pages
rData.m_pPostItShell->CalcLayout();
- const sal_Int32 nPostItDocPageCount = rData.m_pPostItDoc->GetPageCount();
+ const sal_Int32 nPostItDocPageCount = rData.m_pPostItShell->GetPageCount();
if (nPostItMode == POSTITS_ONLY || nPostItMode == POSTITS_ENDDOC)
{
@@ -1547,6 +1549,7 @@ void SwDoc::UpdatePagesForPrintingWithPostItData(
void SwDoc::CalculatePagePairsForProspectPrinting(
+ const SwRootFrm& rLayout,
/* out */ SwRenderData &rData,
const SwPrintUIOptions &rOptions,
sal_Int32 nDocPageCount )
@@ -1575,11 +1578,10 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
}
StringRangeEnumerator aRange( aPageRange, 1, nDocPageCount, 0 );
- DBG_ASSERT( pLayout, "no layout present" );
- if (!pLayout || aRange.size() <= 0)
+ if ( aRange.size() <= 0)
return;
- const SwPageFrm *pStPage = (SwPageFrm*)pLayout->Lower();
+ const SwPageFrm *pStPage = dynamic_cast<const SwPageFrm*>( rLayout.Lower() );
sal_Int32 i = 0;
for ( i = 1; pStPage && i < nDocPageCount; ++i )
pStPage = (SwPageFrm*)pStPage->GetNext();
@@ -1589,7 +1591,7 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
// currently for prospect printing all pages are valid to be printed
// thus we add them all to the respective map and set for later use
sal_Int32 nPageNum = 0;
- const SwPageFrm *pPageFrm = (SwPageFrm*)pLayout->Lower();
+ const SwPageFrm *pPageFrm = dynamic_cast<const SwPageFrm*>( rLayout.Lower() );
while( pPageFrm && nPageNum < nDocPageCount )
{
DBG_ASSERT( pPageFrm, "Empty page frame. How are we going to print this?" );
@@ -1692,32 +1694,6 @@ void SwDoc::CalculatePagePairsForProspectPrinting(
// thus we are done here.
}
-
-sal_uInt16 SwDoc::GetPageCount() const
-{
- return GetRootFrm() ? GetRootFrm()->GetPageNum() : 0;
-}
-
-const Size SwDoc::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const
-{
- Size aSize;
- if( GetRootFrm() && nPageNum )
- {
- const SwPageFrm* pPage = static_cast<const SwPageFrm*>
- (GetRootFrm()->Lower());
-
- while( --nPageNum && pPage->GetNext() )
- pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
-
- if( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() )
- pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
-
- aSize = pPage->Frm().SSize();
- }
- return aSize;
-}
-
-
/*************************************************************************
* void UpdateDocStat( const SwDocStat& rStat );
*************************************************************************/
@@ -1762,7 +1738,7 @@ void SwDoc::UpdateDocStat( SwDocStat& rStat )
}
}
- rStat.nPage = GetRootFrm() ? GetRootFrm()->GetPageNum() : 0;
+ rStat.nPage = GetCurrentLayout() ? GetCurrentLayout()->GetPageNum() : 0; //swmod 080218
rStat.bModified = FALSE;
SetDocStat( rStat );
@@ -2069,46 +2045,35 @@ BOOL lcl_CheckSmartTagsAgain( const SwNodePtr& rpNd, void* )
void SwDoc::SpellItAgainSam( BOOL bInvalid, BOOL bOnlyWrong, BOOL bSmartTags )
{
- ASSERT( GetRootFrm(), "SpellAgain: Where's my RootFrm?" );
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080307
+ ASSERT( GetCurrentLayout(), "SpellAgain: Where's my RootFrm?" );
if( bInvalid )
{
- SwPageFrm *pPage = (SwPageFrm*)GetRootFrm()->Lower();
- while ( pPage )
- {
- if ( bSmartTags )
- pPage->InvalidateSmartTags();
-
- pPage->InvalidateSpelling();
- pPage = (SwPageFrm*)pPage->GetNext();
- }
- GetRootFrm()->SetNeedGrammarCheck( true );
-
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::AllInvalidateSmartTagsOrSpelling),bSmartTags));//swmod 080305
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::SetNeedGrammarCheck), true) );
if ( bSmartTags )
GetNodes().ForEach( lcl_CheckSmartTagsAgain, &bOnlyWrong );
-
GetNodes().ForEach( lcl_SpellAndGrammarAgain, &bOnlyWrong );
}
- GetRootFrm()->SetIdleFlags();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::SetIdleFlags));//swmod 080307
}
void SwDoc::InvalidateAutoCompleteFlag()
{
- if( GetRootFrm() )
+ SwRootFrm* pTmpRoot = GetCurrentLayout();
+ if( pTmpRoot )
{
- SwPageFrm *pPage = (SwPageFrm*)GetRootFrm()->Lower();
- while ( pPage )
- {
- pPage->InvalidateAutoCompleteWords();
- pPage = (SwPageFrm*)pPage->GetNext();
- }
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllInvalidateAutoCompleteWords));//swmod 080305
for( ULONG nNd = 1, nCnt = GetNodes().Count(); nNd < nCnt; ++nNd )
{
SwTxtNode* pTxtNode = GetNodes()[ nNd ]->GetTxtNode();
if ( pTxtNode ) pTxtNode->SetAutoCompleteWordDirty( true );
}
- GetRootFrm()->SetIdleFlags();
- }
+
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::SetIdleFlags));//swmod 080228
+ } //swmod 080219
}
const SwFmtINetFmt* SwDoc::FindINetAttr( const String& rName ) const
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 0080694722ba..ca3ab77a2d5c 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -1286,7 +1286,7 @@ void _SaveCntntIdx(SwDoc* pDoc,
if( pNode )
{
- SwFrm* pFrm = pNode->GetFrm();
+ SwFrm* pFrm = pNode->getLayoutFrm( pDoc->GetCurrentLayout() );
#if OSL_DEBUG_LEVEL > 1
static BOOL bViaDoc = FALSE;
if( bViaDoc )
diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx
index 85b59cc556df..4ef5891271a3 100644
--- a/sw/source/core/doc/docchart.cxx
+++ b/sw/source/core/doc/docchart.cxx
@@ -132,7 +132,7 @@ IMPL_LINK( SwDoc, DoUpdateAllCharts, Timer *, EMPTYARG )
return 0;
}
-void SwDoc::_UpdateCharts( const SwTable& rTbl, ViewShell& /*rVSh*/ ) const
+void SwDoc::_UpdateCharts( const SwTable& rTbl, ViewShell& rVSh ) const
{
String aName( rTbl.GetFrmFmt()->GetName() );
SwOLENode *pONd;
@@ -144,7 +144,7 @@ void SwDoc::_UpdateCharts( const SwTable& rTbl, ViewShell& /*rVSh*/ ) const
SwFrm* pFrm;
if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) &&
aName.Equals( pONd->GetChartTblName() ) &&
- 0 != ( pFrm = pONd->GetFrm() ) )
+ 0 != ( pFrm = pONd->getLayoutFrm( rVSh.GetLayout() ) ) )
{
SwChartDataProvider *pPCD = GetChartDataProvider();
if (pPCD)
@@ -248,7 +248,7 @@ void SwDoc::CreateChartInternalDataProviders( const SwTable *pTable )
aIdx++;
if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) &&
aName.Equals( pONd->GetChartTblName() ) /* OLE node is chart? */ &&
- 0 != (pONd->GetFrm()) /* chart frame is not hidden */ )
+ 0 != (pONd->getLayoutFrm( GetCurrentLayout() )) /* chart frame is not hidden */ )
{
uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef();
if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) )
diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx
index e567a52085be..87ec511c62dd 100644
--- a/sw/source/core/doc/doccorr.cxx
+++ b/sw/source/core/doc/doccorr.cxx
@@ -439,9 +439,9 @@ void SwDoc::CorrRel(const SwNodeIndex& rOldNode,
SwEditShell* SwDoc::GetEditShell( ViewShell** ppSh ) const
{
// Layout und OLE-Shells sollten vorhanden sein!
- if( pLayout && pLayout->GetCurrShell() )
+ if( pCurrentView )
{
- ViewShell *pSh = pLayout->GetCurrShell(), *pVSh = pSh;
+ register ViewShell *pSh = pCurrentView, *pVSh = pSh;
if( ppSh )
*ppSh = pSh;
@@ -453,7 +453,7 @@ SwEditShell* SwDoc::GetEditShell( ViewShell** ppSh ) const
} while( pVSh != ( pSh = (ViewShell*)pSh->GetNext() ));
}
else if( ppSh )
- *ppSh = 0;
+ *ppSh = 0; //swmod 071029//swmod 071225
return 0;
}
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 0b56578e0536..1f05a93f1abd 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -202,6 +202,7 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
ASSERT( i < aPageDescs.Count(), "PageDescs ueberindiziert." );
SwPageDesc *pDesc = aPageDescs[i];
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
BOOL bDoesUndo = DoesUndo();
if (DoesUndo())
@@ -397,9 +398,12 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
}
}
- if ( (bUseOn || bFollow) && GetRootFrm() )
+ if ( (bUseOn || bFollow) && pTmpRoot)
//Layot benachrichtigen!
- GetRootFrm()->CheckPageDescs( (SwPageFrm*)GetRootFrm()->Lower() );
+ {
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));//swmod 080304
+ }
//Jetzt noch die Seiten-Attribute uebernehmen.
::lcl_DescSetAttr( rChged.GetMaster(), pDesc->GetMaster() );
@@ -447,28 +451,10 @@ void SwDoc::ChgPageDesc( USHORT i, const SwPageDesc &rChged )
|*
|*************************************************************************/
-void lcl_RemoveFrms( SwFrmFmt& rFmt, BOOL& rbFtnsRemoved )
-{
- SwClientIter aIter( rFmt );
- SwFrm *pFrm;
- for( pFrm = (SwFrm*)aIter.First(TYPE(SwFrm)); pFrm;
- pFrm = (SwFrm*)aIter.Next() )
- if ( !rbFtnsRemoved && pFrm->IsPageFrm() &&
- ((SwPageFrm*)pFrm)->IsFtnPage() )
- {
- rFmt.getIDocumentLayoutAccess()->GetRootFrm()->RemoveFtns( 0, FALSE, TRUE );
- rbFtnsRemoved = TRUE;
- }
- else
- {
- pFrm->Cut();
- delete pFrm;
- }
-}
-
// #i7983#
void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
{
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
if (0 == pDel)
return;
@@ -501,8 +487,11 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
pLast == pEndNoteInfo->GetPageDescDep() )
{
aPageDescs[0]->Add( pLast );
- if ( GetRootFrm() )
- GetRootFrm()->CheckFtnPageDescs( !bFtnInf );
+ if ( pTmpRoot )
+ {
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), !bFtnInf));//swmod 080228
+ }
}
}
@@ -515,24 +504,12 @@ void SwDoc::PreDelPageDesc(SwPageDesc * pDel)
//die Attribute wiederum reichen die Meldung an die Absaetze weiter.
//Layot benachrichtigen!
- if( GetRootFrm() ) // ist nicht immer vorhanden!! (Orginizer)
- GetRootFrm()->CheckPageDescs( (SwPageFrm*)GetRootFrm()->Lower() );
+ if( pTmpRoot ) // ist nicht immer vorhanden!! (Orginizer)
+ {
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));//swmod 080228
}
}
-
- if( GetRootFrm() ) // ist nicht immer vorhanden!! (Orginizer)
- {
- //Wenn jetzt noch irgendwelche Seiten auf die FrmFmt'e (Master und Left)
- //Zeigen (z.B. irgendwelche Fussnotenseiten), so muessen die Seiten
- //vernichtet werden.
-
- // Wenn wir auf Endnotenseiten stossen, schmeissen wir alle Fussnoten weg,
- // anders kann die Reihenfolge der Seiten (FollowsPageDescs usw.)
- // nicht garantiert werden.
- BOOL bFtnsRemoved = FALSE;
-
- ::lcl_RemoveFrms( pDel->GetMaster(), bFtnsRemoved );
- ::lcl_RemoveFrms( pDel->GetLeft(), bFtnsRemoved );
}
}
@@ -667,7 +644,7 @@ void SwDoc::PrtDataChanged()
ASSERT( get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) ||
0 != getPrinter( sal_False ), "PrtDataChanged will be called recursive!" )
// <--
-
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
SwWait *pWait = 0;
BOOL bEndAction = FALSE;
@@ -675,16 +652,16 @@ void SwDoc::PrtDataChanged()
GetDocShell()->UpdateFontList();
BOOL bDraw = TRUE;
- if ( GetRootFrm() )
+ if ( pTmpRoot )
{
- ViewShell *pSh = GetRootFrm()->GetCurrShell();
- if( !get(IDocumentSettingAccess::BROWSE_MODE) ||
- ( pSh && pSh->GetViewOptions()->IsPrtFormat() ) )
+ ViewShell *pSh = GetCurrentViewShell();
+ if( !pSh->GetViewOptions()->getBrowseMode() ||
+ pSh->GetViewOptions()->IsPrtFormat() )
{
if ( GetDocShell() )
pWait = new SwWait( *GetDocShell(), TRUE );
- GetRootFrm()->StartAllAction();
+ pTmpRoot->StartAllAction();
bEndAction = TRUE;
bDraw = FALSE;
@@ -695,7 +672,9 @@ void SwDoc::PrtDataChanged()
}
pFntCache->Flush();
- GetRootFrm()->InvalidateAllCntnt();
+
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_SIZE));//swmod 080304
if ( pSh )
{
@@ -704,11 +683,11 @@ void SwDoc::PrtDataChanged()
pSh->InitPrt( pPrt );
pSh = (ViewShell*)pSh->GetNext();
}
- while ( pSh != GetRootFrm()->GetCurrShell() );
+ while ( pSh != GetCurrentViewShell() );
}
}
- }
+ } //swmod 080218
if ( bDraw && pDrawModel )
{
const sal_Bool bTmpAddExtLeading = get(IDocumentSettingAccess::ADD_EXT_LEADING);
@@ -723,7 +702,7 @@ void SwDoc::PrtDataChanged()
PrtOLENotify( TRUE );
if ( bEndAction )
- GetRootFrm()->EndAllAction();
+ pTmpRoot->EndAllAction(); //swmod 080218
delete pWait;
}
@@ -737,18 +716,18 @@ extern SvPtrarr *pGlobalOLEExcludeList;
void SwDoc::PrtOLENotify( BOOL bAll )
{
SwFEShell *pShell = 0;
- if ( GetRootFrm() && GetRootFrm()->GetCurrShell() )
+ if ( GetCurrentViewShell() )
{
- ViewShell *pSh = GetRootFrm()->GetCurrShell();
+ ViewShell *pSh = GetCurrentViewShell();
if ( !pSh->ISA(SwFEShell) )
do
{ pSh = (ViewShell*)pSh->GetNext();
} while ( !pSh->ISA(SwFEShell) &&
- pSh != GetRootFrm()->GetCurrShell() );
+ pSh != GetCurrentViewShell() );
if ( pSh->ISA(SwFEShell) )
pShell = (SwFEShell*)pSh;
- }
+ } //swmod 071107//swmod 071225
if ( !pShell )
{
//Das hat ohne Shell und damit ohne Client keinen Sinn, weil nur darueber
@@ -788,7 +767,7 @@ void SwDoc::PrtOLENotify( BOOL bAll )
{
::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
0, pNodes->Count(), GetDocShell());
- GetRootFrm()->StartAllAction();
+ GetCurrentLayout()->StartAllAction(); //swmod 080218
for( USHORT i = 0; i < pNodes->Count(); ++i )
{
@@ -844,7 +823,7 @@ void SwDoc::PrtOLENotify( BOOL bAll )
}
}
delete pNodes;
- GetRootFrm()->EndAllAction();
+ GetCurrentLayout()->EndAllAction(); //swmod 080218
::EndProgress( GetDocShell() );
}
}
@@ -874,7 +853,7 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
{
::StartProgress( STR_STATSTR_SWGPRTOLENOTIFY,
0, aOLENodes.Count(), GetDocShell());
- GetRootFrm()->StartAllAction();
+ GetCurrentLayout()->StartAllAction(); //swmod 080218
SwMsgPoolItem aMsgHint( RES_UPDATE_ATTR );
for( USHORT i = 0; i < aOLENodes.Count(); ++i )
@@ -905,7 +884,7 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
pOLENd->Modify( &aMsgHint, &aMsgHint );
}
}
- GetRootFrm()->EndAllAction();
+ GetCurrentLayout()->EndAllAction(); //swmod 080218
::EndProgress( GetDocShell() );
}
}
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx
index 1a10428d5a58..312115566374 100644
--- a/sw/source/core/doc/docdraw.cxx
+++ b/sw/source/core/doc/docdraw.cxx
@@ -548,7 +548,7 @@ _ZSortFly::_ZSortFly( const SwFrmFmt* pFrmFmt, const SwFmtAnchor* pFlyAn,
if( RES_FLYFRMFMT == pFmt->Which() )
{
- if( pFmt->getIDocumentLayoutAccess()->GetRootFrm() )
+ if( pFmt->getIDocumentLayoutAccess()->GetCurrentViewShell() ) //swmod 071107//swmod 071225
{
// Schauen, ob es ein SdrObject dafuer gibt
if( aIter.First( TYPE( SwFlyFrm) ) )
@@ -650,7 +650,8 @@ void SwDoc::InitDrawModel()
nInvisibleControls = pDrawModel->GetLayerAdmin().NewLayer( sLayerNm )->GetID();
}
- pDrawModel->InsertPage( pDrawModel->AllocPage( FALSE ) );
+ SdrPage* pMasterPage = pDrawModel->AllocPage( FALSE );
+ pDrawModel->InsertPage( pMasterPage );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "after create DrawDocument" );
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create Spellchecker/Hyphenator" );
@@ -675,10 +676,24 @@ void SwDoc::InitDrawModel()
pDrawModel->SetRefDevice( pRefDev );
pDrawModel->SetNotifyUndoActionHdl( LINK( this, SwDoc, AddDrawUndo ));
- if ( pLayout )
+ if ( pCurrentView )
{
- pLayout->SetDrawPage( pDrawModel->GetPage( 0 ) );
- pLayout->GetDrawPage()->SetSize( pLayout->Frm().SSize() );
+ ViewShell* pViewSh = pCurrentView;
+ do
+ {
+ SwRootFrm* pRoot = pViewSh->GetLayout();
+ if( pRoot && !pRoot->GetDrawPage() )
+ {
+ // Disable "multiple layout" for the moment:
+ // use pMasterPage instead of a new created SdrPage
+ // pDrawModel->AllocPage( FALSE );
+ // pDrawModel->InsertPage( pDrawPage );
+ SdrPage* pDrawPage = pMasterPage;
+ pRoot->SetDrawPage( pDrawPage );
+ pDrawPage->SetSize( pRoot->Frm().SSize() );
+ }
+ pViewSh = (ViewShell*)pViewSh->GetNext();
+ }while( pViewSh != pCurrentView );
}
}
@@ -844,14 +859,14 @@ SdrModel* SwDoc::_MakeDrawModel()
{
ASSERT( !pDrawModel, "_MakeDrawModel: Why?" );
InitDrawModel();
- if ( pLayout && pLayout->GetCurrShell() )
+ if ( pCurrentView )
{
- ViewShell* pTmp = pLayout->GetCurrShell();
+ ViewShell* pTmp = pCurrentView;
do
{
pTmp->MakeDrawView();
pTmp = (ViewShell*) pTmp->GetNext();
- } while ( pTmp != pLayout->GetCurrShell() );
+ } while ( pTmp != pCurrentView );
//Broadcast, damit die FormShell mit der DrawView verbunden werden kann
if( GetDocShell() )
@@ -859,7 +874,7 @@ SdrModel* SwDoc::_MakeDrawModel()
SfxSimpleHint aHnt( SW_BROADCAST_DRAWVIEWS_CREATED );
GetDocShell()->Broadcast( aHnt );
}
- }
+ } //swmod 071029//swmod 071225
return pDrawModel;
}
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index c9ee5b00e181..34cf23aed8ce 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -210,7 +210,7 @@ void _RestFlyInRange( _SaveFlyArr & rArr, const SwNodeIndex& rSttIdx,
pFmt, pFmt->GetDoc()->GetSpzFrmFmts()->Count() );
pFmt->SetFmtAttr( aAnchor );
SwCntntNode* pCNd = aPos.nNode.GetNode().GetCntntNode();
- if( pCNd && pCNd->GetFrm( 0, 0, sal_False ) )
+ if( pCNd && pCNd->getLayoutFrm( pFmt->GetDoc()->GetCurrentLayout(), 0, 0, sal_False ) )
pFmt->MakeFrms();
}
}
@@ -407,7 +407,7 @@ bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd,
}
else
{
- pSrch->DelFrms();
+ pSrch->DelFrms(0);
rFtnArr.Remove( nPos );
if( bSaveFtn )
rSaveArr.Insert( pSrch );
@@ -435,7 +435,7 @@ bool lcl_SaveFtn( const SwNodeIndex& rSttNd, const SwNodeIndex& rEndNd,
}
else
{
- pSrch->DelFrms();
+ pSrch->DelFrms(0);
rFtnArr.Remove( nPos );
if( bSaveFtn )
rSaveArr.Insert( pSrch );
@@ -1881,7 +1881,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
switch( pNd->GetNodeType() )
{
case ND_TEXTNODE:
- if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->GetFrm()) )
+ if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->getLayoutFrm( GetCurrentLayout() )) )
{
// geschutze Cellen/Flys ueberspringen, ausgeblendete
//ebenfalls
@@ -2111,7 +2111,7 @@ sal_Bool lcl_HyphenateNode( const SwNodePtr& rpNd, void* pArgs )
SwHyphArgs *pHyphArgs = (SwHyphArgs*)pArgs;
if( pNode )
{
- SwCntntFrm* pCntFrm = pNode->GetFrm();
+ SwCntntFrm* pCntFrm = pNode->getLayoutFrm( pNode->GetDoc()->GetCurrentLayout() );
if( pCntFrm && !((SwTxtFrm*)pCntFrm)->IsHiddenNow() )
{
sal_uInt16 *pPageSt = pHyphArgs->GetPageSt();
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index ebac34bf3540..7c2da903419d 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -567,7 +567,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
{
// steht im Sonderbereich, wird teuer !!
Point aPt; // den im Layout 1. Frame returnen - Tab.Kopfzeile !!
- pFrm = rTxtNd.GetFrm( &aPt );
+ pFrm = rTxtNd.getLayoutFrm( GetCurrentLayout(), &aPt );
if( pFrm )
{
SwPosition aPos( *pTblNd );
@@ -638,7 +638,7 @@ void SwDoc::UpdateTblFlds( SfxPoolItem* pHt )
if( !pCNd )
pCNd = GetNodes().GoNext( &aCNdIdx );
- if( pCNd && 0 != (pFrm = pCNd->GetFrm( &aPt )) )
+ if( pCNd && 0 != (pFrm = pCNd->getLayoutFrm( GetCurrentLayout(), &aPt )) )
{
SwPosition aPos( *pCNd );
if( GetBodyTxtNode( *this, aPos, *pFrm ) )
@@ -2521,7 +2521,7 @@ void SwDocUpdtFld::GetBodyNode( const SwTxtFld& rTFld, USHORT nFldWhich )
// immer den ersten !! (in Tab-Headline, Kopf-/Fuss )
Point aPt;
- const SwCntntFrm* pFrm = rTxtNd.GetFrm( &aPt, 0, FALSE );
+ const SwCntntFrm* pFrm = rTxtNd.getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, FALSE );
_SetGetExpFld* pNew = NULL;
BOOL bIsInBody = FALSE;
@@ -2587,7 +2587,7 @@ void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd )
// immer den ersten !! (in Tab-Headline, Kopf-/Fuss )
Point aPt;
- const SwCntntFrm* pFrm = pCNd->GetFrm( &aPt, 0, FALSE );
+ const SwCntntFrm* pFrm = pCNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aPt, 0, FALSE );
if( !pFrm )
break;
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 68c525ad74e1..307de496314e 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -175,7 +175,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
const SwFrmFmt* pFlyFmt )
{
Point aRet;
- if( rDoc.GetRootFrm() )
+ if( rDoc.GetCurrentViewShell() ) //swmod 071107//swmod 071225
switch( rAnch.GetAnchorId() )
{
case FLY_AS_CHAR:
@@ -193,7 +193,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
{
const SwPosition *pPos = rAnch.GetCntntAnchor();
const SwCntntNode* pNd = pPos->nNode.GetNode().GetCntntNode();
- const SwFrm* pOld = pNd ? pNd->GetFrm( &aRet, 0, FALSE ) : 0;
+ const SwFrm* pOld = pNd ? pNd->getLayoutFrm( rDoc.GetCurrentLayout(), &aRet, 0, FALSE ) : 0;
if( pOld )
aRet = pOld->Frm().Pos();
}
@@ -213,7 +213,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch,
case FLY_AT_PAGE:
{
USHORT nPgNum = rAnch.GetPageNum();
- const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetRootFrm()->Lower();
+ const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetCurrentLayout()->Lower();
for( USHORT i = 1; (i <= nPgNum) && pPage; ++i,
pPage = (const SwPageFrm*)pPage->GetNext() )
if( i == nPgNum )
@@ -652,7 +652,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
const sal_Bool _bSameOnly,
const sal_Bool _bPosCorr )
{
- ASSERT( GetRootFrm(), "Ohne Layout geht gar nichts" );
+ ASSERT( GetCurrentLayout(), "Ohne Layout geht gar nichts" ); //swmod 080218
if ( !_rMrkList.GetMarkCount() ||
_rMrkList.GetMark( 0 )->GetMarkedSdrObj()->GetUpGroup() )
@@ -750,11 +750,11 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
SwPosition aPos( GetNodes() );
Point aPoint( aPt );
aPoint.X() -= 1;
- GetRootFrm()->GetCrsrOfst( &aPos, aPoint, &aState );
+ GetCurrentLayout()->GetCrsrOfst( &aPos, aPoint, &aState );
// OD 20.06.2003 #108784# - consider that drawing objects
// can be in header/footer. Thus, <GetFrm()> by left-top-corner
pTxtFrm = aPos.nNode.GetNode().
- GetCntntNode()->GetFrm( &aPt, 0, FALSE );
+ GetCntntNode()->getLayoutFrm( GetCurrentLayout(), &aPt, 0, FALSE );
}
const SwFrm *pTmp = ::FindAnchor( pTxtFrm, aPt );
pNewAnchorFrm = pTmp->FindFlyFrm();
@@ -772,7 +772,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
}
case FLY_AT_PAGE:
{
- pNewAnchorFrm = GetRootFrm()->Lower();
+ pNewAnchorFrm = GetCurrentLayout()->Lower();
while ( pNewAnchorFrm && !pNewAnchorFrm->Frm().IsInside( aPt ) )
pNewAnchorFrm = pNewAnchorFrm->GetNext();
if ( !pNewAnchorFrm )
@@ -811,7 +811,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
// es muss ein TextNode gefunden werden, denn nur dort
// ist ein inhaltsgebundenes DrawObjekt zu verankern
SwCrsrMoveState aState( MV_SETONLYTEXT );
- GetRootFrm()->GetCrsrOfst( &aPos, aPoint, &aState );
+ GetCurrentLayout()->GetCrsrOfst( &aPos, aPoint, &aState ); //swmod 080218
}
else
{
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index d971ac0c51fe..810e9fb2310a 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -2171,6 +2171,7 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
BOOL bCopyPoolIds )
{
BOOL bNotifyLayout = FALSE;
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
rDstDesc.SetLandscape( rSrcDesc.GetLandscape() );
rDstDesc.SetNumType( rSrcDesc.GetNumType() );
@@ -2234,9 +2235,11 @@ void SwDoc::CopyPageDesc( const SwPageDesc& rSrcDesc, SwPageDesc& rDstDesc,
else
rDstDesc.GetLeft().SetFmtAttr( rDstDesc.GetMaster().GetFooter() );
- if( bNotifyLayout && GetRootFrm() )
- //Layot benachrichtigen!
- GetRootFrm()->CheckPageDescs( (SwPageFrm*)GetRootFrm()->Lower() );
+ if( bNotifyLayout && pTmpRoot )
+ {
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080225
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));//swmod 080226
+ }
//Wenn sich FussnotenInfo veraendert, so werden die Seiten
//angetriggert.
diff --git a/sw/source/core/doc/docftn.cxx b/sw/source/core/doc/docftn.cxx
index 61bab9fdd525..092b05783977 100644
--- a/sw/source/core/doc/docftn.cxx
+++ b/sw/source/core/doc/docftn.cxx
@@ -255,6 +255,7 @@ SwFtnInfo::SwFtnInfo(SwTxtFmtColl *pFmt) :
void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
{
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
if( !(GetFtnInfo() == rInfo) )
{
const SwFtnInfo &rOld = GetFtnInfo();
@@ -279,15 +280,19 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
*pFtnInfo = rInfo;
- if ( GetRootFrm() )
+ if (pTmpRoot)
{
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080304
if ( bFtnPos )
- GetRootFrm()->RemoveFtns();
+ //pTmpRoot->RemoveFtns();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllRemoveFtns));//swmod 080305
else
{
- GetRootFrm()->UpdateFtnNums();
+ //pTmpRoot->UpdateFtnNums();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFtnNums));//swmod 080304
if ( bFtnDesc )
- GetRootFrm()->CheckFtnPageDescs( FALSE );
+ //pTmpRoot->CheckFtnPageDescs( FALSE );
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), FALSE));//swmod 080304
if ( bExtra )
{
//Fuer die Benachrichtung bezueglich ErgoSum usw. sparen wir uns
@@ -302,7 +307,7 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
}
}
}
- }
+ } //swmod 080219
if( FTNNUM_PAGE != rInfo.eNum )
GetFtnIdxs().UpdateAllFtn();
else if( bFtnChrFmts )
@@ -324,6 +329,7 @@ void SwDoc::SetFtnInfo(const SwFtnInfo& rInfo)
void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
{
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
if( !(GetEndNoteInfo() == rInfo) )
{
if( DoesUndo() )
@@ -345,10 +351,14 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
*pEndNoteInfo = rInfo;
- if ( GetRootFrm() )
+ if ( pTmpRoot )
{
if ( bFtnDesc )
- GetRootFrm()->CheckFtnPageDescs( TRUE );
+ //pTmpRoot->CheckFtnPageDescs( TRUE );
+ {
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::CheckFtnPageDescs), TRUE));//swmod 080304
+ }
if ( bExtra )
{
//Fuer die Benachrichtung bezueglich ErgoSum usw. sparen wir uns
@@ -362,7 +372,7 @@ void SwDoc::SetEndNoteInfo(const SwEndNoteInfo& rInfo)
pTxtFtn->SetNumber( rFtn.GetNumber(), &rFtn.GetNumStr());
}
}
- }
+ } //swmod 080219
if( bNumChg )
GetFtnIdxs().UpdateAllFtn();
else if( bFtnChrFmts )
@@ -387,6 +397,7 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
sal_uInt16 nNumber, bool bIsEndNote )
{
SwFtnIdxs& rFtnArr = GetFtnIdxs();
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
const SwPosition* pStt = rPam.Start(), *pEnd = rPam.End();
const ULONG nSttNd = pStt->nNode.GetIndex();
@@ -485,8 +496,12 @@ bool SwDoc::SetCurFtn( const SwPaM& rPam, const String& rNumStr,
if ( !bTypeChgd )
rFtnArr.UpdateAllFtn();
}
- else if( GetRootFrm() )
- GetRootFrm()->UpdateFtnNums();
+ else if( pTmpRoot )
+ //
+ {
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFtnNums));
+ } //swmod 080304pTmpRoot->UpdateFtnNums(); //swmod 080219
SetModified();
}
else
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index ceb7d6e3463c..63a278cdc0c7 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -726,8 +726,8 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos,
}
// Frames anlegen
- if( GetRootFrm() )
- pFmt->MakeFrms(); // ???
+ if( GetCurrentViewShell() )
+ pFmt->MakeFrms(); // ??? //swmod 071108//swmod 071225
if( DoesUndo() )
{
@@ -1003,7 +1003,7 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg,
SwDrawContact* pContact = new SwDrawContact( pFmt, &rDrawObj );
// ggfs. Frames anlegen
- if( GetRootFrm() )
+ if( GetCurrentViewShell() )
{
pFmt->MakeFrms();
// --> OD 2005-02-09 #i42319# - follow-up of #i35635#
@@ -1119,11 +1119,11 @@ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts,
// kein Layout oder nur ein Teil, dann wars das
// Seitenbezogen Flys nur, wenn vollstaendig "gewuenscht" wird !
- if( !GetRootFrm() || pCmpRange )
+ if( !GetCurrentViewShell() || pCmpRange ) //swmod 071108//swmod 071225
return;
pFPos = 0;
- SwPageFrm *pPage = (SwPageFrm*)GetRootFrm()->GetLower();
+ SwPageFrm *pPage = (SwPageFrm*)GetCurrentLayout()->GetLower(); //swmod 080218
while( pPage )
{
if( pPage->GetSortedObjs() )
@@ -1860,11 +1860,12 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
pModLogFile = new ::rtl::Logfile( "First DoIdleJobs" );
#endif
- if( GetRootFrm() && GetRootFrm()->GetCurrShell() &&
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
+ if( pTmpRoot &&
!SfxProgress::GetActiveProgress( pDocShell ) )
{
ViewShell *pSh, *pStartSh;
- pSh = pStartSh = GetRootFrm()->GetCurrShell();
+ pSh = pStartSh = GetCurrentViewShell();
do {
if( pSh->ActionPend() )
{
@@ -1875,10 +1876,9 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
pSh = (ViewShell*)pSh->GetNext();
} while( pSh != pStartSh );
- if (GetRootFrm()->IsNeedGrammarCheck())
+ if( pTmpRoot->IsNeedGrammarCheck() )
{
BOOL bIsOnlineSpell = pSh->GetViewOptions()->IsOnlineSpell();
-
sal_Bool bIsAutoGrammar = sal_False;
SvtLinguConfig().GetProperty( ::rtl::OUString::createFromAscii(
UPN_IS_GRAMMAR_AUTO ) ) >>= bIsAutoGrammar;
@@ -1886,12 +1886,20 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
if (bIsOnlineSpell && bIsAutoGrammar)
StartGrammarChecking( *this );
}
-
- sal_uInt16 nFldUpdFlag;
- if( GetRootFrm()->IsIdleFormat() )
- GetRootFrm()->GetCurrShell()->LayoutIdle();
- else if( ( AUTOUPD_FIELD_ONLY ==
- ( nFldUpdFlag = static_cast<sal_uInt16>(getFieldUpdateFlags(true)) )
+ SwFldUpdateFlags nFldUpdFlag;
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080320
+ std::set<SwRootFrm*>::iterator pLayIter = aAllLayouts.begin();
+ for ( ;pLayIter != aAllLayouts.end();pLayIter++ )
+ {
+ if ((*pLayIter)->IsIdleFormat())
+ {
+ (*pLayIter)->GetCurrShell()->LayoutIdle();
+ break;
+ }
+ }
+ BOOL bAllValid = pLayIter == aAllLayouts.end() ? 1 : 0;
+ if( bAllValid && ( AUTOUPD_FIELD_ONLY ==
+ ( nFldUpdFlag = getFieldUpdateFlags(true) )
|| AUTOUPD_FIELD_AND_CHARTS == nFldUpdFlag ) &&
GetUpdtFlds().IsFieldsDirty() &&
!GetUpdtFlds().IsInUpdateFlds() &&
@@ -1903,7 +1911,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
// chaos::Action-Klammerung!
GetUpdtFlds().SetInUpdateFlds( sal_True );
- GetRootFrm()->StartAllAction();
+ pTmpRoot->StartAllAction();
// no jump on update of fields #i85168#
const sal_Bool bOldLockView = pStartSh->IsViewLocked();
@@ -1914,14 +1922,14 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
UpdateTblFlds(NULL); // Tabellen
UpdateRefFlds(NULL); // Referenzen
- GetRootFrm()->EndAllAction();
+ pTmpRoot->EndAllAction();
pStartSh->LockView( bOldLockView );
GetUpdtFlds().SetInUpdateFlds( sal_False );
GetUpdtFlds().SetFieldsDirty( sal_False );
}
- }
+ } //swmod 080219
#ifdef TIMELOG
if( pModLogFile && 1 != (long)pModLogFile )
delete pModLogFile, ((long&)pModLogFile) = 1;
@@ -1934,7 +1942,7 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer )
IMPL_STATIC_LINK( SwDoc, BackgroundDone, SvxBrushItem*, EMPTYARG )
{
ViewShell *pSh, *pStartSh;
- pSh = pStartSh = pThis->GetRootFrm()->GetCurrShell();
+ pSh = pStartSh = pThis->GetCurrentViewShell(); //swmod 071108//swmod 071225
if( pStartSh )
do {
if( pSh->GetWin() )
@@ -2171,9 +2179,9 @@ sal_Bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const
// Redlines auch an Start- und Endnodes haengen, muss der Index nicht
// unbedingt der eines Content-Nodes sein.
SwNode* pNd = &rIdx.GetNode();
- if( pNd->IsCntntNode() && pLayout )
+ if( pNd->IsCntntNode() && pCurrentView )//swmod 071029//swmod 071225
{
- const SwFrm *pFrm = pNd->GetCntntNode()->GetFrm();
+ const SwFrm *pFrm = pNd->GetCntntNode()->getLayoutFrm( GetCurrentLayout() );
if( pFrm )
{
const SwFrm *pUp = pFrm->GetUpper();
@@ -2286,9 +2294,36 @@ sal_Bool SwDoc::IsInVerticalText( const SwPosition& rPos, const Point* pPt ) con
return FRMDIR_VERT_TOP_RIGHT == nDir || FRMDIR_VERT_TOP_LEFT == nDir;
}
-const SwRootFrm* SwDoc::GetRootFrm() const { return pLayout; }
-SwRootFrm* SwDoc::GetRootFrm() { return pLayout; }
-void SwDoc::SetRootFrm( SwRootFrm* pNew ) { pLayout = pNew; }
+//const SwRootFrm* SwDoc::GetRootFrm() const { return pLayout; }
+//SwRootFrm* SwDoc::GetRootFrm() { return pLayout; }
+//void SwDoc::SetRootFrm( SwRootFrm* pNew ) { pLayout = pNew; } //swmod 071029//swmod 071225
+void SwDoc::SetCurrentViewShell( ViewShell* pNew ) { pCurrentView = pNew; }//swmod 071227
SwLayouter* SwDoc::GetLayouter() { return pLayouter; }
const SwLayouter* SwDoc::GetLayouter() const { return pLayouter; }
void SwDoc::SetLayouter( SwLayouter* pNew ) { pLayouter = pNew; }
+const ViewShell *SwDoc::GetCurrentViewShell() const { return pCurrentView;} //swmod 080219
+ViewShell *SwDoc::GetCurrentViewShell() { return pCurrentView;} //swmod 080219 It must be able to communicate to a ViewShell.This is going to be removerd later.
+const SwRootFrm *SwDoc::GetCurrentLayout() const {
+ if(GetCurrentViewShell())
+ return GetCurrentViewShell()->GetLayout();
+ return 0;
+}
+SwRootFrm *SwDoc::GetCurrentLayout(){
+
+ if(GetCurrentViewShell())
+ return GetCurrentViewShell()->GetLayout();
+ return 0;
+}
+std::set<SwRootFrm*> SwDoc::GetAllLayouts(){
+ std::set<SwRootFrm*> aAllLayouts;
+ ViewShell *pStart = GetCurrentViewShell();
+ ViewShell *pTemp = pStart;
+ do {
+ if (pTemp->GetLayout()) {
+ aAllLayouts.insert(pTemp->GetLayout());
+ pTemp = (ViewShell*)pTemp->GetNext();
+ }
+ } while(pTemp!=pStart);
+ return aAllLayouts;
+}//swmod 070825
+
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index fe4044dd58ac..44697c7d8a38 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -238,7 +238,8 @@ SwDoc::SwDoc() :
pGrfFmtCollTbl( new SwGrfFmtColls() ),
pTOXTypes( new SwTOXTypes() ),
pDefTOXBases( new SwDefTOXBase_Impl() ),
- pLayout( 0 ), // Rootframe des spezifischen Layouts.
+ //pLayout( 0 ), // Rootframe des spezifischen Layouts. //swmod 071029
+ pCurrentView( 0 ), //swmod 071225
pDrawModel( 0 ),
pUndos( new SwUndos( 0, 20 ) ),
pUpdtFlds( new SwDocUpdtFld() ),
@@ -301,6 +302,7 @@ SwDoc::SwDoc() :
mbColumnSelection( false ),
// i#78591#
mbProtectForm(false),
+ mbLastBrowseMode( false ),
n32DummyCompatabilityOptions1(0),
n32DummyCompatabilityOptions2(0),
mbStartIdleTimer(sal_False)
@@ -317,7 +319,7 @@ SwDoc::SwDoc() :
mbNewDoc =
mbCopyIsMove =
mbNoDrawUndoObj =
- mbBrowseMode =
+ //mbBrowseMode =//swmod 080130
mbInReading =
mbInXMLImport =
mbUpdateTOX =
@@ -526,7 +528,7 @@ SwDoc::~SwDoc()
// damit die Fussnotenattribute die Fussnotennodes in Frieden lassen.
mbDtor = TRUE;
- DELETEZ( pLayout );
+ //DELETEZ( pCurrentView ); //swmod 080110//test if i can commit
delete pRedlineTbl;
delete pUnoCrsrTbl;
@@ -829,7 +831,7 @@ void SwDoc::ClearDoc()
// den ersten immer wieder neu anlegen (ohne Attribute/Vorlagen/...)
SwTxtNode* pFirstNd = GetNodes().MakeTxtNode( aSttIdx, pDfltTxtFmtColl );
- if( pLayout )
+ if( pCurrentView ) //swmod 071029//swmod 071225
{
// set the layout to the dummy pagedesc
pFirstNd->SetAttr( SwFmtPageDesc( pDummyPgDsc ));
@@ -881,14 +883,14 @@ void SwDoc::ClearDoc()
pGrfFmtCollTbl->DeleteAndDestroy( 1, pGrfFmtCollTbl->Count()-1 );
pCharFmtTbl->DeleteAndDestroy( 1, pCharFmtTbl->Count()-1 );
- if( pLayout )
+ if( pCurrentView )
{
// search the FrameFormat of the root frm. This is not allowed to delete
- pFrmFmtTbl->Remove( pFrmFmtTbl->GetPos( pLayout->GetFmt() ) );
+ pFrmFmtTbl->Remove( pFrmFmtTbl->GetPos( pCurrentView->GetLayout()->GetFmt() ) );
pFrmFmtTbl->DeleteAndDestroy( 1, pFrmFmtTbl->Count()-1 );
- pFrmFmtTbl->Insert( pLayout->GetFmt(), pFrmFmtTbl->Count() );
+ pFrmFmtTbl->Insert( pCurrentView->GetLayout()->GetFmt(), pFrmFmtTbl->Count() );
}
- else
+ else //swmod 071029//swmod 071225
pFrmFmtTbl->DeleteAndDestroy( 1, pFrmFmtTbl->Count()-1 );
xForbiddenCharsTable.unbind();
@@ -991,7 +993,7 @@ void SwDoc::UpdateLinks( BOOL bUI )
SfxMedium* pMedium = GetDocShell()->GetMedium();
SfxFrame* pFrm = pMedium ? pMedium->GetLoadTargetFrame() : 0;
Window* pDlgParent = pFrm ? &pFrm->GetWindow() : 0;
- if( GetRootFrm() && !GetEditShell( &pVSh ) && !pVSh )
+ if( GetCurrentViewShell() && !GetEditShell( &pVSh ) && !pVSh ) //swmod 071108//swmod 071225
{
ViewShell aVSh( *this, 0, 0 );
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 71dc70106245..861162b6d486 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -2754,8 +2754,8 @@ void SwRedlineTbl::Remove( USHORT nP, USHORT nL )
_SwRedlineTbl::Remove( nP, nL );
ViewShell* pSh;
- if( pDoc && !pDoc->IsInDtor() && pDoc->GetRootFrm() &&
- 0 != ( pSh = pDoc->GetRootFrm()->GetCurrShell()) )
+ if( pDoc && !pDoc->IsInDtor() &&
+ 0 != ( pSh = pDoc->GetCurrentViewShell()) ) //swmod 071108//swmod 071225
pSh->InvalidateWindows( SwRect( 0, 0, LONG_MAX, LONG_MAX ) );
}
@@ -2768,8 +2768,8 @@ void SwRedlineTbl::DeleteAndDestroy( USHORT nP, USHORT nL )
_SwRedlineTbl::DeleteAndDestroy( nP, nL );
ViewShell* pSh;
- if( pDoc && !pDoc->IsInDtor() && pDoc->GetRootFrm() &&
- 0 != ( pSh = pDoc->GetRootFrm()->GetCurrShell()) )
+ if( pDoc && !pDoc->IsInDtor() &&
+ 0 != ( pSh = pDoc->GetCurrentViewShell() ) ) //swmod 071108//swmod 071225
pSh->InvalidateWindows( SwRect( 0, 0, LONG_MAX, LONG_MAX ) );
}
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 58b3e084cf7a..dd8485ece497 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -271,7 +271,7 @@ const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
if( pTOXMark != &rCurTOXMark &&
0 != ( pMark = pTOXMark->GetTxtTOXMark()) &&
0 != ( pTOXSrc = pMark->GetpTxtNd() ) &&
- 0 != ( pCFrm = pTOXSrc->GetFrm( &aPt, 0, FALSE )) &&
+ 0 != ( pCFrm = pTOXSrc->getLayoutFrm( GetCurrentLayout(), &aPt, 0, FALSE )) &&
( bInReadOnly || !pCFrm->IsProtected() ))
{
CompareNodeCntnt aAbsNew( pTOXSrc->GetIndex(), *pMark->GetStart() );
@@ -810,7 +810,7 @@ BOOL SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, BOOL bAtStart ) const
--------------------------------------------------------------------*/
void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
- const bool _bNewTOX )
+ const bool _bNewTOX )//swmodtest 080307
{
const SwSectionNode* pSectNd;
if( !SwTOXBase::GetRegisteredIn()->GetDepends() ||
@@ -1090,9 +1090,13 @@ sNm.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "_Head" ));
pDoc->GetNodes().Delete( aInsPos, 1 );
aN2L.RestoreUpperFrms( pDoc->GetNodes(), nIdx, nIdx + 1 );
- if(pDoc->GetRootFrm())
- SwFrm::CheckPageDescs( (SwPageFrm*)pDoc->GetRootFrm()->Lower() );
-
+ std::set<SwRootFrm*> aAllLayouts = pDoc->GetAllLayouts();
+ for ( std::set<SwRootFrm*>::iterator pLayoutIter = aAllLayouts.begin(); pLayoutIter != aAllLayouts.end(); pLayoutIter++)
+ {
+ SwFrm::CheckPageDescs( (SwPageFrm*)(*pLayoutIter)->Lower() );
+ }//swmod 080310
+ //if(pDoc->GetCurrentLayout())
+ //SwFrm::CheckPageDescs( (SwPageFrm*)pDoc->GetCurrentLayout()->Lower() ); //swmod 080218
SetProtect( SwTOXBase::IsProtected() );
}
@@ -1226,7 +1230,7 @@ void SwTOXBaseSection::UpdateMarks( const SwTOXInternational& rIntl,
// if selected use marks from the same chapter only
if( pTOXSrc->GetNodes().IsDocNodes() &&
pTOXSrc->GetTxt().Len() && pTOXSrc->GetDepends() &&
- pTOXSrc->GetFrm() &&
+ pTOXSrc->getLayoutFrm( pDoc->GetCurrentLayout() ) &&
(!IsFromChapter() || ::lcl_FindChapterNode( *pTOXSrc, 0 ) == pOwnChapterNode ) &&
!pTOXSrc->HasHiddenParaField() &&
!SwScriptInfo::IsInHiddenRange( *pTOXSrc, *pTxtMark->GetStart() ) )
@@ -1290,7 +1294,7 @@ void SwTOXBaseSection::UpdateOutline( const SwTxtNode* pOwnChapterNode )
if( pTxtNd && pTxtNd->Len() && pTxtNd->GetDepends() &&
//USHORT(pTxtNd->GetTxtColl()->GetOutlineLevel()+1) <= GetLevel() && //#outline level,zhaojianwei
USHORT( pTxtNd->GetAttrOutlineLevel()) <= GetLevel() && //<-end,zhaojianwei
- pTxtNd->GetFrm() &&
+ pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() ) &&
!pTxtNd->HasHiddenParaField() &&
!pTxtNd->HasHiddenCharAttribute( true ) &&
( !IsFromChapter() ||
@@ -1332,7 +1336,7 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode )
{
::SetProgressState( 0, pDoc->GetDocShell() );
- if( pTxtNd->GetTxt().Len() && pTxtNd->GetFrm() &&
+ if( pTxtNd->GetTxt().Len() && pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() ) &&
pTxtNd->GetNodes().IsDocNodes() &&
( !IsFromChapter() || pOwnChapterNode ==
::lcl_FindChapterNode( *pTxtNd, 0 ) ) )
@@ -1365,7 +1369,7 @@ void SwTOXBaseSection::UpdateSequence( const SwTxtNode* pOwnChapterNode )
const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode();
::SetProgressState( 0, pDoc->GetDocShell() );
- if( rTxtNode.GetTxt().Len() && rTxtNode.GetFrm() &&
+ if( rTxtNode.GetTxt().Len() && rTxtNode.getLayoutFrm( pDoc->GetCurrentLayout() ) &&
rTxtNode.GetNodes().IsDocNodes() &&
( !IsFromChapter() ||
::lcl_FindChapterNode( rTxtNode, 0 ) == pOwnChapterNode ) )
@@ -1408,12 +1412,12 @@ void SwTOXBaseSection::UpdateAuthorities( const SwTOXInternational& rIntl )
// const SwTxtNode* pChapterCompareNode = 0;
- if( rTxtNode.GetTxt().Len() && rTxtNode.GetFrm() &&
+ if( rTxtNode.GetTxt().Len() && rTxtNode.getLayoutFrm( pDoc->GetCurrentLayout() ) &&
rTxtNode.GetNodes().IsDocNodes() /*&&
(!IsFromChapter() || pChapterCompareNode == pOwnChapterNode) */)
{
//#106485# the body node has to be used!
- SwCntntFrm *pFrm = rTxtNode.GetFrm();
+ SwCntntFrm *pFrm = rTxtNode.getLayoutFrm( pDoc->GetCurrentLayout() );
SwPosition aFldPos(rTxtNode);
const SwTxtNode* pTxtNode = 0;
if(pFrm && !pFrm->IsInDocBody())
@@ -1562,7 +1566,7 @@ void SwTOXBaseSection::UpdateCntnt( SwTOXElement eMyType,
}
}
- if( pCNd->GetFrm() && ( !IsFromChapter() ||
+ if( pCNd->getLayoutFrm( pDoc->GetCurrentLayout() ) && ( !IsFromChapter() ||
::lcl_FindChapterNode( *pCNd, 0 ) == pOwnChapterNode ))
{
SwTOXPara * pNew = new SwTOXPara( *pCNd, eMyType,
@@ -1603,7 +1607,7 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode )
while( 0 != ( pCNd = rNds.GoNext( &aCntntIdx ) ) &&
aCntntIdx.GetIndex() < pTblNd->EndOfSectionIndex() )
{
- if( pCNd->GetFrm() && (!IsFromChapter() ||
+ if( pCNd->getLayoutFrm( pDoc->GetCurrentLayout() ) && (!IsFromChapter() ||
::lcl_FindChapterNode( *pCNd, 0 ) == pOwnChapterNode ))
{
SwTOXTable * pNew = new SwTOXTable( *pCNd );
@@ -1744,7 +1748,7 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx,
long nRightMargin;
if( pPageDesc )
{
- const SwFrm* pFrm = pTOXNd->GetFrm( 0, 0, TRUE );
+ const SwFrm* pFrm = pTOXNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0, 0, TRUE );
if( !pFrm || 0 == ( pFrm = pFrm->FindPageFrm() ) ||
pPageDesc != ((SwPageFrm*)pFrm)->GetPageDesc() )
// dann muss man ueber den PageDesc gehen
@@ -1836,7 +1840,7 @@ void SwTOXBaseSection::GenerateText( USHORT nArrayIdx,
pTOXSource->pNd->IsCntntNode() )
// <--
{
- const SwCntntFrm* pFrm = pTOXSource->pNd->GetFrm();
+ const SwCntntFrm* pFrm = pTOXSource->pNd->getLayoutFrm( pDoc->GetCurrentLayout() );
if( pFrm )
{
SwChapterFieldType aFldTyp;
@@ -2011,7 +2015,7 @@ void SwTOXBaseSection::UpdatePageNum()
SwTOXSource& rTOXSource = pSortBase->aTOXSources[j];
if( rTOXSource.pNd )
{
- SwCntntFrm* pFrm = rTOXSource.pNd->GetFrm();
+ SwCntntFrm* pFrm = rTOXSource.pNd->getLayoutFrm( pDoc->GetCurrentLayout() );
ASSERT( pFrm || pDoc->IsUpdateTOX(), "TOX, no Frame found");
if( !pFrm )
continue;
diff --git a/sw/source/core/doc/ftnidx.cxx b/sw/source/core/doc/ftnidx.cxx
index 3def8b968a60..8ffcac046be4 100644
--- a/sw/source/core/doc/ftnidx.cxx
+++ b/sw/source/core/doc/ftnidx.cxx
@@ -220,6 +220,8 @@ void SwFtnIdxs::UpdateAllFtn()
SwUpdFtnEndNtAtEnd aNumArr;
+ SwRootFrm* pTmpRoot = pDoc->GetCurrentLayout();//swmod 080305
+ std::set<SwRootFrm*> aAllLayouts = pDoc->GetAllLayouts();
//Fuer normale Fussnoten werden Chapter- und Dokumentweise Nummerierung
//getrennt behandelt. Fuer Endnoten gibt es nur die Dokumentweise
//Nummerierung.
@@ -292,8 +294,10 @@ void SwFtnIdxs::UpdateAllFtn()
}
}
- if( pDoc->GetRootFrm() && FTNNUM_PAGE == rFtnInfo.eNum )
- pDoc->GetRootFrm()->UpdateFtnNums();
+ //if( pDoc->GetCurrentLayout() && FTNNUM_PAGE == rFtnInfo.eNum )
+ // pDoc->GetCurrentLayout()->UpdateFtnNums();
+ if( pTmpRoot && FTNNUM_PAGE == rFtnInfo.eNum )
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::UpdateFtnNums));//swmod 0
}
SwTxtFtn* SwFtnIdxs::SeekEntry( const SwNodeIndex& rPos, USHORT* pFndPos ) const
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index e762de8489e3..9f8d9288ea9c 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -54,6 +54,7 @@
#include "poolfmt.hxx"
#include "viewsh.hxx"
#include "tabfrm.hxx"
+#include "viewopt.hxx"
#include "htmltbl.hxx"
#include "ndindex.hxx"
@@ -369,7 +370,7 @@ USHORT SwHTMLTableLayout::GetBrowseWidthByVisArea( const SwDoc& rDoc )
USHORT SwHTMLTableLayout::GetBrowseWidth( const SwDoc& rDoc )
{
// Wenn ein Layout da ist, koennen wir die Breite dort herholen.
- const SwRootFrm *pRootFrm = rDoc.GetRootFrm();
+ const SwRootFrm *pRootFrm = rDoc.GetCurrentLayout(); //swmod 080218
if( pRootFrm )
{
const SwFrm *pPageFrm = pRootFrm->GetLower();
@@ -1811,16 +1812,16 @@ void SwHTMLTableLayout::_Resize( USHORT nAbsAvail, BOOL bRecalc )
if( bRecalc )
AutoLayoutPass1();
- SwRootFrm *pRoot = (SwRootFrm*)GetDoc()->GetRootFrm();
+ SwRootFrm *pRoot = (SwRootFrm*)GetDoc()->GetCurrentViewShell()->GetLayout();
if ( pRoot && pRoot->IsCallbackActionEnabled() )
- pRoot->StartAllAction();
+ pRoot->StartAllAction(); //swmod 071108//swmod 071225
// Sonst koennen die Breiten gesetzt werden, wobei zuvor aber jewils
// noch der Pass 2 laufen muss.
SetWidths( TRUE, nAbsAvail );
if ( pRoot && pRoot->IsCallbackActionEnabled() )
- pRoot->EndAllAction( TRUE ); //True per VirDev (Browsen ruhiger)
+ pRoot->EndAllAction( TRUE ); //True per VirDev (Browsen ruhiger) //swmod 071108//swmod 071225
}
IMPL_STATIC_LINK( SwHTMLTableLayout, DelayedResize_Impl, void*, EMPTYARG )
@@ -1857,7 +1858,7 @@ BOOL SwHTMLTableLayout::Resize( USHORT nAbsAvail, BOOL bRecalc,
// und nicht die der VisArea uebergeben. Wenn wir nicht in einem Rahmen
// stehen, muss die Tabelle allerdings fuer die VisArea berechnet werden,
// weil sond die Umschaltung von relativ nach absolut nicht funktioniert.
- if( pDoc->GetRootFrm() && pDoc->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if( pDoc->GetCurrentViewShell() && pDoc->GetCurrentViewShell()->GetViewOptions()->getBrowseMode() )
{
USHORT nVisAreaWidth = GetBrowseWidthByVisArea( *pDoc );
if( nVisAreaWidth < nAbsAvail && !FindFlyFrmFmt() )
diff --git a/sw/source/core/doc/lineinfo.cxx b/sw/source/core/doc/lineinfo.cxx
index c0c3e296f7b1..7e2d6164c637 100644
--- a/sw/source/core/doc/lineinfo.cxx
+++ b/sw/source/core/doc/lineinfo.cxx
@@ -36,19 +36,22 @@
#include "poolfmt.hxx"
#include "rootfrm.hxx"
#include "viewsh.hxx"
-
+#include <set>
void SwDoc::SetLineNumberInfo( const SwLineNumberInfo &rNew )
{
- if ( GetRootFrm() &&
+ SwRootFrm* pTmpRoot = GetCurrentLayout();//swmod 080219
+ if ( pTmpRoot &&
(rNew.IsCountBlankLines() != pLineNumberInfo->IsCountBlankLines() ||
rNew.IsRestartEachPage() != pLineNumberInfo->IsRestartEachPage()) )
{
- GetRootFrm()->StartAllAction();
+ std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();//swmod 080225
+ pTmpRoot->StartAllAction();
// FME 2007-08-14 #i80120# Invalidate size, because ChgThisLines()
// is only (onny may only be) called by the formatting routines
- GetRootFrm()->InvalidateAllCntnt( INV_LINENUM | INV_SIZE );
- GetRootFrm()->EndAllAction();
- }
+ //pTmpRoot->InvalidateAllCntnt( INV_LINENUM | INV_SIZE );
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::bind2nd(std::mem_fun(&SwRootFrm::InvalidateAllCntnt), INV_LINENUM | INV_SIZE));//swmod 080226
+ pTmpRoot->EndAllAction();
+ } //swmod 080219
*pLineNumberInfo = rNew;
SetModified();
}
@@ -143,11 +146,13 @@ void SwLineNumberInfo::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
{
SwClient::Modify( pOld, pNew );
SwDoc *pDoc = ((SwCharFmt*)GetRegisteredIn())->GetDoc();
- SwRootFrm* pRoot = pDoc->GetRootFrm();
- if( pRoot && pRoot->GetCurrShell() )
+ SwRootFrm* pRoot = pDoc->GetCurrentLayout();
+ if( pRoot )
{
pRoot->StartAllAction();
- pRoot->GetCurrShell()->AddPaintRect( pRoot->Frm() );
+ std::set<SwRootFrm*> aAllLayouts = pDoc->GetAllLayouts();
+ std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllAddPaintRect));//swmod 080305
+ //pRoot->GetCurrShell()->AddPaintRect( pRoot->Frm() );
pRoot->EndAllAction();
}
}
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index bb10e9c1941b..e3ec73f17a1e 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -162,8 +162,8 @@ void lcl_PaintReplacement( const SwRect &rRect, const String &rText,
*************************************************************************/
-SwNoTxtFrm::SwNoTxtFrm(SwNoTxtNode * const pNode)
- : SwCntntFrm(pNode)
+SwNoTxtFrm::SwNoTxtFrm(SwNoTxtNode * const pNode, SwFrm* pSib )
+ : SwCntntFrm( pNode, pSib )
{
InitCtor();
}
@@ -192,9 +192,9 @@ void SwNoTxtFrm::InitCtor()
*************************************************************************/
-SwCntntFrm *SwNoTxtNode::MakeFrm()
+SwCntntFrm *SwNoTxtNode::MakeFrm( SwFrm* pSib )
{
- return new SwNoTxtFrm(this);
+ return new SwNoTxtFrm(this, pSib);
}
/*************************************************************************
@@ -247,7 +247,7 @@ void lcl_ClearArea( const SwFrm &rFrm,
{
// OD 2004-04-23 #116347#
rOut.Push( PUSH_FILLCOLOR|PUSH_LINECOLOR );
- rOut.SetFillColor( rFrm.GetShell()->Imp()->GetRetoucheColor());
+ rOut.SetFillColor( rFrm.getRootFrm()->GetCurrShell()->Imp()->GetRetoucheColor());
rOut.SetLineColor();
for( USHORT i = 0; i < aRegion.Count(); ++i )
rOut.DrawRect( aRegion[i].SVRect() );
@@ -271,7 +271,7 @@ void SwNoTxtFrm::Paint( const SwRect &rRect, const SwPrtOptions * /*pPrintData*/
if ( Frm().IsEmpty() )
return;
- const ViewShell* pSh = GetShell();
+ const ViewShell* pSh = getRootFrm()->GetCurrShell();
if( !pSh->GetViewOptions()->IsGraphic() )
{
StopAnimation();
@@ -826,7 +826,7 @@ void lcl_correctlyAlignRect( SwRect& rAlignedGrfArea, const SwRect& rInArea, Out
/// OD 25.09.2002 #99739# - pixel-align coordinations for drawing graphic.
void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) const
{
- ViewShell* pShell = GetShell();
+ ViewShell* pShell = getRootFrm()->GetCurrShell();
SwNoTxtNode& rNoTNd = *(SwNoTxtNode*)GetNode();
SwGrfNode* pGrfNd = rNoTNd.GetGrfNode();
@@ -1068,7 +1068,7 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea ) cons
BOOL SwNoTxtFrm::IsTransparent() const
{
- const ViewShell* pSh = GetShell();
+ const ViewShell* pSh = getRootFrm()->GetCurrShell();
if ( !pSh || !pSh->GetViewOptions()->IsGraphic() )
return TRUE;
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index e5cfc065db2a..fd7f0ad6ed7b 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -1294,7 +1294,7 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId )
case RES_POOLFRM_FRAME:
{
- if ( get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( get(IDocumentSettingAccess::HTML_MODE) )
{
aSet.Put( SwFmtAnchor( FLY_AS_CHAR ));
aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::LINE_CENTER, text::RelOrientation::PRINT_AREA ) );
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index e40b82d673b7..aed1ceef2772 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -341,7 +341,7 @@ SwDataChanged::~SwDataChanged()
{
// JP 09.04.96: nur wenn das Layout vorhanden ist ( also waehrend der
// Eingabe)
- if( pDoc->GetRootFrm() )
+ if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
const ::sfx2::SvLinkSources& rServers = pDoc->GetLinkManager().GetServers();
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index 0bea7c73f65b..ac9e6957707b 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -54,7 +54,7 @@ SwURLStateChanged::~SwURLStateChanged()
void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
{
- if( rHint.ISA( INetURLHistoryHint ) && pDoc->GetRootFrm() )
+ if( rHint.ISA( INetURLHistoryHint ) && pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
// diese URL wurde veraendert:
const INetURLObject* pIURL = ((INetURLHistoryHint&)rHint).GetObject();
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 306560272c6f..651533c618ca 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -802,7 +802,7 @@ void lcl_DeleteFtn( SwSectionNode *pNd, ULONG nStt, ULONG nEnd )
// Werden die Nodes nicht geloescht mussen sie bei den Seiten
// abmeldet (Frms loeschen) werden, denn sonst bleiben sie
// stehen (Undo loescht sie nicht!)
- pSrch->DelFrms();
+ pSrch->DelFrms(0);
++nPos;
}
@@ -812,7 +812,7 @@ void lcl_DeleteFtn( SwSectionNode *pNd, ULONG nStt, ULONG nEnd )
// Werden die Nodes nicht geloescht mussen sie bei den Seiten
// abmeldet (Frms loeschen) werden, denn sonst bleiben sie
// stehen (Undo loescht sie nicht!)
- pSrch->DelFrms();
+ pSrch->DelFrms(0);
}
}
}
@@ -937,7 +937,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx,
// Hier bietet sich als Optimierung an, vorhandene Frames nicht zu
// zerstoeren und wieder neu anzulegen, sondern nur umzuhaengen.
BOOL bInsFrm = bCreateFrms && !pSectNd->GetSection().IsHidden() &&
- GetDoc()->GetRootFrm();
+ GetDoc()->GetCurrentViewShell(); //swmod 071108//swmod 071225
SwNode2Layout *pNode2Layout = NULL;
if( bInsFrm )
{
@@ -1117,10 +1117,10 @@ SwSectionNode::~SwSectionNode()
}
-SwFrm *SwSectionNode::MakeFrm()
+SwFrm *SwSectionNode::MakeFrm( SwFrm *pSib )
{
m_pSection->m_Data.SetHiddenFlag(false);
- return new SwSectionFrm( *m_pSection );
+ return new SwSectionFrm( *m_pSection, pSib );
}
//Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom
@@ -1130,7 +1130,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
{
// also nehme meinen nachfolgenden oder vorhergehenden ContentFrame:
SwNodes& rNds = GetNodes();
- if( rNds.IsDocNodes() && rNds.GetDoc()->GetRootFrm() )
+ if( rNds.IsDocNodes() && rNds.GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
if( GetSection().IsHidden() || IsCntntHidden() )
{
@@ -1152,7 +1152,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
while( 0 != (pFrm = aNode2Layout.NextFrm()) )
{
ASSERT( pFrm->IsSctFrm(), "Depend von Section keine Section." );
- pNew = rIdx.GetNode().GetCntntNode()->MakeFrm();
+ pNew = rIdx.GetNode().GetCntntNode()->MakeFrm( pFrm );
SwSectionNode* pS = rIdx.GetNode().FindSectionNode();
// --> OD 2008-06-23 #156927#
@@ -1175,7 +1175,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
bool bInitNewSect = false;
if( pS )
{
- SwSectionFrm *pSct = new SwSectionFrm( pS->GetSection() );
+ SwSectionFrm *pSct = new SwSectionFrm( pS->GetSection(), pFrm );
// OD 14.11.2002 #104684# - prepare <Init()> of new section frame.
bInitNewSect = true;
SwLayoutFrm* pUp = pSct;
@@ -1192,7 +1192,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
if ( pNew->IsTxtFrm() )
{
- ViewShell* pViewShell( pNew->GetShell() );
+ ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -1219,7 +1219,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx )
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
if ( pNew->IsTxtFrm() )
{
- ViewShell* pViewShell( pNew->GetShell() );
+ ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -1361,7 +1361,7 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c
// dann kopiere auch noch die Links/Server
if( pNewSect->IsLinkType() ) // den Link eintragen
- pNewSect->CreateLink( pDoc->GetRootFrm() ? CREATE_CONNECT
+ pNewSect->CreateLink( pDoc->GetCurrentViewShell() ? CREATE_CONNECT //swmod 071108//swmod 071225
: CREATE_NONE );
// falls als Server aus dem Undo kopiert wird, wieder eintragen
@@ -1442,12 +1442,9 @@ void SwSectionNode::NodesArrChgd()
{
ASSERT( pDoc == GetDoc(),
"verschieben in unterschiedliche Documente?" );
- if (m_pSection->IsLinkType())
- {
- m_pSection->CreateLink( pDoc->GetRootFrm() ? CREATE_CONNECT
- : CREATE_NONE );
- }
-
+ if( m_pSection->IsLinkType() ) // den Link austragen
+ m_pSection->CreateLink( pDoc->GetCurrentViewShell() ? CREATE_CONNECT //swmod 071108
+ : CREATE_NONE );//swmod 071225
if (m_pSection->IsServer())
{
pDoc->GetLinkManager().InsertServer( m_pSection->GetObject() );
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index b213eb1d075d..4d37b66f4f43 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -952,7 +952,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh,
// JP 28.10.96: vom 1. Node die Positionen des Trenners besorgen,
// damit die Boxen entsprechend eingestellt werden
- SwTxtFrmInfo aFInfo( (SwTxtFrm*)pTxtNd->GetFrm() );
+ SwTxtFrmInfo aFInfo( (SwTxtFrm*)pTxtNd->getLayoutFrm( pTxtNd->GetDoc()->GetCurrentLayout() ) );
if( aFInfo.IsOneLine() ) // nur dann sinnvoll!
{
const sal_Unicode* pTxt = pTxtNd->GetTxt().GetBuffer();
@@ -2450,9 +2450,9 @@ SwTableNode::~SwTableNode()
delete pTable;
}
-SwTabFrm *SwTableNode::MakeFrm()
+SwTabFrm *SwTableNode::MakeFrm( SwFrm* pSib )
{
- return new SwTabFrm( *pTable );
+ return new SwTabFrm( *pTable, pSib );
}
//Methode erzeugt fuer den vorhergehenden Node alle Ansichten vom
@@ -2474,7 +2474,7 @@ void SwTableNode::MakeFrms(const SwNodeIndex & rIdx )
while( 0 != (pFrm = aNode2Layout.NextFrm()) )
{
- pNew = pNode->MakeFrm();
+ pNew = pNode->MakeFrm( pFrm );
// wird ein Node vorher oder nachher mit Frames versehen
if ( bBefore )
// der neue liegt vor mir
@@ -2501,7 +2501,7 @@ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind )
SwNode2Layout aNode2Layout( *pNd, GetIndex() );
while( 0 != (pUpper = aNode2Layout.UpperFrm( pFrm, *this )) )
{
- SwTabFrm* pNew = MakeFrm();
+ SwTabFrm* pNew = MakeFrm( pUpper );
pNew->Paste( pUpper, pFrm );
// --> OD 2005-12-01 #i27138#
// notify accessibility paragraphs objects about changed
@@ -2509,7 +2509,7 @@ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind )
// Relation CONTENT_FLOWS_FROM for next paragraph will change
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
{
- ViewShell* pViewShell( pNew->GetShell() );
+ ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -2549,7 +2549,7 @@ void SwTableNode::DelFrms()
// Relation CONTENT_FLOWS_FROM for current next paragraph will change
// and relation CONTENT_FLOWS_TO for current previous paragraph will change.
{
- ViewShell* pViewShell( pFrm->GetShell() );
+ ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -2604,7 +2604,7 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr,
if( pShCrsr )
aPt = pShCrsr->GetPtPos();
- const SwFrm* pTmpFrm = pCNd->GetFrm( &aPt, 0, FALSE );
+ const SwFrm* pTmpFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE );
do {
pTmpFrm = pTmpFrm->GetUpper();
} while ( !pTmpFrm->IsCellFrm() );
@@ -2829,7 +2829,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, BOOL bCurRowOnly,
if( pShCrsr )
aPt = pShCrsr->GetPtPos();
- const SwFrm* pTmpFrm = pCNd->GetFrm( &aPt, 0, FALSE );
+ const SwFrm* pTmpFrm = pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE );
do {
pTmpFrm = pTmpFrm->GetUpper();
} while ( !pTmpFrm->IsCellFrm() );
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index c561f10d0a3f..985ef3cdbc57 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -125,8 +125,8 @@ void lcl_GetStartEndCell( const SwCursor& rCrsr,
SwCntntNode* pPointNd = rCrsr.GetCntntNode();
SwCntntNode* pMarkNd = rCrsr.GetCntntNode(FALSE);
- SwFrm* pPointFrm = pPointNd ? pPointNd->GetFrm( &aPtPos ) : 0;
- SwFrm* pMarkFrm = pMarkNd ? pMarkNd->GetFrm( &aMkPos ) : 0;
+ SwFrm* pPointFrm = pPointNd ? pPointNd->getLayoutFrm( pPointNd->GetDoc()->GetCurrentLayout(), &aPtPos ) : 0;
+ SwFrm* pMarkFrm = pMarkNd ? pMarkNd->getLayoutFrm( pMarkNd->GetDoc()->GetCurrentLayout(), &aMkPos ) : 0;
prStart = pPointFrm ? pPointFrm->GetUpper() : 0;
prEnd = pMarkFrm ? pMarkFrm->GetUpper() : 0;
@@ -801,7 +801,7 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout();
if( pTableLayout )
{
- SwCntntFrm* pFrm = rCursor.GetCntntNode()->GetFrm();
+ SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->GetCurrentLayout() );
SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm();
pTableLayout->BordersChanged(
@@ -898,7 +898,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout();
if( pTableLayout )
{
- SwCntntFrm* pFrm = rCursor.GetCntntNode()->GetFrm();
+ SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->GetCurrentLayout() );
SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm();
pTableLayout->BordersChanged(
@@ -1158,7 +1158,7 @@ void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew )
SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout();
if( pTableLayout )
{
- SwCntntFrm* pFrm = rCursor.GetCntntNode()->GetFrm();
+ SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->GetCurrentLayout() );
SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm();
pTableLayout->Resize(
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index f1ab04ed0c09..4a6b87893474 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -449,15 +449,15 @@ BOOL SwNode::IsInVisibleArea( ViewShell* pSh ) const
else
pNd = GetCntntNode();
- const SwFrm* pFrm;
- if( pNd && 0 != ( pFrm = pNd->GetFrm( 0, 0, FALSE ) ) )
- {
if( !pSh )
// dann die Shell vom Doc besorgen:
GetDoc()->GetEditShell( &pSh );
if( pSh )
{
+ const SwFrm* pFrm;
+ if( pNd && 0 != ( pFrm = pNd->getLayoutFrm( pSh->GetLayout(), 0, 0, FALSE ) ) )
+ {
if ( pFrm->IsInTab() )
pFrm = pFrm->FindTabFrm();
@@ -494,7 +494,7 @@ BOOL SwNode::IsProtect() const
if( 0 != ( pSttNd = FindTableBoxStartNode() ) )
{
SwCntntFrm* pCFrm;
- if( IsCntntNode() && 0 != (pCFrm = ((SwCntntNode*)this)->GetFrm() ))
+ if( IsCntntNode() && 0 != (pCFrm = ((SwCntntNode*)this)->getLayoutFrm( GetDoc()->GetCurrentLayout() ) ))
return pCFrm->IsProtected();
const SwTableBox* pBox = pSttNd->FindTableNode()->GetTable().
@@ -563,7 +563,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay,
{
const SwFrm* pFrm;
const SwPageFrm* pPage;
- if( pNode && 0 != ( pFrm = pNode->GetFrm( 0, 0, bCalcLay ) ) &&
+ if( pNode && 0 != ( pFrm = pNode->getLayoutFrm( pNode->GetDoc()->GetCurrentLayout(), 0, 0, bCalcLay ) ) &&
0 != ( pPage = pFrm->FindPageFrm() ) )
{
pPgDesc = pPage->GetPageDesc();
@@ -862,8 +862,8 @@ const SwTxtNode* SwNode::FindOutlineNodeOfLevel( BYTE nLvl ) const
const SwCntntNode* pCNd = GetCntntNode();
Point aPt( 0, 0 );
- const SwFrm* pFrm = pRet->GetFrm( &aPt, 0, FALSE ),
- * pMyFrm = pCNd ? pCNd->GetFrm( &aPt, 0, FALSE ) : 0;
+ const SwFrm* pFrm = pRet->getLayoutFrm( pRet->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ),
+ * pMyFrm = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ) : 0;
const SwPageFrm* pPgFrm = pFrm ? pFrm->FindPageFrm() : 0;
if( pPgFrm && pMyFrm &&
pPgFrm->Frm().Top() > pMyFrm->Frm().Top() )
@@ -1157,20 +1157,19 @@ BOOL SwCntntNode::InvalidateNumRule()
return 0 != pRule;
}
-
-SwCntntFrm *SwCntntNode::GetFrm( const Point* pPoint,
- const SwPosition *pPos,
- const BOOL bCalcFrm ) const
+SwCntntFrm *SwCntntNode::getLayoutFrm( const SwRootFrm* _pRoot,
+ const Point* pPoint, const SwPosition *pPos, const BOOL bCalcFrm ) const
{
- return (SwCntntFrm*) ::GetFrmOfModify( *(SwModify*)this, FRM_CNTNT,
+ return (SwCntntFrm*) ::GetFrmOfModify( _pRoot, *(SwModify*)this, FRM_CNTNT,
pPoint, pPos, bCalcFrm );
}
+
SwRect SwCntntNode::FindLayoutRect( const BOOL bPrtArea, const Point* pPoint,
const BOOL bCalcFrm ) const
{
SwRect aRet;
- SwCntntFrm* pFrm = (SwCntntFrm*)::GetFrmOfModify( *(SwModify*)this,
+ SwCntntFrm* pFrm = (SwCntntFrm*)::GetFrmOfModify( 0, *(SwModify*)this,
FRM_CNTNT, pPoint, 0, bCalcFrm );
if( pFrm )
aRet = bPrtArea ? pFrm->Prt() : pFrm->Frm();
@@ -1181,7 +1180,7 @@ SwRect SwCntntNode::FindPageFrmRect( const BOOL bPrtArea, const Point* pPoint,
const BOOL bCalcFrm ) const
{
SwRect aRet;
- SwFrm* pFrm = ::GetFrmOfModify( *(SwModify*)this,
+ SwFrm* pFrm = ::GetFrmOfModify( 0, *(SwModify*)this,
FRM_CNTNT, pPoint, 0, bCalcFrm );
if( pFrm && 0 != ( pFrm = pFrm->FindPageFrm() ))
aRet = bPrtArea ? pFrm->Prt() : pFrm->Frm();
@@ -1353,7 +1352,7 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode )
while( 0 != (pUpper = aNode2Layout.UpperFrm( pFrm, rNode )) )
{
- pNew = rNode.MakeFrm();
+ pNew = rNode.MakeFrm( pUpper );
pNew->Paste( pUpper, pFrm );
// --> OD 2005-12-01 #i27138#
// notify accessibility paragraphs objects about changed
@@ -1362,7 +1361,7 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode )
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
if ( pNew->IsTxtFrm() )
{
- ViewShell* pViewShell( pNew->GetShell() );
+ ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -1400,7 +1399,7 @@ void SwCntntNode::DelFrms()
// and relation CONTENT_FLOWS_TO for current previous paragraph will change.
if ( pFrm->IsTxtFrm() )
{
- ViewShell* pViewShell( pFrm->GetShell() );
+ ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -2049,7 +2048,7 @@ short SwCntntNode::GetTextDirection( const SwPosition& rPos,
// --> OD 2007-01-10 #i72024#
// No format of the frame, because this can cause recursive layout actions
- SwFrm* pFrm = GetFrm( &aPt, &rPos, FALSE );
+ SwFrm* pFrm = getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, &rPos, FALSE );
// <--
if ( pFrm )
diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx
index cce0919e1e1a..62fa380097d3 100644
--- a/sw/source/core/docnode/node2lay.cxx
+++ b/sw/source/core/docnode/node2lay.cxx
@@ -255,7 +255,7 @@ SwLayoutFrm* SwNode2LayImpl::UpperFrm( SwFrm* &rpFrm, const SwNode &rNode )
return static_cast<SwLayoutFrm*>(pFrm);
}
- pUpper = new SwSectionFrm(((SwSectionNode*)pNode)->GetSection());
+ pUpper = new SwSectionFrm(((SwSectionNode*)pNode)->GetSection(), rpFrm);
pUpper->Paste( rpFrm->GetUpper(),
bMaster ? rpFrm : rpFrm->GetNext() );
static_cast<SwSectionFrm*>(pUpper)->Init();
@@ -299,7 +299,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd )
pNxt = pNxt->GetNext();
else
pNxt = pUp->Lower();
- pNew = ((SwCntntNode*)pNd)->MakeFrm();
+ pNew = ((SwCntntNode*)pNd)->MakeFrm( pUp );
pNew->Paste( pUp, pNxt );
(*pUpperFrms)[n-2] = pNew;
}
@@ -314,7 +314,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, ULONG nStt, ULONG nEnd )
pNxt = pNxt->GetNext();
else
pNxt = pUp->Lower();
- pNew = ((SwTableNode*)pNd)->MakeFrm();
+ pNew = ((SwTableNode*)pNd)->MakeFrm( pUp );
ASSERT( pNew->IsTabFrm(), "Table exspected" );
pNew->Paste( pUp, pNxt );
((SwTabFrm*)pNew)->RegistFlys();
@@ -358,7 +358,7 @@ SwFrm* SwNode2LayImpl::GetFrm( const Point* pDocPos,
const SwPosition *pPos,
const BOOL bCalcFrm ) const
{
- return pIter ? ::GetFrmOfModify( pIter->GetModify(), USHRT_MAX,
+ return pIter ? ::GetFrmOfModify( 0, pIter->GetModify(), USHRT_MAX,
pDocPos, pPos, bCalcFrm )
: 0;
}
diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx
index d2c979535dbb..0a1157ad2274 100644
--- a/sw/source/core/docnode/nodes.cxx
+++ b/sw/source/core/docnode/nodes.cxx
@@ -395,7 +395,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz,
if( bNewFrms )
bNewFrms = &GetDoc()->GetNodes() == (const SwNodes*)&rNds &&
- GetDoc()->GetRootFrm();
+ GetDoc()->GetCurrentViewShell(); //swmod 071108//swmod 071225
if( bNewFrms )
{
// Frames besorgen:
@@ -2398,7 +2398,7 @@ SwNode* SwNodes::FindPrvNxtFrmNode( SwNodeIndex& rFrmIdx,
SwNode* pFrmNd = 0;
// habe wir gar kein Layout, vergiss es
- if( GetDoc()->GetRootFrm() )
+ if( GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
SwNode* pSttNd = &rFrmIdx.GetNode();
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 2e19d482fc70..0b16cccb1dfa 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -1207,9 +1207,8 @@ void SwDrawContact::Changed( const SdrObject& rObj,
// OD 2004-06-01 #i26791# - no event handling, if existing <ViewShell>
// is in contruction
SwDoc* pDoc = GetFmt()->GetDoc();
- if ( pDoc->GetRootFrm() &&
- pDoc->GetRootFrm()->GetCurrShell() &&
- pDoc->GetRootFrm()->GetCurrShell()->IsInConstructor() )
+ if ( pDoc->GetCurrentViewShell() &&
+ pDoc->GetCurrentViewShell()->IsInConstructor() )
{
return;
}
@@ -1225,7 +1224,8 @@ void SwDrawContact::Changed( const SdrObject& rObj,
//Action aufsetzen, aber nicht wenn gerade irgendwo eine Action laeuft.
ViewShell *pSh = 0, *pOrg;
- if ( pDoc->GetRootFrm() && pDoc->GetRootFrm()->IsCallbackActionEnabled() )
+ SwRootFrm *pTmpRoot = pDoc->GetCurrentLayout();//swmod 080317
+ if ( pTmpRoot && pTmpRoot->IsCallbackActionEnabled() )
{
pDoc->GetEditShell( &pOrg );
pSh = pOrg;
@@ -1239,13 +1239,13 @@ void SwDrawContact::Changed( const SdrObject& rObj,
} while ( pSh && pSh != pOrg );
if ( pSh )
- pDoc->GetRootFrm()->StartAllAction();
+ pTmpRoot->StartAllAction();
}
SdrObjUserCall::Changed( rObj, eType, rOldBoundRect );
_Changed( rObj, eType, &rOldBoundRect ); //Achtung, ggf. Suizid!
if ( pSh )
- pDoc->GetRootFrm()->EndAllAction();
+ pTmpRoot->EndAllAction();
}
// --> OD 2006-01-18 #129959#
@@ -1920,11 +1920,8 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
SwFrmFmt* pDrawFrmFmt = (SwFrmFmt*)pRegisteredIn;
- SwRootFrm* pRoot = pDrawFrmFmt->getIDocumentLayoutAccess()->GetRootFrm();
- if ( !pRoot )
- {
+ if( !pDrawFrmFmt->getIDocumentLayoutAccess()->GetCurrentViewShell() )
return;
- }
// OD 16.05.2003 #108784# - remove 'virtual' drawing objects from writer
// layout and from drawing page, and remove 'master' drawing object from
@@ -1941,6 +1938,10 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch )
case FLY_AT_PAGE:
{
USHORT nPgNum = pAnch->GetPageNum();
+ ViewShell *pShell = pDrawFrmFmt->getIDocumentLayoutAccess()->GetCurrentViewShell();
+ if( !pShell )
+ break;
+ SwRootFrm* pRoot = pShell->GetLayout();
SwPageFrm *pPage = static_cast<SwPageFrm*>(pRoot->Lower());
for ( USHORT i = 1; i < nPgNum && pPage; ++i )
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 75111933e0ec..80303f49de13 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -53,6 +53,7 @@
#include "ndnotxt.hxx"
#include "grfatr.hxx"
#include "pagefrm.hxx"
+#include "rootfrm.hxx"
using namespace ::com::sun::star;
@@ -473,7 +474,7 @@ SwFrmFmt *SwVirtFlyDrawObj::GetFmt()
void SwVirtFlyDrawObj::wrap_DoPaintObject() const
{
- ViewShell* pShell = pFlyFrm->GetShell();
+ ViewShell* pShell = pFlyFrm->getRootFrm()->GetCurrShell();
// Only paint when we have a current shell and a DrawingLayer paint is in progress.
// This avcoids evtl. problems with renderers which do processing stuff,
@@ -829,9 +830,9 @@ void __EXPORT SwVirtFlyDrawObj::NbcResize(const Point& rRef,
const SwFrm *pRel = GetFlyFrm()->IsFlyLayFrm() ?
GetFlyFrm()->GetAnchorFrm() :
GetFlyFrm()->GetAnchorFrm()->GetUpper();
- const ViewShell *pSh = GetFlyFrm()->GetShell();
+ const ViewShell *pSh = GetFlyFrm()->getRootFrm()->GetCurrShell();
if ( pSh && pRel->IsBodyFrm() &&
- pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ pSh->GetViewOptions()->getBrowseMode() &&
pSh->VisArea().HasArea() )
{
nRelWidth = pSh->GetBrowseWidth();
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index 694599181b81..0db338657a24 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -118,7 +118,7 @@ void InsertGridFrame( SdrPageGridFrameList *pLst, const SwFrm *pPg )
const SdrPageGridFrameList* SwDPage::GetGridFrameList(
const SdrPageView* pPV, const Rectangle *pRect ) const
{
- ViewShell *pSh = ((SwDrawDocument*)GetModel())->GetDoc().GetRootFrm()->GetCurrShell();
+ ViewShell *pSh = ((SwDrawDocument*)GetModel())->GetDoc().GetCurrentViewShell(); //swmod 071108//swmod 071225
if ( pSh )
{
while ( pSh->Imp()->GetPageView() != pPV )
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index f7242d1d8132..83a2e29a2be7 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -1074,8 +1074,9 @@ void SwDrawView::ReplaceMarkedDrawVirtObjs( SdrMarkView& _rMarkView )
void SwDrawView::DeleteMarked()
{
SwDoc* pDoc = Imp().GetShell()->GetDoc();
- if ( pDoc->GetRootFrm() )
- pDoc->GetRootFrm()->StartAllAction();
+ SwRootFrm *pTmpRoot = pDoc->GetCurrentLayout();//swmod 080317
+ if ( pTmpRoot )
+ pTmpRoot->StartAllAction();
pDoc->StartUndo(UNDO_EMPTY, NULL);
// OD 18.06.2003 #108784# - replace marked <SwDrawVirtObj>-objects by its
// reference objects.
@@ -1096,20 +1097,7 @@ void SwDrawView::DeleteMarked()
::FrameNotify( Imp().GetShell(), FLY_DRAG_END );
}
pDoc->EndUndo(UNDO_EMPTY, NULL);
- if( pDoc->GetRootFrm() )
- pDoc->GetRootFrm()->EndAllAction();
+ if( pTmpRoot )
+ pTmpRoot->EndAllAction(); //swmod 080218
}
-/********
-JP 02.10.98: sollte als Fix fuer 57153 gelten, hatte aber Nebenwirkungen,
- wie Bug 57475
-const SdrMarkList& SwDrawView::GetMarkedObjectList() const
-{
- FlushComeBackTimer();
- return FmFormView::GetMarkedObjectList();
-}
-*************/
-
-
-
-
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index 639bab3c10c5..b98f77386086 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -270,7 +270,7 @@ const sal_Unicode* StrChr( const sal_Unicode* pSrc, sal_Unicode c )
SwTxtFrm* SwAutoFormat::GetFrm( const SwTxtNode& rTxtNd ) const
{
// besorge mal den Frame
- const SwCntntFrm *pFrm = rTxtNd.GetFrm();
+ const SwCntntFrm *pFrm = rTxtNd.getLayoutFrm( pEditShell->GetLayout() );
ASSERT( pFrm, "zum Autoformat muss das Layout vorhanden sein" );
if( aFlags.bAFmtByInput && !pFrm->IsValid() )
{
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 37ba5e5ced31..860cf58cf350 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -360,7 +360,7 @@ BOOL SwEditShell::IsMoveLeftMargin( BOOL bRight, BOOL bModulus ) const
long nNext = rLS.GetTxtLeft() + nDefDist;
if( bModulus )
nNext = ( nNext / nDefDist ) * nDefDist;
- SwFrm* pFrm = pCNd->GetFrm();
+ SwFrm* pFrm = pCNd->getLayoutFrm( GetLayout() );
if ( pFrm )
{
const USHORT nFrmWidth = static_cast<USHORT>( pFrm->IsVertical() ?
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index a996ed802a42..8a0ead2da3ce 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -90,7 +90,7 @@ void SwEditShell::DeleteSel( SwPaM& rPam, BOOL* pUndo )
}
// geschuetze Boxen ueberspringen !
if( !pNd->IsCntntNode() ||
- !((SwCntntNode*)pNd)->GetFrm()->IsProtected() )
+ !((SwCntntNode*)pNd)->getLayoutFrm( GetLayout() )->IsProtected() )
{
// alles loeschen
GetDoc()->DeleteAndJoin( aDelPam );
diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx
index 7af79fde80a8..f47579a9110a 100644
--- a/sw/source/core/edit/editsh.cxx
+++ b/sw/source/core/edit/editsh.cxx
@@ -151,7 +151,7 @@ void SwEditShell::Insert2(const String &rStr, const bool bForceExpandHints )
// seems to be an empty paragraph.
Point aPt;
SwCntntFrm* pFrm =
- ((SwTxtNode&)rNode).GetFrm( &aPt, pTmpCrsr->GetPoint(),
+ ((SwTxtNode&)rNode).getLayoutFrm( GetLayout(), &aPt, pTmpCrsr->GetPoint(),
sal_False );
SwScriptInfo aScriptInfo;
@@ -421,7 +421,7 @@ void SwEditShell::SetGraphicPolygon( const PolyPolygon *pPoly )
SwNoTxtNode *pNd = GetCrsr()->GetNode()->GetNoTxtNode();
StartAllAction();
pNd->SetContour( pPoly );
- SwFlyFrm *pFly = (SwFlyFrm*)pNd->GetFrm()->GetUpper();
+ SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper();
const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
pFly->GetFmt()->SwModify::Modify( (SwFmtSurround*)&rSur,
(SwFmtSurround*)&rSur );
@@ -437,7 +437,7 @@ void SwEditShell::ClearAutomaticContour()
{
StartAllAction();
pNd->SetContour( NULL, FALSE );
- SwFlyFrm *pFly = (SwFlyFrm*)pNd->GetFrm()->GetUpper();
+ SwFlyFrm *pFly = (SwFlyFrm*)pNd->getLayoutFrm(GetLayout())->GetUpper();
const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround();
pFly->GetFmt()->SwModify::Modify( (SwFmtSurround*)&rSur,
(SwFmtSurround*)&rSur );
@@ -479,7 +479,7 @@ BOOL SwEditShell::HasOLEObj( const String &rName ) const
SwNode& rNd = aIdx.GetNode();
if( rNd.IsOLENode() &&
rName == ((SwOLENode&)rNd).GetChartTblName() &&
- ((SwOLENode&)rNd).GetFrm() )
+ ((SwOLENode&)rNd).getLayoutFrm( GetLayout() ) )
return TRUE;
aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 );
@@ -737,7 +737,7 @@ Graphic SwEditShell::GetIMapGraphic() const
}
else
{
- SwFlyFrm* pFlyFrm = pNd->GetCntntNode()->GetFrm()->FindFlyFrm();
+ SwFlyFrm* pFlyFrm = pNd->GetCntntNode()->getLayoutFrm( GetLayout() )->FindFlyFrm();
if(pFlyFrm)
aRet = pFlyFrm->GetFmt()->MakeGraphic();
}
@@ -904,7 +904,7 @@ void SwEditShell::SetNumberingRestart()
switch( pNd->GetNodeType() )
{
case ND_TEXTNODE:
- if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->GetFrm()) )
+ if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->getLayoutFrm( GetLayout() )) )
{
//jump over hidden frames - ignore protection!
if( !((SwTxtFrm*)pCntFrm)->IsHiddenNow() )
@@ -972,7 +972,7 @@ USHORT SwEditShell::GetLineCount( BOOL bActPos )
else
{
if( 0 != ( pCNd = pPam->GetCntntNode() ) &&
- 0 != ( pCntFrm = pCNd->GetFrm() ) )
+ 0 != ( pCntFrm = pCNd->getLayoutFrm( GetLayout() ) ) )
{
const SwStartNode *pTmp;
if( pCntFrm->IsInFly() ) // Fly
@@ -1000,7 +1000,7 @@ USHORT SwEditShell::GetLineCount( BOOL bActPos )
while( 0 != ( pCNd = GetDoc()->GetNodes().GoNextSection(
&aStart, TRUE, FALSE )) && ( !bActPos || aStart <= rPtIdx ) )
{
- if( 0 != ( pCntFrm = pCNd->GetFrm() ) && pCntFrm->IsTxtFrm() )
+ if( 0 != ( pCntFrm = pCNd->getLayoutFrm( GetLayout() ) ) && pCntFrm->IsTxtFrm() )
{
xub_StrLen nActPos = bActPos && aStart == rPtIdx ?
pPam->GetPoint()->nContent.GetIndex() : USHRT_MAX;
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 02dc1de62901..58fb72ae16f1 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -1080,7 +1080,7 @@ uno::Reference< XSpellAlternatives >
SwCrsrMoveState aState;
aState.bRealWidth = TRUE;
SwCntntNode* pCntntNode = pCrsr->GetCntntNode();
- SwCntntFrm *pCntntFrame = pCntntNode->GetFrm(pPt, pCrsr->GetPoint(), FALSE);
+ SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), FALSE);
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
rContent = nWordEnd;
@@ -1224,7 +1224,7 @@ bool SwEditShell::GetGrammarCorrection(
SwCrsrMoveState aState;
aState.bRealWidth = TRUE;
SwCntntNode* pCntntNode = pCrsr->GetCntntNode();
- SwCntntFrm *pCntntFrame = pCntntNode->GetFrm(pPt, pCrsr->GetPoint(), FALSE);
+ SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), FALSE);
pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState );
rContent = nWordEnd;
diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index ba3c2e9c7966..e04ff5d4b8b7 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -104,7 +104,7 @@ const SwSection* SwEditShell::GetAnySection( BOOL bOutOfTab, const Point* pPt )
Point aPt( *pPt );
GetLayout()->GetCrsrOfst( &aPos, aPt );
SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode();
- pFrm = pNd->GetFrm( pPt );
+ pFrm = pNd->getLayoutFrm( GetLayout(), pPt );
}
else
pFrm = GetCurrFrm( FALSE );
diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx
index a27b09f5d4ff..58bc6965c40b 100644
--- a/sw/source/core/edit/edundo.cxx
+++ b/sw/source/core/edit/edundo.cxx
@@ -266,10 +266,16 @@ void lcl_SelectSdrMarkList( SwEditShell* pShell,
if( pShell->ISA( SwFEShell ) )
{
SwFEShell* pFEShell = static_cast<SwFEShell*>( pShell );
+ bool bFirst = true;
for( USHORT i = 0; i < pSdrMarkList->GetMarkCount(); ++i )
- pFEShell->SelectObj( Point(),
- (i==0) ? 0 : SW_ADD_SELECT,
- pSdrMarkList->GetMark( i )->GetMarkedSdrObj() );
+ {
+ SdrObject *pObj = pSdrMarkList->GetMark( i )->GetMarkedSdrObj();
+ if( pObj )
+ {
+ pFEShell->SelectObj( Point(), bFirst ? 0 : SW_ADD_SELECT, pObj );
+ bFirst = false;
+ }
+ }
// the old implementation would always unselect
// objects, even if no new ones were selected. If this
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 630f8dc18e34..2c6fe50625ac 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -373,7 +373,7 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle)
const SwTxtNode& rFldTxtNode = pTxtFld->GetTxtNode();
SwPosition aFldPos(rFldTxtNode);
SwDoc& rDoc = *(SwDoc*)rFldTxtNode.GetDoc();
- SwCntntFrm *pFrm = rFldTxtNode.GetFrm();
+ SwCntntFrm *pFrm = rFldTxtNode.getLayoutFrm( rDoc.GetCurrentLayout() );
const SwTxtNode* pTxtNode = 0;
if(pFrm && !pFrm->IsInDocBody())
pTxtNode = GetBodyTxtNode( rDoc, aFldPos, *pFrm );
@@ -381,7 +381,7 @@ USHORT SwAuthorityFieldType::GetSequencePos(long nHandle)
//body the directly available text node will be used
if(!pTxtNode)
pTxtNode = &rFldTxtNode;
- if( pTxtNode->GetTxt().Len() && pTxtNode->GetFrm() &&
+ if( pTxtNode->GetTxt().Len() && pTxtNode->getLayoutFrm( rDoc.GetCurrentLayout() ) &&
pTxtNode->GetNodes().IsDocNodes() )
{
SwTOXAuthority* pNew = new SwTOXAuthority( *pTxtNode,
diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx
index aa46869bca1a..ffe6e6af32b7 100644
--- a/sw/source/core/fields/cellfml.cxx
+++ b/sw/source/core/fields/cellfml.cxx
@@ -741,7 +741,7 @@ const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox )
SwCntntNode* pCNd = aIdx.GetNodes().GoNext( &aIdx );
ASSERT( pCNd, "Box hat keinen TextNode" );
Point aPt; // den im Layout 1. Frame returnen - Tab.Kopfzeile !!
- return pCNd->GetFrm( &aPt, NULL, FALSE );
+ return pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, NULL, FALSE );
}
long lcl_GetLongBoxNum( String& rStr )
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx
index c9811352b062..f208ac71dbb3 100644
--- a/sw/source/core/fields/ddefld.cxx
+++ b/sw/source/core/fields/ddefld.cxx
@@ -319,7 +319,7 @@ void SwDDEFieldType::_RefCntChgd()
{
refLink->SetVisible( pDoc->IsVisibleLinks() );
pDoc->GetLinkManager().InsertDDELink( refLink );
- if( pDoc->GetRootFrm() )
+ if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
UpdateNow();
}
else
diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx
index c10a8b18c5cb..1756690d1384 100644
--- a/sw/source/core/fields/ddetbl.cxx
+++ b/sw/source/core/fields/ddetbl.cxx
@@ -176,7 +176,7 @@ BOOL SwDDETable::NoDDETable()
pNewTbl->GetTabLines().Insert( &GetTabLines(),0 ); // move die Lines
GetTabLines().Remove( 0, GetTabLines().Count() );
- if( pDoc->GetRootFrm() )
+ if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
((SwDDEFieldType*)aDepend.GetRegisteredIn())->DecRefCnt();
pTblNd->SetNewTable( pNewTbl ); // setze die Tabelle
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index fba7115075e8..862a073d9884 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -796,8 +796,8 @@ String SwDocStatFieldType::Expand(sal_uInt16 nSubType, sal_uInt32 nFmt) const
case DS_WORD: nVal = rDStat.nWord; break;
case DS_CHAR: nVal = rDStat.nChar; break;
case DS_PAGE:
- if( pDoc->GetRootFrm() )
- ((SwDocStat &)rDStat).nPage = pDoc->GetRootFrm()->GetPageNum();
+ if( pDoc->GetCurrentLayout() )//swmod 080218
+ ((SwDocStat &)rDStat).nPage = pDoc->GetCurrentLayout()->GetPageNum(); //swmod 080218
nVal = rDStat.nPage;
if( SVX_NUM_PAGEDESC == nFmt )
nFmt = (sal_uInt32)nNumberingType;
@@ -2337,7 +2337,7 @@ sal_uInt16 SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst )
// immer den ersten !! (in Tab-Headline, Kopf-/Fuss )
Point aPt;
- const SwCntntFrm* pFrm = rTxtNd.GetFrm( &aPt, 0, sal_False );
+ const SwCntntFrm* pFrm = rTxtNd.getLayoutFrm( rTxtNd.GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
_SetGetExpFld* pNew;
@@ -2402,8 +2402,8 @@ void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld,
{
// dann bestimme mal den entsp. Offset
Point aPt;
- const SwCntntFrm* pFrm = pTxtNode->GetFrm( &aPt, 0, sal_False );
- const SwCntntFrm* pRefFrm = pRefTxtFld->GetTxtNode().GetFrm( &aPt, 0, sal_False );
+ const SwCntntFrm* pFrm = pTxtNode->getLayoutFrm( pTxtNode->GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
+ const SwCntntFrm* pRefFrm = pRefTxtFld->GetTxtNode().getLayoutFrm( pRefTxtFld->GetTxtNode().GetDoc()->GetCurrentLayout(), &aPt, 0, sal_False );
const SwPageFrm* pPgFrm = 0;
sal_uInt16 nDiff = ( pFrm && pRefFrm )
? (pPgFrm = pFrm->FindPageFrm())->GetPhyPageNum() -
@@ -2496,7 +2496,7 @@ void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm,
const SwRefPageSetField* pSetFld =
(SwRefPageSetField*)pRefTxtFld->GetFld().GetFld();
Point aPt;
- const SwCntntFrm* pRefFrm = pRefTxtFld ? pRefTxtFld->GetTxtNode().GetFrm( &aPt, 0, sal_False ) : 0;
+ const SwCntntFrm* pRefFrm = pRefTxtFld ? pRefTxtFld->GetTxtNode().getLayoutFrm( pFrm->getRootFrm(), &aPt, 0, sal_False ) : 0;
if( pSetFld->IsOn() && pRefFrm )
{
// dann bestimme mal den entsp. Offset
diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx
index 8b03b7e54664..4ca163c25dcb 100644
--- a/sw/source/core/fields/reffld.cxx
+++ b/sw/source/core/fields/reffld.cxx
@@ -111,8 +111,8 @@ void lcl_GetLayTree( const SwFrm* pFrm, SvPtrarr& rArr )
BOOL IsFrameBehind( const SwTxtNode& rMyNd, USHORT nMySttPos,
const SwTxtNode& rBehindNd, USHORT nSttPos )
{
- const SwTxtFrm *pMyFrm = (SwTxtFrm*)rMyNd.GetFrm(0,0,FALSE),
- *pFrm = (SwTxtFrm*)rBehindNd.GetFrm(0,0,FALSE);
+ const SwTxtFrm *pMyFrm = (SwTxtFrm*)rMyNd.getLayoutFrm( rMyNd.GetDoc()->GetCurrentLayout(), 0,0,FALSE),
+ *pFrm = (SwTxtFrm*)rBehindNd.getLayoutFrm( rBehindNd.GetDoc()->GetCurrentLayout(), 0,0,FALSE);
while( pFrm && !pFrm->IsInside( nSttPos ) )
pFrm = (SwTxtFrm*)pFrm->GetFollow();
@@ -401,7 +401,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
case REF_PAGE:
case REF_PAGE_PGDESC:
{
- const SwTxtFrm* pFrm = (SwTxtFrm*)pTxtNd->GetFrm(0,0,FALSE),
+ const SwTxtFrm* pFrm = (SwTxtFrm*)pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0,0,FALSE),
*pSave = pFrm;
while( pFrm && !pFrm->IsInside( nStt ) )
pFrm = (SwTxtFrm*)pFrm->GetFollow();
@@ -423,7 +423,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr )
case REF_CHAPTER:
{
// ein bischen trickreich: suche irgend einen Frame
- const SwFrm* pFrm = pTxtNd->GetFrm();
+ const SwFrm* pFrm = pTxtNd->getLayoutFrm( pDoc->GetCurrentLayout() );
if( pFrm )
{
SwChapterFieldType aFldTyp;
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 9fe5c9a22204..7b232295548f 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -267,7 +267,7 @@ BOOL lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrm* pFly,
{
BOOL bRet = TRUE;
rAnchor.SetAnchor( &rPos );
- SwCntntFrm* pTmpFrm = rNd.GetCntntNode()->GetFrm( &rInsPt, 0, FALSE );
+ SwCntntFrm* pTmpFrm = rNd.GetCntntNode()->getLayoutFrm( rDestShell.GetLayout(), &rInsPt, 0, FALSE );
SwFlyFrm *pTmpFly = pTmpFrm->FindFlyFrm();
if( pTmpFly && bCheckFlyRecur && pFly->IsUpperOf( *pTmpFly ) )
{
diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx
index fe73c36016a0..4d90a916feee 100644
--- a/sw/source/core/frmedt/fedesc.cxx
+++ b/sw/source/core/frmedt/fedesc.cxx
@@ -238,14 +238,14 @@ const SwPageDesc* SwFEShell::GetSelectedPageDescs() const
FOREACHPAM_START(this)
if( 0 != (pCNd = PCURCRSR->GetCntntNode() ) &&
- 0 != ( pPtFrm = pCNd->GetFrm( &aNulPt, 0, FALSE )) )
+ 0 != ( pPtFrm = pCNd->getLayoutFrm( GetLayout(), &aNulPt, 0, FALSE )) )
pPtFrm = pPtFrm->FindPageFrm();
else
pPtFrm = 0;
if( PCURCRSR->HasMark() &&
0 != (pCNd = PCURCRSR->GetCntntNode( FALSE ) ) &&
- 0 != ( pMkFrm = pCNd->GetFrm( &aNulPt, 0, FALSE )) )
+ 0 != ( pMkFrm = pCNd->getLayoutFrm( GetLayout(), &aNulPt, 0, FALSE )) )
pMkFrm = pMkFrm->FindPageFrm();
else
pMkFrm = pPtFrm;
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 0dc721a62f12..426bf5bea70e 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -108,7 +108,7 @@ sal_Bool lcl_SetNewFlyPos( const SwNode& rNode, SwFmtAnchor& rAnchor,
else
{
const SwCntntNode *pCntNd = rNode.GetCntntNode();
- const SwCntntFrm* pCFrm = pCntNd ? pCntNd->GetFrm( &rPt, 0, sal_False ) : 0;
+ const SwCntntFrm* pCFrm = pCntNd ? pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &rPt, 0, sal_False ) : 0;
const SwPageFrm *pPg = pCFrm ? pCFrm->FindPageFrm() : 0;
rAnchor.SetPageNum( pPg ? pPg->GetPhyPageNum() : 1 );
@@ -171,9 +171,9 @@ BOOL lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm,
SwCrsrMoveState aState( MV_SETONLYTEXT );
SwPosition aPos( rDoc.GetNodes() );
aTmpPnt.X() -= 1; //nicht im Fly landen!!
- rDoc.GetRootFrm()->GetCrsrOfst( &aPos, aTmpPnt, &aState );
+ rDoc.GetCurrentLayout()->GetCrsrOfst( &aPos, aTmpPnt, &aState ); //swmod 071108//swmod 071225
pNewAnch = ::FindAnchor(
- aPos.nNode.GetNode().GetCntntNode()->GetFrm( 0, 0, sal_False ),
+ aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( rFrm.getRootFrm(), 0, 0, sal_False ),
aTmpPnt )->FindFlyFrm();
if( pNewAnch && &rFrm != pNewAnch && !pNewAnch->IsProtected() )
@@ -290,7 +290,7 @@ SwFlyFrm *SwFEShell::FindFlyFrm() const
return 0;
SdrObject *pO = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
- return pO->ISA(SwVirtFlyDrawObj) ? ((SwVirtFlyDrawObj*)pO)->GetFlyFrm() : 0;
+ return ( pO && pO->ISA(SwVirtFlyDrawObj) ) ? ((SwVirtFlyDrawObj*)pO)->GetFlyFrm() : 0;
}
return 0;
}
@@ -354,7 +354,7 @@ const SwFrmFmt* SwFEShell::IsFlyInFly()
// OD 01.07.2003 #108784# - determine text frame by left-top-corner
// of object
//pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->GetFrm( 0, 0, sal_False );
- pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aTmpPos, 0, sal_False );
+ pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aTmpPos, 0, sal_False );
}
const SwFrm *pTmp = ::FindAnchor( pTxtFrm, aTmpPos );
const SwFlyFrm *pFly = pTmp->FindFlyFrm();
@@ -485,7 +485,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt )
SwPosition aPos( GetDoc()->GetNodes().GetEndOfExtras() );
Point aTmpPnt( rAbsPos );
GetLayout()->GetCrsrOfst( &aPos, aTmpPnt, &aState );
- pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->GetFrm(0,&aPos,FALSE );
+ pTxtFrm = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(),0,&aPos,FALSE );
}
const SwFrm *pNewAnch;
if( pTxtFrm )
@@ -927,8 +927,8 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj,
{
SwCrsrMoveState aState( MV_SETONLYTEXT );
Point aTmpPt( rInsertPosition );
- getIDocumentLayoutAccess()->GetRootFrm()->GetCrsrOfst( aPam.GetPoint(), aTmpPt, &aState );
- const SwFrm* pFrm = aPam.GetCntntNode()->GetFrm( 0, 0, sal_False );
+ GetLayout()->GetCrsrOfst( aPam.GetPoint(), aTmpPt, &aState );
+ const SwFrm* pFrm = aPam.GetCntntNode()->getLayoutFrm( GetLayout(), 0, 0, sal_False );
const Point aRelPos( rInsertPosition.X() - pFrm->Frm().Left(),
rInsertPosition.Y() - pFrm->Frm().Top() );
rDrawObj.SetRelativePos( aRelPos );
@@ -996,7 +996,7 @@ void SwFEShell::SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset )
SwFrmFmt* pFmt;
long nNewPage;
- SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetRootFrm();
+ SwRootFrm* pTmpRootFrm = GetLayout();//swmod 080317
sal_uInt16 nMaxPage = pTmpRootFrm->GetPageNum();
sal_Bool bTmpAssert = sal_False;
for( sal_uInt16 n = 0; n < rFillArr.Count(); ++n )
@@ -1744,7 +1744,7 @@ const SwFrmFmt* SwFEShell::GetFmtFromAnyObj( const Point& rPt ) const
Point aPt( rPt );
GetLayout()->GetCrsrOfst( &aPos, aPt );
SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode();
- SwFrm* pFrm = pNd->GetFrm( &rPt )->FindFlyFrm();
+ SwFrm* pFrm = pNd->getLayoutFrm( GetLayout(), &rPt, 0, FALSE )->FindFlyFrm();
pRet = pFrm ? ((SwLayoutFrm*)pFrm)->GetFmt() : 0;
}
return pRet;
@@ -1863,6 +1863,8 @@ ObjCntType SwFEShell::GetObjCntTypeOfSelection( SdrObject** ppObj ) const
for( sal_uInt32 i = 0, nE = rMrkList.GetMarkCount(); i < nE; ++i )
{
SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
+ if( !pObj )
+ continue;
ObjCntType eTmp = GetObjCntType( *pObj );
if( !i )
{
diff --git a/sw/source/core/frmedt/feflyole.cxx b/sw/source/core/frmedt/feflyole.cxx
index 070a031e83d3..c78fb22d7421 100644
--- a/sw/source/core/frmedt/feflyole.cxx
+++ b/sw/source/core/frmedt/feflyole.cxx
@@ -80,7 +80,7 @@ SwFlyFrm *SwFEShell::FindFlyFrm( const uno::Reference < embed::XEmbeddedObject >
((SwOLENode*)pNd)->GetOLEObj().GetOleRef() == xObj )
{
bExist = TRUE;
- SwFrm *pFrm = ((SwOLENode*)pNd)->GetFrm();
+ SwFrm *pFrm = ((SwOLENode*)pNd)->getLayoutFrm( GetLayout() );
if ( pFrm )
pFly = pFrm->FindFlyFrm();
break;
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index d6d13316a1e9..e4a668ec3a99 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -108,7 +108,7 @@ SwFlyFrm *GetFlyFromMarked( const SdrMarkList *pLst, ViewShell *pSh )
if ( pLst && pLst->GetMarkCount() == 1 )
{
SdrObject *pO = pLst->GetMark( 0 )->GetMarkedSdrObj();
- if ( pO->ISA(SwVirtFlyDrawObj) )
+ if ( pO && pO->ISA(SwVirtFlyDrawObj) )
return ((SwVirtFlyDrawObj*)pO)->GetFlyFrm();
}
return 0;
@@ -601,7 +601,7 @@ bool SwFEShell::IsSelContainsControl() const
// if we have one marked object, get the SdrObject and check
// whether it contains a control
const SdrObject* pSdrObject = pMarkList->GetMark( 0 )->GetMarkedSdrObj();
- bRet = CheckControlLayer( pSdrObject );
+ bRet = pSdrObject && CheckControlLayer( pSdrObject );
}
return bRet;
}
@@ -957,6 +957,8 @@ short SwFEShell::GetLayerId() const
for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
{
const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
+ if( !pObj )
+ continue;
if ( nRet == SHRT_MAX )
nRet = pObj->GetLayer();
else if ( nRet != pObj->GetLayer() )
@@ -994,6 +996,8 @@ void SwFEShell::ChangeOpaque( SdrLayerID nLayerId )
for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj();
+ if( !pObj )
+ continue;
// OD 21.08.2003 #i18447# - no change of layer for controls
// or group objects containing controls.
const bool bControlObj = ::CheckControlLayer( pObj );
@@ -1658,12 +1662,12 @@ BOOL SwFEShell::ImpEndCreate()
SwPosition aPos( GetDoc()->GetNodes() );
SwCrsrMoveState aState( MV_SETONLYTEXT );
Point aPoint( aPt.X(), aPt.Y() + rBound.GetHeight()/2 );
- getIDocumentLayoutAccess()->GetRootFrm()->GetCrsrOfst( &aPos, aPoint, &aState );
+ GetLayout()->GetCrsrOfst( &aPos, aPoint, &aState ); //swmod 080317
//JP 22.01.99: Zeichenbindung ist im ReadnOnly-Inhalt nicht erlaubt
if( !aPos.nNode.GetNode().IsProtect() )
{
- pAnch = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aPoint, &aPos );
+ pAnch = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aPoint, &aPos );
SwRect aTmp;
pAnch->GetCharRect( aTmp, aPos );
@@ -1711,7 +1715,7 @@ BOOL SwFEShell::ImpEndCreate()
// die naechste nicht READONLY Position suchen?
bAtPage = true;
- pAnch = aPos.nNode.GetNode().GetCntntNode()->GetFrm( &aPoint, 0, FALSE );
+ pAnch = aPos.nNode.GetNode().GetCntntNode()->getLayoutFrm( GetLayout(), &aPoint, 0, FALSE );
if( !bAtPage )
{
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index ad2e077e5d7c..399c2f5ee8cf 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -1167,7 +1167,7 @@ USHORT lcl_GetRowNumber( const SwPosition& rPos )
const SwCntntFrm *pFrm;
if( 0 != ( pNd = rPos.nNode.GetNode().GetCntntNode() ))
- pFrm = pNd->GetFrm( &aTmpPt, &rPos, FALSE );
+ pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aTmpPt, &rPos, FALSE );
else
pFrm = 0;
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 02baddd201bd..5c3c18988501 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -124,10 +124,17 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt,
Point aPt( *pPt );
GetLayout()->GetCrsrOfst( &aPos, aPt );
SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode();
- pFrm = pNd->GetFrm( pPt );
+ pFrm = pNd->getLayoutFrm( GetLayout(), pPt );
}
else
+ {
+ const bool bOldCallbackActionEnabled = GetLayout()->IsCallbackActionEnabled();
+ if( bOldCallbackActionEnabled )
+ GetLayout()->SetCallbackActionEnabled( FALSE );
pFrm = GetCurrFrm();
+ if( bOldCallbackActionEnabled )
+ GetLayout()->SetCallbackActionEnabled( TRUE );
+ }
}
if( !pFrm )
@@ -264,7 +271,7 @@ USHORT SwFEShell::GetFrmType( const Point *pPt, BOOL bStopAtFly ) const
Point aPt( *pPt );
GetLayout()->GetCrsrOfst( &aPos, aPt );
SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode();
- pFrm = pNd->GetFrm( pPt );
+ pFrm = pNd->getLayoutFrm( GetLayout(), pPt );
}
else
pFrm = GetCurrFrm( FALSE );
@@ -423,7 +430,7 @@ void SwFEShell::SetNewPageOffset( USHORT nOffset )
void SwFEShell::SetPageOffset( USHORT nOffset )
{
const SwPageFrm *pPage = GetCurrFrm( FALSE )->FindPageFrm();
- const SwRootFrm* pLayout = GetLayout();
+ const SwRootFrm* pDocLayout = GetLayout();
while ( pPage )
{
const SwFrm *pFlow = pPage->FindFirstBodyCntnt();
@@ -434,7 +441,7 @@ void SwFEShell::SetPageOffset( USHORT nOffset )
const SwFmtPageDesc& rPgDesc = pFlow->GetAttrSet()->GetPageDesc();
if ( rPgDesc.GetNumOffset() )
{
- pLayout->SetVirtPageNum( TRUE );
+ pDocLayout->SetVirtPageNum( TRUE );
lcl_SetAPageOffset( nOffset, (SwPageFrm*)pPage, this );
break;
}
@@ -521,6 +528,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
{
SdrObject* pDrawObj = rMrkList.GetMark(i)->GetMarkedSdrObj();
+ if( pDrawObj )
aDrawObjs.push_back( pDrawObj );
}
}
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index 8cabf285e12b..9f48c725dc4b 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -194,7 +194,7 @@ void GetTblSelCrs( const SwTableCursor& rTblCrsr, SwSelBoxes& rBoxes )
if( rTblCrsr.IsChgd() || !rTblCrsr.GetBoxesCount() )
{
SwTableCursor* pTCrsr = (SwTableCursor*)&rTblCrsr;
- pTCrsr->GetDoc()->GetRootFrm()->MakeTblCrsrs( *pTCrsr );
+ pTCrsr->GetDoc()->GetCurrentLayout()->MakeTblCrsrs( *pTCrsr ); //swmod 080218
}
if( rTblCrsr.GetBoxesCount() )
@@ -289,10 +289,10 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes,
}
const SwCntntNode *pCntNd = rCrsr.GetCntntNode();
const SwLayoutFrm *pStart = pCntNd ?
- pCntNd->GetFrm( &aPtPos )->GetUpper() : 0;
+ pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aPtPos )->GetUpper() : 0;
pCntNd = rCrsr.GetCntntNode(FALSE);
const SwLayoutFrm *pEnd = pCntNd ?
- pCntNd->GetFrm( &aMkPos )->GetUpper() : 0;
+ pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(), &aMkPos )->GetUpper() : 0;
if( pStart && pEnd )
GetTblSel( pStart, pEnd, rBoxes, 0, eSearchType );
}
@@ -501,10 +501,10 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
// OD 07.11.2003 #i22135# - Also the content of the table could be
// invisible - e.g. in a hidden section
// Robust: check, if content was found (e.g. empty table cells)
- if ( !pCNd || pCNd->GetFrm() == NULL )
+ if ( !pCNd || pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) == NULL )
return FALSE;
- const SwLayoutFrm *pStart = pCNd ? pCNd->GetFrm( &aNullPos )->GetUpper() : 0;
+ const SwLayoutFrm *pStart = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aNullPos )->GetUpper() : 0;
ASSERT( pStart, "ohne Frame geht gar nichts" );
aIdx = rEndNd;
@@ -513,12 +513,12 @@ BOOL ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
pCNd = aIdx.GetNodes().GoNextSection( &aIdx, FALSE, FALSE );
// OD 07.11.2003 #i22135# - Robust: check, if content was found and if it's visible
- if ( !pCNd || pCNd->GetFrm() == NULL )
+ if ( !pCNd || pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout() ) == NULL )
{
return FALSE;
}
- const SwLayoutFrm *pEnd = pCNd ? pCNd->GetFrm( &aNullPos )->GetUpper() : 0;
+ const SwLayoutFrm *pEnd = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aNullPos )->GetUpper() : 0;
ASSERT( pEnd, "ohne Frame geht gar nichts" );
@@ -774,9 +774,9 @@ BOOL GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
if ( rShell.IsTableMode() )
pCrsr = rShell.pTblCrsr;
- const SwLayoutFrm *pStart = pCrsr->GetCntntNode()->GetFrm(
+ const SwLayoutFrm *pStart = pCrsr->GetCntntNode()->getLayoutFrm( rShell.GetLayout(),
&pCrsr->GetPtPos() )->GetUpper(),
- *pEnd = pCrsr->GetCntntNode(FALSE)->GetFrm(
+ *pEnd = pCrsr->GetCntntNode(FALSE)->getLayoutFrm( rShell.GetLayout(),
&pCrsr->GetMkPos() )->GetUpper();
const SwLayoutFrm* pSttCell = pStart;
@@ -1014,9 +1014,12 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
// das die 1. Headline mit drin ist.
// Point aPt( rShell.GetCharRect().Pos() );
Point aPt( 0, 0 );
- const SwLayoutFrm *pStart = rPam.GetCntntNode()->GetFrm(
- &aPt )->GetUpper(),
- *pEnd = rPam.GetCntntNode(FALSE)->GetFrm(
+
+ const SwCntntNode* pCntNd = rPam.GetCntntNode();
+ const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
+ &aPt )->GetUpper();
+ pCntNd = rPam.GetCntntNode(FALSE);
+ const SwLayoutFrm *pEnd = rPam.GetCntntNode(FALSE)->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
&aPt )->GetUpper();
SwSelUnions aUnions;
@@ -1525,9 +1528,11 @@ USHORT CheckMergeSel( const SwPaM& rPam )
// richtig. Warum nicht Point 0,0 benutzen? Dann ist garantiert,
// das die 1. Headline mit drin ist.
Point aPt;
- const SwLayoutFrm *pStart = rPam.GetCntntNode()->GetFrm(
- &aPt )->GetUpper(),
- *pEnd = rPam.GetCntntNode(FALSE)->GetFrm(
+ const SwCntntNode* pCntNd = rPam.GetCntntNode();
+ const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
+ &aPt )->GetUpper();
+ pCntNd = rPam.GetCntntNode(FALSE);
+ const SwLayoutFrm *pEnd = rPam.GetCntntNode(FALSE)->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
&aPt )->GetUpper();
GetTblSel( pStart, pEnd, aBoxes, 0 );
return CheckMergeSel( aBoxes );
@@ -2082,9 +2087,12 @@ BOOL CheckSplitCells( const SwCursor& rCrsr, USHORT nDiv,
aPtPos = pShCrsr->GetPtPos();
aMkPos = pShCrsr->GetMkPos();
}
- const SwLayoutFrm *pStart = rCrsr.GetCntntNode()->GetFrm(
- &aPtPos )->GetUpper(),
- *pEnd = rCrsr.GetCntntNode(FALSE)->GetFrm(
+
+ const SwCntntNode* pCntNd = rCrsr.GetCntntNode();
+ const SwLayoutFrm *pStart = pCntNd->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
+ &aPtPos )->GetUpper();
+ pCntNd = rCrsr.GetCntntNode(FALSE);
+ const SwLayoutFrm *pEnd = rCrsr.GetCntntNode(FALSE)->getLayoutFrm( pCntNd->GetDoc()->GetCurrentLayout(),
&aMkPos )->GetUpper();
SWRECTFN( pStart->GetUpper() )
@@ -2143,7 +2151,7 @@ BOOL CheckSplitCells( const SwCursor& rCrsr, USHORT nDiv,
void lcl_InsertRow( SwTableLine &rLine, SwLayoutFrm *pUpper, SwFrm *pSibling )
{
- SwRowFrm *pRow = new SwRowFrm( rLine );
+ SwRowFrm *pRow = new SwRowFrm( rLine, pUpper );
if ( pUpper->IsTabFrm() && ((SwTabFrm*)pUpper)->IsFollow() )
{
SwTabFrm* pTabFrm = (SwTabFrm*)pUpper;
@@ -2430,8 +2438,7 @@ void lcl_UpdateRepeatedHeadlines( SwTabFrm& rTabFrm, bool bCalcLowers )
const USHORT nRepeat = rTable.GetRowsToRepeat();
for ( USHORT nIdx = 0; nIdx < nRepeat; ++nIdx )
{
- SwRowFrm* pHeadline = new SwRowFrm(
- *rTable.GetTabLines()[ nIdx ] );
+ SwRowFrm* pHeadline = new SwRowFrm( *rTable.GetTabLines()[ nIdx ], &rTabFrm );
pHeadline->SetRepeatedHeadline( true );
pHeadline->Paste( &rTabFrm, pLower );
pHeadline->RegistFlys();
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index bcbdc826dd66..772f776d92c2 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -213,7 +213,7 @@ BOOL SwGrfNode::ReRead(
if( refLink.Is() )
{
- if( GetFrm() )
+ if( getLayoutFrm( GetDoc()->GetCurrentLayout() ) )
{
SwMsgPoolItem aMsgHint( RES_GRF_REREAD_AND_INCACHE );
Modify( &aMsgHint, &aMsgHint );
@@ -597,7 +597,7 @@ BOOL SwGrfNode::RestorePersistentData()
IDocumentLinksAdministration* pIDLA = getIDocumentLinksAdministration();
refLink->SetVisible( pIDLA->IsVisibleLinks() );
pIDLA->GetLinkManager().InsertDDELink( refLink );
- if( getIDocumentLayoutAccess()->GetRootFrm() )
+ if( getIDocumentLayoutAccess()->GetCurrentLayout() ) //swmod 080218
refLink->Update();
}
return TRUE;
diff --git a/sw/source/core/inc/bodyfrm.hxx b/sw/source/core/inc/bodyfrm.hxx
index 9bd12a45205f..1ab39ff1578c 100644
--- a/sw/source/core/inc/bodyfrm.hxx
+++ b/sw/source/core/inc/bodyfrm.hxx
@@ -41,7 +41,7 @@ protected:
~SwBodyFrm();
#endif
public:
- SwBodyFrm( SwFrmFmt* );
+ SwBodyFrm( SwFrmFmt*, SwFrm* );
DECL_FIXEDMEMPOOL_NEWDEL(SwBodyFrm)
};
diff --git a/sw/source/core/inc/cellfrm.hxx b/sw/source/core/inc/cellfrm.hxx
index fb479fc86549..2f2b81e6ebe9 100644
--- a/sw/source/core/inc/cellfrm.hxx
+++ b/sw/source/core/inc/cellfrm.hxx
@@ -43,7 +43,7 @@ protected:
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
public:
- SwCellFrm( const SwTableBox &, bool bInsertContent = true );
+ SwCellFrm( const SwTableBox &, SwFrm*, bool bInsertContent = true );
~SwCellFrm();
virtual BOOL GetCrsrOfst( SwPosition *, Point&, SwCrsrMoveState* = 0 ) const;
diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx
index 6d915bc72a8b..5050c5172606 100644
--- a/sw/source/core/inc/cntfrm.hxx
+++ b/sw/source/core/inc/cntfrm.hxx
@@ -68,7 +68,7 @@ protected:
virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
- SwCntntFrm( SwCntntNode * const );
+ SwCntntFrm( SwCntntNode * const, SwFrm* );
public:
virtual ~SwCntntFrm();
diff --git a/sw/source/core/inc/colfrm.hxx b/sw/source/core/inc/colfrm.hxx
index 4d8a54528aa5..90bb547c3333 100644
--- a/sw/source/core/inc/colfrm.hxx
+++ b/sw/source/core/inc/colfrm.hxx
@@ -33,7 +33,7 @@
class SwColumnFrm: public SwFtnBossFrm
{
public:
- SwColumnFrm( SwFrmFmt* );
+ SwColumnFrm( SwFrmFmt*, SwFrm* );
~SwColumnFrm();
DECL_FIXEDMEMPOOL_NEWDEL(SwColumnFrm)
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index cadac60cb8ca..a346fd5a9e2d 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -58,7 +58,6 @@ class SwFlyFrm : public SwLayoutFrm, public SwAnchoredObject
{
//darf Locken. Definiert in frmtool.cxx
friend void AppendObjs ( const SwSpzFrmFmts *, ULONG, SwFrm *, SwPageFrm * );
- friend void AppendAllObjs( const SwSpzFrmFmts * );
friend void Notify( SwFlyFrm *, SwPageFrm *pOld, const SwRect &rOld,
const SwRect* pOldPrt );
@@ -131,7 +130,7 @@ protected:
Size CalcRel( const SwFmtFrmSize &rSz ) const;
SwTwips CalcAutoWidth() const;
- SwFlyFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+ SwFlyFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
/** method to assure that anchored object is registered at the correct
page frame
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index 105d1f117f9e..a648c1175138 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -68,7 +68,7 @@ protected:
virtual void NotifyBackground( SwPageFrm *pPage,
const SwRect& rRect, PrepareHint eHint);
- SwFlyFreeFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+ SwFlyFreeFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
public:
// --> OD 2004-06-29 #i28701#
@@ -130,7 +130,7 @@ public:
// --> OD 2004-06-29 #i28701#
TYPEINFO();
- SwFlyLayFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+ SwFlyLayFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
SwFlyLayFrm( SwFlyLayFrm& );
virtual void Modify( SfxPoolItem*, SfxPoolItem* );
@@ -159,7 +159,7 @@ public:
// --> OD 2004-06-29 #i28701#
TYPEINFO();
- SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+ SwFlyAtCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
virtual void Modify( SfxPoolItem*, SfxPoolItem* );
@@ -198,7 +198,7 @@ public:
// --> OD 2004-06-29 #i28701#
TYPEINFO();
- SwFlyInCntFrm( SwFlyFrmFmt*, SwFrm *pAnchor );
+ SwFlyInCntFrm( SwFlyFrmFmt*, SwFrm*, SwFrm *pAnchor );
virtual ~SwFlyInCntFrm();
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 552555e925f9..1cf116a66b4c 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -277,6 +277,7 @@ class SwFrm: public SwClient
const sal_uInt32 mnFrmId;
// <--
+ SwRootFrm *mpRoot;
SwLayoutFrm *pUpper;
SwFrm *pNext;
SwFrm *pPrev;
@@ -403,6 +404,9 @@ protected:
void ColLock() { bColLocked = TRUE; }
void ColUnlock() { bColLocked = FALSE; }
+ // Only used by SwRootFrm Ctor to get 'this' into mpRoot...
+ void setRootFrm( SwRootFrm* pRoot ) { mpRoot = pRoot; }
+
SwPageFrm *InsertPage( SwPageFrm *pSibling, BOOL bFtn );
void PrepareMake();
void OptPrepareMake();
@@ -425,7 +429,7 @@ protected:
SwModify *GetDep() { return pRegisteredIn; }
const SwModify *GetDep() const { return pRegisteredIn; }
- SwFrm( SwModify* );
+ SwFrm( SwModify*, SwFrm* );
void CheckDir( UINT16 nDir, BOOL bVert, BOOL bOnlyBiDi, BOOL bBrowse );
@@ -614,10 +618,6 @@ public:
inline BOOL HasFixSize() const { return bFixSize; }
inline void SetFixSize( BOOL bNew ) { bFixSize = bNew; }
- //Kann 0 liefern, pruefen auch ob die Shell zum richtigen Dokument
- //gehoert. Impl in frmsh.hxx
- ViewShell *GetShell() const;
-
//Prueft alle Seiten ab der Uebergebenen und korrigiert ggf.
static void CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields = TRUE );
@@ -625,7 +625,7 @@ public:
SwFrm *GetNext() { return pNext; }
SwFrm *GetPrev() { return pPrev; }
SwLayoutFrm *GetUpper() { return pUpper; }
- SwRootFrm *FindRootFrm();
+ SwRootFrm *getRootFrm(){ return mpRoot; }
SwPageFrm *FindPageFrm();
SwFrm *FindColFrm();
SwFtnBossFrm *FindFtnBossFrm( BOOL bFootnotes = FALSE );
@@ -638,6 +638,7 @@ public:
const SwFrm *GetNext() const { return pNext; }
const SwFrm *GetPrev() const { return pPrev; }
const SwLayoutFrm *GetUpper() const { return pUpper; }
+ const SwRootFrm *getRootFrm() const { return mpRoot; }
inline SwTabFrm *FindTabFrm();
inline SwFtnFrm *FindFtnFrm();
inline SwFlyFrm *FindFlyFrm();
@@ -648,7 +649,6 @@ public:
// <--
inline SwFrm *FindPrev();
inline const SwPageFrm *FindPageFrm() const;
- inline const SwRootFrm *FindRootFrm() const;
inline const SwFtnBossFrm *FindFtnBossFrm( BOOL bFtn = FALSE ) const;
inline const SwFrm *FindColFrm() const;
inline const SwFrm *FindFooterOrHeader() const;
@@ -1077,10 +1077,6 @@ inline const SwPageFrm *SwFrm::FindPageFrm() const
{
return ((SwFrm*)this)->FindPageFrm();
}
-inline const SwRootFrm *SwFrm::FindRootFrm() const
-{
- return ((SwFrm*)this)->FindRootFrm();
-}
inline const SwFrm *SwFrm::FindColFrm() const
{
return ((SwFrm*)this)->FindColFrm();
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 94befc1dca59..dcc24294ca4b 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -37,6 +37,7 @@
class SwPageFrm;
class SwFlyFrm;
class SwCntntFrm;
+class SwRootFrm;
class SwDoc;
class SwAttrSet;
class SdrObject;
@@ -138,7 +139,7 @@ const SwFrm * MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage );
// JP 07.05.98: wird von SwCntntNode::GetFrm und von SwFlyFrm::GetFrm
// gerufen
-SwFrm* GetFrmOfModify( SwModify const&, USHORT const nFrmType, const Point* = 0,
+SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const&, USHORT const nFrmType, const Point* = 0,
const SwPosition *pPos = 0,
const BOOL bCalcFrm = FALSE );
diff --git a/sw/source/core/inc/ftnboss.hxx b/sw/source/core/inc/ftnboss.hxx
index 8b9ea8348395..49c803609020 100644
--- a/sw/source/core/inc/ftnboss.hxx
+++ b/sw/source/core/inc/ftnboss.hxx
@@ -70,7 +70,7 @@ protected:
void InsertFtn( SwFtnFrm * );
static void ResetFtn( const SwFtnFrm *pAssumed );
public:
- inline SwFtnBossFrm( SwFrmFmt* pFmt) : SwLayoutFrm( pFmt ) {}
+ inline SwFtnBossFrm( SwFrmFmt* pFmt, SwFrm* pSib ) : SwLayoutFrm( pFmt, pSib ) {}
SwLayoutFrm *FindBodyCont();
inline const SwLayoutFrm *FindBodyCont() const;
diff --git a/sw/source/core/inc/ftnfrm.hxx b/sw/source/core/inc/ftnfrm.hxx
index f8db9fabdf2d..7dc72c081f56 100644
--- a/sw/source/core/inc/ftnfrm.hxx
+++ b/sw/source/core/inc/ftnfrm.hxx
@@ -43,7 +43,7 @@ class SwFtnFrm;
class SwFtnContFrm: public SwLayoutFrm
{
public:
- SwFtnContFrm( SwFrmFmt* );
+ SwFtnContFrm( SwFrmFmt*, SwFrm* );
const SwFtnFrm* FindFootNote() const;
@@ -79,7 +79,7 @@ protected:
public:
- SwFtnFrm( SwFrmFmt*, SwCntntFrm*, SwTxtFtn* );
+ SwFtnFrm( SwFrmFmt*, SwFrm*, SwCntntFrm*, SwTxtFtn* );
virtual void Cut();
virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
diff --git a/sw/source/core/inc/hffrm.hxx b/sw/source/core/inc/hffrm.hxx
index ff25552abc27..95cbe84ebe68 100644
--- a/sw/source/core/inc/hffrm.hxx
+++ b/sw/source/core/inc/hffrm.hxx
@@ -39,7 +39,7 @@ protected:
void FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs);
inline BOOL GetEatSpacing() const; // in hffrm.cxx
public:
- SwHeadFootFrm(SwFrmFmt * pFrm, USHORT aType);
+ SwHeadFootFrm(SwFrmFmt * pFrm, SwFrm*, USHORT aType);
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
virtual SwTwips GrowFrm( SwTwips,
BOOL bTst = FALSE, BOOL bInfo = FALSE );
@@ -50,7 +50,7 @@ public:
class SwHeaderFrm: public SwHeadFootFrm
{
public:
- SwHeaderFrm( SwFrmFmt* pFrm ) : SwHeadFootFrm(pFrm, FRMC_HEADER) {};
+ SwHeaderFrm( SwFrmFmt* pFrm, SwFrm* pSib ) : SwHeadFootFrm(pFrm, pSib, FRMC_HEADER) {};
DECL_FIXEDMEMPOOL_NEWDEL(SwHeaderFrm)
};
@@ -58,7 +58,7 @@ public:
class SwFooterFrm: public SwHeadFootFrm
{
public:
- SwFooterFrm( SwFrmFmt* pFrm ) : SwHeadFootFrm(pFrm, FRMC_FOOTER) {};
+ SwFooterFrm( SwFrmFmt* pFrm, SwFrm* pSib ) : SwHeadFootFrm(pFrm, pSib, FRMC_FOOTER) {};
DECL_FIXEDMEMPOOL_NEWDEL(SwFooterFrm)
};
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index 28216e326b41..76abd86f1538 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -102,7 +102,7 @@ public:
const SwCrsrMoveState *pCMS = 0,
const BOOL bDefaultExpand = TRUE ) const;
- SwLayoutFrm( SwFrmFmt* );
+ SwLayoutFrm( SwFrmFmt*, SwFrm* );
~SwLayoutFrm();
virtual void Paint( const SwRect&, const SwPrtOptions *pPrintData = NULL ) const;
diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx
index 7782a6b90d98..b2e6f45f6c67 100644
--- a/sw/source/core/inc/notxtfrm.hxx
+++ b/sw/source/core/inc/notxtfrm.hxx
@@ -52,7 +52,7 @@ class SwNoTxtFrm: public SwCntntFrm
protected:
virtual void MakeAll();
public:
- SwNoTxtFrm( SwNoTxtNode * const );
+ SwNoTxtFrm( SwNoTxtNode * const, SwFrm* );
~SwNoTxtFrm();
virtual void Modify( SfxPoolItem*, SfxPoolItem* );
diff --git a/sw/source/core/inc/pagefrm.hxx b/sw/source/core/inc/pagefrm.hxx
index bc2fef9b8be4..9c0b8af55e95 100644
--- a/sw/source/core/inc/pagefrm.hxx
+++ b/sw/source/core/inc/pagefrm.hxx
@@ -195,7 +195,7 @@ protected:
public:
DECL_FIXEDMEMPOOL_NEWDEL(SwPageFrm)
- SwPageFrm( SwFrmFmt*, SwPageDesc* );
+ SwPageFrm( SwFrmFmt*, SwFrm*, SwPageDesc* );
~SwPageFrm();
//public, damit die ViewShell beim Umschalten vom BrowseMode darauf
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index ee894a0ef539..b6660978c5dd 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -165,6 +165,11 @@ public:
//MasterObjekte aus der Page entfernen (von den Ctoren gerufen).
static void RemoveMasterObjs( SdrPage *pPg );
+ void AllCheckPageDescs() const;//swmod 080226
+ void AllInvalidateAutoCompleteWords() const;//swmod 080305
+ void AllAddPaintRect() const;
+ void AllRemoveFtns() ;//swmod 080305
+ void AllInvalidateSmartTagsOrSpelling(BOOL bSmartTags) const;//swmod 080307
//Virtuelles Device ausgeben (z.B. wenn Animationen ins Spiel kommen)
static BOOL FlushVout();
//Clipping sparen, wenn im Vout eh genau das Cliprechteck ausgegeben wird
diff --git a/sw/source/core/inc/rowfrm.hxx b/sw/source/core/inc/rowfrm.hxx
index 7f772e10913f..18ce78dc41ff 100644
--- a/sw/source/core/inc/rowfrm.hxx
+++ b/sw/source/core/inc/rowfrm.hxx
@@ -56,7 +56,7 @@ protected:
virtual void MakeAll();
public:
- SwRowFrm( const SwTableLine &, bool bInsertContent = true );
+ SwRowFrm( const SwTableLine &, SwFrm*, bool bInsertContent = true );
~SwRowFrm();
virtual void Cut();
diff --git a/sw/source/core/inc/sectfrm.hxx b/sw/source/core/inc/sectfrm.hxx
index 3f677ec51932..f32d5cdba1e3 100644
--- a/sw/source/core/inc/sectfrm.hxx
+++ b/sw/source/core/inc/sectfrm.hxx
@@ -60,7 +60,7 @@ protected:
virtual BOOL ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL bHead, BOOL &rReformat );
virtual void Format( const SwBorderAttrs *pAttrs = 0 );
public:
- SwSectionFrm( SwSection & ); //Inhalt wird nicht erzeugt!
+ SwSectionFrm( SwSection &, SwFrm* ); //Inhalt wird nicht erzeugt!
SwSectionFrm( SwSectionFrm &, BOOL bMaster );//_Nur_ zum Erzeugen von Master/Follows
~SwSectionFrm();
diff --git a/sw/source/core/inc/tabfrm.hxx b/sw/source/core/inc/tabfrm.hxx
index 3f55c6bdf0ec..f5f8975c228e 100644
--- a/sw/source/core/inc/tabfrm.hxx
+++ b/sw/source/core/inc/tabfrm.hxx
@@ -113,7 +113,7 @@ protected:
//Aendert nur die Framesize, nicht die PrtArea-SSize
virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
public:
- SwTabFrm( SwTable & ); //Immer nach dem erzeugen _und_ pasten das
+ SwTabFrm( SwTable &, SwFrm* ); //Immer nach dem erzeugen _und_ pasten das
//Regist Flys rufen!
SwTabFrm( SwTabFrm & ); //_Nur_ zum erzeugen von Follows
~SwTabFrm();
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 5a8783df261b..42593b174314 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -337,7 +337,7 @@ public:
inline const SwTxtNode *GetTxtNode() const
{ return (SwTxtNode*)SwCntntFrm::GetNode(); }
- SwTxtFrm(SwTxtNode * const);
+ SwTxtFrm(SwTxtNode * const, SwFrm* );
virtual ~SwTxtFrm();
// SwCntntFrm: der "kurze Dienstweg" fuer die Frames.
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 37ec80632153..cc645e674e70 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2544,7 +2544,7 @@ SwRect SwFrmFmt::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint,
else
{
sal_uInt16 nFrmType = RES_FLYFRMFMT == Which() ? FRM_FLY : USHRT_MAX;
- pFrm = ::GetFrmOfModify( *(SwModify*)this, nFrmType, pPoint,
+ pFrm = ::GetFrmOfModify( 0, *(SwModify*)this, nFrmType, pPoint,
0, bCalcFrm );
}
@@ -2578,7 +2578,7 @@ SdrObject* SwFrmFmt::FindRealSdrObject()
if( RES_FLYFRMFMT == Which() )
{
Point aNullPt;
- SwFlyFrm* pFly = (SwFlyFrm*)::GetFrmOfModify( *this, FRM_FLY,
+ SwFlyFrm* pFly = (SwFlyFrm*)::GetFrmOfModify( 0, *this, FRM_FLY,
&aNullPt, 0, sal_False );
return pFly ? pFly->GetVirtDrawObj() : 0;
}
@@ -2701,8 +2701,8 @@ SwFlyFrmFmt::~SwFlyFrmFmt()
void SwFlyFrmFmt::MakeFrms()
{
// gibts ueberhaupt ein Layout ??
- if( !GetDoc()->GetRootFrm() )
- return;
+ if( !GetDoc()->GetCurrentViewShell() )
+ return; //swmod 071108//swmod 071225
SwModify *pModify = 0;
// OD 24.07.2003 #111032# - create local copy of anchor attribute for possible changes.
@@ -2764,7 +2764,7 @@ void SwFlyFrmFmt::MakeFrms()
case FLY_AT_PAGE:
{
sal_uInt16 nPgNum = aAnchorAttr.GetPageNum();
- SwPageFrm *pPage = (SwPageFrm*)GetDoc()->GetRootFrm()->Lower();
+ SwPageFrm *pPage = (SwPageFrm*)GetDoc()->GetCurrentLayout()->Lower(); //swmod 080218
if( !nPgNum && aAnchorAttr.GetCntntAnchor() )
{
SwCntntNode *pCNd =
@@ -2858,16 +2858,16 @@ void SwFlyFrmFmt::MakeFrms()
switch( aAnchorAttr.GetAnchorId() )
{
case FLY_AT_FLY:
- pFly = new SwFlyLayFrm( this, pFrm );
+ pFly = new SwFlyLayFrm( this, pFrm, pFrm );
break;
case FLY_AT_PARA:
case FLY_AT_CHAR:
- pFly = new SwFlyAtCntFrm( this, pFrm );
+ pFly = new SwFlyAtCntFrm( this, pFrm, pFrm );
break;
case FLY_AS_CHAR:
- pFly = new SwFlyInCntFrm( this, pFrm );
+ pFly = new SwFlyInCntFrm( this, pFrm, pFrm );
break;
default:
ASSERT( !this, "Neuer Ankertyp" )
@@ -2884,7 +2884,7 @@ void SwFlyFrmFmt::MakeFrms()
SwFlyFrm* SwFlyFrmFmt::GetFrm( const Point* pPoint, const sal_Bool bCalcFrm ) const
{
- return (SwFlyFrm*)::GetFrmOfModify( *(SwModify*)this, FRM_FLY,
+ return (SwFlyFrm*)::GetFrmOfModify( 0, *(SwModify*)this, FRM_FLY,
pPoint, 0, bCalcFrm );
}
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 28287c957ad1..4db476eab8b6 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -33,6 +33,7 @@
#include "viewsh.hxx"
#include "doc.hxx"
#include "viewimp.hxx"
+#include "viewopt.hxx"
#include "swtypes.hxx"
#include "dflyobj.hxx"
#include "dcontact.hxx"
@@ -179,9 +180,9 @@ BOOL SwCntntFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL & )
//determine space left in new upper frame
nSpace = (aRect.*fnRectX->fnGetHeight)();
-
+ const ViewShell *pSh = pNewUpper->getRootFrm()->GetCurrShell();
if ( IsInFtn() ||
- pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) ||
+ (pSh && pSh->GetViewOptions()->getBrowseMode()) ||
pNewUpper->IsCellFrm() ||
( pNewUpper->IsInSct() && ( pNewUpper->IsSctFrm() ||
( pNewUpper->IsColBodyFrm() &&
@@ -732,8 +733,8 @@ void SwPageFrm::MakeAll()
pAttrs = pAccess->Get();
}
//Bei der BrowseView gelten feste Einstellungen.
- ViewShell *pSh = GetShell();
- if ( pSh && GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if ( pSh && pSh->GetViewOptions()->getBrowseMode() )
{
const Size aBorder = pSh->GetOut()->PixelToLogic( pSh->GetBrowseBorder() );
const long nTop = pAttrs->CalcTopLine() + aBorder.Height();
@@ -986,11 +987,11 @@ BOOL SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs )
const long nRight = ((SwBorderAttrs&)rAttrs).CalcRight( this );
(this->*fnRect->fnSetXMargins)( nLeft, nRight );
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
SwTwips nWidthArea;
if( pSh && 0!=(nWidthArea=(pSh->VisArea().*fnRect->fnGetWidth)()) &&
GetUpper()->IsPageBodyFrm() && // nicht dagegen bei BodyFrms in Columns
- pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ pSh->GetViewOptions()->getBrowseMode() )
{
//Nicht ueber die Kante des sichbaren Bereiches hinausragen.
//Die Seite kann breiter sein, weil es Objekte mit "ueberbreite"
diff --git a/sw/source/core/layout/colfrm.cxx b/sw/source/core/layout/colfrm.cxx
index f64752a18708..3a295a80cbb0 100644
--- a/sw/source/core/layout/colfrm.cxx
+++ b/sw/source/core/layout/colfrm.cxx
@@ -58,11 +58,11 @@ void lcl_RemoveFtns( SwFtnBossFrm* pBoss, BOOL bPageOnly, BOOL bEndNotes );
|* Letzte Aenderung AMA 30. Oct 98
|*
|*************************************************************************/
-SwColumnFrm::SwColumnFrm( SwFrmFmt *pFmt ):
- SwFtnBossFrm( pFmt )
+SwColumnFrm::SwColumnFrm( SwFrmFmt *pFmt, SwFrm* pSib ):
+ SwFtnBossFrm( pFmt, pSib )
{
nType = FRMC_COLUMN;
- SwBodyFrm* pColBody = new SwBodyFrm( pFmt->GetDoc()->GetDfltFrmFmt() );
+ SwBodyFrm* pColBody = new SwBodyFrm( pFmt->GetDoc()->GetDfltFrmFmt(), pSib );
pColBody->InsertBehind( this, 0 ); // ColumnFrms jetzt mit BodyFrm
SetMaxFtnHeight( LONG_MAX );
}
@@ -174,7 +174,7 @@ static BOOL lcl_AddColumns( SwLayoutFrm *pCont, USHORT nCount )
}
for ( USHORT i = 0; i < nCount; ++i )
{
- SwColumnFrm *pTmpCol = new SwColumnFrm( pNeighbourCol->GetFmt() );
+ SwColumnFrm *pTmpCol = new SwColumnFrm( pNeighbourCol->GetFmt(), pCont );
pTmpCol->SetMaxFtnHeight( nMax );
pTmpCol->InsertBefore( pCont, NULL );
pNeighbourCol = (SwLayoutFrm*)pNeighbourCol->GetNext();
@@ -186,7 +186,7 @@ static BOOL lcl_AddColumns( SwLayoutFrm *pCont, USHORT nCount )
for ( USHORT i = 0; i < nCount; ++i )
{
SwFrmFmt *pFmt = pDoc->MakeFrmFmt( aEmptyStr, pDoc->GetDfltFrmFmt());
- SwColumnFrm *pTmp = new SwColumnFrm( pFmt );
+ SwColumnFrm *pTmp = new SwColumnFrm( pFmt, pCont );
pTmp->SetMaxFtnHeight( nMax );
pTmp->Paste( pCont );
}
@@ -248,7 +248,7 @@ void SwLayoutFrm::ChgColumns( const SwFmtCol &rOld, const SwFmtCol &rNew,
// SaveCntnt wuerde auch den Inhalt der Fussnotencontainer aufsaugen
// und im normalen Textfluss unterbringen.
if( IsPageBodyFrm() )
- pDoc->GetRootFrm()->RemoveFtns( (SwPageFrm*)GetUpper(), TRUE, FALSE );
+ pDoc->GetCurrentLayout()->RemoveFtns( (SwPageFrm*)GetUpper(), TRUE, FALSE ); //swmod 080218
pSave = ::SaveCntnt( this );
//Wenn Spalten existieren, jetzt aber eine Spaltenanzahl von
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 8a1e8fe9ea7a..dfdc76263efc 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -468,22 +468,6 @@ const SwCntntFrm* SwCntntFrm::ImplGetNextCntntFrm( bool bFwd ) const
|* Letzte Aenderung MA 05. Sep. 93
|*
|*************************************************************************/
-SwRootFrm* SwFrm::FindRootFrm()
-{
- // MIB: A layout frame is always registerd at a SwFrmFmt and a content
- // frame alyways at a SwCntntNode. For any other case we won't find
- // a root frame.
- // Casting the GetDep() result instead of the frame itself (that has
- // been done before) makes it save to use that method in constructors
- // and destructors.
- ASSERT( GetDep(), "frame is not registered any longer" );
- ASSERT( IsLayoutFrm() || IsCntntFrm(), "invalid frame type" );
- SwDoc *pDoc = IsLayoutFrm()
- ? static_cast < SwFrmFmt * >( GetDep() )->GetDoc()
- : static_cast < SwCntntNode * >( GetDep() )->GetDoc();
- return pDoc->GetRootFrm();
-}
-
SwPageFrm* SwFrm::FindPageFrm()
{
SwFrm *pRet = this;
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index d0015b12114d..4c35ff65ea27 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -30,11 +30,13 @@
#include "pam.hxx"
#include "swtable.hxx"
#include "frame.hxx"
+#include "rootfrm.hxx"
#include "pagefrm.hxx"
#include "flyfrm.hxx"
#include "viewsh.hxx"
#include "doc.hxx"
#include "viewimp.hxx"
+#include "viewopt.hxx"
#include "dflyobj.hxx"
#include "frmtool.hxx"
#include "dcontact.hxx"
@@ -604,7 +606,7 @@ void SwFlowFrm::MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling )
ASSERT( rThis.GetUpper(), "Wo kommen wir denn her?" );
//Sparsamer benachrichtigen wenn eine Action laeuft.
- ViewShell *pSh = rThis.GetShell();
+ ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
const SwViewImp *pImp = pSh ? pSh->Imp() : 0;
const BOOL bComplete = pImp && pImp->IsAction() && pImp->GetLayAction().IsComplete();
@@ -1042,12 +1044,13 @@ SwLayoutFrm *SwFrm::GetNextLeaf( MakePageType eMakePage )
return pLayLeaf;
SwPageFrm *pNew = pLayLeaf->FindPageFrm();
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
// #111704# The pagedesc check does not make sense for frames in fly frames
if ( pNew != FindPageFrm() && !bNewPg && !IsInFly() &&
// --> FME 2005-05-10 #i46683#
// Do not consider page descriptions in browse mode (since
// MoveBwd ignored them)
- !pNew->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ !(pSh && pSh->GetViewOptions()->getBrowseMode() ) )
// <--
{
if( WrongPageDesc( pNew ) )
@@ -1173,7 +1176,8 @@ BOOL SwFlowFrm::IsPrevObjMove() const
// und fuer diesen ggf. Umbrechen.
//!!!!!!!!!!!Hack!!!!!!!!!!!
- if ( rThis.GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ const ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
return FALSE;
SwFrm *pPre = rThis.FindPrev();
@@ -1252,9 +1256,11 @@ BOOL SwFlowFrm::IsPrevObjMove() const
BOOL SwFlowFrm::IsPageBreak( BOOL bAct ) const
{
if ( !IsFollow() && rThis.IsInDocBody() &&
- ( !rThis.IsInTab() || ( rThis.IsTabFrm() && !rThis.GetUpper()->IsInTab() ) ) && // i66968
- !rThis.GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ ( !rThis.IsInTab() || ( rThis.IsTabFrm() && !rThis.GetUpper()->IsInTab() ) ) ) // i66968
{
+ const ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
+ return FALSE;
const SwAttrSet *pSet = rThis.GetAttrSet();
//Vorgaenger ermitteln
@@ -2113,7 +2119,7 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways )
rThis.Prepare( PREP_BOSS_CHGD, 0, FALSE );
if( !bSamePage )
{
- ViewShell *pSh = rThis.GetShell();
+ ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
if ( pSh && !pSh->Imp()->IsUpdateExpFlds() )
pSh->GetDoc()->SetNewFldLst(true); //Wird von CalcLayout() hinterher erledigt!
@@ -2125,7 +2131,9 @@ BOOL SwFlowFrm::MoveFwd( BOOL bMakePage, BOOL bPageBreak, BOOL bMoveAlways )
}
}
// OD 30.10.2002 #97265# - no <CheckPageDesc(..)> in online layout
- if ( !pNewPage->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ const ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
+
+ if ( !( pSh && pSh->GetViewOptions()->getBrowseMode() ) )
{
// --> OD 2009-12-31 #i106452#
// check page description not only in situation with sections.
@@ -2593,7 +2601,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
{
//Kann sein, dass ich einen Container bekam.
SwFtnFrm *pOld = rThis.FindFtnFrm();
- SwFtnFrm *pNew = new SwFtnFrm( pOld->GetFmt(),
+ SwFtnFrm *pNew = new SwFtnFrm( pOld->GetFmt(), pOld,
pOld->GetRef(), pOld->GetAttr() );
if ( pOld->GetMaster() )
{
@@ -2674,7 +2682,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
if( pNewPage != pOldPage )
{
rThis.Prepare( PREP_BOSS_CHGD, (const void*)pOldPage, FALSE );
- ViewShell *pSh = rThis.GetShell();
+ ViewShell *pSh = rThis.getRootFrm()->GetCurrShell();
if ( pSh && !pSh->Imp()->IsUpdateExpFlds() )
pSh->GetDoc()->SetNewFldLst(true); //Wird von CalcLayout() hinterher eledigt!
@@ -2684,7 +2692,7 @@ BOOL SwFlowFrm::MoveBwd( BOOL &rbReformat )
pNewPage->InvalidateWordCount();
// OD 30.10.2002 #97265# - no <CheckPageDesc(..)> in online layout
- if ( !pNewPage->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( !( pSh && pSh->GetViewOptions()->getBrowseMode() ) )
{
if ( bCheckPageDescs && pNewPage->GetNext() )
{
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index cd590d73ddcc..79ea87a6aef8 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -77,6 +77,7 @@
#include "pam.hxx"
#include "frmatr.hxx"
#include "viewimp.hxx"
+#include "viewopt.hxx"
#include "errhdl.hxx"
#include "dcontact.hxx"
#include "dflyobj.hxx"
@@ -111,8 +112,8 @@ TYPEINIT2(SwFlyFrm,SwLayoutFrm,SwAnchoredObject);
|*
|*************************************************************************/
-SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
- SwLayoutFrm( pFmt ),
+SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
+ SwLayoutFrm( pFmt, pSib ),
// OD 2004-03-22 #i26791#
SwAnchoredObject(),
// OD 2004-05-27 #i26791# - moved to <SwAnchoredObject>
@@ -149,11 +150,16 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
bInvalidVert = 0;
bDerivedVert = 0;
bDerivedR2L = 0;
- if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir
- || pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir )
+ bVertical = 0;
+ else
+ {
+ const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
bVertical = 0;
else
bVertical = 1;
+ }
bVert = bVertical;
bInvalidR2L = 0;
if( FRMDIR_HORI_RIGHT_TOP == nDir )
@@ -288,7 +294,7 @@ SwFlyFrm::~SwFlyFrm()
// anchor will do that.
if( IsAccessibleFrm() && GetFmt() && (IsFlyInCntFrm() || !GetAnchorFrm()) )
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() )
{
ViewShell *pVSh = pRootFrm->GetCurrShell();
@@ -428,7 +434,7 @@ void SwFlyFrm::FinitDrawObj()
//Bei den SdrPageViews abmelden falls das Objekt dort noch selektiert ist.
if ( !GetFmt()->GetDoc()->IsInDtor() )
{
- ViewShell *p1St = GetShell();
+ ViewShell *p1St = getRootFrm()->GetCurrShell();
if ( p1St )
{
ViewShell *pSh = p1St;
@@ -524,10 +530,13 @@ void SwFlyFrm::ChainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow )
}
// invalidate accessible relation set (accessibility wrapper)
- ViewShell* pSh = pMaster->GetShell();
- if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
+ ViewShell* pSh = pMaster->getRootFrm()->GetCurrShell();
+ if( pSh )
+ {
+ SwRootFrm* pLayout = pMaster->getRootFrm();
+ if( pLayout && pLayout->IsAnyShellAccessible() )
pSh->Imp()->InvalidateAccessibleRelationSet( pMaster, pFollow );
-
+ }
}
void SwFlyFrm::UnchainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow )
@@ -567,10 +576,14 @@ void SwFlyFrm::UnchainFrames( SwFlyFrm *pMaster, SwFlyFrm *pFollow )
pFollow->GetFmt()->GetDoc(), ++nIndex );
// invalidate accessible relation set (accessibility wrapper)
- ViewShell* pSh = pMaster->GetShell();
- if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
+ ViewShell* pSh = pMaster->getRootFrm()->GetCurrShell();
+ if( pSh )
+ {
+ SwRootFrm* pLayout = pMaster->getRootFrm();
+ if( pLayout && pLayout->IsAnyShellAccessible() )
pSh->Imp()->InvalidateAccessibleRelationSet( pMaster, pFollow );
}
+}
/*************************************************************************
|*
@@ -772,7 +785,7 @@ void SwFlyFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
if ( ( nInvFlags & 0x40 ) && Lower() && Lower()->IsNoTxtFrm() )
ClrContourCache( GetVirtDrawObj() );
SwRootFrm *pRoot;
- if ( nInvFlags & 0x20 && 0 != (pRoot = FindRootFrm()) )
+ if ( nInvFlags & 0x20 && 0 != (pRoot = getRootFrm()) )
pRoot->InvalidateBrowseWidth();
// --> OD 2004-06-28 #i28701#
if ( nInvFlags & 0x80 )
@@ -794,7 +807,7 @@ void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
{
BOOL bClear = TRUE;
const USHORT nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0;
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
switch( nWhich )
{
case RES_VERT_ORIENT:
@@ -846,8 +859,12 @@ void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
const SvxProtectItem *pP = (SvxProtectItem*)pNew;
GetVirtDrawObj()->SetMoveProtect( pP->IsPosProtected() );
GetVirtDrawObj()->SetResizeProtect( pP->IsSizeProtected() );
- if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
+ if( pSh )
+ {
+ SwRootFrm* pLayout = getRootFrm();
+ if( pLayout && pLayout->IsAnyShellAccessible() )
pSh->Imp()->InvalidateAccessibleEditableState( sal_True, this );
+ }
break;
}
@@ -958,8 +975,8 @@ void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
case RES_LR_SPACE:
{
rInvFlags |= 0x41;
- if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
- GetFmt()->GetDoc()->GetRootFrm()->InvalidateBrowseWidth();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
+ getRootFrm()->InvalidateBrowseWidth();
SwRect aNew( GetObjRectWithSpaces() );
SwRect aOld( aFrm );
if ( RES_UL_SPACE == nWhich )
@@ -1000,11 +1017,15 @@ void SwFlyFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
pIDDMA->GetHeavenId() :
pIDDMA->GetHellId();
GetVirtDrawObj()->SetLayer( nId );
- if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
+ if( pSh )
+ {
+ SwRootFrm* pLayout = getRootFrm();
+ if( pLayout && pLayout->IsAnyShellAccessible() )
{
pSh->Imp()->DisposeAccessibleFrm( this );
pSh->Imp()->AddAccessibleFrm( this );
}
+ }
// --> OD 2004-06-28 #i28701# - perform reorder of object lists
// at anchor frame and at page frame.
rInvFlags |= 0x80;
@@ -2194,7 +2215,7 @@ void SwFrm::RemoveFly( SwFlyFrm *pToRemove )
pToRemove->GetFmt() &&
!pToRemove->IsFlyInCntFrm() )
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() )
{
ViewShell *pVSh = pRootFrm->GetCurrShell();
@@ -2261,9 +2282,11 @@ void SwFrm::AppendDrawObj( SwAnchoredObject& _rNewObj )
}
// Notify accessible layout.
- ViewShell* pSh = GetShell();
- if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
+ ViewShell* pSh = getRootFrm()->GetCurrShell();
+ if( pSh )
{
+ SwRootFrm* pLayout = getRootFrm();
+ if( pLayout && pLayout->IsAnyShellAccessible() )
pSh->Imp()->AddAccessibleObj( _rNewObj.GetDrawObj() );
}
}
@@ -2271,9 +2294,11 @@ void SwFrm::AppendDrawObj( SwAnchoredObject& _rNewObj )
void SwFrm::RemoveDrawObj( SwAnchoredObject& _rToRemoveObj )
{
// Notify accessible layout.
- ViewShell* pSh = GetShell();
- if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
+ ViewShell* pSh = getRootFrm()->GetCurrShell();
+ if( pSh )
{
+ SwRootFrm* pLayout = getRootFrm();
+ if( pLayout && pLayout->IsAnyShellAccessible() )
pSh->Imp()->DisposeAccessibleObj( _rToRemoveObj.GetDrawObj() );
}
@@ -2493,10 +2518,10 @@ Size SwFlyFrm::CalcRel( const SwFmtFrmSize &rSz ) const
if( pRel ) // LAYER_IMPL
{
long nRelWidth = LONG_MAX, nRelHeight = LONG_MAX;
- const ViewShell *pSh = GetShell();
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( ( pRel->IsBodyFrm() || pRel->IsPageFrm() ) &&
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
- pSh && pSh->VisArea().HasArea() )
+ pSh && pSh->GetViewOptions()->getBrowseMode() &&
+ pSh->VisArea().HasArea() )
{
nRelWidth = pSh->GetBrowseWidth();
nRelHeight = pSh->VisArea().Height();
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 4d9b654fb79c..7f3dc5e2a027 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -29,7 +29,6 @@
#include "precompiled_sw.hxx"
#include <tools/bigint.hxx>
#include "pagefrm.hxx"
-#include "rootfrm.hxx"
#include "cntfrm.hxx"
#include "flyfrm.hxx"
#include "txtfrm.hxx"
@@ -83,8 +82,8 @@ using namespace ::com::sun::star;
|*
|*************************************************************************/
-SwFlyAtCntFrm::SwFlyAtCntFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
- SwFlyFreeFrm( pFmt, pAnch )
+SwFlyAtCntFrm::SwFlyAtCntFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
+ SwFlyFreeFrm( pFmt, pSib, pAnch )
{
bAtCnt = TRUE;
bAutoPosition = (FLY_AT_CHAR == pFmt->GetAnchor().GetAnchorId());
@@ -194,7 +193,7 @@ void SwFlyAtCntFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if ( !pCntnt )
{
SwCntntNode *pNode = aNewIdx.GetNode().GetCntntNode();
- pCntnt = pNode->GetFrm( &pOldAnchor->Frm().Pos(), 0, FALSE );
+ pCntnt = pNode->getLayoutFrm( getRootFrm(), &pOldAnchor->Frm().Pos(), 0, FALSE );
ASSERT( pCntnt, "Neuen Anker nicht gefunden" );
}
//Flys haengen niemals an einem Follow sondern immer am
diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx
index 61fb9163c6f1..2d64357e0e20 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -52,8 +52,8 @@ void DeepCalc( const SwFrm *pFrm );
|* Letzte Aenderung MA 09. Apr. 99
|*
|*************************************************************************/
-SwFlyInCntFrm::SwFlyInCntFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
- SwFlyFrm( pFmt, pAnch )
+SwFlyInCntFrm::SwFlyInCntFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
+ SwFlyFrm( pFmt, pSib, pAnch )
{
bInCnt = bInvalidLayout = bInvalidCntnt = TRUE;
SwTwips nRel = pFmt->GetVertOrient().GetPos();
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 63d067c175b4..26445d82a9e0 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -74,8 +74,8 @@ using namespace ::com::sun::star;
|*
|*************************************************************************/
-SwFlyFreeFrm::SwFlyFreeFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
- SwFlyFrm( pFmt, pAnch ),
+SwFlyFreeFrm::SwFlyFreeFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
+ SwFlyFrm( pFmt, pSib, pAnch ),
pPage( 0 ),
// --> OD 2004-11-15 #i34753#
mbNoMakePos( false ),
@@ -548,8 +548,8 @@ bool SwFlyFreeFrm::IsFormatPossible() const
|*
|*************************************************************************/
-SwFlyLayFrm::SwFlyLayFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
- SwFlyFreeFrm( pFmt, pAnch )
+SwFlyLayFrm::SwFlyLayFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
+ SwFlyFreeFrm( pFmt, pSib, pAnch )
{
bLayout = TRUE;
}
@@ -600,7 +600,7 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if ( FLY_AT_PAGE == pAnch->GetAnchorId() )
{
USHORT nPgNum = pAnch->GetPageNum();
- SwRootFrm *pRoot = FindRootFrm();
+ SwRootFrm *pRoot = getRootFrm();
SwPageFrm *pTmpPage = (SwPageFrm*)pRoot->Lower();
for ( USHORT i = 1; (i <= nPgNum) && pTmpPage; ++i,
pTmpPage = (SwPageFrm*)pTmpPage->GetNext() )
@@ -622,7 +622,7 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
{
SwNodeIndex aIdx( pAnch->GetCntntAnchor()->nNode );
SwCntntFrm *pCntnt = GetFmt()->GetDoc()->GetNodes().GoNext( &aIdx )->
- GetCntntNode()->GetFrm( 0, 0, FALSE );
+ GetCntntNode()->getLayoutFrm( getRootFrm(), 0, 0, FALSE );
if( pCntnt )
{
SwFlyFrm *pTmp = pCntnt->FindFlyFrm();
@@ -653,7 +653,7 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
{
if ( !pNew->GetVirtDrawObj()->IsInserted() )
- FindRootFrm()->GetDrawPage()->InsertObject(
+ getRootFrm()->GetDrawPage()->InsertObject(
(SdrObject*)pNew->GetVirtDrawObj(),
pNew->GetVirtDrawObj()->GetReferencedObj().GetOrdNumDirect() );
@@ -765,7 +765,7 @@ void SwPageFrm::AppendFlyToPage( SwFlyFrm *pNew )
void SwPageFrm::RemoveFlyFromPage( SwFlyFrm *pToRemove )
{
const UINT32 nOrdNum = pToRemove->GetVirtDrawObj()->GetOrdNum();
- FindRootFrm()->GetDrawPage()->RemoveObject( nOrdNum );
+ getRootFrm()->GetDrawPage()->RemoveObject( nOrdNum );
pToRemove->GetVirtDrawObj()->ReferencedObj().SetOrdNum( nOrdNum );
if ( GetUpper() )
@@ -1036,7 +1036,7 @@ void SwPageFrm::PlaceFly( SwFlyFrm* pFly, SwFlyFrmFmt* pFmt )
AppendFly( pFly );
else
{ ASSERT( pFmt, ":-( kein Format fuer Fly uebergeben." );
- pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, this );
+ pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, this, this );
AppendFly( pFly );
::RegistFlys( this, pFly );
}
diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx
index c724ad8779db..ae27eb8ed805 100644
--- a/sw/source/core/layout/flypos.cxx
+++ b/sw/source/core/layout/flypos.cxx
@@ -58,7 +58,7 @@ SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt,
{
pNdIdx = new SwNodeIndex( rIdx );
}
- else if( pFmt->GetDoc()->GetRootFrm() )
+ else if( pFmt->GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
SwClientIter aIter( (SwFmt&)*pFmt );
if( RES_FLYFRMFMT == pFmt->Which() )
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 395009122063..7da50d2d0dae 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -56,6 +56,7 @@
#include "doc.hxx"
#include "fesh.hxx"
#include "viewimp.hxx"
+#include "viewopt.hxx"
#include "pam.hxx"
#include "dflyobj.hxx"
#include "dcontact.hxx"
@@ -275,7 +276,7 @@ SwFrmNotify::~SwFrmNotify()
{
if( pFrm->IsAccessibleFrm() )
{
- SwRootFrm *pRootFrm = pFrm->FindRootFrm();
+ SwRootFrm *pRootFrm = pFrm->getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -410,7 +411,7 @@ SwFrmNotify::~SwFrmNotify()
}
else if( pFrm->IsTxtFrm() && bValidSize != pFrm->GetValidSizeFlag() )
{
- SwRootFrm *pRootFrm = pFrm->FindRootFrm();
+ SwRootFrm *pRootFrm = pFrm->getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -607,13 +608,16 @@ SwLayNotify::~SwLayNotify()
if ( pLay->IsTabFrm() )
//Damit _nur_ der Shatten bei Groessenaenderungen gemalt wird.
((SwTabFrm*)pLay)->SetComplete();
- else if ( !pLay->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ||
+ else
+ {
+ const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell();
+ if( !( pSh && pSh->GetViewOptions()->getBrowseMode() ) ||
!(pLay->GetType() & (FRM_BODY | FRM_PAGE)) )
//Damit die untergeordneten sauber retouchiert werden.
//Problembsp: Flys an den Henkeln packen und verkleinern.
//Nicht fuer Body und Page, sonst flackerts beim HTML-Laden.
pLay->SetCompletePaint();
-
+ }
}
//Lower benachrichtigen wenn sich die Position veraendert hat.
const BOOL bPrtPos = POS_DIFF( aPrt, pLay->Prt() );
@@ -728,7 +732,7 @@ SwFlyNotify::~SwFlyNotify()
SwFlyFrm *pFly = GetFly();
if ( pFly->IsNotifyBack() )
{
- ViewShell *pSh = pFly->GetShell();
+ ViewShell *pSh = pFly->getRootFrm()->GetCurrShell();
SwViewImp *pImp = pSh ? pSh->Imp() : 0;
if ( !pImp || !pImp->IsAction() || !pImp->GetLayAction().IsAgain() )
{
@@ -945,7 +949,7 @@ SwCntntNotify::~SwCntntNotify()
{
//Aktive PlugIn's oder OLE-Objekte sollten etwas von der Veraenderung
//mitbekommen, damit sie Ihr Window entsprechend verschieben.
- ViewShell *pSh = pCnt->GetShell();
+ ViewShell *pSh = pCnt->getRootFrm()->GetCurrShell();
if ( pSh )
{
SwOLENode *pNd;
@@ -1182,9 +1186,9 @@ void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex,
{
SwFlyFrm *pFly;
if( bFlyAtFly )
- pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, pFrm );
+ pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, pFrm, pFrm );
else
- pFly = new SwFlyAtCntFrm( (SwFlyFrmFmt*)pFmt, pFrm );
+ pFly = new SwFlyAtCntFrm( (SwFlyFrmFmt*)pFmt, pFrm, pFrm );
pFly->Lock();
pFrm->AppendFly( pFly );
pFly->Unlock();
@@ -1196,18 +1200,27 @@ void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex,
}
}
-BOOL MA_FASTCALL lcl_ObjConnected( SwFrmFmt *pFmt )
+bool lcl_ObjConnected( SwFrmFmt *pFmt, const SwFrm* pSib )
{
SwClientIter aIter( *pFmt );
if ( RES_FLYFRMFMT == pFmt->Which() )
- return 0 != aIter.First( TYPE(SwFlyFrm) );
+ {
+ const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : 0;
+ const SwFlyFrm* pTmpFrm;
+ for( pTmpFrm = (SwFlyFrm*)aIter.First( TYPE( SwFlyFrm )); pTmpFrm;
+ pTmpFrm = (SwFlyFrm*)aIter.Next() )
+ {
+ if(! pRoot || pRoot == pTmpFrm->getRootFrm() )
+ return true;
+ }
+ }
else
{
SwDrawContact *pContact;
if ( 0 != (pContact = (SwDrawContact*)aIter.First( TYPE(SwDrawContact))))
return pContact->GetAnchorFrm() != 0;
}
- return FALSE;
+ return false;
}
/** helper method to determine, if a <SwFrmFmt>, which has an object connected,
@@ -1219,9 +1232,6 @@ BOOL MA_FASTCALL lcl_ObjConnected( SwFrmFmt *pFmt )
*/
bool lcl_InHeaderOrFooter( SwFrmFmt& _rFmt )
{
- ASSERT( lcl_ObjConnected( &_rFmt ),
- "::lcl_InHeaderOrFooter(..) - <SwFrmFmt> has no connected object" );
-
bool bRetVal = false;
const SwFmtAnchor& rAnch = _rFmt.GetAnchor();
@@ -1234,7 +1244,7 @@ bool lcl_InHeaderOrFooter( SwFrmFmt& _rFmt )
return bRetVal;
}
-void AppendAllObjs( const SwSpzFrmFmts *pTbl )
+void AppendAllObjs( const SwSpzFrmFmts *pTbl, const SwFrm* pSib )
{
//Verbinden aller Objekte, die in der SpzTbl beschrieben sind mit dem
//Layout.
@@ -1262,7 +1272,7 @@ void AppendAllObjs( const SwSpzFrmFmts *pTbl )
//will ich hier nicht.
bRemove = TRUE;
}
- else if ( FALSE == (bRemove = ::lcl_ObjConnected( pFmt )) ||
+ else if ( FALSE == (bRemove = ::lcl_ObjConnected( pFmt, pSib )) ||
::lcl_InHeaderOrFooter( *pFmt ) )
{
// OD 23.06.2003 #108784# - correction: for objects in header
@@ -1272,7 +1282,7 @@ void AppendAllObjs( const SwSpzFrmFmts *pTbl )
//keine abhaengigen Existieren, andernfalls, oder wenn das
//MakeFrms keine abhaengigen erzeugt, entfernen.
pFmt->MakeFrms();
- bRemove = ::lcl_ObjConnected( pFmt );
+ bRemove = ::lcl_ObjConnected( pFmt, pSib );
}
if ( bRemove )
{
@@ -1308,9 +1318,9 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
SwFrm *pPrv )
{
pDoc->BlockIdling();
- SwRootFrm* pLayout = pDoc->GetRootFrm();
- const BOOL bOldCallbackActionEnabled = pLayout ? pLayout->IsCallbackActionEnabled() : sal_False;
- if(pLayout)
+ SwRootFrm* pLayout = pLay->getRootFrm();
+ const BOOL bOldCallbackActionEnabled = pLayout ? pLayout->IsCallbackActionEnabled() : FALSE;
+ if( bOldCallbackActionEnabled )
pLayout->SetCallbackActionEnabled( FALSE );
//Bei der Erzeugung des Layouts wird bPages mit TRUE uebergeben. Dann
@@ -1390,8 +1400,8 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
if ( pNd->IsCntntNode() )
{
SwCntntNode* pNode = (SwCntntNode*)pNd;
- pFrm = pNode->IsTxtNode() ? new SwTxtFrm( (SwTxtNode*)pNode ) :
- pNode->MakeFrm();
+ pFrm = pNode->IsTxtNode() ? new SwTxtFrm( (SwTxtNode*)pNode, pLay ) :
+ pNode->MakeFrm( pLay );
if( pPageMaker )
pPageMaker->CheckInsert( nIndex );
@@ -1403,7 +1413,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
if ( pFrm->IsTxtFrm() )
{
- ViewShell* pViewShell( pFrm->GetShell() );
+ ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() );
// no notification, if <ViewShell> is in construction
if ( pViewShell && !pViewShell->IsInConstructor() &&
pViewShell->GetLayout() &&
@@ -1443,7 +1453,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
pDoc->UpdateTblFlds( &aMsgHnt );
pTblNode->GetTable().GCLines();
- pFrm = pTblNode->MakeFrm();
+ pFrm = pTblNode->MakeFrm( pLay );
if( pPageMaker )
pPageMaker->CheckInsert( nIndex );
@@ -1455,7 +1465,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
// Relation CONTENT_FLOWS_FROM for next paragraph will change
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
{
- ViewShell* pViewShell( pFrm->GetShell() );
+ ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() );
// no notification, if <ViewShell> is in construction
if ( pViewShell && !pViewShell->IsInConstructor() &&
pViewShell->GetLayout() &&
@@ -1493,7 +1503,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
nIndex = pNode->EndOfSectionIndex();
else
{
- pFrm = pNode->MakeFrm();
+ pFrm = pNode->MakeFrm( pLay );
pActualSection = new SwActualSection( pActualSection,
(SwSectionFrm*)pFrm, pNode );
if ( pActualSection->GetUpper() )
@@ -1532,7 +1542,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
// Relation CONTENT_FLOWS_FROM for next paragraph will change
// and relation CONTENT_FLOWS_TO for previous paragraph will change.
{
- ViewShell* pViewShell( pFrm->GetShell() );
+ ViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() );
// no notification, if <ViewShell> is in construction
if ( pViewShell && !pViewShell->IsInConstructor() &&
pViewShell->GetLayout() &&
@@ -1604,7 +1614,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
}
// new section frame
- pFrm = pActualSection->GetSectionNode()->MakeFrm();
+ pFrm = pActualSection->GetSectionNode()->MakeFrm( pLay );
pFrm->InsertBehind( pLay, pPrv );
static_cast<SwSectionFrm*>(pFrm)->Init();
@@ -1682,7 +1692,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
if ( bPages ) //Jetzt noch die Flys verbinden lassen.
{
if ( !bDontCreateObjects )
- AppendAllObjs( pTbl );
+ AppendAllObjs( pTbl, pLayout );
bObjsDirect = TRUE;
}
@@ -1702,7 +1712,7 @@ void MA_FASTCALL _InsertCnt( SwLayoutFrm *pLay, SwDoc *pDoc,
}
pDoc->UnblockIdling();
- if(pLayout)
+ if( bOldCallbackActionEnabled )
pLayout->SetCallbackActionEnabled( bOldCallbackActionEnabled );
}
@@ -1885,7 +1895,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
{
const SwSpzFrmFmts *pTbl = pDoc->GetSpzFrmFmts();
if( pTbl->Count() )
- AppendAllObjs( pTbl );
+ AppendAllObjs( pTbl, pUpper );
}
// Wenn nichts eingefuegt wurde, z.B. ein ausgeblendeter Bereich,
@@ -1912,7 +1922,7 @@ void MakeFrms( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
if( !pSct->ContainsCntnt() )
{
pSct->DelEmpty( TRUE );
- pDoc->GetRootFrm()->RemoveFromList( pSct );
+ pUpper->getRootFrm()->RemoveFromList( pSct );
delete pSct;
}
}
@@ -2903,11 +2913,11 @@ SwPageFrm * MA_FASTCALL InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper,
{
SwPageDesc *pTmpDesc = pSibling && pSibling->GetPrev() ?
((SwPageFrm*)pSibling->GetPrev())->GetPageDesc() : &rDesc;
- pRet = new SwPageFrm( pDoc->GetEmptyPageFmt(), pTmpDesc );
+ pRet = new SwPageFrm( pDoc->GetEmptyPageFmt(), pUpper, pTmpDesc );
pRet->Paste( pUpper, pSibling );
pRet->PreparePage( bFtn );
}
- pRet = new SwPageFrm( pFmt, &rDesc );
+ pRet = new SwPageFrm( pFmt, pUpper, &rDesc );
pRet->Paste( pUpper, pSibling );
pRet->PreparePage( bFtn );
if ( pRet->GetNext() )
@@ -3019,7 +3029,7 @@ void Notify( SwFlyFrm *pFly, SwPageFrm *pOld, const SwRect &rOld,
//Der Einfachheit halber wird hier bewusst jeweils ein Twip
//unnoetig invalidiert.
- ViewShell *pSh = pFly->GetShell();
+ ViewShell *pSh = pFly->getRootFrm()->GetCurrShell();
if( pSh && rOld.HasArea() )
pSh->InvalidateWindows( rOld );
@@ -3317,7 +3327,7 @@ void Notify_Background( const SdrObject* pObj,
// --> OD 2008-01-30 #i82258# - make code robust
ViewShell* pSh = 0;
if ( bInva && pPage &&
- 0 != (pSh = pPage->GetShell()) )
+ 0 != (pSh = pPage->getRootFrm()->GetCurrShell()) )
{
pSh->InvalidateWindows( rRect );
}
@@ -3382,7 +3392,7 @@ BOOL Is_Lower_Of( const SwFrm *pCurrFrm, const SdrObject* pObj )
}
else
{
- pFrm = ( (SwDrawContact*)GetUserCall(pObj) )->GetAnchorFrm();
+ pFrm = ( (SwDrawContact*)GetUserCall(pObj) )->GetAnchorFrm(pObj);
aPos = pObj->GetCurrentBoundRect().TopLeft();
}
ASSERT( pFrm, "8-( Fly is lost in Space." );
@@ -3516,7 +3526,7 @@ const SwFrm* MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage )
return pPage;
}
-SwFrm* GetFrmOfModify( SwModify const& rMod, USHORT const nFrmType,
+SwFrm* GetFrmOfModify( const SwRootFrm* pLayout, SwModify const& rMod, USHORT const nFrmType,
const Point* pPoint, const SwPosition *pPos, const BOOL bCalcFrm )
{
SwFrm *pMinFrm = 0, *pTmpFrm;
@@ -3533,6 +3543,7 @@ SwFrm* GetFrmOfModify( SwModify const& rMod, USHORT const nFrmType,
pTmpFrm = (SwFrm*)aIter.Next() )
{
if( pTmpFrm->GetType() & nFrmType &&
+ ( !pLayout || pLayout == pTmpFrm->getRootFrm() ) &&
(!pTmpFrm->IsFlowFrm() ||
!SwFlowFrm::CastFlowFrm( pTmpFrm )->IsFollow() ))
{
diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx
index 3dc03053a23f..b808f22452af 100644
--- a/sw/source/core/layout/ftnfrm.cxx
+++ b/sw/source/core/layout/ftnfrm.cxx
@@ -51,6 +51,8 @@
// --> OD 2005-05-17 #i49383#
#include <objectformatter.hxx>
// <--
+#include "viewopt.hxx"
+#include "viewsh.hxx"
/*************************************************************************
|*
@@ -214,8 +216,8 @@ USHORT lcl_ColumnNum( const SwFrm* pBoss )
|*************************************************************************/
-SwFtnContFrm::SwFtnContFrm( SwFrmFmt *pFmt ):
- SwLayoutFrm( pFmt )
+SwFtnContFrm::SwFtnContFrm( SwFrmFmt *pFmt, SwFrm* pSib ):
+ SwLayoutFrm( pFmt, pSib )
{
nType = FRMC_FTNCONT;
}
@@ -283,7 +285,14 @@ void SwFtnContFrm::Format( const SwBorderAttrs * )
if ( !bValidSize )
{
- if ( pPage->IsFtnPage() && !GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ bool bGrow = pPage->IsFtnPage();
+ if( bGrow )
+ {
+ const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
+ bGrow = false;
+ }
+ if( bGrow )
Grow( LONG_MAX, FALSE );
else
{
@@ -379,7 +388,8 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL )
return 0;
}
}
- const bool bBrowseMode = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
SwPageFrm *pPage = pBoss->FindPageFrm();
if ( bBrowseMode || !pPage->IsFtnPage() )
{
@@ -483,9 +493,19 @@ SwTwips SwFtnContFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL )
SwTwips SwFtnContFrm::ShrinkFrm( SwTwips nDiff, BOOL bTst, BOOL bInfo )
{
SwPageFrm *pPage = FindPageFrm();
- if ( pPage &&
- ( !pPage->IsFtnPage() ||
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ) )
+ bool bShrink = false;
+ if ( pPage )
+ {
+ if( !pPage->IsFtnPage() )
+ bShrink = true;
+ else
+ {
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
+ bShrink = true;
+ }
+ }
+ if( bShrink )
{
SwTwips nRet = SwLayoutFrm::ShrinkFrm( nDiff, bTst, bInfo );
if( IsInSct() && !bTst )
@@ -511,8 +531,8 @@ SwTwips SwFtnContFrm::ShrinkFrm( SwTwips nDiff, BOOL bTst, BOOL bInfo )
|*************************************************************************/
-SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwCntntFrm *pCnt, SwTxtFtn *pAt ):
- SwLayoutFrm( pFmt ),
+SwFtnFrm::SwFtnFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwCntntFrm *pCnt, SwTxtFtn *pAt ):
+ SwLayoutFrm( pFmt, pSib ),
pFollow( 0 ),
pMaster( 0 ),
pRef( pCnt ),
@@ -636,8 +656,8 @@ void SwFtnFrm::Cut()
if ( pPage )
{
SwLayoutFrm *pBody = pPage->FindBodyCont();
- if ( !pBody->ContainsCntnt() )
- pPage->FindRootFrm()->SetSuperfluous();
+ if( pBody && !pBody->ContainsCntnt() )
+ pPage->getRootFrm()->SetSuperfluous();
}
SwSectionFrm* pSect = pUp->FindSctFrm();
pUp->Cut();
@@ -1146,7 +1166,7 @@ SwFtnContFrm *SwFtnBossFrm::MakeFtnCont()
}
#endif
- SwFtnContFrm *pNew = new SwFtnContFrm( GetFmt()->GetDoc()->GetDfltFrmFmt());
+ SwFtnContFrm *pNew = new SwFtnContFrm( GetFmt()->GetDoc()->GetDfltFrmFmt(), this );
SwLayoutFrm *pLay = FindBodyCont();
pNew->Paste( this, pLay->GetNext() );
return pNew;
@@ -1379,6 +1399,8 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck )
if ( pLast->ISA(SwFrm) )
{
SwFrm *pFrm = (SwFrm*)pLast;
+ if( pFrm->getRootFrm() == pCheck->getRootFrm() )
+ {
SwFrm *pTmp = pFrm->GetUpper();
while ( pTmp && !pTmp->IsFtnFrm() )
pTmp = pTmp->GetUpper();
@@ -1397,6 +1419,7 @@ void SwFtnBossFrm::ResetFtn( const SwFtnFrm *pCheck )
}
}
}
+ }
pLast = ++aIter;
}
}
@@ -1830,7 +1853,7 @@ void SwFtnBossFrm::AppendFtn( SwCntntFrm *pRef, SwTxtFtn *pAttr )
}
}
- SwFtnFrm *pNew = new SwFtnFrm( pDoc->GetDfltFrmFmt(), pRef, pAttr );
+ SwFtnFrm *pNew = new SwFtnFrm( pDoc->GetDfltFrmFmt(), this, pRef, pAttr );
{
SwNodeIndex aIdx( *pAttr->GetStartNode(), 1 );
::_InsertCnt( pNew, pDoc, aIdx.GetIndex() );
@@ -2850,7 +2873,8 @@ void SwFtnBossFrm::SetFtnDeadLine( const SwTwips nDeadLine )
else
nMaxFtnHeight = -(pBody->Frm().*fnRect->fnBottomDist)( nDeadLine );
- if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
nMaxFtnHeight += pBody->Grow( LONG_MAX, TRUE );
if ( IsInSct() )
nMaxFtnHeight += FindSctFrm()->Grow( LONG_MAX, TRUE );
@@ -2932,9 +2956,12 @@ SwTwips SwFtnBossFrm::GetVarSpace() const
}
else
nRet = 0;
- if ( IsPageFrm() &&
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( IsPageFrm() )
+ {
+ const ViewShell *pSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
nRet += BROWSE_HEIGHT - Frm().Height();
+ }
return nRet;
}
@@ -3181,7 +3208,7 @@ BOOL SwCntntFrm::MoveFtnCntFwd( BOOL bMakePage, SwFtnBossFrm *pOldBoss )
//Fussnote erzeugen.
SwFtnFrm *pOld = FindFtnFrm();
pTmpFtn = new SwFtnFrm( pOld->GetFmt()->GetDoc()->GetDfltFrmFmt(),
- pOld->GetRef(), pOld->GetAttr() );
+ pOld, pOld->GetRef(), pOld->GetAttr() );
//Verkettung der Fussnoten.
if ( pOld->GetFollow() )
{
@@ -3315,7 +3342,7 @@ SwCntntFrm* SwFtnFrm::GetRefFromAttr()
ASSERT( pAttr, "invalid Attribute" );
SwTxtNode& rTNd = (SwTxtNode&)pAttr->GetTxtNode();
SwPosition aPos( rTNd, SwIndex( &rTNd, *pAttr->GetStart() ));
- SwCntntFrm* pCFrm = rTNd.GetFrm( 0, &aPos, FALSE );
+ SwCntntFrm* pCFrm = rTNd.getLayoutFrm( getRootFrm(), 0, &aPos, FALSE );
return pCFrm;
}
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index 79348f01d1e2..8155c7503cc8 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -35,7 +35,9 @@
#include <fmtcntnt.hxx>
#include <fmthdft.hxx>
#include <fmtfsize.hxx>
+#include "viewopt.hxx"
#include "hffrm.hxx"
+#include "rootfrm.hxx"
#include "txtfrm.hxx"
#include "sectfrm.hxx"
#include "flyfrm.hxx"
@@ -117,8 +119,8 @@ static void lcl_LayoutFrmEnsureMinHeight(SwLayoutFrm & rFrm,
}
}
-SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, USHORT nTypeIn)
- : SwLayoutFrm(pFmt)
+SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, SwFrm* pSib, USHORT nTypeIn)
+ : SwLayoutFrm( pFmt, pSib )
{
nType = nTypeIn;
SetDerivedVert( FALSE );
@@ -710,7 +712,8 @@ void SwPageFrm::PrepareHeader()
const SwFmtHeader &rH = ((SwFrmFmt*)pRegisteredIn)->GetHeader();
- const BOOL bOn = !((SwFrmFmt*)pRegisteredIn)->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const BOOL bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode());
if ( bOn && rH.IsActive() )
{ //Header einsetzen, vorher entfernen falls vorhanden.
@@ -727,7 +730,7 @@ void SwPageFrm::PrepareHeader()
delete pDel;
}
ASSERT( pLay, "Wohin mit dem Header?" );
- SwHeaderFrm *pH = new SwHeaderFrm( (SwFrmFmt*)rH.GetHeaderFmt() );
+ SwHeaderFrm *pH = new SwHeaderFrm( (SwFrmFmt*)rH.GetHeaderFmt(), this );
pH->Paste( this, pLay );
if ( GetUpper() )
::RegistFlys( this, pH );
@@ -760,7 +763,8 @@ void SwPageFrm::PrepareFooter()
while ( pLay->GetNext() )
pLay = (SwLayoutFrm*)pLay->GetNext();
- const BOOL bOn = !((SwFrmFmt*)pRegisteredIn)->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const BOOL bOn = !(pSh && pSh->GetViewOptions()->getBrowseMode());
if ( bOn && rF.IsActive() )
{ //Footer einsetzen, vorher entfernen falls vorhanden.
@@ -774,7 +778,7 @@ void SwPageFrm::PrepareFooter()
pLay->Cut();
delete pLay;
}
- SwFooterFrm *pF = new SwFooterFrm( (SwFrmFmt*)rF.GetFooterFmt() );
+ SwFooterFrm *pF = new SwFooterFrm( (SwFrmFmt*)rF.GetFooterFmt(), this );
pF->Paste( this );
if ( GetUpper() )
::RegistFlys( this, pF );
@@ -782,10 +786,10 @@ void SwPageFrm::PrepareFooter()
else if ( pLay && pLay->IsFooterFrm() )
{ //Footer entfernen falls vorhanden.
::DelFlys( pLay, this );
- ViewShell *pSh;
- if ( pLay->GetPrev() && 0 != (pSh = GetShell()) &&
- pSh->VisArea().HasArea() )
- pSh->InvalidateWindows( pSh->VisArea() );
+ ViewShell *pShell;
+ if ( pLay->GetPrev() && 0 != (pShell = getRootFrm()->GetCurrShell()) &&
+ pShell->VisArea().HasArea() )
+ pShell->InvalidateWindows( pShell->VisArea() );
pLay->Cut();
delete pLay;
}
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 1475a3909220..ded3f568fa04 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -438,7 +438,8 @@ BOOL SwLayAction::RemoveEmptyBrowserPages()
//Beim umschalten vom normalen in den Browsermodus bleiben u.U. einige
//unangenehm lange stehen. Diese beseiten wir mal schnell.
BOOL bRet = FALSE;
- if ( pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ const ViewShell *pSh = pRoot->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
{
SwPageFrm *pPage = (SwPageFrm*)pRoot->Lower();
do
@@ -1181,7 +1182,8 @@ const SwAnchoredObject* lcl_FindFirstInvaObj( const SwPageFrm* _pPage,
BOOL SwLayAction::IsShortCut( SwPageFrm *&prPage )
{
BOOL bRet = FALSE;
- const BOOL bBrowse = pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = pRoot->GetCurrShell();
+ const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
//Wenn die Seite nicht Gueltig ist wird sie schnell formatiert, sonst
//gibts nix als Aerger.
@@ -1430,19 +1432,14 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
BOOL bNoPaint = FALSE;
if ( pLay->IsPageBodyFrm() &&
pLay->Frm().Pos() == aOldRect.Pos() &&
- pLay->Lower() &&
- pLay->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ pLay->Lower() )
{
- //HotFix: Vobis Homepage, nicht so genau hinsehen, sonst
- //rpaints
-
+ const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell();
//Einschraenkungen wegen Kopf-/Fusszeilen
- if ( !( pLay->IsCompletePaint() &&
- pLay->FindPageFrm()->FindFtnCont() ) )
- {
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() &&
+ !( pLay->IsCompletePaint() && pLay->FindPageFrm()->FindFtnCont() ) )
bNoPaint = TRUE;
}
- }
if ( !bNoPaint && IsPaint() && bAddRect && (pLay->IsCompletePaint() || bChanged) )
{
@@ -1482,8 +1479,14 @@ BOOL SwLayAction::FormatLayout( SwLayoutFrm *pLay, BOOL bAddRect )
aPaint.Bottom( aPaint.Bottom() + nBorderWidth + nShadowWidth);
}
- if ( pLay->IsPageFrm() &&
- pLay->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ BOOL bPageInBrowseMode = pLay->IsPageFrm();
+ if( bPageInBrowseMode )
+ {
+ const ViewShell *pSh = pLay->getRootFrm()->GetCurrShell();
+ if( !pSh || !pSh->GetViewOptions()->getBrowseMode() )
+ bPageInBrowseMode = FALSE;
+ }
+ if( bPageInBrowseMode )
{
// NOTE: no vertical layout in online layout
//Ist die Aenderung ueberhaupt sichtbar?
@@ -1848,7 +1851,8 @@ BOOL SwLayAction::FormatLayoutTab( SwTabFrm *pTab, BOOL bAddRect )
BOOL SwLayAction::FormatCntnt( const SwPageFrm *pPage )
{
const SwCntntFrm *pCntnt = pPage->ContainsCntnt();
- const BOOL bBrowse = pRoot->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = pRoot->GetCurrShell();
+ const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
while ( pCntnt && pPage->IsAnLower( pCntnt ) )
{
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 39b8a60ef695..670d606fbc23 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -55,6 +55,8 @@
#include <frmtool.hxx>
#include <dflyobj.hxx>
#include <dcontact.hxx>
+#include "viewopt.hxx"
+#include "viewsh.hxx"
#include <flyfrm.hxx>
// OD 2004-05-24 #i28701#
#include <sortedobjs.hxx>
@@ -186,7 +188,7 @@ BOOL SwLayCacheImpl::Read( SvStream& rStream )
void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
{
- if( rDoc.GetRootFrm() ) // the layout itself ..
+ if( rDoc.GetCurrentLayout() ) // the layout itself .. //swmod 080218
{
SwLayCacheIoImpl aIo( rStream, TRUE );
// We want to save the relative index, so we need the index
@@ -194,7 +196,7 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
ULONG nStartOfContent = rDoc.GetNodes().GetEndOfContent().
StartOfSectionNode()->GetIndex();
// The first page..
- SwPageFrm* pPage = (SwPageFrm*)rDoc.GetRootFrm()->Lower();
+ SwPageFrm* pPage = (SwPageFrm*)rDoc.GetCurrentLayout()->Lower(); //swmod 080218
aIo.OpenRec( SW_LAYCACHE_IO_REC_PAGES );
aIo.OpenFlagRec( 0, 0 );
@@ -347,13 +349,16 @@ void SwLayoutCache::Write( SvStream &rStream, const SwDoc& rDoc )
#ifdef DBG_UTIL
sal_Bool SwLayoutCache::CompareLayout( const SwDoc& rDoc ) const
{
+ if( !pImpl )
+ return sal_True;
+ const SwRootFrm *pRootFrm = rDoc.GetCurrentLayout();
sal_Bool bRet = sal_True;
- if( pImpl && rDoc.GetRootFrm() )
+ if( pRootFrm )
{
USHORT nIndex = 0;
ULONG nStartOfContent = rDoc.GetNodes().GetEndOfContent().
StartOfSectionNode()->GetIndex();
- SwPageFrm* pPage = (SwPageFrm*)rDoc.GetRootFrm()->Lower();
+ SwPageFrm* pPage = (SwPageFrm*)pRootFrm->Lower();
if( pPage )
pPage = (SwPageFrm*)pPage->GetNext();
while( pPage )
@@ -598,7 +603,10 @@ ULONG SwLayHelper::CalcPageCount()
}
if ( nNdCount < 1000 )
nPgCount = 0;// no progress bar for small documents
- if ( pDoc->get(IDocumentSettingAccess::BROWSE_MODE) )
+ ViewShell *pSh = 0;
+ if( rpLay && rpLay->getRootFrm() )
+ pSh = rpLay->getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
nMaxParaPerPage *= 6;
}
}
@@ -893,7 +901,7 @@ BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex )
{
ASSERT( pTab->GetTable()->GetTabLines()[ nRowIdx ], "Table ohne Zeilen?" );
pHeadline =
- new SwRowFrm( *pTab->GetTable()->GetTabLines()[ nRowIdx ] );
+ new SwRowFrm( *pTab->GetTable()->GetTabLines()[ nRowIdx ], pTab );
pHeadline->SetRepeatedHeadline( true );
pHeadline->InsertBefore( pFoll, 0 );
pHeadline->RegistFlys();
@@ -925,7 +933,7 @@ BOOL SwLayHelper::CheckInsert( ULONG nNodeIndex )
else
{
SwTxtFrm *pNew = new SwTxtFrm( ((SwTxtFrm*)rpFrm)->
- GetTxtNode() );
+ GetTxtNode(), rpFrm );
pNew->_SetIsFollow( sal_True );
pNew->ManipOfst( nOfst );
pNew->SetFollow( ((SwTxtFrm*)rpFrm)->GetFollow() );
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index 1f9c92220bfa..697f4abfaa96 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -424,7 +424,7 @@ void InitCurrShells( SwRootFrm *pRoot )
SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
SwLayoutFrm( pFmt->GetDoc()->MakeFrmFmt(
- XubString( "Root", RTL_TEXTENCODING_MS_1252 ), pFmt ) ),
+ XubString( "Root", RTL_TEXTENCODING_MS_1252 ), pFmt ), 0 ),
// --> PAGES01
maPagesArea(),
mnViewWidth( -1 ),
@@ -446,6 +446,7 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
nType = FRMC_ROOT;
bIdleFormat = bTurboAllowed = bAssertFlyPages = bIsNewLayout = TRUE;
bCheckSuperfluous = bBrowseWidthValid = FALSE;
+ setRootFrm( this );
InitCurrShells( this );
@@ -454,14 +455,17 @@ SwRootFrm::SwRootFrm( SwFrmFmt *pFmt, ViewShell * pSh ) :
IDocumentFieldsAccess *pFieldsAccess = pFmt->getIDocumentFieldsAccess();
const IDocumentSettingAccess *pSettingAccess = pFmt->getIDocumentSettingAccess();
pTimerAccess->StopIdling();
- pLayoutAccess->SetRootFrm( this ); //Fuer das Erzeugen der Flys durch MakeFrms()
+ pLayoutAccess->SetCurrentViewShell( this->GetCurrShell() ); //Fuer das Erzeugen der Flys durch MakeFrms() //swmod 071108//swmod 071225
bCallbackActionEnabled = FALSE; //vor Verlassen auf TRUE setzen!
SdrModel *pMd = pFmt->getIDocumentDrawModelAccess()->GetDrawModel();
-
if ( pMd )
{
- pDrawPage = pMd->GetPage( 0 );
+ // Disable "multiple layout"
+ pDrawPage = pMd->GetPage(0); //pMd->AllocPage( FALSE );
+ //pMd->InsertPage( pDrawPage );
+ // end of disabling
+
pDrawPage->SetSize( Frm().SSize() );
}
@@ -553,6 +557,7 @@ SwRootFrm::~SwRootFrm()
pBlink->FrmDelete( this );
((SwFrmFmt*)pRegisteredIn)->GetDoc()->DelFrmFmt( (SwFrmFmt*)pRegisteredIn );
delete pDestroy;
+ pDestroy = 0;
//Referenzen entfernen.
for ( USHORT i = 0; i < pCurrShells->Count(); ++i )
@@ -585,5 +590,38 @@ void SwRootFrm::RemoveMasterObjs( SdrPage *pPg )
}
+void SwRootFrm::AllCheckPageDescs() const
+{
+ CheckPageDescs( (SwPageFrm*)this->Lower() );
+}
+//swmod 080226
+void SwRootFrm::AllInvalidateAutoCompleteWords() const
+{
+ SwPageFrm *pPage = (SwPageFrm*)this->Lower();
+ while ( pPage )
+ {
+ pPage->InvalidateAutoCompleteWords();
+ pPage = (SwPageFrm*)pPage->GetNext();
+ }
+}//swmod 080305
+void SwRootFrm::AllAddPaintRect() const
+{
+ GetCurrShell()->AddPaintRect( this->Frm() );
+}//swmod 080305
+void SwRootFrm::AllRemoveFtns()
+{
+ RemoveFtns();
+}
+void SwRootFrm::AllInvalidateSmartTagsOrSpelling(BOOL bSmartTags) const
+{
+ SwPageFrm *pPage = (SwPageFrm*)this->Lower();
+ while ( pPage )
+ {
+ if ( bSmartTags )
+ pPage->InvalidateSmartTags();
+ pPage->InvalidateSpelling();
+ pPage = (SwPageFrm*)pPage->GetNext();
+ } //swmod 080218
+}
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 72976a786fa1..188eb9abb5e6 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -46,6 +46,7 @@
#include <docsh.hxx>
#include "viewimp.hxx"
+#include "viewopt.hxx"
#include "pagefrm.hxx"
#include "rootfrm.hxx"
#include "cntfrm.hxx"
@@ -89,8 +90,8 @@ using namespace ::com::sun::star;
|* Letzte Aenderung MA 01. Aug. 93
|*
|*************************************************************************/
-SwBodyFrm::SwBodyFrm( SwFrmFmt *pFmt ):
- SwLayoutFrm( pFmt )
+SwBodyFrm::SwBodyFrm( SwFrmFmt *pFmt, SwFrm* pSib ):
+ SwLayoutFrm( pFmt, pSib )
{
nType = FRMC_BODY;
}
@@ -196,8 +197,8 @@ void SwBodyFrm::Format( const SwBorderAttrs * )
|* Letzte Aenderung MA 08. Dec. 97
|*
|*************************************************************************/
-SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwPageDesc *pPgDsc ) :
- SwFtnBossFrm( pFmt ),
+SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwFrm* pSib, SwPageDesc *pPgDsc ) :
+ SwFtnBossFrm( pFmt, pSib ),
pSortedObjs( 0 ),
pDesc( pPgDsc ),
nPhyPageNum( 0 ),
@@ -221,12 +222,12 @@ SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwPageDesc *pPgDsc ) :
bInvalidLayout = bInvalidCntnt = bInvalidSpelling = bInvalidSmartTags = bInvalidAutoCmplWrds = bInvalidWordCount = TRUE;
bInvalidFlyLayout = bInvalidFlyCntnt = bInvalidFlyInCnt = bFtnPage = bEndNotePage = FALSE;
- const bool bBrowseMode = pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
if ( bBrowseMode )
{
Frm().Height( 0 );
- ViewShell *pSh = GetShell();
- long nWidth = pSh ? pSh->VisArea().Width():0;
+ long nWidth = pSh->VisArea().Width();
if ( !nWidth )
nWidth = 5000L; //aendert sich sowieso
Frm().Width ( nWidth );
@@ -241,7 +242,7 @@ SwPageFrm::SwPageFrm( SwFrmFmt *pFmt, SwPageDesc *pPgDsc ) :
{
bEmptyPage = FALSE;
Calc(); //Damit die PrtArea stimmt.
- SwBodyFrm *pBodyFrm = new SwBodyFrm( pDoc->GetDfltFrmFmt() );
+ SwBodyFrm *pBodyFrm = new SwBodyFrm( pDoc->GetDfltFrmFmt(), this );
pBodyFrm->ChgSize( Prt().SSize() );
pBodyFrm->Paste( this );
pBodyFrm->Calc(); //Damit die Spalten korrekt
@@ -291,7 +292,7 @@ SwPageFrm::~SwPageFrm()
SwDoc *pDoc = GetFmt()->GetDoc();
if( pDoc && !pDoc->IsInDtor() )
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( pSh )
{
SwViewImp *pImp = pSh->Imp();
@@ -340,16 +341,16 @@ void SwPageFrm::CheckDirection( BOOL bVert )
((SvxFrameDirectionItem&)GetFmt()->GetFmtAttr( RES_FRAMEDIR )).GetValue();
if( bVert )
{
- if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir ||
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if( FRMDIR_HORI_LEFT_TOP == nDir || FRMDIR_HORI_RIGHT_TOP == nDir )
bVertical = 0;
else
- bVertical = 1;
-/*
- if( pDesc && pDesc->GetName().GetChar(0)=='x')
- bReverse = 1;
+ {
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
+ bVertical = 0;
else
- */
+ bVertical = 1;
+ }
bReverse = 0;
bInvalidVert = 0;
}
@@ -465,7 +466,7 @@ void MA_FASTCALL lcl_MakeObjs( const SwSpzFrmFmts &rTbl, SwPageFrm *pPage )
pFly->AnchorFrm()->RemoveFly( pFly );
}
else
- pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, pPg );
+ pFly = new SwFlyLayFrm( (SwFlyFrmFmt*)pFmt, pPg, pPg );
pPg->AppendFly( pFly );
::RegistFlys( pPg, pFly );
}
@@ -532,7 +533,7 @@ void SwPageFrm::PreparePage( BOOL bFtn )
|*************************************************************************/
void SwPageFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( pSh )
pSh->SetFirstVisPageInvalid();
BYTE nInvFlags = 0;
@@ -622,7 +623,8 @@ void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
case RES_FRM_SIZE:
{
const SwRect aOldPageFrmRect( Frm() );
- if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
{
bValidSize = FALSE;
// OD 28.10.2002 #97265# - Don't call <SwPageFrm::MakeAll()>
@@ -650,8 +652,7 @@ void SwPageFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
static_cast<SwRootFrm*>(GetUpper())->CheckViewLayout( 0, 0 );
}
//Window aufraeumen.
- ViewShell *pSh;
- if ( 0 != (pSh = GetShell()) && pSh->GetWin() && aOldPageFrmRect.HasArea() )
+ if( pSh && pSh->GetWin() && aOldPageFrmRect.HasArea() )
{
// OD 12.02.2003 #i9719#, #105645# - consider border and shadow of
// page frame for determine 'old' rectangle - it's used for invalidating.
@@ -790,7 +791,8 @@ SwPageDesc *SwPageFrm::FindPageDesc()
SwPageDesc *pRet = 0;
//5.
- if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
{
SwCntntFrm *pFrm = GetUpper()->ContainsCntnt();
while ( !pFrm->IsInDocBody() )
@@ -847,10 +849,13 @@ void AdjustSizeChgNotify( SwRootFrm *pRoot )
ViewShell *pSh = pRoot->GetCurrShell();
if ( pSh )
{
- pSh->Imp()->NotifySizeChg( pRoot->Frm().SSize() );//Einmal fuer das Drawing.
do
{
- pSh->SizeChgNotify(); //Einmal fuer jede Sicht.
+ if( pRoot == pSh->GetLayout() )
+ {
+ pSh->SizeChgNotify();
+ pSh->Imp()->NotifySizeChg( pRoot->Frm().SSize() );
+ }
pSh = (ViewShell*)pSh->GetNext();
} while ( pSh != pRoot->GetCurrShell() );
}
@@ -876,7 +881,7 @@ void SwPageFrm::Cut()
// PAGES01
//AdjustRootSize( CHG_CUTPAGE, 0 );
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( !IsEmptyPage() )
{
if ( GetNext() )
@@ -982,9 +987,11 @@ void SwPageFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
InvalidatePos();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if ( pSh )
+ pSh->SetFirstVisPageInvalid();
// PAGES01
- if ( GetUpper() )
- static_cast<SwRootFrm*>(GetUpper())->CheckViewLayout( 0, 0 );
+ getRootFrm()->CheckViewLayout( 0, 0 );
}
/*************************************************************************
@@ -1066,7 +1073,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields )
{
ASSERT( pStart, "Keine Startpage." );
- ViewShell *pSh = pStart->GetShell();
+ ViewShell *pSh = pStart->getRootFrm()->GetCurrShell();
SwViewImp *pImp = pSh ? pSh->Imp() : 0;
if ( pImp && pImp->IsAction() && !pImp->GetLayAction().IsCheckPages() )
@@ -1157,7 +1164,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, BOOL bNotifyFields )
{
if ( pPage->GetPrev() )
pDesc = ((SwPageFrm*)pPage->GetPrev())->GetPageDesc();
- SwPageFrm *pTmp = new SwPageFrm( pDoc->GetEmptyPageFmt(),pDesc);
+ SwPageFrm *pTmp = new SwPageFrm( pDoc->GetEmptyPageFmt(),pRoot,pDesc);
pTmp->Paste( pRoot, pPage );
pTmp->PreparePage( FALSE );
pPage = pTmp;
@@ -1316,7 +1323,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn )
if( bWishedOdd != bNextOdd )
{ pFmt = pDoc->GetEmptyPageFmt();
SwPageDesc *pTmpDesc = pPrevPage->GetPageDesc();
- SwPageFrm *pPage = new SwPageFrm( pFmt, pTmpDesc );
+ SwPageFrm *pPage = new SwPageFrm( pFmt, pRoot, pTmpDesc );
pPage->Paste( pRoot, pSibling );
pPage->PreparePage( bFtn );
//Wenn der Sibling keinen Bodytext enthaelt kann ich ihn vernichten
@@ -1336,7 +1343,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn )
}
pFmt = bWishedOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt();
ASSERT( pFmt, "Descriptor without format." );
- SwPageFrm *pPage = new SwPageFrm( pFmt, pDesc );
+ SwPageFrm *pPage = new SwPageFrm( pFmt, pRoot, pDesc );
pPage->Paste( pRoot, pSibling );
pPage->PreparePage( bFtn );
//Wenn der Sibling keinen Bodytext enthaelt kann ich ihn vernichten
@@ -1359,7 +1366,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn )
if ( bCheckPages )
{
CheckPageDescs( pSibling, FALSE );
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
SwViewImp *pImp = pSh ? pSh->Imp() : 0;
if ( pImp && pImp->IsAction() && !pImp->GetLayAction().IsCheckPages() )
{
@@ -1376,7 +1383,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn )
//Fuer das Aktualisieren der Seitennummern-Felder gibt nDocPos
//die Seitenposition an, _ab_ der invalidiert werden soll.
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( !pSh || !pSh->Imp()->IsUpdateExpFlds() )
{
SwDocPosUpdate aMsgHnt( pPrevPage->Frm().Top() );
@@ -1388,12 +1395,13 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, BOOL bFtn )
// false = right, true = left
sw::sidebarwindows::SidebarPosition SwPageFrm::SidebarPosition() const
{
- if (!GetShell() || GetShell()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE))
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( !pSh || pSh->GetViewOptions()->getBrowseMode() )
return sw::sidebarwindows::SIDEBAR_NONE;
else
{
- const bool bLTR = GetUpper() ? static_cast<const SwRootFrm*>(GetUpper())->IsLeftToRightViewLayout() : true;
- const bool bBookMode = GetShell()->GetViewOptions()->IsViewLayoutBookMode();
+ const bool bLTR = getRootFrm()->IsLeftToRightViewLayout();
+ const bool bBookMode = pSh->GetViewOptions()->IsViewLayoutBookMode();
const bool bRightSidebar = bLTR ? (!bBookMode || OnRightPage()) : (bBookMode && !OnRightPage());
return bRightSidebar
@@ -1534,7 +1542,7 @@ void SwRootFrm::RemoveSuperfluous()
}
} while ( pPage );
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( nDocPos != LONG_MAX &&
(!pSh || !pSh->Imp()->IsUpdateExpFlds()) )
{
@@ -1595,7 +1603,7 @@ void SwRootFrm::AssertFlyPages()
{
//Leerseite einfuegen, die Flys werden aber erst von
//der naechsten Seite aufgenommen!
- pPage = new SwPageFrm( pDoc->GetEmptyPageFmt(), pDesc );
+ pPage = new SwPageFrm( pDoc->GetEmptyPageFmt(), this, pDesc );
pPage->Paste( this, pSibling );
pPage->PreparePage( FALSE );
bOdd = bOdd ? FALSE : TRUE;
@@ -1603,7 +1611,7 @@ void SwRootFrm::AssertFlyPages()
}
pPage = new
SwPageFrm( (bOdd ? pDesc->GetRightFmt() :
- pDesc->GetLeftFmt()), pDesc );
+ pDesc->GetLeftFmt()), this, pDesc );
pPage->Paste( this, pSibling );
pPage->PreparePage( FALSE );
bOdd = bOdd ? FALSE : TRUE;
@@ -1754,8 +1762,8 @@ void SwRootFrm::ImplInvalidateBrowseWidth()
|*************************************************************************/
void SwRootFrm::ImplCalcBrowseWidth()
{
- ASSERT( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE),
- "CalcBrowseWidth and not in BrowseView" );
+ ASSERT( GetCurrShell() && GetCurrShell()->GetViewOptions()->getBrowseMode(),
+ "CalcBrowseWidth and not in BrowseView" )
//Die (minimale) Breite wird von Rahmen, Tabellen und Zeichenobjekten
//bestimmt. Die Breite wird nicht anhand ihrer aktuellen Groessen bestimmt,
@@ -1772,7 +1780,7 @@ void SwRootFrm::ImplCalcBrowseWidth()
return;
bBrowseWidthValid = TRUE;
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
nBrowseWidth = pSh
? MINLAY + 2 * pSh->GetOut()->
PixelToLogic( pSh->GetBrowseBorder() ).Width()
@@ -2021,7 +2029,8 @@ void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& rOffset )
if ( pFlyFrm->Lower()->IsNoTxtFrm() )
{
SwCntntFrm* pCntntFrm = static_cast<SwCntntFrm*>(pFlyFrm->Lower());
- ViewShell *pSh = pFlyFrm->Lower()->GetShell();
+ SwRootFrm* pRoot = pFlyFrm->Lower()->getRootFrm();
+ ViewShell *pSh = pRoot ? pRoot->GetCurrShell() : 0;
if ( pSh )
{
SwOLENode* pNode = pCntntFrm->GetNode()->GetOLENode();
@@ -2076,7 +2085,7 @@ void lcl_MoveAllLowers( SwFrm* pFrm, const Point& rOffset )
// Don't forget accessibility:
if( pFrm->IsAccessibleFrm() )
{
- SwRootFrm *pRootFrm = pFrm->FindRootFrm();
+ SwRootFrm *pRootFrm = pFrm->getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -2175,7 +2184,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
bool bPageChanged = false;
const bool bRTL = !IsLeftToRightViewLayout();
- const SwTwips nSidebarWidth = SwPageFrm::GetSidebarBorderWidth( GetShell() );
+ const SwTwips nSidebarWidth = SwPageFrm::GetSidebarBorderWidth( GetCurrShell() );
while ( pPageFrm )
{
@@ -2415,7 +2424,7 @@ void SwRootFrm::CheckViewLayout( const SwViewOption* pViewOpt, const SwRect* pVi
::AdjustSizeChgNotify( this );
Calc();
- ViewShell* pSh = GetShell();
+ ViewShell* pSh = GetCurrShell();
if ( pSh && pSh->GetDoc()->GetDocShell() )
{
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index b838c8163837..0120fb8fb990 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -318,7 +318,7 @@ static const SwFrm* lcl_GetFrmOfNode( const SwNode& rNd )
pMod = 0;
Point aNullPt;
- return pMod ? ::GetFrmOfModify( *pMod, nFrmType, &aNullPt, 0, FALSE )
+ return pMod ? ::GetFrmOfModify( 0, *pMod, nFrmType, &aNullPt, 0, FALSE )
: 0;
}
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 09fc6b00e03d..2b1a1a5373bb 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -33,9 +33,7 @@
#include <hintids.hxx>
-#ifndef _SOUND_HXX //autogen
#include <vcl/sound.hxx>
-#endif
#include <tools/poly.hxx>
#define _SVSTDARR_LONGS
#include <svl/svstdarr.hxx>
@@ -49,9 +47,7 @@
// --> collapsing borders FME 2005-05-27 #i29550#
#include <svx/framelink.hxx>
// <--
-#ifndef _GRAPH_HXX //autogen
#include <vcl/graph.hxx>
-#endif
#include <svx/svdpagv.hxx>
#include <tgrditem.hxx>
@@ -59,9 +55,7 @@
#include <fmtsrnd.hxx>
#include <fmtclds.hxx>
#include <tools/shl.hxx>
-#ifndef _COMCORE_HRC
#include <comcore.hrc>
-#endif
#include <swmodule.hxx>
#include <rootfrm.hxx>
#include <pagefrm.hxx>
@@ -3108,14 +3102,14 @@ void SwRootFrm::HackPrepareLongTblPaint( int nMode )
case HACK_TABLEMODE_INIT : ASSERT( !pLines, "HackPrepare: already prepared" );
pLines = new SwLineRects;
ASSERT( !pGlobalShell, "old GlobalShell lost" );
- pGlobalShell = GetShell();
+ pGlobalShell = GetCurrShell();
bTableHack = TRUE;
break;
case HACK_TABLEMODE_LOCKLINES : pLines->LockLines( TRUE ); break;
case HACK_TABLEMODE_PAINTLINES : pLines->PaintLines( GetShell()->GetOut() );
break;
case HACK_TABLEMODE_UNLOCKLINES: pLines->LockLines( FALSE ); break;
- case HACK_TABLEMODE_EXIT : pLines->PaintLines( GetShell()->GetOut() );
+ case HACK_TABLEMODE_EXIT : pLines->PaintLines( GetCurrShell()->GetOut() );
DELETEZ( pLines );
pGlobalShell = 0;
bTableHack = FALSE;
@@ -3187,7 +3181,7 @@ SwShortCut::SwShortCut( const SwFrm& rFrm, const SwRect& rRect )
void SwLayoutFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */ ) const
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
// --> FME 2004-06-24 #i16816# tagged pdf support
Frm_Info aFrmInfo( *this );
@@ -3630,8 +3624,8 @@ void SwFlyFrm::Paint( const SwRect& rRect, const SwPrtOptions* /* pPrintData */
// for painting the graphic/OLE. Thus, the clip region is
// also applied for the PDF export.
// if ( !pOut->GetConnectMetaFile() || pOut->GetOutDevType() == OUTDEV_PRINTER )
- ViewShell *pSh = GetShell();
- if ( !pOut->GetConnectMetaFile() || !pSh->GetWin() )
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if ( !pOut->GetConnectMetaFile() || !pSh || !pSh->GetWin() )
// <--
{
pOut->SetClipRegion( aPoly );
@@ -4291,7 +4285,7 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft,
// OD 29.04.2003 #107169# - paint SwAligned-rectangle
{
SwRect aPaintRect( aRect );
- ::SwAlignRect( aPaintRect, _rFrm.GetShell() );
+ ::SwAlignRect( aPaintRect, _rFrm.getRootFrm()->GetCurrShell() );
// if <SwAlignRect> reveals rectangle with no width, adjust rectangle
// to the prior left postion with width of one twip.
if ( (aPaintRect.*_rRectFn->fnGetWidth)() == 0 )
@@ -4331,7 +4325,7 @@ void lcl_PaintLeftRightLine( const sal_Bool _bLeft,
// OD 29.04.2003 #107169# - paint SwAligned-rectangle
{
SwRect aPaintRect( aRect );
- ::SwAlignRect( aPaintRect, _rFrm.GetShell() );
+ ::SwAlignRect( aPaintRect, _rFrm.getRootFrm()->GetCurrShell() );
// if <SwAlignRect> reveals rectangle with no width, adjust
// rectangle to the prior left postion with width of one twip.
if ( (aPaintRect.*_rRectFn->fnGetWidth)() == 0 )
@@ -4395,7 +4389,7 @@ void lcl_PaintTopBottomLine( const sal_Bool _bTop,
// OD 29.04.2003 #107169# - paint SwAligned-rectangle
{
SwRect aPaintRect( aRect );
- ::SwAlignRect( aPaintRect, _rFrm.GetShell() );
+ ::SwAlignRect( aPaintRect, _rFrm.getRootFrm()->GetCurrShell() );
// if <SwAlignRect> reveals rectangle with no width, adjust rectangle
// to the prior top postion with width of one twip.
if ( (aPaintRect.*_rRectFn->fnGetHeight)() == 0 )
@@ -4434,7 +4428,7 @@ void lcl_PaintTopBottomLine( const sal_Bool _bTop,
// OD 29.04.2003 #107169# - paint SwAligned-rectangle
{
SwRect aPaintRect( aRect );
- ::SwAlignRect( aPaintRect, _rFrm.GetShell() );
+ ::SwAlignRect( aPaintRect, _rFrm.getRootFrm()->GetCurrShell() );
// if <SwAlignRect> reveals rectangle with no width, adjust
// rectangle to the prior top postion with width of one twip.
if ( (aPaintRect.*_rRectFn->fnGetHeight)() == 0 )
@@ -5252,7 +5246,7 @@ void SwPageFrm::PaintMarginArea( const SwRect& _rOutputRect,
ViewShell* _pViewShell ) const
{
if ( _pViewShell->GetWin() &&
- !_pViewShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ !_pViewShell->GetViewOptions()->getBrowseMode() )
{
SwRect aPgPrtRect( Prt() );
aPgPrtRect.Pos() += Frm().Pos();
@@ -5740,7 +5734,7 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
{
if ( bBack || bPageFrm || !bLowerMode )
{
- const BOOL bBrowse = pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const BOOL bBrowse = pSh->GetViewOptions()->getBrowseMode();
SwRect aRect;
if ( (bPageFrm && bBrowse) ||
@@ -6393,7 +6387,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
return;
ASSERT( GetUpper(), "Retoucheversuch ohne Upper." );
- ASSERT( GetShell() && pGlobalShell->GetWin(), "Retouche auf dem Drucker?" );
+ ASSERT( getRootFrm()->GetCurrShell() && pGlobalShell->GetWin(), "Retouche auf dem Drucker?" );
SwRect aRetouche( GetUpper()->PaintArea() );
aRetouche.Top( Frm().Top() + Frm().Height() );
@@ -6405,7 +6399,7 @@ void SwFrm::Retouche( const SwPageFrm * pPage, const SwRect &rRect ) const
//zum ausstanzen.
SwRegionRects aRegion( aRetouche );
aRegion -= rRect;
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
// --> FME 2004-06-24 #i16816# tagged pdf support
SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pSh->GetOut() );
@@ -6502,7 +6496,7 @@ BOOL SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
BOOL bLowerMode ) const
{
const SwFrm *pFrm = this;
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
const SwViewOption *pOpt = pSh->GetViewOptions();
rpBrush = 0;
rpCol = NULL;
@@ -6558,7 +6552,7 @@ BOOL SwFrm::GetBackgroundBrush( const SvxBrushItem* & rpBrush,
{
rpBrush = &rBack;
if ( pFrm->IsPageFrm() &&
- pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ pSh->GetViewOptions()->getBrowseMode() )
rOrigRect = pFrm->Frm();
else
{
@@ -6623,7 +6617,7 @@ Graphic SwFlyFrmFmt::MakeGraphic( ImageMap* pMap )
SwClientIter aIter( *this );
SwClient *pFirst = aIter.First( TYPE(SwFrm) );
ViewShell *pSh;
- if ( pFirst && 0 != ( pSh = ((SwFrm*)pFirst)->GetShell()) )
+ if ( pFirst && 0 != ( pSh = ((SwFrm*)pFirst)->getRootFrm()->GetCurrShell()) )
{
ViewShell *pOldGlobal = pGlobalShell;
pGlobalShell = pSh;
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 7a1a51deb8eb..b64ab79a3e37 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -54,6 +54,7 @@
#include "layouter.hxx" // SwLayouter
#include "dbg_lay.hxx"
#include "viewsh.hxx"
+#include "viewopt.hxx"
#include "viewimp.hxx"
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
@@ -74,8 +75,8 @@ SV_IMPL_PTRARR_SORT( SwDestroyList, SwSectionFrmPtr )
|* Letzte Aenderung AMA 26. Nov. 97
|*
|*************************************************************************/
-SwSectionFrm::SwSectionFrm( SwSection &rSect ) :
- SwLayoutFrm( rSect.GetFmt() ),
+SwSectionFrm::SwSectionFrm( SwSection &rSect, SwFrm* pSib ) :
+ SwLayoutFrm( rSect.GetFmt(), pSib ),
SwFlowFrm( (SwFrm&)*this ),
pSection( &rSect )
{
@@ -86,7 +87,7 @@ SwSectionFrm::SwSectionFrm( SwSection &rSect ) :
}
SwSectionFrm::SwSectionFrm( SwSectionFrm &rSect, BOOL bMaster ) :
- SwLayoutFrm( rSect.GetFmt() ),
+ SwLayoutFrm( rSect.GetFmt(), rSect.getRootFrm() ),
SwFlowFrm( (SwFrm&)*this ),
pSection( rSect.GetSection() )
{
@@ -152,9 +153,9 @@ SwSectionFrm::~SwSectionFrm()
{
if( GetFmt() && !GetFmt()->GetDoc()->IsInDtor() )
{
- SwRootFrm *pRootFrm = GetFmt()->GetDoc()->GetRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm )
- pRootFrm->RemoveFromList( this );
+ pRootFrm->RemoveFromList( this ); //swmod 071108//swmod 071225
if( IsFollow() )
{
SwSectionFrm *pMaster = FindMaster();
@@ -202,7 +203,7 @@ void SwSectionFrm::DelEmpty( BOOL bRemove )
// Relation CONTENT_FLOWS_FROM for current next paragraph will change
// and relation CONTENT_FLOWS_TO for current previous paragraph will change.
{
- ViewShell* pViewShell( GetShell() );
+ ViewShell* pViewShell( getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -237,11 +238,11 @@ void SwSectionFrm::DelEmpty( BOOL bRemove )
{ // Wenn wir bereits halbtot waren vor diesem DelEmpty, so
// stehen wir vermutlich auch in der Liste und muessen uns
// dort austragen
- if( !pSection )
- GetFmt()->GetDoc()->GetRootFrm()->RemoveFromList( this );
+ if( !pSection && getRootFrm() )
+ getRootFrm()->RemoveFromList( this );
}
- else
- GetFmt()->GetDoc()->GetRootFrm()->InsertEmptySct( this );
+ else if( getRootFrm() )
+ getRootFrm()->InsertEmptySct( this ); //swmod 071108//swmod 071225
pSection = NULL; // damit ist allerdings eine Reanimierung quasi ausgeschlossen
}
}
@@ -398,7 +399,7 @@ void SwSectionFrm::Paste( SwFrm* pParent, SwFrm* pSibling )
}
}
pParent = pSect;
- pSect = new SwSectionFrm( *((SwSectionFrm*)pParent)->GetSection() );
+ pSect = new SwSectionFrm( *((SwSectionFrm*)pParent)->GetSection(), pParent );
// Wenn pParent in zwei Teile zerlegt wird, so muss sein Follow am
// neuen, zweiten Teil angebracht werden.
pSect->SetFollow( ((SwSectionFrm*)pParent)->GetFollow() );
@@ -558,7 +559,7 @@ BOOL SwSectionFrm::SplitSect( SwFrm* pFrm, BOOL bApres )
ASSERT( pSav, "SplitSect: What's on?" );
if( pSav ) // Robust
{ // Einen neuen SctFrm anlegen, nicht als Follow/Master
- SwSectionFrm* pNew = new SwSectionFrm( *pSect->GetSection() );
+ SwSectionFrm* pNew = new SwSectionFrm( *pSect->GetSection(), pSect );
pNew->InsertBehind( pSect->GetUpper(), pSect );
pNew->Init();
SWRECTFN( this )
@@ -752,7 +753,7 @@ void SwSectionFrm::MoveCntntAndDelete( SwSectionFrm* pDel, BOOL bSave )
// vom gleichen Parent abgeleitet ist.
// Dann gibt es (noch) keinen Teil unseres Parents, der den Inhalt
// aufnehmen kann,also bauen wir ihn uns.
- pPrvSct = new SwSectionFrm( *pParent->GetSection() );
+ pPrvSct = new SwSectionFrm( *pParent->GetSection(), pUp );
pPrvSct->InsertBehind( pUp, pPrv );
pPrvSct->Init();
SWRECTFN( pUp )
@@ -786,7 +787,7 @@ void SwSectionFrm::MakeAll()
return;
if( !pSection ) // Durch DelEmpty
{
- ASSERT( GetFmt()->GetDoc()->GetRootFrm()->IsInDelList( this ), "SectionFrm without Section" );
+ ASSERT( getRootFrm()->IsInDelList( this ), "SectionFrm without Section" );
if( !bValidPos )
{
if( GetUpper() )
@@ -810,7 +811,8 @@ void SwSectionFrm::MakeAll()
// OD 2004-03-15 #116561# - In online layout join the follows, if section
// can grow.
- if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() &&
( Grow( LONG_MAX, true ) > 0 ) )
{
while( GetFollow() )
@@ -1332,8 +1334,7 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
{
if( !pSection ) // Durch DelEmpty
{
- ASSERT( GetFmt()->GetDoc()->GetRootFrm()->IsInDelList( this ),
- "SectionFrm without Section" );
+ ASSERT( getRootFrm()->IsInDelList( this ), "SectionFrm without Section" );
bValidSize = bValidPos = bValidPrtArea = TRUE;
return;
}
@@ -1409,7 +1410,8 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
// OD 15.10.2002 #103517# - allow grow in online layout
// Thus, set <..IsBrowseMode()> as parameter <bGrow> on calling
// method <_CheckClipping(..)>.
- _CheckClipping( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE), bMaximize );
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ _CheckClipping( pSh && pSh->GetViewOptions()->getBrowseMode(), bMaximize );
bMaximize = ToMaximize( FALSE );
bValidSize = TRUE;
}
@@ -2041,9 +2043,14 @@ SwTwips SwSectionFrm::_Grow( SwTwips nDist, BOOL bTst )
BOOL bInCalcCntnt = GetUpper() && IsInFly() && FindFlyFrm()->IsLocked();
// OD 2004-03-15 #116561# - allow grow in online layout
- if ( !Lower() || !Lower()->IsColumnFrm() || !Lower()->GetNext() ||
- GetSection()->GetFmt()->GetBalancedColumns().GetValue() ||
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ BOOL bGrow = !Lower() || !Lower()->IsColumnFrm() || !Lower()->GetNext() ||
+ GetSection()->GetFmt()->GetBalancedColumns().GetValue();
+ if( !bGrow )
+ {
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ bGrow = pSh && pSh->GetViewOptions()->getBrowseMode();
+ }
+ if( bGrow )
{
SwTwips nGrow;
if( IsInFtn() )
@@ -2561,7 +2568,7 @@ void SwSectionFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
case RES_PROTECT:
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
pSh->Imp()->InvalidateAccessibleEditableState( sal_True, this );
}
@@ -2755,7 +2762,7 @@ void SwRootFrm::_DeleteEmptySct()
if( pUp && !pUp->Lower() )
{
if( pUp->IsPageBodyFrm() )
- pUp->FindRootFrm()->SetSuperfluous();
+ pUp->getRootFrm()->SetSuperfluous();
else if( pUp->IsFtnFrm() && !pUp->IsColLocked() &&
pUp->GetUpper() )
{
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 9b3ff15666f9..33e971b63e85 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -372,7 +372,7 @@ SwFrm::~SwFrm()
// by the destructors of the derived classes.
if( IsAccessibleFrm() && !(IsFlyFrm() || IsCellFrm()) && GetDep() )
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() )
{
ViewShell *pVSh = pRootFrm->GetCurrShell();
@@ -437,8 +437,8 @@ void SwLayoutFrm::SetFrmFmt( SwFrmFmt *pNew )
/*************************************************************************
|* SwCntntFrm::SwCntntFrm()
|*************************************************************************/
-SwCntntFrm::SwCntntFrm( SwCntntNode * const pCntnt ) :
- SwFrm( pCntnt ),
+SwCntntFrm::SwCntntFrm( SwCntntNode * const pCntnt, SwFrm* pSib ) :
+ SwFrm( pCntnt, pSib ),
SwFlowFrm( (SwFrm&)*this )
{
}
@@ -453,7 +453,7 @@ SwCntntFrm::~SwCntntFrm()
!pCNd->GetDoc()->IsInDtor() )
{
//Bei der Root abmelden wenn ich dort noch im Turbo stehe.
- SwRootFrm *pRoot = FindRootFrm();
+ SwRootFrm *pRoot = getRootFrm();
if( pRoot && pRoot->GetTurbo() == this )
{
pRoot->DisallowTurbo();
@@ -479,7 +479,7 @@ SwCntntFrm::~SwCntntFrm()
pTxtFtn = rFtnIdxs[ nPos ];
if( pTxtFtn->GetTxtNode().GetIndex() > nIndex )
break;
- pTxtFtn->DelFrms();
+ pTxtFtn->DelFrms( this );
++nPos;
}
}
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index f912be5cb9b1..9ae9e3178f37 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -40,6 +40,8 @@
#include "frmtool.hxx"
#include "frmfmt.hxx"
#include "dcontact.hxx"
+#include <anchoreddrawobject.hxx>
+#include <fmtanchr.hxx>
#include "viewopt.hxx"
#include "hints.hxx"
#include "dbg_lay.hxx"
@@ -95,8 +97,8 @@ using namespace ::com::sun::star;
|* Letzte Aenderung MA 30. May. 96
|*
|*************************************************************************/
-SwTabFrm::SwTabFrm( SwTable &rTab ):
- SwLayoutFrm( rTab.GetFrmFmt() ),
+SwTabFrm::SwTabFrm( SwTable &rTab, SwFrm* pSib ):
+ SwLayoutFrm( rTab.GetFrmFmt(), pSib ),
SwFlowFrm( (SwFrm&)*this ),
pTable( &rTab )
{
@@ -115,7 +117,7 @@ SwTabFrm::SwTabFrm( SwTable &rTab ):
SwFrm *pTmpPrev = 0;
for ( USHORT i = 0; i < rLines.Count(); ++i )
{
- SwRowFrm *pNew = new SwRowFrm( *rLines[i] );
+ SwRowFrm *pNew = new SwRowFrm( *rLines[i], this );
if( pNew->Lower() )
{
pNew->InsertBehind( this, pTmpPrev );
@@ -128,7 +130,7 @@ SwTabFrm::SwTabFrm( SwTable &rTab ):
}
SwTabFrm::SwTabFrm( SwTabFrm &rTab ) :
- SwLayoutFrm( rTab.GetFmt() ),
+ SwLayoutFrm( rTab.GetFmt(), &rTab ),
SwFlowFrm( (SwFrm&)*this ),
pTable( rTab.GetTable() )
{
@@ -274,7 +276,7 @@ SwRowFrm* lcl_InsertNewFollowFlowLine( SwTabFrm& rTab, const SwFrm& rTmpRow, boo
const SwRowFrm& rRow = (SwRowFrm&)rTmpRow;
rTab.SetFollowFlowLine( TRUE );
- SwRowFrm *pFollowFlowLine = new SwRowFrm(*rRow.GetTabLine(), false );
+ SwRowFrm *pFollowFlowLine = new SwRowFrm(*rRow.GetTabLine(), &rTab, false );
pFollowFlowLine->SetRowSpanLine( bRowSpanLine );
SwFrm* pFirstRow = rTab.GetFollow()->GetFirstNonHeadlineRow();
pFollowFlowLine->InsertBefore( rTab.GetFollow(), pFirstRow );
@@ -605,7 +607,7 @@ void lcl_PreprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine,
!bTableLayoutToComplex && nMinHeight < nTmpCut ) )
{
// The line has to be split:
- SwRowFrm* pNewRow = new SwRowFrm( *pTmpLastLineRow->GetTabLine(), false );
+ SwRowFrm* pNewRow = new SwRowFrm( *pTmpLastLineRow->GetTabLine(), &rTab, false );
pNewRow->SetFollowFlowRow( true );
pNewRow->SetFollowRow( pTmpLastLineRow->GetFollowRow() );
pTmpLastLineRow->SetFollowRow( pNewRow );
@@ -1277,7 +1279,7 @@ bool SwTabFrm::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKee
// Insert new headlines:
bDontCreateObjects = TRUE; //frmtool
SwRowFrm* pHeadline = new SwRowFrm(
- *GetTable()->GetTabLines()[ nRowCount ] );
+ *GetTable()->GetTabLines()[ nRowCount ], this );
pHeadline->SetRepeatedHeadline( true );
bDontCreateObjects = FALSE;
pHeadline->InsertBefore( pFoll, 0 );
@@ -1731,7 +1733,8 @@ void MA_FASTCALL lcl_FirstTabCalc( SwTabFrm *pTab )
}
SwFrm *pUp = pTab->GetUpper();
long nBottom = (pUp->*fnRect->fnGetPrtBottom)();
- if ( pTab->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ const ViewShell *pSh = pTab->getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
nBottom += pUp->Grow( LONG_MAX, TRUE );
lcl_CalcLowers( (SwLayoutFrm*)pTab->Lower(), pTab, LONG_MAX, false );
}
@@ -2363,7 +2366,8 @@ void SwTabFrm::MakeAll()
/// OD 23.10.2002 #103517# - In online layout try to grow upper of table
/// frame, if table frame doesn't fit in its upper.
- const bool bBrowseMode = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const bool bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
if ( nDistanceToUpperPrtBottom < 0 && bBrowseMode )
{
if ( GetUpper()->Grow( -nDistanceToUpperPrtBottom ) )
@@ -3284,11 +3288,11 @@ void SwTabFrm::Format( const SwBorderAttrs *pAttrs )
else
(this->*fnRect->fnSetXMargins)( nLeftSpacing, nRightSpacing );
- ViewShell *pSh;
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( bCheckBrowseWidth &&
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ pSh && pSh->GetViewOptions()->getBrowseMode() &&
GetUpper()->IsPageBodyFrm() && // nur PageBodyFrms, nicht etwa ColBodyFrms
- 0 != (pSh = GetShell()) && pSh->VisArea().Width() )
+ pSh->VisArea().Width() )
{
//Nicht ueber die Kante des sichbaren Bereiches hinausragen.
//Die Seite kann breiter sein, weil es Objekte mit "ueberbreite"
@@ -3373,7 +3377,7 @@ SwTwips SwTabFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
{
(Frm().*fnRect->fnAddBottom)( nDist );
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -3509,7 +3513,7 @@ void SwTabFrm::_UpdateAttr( SfxPoolItem *pOld, SfxPoolItem *pNew,
for ( USHORT nIdx = 0; nIdx < nNewRepeat; ++nIdx )
{
bDontCreateObjects = TRUE; //frmtool
- SwRowFrm* pHeadline = new SwRowFrm( *GetTable()->GetTabLines()[ nIdx ] );
+ SwRowFrm* pHeadline = new SwRowFrm( *GetTable()->GetTabLines()[ nIdx ], this );
pHeadline->SetRepeatedHeadline( true );
bDontCreateObjects = FALSE;
pHeadline->Paste( this, pLowerRow );
@@ -3781,7 +3785,8 @@ BOOL SwTabFrm::ShouldBwdMoved( SwLayoutFrm *pNewUpper, BOOL, BOOL &rReformat )
nSpace = nTmpSpace;
// <--
- if ( GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ if( pSh && pSh->GetViewOptions()->getBrowseMode() )
nSpace += pNewUpper->Grow( LONG_MAX, TRUE );
}
}
@@ -4009,8 +4014,8 @@ void SwTabFrm::Prepare( const PrepareHint eHint, const void *, BOOL )
|* Letzte Aenderung MA 30. May. 96
|*
|*************************************************************************/
-SwRowFrm::SwRowFrm( const SwTableLine &rLine, bool bInsertContent ):
- SwLayoutFrm( rLine.GetFrmFmt() ),
+SwRowFrm::SwRowFrm( const SwTableLine &rLine, SwFrm* pSib, bool bInsertContent ):
+ SwLayoutFrm( rLine.GetFrmFmt(), pSib ),
pTabLine( &rLine ),
pFollowRow( 0 ),
// --> collapsing borders FME 2005-05-27 #i29550#
@@ -4031,7 +4036,7 @@ SwRowFrm::SwRowFrm( const SwTableLine &rLine, bool bInsertContent ):
SwFrm *pTmpPrev = 0;
for ( USHORT i = 0; i < rBoxes.Count(); ++i )
{
- SwCellFrm *pNew = new SwCellFrm( *rBoxes[i], bInsertContent );
+ SwCellFrm *pNew = new SwCellFrm( *rBoxes[i], this, bInsertContent );
pNew->InsertBehind( this, pTmpPrev );
pTmpPrev = pNew;
}
@@ -4667,7 +4672,7 @@ void SwRowFrm::AdjustCells( const SwTwips nHeight, const BOOL bHeight )
SwFrm *pFrm = Lower();
if ( bHeight )
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
SWRECTFN( this )
SwRect aOldFrm;
@@ -4777,7 +4782,7 @@ void SwRowFrm::Cut()
// --> OD 2010-02-17 #i103961#
// notification for accessibility
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() )
{
ViewShell* pVSh = pRootFrm->GetCurrShell();
@@ -5027,8 +5032,8 @@ bool SwRowFrm::ShouldRowKeepWithNext() const
|* Letzte Aenderung MA 30. May. 96
|*
|*************************************************************************/
-SwCellFrm::SwCellFrm( const SwTableBox &rBox, bool bInsertContent ) :
- SwLayoutFrm( rBox.GetFrmFmt() ),
+SwCellFrm::SwCellFrm( const SwTableBox &rBox, SwFrm* pSib, bool bInsertContent ) :
+ SwLayoutFrm( rBox.GetFrmFmt(), pSib ),
pTabBox( &rBox )
{
nType = FRMC_CELL;
@@ -5050,7 +5055,7 @@ SwCellFrm::SwCellFrm( const SwTableBox &rBox, bool bInsertContent ) :
SwFrm *pTmpPrev = 0;
for ( USHORT i = 0; i < rLines.Count(); ++i )
{
- SwRowFrm *pNew = new SwRowFrm( *rLines[i], bInsertContent );
+ SwRowFrm *pNew = new SwRowFrm( *rLines[i], this, bInsertContent );
pNew->InsertBehind( this, pTmpPrev );
pTmpPrev = pNew;
}
@@ -5064,7 +5069,7 @@ SwCellFrm::~SwCellFrm()
{
// At this stage the lower frames aren't destroyed already,
// therfor we have to do a recursive dispose.
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -5621,7 +5626,7 @@ void SwCellFrm::Modify( SfxPoolItem * pOld, SfxPoolItem * pNew )
SFX_ITEM_SET == ((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_PROTECT, FALSE ) ) ||
RES_PROTECT == pNew->Which() )
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if( pSh && pSh->GetLayout()->IsAnyShellAccessible() )
pSh->Imp()->InvalidateAccessibleEditableState( sal_True, this );
}
@@ -5681,7 +5686,7 @@ void SwCellFrm::Cut()
{
// notification for accessibility
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() )
{
ViewShell* pVSh = pRootFrm->GetCurrShell();
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 018e48440b59..034387978ed7 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -893,7 +893,7 @@ USHORT SwRootFrm::GetCurrPage( const SwPaM *pActualCrsr ) const
{
ASSERT( pActualCrsr, "Welche Seite soll's denn sein?" );
const SwFrm *pActFrm = GetFmt()->GetDoc()->GetNodes()[pActualCrsr->GetPoint()->nNode]->
- GetCntntNode()->GetFrm( 0,
+ GetCntntNode()->getLayoutFrm( this, 0,
pActualCrsr->GetPoint(),
FALSE );
return pActFrm->FindPageFrm()->GetPhyPageNum();
@@ -1878,8 +1878,8 @@ bool SwRootFrm::MakeTblCrsrs( SwTableCursor& rTblCrsr )
const SwCntntNode* pTmpStartNode = rTblCrsr.GetCntntNode();
const SwCntntNode* pTmpEndNode = rTblCrsr.GetCntntNode(FALSE);
- const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->GetFrm( &aPtPt, 0, FALSE ) : 0;
- const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->GetFrm( &aMkPt, 0, FALSE ) : 0;
+ const SwFrm* pTmpStartFrm = pTmpStartNode ? pTmpStartNode->getLayoutFrm( this, &aPtPt, 0, FALSE ) : 0;
+ const SwFrm* pTmpEndFrm = pTmpEndNode ? pTmpEndNode->getLayoutFrm( this, &aMkPt, 0, FALSE ) : 0;
const SwLayoutFrm* pStart = pTmpStartFrm ? pTmpStartFrm->GetUpper() : 0;
const SwLayoutFrm* pEnd = pTmpEndFrm ? pTmpEndFrm->GetUpper() : 0;
@@ -2016,7 +2016,7 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
*pEndPos = rCrsr.GetPoint() == pStartPos ?
rCrsr.GetMark() : rCrsr.GetPoint();
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = GetCurrShell();
// --> FME 2004-06-08 #i12836# enhanced pdf
SwRegionRects aRegion( pSh && !pSh->GetViewOptions()->IsPDFExport() ?
@@ -2024,10 +2024,10 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
Frm() );
// <--
if( !pStartPos->nNode.GetNode().IsCntntNode() ||
- !pStartPos->nNode.GetNode().GetCntntNode()->GetFrm() ||
+ !pStartPos->nNode.GetNode().GetCntntNode()->getLayoutFrm(this) ||
( pStartPos->nNode != pEndPos->nNode &&
( !pEndPos->nNode.GetNode().IsCntntNode() ||
- !pEndPos->nNode.GetNode().GetCntntNode()->GetFrm() ) ) )
+ !pEndPos->nNode.GetNode().GetCntntNode()->getLayoutFrm(this) ) ) )
{
/* For SelectAll we will need something like this later on...
const SwFrm* pPageFrm = GetLower();
@@ -2048,10 +2048,10 @@ void SwRootFrm::CalcFrmRects( SwShellCrsr &rCrsr, BOOL bIsTblMode )
//Erstmal die CntntFrms zum Start und End besorgen, die brauch ich auf
//jedenfall.
const SwCntntFrm *pStartFrm = rNds[ pStartPos->nNode ]->
- GetCntntNode()->GetFrm( &rCrsr.GetSttPos(), pStartPos );
+ GetCntntNode()->getLayoutFrm( this, &rCrsr.GetSttPos(), pStartPos );
const SwCntntFrm *pEndFrm = rNds[ pEndPos->nNode ]->
- GetCntntNode()->GetFrm( &rCrsr.GetEndPos(), pEndPos );
+ GetCntntNode()->getLayoutFrm( this, &rCrsr.GetEndPos(), pEndPos );
ASSERT( (pStartFrm && pEndFrm), "Keine CntntFrms gefunden." );
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index ade3efd4e70d..5a8c8b00d7c9 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -43,8 +43,11 @@
#include <rootfrm.hxx>
#include <cntfrm.hxx>
#include <dcontact.hxx>
+#include <anchoreddrawobject.hxx>
+#include <fmtanchr.hxx>
#include <viewsh.hxx>
#include <viewimp.hxx>
+#include "viewopt.hxx"
#include <doc.hxx>
#include <fesh.hxx>
#include <docsh.hxx>
@@ -87,11 +90,12 @@ using namespace ::com::sun::star;
|*
|*************************************************************************/
-SwFrm::SwFrm( SwModify *pMod ) :
+SwFrm::SwFrm( SwModify *pMod, SwFrm* pSib ) :
SwClient( pMod ),
// --> OD 2006-05-10 #i65250#
mnFrmId( SwFrm::mnLastFrmId++ ),
// <--
+ mpRoot( pSib ? pSib->getRootFrm() : 0 ),
pUpper( 0 ),
pNext( 0 ),
pPrev( 0 ),
@@ -114,16 +118,6 @@ SwFrm::SwFrm( SwModify *pMod ) :
bCompletePaint = bInfInvalid = TRUE;
}
-
-ViewShell * SwFrm::GetShell() const
-{
- const SwRootFrm *pRoot;
- if ( 0 != (pRoot = FindRootFrm()) )
- return pRoot->GetCurrShell();
- return 0;
-}
-
-
void SwFrm::CheckDir( UINT16 nDir, BOOL bVert, BOOL bOnlyBiDi, BOOL bBrowse )
{
if( FRMDIR_ENVIRONMENT == nDir || ( bVert && bOnlyBiDi ) )
@@ -173,9 +167,12 @@ void SwSectionFrm::CheckDirection( BOOL bVert )
{
const SwFrmFmt* pFmt = GetFmt();
if( pFmt )
+ {
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
CheckDir(((SvxFrameDirectionItem&)pFmt->GetFmtAttr(RES_FRAMEDIR)).GetValue(),
- bVert, sal_True,
- pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) );
+ bVert, sal_True, bBrowseMode );
+ }
else
SwFrm::CheckDirection( bVert );
}
@@ -184,9 +181,12 @@ void SwFlyFrm::CheckDirection( BOOL bVert )
{
const SwFrmFmt* pFmt = GetFmt();
if( pFmt )
+ {
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
CheckDir(((SvxFrameDirectionItem&)pFmt->GetFmtAttr(RES_FRAMEDIR)).GetValue(),
- bVert, sal_False,
- pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) );
+ bVert, sal_False, bBrowseMode );
+ }
else
SwFrm::CheckDirection( bVert );
}
@@ -195,9 +195,12 @@ void SwTabFrm::CheckDirection( BOOL bVert )
{
const SwFrmFmt* pFmt = GetFmt();
if( pFmt )
+ {
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
CheckDir(((SvxFrameDirectionItem&)pFmt->GetFmtAttr(RES_FRAMEDIR)).GetValue(),
- bVert, sal_True,
- pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) );
+ bVert, sal_True, bBrowseMode );
+ }
else
SwFrm::CheckDirection( bVert );
}
@@ -213,8 +216,9 @@ void SwCellFrm::CheckDirection( BOOL bVert )
if( pFmt && SFX_ITEM_SET == pFmt->GetItemState( RES_FRAMEDIR, TRUE, &pItem ) )
{
const SvxFrameDirectionItem* pFrmDirItem = static_cast<const SvxFrameDirectionItem*>(pItem);
- CheckDir( pFrmDirItem->GetValue(), bVert, sal_False,
- pFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) );
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
+ CheckDir( pFrmDirItem->GetValue(), bVert, sal_False, bBrowseMode );
}
else
SwFrm::CheckDirection( bVert );
@@ -222,9 +226,10 @@ void SwCellFrm::CheckDirection( BOOL bVert )
void SwTxtFrm::CheckDirection( BOOL bVert )
{
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
CheckDir( GetTxtNode()->GetSwAttrSet().GetFrmDir().GetValue(), bVert,
- sal_True,
- GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) );
+ sal_True, bBrowseMode );
}
/*************************************************************************
@@ -983,7 +988,7 @@ void SwCntntFrm::Cut()
//er die Retouche uebernehmen.
//Ausserdem kann eine Leerseite entstanden sein.
else
- { SwRootFrm *pRoot = FindRootFrm();
+ { SwRootFrm *pRoot = getRootFrm();
if ( pRoot )
{
pRoot->SetSuperfluous();
@@ -1392,7 +1397,8 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst )
if ( !nDiff || !GetUpper()->IsFtnBossFrm() ) // nur innerhalb von Seiten/Spalten
return 0L;
- BOOL bBrowse = GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
//Der (Page)Body veraendert sich nur im BrowseMode, aber nicht wenn er
//Spalten enthaelt.
@@ -1406,16 +1412,16 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst )
long nBrowseAdd = 0;
if ( bBrowse && GetUpper()->IsPageFrm() ) // nur (Page)BodyFrms
{
- ViewShell *pSh = GetShell();
+ ViewShell *pViewShell = getRootFrm()->GetCurrShell();
SwLayoutFrm *pUp = GetUpper();
long nChg;
const long nUpPrtBottom = pUp->Frm().Height() -
pUp->Prt().Height() - pUp->Prt().Top();
SwRect aInva( pUp->Frm() );
- if ( pSh )
+ if ( pViewShell )
{
- aInva.Pos().X() = pSh->VisArea().Left();
- aInva.Width( pSh->VisArea().Width() );
+ aInva.Pos().X() = pViewShell->VisArea().Left();
+ aInva.Width( pViewShell->VisArea().Width() );
}
if ( nDiff > 0 )
{
@@ -1425,7 +1431,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst )
if ( !IsBodyFrm() )
{
SetCompletePaint();
- if ( !pSh || pSh->VisArea().Height() >= pUp->Frm().Height() )
+ if ( !pViewShell || pViewShell->VisArea().Height() >= pUp->Frm().Height() )
{
//Ersteinmal den Body verkleinern. Der waechst dann schon
//wieder.
@@ -1455,12 +1461,12 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst )
//mindestens so gross wie die VisArea.
nChg = nDiff;
long nInvaAdd = 0;
- if ( pSh && !pUp->GetPrev() &&
- pUp->Frm().Height() + nDiff < pSh->VisArea().Height() )
+ if ( pViewShell && !pUp->GetPrev() &&
+ pUp->Frm().Height() + nDiff < pViewShell->VisArea().Height() )
{
//Das heisst aber wiederum trotzdem, das wir geeignet invalidieren
//muessen.
- nChg = pSh->VisArea().Height() - pUp->Frm().Height();
+ nChg = pViewShell->VisArea().Height() - pUp->Frm().Height();
nInvaAdd = -(nDiff - nChg);
}
@@ -1483,16 +1489,16 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst )
if ( !bTst )
{
//Unabhaengig von nChg
- if ( pSh && aInva.HasArea() && pUp->GetUpper() )
- pSh->InvalidateWindows( aInva );
+ if ( pViewShell && aInva.HasArea() && pUp->GetUpper() )
+ pViewShell->InvalidateWindows( aInva );
}
if ( !bTst && nChg )
{
const SwRect aOldRect( pUp->Frm() );
pUp->Frm().SSize().Height() += nChg;
pUp->Prt().SSize().Height() += nChg;
- if ( pSh )
- pSh->Imp()->SetFirstVisPageInvalid();
+ if ( pViewShell )
+ pViewShell->Imp()->SetFirstVisPageInvalid();
if ( GetNext() )
GetNext()->_InvalidatePos();
@@ -1500,7 +1506,7 @@ SwTwips SwFrm::AdjustNeighbourhood( SwTwips nDiff, BOOL bTst )
//Ggf. noch ein Repaint ausloesen.
const SvxGraphicPosition ePos = pUp->GetFmt()->GetBackground().GetGraphicPos();
if ( ePos != GPOS_NONE && ePos != GPOS_TILED )
- pSh->InvalidateWindows( pUp->Frm() );
+ pViewShell->InvalidateWindows( pUp->Frm() );
if ( pUp->GetUpper() )
{
@@ -1889,7 +1895,8 @@ SwTwips SwCntntFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
nDist > (LONG_MAX - nFrmHeight ) )
nDist = LONG_MAX - nFrmHeight;
- const BOOL bBrowse = GetUpper()->GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
const USHORT nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body
if( !(GetUpper()->GetType() & nTmpType) && GetUpper()->HasFixSize() )
{
@@ -2347,8 +2354,8 @@ void SwCntntFrm::_UpdateAttr( SfxPoolItem* pOld, SfxPoolItem* pNew,
|* Letzte Aenderung MA 12. May. 95
|*
|*************************************************************************/
-SwLayoutFrm::SwLayoutFrm( SwFrmFmt* pFmt ):
- SwFrm( pFmt ),
+SwLayoutFrm::SwLayoutFrm( SwFrmFmt* pFmt, SwFrm* pSib ):
+ SwFrm( pFmt, pSib ),
pLower( 0 )
{
const SwFmtFrmSize &rFmtSize = pFmt->GetFrmSize();
@@ -2411,7 +2418,8 @@ SwTwips SwLayoutFrm::InnerHeight() const
|*************************************************************************/
SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
{
- const BOOL bBrowse = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
const USHORT nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body
if( !(GetType() & nTmpType) && HasFixSize() )
return 0;
@@ -2557,7 +2565,7 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
if( bMoveAccFrm && IsAccessibleFrm() )
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -2577,7 +2585,8 @@ SwTwips SwLayoutFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
|*************************************************************************/
SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
{
- const BOOL bBrowse = GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const BOOL bBrowse = pSh && pSh->GetViewOptions()->getBrowseMode();
const USHORT nTmpType = bBrowse ? 0x2084: 0x2004; //Row+Cell, Browse mit Body
if( !(GetType() & nTmpType) && HasFixSize() )
return 0;
@@ -2675,7 +2684,7 @@ SwTwips SwLayoutFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
if( bMoveAccFrm && IsAccessibleFrm() )
{
- SwRootFrm *pRootFrm = FindRootFrm();
+ SwRootFrm *pRootFrm = getRootFrm();
if( pRootFrm && pRootFrm->IsAnyShellAccessible() &&
pRootFrm->GetCurrShell() )
{
@@ -3330,10 +3339,9 @@ long SwLayoutFrm::CalcRel( const SwFmtFrmSize &rSz, BOOL ) const
{
const SwFrm *pRel = GetUpper();
long nRel = LONG_MAX;
- const ViewShell *pSh = GetShell();
- if ( pRel->IsPageBodyFrm() &&
- GetFmt()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
- pSh && pSh->VisArea().Width())
+ const ViewShell *pSh = getRootFrm()->GetCurrShell();
+ const BOOL bBrowseMode = pSh && pSh->GetViewOptions()->getBrowseMode();
+ if( pRel->IsPageBodyFrm() && pSh && bBrowseMode && pSh->VisArea().Width() )
{
nRel = pSh->GetBrowseWidth();
long nDiff = nRel - pRel->Prt().Width();
@@ -3434,7 +3442,9 @@ void SwLayoutFrm::FormatWidthCols( const SwBorderAttrs &rAttrs,
BOOL bEnd = FALSE;
BOOL bBackLock = FALSE;
- SwViewImp *pImp = GetShell() ? GetShell()->Imp() : 0;
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
+
+ SwViewImp *pImp = pSh ? pSh->Imp() : 0;
{
// Zugrunde liegender Algorithmus
// Es wird versucht, eine optimale Hoehe fuer die Spalten zu finden.
@@ -3949,7 +3959,7 @@ void SwRootFrm::InvalidateAllCntnt( BYTE nInv )
if( nInv & INV_PRTAREA )
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if( pSh )
pSh->InvalidateWindows( Frm() );
}
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index 5f5e0155e77c..afd1374126cc 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -36,6 +36,9 @@
// --> OD 2004-10-15 #i26945#
#include <tabfrm.hxx>
// <--
+#include "rootfrm.hxx"
+#include "viewopt.hxx"
+#include "viewsh.hxx"
#include <frmfmt.hxx>
#include <IDocumentSettingAccess.hxx>
#include <fmtsrnd.hxx>
@@ -159,10 +162,13 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// declare and set <bBrowse> to true, if document is in browser mode and
// object is anchored at the body, but not at frame belonging to a table.
- const bool bBrowse = GetAnchorFrm().IsInDocBody() &&
- !GetAnchorFrm().IsInTab()
- ? rFrmFmt.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)
- : false;
+ bool bBrowse = GetAnchorFrm().IsInDocBody() && !GetAnchorFrm().IsInTab();
+ if( bBrowse )
+ {
+ const ViewShell *pSh = GetAnchorFrm().getRootFrm()->GetCurrShell();
+ if( !pSh || !pSh->GetViewOptions()->getBrowseMode() )
+ bBrowse = false;
+ }
// determine left/right and its upper/lower spacing.
const SvxLRSpaceItem &rLR = rFrmFmt.GetLRSpace();
diff --git a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
index 729a1eabaded..243e9b3804bb 100644
--- a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx
@@ -31,15 +31,16 @@
#include <anchoredobject.hxx>
#include <frame.hxx>
#include <pagefrm.hxx>
-#ifndef _SVX_SVDOBJ_HXX
#include <svx/svdobj.hxx>
-#endif
#include <frmfmt.hxx>
#include <fmtanchr.hxx>
#include <fmtornt.hxx>
#include <fmtsrnd.hxx>
#include <IDocumentSettingAccess.hxx>
#include <frmatr.hxx>
+#include "viewsh.hxx"
+#include "viewopt.hxx"
+#include "rootfrm.hxx"
#include <editeng/lrspitem.hxx>
#include <editeng/ulspitem.hxx>
@@ -131,8 +132,9 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition()
// if in online-layout the bottom of to-page anchored object is beyond
// the page bottom, the page frame has to grow by growing its body frame.
+ const ViewShell *pSh = GetAnchorFrm().getRootFrm()->GetCurrShell();
if ( !bFlyAtFly && GetAnchorFrm().IsPageFrm() &&
- rFrmFmt.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ pSh && pSh->GetViewOptions()->getBrowseMode() )
{
const long nAnchorBottom = GetAnchorFrm().Frm().Bottom();
const long nBottom = GetAnchorFrm().Frm().Top() +
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 881402efbfb2..eb95c281ffd1 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -795,7 +795,7 @@ uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef()
{
//Das Teil konnte nicht geladen werden (wahrsch. Kaputt).
Rectangle aArea;
- SwFrm *pFrm = pOLENd->GetFrm();
+ SwFrm *pFrm = pOLENd->getLayoutFrm(0);
if ( pFrm )
{
Size aSz( pFrm->Frm().SSize() );
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index de76b856cda7..2f7d65cf1e1d 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -1406,7 +1406,7 @@ BOOL SwTable::NewSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, USHORT nCnt,
_FndBox aFndBox( 0, 0 );
aFndBox.SetTableLines( rBoxes, *this );
- if( bSameHeight && pDoc->GetRootFrm() )
+ if( bSameHeight && pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
SwSplitLines aRowLines;
SwSplitLines aSplitLines;
diff --git a/sw/source/core/text/blink.cxx b/sw/source/core/text/blink.cxx
index 717bf0170179..5430528956eb 100644
--- a/sw/source/core/text/blink.cxx
+++ b/sw/source/core/text/blink.cxx
@@ -149,7 +149,7 @@ void SwBlink::Insert( const Point& rPoint, const SwLinePortion* pPor,
else
{
pBlinkPor->SetPos( rPoint );
- pBlinkPor->SetRootFrm( pTxtFrm->FindRootFrm() );
+ pBlinkPor->SetRootFrm( pTxtFrm->getRootFrm() );
aList.Insert( pBlinkPor );
pTxtFrm->SetBlinkPor();
if( pPor->IsLayPortion() || pPor->IsParaPortion() )
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index 8f9d3fc77337..d900e606fa82 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -34,6 +34,7 @@
#include "frmtool.hxx"
#include "viewopt.hxx"
#include "paratr.hxx"
+#include "rootfrm.hxx"
#include "pagefrm.hxx"
#include "colfrm.hxx"
#include "txttypes.hxx"
@@ -131,7 +132,7 @@ sal_Bool lcl_ChangeOffset( SwTxtFrm* pFrm, xub_StrLen nNew )
!pFly->GetNextLink() && !pFly->GetPrevLink() ) ||
( !pFly && pFrm->IsInTab() ) )
{
- ViewShell* pVsh = pFrm->GetShell();
+ ViewShell* pVsh = pFrm->getRootFrm()->GetCurrShell();
if( pVsh )
{
if( pVsh->GetNext() != pVsh ||
@@ -145,7 +146,7 @@ sal_Bool lcl_ChangeOffset( SwTxtFrm* pFrm, xub_StrLen nNew )
pFrm->SetPara( 0 );
pFrm->GetFormatted();
if( pFrm->Frm().HasArea() )
- pFrm->GetShell()->InvalidateWindows( pFrm->Frm() );
+ pFrm->getRootFrm()->GetCurrShell()->InvalidateWindows( pFrm->Frm() );
return sal_True;
}
}
@@ -923,7 +924,7 @@ sal_Bool SwTxtFrm::_UnitUp( SwPaM *pPam, const SwTwips nOffset,
xub_StrLen nOffs = GetOfst();
if( pTmpPrev )
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
sal_Bool bProtectedAllowed = pSh && pSh->GetViewOptions()->IsCursorInProtectedArea();
const SwTxtFrm *pPrevPrev = pTmpPrev;
// Hier werden geschuetzte Frames und Frame ohne Inhalt ausgelassen
@@ -1276,7 +1277,7 @@ sal_Bool SwTxtFrm::_UnitDown(SwPaM *pPam, const SwTwips nOffset,
if( 0 != ( pTmpFollow = GetFollow() ) )
{ // geschuetzte Follows auslassen
const SwCntntFrm* pTmp = pTmpFollow;
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if( !pSh || !pSh->GetViewOptions()->IsCursorInProtectedArea() )
{
while( pTmpFollow && pTmpFollow->IsProtected() )
@@ -1436,7 +1437,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
pColl = &pColl->GetNextTxtFmtColl();
SwAttrSet aSet( ((SwDoc*)GetTxtNode()->GetDoc())->GetAttrPool(), aTxtFmtCollSetRange );
const SwAttrSet* pSet = &pColl->GetAttrSet();
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if( GetTxtNode()->HasSwAttrSet() )
{
aSet.Put( *GetTxtNode()->GetpSwAttrSet() );
@@ -1451,8 +1452,7 @@ void SwTxtFrm::FillCrsrPos( SwFillData& rFill ) const
pFnt->ChkMagic( pSh, pFnt->GetActual() );
}
OutputDevice* pOut = pSh->GetOut();
- if ( !GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ||
- ( pSh->GetViewOptions()->IsPrtFormat() ) )
+ if( !pSh->GetViewOptions()->getBrowseMode() || pSh->GetViewOptions()->IsPrtFormat() )
pOut = GetTxtNode()->getIDocumentDeviceAccess()->getReferenceDevice( true );
pFnt->SetFntChg( sal_True );
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index be9c84cc88af..2de1c0d3b0b7 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -681,7 +681,7 @@ SwCntntFrm *SwTxtFrm::JoinFrm()
// and relation CONTENT_FLOWS_TO for current previous paragraph, which
// is <this>, will change.
{
- ViewShell* pViewShell( pFoll->GetShell() );
+ ViewShell* pViewShell( pFoll->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -708,7 +708,7 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos )
// Durch das Paste wird ein Modify() an mich verschickt.
// Damit meine Daten nicht verschwinden, locke ich mich.
SwTxtFrmLocker aLock( this );
- SwTxtFrm *pNew = (SwTxtFrm *)(GetTxtNode()->MakeFrm());
+ SwTxtFrm *pNew = (SwTxtFrm *)(GetTxtNode()->MakeFrm( this ));
pNew->bIsFollow = sal_True;
pNew->SetFollow( GetFollow() );
@@ -721,7 +721,7 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos )
// and relation CONTENT_FLOWS_TO for current previous paragraph, which
// is <this>, will change.
{
- ViewShell* pViewShell( pNew->GetShell() );
+ ViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() );
if ( pViewShell && pViewShell->GetLayout() &&
pViewShell->GetLayout()->IsAnyShellAccessible() )
{
@@ -1297,7 +1297,7 @@ sal_Bool SwTxtFrm::FormatLine( SwTxtFormatter &rLine, const sal_Bool bPrev )
}
SwTwips nRght = Max( nOldWidth, pNew->Width() +
pNew->GetHangingMargin() );
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
const SwViewOption *pOpt = pSh ? pSh->GetViewOptions() : 0;
if( pOpt && (pOpt->IsParagraph() || pOpt->IsLineBreak()) )
nRght += ( Max( nOldAscent, pNew->GetAscent() ) );
diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx
index 443900e1942c..bdee0bb911c5 100644
--- a/sw/source/core/text/frmpaint.cxx
+++ b/sw/source/core/text/frmpaint.cxx
@@ -38,13 +38,10 @@
#include <tgrditem.hxx>
#include <paratr.hxx>
-#ifndef _FMTLINE_HXX
#include <fmtline.hxx>
-#endif
-#ifndef _LINEINFO_HXX
#include <lineinfo.hxx>
-#endif
#include <charfmt.hxx>
+#include "rootfrm.hxx"
#include <pagefrm.hxx>
#include <viewsh.hxx> // ViewShell
#include <viewimp.hxx> // SwViewImp
@@ -324,7 +321,7 @@ void SwTxtFrm::PaintExtraData( const SwRect &rRect ) const
{
if( IsLocked() || IsHiddenNow() || !Prt().Height() )
return;
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
SWAP_IF_NOT_SWAPPED( this )
SwRect rOldRect( rRect );
@@ -478,7 +475,7 @@ SwRect SwTxtFrm::Paint()
sal_Bool SwTxtFrm::PaintEmpty( const SwRect &rRect, sal_Bool bCheck ) const
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if( pSh && ( pSh->GetViewOptions()->IsParagraph() || bInitFont ) )
{
bInitFont = sal_False;
@@ -601,7 +598,7 @@ void SwTxtFrm::Paint( const SwRect &rRect, const SwPrtOptions * /*pPrintData*/ )
ResetRepaint();
// --> FME 2004-06-24 #i16816# tagged pdf support
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
Num_Info aNumInfo( *this );
SwTaggedPDFHelper aTaggedPDFHelperNumbering( &aNumInfo, 0, 0, *pSh->GetOut() );
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index ffcf4b53afbd..6fe26a2ede13 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -299,7 +299,7 @@ void SwTxtSizeInfo::CtorInitTxtSizeInfo( SwTxtFrm *pFrame, SwFont *pNewFnt,
pFrm = pFrame;
CtorInitTxtInfo( pFrm );
const SwTxtNode *pNd = pFrm->GetTxtNode();
- pVsh = pFrm->GetShell();
+ pVsh = pFrm->getRootFrm()->GetCurrShell();
// Get the output and reference device
if ( pVsh )
@@ -311,7 +311,7 @@ void SwTxtSizeInfo::CtorInitTxtSizeInfo( SwTxtFrm *pFrame, SwFont *pNewFnt,
else
{
//Zugriff ueber StarONE, es muss keine Shell existieren oder aktiv sein.
- if ( pNd->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( pNd->getIDocumentSettingAccess()->get(IDocumentSettingAccess::HTML_MODE) )
{
//in Ermangelung eines Besseren kann hier ja wohl nur noch das
//AppWin genommen werden?
@@ -661,7 +661,7 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo
if( GetFont()->IsBlink() && OnWin() && rPor.Width() )
{
// check if accessibility options allow blinking portions:
- const ViewShell* pSh = GetTxtFrm()->GetShell();
+ const ViewShell* pSh = GetTxtFrm()->getRootFrm()->GetCurrShell();
if ( pSh && ! pSh->GetAccessibilityOptions()->IsStopAnimatedText() &&
! pSh->IsPreView() )
{
@@ -710,7 +710,7 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo
const sal_Bool bTmpSmart = bSmartTag && OnWin() && !GetOpt().IsPagePreview() && SwSmartTagMgr::Get().IsSmartTagsEnabled(); // SMARTTAGS
ASSERT( GetParaPortion(), "No paragraph!");
- SwDrawTextInfo aDrawInf( pFrm->GetShell(), *pOut, pSI, rText, nStart, nLength,
+ SwDrawTextInfo aDrawInf( pFrm->getRootFrm()->GetCurrShell(), *pOut, pSI, rText, nStart, nLength,
rPor.Width(), bBullet );
aDrawInf.SetLeft( GetPaintRect().Left() );
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 60b476839705..0e851fdbb448 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -33,7 +33,7 @@
#include <editeng/charscaleitem.hxx>
#include <txtatr.hxx>
#include <sfx2/printer.hxx>
-#include <editeng/lrspitem.hxx>
+#include <svx/svdobj.hxx>
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
#include <fmtanchr.hxx>
@@ -62,6 +62,7 @@
#include <breakit.hxx>
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/i18n/ScriptType.hdl>
+#include <editeng/lrspitem.hxx>
using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star;
@@ -429,15 +430,14 @@ sal_Bool lcl_MinMaxString( SwMinMaxArgs& rArg, SwFont* pFnt, const XubString &rT
return bRet;
}
-sal_Bool SwTxtNode::IsSymbol( const xub_StrLen nBegin ) const
+sal_Bool SwTxtNode::IsSymbol( const xub_StrLen nBegin ) const//swmodtest 080307
{
SwScriptInfo aScriptInfo;
SwAttrIter aIter( *(SwTxtNode*)this, aScriptInfo );
aIter.Seek( nBegin );
- const SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetRootFrm();
- return aIter.GetFnt()->IsSymbol( pTmpRootFrm ?
- pTmpRootFrm->GetCurrShell() :
- 0 );
+ //const SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetCurrentLayout();
+ return aIter.GetFnt()->IsSymbol(
+ const_cast<ViewShell *>(getIDocumentLayoutAccess()->GetCurrentViewShell()) );//swmod 080311
}
class SwMinMaxNodeArgs
@@ -590,7 +590,7 @@ sal_Bool lcl_MinMaxNode( const SwFrmFmtPtr& rpNd, void* pArgs )
// changing this method very likely requires changing of
// "GetScalingOfSelectedText"
void SwTxtNode::GetMinMaxSize( ULONG nIndex, ULONG& rMin, ULONG &rMax,
- ULONG& rAbsMin, OutputDevice* pOut ) const
+ ULONG& rAbsMin, OutputDevice* pOut ) const//swmodtest 080307
{
ViewShell* pSh = 0;
GetDoc()->GetEditShell( &pSh );
@@ -702,10 +702,9 @@ void SwTxtNode::GetMinMaxSize( ULONG nIndex, ULONG& rMin, ULONG &rMax,
case CHAR_HARDHYPHEN:
{
XubString sTmp( cChar );
- const SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetRootFrm();
- SwDrawTextInfo aDrawInf( pTmpRootFrm ?
- pTmpRootFrm->GetCurrShell() :
- 0, *pOut, 0, sTmp, 0, 1, 0, sal_False );
+ //const SwRootFrm* pTmpRootFrm = getIDocumentLayoutAccess()->GetCurrentLayout();
+ SwDrawTextInfo aDrawInf( const_cast<ViewShell *>(getIDocumentLayoutAccess()->GetCurrentViewShell()),
+ *pOut, 0, sTmp, 0, 1, 0, sal_False );//swmod 080311
nAktWidth = aIter.GetFnt()->_GetTxtSize( aDrawInf ).Width();
aArg.nWordWidth += nAktWidth;
aArg.nRowWidth += nAktWidth;
@@ -839,7 +838,7 @@ USHORT SwTxtNode::GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd )
else
{
//Zugriff ueber StarONE, es muss keine Shell existieren oder aktiv sein.
- if ( getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( getIDocumentSettingAccess()->get(IDocumentSettingAccess::HTML_MODE) )
pOut = GetpApp()->GetDefaultDevice();
else
pOut = getIDocumentDeviceAccess()->getReferenceDevice( true );
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 1a05aa38098a..b487df43e44c 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -31,20 +31,11 @@
#include <hintids.hxx>
-#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_
#include <com/sun/star/i18n/ScriptType.hdl>
-#endif
-
-#ifndef _GRAPH_HXX //autogen
#include <vcl/graph.hxx>
-#endif
#include <editeng/brshitem.hxx>
-#ifndef _METRIC_HXX //autogen
#include <vcl/metric.hxx>
-#endif
-#ifndef _OUTDEV_HXX //autogen
#include <vcl/outdev.hxx>
-#endif
#include <viewopt.hxx> // SwViewOptions
#include <txtcfg.hxx>
#include <SwPortionHandler.hxx>
@@ -54,10 +45,9 @@
#include <blink.hxx> // pBlink
#include <frmtool.hxx> // DrawGraphic
#include <viewsh.hxx>
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <doc.hxx>
+#include "rootfrm.hxx"
#include <breakit.hxx>
#include <porrst.hxx>
#include <porftn.hxx> // SwFtnPortion
@@ -1014,7 +1004,7 @@ void SwGrfNumPortion::Paint( const SwTxtPaintInfo &rInf ) const
pViewShell && pViewShell->GetWin() )
{
( (Graphic*) pBrush->GetGraphic() )->StopAnimation(0,nId);
- rInf.GetTxtFrm()->GetShell()->InvalidateWindows( aTmp );
+ rInf.GetTxtFrm()->getRootFrm()->GetCurrShell()->InvalidateWindows( aTmp );
}
@@ -1248,7 +1238,7 @@ sal_Bool SwCombinedPortion::Format( SwTxtFormatInfo &rInf )
}
USHORT nTop = ( nCount + 1 ) / 2; // the first character of the second line
- ViewShell *pSh = rInf.GetTxtFrm()->GetShell();
+ ViewShell *pSh = rInf.GetTxtFrm()->getRootFrm()->GetCurrShell();
SwFont aTmpFont( *rInf.GetFont() );
SwFontSave aFontSave( rInf, &aTmpFont );
nProportion = 55;
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 0cad374e97e2..cc4f060d5f86 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -33,6 +33,7 @@
#include "dflyobj.hxx" // SwVirtFlyDrawObj
#include "pam.hxx" // SwPosition
#include "flyfrm.hxx" // SwFlyInCntFrm
+#include "rootfrm.hxx"
#include "frmfmt.hxx" // SwFrmFmt
#include "viewsh.hxx"
@@ -254,7 +255,7 @@ void SwFlyCntPortion::Paint( const SwTxtPaintInfo &rInf ) const
if( (GetFlyFrm()->IsCompletePaint() ||
GetFlyFrm()->Frm().IsOver( aRepaintRect )) &&
SwFlyFrm::IsPaint( (SdrObject*)GetFlyFrm()->GetVirtDrawObj(),
- GetFlyFrm()->GetShell() ))
+ GetFlyFrm()->getRootFrm()->GetCurrShell() ))
{
SwRect aRect( GetFlyFrm()->Frm() );
if( !GetFlyFrm()->IsCompletePaint() )
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index 3bc8e566b335..2e51fa45411b 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -53,6 +53,7 @@
#include <redlnitr.hxx> // SwRedlineItr
#include <porfly.hxx> // SwFlyPortion
#include <atrhndl.hxx>
+#include "rootfrm.hxx"
#include <IDocumentRedlineAccess.hxx>
#include <IDocumentSettingAccess.hxx>
@@ -233,7 +234,7 @@ SwTwips SwTxtFrm::EmptyHeight() const
SwFont *pFnt;
const SwTxtNode& rTxtNode = *GetTxtNode();
const IDocumentSettingAccess* pIDSA = rTxtNode.getIDocumentSettingAccess();
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( rTxtNode.HasSwAttrSet() )
{
const SwAttrSet *pAttrSet = &( rTxtNode.GetSwAttrSet() );
@@ -250,8 +251,8 @@ SwTwips SwTxtFrm::EmptyHeight() const
pFnt->SetVertical( 2700 );
OutputDevice* pOut = pSh ? pSh->GetOut() : 0;
- if ( !pOut || !pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) ||
- ( pSh->GetViewOptions()->IsPrtFormat() ) )
+ if ( !pOut || !pSh->GetViewOptions()->getBrowseMode() ||
+ pSh->GetViewOptions()->IsPrtFormat() )
{
pOut = rTxtNode.getIDocumentDeviceAccess()->getReferenceDevice(true);
}
@@ -393,13 +394,13 @@ sal_Bool SwTxtFrm::FillRegister( SwTwips& rRegStart, KSHORT& rRegDiff )
}
else
{
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
SwFontAccess aFontAccess( pFmt, pSh );
SwFont aFnt( *aFontAccess.Get()->GetFont() );
OutputDevice *pOut = 0;
- if( !GetTxtNode()->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ||
- (pSh && pSh->GetViewOptions()->IsPrtFormat()) )
+ if( !pSh || !pSh->GetViewOptions()->getBrowseMode() ||
+ pSh->GetViewOptions()->IsPrtFormat() )
pOut = GetTxtNode()->getIDocumentDeviceAccess()->getReferenceDevice( true );
if( pSh && !pOut )
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index d789121de4b8..71db30b53b60 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -64,8 +64,8 @@ using namespace ::com::sun::star;
void SwAttrIter::CtorInitAttrIter( SwTxtNode& rTxtNode, SwScriptInfo& rScrInf, SwTxtFrm* pFrm )
{
// Beim HTML-Import kann es vorkommen, dass kein Layout existiert.
- SwRootFrm* pRootFrm = rTxtNode.getIDocumentLayoutAccess()->GetRootFrm();
- pShell = pRootFrm ? pRootFrm->GetShell() : 0;
+ SwRootFrm* pRootFrm = rTxtNode.getIDocumentLayoutAccess()->GetCurrentLayout();
+ pShell = pRootFrm ? pRootFrm->GetCurrShell() : 0; //swmod 080218
pScriptInfo = &rScrInf;
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index 526dbe74c4d9..adebb58a24e6 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -146,7 +146,7 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
case RES_PAGENUMBERFLD:
{
- if( !bName && pSh && !pSh->Imp()->IsUpdateExpFlds() )
+ if( !bName && pSh && pSh->GetLayout() && !pSh->Imp()->IsUpdateExpFlds() )//swmod 080122
{
SwPageNumberFieldType *pPageNr = (SwPageNumberFieldType *)pFld->GetTyp();
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index db245de1e28b..9108ef01d92a 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -83,6 +83,7 @@
#ifdef DBG_UTIL
#include "viewopt.hxx" // SwViewOptions, nur zum Testen (Test2)
+#include "doc.hxx"
#endif
#ifdef VERT_DISTANCE
@@ -962,7 +963,7 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo &rInf )
if ( bOn && nCount > 0 )
// <--
{
- MSHORT nHellId = pPage->GetShell()->getIDocumentDrawModelAccess()->GetHellId();
+ MSHORT nHellId = pPage->getRootFrm()->GetCurrShell()->getIDocumentDrawModelAccess()->GetHellId();
for( MSHORT i = 0; i < nCount; ++i )
{
// --> OD 2006-08-15 #i68520#
@@ -1067,7 +1068,7 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
if ( bOn && nCount > 0 )
// <--
{
- MSHORT nHellId = pPage->GetShell()->getIDocumentDrawModelAccess()->GetHellId();
+ MSHORT nHellId = pPage->getRootFrm()->GetCurrShell()->getIDocumentDrawModelAccess()->GetHellId();
for( MSHORT i = 0; i < nCount; ++i )
{
// --> OD 2006-08-15 #i68520#
@@ -1106,7 +1107,7 @@ void SwTxtFly::DrawFlyRect( OutputDevice* pOut, const SwRect &rRect,
SwRect aFly( pAnchoredObjTmp->GetObjRect() );
// <--
// OD 24.01.2003 #106593#
- ::SwAlignRect( aFly, pPage->GetShell() );
+ ::SwAlignRect( aFly, pPage->getRootFrm()->GetCurrShell() );
if( aFly.Width() > 0 && aFly.Height() > 0 )
aRegion -= aFly;
}
@@ -1804,11 +1805,11 @@ const SwRect SwContourCache::ContourRect( const SwFmt* pFmt,
delete pPolyPolygon;
// UPPER_LOWER_TEST
#ifdef DBG_UTIL
- const SwRootFrm* pTmpRootFrm = pFmt->getIDocumentLayoutAccess()->GetRootFrm();
- if( pTmpRootFrm->GetCurrShell() )
+ const ViewShell* pTmpViewShell = pFmt->GetDoc()->GetCurrentViewShell();
+ if( pTmpViewShell )
{
- sal_Bool bT2 = pTmpRootFrm->GetCurrShell()->GetViewOptions()->IsTest2();
- sal_Bool bT6 = pTmpRootFrm->GetCurrShell()->GetViewOptions()->IsTest6();
+ sal_Bool bT2 = pTmpViewShell->GetViewOptions()->IsTest2();
+ sal_Bool bT6 = pTmpViewShell->GetViewOptions()->IsTest6();
if( bT2 || bT6 )
{
if( bT2 )
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 0861f98b2ddf..562682c73af3 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -41,6 +41,7 @@
#include <swmodule.hxx>
#include <SwSmartTagMgr.hxx>
#include <doc.hxx> // GetDoc()
+#include "rootfrm.hxx"
#include <pagefrm.hxx> // InvalidateSpelling
#include <rootfrm.hxx>
#include <viewsh.hxx> // ViewShell
@@ -353,8 +354,8 @@ void SwTxtFrm::InitCtor()
/*************************************************************************
* SwTxtFrm::SwTxtFrm()
*************************************************************************/
-SwTxtFrm::SwTxtFrm(SwTxtNode * const pNode)
- : SwCntntFrm(pNode)
+SwTxtFrm::SwTxtFrm(SwTxtNode * const pNode, SwFrm* pSib )
+ : SwCntntFrm( pNode, pSib )
{
InitCtor();
}
@@ -399,7 +400,7 @@ sal_Bool SwTxtFrm::IsHiddenNow() const
const bool bHiddenCharsHidePara = GetTxtNode()->HasHiddenCharAttribute( true );
const bool bHiddenParaField = GetTxtNode()->HasHiddenParaField();
- const ViewShell* pVsh = GetShell();
+ const ViewShell* pVsh = getRootFrm()->GetCurrShell();
if ( pVsh && ( bHiddenCharsHidePara || bHiddenParaField ) )
{
@@ -568,7 +569,7 @@ void SwTxtFrm::HideAndShowObjects()
// paragraph is visible, but can contain hidden text portion.
// first we check if objects are allowed to be hidden:
const SwTxtNode& rNode = *GetTxtNode();
- const ViewShell* pVsh = GetShell();
+ const ViewShell* pVsh = getRootFrm()->GetCurrShell();
const bool bShouldBeHidden = !pVsh || !pVsh->GetWin() ||
!pVsh->GetViewOptions()->IsShowHiddenChar();
@@ -860,7 +861,7 @@ void lcl_SetWrong( SwTxtFrm& rFrm, xub_StrLen nPos, long nCnt, bool bMove )
pTxtNode->SetSmartTagDirty( true );
}
- SwRootFrm *pRootFrm = rFrm.FindRootFrm();
+ SwRootFrm *pRootFrm = rFrm.getRootFrm();
if (pRootFrm)
{
pRootFrm->SetNeedGrammarCheck( TRUE );
@@ -913,7 +914,7 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if( IsInRange( aFrmFmtSetRange, nWhich ) || RES_FMT_CHG == nWhich )
{
SwCntntFrm::Modify( pOld, pNew );
- if( nWhich == RES_FMT_CHG && GetShell() )
+ if( nWhich == RES_FMT_CHG && getRootFrm()->GetCurrShell() )
{
// Collection hat sich geaendert
Prepare( PREP_CLEAR );
@@ -1028,9 +1029,10 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
}
// --> OD 2010-02-16 #i104008#
- if ( GetShell() )
+ ViewShell* pViewSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ if ( pViewSh )
{
- GetShell()->InvalidateAccessibleParaAttrs( *this );
+ pViewSh->InvalidateAccessibleParaAttrs( *this );
}
// <--
}
@@ -1238,7 +1240,7 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
if( nCount )
{
- if( GetShell() )
+ if( getRootFrm()->GetCurrShell() )
{
Prepare( PREP_CLEAR );
_InvalidatePrt();
@@ -1284,9 +1286,10 @@ void SwTxtFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew )
}
// --> OD 2009-01-06 #i88069#
- if ( GetShell() )
+ ViewShell* pViewSh = getRootFrm() ? getRootFrm()->GetCurrShell() : 0;
+ if ( pViewSh )
{
- GetShell()->InvalidateAccessibleParaAttrs( *this );
+ pViewSh->InvalidateAccessibleParaAttrs( *this );
}
// <--
}
@@ -2269,7 +2272,7 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
const SwTwips mnOldHeightOfLastLine( mnHeightOfLastLine );
// <--
// determine output device
- ViewShell* pVsh = GetShell();
+ ViewShell* pVsh = getRootFrm()->GetCurrShell();
ASSERT( pVsh, "<SwTxtFrm::_GetHeightOfLastLineForPropLineSpacing()> - no ViewShell" );
// --> OD 2007-07-02 #i78921# - make code robust, according to provided patch
// There could be no <ViewShell> instance in the case of loading a binary
@@ -2280,7 +2283,7 @@ void SwTxtFrm::_CalcHeightOfLastLine( const bool _bUseFont )
}
OutputDevice* pOut = pVsh->GetOut();
const IDocumentSettingAccess* pIDSA = GetTxtNode()->getIDocumentSettingAccess();
- if ( !pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) ||
+ if ( !pVsh->GetViewOptions()->getBrowseMode() ||
pVsh->GetViewOptions()->IsPrtFormat() )
{
pOut = GetTxtNode()->getIDocumentDeviceAccess()->getReferenceDevice( true );
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 2b655847ad05..74fa31f9237e 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -30,6 +30,7 @@
#include "viewsh.hxx"
#include "doc.hxx"
#include "pagefrm.hxx"
+#include "rootfrm.hxx"
#include "ndtxt.hxx"
#include "txtatr.hxx"
#include <SwPortionHandler.hxx>
@@ -692,7 +693,7 @@ void SwTxtFrm::ConnectFtn( SwTxtFtn *pFtn, const SwTwips nDeadLine )
{
if( !pSrcFrm )
{
- SwFtnFrm *pNew = new SwFtnFrm(pDoc->GetDfltFrmFmt(),this,pFtn);
+ SwFtnFrm *pNew = new SwFtnFrm(pDoc->GetDfltFrmFmt(),this,this,pFtn);
SwNodeIndex aIdx( *pFtn->GetStartNode(), 1 );
::_InsertCnt( pNew, pDoc, aIdx.GetIndex() );
GetNode()->getIDocumentLayoutAccess()->GetLayouter()->CollectEndnote( pNew );
@@ -757,7 +758,7 @@ void SwTxtFrm::ConnectFtn( SwTxtFtn *pFtn, const SwTwips nDeadLine )
pBoss->RearrangeFtns( nDeadLine, sal_False, pFtn );
ValidateBodyFrm();
ValidateFrm();
- ViewShell *pSh = GetShell();
+ ViewShell *pSh = getRootFrm()->GetCurrShell();
if ( pSh && nHeight == (pCont->Frm().*fnRect->fnGetHeight)() )
//Damit uns nix durch die Lappen geht.
pSh->InvalidateWindows( pCont->Frm() );
diff --git a/sw/source/core/text/txtio.cxx b/sw/source/core/text/txtio.cxx
index b1996905935f..f3b75e57f25e 100644
--- a/sw/source/core/text/txtio.cxx
+++ b/sw/source/core/text/txtio.cxx
@@ -39,6 +39,7 @@
#include "errhdl.hxx"
#include "txtcfg.hxx"
#include "txtfrm.hxx" // IsDbg()
+#include "rootfrm.hxx"
#include "flyfrms.hxx"
#include "inftxt.hxx"
#include "porexp.hxx"
@@ -286,8 +287,8 @@ SvStream &operator<<( SvStream &rOs, const SwpHints & ) //$ ostream
sal_Bool IsDbg( const SwTxtFrm *pFrm )
{
- if( pFrm && pFrm->GetShell() )
- return pFrm->GetShell()->GetViewOptions()->IsTest4();
+ if( pFrm && pFrm->getRootFrm()->GetCurrShell() )
+ return pFrm->getRootFrm()->GetCurrShell()->GetViewOptions()->IsTest4();
else
return sal_False;
}
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 5cfffeaf5229..ab4b0c5f7f94 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -183,7 +183,7 @@ SwTOXSortTabBase::SwTOXSortTabBase( TOXSortType nTyp, const SwCntntNode* pNd,
{
// dann die "Anker" (Body) Position holen.
Point aPt;
- const SwCntntFrm* pFrm = pNd->GetFrm( &aPt, 0, FALSE );
+ const SwCntntFrm* pFrm = pNd->getLayoutFrm( pNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE );
if( pFrm )
{
SwPosition aPos( *pNd );
diff --git a/sw/source/core/txtnode/SwGrammarContact.cxx b/sw/source/core/txtnode/SwGrammarContact.cxx
index 5a444161a702..966a3d6f0225 100644
--- a/sw/source/core/txtnode/SwGrammarContact.cxx
+++ b/sw/source/core/txtnode/SwGrammarContact.cxx
@@ -205,7 +205,7 @@ void repaintTextFrames( SwModify& rModify )
pFrm; pFrm = (const SwTxtFrm*)aIter.Next() )
{
SwRect aRec( pFrm->PaintArea() );
- const SwRootFrm *pRootFrm = pFrm->FindRootFrm();
+ const SwRootFrm *pRootFrm = pFrm->getRootFrm();
ViewShell *pCurShell = pRootFrm ? pRootFrm->GetCurrShell() : NULL;
if( pCurShell )
pCurShell->InvalidateWindows( aRec );
diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index 02da2c32be8a..c00a284f4109 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -272,8 +272,9 @@ SwFlyInCntFrm *SwTxtFlyCnt::_GetFlyFrm( const SwFrm *pCurrFrm )
// Dabei wird eine sofortige Neuformatierung von pCurrFrm angestossen.
// Die Rekursion wird durch den Lockmechanismus in SwTxtFrm::Format()
// abgewuergt.
- SwFlyInCntFrm *pFly = new SwFlyInCntFrm( (SwFlyFrmFmt*)pFrmFmt, (SwFrm*)pCurrFrm );
- ((SwFrm*)pCurrFrm)->AppendFly( pFly );
+ SwFrm* pCurrFrame = const_cast< SwFrm* >(pCurrFrm);
+ SwFlyInCntFrm *pFly = new SwFlyInCntFrm( (SwFlyFrmFmt*)pFrmFmt, pCurrFrame, pCurrFrame );
+ pCurrFrame->AppendFly( pFly );
pFly->RegistFlys();
// 7922: Wir muessen dafuer sorgen, dass der Inhalt des FlyInCnt
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 7d6b8959787b..41d5a1618e5e 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -92,7 +92,7 @@ void SwFmtFtn::SetEndNote( bool b )
{
if ( GetTxtFtn() )
{
- GetTxtFtn()->DelFrms();
+ GetTxtFtn()->DelFrms(0);
}
m_bEndNote = b;
}
@@ -238,7 +238,7 @@ void SwTxtFtn::SetStartNode( const SwNodeIndex *pNewNode, BOOL bDelNode )
// Werden die Nodes nicht geloescht mussen sie bei den Seiten
// abmeldet (Frms loeschen) werden, denn sonst bleiben sie
// stehen (Undo loescht sie nicht!)
- DelFrms();
+ DelFrms( 0 );
}
DELETEZ( m_pStartNode );
@@ -356,19 +356,22 @@ void SwTxtFtn::MakeNewTextSection( SwNodes& rNodes )
}
-void SwTxtFtn::DelFrms()
+void SwTxtFtn::DelFrms( const SwFrm* pSib )
{
// delete the FtnFrames from the pages
ASSERT( m_pTxtNode, "SwTxtFtn: where is my TxtNode?" );
if ( !m_pTxtNode )
return;
+ const SwRootFrm* pRoot = pSib ? pSib->getRootFrm() : 0;
BOOL bFrmFnd = FALSE;
{
SwClientIter aIter( *m_pTxtNode );
for( SwCntntFrm* pFnd = (SwCntntFrm*)aIter.First( TYPE( SwCntntFrm ));
pFnd; pFnd = (SwCntntFrm*)aIter.Next() )
{
+ if( pRoot != pFnd->getRootFrm() && pRoot )
+ continue;
SwPageFrm* pPage = pFnd->FindPageFrm();
if( pPage )
{
@@ -389,6 +392,8 @@ void SwTxtFtn::DelFrms()
for( SwCntntFrm* pFnd = (SwCntntFrm*)aIter.First( TYPE( SwCntntFrm ));
pFnd; pFnd = (SwCntntFrm*)aIter.Next() )
{
+ if( pRoot != pFnd->getRootFrm() && pRoot )
+ continue;
SwPageFrm* pPage = pFnd->FindPageFrm();
SwFrm *pFrm = pFnd->GetUpper();
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index ff79d2266ba7..96989f2df2ae 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -417,7 +417,7 @@ USHORT SwFntObj::GetFontLeading( const ViewShell *pSh, const OutputDevice& rOut
const IDocumentSettingAccess& rIDSA = *pSh->getIDocumentSettingAccess();
const bool bBrowse = ( pSh->GetWin() &&
- rIDSA.get(IDocumentSettingAccess::BROWSE_MODE) &&
+ pSh->GetViewOptions()->getBrowseMode() &&
!pSh->GetViewOptions()->IsPrtFormat() );
if ( !bBrowse && rIDSA.get(IDocumentSettingAccess::ADD_EXT_LEADING) )
@@ -459,7 +459,7 @@ void SwFntObj::CreateScrFont( const ViewShell& rSh, const OutputDevice& rOut )
OutputDevice* pPrt = &rSh.GetRefDev();
if( !rSh.GetWin() ||
- !rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ||
+ !rSh.GetViewOptions()->getBrowseMode() ||
rSh.GetViewOptions()->IsPrtFormat() )
{
// After CreatePrtFont pPrtFont is the font which is actually used
@@ -832,13 +832,12 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
OutputDevice& rRefDev = rInf.GetShell()->GetRefDev();
OutputDevice* pWin = rInf.GetShell()->GetWin();
- const IDocumentSettingAccess* pIDSA = rInf.GetShell()->getIDocumentSettingAccess();
// true if pOut is the printer and the printer has been used for formatting
const BOOL bPrt = OUTDEV_PRINTER == rInf.GetOut().GetOutDevType() &&
OUTDEV_PRINTER == rRefDev.GetOutDevType();
const BOOL bBrowse = ( pWin &&
- pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ rInf.GetShell()->GetViewOptions()->getBrowseMode() &&
!rInf.GetShell()->GetViewOptions()->IsPrtFormat() &&
!rInf.GetBullet() &&
( rInf.GetSpace() || !rInf.GetKern() ) &&
@@ -876,7 +875,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
const BOOL bNoAdjust = bPrt ||
( pWin &&
- pIDSA->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ rInf.GetShell()->GetViewOptions()->getBrowseMode() &&
!rInf.GetShell()->GetViewOptions()->IsPrtFormat() );
if ( OUTDEV_PRINTER == rInf.GetOut().GetOutDevType() )
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 798d7e41602f..6523559d8708 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -148,7 +148,7 @@ SwTxtNode *SwNodes::MakeTxtNode( const SwNodeIndex & rWhere,
//Wenn es noch kein Layout gibt oder in einer versteckten Section
// stehen, brauchen wir uns um das MakeFrms nicht bemuehen.
const SwSectionNode* pSectNd;
- if( !GetDoc()->GetRootFrm() ||
+ if( !GetDoc()->GetCurrentViewShell() || //swmod 071108//swmod 071225
( 0 != (pSectNd = pNode->FindSectionNode()) &&
pSectNd->GetSection().IsHiddenFlag() ))
return pNode;
@@ -300,9 +300,9 @@ SwTxtNode::~SwTxtNode()
InitSwParaStatistics( false );
}
-SwCntntFrm *SwTxtNode::MakeFrm()
+SwCntntFrm *SwTxtNode::MakeFrm( SwFrm* pSib )
{
- SwCntntFrm *pFrm = new SwTxtFrm(this);
+ SwCntntFrm *pFrm = new SwTxtFrm( this, pSib );
return pFrm;
}
@@ -320,7 +320,7 @@ xub_StrLen SwTxtNode::Len() const
void lcl_ChangeFtnRef( SwTxtNode &rNode )
{
SwpHints *pSwpHints = rNode.GetpSwpHints();
- if( pSwpHints && rNode.GetDoc()->GetRootFrm() )
+ if( pSwpHints && rNode.GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
SwTxtAttr* pHt;
SwCntntFrm* pFrm = NULL;
@@ -353,7 +353,7 @@ void lcl_ChangeFtnRef( SwTxtNode &rNode )
SwCntntFrm* pCntnt = (SwCntntFrm*)aIter.First(TYPE(SwCntntFrm));
if( pCntnt )
{
- ASSERT( pCntnt->FindRootFrm() == pFrm->FindRootFrm(),
+ ASSERT( pCntnt->getRootFrm() == pFrm->getRootFrm(),
"lcl_ChangeFtnRef: Layout double?" );
SwFtnFrm *pFtn = pCntnt->FindFtnFrm();
if( pFtn && pFtn->GetAttr() == pAttr )
@@ -538,13 +538,13 @@ SwCntntNode *SwTxtNode::SplitCntntNode( const SwPosition &rPos )
UnlockModify(); // Benachrichtigungen wieder freischalten
- const SwRootFrm * const pRootFrm = pNode->GetDoc()->GetRootFrm();
// If there is an accessible layout we must call modify even
// with length zero, because we have to notify about the changed
// text node.
+ const SwRootFrm *pRootFrm;
if ( (nTxtLen != nSplitPos) ||
- ( pRootFrm && pRootFrm->IsAnyShellAccessible() ) )
-
+ ( (pRootFrm = pNode->GetDoc()->GetCurrentLayout()) != 0 &&
+ pRootFrm->IsAnyShellAccessible() ) ) //swmod 080218
{
// dann sage den Frames noch, das am Ende etwas "geloescht" wurde
if( 1 == nTxtLen - nSplitPos )
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 944eb70b2c3d..9614cfc27b91 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1469,7 +1469,7 @@ BOOL SwTxtNode::Hyphenate( SwInterHyphInfo &rHyphInf )
if( pLinguNode != this )
{
pLinguNode = this;
- pLinguFrm = (SwTxtFrm*)GetFrm( (Point*)(rHyphInf.GetCrsrPos()) );
+ pLinguFrm = (SwTxtFrm*)getLayoutFrm( GetDoc()->GetCurrentLayout(), (Point*)(rHyphInf.GetCrsrPos()) );
}
SwTxtFrm *pFrm = pLinguFrm;
if( pFrm )
diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx
index 6df9f9aa24b8..6848f1b13644 100644
--- a/sw/source/core/undo/rolbck.cxx
+++ b/sw/source/core/undo/rolbck.cxx
@@ -949,7 +949,7 @@ void SwHistoryChangeFlyAnchor::SetInDoc( SwDoc* pDoc, bool )
aTmp.SetAnchor( &aPos );
// so the Layout does not get confused
- if ( !pCNd || !pCNd->GetFrm( 0, 0, FALSE ) )
+ if ( !pCNd || !pCNd->getLayoutFrm( pDoc->GetCurrentLayout(), 0, 0, FALSE ) )
{
m_rFmt.DelFrms();
}
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index e3b54c59b142..a4e5ded47f07 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -520,7 +520,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter )
aNewAnchor.SetPageNum( rAnchor.GetPageNum() );
Point aDrawSavePt, aDrawOldPt;
- if( pDoc->GetRootFrm() )
+ if( pDoc->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
if( RES_DRAWFRMFMT == pFrmFmt->Which() )
{
diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx
index a0ba635549ac..3d38407a9e56 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -338,8 +338,7 @@ void SwUndoInsLayFmt::Repeat( SwUndoIter& rUndoIter )
}
else if (FLY_AT_PAGE == aAnchor.GetAnchorId())
{
- aAnchor.SetPageNum( pDoc->GetRootFrm()->GetCurrPage(
- rUndoIter.pAktPam ));
+ aAnchor.SetPageNum( pDoc->GetCurrentLayout()->GetCurrPage( rUndoIter.pAktPam ));
}
else {
ASSERT( FALSE, "was fuer ein Anker ist es denn nun?" );
diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx
index 980496cfd518..4b9505797c57 100644
--- a/sw/source/core/undo/undraw.cxx
+++ b/sw/source/core/undo/undraw.cxx
@@ -32,6 +32,7 @@
#include <rtl/memory.h>
#include <hintids.hxx>
+#include <rtl/string.h>
#include <svx/svdogrp.hxx>
#include <svx/svdundo.hxx>
#include <svx/svdpage.hxx>
@@ -80,7 +81,7 @@ IMPL_LINK( SwDoc, AddDrawUndo, SdrUndoAction *, pUndo )
{
ClearRedo();
const SdrMarkList* pMarkList = 0;
- ViewShell* pSh = GetRootFrm() ? GetRootFrm()->GetCurrShell() : 0;
+ ViewShell* pSh = GetCurrentViewShell() ? GetCurrentViewShell() : 0; //swmod 071108//swmod 071225
if( pSh && pSh->HasDrawView() )
pMarkList = &pSh->GetDrawView()->GetMarkedObjectList();
diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx
index 646ffbd4c8f2..bf485ad62153 100644
--- a/sw/source/core/undo/unins.cxx
+++ b/sw/source/core/undo/unins.cxx
@@ -1057,7 +1057,7 @@ void SwUndoInsertLabel::Repeat( SwUndoIter& rIter )
case LTYPE_OBJECT:
{
SwFlyFrm* pFly;
- SwCntntFrm *pCnt = pCNd->GetFrm();
+ SwCntntFrm *pCnt = pCNd->getLayoutFrm( rDoc.GetCurrentLayout() );
if( pCnt && 0 != ( pFly = pCnt->FindFlyFrm() ) )
nIdx = pFly->GetFmt()->GetCntnt().GetCntntIdx()->GetIndex();
}
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index 92a33da130fe..0379f9bdc82d 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -782,7 +782,7 @@ void getNumberingProperty(SwPaM& rPam, PropertyState& eState, Any * pAny )
* --------------------------------------------------*/
void GetCurPageStyle(SwPaM& rPaM, String &rString)
{
- const SwPageFrm* pPage = rPaM.GetCntntNode()->GetFrm()->FindPageFrm();
+ const SwPageFrm* pPage = rPaM.GetCntntNode()->getLayoutFrm(rPaM.GetDoc()->GetCurrentLayout())->FindPageFrm();
if(pPage)
SwStyleNameMapper::FillProgName( pPage->GetPageDesc()->GetName(), rString, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, sal_True );
}
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 8ae8f948900f..80ee39740c01 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -789,11 +789,11 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape)
else
throw uno::RuntimeException();
}
- else if ((aAnchor.GetAnchorId() != FLY_AT_PAGE) && pDoc->GetRootFrm())
+ else if ((aAnchor.GetAnchorId() != FLY_AT_PAGE) && pDoc->GetCurrentLayout())
{
SwCrsrMoveState aState( MV_SETONLYTEXT );
Point aTmp(MM100_TO_TWIP(aMM100Pos.X), MM100_TO_TWIP(aMM100Pos.Y));
- pDoc->GetRootFrm()->GetCrsrOfst( pPam->GetPoint(), aTmp, &aState );
+ pDoc->GetCurrentLayout()->GetCrsrOfst( pPam->GetPoint(), aTmp, &aState ); //swmod 080218
aAnchor.SetAnchor( pPam->GetPoint() );
// --> OD 2004-08-18 #i32349# - adjustment of vertical positioning
@@ -1346,7 +1346,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
pFmt->SetPositionLayoutDir( nPositionLayoutDir );
}
// <--
- else if( pDoc->GetRootFrm() )
+ else if( pDoc->GetCurrentLayout()) //swmod 080218
{
UnoActionContext aCtx(pDoc);
if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == pEntry->nMemberId)
@@ -1411,11 +1411,11 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
//if the fly has been anchored at page then it needs to be connected
//to the content position
SwPaM aPam(pDoc->GetNodes().GetEndOfContent());
- if( pDoc->GetRootFrm() )
+ if( pDoc->GetCurrentLayout() )
{
SwCrsrMoveState aState( MV_SETONLYTEXT );
Point aTmp( pObj->GetSnapRect().TopLeft() );
- pDoc->GetRootFrm()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState );
+ pDoc->GetCurrentLayout()->GetCrsrOfst( aPam.GetPoint(), aTmp, &aState );
}
else
{
@@ -1530,7 +1530,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
aKeepedPosition = getPosition();
}
// <--
- if( pFmt && pFmt->GetDoc()->GetRootFrm() )
+ if( pFmt && pFmt->GetDoc()->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
UnoActionContext aCtx(pFmt->GetDoc());
xPrSet->setPropertyValue(rPropertyName, aValue);
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx
index 2923b4e46317..f349cbb40027 100644
--- a/sw/source/core/unocore/unoflatpara.cxx
+++ b/sw/source/core/unocore/unoflatpara.cxx
@@ -388,7 +388,7 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara()
if ( !pCurrentPage && !pStopPage )
{
pStopPage = pStartPage;
- pCurrentPage = static_cast<SwPageFrm*>(mpDoc->GetRootFrm()->Lower());
+ pCurrentPage = static_cast<SwPageFrm*>(pViewShell->GetLayout()->Lower());
}
}
}
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index d9334e97c841..355857385903 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -212,9 +212,9 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx,
? FLY_AT_CHAR : FLY_AT_PARA);
const SwCntntFrm* pCFrm;
const SwCntntNode* pCNd;
- if( pDoc->GetRootFrm() &&
+ if( pDoc->GetCurrentViewShell() && //swmod 071108//swmod 071225
0 != (pCNd = rIdx.GetNode().GetCntntNode()) &&
- 0 != (pCFrm = pCNd->GetFrm()) )
+ 0 != (pCFrm = pCNd->getLayoutFrm( pDoc->GetCurrentLayout())) )
{
const SwSortedObjs *pObjs = pCFrm->GetDrawObjs();
if( pObjs )
@@ -272,7 +272,7 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx,
UnoActionContext::UnoActionContext(SwDoc *const pDoc)
: m_pDoc(pDoc)
{
- SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm();
+ SwRootFrm *const pRootFrm = m_pDoc->GetCurrentLayout();
if (pRootFrm)
{
pRootFrm->StartAllAction();
@@ -287,7 +287,7 @@ UnoActionContext::~UnoActionContext()
// Doc may already have been removed here
if (m_pDoc)
{
- SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm();
+ SwRootFrm *const pRootFrm = m_pDoc->GetCurrentLayout();
if (pRootFrm)
{
pRootFrm->EndAllAction();
@@ -301,7 +301,7 @@ UnoActionContext::~UnoActionContext()
UnoActionRemoveContext::UnoActionRemoveContext(SwDoc *const pDoc)
: m_pDoc(pDoc)
{
- SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm();
+ SwRootFrm *const pRootFrm = m_pDoc->GetCurrentLayout();
if (pRootFrm)
{
pRootFrm->UnoRemoveAllActions();
@@ -313,7 +313,7 @@ UnoActionRemoveContext::UnoActionRemoveContext(SwDoc *const pDoc)
* --------------------------------------------------*/
UnoActionRemoveContext::~UnoActionRemoveContext()
{
- SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm();
+ SwRootFrm *const pRootFrm = m_pDoc->GetCurrentLayout();
if (pRootFrm)
{
pRootFrm->UnoRestoreAllActions();
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index 1aa7c91a4c69..79ee12778572 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -272,7 +272,7 @@ BOOL SwViewImp::IsDragPossible( const Point &rPoint )
SdrObject *pO = rMrkList.GetMark(rMrkList.GetMarkCount()-1)->GetMarkedSdrObj();
SwRect aRect;
- if( ::CalcClipRect( pO, aRect, FALSE ) )
+ if( pO && ::CalcClipRect( pO, aRect, FALSE ) )
{
SwRect aTmp;
::CalcClipRect( pO, aTmp, TRUE );
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index b2d91c48f598..4ae0462b95bd 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -69,7 +69,7 @@ void SwViewImp::Init( const SwViewOption *pNewOpt )
{
ASSERT( pDrawView, "SwViewImp::Init without DrawView" );
//Jetzt die PageView erzeugen wenn sie noch nicht existiert.
- SwRootFrm *pRoot = pSh->getIDocumentLayoutAccess()->GetRootFrm();
+ SwRootFrm *pRoot = pSh->GetLayout(); //swmod 071108//swmod 071225
if ( !pSdrPageView )
{
IDocumentDrawModelAccess* pIDDMA = pSh->getIDocumentDrawModelAccess();
@@ -383,7 +383,7 @@ Color SwViewImp::GetRetoucheColor() const
const ViewShell &rSh = *GetShell();
if ( rSh.GetWin() )
{
- if ( rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ if ( rSh.GetViewOptions()->getBrowseMode() &&
COL_TRANSPARENT != rSh.GetViewOptions()->GetRetoucheColor().GetColor() )
aRet = rSh.GetViewOptions()->GetRetoucheColor();
else if(rSh.GetViewOptions()->IsPagePreview() &&
@@ -413,10 +413,10 @@ void SwViewImp::UpdateAccessible()
// We require a layout and an XModel to be accessible.
IDocumentLayoutAccess* pIDLA = GetShell()->getIDocumentLayoutAccess();
Window *pWin = GetShell()->GetWin();
- ASSERT( pIDLA->GetRootFrm(), "no layout, no access" );
+ ASSERT( GetShell()->GetLayout(), "no layout, no access" ); //swmod 071108//swmod 071225
ASSERT( pWin, "no window, no access" );
- if( IsAccessible() && pIDLA->GetRootFrm() && pWin )
+ if( IsAccessible() && pIDLA->GetCurrentViewShell() && pWin ) //swmod 071108//swmod 071225
GetAccessibleMap().GetDocumentView();
}
diff --git a/sw/source/core/view/viewpg.cxx b/sw/source/core/view/viewpg.cxx
index fcb702a7112a..7f0da726a7c6 100644..100755
--- a/sw/source/core/view/viewpg.cxx
+++ b/sw/source/core/view/viewpg.cxx
@@ -90,7 +90,6 @@ void ViewShell::AdjustOptionsForPagePreview( const SwPrtOptions &_rPrintOptions
return;
}
-
// print brochure
// OD 05.05.2003 #i14016# - consider empty pages on calculation of the scaling
// for a page to be printed.
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 156447fda9da..49eb81e3f72e 100755
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -268,7 +268,7 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
if ( pRegion )
{
- SwRootFrm* pLayout = GetLayout();
+ SwRootFrm* pCurrentLayout = GetLayout();
Imp()->pRegion = NULL;
@@ -333,7 +333,7 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
pOut = pVout;
if ( bPaintsFromSystem )
PaintDesktop( aRect );
- pLayout->Paint( aRect );
+ pCurrentLayout->Paint( aRect );
pOld->DrawOutDev( aRect.Pos(), aRect.SSize(),
aRect.Pos(), aRect.SSize(), *pVout );
pOut = pOld;
@@ -354,7 +354,7 @@ void ViewShell::ImplEndAction( const BOOL bIdleEnd )
if ( bPaintsFromSystem )
PaintDesktop( aRect );
- pLayout->Paint( aRect );
+ pCurrentLayout->Paint( aRect );
// #i75172# end DrawingLayer paint
DLPostPaint2(true);
@@ -528,13 +528,14 @@ BOOL ViewShell::AddPaintRect( const SwRect & rRect )
ViewShell *pSh = this;
do
{
+ if( pSh->Imp() )
+ {
if ( pSh->IsPreView() && pSh->GetWin() )
-// pSh->GetWin()->Invalidate();
::RepaintPagePreview( pSh, rRect );
else
- bRet |= pSh->Imp()->AddPaintRect( rRect );
+ bRet |= pSh->Imp()->AddPaintRect( rRect );//swmod 080111
+ }
pSh = (ViewShell*)pSh->GetNext();
-
} while ( pSh != this );
return bRet;
}
@@ -586,7 +587,7 @@ void ViewShell::MakeVisible( const SwRect &rRect )
{
if( pWin )
{
- const SwFrm* pRoot = GetDoc()->GetRootFrm();
+ const SwFrm* pRoot = /*GetDoc()->GetCurrentViewShell()->*/GetLayout();
int nLoopCnt = 3;
long nOldH;
do{
@@ -594,7 +595,7 @@ void ViewShell::MakeVisible( const SwRect &rRect )
StartAction();
ScrollMDI( this, rRect, USHRT_MAX, USHRT_MAX );
EndAction();
- } while( nOldH != pRoot->Frm().Height() && nLoopCnt-- );
+ } while( nOldH != pRoot->Frm().Height() && nLoopCnt-- ); //swmod 071108//swmod 071225
}
#ifdef DBG_UTIL
else
@@ -1191,13 +1192,13 @@ void ViewShell::VisPortChgd( const SwRect &rRect)
const long nXDiff = aPrevArea.Left() - VisArea().Left();
const long nYDiff = aPrevArea.Top() - VisArea().Top();
- if( !nXDiff && !getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ if( !nXDiff && !GetViewOptions()->getBrowseMode() &&
(!Imp()->HasDrawView() || !Imp()->GetDrawView()->IsGridVisible() ) )
{
//Falls moeglich die Wiese nicht mit Scrollen.
//Also linke und rechte Kante des Scrollbereiches auf die
//Seiten begrenzen.
- const SwPageFrm *pPage = (SwPageFrm*)GetDoc()->GetRootFrm()->Lower();
+ const SwPageFrm *pPage = (SwPageFrm*)GetLayout()->Lower(); //swmod 071108//swmod 071225
if ( pPage->Frm().Top() > pOldPage->Frm().Top() )
pPage = (SwPageFrm*)pOldPage;
SwRect aBoth( VisArea() );
@@ -1667,7 +1668,7 @@ void ViewShell::PaintDesktop( const SwRect &rRect )
//Die Rechtecke neben den Seiten muessen wir leider auf jedenfall Painten,
//den diese werden spaeter beim VisPortChgd ausgespart.
BOOL bBorderOnly = FALSE;
- const SwRootFrm *pRoot = GetDoc()->GetRootFrm();
+ const SwRootFrm *pRoot = GetLayout();//swmod 080305
if ( rRect.Top() > pRoot->Frm().Bottom() )
{
const SwFrm *pPg = pRoot->Lower();
@@ -1675,7 +1676,7 @@ void ViewShell::PaintDesktop( const SwRect &rRect )
pPg = pPg->GetNext();
if ( !pPg || !pPg->Frm().IsOver( VisArea() ) )
bBorderOnly = TRUE;
- }
+ } //swmod 071108//swmod 071225
const bool bBookMode = GetViewOptions()->IsViewLayoutBookMode();
@@ -1689,7 +1690,7 @@ void ViewShell::PaintDesktop( const SwRect &rRect )
if ( bBorderOnly )
{
- const SwFrm *pPage = pRoot->Lower();
+ const SwFrm *pPage =pRoot->Lower(); //swmod 071108//swmod 071225
SwRect aLeft( rRect ), aRight( rRect );
while ( pPage )
{
@@ -2099,8 +2100,7 @@ sal_Int32 ViewShell::GetBrowseWidth() const
void ViewShell::CheckBrowseView( BOOL bBrowseChgd )
{
- if ( !bBrowseChgd &&
- !getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( !bBrowseChgd && !GetViewOptions()->getBrowseMode() )
return;
SET_CURR_SHELL( this );
@@ -2168,14 +2168,15 @@ void ViewShell::CheckBrowseView( BOOL bBrowseChgd )
SwRootFrm *ViewShell::GetLayout() const
{
- return GetDoc()->GetRootFrm();
+ return pLayout.get(); //swmod 080116
}
+/***********************************************************************/
OutputDevice& ViewShell::GetRefDev() const
{
OutputDevice* pTmpOut = 0;
if ( GetWin() &&
- getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ GetViewOptions()->getBrowseMode() &&
!GetViewOptions()->IsPrtFormat() )
pTmpOut = GetWin();
else if ( 0 != mpTmpRef )
@@ -2233,7 +2234,10 @@ void ViewShell::ApplyViewOptions( const SwViewOption &rOpt )
ImplApplyViewOptions( rOpt );
- //Einige Aenderungen muessen synchronisiert werden.
+ // swmod 080115
+ // With one layout per view it is not longer necessary
+ // to sync these "layout related" view options
+ // But as long as we have to disable "multiple layout"
pSh = (ViewShell*)this->GetNext();
while ( pSh != this )
{
@@ -2249,6 +2253,7 @@ void ViewShell::ApplyViewOptions( const SwViewOption &rOpt )
pSh->ImplApplyViewOptions( aOpt );
pSh = (ViewShell*)pSh->GetNext();
}
+ // End of disabled multiple window
pSh = this;
do
@@ -2313,12 +2318,17 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
// Wenn kein ReferenzDevice (Drucker) zum Formatieren benutzt wird,
// sondern der Bildschirm, muss bei Zoomfaktoraenderung neu formatiert
// werden.
- if( getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if( pOpt->getBrowseMode() )
bReformat = TRUE;
}
- if ( getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
- pOpt->IsPrtFormat() != rOpt.IsPrtFormat() )
+ bool bBrowseModeChanged = false;
+ if( pOpt->getBrowseMode() != rOpt.getBrowseMode() )
+ {
+ bBrowseModeChanged = true;
+ bReformat = TRUE;
+ }
+ else if( pOpt->getBrowseMode() && pOpt->IsPrtFormat() != rOpt.IsPrtFormat() )
bReformat = TRUE;
if ( HasDrawView() || rOpt.IsGridVisible() )
@@ -2362,6 +2372,15 @@ void ViewShell::ImplApplyViewOptions( const SwViewOption &rOpt )
pDoc->set(IDocumentSettingAccess::HTML_MODE, 0 != ::GetHtmlMode(pDoc->GetDocShell()));
+ if( bBrowseModeChanged )
+ {
+ // --> FME 2005-03-16 #i44963# Good occasion to check if page sizes in
+ // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import)
+ pDoc->CheckDefaultPageFmt();
+ // <--
+ CheckBrowseView( TRUE );
+ }
+
pMyWin->Invalidate();
if ( bReformat )
{
@@ -2452,8 +2471,7 @@ void ViewShell::SetPDFExportOption(sal_Bool bSet)
{
if( bSet != pOpt->IsPDFExport() )
{
- if( bSet &&
- getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if( bSet && pOpt->getBrowseMode() )
pOpt->SetPrtFormat( TRUE );
pOpt->SetPDFExport(bSet);
}
@@ -2524,13 +2542,11 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible > ViewShell::Create
{
uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc;
- SwDoc *pMyDoc = GetDoc();
-
// We require a layout and an XModel to be accessible.
- ASSERT( pMyDoc->GetRootFrm(), "no layout, no access" );
+ ASSERT( pLayout, "no layout, no access" );
ASSERT( GetWin(), "no window, no access" );
- if( pMyDoc->GetRootFrm() && GetWin() )
+ if( pDoc->GetCurrentViewShell() && GetWin() ) //swmod 071108
xAcc = Imp()->GetAccessibleMap().GetDocumentView();
return xAcc;
@@ -2543,18 +2559,18 @@ ViewShell::CreateAccessiblePreview()
"Can't create accessible preview for non-preview ViewShell" );
// We require a layout and an XModel to be accessible.
- ASSERT( pDoc->GetRootFrm(), "no layout, no access" );
+ ASSERT( pLayout, "no layout, no access" );
ASSERT( GetWin(), "no window, no access" );
// OD 15.01.2003 #103492# - add condition <IsPreView()>
- if ( IsPreView() && pDoc->GetRootFrm() && GetWin() )
+ if ( IsPreView() && GetLayout()&& GetWin() )
{
// OD 14.01.2003 #103492# - adjustment for new method signature
return Imp()->GetAccessibleMap().GetDocumentPreview(
PagePreviewLayout()->maPrevwPages,
GetWin()->GetMapMode().GetScaleX(),
- pDoc->GetRootFrm()->GetPageByPageNum( PagePreviewLayout()->mnSelectedPageNum ),
- PagePreviewLayout()->maWinSize );
+ GetLayout()->GetPageByPageNum( PagePreviewLayout()->mnSelectedPageNum ),
+ PagePreviewLayout()->maWinSize ); //swmod 080305
}
return NULL;
}
@@ -2650,6 +2666,30 @@ void ViewShell::SetCareWin( Window* pNew )
pCareWindow = pNew;
}
+sal_uInt16 ViewShell::GetPageCount() const
+{
+ return GetLayout() ? GetLayout()->GetPageNum() : 1;
+}
+
+const Size ViewShell::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const
+{
+ Size aSize;
+ const SwRootFrm* pTmpRoot = GetLayout();
+ if( pTmpRoot && nPageNum )
+ {
+ const SwPageFrm* pPage = static_cast<const SwPageFrm*>
+ (pTmpRoot->Lower());
+
+ while( --nPageNum && pPage->GetNext() )
+ pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
+
+ if( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() )
+ pPage = static_cast<const SwPageFrm*>( pPage->GetNext() );
+
+ aSize = pPage->Frm().SSize();
+ }
+ return aSize;
+}
// --> FME 2004-06-15 #i12836# enhanced pdf export
sal_Int32 ViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const SwRect& rRect ) const
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index adf37dd11f22..4f72891eefdb 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -112,7 +112,7 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
// --> FME 2005-01-21 #i41075#
// Only setup the printer if we need one:
const IDocumentSettingAccess* pIDSA = getIDocumentSettingAccess();
- const bool bBrowseMode = pIDSA->get(IDocumentSettingAccess::BROWSE_MODE);
+ const bool bBrowseMode = pOpt->getBrowseMode();
if( pPDFOut )
InitPrt( pPDFOut );
// <--
@@ -135,12 +135,20 @@ void ViewShell::Init( const SwViewOption *pNewOpt )
GetWin()->SetLineColor();
}
- //Layout erzeugen wenn es noch nicht vorhanden ist.
- SwRootFrm* pRoot = GetDoc()->GetRootFrm();
- if( !pRoot )
- GetDoc()->SetRootFrm( pRoot = new SwRootFrm( pDoc->GetDfltFrmFmt(), this ) );
-
- SizeChgNotify();
+ // Create a new layout, if there is no one available
+ if( !pLayout )
+ {
+ // Here's the code which disables the usage of "multiple" layouts at the moment
+ // If the problems with controls and groups objects are solved,
+ // this code can be removed...
+ ViewShell *pCurrShell = GetDoc()->GetCurrentViewShell();
+ if( pCurrShell )
+ pLayout = pCurrShell->pLayout;
+ // end of "disable multiple layouts"
+ if( !pLayout )
+ pLayout = SwRootFrmPtr(new SwRootFrm( pDoc->GetDfltFrmFmt(), this ));//swmod081016
+ }
+ SizeChgNotify(); //swmod 071108
// --> #i31958#
// XForms mode: initialize XForms mode, based on design mode (draw view)
@@ -276,9 +284,8 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
bPaintInProgress = bViewLocked = bInEndAction = bFrameView =
bEndActionByVirDev = FALSE;
bPreView = 0 !=( VSHELLFLAG_ISPREVIEW & nFlags );
- // OD 12.12.2002 #103492#
- if ( bPreView )
- pImp->InitPagePreviewLayout();
+ if( nFlags & VSHELLFLAG_SHARELAYOUT ) //swmod 080125
+ pLayout = rShell.pLayout;//swmod 080125
SET_CURR_SHELL( this );
@@ -289,6 +296,10 @@ ViewShell::ViewShell( ViewShell& rShell, Window *pWindow,
Init( rShell.GetViewOptions() ); //verstellt ggf. das Outdev (InitPrt())
pOut = pOutput;
+ // OD 12.12.2002 #103492#
+ if ( bPreView )
+ pImp->InitPagePreviewLayout();
+
((SwHiddenTxtFieldType*)pDoc->GetSysFldType( RES_HIDDENTXTFLD ))->
SetHiddenFlag( !pOpt->IsShowHiddenField() );
@@ -362,8 +373,8 @@ ViewShell::~ViewShell()
if( !pDoc->release() )
delete pDoc, pDoc = 0;
else
- pDoc->GetRootFrm()->ResetNewLayout();
- }
+ GetLayout()->ResetNewLayout();
+ }//swmod 080317
delete pOpt;
@@ -378,7 +389,12 @@ ViewShell::~ViewShell()
}
if ( pDoc )
+ {
GetLayout()->DeRegisterShell( this );
+ if(pDoc->GetCurrentViewShell()==this)
+ pDoc->SetCurrentViewShell( this->GetNext()!=this ?
+ (ViewShell*)this->GetNext() : NULL );
+ }
delete mpTmpRef;
delete pAccOptions;
@@ -386,7 +402,7 @@ ViewShell::~ViewShell()
BOOL ViewShell::HasDrawView() const
{
- return Imp()->HasDrawView();
+ return Imp() ? Imp()->HasDrawView() : 0;
}
void ViewShell::MakeDrawView()
diff --git a/sw/source/core/view/vprint.cxx b/sw/source/core/view/vprint.cxx
index e74fb21f720a..91a8353cedc6 100755
--- a/sw/source/core/view/vprint.cxx
+++ b/sw/source/core/view/vprint.cxx
@@ -340,13 +340,13 @@ void ViewShell::CalcPagesForPrint( USHORT nMax )
{
SET_CURR_SHELL( this );
- SwRootFrm* pLayout = GetLayout();
- // ULONG nStatMax = pLayout->GetPageNum();
+ SwRootFrm* pMyLayout = GetLayout();
+ // ULONG nStatMax = pMyLayout->GetPageNum();
- const SwFrm *pPage = pLayout->Lower();
- SwLayAction aAction( pLayout, Imp() );
+ const SwFrm *pPage = pMyLayout->Lower();
+ SwLayAction aAction( pMyLayout, Imp() );
- pLayout->StartAllAction();
+ pMyLayout->StartAllAction();
for ( USHORT i = 1; pPage && i <= nMax; pPage = pPage->GetNext(), ++i )
{
pPage->Calc();
@@ -364,7 +364,8 @@ void ViewShell::CalcPagesForPrint( USHORT nMax )
Imp()->SetFirstVisPageInvalid();
// SwPaintQueue::Repaint();
}
- pLayout->EndAllAction();
+
+ pMyLayout->EndAllAction();
}
/******************************************************************************/
@@ -402,7 +403,7 @@ SwDoc * ViewShell::CreatePrtDoc( SfxObjectShellRef &rDocShellRef)
SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr();
const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode();
- const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->GetFrm( 0, pShellTblCrsr->Start() ) : 0;
+ const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->getLayoutFrm( GetLayout(), 0, pShellTblCrsr->Start() ) : 0;
if( pCntntFrm )
{
SwRect aCharRect;
@@ -511,7 +512,7 @@ SwDoc * ViewShell::FillPrtDoc( SwDoc *pPrtDoc, const SfxPrinter* pPrt)
SwShellTableCrsr* pShellTblCrsr = pFESh->GetTableCrsr();
const SwCntntNode* pCntntNode = pShellTblCrsr->GetNode()->GetCntntNode();
- const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->GetFrm( 0, pShellTblCrsr->Start() ) : 0;
+ const SwCntntFrm *pCntntFrm = pCntntNode ? pCntntNode->getLayoutFrm( GetLayout(), 0, pShellTblCrsr->Start() ) : 0;
if( pCntntFrm )
{
SwRect aCharRect;
@@ -631,7 +632,7 @@ sal_Bool ViewShell::PrintOrPDFExport(
else
{
pOutDevDoc = GetDoc();
- pShell = new ViewShell( *this, 0, pOutDev );
+ pShell = new ViewShell( *this, 0, pOutDev, VSHELLFLAG_SHARELAYOUT );
}
SdrView *pDrawView = pShell->GetDrawView();
@@ -734,10 +735,10 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat
//eine, dann legen wir uns eine neue Sicht an, oder das Doc hat noch
//keine, dann erzeugen wir die erste Sicht.
ViewShell *pSh;
- if( pDoc->GetRootFrm() && pDoc->GetRootFrm()->GetCurrShell() )
- pSh = new ViewShell( *pDoc->GetRootFrm()->GetCurrShell(), 0, pOleOut );
- else
- pSh = new ViewShell( *pDoc, 0, pOpt, pOleOut );
+ if( pDoc->GetCurrentViewShell() )
+ pSh = new ViewShell( *pDoc->GetCurrentViewShell(), 0, pOleOut,VSHELLFLAG_SHARELAYOUT );//swmod 080129
+ else //swmod 071108//swmod 071225
+ pSh = new ViewShell( *pDoc, 0, pOpt, pOleOut);//swmod 080129
{
SET_CURR_SHELL( pSh );
@@ -747,11 +748,12 @@ void ViewShell::PrtOle2( SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintDat
SwRect aSwRect( rRect );
pSh->aVisArea = aSwRect;
- if ( pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ if ( pSh->GetViewOptions()->getBrowseMode() &&
pSh->GetNext() == pSh )
{
pSh->CheckBrowseView( FALSE );
- pDoc->GetRootFrm()->Lower()->InvalidateSize();
+ //pDoc->GetCurrentLayout()->Lower()->InvalidateSize(); //swmod 080218//?
+ pSh->GetLayout()->Lower()->InvalidateSize();
}
// --> FME 2005-02-10 #119474#