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

2022-04-15 Thread Justin Luth (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf148380_modifiedField.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport17.cxx |   17 +
 sw/source/filter/ww8/ww8atr.cxx|4 +--
 3 files changed, 19 insertions(+), 2 deletions(-)

New commits:
commit d9b33ed6644203141fdb0776c291425c2bc9f5ac
Author: Justin Luth 
AuthorDate: Wed Apr 6 18:54:02 2022 +0200
Commit: Justin Luth 
CommitDate: Sat Apr 16 05:47:06 2022 +0200

tdf#148380 docx export: support CHANGEDATE/PRINTDATE without format

This is the same idea as the earlier patch for CREATEDATE.
However, it isn't safe to import these as fields,
so a round-trip test can only test the string itself.

The unit test here really doesn't test any of the code changes,
but is just pre-emptive to ensure that if DI_CHANGE
is imported as a field that it will have the right
output.
(P.S. Expected date output matches MS Word 2003
 even after an F9 refresh.)

Change-Id: I30a8b1fc851246898a67e6241a35e927f85dfbb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132664
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/sw/qa/extras/ooxmlexport/data/tdf148380_modifiedField.docx 
b/sw/qa/extras/ooxmlexport/data/tdf148380_modifiedField.docx
new file mode 100644
index ..14f6e319e298
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf148380_modifiedField.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index 960bb3f16d8b..5d5bdb22471a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -83,6 +83,23 @@ DECLARE_OOXMLEXPORT_TEST(testTdf148380_createField, 
"tdf148380_createField.docx"
 CPPUNIT_ASSERT_EQUAL(OUString("yesterday at noon"), 
xField->getPresentation(false));
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf148380_modifiedField, 
"tdf148380_modifiedField.docx")
+{
+getParagraph(2, "4/5/2022 4:29:00 PM"); // default (unspecified) date 
format
+
+// Verify that these are fields, and not just plain text
+uno::Reference xTextFieldsSupplier(mxComponent, 
uno::UNO_QUERY);
+auto xFieldsAccess(xTextFieldsSupplier->getTextFields());
+uno::Reference 
xFields(xFieldsAccess->createEnumeration());
+uno::Reference xField(xFields->nextElement(), 
uno::UNO_QUERY);
+// unspecified SAVEDATE gets default US formatting because style.xml has 
w:lang w:val="en-US"
+//CPPUNIT_ASSERT_EQUAL(OUString("4/5/2022 4:29:00 PM"), 
xField->getPresentation(false));
+//xField.set(xFields->nextElement(), uno::UNO_QUERY);
+// FIXME: This was hand-modified and really should be Charlie Brown
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Did you fix me? I really should be Charlie 
Brown (or a date)",
+ OUString("Charles Brown"), 
xField->getPresentation(false));
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testTdf135906)
 {
 loadAndReload("tdf135906.docx");
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index b9c71e4433ae..a5e650eb8e6c 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2948,13 +2948,13 @@ void AttributeOutputBase::TextField( const 
SwFormatField& rField )
 case DI_CHANGE:
 if (DI_SUB_AUTHOR == (nSubType & DI_SUB_MASK))
 eField = ww::eLASTSAVEDBY;
-else if (GetExport().GetNumberFormat(*pField, sStr))
+else if (GetExport().GetNumberFormat(*pField, sStr) || 
sStr.isEmpty())
 eField = ww::eSAVEDATE;
 break;
 
 case DI_PRINT:
 if (DI_SUB_AUTHOR != (nSubType & DI_SUB_MASK) &&
-GetExport().GetNumberFormat(*pField, sStr))
+(GetExport().GetNumberFormat(*pField, sStr) || 
sStr.isEmpty()))
 eField = ww::ePRINTDATE;
 break;
 case DI_CUSTOM:


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

2022-04-15 Thread Caolán McNamara (via logerrit)
 vcl/workben/commonfuzzer.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 4659fc2f0a7223a89446edff0b77e58758b5edf5
Author: Caolán McNamara 
AuthorDate: Fri Apr 15 20:07:25 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sat Apr 16 00:14:25 2022 +0200

ofz#46632 Direct-leak

there is no DeinitVCL for fuzzing, so fill the fontoptions,etc cache
before starting

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

diff --git a/vcl/workben/commonfuzzer.hxx b/vcl/workben/commonfuzzer.hxx
index c9afd65552fe..e64a53dda644 100644
--- a/vcl/workben/commonfuzzer.hxx
+++ b/vcl/workben/commonfuzzer.hxx
@@ -129,6 +129,8 @@ void CommonInitialize(int *argc, char ***argv)
 psp::PrintFontManager::get();
 //get the printer info
 Printer::GetPrinterQueues();
+//Draw some text to fill CairoTextRender fontoptions cache
+Application::GetDefaultDevice()->DrawText(Point(0, 0), "hello world");
 
 //https://github.com/google/oss-fuzz/issues/1449
 //https://github.com/google/oss-fuzz/issues/5441


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

2022-04-15 Thread Xisco Fauli (via logerrit)
 sw/qa/uitest/writer_tests/tdf148551.py |   44 +
 1 file changed, 44 insertions(+)

New commits:
commit cb21bbc1210dc270a125613d571521701e379ff9
Author: Xisco Fauli 
AuthorDate: Fri Apr 15 18:27:41 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Apr 15 23:22:01 2022 +0200

tdf#148551: sw: Add UItest

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

diff --git a/sw/qa/uitest/writer_tests/tdf148551.py 
b/sw/qa/uitest/writer_tests/tdf148551.py
new file mode 100644
index ..2d0de314b65a
--- /dev/null
+++ b/sw/qa/uitest/writer_tests/tdf148551.py
@@ -0,0 +1,44 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-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/.
+#
+
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import select_pos
+
+class Tdf148551(UITestCase):
+
+def test_tdf148551(self):
+
+with self.ui_test.create_doc_in_start_center("writer") as document:
+xWriterDoc = self.xUITest.getTopFocusWindow()
+xWriterEdit = xWriterDoc.getChild("writer_edit")
+
+with 
self.ui_test.execute_modeless_dialog_through_command(".uno:InsertField", 
close_button="cancel") as xDialog:
+xTab = xDialog.getChild("tabcontrol")
+select_pos(xTab, "0")
+
+xDoc = xDialog.getChild("type-doc")
+xDoc.getChild('7').executeAction("SELECT", tuple())
+self.assertEqual("Statistics", 
get_state_as_dict(xDoc)['SelectEntryText'])
+
+xSelect = xDialog.getChild("select-doc")
+self.assertEqual("Pages", 
get_state_as_dict(xSelect)['SelectEntryText'])
+
+xFormat = xDialog.getChild("format-doc")
+self.assertEqual("As Page Style", 
get_state_as_dict(xFormat)['SelectEntryText'])
+
+xOk = xDialog.getChild("ok")
+xOk.executeAction("CLICK", tuple())
+
+# Without the fix in place, this test would have failed with
+# AssertionError: '1' != 'A'
+self.assertEqual("1", 
document.Text.createEnumeration().nextElement().String)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:


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

2022-04-15 Thread Xisco Fauli (via logerrit)
 sw/qa/uitest/writer_tests/tdf135377.py |   46 +
 1 file changed, 46 insertions(+)

New commits:
commit b4b3398736d42bf1e3de4b397510576fdc5c3338
Author: Xisco Fauli 
AuthorDate: Fri Apr 15 19:57:30 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Apr 15 22:35:48 2022 +0200

tdf#135377: sw: Add UItest

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

diff --git a/sw/qa/uitest/writer_tests/tdf135377.py 
b/sw/qa/uitest/writer_tests/tdf135377.py
new file mode 100644
index ..b5751bedf8ab
--- /dev/null
+++ b/sw/qa/uitest/writer_tests/tdf135377.py
@@ -0,0 +1,46 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-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/.
+#
+
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict
+from uitest.uihelper.common import select_pos
+
+class Tdf135377(UITestCase):
+
+def test_tdf135377(self):
+
+with self.ui_test.create_doc_in_start_center("writer") as writer_doc:
+
+with 
self.ui_test.execute_modeless_dialog_through_command(".uno:InsertField", 
close_button="cancel") as xDialog:
+xTab = xDialog.getChild("tabcontrol")
+select_pos(xTab, "4")
+
+xType = xDialog.getChild("type-var")
+xType.getChild('8').executeAction("SELECT", tuple())
+self.assertEqual("User Field", 
get_state_as_dict(xType)['SelectEntryText'])
+
+xName = xDialog.getChild("name-var")
+xName.executeAction("TYPE", mkPropertyValues({"TEXT": "AA"}))
+
+xValue = xDialog.getChild("value-var")
+xValue.executeAction("TYPE", mkPropertyValues({"TEXT": "BB"}))
+
+xNumFormat = xDialog.getChild("numformat-var")
+
+# Without the fix in place, this test would have failed with
+# AssertionError: 'General' != ''
+self.assertEqual("General", 
get_state_as_dict(xNumFormat)['SelectEntryText'])
+
+xApplyBtn = xDialog.getChild("apply")
+xApplyBtn.executeAction("CLICK", ())
+
+self.assertEqual("AA", 
get_state_as_dict(xDialog.getChild("select-var"))["SelectEntryText"])
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:


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

2022-04-15 Thread Regina Henschel (via logerrit)
 oox/source/export/shapes.cxx  |6 +--
 sd/qa/unit/data/odp/tdf109169_Diamond.odp |binary
 sd/qa/unit/data/odp/tdf109169_Octagon.odp |binary
 sd/qa/unit/export-tests-ooxml3.cxx|   46 ++
 4 files changed, 49 insertions(+), 3 deletions(-)

New commits:
commit b195cf4db4c21da3cf754689fb22f0b6a904a03e
Author: Regina Henschel 
AuthorDate: Fri Apr 15 15:04:16 2022 +0200
Commit: Regina Henschel 
CommitDate: Fri Apr 15 22:16:40 2022 +0200

tdf#109169 use custGeom for Octagon Bevel shape

The shapes 'Octagon Bevel', type col_60da8460, and 'Diamond Bevel',
type col-502ad400, are LO specific preset shapes. They have neither a
counterpart in MS binary nor in OOXML. So they need to be exported
with custGeom. To force custGeom these shape types are moved from
vDenylist to vAllowlist.
These shapes were exported as prst='rect' before.

Change-Id: I9619345812b6dba8f14ec2cc6a92ae808a56b595
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133069
Tested-by: Jenkins
Reviewed-by: Regina Henschel 

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index e4d378bd6111..3308d5ab4492 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -551,8 +551,6 @@ static bool lcl_IsOnDenylist(OUString const & rShapeType)
 u"flower",
 u"bracket-pair",
 u"brace-pair",
-u"col-60da8460",
-u"col-502ad400",
 u"quad-bevel",
 u"round-rectangular-callout",
 u"rectangular-callout",
@@ -605,7 +603,9 @@ static bool lcl_IsOnAllowlist(OUString const & rShapeType)
 {
 static const std::initializer_list vAllowlist = {
 u"heart",
-u"puzzle"
+u"puzzle",
+u"col-60da8460",
+u"col-502ad400"
 };
 
 return std::find(vAllowlist.begin(), vAllowlist.end(), rShapeType) != 
vAllowlist.end();
diff --git a/sd/qa/unit/data/odp/tdf109169_Diamond.odp 
b/sd/qa/unit/data/odp/tdf109169_Diamond.odp
new file mode 100644
index ..cd6a18d1b318
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf109169_Diamond.odp differ
diff --git a/sd/qa/unit/data/odp/tdf109169_Octagon.odp 
b/sd/qa/unit/data/odp/tdf109169_Octagon.odp
new file mode 100644
index ..f35e746f3b28
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf109169_Octagon.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml3.cxx 
b/sd/qa/unit/export-tests-ooxml3.cxx
index 3f4bec336ef1..23486c66f254 100644
--- a/sd/qa/unit/export-tests-ooxml3.cxx
+++ b/sd/qa/unit/export-tests-ooxml3.cxx
@@ -11,6 +11,7 @@
 #include 
 #include "sdmodeltestbase.hxx"
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -21,6 +22,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -107,6 +109,8 @@ public:
 void testTdf140912_PicturePlaceholder();
 void testEnhancedPathViewBox();
 void testTdf74670();
+void testTdf109169_OctagonBevel();
+void testTdf109169_DiamondBevel();
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest3);
 
@@ -184,6 +188,8 @@ public:
 CPPUNIT_TEST(testTdf140912_PicturePlaceholder);
 CPPUNIT_TEST(testEnhancedPathViewBox);
 CPPUNIT_TEST(testTdf74670);
+CPPUNIT_TEST(testTdf109169_OctagonBevel);
+CPPUNIT_TEST(testTdf109169_DiamondBevel);
 CPPUNIT_TEST_SUITE_END();
 
 virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
@@ -1919,6 +1925,46 @@ void SdOOXMLExportTest3::testTdf74670()
 CPPUNIT_ASSERT_EQUAL(1, nImageFiles);
 }
 
