[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-1' - 3 commits - sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 26 16:13:03 UTC 2020


 sw/source/core/crsr/pam.cxx       |    4 +++-
 sw/source/uibase/docvw/edtwin.cxx |   10 +++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 669d3df09a5e8be56debfc6f419102251cdc174f
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Mar 26 15:53:52 2020 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Thu Mar 26 17:04:20 2020 +0100

    sw: SwEditWin: for CUT of a read-only selection, pop up info dialog
    
    ... as is already done for PASTE, so the user doesn't wonder why it
    doesn't work.
    
    Change-Id: I4c967fdf46bc76f0930d665cf84ca27ef92c00d6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91142
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit b6fb2719170d1d96fc60305d73663ddd81d887e5)

diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index b23727c789e3..1c02072f7ea4 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2251,7 +2251,9 @@ KEYINPUT_CHECKTABLE_INSDEL:
                 if( !m_aInBuffer.isEmpty() && ( !bNormalChar || bIsDocReadOnly ))
                     FlushInBuffer();
 
-                if (rSh.HasReadonlySel() && rKeyCode.GetFunction() == KeyFuncType::PASTE)
+                if (rSh.HasReadonlySel()
+                    && (   rKeyCode.GetFunction() == KeyFuncType::PASTE
+                        || rKeyCode.GetFunction() == KeyFuncType::CUT))
                 {
                     auto xInfo(std::make_shared<weld::GenericDialogController>(GetFrameWeld(), "modules/swriter/ui/inforeadonlydialog.ui", "InfoReadonlyDialog"));
                     weld::DialogController::runAsync(xInfo, [](int) {});
commit dd10329ae977614f8dd0acb99820dd56e10d7bfc
Author:     Ilhan Yesil <ilhanyesil at gmx.de>
AuthorDate: Tue Jul 31 14:36:28 2018 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Thu Mar 26 17:04:20 2020 +0100

    tdf#119016 Editing a read-only section shall popup a dialog
    
    While processing the key input, an additional if statement for the
    paste command (Ctrl+V) is added.
    
    Change-Id: If205589256855422ac93f8a5ed8a1ee394ca9310
    Reviewed-on: https://gerrit.libreoffice.org/58360
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 66838c2418df4d016be0da0ef1c7e54934c03421)

diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index c892f902fed0..b23727c789e3 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2251,7 +2251,13 @@ KEYINPUT_CHECKTABLE_INSDEL:
                 if( !m_aInBuffer.isEmpty() && ( !bNormalChar || bIsDocReadOnly ))
                     FlushInBuffer();
 
-                if( m_rView.KeyInput( aKeyEvent ) )
+                if (rSh.HasReadonlySel() && rKeyCode.GetFunction() == KeyFuncType::PASTE)
+                {
+                    auto xInfo(std::make_shared<weld::GenericDialogController>(GetFrameWeld(), "modules/swriter/ui/inforeadonlydialog.ui", "InfoReadonlyDialog"));
+                    weld::DialogController::runAsync(xInfo, [](int) {});
+                    eKeyState = SwKeyState::End;
+                }
+                else if( m_rView.KeyInput( aKeyEvent ) )
                 {
                     bFlushBuffer = true;
                     bNormalChar = false;
commit b8a807868cae690e6abd19a8eb0e74daf4bdc548
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Mar 26 15:24:37 2020 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Thu Mar 26 17:04:20 2020 +0100

    sw: PROTECT_FIELDS should not protect placeholder fields
    
    The text placeholder field becomes totally nonfunctional, the other
    placeholder fields allow inserting but are then not deleted; just ignore
    protection for placeholder fields.
    
    Change-Id: Ic478a32d616464bfe7f24fc851c1998b5e01a23b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91140
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 3fc68fdc6f4ef04091db2fd46499a10396c3a4f2)

diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index f0d88a26a4d5..8c9ac028bb8b 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -751,7 +751,9 @@ bool SwPaM::HasReadonlySel( bool bFormView ) const
                         {
                             break; // after selection
                         }
-                        if (pHint->Which() == RES_TXTATR_FIELD)
+                        if (pHint->Which() == RES_TXTATR_FIELD
+                            // placeholders don't work if you can't delete them
+                            && pHint->GetFormatField().GetField()->GetTyp()->Which() != SwFieldIds::JumpEdit)
                         {
                             return true;
                         }


More information about the Libreoffice-commits mailing list