summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/strings.hrc2
-rw-r--r--sw/inc/viewsh.hxx4
-rw-r--r--sw/source/core/doc/DocumentSettingManager.cxx2
-rw-r--r--sw/source/core/view/viewsh.cxx24
-rw-r--r--sw/source/ui/config/optcomp.cxx12
5 files changed, 44 insertions, 0 deletions
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index ea58fccb736c..a0d04e35ba29 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -1490,6 +1490,8 @@
#define STR_COMPAT_OPT_EMPTYDBFIELDHIDESPARA NC_("STR_COMPAT_OPT_EMPTYDBFIELDHIDESPARA", "Hide paragraphs of database fields (e.g., mail merge) with an empty value")
#define STR_COMPAT_OPT_USEVARIABLEWIDTHNBSP NC_("STR_COMPAT_OPT_USEVARIABLEWIDTHNBSP", "Render non-breaking spaces (NBSP) as standard-space-width (off for fixed size)")
#define STR_COMPAT_OPT_NOGAPAFTERNOTENUMBER NC_("STR_COMPAT_OPT_NOGAPAFTERNOTENUMBER", "Do not add an extra space after number in footnotes / endnotes with hanging first line")
+#define STR_COMPAT_OPT_TABSRELATIVETOINDENT NC_("STR_COMPAT_OPT_TABSRELATIVETOINDENT", "Set tabstops relative to indent of paragraph")
+#define STR_COMPAT_OPT_TABOVERMARGIN NC_("STR_COMPAT_OPT_TABOVERMARGIN", "Allow tabs to extend beyond the right margin")
#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 a55da3bc1f69..9417702f5b86 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -447,6 +447,10 @@ public:
SW_DLLPUBLIC void SetNoGapAfterNoteNumber(bool bNew);
+ SW_DLLPUBLIC void SetTabsRelativeToIndent(bool bNew);
+
+ SW_DLLPUBLIC void SetTabOverMargin(bool bNew);
+
// 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 4f768933f633..4e093c9230bf 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -137,6 +137,8 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
mbEmptyDbFieldHidesPara = aOptions.get(u"EmptyDbFieldHidesPara"_ustr);
mbUseVariableWidthNBSP = aOptions.get(u"UseVariableWidthNBSP"_ustr);
mbNoGapAfterNoteNumber = aOptions.get(u"NoGapAfterNoteNumber"_ustr);
+ mbTabRelativeToIndent = aOptions.get(u"TabsRelativeToIndent"_ustr);
+ mbTabOverMargin = aOptions.get(u"TabOverMargin"_ustr);
}
else
{
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 7f048409bc02..5ec658a9cd14 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1059,6 +1059,30 @@ void SwViewShell::SetNoGapAfterNoteNumber(bool bNew)
}
}
+void SwViewShell::SetTabsRelativeToIndent(bool bNew)
+{
+ IDocumentSettingAccess& rIDSA = getIDocumentSettingAccess();
+ if (rIDSA.get(DocumentSettingId::TABS_RELATIVE_TO_INDENT) != bNew)
+ {
+ SwWait aWait(*GetDoc()->GetDocShell(), true);
+ rIDSA.set(DocumentSettingId::TABS_RELATIVE_TO_INDENT, bNew);
+ const SwInvalidateFlags nInv = SwInvalidateFlags::Size | SwInvalidateFlags::Section | SwInvalidateFlags::PrtArea | SwInvalidateFlags::Table | SwInvalidateFlags::Pos;
+ lcl_InvalidateAllContent(*this, nInv);
+ }
+}
+
+void SwViewShell::SetTabOverMargin(bool bNew)
+{
+ IDocumentSettingAccess& rIDSA = getIDocumentSettingAccess();
+ if (rIDSA.get(DocumentSettingId::TAB_OVER_MARGIN) != bNew)
+ {
+ SwWait aWait(*GetDoc()->GetDocShell(), true);
+ rIDSA.set(DocumentSettingId::TAB_OVER_MARGIN, bNew);
+ 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 bfbf1c841ff7..9ed4c850bd4d 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -60,6 +60,8 @@ constexpr std::pair<OUString, TranslateId> options_list[]{
{ u"EmptyDbFieldHidesPara"_ustr, STR_COMPAT_OPT_EMPTYDBFIELDHIDESPARA },
{ u"UseVariableWidthNBSP"_ustr, STR_COMPAT_OPT_USEVARIABLEWIDTHNBSP },
{ u"NoGapAfterNoteNumber"_ustr, STR_COMPAT_OPT_NOGAPAFTERNOTENUMBER },
+ { u"TabsRelativeToIndent"_ustr, STR_COMPAT_OPT_TABSRELATIVETOINDENT },
+ { u"TabOverMargin"_ustr, STR_COMPAT_OPT_TABOVERMARGIN },
};
// DocumentSettingId, negate?
@@ -82,6 +84,8 @@ std::pair<DocumentSettingId, bool> DocumentSettingForOption(const OUString& opti
{ u"EmptyDbFieldHidesPara"_ustr, { DocumentSettingId::EMPTY_DB_FIELD_HIDES_PARA, false } },
{ u"UseVariableWidthNBSP"_ustr, { DocumentSettingId::USE_VARIABLE_WIDTH_NBSP, false } },
{ u"NoGapAfterNoteNumber"_ustr, { DocumentSettingId::NO_GAP_AFTER_NOTE_NUMBER, false } },
+ { u"TabsRelativeToIndent"_ustr, { DocumentSettingId::TABS_RELATIVE_TO_INDENT, false } },
+ { u"TabOverMargin"_ustr, { DocumentSettingId::TAB_OVER_MARGIN, false } },
// { u"AddTableLineSpacing"_ustr, { DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS, false } },
};
return map.at(option);
@@ -306,6 +310,14 @@ bool SwCompatibilityOptPage::FillItemSet( SfxItemSet* )
m_pWrtShell->SetNoGapAfterNoteNumber(bChecked);
break;
+ case DocumentSettingId::TABS_RELATIVE_TO_INDENT:
+ m_pWrtShell->SetTabsRelativeToIndent(bChecked);
+ break;
+
+ case DocumentSettingId::TAB_OVER_MARGIN:
+ m_pWrtShell->SetTabOverMargin(bChecked);
+ break;
+
default:
break;
}