+void SdOOXMLExportTest3::testTdf109169_OctagonBevel()
+{
+// The document has a shape 'Octagon Bevel'. It consists of an octagon 
with 8 points and eight
+// facets with 4 points each, total 8+8*4=40 points. Without the patch it 
was exported as
+// rectangle and thus had 4 points.
+::sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf109169_Octagon.odp"),
 ODP);
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+
+auto xPropSet(getShapeFromPage(0, 0, xDocShRef));
+auto aGeomPropSeq = xPropSet->getPropertyValue("CustomShapeGeometry")
+.get>();
+comphelper::SequenceAsHashMap aCustomShapeGeometry(aGeomPropSeq);
+auto 
aPathSeq((aCustomShapeGeometry["Path"]).get>());
+comphelper::SequenceAsHashMap aPath(aPathSeq);
+auto aCoordinates(
+
(aPath["Coordinates"]).get>());
+CPPUNIT_ASSERT_EQUAL(sal_Int32(40), aCoordinates.getLength());
+}
+
+void SdOOXMLExportTest3::testTdf109169_DiamondBevel()
+{
+// The document has a shape 'Diamond Bevel'. It consists of a diamond with 
4 points and four
+// facets with 4 points each, total 4+4*4=20 points. Without the patch it 
was exported as
+// rectangle and thus had 4 points.
+::sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/odp/tdf109169_Diamond.odp"),
 ODP);
+xDocShRef = saveAndReload(xD

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

2022-04-15 Thread Noel Grandin (via logerrit)
 jvmfwk/inc/fwkutil.hxx |2 +-
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx |6 +++---
 jvmfwk/plugins/sunmajor/pluginlib/util.hxx |2 +-
 jvmfwk/source/fwkutil.cxx  |6 +++---
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 65e846d73c023cb8ed8a8393a91032d4a816f2a0
Author: Noel Grandin 
AuthorDate: Fri Apr 15 16:47:26 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 15 21:33:17 2022 +0200

use more string_view in jvmfwk

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

diff --git a/jvmfwk/inc/fwkutil.hxx b/jvmfwk/inc/fwkutil.hxx
index 825355f42a47..76d437ae76b9 100644
--- a/jvmfwk/inc/fwkutil.hxx
+++ b/jvmfwk/inc/fwkutil.hxx
@@ -46,7 +46,7 @@ osl::Mutex& FwkMutex();
 rtl::ByteSequence encodeBase16(const rtl::ByteSequence& rawData);
 rtl::ByteSequence decodeBase16(const rtl::ByteSequence& data);
 
-OUString getDirFromFile(const OUString& usFilePath);
+OUString getDirFromFile(std::u16string_view usFilePath);
 
 enum FileStatus
 {
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index f7d786007544..b596e18cf480 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -1023,10 +1023,10 @@ Reference 
createInstance(createInstance_func pFunc,
 return aBase;
 }
 
-inline OUString getDirFromFile(const OUString& usFilePath)
+inline OUString getDirFromFile(std::u16string_view usFilePath)
 {
-sal_Int32 index = usFilePath.lastIndexOf('/');
-return usFilePath.copy(0, index);
+size_t index = usFilePath.rfind('/');
+return OUString(usFilePath.substr(0, index));
 }
 
 void addJavaInfosFromPath(
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx 
b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
index 78df074f9de3..9ba0055832ed 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
@@ -37,7 +37,7 @@ void addJREInfoFromBinPath(
 const OUString& path,
 std::vector> & allInfos,
 std::vector> & addedInfos);
-inline OUString getDirFromFile(const OUString& usFilePath);
+inline OUString getDirFromFile(std::u16string_view usFilePath);
 void addJavaInfosFromPath(
 std::vector> & allInfos,
 std::vector> & addedInfos);
diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx
index ee083f064926..89cb2e5415cb 100644
--- a/jvmfwk/source/fwkutil.cxx
+++ b/jvmfwk/source/fwkutil.cxx
@@ -136,10 +136,10 @@ rtl::ByteSequence decodeBase16(const rtl::ByteSequence& 
data)
 return ret;
 }
 
-OUString getDirFromFile(const OUString& usFilePath)
+OUString getDirFromFile(std::u16string_view usFilePath)
 {
-sal_Int32 index = usFilePath.lastIndexOf('/');
-return usFilePath.copy(0, index);
+size_t index = usFilePath.rfind('/');
+return OUString(usFilePath.substr(0, index));
 }
 
 OUString getLibraryLocation()


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

2022-04-15 Thread Noel Grandin (via logerrit)
 cui/source/customize/cfgutil.cxx |   22 --
 cui/source/customize/macropg.cxx |   22 +++---
 cui/source/dialogs/scriptdlg.cxx |2 +-
 cui/source/inc/cfgutil.hxx   |2 +-
 4 files changed, 25 insertions(+), 23 deletions(-)

New commits:
commit 15d8762dd07289447e782a3812dfd4425fe9a82b
Author: Noel Grandin 
AuthorDate: Fri Apr 15 16:46:52 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 15 21:32:59 2022 +0200

use more string_view in cui

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

diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index aab25aa9bb8d..6b39170e18f7 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -54,6 +54,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -1027,22 +1028,23 @@ void CuiConfigGroupListBox::SelectMacro( const 
SfxMacroInfoItem *pItem )
 }
 
 void CuiConfigGroupListBox::SelectMacro( std::u16string_view rBasic,
- const OUString& rMacro )
+ std::u16string_view rMacro )
 {
 const OUString aBasicName(OUString::Concat(rBasic) + " " + 
xImp->m_sMacros);
-sal_Int32 nIdx {rMacro.lastIndexOf('.')};
-const OUString aMethod( rMacro.copy(nIdx+1) );
-OUString aLib;
-OUString aModule;
-if ( nIdx>0 )
+size_t nIdx {rMacro.rfind('.')};
+const std::u16string_view aMethod( rMacro.substr(nIdx == 
std::u16string_view::npos ? 0 : nIdx + 1) );
+std::u16string_view aLib;
+std::u16string_view aModule;
+if ( nIdx>0 && nIdx != std::u16string_view::npos )
 {
 // string contains at least 2 tokens
-nIdx = rMacro.lastIndexOf('.', nIdx);
-if (nIdx>=0)
+nIdx = rMacro.rfind('.', nIdx);
+if (nIdx != std::u16string_view::npos)
 {
 // string contains at least 3 tokens
-aLib = rMacro.getToken( 0, '.' );
-aModule = rMacro.getToken( 0, '.', ++nIdx );
+aLib = o3tl::getToken(rMacro, 0, '.' );
+sal_Int32 nIdx2 = nIdx + 1;
+aModule = o3tl::getToken(rMacro, 0, '.', nIdx2 );
 }
 }
 
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index b1df3957de8b..ed9e4f6c0c4d 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -269,21 +270,20 @@ bool SvxMacroTabPage_::IsReadOnly() const
 
 namespace
 {
-OUString GetEventDisplayText(const OUString &rURL)
+std::u16string_view GetEventDisplayText(std::u16string_view rURL)
 {
-if (rURL.isEmpty())
-return OUString();
-sal_Int32 nIndex = rURL.indexOf(aVndSunStarUNO);
-bool bUNO = nIndex == 0;
-OUString aPureMethod;
+if (rURL.empty())
+return std::u16string_view();
+bool bUNO = o3tl::starts_with(rURL, aVndSunStarUNO);
+std::u16string_view aPureMethod;
 if (bUNO)
 {
-aPureMethod = rURL.copy(aVndSunStarUNO.getLength());
+aPureMethod = rURL.substr(aVndSunStarUNO.getLength());
 }
 else
 {
-aPureMethod = rURL.copy(strlen("vnd.sun.star.script:"));
-aPureMethod = aPureMethod.copy( 0, aPureMethod.indexOf( '?' ) );
+aPureMethod = rURL.substr(strlen("vnd.sun.star.script:"));
+aPureMethod = aPureMethod.substr( 0, aPureMethod.find( '?' ) );
 }
 return aPureMethod;
 }
@@ -344,7 +344,7 @@ void SvxMacroTabPage_::DisplayAppEvents( bool appEvents)
 int nRow = mpImpl->xEventLB->n_children();
 mpImpl->xEventLB->append(sEventName, displayName);
 mpImpl->xEventLB->set_image(nRow, GetEventDisplayImage(eventURL), 1);
-mpImpl->xEventLB->set_text(nRow, GetEventDisplayText(eventURL), 2);
+mpImpl->xEventLB->set_text(nRow, 
OUString(GetEventDisplayText(eventURL)), 2);
 }
 
 mpImpl->xEventLB->thaw();
@@ -478,7 +478,7 @@ void 
SvxMacroTabPage_::GenericHandler_Impl(SvxMacroTabPage_* pThis, const weld::
 }
 
 rListBox.set_image(nEntry, GetEventDisplayImage(sEventURL), 1);
-rListBox.set_text(nEntry, GetEventDisplayText(sEventURL), 2);
+rListBox.set_text(nEntry, OUString(GetEventDisplayText(sEventURL)), 2);
 
 rListBox.select(nEntry );
 rListBox.scroll_to_row(nEntry);
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index 4294e56ebac0..0c349367b44d 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -1113,7 +1113,7 @@ OUString FormatErrorString(
 std::u16string_view type,
 std::u16string_view message )
 {
-OUString result = unformatted.copy( 0 );
+OUString result = unformatt

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

2022-04-15 Thread Xisco Fauli (via logerrit)
 sw/qa/uitest/data/tdf143483.odt|binary
 sw/qa/uitest/writer_tests/tdf143483.py |   57 +
 2 files changed, 57 insertions(+)

New commits:
commit 267a0e94920dbaf3f9db316c9cbfe6fa72be8818
Author: Xisco Fauli 
AuthorDate: Fri Apr 15 19:09:56 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Apr 15 21:22:44 2022 +0200

tdf#143483: sw: Add UItest

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

diff --git a/sw/qa/uitest/data/tdf143483.odt b/sw/qa/uitest/data/tdf143483.odt
new file mode 100644
index ..0b80ab196d57
Binary files /dev/null and b/sw/qa/uitest/data/tdf143483.odt differ
diff --git a/sw/qa/uitest/writer_tests/tdf143483.py 
b/sw/qa/uitest/writer_tests/tdf143483.py
new file mode 100644
index ..346fe60743db
--- /dev/null
+++ b/sw/qa/uitest/writer_tests/tdf143483.py
@@ -0,0 +1,57 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-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/.
+#
+
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
+
+class Tdf143483(UITestCase):
+
+def test_tdf143483(self):
+
+with self.ui_test.load_file(get_url_for_data_file("tdf143483.odt")) as 
document:
+
+self.xUITest.executeCommand(".uno:JumpToNextBookmark")
+
+with 
self.ui_test.execute_dialog_through_command(".uno:FieldDialog") as xDialog:
+
+xDoc = xDialog.getChild("type-doc")
+self.assertEqual("Chapter", 
get_state_as_dict(xDoc)['SelectEntryText'])
+
+xFormat = xDialog.getChild("format-doc")
+self.assertEqual("Chapter name", 
get_state_as_dict(xFormat)['SelectEntryText'])
+
+xNext = xDialog.getChild("next")
+xNext.executeAction("CLICK", tuple())
+
+self.assertEqual("Chapter", 
get_state_as_dict(xDoc)['SelectEntryText'])
+self.assertEqual("Chapter number", 
get_state_as_dict(xFormat)['SelectEntryText'])
+
+xNext.executeAction("CLICK", tuple())
+
+self.assertEqual("Chapter", 
get_state_as_dict(xDoc)['SelectEntryText'])
+self.assertEqual("Chapter number and name", 
get_state_as_dict(xFormat)['SelectEntryText'])
+
+xNext.executeAction("CLICK", tuple())
+
+self.assertEqual("Chapter", 
get_state_as_dict(xDoc)['SelectEntryText'])
+self.assertEqual("Chapter number without separator", 
get_state_as_dict(xFormat)['SelectEntryText'])
+
+xEnumeration = document.Text.createEnumeration()
+self.assertEqual("Another title", 
xEnumeration.nextElement().String)
+self.assertEqual("", xEnumeration.nextElement().String)
+self.assertEqual("1. Another title", 
xEnumeration.nextElement().String)
+
+# Without the fix in place, this test would have failed with
+# AssertionError: '2. Chapter 1 -' != '2. Another title'
+self.assertEqual("2. Chapter 1 -", 
xEnumeration.nextElement().String)
+self.assertEqual("3. Chapter 1 - Another title", 
xEnumeration.nextElement().String)
+self.assertEqual("4. 1", xEnumeration.nextElement().String)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:


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

2022-04-15 Thread Stephan Bergmann (via logerrit)
 compilerplugins/clang/includeform.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 4cc5ceb9e3349fccc8ba08fdacb444ae70c597eb
Author: Stephan Bergmann 
AuthorDate: Fri Apr 15 20:10:37 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 15 21:05:03 2022 +0200

Adapt to clang::PPCallbacks::InclusionDirective change in Clang 15 trunk



"[clang][lex] NFCI: Use FileEntryRef in PPCallbacks::InclusionDirective()"

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

diff --git a/compilerplugins/clang/includeform.cxx 
b/compilerplugins/clang/includeform.cxx
index d9e603351783..7b2c0feb07ea 100644
--- a/compilerplugins/clang/includeform.cxx
+++ b/compilerplugins/clang/includeform.cxx
@@ -28,13 +28,18 @@ private:
 
 void InclusionDirective(
 SourceLocation HashLoc, Token const & IncludeTok, StringRef,
-bool IsAngled, CharSourceRange FilenameRange, FileEntry const * File,
+bool IsAngled, CharSourceRange FilenameRange,
+#if CLANG_VERSION >= 15
+Optional File,
+#else
+FileEntry const * File,
+#endif
 StringRef SearchPath, StringRef, clang::Module const *, 
SrcMgr::CharacteristicKind) override
 {
 if (ignoreLocation(HashLoc)) {
 return;
 }
-if (File == nullptr) { // in case of "fatal error: '...' file not 
found"
+if (!File) { // in case of "fatal error: '...' file not found"
 return;
 }
 if (IncludeTok.getIdentifierInfo()->getPPKeywordID() != 
tok::pp_include)


[Libreoffice-commits] core.git: include/vcl svx/source vcl/inc vcl/source vcl/unx

2022-04-15 Thread Caolán McNamara (via logerrit)
 include/vcl/weld.hxx   |3 
 svx/source/tbxctrls/tbunosearchcontrollers.cxx |   29 ---
 vcl/inc/salvtables.hxx |7 +
 vcl/source/app/salvtables.cxx  |   81 ++
 vcl/unx/gtk3/gtkinst.cxx   |   92 +
 5 files changed, 201 insertions(+), 11 deletions(-)

New commits:
commit d1da1c59d196b7f6037b7e0820b81fc527d56a4c
Author: Caolán McNamara 
AuthorDate: Thu Apr 14 20:13:17 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 15 20:44:49 2022 +0200

tdf#148349 add a way to call the user's attention to a widget

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

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index bdef5b22b9ca..226e2cb6c21a 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -320,6 +320,9 @@ public:
 
 virtual VclPtr create_virtual_device() const = 0;
 
+//do something transient to attract the attention of the user to the widget
+virtual void call_attention_to() = 0;
+
 //make this widget look like a page in a notebook
 virtual void set_stack_background() = 0;
 //make this widget look like it has a highlighted background
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx 
b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index 6deb930c18f2..b168462baf2d 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -295,22 +295,29 @@ IMPL_LINK(FindTextFieldControl, KeyInputHdl, const 
KeyEvent&, rKeyEvent, bool)
 }
 }
 }
-// Select text in the search box when Ctrl-F pressed
-else if ( bMod1 && nCode == KEY_F )
-m_xWidget->select_entry_region(0, -1);
-
-// Execute the search when Ctrl-G, F3 and Shift-RETURN pressed (in 
addition to ActivateHdl condition which handles bare RETURN)
-else if ( (bMod1 && KEY_G == nCode) || (bShift && KEY_RETURN == nCode) || 
(KEY_F3 == nCode) )
-{
-ActivateFind(bShift);
-bRet = true;
-}
 else
 {
 auto awtKey = 
svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyEvent.GetKeyCode());
 const OUString aCommand(m_pAcc->findCommand(awtKey));
