core.git: officecfg/registry sw/inc sw/source

2024-04-24 Thread Mohit Marathe (via logerrit)
 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 
AuthorDate: Fri Apr 12 23:31:51 2024 +0530
Commit: Mike Kaganski 
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 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166040
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

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 @@
 
 false
   
+  
+
+  Set tabstops relative to indent of paragraph
+
+true
+  
+  
+
+  Allow tabs to extend beyond the right margin
+
+false
+  
 
   
   
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 
)
 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 

core.git: editeng/source

2024-04-09 Thread Mohit Marathe (via logerrit)
 editeng/source/uno/unotext.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit e211607dffe2986601359dcb1ef757fda3805fb3
Author: Mohit Marathe 
AuthorDate: Sun Mar 24 22:06:46 2024 +0530
Commit: Hossein 
CommitDate: Tue Apr 9 09:06:27 2024 +0200

tdf#42982: Improve UNO API error reporting

Change-Id: If075965f2b020767b35692ea110ca768daf342c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165228
Tested-by: Jenkins
Reviewed-by: Hossein 

diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 09a117d82123..b5f329e62050 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -314,7 +314,7 @@ uno::Reference< text::XTextRange > SAL_CALL 
SvxUnoTextRangeBase::getStart()
 SvxUnoTextBase* pText = comphelper::getFromUnoTunnel( 
getText() );
 
 if(pText == nullptr)
