diff options
Diffstat (limited to 'sw/source/core/undo')
-rw-r--r-- | sw/source/core/undo/SwUndoField.cxx | 24 | ||||
-rw-r--r-- | sw/source/core/undo/SwUndoFmt.cxx | 224 | ||||
-rw-r--r-- | sw/source/core/undo/SwUndoPageDesc.cxx | 196 | ||||
-rw-r--r-- | sw/source/core/undo/rolbck.cxx | 528 | ||||
-rw-r--r-- | sw/source/core/undo/unattr.cxx | 370 | ||||
-rw-r--r-- | sw/source/core/undo/undel.cxx | 304 | ||||
-rw-r--r-- | sw/source/core/undo/undobj.cxx | 266 | ||||
-rw-r--r-- | sw/source/core/undo/undobj1.cxx | 318 | ||||
-rw-r--r-- | sw/source/core/undo/undoflystrattr.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/undo/undraw.cxx | 276 | ||||
-rw-r--r-- | sw/source/core/undo/unfmco.cxx | 32 | ||||
-rw-r--r-- | sw/source/core/undo/unins.cxx | 208 | ||||
-rw-r--r-- | sw/source/core/undo/unmove.cxx | 164 | ||||
-rw-r--r-- | sw/source/core/undo/unnum.cxx | 42 | ||||
-rw-r--r-- | sw/source/core/undo/unovwr.cxx | 116 | ||||
-rw-r--r-- | sw/source/core/undo/unredln.cxx | 60 | ||||
-rw-r--r-- | sw/source/core/undo/unsect.cxx | 94 | ||||
-rw-r--r-- | sw/source/core/undo/unsort.cxx | 56 | ||||
-rw-r--r-- | sw/source/core/undo/unspnd.cxx | 60 | ||||
-rw-r--r-- | sw/source/core/undo/untbl.cxx | 1532 | ||||
-rw-r--r-- | sw/source/core/undo/untblk.cxx | 146 |
21 files changed, 2515 insertions, 2515 deletions
diff --git a/sw/source/core/undo/SwUndoField.cxx b/sw/source/core/undo/SwUndoField.cxx index 080e8b2f24f6..b63a51a89201 100644 --- a/sw/source/core/undo/SwUndoField.cxx +++ b/sw/source/core/undo/SwUndoField.cxx @@ -49,7 +49,7 @@ SwPosition SwUndoField::GetPosition() { SwNode * pNode = pDoc->GetNodes()[nNodeIndex]; SwNodeIndex aNodeIndex(*pNode); - SwIndex aIndex(pNode->GetCntntNode(), nOffset); + SwIndex aIndex(pNode->GetContentNode(), nOffset); SwPosition aResult(aNodeIndex, aIndex); return aResult; @@ -58,11 +58,11 @@ SwPosition SwUndoField::GetPosition() SwUndoFieldFromDoc::SwUndoFieldFromDoc(const SwPosition & rPos, const SwField & rOldField, const SwField & rNewField, - SwMsgPoolItem * _pHnt, bool _bUpdate, SwUndoId _nId) + SwMsgPoolItem * _pHint, bool _bUpdate, SwUndoId _nId) : SwUndoField(rPos,_nId) , pOldField(rOldField.CopyField()) , pNewField(rNewField.CopyField()) - , pHnt(_pHnt) + , pHint(_pHint) , bUpdate(_bUpdate) { OSL_ENSURE(pOldField, "No old field!"); @@ -78,27 +78,27 @@ SwUndoFieldFromDoc::~SwUndoFieldFromDoc() void SwUndoFieldFromDoc::UndoImpl(::sw::UndoRedoContext &) { - SwTxtFld * pTxtFld = sw::DocumentFieldsManager::GetTxtFldAtPos(GetPosition()); - const SwField * pField = pTxtFld ? pTxtFld->GetFmtFld().GetField() : NULL; + SwTextField * pTextField = sw::DocumentFieldsManager::GetTextFieldAtPos(GetPosition()); + const SwField * pField = pTextField ? pTextField->GetFormatField().GetField() : NULL; if (pField) { - pDoc->getIDocumentFieldsAccess().UpdateFld(pTxtFld, *pOldField, pHnt, bUpdate); + pDoc->getIDocumentFieldsAccess().UpdateField(pTextField, *pOldField, pHint, bUpdate); } } void SwUndoFieldFromDoc::DoImpl() { - SwTxtFld * pTxtFld = sw::DocumentFieldsManager::GetTxtFldAtPos(GetPosition()); - const SwField * pField = pTxtFld ? pTxtFld->GetFmtFld().GetField() : NULL; + SwTextField * pTextField = sw::DocumentFieldsManager::GetTextFieldAtPos(GetPosition()); + const SwField * pField = pTextField ? pTextField->GetFormatField().GetField() : NULL; if (pField) { - pDoc->getIDocumentFieldsAccess().UpdateFld(pTxtFld, *pNewField, pHnt, bUpdate); - SwFmtFld* pDstFmtFld = const_cast<SwFmtFld*>(&pTxtFld->GetFmtFld()); + pDoc->getIDocumentFieldsAccess().UpdateField(pTextField, *pNewField, pHint, bUpdate); + SwFormatField* pDstFormatField = const_cast<SwFormatField*>(&pTextField->GetFormatField()); - if ( pDoc->getIDocumentFieldsAccess().GetFldType(RES_POSTITFLD, aEmptyOUStr, false) == pDstFmtFld->GetField()->GetTyp() ) - pDoc->GetDocShell()->Broadcast( SwFmtFldHint( pDstFmtFld, SwFmtFldHintWhich::INSERTED ) ); + if ( pDoc->getIDocumentFieldsAccess().GetFieldType(RES_POSTITFLD, aEmptyOUStr, false) == pDstFormatField->GetField()->GetTyp() ) + pDoc->GetDocShell()->Broadcast( SwFormatFieldHint( pDstFormatField, SwFormatFieldHintWhich::INSERTED ) ); } } diff --git a/sw/source/core/undo/SwUndoFmt.cxx b/sw/source/core/undo/SwUndoFmt.cxx index 55e9953b87bf..5f01e86a3018 100644 --- a/sw/source/core/undo/SwUndoFmt.cxx +++ b/sw/source/core/undo/SwUndoFmt.cxx @@ -31,8 +31,8 @@ #include <IDocumentUndoRedo.hxx> #include <comcore.hrc> -SwUndoFmtCreate::SwUndoFmtCreate -(SwUndoId nUndoId, SwFmt * _pNew, SwFmt * _pDerivedFrom, SwDoc * _pDoc) +SwUndoFormatCreate::SwUndoFormatCreate +(SwUndoId nUndoId, SwFormat * _pNew, SwFormat * _pDerivedFrom, SwDoc * _pDoc) : SwUndo(nUndoId), pNew(_pNew), pDoc(_pDoc), pNewSet(NULL), nId(0), bAuto(false) { @@ -40,11 +40,11 @@ SwUndoFmtCreate::SwUndoFmtCreate sDerivedFrom = _pDerivedFrom->GetName(); } -SwUndoFmtCreate::~SwUndoFmtCreate() +SwUndoFormatCreate::~SwUndoFormatCreate() { } -void SwUndoFmtCreate::UndoImpl(::sw::UndoRedoContext &) +void SwUndoFormatCreate::UndoImpl(::sw::UndoRedoContext &) { if (pNew) { @@ -57,7 +57,7 @@ void SwUndoFmtCreate::UndoImpl(::sw::UndoRedoContext &) if (pNew) { pNewSet = new SfxItemSet(pNew->GetAttrSet()); - nId = pNew->GetPoolFmtId() & COLL_GET_RANGE_BITS; + nId = pNew->GetPoolFormatId() & COLL_GET_RANGE_BITS; bAuto = pNew->IsAuto(); Delete(); @@ -65,26 +65,26 @@ void SwUndoFmtCreate::UndoImpl(::sw::UndoRedoContext &) } } -void SwUndoFmtCreate::RedoImpl(::sw::UndoRedoContext &) +void SwUndoFormatCreate::RedoImpl(::sw::UndoRedoContext &) { - SwFmt * pDerivedFrom = Find(sDerivedFrom); - SwFmt * pFmt = Create(pDerivedFrom); + SwFormat * pDerivedFrom = Find(sDerivedFrom); + SwFormat * pFormat = Create(pDerivedFrom); - if (pFmt && pNewSet) + if (pFormat && pNewSet) { - pFmt->SetAuto(bAuto); - pDoc->ChgFmt(*pFmt, *pNewSet); - pFmt->SetPoolFmtId((pFmt->GetPoolFmtId() + pFormat->SetAuto(bAuto); + pDoc->ChgFormat(*pFormat, *pNewSet); + pFormat->SetPoolFormatId((pFormat->GetPoolFormatId() & ~COLL_GET_RANGE_BITS) | nId); - pNew = pFmt; + pNew = pFormat; } else pNew = NULL; } -SwRewriter SwUndoFmtCreate::GetRewriter() const +SwRewriter SwUndoFormatCreate::GetRewriter() const { if (sNewName.isEmpty() && pNew) sNewName = pNew->GetName(); @@ -96,40 +96,40 @@ SwRewriter SwUndoFmtCreate::GetRewriter() const return aRewriter; } -SwUndoFmtDelete::SwUndoFmtDelete -(SwUndoId nUndoId, SwFmt * _pOld, SwDoc * _pDoc) +SwUndoFormatDelete::SwUndoFormatDelete +(SwUndoId nUndoId, SwFormat * _pOld, SwDoc * _pDoc) : SwUndo(nUndoId), pDoc(_pDoc), sOldName(_pOld->GetName()), aOldSet(_pOld->GetAttrSet()) { sDerivedFrom = _pOld->DerivedFrom()->GetName(); - nId = _pOld->GetPoolFmtId() & COLL_GET_RANGE_BITS; + nId = _pOld->GetPoolFormatId() & COLL_GET_RANGE_BITS; bAuto = _pOld->IsAuto(); } -SwUndoFmtDelete::~SwUndoFmtDelete() +SwUndoFormatDelete::~SwUndoFormatDelete() { } -void SwUndoFmtDelete::UndoImpl(::sw::UndoRedoContext &) +void SwUndoFormatDelete::UndoImpl(::sw::UndoRedoContext &) { - SwFmt * pDerivedFrom = Find(sDerivedFrom); + SwFormat * pDerivedFrom = Find(sDerivedFrom); - SwFmt * pFmt = Create(pDerivedFrom); + SwFormat * pFormat = Create(pDerivedFrom); - if (pFmt) + if (pFormat) { - pDoc->ChgFmt(*pFmt, aOldSet); - pFmt->SetAuto(bAuto); - pFmt->SetPoolFmtId((pFmt->GetPoolFmtId() & + pDoc->ChgFormat(*pFormat, aOldSet); + pFormat->SetAuto(bAuto); + pFormat->SetPoolFormatId((pFormat->GetPoolFormatId() & ~COLL_GET_RANGE_BITS) | nId); } } -void SwUndoFmtDelete::RedoImpl(::sw::UndoRedoContext &) +void SwUndoFormatDelete::RedoImpl(::sw::UndoRedoContext &) { - SwFmt * pOld = Find(sOldName); + SwFormat * pOld = Find(sOldName); if (pOld) { @@ -137,7 +137,7 @@ void SwUndoFmtDelete::RedoImpl(::sw::UndoRedoContext &) } } -SwRewriter SwUndoFmtDelete::GetRewriter() const +SwRewriter SwUndoFormatDelete::GetRewriter() const { SwRewriter aRewriter; @@ -146,7 +146,7 @@ SwRewriter SwUndoFmtDelete::GetRewriter() const return aRewriter; } -SwUndoRenameFmt::SwUndoRenameFmt(SwUndoId nUndoId, +SwUndoRenameFormat::SwUndoRenameFormat(SwUndoId nUndoId, const OUString & _sOldName, const OUString & _sNewName, SwDoc * _pDoc) @@ -155,31 +155,31 @@ SwUndoRenameFmt::SwUndoRenameFmt(SwUndoId nUndoId, { } -SwUndoRenameFmt::~SwUndoRenameFmt() +SwUndoRenameFormat::~SwUndoRenameFormat() { } -void SwUndoRenameFmt::UndoImpl(::sw::UndoRedoContext &) +void SwUndoRenameFormat::UndoImpl(::sw::UndoRedoContext &) { - SwFmt * pFmt = Find(sNewName); + SwFormat * pFormat = Find(sNewName); - if (pFmt) + if (pFormat) { - pDoc->RenameFmt(*pFmt, sOldName, true); + pDoc->RenameFormat(*pFormat, sOldName, true); } } -void SwUndoRenameFmt::RedoImpl(::sw::UndoRedoContext &) +void SwUndoRenameFormat::RedoImpl(::sw::UndoRedoContext &) { - SwFmt * pFmt = Find(sOldName); + SwFormat * pFormat = Find(sOldName); - if (pFmt) + if (pFormat) { - pDoc->RenameFmt(*pFmt, sNewName, true); + pDoc->RenameFormat(*pFormat, sNewName, true); } } -SwRewriter SwUndoRenameFmt::GetRewriter() const +SwRewriter SwUndoRenameFormat::GetRewriter() const { SwRewriter aRewriter; @@ -190,189 +190,189 @@ SwRewriter SwUndoRenameFmt::GetRewriter() const return aRewriter; } -SwUndoTxtFmtCollCreate::SwUndoTxtFmtCollCreate -(SwTxtFmtColl * _pNew, SwTxtFmtColl * _pDerivedFrom, SwDoc * _pDoc) - : SwUndoFmtCreate(UNDO_TXTFMTCOL_CREATE, _pNew, _pDerivedFrom, _pDoc) +SwUndoTextFormatCollCreate::SwUndoTextFormatCollCreate +(SwTextFormatColl * _pNew, SwTextFormatColl * _pDerivedFrom, SwDoc * _pDoc) + : SwUndoFormatCreate(UNDO_TXTFMTCOL_CREATE, _pNew, _pDerivedFrom, _pDoc) { } -SwFmt * SwUndoTxtFmtCollCreate::Create(SwFmt * pDerivedFrom) +SwFormat * SwUndoTextFormatCollCreate::Create(SwFormat * pDerivedFrom) { - return pDoc->MakeTxtFmtColl(sNewName, static_cast<SwTxtFmtColl *>(pDerivedFrom), true); + return pDoc->MakeTextFormatColl(sNewName, static_cast<SwTextFormatColl *>(pDerivedFrom), true); } -void SwUndoTxtFmtCollCreate::Delete() +void SwUndoTextFormatCollCreate::Delete() { - pDoc->DelTxtFmtColl(static_cast<SwTxtFmtColl *>(pNew), true); + pDoc->DelTextFormatColl(static_cast<SwTextFormatColl *>(pNew), true); } -SwFmt * SwUndoTxtFmtCollCreate::Find(const OUString & rName) const +SwFormat * SwUndoTextFormatCollCreate::Find(const OUString & rName) const { - return pDoc->FindTxtFmtCollByName(rName); + return pDoc->FindTextFormatCollByName(rName); } -SwUndoTxtFmtCollDelete::SwUndoTxtFmtCollDelete(SwTxtFmtColl * _pOld, +SwUndoTextFormatCollDelete::SwUndoTextFormatCollDelete(SwTextFormatColl * _pOld, SwDoc * _pDoc) - : SwUndoFmtDelete(UNDO_TXTFMTCOL_DELETE, _pOld, _pDoc) + : SwUndoFormatDelete(UNDO_TXTFMTCOL_DELETE, _pOld, _pDoc) { } -SwFmt * SwUndoTxtFmtCollDelete::Create(SwFmt * pDerivedFrom) +SwFormat * SwUndoTextFormatCollDelete::Create(SwFormat * pDerivedFrom) { - return pDoc->MakeTxtFmtColl(sOldName, static_cast<SwTxtFmtColl *>(pDerivedFrom), true); + return pDoc->MakeTextFormatColl(sOldName, static_cast<SwTextFormatColl *>(pDerivedFrom), true); } -void SwUndoTxtFmtCollDelete::Delete(SwFmt * pOld) +void SwUndoTextFormatCollDelete::Delete(SwFormat * pOld) { - pDoc->DelTxtFmtColl(static_cast<SwTxtFmtColl *>(pOld), true); + pDoc->DelTextFormatColl(static_cast<SwTextFormatColl *>(pOld), true); } -SwFmt * SwUndoTxtFmtCollDelete::Find(const OUString & rName) const +SwFormat * SwUndoTextFormatCollDelete::Find(const OUString & rName) const { - return pDoc->FindTxtFmtCollByName(rName); + return pDoc->FindTextFormatCollByName(rName); } -SwUndoCondTxtFmtCollCreate::SwUndoCondTxtFmtCollCreate(SwConditionTxtFmtColl *_pNew, - SwTxtFmtColl *_pDerivedFrom, SwDoc *_pDoc) - : SwUndoTxtFmtCollCreate(_pNew, _pDerivedFrom, _pDoc) +SwUndoCondTextFormatCollCreate::SwUndoCondTextFormatCollCreate(SwConditionTextFormatColl *_pNew, + SwTextFormatColl *_pDerivedFrom, SwDoc *_pDoc) + : SwUndoTextFormatCollCreate(_pNew, _pDerivedFrom, _pDoc) { } -SwFmt * SwUndoCondTxtFmtCollCreate::Create(SwFmt * pDerivedFrom) +SwFormat * SwUndoCondTextFormatCollCreate::Create(SwFormat * pDerivedFrom) { - return pDoc->MakeCondTxtFmtColl(sNewName, static_cast<SwTxtFmtColl *>(pDerivedFrom), true); + return pDoc->MakeCondTextFormatColl(sNewName, static_cast<SwTextFormatColl *>(pDerivedFrom), true); } -SwUndoCondTxtFmtCollDelete::SwUndoCondTxtFmtCollDelete(SwTxtFmtColl * _pOld, +SwUndoCondTextFormatCollDelete::SwUndoCondTextFormatCollDelete(SwTextFormatColl * _pOld, SwDoc * _pDoc) - : SwUndoTxtFmtCollDelete(_pOld, _pDoc) + : SwUndoTextFormatCollDelete(_pOld, _pDoc) { } -SwFmt * SwUndoCondTxtFmtCollDelete::Create(SwFmt * pDerivedFrom) +SwFormat * SwUndoCondTextFormatCollDelete::Create(SwFormat * pDerivedFrom) { - return pDoc->MakeCondTxtFmtColl(sOldName, static_cast<SwTxtFmtColl *>(pDerivedFrom), true); + return pDoc->MakeCondTextFormatColl(sOldName, static_cast<SwTextFormatColl *>(pDerivedFrom), true); } -SwUndoRenameFmtColl::SwUndoRenameFmtColl(const OUString & sInitOldName, +SwUndoRenameFormatColl::SwUndoRenameFormatColl(const OUString & sInitOldName, const OUString & sInitNewName, SwDoc * _pDoc) - : SwUndoRenameFmt(UNDO_TXTFMTCOL_RENAME, sInitOldName, sInitNewName, _pDoc) + : SwUndoRenameFormat(UNDO_TXTFMTCOL_RENAME, sInitOldName, sInitNewName, _pDoc) { } -SwFmt * SwUndoRenameFmtColl::Find(const OUString & rName) const +SwFormat * SwUndoRenameFormatColl::Find(const OUString & rName) const { - return pDoc->FindTxtFmtCollByName(rName); + return pDoc->FindTextFormatCollByName(rName); } -SwUndoCharFmtCreate::SwUndoCharFmtCreate(SwCharFmt * pNewFmt, - SwCharFmt * pDerivedFrom, +SwUndoCharFormatCreate::SwUndoCharFormatCreate(SwCharFormat * pNewFormat, + SwCharFormat * pDerivedFrom, SwDoc * pDocument) - : SwUndoFmtCreate(UNDO_CHARFMT_CREATE, pNewFmt, pDerivedFrom, pDocument) + : SwUndoFormatCreate(UNDO_CHARFMT_CREATE, pNewFormat, pDerivedFrom, pDocument) { } -SwFmt * SwUndoCharFmtCreate::Create(SwFmt * pDerivedFrom) +SwFormat * SwUndoCharFormatCreate::Create(SwFormat * pDerivedFrom) { - return pDoc->MakeCharFmt(sNewName, static_cast<SwCharFmt *>(pDerivedFrom), true); + return pDoc->MakeCharFormat(sNewName, static_cast<SwCharFormat *>(pDerivedFrom), true); } -void SwUndoCharFmtCreate::Delete() +void SwUndoCharFormatCreate::Delete() { - pDoc->DelCharFmt(static_cast<SwCharFmt *>(pNew), true); + pDoc->DelCharFormat(static_cast<SwCharFormat *>(pNew), true); } -SwFmt * SwUndoCharFmtCreate::Find(const OUString & rName) const +SwFormat * SwUndoCharFormatCreate::Find(const OUString & rName) const { - return pDoc->FindCharFmtByName(rName); + return pDoc->FindCharFormatByName(rName); } -SwUndoCharFmtDelete::SwUndoCharFmtDelete(SwCharFmt * pOld, SwDoc * pDocument) - : SwUndoFmtDelete(UNDO_CHARFMT_DELETE, pOld, pDocument) +SwUndoCharFormatDelete::SwUndoCharFormatDelete(SwCharFormat * pOld, SwDoc * pDocument) + : SwUndoFormatDelete(UNDO_CHARFMT_DELETE, pOld, pDocument) { } -SwFmt * SwUndoCharFmtDelete::Create(SwFmt * pDerivedFrom) +SwFormat * SwUndoCharFormatDelete::Create(SwFormat * pDerivedFrom) { - return pDoc->MakeCharFmt(sOldName, static_cast<SwCharFmt *>(pDerivedFrom), true); + return pDoc->MakeCharFormat(sOldName, static_cast<SwCharFormat *>(pDerivedFrom), true); } -void SwUndoCharFmtDelete::Delete(SwFmt * pFmt) +void SwUndoCharFormatDelete::Delete(SwFormat * pFormat) { - pDoc->DelCharFmt(static_cast<SwCharFmt *>(pFmt), true); + pDoc->DelCharFormat(static_cast<SwCharFormat *>(pFormat), true); } -SwFmt * SwUndoCharFmtDelete::Find(const OUString & rName) const +SwFormat * SwUndoCharFormatDelete::Find(const OUString & rName) const { - return pDoc->FindCharFmtByName(rName); + return pDoc->FindCharFormatByName(rName); } -SwUndoRenameCharFmt::SwUndoRenameCharFmt(const OUString & sInitOldName, +SwUndoRenameCharFormat::SwUndoRenameCharFormat(const OUString & sInitOldName, const OUString & sInitNewName, SwDoc * pDocument) - : SwUndoRenameFmt(UNDO_CHARFMT_RENAME, sInitOldName, sInitNewName, pDocument) + : SwUndoRenameFormat(UNDO_CHARFMT_RENAME, sInitOldName, sInitNewName, pDocument) { } -SwFmt * SwUndoRenameCharFmt::Find(const OUString & rName) const +SwFormat * SwUndoRenameCharFormat::Find(const OUString & rName) const { - return pDoc->FindCharFmtByName(rName); + return pDoc->FindCharFormatByName(rName); } -SwUndoFrmFmtCreate::SwUndoFrmFmtCreate(SwFrmFmt * pNewFmt, - SwFrmFmt * pDerivedFrom, +SwUndoFrameFormatCreate::SwUndoFrameFormatCreate(SwFrameFormat * pNewFormat, + SwFrameFormat * pDerivedFrom, SwDoc * pDocument) - : SwUndoFmtCreate(UNDO_FRMFMT_CREATE, pNewFmt, pDerivedFrom, pDocument), - bAuto(pNewFmt->IsAuto()) + : SwUndoFormatCreate(UNDO_FRMFMT_CREATE, pNewFormat, pDerivedFrom, pDocument), + bAuto(pNewFormat->IsAuto()) { } -SwFmt * SwUndoFrmFmtCreate::Create(SwFmt * pDerivedFrom) +SwFormat * SwUndoFrameFormatCreate::Create(SwFormat * pDerivedFrom) { - return pDoc->MakeFrmFmt(sNewName, static_cast<SwFrmFmt *>(pDerivedFrom), true, bAuto); + return pDoc->MakeFrameFormat(sNewName, static_cast<SwFrameFormat *>(pDerivedFrom), true, bAuto); } -void SwUndoFrmFmtCreate::Delete() +void SwUndoFrameFormatCreate::Delete() { - pDoc->DelFrmFmt(static_cast<SwFrmFmt *>(pNew), true); + pDoc->DelFrameFormat(static_cast<SwFrameFormat *>(pNew), true); } -SwFmt * SwUndoFrmFmtCreate::Find(const OUString & rName) const +SwFormat * SwUndoFrameFormatCreate::Find(const OUString & rName) const { - return pDoc->FindFrmFmtByName(rName); + return pDoc->FindFrameFormatByName(rName); } -SwUndoFrmFmtDelete::SwUndoFrmFmtDelete(SwFrmFmt * pOld, SwDoc * pDocument) - : SwUndoFmtDelete(UNDO_FRMFMT_DELETE, pOld, pDocument) +SwUndoFrameFormatDelete::SwUndoFrameFormatDelete(SwFrameFormat * pOld, SwDoc * pDocument) + : SwUndoFormatDelete(UNDO_FRMFMT_DELETE, pOld, pDocument) { } -SwFmt * SwUndoFrmFmtDelete::Create(SwFmt * pDerivedFrom) +SwFormat * SwUndoFrameFormatDelete::Create(SwFormat * pDerivedFrom) { - return pDoc->MakeFrmFmt(sOldName, static_cast<SwFrmFmt *>(pDerivedFrom), true); + return pDoc->MakeFrameFormat(sOldName, static_cast<SwFrameFormat *>(pDerivedFrom), true); } -void SwUndoFrmFmtDelete::Delete(SwFmt * pFmt) +void SwUndoFrameFormatDelete::Delete(SwFormat * pFormat) { - pDoc->DelFrmFmt(static_cast<SwFrmFmt *>(pFmt), true); + pDoc->DelFrameFormat(static_cast<SwFrameFormat *>(pFormat), true); } -SwFmt * SwUndoFrmFmtDelete::Find(const OUString & rName) const +SwFormat * SwUndoFrameFormatDelete::Find(const OUString & rName) const { - return pDoc->FindFrmFmtByName(rName); + return pDoc->FindFrameFormatByName(rName); } -SwUndoRenameFrmFmt::SwUndoRenameFrmFmt(const OUString & sInitOldName, +SwUndoRenameFrameFormat::SwUndoRenameFrameFormat(const OUString & sInitOldName, const OUString & sInitNewName, SwDoc * pDocument) - : SwUndoRenameFmt(UNDO_FRMFMT_RENAME, sInitOldName, sInitNewName, pDocument) + : SwUndoRenameFormat(UNDO_FRMFMT_RENAME, sInitOldName, sInitNewName, pDocument) { } -SwFmt * SwUndoRenameFrmFmt::Find(const OUString & rName) const +SwFormat * SwUndoRenameFrameFormat::Find(const OUString & rName) const { - return pDoc->FindFrmFmtByName(rName); + return pDoc->FindFrameFormatByName(rName); } SwUndoNumruleCreate::SwUndoNumruleCreate(const SwNumRule * _pNew, diff --git a/sw/source/core/undo/SwUndoPageDesc.cxx b/sw/source/core/undo/SwUndoPageDesc.cxx index b304dfc11258..c55eb68139a4 100644 --- a/sw/source/core/undo/SwUndoPageDesc.cxx +++ b/sw/source/core/undo/SwUndoPageDesc.cxx @@ -42,48 +42,48 @@ void DebugHeaderFooterContent( const SwPageDesc& rPageDesc ) sal_uLong nFooterMaster = ULONG_MAX; sal_uLong nFooterLeft = ULONG_MAX; - SwFmtHeader& rHead = (SwFmtHeader&)rPageDesc.GetMaster().GetHeader(); - SwFmtFooter& rFoot = (SwFmtFooter&)rPageDesc.GetMaster().GetFooter(); - SwFmtHeader& rLeftHead = (SwFmtHeader&)rPageDesc.GetLeft().GetHeader(); - SwFmtFooter& rLeftFoot = (SwFmtFooter&)rPageDesc.GetLeft().GetFooter(); + SwFormatHeader& rHead = (SwFormatHeader&)rPageDesc.GetMaster().GetHeader(); + SwFormatFooter& rFoot = (SwFormatFooter&)rPageDesc.GetMaster().GetFooter(); + SwFormatHeader& rLeftHead = (SwFormatHeader&)rPageDesc.GetLeft().GetHeader(); + SwFormatFooter& rLeftFoot = (SwFormatFooter&)rPageDesc.GetLeft().GetFooter(); if( rHead.IsActive() ) { - SwFrmFmt* pHeaderFmt = rHead.GetHeaderFmt(); - if( pHeaderFmt ) + SwFrameFormat* pHeaderFormat = rHead.GetHeaderFormat(); + if( pHeaderFormat ) { - const SwFmtCntnt* pCntnt = &pHeaderFmt->GetCntnt(); - if( pCntnt->GetCntntIdx() ) - nHeaderMaster = pCntnt->GetCntntIdx()->GetIndex(); + const SwFormatContent* pContent = &pHeaderFormat->GetContent(); + if( pContent->GetContentIdx() ) + nHeaderMaster = pContent->GetContentIdx()->GetIndex(); else nHeaderMaster = 0; } - SwFrmFmt* pLeftHeaderFmt = rLeftHead.GetHeaderFmt(); - if( pLeftHeaderFmt ) + SwFrameFormat* pLeftHeaderFormat = rLeftHead.GetHeaderFormat(); + if( pLeftHeaderFormat ) { - const SwFmtCntnt* pLeftCntnt = &pLeftHeaderFmt->GetCntnt(); - if( pLeftCntnt->GetCntntIdx() ) - nHeaderLeft = pLeftCntnt->GetCntntIdx()->GetIndex(); + const SwFormatContent* pLeftContent = &pLeftHeaderFormat->GetContent(); + if( pLeftContent->GetContentIdx() ) + nHeaderLeft = pLeftContent->GetContentIdx()->GetIndex(); else nHeaderLeft = 0; } } if( rFoot.IsActive() ) { - SwFrmFmt* pFooterFmt = rFoot.GetFooterFmt(); - if( pFooterFmt ) + SwFrameFormat* pFooterFormat = rFoot.GetFooterFormat(); + if( pFooterFormat ) { - const SwFmtCntnt* pCntnt = &pFooterFmt->GetCntnt(); - if( pCntnt->GetCntntIdx() ) - nFooterMaster = pCntnt->GetCntntIdx()->GetIndex(); + const SwFormatContent* pContent = &pFooterFormat->GetContent(); + if( pContent->GetContentIdx() ) + nFooterMaster = pContent->GetContentIdx()->GetIndex(); else nFooterMaster = 0; } - SwFrmFmt* pLeftFooterFmt = rLeftFoot.GetFooterFmt(); - if( pLeftFooterFmt ) + SwFrameFormat* pLeftFooterFormat = rLeftFoot.GetFooterFormat(); + if( pLeftFooterFormat ) { - const SwFmtCntnt* pLeftCntnt = &pLeftFooterFmt->GetCntnt(); - if( pLeftCntnt->GetCntntIdx() ) - nFooterLeft = pLeftCntnt->GetCntntIdx()->GetIndex(); + const SwFormatContent* pLeftContent = &pLeftFooterFormat->GetContent(); + if( pLeftContent->GetContentIdx() ) + nFooterLeft = pLeftContent->GetContentIdx()->GetIndex(); else nFooterLeft = 0; } @@ -120,10 +120,10 @@ SwUndoPageDesc::SwUndoPageDesc(const SwPageDesc & _aOld, */ SwPageDesc &rOldDesc = aOld.m_PageDesc; SwPageDesc &rNewDesc = aNew.m_PageDesc; - const SwFmtHeader& rOldHead = rOldDesc.GetMaster().GetHeader(); - const SwFmtHeader& rNewHead = rNewDesc.GetMaster().GetHeader(); - const SwFmtFooter& rOldFoot = rOldDesc.GetMaster().GetFooter(); - const SwFmtFooter& rNewFoot = rNewDesc.GetMaster().GetFooter(); + const SwFormatHeader& rOldHead = rOldDesc.GetMaster().GetHeader(); + const SwFormatHeader& rNewHead = rNewDesc.GetMaster().GetHeader(); + const SwFormatFooter& rOldFoot = rOldDesc.GetMaster().GetFooter(); + const SwFormatFooter& rNewFoot = rNewDesc.GetMaster().GetFooter(); /* bExchange must not be set, if the old page descriptor will stay active. Two known situations: #i67735#: renaming a page descriptor @@ -144,39 +144,39 @@ SwUndoPageDesc::SwUndoPageDesc(const SwPageDesc & _aOld, { if( rNewHead.IsActive() ) { - SwFrmFmt* pFormat = new SwFrmFmt( *rNewHead.GetHeaderFmt() ); + SwFrameFormat* pFormat = new SwFrameFormat( *rNewHead.GetHeaderFormat() ); // The Ctor of this object will remove the duplicate! - SwFmtHeader aFormatHeader(pFormat); + SwFormatHeader aFormatHeader(pFormat); if (!rNewDesc.IsHeaderShared()) { - pFormat = new SwFrmFmt( *rNewDesc.GetLeft().GetHeader().GetHeaderFmt() ); + pFormat = new SwFrameFormat( *rNewDesc.GetLeft().GetHeader().GetHeaderFormat() ); // The Ctor of this object will remove the duplicate! - SwFmtHeader aLeftHeader(pFormat); + SwFormatHeader aLeftHeader(pFormat); } if (!rNewDesc.IsFirstShared()) { - pFormat = new SwFrmFmt( *rNewDesc.GetFirstMaster().GetHeader().GetHeaderFmt() ); + pFormat = new SwFrameFormat( *rNewDesc.GetFirstMaster().GetHeader().GetHeaderFormat() ); // The Ctor of this object will remove the duplicate! - SwFmtHeader aFirstHeader(pFormat); + SwFormatHeader aFirstHeader(pFormat); } } // Same procedure for footers... if( rNewFoot.IsActive() ) { - SwFrmFmt* pFormat = new SwFrmFmt( *rNewFoot.GetFooterFmt() ); + SwFrameFormat* pFormat = new SwFrameFormat( *rNewFoot.GetFooterFormat() ); // The Ctor of this object will remove the duplicate! - SwFmtFooter aFormatFooter(pFormat); + SwFormatFooter aFormatFooter(pFormat); if (!rNewDesc.IsFooterShared()) { - pFormat = new SwFrmFmt( *rNewDesc.GetLeft().GetFooter().GetFooterFmt() ); + pFormat = new SwFrameFormat( *rNewDesc.GetLeft().GetFooter().GetFooterFormat() ); // The Ctor of this object will remove the duplicate! - SwFmtFooter aLeftFooter(pFormat); + SwFormatFooter aLeftFooter(pFormat); } if (!rNewDesc.IsFirstShared()) { - pFormat = new SwFrmFmt( *rNewDesc.GetFirstMaster().GetFooter().GetFooterFmt() ); + pFormat = new SwFrameFormat( *rNewDesc.GetFirstMaster().GetFooter().GetFooterFormat() ); // The Ctor of this object will remove the duplicate! - SwFmtFooter aFirstFooter(pFormat); + SwFormatFooter aFirstFooter(pFormat); } } @@ -197,8 +197,8 @@ SwUndoPageDesc::~SwUndoPageDesc() void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDest ) { OSL_ENSURE( bExchange, "You shouldn't do that." ); - const SwFmtHeader& rDestHead = rDest.GetMaster().GetHeader(); - const SwFmtHeader& rSourceHead = rSource.GetMaster().GetHeader(); + const SwFormatHeader& rDestHead = rDest.GetMaster().GetHeader(); + const SwFormatHeader& rSourceHead = rSource.GetMaster().GetHeader(); if( rDestHead.IsActive() ) { // Let the destination page description point to the source node position, @@ -206,131 +206,131 @@ void SwUndoPageDesc::ExchangeContentNodes( SwPageDesc& rSource, SwPageDesc &rDes const SfxPoolItem* pItem; rDest.GetMaster().GetAttrSet().GetItemState( RES_HEADER, false, &pItem ); SfxPoolItem *pNewItem = pItem->Clone(); - SwFrmFmt* pNewFmt = static_cast<SwFmtHeader*>(pNewItem)->GetHeaderFmt(); + SwFrameFormat* pNewFormat = static_cast<SwFormatHeader*>(pNewItem)->GetHeaderFormat(); #if OSL_DEBUG_LEVEL > 1 - const SwFmtCntnt& rSourceCntnt = rSourceHead.GetHeaderFmt()->GetCntnt(); - (void)rSourceCntnt; - const SwFmtCntnt& rDestCntnt = rDestHead.GetHeaderFmt()->GetCntnt(); - (void)rDestCntnt; + const SwFormatContent& rSourceContent = rSourceHead.GetHeaderFormat()->GetContent(); + (void)rSourceContent; + const SwFormatContent& rDestContent = rDestHead.GetHeaderFormat()->GetContent(); + (void)rDestContent; #endif - pNewFmt->SetFmtAttr( rSourceHead.GetHeaderFmt()->GetCntnt() ); + pNewFormat->SetFormatAttr( rSourceHead.GetHeaderFormat()->GetContent() ); delete pNewItem; // Let the source page description point to zero node position, // it loses the responsible and can be destroyed without removing the content nodes. rSource.GetMaster().GetAttrSet().GetItemState( RES_HEADER, false, &pItem ); pNewItem = pItem->Clone(); - pNewFmt = static_cast<SwFmtHeader*>(pNewItem)->GetHeaderFmt(); - pNewFmt->SetFmtAttr( SwFmtCntnt() ); + pNewFormat = static_cast<SwFormatHeader*>(pNewItem)->GetHeaderFormat(); + pNewFormat->SetFormatAttr( SwFormatContent() ); delete pNewItem; if( !rDest.IsHeaderShared() ) { // Same procedure for unshared header.. - const SwFmtHeader& rSourceLeftHead = rSource.GetLeft().GetHeader(); + const SwFormatHeader& rSourceLeftHead = rSource.GetLeft().GetHeader(); rDest.GetLeft().GetAttrSet().GetItemState( RES_HEADER, false, &pItem ); pNewItem = pItem->Clone(); - pNewFmt = static_cast<SwFmtHeader*>(pNewItem)->GetHeaderFmt(); + pNewFormat = static_cast<SwFormatHeader*>(pNewItem)->GetHeaderFormat(); #if OSL_DEBUG_LEVEL > 1 - const SwFmtCntnt& rSourceCntnt1 = rSourceLeftHead.GetHeaderFmt()->GetCntnt(); - (void)rSourceCntnt1; - const SwFmtCntnt& rDestCntnt1 = rDest.GetLeft().GetHeader().GetHeaderFmt()->GetCntnt(); - (void)rDestCntnt1; + const SwFormatContent& rSourceContent1 = rSourceLeftHead.GetHeaderFormat()->GetContent(); + (void)rSourceContent1; + const SwFormatContent& rDestContent1 = rDest.GetLeft().GetHeader().GetHeaderFormat()->GetContent(); + (void)rDestContent1; #endif - pNewFmt->SetFmtAttr( rSourceLeftHead.GetHeaderFmt()->GetCntnt() ); + pNewFormat->SetFormatAttr( rSourceLeftHead.GetHeaderFormat()->GetContent() ); delete pNewItem; rSource.GetLeft().GetAttrSet().GetItemState( RES_HEADER, false, &pItem ); pNewItem = pItem->Clone(); - pNewFmt = static_cast<SwFmtHeader*>(pNewItem)->GetHeaderFmt(); - pNewFmt->SetFmtAttr( SwFmtCntnt() ); + pNewFormat = static_cast<SwFormatHeader*>(pNewItem)->GetHeaderFormat(); + pNewFormat->SetFormatAttr( SwFormatContent() ); delete pNewItem; } if (!rDest.IsFirstShared()) { // Same procedure for unshared header.. - const SwFmtHeader& rSourceFirstMasterHead = rSource.GetFirstMaster().GetHeader(); + const SwFormatHeader& rSourceFirstMasterHead = rSource.GetFirstMaster().GetHeader(); rDest.GetFirstMaster().GetAttrSet().GetItemState( RES_HEADER, false, &pItem ); pNewItem = pItem->Clone(); - pNewFmt = static_cast<SwFmtHeader*>(pNewItem)->GetHeaderFmt(); + pNewFormat = static_cast<SwFormatHeader*>(pNewItem)->GetHeaderFormat(); #if OSL_DEBUG_LEVEL > 1 - const SwFmtCntnt& rSourceCntnt1 = rSourceFirstMasterHead.GetHeaderFmt()->GetCntnt(); - (void)rSourceCntnt1; - const SwFmtCntnt& rDestCntnt1 = rDest.GetFirstMaster().GetHeader().GetHeaderFmt()->GetCntnt(); - (void)rDestCntnt1; + const SwFormatContent& rSourceContent1 = rSourceFirstMasterHead.GetHeaderFormat()->GetContent(); + (void)rSourceContent1; + const SwFormatContent& rDestContent1 = rDest.GetFirstMaster().GetHeader().GetHeaderFormat()->GetContent(); + (void)rDestContent1; #endif - pNewFmt->SetFmtAttr( rSourceFirstMasterHead.GetHeaderFmt()->GetCntnt() ); + pNewFormat->SetFormatAttr( rSourceFirstMasterHead.GetHeaderFormat()->GetContent() ); delete pNewItem; rSource.GetFirstMaster().GetAttrSet().GetItemState( RES_HEADER, false, &pItem ); pNewItem = pItem->Clone(); - pNewFmt = static_cast<SwFmtHeader*>(pNewItem)->GetHeaderFmt(); - pNewFmt->SetFmtAttr( SwFmtCntnt() ); + pNewFormat = static_cast<SwFormatHeader*>(pNewItem)->GetHeaderFormat(); + pNewFormat->SetFormatAttr( SwFormatContent() ); delete pNewItem; } } // Same procedure for footers... - const SwFmtFooter& rDestFoot = rDest.GetMaster().GetFooter(); - const SwFmtFooter& rSourceFoot = rSource.GetMaster().GetFooter(); + const SwFormatFooter& rDestFoot = rDest.GetMaster().GetFooter(); + const SwFormatFooter& rSourceFoot = rSource.GetMaster().GetFooter(); if( rDestFoot.IsActive() ) { const SfxPoolItem* pItem; rDest.GetMaster().GetAttrSet().GetItemState( RES_FOOTER, false, &pItem ); SfxPoolItem *pNewItem = pItem->Clone(); - SwFrmFmt *pNewFmt = static_cast<SwFmtFooter*>(pNewItem)->GetFooterFmt(); - pNewFmt->SetFmtAttr( rSourceFoot.GetFooterFmt()->GetCntnt() ); + SwFrameFormat *pNewFormat = static_cast<SwFormatFooter*>(pNewItem)->GetFooterFormat(); + pNewFormat->SetFormatAttr( rSourceFoot.GetFooterFormat()->GetContent() ); delete pNewItem; #if OSL_DEBUG_LEVEL > 1 - const SwFmtCntnt& rFooterSourceCntnt = rSourceFoot.GetFooterFmt()->GetCntnt(); - (void)rFooterSourceCntnt; - const SwFmtCntnt& rFooterDestCntnt = rDestFoot.GetFooterFmt()->GetCntnt(); - (void)rFooterDestCntnt; + const SwFormatContent& rFooterSourceContent = rSourceFoot.GetFooterFormat()->GetContent(); + (void)rFooterSourceContent; + const SwFormatContent& rFooterDestContent = rDestFoot.GetFooterFormat()->GetContent(); + (void)rFooterDestContent; #endif rSource.GetMaster().GetAttrSet().GetItemState( RES_FOOTER, false, &pItem ); pNewItem = pItem->Clone(); - pNewFmt = static_cast<SwFmtFooter*>(pNewItem)->GetFooterFmt(); - pNewFmt->SetFmtAttr( SwFmtCntnt() ); + pNewFormat = static_cast<SwFormatFooter*>(pNewItem)->GetFooterFormat(); + pNewFormat->SetFormatAttr( SwFormatContent() ); delete pNewItem; if( !rDest.IsFooterShared() ) { - const SwFmtFooter& rSourceLeftFoot = rSource.GetLeft().GetFooter(); + const SwFormatFooter& rSourceLeftFoot = rSource.GetLeft().GetFooter(); #if OSL_DEBUG_LEVEL > 1 - const SwFmtCntnt& rFooterSourceCntnt2 = rSourceLeftFoot.GetFooterFmt()->GetCntnt(); - const SwFmtCntnt& rFooterDestCntnt2 = - rDest.GetLeft().GetFooter().GetFooterFmt()->GetCntnt(); - (void)rFooterSourceCntnt2; - (void)rFooterDestCntnt2; + const SwFormatContent& rFooterSourceContent2 = rSourceLeftFoot.GetFooterFormat()->GetContent(); + const SwFormatContent& rFooterDestContent2 = + rDest.GetLeft().GetFooter().GetFooterFormat()->GetContent(); + (void)rFooterSourceContent2; + (void)rFooterDestContent2; #endif rDest.GetLeft().GetAttrSet().GetItemState( RES_FOOTER, false, &pItem ); pNewItem = pItem->Clone(); - pNewFmt = static_cast<SwFmtFooter*>(pNewItem)->GetFooterFmt(); - pNewFmt->SetFmtAttr( rSourceLeftFoot.GetFooterFmt()->GetCntnt() ); + pNewFormat = static_cast<SwFormatFooter*>(pNewItem)->GetFooterFormat(); + pNewFormat->SetFormatAttr( rSourceLeftFoot.GetFooterFormat()->GetContent() ); delete pNewItem; rSource.GetLeft().GetAttrSet().GetItemState( RES_FOOTER, false, &pItem ); pNewItem = pItem->Clone(); - pNewFmt = static_cast<SwFmtFooter*>(pNewItem)->GetFooterFmt(); - pNewFmt->SetFmtAttr( SwFmtCntnt() ); + pNewFormat = static_cast<SwFormatFooter*>(pNewItem)->GetFooterFormat(); + pNewFormat->SetFormatAttr( SwFormatContent() ); delete pNewItem; } if (!rDest.IsFirstShared()) { - const SwFmtFooter& rSourceFirstMasterFoot = rSource.GetFirstMaster().GetFooter(); + const SwFormatFooter& rSourceFirstMasterFoot = rSource.GetFirstMaster().GetFooter(); #if OSL_DEBUG_LEVEL > 1 - const SwFmtCntnt& rFooterSourceCntnt2 = rSourceFirstMasterFoot.GetFooterFmt()->GetCntnt(); - const SwFmtCntnt& rFooterDestCntnt2 = - rDest.GetFirstMaster().GetFooter().GetFooterFmt()->GetCntnt(); - (void)rFooterSourceCntnt2; - (void)rFooterDestCntnt2; + const SwFormatContent& rFooterSourceContent2 = rSourceFirstMasterFoot.GetFooterFormat()->GetContent(); + const SwFormatContent& rFooterDestContent2 = + rDest.GetFirstMaster().GetFooter().GetFooterFormat()->GetContent(); + (void)rFooterSourceContent2; + (void)rFooterDestContent2; #endif rDest.GetFirstMaster().GetAttrSet().GetItemState( RES_FOOTER, false, &pItem ); pNewItem = pItem->Clone(); - pNewFmt = static_cast<SwFmtFooter*>(pNewItem)->GetFooterFmt(); - pNewFmt->SetFmtAttr( rSourceFirstMasterFoot.GetFooterFmt()->GetCntnt() ); + pNewFormat = static_cast<SwFormatFooter*>(pNewItem)->GetFooterFormat(); + pNewFormat->SetFormatAttr( rSourceFirstMasterFoot.GetFooterFormat()->GetContent() ); delete pNewItem; rSource.GetFirstMaster().GetAttrSet().GetItemState( RES_FOOTER, false, &pItem ); pNewItem = pItem->Clone(); - pNewFmt = static_cast<SwFmtFooter*>(pNewItem)->GetFooterFmt(); - pNewFmt->SetFmtAttr( SwFmtCntnt() ); + pNewFormat = static_cast<SwFormatFooter*>(pNewItem)->GetFooterFormat(); + pNewFormat->SetFormatAttr( SwFormatContent() ); delete pNewItem; } } diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index dc726a5cfe67..9a40d8cc3f8a 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -63,37 +63,37 @@ OUString SwHistoryHint::GetDescription() const return OUString(); } -SwHistorySetFmt::SwHistorySetFmt( const SfxPoolItem* pFmtHt, sal_uLong nNd ) +SwHistorySetFormat::SwHistorySetFormat( const SfxPoolItem* pFormatHt, sal_uLong nNd ) : SwHistoryHint( HSTRY_SETFMTHNT ) - , m_pAttr( pFmtHt->Clone() ) + , m_pAttr( pFormatHt->Clone() ) , m_nNodeIndex( nNd ) { switch ( m_pAttr->Which() ) { case RES_PAGEDESC: - static_cast<SwFmtPageDesc&>(*m_pAttr).ChgDefinedIn( 0 ); + static_cast<SwFormatPageDesc&>(*m_pAttr).ChgDefinedIn( 0 ); break; case RES_PARATR_DROP: - static_cast<SwFmtDrop&>(*m_pAttr).ChgDefinedIn( 0 ); + static_cast<SwFormatDrop&>(*m_pAttr).ChgDefinedIn( 0 ); break; case RES_BOXATR_FORMULA: { // save formulas always in plain text - SwTblBoxFormula& rNew = static_cast<SwTblBoxFormula&>(*m_pAttr); + SwTableBoxFormula& rNew = static_cast<SwTableBoxFormula&>(*m_pAttr); if ( rNew.IsIntrnlName() ) { - const SwTblBoxFormula& rOld = - *static_cast<const SwTblBoxFormula*>(pFmtHt); + const SwTableBoxFormula& rOld = + *static_cast<const SwTableBoxFormula*>(pFormatHt); const SwNode* pNd = rOld.GetNodeOfFormula(); if ( pNd ) { const SwTableNode* pTableNode = pNd->FindTableNode(); if (pTableNode) { - SwTableFmlUpdate aMsgHnt( &pTableNode->GetTable() ); - aMsgHnt.eFlags = TBL_BOXNAME; + SwTableFormulaUpdate aMsgHint( &pTableNode->GetTable() ); + aMsgHint.eFlags = TBL_BOXNAME; rNew.ChgDefinedIn( rOld.GetDefinedIn() ); - rNew.ChangeState( &aMsgHnt ); + rNew.ChangeState( &aMsgHint ); } } } @@ -103,14 +103,14 @@ SwHistorySetFmt::SwHistorySetFmt( const SfxPoolItem* pFmtHt, sal_uLong nNd ) } } -OUString SwHistorySetFmt::GetDescription() const +OUString SwHistorySetFormat::GetDescription() const { OUString aResult; switch (m_pAttr->Which()) { case RES_BREAK: - switch ((static_cast<SvxFmtBreakItem &>(*m_pAttr)).GetBreak()) + switch ((static_cast<SvxFormatBreakItem &>(*m_pAttr)).GetBreak()) { case SVX_BREAK_PAGE_BEFORE: case SVX_BREAK_PAGE_AFTER: @@ -135,16 +135,16 @@ OUString SwHistorySetFmt::GetDescription() const return aResult; } -void SwHistorySetFmt::SetInDoc( SwDoc* pDoc, bool bTmpSet ) +void SwHistorySetFormat::SetInDoc( SwDoc* pDoc, bool bTmpSet ) { SwNode * pNode = pDoc->GetNodes()[ m_nNodeIndex ]; - if ( pNode->IsCntntNode() ) + if ( pNode->IsContentNode() ) { - static_cast<SwCntntNode*>(pNode)->SetAttr( *m_pAttr ); + static_cast<SwContentNode*>(pNode)->SetAttr( *m_pAttr ); } else if ( pNode->IsTableNode() ) { - static_cast<SwTableNode*>(pNode)->GetTable().GetFrmFmt()->SetFmtAttr( + static_cast<SwTableNode*>(pNode)->GetTable().GetFrameFormat()->SetFormatAttr( *m_pAttr ); } else if ( pNode->IsStartNode() && (SwTableBoxStartNode == @@ -153,10 +153,10 @@ void SwHistorySetFmt::SetInDoc( SwDoc* pDoc, bool bTmpSet ) SwTableNode* pTNd = pNode->FindTableNode(); if ( pTNd ) { - SwTableBox* pBox = pTNd->GetTable().GetTblBox( m_nNodeIndex ); + SwTableBox* pBox = pTNd->GetTable().GetTableBox( m_nNodeIndex ); if (pBox) { - pBox->ClaimFrmFmt()->SetFmtAttr( *m_pAttr ); + pBox->ClaimFrameFormat()->SetFormatAttr( *m_pAttr ); } } } @@ -167,38 +167,38 @@ void SwHistorySetFmt::SetInDoc( SwDoc* pDoc, bool bTmpSet ) } } -SwHistorySetFmt::~SwHistorySetFmt() +SwHistorySetFormat::~SwHistorySetFormat() { } -SwHistoryResetFmt::SwHistoryResetFmt(const SfxPoolItem* pFmtHt, sal_uLong nNodeIdx) +SwHistoryResetFormat::SwHistoryResetFormat(const SfxPoolItem* pFormatHt, sal_uLong nNodeIdx) : SwHistoryHint( HSTRY_RESETFMTHNT ) , m_nNodeIndex( nNodeIdx ) - , m_nWhich( pFmtHt->Which() ) + , m_nWhich( pFormatHt->Which() ) { } -void SwHistoryResetFmt::SetInDoc( SwDoc* pDoc, bool ) +void SwHistoryResetFormat::SetInDoc( SwDoc* pDoc, bool ) { SwNode * pNode = pDoc->GetNodes()[ m_nNodeIndex ]; - if ( pNode->IsCntntNode() ) + if ( pNode->IsContentNode() ) { - static_cast<SwCntntNode*>(pNode)->ResetAttr( m_nWhich ); + static_cast<SwContentNode*>(pNode)->ResetAttr( m_nWhich ); } else if ( pNode->IsTableNode() ) { - static_cast<SwTableNode*>(pNode)->GetTable().GetFrmFmt()-> - ResetFmtAttr( m_nWhich ); + static_cast<SwTableNode*>(pNode)->GetTable().GetFrameFormat()-> + ResetFormatAttr( m_nWhich ); } } -SwHistorySetTxt::SwHistorySetTxt( SwTxtAttr* pTxtHt, sal_uLong nNodePos ) +SwHistorySetText::SwHistorySetText( SwTextAttr* pTextHt, sal_uLong nNodePos ) : SwHistoryHint( HSTRY_SETTXTHNT ) , m_nNodeIndex( nNodePos ) - , m_nStart( pTxtHt->GetStart() ) - , m_nEnd( *pTxtHt->GetAnyEnd() ) - , m_bFormatIgnoreStart(pTxtHt->IsFormatIgnoreStart()) - , m_bFormatIgnoreEnd (pTxtHt->IsFormatIgnoreEnd ()) + , m_nStart( pTextHt->GetStart() ) + , m_nEnd( *pTextHt->GetAnyEnd() ) + , m_bFormatIgnoreStart(pTextHt->IsFormatIgnoreStart()) + , m_bFormatIgnoreEnd (pTextHt->IsFormatIgnoreEnd ()) { // Caution: the following attributes generate no format attributes: // - NoLineBreak, NoHypen, Inserted, Deleted @@ -206,38 +206,38 @@ SwHistorySetTxt::SwHistorySetTxt( SwTxtAttr* pTxtHt, sal_uLong nNodePos ) // a little bit complicated but works: first assign a copy of the // default value and afterwards the values from text attribute - if ( RES_TXTATR_CHARFMT == pTxtHt->Which() ) + if ( RES_TXTATR_CHARFMT == pTextHt->Which() ) { - m_pAttr.reset( new SwFmtCharFmt( pTxtHt->GetCharFmt().GetCharFmt() ) ); + m_pAttr.reset( new SwFormatCharFormat( pTextHt->GetCharFormat().GetCharFormat() ) ); } else { - m_pAttr.reset( pTxtHt->GetAttr().Clone() ); + m_pAttr.reset( pTextHt->GetAttr().Clone() ); } } -SwHistorySetTxt::~SwHistorySetTxt() +SwHistorySetText::~SwHistorySetText() { } -void SwHistorySetTxt::SetInDoc( SwDoc* pDoc, bool ) +void SwHistorySetText::SetInDoc( SwDoc* pDoc, bool ) { if ( !m_pAttr.get() ) return; if ( RES_TXTATR_CHARFMT == m_pAttr->Which() ) { - // ask the Doc if the CharFmt still exists - if ( !pDoc->GetCharFmts()->Contains( (static_cast<SwFmtCharFmt&>(*m_pAttr)).GetCharFmt() ) ) + // ask the Doc if the CharFormat still exists + if ( !pDoc->GetCharFormats()->Contains( (static_cast<SwFormatCharFormat&>(*m_pAttr)).GetCharFormat() ) ) return; // do not set, format does not exist } - SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode(); - OSL_ENSURE( pTxtNd, "SwHistorySetTxt::SetInDoc: not a TextNode" ); + SwTextNode * pTextNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTextNode(); + OSL_ENSURE( pTextNd, "SwHistorySetText::SetInDoc: not a TextNode" ); - if ( pTxtNd ) + if ( pTextNd ) { - SwTxtAttr *const pAttr = pTxtNd->InsertItem(*m_pAttr, m_nStart, m_nEnd, + SwTextAttr *const pAttr = pTextNd->InsertItem(*m_pAttr, m_nStart, m_nEnd, SetAttrMode::NOTXTATRCHR | SetAttrMode::NOHINTADJUST ); // shouldn't be possible to hit any error/merging path from here @@ -253,108 +253,108 @@ void SwHistorySetTxt::SetInDoc( SwDoc* pDoc, bool ) } } -SwHistorySetTxtFld::SwHistorySetTxtFld( SwTxtFld* pTxtFld, sal_uLong nNodePos ) +SwHistorySetTextField::SwHistorySetTextField( SwTextField* pTextField, sal_uLong nNodePos ) : SwHistoryHint( HSTRY_SETTXTFLDHNT ) - , m_pFld( new SwFmtFld( *pTxtFld->GetFmtFld().GetField() ) ) + , m_pField( new SwFormatField( *pTextField->GetFormatField().GetField() ) ) { // only copy if not Sys-FieldType - SwDoc* pDoc = pTxtFld->GetTxtNode().GetDoc(); - - m_nFldWhich = m_pFld->GetField()->GetTyp()->Which(); - if (m_nFldWhich == RES_DBFLD || - m_nFldWhich == RES_USERFLD || - m_nFldWhich == RES_SETEXPFLD || - m_nFldWhich == RES_DDEFLD || - !pDoc->getIDocumentFieldsAccess().GetSysFldType( m_nFldWhich )) + SwDoc* pDoc = pTextField->GetTextNode().GetDoc(); + + m_nFieldWhich = m_pField->GetField()->GetTyp()->Which(); + if (m_nFieldWhich == RES_DBFLD || + m_nFieldWhich == RES_USERFLD || + m_nFieldWhich == RES_SETEXPFLD || + m_nFieldWhich == RES_DDEFLD || + !pDoc->getIDocumentFieldsAccess().GetSysFieldType( m_nFieldWhich )) { - m_pFldType.reset( m_pFld->GetField()->GetTyp()->Copy() ); - m_pFld->GetField()->ChgTyp( m_pFldType.get() ); // change field type + m_pFieldType.reset( m_pField->GetField()->GetTyp()->Copy() ); + m_pField->GetField()->ChgTyp( m_pFieldType.get() ); // change field type } m_nNodeIndex = nNodePos; - m_nPos = pTxtFld->GetStart(); + m_nPos = pTextField->GetStart(); } -OUString SwHistorySetTxtFld::GetDescription() const +OUString SwHistorySetTextField::GetDescription() const { - return m_pFld->GetField()->GetDescription(); + return m_pField->GetField()->GetDescription(); } -SwHistorySetTxtFld::~SwHistorySetTxtFld() +SwHistorySetTextField::~SwHistorySetTextField() { } -void SwHistorySetTxtFld::SetInDoc( SwDoc* pDoc, bool ) +void SwHistorySetTextField::SetInDoc( SwDoc* pDoc, bool ) { - if ( !m_pFld.get() ) + if ( !m_pField.get() ) return; - SwFieldType* pNewFldType = m_pFldType.get(); - if ( !pNewFldType ) + SwFieldType* pNewFieldType = m_pFieldType.get(); + if ( !pNewFieldType ) { - pNewFldType = pDoc->getIDocumentFieldsAccess().GetSysFldType( m_nFldWhich ); + pNewFieldType = pDoc->getIDocumentFieldsAccess().GetSysFieldType( m_nFieldWhich ); } else { // register type with the document - pNewFldType = pDoc->getIDocumentFieldsAccess().InsertFldType( *m_pFldType ); + pNewFieldType = pDoc->getIDocumentFieldsAccess().InsertFieldType( *m_pFieldType ); } - m_pFld->GetField()->ChgTyp( pNewFldType ); // change field type + m_pField->GetField()->ChgTyp( pNewFieldType ); // change field type - SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode(); - OSL_ENSURE( pTxtNd, "SwHistorySetTxtFld: no TextNode" ); + SwTextNode * pTextNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTextNode(); + OSL_ENSURE( pTextNd, "SwHistorySetTextField: no TextNode" ); - if ( pTxtNd ) + if ( pTextNd ) { - pTxtNd->InsertItem( *m_pFld, m_nPos, m_nPos, + pTextNd->InsertItem( *m_pField, m_nPos, m_nPos, SetAttrMode::NOTXTATRCHR ); } } -SwHistorySetRefMark::SwHistorySetRefMark( SwTxtRefMark* pTxtHt, sal_uLong nNodePos ) +SwHistorySetRefMark::SwHistorySetRefMark( SwTextRefMark* pTextHt, sal_uLong nNodePos ) : SwHistoryHint( HSTRY_SETREFMARKHNT ) - , m_RefName( pTxtHt->GetRefMark().GetRefName() ) + , m_RefName( pTextHt->GetRefMark().GetRefName() ) , m_nNodeIndex( nNodePos ) - , m_nStart( pTxtHt->GetStart() ) - , m_nEnd( *pTxtHt->GetAnyEnd() ) + , m_nStart( pTextHt->GetStart() ) + , m_nEnd( *pTextHt->GetAnyEnd() ) { } void SwHistorySetRefMark::SetInDoc( SwDoc* pDoc, bool ) { - SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode(); - OSL_ENSURE( pTxtNd, "SwHistorySetRefMark: no TextNode" ); - if ( !pTxtNd ) + SwTextNode * pTextNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTextNode(); + OSL_ENSURE( pTextNd, "SwHistorySetRefMark: no TextNode" ); + if ( !pTextNd ) return; - SwFmtRefMark aRefMark( m_RefName ); + SwFormatRefMark aRefMark( m_RefName ); // if a reference mark without an end already exists here: must not insert! if ( m_nStart != m_nEnd || - !pTxtNd->GetTxtAttrForCharAt( m_nStart, RES_TXTATR_REFMARK ) ) + !pTextNd->GetTextAttrForCharAt( m_nStart, RES_TXTATR_REFMARK ) ) { - pTxtNd->InsertItem( aRefMark, m_nStart, m_nEnd, + pTextNd->InsertItem( aRefMark, m_nStart, m_nEnd, SetAttrMode::NOTXTATRCHR ); } } -SwHistorySetTOXMark::SwHistorySetTOXMark( SwTxtTOXMark* pTxtHt, sal_uLong nNodePos ) +SwHistorySetTOXMark::SwHistorySetTOXMark( SwTextTOXMark* pTextHt, sal_uLong nNodePos ) : SwHistoryHint( HSTRY_SETTOXMARKHNT ) - , m_TOXMark( pTxtHt->GetTOXMark() ) + , m_TOXMark( pTextHt->GetTOXMark() ) , m_TOXName( m_TOXMark.GetTOXType()->GetTypeName() ) , m_eTOXTypes( m_TOXMark.GetTOXType()->GetType() ) , m_nNodeIndex( nNodePos ) - , m_nStart( pTxtHt->GetStart() ) - , m_nEnd( *pTxtHt->GetAnyEnd() ) + , m_nStart( pTextHt->GetStart() ) + , m_nEnd( *pTextHt->GetAnyEnd() ) { m_TOXMark.DeRegister(); } void SwHistorySetTOXMark::SetInDoc( SwDoc* pDoc, bool ) { - SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode(); - OSL_ENSURE( pTxtNd, "SwHistorySetTOXMark: no TextNode" ); - if ( !pTxtNd ) + SwTextNode * pTextNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTextNode(); + OSL_ENSURE( pTextNd, "SwHistorySetTOXMark: no TextNode" ); + if ( !pTextNd ) return; // search for respective TOX type @@ -377,7 +377,7 @@ void SwHistorySetTOXMark::SetInDoc( SwDoc* pDoc, bool ) SwTOXMark aNew( m_TOXMark ); aNew.RegisterToTOXType( *pToxType ); - pTxtNd->InsertItem( aNew, m_nStart, m_nEnd, + pTextNd->InsertItem( aNew, m_nStart, m_nEnd, SetAttrMode::NOTXTATRCHR ); } @@ -393,7 +393,7 @@ bool SwHistorySetTOXMark::IsEqual( const SwTOXMark& rCmp ) const ); } -SwHistoryResetTxt::SwHistoryResetTxt( sal_uInt16 nWhich, +SwHistoryResetText::SwHistoryResetText( sal_uInt16 nWhich, sal_Int32 nAttrStart, sal_Int32 nAttrEnd, sal_uLong nNodePos ) : SwHistoryHint( HSTRY_RESETTXTHNT ) , m_nNodeIndex( nNodePos ), m_nStart( nAttrStart ), m_nEnd( nAttrEnd ) @@ -401,49 +401,49 @@ SwHistoryResetTxt::SwHistoryResetTxt( sal_uInt16 nWhich, { } -void SwHistoryResetTxt::SetInDoc( SwDoc* pDoc, bool ) +void SwHistoryResetText::SetInDoc( SwDoc* pDoc, bool ) { - SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode(); - OSL_ENSURE( pTxtNd, "SwHistoryResetTxt: no TextNode" ); - if ( pTxtNd ) + SwTextNode * pTextNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTextNode(); + OSL_ENSURE( pTextNd, "SwHistoryResetText: no TextNode" ); + if ( pTextNd ) { - pTxtNd->DeleteAttributes( m_nAttr, m_nStart, m_nEnd ); + pTextNd->DeleteAttributes( m_nAttr, m_nStart, m_nEnd ); } } -SwHistorySetFootnote::SwHistorySetFootnote( SwTxtFtn* pTxtFtn, sal_uLong nNodePos ) +SwHistorySetFootnote::SwHistorySetFootnote( SwTextFootnote* pTextFootnote, sal_uLong nNodePos ) : SwHistoryHint( HSTRY_SETFTNHNT ) , m_pUndo( new SwUndoSaveSection ) - , m_FootnoteNumber( pTxtFtn->GetFtn().GetNumStr() ) + , m_FootnoteNumber( pTextFootnote->GetFootnote().GetNumStr() ) , m_nNodeIndex( nNodePos ) - , m_nStart( pTxtFtn->GetStart() ) - , m_bEndNote( pTxtFtn->GetFtn().IsEndNote() ) + , m_nStart( pTextFootnote->GetStart() ) + , m_bEndNote( pTextFootnote->GetFootnote().IsEndNote() ) { - OSL_ENSURE( pTxtFtn->GetStartNode(), + OSL_ENSURE( pTextFootnote->GetStartNode(), "SwHistorySetFootnote: Footnote without Section" ); // keep the old NodePos (because who knows what later will be saved/deleted // in SaveSection) - SwDoc* pDoc = const_cast<SwDoc*>(pTxtFtn->GetTxtNode().GetDoc()); + SwDoc* pDoc = const_cast<SwDoc*>(pTextFootnote->GetTextNode().GetDoc()); SwNode* pSaveNd = pDoc->GetNodes()[ m_nNodeIndex ]; - // keep pointer to StartNode of FtnSection and reset its attribute for now + // keep pointer to StartNode of FootnoteSection and reset its attribute for now // (as a result, its/all Frms will be deleted automatically) - SwNodeIndex aSttIdx( *pTxtFtn->GetStartNode() ); - pTxtFtn->SetStartNode( 0, false ); + SwNodeIndex aSttIdx( *pTextFootnote->GetStartNode() ); + pTextFootnote->SetStartNode( 0, false ); m_pUndo->SaveSection( aSttIdx ); m_nNodeIndex = pSaveNd->GetIndex(); } -SwHistorySetFootnote::SwHistorySetFootnote( const SwTxtFtn &rTxtFtn ) +SwHistorySetFootnote::SwHistorySetFootnote( const SwTextFootnote &rTextFootnote ) : SwHistoryHint( HSTRY_SETFTNHNT ) - , m_FootnoteNumber( rTxtFtn.GetFtn().GetNumStr() ) - , m_nNodeIndex( _SwTxtFtn_GetIndex( (&rTxtFtn) ) ) - , m_nStart( rTxtFtn.GetStart() ) - , m_bEndNote( rTxtFtn.GetFtn().IsEndNote() ) + , m_FootnoteNumber( rTextFootnote.GetFootnote().GetNumStr() ) + , m_nNodeIndex( _SwTextFootnote_GetIndex( (&rTextFootnote) ) ) + , m_nStart( rTextFootnote.GetStart() ) + , m_bEndNote( rTextFootnote.GetFootnote().IsEndNote() ) { - OSL_ENSURE( rTxtFtn.GetStartNode(), + OSL_ENSURE( rTextFootnote.GetStartNode(), "SwHistorySetFootnote: Footnote without Section" ); } @@ -458,95 +458,95 @@ SwHistorySetFootnote::~SwHistorySetFootnote() void SwHistorySetFootnote::SetInDoc( SwDoc* pDoc, bool ) { - SwTxtNode * pTxtNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTxtNode(); - OSL_ENSURE( pTxtNd, "SwHistorySetFootnote: no TextNode" ); - if ( !pTxtNd ) + SwTextNode * pTextNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetTextNode(); + OSL_ENSURE( pTextNd, "SwHistorySetFootnote: no TextNode" ); + if ( !pTextNd ) return; if ( m_pUndo.get() ) { // set the footnote in the TextNode - SwFmtFtn aTemp( m_bEndNote ); - SwFmtFtn& rNew = const_cast<SwFmtFtn&>( - static_cast<const SwFmtFtn&>(pDoc->GetAttrPool().Put(aTemp)) ); + SwFormatFootnote aTemp( m_bEndNote ); + SwFormatFootnote& rNew = const_cast<SwFormatFootnote&>( + static_cast<const SwFormatFootnote&>(pDoc->GetAttrPool().Put(aTemp)) ); if ( !m_FootnoteNumber.isEmpty() ) { rNew.SetNumStr( m_FootnoteNumber ); } - SwTxtFtn* pTxtFtn = new SwTxtFtn( rNew, m_nStart ); + SwTextFootnote* pTextFootnote = new SwTextFootnote( rNew, m_nStart ); // create the section of the Footnote - SwNodeIndex aIdx( *pTxtNd ); + SwNodeIndex aIdx( *pTextNd ); m_pUndo->RestoreSection( pDoc, &aIdx, SwFootnoteStartNode ); - pTxtFtn->SetStartNode( &aIdx ); + pTextFootnote->SetStartNode( &aIdx ); if ( m_pUndo->GetHistory() ) { // create frames only now m_pUndo->GetHistory()->Rollback( pDoc ); } - pTxtNd->InsertHint( pTxtFtn ); + pTextNd->InsertHint( pTextFootnote ); } else { - SwTxtFtn * const pFtn = - const_cast<SwTxtFtn*>( static_cast<const SwTxtFtn*>( - pTxtNd->GetTxtAttrForCharAt( m_nStart ))); - SwFmtFtn &rFtn = const_cast<SwFmtFtn&>(pFtn->GetFtn()); - rFtn.SetNumStr( m_FootnoteNumber ); - if ( rFtn.IsEndNote() != m_bEndNote ) + SwTextFootnote * const pFootnote = + const_cast<SwTextFootnote*>( static_cast<const SwTextFootnote*>( + pTextNd->GetTextAttrForCharAt( m_nStart ))); + SwFormatFootnote &rFootnote = const_cast<SwFormatFootnote&>(pFootnote->GetFootnote()); + rFootnote.SetNumStr( m_FootnoteNumber ); + if ( rFootnote.IsEndNote() != m_bEndNote ) { - rFtn.SetEndNote( m_bEndNote ); - pFtn->CheckCondColl(); + rFootnote.SetEndNote( m_bEndNote ); + pFootnote->CheckCondColl(); } } } -SwHistoryChangeFmtColl::SwHistoryChangeFmtColl( SwFmtColl* pFmtColl, sal_uLong nNd, +SwHistoryChangeFormatColl::SwHistoryChangeFormatColl( SwFormatColl* pFormatColl, sal_uLong nNd, sal_uInt8 nNodeWhich ) : SwHistoryHint( HSTRY_CHGFMTCOLL ) - , m_pColl( pFmtColl ) + , m_pColl( pFormatColl ) , m_nNodeIndex( nNd ) , m_nNodeType( nNodeWhich ) { } -void SwHistoryChangeFmtColl::SetInDoc( SwDoc* pDoc, bool ) +void SwHistoryChangeFormatColl::SetInDoc( SwDoc* pDoc, bool ) { - SwCntntNode * pCntntNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetCntntNode(); - OSL_ENSURE( pCntntNd, "SwHistoryChangeFmtColl: no ContentNode" ); + SwContentNode * pContentNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetContentNode(); + OSL_ENSURE( pContentNd, "SwHistoryChangeFormatColl: no ContentNode" ); // before setting the format, check if it is still available in the // document. if it has been deleted, there is no undo! - if ( pCntntNd && m_nNodeType == pCntntNd->GetNodeType() ) + if ( pContentNd && m_nNodeType == pContentNd->GetNodeType() ) { if ( ND_TEXTNODE == m_nNodeType ) { - if (pDoc->GetTxtFmtColls()->Contains( static_cast<SwTxtFmtColl * const>(m_pColl) )) + if (pDoc->GetTextFormatColls()->Contains( static_cast<SwTextFormatColl * const>(m_pColl) )) { - pCntntNd->ChgFmtColl( m_pColl ); + pContentNd->ChgFormatColl( m_pColl ); } } - else if (pDoc->GetGrfFmtColls()->Contains( static_cast<SwGrfFmtColl * const>(m_pColl) )) + else if (pDoc->GetGrfFormatColls()->Contains( static_cast<SwGrfFormatColl * const>(m_pColl) )) { - pCntntNd->ChgFmtColl( m_pColl ); + pContentNd->ChgFormatColl( m_pColl ); } } } -SwHistoryTxtFlyCnt::SwHistoryTxtFlyCnt( SwFrmFmt* const pFlyFmt ) +SwHistoryTextFlyCnt::SwHistoryTextFlyCnt( SwFrameFormat* const pFlyFormat ) : SwHistoryHint( HSTRY_FLYCNT ) - , m_pUndo( new SwUndoDelLayFmt( pFlyFmt ) ) + , m_pUndo( new SwUndoDelLayFormat( pFlyFormat ) ) { - OSL_ENSURE( pFlyFmt, "SwHistoryTxtFlyCnt: no Format" ); + OSL_ENSURE( pFlyFormat, "SwHistoryTextFlyCnt: no Format" ); m_pUndo->ChgShowSel( false ); } -SwHistoryTxtFlyCnt::~SwHistoryTxtFlyCnt() +SwHistoryTextFlyCnt::~SwHistoryTextFlyCnt() { } -void SwHistoryTxtFlyCnt::SetInDoc( SwDoc* pDoc, bool ) +void SwHistoryTextFlyCnt::SetInDoc( SwDoc* pDoc, bool ) { ::sw::IShellCursorSupplier *const pISCS(pDoc->GetIShellCursorSupplier()); OSL_ASSERT(pISCS); @@ -566,9 +566,9 @@ SwHistoryBookmark::SwHistoryBookmark( rBkmk.GetMarkPos().nNode.GetIndex() : 0) , m_nOtherNode(bSaveOtherPos ? rBkmk.GetOtherMarkPos().nNode.GetIndex() : 0) - , m_nCntnt(bSavePos ? + , m_nContent(bSavePos ? rBkmk.GetMarkPos().nContent.GetIndex() : 0) - , m_nOtherCntnt(bSaveOtherPos ? + , m_nOtherContent(bSaveOtherPos ? rBkmk.GetOtherMarkPos().nContent.GetIndex() :0) , m_bSavePos(bSavePos) , m_bSaveOtherPos(bSaveOtherPos) @@ -601,14 +601,14 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool ) if(m_bSavePos) { - SwCntntNode* const pCntntNd = rNds[m_nNode]->GetCntntNode(); - OSL_ENSURE(pCntntNd, + SwContentNode* const pContentNd = rNds[m_nNode]->GetContentNode(); + OSL_ENSURE(pContentNd, "<SwHistoryBookmark::SetInDoc(..)>" " - wrong node for a mark"); // #111660# don't crash when nNode1 doesn't point to content node. - if(pCntntNd) - pPam.reset(new SwPaM(*pCntntNd, m_nCntnt)); + if(pContentNd) + pPam.reset(new SwPaM(*pContentNd, m_nContent)); } else { @@ -618,16 +618,16 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool ) if(m_bSaveOtherPos) { - SwCntntNode* const pCntntNd = rNds[m_nOtherNode]->GetCntntNode(); - OSL_ENSURE(pCntntNd, + SwContentNode* const pContentNd = rNds[m_nOtherNode]->GetContentNode(); + OSL_ENSURE(pContentNd, "<SwHistoryBookmark::SetInDoc(..)>" " - wrong node for a mark"); - if(pPam.get() != NULL && pCntntNd) + if(pPam.get() != NULL && pContentNd) { pPam->SetMark(); pPam->GetMark()->nNode = m_nOtherNode; - pPam->GetMark()->nContent.Assign(pCntntNd, m_nOtherCntnt); + pPam->GetMark()->nContent.Assign(pContentNd, m_nOtherContent); } } else if(m_bHadOtherPos) @@ -670,7 +670,7 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool ) bool SwHistoryBookmark::IsEqualBookmark(const ::sw::mark::IMark& rBkmk) { return m_nNode == rBkmk.GetMarkPos().nNode.GetIndex() - && m_nCntnt == rBkmk.GetMarkPos().nContent.GetIndex() + && m_nContent == rBkmk.GetMarkPos().nContent.GetIndex() && m_aName == rBkmk.GetName(); } @@ -696,12 +696,12 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet, switch ( pItem->Which() ) { case RES_PAGEDESC: - static_cast<SwFmtPageDesc*>( + static_cast<SwFormatPageDesc*>( const_cast<SfxPoolItem*>(pItem))->ChgDefinedIn( 0 ); break; case RES_PARATR_DROP: - static_cast<SwFmtDrop*>( + static_cast<SwFormatDrop*>( const_cast<SfxPoolItem*>(pItem))->ChgDefinedIn( 0 ); break; @@ -712,13 +712,13 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet, // Save formulas always in plain text m_OldSet.ClearItem( RES_BOXATR_VALUE ); - SwTblBoxFormula& rNew = - *static_cast<SwTblBoxFormula*>( + SwTableBoxFormula& rNew = + *static_cast<SwTableBoxFormula*>( const_cast<SfxPoolItem*>(pItem)); if ( rNew.IsIntrnlName() ) { - const SwTblBoxFormula& rOld = - static_cast<const SwTblBoxFormula&>( + const SwTableBoxFormula& rOld = + static_cast<const SwTableBoxFormula&>( rSet.Get( RES_BOXATR_FORMULA )); const SwNode* pNd = rOld.GetNodeOfFormula(); if ( pNd ) @@ -727,11 +727,11 @@ SwHistorySetAttrSet::SwHistorySetAttrSet( const SfxItemSet& rSet, = pNd->FindTableNode(); if (pTableNode) { - SwTableFmlUpdate aMsgHnt( + SwTableFormulaUpdate aMsgHint( &pTableNode->GetTable() ); - aMsgHnt.eFlags = TBL_BOXNAME; + aMsgHint.eFlags = TBL_BOXNAME; rNew.ChgDefinedIn( rOld.GetDefinedIn() ); - rNew.ChangeState( &aMsgHnt ); + rNew.ChangeState( &aMsgHint ); } } } @@ -753,22 +753,22 @@ void SwHistorySetAttrSet::SetInDoc( SwDoc* pDoc, bool ) ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); SwNode * pNode = pDoc->GetNodes()[ m_nNodeIndex ]; - if ( pNode->IsCntntNode() ) + if ( pNode->IsContentNode() ) { - static_cast<SwCntntNode*>(pNode)->SetAttr( m_OldSet ); + static_cast<SwContentNode*>(pNode)->SetAttr( m_OldSet ); if ( !m_ResetArray.empty() ) { - static_cast<SwCntntNode*>(pNode)->ResetAttr( m_ResetArray ); + static_cast<SwContentNode*>(pNode)->ResetAttr( m_ResetArray ); } } else if ( pNode->IsTableNode() ) { - SwFmt& rFmt = - *static_cast<SwTableNode*>(pNode)->GetTable().GetFrmFmt(); - rFmt.SetFmtAttr( m_OldSet ); + SwFormat& rFormat = + *static_cast<SwTableNode*>(pNode)->GetTable().GetFrameFormat(); + rFormat.SetFormatAttr( m_OldSet ); if ( !m_ResetArray.empty() ) { - rFmt.ResetFmtAttr( m_ResetArray.front() ); + rFormat.ResetFormatAttr( m_ResetArray.front() ); } } } @@ -832,10 +832,10 @@ void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool ) { ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); - SwCntntNode * pCntntNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetCntntNode(); - OSL_ENSURE( pCntntNd, "SwHistoryResetAttrSet: no CntntNode" ); + SwContentNode * pContentNd = pDoc->GetNodes()[ m_nNodeIndex ]->GetContentNode(); + OSL_ENSURE( pContentNd, "SwHistoryResetAttrSet: no ContentNode" ); - if (pCntntNd) + if (pContentNd) { std::vector<sal_uInt16>::iterator it; if ( USHRT_MAX == m_nEnd && USHRT_MAX == m_nStart ) @@ -843,7 +843,7 @@ void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool ) // no area: use ContentNode for ( it = m_Array.begin(); it != m_Array.end(); ++it ) { - pCntntNd->ResetAttr( *it ); + pContentNd->ResetAttr( *it ); } } else @@ -851,18 +851,18 @@ void SwHistoryResetAttrSet::SetInDoc( SwDoc* pDoc, bool ) // area: use TextNode for ( it = m_Array.begin(); it != m_Array.end(); ++it ) { - pCntntNd->GetTxtNode()-> DeleteAttributes( *it, m_nStart, m_nEnd ); + pContentNd->GetTextNode()-> DeleteAttributes( *it, m_nStart, m_nEnd ); } } } } -SwHistoryChangeFlyAnchor::SwHistoryChangeFlyAnchor( SwFrmFmt& rFmt ) +SwHistoryChangeFlyAnchor::SwHistoryChangeFlyAnchor( SwFrameFormat& rFormat ) : SwHistoryHint( HSTRY_CHGFLYANCHOR ) - , m_rFmt( rFmt ) - , m_nOldNodeIndex( rFmt.GetAnchor().GetCntntAnchor()->nNode.GetIndex() ) - , m_nOldContentIndex( (FLY_AT_CHAR == rFmt.GetAnchor().GetAnchorId()) - ? rFmt.GetAnchor().GetCntntAnchor()->nContent.GetIndex() + , m_rFormat( rFormat ) + , m_nOldNodeIndex( rFormat.GetAnchor().GetContentAnchor()->nNode.GetIndex() ) + , m_nOldContentIndex( (FLY_AT_CHAR == rFormat.GetAnchor().GetAnchorId()) + ? rFormat.GetAnchor().GetContentAnchor()->nContent.GetIndex() : COMPLETE_STRING ) { } @@ -871,12 +871,12 @@ void SwHistoryChangeFlyAnchor::SetInDoc( SwDoc* pDoc, bool ) { ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); - if ( pDoc->GetSpzFrmFmts()->Contains( &m_rFmt ) ) // Format does still exist + if ( pDoc->GetSpzFrameFormats()->Contains( &m_rFormat ) ) // Format does still exist { - SwFmtAnchor aTmp( m_rFmt.GetAnchor() ); + SwFormatAnchor aTmp( m_rFormat.GetAnchor() ); SwNode* pNd = pDoc->GetNodes()[ m_nOldNodeIndex ]; - SwCntntNode* pCNd = pNd->GetCntntNode(); + SwContentNode* pCNd = pNd->GetContentNode(); SwPosition aPos( *pNd ); if ( COMPLETE_STRING != m_nOldContentIndex ) { @@ -891,68 +891,68 @@ void SwHistoryChangeFlyAnchor::SetInDoc( SwDoc* pDoc, bool ) // so the Layout does not get confused if ( !pCNd || !pCNd->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false ) ) { - m_rFmt.DelFrms(); + m_rFormat.DelFrms(); } - m_rFmt.SetFmtAttr( aTmp ); + m_rFormat.SetFormatAttr( aTmp ); } } -SwHistoryChangeFlyChain::SwHistoryChangeFlyChain( SwFlyFrmFmt& rFmt, - const SwFmtChain& rAttr ) +SwHistoryChangeFlyChain::SwHistoryChangeFlyChain( SwFlyFrameFormat& rFormat, + const SwFormatChain& rAttr ) : SwHistoryHint( HSTRY_CHGFLYCHAIN ) - , m_pPrevFmt( rAttr.GetPrev() ) - , m_pNextFmt( rAttr.GetNext() ) - , m_pFlyFmt( &rFmt ) + , m_pPrevFormat( rAttr.GetPrev() ) + , m_pNextFormat( rAttr.GetNext() ) + , m_pFlyFormat( &rFormat ) { } void SwHistoryChangeFlyChain::SetInDoc( SwDoc* pDoc, bool ) { - if (pDoc->GetSpzFrmFmts()->Contains( m_pFlyFmt ) ) + if (pDoc->GetSpzFrameFormats()->Contains( m_pFlyFormat ) ) { - SwFmtChain aChain; + SwFormatChain aChain; - if ( m_pPrevFmt && - pDoc->GetSpzFrmFmts()->Contains( m_pPrevFmt ) ) + if ( m_pPrevFormat && + pDoc->GetSpzFrameFormats()->Contains( m_pPrevFormat ) ) { - aChain.SetPrev( m_pPrevFmt ); - SwFmtChain aTmp( m_pPrevFmt->GetChain() ); - aTmp.SetNext( m_pFlyFmt ); - m_pPrevFmt->SetFmtAttr( aTmp ); + aChain.SetPrev( m_pPrevFormat ); + SwFormatChain aTmp( m_pPrevFormat->GetChain() ); + aTmp.SetNext( m_pFlyFormat ); + m_pPrevFormat->SetFormatAttr( aTmp ); } - if ( m_pNextFmt && - pDoc->GetSpzFrmFmts()->Contains( m_pNextFmt ) ) + if ( m_pNextFormat && + pDoc->GetSpzFrameFormats()->Contains( m_pNextFormat ) ) { - aChain.SetNext( m_pNextFmt ); - SwFmtChain aTmp( m_pNextFmt->GetChain() ); - aTmp.SetPrev( m_pFlyFmt ); - m_pNextFmt->SetFmtAttr( aTmp ); + aChain.SetNext( m_pNextFormat ); + SwFormatChain aTmp( m_pNextFormat->GetChain() ); + aTmp.SetPrev( m_pFlyFormat ); + m_pNextFormat->SetFormatAttr( aTmp ); } if ( aChain.GetNext() || aChain.GetPrev() ) { - m_pFlyFmt->SetFmtAttr( aChain ); + m_pFlyFormat->SetFormatAttr( aChain ); } } } // -> #i27615# -SwHistoryChangeCharFmt::SwHistoryChangeCharFmt(const SfxItemSet & rSet, - const OUString & sFmt) +SwHistoryChangeCharFormat::SwHistoryChangeCharFormat(const SfxItemSet & rSet, + const OUString & sFormat) : SwHistoryHint(HSTRY_CHGCHARFMT) - , m_OldSet(rSet), m_Fmt(sFmt) + , m_OldSet(rSet), m_Format(sFormat) { } -void SwHistoryChangeCharFmt::SetInDoc(SwDoc * pDoc, bool ) +void SwHistoryChangeCharFormat::SetInDoc(SwDoc * pDoc, bool ) { - SwCharFmt * pCharFmt = pDoc->FindCharFmtByName(m_Fmt); + SwCharFormat * pCharFormat = pDoc->FindCharFormatByName(m_Format); - if (pCharFmt) + if (pCharFormat) { - pCharFmt->SetFmtAttr(m_OldSet); + pCharFormat->SetFormatAttr(m_OldSet); } } // <- #i27615# @@ -998,18 +998,18 @@ void SwHistory::Add( // global tooling aka IsDefaultItem(const SfxPoolItem*) for now if(pOldValue && !IsDefaultItem(pOldValue)) { - pHt = new SwHistorySetFmt( pOldValue, nNodeIdx ); + pHt = new SwHistorySetFormat( pOldValue, nNodeIdx ); } else { - pHt = new SwHistoryResetFmt( pNewValue, nNodeIdx ); + pHt = new SwHistoryResetFormat( pNewValue, nNodeIdx ); } m_SwpHstry.push_back( pHt ); } // FIXME: refactor the following "Add" methods (DRY)? -void SwHistory::Add( SwTxtAttr* pHint, sal_uLong nNodeIdx, bool bNewAttr ) +void SwHistory::Add( SwTextAttr* pHint, sal_uLong nNodeIdx, bool bNewAttr ) { OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" ); @@ -1020,44 +1020,44 @@ void SwHistory::Add( SwTxtAttr* pHint, sal_uLong nNodeIdx, bool bNewAttr ) { case RES_TXTATR_FTN: pHt = new SwHistorySetFootnote( - static_cast<SwTxtFtn*>(pHint), nNodeIdx ); + static_cast<SwTextFootnote*>(pHint), nNodeIdx ); break; case RES_TXTATR_FLYCNT: - pHt = new SwHistoryTxtFlyCnt( static_cast<SwTxtFlyCnt*>(pHint) - ->GetFlyCnt().GetFrmFmt() ); + pHt = new SwHistoryTextFlyCnt( static_cast<SwTextFlyCnt*>(pHint) + ->GetFlyCnt().GetFrameFormat() ); break; case RES_TXTATR_FIELD: case RES_TXTATR_ANNOTATION: - pHt = new SwHistorySetTxtFld( - static_txtattr_cast<SwTxtFld*>(pHint), nNodeIdx); + pHt = new SwHistorySetTextField( + static_txtattr_cast<SwTextField*>(pHint), nNodeIdx); break; case RES_TXTATR_TOXMARK: pHt = new SwHistorySetTOXMark( - static_txtattr_cast<SwTxtTOXMark*>(pHint), nNodeIdx); + static_txtattr_cast<SwTextTOXMark*>(pHint), nNodeIdx); break; case RES_TXTATR_REFMARK: pHt = new SwHistorySetRefMark( - static_txtattr_cast<SwTxtRefMark*>(pHint), nNodeIdx); + static_txtattr_cast<SwTextRefMark*>(pHint), nNodeIdx); break; default: - pHt = new SwHistorySetTxt( - static_cast<SwTxtAttr*>(pHint), nNodeIdx ); + pHt = new SwHistorySetText( + static_cast<SwTextAttr*>(pHint), nNodeIdx ); } } else { - pHt = new SwHistoryResetTxt( pHint->Which(), pHint->GetStart(), + pHt = new SwHistoryResetText( pHint->Which(), pHint->GetStart(), *pHint->GetAnyEnd(), nNodeIdx ); } m_SwpHstry.push_back( pHt ); } -void SwHistory::Add( SwFmtColl* pColl, sal_uLong nNodeIdx, sal_uInt8 nWhichNd ) +void SwHistory::Add( SwFormatColl* pColl, sal_uLong nNodeIdx, sal_uInt8 nWhichNd ) { OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" ); SwHistoryHint * pHt = - new SwHistoryChangeFmtColl( pColl, nNodeIdx, nWhichNd ); + new SwHistoryChangeFormatColl( pColl, nNodeIdx, nWhichNd ); m_SwpHstry.push_back( pHt ); } @@ -1069,59 +1069,59 @@ void SwHistory::Add(const ::sw::mark::IMark& rBkmk, bool bSavePos, bool bSaveOth m_SwpHstry.push_back( pHt ); } -void SwHistory::Add( SwFrmFmt& rFmt ) +void SwHistory::Add( SwFrameFormat& rFormat ) { - SwHistoryHint * pHt = new SwHistoryChangeFlyAnchor( rFmt ); + SwHistoryHint * pHt = new SwHistoryChangeFlyAnchor( rFormat ); m_SwpHstry.push_back( pHt ); } -void SwHistory::Add( SwFlyFrmFmt& rFmt, sal_uInt16& rSetPos ) +void SwHistory::Add( SwFlyFrameFormat& rFormat, sal_uInt16& rSetPos ) { OSL_ENSURE( !m_nEndDiff, "History was not deleted after REDO" ); - const sal_uInt16 nWh = rFmt.Which(); + const sal_uInt16 nWh = rFormat.Which(); if( RES_FLYFRMFMT == nWh || RES_DRAWFRMFMT == nWh ) { - SwHistoryHint * pHint = new SwHistoryTxtFlyCnt( &rFmt ); + SwHistoryHint * pHint = new SwHistoryTextFlyCnt( &rFormat ); m_SwpHstry.push_back( pHint ); - const SwFmtChain* pChainItem; - if( SfxItemState::SET == rFmt.GetItemState( RES_CHAIN, false, + const SwFormatChain* pChainItem; + if( SfxItemState::SET == rFormat.GetItemState( RES_CHAIN, false, reinterpret_cast<const SfxPoolItem**>(&pChainItem) )) { if( pChainItem->GetNext() || pChainItem->GetPrev() ) { SwHistoryHint * pHt = - new SwHistoryChangeFlyChain( rFmt, *pChainItem ); + new SwHistoryChangeFlyChain( rFormat, *pChainItem ); m_SwpHstry.insert( m_SwpHstry.begin() + rSetPos++, pHt ); if ( pChainItem->GetNext() ) { - SwFmtChain aTmp( pChainItem->GetNext()->GetChain() ); + SwFormatChain aTmp( pChainItem->GetNext()->GetChain() ); aTmp.SetPrev( 0 ); - pChainItem->GetNext()->SetFmtAttr( aTmp ); + pChainItem->GetNext()->SetFormatAttr( aTmp ); } if ( pChainItem->GetPrev() ) { - SwFmtChain aTmp( pChainItem->GetPrev()->GetChain() ); + SwFormatChain aTmp( pChainItem->GetPrev()->GetChain() ); aTmp.SetNext( 0 ); - pChainItem->GetPrev()->SetFmtAttr( aTmp ); + pChainItem->GetPrev()->SetFormatAttr( aTmp ); } } - rFmt.ResetFmtAttr( RES_CHAIN ); + rFormat.ResetFormatAttr( RES_CHAIN ); } } } -void SwHistory::Add( const SwTxtFtn& rFtn ) +void SwHistory::Add( const SwTextFootnote& rFootnote ) { - SwHistoryHint *pHt = new SwHistorySetFootnote( rFtn ); + SwHistoryHint *pHt = new SwHistorySetFootnote( rFootnote ); m_SwpHstry.push_back( pHt ); } // #i27615# -void SwHistory::Add(const SfxItemSet & rSet, const SwCharFmt & rFmt) +void SwHistory::Add(const SfxItemSet & rSet, const SwCharFormat & rFormat) { - SwHistoryHint * pHt = new SwHistoryChangeCharFmt(rSet, rFmt.GetName()); + SwHistoryHint * pHt = new SwHistoryChangeCharFormat(rSet, rFormat.GetName()); m_SwpHstry.push_back( pHt ); } @@ -1190,15 +1190,15 @@ sal_uInt16 SwHistory::SetTmpEnd( sal_uInt16 nNewTmpEnd ) { if ( HSTRY_FLYCNT == (*this)[ n ]->Which() ) { - static_cast<SwHistoryTxtFlyCnt*>((*this)[ n ]) - ->GetUDelLFmt()->RedoForRollback(); + static_cast<SwHistoryTextFlyCnt*>((*this)[ n ]) + ->GetUDelLFormat()->RedoForRollback(); } } return nOld; } -void SwHistory::CopyFmtAttr( +void SwHistory::CopyFormatAttr( const SfxItemSet& rSet, sal_uLong nNodeIdx) { @@ -1240,7 +1240,7 @@ void SwHistory::CopyAttr( return; // copy all attributes of the TextNode in the area from nStart to nEnd - SwTxtAttr* pHt; + SwTextAttr* pHt; for( size_t n = 0; n < pHts->Count(); ++n ) { // nAttrStt must even be set when !pEndIdx @@ -1250,7 +1250,7 @@ void SwHistory::CopyAttr( if( 0 != pEndIdx && nAttrStt > nEnd ) break; - // never copy Flys and Ftn !! + // never copy Flys and Footnote !! bool bNextAttr = false; switch( pHt->Which() ) { @@ -1346,11 +1346,11 @@ void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) if ( m_WhichIdSet.count( pItem->Which() ) ) { - pNewHstr = new SwHistorySetFmt( pItem, m_nNodeIndex ); + pNewHstr = new SwHistorySetFormat( pItem, m_nNodeIndex ); } else { - pNewHstr = new SwHistoryResetFmt( pItem, m_nNodeIndex ); + pNewHstr = new SwHistoryResetFormat( pItem, m_nNodeIndex ); } } @@ -1359,7 +1359,7 @@ void SwRegHistory::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) } } -void SwRegHistory::AddHint( SwTxtAttr* pHt, const bool bNew ) +void SwRegHistory::AddHint( SwTextAttr* pHt, const bool bNew ) { m_pHistory->Add( pHt, m_nNodeIndex, bNew ); } @@ -1370,34 +1370,34 @@ bool SwRegHistory::InsertItems( const SfxItemSet& rSet, if( !rSet.Count() ) return false; - SwTxtNode * const pTxtNode = - dynamic_cast<SwTxtNode *>(const_cast<SwModify *>(GetRegisteredIn())); + SwTextNode * const pTextNode = + dynamic_cast<SwTextNode *>(const_cast<SwModify *>(GetRegisteredIn())); - OSL_ENSURE(pTxtNode, "SwRegHistory not registered at text node?"); - if (!pTxtNode) + OSL_ENSURE(pTextNode, "SwRegHistory not registered at text node?"); + if (!pTextNode) return false; - if ( pTxtNode->GetpSwpHints() && m_pHistory ) + if ( pTextNode->GetpSwpHints() && m_pHistory ) { - pTxtNode->GetpSwpHints()->Register( this ); + pTextNode->GetpSwpHints()->Register( this ); } - const bool bInserted = pTxtNode->SetAttr( rSet, nStart, nEnd, nFlags ); + const bool bInserted = pTextNode->SetAttr( rSet, nStart, nEnd, nFlags ); // Caution: The array can be deleted when inserting an attribute! // This can happen when the value that should be added first deletes // an existing attribute but does not need to be added itself because // the paragraph attributes are identical // ( -> bForgetAttr in SwpHints::Insert ) - if ( pTxtNode->GetpSwpHints() && m_pHistory ) + if ( pTextNode->GetpSwpHints() && m_pHistory ) { - pTxtNode->GetpSwpHints()->DeRegister(); + pTextNode->GetpSwpHints()->DeRegister(); } if ( m_pHistory && bInserted ) { SwHistoryHint* pNewHstr = new SwHistoryResetAttrSet( rSet, - pTxtNode->GetIndex(), nStart, nEnd ); + pTextNode->GetIndex(), nStart, nEnd ); // the NodeIndex might be moved! m_pHistory->m_SwpHstry.push_back( pNewHstr ); @@ -1429,14 +1429,14 @@ void SwRegHistory::_MakeSetWhichIds() if( GetRegisteredIn() ) { const SfxItemSet* pSet = 0; - if( GetRegisteredIn()->ISA( SwCntntNode ) ) + if( GetRegisteredIn()->ISA( SwContentNode ) ) { - pSet = static_cast<SwCntntNode*>( + pSet = static_cast<SwContentNode*>( const_cast<SwModify*>(GetRegisteredIn()))->GetpSwAttrSet(); } - else if ( GetRegisteredIn()->ISA( SwFmt ) ) + else if ( GetRegisteredIn()->ISA( SwFormat ) ) { - pSet = &static_cast<SwFmt*>( + pSet = &static_cast<SwFormat*>( const_cast<SwModify*>(GetRegisteredIn()))->GetAttrSet(); } if( pSet && pSet->Count() ) diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index 86f44f280dd2..8eec8e292f41 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -59,13 +59,13 @@ #include <charfmt.hxx> #include <calbck.hxx> -SwUndoFmtAttrHelper::SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSvDrwPt ) - : SwClient( &rFmt ) +SwUndoFormatAttrHelper::SwUndoFormatAttrHelper( SwFormat& rFormat, bool bSvDrwPt ) + : SwClient( &rFormat ) , m_bSaveDrawPt( bSvDrwPt ) { } -void SwUndoFmtAttrHelper::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) +void SwUndoFormatAttrHelper::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { if( pOld ) { if ( pOld->Which() == RES_OBJECTDYING ) { @@ -75,8 +75,8 @@ void SwUndoFmtAttrHelper::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pN if ( GetUndo() ) { m_pUndo->PutAttr( *pOld ); } else { - m_pUndo.reset( new SwUndoFmtAttr( *pOld, - *static_cast<SwFmt*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) ); + m_pUndo.reset( new SwUndoFormatAttr( *pOld, + *static_cast<SwFormat*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) ); } } else if ( RES_ATTRSET_CHG == pOld->Which() ) { if ( GetUndo() ) { @@ -90,77 +90,77 @@ void SwUndoFmtAttrHelper::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pN pItem = aIter.NextItem(); } } else { - m_pUndo.reset( new SwUndoFmtAttr( + m_pUndo.reset( new SwUndoFormatAttr( *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet(), - *static_cast<SwFmt*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) ); + *static_cast<SwFormat*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) ); } } } } } -SwUndoFmtAttr::SwUndoFmtAttr( const SfxItemSet& rOldSet, - SwFmt& rChgFmt, +SwUndoFormatAttr::SwUndoFormatAttr( const SfxItemSet& rOldSet, + SwFormat& rChgFormat, bool bSaveDrawPt ) : SwUndo( UNDO_INSFMTATTR ) - , m_pFmt( &rChgFmt ) + , m_pFormat( &rChgFormat ) // #i56253# , m_pOldSet( new SfxItemSet( rOldSet ) ) , m_nNodeIndex( 0 ) - , m_nFmtWhich( rChgFmt.Which() ) + , m_nFormatWhich( rChgFormat.Which() ) , m_bSaveDrawPt( bSaveDrawPt ) { Init(); } -SwUndoFmtAttr::SwUndoFmtAttr( const SfxPoolItem& rItem, SwFmt& rChgFmt, +SwUndoFormatAttr::SwUndoFormatAttr( const SfxPoolItem& rItem, SwFormat& rChgFormat, bool bSaveDrawPt ) : SwUndo( UNDO_INSFMTATTR ) - , m_pFmt( &rChgFmt ) - , m_pOldSet( m_pFmt->GetAttrSet().Clone( false ) ) + , m_pFormat( &rChgFormat ) + , m_pOldSet( m_pFormat->GetAttrSet().Clone( false ) ) , m_nNodeIndex( 0 ) - , m_nFmtWhich( rChgFmt.Which() ) + , m_nFormatWhich( rChgFormat.Which() ) , m_bSaveDrawPt( bSaveDrawPt ) { m_pOldSet->Put( rItem ); Init(); } -void SwUndoFmtAttr::Init() +void SwUndoFormatAttr::Init() { // treat change of anchor specially if ( SfxItemState::SET == m_pOldSet->GetItemState( RES_ANCHOR, false )) { SaveFlyAnchor( m_bSaveDrawPt ); - } else if ( RES_FRMFMT == m_nFmtWhich ) { - SwDoc* pDoc = m_pFmt->GetDoc(); - if ( pDoc->GetTblFrmFmts()->Contains( m_pFmt )) { + } else if ( RES_FRMFMT == m_nFormatWhich ) { + SwDoc* pDoc = m_pFormat->GetDoc(); + if ( pDoc->GetTableFrameFormats()->Contains( m_pFormat )) { // Table Format: save table position, table formats are volatile! - SwTable * pTbl = SwIterator<SwTable,SwFmt>( *m_pFmt ).First(); - if ( pTbl ) { - m_nNodeIndex = pTbl->GetTabSortBoxes()[ 0 ]->GetSttNd() + SwTable * pTable = SwIterator<SwTable,SwFormat>( *m_pFormat ).First(); + if ( pTable ) { + m_nNodeIndex = pTable->GetTabSortBoxes()[ 0 ]->GetSttNd() ->FindTableNode()->GetIndex(); } - } else if ( pDoc->GetSections().Contains( m_pFmt )) { - m_nNodeIndex = m_pFmt->GetCntnt().GetCntntIdx()->GetIndex(); - } else if ( 0 != dynamic_cast< SwTableBoxFmt* >( m_pFmt ) ) { - SwTableBox * pTblBox = SwIterator<SwTableBox,SwFmt>( *m_pFmt ).First(); - if ( pTblBox ) { - m_nNodeIndex = pTblBox->GetSttIdx(); + } else if ( pDoc->GetSections().Contains( m_pFormat )) { + m_nNodeIndex = m_pFormat->GetContent().GetContentIdx()->GetIndex(); + } else if ( 0 != dynamic_cast< SwTableBoxFormat* >( m_pFormat ) ) { + SwTableBox * pTableBox = SwIterator<SwTableBox,SwFormat>( *m_pFormat ).First(); + if ( pTableBox ) { + m_nNodeIndex = pTableBox->GetSttIdx(); } } } } -SwUndoFmtAttr::~SwUndoFmtAttr() +SwUndoFormatAttr::~SwUndoFormatAttr() { } -void SwUndoFmtAttr::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoFormatAttr::UndoImpl(::sw::UndoRedoContext & rContext) { // OD 2004-10-26 #i35443# // Important note: <Undo(..)> also called by <ReDo(..)> - if ( !m_pOldSet.get() || !m_pFmt || !IsFmtInDoc( &rContext.GetDoc() )) + if ( !m_pOldSet.get() || !m_pFormat || !IsFormatInDoc( &rContext.GetDoc() )) return; // #i35443# - If anchor attribute has been successful @@ -181,8 +181,8 @@ void SwUndoFmtAttr::UndoImpl(::sw::UndoRedoContext & rContext) } if ( !bAnchorAttrRestored ) { - SwUndoFmtAttrHelper aTmp( *m_pFmt, m_bSaveDrawPt ); - m_pFmt->SetFmtAttr( *m_pOldSet ); + SwUndoFormatAttrHelper aTmp( *m_pFormat, m_bSaveDrawPt ); + m_pFormat->SetFormatAttr( *m_pOldSet ); if ( aTmp.GetUndo() ) { // transfer ownership of helper object's old set m_pOldSet = std::move(aTmp.GetUndo()->m_pOldSet); @@ -190,30 +190,30 @@ void SwUndoFmtAttr::UndoImpl(::sw::UndoRedoContext & rContext) m_pOldSet->ClearItem(); } - if ( RES_FLYFRMFMT == m_nFmtWhich || RES_DRAWFRMFMT == m_nFmtWhich ) { - rContext.SetSelections(static_cast<SwFrmFmt*>(m_pFmt), 0); + if ( RES_FLYFRMFMT == m_nFormatWhich || RES_DRAWFRMFMT == m_nFormatWhich ) { + rContext.SetSelections(static_cast<SwFrameFormat*>(m_pFormat), 0); } } } -bool SwUndoFmtAttr::IsFmtInDoc( SwDoc* pDoc ) +bool SwUndoFormatAttr::IsFormatInDoc( SwDoc* pDoc ) { // search for the Format in the Document; if it does not exist any more, // the attribute is not restored! bool bFound = false; - switch ( m_nFmtWhich ) + switch ( m_nFormatWhich ) { case RES_TXTFMTCOLL: - bFound = pDoc->GetTxtFmtColls()->Contains( m_pFmt ); + bFound = pDoc->GetTextFormatColls()->Contains( m_pFormat ); break; case RES_GRFFMTCOLL: - bFound = pDoc->GetGrfFmtColls()->Contains( - static_cast<const SwGrfFmtColl*>(m_pFmt) ); + bFound = pDoc->GetGrfFormatColls()->Contains( + static_cast<const SwGrfFormatColl*>(m_pFormat) ); break; case RES_CHRFMT: - bFound = pDoc->GetCharFmts()->Contains( m_pFmt ); + bFound = pDoc->GetCharFormats()->Contains( m_pFormat ); break; case RES_FRMFMT: @@ -222,29 +222,29 @@ bool SwUndoFmtAttr::IsFmtInDoc( SwDoc* pDoc ) SwNode* pNd = pDoc->GetNodes()[ m_nNodeIndex ]; if ( pNd->IsTableNode() ) { - m_pFmt = - static_cast<SwTableNode*>(pNd)->GetTable().GetFrmFmt(); + m_pFormat = + static_cast<SwTableNode*>(pNd)->GetTable().GetFrameFormat(); bFound = true; break; } else if ( pNd->IsSectionNode() ) { - m_pFmt = - static_cast<SwSectionNode*>(pNd)->GetSection().GetFmt(); + m_pFormat = + static_cast<SwSectionNode*>(pNd)->GetSection().GetFormat(); bFound = true; break; } else if ( pNd->IsStartNode() && (SwTableBoxStartNode == static_cast< SwStartNode* >(pNd)->GetStartNodeType()) ) { - SwTableNode* pTblNode = pNd->FindTableNode(); - if ( pTblNode ) + SwTableNode* pTableNode = pNd->FindTableNode(); + if ( pTableNode ) { SwTableBox* pBox = - pTblNode->GetTable().GetTblBox( m_nNodeIndex ); + pTableNode->GetTable().GetTableBox( m_nNodeIndex ); if ( pBox ) { - m_pFmt = pBox->GetFrmFmt(); + m_pFormat = pBox->GetFrameFormat(); bFound = true; break; } @@ -254,10 +254,10 @@ bool SwUndoFmtAttr::IsFmtInDoc( SwDoc* pDoc ) // no break! case RES_DRAWFRMFMT: case RES_FLYFRMFMT: - bFound = pDoc->GetSpzFrmFmts()->Contains( m_pFmt ); + bFound = pDoc->GetSpzFrameFormats()->Contains( m_pFormat ); if ( !bFound ) { - bFound = pDoc->GetFrmFmts()->Contains( m_pFmt ); + bFound = pDoc->GetFrameFormats()->Contains( m_pFormat ); } break; } @@ -265,68 +265,68 @@ bool SwUndoFmtAttr::IsFmtInDoc( SwDoc* pDoc ) if ( !bFound ) { // Format does not exist; reset - m_pFmt = 0; + m_pFormat = 0; } - return 0 != m_pFmt; + return 0 != m_pFormat; } // Check if it is still in Doc -SwFmt* SwUndoFmtAttr::GetFmt( SwDoc& rDoc ) +SwFormat* SwUndoFormatAttr::GetFormat( SwDoc& rDoc ) { - return m_pFmt && IsFmtInDoc( &rDoc ) ? m_pFmt : 0; + return m_pFormat && IsFormatInDoc( &rDoc ) ? m_pFormat : 0; } -void SwUndoFmtAttr::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoFormatAttr::RedoImpl(::sw::UndoRedoContext & rContext) { // #i35443# - Because the undo stores the attributes for // redo, the same code as for <Undo(..)> can be applied for <Redo(..)> UndoImpl(rContext); } -void SwUndoFmtAttr::RepeatImpl(::sw::RepeatContext & rContext) +void SwUndoFormatAttr::RepeatImpl(::sw::RepeatContext & rContext) { if ( !m_pOldSet.get() ) return; SwDoc & rDoc(rContext.GetDoc()); - switch ( m_nFmtWhich ) { + switch ( m_nFormatWhich ) { case RES_GRFFMTCOLL: { - SwNoTxtNode *const pNd = - rContext.GetRepeatPaM().GetNode().GetNoTxtNode(); + SwNoTextNode *const pNd = + rContext.GetRepeatPaM().GetNode().GetNoTextNode(); if( pNd ) { - rDoc.SetAttr( m_pFmt->GetAttrSet(), *pNd->GetFmtColl() ); + rDoc.SetAttr( m_pFormat->GetAttrSet(), *pNd->GetFormatColl() ); } } break; case RES_TXTFMTCOLL: { - SwTxtNode *const pNd = - rContext.GetRepeatPaM().GetNode().GetTxtNode(); + SwTextNode *const pNd = + rContext.GetRepeatPaM().GetNode().GetTextNode(); if( pNd ) { - rDoc.SetAttr( m_pFmt->GetAttrSet(), *pNd->GetFmtColl() ); + rDoc.SetAttr( m_pFormat->GetAttrSet(), *pNd->GetFormatColl() ); } } break; case RES_FLYFRMFMT: { // Check if the cursor is in a flying frame - // Steps: search in all FlyFrmFormats for the FlyCntnt attribute + // Steps: search in all FlyFrmFormats for the FlyContent attribute // and validate if the cursor is in the respective section - SwFrmFmt *const pFly = - rContext.GetRepeatPaM().GetNode().GetFlyFmt(); + SwFrameFormat *const pFly = + rContext.GetRepeatPaM().GetNode().GetFlyFormat(); if( pFly ) { // Bug 43672: do not set all attributes! if (SfxItemState::SET == - m_pFmt->GetAttrSet().GetItemState( RES_CNTNT )) { - SfxItemSet aTmpSet( m_pFmt->GetAttrSet() ); + m_pFormat->GetAttrSet().GetItemState( RES_CNTNT )) { + SfxItemSet aTmpSet( m_pFormat->GetAttrSet() ); aTmpSet.ClearItem( RES_CNTNT ); if( aTmpSet.Count() ) { rDoc.SetAttr( aTmpSet, *pFly ); } } else { - rDoc.SetAttr( m_pFmt->GetAttrSet(), *pFly ); + rDoc.SetAttr( m_pFormat->GetAttrSet(), *pFly ); } } break; @@ -334,18 +334,18 @@ void SwUndoFmtAttr::RepeatImpl(::sw::RepeatContext & rContext) } } -SwRewriter SwUndoFmtAttr::GetRewriter() const +SwRewriter SwUndoFormatAttr::GetRewriter() const { SwRewriter aRewriter; - if (m_pFmt) { - aRewriter.AddRule(UndoArg1, m_pFmt->GetName()); + if (m_pFormat) { + aRewriter.AddRule(UndoArg1, m_pFormat->GetName()); } return aRewriter; } -void SwUndoFmtAttr::PutAttr( const SfxPoolItem& rItem ) +void SwUndoFormatAttr::PutAttr( const SfxPoolItem& rItem ) { m_pOldSet->Put( rItem ); if ( RES_ANCHOR == rItem.Which() ) { @@ -353,38 +353,38 @@ void SwUndoFmtAttr::PutAttr( const SfxPoolItem& rItem ) } } -void SwUndoFmtAttr::SaveFlyAnchor( bool bSvDrwPt ) +void SwUndoFormatAttr::SaveFlyAnchor( bool bSvDrwPt ) { // Format is valid, otherwise you would not reach this point here if( bSvDrwPt ) { - if ( RES_DRAWFRMFMT == m_pFmt->Which() ) { - Point aPt( static_cast<SwFrmFmt*>(m_pFmt)->FindSdrObject() + if ( RES_DRAWFRMFMT == m_pFormat->Which() ) { + Point aPt( static_cast<SwFrameFormat*>(m_pFormat)->FindSdrObject() ->GetRelativePos() ); - // store old value as attribute, to keep SwUndoFmtAttr small - m_pOldSet->Put( SwFmtFrmSize( ATT_VAR_SIZE, aPt.X(), aPt.Y() ) ); + // store old value as attribute, to keep SwUndoFormatAttr small + m_pOldSet->Put( SwFormatFrmSize( ATT_VAR_SIZE, aPt.X(), aPt.Y() ) ); } } - const SwFmtAnchor& rAnchor = - static_cast<const SwFmtAnchor&>( m_pOldSet->Get( RES_ANCHOR, false ) ); - if( !rAnchor.GetCntntAnchor() ) + const SwFormatAnchor& rAnchor = + static_cast<const SwFormatAnchor&>( m_pOldSet->Get( RES_ANCHOR, false ) ); + if( !rAnchor.GetContentAnchor() ) return; - sal_Int32 nCntnt = 0; + sal_Int32 nContent = 0; switch( rAnchor.GetAnchorId() ) { case FLY_AS_CHAR: case FLY_AT_CHAR: - nCntnt = rAnchor.GetCntntAnchor()->nContent.GetIndex(); + nContent = rAnchor.GetContentAnchor()->nContent.GetIndex(); // fallthrough case FLY_AT_PARA: case FLY_AT_FLY: - m_nNodeIndex = rAnchor.GetCntntAnchor()->nNode.GetIndex(); + m_nNodeIndex = rAnchor.GetContentAnchor()->nNode.GetIndex(); break; default: return; } - SwFmtAnchor aAnchor( rAnchor.GetAnchorId(), nCntnt ); + SwFormatAnchor aAnchor( rAnchor.GetAnchorId(), nContent ); m_pOldSet->Put( aAnchor ); } @@ -392,21 +392,21 @@ void SwUndoFmtAttr::SaveFlyAnchor( bool bSvDrwPt ) // Return value indicates, if anchor attribute is restored. // Note: If anchor attribute is restored, all other existing attributes // are also restored. -bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) +bool SwUndoFormatAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) { SwDoc *const pDoc = & rContext.GetDoc(); - SwFlyFrmFmt* pFrmFmt = static_cast<SwFlyFrmFmt*>(m_pFmt); - const SwFmtAnchor& rAnchor = - static_cast<const SwFmtAnchor&>( m_pOldSet->Get( RES_ANCHOR, false ) ); + SwFlyFrameFormat* pFrameFormat = static_cast<SwFlyFrameFormat*>(m_pFormat); + const SwFormatAnchor& rAnchor = + static_cast<const SwFormatAnchor&>( m_pOldSet->Get( RES_ANCHOR, false ) ); - SwFmtAnchor aNewAnchor( rAnchor.GetAnchorId() ); + SwFormatAnchor aNewAnchor( rAnchor.GetAnchorId() ); if (FLY_AT_PAGE != rAnchor.GetAnchorId()) { SwNode* pNd = pDoc->GetNodes()[ m_nNodeIndex ]; if ( (FLY_AT_FLY == rAnchor.GetAnchorId()) ? ( !pNd->IsStartNode() || (SwFlyStartNode != static_cast<SwStartNode*>(pNd)->GetStartNodeType()) ) - : !pNd->IsTxtNode() ) { + : !pNd->IsTextNode() ) { // #i35443# - invalid position. // Thus, anchor attribute not restored return false; @@ -415,8 +415,8 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) SwPosition aPos( *pNd ); if ((FLY_AS_CHAR == rAnchor.GetAnchorId()) || (FLY_AT_CHAR == rAnchor.GetAnchorId())) { - aPos.nContent.Assign( static_cast<SwTxtNode*>(pNd), rAnchor.GetPageNum() ); - if ( aPos.nContent.GetIndex() > pNd->GetTxtNode()->GetTxt().getLength()) { + aPos.nContent.Assign( static_cast<SwTextNode*>(pNd), rAnchor.GetPageNum() ); + if ( aPos.nContent.GetIndex() > pNd->GetTextNode()->GetText().getLength()) { // #i35443# - invalid position. // Thus, anchor attribute not restored return false; @@ -428,49 +428,49 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) Point aDrawSavePt, aDrawOldPt; if( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ) { - if( RES_DRAWFRMFMT == pFrmFmt->Which() ) { + if( RES_DRAWFRMFMT == pFrameFormat->Which() ) { // get the old cached value - const SwFmtFrmSize& rOldSize = static_cast<const SwFmtFrmSize&>( + const SwFormatFrmSize& rOldSize = static_cast<const SwFormatFrmSize&>( m_pOldSet->Get( RES_FRM_SIZE ) ); aDrawSavePt.X() = rOldSize.GetWidth(); aDrawSavePt.Y() = rOldSize.GetHeight(); m_pOldSet->ClearItem( RES_FRM_SIZE ); // write the current value into cache - aDrawOldPt = pFrmFmt->FindSdrObject()->GetRelativePos(); + aDrawOldPt = pFrameFormat->FindSdrObject()->GetRelativePos(); } else { - pFrmFmt->DelFrms(); // delete Frms + pFrameFormat->DelFrms(); // delete Frms } } - const SwFmtAnchor &rOldAnch = pFrmFmt->GetAnchor(); + const SwFormatAnchor &rOldAnch = pFrameFormat->GetAnchor(); // #i54336# // Consider case, that as-character anchored object has moved its anchor position. if (FLY_AS_CHAR == rOldAnch.GetAnchorId()) { - // With InCntnts it's tricky: the text attribute needs to be deleted. + // With InContents it's tricky: the text attribute needs to be deleted. // Unfortunately, this not only destroys the Frms but also the format. // To prevent that, first detach the connection between attribute and // format. - const SwPosition *pPos = rOldAnch.GetCntntAnchor(); - SwTxtNode *pTxtNode = static_cast<SwTxtNode*>(&pPos->nNode.GetNode()); - OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." ); + const SwPosition *pPos = rOldAnch.GetContentAnchor(); + SwTextNode *pTextNode = static_cast<SwTextNode*>(&pPos->nNode.GetNode()); + OSL_ENSURE( pTextNode->HasHints(), "Missing FlyInCnt-Hint." ); const sal_Int32 nIdx = pPos->nContent.GetIndex(); - SwTxtAttr * const pHnt = - pTxtNode->GetTxtAttrForCharAt( nIdx, RES_TXTATR_FLYCNT ); - OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT, + SwTextAttr * const pHint = + pTextNode->GetTextAttrForCharAt( nIdx, RES_TXTATR_FLYCNT ); + OSL_ENSURE( pHint && pHint->Which() == RES_TXTATR_FLYCNT, "Missing FlyInCnt-Hint." ); - OSL_ENSURE( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFrmFmt, - "Wrong TxtFlyCnt-Hint." ); - const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt()).SetFlyFmt(); + OSL_ENSURE( pHint && pHint->GetFlyCnt().GetFrameFormat() == pFrameFormat, + "Wrong TextFlyCnt-Hint." ); + const_cast<SwFormatFlyCnt&>(pHint->GetFlyCnt()).SetFlyFormat(); // Connection is now detached, therefore the attribute can be deleted - pTxtNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx, nIdx ); + pTextNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx, nIdx ); } { m_pOldSet->Put( aNewAnchor ); - SwUndoFmtAttrHelper aTmp( *m_pFmt, m_bSaveDrawPt ); - m_pFmt->SetFmtAttr( *m_pOldSet ); + SwUndoFormatAttrHelper aTmp( *m_pFormat, m_bSaveDrawPt ); + m_pFormat->SetFormatAttr( *m_pOldSet ); if ( aTmp.GetUndo() ) { m_nNodeIndex = aTmp.GetUndo()->m_nNodeIndex; // transfer ownership of helper object's old set @@ -480,9 +480,9 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) } } - if ( RES_DRAWFRMFMT == pFrmFmt->Which() ) { + if ( RES_DRAWFRMFMT == pFrameFormat->Which() ) { SwDrawContact *pCont = - static_cast<SwDrawContact*>(pFrmFmt->FindContactObj()); + static_cast<SwDrawContact*>(pFrameFormat->FindContactObj()); // The Draw model also prepared an Undo object for its right positioning // which unfortunately is relative. Therefore block here a position // change of the Contact object by setting the anchor. @@ -497,27 +497,27 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) // cache the old value again m_pOldSet->Put( - SwFmtFrmSize( ATT_VAR_SIZE, aDrawOldPt.X(), aDrawOldPt.Y() ) ); + SwFormatFrmSize( ATT_VAR_SIZE, aDrawOldPt.X(), aDrawOldPt.Y() ) ); } if (FLY_AS_CHAR == aNewAnchor.GetAnchorId()) { - const SwPosition* pPos = aNewAnchor.GetCntntAnchor(); - SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode(); - OSL_ENSURE( pTxtNd, "no Text Node at position." ); - SwFmtFlyCnt aFmt( pFrmFmt ); - pTxtNd->InsertItem( aFmt, pPos->nContent.GetIndex(), 0 ); + const SwPosition* pPos = aNewAnchor.GetContentAnchor(); + SwTextNode* pTextNd = pPos->nNode.GetNode().GetTextNode(); + OSL_ENSURE( pTextNd, "no Text Node at position." ); + SwFormatFlyCnt aFormat( pFrameFormat ); + pTextNd->InsertItem( aFormat, pPos->nContent.GetIndex(), 0 ); } - if( RES_DRAWFRMFMT != pFrmFmt->Which() ) - pFrmFmt->MakeFrms(); + if( RES_DRAWFRMFMT != pFrameFormat->Which() ) + pFrameFormat->MakeFrms(); - rContext.SetSelections(pFrmFmt, 0); + rContext.SetSelections(pFrameFormat, 0); // #i35443# - anchor attribute restored. return true; } -SwUndoFmtResetAttr::SwUndoFmtResetAttr( SwFmt& rChangedFormat, +SwUndoFormatResetAttr::SwUndoFormatResetAttr( SwFormat& rChangedFormat, const sal_uInt16 nWhichId ) : SwUndo( UNDO_RESETATTR ) , m_pChangedFormat( &rChangedFormat ) @@ -529,38 +529,38 @@ SwUndoFmtResetAttr::SwUndoFmtResetAttr( SwFmt& rChangedFormat, } } -SwUndoFmtResetAttr::~SwUndoFmtResetAttr() +SwUndoFormatResetAttr::~SwUndoFormatResetAttr() { } -void SwUndoFmtResetAttr::UndoImpl(::sw::UndoRedoContext &) +void SwUndoFormatResetAttr::UndoImpl(::sw::UndoRedoContext &) { if ( m_pOldItem.get() ) { - m_pChangedFormat->SetFmtAttr( *m_pOldItem ); + m_pChangedFormat->SetFormatAttr( *m_pOldItem ); } } -void SwUndoFmtResetAttr::RedoImpl(::sw::UndoRedoContext &) +void SwUndoFormatResetAttr::RedoImpl(::sw::UndoRedoContext &) { if ( m_pOldItem.get() ) { - m_pChangedFormat->ResetFmtAttr( m_nWhichId ); + m_pChangedFormat->ResetFormatAttr( m_nWhichId ); } } -SwUndoResetAttr::SwUndoResetAttr( const SwPaM& rRange, sal_uInt16 nFmtId ) +SwUndoResetAttr::SwUndoResetAttr( const SwPaM& rRange, sal_uInt16 nFormatId ) : SwUndo( UNDO_RESETATTR ), SwUndRng( rRange ) , m_pHistory( new SwHistory ) - , m_nFormatId( nFmtId ) + , m_nFormatId( nFormatId ) { } -SwUndoResetAttr::SwUndoResetAttr( const SwPosition& rPos, sal_uInt16 nFmtId ) +SwUndoResetAttr::SwUndoResetAttr( const SwPosition& rPos, sal_uInt16 nFormatId ) : SwUndo( UNDO_RESETATTR ) , m_pHistory( new SwHistory ) - , m_nFormatId( nFmtId ) + , m_nFormatId( nFormatId ) { nSttNode = nEndNode = rPos.nNode.GetIndex(); - nSttCntnt = nEndCntnt = rPos.nContent.GetIndex(); + nSttContent = nEndContent = rPos.nContent.GetIndex(); } SwUndoResetAttr::~SwUndoResetAttr() @@ -575,11 +575,11 @@ void SwUndoResetAttr::UndoImpl(::sw::UndoRedoContext & rContext) m_pHistory->SetTmpEnd( m_pHistory->Count() ); if ((RES_CONDTXTFMTCOLL == m_nFormatId) && - (nSttNode == nEndNode) && (nSttCntnt == nEndCntnt)) { - SwTxtNode* pTNd = rDoc.GetNodes()[ nSttNode ]->GetTxtNode(); + (nSttNode == nEndNode) && (nSttContent == nEndContent)) { + SwTextNode* pTNd = rDoc.GetNodes()[ nSttNode ]->GetTextNode(); if( pTNd ) { - SwIndex aIdx( pTNd, nSttCntnt ); - pTNd->DontExpandFmt( aIdx, false ); + SwIndex aIdx( pTNd, nSttContent ); + pTNd->DontExpandFormat( aIdx, false ); } } @@ -593,7 +593,7 @@ void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext) switch ( m_nFormatId ) { case RES_CHRFMT: - rDoc.RstTxtAttrs(rPam); + rDoc.RstTextAttrs(rPam); break; case RES_TXTFMTCOLL: rDoc.ResetAttrs(rPam, false, m_Ids ); @@ -607,8 +607,8 @@ void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext) { SwTOXMarks aArr; SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode ); - SwPosition aPos( aIdx, SwIndex( aIdx.GetNode().GetCntntNode(), - nSttCntnt )); + SwPosition aPos( aIdx, SwIndex( aIdx.GetNode().GetContentNode(), + nSttContent )); sal_uInt16 nCnt = SwDoc::GetCurTOXMark( aPos, aArr ); if( nCnt ) { @@ -644,7 +644,7 @@ void SwUndoResetAttr::RepeatImpl(::sw::RepeatContext & rContext) switch ( m_nFormatId ) { case RES_CHRFMT: - rContext.GetDoc().RstTxtAttrs(rContext.GetRepeatPaM()); + rContext.GetDoc().RstTextAttrs(rContext.GetRepeatPaM()); break; case RES_TXTFMTCOLL: rContext.GetDoc().ResetAttrs(rContext.GetRepeatPaM(), false, m_Ids); @@ -686,23 +686,23 @@ SwUndoAttr::~SwUndoAttr() { } -void SwUndoAttr::SaveRedlineData( const SwPaM& rPam, bool bIsCntnt ) +void SwUndoAttr::SaveRedlineData( const SwPaM& rPam, bool bIsContent ) { SwDoc* pDoc = rPam.GetDoc(); if ( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) { - m_pRedlineData.reset( new SwRedlineData( bIsCntnt + m_pRedlineData.reset( new SwRedlineData( bIsContent ? nsRedlineType_t::REDLINE_INSERT : nsRedlineType_t::REDLINE_FORMAT, pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) ); } m_pRedlineSaveData.reset( new SwRedlineSaveDatas ); - if ( !FillSaveDataForFmt( rPam, *m_pRedlineSaveData )) { + if ( !FillSaveDataForFormat( rPam, *m_pRedlineSaveData )) { m_pRedlineSaveData.reset(0); } SetRedlineMode( pDoc->getIDocumentRedlineAccess().GetRedlineMode() ); - if ( bIsCntnt ) { + if ( bIsContent ) { m_nNodeIndex = rPam.GetPoint()->nNode.GetIndex(); } } @@ -718,7 +718,7 @@ void SwUndoAttr::UndoImpl(::sw::UndoRedoContext & rContext) if ( ULONG_MAX != m_nNodeIndex ) { aPam.DeleteMark(); aPam.GetPoint()->nNode = m_nNodeIndex; - aPam.GetPoint()->nContent.Assign( aPam.GetCntntNode(), nSttCntnt ); + aPam.GetPoint()->nContent.Assign( aPam.GetContentNode(), nSttContent ); aPam.SetMark(); ++aPam.GetPoint()->nContent; pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, USHRT_MAX); @@ -794,25 +794,25 @@ void SwUndoAttr::RemoveIdx( SwDoc& rDoc ) SwNodes& rNds = rDoc.GetNodes(); for ( sal_uInt16 n = 0; n < m_pHistory->Count(); ++n ) { - sal_Int32 nCntnt = 0; + sal_Int32 nContent = 0; sal_uLong nNode = 0; - SwHistoryHint* pHstHnt = (*m_pHistory)[ n ]; - switch ( pHstHnt->Which() ) { + SwHistoryHint* pHstHint = (*m_pHistory)[ n ]; + switch ( pHstHint->Which() ) { case HSTRY_RESETTXTHNT: { - SwHistoryResetTxt * pHistoryHint - = static_cast<SwHistoryResetTxt*>(pHstHnt); + SwHistoryResetText * pHistoryHint + = static_cast<SwHistoryResetText*>(pHstHint); if ( RES_TXTATR_FTN == pHistoryHint->GetWhich() ) { nNode = pHistoryHint->GetNode(); - nCntnt = pHistoryHint->GetCntnt(); + nContent = pHistoryHint->GetContent(); } } break; case HSTRY_RESETATTRSET: { SwHistoryResetAttrSet * pHistoryHint - = static_cast<SwHistoryResetAttrSet*>(pHstHnt); - nCntnt = pHistoryHint->GetCntnt(); - if ( COMPLETE_STRING != nCntnt ) { + = static_cast<SwHistoryResetAttrSet*>(pHstHint); + nContent = pHistoryHint->GetContent(); + if ( COMPLETE_STRING != nContent ) { const std::vector<sal_uInt16>& rArr = pHistoryHint->GetArr(); for ( size_t i = rArr.size(); i; ) { if ( RES_TXTATR_FTN == rArr[ --i ] ) { @@ -829,14 +829,14 @@ void SwUndoAttr::RemoveIdx( SwDoc& rDoc ) } if( nNode ) { - SwTxtNode* pTxtNd = rNds[ nNode ]->GetTxtNode(); - if( pTxtNd ) { - SwTxtAttr *const pTxtHt = - pTxtNd->GetTxtAttrForCharAt(nCntnt, RES_TXTATR_FTN); - if( pTxtHt ) { + SwTextNode* pTextNd = rNds[ nNode ]->GetTextNode(); + if( pTextNd ) { + SwTextAttr *const pTextHt = + pTextNd->GetTextAttrForCharAt(nContent, RES_TXTATR_FTN); + if( pTextHt ) { // ok, so get values - SwTxtFtn* pFtn = static_cast<SwTxtFtn*>(pTxtHt); - RemoveIdxFromSection( rDoc, pFtn->GetStartNode()->GetIndex() ); + SwTextFootnote* pFootnote = static_cast<SwTextFootnote*>(pTextHt); + RemoveIdxFromSection( rDoc, pFootnote->GetStartNode()->GetIndex() ); return ; } } @@ -867,8 +867,8 @@ void SwUndoDefaultAttr::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); if ( m_pOldSet.get() ) { - SwUndoFmtAttrHelper aTmp( - *const_cast<SwTxtFmtColl*>(rDoc.GetDfltTxtFmtColl()) ); + SwUndoFormatAttrHelper aTmp( + *const_cast<SwTextFormatColl*>(rDoc.GetDfltTextFormatColl()) ); rDoc.SetDefault( *m_pOldSet ); m_pOldSet.reset( 0 ); if ( aTmp.GetUndo() ) { @@ -930,11 +930,11 @@ void SwUndoMoveLeftMargin::RepeatImpl(::sw::RepeatContext & rContext) } SwUndoChangeFootNote::SwUndoChangeFootNote( - const SwPaM& rRange, const OUString& rTxt, + const SwPaM& rRange, const OUString& rText, sal_uInt16 nNum, bool bIsEndNote ) : SwUndo( UNDO_CHGFTN ), SwUndRng( rRange ) , m_pHistory( new SwHistory() ) - , m_Text( rTxt ) + , m_Text( rText ) , m_nNumber( nNum ) , m_bEndNote( bIsEndNote ) { @@ -951,7 +951,7 @@ void SwUndoChangeFootNote::UndoImpl(::sw::UndoRedoContext & rContext) m_pHistory->TmpRollback( &rDoc, 0 ); m_pHistory->SetTmpEnd( m_pHistory->Count() ); - rDoc.GetFtnIdxs().UpdateAllFtn(); + rDoc.GetFootnoteIdxs().UpdateAllFootnote(); AddUndoRedoPaM(rContext); } @@ -960,19 +960,19 @@ void SwUndoChangeFootNote::RedoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc( rContext.GetDoc() ); SwPaM & rPaM = AddUndoRedoPaM(rContext); - rDoc.SetCurFtn(rPaM, m_Text, m_nNumber, m_bEndNote); + rDoc.SetCurFootnote(rPaM, m_Text, m_nNumber, m_bEndNote); SetPaM(rPaM); } void SwUndoChangeFootNote::RepeatImpl(::sw::RepeatContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - rDoc.SetCurFtn( rContext.GetRepeatPaM(), m_Text, m_nNumber, m_bEndNote ); + rDoc.SetCurFootnote( rContext.GetRepeatPaM(), m_Text, m_nNumber, m_bEndNote ); } -SwUndoFootNoteInfo::SwUndoFootNoteInfo( const SwFtnInfo &rInfo ) +SwUndoFootNoteInfo::SwUndoFootNoteInfo( const SwFootnoteInfo &rInfo ) : SwUndo( UNDO_FTNINFO ) - , m_pFootNoteInfo( new SwFtnInfo( rInfo ) ) + , m_pFootNoteInfo( new SwFootnoteInfo( rInfo ) ) { } @@ -983,16 +983,16 @@ SwUndoFootNoteInfo::~SwUndoFootNoteInfo() void SwUndoFootNoteInfo::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - SwFtnInfo *pInf = new SwFtnInfo( rDoc.GetFtnInfo() ); - rDoc.SetFtnInfo( *m_pFootNoteInfo ); + SwFootnoteInfo *pInf = new SwFootnoteInfo( rDoc.GetFootnoteInfo() ); + rDoc.SetFootnoteInfo( *m_pFootNoteInfo ); m_pFootNoteInfo.reset( pInf ); } void SwUndoFootNoteInfo::RedoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - SwFtnInfo *pInf = new SwFtnInfo( rDoc.GetFtnInfo() ); - rDoc.SetFtnInfo( *m_pFootNoteInfo ); + SwFootnoteInfo *pInf = new SwFootnoteInfo( rDoc.GetFootnoteInfo() ); + rDoc.SetFootnoteInfo( *m_pFootNoteInfo ); m_pFootNoteInfo.reset( pInf ); } @@ -1022,40 +1022,40 @@ void SwUndoEndNoteInfo::RedoImpl(::sw::UndoRedoContext & rContext) m_pEndNoteInfo.reset( pInf ); } -SwUndoDontExpandFmt::SwUndoDontExpandFmt( const SwPosition& rPos ) +SwUndoDontExpandFormat::SwUndoDontExpandFormat( const SwPosition& rPos ) : SwUndo( UNDO_DONTEXPAND ) , m_nNodeIndex( rPos.nNode.GetIndex() ) , m_nContentIndex( rPos.nContent.GetIndex() ) { } -void SwUndoDontExpandFmt::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoDontExpandFormat::UndoImpl(::sw::UndoRedoContext & rContext) { SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor()); SwDoc *const pDoc = & rContext.GetDoc(); SwPosition& rPos = *pPam->GetPoint(); rPos.nNode = m_nNodeIndex; - rPos.nContent.Assign( rPos.nNode.GetNode().GetCntntNode(), m_nContentIndex); - pDoc->DontExpandFmt( rPos, false ); + rPos.nContent.Assign( rPos.nNode.GetNode().GetContentNode(), m_nContentIndex); + pDoc->DontExpandFormat( rPos, false ); } -void SwUndoDontExpandFmt::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoDontExpandFormat::RedoImpl(::sw::UndoRedoContext & rContext) { SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor()); SwDoc *const pDoc = & rContext.GetDoc(); SwPosition& rPos = *pPam->GetPoint(); rPos.nNode = m_nNodeIndex; - rPos.nContent.Assign( rPos.nNode.GetNode().GetCntntNode(), m_nContentIndex); - pDoc->DontExpandFmt( rPos ); + rPos.nContent.Assign( rPos.nNode.GetNode().GetContentNode(), m_nContentIndex); + pDoc->DontExpandFormat( rPos ); } -void SwUndoDontExpandFmt::RepeatImpl(::sw::RepeatContext & rContext) +void SwUndoDontExpandFormat::RepeatImpl(::sw::RepeatContext & rContext) { SwPaM & rPam = rContext.GetRepeatPaM(); SwDoc & rDoc = rContext.GetDoc(); - rDoc.DontExpandFmt( *rPam.GetPoint() ); + rDoc.DontExpandFormat( *rPam.GetPoint() ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index e03897beeb13..c2871f964e72 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -50,19 +50,19 @@ ( == AUTO ), if the anchor frame has be moved via _MoveNodes(..) and DelFrms(..) */ -static void lcl_MakeAutoFrms( const SwFrmFmts& rSpzArr, sal_uLong nMovedIndex ) +static void lcl_MakeAutoFrms( const SwFrameFormats& rSpzArr, sal_uLong nMovedIndex ) { if( !rSpzArr.empty() ) { for( size_t n = 0; n < rSpzArr.size(); ++n ) { - SwFrmFmt * pFmt = rSpzArr[n]; - const SwFmtAnchor* pAnchor = &pFmt->GetAnchor(); + SwFrameFormat * pFormat = rSpzArr[n]; + const SwFormatAnchor* pAnchor = &pFormat->GetAnchor(); if (pAnchor->GetAnchorId() == FLY_AT_CHAR) { - const SwPosition* pAPos = pAnchor->GetCntntAnchor(); + const SwPosition* pAPos = pAnchor->GetContentAnchor(); if( pAPos && nMovedIndex == pAPos->nNode.GetIndex() ) - pFmt->MakeFrms(); + pFormat->MakeFrms(); } } } @@ -96,7 +96,7 @@ static void lcl_MakeAutoFrms( const SwFrmFmts& rSpzArr, sal_uLong nMovedIndex ) SwUndoDelete::SwUndoDelete( SwPaM& rPam, bool bFullPara, - bool bCalledByTblCpy ) + bool bCalledByTableCpy ) : SwUndo(UNDO_DELETE), SwUndRng( rPam ), pMvStt( 0 ), @@ -112,19 +112,19 @@ SwUndoDelete::SwUndoDelete( bGroup( false ), bBackSp( false ), bJoinNext( false ), - bTblDelLastNd( false ), + bTableDelLastNd( false ), // bFullPara is set e.g. if an empty paragraph before a table is deleted bDelFullPara( bFullPara ), bResetPgDesc( false ), bResetPgBrk( false ), - bFromTableCopy( bCalledByTblCpy ) + bFromTableCopy( bCalledByTableCpy ) { bCacheComment = false; SwDoc * pDoc = rPam.GetDoc(); - if( !pDoc->getIDocumentRedlineAccess().IsIgnoreRedline() && !pDoc->getIDocumentRedlineAccess().GetRedlineTbl().empty() ) + if( !pDoc->getIDocumentRedlineAccess().IsIgnoreRedline() && !pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() ) { pRedlSaveData = new SwRedlineSaveDatas; if( !FillSaveData( rPam, *pRedlSaveData )) @@ -144,15 +144,15 @@ SwUndoDelete::SwUndoDelete( if( bDelFullPara ) { OSL_ENSURE( rPam.HasMark(), "PaM ohne Mark" ); - DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint(), - DelCntntType(nsDelCntntType::DELCNT_ALL | nsDelCntntType::DELCNT_CHKNOCNTNT) ); + DelContentIndex( *rPam.GetMark(), *rPam.GetPoint(), + DelContentType(nsDelContentType::DELCNT_ALL | nsDelContentType::DELCNT_CHKNOCNTNT) ); ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); _DelBookmarks(pStt->nNode, pEnd->nNode); } else { - DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint() ); + DelContentIndex( *rPam.GetMark(), *rPam.GetPoint() ); ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); if (nEndNode - nSttNode > 1) // check for fully selected nodes { @@ -169,55 +169,55 @@ SwUndoDelete::SwUndoDelete( bJoinNext = !bFullPara && pEnd == rPam.GetPoint(); bBackSp = !bFullPara && !bJoinNext; - SwTxtNode *pSttTxtNd = 0, *pEndTxtNd = 0; + SwTextNode *pSttTextNd = 0, *pEndTextNd = 0; if( !bFullPara ) { - pSttTxtNd = pStt->nNode.GetNode().GetTxtNode(); - pEndTxtNd = nSttNode == nEndNode - ? pSttTxtNd - : pEnd->nNode.GetNode().GetTxtNode(); + pSttTextNd = pStt->nNode.GetNode().GetTextNode(); + pEndTextNd = nSttNode == nEndNode + ? pSttTextNd + : pEnd->nNode.GetNode().GetTextNode(); } bool bMoveNds = *pStt != *pEnd // any area still existent? - && ( SaveCntnt( pStt, pEnd, pSttTxtNd, pEndTxtNd ) || bFromTableCopy ); + && ( SaveContent( pStt, pEnd, pSttTextNd, pEndTextNd ) || bFromTableCopy ); - if( pSttTxtNd && pEndTxtNd && pSttTxtNd != pEndTxtNd ) + if( pSttTextNd && pEndTextNd && pSttTextNd != pEndTextNd ) { // two different TextNodes, thus save also the TextFormatCollection - pHistory->Add( pSttTxtNd->GetTxtColl(),pStt->nNode.GetIndex(), ND_TEXTNODE ); - pHistory->Add( pEndTxtNd->GetTxtColl(),pEnd->nNode.GetIndex(), ND_TEXTNODE ); + pHistory->Add( pSttTextNd->GetTextColl(),pStt->nNode.GetIndex(), ND_TEXTNODE ); + pHistory->Add( pEndTextNd->GetTextColl(),pEnd->nNode.GetIndex(), ND_TEXTNODE ); if( !bJoinNext ) // Selection from bottom to top { // When using JoinPrev() all AUTO-PageBreak's will be copied // correctly. To restore them with UNDO, Auto-PageBreak of the // EndNode needs to be reset. Same for PageDesc and ColBreak. - if( pEndTxtNd->HasSwAttrSet() ) + if( pEndTextNd->HasSwAttrSet() ) { - SwRegHistory aRegHist( *pEndTxtNd, pHistory ); - if( SfxItemState::SET == pEndTxtNd->GetpSwAttrSet()->GetItemState( + SwRegHistory aRegHist( *pEndTextNd, pHistory ); + if( SfxItemState::SET == pEndTextNd->GetpSwAttrSet()->GetItemState( RES_BREAK, false ) ) - pEndTxtNd->ResetAttr( RES_BREAK ); - if( pEndTxtNd->HasSwAttrSet() && - SfxItemState::SET == pEndTxtNd->GetpSwAttrSet()->GetItemState( + pEndTextNd->ResetAttr( RES_BREAK ); + if( pEndTextNd->HasSwAttrSet() && + SfxItemState::SET == pEndTextNd->GetpSwAttrSet()->GetItemState( RES_PAGEDESC, false ) ) - pEndTxtNd->ResetAttr( RES_PAGEDESC ); + pEndTextNd->ResetAttr( RES_PAGEDESC ); } } } // Move now also the PaM. The SPoint is at the beginning of a SSelection. - if( pEnd == rPam.GetPoint() && ( !bFullPara || pSttTxtNd || pEndTxtNd ) ) + if( pEnd == rPam.GetPoint() && ( !bFullPara || pSttTextNd || pEndTextNd ) ) rPam.Exchange(); - if( !pSttTxtNd && !pEndTxtNd ) + if( !pSttTextNd && !pEndTextNd ) --rPam.GetPoint()->nNode; rPam.DeleteMark(); // the SPoint is in the selection - if( !pEndTxtNd ) - nEndCntnt = 0; - if( !pSttTxtNd ) - nSttCntnt = 0; + if( !pEndTextNd ) + nEndContent = 0; + if( !pSttTextNd ) + nSttContent = 0; if( bMoveNds ) // Do Nodes exist that need to be moved? { @@ -225,7 +225,7 @@ SwUndoDelete::SwUndoDelete( SwNodes& rDocNds = pDoc->GetNodes(); SwNodeRange aRg( rDocNds, nSttNode - nNdDiff, rDocNds, nEndNode - nNdDiff ); - if( !bFullPara && !pEndTxtNd && + if( !bFullPara && !pEndTextNd && &aRg.aEnd.GetNode() != &pDoc->GetNodes().GetEndOfContent() ) { SwNode* pNode = aRg.aEnd.GetNode().StartOfSectionNode(); @@ -247,14 +247,14 @@ SwUndoDelete::SwUndoDelete( if( nReplaceDummy ) { // The selection has been expanded, because ++aRg.aEnd; - if( pEndTxtNd ) + if( pEndTextNd ) { // The end text node has to leave the (expanded) selection // The dummy is needed because _MoveNodes deletes empty // sections ++nReplaceDummy; - SwNodeRange aMvRg( *pEndTxtNd, 0, *pEndTxtNd, 1 ); - SwPosition aSplitPos( *pEndTxtNd ); + SwNodeRange aMvRg( *pEndTextNd, 0, *pEndTextNd, 1 ); + SwPosition aSplitPos( *pEndTextNd ); ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo()); pDoc->getIDocumentContentOperations().SplitNode( aSplitPos, false ); rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aEnd, true ); @@ -272,13 +272,13 @@ SwUndoDelete::SwUndoDelete( ( (pTmpNd = rDocNds[ aRg.aStart.GetIndex()-1 ])->IsSectionNode() && pTmpNd->EndOfSectionIndex() < aRg.aEnd.GetIndex() ) ) --aRg.aStart; - if( pSttTxtNd ) + if( pSttTextNd ) { nReplaceDummy = nSttNode - nNdDiff - aRg.aStart.GetIndex(); if( nReplaceDummy ) { - SwNodeRange aMvRg( *pSttTxtNd, 0, *pSttTxtNd, 1 ); - SwPosition aSplitPos( *pSttTxtNd ); + SwNodeRange aMvRg( *pSttTextNd, 0, *pSttTextNd, 1 ); + SwPosition aSplitPos( *pSttTextNd ); ::sw::UndoGuard const ug(pDoc->GetIDocumentUndoRedo()); pDoc->getIDocumentContentOperations().SplitNode( aSplitPos, false ); rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aStart, true ); @@ -289,15 +289,15 @@ SwUndoDelete::SwUndoDelete( if( bFromTableCopy ) { - if( !pEndTxtNd ) + if( !pEndTextNd ) { - if( pSttTxtNd ) + if( pSttTextNd ) ++aRg.aStart; - else if( !bFullPara && !aRg.aEnd.GetNode().IsCntntNode() ) + else if( !bFullPara && !aRg.aEnd.GetNode().IsContentNode() ) --aRg.aEnd; } } - else if (pSttTxtNd && (pEndTxtNd || pSttTxtNd->GetTxt().getLength())) + else if (pSttTextNd && (pEndTextNd || pSttTextNd->GetText().getLength())) ++aRg.aStart; // Step 3: Moving into UndoArray... @@ -307,7 +307,7 @@ SwUndoDelete::SwUndoDelete( // remember difference! nNode = rNds.GetEndOfContent().GetIndex() - nNode; - if( pSttTxtNd && pEndTxtNd ) + if( pSttTextNd && pEndTextNd ) { //Step 4: Moving around sections nSectDiff = aRg.aEnd.GetIndex() - aRg.aStart.GetIndex(); @@ -318,26 +318,26 @@ SwUndoDelete::SwUndoDelete( { if( bJoinNext ) { - SwNodeRange aMvRg( *pEndTxtNd, 0, *pEndTxtNd, 1 ); + SwNodeRange aMvRg( *pEndTextNd, 0, *pEndTextNd, 1 ); rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aStart, true ); } else { - SwNodeRange aMvRg( *pSttTxtNd, 0, *pSttTxtNd, 1 ); + SwNodeRange aMvRg( *pSttTextNd, 0, *pSttTextNd, 1 ); rDocNds._MoveNodes( aMvRg, rDocNds, aRg.aEnd, true ); } } } if( nSectDiff || nReplaceDummy ) - lcl_MakeAutoFrms( *pDoc->GetSpzFrmFmts(), - bJoinNext ? pEndTxtNd->GetIndex() : pSttTxtNd->GetIndex() ); + lcl_MakeAutoFrms( *pDoc->GetSpzFrameFormats(), + bJoinNext ? pEndTextNd->GetIndex() : pSttTextNd->GetIndex() ); } else nNode = 0; // moved no node -> no difference at the end // Are there any Nodes that got deleted before that (FootNotes // have ContentNodes)? - if( !pSttTxtNd && !pEndTxtNd ) + if( !pSttTextNd && !pEndTextNd ) { nNdDiff = nSttNode - rPam.GetPoint()->nNode.GetIndex() - (bFullPara ? 0 : 1); rPam.Move( fnMoveForward, fnGoNode ); @@ -350,7 +350,7 @@ SwUndoDelete::SwUndoDelete( nNdDiff -= rPam.GetPoint()->nNode.GetIndex(); } - if( !rPam.GetNode().IsCntntNode() ) + if( !rPam.GetNode().IsContentNode() ) rPam.GetPoint()->nContent.Assign( 0, 0 ); // is a history necessary here at all? @@ -358,42 +358,42 @@ SwUndoDelete::SwUndoDelete( DELETEZ( pHistory ); } -bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd, - SwTxtNode* pSttTxtNd, SwTxtNode* pEndTxtNd ) +bool SwUndoDelete::SaveContent( const SwPosition* pStt, const SwPosition* pEnd, + SwTextNode* pSttTextNd, SwTextNode* pEndTextNd ) { sal_uLong nNdIdx = pStt->nNode.GetIndex(); // 1 - copy start in Start-String - if( pSttTxtNd ) + if( pSttTextNd ) { bool bOneNode = nSttNode == nEndNode; - SwRegHistory aRHst( *pSttTxtNd, pHistory ); + SwRegHistory aRHst( *pSttTextNd, pHistory ); // always save all text atttibutes because of possibly overlapping // areas of on/off - pHistory->CopyAttr( pSttTxtNd->GetpSwpHints(), nNdIdx, - 0, pSttTxtNd->GetTxt().getLength(), true ); - if( !bOneNode && pSttTxtNd->HasSwAttrSet() ) - pHistory->CopyFmtAttr( *pSttTxtNd->GetpSwAttrSet(), nNdIdx ); + pHistory->CopyAttr( pSttTextNd->GetpSwpHints(), nNdIdx, + 0, pSttTextNd->GetText().getLength(), true ); + if( !bOneNode && pSttTextNd->HasSwAttrSet() ) + pHistory->CopyFormatAttr( *pSttTextNd->GetpSwAttrSet(), nNdIdx ); // the length might have changed (!!Fields!!) sal_Int32 nLen = ((bOneNode) ? pEnd->nContent.GetIndex() - : pSttTxtNd->GetTxt().getLength()) + : pSttTextNd->GetText().getLength()) - pStt->nContent.GetIndex(); // delete now also the text (all attribute changes are added to // UNDO history) - pSttStr = new OUString( pSttTxtNd->GetTxt().copy(nSttCntnt, nLen)); - pSttTxtNd->EraseText( pStt->nContent, nLen ); - if( pSttTxtNd->GetpSwpHints() ) - pSttTxtNd->GetpSwpHints()->DeRegister(); + pSttStr = new OUString( pSttTextNd->GetText().copy(nSttContent, nLen)); + pSttTextNd->EraseText( pStt->nContent, nLen ); + if( pSttTextNd->GetpSwpHints() ) + pSttTextNd->GetpSwpHints()->DeRegister(); // METADATA: store - bool emptied( !pSttStr->isEmpty() && !pSttTxtNd->Len() ); + bool emptied( !pSttStr->isEmpty() && !pSttTextNd->Len() ); if (!bOneNode || emptied) // merging may overwrite xmlids... { m_pMetadataUndoStart = (emptied) - ? pSttTxtNd->CreateUndoForDelete() - : pSttTxtNd->CreateUndo(); + ? pSttTextNd->CreateUndoForDelete() + : pSttTextNd->CreateUndo(); } if( bOneNode ) @@ -401,38 +401,38 @@ bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd, } // 2 - copy end into End-String - if( pEndTxtNd ) + if( pEndTextNd ) { - SwIndex aEndIdx( pEndTxtNd ); + SwIndex aEndIdx( pEndTextNd ); nNdIdx = pEnd->nNode.GetIndex(); - SwRegHistory aRHst( *pEndTxtNd, pHistory ); + SwRegHistory aRHst( *pEndTextNd, pHistory ); // always save all text atttibutes because of possibly overlapping // areas of on/off - pHistory->CopyAttr( pEndTxtNd->GetpSwpHints(), nNdIdx, 0, - pEndTxtNd->GetTxt().getLength(), true ); + pHistory->CopyAttr( pEndTextNd->GetpSwpHints(), nNdIdx, 0, + pEndTextNd->GetText().getLength(), true ); - if( pEndTxtNd->HasSwAttrSet() ) - pHistory->CopyFmtAttr( *pEndTxtNd->GetpSwAttrSet(), nNdIdx ); + if( pEndTextNd->HasSwAttrSet() ) + pHistory->CopyFormatAttr( *pEndTextNd->GetpSwAttrSet(), nNdIdx ); // delete now also the text (all attribute changes are added to // UNDO history) - pEndStr = new OUString( pEndTxtNd->GetTxt().copy( 0, + pEndStr = new OUString( pEndTextNd->GetText().copy( 0, pEnd->nContent.GetIndex() )); - pEndTxtNd->EraseText( aEndIdx, pEnd->nContent.GetIndex() ); - if( pEndTxtNd->GetpSwpHints() ) - pEndTxtNd->GetpSwpHints()->DeRegister(); + pEndTextNd->EraseText( aEndIdx, pEnd->nContent.GetIndex() ); + if( pEndTextNd->GetpSwpHints() ) + pEndTextNd->GetpSwpHints()->DeRegister(); // METADATA: store - bool emptied = !pEndStr->isEmpty() && !pEndTxtNd->Len(); + bool emptied = !pEndStr->isEmpty() && !pEndTextNd->Len(); m_pMetadataUndoEnd = (emptied) - ? pEndTxtNd->CreateUndoForDelete() - : pEndTxtNd->CreateUndo(); + ? pEndTextNd->CreateUndoForDelete() + : pEndTextNd->CreateUndo(); } // if there are only two Nodes than we're done - if( ( pSttTxtNd || pEndTxtNd ) && nSttNode + 1 == nEndNode ) + if( ( pSttTextNd || pEndTextNd ) && nSttNode + 1 == nEndNode ) return false; // do not move any Node return true; // move Nodes lying in between @@ -445,7 +445,7 @@ bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) return false; // only the deletion of single char's can be condensed - if( nSttNode != nEndNode || ( !bGroup && nSttCntnt+1 != nEndCntnt )) + if( nSttNode != nEndNode || ( !bGroup && nSttContent+1 != nEndContent )) return false; const SwPosition *pStt = rDelPam.Start(), @@ -460,12 +460,12 @@ bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) // Distinguish between BackSpace and Delete because the Undo array needs to // be constructed differently! - if( pEnd->nContent == nSttCntnt ) + if( pEnd->nContent == nSttContent ) { if( bGroup && !bBackSp ) return false; bBackSp = true; } - else if( pStt->nContent == nSttCntnt ) + else if( pStt->nContent == nSttContent ) { if( bGroup && bBackSp ) return false; bBackSp = false; @@ -474,11 +474,11 @@ bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) return false; // are both Nodes (Node/Undo array) TextNodes at all? - SwTxtNode * pDelTxtNd = pStt->nNode.GetNode().GetTxtNode(); - if( !pDelTxtNd ) return false; + SwTextNode * pDelTextNd = pStt->nNode.GetNode().GetTextNode(); + if( !pDelTextNd ) return false; sal_Int32 nUChrPos = bBackSp ? 0 : pSttStr->getLength()-1; - sal_Unicode cDelChar = pDelTxtNd->GetTxt()[ pStt->nContent.GetIndex() ]; + sal_Unicode cDelChar = pDelTextNd->GetText()[ pStt->nContent.GetIndex() ]; CharClass& rCC = GetAppCharClass(); if( ( CH_TXTATR_BREAKWORD == cDelChar || CH_TXTATR_INWORD == cDelChar ) || rCC.isLetterNumeric( OUString( cDelChar ), 0 ) != @@ -501,14 +501,14 @@ bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) // Both 'deletes' can be consolidated, so 'move' the related character if( bBackSp ) - nSttCntnt--; // BackSpace: add char to array! + nSttContent--; // BackSpace: add char to array! else { - nEndCntnt++; // Delete: attach char at the end + nEndContent++; // Delete: attach char at the end nUChrPos++; } (*pSttStr) = pSttStr->replaceAt( nUChrPos, 0, OUString(cDelChar) ); - pDelTxtNd->EraseText( pStt->nContent, 1 ); + pDelTextNd->EraseText( pStt->nContent, 1 ); bGroup = true; return true; @@ -717,26 +717,26 @@ SwRewriter SwUndoDelete::GetRewriter() const return aResult; } -// Every object, anchored "AtCntnt" will be reanchored at rPos -static void lcl_ReAnchorAtCntntFlyFrames( const SwFrmFmts& rSpzArr, SwPosition &rPos, sal_uLong nOldIdx ) +// Every object, anchored "AtContent" will be reanchored at rPos +static void lcl_ReAnchorAtContentFlyFrames( const SwFrameFormats& rSpzArr, SwPosition &rPos, sal_uLong nOldIdx ) { if( !rSpzArr.empty() ) { - SwFlyFrmFmt* pFmt; - const SwFmtAnchor* pAnchor; + SwFlyFrameFormat* pFormat; + const SwFormatAnchor* pAnchor; const SwPosition* pAPos; for( size_t n = 0; n < rSpzArr.size(); ++n ) { - pFmt = static_cast<SwFlyFrmFmt*>(rSpzArr[n]); - pAnchor = &pFmt->GetAnchor(); + pFormat = static_cast<SwFlyFrameFormat*>(rSpzArr[n]); + pAnchor = &pFormat->GetAnchor(); if (pAnchor->GetAnchorId() == FLY_AT_PARA) { - pAPos = pAnchor->GetCntntAnchor(); + pAPos = pAnchor->GetContentAnchor(); if( pAPos && nOldIdx == pAPos->nNode.GetIndex() ) { - SwFmtAnchor aAnch( *pAnchor ); + SwFormatAnchor aAnch( *pAnchor ); aAnch.SetAnchor( &rPos ); - pFmt->SetFmtAttr( aAnch ); + pFormat->SetFormatAttr( aAnch ); } } } @@ -761,17 +761,17 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) { if( pInsNd->IsTableNode() ) { - pInsNd = pDoc->GetNodes().MakeTxtNode( aIdx, - pDoc->GetDfltTxtFmtColl() ); + pInsNd = pDoc->GetNodes().MakeTextNode( aIdx, + pDoc->GetDfltTextFormatColl() ); --aIdx; aPos.nNode = aIdx; - aPos.nContent.Assign( pInsNd->GetCntntNode(), nSttCntnt ); + aPos.nContent.Assign( pInsNd->GetContentNode(), nSttContent ); } else { - if( pInsNd->IsCntntNode() ) - aPos.nContent.Assign( static_cast<SwCntntNode*>(pInsNd), nSttCntnt ); - if( !bTblDelLastNd ) + if( pInsNd->IsContentNode() ) + aPos.nContent.Assign( static_cast<SwContentNode*>(pInsNd), nSttContent ); + if( !bTableDelLastNd ) pInsNd = 0; // do not delete Node! } } @@ -783,13 +783,13 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) if( pEndStr ) { // discard attributes since they all saved! - SwTxtNode* pTxtNd = aPos.nNode.GetNode().GetTxtNode(); + SwTextNode* pTextNd = aPos.nNode.GetNode().GetTextNode(); - if( pTxtNd && pTxtNd->HasSwAttrSet() ) - pTxtNd->ResetAllAttr(); + if( pTextNd && pTextNd->HasSwAttrSet() ) + pTextNd->ResetAllAttr(); - if( pTxtNd && pTxtNd->GetpSwpHints() ) - pTxtNd->ClearSwpHintsArr( true ); + if( pTextNd && pTextNd->GetpSwpHints() ) + pTextNd->ClearSwpHintsArr( true ); if( pSttStr && !bFromTableCopy ) { @@ -800,30 +800,30 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) // on anchoring at the start of the selection // => selection backwards needs a correction. if( bBackSp ) - lcl_ReAnchorAtCntntFlyFrames( *pDoc->GetSpzFrmFmts(), aPos, nOldIdx ); - pTxtNd = aPos.nNode.GetNode().GetTxtNode(); + lcl_ReAnchorAtContentFlyFrames( *pDoc->GetSpzFrameFormats(), aPos, nOldIdx ); + pTextNd = aPos.nNode.GetNode().GetTextNode(); } - if( pTxtNd ) + if( pTextNd ) { - OUString const ins( pTxtNd->InsertText(*pEndStr, aPos.nContent, + OUString const ins( pTextNd->InsertText(*pEndStr, aPos.nContent, SwInsertFlags::NOHINTEXPAND) ); assert(ins.getLength() == pEndStr->getLength()); // must succeed (void) ins; // METADATA: restore - pTxtNd->RestoreMetadata(m_pMetadataUndoEnd); + pTextNd->RestoreMetadata(m_pMetadataUndoEnd); } } else if( pSttStr && bNodeMove ) { - SwTxtNode * pNd = aPos.nNode.GetNode().GetTxtNode(); + SwTextNode * pNd = aPos.nNode.GetNode().GetTextNode(); if( pNd ) { - if (nSttCntnt < pNd->GetTxt().getLength()) + if (nSttContent < pNd->GetText().getLength()) { sal_uLong nOldIdx = aPos.nNode.GetIndex(); pDoc->getIDocumentContentOperations().SplitNode( aPos, false ); if( bBackSp ) - lcl_ReAnchorAtCntntFlyFrames( *pDoc->GetSpzFrmFmts(), aPos, nOldIdx ); + lcl_ReAnchorAtContentFlyFrames( *pDoc->GetSpzFrameFormats(), aPos, nOldIdx ); } else ++aPos.nNode; @@ -881,31 +881,31 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) } if( pMovedNode ) - lcl_MakeAutoFrms( *pDoc->GetSpzFrmFmts(), pMovedNode->GetIndex() ); + lcl_MakeAutoFrms( *pDoc->GetSpzFrameFormats(), pMovedNode->GetIndex() ); if( pSttStr ) { aPos.nNode = nSttNode - nNdDiff + ( bJoinNext ? 0 : nReplaceDummy ); - SwTxtNode * pTxtNd = aPos.nNode.GetNode().GetTxtNode(); + SwTextNode * pTextNd = aPos.nNode.GetNode().GetTextNode(); // If more than a single Node got deleted, also all "Node" // attributes were saved - if (pTxtNd != NULL) + if (pTextNd != NULL) { - if( pTxtNd->HasSwAttrSet() && bNodeMove && !pEndStr ) - pTxtNd->ResetAllAttr(); + if( pTextNd->HasSwAttrSet() && bNodeMove && !pEndStr ) + pTextNd->ResetAllAttr(); - if( pTxtNd->GetpSwpHints() ) - pTxtNd->ClearSwpHintsArr( true ); + if( pTextNd->GetpSwpHints() ) + pTextNd->ClearSwpHintsArr( true ); // SectionNode mode and selection from top to bottom: // -> in StartNode is still the rest of the Join => delete - aPos.nContent.Assign( pTxtNd, nSttCntnt ); - OUString const ins( pTxtNd->InsertText(*pSttStr, aPos.nContent, + aPos.nContent.Assign( pTextNd, nSttContent ); + OUString const ins( pTextNd->InsertText(*pSttStr, aPos.nContent, SwInsertFlags::NOHINTEXPAND) ); assert(ins.getLength() == pSttStr->getLength()); // must succeed (void) ins; // METADATA: restore - pTxtNd->RestoreMetadata(m_pMetadataUndoStart); + pTextNd->RestoreMetadata(m_pMetadataUndoStart); } } @@ -937,10 +937,10 @@ void SwUndoDelete::UndoImpl(::sw::UndoRedoContext & rContext) sal_uInt16 nEnd = static_cast<sal_uInt16>( bResetPgBrk ? RES_BREAK : RES_PAGEDESC ); SwNode* pNode = pDoc->GetNodes()[ nEndNode + 1 ]; - if( pNode->IsCntntNode() ) - static_cast<SwCntntNode*>(pNode)->ResetAttr( nStt, nEnd ); + if( pNode->IsContentNode() ) + static_cast<SwContentNode*>(pNode)->ResetAttr( nStt, nEnd ); else if( pNode->IsTableNode() ) - static_cast<SwTableNode*>(pNode)->GetTable().GetFrmFmt()->ResetFmtAttr( nStt, nEnd ); + static_cast<SwTableNode*>(pNode)->GetTable().GetFrameFormat()->ResetFormatAttr( nStt, nEnd ); } } // delete the temporarily added Node @@ -987,13 +987,13 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext) if( bDelFullPara ) { OSL_ENSURE( rPam.HasMark(), "PaM without Mark" ); - DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint(), - DelCntntType(nsDelCntntType::DELCNT_ALL | nsDelCntntType::DELCNT_CHKNOCNTNT) ); + DelContentIndex( *rPam.GetMark(), *rPam.GetPoint(), + DelContentType(nsDelContentType::DELCNT_ALL | nsDelContentType::DELCNT_CHKNOCNTNT) ); _DelBookmarks(rPam.GetMark()->nNode, rPam.GetPoint()->nNode); } else - DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint() ); + DelContentIndex( *rPam.GetMark(), *rPam.GetPoint() ); nSetPos = pHistory ? pHistory->Count() : 0; pHistory->Move( nSetPos, &aHstr ); @@ -1003,13 +1003,13 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext) if( bDelFullPara ) { OSL_ENSURE( rPam.HasMark(), "PaM without Mark" ); - DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint(), - DelCntntType(nsDelCntntType::DELCNT_ALL | nsDelCntntType::DELCNT_CHKNOCNTNT) ); + DelContentIndex( *rPam.GetMark(), *rPam.GetPoint(), + DelContentType(nsDelContentType::DELCNT_ALL | nsDelContentType::DELCNT_CHKNOCNTNT) ); _DelBookmarks( rPam.GetMark()->nNode, rPam.GetPoint()->nNode ); } else - DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint() ); + DelContentIndex( *rPam.GetMark(), *rPam.GetPoint() ); nSetPos = pHistory ? pHistory->Count() : 0; } @@ -1018,33 +1018,33 @@ void SwUndoDelete::RedoImpl(::sw::UndoRedoContext & rContext) SwNodeIndex aSttIdx = ( bDelFullPara || bJoinNext ) ? rPam.GetMark()->nNode : rPam.GetPoint()->nNode; - SwTableNode* pTblNd = aSttIdx.GetNode().GetTableNode(); - if( pTblNd ) + SwTableNode* pTableNd = aSttIdx.GetNode().GetTableNode(); + if( pTableNd ) { - if( bTblDelLastNd ) + if( bTableDelLastNd ) { // than add again a Node at the end - const SwNodeIndex aTmpIdx( *pTblNd->EndOfSectionNode(), 1 ); - rDoc.GetNodes().MakeTxtNode( aTmpIdx, - rDoc.getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_STANDARD ) ); + const SwNodeIndex aTmpIdx( *pTableNd->EndOfSectionNode(), 1 ); + rDoc.GetNodes().MakeTextNode( aTmpIdx, + rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ) ); } - SwCntntNode* pNextNd = rDoc.GetNodes()[ - pTblNd->EndOfSectionIndex()+1 ]->GetCntntNode(); + SwContentNode* pNextNd = rDoc.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(); + pTableNd->DelFrms(); } // avoid asserts from ~SwIndexReg for deleted nodes @@ -1088,7 +1088,7 @@ void SwUndoDelete::RepeatImpl(::sw::RepeatContext & rContext) if( !rPam.HasMark() ) { rPam.SetMark(); - rPam.Move( fnMoveForward, fnGoCntnt ); + rPam.Move( fnMoveForward, fnGoContent ); } if( bDelFullPara ) rDoc.getIDocumentContentOperations().DelFullPara( rPam ); diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 36d70c64f1d9..1285d1b8d8a3 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -43,7 +43,7 @@ // This class saves the Pam as integers and can recompose those into a PaM SwUndRng::SwUndRng() - : nSttNode( 0 ), nEndNode( 0 ), nSttCntnt( 0 ), nEndCntnt( 0 ) + : nSttNode( 0 ), nEndNode( 0 ), nSttContent( 0 ), nEndContent( 0 ) { } @@ -61,49 +61,49 @@ void SwUndRng::SetValues( const SwPaM& rPam ) ? rPam.GetMark() : rPam.GetPoint(); nEndNode = pEnd->nNode.GetIndex(); - nEndCntnt = pEnd->nContent.GetIndex(); + nEndContent = pEnd->nContent.GetIndex(); } else // no selection !! - nEndNode = 0, nEndCntnt = COMPLETE_STRING; + nEndNode = 0, nEndContent = COMPLETE_STRING; nSttNode = pStt->nNode.GetIndex(); - nSttCntnt = pStt->nContent.GetIndex(); + nSttContent = pStt->nContent.GetIndex(); } -void SwUndRng::SetPaM( SwPaM & rPam, bool bCorrToCntnt ) const +void SwUndRng::SetPaM( SwPaM & rPam, bool bCorrToContent ) const { rPam.DeleteMark(); rPam.GetPoint()->nNode = nSttNode; SwNode& rNd = rPam.GetNode(); - if( rNd.IsCntntNode() ) - rPam.GetPoint()->nContent.Assign( rNd.GetCntntNode(), nSttCntnt ); - else if( bCorrToCntnt ) - rPam.Move( fnMoveForward, fnGoCntnt ); + if( rNd.IsContentNode() ) + rPam.GetPoint()->nContent.Assign( rNd.GetContentNode(), nSttContent ); + else if( bCorrToContent ) + rPam.Move( fnMoveForward, fnGoContent ); else rPam.GetPoint()->nContent.Assign( 0, 0 ); - if( !nEndNode && COMPLETE_STRING == nEndCntnt ) // no selection + if( !nEndNode && COMPLETE_STRING == nEndContent ) // no selection return ; rPam.SetMark(); - if( nSttNode == nEndNode && nSttCntnt == nEndCntnt ) + if( nSttNode == nEndNode && nSttContent == nEndContent ) return; // nothing left to do rPam.GetPoint()->nNode = nEndNode; - if( rPam.GetNode().IsCntntNode() ) - rPam.GetPoint()->nContent.Assign( rPam.GetNode().GetCntntNode(), nEndCntnt ); - else if( bCorrToCntnt ) - rPam.Move( fnMoveBackward, fnGoCntnt ); + if( rPam.GetNode().IsContentNode() ) + rPam.GetPoint()->nContent.Assign( rPam.GetNode().GetContentNode(), nEndContent ); + else if( bCorrToContent ) + rPam.Move( fnMoveBackward, fnGoContent ); else rPam.GetPoint()->nContent.Assign( 0, 0 ); } SwPaM & SwUndRng::AddUndoRedoPaM( - ::sw::UndoRedoContext & rContext, bool const bCorrToCntnt) const + ::sw::UndoRedoContext & rContext, bool const bCorrToContent) const { SwPaM & rPaM( rContext.GetCursorSupplier().CreateNewShellCursor() ); - SetPaM( rPaM, bCorrToCntnt ); + SetPaM( rPaM, bCorrToContent ); return rPaM; } @@ -284,11 +284,11 @@ SwRewriter SwUndo::GetRewriter() const return aResult; } -SwUndoSaveCntnt::SwUndoSaveCntnt() +SwUndoSaveContent::SwUndoSaveContent() : pHistory( 0 ) {} -SwUndoSaveCntnt::~SwUndoSaveCntnt() +SwUndoSaveContent::~SwUndoSaveContent() { delete pHistory; } @@ -301,13 +301,13 @@ SwUndoSaveCntnt::~SwUndoSaveCntnt() // If pEndNdIdx is given, Undo/Redo calls -Ins/DelFly. In that case the whole // section should be moved. -void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx, +void SwUndoSaveContent::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx, sal_uLong* pEndNdIdx, sal_Int32* pEndCntIdx ) { SwDoc& rDoc = *rPaM.GetDoc(); ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo()); - SwNoTxtNode* pCpyNd = rPaM.GetNode().GetNoTxtNode(); + SwNoTextNode* pCpyNd = rPaM.GetNode().GetNoTextNode(); // here comes the actual delete (move) SwNodes & rNds = rDoc.GetUndoManager().GetUndoNodes(); @@ -340,7 +340,7 @@ void SwUndoSaveCntnt::MoveToUndoNds( SwPaM& rPaM, SwNodeIndex* pNodeIdx, *pNodeIdx = aPos.nNode; } -void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx, +void SwUndoSaveContent::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx, SwPosition& rInsPos, sal_uLong* pEndNdIdx, sal_Int32* pEndCntIdx ) { @@ -357,18 +357,18 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx, else { aPaM.GetPoint()->nNode = rNds.GetEndOfExtras(); - GoInCntnt( aPaM, fnMoveBackward ); + GoInContent( aPaM, fnMoveBackward ); } - SwTxtNode* pTxtNd = aPaM.GetNode().GetTxtNode(); - if (!pEndNdIdx && pTxtNd) + SwTextNode* pTextNd = aPaM.GetNode().GetTextNode(); + if (!pEndNdIdx && pTextNd) { if( pEndCntIdx ) - aPaM.GetPoint()->nContent.Assign( pTxtNd, *pEndCntIdx ); + aPaM.GetPoint()->nContent.Assign( pTextNd, *pEndCntIdx ); aPaM.SetMark(); aPaM.GetPoint()->nNode = nNodeIdx; - aPaM.GetPoint()->nContent.Assign(aPaM.GetCntntNode(), 0); + aPaM.GetPoint()->nContent.Assign(aPaM.GetContentNode(), 0); _SaveRedlEndPosForRestore aRedlRest( rInsPos.nNode, rInsPos.nContent.GetIndex() ); @@ -388,7 +388,7 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx, aRedlRest.Restore(); } - else if( pEndNdIdx || !pTxtNd ) + else if( pEndNdIdx || !pTextNd ) { SwNodeRange aRg( rNds, nNodeIdx, rNds, (pEndNdIdx ? ((*pEndNdIdx) + 1) @@ -405,7 +405,7 @@ void SwUndoSaveCntnt::MoveFromUndoNds( SwDoc& rDoc, sal_uLong nNodeIdx, // can span an area for a Undo/Redo. (The Point is then positioned in front of // the area to manipulate!) // The flag indicates if there is still content in front of Point. -bool SwUndoSaveCntnt::MovePtBackward( SwPaM& rPam ) +bool SwUndoSaveContent::MovePtBackward( SwPaM& rPam ) { rPam.SetMark(); if( rPam.Move( fnMoveBackward )) @@ -418,7 +418,7 @@ bool SwUndoSaveCntnt::MovePtBackward( SwPaM& rPam ) return false; } -void SwUndoSaveCntnt::MovePtForward( SwPaM& rPam, bool bMvBkwrd ) +void SwUndoSaveContent::MovePtForward( SwPaM& rPam, bool bMvBkwrd ) { // Was there content before this position? if( bMvBkwrd ) @@ -426,7 +426,7 @@ void SwUndoSaveCntnt::MovePtForward( SwPaM& rPam, bool bMvBkwrd ) else { ++rPam.GetPoint()->nNode; - SwCntntNode* pCNd = rPam.GetCntntNode(); + SwContentNode* pCNd = rPam.GetContentNode(); if( pCNd ) pCNd->MakeStartIndex( &rPam.GetPoint()->nContent ); else @@ -444,9 +444,9 @@ void SwUndoSaveCntnt::MovePtForward( SwPaM& rPam, bool bMvBkwrd ) // #i81002# - extending method // delete certain (not all) cross-reference bookmarks at text node of <rMark> // and at text node of <rPoint>, if these text nodes aren't the same. -void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, +void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark, const SwPosition& rPoint, - DelCntntType nDelCntntType ) + DelContentType nDelContentType ) { const SwPosition *pStt = rMark < rPoint ? &rMark : &rPoint, *pEnd = &rMark == pStt ? &rPoint : &rMark; @@ -456,28 +456,28 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); // 1. Footnotes - if( nsDelCntntType::DELCNT_FTN & nDelCntntType ) + if( nsDelContentType::DELCNT_FTN & nDelContentType ) { - SwFtnIdxs& rFtnArr = pDoc->GetFtnIdxs(); - if( !rFtnArr.empty() ) + SwFootnoteIdxs& rFootnoteArr = pDoc->GetFootnoteIdxs(); + if( !rFootnoteArr.empty() ) { - const SwNode* pFtnNd; + const SwNode* pFootnoteNd; size_t nPos = 0; - rFtnArr.SeekEntry( pStt->nNode, &nPos ); - SwTxtFtn* pSrch; + rFootnoteArr.SeekEntry( pStt->nNode, &nPos ); + SwTextFootnote* pSrch; // for now delete all that come afterwards - while( nPos < rFtnArr.size() && ( pFtnNd = - &( pSrch = rFtnArr[ nPos ] )->GetTxtNode())->GetIndex() + while( nPos < rFootnoteArr.size() && ( pFootnoteNd = + &( pSrch = rFootnoteArr[ nPos ] )->GetTextNode())->GetIndex() <= pEnd->nNode.GetIndex() ) { - const sal_Int32 nFtnSttIdx = pSrch->GetStart(); - if( (nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType ) - ? (&pEnd->nNode.GetNode() == pFtnNd ) - : (( &pStt->nNode.GetNode() == pFtnNd && - pStt->nContent.GetIndex() > nFtnSttIdx) || - ( &pEnd->nNode.GetNode() == pFtnNd && - nFtnSttIdx >= pEnd->nContent.GetIndex() )) ) + const sal_Int32 nFootnoteSttIdx = pSrch->GetStart(); + if( (nsDelContentType::DELCNT_CHKNOCNTNT & nDelContentType ) + ? (&pEnd->nNode.GetNode() == pFootnoteNd ) + : (( &pStt->nNode.GetNode() == pFootnoteNd && + pStt->nContent.GetIndex() > nFootnoteSttIdx) || + ( &pEnd->nNode.GetNode() == pFootnoteNd && + nFootnoteSttIdx >= pEnd->nContent.GetIndex() )) ) { ++nPos; // continue searching continue; @@ -486,90 +486,90 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, // FIXME: duplicated code here and below -> refactor? // Unfortunately an index needs to be created. Otherwise there // will be problems with TextNode because the index will be - // deleted in the DTOR of SwFtn! - SwTxtNode* pTxtNd = const_cast<SwTxtNode*>(static_cast<const SwTxtNode*>(pFtnNd)); + // deleted in the DTOR of SwFootnote! + SwTextNode* pTextNd = const_cast<SwTextNode*>(static_cast<const SwTextNode*>(pFootnoteNd)); if( !pHistory ) pHistory = new SwHistory; - SwTxtAttr* const pFtnHnt = - pTxtNd->GetTxtAttrForCharAt( nFtnSttIdx ); - assert(pFtnHnt); - SwIndex aIdx( pTxtNd, nFtnSttIdx ); - pHistory->Add( pFtnHnt, pTxtNd->GetIndex(), false ); - pTxtNd->EraseText( aIdx, 1 ); + SwTextAttr* const pFootnoteHint = + pTextNd->GetTextAttrForCharAt( nFootnoteSttIdx ); + assert(pFootnoteHint); + SwIndex aIdx( pTextNd, nFootnoteSttIdx ); + pHistory->Add( pFootnoteHint, pTextNd->GetIndex(), false ); + pTextNd->EraseText( aIdx, 1 ); } - while( nPos-- && ( pFtnNd = &( pSrch = rFtnArr[ nPos ] )-> - GetTxtNode())->GetIndex() >= pStt->nNode.GetIndex() ) + while( nPos-- && ( pFootnoteNd = &( pSrch = rFootnoteArr[ nPos ] )-> + GetTextNode())->GetIndex() >= pStt->nNode.GetIndex() ) { - const sal_Int32 nFtnSttIdx = pSrch->GetStart(); - if( !(nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType) && ( - ( &pStt->nNode.GetNode() == pFtnNd && - pStt->nContent.GetIndex() > nFtnSttIdx ) || - ( &pEnd->nNode.GetNode() == pFtnNd && - nFtnSttIdx >= pEnd->nContent.GetIndex() ))) + const sal_Int32 nFootnoteSttIdx = pSrch->GetStart(); + if( !(nsDelContentType::DELCNT_CHKNOCNTNT & nDelContentType) && ( + ( &pStt->nNode.GetNode() == pFootnoteNd && + pStt->nContent.GetIndex() > nFootnoteSttIdx ) || + ( &pEnd->nNode.GetNode() == pFootnoteNd && + nFootnoteSttIdx >= pEnd->nContent.GetIndex() ))) continue; // continue searching // Unfortunately an index needs to be created. Otherwise there // will be problems with TextNode because the index will be - // deleted in the DTOR of SwFtn! - SwTxtNode* pTxtNd = const_cast<SwTxtNode*>(static_cast<const SwTxtNode*>(pFtnNd)); + // deleted in the DTOR of SwFootnote! + SwTextNode* pTextNd = const_cast<SwTextNode*>(static_cast<const SwTextNode*>(pFootnoteNd)); if( !pHistory ) pHistory = new SwHistory; - SwTxtAttr* const pFtnHnt = - pTxtNd->GetTxtAttrForCharAt( nFtnSttIdx ); - assert(pFtnHnt); - SwIndex aIdx( pTxtNd, nFtnSttIdx ); - pHistory->Add( pFtnHnt, pTxtNd->GetIndex(), false ); - pTxtNd->EraseText( aIdx, 1 ); + SwTextAttr* const pFootnoteHint = + pTextNd->GetTextAttrForCharAt( nFootnoteSttIdx ); + assert(pFootnoteHint); + SwIndex aIdx( pTextNd, nFootnoteSttIdx ); + pHistory->Add( pFootnoteHint, pTextNd->GetIndex(), false ); + pTextNd->EraseText( aIdx, 1 ); } } } // 2. Flys - if( nsDelCntntType::DELCNT_FLY & nDelCntntType ) + if( nsDelContentType::DELCNT_FLY & nDelContentType ) { sal_uInt16 nChainInsPos = pHistory ? pHistory->Count() : 0; - const SwFrmFmts& rSpzArr = *pDoc->GetSpzFrmFmts(); + const SwFrameFormats& rSpzArr = *pDoc->GetSpzFrameFormats(); if( !rSpzArr.empty() ) { const bool bDelFwrd = rMark.nNode.GetIndex() <= rPoint.nNode.GetIndex(); - SwFrmFmt* pFmt; - const SwFmtAnchor* pAnchor; + SwFrameFormat* pFormat; + const SwFormatAnchor* pAnchor; size_t n = rSpzArr.size(); const SwPosition* pAPos; while( n && !rSpzArr.empty() ) { - pFmt = rSpzArr[--n]; - pAnchor = &pFmt->GetAnchor(); + pFormat = rSpzArr[--n]; + pAnchor = &pFormat->GetAnchor(); switch( pAnchor->GetAnchorId() ) { case FLY_AS_CHAR: - if( 0 != (pAPos = pAnchor->GetCntntAnchor() ) && - (( nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType ) + if( 0 != (pAPos = pAnchor->GetContentAnchor() ) && + (( nsDelContentType::DELCNT_CHKNOCNTNT & nDelContentType ) ? ( pStt->nNode <= pAPos->nNode && pAPos->nNode < pEnd->nNode ) : ( *pStt <= *pAPos && *pAPos < *pEnd )) ) { if( !pHistory ) pHistory = new SwHistory; - SwTxtNode *const pTxtNd = - pAPos->nNode.GetNode().GetTxtNode(); - SwTxtAttr* const pFlyHnt = pTxtNd->GetTxtAttrForCharAt( + SwTextNode *const pTextNd = + pAPos->nNode.GetNode().GetTextNode(); + SwTextAttr* const pFlyHint = pTextNd->GetTextAttrForCharAt( pAPos->nContent.GetIndex()); - assert(pFlyHnt); - pHistory->Add( pFlyHnt, 0, false ); + assert(pFlyHint); + pHistory->Add( pFlyHint, 0, false ); // reset n so that no Format is skipped n = n >= rSpzArr.size() ? rSpzArr.size() : n+1; } break; case FLY_AT_PARA: { - pAPos = pAnchor->GetCntntAnchor(); + pAPos = pAnchor->GetContentAnchor(); if( pAPos ) { bool bTmp; - if( nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType ) + if( nsDelContentType::DELCNT_CHKNOCNTNT & nDelContentType ) bTmp = pStt->nNode <= pAPos->nNode && pAPos->nNode < pEnd->nNode; else { @@ -587,22 +587,22 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, pHistory = new SwHistory; // Moving the anchor? - if( !( nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType ) && + if( !( nsDelContentType::DELCNT_CHKNOCNTNT & nDelContentType ) && ( rPoint.nNode.GetIndex() == pAPos->nNode.GetIndex() ) ) { // Do not try to move the anchor to a table! - if( rMark.nNode.GetNode().GetTxtNode() ) + if( rMark.nNode.GetNode().GetTextNode() ) { - pHistory->Add( *pFmt ); - SwFmtAnchor aAnch( *pAnchor ); + pHistory->Add( *pFormat ); + SwFormatAnchor aAnch( *pAnchor ); SwPosition aPos( rMark.nNode ); aAnch.SetAnchor( &aPos ); - pFmt->SetFmtAttr( aAnch ); + pFormat->SetFormatAttr( aAnch ); } } else { - pHistory->Add( *static_cast<SwFlyFrmFmt *>(pFmt), nChainInsPos ); + pHistory->Add( *static_cast<SwFlyFrameFormat *>(pFormat), nChainInsPos ); // reset n so that no Format is skipped n = n >= rSpzArr.size() ? rSpzArr.size() : n+1; @@ -612,30 +612,30 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, } break; case FLY_AT_CHAR: - if( 0 != (pAPos = pAnchor->GetCntntAnchor() ) && + if( 0 != (pAPos = pAnchor->GetContentAnchor() ) && ( pStt->nNode <= pAPos->nNode && pAPos->nNode <= pEnd->nNode ) ) { if( !pHistory ) pHistory = new SwHistory; if (IsDestroyFrameAnchoredAtChar( - *pAPos, *pStt, *pEnd, pDoc, nDelCntntType)) + *pAPos, *pStt, *pEnd, pDoc, nDelContentType)) { - pHistory->Add( *static_cast<SwFlyFrmFmt *>(pFmt), nChainInsPos ); + pHistory->Add( *static_cast<SwFlyFrameFormat *>(pFormat), nChainInsPos ); n = n >= rSpzArr.size() ? rSpzArr.size() : n+1; } - else if( !( nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType ) ) + else if( !( nsDelContentType::DELCNT_CHKNOCNTNT & nDelContentType ) ) { if( *pStt <= *pAPos && *pAPos < *pEnd ) { // These are the objects anchored // between section start and end position // Do not try to move the anchor to a table! - if( rMark.nNode.GetNode().GetTxtNode() ) + if( rMark.nNode.GetNode().GetTextNode() ) { - pHistory->Add( *pFmt ); - SwFmtAnchor aAnch( *pAnchor ); + pHistory->Add( *pFormat ); + SwFormatAnchor aAnch( *pAnchor ); aAnch.SetAnchor( &rMark ); - pFmt->SetFmtAttr( aAnch ); + pFormat->SetFormatAttr( aAnch ); } } } @@ -643,13 +643,13 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, break; case FLY_AT_FLY: - if( 0 != (pAPos = pAnchor->GetCntntAnchor() ) && + if( 0 != (pAPos = pAnchor->GetContentAnchor() ) && pStt->nNode == pAPos->nNode ) { if( !pHistory ) pHistory = new SwHistory; - pHistory->Add( *static_cast<SwFlyFrmFmt *>(pFmt), nChainInsPos ); + pHistory->Add( *static_cast<SwFlyFrameFormat *>(pFormat), nChainInsPos ); // reset n so that no Format is skipped n = n >= rSpzArr.size() ? rSpzArr.size() : n+1; @@ -662,7 +662,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, } // 3. Bookmarks - if( nsDelCntntType::DELCNT_BKM & nDelCntntType ) + if( nsDelContentType::DELCNT_BKM & nDelContentType ) { IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); if( pMarkAccess->getAllMarksCount() ) @@ -675,7 +675,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, bool bSaveOtherPos = false; const ::sw::mark::IMark* pBkmk = (pMarkAccess->getAllMarksBegin() + n)->get(); - if( nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType ) + if( nsDelContentType::DELCNT_CHKNOCNTNT & nDelContentType ) { if ( pStt->nNode <= pBkmk->GetMarkPos().nNode && pBkmk->GetMarkPos().nNode < pEnd->nNode ) @@ -725,16 +725,16 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, && dynamic_cast< const ::sw::mark::CrossRefBookmark* >(pBkmk) ) { // certain special handling for cross-reference bookmarks - const bool bDifferentTxtNodesAtMarkAndPoint = + const bool bDifferentTextNodesAtMarkAndPoint = rMark.nNode != rPoint.nNode - && rMark.nNode.GetNode().GetTxtNode() - && rPoint.nNode.GetNode().GetTxtNode(); - if ( bDifferentTxtNodesAtMarkAndPoint ) + && rMark.nNode.GetNode().GetTextNode() + && rPoint.nNode.GetNode().GetTextNode(); + if ( bDifferentTextNodesAtMarkAndPoint ) { // delete cross-reference bookmark at <pStt>, if only part of // <pEnd> text node content is deleted. if( pStt->nNode == pBkmk->GetMarkPos().nNode - && pEnd->nContent.GetIndex() != pEnd->nNode.GetNode().GetTxtNode()->Len() ) + && pEnd->nContent.GetIndex() != pEnd->nNode.GetNode().GetTextNode()->Len() ) { bSavePos = true; bSaveOtherPos = false; // cross-reference bookmarks are not expanded @@ -813,7 +813,7 @@ void SwUndoSaveSection::SaveSection( SwPaM aPam( rRange.aStart, rRange.aEnd ); // delete all footnotes, fly frames, bookmarks and indexes - DelCntntIndex( *aPam.GetMark(), *aPam.GetPoint() ); + DelContentIndex( *aPam.GetMark(), *aPam.GetPoint() ); { // move certain indexes out of deleted range SwNodeIndex aSttIdx( aPam.Start()->nNode.GetNode() ); @@ -831,10 +831,10 @@ void SwUndoSaveSection::SaveSection( --aPam.GetPoint()->nNode; ++aPam.GetMark()->nNode; - SwCntntNode* pCNd = aPam.GetCntntNode( false ); + SwContentNode* pCNd = aPam.GetContentNode( false ); if( pCNd ) aPam.GetMark()->nContent.Assign( pCNd, 0 ); - if( 0 != ( pCNd = aPam.GetCntntNode( true )) ) + if( 0 != ( pCNd = aPam.GetContentNode( true )) ) aPam.GetPoint()->nContent.Assign( pCNd, pCNd->Len() ); // Keep positions as SwIndex so that this section can be deleted in DTOR @@ -900,19 +900,19 @@ SwRedlineSaveData::SwRedlineSaveData( { case POS_OVERLAP_BEFORE: // Pos1 overlaps Pos2 at the beginning nEndNode = rEndPos.nNode.GetIndex(); - nEndCntnt = rEndPos.nContent.GetIndex(); + nEndContent = rEndPos.nContent.GetIndex(); break; case POS_OVERLAP_BEHIND: // Pos1 overlaps Pos2 at the end nSttNode = rSttPos.nNode.GetIndex(); - nSttCntnt = rSttPos.nContent.GetIndex(); + nSttContent = rSttPos.nContent.GetIndex(); break; case POS_INSIDE: // Pos1 lays completely in Pos2 nSttNode = rSttPos.nNode.GetIndex(); - nSttCntnt = rSttPos.nContent.GetIndex(); + nSttContent = rSttPos.nContent.GetIndex(); nEndNode = rEndPos.nNode.GetIndex(); - nEndCntnt = rEndPos.nContent.GetIndex(); + nEndContent = rEndPos.nContent.GetIndex(); break; case POS_OUTSIDE: // Pos2 lays completely in Pos1 @@ -932,7 +932,7 @@ SwRedlineSaveData::SwRedlineSaveData( } #if OSL_DEBUG_LEVEL > 0 - nRedlineCount = rSttPos.nNode.GetNode().GetDoc()->getIDocumentRedlineAccess().GetRedlineTbl().size(); + nRedlineCount = rSttPos.nNode.GetNode().GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().size(); #endif } @@ -982,12 +982,12 @@ bool SwUndo::FillSaveData( SwRedlineSaveData* pNewData; const SwPosition* pStt = rRange.Start(); const SwPosition* pEnd = rRange.End(); - const SwRedlineTbl& rTbl = rRange.GetDoc()->getIDocumentRedlineAccess().GetRedlineTbl(); + const SwRedlineTable& rTable = rRange.GetDoc()->getIDocumentRedlineAccess().GetRedlineTable(); sal_uInt16 n = 0; rRange.GetDoc()->getIDocumentRedlineAccess().GetRedline( *pStt, &n ); - for ( ; n < rTbl.size(); ++n ) + for ( ; n < rTable.size(); ++n ) { - SwRangeRedline* pRedl = rTbl[n]; + SwRangeRedline* pRedl = rTable[n]; const SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRedl->Start(), *pRedl->End() ); @@ -1007,7 +1007,7 @@ bool SwUndo::FillSaveData( return !rSData.empty(); } -bool SwUndo::FillSaveDataForFmt( +bool SwUndo::FillSaveDataForFormat( const SwPaM& rRange, SwRedlineSaveDatas& rSData ) { @@ -1015,12 +1015,12 @@ bool SwUndo::FillSaveDataForFmt( SwRedlineSaveData* pNewData; const SwPosition *pStt = rRange.Start(), *pEnd = rRange.End(); - const SwRedlineTbl& rTbl = rRange.GetDoc()->getIDocumentRedlineAccess().GetRedlineTbl(); + const SwRedlineTable& rTable = rRange.GetDoc()->getIDocumentRedlineAccess().GetRedlineTable(); sal_uInt16 n = 0; rRange.GetDoc()->getIDocumentRedlineAccess().GetRedline( *pStt, &n ); - for ( ; n < rTbl.size(); ++n ) + for ( ; n < rTable.size(); ++n ) { - SwRangeRedline* pRedl = rTbl[n]; + SwRangeRedline* pRedl = rTable[n]; if ( nsRedlineType_t::REDLINE_FORMAT == pRedl->GetType() ) { const SwComparePosition eCmpPos = ComparePosition( *pStt, *pEnd, *pRedl->Start(), *pRedl->End() ); @@ -1051,7 +1051,7 @@ void SwUndo::SetSaveData( SwDoc& rDoc, SwRedlineSaveDatas& rSData ) #if OSL_DEBUG_LEVEL > 0 // check redline count against count saved in RedlineSaveData object assert(rSData.empty() || - (rSData[0].nRedlineCount == rDoc.getIDocumentRedlineAccess().GetRedlineTbl().size())); + (rSData[0].nRedlineCount == rDoc.getIDocumentRedlineAccess().GetRedlineTable().size())); // "redline count not restored properly" #endif @@ -1078,8 +1078,8 @@ bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr, const SwRedlineSaveData& rGet = rCheck[ n ]; if( rSet.nSttNode != rGet.nSttNode || rSet.GetMvSttIdx() || rGet.GetMvSttIdx() || - ( bCurrIsEnd ? rSet.nSttCntnt != rGet.nEndCntnt - : rSet.nEndCntnt != rGet.nSttCntnt ) || + ( bCurrIsEnd ? rSet.nSttContent != rGet.nEndContent + : rSet.nEndContent != rGet.nSttContent ) || !rGet.CanCombine( rSet ) ) { return false; @@ -1091,9 +1091,9 @@ bool SwUndo::CanRedlineGroup( SwRedlineSaveDatas& rCurr, SwRedlineSaveData& rSet = rCurr[ n ]; const SwRedlineSaveData& rGet = rCheck[ n ]; if( bCurrIsEnd ) - rSet.nSttCntnt = rGet.nSttCntnt; + rSet.nSttContent = rGet.nSttContent; else - rSet.nEndCntnt = rGet.nEndCntnt; + rSet.nEndContent = rGet.nEndContent; } return true; } @@ -1120,7 +1120,7 @@ OUString ShortenString(const OUString & rStr, sal_Int32 nLength, const OUString bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos, SwPosition const & rStart, SwPosition const & rEnd, const SwDoc* doc, - DelCntntType const nDelCntntType) + DelContentType const nDelContentType) { bool inSelection = rAnchorPos < rEnd; if( rAnchorPos == rEnd ) @@ -1131,7 +1131,7 @@ bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos, else { SwNodeIndex idx( nodes.GetEndOfContent()); - if( SwCntntNode* last = SwNodes::GoPrevious( &idx )) + if( SwContentNode* last = SwNodes::GoPrevious( &idx )) inSelection = rEnd == SwPosition( *last, last->Len()); } } @@ -1140,7 +1140,7 @@ bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos, // - anchored in start of the selection with "CheckNoContent" // - anchored in start of sel. and the selection start at pos 0 return inSelection - && ( (nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType) + && ( (nsDelContentType::DELCNT_CHKNOCNTNT & nDelContentType) || (rStart.nNode < rAnchorPos.nNode) || !rStart.nContent.GetIndex() ); diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index fc6829207705..6260382cc1e5 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -39,20 +39,20 @@ #include <dcontact.hxx> #include <ndole.hxx> -SwUndoFlyBase::SwUndoFlyBase( SwFrmFmt* pFormat, SwUndoId nUndoId ) +SwUndoFlyBase::SwUndoFlyBase( SwFrameFormat* pFormat, SwUndoId nUndoId ) : SwUndo(nUndoId) - , pFrmFmt(pFormat) + , pFrameFormat(pFormat) , nNdPgPos(0) , nCntPos(0) , nRndId(0) - , bDelFmt(false) + , bDelFormat(false) { } SwUndoFlyBase::~SwUndoFlyBase() { - if( bDelFmt ) // delete during an Undo? - delete pFrmFmt; + if( bDelFormat ) // delete during an Undo? + delete pFrameFormat; } void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm) @@ -60,14 +60,14 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm) SwDoc *const pDoc = & rContext.GetDoc(); // add again into array - SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts(); - rFlyFmts.push_back( pFrmFmt ); + SwFrameFormats& rFlyFormats = *pDoc->GetSpzFrameFormats(); + rFlyFormats.push_back( pFrameFormat ); // OD 26.06.2003 #108784# - insert 'master' drawing object into drawing page - if ( RES_DRAWFRMFMT == pFrmFmt->Which() ) + if ( RES_DRAWFRMFMT == pFrameFormat->Which() ) { SwDrawContact* pDrawContact = - static_cast<SwDrawContact*>(pFrmFmt->FindContactObj()); + static_cast<SwDrawContact*>(pFrameFormat->FindContactObj()); if ( pDrawContact ) { pDrawContact->InsertMasterIntoDrawPage(); @@ -77,7 +77,7 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm) } } - SwFmtAnchor aAnchor( (RndStdIds)nRndId ); + SwFormatAnchor aAnchor( (RndStdIds)nRndId ); if (FLY_AT_PAGE == nRndId) { @@ -89,39 +89,39 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm) aNewPos.nNode = nNdPgPos; if ((FLY_AS_CHAR == nRndId) || (FLY_AT_CHAR == nRndId)) { - aNewPos.nContent.Assign( aNewPos.nNode.GetNode().GetCntntNode(), + aNewPos.nContent.Assign( aNewPos.nNode.GetNode().GetContentNode(), nCntPos ); } aAnchor.SetAnchor( &aNewPos ); } - pFrmFmt->SetFmtAttr( aAnchor ); // reset anchor + pFrameFormat->SetFormatAttr( aAnchor ); // reset anchor - if( RES_DRAWFRMFMT != pFrmFmt->Which() ) + if( RES_DRAWFRMFMT != pFrameFormat->Which() ) { // get Content and reset ContentAttribute SwNodeIndex aIdx( pDoc->GetNodes() ); RestoreSection( pDoc, &aIdx, SwFlyStartNode ); - pFrmFmt->SetFmtAttr( SwFmtCntnt( aIdx.GetNode().GetStartNode() )); + pFrameFormat->SetFormatAttr( SwFormatContent( aIdx.GetNode().GetStartNode() )); } - // Set InCntntAttribute not until there is content! + // Set InContentAttribute not until there is content! // Otherwise the layout would format the Fly beforehand but would not find // content; this happened with graphics from the internet. if (FLY_AS_CHAR == nRndId) { // there must be at least the attribute in a TextNode - SwCntntNode* pCNd = aAnchor.GetCntntAnchor()->nNode.GetNode().GetCntntNode(); - OSL_ENSURE( pCNd->IsTxtNode(), "no Text Node at position." ); - SwFmtFlyCnt aFmt( pFrmFmt ); - pCNd->GetTxtNode()->InsertItem( aFmt, nCntPos, nCntPos ); + SwContentNode* pCNd = aAnchor.GetContentAnchor()->nNode.GetNode().GetContentNode(); + OSL_ENSURE( pCNd->IsTextNode(), "no Text Node at position." ); + SwFormatFlyCnt aFormat( pFrameFormat ); + pCNd->GetTextNode()->InsertItem( aFormat, nCntPos, nCntPos ); } - pFrmFmt->MakeFrms(); + pFrameFormat->MakeFrms(); if( bShowSelFrm ) { - rContext.SetSelections(pFrmFmt, 0); + rContext.SetSelections(pFrameFormat, 0); } if( GetHistory() ) @@ -132,74 +132,74 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrm) case FLY_AS_CHAR: case FLY_AT_CHAR: { - const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); - nNdPgPos = rAnchor.GetCntntAnchor()->nNode.GetIndex(); - nCntPos = rAnchor.GetCntntAnchor()->nContent.GetIndex(); + const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); + nNdPgPos = rAnchor.GetContentAnchor()->nNode.GetIndex(); + nCntPos = rAnchor.GetContentAnchor()->nContent.GetIndex(); } break; case FLY_AT_PARA: case FLY_AT_FLY: { - const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); - nNdPgPos = rAnchor.GetCntntAnchor()->nNode.GetIndex(); + const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); + nNdPgPos = rAnchor.GetContentAnchor()->nNode.GetIndex(); } break; case FLY_AT_PAGE: break; } - bDelFmt = false; + bDelFormat = false; } void SwUndoFlyBase::DelFly( SwDoc* pDoc ) { - bDelFmt = true; // delete Format in DTOR - pFrmFmt->DelFrms(); // destroy Frms + bDelFormat = true; // delete Format in DTOR + pFrameFormat->DelFrms(); // destroy Frms // all Uno objects should now log themselves off { - SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFrmFmt ); - pFrmFmt->ModifyNotification( &aMsgHint, &aMsgHint ); + SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, pFrameFormat ); + pFrameFormat->ModifyNotification( &aMsgHint, &aMsgHint ); } - if ( RES_DRAWFRMFMT != pFrmFmt->Which() ) + if ( RES_DRAWFRMFMT != pFrameFormat->Which() ) { // if there is content than save it - const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt(); - OSL_ENSURE( rCntnt.GetCntntIdx(), "Fly ohne Inhalt" ); + const SwFormatContent& rContent = pFrameFormat->GetContent(); + OSL_ENSURE( rContent.GetContentIdx(), "Fly ohne Inhalt" ); - SaveSection( *rCntnt.GetCntntIdx() ); - const_cast<SwFmtCntnt&>(rCntnt).SetNewCntntIdx( (const SwNodeIndex*)0 ); + SaveSection( *rContent.GetContentIdx() ); + const_cast<SwFormatContent&>(rContent).SetNewContentIdx( (const SwNodeIndex*)0 ); } // OD 02.07.2003 #108784# - remove 'master' drawing object from drawing page - else if ( RES_DRAWFRMFMT == pFrmFmt->Which() ) + else if ( RES_DRAWFRMFMT == pFrameFormat->Which() ) { SwDrawContact* pDrawContact = - static_cast<SwDrawContact*>(pFrmFmt->FindContactObj()); + static_cast<SwDrawContact*>(pFrameFormat->FindContactObj()); if ( pDrawContact ) { pDrawContact->RemoveMasterFromDrawPage(); } } - const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); - const SwPosition* pPos = rAnchor.GetCntntAnchor(); + const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); + const SwPosition* pPos = rAnchor.GetContentAnchor(); // The positions in Nodes array got shifted. nRndId = static_cast<sal_uInt16>(rAnchor.GetAnchorId()); if (FLY_AS_CHAR == nRndId) { nNdPgPos = pPos->nNode.GetIndex(); nCntPos = pPos->nContent.GetIndex(); - SwTxtNode *const pTxtNd = pPos->nNode.GetNode().GetTxtNode(); - OSL_ENSURE( pTxtNd, "Kein Textnode gefunden" ); - SwTxtFlyCnt* const pAttr = static_cast<SwTxtFlyCnt*>( - pTxtNd->GetTxtAttrForCharAt( nCntPos, RES_TXTATR_FLYCNT ) ); + SwTextNode *const pTextNd = pPos->nNode.GetNode().GetTextNode(); + OSL_ENSURE( pTextNd, "Kein Textnode gefunden" ); + SwTextFlyCnt* const pAttr = static_cast<SwTextFlyCnt*>( + pTextNd->GetTextAttrForCharAt( nCntPos, RES_TXTATR_FLYCNT ) ); // attribute is still in TextNode, delete - if( pAttr && pAttr->GetFlyCnt().GetFrmFmt() == pFrmFmt ) + if( pAttr && pAttr->GetFlyCnt().GetFrameFormat() == pFrameFormat ) { // Pointer to 0, do not delete - const_cast<SwFmtFlyCnt&>(pAttr->GetFlyCnt()).SetFlyFmt(); + const_cast<SwFormatFlyCnt&>(pAttr->GetFlyCnt()).SetFlyFormat(); SwIndex aIdx( pPos->nContent ); - pTxtNd->EraseText( aIdx, 1 ); + pTextNd->EraseText( aIdx, 1 ); } } else if (FLY_AT_CHAR == nRndId) @@ -216,21 +216,21 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc ) nNdPgPos = rAnchor.GetPageNum(); } - pFrmFmt->ResetFmtAttr( RES_ANCHOR ); // delete anchor + pFrameFormat->ResetFormatAttr( RES_ANCHOR ); // delete anchor // delete from array - SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts(); - rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), pFrmFmt )); + SwFrameFormats& rFlyFormats = *pDoc->GetSpzFrameFormats(); + rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFrameFormat )); } -SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, sal_uLong nNodeIdx, sal_Int32 nCntIdx ) +SwUndoInsLayFormat::SwUndoInsLayFormat( SwFrameFormat* pFormat, sal_uLong nNodeIdx, sal_Int32 nCntIdx ) : SwUndoFlyBase( pFormat, RES_DRAWFRMFMT == pFormat->Which() ? UNDO_INSDRAWFMT : UNDO_INSLAYFMT ), mnCrsrSaveIndexPara( nNodeIdx ), mnCrsrSaveIndexPos( nCntIdx ) { - const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); + const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); nRndId = static_cast<sal_uInt16>(rAnchor.GetAnchorId()); - bDelFmt = false; + bDelFormat = false; switch( nRndId ) { case FLY_AT_PAGE: @@ -238,12 +238,12 @@ SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, sal_uLong nNodeIdx, sal_Int break; case FLY_AT_PARA: case FLY_AT_FLY: - nNdPgPos = rAnchor.GetCntntAnchor()->nNode.GetIndex(); + nNdPgPos = rAnchor.GetContentAnchor()->nNode.GetIndex(); break; case FLY_AS_CHAR: case FLY_AT_CHAR: { - const SwPosition* pPos = rAnchor.GetCntntAnchor(); + const SwPosition* pPos = rAnchor.GetContentAnchor(); nCntPos = pPos->nContent.GetIndex(); nNdPgPos = pPos->nNode.GetIndex(); } @@ -253,25 +253,25 @@ SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, sal_uLong nNodeIdx, sal_Int } } -SwUndoInsLayFmt::~SwUndoInsLayFmt() +SwUndoInsLayFormat::~SwUndoInsLayFormat() { } -void SwUndoInsLayFmt::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoInsLayFormat::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc(rContext.GetDoc()); - const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt(); - if( rCntnt.GetCntntIdx() ) // no content + const SwFormatContent& rContent = pFrameFormat->GetContent(); + if( rContent.GetContentIdx() ) // no content { bool bRemoveIdx = true; if( mnCrsrSaveIndexPara > 0 ) { - SwTxtNode *const pNode = - rDoc.GetNodes()[mnCrsrSaveIndexPara]->GetTxtNode(); + SwTextNode *const pNode = + rDoc.GetNodes()[mnCrsrSaveIndexPara]->GetTextNode(); if( pNode ) { SwNodeIndex aIdx( rDoc.GetNodes(), - rCntnt.GetCntntIdx()->GetIndex() ); + rContent.GetContentIdx()->GetIndex() ); SwNodeIndex aEndIdx( rDoc.GetNodes(), aIdx.GetNode().EndOfSectionIndex() ); SwIndex aIndex( pNode, mnCrsrSaveIndexPos ); @@ -282,22 +282,22 @@ void SwUndoInsLayFmt::UndoImpl(::sw::UndoRedoContext & rContext) } if( bRemoveIdx ) { - RemoveIdxFromSection( rDoc, rCntnt.GetCntntIdx()->GetIndex() ); + RemoveIdxFromSection( rDoc, rContent.GetContentIdx()->GetIndex() ); } } DelFly(& rDoc); } -void SwUndoInsLayFmt::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoInsLayFormat::RedoImpl(::sw::UndoRedoContext & rContext) { InsFly(rContext); } -void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext) +void SwUndoInsLayFormat::RepeatImpl(::sw::RepeatContext & rContext) { SwDoc *const pDoc = & rContext.GetDoc(); // get anchor and reset it - SwFmtAnchor aAnchor( pFrmFmt->GetAnchor() ); + SwFormatAnchor aAnchor( pFrameFormat->GetAnchor() ); if ((FLY_AT_PARA == aAnchor.GetAnchorId()) || (FLY_AT_CHAR == aAnchor.GetAnchorId()) || (FLY_AS_CHAR == aAnchor.GetAnchorId())) @@ -331,17 +331,17 @@ void SwUndoInsLayFmt::RepeatImpl(::sw::RepeatContext & rContext) OSL_FAIL( "What kind of anchor is this?" ); } - SwFrmFmt* pFlyFmt = pDoc->getIDocumentLayoutAccess().CopyLayoutFmt( *pFrmFmt, aAnchor, true, true ); - (void) pFlyFmt; + SwFrameFormat* pFlyFormat = pDoc->getIDocumentLayoutAccess().CopyLayoutFormat( *pFrameFormat, aAnchor, true, true ); + (void) pFlyFormat; } // #111827# -OUString SwUndoInsLayFmt::GetComment() const +OUString SwUndoInsLayFormat::GetComment() const { OUString aResult; // HACK: disable caching: - // the SfxUndoManager calls GetComment() too early: the pFrmFmt does not + // the SfxUndoManager calls GetComment() too early: the pFrameFormat does not // have a SwDrawContact yet, so it will fall back to SwUndo::GetComment(), // which sets pComment to a wrong value. // if (! pComment) @@ -352,9 +352,9 @@ OUString SwUndoInsLayFmt::GetComment() const comment of the SdrObject. Otherwise use the default comment. */ bool bDone = false; - if (pFrmFmt) + if (pFrameFormat) { - const SdrObject * pSdrObj = pFrmFmt->FindSdrObject(); + const SdrObject * pSdrObj = pFrameFormat->FindSdrObject(); if ( pSdrObj ) { aResult = SdrUndoNewObj::GetComment( *pSdrObj ); @@ -372,20 +372,20 @@ OUString SwUndoInsLayFmt::GetComment() const } static SwUndoId -lcl_GetSwUndoId(SwFrmFmt *const pFrmFmt) +lcl_GetSwUndoId(SwFrameFormat *const pFrameFormat) { - if (RES_DRAWFRMFMT != pFrmFmt->Which()) + if (RES_DRAWFRMFMT != pFrameFormat->Which()) { - const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt(); - OSL_ENSURE( rCntnt.GetCntntIdx(), "Fly without content" ); + const SwFormatContent& rContent = pFrameFormat->GetContent(); + OSL_ENSURE( rContent.GetContentIdx(), "Fly without content" ); - SwNodeIndex firstNode(*rCntnt.GetCntntIdx(), 1); - SwNoTxtNode *const pNoTxtNode(firstNode.GetNode().GetNoTxtNode()); - if (pNoTxtNode && pNoTxtNode->IsGrfNode()) + SwNodeIndex firstNode(*rContent.GetContentIdx(), 1); + SwNoTextNode *const pNoTextNode(firstNode.GetNode().GetNoTextNode()); + if (pNoTextNode && pNoTextNode->IsGrfNode()) { return UNDO_DELGRF; } - else if (pNoTxtNode && pNoTxtNode->IsOLENode()) + else if (pNoTextNode && pNoTextNode->IsOLENode()) { // surprisingly not UNDO_DELOLE, which does not seem to work return UNDO_DELETE; @@ -394,7 +394,7 @@ lcl_GetSwUndoId(SwFrmFmt *const pFrmFmt) return UNDO_DELLAYFMT; } -SwUndoDelLayFmt::SwUndoDelLayFmt( SwFrmFmt* pFormat ) +SwUndoDelLayFormat::SwUndoDelLayFormat( SwFrameFormat* pFormat ) : SwUndoFlyBase( pFormat, lcl_GetSwUndoId(pFormat) ) , bShowSelFrm( true ) { @@ -402,11 +402,11 @@ SwUndoDelLayFmt::SwUndoDelLayFmt( SwFrmFmt* pFormat ) DelFly( pDoc ); } -SwRewriter SwUndoDelLayFmt::GetRewriter() const +SwRewriter SwUndoDelLayFormat::GetRewriter() const { SwRewriter aRewriter; - SwDoc * pDoc = pFrmFmt->GetDoc(); + SwDoc * pDoc = pFrameFormat->GetDoc(); if (pDoc) { @@ -415,7 +415,7 @@ SwRewriter SwUndoDelLayFmt::GetRewriter() const { SwNode *const pNd = & pIdx->GetNode(); - if ( pNd->IsNoTxtNode() && pNd->IsOLENode()) + if ( pNd->IsNoTextNode() && pNd->IsOLENode()) { SwOLENode * pOLENd = pNd->GetOLENode(); @@ -427,76 +427,76 @@ SwRewriter SwUndoDelLayFmt::GetRewriter() const return aRewriter; } -void SwUndoDelLayFmt::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoDelLayFormat::UndoImpl(::sw::UndoRedoContext & rContext) { InsFly( rContext, bShowSelFrm ); } -void SwUndoDelLayFmt::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoDelLayFormat::RedoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc(rContext.GetDoc()); - const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt(); - if( rCntnt.GetCntntIdx() ) // no content + const SwFormatContent& rContent = pFrameFormat->GetContent(); + if( rContent.GetContentIdx() ) // no content { - RemoveIdxFromSection(rDoc, rCntnt.GetCntntIdx()->GetIndex()); + RemoveIdxFromSection(rDoc, rContent.GetContentIdx()->GetIndex()); } DelFly(& rDoc); } -void SwUndoDelLayFmt::RedoForRollback() +void SwUndoDelLayFormat::RedoForRollback() { - const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt(); - if( rCntnt.GetCntntIdx() ) // no content - RemoveIdxFromSection( *pFrmFmt->GetDoc(), - rCntnt.GetCntntIdx()->GetIndex() ); + const SwFormatContent& rContent = pFrameFormat->GetContent(); + if( rContent.GetContentIdx() ) // no content + RemoveIdxFromSection( *pFrameFormat->GetDoc(), + rContent.GetContentIdx()->GetIndex() ); - DelFly( pFrmFmt->GetDoc() ); + DelFly( pFrameFormat->GetDoc() ); } -SwUndoSetFlyFmt::SwUndoSetFlyFmt( SwFrmFmt& rFlyFmt, SwFrmFmt& rNewFrmFmt ) - : SwUndo( UNDO_SETFLYFRMFMT ), SwClient( &rFlyFmt ), pFrmFmt( &rFlyFmt ), - pOldFmt( static_cast<SwFrmFmt*>(rFlyFmt.DerivedFrom()) ), pNewFmt( &rNewFrmFmt ), - pItemSet( new SfxItemSet( *rFlyFmt.GetAttrSet().GetPool(), - rFlyFmt.GetAttrSet().GetRanges() )), +SwUndoSetFlyFormat::SwUndoSetFlyFormat( SwFrameFormat& rFlyFormat, SwFrameFormat& rNewFrameFormat ) + : SwUndo( UNDO_SETFLYFRMFMT ), SwClient( &rFlyFormat ), pFrameFormat( &rFlyFormat ), + pOldFormat( static_cast<SwFrameFormat*>(rFlyFormat.DerivedFrom()) ), pNewFormat( &rNewFrameFormat ), + pItemSet( new SfxItemSet( *rFlyFormat.GetAttrSet().GetPool(), + rFlyFormat.GetAttrSet().GetRanges() )), nOldNode( 0 ), nNewNode( 0 ), - nOldCntnt( 0 ), nNewCntnt( 0 ), + nOldContent( 0 ), nNewContent( 0 ), nOldAnchorTyp( 0 ), nNewAnchorTyp( 0 ), bAnchorChgd( false ) { } -SwRewriter SwUndoSetFlyFmt::GetRewriter() const +SwRewriter SwUndoSetFlyFormat::GetRewriter() const { SwRewriter aRewriter; - if (pNewFmt) - aRewriter.AddRule(UndoArg1, pNewFmt->GetName()); + if (pNewFormat) + aRewriter.AddRule(UndoArg1, pNewFormat->GetName()); return aRewriter; } -SwUndoSetFlyFmt::~SwUndoSetFlyFmt() +SwUndoSetFlyFormat::~SwUndoSetFlyFormat() { delete pItemSet; } -void SwUndoSetFlyFmt::DeRegisterFromFormat( SwFmt& rFmt ) +void SwUndoSetFlyFormat::DeRegisterFromFormat( SwFormat& rFormat ) { - rFmt.Remove(this); + rFormat.Remove(this); } -void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor, - sal_uLong nNode, sal_Int32 nCntnt ) +void SwUndoSetFlyFormat::GetAnchor( SwFormatAnchor& rAnchor, + sal_uLong nNode, sal_Int32 nContent ) { RndStdIds nAnchorTyp = rAnchor.GetAnchorId(); if (FLY_AT_PAGE != nAnchorTyp) { - SwNode* pNd = pFrmFmt->GetDoc()->GetNodes()[ nNode ]; + SwNode* pNd = pFrameFormat->GetDoc()->GetNodes()[ nNode ]; if( FLY_AT_FLY == nAnchorTyp ? ( !pNd->IsStartNode() || SwFlyStartNode != static_cast<SwStartNode*>(pNd)->GetStartNodeType() ) - : !pNd->IsTxtNode() ) + : !pNd->IsTextNode() ) { pNd = 0; // invalid position } @@ -506,13 +506,13 @@ void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor, if ((FLY_AS_CHAR == nAnchorTyp) || (FLY_AT_CHAR == nAnchorTyp)) { - if (nCntnt > pNd->GetTxtNode()->GetTxt().getLength()) + if (nContent > pNd->GetTextNode()->GetText().getLength()) { pNd = 0; // invalid position } else { - aPos.nContent.Assign(pNd->GetTxtNode(), nCntnt); + aPos.nContent.Assign(pNd->GetTextNode(), nContent); } } if ( pNd ) @@ -529,31 +529,31 @@ void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor, } } else - rAnchor.SetPageNum( nCntnt ); + rAnchor.SetPageNum( nContent ); } -void SwUndoSetFlyFmt::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoSetFlyFormat::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); // Is the new Format still existent? - if( rDoc.GetFrmFmts()->Contains( pOldFmt ) ) + if( rDoc.GetFrameFormats()->Contains( pOldFormat ) ) { if( bAnchorChgd ) - pFrmFmt->DelFrms(); + pFrameFormat->DelFrms(); - if( pFrmFmt->DerivedFrom() != pOldFmt ) - pFrmFmt->SetDerivedFrom( pOldFmt ); + if( pFrameFormat->DerivedFrom() != pOldFormat ) + pFrameFormat->SetDerivedFrom( pOldFormat ); SfxItemIter aIter( *pItemSet ); const SfxPoolItem* pItem = aIter.GetCurItem(); while( pItem ) { if( IsInvalidItem( pItem )) - pFrmFmt->ResetFmtAttr( pItemSet->GetWhichByPos( + pFrameFormat->ResetFormatAttr( pItemSet->GetWhichByPos( aIter.GetCurPos() )); else - pFrmFmt->SetFmtAttr( *pItem ); + pFrameFormat->SetFormatAttr( *pItem ); if( aIter.IsAtEnd() ) break; @@ -562,73 +562,73 @@ void SwUndoSetFlyFmt::UndoImpl(::sw::UndoRedoContext & rContext) if( bAnchorChgd ) { - const SwFmtAnchor& rOldAnch = pFrmFmt->GetAnchor(); + const SwFormatAnchor& rOldAnch = pFrameFormat->GetAnchor(); if (FLY_AS_CHAR == rOldAnch.GetAnchorId()) { - // With InCntnts it's tricky: the text attribute needs to be + // With InContents it's tricky: the text attribute needs to be // deleted. Unfortunately, this not only destroys the Frms but // also the format. To prevent that, first detach the // connection between attribute and format. - const SwPosition *pPos = rOldAnch.GetCntntAnchor(); - SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode(); - OSL_ENSURE( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." ); + const SwPosition *pPos = rOldAnch.GetContentAnchor(); + SwTextNode *pTextNode = pPos->nNode.GetNode().GetTextNode(); + OSL_ENSURE( pTextNode->HasHints(), "Missing FlyInCnt-Hint." ); const sal_Int32 nIdx = pPos->nContent.GetIndex(); - SwTxtAttr * pHnt = pTxtNode->GetTxtAttrForCharAt( + SwTextAttr * pHint = pTextNode->GetTextAttrForCharAt( nIdx, RES_TXTATR_FLYCNT ); - OSL_ENSURE( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT, + OSL_ENSURE( pHint && pHint->Which() == RES_TXTATR_FLYCNT, "Missing FlyInCnt-Hint." ); - OSL_ENSURE( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFrmFmt, - "Wrong TxtFlyCnt-Hint." ); - const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt()).SetFlyFmt(); + OSL_ENSURE( pHint && pHint->GetFlyCnt().GetFrameFormat() == pFrameFormat, + "Wrong TextFlyCnt-Hint." ); + const_cast<SwFormatFlyCnt&>(pHint->GetFlyCnt()).SetFlyFormat(); // Connection is now detached, therefore the attribute can be // deleted - pTxtNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx, nIdx ); + pTextNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx, nIdx ); } // reposition anchor - SwFmtAnchor aNewAnchor( (RndStdIds) nOldAnchorTyp ); - GetAnchor( aNewAnchor, nOldNode, nOldCntnt ); - pFrmFmt->SetFmtAttr( aNewAnchor ); + SwFormatAnchor aNewAnchor( (RndStdIds) nOldAnchorTyp ); + GetAnchor( aNewAnchor, nOldNode, nOldContent ); + pFrameFormat->SetFormatAttr( aNewAnchor ); if (FLY_AS_CHAR == aNewAnchor.GetAnchorId()) { - const SwPosition* pPos = aNewAnchor.GetCntntAnchor(); - SwFmtFlyCnt aFmt( pFrmFmt ); - pPos->nNode.GetNode().GetTxtNode()->InsertItem( aFmt, - nOldCntnt, 0 ); + const SwPosition* pPos = aNewAnchor.GetContentAnchor(); + SwFormatFlyCnt aFormat( pFrameFormat ); + pPos->nNode.GetNode().GetTextNode()->InsertItem( aFormat, + nOldContent, 0 ); } - pFrmFmt->MakeFrms(); + pFrameFormat->MakeFrms(); } - rContext.SetSelections(pFrmFmt, 0); + rContext.SetSelections(pFrameFormat, 0); } } -void SwUndoSetFlyFmt::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoSetFlyFormat::RedoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); // Is the new Format still existent? - if( rDoc.GetFrmFmts()->Contains( pNewFmt ) ) + if( rDoc.GetFrameFormats()->Contains( pNewFormat ) ) { if( bAnchorChgd ) { - SwFmtAnchor aNewAnchor( (RndStdIds) nNewAnchorTyp ); - GetAnchor( aNewAnchor, nNewNode, nNewCntnt ); - SfxItemSet aSet( rDoc.GetAttrPool(), aFrmFmtSetRange ); + SwFormatAnchor aNewAnchor( (RndStdIds) nNewAnchorTyp ); + GetAnchor( aNewAnchor, nNewNode, nNewContent ); + SfxItemSet aSet( rDoc.GetAttrPool(), aFrameFormatSetRange ); aSet.Put( aNewAnchor ); - rDoc.SetFrmFmtToFly( *pFrmFmt, *pNewFmt, &aSet ); + rDoc.SetFrameFormatToFly( *pFrameFormat, *pNewFormat, &aSet ); } else - rDoc.SetFrmFmtToFly( *pFrmFmt, *pNewFmt, 0 ); + rDoc.SetFrameFormatToFly( *pFrameFormat, *pNewFormat, 0 ); - rContext.SetSelections(pFrmFmt, 0); + rContext.SetSelections(pFrameFormat, 0); } } -void SwUndoSetFlyFmt::PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem ) +void SwUndoSetFlyFormat::PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem ) { if( pItem && pItem != GetDfltAttr( nWhich ) ) { @@ -640,36 +640,36 @@ void SwUndoSetFlyFmt::PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem ) bAnchorChgd = true; - const SwFmtAnchor* pAnchor = static_cast<const SwFmtAnchor*>(pItem); + const SwFormatAnchor* pAnchor = static_cast<const SwFormatAnchor*>(pItem); switch( nOldAnchorTyp = static_cast<sal_uInt16>(pAnchor->GetAnchorId()) ) { case FLY_AS_CHAR: case FLY_AT_CHAR: - nOldCntnt = pAnchor->GetCntntAnchor()->nContent.GetIndex(); + nOldContent = pAnchor->GetContentAnchor()->nContent.GetIndex(); //fall-through case FLY_AT_PARA: case FLY_AT_FLY: - nOldNode = pAnchor->GetCntntAnchor()->nNode.GetIndex(); + nOldNode = pAnchor->GetContentAnchor()->nNode.GetIndex(); break; default: - nOldCntnt = pAnchor->GetPageNum(); + nOldContent = pAnchor->GetPageNum(); } - pAnchor = &pFrmFmt->GetAnchor(); + pAnchor = &pFrameFormat->GetAnchor(); switch( nNewAnchorTyp = static_cast<sal_uInt16>(pAnchor->GetAnchorId()) ) { case FLY_AS_CHAR: case FLY_AT_CHAR: - nNewCntnt = pAnchor->GetCntntAnchor()->nContent.GetIndex(); + nNewContent = pAnchor->GetContentAnchor()->nContent.GetIndex(); //fall-through case FLY_AT_PARA: case FLY_AT_FLY: - nNewNode = pAnchor->GetCntntAnchor()->nNode.GetIndex(); + nNewNode = pAnchor->GetContentAnchor()->nNode.GetIndex(); break; default: - nNewCntnt = pAnchor->GetPageNum(); + nNewContent = pAnchor->GetPageNum(); } } else @@ -679,7 +679,7 @@ void SwUndoSetFlyFmt::PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem ) pItemSet->InvalidateItem( nWhich ); } -void SwUndoSetFlyFmt::Modify( const SfxPoolItem* pOld, const SfxPoolItem* ) +void SwUndoSetFlyFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* ) { if( pOld ) { diff --git a/sw/source/core/undo/undoflystrattr.cxx b/sw/source/core/undo/undoflystrattr.cxx index 3993ef2f6728..76bff54e965b 100644 --- a/sw/source/core/undo/undoflystrattr.cxx +++ b/sw/source/core/undo/undoflystrattr.cxx @@ -21,12 +21,12 @@ #include <frmfmt.hxx> -SwUndoFlyStrAttr::SwUndoFlyStrAttr( SwFlyFrmFmt& rFlyFrmFmt, +SwUndoFlyStrAttr::SwUndoFlyStrAttr( SwFlyFrameFormat& rFlyFrameFormat, const SwUndoId eUndoId, const OUString& sOldStr, const OUString& sNewStr ) : SwUndo( eUndoId ), - mrFlyFrmFmt( rFlyFrmFmt ), + mrFlyFrameFormat( rFlyFrameFormat ), msOldStr( sOldStr ), msNewStr( sNewStr ) { @@ -44,12 +44,12 @@ void SwUndoFlyStrAttr::UndoImpl(::sw::UndoRedoContext &) { case UNDO_FLYFRMFMT_TITLE: { - mrFlyFrmFmt.SetObjTitle( msOldStr, true ); + mrFlyFrameFormat.SetObjTitle( msOldStr, true ); } break; case UNDO_FLYFRMFMT_DESCRIPTION: { - mrFlyFrmFmt.SetObjDescription( msOldStr, true ); + mrFlyFrameFormat.SetObjDescription( msOldStr, true ); } break; default: @@ -64,12 +64,12 @@ void SwUndoFlyStrAttr::RedoImpl(::sw::UndoRedoContext &) { case UNDO_FLYFRMFMT_TITLE: { - mrFlyFrmFmt.SetObjTitle( msNewStr, true ); + mrFlyFrameFormat.SetObjTitle( msNewStr, true ); } break; case UNDO_FLYFRMFMT_DESCRIPTION: { - mrFlyFrmFmt.SetObjDescription( msNewStr, true ); + mrFlyFrameFormat.SetObjDescription( msNewStr, true ); } break; default: @@ -82,7 +82,7 @@ SwRewriter SwUndoFlyStrAttr::GetRewriter() const { SwRewriter aResult; - aResult.AddRule( UndoArg1, mrFlyFrmFmt.GetName() ); + aResult.AddRule( UndoArg1, mrFlyFrameFormat.GetName() ); return aResult; } diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx index ecbfd4fb128f..c054c9900d29 100644 --- a/sw/source/core/undo/undraw.cxx +++ b/sw/source/core/undo/undraw.cxx @@ -48,7 +48,7 @@ struct SwUndoGroupObjImpl { - SwDrawFrmFmt* pFmt; + SwDrawFrameFormat* pFormat; SdrObject* pObj; sal_uLong nNodeIdx; }; @@ -108,110 +108,110 @@ OUString SwSdrUndo::GetComment() const return pSdrUndo->GetComment(); } -static void lcl_SendRemoveToUno( SwFmt& rFmt ) +static void lcl_SendRemoveToUno( SwFormat& rFormat ) { - SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, &rFmt ); - rFmt.ModifyNotification( &aMsgHint, &aMsgHint ); + SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, &rFormat ); + rFormat.ModifyNotification( &aMsgHint, &aMsgHint ); } -static void lcl_SaveAnchor( SwFrmFmt* pFmt, sal_uLong& rNodePos ) +static void lcl_SaveAnchor( SwFrameFormat* pFormat, sal_uLong& rNodePos ) { - const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); + const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); if ((FLY_AT_PARA == rAnchor.GetAnchorId()) || (FLY_AT_CHAR == rAnchor.GetAnchorId()) || (FLY_AT_FLY == rAnchor.GetAnchorId()) || (FLY_AS_CHAR == rAnchor.GetAnchorId())) { - rNodePos = rAnchor.GetCntntAnchor()->nNode.GetIndex(); - sal_Int32 nCntntPos = 0; + rNodePos = rAnchor.GetContentAnchor()->nNode.GetIndex(); + sal_Int32 nContentPos = 0; if (FLY_AS_CHAR == rAnchor.GetAnchorId()) { - nCntntPos = rAnchor.GetCntntAnchor()->nContent.GetIndex(); + nContentPos = rAnchor.GetContentAnchor()->nContent.GetIndex(); // destroy TextAttribute - SwTxtNode *pTxtNd = pFmt->GetDoc()->GetNodes()[ rNodePos ]->GetTxtNode(); - OSL_ENSURE( pTxtNd, "No text node found!" ); - SwTxtFlyCnt* pAttr = static_cast<SwTxtFlyCnt*>( - pTxtNd->GetTxtAttrForCharAt( nCntntPos, RES_TXTATR_FLYCNT )); + SwTextNode *pTextNd = pFormat->GetDoc()->GetNodes()[ rNodePos ]->GetTextNode(); + OSL_ENSURE( pTextNd, "No text node found!" ); + SwTextFlyCnt* pAttr = static_cast<SwTextFlyCnt*>( + pTextNd->GetTextAttrForCharAt( nContentPos, RES_TXTATR_FLYCNT )); // attribute still in text node, delete - if( pAttr && pAttr->GetFlyCnt().GetFrmFmt() == pFmt ) + if( pAttr && pAttr->GetFlyCnt().GetFrameFormat() == pFormat ) { // just set pointer to 0, don't delete - const_cast<SwFmtFlyCnt&>(pAttr->GetFlyCnt()).SetFlyFmt(); - SwIndex aIdx( pTxtNd, nCntntPos ); - pTxtNd->EraseText( aIdx, 1 ); + const_cast<SwFormatFlyCnt&>(pAttr->GetFlyCnt()).SetFlyFormat(); + SwIndex aIdx( pTextNd, nContentPos ); + pTextNd->EraseText( aIdx, 1 ); } } else if (FLY_AT_CHAR == rAnchor.GetAnchorId()) { - nCntntPos = rAnchor.GetCntntAnchor()->nContent.GetIndex(); + nContentPos = rAnchor.GetContentAnchor()->nContent.GetIndex(); } - pFmt->SetFmtAttr( SwFmtAnchor( rAnchor.GetAnchorId(), nCntntPos ) ); + pFormat->SetFormatAttr( SwFormatAnchor( rAnchor.GetAnchorId(), nContentPos ) ); } } -static void lcl_RestoreAnchor( SwFrmFmt* pFmt, sal_uLong& rNodePos ) +static void lcl_RestoreAnchor( SwFrameFormat* pFormat, sal_uLong& rNodePos ) { - const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); + const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); if ((FLY_AT_PARA == rAnchor.GetAnchorId()) || (FLY_AT_CHAR == rAnchor.GetAnchorId()) || (FLY_AT_FLY == rAnchor.GetAnchorId()) || (FLY_AS_CHAR == rAnchor.GetAnchorId())) { - const sal_Int32 nCntntPos = rAnchor.GetPageNum(); - SwNodes& rNds = pFmt->GetDoc()->GetNodes(); + const sal_Int32 nContentPos = rAnchor.GetPageNum(); + SwNodes& rNds = pFormat->GetDoc()->GetNodes(); SwNodeIndex aIdx( rNds, rNodePos ); SwPosition aPos( aIdx ); - SwFmtAnchor aTmp( rAnchor.GetAnchorId() ); + SwFormatAnchor aTmp( rAnchor.GetAnchorId() ); if ((FLY_AS_CHAR == rAnchor.GetAnchorId()) || (FLY_AT_CHAR == rAnchor.GetAnchorId())) { - aPos.nContent.Assign( aIdx.GetNode().GetCntntNode(), nCntntPos ); + aPos.nContent.Assign( aIdx.GetNode().GetContentNode(), nContentPos ); } aTmp.SetAnchor( &aPos ); - pFmt->SetFmtAttr( aTmp ); + pFormat->SetFormatAttr( aTmp ); if (FLY_AS_CHAR == rAnchor.GetAnchorId()) { - SwTxtNode *pTxtNd = aIdx.GetNode().GetTxtNode(); - OSL_ENSURE( pTxtNd, "no Text Node" ); - SwFmtFlyCnt aFmt( pFmt ); - pTxtNd->InsertItem( aFmt, nCntntPos, nCntntPos ); + SwTextNode *pTextNd = aIdx.GetNode().GetTextNode(); + OSL_ENSURE( pTextNd, "no Text Node" ); + SwFormatFlyCnt aFormat( pFormat ); + pTextNd->InsertItem( aFormat, nContentPos, nContentPos ); } } } SwUndoDrawGroup::SwUndoDrawGroup( sal_uInt16 nCnt ) - : SwUndo( UNDO_DRAWGROUP ), nSize( nCnt + 1 ), bDelFmt( true ) + : SwUndo( UNDO_DRAWGROUP ), nSize( nCnt + 1 ), bDelFormat( true ) { pObjArr = new SwUndoGroupObjImpl[ nSize ]; } SwUndoDrawGroup::~SwUndoDrawGroup() { - if( bDelFmt ) + if( bDelFormat ) { SwUndoGroupObjImpl* pTmp = pObjArr + 1; for( sal_uInt16 n = 1; n < nSize; ++n, ++pTmp ) - delete pTmp->pFmt; + delete pTmp->pFormat; } else - delete pObjArr->pFmt; + delete pObjArr->pFormat; delete [] pObjArr; } void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &) { - bDelFmt = false; + bDelFormat = false; // save group object - SwDrawFrmFmt* pFmt = pObjArr->pFmt; - SwDrawContact* pDrawContact = static_cast<SwDrawContact*>(pFmt->FindContactObj()); + SwDrawFrameFormat* pFormat = pObjArr->pFormat; + SwDrawContact* pDrawContact = static_cast<SwDrawContact*>(pFormat->FindContactObj()); SdrObject* pObj = pDrawContact->GetMaster(); pObjArr->pObj = pObj; @@ -219,46 +219,46 @@ void SwUndoDrawGroup::UndoImpl(::sw::UndoRedoContext &) pDrawContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() ); pObj->SetUserCall( 0 ); - ::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx ); + ::lcl_SaveAnchor( pFormat, pObjArr->nNodeIdx ); // notify UNO objects to decouple - ::lcl_SendRemoveToUno( *pFmt ); + ::lcl_SendRemoveToUno( *pFormat ); // remove from array - SwDoc* pDoc = pFmt->GetDoc(); - SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts(); - rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), pFmt )); + SwDoc* pDoc = pFormat->GetDoc(); + SwFrameFormats& rFlyFormats = *pDoc->GetSpzFrameFormats(); + rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat )); for( sal_uInt16 n = 1; n < nSize; ++n ) { SwUndoGroupObjImpl& rSave = *( pObjArr + n ); - ::lcl_RestoreAnchor( rSave.pFmt, rSave.nNodeIdx ); - rFlyFmts.push_back( rSave.pFmt ); + ::lcl_RestoreAnchor( rSave.pFormat, rSave.nNodeIdx ); + rFlyFormats.push_back( rSave.pFormat ); pObj = rSave.pObj; - SwDrawContact *pContact = new SwDrawContact( rSave.pFmt, pObj ); + SwDrawContact *pContact = new SwDrawContact( rSave.pFormat, pObj ); pContact->ConnectToLayout(); // #i45718# - follow-up of #i35635# move object to visible layer pContact->MoveObjToVisibleLayer( pObj ); // #i45952# - notify that position attributes are already set - OSL_ENSURE( rSave.pFmt->ISA(SwDrawFrmFmt), + OSL_ENSURE( rSave.pFormat->ISA(SwDrawFrameFormat), "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" ); - if ( rSave.pFmt->ISA(SwDrawFrmFmt) ) + if ( rSave.pFormat->ISA(SwDrawFrameFormat) ) { - static_cast<SwDrawFrmFmt*>(rSave.pFmt)->PosAttrSet(); + static_cast<SwDrawFrameFormat*>(rSave.pFormat)->PosAttrSet(); } } } void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &) { - bDelFmt = true; + bDelFormat = true; // remove from array - SwDoc* pDoc = pObjArr->pFmt->GetDoc(); - SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts(); + SwDoc* pDoc = pObjArr->pFormat->GetDoc(); + SwFrameFormats& rFlyFormats = *pDoc->GetSpzFrameFormats(); for( sal_uInt16 n = 1; n < nSize; ++n ) { @@ -272,174 +272,174 @@ void SwUndoDrawGroup::RedoImpl(::sw::UndoRedoContext &) pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() ); pObj->SetUserCall( 0 ); - ::lcl_SaveAnchor( rSave.pFmt, rSave.nNodeIdx ); + ::lcl_SaveAnchor( rSave.pFormat, rSave.nNodeIdx ); // notify UNO objects to decouple - ::lcl_SendRemoveToUno( *rSave.pFmt ); + ::lcl_SendRemoveToUno( *rSave.pFormat ); - rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), rSave.pFmt )); + rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), rSave.pFormat )); } // re-insert group object - ::lcl_RestoreAnchor( pObjArr->pFmt, pObjArr->nNodeIdx ); - rFlyFmts.push_back( pObjArr->pFmt ); + ::lcl_RestoreAnchor( pObjArr->pFormat, pObjArr->nNodeIdx ); + rFlyFormats.push_back( pObjArr->pFormat ); - SwDrawContact *pContact = new SwDrawContact( pObjArr->pFmt, pObjArr->pObj ); + SwDrawContact *pContact = new SwDrawContact( pObjArr->pFormat, pObjArr->pObj ); // #i26791# - correction: connect object to layout pContact->ConnectToLayout(); // #i45718# - follow-up of #i35635# move object to visible layer pContact->MoveObjToVisibleLayer( pObjArr->pObj ); // #i45952# - notify that position attributes are already set - OSL_ENSURE( pObjArr->pFmt->ISA(SwDrawFrmFmt), + OSL_ENSURE( pObjArr->pFormat->ISA(SwDrawFrameFormat), "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" ); - if ( pObjArr->pFmt->ISA(SwDrawFrmFmt) ) + if ( pObjArr->pFormat->ISA(SwDrawFrameFormat) ) { - static_cast<SwDrawFrmFmt*>(pObjArr->pFmt)->PosAttrSet(); + static_cast<SwDrawFrameFormat*>(pObjArr->pFormat)->PosAttrSet(); } } -void SwUndoDrawGroup::AddObj( sal_uInt16 nPos, SwDrawFrmFmt* pFmt, SdrObject* pObj ) +void SwUndoDrawGroup::AddObj( sal_uInt16 nPos, SwDrawFrameFormat* pFormat, SdrObject* pObj ) { SwUndoGroupObjImpl& rSave = *( pObjArr + nPos + 1 ); rSave.pObj = pObj; - rSave.pFmt = pFmt; - ::lcl_SaveAnchor( pFmt, rSave.nNodeIdx ); + rSave.pFormat = pFormat; + ::lcl_SaveAnchor( pFormat, rSave.nNodeIdx ); // notify UNO objects to decouple - ::lcl_SendRemoveToUno( *pFmt ); + ::lcl_SendRemoveToUno( *pFormat ); // remove from array - SwFrmFmts& rFlyFmts = *pFmt->GetDoc()->GetSpzFrmFmts(); - rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), pFmt )); + SwFrameFormats& rFlyFormats = *pFormat->GetDoc()->GetSpzFrameFormats(); + rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat )); } -void SwUndoDrawGroup::SetGroupFmt( SwDrawFrmFmt* pFmt ) +void SwUndoDrawGroup::SetGroupFormat( SwDrawFrameFormat* pFormat ) { pObjArr->pObj = 0; - pObjArr->pFmt = pFmt; + pObjArr->pFormat = pFormat; } SwUndoDrawUnGroup::SwUndoDrawUnGroup( SdrObjGroup* pObj ) - : SwUndo( UNDO_DRAWUNGROUP ), bDelFmt( false ) + : SwUndo( UNDO_DRAWUNGROUP ), bDelFormat( false ) { nSize = (sal_uInt16)pObj->GetSubList()->GetObjCount() + 1; pObjArr = new SwUndoGroupObjImpl[ nSize ]; SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj)); - SwDrawFrmFmt* pFmt = static_cast<SwDrawFrmFmt*>(pContact->GetFmt()); + SwDrawFrameFormat* pFormat = static_cast<SwDrawFrameFormat*>(pContact->GetFormat()); pObjArr->pObj = pObj; - pObjArr->pFmt = pFmt; + pObjArr->pFormat = pFormat; // object will destroy itself pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() ); pObj->SetUserCall( 0 ); - ::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx ); + ::lcl_SaveAnchor( pFormat, pObjArr->nNodeIdx ); // notify UNO objects to decouple - ::lcl_SendRemoveToUno( *pFmt ); + ::lcl_SendRemoveToUno( *pFormat ); // remove from array - SwFrmFmts& rFlyFmts = *pFmt->GetDoc()->GetSpzFrmFmts(); - rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), pFmt )); + SwFrameFormats& rFlyFormats = *pFormat->GetDoc()->GetSpzFrameFormats(); + rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat )); } SwUndoDrawUnGroup::~SwUndoDrawUnGroup() { - if( bDelFmt ) + if( bDelFormat ) { SwUndoGroupObjImpl* pTmp = pObjArr + 1; for( sal_uInt16 n = 1; n < nSize; ++n, ++pTmp ) - delete pTmp->pFmt; + delete pTmp->pFormat; } else - delete pObjArr->pFmt; + delete pObjArr->pFormat; delete [] pObjArr; } void SwUndoDrawUnGroup::UndoImpl(::sw::UndoRedoContext & rContext) { - bDelFmt = true; + bDelFormat = true; SwDoc *const pDoc = & rContext.GetDoc(); - SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts(); + SwFrameFormats& rFlyFormats = *pDoc->GetSpzFrameFormats(); // remove from array for( sal_uInt16 n = 1; n < nSize; ++n ) { SwUndoGroupObjImpl& rSave = *( pObjArr + n ); - ::lcl_SaveAnchor( rSave.pFmt, rSave.nNodeIdx ); + ::lcl_SaveAnchor( rSave.pFormat, rSave.nNodeIdx ); // notify UNO objects to decouple - ::lcl_SendRemoveToUno( *rSave.pFmt ); + ::lcl_SendRemoveToUno( *rSave.pFormat ); - rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), rSave.pFmt )); + rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), rSave.pFormat )); } // re-insert group object - ::lcl_RestoreAnchor( pObjArr->pFmt, pObjArr->nNodeIdx ); - rFlyFmts.push_back( pObjArr->pFmt ); + ::lcl_RestoreAnchor( pObjArr->pFormat, pObjArr->nNodeIdx ); + rFlyFormats.push_back( pObjArr->pFormat ); - SwDrawContact *pContact = new SwDrawContact( pObjArr->pFmt, pObjArr->pObj ); + SwDrawContact *pContact = new SwDrawContact( pObjArr->pFormat, pObjArr->pObj ); pContact->ConnectToLayout(); // #i45718# - follow-up of #i35635# move object to visible layer pContact->MoveObjToVisibleLayer( pObjArr->pObj ); // #i45952# - notify that position attributes are already set - OSL_ENSURE( pObjArr->pFmt->ISA(SwDrawFrmFmt), + OSL_ENSURE( pObjArr->pFormat->ISA(SwDrawFrameFormat), "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" ); - if ( pObjArr->pFmt->ISA(SwDrawFrmFmt) ) + if ( pObjArr->pFormat->ISA(SwDrawFrameFormat) ) { - static_cast<SwDrawFrmFmt*>(pObjArr->pFmt)->PosAttrSet(); + static_cast<SwDrawFrameFormat*>(pObjArr->pFormat)->PosAttrSet(); } } void SwUndoDrawUnGroup::RedoImpl(::sw::UndoRedoContext &) { - bDelFmt = false; + bDelFormat = false; // save group object - SwDrawFrmFmt* pFmt = pObjArr->pFmt; - SwDrawContact* pContact = static_cast<SwDrawContact*>(pFmt->FindContactObj()); + SwDrawFrameFormat* pFormat = pObjArr->pFormat; + SwDrawContact* pContact = static_cast<SwDrawContact*>(pFormat->FindContactObj()); // object will destroy itself pContact->Changed( *pObjArr->pObj, SDRUSERCALL_DELETE, pObjArr->pObj->GetLastBoundRect() ); pObjArr->pObj->SetUserCall( 0 ); - ::lcl_SaveAnchor( pFmt, pObjArr->nNodeIdx ); + ::lcl_SaveAnchor( pFormat, pObjArr->nNodeIdx ); // notify UNO objects to decouple - ::lcl_SendRemoveToUno( *pFmt ); + ::lcl_SendRemoveToUno( *pFormat ); // remove from array - SwDoc* pDoc = pFmt->GetDoc(); - SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts(); - rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), pFmt )); + SwDoc* pDoc = pFormat->GetDoc(); + SwFrameFormats& rFlyFormats = *pDoc->GetSpzFrameFormats(); + rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat )); for( sal_uInt16 n = 1; n < nSize; ++n ) { SwUndoGroupObjImpl& rSave = *( pObjArr + n ); - ::lcl_RestoreAnchor( rSave.pFmt, rSave.nNodeIdx ); - rFlyFmts.push_back( rSave.pFmt ); + ::lcl_RestoreAnchor( rSave.pFormat, rSave.nNodeIdx ); + rFlyFormats.push_back( rSave.pFormat ); // #i45952# - notify that position attributes are already set - OSL_ENSURE( rSave.pFmt->ISA(SwDrawFrmFmt), + OSL_ENSURE( rSave.pFormat->ISA(SwDrawFrameFormat), "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" ); - if ( rSave.pFmt->ISA(SwDrawFrmFmt) ) + if ( rSave.pFormat->ISA(SwDrawFrameFormat) ) { - static_cast<SwDrawFrmFmt*>(rSave.pFmt)->PosAttrSet(); + static_cast<SwDrawFrameFormat*>(rSave.pFormat)->PosAttrSet(); } } } -void SwUndoDrawUnGroup::AddObj( sal_uInt16 nPos, SwDrawFrmFmt* pFmt ) +void SwUndoDrawUnGroup::AddObj( sal_uInt16 nPos, SwDrawFrameFormat* pFormat ) { SwUndoGroupObjImpl& rSave = *( pObjArr + nPos + 1 ); - rSave.pFmt = pFmt; + rSave.pFormat = pFormat; rSave.pObj = 0; } @@ -456,9 +456,9 @@ void SwUndoDrawUnGroupConnectToLayout::UndoImpl(::sw::UndoRedoContext &) { for ( std::vector< SdrObject >::size_type i = 0; - i < aDrawFmtsAndObjs.size(); ++i ) + i < aDrawFormatsAndObjs.size(); ++i ) { - SdrObject* pObj( aDrawFmtsAndObjs[i].second ); + SdrObject* pObj( aDrawFormatsAndObjs[i].second ); SwDrawContact* pDrawContact( dynamic_cast<SwDrawContact*>(pObj->GetUserCall()) ); OSL_ENSURE( pDrawContact, "<SwUndoDrawUnGroupConnectToLayout::Undo(..)> -- missing SwDrawContact instance" ); @@ -475,26 +475,26 @@ SwUndoDrawUnGroupConnectToLayout::UndoImpl(::sw::UndoRedoContext &) void SwUndoDrawUnGroupConnectToLayout::RedoImpl(::sw::UndoRedoContext &) { - for ( std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > >::size_type i = 0; - i < aDrawFmtsAndObjs.size(); ++i ) + for ( std::vector< std::pair< SwDrawFrameFormat*, SdrObject* > >::size_type i = 0; + i < aDrawFormatsAndObjs.size(); ++i ) { - SwDrawFrmFmt* pFmt( aDrawFmtsAndObjs[i].first ); - SdrObject* pObj( aDrawFmtsAndObjs[i].second ); - SwDrawContact *pContact = new SwDrawContact( pFmt, pObj ); + SwDrawFrameFormat* pFormat( aDrawFormatsAndObjs[i].first ); + SdrObject* pObj( aDrawFormatsAndObjs[i].second ); + SwDrawContact *pContact = new SwDrawContact( pFormat, pObj ); pContact->ConnectToLayout(); pContact->MoveObjToVisibleLayer( pObj ); } } -void SwUndoDrawUnGroupConnectToLayout::AddFmtAndObj( SwDrawFrmFmt* pDrawFrmFmt, +void SwUndoDrawUnGroupConnectToLayout::AddFormatAndObj( SwDrawFrameFormat* pDrawFrameFormat, SdrObject* pDrawObject ) { - aDrawFmtsAndObjs.push_back( - std::pair< SwDrawFrmFmt*, SdrObject* >( pDrawFrmFmt, pDrawObject ) ); + aDrawFormatsAndObjs.push_back( + std::pair< SwDrawFrameFormat*, SdrObject* >( pDrawFrameFormat, pDrawObject ) ); } SwUndoDrawDelete::SwUndoDrawDelete( sal_uInt16 nCnt ) - : SwUndo( UNDO_DRAWDELETE ), nSize( nCnt ), bDelFmt( true ) + : SwUndo( UNDO_DRAWDELETE ), nSize( nCnt ), bDelFormat( true ) { pObjArr = new SwUndoGroupObjImpl[ nSize ]; pMarkLst = new SdrMarkList(); @@ -502,11 +502,11 @@ SwUndoDrawDelete::SwUndoDrawDelete( sal_uInt16 nCnt ) SwUndoDrawDelete::~SwUndoDrawDelete() { - if( bDelFmt ) + if( bDelFormat ) { SwUndoGroupObjImpl* pTmp = pObjArr; for( size_t n = 0; n < pMarkLst->GetMarkCount(); ++n, ++pTmp ) - delete pTmp->pFmt; + delete pTmp->pFormat; } delete [] pObjArr; delete pMarkLst; @@ -514,24 +514,24 @@ SwUndoDrawDelete::~SwUndoDrawDelete() void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext) { - bDelFmt = false; - SwFrmFmts & rFlyFmts = *rContext.GetDoc().GetSpzFrmFmts(); + bDelFormat = false; + SwFrameFormats & rFlyFormats = *rContext.GetDoc().GetSpzFrameFormats(); for( size_t n = 0; n < pMarkLst->GetMarkCount(); ++n ) { SwUndoGroupObjImpl& rSave = *( pObjArr + n ); - ::lcl_RestoreAnchor( rSave.pFmt, rSave.nNodeIdx ); - rFlyFmts.push_back( rSave.pFmt ); + ::lcl_RestoreAnchor( rSave.pFormat, rSave.nNodeIdx ); + rFlyFormats.push_back( rSave.pFormat ); SdrObject *pObj = rSave.pObj; - SwDrawContact *pContact = new SwDrawContact( rSave.pFmt, pObj ); + SwDrawContact *pContact = new SwDrawContact( rSave.pFormat, pObj ); pContact->_Changed( *pObj, SDRUSERCALL_INSERTED, NULL ); // #i45718# - follow-up of #i35635# move object to visible layer pContact->MoveObjToVisibleLayer( pObj ); // #i45952# - notify that position attributes are already set - OSL_ENSURE( rSave.pFmt->ISA(SwDrawFrmFmt), + OSL_ENSURE( rSave.pFormat->ISA(SwDrawFrameFormat), "<SwUndoDrawGroup::Undo(..)> - wrong type of frame format for drawing object" ); - if ( rSave.pFmt->ISA(SwDrawFrmFmt) ) + if ( rSave.pFormat->ISA(SwDrawFrameFormat) ) { - static_cast<SwDrawFrmFmt*>(rSave.pFmt)->PosAttrSet(); + static_cast<SwDrawFrameFormat*>(rSave.pFormat)->PosAttrSet(); } } rContext.SetSelections(0, pMarkLst); @@ -539,42 +539,42 @@ void SwUndoDrawDelete::UndoImpl(::sw::UndoRedoContext & rContext) void SwUndoDrawDelete::RedoImpl(::sw::UndoRedoContext & rContext) { - bDelFmt = true; - SwFrmFmts & rFlyFmts = *rContext.GetDoc().GetSpzFrmFmts(); + bDelFormat = true; + SwFrameFormats & rFlyFormats = *rContext.GetDoc().GetSpzFrameFormats(); for( size_t n = 0; n < pMarkLst->GetMarkCount(); ++n ) { SwUndoGroupObjImpl& rSave = *( pObjArr + n ); SdrObject *pObj = rSave.pObj; SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj)); - SwDrawFrmFmt *pFmt = static_cast<SwDrawFrmFmt*>(pContact->GetFmt()); + SwDrawFrameFormat *pFormat = static_cast<SwDrawFrameFormat*>(pContact->GetFormat()); // object will destroy itself pContact->Changed( *pObj, SDRUSERCALL_DELETE, pObj->GetLastBoundRect() ); pObj->SetUserCall( 0 ); // notify UNO objects to decouple - ::lcl_SendRemoveToUno( *pFmt ); + ::lcl_SendRemoveToUno( *pFormat ); - rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), pFmt )); - ::lcl_SaveAnchor( pFmt, rSave.nNodeIdx ); + rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat )); + ::lcl_SaveAnchor( pFormat, rSave.nNodeIdx ); } } -void SwUndoDrawDelete::AddObj( sal_uInt16 , SwDrawFrmFmt* pFmt, +void SwUndoDrawDelete::AddObj( sal_uInt16 , SwDrawFrameFormat* pFormat, const SdrMark& rMark ) { SwUndoGroupObjImpl& rSave = *( pObjArr + pMarkLst->GetMarkCount() ); rSave.pObj = rMark.GetMarkedSdrObj(); - rSave.pFmt = pFmt; - ::lcl_SaveAnchor( pFmt, rSave.nNodeIdx ); + rSave.pFormat = pFormat; + ::lcl_SaveAnchor( pFormat, rSave.nNodeIdx ); // notify UNO objects to decouple - ::lcl_SendRemoveToUno( *pFmt ); + ::lcl_SendRemoveToUno( *pFormat ); // remove from array - SwDoc* pDoc = pFmt->GetDoc(); - SwFrmFmts& rFlyFmts = *pDoc->GetSpzFrmFmts(); - rFlyFmts.erase( std::find( rFlyFmts.begin(), rFlyFmts.end(), pFmt )); + SwDoc* pDoc = pFormat->GetDoc(); + SwFrameFormats& rFlyFormats = *pDoc->GetSpzFrameFormats(); + rFlyFormats.erase( std::find( rFlyFormats.begin(), rFlyFormats.end(), pFormat )); pMarkLst->InsertEntry( rMark ); } diff --git a/sw/source/core/undo/unfmco.cxx b/sw/source/core/undo/unfmco.cxx index 458b400860f9..7759230e559a 100644 --- a/sw/source/core/undo/unfmco.cxx +++ b/sw/source/core/undo/unfmco.cxx @@ -25,28 +25,28 @@ #include "rolbck.hxx" #include "docary.hxx" -SwUndoFmtColl::SwUndoFmtColl( const SwPaM& rRange, - SwFmtColl* pColl, +SwUndoFormatColl::SwUndoFormatColl( const SwPaM& rRange, + SwFormatColl* pColl, const bool bReset, const bool bResetListAttrs ) : SwUndo( UNDO_SETFMTCOLL ), SwUndRng( rRange ), pHistory( new SwHistory ), - pFmtColl( pColl ), + pFormatColl( pColl ), mbReset( bReset ), mbResetListAttrs( bResetListAttrs ) { // #i31191# if ( pColl ) - aFmtName = pColl->GetName(); + aFormatName = pColl->GetName(); } -SwUndoFmtColl::~SwUndoFmtColl() +SwUndoFormatColl::~SwUndoFormatColl() { delete pHistory; } -void SwUndoFmtColl::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoFormatColl::UndoImpl(::sw::UndoRedoContext & rContext) { // restore old values pHistory->TmpRollback(& rContext.GetDoc(), 0); @@ -56,39 +56,39 @@ void SwUndoFmtColl::UndoImpl(::sw::UndoRedoContext & rContext) AddUndoRedoPaM(rContext); } -void SwUndoFmtColl::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoFormatColl::RedoImpl(::sw::UndoRedoContext & rContext) { SwPaM & rPam = AddUndoRedoPaM(rContext); - DoSetFmtColl(rContext.GetDoc(), rPam); + DoSetFormatColl(rContext.GetDoc(), rPam); } -void SwUndoFmtColl::RepeatImpl(::sw::RepeatContext & rContext) +void SwUndoFormatColl::RepeatImpl(::sw::RepeatContext & rContext) { - DoSetFmtColl(rContext.GetDoc(), rContext.GetRepeatPaM()); + DoSetFormatColl(rContext.GetDoc(), rContext.GetRepeatPaM()); } -void SwUndoFmtColl::DoSetFmtColl(SwDoc & rDoc, SwPaM & rPaM) +void SwUndoFormatColl::DoSetFormatColl(SwDoc & rDoc, SwPaM & rPaM) { // Only one TextFrmColl can be applied to a section, thus request only in // this array. // does the format still exist? - if( rDoc.GetTxtFmtColls()->Contains(static_cast<SwTxtFmtColl*>(pFmtColl)) ) + if( rDoc.GetTextFormatColls()->Contains(static_cast<SwTextFormatColl*>(pFormatColl)) ) { - rDoc.SetTxtFmtColl(rPaM, static_cast<SwTxtFmtColl*>(pFmtColl), mbReset, + rDoc.SetTextFormatColl(rPaM, static_cast<SwTextFormatColl*>(pFormatColl), mbReset, mbResetListAttrs); } } -SwRewriter SwUndoFmtColl::GetRewriter() const +SwRewriter SwUndoFormatColl::GetRewriter() const { SwRewriter aResult; // #i31191# Use stored format name instead of - // pFmtColl->GetName(), because pFmtColl does not have to be available + // pFormatColl->GetName(), because pFormatColl does not have to be available // anymore. - aResult.AddRule(UndoArg1, aFmtName ); + aResult.AddRule(UndoArg1, aFormatName ); return aResult; } diff --git a/sw/source/core/undo/unins.cxx b/sw/source/core/undo/unins.cxx index 931cb1f580cc..58bdcf48c34b 100644 --- a/sw/source/core/undo/unins.cxx +++ b/sw/source/core/undo/unins.cxx @@ -60,21 +60,21 @@ using namespace ::com::sun::star; // INSERT -OUString * SwUndoInsert::GetTxtFromDoc() const +OUString * SwUndoInsert::GetTextFromDoc() const { OUString * pResult = NULL; SwNodeIndex aNd( pDoc->GetNodes(), nNode); - SwCntntNode* pCNd = aNd.GetNode().GetCntntNode(); - SwPaM aPaM( *pCNd, nCntnt ); + SwContentNode* pCNd = aNd.GetNode().GetContentNode(); + SwPaM aPaM( *pCNd, nContent ); aPaM.SetMark(); - if( pCNd->IsTxtNode() ) + if( pCNd->IsTextNode() ) { - OUString sTxt = pCNd->GetTxtNode()->GetTxt(); + OUString sText = pCNd->GetTextNode()->GetText(); - sal_Int32 nStart = nCntnt-nLen; + sal_Int32 nStart = nContent-nLen; sal_Int32 nLength = nLen; if (nStart < 0) @@ -83,7 +83,7 @@ OUString * SwUndoInsert::GetTxtFromDoc() const nStart = 0; } - pResult = new OUString(sTxt.copy(nStart, nLength)); + pResult = new OUString(sText.copy(nStart, nLength)); } return pResult; @@ -100,7 +100,7 @@ void SwUndoInsert::Init(const SwNodeIndex & rNd) SetRedlineMode( pDoc->getIDocumentRedlineAccess().GetRedlineMode() ); } - pUndoTxt = GetTxtFromDoc(); + pUndoText = GetTextFromDoc(); bCacheComment = false; } @@ -110,8 +110,8 @@ SwUndoInsert::SwUndoInsert( const SwNodeIndex& rNd, sal_Int32 nCnt, sal_Int32 nL, const SwInsertFlags nInsertFlags, bool bWDelim ) - : SwUndo(UNDO_TYPING), pTxt( 0 ), pRedlData( 0 ), - nNode( rNd.GetIndex() ), nCntnt(nCnt), nLen(nL), + : SwUndo(UNDO_TYPING), pText( 0 ), pRedlData( 0 ), + nNode( rNd.GetIndex() ), nContent(nCnt), nLen(nL), bIsWordDelim( bWDelim ), bIsAppend( false ) , m_bWithRsid(false) , m_nInsertFlags(nInsertFlags) @@ -121,8 +121,8 @@ SwUndoInsert::SwUndoInsert( const SwNodeIndex& rNd, sal_Int32 nCnt, // #111827# SwUndoInsert::SwUndoInsert( const SwNodeIndex& rNd ) - : SwUndo(UNDO_SPLITNODE), pTxt( 0 ), - pRedlData( 0 ), nNode( rNd.GetIndex() ), nCntnt(0), nLen(1), + : SwUndo(UNDO_SPLITNODE), pText( 0 ), + pRedlData( 0 ), nNode( rNd.GetIndex() ), nContent(0), nLen(1), bIsWordDelim( false ), bIsAppend( true ) , m_bWithRsid(false) , m_nInsertFlags(SwInsertFlags::EMPTYEXPAND) @@ -140,10 +140,10 @@ bool SwUndoInsert::CanGrouping( sal_Unicode cIns ) !GetAppCharClass().isLetterNumeric( OUString( cIns )) ) { nLen++; - nCntnt++; + nContent++; - if (pUndoTxt) - (*pUndoTxt) += OUString(cIns); + if (pUndoText) + (*pUndoText) += OUString(cIns); return true; } @@ -154,7 +154,7 @@ bool SwUndoInsert::CanGrouping( const SwPosition& rPos ) { bool bRet = false; if( nNode == rPos.nNode.GetIndex() && - nCntnt == rPos.nContent.GetIndex() ) + nContent == rPos.nContent.GetIndex() ) { // consider Redline SwDoc& rDoc = *rPos.nNode.GetNode().GetDoc(); @@ -166,17 +166,17 @@ bool SwUndoInsert::CanGrouping( const SwPosition& rPos ) // than there is or was still an active Redline: // Check if there is another Redline at the InsPosition. If the // same exists only once, it can be combined. - const SwRedlineTbl& rTbl = rDoc.getIDocumentRedlineAccess().GetRedlineTbl(); - if( !rTbl.empty() ) + const SwRedlineTable& rTable = rDoc.getIDocumentRedlineAccess().GetRedlineTable(); + if( !rTable.empty() ) { SwRedlineData aRData( nsRedlineType_t::REDLINE_INSERT, rDoc.getIDocumentRedlineAccess().GetRedlineAuthor() ); const SwIndexReg* pIReg = rPos.nContent.GetIdxReg(); - for( size_t i = 0; i < rTbl.size(); ++i ) + for( size_t i = 0; i < rTable.size(); ++i ) { - SwRangeRedline* pRedl = rTbl[ i ]; + SwRangeRedline* pRedl = rTable[ i ]; SwIndex* pIdx = &pRedl->End()->nContent; if( pIReg == pIdx->GetIdxReg() && - nCntnt == pIdx->GetIndex() ) + nContent == pIdx->GetIndex() ) { if( !pRedl->HasMark() || !pRedlData || *pRedl != *pRedlData || *pRedl != aRData ) @@ -202,10 +202,10 @@ SwUndoInsert::~SwUndoInsert() rUNds.GetEndOfExtras().GetIndex() - m_pUndoNodeIndex->GetIndex()); m_pUndoNodeIndex.reset(); } - else if( pTxt ) // the inserted text - delete pTxt; + else if( pText ) // the inserted text + delete pText; delete pRedlData; - delete pUndoTxt; + delete pUndoText; } void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext) @@ -219,7 +219,7 @@ void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext) if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() )) { - pPam->GetPoint()->nContent.Assign( pPam->GetCntntNode(), 0 ); + pPam->GetPoint()->nContent.Assign( pPam->GetContentNode(), 0 ); pPam->SetMark(); pPam->Move( fnMoveBackward ); pPam->Exchange(); @@ -227,22 +227,22 @@ void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext) } pPam->DeleteMark(); pTmpDoc->getIDocumentContentOperations().DelFullPara( *pPam ); - pPam->GetPoint()->nContent.Assign( pPam->GetCntntNode(), 0 ); + pPam->GetPoint()->nContent.Assign( pPam->GetContentNode(), 0 ); } else { sal_uLong nNd = nNode; - sal_Int32 nCnt = nCntnt; + sal_Int32 nCnt = nContent; if( nLen ) { SwNodeIndex aNd( pTmpDoc->GetNodes(), nNode); - SwCntntNode* pCNd = aNd.GetNode().GetCntntNode(); - SwPaM aPaM( *pCNd, nCntnt ); + SwContentNode* pCNd = aNd.GetNode().GetContentNode(); + SwPaM aPaM( *pCNd, nContent ); aPaM.SetMark(); - SwTxtNode * const pTxtNode( pCNd->GetTxtNode() ); - if ( pTxtNode ) + SwTextNode * const pTextNode( pCNd->GetTextNode() ); + if ( pTextNode ) { aPaM.GetPoint()->nContent -= nLen; if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() )) @@ -252,16 +252,16 @@ void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext) // RSID was added: remove any CHARFMT/AUTOFMT that may be // set on the deleted text; EraseText will leave empty // ones behind otherwise - pTxtNode->DeleteAttributes(RES_TXTATR_AUTOFMT, + pTextNode->DeleteAttributes(RES_TXTATR_AUTOFMT, aPaM.GetPoint()->nContent.GetIndex(), aPaM.GetMark()->nContent.GetIndex()); - pTxtNode->DeleteAttributes(RES_TXTATR_CHARFMT, + pTextNode->DeleteAttributes(RES_TXTATR_CHARFMT, aPaM.GetPoint()->nContent.GetIndex(), aPaM.GetMark()->nContent.GetIndex()); } RemoveIdxFromRange( aPaM, false ); - pTxt = new OUString( pTxtNode->GetTxt().copy(nCntnt-nLen, nLen) ); - pTxtNode->EraseText( aPaM.GetPoint()->nContent, nLen ); + pText = new OUString( pTextNode->GetText().copy(nContent-nLen, nLen) ); + pTextNode->EraseText( aPaM.GetPoint()->nContent, nLen ); } else // otherwise Graphics/OLE/Text/... { @@ -274,14 +274,14 @@ void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext) nNd = aPaM.GetPoint()->nNode.GetIndex(); nCnt = aPaM.GetPoint()->nContent.GetIndex(); - if( !pTxt ) + if( !pText ) { m_pUndoNodeIndex.reset( new SwNodeIndex(pDoc->GetNodes().GetEndOfContent())); MoveToUndoNds(aPaM, m_pUndoNodeIndex.get()); } nNode = aPaM.GetPoint()->nNode.GetIndex(); - nCntnt = aPaM.GetPoint()->nContent.GetIndex(); + nContent = aPaM.GetPoint()->nContent.GetIndex(); } // set cursor to Undo range @@ -289,10 +289,10 @@ void SwUndoInsert::UndoImpl(::sw::UndoRedoContext & rContext) pPam->GetPoint()->nNode = nNd; pPam->GetPoint()->nContent.Assign( - pPam->GetPoint()->nNode.GetNode().GetCntntNode(), nCnt ); + pPam->GetPoint()->nNode.GetNode().GetContentNode(), nCnt ); } - DELETEZ(pUndoTxt); + DELETEZ(pUndoText); } void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & rContext) @@ -304,7 +304,7 @@ void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & rContext) if( bIsAppend ) { pPam->GetPoint()->nNode = nNode - 1; - pTmpDoc->getIDocumentContentOperations().AppendTxtNode( *pPam->GetPoint() ); + pTmpDoc->getIDocumentContentOperations().AppendTextNode( *pPam->GetPoint() ); pPam->SetMark(); pPam->Move( fnMoveBackward ); @@ -318,7 +318,7 @@ void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & rContext) pTmpDoc->getIDocumentRedlineAccess().SetRedlineMode_intern( eOld ); } else if( !( nsRedlineMode_t::REDLINE_IGNORE & GetRedlineMode() ) && - !pTmpDoc->getIDocumentRedlineAccess().GetRedlineTbl().empty() ) + !pTmpDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() ) pTmpDoc->getIDocumentRedlineAccess().SplitRedline( *pPam ); pPam->DeleteMark(); @@ -326,23 +326,23 @@ void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & rContext) else { pPam->GetPoint()->nNode = nNode; - SwCntntNode *const pCNd = - pPam->GetPoint()->nNode.GetNode().GetCntntNode(); - pPam->GetPoint()->nContent.Assign( pCNd, nCntnt ); + SwContentNode *const pCNd = + pPam->GetPoint()->nNode.GetNode().GetContentNode(); + pPam->GetPoint()->nContent.Assign( pCNd, nContent ); if( nLen ) { const bool bMvBkwrd = MovePtBackward( *pPam ); - if( pTxt ) + if( pText ) { - SwTxtNode *const pTxtNode = pCNd->GetTxtNode(); - OSL_ENSURE( pTxtNode, "where is my textnode ?" ); + SwTextNode *const pTextNode = pCNd->GetTextNode(); + OSL_ENSURE( pTextNode, "where is my textnode ?" ); OUString const ins( - pTxtNode->InsertText( *pTxt, pPam->GetMark()->nContent, + pTextNode->InsertText( *pText, pPam->GetMark()->nContent, m_nInsertFlags) ); - assert(ins.getLength() == pTxt->getLength()); // must succeed - DELETEZ( pTxt ); + assert(ins.getLength() == pText->getLength()); // must succeed + DELETEZ( pText ); if (m_bWithRsid) // re-insert RSID { SwPaM pam(*pPam->GetMark(), 0); // mark -> point @@ -357,7 +357,7 @@ void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & rContext) MoveFromUndoNds(*pTmpDoc, nMvNd, *pPam->GetMark()); } nNode = pPam->GetMark()->nNode.GetIndex(); - nCntnt = pPam->GetMark()->nContent.GetIndex(); + nContent = pPam->GetMark()->nContent.GetIndex(); MovePtForward( *pPam, bMvBkwrd ); pPam->Exchange(); @@ -370,12 +370,12 @@ void SwUndoInsert::RedoImpl(::sw::UndoRedoContext & rContext) pTmpDoc->getIDocumentRedlineAccess().SetRedlineMode_intern( eOld ); } else if( !( nsRedlineMode_t::REDLINE_IGNORE & GetRedlineMode() ) && - !pTmpDoc->getIDocumentRedlineAccess().GetRedlineTbl().empty() ) + !pTmpDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() ) pTmpDoc->getIDocumentRedlineAccess().SplitRedline(*pPam); } } - pUndoTxt = GetTxtFromDoc(); + pUndoText = GetTextFromDoc(); } void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext) @@ -385,14 +385,14 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext) SwDoc & rDoc = rContext.GetDoc(); SwNodeIndex aNd( rDoc.GetNodes(), nNode ); - SwCntntNode* pCNd = aNd.GetNode().GetCntntNode(); + SwContentNode* pCNd = aNd.GetNode().GetContentNode(); if( !bIsAppend && 1 == nLen ) // >1 than always Text, otherwise Graphics/OLE/Text/... { - SwPaM aPaM( *pCNd, nCntnt ); + SwPaM aPaM( *pCNd, nContent ); aPaM.SetMark(); aPaM.Move(fnMoveBackward); - pCNd = aPaM.GetCntntNode(); + pCNd = aPaM.GetContentNode(); } // What happens with the possible selected range ??? @@ -402,14 +402,14 @@ void SwUndoInsert::RepeatImpl(::sw::RepeatContext & rContext) case ND_TEXTNODE: if( bIsAppend ) { - rDoc.getIDocumentContentOperations().AppendTxtNode( *rContext.GetRepeatPaM().GetPoint() ); + rDoc.getIDocumentContentOperations().AppendTextNode( *rContext.GetRepeatPaM().GetPoint() ); } else { - OUString const aTxt( pCNd->GetTxtNode()->GetTxt() ); + OUString const aText( pCNd->GetTextNode()->GetText() ); ::sw::GroupUndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo()); rDoc.getIDocumentContentOperations().InsertString( rContext.GetRepeatPaM(), - aTxt.copy(nCntnt - nLen, nLen) ); + aText.copy(nContent - nLen, nLen) ); } break; case ND_GRFNODE: @@ -458,10 +458,10 @@ SwRewriter SwUndoInsert::GetRewriter() const OUString * pStr = NULL; bool bDone = false; - if (pTxt) - pStr = pTxt; - else if (pUndoTxt) - pStr = pUndoTxt; + if (pText) + pStr = pText; + else if (pUndoText) + pStr = pUndoText; if (pStr) { @@ -483,7 +483,7 @@ SwRewriter SwUndoInsert::GetRewriter() const } class SwUndoReplace::Impl - : private SwUndoSaveCntnt + : private SwUndoSaveContent { OUString m_sOld; OUString m_sIns; @@ -606,11 +606,11 @@ SwUndoReplace::Impl::Impl( m_bSplitNext = m_nSttNd != pEnd->nNode.GetIndex(); - SwTxtNode* pNd = pStt->nNode.GetNode().GetTxtNode(); + SwTextNode* pNd = pStt->nNode.GetNode().GetTextNode(); OSL_ENSURE( pNd, "Dude, where's my TextNode?" ); pHistory = new SwHistory; - DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint() ); + DelContentIndex( *rPam.GetMark(), *rPam.GetPoint() ); m_nSetPos = pHistory->Count(); @@ -620,22 +620,22 @@ SwUndoReplace::Impl::Impl( if ( pNd->GetpSwpHints() ) { pHistory->CopyAttr( pNd->GetpSwpHints(), nNewPos, 0, - pNd->GetTxt().getLength(), true ); + pNd->GetText().getLength(), true ); } if ( m_bSplitNext ) { if( pNd->HasSwAttrSet() ) - pHistory->CopyFmtAttr( *pNd->GetpSwAttrSet(), nNewPos ); - pHistory->Add( pNd->GetTxtColl(), nNewPos, ND_TEXTNODE ); + pHistory->CopyFormatAttr( *pNd->GetpSwAttrSet(), nNewPos ); + pHistory->Add( pNd->GetTextColl(), nNewPos, ND_TEXTNODE ); - SwTxtNode* pNext = pEnd->nNode.GetNode().GetTxtNode(); + SwTextNode* pNext = pEnd->nNode.GetNode().GetTextNode(); sal_uLong nTmp = pNext->GetIndex(); pHistory->CopyAttr( pNext->GetpSwpHints(), nTmp, 0, - pNext->GetTxt().getLength(), true ); + pNext->GetText().getLength(), true ); if( pNext->HasSwAttrSet() ) - pHistory->CopyFmtAttr( *pNext->GetpSwAttrSet(), nTmp ); - pHistory->Add( pNext->GetTxtColl(),nTmp, ND_TEXTNODE ); + pHistory->CopyFormatAttr( *pNext->GetpSwAttrSet(), nTmp ); + pHistory->Add( pNext->GetTextColl(),nTmp, ND_TEXTNODE ); // METADATA: store m_pMetadataUndoStart = pNd ->CreateUndo(); m_pMetadataUndoEnd = pNext->CreateUndo(); @@ -644,9 +644,9 @@ SwUndoReplace::Impl::Impl( if( !pHistory->Count() ) delete pHistory, pHistory = 0; - const sal_Int32 nECnt = m_bSplitNext ? pNd->GetTxt().getLength() + const sal_Int32 nECnt = m_bSplitNext ? pNd->GetText().getLength() : pEnd->nContent.GetIndex(); - m_sOld = pNd->GetTxt().copy( m_nSttCnt, nECnt - m_nSttCnt ); + m_sOld = pNd->GetText().copy( m_nSttCnt, nECnt - m_nSttCnt ); } void SwUndoReplace::Impl::UndoImpl(::sw::UndoRedoContext & rContext) @@ -655,7 +655,7 @@ void SwUndoReplace::Impl::UndoImpl(::sw::UndoRedoContext & rContext) SwPaM & rPam(rContext.GetCursorSupplier().CreateNewShellCursor()); rPam.DeleteMark(); - SwTxtNode* pNd = pDoc->GetNodes()[ m_nSttNd - m_nOffset ]->GetTxtNode(); + SwTextNode* pNd = pDoc->GetNodes()[ m_nSttNd - m_nOffset ]->GetTextNode(); OSL_ENSURE( pNd, "Dude, where's my TextNode?" ); SwAutoCorrExceptWord* pACEWord = pDoc->GetAutoCorrExceptWord(); @@ -676,13 +676,13 @@ void SwUndoReplace::Impl::UndoImpl(::sw::UndoRedoContext & rContext) rPam.GetPoint()->nContent.Assign( pNd, m_nSttCnt ); rPam.SetMark(); rPam.GetPoint()->nNode = m_nEndNd - m_nOffset; - rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), m_nEndCnt ); + rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), m_nEndCnt ); // move it out of the way so it is not registered at deleted node aIdx.Assign(0, 0); pDoc->getIDocumentContentOperations().DeleteAndJoin( rPam ); rPam.DeleteMark(); - pNd = rPam.GetNode().GetTxtNode(); + pNd = rPam.GetNode().GetTextNode(); OSL_ENSURE( pNd, "Dude, where's my TextNode?" ); aIdx.Assign( pNd, m_nSttCnt ); } @@ -692,7 +692,7 @@ void SwUndoReplace::Impl::UndoImpl(::sw::UndoRedoContext & rContext) SwPosition aPos( *pNd, aIdx ); pDoc->getIDocumentContentOperations().SplitNode( aPos, false ); pNd->RestoreMetadata(m_pMetadataUndoEnd); - pNd = pDoc->GetNodes()[ m_nSttNd - m_nOffset ]->GetTxtNode(); + pNd = pDoc->GetNodes()[ m_nSttNd - m_nOffset ]->GetTextNode(); aIdx.Assign( pNd, m_nSttCnt ); // METADATA: restore pNd->RestoreMetadata(m_pMetadataUndoStart); @@ -741,14 +741,14 @@ void SwUndoReplace::Impl::RedoImpl(::sw::UndoRedoContext & rContext) rPam.DeleteMark(); rPam.GetPoint()->nNode = m_nSttNd; - SwTxtNode* pNd = rPam.GetPoint()->nNode.GetNode().GetTxtNode(); + SwTextNode* pNd = rPam.GetPoint()->nNode.GetNode().GetTextNode(); OSL_ENSURE( pNd, "Dude, where's my TextNode?" ); rPam.GetPoint()->nContent.Assign( pNd, m_nSttCnt ); rPam.SetMark(); if( m_bSplitNext ) { rPam.GetPoint()->nNode = m_nSttNd + 1; - pNd = rPam.GetPoint()->nNode.GetNode().GetTxtNode(); + pNd = rPam.GetPoint()->nNode.GetNode().GetTextNode(); } rPam.GetPoint()->nContent.Assign( pNd, m_nSelEnd ); @@ -757,7 +757,7 @@ void SwUndoReplace::Impl::RedoImpl(::sw::UndoRedoContext & rContext) SwHistory* pSave = pHistory; SwHistory aHst; pHistory = &aHst; - DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint() ); + DelContentIndex( *rPam.GetMark(), *rPam.GetPoint() ); m_nSetPos = pHistory->Count(); pHistory = pSave; @@ -766,7 +766,7 @@ void SwUndoReplace::Impl::RedoImpl(::sw::UndoRedoContext & rContext) else { pHistory = new SwHistory; - DelCntntIndex( *rPam.GetMark(), *rPam.GetPoint() ); + DelContentIndex( *rPam.GetMark(), *rPam.GetPoint() ); m_nSetPos = pHistory->Count(); if( !m_nSetPos ) delete pHistory, pHistory = 0; @@ -827,7 +827,7 @@ void SwUndoReRead::SetAndSave(::sw::UndoRedoContext & rContext) if( RES_MIRROR_GRAPH_DONT != nOldMirr ) pGrfNd->SetAttr( SwMirrorGrf() ); - rContext.SetSelections(pGrfNd->GetFlyFmt(), 0); + rContext.SetSelections(pGrfNd->GetFlyFormat(), 0); } void SwUndoReRead::UndoImpl(::sw::UndoRedoContext & rContext) @@ -858,7 +858,7 @@ void SwUndoReRead::SaveGraphicData( const SwGrfNode& rGrfNd ) } SwUndoInsertLabel::SwUndoInsertLabel( const SwLabelType eTyp, - const OUString &rTxt, + const OUString &rText, const OUString& rSeparator, const OUString& rNumberSeparator, const bool bBef, @@ -866,11 +866,11 @@ SwUndoInsertLabel::SwUndoInsertLabel( const SwLabelType eTyp, const OUString& rCharacterStyle, const bool bCpyBorder ) : SwUndo( UNDO_INSERTLABEL ), - sText( rTxt ), + sText( rText ), sSeparator( rSeparator ), sNumberSeparator( rNumberSeparator ),//#i61007# order of captions sCharacterStyle( rCharacterStyle ), - nFldId( nInitId ), + nFieldId( nInitId ), eType( eTyp ), nLayerId( 0 ), bBefore( bBef ), @@ -899,12 +899,12 @@ void SwUndoInsertLabel::UndoImpl(::sw::UndoRedoContext & rContext) if( LTYPE_OBJECT == eType || LTYPE_DRAW == eType ) { OSL_ENSURE( OBJECT.pUndoAttr && OBJECT.pUndoFly, "Pointer not initialized" ); - SwFrmFmt* pFmt; + SwFrameFormat* pFormat; SdrObject *pSdrObj = 0; if( OBJECT.pUndoAttr && - 0 != (pFmt = static_cast<SwFrmFmt*>(OBJECT.pUndoAttr->GetFmt( rDoc ))) && + 0 != (pFormat = static_cast<SwFrameFormat*>(OBJECT.pUndoAttr->GetFormat( rDoc ))) && ( LTYPE_DRAW != eType || - 0 != (pSdrObj = pFmt->FindSdrObject()) ) ) + 0 != (pSdrObj = pFormat->FindSdrObject()) ) ) { OBJECT.pUndoAttr->UndoImpl(rContext); OBJECT.pUndoFly->UndoImpl(rContext); @@ -921,7 +921,7 @@ void SwUndoInsertLabel::UndoImpl(::sw::UndoRedoContext & rContext) SwTableNode *pNd = rDoc.GetNodes()[ rDoc.GetNodes()[NODE.nNode-1]->StartOfSectionIndex()]->GetTableNode(); if ( pNd ) - pNd->GetTable().GetFrmFmt()->ResetFmtAttr( RES_KEEP ); + pNd->GetTable().GetFrameFormat()->ResetFormatAttr( RES_KEEP ); } SwPaM aPam( rDoc.GetNodes().GetEndOfContent() ); aPam.GetPoint()->nNode = NODE.nNode; @@ -938,12 +938,12 @@ void SwUndoInsertLabel::RedoImpl(::sw::UndoRedoContext & rContext) if( LTYPE_OBJECT == eType || LTYPE_DRAW == eType ) { OSL_ENSURE( OBJECT.pUndoAttr && OBJECT.pUndoFly, "Pointer not initialized" ); - SwFrmFmt* pFmt; + SwFrameFormat* pFormat; SdrObject *pSdrObj = 0; if( OBJECT.pUndoAttr && - 0 != (pFmt = static_cast<SwFrmFmt*>(OBJECT.pUndoAttr->GetFmt( rDoc ))) && + 0 != (pFormat = static_cast<SwFrameFormat*>(OBJECT.pUndoAttr->GetFormat( rDoc ))) && ( LTYPE_DRAW != eType || - 0 != (pSdrObj = pFmt->FindSdrObject()) ) ) + 0 != (pSdrObj = pFormat->FindSdrObject()) ) ) { OBJECT.pUndoFly->RedoImpl(rContext); OBJECT.pUndoAttr->RedoImpl(rContext); @@ -965,7 +965,7 @@ void SwUndoInsertLabel::RedoImpl(::sw::UndoRedoContext & rContext) SwTableNode *pNd = rDoc.GetNodes()[ rDoc.GetNodes()[NODE.nNode-1]->StartOfSectionIndex()]->GetTableNode(); if ( pNd ) - pNd->GetTable().GetFrmFmt()->SetFmtAttr( SvxFmtKeepItem(true, RES_KEEP) ); + pNd->GetTable().GetFrameFormat()->SetFormatAttr( SvxFormatKeepItem(true, RES_KEEP) ); } NODE.pUndoInsNd->UndoImpl(rContext); delete NODE.pUndoInsNd, NODE.pUndoInsNd = 0; @@ -979,7 +979,7 @@ void SwUndoInsertLabel::RepeatImpl(::sw::RepeatContext & rContext) sal_uLong nIdx = 0; - SwCntntNode* pCNd = rPos.nNode.GetNode().GetCntntNode(); + SwContentNode* pCNd = rPos.nNode.GetNode().GetContentNode(); if( pCNd ) switch( eType ) { @@ -995,9 +995,9 @@ void SwUndoInsertLabel::RepeatImpl(::sw::RepeatContext & rContext) case LTYPE_OBJECT: { SwFlyFrm* pFly; - SwCntntFrm *pCnt = pCNd->getLayoutFrm( rDoc.getIDocumentLayoutAccess().GetCurrentLayout() ); + SwContentFrm *pCnt = pCNd->getLayoutFrm( rDoc.getIDocumentLayoutAccess().GetCurrentLayout() ); if( pCnt && 0 != ( pFly = pCnt->FindFlyFrm() ) ) - nIdx = pFly->GetFmt()->GetCntnt().GetCntntIdx()->GetIndex(); + nIdx = pFly->GetFormat()->GetContent().GetContentIdx()->GetIndex(); } break; case LTYPE_DRAW: @@ -1007,7 +1007,7 @@ void SwUndoInsertLabel::RepeatImpl(::sw::RepeatContext & rContext) if( nIdx ) { rDoc.InsertLabel( eType, sText, sSeparator, sNumberSeparator, bBefore, - nFldId, nIdx, sCharacterStyle, bCpyBrd ); + nFieldId, nIdx, sCharacterStyle, bCpyBrd ); } } @@ -1028,18 +1028,18 @@ SwRewriter SwUndoInsertLabel::GetRewriter() const return aRewriter; } -void SwUndoInsertLabel::SetFlys( SwFrmFmt& rOldFly, SfxItemSet& rChgSet, - SwFrmFmt& rNewFly ) +void SwUndoInsertLabel::SetFlys( SwFrameFormat& rOldFly, SfxItemSet& rChgSet, + SwFrameFormat& rNewFly ) { if( LTYPE_OBJECT == eType || LTYPE_DRAW == eType ) { - SwUndoFmtAttrHelper aTmp( rOldFly, false ); - rOldFly.SetFmtAttr( rChgSet ); + SwUndoFormatAttrHelper aTmp( rOldFly, false ); + rOldFly.SetFormatAttr( rChgSet ); if ( aTmp.GetUndo() ) { OBJECT.pUndoAttr = aTmp.ReleaseUndo(); } - OBJECT.pUndoFly = new SwUndoInsLayFmt( &rNewFly,0,0 ); + OBJECT.pUndoFly = new SwUndoInsLayFormat( &rNewFly,0,0 ); } } diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx index b6b09af1d0b7..aef019ead43a 100644 --- a/sw/source/core/undo/unmove.cxx +++ b/sw/source/core/undo/unmove.cxx @@ -34,10 +34,10 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos ) , nDestEndNode(0) , nInsPosNode(0) , nMvDestNode(rMvPos.nNode.GetIndex()) - , nDestSttCntnt(0) - , nDestEndCntnt(0) - , nInsPosCntnt(0) - , nMvDestCntnt(rMvPos.nContent.GetIndex()) + , nDestSttContent(0) + , nDestEndContent(0) + , nInsPosContent(0) + , nMvDestContent(rMvPos.nContent.GetIndex()) , bJoinNext(false) , bJoinPrev(false) , bMoveRange(false) @@ -45,49 +45,49 @@ SwUndoMove::SwUndoMove( const SwPaM& rRange, const SwPosition& rMvPos ) { // get StartNode from footnotes before delete! SwDoc* pDoc = rRange.GetDoc(); - SwTxtNode* pTxtNd = pDoc->GetNodes()[ nSttNode ]->GetTxtNode(); - SwTxtNode* pEndTxtNd = pDoc->GetNodes()[ nEndNode ]->GetTxtNode(); + SwTextNode* pTextNd = pDoc->GetNodes()[ nSttNode ]->GetTextNode(); + SwTextNode* pEndTextNd = pDoc->GetNodes()[ nEndNode ]->GetTextNode(); pHistory = new SwHistory; - if( pTxtNd ) + if( pTextNd ) { - pHistory->Add( pTxtNd->GetTxtColl(), nSttNode, ND_TEXTNODE ); - if ( pTxtNd->GetpSwpHints() ) + pHistory->Add( pTextNd->GetTextColl(), nSttNode, ND_TEXTNODE ); + if ( pTextNd->GetpSwpHints() ) { - pHistory->CopyAttr( pTxtNd->GetpSwpHints(), nSttNode, - 0, pTxtNd->GetTxt().getLength(), false ); + pHistory->CopyAttr( pTextNd->GetpSwpHints(), nSttNode, + 0, pTextNd->GetText().getLength(), false ); } - if( pTxtNd->HasSwAttrSet() ) - pHistory->CopyFmtAttr( *pTxtNd->GetpSwAttrSet(), nSttNode ); + if( pTextNd->HasSwAttrSet() ) + pHistory->CopyFormatAttr( *pTextNd->GetpSwAttrSet(), nSttNode ); } - if( pEndTxtNd && pEndTxtNd != pTxtNd ) + if( pEndTextNd && pEndTextNd != pTextNd ) { - pHistory->Add( pEndTxtNd->GetTxtColl(), nEndNode, ND_TEXTNODE ); - if ( pEndTxtNd->GetpSwpHints() ) + pHistory->Add( pEndTextNd->GetTextColl(), nEndNode, ND_TEXTNODE ); + if ( pEndTextNd->GetpSwpHints() ) { - pHistory->CopyAttr( pEndTxtNd->GetpSwpHints(), nEndNode, - 0, pEndTxtNd->GetTxt().getLength(), false ); + pHistory->CopyAttr( pEndTextNd->GetpSwpHints(), nEndNode, + 0, pEndTextNd->GetText().getLength(), false ); } - if( pEndTxtNd->HasSwAttrSet() ) - pHistory->CopyFmtAttr( *pEndTxtNd->GetpSwAttrSet(), nEndNode ); + if( pEndTextNd->HasSwAttrSet() ) + pHistory->CopyFormatAttr( *pEndTextNd->GetpSwAttrSet(), nEndNode ); } - pTxtNd = rMvPos.nNode.GetNode().GetTxtNode(); - if (0 != pTxtNd) + pTextNd = rMvPos.nNode.GetNode().GetTextNode(); + if (0 != pTextNd) { - pHistory->Add( pTxtNd->GetTxtColl(), nMvDestNode, ND_TEXTNODE ); - if ( pTxtNd->GetpSwpHints() ) + pHistory->Add( pTextNd->GetTextColl(), nMvDestNode, ND_TEXTNODE ); + if ( pTextNd->GetpSwpHints() ) { - pHistory->CopyAttr( pTxtNd->GetpSwpHints(), nMvDestNode, - 0, pTxtNd->GetTxt().getLength(), false ); + pHistory->CopyAttr( pTextNd->GetpSwpHints(), nMvDestNode, + 0, pTextNd->GetText().getLength(), false ); } - if( pTxtNd->HasSwAttrSet() ) - pHistory->CopyFmtAttr( *pTxtNd->GetpSwAttrSet(), nMvDestNode ); + if( pTextNd->HasSwAttrSet() ) + pHistory->CopyFormatAttr( *pTextNd->GetpSwAttrSet(), nMvDestNode ); } - nFtnStt = pHistory->Count(); - DelFtn( rRange ); + nFootnoteStt = pHistory->Count(); + DelFootnote( rRange ); if( pHistory && !pHistory->Count() ) DELETEZ( pHistory ); @@ -100,42 +100,42 @@ SwUndoMove::SwUndoMove( SwDoc* pDoc, const SwNodeRange& rRg, , nDestEndNode(0) , nInsPosNode(0) , nMvDestNode(rMvPos.GetIndex()) - , nDestSttCntnt(0) - , nDestEndCntnt(0) - , nInsPosCntnt(0) + , nDestSttContent(0) + , nDestEndContent(0) + , nInsPosContent(0) , bMoveRedlines(false) { bMoveRange = true; bJoinNext = bJoinPrev = false; - nSttCntnt = nEndCntnt = nMvDestCntnt = COMPLETE_STRING; + nSttContent = nEndContent = nMvDestContent = COMPLETE_STRING; nSttNode = rRg.aStart.GetIndex(); nEndNode = rRg.aEnd.GetIndex(); -// DelFtn( rRange ); -// FIXME: duplication of the method body of DelFtn below +// DelFootnote( rRange ); +// FIXME: duplication of the method body of DelFootnote below - // is the current move from CntntArea into the special section? - sal_uLong nCntntStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex(); - if( nMvDestNode < nCntntStt && rRg.aStart.GetIndex() > nCntntStt ) + // is the current move from ContentArea into the special section? + sal_uLong nContentStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex(); + if( nMvDestNode < nContentStt && rRg.aStart.GetIndex() > nContentStt ) { // delete all footnotes since they are undesired there SwPosition aPtPos( rRg.aEnd ); - SwCntntNode* pCNd = rRg.aEnd.GetNode().GetCntntNode(); + SwContentNode* pCNd = rRg.aEnd.GetNode().GetContentNode(); if( pCNd ) aPtPos.nContent.Assign( pCNd, pCNd->Len() ); SwPosition aMkPos( rRg.aStart ); - if( 0 != ( pCNd = aMkPos.nNode.GetNode().GetCntntNode() )) + if( 0 != ( pCNd = aMkPos.nNode.GetNode().GetContentNode() )) aMkPos.nContent.Assign( pCNd, 0 ); - DelCntntIndex( aMkPos, aPtPos, nsDelCntntType::DELCNT_FTN ); + DelContentIndex( aMkPos, aPtPos, nsDelContentType::DELCNT_FTN ); if( pHistory && !pHistory->Count() ) DELETEZ( pHistory ); } - nFtnStt = 0; + nFootnoteStt = 0; } void SwUndoMove::SetDestRange( const SwPaM& rRange, @@ -148,12 +148,12 @@ void SwUndoMove::SetDestRange( const SwPaM& rRange, : rRange.GetPoint(); nDestSttNode = pStt->nNode.GetIndex(); - nDestSttCntnt = pStt->nContent.GetIndex(); + nDestSttContent = pStt->nContent.GetIndex(); nDestEndNode = pEnd->nNode.GetIndex(); - nDestEndCntnt = pEnd->nContent.GetIndex(); + nDestEndContent = pEnd->nContent.GetIndex(); nInsPosNode = rInsPos.nNode.GetIndex(); - nInsPosCntnt = rInsPos.nContent.GetIndex(); + nInsPosContent = rInsPos.nContent.GetIndex(); if( bCorrPam ) { @@ -162,8 +162,8 @@ void SwUndoMove::SetDestRange( const SwPaM& rRange, } bJoinNext = nDestSttNode != nDestEndNode && - pStt->nNode.GetNode().GetTxtNode() && - pEnd->nNode.GetNode().GetTxtNode(); + pStt->nNode.GetNode().GetTextNode() && + pEnd->nNode.GetNode().GetTextNode(); bJoinPrev = bJoin; } @@ -180,7 +180,7 @@ void SwUndoMove::SetDestRange( const SwNodeIndex& rStt, } nInsPosNode = rInsPos.GetIndex(); - nDestSttCntnt = nDestEndCntnt = nInsPosCntnt = COMPLETE_STRING; + nDestSttContent = nDestEndContent = nInsPosContent = COMPLETE_STRING; } void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext) @@ -205,8 +205,8 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext) } else { - SwPaM aPam( aIdx.GetNode(), nDestSttCntnt, - *pDoc->GetNodes()[ nDestEndNode ], nDestEndCntnt ); + SwPaM aPam( aIdx.GetNode(), nDestSttContent, + *pDoc->GetNodes()[ nDestEndNode ], nDestEndContent ); // #i17764# if redlines are to be moved, we may not remove them // before pDoc->Move gets a chance to handle them @@ -214,14 +214,14 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext) RemoveIdxFromRange( aPam, false ); SwPosition aPos( *pDoc->GetNodes()[ nInsPosNode] ); - SwCntntNode* pCNd = aPos.nNode.GetNode().GetCntntNode(); - aPos.nContent.Assign( pCNd, nInsPosCntnt ); + SwContentNode* pCNd = aPos.nNode.GetNode().GetContentNode(); + aPos.nContent.Assign( pCNd, nInsPosContent ); if( pCNd->HasSwAttrSet() ) pCNd->ResetAllAttr(); - if( pCNd->IsTxtNode() && static_cast<SwTxtNode*>(pCNd)->GetpSwpHints() ) - static_cast<SwTxtNode*>(pCNd)->ClearSwpHintsArr( false ); + if( pCNd->IsTextNode() && static_cast<SwTextNode*>(pCNd)->GetpSwpHints() ) + static_cast<SwTextNode*>(pCNd)->ClearSwpHintsArr( false ); // first delete all attributes at InsertPos const bool bSuccess = pDoc->getIDocumentContentOperations().MoveRange( aPam, aPos, (bMoveRedlines) @@ -232,39 +232,39 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext) aPam.Exchange(); aPam.DeleteMark(); - if( aPam.GetNode().IsCntntNode() ) - aPam.GetNode().GetCntntNode()->ResetAllAttr(); + if( aPam.GetNode().IsContentNode() ) + aPam.GetNode().GetContentNode()->ResetAllAttr(); // the Pam will be dropped now } - SwTxtNode* pTxtNd = aIdx.GetNode().GetTxtNode(); + SwTextNode* pTextNd = aIdx.GetNode().GetTextNode(); if( bJoinNext ) { { RemoveIdxRel( aIdx.GetIndex() + 1, SwPosition( aIdx, - SwIndex(pTxtNd, pTxtNd->GetTxt().getLength()))); + SwIndex(pTextNd, pTextNd->GetText().getLength()))); } // Are there any Pams in the next TextNode? - pTxtNd->JoinNext(); + pTextNd->JoinNext(); } - if( bJoinPrev && pTxtNd->CanJoinPrev( &aIdx ) ) + if( bJoinPrev && pTextNd->CanJoinPrev( &aIdx ) ) { // Are there any Pams in the next TextNode? - pTxtNd = aIdx.GetNode().GetTxtNode(); + pTextNd = aIdx.GetNode().GetTextNode(); { RemoveIdxRel( aIdx.GetIndex() + 1, SwPosition( aIdx, - SwIndex( pTxtNd, pTxtNd->GetTxt().getLength()))); + SwIndex( pTextNd, pTextNd->GetText().getLength()))); } - pTxtNd->JoinNext(); + pTextNd->JoinNext(); } } while( false ); if( pHistory ) { - if( nFtnStt != pHistory->Count() ) - pHistory->Rollback( pDoc, nFtnStt ); + if( nFootnoteStt != pHistory->Count() ) + pHistory->Rollback( pDoc, nFootnoteStt ); pHistory->TmpRollback( pDoc, 0 ); pHistory->SetTmpEnd( pHistory->Count() ); } @@ -296,30 +296,30 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext) { SwPaM aPam( *pPam->GetPoint() ); SetPaM( aPam ); - SwPosition aMvPos( aIdx, SwIndex( aIdx.GetNode().GetCntntNode(), - nMvDestCntnt )); + SwPosition aMvPos( aIdx, SwIndex( aIdx.GetNode().GetContentNode(), + nMvDestContent )); - DelFtn( aPam ); + DelFootnote( aPam ); RemoveIdxFromRange( aPam, false ); aIdx = aPam.Start()->nNode; - bool bJoinTxt = aIdx.GetNode().IsTxtNode(); + bool bJoinText = aIdx.GetNode().IsTextNode(); --aIdx; rDoc.getIDocumentContentOperations().MoveRange( aPam, aMvPos, SwMoveFlags::DEFAULT ); - if( nSttNode != nEndNode && bJoinTxt ) + if( nSttNode != nEndNode && bJoinText ) { ++aIdx; - SwTxtNode * pTxtNd = aIdx.GetNode().GetTxtNode(); - if( pTxtNd && pTxtNd->CanJoinNext() ) + SwTextNode * pTextNd = aIdx.GetNode().GetTextNode(); + if( pTextNd && pTextNd->CanJoinNext() ) { { RemoveIdxRel( aIdx.GetIndex() + 1, SwPosition( aIdx, - SwIndex(pTxtNd, pTxtNd->GetTxt().getLength()))); + SwIndex(pTextNd, pTextNd->GetText().getLength()))); } - pTxtNd->JoinNext(); + pTextNd->JoinNext(); } } *pPam->GetPoint() = *aPam.GetPoint(); @@ -328,17 +328,17 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext) } } -void SwUndoMove::DelFtn( const SwPaM& rRange ) +void SwUndoMove::DelFootnote( const SwPaM& rRange ) { - // is the current move from CntntArea into the special section? + // is the current move from ContentArea into the special section? SwDoc* pDoc = rRange.GetDoc(); - sal_uLong nCntntStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex(); - if( nMvDestNode < nCntntStt && - rRange.GetPoint()->nNode.GetIndex() >= nCntntStt ) + sal_uLong nContentStt = pDoc->GetNodes().GetEndOfAutotext().GetIndex(); + if( nMvDestNode < nContentStt && + rRange.GetPoint()->nNode.GetIndex() >= nContentStt ) { // delete all footnotes since they are undesired there - DelCntntIndex( *rRange.GetMark(), *rRange.GetPoint(), - nsDelCntntType::DELCNT_FTN ); + DelContentIndex( *rRange.GetMark(), *rRange.GetPoint(), + nsDelContentType::DELCNT_FTN ); if( pHistory && !pHistory->Count() ) delete pHistory, pHistory = 0; diff --git a/sw/source/core/undo/unnum.cxx b/sw/source/core/undo/unnum.cxx index 27456c98a9ee..99431193a923 100644 --- a/sw/source/core/undo/unnum.cxx +++ b/sw/source/core/undo/unnum.cxx @@ -52,9 +52,9 @@ SwUndoInsNum::SwUndoInsNum( const SwPosition& rPos, const SwNumRule& rRule, sReplaceRule( rReplaceRule ), nLRSavePos( 0 ) { // No selection! - nEndNode = 0, nEndCntnt = COMPLETE_STRING; + nEndNode = 0, nEndContent = COMPLETE_STRING; nSttNode = rPos.nNode.GetIndex(); - nSttCntnt = rPos.nContent.GetIndex(); + nSttContent = rPos.nContent.GetIndex(); } SwUndoInsNum::~SwUndoInsNum() @@ -76,13 +76,13 @@ void SwUndoInsNum::UndoImpl(::sw::UndoRedoContext & rContext) SwDoc & rDoc = rContext.GetDoc(); if( pOldNumRule ) - rDoc.ChgNumRuleFmts( *pOldNumRule ); + rDoc.ChgNumRuleFormats( *pOldNumRule ); if( pHistory ) { - SwTxtNode* pNd; + SwTextNode* pNd; if( ULONG_MAX != nSttSet && - 0 != ( pNd = rDoc.GetNodes()[ nSttSet ]->GetTxtNode() )) + 0 != ( pNd = rDoc.GetNodes()[ nSttSet ]->GetTextNode() )) pNd->SetListRestart( true ); else pNd = 0; @@ -108,7 +108,7 @@ void SwUndoInsNum::RedoImpl(::sw::UndoRedoContext & rContext) SwDoc & rDoc = rContext.GetDoc(); if ( pOldNumRule ) - rDoc.ChgNumRuleFmts( aNumRule ); + rDoc.ChgNumRuleFormats( aNumRule ); else if ( pHistory ) { SwPaM & rPam( AddUndoRedoPaM(rContext) ); @@ -143,7 +143,7 @@ void SwUndoInsNum::RepeatImpl(::sw::RepeatContext & rContext) } else { - rDoc.ChgNumRuleFmts( aNumRule ); + rDoc.ChgNumRuleFormats( aNumRule ); } } @@ -181,11 +181,11 @@ void SwUndoDelNum::UndoImpl(::sw::UndoRedoContext & rContext) for( std::vector<NodeLevel>::const_iterator i = aNodes.begin(); i != aNodes.end(); ++i ) { - SwTxtNode* pNd = rDoc.GetNodes()[ i->index ]->GetTxtNode(); + SwTextNode* pNd = rDoc.GetNodes()[ i->index ]->GetTextNode(); OSL_ENSURE( pNd, "Where has the TextNode gone?" ); pNd->SetAttrListLevel( i->level ); - if( pNd->GetCondFmtColl() ) + if( pNd->GetCondFormatColl() ) pNd->ChkCondColl(); } @@ -203,7 +203,7 @@ void SwUndoDelNum::RepeatImpl(::sw::RepeatContext & rContext) rContext.GetDoc().DelNumRules(rContext.GetRepeatPaM()); } -void SwUndoDelNum::AddNode( const SwTxtNode& rNd, bool ) +void SwUndoDelNum::AddNode( const SwTextNode& rNd, bool ) { if( rNd.GetNumRule() ) { @@ -224,7 +224,7 @@ void SwUndoMoveNum::UndoImpl(::sw::UndoRedoContext & rContext) { sal_uLong nTmpStt = nSttNode, nTmpEnd = nEndNode; - if (nEndNode || nEndCntnt != COMPLETE_STRING) // section? + if (nEndNode || nEndContent != COMPLETE_STRING) // section? { if( nNewStt < nSttNode ) // moved forwards nEndNode = nEndNode - ( nSttNode - nNewStt ); @@ -297,11 +297,11 @@ SwUndoNumOrNoNum::SwUndoNumOrNoNum( const SwNodeIndex& rIdx, bool bOldNum, void SwUndoNumOrNoNum::UndoImpl(::sw::UndoRedoContext & rContext) { SwNodeIndex aIdx( rContext.GetDoc().GetNodes(), nIdx ); - SwTxtNode * pTxtNd = aIdx.GetNode().GetTxtNode(); + SwTextNode * pTextNd = aIdx.GetNode().GetTextNode(); - if (NULL != pTxtNd) + if (NULL != pTextNd) { - pTxtNd->SetCountedInList(mbOldNum); + pTextNd->SetCountedInList(mbOldNum); } } @@ -309,11 +309,11 @@ void SwUndoNumOrNoNum::UndoImpl(::sw::UndoRedoContext & rContext) void SwUndoNumOrNoNum::RedoImpl(::sw::UndoRedoContext & rContext) { SwNodeIndex aIdx( rContext.GetDoc().GetNodes(), nIdx ); - SwTxtNode * pTxtNd = aIdx.GetNode().GetTxtNode(); + SwTextNode * pTextNd = aIdx.GetNode().GetTextNode(); - if (NULL != pTxtNd) + if (NULL != pTextNd) { - pTxtNd->SetCountedInList(mbNewNum); + pTextNd->SetCountedInList(mbNewNum); } } @@ -346,12 +346,12 @@ SwUndoNumRuleStart::SwUndoNumRuleStart( const SwPosition& rPos, sal_uInt16 nStt , bSetSttValue(true) , bFlag(false) { - SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode(); - if ( pTxtNd ) + SwTextNode* pTextNd = rPos.nNode.GetNode().GetTextNode(); + if ( pTextNd ) { - if ( pTxtNd->HasAttrListRestartValue() ) + if ( pTextNd->HasAttrListRestartValue() ) { - nOldStt = static_cast<sal_uInt16>(pTxtNd->GetAttrListRestartValue()); + nOldStt = static_cast<sal_uInt16>(pTextNd->GetAttrListRestartValue()); } else { diff --git a/sw/source/core/undo/unovwr.cxx b/sw/source/core/undo/unovwr.cxx index 4ae473cf2126..c555cb082ca7 100644 --- a/sw/source/core/undo/unovwr.cxx +++ b/sw/source/core/undo/unovwr.cxx @@ -45,7 +45,7 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos, : SwUndo(UNDO_OVERWRITE), pRedlSaveData( 0 ), bGroup( false ) { - if( !pDoc->getIDocumentRedlineAccess().IsIgnoreRedline() && !pDoc->getIDocumentRedlineAccess().GetRedlineTbl().empty() ) + if( !pDoc->getIDocumentRedlineAccess().IsIgnoreRedline() && !pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() ) { SwPaM aPam( rPos.nNode, rPos.nContent.GetIndex(), rPos.nNode, rPos.nContent.GetIndex()+1 ); @@ -55,38 +55,38 @@ SwUndoOverwrite::SwUndoOverwrite( SwDoc* pDoc, SwPosition& rPos, } nSttNode = rPos.nNode.GetIndex(); - nSttCntnt = rPos.nContent.GetIndex(); + nSttContent = rPos.nContent.GetIndex(); - SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode(); - OSL_ENSURE( pTxtNd, "Overwrite not in a TextNode?" ); + SwTextNode* pTextNd = rPos.nNode.GetNode().GetTextNode(); + OSL_ENSURE( pTextNd, "Overwrite not in a TextNode?" ); bInsChar = true; - sal_Int32 nTxtNdLen = pTxtNd->GetTxt().getLength(); - if( nSttCntnt < nTxtNdLen ) // no pure insert? + sal_Int32 nTextNdLen = pTextNd->GetText().getLength(); + if( nSttContent < nTextNdLen ) // no pure insert? { - aDelStr += OUString( pTxtNd->GetTxt()[nSttCntnt] ); + aDelStr += OUString( pTextNd->GetText()[nSttContent] ); if( !pHistory ) pHistory = new SwHistory; - SwRegHistory aRHst( *pTxtNd, pHistory ); - pHistory->CopyAttr( pTxtNd->GetpSwpHints(), nSttNode, 0, - nTxtNdLen, false ); + SwRegHistory aRHst( *pTextNd, pHistory ); + pHistory->CopyAttr( pTextNd->GetpSwpHints(), nSttNode, 0, + nTextNdLen, false ); ++rPos.nContent; bInsChar = false; } - bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); - pTxtNd->SetIgnoreDontExpand( true ); + bool bOldExpFlg = pTextNd->IsIgnoreDontExpand(); + pTextNd->SetIgnoreDontExpand( true ); - pTxtNd->InsertText( OUString(cIns), rPos.nContent, + pTextNd->InsertText( OUString(cIns), rPos.nContent, SwInsertFlags::EMPTYEXPAND ); aInsStr += OUString( cIns ); if( !bInsChar ) { const SwIndex aTmpIndex( rPos.nContent, -2 ); - pTxtNd->EraseText( aTmpIndex, 1 ); + pTextNd->EraseText( aTmpIndex, 1 ); } - pTxtNd->SetIgnoreDontExpand( bOldExpFlg ); + pTextNd->SetIgnoreDontExpand( bOldExpFlg ); bCacheComment = false; } @@ -107,10 +107,10 @@ bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos, return false; // Is the node a TextNode at all? - SwTxtNode * pDelTxtNd = rPos.nNode.GetNode().GetTxtNode(); - if( !pDelTxtNd || - (pDelTxtNd->GetTxt().getLength() != rPos.nContent.GetIndex() && - rPos.nContent.GetIndex() != ( nSttCntnt + aInsStr.getLength() ))) + SwTextNode * pDelTextNd = rPos.nNode.GetNode().GetTextNode(); + if( !pDelTextNd || + (pDelTextNd->GetText().getLength() != rPos.nContent.GetIndex() && + rPos.nContent.GetIndex() != ( nSttContent + aInsStr.getLength() ))) return false; CharClass& rCC = GetAppCharClass(); @@ -131,7 +131,7 @@ bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos, bool bOk = ( !pRedlSaveData && !bSaved ) || ( pRedlSaveData && bSaved && SwUndo::CanRedlineGroup( *pRedlSaveData, aTmpSav, - nSttCntnt > rPos.nContent.GetIndex() )); + nSttContent > rPos.nContent.GetIndex() )); // aTmpSav.DeleteAndDestroyAll(); if( !bOk ) return false; @@ -142,19 +142,19 @@ bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos, // both 'overwrites' can be combined so 'move' the corresponding character if( !bInsChar ) { - if (rPos.nContent.GetIndex() < pDelTxtNd->GetTxt().getLength()) + if (rPos.nContent.GetIndex() < pDelTextNd->GetText().getLength()) { - aDelStr += OUString( pDelTxtNd->GetTxt()[rPos.nContent.GetIndex()] ); + aDelStr += OUString( pDelTextNd->GetText()[rPos.nContent.GetIndex()] ); ++rPos.nContent; } else bInsChar = true; } - bool bOldExpFlg = pDelTxtNd->IsIgnoreDontExpand(); - pDelTxtNd->SetIgnoreDontExpand( true ); + bool bOldExpFlg = pDelTextNd->IsIgnoreDontExpand(); + pDelTextNd->SetIgnoreDontExpand( true ); - OUString const ins( pDelTxtNd->InsertText(OUString(cIns), rPos.nContent, + OUString const ins( pDelTextNd->InsertText(OUString(cIns), rPos.nContent, SwInsertFlags::EMPTYEXPAND) ); assert(ins.getLength() == 1); // check in SwDoc::Overwrite => cannot fail (void) ins; @@ -163,9 +163,9 @@ bool SwUndoOverwrite::CanGrouping( SwDoc* pDoc, SwPosition& rPos, if( !bInsChar ) { const SwIndex aTmpIndex( rPos.nContent, -2 ); - pDelTxtNd->EraseText( aTmpIndex, 1 ); + pDelTextNd->EraseText( aTmpIndex, 1 ); } - pDelTxtNd->SetIgnoreDontExpand( bOldExpFlg ); + pDelTextNd->SetIgnoreDontExpand( bOldExpFlg ); bGroup = true; return true; @@ -178,10 +178,10 @@ void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext) pAktPam->DeleteMark(); pAktPam->GetPoint()->nNode = nSttNode; - SwTxtNode* pTxtNd = pAktPam->GetNode().GetTxtNode(); - OSL_ENSURE( pTxtNd, "Overwrite not in a TextNode?" ); + SwTextNode* pTextNd = pAktPam->GetNode().GetTextNode(); + OSL_ENSURE( pTextNd, "Overwrite not in a TextNode?" ); SwIndex& rIdx = pAktPam->GetPoint()->nContent; - rIdx.Assign( pTxtNd, nSttCntnt ); + rIdx.Assign( pTextNd, nSttContent ); SwAutoCorrExceptWord* pACEWord = pDoc->GetAutoCorrExceptWord(); if( pACEWord ) @@ -195,42 +195,42 @@ void SwUndoOverwrite::UndoImpl(::sw::UndoRedoContext & rContext) if( aInsStr.getLength() > aDelStr.getLength() ) { rIdx += aDelStr.getLength(); - pTxtNd->EraseText( rIdx, aInsStr.getLength() - aDelStr.getLength() ); - rIdx = nSttCntnt; + pTextNd->EraseText( rIdx, aInsStr.getLength() - aDelStr.getLength() ); + rIdx = nSttContent; } if( !aDelStr.isEmpty() ) { - bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); - pTxtNd->SetIgnoreDontExpand( true ); + bool bOldExpFlg = pTextNd->IsIgnoreDontExpand(); + pTextNd->SetIgnoreDontExpand( true ); ++rIdx; for( sal_Int32 n = 0; n < aDelStr.getLength(); n++ ) { // do it individually, to keep the attributes! OUString aTmpStr(aDelStr[n]); - OUString const ins( pTxtNd->InsertText(aTmpStr, rIdx) ); + OUString const ins( pTextNd->InsertText(aTmpStr, rIdx) ); assert(ins.getLength() == 1); // cannot fail (void) ins; rIdx -= 2; - pTxtNd->EraseText( rIdx, 1 ); + pTextNd->EraseText( rIdx, 1 ); rIdx += 2; } - pTxtNd->SetIgnoreDontExpand( bOldExpFlg ); + pTextNd->SetIgnoreDontExpand( bOldExpFlg ); --rIdx; } if( pHistory ) { - if( pTxtNd->GetpSwpHints() ) - pTxtNd->ClearSwpHintsArr( false ); + if( pTextNd->GetpSwpHints() ) + pTextNd->ClearSwpHintsArr( false ); pHistory->TmpRollback( pDoc, 0, false ); } - if( pAktPam->GetMark()->nContent.GetIndex() != nSttCntnt ) + if( pAktPam->GetMark()->nContent.GetIndex() != nSttContent ) { pAktPam->SetMark(); - pAktPam->GetMark()->nContent = nSttCntnt; + pAktPam->GetMark()->nContent = nSttContent; } if( pRedlSaveData ) @@ -260,47 +260,47 @@ void SwUndoOverwrite::RedoImpl(::sw::UndoRedoContext & rContext) pAktPam->DeleteMark(); pAktPam->GetPoint()->nNode = nSttNode; - SwTxtNode* pTxtNd = pAktPam->GetNode().GetTxtNode(); - OSL_ENSURE( pTxtNd, "Overwrite not in TextNode?" ); + SwTextNode* pTextNd = pAktPam->GetNode().GetTextNode(); + OSL_ENSURE( pTextNd, "Overwrite not in TextNode?" ); SwIndex& rIdx = pAktPam->GetPoint()->nContent; if( pRedlSaveData ) { - rIdx.Assign( pTxtNd, nSttCntnt ); + rIdx.Assign( pTextNd, nSttContent ); pAktPam->SetMark(); pAktPam->GetMark()->nContent += aInsStr.getLength(); pDoc->getIDocumentRedlineAccess().DeleteRedline( *pAktPam, false, USHRT_MAX ); pAktPam->DeleteMark(); } - rIdx.Assign( pTxtNd, !aDelStr.isEmpty() ? nSttCntnt+1 : nSttCntnt ); + rIdx.Assign( pTextNd, !aDelStr.isEmpty() ? nSttContent+1 : nSttContent ); - bool bOldExpFlg = pTxtNd->IsIgnoreDontExpand(); - pTxtNd->SetIgnoreDontExpand( true ); + bool bOldExpFlg = pTextNd->IsIgnoreDontExpand(); + pTextNd->SetIgnoreDontExpand( true ); for( sal_Int32 n = 0; n < aInsStr.getLength(); n++ ) { // do it individually, to keep the attributes! OUString const ins( - pTxtNd->InsertText( OUString(aInsStr[n]), rIdx, + pTextNd->InsertText( OUString(aInsStr[n]), rIdx, SwInsertFlags::EMPTYEXPAND) ); assert(ins.getLength() == 1); // cannot fail (void) ins; if( n < aDelStr.getLength() ) { rIdx -= 2; - pTxtNd->EraseText( rIdx, 1 ); + pTextNd->EraseText( rIdx, 1 ); rIdx += n+1 < aDelStr.getLength() ? 2 : 1; } } - pTxtNd->SetIgnoreDontExpand( bOldExpFlg ); + pTextNd->SetIgnoreDontExpand( bOldExpFlg ); // get back old start position from UndoNodes array if( pHistory ) pHistory->SetTmpEnd( pHistory->Count() ); - if( pAktPam->GetMark()->nContent.GetIndex() != nSttCntnt ) + if( pAktPam->GetMark()->nContent.GetIndex() != nSttContent ) { pAktPam->SetMark(); - pAktPam->GetMark()->nContent = nSttCntnt; + pAktPam->GetMark()->nContent = nSttContent; } } @@ -328,8 +328,8 @@ struct _UndoTransliterate_Data sal_uLong nNdIdx; sal_Int32 nStart, nLen; - _UndoTransliterate_Data( sal_uLong nNd, sal_Int32 nStt, sal_Int32 nStrLen, const OUString& rTxt ) - : sText( rTxt ), pHistory( 0 ), pOffsets( 0 ), + _UndoTransliterate_Data( sal_uLong nNd, sal_Int32 nStt, sal_Int32 nStrLen, const OUString& rText ) + : sText( rText ), pHistory( 0 ), pOffsets( 0 ), nNdIdx( nNd ), nStart( nStt ), nLen( nStrLen ) {} ~_UndoTransliterate_Data() { delete pOffsets; delete pHistory; } @@ -381,14 +381,14 @@ void SwUndoTransliterate::DoTransliterate(SwDoc & rDoc, SwPaM & rPam) rDoc.getIDocumentContentOperations().TransliterateText( rPam, aTrans ); } -void SwUndoTransliterate::AddChanges( SwTxtNode& rTNd, +void SwUndoTransliterate::AddChanges( SwTextNode& rTNd, sal_Int32 nStart, sal_Int32 nLen, uno::Sequence <sal_Int32>& rOffsets ) { long nOffsLen = rOffsets.getLength(); _UndoTransliterate_Data* pNew = new _UndoTransliterate_Data( rTNd.GetIndex(), nStart, (sal_Int32)nOffsLen, - rTNd.GetTxt().copy(nStart, nLen)); + rTNd.GetText().copy(nStart, nLen)); aChanges.push_back( pNew ); @@ -442,7 +442,7 @@ void SwUndoTransliterate::AddChanges( SwTxtNode& rTNd, pNew->pHistory = new SwHistory; SwRegHistory aRHst( rTNd, pNew->pHistory ); pNew->pHistory->CopyAttr( rTNd.GetpSwpHints(), - pNew->nNdIdx, 0, rTNd.GetTxt().getLength(), false ); + pNew->nNdIdx, 0, rTNd.GetText().getLength(), false ); } break; } @@ -450,7 +450,7 @@ void SwUndoTransliterate::AddChanges( SwTxtNode& rTNd, void _UndoTransliterate_Data::SetChangeAtNode( SwDoc& rDoc ) { - SwTxtNode* pTNd = rDoc.GetNodes()[ nNdIdx ]->GetTxtNode(); + SwTextNode* pTNd = rDoc.GetNodes()[ nNdIdx ]->GetTextNode(); if( pTNd ) { Sequence <sal_Int32> aOffsets( pOffsets ? pOffsets->getLength() : nLen ); diff --git a/sw/source/core/undo/unredln.cxx b/sw/source/core/undo/unredln.cxx index 016ad41580db..4d07b681e005 100644 --- a/sw/source/core/undo/unredln.cxx +++ b/sw/source/core/undo/unredln.cxx @@ -142,18 +142,18 @@ SwUndoRedlineDelete::SwUndoRedlineDelete( const SwPaM& rRange, SwUndoId nUsrId ) : SwUndoRedline( nUsrId ? nUsrId : UNDO_DELETE, rRange ), bCanGroup( false ), bIsDelim( false ), bIsBackspace( false ) { - const SwTxtNode* pTNd; + const SwTextNode* pTNd; if( UNDO_DELETE == mnUserId && - nSttNode == nEndNode && nSttCntnt + 1 == nEndCntnt && - 0 != (pTNd = rRange.GetNode().GetTxtNode()) ) + nSttNode == nEndNode && nSttContent + 1 == nEndContent && + 0 != (pTNd = rRange.GetNode().GetTextNode()) ) { - sal_Unicode const cCh = pTNd->GetTxt()[nSttCntnt]; + sal_Unicode const cCh = pTNd->GetText()[nSttContent]; if( CH_TXTATR_BREAKWORD != cCh && CH_TXTATR_INWORD != cCh ) { bCanGroup = true; - bIsDelim = !GetAppCharClass().isLetterNumeric( pTNd->GetTxt(), - nSttCntnt ); - bIsBackspace = nSttCntnt == rRange.GetPoint()->nContent.GetIndex(); + bIsDelim = !GetAppCharClass().isLetterNumeric( pTNd->GetText(), + nSttContent ); + bIsBackspace = nSttContent == rRange.GetPoint()->nContent.GetIndex(); } } @@ -185,9 +185,9 @@ bool SwUndoRedlineDelete::CanGrouping( const SwUndoRedlineDelete& rNext ) rNext.nEndNode == nEndNode ) { int bIsEnd = 0; - if( rNext.nSttCntnt == nEndCntnt ) + if( rNext.nSttContent == nEndContent ) bIsEnd = 1; - else if( rNext.nEndCntnt == nSttCntnt ) + else if( rNext.nEndContent == nSttContent ) bIsEnd = -1; if( bIsEnd && @@ -198,9 +198,9 @@ bool SwUndoRedlineDelete::CanGrouping( const SwUndoRedlineDelete& rNext ) ))) { if( 1 == bIsEnd ) - nEndCntnt = rNext.nEndCntnt; + nEndContent = rNext.nEndContent; else - nSttCntnt = rNext.nSttCntnt; + nSttContent = rNext.nSttContent; bRet = true; } } @@ -211,7 +211,7 @@ SwUndoRedlineSort::SwUndoRedlineSort( const SwPaM& rRange, const SwSortOptions& rOpt ) : SwUndoRedline( UNDO_SORT_TXT, rRange ), pOpt( new SwSortOptions( rOpt ) ), - nSaveEndNode( nEndNode ), nOffset( 0 ), nSaveEndCntnt( nEndCntnt ) + nSaveEndNode( nEndNode ), nOffset( 0 ), nSaveEndContent( nEndContent ) { } @@ -239,10 +239,10 @@ void SwUndoRedlineSort::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) sal_uInt16 nFnd = rDoc.getIDocumentRedlineAccess().GetRedlinePos( *rDoc.GetNodes()[ nSttNode + 1 ], nsRedlineType_t::REDLINE_INSERT ); - OSL_ENSURE( USHRT_MAX != nFnd && nFnd+1 < (sal_uInt16)rDoc.getIDocumentRedlineAccess().GetRedlineTbl().size(), + OSL_ENSURE( USHRT_MAX != nFnd && nFnd+1 < (sal_uInt16)rDoc.getIDocumentRedlineAccess().GetRedlineTable().size(), "could not find an Insert object" ); ++nFnd; - rDoc.getIDocumentRedlineAccess().GetRedlineTbl()[nFnd]->Show(1, nFnd); + rDoc.getIDocumentRedlineAccess().GetRedlineTable()[nFnd]->Show(1, nFnd); } { @@ -250,7 +250,7 @@ void SwUndoRedlineSort::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) aTmp.GetMark()->nContent = 0; aTmp.SetMark(); aTmp.GetPoint()->nNode = nSaveEndNode; - aTmp.GetPoint()->nContent.Assign( aTmp.GetCntntNode(), nSaveEndCntnt ); + aTmp.GetPoint()->nContent.Assign( aTmp.GetContentNode(), nSaveEndContent ); rDoc.getIDocumentRedlineAccess().DeleteRedline( aTmp, true, USHRT_MAX ); } @@ -259,12 +259,12 @@ void SwUndoRedlineSort::UndoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) SwPaM *const pPam = & rPam; pPam->DeleteMark(); pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 ); - SwCntntNode* pCNd = pPam->GetCntntNode(); + SwContentNode* pCNd = pPam->GetContentNode(); pPam->GetPoint()->nContent.Assign(pCNd, 0 ); pPam->SetMark(); pPam->GetPoint()->nNode += nOffsetTemp; - pCNd = pPam->GetCntntNode(); + pCNd = pPam->GetContentNode(); pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() ); SetValues( *pPam ); @@ -286,7 +286,7 @@ void SwUndoRedlineSort::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) pPam->DeleteMark(); pPam->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 ); - SwCntntNode* pCNd = pPam->GetCntntNode(); + SwContentNode* pCNd = pPam->GetContentNode(); sal_Int32 nLen = pCNd->Len(); if( nLen > nCntStt ) nLen = nCntStt; @@ -294,14 +294,14 @@ void SwUndoRedlineSort::RedoRedlineImpl(SwDoc & rDoc, SwPaM & rPam) pPam->SetMark(); pPam->GetPoint()->nNode += nOffsetTemp; - pCNd = pPam->GetCntntNode(); + pCNd = pPam->GetContentNode(); pPam->GetPoint()->nContent.Assign( pCNd, pCNd->Len() ); SetValues( rPam ); SetPaM( rPam ); rPam.GetPoint()->nNode = nSaveEndNode; - rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), nSaveEndCntnt ); + rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), nSaveEndContent ); } void SwUndoRedlineSort::RepeatImpl(::sw::RepeatContext & rContext) @@ -313,7 +313,7 @@ void SwUndoRedlineSort::SetSaveRange( const SwPaM& rRange ) { const SwPosition& rPos = *rRange.End(); nSaveEndNode = rPos.nNode.GetIndex(); - nSaveEndCntnt = rPos.nContent.GetIndex(); + nSaveEndContent = rPos.nContent.GetIndex(); } void SwUndoRedlineSort::SetOffset( const SwNodeIndex& rIdx ) @@ -406,22 +406,22 @@ void SwUndoCompDoc::UndoImpl(::sw::UndoRedoContext & rContext) pDoc->getIDocumentRedlineAccess().SetRedlineMode_intern( eOld ); // per definition Point is end (in SwUndRng!) - SwCntntNode* pCSttNd = pPam->GetCntntNode( false ); - SwCntntNode* pCEndNd = pPam->GetCntntNode( true ); + SwContentNode* pCSttNd = pPam->GetContentNode( false ); + SwContentNode* pCEndNd = pPam->GetContentNode( true ); // if start- and end-content is zero, then the doc-compare moves // complete nodes into the current doc. And then the selection // must be from end to start, so the delete join into the right // direction. - if( !nSttCntnt && !nEndCntnt ) + if( !nSttContent && !nEndContent ) pPam->Exchange(); - bool bJoinTxt, bJoinPrev; - sw_GetJoinFlags( *pPam, bJoinTxt, bJoinPrev ); + bool bJoinText, bJoinPrev; + sw_GetJoinFlags( *pPam, bJoinText, bJoinPrev ); pUnDel = new SwUndoDelete( *pPam, false ); - if( bJoinTxt ) + if( bJoinText ) sw_JoinText( *pPam, bJoinPrev ); if( pCSttNd && !pCEndNd) @@ -464,11 +464,11 @@ void SwUndoCompDoc::RedoImpl(::sw::UndoRedoContext & rContext) if( pRedlData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() )) { SwRangeRedline* pTmp = new SwRangeRedline( *pRedlData, *pPam ); - static_cast<SwRedlineTbl&>(pDoc->getIDocumentRedlineAccess().GetRedlineTbl()).Insert( pTmp ); + static_cast<SwRedlineTable&>(pDoc->getIDocumentRedlineAccess().GetRedlineTable()).Insert( pTmp ); pTmp->InvalidateRange(); } else if( !( nsRedlineMode_t::REDLINE_IGNORE & GetRedlineMode() ) && - !pDoc->getIDocumentRedlineAccess().GetRedlineTbl().empty() ) + !pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() ) pDoc->getIDocumentRedlineAccess().SplitRedline( *pPam ); } else @@ -484,7 +484,7 @@ void SwUndoCompDoc::RedoImpl(::sw::UndoRedoContext & rContext) SetPaM( *pPam ); SwRangeRedline* pTmp = new SwRangeRedline( *pRedlData, *pPam ); - static_cast<SwRedlineTbl&>(pDoc->getIDocumentRedlineAccess().GetRedlineTbl()).Insert( pTmp ); + static_cast<SwRedlineTable&>(pDoc->getIDocumentRedlineAccess().GetRedlineTable()).Insert( pTmp ); pTmp->InvalidateRange(); } diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx index c78d02a3ad28..722510d05dd8 100644 --- a/sw/source/core/undo/unsect.cxx +++ b/sw/source/core/undo/unsect.cxx @@ -43,18 +43,18 @@ static SfxItemSet* lcl_GetAttrSet( const SwSection& rSect ) { // save attributes of the format (columns, color, ...) - // Cntnt and Protect items are not interesting since they are already + // Content and Protect items are not interesting since they are already // stored in Section, thus delete them. SfxItemSet* pAttr = 0; - if( rSect.GetFmt() ) + if( rSect.GetFormat() ) { sal_uInt16 nCnt = 1; if( rSect.IsProtect() ) ++nCnt; - if( nCnt < rSect.GetFmt()->GetAttrSet().Count() ) + if( nCnt < rSect.GetFormat()->GetAttrSet().Count() ) { - pAttr = new SfxItemSet( rSect.GetFmt()->GetAttrSet() ); + pAttr = new SfxItemSet( rSect.GetFormat()->GetAttrSet() ); pAttr->ClearItem( RES_PROTECT ); pAttr->ClearItem( RES_CNTNT ); if( !pAttr->Count() ) @@ -74,7 +74,7 @@ SwUndoInsSection::SwUndoInsSection( , m_nSectionNodePos(0) , m_bSplitAtStart(false) , m_bSplitAtEnd(false) - , m_bUpdateFtn(false) + , m_bUpdateFootnote(false) { SwDoc& rDoc = *rPam.GetDoc(); if( rDoc.getIDocumentRedlineAccess().IsRedlineOn() ) @@ -89,7 +89,7 @@ SwUndoInsSection::SwUndoInsSection( if( !rPam.HasMark() ) { - const SwCntntNode* pCNd = rPam.GetPoint()->nNode.GetNode().GetCntntNode(); + const SwContentNode* pCNd = rPam.GetPoint()->nNode.GetNode().GetContentNode(); if( pCNd && pCNd->HasSwAttrSet() && ( !rPam.GetPoint()->nContent.GetIndex() || rPam.GetPoint()->nContent.GetIndex() == pCNd->Len() )) @@ -99,7 +99,7 @@ SwUndoInsSection::SwUndoInsSection( if( aBrkSet.Count() ) { m_pHistory.reset( new SwHistory ); - m_pHistory->CopyFmtAttr( aBrkSet, pCNd->GetIndex() ); + m_pHistory->CopyFormatAttr( aBrkSet, pCNd->GetIndex() ); } } } @@ -124,14 +124,14 @@ void SwUndoInsSection::UndoImpl(::sw::UndoRedoContext & rContext) // no selection? SwNodeIndex aIdx( *pNd ); - if( ( !nEndNode && COMPLETE_STRING == nEndCntnt ) || - ( nSttNode == nEndNode && nSttCntnt == nEndCntnt )) + if( ( !nEndNode && COMPLETE_STRING == nEndContent ) || + ( nSttNode == nEndNode && nSttContent == nEndContent )) // delete simply all nodes rDoc.GetNodes().Delete( aIdx, pNd->EndOfSectionIndex() - aIdx.GetIndex() ); else // just delete format, rest happens automatically - rDoc.DelSectionFmt( pNd->GetSection().GetFmt() ); + rDoc.DelSectionFormat( pNd->GetSection().GetFormat() ); // do we need to consolidate? if (m_bSplitAtStart) @@ -149,9 +149,9 @@ void SwUndoInsSection::UndoImpl(::sw::UndoRedoContext & rContext) m_pHistory->TmpRollback( &rDoc, 0, false ); } - if (m_bUpdateFtn) + if (m_bUpdateFootnote) { - rDoc.GetFtnIdxs().UpdateFtn( aIdx ); + rDoc.GetFootnoteIdxs().UpdateFootnote( aIdx ); } AddUndoRedoPaM(rContext); @@ -194,7 +194,7 @@ void SwUndoInsSection::RedoImpl(::sw::UndoRedoContext & rContext) rDoc.getIDocumentRedlineAccess().SetRedlineMode_intern( eOld ); } else if( !( nsRedlineMode_t::REDLINE_IGNORE & GetRedlineMode() ) && - !rDoc.getIDocumentRedlineAccess().GetRedlineTbl().empty() ) + !rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty() ) { SwPaM aPam( *pSectNd->EndOfSectionNode(), *pSectNd, 1 ); rDoc.getIDocumentRedlineAccess().SplitRedline( aPam ); @@ -230,34 +230,34 @@ void SwUndoInsSection::RepeatImpl(::sw::RepeatContext & rContext) void SwUndoInsSection::Join( SwDoc& rDoc, sal_uLong nNode ) { SwNodeIndex aIdx( rDoc.GetNodes(), nNode ); - SwTxtNode* pTxtNd = aIdx.GetNode().GetTxtNode(); - OSL_ENSURE( pTxtNd, "Where is my TextNode?" ); + SwTextNode* pTextNd = aIdx.GetNode().GetTextNode(); + OSL_ENSURE( pTextNd, "Where is my TextNode?" ); { RemoveIdxRel( nNode + 1, - SwPosition( aIdx, SwIndex( pTxtNd, pTxtNd->GetTxt().getLength() ) ) ); + SwPosition( aIdx, SwIndex( pTextNd, pTextNd->GetText().getLength() ) ) ); } - pTxtNd->JoinNext(); + pTextNd->JoinNext(); if (m_pHistory.get()) { - SwIndex aCntIdx( pTxtNd, 0 ); - pTxtNd->RstTxtAttr( aCntIdx, pTxtNd->Len(), 0, 0, true ); + SwIndex aCntIdx( pTextNd, 0 ); + pTextNd->RstTextAttr( aCntIdx, pTextNd->Len(), 0, 0, true ); } } void -SwUndoInsSection::SaveSplitNode(SwTxtNode *const pTxtNd, bool const bAtStart) +SwUndoInsSection::SaveSplitNode(SwTextNode *const pTextNd, bool const bAtStart) { - if( pTxtNd->GetpSwpHints() ) + if( pTextNd->GetpSwpHints() ) { if (!m_pHistory.get()) { m_pHistory.reset( new SwHistory ); } - m_pHistory->CopyAttr( pTxtNd->GetpSwpHints(), pTxtNd->GetIndex(), 0, - pTxtNd->GetTxt().getLength(), false ); + m_pHistory->CopyAttr( pTextNd->GetpSwpHints(), pTextNd->GetIndex(), 0, + pTextNd->GetText().getLength(), false ); } if (bAtStart) @@ -283,7 +283,7 @@ private: public: SwUndoDelSection( - SwSectionFmt const&, SwSection const&, SwNodeIndex const*const); + SwSectionFormat const&, SwSection const&, SwNodeIndex const*const); virtual ~SwUndoDelSection(); @@ -291,14 +291,14 @@ public: virtual void RedoImpl( ::sw::UndoRedoContext & ) SAL_OVERRIDE; }; -SwUndo * MakeUndoDelSection(SwSectionFmt const& rFormat) +SwUndo * MakeUndoDelSection(SwSectionFormat const& rFormat) { return new SwUndoDelSection(rFormat, *rFormat.GetSection(), - rFormat.GetCntnt().GetCntntIdx()); + rFormat.GetContent().GetContentIdx()); } SwUndoDelSection::SwUndoDelSection( - SwSectionFmt const& rSectionFmt, SwSection const& rSection, + SwSectionFormat const& rSectionFormat, SwSection const& rSection, SwNodeIndex const*const pIndex) : SwUndo( UNDO_DELSECTION ) , m_pSectionData( new SwSectionData(rSection) ) @@ -306,7 +306,7 @@ SwUndoDelSection::SwUndoDelSection( ? new SwTOXBase(static_cast<SwTOXBaseSection const&>(rSection)) : 0 ) , m_pAttrSet( ::lcl_GetAttrSet(rSection) ) - , m_pMetadataUndo( rSectionFmt.CreateUndo() ) + , m_pMetadataUndo( rSectionFormat.CreateUndo() ) , m_nStartNode( pIndex->GetIndex() ) , m_nEndNode( pIndex->GetNode().EndOfSectionIndex() ) { @@ -329,21 +329,21 @@ void SwUndoDelSection::UndoImpl(::sw::UndoRedoContext & rContext) { SwNodeIndex aStt( rDoc.GetNodes(), m_nStartNode ); SwNodeIndex aEnd( rDoc.GetNodes(), m_nEndNode-2 ); - SwSectionFmt* pFmt = rDoc.MakeSectionFmt( 0 ); + SwSectionFormat* pFormat = rDoc.MakeSectionFormat( 0 ); if (m_pAttrSet.get()) { - pFmt->SetFmtAttr( *m_pAttrSet ); + pFormat->SetFormatAttr( *m_pAttrSet ); } /// OD 04.10.2002 #102894# /// remember inserted section node for further calculations SwSectionNode* pInsertedSectNd = rDoc.GetNodes().InsertTextSection( - aStt, *pFmt, *m_pSectionData, 0, & aEnd); + aStt, *pFormat, *m_pSectionData, 0, & aEnd); - if( SfxItemState::SET == pFmt->GetItemState( RES_FTN_AT_TXTEND ) || - SfxItemState::SET == pFmt->GetItemState( RES_END_AT_TXTEND )) + if( SfxItemState::SET == pFormat->GetItemState( RES_FTN_AT_TXTEND ) || + SfxItemState::SET == pFormat->GetItemState( RES_END_AT_TXTEND )) { - rDoc.GetFtnIdxs().UpdateFtn( aStt ); + rDoc.GetFootnoteIdxs().UpdateFootnote( aStt ); } /// OD 04.10.2002 #102894# @@ -359,13 +359,13 @@ void SwUndoDelSection::UndoImpl(::sw::UndoRedoContext & rContext) !aInsertedSect.GetCondition().isEmpty() ) { SwCalc aCalc( rDoc ); - rDoc.getIDocumentFieldsAccess().FldsToCalc(aCalc, pInsertedSectNd->GetIndex(), USHRT_MAX); + rDoc.getIDocumentFieldsAccess().FieldsToCalc(aCalc, pInsertedSectNd->GetIndex(), USHRT_MAX); bool bRecalcCondHidden = aCalc.Calculate( aInsertedSect.GetCondition() ).GetBool(); aInsertedSect.SetCondHidden( bRecalcCondHidden ); } - pFmt->RestoreMetadata(m_pMetadataUndo); + pFormat->RestoreMetadata(m_pMetadataUndo); } } @@ -377,7 +377,7 @@ void SwUndoDelSection::RedoImpl(::sw::UndoRedoContext & rContext) rDoc.GetNodes()[ m_nStartNode ]->GetSectionNode(); OSL_ENSURE( pNd, "Where is my SectionNode?" ); // just delete format, rest happens automatically - rDoc.DelSectionFmt( pNd->GetSection().GetFmt() ); + rDoc.DelSectionFormat( pNd->GetSection().GetFormat() ); } class SwUndoUpdateSection @@ -400,10 +400,10 @@ public: }; SwUndo * -MakeUndoUpdateSection(SwSectionFmt const& rFormat, bool const bOnlyAttr) +MakeUndoUpdateSection(SwSectionFormat const& rFormat, bool const bOnlyAttr) { return new SwUndoUpdateSection(*rFormat.GetSection(), - rFormat.GetCntnt().GetCntntIdx(), bOnlyAttr); + rFormat.GetContent().GetContentIdx(), bOnlyAttr); } SwUndoUpdateSection::SwUndoUpdateSection( @@ -429,28 +429,28 @@ void SwUndoUpdateSection::UndoImpl(::sw::UndoRedoContext & rContext) OSL_ENSURE( pSectNd, "Where is my SectionNode?" ); SwSection& rNdSect = pSectNd->GetSection(); - SwFmt* pFmt = rNdSect.GetFmt(); + SwFormat* pFormat = rNdSect.GetFormat(); SfxItemSet* pCur = ::lcl_GetAttrSet( rNdSect ); if (m_pAttrSet.get()) { // The Content and Protect items must persist const SfxPoolItem* pItem; - m_pAttrSet->Put( pFmt->GetFmtAttr( RES_CNTNT )); - if( SfxItemState::SET == pFmt->GetItemState( RES_PROTECT, true, &pItem )) + m_pAttrSet->Put( pFormat->GetFormatAttr( RES_CNTNT )); + if( SfxItemState::SET == pFormat->GetItemState( RES_PROTECT, true, &pItem )) { m_pAttrSet->Put( *pItem ); } - pFmt->DelDiffs( *m_pAttrSet ); + pFormat->DelDiffs( *m_pAttrSet ); m_pAttrSet->ClearItem( RES_CNTNT ); - pFmt->SetFmtAttr( *m_pAttrSet ); + pFormat->SetFormatAttr( *m_pAttrSet ); } else { // than the old ones need to be deleted - pFmt->ResetFmtAttr( RES_FRMATR_BEGIN, RES_BREAK ); - pFmt->ResetFmtAttr( RES_HEADER, RES_OPAQUE ); - pFmt->ResetFmtAttr( RES_SURROUND, RES_FRMATR_END-1 ); + pFormat->ResetFormatAttr( RES_FRMATR_BEGIN, RES_BREAK ); + pFormat->ResetFormatAttr( RES_HEADER, RES_OPAQUE ); + pFormat->ResetFormatAttr( RES_SURROUND, RES_FRMATR_END-1 ); } m_pAttrSet.reset(pCur); diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx index c771744bab2a..a32c1cbe2e03 100644 --- a/sw/source/core/undo/unsort.cxx +++ b/sw/source/core/undo/unsort.cxx @@ -44,30 +44,30 @@ SwSortUndoElement::~SwSortUndoElement() SwUndoSort::SwUndoSort(const SwPaM& rRg, const SwSortOptions& rOpt) : SwUndo(UNDO_SORT_TXT) , SwUndRng(rRg) - , pUndoTblAttr(0) + , pUndoTableAttr(0) , pRedlData(0) - , nTblNd(0) + , nTableNd(0) { pSortOpt = new SwSortOptions(rOpt); } -SwUndoSort::SwUndoSort( sal_uLong nStt, sal_uLong nEnd, const SwTableNode& rTblNd, +SwUndoSort::SwUndoSort( sal_uLong nStt, sal_uLong nEnd, const SwTableNode& rTableNd, const SwSortOptions& rOpt, bool bSaveTable ) - : SwUndo(UNDO_SORT_TBL), pUndoTblAttr( 0 ), pRedlData( 0 ) + : SwUndo(UNDO_SORT_TBL), pUndoTableAttr( 0 ), pRedlData( 0 ) { nSttNode = nStt; nEndNode = nEnd; - nTblNd = rTblNd.GetIndex(); + nTableNd = rTableNd.GetIndex(); pSortOpt = new SwSortOptions(rOpt); if( bSaveTable ) - pUndoTblAttr = new SwUndoAttrTbl( rTblNd ); + pUndoTableAttr = new SwUndoAttrTable( rTableNd ); } SwUndoSort::~SwUndoSort() { delete pSortOpt; - delete pUndoTblAttr; + delete pUndoTableAttr; delete pRedlData; } @@ -79,26 +79,26 @@ void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext) // Undo for Table RemoveIdxFromSection( rDoc, nSttNode, &nEndNode ); - if( pUndoTblAttr ) + if( pUndoTableAttr ) { - pUndoTblAttr->UndoImpl(rContext); + pUndoTableAttr->UndoImpl(rContext); } - SwTableNode* pTblNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode(); + SwTableNode* pTableNd = rDoc.GetNodes()[ nTableNd ]->GetTableNode(); // #i37739# A simple 'MakeFrms' after the node sorting // does not work if the table is inside a frame and has no prev/next. - SwNode2Layout aNode2Layout( *pTblNd ); + SwNode2Layout aNode2Layout( *pTableNd ); - pTblNd->DelFrms(); - const SwTable& rTbl = pTblNd->GetTable(); + pTableNd->DelFrms(); + const SwTable& rTable = pTableNd->GetTable(); SwMovedBoxes aMovedList; for( size_t i=0; i < aSortList.size(); i++) { - const SwTableBox* pSource = rTbl.GetTblBox( + const SwTableBox* pSource = rTable.GetTableBox( *aSortList[i].SORT_TXT_TBL.TBL.pSource ); - const SwTableBox* pTarget = rTbl.GetTblBox( + const SwTableBox* pTarget = rTable.GetTableBox( *aSortList[i].SORT_TXT_TBL.TBL.pTarget ); // move back @@ -112,7 +112,7 @@ void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext) // Restore table frames: // #i37739# A simple 'MakeFrms' after the node sorting // does not work if the table is inside a frame and has no prev/next. - const sal_uLong nIdx = pTblNd->GetIndex(); + const sal_uLong nIdx = pTableNd->GetIndex(); aNode2Layout.RestoreUpperFrms( rDoc.GetNodes(), nIdx, nIdx + 1 ); } else @@ -159,21 +159,21 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext) // Redo for Table RemoveIdxFromSection( rDoc, nSttNode, &nEndNode ); - SwTableNode* pTblNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode(); + SwTableNode* pTableNd = rDoc.GetNodes()[ nTableNd ]->GetTableNode(); // #i37739# A simple 'MakeFrms' after the node sorting // does not work if the table is inside a frame and has no prev/next. - SwNode2Layout aNode2Layout( *pTblNd ); + SwNode2Layout aNode2Layout( *pTableNd ); - pTblNd->DelFrms(); - const SwTable& rTbl = pTblNd->GetTable(); + pTableNd->DelFrms(); + const SwTable& rTable = pTableNd->GetTable(); SwMovedBoxes aMovedList; for(size_t i=0; i < aSortList.size(); ++i) { - const SwTableBox* pSource = rTbl.GetTblBox( + const SwTableBox* pSource = rTable.GetTableBox( *aSortList[i].SORT_TXT_TBL.TBL.pSource ); - const SwTableBox* pTarget = rTbl.GetTblBox( + const SwTableBox* pTarget = rTable.GetTableBox( *aSortList[i].SORT_TXT_TBL.TBL.pTarget ); // move back @@ -183,15 +183,15 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext) aMovedList.push_back( pSource ); } - if( pUndoTblAttr ) + if( pUndoTableAttr ) { - pUndoTblAttr->RedoImpl(rContext); + pUndoTableAttr->RedoImpl(rContext); } // Restore table frames: // #i37739# A simple 'MakeFrms' after the node sorting // does not work if the table is inside a frame and has no prev/next. - const sal_uLong nIdx = pTblNd->GetIndex(); + const sal_uLong nIdx = pTableNd->GetIndex(); aNode2Layout.RestoreUpperFrms( rDoc.GetNodes(), nIdx, nIdx + 1 ); } else @@ -222,10 +222,10 @@ void SwUndoSort::RedoImpl(::sw::UndoRedoContext & rContext) delete *it; aIdxList.clear(); SetPaM(rPam, true); - SwTxtNode const*const pTNd = rPam.GetNode().GetTxtNode(); + SwTextNode const*const pTNd = rPam.GetNode().GetTextNode(); if( pTNd ) { - rPam.GetPoint()->nContent = pTNd->GetTxt().getLength(); + rPam.GetPoint()->nContent = pTNd->GetText().getLength(); } } } @@ -238,7 +238,7 @@ void SwUndoSort::RepeatImpl(::sw::RepeatContext & rContext) SwPaM *const pPam = & rContext.GetRepeatPaM(); SwDoc& rDoc = *pPam->GetDoc(); - if( !rDoc.IsIdxInTbl( pPam->Start()->nNode ) ) + if( !rDoc.IsIdxInTable( pPam->Start()->nNode ) ) rDoc.SortText(*pPam, *pSortOpt); } } diff --git a/sw/source/core/undo/unspnd.cxx b/sw/source/core/undo/unspnd.cxx index fc9870025196..acaf483f0d4c 100644 --- a/sw/source/core/undo/unspnd.cxx +++ b/sw/source/core/undo/unspnd.cxx @@ -38,16 +38,16 @@ SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos, bool bChkTable ) : SwUndo( UNDO_SPLITNODE ), pHistory( 0 ), pRedlData( 0 ), nNode( rPos.nNode.GetIndex() ), - nCntnt( rPos.nContent.GetIndex() ), - bTblFlag( false ), bChkTblStt( bChkTable ) + nContent( rPos.nContent.GetIndex() ), + bTableFlag( false ), bChkTableStt( bChkTable ) { - SwTxtNode *const pTxtNd = rPos.nNode.GetNode().GetTxtNode(); - OSL_ENSURE( pTxtNd, "only for TextNode" ); - if( pTxtNd->GetpSwpHints() ) + SwTextNode *const pTextNd = rPos.nNode.GetNode().GetTextNode(); + OSL_ENSURE( pTextNd, "only for TextNode" ); + if( pTextNd->GetpSwpHints() ) { pHistory = new SwHistory; - pHistory->CopyAttr( pTxtNd->GetpSwpHints(), nNode, 0, - pTxtNd->GetTxt().getLength(), false ); + pHistory->CopyAttr( pTextNd->GetpSwpHints(), nNode, 0, + pTextNd->GetText().getLength(), false ); if( !pHistory->Count() ) DELETEZ( pHistory ); } @@ -58,7 +58,7 @@ SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos, SetRedlineMode( pDoc->getIDocumentRedlineAccess().GetRedlineMode() ); } - nParRsid = pTxtNd->GetParRsid(); + nParRsid = pTextNd->GetParRsid(); } SwUndoSplitNode::~SwUndoSplitNode() @@ -72,53 +72,53 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext) SwDoc *const pDoc = & rContext.GetDoc(); SwPaM & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() ); rPam.DeleteMark(); - if( bTblFlag ) + if( bTableFlag ) { // than a TextNode was added directly before the current table SwNodeIndex& rIdx = rPam.GetPoint()->nNode; rIdx = nNode; - SwTxtNode* pTNd; + SwTextNode* pTNd; SwNode* pCurrNd = pDoc->GetNodes()[ nNode + 1 ]; - SwTableNode* pTblNd = pCurrNd->FindTableNode(); - if( pCurrNd->IsCntntNode() && pTblNd && - 0 != ( pTNd = pDoc->GetNodes()[ pTblNd->GetIndex()-1 ]->GetTxtNode() )) + SwTableNode* pTableNd = pCurrNd->FindTableNode(); + if( pCurrNd->IsContentNode() && pTableNd && + 0 != ( pTNd = pDoc->GetNodes()[ pTableNd->GetIndex()-1 ]->GetTextNode() )) { // move break attributes - SwFrmFmt* pTableFmt = pTblNd->GetTable().GetFrmFmt(); + SwFrameFormat* pTableFormat = pTableNd->GetTable().GetFrameFormat(); const SfxItemSet* pNdSet = pTNd->GetpSwAttrSet(); if( pNdSet ) { const SfxPoolItem *pItem; if( SfxItemState::SET == pNdSet->GetItemState( RES_PAGEDESC, false, &pItem ) ) - pTableFmt->SetFmtAttr( *pItem ); + pTableFormat->SetFormatAttr( *pItem ); if( SfxItemState::SET == pNdSet->GetItemState( RES_BREAK, false, &pItem ) ) - pTableFmt->SetFmtAttr( *pItem ); + pTableFormat->SetFormatAttr( *pItem ); } // than delete it again - SwNodeIndex aDelNd( *pTblNd, -1 ); - rPam.GetPoint()->nContent.Assign( static_cast<SwCntntNode*>(pCurrNd), 0 ); + SwNodeIndex aDelNd( *pTableNd, -1 ); + rPam.GetPoint()->nContent.Assign( static_cast<SwContentNode*>(pCurrNd), 0 ); RemoveIdxRel( aDelNd.GetIndex(), *rPam.GetPoint() ); pDoc->GetNodes().Delete( aDelNd ); } } else { - SwTxtNode * pTNd = pDoc->GetNodes()[ nNode ]->GetTxtNode(); + SwTextNode * pTNd = pDoc->GetNodes()[ nNode ]->GetTextNode(); if( pTNd ) { rPam.GetPoint()->nNode = *pTNd; - rPam.GetPoint()->nContent.Assign(pTNd, pTNd->GetTxt().getLength()); + rPam.GetPoint()->nContent.Assign(pTNd, pTNd->GetText().getLength()); if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() )) { rPam.SetMark(); ++rPam.GetMark()->nNode; rPam.GetMark()->nContent.Assign( rPam.GetMark()-> - nNode.GetNode().GetCntntNode(), 0 ); + nNode.GetNode().GetContentNode(), 0 ); pDoc->getIDocumentRedlineAccess().DeleteRedline( rPam, true, USHRT_MAX ); rPam.DeleteMark(); } @@ -130,9 +130,9 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext) { rPam.GetPoint()->nContent = 0; rPam.SetMark(); - rPam.GetPoint()->nContent = pTNd->GetTxt().getLength(); + rPam.GetPoint()->nContent = pTNd->GetText().getLength(); - pDoc->RstTxtAttrs( rPam, true ); + pDoc->RstTextAttrs( rPam, true ); pHistory->TmpRollback( pDoc, 0, false ); } @@ -143,28 +143,28 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext) // also set the cursor onto undo section rPam.DeleteMark(); rPam.GetPoint()->nNode = nNode; - rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), nCntnt ); + rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), nContent ); } void SwUndoSplitNode::RedoImpl(::sw::UndoRedoContext & rContext) { SwPaM & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() ); rPam.GetPoint()->nNode = nNode; - SwTxtNode * pTNd = rPam.GetNode().GetTxtNode(); - OSL_ENSURE(pTNd, "SwUndoSplitNode::RedoImpl(): SwTxtNode expected"); + SwTextNode * pTNd = rPam.GetNode().GetTextNode(); + OSL_ENSURE(pTNd, "SwUndoSplitNode::RedoImpl(): SwTextNode expected"); if (pTNd) { - rPam.GetPoint()->nContent.Assign( pTNd, nCntnt ); + rPam.GetPoint()->nContent.Assign( pTNd, nContent ); SwDoc* pDoc = rPam.GetDoc(); - pDoc->getIDocumentContentOperations().SplitNode( *rPam.GetPoint(), bChkTblStt ); + pDoc->getIDocumentContentOperations().SplitNode( *rPam.GetPoint(), bChkTableStt ); if( pHistory ) pHistory->SetTmpEnd( pHistory->Count() ); if( ( pRedlData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() )) || ( !( nsRedlineMode_t::REDLINE_IGNORE & GetRedlineMode() ) && - !pDoc->getIDocumentRedlineAccess().GetRedlineTbl().empty() )) + !pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() )) { rPam.SetMark(); if( rPam.Move( fnMoveBackward )) @@ -188,7 +188,7 @@ void SwUndoSplitNode::RedoImpl(::sw::UndoRedoContext & rContext) void SwUndoSplitNode::RepeatImpl(::sw::RepeatContext & rContext) { rContext.GetDoc().getIDocumentContentOperations().SplitNode( - *rContext.GetRepeatPaM().GetPoint(), bChkTblStt ); + *rContext.GetRepeatPaM().GetPoint(), bChkTableStt ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 6e8cd9cf444c..9acedfe8bb57 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -87,13 +87,13 @@ public: class SwUndoMoves : public boost::ptr_vector<SwUndoMove> {}; -struct SwTblToTxtSave; -class SwTblToTxtSaves : public boost::ptr_vector<SwTblToTxtSave> { +struct SwTableToTextSave; +class SwTableToTextSaves : public boost::ptr_vector<SwTableToTextSave> { public: - SwTblToTxtSaves(size_type n) : boost::ptr_vector<SwTblToTxtSave>(n) {} + SwTableToTextSaves(size_type n) : boost::ptr_vector<SwTableToTextSave>(n) {} }; -struct _UndoTblCpyTbl_Entry +struct _UndoTableCpyTable_Entry { sal_uLong nBoxIdx, nOffset; SfxItemSet* pBoxNumAttr; @@ -102,10 +102,10 @@ struct _UndoTblCpyTbl_Entry // Was the last paragraph of the new and the first paragraph of the old content joined? bool bJoin; // For redlining only - _UndoTblCpyTbl_Entry( const SwTableBox& rBox ); - ~_UndoTblCpyTbl_Entry(); + _UndoTableCpyTable_Entry( const SwTableBox& rBox ); + ~_UndoTableCpyTable_Entry(); }; -class _UndoTblCpyTbl_Entries : public boost::ptr_vector<_UndoTblCpyTbl_Entry> {}; +class _UndoTableCpyTable_Entries : public boost::ptr_vector<_UndoTableCpyTable_Entry> {}; class _SaveBox; class _SaveLine; @@ -114,28 +114,28 @@ class _SaveTable { friend class _SaveBox; friend class _SaveLine; - SfxItemSet m_aTblSet; + SfxItemSet m_aTableSet; _SaveLine* m_pLine; const SwTable* m_pSwTable; SfxItemSets m_aSets; - SwFrmFmts m_aFrmFmts; + SwFrameFormats m_aFrameFormats; sal_uInt16 m_nLineCount; bool m_bModifyBox : 1; bool m_bSaveFormula : 1; bool m_bNewModel : 1; public: - _SaveTable( const SwTable& rTbl, sal_uInt16 nLnCnt = USHRT_MAX, - bool bSaveFml = true ); + _SaveTable( const SwTable& rTable, sal_uInt16 nLnCnt = USHRT_MAX, + bool bSaveFormula = true ); ~_SaveTable(); - sal_uInt16 AddFmt( SwFrmFmt* pFmt, bool bIsLine ); - void NewFrmFmt( const SwTableLine* , const SwTableBox*, sal_uInt16 nFmtPos, - SwFrmFmt* pOldFmt ); + sal_uInt16 AddFormat( SwFrameFormat* pFormat, bool bIsLine ); + void NewFrameFormat( const SwTableLine* , const SwTableBox*, sal_uInt16 nFormatPos, + SwFrameFormat* pOldFormat ); - void RestoreAttr( SwTable& rTbl, bool bModifyBox = false ); - void SaveCntntAttrs( SwDoc* pDoc ); - void CreateNew( SwTable& rTbl, bool bCreateFrms = true, + void RestoreAttr( SwTable& rTable, bool bModifyBox = false ); + void SaveContentAttrs( SwDoc* pDoc ); + void CreateNew( SwTable& rTable, bool bCreateFrms = true, bool bRestoreChart = true ); bool IsNewModel() const { return m_bNewModel; } }; @@ -150,13 +150,13 @@ class _SaveLine sal_uInt16 nItemSet; public: - _SaveLine( _SaveLine* pPrev, const SwTableLine& rLine, _SaveTable& rSTbl ); + _SaveLine( _SaveLine* pPrev, const SwTableLine& rLine, _SaveTable& rSTable ); ~_SaveLine(); - void RestoreAttr( SwTableLine& rLine, _SaveTable& rSTbl ); - void SaveCntntAttrs( SwDoc* pDoc ); + void RestoreAttr( SwTableLine& rLine, _SaveTable& rSTable ); + void SaveContentAttrs( SwDoc* pDoc ); - void CreateNew( SwTable& rTbl, SwTableBox& rParent, _SaveTable& rSTbl ); + void CreateNew( SwTable& rTable, SwTableBox& rParent, _SaveTable& rSTable ); }; class _SaveBox @@ -169,18 +169,18 @@ class _SaveBox sal_uInt16 nItemSet; union { - SfxItemSets* pCntntAttrs; + SfxItemSets* pContentAttrs; _SaveLine* pLine; } Ptrs; public: - _SaveBox( _SaveBox* pPrev, const SwTableBox& rBox, _SaveTable& rSTbl ); + _SaveBox( _SaveBox* pPrev, const SwTableBox& rBox, _SaveTable& rSTable ); ~_SaveBox(); - void RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl ); - void SaveCntntAttrs( SwDoc* pDoc ); + void RestoreAttr( SwTableBox& rBox, _SaveTable& rSTable ); + void SaveContentAttrs( SwDoc* pDoc ); - void CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl ); + void CreateNew( SwTable& rTable, SwTableLine& rParent, _SaveTable& rSTable ); }; #if OSL_DEBUG_LEVEL > 0 @@ -197,21 +197,21 @@ The algorithmn must not rely on this even it holds for a fresh loaded table in o So we need to remember not only the start node position but the end node position as well. */ -struct SwTblToTxtSave +struct SwTableToTextSave { sal_uLong m_nSttNd; sal_uLong m_nEndNd; - sal_Int32 m_nCntnt; + sal_Int32 m_nContent; SwHistory* m_pHstry; // metadata references for first and last paragraph in cell std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart; std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd; - SwTblToTxtSave( SwDoc& rDoc, sal_uLong nNd, sal_uLong nEndIdx, sal_Int32 nCntnt ); - ~SwTblToTxtSave() { delete m_pHstry; } + SwTableToTextSave( SwDoc& rDoc, sal_uLong nNd, sal_uLong nEndIdx, sal_Int32 nContent ); + ~SwTableToTextSave() { delete m_pHstry; } }; -sal_uInt16 aSave_BoxCntntSet[] = { +sal_uInt16 aSave_BoxContentSet[] = { RES_CHRATR_COLOR, RES_CHRATR_CROSSEDOUT, RES_CHRATR_FONT, RES_CHRATR_FONTSIZE, RES_CHRATR_POSTURE, RES_CHRATR_POSTURE, @@ -219,21 +219,21 @@ sal_uInt16 aSave_BoxCntntSet[] = { RES_PARATR_ADJUST, RES_PARATR_ADJUST, 0 }; -SwUndoInsTbl::SwUndoInsTbl( const SwPosition& rPos, sal_uInt16 nCl, sal_uInt16 nRw, - sal_uInt16 nAdj, const SwInsertTableOptions& rInsTblOpts, - const SwTableAutoFmt* pTAFmt, +SwUndoInsTable::SwUndoInsTable( const SwPosition& rPos, sal_uInt16 nCl, sal_uInt16 nRw, + sal_uInt16 nAdj, const SwInsertTableOptions& rInsTableOpts, + const SwTableAutoFormat* pTAFormat, const std::vector<sal_uInt16> *pColArr, const OUString & rName) : SwUndo( UNDO_INSTABLE ), - aInsTblOpts( rInsTblOpts ), pDDEFldType( 0 ), pColWidth( 0 ), pRedlData( 0 ), pAutoFmt( 0 ), + aInsTableOpts( rInsTableOpts ), pDDEFieldType( 0 ), pColWidth( 0 ), pRedlData( 0 ), pAutoFormat( 0 ), nSttNode( rPos.nNode.GetIndex() ), nRows( nRw ), nCols( nCl ), nAdjust( nAdj ) { if( pColArr ) { pColWidth = new std::vector<sal_uInt16>(*pColArr); } - if( pTAFmt ) - pAutoFmt = new SwTableAutoFmt( *pTAFmt ); + if( pTAFormat ) + pAutoFormat = new SwTableAutoFormat( *pTAFormat ); // consider redline SwDoc& rDoc = *rPos.nNode.GetNode().GetDoc(); @@ -243,86 +243,86 @@ SwUndoInsTbl::SwUndoInsTbl( const SwPosition& rPos, sal_uInt16 nCl, sal_uInt16 n SetRedlineMode( rDoc.getIDocumentRedlineAccess().GetRedlineMode() ); } - sTblNm = rName; + sTableNm = rName; } -SwUndoInsTbl::~SwUndoInsTbl() +SwUndoInsTable::~SwUndoInsTable() { - delete pDDEFldType; + delete pDDEFieldType; delete pColWidth; delete pRedlData; - delete pAutoFmt; + delete pAutoFormat; } -void SwUndoInsTbl::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoInsTable::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode ); - SwTableNode* pTblNd = aIdx.GetNode().GetTableNode(); - OSL_ENSURE( pTblNd, "no TableNode" ); - pTblNd->DelFrms(); + SwTableNode* pTableNd = aIdx.GetNode().GetTableNode(); + OSL_ENSURE( pTableNd, "no TableNode" ); + pTableNd->DelFrms(); if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() )) - rDoc.getIDocumentRedlineAccess().DeleteRedline( *pTblNd, true, USHRT_MAX ); + rDoc.getIDocumentRedlineAccess().DeleteRedline( *pTableNd, true, USHRT_MAX ); RemoveIdxFromSection( rDoc, nSttNode ); // move hard page breaks into next node - SwCntntNode* pNextNd = rDoc.GetNodes()[ pTblNd->EndOfSectionIndex()+1 ]->GetCntntNode(); + SwContentNode* pNextNd = rDoc.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 ); } - sTblNm = pTblNd->GetTable().GetFrmFmt()->GetName(); - if( pTblNd->GetTable().IsA( TYPE( SwDDETable )) ) - pDDEFldType = static_cast<SwDDEFieldType*>(static_cast<SwDDETable&>(pTblNd->GetTable()). - GetDDEFldType()->Copy()); + sTableNm = pTableNd->GetTable().GetFrameFormat()->GetName(); + if( pTableNd->GetTable().IsA( TYPE( SwDDETable )) ) + pDDEFieldType = static_cast<SwDDEFieldType*>(static_cast<SwDDETable&>(pTableNd->GetTable()). + GetDDEFieldType()->Copy()); - rDoc.GetNodes().Delete( aIdx, pTblNd->EndOfSectionIndex() - + rDoc.GetNodes().Delete( aIdx, pTableNd->EndOfSectionIndex() - aIdx.GetIndex() + 1 ); SwPaM & rPam( rContext.GetCursorSupplier().CreateNewShellCursor() ); rPam.DeleteMark(); rPam.GetPoint()->nNode = aIdx; - rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), 0 ); + rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), 0 ); } -void SwUndoInsTbl::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoInsTable::RedoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); SwPosition const aPos(SwNodeIndex(rDoc.GetNodes(), nSttNode)); - const SwTable* pTbl = rDoc.InsertTable( aInsTblOpts, aPos, nRows, nCols, + const SwTable* pTable = rDoc.InsertTable( aInsTableOpts, aPos, nRows, nCols, nAdjust, - pAutoFmt, pColWidth ); - ((SwFrmFmt*)pTbl->GetFrmFmt())->SetName( sTblNm ); - SwTableNode* pTblNode = rDoc.GetNodes()[nSttNode]->GetTableNode(); + pAutoFormat, pColWidth ); + ((SwFrameFormat*)pTable->GetFrameFormat())->SetName( sTableNm ); + SwTableNode* pTableNode = rDoc.GetNodes()[nSttNode]->GetTableNode(); - if( pDDEFldType ) + if( pDDEFieldType ) { - SwDDEFieldType* pNewType = static_cast<SwDDEFieldType*>(rDoc.getIDocumentFieldsAccess().InsertFldType( - *pDDEFldType)); - SwDDETable* pDDETbl = new SwDDETable( pTblNode->GetTable(), pNewType ); - pTblNode->SetNewTable( pDDETbl ); - delete pDDEFldType, pDDEFldType = 0; + SwDDEFieldType* pNewType = static_cast<SwDDEFieldType*>(rDoc.getIDocumentFieldsAccess().InsertFieldType( + *pDDEFieldType)); + SwDDETable* pDDETable = new SwDDETable( pTableNode->GetTable(), pNewType ); + pTableNode->SetNewTable( pDDETable ); + delete pDDEFieldType, pDDEFieldType = 0; } if( (pRedlData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() )) || ( !( nsRedlineMode_t::REDLINE_IGNORE & GetRedlineMode() ) && - !rDoc.getIDocumentRedlineAccess().GetRedlineTbl().empty() )) + !rDoc.getIDocumentRedlineAccess().GetRedlineTable().empty() )) { - SwPaM aPam( *pTblNode->EndOfSectionNode(), *pTblNode, 1 ); - SwCntntNode* pCNd = aPam.GetCntntNode( false ); + SwPaM aPam( *pTableNode->EndOfSectionNode(), *pTableNode, 1 ); + SwContentNode* pCNd = aPam.GetContentNode( false ); if( pCNd ) aPam.GetMark()->nContent.Assign( pCNd, 0 ); @@ -339,41 +339,41 @@ void SwUndoInsTbl::RedoImpl(::sw::UndoRedoContext & rContext) } } -void SwUndoInsTbl::RepeatImpl(::sw::RepeatContext & rContext) +void SwUndoInsTable::RepeatImpl(::sw::RepeatContext & rContext) { rContext.GetDoc().InsertTable( - aInsTblOpts, *rContext.GetRepeatPaM().GetPoint(), - nRows, nCols, nAdjust, pAutoFmt, pColWidth ); + aInsTableOpts, *rContext.GetRepeatPaM().GetPoint(), + nRows, nCols, nAdjust, pAutoFormat, pColWidth ); } -SwRewriter SwUndoInsTbl::GetRewriter() const +SwRewriter SwUndoInsTable::GetRewriter() const { SwRewriter aRewriter; aRewriter.AddRule(UndoArg1, SW_RES(STR_START_QUOTE)); - aRewriter.AddRule(UndoArg2, sTblNm); + aRewriter.AddRule(UndoArg2, sTableNm); aRewriter.AddRule(UndoArg3, SW_RES(STR_END_QUOTE)); return aRewriter; } -SwTblToTxtSave::SwTblToTxtSave( SwDoc& rDoc, sal_uLong nNd, sal_uLong nEndIdx, sal_Int32 nCnt ) - : m_nSttNd( nNd ), m_nEndNd( nEndIdx), m_nCntnt( nCnt ), m_pHstry( 0 ) +SwTableToTextSave::SwTableToTextSave( SwDoc& rDoc, sal_uLong nNd, sal_uLong nEndIdx, sal_Int32 nCnt ) + : m_nSttNd( nNd ), m_nEndNd( nEndIdx), m_nContent( nCnt ), m_pHstry( 0 ) { // keep attributes of the joined node - SwTxtNode* pNd = rDoc.GetNodes()[ nNd ]->GetTxtNode(); + SwTextNode* pNd = rDoc.GetNodes()[ nNd ]->GetTextNode(); if( pNd ) { m_pHstry = new SwHistory; - m_pHstry->Add( pNd->GetTxtColl(), nNd, ND_TEXTNODE ); + m_pHstry->Add( pNd->GetTextColl(), nNd, ND_TEXTNODE ); if ( pNd->GetpSwpHints() ) { m_pHstry->CopyAttr( pNd->GetpSwpHints(), nNd, 0, - pNd->GetTxt().getLength(), false ); + pNd->GetText().getLength(), false ); } if( pNd->HasSwAttrSet() ) - m_pHstry->CopyFmtAttr( *pNd->GetpSwAttrSet(), nNd ); + m_pHstry->CopyFormatAttr( *pNd->GetpSwAttrSet(), nNd ); if( !m_pHstry->Count() ) delete m_pHstry, m_pHstry = 0; @@ -387,7 +387,7 @@ SwTblToTxtSave::SwTblToTxtSave( SwDoc& rDoc, sal_uLong nNd, sal_uLong nEndIdx, s // (after SectionUp, the end of the range points to the node after the cell) if ( nEndIdx - 1 > nNd ) { - SwTxtNode* pLastNode( rDoc.GetNodes()[ nEndIdx - 1 ]->GetTxtNode() ); + SwTextNode* pLastNode( rDoc.GetNodes()[ nEndIdx - 1 ]->GetTextNode() ); if( pLastNode ) { // METADATA: store @@ -396,37 +396,37 @@ SwTblToTxtSave::SwTblToTxtSave( SwDoc& rDoc, sal_uLong nNd, sal_uLong nEndIdx, s } } -SwUndoTblToTxt::SwUndoTblToTxt( const SwTable& rTbl, sal_Unicode cCh ) +SwUndoTableToText::SwUndoTableToText( const SwTable& rTable, sal_Unicode cCh ) : SwUndo( UNDO_TABLETOTEXT ), - sTblNm( rTbl.GetFrmFmt()->GetName() ), pDDEFldType( 0 ), pHistory( 0 ), + sTableNm( rTable.GetFrameFormat()->GetName() ), pDDEFieldType( 0 ), pHistory( 0 ), nSttNd( 0 ), nEndNd( 0 ), - cTrenner( cCh ), nHdlnRpt( rTbl.GetRowsToRepeat() ) + cTrenner( cCh ), nHdlnRpt( rTable.GetRowsToRepeat() ) { - pTblSave = new _SaveTable( rTbl ); - pBoxSaves = new SwTblToTxtSaves( (SwTblToTxtSaves::size_type)rTbl.GetTabSortBoxes().size() ); + pTableSave = new _SaveTable( rTable ); + pBoxSaves = new SwTableToTextSaves( (SwTableToTextSaves::size_type)rTable.GetTabSortBoxes().size() ); - if( rTbl.IsA( TYPE( SwDDETable ) ) ) - pDDEFldType = static_cast<SwDDEFieldType*>(static_cast<const SwDDETable&>(rTbl).GetDDEFldType()->Copy()); + if( rTable.IsA( TYPE( SwDDETable ) ) ) + pDDEFieldType = static_cast<SwDDEFieldType*>(static_cast<const SwDDETable&>(rTable).GetDDEFieldType()->Copy()); - bCheckNumFmt = rTbl.GetFrmFmt()->GetDoc()->IsInsTblFormatNum(); + bCheckNumFormat = rTable.GetFrameFormat()->GetDoc()->IsInsTableFormatNum(); pHistory = new SwHistory; - const SwTableNode* pTblNd = rTbl.GetTableNode(); - sal_uLong nTblStt = pTblNd->GetIndex(), nTblEnd = pTblNd->EndOfSectionIndex(); + const SwTableNode* pTableNd = rTable.GetTableNode(); + sal_uLong nTableStt = pTableNd->GetIndex(), nTableEnd = pTableNd->EndOfSectionIndex(); - const SwFrmFmts& rFrmFmtTbl = *pTblNd->GetDoc()->GetSpzFrmFmts(); - for( size_t n = 0; n < rFrmFmtTbl.size(); ++n ) + const SwFrameFormats& rFrameFormatTable = *pTableNd->GetDoc()->GetSpzFrameFormats(); + for( size_t n = 0; n < rFrameFormatTable.size(); ++n ) { - SwFrmFmt* pFmt = rFrmFmtTbl[ n ]; - SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor(); - SwPosition const*const pAPos = pAnchor->GetCntntAnchor(); + SwFrameFormat* pFormat = rFrameFormatTable[ n ]; + SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); + SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && ((FLY_AT_CHAR == pAnchor->GetAnchorId()) || (FLY_AT_PARA == pAnchor->GetAnchorId())) && - nTblStt <= pAPos->nNode.GetIndex() && - pAPos->nNode.GetIndex() < nTblEnd ) + nTableStt <= pAPos->nNode.GetIndex() && + pAPos->nNode.GetIndex() < nTableEnd ) { - pHistory->Add( *pFmt ); + pHistory->Add( *pFormat ); } } @@ -434,15 +434,15 @@ SwUndoTblToTxt::SwUndoTblToTxt( const SwTable& rTbl, sal_Unicode cCh ) delete pHistory, pHistory = 0; } -SwUndoTblToTxt::~SwUndoTblToTxt() +SwUndoTableToText::~SwUndoTableToText() { - delete pDDEFldType; - delete pTblSave; + delete pDDEFieldType; + delete pTableSave; delete pBoxSaves; delete pHistory; } -void SwUndoTblToTxt::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableToText::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor()); @@ -460,30 +460,30 @@ void SwUndoTblToTxt::UndoImpl(::sw::UndoRedoContext & rContext) SwNode2Layout aNode2Layout( aFrmIdx.GetNode() ); // create TableNode structure - SwTableNode* pTblNd = rDoc.GetNodes().UndoTableToText( nSttNd, nEndNd, *pBoxSaves ); - pTblNd->GetTable().SetTableModel( pTblSave->IsNewModel() ); - SwTableFmt* pTableFmt = rDoc.MakeTblFrmFmt( sTblNm, rDoc.GetDfltFrmFmt() ); - pTblNd->GetTable().RegisterToFormat( *pTableFmt ); - pTblNd->GetTable().SetRowsToRepeat( nHdlnRpt ); + SwTableNode* pTableNd = rDoc.GetNodes().UndoTableToText( nSttNd, nEndNd, *pBoxSaves ); + pTableNd->GetTable().SetTableModel( pTableSave->IsNewModel() ); + SwTableFormat* pTableFormat = rDoc.MakeTableFrameFormat( sTableNm, rDoc.GetDfltFrameFormat() ); + pTableNd->GetTable().RegisterToFormat( *pTableFormat ); + pTableNd->GetTable().SetRowsToRepeat( nHdlnRpt ); // create old table structure - pTblSave->CreateNew( pTblNd->GetTable() ); + pTableSave->CreateNew( pTableNd->GetTable() ); - if( pDDEFldType ) + if( pDDEFieldType ) { - SwDDEFieldType* pNewType = static_cast<SwDDEFieldType*>(rDoc.getIDocumentFieldsAccess().InsertFldType( - *pDDEFldType)); - SwDDETable* pDDETbl = new SwDDETable( pTblNd->GetTable(), pNewType ); - pTblNd->SetNewTable( pDDETbl, false ); - delete pDDEFldType, pDDEFldType = 0; + SwDDEFieldType* pNewType = static_cast<SwDDEFieldType*>(rDoc.getIDocumentFieldsAccess().InsertFieldType( + *pDDEFieldType)); + SwDDETable* pDDETable = new SwDDETable( pTableNd->GetTable(), pNewType ); + pTableNd->SetNewTable( pDDETable, false ); + delete pDDEFieldType, pDDEFieldType = 0; } - if( bCheckNumFmt ) + if( bCheckNumFormat ) { - SwTableSortBoxes& rBxs = pTblNd->GetTable().GetTabSortBoxes(); + SwTableSortBoxes& rBxs = pTableNd->GetTable().GetTabSortBoxes(); for (size_t nBoxes = rBxs.size(); nBoxes; ) { - rDoc.ChkBoxNumFmt( *rBxs[ --nBoxes ], false ); + rDoc.ChkBoxNumFormat( *rBxs[ --nBoxes ], false ); } } @@ -495,89 +495,89 @@ void SwUndoTblToTxt::UndoImpl(::sw::UndoRedoContext & rContext) } aNode2Layout.RestoreUpperFrms( rDoc.GetNodes(), - pTblNd->GetIndex(), pTblNd->GetIndex()+1 ); + pTableNd->GetIndex(), pTableNd->GetIndex()+1 ); // Is a table selection requested? pPam->DeleteMark(); - pPam->GetPoint()->nNode = *pTblNd->EndOfSectionNode(); + pPam->GetPoint()->nNode = *pTableNd->EndOfSectionNode(); pPam->SetMark(); pPam->GetPoint()->nNode = *pPam->GetNode().StartOfSectionNode(); - pPam->Move( fnMoveForward, fnGoCntnt ); + pPam->Move( fnMoveForward, fnGoContent ); pPam->Exchange(); - pPam->Move( fnMoveBackward, fnGoCntnt ); + pPam->Move( fnMoveBackward, fnGoContent ); ClearFEShellTabCols(); } // located in untbl.cxx and only an Undo object is allowed to call it SwTableNode* SwNodes::UndoTableToText( sal_uLong nSttNd, sal_uLong nEndNd, - const SwTblToTxtSaves& rSavedData ) + const SwTableToTextSaves& rSavedData ) { SwNodeIndex aSttIdx( *this, nSttNd ); SwNodeIndex aEndIdx( *this, nEndNd+1 ); - SwTableNode * pTblNd = new SwTableNode( aSttIdx ); - SwEndNode* pEndNd = new SwEndNode( aEndIdx, *pTblNd ); + SwTableNode * pTableNd = new SwTableNode( aSttIdx ); + SwEndNode* pEndNd = new SwEndNode( aEndIdx, *pTableNd ); aEndIdx = *pEndNd; - /* Set pTblNd as start of section for all nodes in [nSttNd, nEndNd]. + /* Set pTableNd as start of section for all nodes in [nSttNd, nEndNd]. Delete all Frames attached to the nodes in that range. */ SwNode* pNd; { sal_uLong n, nTmpEnd = aEndIdx.GetIndex(); - for( n = pTblNd->GetIndex() + 1; n < nTmpEnd; ++n ) + for( n = pTableNd->GetIndex() + 1; n < nTmpEnd; ++n ) { - if( ( pNd = (*this)[ n ] )->IsCntntNode() ) - static_cast<SwCntntNode*>(pNd)->DelFrms(); - pNd->pStartOfSection = pTblNd; + if( ( pNd = (*this)[ n ] )->IsContentNode() ) + static_cast<SwContentNode*>(pNd)->DelFrms(); + pNd->pStartOfSection = pTableNd; } } // than create table structure partially. First a single line that contains // all boxes. The correct structure is than taken from SaveStruct. - SwTableBoxFmt* pBoxFmt = GetDoc()->MakeTableBoxFmt(); - SwTableLineFmt* pLineFmt = GetDoc()->MakeTableLineFmt(); - SwTableLine* pLine = new SwTableLine( pLineFmt, rSavedData.size(), 0 ); - pTblNd->GetTable().GetTabLines().insert( pTblNd->GetTable().GetTabLines().begin(), pLine ); + SwTableBoxFormat* pBoxFormat = GetDoc()->MakeTableBoxFormat(); + SwTableLineFormat* pLineFormat = GetDoc()->MakeTableLineFormat(); + SwTableLine* pLine = new SwTableLine( pLineFormat, rSavedData.size(), 0 ); + pTableNd->GetTable().GetTabLines().insert( pTableNd->GetTable().GetTabLines().begin(), pLine ); - const std::shared_ptr<sw::mark::CntntIdxStore> pCntntStore(sw::mark::CntntIdxStore::Create()); + const std::shared_ptr<sw::mark::ContentIdxStore> pContentStore(sw::mark::ContentIdxStore::Create()); for( size_t n = rSavedData.size(); n; ) { - const SwTblToTxtSave* pSave = &rSavedData[ --n ]; + const SwTableToTextSave* pSave = &rSavedData[ --n ]; // if the start node was merged with last from prev. cell, // subtract 1 from index to get the merged paragraph, and split that - aSttIdx = pSave->m_nSttNd - ( ( SAL_MAX_INT32 != pSave->m_nCntnt ) ? 1 : 0); - SwTxtNode* pTxtNd = aSttIdx.GetNode().GetTxtNode(); + aSttIdx = pSave->m_nSttNd - ( ( SAL_MAX_INT32 != pSave->m_nContent ) ? 1 : 0); + SwTextNode* pTextNd = aSttIdx.GetNode().GetTextNode(); - if( SAL_MAX_INT32 != pSave->m_nCntnt ) + if( SAL_MAX_INT32 != pSave->m_nContent ) { // split at ContentPosition, delete previous char (= separator) - OSL_ENSURE( pTxtNd, "Where is my TextNode?" ); - SwIndex aCntPos( pTxtNd, pSave->m_nCntnt - 1 ); + OSL_ENSURE( pTextNd, "Where is my TextNode?" ); + SwIndex aCntPos( pTextNd, pSave->m_nContent - 1 ); - pTxtNd->EraseText( aCntPos, 1 ); - SwCntntNode* pNewNd = pTxtNd->SplitCntntNode( + pTextNd->EraseText( aCntPos, 1 ); + SwContentNode* pNewNd = pTextNd->SplitContentNode( SwPosition( aSttIdx, aCntPos )); - if( !pCntntStore->Empty() ) - pCntntStore->Restore( *pNewNd, pSave->m_nCntnt, pSave->m_nCntnt + 1 ); + if( !pContentStore->Empty() ) + pContentStore->Restore( *pNewNd, pSave->m_nContent, pSave->m_nContent + 1 ); } else { - pCntntStore->Clear(); - if( pTxtNd ) - pCntntStore->Save( GetDoc(), aSttIdx.GetIndex(), pTxtNd->GetTxt().getLength() ); + pContentStore->Clear(); + if( pTextNd ) + pContentStore->Save( GetDoc(), aSttIdx.GetIndex(), pTextNd->GetText().getLength() ); } - if( pTxtNd ) + if( pTextNd ) { // METADATA: restore - pTxtNd->GetTxtNode()->RestoreMetadata(pSave->m_pMetadataUndoStart); - if( pTxtNd->HasSwAttrSet() ) - pTxtNd->ResetAllAttr(); + pTextNd->GetTextNode()->RestoreMetadata(pSave->m_pMetadataUndoStart); + if( pTextNd->HasSwAttrSet() ) + pTextNd->ResetAllAttr(); - if( pTxtNd->GetpSwpHints() ) - pTxtNd->ClearSwpHintsArr( false ); + if( pTextNd->GetpSwpHints() ) + pTextNd->ClearSwpHintsArr( false ); } if( pSave->m_pHstry ) @@ -591,7 +591,7 @@ SwTableNode* SwNodes::UndoTableToText( sal_uLong nSttNd, sal_uLong nEndNd, // end points to node after cell if ( pSave->m_nEndNd - 1 > pSave->m_nSttNd ) { - SwTxtNode* pLastNode = (*this)[ pSave->m_nEndNd - 1 ]->GetTxtNode(); + SwTextNode* pLastNode = (*this)[ pSave->m_nEndNd - 1 ]->GetTextNode(); if (pLastNode) { pLastNode->RestoreMetadata(pSave->m_pMetadataUndoEnd); @@ -601,7 +601,7 @@ SwTableNode* SwNodes::UndoTableToText( sal_uLong nSttNd, sal_uLong nEndNd, aEndIdx = pSave->m_nEndNd; SwStartNode* pSttNd = new SwStartNode( aSttIdx, ND_STARTNODE, SwTableBoxStartNode ); - pSttNd->pStartOfSection = pTblNd; + pSttNd->pStartOfSection = pTableNd; new SwEndNode( aEndIdx, *pSttNd ); for( sal_uLong i = aSttIdx.GetIndex(); i < aEndIdx.GetIndex()-1; ++i ) @@ -612,13 +612,13 @@ SwTableNode* SwNodes::UndoTableToText( sal_uLong nSttNd, sal_uLong nEndNd, i = pNd->EndOfSectionIndex(); } - SwTableBox* pBox = new SwTableBox( pBoxFmt, *pSttNd, pLine ); + SwTableBox* pBox = new SwTableBox( pBoxFormat, *pSttNd, pLine ); pLine->GetTabBoxes().insert( pLine->GetTabBoxes().begin(), pBox ); } - return pTblNd; + return pTableNd; } -void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableToText::RedoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor()); @@ -630,17 +630,17 @@ void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext) pPam->SetMark(); // log off all indices pPam->DeleteMark(); - SwTableNode* pTblNd = pPam->GetNode().GetTableNode(); - OSL_ENSURE( pTblNd, "Could not find any TableNode" ); + SwTableNode* pTableNd = pPam->GetNode().GetTableNode(); + OSL_ENSURE( pTableNd, "Could not find any TableNode" ); - if( pTblNd->GetTable().IsA( TYPE( SwDDETable )) ) - pDDEFldType = static_cast<SwDDEFieldType*>(static_cast<SwDDETable&>(pTblNd->GetTable()). - GetDDEFldType()->Copy()); + if( pTableNd->GetTable().IsA( TYPE( SwDDETable )) ) + pDDEFieldType = static_cast<SwDDEFieldType*>(static_cast<SwDDETable&>(pTableNd->GetTable()). + GetDDEFieldType()->Copy()); - rDoc.TableToText( pTblNd, cTrenner ); + rDoc.TableToText( pTableNd, cTrenner ); ++aSaveIdx; - SwCntntNode* pCNd = aSaveIdx.GetNode().GetCntntNode(); + SwContentNode* pCNd = aSaveIdx.GetNode().GetContentNode(); if( !pCNd && 0 == ( pCNd = rDoc.GetNodes().GoNext( &aSaveIdx ) ) && 0 == ( pCNd = SwNodes::GoPrevious( &aSaveIdx )) ) { @@ -654,72 +654,72 @@ void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext) pPam->DeleteMark(); } -void SwUndoTblToTxt::RepeatImpl(::sw::RepeatContext & rContext) +void SwUndoTableToText::RepeatImpl(::sw::RepeatContext & rContext) { SwPaM *const pPam = & rContext.GetRepeatPaM(); - SwTableNode *const pTblNd = pPam->GetNode().FindTableNode(); - if( pTblNd ) + SwTableNode *const pTableNd = pPam->GetNode().FindTableNode(); + if( pTableNd ) { // move cursor out of table - pPam->GetPoint()->nNode = *pTblNd->EndOfSectionNode(); - pPam->Move( fnMoveForward, fnGoCntnt ); + pPam->GetPoint()->nNode = *pTableNd->EndOfSectionNode(); + pPam->Move( fnMoveForward, fnGoContent ); pPam->SetMark(); pPam->DeleteMark(); - rContext.GetDoc().TableToText( pTblNd, cTrenner ); + rContext.GetDoc().TableToText( pTableNd, cTrenner ); } } -void SwUndoTblToTxt::SetRange( const SwNodeRange& rRg ) +void SwUndoTableToText::SetRange( const SwNodeRange& rRg ) { nSttNd = rRg.aStart.GetIndex(); nEndNd = rRg.aEnd.GetIndex(); } -void SwUndoTblToTxt::AddBoxPos( SwDoc& rDoc, sal_uLong nNdIdx, sal_uLong nEndIdx, sal_Int32 nCntntIdx ) +void SwUndoTableToText::AddBoxPos( SwDoc& rDoc, sal_uLong nNdIdx, sal_uLong nEndIdx, sal_Int32 nContentIdx ) { - SwTblToTxtSave* pNew = new SwTblToTxtSave( rDoc, nNdIdx, nEndIdx, nCntntIdx ); + SwTableToTextSave* pNew = new SwTableToTextSave( rDoc, nNdIdx, nEndIdx, nContentIdx ); pBoxSaves->push_back( pNew ); } -SwUndoTxtToTbl::SwUndoTxtToTbl( const SwPaM& rRg, - const SwInsertTableOptions& rInsTblOpts, +SwUndoTextToTable::SwUndoTextToTable( const SwPaM& rRg, + const SwInsertTableOptions& rInsTableOpts, sal_Unicode cCh, sal_uInt16 nAdj, - const SwTableAutoFmt* pAFmt ) - : SwUndo( UNDO_TEXTTOTABLE ), SwUndRng( rRg ), aInsTblOpts( rInsTblOpts ), - pDelBoxes( 0 ), pAutoFmt( 0 ), + const SwTableAutoFormat* pAFormat ) + : SwUndo( UNDO_TEXTTOTABLE ), SwUndRng( rRg ), aInsTableOpts( rInsTableOpts ), + pDelBoxes( 0 ), pAutoFormat( 0 ), pHistory( 0 ), cTrenner( cCh ), nAdjust( nAdj ) { - if( pAFmt ) - pAutoFmt = new SwTableAutoFmt( *pAFmt ); + if( pAFormat ) + pAutoFormat = new SwTableAutoFormat( *pAFormat ); const SwPosition* pEnd = rRg.End(); SwNodes& rNds = rRg.GetDoc()->GetNodes(); bSplitEnd = pEnd->nContent.GetIndex() && ( pEnd->nContent.GetIndex() - != pEnd->nNode.GetNode().GetCntntNode()->Len() || + != pEnd->nNode.GetNode().GetContentNode()->Len() || pEnd->nNode.GetIndex() >= rNds.GetEndOfContent().GetIndex()-1 ); } -SwUndoTxtToTbl::~SwUndoTxtToTbl() +SwUndoTextToTable::~SwUndoTextToTable() { delete pDelBoxes; - delete pAutoFmt; + delete pAutoFormat; } -void SwUndoTxtToTbl::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTextToTable::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - sal_uLong nTblNd = nSttNode; - if( nSttCntnt ) - ++nTblNd; // Node was splitted previously - SwNodeIndex aIdx( rDoc.GetNodes(), nTblNd ); + sal_uLong nTableNd = nSttNode; + if( nSttContent ) + ++nTableNd; // Node was splitted previously + SwNodeIndex aIdx( rDoc.GetNodes(), nTableNd ); SwTableNode *const pTNd = aIdx.GetNode().GetTableNode(); OSL_ENSURE( pTNd, "Could not find a TableNode" ); - RemoveIdxFromSection( rDoc, nTblNd ); + RemoveIdxFromSection( rDoc, nTableNd ); - sTblNm = pTNd->GetTable().GetFrmFmt()->GetName(); + sTableNm = pTNd->GetTable().GetFrameFormat()->GetName(); if( pHistory ) { @@ -730,12 +730,12 @@ void SwUndoTxtToTbl::UndoImpl(::sw::UndoRedoContext & rContext) if( pDelBoxes ) { pTNd->DelFrms(); - SwTable& rTbl = pTNd->GetTable(); + SwTable& rTable = pTNd->GetTable(); for( size_t n = pDelBoxes->size(); n; ) { - SwTableBox* pBox = rTbl.GetTblBox( (*pDelBoxes)[ --n ] ); + SwTableBox* pBox = rTable.GetTableBox( (*pDelBoxes)[ --n ] ); if( pBox ) - ::_DeleteBox( rTbl, pBox, 0, false, false ); + ::_DeleteBox( rTable, pBox, 0, false, false ); else { OSL_ENSURE( false, "Where is my box?" ); } @@ -748,18 +748,18 @@ void SwUndoTxtToTbl::UndoImpl(::sw::UndoRedoContext & rContext) // join again at start? SwPaM aPam(rDoc.GetNodes().GetEndOfContent()); SwPosition *const pPos = aPam.GetPoint(); - if( nSttCntnt ) + if( nSttContent ) { - pPos->nNode = nTblNd; - pPos->nContent.Assign(pPos->nNode.GetNode().GetCntntNode(), 0); - if (aPam.Move(fnMoveBackward, fnGoCntnt)) + pPos->nNode = nTableNd; + pPos->nContent.Assign(pPos->nNode.GetNode().GetContentNode(), 0); + if (aPam.Move(fnMoveBackward, fnGoContent)) { SwNodeIndex & rIdx = aPam.GetPoint()->nNode; // than move, relatively, the Crsr/etc. again RemoveIdxRel( rIdx.GetIndex()+1, *pPos ); - rIdx.GetNode().GetCntntNode()->JoinNext(); + rIdx.GetNode().GetContentNode()->JoinNext(); } } @@ -768,117 +768,117 @@ void SwUndoTxtToTbl::UndoImpl(::sw::UndoRedoContext & rContext) { SwNodeIndex& rIdx = pPos->nNode; rIdx = nEndNode; - SwTxtNode* pTxtNd = rIdx.GetNode().GetTxtNode(); - if( pTxtNd && pTxtNd->CanJoinNext() ) + SwTextNode* pTextNd = rIdx.GetNode().GetTextNode(); + if( pTextNd && pTextNd->CanJoinNext() ) { aPam.GetMark()->nContent.Assign( 0, 0 ); aPam.GetPoint()->nContent.Assign( 0, 0 ); // than move, relatively, the Crsr/etc. again - pPos->nContent.Assign(pTxtNd, pTxtNd->GetTxt().getLength()); + pPos->nContent.Assign(pTextNd, pTextNd->GetText().getLength()); RemoveIdxRel( nEndNode + 1, *pPos ); - pTxtNd->JoinNext(); + pTextNd->JoinNext(); } } AddUndoRedoPaM(rContext); } -void SwUndoTxtToTbl::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTextToTable::RedoImpl(::sw::UndoRedoContext & rContext) { SwPaM & rPam( AddUndoRedoPaM(rContext) ); RemoveIdxFromRange(rPam, false); SetPaM(rPam); SwTable const*const pTable = rContext.GetDoc().TextToTable( - aInsTblOpts, rPam, cTrenner, nAdjust, pAutoFmt ); - ((SwFrmFmt*)pTable->GetFrmFmt())->SetName( sTblNm ); + aInsTableOpts, rPam, cTrenner, nAdjust, pAutoFormat ); + ((SwFrameFormat*)pTable->GetFrameFormat())->SetName( sTableNm ); } -void SwUndoTxtToTbl::RepeatImpl(::sw::RepeatContext & rContext) +void SwUndoTextToTable::RepeatImpl(::sw::RepeatContext & rContext) { // no Table In Table if (!rContext.GetRepeatPaM().GetNode().FindTableNode()) { - rContext.GetDoc().TextToTable( aInsTblOpts, rContext.GetRepeatPaM(), + rContext.GetDoc().TextToTable( aInsTableOpts, rContext.GetRepeatPaM(), cTrenner, nAdjust, - pAutoFmt ); + pAutoFormat ); } } -void SwUndoTxtToTbl::AddFillBox( const SwTableBox& rBox ) +void SwUndoTextToTable::AddFillBox( const SwTableBox& rBox ) { if( !pDelBoxes ) pDelBoxes = new std::vector<sal_uLong>; pDelBoxes->push_back( rBox.GetSttIdx() ); } -SwHistory& SwUndoTxtToTbl::GetHistory() +SwHistory& SwUndoTextToTable::GetHistory() { if( !pHistory ) pHistory = new SwHistory; return *pHistory; } -SwUndoTblHeadline::SwUndoTblHeadline( const SwTable& rTbl, sal_uInt16 nOldHdl, +SwUndoTableHeadline::SwUndoTableHeadline( const SwTable& rTable, sal_uInt16 nOldHdl, sal_uInt16 nNewHdl ) : SwUndo( UNDO_TABLEHEADLINE ), nOldHeadline( nOldHdl ), nNewHeadline( nNewHdl ) { - OSL_ENSURE( !rTbl.GetTabSortBoxes().empty(), "Table without content" ); - const SwStartNode *pSttNd = rTbl.GetTabSortBoxes()[ 0 ]->GetSttNd(); + OSL_ENSURE( !rTable.GetTabSortBoxes().empty(), "Table without content" ); + const SwStartNode *pSttNd = rTable.GetTabSortBoxes()[ 0 ]->GetSttNd(); OSL_ENSURE( pSttNd, "Box without content" ); - nTblNd = pSttNd->StartOfSectionIndex(); + nTableNd = pSttNd->StartOfSectionIndex(); } -void SwUndoTblHeadline::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableHeadline::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - SwTableNode* pTNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode(); + SwTableNode* pTNd = rDoc.GetNodes()[ nTableNd ]->GetTableNode(); OSL_ENSURE( pTNd, "could not find any TableNode" ); rDoc.SetRowsToRepeat( pTNd->GetTable(), nOldHeadline ); } -void SwUndoTblHeadline::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableHeadline::RedoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - SwTableNode* pTNd = rDoc.GetNodes()[ nTblNd ]->GetTableNode(); + SwTableNode* pTNd = rDoc.GetNodes()[ nTableNd ]->GetTableNode(); OSL_ENSURE( pTNd, "could not find any TableNode" ); rDoc.SetRowsToRepeat( pTNd->GetTable(), nNewHeadline ); } -void SwUndoTblHeadline::RepeatImpl(::sw::RepeatContext & rContext) +void SwUndoTableHeadline::RepeatImpl(::sw::RepeatContext & rContext) { - SwTableNode *const pTblNd = + SwTableNode *const pTableNd = rContext.GetRepeatPaM().GetNode().FindTableNode(); - if( pTblNd ) + if( pTableNd ) { - rContext.GetDoc().SetRowsToRepeat( pTblNd->GetTable(), nNewHeadline ); + rContext.GetDoc().SetRowsToRepeat( pTableNd->GetTable(), nNewHeadline ); } } -_SaveTable::_SaveTable( const SwTable& rTbl, sal_uInt16 nLnCnt, bool bSaveFml ) - : m_aTblSet(*rTbl.GetFrmFmt()->GetAttrSet().GetPool(), aTableSetRange), - m_pSwTable(&rTbl), m_nLineCount(nLnCnt), m_bSaveFormula(bSaveFml) +_SaveTable::_SaveTable( const SwTable& rTable, sal_uInt16 nLnCnt, bool bSaveFormula ) + : m_aTableSet(*rTable.GetFrameFormat()->GetAttrSet().GetPool(), aTableSetRange), + m_pSwTable(&rTable), m_nLineCount(nLnCnt), m_bSaveFormula(bSaveFormula) { m_bModifyBox = false; - m_bNewModel = rTbl.IsNewModel(); - m_aTblSet.Put(rTbl.GetFrmFmt()->GetAttrSet()); - m_pLine = new _SaveLine( 0, *rTbl.GetTabLines()[ 0 ], *this ); + m_bNewModel = rTable.IsNewModel(); + m_aTableSet.Put(rTable.GetFrameFormat()->GetAttrSet()); + m_pLine = new _SaveLine( 0, *rTable.GetTabLines()[ 0 ], *this ); _SaveLine* pLn = m_pLine; if( USHRT_MAX == nLnCnt ) - nLnCnt = rTbl.GetTabLines().size(); + nLnCnt = rTable.GetTabLines().size(); for( sal_uInt16 n = 1; n < nLnCnt; ++n ) - pLn = new _SaveLine( pLn, *rTbl.GetTabLines()[ n ], *this ); + pLn = new _SaveLine( pLn, *rTable.GetTabLines()[ n ], *this ); - m_aFrmFmts.clear(); + m_aFrameFormats.clear(); m_pSwTable = 0; } @@ -887,15 +887,15 @@ _SaveTable::~_SaveTable() delete m_pLine; } -sal_uInt16 _SaveTable::AddFmt( SwFrmFmt* pFmt, bool bIsLine ) +sal_uInt16 _SaveTable::AddFormat( SwFrameFormat* pFormat, bool bIsLine ) { - size_t nRet = m_aFrmFmts.GetPos(pFmt); + size_t nRet = m_aFrameFormats.GetPos(pFormat); if( SIZE_MAX == nRet ) { // Create copy of ItemSet - std::shared_ptr<SfxItemSet> pSet( new SfxItemSet( *pFmt->GetAttrSet().GetPool(), + std::shared_ptr<SfxItemSet> pSet( new SfxItemSet( *pFormat->GetAttrSet().GetPool(), bIsLine ? aTableLineSetRange : aTableBoxSetRange ) ); - pSet->Put( pFmt->GetAttrSet() ); + pSet->Put( pFormat->GetAttrSet() ); // When a formula is set, never save the value. It possibly must be // recalculated. // Save formulas always in plain text. @@ -905,53 +905,53 @@ sal_uInt16 _SaveTable::AddFmt( SwFrmFmt* pFmt, bool bIsLine ) pSet->ClearItem( RES_BOXATR_VALUE ); if (m_pSwTable && m_bSaveFormula) { - SwTableFmlUpdate aMsgHnt(m_pSwTable); - aMsgHnt.eFlags = TBL_BOXNAME; - SwTblBoxFormula* pFormulaItem = const_cast<SwTblBoxFormula*>(static_cast<const SwTblBoxFormula*>(pItem)); - pFormulaItem->ChgDefinedIn( pFmt ); - pFormulaItem->ChangeState( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint(m_pSwTable); + aMsgHint.eFlags = TBL_BOXNAME; + SwTableBoxFormula* pFormulaItem = const_cast<SwTableBoxFormula*>(static_cast<const SwTableBoxFormula*>(pItem)); + pFormulaItem->ChgDefinedIn( pFormat ); + pFormulaItem->ChangeState( &aMsgHint ); pFormulaItem->ChgDefinedIn( 0 ); } } nRet = m_aSets.size(); m_aSets.push_back(pSet); - m_aFrmFmts.insert(m_aFrmFmts.begin() + nRet, pFmt); + m_aFrameFormats.insert(m_aFrameFormats.begin() + nRet, pFormat); } return static_cast<sal_uInt16>(nRet); } -void _SaveTable::RestoreAttr( SwTable& rTbl, bool bMdfyBox ) +void _SaveTable::RestoreAttr( SwTable& rTable, bool bMdfyBox ) { m_bModifyBox = bMdfyBox; // first, get back attributes of TableFrmFormat - SwFrmFmt* pFmt = rTbl.GetFrmFmt(); - SfxItemSet& rFmtSet = (SfxItemSet&)pFmt->GetAttrSet(); - rFmtSet.ClearItem(); - rFmtSet.Put(m_aTblSet); + SwFrameFormat* pFormat = rTable.GetFrameFormat(); + SfxItemSet& rFormatSet = (SfxItemSet&)pFormat->GetAttrSet(); + rFormatSet.ClearItem(); + rFormatSet.Put(m_aTableSet); - if( pFmt->IsInCache() ) + if( pFormat->IsInCache() ) { - SwFrm::GetCache().Delete( pFmt ); - pFmt->SetInCache( false ); + SwFrm::GetCache().Delete( pFormat ); + pFormat->SetInCache( false ); } // for safety, invalidate all TableFrames - SwIterator<SwTabFrm,SwFmt> aIter( *pFmt ); + SwIterator<SwTabFrm,SwFormat> aIter( *pFormat ); for( SwTabFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() ) - if( pLast->GetTable() == &rTbl ) + if( pLast->GetTable() == &rTable ) { pLast->InvalidateAll(); pLast->SetCompletePaint(); } - // fill FrmFmts with defaults (0) - pFmt = 0; + // fill FrameFormats with defaults (0) + pFormat = 0; for (size_t n = m_aSets.size(); n; --n) - m_aFrmFmts.push_back(pFmt); + m_aFrameFormats.push_back(pFormat); const size_t nLnCnt = (USHRT_MAX == m_nLineCount) - ? rTbl.GetTabLines().size() + ? rTable.GetTabLines().size() : m_nLineCount; _SaveLine* pLn = m_pLine; @@ -963,53 +963,53 @@ void _SaveTable::RestoreAttr( SwTable& rTbl, bool bMdfyBox ) break; } - pLn->RestoreAttr( *rTbl.GetTabLines()[ n ], *this ); + pLn->RestoreAttr( *rTable.GetTabLines()[ n ], *this ); } - m_aFrmFmts.clear(); + m_aFrameFormats.clear(); m_bModifyBox = false; } -void _SaveTable::SaveCntntAttrs( SwDoc* pDoc ) +void _SaveTable::SaveContentAttrs( SwDoc* pDoc ) { - m_pLine->SaveCntntAttrs(pDoc); + m_pLine->SaveContentAttrs(pDoc); } -void _SaveTable::CreateNew( SwTable& rTbl, bool bCreateFrms, +void _SaveTable::CreateNew( SwTable& rTable, bool bCreateFrms, bool bRestoreChart ) { _FndBox aTmpBox( 0, 0 ); - aTmpBox.DelFrms( rTbl ); + aTmpBox.DelFrms( rTable ); // first, get back attributes of TableFrmFormat - SwFrmFmt* pFmt = rTbl.GetFrmFmt(); - SfxItemSet& rFmtSet = (SfxItemSet&)pFmt->GetAttrSet(); - rFmtSet.ClearItem(); - rFmtSet.Put(m_aTblSet); + SwFrameFormat* pFormat = rTable.GetFrameFormat(); + SfxItemSet& rFormatSet = (SfxItemSet&)pFormat->GetAttrSet(); + rFormatSet.ClearItem(); + rFormatSet.Put(m_aTableSet); - if( pFmt->IsInCache() ) + if( pFormat->IsInCache() ) { - SwFrm::GetCache().Delete( pFmt ); - pFmt->SetInCache( false ); + SwFrm::GetCache().Delete( pFormat ); + pFormat->SetInCache( false ); } // SwTableBox must have a format - SwTableBox aParent( static_cast<SwTableBoxFmt*>(pFmt), rTbl.GetTabLines().size(), 0 ); + SwTableBox aParent( static_cast<SwTableBoxFormat*>(pFormat), rTable.GetTabLines().size(), 0 ); - // fill FrmFmts with defaults (0) - pFmt = 0; + // fill FrameFormats with defaults (0) + pFormat = 0; for( size_t n = m_aSets.size(); n; --n ) - m_aFrmFmts.push_back(pFmt); + m_aFrameFormats.push_back(pFormat); - m_pLine->CreateNew(rTbl, aParent, *this); - m_aFrmFmts.clear(); + m_pLine->CreateNew(rTable, aParent, *this); + m_aFrameFormats.clear(); // add new lines, delete old ones const size_t nOldLines = (USHRT_MAX == m_nLineCount) - ? rTbl.GetTabLines().size() + ? rTable.GetTabLines().size() : m_nLineCount; - SwDoc *pDoc = rTbl.GetFrmFmt()->GetDoc(); + SwDoc *pDoc = rTable.GetFrameFormat()->GetDoc(); SwChartDataProvider *pPCD = pDoc->getIDocumentChartDataProviderAccess().GetChartDataProvider(); size_t n = 0; for( ; n < aParent.GetTabLines().size(); ++n ) @@ -1018,7 +1018,7 @@ void _SaveTable::CreateNew( SwTable& rTbl, bool bCreateFrms, pLn->SetUpper( 0 ); if( n < nOldLines ) { - SwTableLine* pOld = rTbl.GetTabLines()[ n ]; + SwTableLine* pOld = rTable.GetTabLines()[ n ]; // TL_CHART2: notify chart about boxes to be removed const SwTableBoxes &rBoxes = pOld->GetTabBoxes(); @@ -1027,14 +1027,14 @@ void _SaveTable::CreateNew( SwTable& rTbl, bool bCreateFrms, { SwTableBox *pBox = rBoxes[k]; if (pPCD) - pPCD->DeleteBox( &rTbl, *pBox ); + pPCD->DeleteBox( &rTable, *pBox ); } - rTbl.GetTabLines()[n] = pLn; + rTable.GetTabLines()[n] = pLn; delete pOld; } else - rTbl.GetTabLines().insert( rTbl.GetTabLines().begin() + n, pLn ); + rTable.GetTabLines().insert( rTable.GetTabLines().begin() + n, pLn ); } if( n < nOldLines ) @@ -1042,14 +1042,14 @@ void _SaveTable::CreateNew( SwTable& rTbl, bool bCreateFrms, // remove remaining lines... for (size_t k1 = 0; k1 < nOldLines - n; ++k1) { - const SwTableBoxes &rBoxes = rTbl.GetTabLines()[n + k1]->GetTabBoxes(); + const SwTableBoxes &rBoxes = rTable.GetTabLines()[n + k1]->GetTabBoxes(); const size_t nBoxes = rBoxes.size(); for (size_t k2 = 0; k2 < nBoxes; ++k2) { SwTableBox *pBox = rBoxes[k2]; // TL_CHART2: notify chart about boxes to be removed if (pPCD) - pPCD->DeleteBox( &rTbl, *pBox ); + pPCD->DeleteBox( &rTable, *pBox ); } } @@ -1058,10 +1058,10 @@ void _SaveTable::CreateNew( SwTable& rTbl, bool bCreateFrms, #pragma warning (push, 1) #pragma warning (disable: 4258) #endif - for( SwTableLines::const_iterator it = rTbl.GetTabLines().begin() + n; - it != rTbl.GetTabLines().begin() + nOldLines; ++it ) + for( SwTableLines::const_iterator it = rTable.GetTabLines().begin() + n; + it != rTable.GetTabLines().begin() + nOldLines; ++it ) delete *it; - rTbl.GetTabLines().erase( rTbl.GetTabLines().begin() + n, rTbl.GetTabLines().begin() + nOldLines ); + rTable.GetTabLines().erase( rTable.GetTabLines().begin() + n, rTable.GetTabLines().begin() + nOldLines ); #ifdef _MSC_VER #pragma warning (pop) #endif @@ -1070,41 +1070,41 @@ void _SaveTable::CreateNew( SwTable& rTbl, bool bCreateFrms, aParent.GetTabLines().erase( aParent.GetTabLines().begin(), aParent.GetTabLines().begin() + n ); if( bCreateFrms ) - aTmpBox.MakeFrms( rTbl ); + aTmpBox.MakeFrms( rTable ); if( bRestoreChart ) { // TL_CHART2: need to inform chart of probably changed cell names - pDoc->UpdateCharts( rTbl.GetFrmFmt()->GetName() ); + pDoc->UpdateCharts( rTable.GetFrameFormat()->GetName() ); } } -void _SaveTable::NewFrmFmt( const SwTableLine* pTblLn, const SwTableBox* pTblBx, - sal_uInt16 nFmtPos, SwFrmFmt* pOldFmt ) +void _SaveTable::NewFrameFormat( const SwTableLine* pTableLn, const SwTableBox* pTableBx, + sal_uInt16 nFormatPos, SwFrameFormat* pOldFormat ) { - SwDoc* pDoc = pOldFmt->GetDoc(); + SwDoc* pDoc = pOldFormat->GetDoc(); - SwFrmFmt* pFmt = m_aFrmFmts[ nFmtPos ]; - if( !pFmt ) + SwFrameFormat* pFormat = m_aFrameFormats[ nFormatPos ]; + if( !pFormat ) { - if( pTblLn ) - pFmt = pDoc->MakeTableLineFmt(); + if( pTableLn ) + pFormat = pDoc->MakeTableLineFormat(); else - pFmt = pDoc->MakeTableBoxFmt(); - pFmt->SetFmtAttr(*m_aSets[nFmtPos]); - m_aFrmFmts[nFmtPos] = pFmt; + pFormat = pDoc->MakeTableBoxFormat(); + pFormat->SetFormatAttr(*m_aSets[nFormatPos]); + m_aFrameFormats[nFormatPos] = pFormat; } // first re-assign Frms - SwIterator<SwTabFrm,SwFmt> aIter( *pOldFmt ); + SwIterator<SwTabFrm,SwFormat> aIter( *pOldFormat ); for( SwFrm* pLast = aIter.First(); pLast; pLast = aIter.Next() ) { - if( pTblLn ? static_cast<SwRowFrm*>(pLast)->GetTabLine() == pTblLn - : static_cast<SwCellFrm*>(pLast)->GetTabBox() == pTblBx ) + if( pTableLn ? static_cast<SwRowFrm*>(pLast)->GetTabLine() == pTableLn + : static_cast<SwCellFrm*>(pLast)->GetTabBox() == pTableBx ) { - pLast->RegisterToFormat(*pFmt); + pLast->RegisterToFormat(*pFormat); pLast->InvalidateAll(); pLast->ReinitializeFrmSizeAttrFlags(); - if ( !pTblLn ) + if ( !pTableLn ) { static_cast<SwCellFrm*>(pLast)->SetDerivedVert( false ); static_cast<SwCellFrm*>(pLast)->CheckDirChange(); @@ -1113,35 +1113,35 @@ void _SaveTable::NewFrmFmt( const SwTableLine* pTblLn, const SwTableBox* pTblBx, } // than re-assign myself - if ( pTblLn ) - const_cast<SwTableLine*>(pTblLn)->RegisterToFormat( *pFmt ); - else if ( pTblBx ) - const_cast<SwTableBox*>(pTblBx)->RegisterToFormat( *pFmt ); + if ( pTableLn ) + const_cast<SwTableLine*>(pTableLn)->RegisterToFormat( *pFormat ); + else if ( pTableBx ) + const_cast<SwTableBox*>(pTableBx)->RegisterToFormat( *pFormat ); - if (m_bModifyBox && !pTblLn) + if (m_bModifyBox && !pTableLn) { - const SfxPoolItem& rOld = pOldFmt->GetFmtAttr( RES_BOXATR_FORMAT ), - & rNew = pFmt->GetFmtAttr( RES_BOXATR_FORMAT ); + const SfxPoolItem& rOld = pOldFormat->GetFormatAttr( RES_BOXATR_FORMAT ), + & rNew = pFormat->GetFormatAttr( RES_BOXATR_FORMAT ); if( rOld != rNew ) - pFmt->ModifyNotification( &rOld, &rNew ); + pFormat->ModifyNotification( &rOld, &rNew ); } - if( !pOldFmt->HasWriterListeners() ) - delete pOldFmt; + if( !pOldFormat->HasWriterListeners() ) + delete pOldFormat; } -_SaveLine::_SaveLine( _SaveLine* pPrev, const SwTableLine& rLine, _SaveTable& rSTbl ) +_SaveLine::_SaveLine( _SaveLine* pPrev, const SwTableLine& rLine, _SaveTable& rSTable ) : pNext( 0 ) { if( pPrev ) pPrev->pNext = this; - nItemSet = rSTbl.AddFmt( rLine.GetFrmFmt(), true ); + nItemSet = rSTable.AddFormat( rLine.GetFrameFormat(), true ); - pBox = new _SaveBox( 0, *rLine.GetTabBoxes()[ 0 ], rSTbl ); + pBox = new _SaveBox( 0, *rLine.GetTabBoxes()[ 0 ], rSTable ); _SaveBox* pBx = pBox; for( size_t n = 1; n < rLine.GetTabBoxes().size(); ++n ) - pBx = new _SaveBox( pBx, *rLine.GetTabBoxes()[ n ], rSTbl ); + pBx = new _SaveBox( pBx, *rLine.GetTabBoxes()[ n ], rSTable ); } _SaveLine::~_SaveLine() @@ -1150,9 +1150,9 @@ _SaveLine::~_SaveLine() delete pNext; } -void _SaveLine::RestoreAttr( SwTableLine& rLine, _SaveTable& rSTbl ) +void _SaveLine::RestoreAttr( SwTableLine& rLine, _SaveTable& rSTable ) { - rSTbl.NewFrmFmt( &rLine, 0, nItemSet, rLine.GetFrmFmt() ); + rSTable.NewFrameFormat( &rLine, 0, nItemSet, rLine.GetFrameFormat() ); _SaveBox* pBx = pBox; for( size_t n = 0; n < rLine.GetTabBoxes().size(); ++n, pBx = pBx->pNext ) @@ -1162,38 +1162,38 @@ void _SaveLine::RestoreAttr( SwTableLine& rLine, _SaveTable& rSTbl ) OSL_ENSURE( false, "Number of boxes changed" ); break; } - pBx->RestoreAttr( *rLine.GetTabBoxes()[ n ], rSTbl ); + pBx->RestoreAttr( *rLine.GetTabBoxes()[ n ], rSTable ); } } -void _SaveLine::SaveCntntAttrs( SwDoc* pDoc ) +void _SaveLine::SaveContentAttrs( SwDoc* pDoc ) { - pBox->SaveCntntAttrs( pDoc ); + pBox->SaveContentAttrs( pDoc ); if( pNext ) - pNext->SaveCntntAttrs( pDoc ); + pNext->SaveContentAttrs( pDoc ); } -void _SaveLine::CreateNew( SwTable& rTbl, SwTableBox& rParent, _SaveTable& rSTbl ) +void _SaveLine::CreateNew( SwTable& rTable, SwTableBox& rParent, _SaveTable& rSTable ) { - SwTableLineFmt* pFmt = static_cast<SwTableLineFmt*>(rSTbl.m_aFrmFmts[ nItemSet ]); - if( !pFmt ) + SwTableLineFormat* pFormat = static_cast<SwTableLineFormat*>(rSTable.m_aFrameFormats[ nItemSet ]); + if( !pFormat ) { - SwDoc* pDoc = rTbl.GetFrmFmt()->GetDoc(); - pFmt = pDoc->MakeTableLineFmt(); - pFmt->SetFmtAttr(*rSTbl.m_aSets[nItemSet]); - rSTbl.m_aFrmFmts[nItemSet] = pFmt; + SwDoc* pDoc = rTable.GetFrameFormat()->GetDoc(); + pFormat = pDoc->MakeTableLineFormat(); + pFormat->SetFormatAttr(*rSTable.m_aSets[nItemSet]); + rSTable.m_aFrameFormats[nItemSet] = pFormat; } - SwTableLine* pNew = new SwTableLine( pFmt, 1, &rParent ); + SwTableLine* pNew = new SwTableLine( pFormat, 1, &rParent ); rParent.GetTabLines().push_back( pNew ); - pBox->CreateNew( rTbl, *pNew, rSTbl ); + pBox->CreateNew( rTable, *pNew, rSTable ); if( pNext ) - pNext->CreateNew( rTbl, rParent, rSTbl ); + pNext->CreateNew( rTable, rParent, rSTable ); } -_SaveBox::_SaveBox( _SaveBox* pPrev, const SwTableBox& rBox, _SaveTable& rSTbl ) +_SaveBox::_SaveBox( _SaveBox* pPrev, const SwTableBox& rBox, _SaveTable& rSTable ) : pNext( 0 ), nSttNode( ULONG_MAX ), nRowSpan(0) { Ptrs.pLine = 0; @@ -1201,7 +1201,7 @@ _SaveBox::_SaveBox( _SaveBox* pPrev, const SwTableBox& rBox, _SaveTable& rSTbl ) if( pPrev ) pPrev->pNext = this; - nItemSet = rSTbl.AddFmt( rBox.GetFrmFmt(), false ); + nItemSet = rSTable.AddFormat( rBox.GetFrameFormat(), false ); if( rBox.GetSttNd() ) { @@ -1210,11 +1210,11 @@ _SaveBox::_SaveBox( _SaveBox* pPrev, const SwTableBox& rBox, _SaveTable& rSTbl ) } else { - Ptrs.pLine = new _SaveLine( 0, *rBox.GetTabLines()[ 0 ], rSTbl ); + Ptrs.pLine = new _SaveLine( 0, *rBox.GetTabLines()[ 0 ], rSTable ); _SaveLine* pLn = Ptrs.pLine; for( size_t n = 1; n < rBox.GetTabLines().size(); ++n ) - pLn = new _SaveLine( pLn, *rBox.GetTabLines()[ n ], rSTbl ); + pLn = new _SaveLine( pLn, *rBox.GetTabLines()[ n ], rSTable ); } } @@ -1223,13 +1223,13 @@ _SaveBox::~_SaveBox() if( ULONG_MAX == nSttNode ) // no EndBox delete Ptrs.pLine; else - delete Ptrs.pCntntAttrs; + delete Ptrs.pContentAttrs; delete pNext; } -void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl ) +void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTable ) { - rSTbl.NewFrmFmt( 0, &rBox, nItemSet, rBox.GetFrmFmt() ); + rSTable.NewFrameFormat( 0, &rBox, nItemSet, rBox.GetFrameFormat() ); if( ULONG_MAX == nSttNode ) // no EndBox { @@ -1248,26 +1248,26 @@ void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl ) break; } - pLn->RestoreAttr( *rBox.GetTabLines()[ n ], rSTbl ); + pLn->RestoreAttr( *rBox.GetTabLines()[ n ], rSTable ); } } } else if( rBox.GetSttNd() && rBox.GetSttIdx() == nSttNode ) { - if( Ptrs.pCntntAttrs ) + if( Ptrs.pContentAttrs ) { - SwNodes& rNds = rBox.GetFrmFmt()->GetDoc()->GetNodes(); + SwNodes& rNds = rBox.GetFrameFormat()->GetDoc()->GetNodes(); sal_uInt16 nSet = 0; sal_uLong nEnd = rBox.GetSttNd()->EndOfSectionIndex(); for( sal_uLong n = nSttNode + 1; n < nEnd; ++n ) { - SwCntntNode* pCNd = rNds[ n ]->GetCntntNode(); + SwContentNode* pCNd = rNds[ n ]->GetContentNode(); if( pCNd ) { - std::shared_ptr<SfxItemSet> pSet( (*Ptrs.pCntntAttrs)[ nSet++ ] ); + std::shared_ptr<SfxItemSet> pSet( (*Ptrs.pContentAttrs)[ nSet++ ] ); if( pSet ) { - sal_uInt16 *pRstAttr = aSave_BoxCntntSet; + sal_uInt16 *pRstAttr = aSave_BoxContentSet; while( *pRstAttr ) { pCNd->ResetAttr( *pRstAttr, *(pRstAttr+1) ); @@ -1287,64 +1287,64 @@ void _SaveBox::RestoreAttr( SwTableBox& rBox, _SaveTable& rSTbl ) } } -void _SaveBox::SaveCntntAttrs( SwDoc* pDoc ) +void _SaveBox::SaveContentAttrs( SwDoc* pDoc ) { if( ULONG_MAX == nSttNode ) // no EndBox { // continue in current line - Ptrs.pLine->SaveCntntAttrs( pDoc ); + Ptrs.pLine->SaveContentAttrs( pDoc ); } else { sal_uLong nEnd = pDoc->GetNodes()[ nSttNode ]->EndOfSectionIndex(); - Ptrs.pCntntAttrs = new SfxItemSets( (sal_uInt8)(nEnd - nSttNode - 1 ) ); + Ptrs.pContentAttrs = new SfxItemSets( (sal_uInt8)(nEnd - nSttNode - 1 ) ); for( sal_uLong n = nSttNode + 1; n < nEnd; ++n ) { - SwCntntNode* pCNd = pDoc->GetNodes()[ n ]->GetCntntNode(); + SwContentNode* pCNd = pDoc->GetNodes()[ n ]->GetContentNode(); if( pCNd ) { std::shared_ptr<SfxItemSet> pSet; if( pCNd->HasSwAttrSet() ) { pSet.reset( new SfxItemSet( pDoc->GetAttrPool(), - aSave_BoxCntntSet ) ); + aSave_BoxContentSet ) ); pSet->Put( *pCNd->GetpSwAttrSet() ); } - Ptrs.pCntntAttrs->push_back( pSet ); + Ptrs.pContentAttrs->push_back( pSet ); } } } if( pNext ) - pNext->SaveCntntAttrs( pDoc ); + pNext->SaveContentAttrs( pDoc ); } -void _SaveBox::CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl ) +void _SaveBox::CreateNew( SwTable& rTable, SwTableLine& rParent, _SaveTable& rSTable ) { - SwTableBoxFmt* pFmt = static_cast<SwTableBoxFmt*>(rSTbl.m_aFrmFmts[ nItemSet ]); - if( !pFmt ) + SwTableBoxFormat* pFormat = static_cast<SwTableBoxFormat*>(rSTable.m_aFrameFormats[ nItemSet ]); + if( !pFormat ) { - SwDoc* pDoc = rTbl.GetFrmFmt()->GetDoc(); - pFmt = pDoc->MakeTableBoxFmt(); - pFmt->SetFmtAttr(*rSTbl.m_aSets[nItemSet]); - rSTbl.m_aFrmFmts[nItemSet] = pFmt; + SwDoc* pDoc = rTable.GetFrameFormat()->GetDoc(); + pFormat = pDoc->MakeTableBoxFormat(); + pFormat->SetFormatAttr(*rSTable.m_aSets[nItemSet]); + rSTable.m_aFrameFormats[nItemSet] = pFormat; } if( ULONG_MAX == nSttNode ) // no EndBox { - SwTableBox* pNew = new SwTableBox( pFmt, 1, &rParent ); + SwTableBox* pNew = new SwTableBox( pFormat, 1, &rParent ); rParent.GetTabBoxes().push_back( pNew ); - Ptrs.pLine->CreateNew( rTbl, *pNew, rSTbl ); + Ptrs.pLine->CreateNew( rTable, *pNew, rSTable ); } else { // search box for StartNode in old table - SwTableBox* pBox = rTbl.GetTblBox( nSttNode ); + SwTableBox* pBox = rTable.GetTableBox( nSttNode ); if (pBox) { - SwFrmFmt* pOld = pBox->GetFrmFmt(); - pBox->RegisterToFormat( *pFmt ); + SwFrameFormat* pOld = pBox->GetFrameFormat(); + pBox->RegisterToFormat( *pFormat ); if( !pOld->HasWriterListeners() ) delete pOld; @@ -1360,89 +1360,89 @@ void _SaveBox::CreateNew( SwTable& rTbl, SwTableLine& rParent, _SaveTable& rSTbl } if( pNext ) - pNext->CreateNew( rTbl, rParent, rSTbl ); + pNext->CreateNew( rTable, rParent, rSTable ); } // UndoObject for attribute changes on table -SwUndoAttrTbl::SwUndoAttrTbl( const SwTableNode& rTblNd, bool bClearTabCols ) +SwUndoAttrTable::SwUndoAttrTable( const SwTableNode& rTableNd, bool bClearTabCols ) : SwUndo( UNDO_TABLE_ATTR ), - nSttNode( rTblNd.GetIndex() ) + nSttNode( rTableNd.GetIndex() ) { bClearTabCol = bClearTabCols; - pSaveTbl = new _SaveTable( rTblNd.GetTable() ); + pSaveTable = new _SaveTable( rTableNd.GetTable() ); } -SwUndoAttrTbl::~SwUndoAttrTbl() +SwUndoAttrTable::~SwUndoAttrTable() { - delete pSaveTbl; + delete pSaveTable; } -void SwUndoAttrTbl::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoAttrTable::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - SwTableNode* pTblNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode(); - OSL_ENSURE( pTblNd, "no TableNode" ); + SwTableNode* pTableNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode(); + OSL_ENSURE( pTableNd, "no TableNode" ); - if (pTblNd) + if (pTableNd) { - _SaveTable* pOrig = new _SaveTable( pTblNd->GetTable() ); - pSaveTbl->RestoreAttr( pTblNd->GetTable() ); - delete pSaveTbl; - pSaveTbl = pOrig; + _SaveTable* pOrig = new _SaveTable( pTableNd->GetTable() ); + pSaveTable->RestoreAttr( pTableNd->GetTable() ); + delete pSaveTable; + pSaveTable = pOrig; } if( bClearTabCol ) ClearFEShellTabCols(); } -void SwUndoAttrTbl::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoAttrTable::RedoImpl(::sw::UndoRedoContext & rContext) { UndoImpl(rContext); } // UndoObject for AutoFormat on Table -SwUndoTblAutoFmt::SwUndoTblAutoFmt( const SwTableNode& rTblNd, - const SwTableAutoFmt& rAFmt ) +SwUndoTableAutoFormat::SwUndoTableAutoFormat( const SwTableNode& rTableNd, + const SwTableAutoFormat& rAFormat ) : SwUndo( UNDO_TABLE_AUTOFMT ), - nSttNode( rTblNd.GetIndex() ), - bSaveCntntAttr( false ) - , m_nRepeatHeading(rTblNd.GetTable().GetRowsToRepeat()) + nSttNode( rTableNd.GetIndex() ), + bSaveContentAttr( false ) + , m_nRepeatHeading(rTableNd.GetTable().GetRowsToRepeat()) { - pSaveTbl = new _SaveTable( rTblNd.GetTable() ); + pSaveTable = new _SaveTable( rTableNd.GetTable() ); - if( rAFmt.IsFont() || rAFmt.IsJustify() ) + if( rAFormat.IsFont() || rAFormat.IsJustify() ) { // than also go over the ContentNodes of the EndBoxes and collect // all paragraph attributes - pSaveTbl->SaveCntntAttrs( const_cast<SwDoc*>(rTblNd.GetDoc()) ); - bSaveCntntAttr = true; + pSaveTable->SaveContentAttrs( const_cast<SwDoc*>(rTableNd.GetDoc()) ); + bSaveContentAttr = true; } } -SwUndoTblAutoFmt::~SwUndoTblAutoFmt() +SwUndoTableAutoFormat::~SwUndoTableAutoFormat() { - delete pSaveTbl; + delete pSaveTable; } -void SwUndoTblAutoFmt::SaveBoxCntnt( const SwTableBox& rBox ) +void SwUndoTableAutoFormat::SaveBoxContent( const SwTableBox& rBox ) { - std::shared_ptr<SwUndoTblNumFmt> const p(new SwUndoTblNumFmt(rBox)); + std::shared_ptr<SwUndoTableNumFormat> const p(new SwUndoTableNumFormat(rBox)); m_Undos.push_back(p); } void -SwUndoTblAutoFmt::UndoRedo(bool const bUndo, ::sw::UndoRedoContext & rContext) +SwUndoTableAutoFormat::UndoRedo(bool const bUndo, ::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - SwTableNode* pTblNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode(); - OSL_ENSURE( pTblNd, "no TableNode" ); + SwTableNode* pTableNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode(); + OSL_ENSURE( pTableNd, "no TableNode" ); - SwTable& table = pTblNd->GetTable(); + SwTable& table = pTableNd->GetTable(); _SaveTable* pOrig = new _SaveTable( table ); // than go also over the ContentNodes of the EndBoxes and collect // all paragraph attributes - if( bSaveCntntAttr ) - pOrig->SaveCntntAttrs( &rDoc ); + if( bSaveContentAttr ) + pOrig->SaveContentAttrs( &rDoc ); if (bUndo) { @@ -1454,60 +1454,60 @@ SwUndoTblAutoFmt::UndoRedo(bool const bUndo, ::sw::UndoRedoContext & rContext) table.SetRowsToRepeat(m_nRepeatHeading); } - pSaveTbl->RestoreAttr( pTblNd->GetTable(), !bUndo ); - delete pSaveTbl; - pSaveTbl = pOrig; + pSaveTable->RestoreAttr( pTableNd->GetTable(), !bUndo ); + delete pSaveTable; + pSaveTable = pOrig; } -void SwUndoTblAutoFmt::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableAutoFormat::UndoImpl(::sw::UndoRedoContext & rContext) { UndoRedo(true, rContext); } -void SwUndoTblAutoFmt::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableAutoFormat::RedoImpl(::sw::UndoRedoContext & rContext) { UndoRedo(false, rContext); } -SwUndoTblNdsChg::SwUndoTblNdsChg( SwUndoId nAction, +SwUndoTableNdsChg::SwUndoTableNdsChg( SwUndoId nAction, const SwSelBoxes& rBoxes, - const SwTableNode& rTblNd, + const SwTableNode& rTableNd, long nMn, long nMx, sal_uInt16 nCnt, bool bFlg, bool bSmHght ) : SwUndo( nAction ), nMin( nMn ), nMax( nMx ), - nSttNode( rTblNd.GetIndex() ), nCurrBox( 0 ), + nSttNode( rTableNd.GetIndex() ), nCurrBox( 0 ), nCount( nCnt ), nRelDiff( 0 ), nAbsDiff( 0 ), nSetColType( USHRT_MAX ), bFlag( bFlg ), bSameHeight( bSmHght ) { - const SwTable& rTbl = rTblNd.GetTable(); - pSaveTbl = new _SaveTable( rTbl ); + const SwTable& rTable = rTableNd.GetTable(); + pSaveTable = new _SaveTable( rTable ); // and remember selection ReNewBoxes( rBoxes ); } -SwUndoTblNdsChg::SwUndoTblNdsChg( SwUndoId nAction, +SwUndoTableNdsChg::SwUndoTableNdsChg( SwUndoId nAction, const SwSelBoxes& rBoxes, - const SwTableNode& rTblNd ) + const SwTableNode& rTableNd ) : SwUndo( nAction ), nMin( 0 ), nMax( 0 ), - nSttNode( rTblNd.GetIndex() ), nCurrBox( 0 ), + nSttNode( rTableNd.GetIndex() ), nCurrBox( 0 ), nCount( 0 ), nRelDiff( 0 ), nAbsDiff( 0 ), nSetColType( USHRT_MAX ), bFlag( false ), bSameHeight( false ) { - const SwTable& rTbl = rTblNd.GetTable(); - pSaveTbl = new _SaveTable( rTbl ); + const SwTable& rTable = rTableNd.GetTable(); + pSaveTable = new _SaveTable( rTable ); // and remember selection ReNewBoxes( rBoxes ); } -void SwUndoTblNdsChg::ReNewBoxes( const SwSelBoxes& rBoxes ) +void SwUndoTableNdsChg::ReNewBoxes( const SwSelBoxes& rBoxes ) { if (rBoxes.size() != m_Boxes.size()) { @@ -1519,16 +1519,16 @@ void SwUndoTblNdsChg::ReNewBoxes( const SwSelBoxes& rBoxes ) } } -SwUndoTblNdsChg::~SwUndoTblNdsChg() +SwUndoTableNdsChg::~SwUndoTableNdsChg() { - delete pSaveTbl; + delete pSaveTable; } -void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd, +void SwUndoTableNdsChg::SaveNewBoxes( const SwTableNode& rTableNd, const SwTableSortBoxes& rOld ) { - const SwTable& rTbl = rTblNd.GetTable(); - const SwTableSortBoxes& rTblBoxes = rTbl.GetTabSortBoxes(); + const SwTable& rTable = rTableNd.GetTable(); + const SwTableSortBoxes& rTableBoxes = rTable.GetTabSortBoxes(); OSL_ENSURE( ! IsDelBox(), "wrong Action" ); pNewSttNds.reset( new std::set<_BoxMove> ); @@ -1536,16 +1536,16 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd, size_t i = 0; for (size_t n = 0; n < rOld.size(); ++i) { - if( rOld[ n ] == rTblBoxes[ i ] ) + if( rOld[ n ] == rTableBoxes[ i ] ) ++n; else // new box: insert sorted - pNewSttNds->insert( _BoxMove(rTblBoxes[ i ]->GetSttIdx()) ); + pNewSttNds->insert( _BoxMove(rTableBoxes[ i ]->GetSttIdx()) ); } - for( ; i < rTblBoxes.size(); ++i ) + for( ; i < rTableBoxes.size(); ++i ) // new box: insert sorted - pNewSttNds->insert( _BoxMove(rTblBoxes[ i ]->GetSttIdx()) ); + pNewSttNds->insert( _BoxMove(rTableBoxes[ i ]->GetSttIdx()) ); } static SwTableLine* lcl_FindTableLine( const SwTable& rTable, @@ -1574,24 +1574,24 @@ static const SwTableLines& lcl_FindParentLines( const SwTable& rTable, return rRet; } -void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd, +void SwUndoTableNdsChg::SaveNewBoxes( const SwTableNode& rTableNd, const SwTableSortBoxes& rOld, const SwSelBoxes& rBoxes, const std::vector<sal_uLong> &rNodeCnts ) { - const SwTable& rTbl = rTblNd.GetTable(); - const SwTableSortBoxes& rTblBoxes = rTbl.GetTabSortBoxes(); + const SwTable& rTable = rTableNd.GetTable(); + const SwTableSortBoxes& rTableBoxes = rTable.GetTabSortBoxes(); OSL_ENSURE( ! IsDelBox(), "wrong Action" ); pNewSttNds.reset( new std::set<_BoxMove> ); - OSL_ENSURE( rTbl.IsNewModel() || rOld.size() + nCount * rBoxes.size() == rTblBoxes.size(), + OSL_ENSURE( rTable.IsNewModel() || rOld.size() + nCount * rBoxes.size() == rTableBoxes.size(), "unexpected boxes" ); - OSL_ENSURE( rOld.size() <= rTblBoxes.size(), "more unexpected boxes" ); - for (size_t n = 0, i = 0; i < rTblBoxes.size(); ++i) + OSL_ENSURE( rOld.size() <= rTableBoxes.size(), "more unexpected boxes" ); + for (size_t n = 0, i = 0; i < rTableBoxes.size(); ++i) { if( ( n < rOld.size() ) && - ( rOld[ n ] == rTblBoxes[ i ] ) ) + ( rOld[ n ] == rTableBoxes[ i ] ) ) { // box already known? Then nothing to be done. ++n; @@ -1599,7 +1599,7 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd, else { // new box found: insert (obey sort order) - const SwTableBox* pBox = rTblBoxes[ i ]; + const SwTableBox* pBox = rTableBoxes[ i ]; // find the source box. It must be one in rBoxes. // We found the right one if it's in the same column as pBox. @@ -1608,7 +1608,7 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd, const SwTableBox* pSourceBox = NULL; const SwTableBox* pCheckBox = NULL; const SwTableLine* pBoxLine = pBox->GetUpper(); - sal_uInt16 nLineDiff = lcl_FindParentLines(rTbl,*pBox).GetPos(pBoxLine); + sal_uInt16 nLineDiff = lcl_FindParentLines(rTable,*pBox).GetPos(pBoxLine); sal_uInt16 nLineNo = 0; for (size_t j = 0; j < rBoxes.size(); ++j) { @@ -1616,7 +1616,7 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd, if( pCheckBox->GetUpper()->GetUpper() == pBox->GetUpper()->GetUpper() ) { const SwTableLine* pCheckLine = pCheckBox->GetUpper(); - sal_uInt16 nCheckLine = lcl_FindParentLines( rTbl, *pCheckBox ). + sal_uInt16 nCheckLine = lcl_FindParentLines( rTable, *pCheckBox ). GetPos( pCheckLine ); if( ( !pSourceBox || nCheckLine > nLineNo ) && nCheckLine < nLineDiff ) { @@ -1655,33 +1655,33 @@ void SwUndoTblNdsChg::SaveNewBoxes( const SwTableNode& rTblNd, } } -void SwUndoTblNdsChg::SaveSection( SwStartNode* pSttNd ) +void SwUndoTableNdsChg::SaveSection( SwStartNode* pSttNd ) { OSL_ENSURE( IsDelBox(), "wrong Action" ); if( pDelSects.get() == NULL ) pDelSects.reset( new SwUndoSaveSections( 10 ) ); - SwTableNode* pTblNd = pSttNd->FindTableNode(); + SwTableNode* pTableNd = pSttNd->FindTableNode(); SwUndoSaveSection* pSave = new SwUndoSaveSection; pSave->SaveSection( SwNodeIndex( *pSttNd )); pDelSects->push_back( pSave ); - nSttNode = pTblNd->GetIndex(); + nSttNode = pTableNd->GetIndex(); } -void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode ); - SwTableNode *const pTblNd = aIdx.GetNode().GetTableNode(); - OSL_ENSURE( pTblNd, "no TableNode" ); + SwTableNode *const pTableNd = aIdx.GetNode().GetTableNode(); + OSL_ENSURE( pTableNd, "no TableNode" ); - SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() ); - aMsgHnt.eFlags = TBL_BOXPTR; - rDoc.getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint( &pTableNd->GetTable() ); + aMsgHint.eFlags = TBL_BOXPTR; + rDoc.getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); - CHECK_TABLE( pTblNd->GetTable() ) + CHECK_TABLE( pTableNd->GetTable() ) _FndBox aTmpBox( 0, 0 ); // ? TL_CHART2: notification or locking of controller required ? @@ -1693,7 +1693,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) { // Trick: add missing boxes in any line, they will be connected // correctly when calling CreateNew - SwTableBox* pCpyBox = pTblNd->GetTable().GetTabSortBoxes()[0]; + SwTableBox* pCpyBox = pTableNd->GetTable().GetTabSortBoxes()[0]; SwTableBoxes& rLnBoxes = pCpyBox->GetUpper()->GetTabBoxes(); // restore sections @@ -1703,7 +1703,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) pSave->RestoreSection( &rDoc, &aIdx, SwTableBoxStartNode ); if( pSave->GetHistory() ) pSave->GetHistory()->Rollback( &rDoc ); - SwTableBox* pBox = new SwTableBox( static_cast<SwTableBoxFmt*>(pCpyBox->GetFrmFmt()), aIdx, + SwTableBox* pBox = new SwTableBox( static_cast<SwTableBoxFormat*>(pCpyBox->GetFrameFormat()), aIdx, pCpyBox->GetUpper() ); rLnBoxes.push_back( pBox ); } @@ -1721,12 +1721,12 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) --n; // delete box from table structure sal_uLong nIdx = aTmp[n].index; - SwTableBox* pBox = pTblNd->GetTable().GetTblBox( nIdx ); + SwTableBox* pBox = pTableNd->GetTable().GetTableBox( nIdx ); OSL_ENSURE( pBox, "Where is my TableBox?" ); // TL_CHART2: notify chart about box to be removed if (pPCD) - pPCD->DeleteBox( &pTblNd->GetTable(), *pBox ); + pPCD->DeleteBox( &pTableNd->GetTable(), *pBox ); // insert _before_ deleting the section - otherwise the box // has no start node so all boxes sort equal in SwSelBoxes @@ -1737,7 +1737,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) SwNodeRange aRg( *pBox->GetSttNd(), 1, *pBox->GetSttNd()->EndOfSectionNode() ); - SwTableLine* pLine = lcl_FindTableLine( pTblNd->GetTable(), *pBox ); + SwTableLine* pLine = lcl_FindTableLine( pTableNd->GetTable(), *pBox ); SwNodeIndex aInsPos( *(pLine->GetTabBoxes()[0]->GetSttNd()), 2 ); // adjust all StartNode indices @@ -1765,19 +1765,19 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) for( it = pNewSttNds->rbegin(); it != pNewSttNds->rend(); ++it ) { sal_uLong nIdx = (*it).index; - SwTableBox* pBox = pTblNd->GetTable().GetTblBox( nIdx ); + SwTableBox* pBox = pTableNd->GetTable().GetTableBox( nIdx ); OSL_ENSURE( pBox, "Where's my table box?" ); // TL_CHART2: notify chart about box to be removed if (pPCD) - pPCD->DeleteBox( &pTblNd->GetTable(), *pBox ); + pPCD->DeleteBox( &pTableNd->GetTable(), *pBox ); aDelBoxes.insert(pBox); aDelNodes.push_back(std::make_pair(pBox, nIdx)); } } // fdo#57197: before deleting the SwTableBoxes, delete the SwTabFrms - aTmpBox.SetTableLines(aDelBoxes, pTblNd->GetTable()); - aTmpBox.DelFrms(pTblNd->GetTable()); + aTmpBox.SetTableLines(aDelBoxes, pTableNd->GetTable()); + aTmpBox.DelFrms(pTableNd->GetTable()); // do this _after_ deleting Frms because disposing SwAccessible requires // connection to the nodes, see SwAccessibleChild::IsAccessible() @@ -1798,34 +1798,34 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) delete pCurrBox; } - pSaveTbl->CreateNew( pTblNd->GetTable(), true, false ); + pSaveTable->CreateNew( pTableNd->GetTable(), true, false ); // TL_CHART2: need to inform chart of probably changed cell names - rDoc.UpdateCharts( pTblNd->GetTable().GetFrmFmt()->GetName() ); + rDoc.UpdateCharts( pTableNd->GetTable().GetFrameFormat()->GetName() ); if( IsDelBox() ) - nSttNode = pTblNd->GetIndex(); + nSttNode = pTableNd->GetIndex(); ClearFEShellTabCols(); - CHECK_TABLE( pTblNd->GetTable() ) + CHECK_TABLE( pTableNd->GetTable() ) } -void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableNdsChg::RedoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - SwTableNode* pTblNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode(); - OSL_ENSURE( pTblNd, "no TableNode" ); - CHECK_TABLE( pTblNd->GetTable() ) + SwTableNode* pTableNd = rDoc.GetNodes()[ nSttNode ]->GetTableNode(); + OSL_ENSURE( pTableNd, "no TableNode" ); + CHECK_TABLE( pTableNd->GetTable() ) SwSelBoxes aSelBoxes; for (std::set<sal_uLong>::iterator it = m_Boxes.begin(); it != m_Boxes.end(); ++it) { - SwTableBox* pBox = pTblNd->GetTable().GetTblBox( *it ); + SwTableBox* pBox = pTableNd->GetTable().GetTableBox( *it ); aSelBoxes.insert( pBox ); } - // create SelBoxes and call InsertCell/-Row/SplitTbl + // create SelBoxes and call InsertCell/-Row/SplitTable switch( GetId() ) { case UNDO_TABLE_INSCOL: @@ -1833,7 +1833,7 @@ void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext) rDoc.InsertCol( aSelBoxes, nCount, bFlag ); else { - SwTableBox* pBox = pTblNd->GetTable().GetTblBox( nCurrBox ); + SwTableBox* pBox = pTableNd->GetTable().GetTableBox( nCurrBox ); rDoc.SetColRowWidthHeight( *pBox, nSetColType, nAbsDiff, nRelDiff ); } @@ -1844,42 +1844,42 @@ void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext) rDoc.InsertRow( aSelBoxes, nCount, bFlag ); else { - SwTable& rTbl = pTblNd->GetTable(); - SwTableBox* pBox = rTbl.GetTblBox( nCurrBox ); - TblChgMode eOldMode = rTbl.GetTblChgMode(); - rTbl.SetTblChgMode( (TblChgMode)nCount ); + SwTable& rTable = pTableNd->GetTable(); + SwTableBox* pBox = rTable.GetTableBox( nCurrBox ); + TableChgMode eOldMode = rTable.GetTableChgMode(); + rTable.SetTableChgMode( (TableChgMode)nCount ); rDoc.SetColRowWidthHeight( *pBox, nSetColType, nAbsDiff, nRelDiff ); - rTbl.SetTblChgMode( eOldMode ); + rTable.SetTableChgMode( eOldMode ); } break; case UNDO_TABLE_SPLIT: - rDoc.SplitTbl( aSelBoxes, bFlag, nCount, bSameHeight ); + rDoc.SplitTable( aSelBoxes, bFlag, nCount, bSameHeight ); break; case UNDO_TABLE_DELBOX: case UNDO_ROW_DELETE: case UNDO_COL_DELETE: if( USHRT_MAX == nSetColType ) { - SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() ); - aMsgHnt.eFlags = TBL_BOXPTR; - rDoc.getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); - SwTable &rTable = pTblNd->GetTable(); + SwTableFormulaUpdate aMsgHint( &pTableNd->GetTable() ); + aMsgHint.eFlags = TBL_BOXPTR; + rDoc.getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); + SwTable &rTable = pTableNd->GetTable(); if( nMax > nMin && rTable.IsNewModel() ) rTable.PrepareDeleteCol( nMin, nMax ); rTable.DeleteSel( &rDoc, aSelBoxes, 0, this, true, true ); } else { - SwTable& rTbl = pTblNd->GetTable(); + SwTable& rTable = pTableNd->GetTable(); - SwTableFmlUpdate aMsgHnt( &rTbl ); - aMsgHnt.eFlags = TBL_BOXPTR; - rDoc.getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint( &rTable ); + aMsgHint.eFlags = TBL_BOXPTR; + rDoc.getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); - SwTableBox* pBox = rTbl.GetTblBox( nCurrBox ); - TblChgMode eOldMode = rTbl.GetTblChgMode(); - rTbl.SetTblChgMode( (TblChgMode)nCount ); + SwTableBox* pBox = rTable.GetTableBox( nCurrBox ); + TableChgMode eOldMode = rTable.GetTableChgMode(); + rTable.SetTableChgMode( (TableChgMode)nCount ); // need the SaveSections! rDoc.GetIDocumentUndoRedo().DoUndo( true ); @@ -1887,68 +1887,68 @@ void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext & rContext) switch( nSetColType & 0xff ) { - case nsTblChgWidthHeightType::WH_COL_LEFT: - case nsTblChgWidthHeightType::WH_COL_RIGHT: - case nsTblChgWidthHeightType::WH_CELL_LEFT: - case nsTblChgWidthHeightType::WH_CELL_RIGHT: - rTbl.SetColWidth( *pBox, nSetColType, nAbsDiff, + case nsTableChgWidthHeightType::WH_COL_LEFT: + case nsTableChgWidthHeightType::WH_COL_RIGHT: + case nsTableChgWidthHeightType::WH_CELL_LEFT: + case nsTableChgWidthHeightType::WH_CELL_RIGHT: + rTable.SetColWidth( *pBox, nSetColType, nAbsDiff, nRelDiff, &pUndo ); break; - case nsTblChgWidthHeightType::WH_ROW_TOP: - case nsTblChgWidthHeightType::WH_ROW_BOTTOM: - case nsTblChgWidthHeightType::WH_CELL_TOP: - case nsTblChgWidthHeightType::WH_CELL_BOTTOM: - rTbl.SetRowHeight( *pBox, nSetColType, nAbsDiff, + case nsTableChgWidthHeightType::WH_ROW_TOP: + case nsTableChgWidthHeightType::WH_ROW_BOTTOM: + case nsTableChgWidthHeightType::WH_CELL_TOP: + case nsTableChgWidthHeightType::WH_CELL_BOTTOM: + rTable.SetRowHeight( *pBox, nSetColType, nAbsDiff, nRelDiff, &pUndo ); break; } if( pUndo ) { - pDelSects->transfer( pDelSects->begin(), *static_cast<SwUndoTblNdsChg *>(pUndo)->pDelSects.get() ); + pDelSects->transfer( pDelSects->begin(), *static_cast<SwUndoTableNdsChg *>(pUndo)->pDelSects.get() ); delete pUndo; } rDoc.GetIDocumentUndoRedo().DoUndo( false ); - rTbl.SetTblChgMode( eOldMode ); + rTable.SetTableChgMode( eOldMode ); } - nSttNode = pTblNd->GetIndex(); + nSttNode = pTableNd->GetIndex(); break; default: ; } ClearFEShellTabCols(); - CHECK_TABLE( pTblNd->GetTable() ) + CHECK_TABLE( pTableNd->GetTable() ) } -SwUndoTblMerge::SwUndoTblMerge( const SwPaM& rTblSel ) - : SwUndo( UNDO_TABLE_MERGE ), SwUndRng( rTblSel ), pHistory( 0 ) +SwUndoTableMerge::SwUndoTableMerge( const SwPaM& rTableSel ) + : SwUndo( UNDO_TABLE_MERGE ), SwUndRng( rTableSel ), pHistory( 0 ) { - const SwTableNode* pTblNd = rTblSel.GetNode().FindTableNode(); - OSL_ENSURE( pTblNd, "Where is the TableNode?" ); - pSaveTbl = new _SaveTable( pTblNd->GetTable() ); + const SwTableNode* pTableNd = rTableSel.GetNode().FindTableNode(); + OSL_ENSURE( pTableNd, "Where is the TableNode?" ); + pSaveTable = new _SaveTable( pTableNd->GetTable() ); pMoves = new SwUndoMoves; - nTblNode = pTblNd->GetIndex(); + nTableNode = pTableNd->GetIndex(); } -SwUndoTblMerge::~SwUndoTblMerge() +SwUndoTableMerge::~SwUndoTableMerge() { - delete pSaveTbl; + delete pSaveTable; delete pMoves; delete pHistory; } -void SwUndoTblMerge::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableMerge::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - SwNodeIndex aIdx( rDoc.GetNodes(), nTblNode ); + SwNodeIndex aIdx( rDoc.GetNodes(), nTableNode ); - SwTableNode *const pTblNd = aIdx.GetNode().GetTableNode(); - OSL_ENSURE( pTblNd, "no TableNode" ); + SwTableNode *const pTableNd = aIdx.GetNode().GetTableNode(); + OSL_ENSURE( pTableNd, "no TableNode" ); - SwTableFmlUpdate aMsgHnt( &pTblNd->GetTable() ); - aMsgHnt.eFlags = TBL_BOXPTR; - rDoc.getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint( &pTableNd->GetTable() ); + aMsgHint.eFlags = TBL_BOXPTR; + rDoc.getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); _FndBox aTmpBox( 0, 0 ); // ? TL_CHART2: notification or locking of controller required ? @@ -1956,13 +1956,13 @@ void SwUndoTblMerge::UndoImpl(::sw::UndoRedoContext & rContext) // 1. restore deleted boxes: // Trick: add missing boxes in any line, they will be connected // correctly when calling CreateNew - SwTableBox *pBox, *pCpyBox = pTblNd->GetTable().GetTabSortBoxes()[0]; + SwTableBox *pBox, *pCpyBox = pTableNd->GetTable().GetTabSortBoxes()[0]; SwTableBoxes& rLnBoxes = pCpyBox->GetUpper()->GetTabBoxes(); -CHECKTABLE(pTblNd->GetTable()) +CHECKTABLE(pTableNd->GetTable()) SwSelBoxes aSelBoxes; - SwTxtFmtColl* pColl = rDoc.getIDocumentStylePoolAccess().GetTxtCollFromPool( RES_POOLCOLL_STANDARD ); + SwTextFormatColl* pColl = rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ); std::set<sal_uLong>::iterator it; for (it = m_Boxes.begin(); it != m_Boxes.end(); ++it) @@ -1970,14 +1970,14 @@ CHECKTABLE(pTblNd->GetTable()) aIdx = *it; SwStartNode* pSttNd = rDoc.GetNodes().MakeTextSection( aIdx, SwTableBoxStartNode, pColl ); - pBox = new SwTableBox( static_cast<SwTableBoxFmt*>(pCpyBox->GetFrmFmt()), *pSttNd, + pBox = new SwTableBox( static_cast<SwTableBoxFormat*>(pCpyBox->GetFrameFormat()), *pSttNd, pCpyBox->GetUpper() ); rLnBoxes.push_back( pBox ); aSelBoxes.insert( pBox ); } -CHECKTABLE(pTblNd->GetTable()) +CHECKTABLE(pTableNd->GetTable()) SwChartDataProvider *pPCD = rDoc.getIDocumentChartDataProviderAccess().GetChartDataProvider(); // 2. deleted the inserted boxes @@ -1990,59 +1990,59 @@ CHECKTABLE(pTblNd->GetTable()) if( !nIdx && n ) { nIdx = aNewSttNds[ --n ]; - pBox = pTblNd->GetTable().GetTblBox( nIdx ); + pBox = pTableNd->GetTable().GetTableBox( nIdx ); OSL_ENSURE( pBox, "Where is my TableBox?" ); - if( !pSaveTbl->IsNewModel() ) - rDoc.GetNodes().MakeTxtNode( SwNodeIndex( + if( !pSaveTable->IsNewModel() ) + rDoc.GetNodes().MakeTextNode( SwNodeIndex( *pBox->GetSttNd()->EndOfSectionNode() ), pColl ); // this was the separator -> restore moved ones for( size_t i = pMoves->size(); i; ) { - SwTxtNode* pTxtNd = 0; + SwTextNode* pTextNd = 0; sal_Int32 nDelPos = 0; SwUndoMove* pUndo = &(*pMoves)[ --i ]; if( !pUndo->IsMoveRange() ) { - pTxtNd = rDoc.GetNodes()[ pUndo->GetDestSttNode() ]->GetTxtNode(); - nDelPos = pUndo->GetDestSttCntnt() - 1; + pTextNd = rDoc.GetNodes()[ pUndo->GetDestSttNode() ]->GetTextNode(); + nDelPos = pUndo->GetDestSttContent() - 1; } pUndo->UndoImpl(rContext); if( pUndo->IsMoveRange() ) { // delete the unnecessary node aIdx = pUndo->GetEndNode(); - SwCntntNode *pCNd = aIdx.GetNode().GetCntntNode(); + SwContentNode *pCNd = aIdx.GetNode().GetContentNode(); if( pCNd ) { SwNodeIndex aTmp( aIdx, -1 ); - SwCntntNode *pMove = aTmp.GetNode().GetCntntNode(); + SwContentNode *pMove = aTmp.GetNode().GetContentNode(); if( pMove ) pCNd->MoveTo( *pMove ); } rDoc.GetNodes().Delete( aIdx, 1 ); } - else if( pTxtNd ) + else if( pTextNd ) { // also delete not needed attributes - SwIndex aTmpIdx( pTxtNd, nDelPos ); - if( pTxtNd->GetpSwpHints() && pTxtNd->GetpSwpHints()->Count() ) - pTxtNd->RstTxtAttr( aTmpIdx, pTxtNd->GetTxt().getLength() - nDelPos + 1 ); + SwIndex aTmpIdx( pTextNd, nDelPos ); + if( pTextNd->GetpSwpHints() && pTextNd->GetpSwpHints()->Count() ) + pTextNd->RstTextAttr( aTmpIdx, pTextNd->GetText().getLength() - nDelPos + 1 ); // delete separator - pTxtNd->EraseText( aTmpIdx, 1 ); + pTextNd->EraseText( aTmpIdx, 1 ); } } nIdx = pBox->GetSttIdx(); } else - pBox = pTblNd->GetTable().GetTblBox( nIdx ); + pBox = pTableNd->GetTable().GetTableBox( nIdx ); - if( !pSaveTbl->IsNewModel() ) + if( !pSaveTable->IsNewModel() ) { // TL_CHART2: notify chart about box to be removed if (pPCD) - pPCD->DeleteBox( &pTblNd->GetTable(), *pBox ); + pPCD->DeleteBox( &pTableNd->GetTable(), *pBox ); SwTableBoxes* pTBoxes = &pBox->GetUpper()->GetTabBoxes(); pTBoxes->erase( std::find(pTBoxes->begin(), pTBoxes->end(), pBox ) ); @@ -2059,12 +2059,12 @@ CHECKTABLE(pTblNd->GetTable()) rDoc.getIDocumentContentOperations().DeleteSection( rDoc.GetNodes()[ nIdx ] ); } } -CHECKTABLE(pTblNd->GetTable()) +CHECKTABLE(pTableNd->GetTable()) - pSaveTbl->CreateNew( pTblNd->GetTable(), true, false ); + pSaveTable->CreateNew( pTableNd->GetTable(), true, false ); // TL_CHART2: need to inform chart of probably changed cell names - rDoc.UpdateCharts( pTblNd->GetTable().GetFrmFmt()->GetName() ); + rDoc.UpdateCharts( pTableNd->GetTable().GetFrameFormat()->GetName() ); if( pHistory ) { @@ -2074,27 +2074,27 @@ CHECKTABLE(pTblNd->GetTable()) SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor()); pPam->DeleteMark(); pPam->GetPoint()->nNode = nSttNode; - pPam->GetPoint()->nContent.Assign( pPam->GetCntntNode(), nSttCntnt ); + pPam->GetPoint()->nContent.Assign( pPam->GetContentNode(), nSttContent ); pPam->SetMark(); pPam->DeleteMark(); -CHECKTABLE(pTblNd->GetTable()) +CHECKTABLE(pTableNd->GetTable()) ClearFEShellTabCols(); } -void SwUndoTblMerge::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableMerge::RedoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); SwPaM & rPam( AddUndoRedoPaM(rContext) ); - rDoc.MergeTbl(rPam); + rDoc.MergeTable(rPam); } -void SwUndoTblMerge::MoveBoxCntnt( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& rPos ) +void SwUndoTableMerge::MoveBoxContent( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& rPos ) { SwNodeIndex aTmp( rRg.aStart, -1 ), aTmp2( rPos, -1 ); SwUndoMove* pUndo = new SwUndoMove( pDoc, rRg, rPos ); ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); - pDoc->getIDocumentContentOperations().MoveNodeRange( rRg, rPos, pSaveTbl->IsNewModel() ? + pDoc->getIDocumentContentOperations().MoveNodeRange( rRg, rPos, pSaveTable->IsNewModel() ? SwMoveFlags::NO_DELFRMS : SwMoveFlags::DEFAULT ); ++aTmp; @@ -2104,7 +2104,7 @@ void SwUndoTblMerge::MoveBoxCntnt( SwDoc* pDoc, SwNodeRange& rRg, SwNodeIndex& r pMoves->push_back( pUndo ); } -void SwUndoTblMerge::SetSelBoxes( const SwSelBoxes& rBoxes ) +void SwUndoTableMerge::SetSelBoxes( const SwSelBoxes& rBoxes ) { // memorize selection for (size_t n = 0; n < rBoxes.size(); ++n) @@ -2118,63 +2118,63 @@ void SwUndoTblMerge::SetSelBoxes( const SwSelBoxes& rBoxes ) // The new table model does not delete overlapped cells (by row span), // so the rBoxes array might be empty even some cells have been merged. if( !rBoxes.empty() ) - nTblNode = rBoxes[ 0 ]->GetSttNd()->FindTableNode()->GetIndex(); + nTableNode = rBoxes[ 0 ]->GetSttNd()->FindTableNode()->GetIndex(); } -void SwUndoTblMerge::SaveCollection( const SwTableBox& rBox ) +void SwUndoTableMerge::SaveCollection( const SwTableBox& rBox ) { if( !pHistory ) pHistory = new SwHistory; SwNodeIndex aIdx( *rBox.GetSttNd(), 1 ); - SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode(); + SwContentNode* pCNd = aIdx.GetNode().GetContentNode(); if( !pCNd ) pCNd = aIdx.GetNodes().GoNext( &aIdx ); - pHistory->Add( pCNd->GetFmtColl(), aIdx.GetIndex(), pCNd->GetNodeType()); + pHistory->Add( pCNd->GetFormatColl(), aIdx.GetIndex(), pCNd->GetNodeType()); if( pCNd->HasSwAttrSet() ) - pHistory->CopyFmtAttr( *pCNd->GetpSwAttrSet(), aIdx.GetIndex() ); + pHistory->CopyFormatAttr( *pCNd->GetpSwAttrSet(), aIdx.GetIndex() ); } -SwUndoTblNumFmt::SwUndoTblNumFmt( const SwTableBox& rBox, +SwUndoTableNumFormat::SwUndoTableNumFormat( const SwTableBox& rBox, const SfxItemSet* pNewSet ) : SwUndo(UNDO_TBLNUMFMT) , pBoxSet(0) , pHistory(0) - , nFmtIdx(css::util::NumberFormat::TEXT) - , nNewFmtIdx(0) + , nFormatIdx(css::util::NumberFormat::TEXT) + , nNewFormatIdx(0) , fNum(0.0) , fNewNum(0.0) - , bNewFmt(false) - , bNewFml(false) + , bNewFormat(false) + , bNewFormula(false) , bNewValue(false) { nNode = rBox.GetSttIdx(); - nNdPos = rBox.IsValidNumTxtNd( 0 == pNewSet ); - SwDoc* pDoc = rBox.GetFrmFmt()->GetDoc(); + nNdPos = rBox.IsValidNumTextNd( 0 == pNewSet ); + SwDoc* pDoc = rBox.GetFrameFormat()->GetDoc(); if( ULONG_MAX != nNdPos ) { - SwTxtNode* pTNd = pDoc->GetNodes()[ nNdPos ]->GetTxtNode(); + SwTextNode* pTNd = pDoc->GetNodes()[ nNdPos ]->GetTextNode(); pHistory = new SwHistory; SwRegHistory aRHst( *rBox.GetSttNd(), pHistory ); // always save all text atttibutes because of possibly overlapping // areas of on/off pHistory->CopyAttr( pTNd->GetpSwpHints(), nNdPos, 0, - pTNd->GetTxt().getLength(), true ); + pTNd->GetText().getLength(), true ); if( pTNd->HasSwAttrSet() ) - pHistory->CopyFmtAttr( *pTNd->GetpSwAttrSet(), nNdPos ); + pHistory->CopyFormatAttr( *pTNd->GetpSwAttrSet(), nNdPos ); - aStr = pTNd->GetTxt(); + aStr = pTNd->GetText(); if( pTNd->GetpSwpHints() ) pTNd->GetpSwpHints()->DeRegister(); } pBoxSet = new SfxItemSet( pDoc->GetAttrPool(), aTableBoxSetRange ); - pBoxSet->Put( rBox.GetFrmFmt()->GetAttrSet() ); + pBoxSet->Put( rBox.GetFrameFormat()->GetAttrSet() ); if( pNewSet ) { @@ -2182,20 +2182,20 @@ SwUndoTblNumFmt::SwUndoTblNumFmt( const SwTableBox& rBox, if( SfxItemState::SET == pNewSet->GetItemState( RES_BOXATR_FORMAT, false, &pItem )) { - bNewFmt = true; - nNewFmtIdx = static_cast<const SwTblBoxNumFormat*>(pItem)->GetValue(); + bNewFormat = true; + nNewFormatIdx = static_cast<const SwTableBoxNumFormat*>(pItem)->GetValue(); } if( SfxItemState::SET == pNewSet->GetItemState( RES_BOXATR_FORMULA, false, &pItem )) { - bNewFml = true; - aNewFml = static_cast<const SwTblBoxFormula*>(pItem)->GetFormula(); + bNewFormula = true; + aNewFormula = static_cast<const SwTableBoxFormula*>(pItem)->GetFormula(); } if( SfxItemState::SET == pNewSet->GetItemState( RES_BOXATR_VALUE, false, &pItem )) { bNewValue = true; - fNewNum = static_cast<const SwTblBoxValue*>(pItem)->GetValue(); + fNewNum = static_cast<const SwTableBoxValue*>(pItem)->GetValue(); } } @@ -2204,13 +2204,13 @@ SwUndoTblNumFmt::SwUndoTblNumFmt( const SwTableBox& rBox, DELETEZ( pHistory ); } -SwUndoTblNumFmt::~SwUndoTblNumFmt() +SwUndoTableNumFormat::~SwUndoTableNumFormat() { delete pHistory; delete pBoxSet; } -void SwUndoTblNumFmt::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableNumFormat::UndoImpl(::sw::UndoRedoContext & rContext) { OSL_ENSURE( pBoxSet, "Where's the stored item set?" ); @@ -2218,37 +2218,37 @@ void SwUndoTblNumFmt::UndoImpl(::sw::UndoRedoContext & rContext) SwStartNode* pSttNd = rDoc.GetNodes()[ nNode ]-> FindSttNodeByType( SwTableBoxStartNode ); OSL_ENSURE( pSttNd, "without StartNode no TableBox" ); - SwTableBox* pBox = pSttNd->FindTableNode()->GetTable().GetTblBox( + SwTableBox* pBox = pSttNd->FindTableNode()->GetTable().GetTableBox( pSttNd->GetIndex() ); OSL_ENSURE( pBox, "found no TableBox" ); - SwTableBoxFmt* pFmt = rDoc.MakeTableBoxFmt(); - pFmt->SetFmtAttr( *pBoxSet ); - pBox->ChgFrmFmt( pFmt ); + SwTableBoxFormat* pFormat = rDoc.MakeTableBoxFormat(); + pFormat->SetFormatAttr( *pBoxSet ); + pBox->ChgFrameFormat( pFormat ); if( ULONG_MAX == nNdPos ) return; - SwTxtNode* pTxtNd = rDoc.GetNodes()[ nNdPos ]->GetTxtNode(); + SwTextNode* pTextNd = rDoc.GetNodes()[ nNdPos ]->GetTextNode(); // If more than one node was deleted than all "node" attributes were also // saved - if( pTxtNd->HasSwAttrSet() ) - pTxtNd->ResetAllAttr(); + if( pTextNd->HasSwAttrSet() ) + pTextNd->ResetAllAttr(); - if( pTxtNd->GetpSwpHints() && !aStr.isEmpty() ) - pTxtNd->ClearSwpHintsArr( true ); + if( pTextNd->GetpSwpHints() && !aStr.isEmpty() ) + pTextNd->ClearSwpHintsArr( true ); // ChgTextToNum(..) only acts when the strings are different. We need to do // the same here. - if( pTxtNd->GetTxt() != aStr ) + if( pTextNd->GetText() != aStr ) { rDoc.getIDocumentRedlineAccess().DeleteRedline( *( pBox->GetSttNd() ), false, USHRT_MAX ); - SwIndex aIdx( pTxtNd, 0 ); + SwIndex aIdx( pTextNd, 0 ); if( !aStr.isEmpty() ) { - pTxtNd->EraseText( aIdx ); - pTxtNd->InsertText( aStr, aIdx, + pTextNd->EraseText( aIdx ); + pTextNd->InsertText( aStr, aIdx, SwInsertFlags::NOHINTEXPAND ); } } @@ -2263,7 +2263,7 @@ void SwUndoTblNumFmt::UndoImpl(::sw::UndoRedoContext & rContext) SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor()); pPam->DeleteMark(); pPam->GetPoint()->nNode = nNode + 1; - pPam->GetPoint()->nContent.Assign( pTxtNd, 0 ); + pPam->GetPoint()->nContent.Assign( pTextNd, 0 ); } /** switch the RedlineMode on the given document, using @@ -2301,7 +2301,7 @@ RedlineModeInternGuard::~RedlineModeInternGuard() mrDoc.getIDocumentRedlineAccess().SetRedlineMode_intern( meOldRedlineMode ); } -void SwUndoTblNumFmt::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableNumFormat::RedoImpl(::sw::UndoRedoContext & rContext) { // Could the box be changed? if( !pBoxSet ) @@ -2316,59 +2316,59 @@ void SwUndoTblNumFmt::RedoImpl(::sw::UndoRedoContext & rContext) SwNode * pNd = & pPam->GetPoint()->nNode.GetNode(); SwStartNode* pSttNd = pNd->FindSttNodeByType( SwTableBoxStartNode ); assert(pSttNd && "without StartNode no TableBox"); - SwTableBox* pBox = pSttNd->FindTableNode()->GetTable().GetTblBox( + SwTableBox* pBox = pSttNd->FindTableNode()->GetTable().GetTableBox( pSttNd->GetIndex() ); OSL_ENSURE( pBox, "found no TableBox" ); - SwFrmFmt* pBoxFmt = pBox->ClaimFrmFmt(); - if( bNewFmt || bNewFml || bNewValue ) + SwFrameFormat* pBoxFormat = pBox->ClaimFrameFormat(); + if( bNewFormat || bNewFormula || bNewValue ) { SfxItemSet aBoxSet( rDoc.GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); // Resetting attributes is not enough. In addition, take care that the // text will be also formatted correctly. - pBoxFmt->LockModify(); + pBoxFormat->LockModify(); - if( bNewFml ) - aBoxSet.Put( SwTblBoxFormula( aNewFml )); + if( bNewFormula ) + aBoxSet.Put( SwTableBoxFormula( aNewFormula )); else - pBoxFmt->ResetFmtAttr( RES_BOXATR_FORMULA ); - if( bNewFmt ) - aBoxSet.Put( SwTblBoxNumFormat( nNewFmtIdx )); + pBoxFormat->ResetFormatAttr( RES_BOXATR_FORMULA ); + if( bNewFormat ) + aBoxSet.Put( SwTableBoxNumFormat( nNewFormatIdx )); else - pBoxFmt->ResetFmtAttr( RES_BOXATR_FORMAT ); + pBoxFormat->ResetFormatAttr( RES_BOXATR_FORMAT ); if( bNewValue ) - aBoxSet.Put( SwTblBoxValue( fNewNum )); + aBoxSet.Put( SwTableBoxValue( fNewNum )); else - pBoxFmt->ResetFmtAttr( RES_BOXATR_VALUE ); - pBoxFmt->UnlockModify(); + pBoxFormat->ResetFormatAttr( RES_BOXATR_VALUE ); + pBoxFormat->UnlockModify(); // dvo: When redlining is (was) enabled, setting the attribute // will also change the cell content. To allow this, the // REDLINE_IGNORE flag must be removed during Redo. #108450# RedlineModeInternGuard aGuard( rDoc, nsRedlineMode_t::REDLINE_NONE, nsRedlineMode_t::REDLINE_IGNORE ); - pBoxFmt->SetFmtAttr( aBoxSet ); + pBoxFormat->SetFormatAttr( aBoxSet ); } - else if( css::util::NumberFormat::TEXT != static_cast<sal_Int16>(nFmtIdx) ) + else if( css::util::NumberFormat::TEXT != static_cast<sal_Int16>(nFormatIdx) ) { SfxItemSet aBoxSet( rDoc.GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); - aBoxSet.Put( SwTblBoxNumFormat( nFmtIdx )); - aBoxSet.Put( SwTblBoxValue( fNum )); + aBoxSet.Put( SwTableBoxNumFormat( nFormatIdx )); + aBoxSet.Put( SwTableBoxValue( fNum )); // Resetting attributes is not enough. In addition, take care that the // text will be also formatted correctly. - pBoxFmt->LockModify(); - pBoxFmt->ResetFmtAttr( RES_BOXATR_FORMULA ); - pBoxFmt->UnlockModify(); + pBoxFormat->LockModify(); + pBoxFormat->ResetFormatAttr( RES_BOXATR_FORMULA ); + pBoxFormat->UnlockModify(); // dvo: When redlining is (was) enabled, setting the attribute // will also change the cell content. To allow this, the // REDLINE_IGNORE flag must be removed during Redo. #108450# RedlineModeInternGuard aGuard( rDoc, nsRedlineMode_t::REDLINE_NONE, nsRedlineMode_t::REDLINE_IGNORE ); - pBoxFmt->SetFmtAttr( aBoxSet ); + pBoxFormat->SetFormatAttr( aBoxSet ); } else { @@ -2376,70 +2376,70 @@ void SwUndoTblNumFmt::RedoImpl(::sw::UndoRedoContext & rContext) // Resetting attributes is not enough. In addition, take care that the // text will be also formatted correctly. - pBoxFmt->SetFmtAttr( *GetDfltAttr( RES_BOXATR_FORMAT )); + pBoxFormat->SetFormatAttr( *GetDfltAttr( RES_BOXATR_FORMAT )); - pBoxFmt->ResetFmtAttr( RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); + pBoxFormat->ResetFormatAttr( RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); } - if( bNewFml ) + if( bNewFormula ) { // No matter what was set, an update of the table is always a good idea - SwTableFmlUpdate aTblUpdate( &pSttNd->FindTableNode()->GetTable() ); - rDoc.getIDocumentFieldsAccess().UpdateTblFlds( &aTblUpdate ); + SwTableFormulaUpdate aTableUpdate( &pSttNd->FindTableNode()->GetTable() ); + rDoc.getIDocumentFieldsAccess().UpdateTableFields( &aTableUpdate ); } - if( !pNd->IsCntntNode() ) + if( !pNd->IsContentNode() ) pNd = rDoc.GetNodes().GoNext( &pPam->GetPoint()->nNode ); - pPam->GetPoint()->nContent.Assign( static_cast<SwCntntNode*>(pNd), 0 ); + pPam->GetPoint()->nContent.Assign( static_cast<SwContentNode*>(pNd), 0 ); } -void SwUndoTblNumFmt::SetBox( const SwTableBox& rBox ) +void SwUndoTableNumFormat::SetBox( const SwTableBox& rBox ) { nNode = rBox.GetSttIdx(); } -_UndoTblCpyTbl_Entry::_UndoTblCpyTbl_Entry( const SwTableBox& rBox ) +_UndoTableCpyTable_Entry::_UndoTableCpyTable_Entry( const SwTableBox& rBox ) : nBoxIdx( rBox.GetSttIdx() ), nOffset( 0 ), pBoxNumAttr( 0 ), pUndo( 0 ), bJoin( false ) { } -_UndoTblCpyTbl_Entry::~_UndoTblCpyTbl_Entry() +_UndoTableCpyTable_Entry::~_UndoTableCpyTable_Entry() { delete pUndo; delete pBoxNumAttr; } -SwUndoTblCpyTbl::SwUndoTblCpyTbl() +SwUndoTableCpyTable::SwUndoTableCpyTable() : SwUndo( UNDO_TBLCPYTBL ), pInsRowUndo( 0 ) { - pArr = new _UndoTblCpyTbl_Entries; + pArr = new _UndoTableCpyTable_Entries; } -SwUndoTblCpyTbl::~SwUndoTblCpyTbl() +SwUndoTableCpyTable::~SwUndoTableCpyTable() { delete pArr; delete pInsRowUndo; } -void SwUndoTblCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableCpyTable::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); _DEBUG_REDLINE( &rDoc ) - SwTableNode* pTblNd = 0; + SwTableNode* pTableNd = 0; for( size_t n = pArr->size(); n; ) { - _UndoTblCpyTbl_Entry* pEntry = &(*pArr)[ --n ]; + _UndoTableCpyTable_Entry* pEntry = &(*pArr)[ --n ]; sal_uLong nSttPos = pEntry->nBoxIdx + pEntry->nOffset; SwStartNode* pSNd = rDoc.GetNodes()[ nSttPos ]->StartOfSectionNode(); - if( !pTblNd ) - pTblNd = pSNd->FindTableNode(); + if( !pTableNd ) + pTableNd = pSNd->FindTableNode(); - SwTableBox& rBox = *pTblNd->GetTable().GetTblBox( nSttPos ); + SwTableBox& rBox = *pTableNd->GetTable().GetTableBox( nSttPos ); SwNodeIndex aInsIdx( *rBox.GetSttNd(), 1 ); - rDoc.GetNodes().MakeTxtNode( aInsIdx, rDoc.GetDfltTxtFmtColl() ); + rDoc.GetNodes().MakeTextNode( aInsIdx, rDoc.GetDfltTextFormatColl() ); // b62341295: Redline for copying tables const SwNode *pEndNode = rBox.GetSttNd()->EndOfSectionNode(); @@ -2465,11 +2465,11 @@ void SwUndoTblCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext) // Set aTmpIdx to the beginning fo the old content SwNodeIndex aTmpIdx( *pEndNode, pUndoRedlineDelete->NodeDiff()-1 ); - SwTxtNode *pTxt = aTmpIdx.GetNode().GetTxtNode(); - if( pTxt ) + SwTextNode *pText = aTmpIdx.GetNode().GetTextNode(); + if( pText ) { - aPam.GetPoint()->nNode = *pTxt; - aPam.GetPoint()->nContent.Assign( pTxt, + aPam.GetPoint()->nNode = *pText; + aPam.GetPoint()->nContent.Assign( pText, pUndoRedlineDelete->ContentStart() ); } else @@ -2485,11 +2485,11 @@ void SwUndoTblCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext) bDeleteCompleteParagraph = true; bShiftPam = true; SwNodeIndex aTmpIdx( *pEndNode, -1 ); - SwTxtNode *pTxt = aTmpIdx.GetNode().GetTxtNode(); - if( pTxt ) + SwTextNode *pText = aTmpIdx.GetNode().GetTextNode(); + if( pText ) { - aPam.GetPoint()->nNode = *pTxt; - aPam.GetPoint()->nContent.Assign( pTxt, 0 ); + aPam.GetPoint()->nNode = *pText; + aPam.GetPoint()->nContent.Assign( pText, 0 ); } else *aPam.GetPoint() = SwPosition( aTmpIdx ); @@ -2508,11 +2508,11 @@ void SwUndoTblCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext) // The aPam.Point is at the moment at the last position of the new content and has to be // moved to the first position of the old content for the SwUndoDelete operation SwNodeIndex aTmpIdx( aPam.GetPoint()->nNode, 1 ); - SwTxtNode *pTxt = aTmpIdx.GetNode().GetTxtNode(); - if( pTxt ) + SwTextNode *pText = aTmpIdx.GetNode().GetTextNode(); + if( pText ) { - aPam.GetPoint()->nNode = *pTxt; - aPam.GetPoint()->nContent.Assign( pTxt, 0 ); + aPam.GetPoint()->nNode = *pText; + aPam.GetPoint()->nContent.Assign( pText, 0 ); } else *aPam.GetPoint() = SwPosition( aTmpIdx ); @@ -2536,17 +2536,17 @@ void SwUndoTblCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext) SfxItemSet aTmpSet( rDoc.GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE, RES_VERT_ORIENT, RES_VERT_ORIENT, 0 ); - aTmpSet.Put( rBox.GetFrmFmt()->GetAttrSet() ); + aTmpSet.Put( rBox.GetFrameFormat()->GetAttrSet() ); if( aTmpSet.Count() ) { - SwFrmFmt* pBoxFmt = rBox.ClaimFrmFmt(); - pBoxFmt->ResetFmtAttr( RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); - pBoxFmt->ResetFmtAttr( RES_VERT_ORIENT ); + SwFrameFormat* pBoxFormat = rBox.ClaimFrameFormat(); + pBoxFormat->ResetFormatAttr( RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); + pBoxFormat->ResetFormatAttr( RES_VERT_ORIENT ); } if( pEntry->pBoxNumAttr ) { - rBox.ClaimFrmFmt()->SetFmtAttr( *pEntry->pBoxNumAttr ); + rBox.ClaimFrameFormat()->SetFormatAttr( *pEntry->pBoxNumAttr ); delete pEntry->pBoxNumAttr, pEntry->pBoxNumAttr = 0; } @@ -2568,7 +2568,7 @@ void SwUndoTblCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext) _DEBUG_REDLINE( &rDoc ) } -void SwUndoTblCpyTbl::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoTableCpyTable::RedoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); _DEBUG_REDLINE( &rDoc ) @@ -2578,21 +2578,21 @@ void SwUndoTblCpyTbl::RedoImpl(::sw::UndoRedoContext & rContext) pInsRowUndo->RedoImpl(rContext); } - SwTableNode* pTblNd = 0; + SwTableNode* pTableNd = 0; for( size_t n = 0; n < pArr->size(); ++n ) { - _UndoTblCpyTbl_Entry* pEntry = &(*pArr)[ n ]; + _UndoTableCpyTable_Entry* pEntry = &(*pArr)[ n ]; sal_uLong nSttPos = pEntry->nBoxIdx + pEntry->nOffset; SwStartNode* pSNd = rDoc.GetNodes()[ nSttPos ]->StartOfSectionNode(); - if( !pTblNd ) - pTblNd = pSNd->FindTableNode(); + if( !pTableNd ) + pTableNd = pSNd->FindTableNode(); - SwTableBox& rBox = *pTblNd->GetTable().GetTblBox( nSttPos ); + SwTableBox& rBox = *pTableNd->GetTable().GetTableBox( nSttPos ); SwNodeIndex aInsIdx( *rBox.GetSttNd(), 1 ); // b62341295: Redline for copying tables - Start. - rDoc.GetNodes().MakeTxtNode( aInsIdx, rDoc.GetDfltTxtFmtColl() ); + rDoc.GetNodes().MakeTextNode( aInsIdx, rDoc.GetDfltTextFormatColl() ); SwPaM aPam( aInsIdx.GetNode(), *rBox.GetSttNd()->EndOfSectionNode()); SwUndo* pUndo = IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) ? 0 : new SwUndoDelete( aPam, true ); if( pEntry->pUndo ) @@ -2628,16 +2628,16 @@ void SwUndoTblCpyTbl::RedoImpl(::sw::UndoRedoContext & rContext) SfxItemSet aTmpSet( rDoc.GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE, RES_VERT_ORIENT, RES_VERT_ORIENT, 0 ); - aTmpSet.Put( rBox.GetFrmFmt()->GetAttrSet() ); + aTmpSet.Put( rBox.GetFrameFormat()->GetAttrSet() ); if( aTmpSet.Count() ) { - SwFrmFmt* pBoxFmt = rBox.ClaimFrmFmt(); - pBoxFmt->ResetFmtAttr( RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); - pBoxFmt->ResetFmtAttr( RES_VERT_ORIENT ); + SwFrameFormat* pBoxFormat = rBox.ClaimFrameFormat(); + pBoxFormat->ResetFormatAttr( RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); + pBoxFormat->ResetFormatAttr( RES_VERT_ORIENT ); } if( pEntry->pBoxNumAttr ) { - rBox.ClaimFrmFmt()->SetFmtAttr( *pEntry->pBoxNumAttr ); + rBox.ClaimFrameFormat()->SetFormatAttr( *pEntry->pBoxNumAttr ); delete pEntry->pBoxNumAttr, pEntry->pBoxNumAttr = 0; } @@ -2654,20 +2654,20 @@ void SwUndoTblCpyTbl::RedoImpl(::sw::UndoRedoContext & rContext) _DEBUG_REDLINE( &rDoc ) } -void SwUndoTblCpyTbl::AddBoxBefore( const SwTableBox& rBox, bool bDelCntnt ) +void SwUndoTableCpyTable::AddBoxBefore( const SwTableBox& rBox, bool bDelContent ) { - if( !pArr->empty() && !bDelCntnt ) + if( !pArr->empty() && !bDelContent ) return; - _UndoTblCpyTbl_Entry* pEntry = new _UndoTblCpyTbl_Entry( rBox ); + _UndoTableCpyTable_Entry* pEntry = new _UndoTableCpyTable_Entry( rBox ); pArr->push_back( pEntry ); - SwDoc* pDoc = rBox.GetFrmFmt()->GetDoc(); + SwDoc* pDoc = rBox.GetFrameFormat()->GetDoc(); _DEBUG_REDLINE( pDoc ) - if( bDelCntnt ) + if( bDelContent ) { SwNodeIndex aInsIdx( *rBox.GetSttNd(), 1 ); - pDoc->GetNodes().MakeTxtNode( aInsIdx, pDoc->GetDfltTxtFmtColl() ); + pDoc->GetNodes().MakeTextNode( aInsIdx, pDoc->GetDfltTextFormatColl() ); SwPaM aPam( aInsIdx.GetNode(), *rBox.GetSttNd()->EndOfSectionNode() ); if( !pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) @@ -2677,20 +2677,20 @@ void SwUndoTblCpyTbl::AddBoxBefore( const SwTableBox& rBox, bool bDelCntnt ) pEntry->pBoxNumAttr = new SfxItemSet( pDoc->GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE, RES_VERT_ORIENT, RES_VERT_ORIENT, 0 ); - pEntry->pBoxNumAttr->Put( rBox.GetFrmFmt()->GetAttrSet() ); + pEntry->pBoxNumAttr->Put( rBox.GetFrameFormat()->GetAttrSet() ); if( !pEntry->pBoxNumAttr->Count() ) delete pEntry->pBoxNumAttr, pEntry->pBoxNumAttr = 0; _DEBUG_REDLINE( pDoc ) } -void SwUndoTblCpyTbl::AddBoxAfter( const SwTableBox& rBox, const SwNodeIndex& rIdx, bool bDelCntnt ) +void SwUndoTableCpyTable::AddBoxAfter( const SwTableBox& rBox, const SwNodeIndex& rIdx, bool bDelContent ) { - _UndoTblCpyTbl_Entry* pEntry = &(*pArr).back(); + _UndoTableCpyTable_Entry* pEntry = &(*pArr).back(); // If the content was deleted than remove also the temporarily created node - if( bDelCntnt ) + if( bDelContent ) { - SwDoc* pDoc = rBox.GetFrmFmt()->GetDoc(); + SwDoc* pDoc = rBox.GetFrameFormat()->GetDoc(); _DEBUG_REDLINE( pDoc ) if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) @@ -2699,7 +2699,7 @@ void SwUndoTblCpyTbl::AddBoxAfter( const SwTableBox& rBox, const SwNodeIndex& rI pEntry->pUndo = PrepareRedline( pDoc, rBox, aTmpPos, pEntry->bJoin, false ); } SwNodeIndex aDelIdx( *rBox.GetSttNd(), 1 ); - rBox.GetFrmFmt()->GetDoc()->GetNodes().Delete( aDelIdx, 1 ); + rBox.GetFrameFormat()->GetDoc()->GetNodes().Delete( aDelIdx, 1 ); _DEBUG_REDLINE( pDoc ) } @@ -2712,7 +2712,7 @@ void SwUndoTblCpyTbl::AddBoxAfter( const SwTableBox& rBox, const SwNodeIndex& rI // been merged. // rJoin is true if Redo() is calling and the content has already been merged -SwUndo* SwUndoTblCpyTbl::PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox, +SwUndo* SwUndoTableCpyTable::PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox, const SwPosition& rPos, bool& rJoin, bool bRedo ) { SwUndo *pUndo = 0; @@ -2725,20 +2725,20 @@ SwUndo* SwUndoTblCpyTbl::PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox, pDoc->getIDocumentRedlineAccess().SetRedlineMode_intern((RedlineMode_t)( ( eOld | nsRedlineMode_t::REDLINE_DONTCOMBINE_REDLINES ) & ~nsRedlineMode_t::REDLINE_IGNORE )); SwPosition aInsertEnd( rPos ); - SwTxtNode* pTxt; + SwTextNode* pText; if( !rJoin ) { // If the content is not merged, the end of the insertion is at the end of the node // _before_ the given position rPos --aInsertEnd.nNode; - pTxt = aInsertEnd.nNode.GetNode().GetTxtNode(); - if( pTxt ) + pText = aInsertEnd.nNode.GetNode().GetTextNode(); + if( pText ) { - aInsertEnd.nContent.Assign(pTxt, pTxt->GetTxt().getLength()); - if( !bRedo && rPos.nNode.GetNode().GetTxtNode() ) + aInsertEnd.nContent.Assign(pText, pText->GetText().getLength()); + if( !bRedo && rPos.nNode.GetNode().GetTextNode() ) { // Try to merge, if not called by Redo() rJoin = true; - pTxt->JoinNext(); + pText->JoinNext(); } } else @@ -2749,14 +2749,14 @@ SwUndo* SwUndoTblCpyTbl::PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox, SwPosition aDeleteStart( rJoin ? aInsertEnd : rPos ); if( !rJoin ) { - pTxt = aDeleteStart.nNode.GetNode().GetTxtNode(); - if( pTxt ) - aDeleteStart.nContent.Assign( pTxt, 0 ); + pText = aDeleteStart.nNode.GetNode().GetTextNode(); + if( pText ) + aDeleteStart.nContent.Assign( pText, 0 ); } SwPosition aCellEnd( SwNodeIndex( *rBox.GetSttNd()->EndOfSectionNode(), -1 ) ); - pTxt = aCellEnd.nNode.GetNode().GetTxtNode(); - if( pTxt ) - aCellEnd.nContent.Assign(pTxt, pTxt->GetTxt().getLength()); + pText = aCellEnd.nNode.GetNode().GetTextNode(); + if( pText ) + aCellEnd.nContent.Assign(pText, pText->GetText().getLength()); if( aDeleteStart != aCellEnd ) { // If the old (deleted) part is not empty, here we are... SwPaM aDeletePam( aDeleteStart, aCellEnd ); @@ -2771,9 +2771,9 @@ SwUndo* SwUndoTblCpyTbl::PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox, pUndo = new SwUndoDelete( aTmpPam, true ); } SwPosition aCellStart( SwNodeIndex( *rBox.GetSttNd(), 2 ) ); - pTxt = aCellStart.nNode.GetNode().GetTxtNode(); - if( pTxt ) - aCellStart.nContent.Assign( pTxt, 0 ); + pText = aCellStart.nNode.GetNode().GetTextNode(); + if( pText ) + aCellStart.nContent.Assign( pText, 0 ); if( aCellStart != aInsertEnd ) // An empty insertion will not been marked { SwPaM aTmpPam( aCellStart, aInsertEnd ); @@ -2784,56 +2784,56 @@ SwUndo* SwUndoTblCpyTbl::PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox, return pUndo; } -bool SwUndoTblCpyTbl::InsertRow( SwTable& rTbl, const SwSelBoxes& rBoxes, +bool SwUndoTableCpyTable::InsertRow( SwTable& rTable, const SwSelBoxes& rBoxes, sal_uInt16 nCnt ) { - SwTableNode* pTblNd = const_cast<SwTableNode*>(rTbl.GetTabSortBoxes()[0]-> + SwTableNode* pTableNd = const_cast<SwTableNode*>(rTable.GetTabSortBoxes()[0]-> GetSttNd()->FindTableNode()); - pInsRowUndo = new SwUndoTblNdsChg( UNDO_TABLE_INSROW, rBoxes, *pTblNd, + pInsRowUndo = new SwUndoTableNdsChg( UNDO_TABLE_INSROW, rBoxes, *pTableNd, 0, 0, nCnt, true, false ); - SwTableSortBoxes aTmpLst( rTbl.GetTabSortBoxes() ); + SwTableSortBoxes aTmpLst( rTable.GetTabSortBoxes() ); - bool bRet = rTbl.InsertRow( rTbl.GetFrmFmt()->GetDoc(), rBoxes, nCnt, true ); + bool bRet = rTable.InsertRow( rTable.GetFrameFormat()->GetDoc(), rBoxes, nCnt, true ); if( bRet ) - pInsRowUndo->SaveNewBoxes( *pTblNd, aTmpLst ); + pInsRowUndo->SaveNewBoxes( *pTableNd, aTmpLst ); else delete pInsRowUndo, pInsRowUndo = 0; return bRet; } -bool SwUndoTblCpyTbl::IsEmpty() const +bool SwUndoTableCpyTable::IsEmpty() const { return !pInsRowUndo && pArr->empty(); } -SwUndoCpyTbl::SwUndoCpyTbl() - : SwUndo( UNDO_CPYTBL ), pDel( 0 ), nTblNode( 0 ) +SwUndoCpyTable::SwUndoCpyTable() + : SwUndo( UNDO_CPYTBL ), pDel( 0 ), nTableNode( 0 ) { } -SwUndoCpyTbl::~SwUndoCpyTbl() +SwUndoCpyTable::~SwUndoCpyTable() { delete pDel; } -void SwUndoCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoCpyTable::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - SwTableNode* pTNd = rDoc.GetNodes()[ nTblNode ]->GetTableNode(); + SwTableNode* pTNd = rDoc.GetNodes()[ nTableNode ]->GetTableNode(); // move hard page breaks into next node - SwCntntNode* pNextNd = rDoc.GetNodes()[ pTNd->EndOfSectionIndex()+1 ]->GetCntntNode(); + SwContentNode* pNextNd = rDoc.GetNodes()[ pTNd->EndOfSectionIndex()+1 ]->GetContentNode(); if( pNextNd ) { - SwFrmFmt* pTableFmt = pTNd->GetTable().GetFrmFmt(); + SwFrameFormat* pTableFormat = pTNd->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 ); } @@ -2842,17 +2842,17 @@ void SwUndoCpyTbl::UndoImpl(::sw::UndoRedoContext & rContext) pDel = new SwUndoDelete( aPam, true ); } -void SwUndoCpyTbl::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoCpyTable::RedoImpl(::sw::UndoRedoContext & rContext) { pDel->UndoImpl(rContext); delete pDel, pDel = 0; } -SwUndoSplitTbl::SwUndoSplitTbl( const SwTableNode& rTblNd, +SwUndoSplitTable::SwUndoSplitTable( const SwTableNode& rTableNd, SwSaveRowSpan* pRowSp, sal_uInt16 eMode, bool bNewSize ) : SwUndo( UNDO_SPLIT_TABLE ), - nTblNode( rTblNd.GetIndex() ), nOffset( 0 ), mpSaveRowSpan( pRowSp ), pSavTbl( 0 ), - pHistory( 0 ), nMode( eMode ), nFmlEnd( 0 ), bCalcNewSize( bNewSize ) + nTableNode( rTableNd.GetIndex() ), nOffset( 0 ), mpSaveRowSpan( pRowSp ), pSavTable( 0 ), + pHistory( 0 ), nMode( eMode ), nFormulaEnd( 0 ), bCalcNewSize( bNewSize ) { switch( nMode ) { @@ -2861,34 +2861,34 @@ SwUndoSplitTbl::SwUndoSplitTbl( const SwTableNode& rTblNd, // no break case HEADLINE_BORDERCOPY: case HEADLINE_BOXATTRCOPY: - pSavTbl = new _SaveTable( rTblNd.GetTable(), 1, false ); + pSavTable = new _SaveTable( rTableNd.GetTable(), 1, false ); break; } } -SwUndoSplitTbl::~SwUndoSplitTbl() +SwUndoSplitTable::~SwUndoSplitTable() { - delete pSavTbl; + delete pSavTable; delete pHistory; delete mpSaveRowSpan; } -void SwUndoSplitTbl::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoSplitTable::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc *const pDoc = & rContext.GetDoc(); SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor()); SwNodeIndex& rIdx = pPam->GetPoint()->nNode; - rIdx = nTblNode + nOffset; - pPam->GetPoint()->nContent.Assign(rIdx.GetNode().GetCntntNode(), 0); - assert(rIdx.GetNode().GetCntntNode()->Len() == 0); // empty para inserted + rIdx = nTableNode + nOffset; + pPam->GetPoint()->nContent.Assign(rIdx.GetNode().GetContentNode(), 0); + assert(rIdx.GetNode().GetContentNode()->Len() == 0); // empty para inserted { // avoid asserts from ~SwIndexReg - SwNodeIndex const idx(pDoc->GetNodes(), nTblNode + nOffset); + SwNodeIndex const idx(pDoc->GetNodes(), nTableNode + nOffset); { SwPaM pam(idx); - pam.Move(fnMoveBackward, fnGoCntnt); + pam.Move(fnMoveBackward, fnGoContent); ::PaMCorrAbs(*pPam, *pam.GetPoint()); } @@ -2896,25 +2896,25 @@ void SwUndoSplitTbl::UndoImpl(::sw::UndoRedoContext & rContext) pDoc->GetNodes().Delete( idx, 1 ); } - rIdx = nTblNode + nOffset; - SwTableNode* pTblNd = rIdx.GetNode().GetTableNode(); - SwTable& rTbl = pTblNd->GetTable(); + rIdx = nTableNode + nOffset; + SwTableNode* pTableNd = rIdx.GetNode().GetTableNode(); + SwTable& rTable = pTableNd->GetTable(); - SwTableFmlUpdate aMsgHnt( &rTbl ); - aMsgHnt.eFlags = TBL_BOXPTR; - pDoc->getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint( &rTable ); + aMsgHint.eFlags = TBL_BOXPTR; + pDoc->getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); switch( nMode ) { case HEADLINE_BOXATRCOLLCOPY: if( pHistory ) - pHistory->TmpRollback( pDoc, nFmlEnd ); + pHistory->TmpRollback( pDoc, nFormulaEnd ); // no break case HEADLINE_BOXATTRCOPY: case HEADLINE_BORDERCOPY: { - pSavTbl->CreateNew( rTbl, false ); - pSavTbl->RestoreAttr( rTbl ); + pSavTable->CreateNew( rTable, false ); + pSavTable->RestoreAttr( rTable ); } break; @@ -2922,12 +2922,12 @@ void SwUndoSplitTbl::UndoImpl(::sw::UndoRedoContext & rContext) // the created first line has to be removed again { SwSelBoxes aSelBoxes; - SwTableBox* pBox = rTbl.GetTblBox( nTblNode + nOffset + 1 ); + SwTableBox* pBox = rTable.GetTableBox( nTableNode + nOffset + 1 ); SwTable::SelLineFromBox( pBox, aSelBoxes, true ); _FndBox aTmpBox( 0, 0 ); - aTmpBox.SetTableLines( aSelBoxes, rTbl ); - aTmpBox.DelFrms( rTbl ); - rTbl.DeleteSel( pDoc, aSelBoxes, 0, 0, false, false ); + aTmpBox.SetTableLines( aSelBoxes, rTable ); + aTmpBox.DelFrms( rTable ); + rTable.DeleteSel( pDoc, aSelBoxes, 0, 0, false, false ); } break; } @@ -2941,26 +2941,26 @@ void SwUndoSplitTbl::UndoImpl(::sw::UndoRedoContext & rContext) } if( mpSaveRowSpan ) { - pTblNd = rIdx.GetNode().FindTableNode(); - if( pTblNd ) - pTblNd->GetTable().RestoreRowSpan( *mpSaveRowSpan ); + pTableNd = rIdx.GetNode().FindTableNode(); + if( pTableNd ) + pTableNd->GetTable().RestoreRowSpan( *mpSaveRowSpan ); } ClearFEShellTabCols(); } -void SwUndoSplitTbl::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoSplitTable::RedoImpl(::sw::UndoRedoContext & rContext) { SwDoc *const pDoc = & rContext.GetDoc(); SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor()); pPam->DeleteMark(); - pPam->GetPoint()->nNode = nTblNode; + pPam->GetPoint()->nNode = nTableNode; pDoc->SplitTable( *pPam->GetPoint(), nMode, bCalcNewSize ); ClearFEShellTabCols(); } -void SwUndoSplitTbl::RepeatImpl(::sw::RepeatContext & rContext) +void SwUndoSplitTable::RepeatImpl(::sw::RepeatContext & rContext) { SwPaM *const pPam = & rContext.GetRepeatPaM(); SwDoc *const pDoc = & rContext.GetDoc(); @@ -2969,79 +2969,79 @@ void SwUndoSplitTbl::RepeatImpl(::sw::RepeatContext & rContext) ClearFEShellTabCols(); } -void SwUndoSplitTbl::SaveFormula( SwHistory& rHistory ) +void SwUndoSplitTable::SaveFormula( SwHistory& rHistory ) { if( !pHistory ) pHistory = new SwHistory; - nFmlEnd = rHistory.Count(); + nFormulaEnd = rHistory.Count(); pHistory->Move( 0, &rHistory ); } -SwUndoMergeTbl::SwUndoMergeTbl( const SwTableNode& rTblNd, - const SwTableNode& rDelTblNd, +SwUndoMergeTable::SwUndoMergeTable( const SwTableNode& rTableNd, + const SwTableNode& rDelTableNd, bool bWithPrv, sal_uInt16 nMd ) - : SwUndo( UNDO_MERGE_TABLE ), pSavTbl( 0 ), + : SwUndo( UNDO_MERGE_TABLE ), pSavTable( 0 ), pHistory( 0 ), nMode( nMd ), bWithPrev( bWithPrv ) { // memorize end node of the last table cell that'll stay in position if( bWithPrev ) - nTblNode = rDelTblNd.EndOfSectionIndex() - 1; + nTableNode = rDelTableNd.EndOfSectionIndex() - 1; else - nTblNode = rTblNd.EndOfSectionIndex() - 1; + nTableNode = rTableNd.EndOfSectionIndex() - 1; - aName = rDelTblNd.GetTable().GetFrmFmt()->GetName(); - pSavTbl = new _SaveTable( rDelTblNd.GetTable() ); + aName = rDelTableNd.GetTable().GetFrameFormat()->GetName(); + pSavTable = new _SaveTable( rDelTableNd.GetTable() ); - pSavHdl = bWithPrev ? new _SaveTable( rTblNd.GetTable(), 1 ) : 0; + pSavHdl = bWithPrev ? new _SaveTable( rTableNd.GetTable(), 1 ) : 0; } -SwUndoMergeTbl::~SwUndoMergeTbl() +SwUndoMergeTable::~SwUndoMergeTable() { - delete pSavTbl; + delete pSavTable; delete pSavHdl; delete pHistory; } -void SwUndoMergeTbl::UndoImpl(::sw::UndoRedoContext & rContext) +void SwUndoMergeTable::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc *const pDoc = & rContext.GetDoc(); SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor()); pPam->DeleteMark(); SwNodeIndex& rIdx = pPam->GetPoint()->nNode; - rIdx = nTblNode; + rIdx = nTableNode; - SwTableNode* pTblNd = rIdx.GetNode().FindTableNode(); - SwTable* pTbl = &pTblNd->GetTable(); + SwTableNode* pTableNd = rIdx.GetNode().FindTableNode(); + SwTable* pTable = &pTableNd->GetTable(); - SwTableFmlUpdate aMsgHnt( pTbl ); - aMsgHnt.eFlags = TBL_BOXPTR; - pDoc->getIDocumentFieldsAccess().UpdateTblFlds( &aMsgHnt ); + SwTableFormulaUpdate aMsgHint( pTable ); + aMsgHint.eFlags = TBL_BOXPTR; + pDoc->getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint ); // get lines for layout update _FndBox aFndBox( 0, 0 ); - aFndBox.SetTableLines( *pTbl ); - aFndBox.DelFrms( *pTbl ); + aFndBox.SetTableLines( *pTable ); + aFndBox.DelFrms( *pTable ); // ? TL_CHART2: notification or locking of controller required ? SwTableNode* pNew = pDoc->GetNodes().SplitTable( rIdx, true, false ); // update layout - aFndBox.MakeFrms( *pTbl ); + aFndBox.MakeFrms( *pTable ); // ? TL_CHART2: notification or locking of controller required ? if( bWithPrev ) { // move name - pNew->GetTable().GetFrmFmt()->SetName( pTbl->GetFrmFmt()->GetName() ); + pNew->GetTable().GetFrameFormat()->SetName( pTable->GetFrameFormat()->GetName() ); pSavHdl->RestoreAttr( pNew->GetTable() ); } else - pTbl = &pNew->GetTable(); + pTable = &pNew->GetTable(); - pTbl->GetFrmFmt()->SetName( aName ); - pSavTbl->RestoreAttr( *pTbl ); + pTable->GetFrameFormat()->SetName( aName ); + pSavTable->RestoreAttr( *pTable ); if( pHistory ) { @@ -3054,7 +3054,7 @@ void SwUndoMergeTbl::UndoImpl(::sw::UndoRedoContext & rContext) pNew->MakeFrms( &aTmpIdx ); // position cursor somewhere in content - SwCntntNode* pCNd = pDoc->GetNodes().GoNext( &rIdx ); + SwContentNode* pCNd = pDoc->GetNodes().GoNext( &rIdx ); pPam->GetPoint()->nContent.Assign( pCNd, 0 ); ClearFEShellTabCols(); @@ -3063,29 +3063,29 @@ void SwUndoMergeTbl::UndoImpl(::sw::UndoRedoContext & rContext) SwChartDataProvider *pPCD = pDoc->getIDocumentChartDataProviderAccess().GetChartDataProvider(); if (pPCD) { - pDoc->UpdateCharts( pTbl->GetFrmFmt()->GetName() ); - pDoc->UpdateCharts( pNew->GetTable().GetFrmFmt()->GetName() ); + pDoc->UpdateCharts( pTable->GetFrameFormat()->GetName() ); + pDoc->UpdateCharts( pNew->GetTable().GetFrameFormat()->GetName() ); } } -void SwUndoMergeTbl::RedoImpl(::sw::UndoRedoContext & rContext) +void SwUndoMergeTable::RedoImpl(::sw::UndoRedoContext & rContext) { SwDoc *const pDoc = & rContext.GetDoc(); SwPaM *const pPam(& rContext.GetCursorSupplier().CreateNewShellCursor()); pPam->DeleteMark(); - pPam->GetPoint()->nNode = nTblNode; + pPam->GetPoint()->nNode = nTableNode; if( bWithPrev ) - pPam->GetPoint()->nNode = nTblNode + 3; + pPam->GetPoint()->nNode = nTableNode + 3; else - pPam->GetPoint()->nNode = nTblNode; + pPam->GetPoint()->nNode = nTableNode; pDoc->MergeTable( *pPam->GetPoint(), bWithPrev, nMode ); ClearFEShellTabCols(); } -void SwUndoMergeTbl::RepeatImpl(::sw::RepeatContext & rContext) +void SwUndoMergeTable::RepeatImpl(::sw::RepeatContext & rContext) { SwDoc *const pDoc = & rContext.GetDoc(); SwPaM *const pPam = & rContext.GetRepeatPaM(); @@ -3094,7 +3094,7 @@ void SwUndoMergeTbl::RepeatImpl(::sw::RepeatContext & rContext) ClearFEShellTabCols(); } -void SwUndoMergeTbl::SaveFormula( SwHistory& rHistory ) +void SwUndoMergeTable::SaveFormula( SwHistory& rHistory ) { if( !pHistory ) pHistory = new SwHistory; @@ -3130,10 +3130,10 @@ void InsertSort( std::vector<sal_uInt16>& rArr, sal_uInt16 nIdx, sal_uInt16* pIn } #if OSL_DEBUG_LEVEL > 0 -void CheckTable( const SwTable& rTbl ) +void CheckTable( const SwTable& rTable ) { - const SwNodes& rNds = rTbl.GetFrmFmt()->GetDoc()->GetNodes(); - const SwTableSortBoxes& rSrtArr = rTbl.GetTabSortBoxes(); + const SwNodes& rNds = rTable.GetFrameFormat()->GetDoc()->GetNodes(); + const SwTableSortBoxes& rSrtArr = rTable.GetTabSortBoxes(); for (size_t n = 0; n < rSrtArr.size(); ++n) { const SwTableBox* pBox = rSrtArr[ n ]; diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index 01457c71ab30..d0148ef04277 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -34,36 +34,36 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam ) : SwUndo( nUndoId ), SwUndRng( rPam ), - pTxtFmtColl( 0 ), pLastNdColl(0), pFrmFmts( 0 ), pRedlData( 0 ), - bSttWasTxtNd( true ), nNdDiff( 0 ), nSetPos( 0 ) + pTextFormatColl( 0 ), pLastNdColl(0), pFrameFormats( 0 ), pRedlData( 0 ), + bSttWasTextNd( true ), nNdDiff( 0 ), nSetPos( 0 ) { pHistory = new SwHistory; SwDoc* pDoc = rPam.GetDoc(); - SwTxtNode* pTxtNd = rPam.GetPoint()->nNode.GetNode().GetTxtNode(); - if( pTxtNd ) + SwTextNode* pTextNd = rPam.GetPoint()->nNode.GetNode().GetTextNode(); + if( pTextNd ) { - pTxtFmtColl = pTxtNd->GetTxtColl(); - pHistory->CopyAttr( pTxtNd->GetpSwpHints(), nSttNode, - 0, pTxtNd->GetTxt().getLength(), false ); - if( pTxtNd->HasSwAttrSet() ) - pHistory->CopyFmtAttr( *pTxtNd->GetpSwAttrSet(), nSttNode ); + pTextFormatColl = pTextNd->GetTextColl(); + pHistory->CopyAttr( pTextNd->GetpSwpHints(), nSttNode, + 0, pTextNd->GetText().getLength(), false ); + if( pTextNd->HasSwAttrSet() ) + pHistory->CopyFormatAttr( *pTextNd->GetpSwAttrSet(), nSttNode ); - if( !nSttCntnt ) // than take the Flys along + if( !nSttContent ) // than take the Flys along { - const size_t nArrLen = pDoc->GetSpzFrmFmts()->size(); + const size_t nArrLen = pDoc->GetSpzFrameFormats()->size(); for( size_t n = 0; n < nArrLen; ++n ) { - SwFrmFmt* pFmt = (*pDoc->GetSpzFrmFmts())[n]; - SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor(); - const SwPosition* pAPos = pAnchor->GetCntntAnchor(); + SwFrameFormat* pFormat = (*pDoc->GetSpzFrameFormats())[n]; + SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); + const SwPosition* pAPos = pAnchor->GetContentAnchor(); if (pAPos && (pAnchor->GetAnchorId() == FLY_AT_PARA) && nSttNode == pAPos->nNode.GetIndex() ) { - if( !pFrmFmts ) - pFrmFmts = new std::vector<SwFrmFmt*>; - pFrmFmts->push_back( pFmt ); + if( !pFrameFormats ) + pFrameFormats = new std::vector<SwFrameFormat*>; + pFrameFormats->push_back( pFormat ); } } } @@ -78,11 +78,11 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam ) // set destination after reading input void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys, - bool bSttIsTxtNd ) + bool bSttIsTextNd ) { const SwPosition* pTmpPos = rPam.End(); nEndNode = pTmpPos->nNode.GetIndex(); - nEndCntnt = pTmpPos->nContent.GetIndex(); + nEndContent = pTmpPos->nContent.GetIndex(); if( rPam.HasMark() ) { if( pTmpPos == rPam.GetPoint() ) @@ -91,42 +91,42 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys, pTmpPos = rPam.GetPoint(); nSttNode = pTmpPos->nNode.GetIndex(); - nSttCntnt = pTmpPos->nContent.GetIndex(); + nSttContent = pTmpPos->nContent.GetIndex(); - if( !bSttIsTxtNd ) // if a table selection is added ... + if( !bSttIsTextNd ) // if a table selection is added ... { ++nSttNode; // ... than the CopyPam is not fully correct - bSttWasTxtNd = false; + bSttWasTextNd = false; } } - if( bScanFlys && !nSttCntnt ) + if( bScanFlys && !nSttContent ) { // than collect all new Flys SwDoc* pDoc = rPam.GetDoc(); - const size_t nArrLen = pDoc->GetSpzFrmFmts()->size(); + const size_t nArrLen = pDoc->GetSpzFrameFormats()->size(); for( size_t n = 0; n < nArrLen; ++n ) { - SwFrmFmt* pFmt = (*pDoc->GetSpzFrmFmts())[n]; - SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor(); - SwPosition const*const pAPos = pAnchor->GetCntntAnchor(); + SwFrameFormat* pFormat = (*pDoc->GetSpzFrameFormats())[n]; + SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); + SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && (pAnchor->GetAnchorId() == FLY_AT_PARA) && nSttNode == pAPos->nNode.GetIndex() ) { - std::vector<SwFrmFmt*>::iterator it; - if( !pFrmFmts || - pFrmFmts->end() == ( it = std::find( pFrmFmts->begin(), pFrmFmts->end(), pFmt ) ) ) + std::vector<SwFrameFormat*>::iterator it; + if( !pFrameFormats || + pFrameFormats->end() == ( it = std::find( pFrameFormats->begin(), pFrameFormats->end(), pFormat ) ) ) { - ::boost::shared_ptr<SwUndoInsLayFmt> const pFlyUndo( - new SwUndoInsLayFmt(pFmt, 0, 0)); + ::boost::shared_ptr<SwUndoInsLayFormat> const pFlyUndo( + new SwUndoInsLayFormat(pFormat, 0, 0)); m_FlyUndos.push_back(pFlyUndo); } else - pFrmFmts->erase( it ); + pFrameFormats->erase( it ); } } - delete pFrmFmts, pFrmFmts = 0; + delete pFrameFormats, pFrameFormats = 0; } } @@ -140,7 +140,7 @@ SwUndoInserts::~SwUndoInserts() rUNds.GetEndOfExtras().GetIndex() - m_pUndoNodeIndex->GetIndex()); m_pUndoNodeIndex.reset(); } - delete pFrmFmts; + delete pFrameFormats; delete pRedlData; } @@ -154,26 +154,26 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) // if Point and Mark are different text nodes so a JoinNext has to be done bool bJoinNext = nSttNode != nEndNode && - pPam->GetMark()->nNode.GetNode().GetTxtNode() && - pPam->GetPoint()->nNode.GetNode().GetTxtNode(); + pPam->GetMark()->nNode.GetNode().GetTextNode() && + pPam->GetPoint()->nNode.GetNode().GetTextNode(); // Is there any content? (loading from template does not have content) - if( nSttNode != nEndNode || nSttCntnt != nEndCntnt ) + if( nSttNode != nEndNode || nSttContent != nEndContent ) { if( nSttNode != nEndNode ) { - SwTxtNode* pTxtNd = pDoc->GetNodes()[ nEndNode ]->GetTxtNode(); - if (pTxtNd && pTxtNd->GetTxt().getLength() == nEndCntnt) - pLastNdColl = pTxtNd->GetTxtColl(); + SwTextNode* pTextNd = pDoc->GetNodes()[ nEndNode ]->GetTextNode(); + if (pTextNd && pTextNd->GetText().getLength() == nEndContent) + pLastNdColl = pTextNd->GetTextColl(); } RemoveIdxFromRange( *pPam, false ); SetPaM(*pPam); - // are there Footnotes or CntntFlyFrames in text? + // are there Footnotes or ContentFlyFrames in text? nSetPos = pHistory->Count(); nNdDiff = pPam->GetMark()->nNode.GetIndex(); - DelCntntIndex( *pPam->GetMark(), *pPam->GetPoint() ); + DelContentIndex( *pPam->GetMark(), *pPam->GetPoint() ); nNdDiff -= pPam->GetMark()->nNode.GetIndex(); if( *pPam->GetPoint() != *pPam->GetMark() ) @@ -182,8 +182,8 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) new SwNodeIndex(pDoc->GetNodes().GetEndOfContent())); MoveToUndoNds(*pPam, m_pUndoNodeIndex.get()); - if( !bSttWasTxtNd ) - pPam->Move( fnMoveBackward, fnGoCntnt ); + if( !bSttWasTextNd ) + pPam->Move( fnMoveBackward, fnGoContent ); } } @@ -198,14 +198,14 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) } SwNodeIndex& rIdx = pPam->GetPoint()->nNode; - SwTxtNode* pTxtNode = rIdx.GetNode().GetTxtNode(); - if( pTxtNode ) + SwTextNode* pTextNode = rIdx.GetNode().GetTextNode(); + if( pTextNode ) { - if( !pTxtFmtColl ) // if 0 than it's no TextNode -> delete + if( !pTextFormatColl ) // if 0 than it's no TextNode -> delete { SwNodeIndex aDelIdx( rIdx ); ++rIdx; - SwCntntNode* pCNd = rIdx.GetNode().GetCntntNode(); + SwContentNode* pCNd = rIdx.GetNode().GetContentNode(); pPam->GetPoint()->nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 ); pPam->SetMark(); pPam->DeleteMark(); @@ -216,21 +216,21 @@ void SwUndoInserts::UndoImpl(::sw::UndoRedoContext & rContext) } else { - if( bJoinNext && pTxtNode->CanJoinNext()) + if( bJoinNext && pTextNode->CanJoinNext()) { { RemoveIdxRel( rIdx.GetIndex()+1, SwPosition( rIdx, - SwIndex( pTxtNode, pTxtNode->GetTxt().getLength() ))); + SwIndex( pTextNode, pTextNode->GetText().getLength() ))); } - pTxtNode->JoinNext(); + pTextNode->JoinNext(); } // reset all text attributes in the paragraph! - pTxtNode->RstTxtAttr( SwIndex(pTxtNode, 0), pTxtNode->Len(), 0, 0, true ); + pTextNode->RstTextAttr( SwIndex(pTextNode, 0), pTextNode->Len(), 0, 0, true ); - pTxtNode->ResetAllAttr(); + pTextNode->ResetAllAttr(); - if( pDoc->GetTxtFmtColls()->Contains( pTxtFmtColl )) - pTxtFmtColl = static_cast<SwTxtFmtColl*>(pTxtNode->ChgFmtColl( pTxtFmtColl )) ; + if( pDoc->GetTextFormatColls()->Contains( pTextFormatColl )) + pTextFormatColl = static_cast<SwTextFormatColl*>(pTextNode->ChgFormatColl( pTextFormatColl )) ; pHistory->SetTmpEnd( nSetPos ); pHistory->TmpRollback( pDoc, 0, false ); @@ -245,17 +245,17 @@ void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & rContext) SwDoc* pDoc = pPam->GetDoc(); pPam->DeleteMark(); pPam->GetPoint()->nNode = nSttNode - nNdDiff; - SwCntntNode* pCNd = pPam->GetCntntNode(); - pPam->GetPoint()->nContent.Assign( pCNd, nSttCntnt ); + SwContentNode* pCNd = pPam->GetContentNode(); + pPam->GetPoint()->nContent.Assign( pCNd, nSttContent ); - SwTxtFmtColl* pSavTxtFmtColl = pTxtFmtColl; - if( pTxtFmtColl && pCNd && pCNd->IsTxtNode() ) - pSavTxtFmtColl = static_cast<SwTxtNode*>(pCNd)->GetTxtColl(); + SwTextFormatColl* pSavTextFormatColl = pTextFormatColl; + if( pTextFormatColl && pCNd && pCNd->IsTextNode() ) + pSavTextFormatColl = static_cast<SwTextNode*>(pCNd)->GetTextColl(); pHistory->SetTmpEnd( nSetPos ); // retrieve start position for rollback - if( ( nSttNode != nEndNode || nSttCntnt != nEndCntnt ) && m_pUndoNodeIndex) + if( ( nSttNode != nEndNode || nSttContent != nEndContent ) && m_pUndoNodeIndex) { const bool bMvBkwrd = MovePtBackward( *pPam ); @@ -263,25 +263,25 @@ void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & rContext) sal_uLong const nMvNd = m_pUndoNodeIndex->GetIndex(); m_pUndoNodeIndex.reset(); MoveFromUndoNds(*pDoc, nMvNd, *pPam->GetMark()); - if( bSttWasTxtNd ) + if( bSttWasTextNd ) MovePtForward( *pPam, bMvBkwrd ); pPam->Exchange(); } - if( pDoc->GetTxtFmtColls()->Contains( pTxtFmtColl )) + if( pDoc->GetTextFormatColls()->Contains( pTextFormatColl )) { - SwTxtNode* pTxtNd = pPam->GetMark()->nNode.GetNode().GetTxtNode(); - if( pTxtNd ) - pTxtNd->ChgFmtColl( pTxtFmtColl ); + SwTextNode* pTextNd = pPam->GetMark()->nNode.GetNode().GetTextNode(); + if( pTextNd ) + pTextNd->ChgFormatColl( pTextFormatColl ); } - pTxtFmtColl = pSavTxtFmtColl; + pTextFormatColl = pSavTextFormatColl; - if( pLastNdColl && pDoc->GetTxtFmtColls()->Contains( pLastNdColl ) && + if( pLastNdColl && pDoc->GetTextFormatColls()->Contains( pLastNdColl ) && pPam->GetPoint()->nNode != pPam->GetMark()->nNode ) { - SwTxtNode* pTxtNd = pPam->GetPoint()->nNode.GetNode().GetTxtNode(); - if( pTxtNd ) - pTxtNd->ChgFmtColl( pLastNdColl ); + SwTextNode* pTextNd = pPam->GetPoint()->nNode.GetNode().GetTextNode(); + if( pTextNd ) + pTextNd->ChgFormatColl( pLastNdColl ); } for (size_t n = m_FlyUndos.size(); 0 < n; --n) @@ -299,7 +299,7 @@ void SwUndoInserts::RedoImpl(::sw::UndoRedoContext & rContext) pDoc->getIDocumentRedlineAccess().SetRedlineMode_intern( eOld ); } else if( !( nsRedlineMode_t::REDLINE_IGNORE & GetRedlineMode() ) && - !pDoc->getIDocumentRedlineAccess().GetRedlineTbl().empty() ) + !pDoc->getIDocumentRedlineAccess().GetRedlineTable().empty() ) pDoc->getIDocumentRedlineAccess().SplitRedline( *pPam ); } |