summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs6
-rw-r--r--sw/inc/strings.hrc1
-rw-r--r--sw/inc/viewsh.hxx2
-rw-r--r--sw/source/core/doc/DocumentSettingManager.cxx1
-rw-r--r--sw/source/core/view/viewsh.cxx14
-rw-r--r--sw/source/ui/config/optcomp.cxx6
6 files changed, 30 insertions, 0 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
index a421f1f347ae..47760b0921f9 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
@@ -170,6 +170,12 @@
</info>
<value>false</value>
</prop>
+ <prop oor:name="IgnoreTabsAndBlanksForLineCalculation" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Make whitespace character height not affect line height</desc>
+ </info>
+ <value>false</value>
+ </prop>
</group>
</templates>
<component>
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index ae2b24845615..b14c7ab5daf3 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -1530,6 +1530,7 @@
#define STR_COMPAT_OPT_DO_NOT_MIRROR_RTL_DRAW_OBJS NC_("STR_COMPAT_OPT_DO_NOT_MIRROR_RTL_DRAW_OBJS", "Do not mirror drawing objects anchored in paragraphs with an RTL writing direction")
#define STR_COMPAT_OPT_CONTINUOUS_ENDNOTES NC_("STR_COMPAT_OPT_CONTINUOUS_ENDNOTES", "Render endnotes at the end of document inline, rather than on a separate page")
#define STR_COMPAT_OPT_MSWORDCOMPGRIDMETRICS NC_("STR_COMPAT_OPT_MSWORDCOMPGRIDMETRICS", "Use Word-compatible font metrics for text grid")
+#define STR_COMPAT_OPT_IGNORETABSANDBLANKSFORLINECALCULATION NC_("STR_COMPAT_OPT_IGNORETABSANDBLANKSFORLINECALCULATION", "Make whitespace character height not affect line height")
#define STR_TABLE_PANEL_ALIGN_AUTO NC_("sidebartableedit|alignautolabel", "Automatic")
#define STR_TABLE_PANEL_ALIGN_LEFT NC_("sidebartableedit|alignleftlabel", "Left")
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 1752a167d149..eaa1630cd084 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -456,6 +456,8 @@ public:
SW_DLLPUBLIC void SetMsWordCompGridMetrics(bool bMsWordCompGridMetrics);
+ SW_DLLPUBLIC void SetIgnoreTabsAndBlanksForLineCalculation(bool bIgnoreTabsAndBlanksForLineCalculation);
+
// DOCUMENT COMPATIBILITY FLAGS END
// Calls Idle-formatter of Layout.
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx
index 9f3858f8c0b6..2d9e2c389724 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -146,6 +146,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
mbDoNotMirrorRtlDrawObjs = aOptions.get(u"DoNotMirrorRtlDrawObjs"_ustr);
mbContinuousEndnotes = aOptions.get(u"ContinuousEndnotes"_ustr);
mbMsWordCompGridMetrics = aOptions.get(u"MsWordCompGridMetrics"_ustr);
+ mbIgnoreTabsAndBlanksForLineCalculation = aOptions.get(u"IgnoreTabsAndBlanksForLineCalculation"_ustr);
}
else
{
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index dccebd31546f..eadb0ed8e8c0 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1127,6 +1127,20 @@ void SwViewShell::SetMsWordCompGridMetrics(bool _bMsWordCompGridMetrics)
}
}
+void SwViewShell::SetIgnoreTabsAndBlanksForLineCalculation(bool val)
+{
+ IDocumentSettingAccess& rIDSA = getIDocumentSettingAccess();
+ if (rIDSA.get(DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION) != val)
+ {
+ SwWait aWait(*GetDoc()->GetDocShell(), true);
+ rIDSA.set(DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION, val);
+ const SwInvalidateFlags nInv = SwInvalidateFlags::Size | SwInvalidateFlags::Section
+ | SwInvalidateFlags::PrtArea | SwInvalidateFlags::Table
+ | SwInvalidateFlags::Pos;
+ lcl_InvalidateAllContent(*this, nInv);
+ }
+}
+
void SwViewShell::Reformat()
{
SwWait aWait( *GetDoc()->GetDocShell(), true );
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 61617a82ed6e..f296dbc9f6d4 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -65,6 +65,7 @@ constexpr std::pair<OUString, TranslateId> options_list[]{
{ u"DoNotMirrorRtlDrawObjs"_ustr, STR_COMPAT_OPT_DO_NOT_MIRROR_RTL_DRAW_OBJS },
{ u"ContinuousEndnotes"_ustr, STR_COMPAT_OPT_CONTINUOUS_ENDNOTES },
{ u"MsWordCompGridMetrics"_ustr, STR_COMPAT_OPT_MSWORDCOMPGRIDMETRICS },
+ { u"IgnoreTabsAndBlanksForLineCalculation"_ustr, STR_COMPAT_OPT_IGNORETABSANDBLANKSFORLINECALCULATION },
};
// DocumentSettingId, negate?
@@ -93,6 +94,7 @@ std::pair<DocumentSettingId, bool> DocumentSettingForOption(const OUString& opti
{ u"ContinuousEndnotes"_ustr, { DocumentSettingId::CONTINUOUS_ENDNOTES, false } },
// { u"AddTableLineSpacing"_ustr, { DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS, false } },
{ u"MsWordCompGridMetrics"_ustr, { DocumentSettingId::MS_WORD_COMP_GRID_METRICS, false } },
+ { u"IgnoreTabsAndBlanksForLineCalculation"_ustr, { DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION, false } },
};
return map.at(option);
}
@@ -336,6 +338,10 @@ bool SwCompatibilityOptPage::FillItemSet( SfxItemSet* )
m_pWrtShell->SetMsWordCompGridMetrics(bChecked);
break;
+ case DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION:
+ m_pWrtShell->SetIgnoreTabsAndBlanksForLineCalculation(bChecked);
+ break;
+
default:
break;
}