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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Sep 2 13:34:37 UTC 2018


 editeng/source/outliner/outlvw.cxx  |   12 ++++++++----
 editeng/source/uno/unoviwou.cxx     |    2 +-
 include/editeng/outliner.hxx        |    2 +-
 sw/source/uibase/shells/annotsh.cxx |    2 +-
 4 files changed, 11 insertions(+), 7 deletions(-)

New commits:
commit a201c5c8c3e7ea14001b5634f330dbce2b1f4314
Author:     Maxim Monastirsky <momonasmon at gmail.com>
AuthorDate: Sun Sep 2 14:00:50 2018 +0300
Commit:     Maxim Monastirsky <momonasmon at gmail.com>
CommitDate: Sun Sep 2 15:34:17 2018 +0200

    tdf#112935 Paste as Unformatted doesn't work in shapes and comments
    
    The shapes and comments code in sw and sc assumes
    that OutlinerView::Paste does paste as unformatted
    text, and OutlinerView::PasteSpecial does paste as
    formatted, similar to the corresponding methods of
    EditView, which it's supposed to call internally.
    But the reality is that OutlinerView::Paste just
    calls PasteSpecial, with a comment "HACK(SD does
    not call PasteSpecial)". All this situation goes
    back to "initial import" commits.
    
    This commit changes OutlinerView::Paste to paste
    as unformatted (by default). Call sites that were
    using it, but apparently wanted formatted output,
    were changed to an explicit PasteSpecial call.
    
    Change-Id: I1d7472039fb9fe09810260a199e216ec95765b10
    Reviewed-on: https://gerrit.libreoffice.org/59904
    Tested-by: Jenkins
    Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>

diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index b51cbbbbfb40..f86f707c4c35 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -669,12 +669,12 @@ void OutlinerView::Cut()
     }
 }
 
-void OutlinerView::Paste()
+void OutlinerView::PasteSpecial()
 {
-    PasteSpecial(); // HACK(SD does not call PasteSpecial)
+    Paste( true );
 }
 
-void OutlinerView::PasteSpecial()
+void OutlinerView::Paste( bool bUseSpecial )
 {
     if ( !ImpCalcSelectedPages( false ) || pOwner->ImpCanDeleteSelectedPages( this ) )
     {
@@ -682,7 +682,11 @@ void OutlinerView::PasteSpecial()
 
         pOwner->pEditEngine->SetUpdateMode( false );
         pOwner->bPasting = true;
-        pEditView->PasteSpecial();
+
+        if ( bUseSpecial )
+            pEditView->PasteSpecial();
+        else
+            pEditView->Paste();
 
         if ( pOwner->ImplGetOutlinerMode() == OutlinerMode::OutlineObject )
         {
diff --git a/editeng/source/uno/unoviwou.cxx b/editeng/source/uno/unoviwou.cxx
index ca404db7b0b1..4da65606f8fe 100644
--- a/editeng/source/uno/unoviwou.cxx
+++ b/editeng/source/uno/unoviwou.cxx
@@ -150,7 +150,7 @@ bool SvxDrawOutlinerViewForwarder::Cut()
 
 bool SvxDrawOutlinerViewForwarder::Paste()
 {
-    mrOutlinerView.Paste();
+    mrOutlinerView.PasteSpecial();
     return true;
 }
 
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index e4258582af2a..b6308599cfe3 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -274,7 +274,7 @@ public:
 
     void        Cut();
     void        Copy();
-    void        Paste();
+    void        Paste( bool bUseSpecial = false );
     void        PasteSpecial();
 
     const SfxStyleSheet*  GetStyleSheet() const;
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 021d23f62971..19a513387e3f 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -904,7 +904,7 @@ void SwAnnotationShell::ExecClpbrd(SfxRequest const &rReq)
             break;
         case SID_PASTE:
             if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED)
-                pOLV->Paste();
+                pOLV->PasteSpecial();
             break;
         case SID_PASTE_SPECIAL:
         {


More information about the Libreoffice-commits mailing list