From ba644a0947a91bba7ccb62fe6e1ae85f0ee30041 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 16 Apr 2012 23:44:29 -0400 Subject: EditUndoSplitPara --- editeng/inc/editeng/editeng.hxx | 2 ++ editeng/source/editeng/editeng.cxx | 5 +++++ editeng/source/editeng/editundo.cxx | 18 +++++++++--------- editeng/source/editeng/impedit.hxx | 1 - 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx index 5dfddf784467..a239b9f94958 100644 --- a/editeng/inc/editeng/editeng.hxx +++ b/editeng/inc/editeng/editeng.hxx @@ -562,6 +562,8 @@ public: void InsertContent(ContentNode* pNode, sal_uInt16 nPos); EditPaM SplitContent(sal_uInt16 nNode, sal_uInt16 nSepPos); EditPaM ConnectContents(sal_uInt16 nLeftNode, bool bBackward); + + EditPaM InsertFeature(const EditSelection& rEditSelection, const SfxPoolItem& rItem); }; #endif // _MyEDITENG_HXX diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 3d28480048a4..4a1fa612698e 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -782,6 +782,11 @@ EditPaM EditEngine::ConnectContents(sal_uInt16 nLeftNode, bool bBackward) return pImpEditEngine->ConnectContents(nLeftNode, bBackward); } +EditPaM EditEngine::InsertFeature(const EditSelection& rEditSelection, const SfxPoolItem& rItem) +{ + return pImpEditEngine->ImpInsertFeature(rEditSelection, rItem); +} + uno::Reference EditEngine::CreateTransferable(const EditSelection& rSelection) { return pImpEditEngine->CreateTransferable(rSelection); diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index fa5c72fbdd84..9c370d16e23d 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -412,26 +412,26 @@ EditUndoInsertFeature::~EditUndoInsertFeature() void EditUndoInsertFeature::Undo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); - EditPaM aPaM( GetImpEditEngine()->CreateEditPaM( aEPaM ) ); + DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); + EditPaM aPaM = GetEditEngine()->CreateEditPaM(aEPaM); EditSelection aSel( aPaM, aPaM ); // Attributes are then corrected implicitly by the document ... aSel.Max().GetIndex()++; - GetImpEditEngine()->ImpDeleteSelection( aSel ); + GetEditEngine()->DeleteSelection(aSel); aSel.Max().GetIndex()--; // For Selection - GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( aSel ); + GetEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection(aSel); } void EditUndoInsertFeature::Redo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); - EditPaM aPaM( GetImpEditEngine()->CreateEditPaM( aEPaM ) ); + DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); + EditPaM aPaM = GetEditEngine()->CreateEditPaM(aEPaM); EditSelection aSel( aPaM, aPaM ); - GetImpEditEngine()->ImpInsertFeature( aSel, *pFeature ); + GetEditEngine()->InsertFeature(aSel, *pFeature); if ( pFeature->Which() == EE_FEATURE_FIELD ) - GetImpEditEngine()->UpdateFields(); + GetEditEngine()->UpdateFieldsOnly(); aSel.Max().GetIndex()++; - GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( aSel ); + GetEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection(aSel); } EditUndoMoveParagraphs::EditUndoMoveParagraphs diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 842ba66c2cb4..6e0ebb727d55 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -382,7 +382,6 @@ class ImpEditEngine : public SfxListener, boost::noncopyable { // The Undos have to manipulate directly ( private-Methods ), // do that no new Undo is inserted! - friend class EditUndoInsertFeature; friend class EditUndoMoveParagraphs; friend class EditEngine; // For access to Imp-Methods -- cgit