Re: Question about OpenCL VLOOKUP implementation

2024-01-24 Thread Miklos Vajna
Hi Dhiraj,

On Tue, Jan 23, 2024 at 05:59:06PM -0600, Dhiraj Holden 
 wrote:
> I have a question about the OpenCL implementation of VLOOKUP as given in
> sc/source/core/opencl/op_spreadsheet.cxx. Right now, both the unsorted and
> sorted vlookup both do a linear search to find the right value. I am
> wondering if it would be better to do a binary search for sorted vlookup. I
> could take care of that now that I've wrapped my head around this
> implementation.

Just a general suggestion: make sure that you profile your calculation
cost with callgrind or perf and only optimize this if you see it as a
hotspot.

Also, you might want to consider what the normal (on CPU) calculation
for VLOOKUP does: that is the default, so it typically makes sense to
improve the opencl VLOOKUP if the CPU one already does something
similar, to avoid mismatches and additional complexity.

Regards,

Miklos


core.git: Branch 'distro/collabora/co-23.05' - sw/qa writerfilter/source

2024-01-24 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/layout/data/sdt+framePr.docx|binary
 sw/qa/extras/layout/layout2.cxx  |   34 +++
 writerfilter/source/dmapper/DomainMapper.cxx |   18 +++---
 writerfilter/source/dmapper/SdtHelper.hxx|1 
 4 files changed, 49 insertions(+), 4 deletions(-)

New commits:
commit 122b086e4f388df817ba46763e97fe4c7210b229
Author: Mike Kaganski 
AuthorDate: Mon Jan 22 19:10:29 2024 +0600
Commit: Miklos Vajna 
CommitDate: Thu Jan 25 08:40:45 2024 +0100

tdf#159259: make sure to set FieldStartRange in sdt helper

... also for field case.
Unfortunately, it is not really clear, if the anagement of this could
be moved to DomainMapper_Impl. There are several insertion contexts;
they may use different insertion points; there maybe could be cases
when an inserted content should not go into the current sdt (?). Thus,
I didn't put the code into DomainMapper_Impl::appendTextContent(),
where the field character is inserted. Instead, I added code to check
and set the start range in the same place as for the normal text: we
know for sure, that if it were a normal text, we would append it to
GetCurrentTextRange()->getEnd() - so do the same for fields.

My concern that still stays is that the use of hasUnusedText looks
hackish and fragile. Inserted fields don't set it - so the code that
depends on empty sdt will not notice it. OTOH, it can't set it: this
would break inserting field result for an already inserted command.
Possibly all handling of sdt should be refactored at some point.

Change-Id: I7a783aab2400d9a9c1f9f2e5607c872cb58d346b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162398
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162427
Reviewed-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162506
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/sw/qa/extras/layout/data/sdt+framePr.docx 
b/sw/qa/extras/layout/data/sdt+framePr.docx
new file mode 100644
index ..d46bcbfaa774
Binary files /dev/null and b/sw/qa/extras/layout/data/sdt+framePr.docx differ
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index 27072238dc5c..adb9e7a4276f 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -2918,6 +2918,40 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf156725)
 
"/root/page[2]/body/txt/anchored/fly/column[2]/body/section/column[2]/body/txt",
 1);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf159259)
+{
+// Given a document with a block sdt with a single field, having framePr 
aligned to right
+createSwDoc("sdt+framePr.docx");
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+// Make sure there is only one page and one paragraph with one line and 
one anchored object
+assertXPath(pXmlDoc, "/root/page", 1);
+// Without the fix, this would fail: there were two paragraphs
+assertXPath(pXmlDoc, "/root/page/body/txt", 1);
+assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion", 1);
+assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout", 1);
+// Without the fix, this would fail: there was a field portion in the line
+assertXPath(pXmlDoc, 
"/root/page/body/txt/SwParaPortion/SwLineLayout/SwFieldPortion", 0);
+// Without the fix, this would fail: there was no anchored objects
+assertXPath(pXmlDoc, "/root/page/body/txt/anchored", 1);
+assertXPath(pXmlDoc, "/root/page/body/txt/anchored/fly", 1);
+
+const sal_Int32 paraRight
+= getXPath(pXmlDoc, "/root/page/body/txt/infos/bounds", 
"right").toInt32();
+const sal_Int32 paraHeight
+= getXPath(pXmlDoc, "/root/page/body/txt/infos/bounds", 
"height").toInt32();
+
+CPPUNIT_ASSERT_GREATER(sal_Int32(0), paraRight);
+CPPUNIT_ASSERT_GREATER(sal_Int32(0), paraHeight);
+
+const sal_Int32 flyRight
+= getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", 
"right").toInt32();
+const sal_Int32 flyHeight
+= getXPath(pXmlDoc, "/root/page/body/txt/anchored/fly/infos/bounds", 
"height").toInt32();
+
+CPPUNIT_ASSERT_EQUAL(paraRight, flyRight); // The fly is right-aligned
+CPPUNIT_ASSERT_EQUAL(paraHeight, flyHeight);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index 6813736dc4c5..c2d7eb73ba64 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -4362,14 +4362,24 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, 
size_t len)
 }
 else if (m_pImpl->IsOpenFieldCommand() && 
!m_pImpl->IsForceGenericFields())
 {
-if (bInSdtBlockText && m_p

core.git: Branch 'distro/collabora/co-24.04' - 3 commits - editeng/qa editeng/source sc/CppunitTest_sc_tiledrendering2.mk sc/Module_sc.mk sc/qa sw/qa sw/source

2024-01-24 Thread Miklos Vajna (via logerrit)
 editeng/qa/unit/core-test.cxx   |   61 
 editeng/source/editeng/editeng.cxx  |7 
 editeng/source/editeng/impedit2.cxx |   33 ++
 sc/CppunitTest_sc_tiledrendering2.mk|   75 +
 sc/Module_sc.mk |1 
 sc/qa/unit/tiledrendering/tiledrendering.cxx|   26 -
 sc/qa/unit/tiledrendering2/tiledrendering2.cxx  |  166 
 sw/qa/core/layout/data/floattable-not-wrapped-by-table.docx |binary
 sw/qa/core/layout/tabfrm.cxx|   22 +
 sw/source/core/layout/tabfrm.cxx|   15 -
 10 files changed, 375 insertions(+), 31 deletions(-)

New commits:
commit 26a45d7809ca5a90e36a90ee14bf56d555adf278
Author: Miklos Vajna 
AuthorDate: Tue Jan 23 15:34:07 2024 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 25 08:34:21 2024 +0100

tdf#159017 sw floattable: only shift to the right when needed

Regression from commit 868140fcc1311259b9d5f37b33d226511a53
(tdf#60558 sw floattable: allow wrap of table on the right of a
floattable, 2023-12-05), the document had an inline table, followed by a
floating table, and we moved the inline table to the right even if the
left hand side of the floating table already had enough space.

What happens here is that nominally the inline table's original position
overlaps, but because the table width is small enough, such an overlap
doesn't actually happen. In this case, it's not needed to shift the
inline table to the right.

Fix the problem by making the check that decides whether it's necessary
to increment the left margin of the table more strict: it's not enough
to have enough space on the right of the fly, it's also needed to *not*
have enough space on the left side.

This keeps the original "floating table wrapped by inline table on the
right" use-case working, but restores the ~no left margin for the inline
table for the new bugdoc.

(cherry picked from commit 5df7c66193d55af944b3269f11374e60da437c0b)

Change-Id: Ifb30d90ca6dba7cc4a402d8a4445251120b575ae
Tested-by: Jenkins
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162464
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/core/layout/data/floattable-not-wrapped-by-table.docx 
b/sw/qa/core/layout/data/floattable-not-wrapped-by-table.docx
new file mode 100644
index ..2c255148d351
Binary files /dev/null and 
b/sw/qa/core/layout/data/floattable-not-wrapped-by-table.docx differ
diff --git a/sw/qa/core/layout/tabfrm.cxx b/sw/qa/core/layout/tabfrm.cxx
index 9357fc2df133..61b1a25109f5 100644
--- a/sw/qa/core/layout/tabfrm.cxx
+++ b/sw/qa/core/layout/tabfrm.cxx
@@ -199,6 +199,28 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyWrappedByTable)
 // i.e. the inline table was under the floating one, not on the right of 
it.
 CPPUNIT_ASSERT_LESS(nFloatingBottom, nInlineTop);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testInlineTableThenSplitFly)
+{
+// Given a document with a floating table ("right") and an inline table 
("left"):
+// When laying out the document:
+createSwDoc("floattable-not-wrapped-by-table.docx");
+
+// Then make sure the inline table is on the left (small negative offset):
+SwDoc* pDoc = getSwDoc();
+SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+auto pPage = pLayout->Lower()->DynCastPageFrame();
+CPPUNIT_ASSERT(pPage);
+SwFrame* pBody = pPage->FindBodyCont();
+auto pTab = pBody->GetLower()->GetNext()->DynCastTabFrame();
+SwTwips nInlineLeft = pTab->getFramePrintArea().Left();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected less than: 0
+// - Actual  : 6958
+// i.e. "left" was on the right, its horizontal margin was not a small 
negative value but a
+// large positive one.
+CPPUNIT_ASSERT_LESS(static_cast(0), nInlineLeft);
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 033f692f47cc..f75782456181 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -3296,6 +3296,7 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
 
 bool bShiftDown = css::text::WrapTextMode_NONE == nSurround;
 bool bSplitFly = pFly->IsFlySplitAllowed();
+const SwRect aFlyRectWithoutSpaces = pFly->GetObjRect();
 if (!bShiftDown && bAddVerticalFlyOffsets)
 {
 if (nSurround == text::WrapTextMode_PARALLEL && 
isHoriOrientShiftDown)
@@ -3310,7 +3311,6 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
 
 // Ignore spacing when determining the left/right edge of the 
fly, like
 // Word does.
-const SwRect aFlyRectWithoutSpaces = pFl

core.git: sc/CppunitTest_sc_tiledrendering2.mk sc/Module_sc.mk sc/qa

2024-01-24 Thread Miklos Vajna (via logerrit)
 sc/CppunitTest_sc_tiledrendering2.mk   |   75 +++
 sc/Module_sc.mk|1 
 sc/qa/unit/tiledrendering/tiledrendering.cxx   |   26 ---
 sc/qa/unit/tiledrendering2/tiledrendering2.cxx |  166 +
 4 files changed, 242 insertions(+), 26 deletions(-)

New commits:
commit a2763fe7b6f22e3e65d7e0db62b6ada967ccdd61
Author: Miklos Vajna 
AuthorDate: Tue Jan 23 17:08:44 2024 +0100
Commit: Miklos Vajna 
CommitDate: Thu Jan 25 08:16:26 2024 +0100

CppunitTest_sc_tiledrendering2: extract one test from the old, large suite

Not a split, to avoid too many conflicts while cherry-picking, but at
least create a new suite where next tests can be added without too much
build time after source code edits.

Change-Id: I494df6e23941845a433aab6ec5ecef040feab30e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162473
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/sc/CppunitTest_sc_tiledrendering2.mk 
b/sc/CppunitTest_sc_tiledrendering2.mk
new file mode 100644
index ..d360780428a6
--- /dev/null
+++ b/sc/CppunitTest_sc_tiledrendering2.mk
@@ -0,0 +1,75 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sc_tiledrendering2))
+
+$(eval $(call gb_CppunitTest_use_common_precompiled_header,sc_tiledrendering2))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sc_tiledrendering2, \
+sc/qa/unit/tiledrendering2/tiledrendering2 \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sc_tiledrendering2, \
+comphelper \
+cppu \
+cppuhelper \
+editeng \
+sal \
+sfx \
+sot \
+svl \
+svt \
+svxcore \
+sc \
+scfilt \
+scui \
+subsequenttest \
+test \
+unotest \
+$(call gb_Helper_optional,SCRIPTING, \
+vbahelper) \
+vcl \
+tl \
+utl \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sc_tiledrendering2,\
+boost_headers \
+libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sc_tiledrendering2,\
+-I$(SRCDIR)/sc/source/ui/inc \
+-I$(SRCDIR)/sc/inc \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_sdk_api,sc_tiledrendering2))
+$(eval $(call gb_CppunitTest_use_api,sc_tiledrendering2,oovbaapi))
+
+$(eval $(call gb_CppunitTest_use_ure,sc_tiledrendering2))
+$(eval $(call gb_CppunitTest_use_vcl,sc_tiledrendering2))
+
+$(eval $(call gb_CppunitTest_use_rdb,sc_tiledrendering2,services))
+
+$(eval $(call gb_CppunitTest_use_configuration,sc_tiledrendering2))
+
+$(eval $(call gb_CppunitTest_add_arguments,sc_tiledrendering2, \
+
-env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"{$(gb_Helper_LIBRARY_PATH_VAR)+=$(gb_Helper_LIBRARY_PATH_VAR)}"
 \
+))
+
+$(eval $(call gb_CppunitTest_use_uiconfigs,sc_tiledrendering2, \
+modules/scalc \
+sfx \
+svt \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index af2450d9d14d..a159c957d988 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -70,6 +70,7 @@ ifneq ($(DISABLE_GUI),TRUE)
 ifeq ($(OS),LINUX)
 $(eval $(call gb_Module_add_check_targets,sc,\
CppunitTest_sc_tiledrendering \
+   CppunitTest_sc_tiledrendering2 \
 ))
 endif
 endif
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 702194664eb5..14b80dde4ca7 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -3594,32 +3594,6 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, 
testStatusBarLocale)
 CPPUNIT_ASSERT_EQUAL(std::string("de-DE"), aLocale);
 }
 
-CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testSidebarLocale)
-{
-ScModelObj* pModelObj = createDoc("chart.ods");
-int nView1 = SfxLokHelper::getView();
-ViewCallback aView1;
-SfxViewShell* pView1 = SfxViewShell::Current();
-pView1->SetLOKLocale("en-US");
-SfxLokHelper::createView();
-ViewCallback aView2;
-SfxViewShell* pView2 = SfxViewShell::Current();
-pView2->SetLOKLocale("de-DE");
-TestLokCallbackWrapper::InitializeSidebar();
-Scheduler::ProcessEventsToIdle();
-aView2.m_aStateChanges.clear();
-
-pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONDOWN, 
/*x=*/1,/*y=*/1,/*count=*/2, /*buttons=*/1, /*modifier=*/0);
-pModelObj->postMouseEvent(LOK_MOUSEEVENT_MOUSEBUTTONUP, /*x=*/1, /*y=*/1, 
/*count=*/2, /*buttons=*/1, /*modifier=*/0);
-SfxLokHelper::setView(nView1);
-Scheduler::ProcessEventsToIdle();
-
-auto it = aView2.m_aStateChanges.find(".uno:

core.git: bin/gbuild-to-ide

2024-01-24 Thread Mike Kaganski (via logerrit)
 bin/gbuild-to-ide |  240 +++---
 1 file changed, 68 insertions(+), 172 deletions(-)

New commits:
commit 5d1eafab5233e6eaaf99071554b5b41addf7fa56
Author: Mike Kaganski 
AuthorDate: Thu Jan 25 11:36:55 2024 +0600
Commit: Mike Kaganski 
CommitDate: Thu Jan 25 07:44:48 2024 +0100

Deduplicate, refactor and simplify GbuildLinkTarget initialization

Change-Id: I0c2d9823454ff84af2967c20a383b334e4933967
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162550
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 730191a9f127..5869870de1a9 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -26,101 +26,14 @@ import collections
 import urllib.parse
 
 class GbuildLinkTarget:
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, linked_static_libs, 
link_target):
-(self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.cobjects, self.objcxxobjects, self.cflags, 
self.linked_libs, self.linked_static_libs, self.link_target) = (
-name, location, include, include_sys, defs, cxxobjects, cxxflags, 
cobjects, objcxxobjects, cflags, linked_libs, linked_static_libs, link_target)
-
-def short_name(self):
-return self.name
-
-def is_empty(self):
-return not self.include and not self.defs and not self.cxxobjects and 
not self.cobjects and not self.linked_libs and not self.linked_static_libs
-
-def __str__(self):
-return '%s at %s with include path: %s, isystem includes: %s, defines: 
%s, objects: %s, cxxflags: %s, cobjects: %s, cflags: %s, linked libs: %s and 
linked static libs: %s' % (
-self.short_name(), self.location, self.include, self.include_sys, 
self.defs, self.cxxobjects,
-self.cxxflags, self.cobjects, self.cflags, self.linked_libs, 
self.linked_static_libs)
-
-
-class GbuildLib(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, linked_static_libs, 
link_target):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs, 
linked_static_libs, link_target)
-
-def short_name(self):
-"""Return the short name of target based on the Library_* makefile 
name"""
-return 'Library %s' % self.name
-
-def target_name(self):
-return 'Library_%s' % self.name
-
-def library_name(self):
-return self.name
-
-class GbuildStaticLib(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, linked_static_libs, 
link_target):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs, 
linked_static_libs, link_target)
-
-def short_name(self):
-"""Return the short name of target based on the StaticLibrary_* 
makefile name"""
-return 'StaticLibrary %s' % self.name
-
-def target_name(self):
-return 'StaticLibrary_%s' % self.name
-
-def library_name(self):
-return self.name
-
-class GbuildTest(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, linked_static_libs, 
link_target):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs, 
linked_static_libs, link_target)
-
-def short_name(self):
-"""Return the short name of target based n the CppunitTest_* makefile 
names"""
-return 'CppunitTest %s' % self.name
-
-def target_name(self):
-return 'CppunitTest_%s' % self.name
-
-class GbuildExe(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, linked_static_libs, 
link_target):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs, 
linked_static_libs, link_target)
-
-def short_name(self):
-"""Return the short name of target based on the Executable_* makefile 
name"""
-return 'Executable %s' % self.name
-
-def target_name(self):
-return 'Executable_%s' % self.name
-
-
-class GbuildParser:
-"""Main data model object.
-
-Attributes:
-target_by_path : dict[path:string, set(target)]
-   where target is one of the GbuildLinkTarget 
subclasses
-target_by_location : dict[path:string, set(target)]
-   

core.git: 2 commits - sc/source

2024-01-24 Thread Noel Grandin (via logerrit)
 sc/source/ui/inc/tabvwsh.hxx   |2 
 sc/source/ui/view/tabvwshf.cxx |  463 +
 2 files changed, 242 insertions(+), 223 deletions(-)

New commits:
commit c38ebb561211e55d0a7eb5d2e3db6975f0cadbfc
Author: Noel Grandin 
AuthorDate: Wed Jan 24 12:36:03 2024 +0200
Commit: Noel Grandin 
CommitDate: Thu Jan 25 07:01:15 2024 +0100

split out set-bg-col logic from ScTabViewShell::ExecuteTable

Change-Id: I528d99fbd8e369a0ceaa51184e336d24a4510706
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162510
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 1191669f09c7..a5cafcb885d2 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -459,6 +459,7 @@ private:
 void ExecuteInsertTable( SfxRequest& rReq );
 void DoInsertTableFromDialog( SfxRequest& rReq, const 
VclPtr& pDlg );
 void ExecuteAppendOrRenameTable( SfxRequest& rReq );
+void ExecuteSetTableBackgroundCol( SfxRequest& rReq );
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index dd64c9e14dd1..0440fe8ac019 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -431,109 +431,8 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
 
 case FID_TAB_SET_TAB_BG_COLOR:
 case FID_TAB_MENU_SET_TAB_BG_COLOR:
-{
-if ( nSlot == FID_TAB_MENU_SET_TAB_BG_COLOR )
-nSlot = FID_TAB_SET_TAB_BG_COLOR;
-SCTAB nTabNr = rViewData.GetTabNo();
-ScMarkData& rMark = rViewData.GetMarkData();
-SCTAB nTabSelCount = rMark.GetSelectCount();
-if ( !rDoc.IsDocEditable() )
-break;
-
-if ( rDoc.IsTabProtected( nTabNr ) ) // ||nTabSelCount > 1
-break;
-
-if( pReqArgs != nullptr )
-{
-boolbDone = false;
-const SfxPoolItem*  pItem;
-Color   aColor;
-
-if( pReqArgs->HasItem( nSlot, &pItem ) )
-aColor = static_cast(pItem)->GetValue();
-
-if ( nTabSelCount > 1 )
-{
-std::unique_ptr
-pTabColorList(new ScUndoTabColorInfo::List);
-for (const auto& rTab : rMark)
-{
-if ( !rDoc.IsTabProtected(rTab) )
-{
-ScUndoTabColorInfo aTabColorInfo(rTab);
-aTabColorInfo.maNewTabBgColor = aColor;
-pTabColorList->push_back(aTabColorInfo);
-}
-}
-bDone = SetTabBgColor( *pTabColorList );
-}
-else
-{
-bDone = SetTabBgColor( aColor, nCurrentTab ); 
//ScViewFunc.SetTabBgColor
-}
-if( bDone )
-{
-rReq.Done( *pReqArgs );
-}
-}
-else
-{
-sal_uInt16  nRet= RET_OK; /// temp
-boolbDone   = false; /// temp
-
-Color aTabBgColor = rDoc.GetTabBgColor( nCurrentTab );
-ScAbstractDialogFactory* pFact = 
ScAbstractDialogFactory::Create();
-ScopedVclPtr 
pDlg(pFact->CreateScTabBgColorDlg(
-GetFrameWeld(),
-
ScResId(SCSTR_SET_TAB_BG_COLOR),
-
ScResId(SCSTR_NO_TAB_BG_COLOR),
-aTabBgColor));
-while ( !bDone && nRet == RET_OK )
-{
-nRet = pDlg->Execute();
-if( nRet == RET_OK )
-{
-Color aSelectedColor;
-pDlg->GetSelectedColor(aSelectedColor);
-std::unique_ptr
-pTabColorList(new ScUndoTabColorInfo::List);
-if ( nTabSelCount > 1 )
-{
-for (const auto& rTab : rMark)
-{
-if ( !rDoc.IsTabProtected(rTab) )
-{
-ScUndoTabColorInfo aTabColorInfo(rTab);
-aTab

Outreachy week 8

2024-01-24 Thread khushi gautam
Hi all,
My project is making good progress. Last week jim and I sat up on a video
call as the issues were not being resolved by the email. It was a good
session with Jim. I Learned about so many new techniques of LO and VS code
which I didn't know. Those key points made my work easier and better.

Currently, the QuickfindPanel is able to fetch the strings with the entry
keyword within that. I first worked on fetching the keyword that is being
searched to display in the panel and not with a whole paragraph.
Afterwards, I worked on fetching the left and right side characters of the
searched keywords.

Edited the UI as well on Glade. What I added is the treeview column using
glade. Afterwards, I added the connectors for custom rendering of the
treeview.
void connect_custom_get_size
void connect_custom_render
still working on making the proper functionality of the defined members.

I did some code formatting as well. Removed unnecessary headers.

Thank You
Khushi


core.git: bin/gbuild-to-ide solenv/gbuild

2024-01-24 Thread Mike Kaganski (via logerrit)
 bin/gbuild-to-ide |   77 +-
 solenv/gbuild/StaticLibrary.mk|4 +
 solenv/gbuild/extensions/post_GbuildToJson.mk |9 ++-
 3 files changed, 75 insertions(+), 15 deletions(-)

New commits:
commit 566bb271b8fe5882f24fef230e06c2af4ea12b33
Author: Mike Kaganski 
AuthorDate: Thu Jan 25 00:29:35 2024 +0600
Commit: Mike Kaganski 
CommitDate: Thu Jan 25 02:39:35 2024 +0100

add static libraries to gbuildtojson

... and to vs-ide-integration solution.

Change-Id: I5085e6a61df4bc03cfe595a1e6b99196f6f73643
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162524
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/bin/gbuild-to-ide b/bin/gbuild-to-ide
index 2d9aee089654..730191a9f127 100755
--- a/bin/gbuild-to-ide
+++ b/bin/gbuild-to-ide
@@ -26,25 +26,25 @@ import collections
 import urllib.parse
 
 class GbuildLinkTarget:
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, link_target):
-(self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.cobjects, self.objcxxobjects, self.cflags, 
self.linked_libs, self.link_target) = (
-name, location, include, include_sys, defs, cxxobjects, cxxflags, 
cobjects, objcxxobjects, cflags, linked_libs, link_target)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, linked_static_libs, 
link_target):
+(self.name, self.location, self.include, self.include_sys, self.defs, 
self.cxxobjects, self.cxxflags, self.cobjects, self.objcxxobjects, self.cflags, 
self.linked_libs, self.linked_static_libs, self.link_target) = (
+name, location, include, include_sys, defs, cxxobjects, cxxflags, 
cobjects, objcxxobjects, cflags, linked_libs, linked_static_libs, link_target)
 
 def short_name(self):
 return self.name
 
 def is_empty(self):
-return not self.include and not self.defs and not self.cxxobjects and 
not self.cobjects and not self.linked_libs
+return not self.include and not self.defs and not self.cxxobjects and 
not self.cobjects and not self.linked_libs and not self.linked_static_libs
 
 def __str__(self):
-return '%s at %s with include path: %s, isystem includes: %s, defines: 
%s, objects: %s, cxxflags: %s, cobjects: %s, cflags: %s and linked libs: %s' % (
+return '%s at %s with include path: %s, isystem includes: %s, defines: 
%s, objects: %s, cxxflags: %s, cobjects: %s, cflags: %s, linked libs: %s and 
linked static libs: %s' % (
 self.short_name(), self.location, self.include, self.include_sys, 
self.defs, self.cxxobjects,
-self.cxxflags, self.cobjects, self.cflags, self.linked_libs)
+self.cxxflags, self.cobjects, self.cflags, self.linked_libs, 
self.linked_static_libs)
 
 
 class GbuildLib(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, link_target):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs, 
link_target)
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, linked_static_libs, 
link_target):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs, 
linked_static_libs, link_target)
 
 def short_name(self):
 """Return the short name of target based on the Library_* makefile 
