diff options
Diffstat (limited to 'sw/source/core/docnode')
-rw-r--r-- | sw/source/core/docnode/ndcopy.cxx | 190 | ||||
-rw-r--r-- | sw/source/core/docnode/ndnotxt.cxx | 86 | ||||
-rw-r--r-- | sw/source/core/docnode/ndnum.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/docnode/ndsect.cxx | 346 | ||||
-rw-r--r-- | sw/source/core/docnode/ndsect.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 1834 | ||||
-rw-r--r-- | sw/source/core/docnode/ndtbl1.cxx | 304 | ||||
-rw-r--r-- | sw/source/core/docnode/node.cxx | 482 | ||||
-rw-r--r-- | sw/source/core/docnode/node2lay.cxx | 40 | ||||
-rw-r--r-- | sw/source/core/docnode/nodes.cxx | 322 | ||||
-rw-r--r-- | sw/source/core/docnode/section.cxx | 292 | ||||
-rw-r--r-- | sw/source/core/docnode/swbaslnk.cxx | 76 |
12 files changed, 1997 insertions, 1997 deletions
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index 21dd4b9464ed..571407cacbe6 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -41,76 +41,76 @@ // Structure for the mapping from old and new frame formats to the // boxes and lines of a table -struct _MapTblFrmFmt +struct _MapTableFrameFormat { - const SwFrmFmt *pOld; - SwFrmFmt *pNew; - _MapTblFrmFmt( const SwFrmFmt *pOldFmt, SwFrmFmt*pNewFmt ) - : pOld( pOldFmt ), pNew( pNewFmt ) + const SwFrameFormat *pOld; + SwFrameFormat *pNew; + _MapTableFrameFormat( const SwFrameFormat *pOldFormat, SwFrameFormat*pNewFormat ) + : pOld( pOldFormat ), pNew( pNewFormat ) {} }; -typedef std::vector<_MapTblFrmFmt> _MapTblFrmFmts; +typedef std::vector<_MapTableFrameFormat> _MapTableFrameFormats; -SwCntntNode* SwTxtNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const +SwContentNode* SwTextNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const { // the Copy-Textnode is the Node with the Text, the Copy-Attrnode is the // node with the collection and hard attributes. Normally is the same // node, but if insert a glossary without formatting, then the Attrnode // is the prev node of the destionation position in dest. document. - SwTxtNode* pCpyTxtNd = const_cast<SwTxtNode*>(this); - SwTxtNode* pCpyAttrNd = pCpyTxtNd; + SwTextNode* pCpyTextNd = const_cast<SwTextNode*>(this); + SwTextNode* pCpyAttrNd = pCpyTextNd; // Copy the formats to the other document - SwTxtFmtColl* pColl = 0; + SwTextFormatColl* pColl = 0; if( pDoc->IsInsOnlyTextGlossary() ) { SwNodeIndex aIdx( rIdx, -1 ); - if( aIdx.GetNode().IsTxtNode() ) + if( aIdx.GetNode().IsTextNode() ) { - pCpyAttrNd = aIdx.GetNode().GetTxtNode(); - pColl = &pCpyAttrNd->GetTxtColl()->GetNextTxtFmtColl(); + pCpyAttrNd = aIdx.GetNode().GetTextNode(); + pColl = &pCpyAttrNd->GetTextColl()->GetNextTextFormatColl(); } } if( !pColl ) - pColl = pDoc->CopyTxtColl( *GetTxtColl() ); + pColl = pDoc->CopyTextColl( *GetTextColl() ); - SwTxtNode* pTxtNd = pDoc->GetNodes().MakeTxtNode( rIdx, pColl ); + SwTextNode* pTextNd = pDoc->GetNodes().MakeTextNode( rIdx, pColl ); // METADATA: register copy - pTxtNd->RegisterAsCopyOf(*pCpyTxtNd); + pTextNd->RegisterAsCopyOf(*pCpyTextNd); // Copy Attribute/Text if( !pCpyAttrNd->HasSwAttrSet() ) // An AttrSet was added for numbering, so delete it - pTxtNd->ResetAllAttr(); + pTextNd->ResetAllAttr(); // if Copy-Textnode unequal to Copy-Attrnode, then copy first // the attributes into the new Node. - if( pCpyAttrNd != pCpyTxtNd ) + if( pCpyAttrNd != pCpyTextNd ) { - pCpyAttrNd->CopyAttr( pTxtNd, 0, 0 ); + pCpyAttrNd->CopyAttr( pTextNd, 0, 0 ); if( pCpyAttrNd->HasSwAttrSet() ) { SwAttrSet aSet( *pCpyAttrNd->GetpSwAttrSet() ); aSet.ClearItem( RES_PAGEDESC ); aSet.ClearItem( RES_BREAK ); - aSet.CopyToModify( *pTxtNd ); + aSet.CopyToModify( *pTextNd ); } } // Is that enough? What about PostIts/Fields/FieldTypes? // #i96213# - force copy of all attributes - pCpyTxtNd->CopyText( pTxtNd, SwIndex( pCpyTxtNd ), - pCpyTxtNd->GetTxt().getLength(), true ); + pCpyTextNd->CopyText( pTextNd, SwIndex( pCpyTextNd ), + pCpyTextNd->GetText().getLength(), true ); if( RES_CONDTXTFMTCOLL == pColl->Which() ) - pTxtNd->ChkCondColl(); + pTextNd->ChkCondColl(); - return pTxtNd; + return pTextNd; } -static bool lcl_SrchNew( const _MapTblFrmFmt& rMap, SwFrmFmt** pPara ) +static bool lcl_SrchNew( const _MapTableFrameFormat& rMap, SwFrameFormat** pPara ) { if( rMap.pOld != *pPara ) return true; @@ -121,68 +121,68 @@ static bool lcl_SrchNew( const _MapTblFrmFmt& rMap, SwFrmFmt** pPara ) struct _CopyTable { SwDoc* m_pDoc; - sal_uLong m_nOldTblSttIdx; - _MapTblFrmFmts& m_rMapArr; + sal_uLong m_nOldTableSttIdx; + _MapTableFrameFormats& m_rMapArr; SwTableLine* m_pInsLine; SwTableBox* m_pInsBox; - SwTableNode *m_pTblNd; + SwTableNode *m_pTableNd; const SwTable *m_pOldTable; - _CopyTable(SwDoc* pDc, _MapTblFrmFmts& rArr, sal_uLong nOldStt, - SwTableNode& rTblNd, const SwTable* pOldTable) - : m_pDoc(pDc), m_nOldTblSttIdx(nOldStt), m_rMapArr(rArr), - m_pInsLine(0), m_pInsBox(0), m_pTblNd(&rTblNd), m_pOldTable(pOldTable) + _CopyTable(SwDoc* pDc, _MapTableFrameFormats& rArr, sal_uLong nOldStt, + SwTableNode& rTableNd, const SwTable* pOldTable) + : m_pDoc(pDc), m_nOldTableSttIdx(nOldStt), m_rMapArr(rArr), + m_pInsLine(0), m_pInsBox(0), m_pTableNd(&rTableNd), m_pOldTable(pOldTable) {} }; -static void lcl_CopyTblLine( const SwTableLine* pLine, _CopyTable* pCT ); +static void lcl_CopyTableLine( const SwTableLine* pLine, _CopyTable* pCT ); -static void lcl_CopyTblBox( SwTableBox* pBox, _CopyTable* pCT ) +static void lcl_CopyTableBox( SwTableBox* pBox, _CopyTable* pCT ) { - SwTableBoxFmt * pBoxFmt = static_cast<SwTableBoxFmt*>(pBox->GetFrmFmt()); - for (_MapTblFrmFmts::const_iterator it = pCT->m_rMapArr.begin(); it != pCT->m_rMapArr.end(); ++it) - if ( !lcl_SrchNew( *it, reinterpret_cast<SwFrmFmt**>(&pBoxFmt) ) ) + SwTableBoxFormat * pBoxFormat = static_cast<SwTableBoxFormat*>(pBox->GetFrameFormat()); + for (_MapTableFrameFormats::const_iterator it = pCT->m_rMapArr.begin(); it != pCT->m_rMapArr.end(); ++it) + if ( !lcl_SrchNew( *it, reinterpret_cast<SwFrameFormat**>(&pBoxFormat) ) ) break; - if (pBoxFmt == pBox->GetFrmFmt()) // Create a new one? + if (pBoxFormat == pBox->GetFrameFormat()) // Create a new one? { const SfxPoolItem* pItem; - if( SfxItemState::SET == pBoxFmt->GetItemState( RES_BOXATR_FORMULA, false, - &pItem ) && static_cast<const SwTblBoxFormula*>(pItem)->IsIntrnlName() ) + if( SfxItemState::SET == pBoxFormat->GetItemState( RES_BOXATR_FORMULA, false, + &pItem ) && static_cast<const SwTableBoxFormula*>(pItem)->IsIntrnlName() ) { - const_cast<SwTblBoxFormula*>(static_cast<const SwTblBoxFormula*>(pItem))->PtrToBoxNm(pCT->m_pOldTable); + const_cast<SwTableBoxFormula*>(static_cast<const SwTableBoxFormula*>(pItem))->PtrToBoxNm(pCT->m_pOldTable); } - pBoxFmt = pCT->m_pDoc->MakeTableBoxFmt(); - pBoxFmt->CopyAttrs( *pBox->GetFrmFmt() ); + pBoxFormat = pCT->m_pDoc->MakeTableBoxFormat(); + pBoxFormat->CopyAttrs( *pBox->GetFrameFormat() ); if( pBox->GetSttIdx() ) { SvNumberFormatter* pN = pCT->m_pDoc->GetNumberFormatter(false); - if( pN && pN->HasMergeFmtTbl() && SfxItemState::SET == pBoxFmt-> + if( pN && pN->HasMergeFormatTable() && SfxItemState::SET == pBoxFormat-> GetItemState( RES_BOXATR_FORMAT, false, &pItem ) ) { - sal_uLong nOldIdx = static_cast<const SwTblBoxNumFormat*>(pItem)->GetValue(); - sal_uLong nNewIdx = pN->GetMergeFmtIndex( nOldIdx ); + sal_uLong nOldIdx = static_cast<const SwTableBoxNumFormat*>(pItem)->GetValue(); + sal_uLong nNewIdx = pN->GetMergeFormatIndex( nOldIdx ); if( nNewIdx != nOldIdx ) - pBoxFmt->SetFmtAttr( SwTblBoxNumFormat( nNewIdx )); + pBoxFormat->SetFormatAttr( SwTableBoxNumFormat( nNewIdx )); } } - pCT->m_rMapArr.push_back(_MapTblFrmFmt(pBox->GetFrmFmt(), pBoxFmt)); + pCT->m_rMapArr.push_back(_MapTableFrameFormat(pBox->GetFrameFormat(), pBoxFormat)); } sal_uInt16 nLines = pBox->GetTabLines().size(); SwTableBox* pNewBox; if( nLines ) - pNewBox = new SwTableBox(pBoxFmt, nLines, pCT->m_pInsLine); + pNewBox = new SwTableBox(pBoxFormat, nLines, pCT->m_pInsLine); else { - SwNodeIndex aNewIdx(*pCT->m_pTblNd, pBox->GetSttIdx() - pCT->m_nOldTblSttIdx); + SwNodeIndex aNewIdx(*pCT->m_pTableNd, pBox->GetSttIdx() - pCT->m_nOldTableSttIdx); OSL_ENSURE( aNewIdx.GetNode().IsStartNode(), "Index is not on the start node" ); - pNewBox = new SwTableBox(pBoxFmt, aNewIdx, pCT->m_pInsLine); + pNewBox = new SwTableBox(pBoxFormat, aNewIdx, pCT->m_pInsLine); pNewBox->setRowSpan( pBox->getRowSpan() ); } @@ -193,30 +193,30 @@ static void lcl_CopyTblBox( SwTableBox* pBox, _CopyTable* pCT ) _CopyTable aPara(*pCT); aPara.m_pInsBox = pNewBox; for( const SwTableLine* pLine : pBox->GetTabLines() ) - lcl_CopyTblLine( pLine, &aPara ); + lcl_CopyTableLine( pLine, &aPara ); } - else if (pNewBox->IsInHeadline(&pCT->m_pTblNd->GetTable())) + else if (pNewBox->IsInHeadline(&pCT->m_pTableNd->GetTable())) { // In the headline, the paragraphs must match conditional styles pNewBox->GetSttNd()->CheckSectionCondColl(); } } -static void lcl_CopyTblLine( const SwTableLine* pLine, _CopyTable* pCT ) +static void lcl_CopyTableLine( const SwTableLine* pLine, _CopyTable* pCT ) { - SwTableLineFmt * pLineFmt = static_cast<SwTableLineFmt*>(pLine->GetFrmFmt()); - for (_MapTblFrmFmts::const_iterator it = pCT->m_rMapArr.begin(); it != pCT->m_rMapArr.end(); ++it) - if ( !lcl_SrchNew( *it, reinterpret_cast<SwFrmFmt**>(&pLineFmt) ) ) + SwTableLineFormat * pLineFormat = static_cast<SwTableLineFormat*>(pLine->GetFrameFormat()); + for (_MapTableFrameFormats::const_iterator it = pCT->m_rMapArr.begin(); it != pCT->m_rMapArr.end(); ++it) + if ( !lcl_SrchNew( *it, reinterpret_cast<SwFrameFormat**>(&pLineFormat) ) ) break; - if( pLineFmt == pLine->GetFrmFmt() ) // Create a new one? + if( pLineFormat == pLine->GetFrameFormat() ) // Create a new one? { - pLineFmt = pCT->m_pDoc->MakeTableLineFmt(); - pLineFmt->CopyAttrs( *pLine->GetFrmFmt() ); - pCT->m_rMapArr.push_back(_MapTblFrmFmt(pLine->GetFrmFmt(), pLineFmt)); + pLineFormat = pCT->m_pDoc->MakeTableLineFormat(); + pLineFormat->CopyAttrs( *pLine->GetFrameFormat() ); + pCT->m_rMapArr.push_back(_MapTableFrameFormat(pLine->GetFrameFormat(), pLineFormat)); } - SwTableLine* pNewLine = new SwTableLine(pLineFmt, pLine->GetTabBoxes().size(), pCT->m_pInsBox); + SwTableLine* pNewLine = new SwTableLine(pLineFormat, pLine->GetTabBoxes().size(), pCT->m_pInsBox); // Insert the new row into the table if (pCT->m_pInsBox) { @@ -224,13 +224,13 @@ static void lcl_CopyTblLine( const SwTableLine* pLine, _CopyTable* pCT ) } else { - pCT->m_pTblNd->GetTable().GetTabLines().push_back(pNewLine); + pCT->m_pTableNd->GetTable().GetTabLines().push_back(pNewLine); } pCT->m_pInsLine = pNewLine; for( SwTableBoxes::iterator it = const_cast<SwTableLine*>(pLine)->GetTabBoxes().begin(); it != const_cast<SwTableLine*>(pLine)->GetTabBoxes().end(); ++it) - lcl_CopyTblBox(*it, pCT ); + lcl_CopyTableBox(*it, pCT ); } SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const @@ -244,47 +244,47 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const return 0; } - // Copy the TableFrmFmt - OUString sTblName( GetTable().GetFrmFmt()->GetName() ); + // Copy the TableFrameFormat + OUString sTableName( GetTable().GetFrameFormat()->GetName() ); if( !pDoc->IsCopyIsMove() ) { - const SwFrmFmts& rTblFmts = *pDoc->GetTblFrmFmts(); - for( size_t n = rTblFmts.size(); n; ) - if( rTblFmts[ --n ]->GetName() == sTblName ) + const SwFrameFormats& rTableFormats = *pDoc->GetTableFrameFormats(); + for( size_t n = rTableFormats.size(); n; ) + if( rTableFormats[ --n ]->GetName() == sTableName ) { - sTblName = pDoc->GetUniqueTblName(); + sTableName = pDoc->GetUniqueTableName(); break; } } - SwFrmFmt* pTblFmt = pDoc->MakeTblFrmFmt( sTblName, pDoc->GetDfltFrmFmt() ); - pTblFmt->CopyAttrs( *GetTable().GetFrmFmt() ); - SwTableNode* pTblNd = new SwTableNode( rIdx ); - SwEndNode* pEndNd = new SwEndNode( rIdx, *pTblNd ); + SwFrameFormat* pTableFormat = pDoc->MakeTableFrameFormat( sTableName, pDoc->GetDfltFrameFormat() ); + pTableFormat->CopyAttrs( *GetTable().GetFrameFormat() ); + SwTableNode* pTableNd = new SwTableNode( rIdx ); + SwEndNode* pEndNd = new SwEndNode( rIdx, *pTableNd ); SwNodeIndex aInsPos( *pEndNd ); - SwTable& rTbl = (SwTable&)pTblNd->GetTable(); - rTbl.RegisterToFormat( *pTblFmt ); + SwTable& rTable = (SwTable&)pTableNd->GetTable(); + rTable.RegisterToFormat( *pTableFormat ); - rTbl.SetRowsToRepeat( GetTable().GetRowsToRepeat() ); - rTbl.SetTblChgMode( GetTable().GetTblChgMode() ); - rTbl.SetTableModel( GetTable().IsNewModel() ); + rTable.SetRowsToRepeat( GetTable().GetRowsToRepeat() ); + rTable.SetTableChgMode( GetTable().GetTableChgMode() ); + rTable.SetTableModel( GetTable().IsNewModel() ); SwDDEFieldType* pDDEType = 0; if( IS_TYPE( SwDDETable, &GetTable() )) { // We're copying a DDE table // Is the field type available in the new document? - pDDEType = const_cast<SwDDETable&>(static_cast<const SwDDETable&>(GetTable())).GetDDEFldType(); + pDDEType = const_cast<SwDDETable&>(static_cast<const SwDDETable&>(GetTable())).GetDDEFieldType(); if( pDDEType->IsDeleted() ) - pDoc->getIDocumentFieldsAccess().InsDeletedFldType( *pDDEType ); + pDoc->getIDocumentFieldsAccess().InsDeletedFieldType( *pDDEType ); else - pDDEType = static_cast<SwDDEFieldType*>(pDoc->getIDocumentFieldsAccess().InsertFldType( *pDDEType )); + pDDEType = static_cast<SwDDEFieldType*>(pDoc->getIDocumentFieldsAccess().InsertFieldType( *pDDEType )); OSL_ENSURE( pDDEType, "unknown FieldType" ); // Swap the table pointers in the node - SwDDETable* pNewTable = new SwDDETable( pTblNd->GetTable(), pDDEType ); - pTblNd->SetNewTable( pNewTable, false ); + SwDDETable* pNewTable = new SwDDETable( pTableNd->GetTable(), pDDEType ); + pTableNd->SetNewTable( pNewTable, false ); } // First copy the content of the tables, we will later assign the // boxes/lines and create the frames @@ -295,36 +295,36 @@ SwTableNode* SwTableNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const // (see IsUsed). Therefore the inner table gets the same name as the outer table. // We have to make sure that the table node of the SwTable is accessible, even // without any content in m_TabSortContentBoxes. #i26629# - pTblNd->GetTable().SetTableNode( pTblNd ); + pTableNd->GetTable().SetTableNode( pTableNd ); rNds._Copy( aRg, aInsPos, false ); - pTblNd->GetTable().SetTableNode( 0 ); + pTableNd->GetTable().SetTableNode( 0 ); // Special case for a single box if( 1 == GetTable().GetTabSortBoxes().size() ) { - aRg.aStart.Assign( *pTblNd, 1 ); - aRg.aEnd.Assign( *pTblNd->EndOfSectionNode() ); + aRg.aStart.Assign( *pTableNd, 1 ); + aRg.aEnd.Assign( *pTableNd->EndOfSectionNode() ); pDoc->GetNodes().SectionDown( &aRg, SwTableBoxStartNode ); } // Delete all frames from the copied area, they will be created // during the generation of the table frame - pTblNd->DelFrms(); + pTableNd->DelFrms(); - _MapTblFrmFmts aMapArr; - _CopyTable aPara( pDoc, aMapArr, GetIndex(), *pTblNd, &GetTable() ); + _MapTableFrameFormats aMapArr; + _CopyTable aPara( pDoc, aMapArr, GetIndex(), *pTableNd, &GetTable() ); for( const SwTableLine* pLine : GetTable().GetTabLines() ) - lcl_CopyTblLine( pLine, &aPara ); + lcl_CopyTableLine( pLine, &aPara ); if( pDDEType ) pDDEType->IncRefCnt(); CHECK_TABLE( GetTable() ); - return pTblNd; + return pTableNd; } -void SwTxtNode::CopyCollFmt( SwTxtNode& rDestNd ) +void SwTextNode::CopyCollFormat( SwTextNode& rDestNd ) { // Copy the formats into the other document: // Special case for PageBreak/PageDesc/ColBrk @@ -343,7 +343,7 @@ void SwTxtNode::CopyCollFmt( SwTxtNode& rDestNd ) aPgBrkSet.Put( *pAttr ); } - rDestNd.ChgFmtColl( pDestDoc->CopyTxtColl( *GetTxtColl() )); + rDestNd.ChgFormatColl( pDestDoc->CopyTextColl( *GetTextColl() )); if( 0 != ( pSet = GetpSwAttrSet() ) ) pSet->CopyToModify( rDestNd ); diff --git a/sw/source/core/docnode/ndnotxt.cxx b/sw/source/core/docnode/ndnotxt.cxx index 4c6f414c45fe..4c891ce2bfaf 100644 --- a/sw/source/core/docnode/ndnotxt.cxx +++ b/sw/source/core/docnode/ndnotxt.cxx @@ -36,11 +36,11 @@ #include <frmfmt.hxx> -SwNoTxtNode::SwNoTxtNode( const SwNodeIndex & rWhere, +SwNoTextNode::SwNoTextNode( const SwNodeIndex & rWhere, const sal_uInt8 nNdType, - SwGrfFmtColl *pGrfColl, + SwGrfFormatColl *pGrfColl, SwAttrSet* pAutoAttr ) : - SwCntntNode( rWhere, nNdType, pGrfColl ), + SwContentNode( rWhere, nNdType, pGrfColl ), pContour( 0 ), bAutomaticContour( false ), bContourMapModeValid( true ), @@ -51,42 +51,42 @@ SwNoTxtNode::SwNoTxtNode( const SwNodeIndex & rWhere, SetAttr( *pAutoAttr ); } -SwNoTxtNode::~SwNoTxtNode() +SwNoTextNode::~SwNoTextNode() { delete pContour; } /// Creates an AttrSet for all derivations with ranges for frame- /// and graphics-attributes. -void SwNoTxtNode::NewAttrSet( SwAttrPool& rPool ) +void SwNoTextNode::NewAttrSet( SwAttrPool& rPool ) { OSL_ENSURE( !mpAttrSet.get(), "AttrSet is already set" ); - SwAttrSet aNewAttrSet( rPool, aNoTxtNodeSetRange ); + SwAttrSet aNewAttrSet( rPool, aNoTextNodeSetRange ); // put names of parent style and conditional style: - const SwFmtColl* pFmtColl = GetFmtColl(); + const SwFormatColl* pFormatColl = GetFormatColl(); OUString sVal; - SwStyleNameMapper::FillProgName( pFmtColl->GetName(), sVal, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true ); - SfxStringItem aFmtColl( RES_FRMATR_STYLE_NAME, sVal ); - aNewAttrSet.Put( aFmtColl ); + SwStyleNameMapper::FillProgName( pFormatColl->GetName(), sVal, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true ); + SfxStringItem aFormatColl( RES_FRMATR_STYLE_NAME, sVal ); + aNewAttrSet.Put( aFormatColl ); - aNewAttrSet.SetParent( &GetFmtColl()->GetAttrSet() ); + aNewAttrSet.SetParent( &GetFormatColl()->GetAttrSet() ); mpAttrSet = GetDoc()->GetIStyleAccess().getAutomaticStyle( aNewAttrSet, IStyleAccess::AUTO_STYLE_NOTXT ); } /// Dummies for loading/saving of persistent data /// when working with graphics and OLE objects -bool SwNoTxtNode::RestorePersistentData() +bool SwNoTextNode::RestorePersistentData() { return true; } -bool SwNoTxtNode::SavePersistentData() +bool SwNoTextNode::SavePersistentData() { return true; } -void SwNoTxtNode::SetContour( const tools::PolyPolygon *pPoly, bool bAutomatic ) +void SwNoTextNode::SetContour( const tools::PolyPolygon *pPoly, bool bAutomatic ) { delete pContour; if ( pPoly ) @@ -98,7 +98,7 @@ void SwNoTxtNode::SetContour( const tools::PolyPolygon *pPoly, bool bAutomatic ) bPixelContour = false; } -void SwNoTxtNode::CreateContour() +void SwNoTextNode::CreateContour() { OSL_ENSURE( !pContour, "Contour available." ); pContour = new tools::PolyPolygon(SvxContourDlg::CreateAutoContour(GetGraphic())); @@ -107,7 +107,7 @@ void SwNoTxtNode::CreateContour() bPixelContour = false; } -const tools::PolyPolygon *SwNoTxtNode::HasContour() const +const tools::PolyPolygon *SwNoTextNode::HasContour() const { if( !bContourMapModeValid ) { @@ -172,20 +172,20 @@ const tools::PolyPolygon *SwNoTxtNode::HasContour() const } } } - const_cast<SwNoTxtNode *>(this)->bContourMapModeValid = true; - const_cast<SwNoTxtNode *>(this)->bPixelContour = false; + const_cast<SwNoTextNode *>(this)->bContourMapModeValid = true; + const_cast<SwNoTextNode *>(this)->bPixelContour = false; } return pContour; } -void SwNoTxtNode::GetContour( tools::PolyPolygon &rPoly ) const +void SwNoTextNode::GetContour( tools::PolyPolygon &rPoly ) const { OSL_ENSURE( pContour, "Contour not available." ); rPoly = *HasContour(); } -void SwNoTxtNode::SetContourAPI( const tools::PolyPolygon *pPoly ) +void SwNoTextNode::SetContourAPI( const tools::PolyPolygon *pPoly ) { delete pContour; if ( pPoly ) @@ -195,7 +195,7 @@ void SwNoTxtNode::SetContourAPI( const tools::PolyPolygon *pPoly ) bContourMapModeValid = false; } -bool SwNoTxtNode::GetContourAPI( tools::PolyPolygon &rContour ) const +bool SwNoTextNode::GetContourAPI( tools::PolyPolygon &rContour ) const { if( !pContour ) return false; @@ -231,7 +231,7 @@ bool SwNoTxtNode::GetContourAPI( tools::PolyPolygon &rContour ) const return true; } -bool SwNoTxtNode::IsPixelContour() const +bool SwNoTextNode::IsPixelContour() const { bool bRet; if( bContourMapModeValid ) @@ -247,7 +247,7 @@ bool SwNoTxtNode::IsPixelContour() const return bRet; } -Graphic SwNoTxtNode::GetGraphic() const +Graphic SwNoTextNode::GetGraphic() const { Graphic aRet; if ( GetGrfNode() ) @@ -263,53 +263,53 @@ Graphic SwNoTxtNode::GetGraphic() const } // #i73249# -void SwNoTxtNode::SetTitle( const OUString& rTitle, bool bBroadcast ) +void SwNoTextNode::SetTitle( const OUString& rTitle, bool bBroadcast ) { // Title attribute of <SdrObject> replaces own AlternateText attribute - SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(GetFlyFmt()); - OSL_ENSURE( pFlyFmt, "<SwNoTxtNode::SetTitle(..)> - missing <SwFlyFrmFmt> instance" ); - if ( !pFlyFmt ) + SwFlyFrameFormat* pFlyFormat = dynamic_cast<SwFlyFrameFormat*>(GetFlyFormat()); + OSL_ENSURE( pFlyFormat, "<SwNoTextNode::SetTitle(..)> - missing <SwFlyFrameFormat> instance" ); + if ( !pFlyFormat ) { return; } - pFlyFmt->SetObjTitle( rTitle, bBroadcast ); + pFlyFormat->SetObjTitle( rTitle, bBroadcast ); } -OUString SwNoTxtNode::GetTitle() const +OUString SwNoTextNode::GetTitle() const { - const SwFlyFrmFmt* pFlyFmt = dynamic_cast<const SwFlyFrmFmt*>(GetFlyFmt()); - OSL_ENSURE( pFlyFmt, "<SwNoTxtNode::GetTitle(..)> - missing <SwFlyFrmFmt> instance" ); - if ( !pFlyFmt ) + const SwFlyFrameFormat* pFlyFormat = dynamic_cast<const SwFlyFrameFormat*>(GetFlyFormat()); + OSL_ENSURE( pFlyFormat, "<SwNoTextNode::GetTitle(..)> - missing <SwFlyFrameFormat> instance" ); + if ( !pFlyFormat ) { return OUString(); } - return pFlyFmt->GetObjTitle(); + return pFlyFormat->GetObjTitle(); } -void SwNoTxtNode::SetDescription( const OUString& rDescription, bool bBroadcast ) +void SwNoTextNode::SetDescription( const OUString& rDescription, bool bBroadcast ) { - SwFlyFrmFmt* pFlyFmt = dynamic_cast<SwFlyFrmFmt*>(GetFlyFmt()); - OSL_ENSURE( pFlyFmt, "<SwNoTxtNode::SetDescription(..)> - missing <SwFlyFrmFmt> instance" ); - if ( !pFlyFmt ) + SwFlyFrameFormat* pFlyFormat = dynamic_cast<SwFlyFrameFormat*>(GetFlyFormat()); + OSL_ENSURE( pFlyFormat, "<SwNoTextNode::SetDescription(..)> - missing <SwFlyFrameFormat> instance" ); + if ( !pFlyFormat ) { return; } - pFlyFmt->SetObjDescription( rDescription, bBroadcast ); + pFlyFormat->SetObjDescription( rDescription, bBroadcast ); } -OUString SwNoTxtNode::GetDescription() const +OUString SwNoTextNode::GetDescription() const { - const SwFlyFrmFmt* pFlyFmt = dynamic_cast<const SwFlyFrmFmt*>(GetFlyFmt()); - OSL_ENSURE( pFlyFmt, "<SwNoTxtNode::GetDescription(..)> - missing <SwFlyFrmFmt> instance" ); - if ( !pFlyFmt ) + const SwFlyFrameFormat* pFlyFormat = dynamic_cast<const SwFlyFrameFormat*>(GetFlyFormat()); + OSL_ENSURE( pFlyFormat, "<SwNoTextNode::GetDescription(..)> - missing <SwFlyFrameFormat> instance" ); + if ( !pFlyFormat ) { return OUString(); } - return pFlyFmt->GetObjDescription(); + return pFlyFormat->GetObjDescription(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/docnode/ndnum.cxx b/sw/source/core/docnode/ndnum.cxx index 8c8a542d804f..b462f5c81d8a 100644 --- a/sw/source/core/docnode/ndnum.cxx +++ b/sw/source/core/docnode/ndnum.cxx @@ -39,20 +39,20 @@ bool SwOutlineNodes::Seek_Entry(SwNode* rP, sal_uInt16* pnPos) const void SwNodes::UpdateOutlineNode(SwNode & rNd) { - SwTxtNode * pTxtNd = rNd.GetTxtNode(); + SwTextNode * pTextNd = rNd.GetTextNode(); - if (pTxtNd && pTxtNd->IsOutlineStateChanged()) + if (pTextNd && pTextNd->IsOutlineStateChanged()) { - bool bFound = pOutlineNds->find(pTxtNd) != pOutlineNds->end(); + bool bFound = pOutlineNds->find(pTextNd) != pOutlineNds->end(); - if (pTxtNd->IsOutline()) + if (pTextNd->IsOutline()) { if (! bFound) { // assure that text is in the correct nodes array - if ( &(pTxtNd->GetNodes()) == this ) + if ( &(pTextNd->GetNodes()) == this ) { - pOutlineNds->insert(pTxtNd); + pOutlineNds->insert(pTextNd); } else { @@ -63,17 +63,17 @@ void SwNodes::UpdateOutlineNode(SwNode & rNd) else { if (bFound) - pOutlineNds->erase(pTxtNd); + pOutlineNds->erase(pTextNd); } - pTxtNd->UpdateOutlineState(); + pTextNd->UpdateOutlineState(); // update the structure fields - GetDoc()->getIDocumentFieldsAccess().GetSysFldType( RES_CHAPTERFLD )->UpdateFlds(); + GetDoc()->getIDocumentFieldsAccess().GetSysFieldType( RES_CHAPTERFLD )->UpdateFields(); } } -void SwNodes::UpdtOutlineIdx( const SwNode& rNd ) +void SwNodes::UpdateOutlineIdx( const SwNode& rNd ) { if( pOutlineNds->empty() ) // no OutlineNodes present ? return; diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 71b418df1e48..e100b39b965c 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -60,15 +60,15 @@ #include <ndsect.hxx> #include <tools/datetimeutils.hxx> -// #i21457# - new implementation of local method <lcl_IsInSameTblBox(..)>. +// #i21457# - new implementation of local method <lcl_IsInSameTableBox(..)>. // Method now determines the previous/next on its own. Thus, it can be controlled, // for which previous/next is checked, if it's visible. -static bool lcl_IsInSameTblBox( SwNodes& _rNds, +static bool lcl_IsInSameTableBox( SwNodes& _rNds, const SwNode& _rNd, const bool _bPrev ) { - const SwTableNode* pTblNd = _rNd.FindTableNode(); - if ( !pTblNd ) + const SwTableNode* pTableNd = _rNd.FindTableNode(); + if ( !pTableNd ) { return true; } @@ -87,13 +87,13 @@ static bool lcl_IsInSameTblBox( SwNodes& _rNds, ? !SwNodes::GoPrevSection( &aChkIdx, false, false ) : !_rNds.GoNextSection( &aChkIdx, false, false ) ) { - OSL_FAIL( "<lcl_IsInSameTblBox(..)> - no previous/next!" ); + OSL_FAIL( "<lcl_IsInSameTableBox(..)> - no previous/next!" ); return false; } else { - if ( aChkIdx < pTblNd->GetIndex() || - aChkIdx > pTblNd->EndOfSectionNode()->GetIndex() ) + if ( aChkIdx < pTableNd->GetIndex() || + aChkIdx > pTableNd->EndOfSectionNode()->GetIndex() ) { return false; } @@ -103,7 +103,7 @@ static bool lcl_IsInSameTblBox( SwNodes& _rNds, // is also inside the table. SwSectionNode* pSectNd = aChkIdx.GetNode().FindSectionNode(); if ( !pSectNd || - pSectNd->GetIndex() < pTblNd->GetIndex() || + pSectNd->GetIndex() < pTableNd->GetIndex() || !pSectNd->GetSection().IsHiddenFlag() ) { bFound = true; @@ -114,7 +114,7 @@ static bool lcl_IsInSameTblBox( SwNodes& _rNds, } // Find the Box's StartNode - const SwTableSortBoxes& rSortBoxes = pTblNd->GetTable().GetTabSortBoxes(); + const SwTableSortBoxes& rSortBoxes = pTableNd->GetTable().GetTabSortBoxes(); sal_uLong nIdx = _rNd.GetIndex(); for (size_t n = 0; n < rSortBoxes.size(); ++n) { @@ -137,13 +137,13 @@ static void lcl_CheckEmptyLayFrm( SwNodes& rNds, SwSectionData& rSectionData, if( !SwNodes::GoPrevSection( &aIdx, true, false ) || !CheckNodesRange( rStt, aIdx, true ) || // #i21457# - !lcl_IsInSameTblBox( rNds, rStt, true )) + !lcl_IsInSameTableBox( rNds, rStt, true )) { aIdx = rEnd; if( !rNds.GoNextSection( &aIdx, true, false ) || !CheckNodesRange( rEnd, aIdx, true ) || // #i21457# - !lcl_IsInSameTblBox( rNds, rEnd, false )) + !lcl_IsInSameTableBox( rNds, rEnd, false )) { rSectionData.SetHidden( false ); } @@ -171,7 +171,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, { const SwPosition *pStt = rRange.Start(), *pEnd = rRange.End(); if( !pStt->nContent.GetIndex() && - pEnd->nNode.GetNode().GetCntntNode()->Len() == + pEnd->nNode.GetNode().GetContentNode()->Len() == pEnd->nContent.GetIndex() ) { ::lcl_CheckEmptyLayFrm( GetNodes(), @@ -190,10 +190,10 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, GetIDocumentUndoRedo().DoUndo(false); } - SwSectionFmt* const pFmt = MakeSectionFmt( 0 ); + SwSectionFormat* const pFormat = MakeSectionFormat( 0 ); if ( pAttr ) { - pFmt->SetFmtAttr( *pAttr ); + pFormat->SetFormatAttr( *pAttr ); } SwSectionNode* pNewSectNode = 0; @@ -216,7 +216,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, --aEnd; // End is inclusive in the InsertSection pNewSectNode = GetNodes().InsertTextSection( - aStt, *pFmt, rNewData, pTOXBase, & aEnd); + aStt, *pFormat, rNewData, pTOXBase, & aEnd); } else { @@ -225,8 +225,8 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, if( !( pPrvNd && 1 == nRegionRet ) && pSttPos->nContent.GetIndex() ) { - SwTxtNode* const pTNd = - pSttPos->nNode.GetNode().GetTxtNode(); + SwTextNode* const pTNd = + pSttPos->nNode.GetNode().GetTextNode(); if (pTNd) { pUndoInsSect->SaveSplitNode( pTNd, true ); @@ -235,9 +235,9 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, if ( !( pPrvNd && 2 == nRegionRet ) ) { - SwTxtNode *const pTNd = - pEndPos->nNode.GetNode().GetTxtNode(); - if (pTNd && (pTNd->GetTxt().getLength() + SwTextNode *const pTNd = + pEndPos->nNode.GetNode().GetTextNode(); + if (pTNd && (pTNd->GetText().getLength() != pEndPos->nContent.GetIndex())) { pUndoInsSect->SaveSplitNode( pTNd, false ); @@ -248,7 +248,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, if( pPrvNd && 1 == nRegionRet ) { pSttPos->nNode.Assign( *pPrvNd ); - pSttPos->nContent.Assign( pSttPos->nNode.GetNode().GetCntntNode(), 0 ); + pSttPos->nContent.Assign( pSttPos->nNode.GetNode().GetContentNode(), 0 ); } else if( pSttPos->nContent.GetIndex() ) { @@ -258,61 +258,61 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, if( pPrvNd && 2 == nRegionRet ) { pEndPos->nNode.Assign( *pPrvNd ); - pEndPos->nContent.Assign( pEndPos->nNode.GetNode().GetCntntNode(), 0 ); + pEndPos->nContent.Assign( pEndPos->nNode.GetNode().GetContentNode(), 0 ); } else { - const SwCntntNode* pCNd = pEndPos->nNode.GetNode().GetCntntNode(); + const SwContentNode* pCNd = pEndPos->nNode.GetNode().GetContentNode(); if( pCNd && pCNd->Len() != pEndPos->nContent.GetIndex() ) { - sal_Int32 nCntnt = pSttPos->nContent.GetIndex(); + sal_Int32 nContent = pSttPos->nContent.GetIndex(); getIDocumentContentOperations().SplitNode( *pEndPos, false ); - SwTxtNode* pTNd; + SwTextNode* pTNd; if( pEndPos->nNode.GetIndex() == pSttPos->nNode.GetIndex() ) { --pSttPos->nNode; --pEndPos->nNode; - pTNd = pSttPos->nNode.GetNode().GetTxtNode(); - pSttPos->nContent.Assign( pTNd, nCntnt ); + pTNd = pSttPos->nNode.GetNode().GetTextNode(); + pSttPos->nContent.Assign( pTNd, nContent ); } else { // Set to the end of the previous --pEndPos->nNode; - pTNd = pEndPos->nNode.GetNode().GetTxtNode(); + pTNd = pEndPos->nNode.GetNode().GetTextNode(); } - nCntnt = (pTNd) ? pTNd->GetTxt().getLength() : 0; - pEndPos->nContent.Assign( pTNd, nCntnt ); + nContent = (pTNd) ? pTNd->GetText().getLength() : 0; + pEndPos->nContent.Assign( pTNd, nContent ); } } pNewSectNode = GetNodes().InsertTextSection( - pSttPos->nNode, *pFmt, rNewData, pTOXBase, &pEndPos->nNode); + pSttPos->nNode, *pFormat, rNewData, pTOXBase, &pEndPos->nNode); } } else { const SwPosition* pPos = rRange.GetPoint(); - const SwCntntNode* pCNd = pPos->nNode.GetNode().GetCntntNode(); + const SwContentNode* pCNd = pPos->nNode.GetNode().GetContentNode(); if( !pPos->nContent.GetIndex() ) { pNewSectNode = GetNodes().InsertTextSection( - pPos->nNode, *pFmt, rNewData, pTOXBase, 0, true); + pPos->nNode, *pFormat, rNewData, pTOXBase, 0, true); } else if( pPos->nContent.GetIndex() == pCNd->Len() ) { pNewSectNode = GetNodes().InsertTextSection( - pPos->nNode, *pFmt, rNewData, pTOXBase, 0, false); + pPos->nNode, *pFormat, rNewData, pTOXBase, 0, false); } else { - if( pUndoInsSect && pCNd->IsTxtNode() ) + if( pUndoInsSect && pCNd->IsTextNode() ) { - pUndoInsSect->SaveSplitNode( const_cast<SwTxtNode*>(static_cast<const SwTxtNode*>(pCNd)), true ); + pUndoInsSect->SaveSplitNode( const_cast<SwTextNode*>(static_cast<const SwTextNode*>(pCNd)), true ); } getIDocumentContentOperations().SplitNode( *pPos, false ); pNewSectNode = GetNodes().InsertTextSection( - pPos->nNode, *pFmt, rNewData, pTOXBase, 0, true); + pPos->nNode, *pFormat, rNewData, pTOXBase, 0, true); } } @@ -322,8 +322,8 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, getIDocumentRedlineAccess().SetRedlineMode_intern( eOld ); - // To-Do - add 'SwExtraRedlineTbl' also ? - if( getIDocumentRedlineAccess().IsRedlineOn() || (!getIDocumentRedlineAccess().IsIgnoreRedline() && !getIDocumentRedlineAccess().GetRedlineTbl().empty() )) + // To-Do - add 'SwExtraRedlineTable' also ? + if( getIDocumentRedlineAccess().IsRedlineOn() || (!getIDocumentRedlineAccess().IsIgnoreRedline() && !getIDocumentRedlineAccess().GetRedlineTable().empty() )) { SwPaM aPam( *pNewSectNode->EndOfSectionNode(), *pNewSectNode, 1 ); if( getIDocumentRedlineAccess().IsRedlineOn() ) @@ -343,31 +343,31 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, SwCalc aCalc( *this ); if( ! IsInReading() ) { - getIDocumentFieldsAccess().FldsToCalc( aCalc, pNewSectNode->GetIndex(), USHRT_MAX ); + getIDocumentFieldsAccess().FieldsToCalc( aCalc, pNewSectNode->GetIndex(), USHRT_MAX ); } SwSection& rNewSect = pNewSectNode->GetSection(); rNewSect.SetCondHidden( aCalc.Calculate( rNewSect.GetCondition() ).GetBool() ); } - bool bUpdateFtn = false; - if( GetFtnIdxs().size() && pAttr ) + bool bUpdateFootnote = false; + if( GetFootnoteIdxs().size() && pAttr ) { - sal_uInt16 nVal = static_cast<const SwFmtFtnAtTxtEnd&>(pAttr->Get( + sal_uInt16 nVal = static_cast<const SwFormatFootnoteAtTextEnd&>(pAttr->Get( RES_FTN_AT_TXTEND )).GetValue(); if( ( FTNEND_ATTXTEND_OWNNUMSEQ == nVal || FTNEND_ATTXTEND_OWNNUMANDFMT == nVal ) || - ( FTNEND_ATTXTEND_OWNNUMSEQ == ( nVal = static_cast<const SwFmtEndAtTxtEnd&>( + ( FTNEND_ATTXTEND_OWNNUMSEQ == ( nVal = static_cast<const SwFormatEndAtTextEnd&>( pAttr->Get( RES_END_AT_TXTEND )).GetValue() ) || FTNEND_ATTXTEND_OWNNUMANDFMT == nVal )) { - bUpdateFtn = true; + bUpdateFootnote = true; } } if( pUndoInsSect ) { pUndoInsSect->SetSectNdPos( pNewSectNode->GetIndex() ); - pUndoInsSect->SetUpdtFtnFlag( bUpdateFtn ); + pUndoInsSect->SetUpdateFootnoteFlag( bUpdateFootnote ); GetIDocumentUndoRedo().DoUndo(bUndo); } @@ -376,9 +376,9 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, pNewSectNode->GetSection().CreateLink( bUpdate ? CREATE_UPDATE : CREATE_CONNECT ); } - if( bUpdateFtn ) + if( bUpdateFootnote ) { - GetFtnIdxs().UpdateFtn( SwNodeIndex( *pNewSectNode )); + GetFootnoteIdxs().UpdateFootnote( SwNodeIndex( *pNewSectNode )); } getIDocumentState().SetModified(); @@ -395,7 +395,7 @@ sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange, const SwPosition* pStt = rRange.Start(); const SwPosition* pEnd = rRange.End(); - const SwCntntNode* pCNd = pEnd->nNode.GetNode().GetCntntNode(); + const SwContentNode* pCNd = pEnd->nNode.GetNode().GetContentNode(); const SwNode* pNd = &pStt->nNode.GetNode(); const SwSectionNode* pSectNd = pNd->FindSectionNode(); const SwSectionNode* pEndSectNd = pCNd ? pCNd->FindSectionNode() : 0; @@ -506,29 +506,29 @@ SwSection* SwDoc::GetCurrSection( const SwPosition& rPos ) return 0; } -SwSectionFmt* SwDoc::MakeSectionFmt( SwSectionFmt *pDerivedFrom ) +SwSectionFormat* SwDoc::MakeSectionFormat( SwSectionFormat *pDerivedFrom ) { - SwSectionFmt* pNew = new SwSectionFmt( - pDerivedFrom == 0 ? mpDfltFrmFmt : pDerivedFrom, this ); - mpSectionFmtTbl->push_back( pNew ); + SwSectionFormat* pNew = new SwSectionFormat( + pDerivedFrom == 0 ? mpDfltFrameFormat : pDerivedFrom, this ); + mpSectionFormatTable->push_back( pNew ); return pNew; } -void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, bool bDelNodes ) +void SwDoc::DelSectionFormat( SwSectionFormat *pFormat, bool bDelNodes ) { - SwSectionFmts::iterator itFmtPos = std::find( mpSectionFmtTbl->begin(), mpSectionFmtTbl->end(), pFmt ); + SwSectionFormats::iterator itFormatPos = std::find( mpSectionFormatTable->begin(), mpSectionFormatTable->end(), pFormat ); GetIDocumentUndoRedo().StartUndo(UNDO_DELSECTION, NULL); - if( mpSectionFmtTbl->end() != itFmtPos ) + if( mpSectionFormatTable->end() != itFormatPos ) { - const SwNodeIndex* pIdx = pFmt->GetCntnt( false ).GetCntntIdx(); - const SfxPoolItem* pFtnEndAtTxtEnd; - if( SfxItemState::SET != pFmt->GetItemState( - RES_FTN_AT_TXTEND, true, &pFtnEndAtTxtEnd ) || - SfxItemState::SET != pFmt->GetItemState( - RES_END_AT_TXTEND, true, &pFtnEndAtTxtEnd )) - pFtnEndAtTxtEnd = 0; + const SwNodeIndex* pIdx = pFormat->GetContent( false ).GetContentIdx(); + const SfxPoolItem* pFootnoteEndAtTextEnd; + if( SfxItemState::SET != pFormat->GetItemState( + RES_FTN_AT_TXTEND, true, &pFootnoteEndAtTextEnd ) || + SfxItemState::SET != pFormat->GetItemState( + RES_END_AT_TXTEND, true, &pFootnoteEndAtTextEnd )) + pFootnoteEndAtTextEnd = 0; const SwSectionNode* pSectNd; @@ -540,22 +540,22 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, bool bDelNodes ) SwNodeIndex aUpdIdx( *pIdx ); SwPaM aPaM( *pSectNd->EndOfSectionNode(), *pSectNd ); GetIDocumentUndoRedo().AppendUndo( new SwUndoDelete( aPaM )); - if( pFtnEndAtTxtEnd ) - GetFtnIdxs().UpdateFtn( aUpdIdx ); + if( pFootnoteEndAtTextEnd ) + GetFootnoteIdxs().UpdateFootnote( aUpdIdx ); getIDocumentState().SetModified(); //#126178# start/end undo have to be pairs! GetIDocumentUndoRedo().EndUndo(UNDO_DELSECTION, NULL); return ; } - GetIDocumentUndoRedo().AppendUndo( MakeUndoDelSection( *pFmt ) ); + GetIDocumentUndoRedo().AppendUndo( MakeUndoDelSection( *pFormat ) ); } else if( bDelNodes && pIdx && &GetNodes() == &pIdx->GetNodes() && 0 != (pSectNd = pIdx->GetNode().GetSectionNode() )) { SwNodeIndex aUpdIdx( *pIdx ); getIDocumentContentOperations().DeleteSection( (SwNode*)pSectNd ); - if( pFtnEndAtTxtEnd ) - GetFtnIdxs().UpdateFtn( aUpdIdx ); + if( pFootnoteEndAtTextEnd ) + GetFootnoteIdxs().UpdateFootnote( aUpdIdx ); getIDocumentState().SetModified(); //#126178# start/end undo have to be pairs! GetIDocumentUndoRedo().EndUndo(UNDO_DELSECTION, NULL); @@ -563,17 +563,17 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, bool bDelNodes ) } { - SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt ); - pFmt->ModifyNotification( &aMsgHint, &aMsgHint ); + SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFormat ); + pFormat->ModifyNotification( &aMsgHint, &aMsgHint ); } // A ClearRedo could result in a recursive call of this function and delete some section - // formats, thus the position inside the SectionFmtTbl could have changed - itFmtPos = std::find( mpSectionFmtTbl->begin(), mpSectionFmtTbl->end(), pFmt ); + // formats, thus the position inside the SectionFormatTable could have changed + itFormatPos = std::find( mpSectionFormatTable->begin(), mpSectionFormatTable->end(), pFormat ); // WARNING: First remove from the array and then delete, // as the Section DTOR tries to delete it's format itself. - mpSectionFmtTbl->erase( itFmtPos ); + mpSectionFormatTable->erase( itFormatPos ); //FEATURE::CONDCOLL sal_uLong nCnt = 0, nSttNd = 0; if( pIdx && &GetNodes() == &pIdx->GetNodes() && @@ -584,19 +584,19 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, bool bDelNodes ) } //FEATURE::CONDCOLL - delete pFmt; + delete pFormat; - if( nSttNd && pFtnEndAtTxtEnd ) + if( nSttNd && pFootnoteEndAtTextEnd ) { SwNodeIndex aUpdIdx( GetNodes(), nSttNd ); - GetFtnIdxs().UpdateFtn( aUpdIdx ); + GetFootnoteIdxs().UpdateFootnote( aUpdIdx ); } //FEATURE::CONDCOLL - SwCntntNode* pCNd; + SwContentNode* pCNd; for( ; nCnt--; ++nSttNd ) - if( 0 != (pCNd = GetNodes()[ nSttNd ]->GetCntntNode() ) && - RES_CONDTXTFMTCOLL == pCNd->GetFmtColl()->Which() ) + if( 0 != (pCNd = GetNodes()[ nSttNd ]->GetContentNode() ) && + RES_CONDTXTFMTCOLL == pCNd->GetFormatColl()->Which() ) pCNd->ChkCondColl(); //FEATURE::CONDCOLL } @@ -609,8 +609,8 @@ void SwDoc::DelSectionFmt( SwSectionFmt *pFmt, bool bDelNodes ) void SwDoc::UpdateSection( size_t const nPos, SwSectionData & rNewData, SfxItemSet const*const pAttr, bool const bPreventLinkUpdate ) { - SwSectionFmt* pFmt = (*mpSectionFmtTbl)[ nPos ]; - SwSection* pSection = pFmt->GetSection(); + SwSectionFormat* pFormat = (*mpSectionFormatTable)[ nPos ]; + SwSection* pSection = pFormat->GetSection(); /// remember hidden condition flag of SwSection before changes bool bOldCondHidden = pSection->IsCondHidden(); @@ -625,7 +625,7 @@ void SwDoc::UpdateSection( size_t const nPos, SwSectionData & rNewData, sal_uInt16 nWhich = aIter.GetCurItem()->Which(); while( true ) { - if( pFmt->GetFmtAttr( nWhich ) != *aIter.GetCurItem() ) + if( pFormat->GetFormatAttr( nWhich ) != *aIter.GetCurItem() ) { bOnlyAttrChg = true; break; @@ -642,13 +642,13 @@ void SwDoc::UpdateSection( size_t const nPos, SwSectionData & rNewData, if (GetIDocumentUndoRedo().DoesUndo()) { GetIDocumentUndoRedo().AppendUndo( - MakeUndoUpdateSection( *pFmt, true ) ); + MakeUndoUpdateSection( *pFormat, true ) ); } - // #i32968# Inserting columns in the section causes MakeFrmFmt - // to put two objects of type SwUndoFrmFmt on the undo stack. + // #i32968# Inserting columns in the section causes MakeFrameFormat + // to put two objects of type SwUndoFrameFormat on the undo stack. // We don't want them. ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); - pFmt->SetFmtAttr( *pAttr ); + pFormat->SetFormatAttr( *pAttr ); getIDocumentState().SetModified(); } return; @@ -660,7 +660,7 @@ void SwDoc::UpdateSection( size_t const nPos, SwSectionData & rNewData, { if (rNewData.IsHidden()) { - pIdx = pFmt->GetCntnt().GetCntntIdx(); + pIdx = pFormat->GetContent().GetContentIdx(); if (pIdx) { const SwSectionNode* pSectNd = @@ -676,10 +676,10 @@ void SwDoc::UpdateSection( size_t const nPos, SwSectionData & rNewData, if (GetIDocumentUndoRedo().DoesUndo()) { - GetIDocumentUndoRedo().AppendUndo(MakeUndoUpdateSection(*pFmt, false)); + GetIDocumentUndoRedo().AppendUndo(MakeUndoUpdateSection(*pFormat, false)); } - // #i32968# Inserting columns in the section causes MakeFrmFmt to put two - // objects of type SwUndoFrmFmt on the undo stack. We don't want them. + // #i32968# Inserting columns in the section causes MakeFrameFormat to put two + // objects of type SwUndoFrameFormat on the undo stack. We don't want them. ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); // The LinkFileName could only consist of separators @@ -705,7 +705,7 @@ void SwDoc::UpdateSection( size_t const nPos, SwSectionData & rNewData, pSection->SetSectionData(rNewData); if( pAttr ) - pSection->GetFmt()->SetFmtAttr( *pAttr ); + pSection->GetFormat()->SetFormatAttr( *pAttr ); if( !sSectName.isEmpty() ) { @@ -718,12 +718,12 @@ void SwDoc::UpdateSection( size_t const nPos, SwSectionData & rNewData, // Then calculate up to that position SwCalc aCalc( *this ); if( !pIdx ) - pIdx = pFmt->GetCntnt().GetCntntIdx(); - getIDocumentFieldsAccess().FldsToCalc( aCalc, pIdx->GetIndex(), USHRT_MAX ); + pIdx = pFormat->GetContent().GetContentIdx(); + getIDocumentFieldsAccess().FieldsToCalc( aCalc, pIdx->GetIndex(), USHRT_MAX ); /// Because on using SwSection::operator=() to set up <pSection> /// with <rNewData> and the above given note, the hidden condition flag - /// has to be set to false, if hidden condition flag of <pFmt->GetSection()> + /// has to be set to false, if hidden condition flag of <pFormat->GetSection()> /// (SwSection before the changes) is false (already saved in <bOldCondHidden>) /// and new calculated condition is true. /// This is necessary, because otherwise the <SetCondHidden> would have @@ -748,18 +748,18 @@ void SwDoc::UpdateSection( size_t const nPos, SwSectionData & rNewData, getIDocumentState().SetModified(); } -void sw_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd ) +void sw_DeleteFootnote( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd ) { - SwFtnIdxs& rFtnArr = pNd->GetDoc()->GetFtnIdxs(); - if( rFtnArr.size() ) + SwFootnoteIdxs& rFootnoteArr = pNd->GetDoc()->GetFootnoteIdxs(); + if( rFootnoteArr.size() ) { size_t nPos = 0; - rFtnArr.SeekEntry( SwNodeIndex( *pNd ), &nPos ); - SwTxtFtn* pSrch; + rFootnoteArr.SeekEntry( SwNodeIndex( *pNd ), &nPos ); + SwTextFootnote* pSrch; // Delete all succeeding Footnotes - while( nPos < rFtnArr.size() && - _SwTxtFtn_GetIndex( (pSrch = rFtnArr[ nPos ]) ) <= nEnd ) + while( nPos < rFootnoteArr.size() && + _SwTextFootnote_GetIndex( (pSrch = rFootnoteArr[ nPos ]) ) <= nEnd ) { // If the Nodes are not deleted, they need to deregister at the Pages // (delete Frms) or else they will remain there (Undo does not delete them!) @@ -768,7 +768,7 @@ void sw_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd ) } while( nPos-- && - _SwTxtFtn_GetIndex( (pSrch = rFtnArr[ nPos ]) ) >= nStt ) + _SwTextFootnote_GetIndex( (pSrch = rFootnoteArr[ nPos ]) ) >= nStt ) { // If the Nodes are not deleted, they need to deregister at the Pages // (delete Frms) or else they will remain there (Undo does not delete them!) @@ -784,7 +784,7 @@ static inline bool lcl_IsTOXSection(SwSectionData const& rSectionData) } SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, - SwSectionFmt& rSectionFmt, + SwSectionFormat& rSectionFormat, SwSectionData const& rSectionData, SwTOXBase const*const pTOXBase, SwNodeIndex const*const pEnde, @@ -824,7 +824,7 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, } SwSectionNode *const pSectNd = - new SwSectionNode(aInsPos, rSectionFmt, pTOXBase); + new SwSectionNode(aInsPos, rSectionFormat, pTOXBase); if( pEnde ) { // Special case for the Reader/Writer @@ -857,10 +857,10 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, } else { - SwTxtNode* pCpyTNd = rNdIdx.GetNode().GetTxtNode(); + SwTextNode* pCpyTNd = rNdIdx.GetNode().GetTextNode(); if( pCpyTNd ) { - SwTxtNode* pTNd = new SwTxtNode( aInsPos, pCpyTNd->GetTxtColl() ); + SwTextNode* pTNd = new SwTextNode( aInsPos, pCpyTNd->GetTextColl() ); if( pCpyTNd->HasSwAttrSet() ) { // Move PageDesc/Break to the first Node of the section @@ -885,12 +885,12 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, pCpyTNd->MakeFrms( *pTNd ); } else - new SwTxtNode( aInsPos, GetDoc()->GetDfltTxtFmtColl() ); + new SwTextNode( aInsPos, GetDoc()->GetDfltTextFormatColl() ); } new SwEndNode( aInsPos, *pSectNd ); pSectNd->GetSection().SetSectionData(rSectionData); - SwSectionFmt* pSectFmt = pSectNd->GetSection().GetFmt(); + SwSectionFormat* pSectFormat = pSectNd->GetSection().GetFormat(); // We could optimize this, by not removing already contained Frames and recreating them, // but by simply rewiring them @@ -924,8 +924,8 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, // Make up the Format's nesting if( pNd->IsSectionNode() ) { - static_cast<SwSectionNode*>(pNd)->GetSection().GetFmt()-> - SetDerivedFrom( pSectFmt ); + static_cast<SwSectionNode*>(pNd)->GetSection().GetFormat()-> + SetDerivedFrom( pSectFormat ); static_cast<SwSectionNode*>(pNd)->DelFrms(); n = pNd->EndOfSectionIndex(); } @@ -938,11 +938,11 @@ SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx, nSkipIdx = pNd->EndOfSectionIndex(); } } - else if( pNd->IsCntntNode() ) - static_cast<SwCntntNode*>(pNd)->DelFrms(); + else if( pNd->IsContentNode() ) + static_cast<SwContentNode*>(pNd)->DelFrms(); } - sw_DeleteFtn( pSectNd, nStart, nEnde ); + sw_DeleteFootnote( pSectNd, nStart, nEnde ); if( bInsFrm ) { @@ -972,32 +972,32 @@ SwSectionNode* SwNode::FindSectionNode() // SwSectionNode // ugly hack to make m_pSection const -static SwSectionFmt & -lcl_initParent(SwSectionNode & rThis, SwSectionFmt & rFmt) +static SwSectionFormat & +lcl_initParent(SwSectionNode & rThis, SwSectionFormat & rFormat) { SwSectionNode *const pParent = rThis.StartOfSectionNode()->FindSectionNode(); if( pParent ) { // Register the Format at the right Parent - rFmt.SetDerivedFrom( pParent->GetSection().GetFmt() ); + rFormat.SetDerivedFrom( pParent->GetSection().GetFormat() ); } - return rFmt; + return rFormat; } SwSectionNode::SwSectionNode(SwNodeIndex const& rIdx, - SwSectionFmt & rFmt, SwTOXBase const*const pTOXBase) + SwSectionFormat & rFormat, SwTOXBase const*const pTOXBase) : SwStartNode( rIdx, ND_SECTIONNODE ) , m_pSection( (pTOXBase) - ? new SwTOXBaseSection(*pTOXBase, lcl_initParent(*this, rFmt)) - : new SwSection( CONTENT_SECTION, rFmt.GetName(), - lcl_initParent(*this, rFmt) ) ) + ? new SwTOXBaseSection(*pTOXBase, lcl_initParent(*this, rFormat)) + : new SwSection( CONTENT_SECTION, rFormat.GetName(), + lcl_initParent(*this, rFormat) ) ) { // Set the connection from Format to Node // Suppress Modify; no one's interessted anyway - rFmt.LockModify(); - rFmt.SetFmtAttr( SwFmtCntnt( this ) ); - rFmt.UnlockModify(); + rFormat.LockModify(); + rFormat.SetFormatAttr( SwFormatContent( this ) ); + rFormat.UnlockModify(); } #ifdef DBG_UTIL @@ -1034,15 +1034,15 @@ SwSectionNode::~SwSectionNode() { // mba: test if iteration works as clients will be removed in callback // use hint which allows to specify, if the content shall be saved or not - m_pSection->GetFmt()->CallSwClientNotify( SwSectionFrmMoveAndDeleteHint( true ) ); - SwSectionFmt* pFmt = m_pSection->GetFmt(); - if( pFmt ) + m_pSection->GetFormat()->CallSwClientNotify( SwSectionFrmMoveAndDeleteHint( true ) ); + SwSectionFormat* pFormat = m_pSection->GetFormat(); + if( pFormat ) { // Remove the Attributei, because the Section deletes it's Format - // and it will neutralize the Section, if the Cntnt Attribute is set - pFmt->LockModify(); - pFmt->ResetFmtAttr( RES_CNTNT ); - pFmt->UnlockModify(); + // and it will neutralize the Section, if the Content Attribute is set + pFormat->LockModify(); + pFormat->ResetFormatAttr( RES_CNTNT ); + pFormat->UnlockModify(); } } @@ -1060,10 +1060,10 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) SwNodes& rNds = GetNodes(); if( rNds.IsDocNodes() && rNds.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell() ) { - if( GetSection().IsHidden() || IsCntntHidden() ) + if( GetSection().IsHidden() || IsContentHidden() ) { SwNodeIndex aIdx( *EndOfSectionNode() ); - SwCntntNode* pCNd = rNds.GoNextSection( &aIdx, true, false ); + SwContentNode* pCNd = rNds.GoNextSection( &aIdx, true, false ); if( !pCNd ) { aIdx = *this; @@ -1071,8 +1071,8 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) if (!pCNd) return; } - pCNd = aIdx.GetNode().GetCntntNode(); - pCNd->MakeFrms( static_cast<SwCntntNode&>(rIdx.GetNode()) ); + pCNd = aIdx.GetNode().GetContentNode(); + pCNd->MakeFrms( static_cast<SwContentNode&>(rIdx.GetNode()) ); } else { @@ -1081,7 +1081,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) while( 0 != (pFrm = aNode2Layout.NextFrm()) ) { OSL_ENSURE( pFrm->IsSctFrm(), "Depend of Section not a Section." ); - SwFrm *pNew = rIdx.GetNode().GetCntntNode()->MakeFrm( pFrm ); + SwFrm *pNew = rIdx.GetNode().GetContentNode()->MakeFrm( pFrm ); SwSectionNode* pS = rIdx.GetNode().FindSectionNode(); @@ -1118,15 +1118,15 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) // CONTENT_FLOWS_FROM/_TO relation. // Relation CONTENT_FLOWS_FROM for next paragraph will change // and relation CONTENT_FLOWS_TO for previous paragraph will change. - if ( pNew->IsTxtFrm() ) + if ( pNew->IsTextFrm() ) { SwViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { pViewShell->InvalidateAccessibleParaFlowRelation( - dynamic_cast<SwTxtFrm*>(pNew->FindNextCnt( true )), - dynamic_cast<SwTxtFrm*>(pNew->FindPrevCnt( true )) ); + dynamic_cast<SwTextFrm*>(pNew->FindNextCnt( true )), + dynamic_cast<SwTextFrm*>(pNew->FindPrevCnt( true )) ); } } pNew = pSct; @@ -1144,15 +1144,15 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) // CONTENT_FLOWS_FROM/_TO relation. // Relation CONTENT_FLOWS_FROM for next paragraph will change // and relation CONTENT_FLOWS_TO for previous paragraph will change. - if ( pNew->IsTxtFrm() ) + if ( pNew->IsTextFrm() ) { SwViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { pViewShell->InvalidateAccessibleParaFlowRelation( - dynamic_cast<SwTxtFrm*>(pNew->FindNextCnt( true )), - dynamic_cast<SwTxtFrm*>(pNew->FindPrevCnt( true )) ); + dynamic_cast<SwTextFrm*>(pNew->FindNextCnt( true )), + dynamic_cast<SwTextFrm*>(pNew->FindPrevCnt( true )) ); } } if ( bInitNewSect ) @@ -1163,7 +1163,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) } // Create a new SectionFrm for every occurrence in the Layout and insert before -// the corresponding CntntFrm +// the corresponding ContentFrm void SwSectionNode::MakeFrms( SwNodeIndex* pIdxBehind, SwNodeIndex* pEndIdx ) { OSL_ENSURE( pIdxBehind, "no Index" ); @@ -1193,26 +1193,26 @@ void SwSectionNode::DelFrms() } SwNodes& rNds = GetNodes(); - m_pSection->GetFmt()->DelFrms(); + m_pSection->GetFormat()->DelFrms(); // Update our Flag m_pSection->m_Data.SetHiddenFlag(true); // If the Area is within a Fly or TableBox, we can only hide it if // there is more Content which has Frames. - // Or else the Fly/TblBox Frame does not have a Lower! + // Or else the Fly/TableBox Frame does not have a Lower! { SwNodeIndex aIdx( *this ); if( !SwNodes::GoPrevSection( &aIdx, true, false ) || !CheckNodesRange( *this, aIdx, true ) || // #i21457# - !lcl_IsInSameTblBox( rNds, *this, true )) + !lcl_IsInSameTableBox( rNds, *this, true )) { aIdx = *EndOfSectionNode(); if( !rNds.GoNextSection( &aIdx, true, false ) || !CheckNodesRange( *EndOfSectionNode(), aIdx, true ) || // #i21457# - !lcl_IsInSameTblBox( rNds, *EndOfSectionNode(), false )) + !lcl_IsInSameTableBox( rNds, *EndOfSectionNode(), false )) { m_pSection->m_Data.SetHiddenFlag(false); } @@ -1225,9 +1225,9 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c // In which array am I: Nodes, UndoNodes? const SwNodes& rNds = GetNodes(); - // Copy the SectionFrmFmt - SwSectionFmt* pSectFmt = pDoc->MakeSectionFmt( 0 ); - pSectFmt->CopyAttrs( *GetSection().GetFmt() ); + // Copy the SectionFrameFormat + SwSectionFormat* pSectFormat = pDoc->MakeSectionFormat( 0 ); + pSectFormat->CopyAttrs( *GetSection().GetFormat() ); boost::scoped_ptr<SwTOXBase> pTOXBase; if (TOX_CONTENT_SECTION == GetSection().GetType()) @@ -1239,7 +1239,7 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c } SwSectionNode *const pSectNd = - new SwSectionNode(rIdx, *pSectFmt, pTOXBase.get()); + new SwSectionNode(rIdx, *pSectFormat, pTOXBase.get()); SwEndNode* pEndNd = new SwEndNode( rIdx, *pSectNd ); SwNodeIndex aInsPos( *pEndNd ); @@ -1291,12 +1291,12 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c } // METADATA: copy xml:id; must be done after insertion of node - pSectFmt->RegisterAsCopyOf(*GetSection().GetFmt()); + pSectFormat->RegisterAsCopyOf(*GetSection().GetFormat()); return pSectNd; } -bool SwSectionNode::IsCntntHidden() const +bool SwSectionNode::IsContentHidden() const { OSL_ENSURE( !m_pSection->IsHidden(), "That's simple: Hidden Section => Hidden Content" ); @@ -1313,7 +1313,7 @@ bool SwSectionNode::IsCntntHidden() const } else { - if( aTmp.GetNode().IsCntntNode() || aTmp.GetNode().IsTableNode() ) + if( aTmp.GetNode().IsContentNode() || aTmp.GetNode().IsTableNode() ) return false; // We found non-hidden content OSL_ENSURE( aTmp.GetNode().IsEndNode(), "EndNode expected" ); } @@ -1324,26 +1324,26 @@ bool SwSectionNode::IsCntntHidden() const void SwSectionNode::NodesArrChgd() { - SwSectionFmt *const pFmt = m_pSection->GetFmt(); - if( pFmt ) + SwSectionFormat *const pFormat = m_pSection->GetFormat(); + if( pFormat ) { SwNodes& rNds = GetNodes(); - SwDoc* pDoc = pFmt->GetDoc(); + SwDoc* pDoc = pFormat->GetDoc(); if( !rNds.IsDocNodes() ) { - SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt ); - pFmt->ModifyNotification( &aMsgHint, &aMsgHint ); + SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFormat ); + pFormat->ModifyNotification( &aMsgHint, &aMsgHint ); } - pFmt->LockModify(); - pFmt->SetFmtAttr( SwFmtCntnt( this )); - pFmt->UnlockModify(); + pFormat->LockModify(); + pFormat->SetFormatAttr( SwFormatContent( this )); + pFormat->UnlockModify(); SwSectionNode* pSectNd = StartOfSectionNode()->FindSectionNode(); // set the correct parent from the new section - pFmt->SetDerivedFrom( pSectNd ? pSectNd->GetSection().GetFmt() - : pDoc->GetDfltFrmFmt() ); + pFormat->SetDerivedFrom( pSectNd ? pSectNd->GetSection().GetFormat() + : pDoc->GetDfltFrameFormat() ); // Set the right StartNode for all in this Area sal_uLong nStart = GetIndex()+1, nEnde = EndOfSectionIndex(); @@ -1351,7 +1351,7 @@ void SwSectionNode::NodesArrChgd() // Make up the Format's nesting if( 0 != ( pSectNd = rNds[ n ]->GetSectionNode() ) ) { - pSectNd->GetSection().GetFmt()->SetDerivedFrom( pFmt ); + pSectNd->GetSection().GetFormat()->SetDerivedFrom( pFormat ); n = pSectNd->EndOfSectionIndex(); } @@ -1385,7 +1385,7 @@ OUString SwDoc::GetUniqueSectionName( const OUString* pChkStr ) const { OUString newName = "MailMergeSection" + OStringToOUString( DateTimeToOString( DateTime( DateTime::SYSTEM )), RTL_TEXTENCODING_ASCII_US ) - + OUString::number( mpSectionFmtTbl->size() + 1 ); + + OUString::number( mpSectionFormatTable->size() + 1 ); if( pChkStr ) newName += *pChkStr; return newName; @@ -1393,14 +1393,14 @@ OUString SwDoc::GetUniqueSectionName( const OUString* pChkStr ) const const OUString aName( ResId( STR_REGION_DEFNAME, *pSwResMgr ) ); - SwSectionFmts::size_type nNum = 0; - const SwSectionFmts::size_type nFlagSize = ( mpSectionFmtTbl->size() / 8 ) + 2; + SwSectionFormats::size_type nNum = 0; + const SwSectionFormats::size_type nFlagSize = ( mpSectionFormatTable->size() / 8 ) + 2; sal_uInt8* pSetFlags = new sal_uInt8[ nFlagSize ]; memset( pSetFlags, 0, nFlagSize ); - for( auto pFmt : *mpSectionFmtTbl ) + for( auto pFormat : *mpSectionFormatTable ) { - const SwSectionNode *const pSectNd = pFmt->GetSectionNode( false ); + const SwSectionNode *const pSectNd = pFormat->GetSectionNode( false ); if( pSectNd != nullptr ) { const OUString rNm = pSectNd->GetSection().GetSectionName(); @@ -1408,7 +1408,7 @@ OUString SwDoc::GetUniqueSectionName( const OUString* pChkStr ) const { // Calculate the Number and reset the Flag nNum = rNm.copy( aName.getLength() ).toInt32(); - if( nNum-- && nNum < mpSectionFmtTbl->size() ) + if( nNum-- && nNum < mpSectionFormatTable->size() ) pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 )); } if( pChkStr && *pChkStr==rNm ) @@ -1419,8 +1419,8 @@ OUString SwDoc::GetUniqueSectionName( const OUString* pChkStr ) const if( !pChkStr ) { // Flagged all Numbers accordingly, so get the right Number - nNum = mpSectionFmtTbl->size(); - for( SwSectionFmts::size_type n = 0; n < nFlagSize; ++n ) + nNum = mpSectionFormatTable->size(); + for( SwSectionFormats::size_type n = 0; n < nFlagSize; ++n ) { auto nTmp = pSetFlags[ n ]; if( nTmp != 0xFF ) diff --git a/sw/source/core/docnode/ndsect.hxx b/sw/source/core/docnode/ndsect.hxx index 9ca5f60ddf78..19c3eadbfe2c 100644 --- a/sw/source/core/docnode/ndsect.hxx +++ b/sw/source/core/docnode/ndsect.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_SW_SOURCE_CORE_DOCNODE_NDSECT_HXX #define INCLUDED_SW_SOURCE_CORE_DOCNODE_NDSECT_HXX -void sw_DeleteFtn( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd ); +void sw_DeleteFootnote( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd ); #endif diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index c9ebc129ace7..7a77906d430d 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -106,7 +106,7 @@ using namespace ::com::sun::star; const sal_Unicode T2T_PARA = 0x0a; -static void lcl_SetDfltBoxAttr( SwFrmFmt& rFmt, sal_uInt8 nId ) +static void lcl_SetDfltBoxAttr( SwFrameFormat& rFormat, sal_uInt8 nId ) { bool bTop = false, bBottom = false, bLeft = false, bRight = false; switch ( nId ) @@ -117,7 +117,7 @@ static void lcl_SetDfltBoxAttr( SwFrmFmt& rFmt, sal_uInt8 nId ) case 3: bBottom = bLeft = bRight = true; break; } - const bool bHTML = rFmt.getIDocumentSettingAccess()->get(DocumentSettingId::HTML_MODE); + const bool bHTML = rFormat.getIDocumentSettingAccess()->get(DocumentSettingId::HTML_MODE); Color aCol( bHTML ? COL_GRAY : COL_BLACK ); SvxBorderLine aLine( &aCol, DEF_LINE_WIDTH_0 ); if ( bHTML ) @@ -134,83 +134,83 @@ static void lcl_SetDfltBoxAttr( SwFrmFmt& rFmt, sal_uInt8 nId ) aBox.SetLine( &aLine, SvxBoxItemLine::LEFT ); if ( bRight ) aBox.SetLine( &aLine, SvxBoxItemLine::RIGHT ); - rFmt.SetFmtAttr( aBox ); + rFormat.SetFormatAttr( aBox ); } -typedef std::map<SwFrmFmt *, SwTableBoxFmt *> DfltBoxAttrMap_t; +typedef std::map<SwFrameFormat *, SwTableBoxFormat *> DfltBoxAttrMap_t; typedef std::vector<DfltBoxAttrMap_t *> DfltBoxAttrList_t; static void -lcl_SetDfltBoxAttr(SwTableBox& rBox, DfltBoxAttrList_t & rBoxFmtArr, - sal_uInt8 const nId, SwTableAutoFmt const*const pAutoFmt = 0) +lcl_SetDfltBoxAttr(SwTableBox& rBox, DfltBoxAttrList_t & rBoxFormatArr, + sal_uInt8 const nId, SwTableAutoFormat const*const pAutoFormat = 0) { - DfltBoxAttrMap_t * pMap = rBoxFmtArr[ nId ]; + DfltBoxAttrMap_t * pMap = rBoxFormatArr[ nId ]; if (!pMap) { pMap = new DfltBoxAttrMap_t; - rBoxFmtArr[ nId ] = pMap; + rBoxFormatArr[ nId ] = pMap; } - SwTableBoxFmt* pNewTableBoxFmt = 0; - SwFrmFmt* pBoxFrmFmt = rBox.GetFrmFmt(); - DfltBoxAttrMap_t::iterator const iter(pMap->find(pBoxFrmFmt)); + SwTableBoxFormat* pNewTableBoxFormat = 0; + SwFrameFormat* pBoxFrameFormat = rBox.GetFrameFormat(); + DfltBoxAttrMap_t::iterator const iter(pMap->find(pBoxFrameFormat)); if (pMap->end() != iter) { - pNewTableBoxFmt = iter->second; + pNewTableBoxFormat = iter->second; } else { - SwDoc* pDoc = pBoxFrmFmt->GetDoc(); + SwDoc* pDoc = pBoxFrameFormat->GetDoc(); // format does not exist, so create it - pNewTableBoxFmt = pDoc->MakeTableBoxFmt(); - pNewTableBoxFmt->SetFmtAttr( pBoxFrmFmt->GetAttrSet().Get( RES_FRM_SIZE ) ); + pNewTableBoxFormat = pDoc->MakeTableBoxFormat(); + pNewTableBoxFormat->SetFormatAttr( pBoxFrameFormat->GetAttrSet().Get( RES_FRM_SIZE ) ); - if( pAutoFmt ) - pAutoFmt->UpdateToSet( nId, (SfxItemSet&)pNewTableBoxFmt->GetAttrSet(), - SwTableAutoFmt::UPDATE_BOX, + if( pAutoFormat ) + pAutoFormat->UpdateToSet( nId, (SfxItemSet&)pNewTableBoxFormat->GetAttrSet(), + SwTableAutoFormat::UPDATE_BOX, pDoc->GetNumberFormatter( true ) ); else - ::lcl_SetDfltBoxAttr( *pNewTableBoxFmt, nId ); + ::lcl_SetDfltBoxAttr( *pNewTableBoxFormat, nId ); - (*pMap)[pBoxFrmFmt] = pNewTableBoxFmt; + (*pMap)[pBoxFrameFormat] = pNewTableBoxFormat; } - rBox.ChgFrmFmt( pNewTableBoxFmt ); + rBox.ChgFrameFormat( pNewTableBoxFormat ); } -static SwTableBoxFmt *lcl_CreateDfltBoxFmt( SwDoc &rDoc, std::vector<SwTableBoxFmt*> &rBoxFmtArr, +static SwTableBoxFormat *lcl_CreateDfltBoxFormat( SwDoc &rDoc, std::vector<SwTableBoxFormat*> &rBoxFormatArr, sal_uInt16 nCols, sal_uInt8 nId ) { - if ( !rBoxFmtArr[nId] ) + if ( !rBoxFormatArr[nId] ) { - SwTableBoxFmt* pBoxFmt = rDoc.MakeTableBoxFmt(); + SwTableBoxFormat* pBoxFormat = rDoc.MakeTableBoxFormat(); if( USHRT_MAX != nCols ) - pBoxFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, + pBoxFormat->SetFormatAttr( SwFormatFrmSize( ATT_VAR_SIZE, USHRT_MAX / nCols, 0 )); - ::lcl_SetDfltBoxAttr( *pBoxFmt, nId ); - rBoxFmtArr[ nId ] = pBoxFmt; + ::lcl_SetDfltBoxAttr( *pBoxFormat, nId ); + rBoxFormatArr[ nId ] = pBoxFormat; } - return rBoxFmtArr[nId]; + return rBoxFormatArr[nId]; } -static SwTableBoxFmt *lcl_CreateAFmtBoxFmt( SwDoc &rDoc, std::vector<SwTableBoxFmt*> &rBoxFmtArr, - const SwTableAutoFmt& rAutoFmt, +static SwTableBoxFormat *lcl_CreateAFormatBoxFormat( SwDoc &rDoc, std::vector<SwTableBoxFormat*> &rBoxFormatArr, + const SwTableAutoFormat& rAutoFormat, sal_uInt16 nCols, sal_uInt8 nId ) { - if( !rBoxFmtArr[nId] ) + if( !rBoxFormatArr[nId] ) { - SwTableBoxFmt* pBoxFmt = rDoc.MakeTableBoxFmt(); - rAutoFmt.UpdateToSet( nId, (SfxItemSet&)pBoxFmt->GetAttrSet(), - SwTableAutoFmt::UPDATE_BOX, + SwTableBoxFormat* pBoxFormat = rDoc.MakeTableBoxFormat(); + rAutoFormat.UpdateToSet( nId, (SfxItemSet&)pBoxFormat->GetAttrSet(), + SwTableAutoFormat::UPDATE_BOX, rDoc.GetNumberFormatter( true ) ); if( USHRT_MAX != nCols ) - pBoxFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, + pBoxFormat->SetFormatAttr( SwFormatFrmSize( ATT_VAR_SIZE, USHRT_MAX / nCols, 0 )); - rBoxFmtArr[ nId ] = pBoxFmt; + rBoxFormatArr[ nId ] = pBoxFormat; } - return rBoxFmtArr[nId]; + return rBoxFormatArr[nId]; } -SwTableNode* SwDoc::IsIdxInTbl(const SwNodeIndex& rIdx) +SwTableNode* SwDoc::IsIdxInTable(const SwNodeIndex& rIdx) { SwTableNode* pTableNd = 0; sal_uLong nIndex = rIdx.GetIndex(); @@ -227,10 +227,10 @@ SwTableNode* SwDoc::IsIdxInTbl(const SwNodeIndex& rIdx) /** * Insert a new Box before the InsPos */ -bool SwNodes::InsBoxen( SwTableNode* pTblNd, +bool SwNodes::InsBoxen( SwTableNode* pTableNd, SwTableLine* pLine, - SwTableBoxFmt* pBoxFmt, - SwTxtFmtColl* pTxtColl, + SwTableBoxFormat* pBoxFormat, + SwTextFormatColl* pTextColl, const SfxItemSet* pAutoAttr, sal_uInt16 nInsPos, sal_uInt16 nCnt ) @@ -246,30 +246,30 @@ bool SwNodes::InsBoxen( SwTableNode* pTblNd, { if( nInsPos < pLine->GetTabBoxes().size() ) { - if( 0 == (pPrvBox = pLine->FindPreviousBox( pTblNd->GetTable(), + if( 0 == (pPrvBox = pLine->FindPreviousBox( pTableNd->GetTable(), pLine->GetTabBoxes()[ nInsPos ] ))) - pPrvBox = pLine->FindPreviousBox( pTblNd->GetTable() ); + pPrvBox = pLine->FindPreviousBox( pTableNd->GetTable() ); } else { - if( 0 == (pNxtBox = pLine->FindNextBox( pTblNd->GetTable(), + if( 0 == (pNxtBox = pLine->FindNextBox( pTableNd->GetTable(), pLine->GetTabBoxes().back() ))) - pNxtBox = pLine->FindNextBox( pTblNd->GetTable() ); + pNxtBox = pLine->FindNextBox( pTableNd->GetTable() ); } } - else if( 0 == ( pNxtBox = pLine->FindNextBox( pTblNd->GetTable() ))) - pPrvBox = pLine->FindPreviousBox( pTblNd->GetTable() ); + else if( 0 == ( pNxtBox = pLine->FindNextBox( pTableNd->GetTable() ))) + pPrvBox = pLine->FindPreviousBox( pTableNd->GetTable() ); if( !pPrvBox && !pNxtBox ) { bool bSetIdxPos = true; - if( pTblNd->GetTable().GetTabLines().size() && !nInsPos ) + if( pTableNd->GetTable().GetTabLines().size() && !nInsPos ) { - const SwTableLine* pTblLn = pLine; - while( pTblLn->GetUpper() ) - pTblLn = pTblLn->GetUpper()->GetUpper(); + const SwTableLine* pTableLn = pLine; + while( pTableLn->GetUpper() ) + pTableLn = pTableLn->GetUpper()->GetUpper(); - if( pTblNd->GetTable().GetTabLines()[ 0 ] == pTblLn ) + if( pTableNd->GetTable().GetTabLines()[ 0 ] == pTableLn ) { // Before the Table's first Box while( ( pNxtBox = pLine->GetTabBoxes()[0])->GetTabLines().size() ) @@ -280,7 +280,7 @@ bool SwNodes::InsBoxen( SwTableNode* pTblNd, } if( bSetIdxPos ) // Tables without content or at the end; move before the End - nIdxPos = pTblNd->EndOfSectionIndex(); + nIdxPos = pTableNd->EndOfSectionIndex(); } else if( pNxtBox ) // There is a successor nIdxPos = pNxtBox->GetSttIdx(); @@ -292,10 +292,10 @@ bool SwNodes::InsBoxen( SwTableNode* pTblNd, { SwStartNode* pSttNd = new SwStartNode( aEndIdx, ND_STARTNODE, SwTableBoxStartNode ); - pSttNd->pStartOfSection = pTblNd; + pSttNd->pStartOfSection = pTableNd; new SwEndNode( aEndIdx, *pSttNd ); - pPrvBox = new SwTableBox( pBoxFmt, *pSttNd, pLine ); + pPrvBox = new SwTableBox( pBoxFormat, *pSttNd, pLine ); SwTableBoxes & rTabBoxes = pLine->GetTabBoxes(); sal_uInt16 nRealInsPos = nInsPos + n; @@ -304,21 +304,21 @@ bool SwNodes::InsBoxen( SwTableNode* pTblNd, rTabBoxes.insert( rTabBoxes.begin() + nRealInsPos, pPrvBox ); - if( ! pTxtColl->IsAssignedToListLevelOfOutlineStyle() + if( ! pTextColl->IsAssignedToListLevelOfOutlineStyle() //FEATURE::CONDCOLL - && RES_CONDTXTFMTCOLL != pTxtColl->Which() + && RES_CONDTXTFMTCOLL != pTextColl->Which() //FEATURE::CONDCOLL ) - new SwTxtNode( SwNodeIndex( *pSttNd->EndOfSectionNode() ), - pTxtColl, pAutoAttr ); + new SwTextNode( SwNodeIndex( *pSttNd->EndOfSectionNode() ), + pTextColl, pAutoAttr ); else { // Handle Outline numbering correctly! - SwTxtNode* pTNd = new SwTxtNode( + SwTextNode* pTNd = new SwTextNode( SwNodeIndex( *pSttNd->EndOfSectionNode() ), - GetDoc()->GetDfltTxtFmtColl(), + GetDoc()->GetDfltTextFormatColl(), pAutoAttr ); - pTNd->ChgFmtColl( pTxtColl ); + pTNd->ChgFormatColl( pTextColl ); } } return true; @@ -327,10 +327,10 @@ bool SwNodes::InsBoxen( SwTableNode* pTblNd, /** * Insert a new Table */ -const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, +const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts, const SwPosition& rPos, sal_uInt16 nRows, sal_uInt16 nCols, sal_Int16 eAdjust, - const SwTableAutoFmt* pTAFmt, + const SwTableAutoFormat* pTAFormat, const std::vector<sal_uInt16> *pColArr, bool bCalledFromShell, bool bNewModel ) @@ -350,68 +350,68 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, pColArr = 0; } - OUString aTblName = GetUniqueTblName(); + OUString aTableName = GetUniqueTableName(); if( GetIDocumentUndoRedo().DoesUndo() ) { GetIDocumentUndoRedo().AppendUndo( - new SwUndoInsTbl( rPos, nCols, nRows, static_cast<sal_uInt16>(eAdjust), - rInsTblOpts, pTAFmt, pColArr, - aTblName)); + new SwUndoInsTable( rPos, nCols, nRows, static_cast<sal_uInt16>(eAdjust), + rInsTableOpts, pTAFormat, pColArr, + aTableName)); } // Start with inserting the Nodes and get the AutoFormat for the Table - SwTxtFmtColl *pBodyColl = getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_TABLE ), + SwTextFormatColl *pBodyColl = getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TABLE ), *pHeadColl = pBodyColl; - bool bDfltBorders = 0 != ( rInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER ); + bool bDfltBorders = 0 != ( rInsTableOpts.mnInsMode & tabopts::DEFAULT_BORDER ); - if( (rInsTblOpts.mnInsMode & tabopts::HEADLINE) && (1 != nRows || !bDfltBorders) ) - pHeadColl = getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_TABLE_HDLN ); + if( (rInsTableOpts.mnInsMode & tabopts::HEADLINE) && (1 != nRows || !bDfltBorders) ) + pHeadColl = getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TABLE_HDLN ); const sal_uInt16 nRowsToRepeat = - tabopts::HEADLINE == (rInsTblOpts.mnInsMode & tabopts::HEADLINE) ? - rInsTblOpts.mnRowsToRepeat : + tabopts::HEADLINE == (rInsTableOpts.mnInsMode & tabopts::HEADLINE) ? + rInsTableOpts.mnRowsToRepeat : 0; /* Save content node to extract FRAMEDIR from. */ - const SwCntntNode * pCntntNd = rPos.nNode.GetNode().GetCntntNode(); + const SwContentNode * pContentNd = rPos.nNode.GetNode().GetContentNode(); /* If we are called from a shell pass the attrset from - pCntntNd (aka the node the table is inserted at) thus causing + pContentNd (aka the node the table is inserted at) thus causing SwNodes::InsertTable to propagate an adjust item if necessary. */ - SwTableNode *pTblNd = SwNodes::InsertTable( + SwTableNode *pTableNd = SwNodes::InsertTable( rPos.nNode, nCols, pBodyColl, nRows, nRowsToRepeat, pHeadColl, - bCalledFromShell ? &pCntntNd->GetSwAttrSet() : 0 ); + bCalledFromShell ? &pContentNd->GetSwAttrSet() : 0 ); // Create the Box/Line/Table construct - SwTableLineFmt* pLineFmt = MakeTableLineFmt(); - SwTableFmt* pTableFmt = MakeTblFrmFmt( aTblName, GetDfltFrmFmt() ); + SwTableLineFormat* pLineFormat = MakeTableLineFormat(); + SwTableFormat* pTableFormat = MakeTableFrameFormat( aTableName, GetDfltFrameFormat() ); /* If the node to insert the table at is a context node and has a non-default FRAMEDIR propagate it to the table. */ - if (pCntntNd) + if (pContentNd) { - const SwAttrSet & aNdSet = pCntntNd->GetSwAttrSet(); + const SwAttrSet & aNdSet = pContentNd->GetSwAttrSet(); const SfxPoolItem *pItem = NULL; if (SfxItemState::SET == aNdSet.GetItemState( RES_FRAMEDIR, true, &pItem ) && pItem != NULL) { - pTableFmt->SetFmtAttr( *pItem ); + pTableFormat->SetFormatAttr( *pItem ); } } - // Set Orientation at the Table's Fmt - pTableFmt->SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) ); + // Set Orientation at the Table's Format + pTableFormat->SetFormatAttr( SwFormatHoriOrient( 0, eAdjust ) ); // All lines use the left-to-right Fill-Order! - pLineFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT )); + pLineFormat->SetFormatAttr( SwFormatFillOrder( ATT_LEFT_TO_RIGHT )); // Set USHRT_MAX as the Table's default SSize SwTwips nWidth = USHRT_MAX; @@ -423,7 +423,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, { sal_uInt16 nFrmWidth = nLastPos; nLastPos = (*pColArr)[ pColArr->size()-2 ]; - pTableFmt->SetFmtAttr( SvxLRSpaceItem( nSttPos, nFrmWidth - nLastPos, 0, 0, RES_LR_SPACE ) ); + pTableFormat->SetFormatAttr( SvxLRSpaceItem( nSttPos, nFrmWidth - nLastPos, 0, 0, RES_LR_SPACE ) ); } nWidth = nLastPos - nSttPos; } @@ -432,13 +432,13 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, nWidth /= nCols; nWidth *= nCols; // to avoid rounding problems } - pTableFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nWidth )); - if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) ) - pTableFmt->SetFmtAttr( SwFmtLayoutSplit( false )); + pTableFormat->SetFormatAttr( SwFormatFrmSize( ATT_VAR_SIZE, nWidth )); + if( !(rInsTableOpts.mnInsMode & tabopts::SPLIT_LAYOUT) ) + pTableFormat->SetFormatAttr( SwFormatLayoutSplit( false )); // Move the hard PageDesc/PageBreak Attributes if needed - SwCntntNode* pNextNd = GetNodes()[ pTblNd->EndOfSectionIndex()+1 ] - ->GetCntntNode(); + SwContentNode* pNextNd = GetNodes()[ pTableNd->EndOfSectionIndex()+1 ] + ->GetContentNode(); if( pNextNd && pNextNd->HasSwAttrSet() ) { const SfxItemSet* pNdSet = pNextNd->GetpSwAttrSet(); @@ -446,75 +446,75 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, if( SfxItemState::SET == pNdSet->GetItemState( RES_PAGEDESC, false, &pItem ) ) { - pTableFmt->SetFmtAttr( *pItem ); + pTableFormat->SetFormatAttr( *pItem ); pNextNd->ResetAttr( RES_PAGEDESC ); pNdSet = pNextNd->GetpSwAttrSet(); } if( pNdSet && SfxItemState::SET == pNdSet->GetItemState( RES_BREAK, false, &pItem ) ) { - pTableFmt->SetFmtAttr( *pItem ); + pTableFormat->SetFormatAttr( *pItem ); pNextNd->ResetAttr( RES_BREAK ); } } - SwTable& rNdTbl = pTblNd->GetTable(); - rNdTbl.RegisterToFormat( *pTableFmt ); + SwTable& rNdTable = pTableNd->GetTable(); + rNdTable.RegisterToFormat( *pTableFormat ); - rNdTbl.SetRowsToRepeat( nRowsToRepeat ); - rNdTbl.SetTableModel( bNewModel ); + rNdTable.SetRowsToRepeat( nRowsToRepeat ); + rNdTable.SetTableModel( bNewModel ); - std::vector<SwTableBoxFmt*> aBoxFmtArr; - SwTableBoxFmt* pBoxFmt = 0; - if( !bDfltBorders && !pTAFmt ) + std::vector<SwTableBoxFormat*> aBoxFormatArr; + SwTableBoxFormat* pBoxFormat = 0; + if( !bDfltBorders && !pTAFormat ) { - pBoxFmt = MakeTableBoxFmt(); - pBoxFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX / nCols, 0 )); + pBoxFormat = MakeTableBoxFormat(); + pBoxFormat->SetFormatAttr( SwFormatFrmSize( ATT_VAR_SIZE, USHRT_MAX / nCols, 0 )); } else { - const sal_uInt16 nBoxArrLen = pTAFmt ? 16 : 4; - aBoxFmtArr.resize( nBoxArrLen, NULL ); + const sal_uInt16 nBoxArrLen = pTAFormat ? 16 : 4; + aBoxFormatArr.resize( nBoxArrLen, NULL ); } SfxItemSet aCharSet( GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1 ); - SwNodeIndex aNdIdx( *pTblNd, 1 ); // Set to StartNode of first Box - SwTableLines& rLines = rNdTbl.GetTabLines(); + SwNodeIndex aNdIdx( *pTableNd, 1 ); // Set to StartNode of first Box + SwTableLines& rLines = rNdTable.GetTabLines(); for( sal_uInt16 n = 0; n < nRows; ++n ) { - SwTableLine* pLine = new SwTableLine( pLineFmt, nCols, 0 ); + SwTableLine* pLine = new SwTableLine( pLineFormat, nCols, 0 ); rLines.insert( rLines.begin() + n, pLine ); SwTableBoxes& rBoxes = pLine->GetTabBoxes(); for( sal_uInt16 i = 0; i < nCols; ++i ) { - SwTableBoxFmt *pBoxF; - if( pTAFmt ) + SwTableBoxFormat *pBoxF; + if( pTAFormat ) { sal_uInt8 nId = static_cast<sal_uInt8>(!n ? 0 : (( n+1 == nRows ) ? 12 : (4 * (1 + ((n-1) & 1 ))))); nId = nId + static_cast<sal_uInt8>( !i ? 0 : ( i+1 == nCols ? 3 : (1 + ((i-1) & 1)))); - pBoxF = ::lcl_CreateAFmtBoxFmt( *this, aBoxFmtArr, *pTAFmt, + pBoxF = ::lcl_CreateAFormatBoxFormat( *this, aBoxFormatArr, *pTAFormat, nCols, nId ); // Set the Paragraph/Character Attributes if needed - if( pTAFmt->IsFont() || pTAFmt->IsJustify() ) + if( pTAFormat->IsFont() || pTAFormat->IsJustify() ) { aCharSet.ClearItem(); - pTAFmt->UpdateToSet( nId, aCharSet, - SwTableAutoFmt::UPDATE_CHAR, 0 ); + pTAFormat->UpdateToSet( nId, aCharSet, + SwTableAutoFormat::UPDATE_CHAR, 0 ); if( aCharSet.Count() ) - GetNodes()[ aNdIdx.GetIndex()+1 ]->GetCntntNode()-> + GetNodes()[ aNdIdx.GetIndex()+1 ]->GetContentNode()-> SetAttr( aCharSet ); } } else if( bDfltBorders ) { sal_uInt8 nBoxId = (i < nCols - 1 ? 0 : 1) + (n ? 2 : 0 ); - pBoxF = ::lcl_CreateDfltBoxFmt( *this, aBoxFmtArr, nCols, nBoxId); + pBoxF = ::lcl_CreateDfltBoxFormat( *this, aBoxFormatArr, nCols, nBoxId); } else - pBoxF = pBoxFmt; + pBoxF = pBoxFormat; // For AutoFormat on input: the columns are set when inserting the Table // The Array contains the columns positions and not their widths! @@ -525,11 +525,11 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, { if( pBoxF->HasWriterListeners() ) // Create new Format { - SwTableBoxFmt *pNewFmt = MakeTableBoxFmt(); - *pNewFmt = *pBoxF; - pBoxF = pNewFmt; + SwTableBoxFormat *pNewFormat = MakeTableBoxFormat(); + *pNewFormat = *pBoxF; + pBoxF = pNewFormat; } - pBoxF->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nWidth )); + pBoxF->SetFormatAttr( SwFormatFrmSize( ATT_VAR_SIZE, nWidth )); } } @@ -540,12 +540,12 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, } // Insert Frms GetNodes().GoNext( &aNdIdx ); // Go to the next ContentNode - pTblNd->MakeFrms( &aNdIdx ); + pTableNd->MakeFrms( &aNdIdx ); - // To-Do - add 'SwExtraRedlineTbl' also ? - if( getIDocumentRedlineAccess().IsRedlineOn() || (!getIDocumentRedlineAccess().IsIgnoreRedline() && !getIDocumentRedlineAccess().GetRedlineTbl().empty() )) + // To-Do - add 'SwExtraRedlineTable' also ? + if( getIDocumentRedlineAccess().IsRedlineOn() || (!getIDocumentRedlineAccess().IsIgnoreRedline() && !getIDocumentRedlineAccess().GetRedlineTable().empty() )) { - SwPaM aPam( *pTblNd->EndOfSectionNode(), *pTblNd, 1 ); + SwPaM aPam( *pTableNd->EndOfSectionNode(), *pTableNd, 1 ); if( getIDocumentRedlineAccess().IsRedlineOn() ) getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( nsRedlineType_t::REDLINE_INSERT, aPam ), true); else @@ -553,42 +553,42 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, } getIDocumentState().SetModified(); - CHECK_TABLE(rNdTbl); - return &rNdTbl; + CHECK_TABLE(rNdTable); + return &rNdTable; } SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx, sal_uInt16 nBoxes, - SwTxtFmtColl* pCntntTxtColl, + SwTextFormatColl* pContentTextColl, sal_uInt16 nLines, sal_uInt16 nRepeat, - SwTxtFmtColl* pHeadlineTxtColl, + SwTextFormatColl* pHeadlineTextColl, const SwAttrSet * pAttrSet) { if( !nBoxes ) return 0; // If Lines is given, create the Matrix from Lines and Boxes - if( !pHeadlineTxtColl || !nLines ) - pHeadlineTxtColl = pCntntTxtColl; + if( !pHeadlineTextColl || !nLines ) + pHeadlineTextColl = pContentTextColl; - SwTableNode * pTblNd = new SwTableNode( rNdIdx ); - SwEndNode* pEndNd = new SwEndNode( rNdIdx, *pTblNd ); + SwTableNode * pTableNd = new SwTableNode( rNdIdx ); + SwEndNode* pEndNd = new SwEndNode( rNdIdx, *pTableNd ); if( !nLines ) // For the for loop ++nLines; SwNodeIndex aIdx( *pEndNd ); - SwTxtFmtColl* pTxtColl = pHeadlineTxtColl; + SwTextFormatColl* pTextColl = pHeadlineTextColl; for( sal_uInt16 nL = 0; nL < nLines; ++nL ) { for( sal_uInt16 nB = 0; nB < nBoxes; ++nB ) { SwStartNode* pSttNd = new SwStartNode( aIdx, ND_STARTNODE, SwTableBoxStartNode ); - pSttNd->pStartOfSection = pTblNd; + pSttNd->pStartOfSection = pTableNd; - SwTxtNode * pTmpNd = new SwTxtNode( aIdx, pTxtColl ); + SwTextNode * pTmpNd = new SwTextNode( aIdx, pTextColl ); // #i60422# Propagate some more attributes. const SfxPoolItem* pItem = NULL; @@ -605,7 +605,7 @@ SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx, { if ( SfxItemState::SET != pTmpNd->GetSwAttrSet().GetItemState( *pIdx ) && SfxItemState::SET == pAttrSet->GetItemState( *pIdx, true, &pItem ) ) - static_cast<SwCntntNode *>(pTmpNd)->SetAttr(*pItem); + static_cast<SwContentNode *>(pTmpNd)->SetAttr(*pItem); ++pIdx; } } @@ -613,41 +613,41 @@ SwTableNode* SwNodes::InsertTable( const SwNodeIndex& rNdIdx, new SwEndNode( aIdx, *pSttNd ); } if ( nL + 1 >= nRepeat ) - pTxtColl = pCntntTxtColl; + pTextColl = pContentTextColl; } - return pTblNd; + return pTableNd; } /** * Text to Table */ -const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, +const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTableOpts, const SwPaM& rRange, sal_Unicode cCh, sal_Int16 eAdjust, - const SwTableAutoFmt* pTAFmt ) + const SwTableAutoFormat* pTAFormat ) { // See if the selection contains a Table const SwPosition *pStt = rRange.Start(), *pEnd = rRange.End(); { sal_uLong nCnt = pStt->nNode.GetIndex(); for( ; nCnt <= pEnd->nNode.GetIndex(); ++nCnt ) - if( !GetNodes()[ nCnt ]->IsTxtNode() ) + if( !GetNodes()[ nCnt ]->IsTextNode() ) return 0; } // Save first node in the selection if it is a context node - SwCntntNode * pSttCntntNd = pStt->nNode.GetNode().GetCntntNode(); + SwContentNode * pSttContentNd = pStt->nNode.GetNode().GetContentNode(); SwPaM aOriginal( *pStt, *pEnd ); pStt = aOriginal.GetMark(); pEnd = aOriginal.GetPoint(); - SwUndoTxtToTbl* pUndo = 0; + SwUndoTextToTable* pUndo = 0; if( GetIDocumentUndoRedo().DoesUndo() ) { GetIDocumentUndoRedo().StartUndo( UNDO_TEXTTOTABLE, NULL ); - pUndo = new SwUndoTxtToTbl( aOriginal, rInsTblOpts, cCh, - static_cast<sal_uInt16>(eAdjust), pTAFmt ); + pUndo = new SwUndoTextToTable( aOriginal, rInsTableOpts, cCh, + static_cast<sal_uInt16>(eAdjust), pTAFormat ); GetIDocumentUndoRedo().AppendUndo( pUndo ); // Do not add splitting the TextNode to the Undo history @@ -661,18 +661,18 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, if( pStt->nContent.GetIndex() ) getIDocumentContentOperations().SplitNode( *pStt, false ); - bool bEndCntnt = 0 != pEnd->nContent.GetIndex(); + bool bEndContent = 0 != pEnd->nContent.GetIndex(); // Do not split at the End of a Line (except at the End of the Doc) - if( bEndCntnt ) + if( bEndContent ) { - if( pEnd->nNode.GetNode().GetCntntNode()->Len() != pEnd->nContent.GetIndex() + if( pEnd->nNode.GetNode().GetContentNode()->Len() != pEnd->nContent.GetIndex() || pEnd->nNode.GetIndex() >= GetNodes().GetEndOfContent().GetIndex()-1 ) { getIDocumentContentOperations().SplitNode( *pEnd, false ); --((SwNodeIndex&)pEnd->nNode); ((SwIndex&)pEnd->nContent).Assign( - pEnd->nNode.GetNode().GetCntntNode(), 0 ); + pEnd->nNode.GetNode().GetContentNode(), 0 ); // A Node and at the End? if( pStt->nNode.GetIndex() >= pEnd->nNode.GetIndex() ) --aRg.aStart; @@ -693,78 +693,78 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, GetIDocumentUndoRedo().DoUndo( 0 != pUndo ); // Create the Box/Line/Table construct - SwTableBoxFmt* pBoxFmt = MakeTableBoxFmt(); - SwTableLineFmt* pLineFmt = MakeTableLineFmt(); - SwTableFmt* pTableFmt = MakeTblFrmFmt( GetUniqueTblName(), GetDfltFrmFmt() ); + SwTableBoxFormat* pBoxFormat = MakeTableBoxFormat(); + SwTableLineFormat* pLineFormat = MakeTableLineFormat(); + SwTableFormat* pTableFormat = MakeTableFrameFormat( GetUniqueTableName(), GetDfltFrameFormat() ); // All Lines have a left-to-right Fill Order - pLineFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT )); + pLineFormat->SetFormatAttr( SwFormatFillOrder( ATT_LEFT_TO_RIGHT )); // The Table's SSize is USHRT_MAX - pTableFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX )); - if( !(rInsTblOpts.mnInsMode & tabopts::SPLIT_LAYOUT) ) - pTableFmt->SetFmtAttr( SwFmtLayoutSplit( false )); + pTableFormat->SetFormatAttr( SwFormatFrmSize( ATT_VAR_SIZE, USHRT_MAX )); + if( !(rInsTableOpts.mnInsMode & tabopts::SPLIT_LAYOUT) ) + pTableFormat->SetFormatAttr( SwFormatLayoutSplit( false )); /* If the first node in the selection is a context node and if it has an item FRAMEDIR set (no default) propagate the item to the replacing table. */ - if (pSttCntntNd) + if (pSttContentNd) { - const SwAttrSet & aNdSet = pSttCntntNd->GetSwAttrSet(); + const SwAttrSet & aNdSet = pSttContentNd->GetSwAttrSet(); const SfxPoolItem *pItem = NULL; if (SfxItemState::SET == aNdSet.GetItemState( RES_FRAMEDIR, true, &pItem ) && pItem != NULL) { - pTableFmt->SetFmtAttr( *pItem ); + pTableFormat->SetFormatAttr( *pItem ); } } - SwTableNode* pTblNd = GetNodes().TextToTable( - aRg, cCh, pTableFmt, pLineFmt, pBoxFmt, - getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_STANDARD ), pUndo ); + SwTableNode* pTableNd = GetNodes().TextToTable( + aRg, cCh, pTableFormat, pLineFormat, pBoxFormat, + getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ), pUndo ); - SwTable& rNdTbl = pTblNd->GetTable(); + SwTable& rNdTable = pTableNd->GetTable(); const sal_uInt16 nRowsToRepeat = - tabopts::HEADLINE == (rInsTblOpts.mnInsMode & tabopts::HEADLINE) ? - rInsTblOpts.mnRowsToRepeat : + tabopts::HEADLINE == (rInsTableOpts.mnInsMode & tabopts::HEADLINE) ? + rInsTableOpts.mnRowsToRepeat : 0; - rNdTbl.SetRowsToRepeat(nRowsToRepeat); + rNdTable.SetRowsToRepeat(nRowsToRepeat); - bool bUseBoxFmt = false; - if( !pBoxFmt->HasWriterListeners() ) + bool bUseBoxFormat = false; + if( !pBoxFormat->HasWriterListeners() ) { // The Box's Formats already have the right size, we must only set - // the right Border/AutoFmt. - bUseBoxFmt = true; - pTableFmt->SetFmtAttr( pBoxFmt->GetFrmSize() ); - delete pBoxFmt; + // the right Border/AutoFormat. + bUseBoxFormat = true; + pTableFormat->SetFormatAttr( pBoxFormat->GetFrmSize() ); + delete pBoxFormat; eAdjust = text::HoriOrientation::NONE; } - // Set Orientation in the Table's Fmt - pTableFmt->SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) ); + // Set Orientation in the Table's Format + pTableFormat->SetFormatAttr( SwFormatHoriOrient( 0, eAdjust ) ); - if( pTAFmt || ( rInsTblOpts.mnInsMode & tabopts::DEFAULT_BORDER) ) + if( pTAFormat || ( rInsTableOpts.mnInsMode & tabopts::DEFAULT_BORDER) ) { - sal_uInt8 nBoxArrLen = pTAFmt ? 16 : 4; - std::unique_ptr< DfltBoxAttrList_t > aBoxFmtArr1; - std::unique_ptr< std::vector<SwTableBoxFmt*> > aBoxFmtArr2; - if( bUseBoxFmt ) + sal_uInt8 nBoxArrLen = pTAFormat ? 16 : 4; + std::unique_ptr< DfltBoxAttrList_t > aBoxFormatArr1; + std::unique_ptr< std::vector<SwTableBoxFormat*> > aBoxFormatArr2; + if( bUseBoxFormat ) { - aBoxFmtArr1.reset(new DfltBoxAttrList_t( nBoxArrLen, NULL )); + aBoxFormatArr1.reset(new DfltBoxAttrList_t( nBoxArrLen, NULL )); } else { - aBoxFmtArr2.reset(new std::vector<SwTableBoxFmt*>( nBoxArrLen, NULL )); + aBoxFormatArr2.reset(new std::vector<SwTableBoxFormat*>( nBoxArrLen, NULL )); } SfxItemSet aCharSet( GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1 ); SwHistory* pHistory = pUndo ? &pUndo->GetHistory() : 0; - SwTableBoxFmt *pBoxF = 0; - SwTableLines& rLines = rNdTbl.GetTabLines(); + SwTableBoxFormat *pBoxF = 0; + SwTableLines& rLines = rNdTable.GetTabLines(); const SwTableLines::size_type nRows = rLines.size(); for( SwTableLines::size_type n = 0; n < nRows; ++n ) { @@ -775,34 +775,34 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, SwTableBox* pBox = rBoxes[ i ]; bool bChgSz = false; - if( pTAFmt ) + if( pTAFormat ) { sal_uInt8 nId = static_cast<sal_uInt8>(!n ? 0 : (( n+1 == nRows ) ? 12 : (4 * (1 + ((n-1) & 1 ))))); nId = nId + static_cast<sal_uInt8>(!i ? 0 : ( i+1 == nCols ? 3 : (1 + ((i-1) & 1)))); - if( bUseBoxFmt ) - ::lcl_SetDfltBoxAttr( *pBox, *aBoxFmtArr1, nId, pTAFmt ); + if( bUseBoxFormat ) + ::lcl_SetDfltBoxAttr( *pBox, *aBoxFormatArr1, nId, pTAFormat ); else { - bChgSz = 0 == (*aBoxFmtArr2)[ nId ]; - pBoxF = ::lcl_CreateAFmtBoxFmt( *this, *aBoxFmtArr2, - *pTAFmt, USHRT_MAX, nId ); + bChgSz = 0 == (*aBoxFormatArr2)[ nId ]; + pBoxF = ::lcl_CreateAFormatBoxFormat( *this, *aBoxFormatArr2, + *pTAFormat, USHRT_MAX, nId ); } // Set Paragraph/Character Attributes if needed - if( pTAFmt->IsFont() || pTAFmt->IsJustify() ) + if( pTAFormat->IsFont() || pTAFormat->IsJustify() ) { aCharSet.ClearItem(); - pTAFmt->UpdateToSet( nId, aCharSet, - SwTableAutoFmt::UPDATE_CHAR, 0 ); + pTAFormat->UpdateToSet( nId, aCharSet, + SwTableAutoFormat::UPDATE_CHAR, 0 ); if( aCharSet.Count() ) { sal_uLong nSttNd = pBox->GetSttIdx()+1; sal_uLong nEndNd = pBox->GetSttNd()->EndOfSectionIndex(); for( ; nSttNd < nEndNd; ++nSttNd ) { - SwCntntNode* pNd = GetNodes()[ nSttNd ]->GetCntntNode(); + SwContentNode* pNd = GetNodes()[ nSttNd ]->GetContentNode(); if( pNd ) { if( pHistory ) @@ -820,51 +820,51 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, else { sal_uInt8 nId = (i < nCols - 1 ? 0 : 1) + (n ? 2 : 0 ); - if( bUseBoxFmt ) - ::lcl_SetDfltBoxAttr( *pBox, *aBoxFmtArr1, nId ); + if( bUseBoxFormat ) + ::lcl_SetDfltBoxAttr( *pBox, *aBoxFormatArr1, nId ); else { - bChgSz = 0 == (*aBoxFmtArr2)[ nId ]; - pBoxF = ::lcl_CreateDfltBoxFmt( *this, *aBoxFmtArr2, + bChgSz = 0 == (*aBoxFormatArr2)[ nId ]; + pBoxF = ::lcl_CreateDfltBoxFormat( *this, *aBoxFormatArr2, USHRT_MAX, nId ); } } - if( !bUseBoxFmt ) + if( !bUseBoxFormat ) { if( bChgSz ) - pBoxF->SetFmtAttr( pBox->GetFrmFmt()->GetFrmSize() ); - pBox->ChgFrmFmt( pBoxF ); + pBoxF->SetFormatAttr( pBox->GetFrameFormat()->GetFrmSize() ); + pBox->ChgFrameFormat( pBoxF ); } } } - if( bUseBoxFmt ) + if( bUseBoxFormat ) { for( sal_uInt8 i = 0; i < nBoxArrLen; ++i ) { - delete (*aBoxFmtArr1)[ i ]; + delete (*aBoxFormatArr1)[ i ]; } } } // Check the boxes for numbers - if( IsInsTblFormatNum() ) + if( IsInsTableFormatNum() ) { - for (size_t nBoxes = rNdTbl.GetTabSortBoxes().size(); nBoxes; ) + for (size_t nBoxes = rNdTable.GetTabSortBoxes().size(); nBoxes; ) { - ChkBoxNumFmt(*rNdTbl.GetTabSortBoxes()[ --nBoxes ], false); + ChkBoxNumFormat(*rNdTable.GetTabSortBoxes()[ --nBoxes ], false); } } - sal_uLong nIdx = pTblNd->GetIndex(); + sal_uLong nIdx = pTableNd->GetIndex(); aNode2Layout.RestoreUpperFrms( GetNodes(), nIdx, nIdx + 1 ); { SwPaM& rTmp = (SwPaM&)rRange; // Point always at the Start rTmp.DeleteMark(); - rTmp.GetPoint()->nNode = *pTblNd; - SwCntntNode* pCNd = GetNodes().GoNext( &rTmp.GetPoint()->nNode ); + rTmp.GetPoint()->nNode = *pTableNd; + SwContentNode* pCNd = GetNodes().GoNext( &rTmp.GetPoint()->nNode ); rTmp.GetPoint()->nContent.Assign( pCNd, 0 ); } @@ -875,44 +875,44 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTblOpts, getIDocumentState().SetModified(); getIDocumentFieldsAccess().SetFieldsDirty(true, NULL, 0); - return &rNdTbl; + return &rNdTable; } -static void lcl_RemoveBreaks(SwCntntNode & rNode, SwTableFmt *const pTableFmt) +static void lcl_RemoveBreaks(SwContentNode & rNode, SwTableFormat *const pTableFormat) { // delete old layout frames, new ones need to be created... rNode.DelFrms(); - if (!rNode.IsTxtNode()) + if (!rNode.IsTextNode()) { return; } - SwTxtNode & rTxtNode = *rNode.GetTxtNode(); + SwTextNode & rTextNode = *rNode.GetTextNode(); // remove PageBreaks/PageDesc/ColBreak - SfxItemSet const* pSet = rTxtNode.GetpSwAttrSet(); + SfxItemSet const* pSet = rTextNode.GetpSwAttrSet(); if (pSet) { const SfxPoolItem* pItem; if (SfxItemState::SET == pSet->GetItemState(RES_BREAK, false, &pItem)) { - if (pTableFmt) + if (pTableFormat) { - pTableFmt->SetFmtAttr(*pItem); + pTableFormat->SetFormatAttr(*pItem); } - rTxtNode.ResetAttr(RES_BREAK); - pSet = rTxtNode.GetpSwAttrSet(); + rTextNode.ResetAttr(RES_BREAK); + pSet = rTextNode.GetpSwAttrSet(); } if (pSet && (SfxItemState::SET == pSet->GetItemState(RES_PAGEDESC, false, &pItem)) - && static_cast<SwFmtPageDesc const*>(pItem)->GetPageDesc()) + && static_cast<SwFormatPageDesc const*>(pItem)->GetPageDesc()) { - if (pTableFmt) + if (pTableFormat) { - pTableFmt->SetFmtAttr(*pItem); + pTableFormat->SetFormatAttr(*pItem); } - rTxtNode.ResetAttr(RES_PAGEDESC); + rTextNode.ResetAttr(RES_PAGEDESC); } } } @@ -922,8 +922,8 @@ static void lcl_RemoveBreaks(SwCntntNode & rNode, SwTableFmt *const pTableFmt) */ static void lcl_BalanceTable(SwTable & rTable, size_t const nMaxBoxes, - SwTableNode & rTblNd, SwTableBoxFmt & rBoxFmt, SwTxtFmtColl & rTxtColl, - SwUndoTxtToTbl *const pUndo, std::vector<sal_uInt16> *const pPositions) + SwTableNode & rTableNd, SwTableBoxFormat & rBoxFormat, SwTextFormatColl & rTextColl, + SwUndoTextToTable *const pUndo, std::vector<sal_uInt16> *const pPositions) { for (size_t n = 0; n < rTable.GetTabLines().size(); ++n) { @@ -931,7 +931,7 @@ lcl_BalanceTable(SwTable & rTable, size_t const nMaxBoxes, size_t const nBoxes = pCurrLine->GetTabBoxes().size(); if (nMaxBoxes != nBoxes) { - rTblNd.GetNodes().InsBoxen(&rTblNd, pCurrLine, &rBoxFmt, &rTxtColl, + rTableNd.GetNodes().InsBoxen(&rTableNd, pCurrLine, &rBoxFormat, &rTextColl, 0, nBoxes, nMaxBoxes - nBoxes); if (pUndo) @@ -953,7 +953,7 @@ lcl_BalanceTable(SwTable & rTable, size_t const nMaxBoxes, static void lcl_SetTableBoxWidths(SwTable & rTable, size_t const nMaxBoxes, - SwTableBoxFmt & rBoxFmt, SwDoc & rDoc, + SwTableBoxFormat & rBoxFormat, SwDoc & rDoc, std::vector<sal_uInt16> *const pPositions) { if (pPositions && !pPositions->empty()) @@ -962,71 +962,71 @@ lcl_SetTableBoxWidths(SwTable & rTable, size_t const nMaxBoxes, sal_uInt16 nLastPos = 0; for (size_t n = 0; n < pPositions->size(); ++n) { - SwTableBoxFmt *pNewFmt = rDoc.MakeTableBoxFmt(); - pNewFmt->SetFmtAttr( - SwFmtFrmSize(ATT_VAR_SIZE, (*pPositions)[n] - nLastPos)); + SwTableBoxFormat *pNewFormat = rDoc.MakeTableBoxFormat(); + pNewFormat->SetFormatAttr( + SwFormatFrmSize(ATT_VAR_SIZE, (*pPositions)[n] - nLastPos)); for (size_t nTmpLine = 0; nTmpLine < rLns.size(); ++nTmpLine) { // Have to do an Add here, because the BoxFormat // is still needed by the caller - pNewFmt->Add( rLns[ nTmpLine ]->GetTabBoxes()[ n ] ); + pNewFormat->Add( rLns[ nTmpLine ]->GetTabBoxes()[ n ] ); } nLastPos = (*pPositions)[ n ]; } // propagate size upwards from format, so the table gets the right size - SAL_WARN_IF(rBoxFmt.HasWriterListeners(), "sw.core", + SAL_WARN_IF(rBoxFormat.HasWriterListeners(), "sw.core", "who is still registered in the format?"); - rBoxFmt.SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nLastPos )); + rBoxFormat.SetFormatAttr( SwFormatFrmSize( ATT_VAR_SIZE, nLastPos )); } else { size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX; - rBoxFmt.SetFmtAttr(SwFmtFrmSize(ATT_VAR_SIZE, nWidth)); + rBoxFormat.SetFormatAttr(SwFormatFrmSize(ATT_VAR_SIZE, nWidth)); } } SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, - SwTableFmt* pTblFmt, - SwTableLineFmt* pLineFmt, - SwTableBoxFmt* pBoxFmt, - SwTxtFmtColl* pTxtColl, - SwUndoTxtToTbl* pUndo ) + SwTableFormat* pTableFormat, + SwTableLineFormat* pLineFormat, + SwTableBoxFormat* pBoxFormat, + SwTextFormatColl* pTextColl, + SwUndoTextToTable* pUndo ) { if( rRange.aStart >= rRange.aEnd ) return 0; - SwTableNode * pTblNd = new SwTableNode( rRange.aStart ); - new SwEndNode( rRange.aEnd, *pTblNd ); + SwTableNode * pTableNd = new SwTableNode( rRange.aStart ); + new SwEndNode( rRange.aEnd, *pTableNd ); SwDoc* pDoc = GetDoc(); std::vector<sal_uInt16> aPosArr; - SwTable& rTable = pTblNd->GetTable(); + SwTable& rTable = pTableNd->GetTable(); SwTableBox* pBox; sal_uInt16 nBoxes, nLines, nMaxBoxes = 0; - SwNodeIndex aSttIdx( *pTblNd, 1 ); + SwNodeIndex aSttIdx( *pTableNd, 1 ); SwNodeIndex aEndIdx( rRange.aEnd, -1 ); for( nLines = 0, nBoxes = 0; aSttIdx.GetIndex() < aEndIdx.GetIndex(); aSttIdx += 2, nLines++, nBoxes = 0 ) { - SwTxtNode* pTxtNd = aSttIdx.GetNode().GetTxtNode(); - OSL_ENSURE( pTxtNd, "Only add TextNodes to the Table" ); + SwTextNode* pTextNd = aSttIdx.GetNode().GetTextNode(); + OSL_ENSURE( pTextNd, "Only add TextNodes to the Table" ); if( !nLines && 0x0b == cCh ) { cCh = 0x09; // Get the separator's position from the first Node, in order for the Boxes to be set accordingly - SwTxtFrmInfo aFInfo( static_cast<SwTxtFrm*>(pTxtNd->getLayoutFrm( pTxtNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() )) ); + SwTextFrmInfo aFInfo( static_cast<SwTextFrm*>(pTextNd->getLayoutFrm( pTextNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() )) ); if( aFInfo.IsOneLine() ) // only makes sense in this case { - OUString const& rTxt(pTxtNd->GetTxt()); - for (sal_Int32 nChPos = 0; nChPos < rTxt.getLength(); ++nChPos) + OUString const& rText(pTextNd->GetText()); + for (sal_Int32 nChPos = 0; nChPos < rText.getLength(); ++nChPos) { - if (rTxt[nChPos] == cCh) + if (rText[nChPos] == cCh) { aPosArr.push_back( static_cast<sal_uInt16>( aFInfo.GetCharPos( nChPos+1, false )) ); @@ -1041,34 +1041,34 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, } } - lcl_RemoveBreaks(*pTxtNd, (0 == nLines) ? pTblFmt : 0); + lcl_RemoveBreaks(*pTextNd, (0 == nLines) ? pTableFormat : 0); // Set the TableNode as StartNode for all TextNodes in the Table - pTxtNd->pStartOfSection = pTblNd; + pTextNd->pStartOfSection = pTableNd; - SwTableLine* pLine = new SwTableLine( pLineFmt, 1, 0 ); + SwTableLine* pLine = new SwTableLine( pLineFormat, 1, 0 ); rTable.GetTabLines().insert(rTable.GetTabLines().begin() + nLines, pLine); SwStartNode* pSttNd; - SwPosition aCntPos( aSttIdx, SwIndex( pTxtNd )); + SwPosition aCntPos( aSttIdx, SwIndex( pTextNd )); - const std::shared_ptr< sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); - pCntntStore->Save( pDoc, aSttIdx.GetIndex(), pTxtNd->GetTxt().getLength() ); + const std::shared_ptr< sw::mark::ContentIdxStore> pContentStore(sw::mark::ContentIdxStore::Create()); + pContentStore->Save( pDoc, aSttIdx.GetIndex(), pTextNd->GetText().getLength() ); if( T2T_PARA != cCh ) { - for (sal_Int32 nChPos = 0; nChPos < pTxtNd->GetTxt().getLength();) + for (sal_Int32 nChPos = 0; nChPos < pTextNd->GetText().getLength();) { - if (pTxtNd->GetTxt()[nChPos] == cCh) + if (pTextNd->GetText()[nChPos] == cCh) { aCntPos.nContent = nChPos; - SwCntntNode* pNewNd = pTxtNd->SplitCntntNode( aCntPos ); + SwContentNode* pNewNd = pTextNd->SplitContentNode( aCntPos ); - if( !pCntntStore->Empty() ) - pCntntStore->Restore( *pNewNd, nChPos, nChPos + 1 ); + if( !pContentStore->Empty() ) + pContentStore->Restore( *pNewNd, nChPos, nChPos + 1 ); // Delete separator and correct search string - pTxtNd->EraseText( aCntPos.nContent, 1 ); + pTextNd->EraseText( aCntPos.nContent, 1 ); nChPos = 0; // Set the TableNode as StartNode for all TextNodes in the Table @@ -1079,7 +1079,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, pNewNd->pStartOfSection = pSttNd; // Assign Section to the Box - pBox = new SwTableBox( pBoxFmt, *pSttNd, pLine ); + pBox = new SwTableBox( pBoxFormat, *pSttNd, pLine ); pLine->GetTabBoxes().insert( pLine->GetTabBoxes().begin() + nBoxes++, pBox ); } else @@ -1090,26 +1090,26 @@ SwTableNode* SwNodes::TextToTable( const SwNodeRange& rRange, sal_Unicode cCh, } // Now for the last substring - if( !pCntntStore->Empty()) - pCntntStore->Restore( *pTxtNd, pTxtNd->GetTxt().getLength(), pTxtNd->GetTxt().getLength()+1 ); + if( !pContentStore->Empty()) + pContentStore->Restore( *pTextNd, pTextNd->GetText().getLength(), pTextNd->GetText().getLength()+1 ); pSttNd = new SwStartNode( aCntPos.nNode, ND_STARTNODE, SwTableBoxStartNode ); const SwNodeIndex aTmpIdx( aCntPos.nNode, 1 ); new SwEndNode( aTmpIdx, *pSttNd ); - pTxtNd->pStartOfSection = pSttNd; + pTextNd->pStartOfSection = pSttNd; - pBox = new SwTableBox( pBoxFmt, *pSttNd, pLine ); + pBox = new SwTableBox( pBoxFormat, *pSttNd, pLine ); pLine->GetTabBoxes().insert( pLine->GetTabBoxes().begin() + nBoxes++, pBox ); if( nMaxBoxes < nBoxes ) nMaxBoxes = nBoxes; } - lcl_BalanceTable(rTable, nMaxBoxes, *pTblNd, *pBoxFmt, *pTxtColl, + lcl_BalanceTable(rTable, nMaxBoxes, *pTableNd, *pBoxFormat, *pTextColl, pUndo, &aPosArr); - rTable.RegisterToFormat(*pTblFmt); - lcl_SetTableBoxWidths(rTable, nMaxBoxes, *pBoxFmt, *pDoc, &aPosArr); + rTable.RegisterToFormat(*pTableFormat); + lcl_SetTableBoxWidths(rTable, nMaxBoxes, *pBoxFormat, *pDoc, &aPosArr); - return pTblNd; + return pTableNd; } const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >& rTableNodes ) @@ -1128,7 +1128,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > return NULL; /* Save first node in the selection if it is a content node. */ - SwCntntNode * pSttCntntNd = rFirstRange.begin()->aStart.GetNode().GetCntntNode(); + SwContentNode * pSttContentNd = rFirstRange.begin()->aStart.GetNode().GetContentNode(); const SwNodeRange& rStartRange = *rFirstRange.begin(); const SwNodeRange& rEndRange = *rLastRange.rbegin(); @@ -1152,18 +1152,18 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > if( pStt->nContent.GetIndex() ) getIDocumentContentOperations().SplitNode( *pStt, false ); - bool bEndCntnt = 0 != pEnd->nContent.GetIndex(); + bool bEndContent = 0 != pEnd->nContent.GetIndex(); // Do not split at the End of a Line (except at the End of the Doc) - if( bEndCntnt ) + if( bEndContent ) { - if( pEnd->nNode.GetNode().GetCntntNode()->Len() != pEnd->nContent.GetIndex() + if( pEnd->nNode.GetNode().GetContentNode()->Len() != pEnd->nContent.GetIndex() || pEnd->nNode.GetIndex() >= GetNodes().GetEndOfContent().GetIndex()-1 ) { getIDocumentContentOperations().SplitNode( *pEnd, false ); --((SwNodeIndex&)pEnd->nNode); ((SwIndex&)pEnd->nContent).Assign( - pEnd->nNode.GetNode().GetCntntNode(), 0 ); + pEnd->nNode.GetNode().GetContentNode(), 0 ); // A Node and at the End? if( pStt->nNode.GetIndex() >= pEnd->nNode.GetIndex() ) --aRg.aStart; @@ -1193,16 +1193,16 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > { assert(SwNodeIndex(*pPrev, +1) == cell->aStart); SwPaM pam(cell->aStart, 0, *pPrev, - (pPrev->GetNode().IsCntntNode()) - ? pPrev->GetNode().GetCntntNode()->Len() : 0); + (pPrev->GetNode().IsContentNode()) + ? pPrev->GetNode().GetContentNode()->Len() : 0); rIDRA.SplitRedline(pam); pPrev = &cell->aEnd; } } // another one to break between last cell and node after table SwPaM pam(SwNodeIndex(*pPrev, +1), 0, *pPrev, - (pPrev->GetNode().IsCntntNode()) - ? pPrev->GetNode().GetCntntNode()->Len() : 0); + (pPrev->GetNode().IsContentNode()) + ? pPrev->GetNode().GetContentNode()->Len() : 0); rIDRA.SplitRedline(pam); } @@ -1212,50 +1212,50 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > GetIDocumentUndoRedo().DoUndo(bUndo); // Create the Box/Line/Table construct - SwTableBoxFmt* pBoxFmt = MakeTableBoxFmt(); - SwTableLineFmt* pLineFmt = MakeTableLineFmt(); - SwTableFmt* pTableFmt = MakeTblFrmFmt( GetUniqueTblName(), GetDfltFrmFmt() ); + SwTableBoxFormat* pBoxFormat = MakeTableBoxFormat(); + SwTableLineFormat* pLineFormat = MakeTableLineFormat(); + SwTableFormat* pTableFormat = MakeTableFrameFormat( GetUniqueTableName(), GetDfltFrameFormat() ); // All Lines have a left-to-right Fill Order - pLineFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT )); + pLineFormat->SetFormatAttr( SwFormatFillOrder( ATT_LEFT_TO_RIGHT )); // The Table's SSize is USHRT_MAX - pTableFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX )); + pTableFormat->SetFormatAttr( SwFormatFrmSize( ATT_VAR_SIZE, USHRT_MAX )); /* If the first node in the selection is a context node and if it has an item FRAMEDIR set (no default) propagate the item to the replacing table. */ - if (pSttCntntNd) + if (pSttContentNd) { - const SwAttrSet & aNdSet = pSttCntntNd->GetSwAttrSet(); + const SwAttrSet & aNdSet = pSttContentNd->GetSwAttrSet(); const SfxPoolItem *pItem = NULL; if (SfxItemState::SET == aNdSet.GetItemState( RES_FRAMEDIR, true, &pItem ) && pItem != NULL) { - pTableFmt->SetFmtAttr( *pItem ); + pTableFormat->SetFormatAttr( *pItem ); } } - SwTableNode* pTblNd = GetNodes().TextToTable( - rTableNodes, pTableFmt, pLineFmt, pBoxFmt, - getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_STANDARD )/*, pUndo*/ ); + SwTableNode* pTableNd = GetNodes().TextToTable( + rTableNodes, pTableFormat, pLineFormat, pBoxFormat, + getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD )/*, pUndo*/ ); - SwTable& rNdTbl = pTblNd->GetTable(); + SwTable& rNdTable = pTableNd->GetTable(); - if( !pBoxFmt->HasWriterListeners() ) + if( !pBoxFormat->HasWriterListeners() ) { // The Box's Formats already have the right size, we must only set - // the right Border/AutoFmt. - pTableFmt->SetFmtAttr( pBoxFmt->GetFrmSize() ); - delete pBoxFmt; + // the right Border/AutoFormat. + pTableFormat->SetFormatAttr( pBoxFormat->GetFrmSize() ); + delete pBoxFormat; } - sal_uLong nIdx = pTblNd->GetIndex(); + sal_uLong nIdx = pTableNd->GetIndex(); aNode2Layout.RestoreUpperFrms( GetNodes(), nIdx, nIdx + 1 ); getIDocumentState().SetModified(); getIDocumentFieldsAccess().SetFieldsDirty( true, NULL, 0 ); - return &rNdTbl; + return &rNdTable; } SwNodeRange * SwNodes::ExpandRangeForTableBox(const SwNodeRange & rRange) @@ -1322,7 +1322,7 @@ SwNodeRange * SwNodes::ExpandRangeForTableBox(const SwNodeRange & rRange) static void lcl_SetTableBoxWidths2(SwTable & rTable, size_t const nMaxBoxes, - SwTableBoxFmt & rBoxFmt, SwDoc & rDoc) + SwTableBoxFormat & rBoxFormat, SwDoc & rDoc) { // rhbz#820283, fdo#55462: set default box widths so table width is covered SwTableLines & rLines = rTable.GetTabLines(); @@ -1333,35 +1333,35 @@ lcl_SetTableBoxWidths2(SwTable & rTable, size_t const nMaxBoxes, if (nMissing) { // default width for box at the end of an incomplete line - SwTableBoxFmt *const pNewFmt = rDoc.MakeTableBoxFmt(); + SwTableBoxFormat *const pNewFormat = rDoc.MakeTableBoxFormat(); size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX; - pNewFmt->SetFmtAttr( SwFmtFrmSize(ATT_VAR_SIZE, + pNewFormat->SetFormatAttr( SwFormatFrmSize(ATT_VAR_SIZE, nWidth * (nMissing + 1)) ); - pNewFmt->Add(rBoxes.back()); + pNewFormat->Add(rBoxes.back()); } } size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX; // default width for all boxes not at the end of an incomplete line - rBoxFmt.SetFmtAttr(SwFmtFrmSize(ATT_VAR_SIZE, nWidth)); + rBoxFormat.SetFormatAttr(SwFormatFrmSize(ATT_VAR_SIZE, nWidth)); } SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes, - SwTableFmt* pTblFmt, - SwTableLineFmt* pLineFmt, - SwTableBoxFmt* pBoxFmt, - SwTxtFmtColl* /*pTxtColl*/ /*, SwUndo... pUndo*/ ) + SwTableFormat* pTableFormat, + SwTableLineFormat* pLineFormat, + SwTableBoxFormat* pBoxFormat, + SwTextFormatColl* /*pTextColl*/ /*, SwUndo... pUndo*/ ) { if( !rTableNodes.size() ) return 0; - SwTableNode * pTblNd = new SwTableNode( rTableNodes.begin()->begin()->aStart ); + SwTableNode * pTableNd = new SwTableNode( rTableNodes.begin()->begin()->aStart ); //insert the end node after the last text node SwNodeIndex aInsertIndex( rTableNodes.rbegin()->rbegin()->aEnd ); ++aInsertIndex; //!! ownership will be transferred in c-tor to SwNodes array. //!! Thus no real problem here... - new SwEndNode( aInsertIndex, *pTblNd ); + new SwEndNode( aInsertIndex, *pTableNd ); #if OSL_DEBUG_LEVEL > 1 const SwNodeRange& rStartRange = *rTableNodes.begin()->begin(); @@ -1371,7 +1371,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes, #endif SwDoc* pDoc = GetDoc(); - SwTable& rTable = pTblNd->GetTable(); + SwTable& rTable = pTableNd->GetTable(); SwTableBox* pBox; sal_uInt16 nBoxes, nLines, nMaxBoxes = 0; @@ -1380,10 +1380,10 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes, for( nLines = 0; aNodeIndex <= rTableNodes.rbegin()->rbegin()->aEnd; ++aNodeIndex,++nLines ) { SwNode& rNode = aNodeIndex.GetNode(); - if( rNode.IsCntntNode() ) + if( rNode.IsContentNode() ) { - lcl_RemoveBreaks(static_cast<SwCntntNode&>(rNode), - (0 == nLines) ? pTblFmt : 0); + lcl_RemoveBreaks(static_cast<SwContentNode&>(rNode), + (0 == nLines) ? pTableFormat : 0); } } @@ -1392,7 +1392,7 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes, aRowIter != rTableNodes.end(); ++aRowIter, nLines++, nBoxes = 0 ) { - SwTableLine* pLine = new SwTableLine( pLineFmt, 1, 0 ); + SwTableLine* pLine = new SwTableLine( pLineFormat, 1, 0 ); rTable.GetTabLines().insert(rTable.GetTabLines().begin() + nLines, pLine); std::vector< SwNodeRange >::const_iterator aCellIter = aRowIter->begin(); @@ -1422,47 +1422,47 @@ SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes, } // assign Section to the Box - pBox = new SwTableBox( pBoxFmt, *pSttNd, pLine ); + pBox = new SwTableBox( pBoxFormat, *pSttNd, pLine ); pLine->GetTabBoxes().insert( pLine->GetTabBoxes().begin() + nBoxes++, pBox ); } if( nMaxBoxes < nBoxes ) nMaxBoxes = nBoxes; } - rTable.RegisterToFormat(*pTblFmt); - lcl_SetTableBoxWidths2(rTable, nMaxBoxes, *pBoxFmt, *pDoc); + rTable.RegisterToFormat(*pTableFormat); + lcl_SetTableBoxWidths2(rTable, nMaxBoxes, *pBoxFormat, *pDoc); - return pTblNd; + return pTableNd; } /** * Table to Text */ -bool SwDoc::TableToText( const SwTableNode* pTblNd, sal_Unicode cCh ) +bool SwDoc::TableToText( const SwTableNode* pTableNd, sal_Unicode cCh ) { - if( !pTblNd ) + if( !pTableNd ) return false; // #i34471# - // If this is trigged by SwUndoTblToTxt::Repeat() nobody ever deleted + // If this is trigged by SwUndoTableToText::Repeat() nobody ever deleted // the table cursor. SwEditShell* pESh = GetEditShell(); if( pESh && pESh->IsTableMode() ) pESh->ClearMark(); - SwNodeRange aRg( *pTblNd, 0, *pTblNd->EndOfSectionNode() ); - SwUndoTblToTxt* pUndo = 0; + SwNodeRange aRg( *pTableNd, 0, *pTableNd->EndOfSectionNode() ); + SwUndoTableToText* pUndo = 0; SwNodeRange* pUndoRg = 0; if (GetIDocumentUndoRedo().DoesUndo()) { GetIDocumentUndoRedo().ClearRedo(); pUndoRg = new SwNodeRange( aRg.aStart, -1, aRg.aEnd, +1 ); - pUndo = new SwUndoTblToTxt( pTblNd->GetTable(), cCh ); + pUndo = new SwUndoTableToText( pTableNd->GetTable(), cCh ); } - SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() ); - aMsgHnt.eFlags = TBL_BOXNAME; - getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint( &pTableNd->GetTable() ); + aMsgHint.eFlags = TBL_BOXNAME; + getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); bool bRet = GetNodes().TableToText( aRg, cCh, pUndo ); if( pUndoRg ) @@ -1486,12 +1486,12 @@ bool SwDoc::TableToText( const SwTableNode* pTblNd, sal_Unicode cCh ) */ struct _DelTabPara { - SwTxtNode* pLastNd; + SwTextNode* pLastNd; SwNodes& rNds; - SwUndoTblToTxt* pUndo; + SwUndoTableToText* pUndo; sal_Unicode cCh; - _DelTabPara( SwNodes& rNodes, sal_Unicode cChar, SwUndoTblToTxt* pU ) : + _DelTabPara( SwNodes& rNodes, sal_Unicode cChar, SwUndoTableToText* pU ) : pLastNd(0), rNds( rNodes ), pUndo( pU ), cCh( cChar ) {} _DelTabPara( const _DelTabPara& rPara ) : pLastNd(rPara.pLastNd), rNds( rPara.rNds ), @@ -1530,9 +1530,9 @@ static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara ) *pBox->GetSttNd()->EndOfSectionNode() ); // Delete the Section pDelPara->rNds.SectionUp( &aDelRg ); - const SwTxtNode* pCurTxtNd; + const SwTextNode* pCurTextNd; if( T2T_PARA != pDelPara->cCh && pDelPara->pLastNd && - 0 != ( pCurTxtNd = aDelRg.aStart.GetNode().GetTxtNode() )) + 0 != ( pCurTextNd = aDelRg.aStart.GetNode().GetTextNode() )) { // Join the current text node with the last from the previous box if possible sal_uLong nNdIdx = aDelRg.aStart.GetIndex(); @@ -1541,21 +1541,21 @@ static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara ) { // Inserting the separator SwIndex aCntIdx( pDelPara->pLastNd, - pDelPara->pLastNd->GetTxt().getLength()); + pDelPara->pLastNd->GetText().getLength()); pDelPara->pLastNd->InsertText( OUString(pDelPara->cCh), aCntIdx, SwInsertFlags::EMPTYEXPAND ); if( pDelPara->pUndo ) pDelPara->pUndo->AddBoxPos( *pDoc, nNdIdx, aDelRg.aEnd.GetIndex(), aCntIdx.GetIndex() ); - const std::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); - const sal_Int32 nOldTxtLen = aCntIdx.GetIndex(); - pCntntStore->Save( pDoc, nNdIdx, pCurTxtNd->GetTxt().getLength() ); + const std::shared_ptr<sw::mark::ContentIdxStore> pContentStore(sw::mark::ContentIdxStore::Create()); + const sal_Int32 nOldTextLen = aCntIdx.GetIndex(); + pContentStore->Save( pDoc, nNdIdx, pCurTextNd->GetText().getLength() ); pDelPara->pLastNd->JoinNext(); - if( !pCntntStore->Empty() ) - pCntntStore->Restore( pDoc, pDelPara->pLastNd->GetIndex(), nOldTxtLen ); + if( !pContentStore->Empty() ) + pContentStore->Restore( pDoc, pDelPara->pLastNd->GetIndex(), nOldTextLen ); } else if( pDelPara->pUndo ) { @@ -1566,7 +1566,7 @@ static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara ) else if( pDelPara->pUndo ) pDelPara->pUndo->AddBoxPos( *pDoc, aDelRg.aStart.GetIndex(), aDelRg.aEnd.GetIndex() ); --aDelRg.aEnd; - pDelPara->pLastNd = aDelRg.aEnd.GetNode().GetTxtNode(); + pDelPara->pLastNd = aDelRg.aEnd.GetNode().GetTextNode(); // Do not take over the NumberFormatting's adjustment if( pDelPara->pLastNd && pDelPara->pLastNd->HasSwAttrSet() ) @@ -1575,13 +1575,13 @@ static void lcl_DelBox( SwTableBox* pBox, _DelTabPara* pDelPara ) } bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, - SwUndoTblToTxt* pUndo ) + SwUndoTableToText* pUndo ) { // Is a Table selected? - SwTableNode* pTblNd; + SwTableNode* pTableNd; if( rRange.aStart.GetIndex() >= rRange.aEnd.GetIndex() || - 0 == ( pTblNd = rRange.aStart.GetNode().GetTableNode()) || - &rRange.aEnd.GetNode() != pTblNd->EndOfSectionNode() ) + 0 == ( pTableNd = rRange.aStart.GetNode().GetTableNode()) || + &rRange.aEnd.GetNode() != pTableNd->EndOfSectionNode() ) return false; // If the Table was alone in a Section, create the Frames via the Table's Upper @@ -1590,14 +1590,14 @@ bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, SwNode* pFrmNd = FindPrvNxtFrmNode( aFrmIdx, &rRange.aEnd.GetNode() ); if( !pFrmNd ) // Collect all Uppers - pNode2Layout = new SwNode2Layout( *pTblNd ); + pNode2Layout = new SwNode2Layout( *pTableNd ); // Delete the Frames - pTblNd->DelFrms(); + pTableNd->DelFrms(); // "Delete" the Table and merge all Lines/Boxes _DelTabPara aDelPara( *this, cCh, pUndo ); - for( SwTableLine *pLine : pTblNd->pTable->GetTabLines() ) + for( SwTableLine *pLine : pTableNd->pTable->GetTabLines() ) lcl_DelLine( pLine, &aDelPara ); // We just created a TextNode with fitting separator for every TableLine. @@ -1609,17 +1609,17 @@ bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, // first Text Node { // What about UNDO? - const SfxItemSet& rTblSet = pTblNd->pTable->GetFrmFmt()->GetAttrSet(); + const SfxItemSet& rTableSet = pTableNd->pTable->GetFrameFormat()->GetAttrSet(); const SfxPoolItem *pBreak, *pDesc; - if( SfxItemState::SET != rTblSet.GetItemState( RES_PAGEDESC, false, &pDesc )) + if( SfxItemState::SET != rTableSet.GetItemState( RES_PAGEDESC, false, &pDesc )) pDesc = 0; - if( SfxItemState::SET != rTblSet.GetItemState( RES_BREAK, false, &pBreak )) + if( SfxItemState::SET != rTableSet.GetItemState( RES_BREAK, false, &pBreak )) pBreak = 0; if( pBreak || pDesc ) { - SwNodeIndex aIdx( *pTblNd ); - SwCntntNode* pCNd = GoNext( &aIdx ); + SwNodeIndex aIdx( *pTableNd ); + SwContentNode* pCNd = GoNext( &aIdx ); if( pBreak ) pCNd->SetAttr( *pBreak ); if( pDesc ) @@ -1638,14 +1638,14 @@ bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, } else { - SwCntntNode *pCNd; + SwContentNode *pCNd; SwSectionNode *pSNd; while( aDelRg.aStart.GetIndex() < nEnd ) { - if( 0 != ( pCNd = aDelRg.aStart.GetNode().GetCntntNode())) + if( 0 != ( pCNd = aDelRg.aStart.GetNode().GetContentNode())) { - if( pFrmNd->IsCntntNode() ) - static_cast<SwCntntNode*>(pFrmNd)->MakeFrms( *pCNd ); + if( pFrmNd->IsContentNode() ) + static_cast<SwContentNode*>(pFrmNd)->MakeFrms( *pCNd ); else if( pFrmNd->IsTableNode() ) static_cast<SwTableNode*>(pFrmNd)->MakeFrms( aDelRg.aStart ); else if( pFrmNd->IsSectionNode() ) @@ -1654,7 +1654,7 @@ bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, } else if( 0 != ( pSNd = aDelRg.aStart.GetNode().GetSectionNode())) { - if( !pSNd->GetSection().IsHidden() && !pSNd->IsCntntHidden() ) + if( !pSNd->GetSection().IsHidden() && !pSNd->IsContentHidden() ) { pSNd->MakeFrms( &aFrmIdx, &aDelRg.aEnd ); pFrmNd = pSNd; @@ -1668,19 +1668,19 @@ bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, // #i28006# Fly frames have to be restored even if the table was // #alone in the section - const SwFrmFmts& rFlyArr = *GetDoc()->GetSpzFrmFmts(); + const SwFrameFormats& rFlyArr = *GetDoc()->GetSpzFrameFormats(); for( auto pFly : rFlyArr ) { - SwFrmFmt *const pFmt = (SwFrmFmt*)pFly; - const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); - SwPosition const*const pAPos = rAnchor.GetCntntAnchor(); + SwFrameFormat *const pFormat = (SwFrameFormat*)pFly; + const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); + SwPosition const*const pAPos = rAnchor.GetContentAnchor(); if (pAPos && ((FLY_AT_PARA == rAnchor.GetAnchorId()) || (FLY_AT_CHAR == rAnchor.GetAnchorId())) && nStt <= pAPos->nNode.GetIndex() && pAPos->nNode.GetIndex() < nEnd ) { - pFmt->MakeFrms(); + pFormat->MakeFrms(); } } @@ -1692,12 +1692,12 @@ bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, */ bool SwDoc::InsertCol( const SwCursor& rCursor, sal_uInt16 nCnt, bool bBehind ) { - if( !::CheckSplitCells( rCursor, nCnt + 1, nsSwTblSearchType::TBLSEARCH_COL ) ) + if( !::CheckSplitCells( rCursor, nCnt + 1, nsSwTableSearchType::TBLSEARCH_COL ) ) return false; // Find the Boxes via the Layout SwSelBoxes aBoxes; - ::GetTblSel( rCursor, aBoxes, nsSwTblSearchType::TBLSEARCH_COL ); + ::GetTableSel( rCursor, aBoxes, nsSwTableSearchType::TBLSEARCH_COL ); bool bRet = false; if( !aBoxes.empty() ) @@ -1708,32 +1708,32 @@ bool SwDoc::InsertCol( const SwCursor& rCursor, sal_uInt16 nCnt, bool bBehind ) bool SwDoc::InsertCol( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool bBehind ) { OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); - SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode()); - if( !pTblNd ) + SwTableNode* pTableNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode()); + if( !pTableNd ) return false; - SwTable& rTbl = pTblNd->GetTable(); - if( rTbl.ISA( SwDDETable )) + SwTable& rTable = pTableNd->GetTable(); + if( rTable.ISA( SwDDETable )) return false; SwTableSortBoxes aTmpLst; - SwUndoTblNdsChg* pUndo = 0; + SwUndoTableNdsChg* pUndo = 0; if (GetIDocumentUndoRedo().DoesUndo()) { - pUndo = new SwUndoTblNdsChg( UNDO_TABLE_INSCOL, rBoxes, *pTblNd, + pUndo = new SwUndoTableNdsChg( UNDO_TABLE_INSCOL, rBoxes, *pTableNd, 0, 0, nCnt, bBehind, false ); - aTmpLst.insert( rTbl.GetTabSortBoxes() ); + aTmpLst.insert( rTable.GetTabSortBoxes() ); } bool bRet(false); { ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); - SwTableFmlUpdate aMsgHnt( &rTbl ); - aMsgHnt.eFlags = TBL_BOXPTR; - getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint( &rTable ); + aMsgHint.eFlags = TBL_BOXPTR; + getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); - bRet = rTbl.InsertCol( this, rBoxes, nCnt, bBehind ); + bRet = rTable.InsertCol( this, rBoxes, nCnt, bBehind ); if (bRet) { getIDocumentState().SetModified(); @@ -1746,7 +1746,7 @@ bool SwDoc::InsertCol( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool bBehind ) { if( bRet ) { - pUndo->SaveNewBoxes( *pTblNd, aTmpLst ); + pUndo->SaveNewBoxes( *pTableNd, aTmpLst ); GetIDocumentUndoRedo().AppendUndo( pUndo ); } else @@ -1759,7 +1759,7 @@ bool SwDoc::InsertRow( const SwCursor& rCursor, sal_uInt16 nCnt, bool bBehind ) { // Find the Boxes via the Layout SwSelBoxes aBoxes; - GetTblSel( rCursor, aBoxes, nsSwTblSearchType::TBLSEARCH_ROW ); + GetTableSel( rCursor, aBoxes, nsSwTableSearchType::TBLSEARCH_ROW ); bool bRet = false; if( !aBoxes.empty() ) @@ -1770,32 +1770,32 @@ bool SwDoc::InsertRow( const SwCursor& rCursor, sal_uInt16 nCnt, bool bBehind ) bool SwDoc::InsertRow( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool bBehind ) { OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); - SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode()); - if( !pTblNd ) + SwTableNode* pTableNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode()); + if( !pTableNd ) return false; - SwTable& rTbl = pTblNd->GetTable(); - if( rTbl.ISA( SwDDETable )) + SwTable& rTable = pTableNd->GetTable(); + if( rTable.ISA( SwDDETable )) return false; SwTableSortBoxes aTmpLst; - SwUndoTblNdsChg* pUndo = 0; + SwUndoTableNdsChg* pUndo = 0; if (GetIDocumentUndoRedo().DoesUndo()) { - pUndo = new SwUndoTblNdsChg( UNDO_TABLE_INSROW,rBoxes, *pTblNd, + pUndo = new SwUndoTableNdsChg( UNDO_TABLE_INSROW,rBoxes, *pTableNd, 0, 0, nCnt, bBehind, false ); - aTmpLst.insert( rTbl.GetTabSortBoxes() ); + aTmpLst.insert( rTable.GetTabSortBoxes() ); } bool bRet(false); { ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); - SwTableFmlUpdate aMsgHnt( &rTbl ); - aMsgHnt.eFlags = TBL_BOXPTR; - getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint( &rTable ); + aMsgHint.eFlags = TBL_BOXPTR; + getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); - bRet = rTbl.InsertRow( this, rBoxes, nCnt, bBehind ); + bRet = rTable.InsertRow( this, rBoxes, nCnt, bBehind ); if (bRet) { getIDocumentState().SetModified(); @@ -1808,7 +1808,7 @@ bool SwDoc::InsertRow( const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bool bBehind ) { if( bRet ) { - pUndo->SaveNewBoxes( *pTblNd, aTmpLst ); + pUndo->SaveNewBoxes( *pTableNd, aTmpLst ); GetIDocumentUndoRedo().AppendUndo( pUndo ); } else @@ -1825,7 +1825,7 @@ bool SwDoc::DeleteRow( const SwCursor& rCursor ) { // Find the Boxes via the Layout SwSelBoxes aBoxes; - GetTblSel( rCursor, aBoxes, nsSwTblSearchType::TBLSEARCH_ROW ); + GetTableSel( rCursor, aBoxes, nsSwTableSearchType::TBLSEARCH_ROW ); if( ::HasProtectedCells( aBoxes )) return false; @@ -1834,16 +1834,16 @@ bool SwDoc::DeleteRow( const SwCursor& rCursor ) // - when there's another Line, we place it in that one // - when a Line precedes it, we place it in that one { - SwTableNode* pTblNd = rCursor.GetNode().FindTableNode(); + SwTableNode* pTableNd = rCursor.GetNode().FindTableNode(); - if( pTblNd->GetTable().ISA( SwDDETable )) + if( pTableNd->GetTable().ISA( SwDDETable )) return false; // Find all Boxes/Lines _FndBox aFndBox( 0, 0 ); { _FndPara aPara( aBoxes, &aFndBox ); - ForEach_FndLineCopyCol( pTblNd->GetTable().GetTabLines(), &aPara ); + ForEach_FndLineCopyCol( pTableNd->GetTable().GetTabLines(), &aPara ); } if( !aFndBox.GetLines().size() ) @@ -1874,11 +1874,11 @@ bool SwDoc::DeleteRow( const SwCursor& rCursor ) pDelBox->GetTabLines().size()-1 ]; pDelBox = pLn->GetTabBoxes().back(); } - SwTableBox* pNextBox = pDelLine->FindNextBox( pTblNd->GetTable(), + SwTableBox* pNextBox = pDelLine->FindNextBox( pTableNd->GetTable(), pDelBox, true ); while( pNextBox && - pNextBox->GetFrmFmt()->GetProtect().IsCntntProtected() ) - pNextBox = pNextBox->FindNextBox( pTblNd->GetTable(), pNextBox ); + pNextBox->GetFrameFormat()->GetProtect().IsContentProtected() ) + pNextBox = pNextBox->FindNextBox( pTableNd->GetTable(), pNextBox ); if( !pNextBox ) // No succeeding Boxes? Then take the preceding one { @@ -1886,21 +1886,21 @@ bool SwDoc::DeleteRow( const SwCursor& rCursor ) pDelBox = pDelLine->GetTabBoxes()[ 0 ]; while( !pDelBox->GetSttNd() ) pDelBox = pDelBox->GetTabLines()[0]->GetTabBoxes()[0]; - pNextBox = pDelLine->FindPreviousBox( pTblNd->GetTable(), + pNextBox = pDelLine->FindPreviousBox( pTableNd->GetTable(), pDelBox, true ); while( pNextBox && - pNextBox->GetFrmFmt()->GetProtect().IsCntntProtected() ) - pNextBox = pNextBox->FindPreviousBox( pTblNd->GetTable(), pNextBox ); + pNextBox->GetFrameFormat()->GetProtect().IsContentProtected() ) + pNextBox = pNextBox->FindPreviousBox( pTableNd->GetTable(), pNextBox ); } sal_uLong nIdx; if( pNextBox ) // Place the Cursor here nIdx = pNextBox->GetSttIdx() + 1; else // Else after the Table - nIdx = pTblNd->EndOfSectionIndex() + 1; + nIdx = pTableNd->EndOfSectionIndex() + 1; SwNodeIndex aIdx( GetNodes(), nIdx ); - SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode(); + SwContentNode* pCNd = aIdx.GetNode().GetContentNode(); if( !pCNd ) pCNd = GetNodes().GoNext( &aIdx ); @@ -1927,7 +1927,7 @@ bool SwDoc::DeleteCol( const SwCursor& rCursor ) { // Find the Boxes via the Layout SwSelBoxes aBoxes; - GetTblSel( rCursor, aBoxes, nsSwTblSearchType::TBLSEARCH_COL ); + GetTableSel( rCursor, aBoxes, nsSwTableSearchType::TBLSEARCH_COL ); if( ::HasProtectedCells( aBoxes )) return false; @@ -1955,16 +1955,16 @@ bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) return false; OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); - SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode()); - if( !pTblNd ) + SwTableNode* pTableNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode()); + if( !pTableNd ) return false; - if( pTblNd->GetTable().ISA( SwDDETable )) + if( pTableNd->GetTable().ISA( SwDDETable )) return false; ::ClearFEShellTabCols(); SwSelBoxes aSelBoxes( rBoxes ); - SwTable &rTable = pTblNd->GetTable(); + SwTable &rTable = pTableNd->GetTable(); long nMin = 0; long nMax = 0; if( rTable.IsNewModel() ) @@ -1976,35 +1976,35 @@ bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) } // Are we deleting the whole Table? - const sal_uLong nTmpIdx1 = pTblNd->GetIndex(); + const sal_uLong nTmpIdx1 = pTableNd->GetIndex(); const sal_uLong nTmpIdx2 = aSelBoxes.back()->GetSttNd()->EndOfSectionIndex() + 1; - if( pTblNd->GetTable().GetTabSortBoxes().size() == aSelBoxes.size() && + if( pTableNd->GetTable().GetTabSortBoxes().size() == aSelBoxes.size() && aSelBoxes[0]->GetSttIdx()-1 == nTmpIdx1 && - nTmpIdx2 == pTblNd->EndOfSectionIndex() ) + nTmpIdx2 == pTableNd->EndOfSectionIndex() ) { - bool bNewTxtNd = false; + bool bNewTextNd = false; // Is it alone in a FlyFrame? - SwNodeIndex aIdx( *pTblNd, -1 ); + SwNodeIndex aIdx( *pTableNd, -1 ); const SwStartNode* pSttNd = aIdx.GetNode().GetStartNode(); if( pSttNd ) { - const sal_uLong nTblEnd = pTblNd->EndOfSectionIndex() + 1; + const sal_uLong nTableEnd = pTableNd->EndOfSectionIndex() + 1; const sal_uLong nSectEnd = pSttNd->EndOfSectionIndex(); - if( nTblEnd == nSectEnd ) + if( nTableEnd == nSectEnd ) { if( SwFlyStartNode == pSttNd->GetStartNodeType() ) { - SwFrmFmt* pFmt = pSttNd->GetFlyFmt(); - if( pFmt ) + SwFrameFormat* pFormat = pSttNd->GetFlyFormat(); + if( pFormat ) { // That's the FlyFormat we're looking for - getIDocumentLayoutAccess().DelLayoutFmt( pFmt ); + getIDocumentLayoutAccess().DelLayoutFormat( pFormat ); return true; } } // No Fly? Thus Header or Footer: always leave a TextNode // We can forget about Undo then! - bNewTxtNd = true; + bNewTextNd = true; } } @@ -2013,44 +2013,44 @@ bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) if (GetIDocumentUndoRedo().DoesUndo()) { GetIDocumentUndoRedo().ClearRedo(); - SwPaM aPaM( *pTblNd->EndOfSectionNode(), aIdx.GetNode() ); + SwPaM aPaM( *pTableNd->EndOfSectionNode(), aIdx.GetNode() ); - if( bNewTxtNd ) + if( bNewTextNd ) { - const SwNodeIndex aTmpIdx( *pTblNd->EndOfSectionNode(), 1 ); - GetNodes().MakeTxtNode( aTmpIdx, - getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) ); + const SwNodeIndex aTmpIdx( *pTableNd->EndOfSectionNode(), 1 ); + GetNodes().MakeTextNode( aTmpIdx, + getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ) ); } // Save the cursors (UNO and otherwise) - SwPaM aSavePaM( SwNodeIndex( *pTblNd->EndOfSectionNode() ) ); + SwPaM aSavePaM( SwNodeIndex( *pTableNd->EndOfSectionNode() ) ); if( ! aSavePaM.Move( fnMoveForward, fnGoNode ) ) { - *aSavePaM.GetMark() = SwPosition( *pTblNd ); + *aSavePaM.GetMark() = SwPosition( *pTableNd ); aSavePaM.Move( fnMoveBackward, fnGoNode ); } { - SwPaM const tmpPaM(*pTblNd, *pTblNd->EndOfSectionNode()); + SwPaM const tmpPaM(*pTableNd, *pTableNd->EndOfSectionNode()); ::PaMCorrAbs(tmpPaM, *aSavePaM.GetMark()); } // Move hard PageBreaks to the succeeding Node bool bSavePageBreak = false, bSavePageDesc = false; - sal_uLong nNextNd = pTblNd->EndOfSectionIndex()+1; - SwCntntNode* pNextNd = GetNodes()[ nNextNd ]->GetCntntNode(); + sal_uLong nNextNd = pTableNd->EndOfSectionIndex()+1; + SwContentNode* pNextNd = GetNodes()[ nNextNd ]->GetContentNode(); if( pNextNd ) { { - SwFrmFmt* pTableFmt = pTblNd->GetTable().GetFrmFmt(); + SwFrameFormat* pTableFormat = pTableNd->GetTable().GetFrameFormat(); const SfxPoolItem *pItem; - if( SfxItemState::SET == pTableFmt->GetItemState( RES_PAGEDESC, + if( SfxItemState::SET == pTableFormat->GetItemState( RES_PAGEDESC, false, &pItem ) ) { pNextNd->SetAttr( *pItem ); bSavePageDesc = true; } - if( SfxItemState::SET == pTableFmt->GetItemState( RES_BREAK, + if( SfxItemState::SET == pTableFormat->GetItemState( RES_BREAK, false, &pItem ) ) { pNextNd->SetAttr( *pItem ); @@ -2059,60 +2059,60 @@ bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) } } SwUndoDelete* pUndo = new SwUndoDelete( aPaM ); - if( bNewTxtNd ) - pUndo->SetTblDelLastNd(); + if( bNewTextNd ) + pUndo->SetTableDelLastNd(); pUndo->SetPgBrkFlags( bSavePageBreak, bSavePageDesc ); - pUndo->SetTableName(pTblNd->GetTable().GetFrmFmt()->GetName()); + pUndo->SetTableName(pTableNd->GetTable().GetFrameFormat()->GetName()); GetIDocumentUndoRedo().AppendUndo( pUndo ); } else { - if( bNewTxtNd ) + if( bNewTextNd ) { - const SwNodeIndex aTmpIdx( *pTblNd->EndOfSectionNode(), 1 ); - GetNodes().MakeTxtNode( aTmpIdx, - getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) ); + const SwNodeIndex aTmpIdx( *pTableNd->EndOfSectionNode(), 1 ); + GetNodes().MakeTextNode( aTmpIdx, + getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ) ); } // Save the cursors (UNO and otherwise) - SwPaM aSavePaM( SwNodeIndex( *pTblNd->EndOfSectionNode() ) ); + SwPaM aSavePaM( SwNodeIndex( *pTableNd->EndOfSectionNode() ) ); if( ! aSavePaM.Move( fnMoveForward, fnGoNode ) ) { - *aSavePaM.GetMark() = SwPosition( *pTblNd ); + *aSavePaM.GetMark() = SwPosition( *pTableNd ); aSavePaM.Move( fnMoveBackward, fnGoNode ); } { - SwPaM const tmpPaM(*pTblNd, *pTblNd->EndOfSectionNode()); + SwPaM const tmpPaM(*pTableNd, *pTableNd->EndOfSectionNode()); ::PaMCorrAbs(tmpPaM, *aSavePaM.GetMark()); } // Move hard PageBreaks to the succeeding Node - SwCntntNode* pNextNd = GetNodes()[ pTblNd->EndOfSectionIndex()+1 ]->GetCntntNode(); + SwContentNode* pNextNd = GetNodes()[ pTableNd->EndOfSectionIndex()+1 ]->GetContentNode(); if( pNextNd ) { - SwFrmFmt* pTableFmt = pTblNd->GetTable().GetFrmFmt(); + SwFrameFormat* pTableFormat = pTableNd->GetTable().GetFrameFormat(); const SfxPoolItem *pItem; - if( SfxItemState::SET == pTableFmt->GetItemState( RES_PAGEDESC, + if( SfxItemState::SET == pTableFormat->GetItemState( RES_PAGEDESC, false, &pItem ) ) pNextNd->SetAttr( *pItem ); - if( SfxItemState::SET == pTableFmt->GetItemState( RES_BREAK, + if( SfxItemState::SET == pTableFormat->GetItemState( RES_BREAK, false, &pItem ) ) pNextNd->SetAttr( *pItem ); } - pTblNd->DelFrms(); - getIDocumentContentOperations().DeleteSection( pTblNd ); + pTableNd->DelFrms(); + getIDocumentContentOperations().DeleteSection( pTableNd ); } getIDocumentState().SetModified(); getIDocumentFieldsAccess().SetFieldsDirty( true, NULL, 0 ); return true; } - SwUndoTblNdsChg* pUndo = 0; + SwUndoTableNdsChg* pUndo = 0; if (GetIDocumentUndoRedo().DoesUndo()) { - pUndo = new SwUndoTblNdsChg( UNDO_TABLE_DELBOX, aSelBoxes, *pTblNd, + pUndo = new SwUndoTableNdsChg( UNDO_TABLE_DELBOX, aSelBoxes, *pTableNd, nMin, nMax, 0, false, false ); } @@ -2120,9 +2120,9 @@ bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) { ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); - SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() ); - aMsgHnt.eFlags = TBL_BOXPTR; - getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint( &pTableNd->GetTable() ); + aMsgHint.eFlags = TBL_BOXPTR; + getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); if (rTable.IsNewModel()) { @@ -2156,27 +2156,27 @@ bool SwDoc::DeleteRowCol( const SwSelBoxes& rBoxes, bool bColumn ) /** * Split up/merge Boxes in the Table */ -bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, bool bVert, sal_uInt16 nCnt, +bool SwDoc::SplitTable( const SwSelBoxes& rBoxes, bool bVert, sal_uInt16 nCnt, bool bSameHeight ) { OSL_ENSURE( !rBoxes.empty() && nCnt, "No valid Box list" ); - SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode()); - if( !pTblNd ) + SwTableNode* pTableNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode()); + if( !pTableNd ) return false; - SwTable& rTbl = pTblNd->GetTable(); - if( rTbl.ISA( SwDDETable )) + SwTable& rTable = pTableNd->GetTable(); + if( rTable.ISA( SwDDETable )) return false; std::vector<sal_uLong> aNdsCnts; SwTableSortBoxes aTmpLst; - SwUndoTblNdsChg* pUndo = 0; + SwUndoTableNdsChg* pUndo = 0; if (GetIDocumentUndoRedo().DoesUndo()) { - pUndo = new SwUndoTblNdsChg( UNDO_TABLE_SPLIT, rBoxes, *pTblNd, 0, 0, + pUndo = new SwUndoTableNdsChg( UNDO_TABLE_SPLIT, rBoxes, *pTableNd, 0, 0, nCnt, bVert, bSameHeight ); - aTmpLst.insert( rTbl.GetTabSortBoxes() ); + aTmpLst.insert( rTable.GetTabSortBoxes() ); if( !bVert ) { for (size_t n = 0; n < rBoxes.size(); ++n) @@ -2192,14 +2192,14 @@ bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, bool bVert, sal_uInt16 nCnt, { ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); - SwTableFmlUpdate aMsgHnt( &rTbl ); - aMsgHnt.eFlags = TBL_BOXPTR; - getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint( &rTable ); + aMsgHint.eFlags = TBL_BOXPTR; + getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); if (bVert) - bRet = rTbl.SplitCol( this, rBoxes, nCnt ); + bRet = rTable.SplitCol( this, rBoxes, nCnt ); else - bRet = rTbl.SplitRow( this, rBoxes, nCnt, bSameHeight ); + bRet = rTable.SplitRow( this, rBoxes, nCnt, bSameHeight ); if (bRet) { @@ -2213,9 +2213,9 @@ bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, bool bVert, sal_uInt16 nCnt, if( bRet ) { if( bVert ) - pUndo->SaveNewBoxes( *pTblNd, aTmpLst ); + pUndo->SaveNewBoxes( *pTableNd, aTmpLst ); else - pUndo->SaveNewBoxes( *pTblNd, aTmpLst, rBoxes, aNdsCnts ); + pUndo->SaveNewBoxes( *pTableNd, aTmpLst, rBoxes, aNdsCnts ); GetIDocumentUndoRedo().AppendUndo( pUndo ); } else @@ -2225,13 +2225,13 @@ bool SwDoc::SplitTbl( const SwSelBoxes& rBoxes, bool bVert, sal_uInt16 nCnt, return bRet; } -sal_uInt16 SwDoc::MergeTbl( SwPaM& rPam ) +sal_uInt16 SwDoc::MergeTable( SwPaM& rPam ) { // Check if the current cursor's Point/Mark are inside a Table - SwTableNode* pTblNd = rPam.GetNode().FindTableNode(); - if( !pTblNd ) + SwTableNode* pTableNd = rPam.GetNode().FindTableNode(); + if( !pTableNd ) return TBLMERGE_NOSELECTION; - SwTable& rTable = pTblNd->GetTable(); + SwTable& rTable = pTableNd->GetTable(); if( rTable.ISA(SwDDETable) ) return TBLMERGE_NOSELECTION; sal_uInt16 nRet = TBLMERGE_NOSELECTION; @@ -2249,8 +2249,8 @@ sal_uInt16 SwDoc::MergeTbl( SwPaM& rPam ) RedlineMode_t eOld = getIDocumentRedlineAccess().GetRedlineMode(); getIDocumentRedlineAccess().SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE)); - SwUndoTblMerge *const pUndo( (GetIDocumentUndoRedo().DoesUndo()) - ? new SwUndoTblMerge( rPam ) + SwUndoTableMerge *const pUndo( (GetIDocumentUndoRedo().DoesUndo()) + ? new SwUndoTableMerge( rPam ) : 0 ); // Find the Boxes via the Layout @@ -2303,11 +2303,11 @@ sal_uInt16 SwDoc::MergeTbl( SwPaM& rPam ) } // Merge them - SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() ); - aMsgHnt.eFlags = TBL_BOXPTR; - getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint( &pTableNd->GetTable() ); + aMsgHint.eFlags = TBL_BOXPTR; + getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); - if( pTblNd->GetTable().Merge( this, aBoxes, aMerged, pMergeBox, pUndo )) + if( pTableNd->GetTable().Merge( this, aBoxes, aMerged, pMergeBox, pUndo )) { nRet = TBLMERGE_OK; getIDocumentState().SetModified(); @@ -2339,10 +2339,10 @@ SwTableNode::SwTableNode( const SwNodeIndex& rIdx ) SwTableNode::~SwTableNode() { // Notify UNO wrappers - SwFrmFmt* pTblFmt = GetTable().GetFrmFmt(); + SwFrameFormat* pTableFormat = GetTable().GetFrameFormat(); SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, - pTblFmt ); - pTblFmt->ModifyNotification( &aMsgHint, &aMsgHint ); + pTableFormat ); + pTableFormat->ModifyNotification( &aMsgHint, &aMsgHint ); DelFrms(); delete pTable; } @@ -2358,11 +2358,11 @@ SwTabFrm *SwTableNode::MakeFrm( SwFrm* pSib ) */ void SwTableNode::MakeFrms(const SwNodeIndex & rIdx ) { - if( !GetTable().GetFrmFmt()->HasWriterListeners()) // Do we actually have Frame? + if( !GetTable().GetFrameFormat()->HasWriterListeners()) // Do we actually have Frame? return; SwFrm *pFrm; - SwCntntNode * pNode = rIdx.GetNode().GetCntntNode(); + SwContentNode * pNode = rIdx.GetNode().GetContentNode(); OSL_ENSURE( pNode, "No ContentNode or CopyNode and new Node is identical"); @@ -2384,7 +2384,7 @@ void SwTableNode::MakeFrms(const SwNodeIndex & rIdx ) } /** - * Create a TblFrm for every Shell and insert before the corresponding CntntFrm. + * Create a TableFrm for every Shell and insert before the corresponding ContentFrm. */ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind ) { @@ -2412,8 +2412,8 @@ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind ) pViewShell->GetLayout()->IsAnyShellAccessible() ) { pViewShell->InvalidateAccessibleParaFlowRelation( - dynamic_cast<SwTxtFrm*>(pNew->FindNextCnt( true )), - dynamic_cast<SwTxtFrm*>(pNew->FindPrevCnt( true )) ); + dynamic_cast<SwTextFrm*>(pNew->FindNextCnt( true )), + dynamic_cast<SwTextFrm*>(pNew->FindPrevCnt( true )) ); } } pNew->RegistFlys(); @@ -2423,10 +2423,10 @@ void SwTableNode::MakeFrms( SwNodeIndex* pIdxBehind ) void SwTableNode::DelFrms() { /* For a start, cut out and delete the TabFrms (which will also delete the Columns and Rows) - The TabFrms are attached to the FrmFmt of the SwTable. + The TabFrms are attached to the FrameFormat of the SwTable. We need to delete them in a more cumbersome way, for the Master to also delete the Follows. */ - SwIterator<SwTabFrm,SwFmt> aIter( *(pTable->GetFrmFmt()) ); + SwIterator<SwTabFrm,SwFormat> aIter( *(pTable->GetFrameFormat()) ); SwTabFrm *pFrm = aIter.First(); while ( pFrm ) { @@ -2447,8 +2447,8 @@ void SwTableNode::DelFrms() pViewShell->GetLayout()->IsAnyShellAccessible() ) { pViewShell->InvalidateAccessibleParaFlowRelation( - dynamic_cast<SwTxtFrm*>(pFrm->FindNextCnt( true )), - dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) ); + dynamic_cast<SwTextFrm*>(pFrm->FindNextCnt( true )), + dynamic_cast<SwTextFrm*>(pFrm->FindPrevCnt( true )) ); } } pFrm->Cut(); @@ -2478,9 +2478,9 @@ void SwTableNode::RemoveRedlines() SwDoc* pDoc = GetDoc(); if (pDoc) { - SwTable& rTbl = GetTable(); - if ( pDoc->getIDocumentRedlineAccess().HasExtraRedlineTbl() ) - pDoc->getIDocumentRedlineAccess().GetExtraRedlineTbl().DeleteAllTableRedlines( pDoc, rTbl, true, USHRT_MAX ); + SwTable& rTable = GetTable(); + if ( pDoc->getIDocumentRedlineAccess().HasExtraRedlineTable() ) + pDoc->getIDocumentRedlineAccess().GetExtraRedlineTable().DeleteAllTableRedlines( pDoc, rTable, true, USHRT_MAX ); } } @@ -2497,7 +2497,7 @@ void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr, } else if( pCrsr ) { - const SwCntntNode* pCNd = pCrsr->GetCntntNode(); + const SwContentNode* pCNd = pCrsr->GetContentNode(); if( !pCNd ) return ; @@ -2573,16 +2573,16 @@ void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* , // #i39552# Collection of the boxes of the current // column has to be done at the beginning of this function, because - // the table may be formatted in ::GetTblSel. + // the table may be formatted in ::GetTableSel. SwDeletionChecker aDelCheck( pBoxFrm ); SwSelBoxes aBoxes; - const SwCntntFrm* pCntnt = ::GetCellCntnt( *pBoxFrm ); - if ( pCntnt && pCntnt->IsTxtFrm() ) + const SwContentFrm* pContent = ::GetCellContent( *pBoxFrm ); + if ( pContent && pContent->IsTextFrm() ) { - const SwPosition aPos( *static_cast<const SwTxtFrm*>(pCntnt)->GetTxtNode() ); + const SwPosition aPos( *static_cast<const SwTextFrm*>(pContent)->GetTextNode() ); const SwCursor aTmpCrsr( aPos, 0, false ); - ::GetTblSel( aTmpCrsr, aBoxes, nsSwTblSearchType::TBLSEARCH_COL ); + ::GetTableSel( aTmpCrsr, aBoxes, nsSwTableSearchType::TBLSEARCH_COL ); } // Make code robust: @@ -2711,7 +2711,7 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, bool bCurRowOnly, } else if( pCrsr ) { - const SwCntntNode* pCNd = pCrsr->GetCntntNode(); + const SwContentNode* pCNd = pCrsr->GetContentNode(); if( !pCNd ) return ; @@ -2738,22 +2738,22 @@ void SwDoc::SetTabCols( const SwTabCols &rNew, bool bCurRowOnly, // If the Table is still using relative values (USHRT_MAX) // we need to switch to absolute ones. SwTable& rTab = *pTab->GetTable(); - const SwFmtFrmSize& rTblFrmSz = rTab.GetFrmFmt()->GetFrmSize(); + const SwFormatFrmSize& rTableFrmSz = rTab.GetFrameFormat()->GetFrmSize(); SWRECTFN( pTab ) // #i17174# - With fix for #i9040# the shadow size is taken // from the table width. Thus, add its left and right size to current table // printing area width in order to get the correct table size attribute. SwTwips nPrtWidth = (pTab->Prt().*fnRect->fnGetWidth)(); { - SvxShadowItem aShadow( rTab.GetFrmFmt()->GetShadow() ); + SvxShadowItem aShadow( rTab.GetFrameFormat()->GetShadow() ); nPrtWidth += aShadow.CalcShadowSpace( SvxShadowItemSide::LEFT ) + aShadow.CalcShadowSpace( SvxShadowItemSide::RIGHT ); } - if( nPrtWidth != rTblFrmSz.GetWidth() ) + if( nPrtWidth != rTableFrmSz.GetWidth() ) { - SwFmtFrmSize aSz( rTblFrmSz ); + SwFormatFrmSize aSz( rTableFrmSz ); aSz.SetWidth( nPrtWidth ); - rTab.GetFrmFmt()->SetFmtAttr( aSz ); + rTab.GetFrameFormat()->SetFormatAttr( aSz ); } SwTabCols aOld( rNew.Count() ); @@ -2833,12 +2833,12 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly, const SwCursor* const long nDiff = nNewRowHeight - nOldRowHeight; if ( std::abs( nDiff ) >= ROWFUZZY ) { - // For the old table model pTxtFrm and pLine will be set for every box. - // For the new table model pTxtFrm will be set if the box is not covered, + // For the old table model pTextFrm and pLine will be set for every box. + // For the new table model pTextFrm will be set if the box is not covered, // but the pLine will be set if the box is not an overlapping box // In the new table model the row height can be adjusted, // when both variables are set. - const SwTxtFrm* pTxtFrm = 0; + const SwTextFrm* pTextFrm = 0; const SwTableLine* pLine = 0; // Iterate over all SwCellFrms with Bottom = nOldPos @@ -2853,20 +2853,20 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly, const SwCursor* { if ( !bCurColOnly || pFrm == pBoxFrm ) { - const SwFrm* pCntnt = ::GetCellCntnt( static_cast<const SwCellFrm&>(*pFrm) ); + const SwFrm* pContent = ::GetCellContent( static_cast<const SwCellFrm&>(*pFrm) ); - if ( pCntnt && pCntnt->IsTxtFrm() ) + if ( pContent && pContent->IsTextFrm() ) { const SwTableBox* pBox = static_cast<const SwCellFrm*>(pFrm)->GetTabBox(); const long nRowSpan = pBox->getRowSpan(); if( nRowSpan > 0 ) // Not overlapped - pTxtFrm = static_cast<const SwTxtFrm*>(pCntnt); + pTextFrm = static_cast<const SwTextFrm*>(pContent); if( nRowSpan < 2 ) // Not overlapping for row height pLine = pBox->GetUpper(); - if( pLine && pTxtFrm ) // always for old table model + if( pLine && pTextFrm ) // always for old table model { // The new row height must not to be calculated from a overlapping box - SwFmtFrmSize aNew( pLine->GetFrmFmt()->GetFrmSize() ); + SwFormatFrmSize aNew( pLine->GetFrameFormat()->GetFrmSize() ); const long nNewSize = (pFrm->Frm().*fnRect->fnGetHeight)() + nDiff; if( nNewSize != aNew.GetHeight() ) { @@ -2874,7 +2874,7 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly, const SwCursor* if ( ATT_VAR_SIZE == aNew.GetHeightSizeType() ) aNew.SetHeightSizeType( ATT_MIN_SIZE ); // This position must not be in an overlapped box - const SwPosition aPos( *static_cast<const SwTxtFrm*>(pCntnt)->GetTxtNode() ); + const SwPosition aPos( *static_cast<const SwTextFrm*>(pContent)->GetTextNode() ); const SwCursor aTmpCrsr( aPos, 0, false ); SetRowHeight( aTmpCrsr, aNew ); // For the new table model we're done, for the old one @@ -2907,7 +2907,7 @@ void SwDoc::SetTabCols(SwTable& rTab, const SwTabCols &rNew, const SwTabCols &rO if (GetIDocumentUndoRedo().DoesUndo()) { GetIDocumentUndoRedo().AppendUndo( - new SwUndoAttrTbl( *rTab.GetTableNode(), true )); + new SwUndoAttrTable( *rTab.GetTableNode(), true )); } rTab.SetTabCols( rNew, rOld, pStart, bCurRowOnly ); ::ClearFEShellTabCols(); @@ -2922,30 +2922,30 @@ void SwDoc::SetRowsToRepeat( SwTable &rTable, sal_uInt16 nSet ) if (GetIDocumentUndoRedo().DoesUndo()) { GetIDocumentUndoRedo().AppendUndo( - new SwUndoTblHeadline(rTable, rTable.GetRowsToRepeat(), nSet) ); + new SwUndoTableHeadline(rTable, rTable.GetRowsToRepeat(), nSet) ); } SwMsgPoolItem aChg( RES_TBLHEADLINECHG ); rTable.SetRowsToRepeat( nSet ); - rTable.GetFrmFmt()->ModifyNotification( &aChg, &aChg ); + rTable.GetFrameFormat()->ModifyNotification( &aChg, &aChg ); getIDocumentState().SetModified(); } -void SwCollectTblLineBoxes::AddToUndoHistory( const SwCntntNode& rNd ) +void SwCollectTableLineBoxes::AddToUndoHistory( const SwContentNode& rNd ) { if( pHst ) - pHst->Add( rNd.GetFmtColl(), rNd.GetIndex(), ND_TEXTNODE ); + pHst->Add( rNd.GetFormatColl(), rNd.GetIndex(), ND_TEXTNODE ); } -void SwCollectTblLineBoxes::AddBox( const SwTableBox& rBox ) +void SwCollectTableLineBoxes::AddBox( const SwTableBox& rBox ) { aPosArr.push_back(nWidth); SwTableBox* p = const_cast<SwTableBox*>(&rBox); m_Boxes.push_back(p); - nWidth = nWidth + (sal_uInt16)rBox.GetFrmFmt()->GetFrmSize().GetWidth(); + nWidth = nWidth + (sal_uInt16)rBox.GetFrameFormat()->GetFrmSize().GetWidth(); } -const SwTableBox* SwCollectTblLineBoxes::GetBoxOfPos( const SwTableBox& rBox ) +const SwTableBox* SwCollectTableLineBoxes::GetBoxOfPos( const SwTableBox& rBox ) { const SwTableBox* pRet = 0; @@ -2965,13 +2965,13 @@ const SwTableBox* SwCollectTblLineBoxes::GetBoxOfPos( const SwTableBox& rBox ) if( n >= aPosArr.size() ) --n; - nWidth = nWidth + (sal_uInt16)rBox.GetFrmFmt()->GetFrmSize().GetWidth(); + nWidth = nWidth + (sal_uInt16)rBox.GetFrameFormat()->GetFrmSize().GetWidth(); pRet = m_Boxes[ n ]; } return pRet; } -bool SwCollectTblLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth ) +bool SwCollectTableLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth ) { if( !aPosArr.empty() ) { @@ -3012,7 +3012,7 @@ bool SwCollectTblLineBoxes::Resize( sal_uInt16 nOffset, sal_uInt16 nOldWidth ) bool sw_Line_CollectBox( const SwTableLine*& rpLine, void* pPara ) { - SwCollectTblLineBoxes* pSplPara = static_cast<SwCollectTblLineBoxes*>(pPara); + SwCollectTableLineBoxes* pSplPara = static_cast<SwCollectTableLineBoxes*>(pPara); if( pSplPara->IsGetValues() ) for( SwTableBoxes::iterator it = const_cast<SwTableLine*>(rpLine)->GetTabBoxes().begin(); it != const_cast<SwTableLine*>(rpLine)->GetTabBoxes().end(); ++it) @@ -3020,11 +3020,11 @@ bool sw_Line_CollectBox( const SwTableLine*& rpLine, void* pPara ) else for( SwTableBoxes::iterator it = const_cast<SwTableLine*>(rpLine)->GetTabBoxes().begin(); it != const_cast<SwTableLine*>(rpLine)->GetTabBoxes().end(); ++it) - sw_BoxSetSplitBoxFmts(*it, pSplPara ); + sw_BoxSetSplitBoxFormats(*it, pSplPara ); return true; } -void sw_Box_CollectBox( const SwTableBox* pBox, SwCollectTblLineBoxes* pSplPara ) +void sw_Box_CollectBox( const SwTableBox* pBox, SwCollectTableLineBoxes* pSplPara ) { auto nLen = pBox->GetTabLines().size(); if( nLen ) @@ -3042,7 +3042,7 @@ void sw_Box_CollectBox( const SwTableBox* pBox, SwCollectTblLineBoxes* pSplPara pSplPara->AddBox( *pBox ); } -void sw_BoxSetSplitBoxFmts( SwTableBox* pBox, SwCollectTblLineBoxes* pSplPara ) +void sw_BoxSetSplitBoxFormats( SwTableBox* pBox, SwCollectTableLineBoxes* pSplPara ) { auto nLen = pBox->GetTabLines().size(); if( nLen ) @@ -3059,17 +3059,17 @@ void sw_BoxSetSplitBoxFmts( SwTableBox* pBox, SwCollectTblLineBoxes* pSplPara ) else { const SwTableBox* pSrcBox = pSplPara->GetBoxOfPos( *pBox ); - SwFrmFmt* pFmt = pSrcBox->GetFrmFmt(); + SwFrameFormat* pFormat = pSrcBox->GetFrameFormat(); if( HEADLINE_BORDERCOPY == pSplPara->GetMode() ) { - const SvxBoxItem& rBoxItem = pBox->GetFrmFmt()->GetBox(); + const SvxBoxItem& rBoxItem = pBox->GetFrameFormat()->GetBox(); if( !rBoxItem.GetTop() ) { SvxBoxItem aNew( rBoxItem ); - aNew.SetLine( pFmt->GetBox().GetBottom(), SvxBoxItemLine::TOP ); + aNew.SetLine( pFormat->GetBox().GetBottom(), SvxBoxItemLine::TOP ); if( aNew != rBoxItem ) - pBox->ClaimFrmFmt()->SetFmtAttr( aNew ); + pBox->ClaimFrameFormat()->SetFormatAttr( aNew ); } } else @@ -3081,27 +3081,27 @@ void sw_BoxSetSplitBoxFmts( SwTableBox* pBox, SwCollectTblLineBoxes* pSplPara ) RES_VERT_ORIENT, RES_VERT_ORIENT, 0 }; - SfxItemSet aTmpSet( pFmt->GetDoc()->GetAttrPool(), + SfxItemSet aTmpSet( pFormat->GetDoc()->GetAttrPool(), aTableSplitBoxSetRange ); - aTmpSet.Put( pFmt->GetAttrSet() ); + aTmpSet.Put( pFormat->GetAttrSet() ); if( aTmpSet.Count() ) - pBox->ClaimFrmFmt()->SetFmtAttr( aTmpSet ); + pBox->ClaimFrameFormat()->SetFormatAttr( aTmpSet ); if( HEADLINE_BOXATRCOLLCOPY == pSplPara->GetMode() ) { SwNodeIndex aIdx( *pSrcBox->GetSttNd(), 1 ); - SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode(); + SwContentNode* pCNd = aIdx.GetNode().GetContentNode(); if( !pCNd ) pCNd = aIdx.GetNodes().GoNext( &aIdx ); aIdx = *pBox->GetSttNd(); - SwCntntNode* pDNd = aIdx.GetNodes().GoNext( &aIdx ); + SwContentNode* pDNd = aIdx.GetNodes().GoNext( &aIdx ); // If the Node is alone in the Section if( 2 == pDNd->EndOfSectionIndex() - pDNd->StartOfSectionIndex() ) { pSplPara->AddToUndoHistory( *pDNd ); - pDNd->ChgFmtColl( pCNd->GetFmtColl() ); + pDNd->ChgFormatColl( pCNd->GetFormatColl() ); } } @@ -3131,22 +3131,22 @@ bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, if( pTNd->GetTable().ISA( SwDDETable )) return false; - SwTable& rTbl = pTNd->GetTable(); - rTbl.SetHTMLTableLayout( 0 ); // Delete HTML Layout + SwTable& rTable = pTNd->GetTable(); + rTable.SetHTMLTableLayout( 0 ); // Delete HTML Layout - SwTableFmlUpdate aMsgHnt( &rTbl ); + SwTableFormulaUpdate aMsgHint( &rTable ); SwHistory aHistory; if (GetIDocumentUndoRedo().DoesUndo()) { - aMsgHnt.pHistory = &aHistory; + aMsgHint.pHistory = &aHistory; } { sal_uLong nSttIdx = pNd->FindTableBoxStartNode()->GetIndex(); // Find top-level Line - SwTableBox* pBox = rTbl.GetTblBox( nSttIdx ); + SwTableBox* pBox = rTable.GetTableBox( nSttIdx ); if( pBox ) { SwTableLine* pLine = pBox->GetUpper(); @@ -3154,29 +3154,29 @@ bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, pLine = pLine->GetUpper()->GetUpper(); // pLine contains the top-level Line now - aMsgHnt.nSplitLine = rTbl.GetTabLines().GetPos( pLine ); + aMsgHint.nSplitLine = rTable.GetTabLines().GetPos( pLine ); } - OUString sNewTblNm( GetUniqueTblName() ); - aMsgHnt.DATA.pNewTblNm = &sNewTblNm; - aMsgHnt.eFlags = TBL_SPLITTBL; - getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + OUString sNewTableNm( GetUniqueTableName() ); + aMsgHint.DATA.pNewTableNm = &sNewTableNm; + aMsgHint.eFlags = TBL_SPLITTBL; + getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); } // Find Lines for the Layout update _FndBox aFndBox( 0, 0 ); - aFndBox.SetTableLines( rTbl ); - aFndBox.DelFrms( rTbl ); + aFndBox.SetTableLines( rTable ); + aFndBox.DelFrms( rTable ); SwTableNode* pNew = GetNodes().SplitTable( rPos.nNode, false, bCalcNewSize ); if( pNew ) { - SwSaveRowSpan* pSaveRowSp = pNew->GetTable().CleanUpTopRowSpan( rTbl.GetTabLines().size() ); - SwUndoSplitTbl* pUndo = 0; + SwSaveRowSpan* pSaveRowSp = pNew->GetTable().CleanUpTopRowSpan( rTable.GetTabLines().size() ); + SwUndoSplitTable* pUndo = 0; if (GetIDocumentUndoRedo().DoesUndo()) { - pUndo = new SwUndoSplitTbl( + pUndo = new SwUndoSplitTable( *pNew, pSaveRowSp, eHdlnMode, bCalcNewSize); GetIDocumentUndoRedo().AppendUndo(pUndo); if( aHistory.Count() ) @@ -3189,9 +3189,9 @@ bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, // the upper Border of the current one case HEADLINE_BORDERCOPY: { - SwCollectTblLineBoxes aPara( false, eHdlnMode ); - SwTableLine* pLn = rTbl.GetTabLines()[ - rTbl.GetTabLines().size() - 1 ]; + SwCollectTableLineBoxes aPara( false, eHdlnMode ); + SwTableLine* pLn = rTable.GetTabLines()[ + rTable.GetTabLines().size() - 1 ]; for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin(); it != pLn->GetTabBoxes().end(); ++it) sw_Box_CollectBox(*it, &aPara ); @@ -3200,7 +3200,7 @@ bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, pLn = pNew->GetTable().GetTabLines()[ 0 ]; for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin(); it != pLn->GetTabBoxes().end(); ++it) - sw_BoxSetSplitBoxFmts(*it, &aPara ); + sw_BoxSetSplitBoxFormats(*it, &aPara ); // Switch off repeating Header pNew->GetTable().SetRowsToRepeat( 0 ); @@ -3215,8 +3215,8 @@ bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, if( HEADLINE_BOXATRCOLLCOPY == eHdlnMode && pUndo ) pHst = pUndo->GetHistory(); - SwCollectTblLineBoxes aPara( true, eHdlnMode, pHst ); - SwTableLine* pLn = rTbl.GetTabLines()[ 0 ]; + SwCollectTableLineBoxes aPara( true, eHdlnMode, pHst ); + SwTableLine* pLn = rTable.GetTabLines()[ 0 ]; for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin(); it != pLn->GetTabBoxes().end(); ++it) sw_Box_CollectBox(*it, &aPara ); @@ -3225,14 +3225,14 @@ bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, pLn = pNew->GetTable().GetTabLines()[ 0 ]; for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin(); it != pLn->GetTabBoxes().end(); ++it) - sw_BoxSetSplitBoxFmts(*it, &aPara ); + sw_BoxSetSplitBoxFormats(*it, &aPara ); } break; case HEADLINE_CNTNTCOPY: - rTbl.CopyHeadlineIntoTable( *pNew ); + rTable.CopyHeadlineIntoTable( *pNew ); if( pUndo ) - pUndo->SetTblNodeOffset( pNew->GetIndex() ); + pUndo->SetTableNodeOffset( pNew->GetIndex() ); break; case HEADLINE_NONE: @@ -3247,78 +3247,78 @@ bool SwDoc::SplitTable( const SwPosition& rPos, sal_uInt16 eHdlnMode, pNew->MakeFrms( &aNdIdx ); // Insert a paragraph between the Table - GetNodes().MakeTxtNode( SwNodeIndex( *pNew ), - getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_TEXT ) ); + GetNodes().MakeTextNode( SwNodeIndex( *pNew ), + getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TEXT ) ); } // Update Layout - aFndBox.MakeFrms( rTbl ); + aFndBox.MakeFrms( rTable ); // TL_CHART2: need to inform chart of probably changed cell names - UpdateCharts( rTbl.GetFrmFmt()->GetName() ); + UpdateCharts( rTable.GetFrameFormat()->GetName() ); getIDocumentFieldsAccess().SetFieldsDirty( true, NULL, 0 ); return 0 != pNew; } -static bool lcl_ChgTblSize( SwTable& rTbl ) +static bool lcl_ChgTableSize( SwTable& rTable ) { // The Attribute must not be set via the Modify or else all Boxes are // set back to 0. // So lock the Format. - SwFrmFmt* pFmt = rTbl.GetFrmFmt(); - SwFmtFrmSize aTblMaxSz( pFmt->GetFrmSize() ); + SwFrameFormat* pFormat = rTable.GetFrameFormat(); + SwFormatFrmSize aTableMaxSz( pFormat->GetFrmSize() ); - if( USHRT_MAX == aTblMaxSz.GetWidth() ) + if( USHRT_MAX == aTableMaxSz.GetWidth() ) return false; - bool bLocked = pFmt->IsModifyLocked(); - pFmt->LockModify(); + bool bLocked = pFormat->IsModifyLocked(); + pFormat->LockModify(); - aTblMaxSz.SetWidth( 0 ); + aTableMaxSz.SetWidth( 0 ); - SwTableLines& rLns = rTbl.GetTabLines(); + SwTableLines& rLns = rTable.GetTabLines(); for( auto pLn : rLns ) { SwTwips nMaxLnWidth = 0; SwTableBoxes& rBoxes = pLn->GetTabBoxes(); for( auto pBox : rBoxes ) - nMaxLnWidth += pBox->GetFrmFmt()->GetFrmSize().GetWidth(); + nMaxLnWidth += pBox->GetFrameFormat()->GetFrmSize().GetWidth(); - if( nMaxLnWidth > aTblMaxSz.GetWidth() ) - aTblMaxSz.SetWidth( nMaxLnWidth ); + if( nMaxLnWidth > aTableMaxSz.GetWidth() ) + aTableMaxSz.SetWidth( nMaxLnWidth ); } - pFmt->SetFmtAttr( aTblMaxSz ); + pFormat->SetFormatAttr( aTableMaxSz ); if( !bLocked ) // Release the Lock if appropriate - pFmt->UnlockModify(); + pFormat->UnlockModify(); return true; } class _SplitTable_Para { - std::map<SwFrmFmt*, SwFrmFmt*> aSrcDestMap; - SwTableNode* pNewTblNd; - SwTable& rOldTbl; + std::map<SwFrameFormat*, SwFrameFormat*> aSrcDestMap; + SwTableNode* pNewTableNd; + SwTable& rOldTable; public: _SplitTable_Para( SwTableNode* pNew, SwTable& rOld ) - : aSrcDestMap(), pNewTblNd( pNew ), rOldTbl( rOld ) + : aSrcDestMap(), pNewTableNd( pNew ), rOldTable( rOld ) {} - SwFrmFmt* GetDestFmt( SwFrmFmt* pSrcFmt ) const + SwFrameFormat* GetDestFormat( SwFrameFormat* pSrcFormat ) const { - std::map<SwFrmFmt*, SwFrmFmt*>::const_iterator it = aSrcDestMap.find( pSrcFmt ); + std::map<SwFrameFormat*, SwFrameFormat*>::const_iterator it = aSrcDestMap.find( pSrcFormat ); return it == aSrcDestMap.end() ? NULL : it->second; } - void InsertSrcDest( SwFrmFmt* pSrcFmt, SwFrmFmt* pDestFmt ) - { aSrcDestMap[ pSrcFmt ] = pDestFmt; } + void InsertSrcDest( SwFrameFormat* pSrcFormat, SwFrameFormat* pDestFormat ) + { aSrcDestMap[ pSrcFormat ] = pDestFormat; } void ChgBox( SwTableBox* pBox ) { - rOldTbl.GetTabSortBoxes().erase( pBox ); - pNewTblNd->GetTable().GetTabSortBoxes().insert( pBox ); + rOldTable.GetTabSortBoxes().erase( pBox ); + pNewTableNd->GetTable().GetTabSortBoxes().insert( pBox ); } }; @@ -3326,14 +3326,14 @@ static void lcl_SplitTable_CpyBox( SwTableBox* pBox, _SplitTable_Para* pPara ); static void lcl_SplitTable_CpyLine( SwTableLine* pLn, _SplitTable_Para* pPara ) { - SwFrmFmt *pSrcFmt = pLn->GetFrmFmt(); - SwTableLineFmt* pDestFmt = static_cast<SwTableLineFmt*>( pPara->GetDestFmt( pSrcFmt ) ); - if( pDestFmt == NULL ) + SwFrameFormat *pSrcFormat = pLn->GetFrameFormat(); + SwTableLineFormat* pDestFormat = static_cast<SwTableLineFormat*>( pPara->GetDestFormat( pSrcFormat ) ); + if( pDestFormat == NULL ) { - pPara->InsertSrcDest( pSrcFmt, pLn->ClaimFrmFmt() ); + pPara->InsertSrcDest( pSrcFormat, pLn->ClaimFrameFormat() ); } else - pLn->ChgFrmFmt( pDestFmt ); + pLn->ChgFrameFormat( pDestFormat ); for( SwTableBoxes::iterator it = pLn->GetTabBoxes().begin(); it != pLn->GetTabBoxes().end(); ++it) @@ -3342,14 +3342,14 @@ static void lcl_SplitTable_CpyLine( SwTableLine* pLn, _SplitTable_Para* pPara ) static void lcl_SplitTable_CpyBox( SwTableBox* pBox, _SplitTable_Para* pPara ) { - SwFrmFmt *pSrcFmt = pBox->GetFrmFmt(); - SwTableBoxFmt* pDestFmt = static_cast<SwTableBoxFmt*>(pPara->GetDestFmt( pSrcFmt )); - if( pDestFmt == NULL ) + SwFrameFormat *pSrcFormat = pBox->GetFrameFormat(); + SwTableBoxFormat* pDestFormat = static_cast<SwTableBoxFormat*>(pPara->GetDestFormat( pSrcFormat )); + if( pDestFormat == NULL ) { - pPara->InsertSrcDest( pSrcFmt, pBox->ClaimFrmFmt() ); + pPara->InsertSrcDest( pSrcFormat, pBox->ClaimFrameFormat() ); } else - pBox->ChgFrmFmt( pDestFmt ); + pBox->ChgFrameFormat( pDestFormat ); if( pBox->GetSttNd() ) pPara->ChgBox( pBox ); @@ -3369,8 +3369,8 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, bool bAfter, sal_uLong nSttIdx = pNd->FindTableBoxStartNode()->GetIndex(); // Find this Box/top-level line - SwTable& rTbl = pTNd->GetTable(); - SwTableBox* pBox = rTbl.GetTblBox( nSttIdx ); + SwTable& rTable = pTNd->GetTable(); + SwTableBox* pBox = rTable.GetTableBox( nSttIdx ); if( !pBox ) return 0; @@ -3379,95 +3379,95 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, bool bAfter, pLine = pLine->GetUpper()->GetUpper(); // pLine now contains the top-level line - sal_uInt16 nLinePos = rTbl.GetTabLines().GetPos( pLine ); + sal_uInt16 nLinePos = rTable.GetTabLines().GetPos( pLine ); if( USHRT_MAX == nLinePos || - ( bAfter ? ++nLinePos >= rTbl.GetTabLines().size() : !nLinePos )) + ( bAfter ? ++nLinePos >= rTable.GetTabLines().size() : !nLinePos )) return 0; // Not found or last Line! // Find the first Box of the succeeding Line - SwTableLine* pNextLine = rTbl.GetTabLines()[ nLinePos ]; + SwTableLine* pNextLine = rTable.GetTabLines()[ nLinePos ]; pBox = pNextLine->GetTabBoxes()[0]; while( !pBox->GetSttNd() ) pBox = pBox->GetTabLines()[0]->GetTabBoxes()[0]; // Insert an EndNode and TableNode into the Nodes Array - SwTableNode * pNewTblNd; + SwTableNode * pNewTableNd; { - SwEndNode* pOldTblEndNd = pTNd->EndOfSectionNode()->GetEndNode(); - OSL_ENSURE( pOldTblEndNd, "Where is the EndNode?" ); + SwEndNode* pOldTableEndNd = pTNd->EndOfSectionNode()->GetEndNode(); + OSL_ENSURE( pOldTableEndNd, "Where is the EndNode?" ); SwNodeIndex aIdx( *pBox->GetSttNd() ); new SwEndNode( aIdx, *pTNd ); - pNewTblNd = new SwTableNode( aIdx ); - pNewTblNd->GetTable().SetTableModel( rTbl.IsNewModel() ); + pNewTableNd = new SwTableNode( aIdx ); + pNewTableNd->GetTable().SetTableModel( rTable.IsNewModel() ); - pOldTblEndNd->pStartOfSection = pNewTblNd; - pNewTblNd->pEndOfSection = pOldTblEndNd; + pOldTableEndNd->pStartOfSection = pNewTableNd; + pNewTableNd->pEndOfSection = pOldTableEndNd; SwNode* pBoxNd = aIdx.GetNode().GetStartNode(); do { OSL_ENSURE( pBoxNd->IsStartNode(), "This needs to be a StartNode!" ); - pBoxNd->pStartOfSection = pNewTblNd; + pBoxNd->pStartOfSection = pNewTableNd; pBoxNd = (*this)[ pBoxNd->EndOfSectionIndex() + 1 ]; - } while( pBoxNd != pOldTblEndNd ); + } while( pBoxNd != pOldTableEndNd ); } { // Move the Lines - SwTable& rNewTbl = pNewTblNd->GetTable(); - rNewTbl.GetTabLines().insert( rNewTbl.GetTabLines().begin(), - rTbl.GetTabLines().begin() + nLinePos, rTbl.GetTabLines().end() ); + SwTable& rNewTable = pNewTableNd->GetTable(); + rNewTable.GetTabLines().insert( rNewTable.GetTabLines().begin(), + rTable.GetTabLines().begin() + nLinePos, rTable.GetTabLines().end() ); /* From the back (bottom right) to the front (top left) deregister all Boxes from the Chart Data Provider. The Modify event is triggered in the calling function. TL_CHART2: */ - SwChartDataProvider *pPCD = rTbl.GetFrmFmt()->getIDocumentChartDataProviderAccess()->GetChartDataProvider(); + SwChartDataProvider *pPCD = rTable.GetFrameFormat()->getIDocumentChartDataProviderAccess()->GetChartDataProvider(); if( pPCD ) { - for (SwTableLines::size_type k = nLinePos; k < rTbl.GetTabLines().size(); ++k) + for (SwTableLines::size_type k = nLinePos; k < rTable.GetTabLines().size(); ++k) { - const SwTableLines::size_type nLineIdx = (rTbl.GetTabLines().size() - 1) - k + nLinePos; - const SwTableBoxes::size_type nBoxCnt = rTbl.GetTabLines()[ nLineIdx ]->GetTabBoxes().size(); + const SwTableLines::size_type nLineIdx = (rTable.GetTabLines().size() - 1) - k + nLinePos; + const SwTableBoxes::size_type nBoxCnt = rTable.GetTabLines()[ nLineIdx ]->GetTabBoxes().size(); for (SwTableBoxes::size_type j = 0; j < nBoxCnt; ++j) { const SwTableBoxes::size_type nIdx = nBoxCnt - 1 - j; - pPCD->DeleteBox( &rTbl, *rTbl.GetTabLines()[ nLineIdx ]->GetTabBoxes()[nIdx] ); + pPCD->DeleteBox( &rTable, *rTable.GetTabLines()[ nLineIdx ]->GetTabBoxes()[nIdx] ); } } } // Delete - sal_uInt16 nDeleted = rTbl.GetTabLines().size() - nLinePos; - rTbl.GetTabLines().erase( rTbl.GetTabLines().begin() + nLinePos, rTbl.GetTabLines().end() ); + sal_uInt16 nDeleted = rTable.GetTabLines().size() - nLinePos; + rTable.GetTabLines().erase( rTable.GetTabLines().begin() + nLinePos, rTable.GetTabLines().end() ); // Move the affected Boxes. Make the Formats unique and correct the StartNodes - _SplitTable_Para aPara( pNewTblNd, rTbl ); - for( SwTableLine* pNewLine : rNewTbl.GetTabLines() ) + _SplitTable_Para aPara( pNewTableNd, rTable ); + for( SwTableLine* pNewLine : rNewTable.GetTabLines() ) lcl_SplitTable_CpyLine( pNewLine, &aPara ); - rTbl.CleanUpBottomRowSpan( nDeleted ); + rTable.CleanUpBottomRowSpan( nDeleted ); } { // Copy the Table FrmFormat - SwFrmFmt* pOldTblFmt = rTbl.GetFrmFmt(); - SwFrmFmt* pNewTblFmt = pOldTblFmt->GetDoc()->MakeTblFrmFmt( - pOldTblFmt->GetDoc()->GetUniqueTblName(), - pOldTblFmt->GetDoc()->GetDfltFrmFmt() ); + SwFrameFormat* pOldTableFormat = rTable.GetFrameFormat(); + SwFrameFormat* pNewTableFormat = pOldTableFormat->GetDoc()->MakeTableFrameFormat( + pOldTableFormat->GetDoc()->GetUniqueTableName(), + pOldTableFormat->GetDoc()->GetDfltFrameFormat() ); - *pNewTblFmt = *pOldTblFmt; - pNewTblNd->GetTable().RegisterToFormat( *pNewTblFmt ); + *pNewTableFormat = *pOldTableFormat; + pNewTableNd->GetTable().RegisterToFormat( *pNewTableFormat ); // Calculate a new Size? - // lcl_ChgTblSize: Only execute the second call if the first call was + // lcl_ChgTableSize: Only execute the second call if the first call was // successful, thus has an absolute Size - if( bCalcNewSize && lcl_ChgTblSize( rTbl ) ) - lcl_ChgTblSize( pNewTblNd->GetTable() ); + if( bCalcNewSize && lcl_ChgTableSize( rTable ) ) + lcl_ChgTableSize( pNewTableNd->GetTable() ); } // TL_CHART2: need to inform chart of probably changed cell names - rTbl.UpdateCharts(); + rTable.UpdateCharts(); - return pNewTblNd; // That's it! + return pNewTableNd; // That's it! } /** @@ -3478,45 +3478,45 @@ SwTableNode* SwNodes::SplitTable( const SwNodeIndex& rPos, bool bAfter, */ bool SwDoc::MergeTable( const SwPosition& rPos, bool bWithPrev, sal_uInt16 nMode ) { - SwTableNode* pTblNd = rPos.nNode.GetNode().FindTableNode(), *pDelTblNd; - if( !pTblNd ) + SwTableNode* pTableNd = rPos.nNode.GetNode().FindTableNode(), *pDelTableNd; + if( !pTableNd ) return false; SwNodes& rNds = GetNodes(); if( bWithPrev ) - pDelTblNd = rNds[ pTblNd->GetIndex() - 1 ]->FindTableNode(); + pDelTableNd = rNds[ pTableNd->GetIndex() - 1 ]->FindTableNode(); else - pDelTblNd = rNds[ pTblNd->EndOfSectionIndex() + 1 ]->GetTableNode(); - if( !pDelTblNd ) + pDelTableNd = rNds[ pTableNd->EndOfSectionIndex() + 1 ]->GetTableNode(); + if( !pDelTableNd ) return false; - if( pTblNd->GetTable().ISA( SwDDETable ) || - pDelTblNd->GetTable().ISA( SwDDETable )) + if( pTableNd->GetTable().ISA( SwDDETable ) || + pDelTableNd->GetTable().ISA( SwDDETable )) return false; // Delete HTML Layout - pTblNd->GetTable().SetHTMLTableLayout( 0 ); - pDelTblNd->GetTable().SetHTMLTableLayout( 0 ); + pTableNd->GetTable().SetHTMLTableLayout( 0 ); + pDelTableNd->GetTable().SetHTMLTableLayout( 0 ); // Both Tables are present; we can start - SwUndoMergeTbl* pUndo = 0; + SwUndoMergeTable* pUndo = 0; SwHistory* pHistory = 0; if (GetIDocumentUndoRedo().DoesUndo()) { - pUndo = new SwUndoMergeTbl( *pTblNd, *pDelTblNd, bWithPrev, nMode ); + pUndo = new SwUndoMergeTable( *pTableNd, *pDelTableNd, bWithPrev, nMode ); GetIDocumentUndoRedo().AppendUndo(pUndo); pHistory = new SwHistory; } // Adapt all "TableFormulas" - SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() ); - aMsgHnt.DATA.pDelTbl = &pDelTblNd->GetTable(); - aMsgHnt.eFlags = TBL_MERGETBL; - aMsgHnt.pHistory = pHistory; - getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint( &pTableNd->GetTable() ); + aMsgHint.DATA.pDelTable = &pDelTableNd->GetTable(); + aMsgHint.eFlags = TBL_MERGETBL; + aMsgHint.pHistory = pHistory; + getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); // The actual merge - SwNodeIndex aIdx( bWithPrev ? *pTblNd : *pDelTblNd ); + SwNodeIndex aIdx( bWithPrev ? *pTableNd : *pDelTableNd ); bool bRet = rNds.MergeTable( aIdx, !bWithPrev, nMode, pHistory ); if( pHistory ) @@ -3536,40 +3536,40 @@ bool SwDoc::MergeTable( const SwPosition& rPos, bool bWithPrev, sal_uInt16 nMode bool SwNodes::MergeTable( const SwNodeIndex& rPos, bool bWithPrev, sal_uInt16 nMode, SwHistory* ) { - SwTableNode* pDelTblNd = rPos.GetNode().GetTableNode(); - OSL_ENSURE( pDelTblNd, "Where did the TableNode go?" ); + SwTableNode* pDelTableNd = rPos.GetNode().GetTableNode(); + OSL_ENSURE( pDelTableNd, "Where did the TableNode go?" ); - SwTableNode* pTblNd = (*this)[ rPos.GetIndex() - 1]->FindTableNode(); - OSL_ENSURE( pTblNd, "Where did the TableNode go?" ); + SwTableNode* pTableNd = (*this)[ rPos.GetIndex() - 1]->FindTableNode(); + OSL_ENSURE( pTableNd, "Where did the TableNode go?" ); - if( !pDelTblNd || !pTblNd ) + if( !pDelTableNd || !pTableNd ) return false; - pDelTblNd->DelFrms(); + pDelTableNd->DelFrms(); - SwTable& rDelTbl = pDelTblNd->GetTable(); - SwTable& rTbl = pTblNd->GetTable(); + SwTable& rDelTable = pDelTableNd->GetTable(); + SwTable& rTable = pTableNd->GetTable(); // Find Lines for the Layout update _FndBox aFndBox( 0, 0 ); - aFndBox.SetTableLines( rTbl ); - aFndBox.DelFrms( rTbl ); + aFndBox.SetTableLines( rTable ); + aFndBox.DelFrms( rTable ); // TL_CHART2: // tell the charts about the table to be deleted and have them use their own data - GetDoc()->getIDocumentChartDataProviderAccess().CreateChartInternalDataProviders( &rDelTbl ); + GetDoc()->getIDocumentChartDataProviderAccess().CreateChartInternalDataProviders( &rDelTable ); // Sync the TableFormat's Width { - const SwFmtFrmSize& rTblSz = rTbl.GetFrmFmt()->GetFrmSize(); - const SwFmtFrmSize& rDelTblSz = rDelTbl.GetFrmFmt()->GetFrmSize(); - if( rTblSz != rDelTblSz ) + const SwFormatFrmSize& rTableSz = rTable.GetFrameFormat()->GetFrmSize(); + const SwFormatFrmSize& rDelTableSz = rDelTable.GetFrameFormat()->GetFrmSize(); + if( rTableSz != rDelTableSz ) { // The needs correction if( bWithPrev ) - rDelTbl.GetFrmFmt()->SetFmtAttr( rTblSz ); + rDelTable.GetFrameFormat()->SetFormatAttr( rTableSz ); else - rTbl.GetFrmFmt()->SetFmtAttr( rDelTblSz ); + rTable.GetFrameFormat()->SetFormatAttr( rDelTableSz ); } } @@ -3577,44 +3577,44 @@ bool SwNodes::MergeTable( const SwNodeIndex& rPos, bool bWithPrev, { // Transfer all Attributes of the succeeding Table to the preceding one // We do this, because the succeeding one is deleted when deleting the Node - rTbl.SetRowsToRepeat( rDelTbl.GetRowsToRepeat() ); - rTbl.SetTblChgMode( rDelTbl.GetTblChgMode() ); + rTable.SetRowsToRepeat( rDelTable.GetRowsToRepeat() ); + rTable.SetTableChgMode( rDelTable.GetTableChgMode() ); - rTbl.GetFrmFmt()->LockModify(); - *rTbl.GetFrmFmt() = *rDelTbl.GetFrmFmt(); + rTable.GetFrameFormat()->LockModify(); + *rTable.GetFrameFormat() = *rDelTable.GetFrameFormat(); // Also switch the Name - rTbl.GetFrmFmt()->SetName( rDelTbl.GetFrmFmt()->GetName() ); - rTbl.GetFrmFmt()->UnlockModify(); + rTable.GetFrameFormat()->SetName( rDelTable.GetFrameFormat()->GetName() ); + rTable.GetFrameFormat()->UnlockModify(); } // Move the Lines and Boxes - SwTableLines::size_type nOldSize = rTbl.GetTabLines().size(); - rTbl.GetTabLines().insert( rTbl.GetTabLines().begin() + nOldSize, - rDelTbl.GetTabLines().begin(), rDelTbl.GetTabLines().end() ); - rDelTbl.GetTabLines().clear(); + SwTableLines::size_type nOldSize = rTable.GetTabLines().size(); + rTable.GetTabLines().insert( rTable.GetTabLines().begin() + nOldSize, + rDelTable.GetTabLines().begin(), rDelTable.GetTabLines().end() ); + rDelTable.GetTabLines().clear(); - rTbl.GetTabSortBoxes().insert( rDelTbl.GetTabSortBoxes() ); - rDelTbl.GetTabSortBoxes().clear(); + rTable.GetTabSortBoxes().insert( rDelTable.GetTabSortBoxes() ); + rDelTable.GetTabSortBoxes().clear(); // The preceding Table always remains, while the succeeding one is deleted - SwEndNode* pTblEndNd = pDelTblNd->EndOfSectionNode(); - pTblNd->pEndOfSection = pTblEndNd; + SwEndNode* pTableEndNd = pDelTableNd->EndOfSectionNode(); + pTableNd->pEndOfSection = pTableEndNd; - SwNodeIndex aIdx( *pDelTblNd, 1 ); + SwNodeIndex aIdx( *pDelTableNd, 1 ); SwNode* pBoxNd = aIdx.GetNode().GetStartNode(); do { OSL_ENSURE( pBoxNd->IsStartNode(), "This needs to be a StartNode!" ); - pBoxNd->pStartOfSection = pTblNd; + pBoxNd->pStartOfSection = pTableNd; pBoxNd = (*this)[ pBoxNd->EndOfSectionIndex() + 1 ]; - } while( pBoxNd != pTblEndNd ); - pBoxNd->pStartOfSection = pTblNd; + } while( pBoxNd != pTableEndNd ); + pBoxNd->pStartOfSection = pTableNd; aIdx -= 2; DelNodes( aIdx, 2 ); // tweak the conditional styles at the first inserted Line - const SwTableLine* pFirstLn = rTbl.GetTabLines()[ nOldSize ]; + const SwTableLine* pFirstLn = rTable.GetTabLines()[ nOldSize ]; if( 1 == nMode ) { // Set Header Template in the Line and save in the History @@ -3625,69 +3625,69 @@ bool SwNodes::MergeTable( const SwNodeIndex& rPos, bool bWithPrev, // Clean up the Borders if( nOldSize ) { - _SwGCLineBorder aPara( rTbl ); + _SwGCLineBorder aPara( rTable ); aPara.nLinePos = --nOldSize; - pFirstLn = rTbl.GetTabLines()[ nOldSize ]; + pFirstLn = rTable.GetTabLines()[ nOldSize ]; sw_GC_Line_Border( pFirstLn, &aPara ); } // Update Layout - aFndBox.MakeFrms( rTbl ); + aFndBox.MakeFrms( rTable ); return true; } // Use the PtrArray's ForEach method -struct _SetAFmtTabPara +struct _SetAFormatTabPara { - SwTableAutoFmt& rTblFmt; - SwUndoTblAutoFmt* pUndo; + SwTableAutoFormat& rTableFormat; + SwUndoTableAutoFormat* pUndo; sal_uInt16 nEndBox, nCurBox; - sal_uInt8 nAFmtLine, nAFmtBox; + sal_uInt8 nAFormatLine, nAFormatBox; - _SetAFmtTabPara( const SwTableAutoFmt& rNew ) - : rTblFmt( (SwTableAutoFmt&)rNew ), pUndo( 0 ), - nEndBox( 0 ), nCurBox( 0 ), nAFmtLine( 0 ), nAFmtBox( 0 ) + _SetAFormatTabPara( const SwTableAutoFormat& rNew ) + : rTableFormat( (SwTableAutoFormat&)rNew ), pUndo( 0 ), + nEndBox( 0 ), nCurBox( 0 ), nAFormatLine( 0 ), nAFormatBox( 0 ) {} }; // Forward declare so that the Lines and Boxes can use recursion -static bool lcl_SetAFmtBox(_FndBox &, _SetAFmtTabPara *pSetPara); -static bool lcl_SetAFmtLine(_FndLine &, _SetAFmtTabPara *pPara); +static bool lcl_SetAFormatBox(_FndBox &, _SetAFormatTabPara *pSetPara); +static bool lcl_SetAFormatLine(_FndLine &, _SetAFormatTabPara *pPara); -static bool lcl_SetAFmtLine(_FndLine & rLine, _SetAFmtTabPara *pPara) +static bool lcl_SetAFormatLine(_FndLine & rLine, _SetAFormatTabPara *pPara) { for (_FndBoxes::iterator it = rLine.GetBoxes().begin(); it != rLine.GetBoxes().end(); ++it) { - lcl_SetAFmtBox(*it, pPara); + lcl_SetAFormatBox(*it, pPara); } return true; } -static bool lcl_SetAFmtBox( _FndBox & rBox, _SetAFmtTabPara *pSetPara ) +static bool lcl_SetAFormatBox( _FndBox & rBox, _SetAFormatTabPara *pSetPara ) { if (!rBox.GetUpper()->GetUpper()) // Box on first level? { if( !pSetPara->nCurBox ) - pSetPara->nAFmtBox = 0; + pSetPara->nAFormatBox = 0; else if( pSetPara->nCurBox == pSetPara->nEndBox ) - pSetPara->nAFmtBox = 3; + pSetPara->nAFormatBox = 3; else - pSetPara->nAFmtBox = (sal_uInt8)(1 + ((pSetPara->nCurBox-1) & 1)); + pSetPara->nAFormatBox = (sal_uInt8)(1 + ((pSetPara->nCurBox-1) & 1)); } if (rBox.GetBox()->GetSttNd()) { SwTableBox* pSetBox = static_cast<SwTableBox*>(rBox.GetBox()); - SwDoc* pDoc = pSetBox->GetFrmFmt()->GetDoc(); + SwDoc* pDoc = pSetBox->GetFrameFormat()->GetDoc(); SfxItemSet aCharSet( pDoc->GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1 ); SfxItemSet aBoxSet( pDoc->GetAttrPool(), aTableBoxSetRange ); - sal_uInt8 nPos = pSetPara->nAFmtLine * 4 + pSetPara->nAFmtBox; - pSetPara->rTblFmt.UpdateToSet( nPos, aCharSet, - SwTableAutoFmt::UPDATE_CHAR, 0 ); - pSetPara->rTblFmt.UpdateToSet( nPos, aBoxSet, - SwTableAutoFmt::UPDATE_BOX, + sal_uInt8 nPos = pSetPara->nAFormatLine * 4 + pSetPara->nAFormatBox; + pSetPara->rTableFormat.UpdateToSet( nPos, aCharSet, + SwTableAutoFormat::UPDATE_CHAR, 0 ); + pSetPara->rTableFormat.UpdateToSet( nPos, aBoxSet, + SwTableAutoFormat::UPDATE_BOX, pDoc->GetNumberFormatter( true ) ); if( aCharSet.Count() ) { @@ -3695,7 +3695,7 @@ static bool lcl_SetAFmtBox( _FndBox & rBox, _SetAFmtTabPara *pSetPara ) sal_uLong nEndNd = pSetBox->GetSttNd()->EndOfSectionIndex(); for( ; nSttNd < nEndNd; ++nSttNd ) { - SwCntntNode* pNd = pDoc->GetNodes()[ nSttNd ]->GetCntntNode(); + SwContentNode* pNd = pDoc->GetNodes()[ nSttNd ]->GetContentNode(); if( pNd ) pNd->SetAttr( aCharSet ); } @@ -3705,15 +3705,15 @@ static bool lcl_SetAFmtBox( _FndBox & rBox, _SetAFmtTabPara *pSetPara ) { if( pSetPara->pUndo && SfxItemState::SET == aBoxSet.GetItemState( RES_BOXATR_FORMAT )) - pSetPara->pUndo->SaveBoxCntnt( *pSetBox ); + pSetPara->pUndo->SaveBoxContent( *pSetBox ); - pSetBox->ClaimFrmFmt()->SetFmtAttr( aBoxSet ); + pSetBox->ClaimFrameFormat()->SetFormatAttr( aBoxSet ); } } else { for( _FndLine& rFndLine : rBox.GetLines() ) - lcl_SetAFmtLine( rFndLine, pSetPara ); + lcl_SetAFormatLine( rFndLine, pSetPara ); } if (!rBox.GetUpper()->GetUpper()) // a BaseLine @@ -3724,23 +3724,23 @@ static bool lcl_SetAFmtBox( _FndBox & rBox, _SetAFmtTabPara *pSetPara ) /** * AutoFormat for the Table/TableSelection */ -bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNew ) +bool SwDoc::SetTableAutoFormat( const SwSelBoxes& rBoxes, const SwTableAutoFormat& rNew ) { OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); - SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode()); - if( !pTblNd ) + SwTableNode* pTableNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode()); + if( !pTableNd ) return false; // Find all Boxes/Lines _FndBox aFndBox( 0, 0 ); { _FndPara aPara( rBoxes, &aFndBox ); - ForEach_FndLineCopyCol( pTblNd->GetTable().GetTabLines(), &aPara ); + ForEach_FndLineCopyCol( pTableNd->GetTable().GetTabLines(), &aPara ); } if( aFndBox.GetLines().empty() ) return false; - SwTable &table = pTblNd->GetTable(); + SwTable &table = pTableNd->GetTable(); table.SetHTMLTableLayout( 0 ); _FndBox* pFndBox = &aFndBox; @@ -3754,18 +3754,18 @@ bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNe pFndBox = pFndBox->GetUpper()->GetUpper(); // Disable Undo, but first store parameters - SwUndoTblAutoFmt* pUndo = 0; + SwUndoTableAutoFormat* pUndo = 0; bool const bUndo(GetIDocumentUndoRedo().DoesUndo()); if (bUndo) { - pUndo = new SwUndoTblAutoFmt( *pTblNd, rNew ); + pUndo = new SwUndoTableAutoFormat( *pTableNd, rNew ); GetIDocumentUndoRedo().AppendUndo(pUndo); GetIDocumentUndoRedo().DoUndo(false); } rNew.RestoreTableProperties(table); - _SetAFmtTabPara aPara( rNew ); + _SetAFormatTabPara aPara( rNew ); _FndLines& rFLns = pFndBox->GetLines(); for( _FndLines::size_type n = 0; n < rFLns.size(); ++n ) @@ -3777,20 +3777,20 @@ bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNe pLine->SetUpper( 0 ); if( !n ) - aPara.nAFmtLine = 0; + aPara.nAFormatLine = 0; else if (static_cast<size_t>(n+1) == rFLns.size()) - aPara.nAFmtLine = 3; + aPara.nAFormatLine = 3; else - aPara.nAFmtLine = (sal_uInt8)(1 + ((n-1) & 1 )); + aPara.nAFormatLine = (sal_uInt8)(1 + ((n-1) & 1 )); - aPara.nAFmtBox = 0; + aPara.nAFormatBox = 0; aPara.nCurBox = 0; aPara.nEndBox = pLine->GetBoxes().size()-1; aPara.pUndo = pUndo; for (_FndBoxes::iterator it = pLine->GetBoxes().begin(); it != pLine->GetBoxes().end(); ++it) { - lcl_SetAFmtBox(*it, &aPara); + lcl_SetAFormatBox(*it, &aPara); } pLine->SetUpper( pSaveBox ); @@ -3810,24 +3810,24 @@ bool SwDoc::SetTableAutoFmt( const SwSelBoxes& rBoxes, const SwTableAutoFmt& rNe /** * Find out who has the Attributes */ -bool SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet ) +bool SwDoc::GetTableAutoFormat( const SwSelBoxes& rBoxes, SwTableAutoFormat& rGet ) { OSL_ENSURE( !rBoxes.empty(), "No valid Box list" ); - SwTableNode* pTblNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode()); - if( !pTblNd ) + SwTableNode* pTableNd = const_cast<SwTableNode*>(rBoxes[0]->GetSttNd()->FindTableNode()); + if( !pTableNd ) return false; // Find all Boxes/Lines _FndBox aFndBox( 0, 0 ); { _FndPara aPara( rBoxes, &aFndBox ); - ForEach_FndLineCopyCol( pTblNd->GetTable().GetTabLines(), &aPara ); + ForEach_FndLineCopyCol( pTableNd->GetTable().GetTabLines(), &aPara ); } if( aFndBox.GetLines().empty() ) return false; // Store table properties - SwTable &table = pTblNd->GetTable(); + SwTable &table = pTableNd->GetTable(); rGet.StoreTableProperties(table); _FndBox* pFndBox = &aFndBox; @@ -3867,15 +3867,15 @@ bool SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet ) sal_uInt8 nPos = nLine * 4 + nBox; SwNodeIndex aIdx( *pFBox->GetSttNd(), 1 ); - SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode(); + SwContentNode* pCNd = aIdx.GetNode().GetContentNode(); if( !pCNd ) pCNd = GetNodes().GoNext( &aIdx ); if( pCNd ) rGet.UpdateFromSet( nPos, pCNd->GetSwAttrSet(), - SwTableAutoFmt::UPDATE_CHAR, 0 ); - rGet.UpdateFromSet( nPos, pFBox->GetFrmFmt()->GetAttrSet(), - SwTableAutoFmt::UPDATE_BOX, + SwTableAutoFormat::UPDATE_CHAR, 0 ); + rGet.UpdateFromSet( nPos, pFBox->GetFrameFormat()->GetAttrSet(), + SwTableAutoFormat::UPDATE_BOX, GetNumberFormatter( true ) ); } } @@ -3883,40 +3883,40 @@ bool SwDoc::GetTableAutoFmt( const SwSelBoxes& rBoxes, SwTableAutoFmt& rGet ) return true; } -OUString SwDoc::GetUniqueTblName() const +OUString SwDoc::GetUniqueTableName() const { if( IsInMailMerge()) { OUString newName = "MailMergeTable" + OStringToOUString( DateTimeToOString( DateTime( DateTime::SYSTEM )), RTL_TEXTENCODING_ASCII_US ) - + OUString::number( mpTblFrmFmtTbl->size() + 1 ); + + OUString::number( mpTableFrameFormatTable->size() + 1 ); return newName; } ResId aId( STR_TABLE_DEFNAME, *pSwResMgr ); const OUString aName( aId ); - const size_t nFlagSize = ( mpTblFrmFmtTbl->size() / 8 ) + 2; + const size_t nFlagSize = ( mpTableFrameFormatTable->size() / 8 ) + 2; sal_uInt8* pSetFlags = new sal_uInt8[ nFlagSize ]; memset( pSetFlags, 0, nFlagSize ); - for( size_t n = 0; n < mpTblFrmFmtTbl->size(); ++n ) + for( size_t n = 0; n < mpTableFrameFormatTable->size(); ++n ) { - const SwFrmFmt* pFmt = (*mpTblFrmFmtTbl)[ n ]; - if( !pFmt->IsDefault() && IsUsed( *pFmt ) && - pFmt->GetName().startsWith( aName ) ) + const SwFrameFormat* pFormat = (*mpTableFrameFormatTable)[ n ]; + if( !pFormat->IsDefault() && IsUsed( *pFormat ) && + pFormat->GetName().startsWith( aName ) ) { // Get number and set the Flag const sal_Int32 nNmLen = aName.getLength(); - size_t nNum = pFmt->GetName().copy( nNmLen ).toInt32(); - if( nNum-- && nNum < mpTblFrmFmtTbl->size() ) + size_t nNum = pFormat->GetName().copy( nNmLen ).toInt32(); + if( nNum-- && nNum < mpTableFrameFormatTable->size() ) pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 )); } } // All numbers are flagged properly, thus calculate the right number - size_t nNum = mpTblFrmFmtTbl->size(); + size_t nNum = mpTableFrameFormatTable->size(); for( size_t n = 0; n < nFlagSize; ++n ) { auto nTmp = pSetFlags[ n ]; @@ -3937,60 +3937,60 @@ OUString SwDoc::GetUniqueTblName() const return aName + OUString::number( ++nNum ); } -SwTableFmt* SwDoc::FindTblFmtByName( const OUString& rName, bool bAll ) const +SwTableFormat* SwDoc::FindTableFormatByName( const OUString& rName, bool bAll ) const { - const SwFmt* pRet = 0; + const SwFormat* pRet = 0; if( bAll ) - pRet = FindFmtByName( *mpTblFrmFmtTbl, rName ); + pRet = FindFormatByName( *mpTableFrameFormatTable, rName ); else { // Only the ones set in the Doc - for( size_t n = 0; n < mpTblFrmFmtTbl->size(); ++n ) + for( size_t n = 0; n < mpTableFrameFormatTable->size(); ++n ) { - const SwFrmFmt* pFmt = (*mpTblFrmFmtTbl)[ n ]; - if( !pFmt->IsDefault() && IsUsed( *pFmt ) && - pFmt->GetName() == rName ) + const SwFrameFormat* pFormat = (*mpTableFrameFormatTable)[ n ]; + if( !pFormat->IsDefault() && IsUsed( *pFormat ) && + pFormat->GetName() == rName ) { - pRet = pFmt; + pRet = pFormat; break; } } } - return const_cast<SwTableFmt*>(static_cast<const SwTableFmt*>(pRet)); + return const_cast<SwTableFormat*>(static_cast<const SwTableFormat*>(pRet)); } bool SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, sal_uInt16 eType, SwTwips nAbsDiff, SwTwips nRelDiff ) { - SwTableNode* pTblNd = const_cast<SwTableNode*>(rAktBox.GetSttNd()->FindTableNode()); + SwTableNode* pTableNd = const_cast<SwTableNode*>(rAktBox.GetSttNd()->FindTableNode()); SwUndo* pUndo = 0; - if( nsTblChgWidthHeightType::WH_FLAG_INSDEL & eType && pTblNd->GetTable().ISA( SwDDETable )) + if( nsTableChgWidthHeightType::WH_FLAG_INSDEL & eType && pTableNd->GetTable().ISA( SwDDETable )) return false; - SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() ); - aMsgHnt.eFlags = TBL_BOXPTR; - getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint( &pTableNd->GetTable() ); + aMsgHint.eFlags = TBL_BOXPTR; + getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); bool const bUndo(GetIDocumentUndoRedo().DoesUndo()); bool bRet = false; switch( eType & 0xff ) { - case nsTblChgWidthHeightType::WH_COL_LEFT: - case nsTblChgWidthHeightType::WH_COL_RIGHT: - case nsTblChgWidthHeightType::WH_CELL_LEFT: - case nsTblChgWidthHeightType::WH_CELL_RIGHT: + case nsTableChgWidthHeightType::WH_COL_LEFT: + case nsTableChgWidthHeightType::WH_COL_RIGHT: + case nsTableChgWidthHeightType::WH_CELL_LEFT: + case nsTableChgWidthHeightType::WH_CELL_RIGHT: { - bRet = pTblNd->GetTable().SetColWidth( rAktBox, + bRet = pTableNd->GetTable().SetColWidth( rAktBox, eType, nAbsDiff, nRelDiff, (bUndo) ? &pUndo : 0 ); } break; - case nsTblChgWidthHeightType::WH_ROW_TOP: - case nsTblChgWidthHeightType::WH_ROW_BOTTOM: - case nsTblChgWidthHeightType::WH_CELL_TOP: - case nsTblChgWidthHeightType::WH_CELL_BOTTOM: - bRet = pTblNd->GetTable().SetRowHeight( rAktBox, + case nsTableChgWidthHeightType::WH_ROW_TOP: + case nsTableChgWidthHeightType::WH_ROW_BOTTOM: + case nsTableChgWidthHeightType::WH_CELL_TOP: + case nsTableChgWidthHeightType::WH_CELL_BOTTOM: + bRet = pTableNd->GetTable().SetRowHeight( rAktBox, eType, nAbsDiff, nRelDiff, (bUndo) ? &pUndo : 0 ); break; @@ -4005,28 +4005,28 @@ bool SwDoc::SetColRowWidthHeight( SwTableBox& rAktBox, sal_uInt16 eType, if( bRet ) { getIDocumentState().SetModified(); - if( nsTblChgWidthHeightType::WH_FLAG_INSDEL & eType ) + if( nsTableChgWidthHeightType::WH_FLAG_INSDEL & eType ) getIDocumentFieldsAccess().SetFieldsDirty( true, NULL, 0 ); } return bRet; } -void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, bool bCallUpdate ) +void SwDoc::ChkBoxNumFormat( SwTableBox& rBox, bool bCallUpdate ) { // Optimization: If the Box says it's Text, it remains Text - const SfxPoolItem* pNumFmtItem = 0; - if( SfxItemState::SET == rBox.GetFrmFmt()->GetItemState( RES_BOXATR_FORMAT, - false, &pNumFmtItem ) && GetNumberFormatter()->IsTextFormat( - static_cast<const SwTblBoxNumFormat*>(pNumFmtItem)->GetValue() )) + const SfxPoolItem* pNumFormatItem = 0; + if( SfxItemState::SET == rBox.GetFrameFormat()->GetItemState( RES_BOXATR_FORMAT, + false, &pNumFormatItem ) && GetNumberFormatter()->IsTextFormat( + static_cast<const SwTableBoxNumFormat*>(pNumFormatItem)->GetValue() )) return ; - SwUndoTblNumFmt* pUndo = 0; + SwUndoTableNumFormat* pUndo = 0; - bool bIsEmptyTxtNd; + bool bIsEmptyTextNd; bool bChgd = true; - sal_uInt32 nFmtIdx; + sal_uInt32 nFormatIdx; double fNumber; - if( rBox.HasNumCntnt( fNumber, nFmtIdx, bIsEmptyTxtNd ) ) + if( rBox.HasNumContent( fNumber, nFormatIdx, bIsEmptyTextNd ) ) { if( !rBox.IsNumberChanged() ) bChgd = false; @@ -4035,31 +4035,31 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, bool bCallUpdate ) if (GetIDocumentUndoRedo().DoesUndo()) { GetIDocumentUndoRedo().StartUndo( UNDO_TABLE_AUTOFMT, NULL ); - pUndo = new SwUndoTblNumFmt( rBox ); - pUndo->SetNumFmt( nFmtIdx, fNumber ); + pUndo = new SwUndoTableNumFormat( rBox ); + pUndo->SetNumFormat( nFormatIdx, fNumber ); } - SwTableBoxFmt* pBoxFmt = static_cast<SwTableBoxFmt*>(rBox.GetFrmFmt()); + SwTableBoxFormat* pBoxFormat = static_cast<SwTableBoxFormat*>(rBox.GetFrameFormat()); SfxItemSet aBoxSet( GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); bool bLockModify = true; bool bSetNumberFormat = false; - const bool bForceNumberFormat = IsInsTblFormatNum() && IsInsTblChangeNumFormat(); + const bool bForceNumberFormat = IsInsTableFormatNum() && IsInsTableChangeNumFormat(); // if the user forced a number format in this cell previously, // keep it, unless the user set that she wants the full number // format recognition - if( pNumFmtItem && !bForceNumberFormat ) + if( pNumFormatItem && !bForceNumberFormat ) { - sal_uLong nOldNumFmt = static_cast<const SwTblBoxNumFormat*>(pNumFmtItem)->GetValue(); - SvNumberFormatter* pNumFmtr = GetNumberFormatter(); + sal_uLong nOldNumFormat = static_cast<const SwTableBoxNumFormat*>(pNumFormatItem)->GetValue(); + SvNumberFormatter* pNumFormatr = GetNumberFormatter(); - short nFmtType = pNumFmtr->GetType( nFmtIdx ); - if( nFmtType == pNumFmtr->GetType( nOldNumFmt ) || css::util::NumberFormat::NUMBER == nFmtType ) + short nFormatType = pNumFormatr->GetType( nFormatIdx ); + if( nFormatType == pNumFormatr->GetType( nOldNumFormat ) || css::util::NumberFormat::NUMBER == nFormatType ) { // Current and specified NumFormat match // -> keep old Format - nFmtIdx = nOldNumFmt; + nFormatIdx = nOldNumFormat; bSetNumberFormat = true; } else @@ -4072,58 +4072,58 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, bool bCallUpdate ) if( bSetNumberFormat || bForceNumberFormat ) { - pBoxFmt = static_cast<SwTableBoxFmt*>(rBox.ClaimFrmFmt()); + pBoxFormat = static_cast<SwTableBoxFormat*>(rBox.ClaimFrameFormat()); - aBoxSet.Put( SwTblBoxValue( fNumber )); - aBoxSet.Put( SwTblBoxNumFormat( nFmtIdx )); + aBoxSet.Put( SwTableBoxValue( fNumber )); + aBoxSet.Put( SwTableBoxNumFormat( nFormatIdx )); } // It's not enough to only reset the Formula. // Make sure that the Text is formatted accordingly - if( !bSetNumberFormat && !bIsEmptyTxtNd && pNumFmtItem ) + if( !bSetNumberFormat && !bIsEmptyTextNd && pNumFormatItem ) { // Just resetting Attributes is not enough // Make sure that the Text is formatted accordingly - pBoxFmt->SetFmtAttr( *GetDfltAttr( RES_BOXATR_FORMAT )); + pBoxFormat->SetFormatAttr( *GetDfltAttr( RES_BOXATR_FORMAT )); } - if( bLockModify ) pBoxFmt->LockModify(); - pBoxFmt->ResetFmtAttr( RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); - if( bLockModify ) pBoxFmt->UnlockModify(); + if( bLockModify ) pBoxFormat->LockModify(); + pBoxFormat->ResetFormatAttr( RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); + if( bLockModify ) pBoxFormat->UnlockModify(); if( bSetNumberFormat ) - pBoxFmt->SetFmtAttr( aBoxSet ); + pBoxFormat->SetFormatAttr( aBoxSet ); } } else { // It's not a number - const SfxPoolItem* pValueItem = 0, *pFmtItem = 0; - SwTableBoxFmt* pBoxFmt = static_cast<SwTableBoxFmt*>(rBox.GetFrmFmt()); - if( SfxItemState::SET == pBoxFmt->GetItemState( RES_BOXATR_FORMAT, - false, &pFmtItem ) || - SfxItemState::SET == pBoxFmt->GetItemState( RES_BOXATR_VALUE, + const SfxPoolItem* pValueItem = 0, *pFormatItem = 0; + SwTableBoxFormat* pBoxFormat = static_cast<SwTableBoxFormat*>(rBox.GetFrameFormat()); + if( SfxItemState::SET == pBoxFormat->GetItemState( RES_BOXATR_FORMAT, + false, &pFormatItem ) || + SfxItemState::SET == pBoxFormat->GetItemState( RES_BOXATR_VALUE, false, &pValueItem )) { if (GetIDocumentUndoRedo().DoesUndo()) { GetIDocumentUndoRedo().StartUndo( UNDO_TABLE_AUTOFMT, NULL ); - pUndo = new SwUndoTblNumFmt( rBox ); + pUndo = new SwUndoTableNumFormat( rBox ); } - pBoxFmt = static_cast<SwTableBoxFmt*>(rBox.ClaimFrmFmt()); + pBoxFormat = static_cast<SwTableBoxFormat*>(rBox.ClaimFrameFormat()); // Remove all number formats sal_uInt16 nWhich1 = RES_BOXATR_FORMULA; - if( !bIsEmptyTxtNd ) + if( !bIsEmptyTextNd ) { nWhich1 = RES_BOXATR_FORMAT; // Just resetting Attributes is not enough // Make sure that the Text is formatted accordingly - pBoxFmt->SetFmtAttr( *GetDfltAttr( nWhich1 )); + pBoxFormat->SetFormatAttr( *GetDfltAttr( nWhich1 )); } - pBoxFmt->ResetFmtAttr( nWhich1, RES_BOXATR_VALUE ); + pBoxFormat->ResetFormatAttr( nWhich1, RES_BOXATR_VALUE ); } else bChgd = false; @@ -4138,42 +4138,42 @@ void SwDoc::ChkBoxNumFmt( SwTableBox& rBox, bool bCallUpdate ) GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); } - const SwTableNode* pTblNd = rBox.GetSttNd()->FindTableNode(); + const SwTableNode* pTableNd = rBox.GetSttNd()->FindTableNode(); if( bCallUpdate ) { - SwTableFmlUpdate aTblUpdate( &pTblNd->GetTable() ); - getIDocumentFieldsAccess().UpdateTblFlds( &aTblUpdate ); + SwTableFormulaUpdate aTableUpdate( &pTableNd->GetTable() ); + getIDocumentFieldsAccess().UpdateTableFields( &aTableUpdate ); // TL_CHART2: update charts (when cursor leaves cell and // automatic update is enabled) if (AUTOUPD_FIELD_AND_CHARTS == GetDocumentSettingManager().getFieldUpdateFlags(true)) - pTblNd->GetTable().UpdateCharts(); + pTableNd->GetTable().UpdateCharts(); } getIDocumentState().SetModified(); } } -void SwDoc::SetTblBoxFormulaAttrs( SwTableBox& rBox, const SfxItemSet& rSet ) +void SwDoc::SetTableBoxFormulaAttrs( SwTableBox& rBox, const SfxItemSet& rSet ) { if (GetIDocumentUndoRedo().DoesUndo()) { - GetIDocumentUndoRedo().AppendUndo( new SwUndoTblNumFmt(rBox, &rSet) ); + GetIDocumentUndoRedo().AppendUndo( new SwUndoTableNumFormat(rBox, &rSet) ); } - SwFrmFmt* pBoxFmt = rBox.ClaimFrmFmt(); + SwFrameFormat* pBoxFormat = rBox.ClaimFrameFormat(); if( SfxItemState::SET == rSet.GetItemState( RES_BOXATR_FORMULA )) { - pBoxFmt->LockModify(); - pBoxFmt->ResetFmtAttr( RES_BOXATR_VALUE ); - pBoxFmt->UnlockModify(); + pBoxFormat->LockModify(); + pBoxFormat->ResetFormatAttr( RES_BOXATR_VALUE ); + pBoxFormat->UnlockModify(); } else if( SfxItemState::SET == rSet.GetItemState( RES_BOXATR_VALUE )) { - pBoxFmt->LockModify(); - pBoxFmt->ResetFmtAttr( RES_BOXATR_FORMULA ); - pBoxFmt->UnlockModify(); + pBoxFormat->LockModify(); + pBoxFormat->ResetFormatAttr( RES_BOXATR_FORMULA ); + pBoxFormat->UnlockModify(); } - pBoxFmt->SetFmtAttr( rSet ); + pBoxFormat->SetFormatAttr( rSet ); getIDocumentState().SetModified(); } @@ -4181,21 +4181,21 @@ void SwDoc::ClearLineNumAttrs( SwPosition & rPos ) { SwPaM aPam(rPos); aPam.Move(fnMoveBackward); - SwCntntNode *pNode = aPam.GetCntntNode(); + SwContentNode *pNode = aPam.GetContentNode(); if ( 0 == pNode ) return ; - if( pNode->IsTxtNode() ) + if( pNode->IsTextNode() ) { - SwTxtNode * pTxtNode = pNode->GetTxtNode(); - if (pTxtNode && pTxtNode->IsNumbered() - && pTxtNode->GetTxt().isEmpty()) + SwTextNode * pTextNode = pNode->GetTextNode(); + if (pTextNode && pTextNode->IsNumbered() + && pTextNode->GetText().isEmpty()) { - const SfxPoolItem* pFmtItem = 0; - SfxItemSet rSet( const_cast<SwAttrPool&>(pTxtNode->GetDoc()->GetAttrPool()), + const SfxPoolItem* pFormatItem = 0; + SfxItemSet rSet( const_cast<SwAttrPool&>(pTextNode->GetDoc()->GetAttrPool()), RES_PARATR_BEGIN, RES_PARATR_END - 1, 0); - pTxtNode->SwCntntNode::GetAttr( rSet ); - if ( SfxItemState::SET == rSet.GetItemState( RES_PARATR_NUMRULE , false , &pFmtItem ) ) + pTextNode->SwContentNode::GetAttr( rSet ); + if ( SfxItemState::SET == rSet.GetItemState( RES_PARATR_NUMRULE , false , &pFormatItem ) ) { SwUndoDelNum * pUndo; if( GetIDocumentUndoRedo().DoesUndo() ) @@ -4206,13 +4206,13 @@ void SwDoc::ClearLineNumAttrs( SwPosition & rPos ) else pUndo = 0; SwRegHistory aRegH( pUndo ? pUndo->GetHistory() : 0 ); - aRegH.RegisterInModify( pTxtNode , *pTxtNode ); + aRegH.RegisterInModify( pTextNode , *pTextNode ); if ( pUndo ) - pUndo->AddNode( *pTxtNode , false ); - SfxStringItem * pNewItem = static_cast<SfxStringItem*>(pFmtItem->Clone()); + pUndo->AddNode( *pTextNode , false ); + SfxStringItem * pNewItem = static_cast<SfxStringItem*>(pFormatItem->Clone()); pNewItem->SetValue(OUString()); rSet.Put( *pNewItem ); - pTxtNode->SetAttr( rSet ); + pTextNode->SetAttr( rSet ); delete pNewItem; } } @@ -4227,32 +4227,32 @@ void SwDoc::ClearBoxNumAttrs( const SwNodeIndex& rNode ) 2 == pSttNd->EndOfSectionIndex() - pSttNd->GetIndex() ) { SwTableBox* pBox = pSttNd->FindTableNode()->GetTable(). - GetTblBox( pSttNd->GetIndex() ); + GetTableBox( pSttNd->GetIndex() ); - const SfxPoolItem* pFmtItem = 0; - const SfxItemSet& rSet = pBox->GetFrmFmt()->GetAttrSet(); - if( SfxItemState::SET == rSet.GetItemState( RES_BOXATR_FORMAT, false, &pFmtItem ) || + const SfxPoolItem* pFormatItem = 0; + const SfxItemSet& rSet = pBox->GetFrameFormat()->GetAttrSet(); + if( SfxItemState::SET == rSet.GetItemState( RES_BOXATR_FORMAT, false, &pFormatItem ) || SfxItemState::SET == rSet.GetItemState( RES_BOXATR_FORMULA, false ) || SfxItemState::SET == rSet.GetItemState( RES_BOXATR_VALUE, false )) { if (GetIDocumentUndoRedo().DoesUndo()) { - GetIDocumentUndoRedo().AppendUndo(new SwUndoTblNumFmt(*pBox)); + GetIDocumentUndoRedo().AppendUndo(new SwUndoTableNumFormat(*pBox)); } - SwFrmFmt* pBoxFmt = pBox->ClaimFrmFmt(); + SwFrameFormat* pBoxFormat = pBox->ClaimFrameFormat(); // Keep TextFormats! sal_uInt16 nWhich1 = RES_BOXATR_FORMAT; - if( pFmtItem && GetNumberFormatter()->IsTextFormat( - static_cast<const SwTblBoxNumFormat*>(pFmtItem)->GetValue() )) + if( pFormatItem && GetNumberFormatter()->IsTextFormat( + static_cast<const SwTableBoxNumFormat*>(pFormatItem)->GetValue() )) nWhich1 = RES_BOXATR_FORMULA; else // Just resetting Attributes is not enough // Make sure that the Text is formatted accordingly - pBoxFmt->SetFmtAttr( *GetDfltAttr( RES_BOXATR_FORMAT )); + pBoxFormat->SetFormatAttr( *GetDfltAttr( RES_BOXATR_FORMAT )); - pBoxFmt->ResetFmtAttr( nWhich1, RES_BOXATR_VALUE ); + pBoxFormat->ResetFormatAttr( nWhich1, RES_BOXATR_VALUE ); getIDocumentState().SetModified(); } } @@ -4261,34 +4261,34 @@ void SwDoc::ClearBoxNumAttrs( const SwNodeIndex& rNode ) /** * Copies a Table from the same or another Doc into itself * We create a new Table or an existing one is filled with the Content. - * We either fill in the Content from a certain Box or a certain TblSelection + * We either fill in the Content from a certain Box or a certain TableSelection * * This method is called by edglss.cxx/fecopy.cxx */ -bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, - const SwTable* pCpyTbl, bool bCpyName, bool bCorrPos ) +bool SwDoc::InsCopyOfTable( SwPosition& rInsPos, const SwSelBoxes& rBoxes, + const SwTable* pCpyTable, bool bCpyName, bool bCorrPos ) { bool bRet; - const SwTableNode* pSrcTblNd = pCpyTbl - ? pCpyTbl->GetTableNode() + const SwTableNode* pSrcTableNd = pCpyTable + ? pCpyTable->GetTableNode() : rBoxes[ 0 ]->GetSttNd()->FindTableNode(); - SwTableNode * pInsTblNd = rInsPos.nNode.GetNode().FindTableNode(); + SwTableNode * pInsTableNd = rInsPos.nNode.GetNode().FindTableNode(); bool const bUndo( GetIDocumentUndoRedo().DoesUndo() ); - if( !pCpyTbl && !pInsTblNd ) + if( !pCpyTable && !pInsTableNd ) { - SwUndoCpyTbl* pUndo = 0; + SwUndoCpyTable* pUndo = 0; if (bUndo) { GetIDocumentUndoRedo().ClearRedo(); - pUndo = new SwUndoCpyTbl; + pUndo = new SwUndoCpyTable; } { ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); - bRet = pSrcTblNd->GetTable().MakeCopy( this, rInsPos, rBoxes, + bRet = pSrcTableNd->GetTable().MakeCopy( this, rInsPos, rBoxes, true, bCpyName ); } @@ -4301,9 +4301,9 @@ bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, } else { - pInsTblNd = GetNodes()[ rInsPos.nNode.GetIndex() - 1 ]->FindTableNode(); + pInsTableNd = GetNodes()[ rInsPos.nNode.GetIndex() - 1 ]->FindTableNode(); - pUndo->SetTableSttIdx( pInsTblNd->GetIndex() ); + pUndo->SetTableSttIdx( pInsTableNd->GetIndex() ); GetIDocumentUndoRedo().AppendUndo( pUndo ); } } @@ -4316,15 +4316,15 @@ bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE)); - SwUndoTblCpyTbl* pUndo = 0; + SwUndoTableCpyTable* pUndo = 0; if (bUndo) { GetIDocumentUndoRedo().ClearRedo(); - pUndo = new SwUndoTblCpyTbl; + pUndo = new SwUndoTableCpyTable; GetIDocumentUndoRedo().DoUndo(false); } - SwDoc* pCpyDoc = const_cast<SwDoc*>(pSrcTblNd->GetDoc()); + SwDoc* pCpyDoc = const_cast<SwDoc*>(pSrcTableNd->GetDoc()); bool bDelCpyDoc = pCpyDoc == this; if( bDelCpyDoc ) @@ -4334,7 +4334,7 @@ bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, pCpyDoc->acquire(); SwPosition aPos( SwNodeIndex( pCpyDoc->GetNodes().GetEndOfContent() )); - if( !pSrcTblNd->GetTable().MakeCopy( pCpyDoc, aPos, rBoxes, true, true )) + if( !pSrcTableNd->GetTable().MakeCopy( pCpyDoc, aPos, rBoxes, true, true )) { if( pCpyDoc->release() == 0 ) delete pCpyDoc; @@ -4348,7 +4348,7 @@ bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, return false; } aPos.nNode -= 1; // Set to the Table's EndNode - pSrcTblNd = aPos.nNode.GetNode().FindTableNode(); + pSrcTableNd = aPos.nNode.GetNode().FindTableNode(); } const SwStartNode* pSttNd = rInsPos.nNode.GetNode().FindTableBoxStartNode(); @@ -4356,7 +4356,7 @@ bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, rInsPos.nContent.Assign( 0, 0 ); // no complex into complex, but copy into or from new model is welcome - if( ( !pSrcTblNd->GetTable().IsTblComplex() || pInsTblNd->GetTable().IsNewModel() ) + if( ( !pSrcTableNd->GetTable().IsTableComplex() || pInsTableNd->GetTable().IsNewModel() ) && ( bDelCpyDoc || !rBoxes.empty() ) ) { // Copy the Table "relatively" @@ -4365,7 +4365,7 @@ bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, if( bDelCpyDoc ) { - SwTableBox* pBox = pInsTblNd->GetTable().GetTblBox( + SwTableBox* pBox = pInsTableNd->GetTable().GetTableBox( pSttNd->GetIndex() ); OSL_ENSURE( pBox, "Box is not in this Table" ); aBoxes.insert( pBox ); @@ -4375,13 +4375,13 @@ bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, pBoxes = &rBoxes; // Copy Table to the selected Lines - bRet = pInsTblNd->GetTable().InsTable( pSrcTblNd->GetTable(), + bRet = pInsTableNd->GetTable().InsTable( pSrcTableNd->GetTable(), *pBoxes, pUndo ); } else { SwNodeIndex aNdIdx( *pSttNd, 1 ); - bRet = pInsTblNd->GetTable().InsTable( pSrcTblNd->GetTable(), + bRet = pInsTableNd->GetTable().InsTable( pSrcTableNd->GetTable(), aNdIdx, pUndo ); } @@ -4419,20 +4419,20 @@ bool SwDoc::InsCopyOfTbl( SwPosition& rInsPos, const SwSelBoxes& rBoxes, return bRet; } -bool SwDoc::_UnProtectTblCells( SwTable& rTbl ) +bool SwDoc::_UnProtectTableCells( SwTable& rTable ) { bool bChgd = false; - SwUndoAttrTbl *const pUndo = (GetIDocumentUndoRedo().DoesUndo()) - ? new SwUndoAttrTbl( *rTbl.GetTableNode() ) + SwUndoAttrTable *const pUndo = (GetIDocumentUndoRedo().DoesUndo()) + ? new SwUndoAttrTable( *rTable.GetTableNode() ) : 0; - SwTableSortBoxes& rSrtBox = rTbl.GetTabSortBoxes(); + SwTableSortBoxes& rSrtBox = rTable.GetTabSortBoxes(); for (size_t i = rSrtBox.size(); i; ) { - SwFrmFmt *pBoxFmt = rSrtBox[ --i ]->GetFrmFmt(); - if( pBoxFmt->GetProtect().IsCntntProtected() ) + SwFrameFormat *pBoxFormat = rSrtBox[ --i ]->GetFrameFormat(); + if( pBoxFormat->GetProtect().IsContentProtected() ) { - pBoxFmt->ResetFmtAttr( RES_PROTECT ); + pBoxFormat->ResetFormatAttr( RES_PROTECT ); bChgd = true; } } @@ -4452,10 +4452,10 @@ bool SwDoc::_UnProtectTblCells( SwTable& rTbl ) bool SwDoc::UnProtectCells( const OUString& rName ) { bool bChgd = false; - SwTableFmt* pFmt = FindTblFmtByName( rName ); - if( pFmt ) + SwTableFormat* pFormat = FindTableFormatByName( rName ); + if( pFormat ) { - bChgd = _UnProtectTblCells( *SwTable::FindTable( pFmt ) ); + bChgd = _UnProtectTableCells( *SwTable::FindTable( pFormat ) ); if( bChgd ) getIDocumentState().SetModified(); } @@ -4468,27 +4468,27 @@ bool SwDoc::UnProtectCells( const SwSelBoxes& rBoxes ) bool bChgd = false; if( !rBoxes.empty() ) { - SwUndoAttrTbl *const pUndo = (GetIDocumentUndoRedo().DoesUndo()) - ? new SwUndoAttrTbl( *rBoxes[0]->GetSttNd()->FindTableNode() ) + SwUndoAttrTable *const pUndo = (GetIDocumentUndoRedo().DoesUndo()) + ? new SwUndoAttrTable( *rBoxes[0]->GetSttNd()->FindTableNode() ) : 0; - std::map<SwFrmFmt*, SwTableBoxFmt*> aFmtsMap; + std::map<SwFrameFormat*, SwTableBoxFormat*> aFormatsMap; for (size_t i = rBoxes.size(); i; ) { SwTableBox* pBox = rBoxes[ --i ]; - SwFrmFmt* pBoxFmt = pBox->GetFrmFmt(); - if( pBoxFmt->GetProtect().IsCntntProtected() ) + SwFrameFormat* pBoxFormat = pBox->GetFrameFormat(); + if( pBoxFormat->GetProtect().IsContentProtected() ) { - std::map<SwFrmFmt*, SwTableBoxFmt*>::const_iterator const it = - aFmtsMap.find(pBoxFmt); - if (aFmtsMap.end() != it) - pBox->ChgFrmFmt(it->second); + std::map<SwFrameFormat*, SwTableBoxFormat*>::const_iterator const it = + aFormatsMap.find(pBoxFormat); + if (aFormatsMap.end() != it) + pBox->ChgFrameFormat(it->second); else { - SwTableBoxFmt *const pNewBoxFmt( - static_cast<SwTableBoxFmt*>(pBox->ClaimFrmFmt())); - pNewBoxFmt->ResetFmtAttr( RES_PROTECT ); - aFmtsMap.insert(std::make_pair(pBoxFmt, pNewBoxFmt)); + SwTableBoxFormat *const pNewBoxFormat( + static_cast<SwTableBoxFormat*>(pBox->ClaimFrameFormat())); + pNewBoxFormat->ResetFormatAttr( RES_PROTECT ); + aFormatsMap.insert(std::make_pair(pBoxFormat, pNewBoxFormat)); } bChgd = true; } @@ -4507,21 +4507,21 @@ bool SwDoc::UnProtectCells( const SwSelBoxes& rBoxes ) return bChgd; } -bool SwDoc::UnProtectTbls( const SwPaM& rPam ) +bool SwDoc::UnProtectTables( const SwPaM& rPam ) { GetIDocumentUndoRedo().StartUndo(UNDO_EMPTY, NULL); bool bChgd = false, bHasSel = rPam.HasMark() || rPam.GetNext() != &rPam; - SwFrmFmts& rFmts = *GetTblFrmFmts(); - SwTable* pTbl; - const SwTableNode* pTblNd; - for( auto n = rFmts.size(); n ; ) - if( 0 != (pTbl = SwTable::FindTable( rFmts[ --n ] )) && - 0 != (pTblNd = pTbl->GetTableNode() ) && - pTblNd->GetNodes().IsDocNodes() ) + SwFrameFormats& rFormats = *GetTableFrameFormats(); + SwTable* pTable; + const SwTableNode* pTableNd; + for( auto n = rFormats.size(); n ; ) + if( 0 != (pTable = SwTable::FindTable( rFormats[ --n ] )) && + 0 != (pTableNd = pTable->GetTableNode() ) && + pTableNd->GetNodes().IsDocNodes() ) { - sal_uLong nTblIdx = pTblNd->GetIndex(); + sal_uLong nTableIdx = pTableNd->GetIndex(); // Check whether the Table is within the Selection if( bHasSel ) @@ -4531,8 +4531,8 @@ bool SwDoc::UnProtectTbls( const SwPaM& rPam ) do { const SwPosition *pStt = pTmp->Start(), *pEnd = pTmp->End(); - bFound = pStt->nNode.GetIndex() < nTblIdx && - nTblIdx < pEnd->nNode.GetIndex(); + bFound = pStt->nNode.GetIndex() < nTableIdx && + nTableIdx < pEnd->nNode.GetIndex(); } while( !bFound && &rPam != ( pTmp = static_cast<SwPaM*>(pTmp->GetNext()) ) ); if( !bFound ) @@ -4540,7 +4540,7 @@ bool SwDoc::UnProtectTbls( const SwPaM& rPam ) } // Lift the protection - bChgd |= _UnProtectTblCells( *pTbl ); + bChgd |= _UnProtectTableCells( *pTable ); } GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL); @@ -4550,40 +4550,40 @@ bool SwDoc::UnProtectTbls( const SwPaM& rPam ) return bChgd; } -bool SwDoc::HasTblAnyProtection( const SwPosition* pPos, - const OUString* pTblName, - bool* pFullTblProtection ) +bool SwDoc::HasTableAnyProtection( const SwPosition* pPos, + const OUString* pTableName, + bool* pFullTableProtection ) { bool bHasProtection = false; - SwTable* pTbl = 0; - if( pTblName ) - pTbl = SwTable::FindTable( FindTblFmtByName( *pTblName ) ); + SwTable* pTable = 0; + if( pTableName ) + pTable = SwTable::FindTable( FindTableFormatByName( *pTableName ) ); else if( pPos ) { - SwTableNode* pTblNd = pPos->nNode.GetNode().FindTableNode(); - if( pTblNd ) - pTbl = &pTblNd->GetTable(); + SwTableNode* pTableNd = pPos->nNode.GetNode().FindTableNode(); + if( pTableNd ) + pTable = &pTableNd->GetTable(); } - if( pTbl ) + if( pTable ) { - SwTableSortBoxes& rSrtBox = pTbl->GetTabSortBoxes(); + SwTableSortBoxes& rSrtBox = pTable->GetTabSortBoxes(); for (size_t i = rSrtBox.size(); i; ) { - SwFrmFmt *pBoxFmt = rSrtBox[ --i ]->GetFrmFmt(); - if( pBoxFmt->GetProtect().IsCntntProtected() ) + SwFrameFormat *pBoxFormat = rSrtBox[ --i ]->GetFrameFormat(); + if( pBoxFormat->GetProtect().IsContentProtected() ) { if( !bHasProtection ) { bHasProtection = true; - if( !pFullTblProtection ) + if( !pFullTableProtection ) break; - *pFullTblProtection = true; + *pFullTableProtection = true; } } - else if( bHasProtection && pFullTblProtection ) + else if( bHasProtection && pFullTableProtection ) { - *pFullTblProtection = false; + *pFullTableProtection = false; break; } } diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 341132376990..e405c5f2a2fa 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -60,25 +60,25 @@ using namespace ::com::sun::star; inline bool IsSame( long nA, long nB ) { return std::abs(nA-nB) <= COLFUZZY; } -class SwTblFmtCmp +class SwTableFormatCmp { public: - SwFrmFmt *pOld, + SwFrameFormat *pOld, *pNew; sal_Int16 nType; - SwTblFmtCmp( SwFrmFmt *pOld, SwFrmFmt *pNew, sal_Int16 nType ); + SwTableFormatCmp( SwFrameFormat *pOld, SwFrameFormat *pNew, sal_Int16 nType ); - static SwFrmFmt *FindNewFmt( std::vector<SwTblFmtCmp*> &rArr, SwFrmFmt*pOld, sal_Int16 nType ); - static void Delete( std::vector<SwTblFmtCmp*> &rArr ); + static SwFrameFormat *FindNewFormat( std::vector<SwTableFormatCmp*> &rArr, SwFrameFormat*pOld, sal_Int16 nType ); + static void Delete( std::vector<SwTableFormatCmp*> &rArr ); }; -SwTblFmtCmp::SwTblFmtCmp( SwFrmFmt *pO, SwFrmFmt *pN, sal_Int16 nT ) +SwTableFormatCmp::SwTableFormatCmp( SwFrameFormat *pO, SwFrameFormat *pN, sal_Int16 nT ) : pOld ( pO ), pNew ( pN ), nType( nT ) { } -SwFrmFmt *SwTblFmtCmp::FindNewFmt( std::vector<SwTblFmtCmp*> &rArr, SwFrmFmt *pOld, sal_Int16 nType ) +SwFrameFormat *SwTableFormatCmp::FindNewFormat( std::vector<SwTableFormatCmp*> &rArr, SwFrameFormat *pOld, sal_Int16 nType ) { for ( auto pCmp : rArr ) { @@ -88,7 +88,7 @@ SwFrmFmt *SwTblFmtCmp::FindNewFmt( std::vector<SwTblFmtCmp*> &rArr, SwFrmFmt *pO return 0; } -void SwTblFmtCmp::Delete( std::vector<SwTblFmtCmp*> &rArr ) +void SwTableFormatCmp::Delete( std::vector<SwTableFormatCmp*> &rArr ) { for ( auto pCmp : rArr ) delete pCmp; @@ -97,7 +97,7 @@ void SwTblFmtCmp::Delete( std::vector<SwTblFmtCmp*> &rArr ) static void lcl_GetStartEndCell( const SwCursor& rCrsr, SwLayoutFrm *&prStart, SwLayoutFrm *&prEnd ) { - OSL_ENSURE( rCrsr.GetCntntNode() && rCrsr.GetCntntNode( false ), + OSL_ENSURE( rCrsr.GetContentNode() && rCrsr.GetContentNode( false ), "Tab selection not at ContentNode" ); Point aPtPos, aMkPos; @@ -109,8 +109,8 @@ static void lcl_GetStartEndCell( const SwCursor& rCrsr, } // Robust: - SwCntntNode* pPointNd = rCrsr.GetCntntNode(); - SwCntntNode* pMarkNd = rCrsr.GetCntntNode(false); + SwContentNode* pPointNd = rCrsr.GetContentNode(); + SwContentNode* pMarkNd = rCrsr.GetContentNode(false); SwFrm* pPointFrm = pPointNd ? pPointNd->getLayoutFrm( pPointNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPtPos ) : 0; SwFrm* pMarkFrm = pMarkNd ? pMarkNd->getLayoutFrm( pMarkNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aMkPos ) : 0; @@ -122,10 +122,10 @@ static void lcl_GetStartEndCell( const SwCursor& rCrsr, static bool lcl_GetBoxSel( const SwCursor& rCursor, SwSelBoxes& rBoxes, bool bAllCrsr = false ) { - const SwTableCursor* pTblCrsr = + const SwTableCursor* pTableCrsr = dynamic_cast<const SwTableCursor*>(&rCursor); - if( pTblCrsr ) - ::GetTblSelCrs( *pTblCrsr, rBoxes ); + if( pTableCrsr ) + ::GetTableSelCrs( *pTableCrsr, rBoxes ); else { const SwPaM *pCurPam = &rCursor, *pSttPam = pCurPam; @@ -134,7 +134,7 @@ static bool lcl_GetBoxSel( const SwCursor& rCursor, SwSelBoxes& rBoxes, if( pNd ) { SwTableBox* pBox = const_cast<SwTableBox*>(pNd->FindTableNode()->GetTable(). - GetTblBox( pNd->GetIndex() )); + GetTableBox( pNd->GetIndex() )); rBoxes.insert( pBox ); } } while( bAllCrsr && @@ -168,8 +168,8 @@ struct LinesAndTable const SwTable &m_rTable; bool m_bInsertLines; - LinesAndTable(std::vector<SwTableLine*> &rL, const SwTable &rTbl) : - m_rLines(rL), m_rTable(rTbl), m_bInsertLines(true) {} + LinesAndTable(std::vector<SwTableLine*> &rL, const SwTable &rTable) : + m_rLines(rL), m_rTable(rTable), m_bInsertLines(true) {} }; bool _FindLine( _FndLine & rLine, LinesAndTable* pPara ); @@ -253,46 +253,46 @@ static void lcl_CollectLines( std::vector<SwTableLine*> &rArr, const SwCursor& r } } -static void lcl_ProcessRowAttr( std::vector<SwTblFmtCmp*>& rFmtCmp, SwTableLine* pLine, const SfxPoolItem& rNew ) +static void lcl_ProcessRowAttr( std::vector<SwTableFormatCmp*>& rFormatCmp, SwTableLine* pLine, const SfxPoolItem& rNew ) { - SwFrmFmt *pNewFmt; - if ( 0 != (pNewFmt = SwTblFmtCmp::FindNewFmt( rFmtCmp, pLine->GetFrmFmt(), 0 ))) - pLine->ChgFrmFmt( static_cast<SwTableLineFmt*>(pNewFmt) ); + SwFrameFormat *pNewFormat; + if ( 0 != (pNewFormat = SwTableFormatCmp::FindNewFormat( rFormatCmp, pLine->GetFrameFormat(), 0 ))) + pLine->ChgFrameFormat( static_cast<SwTableLineFormat*>(pNewFormat) ); else { - SwFrmFmt *pOld = pLine->GetFrmFmt(); - SwFrmFmt *pNew = pLine->ClaimFrmFmt(); - pNew->SetFmtAttr( rNew ); - rFmtCmp.push_back( new SwTblFmtCmp( pOld, pNew, 0 ) ); + SwFrameFormat *pOld = pLine->GetFrameFormat(); + SwFrameFormat *pNew = pLine->ClaimFrameFormat(); + pNew->SetFormatAttr( rNew ); + rFormatCmp.push_back( new SwTableFormatCmp( pOld, pNew, 0 ) ); } } -static void lcl_ProcessBoxSize( std::vector<SwTblFmtCmp*> &rFmtCmp, SwTableBox *pBox, const SwFmtFrmSize &rNew ); +static void lcl_ProcessBoxSize( std::vector<SwTableFormatCmp*> &rFormatCmp, SwTableBox *pBox, const SwFormatFrmSize &rNew ); -static void lcl_ProcessRowSize( std::vector<SwTblFmtCmp*> &rFmtCmp, SwTableLine *pLine, const SwFmtFrmSize &rNew ) +static void lcl_ProcessRowSize( std::vector<SwTableFormatCmp*> &rFormatCmp, SwTableLine *pLine, const SwFormatFrmSize &rNew ) { - lcl_ProcessRowAttr( rFmtCmp, pLine, rNew ); + lcl_ProcessRowAttr( rFormatCmp, pLine, rNew ); SwTableBoxes &rBoxes = pLine->GetTabBoxes(); for ( auto pBox : rBoxes ) - ::lcl_ProcessBoxSize( rFmtCmp, pBox, rNew ); + ::lcl_ProcessBoxSize( rFormatCmp, pBox, rNew ); } -static void lcl_ProcessBoxSize( std::vector<SwTblFmtCmp*> &rFmtCmp, SwTableBox *pBox, const SwFmtFrmSize &rNew ) +static void lcl_ProcessBoxSize( std::vector<SwTableFormatCmp*> &rFormatCmp, SwTableBox *pBox, const SwFormatFrmSize &rNew ) { SwTableLines &rLines = pBox->GetTabLines(); if ( !rLines.empty() ) { - SwFmtFrmSize aSz( rNew ); + SwFormatFrmSize aSz( rNew ); aSz.SetHeight( rNew.GetHeight() ? rNew.GetHeight() / rLines.size() : 0 ); for ( auto pLine : rLines ) - ::lcl_ProcessRowSize( rFmtCmp, pLine, aSz ); + ::lcl_ProcessRowSize( rFormatCmp, pLine, aSz ); } } -void SwDoc::SetRowSplit( const SwCursor& rCursor, const SwFmtRowSplit &rNew ) +void SwDoc::SetRowSplit( const SwCursor& rCursor, const SwFormatRowSplit &rNew ) { - SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); - if( pTblNd ) + SwTableNode* pTableNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); + if( pTableNd ) { std::vector<SwTableLine*> aRowArr; // For Lines collecting ::lcl_CollectLines( aRowArr, rCursor, false ); @@ -301,40 +301,40 @@ void SwDoc::SetRowSplit( const SwCursor& rCursor, const SwFmtRowSplit &rNew ) { if (GetIDocumentUndoRedo().DoesUndo()) { - GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd)); + GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTable(*pTableNd)); } - std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); + std::vector<SwTableFormatCmp*> aFormatCmp; + aFormatCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); for( auto pLn : aRowArr ) - ::lcl_ProcessRowAttr( aFmtCmp, pLn, rNew ); + ::lcl_ProcessRowAttr( aFormatCmp, pLn, rNew ); - SwTblFmtCmp::Delete( aFmtCmp ); + SwTableFormatCmp::Delete( aFormatCmp ); getIDocumentState().SetModified(); } } } -void SwDoc::GetRowSplit( const SwCursor& rCursor, SwFmtRowSplit *& rpSz ) +void SwDoc::GetRowSplit( const SwCursor& rCursor, SwFormatRowSplit *& rpSz ) { rpSz = 0; - SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); - if( pTblNd ) + SwTableNode* pTableNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); + if( pTableNd ) { std::vector<SwTableLine*> aRowArr; // For Lines collecting ::lcl_CollectLines( aRowArr, rCursor, false ); if( !aRowArr.empty() ) { - rpSz = &(SwFmtRowSplit&)aRowArr[0]->GetFrmFmt()->GetRowSplit(); + rpSz = &(SwFormatRowSplit&)aRowArr[0]->GetFrameFormat()->GetRowSplit(); if (rpSz) { for ( auto pLn : aRowArr ) { - if ( (*rpSz).GetValue() != pLn->GetFrmFmt()->GetRowSplit().GetValue() ) + if ( (*rpSz).GetValue() != pLn->GetFrameFormat()->GetRowSplit().GetValue() ) { rpSz = 0; break; @@ -342,7 +342,7 @@ void SwDoc::GetRowSplit( const SwCursor& rCursor, SwFmtRowSplit *& rpSz ) } } if ( rpSz ) - rpSz = new SwFmtRowSplit( *rpSz ); + rpSz = new SwFormatRowSplit( *rpSz ); } } } @@ -358,14 +358,14 @@ void SwDoc::GetRowSplit( const SwCursor& rCursor, SwFmtRowSplit *& rpSz ) * a respective value that is calculated from the relation of the old and * new size of the topmost Line in the lower line's own size. * - * All changed Lines may get an own FrmFmt. + * All changed Lines may get an own FrameFormat. * Of course we can only touch every Line once. */ -void SwDoc::SetRowHeight( const SwCursor& rCursor, const SwFmtFrmSize &rNew ) +void SwDoc::SetRowHeight( const SwCursor& rCursor, const SwFormatFrmSize &rNew ) { - SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); - if( pTblNd ) + SwTableNode* pTableNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); + if( pTableNd ) { std::vector<SwTableLine*> aRowArr; // For Lines collecting ::lcl_CollectLines( aRowArr, rCursor, true ); @@ -374,39 +374,39 @@ void SwDoc::SetRowHeight( const SwCursor& rCursor, const SwFmtFrmSize &rNew ) { if (GetIDocumentUndoRedo().DoesUndo()) { - GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd)); + GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTable(*pTableNd)); } - std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); + std::vector<SwTableFormatCmp*> aFormatCmp; + aFormatCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); for ( auto pLn : aRowArr ) - ::lcl_ProcessRowSize( aFmtCmp, pLn, rNew ); - SwTblFmtCmp::Delete( aFmtCmp ); + ::lcl_ProcessRowSize( aFormatCmp, pLn, rNew ); + SwTableFormatCmp::Delete( aFormatCmp ); getIDocumentState().SetModified(); } } } -void SwDoc::GetRowHeight( const SwCursor& rCursor, SwFmtFrmSize *& rpSz ) +void SwDoc::GetRowHeight( const SwCursor& rCursor, SwFormatFrmSize *& rpSz ) { rpSz = 0; - SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); - if( pTblNd ) + SwTableNode* pTableNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); + if( pTableNd ) { std::vector<SwTableLine*> aRowArr; // For Lines collecting ::lcl_CollectLines( aRowArr, rCursor, true ); if( !aRowArr.empty() ) { - rpSz = &(SwFmtFrmSize&)aRowArr[0]->GetFrmFmt()->GetFrmSize(); + rpSz = &(SwFormatFrmSize&)aRowArr[0]->GetFrameFormat()->GetFrmSize(); if (rpSz) { for ( auto pLn : aRowArr ) { - if ( *rpSz != pLn->GetFrmFmt()->GetFrmSize() ) + if ( *rpSz != pLn->GetFrameFormat()->GetFrmSize() ) { rpSz = 0; break; @@ -414,7 +414,7 @@ void SwDoc::GetRowHeight( const SwCursor& rCursor, SwFmtFrmSize *& rpSz ) } } if ( rpSz ) - rpSz = new SwFmtFrmSize( *rpSz ); + rpSz = new SwFormatFrmSize( *rpSz ); } } } @@ -422,8 +422,8 @@ void SwDoc::GetRowHeight( const SwCursor& rCursor, SwFmtFrmSize *& rpSz ) bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, bool bTstOnly ) { bool bRet = false; - SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); - if( pTblNd ) + SwTableNode* pTableNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); + if( pTableNd ) { std::vector<SwTableLine*> aRowArr; // For Lines collecting ::lcl_CollectLines( aRowArr, rCursor, true ); @@ -436,7 +436,7 @@ bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, bool bTstOnly ) for ( auto pLn : aRowArr ) { - SwIterator<SwFrm,SwFmt> aIter( *pLn->GetFrmFmt() ); + SwIterator<SwFrm,SwFormat> aIter( *pLn->GetFrameFormat() ); SwFrm* pFrm = aIter.First(); while ( pFrm ) { @@ -444,19 +444,19 @@ bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, bool bTstOnly ) pFrm = aIter.Next(); } } - SwFmtFrmSize aNew( ATT_MIN_SIZE, 0, nHeight ); + SwFormatFrmSize aNew( ATT_MIN_SIZE, 0, nHeight ); if (GetIDocumentUndoRedo().DoesUndo()) { GetIDocumentUndoRedo().AppendUndo( - new SwUndoAttrTbl(*pTblNd)); + new SwUndoAttrTable(*pTableNd)); } - std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); + std::vector<SwTableFormatCmp*> aFormatCmp; + aFormatCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); for( auto pLn : aRowArr ) - ::lcl_ProcessRowSize( aFmtCmp, pLn, aNew ); - SwTblFmtCmp::Delete( aFmtCmp ); + ::lcl_ProcessRowSize( aFormatCmp, pLn, aNew ); + SwTableFormatCmp::Delete( aFormatCmp ); getIDocumentState().SetModified(); } @@ -468,8 +468,8 @@ bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, bool bTstOnly ) void SwDoc::SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew ) { - SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); - if( pTblNd ) + SwTableNode* pTableNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); + if( pTableNd ) { std::vector<SwTableLine*> aRowArr; // For Lines collecting ::lcl_CollectLines( aRowArr, rCursor, true ); @@ -478,16 +478,16 @@ void SwDoc::SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew { if (GetIDocumentUndoRedo().DoesUndo()) { - GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd)); + GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTable(*pTableNd)); } - std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); + std::vector<SwTableFormatCmp*> aFormatCmp; + aFormatCmp.reserve( std::max( 255, (int)aRowArr.size() ) ); for( auto pLn : aRowArr ) - ::lcl_ProcessRowAttr( aFmtCmp, pLn, rNew ); + ::lcl_ProcessRowAttr( aFormatCmp, pLn, rNew ); - SwTblFmtCmp::Delete( aFmtCmp ); + SwTableFormatCmp::Delete( aFormatCmp ); getIDocumentState().SetModified(); } } @@ -496,19 +496,19 @@ void SwDoc::SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew bool SwDoc::GetRowBackground( const SwCursor& rCursor, SvxBrushItem &rToFill ) { bool bRet = false; - SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); - if( pTblNd ) + SwTableNode* pTableNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); + if( pTableNd ) { std::vector<SwTableLine*> aRowArr; // For Lines collecting ::lcl_CollectLines( aRowArr, rCursor, true ); if( !aRowArr.empty() ) { - rToFill = aRowArr[0]->GetFrmFmt()->makeBackgroundBrushItem(); + rToFill = aRowArr[0]->GetFrameFormat()->makeBackgroundBrushItem(); bRet = true; for ( std::vector<SwTableLine*>::size_type i = 1; i < aRowArr.size(); ++i ) - if ( rToFill != aRowArr[i]->GetFrmFmt()->makeBackgroundBrushItem() ) + if ( rToFill != aRowArr[i]->GetFrameFormat()->makeBackgroundBrushItem() ) { bRet = false; break; @@ -549,9 +549,9 @@ static void lcl_CollectCells( std::vector<SwCellFrm*> &rArr, const SwRect &rUnio void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ) { - SwCntntNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetCntntNode(); - SwTableNode* pTblNd = pCntNd ? pCntNd->FindTableNode() : 0; - if( !pTblNd ) + SwContentNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetContentNode(); + SwTableNode* pTableNd = pCntNd ? pCntNd->FindTableNode() : 0; + if( !pTableNd ) return ; SwLayoutFrm *pStart, *pEnd; @@ -562,14 +562,14 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ) if( !aUnions.empty() ) { - SwTable& rTable = pTblNd->GetTable(); + SwTable& rTable = pTableNd->GetTable(); if (GetIDocumentUndoRedo().DoesUndo()) { - GetIDocumentUndoRedo().AppendUndo( new SwUndoAttrTbl(*pTblNd) ); + GetIDocumentUndoRedo().AppendUndo( new SwUndoAttrTable(*pTableNd) ); } - std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve( 255 ); + std::vector<SwTableFormatCmp*> aFormatCmp; + aFormatCmp.reserve( 255 ); const SvxBoxItem* pSetBox; const SvxBoxInfoItem *pSetBoxInfo; @@ -669,7 +669,7 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ) pCell->IsInFollowFlowRow() ) ) continue; - SvxBoxItem aBox( pCell->GetFmt()->GetBox() ); + SvxBoxItem aBox( pCell->GetFormat()->GetBox() ); sal_Int16 nType = 0; @@ -781,15 +781,15 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ) } SwTableBox *pBox = const_cast<SwTableBox*>(pCell->GetTabBox()); - SwFrmFmt *pNewFmt; - if ( 0 != (pNewFmt = SwTblFmtCmp::FindNewFmt( aFmtCmp, pBox->GetFrmFmt(), nType ))) - pBox->ChgFrmFmt( static_cast<SwTableBoxFmt*>(pNewFmt) ); + SwFrameFormat *pNewFormat; + if ( 0 != (pNewFormat = SwTableFormatCmp::FindNewFormat( aFormatCmp, pBox->GetFrameFormat(), nType ))) + pBox->ChgFrameFormat( static_cast<SwTableBoxFormat*>(pNewFormat) ); else { - SwFrmFmt *pOld = pBox->GetFrmFmt(); - SwFrmFmt *pNew = pBox->ClaimFrmFmt(); - pNew->SetFmtAttr( aBox ); - aFmtCmp.push_back( new SwTblFmtCmp( pOld, pNew, nType ) ); + SwFrameFormat *pOld = pBox->GetFrameFormat(); + SwFrameFormat *pNew = pBox->ClaimFrameFormat(); + pNew->SetFormatAttr( aBox ); + aFormatCmp.push_back( new SwTableFormatCmp( pOld, pNew, nType ) ); } } @@ -799,13 +799,13 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet ) SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout(); if( pTableLayout ) { - SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ); + SwContentFrm* pFrm = rCursor.GetContentNode()->getLayoutFrm( rCursor.GetContentNode()->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ); SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm(); pTableLayout->BordersChanged( pTableLayout->GetBrowseWidthByTabFrm( *pTabFrm ), true ); } - SwTblFmtCmp::Delete( aFmtCmp ); + SwTableFormatCmp::Delete( aFormatCmp ); ::ClearFEShellTabCols(); getIDocumentState().SetModified(); } @@ -833,9 +833,9 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor, const Color* pColor, bool bSetLine, const SvxBorderLine* pBorderLine ) { - SwCntntNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetCntntNode(); - SwTableNode* pTblNd = pCntNd ? pCntNd->FindTableNode() : 0; - if( !pTblNd ) + SwContentNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetContentNode(); + SwTableNode* pTableNd = pCntNd ? pCntNd->FindTableNode() : 0; + if( !pTableNd ) return ; SwLayoutFrm *pStart, *pEnd; @@ -846,10 +846,10 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor, if( !aUnions.empty() ) { - SwTable& rTable = pTblNd->GetTable(); + SwTable& rTable = pTableNd->GetTable(); if (GetIDocumentUndoRedo().DoesUndo()) { - GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTbl(*pTblNd)); + GetIDocumentUndoRedo().AppendUndo(new SwUndoAttrTable(*pTableNd)); } for( auto &rU : aUnions ) @@ -866,9 +866,9 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor, if ( pTab->IsFollow() && pTab->IsInHeadline( *pCell ) ) continue; - const_cast<SwTableBox*>(pCell->GetTabBox())->ClaimFrmFmt(); - SwFrmFmt *pFmt = pCell->GetFmt(); - SvxBoxItem aBox( pFmt->GetBox() ); + const_cast<SwTableBox*>(pCell->GetTabBox())->ClaimFrameFormat(); + SwFrameFormat *pFormat = pCell->GetFormat(); + SvxBoxItem aBox( pFormat->GetBox() ); if ( !pBorderLine && bSetLine ) aBox = *static_cast<const SvxBoxItem*>(::GetDfltAttr( RES_BOX )); @@ -887,14 +887,14 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor, ::lcl_SetLineStyle( const_cast<SvxBorderLine*>(aBox.GetRight()), pColor, pBorderLine ); } - pFmt->SetFmtAttr( aBox ); + pFormat->SetFormatAttr( aBox ); } } SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout(); if( pTableLayout ) { - SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ); + SwContentFrm* pFrm = rCursor.GetContentNode()->getLayoutFrm( rCursor.GetContentNode()->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ); SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm(); pTableLayout->BordersChanged( @@ -907,9 +907,9 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor, void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) { - SwCntntNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetCntntNode(); - SwTableNode* pTblNd = pCntNd ? pCntNd->FindTableNode() : 0; - if( !pTblNd ) + SwContentNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetContentNode(); + SwTableNode* pTableNd = pCntNd ? pCntNd->FindTableNode() : 0; + if( !pTableNd ) return ; SwLayoutFrm *pStart, *pEnd; @@ -973,8 +973,8 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) bLeftOver = bTmp; } - const SwFrmFmt *pFmt = pCell->GetFmt(); - const SvxBoxItem &rBox = pFmt->GetBox(); + const SwFrameFormat *pFormat = pCell->GetFormat(); + const SvxBoxItem &rBox = pFormat->GetBox(); // Top Border if ( bFirst && bTopOver ) @@ -1128,44 +1128,44 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew ) { - SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); + SwTableNode* pTableNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); SwSelBoxes aBoxes; - if( pTblNd && ::lcl_GetBoxSel( rCursor, aBoxes, true ) ) + if( pTableNd && ::lcl_GetBoxSel( rCursor, aBoxes, true ) ) { - SwTable& rTable = pTblNd->GetTable(); + SwTable& rTable = pTableNd->GetTable(); if (GetIDocumentUndoRedo().DoesUndo()) { - GetIDocumentUndoRedo().AppendUndo( new SwUndoAttrTbl(*pTblNd) ); + GetIDocumentUndoRedo().AppendUndo( new SwUndoAttrTable(*pTableNd) ); } - std::vector<SwTblFmtCmp*> aFmtCmp; - aFmtCmp.reserve(std::max<size_t>(255, aBoxes.size())); + std::vector<SwTableFormatCmp*> aFormatCmp; + aFormatCmp.reserve(std::max<size_t>(255, aBoxes.size())); for (size_t i = 0; i < aBoxes.size(); ++i) { SwTableBox *pBox = aBoxes[i]; - SwFrmFmt *pNewFmt; - if ( 0 != (pNewFmt = SwTblFmtCmp::FindNewFmt( aFmtCmp, pBox->GetFrmFmt(), 0 ))) - pBox->ChgFrmFmt( static_cast<SwTableBoxFmt*>(pNewFmt) ); + SwFrameFormat *pNewFormat; + if ( 0 != (pNewFormat = SwTableFormatCmp::FindNewFormat( aFormatCmp, pBox->GetFrameFormat(), 0 ))) + pBox->ChgFrameFormat( static_cast<SwTableBoxFormat*>(pNewFormat) ); else { - SwFrmFmt *pOld = pBox->GetFrmFmt(); - SwFrmFmt *pNew = pBox->ClaimFrmFmt(); - pNew->SetFmtAttr( rNew ); - aFmtCmp.push_back( new SwTblFmtCmp( pOld, pNew, 0 ) ); + SwFrameFormat *pOld = pBox->GetFrameFormat(); + SwFrameFormat *pNew = pBox->ClaimFrameFormat(); + pNew->SetFormatAttr( rNew ); + aFormatCmp.push_back( new SwTableFormatCmp( pOld, pNew, 0 ) ); } } SwHTMLTableLayout *pTableLayout = rTable.GetHTMLTableLayout(); if( pTableLayout ) { - SwCntntFrm* pFrm = rCursor.GetCntntNode()->getLayoutFrm( rCursor.GetCntntNode()->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ); + SwContentFrm* pFrm = rCursor.GetContentNode()->getLayoutFrm( rCursor.GetContentNode()->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ); SwTabFrm* pTabFrm = pFrm->ImplFindTabFrm(); pTableLayout->Resize( pTableLayout->GetBrowseWidthByTabFrm( *pTabFrm ), true ); } - SwTblFmtCmp::Delete( aFmtCmp ); + SwTableFormatCmp::Delete( aFormatCmp ); getIDocumentState().SetModified(); } } @@ -1173,9 +1173,9 @@ void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew ) bool SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) { bool bRet = false; - SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); + SwTableNode* pTableNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); SwSelBoxes aBoxes; - if( pTblNd && lcl_GetBoxSel( rCursor, aBoxes )) + if( pTableNd && lcl_GetBoxSel( rCursor, aBoxes )) { bRet = true; bool bOneFound = false; @@ -1187,7 +1187,7 @@ bool SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) case RES_BACKGROUND: { SvxBrushItem aBack = - aBoxes[i]->GetFrmFmt()->makeBackgroundBrushItem(); + aBoxes[i]->GetFrameFormat()->makeBackgroundBrushItem(); if( !bOneFound ) { static_cast<SvxBrushItem&>(rToFill) = aBack; @@ -1201,7 +1201,7 @@ bool SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) case RES_FRAMEDIR: { const SvxFrameDirectionItem& rDir = - aBoxes[i]->GetFrmFmt()->GetFrmDir(); + aBoxes[i]->GetFrameFormat()->GetFrmDir(); if( !bOneFound ) { static_cast<SvxFrameDirectionItem&>(rToFill) = rDir; @@ -1224,21 +1224,21 @@ void SwDoc::SetBoxAlign( const SwCursor& rCursor, sal_uInt16 nAlign ) OSL_ENSURE( nAlign == text::VertOrientation::NONE || nAlign == text::VertOrientation::CENTER || nAlign == text::VertOrientation::BOTTOM, "Wrong alignment" ); - SwFmtVertOrient aVertOri( 0, nAlign ); + SwFormatVertOrient aVertOri( 0, nAlign ); SetBoxAttr( rCursor, aVertOri ); } sal_uInt16 SwDoc::GetBoxAlign( const SwCursor& rCursor ) { sal_uInt16 nAlign = USHRT_MAX; - SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); + SwTableNode* pTableNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); SwSelBoxes aBoxes; - if( pTblNd && ::lcl_GetBoxSel( rCursor, aBoxes )) + if( pTableNd && ::lcl_GetBoxSel( rCursor, aBoxes )) { for (size_t i = 0; i < aBoxes.size(); ++i) { - const SwFmtVertOrient &rOri = - aBoxes[i]->GetFrmFmt()->GetVertOrient(); + const SwFormatVertOrient &rOri = + aBoxes[i]->GetFrameFormat()->GetVertOrient(); if( USHRT_MAX == nAlign ) nAlign = static_cast<sal_uInt16>(rOri.GetVertOrient()); else if( rOri.GetVertOrient() != nAlign ) @@ -1261,9 +1261,9 @@ static sal_uInt16 lcl_CalcCellFit( const SwLayoutFrm *pCell ) const SwTwips nAdd = (pFrm->Frm().*fnRect->fnGetWidth)() - (pFrm->Prt().*fnRect->fnGetWidth)(); - // pFrm does not necessarily have to be a SwTxtFrm! - const SwTwips nCalcFitToContent = pFrm->IsTxtFrm() ? - const_cast<SwTxtFrm*>(static_cast<const SwTxtFrm*>(pFrm))->CalcFitToContent() : + // pFrm does not necessarily have to be a SwTextFrm! + const SwTwips nCalcFitToContent = pFrm->IsTextFrm() ? + const_cast<SwTextFrm*>(static_cast<const SwTextFrm*>(pFrm))->CalcFitToContent() : (pFrm->Prt().*fnRect->fnGetWidth)(); nRet = std::max( nRet, nCalcFitToContent + nAdd ); @@ -1359,7 +1359,7 @@ static void lcl_CalcColValues( std::vector<sal_uInt16> &rToFill, const SwTabCols { SwSelUnions aUnions; ::MakeSelUnions( aUnions, pStart, pEnd, - bWishValues ? nsSwTblSearchType::TBLSEARCH_NONE : nsSwTblSearchType::TBLSEARCH_COL ); + bWishValues ? nsSwTableSearchType::TBLSEARCH_NONE : nsSwTableSearchType::TBLSEARCH_COL ); for ( auto &rU : aUnions ) { @@ -1375,7 +1375,7 @@ static void lcl_CalcColValues( std::vector<sal_uInt16> &rToFill, const SwTabCols continue; do { - if ( pCell->IsCellFrm() && pCell->FindTabFrm() == pTab && ::IsFrmInTblSel( rUnion, pCell ) ) + if ( pCell->IsCellFrm() && pCell->FindTabFrm() == pTab && ::IsFrmInTableSel( rUnion, pCell ) ) { const long nCLeft = (pCell->Frm().*fnRect->fnGetLeft)(); const long nCRight = (pCell->Frm().*fnRect->fnGetRight)(); @@ -1441,9 +1441,9 @@ static void lcl_CalcColValues( std::vector<sal_uInt16> &rToFill, const SwTabCols void SwDoc::AdjustCellWidth( const SwCursor& rCursor, bool bBalance ) { // Check whether the current Crsr has it's Point/Mark in a Table - SwCntntNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetCntntNode(); - SwTableNode* pTblNd = pCntNd ? pCntNd->FindTableNode() : 0; - if( !pTblNd ) + SwContentNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetContentNode(); + SwTableNode* pTableNd = pCntNd ? pCntNd->FindTableNode() : 0; + if( !pTableNd ) return ; SwLayoutFrm *pStart, *pEnd; @@ -1471,7 +1471,7 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, bool bBalance ) // It's more robust if we calculate the minimum values for the whole Table const SwTabFrm *pTab = pStart->ImplFindTabFrm(); pStart = (SwLayoutFrm*)pTab->FirstCell(); - pEnd = const_cast<SwLayoutFrm*>(pTab->FindLastCntnt()->GetUpper()); + pEnd = const_cast<SwLayoutFrm*>(pTab->FindLastContent()->GetUpper()); while( !pEnd->IsCellFrm() ) pEnd = pEnd->GetUpper(); ::lcl_CalcColValues( aMins, aTabCols, pStart, pEnd, false ); @@ -1553,19 +1553,19 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, bool bBalance ) const long nNewRight = aTabCols.GetRight(); - SwFrmFmt *pFmt = pTblNd->GetTable().GetFrmFmt(); - const sal_Int16 nOriHori = pFmt->GetHoriOrient().GetHoriOrient(); + SwFrameFormat *pFormat = pTableNd->GetTable().GetFrameFormat(); + const sal_Int16 nOriHori = pFormat->GetHoriOrient().GetHoriOrient(); // We can leave the "real" work to the SwTable now SetTabCols( aTabCols, false, 0, static_cast<SwCellFrm*>(pBoxFrm) ); // Alignment might have been changed in SetTabCols; restore old value - const SwFmtHoriOrient &rHori = pFmt->GetHoriOrient(); - SwFmtHoriOrient aHori( rHori ); + const SwFormatHoriOrient &rHori = pFormat->GetHoriOrient(); + SwFormatHoriOrient aHori( rHori ); if ( aHori.GetHoriOrient() != nOriHori ) { aHori.SetHoriOrient( nOriHori ); - pFmt->SetFmtAttr( aHori ); + pFormat->SetFormatAttr( aHori ); } // We switch to left-adjusted for automatic width @@ -1575,7 +1575,7 @@ void SwDoc::AdjustCellWidth( const SwCursor& rCursor, bool bBalance ) if( aHori.GetHoriOrient() == text::HoriOrientation::FULL ) { aHori.SetHoriOrient( text::HoriOrientation::LEFT ); - pFmt->SetFmtAttr( aHori ); + pFormat->SetFormatAttr( aHori ); } } diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 0f01281fb979..6cacd008e309 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -69,7 +69,7 @@ using namespace ::com::sun::star::i18n; -TYPEINIT2( SwCntntNode, SwModify, SwIndexReg ) +TYPEINIT2( SwContentNode, SwModify, SwIndexReg ) /* * Some local helper functions for the attribute set handle of a content node. @@ -82,14 +82,14 @@ namespace AttrSetHandleHelper { void GetNewAutoStyle( std::shared_ptr<const SfxItemSet>& rpAttrSet, - const SwCntntNode& rNode, + const SwContentNode& rNode, SwAttrSet& rNewAttrSet ) { const SwAttrSet* pAttrSet = static_cast<const SwAttrSet*>(rpAttrSet.get()); if( rNode.GetModifyAtAttr() ) const_cast<SwAttrSet*>(pAttrSet)->SetModifyAtAttr( 0 ); IStyleAccess& rSA = pAttrSet->GetPool()->GetDoc()->GetIStyleAccess(); - rpAttrSet = rSA.getAutomaticStyle( rNewAttrSet, rNode.IsTxtNode() ? + rpAttrSet = rSA.getAutomaticStyle( rNewAttrSet, rNode.IsTextNode() ? IStyleAccess::AUTO_STYLE_PARA : IStyleAccess::AUTO_STYLE_NOTXT ); const bool bSetModifyAtAttr = const_cast<SwAttrSet*>(static_cast<const SwAttrSet*>(rpAttrSet.get()))->SetModifyAtAttr( &rNode ); @@ -97,15 +97,15 @@ void GetNewAutoStyle( std::shared_ptr<const SfxItemSet>& rpAttrSet, } void SetParent( std::shared_ptr<const SfxItemSet>& rpAttrSet, - const SwCntntNode& rNode, - const SwFmt* pParentFmt, - const SwFmt* pConditionalFmt ) + const SwContentNode& rNode, + const SwFormat* pParentFormat, + const SwFormat* pConditionalFormat ) { const SwAttrSet* pAttrSet = static_cast<const SwAttrSet*>(rpAttrSet.get()); OSL_ENSURE( pAttrSet, "no SwAttrSet" ); - OSL_ENSURE( pParentFmt || !pConditionalFmt, "ConditionalFmt without ParentFmt?" ); + OSL_ENSURE( pParentFormat || !pConditionalFormat, "ConditionalFormat without ParentFormat?" ); - const SwAttrSet* pParentSet = pParentFmt ? &pParentFmt->GetAttrSet() : 0; + const SwAttrSet* pParentSet = pParentFormat ? &pParentFormat->GetAttrSet() : 0; if ( pParentSet != pAttrSet->GetParent() ) { @@ -115,17 +115,17 @@ void SetParent( std::shared_ptr<const SfxItemSet>& rpAttrSet, aNewSet.ClearItem( RES_FRMATR_CONDITIONAL_STYLE_NAME ); OUString sVal; - if ( pParentFmt ) + if ( pParentFormat ) { - SwStyleNameMapper::FillProgName( pParentFmt->GetName(), sVal, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true ); - const SfxStringItem aAnyFmtColl( RES_FRMATR_STYLE_NAME, sVal ); - aNewSet.Put( aAnyFmtColl ); + SwStyleNameMapper::FillProgName( pParentFormat->GetName(), sVal, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true ); + const SfxStringItem aAnyFormatColl( RES_FRMATR_STYLE_NAME, sVal ); + aNewSet.Put( aAnyFormatColl ); - if ( pConditionalFmt != pParentFmt ) - SwStyleNameMapper::FillProgName( pConditionalFmt->GetName(), sVal, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true ); + if ( pConditionalFormat != pParentFormat ) + SwStyleNameMapper::FillProgName( pConditionalFormat->GetName(), sVal, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, true ); - const SfxStringItem aFmtColl( RES_FRMATR_CONDITIONAL_STYLE_NAME, sVal ); - aNewSet.Put( aFmtColl ); + const SfxStringItem aFormatColl( RES_FRMATR_CONDITIONAL_STYLE_NAME, sVal ); + aNewSet.Put( aFormatColl ); } GetNewAutoStyle( rpAttrSet, rNode, aNewSet ); @@ -133,7 +133,7 @@ void SetParent( std::shared_ptr<const SfxItemSet>& rpAttrSet, } const SfxPoolItem* Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, - const SwCntntNode& rNode, + const SwContentNode& rNode, const SfxPoolItem& rAttr ) { SwAttrSet aNewSet( static_cast<const SwAttrSet&>(*rpAttrSet) ); @@ -143,7 +143,7 @@ const SfxPoolItem* Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, return pRet; } -bool Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwCntntNode& rNode, +bool Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNode& rNode, const SfxItemSet& rSet ) { SwAttrSet aNewSet( static_cast<const SwAttrSet&>(*rpAttrSet) ); @@ -172,7 +172,7 @@ bool Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwCntntNode& rNode } bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, - const SwCntntNode& rNode, const SfxPoolItem& rAttr, + const SwContentNode& rNode, const SfxPoolItem& rAttr, SwAttrSet* pOld, SwAttrSet* pNew ) { SwAttrSet aNewSet( static_cast<const SwAttrSet&>(*rpAttrSet) ); @@ -191,7 +191,7 @@ bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, } bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, - const SwCntntNode& rNode, const SfxItemSet& rSet, + const SwContentNode& rNode, const SfxItemSet& rSet, SwAttrSet* pOld, SwAttrSet* pNew ) { SwAttrSet aNewSet( static_cast<const SwAttrSet&>(*rpAttrSet) ); @@ -225,7 +225,7 @@ bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, } sal_uInt16 ClearItem_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, - const SwCntntNode& rNode, sal_uInt16 nWhich, + const SwContentNode& rNode, sal_uInt16 nWhich, SwAttrSet* pOld, SwAttrSet* pNew ) { SwAttrSet aNewSet( static_cast<const SwAttrSet&>(*rpAttrSet) ); @@ -238,7 +238,7 @@ sal_uInt16 ClearItem_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, } sal_uInt16 ClearItem_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, - const SwCntntNode& rNode, + const SwContentNode& rNode, sal_uInt16 nWhich1, sal_uInt16 nWhich2, SwAttrSet* pOld, SwAttrSet* pNew ) { @@ -256,7 +256,7 @@ sal_uInt16 ClearItem_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, /** Returns the section level at the position given by aIndex. * * We use the following logic: - * S = Start, E = End, C = CntntNode + * S = Start, E = End, C = ContentNode * Level 0 = E * 1 = S E * 2 = SC @@ -283,7 +283,7 @@ long SwNode::s_nSerial = 0; SwNode::SwNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType ) : nNodeType( nNdType ) - , nAFmtNumLvl( 0 ) + , nAFormatNumLvl( 0 ) , bSetNumLSpace( false ) , bIgnoreDontExpand( false) #ifdef DBG_UTIL @@ -316,7 +316,7 @@ SwNode::SwNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType ) */ SwNode::SwNode( SwNodes& rNodes, sal_uLong nPos, const sal_uInt8 nNdType ) : nNodeType( nNdType ) - , nAFmtNumLvl( 0 ) + , nAFormatNumLvl( 0 ) , bSetNumLSpace( false ) , bIgnoreDontExpand( false) #ifdef DBG_UTIL @@ -361,7 +361,7 @@ SwTableNode* SwNode::FindTableNode() bool SwNode::IsInVisibleArea( SwViewShell const * pSh ) const { bool bRet = false; - const SwCntntNode* pNd; + const SwContentNode* pNd; if( ND_STARTNODE & nNodeType ) { @@ -374,7 +374,7 @@ bool SwNode::IsInVisibleArea( SwViewShell const * pSh ) const pNd = SwNodes::GoPrevious( &aIdx ); } else - pNd = GetCntntNode(); + pNd = GetContentNode(); if( !pSh ) // Get the Shell from the Doc @@ -421,32 +421,32 @@ bool SwNode::IsProtect() const if( 0 != ( pSttNd = FindTableBoxStartNode() ) ) { - SwCntntFrm* pCFrm; - if( IsCntntNode() && 0 != (pCFrm = static_cast<const SwCntntNode*>(this)->getLayoutFrm( GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ) )) + SwContentFrm* pCFrm; + if( IsContentNode() && 0 != (pCFrm = static_cast<const SwContentNode*>(this)->getLayoutFrm( GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout() ) )) return pCFrm->IsProtected(); const SwTableBox* pBox = pSttNd->FindTableNode()->GetTable(). - GetTblBox( pSttNd->GetIndex() ); + GetTableBox( pSttNd->GetIndex() ); //Robust #149568 - if( pBox && pBox->GetFrmFmt()->GetProtect().IsCntntProtected() ) + if( pBox && pBox->GetFrameFormat()->GetProtect().IsContentProtected() ) return true; } - SwFrmFmt* pFlyFmt = GetFlyFmt(); - if( pFlyFmt ) + SwFrameFormat* pFlyFormat = GetFlyFormat(); + if( pFlyFormat ) { - if( pFlyFmt->GetProtect().IsCntntProtected() ) + if( pFlyFormat->GetProtect().IsContentProtected() ) return true; - const SwFmtAnchor& rAnchor = pFlyFmt->GetAnchor(); - return rAnchor.GetCntntAnchor() && rAnchor.GetCntntAnchor()->nNode.GetNode().IsProtect(); + const SwFormatAnchor& rAnchor = pFlyFormat->GetAnchor(); + return rAnchor.GetContentAnchor() && rAnchor.GetContentAnchor()->nNode.GetNode().IsProtect(); } if( 0 != ( pSttNd = FindFootnoteStartNode() ) ) { - const SwTxtFtn* pTFtn = GetDoc()->GetFtnIdxs().SeekEntry( + const SwTextFootnote* pTFootnote = GetDoc()->GetFootnoteIdxs().SeekEntry( SwNodeIndex( *pSttNd ) ); - if( pTFtn ) - return pTFtn->GetTxtNode().IsProtect(); + if( pTFootnote ) + return pTFootnote->GetTextNode().IsProtect(); } return false; @@ -464,7 +464,7 @@ const SwPageDesc* SwNode::FindPageDesc( bool bCalcLay, const SwPageDesc* pPgDesc = 0; - const SwCntntNode* pNode; + const SwContentNode* pNode; if( ND_STARTNODE & nNodeType ) { SwNodeIndex aIdx( *this ); @@ -477,9 +477,9 @@ const SwPageDesc* SwNode::FindPageDesc( bool bCalcLay, } else { - pNode = GetCntntNode(); + pNode = GetContentNode(); if( pNode ) - pPgDesc = static_cast<const SwFmtPageDesc&>(pNode->GetAttr( RES_PAGEDESC )).GetPageDesc(); + pPgDesc = static_cast<const SwFormatPageDesc&>(pNode->GetAttr( RES_PAGEDESC )).GetPageDesc(); } // Are we going through the layout? @@ -508,60 +508,60 @@ const SwPageDesc* SwNode::FindPageDesc( bool bCalcLay, 0 != ( pSttNd = pNd->FindFlyStartNode() ) ) { // Find the right Anchor first - const SwFrmFmt* pFmt = 0; - const SwFrmFmts& rFmts = *pDoc->GetSpzFrmFmts(); + const SwFrameFormat* pFormat = 0; + const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats(); - for( size_t n = 0; n < rFmts.size(); ++n ) + for( size_t n = 0; n < rFormats.size(); ++n ) { - const SwFrmFmt* pFrmFmt = rFmts[ n ]; - const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt(); - if( rCntnt.GetCntntIdx() && - &rCntnt.GetCntntIdx()->GetNode() == (SwNode*)pSttNd ) + const SwFrameFormat* pFrameFormat = rFormats[ n ]; + const SwFormatContent& rContent = pFrameFormat->GetContent(); + if( rContent.GetContentIdx() && + &rContent.GetContentIdx()->GetNode() == (SwNode*)pSttNd ) { - pFmt = pFrmFmt; + pFormat = pFrameFormat; break; } } - if( pFmt ) + if( pFormat ) { - const SwFmtAnchor* pAnchor = &pFmt->GetAnchor(); + const SwFormatAnchor* pAnchor = &pFormat->GetAnchor(); if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && - pAnchor->GetCntntAnchor() ) + pAnchor->GetContentAnchor() ) { - pNd = &pAnchor->GetCntntAnchor()->nNode.GetNode(); + pNd = &pAnchor->GetContentAnchor()->nNode.GetNode(); const SwNode* pFlyNd = pNd->FindFlyStartNode(); while( pFlyNd ) { // Get up through the Anchor size_t n; - for( n = 0; n < rFmts.size(); ++n ) + for( n = 0; n < rFormats.size(); ++n ) { - const SwFrmFmt* pFrmFmt = rFmts[ n ]; - const SwNodeIndex* pIdx = pFrmFmt->GetCntnt(). - GetCntntIdx(); + const SwFrameFormat* pFrameFormat = rFormats[ n ]; + const SwNodeIndex* pIdx = pFrameFormat->GetContent(). + GetContentIdx(); if( pIdx && pFlyNd == &pIdx->GetNode() ) { - if( pFmt == pFrmFmt ) + if( pFormat == pFrameFormat ) { pNd = pFlyNd; pFlyNd = 0; break; } - pAnchor = &pFrmFmt->GetAnchor(); + pAnchor = &pFrameFormat->GetAnchor(); if ((FLY_AT_PAGE == pAnchor->GetAnchorId()) || - !pAnchor->GetCntntAnchor() ) + !pAnchor->GetContentAnchor() ) { pFlyNd = 0; break; } - pFlyNd = pAnchor->GetCntntAnchor()->nNode. + pFlyNd = pAnchor->GetContentAnchor()->nNode. GetNode().FindFlyStartNode(); break; } } - if( n >= rFmts.size() ) + if( n >= rFormats.size() ) { OSL_ENSURE( false, "FlySection, but no Format found" ); return 0; @@ -602,22 +602,22 @@ const SwPageDesc* SwNode::FindPageDesc( bool bCalcLay, for( size_t n = pDoc->GetPageDescCnt(); n && !pPgDesc; ) { const SwPageDesc& rPgDsc = pDoc->GetPageDesc( --n ); - const SwFrmFmt* pFmt = &rPgDsc.GetMaster(); + const SwFrameFormat* pFormat = &rPgDsc.GetMaster(); int nStt = 0, nLast = 1; if( !( eAskUse & rPgDsc.ReadUseOn() )) ++nLast; - for( ; nStt < nLast; ++nStt, pFmt = &rPgDsc.GetLeft() ) + for( ; nStt < nLast; ++nStt, pFormat = &rPgDsc.GetLeft() ) { - const SwFrmFmt * pHdFtFmt = nId == RES_HEADER - ? static_cast<SwFmtHeader const &>( - pFmt->GetFmtAttr(nId)).GetHeaderFmt() - : static_cast<SwFmtFooter const &>( - pFmt->GetFmtAttr(nId)).GetFooterFmt(); - if( pHdFtFmt ) + const SwFrameFormat * pHdFtFormat = nId == RES_HEADER + ? static_cast<SwFormatHeader const &>( + pFormat->GetFormatAttr(nId)).GetHeaderFormat() + : static_cast<SwFormatFooter const &>( + pFormat->GetFormatAttr(nId)).GetFooterFormat(); + if( pHdFtFormat ) { - const SwFmtCntnt& rCntnt = pHdFtFmt->GetCntnt(); - if( rCntnt.GetCntntIdx() && - &rCntnt.GetCntntIdx()->GetNode() == + const SwFormatContent& rContent = pHdFtFormat->GetContent(); + if( rContent.GetContentIdx() && + &rContent.GetContentIdx()->GetNode() == (SwNode*)pSttNd ) { pPgDesc = &rPgDsc; @@ -634,14 +634,14 @@ const SwPageDesc* SwNode::FindPageDesc( bool bCalcLay, else if( 0 != ( pSttNd = pNd->FindFootnoteStartNode() )) { // the Anchor can only be in the Body text - const SwTxtFtn* pTxtFtn; - const SwFtnIdxs& rFtnArr = pDoc->GetFtnIdxs(); - for( size_t n = 0; n < rFtnArr.size(); ++n ) - if( 0 != ( pTxtFtn = rFtnArr[ n ])->GetStartNode() && + const SwTextFootnote* pTextFootnote; + const SwFootnoteIdxs& rFootnoteArr = pDoc->GetFootnoteIdxs(); + for( size_t n = 0; n < rFootnoteArr.size(); ++n ) + if( 0 != ( pTextFootnote = rFootnoteArr[ n ])->GetStartNode() && (SwNode*)pSttNd == - &pTxtFtn->GetStartNode()->GetNode() ) + &pTextFootnote->GetStartNode()->GetNode() ) { - pNd = &pTxtFtn->GetTxtNode(); + pNd = &pTextFootnote->GetTextNode(); break; } } @@ -667,27 +667,27 @@ const SwPageDesc* SwNode::FindPageDesc( bool bCalcLay, { const SfxPoolItem* pItem; if( 0 != (pItem = pDoc->GetAttrPool().GetItem2( RES_PAGEDESC, i ) ) && - static_cast<const SwFmtPageDesc*>(pItem)->GetDefinedIn() ) + static_cast<const SwFormatPageDesc*>(pItem)->GetDefinedIn() ) { - const SwModify* pMod = static_cast<const SwFmtPageDesc*>(pItem)->GetDefinedIn(); - if( pMod->ISA( SwCntntNode ) ) - aInfo.CheckNode( *static_cast<const SwCntntNode*>(pMod) ); - else if( pMod->ISA( SwFmt )) - static_cast<const SwFmt*>(pMod)->GetInfo( aInfo ); + const SwModify* pMod = static_cast<const SwFormatPageDesc*>(pItem)->GetDefinedIn(); + if( pMod->ISA( SwContentNode ) ) + aInfo.CheckNode( *static_cast<const SwContentNode*>(pMod) ); + else if( pMod->ISA( SwFormat )) + static_cast<const SwFormat*>(pMod)->GetInfo( aInfo ); } } if( 0 != ( pNd = aInfo.GetFoundNode() )) { - if( pNd->IsCntntNode() ) - pPgDesc = static_cast<const SwFmtPageDesc&>(pNd->GetCntntNode()-> + if( pNd->IsContentNode() ) + pPgDesc = static_cast<const SwFormatPageDesc&>(pNd->GetContentNode()-> GetAttr( RES_PAGEDESC )).GetPageDesc(); else if( pNd->IsTableNode() ) pPgDesc = pNd->GetTableNode()->GetTable(). - GetFrmFmt()->GetPageDesc().GetPageDesc(); + GetFrameFormat()->GetPageDesc().GetPageDesc(); else if( pNd->IsSectionNode() ) pPgDesc = pNd->GetSectionNode()->GetSection(). - GetFmt()->GetPageDesc().GetPageDesc(); + GetFormat()->GetPageDesc().GetPageDesc(); if ( pPgDescNdIdx ) { *pPgDescNdIdx = pNd->GetIndex(); @@ -701,33 +701,33 @@ const SwPageDesc* SwNode::FindPageDesc( bool bCalcLay, } /// If the node is located in a Fly, we return it formatted accordingly -SwFrmFmt* SwNode::GetFlyFmt() const +SwFrameFormat* SwNode::GetFlyFormat() const { - SwFrmFmt* pRet = 0; + SwFrameFormat* pRet = 0; const SwNode* pSttNd = FindFlyStartNode(); if( pSttNd ) { - if( IsCntntNode() ) + if( IsContentNode() ) { - SwCntntFrm* pFrm = SwIterator<SwCntntFrm,SwCntntNode>( *static_cast<const SwCntntNode*>(this) ).First(); + SwContentFrm* pFrm = SwIterator<SwContentFrm,SwContentNode>( *static_cast<const SwContentNode*>(this) ).First(); if( pFrm ) - pRet = pFrm->FindFlyFrm()->GetFmt(); + pRet = pFrm->FindFlyFrm()->GetFormat(); } if( !pRet ) { // The hard way through the Doc is our last way out - const SwFrmFmts& rFrmFmtTbl = *GetDoc()->GetSpzFrmFmts(); - for( size_t n = 0; n < rFrmFmtTbl.size(); ++n ) + const SwFrameFormats& rFrameFormatTable = *GetDoc()->GetSpzFrameFormats(); + for( size_t n = 0; n < rFrameFormatTable.size(); ++n ) { - SwFrmFmt* pFmt = rFrmFmtTbl[n]; + SwFrameFormat* pFormat = rFrameFormatTable[n]; // Only Writer fly frames can contain Writer nodes. - if (pFmt->Which() != RES_FLYFRMFMT) + if (pFormat->Which() != RES_FLYFRMFMT) continue; - const SwFmtCntnt& rCntnt = pFmt->GetCntnt(); - if( rCntnt.GetCntntIdx() && - &rCntnt.GetCntntIdx()->GetNode() == pSttNd ) + const SwFormatContent& rContent = pFormat->GetContent(); + if( rContent.GetContentIdx() && + &rContent.GetContentIdx()->GetNode() == pSttNd ) { - pRet = pFmt; + pRet = pFormat; break; } } @@ -736,12 +736,12 @@ SwFrmFmt* SwNode::GetFlyFmt() const return pRet; } -SwTableBox* SwNode::GetTblBox() const +SwTableBox* SwNode::GetTableBox() const { SwTableBox* pBox = 0; const SwNode* pSttNd = FindTableBoxStartNode(); if( pSttNd ) - pBox = const_cast<SwTableBox*>(pSttNd->FindTableNode()->GetTable().GetTblBox( + pBox = const_cast<SwTableBox*>(pSttNd->FindTableNode()->GetTable().GetTableBox( pSttNd->GetIndex() )); return pBox; } @@ -755,9 +755,9 @@ SwStartNode* SwNode::FindSttNodeByType( SwStartNodeType eTyp ) return eTyp == pTmp->GetStartNodeType() ? pTmp : 0; } -const SwTxtNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const +const SwTextNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const { - const SwTxtNode* pRet = 0; + const SwTextNode* pRet = 0; const SwOutlineNodes& rONds = GetNodes().GetOutLineNds(); if( MAXLEVEL > nLvl && !rONds.empty() ) { @@ -776,9 +776,9 @@ const SwTxtNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const { // The first OutlineNode comes after the one asking. Test if it points to the same node. // If not it's invalid. - pRet = rONds[0]->GetTxtNode(); + pRet = rONds[0]->GetTextNode(); - const SwCntntNode* pCNd = GetCntntNode(); + const SwContentNode* pCNd = GetContentNode(); Point aPt( 0, 0 ); const SwFrm* pFrm = pRet->getLayoutFrm( pRet->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, 0, false ), @@ -795,12 +795,12 @@ const SwTxtNode* SwNode::FindOutlineNodeOfLevel( sal_uInt8 nLvl ) const { // Or at the Field and get it from there! while( nPos && - nLvl < ( pRet = rONds[nPos]->GetTxtNode() ) + nLvl < ( pRet = rONds[nPos]->GetTextNode() ) ->GetAttrOutlineLevel() - 1 ) --nPos; if( !nPos ) // Get separately when 0 - pRet = rONds[0]->GetTxtNode(); + pRet = rONds[0]->GetTextNode(); } } return pRet; @@ -909,7 +909,7 @@ void SwStartNode::CheckSectionCondColl() const SwNodeIndex aIdx( *this ); sal_uLong nEndIdx = EndOfSectionIndex(); const SwNodes& rNds = GetNodes(); - SwCntntNode* pCNd; + SwContentNode* pCNd; while( 0 != ( pCNd = rNds.GoNext( &aIdx )) && pCNd->GetIndex() < nEndIdx ) pCNd->ChkCondColl(); //FEATURE::CONDCOLL @@ -959,7 +959,7 @@ void SwStartNode::dumpAsXml(xmlTextWriterPtr pWriter) const if (IsTableNode()) { xmlTextWriterStartElement(pWriter, BAD_CAST("attrset")); - GetTableNode()->GetTable().GetFrmFmt()->GetAttrSet().dumpAsXml(pWriter); + GetTableNode()->GetTable().GetFrameFormat()->GetAttrSet().dumpAsXml(pWriter); xmlTextWriterEndElement(pWriter); } @@ -991,16 +991,16 @@ SwEndNode::SwEndNode( SwNodes& rNds, sal_uLong nPos, SwStartNode& rSttNd ) pStartOfSection->pEndOfSection = this; } -SwCntntNode::SwCntntNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType, - SwFmtColl *pColl ) - : SwModify( pColl ), // CrsrsShell, FrameFmt, +SwContentNode::SwContentNode( const SwNodeIndex &rWhere, const sal_uInt8 nNdType, + SwFormatColl *pColl ) + : SwModify( pColl ), // CrsrsShell, FrameFormat, SwNode( rWhere, nNdType ), pCondColl( 0 ), mbSetModifyAtAttr( false ) { } -SwCntntNode::~SwCntntNode() +SwContentNode::~SwContentNode() { // The base class SwClient of SwFrm excludes itself from the dependency list! // Thus, we need to delete all Frames in the dependency list. @@ -1012,7 +1012,7 @@ SwCntntNode::~SwCntntNode() const_cast<SwAttrSet*>(static_cast<const SwAttrSet*>(mpAttrSet.get()))->SetModifyAtAttr( 0 ); } -void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) +void SwContentNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue ) { sal_uInt16 nWhich = pOldValue ? pOldValue->Which() : pNewValue ? pNewValue->Which() : 0 ; @@ -1022,17 +1022,17 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV case RES_OBJECTDYING : if (pNewValue) { - SwFmt * pFmt = static_cast<SwFmt *>( static_cast<const SwPtrMsgPoolItem *>(pNewValue)->pObject ); + SwFormat * pFormat = static_cast<SwFormat *>( static_cast<const SwPtrMsgPoolItem *>(pNewValue)->pObject ); // Do not mangle pointers if it is the upper-most format! - if( GetRegisteredIn() == pFmt ) + if( GetRegisteredIn() == pFormat ) { - if( pFmt->GetRegisteredIn() ) + if( pFormat->GetRegisteredIn() ) { // If Parent, register anew in the new Parent - static_cast<SwModify*>(pFmt->GetRegisteredIn())->Add( this ); + static_cast<SwModify*>(pFormat->GetRegisteredIn())->Add( this ); if ( GetpSwAttrSet() ) - AttrSetHandleHelper::SetParent( mpAttrSet, *this, GetFmtColl(), GetFmtColl() ); + AttrSetHandleHelper::SetParent( mpAttrSet, *this, GetFormatColl(), GetFormatColl() ); } else { @@ -1049,16 +1049,16 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV // If the Format parent was switched, register the Attrset at the new one // Skip own Modify! if( GetpSwAttrSet() && pNewValue && - static_cast<const SwFmtChg*>(pNewValue)->pChangedFmt == GetRegisteredIn() ) + static_cast<const SwFormatChg*>(pNewValue)->pChangedFormat == GetRegisteredIn() ) { // Attach Set to the new parent - AttrSetHandleHelper::SetParent( mpAttrSet, *this, GetFmtColl(), GetFmtColl() ); + AttrSetHandleHelper::SetParent( mpAttrSet, *this, GetFormatColl(), GetFormatColl() ); } break; //FEATURE::CONDCOLL case RES_CONDCOLL_CONDCHG: - if( pNewValue && static_cast<const SwCondCollCondChg*>(pNewValue)->pChangedFmt == GetRegisteredIn() && + if( pNewValue && static_cast<const SwCondCollCondChg*>(pNewValue)->pChangedFormat == GetRegisteredIn() && &GetNodes() == &GetDoc()->GetNodes() ) { ChkCondColl(); @@ -1067,24 +1067,24 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV //FEATURE::CONDCOLL case RES_ATTRSET_CHG: - if (GetNodes().IsDocNodes() && IsTxtNode() && pOldValue) + if (GetNodes().IsDocNodes() && IsTextNode() && pOldValue) { if( SfxItemState::SET == static_cast<const SwAttrSetChg*>(pOldValue)->GetChgSet()->GetItemState( RES_CHRATR_HIDDEN, false ) ) { - static_cast<SwTxtNode*>(this)->SetCalcHiddenCharFlags(); + static_cast<SwTextNode*>(this)->SetCalcHiddenCharFlags(); } } break; case RES_UPDATE_ATTR: - if (GetNodes().IsDocNodes() && IsTxtNode() && pNewValue) + if (GetNodes().IsDocNodes() && IsTextNode() && pNewValue) { const sal_uInt16 nTmp = static_cast<const SwUpdateAttr*>(pNewValue)->getWhichAttr(); if ( RES_ATTRSET_CHG == nTmp ) { // TODO: anybody wants to do some optimization here? - static_cast<SwTxtNode*>(this)->SetCalcHiddenCharFlags(); + static_cast<SwTextNode*>(this)->SetCalcHiddenCharFlags(); } } break; @@ -1093,7 +1093,7 @@ void SwCntntNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewV NotifyClients( pOldValue, pNewValue ); } -bool SwCntntNode::InvalidateNumRule() +bool SwContentNode::InvalidateNumRule() { SwNumRule* pRule = 0; const SfxPoolItem* pItem; @@ -1108,25 +1108,25 @@ bool SwCntntNode::InvalidateNumRule() return 0 != pRule; } -SwCntntFrm *SwCntntNode::getLayoutFrm( const SwRootFrm* _pRoot, +SwContentFrm *SwContentNode::getLayoutFrm( const SwRootFrm* _pRoot, const Point* pPoint, const SwPosition *pPos, const bool bCalcFrm ) const { - return static_cast<SwCntntFrm*>( ::GetFrmOfModify( _pRoot, *(SwModify*)this, FRM_CNTNT, + return static_cast<SwContentFrm*>( ::GetFrmOfModify( _pRoot, *(SwModify*)this, FRM_CNTNT, pPoint, pPos, bCalcFrm )); } -SwRect SwCntntNode::FindLayoutRect( const bool bPrtArea, const Point* pPoint, +SwRect SwContentNode::FindLayoutRect( const bool bPrtArea, const Point* pPoint, const bool bCalcFrm ) const { SwRect aRet; - SwCntntFrm* pFrm = static_cast<SwCntntFrm*>( ::GetFrmOfModify( 0, *(SwModify*)this, + SwContentFrm* pFrm = static_cast<SwContentFrm*>( ::GetFrmOfModify( 0, *(SwModify*)this, FRM_CNTNT, pPoint, 0, bCalcFrm ) ); if( pFrm ) aRet = bPrtArea ? pFrm->Prt() : pFrm->Frm(); return aRet; } -SwRect SwCntntNode::FindPageFrmRect( const bool bPrtArea, const Point* pPoint, +SwRect SwContentNode::FindPageFrmRect( const bool bPrtArea, const Point* pPoint, const bool bCalcFrm ) const { SwRect aRet; @@ -1137,12 +1137,12 @@ SwRect SwCntntNode::FindPageFrmRect( const bool bPrtArea, const Point* pPoint, return aRet; } -sal_Int32 SwCntntNode::Len() const { return 0; } +sal_Int32 SwContentNode::Len() const { return 0; } -SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl ) +SwFormatColl *SwContentNode::ChgFormatColl( SwFormatColl *pNewColl ) { OSL_ENSURE( pNewColl, "Collectionpointer is 0." ); - SwFmtColl *pOldColl = GetFmtColl(); + SwFormatColl *pOldColl = GetFormatColl(); if( pNewColl != pOldColl ) { @@ -1156,15 +1156,15 @@ SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl ) // TODO: HACK: We need to recheck this condition according to the new template! if( true /*pNewColl */ ) { - SetCondFmtColl( 0 ); + SetCondFormatColl( 0 ); } //FEATURE::CONDCOLL if( !IsModifyLocked() ) { - SwFmtChg aTmp1( pOldColl ); - SwFmtChg aTmp2( pNewColl ); - SwCntntNode::Modify( &aTmp1, &aTmp2 ); + SwFormatChg aTmp1( pOldColl ); + SwFormatChg aTmp2( pNewColl ); + SwContentNode::Modify( &aTmp1, &aTmp2 ); } } if ( IsInCache() ) @@ -1175,16 +1175,16 @@ SwFmtColl *SwCntntNode::ChgFmtColl( SwFmtColl *pNewColl ) return pOldColl; } -bool SwCntntNode::GoNext(SwIndex * pIdx, sal_uInt16 nMode ) const +bool SwContentNode::GoNext(SwIndex * pIdx, sal_uInt16 nMode ) const { bool bRet = true; if( pIdx->GetIndex() < Len() ) { - if( !IsTxtNode() ) + if( !IsTextNode() ) ++(*pIdx); else { - const SwTxtNode& rTNd = *GetTxtNode(); + const SwTextNode& rTNd = *GetTextNode(); sal_Int32 nPos = pIdx->GetIndex(); if( g_pBreakIt->GetBreakIter().is() ) { @@ -1192,7 +1192,7 @@ bool SwCntntNode::GoNext(SwIndex * pIdx, sal_uInt16 nMode ) const sal_uInt16 nItrMode = ( CRSR_SKIP_CELLS & nMode ) ? CharacterIteratorMode::SKIPCELL : CharacterIteratorMode::SKIPCONTROLCHARACTER; - nPos = g_pBreakIt->GetBreakIter()->nextCharacters( rTNd.GetTxt(), nPos, + nPos = g_pBreakIt->GetBreakIter()->nextCharacters( rTNd.GetText(), nPos, g_pBreakIt->GetLocale( rTNd.GetLang( nPos ) ), nItrMode, 1, nDone ); @@ -1211,7 +1211,7 @@ bool SwCntntNode::GoNext(SwIndex * pIdx, sal_uInt16 nMode ) const else bRet = false; } - else if (nPos < rTNd.GetTxt().getLength()) + else if (nPos < rTNd.GetText().getLength()) ++(*pIdx); else bRet = false; @@ -1222,16 +1222,16 @@ bool SwCntntNode::GoNext(SwIndex * pIdx, sal_uInt16 nMode ) const return bRet; } -bool SwCntntNode::GoPrevious(SwIndex * pIdx, sal_uInt16 nMode ) const +bool SwContentNode::GoPrevious(SwIndex * pIdx, sal_uInt16 nMode ) const { bool bRet = true; if( pIdx->GetIndex() > 0 ) { - if( !IsTxtNode() ) + if( !IsTextNode() ) --(*pIdx); else { - const SwTxtNode& rTNd = *GetTxtNode(); + const SwTextNode& rTNd = *GetTextNode(); sal_Int32 nPos = pIdx->GetIndex(); if( g_pBreakIt->GetBreakIter().is() ) { @@ -1239,7 +1239,7 @@ bool SwCntntNode::GoPrevious(SwIndex * pIdx, sal_uInt16 nMode ) const sal_uInt16 nItrMode = ( CRSR_SKIP_CELLS & nMode ) ? CharacterIteratorMode::SKIPCELL : CharacterIteratorMode::SKIPCONTROLCHARACTER; - nPos = g_pBreakIt->GetBreakIter()->previousCharacters( rTNd.GetTxt(), nPos, + nPos = g_pBreakIt->GetBreakIter()->previousCharacters( rTNd.GetText(), nPos, g_pBreakIt->GetLocale( rTNd.GetLang( nPos ) ), nItrMode, 1, nDone ); @@ -1273,7 +1273,7 @@ bool SwCntntNode::GoPrevious(SwIndex * pIdx, sal_uInt16 nMode ) const * Creates all Views for the Doc for this Node. * The created ContentFrames are attached to the corresponding Layout. */ -void SwCntntNode::MakeFrms( SwCntntNode& rNode ) +void SwContentNode::MakeFrms( SwContentNode& rNode ) { OSL_ENSURE( &rNode != this, "No ContentNode or CopyNode and new Node identical." ); @@ -1297,15 +1297,15 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode ) // CONTENT_FLOWS_FROM/_TO relation. // Relation CONTENT_FLOWS_FROM for next paragraph will change // and relation CONTENT_FLOWS_TO for previous paragraph will change. - if ( pNew->IsTxtFrm() ) + if ( pNew->IsTextFrm() ) { SwViewShell* pViewShell( pNew->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { pViewShell->InvalidateAccessibleParaFlowRelation( - dynamic_cast<SwTxtFrm*>(pNew->FindNextCnt( true )), - dynamic_cast<SwTxtFrm*>(pNew->FindPrevCnt( true )) ); + dynamic_cast<SwTextFrm*>(pNew->FindNextCnt( true )), + dynamic_cast<SwTextFrm*>(pNew->FindPrevCnt( true )) ); } } } @@ -1317,34 +1317,34 @@ void SwCntntNode::MakeFrms( SwCntntNode& rNode ) * * An input param to identify if the acc table should be disposed. */ -void SwCntntNode::DelFrms( bool bIsDisposeAccTable ) +void SwContentNode::DelFrms( bool bIsDisposeAccTable ) { if( !HasWriterListeners() ) return; - SwIterator<SwCntntFrm,SwCntntNode> aIter( *this ); - for( SwCntntFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) + SwIterator<SwContentFrm,SwContentNode> aIter( *this ); + for( SwContentFrm* pFrm = aIter.First(); pFrm; pFrm = aIter.Next() ) { // #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() ) + if ( pFrm->IsTextFrm() ) { SwViewShell* pViewShell( pFrm->getRootFrm()->GetCurrShell() ); if ( pViewShell && pViewShell->GetLayout() && pViewShell->GetLayout()->IsAnyShellAccessible() ) { pViewShell->InvalidateAccessibleParaFlowRelation( - dynamic_cast<SwTxtFrm*>(pFrm->FindNextCnt( true )), - dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) ); + dynamic_cast<SwTextFrm*>(pFrm->FindNextCnt( true )), + dynamic_cast<SwTextFrm*>(pFrm->FindPrevCnt( true )) ); } } if( pFrm->IsFollow() ) { - SwCntntFrm* pMaster = pFrm->FindMaster(); + SwContentFrm* pMaster = pFrm->FindMaster(); pMaster->SetFollow( pFrm->GetFollow() ); } pFrm->SetFollow( 0 );//So it doesn't get funny ideas. @@ -1355,17 +1355,17 @@ void SwCntntNode::DelFrms( bool bIsDisposeAccTable ) //crushed here because we'll destroy all of it //anyway. - if( pFrm->GetUpper() && pFrm->IsInFtn() && !pFrm->GetIndNext() && + if( pFrm->GetUpper() && pFrm->IsInFootnote() && !pFrm->GetIndNext() && !pFrm->GetIndPrev() ) { - SwFtnFrm *pFtn = pFrm->FindFtnFrm(); - OSL_ENSURE( pFtn, "You promised a FtnFrm?" ); - SwCntntFrm* pCFrm; - if( !pFtn->GetFollow() && !pFtn->GetMaster() && - 0 != ( pCFrm = pFtn->GetRefFromAttr()) && pCFrm->IsFollow() ) + SwFootnoteFrm *pFootnote = pFrm->FindFootnoteFrm(); + OSL_ENSURE( pFootnote, "You promised a FootnoteFrm?" ); + SwContentFrm* pCFrm; + if( !pFootnote->GetFollow() && !pFootnote->GetMaster() && + 0 != ( pCFrm = pFootnote->GetRefFromAttr()) && pCFrm->IsFollow() ) { - OSL_ENSURE( pCFrm->IsTxtFrm(), "NoTxtFrm has Footnote?" ); - static_cast<SwTxtFrm*>(pCFrm->FindMaster())->Prepare( PREP_FTN_GONE ); + OSL_ENSURE( pCFrm->IsTextFrm(), "NoTextFrm has Footnote?" ); + static_cast<SwTextFrm*>(pCFrm->FindMaster())->Prepare( PREP_FTN_GONE ); } } //Set acc table dispose state @@ -1376,44 +1376,44 @@ void SwCntntNode::DelFrms( bool bIsDisposeAccTable ) SwFrm::DestroyFrm(pFrm); } - if( bIsDisposeAccTable && IsTxtNode() ) + if( bIsDisposeAccTable && IsTextNode() ) { - GetTxtNode()->DelFrms_TxtNodePart(); + GetTextNode()->DelFrms_TextNodePart(); } } -SwCntntNode *SwCntntNode::JoinNext() +SwContentNode *SwContentNode::JoinNext() { return this; } -SwCntntNode *SwCntntNode::JoinPrev() +SwContentNode *SwContentNode::JoinPrev() { return this; } /// Get info from Modify -bool SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const +bool SwContentNode::GetInfo( SfxPoolItem& rInfo ) const { switch( rInfo.Which() ) { case RES_AUTOFMT_DOCNODE: - if( &GetNodes() == static_cast<SwAutoFmtGetDocNode&>(rInfo).pNodes ) + if( &GetNodes() == static_cast<SwAutoFormatGetDocNode&>(rInfo).pNodes ) { - static_cast<SwAutoFmtGetDocNode&>(rInfo).pCntntNode = this; + static_cast<SwAutoFormatGetDocNode&>(rInfo).pContentNode = this; return false; } break; case RES_FINDNEARESTNODE: - if( static_cast<const SwFmtPageDesc&>(GetAttr( RES_PAGEDESC )).GetPageDesc() ) + if( static_cast<const SwFormatPageDesc&>(GetAttr( RES_PAGEDESC )).GetPageDesc() ) static_cast<SwFindNearestNode&>(rInfo).CheckNode( *this ); return true; case RES_CONTENT_VISIBLE: { static_cast<SwPtrMsgPoolItem&>(rInfo).pObject = - SwIterator<SwFrm,SwCntntNode>(*this).First(); + SwIterator<SwFrm,SwContentNode>(*this).First(); } return false; } @@ -1422,7 +1422,7 @@ bool SwCntntNode::GetInfo( SfxPoolItem& rInfo ) const } /// @param rAttr the attribute to set -bool SwCntntNode::SetAttr(const SfxPoolItem& rAttr ) +bool SwContentNode::SetAttr(const SfxPoolItem& rAttr ) { if( !GetpSwAttrSet() ) // Have the Nodes created by the corresponding AttrSets NewAttrSet( GetDoc()->GetAttrPool() ); @@ -1458,7 +1458,7 @@ bool SwCntntNode::SetAttr(const SfxPoolItem& rAttr ) #include <svl/itemiter.hxx> -bool SwCntntNode::SetAttr( const SfxItemSet& rSet ) +bool SwContentNode::SetAttr( const SfxItemSet& rSet ) { if ( IsInCache() ) { @@ -1470,7 +1470,7 @@ bool SwCntntNode::SetAttr( const SfxItemSet& rSet ) if( SfxItemState::SET == rSet.GetItemState( RES_AUTO_STYLE, false, &pFnd ) ) { OSL_ENSURE( rSet.Count() == 1, "SetAutoStyle mixed with other attributes?!" ); - const SwFmtAutoFmt* pTmp = static_cast<const SwFmtAutoFmt*>(pFnd); + const SwFormatAutoFormat* pTmp = static_cast<const SwFormatAutoFormat*>(pFnd); // If there already is an attribute set (usually containing a numbering // item), we have to merge the attribute of the new set into the old set: @@ -1495,12 +1495,12 @@ bool SwCntntNode::SetAttr( const SfxItemSet& rSet ) // FME 2007-07-10 #i78124# If autostyle does not have a parent, // the string is empty. const SfxPoolItem* pNameItem = 0; - if ( 0 != GetCondFmtColl() || + if ( 0 != GetCondFormatColl() || SfxItemState::SET != mpAttrSet->GetItemState( RES_FRMATR_STYLE_NAME, false, &pNameItem ) || static_cast<const SfxStringItem*>(pNameItem)->GetValue().isEmpty() ) - AttrSetHandleHelper::SetParent( mpAttrSet, *this, &GetAnyFmtColl(), GetFmtColl() ); + AttrSetHandleHelper::SetParent( mpAttrSet, *this, &GetAnyFormatColl(), GetFormatColl() ); else - const_cast<SfxItemSet*>(mpAttrSet.get())->SetParent( &GetFmtColl()->GetAttrSet() ); + const_cast<SfxItemSet*>(mpAttrSet.get())->SetParent( &GetFormatColl()->GetAttrSet() ); } return true; @@ -1534,7 +1534,7 @@ bool SwCntntNode::SetAttr( const SfxItemSet& rSet ) } // With nWhich it takes the Hint from the Delta array -bool SwCntntNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) +bool SwContentNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) { if( !GetpSwAttrSet() ) return false; @@ -1583,7 +1583,7 @@ bool SwCntntNode::ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 ) return bRet; } -bool SwCntntNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr ) +bool SwContentNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr ) { if( !GetpSwAttrSet() ) return false; @@ -1623,7 +1623,7 @@ bool SwCntntNode::ResetAttr( const std::vector<sal_uInt16>& rWhichArr ) return 0 != nDel ; } -sal_uInt16 SwCntntNode::ResetAllAttr() +sal_uInt16 SwContentNode::ResetAllAttr() { if( !GetpSwAttrSet() ) return 0; @@ -1661,7 +1661,7 @@ sal_uInt16 SwCntntNode::ResetAllAttr() return aNew.Count(); } -bool SwCntntNode::GetAttr( SfxItemSet& rSet, bool bInParent ) const +bool SwContentNode::GetAttr( SfxItemSet& rSet, bool bInParent ) const { if( rSet.Count() ) rSet.ClearItem(); @@ -1674,7 +1674,7 @@ bool SwCntntNode::GetAttr( SfxItemSet& rSet, bool bInParent ) const return rSet.Count() != 0; } -sal_uInt16 SwCntntNode::ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rWhichIds ) +sal_uInt16 SwContentNode::ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rWhichIds ) { sal_uInt16 nRet = 0; if ( 0 == rWhichIds.size() ) @@ -1694,7 +1694,7 @@ sal_uInt16 SwCntntNode::ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rW return nRet; } -const SfxPoolItem* SwCntntNode::GetNoCondAttr( sal_uInt16 nWhich, +const SfxPoolItem* SwContentNode::GetNoCondAttr( sal_uInt16 nWhich, bool bInParents ) const { const SfxPoolItem* pFnd = 0; @@ -1703,7 +1703,7 @@ const SfxPoolItem* SwCntntNode::GetNoCondAttr( sal_uInt16 nWhich, if( !GetpSwAttrSet() || ( SfxItemState::SET != GetpSwAttrSet()->GetItemState( nWhich, false, &pFnd ) && bInParents )) { - (void)static_cast<const SwFmt*>(GetRegisteredIn())->GetItemState( nWhich, bInParents, &pFnd ); + (void)static_cast<const SwFormat*>(GetRegisteredIn())->GetItemState( nWhich, bInParents, &pFnd ); } } // undo change of issue #i51029# @@ -1723,18 +1723,18 @@ static bool lcl_CheckMaxLength(SwNode const& rPrev, SwNode const& rNext) { return false; } - if (!rPrev.IsTxtNode()) + if (!rPrev.IsTextNode()) { return true; } // Check if a node can contain the other (order is not significant) - return rPrev.GetTxtNode()->GetSpaceLeft() > rNext.GetTxtNode()->Len(); + return rPrev.GetTextNode()->GetSpaceLeft() > rNext.GetTextNode()->Len(); } /// Can we join two Nodes? /// We can return the 2nd position in pIdx. -bool SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const +bool SwContentNode::CanJoinNext( SwNodeIndex* pIdx ) const { const SwNodes& rNds = GetNodes(); SwNodeIndex aIdx( *this, 1 ); @@ -1758,7 +1758,7 @@ bool SwCntntNode::CanJoinNext( SwNodeIndex* pIdx ) const /// Can we join two Nodes? /// We can return the 2nd position in pIdx. -bool SwCntntNode::CanJoinPrev( SwNodeIndex* pIdx ) const +bool SwContentNode::CanJoinPrev( SwNodeIndex* pIdx ) const { SwNodeIndex aIdx( *this, -1 ); @@ -1780,12 +1780,12 @@ bool SwCntntNode::CanJoinPrev( SwNodeIndex* pIdx ) const } //FEATURE::CONDCOLL -void SwCntntNode::SetCondFmtColl( SwFmtColl* pColl ) +void SwContentNode::SetCondFormatColl( SwFormatColl* pColl ) { if( (!pColl && pCondColl) || ( pColl && !pCondColl ) || ( pColl && pColl != pCondColl->GetRegisteredIn() ) ) { - SwFmtColl* pOldColl = GetCondFmtColl(); + SwFormatColl* pOldColl = GetCondFormatColl(); delete pCondColl; if( pColl ) pCondColl = new SwDepend( this, pColl ); @@ -1794,13 +1794,13 @@ void SwCntntNode::SetCondFmtColl( SwFmtColl* pColl ) if( GetpSwAttrSet() ) { - AttrSetHandleHelper::SetParent( mpAttrSet, *this, &GetAnyFmtColl(), GetFmtColl() ); + AttrSetHandleHelper::SetParent( mpAttrSet, *this, &GetAnyFormatColl(), GetFormatColl() ); } if( !IsModifyLocked() ) { - SwFmtChg aTmp1( pOldColl ? pOldColl : GetFmtColl() ); - SwFmtChg aTmp2( pColl ? pColl : GetFmtColl() ); + SwFormatChg aTmp1( pOldColl ? pOldColl : GetFormatColl() ); + SwFormatChg aTmp2( pColl ? pColl : GetFormatColl() ); NotifyClients( &aTmp1, &aTmp2 ); } if( IsInCache() ) @@ -1811,7 +1811,7 @@ void SwCntntNode::SetCondFmtColl( SwFmtColl* pColl ) } } -bool SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const +bool SwContentNode::IsAnyCondition( SwCollCondition& rTmp ) const { const SwNodes& rNds = GetNodes(); { @@ -1830,11 +1830,11 @@ bool SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const case SwTableBoxStartNode: { nCond = PARA_IN_TABLEBODY; - const SwTableNode* pTblNd = pSttNd->FindTableNode(); + const SwTableNode* pTableNd = pSttNd->FindTableNode(); const SwTableBox* pBox; - if( pTblNd && 0 != ( pBox = pTblNd->GetTable(). - GetTblBox( pSttNd->GetIndex() ) ) && pBox && - pBox->IsInHeadline( &pTblNd->GetTable() ) ) + if( pTableNd && 0 != ( pBox = pTableNd->GetTable(). + GetTableBox( pSttNd->GetIndex() ) ) && pBox && + pBox->IsInHeadline( &pTableNd->GetTable() ) ) nCond = PARA_IN_TABLEHEAD; } break; @@ -1842,15 +1842,15 @@ bool SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const case SwFootnoteStartNode: { nCond = PARA_IN_FOOTENOTE; - const SwFtnIdxs& rFtnArr = rNds.GetDoc()->GetFtnIdxs(); - const SwTxtFtn* pTxtFtn; + const SwFootnoteIdxs& rFootnoteArr = rNds.GetDoc()->GetFootnoteIdxs(); + const SwTextFootnote* pTextFootnote; const SwNode* pSrchNd = pSttNd; - for( size_t n = 0; n < rFtnArr.size(); ++n ) - if( 0 != ( pTxtFtn = rFtnArr[ n ])->GetStartNode() && - pSrchNd == &pTxtFtn->GetStartNode()->GetNode() ) + for( size_t n = 0; n < rFootnoteArr.size(); ++n ) + if( 0 != ( pTextFootnote = rFootnoteArr[ n ])->GetStartNode() && + pSrchNd == &pTextFootnote->GetStartNode()->GetNode() ) { - if( pTxtFtn->GetFtn().IsEndNote() ) + if( pTextFootnote->GetFootnote().IsEndNote() ) nCond = PARA_IN_ENDNOTE; break; } @@ -1878,12 +1878,12 @@ bool SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds(); if( !rOutlNds.empty() ) { - if( !rOutlNds.Seek_Entry( const_cast<SwCntntNode*>(this), &nPos ) && nPos ) + if( !rOutlNds.Seek_Entry( const_cast<SwContentNode*>(this), &nPos ) && nPos ) --nPos; if( nPos < rOutlNds.size() && rOutlNds[ nPos ]->GetIndex() < GetIndex() ) { - SwTxtNode* pOutlNd = rOutlNds[ nPos ]->GetTxtNode(); + SwTextNode* pOutlNd = rOutlNds[ nPos ]->GetTextNode(); if( pOutlNd->IsOutline()) { @@ -1897,10 +1897,10 @@ bool SwCntntNode::IsAnyCondition( SwCollCondition& rTmp ) const return false; } -void SwCntntNode::ChkCondColl() +void SwContentNode::ChkCondColl() { // Check, just to be sure - if( RES_CONDTXTFMTCOLL == GetFmtColl()->Which() ) + if( RES_CONDTXTFMTCOLL == GetFormatColl()->Which() ) { SwCollCondition aTmp( 0, 0, 0 ); const SwCollCondition* pCColl; @@ -1909,39 +1909,39 @@ void SwCntntNode::ChkCondColl() if( IsAnyCondition( aTmp )) { - pCColl = static_cast<SwConditionTxtFmtColl*>(GetFmtColl()) + pCColl = static_cast<SwConditionTextFormatColl*>(GetFormatColl()) ->HasCondition( aTmp ); if (pCColl) { - SetCondFmtColl( pCColl->GetTxtFmtColl() ); + SetCondFormatColl( pCColl->GetTextFormatColl() ); bDone = true; } } if (!bDone) { - if( IsTxtNode() && static_cast<SwTxtNode*>(this)->GetNumRule()) + if( IsTextNode() && static_cast<SwTextNode*>(this)->GetNumRule()) { // Is at which Level in a list? aTmp.SetCondition( PARA_IN_LIST, - static_cast<SwTxtNode*>(this)->GetActualListLevel() ); - pCColl = static_cast<SwConditionTxtFmtColl*>(GetFmtColl())-> + static_cast<SwTextNode*>(this)->GetActualListLevel() ); + pCColl = static_cast<SwConditionTextFormatColl*>(GetFormatColl())-> HasCondition( aTmp ); } else pCColl = 0; if( pCColl ) - SetCondFmtColl( pCColl->GetTxtFmtColl() ); + SetCondFormatColl( pCColl->GetTextFormatColl() ); else if( pCondColl ) - SetCondFmtColl( 0 ); + SetCondFormatColl( 0 ); } } } // #i42921# -short SwCntntNode::GetTextDirection( const SwPosition& rPos, +short SwContentNode::GetTextDirection( const SwPosition& rPos, const Point* pPt ) const { short nRet = -1; @@ -1974,11 +1974,11 @@ short SwCntntNode::GetTextDirection( const SwPosition& rPos, return nRet; } -SwOLENodes* SwCntntNode::CreateOLENodesArray( const SwFmtColl& rColl, bool bOnlyWithInvalidSize ) +SwOLENodes* SwContentNode::CreateOLENodesArray( const SwFormatColl& rColl, bool bOnlyWithInvalidSize ) { SwOLENodes *pNodes = 0; - SwIterator<SwCntntNode,SwFmtColl> aIter( rColl ); - for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) + SwIterator<SwContentNode,SwFormatColl> aIter( rColl ); + for( SwContentNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) { SwOLENode *pONd = pNd->GetOLENode(); if ( pONd && (!bOnlyWithInvalidSize || pONd->IsOLESizeInvalid()) ) @@ -1993,7 +1993,7 @@ SwOLENodes* SwCntntNode::CreateOLENodesArray( const SwFmtColl& rColl, bool bOnly } //UUUU -drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwCntntNode::getSdrAllFillAttributesHelper() const +drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwContentNode::getSdrAllFillAttributesHelper() const { return drawinglayer::attribute::SdrAllFillAttributesHelperPtr(); } @@ -2029,27 +2029,27 @@ bool SwNode::IsInRedlines() const return bResult; } -void SwNode::AddAnchoredFly(SwFrmFmt *const pFlyFmt) +void SwNode::AddAnchoredFly(SwFrameFormat *const pFlyFormat) { - assert(pFlyFmt); - assert(&pFlyFmt->GetAnchor(false).GetCntntAnchor()->nNode.GetNode() == this); - // check node type, cf. SwFmtAnchor::SetAnchor() - assert(IsTxtNode() || IsStartNode() || IsTableNode()); + assert(pFlyFormat); + assert(&pFlyFormat->GetAnchor(false).GetContentAnchor()->nNode.GetNode() == this); + // check node type, cf. SwFormatAnchor::SetAnchor() + assert(IsTextNode() || IsStartNode() || IsTableNode()); if (!m_pAnchoredFlys) { - m_pAnchoredFlys.reset(new std::vector<SwFrmFmt*>); + m_pAnchoredFlys.reset(new std::vector<SwFrameFormat*>); } - m_pAnchoredFlys->push_back(pFlyFmt); + m_pAnchoredFlys->push_back(pFlyFormat); } -void SwNode::RemoveAnchoredFly(SwFrmFmt *const pFlyFmt) +void SwNode::RemoveAnchoredFly(SwFrameFormat *const pFlyFormat) { - assert(pFlyFmt); + assert(pFlyFormat); // cannot assert this in Remove because it is called when new anchor is already set -// assert(&pFlyFmt->GetAnchor(false).GetCntntAnchor()->nNode.GetNode() == this); - assert(IsTxtNode() || IsStartNode() || IsTableNode()); +// assert(&pFlyFormat->GetAnchor(false).GetContentAnchor()->nNode.GetNode() == this); + assert(IsTextNode() || IsStartNode() || IsTableNode()); assert(m_pAnchoredFlys); - auto it(std::find(m_pAnchoredFlys->begin(), m_pAnchoredFlys->end(), pFlyFmt)); + auto it(std::find(m_pAnchoredFlys->begin(), m_pAnchoredFlys->end(), pFlyFormat)); assert(it != m_pAnchoredFlys->end()); m_pAnchoredFlys->erase(it); if (m_pAnchoredFlys->empty()) diff --git a/sw/source/core/docnode/node2lay.cxx b/sw/source/core/docnode/node2lay.cxx index e9351873100b..4ed1518c2d56 100644 --- a/sw/source/core/docnode/node2lay.cxx +++ b/sw/source/core/docnode/node2lay.cxx @@ -68,10 +68,10 @@ SwNode* GoNextWithFrm(const SwNodes& rNodes, SwNodeIndex *pIdx) { pNd = &aTmp.GetNode(); bool bFound = false; - if ( pNd->IsCntntNode() ) - bFound = SwIterator<SwFrm,SwCntntNode>(*static_cast<SwCntntNode*>(pNd)).First(); + if ( pNd->IsContentNode() ) + bFound = SwIterator<SwFrm,SwContentNode>(*static_cast<SwContentNode*>(pNd)).First(); else if ( pNd->IsTableNode() ) - bFound = SwIterator<SwFrm,SwFmt>(*static_cast<SwTableNode*>(pNd)->GetTable().GetFrmFmt()).First() ; + bFound = SwIterator<SwFrm,SwFormat>(*static_cast<SwTableNode*>(pNd)->GetTable().GetFrameFormat()).First() ; else if( pNd->IsEndNode() && !pNd->StartOfSectionNode()->IsSectionNode() ) { pNd = 0; @@ -100,10 +100,10 @@ SwNode* GoPreviousWithFrm(SwNodeIndex *pIdx) { pNd = &aTmp.GetNode(); bool bFound = false; - if ( pNd->IsCntntNode() ) - bFound = SwIterator<SwFrm,SwCntntNode>(*static_cast<SwCntntNode*>(pNd)).First(); + if ( pNd->IsContentNode() ) + bFound = SwIterator<SwFrm,SwContentNode>(*static_cast<SwContentNode*>(pNd)).First(); else if ( pNd->IsTableNode() ) - bFound = SwIterator<SwFrm,SwFmt>(*static_cast<SwTableNode*>(pNd)->GetTable().GetFrmFmt()).First(); + bFound = SwIterator<SwFrm,SwFormat>(*static_cast<SwTableNode*>(pNd)->GetTable().GetFrameFormat()).First(); else if( pNd->IsStartNode() && !pNd->IsSectionNode() ) { pNd = 0; @@ -136,7 +136,7 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, bool bSearc const SwNode* pNd; if( bSearch || rNode.IsSectionNode() ) { - // Find the next Cntnt/TableNode that contains a Frame, so that we can add + // Find the next Content/TableNode that contains a Frame, so that we can add // ourselves before/after it if( !bSearch && rNode.GetIndex() < nIndex ) { @@ -162,12 +162,12 @@ SwNode2LayImpl::SwNode2LayImpl( const SwNode& rNode, sal_uLong nIdx, bool bSearc } if( pNd ) { - if( pNd->IsCntntNode() ) - pMod = (SwModify*)pNd->GetCntntNode(); + if( pNd->IsContentNode() ) + pMod = (SwModify*)pNd->GetContentNode(); else { OSL_ENSURE( pNd->IsTableNode(), "For Tablenodes only" ); - pMod = pNd->GetTableNode()->GetTable().GetFrmFmt(); + pMod = pNd->GetTableNode()->GetTable().GetFrameFormat(); } pIter = new SwIterator<SwFrm,SwModify>( *pMod ); } @@ -207,7 +207,7 @@ SwFrm* SwNode2LayImpl::NextFrm() while( pRet ) { SwFlowFrm* pFlow = SwFlowFrm::CastFlowFrm( pRet ); - OSL_ENSURE( pFlow, "Cntnt or Table expected?!" ); + OSL_ENSURE( pFlow, "Content or Table expected?!" ); // Follows are pretty volatile, thus we ignore them. // Even if we insert after the Frame, we start from the Master // and iterate through it until the last Follow @@ -227,14 +227,14 @@ SwFrm* SwNode2LayImpl::NextFrm() // should be outside of it when looking at the Nodes. // Thus, when dealing with Footnotes, we need to check whether the // SectionFrm is also located within the Footnote and not outside of it. - if( !pRet->IsInFtn() || pSct->IsInFtn() ) + if( !pRet->IsInFootnote() || pSct->IsInFootnote() ) { OSL_ENSURE( pSct && pSct->GetSection(), "Where's my section?" ); - SwSectionNode* pNd = pSct->GetSection()->GetFmt()->GetSectionNode(); + SwSectionNode* pNd = pSct->GetSection()->GetFormat()->GetSectionNode(); OSL_ENSURE( pNd, "Lost SectionNode" ); // If the result Frame is located within a Section Frame // whose Section does not contain the Node, we return with - // the SectionFrm, else we return with the Cntnt/TabFrm + // the SectionFrm, else we return with the Content/TabFrm if( bMaster ) { if( pNd->GetIndex() >= nIndex ) @@ -261,8 +261,8 @@ void SwNode2LayImpl::SaveUpperFrms() pFrm = pFrm->GetUpper(); if( pFrm ) { - if( pFrm->IsFtnFrm() ) - static_cast<SwFtnFrm*>(pFrm)->ColLock(); + if( pFrm->IsFootnoteFrm() ) + static_cast<SwFootnoteFrm*>(pFrm)->ColLock(); else if( pFrm->IsInSct() ) pFrm->FindSctFrm()->ColLock(); if( pPrv && pPrv->IsSctFrm() ) @@ -347,7 +347,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong SwFrm* pNew = 0; SwFrm* pNxt; SwLayoutFrm* pUp; - if( (pNd = rNds[nStt])->IsCntntNode() ) + if( (pNd = rNds[nStt])->IsContentNode() ) for( std::vector<SwFrm*>::size_type n = 0; n < pUpperFrms->size(); ) { pNxt = (*pUpperFrms)[n++]; @@ -358,7 +358,7 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong pNxt = pNxt->GetNext(); else pNxt = pUp->Lower(); - pNew = static_cast<SwCntntNode*>(pNd)->MakeFrm( pUp ); + pNew = static_cast<SwContentNode*>(pNd)->MakeFrm( pUp ); pNew->Paste( pUp, pNxt ); (*pUpperFrms)[n-2] = pNew; } @@ -399,8 +399,8 @@ void SwNode2LayImpl::RestoreUpperFrms( SwNodes& rNds, sal_uLong nStt, sal_uLong for( std::vector<SwFrm*>::size_type x = 0; x < pUpperFrms->size(); ++x ) { SwFrm* pTmp = (*pUpperFrms)[++x]; - if( pTmp->IsFtnFrm() ) - static_cast<SwFtnFrm*>(pTmp)->ColUnlock(); + if( pTmp->IsFootnoteFrm() ) + static_cast<SwFootnoteFrm*>(pTmp)->ColUnlock(); else if ( pTmp->IsInSct() ) { SwSectionFrm* pSctFrm = pTmp->FindSctFrm(); diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 807100a5648c..30e33ae5cd83 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -145,16 +145,16 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, SwNode& rNd = aDelIdx.GetNode(); // #i57920# - correction of refactoring done by cws swnumtree: - // - <SwTxtNode::SetLevel( NO_NUMBERING ) is deprecated and + // - <SwTextNode::SetLevel( NO_NUMBERING ) is deprecated and // set <IsCounted> state of the text node to <false>, which // isn't correct here. - if ( rNd.IsTxtNode() ) + if ( rNd.IsTextNode() ) { - SwTxtNode* pTxtNode = rNd.GetTxtNode(); + SwTextNode* pTextNode = rNd.GetTextNode(); - pTxtNode->RemoveFromList(); + pTextNode->RemoveFromList(); - if (pTxtNode->IsOutline()) + if (pTextNode->IsOutline()) { const SwNodePtr pSrch = (SwNodePtr)&rNd; pOutlineNds->erase( pSrch ); @@ -163,26 +163,26 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, BigPtrArray::Move( aDelIdx.GetIndex(), rInsPos.GetIndex() ); - if( rNd.IsTxtNode() ) + if( rNd.IsTextNode() ) { - SwTxtNode& rTxtNd = static_cast<SwTxtNode&>(rNd); + SwTextNode& rTextNd = static_cast<SwTextNode&>(rNd); - rTxtNd.AddToList(); + rTextNd.AddToList(); - if (bInsOutlineIdx && rTxtNd.IsOutline()) + if (bInsOutlineIdx && rTextNd.IsOutline()) { const SwNodePtr pSrch = (SwNodePtr)&rNd; pOutlineNds->insert( pSrch ); } - rTxtNd.InvalidateNumRule(); + rTextNd.InvalidateNumRule(); //FEATURE::CONDCOLL - if( RES_CONDTXTFMTCOLL == rTxtNd.GetTxtColl()->Which() ) - rTxtNd.ChkCondColl(); + if( RES_CONDTXTFMTCOLL == rTextNd.GetTextColl()->Which() ) + rTextNd.ChkCondColl(); //FEATURE::CONDCOLL } - else if( rNd.IsCntntNode() ) - static_cast<SwCntntNode&>(rNd).InvalidateNumRule(); + else if( rNd.IsContentNode() ) + static_cast<SwContentNode&>(rNd).InvalidateNumRule(); } } else @@ -203,17 +203,17 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, SwNode* pNd = &rDelPos.GetNode(); // NoTextNode keep their persistent data - if( pNd->IsNoTxtNode() ) + if( pNd->IsNoTextNode() ) { if( bSavePersData ) - static_cast<SwNoTxtNode*>(pNd)->SavePersistentData(); + static_cast<SwNoTextNode*>(pNd)->SavePersistentData(); } - else if( pNd->IsTxtNode() ) + else if( pNd->IsTextNode() ) { - SwTxtNode* pTxtNd = static_cast<SwTxtNode*>(pNd); + SwTextNode* pTextNd = static_cast<SwTextNode*>(pNd); // remove outline index from old nodes array - if (pTxtNd->IsOutline()) + if (pTextNd->IsOutline()) { pOutlineNds->erase( pNd ); } @@ -221,7 +221,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, // copy rules if needed if( pDestDoc ) { - const SwNumRule* pNumRule = pTxtNd->GetNumRule(); + const SwNumRule* pNumRule = pTextNd->GetNumRule(); if( pNumRule && sNumRule != pNumRule->GetName() ) { sNumRule = pNumRule->GetName(); @@ -234,28 +234,28 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, } else // if movement into the UndoNodes-array, update numbering - pTxtNd->InvalidateNumRule(); + pTextNd->InvalidateNumRule(); - pTxtNd->RemoveFromList(); + pTextNd->RemoveFromList(); } RemoveNode( rDelPos.GetIndex(), 1, false ); // move indices - SwCntntNode * pCNd = pNd->GetCntntNode(); + SwContentNode * pCNd = pNd->GetContentNode(); rNds.InsertNode( pNd, aInsPos ); if( pCNd ) { - SwTxtNode* pTxtNd = pCNd->GetTxtNode(); - if( pTxtNd ) + SwTextNode* pTextNd = pCNd->GetTextNode(); + if( pTextNd ) { - SwpHints * const pHts = pTxtNd->GetpSwpHints(); + SwpHints * const pHts = pTextNd->GetpSwpHints(); // OultineNodes set the new nodes in the array - if (bInsOutlineIdx && pTxtNd->IsOutline()) + if (bInsOutlineIdx && pTextNd->IsOutline()) { - rNds.pOutlineNds->insert( pTxtNd ); + rNds.pOutlineNds->insert( pTextNd ); } - pTxtNd->AddToList(); + pTextNd->AddToList(); // special treatment for fields if( pHts && pHts->Count() ) @@ -264,25 +264,25 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, GetDoc()->GetIDocumentUndoRedo().IsUndoNodes(rNds); for( size_t i = pHts->Count(); i; ) { - SwTxtAttr * const pAttr = pHts->GetTextHint( --i ); + SwTextAttr * const pAttr = pHts->GetTextHint( --i ); switch ( pAttr->Which() ) { case RES_TXTATR_FIELD: case RES_TXTATR_ANNOTATION: case RES_TXTATR_INPUTFIELD: { - SwTxtFld* pTxtFld = static_txtattr_cast<SwTxtFld*>(pAttr); - rNds.GetDoc()->getIDocumentFieldsAccess().InsDelFldInFldLst( !bToUndo, *pTxtFld ); + SwTextField* pTextField = static_txtattr_cast<SwTextField*>(pAttr); + rNds.GetDoc()->getIDocumentFieldsAccess().InsDelFieldInFieldLst( !bToUndo, *pTextField ); - const SwFieldType* pTyp = pTxtFld->GetFmtFld().GetField()->GetTyp(); + const SwFieldType* pTyp = pTextField->GetFormatField().GetField()->GetTyp(); if ( RES_POSTITFLD == pTyp->Which() ) { rNds.GetDoc()->GetDocShell()->Broadcast( - SwFmtFldHint( - &pTxtFld->GetFmtFld(), - ( pTxtFld->GetFmtFld().IsFldInDoc() - ? SwFmtFldHintWhich::INSERTED - : SwFmtFldHintWhich::REMOVED ) ) ); + SwFormatFieldHint( + &pTextField->GetFormatField(), + ( pTextField->GetFormatField().IsFieldInDoc() + ? SwFormatFieldHintWhich::INSERTED + : SwFormatFieldHintWhich::REMOVED ) ) ); } else if( RES_DDEFLD == pTyp->Which() ) { @@ -291,13 +291,13 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, else const_cast<SwDDEFieldType*>(static_cast<const SwDDEFieldType*>(pTyp))->IncRefCnt(); } - static_cast<SwFmtFld&>(pAttr->GetAttr()) + static_cast<SwFormatField&>(pAttr->GetAttr()) .InvalidateField(); } break; case RES_TXTATR_FTN: - static_cast<SwFmtFtn&>(pAttr->GetAttr()) + static_cast<SwFormatFootnote&>(pAttr->GetAttr()) .InvalidateFootnote(); break; @@ -307,18 +307,18 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, break; case RES_TXTATR_REFMARK: - static_cast<SwFmtRefMark&>(pAttr->GetAttr()) + static_cast<SwFormatRefMark&>(pAttr->GetAttr()) .InvalidateRefMark(); break; case RES_TXTATR_META: case RES_TXTATR_METAFIELD: { - SwTxtMeta *const pTxtMeta( - static_txtattr_cast<SwTxtMeta*>(pAttr)); + SwTextMeta *const pTextMeta( + static_txtattr_cast<SwTextMeta*>(pAttr)); // force removal of UNO object - pTxtMeta->ChgTxtNode(0); - pTxtMeta->ChgTxtNode(pTxtNd); + pTextMeta->ChgTextNode(0); + pTextMeta->ChgTextNode(pTextNd); } break; @@ -328,15 +328,15 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, } } //FEATURE::CONDCOLL - if( RES_CONDTXTFMTCOLL == pTxtNd->GetTxtColl()->Which() ) - pTxtNd->ChkCondColl(); + if( RES_CONDTXTFMTCOLL == pTextNd->GetTextColl()->Which() ) + pTextNd->ChkCondColl(); //FEATURE::CONDCOLL } else { // Moved into different Docs? Persist data again! - if( pCNd->IsNoTxtNode() && bRestPersData ) - static_cast<SwNoTxtNode*>(pCNd)->RestorePersistentData(); + if( pCNd->IsNoTextNode() && bRestPersData ) + static_cast<SwNoTextNode*>(pCNd)->RestorePersistentData(); } } } @@ -365,14 +365,14 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, OSL_ENSURE( false, "here, something wrong happened" ); aFrmNdIdx = rNds.GetEndOfContent(); pFrmNd = SwNodes::GoPrevSection( &aFrmNdIdx, true, false ); - if( pFrmNd && !static_cast<SwCntntNode*>(pFrmNd)->HasWriterListeners() ) + if( pFrmNd && !static_cast<SwContentNode*>(pFrmNd)->HasWriterListeners() ) pFrmNd = 0; OSL_ENSURE( pFrmNd, "ChgNode() - no FrameNode found" ); } if( pFrmNd ) while( aIdx != rInsPos ) { - SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode(); + SwContentNode* pCNd = aIdx.GetNode().GetContentNode(); if( pCNd ) { if( pFrmNd->IsTableNode() ) @@ -380,7 +380,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, else if( pFrmNd->IsSectionNode() ) static_cast<SwSectionNode*>(pFrmNd)->MakeFrms( aIdx ); else - static_cast<SwCntntNode*>(pFrmNd)->MakeFrms( *pCNd ); + static_cast<SwContentNode*>(pFrmNd)->MakeFrms( *pCNd ); pFrmNd = pCNd; } ++aIdx; @@ -480,7 +480,7 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, SwStartNode* pSttNd = pAktNode->pStartOfSection; if( pSttNd->IsTableNode() ) { - SwTableNode* pTblNd = static_cast<SwTableNode*>(pSttNd); + SwTableNode* pTableNd = static_cast<SwTableNode*>(pSttNd); // move the whole table/range nInsPos = (aRg.aEnd.GetIndex() - @@ -495,25 +495,25 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, if( bNewFrms ) // delete all frames - pTblNd->DelFrms(); + pTableNd->DelFrms(); if( &rNodes == this ) // move into self? { // move all Start/End/ContentNodes // ContentNodes: delete also the frames! - pTblNd->pStartOfSection = aIdx.GetNode().pStartOfSection; + pTableNd->pStartOfSection = aIdx.GetNode().pStartOfSection; for( sal_uLong n = 0; n < nInsPos; ++n ) { SwNodeIndex aMvIdx( aRg.aEnd, 1 ); - SwCntntNode* pCNd = 0; + SwContentNode* pCNd = 0; SwNode* pTmpNd = &aMvIdx.GetNode(); - if( pTmpNd->IsCntntNode() ) + if( pTmpNd->IsContentNode() ) { - pCNd = static_cast<SwCntntNode*>(pTmpNd); - if( pTmpNd->IsTxtNode() ) - static_cast<SwTxtNode*>(pTmpNd)->RemoveFromList(); + pCNd = static_cast<SwContentNode*>(pTmpNd); + if( pTmpNd->IsTextNode() ) + static_cast<SwTextNode*>(pTmpNd)->RemoveFromList(); // remove outline index from old nodes array - if (pCNd->IsTxtNode() && pCNd->GetTxtNode()->IsOutline()) + if (pCNd->IsTextNode() && pCNd->GetTextNode()->IsOutline()) { pOutlineNds->erase( pCNd ); } @@ -525,8 +525,8 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, if( bInsOutlineIdx && pCNd ) pOutlineNds->insert( pCNd ); - if( pTmpNd->IsTxtNode() ) - static_cast<SwTxtNode*>(pTmpNd)->AddToList(); + if( pTmpNd->IsTextNode() ) + static_cast<SwTextNode*>(pTmpNd)->AddToList(); } } else @@ -545,7 +545,7 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, { SwNode* pNd = &aMvIdx.GetNode(); - const bool bOutlNd = pNd->IsTxtNode() && pNd->GetTxtNode()->IsOutline(); + const bool bOutlNd = pNd->IsTextNode() && pNd->GetTextNode()->IsOutline(); // delete outline indices from old node array if( bOutlNd ) pOutlineNds->erase( pNd ); @@ -569,10 +569,10 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, } } - if( pTblNd->GetTable().IsA( TYPE( SwDDETable ) )) + if( pTableNd->GetTable().IsA( TYPE( SwDDETable ) )) { - SwDDEFieldType* pTyp = static_cast<SwDDETable&>(pTblNd-> - GetTable()).GetDDEFldType(); + SwDDEFieldType* pTyp = static_cast<SwDDETable&>(pTableNd-> + GetTable()).GetDDEFieldType(); if( pTyp ) { if( rNodes.IsDocNodes() ) @@ -585,16 +585,16 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, if (GetDoc()->GetIDocumentUndoRedo().IsUndoNodes( rNodes)) { - SwFrmFmt* pTblFmt = pTblNd->GetTable().GetFrmFmt(); + SwFrameFormat* pTableFormat = pTableNd->GetTable().GetFrameFormat(); SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, - pTblFmt ); - pTblFmt->ModifyNotification( &aMsgHint, &aMsgHint ); + pTableFormat ); + pTableFormat->ModifyNotification( &aMsgHint, &aMsgHint ); } } if( bNewFrms ) { SwNodeIndex aTmp( aIdx ); - pTblNd->MakeFrms( &aTmp ); + pTableNd->MakeFrms( &aTmp ); } aIdx -= nInsPos; nInsPos = 0; @@ -795,8 +795,8 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, case ND_TEXTNODE: //Add special function to text node. { - if( bNewFrms && pAktNode->GetCntntNode() ) - static_cast<SwCntntNode*>(pAktNode)->DelFrms(); + if( bNewFrms && pAktNode->GetContentNode() ) + static_cast<SwContentNode*>(pAktNode)->DelFrms(); pAktNode->pStartOfSection = aSttNdStack[ nLevel ]; nInsPos++; --aRg.aEnd; @@ -805,8 +805,8 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, case ND_GRFNODE: case ND_OLENODE: { - if( bNewFrms && pAktNode->GetCntntNode() ) - static_cast<SwCntntNode*>(pAktNode)->DelFrms(); + if( bNewFrms && pAktNode->GetContentNode() ) + static_cast<SwContentNode*>(pAktNode)->DelFrms(); pAktNode->pStartOfSection = aSttNdStack[ nLevel ]; nInsPos++; @@ -873,13 +873,13 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes, if( this == &rNodes && aRg.aEnd.GetIndex() >= aOrigInsPos.aStart.GetIndex() ) { - UpdtOutlineIdx( aOrigInsPos.aStart.GetNode() ); - UpdtOutlineIdx( aRg.aEnd.GetNode() ); + UpdateOutlineIdx( aOrigInsPos.aStart.GetNode() ); + UpdateOutlineIdx( aRg.aEnd.GetNode() ); } else { - UpdtOutlineIdx( aRg.aEnd.GetNode() ); - rNodes.UpdtOutlineIdx( aOrigInsPos.aStart.GetNode() ); + UpdateOutlineIdx( aRg.aEnd.GetNode() ); + rNodes.UpdateOutlineIdx( aOrigInsPos.aStart.GetNode() ); } return true; @@ -1114,26 +1114,26 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, sal_uLong nNodes) // delete the whole section? if( pAktNode->StartOfSectionIndex() > aRg.aStart.GetIndex() ) { - SwTableNode* pTblNd = pAktNode->pStartOfSection->GetTableNode(); - if( pTblNd ) - pTblNd->DelFrms(); + SwTableNode* pTableNd = pAktNode->pStartOfSection->GetTableNode(); + if( pTableNd ) + pTableNd->DelFrms(); SwNode *pNd, *pChkNd = pAktNode->pStartOfSection; sal_uInt16 nIdxPos; do { pNd = &aRg.aEnd.GetNode(); - if( pNd->IsTxtNode() ) + if( pNd->IsTextNode() ) { - SwTxtNode *const pTxtNode(pNd->GetTxtNode()); - if (pTxtNode->IsOutline() && + SwTextNode *const pTextNode(pNd->GetTextNode()); + if (pTextNode->IsOutline() && pOutlineNds->Seek_Entry( pNd, &nIdxPos )) { // remove outline indices pOutlineNds->erase(nIdxPos); bUpdateOutline = true; } - pTxtNode->InvalidateNumRule(); + pTextNode->InvalidateNumRule(); } else if( pNd->IsEndNode() && pNd->pStartOfSection->IsTableNode() ) @@ -1187,19 +1187,19 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, sal_uLong nNodes) } else // "normal" node, so insert into TmpArray { - SwTxtNode* pTxtNd = pAktNode->GetTxtNode(); - if( pTxtNd ) + SwTextNode* pTextNd = pAktNode->GetTextNode(); + if( pTextNd ) { - if( pTxtNd->IsOutline()) + if( pTextNd->IsOutline()) { // delete outline indices - pOutlineNds->erase( pTxtNd ); + pOutlineNds->erase( pTextNd ); bUpdateOutline = true; } - pTxtNd->InvalidateNumRule(); + pTextNd->InvalidateNumRule(); } - else if( pAktNode->IsCntntNode() ) - static_cast<SwCntntNode*>(pAktNode)->InvalidateNumRule(); + else if( pAktNode->IsContentNode() ) + static_cast<SwContentNode*>(pAktNode)->InvalidateNumRule(); --aRg.aEnd; nCnt++; @@ -1227,7 +1227,7 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, sal_uLong nNodes) // update numbering if( bUpdateOutline || bInDelUpdOutl ) { - UpdtOutlineIdx( aRg.aEnd.GetNode() ); + UpdateOutlineIdx( aRg.aEnd.GetNode() ); bInDelUpdOutl = false; } @@ -1263,7 +1263,7 @@ void SwNodes::GoStartOfSection(SwNodeIndex *pIdx) // If index points to no ContentNode, than go to one. // If there is no further available, do not change the index' position! - while( !aTmp.GetNode().IsCntntNode() ) + while( !aTmp.GetNode().IsContentNode() ) { // go from this StartNode (can only be one) to its end if( *pIdx <= aTmp ) return; // ERROR: already after the section @@ -1280,38 +1280,38 @@ void SwNodes::GoEndOfSection(SwNodeIndex *pIdx) (*pIdx) = *pIdx->GetNode().EndOfSectionNode(); } -SwCntntNode* SwNodes::GoNext(SwNodeIndex *pIdx) const +SwContentNode* SwNodes::GoNext(SwNodeIndex *pIdx) const { if( pIdx->GetIndex() >= Count() - 1 ) return 0; SwNodeIndex aTmp(*pIdx, +1); SwNode* pNd = 0; - while( aTmp < Count()-1 && !( pNd = &aTmp.GetNode())->IsCntntNode() ) + while( aTmp < Count()-1 && !( pNd = &aTmp.GetNode())->IsContentNode() ) ++aTmp; if( aTmp == Count()-1 ) pNd = 0; else (*pIdx) = aTmp; - return static_cast<SwCntntNode*>(pNd); + return static_cast<SwContentNode*>(pNd); } -SwCntntNode* SwNodes::GoPrevious(SwNodeIndex *pIdx) +SwContentNode* SwNodes::GoPrevious(SwNodeIndex *pIdx) { if( !pIdx->GetIndex() ) return 0; SwNodeIndex aTmp( *pIdx, -1 ); SwNode* pNd = 0; - while( aTmp.GetIndex() && !( pNd = &aTmp.GetNode())->IsCntntNode() ) + while( aTmp.GetIndex() && !( pNd = &aTmp.GetNode())->IsContentNode() ) --aTmp; if( !aTmp.GetIndex() ) pNd = 0; else (*pIdx) = aTmp; - return static_cast<SwCntntNode*>(pNd); + return static_cast<SwContentNode*>(pNd); } inline bool TstIdx( sal_uLong nSttIdx, sal_uLong nEndIdx, sal_uLong nStt, sal_uLong nEnd ) @@ -1383,7 +1383,7 @@ void SwNodes::DelNodes( const SwNodeIndex & rStart, sal_uLong nCnt ) { SwNode* pNd = (*this)[ n ]; - if (pNd->IsTxtNode() && pNd->GetTxtNode()->IsOutline()) + if (pNd->IsTextNode() && pNd->GetTextNode()->IsOutline()) { // remove the outline indices sal_uInt16 nIdxPos; @@ -1393,17 +1393,17 @@ void SwNodes::DelNodes( const SwNodeIndex & rStart, sal_uLong nCnt ) bUpdateNum = 1; } } - if( pNd->IsCntntNode() ) + if( pNd->IsContentNode() ) { - static_cast<SwCntntNode*>(pNd)->InvalidateNumRule(); - static_cast<SwCntntNode*>(pNd)->DelFrms(); + static_cast<SwContentNode*>(pNd)->InvalidateNumRule(); + static_cast<SwContentNode*>(pNd)->DelFrms(); } } RemoveNode( nSttIdx, nCnt, true ); // update numbering if( bUpdateNum ) - UpdtOutlineIdx( rStart.GetNode() ); + UpdateOutlineIdx( rStart.GetNode() ); } } @@ -1460,10 +1460,10 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) SwNodeIndex aEndIdx( pEnd->nNode ); SwNodeIndex aSttIdx( pStt->nNode ); - SwTxtNode *const pSrcNd = aSttIdx.GetNode().GetTxtNode(); - SwTxtNode * pDestNd = rPos.nNode.GetNode().GetTxtNode(); + SwTextNode *const pSrcNd = aSttIdx.GetNode().GetTextNode(); + SwTextNode * pDestNd = rPos.nNode.GetNode().GetTextNode(); bool bSplitDestNd = true; - bool bCopyCollFmt = pDestNd && pDestNd->GetTxt().isEmpty(); + bool bCopyCollFormat = pDestNd && pDestNd->GetText().isEmpty(); if( pSrcNd ) { @@ -1471,13 +1471,13 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) // be also a TextNode in the NodesArray to store the content if( !pDestNd ) { - pDestNd = rNodes.MakeTxtNode( rPos.nNode, pSrcNd->GetTxtColl() ); + pDestNd = rNodes.MakeTextNode( rPos.nNode, pSrcNd->GetTextColl() ); --rPos.nNode; rPos.nContent.Assign( pDestNd, 0 ); - bCopyCollFmt = true; + bCopyCollFormat = true; } bSplitDestNd = pDestNd->Len() > rPos.nContent.GetIndex() || - pEnd->nNode.GetNode().IsTxtNode(); + pEnd->nNode.GetNode().IsTextNode(); // move the content into the new node bool bOneNd = pStt->nNode == pEnd->nNode; @@ -1485,14 +1485,14 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) ( (bOneNd) ? pEnd->nContent.GetIndex() : pSrcNd->Len() ) - pStt->nContent.GetIndex(); - if( !pEnd->nNode.GetNode().IsCntntNode() ) + if( !pEnd->nNode.GetNode().IsContentNode() ) { bOneNd = true; sal_uLong nSttNdIdx = pStt->nNode.GetIndex() + 1; const sal_uLong nEndNdIdx = pEnd->nNode.GetIndex(); for( ; nSttNdIdx < nEndNdIdx; ++nSttNdIdx ) { - if( (*this)[ nSttNdIdx ]->IsCntntNode() ) + if( (*this)[ nSttNdIdx ]->IsContentNode() ) { bOneNd = false; break; @@ -1505,7 +1505,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) { if( !rPos.nContent.GetIndex() ) { - bCopyCollFmt = true; + bCopyCollFormat = true; } if( rNodes.IsDocNodes() ) { @@ -1515,7 +1515,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) } else { - pDestNd->SplitCntntNode( rPos ); + pDestNd->SplitContentNode( rPos ); } if( rPos.nNode == aEndIdx ) @@ -1524,7 +1524,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) } bSplitDestNd = true; - pDestNd = rNodes[ rPos.nNode.GetIndex() - 1 ]->GetTxtNode(); + pDestNd = rNodes[ rPos.nNode.GetIndex() - 1 ]->GetTextNode(); if( nLen ) { pSrcNd->CutText( pDestNd, SwIndex( pDestNd, pDestNd->Len()), @@ -1536,12 +1536,12 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) pSrcNd->CutText( pDestNd, rPos.nContent, pStt->nContent, nLen ); } - if( bCopyCollFmt ) + if( bCopyCollFormat ) { SwDoc* const pInsDoc = pDestNd->GetDoc(); ::sw::UndoGuard const undoGuard(pInsDoc->GetIDocumentUndoRedo()); - pSrcNd->CopyCollFmt( *pDestNd ); - bCopyCollFmt = false; + pSrcNd->CopyCollFormat( *pDestNd ); + bCopyCollFormat = false; } if( bOneNd ) @@ -1551,8 +1551,8 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) // Also, a selection is invalidated. pEnd->nContent = pStt->nContent; rPam.DeleteMark(); - GetDoc()->GetDocShell()->Broadcast( SwFmtFldHint( 0, - rNodes.IsDocNodes() ? SwFmtFldHintWhich::INSERTED : SwFmtFldHintWhich::REMOVED ) ); + GetDoc()->GetDocShell()->Broadcast( SwFormatFieldHint( 0, + rNodes.IsDocNodes() ? SwFormatFieldHintWhich::INSERTED : SwFormatFieldHintWhich::REMOVED ) ); return; } @@ -1580,7 +1580,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) } else { - pDestNd->SplitCntntNode( rPos ); + pDestNd->SplitContentNode( rPos ); } if ( bCorrEnd ) @@ -1593,7 +1593,7 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) bSplitDestNd = true; } - SwTxtNode* const pEndSrcNd = aEndIdx.GetNode().GetTxtNode(); + SwTextNode* const pEndSrcNd = aEndIdx.GetNode().GetTextNode(); if ( pEndSrcNd ) { { @@ -1606,13 +1606,13 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) } pDestNd = - rNodes.MakeTxtNode( rPos.nNode, pEndSrcNd->GetTxtColl() ); + rNodes.MakeTextNode( rPos.nNode, pEndSrcNd->GetTextColl() ); --rPos.nNode; rPos.nContent.Assign( pDestNd, 0 ); } else { - pDestNd = rPos.nNode.GetNode().GetTxtNode(); + pDestNd = rPos.nNode.GetNode().GetTextNode(); } if (pDestNd && pEnd->nContent.GetIndex()) @@ -1623,24 +1623,24 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) pEnd->nContent.GetIndex()); } - if (pDestNd && bCopyCollFmt) + if (pDestNd && bCopyCollFormat) { SwDoc* const pInsDoc = pDestNd->GetDoc(); ::sw::UndoGuard const ug(pInsDoc->GetIDocumentUndoRedo()); - pEndSrcNd->CopyCollFmt( *pDestNd ); + pEndSrcNd->CopyCollFormat( *pDestNd ); } } } else { - if ( pSrcNd && aEndIdx.GetNode().IsCntntNode() ) + if ( pSrcNd && aEndIdx.GetNode().IsContentNode() ) { ++aEndIdx; } if( !bSplitDestNd ) { ++rPos.nNode; - rPos.nContent.Assign( rPos.nNode.GetNode().GetCntntNode(), 0 ); + rPos.nContent.Assign( rPos.nNode.GetNode().GetContentNode(), 0 ); } } @@ -1666,20 +1666,20 @@ void SwNodes::MoveRange( SwPaM & rPam, SwPosition & rPos, SwNodes& rNodes ) OSL_ENSURE( bSuccess, "Move() - no ContentNode here" ); (void) bSuccess; } - pStt->nContent.Assign( pStt->nNode.GetNode().GetCntntNode(), + pStt->nContent.Assign( pStt->nNode.GetNode().GetContentNode(), pStt->nContent.GetIndex() ); // Correct the PaM, because it might have happened that the move // went over the node borders (so the data might be in different nodes). // Also, a selection is invalidated. *pEnd = *pStt; rPam.DeleteMark(); - GetDoc()->GetDocShell()->Broadcast( SwFmtFldHint( 0, - rNodes.IsDocNodes() ? SwFmtFldHintWhich::INSERTED : SwFmtFldHintWhich::REMOVED ) ); + GetDoc()->GetDocShell()->Broadcast( SwFormatFieldHint( 0, + rNodes.IsDocNodes() ? SwFormatFieldHintWhich::INSERTED : SwFormatFieldHintWhich::REMOVED ) ); } ///@see SwNodes::_MoveNodes (TODO: seems to be C&P programming here) void SwNodes::_CopyNodes( const SwNodeRange& rRange, - const SwNodeIndex& rIndex, bool bNewFrms, bool bTblInsDummyNode ) const + const SwNodeIndex& rIndex, bool bNewFrms, bool bTableInsDummyNode ) const { SwDoc* pDoc = rIndex.GetNode().GetDoc(); @@ -1753,7 +1753,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, nNodeCnt = 1; // insert a DummyNode for a TableNode - if( bTblInsDummyNode ) + if( bTableInsDummyNode ) new SwPlaceholderNode(aInsPos); // copy all of the table's nodes into the current cell @@ -1762,7 +1762,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, ++aRg.aStart ) { // insert a DummyNode for the box-StartNode? - if( bTblInsDummyNode ) + if( bTableInsDummyNode ) new SwPlaceholderNode(aInsPos); SwStartNode* pSttNd = aRg.aStart.GetNode().GetStartNode(); @@ -1771,19 +1771,19 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, aInsPos, bNewFrms, false ); // insert a DummyNode for the box-EndNode? - if( bTblInsDummyNode ) + if( bTableInsDummyNode ) new SwPlaceholderNode(aInsPos); aRg.aStart = *pSttNd->EndOfSectionNode(); } // insert a DummyNode for the table-EndNode - if( bTblInsDummyNode ) + if( bTableInsDummyNode ) new SwPlaceholderNode(aInsPos); aRg.aStart = *pAktNode->EndOfSectionNode(); } else { SwNodeIndex nStt( aInsPos, -1 ); - SwTableNode* pTblNd = static_cast<SwTableNode*>(pAktNode)-> + SwTableNode* pTableNd = static_cast<SwTableNode*>(pAktNode)-> MakeCopy( pDoc, aInsPos ); sal_uLong nDistance = aInsPos.GetIndex() - nStt.GetIndex() - 2; if (nDistance < nNodeCnt) @@ -1793,10 +1793,10 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, aRg.aStart = pAktNode->EndOfSectionIndex(); - if( bNewFrms && pTblNd ) + if( bNewFrms && pTableNd ) { nStt = aInsPos; - pTblNd->MakeFrms( &nStt ); + pTableNd->MakeFrms( &nStt ); } } break; @@ -1855,7 +1855,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange, case ND_GRFNODE: case ND_OLENODE: { - SwCntntNode* pNew = static_cast<SwCntntNode*>(pAktNode)->MakeCopy( + SwContentNode* pNew = static_cast<SwContentNode*>(pAktNode)->MakeCopy( pDoc, aInsPos ); // frames are always created as default, so delete if needed if( !bNewFrms ) @@ -1907,12 +1907,12 @@ SwStartNode* SwNodes::MakeEmptySection( const SwNodeIndex& rIdx, SwStartNode* SwNodes::MakeTextSection( const SwNodeIndex & rWhere, SwStartNodeType eSttNdTyp, - SwTxtFmtColl *pColl, + SwTextFormatColl *pColl, SwAttrSet* pAutoAttr ) { SwStartNode* pSttNd = new SwStartNode( rWhere, ND_STARTNODE, eSttNdTyp ); new SwEndNode( rWhere, *pSttNd ); - MakeTxtNode( SwNodeIndex( rWhere, - 1 ), pColl, pAutoAttr ); + MakeTextNode( SwNodeIndex( rWhere, - 1 ), pColl, pAutoAttr ); return pSttNd; } @@ -1929,7 +1929,7 @@ SwStartNode* SwNodes::MakeTextSection( const SwNodeIndex & rWhere, * @see SwNodes::GoPrevious * @see SwNodes::GoNextSection (TODO: seems to be C&P programming here) */ -SwCntntNode* SwNodes::GoNextSection( SwNodeIndex * pIdx, +SwContentNode* SwNodes::GoNextSection( SwNodeIndex * pIdx, bool bSkipHidden, bool bSkipProtect ) const { bool bFirst = true; @@ -1971,7 +1971,7 @@ SwCntntNode* SwNodes::GoNextSection( SwNodeIndex * pIdx, else { (*pIdx) = aTmp; - return const_cast<SwCntntNode*>(static_cast<const SwCntntNode*>(pNd)); + return const_cast<SwContentNode*>(static_cast<const SwContentNode*>(pNd)); } } ++aTmp; @@ -1981,7 +1981,7 @@ SwCntntNode* SwNodes::GoNextSection( SwNodeIndex * pIdx, } ///@see SwNodes::GoNextSection (TODO: seems to be C&P programming here) -SwCntntNode* SwNodes::GoPrevSection( SwNodeIndex * pIdx, +SwContentNode* SwNodes::GoPrevSection( SwNodeIndex * pIdx, bool bSkipHidden, bool bSkipProtect ) { bool bFirst = true; @@ -2029,7 +2029,7 @@ SwCntntNode* SwNodes::GoPrevSection( SwNodeIndex * pIdx, else { (*pIdx) = aTmp; - return const_cast<SwCntntNode*>(static_cast<const SwCntntNode*>(pNd)); + return const_cast<SwContentNode*>(static_cast<const SwContentNode*>(pNd)); } } --aTmp; @@ -2079,7 +2079,7 @@ SwNode* SwNodes::FindPrvNxtFrmNode( SwNodeIndex& rFrmIdx, else pNd = pSttNd; - if( ( pFrmNd = pNd )->IsCntntNode() ) + if( ( pFrmNd = pNd )->IsContentNode() ) rFrmIdx = aIdx; // search forward or backward for a content node @@ -2104,7 +2104,7 @@ SwNode* SwNodes::FindPrvNxtFrmNode( SwNodeIndex& rFrmIdx, aIdx = rFrmIdx; // NEVER leave the section when doing this! - if( ( pEnd && ( pFrmNd = &aIdx.GetNode())->IsCntntNode() ) || + if( ( pEnd && ( pFrmNd = &aIdx.GetNode())->IsContentNode() ) || ( 0 != ( pFrmNd = GoNextSection( &aIdx, true, false )) && ::CheckNodesRange( aIdx, rFrmIdx, true ) && ( pFrmNd->FindTableNode() == pTableNd && @@ -2217,38 +2217,38 @@ void SwNodes::RemoveNode( sal_uLong nDelPos, sal_uLong nSz, bool bDel ) for (sal_uLong nCnt = 0; nCnt < nSz; nCnt++) { SwNode* pNode = ((*this)[ nDelPos + nCnt ]); - SwTxtNode * pTxtNd = pNode->GetTxtNode(); + SwTextNode * pTextNd = pNode->GetTextNode(); - if (pTxtNd) + if (pTextNd) { - pTxtNd->RemoveFromList(); + pTextNd->RemoveFromList(); // remove FLY_AS_CHAR *before* adjusting SwNodeIndex // so their anchor still points to correct node when deleted! // NOTE: this will call RemoveNode() recursively! // so adjust our indexes to account for removed nodes - sal_uLong const nPos = pTxtNd->GetIndex(); - SwpHints *const pHints(pTxtNd->GetpSwpHints()); + sal_uLong const nPos = pTextNd->GetIndex(); + SwpHints *const pHints(pTextNd->GetpSwpHints()); if (pHints) { - std::vector<SwTxtAttr*> flys; + std::vector<SwTextAttr*> flys; for (size_t i = 0; i < pHints->Count(); ++i) { - SwTxtAttr *const pHint(pHints->GetTextHint(i)); + SwTextAttr *const pHint(pHints->GetTextHint(i)); if (RES_TXTATR_FLYCNT == pHint->Which()) { flys.push_back(pHint); } } - for (SwTxtAttr * pHint : flys) + for (SwTextAttr * pHint : flys) { - pTxtNd->DeleteAttribute(pHint); + pTextNd->DeleteAttribute(pHint); } // pHints may be dead now - sal_uLong const nDiff = nPos - pTxtNd->GetIndex(); + sal_uLong const nDiff = nPos - pTextNd->GetIndex(); if (nDiff) { nDelPos -= nDiff; } - assert(pTxtNd == (*this)[nDelPos + nCnt]); + assert(pTextNd == (*this)[nDelPos + nCnt]); assert(pFirst == (*this)[nDelPos]); } } diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index e993c42204a3..ffc6bc876b54 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -70,11 +70,11 @@ using namespace ::com::sun::star; class SwIntrnlSectRefLink : public SwBaseLink { - SwSectionFmt& rSectFmt; + SwSectionFormat& rSectFormat; public: - SwIntrnlSectRefLink( SwSectionFmt& rFmt, SfxLinkUpdateMode nUpdateType, SotClipboardFormatId nFmt ) - : SwBaseLink( nUpdateType, nFmt ), - rSectFmt( rFmt ) + SwIntrnlSectRefLink( SwSectionFormat& rFormat, SfxLinkUpdateMode nUpdateType, SotClipboardFormatId nFormat ) + : SwBaseLink( nUpdateType, nFormat ), + rSectFormat( rFormat ) {} virtual void Closed() SAL_OVERRIDE; @@ -92,7 +92,7 @@ public: } }; -TYPEINIT1(SwSectionFmt,SwFrmFmt ); +TYPEINIT1(SwSectionFormat,SwFrameFormat ); TYPEINIT1(SwSection,SwClient ); SwSectionData::SwSectionData(SectionType const eType, OUString const& rName) @@ -198,7 +198,7 @@ OUString SwSectionData::CollapseWhiteSpaces(const OUString& sName) } SwSection::SwSection( - SectionType const eType, OUString const& rName, SwSectionFmt & rFormat) + SectionType const eType, OUString const& rName, SwSectionFormat & rFormat) : SwClient(& rFormat) , m_Data(eType, rName) { @@ -217,7 +217,7 @@ SwSection::SwSection( if (!m_Data.IsProtectFlag()) { - m_Data.SetProtectFlag( rFormat.GetProtect().IsCntntProtected() ); + m_Data.SetProtectFlag( rFormat.GetProtect().IsContentProtected() ); } if (!m_Data.IsEditInReadonlyFlag()) // edit in readonly sections @@ -228,21 +228,21 @@ SwSection::SwSection( SwSection::~SwSection() { - SwSectionFmt* pFmt = GetFmt(); - if( !pFmt ) + SwSectionFormat* pFormat = GetFormat(); + if( !pFormat ) return; - SwDoc* pDoc = pFmt->GetDoc(); + SwDoc* pDoc = pFormat->GetDoc(); if( pDoc->IsInDtor() ) { - // We reattach our Format to the default FrameFmt + // We reattach our Format to the default FrameFormat // to not get any dependencies - if( pFmt->DerivedFrom() != pDoc->GetDfltFrmFmt() ) - pFmt->RegisterToFormat( *pDoc->GetDfltFrmFmt() ); + if( pFormat->DerivedFrom() != pDoc->GetDfltFrameFormat() ) + pFormat->RegisterToFormat( *pDoc->GetDfltFrameFormat() ); } else { - pFmt->Remove( this ); // remove + pFormat->Remove( this ); // remove if (CONTENT_SECTION != m_Data.GetType()) { @@ -255,13 +255,13 @@ SwSection::~SwSection() } // If the Section is the last Client in the Format we can delete it - SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFmt ); - pFmt->ModifyNotification( &aMsgHint, &aMsgHint ); - if( !pFmt->HasWriterListeners() ) + SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFormat ); + pFormat->ModifyNotification( &aMsgHint, &aMsgHint ); + if( !pFormat->HasWriterListeners() ) { // Do not add to the Undo. This should've happened earlier. ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); - pDoc->DelSectionFmt( pFmt ); + pDoc->DelSectionFormat( pFormat ); } } if (m_RefObj.Is()) @@ -301,9 +301,9 @@ bool SwSection::DataEquals(SwSectionData const& rCmp) const void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition) { - SwSectionFmt* pFmt = GetFmt(); - OSL_ENSURE(pFmt, "ImplSetHiddenFlag: no format?"); - if( pFmt ) + SwSectionFormat* pFormat = GetFormat(); + OSL_ENSURE(pFormat, "ImplSetHiddenFlag: no format?"); + if( pFormat ) { const bool bHide = bTmpHidden && bCondition; @@ -316,24 +316,24 @@ void SwSection::ImplSetHiddenFlag(bool const bTmpHidden, bool const bCondition) // Tell all Children that they are hidden SwMsgPoolItem aMsgItem( RES_SECTION_HIDDEN ); - pFmt->ModifyNotification( &aMsgItem, &aMsgItem ); + pFormat->ModifyNotification( &aMsgItem, &aMsgItem ); // Delete all Frames - pFmt->DelFrms(); + pFormat->DelFrms(); } } else if (m_Data.IsHiddenFlag()) // show Nodes again { // Show all Frames (Child Sections are accounted for by MakeFrms) // Only if the Parent Section is not restricting us! - SwSection* pParentSect = pFmt->GetParentSection(); + SwSection* pParentSect = pFormat->GetParentSection(); if( !pParentSect || !pParentSect->IsHiddenFlag() ) { // Tell all Children that the Parent is not hidden anymore SwMsgPoolItem aMsgItem( RES_SECTION_NOT_HIDDEN ); - pFmt->ModifyNotification( &aMsgItem, &aMsgItem ); + pFormat->ModifyNotification( &aMsgItem, &aMsgItem ); - pFmt->MakeFrms(); + pFormat->MakeFrms(); } } } @@ -352,20 +352,20 @@ bool SwSection::CalcHiddenFlag() const bool SwSection::IsProtect() const { - SwSectionFmt const *const pFmt( GetFmt() ); - OSL_ENSURE(pFmt, "SwSection::IsProtect: no format?"); - return (pFmt) - ? pFmt->GetProtect().IsCntntProtected() + SwSectionFormat const *const pFormat( GetFormat() ); + OSL_ENSURE(pFormat, "SwSection::IsProtect: no format?"); + return (pFormat) + ? pFormat->GetProtect().IsContentProtected() : IsProtectFlag(); } // edit in readonly sections bool SwSection::IsEditInReadonly() const { - SwSectionFmt const *const pFmt( GetFmt() ); - OSL_ENSURE(pFmt, "SwSection::IsEditInReadonly: no format?"); - return (pFmt) - ? pFmt->GetEditInReadonly().GetValue() + SwSectionFormat const *const pFormat( GetFormat() ); + OSL_ENSURE(pFormat, "SwSection::IsEditInReadonly: no format?"); + return (pFormat) + ? pFormat->GetEditInReadonly().GetValue() : IsEditInReadonlyFlag(); } @@ -380,13 +380,13 @@ void SwSection::SetHidden(bool const bFlag) void SwSection::SetProtect(bool const bFlag) { - SwSectionFmt *const pFormat( GetFmt() ); + SwSectionFormat *const pFormat( GetFormat() ); OSL_ENSURE(pFormat, "SwSection::SetProtect: no format?"); if (pFormat) { SvxProtectItem aItem( RES_PROTECT ); - aItem.SetCntntProtect( bFlag ); - pFormat->SetFmtAttr( aItem ); + aItem.SetContentProtect( bFlag ); + pFormat->SetFormatAttr( aItem ); // note: this will call m_Data.SetProtectFlag via Modify! } else @@ -398,13 +398,13 @@ void SwSection::SetProtect(bool const bFlag) // edit in readonly sections void SwSection::SetEditInReadonly(bool const bFlag) { - SwSectionFmt *const pFormat( GetFmt() ); + SwSectionFormat *const pFormat( GetFormat() ); OSL_ENSURE(pFormat, "SwSection::SetEditInReadonly: no format?"); if (pFormat) { - SwFmtEditInReadonly aItem; + SwFormatEditInReadonly aItem; aItem.SetValue( bFlag ); - pFormat->SetFmtAttr( aItem ); + pFormat->SetFormatAttr( aItem ); // note: this will call m_Data.SetEditInReadonlyFlag via Modify! } else @@ -415,7 +415,7 @@ void SwSection::SetEditInReadonly(bool const bFlag) void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { - bool bUpdateFtn = false; + bool bUpdateFootnote = false; switch( pOld ? pOld->Which() : pNew ? pNew->Which() : 0 ) { case RES_ATTRSET_CHG: @@ -429,7 +429,7 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) RES_PROTECT, false, &pItem ) ) { m_Data.SetProtectFlag( static_cast<SvxProtectItem const*>(pItem) - ->IsCntntProtected() ); + ->IsContentProtected() ); pNewSet->ClearItem( RES_PROTECT ); pOldSet->ClearItem( RES_PROTECT ); } @@ -439,7 +439,7 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) RES_EDIT_IN_READONLY, false, &pItem ) ) { m_Data.SetEditInReadonlyFlag( - static_cast<SwFmtEditInReadonly const*>(pItem)->GetValue()); + static_cast<SwFormatEditInReadonly const*>(pItem)->GetValue()); pNewSet->ClearItem( RES_EDIT_IN_READONLY ); pOldSet->ClearItem( RES_EDIT_IN_READONLY ); } @@ -449,7 +449,7 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) SfxItemState::SET == pNewSet->GetItemState( RES_END_AT_TXTEND, false, &pItem )) { - bUpdateFtn = true; + bUpdateFootnote = true; } if( !pNewSet->Count() ) @@ -461,7 +461,7 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) if( pNew ) { bool bNewFlag = - static_cast<const SvxProtectItem*>(pNew)->IsCntntProtected(); + static_cast<const SvxProtectItem*>(pNew)->IsContentProtected(); if( !bNewFlag ) { // Switching off: See if there is protection transferred @@ -485,7 +485,7 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) if( pNew ) { const bool bNewFlag = - static_cast<const SwFmtEditInReadonly*>(pNew)->GetValue(); + static_cast<const SwFormatEditInReadonly*>(pNew)->GetValue(); m_Data.SetEditInReadonlyFlag( bNewFlag ); } return; @@ -506,14 +506,14 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) case RES_FTN_AT_TXTEND: if( pNew && pOld ) { - bUpdateFtn = true; + bUpdateFootnote = true; } break; case RES_END_AT_TXTEND: if( pNew && pOld ) { - bUpdateFtn = true; + bUpdateFootnote = true; } break; @@ -522,11 +522,11 @@ void SwSection::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) break; } - if( bUpdateFtn ) + if( bUpdateFootnote ) { - SwSectionNode* pSectNd = GetFmt()->GetSectionNode( false ); + SwSectionNode* pSectNd = GetFormat()->GetSectionNode( false ); if( pSectNd ) - pSectNd->GetDoc()->GetFtnIdxs().UpdateFtn(SwNodeIndex( *pSectNd )); + pSectNd->GetDoc()->GetFootnoteIdxs().UpdateFootnote(SwNodeIndex( *pSectNd )); } } @@ -567,7 +567,7 @@ OUString SwSection::GetLinkFileName() const sTmp += OUString(sfx2::cTokenSeparator) + sFilter + OUString(sfx2::cTokenSeparator) + sRange; } - else if( GetFmt() && !GetFmt()->GetSectionNode() ) + else if( GetFormat() && !GetFormat()->GetSectionNode() ) { // If the Section is in the UndoNodesArray, the LinkManager // does not contain the Link, thus it cannot be queried for it. @@ -630,20 +630,20 @@ const SwTOXBase* SwSection::GetTOXBase() const return pRet; } -SwSectionFmt::SwSectionFmt( SwFrmFmt* pDrvdFrm, SwDoc *pDoc ) - : SwFrmFmt( pDoc->GetAttrPool(), OUString(), pDrvdFrm ) +SwSectionFormat::SwSectionFormat( SwFrameFormat* pDrvdFrm, SwDoc *pDoc ) + : SwFrameFormat( pDoc->GetAttrPool(), OUString(), pDrvdFrm ) { LockModify(); - SetFmtAttr( *GetDfltAttr( RES_COL ) ); + SetFormatAttr( *GetDfltAttr( RES_COL ) ); UnlockModify(); } -SwSectionFmt::~SwSectionFmt() +SwSectionFormat::~SwSectionFormat() { if( !GetDoc()->IsInDtor() ) { SwSectionNode* pSectNd; - const SwNodeIndex* pIdx = GetCntnt( false ).GetCntntIdx(); + const SwNodeIndex* pIdx = GetContent( false ).GetContentIdx(); if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() && 0 != (pSectNd = pIdx->GetNode().GetSectionNode() )) { @@ -672,32 +672,32 @@ SwSectionFmt::~SwSectionFmt() GetDoc()->GetNodes().SectionUp( &aRg ); } LockModify(); - ResetFmtAttr( RES_CNTNT ); + ResetFormatAttr( RES_CNTNT ); UnlockModify(); } } -SwSection * SwSectionFmt::GetSection() const +SwSection * SwSectionFormat::GetSection() const { - return SwIterator<SwSection,SwSectionFmt>( *this ).First(); + return SwIterator<SwSection,SwSectionFormat>( *this ).First(); } // Do not destroy all Frms in aDepend (Frms are recognized with a PTR_CAST). -void SwSectionFmt::DelFrms() +void SwSectionFormat::DelFrms() { SwSectionNode* pSectNd; - const SwNodeIndex* pIdx = GetCntnt(false).GetCntntIdx(); + const SwNodeIndex* pIdx = GetContent(false).GetContentIdx(); if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() && 0 != (pSectNd = pIdx->GetNode().GetSectionNode() )) { - // First delete the <SwSectionFrm> of the <SwSectionFmt> instance + // First delete the <SwSectionFrm> of the <SwSectionFormat> instance // mba: test iteration as objects are removed in iteration // use hint which allows to specify, if the content shall be saved or not CallSwClientNotify( SwSectionFrmMoveAndDeleteHint( false ) ); - // Then delete frames of the nested <SwSectionFmt> instances - SwIterator<SwSectionFmt,SwSectionFmt> aIter( *this ); - SwSectionFmt *pLast = aIter.First(); + // Then delete frames of the nested <SwSectionFormat> instances + SwIterator<SwSectionFormat,SwSectionFormat> aIter( *this ); + SwSectionFormat *pLast = aIter.First(); while ( pLast ) { pLast->DelFrms(); @@ -706,7 +706,7 @@ void SwSectionFmt::DelFrms() sal_uLong nEnde = pSectNd->EndOfSectionIndex(); sal_uLong nStart = pSectNd->GetIndex()+1; - sw_DeleteFtn( pSectNd, nStart, nEnde ); + sw_DeleteFootnote( pSectNd, nStart, nEnde ); } if( pIdx ) { @@ -714,7 +714,7 @@ void SwSectionFmt::DelFrms() // Paste of the Framei tself would need to do this. But that leads // to subsequent errors, which we'd need to solve at run-time. SwNodeIndex aNextNd( *pIdx ); - SwCntntNode* pCNd = GetDoc()->GetNodes().GoNextSection( &aNextNd, true, false ); + SwContentNode* pCNd = GetDoc()->GetNodes().GoNextSection( &aNextNd, true, false ); if( pCNd ) { const SfxPoolItem& rItem = pCNd->GetSwAttrSet().Get( RES_PAGEDESC ); @@ -724,10 +724,10 @@ void SwSectionFmt::DelFrms() } // Create the Views -void SwSectionFmt::MakeFrms() +void SwSectionFormat::MakeFrms() { SwSectionNode* pSectNd; - const SwNodeIndex* pIdx = GetCntnt(false).GetCntntIdx(); + const SwNodeIndex* pIdx = GetContent(false).GetContentIdx(); if( pIdx && &GetDoc()->GetNodes() == &pIdx->GetNodes() && 0 != (pSectNd = pIdx->GetNode().GetSectionNode() )) @@ -737,7 +737,7 @@ void SwSectionFmt::MakeFrms() } } -void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) +void SwSectionFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { bool bClients = false; sal_uInt16 nWhich = pOld ? pOld->Which() : pNew ? pNew->Which() : 0; @@ -816,7 +816,7 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { // My Parents will be destroyed, so get the Parent's Parent // and update - SwFrmFmt::Modify( pOld, pNew ); // Rewire first! + SwFrameFormat::Modify( pOld, pNew ); // Rewire first! UpdateParent(); return; } @@ -824,17 +824,17 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) case RES_FMT_CHG: if( !GetDoc()->IsInDtor() && - static_cast<const SwFmtChg*>(pNew)->pChangedFmt == (void*)GetRegisteredIn() && - static_cast<const SwFmtChg*>(pNew)->pChangedFmt->IsA( TYPE( SwSectionFmt )) ) + static_cast<const SwFormatChg*>(pNew)->pChangedFormat == (void*)GetRegisteredIn() && + static_cast<const SwFormatChg*>(pNew)->pChangedFormat->IsA( TYPE( SwSectionFormat )) ) { // My Parent will be changed, thus I need to update - SwFrmFmt::Modify( pOld, pNew ); // Rewire first! + SwFrameFormat::Modify( pOld, pNew ); // Rewire first! UpdateParent(); return; } break; } - SwFrmFmt::Modify( pOld, pNew ); + SwFrameFormat::Modify( pOld, pNew ); if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which())) { // invalidate cached uno object @@ -843,12 +843,12 @@ void SwSectionFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) } // Get info from the Format -bool SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const +bool SwSectionFormat::GetInfo( SfxPoolItem& rInfo ) const { switch( rInfo.Which() ) { case RES_FINDNEARESTNODE: - if( static_cast<const SwFmtPageDesc&>(GetFmtAttr( RES_PAGEDESC )).GetPageDesc() ) + if( static_cast<const SwFormatPageDesc&>(GetFormatAttr( RES_PAGEDESC )).GetPageDesc() ) { const SwSectionNode* pNd = GetSectionNode(); if( pNd ) @@ -858,15 +858,15 @@ bool SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const case RES_CONTENT_VISIBLE: { - SwFrm* pFrm = SwIterator<SwFrm,SwFmt>(*this).First(); + SwFrm* pFrm = SwIterator<SwFrm,SwFormat>(*this).First(); // if the current section has no own frame search for the children if(!pFrm) { - SwIterator<SwSectionFmt,SwSectionFmt> aFormatIter(*this); - SwSectionFmt* pChild = aFormatIter.First(); + SwIterator<SwSectionFormat,SwSectionFormat> aFormatIter(*this); + SwSectionFormat* pChild = aFormatIter.First(); while(pChild && !pFrm) { - pFrm = SwIterator<SwFrm,SwFmt>(*pChild).First(); + pFrm = SwIterator<SwFrm,SwFormat>(*pChild).First(); pChild = aFormatIter.Next(); } } @@ -879,14 +879,14 @@ bool SwSectionFmt::GetInfo( SfxPoolItem& rInfo ) const static bool lcl_SectionCmpPos( const SwSection *pFirst, const SwSection *pSecond) { - const SwSectionFmt* pFSectFmt = pFirst->GetFmt(); - const SwSectionFmt* pSSectFmt = pSecond->GetFmt(); - OSL_ENSURE( pFSectFmt && pSSectFmt && - pFSectFmt->GetCntnt(false).GetCntntIdx() && - pSSectFmt->GetCntnt(false).GetCntntIdx(), + const SwSectionFormat* pFSectFormat = pFirst->GetFormat(); + const SwSectionFormat* pSSectFormat = pSecond->GetFormat(); + OSL_ENSURE( pFSectFormat && pSSectFormat && + pFSectFormat->GetContent(false).GetContentIdx() && + pSSectFormat->GetContent(false).GetContentIdx(), "ungueltige Sections" ); - return pFSectFmt->GetCntnt(false).GetCntntIdx()->GetIndex() < - pSSectFmt->GetCntnt(false).GetCntntIdx()->GetIndex(); + return pFSectFormat->GetContent(false).GetContentIdx()->GetIndex() < + pSSectFormat->GetContent(false).GetContentIdx()->GetIndex(); } static bool lcl_SectionCmpNm( const SwSection *pFSect, const SwSection *pSSect) @@ -896,7 +896,7 @@ static bool lcl_SectionCmpNm( const SwSection *pFSect, const SwSection *pSSect) } // get all Sections that have been derived from this one -void SwSectionFmt::GetChildSections( SwSections& rArr, +void SwSectionFormat::GetChildSections( SwSections& rArr, SectionSort eSort, bool bAllSections ) const { @@ -904,12 +904,12 @@ void SwSectionFmt::GetChildSections( SwSections& rArr, if( HasWriterListeners() ) { - SwIterator<SwSectionFmt,SwSectionFmt> aIter(*this); + SwIterator<SwSectionFormat,SwSectionFormat> aIter(*this); const SwNodeIndex* pIdx; - for( SwSectionFmt* pLast = aIter.First(); pLast; pLast = aIter.Next() ) + for( SwSectionFormat* pLast = aIter.First(); pLast; pLast = aIter.Next() ) if( bAllSections || - ( 0 != ( pIdx = pLast->GetCntnt(false). - GetCntntIdx()) && &pIdx->GetNodes() == &GetDoc()->GetNodes() )) + ( 0 != ( pIdx = pLast->GetContent(false). + GetContentIdx()) && &pIdx->GetNodes() == &GetDoc()->GetNodes() )) { SwSection* pDummy = pLast->GetSection(); rArr.push_back( pDummy ); @@ -932,14 +932,14 @@ void SwSectionFmt::GetChildSections( SwSections& rArr, } // See whether the Section is within the Nodes or the UndoNodes array -bool SwSectionFmt::IsInNodesArr() const +bool SwSectionFormat::IsInNodesArr() const { - const SwNodeIndex* pIdx = GetCntnt(false).GetCntntIdx(); + const SwNodeIndex* pIdx = GetContent(false).GetContentIdx(); return pIdx && &pIdx->GetNodes() == &GetDoc()->GetNodes(); } // Parent was changed -void SwSectionFmt::UpdateParent() +void SwSectionFormat::UpdateParent() { if( !HasWriterListeners() ) return; @@ -947,13 +947,13 @@ void SwSectionFmt::UpdateParent() SwSection* pSection = 0; const SvxProtectItem* pProtect(0); // edit in readonly sections - const SwFmtEditInReadonly* pEditInReadonly = 0; + const SwFormatEditInReadonly* pEditInReadonly = 0; bool bIsHidden = false; - SwIterator<SwClient,SwSectionFmt> aIter(*this); + SwIterator<SwClient,SwSectionFormat> aIter(*this); for(SwClient* pLast = aIter.First(); pLast; pLast = aIter.Next()) { - if( pLast->IsA( TYPE(SwSectionFmt) ) ) + if( pLast->IsA( TYPE(SwSectionFormat) ) ) { if( !pSection ) { @@ -961,9 +961,9 @@ void SwSectionFmt::UpdateParent() if( GetRegisteredIn() ) { const SwSection* pPS = GetParentSection(); - pProtect = &pPS->GetFmt()->GetProtect(); + pProtect = &pPS->GetFormat()->GetProtect(); // edit in readonly sections - pEditInReadonly = &pPS->GetFmt()->GetEditInReadonly(); + pEditInReadonly = &pPS->GetFormat()->GetEditInReadonly(); bIsHidden = pPS->IsHiddenFlag(); } else @@ -974,7 +974,7 @@ void SwSectionFmt::UpdateParent() bIsHidden = pSection->IsHidden(); } } - if (!pProtect->IsCntntProtected() != + if (!pProtect->IsContentProtected() != !pSection->IsProtectFlag()) { pLast->ModifyNotification( (SfxPoolItem*)pProtect, @@ -1004,9 +1004,9 @@ void SwSectionFmt::UpdateParent() if( GetRegisteredIn() ) { const SwSection* pPS = GetParentSection(); - pProtect = &pPS->GetFmt()->GetProtect(); + pProtect = &pPS->GetFormat()->GetProtect(); // edit in readonly sections - pEditInReadonly = &pPS->GetFmt()->GetEditInReadonly(); + pEditInReadonly = &pPS->GetFormat()->GetEditInReadonly(); bIsHidden = pPS->IsHiddenFlag(); } else @@ -1020,16 +1020,16 @@ void SwSectionFmt::UpdateParent() } } -SwSectionNode* SwSectionFmt::GetSectionNode(bool const bAlways) +SwSectionNode* SwSectionFormat::GetSectionNode(bool const bAlways) { - const SwNodeIndex* pIdx = GetCntnt(false).GetCntntIdx(); + const SwNodeIndex* pIdx = GetContent(false).GetContentIdx(); if( pIdx && ( bAlways || &pIdx->GetNodes() == &GetDoc()->GetNodes() )) return pIdx->GetNode().GetSectionNode(); return 0; } // Is this Section valid for the GlobalDocument? -const SwSection* SwSectionFmt::GetGlobalDocSection() const +const SwSection* SwSectionFormat::GetGlobalDocSection() const { const SwSectionNode* pNd = GetSectionNode(); if( pNd && @@ -1043,25 +1043,25 @@ const SwSection* SwSectionFmt::GetGlobalDocSection() const } // sw::Metadatable -::sfx2::IXmlIdRegistry& SwSectionFmt::GetRegistry() +::sfx2::IXmlIdRegistry& SwSectionFormat::GetRegistry() { return GetDoc()->GetXmlIdRegistry(); } -bool SwSectionFmt::IsInClipboard() const +bool SwSectionFormat::IsInClipboard() const { return GetDoc()->IsClipBoard(); } -bool SwSectionFmt::IsInUndo() const +bool SwSectionFormat::IsInUndo() const { return !IsInNodesArr(); } -bool SwSectionFmt::IsInContent() const +bool SwSectionFormat::IsInContent() const { - SwNodeIndex const*const pIdx = GetCntnt(false).GetCntntIdx(); - OSL_ENSURE(pIdx, "SwSectionFmt::IsInContent: no index?"); + SwNodeIndex const*const pIdx = GetContent(false).GetContentIdx(); + OSL_ENSURE(pIdx, "SwSectionFormat::IsInContent: no index?"); return pIdx == nullptr || !GetDoc()->IsInHeaderFooter(*pIdx); } @@ -1071,7 +1071,7 @@ bool SwSectionFmt::IsInContent() const // section format. but here only one UNO object can be returned, // so always return the text section. uno::Reference< rdf::XMetadatable > -SwSectionFmt::MakeUnoObject() +SwSectionFormat::MakeUnoObject() { uno::Reference<rdf::XMetadatable> xMeta; SwSection *const pSection( GetSection() ); @@ -1084,19 +1084,19 @@ SwSectionFmt::MakeUnoObject() return xMeta; } -void SwSectionFmt::dumpAsXml(xmlTextWriterPtr pWriter) const +void SwSectionFormat::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("swSectionFmt")); + xmlTextWriterStartElement(pWriter, BAD_CAST("swSectionFormat")); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(GetName().toUtf8().getStr())); GetAttrSet().dumpAsXml(pWriter); xmlTextWriterEndElement(pWriter); } -void SwSectionFmts::dumpAsXml(xmlTextWriterPtr pWriter) const +void SwSectionFormats::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("swSectionFmts")); + xmlTextWriterStartElement(pWriter, BAD_CAST("swSectionFormats")); for (size_t i = 0; i < size(); ++i) - GetFmt(i)->dumpAsXml(pWriter); + GetFormat(i)->dumpAsXml(pWriter); xmlTextWriterEndElement(pWriter); } @@ -1185,8 +1185,8 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) ::sfx2::SvBaseLink::UpdateResult SwIntrnlSectRefLink::DataChanged( const OUString& rMimeType, const uno::Any & rValue ) { - SwSectionNode* pSectNd = rSectFmt.GetSectionNode( false ); - SwDoc* pDoc = rSectFmt.GetDoc(); + SwSectionNode* pSectNd = rSectFormat.GetSectionNode( false ); + SwDoc* pDoc = rSectFormat.GetDoc(); SotClipboardFormatId nDataFormat = SotExchange::GetFormatIdFromMimeType( rMimeType ); @@ -1213,13 +1213,13 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) SwPaM* pPam; SwViewShell* pVSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(); SwEditShell* pESh = pDoc->GetEditShell(); - pDoc->getIDocumentFieldsAccess().LockExpFlds(); + pDoc->getIDocumentFieldsAccess().LockExpFields(); { // Insert an empty TextNode at the Section's start SwNodeIndex aIdx( *pSectNd, +1 ); SwNodeIndex aEndIdx( *pSectNd->EndOfSectionNode() ); - SwTxtNode* pNewNd = pDoc->GetNodes().MakeTxtNode( aIdx, - pDoc->getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_TEXT ) ); + SwTextNode* pNewNd = pDoc->GetNodes().MakeTextNode( aIdx, + pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_TEXT ) ); if( pESh ) pESh->StartAllAction(); @@ -1361,7 +1361,7 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) pDoc->GetNodes().GetEndOfExtras().GetIndex() || rInsPos.GetNode().FindTableNode(); - SwTblNumFmtMerge aTNFM( *pSrcDoc, *pDoc ); + SwTableNumFormatMerge aTNFM( *pSrcDoc, *pDoc ); pSrcDoc->GetDocumentContentOperationsManager().CopyWithFlyInFly( *pCpyRg, 0, rInsPos, NULL, bCreateFrm ); ++aSave; @@ -1438,9 +1438,9 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) pDoc->GetIDocumentUndoRedo().DoUndo(bWasUndo); pDoc->getIDocumentLinksAdministration().SetVisibleLinks( bWasVisibleLinks ); - pDoc->getIDocumentFieldsAccess().UnlockExpFlds(); - if( !pDoc->getIDocumentFieldsAccess().IsExpFldsLocked() ) - pDoc->getIDocumentFieldsAccess().UpdateExpFlds(NULL, true); + pDoc->getIDocumentFieldsAccess().UnlockExpFields(); + if( !pDoc->getIDocumentFieldsAccess().IsExpFieldsLocked() ) + pDoc->getIDocumentFieldsAccess().UpdateExpFields(NULL, true); if( pESh ) pESh->EndAllAction(); @@ -1453,14 +1453,14 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) void SwIntrnlSectRefLink::Closed() { - SwDoc* pDoc = rSectFmt.GetDoc(); + SwDoc* pDoc = rSectFormat.GetDoc(); if( pDoc && !pDoc->IsInDtor() ) { // Advise says goodbye: mark the Section as not protected // and change the Flag - const SwSectionFmts& rFmts = pDoc->GetSections(); - for( auto n = rFmts.size(); n; ) - if( rFmts[ --n ] == &rSectFmt ) + const SwSectionFormats& rFormats = pDoc->GetSections(); + for( auto n = rFormats.size(); n; ) + if( rFormats[ --n ] == &rSectFormat ) { SwViewShell* pSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(); SwEditShell* pESh = pDoc->GetEditShell(); @@ -1470,7 +1470,7 @@ void SwIntrnlSectRefLink::Closed() else pSh->StartAction(); - SwSectionData aSectionData(*rSectFmt.GetSection()); + SwSectionData aSectionData(*rSectFormat.GetSection()); aSectionData.SetType( CONTENT_SECTION ); aSectionData.SetLinkFileName( OUString() ); aSectionData.SetHidden( false ); @@ -1483,7 +1483,7 @@ void SwIntrnlSectRefLink::Closed() pDoc->UpdateSection( n, aSectionData ); // Make all Links within the Section visible again - SwSectionNode* pSectNd = rSectFmt.GetSectionNode( false ); + SwSectionNode* pSectNd = rSectFormat.GetSectionNode( false ); if( pSectNd ) SwSection::MakeChildLinksVisible( *pSectNd ); @@ -1499,9 +1499,9 @@ void SwIntrnlSectRefLink::Closed() void SwSection::CreateLink( LinkCreateType eCreateType ) { - SwSectionFmt* pFmt = GetFmt(); - OSL_ENSURE(pFmt, "SwSection::CreateLink: no format?"); - if (!pFmt || (CONTENT_SECTION == m_Data.GetType())) + SwSectionFormat* pFormat = GetFormat(); + OSL_ENSURE(pFormat, "SwSection::CreateLink: no format?"); + if (!pFormat || (CONTENT_SECTION == m_Data.GetType())) return ; SfxLinkUpdateMode nUpdateType = SfxLinkUpdateMode::ALWAYS; @@ -1509,11 +1509,11 @@ void SwSection::CreateLink( LinkCreateType eCreateType ) if (!m_RefLink.Is()) { // create BaseLink - m_RefLink = new SwIntrnlSectRefLink( *pFmt, nUpdateType, SotClipboardFormatId::RTF ); + m_RefLink = new SwIntrnlSectRefLink( *pFormat, nUpdateType, SotClipboardFormatId::RTF ); } else { - pFmt->GetDoc()->getIDocumentLinksAdministration().GetLinkManager().Remove( m_RefLink ); + pFormat->GetDoc()->getIDocumentLinksAdministration().GetLinkManager().Remove( m_RefLink ); } SwIntrnlSectRefLink *const pLnk = @@ -1521,13 +1521,13 @@ void SwSection::CreateLink( LinkCreateType eCreateType ) const OUString sCmd(SwSectionData::CollapseWhiteSpaces(m_Data.GetLinkFileName())); pLnk->SetUpdateMode( nUpdateType ); - pLnk->SetVisible( pFmt->GetDoc()->getIDocumentLinksAdministration().IsVisibleLinks() ); + pLnk->SetVisible( pFormat->GetDoc()->getIDocumentLinksAdministration().IsVisibleLinks() ); switch (m_Data.GetType()) { case DDE_LINK_SECTION: pLnk->SetLinkSourceName( sCmd ); - pFmt->GetDoc()->getIDocumentLinksAdministration().GetLinkManager().InsertDDELink( pLnk ); + pFormat->GetDoc()->getIDocumentLinksAdministration().GetLinkManager().InsertDDELink( pLnk ); break; case FILE_LINK_SECTION: { @@ -1536,7 +1536,7 @@ void SwSection::CreateLink( LinkCreateType eCreateType ) const OUString sFile(sCmd.getToken( 0, sfx2::cTokenSeparator, nIndex )); const OUString sFltr(sCmd.getToken( 0, sfx2::cTokenSeparator, nIndex )); const OUString sRange(sCmd.getToken( 0, sfx2::cTokenSeparator, nIndex )); - pFmt->GetDoc()->getIDocumentLinksAdministration().GetLinkManager().InsertFileLink( *pLnk, + pFormat->GetDoc()->getIDocumentLinksAdministration().GetLinkManager().InsertFileLink( *pLnk, static_cast<sal_uInt16>(m_Data.GetType()), sFile, ( !sFltr.isEmpty() ? &sFltr : 0 ), @@ -1574,7 +1574,7 @@ void SwSection::BreakLink() // Release link, if it exists if (m_RefLink.Is()) { - SwSectionFmt *const pFormat( GetFmt() ); + SwSectionFormat *const pFormat( GetFormat() ); OSL_ENSURE(pFormat, "SwSection::BreakLink: no format?"); if (pFormat) { @@ -1591,13 +1591,13 @@ void SwSection::BreakLink() const SwNode* SwIntrnlSectRefLink::GetAnchor() const { - return rSectFmt.GetSectionNode( false ); + return rSectFormat.GetSectionNode( false ); } bool SwIntrnlSectRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, sal_Int32 , sal_Int32 ) const { - SwStartNode* pSttNd = rSectFmt.GetSectionNode( false ); + SwStartNode* pSttNd = rSectFormat.GetSectionNode( false ); return pSttNd && nSttNd < pSttNd->GetIndex() && pSttNd->EndOfSectionIndex() < nEndNd; diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index edd25b63a154..a00c8f966c1c 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -60,19 +60,19 @@ TYPEINIT1( SwBaseLink, ::sfx2::SvBaseLink ); static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) { - //call fist all not SwNoTxtFrames, then the SwNoTxtFrames. - // The reason is, that in the SwNoTxtFrames the Graphic + //call fist all not SwNoTextFrames, then the SwNoTextFrames. + // The reason is, that in the SwNoTextFrames the Graphic // after a Paint will be swapped out! So all other "behind" // them havent't a loaded Graphic. rGrfNd.LockModify(); { SwIterator<SwClient,SwGrfNode> aIter(rGrfNd); for(SwClient* pLast = aIter.First(); pLast; pLast = aIter.Next()) - if(!pLast->ISA(SwCntntFrm)) + if(!pLast->ISA(SwContentFrm)) pLast->ModifyNotification(&rItem, &rItem); } { - SwIterator<SwCntntFrm,SwGrfNode> aIter(rGrfNd); + SwIterator<SwContentFrm,SwGrfNode> aIter(rGrfNd); for(SwClient* pLast = aIter.First(); pLast; pLast = aIter.Next()) pLast->ModifyNotification(&rItem, &rItem); } @@ -82,23 +82,23 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) ::sfx2::SvBaseLink::UpdateResult SwBaseLink::DataChanged( const OUString& rMimeType, const uno::Any & rValue ) { - if( !pCntntNode ) + if( !pContentNode ) { OSL_ENSURE(false, "DataChanged without ContentNode" ); return ERROR_GENERAL; } - SwDoc* pDoc = pCntntNode->GetDoc(); + SwDoc* pDoc = pContentNode->GetDoc(); if( pDoc->IsInDtor() || ChkNoDataFlag() || bIgnoreDataChanged ) { bIgnoreDataChanged = false; return SUCCESS; } - SotClipboardFormatId nFmt = SotExchange::GetFormatIdFromMimeType( rMimeType ); + SotClipboardFormatId nFormat = SotExchange::GetFormatIdFromMimeType( rMimeType ); - if( pCntntNode->IsNoTxtNode() && - nFmt == sfx2::LinkManager::RegisterStatusInfoId() ) + if( pContentNode->IsNoTextNode() && + nFormat == sfx2::LinkManager::RegisterStatusInfoId() ) { // Only a status change - serve Events? OUString sState; @@ -113,11 +113,11 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) case sfx2::LinkManager::STATE_LOAD_ABORT: nEvent = SVX_EVENT_IMAGE_ABORT; break; } - SwFrmFmt* pFmt; - if( nEvent && 0 != ( pFmt = pCntntNode->GetFlyFmt() )) + SwFrameFormat* pFormat; + if( nEvent && 0 != ( pFormat = pContentNode->GetFlyFormat() )) { SwCallMouseEvent aCallEvent; - aCallEvent.Set( EVENT_OBJECT_IMAGE, pFmt ); + aCallEvent.Set( EVENT_OBJECT_IMAGE, pFormat ); pDoc->CallEvent( nEvent, aCallEvent ); } } @@ -132,9 +132,9 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) SwGrfNode* pSwGrfNode = NULL; - if (pCntntNode->IsGrfNode()) + if (pContentNode->IsGrfNode()) { - pSwGrfNode = pCntntNode->GetGrfNode(); + pSwGrfNode = pContentNode->GetGrfNode(); assert(pSwGrfNode && "Error, pSwGrfNode expected when node answers IsGrfNode() with true (!)"); aOldSz = pSwGrfNode->GetTwipSize(); const GraphicObject& rGrfObj = pSwGrfNode->GetGrfObj(); @@ -184,7 +184,7 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) if ( bUpdate && !bGraphicArrived && !bGraphicPieceArrived ) pSwGrfNode->SetTwipSize( Size(0,0) ); } - else if( pCntntNode->IsOLENode() ) + else if( pContentNode->IsOLENode() ) bUpdate = true; SwViewShell *pSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(); @@ -196,7 +196,7 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) if ( (!pSh || !pSh->ActionPend()) && (!pESh || !pESh->ActionPend()) ) { SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED ); - pCntntNode->ModifyNotification( &aMsgHint, &aMsgHint ); + pContentNode->ModifyNotification( &aMsgHint, &aMsgHint ); bUpdate = false; } } @@ -233,7 +233,7 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) pLnk->ISA( SwBaseLink ) && pLnk->GetObj() == GetObj() ) { SwBaseLink* pBLink = static_cast<SwBaseLink*>(pLnk); - SwGrfNode* pGrfNd = static_cast<SwGrfNode*>(pBLink->pCntntNode); + SwGrfNode* pGrfNd = static_cast<SwGrfNode*>(pBLink->pContentNode); if( pBLink != this && ( !bSwapIn || @@ -245,7 +245,7 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) pBLink->DataChanged( rMimeType, rValue ); pBLink->bIgnoreDataChanged = true; - pGrfNd->SetGraphicArrived( static_cast<SwGrfNode*>(pCntntNode)-> + pGrfNd->SetGraphicArrived( static_cast<SwGrfNode*>(pContentNode)-> IsGraphicArrived() ); // Adjust the Fly's graphic @@ -268,7 +268,7 @@ static void lcl_CallModify( SwGrfNode& rGrfNd, SfxPoolItem& rItem ) } else { - pCntntNode->ModifyNotification( &aMsgHint, &aMsgHint ); + pContentNode->ModifyNotification( &aMsgHint, &aMsgHint ); } if( pESh ) @@ -300,9 +300,9 @@ static bool SetGrfFlySize( const Size& rGrfSz, SwGrfNode* pGrfNd, const Size& rO if ( !(aSz.Width() && aSz.Height()) && rGrfSz.Width() && rGrfSz.Height() ) { - SwFrmFmt* pFmt; + SwFrameFormat* pFormat; if( pGrfNd->IsChgTwipSize() && - 0 != (pFmt = pGrfNd->GetFlyFmt()) ) + 0 != (pFormat = pGrfNd->GetFlyFormat()) ) { Size aCalcSz( aSz ); if ( !aSz.Height() && aSz.Width() ) @@ -317,17 +317,17 @@ static bool SetGrfFlySize( const Size& rGrfSz, SwGrfNode* pGrfNd, const Size& rO // Take over height and width aCalcSz = rGrfSz; - const SvxBoxItem &rBox = pFmt->GetBox(); + const SvxBoxItem &rBox = pFormat->GetBox(); aCalcSz.Width() += rBox.CalcLineSpace(SvxBoxItemLine::LEFT) + rBox.CalcLineSpace(SvxBoxItemLine::RIGHT); aCalcSz.Height()+= rBox.CalcLineSpace(SvxBoxItemLine::TOP) + rBox.CalcLineSpace(SvxBoxItemLine::BOTTOM); - const SwFmtFrmSize& rOldAttr = pFmt->GetFrmSize(); + const SwFormatFrmSize& rOldAttr = pFormat->GetFrmSize(); if( rOldAttr.GetSize() != aCalcSz ) { - SwFmtFrmSize aAttr( rOldAttr ); + SwFormatFrmSize aAttr( rOldAttr ); aAttr.SetSize( aCalcSz ); - pFmt->SetFmtAttr( aAttr ); + pFormat->SetFormatAttr( aAttr ); bRet = true; } @@ -336,16 +336,16 @@ static bool SetGrfFlySize( const Size& rGrfSz, SwGrfNode* pGrfNd, const Size& rO // If the graphic is anchored in a table, we need to recalculate // the table rows const SwDoc *pDoc = pGrfNd->GetDoc(); - const SwPosition* pAPos = pFmt->GetAnchor().GetCntntAnchor(); + const SwPosition* pAPos = pFormat->GetAnchor().GetContentAnchor(); SwNode *pANd; - SwTableNode *pTblNd; + SwTableNode *pTableNd; if( pAPos && 0 != (pANd = & pAPos->nNode.GetNode()) && - 0 != (pTblNd = pANd->FindTableNode()) ) + 0 != (pTableNd = pANd->FindTableNode()) ) { - const bool bLastGrf = !pTblNd->GetTable().DecGrfsThatResize(); + const bool bLastGrf = !pTableNd->GetTable().DecGrfsThatResize(); SwHTMLTableLayout *pLayout = - pTblNd->GetTable().GetHTMLTableLayout(); + pTableNd->GetTable().GetHTMLTableLayout(); if( pLayout ) { const sal_uInt16 nBrowseWidth = @@ -431,24 +431,24 @@ bool SwBaseLink::SwapIn( bool bWaitForData, bool bNativFormat ) void SwBaseLink::Closed() { - if( pCntntNode && !pCntntNode->GetDoc()->IsInDtor() ) + if( pContentNode && !pContentNode->GetDoc()->IsInDtor() ) { // Delete the connection - if( pCntntNode->IsGrfNode() ) - static_cast<SwGrfNode*>(pCntntNode)->ReleaseLink(); + if( pContentNode->IsGrfNode() ) + static_cast<SwGrfNode*>(pContentNode)->ReleaseLink(); } SvBaseLink::Closed(); } const SwNode* SwBaseLink::GetAnchor() const { - if (pCntntNode) + if (pContentNode) { - SwFrmFmt *const pFmt = pCntntNode->GetFlyFmt(); - if (pFmt) + SwFrameFormat *const pFormat = pContentNode->GetFlyFormat(); + if (pFormat) { - const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); - SwPosition const*const pAPos = rAnchor.GetCntntAnchor(); + const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); + SwPosition const*const pAPos = rAnchor.GetContentAnchor(); if (pAPos && ((FLY_AS_CHAR == rAnchor.GetAnchorId()) || (FLY_AT_CHAR == rAnchor.GetAnchorId()) || |