-if (aCommand == ".uno:SearchDialog")
+
+// Select text in the search box when Ctrl-F pressed
+if ( bMod1 && nCode == KEY_F )
+m_xWidget->select_entry_region(0, -1);
+// Execute the search when Ctrl-G, F3 and Shift-RETURN pressed (in 
addition to ActivateHdl condition which handles bare RETURN)
+else if ( (bMod1 && KEY_G == nCode) || (bShift && KEY_RETURN == nCode) 
|| (KEY_F3 == nCode) )
+{
+ActivateFind(bShift);
+bRet = true;
+}
+else if (aCommand == ".uno:SearchDialog")
 bRet = m_pAcc->execute(awtKey);
+
+// find-shortcut called with focus already in find
+if (aCommand == "vnd.sun.star.findbar:FocusToFindbar")
+{
+m_xWidget->call_attention_to();
+bRet = true;
+}
 }
 
 return bRet || ChildKeyInput(rKeyEvent);
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 5f8ceb6b9ae3..3f574237444b 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -167,10 +167,13 @@ public:
 virtual ~SalInstanceMenu() override;
 };
 
+class SalFlashAttention;
+
 class SalInstanceWidget : public virtual weld::Widget
 {
 protected:
 VclPtr m_xWidget;
+std::unique_ptr m_xFlashAttention;
 SalInstanceBuilder* m_pBuilder;
 
 private:
@@ -367,6 +370,8 @@ public:
 
 virtual void get_property_tree(tools::JsonWriter& rJsonWriter) override;
 
+virtual void call_attention_to() override;
+
 virtual void set_stack_background() override;
 
 virtual void set_title_background() override;
@@ -1000,6 +1005,8 @@ public:
 
 virtual void HandleEventListener(VclWindowEvent& rEvent) override;
 
+virtual void call_attention_to() override;
+
 virtual ~SalInstanceComboBoxWithEdit() override;
 };
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 263c29ff5eea..a8fdaf2a7978 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -559,6 +559,79 @@ VclPtr 
SalInstanceWidget::create_virtual_device() const
  DeviceFormat::DEFAULT);
 }
 
