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

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Thu Feb 6 12:01:09 UTC 2020


 sw/source/core/text/inftxt.cxx    |    7 +------
 sw/source/uibase/wrtsh/delete.cxx |   12 ++++++++++++
 2 files changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 0788ab19869aa2ae5f7fbef9e3c13ceb641f80ee
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Feb 5 18:31:29 2020 +0100
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Thu Feb 6 13:00:46 2020 +0100

    sw: read-only/protected content dialog was missing on Delete/Backspace
    
    If SwWrtShell::DelRight()/DelLeft() are called without an active
    selection, they select 1 character to the right/left, but then they
    don't check if the selection is read-only, so then SwEditShell::Delete()
    calls HasReadonlySel() and silently returns.
    
    Pop up the dialog in this case too, for consistency.
    
    Change-Id: I3d72f136f4d132de3f8a6f3cc2aab493ced95a28
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88055
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/source/uibase/wrtsh/delete.cxx b/sw/source/uibase/wrtsh/delete.cxx
index 177cb2344c46..631afcfa1fce 100644
--- a/sw/source/uibase/wrtsh/delete.cxx
+++ b/sw/source/uibase/wrtsh/delete.cxx
@@ -279,6 +279,12 @@ bool SwWrtShell::DelLeft()
     if( !bRet && bSwap )
         SwCursorShell::SwapPam();
     CloseMark( bRet );
+    if (!bRet)
+    {   // false indicates HasReadonlySel failed
+        std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetView().GetFrameWeld(), "modules/swriter/ui/inforeadonlydialog.ui"));
+        std::unique_ptr<weld::MessageDialog> xInfo(xBuilder->weld_message_dialog("InfoReadonlyDialog"));
+        xInfo->run();
+    }
     return bRet;
 }
 
@@ -394,6 +400,12 @@ bool SwWrtShell::DelRight()
         SwCursorShell::Right(1, CRSR_SKIP_CELLS);
         bRet = Delete();
         CloseMark( bRet );
+        if (!bRet)
+        {   // false indicates HasReadonlySel failed
+            std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(GetView().GetFrameWeld(), "modules/swriter/ui/inforeadonlydialog.ui"));
+            std::unique_ptr<weld::MessageDialog> xInfo(xBuilder->weld_message_dialog("InfoReadonlyDialog"));
+            xInfo->run();
+        }
         break;
 
     case SelectionType::Frame:
commit c0b7fe8281319146c4a2e36e203cfd65633ce3bd
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Feb 5 16:27:53 2020 +0100
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Thu Feb 6 13:00:34 2020 +0100

    tdf#45589 sw: don't paint field shading for bookmarks
    
    Maybe it looks better without.
    
    Change-Id: Id603fbef361574cafbe2ec9f625ac54fea27a0f6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88039
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index e4f42d4a8ea7..cd6781ca4b87 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1376,12 +1376,7 @@ void SwTextPaintInfo::DrawViewOpt( const SwLinePortion &rPor,
             }
             break;
         case PortionType::Bookmark:
-            if (!GetOpt().IsPagePreview()
-                 && !GetOpt().IsReadonly()
-                 && GetOpt().IsShowBookmarks())
-            {
-                bDraw = true;
-            }
+            // no shading
             break;
         case PortionType::InputField:
             // input field shading also in read-only mode


More information about the Libreoffice-commits mailing list