[Libreoffice-commits] mso-dumper.git: msodumper/wmfrecord.py

2021-09-28 Thread Libreoffice Gerrit user
 msodumper/wmfrecord.py |   21 -
 1 file changed, 16 insertions(+), 5 deletions(-)

New commits:
commit 7bcbe575ce88e4daa6f6335d0b78acc58917cb3e
Author: Hossein 
AuthorDate: Tue Sep 28 09:27:19 2021 +0200
Commit: Hossein 
CommitDate: Tue Sep 28 09:29:10 2021 +0200

Added dump() for META_POLYLINE record in wmf-dump

Added dump() for the META_POLYLINE (PolyLine) record in wmf-dump.py

Change-Id: Ie15f208ee46664cfcc915520d6416b1f3beb8421
Reviewed-on: https://gerrit.libreoffice.org/c/mso-dumper/+/122731
Tested-by: Hossein 
Reviewed-by: Hossein 

diff --git a/msodumper/wmfrecord.py b/msodumper/wmfrecord.py
index 272ba79..dc1ecdb 100644
--- a/msodumper/wmfrecord.py
+++ b/msodumper/wmfrecord.py
@@ -1103,13 +1103,24 @@ class Polygon(WMFRecord):
 assert self.pos == dataPos + self.RecordSize * 2
 
 
-class Polyline(WMFRecord):
-def __init__(self, parent):
+class PolyLine(WMFRecord):
+def __init__(self, parent, name=None):
 WMFRecord.__init__(self, parent)
+if name:
+self.name = name
+else:
+self.name = "polyline"
 
 def dump(self):
-print("")
-pass
+dataPos = self.pos
+print('<%s type="PolyLine">' % self.name)
+self.printAndSet("RecordSize", self.readuInt32(), hexdump=False)
+self.printAndSet("RecordFunction", self.readuInt16(), hexdump=True)
+self.printAndSet("NumberOfPoints", self.readInt16(), hexdump=False)
+for i in range(self.NumberOfPoints):
+PointS(self, "aPoint%d" % i).dump()
+print('' % self.name)
+assert self.pos == dataPos + self.RecordSize * 2
 
 
 class SetTextJustification(WMFRecord):
