summaryrefslogtreecommitdiff
path: root/sw/source/core/docnode/ndcopy.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/docnode/ndcopy.cxx')
-rw-r--r--sw/source/core/docnode/ndcopy.cxx190
1 files changed, 95 insertions, 95 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 );