officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs |   12 +++++
 sw/inc/strings.hrc                                                |    2 
 sw/inc/viewsh.hxx                                                 |    4 +
 sw/source/core/doc/DocumentSettingManager.cxx                     |    2 
 sw/source/core/view/viewsh.cxx                                    |   24 
++++++++++
 sw/source/ui/config/optcomp.cxx                                   |   12 +++++
 6 files changed, 56 insertions(+)

New commits:
commit b51271b85387a57b4cdd20ee6277c1a955706fc1
Author:     Mohit Marathe <mohitmara...@proton.me>
AuthorDate: Fri Apr 12 23:31:51 2024 +0530
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Thu Apr 25 07:45:54 2024 +0200

    tdf#76005 add TabsRelativeToIndent, TabOverMargin compat option to dialog
    
    Change-Id: I17703c2fe388f485462bd82982664f0b4a14d537
    Signed-off-by: Mohit Marathe <mohitmara...@proton.me>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166040
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
index 8d5f1e172918..085a380cbd41 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
@@ -140,6 +140,18 @@
         </info>
         <value>false</value>
       </prop>
+      <prop oor:name="TabsRelativeToIndent" oor:type="xs:boolean" 
oor:nillable="false">
+        <info>
+          <desc>Set tabstops relative to indent of paragraph</desc>
+        </info>
+        <value>true</value>
+      </prop>
+      <prop oor:name="TabOverMargin" oor:type="xs:boolean" 
oor:nillable="false">
+        <info>
+          <desc>Allow tabs to extend beyond the right margin</desc>
+        </info>
+        <value>false</value>
+      </prop>
     </group>
   </templates>
   <component>
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;
                 }

Reply via email to