diff options
Diffstat (limited to 'sw/source/core/docnode/node.cxx')
-rw-r--r-- | sw/source/core/docnode/node.cxx | 326 |
1 files changed, 205 insertions, 121 deletions
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 767697208bfd..7c62f31f7eef 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -157,7 +157,7 @@ int Put( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, const SwCntntNode& rNo // --> FME 2007-4-12 #i76273# Robust: Save the style name items: SfxItemSet* pStyleNames = 0; - if ( SFX_ITEM_SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, FALSE ) ) + if ( SFX_ITEM_SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, sal_False ) ) { pStyleNames = new SfxItemSet( *aNewSet.GetPool(), RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME ); pStyleNames->Put( aNewSet ); @@ -207,7 +207,7 @@ int Put_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, // --> FME 2007-4-12 #i76273# Robust: Save the style name items: SfxItemSet* pStyleNames = 0; - if ( SFX_ITEM_SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, FALSE ) ) + if ( SFX_ITEM_SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, sal_False ) ) { pStyleNames = new SfxItemSet( *aNewSet.GetPool(), RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME ); pStyleNames->Put( aNewSet ); @@ -235,28 +235,28 @@ int Put_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, return nRet; } -USHORT ClearItem_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, - const SwCntntNode& rNode, USHORT nWhich, +sal_uInt16 ClearItem_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, + const SwCntntNode& rNode, sal_uInt16 nWhich, SwAttrSet* pOld, SwAttrSet* pNew ) { SwAttrSet aNewSet( (SwAttrSet&)*mrpAttrSet ); if( rNode.GetModifyAtAttr() ) aNewSet.SetModifyAtAttr( &rNode ); - const USHORT nRet = aNewSet.ClearItem_BC( nWhich, pOld, pNew ); + const sal_uInt16 nRet = aNewSet.ClearItem_BC( nWhich, pOld, pNew ); if ( nRet ) GetNewAutoStyle( mrpAttrSet, rNode, aNewSet ); return nRet; } -USHORT ClearItem_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, +sal_uInt16 ClearItem_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, const SwCntntNode& rNode, - USHORT nWhich1, USHORT nWhich2, + sal_uInt16 nWhich1, sal_uInt16 nWhich2, SwAttrSet* pOld, SwAttrSet* pNew ) { SwAttrSet aNewSet( (SwAttrSet&)*mrpAttrSet ); if( rNode.GetModifyAtAttr() ) aNewSet.SetModifyAtAttr( &rNode ); - const USHORT nRet = aNewSet.ClearItem_BC( nWhich1, nWhich2, pOld, pNew ); + const sal_uInt16 nRet = aNewSet.ClearItem_BC( nWhich1, nWhich2, pOld, pNew ); if ( nRet ) GetNewAutoStyle( mrpAttrSet, rNode, aNewSet ); return nRet; @@ -289,13 +289,13 @@ USHORT ClearItem_BC( boost::shared_ptr<const SfxItemSet>& mrpAttrSet, *******************************************************************/ -USHORT SwNode::GetSectionLevel() const +sal_uInt16 SwNode::GetSectionLevel() const { // EndNode einer Grund-Section ?? diese sind immer 0 !! if( IsEndNode() && 0 == pStartOfSection->StartOfSectionIndex() ) return 0; - USHORT nLevel; + sal_uInt16 nLevel; const SwNode* pNode = IsStartNode() ? this : pStartOfSection; for( nLevel = 1; 0 != pNode->StartOfSectionIndex(); ++nLevel ) pNode = pNode->pStartOfSection; @@ -334,10 +334,10 @@ USHORT SwNode::GetSectionLevel() const long SwNode::nSerial = 0; #endif -SwNode::SwNode( const SwNodeIndex &rWhere, const BYTE nNdType ) +SwNode::SwNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType ) : nNodeType( nNdType ), pStartOfSection( 0 ) { - bSetNumLSpace = bIgnoreDontExpand = FALSE; + bSetNumLSpace = bIgnoreDontExpand = sal_False; nAFmtNumLvl = 0; SwNodes& rNodes = (SwNodes&)rWhere.GetNodes(); @@ -368,10 +368,10 @@ SwNode::SwNode( const SwNodeIndex &rWhere, const BYTE nNdType ) #endif } -SwNode::SwNode( SwNodes& rNodes, ULONG nPos, const BYTE nNdType ) +SwNode::SwNode( SwNodes& rNodes, sal_uLong nPos, const sal_uInt8 nNdType ) : nNodeType( nNdType ), pStartOfSection( 0 ) { - bSetNumLSpace = bIgnoreDontExpand = FALSE; + bSetNumLSpace = bIgnoreDontExpand = sal_False; nAFmtNumLvl = 0; SwNode* pInsNd = this; // der MAC kann this nicht einfuegen !! @@ -425,9 +425,9 @@ SwTableNode* SwNode::FindTableNode() // liegt der Node im Sichtbarenbereich der Shell ? -BOOL SwNode::IsInVisibleArea( ViewShell* pSh ) const +sal_Bool SwNode::IsInVisibleArea( ViewShell* pSh ) const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; const SwCntntNode* pNd; if( ND_STARTNODE & nNodeType ) @@ -443,6 +443,12 @@ BOOL SwNode::IsInVisibleArea( ViewShell* pSh ) const else pNd = GetCntntNode(); +<<<<<<< local +======= + const SwFrm* pFrm; + if( pNd && 0 != ( pFrm = pNd->GetFrm( 0, 0, sal_False ) ) ) + { +>>>>>>> other if( !pSh ) // dann die Shell vom Doc besorgen: GetDoc()->GetEditShell( &pSh ); @@ -461,14 +467,14 @@ BOOL SwNode::IsInVisibleArea( ViewShell* pSh ) const } while ( pFrm && !pFrm->IsValid() ); if( !pFrm || pSh->VisArea().IsOver( pFrm->Frm() ) ) - bRet = TRUE; + bRet = sal_True; } } return bRet; } -BOOL SwNode::IsInProtectSect() const +sal_Bool SwNode::IsInProtectSect() const { const SwNode* pNd = ND_SECTIONNODE == nNodeType ? pStartOfSection : this; const SwSectionNode* pSectNd = pNd->FindSectionNode(); @@ -478,12 +484,12 @@ BOOL SwNode::IsInProtectSect() const // befindet sich der Node in irgendetwas geschuetzten ? // (Bereich/Rahmen/Tabellenzellen/... incl. des Ankers bei // Rahmen/Fussnoten/..) -BOOL SwNode::IsProtect() const +sal_Bool SwNode::IsProtect() const { const SwNode* pNd = ND_SECTIONNODE == nNodeType ? pStartOfSection : this; const SwStartNode* pSttNd = pNd->FindSectionNode(); if( pSttNd && ((SwSectionNode*)pSttNd)->GetSection().IsProtectFlag() ) - return TRUE; + return sal_True; if( 0 != ( pSttNd = FindTableBoxStartNode() ) ) { @@ -495,18 +501,18 @@ BOOL SwNode::IsProtect() const GetTblBox( pSttNd->GetIndex() ); //Robust #149568 if( pBox && pBox->GetFrmFmt()->GetProtect().IsCntntProtected() ) - return TRUE; + return sal_True; } SwFrmFmt* pFlyFmt = GetFlyFmt(); if( pFlyFmt ) { if( pFlyFmt->GetProtect().IsCntntProtected() ) - return TRUE; + return sal_True; const SwFmtAnchor& rAnchor = pFlyFmt->GetAnchor(); return rAnchor.GetCntntAnchor() ? rAnchor.GetCntntAnchor()->nNode.GetNode().IsProtect() - : FALSE; + : sal_False; } if( 0 != ( pSttNd = FindFootnoteStartNode() ) ) @@ -517,13 +523,13 @@ BOOL SwNode::IsProtect() const return pTFtn->GetTxtNode().IsProtect(); } - return FALSE; + return sal_False; } // suche den PageDesc, mit dem dieser Node formatiert ist. Wenn das // Layout vorhanden ist wird ueber das gesucht, ansonsten gibt es nur // die harte Tour ueber die Nodes nach vorne suchen!! -const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay, +const SwPageDesc* SwNode::FindPageDesc( sal_Bool bCalcLay, sal_uInt32* pPgDescNdIdx ) const { // OD 18.03.2003 #106329# @@ -581,7 +587,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay, // dann erstmal den richtigen Anker finden const SwFrmFmt* pFmt = 0; const SwSpzFrmFmts& rFmts = *pDoc->GetSpzFrmFmts(); - USHORT n; + sal_uInt16 n; for( n = 0; n < rFmts.Count(); ++n ) { @@ -635,7 +641,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay, if( n >= rFmts.Count() ) { ASSERT( !this, "Fly-Section aber kein Format gefunden" ); - return FALSE; + return sal_False; } } } @@ -658,7 +664,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay, 0 != ( pSttNd = pNd->FindFooterStartNode() )) { // dann in den PageDescs diesen StartNode suchen - USHORT nId; + sal_uInt16 nId; UseOnPage eAskUse; if( SwHeaderStartNode == pSttNd->GetStartNodeType()) { @@ -671,7 +677,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay, eAskUse = nsUseOnPage::PD_FOOTERSHARE; } - for( USHORT n = pDoc->GetPageDescCnt(); n && !pPgDesc; ) + for( sal_uInt16 n = pDoc->GetPageDescCnt(); n && !pPgDesc; ) { const SwPageDesc& rPgDsc = pDoc->GetPageDesc( --n ); const SwFrmFmt* pFmt = &rPgDsc.GetMaster(); @@ -706,7 +712,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay, // der Anker kann nur im Bodytext sein const SwTxtFtn* pTxtFtn; const SwFtnIdxs& rFtnArr = pDoc->GetFtnIdxs(); - for( USHORT n = 0; n < rFtnArr.Count(); ++n ) + for( sal_uInt16 n = 0; n < rFtnArr.Count(); ++n ) if( 0 != ( pTxtFtn = rFtnArr[ n ])->GetStartNode() && (SwNode*)pSttNd == &pTxtFtn->GetStartNode()->GetNode() ) @@ -789,7 +795,7 @@ SwFrmFmt* SwNode::GetFlyFmt() const { // dann gibts noch harten steinigen Weg uebers Dokument: const SwSpzFrmFmts& rFrmFmtTbl = *GetDoc()->GetSpzFrmFmts(); - for( USHORT n = 0; n < rFrmFmtTbl.Count(); ++n ) + for( sal_uInt16 n = 0; n < rFrmFmtTbl.Count(); ++n ) { SwFrmFmt* pFmt = rFrmFmtTbl[n]; const SwFmtCntnt& rCntnt = pFmt->GetCntnt(); @@ -828,21 +834,21 @@ SwStartNode* SwNode::FindSttNodeByType( SwStartNodeType eTyp ) return eTyp == pTmp->GetStartNodeType() ? pTmp : 0; } -const SwTxtNode* SwNode::FindOutlineNodeOfLevel( BYTE nLvl ) const +const SwTxtNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const { const SwTxtNode* pRet = 0; const SwOutlineNodes& rONds = GetNodes().GetOutLineNds(); if( MAXLEVEL > nLvl && rONds.Count() ) { - USHORT nPos; + sal_uInt16 nPos; SwNode* pNd = (SwNode*)this; - BOOL bCheckFirst = FALSE; + sal_Bool bCheckFirst = sal_False; if( !rONds.Seek_Entry( pNd, &nPos )) { if( nPos ) nPos = nPos-1; else - bCheckFirst = TRUE; + bCheckFirst = sal_True; } if( bCheckFirst ) @@ -855,8 +861,13 @@ const SwTxtNode* SwNode::FindOutlineNodeOfLevel( BYTE nLvl ) const const SwCntntNode* pCNd = GetCntntNode(); Point aPt( 0, 0 ); +<<<<<<< local const SwFrm* pFrm = pRet->getLayoutFrm( pRet->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ), * pMyFrm = pCNd ? pCNd->getLayoutFrm( pCNd->GetDoc()->GetCurrentLayout(), &aPt, 0, FALSE ) : 0; +======= + const SwFrm* pFrm = pRet->GetFrm( &aPt, 0, sal_False ), + * pMyFrm = pCNd ? pCNd->GetFrm( &aPt, 0, sal_False ) : 0; +>>>>>>> other const SwPageFrm* pPgFrm = pFrm ? pFrm->FindPageFrm() : 0; if( pPgFrm && pMyFrm && pPgFrm->Frm().Top() > pMyFrm->Frm().Top() ) @@ -889,11 +900,11 @@ inline sal_Bool IsValidNextPrevNd( const SwNode& rNd ) ND_TABLENODE == rNd.StartOfSectionNode()->GetNodeType() ); } -BYTE SwNode::HasPrevNextLayNode() const +sal_uInt8 SwNode::HasPrevNextLayNode() const { // assumption: <this> node is a node inside the document nodes array section. - BYTE nRet = 0; + sal_uInt8 nRet = 0; if( IsValidNextPrevNd( *this )) { SwNodeIndex aIdx( *this, -1 ); @@ -945,7 +956,7 @@ BYTE SwNode::HasPrevNextLayNode() const *******************************************************************/ -SwStartNode::SwStartNode( const SwNodeIndex &rWhere, const BYTE nNdType, +SwStartNode::SwStartNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType, SwStartNodeType eSttNd ) : SwNode( rWhere, nNdType ), eSttNdTyp( eSttNd ) { @@ -953,7 +964,7 @@ SwStartNode::SwStartNode( const SwNodeIndex &rWhere, const BYTE nNdType, pEndOfSection = (SwEndNode*)this; } -SwStartNode::SwStartNode( SwNodes& rNodes, ULONG nPos ) +SwStartNode::SwStartNode( SwNodes& rNodes, sal_uLong nPos ) : SwNode( rNodes, nPos, ND_STARTNODE ), eSttNdTyp( SwNormalStartNode ) { // erstmal temporaer, bis der EndNode eingefuegt wird. @@ -965,7 +976,7 @@ void SwStartNode::CheckSectionCondColl() const { //FEATURE::CONDCOLL SwNodeIndex aIdx( *this ); - ULONG nEndIdx = EndOfSectionIndex(); + sal_uLong nEndIdx = EndOfSectionIndex(); const SwNodes& rNds = GetNodes(); SwCntntNode* pCNd; while( 0 != ( pCNd = rNds.GoNext( &aIdx )) && pCNd->GetIndex() < nEndIdx ) @@ -1011,7 +1022,7 @@ SwEndNode::SwEndNode( const SwNodeIndex &rWhere, SwStartNode& rSttNd ) pStartOfSection->pEndOfSection = this; } -SwEndNode::SwEndNode( SwNodes& rNds, ULONG nPos, SwStartNode& rSttNd ) +SwEndNode::SwEndNode( SwNodes& rNds, sal_uLong nPos, SwStartNode& rSttNd ) : SwNode( rNds, nPos, ND_ENDNODE ) { pStartOfSection = &rSttNd; @@ -1025,7 +1036,7 @@ SwEndNode::SwEndNode( SwNodes& rNds, ULONG nPos, SwStartNode& rSttNd ) // -------------------- -SwCntntNode::SwCntntNode( const SwNodeIndex &rWhere, const BYTE nNdType, +SwCntntNode::SwCntntNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType, SwFmtColl *pColl ) : SwModify( pColl ), // CrsrsShell, FrameFmt, SwNode( rWhere, nNdType ), @@ -1055,7 +1066,7 @@ SwCntntNode::~SwCntntNode() void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) { - USHORT nWhich = pOldValue ? pOldValue->Which() : + sal_uInt16 nWhich = pOldValue ? pOldValue->Which() : pNewValue ? pNewValue->Which() : 0 ; switch( nWhich ) @@ -1112,7 +1123,7 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV if( GetNodes().IsDocNodes() && IsTxtNode() ) { if( SFX_ITEM_SET == ((SwAttrSetChg*)pOldValue)->GetChgSet()->GetItemState( - RES_CHRATR_HIDDEN, FALSE ) ) + RES_CHRATR_HIDDEN, sal_False ) ) { ((SwTxtNode*)this)->SetCalcHiddenCharFlags(); } @@ -1122,7 +1133,7 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV case RES_UPDATE_ATTR: if( GetNodes().IsDocNodes() && IsTxtNode() ) { - const USHORT nTmp = ((SwUpdateAttr*)pNewValue)->nWhichAttr; + const sal_uInt16 nTmp = ((SwUpdateAttr*)pNewValue)->nWhichAttr; if ( RES_ATTRSET_CHG == nTmp ) { // anybody wants to do some optimization here? @@ -1135,31 +1146,43 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV NotifyClients( pOldValue, pNewValue ); } -BOOL SwCntntNode::InvalidateNumRule() +sal_Bool SwCntntNode::InvalidateNumRule() { SwNumRule* pRule = 0; const SfxPoolItem* pItem; if( GetNodes().IsDocNodes() && - 0 != ( pItem = GetNoCondAttr( RES_PARATR_NUMRULE, TRUE )) && + 0 != ( pItem = GetNoCondAttr( RES_PARATR_NUMRULE, sal_True )) && ((SwNumRuleItem*)pItem)->GetValue().Len() && 0 != (pRule = GetDoc()->FindNumRulePtr( ((SwNumRuleItem*)pItem)->GetValue() ) ) ) { - pRule->SetInvalidRule( TRUE ); + pRule->SetInvalidRule( sal_True ); } return 0 != pRule; } +<<<<<<< local SwCntntFrm *SwCntntNode::getLayoutFrm( const SwRootFrm* _pRoot, const Point* pPoint, const SwPosition *pPos, const BOOL bCalcFrm ) const +======= + +SwCntntFrm *SwCntntNode::GetFrm( const Point* pPoint, + const SwPosition *pPos, + const sal_Bool bCalcFrm ) const +>>>>>>> other { return (SwCntntFrm*) ::GetFrmOfModify( _pRoot, *(SwModify*)this, FRM_CNTNT, pPoint, pPos, bCalcFrm ); } +<<<<<<< local SwRect SwCntntNode::FindLayoutRect( const BOOL bPrtArea, const Point* pPoint, const BOOL bCalcFrm ) const +======= +SwRect SwCntntNode::FindLayoutRect( const sal_Bool bPrtArea, const Point* pPoint, + const sal_Bool bCalcFrm ) const +>>>>>>> other { SwRect aRet; SwCntntFrm* pFrm = (SwCntntFrm*)::GetFrmOfModify( 0, *(SwModify*)this, @@ -1169,8 +1192,8 @@ SwRect SwCntntNode::FindLayoutRect( const BOOL bPrtArea, const Point* pPoint, return aRet; } -SwRect SwCntntNode::FindPageFrmRect( const BOOL bPrtArea, const Point* pPoint, - const BOOL bCalcFrm ) const +SwRect SwCntntNode::FindPageFrmRect( const sal_Bool bPrtArea, const Point* pPoint, + const sal_Bool bCalcFrm ) const { SwRect aRet; SwFrm* pFrm = ::GetFrmOfModify( 0, *(SwModify*)this, @@ -1201,7 +1224,7 @@ SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl ) //FEATURE::CONDCOLL // HACK: hier muss die entsprechend der neuen Vorlage die Bedingungen // neu ueberprueft werden! - if( TRUE /*pNewColl */ ) + if( sal_True /*pNewColl */ ) { SetCondFmtColl( 0 ); } @@ -1217,15 +1240,15 @@ SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl ) if ( IsInCache() ) { SwFrm::GetCache().Delete( this ); - SetInCache( FALSE ); + SetInCache( sal_False ); } return pOldColl; } -BOOL SwCntntNode::GoNext(SwIndex * pIdx, USHORT nMode ) const +sal_Bool SwCntntNode::GoNext(SwIndex * pIdx, sal_uInt16 nMode ) const { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( pIdx->GetIndex() < Len() ) { if( !IsTxtNode() ) @@ -1257,23 +1280,23 @@ BOOL SwCntntNode::GoNext(SwIndex * pIdx, USHORT nMode ) const if( 1 == nDone ) *pIdx = nPos; else - bRet = FALSE; + bRet = sal_False; } else if( nPos < rTNd.GetTxt().Len() ) (*pIdx)++; else - bRet = FALSE; + bRet = sal_False; } } else - bRet = FALSE; + bRet = sal_False; return bRet; } -BOOL SwCntntNode::GoPrevious(SwIndex * pIdx, USHORT nMode ) const +sal_Bool SwCntntNode::GoPrevious(SwIndex * pIdx, sal_uInt16 nMode ) const { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( pIdx->GetIndex() > 0 ) { if( !IsTxtNode() ) @@ -1305,16 +1328,16 @@ BOOL SwCntntNode::GoPrevious(SwIndex * pIdx, USHORT nMode ) const if( 1 == nDone ) *pIdx = nPos; else - bRet = FALSE; + bRet = sal_False; } else if( nPos ) (*pIdx)--; else - bRet = FALSE; + bRet = sal_False; } } else - bRet = FALSE; + bRet = sal_False; return bRet; } @@ -1377,7 +1400,64 @@ void SwCntntNode::DelFrms() if( !GetDepends() ) return; +<<<<<<< local SwCntntFrm::DelFrms(*this); +======= + SwClientIter aIter( *this ); + SwCntntFrm *pFrm; + + for( pFrm = (SwCntntFrm*)aIter.First( TYPE(SwCntntFrm)); pFrm; + pFrm = (SwCntntFrm*)aIter.Next() ) + { + // --> OD 2005-12-01 #i27138# + // notify accessibility paragraphs objects about changed + // CONTENT_FLOWS_FROM/_TO relation. + // Relation CONTENT_FLOWS_FROM for current next paragraph will change + // and relation CONTENT_FLOWS_TO for current previous paragraph will change. + if ( pFrm->IsTxtFrm() ) + { + ViewShell* pViewShell( pFrm->GetShell() ); + if ( pViewShell && pViewShell->GetLayout() && + pViewShell->GetLayout()->IsAnyShellAccessible() ) + { + pViewShell->InvalidateAccessibleParaFlowRelation( + dynamic_cast<SwTxtFrm*>(pFrm->FindNextCnt( true )), + dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) ); + } + } + // <-- + if( pFrm->HasFollow() ) + pFrm->GetFollow()->_SetIsFollow( pFrm->IsFollow() ); + if( pFrm->IsFollow() ) + { + SwCntntFrm* pMaster = (SwTxtFrm*)pFrm->FindMaster(); + pMaster->SetFollow( pFrm->GetFollow() ); + pFrm->_SetIsFollow( sal_False ); + } + pFrm->SetFollow( 0 );//Damit er nicht auf dumme Gedanken kommt. + //Andernfalls kann es sein, dass ein Follow + //vor seinem Master zerstoert wird, der Master + //greift dann ueber den ungueltigen + //Follow-Pointer auf fremdes Memory zu. + //Die Kette darf hier zerknauscht werden, weil + //sowieso alle zerstoert werden. + if( pFrm->GetUpper() && pFrm->IsInFtn() && !pFrm->GetIndNext() && + !pFrm->GetIndPrev() ) + { + SwFtnFrm *pFtn = pFrm->FindFtnFrm(); + ASSERT( pFtn, "You promised a FtnFrm?" ); + SwCntntFrm* pCFrm; + if( !pFtn->GetFollow() && !pFtn->GetMaster() && + 0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() ) + { + ASSERT( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" ); + ((SwTxtFrm*)pCFrm->FindMaster())->Prepare( PREP_FTN_GONE ); + } + } + pFrm->Cut(); + delete pFrm; + } +>>>>>>> other if( IsTxtNode() ) { ((SwTxtNode*)this)->SetWrong( NULL ); @@ -1409,7 +1489,7 @@ SwCntntNode *SwCntntNode::JoinPrev() // erfrage vom Modify Informationen -BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const +sal_Bool SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const { switch( rInfo.Which() ) { @@ -1417,7 +1497,7 @@ BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const if( &GetNodes() == ((SwAutoFmtGetDocNode&)rInfo).pNodes ) { ((SwAutoFmtGetDocNode&)rInfo).pCntntNode = this; - return FALSE; + return sal_False; } break; // --> OD 2008-02-19 #refactorlists# @@ -1426,7 +1506,7 @@ BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const // if( IsTxtNode()) // { // SwTxtNode * pTxtNode = (SwTxtNode*)this; -// pItem = (SwNumRuleItem*)GetNoCondAttr(RES_PARATR_NUMRULE, TRUE ); +// pItem = (SwNumRuleItem*)GetNoCondAttr(RES_PARATR_NUMRULE, sal_True ); // if (0 != pItem && // pItem->GetValue().Len() && @@ -1437,20 +1517,20 @@ BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const // } // } -// return TRUE; +// return sal_True; // <-- case RES_FINDNEARESTNODE: if( ((SwFmtPageDesc&)GetAttr( RES_PAGEDESC )).GetPageDesc() ) ((SwFindNearestNode&)rInfo).CheckNode( *this ); - return TRUE; + return sal_True; case RES_CONTENT_VISIBLE: { ((SwPtrMsgPoolItem&)rInfo).pObject = SwIterator<SwFrm,SwCntntNode>::FirstElement(*this); } - return FALSE; + return sal_False; } return SwModify::GetInfo( rInfo ); @@ -1458,7 +1538,7 @@ BOOL SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const // setze ein Attribut -BOOL SwCntntNode::SetAttr(const SfxPoolItem& rAttr ) +sal_Bool SwCntntNode::SetAttr(const SfxPoolItem& rAttr ) { if( !GetpSwAttrSet() ) // lasse von den entsprechenden Nodes die NewAttrSet( GetDoc()->GetAttrPool() ); // AttrSets anlegen @@ -1468,10 +1548,10 @@ BOOL SwCntntNode::SetAttr(const SfxPoolItem& rAttr ) if ( IsInCache() ) { SwFrm::GetCache().Delete( this ); - SetInCache( FALSE ); + SetInCache( sal_False ); } - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; // wenn Modify gelockt ist, werden keine Modifies verschickt if( IsModifyLocked() || ( !GetDepends() && RES_PARATR_NUMRULE != rAttr.Which() )) @@ -1493,16 +1573,16 @@ BOOL SwCntntNode::SetAttr(const SfxPoolItem& rAttr ) } #include <svl/itemiter.hxx> -BOOL SwCntntNode::SetAttr( const SfxItemSet& rSet ) +sal_Bool SwCntntNode::SetAttr( const SfxItemSet& rSet ) { if ( IsInCache() ) { SwFrm::GetCache().Delete( this ); - SetInCache( FALSE ); + SetInCache( sal_False ); } const SfxPoolItem* pFnd = 0; - if( SFX_ITEM_SET == rSet.GetItemState( RES_AUTO_STYLE, FALSE, &pFnd ) ) + if( SFX_ITEM_SET == rSet.GetItemState( RES_AUTO_STYLE, sal_False, &pFnd ) ) { ASSERT( rSet.Count() == 1, "SetAutoStyle mixed with other attributes?!" ); const SwFmtAutoFmt* pTmp = static_cast<const SwFmtAutoFmt*>(pFnd); @@ -1531,24 +1611,24 @@ BOOL SwCntntNode::SetAttr( const SfxItemSet& rSet ) // the string is empty. const SfxPoolItem* pNameItem = 0; if ( 0 != GetCondFmtColl() || - SFX_ITEM_SET != mpAttrSet->GetItemState( RES_FRMATR_STYLE_NAME, FALSE, &pNameItem ) || + SFX_ITEM_SET != mpAttrSet->GetItemState( RES_FRMATR_STYLE_NAME, sal_False, &pNameItem ) || 0 == static_cast<const SfxStringItem*>(pNameItem)->GetValue().Len() ) AttrSetHandleHelper::SetParent( mpAttrSet, *this, &GetAnyFmtColl(), GetFmtColl() ); else const_cast<SfxItemSet*>(mpAttrSet.get())->SetParent( &GetFmtColl()->GetAttrSet() ); } - return TRUE; + return sal_True; } if( !GetpSwAttrSet() ) // lasse von den entsprechenden Nodes die NewAttrSet( GetDoc()->GetAttrPool() ); // AttrSets anlegen - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; // wenn Modify gelockt ist, werden keine Modifies verschickt if ( IsModifyLocked() || ( !GetDepends() && - SFX_ITEM_SET != rSet.GetItemState( RES_PARATR_NUMRULE, FALSE ) ) ) + SFX_ITEM_SET != rSet.GetItemState( RES_PARATR_NUMRULE, sal_False ) ) ) { // einige Sonderbehandlungen fuer Attribute bRet = 0 != AttrSetHandleHelper::Put( mpAttrSet, *this, rSet ); @@ -1571,24 +1651,24 @@ BOOL SwCntntNode::SetAttr( const SfxItemSet& rSet ) // Nimmt den Hint mit nWhich aus dem Delta-Array -BOOL SwCntntNode::ResetAttr( USHORT nWhich1, USHORT nWhich2 ) +sal_Bool SwCntntNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) { if( !GetpSwAttrSet() ) - return FALSE; + return sal_False; if ( IsInCache() ) { SwFrm::GetCache().Delete( this ); - SetInCache( FALSE ); + SetInCache( sal_False ); } // wenn Modify gelockt ist, werden keine Modifies verschickt if( IsModifyLocked() ) { - USHORT nDel = 0; + sal_uInt16 nDel = 0; if ( !nWhich2 || nWhich2 < nWhich1 ) { - std::vector<USHORT> aClearWhichIds; + std::vector<sal_uInt16> aClearWhichIds; aClearWhichIds.push_back( nWhich1 ); nDel = ClearItemsFromAttrSet( aClearWhichIds ); } @@ -1606,7 +1686,7 @@ BOOL SwCntntNode::ResetAttr( USHORT nWhich1, USHORT nWhich2 ) SwAttrSet aOld( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ), aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ); - BOOL bRet = 0 != AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, nWhich1, nWhich2, &aOld, &aNew ); + sal_Bool bRet = 0 != AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, nWhich1, nWhich2, &aOld, &aNew ); if( bRet ) { @@ -1619,23 +1699,23 @@ BOOL SwCntntNode::ResetAttr( USHORT nWhich1, USHORT nWhich2 ) } return bRet; } -BOOL SwCntntNode::ResetAttr( const SvUShorts& rWhichArr ) +sal_Bool SwCntntNode::ResetAttr( const SvUShorts& rWhichArr ) { if( !GetpSwAttrSet() ) - return FALSE; + return sal_False; if ( IsInCache() ) { SwFrm::GetCache().Delete( this ); - SetInCache( FALSE ); + SetInCache( sal_False ); } // wenn Modify gelockt ist, werden keine Modifies verschickt - USHORT nDel = 0; + sal_uInt16 nDel = 0; if( IsModifyLocked() ) { - std::vector<USHORT> aClearWhichIds; - for( USHORT n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n ) + std::vector<sal_uInt16> aClearWhichIds; + for( sal_uInt16 n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n ) aClearWhichIds.push_back( rWhichArr[ n ] ); nDel = ClearItemsFromAttrSet( aClearWhichIds ); @@ -1645,7 +1725,7 @@ BOOL SwCntntNode::ResetAttr( const SvUShorts& rWhichArr ) SwAttrSet aOld( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ), aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ); - for( USHORT n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n ) + for( sal_uInt16 n = 0, nEnd = rWhichArr.Count(); n < nEnd; ++n ) if( AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, rWhichArr[ n ], &aOld, &aNew )) ++nDel; @@ -1662,7 +1742,7 @@ BOOL SwCntntNode::ResetAttr( const SvUShorts& rWhichArr ) } -USHORT SwCntntNode::ResetAllAttr() +sal_uInt16 SwCntntNode::ResetAllAttr() { if( !GetpSwAttrSet() ) return 0; @@ -1670,15 +1750,15 @@ USHORT SwCntntNode::ResetAllAttr() if ( IsInCache() ) { SwFrm::GetCache().Delete( this ); - SetInCache( FALSE ); + SetInCache( sal_False ); } // wenn Modify gelockt ist, werden keine Modifies verschickt if( IsModifyLocked() ) { - std::vector<USHORT> aClearWhichIds; + std::vector<sal_uInt16> aClearWhichIds; aClearWhichIds.push_back(0); - USHORT nDel = ClearItemsFromAttrSet( aClearWhichIds ); + sal_uInt16 nDel = ClearItemsFromAttrSet( aClearWhichIds ); if( !GetpSwAttrSet()->Count() ) // leer, dann loeschen mpAttrSet.reset(); // DELETEZ( mpAttrSet ); return nDel; @@ -1686,7 +1766,7 @@ USHORT SwCntntNode::ResetAllAttr() SwAttrSet aOld( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ), aNew( *GetpSwAttrSet()->GetPool(), GetpSwAttrSet()->GetRanges() ); - BOOL bRet = 0 != AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, 0, &aOld, &aNew ); + sal_Bool bRet = 0 != AttrSetHandleHelper::ClearItem_BC( mpAttrSet, *this, 0, &aOld, &aNew ); if( bRet ) { @@ -1701,28 +1781,28 @@ USHORT SwCntntNode::ResetAllAttr() } -BOOL SwCntntNode::GetAttr( SfxItemSet& rSet, BOOL bInParent ) const +sal_Bool SwCntntNode::GetAttr( SfxItemSet& rSet, sal_Bool bInParent ) const { if( rSet.Count() ) rSet.ClearItem(); const SwAttrSet& rAttrSet = GetSwAttrSet(); if( bInParent ) - return rSet.Set( rAttrSet, TRUE ) ? TRUE : FALSE; + return rSet.Set( rAttrSet, sal_True ) ? sal_True : sal_False; rSet.Put( rAttrSet ); - return rSet.Count() ? TRUE : FALSE; + return rSet.Count() ? sal_True : sal_False; } -USHORT SwCntntNode::ClearItemsFromAttrSet( const std::vector<USHORT>& rWhichIds ) +sal_uInt16 SwCntntNode::ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rWhichIds ) { - USHORT nRet = 0; + sal_uInt16 nRet = 0; if ( 0 == rWhichIds.size() ) return nRet; ASSERT( GetpSwAttrSet(), "no item set" ) SwAttrSet aNewAttrSet( *GetpSwAttrSet() ); - for ( std::vector<USHORT>::const_iterator aIter = rWhichIds.begin(); + for ( std::vector<sal_uInt16>::const_iterator aIter = rWhichIds.begin(); aIter != rWhichIds.end(); ++aIter ) { @@ -1734,14 +1814,14 @@ USHORT SwCntntNode::ClearItemsFromAttrSet( const std::vector<USHORT>& rWhichIds return nRet; } -const SfxPoolItem* SwCntntNode::GetNoCondAttr( USHORT nWhich, - BOOL bInParents ) const +const SfxPoolItem* SwCntntNode::GetNoCondAttr( sal_uInt16 nWhich, + sal_Bool bInParents ) const { const SfxPoolItem* pFnd = 0; if( pCondColl && pCondColl->GetRegisteredIn() ) { if( !GetpSwAttrSet() || ( SFX_ITEM_SET != GetpSwAttrSet()->GetItemState( - nWhich, FALSE, &pFnd ) && bInParents )) + nWhich, sal_False, &pFnd ) && bInParents )) ((SwFmt*)GetRegisteredIn())->GetItemState( nWhich, bInParents, &pFnd ); } // --> OD 2005-10-25 #126347# - undo change of issue #i51029# @@ -1761,7 +1841,7 @@ const SfxPoolItem* SwCntntNode::GetNoCondAttr( USHORT nWhich, int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const { const SwNodes& rNds = GetNodes(); - BYTE nNdType = GetNodeType(); + sal_uInt8 nNdType = GetNodeType(); SwNodeIndex aIdx( *this, 1 ); const SwNode* pNd = this; @@ -1771,7 +1851,7 @@ int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const aIdx++; if( pNd->GetNodeType() != nNdType || rNds.Count()-1 == aIdx.GetIndex() ) - return FALSE; + return sal_False; if( IsTxtNode() ) { // Do not merge strings if the result exceeds the allowed string length const SwTxtNode* pTxtNd = static_cast<const SwTxtNode*>(this); @@ -1779,11 +1859,11 @@ int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const pTxtNd = static_cast<const SwTxtNode*>(pNd); nSum += pTxtNd->GetTxt().Len(); if( nSum > STRING_LEN ) - return FALSE; + return sal_False; } if( pIdx ) *pIdx = aIdx; - return TRUE; + return sal_True; } @@ -1791,7 +1871,7 @@ int SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const // in pIdx kann die 2. Position returnt werden. int SwCntntNode::CanJoinPrev( SwNodeIndex* pIdx ) const { - BYTE nNdType = GetNodeType(); + sal_uInt8 nNdType = GetNodeType(); SwNodeIndex aIdx( *this, -1 ); const SwNode* pNd = this; @@ -1801,10 +1881,10 @@ int SwCntntNode::CanJoinPrev( SwNodeIndex* pIdx ) const aIdx--; if( pNd->GetNodeType() != nNdType || 0 == aIdx.GetIndex() ) - return FALSE; + return sal_False; if( pIdx ) *pIdx = aIdx; - return TRUE; + return sal_True; } @@ -1837,13 +1917,13 @@ void SwCntntNode::SetCondFmtColl( SwFmtColl* pColl ) if( IsInCache() ) { SwFrm::GetCache().Delete( this ); - SetInCache( FALSE ); + SetInCache( sal_False ); } } } -BOOL SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const +sal_Bool SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const { const SwNodes& rNds = GetNodes(); { @@ -1878,7 +1958,7 @@ BOOL SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const const SwTxtFtn* pTxtFtn; const SwNode* pSrchNd = pSttNd; - for( USHORT n = 0; n < rFtnArr.Count(); ++n ) + for( sal_uInt16 n = 0; n < rFtnArr.Count(); ++n ) if( 0 != ( pTxtFtn = rFtnArr[ n ])->GetStartNode() && pSrchNd == &pTxtFtn->GetStartNode()->GetNode() ) { @@ -1897,7 +1977,7 @@ BOOL SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const if( nCond ) { rTmp.SetCondition( (Master_CollConditions)nCond, 0 ); - return TRUE; + return sal_True; } pSttNd = pSttNd->GetIndex() ? pSttNd->StartOfSectionNode() @@ -1906,7 +1986,7 @@ BOOL SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const } { - USHORT nPos; + sal_uInt16 nPos; const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds(); if( rOutlNds.Count() ) { @@ -1920,13 +2000,13 @@ BOOL SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const if( pOutlNd->IsOutline()) { rTmp.SetCondition( PARA_IN_OUTLINE, pOutlNd->GetAttrOutlineLevel() - 1 ); - return TRUE; + return sal_True; } } } } - return FALSE; + return sal_False; } @@ -1986,7 +2066,11 @@ short SwCntntNode::GetTextDirection( const SwPosition& rPos, // --> OD 2007-01-10 #i72024# // No format of the frame, because this can cause recursive layout actions +<<<<<<< local SwFrm* pFrm = getLayoutFrm( GetDoc()->GetCurrentLayout(), &aPt, &rPos, FALSE ); +======= + SwFrm* pFrm = GetFrm( &aPt, &rPos, sal_False ); +>>>>>>> other // <-- if ( pFrm ) @@ -2069,10 +2153,10 @@ IDocumentListItems& SwNode::getIDocumentListItems() } // <-- -BOOL SwNode::IsInRedlines() const +sal_Bool SwNode::IsInRedlines() const { const SwDoc * pDoc = GetDoc(); - BOOL bResult = FALSE; + sal_Bool bResult = sal_False; if (pDoc != NULL) bResult = pDoc->IsInRedlines(*this); |