33 #include <osl/diagnose.h>
38 #define CHECK_TABLE(t) (t).CheckConsistency();
40 #define CHECK_TABLE(t)
47 struct MapTableFrameFormat
52 : pOld( pOldFormat ), pNew( pNewFormat )
95 if( pCpyAttrNd != pCpyTextNd )
97 pCpyAttrNd->
CopyAttr( pTextNd, 0, 0 );
103 aSet.CopyToModify( *pTextNd );
110 pCpyTextNd->
GetText().getLength(), true );
120 if( rMap.pOld != *pPara )
140 : m_rDoc(rDc), m_nOldTableSttIdx(nOldStt), m_rMapArr(rArr),
141 m_pInsLine(nullptr), m_pInsBox(nullptr), m_pTableNd(&rTableNd), m_pOldTable(pOldTable)
152 for (
const auto& rMap : pCT->m_rMapArr)
153 if ( !
lcl_SrchNew( rMap, reinterpret_cast<SwFrameFormat**>(&pBoxFormat) ) )
164 pBoxFormat = pCT->m_rDoc.MakeTableBoxFormat();
176 if( nNewIdx != nOldIdx )
188 pNewBox =
new SwTableBox(pBoxFormat, nLines, pCT->m_pInsLine);
192 assert(aNewIdx.GetNode().IsStartNode() &&
"Index is not on the start node");
194 pNewBox =
new SwTableBox(pBoxFormat, aNewIdx, pCT->m_pInsLine);
198 pCT->m_pInsLine->GetTabBoxes().push_back( pNewBox );
202 CopyTable aPara(*pCT);
203 aPara.m_pInsBox = pNewBox;
207 else if (pNewBox->
IsInHeadline(&pCT->m_pTableNd->GetTable()))
217 for (
const auto& rMap : pCT->m_rMapArr)
218 if ( !
lcl_SrchNew( rMap, reinterpret_cast<SwFrameFormat**>(&pLineFormat) ) )
223 pLineFormat = pCT->m_rDoc.MakeTableLineFormat();
225 pCT->m_rMapArr.emplace_back(pLine->
GetFrameFormat(), pLineFormat);
232 pCT->m_pInsBox->GetTabLines().push_back(pNewLine);
236 pCT->m_pTableNd->GetTable().GetTabLines().push_back(pNewLine);
239 pCT->m_pInsLine = pNewLine;
240 for(
auto& rpBox : const_cast<SwTableLine*>(pLine)->GetTabBoxes() )
260 for(
size_t n = rTableFormats.
size();
n; )
261 if( rTableFormats[ --
n ]->
GetName() == sTableName )
283 if(
auto pSwDDETable = dynamic_cast<const SwDDETable*>( &
GetTable() ) )
287 pDDEType =
const_cast<SwDDETable*
>(pSwDDETable)->GetDDEFieldType();
292 OSL_ENSURE( pDDEType,
"unknown FieldType" );
295 std::unique_ptr<SwDDETable> pNewTable(
new SwDDETable( pTableNd->
GetTable(), pDDEType ));
296 pTableNd->
SetNewTable( std::move(pNewTable),
false );
308 rNds.
Copy_( aRg, aInsPos,
false );
345 if(
nullptr != pSet )
349 if( SfxItemState::SET == pSet->GetItemState(
RES_BREAK,
false, &pAttr ) )
350 aPgBrkSet.Put( *pAttr );
352 if( SfxItemState::SET == pSet->GetItemState(
RES_PAGEDESC,
false, &pAttr ) )
353 aPgBrkSet.Put( *pAttr );
358 if (bUndoForChgFormatColl)
368 if(
nullptr != pSet )
371 pSet->CopyToModify( rDestNd );
374 if( aPgBrkSet.Count() )
SwTableFormat * MakeTableFrameFormat(const OUString &rFormatName, SwFrameFormat *pDerivedFrom)
const SwEndNode * EndOfSectionNode() const
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
SwNode & GetEndOfInserts() const
Section for all footnotes.
void SetRowsToRepeat(sal_uInt16 nNumOfRows)
Represents the style of a paragraph.
void RegisterToFormat(SwFormat &rFormat)
void DelFrames(SwRootFrame const *pLayout=nullptr)
Method deletes all views of document for the node.
constexpr TypedWhichId< SwTableBoxNumFormat > RES_BOXATR_FORMAT(RES_BOXATR_BEGIN)
const OUString & GetText() const
virtual sal_uInt16 ResetAllAttr() override
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
const SwFrameFormats * GetTableFrameFormats() const
SwNodeOffset StartOfSectionIndex() const
OUString GetUniqueTableName() const
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
SwTableLine is one table row in the document model.
constexpr TypedWhichId< SwConditionTextFormatColl > RES_CONDTXTFMTCOLL(160)
IDocumentUndoRedo & GetIDocumentUndoRedo()
bool IsInHeadline(const SwTable *pTable) const
void CheckSectionCondColl() const
Call ChkCondcoll to all ContentNodes of section.
void Copy_(const SwNodeRange &rRg, const SwNodeIndex &rInsPos, bool bNewFrames=true) const
bool IsInsOnlyTextGlossary() const
static bool lcl_SrchNew(const MapTableFrameFormat &rMap, SwFrameFormat **pPara)
SwNodeOffset GetSttIdx() const
sal_Int32 getRowSpan() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
void SetTableModel(bool bNew)
SwTextFormatColl * CopyTextColl(const SwTextFormatColl &rColl)
copy TextNodes
const SwTable & GetTable() const
SwTableNode * MakeCopy(SwDoc &, const SwNodeIndex &) const
virtual OUString GetName() const override
void ChkCondColl(const SwTextFormatColl *pColl=nullptr)
void SetTableNode(SwTableNode *pNode)
void CopyText(SwTextNode *const pDest, const SwIndex &rStart, const sal_Int32 nLen, const bool bForceCopyOfAllAttrs)
Actions on text and attributes.
const SwAttrSet * GetpSwAttrSet() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SwNodeIndex & Assign(SwNodes const &rNds, SwNodeOffset)
void SectionDown(SwNodeRange *pRange, SwStartNodeType=SwNormalStartNode)
create a start/end section pair
static void lcl_CopyTableLine(const SwTableLine *pLine, CopyTable *pCT)
SAL_DLLPRIVATE void CopyAttr(SwTextNode *pDest, const sal_Int32 nStart, const sal_Int32 nOldPos)
Copies the attributes at nStart to pDest.
SwNodeOffset GetIndex() const
virtual SwFormatColl * ChgFormatColl(SwFormatColl *) override
WhichRangesContainer const aBreakSetRange(svl::Items< RES_PAGEDESC, RES_BREAK >)
virtual void InsDeletedFieldType(SwFieldType &)=0
SwFrameFormat * GetFrameFormat()
Marks a node in the document model.
SwFrameFormat * GetFrameFormat()
SwNodes & GetNodes()
Node is in which nodes-array/doc?
bool HasSwAttrSet() const
SwTableNode(const SwNodeIndex &)
SwTable is one table in the document model, containing rows (which contain cells).
SwTableLines & GetTabLines()
const SwFrameFormat * GetDfltFrameFormat() const
void SetTableChgMode(TableChgMode eMode)
SwTextNode is a paragraph in the document model.
SwTableBoxes & GetTabBoxes()
const SwStartNode * GetSttNd() const
std::vector< MapTableFrameFormat > MapTableFrameFormats
virtual SwFieldType * InsertFieldType(const SwFieldType &)=0
void SetTableStyleName(const OUString &rName)
Set the new table style name for this table.
bool IsCopyIsMove() const
friend class SwEndNode
to set the theEndOfSection !!
constexpr TypedWhichId< SwTableBoxFormula > RES_BOXATR_FORMULA(151)
SwTableBox is one table cell in the document model.
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
static void lcl_CopyTableBox(SwTableBox *pBox, CopyTable *pCT)
void CopyCollFormat(SwTextNode &rDestNd, bool bUndoForChgFormatColl=true)
Copy collection with all auto formats to dest-node.
sal_uInt32 GetValue() const
Ends a section of nodes in the document model.
void SetNewTable(std::unique_ptr< SwTable >, bool bNewFrames=true)
SwTextFormatColl & GetNextTextFormatColl() const
const SwAttrPool & GetAttrPool() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwTextNode * MakeTextNode(const SwNodeIndex &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
virtual SwContentNode * MakeCopy(SwDoc &, const SwNodeIndex &, bool bNewFrames) const override
SwTextFormatColl * GetTextColl() const