sw/source/core/text/inftxt.cxx    |   90 +++++++++++++++++++-------------------
 sw/source/uibase/uiview/view0.cxx |    6 --
 2 files changed, 47 insertions(+), 49 deletions(-)

New commits:
commit b79e0dd7fc8bc620420ed65edbc105eec3648b34
Author:     Heiko Tietze <heiko.tie...@documentfoundation.org>
AuthorDate: Fri Apr 12 15:26:41 2024 +0200
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Sun Apr 21 12:40:23 2024 +0200

    Resolves tdf#58434 - Show formatting marks independently from fields
    
    Field Shading / .uno:Marks toggles now only fields, footnotes, tox etc.
    and Tab, SoftHyphen, Blank, as well as ControlChar depends now on
    Formatting Marks / .uno:ControlCodes. Field Shading also does not
    toggle HardBlank and SoftHyphen, and what control character is shown
    respect the options under Formatting Aids
    
    Change-Id: I63c826e7fdc09ec95f17aee9735d4f5de9a1b897
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166033
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 18ad3d1144e0..b293f18f824a 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1407,54 +1407,56 @@ void SwTextPaintInfo::DrawViewOpt( const SwLinePortion 
&rPor,
         return;
 
     bool bDraw = false;
-    switch( nWhich )
-    {
-    case PortionType::Footnote:
-    case PortionType::QuoVadis:
-    case PortionType::Number:
-    case PortionType::Field:
-    case PortionType::Hidden:
-    case PortionType::Tox:
-    case PortionType::Ref:
-    case PortionType::Meta:
-    case PortionType::ContentControl:
-    case PortionType::ControlChar:
-        if ( !GetOpt().IsPagePreview()
-             && !GetOpt().IsReadonly()
-             && GetOpt().IsFieldShadings()
-             && ( PortionType::Number != nWhich
-                  || m_pFrame->GetTextNodeForParaProps()->HasMarkedLabel())) 
// #i27615#
-        {
-            bDraw = PortionType::Footnote != nWhich || 
m_pFrame->IsFootnoteAllowed();
-            bDraw &= GetOpt().IsHardBlank();
-        }
-        break;
-    case PortionType::Bookmark:
-        // no shading
-        break;
-    case PortionType::InputField:
-        // input field shading also in read-only mode
-        if ( !GetOpt().IsPagePreview()
-             && GetOpt().IsFieldShadings() )
-        {
-            bDraw = true;
-        }
-        break;
-    case PortionType::Tab:
-        if ( GetOpt().IsTab() )     bDraw = true;
-        break;
-    case PortionType::SoftHyphen:
-        if ( GetOpt().IsSoftHyph() )bDraw = true;
-        break;
-    case PortionType::Blank:
-        if ( GetOpt().IsHardBlank())bDraw = true;
-        break;
-    default:
+    if ( !GetOpt().IsPagePreview()
+         && !GetOpt().IsReadonly() )
+    {
+        switch( nWhich )
         {
-            OSL_ENSURE( false, "SwTextPaintInfo::DrawViewOpt: don't know how 
to draw this" );
+        case PortionType::Tab:
+            if ( GetOpt().IsViewMetaChars() )
+                bDraw = GetOpt().IsTab();
+            break;
+        case PortionType::SoftHyphen:
+            if ( GetOpt().IsViewMetaChars() )
+                bDraw = GetOpt().IsSoftHyph();
             break;
+        case PortionType::Blank:
+            if ( GetOpt().IsViewMetaChars() )
+                bDraw = GetOpt().IsHardBlank();
+            break;
+        case PortionType::ControlChar:
+            if ( GetOpt().IsViewMetaChars() )
+                bDraw = true;
+            break;
+        case PortionType::Bookmark:
+            // no shading
+            break;
+        case PortionType::Footnote:
+        case PortionType::QuoVadis:
+        case PortionType::Number:
+        case PortionType::Hidden:
+        case PortionType::Tox:
+        case PortionType::Ref:
+        case PortionType::Meta:
+        case PortionType::ContentControl:
+        case PortionType::Field:
+        case PortionType::InputField:
+            // input field shading also in read-only mode
+            if (GetOpt().IsFieldShadings()
+                && ( PortionType::Number != nWhich
+                    || m_pFrame->GetTextNodeForParaProps()->HasMarkedLabel())) 
// #i27615#
+            {
+                bDraw = PortionType::Footnote != nWhich || 
m_pFrame->IsFootnoteAllowed();
+            }
+            break;
+        default:
+            {
+                OSL_ENSURE( false, "SwTextPaintInfo::DrawViewOpt: don't know 
how to draw this" );
+                break;
+            }
         }
     }
+
     if ( bDraw )
         DrawBackground( rPor, pColor );
 }
diff --git a/sw/source/uibase/uiview/view0.cxx 
b/sw/source/uibase/uiview/view0.cxx
index 70c9882e0d2e..488b32cc5fee 100644
--- a/sw/source/uibase/uiview/view0.cxx
+++ b/sw/source/uibase/uiview/view0.cxx
@@ -128,14 +128,10 @@ std::shared_ptr<SwMailMergeConfigItem> const & 
SwView::GetMailMergeConfigItem()
 
 static bool lcl_IsViewMarks( const SwViewOption& rVOpt )
 {
-    return  rVOpt.IsHardBlank() &&
-            rVOpt.IsSoftHyph() &&
-            rVOpt.IsFieldShadings();
+    return  rVOpt.IsFieldShadings();
 }
 static void lcl_SetViewMarks(SwViewOption& rVOpt, bool bOn )
 {
-    rVOpt.SetHardBlank(bOn);
-    rVOpt.SetSoftHyph(bOn);
     rVOpt.SetAppearanceFlag(
             ViewOptFlags::FieldShadings, bOn, true);
 }

Reply via email to