@@ -1824,7 +1835,7 @@ RecordType = {
 0x0231: ['META_SETMAPPERFLAGS', SetMapperFlags],
 0x0234: ['META_SELECTPALETTE', SelectPalette],
 0x0324: ['META_POLYGON', Polygon],
-0x0325: ['META_POLYLINE', Polyline],
+0x0325: ['META_POLYLINE', PolyLine],
 0x020A: ['META_SETTEXTJUSTIFICATION', SetTextJustification],
 0x020B: ['META_SETWINDOWORG', SetWindowOrg],
 0x020C: ['META_SETWINDOWEXT', SetWindowExt],


[Libreoffice-commits] mso-dumper.git: msodumper/wmfrecord.py

2021-09-28 Thread Libreoffice Gerrit user
 msodumper/wmfrecord.py |   40 
 1 file changed, 24 insertions(+), 16 deletions(-)

New commits:
commit 5b01cfd6971e8822b8d52e0ba3bad2134a9e5aa9
Author: Hossein 
AuthorDate: Tue Sep 28 09:42:03 2021 +0200
Commit: Hossein 
CommitDate: Tue Sep 28 09:50:54 2021 +0200

Added dump() for 2 wmf records in wmf-dump

Added dump() for 2 wmf records to wmf-dump.py

List of records:

1. SaveDC (META_SAVEDC)
2. RestoreDC (META_RESTOREDC)

Change-Id: I12007c40d385b3b3ca25876428f37e01e241757d
Reviewed-on: https://gerrit.libreoffice.org/c/mso-dumper/+/122754
Tested-by: Hossein 
Reviewed-by: Hossein 

diff --git a/msodumper/wmfrecord.py b/msodumper/wmfrecord.py
index dc1ecdb..6065163 100644
--- a/msodumper/wmfrecord.py
+++ b/msodumper/wmfrecord.py
@@ -953,13 +953,22 @@ class SetTextCharacterExtra(WMFRecord):
 pass
 
 
-class RestoreDC:
-def __init__(self, parent):
+class RestoreDC(WMFRecord):
+def __init__(self, parent, name=None):
 WMFRecord.__init__(self, parent)
+if name:
+self.name = name
+else:
+self.name = "restoredc"
 
 def dump(self):
-print("")
-pass
+dataPos = self.pos
+print('<%s type="RestoreDC">' % self.name)
+self.printAndSet("RecordSize", self.readuInt32(), hexdump=False)
+self.printAndSet("RecordFunction", self.readuInt16(), hexdump=True)
+self.printAndSet("nSavedDC", self.readInt16(), hexdump=False)
+# RecordSize is described in words, so we should double for bytes
+assert self.pos == dataPos + self.RecordSize * 2
 
 
 class ResizePalette(WMFRecord):
@@ -1423,21 +1432,20 @@ class RoundRect(WMFRecord):
 
 
 class SaveDC(WMFRecord):
-def __init__(self, parent):
-WMFRecord.__init__(self, parent)
-
-def dump(self):
-print("")
-pass
-
-
-class SaveDC(WMFRecord):
-def __init__(self, parent):
+def __init__(self, parent, name=None):
 WMFRecord.__init__(self, parent)
+if name:
+self.name = name
+else:
+self.name = "savedc"
 
 def dump(self):
-print("")
-pass
+dataPos = self.pos
+print('<%s type="SaveDC">' % self.name)
+self.printAndSet("RecordSize", self.readuInt32(), hexdump=False)
+self.printAndSet("RecordFunction", self.readuInt16(), hexdump=True)
+# RecordSize is described in words, so we should double for bytes
+assert self.pos == dataPos + self.RecordSize * 2
 
 
 class Pie(WMFRecord):


[Libreoffice-commits] core.git: include/xmloff schema/libreoffice sw/qa xmloff/source

2021-09-28 Thread Miklos Vajna (via logerrit)
 include/xmloff/xmlstyle.hxx |2 +
 include/xmloff/xmltoken.hxx |2 +
 schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng |9 
 sw/qa/extras/odfexport/data/style-link.fodt |   15 +++
 sw/qa/extras/odfexport/odfexport2.cxx   |   21 ++
 xmloff/source/core/xmltoken.cxx |2 +
 xmloff/source/style/prstylei.cxx|   24 
 xmloff/source/style/styleexp.cxx|   13 ++
 xmloff/source/style/xmlstyle.cxx|3 +
 xmloff/source/token/tokens.txt  |1 
 10 files changed, 92 insertions(+)

New commits:
commit 05f863844d9a5613250e8d787e32752b270ec4d3
Author: Miklos Vajna 
AuthorDate: Tue Sep 28 09:37:10 2021 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 28 10:27:20 2021 +0200

sw: paragraph styles: add ODT filter for a linked character style

And the same in the other direction: link a para style from a char
style.

With this, the ODT filter is on par with the DOCX one for this feature.

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

diff --git a/include/xmloff/xmlstyle.hxx b/include/xmloff/xmlstyle.hxx
index 184fd19eb379..04a74b841a15 100644
--- a/include/xmloff/xmlstyle.hxx
+++ b/include/xmloff/xmlstyle.hxx
@@ -44,6 +44,7 @@ class XMLOFF_DLLPUBLIC SvXMLStyleContext : public 
SvXMLImportContext
 OUString maAutoName;
 OUString maParentName;// Will be moved to XMLPropStyle soon
 OUString maFollow;// Will be moved to XMLPropStyle soon
+OUString maLinked;
 bool mbHidden;
 
 XmlStyleFamily mnFamily;
@@ -79,6 +80,7 @@ public:
 const OUString&  GetAutoName() const { return maAutoName; }
 const OUString&  GetParentName() const { return maParentName; }
 const OUString&  GetFollow() const { return maFollow; }
+const OUString&  GetLinked() const { return maLinked; }
 
 XmlStyleFamily GetFamily() const { return mnFamily; }
 
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index e4b2314527f0..c8dedd84b4b2 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -3437,6 +3437,8 @@ namespace xmloff::token {
 XML_RTL,
 XML_SYMMETRIC,
 
+XML_LINKED_STYLE_NAME,
+
 XML_TOKEN_END
 };
 
diff --git a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng 
b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
index a0f8711d092b..0c467fdc3780 100644
--- a/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
+++ b/schema/libreoffice/OpenDocument-v1.3+libreoffice-schema.rng
@@ -2731,4 +2731,13 @@ 
xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.
 
   
 
+  
+  
+
+  
+
+  
+
+  
+
 
diff --git a/sw/qa/extras/odfexport/data/style-link.fodt 
b/sw/qa/extras/odfexport/data/style-link.fodt
new file mode 100644
index ..76c36c698845
--- /dev/null
+++ b/sw/qa/extras/odfexport/data/style-link.fodt
@@ -0,0 +1,15 @@
+
+
+  
+
+
+  
+  
+
+  
+  
+
+  
+
+  
+
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx 
b/sw/qa/extras/odfexport/odfexport2.cxx
index bb05521f08fc..c73dc611db04 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -184,6 +184,27 @@ DECLARE_ODFEXPORT_TEST(testListFormatOdt, "listformat.odt")
 }
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testStyleLink)
+{
+// Given a document with a para and a char style that links each other, 
when loading that
+// document:
+load(mpTestDocumentPath, "style-link.fodt");
+
+// Then make sure the char style links the para one:
+uno::Any aCharStyle = getStyles("CharacterStyles")->getByName("List 
Paragraph Char");
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: List Paragraph
+// - Actual  :
+// i.e. the linked style was lost on import.
+CPPUNIT_ASSERT_EQUAL(OUString("List Paragraph"), 
getProperty(aCharStyle, "LinkStyle"));
+uno::Any aParaStyle = getStyles("ParagraphStyles")->getByName("List 
Paragraph");
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: List Paragraph Char
+// - Actual  :
+// i.e. the linked style was lost on import.
+CPPUNIT_ASSERT_EQUAL(OUString("List Paragraph Char"), 
getProperty(aParaStyle, "LinkStyle"));
+}
+
 // This test started in LO 7.2. Use the odfexport.cxx if you intend to 
backport to 7.1.
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 1e682a39fcb1..52ecd9038cbb 100644
--- a/xmloff/source/core/xmltoken

[Libreoffice-commits] core.git: svl/source

2021-09-28 Thread Roman Kuznetsov (via logerrit)
 svl/source/misc/gridprinter.cxx |   16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

New commits:
commit aeb056fb2feab4dfc5a5c4928b54fa21756d824b
Author: Roman Kuznetsov 
AuthorDate: Mon Sep 27 18:29:59 2021 +0200
Commit: Roman Kuznetsov 
CommitDate: Tue Sep 28 10:43:14 2021 +0200

drop 'using namespace std' here

Change-Id: Ifbbd6e985fb66893dc872522ed5418453ca8e2d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122651
Tested-by: Jenkins
Reviewed-by: Roman Kuznetsov 

diff --git a/svl/source/misc/gridprinter.cxx b/svl/source/misc/gridprinter.cxx
index ae910e4f0cf7..070ed08b3eb9 100644
--- a/svl/source/misc/gridprinter.cxx
+++ b/svl/source/misc/gridprinter.cxx
@@ -17,8 +17,6 @@
 
 #include 
 
-using namespace std;
-
 namespace svl {
 
 // String ID
@@ -79,10 +77,10 @@ void GridPrinter::print( const char* pHeader ) const
 return;
 
 if (pHeader)
-cout << pHeader << endl;
+std::cout << pHeader << std::endl;
 
 MatrixImplType::size_pair_type ns = mpImpl->maMatrix.size();
-vector aColWidths(ns.column, 0);
+std::vector aColWidths(ns.column, 0);
 
 // Calculate column widths first.
 for (size_t row = 0; row < ns.row; ++row)
@@ -109,10 +107,10 @@ void GridPrinter::print( const char* pHeader ) const
 OUString aSep = aBuf.makeStringAndClear();
 
 // Now print to stdout.
-cout << aSep << endl;
+std::cout << aSep << std::endl;
 for (size_t row = 0; row < ns.row; ++row)
 {
-cout << "| ";
+std::cout << "| ";
 for (size_t col = 0; col < ns.column; ++col)
 {
 OUString aStr = mpImpl->maMatrix.get_string(row, col);
@@ -120,10 +118,10 @@ void GridPrinter::print( const char* pHeader ) const
 aBuf.append(aStr);
 for (size_t i = 0; i < nPadding; ++i)
 aBuf.append(u' ');
-cout << aBuf.makeStringAndClear() << " | ";
+std::cout << aBuf.makeStringAndClear() << " | ";
 }
-cout << endl;
-cout << aSep << endl;
+std::cout << std::endl;
+std::cout << aSep << std::endl;
 }
 }
 


[Libreoffice-commits] core.git: 2 commits - cppuhelper/Library_cppuhelper.mk cppuhelper/source solenv/bin

2021-09-28 Thread Tor Lillqvist (via logerrit)
 cppuhelper/Library_cppuhelper.mk |6 ++
 cppuhelper/source/shlib.cxx  |   12 
 solenv/bin/native-code.py|9 +
 3 files changed, 27 insertions(+)

New commits:
commit e37c97bc1d698c94ed6736dbe4642a784e79eeff
Author: Tor Lillqvist 
AuthorDate: Mon Sep 27 18:47:15 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Sep 28 10:59:20 2021 +0200

Warn harder about unknown constructors and factories on iOS in Xcode

Use NSLog() and not just SAL_WARN(). There are so many irrelevant
SAL_WARN() warnings displayed that these ones that can be extremely
relevant are easily missed. I typically run the app in Xcode with
SAL_LOG=-WARN.

(Such warnings are typically caused by something missing from the
solenv/bin/native-code.py.)

Change-Id: I4ab16f4f652ac34319021c9427e2e9f911ee29e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122721
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122756
Tested-by: Jenkins

diff --git a/cppuhelper/Library_cppuhelper.mk b/cppuhelper/Library_cppuhelper.mk
index 5e131cb6c43e..e9caf2dfd6d6 100644
--- a/cppuhelper/Library_cppuhelper.mk
+++ b/cppuhelper/Library_cppuhelper.mk
@@ -39,6 +39,12 @@ $(eval $(call gb_Library_use_static_libraries,cppuhelper,\
findsofficepath \
 ))
 
+ifeq ($(OS),iOS)
+$(eval $(call gb_Library_add_cxxflags,cppuhelper,\
+$(gb_OBJCXXFLAGS) \
+))
+endif
+
 $(eval $(call gb_Library_add_exception_objects,cppuhelper,\
cppuhelper/source/access_control \
cppuhelper/source/bootstrap \
diff --git a/cppuhelper/source/shlib.cxx b/cppuhelper/source/shlib.cxx
index b0a938a4abac..41af3dd80ebc 100644
--- a/cppuhelper/source/shlib.cxx
+++ b/cppuhelper/source/shlib.cxx
@@ -23,6 +23,12 @@
 #include 
 #include 
 
+#ifdef IOS
+#include 
+#include 
+#include 
+#endif
+
 #include 
 #include 
 #include 
@@ -267,6 +273,9 @@ void cppuhelper::detail::loadSharedLibComponentFactory(
 }
 if (fp == 0) {
 SAL_WARN("cppuhelper", "unknown factory name \"" << uri << "\"");
+#ifdef IOS
+NSLog(@"Unknown factory %s", uri.toUtf8().getStr());
+#endif
 throw css::loader::CannotActivateFactoryException(
 "unknown factory name \"" + uri + "\"",
 css::uno::Reference());
@@ -287,6 +296,9 @@ void cppuhelper::detail::loadSharedLibComponentFactory(
 }
 }
 SAL_WARN("cppuhelper", "unknown constructor name \"" << constructor << 
"\"");
+#ifdef IOS
+NSLog(@"Unknown constructor %s", constructor.toUtf8().getStr());
+#endif
 throw css::loader::CannotActivateFactoryException(
 "unknown constructor name \"" + constructor + "\"",
 css::uno::Reference());
commit 10e809e1393d65f8864b6b7a5176f0b60cc1ec8c
Author: Tor Lillqvist 
AuthorDate: Mon Sep 27 18:23:39 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Tue Sep 28 10:59:05 2021 +0200

More constructors needed for the DISABLE_DYNLOADING case

Fixes https://github.com/CollaboraOnline/online/issues/3293.

Change-Id: I3c0eaedf47321f0e81be4ac52c66f8e55381ac32
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122720
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122755

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 8efa9c19936c..9e035ddc1b87 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -90,6 +90,7 @@ core_constructor_list = [
 "com_sun_star_comp_chart2_ChartDocumentWrapper_get_implementation",
 "com_sun_star_comp_chart2_ChartFrameLoader_get_implementation",
 "com_sun_star_comp_chart2_WizardDialog_get_implementation",
+"org_libreoffice_chart2_Chart2ToolboxController",
 "org_libreoffice_comp_chart2_sidebar_ChartPanelFactory",
 # comphelper/util/comphelp.component
 "com_sun_star_comp_MemoryStream",
@@ -371,8 +372,12 @@ core_constructor_list = [
 # svgio/svgio.component
 "svgio_XSvgParser_get_implementation",
 # svx/util/svx.component
+"com_sun_star_comp_svx_CharacterSpacingToolBoxControl_get_implementation",
+"com_sun_star_comp_svx_CTLToolBoxControl_get_implementation",
+"com_sun_star_comp_svx_LineSpacingToolBoxControl_get_implementation",
 "com_sun_star_comp_svx_NumberingToolBoxControl_get_implementation",
 "com_sun_star_comp_svx_SmartTagMenuController_get_implementation",
+"com_sun_star_comp_svx_UnderlineToolBoxControl_get_implementation",
 "com_sun_star_drawing_EnhancedCustomShapeEngine_get_implementation",
 "com_sun_star_drawing_SvxShapeCollection_get_implementation",
 "com_sun_star_svx_FontHeightToolBoxController_get_implementation",
@@ -380,10 +385,14 @@ core_constructor_list = [
 # svx/util/svxcore.component
 "com_sun_star_comp_graphic_PrimitiveFactory2D_get_implementation",
 "com_sun_star_comp_D

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - basic/qa basic/source

2021-09-28 Thread Andreas Heinisch (via logerrit)
 basic/qa/vba_tests/constants.vb |   11 +++
 basic/source/comp/parser.cxx|   18 ++
 2 files changed, 29 insertions(+)

New commits:
commit d765faacd1933c091e9eb0ecd566460beeb2a33d
Author: Andreas Heinisch 
AuthorDate: Sat Sep 25 16:42:37 2021 +0200
Commit: Xisco Fauli 
CommitDate: Tue Sep 28 11:00:33 2021 +0200

tdf#131563 - Add vba color constants

Change-Id: I59bcd11b5da1450fced77671c2cf6ed44e299a06
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122607
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch 
(cherry picked from commit d6063f416c78f30f1fb717f3ab05f9691bb3461d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122648
Reviewed-by: Xisco Fauli 

diff --git a/basic/qa/vba_tests/constants.vb b/basic/qa/vba_tests/constants.vb
index d03fdda95afe..be7add515e83 100644
--- a/basic/qa/vba_tests/constants.vb
+++ b/basic/qa/vba_tests/constants.vb
@@ -25,6 +25,17 @@ Sub verify_testConstants()
 TestUtil.AssertEqual(vbNewLine, vbLf, "vbNewline")
 End If
 
+' tdf#131563 - check for vba color constants
+' See 
https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/color-constants
+TestUtil.AssertEqual(vbBlack,   RGB(0, 0, 0),   "vbBlack")
+TestUtil.AssertEqual(vbRed, RGB(255, 0, 0), "vbRed")
+TestUtil.AssertEqual(vbGreen,   RGB(0, 255, 0), "vbGreen")
+TestUtil.AssertEqual(vbYellow,  RGB(255, 255, 0),   "vbYellow")
+TestUtil.AssertEqual(vbBlue,RGB(0, 0, 255), "vbBlue")
+TestUtil.AssertEqual(vbMagenta, RGB(255, 0, 255),   "vbMagenta")
+TestUtil.AssertEqual(vbCyan,RGB(0, 255, 255),   "vbCyan")
+TestUtil.AssertEqual(vbWhite,   RGB(255, 255, 255), "vbWhite")
+
 Exit Sub
 errorHandler:
 TestUtil.ReportErrorHandler("verify_testConstants", Err, Error$, Erl)
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index 6ebc2208ae42..dc0b3b16b348 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -841,8 +841,26 @@ static void addStringConst( SbiSymPool& rPool, const 
OUString& pSym, const OUStr
 rPool.Add( pConst );
 }
 
+static void addNumericConst(SbiSymPool& rPool, const OUString& pSym, double 
nVal)
+{
+SbiConstDef* pConst = new SbiConstDef(pSym);
+pConst->Set(nVal, SbxDOUBLE);
+rPool.Add(pConst);
+}
+
 void SbiParser::AddConstants()
 {
+// tdf#131563 - add vba color constants
+// See 
https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/color-constants
+addNumericConst(aPublics, "vbBlack", 0x0);
+addNumericConst(aPublics, "vbRed", 0xFF);
+addNumericConst(aPublics, "vbGreen", 0xFF00);
+addNumericConst(aPublics, "vbYellow", 0x);
+addNumericConst(aPublics, "vbBlue", 0xFF);
+addNumericConst(aPublics, "vbMagenta", 0xFF00FF);
+addNumericConst(aPublics, "vbCyan", 0x00);
+addNumericConst(aPublics, "vbWhite", 0xFF);
+
 // #113063 Create constant RTL symbols
 addStringConst( aPublics, "vbCr", "\x0D" );
 addStringConst( aPublics, "vbCrLf", "\x0D\x0A" );


[Libreoffice-commits] core.git: officecfg/registry sw/uiconfig

2021-09-28 Thread Heiko Tietze (via logerrit)
 officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu |4 ++--
 sw/uiconfig/sglobal/popupmenu/table.xml |1 +
 sw/uiconfig/sweb/popupmenu/table.xml|1 +
 sw/uiconfig/swform/popupmenu/table.xml  |1 +
 sw/uiconfig/swreport/popupmenu/table.xml|1 +
 sw/uiconfig/swriter/popupmenu/table.xml |1 +
 sw/uiconfig/swxform/popupmenu/table.xml |1 +
 7 files changed, 8 insertions(+), 2 deletions(-)

New commits:
commit ac34bafb6cad056f843ff3ff0dee293bf1e18c56
Author: Heiko Tietze 
AuthorDate: Tue Sep 28 09:22:00 2021 +0200
Commit: Heiko Tietze 
CommitDate: Tue Sep 28 11:07:27 2021 +0200

Resolves tdf#144735 - Access to formula edit bar via context menu

* Command added to context menu
* Label modified for more user-centered clarity

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

diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index f67dc96ff9b4..ffc66b25c054 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -1837,10 +1837,10 @@
   
   
 
-  Text Fo~rmula
+  Edit Fo~rmula
 
 
-  Insert Text Formulak
+  Insert or Edit Formulak
 
 
   1
diff --git a/sw/uiconfig/sglobal/popupmenu/table.xml 
b/sw/uiconfig/sglobal/popupmenu/table.xml
index 2ef887ebaef7..c986ff788102 100644
--- a/sw/uiconfig/sglobal/popupmenu/table.xml
+++ b/sw/uiconfig/sglobal/popupmenu/table.xml
@@ -121,6 +121,7 @@
 
   
   
+  
   
   
   
diff --git a/sw/uiconfig/sweb/popupmenu/table.xml 
b/sw/uiconfig/sweb/popupmenu/table.xml
index 2ef887ebaef7..c986ff788102 100644
--- a/sw/uiconfig/sweb/popupmenu/table.xml
+++ b/sw/uiconfig/sweb/popupmenu/table.xml
@@ -121,6 +121,7 @@
 
   
   
+  
   
   
   
diff --git a/sw/uiconfig/swform/popupmenu/table.xml 
b/sw/uiconfig/swform/popupmenu/table.xml
index 2ef887ebaef7..c986ff788102 100644
--- a/sw/uiconfig/swform/popupmenu/table.xml
+++ b/sw/uiconfig/swform/popupmenu/table.xml
@@ -121,6 +121,7 @@
 
   
   
+  
   
   
   
diff --git a/sw/uiconfig/swreport/popupmenu/table.xml 
b/sw/uiconfig/swreport/popupmenu/table.xml
index b7df85b54a4e..f6734784cf4d 100644
--- a/sw/uiconfig/swreport/popupmenu/table.xml
+++ b/sw/uiconfig/swreport/popupmenu/table.xml
@@ -76,6 +76,7 @@
   
   
   
+  
   
   
   
diff --git a/sw/uiconfig/swriter/popupmenu/table.xml 
b/sw/uiconfig/swriter/popupmenu/table.xml
index 4e1a81e4b44e..30449122097a 100644
--- a/sw/uiconfig/swriter/popupmenu/table.xml
+++ b/sw/uiconfig/swriter/popupmenu/table.xml
@@ -124,6 +124,7 @@
 
   
   
+  
   
   
   
diff --git a/sw/uiconfig/swxform/popupmenu/table.xml 
b/sw/uiconfig/swxform/popupmenu/table.xml
index 2ef887ebaef7..c986ff788102 100644
--- a/sw/uiconfig/swxform/popupmenu/table.xml
+++ b/sw/uiconfig/swxform/popupmenu/table.xml
@@ -121,6 +121,7 @@
 
   
   
+  
   
   
   


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/inc sc/source

2021-09-28 Thread Eike Rathke (via logerrit)
 sc/inc/queryentry.hxx  |9 +-
 sc/source/core/data/column3.cxx|2 
 sc/source/core/data/table3.cxx |  121 ++---
 sc/source/core/tool/queryentry.cxx |3 
 4 files changed, 94 insertions(+), 41 deletions(-)

New commits:
commit 825a96114a7693335be000b2aa661df88a02e273
Author: Eike Rathke 
AuthorDate: Tue Sep 28 00:19:47 2021 +0200
Commit: Xisco Fauli 
CommitDate: Tue Sep 28 11:28:32 2021 +0200

Resolves: tdf#144740 Fix broken compareByValue() query, tdf#142910 
tdf#144253

Fix regression of a series of commits that, intended for filter
queries, unconditionally round numeric values as shown under
ScTable::ValidQuery() and compareByValue() without having taken
into account that the same query and compare functions are used by
the interpreter for all functions that use query criteria,
possibly delivering completely wrong results including in
backports to 7.2.0.0

commit f6b143a57d9bd8f5d7b29febcb4e01ee1eb2ff1d
CommitDate: Wed Jul 7 17:44:46 2021 +0200

tdf#142910 sc filter: fix "greater than" or "smaller than" etc

commit 51375b48378915b6e95c1ac26b2ccf8e39880f7e
CommitDate: Tue Sep 21 11:06:35 2021 +0200

tdf#144253 tdf#144324 sc filter: use formatted values in filters

Several related and intertwined commits in filter context make
assumptions about these queries always being executed rounded, so
the only clean solution is to make that depend on the
ScQueryEntry::Item being passed. Its mbRoundForFilter value is set
to true for all items of all queries executed via ScTable::Query()
and ScTable::GetFilteredFilterEntries(). It might be not all are
necessary (or some even still harmful?) and unnecessarily
obtaining number formats and calling RoundValueAsShown() is still
a bottle neck for those, but that should be addressed and reworked
independently. The important part is calculations work as before.

Also, moved obtaining number formats for calling RoundValueAsShown()
into logic that calls them only if necessary.

Note the TODO in compareByValue() about suspicious rounding of
rItem.mfVal in filter context that is to be addressed.

Change-Id: Ieb178ad1ea15a635caeb1ba698c2f4b7ad676d57
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122729
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit b60b6bfaafa1315e07108dba50f016975b619c59)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122735
Reviewed-by: Xisco Fauli 

diff --git a/sc/inc/queryentry.hxx b/sc/inc/queryentry.hxx
index 94ea761c1239..9b0b1cd98124 100644
--- a/sc/inc/queryentry.hxx
+++ b/sc/inc/queryentry.hxx
@@ -44,13 +44,14 @@ struct SC_DLLPUBLIC ScQueryEntry
 
 struct SAL_DLLPRIVATE Item
 {
-QueryType meType;
-doublemfVal;
+QueryType meType;
+doublemfVal;
 svl::SharedString maString;
+Color maColor;
 bool  mbMatchEmpty;
-Color maColor;
+bool  mbRoundForFilter;
 
-Item() : meType(ByValue), mfVal(0.0), mbMatchEmpty(false) {}
+Item() : meType(ByValue), mfVal(0.0), mbMatchEmpty(false), 
mbRoundForFilter(false) {}
 
 bool operator== (const Item& r) const;
 };
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 9f9c697e709e..72f5d3448fd6 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2551,7 +2551,7 @@ class FilterEntriesHandler
 pFormatter->GetInputLineString(fVal, nIndex, aStr);
 }
 // store the formatted/rounded value for filtering
-if (nFormat && !bDate)
+if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0 && !bDate)
 mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, 
rColumn.GetDoc().RoundValueAsShown(fVal, nFormat), ScTypedStrData::Value, 
bDate));
 else
 mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, fVal, 
ScTypedStrData::Value, bDate));
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 554b69b90203..14a9c7f35884 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2445,6 +2445,17 @@ public:
 return mrTab.HasStringData(nCol, nRow);
 }
 
+sal_uInt32 getNumFmt( SCCOL nCol, SCROW nRow, const ScInterpreterContext* 
pContext )
+{
+sal_uInt32 nNumFmt = (pContext ?
+mrTab.GetNumberFormat(*pContext, ScAddress(nCol, nRow, 
mrTab.GetTab())) :
+mrTab.GetNumberFormat(nCol, nRow));
+if (nNumFmt && (nNumFmt % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
+// Any General of any locale is irrelevant for rounding.
+nNumFmt = 0;
+return nNumFmt;
+}
+
 std::pair compareByValue(
 const 

[Libreoffice-commits] core.git: sc/qa sc/source

2021-09-28 Thread Daniel Arato (NISZ) (via logerrit)
 sc/qa/unit/data/ods/header-footer-content.ods |binary
 sc/qa/unit/subsequent_export_test2.cxx|   36 ++
 sc/source/filter/xml/XMLTableMasterPageExport.cxx |2 -
 3 files changed, 37 insertions(+), 1 deletion(-)

New commits:
commit 6f04952e6828cf1419b991e82070514bae24896c
Author: Daniel Arato (NISZ) 
AuthorDate: Wed Sep 22 15:03:48 2021 +0200
Commit: László Németh 
CommitDate: Tue Sep 28 11:32:53 2021 +0200

tdf#144184 sc: fix first page footer export

Due to a typical case of copy-paste oversight LO Calc used to lose
the first page footer when exporting to ODS. With the typo fixed,
the export now works again.

Follow-up to commit 19fa853ce12136b5c14e0c5a0aa906c296b75388
"tdf#121715 XLSX: support custom first page header/footer".

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

diff --git a/sc/qa/unit/data/ods/header-footer-content.ods 
b/sc/qa/unit/data/ods/header-footer-content.ods
new file mode 100644
index ..f365748ddc22
Binary files /dev/null and b/sc/qa/unit/data/ods/header-footer-content.ods 
differ
diff --git a/sc/qa/unit/subsequent_export_test2.cxx 
b/sc/qa/unit/subsequent_export_test2.cxx
index 41a25d2c0312..10743521d31c 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -83,6 +83,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -126,6 +127,7 @@ public:
 void testRefStringConfigXLSX();
 void testRefStringUnspecified();
 void testHeaderImageODS();
+void testHeaderFooterContentODS();
 
 void testTdf88657ODS();
 void testTdf41722();
@@ -233,6 +235,7 @@ public:
 CPPUNIT_TEST(testRefStringConfigXLSX);
 CPPUNIT_TEST(testRefStringUnspecified);
 CPPUNIT_TEST(testHeaderImageODS);
+CPPUNIT_TEST(testHeaderFooterContentODS);
 
 CPPUNIT_TEST(testTdf88657ODS);
 CPPUNIT_TEST(testTdf41722);
@@ -485,6 +488,39 @@ void ScExportTest2::testHeaderImageODS()
 xDocSh->DoClose();
 }
 
+void ScExportTest2::testHeaderFooterContentODS()
+{
+ScDocShellRef xShell = loadDoc(u"header-footer-content.", FORMAT_ODS);
+ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_ODS);
+uno::Reference 
xStyleFamiliesSupplier(xDocSh->GetModel(),
+ 
uno::UNO_QUERY);
+uno::Reference xStyleFamilies
+= xStyleFamiliesSupplier->getStyleFamilies();
+uno::Reference 
xPageStyles(xStyleFamilies->getByName("PageStyles"),
+   uno::UNO_QUERY);
+uno::Reference 
xStyle(xPageStyles->getByName("Default"), uno::UNO_QUERY);
+
+uno::Reference xContent;
+xStyle->getPropertyValue("RightPageHeaderContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("header"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("FirstPageHeaderContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("first page header"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("RightPageFooterContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("footer"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("FirstPageFooterContent") >>= xContent;
+// First page footer content used to be lost upon export.
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("first page footer"), 
xContent->getCenterText()->getString());
+
+xDocSh->DoClose();
+}
+
 void ScExportTest2::testTextDirectionXLSX()
 {
 ScDocShellRef xDocSh = loadDoc(u"writingMode.", FORMAT_XLSX);
diff --git a/sc/source/filter/xml/XMLTableMasterPageExport.cxx 
b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
index bf43b2c29fb2..59b29378ea16 100644
--- a/sc/source/filter/xml/XMLTableMasterPageExport.cxx
+++ b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
@@ -187,7 +187,7 @@ void XMLTableMasterPageExport::exportMasterPageContent(
 
 bool bFirstFooter = (!::cppu::any2bool(rPropSet->getPropertyValue( 
SC_UNO_PAGE_FIRSTFTRSHARED )) && bFooter);
 
-exportHeaderFooter( xFooterLeft, XML_FOOTER_FIRST, bFirstFooter );
+exportHeaderFooter( xFooterFirst, XML_FOOTER_FIRST, bFirstFooter );
 }
 }
 


[Libreoffice-commits] core.git: connectivity/source

2021-09-28 Thread Caolán McNamara (via logerrit)
 connectivity/source/drivers/dbase/DTable.cxx |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit a52de700a0092ac547f3cbdc3c14e77b6da37955
Author: Caolán McNamara 
AuthorDate: Tue Sep 28 09:28:03 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 28 11:44:20 2021 +0200

ofz: Integer-overflow in lcl_CalDate

FWIW we have another similar implementation of this as
Calendar_hijri::getGregorianDay

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

diff --git a/connectivity/source/drivers/dbase/DTable.cxx 
b/connectivity/source/drivers/dbase/DTable.cxx
index 0ec699d6a7db..73a0d5db7df1 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -155,17 +155,17 @@ void lcl_CalDate(sal_Int32 _nJulianDate,sal_Int32 
_nJulianTime,css::util::DateTi
 {
 if ( _nJulianDate )
 {
-sal_Int32 ka = _nJulianDate;
+sal_Int64 ka = _nJulianDate;
 if ( _nJulianDate >= 2299161 )
 {
-sal_Int32 ialp = static_cast( 
(static_cast(_nJulianDate) - 1867216.25 ) / 36524.25 );
-ka = _nJulianDate + 1 + ialp - ( ialp >> 2 );
+sal_Int64 ialp = static_cast( 
(static_cast(_nJulianDate) - 1867216.25 ) / 36524.25 );
+ka = ka + 1 + ialp - ( ialp >> 2 );
 }
-sal_Int32 kb = ka + 1524;
-sal_Int32 kc =  static_cast( (static_cast(kb) - 
122.1 ) / 365.25 );
-sal_Int32 kd = static_cast(static_cast(kc) * 
365.25);
-sal_Int32 ke = static_cast(static_cast( kb - kd ) / 
30.6001 );
-_rDateTime.Day = static_cast(kb - kd - 
static_cast( static_cast(ke) * 30.6001 ));
+sal_Int64 kb = ka + 1524;
+sal_Int64 kc = static_cast((static_cast(kb) - 
122.1) / 365.25);
+sal_Int64 kd = static_cast(static_cast(kc) * 
365.25);
+sal_Int64 ke = static_cast(static_cast(kb - kd) / 
30.6001);
+_rDateTime.Day = static_cast(kb - kd - 
static_cast( static_cast(ke) * 30.6001 ));
 if ( ke > 13 )
 _rDateTime.Month = static_cast(ke - 13);
 else


cppunit Patch feature-modernize

2021-09-28 Thread Florian Becker
Hello,

i have patched the libcppunit 1.15.1 to modernize and use clang flags 
with highest flag settings. Hopefully you can integrate this patch 
inside master. https://github.com/VXAPPS/cppunit/tree/feature-modernize

If you have suggestions, please let me know.

Regards,
Florian



[Libreoffice-commits] core.git: vcl/win

2021-09-28 Thread Jan-Marek Glogowski (via logerrit)
 vcl/win/gdi/salfont.cxx |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 3476106890ea2a00e6f949c918f6c05e17c66a36
Author: Jan-Marek Glogowski 
AuthorDate: Mon Sep 27 18:26:17 2021 +0200
Commit: Jan-Marek Glogowski 
CommitDate: Tue Sep 28 13:02:04 2021 +0200

tdf#144754 WIN de-assert ReleaseFonts / setFont

DeInitGraphics might already have reset the default HDC font,
while the WinSalGraphics still has a font fallback stack. Not
sure why this didn't trigger the existing assert before.
Quite probably there was an existing lifecycle bug.

Regression from commit 42f9d4335bfa4b7299224801fd7ccdd97ae92fbf
("WIN always (de-)init WinSalGraphics")

Change-Id: Ie5826e632310a0d69e8f9617cf6f3629bc31f152
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122726
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski 

diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index c3ad1eb5817d..6dd8365e6955 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -856,16 +856,22 @@ HFONT 
WinSalGraphics::ImplDoSetFont(vcl::font::FontSelectPattern const & i_rFont
 
 void WinSalGraphics::SetFont(LogicalFontInstance* pFont, int nFallbackLevel)
 {
+// check that we don't change the first font while ScopedFont has replaced 
HFONT
+assert(!mpWinFontEntry[0].is() || nFallbackLevel != 0 || 
mpWinFontEntry[0]->GetHFONT());
+assert(nFallbackLevel >= 0 && nFallbackLevel < MAX_FALLBACK);
+
 // return early if there is no new font
 if( !pFont )
 {
 if (!mpWinFontEntry[nFallbackLevel].is())
 return;
 
-// select original DC font
-assert(mhDefFont);
-::SelectFont(getHDC(), mhDefFont);
-mhDefFont = nullptr;
+// DeInitGraphics doesn't free the cached fonts, so mhDefFont might be 
nullptr
+if (mhDefFont)
+{
+::SelectFont(getHDC(), mhDefFont);
+mhDefFont = nullptr;
+}
 
 // release no longer referenced font handles
 for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )


[Libreoffice-commits] core.git: sw/source

2021-09-28 Thread Caolán McNamara (via logerrit)
 sw/source/filter/xml/xmlexp.cxx |   14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 6e111548d9de8eacff79d614e4400719df792228
Author: Caolán McNamara 
AuthorDate: Tue Sep 28 10:23:29 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 28 13:02:39 2021 +0200

flatten this in advance of additional changes

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

diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 437a1a9c76f6..7ddf32da76cb 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -385,12 +385,14 @@ void 
SwXMLExport::GetViewSettings(Sequence& aProps)
 void SwXMLExport::GetConfigurationSettings( Sequence < PropertyValue >& rProps)
 {
 Reference< XMultiServiceFactory > xFac( GetModel(), UNO_QUERY );
-if( xFac.is() )
-{
-Reference< XPropertySet > xProps( 
xFac->createInstance("com.sun.star.document.Settings"), UNO_QUERY );
-if( xProps.is() )
-SvXMLUnitConverter::convertPropertySet( rProps, xProps );
-}
+if (!xFac.is())
+return;
+
+Reference< XPropertySet > xProps( 
xFac->createInstance("com.sun.star.document.Settings"), UNO_QUERY );
+if (!xProps.is())
+return;
+
+SvXMLUnitConverter::convertPropertySet( rProps, xProps );
 }
 
 sal_Int32 SwXMLExport::GetDocumentSpecificSettings( std::vector< SettingsGroup 
>& _out_rSettings )


[Libreoffice-commits] core.git: sw/source

2021-09-28 Thread Caolán McNamara (via logerrit)
 sw/source/filter/xml/wrtxml.cxx |   19 +++
 sw/source/filter/xml/wrtxml.hxx |2 +-
 sw/source/filter/xml/xmlexp.cxx |   29 +
 3 files changed, 45 insertions(+), 5 deletions(-)

New commits:
commit c9a405b3bcc0d3f5fdb6b4386831a4d4b2897c74
Author: Caolán McNamara 
AuthorDate: Tue Sep 28 10:39:46 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 28 13:03:03 2021 +0200

tdf#144532 closing mail merge wizard preview removed document's data source

Filter out the "EmbeddedDatabaseName" property from the document
settings on saving document that will be loaded by the mail merge
preview so that when the temp mailmerge preview document is closed it
doesn't unregister the database of the same name which was registered by
the document this is a copy of.

This looks like a similar problem to tdf#118634 addressed by:
commit edc62adae9a354ca1305e83b10c98a545f58d341
Date:   Mon Jul 9 19:49:34 2018 +1000

tdf#118634: Don't save embedded data source to a temporary preview 
document

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

diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index 859140d9f950..aa969c9d40e6 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -81,8 +81,8 @@ SwXMLWriter::~SwXMLWriter()
 {
 }
 
-ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& 
xStatusIndicator,
-const OUString& aDocHierarchicalName )
+ErrCode SwXMLWriter::Write_(const uno::Reference < task::XStatusIndicator >& 
xStatusIndicator,
+const OUString& aDocHierarchicalName, bool 
bNoEmbDS)
 {
 // Get service factory
 uno::Reference< uno::XComponentContext > xContext =
@@ -160,6 +160,10 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < 
task::XStatusIndicator >& xS
   beans::PropertyAttribute::MAYBEVOID, 0 },
 { OUString("TargetStorage"),0, cppu::UnoType::get(),
   css::beans::PropertyAttribute::MAYBEVOID, 0 },
+// tdf#144532
+{ OUString("NoEmbDataSet"), 0,
+  cppu::UnoType::get(),
+  beans::PropertyAttribute::MAYBEVOID, 0 },
 { OUString(), 0, css::uno::Type(), 0, 0 }
 };
 uno::Reference< beans::XPropertySet > xInfoSet(
@@ -168,6 +172,8 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < 
task::XStatusIndicator >& xS
 
 xInfoSet->setPropertyValue( "TargetStorage", Any( m_xStg ) );
 
+xInfoSet->setPropertyValue("NoEmbDataSet", makeAny(bNoEmbDS));
+
 if (m_bShowProgress)
 {
 // set progress range and start status indicator
@@ -441,13 +447,15 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < 
task::XStatusIndicator >& xS
 
 ErrCode SwXMLWriter::WriteStorage()
 {
-return Write_( uno::Reference < task::XStatusIndicator >(), OUString() );
+return Write_(uno::Reference(), OUString(), false);
 }
 
 ErrCode SwXMLWriter::WriteMedium( SfxMedium& aTargetMedium )
 {
 uno::Reference < task::XStatusIndicator > xStatusIndicator;
 OUString aName;
+bool bNoEmbDS(false);
+
 const SfxUnoAnyItem* pStatusBarItem = static_cast(
aTargetMedium.GetItemSet()->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) );
 if ( pStatusBarItem )
@@ -456,8 +464,11 @@ ErrCode SwXMLWriter::WriteMedium( SfxMedium& aTargetMedium 
)
 aTargetMedium.GetItemSet()->GetItem(SID_DOC_HIERARCHICALNAME) );
 if ( pDocHierarchItem )
 aName = pDocHierarchItem->GetValue();
+const SfxBoolItem* pNoEmbDS = 
SfxItemSet::GetItem(aTargetMedium.GetItemSet(), SID_NO_EMBEDDED_DS, false);
+if (pNoEmbDS)
+bNoEmbDS = pNoEmbDS->GetValue();
 
-return Write_( xStatusIndicator, aName );
+return Write_(xStatusIndicator, aName, bNoEmbDS);
 }
 
 ErrCode SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed,
diff --git a/sw/source/filter/xml/wrtxml.hxx b/sw/source/filter/xml/wrtxml.hxx
index c82afcc97436..7e4ed6580c15 100644
--- a/sw/source/filter/xml/wrtxml.hxx
+++ b/sw/source/filter/xml/wrtxml.hxx
@@ -40,7 +40,7 @@ namespace com::sun::star {
 
 class SwXMLWriter : public StgWriter
 {
-ErrCode Write_( const css::uno::Reference < css::task::XStatusIndicator>&, 
const OUString&  );
+ErrCode Write_(const css::uno::Reference < css::task::XStatusIndicator>&, 
const OUString&, bool bNoEmbDS);
 
 using StgWriter::Write;
 
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 7ddf32da76cb..bcc9729ebbab 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -393,6 +393,35 @@ void SwXMLExport::GetConfigurationSettings( Sequence < 
PropertyValue >& rProps)
 return;
 
 SvXMLUnitConverter::convertPropertySet( rProps, xProps );
+
+// tdf#144532 if NoEmbDat

[Libreoffice-commits] core.git: desktop/inc desktop/source

2021-09-28 Thread Luboš Luňák (via logerrit)
 desktop/inc/lib/init.hxx|3 
 desktop/source/lib/init.cxx |  204 +++-
 2 files changed, 114 insertions(+), 93 deletions(-)

New commits:
commit 6e060ba9e8c4f34b5ad12908e0c0b5f65c533869
Author: Luboš Luňák 
AuthorDate: Fri Sep 24 00:19:18 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 13:46:39 2021 +0200

optimize removing from the LOK flush queue

All the lambdas check for event type, so it makes sense to first
separately check the type and only then possibly call the lambda.
Especially since 3b3e4ee97af23f21 separated the types for better
searching.

Change-Id: I144c88f5319ac2141336e1aa3c4ffd7b38265af9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122673
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
index e6b4f00a5427..2693e67eb718 100644
--- a/desktop/inc/lib/init.hxx
+++ b/desktop/inc/lib/init.hxx
@@ -128,9 +128,12 @@ namespace desktop {
 typedef std::vector queue_type2;
 
 private:
+bool removeAll(int type);
+bool removeAll(int type, const std::function& rTestFunc);
 bool removeAll(const std::function& 
rTestFunc);
 bool processInvalidateTilesEvent(int type, CallbackData& 
aCallbackData);
 bool processWindowEvent(int type, CallbackData& aCallbackData);
+queue_type2::iterator toQueue2(queue_type1::iterator);
 queue_type2::reverse_iterator toQueue2(queue_type1::reverse_iterator);
 
 /** we frequently want to scan the queue, and mostly when we do so, we 
only care about the element type
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 26ba3016b99c..267d54492d14 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1426,6 +1426,12 @@ void CallbackFlushHandler::callback(const int type, 
const char* payload, void* d
 }
 }
 
+CallbackFlushHandler::queue_type2::iterator 
CallbackFlushHandler::toQueue2(CallbackFlushHandler::queue_type1::iterator pos)
+{
+int delta = std::distance(m_queue1.begin(), pos);
+return m_queue2.begin() + delta;
+}
+
 CallbackFlushHandler::queue_type2::reverse_iterator 
CallbackFlushHandler::toQueue2(CallbackFlushHandler::queue_type1::reverse_iterator
 pos)
 {
 int delta = std::distance(m_queue1.rbegin(), pos);
@@ -1555,8 +1561,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 case LOK_CALLBACK_GRAPHIC_SELECTION:
 case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
 case LOK_CALLBACK_INVALIDATE_TILES:
-if (removeAll(
-[type](int elemType, const CallbackData&) { return 
(elemType == type); }))
+if (removeAll(type))
 SAL_INFO("lok", "Removed dups of [" << type << "]: [" << 
payload << "].");
 break;
 }
@@ -1579,8 +1584,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 case LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE:
 case LOK_CALLBACK_RULER_UPDATE:
 {
-if (removeAll(
-[type](int elemType, const CallbackData&) { return 
(elemType == type); }))
+if (removeAll(type))
 SAL_INFO("lok", "Removed dups of [" << type << "]: [" << 
payload << "].");
 }
 break;
@@ -1603,9 +1607,8 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 payload.find("\"hyperlink\":\"\"") == std::string::npos &&
 payload.find("\"hyperlink\": {}") == std::string::npos;
 const int nViewId = lcl_getViewId(payload);
-removeAll(
-[type, nViewId, hyperLinkException] (int elemType, const 
CallbackData& elemData) {
-return (elemType == type && nViewId == 
lcl_getViewId(elemData) && !hyperLinkException);
+removeAll(type, [nViewId, hyperLinkException] (const 
CallbackData& elemData) {
+return (nViewId == lcl_getViewId(elemData) && 
!hyperLinkException);
 }
 );
 }
@@ -1629,9 +1632,8 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 // a save occurs while a cell is still edited in Calc.
 if (name != ".uno:ModifiedStatus=")
 {
-removeAll(
-[type, &name] (int elemType, const CallbackData& 
elemData) {
-return (elemType == type) && 
(elemData.PayloadString.compare(0, name.size(), name) == 0);
+removeAll(type, [&name] (const CallbackData& elemData) 
{
+return (elemData.PayloadString.compare(0, 
name.size(), name) == 0);
 }
 );

[Libreoffice-commits] core.git: desktop/source

2021-09-28 Thread Luboš Luňák (via logerrit)
 desktop/source/lib/init.cxx |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 6a1aa5ba0be05258b6375433a071389811efd405
Author: Luboš Luňák 
AuthorDate: Sat Sep 25 21:26:31 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 13:46:55 2021 +0200

do not check a const variable in every lambda invocation

If the variable is false, then every call to the lambda will be false
as well, so the entire block may be skipped.

Change-Id: I8b61133d246fcfa721145f9d28c55e9afdb06e5d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122678
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 267d54492d14..0677c0ccc5e7 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1606,11 +1606,14 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 const bool hyperLinkException = type == 
LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR &&
 payload.find("\"hyperlink\":\"\"") == std::string::npos &&
 payload.find("\"hyperlink\": {}") == std::string::npos;
-const int nViewId = lcl_getViewId(payload);
-removeAll(type, [nViewId, hyperLinkException] (const 
CallbackData& elemData) {
-return (nViewId == lcl_getViewId(elemData) && 
!hyperLinkException);
-}
-);
+if(!hyperLinkException)
+{
+const int nViewId = lcl_getViewId(payload);
+removeAll(type, [nViewId] (const CallbackData& elemData) {
+return (nViewId == lcl_getViewId(elemData));
+}
+);
+}
 }
 break;
 


[Libreoffice-commits] core.git: desktop/source

2021-09-28 Thread Luboš Luňák (via logerrit)
 desktop/source/lib/init.cxx |   13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 6eac17ddcb25765f395493526e75c979049c73e2
Author: Luboš Luňák 
AuthorDate: Fri Sep 24 12:12:12 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 13:47:25 2021 +0200

do not use std::find_if() if std::find() does the job

Change-Id: I94fe697e18442c1bce5e09abf82e8fe4b89cd0dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122675
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0677c0ccc5e7..9274be462370 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1523,8 +1523,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 case LOK_CALLBACK_CALC_FUNCTION_LIST:
 case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY:
 {
-const auto& pos = std::find_if(m_queue1.rbegin(), m_queue1.rend(),
-[type] (int elemType) { return (elemType == type); });
+const auto& pos = std::find(m_queue1.rbegin(), m_queue1.rend(), 
type);
 auto pos2 = toQueue2(pos);
 if (pos != m_queue1.rend() && pos2->PayloadString == payload)
 {
@@ -1537,14 +1536,12 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 
 if (type == LOK_CALLBACK_TEXT_SELECTION && payload.empty())
 {
-const auto& posStart = std::find_if(m_queue1.rbegin(), m_queue1.rend(),
-[] (int elemType) { return (elemType == 
LOK_CALLBACK_TEXT_SELECTION_START); });
+const auto& posStart = std::find(m_queue1.rbegin(), m_queue1.rend(), 
LOK_CALLBACK_TEXT_SELECTION_START);
 auto posStart2 = toQueue2(posStart);
 if (posStart != m_queue1.rend())
 posStart2->PayloadString.clear();
 
-const auto& posEnd = std::find_if(m_queue1.rbegin(), m_queue1.rend(),
-[] (int elemType) { return (elemType == 
LOK_CALLBACK_TEXT_SELECTION_END); });
+const auto& posEnd = std::find(m_queue1.rbegin(), m_queue1.rend(), 
LOK_CALLBACK_TEXT_SELECTION_END);
 auto posEnd2 = toQueue2(posEnd);
 if (posEnd != m_queue1.rend())
 posEnd2->PayloadString.clear();
@@ -1709,9 +1706,7 @@ bool 
CallbackFlushHandler::processInvalidateTilesEvent(int type, CallbackData& a
 // If we have to invalidate all tiles, we can skip any new tile 
invalidation.
 // Find the last INVALIDATE_TILES entry, if any to see if it's 
invalidate-all.
 const auto& pos
-= std::find_if(m_queue1.rbegin(), m_queue1.rend(), [](int elemType) {
-  return (elemType == LOK_CALLBACK_INVALIDATE_TILES);
-  });
+= std::find(m_queue1.rbegin(), m_queue1.rend(), 
LOK_CALLBACK_INVALIDATE_TILES);
 if (pos != m_queue1.rend())
 {
 auto pos2 = toQueue2(pos);


[Libreoffice-commits] core.git: vcl/source

2021-09-28 Thread Luboš Luňák (via logerrit)
 vcl/source/window/paint.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit fbaa1c3377f445180db2f7811b9516895b357aa8
Author: Luboš Luňák 
AuthorDate: Fri Sep 24 11:47:30 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 13:47:54 2021 +0200

optimize out a bit of Invalidate() in LOK mode

Change-Id: I3c076e2506c9cade7e6bb874a2cddfa1ef0db6a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122674
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 65451c0c4d59..302faae5df06 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1179,8 +1179,11 @@ void Window::Invalidate( const tools::Rectangle& rRect, 
InvalidateFlags nFlags )
 tools::Rectangle aRect = pOutDev->ImplLogicToDevicePixel( rRect );
 if ( !aRect.IsEmpty() )
 {
-vcl::Region aRegion( aRect );
-ImplInvalidate( &aRegion, nFlags );
+if (!comphelper::LibreOfficeKit::isActive())
+{   // ImplInvalidate() immediatelly returns in LOK mode, skip useless 
Region construction
+vcl::Region aRegion( aRect );
+ImplInvalidate( &aRegion, nFlags );
+}
 tools::Rectangle aLogicRectangle(rRect);
 LogicInvalidate(&aLogicRectangle);
 }


[Libreoffice-commits] core.git: sw/source

2021-09-28 Thread Luboš Luňák (via logerrit)
 sw/source/core/bastyp/swregion.cxx |   29 +++--
 1 file changed, 19 insertions(+), 10 deletions(-)

New commits:
commit 9cd4845e50efb30c14407b139ef05a891dea1781
Author: Luboš Luňák 
AuthorDate: Fri Sep 24 13:17:34 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 13:48:18 2021 +0200

avoid repeated std::vector::erase() in SwRegionRects::Compress()

Change-Id: I5e646d2938dda7077e5e4ff40ab6caa847ac7a80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122676
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sw/source/core/bastyp/swregion.cxx 
b/sw/source/core/bastyp/swregion.cxx
index 967bc44b2cb2..5b928a1ab9b0 100644
--- a/sw/source/core/bastyp/swregion.cxx
+++ b/sw/source/core/bastyp/swregion.cxx
@@ -159,31 +159,35 @@ void SwRegionRects::Compress( CompressType type )
 {
 sort( begin(), end(), []( const SwRect& l, const SwRect& r ) { return 
l.Top() < r.Top(); } );
 bAgain = false;
+bool bRemoved = false;
 for (size_type i = 0; i < size(); ++i )
 {
+if( (*this)[i].IsEmpty())
+continue;
 // Rectangles are sorted by Y axis, so check only pairs of 
rectangles
 // that are possibly overlapping or adjacent or close enough to be 
grouped by the fuzzy
 // code below.
 const tools::Long nFuzzy = type == CompressFuzzy ? 1361513 : 0;
 const tools::Long yMax = (*this)[i].Top() + (*this)[i].Height() + 
nFuzzy
 / std::max( 1, (*this)[i].Width());
-size_type j = i+1;
-while( j < size() && (*this)[j].Top() <= yMax )
-++j;
---j;
-// Walk backwards for simpler and faster erase().
-for ( ; j >= i+1; --j )
+for(size_type j = i+1; j < size(); ++j)
 {
+if( (*this)[j].IsEmpty())
+continue;
+if( (*this)[j].Top() > yMax )
+break;
 // If one rectangle contains a second completely than the 
latter
 // does not need to be stored and can be deleted
-if ( (*this)[i].Contains( (*this)[j] ) )
+else if ( (*this)[i].Contains( (*this)[j] ) )
 {
-erase( begin() + j );
+(*this)[j].Width(0); // = erase(), see below
+bRemoved = true;
 }
 else if ( (*this)[j].Contains( (*this)[i] ) )
 {
 (*this)[i] = (*this)[j];
-erase( begin() + j );
+(*this)[j].Width(0);
+bRemoved = true;
 bAgain = true;
 }
 else
@@ -206,12 +210,17 @@ void SwRegionRects::Compress( CompressType type )
 + nFuzzy >= CalcArea( aUnion ) )
 {
 (*this)[i] = aUnion;
-erase( begin() + j );
+(*this)[j].Width(0);
+bRemoved = true;
 bAgain = true;
 }
 }
 }
 }
+// Instead of repeated erase() we Width(0) the elements, and now erase
+// all empty elements just once.
+if( bRemoved )
+resize( std::remove_if(begin(), end(), [](const SwRect& rect) { 
return rect.IsEmpty(); }) - begin());
 // Code paths setting bAgain alter elements of the vector, possibly 
breaking
 // the Y-axis optimization, so run another pass just to make sure. The 
adjacent-rects
 // merging code may possibly benefit from a repeated pass also if two 
pairs of merged


[Libreoffice-commits] core.git: solenv/bin

2021-09-28 Thread Caolán McNamara (via logerrit)
 solenv/bin/native-code.py |1 -
 1 file changed, 1 deletion(-)

New commits:
commit eed05aae4a308224ffde7e00d347830f80bbefef
Author: Caolán McNamara 
AuthorDate: Tue Sep 28 12:15:24 2021 +0100
Commit: Tor Lillqvist 
CommitDate: Tue Sep 28 13:48:49 2021 +0200

com_sun_star_comp_svx_CharacterSpacingToolBoxControl is duplicated

com_sun_star_comp_svx_CharacterSpacingToolBoxControl_get_implementation
is already listed under svx/util/svx.component

Change-Id: I55fd0e2aff051b62b33d5b257ced8e934c9053d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122770
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 9e035ddc1b87..e9f2ebd3fab1 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -385,7 +385,6 @@ core_constructor_list = [
 # svx/util/svxcore.component
 "com_sun_star_comp_graphic_PrimitiveFactory2D_get_implementation",
 "com_sun_star_comp_Draw_GraphicExporter_get_implementation",
-"com_sun_star_comp_svx_CharacterSpacingToolBoxControl_get_implementation",
 "com_sun_star_comp_svx_ColorToolBoxControl_get_implementation",
 "com_sun_star_comp_svx_FontNameToolBoxControl_get_implementation",
 "com_sun_star_comp_svx_FrameToolBoxControl_get_implementation",


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 2 commits - desktop/inc desktop/source

2021-09-28 Thread Luboš Luňák (via logerrit)
 desktop/inc/lib/init.hxx|3 
 desktop/source/lib/init.cxx |  213 
 2 files changed, 120 insertions(+), 96 deletions(-)

New commits:
commit e9b341e477eba6f4593c5459bf947faf0cd2f2ea
Author: Luboš Luňák 
AuthorDate: Sat Sep 25 21:26:31 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 13:50:20 2021 +0200

do not check a const variable in every lambda invocation

If the variable is false, then every call to the lambda will be false
as well, so the entire block may be skipped.

Change-Id: I8b61133d246fcfa721145f9d28c55e9afdb06e5d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122644
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Luboš Luňák 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 48db6cf4c434..73af13dd8910 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1612,11 +1612,14 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 const bool hyperLinkException = type == 
LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR &&
 payload.find("\"hyperlink\":\"\"") == std::string::npos &&
 payload.find("\"hyperlink\": {}") == std::string::npos;
-const int nViewId = lcl_getViewId(payload);
-removeAll(type, [nViewId, hyperLinkException] (const 
CallbackData& elemData) {
-return (nViewId == lcl_getViewId(elemData) && 
!hyperLinkException);
-}
-);
+if(!hyperLinkException)
+{
+const int nViewId = lcl_getViewId(payload);
+removeAll(type, [nViewId] (const CallbackData& elemData) {
+return (nViewId == lcl_getViewId(elemData));
+}
+);
+}
 }
 break;
 
commit da16b920745887ce843623b5f3ef7d06dde59f3b
Author: Luboš Luňák 
AuthorDate: Fri Sep 24 00:19:18 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 13:50:05 2021 +0200

optimize removing from the LOK flush queue

All the lambdas check for event type, so it makes sense to first
separately check the type and only then possibly call the lambda.
Especially since 3b3e4ee97af23f21 separated the types for better
searching.

Change-Id: I144c88f5319ac2141336e1aa3c4ffd7b38265af9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122640
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Luboš Luňák 

diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
index ed35ebc2fa13..6cbabd3b 100644
--- a/desktop/inc/lib/init.hxx
+++ b/desktop/inc/lib/init.hxx
@@ -127,9 +127,12 @@ namespace desktop {
 typedef std::vector queue_type2;
 
 private:
+bool removeAll(int type);
+bool removeAll(int type, const std::function& rTestFunc);
 bool removeAll(const std::function& 
rTestFunc);
 bool processInvalidateTilesEvent(int type, CallbackData& 
aCallbackData);
 bool processWindowEvent(int type, CallbackData& aCallbackData);
+queue_type2::iterator toQueue2(queue_type1::iterator);
 queue_type2::reverse_iterator toQueue2(queue_type1::reverse_iterator);
 
 /** we frequently want to scan the queue, and mostly when we do so, we 
only care about the element type
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0426b53946d3..48db6cf4c434 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1432,6 +1432,12 @@ void CallbackFlushHandler::callback(const int type, 
const char* payload, void* d
 }
 }
 
+CallbackFlushHandler::queue_type2::iterator 
CallbackFlushHandler::toQueue2(CallbackFlushHandler::queue_type1::iterator pos)
+{
+int delta = std::distance(m_queue1.begin(), pos);
+return m_queue2.begin() + delta;
+}
+
 CallbackFlushHandler::queue_type2::reverse_iterator 
CallbackFlushHandler::toQueue2(CallbackFlushHandler::queue_type1::reverse_iterator
 pos)
 {
 int delta = std::distance(m_queue1.rbegin(), pos);
@@ -1561,8 +1567,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 case LOK_CALLBACK_GRAPHIC_SELECTION:
 case LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR:
 case LOK_CALLBACK_INVALIDATE_TILES:
-if (removeAll(
-[type](int elemType, const CallbackData&) { return 
(elemType == type); }))
+if (removeAll(type))
 SAL_INFO("lok", "Removed dups of [" << type << "]: [" << 
payload << "].");
 break;
 }
@@ -1585,8 +1590,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 case LOK_CALLBACK_STATUS_INDICATOR_SET_VALUE:
 case LOK_CALLBACK_RULER_UPDATE:
 {
-if (removeAll(
-  

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/source

2021-09-28 Thread Luboš Luňák (via logerrit)
 desktop/source/lib/init.cxx |   13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 2b32ab3a32ce9fff42818a6813a041b356d324b8
Author: Luboš Luňák 
AuthorDate: Fri Sep 24 12:12:12 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 13:50:47 2021 +0200

do not use std::find_if() if std::find() does the job

Change-Id: I94fe697e18442c1bce5e09abf82e8fe4b89cd0dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122642
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Luboš Luňák 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 73af13dd8910..824f45b5d23f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1529,8 +1529,7 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 case LOK_CALLBACK_CALC_FUNCTION_LIST:
 case LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY:
 {
-const auto& pos = std::find_if(m_queue1.rbegin(), m_queue1.rend(),
-[type] (int elemType) { return (elemType == type); });
+const auto& pos = std::find(m_queue1.rbegin(), m_queue1.rend(), 
type);
 auto pos2 = toQueue2(pos);
 if (pos != m_queue1.rend() && pos2->PayloadString == payload)
 {
@@ -1543,14 +1542,12 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 
 if (type == LOK_CALLBACK_TEXT_SELECTION && payload.empty())
 {
-const auto& posStart = std::find_if(m_queue1.rbegin(), m_queue1.rend(),
-[] (int elemType) { return (elemType == 
LOK_CALLBACK_TEXT_SELECTION_START); });
+const auto& posStart = std::find(m_queue1.rbegin(), m_queue1.rend(), 
LOK_CALLBACK_TEXT_SELECTION_START);
 auto posStart2 = toQueue2(posStart);
 if (posStart != m_queue1.rend())
 posStart2->PayloadString.clear();
 
-const auto& posEnd = std::find_if(m_queue1.rbegin(), m_queue1.rend(),
-[] (int elemType) { return (elemType == 
LOK_CALLBACK_TEXT_SELECTION_END); });
+const auto& posEnd = std::find(m_queue1.rbegin(), m_queue1.rend(), 
LOK_CALLBACK_TEXT_SELECTION_END);
 auto posEnd2 = toQueue2(posEnd);
 if (posEnd != m_queue1.rend())
 posEnd2->PayloadString.clear();
@@ -1715,9 +1712,7 @@ bool 
CallbackFlushHandler::processInvalidateTilesEvent(int type, CallbackData& a
 // If we have to invalidate all tiles, we can skip any new tile 
invalidation.
 // Find the last INVALIDATE_TILES entry, if any to see if it's 
invalidate-all.
 const auto& pos
-= std::find_if(m_queue1.rbegin(), m_queue1.rend(), [](int elemType) {
-  return (elemType == LOK_CALLBACK_INVALIDATE_TILES);
-  });
+= std::find(m_queue1.rbegin(), m_queue1.rend(), 
LOK_CALLBACK_INVALIDATE_TILES);
 if (pos != m_queue1.rend())
 {
 auto pos2 = toQueue2(pos);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/source

2021-09-28 Thread Luboš Luňák (via logerrit)
 vcl/source/window/paint.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 3604738373198feb4c1c7a9ef82b6ea1579265d8
Author: Luboš Luňák 
AuthorDate: Fri Sep 24 11:47:30 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 13:51:12 2021 +0200

optimize out a bit of Invalidate() in LOK mode

Change-Id: I3c076e2506c9cade7e6bb874a2cddfa1ef0db6a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122641
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Luboš Luňák 

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index c7c3b7544937..8531ead70012 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1202,8 +1202,11 @@ void Window::Invalidate( const tools::Rectangle& rRect, 
InvalidateFlags nFlags )
 tools::Rectangle aRect = pOutDev->ImplLogicToDevicePixel( rRect );
 if ( !aRect.IsEmpty() )
 {
-vcl::Region aRegion( aRect );
-ImplInvalidate( &aRegion, nFlags );
+if (!comphelper::LibreOfficeKit::isActive())
+{   // ImplInvalidate() immediatelly returns in LOK mode, skip useless 
Region construction
+vcl::Region aRegion( aRect );
+ImplInvalidate( &aRegion, nFlags );
+}
 tools::Rectangle aLogicRectangle(rRect);
 LogicInvalidate(&aLogicRectangle);
 }


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sw/source

2021-09-28 Thread Luboš Luňák (via logerrit)
 sw/source/core/bastyp/swregion.cxx |   29 +++--
 1 file changed, 19 insertions(+), 10 deletions(-)

New commits:
commit 9817068cb35f76d63466277b41e8415b583d6c32
Author: Luboš Luňák 
AuthorDate: Fri Sep 24 13:17:34 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 13:51:40 2021 +0200

avoid repeated std::vector::erase() in SwRegionRects::Compress()

Change-Id: I5e646d2938dda7077e5e4ff40ab6caa847ac7a80
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122643
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Luboš Luňák 

diff --git a/sw/source/core/bastyp/swregion.cxx 
b/sw/source/core/bastyp/swregion.cxx
index 6a570bcdd091..06b810c20664 100644
--- a/sw/source/core/bastyp/swregion.cxx
+++ b/sw/source/core/bastyp/swregion.cxx
@@ -160,31 +160,35 @@ void SwRegionRects::Compress()
 {
 sort( begin(), end(), []( const SwRect& l, const SwRect& r ) { return 
l.Top() < r.Top(); } );
 bAgain = false;
+bool bRemoved = false;
 for (size_type i = 0; i < size(); ++i )
 {
+if( (*this)[i].IsEmpty())
+continue;
 // Rectangles are sorted by Y axis, so check only pairs of 
rectangles
 // that are possibly overlapping or adjacent or close enough to be 
grouped by the fuzzy
 // code below.
 const tools::Long nFuzzy = 1361513;
 const tools::Long yMax = (*this)[i].Bottom() + nFuzzy
 / std::max( 1, (*this)[i].Width());
-size_type j = i+1;
-while( j < size() && (*this)[j].Top() <= yMax )
-++j;
---j;
-// Walk backwards for simpler and faster erase().
-for ( ; j >= i+1; --j )
+for(size_type j = i+1; j < size(); ++j)
 {
+if( (*this)[j].IsEmpty())
+continue;
+if( (*this)[j].Top() > yMax )
+break;
 // If one rectangle contains a second completely than the 
latter
 // does not need to be stored and can be deleted
-if ( (*this)[i].IsInside( (*this)[j] ) )
+else if ( (*this)[i].IsInside( (*this)[j] ) )
 {
-erase( begin() + j );
+(*this)[j].Width(0); // = erase(), see below
+bRemoved = true;
 }
 else if ( (*this)[j].IsInside( (*this)[i] ) )
 {
 (*this)[i] = (*this)[j];
-erase( begin() + j );
+(*this)[j].Width(0);
+bRemoved = true;
 bAgain = true;
 }
 else
@@ -217,12 +221,17 @@ void SwRegionRects::Compress()
  (::CalcArea( aUnion ) - CalcArea( aInter )) )
 {
 (*this)[i] = aUnion;
-erase( begin() + j );
+(*this)[j].Width(0);
+bRemoved = true;
 bAgain = true;
 }
 }
 }
 }
+// Instead of repeated erase() we Width(0) the elements, and now erase
+// all empty elements just once.
+if( bRemoved )
+resize( std::remove_if(begin(), end(), [](const SwRect& rect) { 
return rect.IsEmpty(); }) - begin());
 // Code paths setting bAgain alter elements of the vector, possibly 
breaking
 // the Y-axis optimization, so run another pass just to make sure. The 
adjacent-rects
 // merging code may possibly benefit from a repeated pass also if two 
pairs of merged


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sw/CppunitTest_sw_uwriter.mk sw/inc sw/qa sw/source

2021-09-28 Thread Luboš Luňák (via logerrit)
 sw/CppunitTest_sw_uwriter.mk   |1 
 sw/inc/swregion.hxx|3 -
 sw/qa/core/test_region.cxx |  108 +
 sw/source/core/bastyp/swregion.cxx |   32 +++---
 sw/source/core/view/viewsh.cxx |4 -
 5 files changed, 124 insertions(+), 24 deletions(-)

New commits:
commit 6fef9f66f924a518b5e8290445d34536ed8c0678
Author: Luboš Luňák 
AuthorDate: Wed Sep 22 16:41:45 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 13:52:07 2021 +0200

add some unittests for SwRegionRects

And fix two small bugs in SwRegionRects::Compress().

Change-Id: I8df7cc2e9d4d6ca78e3af711639e3fbae2e471ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122462
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit 362d2271721dd19de7a7f6f2271a349272ce51d8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122639
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/CppunitTest_sw_uwriter.mk b/sw/CppunitTest_sw_uwriter.mk
index e6a490c5dff1..6507224393dc 100644
--- a/sw/CppunitTest_sw_uwriter.mk
+++ b/sw/CppunitTest_sw_uwriter.mk
@@ -20,6 +20,7 @@ $(eval $(call 
gb_CppunitTest_add_exception_objects,sw_uwriter, \
 sw/qa/core/test_ToxLinkProcessor \
 sw/qa/core/test_ToxTextGenerator \
 sw/qa/core/test_ToxMiscTest \
+sw/qa/core/test_region \
 ))
 
 $(eval $(call gb_CppunitTest_use_library_objects,sw_uwriter,sw))
diff --git a/sw/inc/swregion.hxx b/sw/inc/swregion.hxx
index 1aa190712a8f..338a30649c7a 100644
--- a/sw/inc/swregion.hxx
+++ b/sw/inc/swregion.hxx
@@ -55,8 +55,9 @@ public:
 // Ensures all rectangles are within the origin area.
 void LimitToOrigin();
 
+enum CompressType { CompressExact, CompressFuzzy };
 // Combine adjacent rectangles.
-void Compress();
+void Compress( CompressType type );
 
 const SwRect &GetOrigin() const { return m_aOrigin; }
 void ChangeOrigin( const SwRect &rRect ) { m_aOrigin = rRect; }
diff --git a/sw/qa/core/test_region.cxx b/sw/qa/core/test_region.cxx
new file mode 100644
index ..15fa398c7e4a
--- /dev/null
+++ b/sw/qa/core/test_region.cxx
@@ -0,0 +1,108 @@
+/* -*- 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/.
+ *
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+class RegionUnittest : public CppUnit::TestFixture
+{
+public:
+void testCompress();
+void testInvert();
+
+CPPUNIT_TEST_SUITE(RegionUnittest);
+CPPUNIT_TEST(testCompress);
+CPPUNIT_TEST(testInvert);
+CPPUNIT_TEST_SUITE_END();
+};
+
+void RegionUnittest::testCompress()
+{
+SwRegionRects region;
+
+// All inside each other, check it'll compress them to the largest one.
+region = SwRegionRects();
+region += SwRect(Point(10, 10), Size(10, 10));
+region += SwRect(Point(10, 10), Size(20, 20));
+region += SwRect(Point(10, 10), Size(100, 100));
+region += SwRect(Point(10, 10), Size(50, 50));
+region.Compress(SwRegionRects::CompressExact);
+CPPUNIT_ASSERT_EQUAL(size_t(1), region.size());
+CPPUNIT_ASSERT_EQUAL(SwRect(Point(10, 10), Size(100, 100)), region[0]);
+
+// Check merging of adjacent rectangles. This will merge first two groups
+// and then those two merged rects only in the next iteration.
+region = SwRegionRects();
+region += SwRect(Point(10, 10), Size(1, 1));
+region += SwRect(Point(10010, 10), Size(1, 1));
+region += SwRect(Point(10, 10010), Size(1, 1));
+region += SwRect(Point(10010, 10010), Size(1, 1));
+region.Compress(SwRegionRects::CompressExact);
+CPPUNIT_ASSERT_EQUAL(size_t(1), region.size());
+CPPUNIT_ASSERT_EQUAL(SwRect(Point(10, 10), Size(2, 2)), region[0]);
+
+// Check fuzzy compress, two almost aligned rects will be compressed to 
one.
+region = SwRegionRects();
+region += SwRect(Point(10, 10), Size(100, 100));
+region += SwRect(Point(110, 10), Size(100, 90));
+region.Compress(SwRegionRects::CompressExact);
+CPPUNIT_ASSERT_EQUAL(size_t(2), region.size());
+region.Compress(SwRegionRects::CompressFuzzy);
+CPPUNIT_ASSERT_EQUAL(size_t(1), region.size());
+CPPUNIT_ASSERT_EQUAL(SwRect(Point(10, 10), Size(200, 100)), region[0]);
+
+// Check it doesn't crash because of empty size.
+region = SwRegionRects();
+region += SwRect(Point(0, 0), Size(0, 0));
+region += SwRect(Point(10, 10), Size(0, 0));
+region += SwRect(Point(100, 100), Size(0, 0));
+region.Compress(SwRegionRects::CompressExact);
+region.Compress(SwRegionRects::CompressFuzzy);
+}
+
+void RegionUnittest::testInvert()
+{
+// Check that punching holes and inverting has 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - solenv/bin

2021-09-28 Thread Caolán McNamara (via logerrit)
 solenv/bin/native-code.py |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 8469533884c5a84f15205611bf327ae77bb0ecae
Author: Caolán McNamara 
AuthorDate: Tue Sep 28 12:15:24 2021 +0100
Commit: Tor Lillqvist 
CommitDate: Tue Sep 28 14:53:20 2021 +0300

com_sun_star_comp_svx_CharacterSpacingToolBoxControl is duplicated

com_sun_star_comp_svx_CharacterSpacingToolBoxControl_get_implementation
is already listed under svx/util/svx.component

Change-Id: I55fd0e2aff051b62b33d5b257ced8e934c9053d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122770
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 75835b6a2d31..ed9ed2e9ef9d 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -382,7 +382,6 @@ core_constructor_list = [
 # svx/util/svxcore.component
 "com_sun_star_comp_graphic_PrimitiveFactory2D_get_implementation",
 "com_sun_star_comp_Draw_GraphicExporter_get_implementation",
-"com_sun_star_comp_svx_CharacterSpacingToolBoxControl_get_implementation",
 "com_sun_star_comp_svx_ColorToolBoxControl_get_implementation",
 "com_sun_star_comp_svx_FontNameToolBoxControl_get_implementation",
 "com_sun_star_comp_svx_FrameToolBoxControl_get_implementation",


[Libreoffice-commits] core.git: desktop/inc desktop/source

2021-09-28 Thread Luboš Luňák (via logerrit)
 desktop/inc/lib/init.hxx|9 +
 desktop/source/lib/init.cxx |   26 ++
 2 files changed, 31 insertions(+), 4 deletions(-)

New commits:
commit 6552ec19d1920a0c4ab074b4a16afc0fe39296f3
Author: Luboš Luňák 
AuthorDate: Fri Sep 24 00:11:04 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 14:01:07 2021 +0200

add extra timeout with higher priority to LOK flushing

The normal idle has TaskPriority::POST_PAINT, which means that
if we get too busy, the idle won't be called for a long time,
meaning the queue will get longer and longer, making its processing
slower, and client interactivity will be very poor, with updates
possibly coming only when everything becomes idle.

The second timeout will flush the queue after a reasonable timeout.
I don't think there's an optimal value, so let's choose 100ms for now.

Change-Id: Ia1312a690aefd2c8628c82e0f42b2993802d8b1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122728
Tested-by: Luboš Luňák 
Reviewed-by: Luboš Luňák 

diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
index 2693e67eb718..95468b494189 100644
--- a/desktop/inc/lib/init.hxx
+++ b/desktop/inc/lib/init.hxx
@@ -147,6 +147,15 @@ namespace desktop {
 void *m_pData;
 int m_nDisableCallbacks;
 std::mutex m_mutex;
+class TimeoutIdle : public Timer
+{
+public:
+TimeoutIdle( CallbackFlushHandler* handler );
+virtual void Invoke() override;
+private:
+CallbackFlushHandler* mHandler;
+};
+TimeoutIdle m_TimeoutIdle;
 };
 
 struct DESKTOP_DLLPUBLIC LibLODocument_Impl : public 
_LibreOfficeKitDocument
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9274be462370..15c0eb281a38 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1386,12 +1386,28 @@ static OUString getGenerator()
 
 extern "C" {
 
+CallbackFlushHandler::TimeoutIdle::TimeoutIdle( CallbackFlushHandler* handler )
+: Timer( "lokit timer callback" )
+, mHandler( handler )
+{
+// A second timer with higher priority, it'll ensure we flush in 
reasonable time if we get too busy
+// to get POST_PAINT priority processing. Otherwise it could take a long 
time to flush.
+SetPriority(TaskPriority::DEFAULT);
+SetTimeout( 100 ); // 100 ms
+}
+
+void CallbackFlushHandler::TimeoutIdle::Invoke()
+{
+mHandler->Invoke();
+}
+
 CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, 
LibreOfficeKitCallback pCallback, void* pData)
-: Idle( "lokit timer callback" ),
+: Idle( "lokit idle callback" ),
   m_pDocument(pDocument),
   m_pCallback(pCallback),
   m_pData(pData),
-  m_nDisableCallbacks(0)
+  m_nDisableCallbacks(0),
+  m_TimeoutIdle( this )
 {
 SetPriority(TaskPriority::POST_PAINT);
 
@@ -1408,8 +1424,6 @@ 
CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, Li
 m_states.emplace(LOK_CALLBACK_CURSOR_VISIBLE, "NIL");
 m_states.emplace(LOK_CALLBACK_SET_PART, "NIL");
 m_states.emplace(LOK_CALLBACK_TABLE_SELECTED, "NIL");
-
-Start();
 }
 
 CallbackFlushHandler::~CallbackFlushHandler()
@@ -1690,6 +1704,8 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 {
 Start();
 }
+if (!m_TimeoutIdle.IsActive())
+m_TimeoutIdle.Start();
 }
 
 bool CallbackFlushHandler::processInvalidateTilesEvent(int type, CallbackData& 
aCallbackData)
@@ -2053,6 +2069,8 @@ void CallbackFlushHandler::Invoke()
 
 m_queue1.clear();
 m_queue2.clear();
+Stop();
+m_TimeoutIdle.Stop();
 }
 
 bool CallbackFlushHandler::removeAll(int type)


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - desktop/inc desktop/source

2021-09-28 Thread Luboš Luňák (via logerrit)
 desktop/inc/lib/init.hxx|9 +
 desktop/source/lib/init.cxx |   26 ++
 2 files changed, 31 insertions(+), 4 deletions(-)

New commits:
commit 3f6f1a45c1f4225817188f97721e6546e38871e2
Author: Luboš Luňák 
AuthorDate: Fri Sep 24 00:11:04 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 14:01:25 2021 +0200

add extra timeout with higher priority to LOK flushing

The normal idle has TaskPriority::POST_PAINT, which means that
if we get too busy, the idle won't be called for a long time,
meaning the queue will get longer and longer, making its processing
slower, and client interactivity will be very poor, with updates
possibly coming only when everything becomes idle.

The second timeout will flush the queue after a reasonable timeout.
I don't think there's an optimal value, so let's choose 100ms for now.

Change-Id: Ia1312a690aefd2c8628c82e0f42b2993802d8b1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122737
Tested-by: Luboš Luňák 
Reviewed-by: Luboš Luňák 

diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
index 6cbabd3b..eee6b0fb4d76 100644
--- a/desktop/inc/lib/init.hxx
+++ b/desktop/inc/lib/init.hxx
@@ -146,6 +146,15 @@ namespace desktop {
 void *m_pData;
 int m_nDisableCallbacks;
 std::mutex m_mutex;
+class TimeoutIdle : public Timer
+{
+public:
+TimeoutIdle( CallbackFlushHandler* handler );
+virtual void Invoke() override;
+private:
+CallbackFlushHandler* mHandler;
+};
+TimeoutIdle m_TimeoutIdle;
 };
 
 struct DESKTOP_DLLPUBLIC LibLODocument_Impl : public 
_LibreOfficeKitDocument
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 824f45b5d23f..3e09f2d8b5ab 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1392,12 +1392,28 @@ static OUString getGenerator()
 
 extern "C" {
 
+CallbackFlushHandler::TimeoutIdle::TimeoutIdle( CallbackFlushHandler* handler )
+: Timer( "lokit timer callback" )
+, mHandler( handler )
+{
+// A second timer with higher priority, it'll ensure we flush in 
reasonable time if we get too busy
+// to get POST_PAINT priority processing. Otherwise it could take a long 
time to flush.
+SetPriority(TaskPriority::DEFAULT);
+SetTimeout( 100 ); // 100 ms
+}
+
+void CallbackFlushHandler::TimeoutIdle::Invoke()
+{
+mHandler->Invoke();
+}
+
 CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, 
LibreOfficeKitCallback pCallback, void* pData)
-: Idle( "lokit timer callback" ),
+: Idle( "lokit idle callback" ),
   m_pDocument(pDocument),
   m_pCallback(pCallback),
   m_pData(pData),
-  m_nDisableCallbacks(0)
+  m_nDisableCallbacks(0),
+  m_TimeoutIdle( this )
 {
 SetPriority(TaskPriority::POST_PAINT);
 
@@ -1414,8 +1430,6 @@ 
CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, Li
 m_states.emplace(LOK_CALLBACK_CURSOR_VISIBLE, "NIL");
 m_states.emplace(LOK_CALLBACK_SET_PART, "NIL");
 m_states.emplace(LOK_CALLBACK_TABLE_SELECTED, "NIL");
-
-Start();
 }
 
 CallbackFlushHandler::~CallbackFlushHandler()
@@ -1696,6 +1710,8 @@ void CallbackFlushHandler::queue(const int type, const 
char* data)
 {
 Start();
 }
+if (!m_TimeoutIdle.IsActive())
+m_TimeoutIdle.Start();
 }
 
 bool CallbackFlushHandler::processInvalidateTilesEvent(int type, CallbackData& 
aCallbackData)
@@ -2059,6 +2075,8 @@ void CallbackFlushHandler::Invoke()
 
 m_queue1.clear();
 m_queue2.clear();
+Stop();
+m_TimeoutIdle.Stop();
 }
 
 bool CallbackFlushHandler::removeAll(int type)


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - extensions/source

2021-09-28 Thread Julien Nabet (via logerrit)
 extensions/source/update/check/updatehdl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 140fa0023eec1b8bfcd68394c4395a473c666057
Author: Julien Nabet 
AuthorDate: Sun Sep 26 10:19:55 2021 +0200
Commit: Michael Stahl 
CommitDate: Tue Sep 28 14:09:38 2021 +0200

tdf#50421: use substVariables for remaining %PERCENT% in "Check for Updates"

Change-Id: I9e1094ef9a957ca1524367f985f37ffc0da5b353
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122621
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
(cherry picked from commit 501929557800e400c9ee07d25687ee60354d74c2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122733
Reviewed-by: Michael Stahl 

diff --git a/extensions/source/update/check/updatehdl.cxx 
b/extensions/source/update/check/updatehdl.cxx
index e2d95bc8e84e..268fe4661f9c 100644
--- a/extensions/source/update/check/updatehdl.cxx
+++ b/extensions/source/update/check/updatehdl.cxx
@@ -1071,7 +1071,7 @@ void UpdateHandler::createDialog()
 {   // Text (edit) 
 uno::Sequence< beans::NamedValue > aProps
 {
-{ "Text", uno::Any( msPercent ) },
+{ "Text", uno::Any( substVariables(msPercent) ) },
 { "Border", uno::Any( sal_Int16( 0 ) ) },
 { "PaintTransparent", uno::Any( true ) },
 { "ReadOnly", uno::Any( true ) },


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/qa sc/source

2021-09-28 Thread Mike Kaganski (via logerrit)
 sc/qa/unit/data/xls/tdf144732.xls   |binary
 sc/qa/unit/subsequent_filters-test2.cxx |  103 
 sc/source/filter/excel/impop.cxx|6 -
 3 files changed, 105 insertions(+), 4 deletions(-)

New commits:
commit a3010249f185b8d2b7ade2cbf10600255bb935fb
Author: Mike Kaganski 
AuthorDate: Mon Sep 27 17:05:25 2021 +0200
Commit: Michael Stahl 
CommitDate: Tue Sep 28 14:12:53 2021 +0200

tdf#144732: treat invalid subtype value as worksheet

Commit 9bdb1d2473510067da1ac74013595b661ac37800 for
i51490 had introduced the same change for Bof2, Bof3, Bof4.

Change-Id: I478a8611874d70fad0c83700efed5ea882d5f69f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122650
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122758
Reviewed-by: Michael Stahl 

diff --git a/sc/qa/unit/data/xls/tdf144732.xls 
b/sc/qa/unit/data/xls/tdf144732.xls
new file mode 100644
index ..04f3cc0d12bf
Binary files /dev/null and b/sc/qa/unit/data/xls/tdf144732.xls differ
diff --git a/sc/qa/unit/subsequent_filters-test2.cxx 
b/sc/qa/unit/subsequent_filters-test2.cxx
index 4b4995f9147c..9c15eebfff0a 100644
--- a/sc/qa/unit/subsequent_filters-test2.cxx
+++ b/sc/qa/unit/subsequent_filters-test2.cxx
@@ -206,6 +206,7 @@ public:
 void testTdf129940();
 void testTdf139763ShapeAnchor();
 void testAutofilterNamedRangesXLSX();
+void testInvalidBareBiff5();
 
 CPPUNIT_TEST_SUITE(ScFiltersTest2);
 
@@ -311,6 +312,7 @@ public:
 CPPUNIT_TEST(testTdf129940);
 CPPUNIT_TEST(testTdf139763ShapeAnchor);
 CPPUNIT_TEST(testAutofilterNamedRangesXLSX);
+CPPUNIT_TEST(testInvalidBareBiff5);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -2875,6 +2877,107 @@ void ScFiltersTest2::testAutofilterNamedRangesXLSX()
 xDocSh->DoClose();
 }
 
+void ScFiltersTest2::testInvalidBareBiff5()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf144732.", FORMAT_XLS);
+CPPUNIT_ASSERT(xDocSh.is());
+ScDocument& rDoc = xDocSh->GetDocument();
+rDoc.CalcAll();
+
+// Check that we import the contents from such file, as Excel does
+CPPUNIT_ASSERT_EQUAL(SCTAB(1), rDoc.GetTableCount());
+
+// Row 1
+ScAddress aPos(0, 0, 0);
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_VALUE, rDoc.GetCellType(aPos));
+CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(aPos));
+aPos.IncCol();
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_VALUE, rDoc.GetCellType(aPos));
+CPPUNIT_ASSERT_EQUAL(2.0, rDoc.GetValue(aPos));
+aPos.IncCol();
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_VALUE, rDoc.GetCellType(aPos));
+CPPUNIT_ASSERT_EQUAL(3.0, rDoc.GetValue(aPos));
+aPos.IncCol();
+CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetString(aPos));
+
+// Row 2
+aPos = ScAddress(0, 1, 0);
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_FORMULA, rDoc.GetCellType(aPos));
+OUString sFormula;
+rDoc.GetFormula(aPos.Col(), aPos.Row(), aPos.Tab(), sFormula);
+CPPUNIT_ASSERT_EQUAL(OUString("=TRUE()"), sFormula);
+CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(aPos));
+aPos.IncCol();
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_FORMULA, rDoc.GetCellType(aPos));
+rDoc.GetFormula(aPos.Col(), aPos.Row(), aPos.Tab(), sFormula);
+CPPUNIT_ASSERT_EQUAL(OUString("=FALSE()"), sFormula);
+CPPUNIT_ASSERT_EQUAL(0.0, rDoc.GetValue(aPos));
+aPos.IncCol();
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_NONE, rDoc.GetCellType(aPos));
+CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetString(aPos));
+aPos.IncCol();
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, rDoc.GetCellType(aPos));
+CPPUNIT_ASSERT_EQUAL(OUString(u"sheetjs"), rDoc.GetString(aPos));
+
+// Row 3
+aPos = ScAddress(0, 2, 0);
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, rDoc.GetCellType(aPos));
+CPPUNIT_ASSERT_EQUAL(OUString(u"foobar"), rDoc.GetString(aPos));
+aPos.IncCol();
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, rDoc.GetCellType(aPos));
+CPPUNIT_ASSERT_EQUAL(OUString(u"baz"), rDoc.GetString(aPos));
+aPos.IncCol();
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_VALUE, rDoc.GetCellType(aPos));
+CPPUNIT_ASSERT_EQUAL(41689.4375, rDoc.GetValue(aPos));
+aPos.IncCol();
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, rDoc.GetCellType(aPos));
+CPPUNIT_ASSERT_EQUAL(OUString(u"0.3"), rDoc.GetString(aPos));
+
+// Row 4
+aPos = ScAddress(0, 3, 0);
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, rDoc.GetCellType(aPos));
+CPPUNIT_ASSERT_EQUAL(OUString(u"baz"), rDoc.GetString(aPos));
+aPos.IncCol();
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_NONE, rDoc.GetCellType(aPos));
+CPPUNIT_ASSERT_EQUAL(OUString(), rDoc.GetString(aPos));
+aPos.IncCol();
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_STRING, rDoc.GetCellType(aPos));
+CPPUNIT_ASSERT_EQUAL(OUString(u"_"), rDoc.GetString(aPos));
+aPos.IncCol();
+CPPUNIT_ASSERT_EQUAL(CELLTYPE_VALUE, rDoc.GetCellType(aPos));
+CPPUNIT_ASSERT_EQUAL(3.14159, rDoc.GetValue(aPos));
+
+// Row 5
+aPos = ScAddress(0

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/qa sc/source

2021-09-28 Thread Daniel Arato (NISZ) (via logerrit)
 sc/qa/unit/data/ods/header-footer-content.ods |binary
 sc/qa/unit/subsequent_export-test2.cxx|   36 ++
 sc/source/filter/xml/XMLTableMasterPageExport.cxx |2 -
 3 files changed, 37 insertions(+), 1 deletion(-)

New commits:
commit ccd1393611ff7ea71d2dc5d75b0c27a4794ebdbb
Author: Daniel Arato (NISZ) 
AuthorDate: Wed Sep 22 15:03:48 2021 +0200
Commit: Michael Stahl 
CommitDate: Tue Sep 28 14:18:50 2021 +0200

tdf#144184 sc: fix first page footer export

Due to a typical case of copy-paste oversight LO Calc used to lose
the first page footer when exporting to ODS. With the typo fixed,
the export now works again.

Follow-up to commit 19fa853ce12136b5c14e0c5a0aa906c296b75388
"tdf#121715 XLSX: support custom first page header/footer".

Change-Id: If8f5ab4ff9a9392768789b886218d1d9c56ddbae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122455
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/+/122764
Tested-by: Jenkins

diff --git a/sc/qa/unit/data/ods/header-footer-content.ods 
b/sc/qa/unit/data/ods/header-footer-content.ods
new file mode 100644
index ..f365748ddc22
Binary files /dev/null and b/sc/qa/unit/data/ods/header-footer-content.ods 
differ
diff --git a/sc/qa/unit/subsequent_export-test2.cxx 
b/sc/qa/unit/subsequent_export-test2.cxx
index dde758e2bd5b..dc72c46aebf4 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit/subsequent_export-test2.cxx
@@ -82,6 +82,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -125,6 +126,7 @@ public:
 void testRefStringConfigXLSX();
 void testRefStringUnspecified();
 void testHeaderImageODS();
+void testHeaderFooterContentODS();
 
 void testTdf88657ODS();
 void testTdf41722();
@@ -227,6 +229,7 @@ public:
 CPPUNIT_TEST(testRefStringConfigXLSX);
 CPPUNIT_TEST(testRefStringUnspecified);
 CPPUNIT_TEST(testHeaderImageODS);
+CPPUNIT_TEST(testHeaderFooterContentODS);
 
 CPPUNIT_TEST(testTdf88657ODS);
 CPPUNIT_TEST(testTdf41722);
@@ -474,6 +477,39 @@ void ScExportTest2::testHeaderImageODS()
 xDocSh->DoClose();
 }
 
+void ScExportTest2::testHeaderFooterContentODS()
+{
+ScDocShellRef xShell = loadDoc(u"header-footer-content.", FORMAT_ODS);
+ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_ODS);
+uno::Reference 
xStyleFamiliesSupplier(xDocSh->GetModel(),
+ 
uno::UNO_QUERY);
+uno::Reference xStyleFamilies
+= xStyleFamiliesSupplier->getStyleFamilies();
+uno::Reference 
xPageStyles(xStyleFamilies->getByName("PageStyles"),
+   uno::UNO_QUERY);
+uno::Reference 
xStyle(xPageStyles->getByName("Default"), uno::UNO_QUERY);
+
+uno::Reference xContent;
+xStyle->getPropertyValue("RightPageHeaderContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("header"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("FirstPageHeaderContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("first page header"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("RightPageFooterContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("footer"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("FirstPageFooterContent") >>= xContent;
+// First page footer content used to be lost upon export.
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("first page footer"), 
xContent->getCenterText()->getString());
+
+xDocSh->DoClose();
+}
+
 void ScExportTest2::testTextDirectionXLSX()
 {
 ScDocShellRef xDocSh = loadDoc(u"writingMode.", FORMAT_XLSX);
diff --git a/sc/source/filter/xml/XMLTableMasterPageExport.cxx 
b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
index bf43b2c29fb2..59b29378ea16 100644
--- a/sc/source/filter/xml/XMLTableMasterPageExport.cxx
+++ b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
@@ -187,7 +187,7 @@ void XMLTableMasterPageExport::exportMasterPageContent(
 
 bool bFirstFooter = (!::cppu::any2bool(rPropSet->getPropertyValue( 
SC_UNO_PAGE_FIRSTFTRSHARED )) && bFooter);
 
-exportHeaderFooter( xFooterLeft, XML_FOOTER_FIRST, bFirstFooter );
+exportHeaderFooter( xFooterFirst, XML_FOOTER_FIRST, bFirstFooter );
 }
 }
 


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sw/source

2021-09-28 Thread Caolán McNamara (via logerrit)
 sw/source/filter/xml/wrtxml.cxx |   19 +++
 sw/source/filter/xml/wrtxml.hxx |2 +-
 sw/source/filter/xml/xmlexp.cxx |   39 +++
 3 files changed, 51 insertions(+), 9 deletions(-)

New commits:
commit 83876642498b0203b25b8b95e612603d46addd62
Author: Caolán McNamara 
AuthorDate: Tue Sep 28 10:23:29 2021 +0100
Commit: Michael Stahl 
CommitDate: Tue Sep 28 14:28:14 2021 +0200

tdf#144532 closing mail merge wizard preview removed document's data source

Filter out the "EmbeddedDatabaseName" property from the document
settings on saving document that will be loaded by the mail merge
preview so that when the temp mailmerge preview document is closed it
doesn't unregister the database of the same name which was registered by
the document this is a copy of.

This looks like a similar problem to tdf#118634 addressed by:
commit edc62adae9a354ca1305e83b10c98a545f58d341
Date:   Mon Jul 9 19:49:34 2018 +1000

tdf#118634: Don't save embedded data source to a temporary preview 
document

Change-Id: I3fecc2ace1c9e06354b145609f0130dbbb2c036b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122767
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index be2a21aeeefa..da1d344b6ce6 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -80,8 +80,8 @@ SwXMLWriter::~SwXMLWriter()
 {
 }
 
-ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& 
xStatusIndicator,
-const OUString& aDocHierarchicalName )
+ErrCode SwXMLWriter::Write_(const uno::Reference < task::XStatusIndicator >& 
xStatusIndicator,
+const OUString& aDocHierarchicalName, bool 
bNoEmbDS)
 {
 // Get service factory
 uno::Reference< uno::XComponentContext > xContext =
@@ -159,6 +159,10 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < 
task::XStatusIndicator >& xS
   beans::PropertyAttribute::MAYBEVOID, 0 },
 { OUString("TargetStorage"),0, cppu::UnoType::get(),
   css::beans::PropertyAttribute::MAYBEVOID, 0 },
+// tdf#144532
+{ OUString("NoEmbDataSet"), 0,
+  cppu::UnoType::get(),
+  beans::PropertyAttribute::MAYBEVOID, 0 },
 { OUString(), 0, css::uno::Type(), 0, 0 }
 };
 uno::Reference< beans::XPropertySet > xInfoSet(
@@ -167,6 +171,8 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < 
task::XStatusIndicator >& xS
 
 xInfoSet->setPropertyValue( "TargetStorage", Any( m_xStg ) );
 
+xInfoSet->setPropertyValue("NoEmbDataSet", makeAny(bNoEmbDS));
+
 if (m_bShowProgress)
 {
 // set progress range and start status indicator
@@ -441,13 +447,15 @@ ErrCode SwXMLWriter::Write_( const uno::Reference < 
task::XStatusIndicator >& xS
 
 ErrCode SwXMLWriter::WriteStorage()
 {
-return Write_( uno::Reference < task::XStatusIndicator >(), OUString() );
+return Write_(uno::Reference(), OUString(), false);
 }
 
 ErrCode SwXMLWriter::WriteMedium( SfxMedium& aTargetMedium )
 {
 uno::Reference < task::XStatusIndicator > xStatusIndicator;
 OUString aName;
+bool bNoEmbDS(false);
+
 const SfxUnoAnyItem* pStatusBarItem = static_cast(
aTargetMedium.GetItemSet()->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) );
 if ( pStatusBarItem )
@@ -456,8 +464,11 @@ ErrCode SwXMLWriter::WriteMedium( SfxMedium& aTargetMedium 
)
 aTargetMedium.GetItemSet()->GetItem(SID_DOC_HIERARCHICALNAME) );
 if ( pDocHierarchItem )
 aName = pDocHierarchItem->GetValue();
+const SfxBoolItem* pNoEmbDS = 
SfxItemSet::GetItem(aTargetMedium.GetItemSet(), SID_NO_EMBEDDED_DS, false);
+if (pNoEmbDS)
+bNoEmbDS = pNoEmbDS->GetValue();
 
-return Write_( xStatusIndicator, aName );
+return Write_(xStatusIndicator, aName, bNoEmbDS);
 }
 
 ErrCode SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed,
diff --git a/sw/source/filter/xml/wrtxml.hxx b/sw/source/filter/xml/wrtxml.hxx
index c82afcc97436..7e4ed6580c15 100644
--- a/sw/source/filter/xml/wrtxml.hxx
+++ b/sw/source/filter/xml/wrtxml.hxx
@@ -40,7 +40,7 @@ namespace com::sun::star {
 
 class SwXMLWriter : public StgWriter
 {
-ErrCode Write_( const css::uno::Reference < css::task::XStatusIndicator>&, 
const OUString&  );
+ErrCode Write_(const css::uno::Reference < css::task::XStatusIndicator>&, 
const OUString&, bool bNoEmbDS);
 
 using StgWriter::Write;
 
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 3ed4a25570d6..6017bc2f1e59 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -385,12 +385,43 @@ void 
SwXMLExport::GetViewSettings(Sequence& aProps)
 void SwXMLExport::GetConfigurationSettings( Sequence < PropertyValue >& rProps)
 {
 Reference< XMultiServiceFactory > xFac( GetMod

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - vcl/source

2021-09-28 Thread Szymon Kłos (via logerrit)
 vcl/source/control/tabctrl.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e14febcf8f70713ad30c768cfd1d775de6c30a2d
Author: Szymon Kłos 
AuthorDate: Mon Sep 27 15:37:59 2021 +0200
Commit: Szymon Kłos 
CommitDate: Tue Sep 28 14:55:09 2021 +0200

jsdialog: dump tabs as array

Change-Id: I187ea81c7b51f67aaa8d67b59aa5fcb5a4229941
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122711
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index bab7684c2f31..0918ef6028b9 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -2183,10 +2183,10 @@ void TabControl::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
 {
 Control::DumpAsPropertyTree(rJsonWriter);
 {
-auto tabsNode = rJsonWriter.startNode("tabs");
+auto tabsNode = rJsonWriter.startArray("tabs");
 for(auto id : GetPageIDs())
 {
-auto tabNode = rJsonWriter.startNode("");
+auto tabNode = rJsonWriter.startStruct();
 rJsonWriter.put("text", GetPageText(id));
 rJsonWriter.put("id", id);
 rJsonWriter.put("name", GetPageName(id));


[Libreoffice-commits] core.git: sfx2/source

2021-09-28 Thread Noel Grandin (via logerrit)
 sfx2/source/notify/globalevents.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 78485eb52d1f10a6ba0314370288f7e747e0ec53
Author: Noel Grandin 
AuthorDate: Tue Sep 28 13:06:37 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 28 15:11:40 2021 +0200

fix deadlock on exit

regression from
commit 8122c82d90117fc0c4c8ea87aa7f771d5e92bf36
osl::Mutex->std::mutex in SfxGlobalEvents_Imp

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

diff --git a/sfx2/source/notify/globalevents.cxx 
b/sfx2/source/notify/globalevents.cxx
index 3982fbecdb33..71fdd8a70aae 100644
--- a/sfx2/source/notify/globalevents.cxx
+++ b/sfx2/source/notify/globalevents.cxx
@@ -243,11 +243,17 @@ void SfxGlobalEvents_Impl::dispose() {
 std::multiset> listeners;
 {
 std::unique_lock g(m_aLock);
-m_xEvents.clear();
+if (m_disposed)
+return;
+m_disposed = true;
+auto tmp = std::move(m_xEvents);
 m_xJobExecutorListener.clear();
 m_disposeListeners.swap(listeners);
 m_lModels.clear();
-m_disposed = true;
+g.unlock();
+// clear events outside lock because it will trigger a call back into 
us
+tmp.clear();
+g.lock();
 m_aLegacyListeners.disposeAndClear(g, {static_cast(this)});
 g.lock(); // because disposeAndClear is going to want to unlock()
 m_aDocumentListeners.disposeAndClear(g, {static_cast(this)});


[Libreoffice-commits] help.git: source/text

2021-09-28 Thread Olivier Hallot (via logerrit)
 source/text/sdatabase/dabaadvpropdat.xhp |  228 ---
 1 file changed, 125 insertions(+), 103 deletions(-)

New commits:
commit 7a89e385e842191c215e407541a96343fbb5dc97
Author: Olivier Hallot 
AuthorDate: Mon Sep 27 12:40:41 2021 -0300
Commit: Olivier Hallot 
CommitDate: Tue Sep 28 15:22:59 2021 +0200

tdf#144712 Database Advanced Settings: Help Inconsistent

Update and fix order of the dialog settings
Add missing settings entries in Help page

Change-Id: Ia763d1e63f286fa819fb6eadc820e788e371e921
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/122718
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/source/text/sdatabase/dabaadvpropdat.xhp 
b/source/text/sdatabase/dabaadvpropdat.xhp
index 0a0e98f94..bfe2fa07b 100644
--- a/source/text/sdatabase/dabaadvpropdat.xhp
+++ b/source/text/sdatabase/dabaadvpropdat.xhp
@@ -1,108 +1,130 @@
 
 
 
-
-
-  
- Special Settings
- /text/sdatabase/dabaadvpropdat.xhp
-  
-   
-   
- 
- 
- 
- database;special settings
- database settings;SQL92 naming
- database settings;keyword AS
- database settings;outer join syntax
- database settings;special SELECT 
statements
- database settings;ODBC date/time
- database settings;support primary 
keys
- database settings;line ends
- database settings;version columns
- 
-  
- Special Settings
- Specifies the way you can work with data in a 
database.
-  
-  
- In a 
database window, choose Edit - Database - Advanced Settings
- 
-  
-  The 
availability of the following controls depends on the type of 
database:
-  Use SQL92 naming constraintsUFI: found 
this for dBase and for text file folder
-  Only allows characters that conform to the SQL92 naming convention in a 
name in a data source. All other characters are rejected. Each name must begin 
with a lowercase letter, an uppercase letter, or an underscore ( _ ). The 
remaining characters can be ASCII letters, numbers, and 
underscores.
-  
-  Use keyword AS before table alias names
-  Some databases use the keyword "AS" between a name and its alias, while 
other databases use a whitespace. Enable this option to insert AS before the 
alias.http://dba.openoffice.org/specifications/Data_Source_Property_Dialog.sxw
-
-  
-End text lines with CR + LFUFI: found for dBase 
and text file folder
-  Select to use the CR + LF code pair to end every text line (preferred 
for DOS and Windows operating systems).
-
-Append the table alias name in SELECT statements
-  Appends the alias to the table name in SELECT 
statements.
-
-Use Outer Join syntax '{OJ }'
-  Use escape sequences for outer joins. The syntax for this escape 
sequence is {oj outer-join}copied from 
shared\explorer\database\02010100.xhp
-  Example:
-  select 
Article.* from {oj item LEFT OUTER JOIN orders ON 
item.no=orders.ANR}
-
-Ignore the privileges from the database driver
-  Ignores access privileges that are provided by the database 
driver.
-
-Replace named parameters with ?
-  Replaces named parameters in a data source with a question mark 
(?).
-
-Display version columns (when available)
-  Some 
databases assign version numbers to fields to track changes to records. The 
version number of a field is incremented by one each time the contents of the 
field are changed. Displays the internal version 
number of the record in the database table.copied from 
shared\explorer\database\1109.xhp
-
-Use the catalog name in SELECT statements
-  Uses the current data source of the catalog. This option is useful when 
the ODBC data source is a database server. Do not select this option if the 
ODBC data source is a dBASE driver.copie from 
shared\explorer\database\1102.xhp
-
-Use the schema name in SELECT statements
-  Allows you to use the schema name in SELECT 
statements.UFI: ???
-
-Create index with ASC or DESC statement
-  Creates an index with ASC or DESC statements.UFI: 
???
-
-Comparison of Boolean values
-  Select the type of Boolean comparison that you want to 
use.UFI: ???
-
-Form data input checks for required 
fieldsi82291
-  When you enter a new record or update an existing record in a form, and 
you leave a field empty which is bound to a database column which requires 
input, then you will see a message complaining about the empty 
field.
-  If this 
control box is not enabled, then the forms in the current database will not be 
checked for required fields.
-  The 
control box is available for all data source types which support write access 
to their data. The control box does not exist for spreadsheets, text, csv, and 
the various read-only address books.
-
-  Ignore currency field information
-  Only for Oracle JDBC connections. When enabled 
it specifies that no column is treat

[Libreoffice-commits] core.git: helpcontent2

2021-09-28 Thread Olivier Hallot (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 95a16f0104a9e9722937d5b2c4db45388d7a58a9
Author: Olivier Hallot 
AuthorDate: Tue Sep 28 10:23:01 2021 -0300
Commit: Gerrit Code Review 
CommitDate: Tue Sep 28 15:23:01 2021 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 7a89e385e842191c215e407541a96343fbb5dc97
  - tdf#144712 Database Advanced Settings: Help Inconsistent

Update and fix order of the dialog settings
Add missing settings entries in Help page

Change-Id: Ia763d1e63f286fa819fb6eadc820e788e371e921
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/122718
Tested-by: Jenkins
Reviewed-by: Olivier Hallot 

diff --git a/helpcontent2 b/helpcontent2
index 4e6211e98f0f..7a89e385e842 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 4e6211e98f0f4000477ecee0783522603b3caad8
+Subproject commit 7a89e385e842191c215e407541a96343fbb5dc97


[Libreoffice-commits] core.git: sc/qa

2021-09-28 Thread Xisco Fauli (via logerrit)
 sc/qa/unit/data/ods/tdf144740.ods   |binary
 sc/qa/unit/subsequent_filters_test2.cxx |   16 
 2 files changed, 16 insertions(+)

New commits:
commit e5d086c31e6765430f8c366196fb4a2b0c25924d
Author: Xisco Fauli 
AuthorDate: Tue Sep 28 11:41:42 2021 +0200
Commit: Xisco Fauli 
CommitDate: Tue Sep 28 15:25:11 2021 +0200

tdf#144740: sc_subsequent_filters_test2: Add unittest

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

diff --git a/sc/qa/unit/data/ods/tdf144740.ods 
b/sc/qa/unit/data/ods/tdf144740.ods
new file mode 100644
index ..5c9f7c2b0e8b
Binary files /dev/null and b/sc/qa/unit/data/ods/tdf144740.ods differ
diff --git a/sc/qa/unit/subsequent_filters_test2.cxx 
b/sc/qa/unit/subsequent_filters_test2.cxx
index 4803e19cbab8..840bf5042e65 100644
--- a/sc/qa/unit/subsequent_filters_test2.cxx
+++ b/sc/qa/unit/subsequent_filters_test2.cxx
@@ -205,6 +205,7 @@ public:
 void testDrawCircleInMergeCells();
 void testDeleteCirclesInRowAndCol();
 void testTdf129940();
+void testTdf144740();
 void testTdf139763ShapeAnchor();
 void testAutofilterNamedRangesXLSX();
 void testInvalidBareBiff5();
@@ -312,6 +313,7 @@ public:
 CPPUNIT_TEST(testDrawCircleInMergeCells);
 CPPUNIT_TEST(testDeleteCirclesInRowAndCol);
 CPPUNIT_TEST(testTdf129940);
+CPPUNIT_TEST(testTdf144740);
 CPPUNIT_TEST(testTdf139763ShapeAnchor);
 CPPUNIT_TEST(testAutofilterNamedRangesXLSX);
 CPPUNIT_TEST(testInvalidBareBiff5);
@@ -2845,6 +2847,20 @@ void ScFiltersTest2::testTdf129940()
 xDocSh->DoClose();
 }
 
+void ScFiltersTest2::testTdf144740()
+{
+ScDocShellRef xDocSh = loadDoc(u"tdf144740.", FORMAT_ODS);
+CPPUNIT_ASSERT_MESSAGE("Failed to load tdf144740.ods", xDocSh.is());
+ScDocument& rDoc = xDocSh->GetDocument();
+
+// Without the fix in place, this test would have failed with
+// - Expected: 1
+// - Actual  : 2
+CPPUNIT_ASSERT_EQUAL(1.0, rDoc.GetValue(ScAddress(1, 0, 0)));
+
+xDocSh->DoClose();
+}
+
 void ScFiltersTest2::testTdf139763ShapeAnchor()
 {
 ScDocShellRef xDocSh = loadDoc(u"tdf139763ShapeAnchor.", FORMAT_XLSX);


[Libreoffice-commits] core.git: vcl/unx

2021-09-28 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   26 --
 1 file changed, 24 insertions(+), 2 deletions(-)

New commits:
commit a0f6d3865dd113f38fd3aa673075e9fecd06f3cd
Author: Caolán McNamara 
AuthorDate: Tue Sep 28 12:10:33 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 28 16:42:18 2021 +0200

tdf#144139 don't crash when OutputDevice is a printer

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 36ea3f96fa27..7782205fde56 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -4358,7 +4358,19 @@ public:
 
 VclPtr 
xOutput(VclPtr::Create(DeviceFormat::DEFAULT));
 xOutput->SetOutputSizePixel(aSize);
-xOutput->DrawOutDev(Point(), aSize, rPos, aSize, rOutput);
+
+switch (rOutput.GetOutDevType())
+{
+case OUTDEV_WINDOW:
+case OUTDEV_VIRDEV:
+xOutput->DrawOutDev(Point(), aSize, rPos, aSize, rOutput);
+break;
+case OUTDEV_PRINTER:
+case OUTDEV_PDF:
+xOutput->SetBackground(rOutput.GetBackground());
+xOutput->Erase();
+break;
+}
 
 cairo_surface_t* pSurface = get_underlying_cairo_surface(*xOutput);
 cairo_t* cr = cairo_create(pSurface);
@@ -4376,7 +4388,17 @@ public:
 gtk_widget_size_allocate(m_pWidget, &aOrigAllocation, 0);
 #endif
 
-rOutput.DrawOutDev(rPos, aSize, Point(), aSize, *xOutput);
+switch (rOutput.GetOutDevType())
+{
+case OUTDEV_WINDOW:
+case OUTDEV_VIRDEV:
+rOutput.DrawOutDev(rPos, aSize, Point(), aSize, *xOutput);
+break;
+case OUTDEV_PRINTER:
+case OUTDEV_PDF:
+rOutput.DrawBitmapEx(rPos, xOutput->GetBitmapEx(Point(), 
aSize));
+break;
+}
 
 if (bAnimations)
 g_object_set(pSettings, "gtk-enable-animations", true, nullptr);


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - external/skia

2021-09-28 Thread Luboš Luňák (via logerrit)
 external/skia/UnpackedTarball_skia.mk|3 ++-
 external/skia/windows-libraries-system32.patch.1 |   13 +
 2 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit e911cfe7c75a18a8023008cd437a281f3bfd3254
Author: Luboš Luňák 
AuthorDate: Wed Sep 1 11:00:38 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 17:11:14 2021 +0200

patch Skia to search only system32/ for libraries

LO on Windows defaults to Vulkan, and Skia tries to load the vulkan
DLL, which may not be present on some systems. The library AFAICT
should always be in a system directory, so restrict library
searching to just there to avoid the possibility of DLL hijacking,
just to be safe.

Change-Id: I78ad3c7297e613c0316e82c5ff3c0110a02da337
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121437
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit e7d2edb025b0ded69742f5e21786061ffc9f70df)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122738
Tested-by: Jenkins CollaboraOffice 

diff --git a/external/skia/UnpackedTarball_skia.mk 
b/external/skia/UnpackedTarball_skia.mk
index 319b33716a96..7e00f98a8dbb 100644
--- a/external/skia/UnpackedTarball_skia.mk
+++ b/external/skia/UnpackedTarball_skia.mk
@@ -36,7 +36,8 @@ skia_patches := \
 c++20.patch.0 \
 constexpr-debug-std-max.patch.1 \
 swap-buffers-rect.patch.1 \
-ubsan.patch.0
+ubsan.patch.0 \
+windows-libraries-system32.patch.1 \
 
 $(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1))
 
diff --git a/external/skia/windows-libraries-system32.patch.1 
b/external/skia/windows-libraries-system32.patch.1
new file mode 100644
index ..45c0e35d1cfa
--- /dev/null
+++ b/external/skia/windows-libraries-system32.patch.1
@@ -0,0 +1,13 @@
+diff --git a/src/ports/SkOSLibrary_win.cpp b/src/ports/SkOSLibrary_win.cpp
+index d2dcbe0af6..c288bbf177 100644
+--- a/src/ports/SkOSLibrary_win.cpp
 b/src/ports/SkOSLibrary_win.cpp
+@@ -11,7 +11,7 @@
+ #include "src/ports/SkOSLibrary.h"
+ 
+ void* SkLoadDynamicLibrary(const char* libraryName) {
+-return LoadLibraryA(libraryName);
++return LoadLibraryExA(libraryName, nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32);
+ }
+ 
+ void* SkGetProcedureAddress(void* library, const char* functionName) {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - config_host.mk.in configure.ac external/skia solenv/gbuild

2021-09-28 Thread Luboš Luňák (via logerrit)
 config_host.mk.in |1 +
 configure.ac  |   20 
 external/skia/Library_skia.mk |   17 +
 solenv/gbuild/LinkTarget.mk   |2 --
 4 files changed, 38 insertions(+), 2 deletions(-)

New commits:
commit 9e634c0987738ff2951ab82d7690a8e91c7e952e
Author: Luboš Luňák 
AuthorDate: Mon Sep 20 00:53:33 2021 +
Commit: Luboš Luňák 
CommitDate: Tue Sep 28 17:11:32 2021 +0200

use clang-cl's -Zc:dllexportInlines- for Skia (tdf#144598)

This is clang-cl's equivalent of -fvisibility-inlines-hidden,
and it seems to be also sort of the equivalent of MSVC's
-Zc:inline. So it saves build time and disk space.

As an additional effect, this disables emitting copies
of inlines functions in every .o file where the function
is called (even if inlined), which means that it hopefully
avoids the problem of SkOpts_avx.cpp generating a copy
of SkRect::round() which would include AVX code, and
the linker might select this as the instance of SkRect::round()
to keep, thus making SSE2 code call AVX code without checking
for AVX availability first.

Change-Id: I97541ae11d05f489894bc9233271eb21fd520f43
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122335
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit 36f76223193fb96df7b8cbc1a1ff30f739857189)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122739
Tested-by: Jenkins CollaboraOffice 

diff --git a/config_host.mk.in b/config_host.mk.in
index 29626ec9fc42..d6edba704b21 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -262,6 +262,7 @@ export USING_X11=@USING_X11@
 export HAMCREST_JAR=@HAMCREST_JAR@
 export 
HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED=@HAVE_BROKEN_GCC_WMAYBE_UNINITIALIZED@
 export 
HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR=@HAVE_CLANG_DEBUG_INFO_KIND_CONSTRUCTOR@
+export HAVE_LO_CLANG_DLLEXPORTINLINES=@HAVE_LO_CLANG_DLLEXPORTINLINES@
 export HAVE_GCC_AVX=@HAVE_GCC_AVX@
 export HAVE_GCC_BUILTIN_ATOMIC=@HAVE_GCC_BUILTIN_ATOMIC@
 export HAVE_GCC_FNO_ENFORCE_EH_SPECS=@HAVE_GCC_FNO_ENFORCE_EH_SPECS@
diff --git a/configure.ac b/configure.ac
index 31bf6e85efac..518fce0704d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11719,6 +11719,7 @@ LO_CLANG_CXXFLAGS_INTRINSICS_AVX2=
 LO_CLANG_CXXFLAGS_INTRINSICS_AVX512=
 LO_CLANG_CXXFLAGS_INTRINSICS_F16C=
 LO_CLANG_CXXFLAGS_INTRINSICS_FMA=
+HAVE_LO_CLANG_DLLEXPORTINLINES=
 
 if test "$ENABLE_SKIA" = TRUE -a "$COM_IS_CLANG" != TRUE -a ! \( "$_os" = 
"WINNT" -a "$CPUNAME" = "ARM64" \); then
 if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
@@ -11750,6 +11751,24 @@ if test "$ENABLE_SKIA" = TRUE -a "$COM_IS_CLANG" != 
TRUE -a ! \( "$_os" = "WINNT
 LO_CLANG_CXX=
 fi
 fi
+if test -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX" -a "$_os" = "WINNT"; then
+save_CXX="$CXX"
+CXX="$LO_CLANG_CXX"
+AC_MSG_CHECKING([whether $CXX supports -Zc:dllexportInlines-])
+AC_LANG_PUSH([C++])
+save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="$CXXFLAGS -Werror -Zc:dllexportInlines-"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE()], [
+HAVE_LO_CLANG_DLLEXPORTINLINES=TRUE
+AC_MSG_RESULT([yes])
+], [AC_MSG_RESULT([no])])
+CXXFLAGS=$save_CXXFLAGS
+AC_LANG_POP([C++])
+CXX="$save_CXX"
+if test -z "$HAVE_LO_CLANG_DLLEXPORTINLINES"; then
+AC_MSG_ERROR([Clang compiler does not support 
-Zc:dllexportInlines-. The Skia library needs to be built using a newer Clang 
version, or use --disable-skia.])
+fi
+fi
 if test -z "$LO_CLANG_CC" -o -z "$LO_CLANG_CXX"; then
 # Skia is the default on Windows, so hard-require Clang.
 # Elsewhere it's used just by the 'gen' VCL backend which is rarely 
used.
@@ -12020,6 +12039,7 @@ AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_AVX512)
 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_F16C)
 AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_FMA)
 AC_SUBST(CLANG_USE_LD)
+AC_SUBST([HAVE_LO_CLANG_DLLEXPORTINLINES])
 
 SYSTEM_GPGMEPP=
 
diff --git a/external/skia/Library_skia.mk b/external/skia/Library_skia.mk
index 87ae0c64552f..fc59c3ebfe1e 100644
--- a/external/skia/Library_skia.mk
+++ b/external/skia/Library_skia.mk
@@ -57,6 +57,17 @@ $(eval $(call gb_Library_use_system_win32_libs,skia,\
 usp10 \
 gdi32 \
 ))
+
+# cl.exe (and thus clang-cl) likes to emit copies of inline functions even 
when not needed,
+# which means that for e.g. AVX-compiled sources the .o may contain a copy of 
an inline
+# function built using AVX, and the linker may select that copy as the one to 
keep, thus
+# introducing AVX code into generic code. Avoid generating such inlines. The 
flag currently
+# cannot be used for the whole Skia, because code built without the flag 
cannot use
+# libraries built with the flag, so cl.exe-built VCL would have undefined 
references.
+ifeq ($(HAVE_LO_CLANG_DLLEXPORTINLINES),TRUE)
+LO_SK

[Libreoffice-commits] core.git: sw/source

2021-09-28 Thread Caolán McNamara (via logerrit)
 sw/source/filter/xml/wrtxml.cxx |   42 
 sw/source/filter/xml/wrtxml.hxx |2 -
 2 files changed, 23 insertions(+), 21 deletions(-)

New commits:
commit 082394a8ff125a7a7a009f60a0002d1d4c2ca7fb
Author: Caolán McNamara 
AuthorDate: Tue Sep 28 11:33:33 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 28 17:24:19 2021 +0200

make this look less like it grew organically and more like it was planned

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

diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index aa969c9d40e6..1bbee52b77aa 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -81,9 +81,27 @@ SwXMLWriter::~SwXMLWriter()
 {
 }
 
-ErrCode SwXMLWriter::Write_(const uno::Reference < task::XStatusIndicator >& 
xStatusIndicator,
-const OUString& aDocHierarchicalName, bool 
bNoEmbDS)
+ErrCode SwXMLWriter::Write_(const SfxItemSet* pMediumItemSet)
 {
+uno::Reference xStatusIndicator;
+OUString aDocHierarchicalName;
+bool bNoEmbDS(false);
+
+if (pMediumItemSet)
+{
+const SfxUnoAnyItem* pStatusBarItem = static_cast(
+   pMediumItemSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL));
+if (pStatusBarItem)
+pStatusBarItem->GetValue() >>= xStatusIndicator;
+const SfxStringItem* pDocHierarchItem = static_cast(
+pMediumItemSet->GetItem(SID_DOC_HIERARCHICALNAME));
+if (pDocHierarchItem)
+aDocHierarchicalName = pDocHierarchItem->GetValue();
+const SfxBoolItem* pNoEmbDS = 
pMediumItemSet->GetItem(SID_NO_EMBEDDED_DS);
+if (pNoEmbDS)
+bNoEmbDS = pNoEmbDS->GetValue();
+}
+
 // Get service factory
 uno::Reference< uno::XComponentContext > xContext =
 comphelper::getProcessComponentContext();
@@ -447,28 +465,12 @@ ErrCode SwXMLWriter::Write_(const uno::Reference < 
task::XStatusIndicator >& xSt
 
 ErrCode SwXMLWriter::WriteStorage()
 {
-return Write_(uno::Reference(), OUString(), false);
+return Write_(nullptr);
 }
 
 ErrCode SwXMLWriter::WriteMedium( SfxMedium& aTargetMedium )
 {
-uno::Reference < task::XStatusIndicator > xStatusIndicator;
-OUString aName;
-bool bNoEmbDS(false);
-
-const SfxUnoAnyItem* pStatusBarItem = static_cast(
-   aTargetMedium.GetItemSet()->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) );
-if ( pStatusBarItem )
-pStatusBarItem->GetValue() >>= xStatusIndicator;
-const SfxStringItem* pDocHierarchItem = static_cast(
-aTargetMedium.GetItemSet()->GetItem(SID_DOC_HIERARCHICALNAME) );
-if ( pDocHierarchItem )
-aName = pDocHierarchItem->GetValue();
-const SfxBoolItem* pNoEmbDS = 
SfxItemSet::GetItem(aTargetMedium.GetItemSet(), SID_NO_EMBEDDED_DS, false);
-if (pNoEmbDS)
-bNoEmbDS = pNoEmbDS->GetValue();
-
-return Write_(xStatusIndicator, aName, bNoEmbDS);
+return Write_(aTargetMedium.GetItemSet());
 }
 
 ErrCode SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed,
diff --git a/sw/source/filter/xml/wrtxml.hxx b/sw/source/filter/xml/wrtxml.hxx
index 7e4ed6580c15..7b9c6fe08302 100644
--- a/sw/source/filter/xml/wrtxml.hxx
+++ b/sw/source/filter/xml/wrtxml.hxx
@@ -40,7 +40,7 @@ namespace com::sun::star {
 
 class SwXMLWriter : public StgWriter
 {
-ErrCode Write_(const css::uno::Reference < css::task::XStatusIndicator>&, 
const OUString&, bool bNoEmbDS);
+ErrCode Write_(const SfxItemSet* pMediumItemSet);
 
 using StgWriter::Write;
 


[Libreoffice-commits] core.git: sw/source

2021-09-28 Thread Noel Grandin (via logerrit)
 sw/source/core/text/atrhndl.hxx |2 +-
 sw/source/core/text/atrstck.cxx |   20 +---
 2 files changed, 10 insertions(+), 12 deletions(-)

New commits:
commit b62153753a9f21afb2a49110ef0459e427b0b01a
Author: Noel Grandin 
AuthorDate: Tue Sep 28 14:47:58 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 28 18:24:52 2021 +0200

tdf#135683 speedup SwAttrHandler

we only care about the "highest priority" attribute, so we only
need to store a single attribute, not a whole vector worth.

Shaves 5% off the load time for me.

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

diff --git a/sw/source/core/text/atrhndl.hxx b/sw/source/core/text/atrhndl.hxx
index 1033242492c3..8a3c438fd91d 100644
--- a/sw/source/core/text/atrhndl.hxx
+++ b/sw/source/core/text/atrhndl.hxx
@@ -38,7 +38,7 @@ extern const sal_uInt8 StackPos[];
 class SwAttrHandler
 {
 private:
-std::vector m_aAttrStack[NUM_ATTRIBUTE_STACKS]; // 
stack collection
+const SwTextAttr* m_aAttrStack[NUM_ATTRIBUTE_STACKS] {}; // stack 
collection
 const SfxPoolItem* m_pDefaultArray[ NUM_DEFAULT_VALUES ];
 const IDocumentSettingAccess* m_pIDocumentSettingAccess;
 const SwViewShell* m_pShell;
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index 4cc7b501094f..794390a63ede 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -335,7 +335,7 @@ void SwAttrHandler::Init( const SfxPoolItem** pPoolItem, 
const SwAttrSet* pAS,
 void SwAttrHandler::Reset( )
 {
 for (auto& i : m_aAttrStack)
-i.clear();
+i = nullptr;
 }
 
 void SwAttrHandler::PushAndChg( const SwTextAttr& rAttr, SwFont& rFnt )
@@ -384,7 +384,7 @@ void SwAttrHandler::PushAndChg( const SwTextAttr& rAttr, 
SwFont& rFnt )
 
 const SwTextAttr* SwAttrHandler::GetTop(sal_uInt16 nStack)
 {
-return m_aAttrStack[nStack].empty() ? nullptr : 
m_aAttrStack[nStack].back();
+return m_aAttrStack[nStack];
 }
 
 bool SwAttrHandler::Push( const SwTextAttr& rAttr, const SfxPoolItem& rItem )
@@ -406,21 +406,20 @@ bool SwAttrHandler::Push( const SwTextAttr& rAttr, const 
SfxPoolItem& rItem )
  || ( !pTopAttr->IsPriorityAttr()
   && !lcl_ChgHyperLinkColor(*pTopAttr, rItem, m_pShell, nullptr)))
 {
-m_aAttrStack[nStack].push_back(&rAttr);
+m_aAttrStack[nStack] = &rAttr;
 return true;
 }
 
-const auto it = m_aAttrStack[nStack].end() - 1;
-m_aAttrStack[nStack].insert(it, &rAttr);
+if (!pTopAttr)
+m_aAttrStack[nStack] = &rAttr;
 return false;
 }
 
 void SwAttrHandler::RemoveFromStack(sal_uInt16 nWhich, const SwTextAttr& rAttr)
 {
 auto& rStack = m_aAttrStack[StackPos[nWhich]];
-const auto it = std::find(rStack.begin(), rStack.end(), &rAttr);
-if (it != rStack.end())
-rStack.erase(it);
+if (rStack == &rAttr)
+rStack = nullptr;
 }
 
 void SwAttrHandler::PopAndChg( const SwTextAttr& rAttr, SwFont& rFnt )
@@ -740,7 +739,7 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, 
SwFont& rFnt, bool bPush )
 // 2. top of two line stack ( or default attribute )is an
 //deactivated two line attribute
 const bool bRuby =
-0 != m_aAttrStack[ StackPos[ RES_TXTATR_CJK_RUBY ] ].size();
+nullptr != m_aAttrStack[ StackPos[ RES_TXTATR_CJK_RUBY ] ];
 
 if ( bRuby )
 break;
@@ -764,8 +763,7 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, 
SwFont& rFnt, bool bPush )
 }
 case RES_CHRATR_TWO_LINES :
 {
-bool bRuby = 0 !=
-m_aAttrStack[ StackPos[ RES_TXTATR_CJK_RUBY ] ].size();
+bool bRuby = nullptr != m_aAttrStack[ StackPos[ 
RES_TXTATR_CJK_RUBY ] ];
 
 // two line is activated, if
 // 1. no ruby attribute is set and


[Libreoffice-commits] core.git: 2 commits - sw/source

2021-09-28 Thread Noel Grandin (via logerrit)
 sw/source/core/text/atrhndl.hxx |   10 +-
 sw/source/core/text/atrstck.cxx |   16 ++--
 sw/source/core/text/inftxt.cxx  |   20 ++--
 sw/source/core/text/inftxt.hxx  |2 +-
 sw/source/core/text/txttab.cxx  |6 +++---
 5 files changed, 25 insertions(+), 29 deletions(-)

New commits:
commit 8156a8f87996e353f8d36935e0497624245f1ad1
Author: Noel Grandin 
AuthorDate: Tue Sep 28 15:01:45 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 28 18:25:48 2021 +0200

 no need to allocate SwFont separately in SwAttrHandler

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

diff --git a/sw/source/core/text/atrhndl.hxx b/sw/source/core/text/atrhndl.hxx
index 8a3c438fd91d..92d0153eefc3 100644
--- a/sw/source/core/text/atrhndl.hxx
+++ b/sw/source/core/text/atrhndl.hxx
@@ -45,7 +45,7 @@ private:
 
 // This is the base font for the paragraph. It is stored in order to have
 // a template, if we have to restart the attribute evaluation
-std::unique_ptr m_pFnt;
+std::optional m_oFnt;
 
 bool m_bVertLayout;
 bool m_bVertLayoutLRBT;
@@ -104,14 +104,14 @@ public:
 
 inline void SwAttrHandler::ResetFont( SwFont& rFnt ) const
 {
-OSL_ENSURE(m_pFnt, "ResetFont without a font");
-if (m_pFnt)
-rFnt = *m_pFnt;
+OSL_ENSURE(m_oFnt, "ResetFont without a font");
+if (m_oFnt)
+rFnt = *m_oFnt;
 };
 
 inline const SwFont* SwAttrHandler::GetFont() const
 {
-return m_pFnt.get();
+return m_oFnt ? &*m_oFnt : nullptr;
 };
 
 
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index 794390a63ede..79dc822361c6 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -322,14 +322,10 @@ void SwAttrHandler::Init( const SfxPoolItem** pPoolItem, 
const SwAttrSet* pAS,
 // SwTextFrame::FormatOnceMore situation or (since sw_redlinehide)
 // from SwAttrIter::Seek(); in the latter case SwTextSizeInfo::m_pFnt
 // is an alias of m_pFnt so it must not be deleted!
-if (m_pFnt)
-{
-*m_pFnt = rFnt;
-}
+if (m_oFnt)
+*m_oFnt = rFnt;
 else
-{
-m_pFnt.reset(new SwFont(rFnt));
-}
+m_oFnt.emplace(rFnt);
 }
 
 void SwAttrHandler::Reset( )
@@ -826,11 +822,11 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, 
SwFont& rFnt, bool bPush )
 void SwAttrHandler::GetDefaultAscentAndHeight( SwViewShell const * pShell, 
OutputDevice const & rOut,
sal_uInt16& nAscent, 
sal_uInt16& nHeight ) const
 {
-OSL_ENSURE(m_pFnt, "No font available for GetDefaultAscentAndHeight");
+OSL_ENSURE(m_oFnt, "No font available for GetDefaultAscentAndHeight");
 
-if (m_pFnt)
+if (m_oFnt)
 {
-SwFont aFont( *m_pFnt );
+SwFont aFont( *m_oFnt );
 nHeight = aFont.GetHeight( pShell, rOut );
 nAscent = aFont.GetAscent( pShell, rOut );
 }
commit 2d45cef3cd18c9d0198b9d302016a7598ce0484c
Author: Noel Grandin 
AuthorDate: Tue Sep 28 14:55:22 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 28 18:25:33 2021 +0200

no need to allocate SvxTabStopItem separately in SwLineInfo

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

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 26e7246a2a98..e3546c66db1a 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -99,7 +99,7 @@ SwLineInfo::~SwLineInfo()
 void SwLineInfo::CtorInitLineInfo( const SwAttrSet& rAttrSet,
const SwTextNode& rTextNode )
 {
-m_pRuler.reset( new SvxTabStopItem( rAttrSet.GetTabStops() ) );
+m_oRuler.emplace( rAttrSet.GetTabStops() );
 if ( rTextNode.GetListTabStopPosition( m_nListTabStopPosition ) )
 {
 m_bListTabStopIncluded = true;
@@ -107,15 +107,15 @@ void SwLineInfo::CtorInitLineInfo( const SwAttrSet& 
rAttrSet,
 // insert the list tab stop into SvxTabItem instance 
 const SvxTabStop aListTabStop( m_nListTabStopPosition,
SvxTabAdjust::Left );
-m_pRuler->Insert( aListTabStop );
+m_oRuler->Insert( aListTabStop );
 
 // remove default tab stops, which are before the inserted list tab 
stop
-for ( sal_uInt16 i = 0; i < m_pRuler->Count(); i++ )
+for ( sal_uInt16 i = 0; i < m_oRuler->Count(); i++ )
 {
-if ( (*m_pRuler)[i].GetTabPos() < m_nListTabStopPosition &&
- (*m_pRuler)[i].GetAdjustment() == SvxTabAdjust::Default )
+if ( (*m_oRuler)[i].GetTabPos() < m_nListTabStopPosition &&
+ (*m_oRuler)[i].GetAdjustment() == SvxTabAdjust::Default )
 {
-

[Libreoffice-commits] core.git: sw/source

2021-09-28 Thread Noel Grandin (via logerrit)
 sw/source/core/layout/calcmove.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 73c56d8c7830b800aea23ecd083194d7b6ab8a03
Author: Noel Grandin 
AuthorDate: Tue Sep 28 15:35:21 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 28 18:26:03 2021 +0200

no need to allocate this on the heap

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

diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index 98df857e3910..ec53f551f135 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1248,7 +1248,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
 PROTOCOL_ENTER( this, PROT::MakeAll, DbgAction::NONE, nullptr )
 
 // takes care of the notification in the dtor
-std::unique_ptr> 
pNotify(new SwContentNotify( this ));
+std::optional oNotify( std::in_place, this );
 
 // as long as bMakePage is true, a new page can be created (exactly once)
 bool bMakePage = true;
@@ -1280,7 +1280,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
 
 if ( !IsFollow() && rAttrs.JoinedWithPrev( *(this) ) )
 {
-pNotify->SetBordersJoinedWithPrev();
+oNotify->SetBordersJoinedWithPrev();
 }
 
 const bool bKeep = IsKeep(rAttrs.GetAttrSet().GetKeep(), GetBreakItem());
@@ -1720,7 +1720,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
   bNxtNew) )
 {
 if( bMovedFwd )
-pNotify->SetInvaKeep();
+oNotify->SetInvaKeep();
 bMovedFwd = false;
 }
 }
@@ -1909,12 +1909,12 @@ void SwContentFrame::MakeAll(vcl::RenderContext* 
/*pRenderContext*/)
 UnlockJoin();
 oDeleteGuard.reset();
 if ( bMovedFwd || bMovedBwd )
-pNotify->SetInvaKeep();
+oNotify->SetInvaKeep();
 if ( bMovedFwd )
 {
-pNotify->SetInvalidatePrevPrtArea();
+oNotify->SetInvalidatePrevPrtArea();
 }
-pNotify.reset();
+oNotify.reset();
 SetFlyLock( false );
 }
 


[Libreoffice-commits] help.git: source/text

2021-09-28 Thread Eike Rathke (via logerrit)
 source/text/scalc/01/04060109.xhp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5a4f9fe6afa18531f7403df99e555ea04d96e9b6
Author: Eike Rathke 
AuthorDate: Tue Sep 28 18:55:09 2021 +0200
Commit: Eike Rathke 
CommitDate: Tue Sep 28 19:07:23 2021 +0200

Resolves: tdf#144770 MATCH() remove plain wrong statement about unsorted 
array

In since the initial 2004 commit. Whatever idea that was, it's wrong.

Change-Id: Ic54bed36b832d223e96d42efdee1a2f8067b6c41
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/122784
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/source/text/scalc/01/04060109.xhp 
b/source/text/scalc/01/04060109.xhp
index 4f2de..2a8ff6cd9 100644
--- a/source/text/scalc/01/04060109.xhp
+++ b/source/text/scalc/01/04060109.xhp
@@ -341,7 +341,7 @@
  
 Type may take the values 1, 0, or -1. If Type = 1 or 
if this optional parameter is missing, it is assumed that the first column of 
the search array is sorted in ascending order. If Type = -1 it is assumed that 
the column in sorted in descending order. This corresponds to the same function 
in Microsoft Excel.
  If 
Type = 0, only exact matches are found. If the search criterion is found more 
than once, the function returns the index of the first matching value. Only if 
Type = 0 can you search for regular expressions (if enabled in calculation 
options) or wildcards (if enabled in calculation options).
- If 
Type = 1 or the third parameter is missing, the index of the last value that is 
smaller or equal to the search criterion is returned. This applies even when 
the search array is not sorted. For Type = -1, the first value that is larger 
or equal is returned.
+ If 
Type = 1 or the third parameter is missing, the index of the last value that is 
smaller or equal to the search criterion is returned. For Type = -1, the first 
value that is larger or equal is returned.
  
  
  


[Libreoffice-commits] core.git: helpcontent2

2021-09-28 Thread Eike Rathke (via logerrit)
 helpcontent2 |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit df37d83500f7fe94046afb8817d29bd4ee650635
Author: Eike Rathke 
AuthorDate: Tue Sep 28 19:07:24 2021 +0200
Commit: Gerrit Code Review 
CommitDate: Tue Sep 28 19:07:24 2021 +0200

Update git submodules

* Update helpcontent2 from branch 'master'
  to 5a4f9fe6afa18531f7403df99e555ea04d96e9b6
  - Resolves: tdf#144770 MATCH() remove plain wrong statement about 
unsorted array

In since the initial 2004 commit. Whatever idea that was, it's wrong.

Change-Id: Ic54bed36b832d223e96d42efdee1a2f8067b6c41
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/122784
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/helpcontent2 b/helpcontent2
index 7a89e385e842..5a4f9fe6afa1 16
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 7a89e385e842191c215e407541a96343fbb5dc97
+Subproject commit 5a4f9fe6afa18531f7403df99e555ea04d96e9b6


[Libreoffice-commits] core.git: wizards/source

2021-09-28 Thread Jean-Pierre Ledure (via logerrit)
 wizards/source/scriptforge/SF_L10N.xba   |2 -
 wizards/source/scriptforge/SF_Platform.xba   |   28 +++
 wizards/source/scriptforge/SF_Root.xba   |2 +
 wizards/source/scriptforge/SF_Utils.xba  |5 
 wizards/source/scriptforge/python/scriptforge.py |2 -
 5 files changed, 37 insertions(+), 2 deletions(-)

New commits:
commit 0bcc4b55d723f73b2fb7a86fcfebeca49905079e
Author: Jean-Pierre Ledure 
AuthorDate: Tue Sep 28 17:37:36 2021 +0200
Commit: Jean-Pierre Ledure 
CommitDate: Tue Sep 28 19:11:00 2021 +0200

ScriptForge - (SF_Platform) new Fonts property

The Fonts property returns the list of available fonts
as an unsorted array of unique font names

The size of the array being potentially huge, the choice
has been made to not sort the list at each invocation
of the property.
To get it sorted, use the SF_Array.Sort() method.

The property is available both from Basic and Python scripts.
It is read-only.

Change-Id: I49233d279dc7257d3b97e5a17be0bc8807f18d67
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122780
Tested-by: Jean-Pierre Ledure 
Tested-by: Jenkins
Reviewed-by: Jean-Pierre Ledure 

diff --git a/wizards/source/scriptforge/SF_L10N.xba 
b/wizards/source/scriptforge/SF_L10N.xba
index 8b09d85db437..859f67386ba4 100644
--- a/wizards/source/scriptforge/SF_L10N.xba
+++ b/wizards/source/scriptforge/SF_L10N.xba
@@ -818,4 +818,4 @@ Private Function _Repr() As String
 End Function   '  ScriptForge.SF_L10N._Repr
 
 REM  END OF SCRIPTFORGE.SF_L10N
-
+
\ No newline at end of file
diff --git a/wizards/source/scriptforge/SF_Platform.xba 
b/wizards/source/scriptforge/SF_Platform.xba
index 5c2970823d05..703ae195b942 100644
--- a/wizards/source/scriptforge/SF_Platform.xba
+++ b/wizards/source/scriptforge/SF_Platform.xba
@@ -73,6 +73,15 @@ Property Get CurrentUser() As String
CurrentUser = _PropertyGet("CurrentUser")
 End Property   '  ScriptForge.SF_Platform.CurrentUser (get)
 
+REM 
-
+Property Get Fonts() As Variant
+''' Returns the list of available fonts as an unsorted 
array of unique strings
+''' To get the list sorted, use SF_Array.Sort()
+''' Example:
+''' myFontsList = platform.Fonts
+   Fonts = _PropertyGet("Fonts")
+End Property   '  ScriptForge.SF_Platform.Fonts (get)
+
 REM 
-
 Property Get Locale() As String
 ''' Returns the locale combining language-COUNTRY (la-CO)
@@ -218,6 +227,7 @@ Public Function Properties() As Variant
, "ComputerName" _
, "CPUCount" _
, "CurrentUser" _
+   , "Fonts" _
, "Locale" _
, "Machine" _
, "OfficeVersion" _
@@ -308,6 +318,12 @@ Private Function _PropertyGet(Optional ByVal psProperty As 
String) As Variant
 Dim sOSName As String  '  Operating system
 Dim oLocale As Object  '  com.sun.star.lang.Locale
 Dim oPrinterServer As Object   '  com.sun.star.awt.PrinterServer
+Dim oToolkit As Object '  com.sun.star.awt.Toolkit
+Dim oDevice As Object  '  com.sun.star.awt.XDevice
+Dim oFontDescriptors As Variant'  Array of 
com.sun.star.awt.FontDescriptor
+Dim sFonts As String   '  Comma-separated list of fonts
+Dim sFont As String'  A single font name
+Dim i As Long
 
 Const cstPyHelper = "$" & "_SF_Platform"
 Dim cstThisSub As String
@@ -322,6 +338,18 @@ Const cstSubArgs = ""
With ScriptForge.SF_Session
_PropertyGet = 
.ExecutePythonScript(.SCRIPTISSHARED, _SF_.PythonHelper & cstPyHelper, 
psProperty)
End With
+   Case "Fonts"
+   Set oToolkit = 
SF_Utils._GetUnoService("Toolkit")
+   Set oDevice = oToolkit.createScreenCompatibleDevice(0, 
0)
+   oFontDescriptors = oDevice.FontDescriptors()
+   sFonts = ","
+   '  Select only not yet registered fonts
+   For i = 0 To UBound(oFontDescriptors)
+   sFont = oFontDescriptors(i).Name
+   If InStr(sFonts, "," & sFont 
& ",") = 0  Then sFonts = sFonts & sFont & ","
+   Next i
+   '  Remove leading and trailing commas
+   If Len(sFonts) > 1 Then _PropertyGet = 
Split(Mid(sFonts, 2, Len(sFonts) - 2), ",") Else _PropertyGet = 
Array()
Case "Loca

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - drawinglayer/source include/drawinglayer svx/CppunitTest_svx_unit.mk svx/qa svx/source

2021-09-28 Thread Miklos Vajna (via logerrit)
 drawinglayer/source/primitive2d/shadowprimitive2d.cxx   |   71 ---
 drawinglayer/source/processor2d/vclpixelprocessor2d.cxx |   10 +
 drawinglayer/source/tools/primitive2dxmldump.cxx|   33 +
 include/drawinglayer/primitive2d/baseprimitive2d.hxx|7 +
 include/drawinglayer/primitive2d/shadowprimitive2d.hxx  |8 +
 svx/CppunitTest_svx_unit.mk |1 
 svx/qa/unit/data/table-shadow-blur.pptx |binary
 svx/qa/unit/table.cxx   |  100 
 svx/source/table/viewcontactoftableobj.cxx  |   13 +-
 9 files changed, 221 insertions(+), 22 deletions(-)

New commits:
commit 52524e52e8f061aa3f0c63219d954d2d5aefd059
Author: Miklos Vajna 
AuthorDate: Mon Sep 20 11:26:53 2021 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 28 19:19:19 2021 +0200

tdf#144091 svx: fix unwanted blur of shadow from table cell fill

Initial render support for shadows of table shapes were added in commit
a75bf43a8d6c5dec6dcc86908c142ceec541aa8c (tdf#129961 svx: add rendering
for table shadow as direct format, 2020-12-02).

That already noticed a trick with the shadow of table shapes: the shadow
is generate from the cell fill and the border, but not from the text.

An additional trick is that when blur is enabled for the table shape's
shadow, then only the border should be blurred, not the cell fill.

In the bug document's case, the effective cell background was gray, with
a semi-transparent red shadow. We used to render cc with blur and
cc without blur, now we correctly render cca3a3, matching
PowerPoint.

(cherry picked from commit 37a52d30bbfcf1d073779b50139c4dafa507be4b)

Conflicts:
drawinglayer/source/primitive2d/shadowprimitive2d.cxx
drawinglayer/source/tools/primitive2dxmldump.cxx

include/drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx

Change-Id: I7326a5f6254cf19b2d05181084c78e734ff7a7b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122383
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122760
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Miklos Vajna 

diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx 
b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
index f0efd64c7bdc..516cc0c0bd4a 100644
--- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
@@ -30,6 +30,27 @@ using namespace com::sun::star;
 
 namespace drawinglayer::primitive2d
 {
+namespace
+{
+void get2DDecompositionOfChildren(const ShadowPrimitive2D& rPrimitive,
+  Primitive2DDecompositionVisitor& rVisitor,
+  const Primitive2DContainer& rChildren)
+{
+if (rChildren.empty())
+return;
+
+// create a modifiedColorPrimitive containing the shadow color and the 
content
+const basegfx::BColorModifierSharedPtr aBColorModifier
+= 
std::make_shared(rPrimitive.getShadowColor());
+const Primitive2DReference xRefA(new ModifiedColorPrimitive2D(rChildren, 
aBColorModifier));
+Primitive2DContainer aSequenceB{ xRefA };
+
+// build transformed primitiveVector with shadow offset and add to target
+rVisitor.append(
+new TransformPrimitive2D(rPrimitive.getShadowTransform(), 
std::move(aSequenceB)));
+}
+}
+
 ShadowPrimitive2D::ShadowPrimitive2D(
 const basegfx::B2DHomMatrix& rShadowTransform,
 const basegfx::BColor& rShadowColor,
@@ -66,21 +87,41 @@ namespace drawinglayer::primitive2d
 
 void 
ShadowPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& 
rVisitor, const geometry::ViewInformation2D& /*rViewInformation*/) const
 {
-if(getChildren().empty())
-return;
-
-// create a modifiedColorPrimitive containing the shadow color and 
the content
-const basegfx::BColorModifierSharedPtr aBColorModifier =
-std::make_shared(
-getShadowColor());
-const Primitive2DReference xRefA(
-new ModifiedColorPrimitive2D(
-getChildren(),
-aBColorModifier));
-const Primitive2DContainer aSequenceB { xRefA };
-
-// build transformed primitiveVector with shadow offset and add to 
target
-rVisitor.append(new TransformPrimitive2D(getShadowTransform(), 
aSequenceB));
+get2DDecompositionOfChildren(*this, rVisitor, getChildren());
+}
+
+void ShadowPrimitive2D::get2DDecompositionWithoutBlur(
+Primitive2DDecompositionVisitor& rVisitor,
+const geometry::ViewInformation2D& /*rViewInformation*/) const
+{
+Primitive2DContainer aChildren;
+/

[Libreoffice-commits] core.git: basctl/source basic/source chart2/inc chart2/source cui/source dbaccess/source desktop/source drawinglayer/source editeng/source extensions/source forms/source fpicker/

2021-09-28 Thread Noel Grandin (via logerrit)
 basctl/source/basicide/baside2b.cxx   |2 
 basctl/source/dlged/dlgedfunc.cxx |2 
 basic/source/runtime/methods1.cxx |2 
 chart2/inc/ChartView.hxx  |2 
 chart2/source/controller/dialogs/DataBrowser.cxx  |3 -
 chart2/source/controller/dialogs/TimerTriggeredControllerLock.cxx |1 
 chart2/source/controller/dialogs/tp_3D_SceneGeometry.cxx  |2 
 chart2/source/controller/main/ChartController.cxx |1 
 cui/source/customize/acccfg.cxx   |5 -
 cui/source/customize/cfg.cxx  |3 -
 cui/source/dialogs/AdditionsDialog.cxx|3 -
 cui/source/dialogs/cuigaldlg.cxx  |1 
 cui/source/dialogs/cuigrfflt.cxx  |1 
 cui/source/dialogs/hltpbase.cxx   |1 
 cui/source/tabpages/chardlg.cxx   |2 
 cui/source/tabpages/macroass.cxx  |3 -
 cui/source/tabpages/numpages.cxx  |1 
 dbaccess/source/ui/browser/brwctrlr.cxx   |2 
 dbaccess/source/ui/control/dbtreelistbox.cxx  |1 
 dbaccess/source/ui/control/sqledit.cxx|3 -
 dbaccess/source/ui/dlg/paramdialog.cxx|1 
 dbaccess/source/ui/querydesign/JoinTableView.cxx  |1 
 dbaccess/source/ui/querydesign/QueryTextView.cxx  |2 
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx |1 
 dbaccess/source/ui/tabledesign/TEditControl.cxx   |3 -
 desktop/source/app/app.cxx|4 -
 desktop/source/deployment/gui/dp_gui_dialog2.cxx  |4 -
 desktop/source/deployment/gui/license_dialog.cxx  |2 
 drawinglayer/source/processor2d/vclhelperbufferdevice.cxx |3 -
 editeng/source/editeng/impedit2.cxx   |5 -
 editeng/source/editeng/impedit5.cxx   |1 
 extensions/source/bibliography/toolbar.cxx|1 
 forms/source/component/ListBox.cxx|1 
 fpicker/source/office/autocmpledit.cxx|2 
 fpicker/source/office/fileview.cxx|2 
 fpicker/source/office/iodlgimp.cxx|1 
 framework/source/layoutmanager/layoutmanager.cxx  |2 
 framework/source/services/autorecovery.cxx|3 -
 framework/source/uielement/menubarmanager.cxx |2 
 framework/source/uielement/toolbarmanager.cxx |3 -
 include/vcl/dockwin.hxx   |8 +-
 include/vcl/idle.hxx  |2 
 include/vcl/syswin.hxx|   10 ---
 include/vcl/task.hxx  |1 
 include/vcl/timer.hxx |4 -
 linguistic/source/lngsvcmgr.cxx   |1 
 reportdesign/source/ui/report/dlgedfunc.cxx   |1 
 sc/source/core/tool/chartlis.cxx  |3 -
 sc/source/core/tool/chartlock.cxx |2 
 sc/source/core/tool/refreshtimer.cxx  |4 -
 sc/source/filter/oox/workbookfragment.cxx |2 
 sc/source/ui/cctrl/checklistmenu.cxx  |3 -
 sc/source/ui/dbgui/csvtablebox.cxx|1 
 sc/source/ui/dbgui/tpsort.cxx |2 
 sc/source/ui/docshell/datastream.cxx  |1 
 sc/source/ui/docshell/externalrefmgr.cxx  |4 -
 sc/source/ui/drawfunc/fupoor.cxx  |2 
 sc/source/ui/miscdlgs/acredlin.cxx|3 -
 sc/source/ui/miscdlgs/conflictsdlg.cxx|3 -
 sc/source/ui/miscdlgs/dataproviderdlg.cxx |1 
 sc/source/ui/miscdlgs/instbdlg.cxx|1 
 sc/source/ui/navipi/navipi.cxx|1 
 sc/source/ui/view/gridwin.cxx |1 
 sc/source/ui/view/notemark.cxx|1 
 sc/source/ui/view/tabview.cxx |1 
 sd/source/core/CustomAnimationEffect.cxx  |2 
 sd/source/ui/animations

[Libreoffice-commits] core.git: cui/source

2021-09-28 Thread Miklos Vajna (via logerrit)
 cui/source/dialogs/insdlg.cxx |   28 
 1 file changed, 28 insertions(+)

New commits:
commit 0713d278f5bf232bad819dd46dc19d34ed807b12
Author: Miklos Vajna 
AuthorDate: Tue Sep 28 17:54:27 2021 +0200
Commit: Miklos Vajna 
CommitDate: Tue Sep 28 19:45:40 2021 +0200

cui: add a status indicator for the OLE insert dialog

Inserting a large file can take a while, and we do it on the main
thread, so the UI is frozen during the operation.

Create a statusbar and tell the user what's happening, even if the
underlying CreateObjectFromFile() and OleSave() functions don't report
their progress, so effectively this is more like a spinner than a
progressbar.

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

diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index 7e411d3c021d..e811ad033f69 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -48,6 +49,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -276,10 +280,34 @@ short SvInsertOleDlg::run()
 aMedium[1].Value <<= xInteraction;
 
 // create object from media descriptor
+
+uno::Reference xProgress;
+SfxViewFrame* pFrame = SfxViewFrame::Current();
+if (pFrame)
+{
+// Have a current frame, create visual indication that 
insert is in progress.
+uno::Reference xFrame = 
pFrame->GetFrame().GetFrameInterface();
+uno::Reference 
xProgressFactory(xFrame, uno::UNO_QUERY);
+if (xProgressFactory.is())
+{
+xProgress = xProgressFactory->createStatusIndicator();
+if (xProgress)
+{
+OUString aDocLoad(SvxResId(RID_SVXSTR_DOC_LOAD));
+xProgress->start(aDocLoad, 100);
+}
+}
+}
+
 if ( bLink )
 m_xObj = aCnt.InsertEmbeddedLink( aMedium, aName );
 else
 m_xObj = aCnt.InsertEmbeddedObject( aMedium, aName );
+
+if (xProgress.is())
+{
+xProgress->end();
+}
 }
 
 if ( !m_xObj.is() )


[Libreoffice-commits] core.git: connectivity/source

2021-09-28 Thread Andrea Gelmini (via logerrit)
 connectivity/source/drivers/jdbc/Blob.cxx |2 +-
 connectivity/source/drivers/jdbc/Clob.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 858c15cf215e511e2d636c16d374c88bca96d66c
Author: Andrea Gelmini 
AuthorDate: Mon Sep 27 16:23:17 2021 +0200
Commit: Julien Nabet 
CommitDate: Tue Sep 28 21:10:04 2021 +0200

Fix typos

Change-Id: I05fdb2378f48b7e2c7373c16c66065111c5d2f73
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122716
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/connectivity/source/drivers/jdbc/Blob.cxx 
b/connectivity/source/drivers/jdbc/Blob.cxx
index adacd5d7c166..4531fc9b8724 100644
--- a/connectivity/source/drivers/jdbc/Blob.cxx
+++ b/connectivity/source/drivers/jdbc/Blob.cxx
@@ -135,7 +135,7 @@ sal_Int64 SAL_CALL java_sql_Blob::positionOfBlob( const 
css::uno::Reference< css
 ::dbtools::throwFeatureNotImplementedSQLException( 
"XBlob::positionOfBlob", *this );
 // this was put here in CWS warnings01. The previous implementation was 
defective, as it did ignore
 // the pattern parameter. Since the effort for proper implementation is 
rather high - we would need
-// to translated patter into a byte[] -, we defer this functionality for 
the moment (hey, it was
+// to translated pattern into a byte[] -, we defer this functionality for 
the moment (hey, it was
 // unusable, anyway)
 // #i57457#
 return 0;
diff --git a/connectivity/source/drivers/jdbc/Clob.cxx 
b/connectivity/source/drivers/jdbc/Clob.cxx
index 135512d5a245..6108981aca89 100644
--- a/connectivity/source/drivers/jdbc/Clob.cxx
+++ b/connectivity/source/drivers/jdbc/Clob.cxx
@@ -122,7 +122,7 @@ sal_Int64 SAL_CALL java_sql_Clob::positionOfClob( const 
css::uno::Reference< css
 ::dbtools::throwFeatureNotImplementedSQLException( 
"XClob::positionOfClob", *this );
 // this was put here in CWS warnings01. The previous implementation was 
defective, as it did ignore
 // the pattern parameter. Since the effort for proper implementation is 
rather high - we would need
-// to translated patter into a byte[] -, we defer this functionality for 
the moment (hey, it was
+// to translated pattern into a byte[] -, we defer this functionality for 
the moment (hey, it was
 // unusable, anyway)
 // 2005-11-15 / #i57457# / frank.schoenh...@sun.com
 return 0;


[Libreoffice-commits] core.git: compilerplugins/clang connectivity/source

2021-09-28 Thread Stephan Bergmann (via logerrit)
 compilerplugins/clang/bufferadd.cxx |9 +
 compilerplugins/clang/test/bufferadd.cxx|6 ++
 connectivity/source/drivers/postgresql/pq_statement.cxx |   15 +--
 3 files changed, 20 insertions(+), 10 deletions(-)

New commits:
commit 4c1bf9d7790ca037933c3c6825d48736572a1886
Author: Stephan Bergmann 
AuthorDate: Tue Sep 28 20:09:55 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Sep 28 21:23:06 2021 +0200

Make loplugin:bufferadd look through O[U]String::operator 
std::[u16]string_view

Change-Id: I79a32f64541a90b0b824f7721e8815c1e7c873ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122788
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/compilerplugins/clang/bufferadd.cxx 
b/compilerplugins/clang/bufferadd.cxx
index bc8c7065b2a1..cf2b6a011b4a 100644
--- a/compilerplugins/clang/bufferadd.cxx
+++ b/compilerplugins/clang/bufferadd.cxx
@@ -347,6 +347,15 @@ bool BufferAdd::isSideEffectFree(Expr const* expr)
 if (isSideEffectFree(callExpr->getArg(0)))
 return true;
 }
+// O[U]String::operator std::[u16]string_view:
+if (auto const d = 
dyn_cast_or_null(callExpr->getCalleeDecl()))
+{
+auto tc = loplugin::TypeCheck(d->getParent());
+if (tc.Class("OString") || tc.Class("OUString"))
+{
+return true;
+}
+}
 }
 
 // sometimes we have a constructor call on the RHS
diff --git a/compilerplugins/clang/test/bufferadd.cxx 
b/compilerplugins/clang/test/bufferadd.cxx
index a9f28b13b55a..c8057a6f497b 100644
--- a/compilerplugins/clang/test/bufferadd.cxx
+++ b/compilerplugins/clang/test/bufferadd.cxx
@@ -52,6 +52,12 @@ void f5(OUStringBuffer& input)
 OUStringBuffer v(input);
 v.append("");
 }
+void f6(OString const& s)
+{
+// expected-error@+1 {{convert this append sequence into a *String + 
sequence [loplugin:bufferadd]}}
+OUStringBuffer b("foo");
+b.append(OStringToOUString(s, RTL_TEXTENCODING_ASCII_US));
+}
 struct Footer
 {
 OStringBuffer m_descriptorStart;
diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx 
b/connectivity/source/drivers/postgresql/pq_statement.cxx
index 48fd7b062c8b..9fc87bc761c2 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.cxx
@@ -44,7 +44,6 @@
 #include 
 
 #include 
-#include 
 
 #include 
 
@@ -456,15 +455,11 @@ bool executePostgresCommand( const OString & cmd, struct 
CommandData *data )
 }
 else if( !sourceTableKeys.empty() )
 {
-OStringBuffer buf( 128 );
-buf.append( "can't support updateable resultset for table 
" );
-buf.append( OUStringToOString( schema, 
ConnectionSettings::encoding ) );
-buf.append( "." );
-buf.append( OUStringToOString( table, 
ConnectionSettings::encoding ) );
-buf.append( ", because resultset does not contain a part 
of the primary key ( column " );
-buf.append( OUStringToOString( sourceTableKeys[i], 
ConnectionSettings::encoding ) );
-buf.append( " is missing )" );
-aReason = buf.makeStringAndClear();
+aReason = "can't support updateable resultset for table "
++ OUStringToOString( schema, 
ConnectionSettings::encoding ) + "."
++ OUStringToOString( table, 
ConnectionSettings::encoding )
++ ", because resultset does not contain a part of the 
primary key ( column "
++ OUStringToOString( sourceTableKeys[i], 
ConnectionSettings::encoding );
 }
 else
 {


[Libreoffice-commits] core.git: vcl/source

2021-09-28 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |   28 ++--
 1 file changed, 26 insertions(+), 2 deletions(-)

New commits:
commit 36cec4b92e8be9f47467539967672ba8906096e1
Author: Caolán McNamara 
AuthorDate: Tue Sep 28 17:11:02 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 28 21:49:11 2021 +0200

tdf#144139 gen backend doesn't crash but DrawOutDev is a null op for 
Printers

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

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index fd17e157d8ce..2d30c82e781b 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -1285,7 +1285,19 @@ void SalInstanceWidget::DoRecursivePaint(vcl::Window* 
pWindow, const Point& rRen
 Size aTempLogicSize(xOutput->PixelToLogic(aChildSizePixel));
 Size aRenderLogicSize(rOutput.PixelToLogic(aChildSizePixel));
 
-xOutput->DrawOutDev(Point(), aTempLogicSize, rRenderLogicPos, 
aRenderLogicSize, rOutput);
+switch (rOutput.GetOutDevType())
+{
+case OUTDEV_WINDOW:
+case OUTDEV_VIRDEV:
+xOutput->DrawOutDev(Point(), aTempLogicSize, rRenderLogicPos, 
aRenderLogicSize,
+rOutput);
+break;
+case OUTDEV_PRINTER:
+case OUTDEV_PDF:
+xOutput->SetBackground(rOutput.GetBackground());
+xOutput->Erase();
+break;
+}
 
 //set ReallyVisible to match Visible, we restore the original state after 
Paint
 WindowImpl* pImpl = pWindow->ImplGetWindowImpl();
@@ -1297,7 +1309,19 @@ void SalInstanceWidget::DoRecursivePaint(vcl::Window* 
pWindow, const Point& rRen
 
 pImpl->mbReallyVisible = bRVisible;
 
-rOutput.DrawOutDev(rRenderLogicPos, aRenderLogicSize, Point(), 
aTempLogicSize, *xOutput);
+switch (rOutput.GetOutDevType())
+{
+case OUTDEV_WINDOW:
+case OUTDEV_VIRDEV:
+rOutput.DrawOutDev(rRenderLogicPos, aRenderLogicSize, Point(), 
aTempLogicSize,
+   *xOutput);
+break;
+case OUTDEV_PRINTER:
+case OUTDEV_PDF:
+rOutput.DrawBitmapEx(rRenderLogicPos, aRenderLogicSize,
+ xOutput->GetBitmapEx(Point(), 
aTempLogicSize));
+break;
+}
 
 xOutput.disposeAndClear();
 


[Libreoffice-commits] core.git: sfx2/source

2021-09-28 Thread Noel Grandin (via logerrit)
 sfx2/source/notify/globalevents.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit a69987dfd496413792d9bef5cb071615dd7ab375
Author: Noel Grandin 
AuthorDate: Tue Sep 28 15:41:28 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Sep 28 22:10:26 2021 +0200

fix deadlock on exit (attempt2)

regression from
commit 8122c82d90117fc0c4c8ea87aa7f771d5e92bf36
osl::Mutex->std::mutex in SfxGlobalEvents_Imp

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

diff --git a/sfx2/source/notify/globalevents.cxx 
b/sfx2/source/notify/globalevents.cxx
index 71fdd8a70aae..aba0d718c7d0 100644
--- a/sfx2/source/notify/globalevents.cxx
+++ b/sfx2/source/notify/globalevents.cxx
@@ -246,13 +246,15 @@ void SfxGlobalEvents_Impl::dispose() {
 if (m_disposed)
 return;
 m_disposed = true;
-auto tmp = std::move(m_xEvents);
+auto tmpEvents = std::move(m_xEvents);
+auto tmpModels = std::move(m_lModels);
 m_xJobExecutorListener.clear();
 m_disposeListeners.swap(listeners);
 m_lModels.clear();
 g.unlock();
-// clear events outside lock because it will trigger a call back into 
us
-tmp.clear();
+// clear events&models outside lock because it will trigger a call 
back into us
+tmpEvents.clear();
+tmpModels.clear();
 g.lock();
 m_aLegacyListeners.disposeAndClear(g, {static_cast(this)});
 g.lock(); // because disposeAndClear is going to want to unlock()


_ssl.cpython-3.8.so does not exist in the tarball

2021-09-28 Thread mcmurchy1917techy

Did a pull over the weekend.

Compiled and got this error.


[build DEP] LNK:Library/libcuilo.so
[build DEP] LNK:Library/libcuilo.so
[build LNK] Library/libcuilo.so
/home/master/master/external/python3/ExternalPackage_python3.mk:46: *** file 
/home/master/master/workdir/UnpackedTarball/python3/LO_lib/_ssl.cpython-3.8.so does not exist in the tarball.  Stop.

make[1]: *** Waiting for unfinished jobs
make: *** [Makefile:288: build] Error 2


My autogen has this flag --enable-python=internal. If I remove the flag  --enable-python=internal libreoffice compiles 
successfully.


I'm a bit behind the curve, the last time I compiled was June 12th also with  
--enable-python=internal, that was successful

What do I need to do to resolve?

My system has the python3 3.9.6 package. Have I got myself ahead of the curve?

Regards

Alex




[Libreoffice-commits] core.git: Branch 'libreoffice-7-2-2' - sc/inc sc/source

2021-09-28 Thread Eike Rathke (via logerrit)
 sc/inc/queryentry.hxx  |9 +-
 sc/source/core/data/column3.cxx|2 
 sc/source/core/data/table3.cxx |  121 ++---
 sc/source/core/tool/queryentry.cxx |3 
 4 files changed, 94 insertions(+), 41 deletions(-)

New commits:
commit dc1642c3225ff4aeada5df749946f406772eb1ff
Author: Eike Rathke 
AuthorDate: Tue Sep 28 00:19:47 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Sep 29 06:32:18 2021 +0200

Resolves: tdf#144740 Fix broken compareByValue() query, tdf#142910 
tdf#144253

Fix regression of a series of commits that, intended for filter
queries, unconditionally round numeric values as shown under
ScTable::ValidQuery() and compareByValue() without having taken
into account that the same query and compare functions are used by
the interpreter for all functions that use query criteria,
possibly delivering completely wrong results including in
backports to 7.2.0.0

commit f6b143a57d9bd8f5d7b29febcb4e01ee1eb2ff1d
CommitDate: Wed Jul 7 17:44:46 2021 +0200

tdf#142910 sc filter: fix "greater than" or "smaller than" etc

commit 51375b48378915b6e95c1ac26b2ccf8e39880f7e
CommitDate: Tue Sep 21 11:06:35 2021 +0200

tdf#144253 tdf#144324 sc filter: use formatted values in filters

Several related and intertwined commits in filter context make
assumptions about these queries always being executed rounded, so
the only clean solution is to make that depend on the
ScQueryEntry::Item being passed. Its mbRoundForFilter value is set
to true for all items of all queries executed via ScTable::Query()
and ScTable::GetFilteredFilterEntries(). It might be not all are
necessary (or some even still harmful?) and unnecessarily
obtaining number formats and calling RoundValueAsShown() is still
a bottle neck for those, but that should be addressed and reworked
independently. The important part is calculations work as before.

Also, moved obtaining number formats for calling RoundValueAsShown()
into logic that calls them only if necessary.

Note the TODO in compareByValue() about suspicious rounding of
rItem.mfVal in filter context that is to be addressed.

Change-Id: Ieb178ad1ea15a635caeb1ba698c2f4b7ad676d57
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122729
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit b60b6bfaafa1315e07108dba50f016975b619c59)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122736
Reviewed-by: Xisco Fauli 
Reviewed-by: Mike Kaganski 
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/sc/inc/queryentry.hxx b/sc/inc/queryentry.hxx
index 94ea761c1239..9b0b1cd98124 100644
--- a/sc/inc/queryentry.hxx
+++ b/sc/inc/queryentry.hxx
@@ -44,13 +44,14 @@ struct SC_DLLPUBLIC ScQueryEntry
 
 struct SAL_DLLPRIVATE Item
 {
-QueryType meType;
-doublemfVal;
+QueryType meType;
+doublemfVal;
 svl::SharedString maString;
+Color maColor;
 bool  mbMatchEmpty;
-Color maColor;
+bool  mbRoundForFilter;
 
-Item() : meType(ByValue), mfVal(0.0), mbMatchEmpty(false) {}
+Item() : meType(ByValue), mfVal(0.0), mbMatchEmpty(false), 
mbRoundForFilter(false) {}
 
 bool operator== (const Item& r) const;
 };
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 49c646073e27..ab34d8297c27 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2500,7 +2500,7 @@ class FilterEntriesHandler
 pFormatter->GetInputLineString(fVal, nIndex, aStr);
 }
 // store the formatted/rounded value for filtering
-if (nFormat && !bDate)
+if ((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) != 0 && !bDate)
 mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, 
rColumn.GetDoc().RoundValueAsShown(fVal, nFormat), ScTypedStrData::Value, 
bDate));
 else
 mrFilterEntries.push_back(ScTypedStrData(aStr, fVal, fVal, 
ScTypedStrData::Value, bDate));
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 5caea5500fda..08be06aa15b7 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2443,6 +2443,17 @@ public:
 return mrTab.HasStringData(nCol, nRow);
 }
 
+sal_uInt32 getNumFmt( SCCOL nCol, SCROW nRow, const ScInterpreterContext* 
pContext )
+{
+sal_uInt32 nNumFmt = (pContext ?
+mrTab.GetNumberFormat(*pContext, ScAddress(nCol, nRow, 
mrTab.GetTab())) :
+mrTab.GetNumberFormat(nCol, nRow));
+if (nNumFmt && (nNumFmt % SV_COUNTRY_LANGUAGE_OFFSET) == 0)
+// Any General of any locale is irrel

[Libreoffice-commits] core.git: Branch 'libreoffice-7-2-2' - connectivity/source

2021-09-28 Thread Caolán McNamara (via logerrit)
 connectivity/source/commontools/dbconversion.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 2736a88f77e02786343c21359adfb6f6bb04beab
Author: Caolán McNamara 
AuthorDate: Sun Sep 26 14:23:54 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Sep 29 07:36:31 2021 +0200

ofz#39301 month has to be in range [1-12]

Change-Id: I5a4ca534b24098342d8f465a32bc1887f40f5b63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122646
Reviewed-by: Michael Stahl 
Reviewed-by: Xisco Fauli 
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/connectivity/source/commontools/dbconversion.cxx 
b/connectivity/source/commontools/dbconversion.cxx
index 13a799e55a9a..96b1f1dcfd0a 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -163,10 +164,13 @@ namespace dbtools
 ;
 }
 
-
 static sal_Int32 implDaysInMonth(sal_Int32 _nMonth, sal_Int32 _nYear)
 {
-OSL_ENSURE(_nMonth > 0 && _nMonth < 13,"Month as invalid value!");
+SAL_WARN_IF(_nMonth < 1 || _nMonth > 12, "connectivity.commontools", 
"Month has invalid value: " << _nMonth);
+if (_nMonth < 1)
+_nMonth = 1;
+else if (_nMonth > 12)
+_nMonth = 12;
 if (_nMonth != 2)
 return aDaysInMonth[_nMonth-1];
 else
@@ -178,7 +182,6 @@ namespace dbtools
 }
 }
 
-
 static sal_Int32 implRelativeToAbsoluteNull(const css::util::Date& _rDate)
 {
 sal_Int32 nDays = 0;


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2-2' - connectivity/source

2021-09-28 Thread Caolán McNamara (via logerrit)
 connectivity/source/drivers/dbase/DTable.cxx |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 4e76220028b5db5018425a08c764ec073020232c
Author: Caolán McNamara 
AuthorDate: Sun Sep 26 14:05:37 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Sep 29 07:37:28 2021 +0200

ofz#39304 short timestamp record

Change-Id: I8f783473dd5d4679846c7c866cd1853ef7d919fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122645
Reviewed-by: Michael Stahl 
Reviewed-by: Xisco Fauli 
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/connectivity/source/drivers/dbase/DTable.cxx 
b/connectivity/source/drivers/dbase/DTable.cxx
index 5b1ea452f61a..8b36eb3b3cf4 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -772,10 +772,8 @@ bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const 
OSQLColumns & _rCols, bool
 for (std::size_t i = 1; aIter != aEnd && nByteOffset <= m_nBufferSize && i 
< nCount;++aIter, i++)
 {
 // Lengths depending on data type:
-sal_Int32 nLen = 0;
-sal_Int32 nType = 0;
-nLen= m_aPrecisions[i-1];
-nType   = m_aTypes[i-1];
+sal_Int32 nLen = m_aPrecisions[i-1];
+sal_Int32 nType = m_aTypes[i-1];
 
 switch(nType)
 {
@@ -834,8 +832,13 @@ bool ODbaseTable::fetchRow(OValueRefRow& _rRow, const 
OSQLColumns & _rCols, bool
 else if ( DataType::TIMESTAMP == nType )
 {
 sal_Int32 nDate = 0,nTime = 0;
+if (o3tl::make_unsigned(nLen) < 8)
+{
+SAL_WARN("connectivity.drivers", "short TIMESTAMP");
+return false;
+}
 memcpy(&nDate, pData, 4);
-memcpy(&nTime, pData+ 4, 4);
+memcpy(&nTime, pData + 4, 4);
 if ( !nDate && !nTime )
 {
 (*_rRow)[i]->setNull();


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2-2' - sc/qa sc/source

2021-09-28 Thread Daniel Arato (NISZ) (via logerrit)
 sc/qa/unit/data/ods/header-footer-content.ods |binary
 sc/qa/unit/subsequent_export-test2.cxx|   36 ++
 sc/source/filter/xml/XMLTableMasterPageExport.cxx |2 -
 3 files changed, 37 insertions(+), 1 deletion(-)

New commits:
commit f75ec59c9a77065d4a39a4b433b139cabe1405e1
Author: Daniel Arato (NISZ) 
AuthorDate: Wed Sep 22 15:03:48 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Sep 29 07:38:33 2021 +0200

tdf#144184 sc: fix first page footer export

Due to a typical case of copy-paste oversight LO Calc used to lose
the first page footer when exporting to ODS. With the typo fixed,
the export now works again.

Follow-up to commit 19fa853ce12136b5c14e0c5a0aa906c296b75388
"tdf#121715 XLSX: support custom first page header/footer".

Change-Id: If8f5ab4ff9a9392768789b886218d1d9c56ddbae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122455
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/+/122764
Tested-by: Jenkins
(cherry picked from commit ccd1393611ff7ea71d2dc5d75b0c27a4794ebdbb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122742
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/sc/qa/unit/data/ods/header-footer-content.ods 
b/sc/qa/unit/data/ods/header-footer-content.ods
new file mode 100644
index ..f365748ddc22
Binary files /dev/null and b/sc/qa/unit/data/ods/header-footer-content.ods 
differ
diff --git a/sc/qa/unit/subsequent_export-test2.cxx 
b/sc/qa/unit/subsequent_export-test2.cxx
index 77e4bc37673e..f3bf709500b4 100644
--- a/sc/qa/unit/subsequent_export-test2.cxx
+++ b/sc/qa/unit/subsequent_export-test2.cxx
@@ -82,6 +82,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
@@ -125,6 +126,7 @@ public:
 void testRefStringConfigXLSX();
 void testRefStringUnspecified();
 void testHeaderImageODS();
+void testHeaderFooterContentODS();
 
 void testTdf88657ODS();
 void testTdf41722();
@@ -227,6 +229,7 @@ public:
 CPPUNIT_TEST(testRefStringConfigXLSX);
 CPPUNIT_TEST(testRefStringUnspecified);
 CPPUNIT_TEST(testHeaderImageODS);
+CPPUNIT_TEST(testHeaderFooterContentODS);
 
 CPPUNIT_TEST(testTdf88657ODS);
 CPPUNIT_TEST(testTdf41722);
@@ -474,6 +477,39 @@ void ScExportTest2::testHeaderImageODS()
 xDocSh->DoClose();
 }
 
+void ScExportTest2::testHeaderFooterContentODS()
+{
+ScDocShellRef xShell = loadDoc(u"header-footer-content.", FORMAT_ODS);
+ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_ODS);
+uno::Reference 
xStyleFamiliesSupplier(xDocSh->GetModel(),
+ 
uno::UNO_QUERY);
+uno::Reference xStyleFamilies
+= xStyleFamiliesSupplier->getStyleFamilies();
+uno::Reference 
xPageStyles(xStyleFamilies->getByName("PageStyles"),
+   uno::UNO_QUERY);
+uno::Reference 
xStyle(xPageStyles->getByName("Default"), uno::UNO_QUERY);
+
+uno::Reference xContent;
+xStyle->getPropertyValue("RightPageHeaderContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("header"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("FirstPageHeaderContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("first page header"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("RightPageFooterContent") >>= xContent;
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("footer"), 
xContent->getCenterText()->getString());
+
+xStyle->getPropertyValue("FirstPageFooterContent") >>= xContent;
+// First page footer content used to be lost upon export.
+CPPUNIT_ASSERT(xContent.is());
+CPPUNIT_ASSERT_EQUAL(OUString("first page footer"), 
xContent->getCenterText()->getString());
+
+xDocSh->DoClose();
+}
+
 void ScExportTest2::testTextDirectionXLSX()
 {
 ScDocShellRef xDocSh = loadDoc(u"writingMode.", FORMAT_XLSX);
diff --git a/sc/source/filter/xml/XMLTableMasterPageExport.cxx 
b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
index bf43b2c29fb2..59b29378ea16 100644
--- a/sc/source/filter/xml/XMLTableMasterPageExport.cxx
+++ b/sc/source/filter/xml/XMLTableMasterPageExport.cxx
@@ -187,7 +187,7 @@ void XMLTableMasterPageExport::exportMasterPageContent(
 
 bool bFirstFooter = (!::cppu::any2bool(rPropSet->getPropertyValue( 
SC_UNO_PAGE_FIRSTFTRSHARED )) && bFooter);
 
-exportHeaderFooter( xFooterLeft, XML_FOOTER_FIRST, bFirstFooter );
+exportHeaderFooter( xFooterFirst, XML_FOOTER_FIRST, bFirstFooter );
 }
 }
 


[Libreoffice-commits] core.git: sw/source sw/uiconfig

2021-09-28 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/inc/conttree.hxx  |1 +
 sw/source/uibase/utlui/content.cxx |   21 +++--
 sw/uiconfig/swriter/ui/navigatorcontextmenu.ui |8 
 3 files changed, 28 insertions(+), 2 deletions(-)

New commits:
commit 38eb9a0594393e263f57701702974a030d3327de
Author: Jim Raykowski 
AuthorDate: Thu Sep 16 21:02:44 2021 -0800
Commit: Jim Raykowski 
CommitDate: Wed Sep 29 08:57:00 2021 +0200

tdf#144335 SwNavigator: Table tracking option

Adds a check button to the table context menu in the content tree to
turn table tracking on or off.

Change-Id: I787dc2f3e3b465d7f25a9e16b5f5491dc2d933d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122218
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 

diff --git a/sw/source/uibase/inc/conttree.hxx 
b/sw/source/uibase/inc/conttree.hxx
index 78e078cc78f3..9364e36c6181 100644
--- a/sw/source/uibase/inc/conttree.hxx
+++ b/sw/source/uibase/inc/conttree.hxx
@@ -112,6 +112,7 @@ class SwContentTree final : public SfxListener
 sal_uInt8   m_nOutlineLevel;
 
 sal_uInt32  m_nOutlineTracking = 1;
+bool m_bTableTracking = true;
 
 enum class State { ACTIVE, CONSTANT, HIDDEN } m_eState;
 
diff --git a/sw/source/uibase/utlui/content.cxx 
b/sw/source/uibase/utlui/content.cxx
index 5933b3cf26f8..ae46fe4272c6 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -1570,6 +1570,7 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 bool bRemoveToggleExpandEntry = true;
 bool bRemoveChapterEntries = true;
 bool bRemoveSendOutlineEntry = true;
+bool bRemoveTableTracking = true;
 
 // Edit only if the shown content is coming from the current view.
 if (State::HIDDEN != m_eState &&
@@ -1632,6 +1633,8 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 bool bProt = m_pActiveShell->HasTableAnyProtection( 
&sTableName, &bFull );
 xPop->set_sensitive(OString::number(403), !bFull);
 xPop->set_sensitive(OString::number(404), bProt);
+xPop->set_active("tabletracking", m_bTableTracking);
+bRemoveTableTracking = false;
 bRemoveDeleteEntry = false;
 }
 else if(ContentTypeId::DRAWOBJECT == nContentType)
@@ -1684,11 +1687,16 @@ IMPL_LINK(SwContentTree, CommandHdl, const 
CommandEvent&, rCEvt, bool)
 bRemoveToggleExpandEntry = 
lcl_InsertExpandCollapseAllItem(*m_xTreeView, *xEntry,

*xPop);
 }
-if (State::HIDDEN != m_eState &&
+else if (State::HIDDEN != m_eState &&
 pType->GetType() == ContentTypeId::POSTIT &&
 !m_pActiveShell->GetView().GetDocShell()->IsReadOnly() &&
 pType->GetMemberCount() > 0)
 bRemovePostItEntries = false;
+else if (ContentTypeId::TABLE == pType->GetType())
+{
+xPop->set_active("tabletracking", m_bTableTracking);
+bRemoveTableTracking = false;
+}
 }
 }
 
@@ -1773,6 +1781,9 @@ IMPL_LINK(SwContentTree, CommandHdl, const CommandEvent&, 
rCEvt, bool)
 xPop->remove("separator1511");
 }
 
+if (bRemoveTableTracking)
+xPop->remove("tabletracking");
+
 OString sCommand = xPop->popup_at_rect(m_xTreeView.get(), 
tools::Rectangle(rCEvt.GetMousePosPixel(), Size(1,1)));
 if (!sCommand.isEmpty())
 ExecuteContextMenuAction(sCommand);
@@ -3552,7 +3563,7 @@ void SwContentTree::UpdateTracking()
 return;
 }
 // table
-if (m_pActiveShell->IsCursorInTable()  &&
+if (m_bTableTracking && m_pActiveShell->IsCursorInTable() &&
 !(m_bIsRoot && m_nRootType != ContentTypeId::TABLE))
 {
 if(m_pActiveShell->GetTableFormat())
@@ -4062,6 +4073,12 @@ IMPL_LINK(SwContentTree, QueryTooltipHdl, const 
weld::TreeIter&, rEntry, OUStrin
 
 void SwContentTree::ExecuteContextMenuAction(const OString& 
rSelectedPopupEntry)
 {
+if (rSelectedPopupEntry == "tabletracking")
+{
+m_bTableTracking = !m_bTableTracking;
+return;
+}
+
 std::unique_ptr xFirst(m_xTreeView->make_iterator());
 if (!m_xTreeView->get_selected(xFirst.get()))
 xFirst.reset();
diff --git a/sw/uiconfig/swriter/ui/navigatorcontextmenu.ui 
b/sw/uiconfig/swriter/ui/navigatorcontextmenu.ui
index 8c27c7e07c28..c3a5b64bde47 100644
--- a/sw/uiconfig/swriter/ui/navigatorcontextmenu.ui
+++ b/sw/uiconfig/swriter/ui/navigatorcontextmenu.ui
@@ -230,6 +230,14 @@
 
   
 
+
+  
+True
+False
+Table Tracking
+True
+  
+
 
   
 True