summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-04-16 23:10:13 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-04-16 23:50:19 -0400
commitc6eceac87b5f904a2ec51b161dd4136bfb8c4e54 (patch)
tree26dca434f7ef922086d275af4bba1a737a7d8a09 /editeng
parentc5cf5f700f53f5742bb8f3080083454c9623dadc (diff)
EditUndoInsertCharts is no longer a friend of ImpEditEngine.
Diffstat (limited to 'editeng')
-rw-r--r--editeng/inc/editeng/editeng.hxx2
-rw-r--r--editeng/source/editeng/editeng.cxx25
-rw-r--r--editeng/source/editeng/editundo.cxx16
-rw-r--r--editeng/source/editeng/impedit.hxx1
4 files changed, 25 insertions, 19 deletions
diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index 8bfe3f4f02a1..215f63f1122c 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -109,6 +109,7 @@ class EditSelectionEngine;
class EditDoc;
struct PasteOrDropInfos;
class Range;
+struct EPaM;
//////////////////////////////////////////////////////////////////////////////
@@ -519,6 +520,7 @@ public:
void ParaAttribsToCharAttribs(ContentNode* pNode);
+ EditPaM CreateEditPaM(const EPaM& rEPaM);
EditPaM ConnectParagraphs(
ContentNode* pLeft, ContentNode* pRight, bool bBackward = false);
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index c5e1e5a2b151..1fae33188fa1 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -752,6 +752,11 @@ void EditEngine::ParaAttribsToCharAttribs(ContentNode* pNode)
pImpEditEngine->ParaAttribsToCharAttribs(pNode);
}
+EditPaM EditEngine::CreateEditPaM(const EPaM& rEPaM)
+{
+ return pImpEditEngine->CreateEditPaM(rEPaM);
+}
+
EditPaM EditEngine::ConnectParagraphs(
ContentNode* pLeft, ContentNode* pRight, bool bBackward)
{
@@ -2543,7 +2548,7 @@ void EditEngine::ParagraphHeightChanged( sal_uInt16 nPara )
XubString EditEngine::GetUndoComment( sal_uInt16 nId ) const
{
DBG_CHKTHIS( EditEngine, 0 );
- rtl::OUString aComment;
+ XubString aComment;
switch ( nId )
{
case EDITUNDO_REMOVECHARS:
@@ -2552,12 +2557,12 @@ XubString EditEngine::GetUndoComment( sal_uInt16 nId ) const
case EDITUNDO_DELCONTENT:
case EDITUNDO_DELETE:
case EDITUNDO_CUT:
- aComment = EE_RESSTR(RID_EDITUNDO_DEL);
+ aComment = XubString( EditResId( RID_EDITUNDO_DEL ) );
break;
case EDITUNDO_MOVEPARAGRAPHS:
case EDITUNDO_MOVEPARAS:
case EDITUNDO_DRAGANDDROP:
- aComment = EE_RESSTR(RID_EDITUNDO_MOVE);
+ aComment = XubString( EditResId( RID_EDITUNDO_MOVE ) );
break;
case EDITUNDO_INSERTFEATURE:
case EDITUNDO_SPLITPARA:
@@ -2565,29 +2570,29 @@ XubString EditEngine::GetUndoComment( sal_uInt16 nId ) const
case EDITUNDO_PASTE:
case EDITUNDO_INSERT:
case EDITUNDO_READ:
- aComment = EE_RESSTR(RID_EDITUNDO_INSERT);
+ aComment = XubString( EditResId( RID_EDITUNDO_INSERT ) );
break;
case EDITUNDO_SRCHANDREPL:
case EDITUNDO_REPLACEALL:
- aComment = EE_RESSTR(RID_EDITUNDO_REPLACE);
+ aComment = XubString( EditResId( RID_EDITUNDO_REPLACE ) );
break;
case EDITUNDO_ATTRIBS:
case EDITUNDO_PARAATTRIBS:
case EDITUNDO_STRETCH:
- aComment = EE_RESSTR(RID_EDITUNDO_SETATTRIBS);
+ aComment = XubString( EditResId( RID_EDITUNDO_SETATTRIBS ) );
break;
case EDITUNDO_RESETATTRIBS:
- aComment = EE_RESSTR(RID_EDITUNDO_RESETATTRIBS);
+ aComment = XubString( EditResId( RID_EDITUNDO_RESETATTRIBS ) );
break;
case EDITUNDO_STYLESHEET:
- aComment = EE_RESSTR(RID_EDITUNDO_SETSTYLE);
+ aComment = XubString( EditResId( RID_EDITUNDO_SETSTYLE ) );
break;
case EDITUNDO_TRANSLITERATE:
- aComment = EE_RESSTR(RID_EDITUNDO_TRANSLITERATE);
+ aComment = XubString( EditResId( RID_EDITUNDO_TRANSLITERATE ) );
break;
case EDITUNDO_INDENTBLOCK:
case EDITUNDO_UNINDENTBLOCK:
- aComment = EE_RESSTR(RID_EDITUNDO_INDENT);
+ aComment = XubString( EditResId( RID_EDITUNDO_INDENT ) );
break;
}
return aComment;
diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx
index f39572907285..c98ea016aeb3 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -337,22 +337,22 @@ EditUndoInsertChars::EditUndoInsertChars( ImpEditEngine* _pImpEE, const EPaM& rE
void EditUndoInsertChars::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 );
aSel.Max().GetIndex() = aSel.Max().GetIndex() + aText.Len();
- EditPaM aNewPaM( GetImpEditEngine()->ImpDeleteSelection( aSel ) );
- GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aNewPaM, aNewPaM ) );
+ EditPaM aNewPaM( GetEditEngine()->DeleteSelection(aSel) );
+ GetEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aNewPaM, aNewPaM ) );
}
void EditUndoInsertChars::Redo()
{
- DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" );
- EditPaM aPaM( GetImpEditEngine()->CreateEditPaM( aEPaM ) );
- GetImpEditEngine()->ImpInsertText( EditSelection( aPaM, aPaM ), aText );
+ DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: Keine Active View!" );
+ EditPaM aPaM = GetEditEngine()->CreateEditPaM(aEPaM);
+ GetEditEngine()->InsertText(EditSelection(aPaM, aPaM), aText);
EditPaM aNewPaM( aPaM );
aNewPaM.GetIndex() = aNewPaM.GetIndex() + aText.Len();
- GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aNewPaM ) );
+ GetEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aNewPaM ) );
}
sal_Bool EditUndoInsertChars::Merge( SfxUndoAction* pNextAction )
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 1f77f8825895..a74fbef44c70 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 EditUndoInsertChars;
friend class EditUndoRemoveChars;
friend class EditUndoDelContent;
friend class EditUndoConnectParas;