[Libreoffice-commits] core.git: editeng/source include/editeng

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Mon Oct 16 13:23:03 UTC 2017


 editeng/source/editeng/editview.cxx |   10 ++++++++++
 include/editeng/editview.hxx        |    1 +
 2 files changed, 11 insertions(+)

New commits:
commit 92fad9596efb5ecbc756bdcc5f53ea4a417ece62
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Tue Sep 19 15:09:54 2017 +0200

    editeng: add function to insert parargaph break to the EditView
    
    Change-Id: I06ab56967f25e6f9170cfbeb391110b55ddb18f6
    Reviewed-on: https://gerrit.libreoffice.org/43359
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 76692f6ab18d..bc59c9b97273 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1155,6 +1155,16 @@ void EditView::SelectCurrentWord( sal_Int16 nWordType )
     ShowCursor( true, false );
 }
 
+void EditView::InsertParaBreak()
+{
+    pImpEditView->pEditEngine->UndoActionStart(EDITUNDO_INSERT);
+    pImpEditView->DeleteSelected();
+    EditPaM aPaM(pImpEditView->pEditEngine->InsertParaBreak(pImpEditView->GetEditSelection()));
+    pImpEditView->pEditEngine->UndoActionEnd();
+    pImpEditView->SetEditSelection(EditSelection(aPaM, aPaM));
+    pImpEditView->pEditEngine->FormatAndUpdate(this);
+}
+
 void EditView::InsertField( const SvxFieldItem& rFld )
 {
     EditEngine* pEE = pImpEditView->pEditEngine;
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 79af335b3db4..6e566be7be7d 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -187,6 +187,7 @@ public:
     vcl::Cursor*    GetCursor() const;
 
     void            InsertText( const OUString& rNew, bool bSelect = false );
+    void            InsertParaBreak();
 
     bool            PostKeyEvent( const KeyEvent& rKeyEvent, vcl::Window const * pFrameWin = nullptr );
 


More information about the Libreoffice-commits mailing list