diff options
author | Noel Grandin <noel@peralex.com> | 2015-01-11 16:40:21 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-01-12 06:16:00 +0000 |
commit | a4d1e3d22b7f73ba7740dfe5f1d3586a49164947 (patch) | |
tree | f172a78a4cbf38a0f5edef71ccd8ddbbb4c7ca9a | |
parent | b3b4bbaf6cbd2226b659fea7d6ae473ccf84e9dd (diff) |
no need for DeletedNodeInfo class to be type unsafe
Change-Id: Idab8eacf8fa06d902c9186995b249e871bc54067
Reviewed-on: https://gerrit.libreoffice.org/13860
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | editeng/source/editeng/editdoc.hxx | 10 | ||||
-rw-r--r-- | editeng/source/editeng/editundo.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 8 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index 5e4559ceeee2..9127ca751f60 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -725,18 +725,18 @@ public: class DeletedNodeInfo { private: - sal_uIntPtr nInvalidAdressPtr; + ContentNode* mpInvalidNode; sal_Int32 nInvalidParagraph; public: - DeletedNodeInfo( sal_uIntPtr nInvAdr, sal_Int32 nPos ) - : nInvalidAdressPtr(nInvAdr) + DeletedNodeInfo( ContentNode* pNode, sal_Int32 nPos ) + : mpInvalidNode(pNode) , nInvalidParagraph(nPos) { } - sal_uIntPtr GetInvalidAdress() const { return nInvalidAdressPtr; } - sal_Int32 GetPosition() const { return nInvalidParagraph; } + ContentNode* GetNode() const { return mpInvalidNode; } + sal_Int32 GetPosition() const { return nInvalidParagraph; } }; diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index 674fc96e10ba..dc6309c122ef 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -187,7 +187,7 @@ void EditUndoDelContent::Redo() if (pEE->IsCallParaInsertedOrDeleted()) pEE->ParagraphDeleted( nNode ); - DeletedNodeInfo* pInf = new DeletedNodeInfo( reinterpret_cast<sal_uLong>(pContentNode), nNode ); + DeletedNodeInfo* pInf = new DeletedNodeInfo( pContentNode, nNode ); pEE->AppendDeletedNodeInfo(pInf); pEE->UpdateSelections(); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 1b8993fae745..da289347edfe 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -2200,7 +2200,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR } sal_Int32 nParagraphTobeDeleted = aEditDoc.GetPos( pRight ); - DeletedNodeInfo* pInf = new DeletedNodeInfo( reinterpret_cast<sal_uIntPtr>(pRight), nParagraphTobeDeleted ); + DeletedNodeInfo* pInf = new DeletedNodeInfo( pRight, nParagraphTobeDeleted ); aDeletedNodes.push_back(pInf); GetEditEnginePtr()->ParagraphConnected( aEditDoc.GetPos( pLeft ), aEditDoc.GetPos( pRight ) ); @@ -2440,7 +2440,7 @@ void ImpEditEngine::ImpRemoveParagraph( sal_Int32 nPara ) OSL_ENSURE( pNode, "Blind Node in ImpRemoveParagraph" ); - DeletedNodeInfo* pInf = new DeletedNodeInfo( reinterpret_cast<sal_uIntPtr>(pNode), nPara ); + DeletedNodeInfo* pInf = new DeletedNodeInfo( pNode, nPara ); aDeletedNodes.push_back(pInf); // The node is managed by the undo and possibly destroyed! @@ -3299,8 +3299,8 @@ void ImpEditEngine::UpdateSelections() for (size_t i = 0, n = aDeletedNodes.size(); i < n; ++i) { const DeletedNodeInfo& rInf = aDeletedNodes[i]; - if ( ( reinterpret_cast<sal_uLong>(aCurSel.Min().GetNode()) == rInf.GetInvalidAdress() ) || - ( reinterpret_cast<sal_uLong>(aCurSel.Max().GetNode()) == rInf.GetInvalidAdress() ) ) + if ( ( aCurSel.Min().GetNode() == rInf.GetNode() ) || + ( aCurSel.Max().GetNode() == rInf.GetNode() ) ) { // Use ParaPortions, as now also hidden paragraphs have to be // taken into account! diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index b777fc34afa5..494aafc82e50 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -3924,7 +3924,7 @@ void ImpEditEngine::ShowParagraph( sal_Int32 nParagraph, bool bShow ) { // Mark as deleted, so that no selection will end or begin at // this paragraph... - DeletedNodeInfo* pDelInfo = new DeletedNodeInfo( reinterpret_cast<sal_uIntPtr>(pPPortion->GetNode()), nParagraph ); + DeletedNodeInfo* pDelInfo = new DeletedNodeInfo( pPPortion->GetNode(), nParagraph ); aDeletedNodes.push_back(pDelInfo); UpdateSelections(); // The region below will not be invalidated if UpdateMode = sal_False! |