summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHeiko Tietze <heiko.tietze@documentfoundation.org>2024-04-12 15:26:41 +0200
committerHeiko Tietze <heiko.tietze@documentfoundation.org>2024-04-21 12:40:23 +0200
commitb79e0dd7fc8bc620420ed65edbc105eec3648b34 (patch)
tree48eb0bac9c2929840d290e72a1cdd41bbabb1f6d
parenttdf#80390 Extend InsertCells Dialog to allow adding a set of Rows/Columns (diff)
downloadcore-b79e0dd7fc8bc620420ed65edbc105eec3648b34.tar.gz
core-b79e0dd7fc8bc620420ed65edbc105eec3648b34.zip
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.tietze@documentfoundation.org>
-rw-r--r--sw/source/core/text/inftxt.cxx90
-rw-r--r--sw/source/uibase/uiview/view0.cxx6
2 files changed, 47 insertions, 49 deletions
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);
}