name"""
@@ -56,9 +56,23 @@ class GbuildLib(GbuildLinkTarget):
 def library_name(self):
 return self.name
 
+class GbuildStaticLib(GbuildLinkTarget):
+def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, linked_static_libs, 
link_target):
+GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_libs, 
linked_static_libs, link_target)
+
+def short_name(self):
+"""Return the short name of target based on the StaticLibrary_* 
makefile name"""
+return 'StaticLibrary %s' % self.name
+
+def target_name(self):
+return 'StaticLibrary_%s' % self.name
+
+def library_name(self):
+return self.name
+
 class GbuildTest(GbuildLinkTarget):
-def __init__(self, name, location, include, include_sys, defs, cxxobjects, 
cxxflags, cobjects, objcxxobjects, cflags, linked_libs, link_target):
-GbuildLinkTarget.__init__(self, name, location, include, include_sys, 
defs, cxxobjects, cxxflags, cobjects, objcxxobjects, cflags, linked_l

core.git: editeng/source include/editeng include/svl svl/source

2024-01-24 Thread Armin Le Grand (allotropia) (via logerrit)
 editeng/source/items/frmitems.cxx |8 +-
 editeng/source/items/paraitem.cxx |4 -
 editeng/source/items/textitem.cxx |   58 +--
 include/editeng/udlnitem.hxx  |9 +-
 include/svl/poolitem.hxx  |   27 ++-
 svl/source/items/cenumitm.cxx |   13 ++-
 svl/source/items/itemset.cxx  |  141 --
 7 files changed, 188 insertions(+), 72 deletions(-)

New commits:
commit 37f148c58974210707e069f21da2cc2b9ae086dd
Author: Armin Le Grand (allotropia) 
AuthorDate: Wed Jan 24 17:53:19 2024 +0100
Commit: Armin Le Grand 
CommitDate: Thu Jan 25 01:58:36 2024 +0100

ITEM: Slight re-design of global Item-Reusage

Unfortunately I had overseen something with derived
classes, but it came now up on CI ASan/UBsan build
with a failing UnitTest - thanks to pointing me at
it.

The ItemInstanceManager at the SfxPoolItems are now
no longer static but constructed instances returned
on-demand.

Also added checks to really use an incarnated/
registered one *only* for that derivation and made
sure this is now correctly supported.

Had to change again, using createItemInstanceManager
to always create instances was less effective than
intended, back to getItemInstanceManager & static
instances in the Item implementations. Also added
some stuff to implCreateItemEntry/implCleanupItemEntry
to be more effective, e.g. direct handling of
slot stuff in latter one. Also some more asserts
and comments. Slot stuff is now handled without
RefCounting, takes some write accesses away...

Change-Id: I6cd69556b416510b5b23549dd042ff3ba19d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162521
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/editeng/source/items/frmitems.cxx 
b/editeng/source/items/frmitems.cxx
index c3a5836b082a..e84ae2140e33 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3980,8 +3980,8 @@ void SvxLineItem::SetLine( const SvxBorderLine* pNew )
 
 ItemInstanceManager* SvxBrushItem::getItemInstanceManager() const
 {
-static DefaultItemInstanceManager aManager;
-return &aManager;
+static DefaultItemInstanceManager 
aInstanceManager(typeid(SvxBrushItem).hash_code());
+return &aInstanceManager;
 }
 
 SvxBrushItem::SvxBrushItem(sal_uInt16 _nWhich)
@@ -4598,8 +4598,8 @@ void SvxBrushItem::dumpAsXml(xmlTextWriterPtr pWriter) 
const
 
 ItemInstanceManager* SvxFrameDirectionItem::getItemInstanceManager() const
 {
-static DefaultItemInstanceManager aManager;
-return &aManager;
+static DefaultItemInstanceManager 
aInstanceManager(typeid(SvxFrameDirectionItem).hash_code());
+return &aInstanceManager;
 }
 
 SvxFrameDirectionItem::SvxFrameDirectionItem( SvxFrameDirection nValue ,
diff --git a/editeng/source/items/paraitem.cxx 
b/editeng/source/items/paraitem.cxx
index 2a9a514a6461..e080b517eb43 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -340,8 +340,8 @@ void SvxLineSpacingItem::SetEnumValue( sal_uInt16 nVal )
 
 ItemInstanceManager* SvxAdjustItem::getItemInstanceManager() const
 {
-static DefaultItemInstanceManager aManager;
-return &aManager;
+static DefaultItemInstanceManager 
aInstanceManager(typeid(SvxAdjustItem).hash_code());
+return &aInstanceManager;
 }
 
 SvxAdjustItem::SvxAdjustItem(const SvxAdjust eAdjst, const sal_uInt16 nId )
diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index 0bed0a7d077d..77e4c6c9cda0 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -168,8 +168,17 @@ namespace
 {
 SvxFontItemMap  maRegistered;
 
+public:
+SvxFontItemInstanceManager()
+: ItemInstanceManager(typeid(SvxFontItem).hash_code())
+{
+}
+
+private:
 static size_t hashCode(const SfxPoolItem&);
 
+// standard interface, accessed exclusively
+// by implCreateItemEntry/implCleanupItemEntry
 virtual const SfxPoolItem* find(const SfxPoolItem&) const override;
 virtual void add(const SfxPoolItem&) override;
 virtual void remove(const SfxPoolItem&) override;
@@ -209,8 +218,8 @@ namespace
 
 ItemInstanceManager* SvxFontItem::getItemInstanceManager() const
 {
-static SvxFontItemInstanceManager aManager;
-return &aManager;
+static SvxFontItemInstanceManager aInstanceManager;
+return &aInstanceManager;
 }
 
 SvxFontItem::SvxFontItem(
@@ -439,8 +448,8 @@ void SvxFontItem::dumpAsXml(xmlTextWriterPtr pWriter) const
 
 ItemInstanceManager* SvxPostureItem::getItemInstanceManager() const
 {
-static DefaultItemInstanceManager aManager;
-return &aManager;
+static DefaultItemInstanceManager 
aInstanceManager(typeid(SvxPostureItem).hash_code());
+return &aInstanceManager;
 }
 
 SvxPostureItem::SvxPostureItem( const FontItalic 

core.git: Branch 'distro/collabora/co-23.05' - desktop/source

2024-01-24 Thread Caolán McNamara (via logerrit)
 desktop/source/lib/init.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 066c768d67cf640df89aa69e864171b55f6a4918
Author: Caolán McNamara 
AuthorDate: Tue Jan 23 19:37:54 2024 +
Commit: Andras Timar 
CommitDate: Wed Jan 24 22:25:59 2024 +0100

preload sal_textenc

use RTL_TEXTENCODING_MS_1250 to trigger Impl_getTextEncodingData to
dlopen sal_textenclo early

Change-Id: Ie96b81615cbd4b479d731916518835b2f72adf6a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162458
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 60618c6b9dc1..238f2f76d935 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -7476,6 +7476,12 @@ static void preloadData()
 if(bAbort)
 std::cerr << "CheckExtensionDependencies failed" << std::endl;
 
+std::cerr << "Preload textencodings"; // sal_textenc
+// Use RTL_TEXTENCODING_MS_1250 to trigger Impl_getTextEncodingData
+// to dlopen sal_textenclo
+(void)OUStringToOString(u"arbitrary string", RTL_TEXTENCODING_MS_1250);
+std::cerr << "
";
+
 // setup LanguageTool config before spell checking init
 setLanguageToolConfig();
 


core.git: editeng/qa editeng/source

2024-01-24 Thread Miklos Vajna (via logerrit)
 editeng/qa/unit/core-test.cxx   |   60 
 editeng/source/editeng/editeng.cxx  |7 
 editeng/source/editeng/impedit2.cxx |   33 +++
 3 files changed, 99 insertions(+), 1 deletion(-)

New commits:
commit ce53519f025158f8f64a4e8603c8c6e0dc35473a
Author: Miklos Vajna 
AuthorDate: Wed Jan 24 12:17:41 2024 +0100
Commit: Miklos Vajna 
CommitDate: Wed Jan 24 22:21:04 2024 +0100

cool#8023 editeng: support HTML paste

editeng text (e.g. Writer shape text or Calc cell text edit) had working
plain text and RTF paste, but HTML paste was not working.

This is typically not noticed because desktop paste usually goes via
RTF, but it can be visible when a LOK client just puts the best format
on the clipboard, i.e. HTML is provided, but RTF is unavailable in the
browser and plain text is also not written to the LOK clipboard.

Fix the problem by connecting the existing ImpEditEngine::ReadHTML() to
the generic ImpEditEngine::PasteText(): this already worked for plain
text and RTF, but not for HTML.

Note that "SIMPLE_HTML" was already supported, but that's not really
HTML but some custom format that contains HTML, and it's claimed that MS
IE 4.0 produced this.

Change-Id: Ib41529c66d9bda30cc4ed5faca4a99274ae594d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162449
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 097602ec6b4c..c70fd56a1d29 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -80,6 +80,9 @@ public:
 /// Test Copy/Paste using Legacy Format
 void testCopyPaste();
 
+/// Test Paste using HTML
+void testHTMLPaste();
+
 /// Test Copy/Paste with selective selection over multiple paragraphs
 void testMultiParaSelCopyPaste();
 
@@ -128,6 +131,7 @@ public:
 CPPUNIT_TEST(testAutocorrect);
 CPPUNIT_TEST(testHyperlinkCopyPaste);
 CPPUNIT_TEST(testCopyPaste);
+CPPUNIT_TEST(testHTMLPaste);
 CPPUNIT_TEST(testMultiParaSelCopyPaste);
 CPPUNIT_TEST(testTabsCopyPaste);
 CPPUNIT_TEST(testHyperlinkSearch);
@@ -712,6 +716,62 @@ void Test::testCopyPaste()
 CPPUNIT_ASSERT_EQUAL( OUString(aText + aText), 
rDoc.GetParaAsString(sal_Int32(0)) );
 }
 
+/// XTransferable implementation that provides simple HTML content.
+class TestHTMLTransferable : public 
cppu::WeakImplHelper
+{
+public:
+uno::Any SAL_CALL getTransferData(const datatransfer::DataFlavor& rFlavor) 
override;
+uno::Sequence SAL_CALL getTransferDataFlavors() 
override;
+sal_Bool SAL_CALL isDataFlavorSupported(const datatransfer::DataFlavor& 
rFlavor) override;
+};
+
+uno::Any TestHTMLTransferable::getTransferData(const datatransfer::DataFlavor& 
rFlavor)
+{
+if (rFlavor.MimeType != "text/html")
+{
+return {};
+}
+
+uno::Any aRet;
+SvMemoryStream aStream;
+aStream.WriteOString("
test");
+aRet <<= uno::Sequence(static_cast(aStream.GetData()), aStream.GetSize());
+return aRet;
+}
+
+uno::Sequence 
TestHTMLTransferable::getTransferDataFlavors()
+{
+datatransfer::DataFlavor aFlavor;
+aFlavor.DataType = cppu::UnoType>::get();
+aFlavor.MimeType = "text/html";
+aFlavor.HumanPresentableName = aFlavor.MimeType;
+return { aFlavor };
+}
+
+sal_Bool TestHTMLTransferable::isDataFlavorSupported(const 
datatransfer::DataFlavor& rFlavor)
+{
+return rFlavor.MimeType == "text/html"
+   && rFlavor.DataType == 
cppu::UnoType>::get();
+}
+
+void Test::testHTMLPaste()
+{
+// Given an empty editeng document:
+EditEngine aEditEngine(mpItemPool.get());
+EditDoc &rDoc = aEditEngine.GetEditDoc();
+uno::Reference< datatransfer::XTransferable > xData(new 
TestHTMLTransferable);
+
+// When trying to paste HTML:
+aEditEngine.InsertText(xData, OUString(), rDoc.GetEndPaM(), true);
+
+// Then make sure the text gets pasted:
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: test
+// - Actual  :
+// i.e. RTF and plain text paste worked, but not HTML.
+CPPUNIT_ASSERT_EQUAL(OUString("test"), 
rDoc.GetParaAsString(static_cast(0)));
+}
+
 void Test::testMultiParaSelCopyPaste()
 {
 // Create EditEngine's instance
diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 26e8fe3099b4..d4bcfe337c86 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2797,6 +2797,13 @@ bool EditEngine::HasValidData( const 
css::uno::Reference< css::datatransfer::XTr
 datatransfer::DataFlavor aFlavor;
 SotExchange::GetFormatDataFlavor( SotClipboardFormatId::STRING, 
aFlavor );
 bValidData = rTransferable->isDataFlavorSupported( aFlavor );
+
+if (!bValidData)
+{
+// Allow HTML-only clipboard, i.e. without plain 

core.git: configure.ac

2024-01-24 Thread Christian Lohmaier (via logerrit)
 configure.ac |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 6cad8d3a96c5425fe787765e5664463242958a78
Author: Christian Lohmaier 
AuthorDate: Wed Jan 24 13:09:36 2024 +0100
Commit: Christian Lohmaier 
CommitDate: Wed Jan 24 22:20:19 2024 +0100

fix windows aarch64 cross-build wrt REPORTBUILDER

broken after a2a9850217b3f711440283131fdfc58a9a254919 which added the
REPORTBUILDER conditional, but didn't also put it into the special
PERMITTED_BUILD_TARGETS list - so it wasn't set during cross-compilation
and broke the build

C:/cygwin/home/tdf/jenkins/dly/s_master/solenv/gbuild/Configuration.mk:169: 
*** There is no target

C:/cygwin/home/tdf/jenkins/dly/b_master/workdir_for_build/XcuModuleTarget/officecfg/registry/data/org/openoffice/Setup-reportbuilder.xcu.
Stop.

Change-Id: I9474318eae775bcd974e79db0d8340a2d3839412
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162504
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 

diff --git a/configure.ac b/configure.ac
index 33f64d0de3e0..6a85728e2248 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5909,6 +5909,7 @@ if test "$cross_compiling" = "yes"; then
 OPENSSL
 ORCUS
 PYTHON
+REPORTBUILDER
 SCRIPTING
 ZLIB
 ZXCVBN


core.git: Changes to 'refs/tags/cp-23.05.8-1'

2024-01-24 Thread Andras Timar (via logerrit)
Tag 'cp-23.05.8-1' created by Andras Timar  at 
2024-01-24 21:13 +

cp-23.05.8-1

Changes since cp-23.05.7-4-15:
---
 0 files changed
---


translations.git: Changes to 'refs/tags/cp-23.05.8-1'

2024-01-24 Thread Andras Timar (via logerrit)
Tag 'cp-23.05.8-1' created by Andras Timar  at 
2024-01-24 21:13 +

cp-23.05.8-1

Changes since cp-23.05.6-4:
Andras Timar (1):
  Update German translation (easy conditional formatting dialog)

---
 source/de/sc/messages.po |  981 +++
 1 file changed, 494 insertions(+), 487 deletions(-)
---


help.git: Changes to 'refs/tags/cp-23.05.8-1'

2024-01-24 Thread Andras Timar (via logerrit)
Tag 'cp-23.05.8-1' created by Andras Timar  at 
2024-01-24 21:13 +

cp-23.05.8-1

Changes since cp-23.05.5-4-1:
---
 0 files changed
---


dictionaries.git: Changes to 'refs/tags/cp-23.05.8-1'

2024-01-24 Thread Andras Timar (via logerrit)
Tag 'cp-23.05.8-1' created by Andras Timar  at 
2024-01-24 21:13 +

cp-23.05.8-1

Changes since co-23.05-branch-point:
Andras Timar (1):
  On Linux dictionaries are packaged separately

---
 Module_dictionaries.mk |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---


core.git: Branch 'distro/collabora/co-23.05' - configure.ac

2024-01-24 Thread Andras Timar (via logerrit)
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 196b61c553eef277a1ceb39ffc0d35e329a69534
Author: Andras Timar 
AuthorDate: Wed Jan 24 22:12:52 2024 +0100
Commit: Andras Timar 
CommitDate: Wed Jan 24 22:12:52 2024 +0100

Bump version to 23.05.8.1

Change-Id: Ibc07c7c89c340cdad54a1b3fcb36d94304f498ea

diff --git a/configure.ac b/configure.ac
index 068e79a9ab5c..5f0ce2851520 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for 
the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no 
idea.
 
-AC_INIT([Collabora Office],[23.05.7.5],[],[],[https://collaboraoffice.com/])
+AC_INIT([Collabora Office],[23.05.8.1],[],[],[https://collaboraoffice.com/])
 
 dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just 
fine if it is installed
 dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails 
hard


core.git: Branch 'libreoffice-24-2' - sfx2/source

2024-01-24 Thread Xisco Fauli (via logerrit)
 sfx2/source/doc/guisaveas.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c36bb3f22a55af0066b0d81a966ef8932d20bf7b
Author: Xisco Fauli 
AuthorDate: Wed Jan 24 10:03:53 2024 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jan 24 21:41:33 2024 +0100

sfx2: check SfxViewShell::Current()

Seen in 
https://crashreport.libreoffice.org/stats/crash_details/52df6de5-7ea8-48e4-8c45-f18b02d9a767

Change-Id: I56c17234a0f82797d37e26b0c39eeba7f78fcee5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162492
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
(cherry picked from commit 1a4a215bc59e50958b2c04ac405c5200f5811970)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162468

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 657d162ff732..9e06dca31dce 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1485,7 +1485,7 @@ bool SfxStoringHelper::GUIStoreModel( const 
uno::Reference< frame::XModel >& xMo
 }
 }
 
-if (!comphelper::LibreOfficeKit::isActive() && !( m_nStoreMode & 
EXPORT_REQUESTED ) )
+if (!comphelper::LibreOfficeKit::isActive() && !( m_nStoreMode & 
EXPORT_REQUESTED ) && SfxViewShell::Current() )
 {
 SfxObjectShell* pDocShell = SfxViewShell::Current()->GetObjectShell();
 


core.git: Branch 'libreoffice-24-2' - svx/source

2024-01-24 Thread Michael Weghorn (via logerrit)
 svx/source/accessibility/AccessibleShape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit df266f613bc12c18ec8d1c9cdc250fda1bc6c45b
Author: Michael Weghorn 
AuthorDate: Wed Jan 24 10:19:58 2024 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jan 24 21:35:13 2024 +0100

svx a11y: Notify listeners when disposing shape

In `AccessibleShape::disposing`, call the same method
of the base class, i.e. `AccessibleContextBase::disposing`,
not `AccessibleContextBase::dispose`.

The code was moved from `AccessibleShape::dispose` to
`AccessibleShape::disposing` in

commit f11b151dc08ccfcb7e78bfd9a24c77670942ea63
Date:   Tue Apr 30 13:30:10 2002 +

#95585# Moved code from dispose to disposing().

and it seems likely that adjusting the base class method to call
was just forgotten/missed.

This resulted in the accessible getting disposed without listeners
getting notified (since `AccessibleContextBase::disposing` takes
care of that).

This resulted in a crash for the following scenario with the qt6
VCL plugin when the Orca screen reader is running:

1) start LO Writer
2) click on the "Basic shapes" toolbar button
3) click + drag to insert a shape into the document
4) click somewhere else

Backtrace is below.
`AtSpiAdaptor::handleMessage` (frame #12 in the bt) checks
whether the accessible is valid and returns early otherwise.
But since listeners were not notified when the object got disposed,
`QtAccessibleEventListener::disposing` wasn't called, which would
have taken care of invalidating the `QtAccessibleWidget`, in which
case this early return would have happened instead of the crash.

This behaves as expected now with this commit in place.

stderr output of the crash:

terminate called after throwing an instance of 
'com::sun::star::lang::DisposedException'

Backtrace:

Thread 1 received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x7f5bc1ca815f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7f5bc1c5a472 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x7f5bc1c444b2 in __GI_abort () at ./stdlib/abort.c:79
#4  0x7f5bc18a09eb in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x7f5bc18affca in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x7f5bc18b0035 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x7f5bc18b0288 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x7f5bc02b4550 in 
accessibility::AccessibleContextBase::ThrowIfDisposed() (this=0x55a6fc7e7da0) 
at .../libreoffice/editeng/source/accessibility/AccessibleContextBase.cxx:494
#9  0x7f5bbcf7d54e in 
accessibility::AccessibleShape::getAccessibleName() (this=0x55a6fc7e7da0) at 
.../libreoffice/svx/source/accessibility/AccessibleShape.cxx:280
#10 0x7f5bada62107 in QtAccessibleWidget::text(QAccessible::Text) 
const (this=0x55a6fad4fe20, text=QAccessible::Name) at 
.../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:362
#11 0x7f5bac5552d2 in 
AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, 
QDBusMessage const&, QDBusConnection const&) (this=0x55a6f769bce0, 
interface=0x55a6fad4fe20, function=..., message=..., connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1545
#12 0x7f5bac553cce in AtSpiAdaptor::handleMessage(QDBusMessage 
const&, QDBusConnection const&) (this=0x55a6f769bce0, message=..., 
connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1432
#13 0x7f5baaa88943 in 
QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, 
QDBusMessage const&, int) (this=0x7f5ba4010f30, node=..., msg=..., 
pathStartPos=27)
at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
#14 0x7f5baaa89628 in 
QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f5ba4026980) at 
.../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
#15 0x7f5bad044013 in QObject::event(QEvent*) (this=0x55a6f769bce0, 
e=0x7f5ba4026980) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447
#16 0x7f5bab1a6986 in QApplicationPrivate::notify_helper(QObject*, 
QEvent*) (this=0x55a6f631c3e0, receiver=0x55a6f769bce0, e=0x7f5ba4026980) at 
.../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298
#17 0x7f5bab1a6797 in QApplication::notify(QObject*, QEvent*) 
(this=0

core.git: sc/source

2024-01-24 Thread Noel Grandin (via logerrit)
 sc/source/ui/inc/tabvwsh.hxx   |2 +
 sc/source/ui/view/tabvwshf.cxx |   80 +
 2 files changed, 52 insertions(+), 30 deletions(-)

New commits:
commit fee9b337eb25f81191ec4b270860de1a0d7eaf61
Author: Noel Grandin 
AuthorDate: Wed Jan 24 11:47:20 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed Jan 24 21:33:01 2024 +0100

make move table dialog async

Change-Id: I85ddcd2589b6cb27f2022746607e9eda3818abd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162499
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index b85400e02692..1f8fe640fcd3 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -42,6 +42,7 @@ class SfxChildWindow;
 class SvxNumberInfoItem;
 struct SfxChildWinInfo;
 class AbstractScInsertTableDlg;
+class AbstractScMoveTableDlg;
 class ScArea;
 class ScAuditingShell;
 class ScDrawShell;
@@ -454,6 +455,7 @@ public:
 
 private:
 void ExecuteMoveTable( SfxRequest& rReq );
+void DoMoveTableFromDialog( SfxRequest& rReq, const 
VclPtr& pDlg );
 void ExecuteInsertTable( SfxRequest& rReq );
 void DoInsertTableFromDialog( SfxRequest& rReq, const 
VclPtr& pDlg );
 };
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index c7a53f87427d..a94640450a26 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -1016,7 +1016,7 @@ void ScTabViewShell::ExecuteMoveTable( SfxRequest& rReq )
 
 ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
 
-ScopedVclPtr 
pDlg(pFact->CreateScMoveTableDlg(GetFrameWeld(),
+VclPtr 
pDlg(pFact->CreateScMoveTableDlg(GetFrameWeld(),
 aDefaultName));
 
 SCTAB nTableCount = rDoc.GetTableCount();
@@ -1032,39 +1032,18 @@ void ScTabViewShell::ExecuteMoveTable( SfxRequest& rReq 
)
 // is selected.
 pDlg->EnableRenameTable(nTabSelCount == 1);
 
-if ( pDlg->Execute() == RET_OK )
-{
-nDoc = pDlg->GetSelectedDocument();
-nTab = pDlg->GetSelectedTable();
-bCpy = pDlg->GetCopyTable();
-bool bRna = pDlg->GetRenameTable();
-// Leave aTabName string empty, when Rename is FALSE.
-if( bRna )
-{
-   pDlg->GetTabNameString( aTabName );
-}
-bDoIt = true;
-
-OUString aFoundDocName;
-if ( nDoc != SC_DOC_NEW )
+auto xRequest = std::make_shared(rReq);
+rReq.Ignore(); // the 'old' request is not relevant any more
+pDlg->StartExecuteAsync(
+[this, pDlg, xRequest] (sal_Int32 nResult)->void
 {
-ScDocShell* pSh = ScDocShell::GetShellByNum( nDoc );
-if (pSh)
+if (nResult == RET_OK)
 {
-aFoundDocName = pSh->GetTitle();
-if ( !pSh->GetDocument().IsDocEditable() )
-{
-ErrorMessage(STR_READONLYERR);
-bDoIt = false;
-}
+DoMoveTableFromDialog(*xRequest, pDlg);
 }
+pDlg->disposeOnce();
 }
-rReq.AppendItem( SfxStringItem( FID_TAB_MOVE, aFoundDocName ) );
-// 1-based table, if not APPEND
-SCTAB nBasicTab = ( nTab <= MAXTAB ) ? (nTab+1) : nTab;
-rReq.AppendItem( SfxUInt16Item( FN_PARAM_1, 
static_cast(nBasicTab) ) );
-rReq.AppendItem( SfxBoolItem( FN_PARAM_2, bCpy ) );
-}
+);
 }
 
 if( bDoIt )
@@ -1238,4 +1217,45 @@ void ScTabViewShell::DoInsertTableFromDialog(SfxRequest& 
rReq, const VclPtr& pDlg )
+{
+sal_uInt16 nDoc = pDlg->GetSelectedDocument();
+SCTAB nTab = pDlg->GetSelectedTable();
+bool bCpy = pDlg->GetCopyTable();
+bool bRna = pDlg->GetRenameTable();
+OUString aTabName;
+// Leave aTabName string empty, when Rename is FALSE.
+if( bRna )
+{
+   pDlg->GetTabNameString( aTabName );
+}
+bool bDoIt = true;
+
+OUString aFoundDocName;
+if ( nDoc != SC_DOC_NEW )
+{
+ScDocShell* pSh = ScDocShell::GetShellByNum( nDoc );
+if (pSh)
+{
+aFoundDocName = pSh->GetTitle();
+if ( !pSh->GetDocument().IsDocEditable() )
+{
+ErrorMessage(STR_READONLYERR);
+bDoIt = false;
+}
+}
+}
+rReq.AppendItem( SfxStringItem( FID_TAB_MOVE, aFoundDocName ) );
+// 1-based table, if not APPEND
+SCTAB nBasicTab = ( nTab <= MAXTAB ) ? (nTab+1) : nTab;
+rReq.AppendItem( SfxUInt16Item( FN_PARAM_1, 
static_cast(nBasicTab) ) );
+rReq.AppendItem( SfxBoolItem( FN_PARAM_2, bCpy ) );
+if( bDoIt )
+{
+rReq.Done();// record, while doc is active
+MoveTable( nDoc, nTab, bCpy, &aTabName );
+  

core.git: cui/source cui/uiconfig editeng/source include/editeng sw/qa sw/source

2024-01-24 Thread László Németh (via logerrit)
 cui/source/inc/chardlg.hxx|1 
 cui/source/tabpages/chardlg.cxx   |   25 
 cui/uiconfig/ui/positionpage.ui   |   49 
 editeng/source/items/textitem.cxx |   14 +++-
 include/editeng/editrids.hrc  |1 
 include/editeng/nhypitem.hxx  |4 +
 sw/qa/uitest/writer_tests2/formatCharacter.py |5 +
 sw/qa/uitest/writer_tests8/tdf106733.py   |   78 ++
 sw/source/core/access/AccessibilityCheck.cxx  |6 ++
 sw/source/core/bastyp/init.cxx|2 
 sw/source/core/layout/wsfrm.cxx   |1 
 sw/source/core/unocore/unomap.cxx |2 
 sw/source/core/unocore/unomapproperties.hxx   |2 
 13 files changed, 182 insertions(+), 8 deletions(-)

New commits:
commit 03c5a31a0f374a90fbc821718c14dc5f8a385adf
Author: László Németh 
AuthorDate: Wed Jan 24 13:25:21 2024 +0100
Commit: László Németh 
CommitDate: Wed Jan 24 20:57:37 2024 +0100

tdf#106733 sw cui: add CharNoHyphenation checkbox

On Position tab of Character formatting dialog window
as a new checkbox "Exclude from hyphenation" (UX design
by Heiko Tietze).

With this, it's possible to disable hyphenation
with direct character formatting (e.g. combined with
Find All), or using character styles, and setting
"Exclude from hyphenation" in them. This feature
is conformant to the OpenDocument standard, and
unlike the previous locale=None workaround, it keeps
spell checking and locale dependent text layout.

Note: Clear direct formatting (Ctrl-M) is an
alternative way to remove the enabled CharNoHyphenation
(e.g. in version 24.2, where this commit won't
be back-ported).

Follow-up to commit b5e275f47a54bd7fee39dad516a433fde5be872d
"tdf#106733 sw: implement CharNoHyphenation".

Change-Id: I26823e6ec2a3ca39dcf0f7c051d96e638921c589
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162514
Tested-by: Jenkins
Reviewed-by: László Németh 

diff --git a/cui/source/inc/chardlg.hxx b/cui/source/inc/chardlg.hxx
index 6d6bf958c2e2..b484c7419b83 100644
--- a/cui/source/inc/chardlg.hxx
+++ b/cui/source/inc/chardlg.hxx
@@ -269,6 +269,7 @@ private:
 
 std::unique_ptr m_xKerningMF;
 std::unique_ptr m_xPairKerningBtn;
+std::unique_ptr m_xNoHyphenationBtn;
 
 voidInitialize();
 voidUpdatePreview_Impl( sal_uInt8 nProp, sal_uInt8 
nEscProp, short nEsc );
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index e851816c1787..86b183fe4160 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -41,6 +41,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2429,6 +2430,7 @@ SvxCharPositionPage::SvxCharPositionPage(weld::Container* 
pPage, weld::DialogCon
 , m_xScaleWidthMF(m_xBuilder->weld_metric_spin_button("scalewidthsb", 
FieldUnit::PERCENT))
 , m_xKerningMF(m_xBuilder->weld_metric_spin_button("kerningsb", 
FieldUnit::POINT))
 , m_xPairKerningBtn(m_xBuilder->weld_check_button("pairkerning"))
+, m_xNoHyphenationBtn(m_xBuilder->weld_check_button("nohyphenation"))
 {
 m_xPreviewWin.reset(new weld::CustomWeld(*m_xBuilder, "preview", 
m_aPreviewWin));
 #ifdef IOS
@@ -2794,6 +2796,16 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
 else
 m_xPairKerningBtn->set_active(false);
 
+// No hyphenation
+nWhich = GetWhich( sal_uInt16(19) );  // number borrowed from 
RES_CHRATR_NOHYPHEN
+if ( rSet->GetItemState( nWhich ) >= SfxItemState::DEFAULT )
+{
+const SvxNoHyphenItem& rItem = static_cast(rSet->Get( nWhich ));
+m_xNoHyphenationBtn->set_active(rItem.GetValue());
+}
+else
+m_xNoHyphenationBtn->set_active(false);
+
 // Scale Width
 nWhich = GetWhich( SID_ATTR_CHAR_SCALEWIDTH );
 if ( rSet->GetItemState( nWhich ) >= SfxItemState::DEFAULT )
@@ -2874,6 +2886,7 @@ void SvxCharPositionPage::ChangesApplied()
 m_xScaleWidthMF->save_value();
 m_xKerningMF->save_value();
 m_xPairKerningBtn->save_state();
+m_xNoHyphenationBtn->save_state();
 }
 
 bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
@@ -2963,6 +2976,18 @@ bool SvxCharPositionPage::FillItemSet( SfxItemSet* rSet )
 else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
 rSet->InvalidateItem(nWhich);
 
+// No hyphenation
+
+nWhich = GetWhich( sal_uInt16(19) );  // number borrowed from 
RES_CHRATR_NOHYPHEN
+
+if (m_xNoHyphenationBtn->get_state_changed_from_saved())
+{
+rSet->Put( SvxNoHyphenItem( m_xNoHyphenationBtn->get_active(), nWhich 
) );
+bModified = true;
+}
+else if ( SfxItemState::DEFAULT == rOldSet.GetItemState( nWhich, false ) )
+rSet->InvalidateItem(nWhich);
+
 // Scale Width
 nWhich = GetWhich( 

core.git: sc/source

2024-01-24 Thread Noel Grandin (via logerrit)
 sc/source/ui/attrdlg/scdlgfact.cxx |5 +
 sc/source/ui/attrdlg/scdlgfact.hxx |5 -
 sc/source/ui/inc/tabvwsh.hxx   |3 
 sc/source/ui/view/tabvwshf.cxx |  167 -
 4 files changed, 102 insertions(+), 78 deletions(-)

New commits:
commit 5d993a39c60d9184ddc3dbdaa9854ec1ecc99464
Author: Noel Grandin 
AuthorDate: Wed Jan 24 11:34:29 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed Jan 24 19:53:59 2024 +0100

make insert table dialog async

Change-Id: I4fd880ed2b1f07439229750e77246cf9cb2df5f3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162498
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx 
b/sc/source/ui/attrdlg/scdlgfact.cxx
index 24fecf8e9966..8cbd923ce63a 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -199,6 +199,11 @@ short AbstractScInsertTableDlg_Impl::Execute()
 return m_xDlg->run();
 }
 
+bool 
AbstractScInsertTableDlg_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext
 &rCtx)
+{
+return weld::DialogController::runAsync(m_xDlg, rCtx.maEndDialogFn);
+}
+
 short AbstractScSelEntryDlg_Impl::Execute()
 {
 return m_xDlg->run();
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx 
b/sc/source/ui/attrdlg/scdlgfact.hxx
index 954e58f0f2a8..7591b7338801 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -295,13 +295,14 @@ public:
 
 class AbstractScInsertTableDlg_Impl : public AbstractScInsertTableDlg
 {
-std::unique_ptr m_xDlg;
+std::shared_ptr m_xDlg;
 public:
-explicit AbstractScInsertTableDlg_Impl(std::unique_ptr p)
+explicit AbstractScInsertTableDlg_Impl(std::shared_ptr p)
 : m_xDlg(std::move(p))
 {
 }
 virtual short   Execute() override;
+virtual boolStartExecuteAsync(VclAbstractDialog::AsyncContext 
&rCtx) override;
 virtual boolGetTablesFromFile() override;
 virtual boolGetTablesAsLink() override;
 virtual const OUString* GetFirstTable( sal_uInt16* pN = nullptr ) override;
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 219fb3534d60..b85400e02692 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -41,7 +41,7 @@ class SfxBindings;
 class SfxChildWindow;
 class SvxNumberInfoItem;
 struct SfxChildWinInfo;
-
+class AbstractScInsertTableDlg;
 class ScArea;
 class ScAuditingShell;
 class ScDrawShell;
@@ -455,6 +455,7 @@ public:
 private:
 void ExecuteMoveTable( SfxRequest& rReq );
 void ExecuteInsertTable( SfxRequest& rReq );
+void DoInsertTableFromDialog( SfxRequest& rReq, const 
VclPtr& pDlg );
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 41781f2cee19..c7a53f87427d 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -1126,97 +1126,114 @@ void ScTabViewShell::ExecuteInsertTable(SfxRequest& 
rReq)
 }
 else// dialog
 {
+auto xRequest = std::make_shared(rReq);
+rReq.Ignore(); // the 'old' request is not relevant any more
 ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
-
-ScopedVclPtr 
pDlg(pFact->CreateScInsertTableDlg(GetFrameWeld(), rViewData,
+VclPtr 
pDlg(pFact->CreateScInsertTableDlg(GetFrameWeld(), rViewData,
 nTabSelCount, nSlot == FID_INS_TABLE_EXT));
-if ( RET_OK == pDlg->Execute() )
-{
-if (pDlg->GetTablesFromFile())
+pDlg->StartExecuteAsync(
+[this, pDlg, xRequest] (sal_Int32 nResult)->void
 {
-std::vector nTabs;
-sal_uInt16 n = 0;
-const OUString* pStr = pDlg->GetFirstTable( &n );
-while ( pStr )
-{
-nTabs.push_back( static_cast(n) );
-pStr = pDlg->GetNextTable( &n );
-}
-bool bLink = pDlg->GetTablesAsLink();
-if (!nTabs.empty())
-{
-if(pDlg->IsTableBefore())
-{
-ImportTables( pDlg->GetDocShellTables(), nTabs.size(), 
nTabs.data(),
-bLink,nTabNr );
-}
-else
-{
-SCTAB   nTabAfter= nTabNr+1;
+if (nResult == RET_OK)
+DoInsertTableFromDialog(*xRequest, pDlg);
+pDlg->disposeOnce();
+}
+);
+}
+}
 
-for(SCTAB j=nCurrentTab+1;j& pDlg)
+{
+ScViewData& rViewData   = GetViewData();
+ScDocument& rDoc= rViewData.GetDocument();
+SCTAB   nCurrentTab = rViewData.GetTabNo();
+SCTAB   nTabNr  = nCurrentTab;
+SCTAB  

core.git: Branch 'distro/collabora/co-23.05' - sw/qa

2024-01-24 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/rtfimport/rtfimport.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b82ff36ecf81091fc57a0392cfdf4271c56e2745
Author: Mike Kaganski 
AuthorDate: Wed Jan 24 19:07:14 2024 +0600
Commit: Mike Kaganski 
CommitDate: Wed Jan 24 18:23:57 2024 +0100

Fix build

... after commit 2cc3e16f8e3f50d0fa53f15f78bba3afe29977bd (tdf#136472 adjust
ooxml import to handle first header/footer, 2023-12-04), which replaced the
pre-existing SAL_NEWLINE_STRING with 
.

Change-Id: Ic42574f1d678cd538e9aa50a42b2f81d27ff8673
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162507
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 

diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 8345e42579df..2bf871028e28 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1515,7 +1515,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf108947)
 uno::Reference xHeaderTextLeft = 
getProperty>(
 getStyles("PageStyles")->getByName("Default Page Style"), 
"HeaderTextLeft");
 aActual = xHeaderTextLeft->getString();
-CPPUNIT_ASSERT_EQUAL(OUString("
Header Page 2 ?"), aActual);
+CPPUNIT_ASSERT_EQUAL(OUString(SAL_NEWLINE_STRING "Header Page 2 ?"), 
aActual);
 #endif
 }
 


core.git: svx/source

2024-01-24 Thread Michael Weghorn (via logerrit)
 svx/source/accessibility/AccessibleShape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 38f98c60e797753fa54bf3649520995df9861b45
Author: Michael Weghorn 
AuthorDate: Wed Jan 24 10:19:58 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 17:34:58 2024 +0100

svx a11y: Notify listeners when disposing shape

In `AccessibleShape::disposing`, call the same method
of the base class, i.e. `AccessibleContextBase::disposing`,
not `AccessibleContextBase::dispose`.

The code was moved from `AccessibleShape::dispose` to
`AccessibleShape::disposing` in

commit f11b151dc08ccfcb7e78bfd9a24c77670942ea63
Date:   Tue Apr 30 13:30:10 2002 +

#95585# Moved code from dispose to disposing().

and it seems likely that adjusting the base class method to call
was just forgotten/missed.

This resulted in the accessible getting disposed without listeners
getting notified (since `AccessibleContextBase::disposing` takes
care of that).

This resulted in a crash for the following scenario with the qt6
VCL plugin when the Orca screen reader is running:

1) start LO Writer
2) click on the "Basic shapes" toolbar button
3) click + drag to insert a shape into the document
4) click somewhere else

Backtrace is below.
`AtSpiAdaptor::handleMessage` (frame #12 in the bt) checks
whether the accessible is valid and returns early otherwise.
But since listeners were not notified when the object got disposed,
`QtAccessibleEventListener::disposing` wasn't called, which would
have taken care of invalidating the `QtAccessibleWidget`, in which
case this early return would have happened instead of the crash.

This behaves as expected now with this commit in place.

stderr output of the crash:

terminate called after throwing an instance of 
'com::sun::star::lang::DisposedException'

Backtrace:

Thread 1 received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44  ./nptl/pthread_kill.c: No such file or directory.
(gdb) bt
#0  __pthread_kill_implementation (threadid=, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x7f5bc1ca815f in __pthread_kill_internal (signo=6, 
threadid=) at ./nptl/pthread_kill.c:78
#2  0x7f5bc1c5a472 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#3  0x7f5bc1c444b2 in __GI_abort () at ./stdlib/abort.c:79
#4  0x7f5bc18a09eb in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x7f5bc18affca in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x7f5bc18b0035 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x7f5bc18b0288 in  () at /lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x7f5bc02b4550 in 
accessibility::AccessibleContextBase::ThrowIfDisposed() (this=0x55a6fc7e7da0) 
at .../libreoffice/editeng/source/accessibility/AccessibleContextBase.cxx:494
#9  0x7f5bbcf7d54e in 
accessibility::AccessibleShape::getAccessibleName() (this=0x55a6fc7e7da0) at 
.../libreoffice/svx/source/accessibility/AccessibleShape.cxx:280
#10 0x7f5bada62107 in QtAccessibleWidget::text(QAccessible::Text) 
const (this=0x55a6fad4fe20, text=QAccessible::Name) at 
.../libreoffice/vcl/qt6/../qt5/QtAccessibleWidget.cxx:362
#11 0x7f5bac5552d2 in 
AtSpiAdaptor::accessibleInterface(QAccessibleInterface*, QString const&, 
QDBusMessage const&, QDBusConnection const&) (this=0x55a6f769bce0, 
interface=0x55a6fad4fe20, function=..., message=..., connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1545
#12 0x7f5bac553cce in AtSpiAdaptor::handleMessage(QDBusMessage 
const&, QDBusConnection const&) (this=0x55a6f769bce0, message=..., 
connection=...)
at .../qt5/qtbase/src/gui/accessible/linux/atspiadaptor.cpp:1432
#13 0x7f5baaa88943 in 
QDBusConnectionPrivate::activateObject(QDBusConnectionPrivate::ObjectTreeNode&, 
QDBusMessage const&, int) (this=0x7f5ba4010f30, node=..., msg=..., 
pathStartPos=27)
at .../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1448
#14 0x7f5baaa89628 in 
QDBusActivateObjectEvent::placeMetaCall(QObject*) (this=0x7f5ba4026980) at 
.../qt5/qtbase/src/dbus/qdbusintegrator.cpp:1604
#15 0x7f5bad044013 in QObject::event(QEvent*) (this=0x55a6f769bce0, 
e=0x7f5ba4026980) at .../qt5/qtbase/src/corelib/kernel/qobject.cpp:1447
#16 0x7f5bab1a6986 in QApplicationPrivate::notify_helper(QObject*, 
QEvent*) (this=0x55a6f631c3e0, receiver=0x55a6f769bce0, e=0x7f5ba4026980) at 
.../qt5/qtbase/src/widgets/kernel/qapplication.cpp:3298
#17 0x7f5bab1a6797 in QApplication::notify(QObject*, QEvent*) 
(this=0

core.git: vcl/inc vcl/qt5

2024-01-24 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtInstanceMessageDialog.hxx |1 +
 vcl/qt5/QtInstanceMessageDialog.cxx |   20 
 2 files changed, 21 insertions(+)

New commits:
commit e44a322fd00e017ea6494d836f66e5ddf6cfa9d5
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 14:04:54 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 17:24:08 2024 +0100

tdf#154381 qt weld: Allow setting message box default button

Implement `QtInstanceMessageDialog::set_default_response`
by identifying the `QPushButton` in the `QMessageBox` that
has the `QMessageBox::ButtonRole` corresponding to the
given VCL return type and setting that as the default
button in the `QMessageBox`.

With this in place, the qt6 welded message dialog that
shows up when opening a file that's already open in another
instance of LibreOffice (s. `AlreadyOpenQueryBox::AlreadyOpenQueryBox`)
has initial focus on the "Open Read-Only" button when it opens,
just as is the case for the non-welded one
(whose use can be forced by setting env var
`SAL_VCL_QT_NO_WELDED_WIDGETS=1`).

Change-Id: I6d543b43cb6adec2dde9646e1452aa03bdcbf331
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162441
Tested-by: Jenkins
Reviewed-by: Omkar Acharekar  
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/QtInstanceMessageDialog.hxx 
b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
index 0c585a9ed916..ae353268833c 100644
--- a/vcl/inc/qt5/QtInstanceMessageDialog.hxx
+++ b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
@@ -33,6 +33,7 @@ public:
 // weld::Dialog overrides
 virtual void add_button(const OUString& rText, int nResponse,
 const OUString& rHelpId = {}) override;
+virtual void set_default_response(int nResponse) override;
 virtual int run() override;
 };
 
diff --git a/vcl/qt5/QtInstanceMessageDialog.cxx 
b/vcl/qt5/QtInstanceMessageDialog.cxx
index 6f252c79c816..ed48c5298a6c 100644
--- a/vcl/qt5/QtInstanceMessageDialog.cxx
+++ b/vcl/qt5/QtInstanceMessageDialog.cxx
@@ -9,6 +9,8 @@
 
 #include 
 
+#include 
+
 namespace
 {
 QMessageBox::ButtonRole lcl_vclResponseTypeToQtMessageBoxButtonRole(int 
nResponseType)
@@ -109,6 +111,24 @@ void QtInstanceMessageDialog::add_button(const OUString& 
rText, int nResponse, c
 
lcl_vclResponseTypeToQtMessageBoxButtonRole(nResponse));
 }
 
+void QtInstanceMessageDialog::set_default_response(int nResponse)
+{
+assert(m_pMessageDialog);
+
+const QList aButtons = m_pMessageDialog->buttons();
+for (QAbstractButton* pAbstractButton : aButtons)
+{
+QPushButton* pButton = dynamic_cast(pAbstractButton);
+assert(pButton);
+const QMessageBox::ButtonRole eRole = 
m_pMessageDialog->buttonRole(pButton);
+if (lcl_qtMessageBoxButtonRoleToVclResponseType(eRole) == nResponse)
+{
+m_pMessageDialog->setDefaultButton(pButton);
+return;
+}
+}
+}
+
 int QtInstanceMessageDialog::run()
 {
 // cannot use the QMessageBox::exec() return value right away, because it 
returns the


core.git: vcl/inc vcl/qt5

2024-01-24 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtInstanceMessageDialog.hxx |5 +
 vcl/qt5/QtInstanceMessageDialog.cxx |   83 
 2 files changed, 88 insertions(+)

New commits:
commit bb0c0e422788b6c461387491c59911ad84c27b83
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 13:47:21 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 17:15:07 2024 +0100

tdf#154381 qt weld: Add button handling for message box

Override the `QtInstanceDialog` methods `add_button`
and `run` in `QtInstanceMessageDialog`, and implement
handling for these buttons with the native
`QMessageBox` that is used internally:

Implement `QtInstanceMessageDialog::add_button` to
make adding buttons to the welded message dialog
work.
Map the VCL response type to a corresponding
`QMessageBox::ButtonRole`. Some mappings are
straightforward, others are a bit more arbitrary,
but the only essential thing is that the mapping
back to the VCL response code is consistent.

`QMessageBox::exec` [1] overrides `QDialog::exec` [2],
and while the int returned by the latter corresponds
to a `QDialog::DialogCode` code, the int returned by
the former corresponds to a `QMessageBox::StandardButton`
value. Since the current `QtInstanceDialog::run` implementation
relies on the `QDialog` behaviour, override it for the
message dialog case. Since the `QMessageBox::ButtonRole`
is set in `QtInstanceMessageDialog::add_button`, retrieve
the corresponding role from the clicked button instead
of using the return value of the `QMessageBox::exec`
to be able to get the correct VCL return code again.

With this in place, the qt6 welded message dialog that
shows up when opening a file that's already open in another
instance of LibreOffice (s. `AlreadyOpenQueryBox::AlreadyOpenQueryBox`)
shows buttons and clicking any of them
behaves as expected, just as is the case for the non-welded one
(whose use can be forced by setting env var
`SAL_VCL_QT_NO_WELDED_WIDGETS=1`).

[1] https://doc.qt.io/qt-6/qmessagebox.html#exec`
[2] https://doc.qt.io/qt-6/qdialog.html#exec

Change-Id: Ie37573951302f13eab758f889d478dc9351e9c07
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162440
Tested-by: Jenkins
Reviewed-by: Omkar Acharekar  
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/QtInstanceMessageDialog.hxx 
b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
index 68d2010cb1fa..0c585a9ed916 100644
--- a/vcl/inc/qt5/QtInstanceMessageDialog.hxx
+++ b/vcl/inc/qt5/QtInstanceMessageDialog.hxx
@@ -29,6 +29,11 @@ public:
 virtual OUString get_primary_text() const override;
 
 virtual OUString get_secondary_text() const override;
+
+// weld::Dialog overrides
+virtual void add_button(const OUString& rText, int nResponse,
+const OUString& rHelpId = {}) override;
+virtual int run() override;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/QtInstanceMessageDialog.cxx 
b/vcl/qt5/QtInstanceMessageDialog.cxx
index 2ba386ded5c5..6f252c79c816 100644
--- a/vcl/qt5/QtInstanceMessageDialog.cxx
+++ b/vcl/qt5/QtInstanceMessageDialog.cxx
@@ -9,6 +9,69 @@
 
 #include 
 
+namespace
+{
+QMessageBox::ButtonRole lcl_vclResponseTypeToQtMessageBoxButtonRole(int 
nResponseType)
+{
+// RET_CANCEL, RET_HELP, RET_YES, RET_NO and RET_OK have a matching 
equivalent
+// in Qt, the others are a bit more arbitrary; what really matters about 
these
+// is only that the mapping here and the other way around
+// (in lcl_qtMessageBoxButtonRoleToVclResponseType) is consistent
+switch (nResponseType)
+{
+case RET_CANCEL:
+return QMessageBox::ButtonRole::RejectRole;
+case RET_HELP:
+return QMessageBox::ButtonRole::HelpRole;
+case RET_YES:
+return QMessageBox::ButtonRole::YesRole;
+case RET_NO:
+return QMessageBox::ButtonRole::NoRole;
+case RET_OK:
+return QMessageBox::ButtonRole::AcceptRole;
+case RET_RETRY:
+return QMessageBox::ButtonRole::ResetRole;
+case RET_IGNORE:
+return QMessageBox::ButtonRole::ActionRole;
+case RET_CLOSE:
+return QMessageBox::ButtonRole::DestructiveRole;
+default:
+assert(false && "Unhandled vcl response type");
+return QMessageBox::InvalidRole;
+}
+}
+
+VclResponseType lcl_qtMessageBoxButtonRoleToVclResponseType(int nRet)
+{
+// AcceptRole, HelpRole, NoRole, RejectRole and YesRole have a matching 
equivalent
+// in VCL, the others are a bit more arbitrary; what really matters about 
these
+// is only that the mapping here and the other way around
+// (in lcl_vclResponseTypeToQtMessageBoxButtonRole) is consistent
+switch (nRet)
+{
+case QMessageBox::ButtonRole::AcceptRole:
+return RET

core.git: 2 commits - vcl/inc vcl/qt5

2024-01-24 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtMenu.hxx  |1 -
 vcl/inc/qt5/QtTools.hxx |5 +
 vcl/qt5/QtMenu.cxx  |   21 +
 vcl/qt5/QtTools.cxx |9 -
 4 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit ae910722fcd778d71c9e73a860a9ad94eb449608
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 13:47:07 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 17:14:56 2024 +0100

qt: Move VCL -> Qt accelerator text handling to QtTools

Move the functionality to convert a string (potentially)
containing a VCL-style accelerator ('~') to the Qt equivalent
from `QtMenu::NativeItemText` to a new helper function
`vclToQtStringtWithAccelerator` in QtTools.hxx

This will be reused for button text in welded message dialogs
in an upcoming commit.

Change-Id: Ibedabb7937b97d195244045799c092463810d766
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162439
Tested-by: Jenkins
Reviewed-by: Omkar Acharekar  
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/QtMenu.hxx b/vcl/inc/qt5/QtMenu.hxx
index 587e1cfea8d1..28e5ac57146b 100644
--- a/vcl/inc/qt5/QtMenu.hxx
+++ b/vcl/inc/qt5/QtMenu.hxx
@@ -57,7 +57,6 @@ private:
 static OUString m_sCurrentHelpId;
 
 void DoFullMenuUpdate(Menu* pMenuBar);
-static void NativeItemText(OUString& rItemText);
 
 void InsertMenuItem(QtMenuItem* pSalMenuItem, unsigned nPos);
 
diff --git a/vcl/inc/qt5/QtTools.hxx b/vcl/inc/qt5/QtTools.hxx
index 20e0452188af..b419c1fd3da9 100644
--- a/vcl/inc/qt5/QtTools.hxx
+++ b/vcl/inc/qt5/QtTools.hxx
@@ -158,6 +158,11 @@ QString vclMessageTypeToQtTitle(VclMessageType eType);
 QMessageBox::StandardButtons vclButtonsTypeToQtButton(VclButtonsType 
eButtonType);
 int qtResponseTypeToVclResponseType(int ret);
 
+/** Converts a string potentially containing a '~' character to indicate an 
accelerator
+ *  to the Qt variant using '&' for the accelerator.
+ */
+QString vclToQtStringWithAccelerator(const OUString& rText);
+
 template 
 inline std::basic_ostream& operator<<(std::basic_ostream& stream,
  const QString& rString)
diff --git a/vcl/qt5/QtMenu.cxx b/vcl/qt5/QtMenu.cxx
index 93f3d6f5a378..e3494356fc8b 100644
--- a/vcl/qt5/QtMenu.cxx
+++ b/vcl/qt5/QtMenu.cxx
@@ -71,8 +71,7 @@ bool QtMenu::VisibleMenuBar() { return true; }
 void QtMenu::InsertMenuItem(QtMenuItem* pSalMenuItem, unsigned nPos)
 {
 sal_uInt16 nId = pSalMenuItem->mnId;
-OUString aText = mpVCLMenu->GetItemText(nId);
-NativeItemText(aText);
+const QString aText = 
vclToQtStringWithAccelerator(mpVCLMenu->GetItemText(nId));
 vcl::KeyCode nAccelKey = mpVCLMenu->GetAccelKey(nId);
 
 pSalMenuItem->mpAction.reset();
@@ -83,7 +82,7 @@ void QtMenu::InsertMenuItem(QtMenuItem* pSalMenuItem, 
unsigned nPos)
 // top-level menu
 if (validateQMenuBar())
 {
-QMenu* pQMenu = new QMenu(toQString(aText), nullptr);
+QMenu* pQMenu = new QMenu(aText, nullptr);
 connectHelpSignalSlots(pQMenu, pSalMenuItem);
 pSalMenuItem->mpMenu.reset(pQMenu);
 
@@ -122,7 +121,7 @@ void QtMenu::InsertMenuItem(QtMenuItem* pSalMenuItem, 
unsigned nPos)
 if (pSalMenuItem->mpSubMenu)
 {
 // submenu
-QMenu* pQMenu = new QMenu(toQString(aText), nullptr);
+QMenu* pQMenu = new QMenu(aText, nullptr);
 connectHelpSignalSlots(pQMenu, pSalMenuItem);
 pSalMenuItem->mpMenu.reset(pQMenu);
 
@@ -172,7 +171,7 @@ void QtMenu::InsertMenuItem(QtMenuItem* pSalMenuItem, 
unsigned nPos)
 else
 {
 // leaf menu
-QAction* pAction = new QAction(toQString(aText), nullptr);
+QAction* pAction = new QAction(aText, nullptr);
 pSalMenuItem->mpAction.reset(pAction);
 
 if ((nPos != MENU_APPEND)
@@ -556,9 +555,7 @@ void QtMenu::SetItemText(unsigned, SalMenuItem* pItem, 
const OUString& rText)
 QAction* pAction = pSalMenuItem->getAction();
 if (pAction)
 {
-OUString aText(rText);
-NativeItemText(aText);
-pAction->setText(toQString(aText));
+pAction->setText(vclToQtStringWithAccelerator(rText));
 }
 }
 
@@ -683,14 +680,6 @@ void QtMenu::slotMenuAboutToHide(QtMenuItem* pQItem)
 }
 }
 
-void QtMenu::NativeItemText(OUString& rItemText)
-{
-// preserve literal '&'s in menu texts
-rItemText = rItemText.replaceAll("&", "&&");
-
-rItemText = rItemText.replace('~', '&');
-}
-
 void QtMenu::slotCloseDocument()
 {
 MenuBar* pVclMenuBar = static_cast(mpVCLMenu.get());
diff --git a/vcl/qt5/QtTools.cxx b/vcl/qt5/QtTools.cxx
index 0f8af934d2fa..e4000f9a99c1 100644
--- a/vcl/qt5/QtTools.cxx
+++ b/vcl/qt5/QtTools.cxx
@@ -212,4 +212,10 @@ int qtResponseTypeToVclResponseType(int ret)
 return ret;
 }
 
+QString vclToQtStringWithAccelerator(const OUString& rText)
+{
+

core.git: 2 commits - vcl/inc vcl/qt5

2024-01-24 Thread Michael Weghorn (via logerrit)
 vcl/inc/qt5/QtInstanceDialog.hxx |4 ++--
 vcl/inc/qt5/QtInstanceWindow.hxx |7 ++-
 vcl/qt5/QtInstanceDialog.cxx |3 ++-
 vcl/qt5/QtInstanceWindow.cxx |   13 +++--
 4 files changed, 21 insertions(+), 6 deletions(-)

New commits:
commit d76d4df7ea1db0fdd27d350119ff7c0b2024b6e1
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 13:45:48 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 17:14:37 2024 +0100

tdf#154381 qt weld: Implement QtInstanceWindow::{g,s}et_title

Implement methods to set and get the window title.

In order to do that, add a `m_pWidget` member to
`QtInstanceWindow`. For the `QtInstanceDialog` case, that widget
is a pointer to the same dialog that `QtInstanceDialog::m_pDialog`
points to, which is a unique_ptr and thus takes care of the memory
management.

The non-dialog case is not supported yet, s.a. this commit
adding support for simple welded message dialogs initially:

commit 1ace23443b85d4a81b94656844f1b27e2987
Date:   Wed Dec 20 19:13:50 2023 +0530

tdf#130857 Use native qt widgets - simple message dialog

With this in place, the qt6 welded message dialog that
shows up when opening a file that's already open in another
instance of LO has the correct title ("Document in Use"),
just as is the case for the non-welded one
(whose use can be forced by setting env var
`SAL_VCL_QT_NO_WELDED_WIDGETS=1`).

Change-Id: I35f323cdfa70fb953b6bc73aaf726fb1f3098c45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162437
Tested-by: Jenkins
Reviewed-by: Omkar Acharekar  
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/QtInstanceWindow.hxx b/vcl/inc/qt5/QtInstanceWindow.hxx
index be6aec6623cd..c29863da4f67 100644
--- a/vcl/inc/qt5/QtInstanceWindow.hxx
+++ b/vcl/inc/qt5/QtInstanceWindow.hxx
@@ -13,7 +13,12 @@
 
 class QtInstanceWindow : public QtInstanceContainer, public virtual 
weld::Window
 {
-virtual void set_title(const OUString&) override;
+QWidget* m_pWidget;
+
+public:
+QtInstanceWindow(QWidget* pWidget);
+
+virtual void set_title(const OUString& rTitle) override;
 virtual OUString get_title() const override;
 virtual void window_move(int, int) override;
 virtual void set_modal(bool) override;
diff --git a/vcl/qt5/QtInstanceDialog.cxx b/vcl/qt5/QtInstanceDialog.cxx
index 8d884688e247..e65e4b749e13 100644
--- a/vcl/qt5/QtInstanceDialog.cxx
+++ b/vcl/qt5/QtInstanceDialog.cxx
@@ -10,7 +10,8 @@
 #include 
 
 QtInstanceDialog::QtInstanceDialog(QDialog* pDialog)
-: m_pDialog(pDialog)
+: QtInstanceWindow(pDialog)
+, m_pDialog(pDialog)
 {
 }
 
diff --git a/vcl/qt5/QtInstanceWindow.cxx b/vcl/qt5/QtInstanceWindow.cxx
index e0bf4bfdd2af..0e74c8d6f873 100644
--- a/vcl/qt5/QtInstanceWindow.cxx
+++ b/vcl/qt5/QtInstanceWindow.cxx
@@ -9,9 +9,18 @@
 
 #include 
 
-void QtInstanceWindow::set_title(const OUString&) {}
+QtInstanceWindow::QtInstanceWindow(QWidget* pWidget)
+: m_pWidget(pWidget)
+{
+assert(m_pWidget);
+}
+
+void QtInstanceWindow::set_title(const OUString& rTitle)
+{
+m_pWidget->setWindowTitle(toQString(rTitle));
+}
 
-OUString QtInstanceWindow::get_title() const { return OUString(); }
+OUString QtInstanceWindow::get_title() const { return 
toOUString(m_pWidget->windowTitle()); }
 
 void QtInstanceWindow::window_move(int, int) {}
 
commit 8efcb80c95ab173a3931da3b35fc1b5bf1e4e0d2
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 13:43:48 2024 +0100
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 17:14:29 2024 +0100

qt weld: Make QtInstanceDialog::m_pDialog private

Change-Id: I757849beb06d0ce986be352feb34af463430333b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162436
Tested-by: Jenkins
Reviewed-by: Omkar Acharekar  
Reviewed-by: Michael Weghorn 

diff --git a/vcl/inc/qt5/QtInstanceDialog.hxx b/vcl/inc/qt5/QtInstanceDialog.hxx
index 1eb7e5f63eb5..04b45d57a31f 100644
--- a/vcl/inc/qt5/QtInstanceDialog.hxx
+++ b/vcl/inc/qt5/QtInstanceDialog.hxx
@@ -13,9 +13,9 @@
 
 class QtInstanceDialog : public QtInstanceWindow, public virtual weld::Dialog
 {
-public:
 std::unique_ptr m_pDialog;
 
+public:
 QtInstanceDialog(QDialog* pDialog);
 
 virtual bool runAsync(std::shared_ptr const&,
@@ -48,4 +48,4 @@ public:
 virtual weld::Container* weld_content_area() override;
 };
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


ESC meeting agenda: 2024-01-25 16:00 CET

2024-01-24 Thread Miklos Vajna

Hi,

The prototype agenda is below. Extra items are appreciated either in
this document or as a reply to this mail:

https://pad.documentfoundation.org/p/esc

You can join using Jitsi here:

https://jitsi.documentfoundation.org/esc

Regards,

Miklos

---

* Present:
+

* Completed Action Items:

* Pending Action Items:
  + try to restore source code links in crashreports (Cloph)
  + look at missing bundled python in bibisect binaries (Xisco)

* Release Engineering update (Cloph)
+ 7.6: 7.6.5 RC1 in 1 week?
  + plan to tag on Tuesday
+ 24.2: RC 3 this week?
  + libreoffice-24-2-0 branch, needs +2 reviews
  + late features:
+ MAR updates (Stephan)

* Documentation (Olivier)
+ Bugzilla Documentation statistics
275(275) bugs open
+ Updates:
BZ changes   1 week   1 month   3 months   12 months
   created  5(1)15(3)  35(-1)246(-1)
 commented 16(10)   62(9) 158(-1)961(4)
  resolved  1(0) 8(1)  14(-1)130(0)
+ top 10 contributors:
  Nabet, Julien made 13 changes in 1 month, and 46 changes in 1 year
  Faisal made 6 changes in 1 month, and 6 changes in 1 year
  Heiko Tietze made 5 changes in 1 month, and 105 changes in 1 year
  Ilmari Lauhakangas made 5 changes in 1 month, and 90 changes in 1 year
  Olivier Hallot made 5 changes in 1 month, and 367 changes in 1 year
  Stéphane Guillou made 5 changes in 1 month, and 278 changes in 1 year
  Kaganski, Mike made 4 changes in 1 month, and 66 changes in 1 year
  libretist made 4 changes in 1 month, and 4 changes in 1 year
  Telesto made 4 changes in 1 month, and 9 changes in 1 year
  Eivind Samseth made 3 changes in 1 month, and 3 changes in 1 year

* UX Update (Heiko)
+ Bugzilla (topicUI) statistics
249(249) (topicUI) bugs open, 59(59) (needsUXEval) needs to be 
evaluated by the UXteam
+ Updates:
BZ changes   1 week1 month3 months   12 months
 added  2(-4) 16(-8) 28(-8)  41(-7)
 commented 39(-46)   156(-56)   563(-67)   2175(-60)
   removed  0(0)   0(-1)  3(0)   14(0)
  resolved  7(3)  18(2)  68(1)  319(0)
+ top 10 contributors:
  Heiko Tietze made 101 changes in 1 month, and 1289 changes in 1 year
  Stéphane Guillou made 53 changes in 1 month, and 612 changes in 1 year
  Eyal Rozenberg made 21 changes in 1 month, and 211 changes in 1 year
  Dieter made 13 changes in 1 month, and 209 changes in 1 year
  Telesto made 13 changes in 1 month, and 48 changes in 1 year
  Jim Raykowski made 12 changes in 1 month, and 30 changes in 1 year
  Vernon, Stuart Foote made 11 changes in 1 month, and 279 changes in 1 
year
  Samuel Mehrbrodt made 8 changes in 1 month, and 18 changes in 1 year
  Seth Chaiklin made 8 changes in 1 month, and 81 changes in 1 year
  Akshay Warrier made 7 changes in 1 month, and 7 changes in 1 year

* Crash Testing (Caolan)
+ 5(-22) import failure, 1(-21) export failures
+ ??? coverity issues
+ Google / ossfuzz: ?? fuzzers active now

* Crash Reporting (Xisco)
+ 7.6.1.212000(+325)
+ 7.6.2.140551(+1730)
+ 7.6.3.26035(+642)
+ 7.6.4.116591(+3507)

* Mentoring (Hossein)
  committer...   1 week 1 month 3 months12 months
  open  71(0)  134(5)  141(11)  141(11)
   reviews 450(-28)   1354(32)3336(108)   11814(88)
merged 267(-35)   1061(-30)   3234(67)12294(-38)
 abandoned  18(4)   62(1)  220(7)   654(0)
   own commits 157(-50)725(-40)   2475(-66)9696(-93)
review commits  76(-23)310(1)  814(22) 3028(38)
contributor...   1 week  1 month  3 months12 months
  open  27(-16) 256(-25) 291(-11) 292(-11)
   reviews 742(-140)   2704(-150)   7868(-96)   30358(-206)
merged  28(0)   100(-14) 346(-88)2271(-70)
 abandoned   6(-2)   43(-7)  125(2)   538(3)
   own commits  43(7)   127(-3)  266(22) 1017(28)
review commits   0(0) 0(0) 0(0) 0(0)
+ easyHack statistics:
   needsDevEval 8(8)   needsUXEval 1(1)   cleanup_comments 320(320)
   total 407(407)   assigned 22(22)   open 354(354)
+ top 10 contributors:
  Armin Le Grand (allotropia) made 17 patches in 1 month, and 79 
patches in 1 year
  Srebotnjak, Martin made 8 patches in 1 month, and 19 patches in 1 year
  Kira Tubo made 8 patches in 1 month, and 10 patches in 1 year
  Weblate made 6 patches in 1 month, and 16 patches in 1 year
  Matt K made 6 patches in 1 month, and 20 patches

core.git: helpcontent2

2024-01-24 Thread Patrick Luby (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b873dc28d9a5896cdf8b842742d191218a91ff41
Author: Patrick Luby 
AuthorDate: Wed Jan 24 16:18:06 2024 +0100
Commit: Gerrit Code Review 
CommitDate: Wed Jan 24 16:18:06 2024 +0100

Update git submodules

* Update helpcontent2 from branch 'master'
  to 5d2a29ee4f4556b0133e73ea429c9c1aaede0581
  - tdf#159307 macOS uses Command+Option+F while other plafforms use Ctrl+H

Change-Id: Iee37805afba1aa712a45c213d1f9eeae4d01d923
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/162452
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/helpcontent2 b/helpcontent2
index 5c4fdb89c981..5d2a29ee4f45 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 5c4fdb89c9810bd961717a09a4c4cf177fa5b3d5
+Subproject commit 5d2a29ee4f4556b0133e73ea429c9c1aaede0581


help.git: source/text

2024-01-24 Thread Patrick Luby (via logerrit)
 source/text/shared/04/0101.xhp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5d2a29ee4f4556b0133e73ea429c9c1aaede0581
Author: Patrick Luby 
AuthorDate: Tue Jan 23 14:17:57 2024 +0100
Commit: Patrick Luby 
CommitDate: Wed Jan 24 16:18:06 2024 +0100

tdf#159307 macOS uses Command+Option+F while other plafforms use Ctrl+H

Change-Id: Iee37805afba1aa712a45c213d1f9eeae4d01d923
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/162452
Tested-by: Jenkins
Reviewed-by: Patrick Luby 

diff --git a/source/text/shared/04/0101.xhp 
b/source/text/shared/04/0101.xhp
index 6ce842fd24..b13f80396c 100644
--- a/source/text/shared/04/0101.xhp
+++ b/source/text/shared/04/0101.xhp
@@ -240,7 +240,7 @@
   
   
 
-  CommandCtrl+H
+  Command+Option+FCtrl+H
 
 
   Calls 
the Find & Replace dialog.


core.git: sw/qa sw/source

2024-01-24 Thread Xisco Fauli (via logerrit)
 sw/qa/core/text/data/tdf159336.odt |binary
 sw/qa/core/text/text.cxx   |   35 +++
 sw/source/core/text/itrform2.cxx   |2 ++
 3 files changed, 37 insertions(+)

New commits:
commit 863a4cde77a5045d44b1da583f00c0a72762f19a
Author: Xisco Fauli 
AuthorDate: Tue Jan 23 15:28:26 2024 +0100
Commit: Xisco Fauli 
CommitDate: Wed Jan 24 15:40:25 2024 +0100

tdf#159336: export EditWidget with multiline enabled

How to reproduce it from scratch:
1. Open writer
2. Form - Content Controls - Rich Text/Plain Text
3. Split the control intro different lines
4. Export to PDF

-> The content control is displayed in one line

Change-Id: Ia8666c8a6520e94ae06693ea8767c1d79aa5d3a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162446
Reviewed-by: Xisco Fauli 
Tested-by: Jenkins

diff --git a/sw/qa/core/text/data/tdf159336.odt 
b/sw/qa/core/text/data/tdf159336.odt
new file mode 100644
index ..4f396e4f2abb
Binary files /dev/null and b/sw/qa/core/text/data/tdf159336.odt differ
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index d61492d43d61..690fc333afb5 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -115,6 +116,40 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, 
testLastBibliographyPdfExport)
 CPPUNIT_ASSERT(true);
 }
 
+CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf159336)
+{
+createSwDoc("tdf159336.odt");
+save("writer_pdf_Export");
+
+vcl::filter::PDFDocument aDocument;
+SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ);
+CPPUNIT_ASSERT(aDocument.Read(aStream));
+
+// The document has one page.
+std::vector aPages = aDocument.GetPages();
+CPPUNIT_ASSERT_EQUAL(static_cast(1), aPages.size());
+
+auto pAnnots = 
dynamic_cast(aPages[0]->Lookup("Annots"_ostr));
+CPPUNIT_ASSERT(pAnnots);
+
+CPPUNIT_ASSERT_EQUAL(static_cast(1), 
pAnnots->GetElements().size());
+auto pAnnotReference
+= 
dynamic_cast(pAnnots->GetElements()[0]);
+CPPUNIT_ASSERT(pAnnotReference);
+vcl::filter::PDFObjectElement* pAnnot = pAnnotReference->LookupObject();
+CPPUNIT_ASSERT(pAnnot);
+CPPUNIT_ASSERT_EQUAL(
+"Annot"_ostr,
+
static_cast(pAnnot->Lookup("Type"_ostr))->GetValue());
+CPPUNIT_ASSERT_EQUAL(
+"Widget"_ostr,
+
static_cast(pAnnot->Lookup("Subtype"_ostr))->GetValue());
+// Ff = multiline
+auto pFf = 
dynamic_cast(pAnnot->Lookup("Ff"_ostr));
+CPPUNIT_ASSERT(pFf);
+CPPUNIT_ASSERT_EQUAL(4096.0, pFf->GetValue());
+}
+
 CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testBibliographyUrlPdfExport)
 {
 // Given a document with a bibliography entry field:
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index a713aebe3fa0..5690d228cf59 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1009,6 +1009,8 @@ bool SwContentControlPortion::DescribePDFControl(const 
SwTextPaintInfo& rInf) co
 case SwContentControlType::PLAIN_TEXT:
 {
 pDescriptor = std::make_unique();
+auto pEditWidget = 
static_cast(pDescriptor.get());
+pEditWidget->MultiLine = true;
 break;
 }
 case SwContentControlType::CHECKBOX:


core.git: Branch 'libreoffice-24-2' - include/svx sc/source sw/source

2024-01-24 Thread Szymon Kłos (via logerrit)
 include/svx/DocumentColorHelper.hxx |   41 
 sc/source/core/data/document10.cxx  |   17 --
 sw/source/core/doc/docfmt.cxx   |   18 +--
 3 files changed, 52 insertions(+), 24 deletions(-)

New commits:
commit 9a19639b2bcfecc4387e720e6c01c3ba57ed00b7
Author: Szymon Kłos 
AuthorDate: Mon Jan 15 09:49:18 2024 +0100
Commit: Tomaž Vajngerl 
CommitDate: Wed Jan 24 15:33:26 2024 +0100

Use correct type when getting document colors

After commit 0460be8848b0ce02c07183e41dd7137ac3b94164
Send document colors with lok callback

There was issue detected by CI:
/sc/source/core/data/document10.cxx:198:46: runtime error: downcast of 
address 0x610efa40 which does not point to an object of type 'const 
SvxColorItem'
  0x610efa40: note: object is of type 'SvxBrushItem'
   00 00 00 00  b0 79 19 48 ce 7f 00 00  01 00 00 00 94 00 be be  4c 17 00 
00 a0 be be be  cc cc ff 00
^~~
vptr for 'SvxBrushItem'
  #0 0x7fce1fbed369 in ScDocument::GetDocColors() 
/sc/source/core/data/document10.cxx:198:46

Change-Id: I41f28b6bb54d7720d58c16d75b9d116a53f106cc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162076
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tomaž Vajngerl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162501
Tested-by: Jenkins

diff --git a/include/svx/DocumentColorHelper.hxx 
b/include/svx/DocumentColorHelper.hxx
new file mode 100644
index ..9388b7cba815
--- /dev/null
+++ b/include/svx/DocumentColorHelper.hxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+#include 
+
+namespace svx
+{
+namespace DocumentColorHelper
+{
+inline Color getColorFromItem(const SvxColorItem* pItem) { return 
pItem->GetValue(); }
+
+inline Color getColorFromItem(const SvxBrushItem* pItem) { return 
pItem->GetColor(); }
+
+template 
+void queryColors(const sal_uInt16 nAttrib, const SfxItemPool* pPool, 
std::set& rOutput)
+{
+for (const SfxPoolItem* pItem : pPool->GetItemSurrogates(nAttrib))
+{
+auto pColorItem = static_cast(pItem);
+Color aColor(getColorFromItem(pColorItem));
+if (COL_AUTO != aColor)
+rOutput.insert(aColor);
+}
+}
+}
+
+} // end of namespace svx
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/document10.cxx 
b/sc/source/core/data/document10.cxx
index acf0f27672b0..df5057558934 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -22,7 +22,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -188,17 +188,10 @@ std::set ScDocument::GetDocColors()
 {
 std::set aDocColors;
 ScDocumentPool *pPool = GetPool();
-const sal_uInt16 pAttribs[] = {ATTR_BACKGROUND, ATTR_FONT_COLOR};
-for (sal_uInt16 nAttrib : pAttribs)
-{
-for (const SfxPoolItem* pItem : pPool->GetItemSurrogates(nAttrib))
-{
-const SvxColorItem *pColorItem = static_cast(pItem);
-Color aColor( pColorItem->GetValue() );
-if (COL_AUTO != aColor)
-aDocColors.insert(aColor);
-}
-}
+
+svx::DocumentColorHelper::queryColors(ATTR_BACKGROUND, 
pPool, aDocColors);
+svx::DocumentColorHelper::queryColors(ATTR_FONT_COLOR, 
pPool, aDocColors);
+
 return aDocColors;
 }
 
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 57c42c529eb1..d6c943dbcdc8 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -25,10 +25,10 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -2036,17 +2036,11 @@ std::set SwDoc::GetDocColors()
 {
 std::set aDocColors;
 SwAttrPool& rPool = GetAttrPool();
-const sal_uInt16 pAttribs[] = {RES_CHRATR_COLOR, RES_CHRATR_HIGHLIGHT, 
RES_BACKGROUND};
-for (sal_uInt16 nAttrib : pAttribs)
-{
-for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(nAttrib))
-{
-auto pColorItem = static_cast(pItem);
-Color aColor( pColorItem->GetValue() );
-if (COL_AUTO != aColor)
-aDocColors.insert(aColor);
-}
-}
+
+svx::DocumentColorHelper::queryColors(RES_CHRATR_COLOR, 
&rPool, aDocColors);
+svx::DocumentColorHelper::queryColors(RES_CHRATR_HIGHLIGHT, 
&rPool, aDocColors);
+svx::DocumentColorHelper::queryColors(RES_CHRATR_BACKGROUND, 
&rPool, aDocColors);
+
 return aDocColors;
 }

core.git: 2 commits - desktop/source include/rtl include/sfx2 sfx2/source test/source

2024-01-24 Thread Caolán McNamara (via logerrit)
 desktop/source/lib/init.cxx|6 +++---
 include/rtl/string.hxx |3 +++
 include/rtl/ustring.hxx|3 +++
 include/sfx2/viewsh.hxx|8 
 sfx2/source/view/lokstarmathhelper.cxx |4 ++--
 sfx2/source/view/viewsh.cxx|8 
 test/source/lokcallback.cxx|8 
 7 files changed, 23 insertions(+), 17 deletions(-)

New commits:
commit fd156c9c2ff1b10e1f3d72c0001f36676e412e5b
Author: Caolán McNamara 
AuthorDate: Wed Jan 24 09:41:17 2024 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 24 14:32:56 2024 +0100

SfxViewShell::GetFirst lambda is never passed a null pShell

it's null checked before the lambda gets called so make this a
reference

Change-Id: Ib8804a2003cbdc6b7b62d8a38fa514d0ce08128c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162495
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index a2675fd97871..ebef6305c2ad 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2280,7 +2280,7 @@ void CallbackFlushHandler::enqueueUpdatedTypes()
 return;
 assert(m_viewId >= 0);
 SfxViewShell* viewShell = SfxViewShell::GetFirst( false,
-[this](const SfxViewShell* shell) { return 
shell->GetViewShellId().get() == m_viewId; } );
+[this](const SfxViewShell& shell) { return 
shell.GetViewShellId().get() == m_viewId; } );
 assert(viewShell != nullptr);
 
 // First move data to local structures, so that callbacks don't possibly 
modify it.
@@ -2323,7 +2323,7 @@ void CallbackFlushHandler::enqueueUpdatedTypes()
 {
 assert(sourceViewId >= 0);
 sourceViewShell = SfxViewShell::GetFirst( false,
-[sourceViewId](const SfxViewShell* shell) { return 
shell->GetViewShellId().get() == sourceViewId; } );
+[sourceViewId](const SfxViewShell& shell) { return 
shell.GetViewShellId().get() == sourceViewId; } );
 }
 if(sourceViewShell == nullptr)
 {
@@ -2364,7 +2364,7 @@ void CallbackFlushHandler::Invoke()
 // so it must be done before taking the mutex.
 assert(m_viewId >= 0);
 if(SfxViewShell* viewShell = SfxViewShell::GetFirst( false,
-[this](const SfxViewShell* shell) { return 
shell->GetViewShellId().get() == m_viewId; } ))
+[this](const SfxViewShell& shell) { return 
shell.GetViewShellId().get() == m_viewId; } ))
 {
 viewShell->flushPendingLOKInvalidateTiles();
 }
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 0cbadc5072dc..805b7ee7893a 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -150,9 +150,9 @@ public: \
 #define SFX_VIEW_REGISTRATION(DocClass) \
 DocClass::Factory().RegisterViewFactory( *Factory() )
 
-template bool checkSfxViewShell(const SfxViewShell* pShell)
+template bool checkSfxViewShell(const SfxViewShell& pShell)
 {
-return dynamic_cast(pShell) != nullptr;
+return dynamic_cast(&pShell) != nullptr;
 }
 
 typedef std::unordered_map> 
StylesHighlighterColorMap;
@@ -204,10 +204,10 @@ protected:
 
 public:
 // Iteration
-SAL_WARN_UNUSED_RESULT static SfxViewShell* GetFirst( bool bOnlyVisible = 
true, const std::function& isViewShell = nullptr 
);
+SAL_WARN_UNUSED_RESULT static SfxViewShell* GetFirst( bool bOnlyVisible = 
true, const std::function& isViewShell = nullptr 
);
 SAL_WARN_UNUSED_RESULT static SfxViewShell* GetNext( const SfxViewShell& 
rPrev,
  bool bOnlyVisible = true,
- const std::function& isViewShell = nullptr );
+ const std::function& isViewShell = nullptr );
 SAL_WARN_UNUSED_RESULT static SfxViewShell* Current();
 
 SAL_WARN_UNUSED_RESULT static SfxViewShell* Get( const 
css::uno::Reference< css::frame::XController>& i_rController );
diff --git a/sfx2/source/view/lokstarmathhelper.cxx 
b/sfx2/source/view/lokstarmathhelper.cxx
index 9b2df19ecdec..e8c4b3a6ca7c 100644
--- a/sfx2/source/view/lokstarmathhelper.cxx
+++ b/sfx2/source/view/lokstarmathhelper.cxx
@@ -130,8 +130,8 @@ const SfxViewShell* LokStarMathHelper::GetSmViewShell()
 {
 if (vcl::Window* pGraphWindow = GetGraphicWindow())
 {
-return SfxViewShell::GetFirst(false, [pGraphWindow](const 
SfxViewShell* shell) {
-return shell->GetWindow() && 
shell->GetWindow()->IsChild(pGraphWindow);
+return SfxViewShell::GetFirst(false, [pGraphWindow](const 
SfxViewShell& shell) {
+return shell.GetWindow() && 
shell.GetWindow()->IsChild(pGraphWindow);
 });
 }
 return nullptr;
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index ca8db9d63a5d..06dfc49798be 100644
--- a/sfx2/source/view/viewsh.c

core.git: include/svl svl/source

2024-01-24 Thread Armin Le Grand (allotropia) (via logerrit)
 include/svl/poolitem.hxx |2 
 svl/source/items/itemset.cxx |  151 ---
 2 files changed, 129 insertions(+), 24 deletions(-)

New commits:
commit 64503f9187252c7ebf85832cca65c0642013bc38
Author: Armin Le Grand (allotropia) 
AuthorDate: Tue Jan 23 20:56:17 2024 +0100
Commit: Armin Le Grand 
CommitDate: Wed Jan 24 14:27:56 2024 +0100

ITEM: Add some default global sharing

As addition to tdf#158605 I have added a
global default mechanism to support global
sharing of Item instances. It's automated
and complements the existing one, see one
of the last commits. All in all there are
now the following possibilities to support
this for individual Item derivations:

(1) Do nothing: In that case, if the Item
is shareable, the new mechanism will kick
in: It will start sharing the Item globally,
but not immediately: After a defined amount
of allowed non-shared ocurrences (look for
NUMBER_OF_UNSHARED_INSTANCES) an instance
of the default ItemInstanceManager, a
DefaultItemInstanceManager, will be incarnated
and used. NOTE: Mixing shared/unshared
instances is not a problem (we might even
implement a kind of 're-hash' when this
kicks in, but is not really needded).

(2) Overload getItemInstanceManager for
SfxPoolItem in a class derived from
SfxPoolItem and...

(2a) Return a static incarnation of
DefaultItemInstanceManager to immediately
start global sharing of that Item derivation.

(2b) Implement and return your own
implementation and static incarnation of
ItemInstanceManager to do something better/
faster that the default implementation can#
do. Example: SvxFontItem, uses hashing.

The NUMBER_OF_UNSHARED_INSTANCES is currently
at (50) which gives a decent relationship
bewteen no global sharing (speed) and memory
needs. Not sharing is faster (that access to
'find' an equal item is spared which might be
costly), sharing again needs less memory.

There are two supported ENVVARs to use:

(a) SVL_DISABLE_ITEM_INSTANCE_MANAGER:
This disables the mechanism of global Item
sharing completely. This can be used to test/
check speed/memory needs compared with using
it, but also may come in handy to check if
evtl. errors/resgrressions have to do with
it.

(b) SVL_SHARE_ITEMS_GLOBALLY_INSTANTLY:
This internally forces the
NUMBER_OF_UNSHARED_INSTANCES to be ignored
and start sharing ALL Item derivations
instantly.

Change-Id: I40d9c5f228f0bcbf239f2ce0a02d423054240570
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162478
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx
index a3af1762d679..43d8c101dd05 100644
--- a/include/svl/poolitem.hxx
+++ b/include/svl/poolitem.hxx
@@ -118,6 +118,7 @@ class SVL_DLLPUBLIC SfxPoolItem
 friend class SfxItemPool;
 friend class SfxItemDisruptor_Impl;
 friend class SfxItemSet;
+friend class InstanceManagerHelper;
 
 // allow ItemSetTooling to access
 friend SfxPoolItem const* implCreateItemEntry(SfxItemPool&, SfxPoolItem 
const*, bool);
@@ -316,6 +317,7 @@ class SVL_DLLPUBLIC DefaultItemInstanceManager : public 
ItemInstanceManager
 std::unordered_set  maRegistered;
 
 public:
+virtual ~DefaultItemInstanceManager() = default;
 virtual const SfxPoolItem* find(const SfxPoolItem&) const override;
 virtual void add(const SfxPoolItem&) override;
 virtual void remove(const SfxPoolItem&) override;
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index df46011dc2d9..907daa23180f 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -34,10 +34,11 @@
 #include 
 #include 
 #include 
-
 #include 
 
 static bool 
g_bDisableItemInstanceManager(getenv("SVL_DISABLE_ITEM_INSTANCE_MANAGER"));
+static bool g_bShareImmediately(getenv("SVL_SHARE_ITEMS_GLOBALLY_INSTANTLY"));
+#define NUMBER_OF_UNSHARED_INSTANCES  (50)
 
 #ifdef DBG_UTIL
 static size_t nAllocatedSfxItemSetCount(0);
@@ -323,6 +324,116 @@ SfxItemSet::SfxItemSet(SfxItemPool& pool, 
WhichRangesContainer wids)
 assert(svl::detail::validRanges2(m_pWhichRanges));
 }
 
+class InstanceManagerHelper
+{
+typedef std::unordered_map> managerTypeMap;
+managerTypeMap  maManagerPerType;
+
+public:
+InstanceManagerHelper() {}
+~InstanceManagerHelper()
+{
+for (auto& rCandidate : maManagerPerType)
+if (nullptr != rCandidate.second.second)
+delete rCandidate.second.second;
+}
+
+ItemInstanceManager* getOrCreateItemInstanceManager(const SfxPoolItem& 
rItem)
+{
+// deactivated?
+if (g_bDisableItemInstanceManager)
+return nullptr;
+
+// Item cannot be shared?
+if (!rItem.isShareable())
+r

core.git: include/svl

2024-01-24 Thread Andrea Gelmini (via logerrit)
 include/svl/poolitem.hxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 2863329783e6507af4cbac796b5b3767f277d75d
Author: Andrea Gelmini 
AuthorDate: Tue Jan 23 21:14:30 2024 +0100
Commit: Julien Nabet 
CommitDate: Wed Jan 24 14:00:26 2024 +0100

Fix typos

Change-Id: I2eb42da2971c5fad5b7f023b17315f556a3cbb88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162479
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx
index 79a113b6da89..a3af1762d679 100644
--- a/include/svl/poolitem.hxx
+++ b/include/svl/poolitem.hxx
@@ -54,7 +54,7 @@ inline bool Any2Bool( const css::uno::Any&rValue )
 }
 
 // Offer simple assert if Item is RefCounted (RefCnt > 1) and thus CANNOT be 
changed.
-// This should be used at *all* SfxPoolItem set* mehods. Remember that 
SfxPoolItems
+// This should be used at *all* SfxPoolItem set* methods. Remember that 
SfxPoolItems
 // are by design intended to be create-one, read-only, shared data packages
 #define ASSERT_CHANGE_REFCOUNTED_ITEM \
 assert(!GetRefCount() && "ERROR: RefCounted SfxPoolItem CANNOT be changed 
(!)")
@@ -306,9 +306,9 @@ class SVL_DLLPUBLIC ItemInstanceManager
 // offering a default implementation that can be use for
 // each SfxPoolItem (except when !isShareable()). It just
 // uses an unordered_set holding ptrs to SfxPoolItems added
-// and SfxPoolItem::opeator== to linearly search for one.
-// Thus thisi is not the fastest, but as fast as old 'poooled'
-// stuff - btter use an intelligent, pro-Item implementation
+// and SfxPoolItem::operator== to linearly search for one.
+// Thus this is not the fastest, but as fast as old 'poooled'
+// stuff - better use an intelligent, pro-Item implementation
 // that does e.g. hashing or whatever might be feasible for
 // that specific Item (see other derivations)
 class SVL_DLLPUBLIC DefaultItemInstanceManager : public ItemInstanceManager


core.git: sc/source

2024-01-24 Thread Noel Grandin (via logerrit)
 sc/source/ui/inc/tabvwsh.hxx   |4 
 sc/source/ui/view/tabvwshf.cxx |  777 -
 2 files changed, 401 insertions(+), 380 deletions(-)

New commits:
commit e9f98de005cdbb65193907cb8f17c258247bd428
Author: Noel Grandin 
AuthorDate: Wed Jan 24 11:16:56 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed Jan 24 13:52:18 2024 +0100

split out move and insert table logic from ScTabViewShell::ExecuteTable

Change-Id: Id56b65e94d553a644f32e9cf7a91ff797bda6bac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162497
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index d14985f83284..219fb3534d60 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -451,6 +451,10 @@ public:
 
 void setScCondFormatDlgItem(const std::shared_ptr& 
rItem) { m_pScCondFormatDlgItem = rItem; }
 const std::shared_ptr& getScCondFormatDlgItem() const 
{ return m_pScCondFormatDlgItem; }
+
+private:
+void ExecuteMoveTable( SfxRequest& rReq );
+void ExecuteInsertTable( SfxRequest& rReq );
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index a41840d5d97e..41781f2cee19 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -187,141 +187,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
 
 case FID_INS_TABLE:
 case FID_INS_TABLE_EXT:
-{
-ScMarkData& rMark= rViewData.GetMarkData();
-SCTAB   nTabSelCount = rMark.GetSelectCount();
-SCTAB   nTabNr   = nCurrentTab;
-
-if ( !rDoc.IsDocEditable() )
-break;  // locked
-
-if ( pReqArgs != nullptr ) // from basic
-{
-bool bOk = false;
-const SfxPoolItem*  pTabItem;
-const SfxPoolItem*  pNameItem;
-
-if ( pReqArgs->HasItem( FN_PARAM_1, &pTabItem ) &&
- pReqArgs->HasItem( nSlot, &pNameItem ) )
-{
-OUString aName = static_cast(pNameItem)->GetValue();
-rDoc.CreateValidTabName(aName);
-
-// sheet number from basic: 1-based
-// 0 is special, means adding at the end
-nTabNr = static_cast(pTabItem)->GetValue();
-if (nTabNr == 0)
-nTabNr = nTabCount;
-else
---nTabNr;
-
-if (nTabNr > nTabCount)
-nTabNr = nTabCount;
-
-bOk = InsertTable(aName, nTabNr);
-}
-
-if (bOk)
-rReq.Done( *pReqArgs );
-//! else set error
-}
-else// dialog
-{
-ScAbstractDialogFactory* pFact = 
ScAbstractDialogFactory::Create();
-
-ScopedVclPtr 
pDlg(pFact->CreateScInsertTableDlg(GetFrameWeld(), rViewData,
-nTabSelCount, nSlot == FID_INS_TABLE_EXT));
-if ( RET_OK == pDlg->Execute() )
-{
-if (pDlg->GetTablesFromFile())
-{
-std::vector nTabs;
-sal_uInt16 n = 0;
-const OUString* pStr = pDlg->GetFirstTable( &n );
-while ( pStr )
-{
-nTabs.push_back( static_cast(n) );
-pStr = pDlg->GetNextTable( &n );
-}
-bool bLink = pDlg->GetTablesAsLink();
-if (!nTabs.empty())
-{
-if(pDlg->IsTableBefore())
-{
-ImportTables( pDlg->GetDocShellTables(), 
nTabs.size(), nTabs.data(),
-bLink,nTabNr );
-}
-else
-{
-SCTAB   nTabAfter= nTabNr+1;
-
-for(SCTAB j=nCurrentTab+1;jGetDocShellTables(), 
nTabs.size(), nTabs.data(),
-bLink,nTabAfter );
-}
-}
-}
-else
-{
-SCTAB nCount=pDlg->GetTableCount();
-if

core.git: sc/source

2024-01-24 Thread Noel Grandin (via logerrit)
 sc/source/ui/inc/viewfunc.hxx  |9 
 sc/source/ui/view/viewfun5.cxx |  664 +
 2 files changed, 350 insertions(+), 323 deletions(-)

New commits:
commit 850b3e9d674bde31b727276b250180798e669462
Author: Noel Grandin 
AuthorDate: Wed Jan 24 11:10:29 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed Jan 24 13:52:10 2024 +0100

split up large method ScViewFunc::PasteDataFormat

Change-Id: I71c60af424aa317dd1cbc3568e171aba3a96c8fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162496
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index bf6a9a77269a..117cd407bbd8 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -369,6 +369,15 @@ private:
 
 voidPostPasteFromClip(const ScRangeList& rPasteRanges, const 
ScMarkData& rMark);
 
+boolPasteDataFormatSource( SotClipboardFormatId nFormatId,
+SCCOL nPosX, SCROW nPosY,
+bool bAllowDialogs,
+TransferableDataHelper& rDataHelper, 
Point& rPos);
+boolPasteDataFormatFormattedText( SotClipboardFormatId 
nFormatId,
+const css::uno::Reference< 
css::datatransfer::XTransferable >& rxTransferable,
+SCCOL nPosX, SCROW nPosY,
+bool bAllowDialogs, 
TransferableDataHelper& rDataHelper );
+
 sal_uInt16  GetOptimalColWidth( SCCOL nCol, SCTAB nTab, bool bFormula 
);
 
 voidStartFormatArea();
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 1098319506f8..9cb343ecd478 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -117,196 +117,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId 
nFormatId,
  nFormatId == SotClipboardFormatId::LINK_SOURCE_OLE ||
  nFormatId == SotClipboardFormatId::EMBEDDED_OBJ_OLE )
 {
-uno::Reference < io::XInputStream > xStm;
-TransferableObjectDescriptor   aObjDesc;
-
-if 
(aDataHelper.GetTransferableObjectDescriptor(SotClipboardFormatId::OBJECTDESCRIPTOR,
 aObjDesc))
-xStm = aDataHelper.GetInputStream(nFormatId, OUString());
-
-if (xStm.is())
-{
-if ( aObjDesc.maClassName == SvGlobalName( SO3_SC_CLASSID_60 ) )
-{
-uno::Reference < embed::XStorage > xStore = 
::comphelper::OStorageHelper::GetStorageFromInputStream( xStm );
-
-// mba: BaseURL doesn't make sense for clipboard
-// #i43716# Medium must be allocated with "new".
-// DoLoad stores the pointer and deletes it with the 
SfxObjectShell.
-SfxMedium* pMedium = new SfxMedium( xStore, OUString() );
-
-//  TODO/LATER: is it a problem that we don't support binary 
formats here?
-ScDocShellRef xDocShRef = new 
ScDocShell(SfxModelFlags::EMBEDDED_OBJECT);
-if (xDocShRef->DoLoad(pMedium))
-{
-ScDocument& rSrcDoc = xDocShRef->GetDocument();
-SCTAB nSrcTab = rSrcDoc.GetVisibleTab();
-if (!rSrcDoc.HasTable(nSrcTab))
-nSrcTab = 0;
-
-ScMarkData aSrcMark(rSrcDoc.GetSheetLimits());
-aSrcMark.SelectOneTable( nSrcTab ); // for 
CopyToClip
-ScDocumentUniquePtr pClipDoc(new ScDocument( 
SCDOCMODE_CLIP ));
-
-SCCOL nFirstCol, nLastCol;
-SCROW nFirstRow, nLastRow;
-if ( rSrcDoc.GetDataStart( nSrcTab, nFirstCol, nFirstRow ) 
)
-{
-rSrcDoc.GetCellArea( nSrcTab, nLastCol, nLastRow );
-if (nLastCol < nFirstCol)
-nLastCol = nFirstCol;
-if (nLastRow < nFirstRow)
-nLastRow = nFirstRow;
-}
-else
-{
-nFirstCol = nLastCol = 0;
-nFirstRow = nLastRow = 0;
-}
-
-bool bIncludeObjects = false; // include drawing layer 
objects in CopyToClip ?
-
-if (nFormatId == SotClipboardFormatId::EMBED_SOURCE)
-{
-const ScDrawLayer* pDraw = rSrcDoc.GetDrawLayer();
-SCCOL nPrintEndCol = nFirstCol;
-SCROW nPrintEndRow = nFirstRow;
-bool bHasObjects = pDraw && pDraw->HasObjects();
-// Extend the range to include the drawing layer 
objects.
-if (bHasObjects && rSrcDoc.GetPrintArea(nSrcT

core.git: Branch 'distro/collabora/co-23.05' - writerfilter/source

2024-01-24 Thread Mike Kaganski (via logerrit)
 writerfilter/source/dmapper/DomainMapper.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit e8d97f2af7e58e7c0068c813eede2fb4ea75a3ab
Author: Mike Kaganski 
AuthorDate: Thu Jan 18 20:57:52 2024 +0600
Commit: Mike Kaganski 
CommitDate: Wed Jan 24 13:52:00 2024 +0100

Related: tdf#159259 Drop obsolete exclusion of framePr inside sdt

Commit 73bd937420b9a99e1e35950e3f9dcbcfd874876d (n#780853 fix DOCX
import of w:sdtContent in table cell, 2012-09-25) had introduced a
restriction, where a framePr was ignored, when inside an sdt. It
was required to allow table import, which broke otherwise.

Since then, the situation has obviously changed; the test case for
the change, added in commit 7ea71eb8a28c4b41949299ff7d4b391486c90eea
(n#780853 testcase, 2012-09-25) passes after removal of the check.

This check disallows importing sdt in frame. This makes the bugdoc
of tdf#159259 to import the sdt in frame. The Lorem Ipsum paragraph
is still enclosed into the sdt - to be fixed in a follow-up.

Change-Id: I60fbb2dd6f753682217d86e4f8d315f1883c6e83
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162258
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 4d0f2d5ec9f7f988a1493916ae35bac1986c95a8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162384
Reviewed-by: Xisco Fauli 
Tested-by: Xisco Fauli 
(cherry picked from commit 883aa0695524d171c9009c87b4f32488b134629f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162467
Tested-by: Jenkins CollaboraOffice 

diff --git a/writerfilter/source/dmapper/DomainMapper.cxx 
b/writerfilter/source/dmapper/DomainMapper.cxx
index e4e66672fab9..6813736dc4c5 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2408,8 +2408,6 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const 
PropertyMapPtr& rContext )
 }
 break;
 case NS_ooxml::LN_CT_PPrBase_framePr:
-// Avoid frames if we're inside a structured document tag, would just 
cause outer tables fail to create.
-if (!m_pImpl->GetSdt())
 {
 PropertyMapPtr pContext = 
m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH);
 if( pContext )


core.git: sfx2/source

2024-01-24 Thread Xisco Fauli (via logerrit)
 sfx2/source/doc/guisaveas.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ae591835dc6b2c18169c2685fbc7e9fb958bf369
Author: Xisco Fauli 
AuthorDate: Wed Jan 24 10:03:53 2024 +0100
Commit: Xisco Fauli 
CommitDate: Wed Jan 24 13:30:50 2024 +0100

sfx2: check SfxViewShell::Current()

Seen in 
https://crashreport.libreoffice.org/stats/crash_details/52df6de5-7ea8-48e4-8c45-f18b02d9a767

Change-Id: I56c17234a0f82797d37e26b0c39eeba7f78fcee5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162492
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 7b286321c217..5773fc732ea9 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1521,7 +1521,7 @@ bool SfxStoringHelper::GUIStoreModel( const 
uno::Reference< frame::XModel >& xMo
 }
 }
 
-if (!comphelper::LibreOfficeKit::isActive() && !( m_nStoreMode & 
EXPORT_REQUESTED ) )
+if (!comphelper::LibreOfficeKit::isActive() && !( m_nStoreMode & 
EXPORT_REQUESTED ) && SfxViewShell::Current() )
 {
 SfxObjectShell* pDocShell = SfxViewShell::Current()->GetObjectShell();
 


core.git: include/svx

2024-01-24 Thread Caolán McNamara (via logerrit)
 include/svx/DocumentColorHelper.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ebd97f4b8c598f8982446aac06fbb45341d8c2cf
Author: Caolán McNamara 
AuthorDate: Wed Jan 24 10:02:47 2024 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 24 12:56:28 2024 +0100

make these inlines non-static

Change-Id: Icf0f79b7673df1e147a57e796faf82dfd0e01b11
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162500
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/svx/DocumentColorHelper.hxx 
b/include/svx/DocumentColorHelper.hxx
index 4e12733391a5..83884adcfa51 100644
--- a/include/svx/DocumentColorHelper.hxx
+++ b/include/svx/DocumentColorHelper.hxx
@@ -19,9 +19,9 @@ namespace svx
 {
 namespace DocumentColorHelper
 {
-static inline Color getColorFromItem(const SvxColorItem* pItem) { return 
pItem->GetValue(); }
+inline Color getColorFromItem(const SvxColorItem* pItem) { return 
pItem->GetValue(); }
 
-static inline Color getColorFromItem(const SvxBrushItem* pItem) { return 
pItem->GetColor(); }
+inline Color getColorFromItem(const SvxBrushItem* pItem) { return 
pItem->GetColor(); }
 
 template 
 void queryColors(const sal_uInt16 nAttrib, const SfxItemPool* pPool, 
std::set& rOutput)


core.git: Branch 'libreoffice-7-6' - vcl/qt5

2024-01-24 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtWidget.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 33c646b5044f77de2f1740f6e6b8c951139a96eb
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 09:32:07 2024 +0100
Commit: Michael Stahl 
CommitDate: Wed Jan 24 12:15:25 2024 +0100

tdf#159333 qt a11y: Process shortcuts only once

As described in

commit 69e708868f6046cada955a16bca966370ce3218a
Author: Michael Weghorn 
Date:   Thu Feb 20 08:14:36 2020 +0100

tdf#130794 qt5: Actually, ignore non-spontaneous 
QEvent::ShortcutOverride

and the previous

commit 034f56015c1c7a61faede33fb5306f63b5585632
Author: Michael Weghorn 
Date:   Mon Feb 17 10:38:15 2020 +0100

tdf#126785 qt5: Ignore external QEvent::ShortcutOverride

it refers to, duplicate events of type
`QEvent::ShortcutOverride` are received when a11y is
active, so those commits introduced ignoring of the
non-spontaneous one, and leaving processing for the
spontaneous event only, thus preventing duplication of
typed text.

However, keyboard shortcuts like Ctrl+V were still
processed twice: While they're only processed once
in `QtWidget::handleEvent` (for the spontaneous
event of type `QEvent::ShortcutOverride`), the keyboard
shortcut was additionally handled as the shortcut to
activate the action that's used for the menu entries,
e.g. the "Edit" -> "Paste" menu entry for Ctrl+V
(s. class `QtMenu`, where those are set).

Accept the non-spontaneous `QEvent::ShortcutOverride`
event to prevent that from happening.

Quoting the `QEvent::ShortcutOverride` doc [1]:

> Key press in child, for overriding shortcut key handling (QKeyEvent).
> When a shortcut is about to trigger, ShortcutOverride is sent to the
> active window. This allows clients (e.g. widgets) to signal that they
> will handle the shortcut themselves, by accepting the event. If the
> shortcut override is accepted, the event is delivered as a normal key
> press to the focus widget. Otherwise, it triggers the shortcut action,
> if one exists.

With this commit in place, the shortcut is only
processed once, as expected.

Potentially, this should ideally be addressed on Qt
side in the future, see the discussion in tdf#126785.

The duplication happens since this qtbase commit
(no longer with a local revert of it): [2]

commit 7c532891e0be2cf78c89738e175b3d312d305e4e
Date:   Tue Apr 17 16:45:09 2018 +0200

Send ShortcutOverride event when receiving a non-spontaneous key 
press

Since 2020, there a pending Qt change by Alexander Volkov
suggesting to avoid the duplicate events by filtering them
out in `QSpiApplicationAdaptor::eventFilter` on qtbase
side: [3]

With that change not being merged yet, fix this on LO side
for now.

[1] https://doc.qt.io/qt-6/qevent.html#Type-enum
[2] 
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=7c532891e0be2cf78c89738e175b3d312d305e4e
[3] https://codereview.qt-project.org/c/qt/qtbase/+/295892

Change-Id: I28cb11914ae81284e050bff0deb39d95e8073ce0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162430
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit 6e20e58270c88c8c77f156be75c23c66e1169e44)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162454
Reviewed-by: Michael Stahl 

diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index 83ada7866f2b..f8fa70886cb2 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -641,6 +641,9 @@ bool QtWidget::handleEvent(QtFrame& rFrame, QWidget& 
rWidget, QEvent* pEvent)
 // is called below (s. tdf#122053)
 if (!pEvent->spontaneous())
 {
+// accept event so shortcut action (from menu) isn't triggered in 
addition
+// to the processing for the spontaneous event further below
+pEvent->accept();
 return false;
 }
 


core.git: Branch 'libreoffice-24-2' - vcl/qt5

2024-01-24 Thread Michael Weghorn (via logerrit)
 vcl/qt5/QtWidget.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit ac136a069ef69fd7e9c71256a93499475631794b
Author: Michael Weghorn 
AuthorDate: Tue Jan 23 09:32:07 2024 +0100
Commit: Michael Stahl 
CommitDate: Wed Jan 24 12:15:05 2024 +0100

tdf#159333 qt a11y: Process shortcuts only once

As described in

commit 69e708868f6046cada955a16bca966370ce3218a
Author: Michael Weghorn 
Date:   Thu Feb 20 08:14:36 2020 +0100

tdf#130794 qt5: Actually, ignore non-spontaneous 
QEvent::ShortcutOverride

and the previous

commit 034f56015c1c7a61faede33fb5306f63b5585632
Author: Michael Weghorn 
Date:   Mon Feb 17 10:38:15 2020 +0100

tdf#126785 qt5: Ignore external QEvent::ShortcutOverride

it refers to, duplicate events of type
`QEvent::ShortcutOverride` are received when a11y is
active, so those commits introduced ignoring of the
non-spontaneous one, and leaving processing for the
spontaneous event only, thus preventing duplication of
typed text.

However, keyboard shortcuts like Ctrl+V were still
processed twice: While they're only processed once
in `QtWidget::handleEvent` (for the spontaneous
event of type `QEvent::ShortcutOverride`), the keyboard
shortcut was additionally handled as the shortcut to
activate the action that's used for the menu entries,
e.g. the "Edit" -> "Paste" menu entry for Ctrl+V
(s. class `QtMenu`, where those are set).

Accept the non-spontaneous `QEvent::ShortcutOverride`
event to prevent that from happening.

Quoting the `QEvent::ShortcutOverride` doc [1]:

> Key press in child, for overriding shortcut key handling (QKeyEvent).
> When a shortcut is about to trigger, ShortcutOverride is sent to the
> active window. This allows clients (e.g. widgets) to signal that they
> will handle the shortcut themselves, by accepting the event. If the
> shortcut override is accepted, the event is delivered as a normal key
> press to the focus widget. Otherwise, it triggers the shortcut action,
> if one exists.

With this commit in place, the shortcut is only
processed once, as expected.

Potentially, this should ideally be addressed on Qt
side in the future, see the discussion in tdf#126785.

The duplication happens since this qtbase commit
(no longer with a local revert of it): [2]

commit 7c532891e0be2cf78c89738e175b3d312d305e4e
Date:   Tue Apr 17 16:45:09 2018 +0200

Send ShortcutOverride event when receiving a non-spontaneous key 
press

Since 2020, there a pending Qt change by Alexander Volkov
suggesting to avoid the duplicate events by filtering them
out in `QSpiApplicationAdaptor::eventFilter` on qtbase
side: [3]

With that change not being merged yet, fix this on LO side
for now.

[1] https://doc.qt.io/qt-6/qevent.html#Type-enum
[2] 
https://code.qt.io/cgit/qt/qtbase.git/commit/?id=7c532891e0be2cf78c89738e175b3d312d305e4e
[3] https://codereview.qt-project.org/c/qt/qtbase/+/295892

Change-Id: I28cb11914ae81284e050bff0deb39d95e8073ce0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162430
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 
(cherry picked from commit f4cc37c06ae15923df6b15777f2526008c2b4ca6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162453
Reviewed-by: Michael Stahl 

diff --git a/vcl/qt5/QtWidget.cxx b/vcl/qt5/QtWidget.cxx
index a7c4f32e9243..996a0a7cc9ce 100644
--- a/vcl/qt5/QtWidget.cxx
+++ b/vcl/qt5/QtWidget.cxx
@@ -697,6 +697,9 @@ bool QtWidget::handleEvent(QtFrame& rFrame, QWidget& 
rWidget, QEvent* pEvent)
 // is called below (s. tdf#122053)
 if (!pEvent->spontaneous())
 {
+// accept event so shortcut action (from menu) isn't triggered in 
addition
+// to the processing for the spontaneous event further below
+pEvent->accept();
 return false;
 }
 


core.git: Branch 'libreoffice-24-2' - 2 commits - offapi/com sw/inc sw/qa sw/source xmloff/source

2024-01-24 Thread László Németh (via logerrit)
 offapi/com/sun/star/style/CharacterProperties.idl |8 +
 sw/inc/ndtxt.hxx  |2 
 sw/qa/uitest/data/tdf106733.fodt  |   66 
 sw/qa/uitest/writer_tests8/tdf106733.py   |  112 ++
 sw/qa/uitest/writer_tests8/tdf159102.py   |   42 +---
 sw/source/core/inc/txtfrm.hxx |2 
 sw/source/core/text/guess.cxx |7 +
 sw/source/core/text/txtfrm.cxx|4 
 sw/source/core/txtnode/thints.cxx |   25 +++-
 xmloff/source/text/txtprmap.cxx   |2 
 10 files changed, 244 insertions(+), 26 deletions(-)

New commits:
commit de8a6c90c7aa5d26f758a590bad955cd62251702
Author: László Németh 
AuthorDate: Mon Jan 22 15:22:39 2024 +0100
Commit: Michael Stahl 
CommitDate: Wed Jan 24 12:12:18 2024 +0100

tdf#106733 sw: fix bad downcast in SwTextNode::GetLang()

Fix bad cast of SvxNoHyphenItem to SvxLanguageItem
reported by :

  /sw/source/core/txtnode/thints.cxx:3560:16: runtime error: downcast of 
address 0x6030005e44d0 which does not point to an object of type 'const 
SvxLanguageItem'
  0x6030005e44d0: note: object is of type 'SvxNoHyphenItem'
   1a 00 00 00  90 e3 d5 77 5c 7f 00 00  00 00 00 00 13 00 be be  16 00 00 
00 92 01 be be  00 00 00 00
^~~
vptr for 'SvxNoHyphenItem'
  #0 0x7f5bda7e8c0c in SwTextNode::GetLang(int, int, unsigned short, 
bool) const /sw/source/core/txtnode/thints.cxx:3560:16

Regression since commit b5e275f47a54bd7fee39dad516a433fde5be872d
"tdf#106733 sw: implement CharNoHyphenation".

Change-Id: I0c6f60a4074f8fd6da26674cace47f5c5e32afd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162401
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit 9193e61d3e7b850b3715c848c09434e24855340b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162379
Reviewed-by: Michael Stahl 

diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index a7dff69e1c2e..cf5e1ff1cccf 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -3555,7 +3555,7 @@ LanguageType SwTextNode::GetLang( const sal_Int32 nBegin, 
const sal_Int32 nLen,
 }
 }
 }
-if( LANGUAGE_DONTKNOW == nRet )
+if( LANGUAGE_DONTKNOW == nRet && !bNoneIfNoHyphenation )
 {
 nRet = static_cast(GetSwAttrSet().Get( 
nWhichId )).GetLanguage();
 if( LANGUAGE_DONTKNOW == nRet )
commit 04c92ff9cfec039f7fc03277de46d77bb3109431
Author: László Németh 
AuthorDate: Fri Jan 19 01:29:34 2024 +0100
Commit: Michael Stahl 
CommitDate: Wed Jan 24 12:12:12 2024 +0100

tdf#106733 sw: implement CharNoHyphenation

Implement CharNoHyphenation character property to
disable automatic hyphenation of words in paragraphs
with enabled hyphenation.

Fix also fo:hyphenate mapping to CharNoHyphenation
using automatic inversion of their boolean values
defined by xmloff's XML_TYPE_NBOOL, as suggested by
Michael Stahl.

Update also the test for tdf#159102 to check the available
hyphenation dictionary (also custom hyphenation patterns
work only with supported locales of the hyphenator).

Note: patch of thints.cxx contains also partial revert
of commit 53b289eabb3d265b47bc7fb6cc430291c97f0c0b
"use more TypedWhichId".

Follow-up to commit 73bd04a71e741788a2f2f3b26cc46ddb6a361372
"tdf#106733 xmloff: keep fo:hyphenate in character formatting".

Change-Id: If99b94ddcd44a5c2426e646be149078a3b9773b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162300
Tested-by: László Németh 
Reviewed-by: László Németh 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162283
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/offapi/com/sun/star/style/CharacterProperties.idl 
b/offapi/com/sun/star/style/CharacterProperties.idl
index 6502a47b2886..aaff4a569455 100644
--- a/offapi/com/sun/star/style/CharacterProperties.idl
+++ b/offapi/com/sun/star/style/CharacterProperties.idl
@@ -325,7 +325,13 @@ published service CharacterProperties
 
 
 /** This optional property determines if the word can be hyphenated at the
-character.
+character by automatic hyphenation.
+
+Setting to `true` will disable hyphenation enabled by 
ParaIsHyphenation.
+
+Note: implemented since LibreOffice 24.2.
+
+@see ParaIsHyphenation
  */
 [optional, property] boolean CharNoHyphenation;
 
diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx
index 3f99919f77b2..352dad71c247 100644
--- a/sw/inc/ndtxt.hxx
+++ b/sw/inc/ndtxt.hxx
@@ -720,7 +720,7 @@ public:
 void fillSoftPageBreakList( SwSoftPageBreakList&

core.git: basctl/uiconfig

2024-01-24 Thread Rafael Lima (via logerrit)
 basctl/uiconfig/basicide/ui/gotolinedialog.ui |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 52188252bb5d44e15266b84b771599a453438ba6
Author: Rafael Lima 
AuthorDate: Wed Jan 24 00:46:48 2024 +0100
Commit: Rafael Lima 
CommitDate: Wed Jan 24 12:11:08 2024 +0100

Related tdf#158749 The "Go to Line" dialog should not be resizable

Change-Id: I93c5c1b4a2832b60e194abd7e7d528362885bb24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162461
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 

diff --git a/basctl/uiconfig/basicide/ui/gotolinedialog.ui 
b/basctl/uiconfig/basicide/ui/gotolinedialog.ui
index fdef2dec1f19..84960ce7d4e0 100644
--- a/basctl/uiconfig/basicide/ui/gotolinedialog.ui
+++ b/basctl/uiconfig/basicide/ui/gotolinedialog.ui
@@ -6,6 +6,7 @@
 False
 6
 Go to Line
+False
 True
 0
 0


core.git: Branch 'libreoffice-24-2-0' - external/onlineupdate

2024-01-24 Thread Stephan Bergmann (via logerrit)
 external/onlineupdate/lo.patch |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 5bb295c263803fbf39562aa7e95f8d32a77ac854
Author: Stephan Bergmann 
AuthorDate: Tue Jan 23 14:20:51 2024 +0100
Commit: Michael Stahl 
CommitDate: Wed Jan 24 11:33:55 2024 +0100

MAR update, too big to (not) fail

On Windows, when a MAR update generated by create-partial-info contains very
many patches (as easily happens with LibreOffice), applying it would fail 
with
"failed: 7" (aka WRITE_ERROR, see

workdir/UnpackedTarball/onlineupdate/onlineupdate/source/update/common/updatererror.h)
because in

workdir/UnpackedTarball/onlineupdate/onlineupdate/source/update/updater/updater.cpp
PatchFile::mPatchStream holds open one FILE instance per patch from
PatchFile::Prepare to PatchFile::Execute (and which can't easily be reworked
because of the Lock/UnlockFile done on the underlying HANDLE "so it can't be
messed with [in] between"), so calling NS_tfopen in PatchFile::Prepare will
eventually start to fail with EMFILE.

To avoid that, try to raise the limit to its maximum (but don't fail 
immediately
if that fails, in case the given MAR update wouldn't run into the issue of 
too
many patches, anyway), and keep fingers crossed.  (See


"_setmaxstdio" for details:  "By default, up to 512 files can be open
simultaneously at the stream I/O level.  This level includes files opened 
and
accessed using the fopen, fgetc, and fputc family of functions.  The limit 
of
512 open files at the stream I/O level can be increased to a maximum of 
8,192 by
use of the _setmaxstdio function.")

Change-Id: I6b3499f0f6c2060628418a15f5e36021bfe7dd18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162442
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit 4582da4ad473e256975c86054033eb7d238d464e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162455
Reviewed-by: Thorsten Behrens 
(cherry picked from commit dec29bf4c7844d6cc3231b93ca1bb56243caabfe)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162459
Reviewed-by: Michael Weghorn 
Reviewed-by: Ilmari Lauhakangas 
Tested-by: Michael Stahl 
Reviewed-by: Michael Stahl 

diff --git a/external/onlineupdate/lo.patch b/external/onlineupdate/lo.patch
index 870857b7ba46..14b2a9a2dec3 100644
--- a/external/onlineupdate/lo.patch
+++ b/external/onlineupdate/lo.patch
@@ -223,6 +223,19 @@
LOG_WARN(("Install directory updater could not be determined."));
result = FALSE;
  }
+--- onlineupdate/source/update/updater/updater.cpp
 onlineupdate/source/update/updater/updater.cpp
+@@ -4174,6 +4174,10 @@
+ NS_tmkdir(gDeleteDirPath, 0755);
+   }
+ }
++
++if (_setmaxstdio(8192) == -1) {
++LOG(("_setmaxstdio failed"));
++}
+ #endif /* XP_WIN */
+ 
+ // Run update process on a background thread. ShowProgressUI may return
 --- tools/update-packaging/common.sh
 +++ tools/update-packaging/common.sh
 @@ -76,6 +76,15 @@


core.git: chart2/source sc/source sd/source sw/source

2024-01-24 Thread Noel Grandin (via logerrit)
 chart2/source/controller/main/ShapeController.cxx |   28 --
 sc/source/ui/drawfunc/drawsh.cxx  |9 ++--
 sc/source/ui/drawfunc/drtxtob.cxx |   42 +++---
 sd/source/ui/func/futxtatt.cxx|   31 
 sw/source/uibase/shells/drawdlg.cxx   |   38 +++
 sw/source/uibase/shells/drwtxtsh.cxx  |   24 +++-
 6 files changed, 104 insertions(+), 68 deletions(-)

New commits:
commit a9ee88cc47783a809f6c49f5b7326180dc0bbead
Author: Noel Grandin 
AuthorDate: Tue Jan 23 12:58:48 2024 +0200
Commit: Noel Grandin 
CommitDate: Wed Jan 24 10:51:00 2024 +0100

make text-table dialog async

Change-Id: Ic24b2b935f1d539cf257194d136d901b52e00a84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162433
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/chart2/source/controller/main/ShapeController.cxx 
b/chart2/source/controller/main/ShapeController.cxx
index fe09d3e9af61..c440a7d97925 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -320,20 +320,26 @@ void ShapeController::executeDispatch_TextAttributes()
 pDrawViewWrapper->MergeAttrFromMarked( aAttr, false );
 }
 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-ScopedVclPtr< SfxAbstractTabDialog > pDlg(
+VclPtr< SfxAbstractTabDialog > pDlg(
 pFact->CreateTextTabDialog(pChartWindow, &aAttr, pDrawViewWrapper));
-if ( pDlg->Execute() == RET_OK )
-{
-const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
-if ( bHasMarked )
-{
-pDrawViewWrapper->SetAttributes( *pOutAttr );
-}
-else
+pDlg->StartExecuteAsync(
+[pDlg, bHasMarked, pDrawViewWrapper] (sal_Int32 nResult)->void
 {
-pDrawViewWrapper->SetDefaultAttr( *pOutAttr, false );
+if ( RET_OK == nResult )
+{
+const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
+if ( bHasMarked )
+{
+pDrawViewWrapper->SetAttributes( *pOutAttr );
+}
+else
+{
+pDrawViewWrapper->SetDefaultAttr( *pOutAttr, false );
+}
+}
+pDlg->disposeOnce();
 }
-}
+);
 }
 
 void ShapeController::executeDispatch_TransformDialog()
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index dfc3d94ef79f..19e455fd2169 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -559,10 +559,12 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq )
 weld::Window* pWin = rViewData.GetDialogParent();
 VclPtr pDlg(pFact->CreateTextTabDialog(pWin, 
&aNewAttr, pView));
 
+auto xRequest = std::make_shared(rReq);
+rReq.Ignore(); // the 'old' request is not relevant any more
 pDlg->StartExecuteAsync(
-[pDlg, bHasMarked, pView] (sal_Int32 nResult)->void
+[pDlg, xRequest, bHasMarked, pView] (sal_Int32 nResult)->void
 {
-if (nResult == RET_OK)
+if ( RET_OK == nResult )
 {
 if ( bHasMarked )
 pView->SetAttributes( *pDlg->GetOutputItemSet() );
@@ -570,12 +572,11 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq )
 pView->SetDefaultAttr( *pDlg->GetOutputItemSet(), false );
 
 pView->InvalidateAttribs();
+xRequest->Done();
 }
 pDlg->disposeOnce();
 }
 );
-
-rReq.Done();
 }
 
 void ScDrawShell::ExecuteMeasureDlg( SfxRequest& rReq )
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx 
b/sc/source/ui/drawfunc/drtxtob.cxx
index a04f86a2f44d..b283e0546b6a 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -887,19 +887,35 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
 case SID_DRAWTEXT_ATTR_DLG:
 {
 SvxAbstractDialogFactory* pFact = 
SvxAbstractDialogFactory::Create();
-ScopedVclPtr 
pDlg(pFact->CreateTextTabDialog(mrViewData.GetDialogParent(), &aEditAttr, 
pView));
-
-bDone = ( RET_OK == pDlg->Execute() );
-
-if ( bDone )
-aNewAttr.Put( *pDlg->GetOutputItemSet() );
-
-pDlg.disposeAndClear();
-
-SfxBindings& rBindings = mrViewData.GetBindings();
-rBindings.Invalidate( SID_TABLE_VERT_NONE );
-rBindings.Invalidate( SID_TABLE_VERT_CENTER );
-rBindings.Invalidate( SID_TABLE_VERT_BOTTOM );
+VclPtr 
pDlg(pFact->CreateTextTabDialog(mrViewData.GetDialogParent(), &aEditAttr, 
pView));
+auto xRequest = std::make_sh

core.git: Branch 'distro/collabora/co-24.04' - sal/osl sal/qa

2024-01-24 Thread Szymon Kłos (via logerrit)
 sal/osl/unx/file.cxx |   46 ++-
 sal/qa/osl/file/osl_File.cxx |   25 +++
 2 files changed, 62 insertions(+), 9 deletions(-)

New commits:
commit b410c4f06b3a341081c1591ef22660fae27f017e
Author: Szymon Kłos 
AuthorDate: Wed Nov 29 14:00:32 2023 +0100
Commit: Caolán McNamara 
CommitDate: Wed Jan 24 10:47:39 2024 +0100

sal: osl::File allow to create files in sandbox

"realpath" returns NULL for path which doesn't exist.
Allow usage of non-existing paths if parent is allowed.
This allows to successfully start the sandboxed kit.

osl_setAllowedPaths will allow now to use:
/foo/bar/nonexisting - previously it was ignored, is needed for LOK
but /foo/bar/nonexisting/newlevel - still cannot be used

isForbidden now checks parents of non-existing dir and assumes
the same permissions, if parent doesn't exist - it tries with
parent of parent, etc ...

Change-Id: I1052747ca284d2f81dfd5c5fbf893936e7426220
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160111
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 
(cherry picked from commit c3bdba781e8c9d61ca9e2a3d8d2eaca435b9aaad)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162486
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index ecd721cfc31c..41ce0aae9aba 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -789,6 +789,18 @@ static std::vector allowedPathsRead;
 static std::vector allowedPathsReadWrite;
 static std::vector allowedPathsExecute;
 
+static OString getParentFolder(const OString &rFilePath)
+{
+sal_Int32 n = rFilePath.lastIndexOf('/');
+OString folderPath;
+if (n < 1)
+folderPath = ".";
+else
+folderPath = rFilePath.copy(0, n);
+
+return folderPath;
+}
+
 SAL_DLLPUBLIC void osl_setAllowedPaths(
 rtl_uString *pustrFilePaths
 )
@@ -819,9 +831,25 @@ SAL_DLLPUBLIC void osl_setAllowedPaths(
 }
 
 char resolvedPath[PATH_MAX];
-if (realpath(aPath.getStr(), resolvedPath))
+bool isResolved = !!realpath(aPath.getStr(), resolvedPath);
+bool notExists = !isResolved && errno == ENOENT;
+
+if (notExists)
 {
-OString aPushPath = OString(resolvedPath, strlen(resolvedPath));
+sal_Int32 n = aPath.lastIndexOf('/');
+OString folderPath = getParentFolder(aPath);
+isResolved = !!realpath(folderPath.getStr(), resolvedPath);
+notExists = !isResolved && errno == ENOENT;
+
+if (notExists || !isResolved || strlen(resolvedPath) + 
aPath.getLength() - n + 1 >= PATH_MAX)
+return; // too bad
+else
+strcat(resolvedPath, aPath.getStr() + n);
+}
+
+if (isResolved)
+{
+OString aPushPath(resolvedPath, strlen(resolvedPath));
 if (eType == 'r')
 allowedPathsRead.push_back(aPushPath);
 else if (eType == 'w')
@@ -851,13 +879,13 @@ bool isForbidden(const OString &filePath, int nFlags)
 // fail to resolve. Thankfully our I/O APIs don't allow
 // symlink creation to race here.
 sal_Int32 n = filePath.lastIndexOf('/');
-OString folderPath;
-if (n < 1)
-folderPath = ".";
-else
-folderPath = filePath.copy(0, n);
-if (!realpath(folderPath.getStr(), resolvedPath) ||
-strlen(resolvedPath) + filePath.getLength() - n + 1 >= PATH_MAX)
+OString folderPath = getParentFolder(filePath);
+
+bool isResolved = !!realpath(folderPath.getStr(), resolvedPath);
+bool notExists = !isResolved && errno == ENOENT;
+if (notExists) // folder doesn't exist, check parent, in the end of 
chain checks "."
+return isForbidden(folderPath, nFlags);
+else if (!isResolved || strlen(resolvedPath) + filePath.getLength() - 
n + 1 >= PATH_MAX)
 return true; // too bad
 else
 strcat(resolvedPath, filePath.getStr() + n);
diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx
index 0de87eeb14a9..df59f33e6070 100644
--- a/sal/qa/osl/file/osl_File.cxx
+++ b/sal/qa/osl/file/osl_File.cxx
@@ -1348,6 +1348,19 @@ namespace osl_Forbidden
 void forbidden()
 {
 File::setAllowedPaths(maScratchGood);
+
+// check some corner cases first
+CPPUNIT_ASSERT_EQUAL_MESSAGE("read bad should be forbidden",
+ true, File::isForbidden(".", 
osl_File_OpenFlag_Read));
+CPPUNIT_ASSERT_EQUAL_MESSAGE("read bad should be forbidden",
+ true, File::isForbidden("", 
osl_File_OpenFlag_Read));
+CPPUNIT_ASSERT_EQUAL_MESSAGE("read bad should be forbidden",
+ 

core.git: sd/source

2024-01-24 Thread Tomaž Vajngerl (via logerrit)
 sd/source/ui/view/drviewsf.cxx |   15 ---
 1 file changed, 15 deletions(-)

New commits:
commit ad8248bcc7ed19285147aeff71a508453a61
Author: Tomaž Vajngerl 
AuthorDate: Wed Aug 30 09:15:56 2023 +0200
Commit: Caolán McNamara 
CommitDate: Wed Jan 24 10:45:14 2024 +0100

sd: remove condition to only show ThemeDialog in master view

Change-Id: I09ce07f7b520688aa54dd30107b5ab2218b12894
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156277
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 
(cherry picked from commit 62804da3c0ab9443cf36f2e02387a2e9c272d5dc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162463
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index 979225bb06dd..cb0e6495323d 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -470,21 +470,6 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
 }
 break;
 
-case SID_THEME_DIALOG:
-{
-bool bDisable = true;
-SdrPageView* pPageView = mpDrawView->GetSdrPageView();
-if (pPageView)
-{
-SdPage* pPage = 
dynamic_cast(pPageView->GetPage());
-if (pPage && pPage->IsMasterPage())
-bDisable = false;
-}
-if (bDisable)
-rSet.DisableItem(nWhich);
-}
-break;
-
 case SID_STYLE_FAMILY2:
 case SID_STYLE_FAMILY3:
 case SID_STYLE_FAMILY5:


core.git: Branch 'libreoffice-24-2' - sw/qa sw/source

2024-01-24 Thread Miklos Vajna (via logerrit)
 sw/qa/core/layout/data/floattable-not-wrapped-by-table.docx |binary
 sw/qa/core/layout/tabfrm.cxx|   22 
 sw/source/core/layout/tabfrm.cxx|   15 ++--
 3 files changed, 33 insertions(+), 4 deletions(-)

New commits:
commit 5df7c66193d55af944b3269f11374e60da437c0b
Author: Miklos Vajna 
AuthorDate: Tue Jan 23 15:34:07 2024 +0100
Commit: Xisco Fauli 
CommitDate: Wed Jan 24 10:14:10 2024 +0100

tdf#159017 sw floattable: only shift to the right when needed

Regression from commit 868140fcc1311259b9d5f37b33d226511a53
(tdf#60558 sw floattable: allow wrap of table on the right of a
floattable, 2023-12-05), the document had an inline table, followed by a
floating table, and we moved the inline table to the right even if the
left hand side of the floating table already had enough space.

What happens here is that nominally the inline table's original position
overlaps, but because the table width is small enough, such an overlap
doesn't actually happen. In this case, it's not needed to shift the
inline table to the right.

Fix the problem by making the check that decides whether it's necessary
to increment the left margin of the table more strict: it's not enough
to have enough space on the right of the fly, it's also needed to *not*
have enough space on the left side.

This keeps the original "floating table wrapped by inline table on the
right" use-case working, but restores the ~no left margin for the inline
table for the new bugdoc.

Change-Id: Ifb30d90ca6dba7cc4a402d8a4445251120b575ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162447
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 6e3ad6ca0ae6cf62056610ddae9097973a887d99)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162464
Reviewed-by: Xisco Fauli 

diff --git a/sw/qa/core/layout/data/floattable-not-wrapped-by-table.docx 
b/sw/qa/core/layout/data/floattable-not-wrapped-by-table.docx
new file mode 100644
index ..2c255148d351
Binary files /dev/null and 
b/sw/qa/core/layout/data/floattable-not-wrapped-by-table.docx differ
diff --git a/sw/qa/core/layout/tabfrm.cxx b/sw/qa/core/layout/tabfrm.cxx
index 9357fc2df133..61b1a25109f5 100644
--- a/sw/qa/core/layout/tabfrm.cxx
+++ b/sw/qa/core/layout/tabfrm.cxx
@@ -199,6 +199,28 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyWrappedByTable)
 // i.e. the inline table was under the floating one, not on the right of 
it.
 CPPUNIT_ASSERT_LESS(nFloatingBottom, nInlineTop);
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testInlineTableThenSplitFly)
+{
+// Given a document with a floating table ("right") and an inline table 
("left"):
+// When laying out the document:
+createSwDoc("floattable-not-wrapped-by-table.docx");
+
+// Then make sure the inline table is on the left (small negative offset):
+SwDoc* pDoc = getSwDoc();
+SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout();
+auto pPage = pLayout->Lower()->DynCastPageFrame();
+CPPUNIT_ASSERT(pPage);
+SwFrame* pBody = pPage->FindBodyCont();
+auto pTab = pBody->GetLower()->GetNext()->DynCastTabFrame();
+SwTwips nInlineLeft = pTab->getFramePrintArea().Left();
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected less than: 0
+// - Actual  : 6958
+// i.e. "left" was on the right, its horizontal margin was not a small 
negative value but a
+// large positive one.
+CPPUNIT_ASSERT_LESS(static_cast(0), nInlineLeft);
+}
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 033f692f47cc..f75782456181 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -3296,6 +3296,7 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
 
 bool bShiftDown = css::text::WrapTextMode_NONE == nSurround;
 bool bSplitFly = pFly->IsFlySplitAllowed();
+const SwRect aFlyRectWithoutSpaces = pFly->GetObjRect();
 if (!bShiftDown && bAddVerticalFlyOffsets)
 {
 if (nSurround == text::WrapTextMode_PARALLEL && 
isHoriOrientShiftDown)
@@ -3310,7 +3311,6 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
 
 // Ignore spacing when determining the left/right edge of the 
fly, like
 // Word does.
-const SwRect aFlyRectWithoutSpaces = pFly->GetObjRect();
 basegfx::B1DRange 
aFlyRange(aRectFnSet.GetLeft(aFlyRectWithoutSpaces),
 
aRectFnSet.GetRight(aFlyRectWithoutSpaces));
 
@@ -3373,9 +3373,16 @@ bool SwTabFrame::CalcFlyOffsets( SwTwips& rUpper,
 bool bFlyHoriOrientLeft = text::HoriOrientation::LEFT == 
rHori.GetHoriOrient();
 if (bSplitFly && !bFlyHoriOrient

core.git: sw/qa

2024-01-24 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/ooxmlexport/ooxmllinks.cxx |   34 +++-
 1 file changed, 12 insertions(+), 22 deletions(-)

New commits:
commit 7d9e3df6d6c26508c06fff306b443356c6d499ea
Author: Miklos Vajna 
AuthorDate: Wed Jan 24 08:14:40 2024 +0100
Commit: Miklos Vajna 
CommitDate: Wed Jan 24 09:58:46 2024 +0100

CppunitTest_sw_ooxmllinks: rework to avoid DECLARE_LINKS_IMPORT_TEST

No need go via Writer-specific macros.

Change-Id: I6918fe2946a24b97bf7d79e0a4f99cf1ae85b5a3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162490
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx 
b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
index 247160636829..ccc08515644d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx
@@ -68,24 +68,6 @@
 CPPUNIT_TEST_SUITE_REGISTRATION(TestName); 
\
 void TestName::verify()
 
-// bAbsolute - decide if relative link should be converted to absolute on 
import
-#define DECLARE_LINKS_IMPORT_TEST(TestName, FileName, bAbsolute)   
\
-class TestName : public Test   
\
-{  
\
-public:
\
-CPPUNIT_TEST_SUITE(TestName);  
\
-CPPUNIT_TEST(Import);  
\
-CPPUNIT_TEST_SUITE_END();  
\
-void Import()  
\
-{  
\
-SetAbsolute(bAbsolute);
\
-executeImportTest(FileName);   
\
-}  
\
-void verify() override;
\
-}; 
\
-CPPUNIT_TEST_SUITE_REGISTRATION(TestName); 
\
-void TestName::verify()
-
 class Test : public SwModelTestBase
 {
 public:
@@ -115,8 +97,10 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeToRelativeImport)
 CPPUNIT_ASSERT(sTarget.endsWith("relative.docx"));
 }
 
-DECLARE_LINKS_IMPORT_TEST(testRelativeToAbsoluteImport, "relative-link.docx", 
USE_ABSOLUTE)
+CPPUNIT_TEST_FIXTURE(Test, testRelativeToAbsoluteImport)
 {
+SetAbsolute(USE_ABSOLUTE);
+createSwDoc("relative-link.docx");
 uno::Reference xParagraph = getParagraph(1);
 uno::Reference xText = getRun(xParagraph, 1);
 OUString sTarget = getProperty(xText, "HyperLinkURL");
@@ -124,8 +108,10 @@ DECLARE_LINKS_IMPORT_TEST(testRelativeToAbsoluteImport, 
"relative-link.docx", US
 CPPUNIT_ASSERT(sTarget.endsWith("relative.docx"));
 }
 
-DECLARE_LINKS_IMPORT_TEST(testAbsoluteToAbsoluteImport, "absolute-link.docx", 
USE_ABSOLUTE)
+CPPUNIT_TEST_FIXTURE(Test, testAbsoluteToAbsoluteImport)
 {
+SetAbsolute(USE_ABSOLUTE);
+createSwDoc("absolute-link.docx");
 uno::Reference xParagraph = getParagraph(1);
 uno::Reference xText = getRun(xParagraph, 1);
 // # should be encoded
@@ -133,8 +119,10 @@ DECLARE_LINKS_IMPORT_TEST(testAbsoluteToAbsoluteImport, 
"absolute-link.docx", US
  getProperty(xText, "HyperLinkURL"));
 }
 
-DECLARE_LINKS_IMPORT_TEST(testAbsoluteToRelativeImport, "absolute-link.docx", 
USE_RELATIVE)
+CPPUNIT_TEST_FIXTURE(Test, testAbsoluteToRelativeImport)
 {
+SetAbsolute(USE_RELATIVE);
+createSwDoc("absolute-link.docx");
 uno::Reference xParagraph = getParagraph(1);
 uno::Reference xText = getRun(xParagraph, 1);
 // when target file (B:\...) & document with link (temp dir) are placed on 
different partitions, absolute path will be loaded
@@ -142,8 +130,10 @@ DECLARE_LINKS_IMPORT_TEST(testAbsoluteToRelativeImport, 
"absolute-link.docx", US
  getProperty(xText, "HyperLinkURL"));
 }
 
-DECLARE_LINKS_IMPORT_TEST(testTdf123627_import, "tdf123627.docx", USE_RELATIVE)
+CPPUNIT_TEST_FIXTURE(Test, testTdf123627_import)
 {
+SetAbsolute(USE_RELATIVE);
+createSwDoc("tdf123627.docx");
 uno::Reference xText = getRun(getParagraph(1), 1);
 OUString sTarget = getProperty(xText, "HyperLinkURL");
 CPPUNIT_ASSERT(sTarget.startsWith("file:///"));


core.git: sc/source

2024-01-24 Thread Caolán McNamara (via logerrit)
 sc/source/core/tool/interpr1.cxx |   18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

New commits:
commit 5babeba8d9e5087ea974a3b656543fd8e5a1d93e
Author: Caolán McNamara 
AuthorDate: Tue Jan 23 17:41:11 2024 +
Commit: Caolán McNamara 
CommitDate: Wed Jan 24 09:55:04 2024 +0100

complete filename isn't meaningful in this mode

Change-Id: Icc5bdac688ca6b328dcf097c9638b4e6df211332
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162476
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index eeb4cc6b1b9e..13036fe1d55d 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -65,7 +65,7 @@
 #include 
 #include 
 #include 
-
+#include 
 #include 
 #include 
 #include 
@@ -2357,16 +2357,20 @@ void ScInterpreter::ScCell()
 eConv == FormulaGrammar::CONV_XL_OOX)
 {
 // file name and table name: 
FILEPATH/[FILENAME]TABLE
-aFuncResult = rURLObj.GetPartBeforeLastName()
-+ "[" + 
rURLObj.GetLastName(INetURLObject::DecodeMechanism::Unambiguous)
-+ "]" + aTabName;
+if (!comphelper::LibreOfficeKit::isActive())
+aFuncResult = rURLObj.GetPartBeforeLastName();
+aFuncResult += "[" + 
rURLObj.GetLastName(INetURLObject::DecodeMechanism::Unambiguous) +
+   "]" + aTabName;
 }
 else
 {
 // file name and table name: 
'FILEPATH/FILENAME'#$TABLE
-aFuncResult = "'"
-+ 
rURLObj.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous)
-+ "'#$" + aTabName;
+aFuncResult = "'";
+if (!comphelper::LibreOfficeKit::isActive())
+aFuncResult += 
rURLObj.GetMainURL(INetURLObject::DecodeMechanism::Unambiguous);
+else
+aFuncResult += 
rURLObj.GetLastName(INetURLObject::DecodeMechanism::Unambiguous);
+aFuncResult += "'#$" + aTabName;
 }
 }
 }


core.git: Branch 'libreoffice-24-2-0' - sd/source

2024-01-24 Thread Armin Le Grand (allotropia) (via logerrit)
 sd/source/ui/slideshow/slideshowimpl.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit ef96ca7f3b839f591b6258d1b3565a2bd7d5ad79
Author: Armin Le Grand (allotropia) 
AuthorDate: Thu Jan 11 14:22:32 2024 +0100
Commit: Xisco Fauli 
CommitDate: Wed Jan 24 09:50:58 2024 +0100

tdf#158664 Ignore Notifications when SlideShow is inactive

The impl SlideshowImpl gets notifications for changes from
the ObjectModel, but needs to ignore them when SlideShow
is not active/running. For discussion how to do this see
comments in task.

Change-Id: Ic251af4b82f0f4b48d8d9b0127dd2f6015966935
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161922
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 
(cherry picked from commit 2184890a0eebc55aa24cbe61de5b8918d958c65f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161932
Reviewed-by: Michael Stahl 
(cherry picked from commit f259a4636308fbdb8c5d8b9f430e3d53018f327b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161944
Reviewed-by: Michael Weghorn 
Reviewed-by: Ilmari Lauhakangas 
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx 
b/sd/source/ui/slideshow/slideshowimpl.cxx
index 1e739ab97f26..4bf43fc3bda5 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -3192,6 +3192,14 @@ void SlideshowImpl::Notify(SfxBroadcaster& /*rBC*/, 
const SfxHint& rHint)
 // better do nothing when no DrawModel (should not happen)
 return;
 
+// tdf#158664 I am surprised, but the 'this' instance keeps incarnated
+// when the slideshow was running once, so need to check for
+// SlideShow instance/running to be safe.
+// NOTE: isRunning() checks mxShow.is(), that is what we want
+if (!isRunning())
+// no SlideShow instance or not running, nothing to do
+return;
+
 const SdrHintKind eHintKind(static_cast(rHint).GetKind());
 
 if (SdrHintKind::ObjectChange == eHintKind)


core.git: Branch 'libreoffice-24-2-0' - cui/source

2024-01-24 Thread Samuel Mehrbrodt (via logerrit)
 cui/source/options/optaboutconfig.cxx |   28 
 cui/source/options/optaboutconfig.hxx |5 +++--
 2 files changed, 19 insertions(+), 14 deletions(-)

New commits:
commit 89807b69090d657bbd52dce74be4bfe024179036
Author: Samuel Mehrbrodt 
AuthorDate: Mon Jan 15 08:15:46 2024 +0100
Commit: Xisco Fauli 
CommitDate: Wed Jan 24 09:49:59 2024 +0100

tdf#159186 Use changed value when editing string-list a second time

Change-Id: I0e26a053b3b5fb04abf87894bcfebccea8bdd26f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162074
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
(cherry picked from commit 76ce6466b814bb9ff119f4f83795a2aeefc28793)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162097
Tested-by: Gabor Kelemen 
Reviewed-by: Gabor Kelemen 
(cherry picked from commit 395c8cfb770e7424fd99b884f568a32fcc7a728f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162145
Reviewed-by: Michael Stahl 
Reviewed-by: Michael Weghorn 
Reviewed-by: Ilmari Lauhakangas 
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/cui/source/options/optaboutconfig.cxx 
b/cui/source/options/optaboutconfig.cxx
index 1b02642e6d00..f927363f8650 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -70,15 +70,18 @@ struct UserData
 bool bIsReadOnly;
 bool bWasModified;
 OUString sPropertyPath;
+Any aPropertyValue;
 OUString sTooltip;
 int aLineage;
 Reference aXNameAccess;
 
-explicit UserData(OUString aPropertyPath, OUString aTooltip, bool 
isReadOnly, bool wasModified)
+explicit UserData(OUString aPropertyPath, Any aPropValue, OUString 
aTooltip, bool isReadOnly,
+  bool wasModified)
 : bIsPropertyPath(true)
 , bIsReadOnly(isReadOnly)
 , bWasModified(wasModified)
 , sPropertyPath(std::move(aPropertyPath))
+, aPropertyValue(aPropValue)
 , sTooltip(std::move(aTooltip))
 , aLineage(0)
 {
@@ -187,9 +190,10 @@ IMPL_STATIC_LINK_NOARG(CuiAboutConfigTabPage, 
ValidNameHdl, SvxNameDialog&, bool
 
 CuiAboutConfigTabPage::~CuiAboutConfigTabPage() {}
 
-void CuiAboutConfigTabPage::InsertEntry(const OUString& rPropertyPath, const 
OUString& rProp,
-const OUString& rStatus, const 
OUString& rType,
-const OUString& rValue, const 
OUString& rTooltip,
+void CuiAboutConfigTabPage::InsertEntry(const OUString& rPropertyPath, Any 
aPropertyValue,
+const OUString& rProp, const OUString& 
rStatus,
+const OUString& rType, const OUString& 
rValue,
+const OUString& rTooltip,
 const weld::TreeIter* pParentEntry, 
bool bInsertToPrefBox,
 bool bIsReadOnly, bool bWasModified)
 {
@@ -197,8 +201,8 @@ void CuiAboutConfigTabPage::InsertEntry(const OUString& 
rPropertyPath, const OUS
 if (bOnlyModified && !bWasModified)
 return;
 
-m_vectorUserData.push_back(
-std::make_unique(rPropertyPath, rTooltip, bIsReadOnly, 
bWasModified));
+m_vectorUserData.push_back(std::make_unique(rPropertyPath, 
aPropertyValue, rTooltip,
+  bIsReadOnly, 
bWasModified));
 if (bInsertToPrefBox)
 {
 OUString sId(weld::toId(m_vectorUserData.back().get()));
@@ -689,8 +693,9 @@ void CuiAboutConfigTabPage::FillItems(const 
Reference& xNameAccess,
 for (int j = 1; j < lineage; ++j)
 index = sPath.indexOf("/", index + 1);
 
-InsertEntry(sPath, sPath.copy(index + 1), item, sType, 
sValue.makeStringAndClear(),
-sTooltip, pParentEntry, !bLoadAll, bReadOnly, 
bWasModified);
+InsertEntry(sPath, aNode, sPath.copy(index + 1), item, sType,
+sValue.makeStringAndClear(), sTooltip, pParentEntry, 
!bLoadAll, bReadOnly,
+bWasModified);
 }
 }
 }
@@ -940,10 +945,8 @@ IMPL_LINK_NOARG(CuiAboutConfigTabPage, StandardHdl_Impl, 
weld::Button&, void)
 else if (sPropertyType == "string-list")
 {
 SvxListDialog aListDialog(m_xDialog.get());
-Reference xConfigAccess
-= getConfigAccess(pUserData->sPropertyPath, false);
-Any aNode = xConfigAccess->getByName(sPropertyName);
-uno::Sequence aList = 
aNode.get>();
+uno::Sequence aList
+= pUserData->aPropertyValue.get>();
 aListDialog.SetEntries(
 
comphelper::sequenceToContainer>(aList));
 aListDialog.SetMode(ListMode::String);
@@ -962,6 +965,7 @@ IMPL_LINK_NOARG(CuiAboutConfigTabPage, StandardHdl

core.git: Branch 'libreoffice-24-2-0' - sc/source

2024-01-24 Thread Matt K (via logerrit)
 sc/source/core/data/document.cxx |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 51233ec34207c8be256d8d75800fa3ca495c5ca4
Author: Matt K 
AuthorDate: Sat Jan 13 17:30:59 2024 -0600
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 09:28:47 2024 +0100

tdf#151752 Fix crash when selecting unprotected cells and copy/pasting

The problem is that the code attemps to index into maTabs when looping
through clipboard ranges, but maTabs.size() can be 0 at that point
thus resulting in a crash.  The fix is to first check if maTabs.size()
is greater than 0 before doing the looping.

Change-Id: Ib2fc4c9f847f87f44a68ad6d73c2745d79b5caa5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162032
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 59927dedc31eb5d51b417a02ae927eb578b90bd6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162090
Reviewed-by: Xisco Fauli 
(cherry picked from commit a381ac7b0fa95ce340bd1b384c946fbd19d87393)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162095
Reviewed-by: Matt K 
Reviewed-by: Ilmari Lauhakangas 
Tested-by: Michael Weghorn 
Reviewed-by: Michael Weghorn 

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 060bd85eebbc..ff6d77b432f7 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3254,12 +3254,16 @@ bool ScDocument::HasClipFilteredRows()
 if ( rClipRanges.empty() )
 return false;
 
-for ( size_t i = 0, n = rClipRanges.size(); i < n; ++i )
+if (maTabs.size() > 0)
 {
-ScRange & rRange = rClipRanges[ i ];
-bool bAnswer = maTabs[nCountTab]->HasFilteredRows(rRange.aStart.Row(), 
rRange.aEnd.Row());
-if (bAnswer)
-return true;
+for (size_t i = 0, n = rClipRanges.size(); i < n; ++i)
+{
+ScRange& rRange = rClipRanges[i];
+bool bAnswer
+= maTabs[nCountTab]->HasFilteredRows(rRange.aStart.Row(), 
rRange.aEnd.Row());
+if (bAnswer)
+return true;
+}
 }
 return false;
 }


core.git: Branch 'libreoffice-24-2-0' - sw/source

2024-01-24 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/utlui/content.cxx |   20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

New commits:
commit 553b91ef4204d0d6473f45ceadb76d6e24a08879
Author: Jim Raykowski 
AuthorDate: Fri Jan 12 23:56:43 2024 -0900
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 09:27:42 2024 +0100

tdf#159147 Fix crash when editing hyperlink while navigator is open

by assuring the SwURLFieldContent::SwTextINetFormat pointer is still
valid before trying to bring the hyperlink content to attention

Change-Id: I7f672576ab2869c5483284b543e99e46a558acc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162013
Tested-by: Jenkins
Tested-by: Xisco Fauli 
Reviewed-by: Jim Raykowski 
(cherry picked from commit b2500f0e32b33eec2740dc370238f66fb8b50ffb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162212
Reviewed-by: Xisco Fauli 
(cherry picked from commit a6ce9960c37928cb8a27383dc8e10125011131c9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162216
Reviewed-by: Hossein 
Reviewed-by: Michael Stahl 
Reviewed-by: Ilmari Lauhakangas 
Tested-by: Michael Weghorn 
Reviewed-by: Michael Weghorn 

diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 72fd76cbe1ce..3bf29979ddf3 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -6077,8 +6077,24 @@ void SwContentTree::BringEntryToAttention(const 
weld::TreeIter& rEntry)
 }
 else if (nType == ContentTypeId::URLFIELD)
 {
-BringURLFieldsToAttention(SwGetINetAttrs 
{SwGetINetAttr(pCnt->GetName(),
-
*static_cast(pCnt)->GetINetAttr())});
+// tdf#159147 - Assure the SwURLFieldContent::SwTextINetFormat 
pointer is valid
+// before bringing to attention.
+const SwTextINetFormat* pTextINetFormat
+= static_cast(pCnt)->GetINetAttr();
+const SwCharFormats* pFormats = 
m_pActiveShell->GetDoc()->GetCharFormats();
+for (auto n = pFormats->size(); 1 < n;)
+{
+SwIterator 
aIter(*(*pFormats)[--n]);
+for (SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = 
aIter.Next() )
+{
+if (pTextINetFormat == pFnd)
+{
+BringURLFieldsToAttention(SwGetINetAttrs 
{SwGetINetAttr(pCnt->GetName(),
+  
*pTextINetFormat)});
+break;
+}
+}
+}
 }
 else if (nType == ContentTypeId::REFERENCE)
 {


core.git: svl/source

2024-01-24 Thread Caolán McNamara (via logerrit)
 svl/source/items/itemset.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit b840110ffc1c30ba9dd242efd6692d5ae16bbda3
Author: Caolán McNamara 
AuthorDate: Tue Jan 23 21:07:07 2024 +
Commit: Noel Grandin 
CommitDate: Wed Jan 24 09:27:42 2024 +0100

add #include unordered_map

Change-Id: Ieaba8db5df426ed30aca7366a86ee4fb11e03a44
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162480
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 5eec0a7a9391..df46011dc2d9 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -23,6 +23,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 


core.git: Branch 'libreoffice-24-2-0' - sw/qa sw/source

2024-01-24 Thread Mike Kaganski (via logerrit)
 sw/qa/extras/layout/data/fld-in-tbl.docx |binary
 sw/qa/extras/layout/layout3.cxx  |   21 +
 sw/source/core/text/guess.cxx|   14 --
 3 files changed, 29 insertions(+), 6 deletions(-)

New commits:
commit 53c9b06f7bda62efb97bb383ac0002234e4aa5e8
Author: Mike Kaganski 
AuthorDate: Fri Jan 19 11:07:58 2024 +0600
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 09:25:22 2024 +0100

tdf#159271: do not try to put fields' spaces to hole portions

Change-Id: Ic1b3f9602089cc773f9c3adc0be09a3be08d690f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162269
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162293
Reviewed-by: Xisco Fauli 
(cherry picked from commit 8cbf48ac9d3e0d5c420e45b59bf761f51ad395fe)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162281
Reviewed-by: Michael Stahl 
Reviewed-by: Ilmari Lauhakangas 
Tested-by: Michael Weghorn 
Reviewed-by: Michael Weghorn 

diff --git a/sw/qa/extras/layout/data/fld-in-tbl.docx 
b/sw/qa/extras/layout/data/fld-in-tbl.docx
new file mode 100644
index ..95d1b8adae38
Binary files /dev/null and b/sw/qa/extras/layout/data/fld-in-tbl.docx differ
diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx
index 9a1d9b2fb7c5..aecea0148da9 100644
--- a/sw/qa/extras/layout/layout3.cxx
+++ b/sw/qa/extras/layout/layout3.cxx
@@ -2232,6 +2232,27 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159050)
 u"PortionType::Margin"_ustr);
 }
 
+CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf159271)
+{
+// Given a document with a field with several spaces in a field content
+createSwDoc("fld-in-tbl.docx");
+xmlDocUniquePtr pXmlDoc = parseLayoutDump();
+// Make sure there is only one page, one table with one row and two cells, 
and one paragraph
+assertXPath(pXmlDoc, "/root/page"_ostr, 1);
+assertXPath(pXmlDoc, "/root/page/body/tab"_ostr, 1);
+assertXPath(pXmlDoc, "/root/page/body/tab/row"_ostr, 1);
+assertXPath(pXmlDoc, "/root/page/body/tab/row/cell"_ostr, 2);
+assertXPath(pXmlDoc, "/root/page/body/txt"_ostr, 1);
+assertXPath(pXmlDoc, 
"/root/page/body/tab/row/cell[2]/txt/SwParaPortion"_ostr, 1);
+
+// Without the fix, this would fail:
+// - Expected: 1
+// - Actual  : 16
+// - In <>, XPath '/root/page/body/tab/row/cell[2]/txt//SwLineLayout' 
number of nodes is incorrect
+assertXPath(pXmlDoc, 
"/root/page/body/tab/row/cell[2]/txt//SwLineLayout"_ostr, 1);
+assertXPath(pXmlDoc, 
"/root/page/body/tab/row/cell[2]/txt//SwFieldPortion"_ostr, 1);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 3c85a42f4f15..3346fe345acc 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -253,9 +253,10 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, 
SwTextFormatInfo &rInf,
 {
 // portion fits to line
 m_nCutPos = rInf.GetIdx() + nMaxLen;
-bool bRet = maybeAdjustPositionsForBlockAdjust(m_nCutPos, 
m_nBreakPos, m_nBreakStart,
-   m_nBreakWidth, 
m_nExtraBlankWidth,
-   nMaxSizeDiff, rInf, 
rSI, nMaxComp);
+bool bRet = rPor.InFieldGrp()
+|| maybeAdjustPositionsForBlockAdjust(m_nCutPos, 
m_nBreakPos, m_nBreakStart,
+  m_nBreakWidth, 
m_nExtraBlankWidth,
+  nMaxSizeDiff, 
rInf, rSI, nMaxComp);
 if( nItalic &&
 (m_nCutPos >= TextFrameIndex(rInf.GetText().getLength()) ||
   // #i48035# Needed for CalcFitToContent
@@ -408,9 +409,10 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, 
SwTextFormatInfo &rInf,
 // there likely has been a pixel rounding error in GetTextBreak
 if ( m_nBreakWidth <= nLineWidth )
 {
-bool bRet = maybeAdjustPositionsForBlockAdjust(m_nCutPos, 
m_nBreakPos, m_nBreakStart,
-   m_nBreakWidth, 
m_nExtraBlankWidth,
-   nMaxSizeDiff, rInf, 
rSI, nMaxComp);
+bool bRet = rPor.InFieldGrp()
+|| maybeAdjustPositionsForBlockAdjust(m_nCutPos, 
m_nBreakPos, m_nBreakStart,
+  m_nBreakWidth, 
m_nExtraBlankWidth,
+  nMaxSizeDiff, 
rInf, rSI, nMaxComp);
 
 if (nItalic && (m_nBreakPos + TextFrameIndex(1)) >= 
TextFrameIndex(rInf.GetText().getLength()))
 m_nBreakWidth += nItalic;


core.git: Branch 'libreoffice-24-2-0' - editeng/source

2024-01-24 Thread Mike Kaganski (via logerrit)
 editeng/source/misc/acorrcfg.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 81b59e7d7eb35fd0e707a04ef926a97ae9be86df
Author: Mike Kaganski 
AuthorDate: Mon Jan 22 12:08:56 2024 +0600
Commit: Michael Weghorn 
CommitDate: Wed Jan 24 09:21:48 2024 +0100

tdf#159313: pass properties in correct order

Regression after commit c4fc18308074634e9578ad12d94d937f259aa22a
(Autocorrect: Add option for autoformat bulleted lists after space,
2023-09-07).

Change-Id: I35fafc1441b4f67886a86d4d67764a91146b8ece
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162359
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit ca33b8b35a10243dc13e68c93e7c7512eef937ec)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162289
Reviewed-by: Michael Stahl 
Tested-by: Xisco Fauli 
(cherry picked from commit 480e15fa4f641ed5d312d4399fa0c5d37e9c10f3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162383
Reviewed-by: Xisco Fauli 
Reviewed-by: Ilmari Lauhakangas 
Tested-by: Michael Weghorn 
Reviewed-by: Michael Weghorn 

diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx
index fcafbfca6f0c..616d75c69600 100644
--- a/editeng/source/misc/acorrcfg.cxx
+++ b/editeng/source/misc/acorrcfg.cxx
@@ -645,7 +645,6 @@ void SvxSwAutoCorrCfg::ImplCommit()
  css::uno::Any(rParent.bAutoFmtByInput), // "Format/ByInput/Enable"
  css::uno::Any(rSwFlags.bChgToEnEmDash), // "Format/ByInput/ChangeDash"
  css::uno::Any(rSwFlags.bSetNumRule),
- css::uno::Any(rSwFlags.bSetNumRuleAfterSpace),
 // "Format/ByInput/ApplyNumbering/Enable"
  css::uno::Any(rSwFlags.bSetBorder), // 
"Format/ByInput/ChangeToBorders"
  css::uno::Any(rSwFlags.bCreateTable), // 
"Format/ByInput/ChangeToTable"
@@ -679,7 +678,9 @@ void SvxSwAutoCorrCfg::ImplCommit()
 // "Format/ByInput/ApplyNumbering/SpecialCharacter/FontCharset"
  css::uno::Any(sal_Int32(rSwFlags.aByInputBulletFont.GetPitch())),
 // "Format/ByInput/ApplyNumbering/SpecialCharacter/FontPitch"
- css::uno::Any(rSwFlags.bSetDOIAttr)});
+ css::uno::Any(rSwFlags.bSetDOIAttr),
+ css::uno::Any(rSwFlags.bSetNumRuleAfterSpace), // 
"Format/ByInput/ApplyNumberingAfterSpace"
+});
 // "Format/Option/SetDOIAttribute"
 }
 


core.git: Branch 'libreoffice-7-6' - include/test sw/qa writerfilter/source

2024-01-24 Thread Justin Luth (via logerrit)
 include/test/unoapi_test.hxx |5 ++
 sw/qa/extras/ooxmlexport/data/tdf159207_footerFramePrBorder.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport21.cxx   |   18 
++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx|4 ++
 4 files changed, 27 insertions(+)

New commits:
commit 4d3e10fe4503810f17c60443b84a300a543a44b6
Author: Justin Luth 
AuthorDate: Sat Jan 20 19:54:54 2024 -0500
Commit: Miklos Vajna 
CommitDate: Wed Jan 24 09:16:42 2024 +0100

tdf#159207 writerfilter framePr: avoid unexpected frame borders

This backport includes some extra code to simplify
future unit test backports: loadFromFile -> loadFromURL

This fixes my regressive 7.6 commit
31ea6305b6a763ee48f639562313d9bd109a2923

The text's first border checked (the left one) returned void
because the property SetState was DONTCARE.
Then it SETS the text's left border to be nothing
(I presume to remove the border from the paragraph since
it is moving it onto frame).
Well, apparently that act of setting one border sets all of them
(which makes sense since it would be one box item,
and once the box item exists, it has a definition for each border).

Therefore on the the next steps of the for loop,
the remaining borders will exist (as nothing)
and be dutifully moved to the frame.

Apparently the default for a frame is a box with DEFINED borders,
so omitting the moving of a nothing border resulted in a stray edge.

make CppunitTest_sw_ooxmlexport21 \
CPPUNIT_TEST_NAME=testTdf159207_footerFramePrBorder

Change-Id: I217d02678b368f70643be91c4466927b4ca53988
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162409
Tested-by: Jenkins
Reviewed-by: Justin Luth 
(cherry picked from commit f43efd5473862edbdad0feb7f78c7be02914e997)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162375
Reviewed-by: Michael Stahl 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162443
Tested-by: Justin Luth 
Reviewed-by: Miklos Vajna 

diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index 4ba209c44d39..bd6a2082eb6f 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -39,6 +39,11 @@ public:
 void loadWithParams(const OUString& rURL,
 const css::uno::Sequence& 
rParams);
 OUString loadFromURL(std::u16string_view aFileBase, const char* pPassword 
= nullptr);
+OUString loadFromFile(std::u16string_view aFileBase, const char* pPassword 
= nullptr)
+{
+//simplify backports
+return loadFromURL(aFileBase, pPassword);
+}
 
 css::uno::Any executeMacro(const OUString& rScriptURL,
const css::uno::Sequence& 
rParams = {});
diff --git a/sw/qa/extras/ooxmlexport/data/tdf159207_footerFramePrBorder.docx 
b/sw/qa/extras/ooxmlexport/data/tdf159207_footerFramePrBorder.docx
new file mode 100644
index ..7a4c54cc5c75
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf159207_footerFramePrBorder.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
index 9f6de0d155d5..a6df0bff9300 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx
@@ -44,6 +44,24 @@ DECLARE_OOXMLEXPORT_TEST(testTdf153909_followTextFlow, 
"tdf153909_followTextFlow
 CPPUNIT_ASSERT(nTableTop > nRectBottom);
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf159207_footerFramePrBorder)
+{
+loadFromFile(u"tdf159207_footerFramePrBorder.docx"); // re-imports as 
editeng Frame/Shape
+
+// given a doc with footer paragraphs frame (with a top border, but no 
left border)
+uno::Reference xTextFramesSupplier(mxComponent, 
uno::UNO_QUERY);
+uno::Reference 
xIndexAccess(xTextFramesSupplier->getTextFrames(),
+ uno::UNO_QUERY);
+uno::Reference xFrame0(xIndexAccess->getByIndex(0), 
uno::UNO_QUERY);
+auto aBorder = getProperty(xFrame0, "LeftBorder");
+sal_uInt32 nBorderWidth
+= aBorder.OuterLineWidth + aBorder.InnerLineWidth + 
aBorder.LineDistance;
+// Without patch it failed with Expected 0, Actual 26
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Left border:", static_cast(0), 
nBorderWidth);
+
+// TODO: there SHOULD BE a top border, and even if loaded, it would be 
lost on re-import...
+}
+
 } // end of anonymous namespace
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx 
b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index d6775189d8cb..d4da6625be61 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1694,7 +1694,11 @@ static void 
lcl_MoveBorderPropertiesToFrame(std::vector& r
 aValue.Name = sProper

core.git: cui/source include/sfx2 include/svx include/vcl sfx2/sdi sfx2/source solenv/clang-format

2024-01-24 Thread Balazs Varga (via logerrit)
 cui/source/factory/dlgfact.cxx |   11 +
 cui/source/factory/dlgfact.hxx |8 ++
 cui/source/inc/securityoptions.hxx |1 
 cui/source/options/optinet2.cxx|   39 ++---
 cui/source/options/securityoptions.cxx |   31 +-
 include/sfx2/sfxdlg.hxx|2 +
 include/sfx2/sfxsids.hrc   |1 
 include/svx/svxdlg.hxx |2 +
 include/vcl/abstdlg.hxx|8 ++
 sfx2/sdi/appslots.sdi  |4 +++
 sfx2/sdi/sfx.sdi   |   17 ++
 sfx2/source/appl/appserv.cxx   |   14 +++
 sfx2/source/view/viewfrm.cxx   |3 --
 solenv/clang-format/excludelist|2 -
 14 files changed, 103 insertions(+), 40 deletions(-)

New commits:
commit 2c16ea16b305dc546164e28cf6b212ebccc44ec4
Author: Balazs Varga 
AuthorDate: Mon Jan 22 13:19:26 2024 +0100
Commit: Balazs Varga 
CommitDate: Wed Jan 24 09:06:39 2024 +0100

tdf#159128 UI: Open Security settings option directly

Open Security Option Setting page directly from Security pop up
warning infobar.

Follow up of 1f440348eb0892fd2c9597806d87b5fe9d60d49a
(tdf#157482 UI: Turn Security Warnings popup windows into infobars)

Change-Id: Iac116677801bdb13a9680bcfdf532ec3d874ce0e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162393
Tested-by: Jenkins
Reviewed-by: Balazs Varga 

diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index b5e852cbb292..6979167de569 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -116,6 +116,7 @@ IMPL_ABSTDLG_CLASS(AbstractScreenshotAnnotationDlg)
 IMPL_ABSTDLG_CLASS_ASYNC(AbstractSignatureLineDialog, SignatureLineDialog)
 IMPL_ABSTDLG_CLASS_ASYNC(AbstractSignSignatureLineDialog, 
SignSignatureLineDialog)
 IMPL_ABSTDLG_CLASS_ASYNC(AbstractSvxCharacterMapDialog, SvxCharacterMap)
+IMPL_ABSTDLG_CLASS(AbstractSecurityOptionsDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxHpLinkDlg)
 IMPL_ABSTDLG_CLASS(AbstractSvxJSearchOptionsDialog)
 IMPL_ABSTDLG_CLASS(AbstractSvxMultiPathDialog)
@@ -874,6 +875,16 @@ VclPtr 
AbstractDialogFactory_Impl::CreateFrameDialog(weld::Wi
 return nullptr;
 }
 
+VclPtr 
AbstractDialogFactory_Impl::CreateSvxSecurityOptionsDialog(weld::Window* 
pParent)
+{
+return 
VclPtr::Create(std::make_unique(pParent));
+}
+
+bool AbstractSecurityOptionsDialog_Impl::SetSecurityOptions()
+{
+return m_xDlg->SetSecurityOptions();
+}
+
 // TabDialog outside the drawing layer
 VclPtr 
AbstractDialogFactory_Impl::CreateAutoCorrTabDialog(weld::Window* pParent, 
const SfxItemSet* pAttrSet)
 {
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 0125c975ae79..3c8601140164 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -49,6 +49,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -402,6 +403,11 @@ 
DECL_ABSTDLG_CLASS_SHARED_ASYNC(AbstractSvxCharacterMapDialog,SfxAbstractDialog,
 DECL_ABSTDLG_CLASS(AbstractScreenshotAnnotationDlg,ScreenshotAnnotationDlg)
 };
 
+// AbstractSecurityOptionsDialog_Impl
+DECL_ABSTDLG_CLASS(AbstractSecurityOptionsDialog, svx::SecurityOptionsDialog)
+virtual bool SetSecurityOptions() override;
+};
+
 // AbstractSignatureLineDialog_Impl
 DECL_ABSTDLG_CLASS_ASYNC(AbstractSignatureLineDialog,SignatureLineDialog)
 virtual void Apply() override { m_xDlg->Apply(); }
@@ -594,6 +600,8 @@ public:
 
 virtual VclPtr 
CreateScreenshotAnnotationDlg(weld::Dialog& rParentDialog) override;
 
+virtual VclPtr 
CreateSvxSecurityOptionsDialog(weld::Window* pParent) override;
+
 virtual VclPtr
 CreateSignatureLineDialog(weld::Window* pParent,
   const css::uno::Reference 
xModel, bool bEditExisting) override;
diff --git a/cui/source/options/securityoptions.hxx 
b/cui/source/inc/securityoptions.hxx
similarity index 99%
rename from cui/source/options/securityoptions.hxx
rename to cui/source/inc/securityoptions.hxx
index 10534d4426a7..981c9ac29bf8 100644
--- a/cui/source/options/securityoptions.hxx
+++ b/cui/source/inc/securityoptions.hxx
@@ -75,6 +75,7 @@ namespace svx
 
 DECL_LINK(ShowPersonalInfosToggle, weld::Toggleable&, void);
 
+bool SetSecurityOptions();
 void changeKeepSecurityInfosEnabled();
 };
 }
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index de34b031e8ce..eaf0e8616bfd 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -27,7 +27,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -52,7 +51,7 @@
 #include 
 #include 
 #include 
-#include "securityoptions.hxx"
+#include 
 #include "webconninfo.hxx"
 #include "certpath.hxx"
 #include "tsaurls.hxx"
@@ -834,25 +833,6 @@ DeactivateRC SvxSecurityTabPage::DeactivatePage( 
SfxItemSet* _pS