-throw uno::RuntimeException();
+throw uno::RuntimeException("Failed to retrieve a valid text base 
object from the Uno Tunnel");
 
 rtl::Reference pRange = new SvxUnoTextRange( *pText );
 xRange = pRange;
@@ -342,7 +342,7 @@ uno::Reference< text::XTextRange > SAL_CALL 
SvxUnoTextRangeBase::getEnd()
 SvxUnoTextBase* pText = comphelper::getFromUnoTunnel( 
getText() );
 
 if(pText == nullptr)
-throw uno::RuntimeException();
+throw uno::RuntimeException("Failed to retrieve a valid text base 
object from the Uno Tunnel");
 
 rtl::Reference pNew = new SvxUnoTextRange( *pText );
 xRet = pNew;
@@ -704,12 +704,12 @@ bool SvxUnoTextRangeBase::GetPropertyValueHelper(  
SfxItemSet const & rSet, cons
 {
 SfxItemState eState = rSet.GetItemState( EE_PARA_NUMBULLET );
 if( eState != SfxItemState::SET && eState != SfxItemState::DEFAULT)
-throw uno::RuntimeException();
+throw uno::RuntimeException("Invalid item state for paragraph 
numbering/bullet. Expected SET or DEFAULT.");
 
 const SvxNumBulletItem* pBulletItem = rSet.GetItem( 
EE_PARA_NUMBULLET );
 
 if( pBulletItem == nullptr )
-throw uno::RuntimeException();
+throw uno::RuntimeException("Unable to retrieve paragraph 
numbering/bullet item.");
 
 aAny <<= SvxCreateNumRule( pBulletItem->GetNumRule() );
 }


core.git: stoc/test

2024-03-25 Thread Mohit Marathe (via logerrit)
 stoc/test/uriproc/test_uriproc.cxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 913437f3cd79c4f64151b98366fcc8a90bb66dac
Author: Mohit Marathe 
AuthorDate: Mon Mar 25 13:08:57 2024 +0530
Commit: Michael Weghorn 
CommitDate: Mon Mar 25 13:14:32 2024 +0100

tdf#147021 replace SAL_N_ELEMENTS() with std::size()

Change-Id: I8d704123aaa968352033d1b6680d5da6153eba21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165268
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/stoc/test/uriproc/test_uriproc.cxx 
b/stoc/test/uriproc/test_uriproc.cxx
index aa96e6a86bf8..02cc9d027ecb 100644
--- a/stoc/test/uriproc/test_uriproc.cxx
+++ b/stoc/test/uriproc/test_uriproc.cxx
@@ -188,7 +188,7 @@ void Test::testParse() {
   "/", false, 1, "", "", "", "", "", nullptr, nullptr },
 { "", nullptr, "", true, "",
   "//", false, 2, "", "", "", "", "", nullptr, nullptr } };
-for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
+for (std::size_t i = 0; i < std::size(data); ++i) {
 css::uno::Reference< css::uri::XUriReference > uriRef(
 m_uriFactory->parse(
 OUString::createFromAscii(data[i].uriReference)));
@@ -986,7 +986,7 @@ void Test::testMakeAbsolute() {
   "scheme:/a/../b/c" },
 { "scheme:/a/../b/c", "d", true, 
css::uri::RelativeUriExcessParentSegments_REMOVE,
   "scheme:/b/d" } };
-for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
+for (std::size_t i = 0; i < std::size(data); ++i) {
 css::uno::Reference< css::uri::XUriReference > baseUriRef(
 m_uriFactory->parse(
 OUString::createFromAscii(data[i].baseUriReference)));
@@ -1116,7 +1116,7 @@ void Test::testMakeRelative() {
 { "scheme:/a/b/c", "scheme:/d/e/f", true, true, false, "/d/e/f", 
nullptr },
 { "scheme:a/b/c", "scheme:d/e/f", true, true, false, "scheme:d/e/f", 
nullptr },
 { "scheme:/a/b/c", "scheme:d/e/f", true, true, false, "scheme:d/e/f", 
nullptr } };
-for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
+for (std::size_t i = 0; i < std::size(data); ++i) {
 css::uno::Reference< css::uri::XUriReference > baseUriRef(
 m_uriFactory->parse(
 OUString::createFromAscii(data[i].baseUriReference)));
@@ -1167,7 +1167,7 @@ void Test::testVndSunStarExpand() {
 m_context->getValueByName(
   "/singletons/com.sun.star.util.theMacroExpander"),
 css::uno::UNO_QUERY_THROW);
-for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
+for (std::size_t i = 0; i < std::size(data); ++i) {
 css::uno::Reference< css::uri::XUriReference > uriRef(
 m_uriFactory->parse(
 OUString::createFromAscii(data[i].uriReference)));
@@ -1207,7 +1207,7 @@ void Test::testVndSunStarScript() {
 { "vnd.sun.star.script:name?a=&", nullptr, true, {} },
 { "vnd.sun.star.script:name?key1=&%26=%3D=hello", "name", true,
   { { "key1", "" }, { "key2", nullptr }, { "&", "=" } } } };
-for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
+for (std::size_t i = 0; i < std::size(data); ++i) {
 css::uno::Reference< css::uri::XUriReference > uriRef(
 m_uriFactory->parse(
 OUString::createFromAscii(data[i].uriReference)));
@@ -1363,7 +1363,7 @@ void Test::testTranslator() {
 { "file:///abc/%25ef", "file:///abc/%25ef", true } };
 css::uno::Reference< css::uri::XExternalUriReferenceTranslator >
 
translator(css::uri::ExternalUriReferenceTranslator::create(m_context));
-for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
+for (std::size_t i = 0; i < std::size(data); ++i) {
 if (data[i].toInternal) {
 TEST_ASSERT_EQUAL(
 "testTranslator, translateToInternal", i,
@@ -1394,7 +1394,7 @@ void Test::testPkgUrlFactory() {
   "vnd.sun.star.pkg://file:%2F%2F%2Fa%2525b%252fc%2Fd~e@g%3Fh" } };
 css::uno::Reference< css::uri::XVndSunStarPkgUrlReferenceFactory > factory(
 css::uri::VndSunStarPkgUrlReferenceFactory::create(m_context));
-for (std::size_t i = 0; i < SAL_N_ELEMENTS(data); ++i) {
+for (std::size_t i = 0; i < std::size(data); ++i) {
 css::uno::Reference< css::uri::XUriReference > url(
 factory->createVndSunStarPkgUrlReference(
 m_uriFactory->parse(


core.git: stoc/source

2024-03-21 Thread Mohit Marathe (via logerrit)
 stoc/source/corereflection/base.hxx |6 +-
 stoc/source/corereflection/lrucache.hxx |7 ++-
 2 files changed, 3 insertions(+), 10 deletions(-)

New commits:
commit 370755c72d0b0a5215d2edd45e30782b1e9d0286
Author: Mohit Marathe 
AuthorDate: Wed Mar 20 19:24:59 2024 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Thu Mar 21 16:32:54 2024 +0100

tdf#143148 Use #pragma once instead of include guards

Change-Id: Ia55d226aa308413365659b5537eca7a136ec308a
Signed-off-by: Mohit Marathe 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165064
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/stoc/source/corereflection/base.hxx 
b/stoc/source/corereflection/base.hxx
index 03d844de3cc9..316b388d20bb 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -18,8 +18,7 @@
  */
 //  #define TEST_LIST_CLASSES
 
-#ifndef INCLUDED_STOC_SOURCE_COREREFLECTION_BASE_HXX
-#define INCLUDED_STOC_SOURCE_COREREFLECTION_BASE_HXX
+#pragma once
 
 #include 
 
@@ -400,7 +399,4 @@ inline bool coerce_assign(
 
 }
 
-
-#endif // INCLUDED_STOC_SOURCE_COREREFLECTION_BASE_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/corereflection/lrucache.hxx 
b/stoc/source/corereflection/lrucache.hxx
index d5eebe804f46..a0413fd353a3 100644
--- a/stoc/source/corereflection/lrucache.hxx
+++ b/stoc/source/corereflection/lrucache.hxx
@@ -16,8 +16,8 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_STOC_SOURCE_COREREFLECTION_LRUCACHE_HXX
-#define INCLUDED_STOC_SOURCE_COREREFLECTION_LRUCACHE_HXX
+
+#pragma once
 
 // __CACHE_DIAGNOSE forces cache size to 4 and works only for OUString keys
 //  #define __CACHE_DIAGNOSE 1
@@ -203,7 +203,4 @@ inline void LRU_Cache< t_Key, t_Val, t_KeyHash >::clear()
 typedef LRU_Cache< OUString, css::uno::Any, OUStringHash >
 LRU_CacheAnyByOUString;
 
-
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */