diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-16 23:38:43 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-16 23:50:20 -0400 |
commit | a5927d2166a5095b3edbd1886a6e00bb3f863915 (patch) | |
tree | c426b7bbd4cf9bedcc6e026054504a839ce15e32 /editeng | |
parent | c998665f8a5d7b46772fbd10b6cbd03384295c7f (diff) |
Same with EditUndoConnectParas.
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/inc/editeng/editeng.hxx | 3 | ||||
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 15 | ||||
-rw-r--r-- | editeng/source/editeng/editundo.cxx | 32 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 1 |
4 files changed, 34 insertions, 17 deletions
diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx index c7357dfcdeb1..5dfddf784467 100644 --- a/editeng/inc/editeng/editeng.hxx +++ b/editeng/inc/editeng/editeng.hxx @@ -553,12 +553,15 @@ public: void RemoveParaPortion(size_t nNode); + void SetCallParaInsertedOrDeleted(bool b); bool IsCallParaInsertedOrDeleted() const; void AppendDeletedNodeInfo(DeletedNodeInfo* pInfo); void UpdateSelections(); void InsertContent(ContentNode* pNode, sal_uInt16 nPos); + EditPaM SplitContent(sal_uInt16 nNode, sal_uInt16 nSepPos); + EditPaM ConnectContents(sal_uInt16 nLeftNode, bool bBackward); }; #endif // _MyEDITENG_HXX diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 93f5decb5545..3d28480048a4 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -747,6 +747,11 @@ void EditEngine::RemoveParaPortion(size_t nNode) pImpEditEngine->GetParaPortions().Remove(nNode); } +void EditEngine::SetCallParaInsertedOrDeleted(bool b) +{ + pImpEditEngine->SetCallParaInsertedOrDeleted(b); +} + bool EditEngine::IsCallParaInsertedOrDeleted() const { return pImpEditEngine->IsCallParaInsertedOrDeleted(); @@ -767,6 +772,16 @@ void EditEngine::InsertContent(ContentNode* pNode, sal_uInt16 nPos) pImpEditEngine->InsertContent(pNode, nPos); } +EditPaM EditEngine::SplitContent(sal_uInt16 nNode, sal_uInt16 nSepPos) +{ + return pImpEditEngine->SplitContent(nNode, nSepPos); +} + +EditPaM EditEngine::ConnectContents(sal_uInt16 nLeftNode, bool bBackward) +{ + return pImpEditEngine->ConnectContents(nLeftNode, bBackward); +} + uno::Reference<datatransfer::XTransferable> EditEngine::CreateTransferable(const EditSelection& rSelection) { return pImpEditEngine->CreateTransferable(rSelection); diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index fb7cd5771311..0aa0a4d29f5d 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -268,39 +268,39 @@ EditUndoConnectParas::~EditUndoConnectParas() void EditUndoConnectParas::Undo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); + DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); // For SplitContent ParagraphInserted can not be called yet because the // Outliner relies on the attributes to initialize the depth - sal_Bool bCall = GetImpEditEngine()->IsCallParaInsertedOrDeleted(); - GetImpEditEngine()->SetCallParaInsertedOrDeleted( sal_False ); + sal_Bool bCall = GetEditEngine()->IsCallParaInsertedOrDeleted(); + GetEditEngine()->SetCallParaInsertedOrDeleted(false); - EditPaM aPaM = GetImpEditEngine()->SplitContent( nNode, nSepPos ); - GetImpEditEngine()->SetParaAttribs( nNode, aLeftParaAttribs ); - GetImpEditEngine()->SetParaAttribs( nNode+1, aRightParaAttribs ); + EditPaM aPaM = GetEditEngine()->SplitContent(nNode, nSepPos); + GetEditEngine()->SetParaAttribs( nNode, aLeftParaAttribs ); + GetEditEngine()->SetParaAttribs( nNode+1, aRightParaAttribs ); - GetImpEditEngine()->SetCallParaInsertedOrDeleted( bCall ); - if ( GetImpEditEngine()->IsCallParaInsertedOrDeleted() ) - GetImpEditEngine()->GetEditEnginePtr()->ParagraphInserted( nNode+1 ); + GetEditEngine()->SetCallParaInsertedOrDeleted( bCall ); + if (GetEditEngine()->IsCallParaInsertedOrDeleted()) + GetEditEngine()->ParagraphInserted( nNode+1 ); - if ( GetImpEditEngine()->GetStyleSheetPool() ) + if (GetEditEngine()->GetStyleSheetPool()) { if ( aLeftStyleName.Len() ) - GetImpEditEngine()->SetStyleSheet( (sal_uInt16)nNode, (SfxStyleSheet*)GetImpEditEngine()->GetStyleSheetPool()->Find( aLeftStyleName, eLeftStyleFamily ) ); + GetEditEngine()->SetStyleSheet( (sal_uInt16)nNode, (SfxStyleSheet*)GetEditEngine()->GetStyleSheetPool()->Find( aLeftStyleName, eLeftStyleFamily ) ); if ( aRightStyleName.Len() ) - GetImpEditEngine()->SetStyleSheet( nNode+1, (SfxStyleSheet*)GetImpEditEngine()->GetStyleSheetPool()->Find( aRightStyleName, eRightStyleFamily ) ); + GetEditEngine()->SetStyleSheet( nNode+1, (SfxStyleSheet*)GetEditEngine()->GetStyleSheetPool()->Find( aRightStyleName, eRightStyleFamily ) ); } - GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aPaM ) ); + GetEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aPaM ) ); } void EditUndoConnectParas::Redo() { - DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Np Active View!" ); - EditPaM aPaM = GetImpEditEngine()->ConnectContents( nNode, bBackward ); + DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: Np Active View!" ); + EditPaM aPaM = GetEditEngine()->ConnectContents( nNode, bBackward ); - GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aPaM ) ); + GetEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aPaM ) ); } EditUndoSplitPara::EditUndoSplitPara( ImpEditEngine* _pImpEE, sal_uInt16 nN, sal_uInt16 nSP ) diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 6e31d6c07e63..b1d8868ac576 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 EditUndoConnectParas; friend class EditUndoSplitPara; friend class EditUndoInsertFeature; friend class EditUndoMoveParagraphs; |