+class SalFlashAttention
+{
+private:
+VclPtr m_xWidget;
+Timer m_aFlashTimer;
+Color m_aOrigControlBackground;
+Wallpaper m_aOrigBackground;
+bool m_bOrigControlBackground;
+int m_nFlashCount;
+
+void SetFlash()
+{
+Color 
aColor(Application::GetSettings().GetStyleSettings().GetHighlightColor());
+m_xWidget->SetControlBackground(aColor);
+}
+
+void ClearFlash()
+{
+if (m_bOrigCon

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

2022-04-15 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   24 ++--
 1 file changed, 18 insertions(+), 6 deletions(-)

New commits:
commit fbfda267e8f4b55dff30a3827bff760565f36fdb
Author: Caolán McNamara 
AuthorDate: Fri Apr 15 17:19:05 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 15 20:43:47 2022 +0200

gtk[3|4] add the css "warning" "error" to GtkEntry when those states fit

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 53f9e3bb644f..50e3b7949877 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -12586,30 +12586,42 @@ public:
 
 namespace
 {
-#if GTK_CHECK_VERSION(4, 0, 0)
 // CSS nodes: entry[.flat][.warning][.error]
 void set_widget_css_message_type(GtkWidget* pWidget, 
weld::EntryMessageType eType)
 {
+#if GTK_CHECK_VERSION(4, 0, 0)
+gtk_widget_remove_css_class(pWidget, "error");
+gtk_widget_remove_css_class(pWidget, "warning");
+#else
+GtkStyleContext *pWidgetContext = 
gtk_widget_get_style_context(pWidget);
+gtk_style_context_remove_class(pWidgetContext, "error");
+gtk_style_context_remove_class(pWidgetContext, "warning");
+#endif
+
 switch (eType)
 {
 case weld::EntryMessageType::Normal:
-gtk_widget_remove_css_class(pWidget, "error");
-gtk_widget_remove_css_class(pWidget, "warning");
 break;
 case weld::EntryMessageType::Warning:
-gtk_widget_remove_css_class(pWidget, "error");
+#if GTK_CHECK_VERSION(4, 0, 0)
 gtk_widget_add_css_class(pWidget, "warning");
+#else
+gtk_style_context_add_class(pWidgetContext, "warning");
+#endif
 break;
 case weld::EntryMessageType::Error:
-gtk_widget_remove_css_class(pWidget, "warning");
+#if GTK_CHECK_VERSION(4, 0, 0)
 gtk_widget_add_css_class(pWidget, "error");
+#else
+gtk_style_context_add_class(pWidgetContext, "error");
+#endif
 break;
 }
 }
-#endif
 
 void set_entry_message_type(GtkEntry* pEntry, weld::EntryMessageType eType)
 {
+set_widget_css_message_type(GTK_WIDGET(pEntry), eType);
 switch (eType)
 {
 case weld::EntryMessageType::Normal:


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

2022-04-15 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 211fb753067f315597ac79f13c1bc553407fbf2f
Author: Caolán McNamara 
AuthorDate: Fri Apr 15 17:02:09 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 15 20:43:31 2022 +0200

gtk4: warning and error are explicitly mentioned in the documentation

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 42e5b6971b8c..53f9e3bb644f 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -12587,7 +12587,7 @@ public:
 namespace
 {
 #if GTK_CHECK_VERSION(4, 0, 0)
-// speculative, "error" seems to be a thing but "warning" probably isn't
+// CSS nodes: entry[.flat][.warning][.error]
 void set_widget_css_message_type(GtkWidget* pWidget, 
weld::EntryMessageType eType)
 {
 switch (eType)


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

2022-04-15 Thread Caolán McNamara (via logerrit)
 vcl/inc/unx/gtk/gtkobject.hxx |7 +
 vcl/unx/gtk3/gtkobject.cxx|   53 ++
 2 files changed, 46 insertions(+), 14 deletions(-)

New commits:
commit 37fb1cbf7bceac8421741dc55b89146a42a77a22
Author: Caolán McNamara 
AuthorDate: Fri Apr 15 16:27:37 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 15 20:43:16 2022 +0200

Related: tdf#147237 change the SalObject background when the settings change

which solves the problem of parts of the gtk ui remaining in the old
theme when switching dark<->light

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

diff --git a/vcl/inc/unx/gtk/gtkobject.hxx b/vcl/inc/unx/gtk/gtkobject.hxx
index 113868a4616c..b43f09e0bd30 100644
--- a/vcl/inc/unx/gtk/gtkobject.hxx
+++ b/vcl/inc/unx/gtk/gtkobject.hxx
@@ -82,6 +82,8 @@ class GtkSalObjectWidgetClip final : public GtkSalObjectBase
 tools::Rectangle m_aRect;
 tools::Rectangle m_aClipRect;
 GtkWidget* m_pScrolledWindow;
+GtkWidget* m_pViewPort;
+GtkCssProvider* m_pBgCssProvider;
 
 // signals
 #if !GTK_CHECK_VERSION(4, 0, 0)
@@ -98,6 +100,11 @@ class GtkSalObjectWidgetClip final : public GtkSalObjectBase
 #endif
 
 void ApplyClipRegion();
+
+void SetViewPortBackground();
+
+DECL_LINK(SettingsChangedHdl, VclWindowEvent&, void);
+
 public:
 GtkSalObjectWidgetClip(GtkSalFrame* pParent, bool bShow);
 virtual ~GtkSalObjectWidgetClip() override;
diff --git a/vcl/unx/gtk3/gtkobject.cxx b/vcl/unx/gtk3/gtkobject.cxx
index e5adb887cbeb..ca01e7795ab4 100644
--- a/vcl/unx/gtk3/gtkobject.cxx
+++ b/vcl/unx/gtk3/gtkobject.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 GtkSalObjectBase::GtkSalObjectBase(GtkSalFrame* pParent)
 : m_pSocket(nullptr)
@@ -296,6 +297,8 @@ void GtkSalObjectBase::SetForwardKey( bool bEnable )
 GtkSalObjectWidgetClip::GtkSalObjectWidgetClip(GtkSalFrame* pParent, bool 
bShow)
 : GtkSalObjectBase(pParent)
 , m_pScrolledWindow(nullptr)
+, m_pViewPort(nullptr)
+, m_pBgCssProvider(nullptr)
 {
 if( !pParent )
 return;
@@ -318,31 +321,26 @@ 
GtkSalObjectWidgetClip::GtkSalObjectWidgetClip(GtkSalFrame* pParent, bool bShow)
0, 0 );
 
 // deliberately without adjustments to avoid gtk's auto adjustment on 
changing focus
-GtkWidget* pViewPort = gtk_viewport_new(nullptr, nullptr);
+m_pViewPort = gtk_viewport_new(nullptr, nullptr);
 
 // force in a fake background of a suitable color
-GtkStyleContext *pWidgetContext = gtk_widget_get_style_context(pViewPort);
-GtkCssProvider* pBgCssProvider = gtk_css_provider_new();
-OUString sColor = 
Application::GetSettings().GetStyleSettings().GetDialogColor().AsRGBHexString();
-OUString aBuffer = "* { background-color: #" + sColor + "; }";
-OString aResult = OUStringToOString(aBuffer, RTL_TEXTENCODING_UTF8);
-css_provider_load_from_data(pBgCssProvider, aResult.getStr(), 
aResult.getLength());
-gtk_style_context_add_provider(pWidgetContext, 
GTK_STYLE_PROVIDER(pBgCssProvider),
-   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+SetViewPortBackground();
+
+ImplGetDefaultWindow()->AddEventListener(LINK(this, 
GtkSalObjectWidgetClip, SettingsChangedHdl));
 
 #if !GTK_CHECK_VERSION(4, 0, 0)
-gtk_container_add(GTK_CONTAINER(m_pScrolledWindow), pViewPort);
+gtk_container_add(GTK_CONTAINER(m_pScrolledWindow), m_pViewPort);
 #else
-gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(m_pScrolledWindow), 
pViewPort);
+gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(m_pScrolledWindow), 
m_pViewPort);
 #endif
-gtk_widget_show(pViewPort);
+gtk_widget_show(m_pViewPort);
 
 // our plug window
 m_pSocket = gtk_grid_new();
 #if !GTK_CHECK_VERSION(4, 0, 0)
-gtk_container_add(GTK_CONTAINER(pViewPort), m_pSocket);
+gtk_container_add(GTK_CONTAINER(m_pViewPort), m_pSocket);
 #else
-gtk_viewport_set_child(GTK_VIEWPORT(pViewPort), m_pSocket);
+gtk_viewport_set_child(GTK_VIEWPORT(m_pViewPort), m_pSocket);
 #endif
 gtk_widget_show(m_pSocket);
 
@@ -353,8 +351,35 @@ 
GtkSalObjectWidgetClip::GtkSalObjectWidgetClip(GtkSalFrame* pParent, bool bShow)
 g_signal_connect( G_OBJECT(m_pSocket), "destroy", 
G_CALLBACK(signalDestroy), this );
 }
 
+// force in a fake background of a suitable color
+void GtkSalObjectWidgetClip::SetViewPortBackground()
+{
+GtkStyleContext *pWidgetContext = 
gtk_widget_get_style_context(m_pViewPort);
+if (m_pBgCssProvider)
+gtk_style_context_remove_provider(pWidgetContext, 
GTK_STYLE_PROVIDER(m_pBgCssProvider));
+m_pBgCssProvider = gtk_css_provider_new();
+OUString sColor = 
Application::GetSettings().GetStyleSettings().GetDialogColor().AsRGBHexString();
+OUString aBuffer = "* { background-color: #" + sColor + "; }

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

2022-04-15 Thread Rene Engelhard (via logerrit)
 i18npool/qa/cppunit/test_breakiterator.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 67c577c692faaa0382d26c3c3f47b5ffa9deaa77
Author: Rene Engelhard 
AuthorDate: Fri Apr 15 08:38:52 2022 +0200
Commit: Eike Rathke 
CommitDate: Fri Apr 15 20:23:13 2022 +0200

apply ICU test workaround to < 70 to "fix" test with ICU 71

See also 263961306ede0656ebb7904034a2172615ce81d0

Change-Id: Ib64ec43dba59ffddb34fe7f1a0f0d2e589c3455c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133063
Tested-by: René Engelhard 
Reviewed-by: Eike Rathke 

diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx 
b/i18npool/qa/cppunit/test_breakiterator.cxx
index b74ff4222be4..cdcbff9be535 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -856,11 +856,11 @@ void TestBreakIterator::testLao()
 i18n::WordType::DICTIONARY_WORD, true);
 
 CPPUNIT_ASSERT_EQUAL(sal_Int32(5), aBounds.startPos);
-#if (U_ICU_VERSION_MAJOR_NUM != 70)
+#if (U_ICU_VERSION_MAJOR_NUM < 70)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(9), aBounds.endPos);
 #else
 // FIXME:
-// In ICU 70 for yet unknown reason the word boundary 9 is not detected and
+// In ICU 70/71 for yet unknown reason the word boundary 9 is not detected 
and
 // instead the length 12 is returned as endpos.
 // Deep in
 // icu_70::RuleBasedBreakIterator::BreakCache::next()


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

2022-04-15 Thread Noel Grandin (via logerrit)
 connectivity/source/drivers/hsqldb/HStorageMap.cxx |4 ++--
 connectivity/source/drivers/mysql_jdbc/YDriver.cxx |6 +++---
 connectivity/source/inc/hsqldb/HStorageMap.hxx |2 +-
 connectivity/source/inc/mysql/YDriver.hxx  |2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit f9a15395dc1d71a9597296e0e29e266cf9441a7e
Author: Noel Grandin 
AuthorDate: Fri Apr 15 16:45:39 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 15 20:12:11 2022 +0200

use more string_view in connectivity

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

diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx 
b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
index 63b5e0481c5c..aba88f192801 100644
--- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
@@ -132,9 +132,9 @@ namespace connectivity::hsqldb
 return OUString::number(s_nCount++);
 }
 
-OUString StorageContainer::removeURLPrefix(const OUString& _sURL,const 
OUString& _sFileURL)
+OUString StorageContainer::removeURLPrefix(std::u16string_view 
_sURL,const OUString& _sFileURL)
 {
-return _sURL.copy(_sFileURL.getLength()+1);
+return OUString(_sURL.substr(_sFileURL.getLength()+1));
 }
 
 OUString StorageContainer::removeOldURLPrefix(const OUString& _sURL)
diff --git a/connectivity/source/drivers/mysql_jdbc/YDriver.cxx 
b/connectivity/source/drivers/mysql_jdbc/YDriver.cxx
index 7ee501d42e81..69d2386990ae 100644
--- a/connectivity/source/drivers/mysql_jdbc/YDriver.cxx
+++ b/connectivity/source/drivers/mysql_jdbc/YDriver.cxx
@@ -115,9 +115,9 @@ T_DRIVERTYPE lcl_getDriverType(std::u16string_view _sUrl)
 return eRet;
 }
 
-OUString transformUrl(const OUString& _sUrl)
+OUString transformUrl(std::u16string_view _sUrl)
 {
-OUString sNewUrl = _sUrl.copy(11);
+OUString sNewUrl(_sUrl.substr(11));
 if (isOdbcUrl(_sUrl))
 sNewUrl = "sdbc:" + sNewUrl;
 else if (isNativeUrl(_sUrl))
@@ -187,7 +187,7 @@ Sequence lcl_convertProperties(T_DRIVERTYPE 
_eType,
 }
 }
 
-Reference ODriverDelegator::loadDriver(const OUString& url,
+Reference ODriverDelegator::loadDriver(std::u16string_view url,
 const Sequence& 
info)
 {
 Reference xDriver;
diff --git a/connectivity/source/inc/hsqldb/HStorageMap.hxx 
b/connectivity/source/inc/hsqldb/HStorageMap.hxx
index ee4590864016..06f31e6df326 100644
--- a/connectivity/source/inc/hsqldb/HStorageMap.hxx
+++ b/connectivity/source/inc/hsqldb/HStorageMap.hxx
@@ -86,7 +86,7 @@ namespace connectivity::hsqldb
 static TStreamMap::mapped_type getRegisteredStream( JNIEnv * env, 
jstring name, jstring key);
 
 static OUString jstring2ustring(JNIEnv * env, jstring jstr);
-static OUString removeURLPrefix(const OUString& _sURL,const 
OUString& _sFileURL);
+static OUString removeURLPrefix(std::u16string_view _sURL,const 
OUString& _sFileURL);
 static OUString removeOldURLPrefix(const OUString& _sURL);
 static void throwJavaException(const css::uno::Exception& 
_aException,JNIEnv * env);
 };
diff --git a/connectivity/source/inc/mysql/YDriver.hxx 
b/connectivity/source/inc/mysql/YDriver.hxx
index 7bdb499718fd..84fad1af1c99 100644
--- a/connectivity/source/inc/mysql/YDriver.hxx
+++ b/connectivity/source/inc/mysql/YDriver.hxx
@@ -72,7 +72,7 @@ namespace connectivity
 @return
 The driver which was currently selected.
 */
-css::uno::Reference< css::sdbc::XDriver > loadDriver( const 
OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info );
+css::uno::Reference< css::sdbc::XDriver > loadDriver( 
std::u16string_view url, const css::uno::Sequence< css::beans::PropertyValue >& 
info );
 
 public:
 /** creates a new delegator for a mysql driver


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

2022-04-15 Thread Noel Grandin (via logerrit)
 xmlhelp/source/cxxhelp/provider/databases.cxx  |   47 -
 xmlhelp/source/cxxhelp/provider/databases.hxx  |8 +-
 xmlsecurity/inc/documentsignaturemanager.hxx   |2 
 xmlsecurity/source/helper/documentsignaturemanager.cxx |   11 ++-
 4 files changed, 35 insertions(+), 33 deletions(-)

New commits:
commit 558aaa9ed222e7142fe87c9bab9a8293a5e2a159
Author: Noel Grandin 
AuthorDate: Fri Apr 15 16:43:40 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 15 20:11:48 2022 +0200

use more string_view in xml*

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

diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx 
b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 48e6788b0639..7d70fde659ce 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -567,35 +567,36 @@ namespace chelp {
 KeywordInfo::KeywordElement::KeywordElement( Databases const *pDatabases,
  helpdatafileproxy::Hdf* pHdf,
  OUString const & ky,
- OUString const & data )
+ std::u16string_view data )
 : key( ky )
 {
 pDatabases->replaceName( key );
 init( pDatabases,pHdf,data );
 }
 
-void KeywordInfo::KeywordElement::init( Databases const 
*pDatabases,helpdatafileproxy::Hdf* pHdf,const OUString& ids )
+void KeywordInfo::KeywordElement::init( Databases const 
*pDatabases,helpdatafileproxy::Hdf* pHdf, std::u16string_view ids )
 {
 std::vector< OUString > id,anchor;
-int idx = -1,k;
+size_t idx = std::u16string_view::npos;
+size_t k = 0;
 for (;;)
 {
-k = ++idx;
-idx = ids.indexOf( ';', k );
-if( idx == -1 )
+idx = ids.find( ';', k );
+if( idx == std::u16string_view::npos )
 break;
-int h = ids.indexOf( '#', k );
-if( h < idx )
+size_t h = ids.find( '#', k );
+if( h == std::u16string_view::npos || h < idx )
 {
 // found an anchor
-id.push_back( ids.copy( k, h-k ) );
-anchor.push_back( ids.copy( h+1, idx-h-1 ) );
+id.push_back( OUString(ids.substr( k, h-k )) );
+anchor.push_back( OUString(ids.substr( h+1, idx-h-1 )) );
 }
 else
 {
-id.push_back( ids.copy( k, idx-k ) );
+id.push_back( OUString(ids.substr( k, idx-k )) );
 anchor.emplace_back( );
 }
+k = ++idx;
 }
 
 listId.realloc( id.size() );
@@ -775,10 +776,10 @@ KeywordInfo* Databases::getKeyword( const OUString& 
Database,
 return it->second.get();
 }
 
-Reference< XHierarchicalNameAccess > Databases::jarFile( const OUString& jar,
+Reference< XHierarchicalNameAccess > Databases::jarFile( std::u16string_view 
jar,
  const OUString& 
Language )
 {
-if( jar.isEmpty() || Language.isEmpty() )
+if( jar.empty() || Language.isEmpty() )
 {
 return Reference< XHierarchicalNameAccess >( nullptr );
 }
@@ -795,14 +796,14 @@ Reference< XHierarchicalNameAccess > Databases::jarFile( 
const OUString& jar,
 {
 OUString zipFile;
 // Extension jar file? Search for ?
-sal_Int32 nQuestionMark1 = jar.indexOf( '?' );
-sal_Int32 nQuestionMark2 = jar.lastIndexOf( '?' );
-if( nQuestionMark1 != -1 && nQuestionMark2 != -1 && nQuestionMark1 
!= nQuestionMark2 )
+size_t nQuestionMark1 = jar.find( '?' );
+size_t nQuestionMark2 = jar.rfind( '?' );
+if( nQuestionMark1 != std::u16string_view::npos && nQuestionMark2 
!= std::u16string_view::npos && nQuestionMark1 != nQuestionMark2 )
 {
-OUString aExtensionPath = jar.copy( nQuestionMark1 + 1, 
nQuestionMark2 - nQuestionMark1 - 1 );
-OUString aPureJar = jar.copy( nQuestionMark2 + 1 );
+std::u16string_view aExtensionPath = jar.substr( 
nQuestionMark1 + 1, nQuestionMark2 - nQuestionMark1 - 1 );
+std::u16string_view aPureJar = jar.substr( nQuestionMark2 + 1 
);
 
-zipFile = expandURL( aExtensionPath + "/" + aPureJar );
+zipFile = expandURL( OUString::Concat(aExtensionPath) + "/" + 
aPureJar );
 }
 else
 {
@@ -1795,12 +1796,12 @@ OUString 
IndexFolderIterator::implGetIndexFolderFromPackage( bool& o_rbTemporary
 return aIndexFolder;
 }
 
-void IndexFolderIterator::deleteTempIndexFolder( const OUString& aIndexFolder )
+void IndexFolderIterator::deleteTempIndexFolder( std::u16string_view 
aIndexFolder )
 {
-sal_Int32 nLastSlash = aIndexFolder.lastIndexOf( '/' );
-if( nLas

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

2022-04-15 Thread Noel Grandin (via logerrit)
 fpicker/source/office/contentenumeration.cxx |4 ++--
 fpicker/source/office/contentenumeration.hxx |2 +-
 fpicker/source/office/iodlg.cxx  |   10 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit ba74c925a5ef872c291613d4be589e1ab4b4e9e1
Author: Noel Grandin 
AuthorDate: Fri Apr 15 16:39:27 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 15 20:11:29 2022 +0200

use more string_view in fpicker

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

diff --git a/fpicker/source/office/contentenumeration.cxx 
b/fpicker/source/office/contentenumeration.cxx
index 737808e10b62..5b74719a3f6e 100644
--- a/fpicker/source/office/contentenumeration.cxx
+++ b/fpicker/source/office/contentenumeration.cxx
@@ -306,9 +306,9 @@ namespace svt
 }
 
 
-bool FileViewContentEnumerator::URLOnDenyList ( const OUString& sRealURL )
+bool FileViewContentEnumerator::URLOnDenyList ( std::u16string_view 
sRealURL )
 {
-OUString entryName = sRealURL.copy( sRealURL.lastIndexOf( '/' ) + 1 );
+std::u16string_view entryName = sRealURL.substr( sRealURL.rfind( '/' ) 
+ 1 );
 
 return comphelper::findValue(m_rDenyList, entryName) != -1;
 }
diff --git a/fpicker/source/office/contentenumeration.hxx 
b/fpicker/source/office/contentenumeration.hxx
index bc2180c53c47..68277e6a4830 100644
--- a/fpicker/source/office/contentenumeration.hxx
+++ b/fpicker/source/office/contentenumeration.hxx
@@ -172,7 +172,7 @@ namespace svt
 
 css::uno::Sequence< OUString > m_rDenyList;
 
-bool URLOnDenyList ( const OUString& sRealURL );
+bool URLOnDenyList ( std::u16string_view sRealURL );
 
 public:
 /** constructs an enumerator instance
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 4090189a3cf6..d41bbab8b252 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -127,18 +127,18 @@ namespace
 }
 
 
-OUString GetFsysExtension_Impl( const OUString& rFile, const OUString& 
rLastFilterExt )
+OUString GetFsysExtension_Impl( std::u16string_view rFile, const OUString& 
rLastFilterExt )
 {
-sal_Int32 nDotPos = rFile.lastIndexOf( '.' );
-if ( nDotPos != -1 )
+size_t nDotPos = rFile.rfind( '.' );
+if ( nDotPos != std::u16string_view::npos )
 {
 if ( !rLastFilterExt.isEmpty() )
 {
-if ( o3tl::equalsIgnoreAsciiCase(rFile.subView( nDotPos + 1 ), 
rLastFilterExt ) )
+if ( o3tl::equalsIgnoreAsciiCase(rFile.substr( nDotPos + 1 ), 
rLastFilterExt ) )
 return rLastFilterExt;
 }
 else
-return rFile.copy( nDotPos );
+return OUString(rFile.substr( nDotPos ));
 }
 return OUString();
 }


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

2022-04-15 Thread Justin Luth (via logerrit)
 sw/inc/docufld.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ad76fa39f3a43822103141dbbaea3b057e5d3a15
Author: Justin Luth 
AuthorDate: Wed Apr 6 09:28:49 2022 +0200
Commit: Andras Timar 
CommitDate: Fri Apr 15 20:00:22 2022 +0200

tdf#147861 sw ms export: DI_SUB_MASK must exclude FIXED now

This is a follow-up to
7.4 commit daef39352b008fc1f903fd8c09288ff5e772fa42

There is only one place in which DI_SUB_MASK is used,
so I'm just changing it to what it could have always been,
since it never was actually used to mask out DI_SUB_FIXED.
Otherwise, I might have made this a MASK2 or whatever.

The issue here is that AUTHOR was not being recognized
when it was paired with FIXED, so every FIXEDFLD was
ended up being considered as a date/time.

In practice, this didn't really change anything
because bWriteExpand already ignored any of
these areas of the code. It is only when I turn off
bWriteExpand as I implement fixes that I am seeing
the wrong field type being created.

And regardless, since the field is FIXED, the visible
content remains the same anyway (until someone in MS Word
refreshes the field with F9).

Both Author and date have the same field name ":Created"
so I couldn't super easily test this.

Change-Id: Icd2d0be2d3fbe24dc4763e0e25801569bcca471b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132660
Tested-by: Jenkins
Reviewed-by: Justin Luth 
Reviewed-by: Miklos Vajna 
(cherry picked from commit e61eed211766f26a3896c1d912dc7349abbe823d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132698
Tested-by: Jenkins CollaboraOffice 
(cherry picked from commit 2e6acddd815bca6261634b69b015c6deead74b58)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132702
Reviewed-by: Andras Timar 

diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 62363f01bbd1..b4fe720970b6 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -79,7 +79,7 @@ namespace nsSwDocInfoSubType
 const SwDocInfoSubType DI_SUB_TIME  = 0x0200;
 const SwDocInfoSubType DI_SUB_DATE  = 0x0300;
 const SwDocInfoSubType DI_SUB_FIXED = 0x1000;
-const SwDocInfoSubType DI_SUB_MASK  = 0xff00;
+const SwDocInfoSubType DI_SUB_MASK  = 0x0f00;
 }
 
 enum SwPageNumSubType


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

2022-04-15 Thread Dennis Francis (via logerrit)
 sc/qa/unit/tiledrendering/tiledrendering.cxx |   30 +++
 1 file changed, 26 insertions(+), 4 deletions(-)

New commits:
commit e7710ecab5da8ba734a0270e87bba269041ae391
Author: Dennis Francis 
AuthorDate: Tue Apr 12 10:43:00 2022 +0530
Commit: Andras Timar 
CommitDate: Fri Apr 15 19:58:58 2022 +0200

unit test: use temp copy in testInvalidEntrySave()

Use a temporary copy of the source file to run this test otherwise it
will execute a .uno:Save on the original document in the git tree!

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

diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx 
b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index 9894da18e018..053b8d842019 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -42,6 +42,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 #include 
@@ -187,10 +189,11 @@ public:
 CPPUNIT_TEST_SUITE_END();
 
 private:
-ScModelObj* createDoc(const char* pName);
+ScModelObj* createDoc(const char* pName, bool bMakeTempCopy = false);
 void setupLibreOfficeKitViewCallback(SfxViewShell* pViewShell);
 static void callback(int nType, const char* pPayload, void* pData);
 void callbackImpl(int nType, const char* pPayload);
+void makeTempCopy(const OUString& rOrigURL);
 
 /// document size changed callback.
 osl::Condition m_aDocSizeCondition;
@@ -198,6 +201,7 @@ private:
 
 uno::Reference mxComponent;
 TestLokCallbackWrapper m_callbackWrapper;
+std::unique_ptr mpTempFile;
 };
 
 ScTiledRenderingTest::ScTiledRenderingTest()
@@ -236,11 +240,29 @@ void ScTiledRenderingTest::tearDown()
 test::BootstrapFixture::tearDown();
 }
 
-ScModelObj* ScTiledRenderingTest::createDoc(const char* pName)
+void ScTiledRenderingTest::makeTempCopy(const OUString& rOrigURL)
+{
+mpTempFile.reset(new utl::TempFile());
+mpTempFile->EnableKillingFile();
+auto const aError = osl::File::copy(rOrigURL, mpTempFile->GetURL());
+CPPUNIT_ASSERT_EQUAL_MESSAGE(
+OUString("<" + rOrigURL + "> -> <" + mpTempFile->GetURL() + 
">").toUtf8().getStr(),
+osl::FileBase::E_None, aError);
+}
+
+ScModelObj* ScTiledRenderingTest::createDoc(const char* pName, bool 
bMakeTempCopy)
 {
 if (mxComponent.is())
 mxComponent->dispose();
-mxComponent = loadFromDesktop(m_directories.getURLFromSrc(DATA_DIRECTORY) 
+ OUString::createFromAscii(pName), "com.sun.star.sheet.SpreadsheetDocument");
+
+OUString aOriginalSrc = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
OUString::createFromAscii(pName);
+if (bMakeTempCopy)
+makeTempCopy(aOriginalSrc);
+
+mxComponent = loadFromDesktop(
+bMakeTempCopy ? mpTempFile->GetURL() : aOriginalSrc,
+"com.sun.star.sheet.SpreadsheetDocument");
+
 ScModelObj* pModelObj = dynamic_cast(mxComponent.get());
 CPPUNIT_ASSERT(pModelObj);
 
pModelObj->initializeForTiledRendering(uno::Sequence());
@@ -3033,7 +3055,7 @@ void ScTiledRenderingTest::testInvalidEntrySave()
 // Load a document
 comphelper::LibreOfficeKit::setActive();
 
-ScModelObj* pModelObj = createDoc("validity.xlsx");
+ScModelObj* pModelObj = createDoc("validity.xlsx", true /* bMakeTempCopy 
*/);
 const ScDocument* pDoc = pModelObj->GetDocument();
 ViewCallback aView;
 int nView = SfxLokHelper::getView();


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

2022-04-15 Thread Xisco Fauli (via logerrit)
 sw/qa/extras/ooxmlexport/data/tdf148494.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport17.cxx   |   12 
 sw/source/filter/ww8/ww8atr.cxx  |4 ++--
 3 files changed, 14 insertions(+), 2 deletions(-)

New commits:
commit c5d5c7e8c385f8a7e6ab824095e61aeeca4ab8c7
Author: Xisco Fauli 
AuthorDate: Fri Apr 15 17:55:21 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Apr 15 19:17:54 2022 +0200

tdf#148494: export: Always add space separator

Otherwise, the macro is saved as MACROBUTTONAllCaps
instead of MACROBUTTON AllCaps

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

diff --git a/sw/qa/extras/ooxmlexport/data/tdf148494.docx 
b/sw/qa/extras/ooxmlexport/data/tdf148494.docx
new file mode 100644
index ..c60c73a206fb
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf148494.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
index 75b483e7d239..960bb3f16d8b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport17.cxx
@@ -158,6 +158,18 @@ CPPUNIT_TEST_FIXTURE(Test, testContentControlExport)
 assertXPath(pXmlDoc, "//w:sdt/w:sdtContent", 1);
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf148494)
+{
+loadAndSave("tdf148494.docx");
+
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+
+// Without the fix in place, this test would have failed with
+// - Expected:  MACROBUTTON AllCaps Hello World
+// - Actual  :  MACROBUTTONAllCaps Hello World
+assertXPathContent(pXmlDoc, "/w:document/w:body/w:p/w:r[3]/w:instrText", " 
MACROBUTTON AllCaps Hello World ");
+}
+
 DECLARE_OOXMLEXPORT_TEST(testTdf137466, "tdf137466.docx")
 {
 xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 72bdc213f4b3..b9c71e4433ae 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3300,8 +3300,8 @@ void AttributeOutputBase::TextField( const SwFormatField& 
rField )
 break;
 case SwFieldIds::Macro:
 {
-const OUString sStr = " MACROBUTTON"
-+ 
pField->GetPar1().replaceFirst("StarOffice.Standard.Modul1.", " ")
+const OUString sStr = " MACROBUTTON "
++ 
pField->GetPar1().replaceFirst("StarOffice.Standard.Modul1.", "")
 + " "
 + lcl_GetExpandedField(*pField);
 GetExport().OutputField( pField, ww::eMACROBUTTON, sStr );


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

2022-04-15 Thread Thorsten Behrens (via logerrit)
 slideshow/source/engine/activities/simplecontinuousactivitybase.cxx |   12 
+++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 18ac22f8a24cb4b691d8c0269206355d0f484625
Author: Thorsten Behrens 
AuthorDate: Thu Apr 14 12:01:50 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Apr 15 18:28:24 2022 +0200

Resolves: tdf#143615 clamp relative times to 1.0

User input permits zero-length animations, so whenever we calculate
relative position within the animation time frame, the case
mnMinSimpleDuration == 0.0 means: we're already at the end of the
animation, i.e. set relative time to 1.0

Change-Id: I0e8c1e29f47bd9fa16f04115cf52d3a176e13fb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133005
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit e1db8c27875eac73b1e619e4a23ecdb7a9924b61)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133039
Reviewed-by: Xisco Fauli 

diff --git 
a/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx 
b/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx
index 9e23fc2c76c8..01cb3b75007b 100644
--- a/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx
+++ b/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx
@@ -63,9 +63,12 @@ namespace slideshow::internal
 // perform will be called at least mnMinNumberOfTurns
 // times.
 
-// fraction of time elapsed
+// fraction of time elapsed (clamp to 1.0 for zero-length
+// animations)
 const double nFractionElapsedTime(
-nCurrElapsedTime / mnMinSimpleDuration );
+mnMinSimpleDuration != 0.0 ?
+nCurrElapsedTime / mnMinSimpleDuration :
+1.0 );
 
 // fraction of minimum calls performed
 const double nFractionRequiredCalls(
@@ -115,7 +118,10 @@ namespace slideshow::internal
 // ===
 
 const double nCurrElapsedTime( maTimer.getElapsedTime() );
-double nT( nCurrElapsedTime / mnMinSimpleDuration );
+// clamp to 1.0 for zero animation duration
+double nT( mnMinSimpleDuration != 0.0 ?
+   nCurrElapsedTime / mnMinSimpleDuration :
+   1.0 );
 
 
 // one of the stop criteria reached?


[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - slideshow/source

2022-04-15 Thread Thorsten Behrens (via logerrit)
 slideshow/source/engine/activities/simplecontinuousactivitybase.cxx |   12 
+++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 01c5006db900e3911e6bf8cb7abc2935e8215ded
Author: Thorsten Behrens 
AuthorDate: Thu Apr 14 12:01:50 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Apr 15 18:05:46 2022 +0200

Resolves: tdf#143615 clamp relative times to 1.0

User input permits zero-length animations, so whenever we calculate
relative position within the animation time frame, the case
mnMinSimpleDuration == 0.0 means: we're already at the end of the
animation, i.e. set relative time to 1.0

Change-Id: I0e8c1e29f47bd9fa16f04115cf52d3a176e13fb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133005
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit e1db8c27875eac73b1e619e4a23ecdb7a9924b61)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133038
Reviewed-by: Xisco Fauli 

diff --git 
a/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx 
b/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx
index 9e23fc2c76c8..01cb3b75007b 100644
--- a/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx
+++ b/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx
@@ -63,9 +63,12 @@ namespace slideshow::internal
 // perform will be called at least mnMinNumberOfTurns
 // times.
 
-// fraction of time elapsed
+// fraction of time elapsed (clamp to 1.0 for zero-length
+// animations)
 const double nFractionElapsedTime(
-nCurrElapsedTime / mnMinSimpleDuration );
+mnMinSimpleDuration != 0.0 ?
+nCurrElapsedTime / mnMinSimpleDuration :
+1.0 );
 
 // fraction of minimum calls performed
 const double nFractionRequiredCalls(
@@ -115,7 +118,10 @@ namespace slideshow::internal
 // ===
 
 const double nCurrElapsedTime( maTimer.getElapsedTime() );
-double nT( nCurrElapsedTime / mnMinSimpleDuration );
+// clamp to 1.0 for zero animation duration
+double nT( mnMinSimpleDuration != 0.0 ?
+   nCurrElapsedTime / mnMinSimpleDuration :
+   1.0 );
 
 
 // one of the stop criteria reached?


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

2022-04-15 Thread Vasily Melenchuk (via logerrit)
 sw/source/ui/fldui/flddok.cxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit b2b821715a3745718a941fa99dda92137c0f0c86
Author: Vasily Melenchuk 
AuthorDate: Wed Apr 13 20:19:35 2022 +0300
Commit: Thorsten Behrens 
CommitDate: Fri Apr 15 18:02:00 2022 +0200

tdf#148551: sw ui: set default format value for Insert Field dlg

My previous implementation was changing current format selection
only for field edit dialog. However it should be initialized also
for insert field dlg. It is not always first element. Instead of
older confusing approach right now there is a switch to set
defaults: it is less confusing IMO.

Change-Id: I189339ba66effc49267004a42345a28892cb693c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132980
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index 2e7c1c67dbc2..4e65a7c3fb26 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -479,6 +479,19 @@ sal_Int32 SwFieldDokPage::FillFormatLB(SwFieldTypesEnum 
nTypeId)
 {
 m_xFormatLB->select_id(OUString::number(GetCurField()->GetFormat() & 
~AF_FIXED));
 }
+else
+{
+// Select default selected value for "Insert" dialog
+switch (nTypeId)
+{
+case SwFieldTypesEnum::PageNumber:
+case SwFieldTypesEnum::DocumentStatistics:
+m_xFormatLB->select_text(SwResId(FMT_NUM_PAGEDESC));
+break;
+default:
+m_xFormatLB->select(0);
+}
+}
 
 FormatHdl(*m_xFormatLB);
 


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

2022-04-15 Thread Caolán McNamara (via logerrit)
 vcl/source/app/salvtables.cxx |   43 --
 1 file changed, 21 insertions(+), 22 deletions(-)

New commits:
commit 9efab24f38bb5e4b150c842cda51cfd76d694022
Author: Caolán McNamara 
AuthorDate: Fri Apr 15 14:44:54 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 15 17:57:30 2022 +0200

use the same colors for warning/error for gen ComboBox as Entry does

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

diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index fad841f45787..263c29ff5eea 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3316,31 +3316,39 @@ void SalInstanceEntry::set_overwrite_mode(bool bOn) { 
m_xEntry->SetInsertMode(!b
 
 bool SalInstanceEntry::get_overwrite_mode() const { return 
!m_xEntry->IsInsertMode(); }
 
-void SalInstanceEntry::set_message_type(weld::EntryMessageType eType)
+namespace
+{
+void set_message_type(Edit* pEntry, weld::EntryMessageType eType)
 {
 switch (eType)
 {
 case weld::EntryMessageType::Normal:
-m_xEntry->SetForceControlBackground(false);
-m_xEntry->SetControlForeground();
-m_xEntry->SetControlBackground();
+pEntry->SetForceControlBackground(false);
+pEntry->SetControlForeground();
+pEntry->SetControlBackground();
 break;
 case weld::EntryMessageType::Warning:
 // tdf#114603: enable setting the background to a different color;
 // relevant for GTK; see also #i75179#
-m_xEntry->SetForceControlBackground(true);
-m_xEntry->SetControlForeground(COL_BLACK);
-m_xEntry->SetControlBackground(COL_YELLOW);
+pEntry->SetForceControlBackground(true);
+pEntry->SetControlForeground(COL_BLACK);
+pEntry->SetControlBackground(COL_YELLOW);
 break;
 case weld::EntryMessageType::Error:
 // tdf#114603: enable setting the background to a different color;
 // relevant for GTK; see also #i75179#
-m_xEntry->SetForceControlBackground(true);
-m_xEntry->SetControlForeground(COL_WHITE);
-m_xEntry->SetControlBackground(0xff6563);
+pEntry->SetForceControlBackground(true);
+pEntry->SetControlForeground(COL_WHITE);
+pEntry->SetControlBackground(0xff6563);
 break;
 }
 }
+}
+
+void SalInstanceEntry::set_message_type(weld::EntryMessageType eType)
+{
+::set_message_type(m_xEntry, eType);
+}
 
 void SalInstanceEntry::set_font(const vcl::Font& rFont)
 {
@@ -6355,18 +6363,9 @@ bool 
SalInstanceComboBoxWithEdit::changed_by_direct_pick() const
 
 void 
SalInstanceComboBoxWithEdit::set_entry_message_type(weld::EntryMessageType 
eType)
 {
-switch (eType)
-{
-case weld::EntryMessageType::Normal:
-m_xComboBox->SetControlForeground();
-break;
-case weld::EntryMessageType::Warning:
-m_xComboBox->SetControlForeground(COL_YELLOW);
-break;
-case weld::EntryMessageType::Error:
-m_xComboBox->SetControlForeground(Color(0xf0, 0, 0));
-break;
-}
+Edit* pEdit = m_xComboBox->GetSubEdit();
+assert(pEdit);
+::set_message_type(pEdit, eType);
 }
 
 OUString SalInstanceComboBoxWithEdit::get_active_text() const { return 
m_xComboBox->GetText(); }


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

2022-04-15 Thread Caolán McNamara (via logerrit)
 vcl/win/window/salframe.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit a0f9f8ddaaa4ca14c9cc37259e2ac5dce63b3c77
Author: Caolán McNamara 
AuthorDate: Fri Apr 15 13:50:10 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 15 16:16:35 2022 +0200

tdf#148448 pick a warning color more likely to be readable in dark theme

I can't see anything that is useful which could be used to derive this
so just pick a better hard coded color

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

diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index bbfd7843502a..6f3b3ca507e5 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -2695,6 +2695,10 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings 
)
 aMenuBarTextColor = ImplWinColorToSal( color );
 aMenuBarRolloverTextColor = ImplWinColorToSal( color );
 CloseThemeData(hTheme);
+
+// tdf#148448 pick a warning color more likely to be readable as a
+// background in a dark theme
+aStyleSettings.SetWarningColor(Color(0xf5, 0x79, 0x00));
 }
 else
 {


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

2022-04-15 Thread Noel Grandin (via logerrit)
 l10ntools/source/merge.cxx |   13 +
 l10ntools/source/po.cxx|5 -
 2 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit b9c806b9e3631d76b8ceaa6208497aba60c75f83
Author: Noel Grandin 
AuthorDate: Thu Apr 14 18:52:19 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 15 14:06:06 2022 +0200

address potential find/rfind failures

in the conversion in
commit 74957c7d2f3697fbf2b6f4d6a31c61d5d7df039b
Author: Noel Grandin 
Date:   Wed Apr 13 13:54:22 2022 +0200
use more string_view in l10ntools

where the prior code might have been relying on the -1 returned by
indexOf and lastIndexOd

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

diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 8a6964c61fa4..588cb73d8614 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -34,10 +34,15 @@ namespace
 {
 OString lcl_NormalizeFilename(std::string_view rFilename)
 {
-return OString(rFilename.substr(
-std::max(
-rFilename.rfind( '\\' ),
-rFilename.rfind( '/' ))+1));
+size_t idx1 = rFilename.rfind( '\\' );
+size_t idx2 = rFilename.rfind( '/' );
+if (idx1 == std::string_view::npos && idx2 == std::string_view::npos)
+return OString(rFilename);
+if (idx1 == std::string_view::npos)
+idx1 = 0;
+if (idx2 == std::string_view::npos)
+idx2 = 0;
+return OString(rFilename.substr(std::max(idx1, idx2)+1));
 };
 
 bool lcl_ReadPoChecked(
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index b93126838c99..62d09e1e7407 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -257,7 +257,10 @@ PoEntry::PoEntry(
 throw WRONGHELPTEXT;
 
 m_pGenPo.reset( new GenPoEntry() );
-OString sReference(rSourceFile.substr(rSourceFile.rfind('/')+1));
+size_t idx = rSourceFile.rfind('/');
+if (idx == std::string_view::npos)
+idx = 0;
+OString sReference(rSourceFile.substr(idx+1));
 m_pGenPo->setReference(sReference);
 
 OString sMsgCtxt =


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

2022-04-15 Thread Stephan Bergmann (via logerrit)
 shell/source/backends/wininetbe/wininetbackend.cxx |   38 -
 1 file changed, 22 insertions(+), 16 deletions(-)

New commits:
commit 6fd447aaf2f21a4708ca4e4268e209f4499cbeee
Author: Stephan Bergmann 
AuthorDate: Thu Apr 14 22:59:11 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 15 13:42:34 2022 +0200

loplugin:stringviewparam

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

diff --git a/shell/source/backends/wininetbe/wininetbackend.cxx 
b/shell/source/backends/wininetbe/wininetbackend.cxx
index 8ac38b5517b3..cc059e3e 100644
--- a/shell/source/backends/wininetbe/wininetbackend.cxx
+++ b/shell/source/backends/wininetbe/wininetbackend.cxx
@@ -17,8 +17,14 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
+
+#include 
+#include 
+
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -53,38 +59,38 @@ struct ProxyEntry
 OUString Port;
 };
 
-ProxyEntry ReadProxyEntry(const OUString& aProxy, sal_Int32& i)
+ProxyEntry ReadProxyEntry(std::u16string_view aProxy, std::size_t& i)
 {
 ProxyEntry aProxyEntry;
 
-aProxyEntry.Server = aProxy.getToken( 0, COLON, i );
-if ( i > -1 )
-aProxyEntry.Port = aProxy.getToken( 0, COLON, i );
+aProxyEntry.Server = o3tl::getToken( aProxy, COLON, i );
+if ( i != std::u16string_view::npos )
+aProxyEntry.Port = o3tl::getToken( aProxy, COLON, i );
 
 return aProxyEntry;
 }
 
-ProxyEntry FindProxyEntry(const OUString& aProxyList, const OUString& 
aType)
+ProxyEntry FindProxyEntry(std::u16string_view aProxyList, 
std::u16string_view aType)
 {
-sal_Int32 nIndex = 0;
+std::size_t nIndex = 0;
 
 do
 {
 // get the next token, e.g. ftp=server:port
-OUString nextToken = aProxyList.getToken( 0, SPACE, nIndex );
+std::u16string_view nextToken = o3tl::getToken( aProxyList, SPACE, 
nIndex );
 
 // split the next token again into the parts separated
 // through '=', e.g. ftp=server:port -> ftp and server:port
-sal_Int32 i = 0;
-if( nextToken.indexOf( EQUAL_SIGN ) > -1 )
+std::size_t i = 0;
+if( nextToken.find( EQUAL_SIGN ) != std::u16string_view::npos )
 {
-if( aType.equals( nextToken.getToken( 0, EQUAL_SIGN, i ) ) )
+if( aType == o3tl::getToken( nextToken, EQUAL_SIGN, i ) )
 return ReadProxyEntry(nextToken, i);
 }
-else if( aType.isEmpty())
+else if( aType.empty())
 return ReadProxyEntry(nextToken, i);
 
-} while ( nIndex >= 0 );
+} while ( nIndex != std::u16string_view::npos );
 
 return ProxyEntry();
 }
@@ -215,11 +221,11 @@ WinInetBackend::WinInetBackend()
 // there is one and it has a port
 
 
-ProxyEntry aTypeIndepProxy = FindProxyEntry( aProxyList, 
OUString());
-ProxyEntry aHttpProxy = FindProxyEntry( aProxyList, "http" );
-ProxyEntry aHttpsProxy  = FindProxyEntry( aProxyList, "https" 
);
+ProxyEntry aTypeIndepProxy = FindProxyEntry( aProxyList, u"");
+ProxyEntry aHttpProxy = FindProxyEntry( aProxyList, u"http" );
+ProxyEntry aHttpsProxy  = FindProxyEntry( aProxyList, u"https" 
);
 
-ProxyEntry aFtpProxy  = FindProxyEntry( aProxyList, "ftp" );
+ProxyEntry aFtpProxy  = FindProxyEntry( aProxyList, u"ftp" );
 
 if( aTypeIndepProxy.Server.getLength() )
 {


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-22.05' - cui/inc cui/Library_cui.mk cui/source cui/uiconfig cui/UIConfig_cui.mk include/sfx2 sfx2/sdi sfx2/source vcl/jsdialog

2022-04-15 Thread rash419 (via logerrit)
 cui/Library_cui.mk   |1 
 cui/UIConfig_cui.mk  |1 
 cui/inc/widgettestdlg.hxx|   30 ++
 cui/source/dialogs/widgettestdlg.cxx |   36 ++
 cui/source/factory/dlgfact.cxx   |9 
 cui/source/factory/dlgfact.hxx   |6 
 cui/uiconfig/ui/widgettestdialog.ui  |  496 +++
 include/sfx2/sfxdlg.hxx  |2 
 include/sfx2/sfxsids.hrc |1 
 sfx2/sdi/appslots.sdi|4 
 sfx2/sdi/sfx.sdi |   17 +
 sfx2/source/appl/appserv.cxx |   11 
 vcl/jsdialog/enabled.cxx |3 
 13 files changed, 616 insertions(+), 1 deletion(-)

New commits:
commit 7f44d4b0efa23affc71b5dc77ac2fd78cc76e87e
Author: rash419 
AuthorDate: Wed Apr 13 16:20:36 2022 +0530
Commit: Szymon Kłos 
CommitDate: Fri Apr 15 12:23:49 2022 +0200

jsdialogs: added WidgetTestDialog to test different vcl widgets in online 
side

Signed-off-by: rash419 
Change-Id: I27cbb72b4ccd486b58934503b1d3d5d7ff47cbfe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132865
Reviewed-by: Szymon Kłos 
Tested-by: Jenkins CollaboraOffice 

diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk
index fb3546b4e9ad..88e75ee1faef 100644
--- a/cui/Library_cui.mk
+++ b/cui/Library_cui.mk
@@ -231,6 +231,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
 cui/source/tabpages/tptrans \
 cui/source/tabpages/transfrm \
 cui/source/util/FontFeatures \
+cui/source/dialogs/widgettestdlg \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk
index daa8a1e3d55d..c70cbd94588c 100644
--- a/cui/UIConfig_cui.mk
+++ b/cui/UIConfig_cui.mk
@@ -220,6 +220,7 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\
cui/uiconfig/ui/wordcompletionpage \
cui/uiconfig/ui/spinbox \
cui/uiconfig/ui/zoomdialog \
+   cui/uiconfig/ui/widgettestdialog \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/cui/inc/widgettestdlg.hxx b/cui/inc/widgettestdlg.hxx
new file mode 100644
index ..15a480d7119d
--- /dev/null
+++ b/cui/inc/widgettestdlg.hxx
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+* This file is part of the LibreOffice project.
+*
+* This Source Code Form is subject to the terms of the Mozilla Public
+* License, v. 2.0. If a copy of the MPL was not distributed with this
+* file, You can obtain one at http://mozilla.org/MPL/2.0/.
+*/
+
+#pragma once
+
+#include "tools/link.hxx"
+#include 
+#include 
+
+class WidgetTestDialog final : public weld::GenericDialogController
+{
+private:
+std::unique_ptr m_xOKButton;
+std::unique_ptr m_xCancelButton;
+
+DECL_LINK(OkHdl, weld::Button&, void);
+DECL_LINK(CancelHdl, weld::Button&, void);
+
+public:
+WidgetTestDialog(weld::Window *pParent);
+~WidgetTestDialog();
+};
+
+
diff --git a/cui/source/dialogs/widgettestdlg.cxx 
b/cui/source/dialogs/widgettestdlg.cxx
new file mode 100644
index ..891d3f542438
--- /dev/null
+++ b/cui/source/dialogs/widgettestdlg.cxx
@@ -0,0 +1,36 @@
+/* -*- 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 
+
+WidgetTestDialog::WidgetTestDialog(weld::Window *pParent)
+  : GenericDialogController(pParent, "cui/ui/widgettestdialog.ui", 
"WidgetTestDialog")
+{
+m_xOKButton = m_xBuilder->weld_button("ok_btn");
+m_xCancelButton = m_xBuilder->weld_button("cancel_btn");
+
+m_xOKButton->connect_clicked(LINK(this, WidgetTestDialog, OkHdl));
+m_xCancelButton->connect_clicked(LINK(this, WidgetTestDialog, CancelHdl));
+}
+
+WidgetTestDialog::~WidgetTestDialog()
+{
+}
+
+IMPL_LINK_NOARG(WidgetTestDialog, OkHdl, weld::Button&, void)
+{
+m_xDialog->response(RET_OK);
+}
+
+IMPL_LINK_NOARG(WidgetTestDialog, CancelHdl, weld::Button&, void)
+{
+m_xDialog->response(RET_CANCEL);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index bd3130fd0fc7..4496b8e8799d 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -88,6 +88,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -142,6 +143,7 @@ 
IMPL_ABSTDLG_CLASS_ASYNC(CuiAbstractControllerAsync,weld::DialogController)
 IMPL_ABSTDLG_CLASS_ASYNC(CuiAbstractTabController,SfxTabDialogController)
 IMPL_ABSTDLG_CLASS(CuiAbstractController)
 IMPL_ABSTDLG_CLASS(CuiAbstractSingleTabController)
+IMPL_ABSTDLG_CLASS_ASYNC(CuiAbstractWidgetTestControllerAsync,weld::GenericDialogController)
 
 const SfxItemSet* AbstractSvxCharacterMapDialog_Impl::GetOutputItemSet() const
 {
@@ -1488,6 +1

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

2022-04-15 Thread Szymon Kłos (via logerrit)
 desktop/source/lib/init.cxx  |1 +
 sfx2/source/control/unoctitm.cxx |1 +
 2 files changed, 2 insertions(+)

New commits:
commit de60fbd120cf56696bb07f72fef2b86feccddde1
Author: Szymon Kłos 
AuthorDate: Tue Apr 5 19:07:26 2022 +0200
Commit: Szymon Kłos 
CommitDate: Fri Apr 15 11:27:31 2022 +0200

lok: send status update for .uno:SplitCell

Change-Id: Ic972d3ff3334f4c3a507868a95ac955c9ffbc614
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132585
Reviewed-by: Mert Tumer 
Tested-by: Jenkins CollaboraOffice 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132909
Reviewed-by: Szymon Kłos 

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 82bb8715960b..c6fb6d1460b8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3115,6 +3115,7 @@ static void doc_iniUnoCommands ()
 OUString(".uno:InsertCaptionDialog"),
 OUString(".uno:FormatGroup"),
 OUString(".uno:SplitTable"),
+OUString(".uno:SplitCell"),
 OUString(".uno:MergeCells"),
 OUString(".uno:DeleteNote"),
 OUString(".uno:AcceptChanges"),
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index f7b6ecefba0d..00985b1fe4ee 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1058,6 +1058,7 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
  aEvent.FeatureURL.Path == "InsertCaptionDialog" ||
  aEvent.FeatureURL.Path == "MergeCells" ||
  aEvent.FeatureURL.Path == "SplitTable" ||
+ aEvent.FeatureURL.Path == "SplitCell" ||
  aEvent.FeatureURL.Path == "DeleteNote" ||
  aEvent.FeatureURL.Path == "AcceptChanges" ||
  aEvent.FeatureURL.Path == "SetDefault" ||


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

2022-04-15 Thread Szymon Kłos (via logerrit)
 include/vcl/jsdialog/executor.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dcc9d7f0a0e8a6978ada6e92244cd6cd4b276520
Author: Szymon Kłos 
AuthorDate: Wed Apr 6 09:52:34 2022 +0200
Commit: Szymon Kłos 
CommitDate: Fri Apr 15 11:26:34 2022 +0200

jsdialog: close popup correctly

call popdown so we will mark popup as closed in DockingManager
this fixes crash when trying to open autofilter popup second time

Change-Id: I9f2db6fe284d9b9770c20dea4b8a4054524a998b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132619
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mert Tumer 
Reviewed-by: Andras Timar 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132917
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/include/vcl/jsdialog/executor.hxx 
b/include/vcl/jsdialog/executor.hxx
index 149df76d0b1c..0f8fb821e2bd 100644
--- a/include/vcl/jsdialog/executor.hxx
+++ b/include/vcl/jsdialog/executor.hxx
@@ -55,7 +55,7 @@ public:
 rSpinButton.signal_value_changed();
 }
 
-static void trigger_closed(weld::Popover& rPopover) { 
rPopover.signal_closed(); }
+static void trigger_closed(weld::Popover& rPopover) { rPopover.popdown(); }
 };
 
 namespace jsdialog


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

2022-04-15 Thread Szymon Kłos (via logerrit)
 sc/source/ui/cctrl/checklistmenu.cxx |   46 ++-
 sc/source/ui/inc/checklistmenu.hxx   |   10 +--
 sc/source/ui/view/gridwin.cxx|6 
 sc/source/ui/view/gridwin2.cxx   |6 
 vcl/jsdialog/jsdialogbuilder.cxx |7 +
 5 files changed, 9 insertions(+), 66 deletions(-)

New commits:
commit 02c9687b0792a568897f911a0f8d6e1582fdbe6a
Author: Szymon Kłos 
AuthorDate: Mon Apr 4 23:27:01 2022 +0200
Commit: Szymon Kłos 
CommitDate: Fri Apr 15 11:26:16 2022 +0200

jsdialog: autofilter: unify with regular popup

- remove special type "autofilter"
- now autofilter will be handled by dialog code in online

Change-Id: I3478c3e05ab2e83030a8d68632d0426a5cc0accd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132539
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mert Tumer 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132916
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index b1e2f5ca1644..833857614e72 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -182,7 +182,7 @@ ScListSubMenuControl* 
ScCheckListMenuControl::addSubMenuItem(const OUString& rTe
 MenuItemData aItem;
 aItem.mbEnabled = bEnabled;
 
-aItem.mxSubMenuWin.reset(new ScListSubMenuControl(mxMenu.get(), *this, 
bColorMenu, mpNotifier));
+aItem.mxSubMenuWin.reset(new ScListSubMenuControl(mxMenu.get(), *this, 
bColorMenu));
 maMenuItems.emplace_back(std::move(aItem));
 
 mxMenu->show();
@@ -439,9 +439,6 @@ void ScCheckListMenuControl::StartPopupMode(weld::Widget* 
pParent, const tools::
 
 void ScCheckListMenuControl::terminateAllPopupMenus()
 {
-if (comphelper::LibreOfficeKit::isActive())
-NotifyCloseLOK();
-
 EndPopupMode();
 }
 
@@ -468,7 +465,7 @@ constexpr int nCheckListVisibleRows = 9;
 constexpr int nColorListVisibleRows = 9;
 
 ScCheckListMenuControl::ScCheckListMenuControl(weld::Widget* pParent, 
ScViewData& rViewData,
-   bool bHasDates, int nWidth, 
vcl::ILibreOfficeKitNotifier* pNotifier)
+   bool bHasDates, int nWidth)
 : mxBuilder(Application::CreateBuilder(pParent, 
"modules/scalc/ui/filterdropdown.ui"))
 , mxPopover(mxBuilder->weld_popover("FilterDropDown"))
 , mxContainer(mxBuilder->weld_container("container"))
@@ -495,7 +492,6 @@ 
ScCheckListMenuControl::ScCheckListMenuControl(weld::Widget* pParent, ScViewData
 , mrViewData(rViewData)
 , mnAsyncPostPopdownId(nullptr)
 , mnAsyncSetDropdownPosId(nullptr)
-, mpNotifier(pNotifier)
 , mbHasDates(bHasDates)
 , mbIsPoppedUp(false)
 , maOpenTimer(this)
@@ -1439,27 +1435,11 @@ void ScCheckListMenuControl::launch(weld::Widget* 
pWidget, const tools::Rectangl
 StartPopupMode(pWidget, aRect);
 }
 
-void ScCheckListMenuControl::NotifyCloseLOK()
-{
-if (mpNotifier)
-{
-tools::JsonWriter aJsonWriter;
-aJsonWriter.put("jsontype", "autofilter");
-aJsonWriter.put("action", "close");
-
-const std::string message = aJsonWriter.extractAsStdString();
-mpNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, 
message.c_str());
-}
-}
-
 void ScCheckListMenuControl::close(bool bOK)
 {
 if (bOK && mxOKAction)
 mxOKAction->execute();
 EndPopupMode();
-
-if (comphelper::LibreOfficeKit::isActive())
-NotifyCloseLOK();
 }
 
 void ScCheckListMenuControl::setExtendedData(std::unique_ptr p)
@@ -1490,9 +1470,6 @@ IMPL_LINK_NOARG(ScCheckListMenuControl, PopupModeEndHdl, 
weld::Popover&, void)
 mxPopupEndAction->execute();
 
 DropPendingEvents();
-
-if (comphelper::LibreOfficeKit::isActive())
-NotifyCloseLOK();
 }
 
 int ScCheckListMenuControl::GetTextWidth(const OUString& rsName) const
@@ -1513,7 +1490,7 @@ int 
ScCheckListMenuControl::IncreaseWindowWidthToFitText(int nMaxTextWidth)
 return mnCheckWidthReq + nBorder;
 }
 
-ScListSubMenuControl::ScListSubMenuControl(weld::Widget* pParent, 
ScCheckListMenuControl& rParentControl, bool bColorMenu, 
vcl::ILibreOfficeKitNotifier* pNotifier)
+ScListSubMenuControl::ScListSubMenuControl(weld::Widget* pParent, 
ScCheckListMenuControl& rParentControl, bool bColorMenu)
 : mxBuilder(Application::CreateBuilder(pParent, 
"modules/scalc/ui/filtersubdropdown.ui"))
 , mxPopover(mxBuilder->weld_popover("FilterSubDropDown"))
 , mxContainer(mxBuilder->weld_container("container"))
@@ -1522,7 +1499,6 @@ ScListSubMenuControl::ScListSubMenuControl(weld::Widget* 
pParent, ScCheckListMen
 , mxTextColorMenu(mxBuilder->weld_tree_view("textcolor"))
 , mxScratchIter(mxMenu->make_iterator())
 , mrParentControl(rParentControl)
-, mpNotifier(pNotifier)
 , mnBackColorMenuPrefHeight(-1)
 , mnTextColorMenuPrefHeight(-1)
 , mb

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

2022-04-15 Thread rash419 (via logerrit)
 sc/source/ui/attrdlg/scdlgfact.cxx |7 ++
 sc/source/ui/attrdlg/scdlgfact.hxx |5 +
 sc/source/ui/view/cellsh3.cxx  |   96 +
 3 files changed, 65 insertions(+), 43 deletions(-)

New commits:
commit f7e1018f88f400aeee91a0b85a26964492e216fc
Author: rash419 
AuthorDate: Tue Apr 12 20:00:13 2022 +0530
Commit: Szymon Kłos 
CommitDate: Fri Apr 15 10:47:56 2022 +0200

sc: convert optimal width/height and normal width/height dialog to async

Signed-off-by: rash419 
Change-Id: I96f6d90692d7767bdc276f753897bdc392c90411
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132919
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx 
b/sc/source/ui/attrdlg/scdlgfact.cxx
index 928f235882ad..57648f857fef 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -192,6 +192,11 @@ short AbstractScMetricInputDlg_Impl::Execute()
 return m_xDlg->run();
 }
 
+bool AbstractScMetricInputDlg_Impl::StartExecuteAsync(AsyncContext& rCtx)
+{
+return ScMetricInputDlg::runAsync(m_xDlg, rCtx.maEndDialogFn);
+}
+
 short AbstractScMoveTableDlg_Impl::Execute()
 {
 return m_xDlg->run();
@@ -1105,7 +1110,7 @@ VclPtr 
ScAbstractDialogFactory_Impl::CreateScMetricInp
 tools::Long
nMaximum ,
 tools::Long
nMinimum )
 {
-return 
VclPtr::Create(std::make_unique(pParent,
 sDialogName, nCurrent ,nDefault, eFUnit,
+return 
VclPtr::Create(std::make_shared(pParent,
 sDialogName, nCurrent ,nDefault, eFUnit,
 nDecimals, nMaximum , nMinimum));
 }
 
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx 
b/sc/source/ui/attrdlg/scdlgfact.hxx
index 46583103919f..b7e8d9efbe65 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -392,13 +392,14 @@ public:
 
 class AbstractScMetricInputDlg_Impl : public AbstractScMetricInputDlg
 {
-std::unique_ptr m_xDlg;
+std::shared_ptr m_xDlg;
 public:
-explicit AbstractScMetricInputDlg_Impl(std::unique_ptr p)
+explicit AbstractScMetricInputDlg_Impl(std::shared_ptr p)
 : m_xDlg(std::move(p))
 {
 }
 virtual short Execute() override;
+virtual bool StartExecuteAsync(AsyncContext& rCtx) override;
 virtual int GetInputValue() const override;
 };
 
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 924ce27ab5f8..e2e31108c944 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -697,21 +697,24 @@ void ScCellShell::Execute( SfxRequest& rReq )
 GetRowHeight( pData->GetCurY(),
   
pData->GetTabNo() );
 ScAbstractDialogFactory* pFact = 
ScAbstractDialogFactory::Create();
-ScopedVclPtr 
pDlg(pFact->CreateScMetricInputDlg(
+VclPtr 
pDlg(pFact->CreateScMetricInputDlg(
 pTabViewShell->GetFrameWeld(), "RowHeightDialog",
 nCurHeight, ScGlobal::nStdRowHeight,
 eMetric, 2, MAX_ROW_HEIGHT));
 
-if ( pDlg->Execute() == RET_OK )
-{
-tools::Long nVal = pDlg->GetInputValue();
-pTabViewShell->SetMarkedWidthOrHeight( false, 
SC_SIZE_DIRECT, static_cast(nVal) );
-
-// #101390#; the value of the macro should be in HMM 
so use TwipsToEvenHMM to convert
-rReq.AppendItem( SfxUInt16Item( FID_ROW_HEIGHT, 
static_cast(TwipsToEvenHMM(nVal)) ) );
-rReq.Done();
+pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 
nResult){
+if (nResult == RET_OK)
+{
+SfxRequest pRequest(pTabViewShell->GetViewFrame(), 
FID_ROW_HEIGHT);
+tools::Long nVal = pDlg->GetInputValue();
+pTabViewShell->SetMarkedWidthOrHeight( false, 
SC_SIZE_DIRECT, static_cast(nVal) );
 
-}
+// #101390#; the value of the macro should be in 
HMM so use TwipsToEvenHMM to convert
+pRequest.AppendItem( SfxUInt16Item( 
FID_ROW_HEIGHT, static_cast(TwipsToEvenHMM(nVal)) ) );
+pRequest.Done();
+}
+pDlg->disposeOnce();
+});
 }
 }
 break;
@@ -735,20 +738,24 @@ void ScCellShell::Execute( SfxRequest& rReq )
 FieldUnit eMetric = 
SC_MOD()->GetAppOptions().GetAppMetric();
 
 ScAbstractDialogFactory* pFact = 
ScAbstractDialogFactory::Create();
-

[Libreoffice-commits] core.git: offapi/com

2022-04-15 Thread Caolán McNamara (via logerrit)
 offapi/com/sun/star/frame/XModel2.idl |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 53ec893208e2fb82d1569a1e2414b83b5a20bbfa
Author: Caolán McNamara 
AuthorDate: Thu Apr 14 09:39:49 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 15 10:17:43 2022 +0200

warning: found  tag without matching 

so use same solution as com/sun/star/style/XStyleLoader.hdl

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

diff --git a/offapi/com/sun/star/frame/XModel2.idl 
b/offapi/com/sun/star/frame/XModel2.idl
index f6cb57d72500..615fc82446bf 100644
--- a/offapi/com/sun/star/frame/XModel2.idl
+++ b/offapi/com/sun/star/frame/XModel2.idl
@@ -147,7 +147,7 @@ interface XModel2 : com::sun::star::frame::XModel
 com::sun::star::document::MediaDescriptor::LockPrint
 com::sun::star::document::MediaDescriptor::LockSave
 com::sun::star::document::MediaDescriptor::LockEditDoc
-com::sun::star::document::MediaDescriptor::EncryptionData 
@since LibreOffice 7.0
+com::sun::star::document::MediaDescriptor::EncryptionData 
(since LibreOffice 7.0)
 
 
 @throws com::sun::star::lang::IllegalArgumentException When trying to 
set an unsupported property


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

2022-04-15 Thread Caolán McNamara (via logerrit)
 filter/source/graphicfilter/icgm/class4.cxx |   20 ++--
 1 file changed, 6 insertions(+), 14 deletions(-)

New commits:
commit 0ba7674c7389db8f1cf7eb089dc1c89ed93be778
Author: Caolán McNamara 
AuthorDate: Thu Apr 14 12:26:03 2022 +0100
Commit: Caolán McNamara 
CommitDate: Fri Apr 15 10:17:00 2022 +0200

ofz: Timeout 23s->4s

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

diff --git a/filter/source/graphicfilter/icgm/class4.cxx 
b/filter/source/graphicfilter/icgm/class4.cxx
index 4ef817844570..af66ff26ae09 100644
--- a/filter/source/graphicfilter/icgm/class4.cxx
+++ b/filter/source/graphicfilter/icgm/class4.cxx
@@ -276,29 +276,21 @@ void CGM::ImplDoClass4()
 if ( mbFigure )
 mpOutAct->CloseRegion();
 
-sal_uInt16  nPoints = 0;
-std::unique_ptr pPoints(new Point[ 0x4000 ]);
-
+std::vector aPoints;
 tools::PolyPolygon aPolyPolygon;
 FloatPoint  aFloatPoint;
-sal_uInt32  nEdgeFlag;
+
 while ( mnParaSize < mnElementSize )
 {
 ImplGetPoint( aFloatPoint, true );
-nEdgeFlag = ImplGetUI16();
-pPoints[ nPoints++ ] = Point( 
static_cast(aFloatPoint.X), 
static_cast(aFloatPoint.Y) );
+sal_uInt32 nEdgeFlag = ImplGetUI16();
+
aPoints.push_back(Point(static_cast(aFloatPoint.X), 
static_cast(aFloatPoint.Y)));
 if ( ( nEdgeFlag & 2 ) || ( mnParaSize == mnElementSize ) )
 {
-tools::Polygon aPolygon( nPoints );
-for ( sal_uInt16 i = 0; i < nPoints; i++ )
-{
-aPolygon.SetPoint( pPoints[ i ], i );
-}
-aPolyPolygon.Insert( aPolygon );
-nPoints = 0;
+aPolyPolygon.Insert(tools::Polygon(aPoints.size(), 
aPoints.data()));
+aPoints.clear();
 }
 }
-pPoints.reset();
 mpOutAct->DrawPolyPolygon( aPolyPolygon );
 }
 break;


[Libreoffice-commits] core.git: include/rtl

2022-04-15 Thread Stephan Bergmann (via logerrit)
 include/rtl/strbuf.hxx  |3 +++
 include/rtl/ustrbuf.hxx |3 +++
 2 files changed, 6 insertions(+)

New commits:
commit 21121b0cba765958f38176ba17be85b6bc3bcb58
Author: Stephan Bergmann 
AuthorDate: Thu Apr 14 22:57:56 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 15 09:49:53 2022 +0200

Also add C++20 char8_t overloads

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

diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx
index 89301a088d34..098e8b0bbc97 100644
--- a/include/rtl/strbuf.hxx
+++ b/include/rtl/strbuf.hxx
@@ -122,6 +122,9 @@ public:
 explicit OStringBuffer(bool) = delete;
 explicit OStringBuffer(char) = delete;
 explicit OStringBuffer(wchar_t) = delete;
+#if defined __cpp_char8_t
+explicit OStringBuffer(char8_t) = delete;
+#endif
 explicit OStringBuffer(char16_t) = delete;
 explicit OStringBuffer(char32_t) = delete;
 #endif
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index bb1bb9cef366..8c8cc54f8f01 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -122,6 +122,9 @@ public:
 explicit OUStringBuffer(bool) = delete;
 explicit OUStringBuffer(char) = delete;
 explicit OUStringBuffer(wchar_t) = delete;
+#if defined __cpp_char8_t
+explicit OUStringBuffer(char8_t) = delete;
+#endif
 explicit OUStringBuffer(char16_t) = delete;
 explicit OUStringBuffer(char32_t) = delete;
 #endif


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

2022-04-15 Thread Stephan Bergmann (via logerrit)
 fpicker/source/win32/VistaFilePickerImpl.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 020cf33af4de4f9a0b3a9b920d0b1035959df440
Author: Stephan Bergmann 
AuthorDate: Thu Apr 14 23:02:27 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 15 09:37:48 2022 +0200

loplugin:stringview

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

diff --git a/fpicker/source/win32/VistaFilePickerImpl.cxx 
b/fpicker/source/win32/VistaFilePickerImpl.cxx
index 76da82108cde..81732ce5cc97 100644
--- a/fpicker/source/win32/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/VistaFilePickerImpl.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "WinImplHelper.hxx"
 
 #include 
@@ -224,7 +225,7 @@ bailout:
 static OUString lcl_AdjustFilterName(const OUString& sName)
 {
 const sal_Int32 idx = sName.indexOf("(.");
-return (idx > 0) ? sName.copy(0, idx).trim() : sName;
+return (idx > 0) ? OUString(o3tl::trim(sName.subView(0, idx))) : sName;
 }
 
 // rvStrings holds the OUStrings, pointers to which data are stored in 
returned COMDLG_FILTERSPEC