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

2022-05-23 Thread Tünde Tóth (via logerrit)
 framework/source/services/autorecovery.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit aeb8a0076cd5ec2836b3dfc1adffcced432f995f
Author: Tünde Tóth 
AuthorDate: Thu May 19 15:14:20 2022 +0200
Commit: László Németh 
CommitDate: Mon May 23 08:59:45 2022 +0200

tdf#149176 tdf#149178 fix Save autorecovery information.. option

Autorecovery information was saved in every 10 minutes,
regardless of the "Save Autorecovery information every" setting.

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

diff --git a/framework/source/services/autorecovery.cxx 
b/framework/source/services/autorecovery.cxx
index ffc426a21d19..d4b68b11c994 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -96,6 +96,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -1751,7 +1752,7 @@ void AutoRecovery::implts_readAutoSaveConfig()
 implts_openConfig();
 
 // AutoSave [bool]
-bool bEnabled(officecfg::Office::Recovery::AutoSave::Enabled::get());
+bool bEnabled(officecfg::Office::Common::Save::Document::AutoSave::get());
 
 /* SAFE */ {
 osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);
@@ -1779,7 +1780,8 @@ void AutoRecovery::implts_readAutoSaveConfig()
 } /* SAFE */
 
 // AutoSaveTimeIntervall [int] in min
-sal_Int32 
nTimeIntervall(officecfg::Office::Recovery::AutoSave::TimeIntervall::get());
+sal_Int32 nTimeIntervall(
+
officecfg::Office::Common::Save::Document::AutoSaveTimeIntervall::get());
 
 /* SAFE */ {
 osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);


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

2022-05-23 Thread Heiko Tietze (via logerrit)
 sc/qa/uitest/conditional_format/tdf81696.py |2 
 sc/qa/uitest/sort/naturalSort.py|5 
 sc/qa/uitest/sort/sorting.py|4 
 sc/qa/uitest/sort/tdf49531.py   |6 
 sc/qa/uitest/sort/tdf53482.py   |7 
 sc/qa/uitest/sort/tdf57465.py   |8 -
 sc/qa/uitest/sort/tdf91305.py   |9 -
 sc/qa/uitest/sort/tdf99208.py   |   11 -
 sc/source/ui/dbgui/sortdlg.cxx  |2 
 sc/source/ui/dbgui/sortkeydlg.cxx   |6 
 sc/source/ui/dbgui/tpsort.cxx   |  198 ++--
 sc/source/ui/inc/sortdlg.hxx|9 -
 sc/source/ui/inc/tpsort.hxx |   17 +-
 sc/uiconfig/scalc/ui/sortcriteriapage.ui|  154 -
 sc/uiconfig/scalc/ui/sortkey.ui |3 
 sc/uiconfig/scalc/ui/sortoptionspage.ui |  123 ++---
 16 files changed, 270 insertions(+), 294 deletions(-)

New commits:
commit 7c2bcac3e6aac31811adede6f466d2125184da4c
Author: Heiko Tietze 
AuthorDate: Wed Mar 2 12:20:44 2022 +0100
Commit: Heiko Tietze 
CommitDate: Mon May 23 09:02:45 2022 +0200

Resolves tdf#131155 - Keep frequently used options on sort criteria tab

* Row/Column header moved
* Sort by row/column moved
* Extra variables removed
* UI tests adjusted to read/set sort direction and header from first tab

Change-Id: I9fc0406806256f289d52e45b096e392067768eaa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130843
Tested-by: Heiko Tietze 
Reviewed-by: Heiko Tietze 

diff --git a/sc/qa/uitest/conditional_format/tdf81696.py 
b/sc/qa/uitest/conditional_format/tdf81696.py
index 6b9bb7903154..0fca31e2bd98 100644
--- a/sc/qa/uitest/conditional_format/tdf81696.py
+++ b/sc/qa/uitest/conditional_format/tdf81696.py
@@ -28,7 +28,7 @@ class tdf81696(UITestCase):
 #Open sort dialog by DATA - SORT,Just sort it by Column A, 
ascending. (it's default)
 with self.ui_test.execute_dialog_through_command(".uno:DataSort") 
as xDialog:
 xTabs = xDialog.getChild("tabcontrol")
-xleftright = xDialog.getChild("leftright")
+xleftright = xDialog.getChild("rbLeftRight")
 select_pos(xTabs, "0")
 
 #verify
diff --git a/sc/qa/uitest/sort/naturalSort.py b/sc/qa/uitest/sort/naturalSort.py
index ca8384d5f2bf..6d9dd3edd7ca 100644
--- a/sc/qa/uitest/sort/naturalSort.py
+++ b/sc/qa/uitest/sort/naturalSort.py
@@ -85,12 +85,13 @@ class CalcNaturalSorting(UITestCase):
 #Open sort dialog by DATA - SORT
 with self.ui_test.execute_dialog_through_command(".uno:DataSort") 
as xDialog:
 xTabs = xDialog.getChild("tabcontrol")
-xleftright = xDialog.getChild("leftright")
 select_pos(xTabs, "1")
 xNatural = xDialog.getChild("naturalsort")
-xleftright.executeAction("CLICK", tuple())
 if (get_state_as_dict(xNatural)["Selected"]) == "false":
 xNatural.executeAction("CLICK", tuple())
+select_pos(xTabs, "0")
+xleftright = xDialog.getChild("rbLeftRight")
+xleftright.executeAction("CLICK", tuple())
 
 #Verify
 self.assertEqual(get_cell_by_position(document, 0, 0, 
0).getString(), "MW-1")
diff --git a/sc/qa/uitest/sort/sorting.py b/sc/qa/uitest/sort/sorting.py
index 10645827435c..a3c901574109 100644
--- a/sc/qa/uitest/sort/sorting.py
+++ b/sc/qa/uitest/sort/sorting.py
@@ -58,7 +58,7 @@ class CalcSorting(UITestCase):
 xTabs = xDialog.getChild("tabcontrol")
 select_pos(xTabs, "1")
 #Verify that option "Range contains column labels" is set
-xHeader = xDialog.getChild("header")
+xHeader = xDialog.getChild("cbHeader")
 self.assertEqual(get_state_as_dict(xHeader)["Selected"], 
"true")
 #Cancel dialog
 #Select Range A1:B5
@@ -100,7 +100,7 @@ class CalcSorting(UITestCase):
 xTabs = xDialog.getChild("tabcontrol")
 select_pos(xTabs, "1")
 #Verify that option "Range contains column labels" is not set
-xHeader = xDialog.getChild("header")
+xHeader = xDialog.getChild("cbHeader")
 self.assertEqual(get_state_as_dict(xHeader)["Selected"], 
"false")
 #Cancel dialog
 
diff --git a/sc/qa/uitest/sort/tdf49531.py b/sc/qa/uitest/sort/tdf49531.py
index 08f94cd1a275..98d705bf8dd3 100644
--- a/sc/qa/uitest/sort/tdf49531.py
+++ b/sc/qa/uitest/sort/tdf49531.py
@@ -31,14 +31,14 @@ class tdf49531(UITestCase):
 xTabs = xDialog.getChild("tabcontrol")
 select_pos(xTabs, "1")
 xNatural = xDialog.getChild("naturalsort")
-xtopdown = xDialog.getChild("topdown")
-xHe

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

2022-05-23 Thread Miklos Vajna (via logerrit)
 sw/qa/uibase/wrtsh/wrtsh.cxx |4 
 sw/source/filter/ww8/docxattributeoutput.cxx |   16 +-
 sw/source/filter/ww8/rtfattributeoutput.cxx  |   12 +-
 sw/source/filter/ww8/writerwordglue.cxx  |   22 +--
 sw/source/filter/ww8/writerwordglue.hxx  |8 -
 sw/source/filter/ww8/ww8atr.cxx  |   12 +-
 sw/source/filter/ww8/ww8glsy.cxx |   30 ++---
 sw/source/filter/ww8/ww8glsy.hxx |   14 +-
 sw/source/filter/ww8/ww8par.hxx  |   14 +-
 sw/source/filter/ww8/ww8par2.cxx |2 
 sw/source/filter/ww8/ww8par3.cxx |  154 +--
 sw/source/filter/ww8/ww8par6.cxx |   10 -
 12 files changed, 149 insertions(+), 149 deletions(-)

New commits:
commit 42e88e3b34faf7b5fea116c91aa85a0c4043d359
Author: Miklos Vajna 
AuthorDate: Mon May 23 08:32:40 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 23 09:15:34 2022 +0200

sw: prefix members of SwWW8Shade, WW8Glossary, WW8ListManager and ...

... sw::util::HdFtDistanceGlue

See tdf#94879 for motivation.

And add a build-time test to ensure that wrtsh.hxx is self-contained.

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

diff --git a/sw/qa/uibase/wrtsh/wrtsh.cxx b/sw/qa/uibase/wrtsh/wrtsh.cxx
index 3fd708bf2a48..65a41086dce4 100644
--- a/sw/qa/uibase/wrtsh/wrtsh.cxx
+++ b/sw/qa/uibase/wrtsh/wrtsh.cxx
@@ -7,7 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include 
+#include 
 
 #include 
 
@@ -19,10 +19,10 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 65fc656ee13a..40ad41934480 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -7298,10 +7298,10 @@ void DocxAttributeOutput::SectionPageBorders( const 
SwFrameFormat* pFormat, cons
 editeng::WordPageMargins aMargins = m_pageMargins;
 HdFtDistanceGlue aGlue(pFormat->GetAttrSet());
 if (aGlue.HasHeader())
-aMargins.nTop = aGlue.dyaHdrTop;
+aMargins.nTop = aGlue.m_DyaHdrTop;
 // Ditto for bottom margin.
 if (aGlue.HasFooter())
-aMargins.nBottom = aGlue.dyaHdrBottom;
+aMargins.nBottom = aGlue.m_DyaHdrBottom;
 
 if 
(pFormat->GetDoc()->getIDocumentSettingAccess().get(DocumentSettingId::GUTTER_AT_TOP))
 {
@@ -9416,7 +9416,7 @@ void DocxAttributeOutput::FormatULSpace( const 
SvxULSpaceItem& rULSpace )
 
 sal_Int32 nHeader = 0;
 if ( aDistances.HasHeader() )
-nHeader = sal_Int32( aDistances.dyaHdrTop );
+nHeader = sal_Int32( aDistances.m_DyaHdrTop );
 else if (m_rExport.m_pFirstPageFormat)
 {
 HdFtDistanceGlue 
aFirstPageDistances(m_rExport.m_pFirstPageFormat->GetAttrSet());
@@ -9425,16 +9425,16 @@ void DocxAttributeOutput::FormatULSpace( const 
SvxULSpaceItem& rULSpace )
 // The follow page style has no header, but the first page 
style has. In Word terms,
 // this means that the header margin of "the" section is 
coming from the first page
 // style.
-nHeader = sal_Int32(aFirstPageDistances.dyaHdrTop);
+nHeader = sal_Int32(aFirstPageDistances.m_DyaHdrTop);
 }
 }
 
 // Page top
-m_pageMargins.nTop = aDistances.dyaTop;
+m_pageMargins.nTop = aDistances.m_DyaTop;
 
 sal_Int32 nFooter = 0;
 if ( aDistances.HasFooter() )
-nFooter = sal_Int32( aDistances.dyaHdrBottom );
+nFooter = sal_Int32( aDistances.m_DyaHdrBottom );
 else if (m_rExport.m_pFirstPageFormat)
 {
 HdFtDistanceGlue 
aFirstPageDistances(m_rExport.m_pFirstPageFormat->GetAttrSet());
@@ -9443,12 +9443,12 @@ void DocxAttributeOutput::FormatULSpace( const 
SvxULSpaceItem& rULSpace )
 // The follow page style has no footer, but the first page 
style has. In Word terms,
 // this means that the footer margin of "the" section is 
coming from the first page
 // style.
-nFooter = sal_Int32(aFirstPageDistances.dyaHdrBottom);
+nFooter = sal_Int32(aFirstPageDistances.m_DyaHdrBottom);
 }
 }
 
 // Page Bottom
-m_pageMargins.nBottom = aDistances.dyaBottom;
+m_pageMargins.nBottom = aDistances.m_DyaBottom;
 
 AddToAttrList( m_pSectionSpacingAttrList, 4,
 FSNS( XML_w, XML_header ), OString::number( nHeader ).getStr(),
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx 
b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 645de35025ea..20e8e6fc907c 100644
--- a/sw/source/filter

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

2022-05-23 Thread Michael Stahl (via logerrit)
 comphelper/source/streaming/memorystream.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 5cf5df83aad9c9c97060043727337bdef8af10ec
Author: Michael Stahl 
AuthorDate: Sun May 22 11:06:43 2022 +0200
Commit: Julien Nabet 
CommitDate: Mon May 23 09:42:24 2022 +0200

comphelper: -Werror=class-memaccess

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

diff --git a/comphelper/source/streaming/memorystream.cxx 
b/comphelper/source/streaming/memorystream.cxx
index 7edfe7a78ce0..ea1a955cb4d4 100644
--- a/comphelper/source/streaming/memorystream.cxx
+++ b/comphelper/source/streaming/memorystream.cxx
@@ -218,7 +218,8 @@ void SAL_CALL UNOMemoryStream::writeBytes( const Sequence< 
sal_Int8 >& aData )
 
 NoInitInt8* pData = &(*maData.begin());
 NoInitInt8* pCursor = &(pData[mnCursor]);
-memcpy( pCursor, aData.getConstArray(), nBytesToWrite );
+// cast to avoid -Werror=class-memaccess
+memcpy(static_cast(pCursor), aData.getConstArray(), nBytesToWrite);
 
 mnCursor += nBytesToWrite;
 }


[Libreoffice-commits] translations.git: Changes to 'feature/cib_contract138c'

2022-05-23 Thread Samuel Mehrbrodt (via logerrit)
New branch 'feature/cib_contract138c' available with the following commits:
commit 3caabbbf1c795b0fce31603269f99d656a01ff0c
Author: Samuel Mehrbrodt 
Date:   Wed May 11 08:32:55 2022 +0200

Add translation df05d27336927373bf83664a90156fbe505fc546

Change-Id: I8f691b27668b6942d29d44320e326f95a4a2239b



[Libreoffice-commits] core.git: Branch 'feature/cib_contract138c' - translations

2022-05-23 Thread Samuel Mehrbrodt (via logerrit)
 translations |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 72ea4f4983456a6801d49478ea74d603ce306f98
Author: Samuel Mehrbrodt 
AuthorDate: Mon May 23 10:07:20 2022 +0200
Commit: Gerrit Code Review 
CommitDate: Mon May 23 10:07:20 2022 +0200

Update git submodules

* Update translations from branch 'feature/cib_contract138c'
  to 3caabbbf1c795b0fce31603269f99d656a01ff0c
  - Add translation df05d27336927373bf83664a90156fbe505fc546

Change-Id: I8f691b27668b6942d29d44320e326f95a4a2239b

diff --git a/translations b/translations
index 3e7a06d16ca2..3caabbbf1c79 16
--- a/translations
+++ b/translations
@@ -1 +1 @@
-Subproject commit 3e7a06d16ca2b062179f0ea9ba1d0cc573f4c4b4
+Subproject commit 3caabbbf1c795b0fce31603269f99d656a01ff0c


[Libreoffice-commits] core.git: external/skia

2022-05-23 Thread Michael Stahl (via logerrit)
 external/skia/fix-warnings.patch.1 |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 3a1d90f4844f44ceea6b07ef8aa3947aae624825
Author: Michael Stahl 
AuthorDate: Sun May 22 12:28:19 2022 +0200
Commit: Michael Weghorn 
CommitDate: Mon May 23 10:14:38 2022 +0200

skia: fix GCC12 -Werror=shadow

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

diff --git a/external/skia/fix-warnings.patch.1 
b/external/skia/fix-warnings.patch.1
index fc9418739810..2aefd91c52e4 100644
--- a/external/skia/fix-warnings.patch.1
+++ b/external/skia/fix-warnings.patch.1
@@ -26,3 +26,14 @@ index f143dab013..be3cde0f4f 100644
  
  const DisplayParams& getDisplayParams() { return fDisplayParams; }
  virtual void setDisplayParams(const DisplayParams& params) = 0;
+--- skia/include/core/SkSamplingOptions.h.orig 2022-05-22 12:25:06.112544528 
+0200
 skia/include/core/SkSamplingOptions.h  2022-05-22 12:25:09.207636134 
+0200
+@@ -97,7 +97,7 @@
+ bool isAniso() const { return maxAniso != 0; }
+ 
+ private:
+-SkSamplingOptions(int maxAniso) : maxAniso(maxAniso) {}
++SkSamplingOptions(int maxAniso_) : maxAniso(maxAniso_) {}
+ };
+ 
+ #endif


[Libreoffice-commits] core.git: Branch 'distro/cib/libreoffice-6-4' - vcl/win

2022-05-23 Thread Jan-Marek Glogowski (via logerrit)
 vcl/win/window/salframe.cxx |   57 ++--
 1 file changed, 55 insertions(+), 2 deletions(-)

New commits:
commit 5d15bf26b982953668f5d80f1d8f745d6cc8daf1
Author: Jan-Marek Glogowski 
AuthorDate: Mon Mar 9 15:25:20 2020 +0100
Commit: Thorsten Behrens 
CommitDate: Mon May 23 10:31:34 2022 +0200

WIN add bootstrap var to re-enable foreground hack

We already found a regressed installation from commit
518c0265efebf39ab6d1e90c4ec4e7cf52b701c6 ("WIN prevent deadlock
in SetForegroundWindow").

Finding a real fix might be impossible, so this just adds the
bootstrap.ini boolean variable Win32.EnableAttachThreadInputHack
to re-enable the previous AttachThreadInput hack on demand.

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

diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 0997d3de9149..dd5f8fbb8533 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -33,6 +33,12 @@
 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+#include 
+
 #include 
 #include 
 #include 
@@ -1924,16 +1930,63 @@ void WinSalFrame::SetAlwaysOnTop( bool bOnTop )
 SetWindowPos( mhWnd, hWnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | 
SWP_NOACTIVATE );
 }
 
+static bool EnableAttachThreadInputHack()
+{
+OUString aBootstrapUri;
+if (osl_getProcessWorkingDir(&aBootstrapUri.pData) != osl_Process_E_None)
+return false;
+aBootstrapUri += "/bootstrap.ini";
+
+OUString aSystemFileName;
+if (osl::FileBase::getSystemPathFromFileURL(aBootstrapUri, 
aSystemFileName) != osl::FileBase::E_None)
+return false;
+if (aSystemFileName.getLength() > MAX_PATH)
+return false;
+
+// this uses the Boost ini parser, instead of tools::Config, as we already 
use it to read other
+// values from bootstrap.ini in desktop/win32/source/loader.cxx, because 
that watchdog process
+// can't access LO libs. This way the handling is consistent.
+try
+{
+boost::property_tree::ptree pt;
+std::ifstream aFile(o3tl::toW(aSystemFileName.getStr()));
+boost::property_tree::ini_parser::read_ini(aFile, pt);
+const bool bEnabled = pt.get("Win32.EnableAttachThreadInputHack", 
false);
+SAL_WARN_IF(bEnabled, "vcl", "AttachThreadInput hack is enabled. Watch 
out for deadlocks!");
+return bEnabled;
+}
+catch (...)
+{
+return false;
+}
+}
+
 static void ImplSalToTop( HWND hWnd, SalFrameToTop nFlags )
 {
+static const bool bEnableAttachThreadInputHack = 
EnableAttachThreadInputHack();
+
 WinSalFrame* pToTopFrame = GetWindowPtr( hWnd );
 if( pToTopFrame && (pToTopFrame->mnStyle & 
SalFrameStyleFlags::SYSTEMCHILD) )
 BringWindowToTop( hWnd );
 
 if ( nFlags & SalFrameToTop::ForegroundTask )
 {
-// LO used to call AttachThreadInput here, which resulted in deadlocks!
-SetForegroundWindow_Impl(hWnd);
+// LO used to always call AttachThreadInput here, which resulted in 
deadlocks
+// in some installations for unknown reasons!
+if (bEnableAttachThreadInputHack)
+{
+// This magic code is necessary to connect the input focus of the
+// current window thread and the thread which owns the window that
+// should be the new foreground window.
+HWND hCurrWnd = GetForegroundWindow();
+DWORD myThreadID = GetCurrentThreadId();
+DWORD currThreadID = GetWindowThreadProcessId(hCurrWnd,nullptr);
+AttachThreadInput(myThreadID, currThreadID, TRUE);
+SetForegroundWindow_Impl(hWnd);
+AttachThreadInput(myThreadID, currThreadID, FALSE);
+}
+else
+SetForegroundWindow_Impl(hWnd);
 }
 
 if ( nFlags & SalFrameToTop::RestoreWhenMin )


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

2022-05-23 Thread Stephan Bergmann (via logerrit)
 binaryurp/source/binaryany.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit de403384f2efb163f8881aa42e08c6ead25291bd
Author: Stephan Bergmann 
AuthorDate: Mon May 23 08:51:29 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 23 10:32:40 2022 +0200

Adapt comment

...after 084b2b068ad6729775f7fa5965429fc5cc3c2ae3 "optimise 
Any::operator=(&&) a
little" folded moveAnyInternals into its only remaining call site

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

diff --git a/binaryurp/source/binaryany.cxx b/binaryurp/source/binaryany.cxx
index 17db2f3775ef..7f6e14a6fb35 100644
--- a/binaryurp/source/binaryany.cxx
+++ b/binaryurp/source/binaryany.cxx
@@ -32,7 +32,7 @@ namespace binaryurp {
 
 namespace {
 
-// Cf. com::sun::star::uno::detail::moveAnyInternals in
+// Cf. com::sun::star::uno::Any move ctor in
 // include/com/sun/star/uno/Any.hxx:
 void moveInternals(uno_Any & from, uno_Any & to) {
 uno_any_construct(&to, nullptr, nullptr, nullptr);


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

2022-05-23 Thread Luboš Luňák (via logerrit)
 vcl/source/gdi/impglyphitem.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 5d02daa5198d5bff9234d5db698e934a5e31c95f
Author: Luboš Luňák 
AuthorDate: Mon May 23 09:29:24 2022 +0200
Commit: Luboš Luňák 
CommitDate: Mon May 23 10:34:04 2022 +0200

handle RTL space in non-RTL layout in SalLayoutGlyphsCache

Reproduced with tdf#95217-1 on the crashtesting server.

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

diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index 3711d3298039..a3ab689ff23e 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -164,7 +164,7 @@ SalLayoutGlyphsImpl* 
SalLayoutGlyphsImpl::cloneCharRange(sal_Int32 index, sal_In
 if (!isSafeToBreak(pos, rtl))
 return nullptr;
 }
-// HACK: If mode is se to be RTL, but the last glyph is a non-RTL space,
+// HACK: If mode is set to be RTL, but the last glyph is a non-RTL space,
 // then making a subset would give a different result than the actual 
layout,
 // because the weak BiDi mode code in ImplLayoutArgs ctor would interpret
 // the string subset ending with space as the space being RTL, but it would
@@ -174,6 +174,12 @@ SalLayoutGlyphsImpl* 
SalLayoutGlyphsImpl::cloneCharRange(sal_Int32 index, sal_In
 {
 return nullptr;
 }
+// Similarly, if mode is not RTL but the last glyph is an RTL space.
+if (!(GetFlags() & SalLayoutFlags::BiDiRtl) && rtl && !copy->empty()
+&& copy->back().IsSpacing())
+{
+return nullptr;
+}
 return copy.release();
 }
 


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

2022-05-23 Thread Michael Stahl (via logerrit)
 svl/source/misc/sharedstringpool.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 694db7d3e7be0caf81dd52dba1a865db206ac145
Author: Michael Stahl 
AuthorDate: Sun May 22 12:26:48 2022 +0200
Commit: Michael Stahl 
CommitDate: Mon May 23 10:40:54 2022 +0200

svl: spurious GCC12 -Werror=maybe-uninitialized

In file included from svl/source/misc/sharedstringpool.cxx:11:
In constructor ‘svl::SharedString::SharedString(rtl_uString*, 
rtl_uString*)’,
inlined from ‘svl::SharedString svl::SharedStringPool::intern(const 
rtl::OUString&)’ at svl/source/misc/sharedstringpool.cxx:129:51:
include/svl/sharedstring.hxx:56:20: error: ‘pResultUpper’ may be used 
uninitialized [-Werror=maybe-uninitialized]
   56 | mpData(pData), mpDataIgnoreCase(pDataIgnoreCase)
  |^
svl/source/misc/sharedstringpool.cxx: In member function ‘svl::SharedString 
svl::SharedStringPool::intern(const rtl::OUString&)’:
svl/source/misc/sharedstringpool.cxx:93:33: note: ‘pResultUpper’ was 
declared here
   93 | rtl_uString *pResultLower, *pResultUpper;
  | ^~~~

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

diff --git a/svl/source/misc/sharedstringpool.cxx 
b/svl/source/misc/sharedstringpool.cxx
index a37c36b641d7..4f891d3677d1 100644
--- a/svl/source/misc/sharedstringpool.cxx
+++ b/svl/source/misc/sharedstringpool.cxx
@@ -90,7 +90,7 @@ SharedString SharedStringPool::intern(const OUString& rStr)
 {
 auto& rMap = mpImpl->maStrMap;
 
-rtl_uString *pResultLower, *pResultUpper;
+rtl_uString *pResultLower = {}, *pResultUpper = {}; // bogus GCC 12 
-Werror=maybe-uninitialized
 if (rMap.find_fn(rStr.pData, [&](const Mapped& rMapped) {
 pResultLower = rMapped.first.pData;
 pResultUpper = rMapped.second.pData;


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

2022-05-23 Thread Michael Stahl (via logerrit)
 vcl/source/helper/strhelper.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit cd4976646dc2e5b28c3328a7fa96361e147b23b9
Author: Michael Stahl 
AuthorDate: Sun May 22 12:51:35 2022 +0200
Commit: Michael Stahl 
CommitDate: Mon May 23 10:45:21 2022 +0200

vcl: WhitespaceToSpace() spurious -Werror=maybe-uninitialized

vcl/source/helper/strhelper.cxx:366:9: error: ‘pBuffer[-1]’ may be used 
uninitialized [-Werror=maybe-uninitialized]

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

diff --git a/vcl/source/helper/strhelper.cxx b/vcl/source/helper/strhelper.cxx
index e44ba8530542..9d05b2c9811e 100644
--- a/vcl/source/helper/strhelper.cxx
+++ b/vcl/source/helper/strhelper.cxx
@@ -363,9 +363,15 @@ OString WhitespaceToSpace(std::string_view rLine)
 // there might be a space at beginning or end
 assert(pLeap > pBuffer);
 pLeap--;
+#if defined(__GNUC__) && __GNUC__ == 12
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#endif
 if( *pLeap == ' ' )
 *pLeap = 0;
-
+#if defined(__GNUC__) && __GNUC__ == 12
+#pragma GCC diagnostic pop
+#endif
 return *pBuffer == ' ' ? pBuffer+1 : pBuffer;
 }
 


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

2022-05-23 Thread Michael Stahl (via logerrit)
 vcl/unx/generic/printer/cpdmgr.cxx  |2 +-
 vcl/unx/generic/printer/cupsmgr.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 02ebfb8ed6175934a1985786e6816ecef1bd59f8
Author: Michael Stahl 
AuthorDate: Sun May 22 12:55:36 2022 +0200
Commit: Michael Stahl 
CommitDate: Mon May 23 10:47:08 2022 +0200

vcl: GCC12 says fclose() causes -Werror=use-after-free on any use of FILE*

In file included from vcl/inc/unx/cpdmgr.hxx:34,
 from vcl/unx/generic/printer/cpdmgr.cxx:25:
In member function ‘size_t psp::FPtrHash::operator()(const FILE*) const’,
inlined from ‘std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, 
_Hash, _RangeHash, _Unused, __cache_hash_code>::__hash_code 
std::__detail::_Hash_code_base<_Key, _Value, _ExtractKey, _Hash, _RangeHash, 
_Unused, __cache_hash_code>::_M_hash_code(const _Key&) const [with _Key = 
_IO_FILE*; _Value = std::pair<_IO_FILE* const, rtl::OString>; _ExtractKey = 
std::__detail::_Select1st; _Hash = psp::FPtrHash; _RangeHash = 
std::__detail::_Mod_range_hashing; _Unused = 
std::__detail::_Default_ranged_hash; bool __cache_hash_code = true]’ at 
/usr/include/c++/12/bits/hashtable_policy.h:1268:18,
inlined from ‘std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, 
_Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::size_type 
std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, 
_Unused, _RehashPolicy, _Traits>::_M_erase(std::true_type, const key_type&) 
[with _Key = _IO_FILE*; _Value = std::pair<_IO_FILE* const, rtl::OString>; 
_Alloc = std::allocator >; _ExtractKey 
= std::__detail::_Select1st; _Equal = std::equal_to<_IO_FILE*>; _Hash = 
psp::FPtrHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = 
std::__detail::_Default_ranged_hash; _RehashPolicy = 
std::__detail::_Prime_rehash_policy; _Traits = 
std::__detail::_Hashtable_traits]’ at 
/usr/include/c++/12/bits/hashtable.h:2358:43,
inlined from ‘std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, 
_Equal, _Hash, _RangeHash, _Unused, _RehashPolicy, _Traits>::size_type 
std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _Hash, _RangeHash, 
_Unused, _RehashPolicy, _Traits>::erase(const key_type&) [with _Key = 
_IO_FILE*; _Value = std::pair<_IO_FILE* const, rtl::OString>; _Alloc = 
std::allocator >; _ExtractKey = 
std::__detail::_Select1st; _Equal = std::equal_to<_IO_FILE*>; _Hash = 
psp::FPtrHash; _RangeHash = std::__detail::_Mod_range_hashing; _Unused = 
std::__detail::_Default_ranged_hash; _RehashPolicy = 
std::__detail::_Prime_rehash_policy; _Traits = 
std::__detail::_Hashtable_traits]’ at 
/usr/include/c++/12/bits/hashtable.h:971:24,
inlined from ‘std::unordered_map<_Key, _Tp, _Hash, _Pred, 
_Alloc>::size_type std::unordered_map<_Key, _Tp, _Hash, _Pred, 
_Alloc>::erase(const key_type&) [with _Key = _IO_FILE*; _Tp = rtl::OString; 
_Hash = psp::FPtrHash; _Pred = std::equal_to<_IO_FILE*>; _Alloc = 
std::allocator >]’ at 
/usr/include/c++/12/bits/unordered_map.h:763:26,
inlined from ‘virtual bool psp::CPDManager::endSpool(const 
rtl::OUString&, const rtl::OUString&, FILE*, const psp::JobData&, bool, const 
rtl::OUString&)’ at vcl/unx/generic/printer/cpdmgr.cxx:725:28:
vcl/inc/unx/cupsmgr.hxx:35:43: error: pointer may be used after ‘int 
fclose(FILE*)’ [-Werror=use-after-free]
   35 | { return reinterpret_cast(pPtr); }
  |   ^
vcl/unx/generic/printer/cpdmgr.cxx: In member function ‘virtual bool 
psp::CPDManager::endSpool(const rtl::OUString&, const rtl::OUString&, FILE*, 
const psp::JobData&, bool, const rtl::OUString&)’:
vcl/unx/generic/printer/cpdmgr.cxx:695:15: note: call to ‘int 
fclose(FILE*)’ here
  695 | fclose( pFile );
  | ~~^

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

diff --git a/vcl/unx/generic/printer/cpdmgr.cxx 
b/vcl/unx/generic/printer/cpdmgr.cxx
index 0a830a7e13c0..fdee9d5b70d6 100644
--- a/vcl/unx/generic/printer/cpdmgr.cxx
+++ b/vcl/unx/generic/printer/cpdmgr.cxx
@@ -722,7 +722,7 @@ bool CPDManager::endSpool( const OUString& rPrintername, 
const OUString& rJobTit
 }
 g_variant_unref(ret);
 unlink( it->second.getStr() );
-m_aSpoolFiles.erase( pFile );
+m_aSpoolFiles.erase(it);
 }
 #else
 (void)rPrintername;
diff --git a/vcl/unx/generic/printer/cupsmgr.cxx 
b/vcl/unx/generic/printer/cupsmgr.cxx
index a0f00106013f..6acfe1db6ee1 100644
--- a/vcl/unx/generic/printer/cupsmgr.cxx
+++ b/vcl/unx/generic/printer/cupsmgr.cxx
@@ -881,7 +881,7 @@ bool CUPSManager::endSpool( const OUString& rPrintername, 
const OUString& rJobTi
 #endif
 
 unlink( it->second.getStr() );
-m_aSpoolFiles.erase( pFile );
+m_aSpoolFiles.erase(it);
 if( pOp

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

2022-05-23 Thread Michael Stahl (via logerrit)
 svx/source/form/formcontrolling.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d37486537e7d404b19acdfaec358cb0ad706940c
Author: Michael Stahl 
AuthorDate: Sun May 22 13:25:50 2022 +0200
Commit: Michael Stahl 
CommitDate: Mon May 23 10:47:28 2022 +0200

svx: work around GCC12 spurious -Werror=stringop-overflow

/usr/include/c++/12/bits/stl_algobase.h:431:30: error: ‘void*
__builtin_memcpy(void*, const void*, long unsigned int)’ writing 1 or
more bytes into a region of size 0 overflows the destination
[-Werror=stringop-overflow=]

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

diff --git a/svx/source/form/formcontrolling.cxx 
b/svx/source/form/formcontrolling.cxx
index 456e5a88ffbf..221ae3584f21 100644
--- a/svx/source/form/formcontrolling.cxx
+++ b/svx/source/form/formcontrolling.cxx
@@ -425,6 +425,7 @@ namespace svx
 SID_FM_VIEW_AS_GRID
 };
 sal_Int32 nFeatureCount = SAL_N_ELEMENTS( pSupportedFeatures );
+aSupportedFeatures.reserve(nFeatureCount); // work around GCC12 
spurious -Werror=stringop-overflow=
 aSupportedFeatures.insert( aSupportedFeatures.begin(), 
pSupportedFeatures, pSupportedFeatures + nFeatureCount );
 
 m_pInvalidationCallback->invalidateFeatures( aSupportedFeatures );


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

2022-05-23 Thread Michael Stahl (via logerrit)
 sw/inc/ndindex.hxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 486991b8ec2b63324c8cf5a26e9091942c24b3d9
Author: Michael Stahl 
AuthorDate: Sun May 22 13:50:11 2022 +0200
Commit: Michael Stahl 
CommitDate: Mon May 23 10:48:07 2022 +0200

sw: SwNodeIndex GCC12 spurious -Werror=dangling-pointer=

It doesn't understand that ~SwNodeIndex() will remove the pointer,
which is obfuscated by over-boostified code.

In member function ‘void SwNodeIndex::RegisterIndex(SwNodes&)’,
inlined from ‘SwNodeIndex::SwNodeIndex(SwNodes&, SwNodeOffset)’ at 
sw/inc/ndindex.hxx:54:22,
inlined from ‘bool SwNodes::InsBoxen(SwTableNode*, SwTableLine*, 
SwTableBoxFormat*, SwTextFormatColl*, const SfxItemSet*, sal_uInt16, 
sal_uInt16)’ at sw/source/core/docnode/ndtbl.cxx:301:41:
sw/inc/ndindex.hxx:37:31: error: storing the address of local variable 
‘aEndIdx’ in ‘*this.SwNodes::m_vIndices’ [-Werror=dangling-pointer=]
   37 | rNodes.m_vIndices = this;
  | ~~^~
sw/source/core/docnode/ndtbl.cxx: In member function ‘bool 
SwNodes::InsBoxen(SwTableNode*, SwTableLine*, SwTableBoxFormat*, 
SwTextFormatColl*, const SfxItemSet*, sal_uInt16, sal_uInt16)’:
sw/source/core/docnode/ndtbl.cxx:301:17: note: ‘aEndIdx’ declared here
  301 | SwNodeIndex aEndIdx( *this, nIdxPos );
  | ^~~
sw/source/core/docnode/ndtbl.cxx:301:17: note: ‘’ declared here

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

diff --git a/sw/inc/ndindex.hxx b/sw/inc/ndindex.hxx
index 474bc82f452d..d97c58947d0c 100644
--- a/sw/inc/ndindex.hxx
+++ b/sw/inc/ndindex.hxx
@@ -34,7 +34,16 @@ class SW_DLLPUBLIC SwNodeIndex final : public 
sw::Ring
 void RegisterIndex( SwNodes& rNodes )
 {
 if(!rNodes.m_vIndices)
+{
+#if defined(__GNUC__) && __GNUC__ == 12
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdangling-pointer"
+#endif
 rNodes.m_vIndices = this;
+#if defined(__GNUC__) && __GNUC__ == 12
+#pragma GCC diagnostic pop
+#endif
+}
 MoveTo(rNodes.m_vIndices);
 }
 void DeRegisterIndex( SwNodes& rNodes )


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

2022-05-23 Thread Michael Stahl (via logerrit)
 starmath/source/mathml/iterator.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 32c43ee75c094ffe3c34f7a713aa252479515ad0
Author: Michael Stahl 
AuthorDate: Sun May 22 14:50:55 2022 +0200
Commit: Michael Stahl 
CommitDate: Mon May 23 10:48:56 2022 +0200

starmath: fix real use-after-free detected by GCC 12

In file included from starmath/inc/mathml/iterator.hxx:12,
 from starmath/source/mathml/iterator.cxx:10:
In member function ‘SmMlElement* SmMlElement::getParentElement()’,
inlined from ‘void mathml::SmMlIteratorBottomToTop(SmMlElement*, 
runType, void*) [with runType = void (*)(SmMlElement*, void*)]’ at 
starmath/inc/mathml/iterator.hxx:43:39,
inlined from ‘void mathml::SmMlIteratorFree(SmMlElement*)’ at 
starmath/source/mathml/iterator.cxx:57:28:
starmath/inc/mathml/element.hxx:263:46: error: pointer ‘pCurrent’ used 
after ‘void operator delete(void*, std::size_t)’ [-Werror=use-after-free]
  263 | SmMlElement* getParentElement() { return m_aParentElement; };
  |  ^~~~
In function ‘void mathml::deleteElement(SmMlElement*, void*)’,
inlined from ‘void mathml::deleteElement(SmMlElement*, void*)’ at 
starmath/source/mathml/iterator.cxx:19:20,
inlined from ‘void mathml::SmMlIteratorBottomToTop(SmMlElement*, 
runType, void*) [with runType = void (*)(SmMlElement*, void*)]’ at 
starmath/inc/mathml/iterator.hxx:65:21,
inlined from ‘void mathml::SmMlIteratorFree(SmMlElement*)’ at 
starmath/source/mathml/iterator.cxx:57:28:
starmath/source/mathml/iterator.cxx:19:77: note: call to ‘void operator 
delete(void*, std::size_t)’ here
   19 | static inline void deleteElement(SmMlElement* aSmMlElement, void*) 
{ delete aSmMlElement; }
  | 
^~~~

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

diff --git a/starmath/source/mathml/iterator.cxx 
b/starmath/source/mathml/iterator.cxx
index cfa9a0b78865..24de35c18323 100644
--- a/starmath/source/mathml/iterator.cxx
+++ b/starmath/source/mathml/iterator.cxx
@@ -54,7 +54,11 @@ void SmMlIteratorFree(SmMlElement* pMlElementTree)
 {
 if (pMlElementTree == nullptr)
 return;
-SmMlIteratorBottomToTop(pMlElementTree, deleteElement, nullptr);
+for (size_t i = 0; i < pMlElementTree->getSubElementsCount(); ++i)
+{
+SmMlIteratorFree(pMlElementTree->getSubElement(i));
+}
+deleteElement(pMlElementTree, nullptr);
 }
 
 SmMlElement* SmMlIteratorCopy(SmMlElement* pMlElementTree)


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

2022-05-23 Thread Noel Grandin (via logerrit)
 configmgr/source/access.cxx|5 +++--
 configmgr/source/access.hxx|2 +-
 configmgr/source/broadcaster.cxx   |   17 +
 configmgr/source/broadcaster.hxx   |8 
 configmgr/source/childaccess.cxx   |5 +++--
 configmgr/source/childaccess.hxx   |2 +-
 configmgr/source/components.cxx|   13 +++--
 configmgr/source/configurationprovider.cxx |5 +++--
 configmgr/source/configurationregistry.cxx |5 +++--
 configmgr/source/groupnode.cxx |5 +++--
 configmgr/source/groupnode.hxx |2 +-
 configmgr/source/localizedvaluenode.cxx|5 +++--
 configmgr/source/localizedvaluenode.hxx|2 +-
 configmgr/source/propertynode.cxx  |5 +++--
 configmgr/source/propertynode.hxx  |2 +-
 configmgr/source/readonlyaccess.cxx|5 +++--
 configmgr/source/readwriteaccess.cxx   |5 +++--
 configmgr/source/rootaccess.cxx|9 +
 configmgr/source/rootaccess.hxx|4 ++--
 configmgr/source/setnode.cxx   |9 +
 configmgr/source/setnode.hxx   |4 ++--
 configmgr/source/xcsparser.hxx |7 ---
 configmgr/source/xcuparser.hxx |9 +
 23 files changed, 75 insertions(+), 60 deletions(-)

New commits:
commit be9a39488420b069ed5c7fd65347b2ff68883e62
Author: Noel Grandin 
AuthorDate: Mon May 23 09:01:36 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 10:52:11 2022 +0200

clang-tidy modernize-pass-by-value in configmgr

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

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 86e6bdb72772..865d383002d3 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -1924,8 +1925,8 @@ Access::ModifiedChild::ModifiedChild():
 {}
 
 Access::ModifiedChild::ModifiedChild(
-rtl::Reference< ChildAccess > const & theChild, bool theDirectlyModified):
-child(theChild), directlyModified(theDirectlyModified)
+rtl::Reference< ChildAccess > theChild, bool theDirectlyModified):
+child(std::move(theChild)), directlyModified(theDirectlyModified)
 {}
 
 rtl::Reference< ChildAccess > Access::getModifiedChild(
diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx
index 811c63693835..51e43d5bcfcc 100644
--- a/configmgr/source/access.hxx
+++ b/configmgr/source/access.hxx
@@ -354,7 +354,7 @@ private:
 ModifiedChild();
 
 ModifiedChild(
-rtl::Reference< ChildAccess > const & theChild,
+rtl::Reference< ChildAccess > theChild,
 bool theDirectlyModified);
 };
 
diff --git a/configmgr/source/broadcaster.cxx b/configmgr/source/broadcaster.cxx
index 24b047e9d5a4..f1830ee81b13 100644
--- a/configmgr/source/broadcaster.cxx
+++ b/configmgr/source/broadcaster.cxx
@@ -35,6 +35,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "broadcaster.hxx"
 
@@ -183,8 +184,8 @@ void Broadcaster::send() {
 
 Broadcaster::DisposeNotification::DisposeNotification(
 css::uno::Reference< css::lang::XEventListener > const & theListener,
-css::lang::EventObject const & theEvent):
-listener(theListener), event(theEvent)
+css::lang::EventObject  theEvent):
+listener(theListener), event(std::move(theEvent))
 {
 assert(theListener.is());
 }
@@ -192,8 +193,8 @@ Broadcaster::DisposeNotification::DisposeNotification(
 Broadcaster::ContainerNotification::ContainerNotification(
 css::uno::Reference< css::container::XContainerListener > const &
 theListener,
-css::container::ContainerEvent const & theEvent):
-listener(theListener), event(theEvent)
+css::container::ContainerEvent  theEvent):
+listener(theListener), event(std::move(theEvent))
 {
 assert(theListener.is());
 }
@@ -201,8 +202,8 @@ Broadcaster::ContainerNotification::ContainerNotification(
 Broadcaster::PropertyChangeNotification::PropertyChangeNotification(
 css::uno::Reference< css::beans::XPropertyChangeListener > const &
 theListener,
-css::beans::PropertyChangeEvent const & theEvent):
-listener(theListener), event(theEvent)
+css::beans::PropertyChangeEvent  theEvent):
+listener(theListener), event(std::move(theEvent))
 {
 assert(theListener.is());
 }
@@ -218,8 +219,8 @@ 
Broadcaster::PropertiesChangeNotification::PropertiesChangeNotification(
 
 Broadcaster::ChangesNotification::ChangesNotification(
 css::uno::Reference< css::util::XChangesListener > const & theListener,
-css::util::ChangesEvent const & theEvent):
-listener(theListener), event(theEvent)
+css::util::ChangesEvent  theEvent):
+listener(theListener), event(std::

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

2022-05-23 Thread Michael Stahl (via logerrit)
 sw/source/core/crsr/crbm.cxx |   15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 4d3b750d08d05c475fb38f8b3961696d9cc9882f
Author: Michael Stahl 
AuthorDate: Fri May 20 15:46:20 2022 +0200
Commit: Michael Stahl 
CommitDate: Mon May 23 10:52:57 2022 +0200

sw_redlinehide: fix crash in IsMarkHidden() if pointing to table node

This is called during mail merge from documentStartPageNumber()
and if the document starts with a table, the passed UNO mark will point
to SwTableNode.

(regression from commit 943d9be770e550d20ca72274fa5e914d1f61e605)

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

diff --git a/sw/source/core/crsr/crbm.cxx b/sw/source/core/crsr/crbm.cxx
index 9e2027a2ceba..02f554014568 100644
--- a/sw/source/core/crsr/crbm.cxx
+++ b/sw/source/core/crsr/crbm.cxx
@@ -128,9 +128,14 @@ bool IsMarkHidden(SwRootFrame const& rLayout, 
::sw::mark::IMark const& rMark)
 {
 return false;
 }
-SwTextNode const& rNode(*rMark.GetMarkPos().nNode.GetNode().GetTextNode());
+SwNode const& rNode(rMark.GetMarkPos().nNode.GetNode());
+SwTextNode const*const pTextNode(rNode.GetTextNode());
+if (pTextNode == nullptr)
+{   // UNO_BOOKMARK may point to table node
+return rNode.GetRedlineMergeFlag() == SwNode::Merge::Hidden;
+}
 SwTextFrame const*const pFrame(static_cast(
-rNode.getLayoutFrame(&rLayout)));
+pTextNode->getLayoutFrame(&rLayout)));
 if (!pFrame)
 {
 return true;
@@ -145,14 +150,14 @@ bool IsMarkHidden(SwRootFrame const& rLayout, 
::sw::mark::IMark const& rMark)
 }
 else
 {
-if (rMark.GetMarkPos().nContent.GetIndex() == rNode.Len())
+if (rMark.GetMarkPos().nContent.GetIndex() == pTextNode->Len())
 {   // at end of node: never deleted (except if node deleted)
-return rNode.GetRedlineMergeFlag() == SwNode::Merge::Hidden;
+return pTextNode->GetRedlineMergeFlag() == SwNode::Merge::Hidden;
 }
 else
 {   // check character following mark pos
 return pFrame->MapModelToViewPos(rMark.GetMarkPos())
-== pFrame->MapModelToView(&rNode, 
rMark.GetMarkPos().nContent.GetIndex() + 1);
+== pFrame->MapModelToView(pTextNode, 
rMark.GetMarkPos().nContent.GetIndex() + 1);
 }
 }
 }


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

2022-05-23 Thread Michael Stahl (via logerrit)
 sw/source/core/frmedt/fecopy.cxx |   13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

New commits:
commit 1b8c42f8b007d690a85676f260b28b44639fc79a
Author: Michael Stahl 
AuthorDate: Fri May 20 16:01:57 2022 +0200
Commit: Michael Stahl 
CommitDate: Mon May 23 10:53:20 2022 +0200

sw: avoid ~SwIndexReg() assert in SwFEShell::PastePages()

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

diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 6e28597024c9..f1db6d946f45 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1133,7 +1133,7 @@ void SwFEShell::PastePages( SwFEShell& rToFill, 
sal_uInt16 nStartPage, sal_uInt1
 return;
 }
 MovePage( GetThisFrame, GetFirstSub );
-SwPaM aCpyPam( *GetCursor()->GetPoint() );
+::std::optional oSourcePam( *GetCursor()->GetPoint() );
 OUString sStartingPageDesc = GetPageDesc( GetCurPageDesc()).GetName();
 SwPageDesc* pDesc = rToFill.FindPageDescByName( sStartingPageDesc, true );
 if( pDesc )
@@ -1145,7 +1145,7 @@ void SwFEShell::PastePages( SwFEShell& rToFill, 
sal_uInt16 nStartPage, sal_uInt1
 return;
 }
 //if the page starts with a table a paragraph has to be inserted before
-SwNode* pTableNode = aCpyPam.GetNode().FindTableNode();
+SwNode *const pTableNode = oSourcePam->GetNode().FindTableNode();
 if(pTableNode)
 {
 //insert a paragraph
@@ -1155,22 +1155,23 @@ void SwFEShell::PastePages( SwFEShell& rToFill, 
sal_uInt16 nStartPage, sal_uInt1
 if(GetDoc()->getIDocumentContentOperations().AppendTextNode( aBefore ))
 {
 SwPaM aTmp(aBefore);
-aCpyPam = aTmp;
+*oSourcePam = aTmp;
 }
 EndUndo(SwUndoId::INSERT);
 }
 
 MovePage( GetThisFrame, GetLastSub );
-aCpyPam.SetMark();
-*aCpyPam.GetMark() = *GetCursor()->GetPoint();
+oSourcePam->SetMark();
+*oSourcePam->GetMark() = *GetCursor()->GetPoint();
 
 CurrShell aCurr( this );
 
 StartAllAction();
 GetDoc()->getIDocumentFieldsAccess().LockExpFields();
-SetSelection(aCpyPam);
+SetSelection(*oSourcePam);
 // copy the text of the selection
 SwEditShell::Copy(rToFill);
+oSourcePam.reset(); // delete it because Undo will remove its node!
 
 if(pTableNode)
 {


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

2022-05-23 Thread Michael Stahl (via logerrit)
 sw/qa/extras/mailmerge/data/grabbagtest.docx |binary
 sw/qa/extras/mailmerge/data/onecell.xlsx |binary
 sw/qa/extras/mailmerge/mailmerge.cxx |   92 +++
 sw/source/core/doc/docnew.cxx|9 ++
 sw/source/ui/dbui/mmresultdialogs.cxx|8 ++
 writerfilter/source/dmapper/DomainMapper.cxx |2 
 6 files changed, 98 insertions(+), 13 deletions(-)

New commits:
commit 123d3a9301c90925c23cfb4806d7b0be01b975d6
Author: Michael Stahl 
AuthorDate: Fri May 20 20:56:56 2022 +0200
Commit: Michael Stahl 
CommitDate: Mon May 23 10:54:16 2022 +0200

sw: copy grab bags in mail merge

Otherwise formatting may get lost when the result is stored as DOCX.

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

diff --git a/sw/qa/extras/mailmerge/data/grabbagtest.docx 
b/sw/qa/extras/mailmerge/data/grabbagtest.docx
new file mode 100644
index ..4b40f1fb4e94
Binary files /dev/null and b/sw/qa/extras/mailmerge/data/grabbagtest.docx differ
diff --git a/sw/qa/extras/mailmerge/data/onecell.xlsx 
b/sw/qa/extras/mailmerge/data/onecell.xlsx
new file mode 100644
index ..972f6b3c5fc5
Binary files /dev/null and b/sw/qa/extras/mailmerge/data/onecell.xlsx differ
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx 
b/sw/qa/extras/mailmerge/mailmerge.cxx
index 53678a1caf94..c5b0a6cb16b8 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -16,7 +16,9 @@
 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -76,7 +78,7 @@ public:
  * calling executeMailMerge() after modifying the job arguments.
  */
 void executeMailMergeTest( const char* filename, const char* datasource, 
const char* tablename,
-   bool file, int selection, const char* column )
+   char const*const filter, int selection, const 
char* column )
 {
 maMMtestFilename = filename;
 header();
@@ -88,7 +90,7 @@ public:
 const OUString aURI( m_directories.getURLFromSrc(mpTestDocumentPath) + 
OUString::createFromAscii(datasource) );
 const OUString aPrefix = column ? OUString::createFromAscii( column ) 
: "LOMM_";
 const OUString aDBName = registerDBsource( aURI, aWorkDir );
-initMailMergeJobAndArgs( filename, tablename, aDBName, aPrefix, 
aWorkDir, file, selection, column != nullptr );
+initMailMergeJobAndArgs( filename, tablename, aDBName, aPrefix, 
aWorkDir, filter, selection, column != nullptr );
 
 verify();
 finish();
@@ -137,7 +139,8 @@ public:
 }
 
 void initMailMergeJobAndArgs( const char* filename, const char* tablename, 
const OUString &aDBName,
-  const OUString &aPrefix, const OUString 
&aWorkDir, bool file, int nDataSets,
+  const OUString &aPrefix, const OUString 
&aWorkDir,
+  char const*const filter, int nDataSets,
   const bool bPrefixIsColumn )
 {
 uno::Reference< task::XJob > xJob( 
getMultiServiceFactory()->createInstance( "com.sun.star.text.MailMerge" ), 
uno::UNO_QUERY_THROW );
@@ -145,13 +148,16 @@ public:
 
 mMMargs.reserve( 15 );
 
-mMMargs.emplace_back( UNO_NAME_OUTPUT_TYPE, uno::Any( file ? 
text::MailMergeType::FILE : text::MailMergeType::SHELL ) );
+mMMargs.emplace_back( UNO_NAME_OUTPUT_TYPE, uno::Any( filter ? 
text::MailMergeType::FILE : text::MailMergeType::SHELL ) );
 mMMargs.emplace_back( UNO_NAME_DOCUMENT_URL, uno::Any(
  ( OUString( 
m_directories.getURLFromSrc(mpTestDocumentPath) + 
OUString::createFromAscii(filename)) ) ) );
 mMMargs.emplace_back( UNO_NAME_DATA_SOURCE_NAME, uno::Any( aDBName ) );
 mMMargs.emplace_back( UNO_NAME_OUTPUT_URL, uno::Any( aWorkDir ) );
-if (file)
+if (filter)
+{
 mMMargs.emplace_back( UNO_NAME_FILE_NAME_PREFIX, uno::Any( aPrefix 
) );
+mMMargs.emplace_back(UNO_NAME_SAVE_FILTER, 
uno::Any(OUString::createFromAscii(filter)));
+}
 
 if (bPrefixIsColumn)
 mMMargs.emplace_back( UNO_NAME_FILE_NAME_FROM_COLUMN, uno::Any( 
true ) );
@@ -255,7 +261,7 @@ public:
 /**
  Loads number-th document from mail merge. Requires file output from mail 
merge.
 */
-void loadMailMergeDocument( int number )
+void loadMailMergeDocument(int number, char const*const ext = ".odt")
 {
 OUString name;
 if (!msMailMergeOutputPrefix.isEmpty())
@@ -267,7 +273,7 @@ public:
 aURLObj.SetSmartURL( msMailMergeDocumentURL );
 name = aURLObj.GetBase();
 }
-name += OUString::number( number ) + ".odt";
+name += OUString::n

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

2022-05-23 Thread Stephan Bergmann (via logerrit)
 binaryurp/source/bridge.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 6974647815a4bebf57136be9d7cb28d4137e96b3
Author: Stephan Bergmann 
AuthorDate: Mon May 23 08:36:49 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 23 10:55:45 2022 +0200

cid#1504543 Silence unhelpful, aggressive UNINIT_CTOR

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

diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx
index db6866ec1641..7d73d6dd7b00 100644
--- a/binaryurp/source/bridge.cxx
+++ b/binaryurp/source/bridge.cxx
@@ -202,6 +202,7 @@ Bridge::Bridge(
 throw css::uno::RuntimeException("URP: no C++ UNO mapping");
 }
 passive_.set();
+// coverity[uninit_member] - random_ is set in due course by the reader_ 
thread's state machine
 }
 
 void Bridge::start() {


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

2022-05-23 Thread Miklos Vajna (via logerrit)
 sw/qa/extras/htmlexport/htmlexport.cxx  |   34 +
 sw/source/filter/html/htmlflywriter.cxx |   50 
 2 files changed, 78 insertions(+), 6 deletions(-)

New commits:
commit 961c0da0503c94f5a86c962acd4932ffa8967db1
Author: Miklos Vajna 
AuthorDate: Tue May 17 16:11:25 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 23 10:58:13 2022 +0200

sw HTML export: avoid pixel height when height is scale and width is 
relative

Commit b17180a84cb4561b8a7bbf9e2281c91fffd56f87 (write out image size in
html export for 'keep ratio' images, 2021-06-29) changed the sw HTML
export to write the layout size of images in case one dimension is "keep
ratio" and the other is some more concrete value.

This is useful in case that other dimension is a fixed value, because
"keep ratio" on the UI only means to keep the ratio as the size changes,
it does not mean that the ratio will be the original ratio of the
bitmap. However, it's problematic to write this layout size of the "keep
ratio" dimension when the other dimension is relative, as this will mean
the image's aspect ratio will change if the user resizes the browser
window.

Fix the problem by extending the way we write the "height" and "width"
of fly frames:

1) Write a percentage in case of relative sizes

2) Write an explicit "auto" (or just omit the attribute in XHTML mode)
   in case the size is "keep ratio" and the other dimension is a
   relative size

3) Write the layout size in other cases (fixed size or "keep ratio", but
   the other dimension is a fixed size)

Note that HTML itself has no concept of relative sizes where 100% is not
the parent's size (e.g. page, not paragraph) and also has no concept of
keeping an aspect ratio which is not the aspect ratio of the bitmap, so
those cases remain unchanged.

Change-Id: Ic5c7dc4d697160eff81e960a2f7d335fb78ab7c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134482
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
(cherry picked from commit 9e3eee88338c45424b24040f731083f9f59cfbe2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134450
Reviewed-by: Xisco Fauli 
(cherry picked from commit 4bced2b78b3e22730c12d9729f5633ae1a3a35c8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134754
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx 
b/sw/qa/extras/htmlexport/htmlexport.cxx
index 3ee58613903a..997537012bb8 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -2200,6 +2200,40 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, 
testTableBackground)
 assertXPathNoAttribute(pXmlDoc, 
"//reqif-xhtml:table[2]/reqif-xhtml:tr[1]", "bgcolor");
 }
 
+CPPUNIT_TEST_FIXTURE(HtmlExportTest, testImageKeepRatio)
+{
+// Given a document with an image: width is relative, height is "keep 
ratio":
+createSwDoc();
+uno::Reference xFactory(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xTextGraphic(
+xFactory->createInstance("com.sun.star.text.TextGraphicObject"), 
uno::UNO_QUERY);
+xTextGraphic->setPropertyValue("AnchorType",
+   
uno::Any(text::TextContentAnchorType_AS_CHARACTER));
+xTextGraphic->setPropertyValue("RelativeWidth", 
uno::Any(static_cast(42)));
+xTextGraphic->setPropertyValue("IsSyncHeightToWidth", uno::Any(true));
+uno::Reference xTextDocument(mxComponent, 
uno::UNO_QUERY);
+uno::Reference xBodyText = xTextDocument->getText();
+uno::Reference xCursor(xBodyText->createTextCursor());
+uno::Reference xTextContent(xTextGraphic, 
uno::UNO_QUERY);
+xBodyText->insertTextContent(xCursor, xTextContent, false);
+
+// When exporting to HTML:
+uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
+uno::Sequence aStoreProperties = {
+comphelper::makePropertyValue("FilterName", OUString("HTML 
(StarWriter)")),
+};
+xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties);
+
+// Then make sure that the width is not a fixed size, that would break on 
resizing the browser
+// window:
+htmlDocUniquePtr pDoc = parseHtml(maTempFile);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected: auto
+// - Actual  : 2
+// i.e. a static (CSS pixel) height was written.
+assertXPath(pDoc, "/html/body/p/img", "height", "auto");
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/html/htmlflywriter.cxx 
b/sw/source/filter/html/htmlflywriter.cxx
index 2aee659fc6e8..5eff1441760f 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -987,22 +987,60 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& 
aHtml, const SwFrameForma
 (

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

2022-05-23 Thread Tibor Nagy (via logerrit)
 oox/source/export/shapes.cxx   |4 ++--
 sd/qa/unit/data/odp/tdf66228.odp   |binary
 sd/qa/unit/export-tests-ooxml1.cxx |   15 +++
 3 files changed, 17 insertions(+), 2 deletions(-)

New commits:
commit f4efaf455136c3a0db8dfd3f1afc0db827192147
Author: Tibor Nagy 
AuthorDate: Fri May 13 14:09:35 2022 +0200
Commit: László Németh 
CommitDate: Mon May 23 10:59:10 2022 +0200

tdf#66228 PPTX export: fix lost U-shaped connectors

which were replaced with straight connector lines.

The "Line Connector" has no equivalent in OOXML. So far it has
been saved as a "Straight connector". In most cases, the better
solution is to change it to "Standard connector", keeping
the original layout with U-shaped connectors.

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

diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index ed129784ba51..284daea2db21 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -1662,12 +1662,12 @@ ShapeExport& ShapeExport::WriteConnectorShape( const 
Reference< XShape >& xShape
 case ConnectorType_CURVE:
 sGeometry = "curvedConnector";
 break;
+case ConnectorType_LINES:
 case ConnectorType_STANDARD:
 sGeometry = "bentConnector";
 break;
 default:
 case ConnectorType_LINE:
-case ConnectorType_LINES:
 sGeometry = "straightConnector1";
 break;
 }
@@ -1692,7 +1692,7 @@ ShapeExport& ShapeExport::WriteConnectorShape( const 
Reference< XShape >& xShape
 }
 EscherConnectorListEntry aConnectorEntry( xShape, aStartPoint, rXShapeA, 
aEndPoint, rXShapeB );
 
-if (eConnectorType == ConnectorType_CURVE || eConnectorType == 
ConnectorType_STANDARD)
+if (eConnectorType != ConnectorType_LINE)
 {
 tools::PolyPolygon aPolyPolygon = 
EscherPropertyContainer::GetPolyPolygon(xShape);
 if (aPolyPolygon.Count() > 0)
diff --git a/sd/qa/unit/data/odp/tdf66228.odp b/sd/qa/unit/data/odp/tdf66228.odp
new file mode 100644
index ..a34c6fc65270
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf66228.odp differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx 
b/sd/qa/unit/export-tests-ooxml1.cxx
index a1dac4fbf63c..70c64d793084 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -48,6 +48,7 @@ using namespace css;
 class SdOOXMLExportTest1 : public SdModelTestBaseXML
 {
 public:
+void testTdf66228();
 void testTdf147919();
 void testTdf130165();
 void testTdf124781();
@@ -118,6 +119,7 @@ public:
 
 CPPUNIT_TEST_SUITE(SdOOXMLExportTest1);
 
+CPPUNIT_TEST(testTdf66228);
 CPPUNIT_TEST(testTdf147919);
 CPPUNIT_TEST(testTdf130165);
 CPPUNIT_TEST(testTdf124781);
@@ -215,6 +217,19 @@ void checkFontAttributes( const SdrTextObj* pObj, 
ItemValue nVal, sal_uInt32 nId
 
 }
 
+void SdOOXMLExportTest1::testTdf66228()
+{
+sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/odp/tdf66228.odp"), ODP);
+utl::TempFile tempFile;
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile);
+xDocShRef->DoClose();
+
+xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml");
+assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:cxnSp/p:spPr/a:prstGeom", 
"prst",
+"bentConnector3");
+}
+
 void SdOOXMLExportTest1::testTdf147919()
 {
 sd::DrawDocShellRef xDocShRef


[Libreoffice-commits] core.git: include/jvmaccess jvmaccess/source

2022-05-23 Thread Noel Grandin (via logerrit)
 include/jvmaccess/unovirtualmachine.hxx |3 +--
 include/jvmaccess/virtualmachine.hxx|2 +-
 jvmaccess/source/unovirtualmachine.cxx  |5 +++--
 jvmaccess/source/virtualmachine.cxx |5 +++--
 4 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 0c17712465b07e8a7ebe078b00123965b112f0ac
Author: Noel Grandin 
AuthorDate: Mon May 23 10:03:30 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 11:46:13 2022 +0200

clang-tidy modernize-pass-by-value in jvmaccess

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

diff --git a/include/jvmaccess/unovirtualmachine.hxx 
b/include/jvmaccess/unovirtualmachine.hxx
index f3e34e641d6b..1b424dba9c6a 100644
--- a/include/jvmaccess/unovirtualmachine.hxx
+++ b/include/jvmaccess/unovirtualmachine.hxx
@@ -64,8 +64,7 @@ public:
 @exception CreationException
 Thrown in case creation fails (due to a JNI problem).
  */
-UnoVirtualMachine(rtl::Reference const& 
virtualMachine,
-  void* classLoader);
+UnoVirtualMachine(rtl::Reference 
virtualMachine, void* classLoader);
 
 /** Get the Java virtual machine wrapper.
 
diff --git a/include/jvmaccess/virtualmachine.hxx 
b/include/jvmaccess/virtualmachine.hxx
index b4edf4de98d9..e1286e70017f 100644
--- a/include/jvmaccess/virtualmachine.hxx
+++ b/include/jvmaccess/virtualmachine.hxx
@@ -73,7 +73,7 @@ public:
 @exception CreationException
 Thrown in case attaching fails (due to a JNI problem).
  */
-explicit AttachGuard(rtl::Reference const& rMachine);
+explicit AttachGuard(rtl::Reference xMachine);
 
 /** Detach the current thread from the virtual machine again.
  */
diff --git a/jvmaccess/source/unovirtualmachine.cxx 
b/jvmaccess/source/unovirtualmachine.cxx
index 5387497326d4..08bfbcdcfe5e 100644
--- a/jvmaccess/source/unovirtualmachine.cxx
+++ b/jvmaccess/source/unovirtualmachine.cxx
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -40,9 +41,9 @@ UnoVirtualMachine::CreationException::operator 
=(CreationException const &) {
 }
 
 UnoVirtualMachine::UnoVirtualMachine(
-rtl::Reference< jvmaccess::VirtualMachine > const & virtualMachine,
+rtl::Reference< jvmaccess::VirtualMachine > virtualMachine,
 void * classLoader):
-m_virtualMachine(virtualMachine),
+m_virtualMachine(std::move(virtualMachine)),
 m_classLoader(nullptr)
 {
 try {
diff --git a/jvmaccess/source/virtualmachine.cxx 
b/jvmaccess/source/virtualmachine.cxx
index c37d555f23ca..eb4b8069cad7 100644
--- a/jvmaccess/source/virtualmachine.cxx
+++ b/jvmaccess/source/virtualmachine.cxx
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 
 using jvmaccess::VirtualMachine;
 
@@ -41,8 +42,8 @@ VirtualMachine::AttachGuard::CreationException::operator =(
 }
 
 VirtualMachine::AttachGuard::AttachGuard(
-rtl::Reference< VirtualMachine > const & rMachine):
-m_xMachine(rMachine)
+rtl::Reference< VirtualMachine > xMachine):
+m_xMachine(std::move(xMachine))
 {
 assert(m_xMachine.is());
 m_pEnvironment = m_xMachine->attachThread(&m_bDetach);


[Libreoffice-commits] core.git: chart2/source solenv/clang-format

2022-05-23 Thread Noel Grandin (via logerrit)
 chart2/source/inc/Title.hxx |4 -
 chart2/source/model/main/Title.cxx  |2 
 chart2/source/tools/TitleHelper.cxx |  104 
 solenv/clang-format/excludelist |2 
 4 files changed, 52 insertions(+), 60 deletions(-)

New commits:
commit 8d00d5f36454e202586df4e2dafb12c7195b7a1f
Author: Noel Grandin 
AuthorDate: Sun May 22 20:19:31 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 11:58:54 2022 +0200

instantiate Title directly in chart

which simplifies some code

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

diff --git a/chart2/source/model/main/Title.hxx b/chart2/source/inc/Title.hxx
similarity index 98%
rename from chart2/source/model/main/Title.hxx
rename to chart2/source/inc/Title.hxx
index 426fd5ef4219..091c558dba44 100644
--- a/chart2/source/model/main/Title.hxx
+++ b/chart2/source/inc/Title.hxx
@@ -18,14 +18,14 @@
  */
 #pragma once
 
-#include 
+#include "OPropertySet.hxx"
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
+#include "ModifyListenerHelper.hxx"
 
 namespace chart
 {
diff --git a/chart2/source/model/main/Title.cxx 
b/chart2/source/model/main/Title.cxx
index ab32d7a306e6..98004e30a2d4 100644
--- a/chart2/source/model/main/Title.cxx
+++ b/chart2/source/model/main/Title.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include "Title.hxx"
+#include 
 #include 
 #include 
 #include 
diff --git a/chart2/source/tools/TitleHelper.cxx 
b/chart2/source/tools/TitleHelper.cxx
index ece3ec239d1b..943adace7913 100644
--- a/chart2/source/tools/TitleHelper.cxx
+++ b/chart2/source/tools/TitleHelper.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -197,7 +198,7 @@ uno::Reference< XTitle > TitleHelper::createTitle(
 , const uno::Reference< uno::XComponentContext > & xContext
 , ReferenceSizeProvider * pRefSizeProvider )
 {
-uno::Reference< XTitle > xTitle;
+rtl::Reference< ::chart::Title > xTitle;
 uno::Reference< XTitled > xTitled( lcl_getTitleParent( eTitleType, xModel 
) );
 
 if( !xTitled.is() )
@@ -226,71 +227,62 @@ uno::Reference< XTitle > TitleHelper::createTitle(
 {
 rtl::Reference< Diagram > xDiagram( ChartModelHelper::findDiagram( 
xModel ) );
 
-xTitle.set( xContext->getServiceManager()->createInstanceWithContext(
-"com.sun.star.chart2.Title",
-xContext ), uno::UNO_QUERY );
+xTitle = new ::chart::Title();
 
-if(xTitle.is())
+// default char height (main: 13.0 == default)
+float fDefaultCharHeightSub = 11.0;
+float fDefaultCharHeightAxis = 9.0;
+switch( eTitleType )
 {
-// default char height (main: 13.0 == default)
-float fDefaultCharHeightSub = 11.0;
-float fDefaultCharHeightAxis = 9.0;
-switch( eTitleType )
-{
-case TitleHelper::SUB_TITLE:
-TitleHelper::setCompleteString(
-rTitleText, xTitle, xContext, & fDefaultCharHeightSub 
);
-break;
-case TitleHelper::X_AXIS_TITLE:
-case TitleHelper::Y_AXIS_TITLE:
-case TitleHelper::Z_AXIS_TITLE:
-case TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION:
-case TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION:
-case TitleHelper::SECONDARY_X_AXIS_TITLE:
-case TitleHelper::SECONDARY_Y_AXIS_TITLE:
-TitleHelper::setCompleteString(
-rTitleText, xTitle, xContext, & fDefaultCharHeightAxis 
);
-break;
-default:
-TitleHelper::setCompleteString( rTitleText, xTitle, 
xContext );
-break;
-}
+case TitleHelper::SUB_TITLE:
+TitleHelper::setCompleteString(
+rTitleText, xTitle, xContext, & fDefaultCharHeightSub );
+break;
+case TitleHelper::X_AXIS_TITLE:
+case TitleHelper::Y_AXIS_TITLE:
+case TitleHelper::Z_AXIS_TITLE:
+case TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION:
+case TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION:
+case TitleHelper::SECONDARY_X_AXIS_TITLE:
+case TitleHelper::SECONDARY_Y_AXIS_TITLE:
+TitleHelper::setCompleteString(
+rTitleText, xTitle, xContext, & fDefaultCharHeightAxis );
+break;
+default:
+TitleHelper::setCompleteString( rTitleText, xTitle, xContext );
+break;
+}
 
-// set/clear autoscale
-if( pRefSizeProvider )
-pRefSize

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

2022-05-23 Thread Stephan Bergmann (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c8d4ae2ad0cfdac770d897e7aca72fbb4a87765f
Author: Stephan Bergmann 
AuthorDate: Mon May 23 10:08:08 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 23 12:00:23 2022 +0200

tdf#149198 Fix use of nullptr

...which would have caused std::abort for non-production debug builds since
4f0c70fb5554325e0cc2129741175bf07de22029 "Avoid calling OString ctor with 
null
pointer", and started to erroneously pass a nullptr argument into a
std::string_view for all kinds of builds with
af16aa625682b649e8843237652b9246d519cbae "Improve loplugin:stringview"

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 40ad41934480..4294f841cbd5 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3136,7 +3136,7 @@ void DocxAttributeOutput::WriteCollectedRunProperties()
 {
 const char* pVal = nullptr;
 m_pColorAttrList->getAsChar(FSNS(XML_w, XML_val), pVal);
-if (std::string_view("auto") != pVal)
+if (pVal != nullptr && std::string_view("auto") != pVal)
 {
 m_pSerializer->startElementNS(XML_w14, XML_textFill);
 m_pSerializer->startElementNS(XML_w14, XML_solidFill);


[Libreoffice-commits] core.git: external/breakpad external/liborcus external/pdfium external/zxing

2022-05-23 Thread Stephan Bergmann (via logerrit)
 external/breakpad/UnpackedTarball_breakpad.mk |1 +
 external/breakpad/include.patch   |   10 ++
 external/liborcus/UnpackedTarball_liborcus.mk |1 +
 external/liborcus/include.patch.0 |   20 
 external/pdfium/UnpackedTarball_pdfium.mk |2 ++
 external/pdfium/include.patch |   11 +++
 external/zxing/UnpackedTarball_zxing.mk   |1 +
 external/zxing/include.patch.0|   10 ++
 8 files changed, 56 insertions(+)

New commits:
commit 1e51a325a8e21eb5f900336a0c9e1bd78ed330ab
Author: Stephan Bergmann 
AuthorDate: Mon May 23 10:21:54 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 23 12:08:30 2022 +0200

Missing #include  in various external code

...which is a problem presumably since GCC 13 trunk


"libstdc++: Avoid including  for std::char_traits".  (All the 
broken
C++ code used unqualified uintptr_t etc. rather than std::uintptr_t etc., 
so I
deemed it more appropriate to include  rather than .)

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

diff --git a/external/breakpad/UnpackedTarball_breakpad.mk 
b/external/breakpad/UnpackedTarball_breakpad.mk
index 9a10a5ac1abb..eca3d550d0d4 100644
--- a/external/breakpad/UnpackedTarball_breakpad.mk
+++ b/external/breakpad/UnpackedTarball_breakpad.mk
@@ -29,6 +29,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,breakpad,\
external/breakpad/breakpad-no-env.patch.1 \
external/breakpad/SIGSTKSZ.patch \
external/breakpad/sanitizer.patch \
+   external/breakpad/include.patch \
 ))
 
 $(eval $(call 
gb_UnpackedTarball_add_files,breakpad,src/tools/windows/dump_syms,\
diff --git a/external/breakpad/include.patch b/external/breakpad/include.patch
new file mode 100644
index ..e90ae9c11744
--- /dev/null
+++ b/external/breakpad/include.patch
@@ -0,0 +1,10 @@
+--- src/client/linux/handler/minidump_descriptor.h
 src/client/linux/handler/minidump_descriptor.h
+@@ -31,6 +31,7 @@
+ #define CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_
+ 
+ #include 
++#include 
+ #include 
+ 
+ #include 
diff --git a/external/liborcus/UnpackedTarball_liborcus.mk 
b/external/liborcus/UnpackedTarball_liborcus.mk
index eaa730255071..2ad70119179b 100644
--- a/external/liborcus/UnpackedTarball_liborcus.mk
+++ b/external/liborcus/UnpackedTarball_liborcus.mk
@@ -38,6 +38,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
external/liborcus/forcepoint-87.patch.1 \
external/liborcus/forcepoint-88.patch.1 \
external/liborcus/forcepoint-95.patch.1 \
+   external/liborcus/include.patch.0 \
 ))
 
 ifeq ($(OS),WNT)
diff --git a/external/liborcus/include.patch.0 
b/external/liborcus/include.patch.0
new file mode 100644
index ..1131d04d3046
--- /dev/null
+++ b/external/liborcus/include.patch.0
@@ -0,0 +1,20 @@
+--- include/orcus/base64.hpp
 include/orcus/base64.hpp
+@@ -9,6 +9,7 @@
+ #define __ORCUS_BASE64_HPP__
+ 
+ #include "env.hpp"
++#include 
+ #include 
+ #include 
+ 
+--- include/orcus/types.hpp
 include/orcus/types.hpp
+@@ -16,6 +16,7 @@
+ #pragma GCC diagnostic ignored "-Wshadow"
+ #endif
+ 
++#include 
+ #include 
+ #include 
+ #include 
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk 
b/external/pdfium/UnpackedTarball_pdfium.mk
index da4a016cf9d8..06b94e4d064d 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -24,6 +24,8 @@ pdfium_patches += AndroidNDK19.patch.1
 # --with-latest-c++:
 pdfium_patches += gcc-c++20-comparison.patch
 
+pdfium_patches += include.patch
+
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,pdfium,$(PDFIUM_TARBALL)))
diff --git a/external/pdfium/include.patch b/external/pdfium/include.patch
new file mode 100644
index ..75c0e3b9272a
--- /dev/null
+++ b/external/pdfium/include.patch
@@ -0,0 +1,11 @@
+--- constants/annotation_flags.h
 constants/annotation_flags.h
+@@ -5,6 +5,8 @@
+ #ifndef CONSTANTS_ANNOTATION_FLAGS_H_
+ #define CONSTANTS_ANNOTATION_FLAGS_H_
+ 
++#include 
++
+ namespace pdfium {
+ namespace annotation_flags {
+ 
diff --git a/external/zxing/UnpackedTarball_zxing.mk 
b/external/zxing/UnpackedTarball_zxing.mk
index ff5f45e71c30..a171c86de7db 100644
--- a/external/zxing/UnpackedTarball_zxing.mk
+++ b/external/zxing/UnpackedTarball_zxing.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,zxing, \
external/zxing/0002-Update-stb_image_write-from-1.14-to-1.16.patch \
external/zxing/0003-Update-stb_image-from-2.25-to-2.27.patch \
external/zxing/0004-Apply-stb-PR-1223-to-stb_image.patch \
+   external/zxing/include.patch.0 \

[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - vcl/unx

2022-05-23 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   45 +
 1 file changed, 45 insertions(+)

New commits:
commit a37577f9fd74c5f84ee7d24adca3755b6f26a55c
Author: Caolán McNamara 
AuthorDate: Sun May 15 16:07:57 2022 +0100
Commit: Michael Stahl 
CommitDate: Mon May 23 12:46:21 2022 +0200

tdf#149068 reject OpenGL versions that don't support glGenVertexArrays

use a throwaway toplevel to figure that out, because if the current
window is used then gtk will always call glGenVertexArrays on it due
to the creation of a GLContext which is the problem we want to avoid.

Change-Id: I40ccc48b5ed2d9fd99d3c242244847c8448c3803
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134350
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit da50382b366d6f3de778d8a52136cd812ef5b751)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134628
Reviewed-by: Michael Stahl 

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index e29a1bfb77f3..4008e98baf0a 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -1960,8 +1960,53 @@ private:
 glViewport(0, 0, width, height);
 }
 
+// Use a throw away toplevel to determine the OpenGL version because once
+// an GdkGLContext is created for a window then it seems that
+// glGenVertexArrays will always be called when the window gets rendered.
+static int GetOpenGLVersion()
+{
+int nMajorGLVersion(0);
+
+GtkWidget* pWindow;
+#if !GTK_CHECK_VERSION(4,0,0)
+pWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+#else
+pWindow = gtk_window_new();
+#endif
+
+gtk_widget_realize(pWindow);
+
+if (GdkSurface* pSurface = widget_get_surface(pWindow))
+{
+if (GdkGLContext* pContext = surface_create_gl_context(pSurface))
+{
+if (gdk_gl_context_realize(pContext, nullptr))
+{
+gdk_gl_context_make_current(pContext);
+gdk_gl_context_get_version(pContext, &nMajorGLVersion, 
nullptr);
+gdk_gl_context_clear_current();
+}
+g_object_unref(pContext);
+}
+}
+
+#if !GTK_CHECK_VERSION(4,0,0)
+gtk_widget_destroy(pWindow);
+#else
+gtk_window_destroy(GTK_WINDOW(pWindow));
+#endif
+return nMajorGLVersion;
+}
+
 virtual bool ImplInit() override
 {
+static int nOpenGLVersion = GetOpenGLVersion();
+if (nOpenGLVersion < 3)
+{
+SAL_WARN("vcl.gtk", "gtk GL requires glGenVertexArrays which is 
OpenGL 3, while system provides: " << nOpenGLVersion);
+return false;
+}
+
 const SystemEnvData* pEnvData = m_pChildWindow->GetSystemData();
 GtkWidget *pParent = static_cast(pEnvData->pWidget);
 m_pGLArea = gtk_gl_area_new();


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

2022-05-23 Thread Ilmari Lauhakangas (via logerrit)
 sysui/desktop/menus/base.desktop|2 +-
 sysui/desktop/menus/calc.desktop|2 +-
 sysui/desktop/menus/draw.desktop|2 +-
 sysui/desktop/menus/impress.desktop |2 +-
 sysui/desktop/menus/math.desktop|2 +-
 sysui/desktop/menus/startcenter.desktop |4 ++--
 sysui/desktop/menus/writer.desktop  |2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 6ed597a7dd1da40248236e7a71843c2d76d6173e
Author: Ilmari Lauhakangas 
AuthorDate: Sat May 21 16:32:26 2022 +0300
Commit: Ilmari Lauhakangas 
CommitDate: Mon May 23 12:57:52 2022 +0200

tdf#140215 Improve the Comment strings in .desktop files

Change-Id: I94bde89ee8cb122ed04f510e25e558240e3029b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134708
Reviewed-by: Heiko Tietze 
Tested-by: Ilmari Lauhakangas 

diff --git a/sysui/desktop/menus/base.desktop b/sysui/desktop/menus/base.desktop
index 36a36ecb6fe5..b2a06b5c4730 100644
--- a/sysui/desktop/menus/base.desktop
+++ b/sysui/desktop/menus/base.desktop
@@ -25,7 +25,7 @@ Exec=${UNIXBASISROOTNAME} --base %%FILE%%
 
MimeType=application/vnd.oasis.opendocument.database;application/vnd.sun.xml.base;
 Name=%PRODUCTNAME Base
 GenericName=Database Development
-Comment=Manage databases, create queries and reports to track and manage your 
information by using Base.
+Comment=Manage databases, create queries and reports to track and manage your 
information
 StartupNotify=true
 X-GIO-NoFuse=true
 Keywords=Data;SQL;
diff --git a/sysui/desktop/menus/calc.desktop b/sysui/desktop/menus/calc.desktop
index 643687946d1a..0575f49e3e09 100644
--- a/sysui/desktop/menus/calc.desktop
+++ b/sysui/desktop/menus/calc.desktop
@@ -25,7 +25,7 @@ Exec=${UNIXBASISROOTNAME} --calc %%FILE%%
 
MimeType=application/vnd.oasis.opendocument.spreadsheet;application/vnd.oasis.opendocument.spreadsheet-template;application/vnd.sun.xml.calc;application/vnd.sun.xml.calc.template;application/msexcel;application/vnd.ms-excel;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.ms-excel.sheet.macroEnabled.12;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.template.macroEnabled.12;application/vnd.ms-excel.sheet.binary.macroEnabled.12;text/csv;application/x-dbf;text/spreadsheet;application/csv;application/excel;application/tab-separated-values;application/vnd.lotus-1-2-3;application/vnd.oasis.opendocument.chart;application/vnd.oasis.opendocument.chart-template;application/x-dbase;application/x-dos_ms_excel;application/x-excel;application/x-msexcel;application/x-ms-excel;application/x-quattropro;application/x-123;text/comma-separated-values;text/tab-separated-values;text/x-comma-separated-values;text/x-csv;applica
 
tion/vnd.oasis.opendocument.spreadsheet-flat-xml;application/vnd.ms-works;application/clarisworks;application/x-iwork-numbers-sffnumbers;application/x-starcalc;
 Name=%PRODUCTNAME Calc
 GenericName=Spreadsheet
-Comment=Perform calculations, analyze information and manage lists in 
spreadsheets by using Calc.
+Comment=Perform calculations, analyze information and manage lists in 
spreadsheets
 StartupNotify=true
 X-GIO-NoFuse=true
 Keywords=Accounting;Stats;OpenDocument Spreadsheet;Chart;Microsoft 
Excel;Microsoft Works;OpenOffice Calc;ods;xls;xlsx;
diff --git a/sysui/desktop/menus/draw.desktop b/sysui/desktop/menus/draw.desktop
index ff9fa53084ed..e5fe6864fda4 100644
--- a/sysui/desktop/menus/draw.desktop
+++ b/sysui/desktop/menus/draw.desktop
@@ -25,7 +25,7 @@ Exec=${UNIXBASISROOTNAME} --draw %%FILE%%
 
MimeType=application/vnd.oasis.opendocument.graphics;application/vnd.oasis.opendocument.graphics-flat-xml;application/vnd.oasis.opendocument.graphics-template;application/vnd.sun.xml.draw;application/vnd.sun.xml.draw.template;application/vnd.visio;application/x-wpg;application/vnd.corel-draw;application/vnd.ms-publisher;image/x-freehand;application/clarisworks;application/x-pagemaker;application/pdf;application/x-stardraw;image/x-emf;image/x-wmf;
 Name=%PRODUCTNAME Draw
 GenericName=Drawing Program
-Comment=Create and edit drawings, flow charts and logos by using Draw.
+Comment=Create and edit drawings, flow charts and logos
 StartupNotify=true
 X-GIO-NoFuse=true
 Keywords=Vector;Schema;Diagram;Layout;OpenDocument Graphics;Microsoft 
Publisher;Microsoft Visio;Corel Draw;cdr;odg;svg;pdf;vsd;
diff --git a/sysui/desktop/menus/impress.desktop 
b/sysui/desktop/menus/impress.desktop
index 0af5e121d371..d2d607d871e0 100644
--- a/sysui/desktop/menus/impress.desktop
+++ b/sysui/desktop/menus/impress.desktop
@@ -25,7 +25,7 @@ Exec=${UNIXBASISROOTNAME} --impress %%FILE%%
 
MimeType=application/vnd.oasis.opendocument.presentation;application/vnd.oasis.opendocument.presentation-template;application/vnd.sun.xml.impress;application/vnd.sun.xml.impress.template;application/mspowerpoint;application/vnd.ms-powerpoint;application/vnd.openxmlformats-officedocument.presentationml.pres

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

2022-05-23 Thread Stephan Bergmann (via logerrit)
 external/python3/darwin.patch.0 |   12 
 1 file changed, 12 insertions(+)

New commits:
commit 2658b93f0b6fd727b53ba2d20faccbf92b1ce8fb
Author: Stephan Bergmann 
AuthorDate: Thu May 6 21:59:02 2021 +0200
Commit: Tor Lillqvist 
CommitDate: Mon May 23 13:14:22 2022 +0200

external/python3: Clang 13 trunk implements --print-multiarch now

...since


"[Driver] Add -print-multiarch", which causes an issue when building
ExternalProject_python3 on macOS:

> checking build system type... x86_64-apple-darwin19.6.0
> checking host system type... x86_64-apple-darwin19.6.0
[...]
> checking for the platform triplet based on compiler characteristics... 
darwin
configure: error: internal configure error for the platform triplet, please 
file a bug report
> make[1]: *** 
[/Users/stephan/Software/lo/core/external/python3/ExternalProject_python3.mk:80:
 /Users/stephan/Software/lo/core/workdir/ExternalProject/python3/build] Error 1

as workdir/UnpackedTarball/python3/configure.ac computes PLATFORM_TRIPLET as
"darwin", and instead of computing MULTIARCH as empty (as `$CC
--print-multiarch` used to just print

> clang: error: unsupported option '--print-multiarch'
> clang: error: no input files

to stderr), it now computes it as e.g. "x86_64-apple-darwin19.6.0" (or 
whatever
-target is explicitly set to in $CC), so the check that they have equal 
values
if they are bot nonempty fails now when building against Clang 13 trunk.  
(This
is not yet an issue with any Apple Clang version, though.)

Until this is eventually fixed upstream at 
,
just keep pretending that `clang --print-multiarch` would cause no stdout 
output
on macOS when determining MULTIARCH.

Change-Id: Ic1b27c6791b327d5709a9d61a6d675c3fa8989bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115219
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134809
Tested-by: Tor Lillqvist 
Reviewed-by: Tor Lillqvist 

diff --git a/external/python3/darwin.patch.0 b/external/python3/darwin.patch.0
index 139cdc9780bb..30d20ed57578 100644
--- a/external/python3/darwin.patch.0
+++ b/external/python3/darwin.patch.0
@@ -8,3 +8,15 @@
  .text
  
  /* ffi_call_unix64 (void *args, unsigned long bytes, unsigned flags,
+--- configure
 configure
+@@ -5167,7 +5167,9 @@
+ fi
+ 
+ 
++if test "$(uname -s)" = Darwin; then MULTIARCH=; else
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
++fi
+ 
+ 
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the platform triplet 
based on compiler characteristics" >&5


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

2022-05-23 Thread Tor Lillqvist (via logerrit)
 connectivity/source/inc/java/tools.hxx |2 ++
 include/vcl/BitmapBuffer.hxx   |2 ++
 xmlsecurity/source/gpg/SecurityEnvironment.hxx |3 +++
 3 files changed, 7 insertions(+)

New commits:
commit 3a43c4c65e0e4531479408882b931f9d92f63d87
Author: Tor Lillqvist 
AuthorDate: Mon May 23 13:16:13 2022 +0300
Commit: Tor Lillqvist 
CommitDate: Mon May 23 13:40:19 2022 +0200

Include  for std::unique_ptr

Change-Id: Ife038559e03ace7ceebe02a95cb89689cd699135
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134810
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Tor Lillqvist 

diff --git a/connectivity/source/inc/java/tools.hxx 
b/connectivity/source/inc/java/tools.hxx
index aa7cb20cad9b..c6024c2a7fb9 100644
--- a/connectivity/source/inc/java/tools.hxx
+++ b/connectivity/source/inc/java/tools.hxx
@@ -20,6 +20,8 @@
 #ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_JAVA_TOOLS_HXX
 #define INCLUDED_CONNECTIVITY_SOURCE_INC_JAVA_TOOLS_HXX
 
+#include 
+
 #include 
 #include 
 
diff --git a/include/vcl/BitmapBuffer.hxx b/include/vcl/BitmapBuffer.hxx
index 4a4ec8404a08..c7516dc52e78 100644
--- a/include/vcl/BitmapBuffer.hxx
+++ b/include/vcl/BitmapBuffer.hxx
@@ -20,6 +20,8 @@
 #ifndef INCLUDED_VCL_BITMAPBUFFER_HXX
 #define INCLUDED_VCL_BITMAPBUFFER_HXX
 
+#include 
+
 #include 
 #include 
 #include 
diff --git a/xmlsecurity/source/gpg/SecurityEnvironment.hxx 
b/xmlsecurity/source/gpg/SecurityEnvironment.hxx
index c815e0e1f5d2..548d76597f56 100644
--- a/xmlsecurity/source/gpg/SecurityEnvironment.hxx
+++ b/xmlsecurity/source/gpg/SecurityEnvironment.hxx
@@ -11,6 +11,9 @@
 #define INCLUDED_XMLSECURITY_SOURCE_GPG_SECURITYENVIRONMENT_HXX
 
 #include 
+
+#include 
+
 #include 
 #include 
 


[Libreoffice-commits] core.git: sal/osl

2022-05-23 Thread Noel Grandin (via logerrit)
 sal/osl/unx/file_impl.hxx |4 ++--
 sal/osl/unx/file_misc.cxx |   14 +-
 sal/osl/unx/file_stat.cxx |6 +++---
 3 files changed, 10 insertions(+), 14 deletions(-)

New commits:
commit d8b60f77f389a248f98aa45592e6e1045baafbe1
Author: Noel Grandin 
AuthorDate: Mon May 23 09:21:19 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 14:32:41 2022 +0200

rtl_String->OString in DirectoryItem_Impl

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

diff --git a/sal/osl/unx/file_impl.hxx b/sal/osl/unx/file_impl.hxx
index 078474cf05ff..a4e0c66adc57 100644
--- a/sal/osl/unx/file_impl.hxx
+++ b/sal/osl/unx/file_impl.hxx
@@ -27,12 +27,12 @@
 
 struct DirectoryItem_Impl
 {
-rtl_String *  m_strFilePath;   /* holds native file name */
+OString   m_strFilePath;   /* holds native file name */
 sal_Int32 m_RefCount;
 unsigned char m_DType;
 
 explicit DirectoryItem_Impl(
-rtl_String * strFilePath, unsigned char DType = 0);
+OString strFilePath, unsigned char DType = 0);
 ~DirectoryItem_Impl();
 
 static void * operator new(size_t n);
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index fee04804ea19..50fdcc040765 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -84,18 +84,14 @@ struct DirectoryImpl
 }
 
 DirectoryItem_Impl::DirectoryItem_Impl(
-rtl_String * strFilePath, unsigned char DType)
-: m_strFilePath (strFilePath),
+OString strFilePath, unsigned char DType)
+: m_strFilePath (std::move(strFilePath)),
   m_RefCount (1),
   m_DType(DType)
 {
-if (m_strFilePath != nullptr)
-rtl_string_acquire(m_strFilePath);
 }
 DirectoryItem_Impl::~DirectoryItem_Impl()
 {
-if (m_strFilePath != nullptr)
-rtl_string_release(m_strFilePath);
 }
 
 void * DirectoryItem_Impl::operator new(size_t n)
@@ -343,9 +339,9 @@ oslFileError SAL_CALL osl_getNextDirectoryItem(oslDirectory 
pDirectory,
 pImpl = nullptr;
 }
 #ifdef _DIRENT_HAVE_D_TYPE
-pImpl = new DirectoryItem_Impl(strFilePath.pData, pEntry->d_type);
+pImpl = new DirectoryItem_Impl(std::move(strFilePath), pEntry->d_type);
 #else
-pImpl = new DirectoryItem_Impl(strFilePath.pData);
+pImpl = new DirectoryItem_Impl(std::move(strFilePath));
 #endif /* _DIRENT_HAVE_D_TYPE */
 *pItem = pImpl;
 
@@ -372,7 +368,7 @@ oslFileError SAL_CALL osl_getDirectoryItem(rtl_uString* 
ustrFileURL, oslDirector
 }
 else
 {
-*pItem = new DirectoryItem_Impl(strSystemPath.pData);
+*pItem = new DirectoryItem_Impl(std::move(strSystemPath));
 }
 
 return osl_error;
diff --git a/sal/osl/unx/file_stat.cxx b/sal/osl/unx/file_stat.cxx
index d08a6ed56894..3b702905cb99 100644
--- a/sal/osl/unx/file_stat.cxx
+++ b/sal/osl/unx/file_stat.cxx
@@ -191,7 +191,7 @@ namespace
 if ((pImpl == nullptr) || (pStat == nullptr))
 return osl_File_E_INVAL;
 
-file_path = OString(pImpl->m_strFilePath);
+file_path = pImpl->m_strFilePath;
 OSL_ASSERT(!file_path.isEmpty());
 if (file_path.isEmpty())
 return osl_File_E_INVAL;
@@ -443,8 +443,8 @@ SAL_CALL osl_identicalDirectoryItem( oslDirectoryItem a, 
oslDirectoryItem b)
 
 struct stat a_stat, b_stat;
 
-if (osl::lstat(OString(pA->m_strFilePath), a_stat) != 0 ||
-osl::lstat(OString(pB->m_strFilePath), b_stat) != 0)
+if (osl::lstat(pA->m_strFilePath, a_stat) != 0 ||
+osl::lstat(pB->m_strFilePath, b_stat) != 0)
 return false;
 
 return (a_stat.st_ino == b_stat.st_ino);


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

2022-05-23 Thread tagezi (via logerrit)
 sc/qa/uitest/calc_tests8/tdf119343.py|7 ++-
 sc/qa/uitest/calc_tests9/tdf142763.py|4 ++--
 sc/qa/uitest/chart/chartGrids.py |8 +++-
 sc/qa/uitest/chart/chartXAxis.py |   12 +---
 sc/qa/uitest/chart/chartYAxis.py |   12 +---
 sc/qa/uitest/chart/tdf93506_trendline.py |   14 ++
 sc/qa/uitest/chart2/tdf124295.py |2 --
 sc/qa/uitest/conditional_format/tdf105466.py |2 +-
 sc/qa/uitest/conditional_format/tdf105544.py |6 +++---
 sc/qa/uitest/conditional_format/tdf81696.py  |9 +++--
 sc/qa/uitest/function_wizard/tdf123479.py|8 ++--
 sc/qa/uitest/hide_cols/tdf95306.py   |5 ++---
 sc/qa/uitest/inputLine/tdf54197.py   |9 -
 sc/qa/uitest/key_f4/f4.py|6 +++---
 sc/qa/uitest/pasteSpecial/tdf74577.py|3 ++-
 sc/qa/uitest/protect/protectSheet.py |7 +++
 sc/qa/uitest/protect/protectSpreadsheet.py   |9 ++---
 sc/qa/uitest/sort/naturalSort.py |9 -
 sc/qa/uitest/sort/sorting.py |9 -
 sc/qa/uitest/sort/stableSorting.py   |7 ++-
 sc/qa/uitest/sort/tdf91305.py|8 
 sc/qa/uitest/sort/tdf99773.py|9 -
 sc/qa/uitest/statistics/anova.py |6 ++
 sc/qa/uitest/statistics/chiSquare.py |6 ++
 sc/qa/uitest/statistics/correlation.py   |6 ++
 sc/qa/uitest/statistics/covariance.py|6 ++
 sc/qa/uitest/statistics/descriptiveStatistics.py |6 ++
 sc/qa/uitest/statistics/exponentialSmoothing.py  |6 ++
 sc/qa/uitest/statistics/movingAverage.py |6 ++
 sc/qa/uitest/statistics/sampling.py  |7 +++
 sc/qa/uitest/statistics/tTest.py |6 ++
 sc/qa/uitest/statistics/tdf76731.py  |7 ++-
 sc/qa/uitest/statistics/zTest.py |6 ++
 33 files changed, 89 insertions(+), 144 deletions(-)

New commits:
commit 30a048cb895a3dcdd6048f3c525edd95a1371b91
Author: tagezi 
AuthorDate: Mon May 16 14:55:48 2022 +0300
Commit: Xisco Fauli 
CommitDate: Mon May 23 14:33:38 2022 +0200

tdf#132293: Removing unused imports from uitests files.

It seems, most of the most imports were copy-pasted from one file
to a new one.
Additionally, the import block and surrounding area made more readable.

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

diff --git a/sc/qa/uitest/calc_tests8/tdf119343.py 
b/sc/qa/uitest/calc_tests8/tdf119343.py
index 51d35a99af93..0debe6aea848 100644
--- a/sc/qa/uitest/calc_tests8/tdf119343.py
+++ b/sc/qa/uitest/calc_tests8/tdf119343.py
@@ -8,15 +8,12 @@
 #
 from uitest.framework import UITestCase
 from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file
-from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_sheet_from_doc
-from libreoffice.calc.conditional_format import 
get_conditional_format_from_sheet
+
 from libreoffice.calc.document import get_cell_by_position
 from libreoffice.uno.propertyvalue import mkPropertyValues
 
-#Bug 119343 - EDITING: copied and pasted cells containing formulas are not 
recalculated (2)
 
+# Bug 119343 - EDITING: copied and pasted cells containing formulas are not 
recalculated (2)
 class tdf119343(UITestCase):
 def test_tdf119343_copy_paste_formula(self):
 #numberingformatpage.ui
diff --git a/sc/qa/uitest/calc_tests9/tdf142763.py 
b/sc/qa/uitest/calc_tests9/tdf142763.py
index e7885063a292..238d30833eb1 100644
--- a/sc/qa/uitest/calc_tests9/tdf142763.py
+++ b/sc/qa/uitest/calc_tests9/tdf142763.py
@@ -8,9 +8,9 @@
 #
 from uitest.framework import UITestCase
 from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, 
select_pos
+
 from libreoffice.uno.propertyvalue import mkPropertyValues
-from libreoffice.calc.document import get_cell_by_position
-import time
+
 
 class Tdf142763(UITestCase):
 
diff --git a/sc/qa/uitest/chart/chartGrids.py b/sc/qa/uitest/chart/chartGrids.py
index 8bff4e58296c..dda37675c4cc 100644
--- a/sc/qa/uitest/chart/chartGrids.py
+++ b/sc/qa/uitest/chart/chartGrids.py
@@ -7,14 +7,12 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 from uitest.framework import UITestCase
-from uitest.uihelper.common import select_pos
-from uitest.uihelper.calc import enter_text_to_cell
-from libreoffice.calc.document import get_cell_by_position
-from libreoffice.uno.propertyvalue import mkPropertyValues
 from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file, 
type_

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

2022-05-23 Thread tagezi (via logerrit)
 sc/qa/uitest/calc_tests3/tdf139974.py |3 ++-
 sc/qa/uitest/calc_tests4/exportToPDF.py   |8 +---
 sc/qa/uitest/calc_tests4/saveToCSV.py |9 +
 sc/qa/uitest/calc_tests8/tdf125051.py |5 ++---
 sc/qa/uitest/calc_tests9/tdf126673.py |8 +++-
 sc/qa/uitest/calc_tests9/tdf141244.py |4 ++--
 sc/qa/uitest/calc_tests9/tdf144996.py |3 ++-
 sc/qa/uitest/chart/chartArea.py   |   10 --
 sc/qa/uitest/chart/chartAxes.py   |8 +++-
 sc/qa/uitest/chart/chartDataLabels.py |   10 --
 sc/qa/uitest/chart/chartGrid.py   |   11 ---
 sc/qa/uitest/chart/chartLegend.py |8 +++-
 sc/qa/uitest/chart/chartWall.py   |   10 --
 sc/qa/uitest/chart/formatDataSeries.py|   10 --
 sc/qa/uitest/chart/tdf122011.py   |5 +++--
 sc/qa/uitest/chart/tdf46885.py|5 ++---
 sc/qa/uitest/chart/tdf62349.py|7 +++
 sc/qa/uitest/chart/tdf99069.py|6 +++---
 sc/qa/uitest/chart2/tdf101894.py  |6 +++---
 sc/qa/uitest/chart2/tdf120348.py  |5 +++--
 sc/qa/uitest/chart2/tdf122398.py  |7 +++
 sc/qa/uitest/chart2/tdf123013.py  |7 +++
 sc/qa/uitest/chart2/tdf123231.py  |7 +++
 sc/qa/uitest/chart2/tdf123520.py  |   10 --
 sc/qa/uitest/chart2/tdf124111.py  |7 +++
 sc/qa/uitest/chart2/tdf136011.py  |6 +++---
 sc/qa/uitest/conditional_format/tdf117899.py  |   10 ++
 sc/qa/uitest/conditional_format/tdf118206.py  |8 
 sc/qa/uitest/csv_dialog/tdf39716.py   |3 ++-
 sc/qa/uitest/external_links/tdf114995.py  |6 +++---
 sc/qa/uitest/external_links/tdf127484.py  |8 
 sc/qa/uitest/external_links/tdf147767.py  |8 
 sc/qa/uitest/external_links/tdf95217.py   |8 
 sc/qa/uitest/external_links/tdf96499.py   |8 
 sc/qa/uitest/function_wizard/function_wizard.py   |3 +--
 sc/qa/uitest/goalSeek/goalSeek.py |6 +++---
 sc/qa/uitest/goalSeek/tdf37341.py |7 +++
 sc/qa/uitest/goalSeek/tdf43693.py |7 +++
 sc/qa/uitest/key_f4/tdf102525.py  |5 +++--
 sc/qa/uitest/options/tdf122977.py |6 +-
 sc/qa/uitest/pageFormat/tdf123508.py  |   11 ---
 sc/qa/uitest/range_name/tdf119954.py  |8 
 sc/qa/uitest/range_name/tdf86214.py   |3 +--
 sc/qa/uitest/search_replace/tdf35020.py   |6 +++---
 sc/qa/uitest/search_replace/tdf39917.py   |8 +++-
 sc/qa/uitest/search_replace/tdf39959.py   |7 +++
 sc/qa/uitest/search_replace/tdf44398.py   |7 +++
 sc/qa/uitest/search_replace/tdf44861.py   |7 +++
 sc/qa/uitest/signatureLine/insertSignatureLine.py |5 ++---
 sc/qa/uitest/solver/solver.py |4 ++--
 sc/qa/uitest/sort/subtotals.py|   10 +-
 sc/qa/uitest/sort/tdf49531.py |9 -
 sc/qa/uitest/sort/tdf54018.py |   10 --
 sc/qa/uitest/sort/tdf95192.py |8 
 sc/qa/uitest/sort/tdf99208.py |7 +++
 sc/qa/uitest/sort/tdf99627.py |7 +++
 sc/qa/uitest/statistics/regression.py |5 ++---
 sc/qa/uitest/textCase/textCase.py |4 ++--
 sc/qa/uitest/validity/tdf138134.py|7 +++
 sc/qa/uitest/validity/tdf53920.py |9 +
 sc/qa/uitest/validity/tdf65686.py |   10 +-
 sc/qa/uitest/validity/tdf96698.py |   10 +-
 sc/qa/uitest/validity/validity.py |7 +++
 63 files changed, 204 insertions(+), 243 deletions(-)

New commits:
commit 69a103b57a39798473ebc48fdad0f696cbd606a6
Author: tagezi 
AuthorDate: Mon May 16 23:16:29 2022 +0300
Commit: Xisco Fauli 
CommitDate: Mon May 23 14:35:38 2022 +0200

tdf#132293: Removing unused imports from uitests files.

It seems, the most imports were copy-pasted from a file to a new one.
Additionally, the import block and surrounding area made more readable.

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

diff --git a/sc/qa/uitest/calc_tests3/tdf139974.py 
b/sc/qa/uitest/calc_tests3/tdf139974.py
index 1e7009b36fce..c30a05f90c19 100644
--- a/sc/qa/uitest/calc_tests3/tdf139974.py
+++ b/sc/qa/uit

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

2022-05-23 Thread AshSinc (via logerrit)
 sw/source/uibase/inc/concustomshape.hxx|1 +
 sw/source/uibase/inc/drawbase.hxx  |1 +
 sw/source/uibase/ribbar/concustomshape.cxx |   16 
 sw/source/uibase/ribbar/drawbase.cxx   |   24 ++--
 4 files changed, 40 insertions(+), 2 deletions(-)

New commits:
commit 3aa5aa83039b04f1412185e49cad9e3b694d49ca
Author: AshSinc 
AuthorDate: Fri May 20 12:54:53 2022 +0100
Commit: Heiko Tietze 
CommitDate: Mon May 23 15:09:35 2022 +0200

tdf#149141 - Writer - Added default object creation when drag size too low

Patch in case consistency is required for suggested Draw/Impress change 
here : https://gerrit.libreoffice.org/c/core/+/134499

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

diff --git a/sw/source/uibase/inc/concustomshape.hxx 
b/sw/source/uibase/inc/concustomshape.hxx
index 1ebb77cdd68e..cc2358ceeefc 100644
--- a/sw/source/uibase/inc/concustomshape.hxx
+++ b/sw/source/uibase/inc/concustomshape.hxx
@@ -47,6 +47,7 @@ class ConstCustomShape final : public SwDrawBase
 static OUString GetShapeTypeFromRequest( SfxRequest const & rReq );
 
 virtual void CreateDefaultObject() override;
+virtual void CreateDefaultObjectAtPosWithSize(Point aPos, Size aSize) 
override;
 
 // #i33136#
 virtual bool doConstructOrthogonal() const override;
diff --git a/sw/source/uibase/inc/drawbase.hxx 
b/sw/source/uibase/inc/drawbase.hxx
index 6aeb4455a3a1..ccc045ced313 100644
--- a/sw/source/uibase/inc/drawbase.hxx
+++ b/sw/source/uibase/inc/drawbase.hxx
@@ -63,6 +63,7 @@ public:
 virtual void Deactivate();  // deactivate function
 
 virtual void CreateDefaultObject();
+virtual void CreateDefaultObjectAtPosWithSize(Point aPos, Size aSize);
 
 // #i33136#
 virtual bool doConstructOrthogonal() const;
diff --git a/sw/source/uibase/ribbar/concustomshape.cxx 
b/sw/source/uibase/ribbar/concustomshape.cxx
index e830a447a374..56030fc42d35 100644
--- a/sw/source/uibase/ribbar/concustomshape.cxx
+++ b/sw/source/uibase/ribbar/concustomshape.cxx
@@ -171,6 +171,22 @@ void ConstCustomShape::CreateDefaultObject()
 }
 }
 
+void ConstCustomShape::CreateDefaultObjectAtPosWithSize(Point aPos, Size aSize)
+{
+SwDrawBase::CreateDefaultObjectAtPosWithSize(aPos, aSize);
+SdrView *pSdrView = m_pSh->GetDrawView();
+if ( pSdrView )
+{
+const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
+if ( rMarkList.GetMarkCount() == 1 )
+{
+SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
+if ( dynamic_cast< const SdrObjCustomShape *>( pObj ) )
+SetAttributes( pObj );
+}
+}
+}
+
 // #i33136#
 bool ConstCustomShape::doConstructOrthogonal() const
 {
diff --git a/sw/source/uibase/ribbar/drawbase.cxx 
b/sw/source/uibase/ribbar/drawbase.cxx
index b88c964aa7f2..36a00853da90 100644
--- a/sw/source/uibase/ribbar/drawbase.cxx
+++ b/sw/source/uibase/ribbar/drawbase.cxx
@@ -254,7 +254,7 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt)
SdrObjKind::PathFill == nDrawMode ||
SdrObjKind::FreehandLine == nDrawMode ||
SdrObjKind::FreehandFill == nDrawMode;
-if(rMEvt.IsRight() || (aPnt == m_aStartPos && !bMultiPoint))
+if(rMEvt.IsRight())
 {
 m_pSh->BreakCreate();
 m_pView->LeaveDrawCreate();
@@ -269,7 +269,12 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt)
 m_pSh->StartUndo(SwUndoId::INSERT, &aRewriter);
 }
 
-m_pSh->EndCreate(SdrCreateCmd::ForceEnd);
+bool didCreate = m_pSh->EndCreate(SdrCreateCmd::ForceEnd);
+if(!didCreate && !bMultiPoint)
+{
+CreateDefaultObjectAtPosWithSize(aPnt, Size(1000, 1000));
+}
+
 if (SdrObjKind::NONE == nDrawMode)   // Text border inserted
 {
 uno::Reference< frame::XDispatchRecorder > xRecorder =
@@ -523,6 +528,21 @@ void SwDrawBase::CreateDefaultObject()
 m_pSh->CreateDefaultShape(m_pWin->GetSdrDrawMode(), aRect, m_nSlotId);
 }
 
+void SwDrawBase::CreateDefaultObjectAtPosWithSize(Point aPos, Size aSize)
+{
+aPos.AdjustX(-sal_Int32(aSize.getWidth() / 2));
+aPos.AdjustY(-sal_Int32(aSize.getHeight() / 2));
+
+SdrView* sdrView =  m_pView->GetDrawView();
+SdrPageView *pPV = sdrView->GetSdrPageView();
+
+if(sdrView->IsSnapEnabled())
+aPos = sdrView->GetSnapPos(aPos, pPV);
+
+::tools::Rectangle aNewObjectRectangle(aPos, aSize);
+m_pSh->CreateDefaultShape(m_pWin->GetSdrDrawMode(), aNewObjectRectangle, 
m_nSlotId);
+}
+
 Point  SwDrawBase::GetDefaultCenterPos() const
 {
 Size aDocSz(m_pSh->GetDocSize());


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

2022-05-23 Thread AshSinc (via logerrit)
 sd/source/ui/func/fucon3d.cxx  |   26 +++---
 sd/source/ui/func/fuconcs.cxx  |   18 ++
 sd/source/ui/func/fuconrec.cxx |   18 ++
 3 files changed, 59 insertions(+), 3 deletions(-)

New commits:
commit 9e7597a1cc92e06d61acf87a8c560de3b4fdabf8
Author: AshSinc 
AuthorDate: Wed May 18 23:04:20 2022 +0100
Commit: Heiko Tietze 
CommitDate: Mon May 23 15:12:04 2022 +0200

tdf#149141 - Added default object creation when drag size too low

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

diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx
index 111f7b141282..fb844548fafc 100644
--- a/sd/source/ui/func/fucon3d.cxx
+++ b/sd/source/ui/func/fucon3d.cxx
@@ -357,10 +357,30 @@ bool FuConstruct3dObject::MouseButtonUp(const MouseEvent& 
rMEvt)
 
 if ( mpView->IsCreateObj() && rMEvt.IsLeft() )
 {
-mpView->EndCreateObj(SdrCreateCmd::ForceEnd);
-bReturn = true;
-}
+if( mpView->EndCreateObj( SdrCreateCmd::ForceEnd ) )
+{
+bReturn = true;
+}
+else
+{
+//Drag was too small to create object, so insert default object at 
click pos
+Point aClickPos(mpWindow->PixelToLogic(rMEvt.GetPosPixel()));
+sal_uInt32 nDefaultObjectSize(1000);
+sal_Int32 nCenterOffset(-sal_Int32(nDefaultObjectSize / 2));
+aClickPos.AdjustX(nCenterOffset);
+aClickPos.AdjustY(nCenterOffset);
+
+SdrPageView *pPV = mpView->GetSdrPageView();
 
+if(mpView->IsSnapEnabled())
+aClickPos = mpView->GetSnapPos(aClickPos, pPV);
+
+::tools::Rectangle aNewObjectRectangle(aClickPos, 
Size(nDefaultObjectSize, nDefaultObjectSize));
+SdrObjectUniquePtr pObjDefault = CreateDefaultObject(nSlotId, 
aNewObjectRectangle);
+
+bReturn = mpView->InsertObjectAtView(pObjDefault.release(), *pPV);
+}
+}
 bReturn = FuConstruct::MouseButtonUp(rMEvt) || bReturn;
 
 if (!bPermanent)
diff --git a/sd/source/ui/func/fuconcs.cxx b/sd/source/ui/func/fuconcs.cxx
index 964366f4522d..806960dd254a 100644
--- a/sd/source/ui/func/fuconcs.cxx
+++ b/sd/source/ui/func/fuconcs.cxx
@@ -124,6 +124,24 @@ bool FuConstructCustomShape::MouseButtonUp(const 
MouseEvent& rMEvt)
 {
 bReturn = true;
 }
+else
+{
+//Drag was too small to create object, so insert default object at 
click pos
+Point aClickPos(mpWindow->PixelToLogic(rMEvt.GetPosPixel()));
+sal_uInt32 nDefaultObjectSize(1000);
+sal_Int32 nCenterOffset(-sal_Int32(nDefaultObjectSize / 2));
+aClickPos.AdjustX(nCenterOffset);
+aClickPos.AdjustY(nCenterOffset);
+
+SdrPageView *pPV = mpView->GetSdrPageView();
+if(mpView->IsSnapEnabled())
+aClickPos = mpView->GetSnapPos(aClickPos, pPV);
+
+::tools::Rectangle aNewObjectRectangle(aClickPos, 
Size(nDefaultObjectSize, nDefaultObjectSize));
+SdrObjectUniquePtr pObjDefault = CreateDefaultObject(nSlotId, 
aNewObjectRectangle);
+
+bReturn = mpView->InsertObjectAtView(pObjDefault.release(), *pPV);
+}
 }
 bReturn = FuConstruct::MouseButtonUp (rMEvt) || bReturn;
 
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index 605a330bdf63..d93ef2849468 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -314,6 +314,24 @@ bool FuConstructRectangle::MouseButtonUp(const MouseEvent& 
rMEvt)
 
 bReturn = true;
 }
+else
+{
+//Drag was too small to create object, so insert default object at 
click pos
+Point aClickPos(mpWindow->PixelToLogic(rMEvt.GetPosPixel()));
+sal_uInt32 nDefaultObjectSize(1500);
+sal_Int32 nCenterOffset(-sal_Int32(nDefaultObjectSize / 2));
+aClickPos.AdjustX(nCenterOffset);
+aClickPos.AdjustY(nCenterOffset);
+
+SdrPageView *pPV = mpView->GetSdrPageView();
+if(mpView->IsSnapEnabled())
+aClickPos = mpView->GetSnapPos(aClickPos, pPV);
+
+::tools::Rectangle aNewObjectRectangle(aClickPos, 
Size(nDefaultObjectSize, nDefaultObjectSize));
+SdrObjectUniquePtr pObjDefault = CreateDefaultObject(nSlotId, 
aNewObjectRectangle);
+
+bReturn = mpView->InsertObjectAtView(pObjDefault.release(), *pPV);
+}
 }
 
 bReturn = FuConstruct::MouseButtonUp (rMEvt) || bReturn;


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

2022-05-23 Thread Stephan Bergmann (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f546767b4e9bf3de288ea50336cf1e15f1ee7435
Author: Stephan Bergmann 
AuthorDate: Mon May 23 12:25:13 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 23 15:21:11 2022 +0200

tdf#149198 Fix previous fix

...c8d4ae2ad0cfdac770d897e7aca72fbb4a87765f "tdf#149198 Fix use of nullptr".
Thanks to Mike for spotting my mistake there.

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 4294f841cbd5..db9fd1a873b8 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3136,7 +3136,7 @@ void DocxAttributeOutput::WriteCollectedRunProperties()
 {
 const char* pVal = nullptr;
 m_pColorAttrList->getAsChar(FSNS(XML_w, XML_val), pVal);
-if (pVal != nullptr && std::string_view("auto") != pVal)
+if (pVal == nullptr || std::string_view("auto") != pVal)
 {
 m_pSerializer->startElementNS(XML_w14, XML_textFill);
 m_pSerializer->startElementNS(XML_w14, XML_solidFill);


[Libreoffice-commits] core.git: sal/osl

2022-05-23 Thread Noel Grandin (via logerrit)
 sal/osl/unx/file.cxx  |   13 -
 sal/osl/unx/file_impl.hxx |3 ---
 sal/osl/unx/file_misc.cxx |9 -
 sal/osl/w32/file.cxx  |   12 
 4 files changed, 37 deletions(-)

New commits:
commit e1b3a6edd4b3400c25aa135d75bd1ad19b279609
Author: Noel Grandin 
AuthorDate: Mon May 23 09:12:51 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 15:25:04 2022 +0200

no need to override 'operator new' in FileHandle_Impl

it's been a while since we had our own allocator

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

diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 351d1457e89b..caa7f5dd57e9 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -111,9 +111,6 @@ struct FileHandle_Impl
 explicit FileHandle_Impl(int fd, Kind kind = KIND_FD);
 ~FileHandle_Impl();
 
-static void* operator new (size_t n);
-static void  operator delete (void * p);
-
 static size_t getpagesize();
 
 sal_uInt64   getPos() const;
@@ -221,16 +218,6 @@ FileHandle_Impl::~FileHandle_Impl()
 (void) pthread_mutex_destroy(&m_mutex); // ignoring EBUSY ...
 }
 
-void* FileHandle_Impl::operator new (size_t n)
-{
-return malloc(n);
-}
-
-void FileHandle_Impl::operator delete (void * p)
-{
-free(p);
-}
-
 size_t FileHandle_Impl::getpagesize()
 {
 return sal::static_int_cast< size_t >(::sysconf(_SC_PAGESIZE));
diff --git a/sal/osl/unx/file_impl.hxx b/sal/osl/unx/file_impl.hxx
index a4e0c66adc57..6d5e2d740913 100644
--- a/sal/osl/unx/file_impl.hxx
+++ b/sal/osl/unx/file_impl.hxx
@@ -35,9 +35,6 @@ struct DirectoryItem_Impl
 OString strFilePath, unsigned char DType = 0);
 ~DirectoryItem_Impl();
 
-static void * operator new(size_t n);
-static void operator delete (void * p);
-
 void acquire(); /* @see osl_acquireDirectoryItem() */
 void release(); /* @see osl_releaseDirectoryItem() */
 
diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx
index 50fdcc040765..b2d6010fe847 100644
--- a/sal/osl/unx/file_misc.cxx
+++ b/sal/osl/unx/file_misc.cxx
@@ -94,15 +94,6 @@ DirectoryItem_Impl::~DirectoryItem_Impl()
 {
 }
 
-void * DirectoryItem_Impl::operator new(size_t n)
-{
-return malloc(n);
-}
-void DirectoryItem_Impl::operator delete(void * p)
-{
-free(p);
-}
-
 void DirectoryItem_Impl::acquire()
 {
 ++m_RefCount;
diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx
index 96b2bba4b486..57d95e14dfed 100644
--- a/sal/osl/w32/file.cxx
+++ b/sal/osl/w32/file.cxx
@@ -83,8 +83,6 @@ struct FileHandle_Impl
 explicit  FileHandle_Impl (HANDLE hFile);
   ~FileHandle_Impl();
 
-static void*  operator new(size_t n);
-static void   operator delete(void * p, size_t);
 static SIZE_T getpagesize();
 
 sal_uInt64getPos() const;
@@ -178,16 +176,6 @@ FileHandle_Impl::~FileHandle_Impl()
 ::DeleteCriticalSection (&m_mutex);
 }
 
-void * FileHandle_Impl::operator new(size_t n)
-{
-return malloc(n);
-}
-
-void FileHandle_Impl::operator delete(void * p, size_t)
-{
-free(p);
-}
-
 SIZE_T FileHandle_Impl::getpagesize()
 {
 SYSTEM_INFO info;


[Libreoffice-commits] core.git: starmath/source svx/source ucbhelper/source

2022-05-23 Thread Noel Grandin (via logerrit)
 starmath/source/unomodel.cxx  |7 +++
 svx/source/customshapes/EnhancedCustomShape2d.cxx |   15 ++-
 ucbhelper/source/client/content.cxx   |3 ++-
 3 files changed, 15 insertions(+), 10 deletions(-)

New commits:
commit 0a1bfe1e3fb298d7d7e2cfd85887d430cce59238
Author: Noel Grandin 
AuthorDate: Mon May 23 11:04:19 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 15:25:42 2022 +0200

elide some OUString allocation

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

diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 8b0b8817f588..b61fae230441 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -389,10 +389,9 @@ sal_Bool SmModel::supportsService(const OUString& 
rServiceName)
 
 uno::Sequence< OUString > SmModel::getSupportedServiceNames()
 {
-return uno::Sequence{
-"com.sun.star.document.OfficeDocument",
-"com.sun.star.formula.FormulaProperties"
-};
+static constexpr OUStringLiteral service1 = 
u"com.sun.star.document.OfficeDocument";
+static constexpr OUStringLiteral service2 = 
u"com.sun.star.formula.FormulaProperties";
+return uno::Sequence{ service1, service2 };
 }
 
 void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const 
Any* pValues)
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx 
b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 41cec42df4a1..87c081628993 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -541,13 +541,15 @@ bool 
EnhancedCustomShape2d::ConvertSequenceToEnhancedCustomShape2dHandle(
 void EnhancedCustomShape2d::ApplyShapeAttributes( const 
SdrCustomShapeGeometryItem& rGeometryItem )
 {
 // AdjustmentValues
-const Any* pAny = 
const_cast(rGeometryItem).GetPropertyValueByName( 
"AdjustmentValues" );
+static constexpr OUStringLiteral sAdjustmentValues( u"AdjustmentValues" );
+const Any* pAny = 
const_cast(rGeometryItem).GetPropertyValueByName( 
sAdjustmentValues );
 if ( pAny )
 *pAny >>= seqAdjustmentValues;
 
 
 // Coordsize
-const Any* pViewBox = 
const_cast(rGeometryItem).GetPropertyValueByName( 
"ViewBox" );
+static constexpr OUStringLiteral sViewBox( u"ViewBox" );
+const Any* pViewBox = 
const_cast(rGeometryItem).GetPropertyValueByName( 
sViewBox );
 css::awt::Rectangle aViewBox;
 if ( pViewBox && (*pViewBox >>= aViewBox ) )
 {
@@ -745,7 +747,8 @@ 
EnhancedCustomShape2d::EnhancedCustomShape2d(SdrObjCustomShape& rSdrObjCustomSha
 
 OUString sShapeType;
 const SdrCustomShapeGeometryItem& 
rGeometryItem(mrSdrObjCustomShape.GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY 
));
-const Any* pAny = rGeometryItem.GetPropertyValueByName( "Type" );
+static constexpr OUStringLiteral sType = u"Type";
+const Any* pAny = rGeometryItem.GetPropertyValueByName( sType );
 if ( pAny ) {
 *pAny >>= sShapeType;
 bOOXMLShape = sShapeType.startsWith("ooxml-");
@@ -753,10 +756,12 @@ 
EnhancedCustomShape2d::EnhancedCustomShape2d(SdrObjCustomShape& rSdrObjCustomSha
 }
 eSpType = EnhancedCustomShapeTypeNames::Get( sShapeType );
 
-pAny = rGeometryItem.GetPropertyValueByName( "MirroredX" );
+static constexpr OUStringLiteral sMirroredX = u"MirroredX";
+static constexpr OUStringLiteral sMirroredY = u"MirroredY";
+pAny = rGeometryItem.GetPropertyValueByName( sMirroredX );
 if ( pAny )
 *pAny >>= bFlipH;
-pAny = rGeometryItem.GetPropertyValueByName( "MirroredY" );
+pAny = rGeometryItem.GetPropertyValueByName( sMirroredY );
 if ( pAny )
 *pAny >>= bFlipV;
 
diff --git a/ucbhelper/source/client/content.cxx 
b/ucbhelper/source/client/content.cxx
index 948c4848c6f4..7f3268c41754 100644
--- a/ucbhelper/source/client/content.cxx
+++ b/ucbhelper/source/client/content.cxx
@@ -416,8 +416,9 @@ Reference< XCommandInfo > Content::getCommands()
 
 Reference< XPropertySetInfo > Content::getProperties()
 {
+static constexpr OUStringLiteral sgetPropertySetInfo = 
u"getPropertySetInfo";
 Command aCommand;
-aCommand.Name = "getPropertySetInfo";
+aCommand.Name = sgetPropertySetInfo;
 aCommand.Handle   = -1; // n/a
 aCommand.Argument = Any();
 


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

2022-05-23 Thread Noel Grandin (via logerrit)
 unotools/source/config/eventcfg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9c046328596e21ce26ed59e215ba2ba5202361e2
Author: Noel Grandin 
AuthorDate: Mon May 23 11:04:38 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 15:26:12 2022 +0200

cache ref to GlobalEventConfig

so we avoid repeated allocation

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

diff --git a/unotools/source/config/eventcfg.cxx 
b/unotools/source/config/eventcfg.cxx
index 8cd883e0a0be..a92618a81f56 100644
--- a/unotools/source/config/eventcfg.cxx
+++ b/unotools/source/config/eventcfg.cxx
@@ -374,7 +374,7 @@ OUString GlobalEventConfig::GetEventName( GlobalEventId 
nIndex )
 {
 if (utl::ConfigManager::IsFuzzing())
 return OUString();
-rtl::Reference createImpl(new GlobalEventConfig);
+static rtl::Reference createImpl(new GlobalEventConfig);
 return GlobalEventConfig::m_pImpl->GetEventName( nIndex );
 }
 


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

2022-05-23 Thread Szymon Kłos (via logerrit)
 sfx2/source/sidebar/SidebarController.cxx |9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

New commits:
commit 89ceb3504c74e6f7875785d436a378a991ba2f8a
Author: Szymon Kłos 
AuthorDate: Mon May 23 14:51:07 2022 +0200
Commit: Michael Meeks 
CommitDate: Mon May 23 15:41:37 2022 +0200

Revert "lok: sidebar: avoid async call to switch context"

Async call was introduced so we will not switch panels multiple times
in a row, but only one time. That patch was bad for performance.

This reverts commit 55f65c4d6cf7d1f68fe9c39c42431e6a15d903e6.

Change-Id: I710d9c4bf0881750ca763d53cd1928068721cc82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134821
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index ba1c968d022f..db4f9679e34a 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -332,9 +332,8 @@ void SAL_CALL SidebarController::notifyContextChangeEvent 
(const css::ui::Contex
 maContextChangeUpdate.RequestCall(); // async call, not a prob
  // calling with held
  // solarmutex
-if (comphelper::LibreOfficeKit::isActive())
-maContextChangeUpdate.Sync();
-else // TODO: this call is redundant but mandatory for unit test to 
update context on document loading
+// TODO: this call is redundant but mandatory for unit test to update 
context on document loading
+if (!comphelper::LibreOfficeKit::isActive())
 UpdateConfigurations();
 }
 }
@@ -374,8 +373,6 @@ void SAL_CALL SidebarController::statusChanged (const 
css::frame::FeatureStateEv
 mnRequestedForceFlags |= SwitchFlag_ForceSwitch;
 maContextChangeUpdate.RequestCall(); // async call, ok to call
  // with held solarmutex
-if (comphelper::LibreOfficeKit::isActive())
-maContextChangeUpdate.Sync();
 }
 }
 
@@ -1031,8 +1028,6 @@ IMPL_LINK(SidebarController, WindowEventHandler, 
VclWindowEvent&, rEvent, void)
 mpParentWindow->Invalidate();
 mnRequestedForceFlags |= SwitchFlag_ForceNewDeck | 
SwitchFlag_ForceNewPanels;
 maContextChangeUpdate.RequestCall();
-if (comphelper::LibreOfficeKit::isActive())
-maContextChangeUpdate.Sync();
 break;
 
 case VclEventId::ObjectDying:


Ashleigh Sinclair license statement

2022-05-23 Thread Ashleigh
All of my past & future contributions to LibreOffice may be licensed under
the MPLv2/LGPLv3+ dual license.


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

2022-05-23 Thread Hossein (via logerrit)
 sw/qa/extras/uiwriter/data/simplefooter.docx |binary
 sw/qa/extras/uiwriter/uiwriter7.cxx  |   24 
 sw/source/filter/ww8/wrtw8sty.cxx|8 
 3 files changed, 32 insertions(+)

New commits:
commit 3eda5d345f14f8926358df7b425c452a8a165c7d
Author: Hossein 
AuthorDate: Fri May 20 15:20:40 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 23 16:29:54 2022 +0200

tdf#149184 DOCX: fix crash removing footer, then saving to doc

When openeing the simplefooter.docx, after removing the footer and
exporting to .doc, LibreOffice crashes. This regression was
introduced with 88e6a1bfeac86e0c89d2ff08c908c2b5ae061177 which is
titled: "DOCX: export hidden (shared) headers/footers".

The current patch fixes this problem by checking to see if the header
or footer text is there or not.

A unit test is added to avoid this problem in the future. One can run
the test with:

make CPPUNIT_TEST_NAME="testTdf149184" -sr CppunitTest_sw_uiwriter7

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

diff --git a/sw/qa/extras/uiwriter/data/simplefooter.docx 
b/sw/qa/extras/uiwriter/data/simplefooter.docx
new file mode 100644
index ..006c85ab7cc8
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/simplefooter.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx 
b/sw/qa/extras/uiwriter/uiwriter7.cxx
index 3815713dc877..0cb70e91076b 100644
--- a/sw/qa/extras/uiwriter/uiwriter7.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter7.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -2751,6 +2752,29 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf117225)
 CPPUNIT_ASSERT_EQUAL(nExpected, nActual);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf149184)
+{
+SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "simplefooter.docx");
+SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+
+// Removing the footer for all styles
+pWrtShell->ChangeHeaderOrFooter(u"", false, false, false);
+
+// export to simplefooter.doc
+uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
+uno::Sequence aStoreProps = 
comphelper::InitPropertySequence({
+{ "FilterName", uno::Any(OUString("MS Word 97")) },
+});
+utl::TempFile aTempFile;
+aTempFile.EnableKillingFile();
+
+// Without the fix in place, the test fails with:
+// [CUT] sw_uiwriter7
+// Segmentation fault (core dumped)
+// [_RUN_] testTdf149184::TestBody
+xStorable->storeToURL(aTempFile.GetURL(), aStoreProps);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index 44d437dbf772..6e9053401606 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -2080,6 +2080,10 @@ void MSWordExportBase::WriteHeaderFooterText( const 
SwFormat& rFormat, bool bHea
 m_bHasHdr = true;
 const SwFormatHeader& rHd = rFormat.GetHeader();
 OSL_ENSURE( rHd.GetHeaderFormat(), "Header text is not here" );
+
+if ( !rHd.GetHeaderFormat() )
+return;
+
 pContent = &rHd.GetHeaderFormat()->GetContent();
 }
 else
@@ -2087,6 +2091,10 @@ void MSWordExportBase::WriteHeaderFooterText( const 
SwFormat& rFormat, bool bHea
 m_bHasFtr = true;
 const SwFormatFooter& rFt = rFormat.GetFooter();
 OSL_ENSURE( rFt.GetFooterFormat(), "Footer text is not here" );
+
+if ( !rFt.GetFooterFormat() )
+return;
+
 pContent = &rFt.GetFooterFormat()->GetContent();
 }
 


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

2022-05-23 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/itiff/itiff.cxx |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

New commits:
commit ecae51e5f14dad2591d6a15f2e70b4d024fb7985
Author: Caolán McNamara 
AuthorDate: Mon May 23 08:54:04 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 23 17:08:12 2022 +0200

tiled tiff found at rhbz552360-2.tiff

fix up wrt skew and buffer size and the right put function

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

diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index f919cda526dc..cb512d58577d 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -53,7 +53,7 @@ namespace
 {
 }
 
-void SetPixels(uint32_t x, uint32_t y, uint32_t w, uint32_t h)
+void SetPixels(uint32_t x, uint32_t y, uint32_t w, uint32_t h, 
uint32_t skew)
 {
 const uint32_t* pSrc = aBuffer.data();
 
@@ -66,6 +66,7 @@ namespace
 pAlphaAccess->SetPixelIndex(y + nRow, x + nCol, 255 - 
TIFFGetA(*pSrc));
 ++pSrc;
 }
+pSrc += skew;
 }
 }
 };
@@ -124,11 +125,11 @@ static void putContigPixel(TIFFRGBAImage* img, uint32_t* 
/*raster*/,
 {
 Context* pContext = static_cast(TIFFClientdata(img->tif));
 
-pContext->aBuffer.resize(w * h);
+pContext->aBuffer.resize((w + toskew) * h);
 (pContext->pOrigContig)(img, pContext->aBuffer.data(), 0, 0, w, h,
 fromskew, toskew, cp);
 
-pContext->SetPixels(x, y, w, h);
+pContext->SetPixels(x, y, w, h, toskew);
 }
 
 static void putSeparatePixel(TIFFRGBAImage* img, uint32_t* /*raster*/,
@@ -138,11 +139,11 @@ static void putSeparatePixel(TIFFRGBAImage* img, 
uint32_t* /*raster*/,
 {
 Context* pContext = static_cast(TIFFClientdata(img->tif));
 
-pContext->aBuffer.resize(w * h);
+pContext->aBuffer.resize((w + toskew) * h);
 (pContext->pOrigSeparate)(img, pContext->aBuffer.data(), 0, 0, w, h,
   fromskew, toskew, r, g, b, a);
 
-pContext->SetPixels(x, y, w, h);
+pContext->SetPixels(x, y, w, h, toskew);
 }
 
 bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic)
@@ -204,8 +205,8 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& 
rGraphic)
 if (TIFFRGBAImageOK(tif, emsg) && TIFFRGBAImageBegin(&img, tif, 1, 
emsg))
 {
 img.req_orientation = ORIENTATION_TOPLEFT;
-assert(!TIFFIsTiled(img.tif));
-if (!TIFFIsTiled(img.tif))
+assert(img.isContig);
+if (img.isContig)
 {
 aContext.pOrigContig = img.put.contig;
 img.put.contig = putContigPixel;


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

2022-05-23 Thread Pranam Lashkari (via logerrit)
 sw/inc/docufld.hxx|1 +
 sw/source/core/fields/docufld.cxx |5 +
 sw/source/core/txtnode/thints.cxx |4 +++-
 3 files changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 0d3bba5c383ef8b9f62c121a26fed4445c813949
Author: Pranam Lashkari 
AuthorDate: Fri May 20 20:24:46 2022 +0530
Commit: Gökay ŞATIR 
CommitDate: Mon May 23 17:13:29 2022 +0200

comments: reassign ID when copy comment

reassigning new ID will make all the comments have unique IDs
this will also ensure there is no mixup when working with comments ID

Signed-off-by: Pranam Lashkari 
Change-Id: I94b433130c68354ab94d4d6e9b86751038b31af5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134686
Reviewed-by: Szymon Kłos 
Reviewed-by: Gökay ŞATIR 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index b4fe720970b6..f7bc73bad0db 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -474,6 +474,7 @@ public:
 Date   GetDate() const { return 
Date(m_aDateTime.GetDate()); }
 tools::Time GetTime() const { return 
tools::Time(m_aDateTime.GetTime()); }
 sal_uInt32 GetPostItId() const { return m_nPostItId; }
+void SetPostItId(const sal_uInt32 nPostItId = 0);
 
 /// Author
 virtual OUStringGetPar1() const override;
diff --git a/sw/source/core/fields/docufld.cxx 
b/sw/source/core/fields/docufld.cxx
index b32c4937ed1e..574cac74fe37 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -1829,6 +1829,11 @@ sal_Int32 SwPostItField::GetNumberOfParagraphs() const
 return mpText ? mpText->Count() : 1;
 }
 
+void SwPostItField::SetPostItId(const sal_uInt32 nPostItId)
+{
+m_nPostItId = nPostItId == 0 ? s_nLastPostItId++ : nPostItId;
+}
+
 bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
 {
 switch( nWhichId )
diff --git a/sw/source/core/txtnode/thints.cxx 
b/sw/source/core/txtnode/thints.cxx
index af1f220fa448..f0a784f6fc42 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1080,7 +1080,9 @@ SwTextAttr* MakeTextAttr(
 // the relation to its annotation mark (relation established 
via annotation field's name).
 // If the annotation mark is also copied, the relation and 
thus the annotated text range will be reestablished,
 // when the annotation mark is created and inserted into the 
document.
-const_cast(dynamic_cast(*(pNew->GetFormatField().GetField(.SetName(OUString());
+auto& pField = const_cast(dynamic_cast(*(pNew->GetFormatField().GetField(;
+pField.SetName(OUString());
+pField.SetPostItId();
 }
 }
 break;


[Libreoffice-commits] core.git: sal/osl

2022-05-23 Thread Noel Grandin (via logerrit)
 sal/osl/unx/file_url.cxx |4 ++--
 sal/osl/unx/file_url.hxx |2 +-
 sal/osl/unx/tempfile.cxx |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 72582e9fb3d634a28c1466126bbe8e36fc00b446
Author: Noel Grandin 
AuthorDate: Mon May 23 09:33:51 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 17:26:15 2022 +0200

rename osl_getSystemPathFromFileURL_Ex->getSystemPathFromFileURL_Ex

so I can more readily distinguish between functions that are actually in
the OSL API and functions that are not

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

diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx
index 2e21684eba8f..4b5a16885cb3 100644
--- a/sal/osl/unx/file_url.cxx
+++ b/sal/osl/unx/file_url.cxx
@@ -444,7 +444,7 @@ oslFileError SAL_CALL osl_getFileURLFromSystemPath( 
rtl_uString *ustrSystemPath,
 /*
  * relative URLs are not accepted
  */
-oslFileError osl_getSystemPathFromFileURL_Ex(
+oslFileError getSystemPathFromFileURL_Ex(
 rtl_uString *ustrFileURL, rtl_uString **pustrSystemPath)
 {
 rtl_uString* temp = nullptr;
@@ -711,7 +711,7 @@ oslFileError osl_getAbsoluteFileURL(
 if (systemPathIsRelativePath(unresolved_path))
 {
 OUString base_path;
-oslFileError rc = osl_getSystemPathFromFileURL_Ex(ustrBaseDirURL, 
&base_path.pData);
+oslFileError rc = getSystemPathFromFileURL_Ex(ustrBaseDirURL, 
&base_path.pData);
 if (rc != osl_File_E_None)
 return rc;
 
diff --git a/sal/osl/unx/file_url.hxx b/sal/osl/unx/file_url.hxx
index f9f31eb2056a..3ffd9e06bace 100644
--- a/sal/osl/unx/file_url.hxx
+++ b/sal/osl/unx/file_url.hxx
@@ -27,7 +27,7 @@ namespace rtl {
 class OUString;
 }
 
-oslFileError osl_getSystemPathFromFileURL_Ex(rtl_uString *ustrFileURL, 
rtl_uString **pustrSystemPath);
+oslFileError getSystemPathFromFileURL_Ex(rtl_uString *ustrFileURL, rtl_uString 
**pustrSystemPath);
 
 oslFileError FileURLToPath(char * buffer, size_t bufLen, rtl_uString* 
ustrFileURL);
 
diff --git a/sal/osl/unx/tempfile.cxx b/sal/osl/unx/tempfile.cxx
index 00ae0664b2c0..bd8e88db742c 100644
--- a/sal/osl/unx/tempfile.cxx
+++ b/sal/osl/unx/tempfile.cxx
@@ -127,7 +127,7 @@ static oslFileError osl_setup_base_directory_impl_(
 
 if (error == osl_File_E_None)
 {
-error = osl_getSystemPathFromFileURL_Ex(dir_url, &dir);
+error = getSystemPathFromFileURL_Ex(dir_url, &dir);
 rtl_uString_release(dir_url);
 }
 


[Libreoffice-commits] core.git: configure.ac

2022-05-23 Thread Michael Weghorn (via logerrit)
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9adc0e9d381e8469ac2fe67d1fb09dfddad225d8
Author: Michael Weghorn 
AuthorDate: Mon May 23 12:51:26 2022 +0200
Commit: Michael Weghorn 
CommitDate: Mon May 23 17:40:21 2022 +0200

qt6 configure: Consider 'qmake6' when searching Qt 6 qmake

Debian testing/unstable provides a `/usr/bin/qmake6`.

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

diff --git a/configure.ac b/configure.ac
index f75582843689..ee9fe810377c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13027,7 +13027,7 @@ then
 if test -n "$QT6DIR"; then
 AC_PATH_PROG(QMAKE6, [qmake], no, [$QT6DIR/bin])
 else
-AC_PATH_PROGS(QMAKE6, [qmake-qt6 qmake], no)
+AC_PATH_PROGS(QMAKE6, [qmake-qt6 qmake6 qmake], no)
 fi
 if test "$QMAKE6" = "no"; then
 AC_MSG_ERROR([Qmake not found.  Please specify the root of your Qt6 
installation by exporting QT6DIR before running "configure".])


[Libreoffice-commits] core.git: configure.ac

2022-05-23 Thread Michael Weghorn (via logerrit)
 configure.ac |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 95c55b40f7670984ba39447bd695c78ac7d6df1f
Author: Michael Weghorn 
AuthorDate: Mon May 23 12:56:38 2022 +0200
Commit: Michael Weghorn 
CommitDate: Mon May 23 17:40:38 2022 +0200

qt6 configure: Consider more paths to find Qt 6 moc

commit 88d57cf241209ffec9eaed3e523942ab51af6db6
Date:   Wed Sep 29 11:09:51 2021 +0200

qt6: Add a qt6 VCL plugin

mentioned:

> 1) At least in my self-compiled Qt versions,
> 'moc' (the meta-object compiler) is located
> in the 'libexec' subdirectory in 'QT6DIR', while the
> Qt 5 equivalent is located in the "bin" subdirectory
> of 'QT5DIR', so the configure.ac check uses the former.

Search for moc in the "libexec" subdirectory of
all paths in `lib_dir` before trying `$PATH`,
so e.g. the one provided as `/usr/lib/qt6/libexec/moc`
by package "qt6-base-dev-tools" in Debian testing is found
before a Qt 5 version in `$PATH`.

With this change in place, building on Debian testing
using the system Qt 6 works when building with autogen option
`--enable-qt6` but no `QT6DIR` set and `/usr/bin/moc` points
to the Qt 5 version of moc.

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

diff --git a/configure.ac b/configure.ac
index ee9fe810377c..bd9a1c3f8be6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13104,7 +13104,14 @@ then
 
 dnl Check for Meta Object Compiler
 
-AC_PATH_PROGS( MOC6, [moc-qt6 moc], no, [`dirname 
$qt6_libdir`/libexec:$QT6DIR/libexec:$PATH])
+for lib_dir in $qt6_libdirs; do
+if test -z "$qt6_libexec_dirs"; then
+qt6_libexec_dirs="$lib_dir/libexec"
+else
+qt6_libexec_dirs="$qt6_libexec_dirs:$lib_dir/libexec"
+fi
+done
+AC_PATH_PROGS( MOC6, [moc-qt6 moc], no, [`dirname 
$qt6_libdir`/libexec:$QT6DIR/libexec:$qt6_libexec_dirs:$PATH])
 if test "$MOC6" = "no"; then
 AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
 the root of your Qt installation by exporting QT6DIR before running 
"configure".])


[Libreoffice-commits] core.git: desktop/source include/LibreOfficeKit libreofficekit/source sw/source

2022-05-23 Thread Miklos Vajna (via logerrit)
 desktop/source/lib/init.cxx  |4 -
 include/LibreOfficeKit/LibreOfficeKit.hxx|   10 +++-
 include/LibreOfficeKit/LibreOfficeKitEnums.h |   23 ---
 libreofficekit/source/gtk/lokdocview.cxx |   27 -
 sw/source/uibase/uno/unotxdoc.cxx|   56 ++-
 sw/source/uibase/wrtsh/wrtsh3.cxx|   18 +++-
 6 files changed, 106 insertions(+), 32 deletions(-)

New commits:
commit 9a76be53dfb801b754bf55f9d4b8c5f82991a62f
Author: Miklos Vajna 
AuthorDate: Mon May 23 08:39:34 2022 +0200
Commit: Miklos Vajna 
CommitDate: Mon May 23 18:04:09 2022 +0200

sw content controls, picture: add LOK API

- send a LOK_CALLBACK_CONTENT_CONTROL callback with
  action=change-picture when a file picker should be shown

- extend lok::Document::sendContentControlEvent() to be able to replace
  the placeholder with the selected URL

- update gtktiledviewer to work with these

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

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 45f059a73d7d..fbba1847078a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -6093,9 +6093,9 @@ static void 
doc_sendContentControlEvent(LibreOfficeKitDocument* pThis, const cha
 }
 
 // Sanity check
-if (aMap.find("type") == aMap.end() || aMap.find("selected") == aMap.end())
+if (aMap.find("type") == aMap.end())
 {
-SetLastExceptionMsg("Wrong arguments for sendContentControlEvent");
+SetLastExceptionMsg("Missing 'type' argument for 
sendContentControlEvent");
 return;
 }
 
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 3140e121151d..827856c3ebeb 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -812,14 +812,18 @@ public:
  *
  * @param pArguments arguments of the event.
  *
- * Example argument string:
- *
+ * Examples:
+ * To select the 3rd list item of the drop-down:
  * {
  * "type": "drop-down",
  * "selected": "2"
  * }
  *
- * selects the 3rd list item of the drop-down.
+ * To change a picture place-holder:
+ * {
+ * "type": "picture",
+ * "changed": "file:///path/to/test.png"
+ * }
  */
 void sendContentControlEvent(const char* pArguments)
 {
diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h 
b/include/LibreOfficeKit/LibreOfficeKitEnums.h
index 05544b5473a5..339b0183f153 100644
--- a/include/LibreOfficeKit/LibreOfficeKitEnums.h
+++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h
@@ -799,15 +799,28 @@ typedef enum
 /**
  * Sends all information for displaying metadata for a text based content 
control.
  *
- * The payload example:
+ * Examples:
+ * Entered a rich text content control:
  * {
- *  "action": "show",
- *  "rectangles": "1418, 1694, 720, 551; 10291, 1418, 1099, 275"
+ * "action": "show",
+ * "rectangles": "1418, 1694, 720, 551; 10291, 1418, 1099, 275"
  * }
  *
- * or
+ * Left a rich text content control:
+ * {
+ * "action": "hide"
+ * }
+ *
+ * Entered a dropdown content control:
+ * {
+ * "action": "show",
+ * "rectangles": "...",
+ * "items": ["red", "green", "blue"]
+ * }
+ *
+ * Clicked on a picture content control's placeholder:
  * {
- *  "action": "hide"
+ * "action": "change-picture"
  * }
  */
 LOK_CALLBACK_CONTENT_CONTROL = 55,
diff --git a/libreofficekit/source/gtk/lokdocview.cxx 
b/libreofficekit/source/gtk/lokdocview.cxx
index aafaa084be9c..39f2281b0c7d 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -1397,9 +1397,9 @@ callback (gpointer pData)
 
 case LOK_CALLBACK_CONTENT_CONTROL:
 {
-std::stringstream aStream(pCallback->m_aPayload);
+std::stringstream aPayloadStream(pCallback->m_aPayload);
 boost::property_tree::ptree aTree;
-boost::property_tree::read_json(aStream, aTree);
+boost::property_tree::read_json(aPayloadStream, aTree);
 auto aAction = aTree.get("action");
 if (aAction == "show")
 {
@@ -1410,6 +1410,29 @@ callback (gpointer pData)
 {
 priv->m_aContentControlRectangles.clear();
 }
+else if (aAction == "change-picture")
+{
+GtkWidget* pDialog = gtk_file_chooser_dialog_new(
+"Open File", 
GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(pDocView))),
+GTK_FILE_CHOOSER_ACTION_OPEN, "Cancel", GTK_RESPONSE_CANCEL, 
"Open",
+GTK_RESPONSE_ACCEPT, nullptr);
+ 

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

2022-05-23 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/itiff/itiff.cxx |   44 +-
 1 file changed, 34 insertions(+), 10 deletions(-)

New commits:
commit 95567d6175bccd45f8f954d3b329f73a73a7b8bf
Author: Caolán McNamara 
AuthorDate: Mon May 23 10:47:03 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 23 18:15:53 2022 +0200

crashtesting: we can have negative skew

which is used to fill rows backwards

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

diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index cb512d58577d..90c7bf5f3422 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -53,20 +53,42 @@ namespace
 {
 }
 
-void SetPixels(uint32_t x, uint32_t y, uint32_t w, uint32_t h, 
uint32_t skew)
+uint32_t* GetBuffer(uint32_t w, uint32_t h, int32_t toskew)
 {
-const uint32_t* pSrc = aBuffer.data();
+uint32_t nExtraPerRow;
+if (toskew >= 0)
+nExtraPerRow = toskew;
+else
+{
+int32_t nExtraNeg = w + toskew + w;
+nExtraPerRow = std::abs(nExtraNeg);
+}
+uint32_t nScanLine = w + nExtraPerRow;
+aBuffer.resize(nScanLine * h);
+uint32_t* pBuffer = aBuffer.data();
+if (toskew < 0)
+pBuffer += h * nScanLine - nScanLine;
+
+return pBuffer;
+}
 
+void SetPixels(uint32_t x, uint32_t y, uint32_t w, uint32_t h, const 
uint32_t* pSrc, int32_t skew)
+{
+uint32_t nDestRow = y;
 for (uint32_t nRow = 0; nRow < h; ++nRow)
 {
 for (uint32_t nCol = 0; nCol < w; ++nCol)
 {
-pWriteAccess->SetPixel(y + nRow, x + nCol,
+pWriteAccess->SetPixel(nDestRow, x + nCol,
 Color(TIFFGetR(*pSrc), TIFFGetG(*pSrc), 
TIFFGetB(*pSrc)));
-pAlphaAccess->SetPixelIndex(y + nRow, x + nCol, 255 - 
TIFFGetA(*pSrc));
+pAlphaAccess->SetPixelIndex(nDestRow, x + nCol, 255 - 
TIFFGetA(*pSrc));
 ++pSrc;
 }
 pSrc += skew;
+if (skew >= 0)
+++nDestRow;
+else
+--nDestRow;
 }
 }
 };
@@ -125,11 +147,12 @@ static void putContigPixel(TIFFRGBAImage* img, uint32_t* 
/*raster*/,
 {
 Context* pContext = static_cast(TIFFClientdata(img->tif));
 
-pContext->aBuffer.resize((w + toskew) * h);
-(pContext->pOrigContig)(img, pContext->aBuffer.data(), 0, 0, w, h,
+uint32_t* pBuffer = pContext->GetBuffer(w, h, toskew);
+
+(pContext->pOrigContig)(img, pBuffer, 0, 0, w, h,
 fromskew, toskew, cp);
 
-pContext->SetPixels(x, y, w, h, toskew);
+pContext->SetPixels(x, y, w, h, pBuffer, toskew);
 }
 
 static void putSeparatePixel(TIFFRGBAImage* img, uint32_t* /*raster*/,
@@ -139,11 +162,12 @@ static void putSeparatePixel(TIFFRGBAImage* img, 
uint32_t* /*raster*/,
 {
 Context* pContext = static_cast(TIFFClientdata(img->tif));
 
-pContext->aBuffer.resize((w + toskew) * h);
-(pContext->pOrigSeparate)(img, pContext->aBuffer.data(), 0, 0, w, h,
+uint32_t* pBuffer = pContext->GetBuffer(w, h, toskew);
+
+(pContext->pOrigSeparate)(img, pBuffer, 0, 0, w, h,
   fromskew, toskew, r, g, b, a);
 
-pContext->SetPixels(x, y, w, h, toskew);
+pContext->SetPixels(x, y, w, h, pBuffer, toskew);
 }
 
 bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& rGraphic)


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

2022-05-23 Thread Caolán McNamara (via logerrit)
 vcl/source/filter/itiff/itiff.cxx |   40 --
 1 file changed, 38 insertions(+), 2 deletions(-)

New commits:
commit daac48d510a64cfc2ca12a35ee6f54262c8e77dc
Author: Caolán McNamara 
AuthorDate: Mon May 23 11:57:17 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 23 18:16:10 2022 +0200

tiff: reverse row pixels for ORIENTATION_LEFTBOT

and rotate

e.g. novell600797-1.tiff

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

diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index 90c7bf5f3422..292621ed0b83 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -36,6 +36,17 @@ namespace
 {
 SvStream& rStream;
 tsize_t nSize;
+/*
+ORIENTATION_TOPLEFT = 1
+ORIENTATION_TOPRIGHT = 2
+ORIENTATION_BOTRIGHT = 3
+ORIENTATION_BOTLEFT = 4
+ORIENTATION_LEFTTOP = 5
+ORIENTATION_RIGHTTOP = 6
+ORIENTATION_RIGHTBOT = 7
+ORIENTATION_LEFTBOT = 8
+ */
+uint16_t nOrientation;
 
 tileContigRoutine pOrigContig;
 tileSeparateRoutine pOrigSeparate;
@@ -46,6 +57,7 @@ namespace
 Context(SvStream& rInStream, tsize_t nInSize)
 : rStream(rInStream)
 , nSize(nInSize)
+, nOrientation(0)
 , pOrigContig(nullptr)
 , pOrigSeparate(nullptr)
 , pWriteAccess(nullptr)
@@ -79,9 +91,20 @@ namespace
 {
 for (uint32_t nCol = 0; nCol < w; ++nCol)
 {
-pWriteAccess->SetPixel(nDestRow, x + nCol,
+uint32_t nDestCol;
+switch (nOrientation)
+{
+case ORIENTATION_LEFTBOT:
+nDestCol = x + w - 1 - nCol;
+break;
+default:
+nDestCol = x + nCol;
+break;
+}
+
+pWriteAccess->SetPixel(nDestRow, nDestCol,
 Color(TIFFGetR(*pSrc), TIFFGetG(*pSrc), 
TIFFGetB(*pSrc)));
-pAlphaAccess->SetPixelIndex(nDestRow, x + nCol, 255 - 
TIFFGetA(*pSrc));
+pAlphaAccess->SetPixelIndex(nDestRow, nDestCol, 255 - 
TIFFGetA(*pSrc));
 ++pSrc;
 }
 pSrc += skew;
@@ -205,6 +228,9 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& 
rGraphic)
 break;
 }
 
+aContext.nOrientation = 0;
+TIFFGetField(tif, TIFFTAG_ORIENTATION, &aContext.nOrientation);
+
 Bitmap bitmap(Size(w, h), vcl::PixelFormat::N24_BPP);
 AlphaMask bitmapAlpha(Size(w, h));
 
@@ -255,6 +281,16 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& 
rGraphic)
 if (bOk)
 {
 BitmapEx aBitmapEx(bitmap, bitmapAlpha);
+
+switch (aContext.nOrientation)
+{
+case ORIENTATION_LEFTBOT:
+aBitmapEx.Rotate(2700_deg10, COL_BLACK);
+break;
+default:
+break;
+}
+
 AnimationBitmap aAnimationBitmap(aBitmapEx, Point(0, 0), 
aBitmapEx.GetSizePixel(),
  ANIMATION_TIMEOUT_ON_CLICK, 
Disposal::Back);
 aAnimation.Insert(aAnimationBitmap);


[Libreoffice-commits] core.git: external/libtiff

2022-05-23 Thread Julien Nabet (via logerrit)
 external/libtiff/README |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit a14d8acb93717b958598421590831e8a92fde27c
Author: Julien Nabet 
AuthorDate: Mon May 23 13:40:15 2022 +0200
Commit: Caolán McNamara 
CommitDate: Mon May 23 18:16:43 2022 +0200

README libtiff

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

diff --git a/external/libtiff/README b/external/libtiff/README
new file mode 100644
index ..a650ea584a6a
--- /dev/null
+++ b/external/libtiff/README
@@ -0,0 +1,3 @@
+libtiff is a library to encode and decode images in TIFF format, from 
[http://download.osgeo.org/libtiff/]
+
+For the moment we use it only for decoding part.


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

2022-05-23 Thread Stephan Bergmann (via logerrit)
 vcl/source/filter/itiff/itiff.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 728ff63903083f3bc4321e8fbbb2c1d4b1755a0c
Author: Stephan Bergmann 
AuthorDate: Mon May 23 14:57:18 2022 +0200
Commit: Caolán McNamara 
CommitDate: Mon May 23 18:17:10 2022 +0200

Bad hack to silence UBSan nullptr-with-offset

...since e912a446210fdae61be3fc04d20d90488cedcdf6 "tiff: use more 
complicated
apis to need a smaller buffer during read" in CppunitTest_vcl_filters_test,

> [_RUN_] TiffFilterTest::testCVEs
[...]
> tif_getimage.c:998:21: runtime error: applying zero offset to null pointer
> #0 0x7f487da9d408 in gtStripContig 
/workdir/UnpackedTarball/libtiff/libtiff/tif_getimage.c:998:21
> #1 0x7f487da97c27 in TIFFRGBAImageGet 
/workdir/UnpackedTarball/libtiff/libtiff/tif_getimage.c:512:12
> #2 0x7f487bd1a56c in ImportTiffGraphicImport(SvStream&, Graphic&) 
/vcl/source/filter/itiff/itiff.cxx:219:19
> #3 0x7f485d820126 in TiffFilterTest::load(rtl::OUString const&, 
rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, 
SotClipboardFormatId, unsigned int) 
/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx:70:12
> #4 0x7f485a49ffa0 in 
test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString const&, 
rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, 
SotClipboardFormatId, unsigned int, bool) 
/unotest/source/cpp/filters-test.cxx:132:20
> #5 0x7f485a4a3a52 in test::FiltersTest::testDir(rtl::OUString const&, 
std::basic_string_view >, rtl::OUString 
const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) 
/unotest/source/cpp/filters-test.cxx:157:5
> #6 0x7f485d8206f9 in TiffFilterTest::testCVEs() 
/vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx:76:5

().

(If UBSan or some other tool starts to flag this too, we'll probably need to
pass in a nullptr after all and teach libtiff to treat that case specially 
and
not advance it.)

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

diff --git a/vcl/source/filter/itiff/itiff.cxx 
b/vcl/source/filter/itiff/itiff.cxx
index 292621ed0b83..9f51e28df0a9 100644
--- a/vcl/source/filter/itiff/itiff.cxx
+++ b/vcl/source/filter/itiff/itiff.cxx
@@ -267,7 +267,14 @@ bool ImportTiffGraphicImport(SvStream& rTIFF, Graphic& 
rGraphic)
 img.put.separate = putSeparatePixel;
 }
 
-bOk = TIFFRGBAImageGet(&img, nullptr, w, img.height);
+bOk = TIFFRGBAImageGet(
+&img, reinterpret_cast(sizeof (uint32_t)), w, 
img.height);
+// we don't access TIFFRGBAImageGet's raster argument in our 
custom putContigPixel/
+// putSeparatePixel functions, but TIFFRGBAImageGet 
nevertheless internally
+// advances that pointer, so passing nullptr would cause UBSan 
nullptr-with-offset
+// errors; while technically still UB, this HACK of passing a 
non-null pointer keeps
+// UBSan happy for now (and better use an artificial pointer 
value which would
+// hopefully cause SIGSEGV if it should erroneously be 
dereferenced after all)
 TIFFRGBAImageEnd(&img);
 }
 else


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

2022-05-23 Thread Noel Grandin (via logerrit)
 sfx2/source/appl/appuno.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit d850510bae778afb788f7d5d48a418858686ea46
Author: Noel Grandin 
AuthorDate: Mon May 23 11:03:53 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 18:48:06 2022 +0200

use std::move to avoid some object allocation

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

diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 1c4994f93929..6c75faa21977 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -208,7 +208,7 @@ void TransformParameters( sal_uInt16 nSlotId, const 
uno::SequencePutValue( rProp.Value, bConvertTwips ? CONVERT_TWIPS : 
0 ) )
 // only use successfully converted items
-rSet.Put( *pItem );
+rSet.Put( std::move(pItem) );
 else
 {
 SAL_WARN( "sfx", "Property not convertible: " << 
pSlot->pUnoName );
@@ -304,7 +304,7 @@ void TransformParameters( sal_uInt16 nSlotId, const 
uno::SequencePutValue( pProp->Value, 0 ) )
 // only use successfully converted items
-rSet.Put( *pItem );
+rSet.Put( std::move(pItem) );
 else
 {
 SAL_WARN( "sfx", "Property not convertible: " << 
rArg.pName );
@@ -326,7 +326,7 @@ void TransformParameters( sal_uInt16 nSlotId, const 
uno::SequencePutValue( rProp.Value, 0 ) )
 // only use successfully converted items
-rSet.Put( *pItem );
+rSet.Put( std::move(pItem) );
 else
 {
 SAL_WARN( "sfx", "Property not convertible: " << 
rArg.pName );


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

2022-05-23 Thread Noel Grandin (via logerrit)
 ucb/source/ucp/file/filtask.cxx |9 +
 ucb/source/ucp/file/filtask.hxx |   15 ---
 2 files changed, 9 insertions(+), 15 deletions(-)

New commits:
commit 86c95d195dfb1af7511cc0e70a93de9813284855
Author: Noel Grandin 
AuthorDate: Mon May 23 11:05:10 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 18:48:25 2022 +0200

std::unordered_set->o3tl::sorted_vector in TaskManager

avoids repeated allocation

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

diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index 122ad052618c..7c87f5652be7 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -539,7 +539,7 @@ TaskManager::associate( const OUString& aUnqPath,
 beans::PropertyState_DEFAULT_VALUE,
 Attributes );
 
-TaskManager::PropertySet::iterator it1 = m_aDefaultProperties.find( 
newProperty );
+auto it1 = m_aDefaultProperties.find( newProperty );
 if( it1 != m_aDefaultProperties.end() )
 throw beans::PropertyExistException( THROW_WHERE );
 
@@ -570,7 +570,7 @@ TaskManager::deassociate( const OUString& aUnqPath,
 {
 MyProperty oldProperty( PropertyName );
 
-TaskManager::PropertySet::iterator it1 = m_aDefaultProperties.find( 
oldProperty );
+auto it1 = m_aDefaultProperties.find( oldProperty );
 if( it1 != m_aDefaultProperties.end() )
 throw beans::NotRemoveableException( THROW_WHERE );
 
@@ -845,7 +845,7 @@ TaskManager::setv( const OUString& aUnqPath,
 
 TaskManager::ContentMap::iterator it = m_aContent.find( aUnqPath );
 PropertySet& properties = it->second.properties;
-TaskManager::PropertySet::iterator it1;
+TaskManager::PropertySet::const_iterator it1;
 uno::Any aAny;
 
 for( sal_Int32 i = 0; i < values.getLength(); ++i )
@@ -1934,6 +1934,7 @@ void TaskManager::insertDefaultProperties( const 
OUString& aUnqPath )
 PropertySet& properties = it->second.properties;
 bool ContentNotDefau = properties.find( ContentTProperty ) != 
properties.end();
 
+properties.reserve(properties.size() + m_aDefaultProperties.size());
 for (auto const& defaultprop : m_aDefaultProperties)
 {
 if( !ContentNotDefau || defaultprop.getPropertyName() != ContentType )
@@ -2243,7 +2244,7 @@ void
 TaskManager::commit( const TaskManager::ContentMap::iterator& it,
const osl::FileStatus& aFileStatus )
 {
-TaskManager::PropertySet::iterator it1;
+TaskManager::PropertySet::const_iterator it1;
 
 if( it->second.properties.empty() )
 {
diff --git a/ucb/source/ucp/file/filtask.hxx b/ucb/source/ucp/file/filtask.hxx
index 3fa4b85752ed..c7199159fb44 100644
--- a/ucb/source/ucp/file/filtask.hxx
+++ b/ucb/source/ucp/file/filtask.hxx
@@ -18,6 +18,7 @@
  */
 #pragma once
 
+#include 
 #include 
 #include 
 
@@ -186,23 +187,15 @@ namespace fileaccess
 inline void setState( const css::beans::PropertyState& theState ) 
const;
 };
 
-struct eMyProperty
+struct MyPropertyLess
 {
 bool operator()( const MyProperty& rKey1, const MyProperty& rKey2 
) const
 {
-return rKey1.getPropertyName() == rKey2.getPropertyName();
+return rKey1.getPropertyName() < rKey2.getPropertyName();
 }
 };
 
-struct hMyProperty
-{
-size_t operator()( const MyProperty& rName ) const
-{
-return rName.getPropertyName().hashCode();
-}
-};
-
-typedef std::unordered_set< MyProperty,hMyProperty,eMyProperty > 
PropertySet;
+typedef o3tl::sorted_vector< MyProperty, MyPropertyLess > PropertySet;
 
 class UnqPathData
 {


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

2022-05-23 Thread Noel Grandin (via logerrit)
 filter/source/config/cache/basecontainer.cxx |6 +-
 filter/source/config/cache/cacheitem.cxx |   12 ++--
 filter/source/config/cache/cacheitem.hxx |6 +++---
 filter/source/config/cache/filtercache.cxx   |4 ++--
 filter/source/config/cache/filtercache.hxx   |6 +++---
 filter/source/config/cache/filterfactory.cxx |   10 --
 filter/source/config/cache/typedetection.cxx |   14 +++---
 7 files changed, 26 insertions(+), 32 deletions(-)

New commits:
commit 41bbc62f38b9eac97c03dc5a7e706fa6aaff055c
Author: Noel Grandin 
AuthorDate: Mon May 23 11:26:07 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 18:48:42 2022 +0200

elide allocation of CacheItem when enumerating filters

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

diff --git a/filter/source/config/cache/basecontainer.cxx 
b/filter/source/config/cache/basecontainer.cxx
index 6f9491eeaac1..c5c9ff939443 100644
--- a/filter/source/config/cache/basecontainer.cxx
+++ b/filter/source/config/cache/basecontainer.cxx
@@ -362,14 +362,10 @@ css::uno::Reference< css::container::XEnumeration > 
SAL_CALL BaseContainer::crea
 
 try
 {
-// convert the given properties first to our internal representation
-CacheItem lProps;
-lProps << lProperties;
-
 // search the key names of all items, where its properties match
 // the given ones in its minimum
 FilterCache* pCache = impl_getWorkingCache();
-lKeys = pCache->getMatchingItemsByProps(m_eType, lProps);
+lKeys = pCache->getMatchingItemsByProps(m_eType, o3tl::span( lProperties.getConstArray(), lProperties.getLength() 
));
 }
 catch(const css::uno::Exception&)
 {
diff --git a/filter/source/config/cache/cacheitem.cxx 
b/filter/source/config/cache/cacheitem.cxx
index dc28b5471d55..595d3891aa7d 100644
--- a/filter/source/config/cache/cacheitem.cxx
+++ b/filter/source/config/cache/cacheitem.cxx
@@ -263,19 +263,19 @@ static bool isSubSet(const css::uno::Any& aSubSet,
 }
 
 
-bool CacheItem::haveProps(const CacheItem& lProps) const
+bool CacheItem::haveProps(o3tl::span< const css::beans::NamedValue > lProps) 
const
 {
 for (auto const& prop : lProps)
 {
 // i) one required property does not exist at this item => return false
-const_iterator pItThis = find(prop.first);
+const_iterator pItThis = find(prop.Name);
 if (pItThis == end())
 {
 return false;
 }
 
 // ii) one item does not have the right value => return false
-if (!isSubSet(prop.second, pItThis->second))
+if (!isSubSet(prop.Value, pItThis->second))
 {
 return false;
 }
@@ -288,7 +288,7 @@ bool CacheItem::haveProps(const CacheItem& lProps) const
 }
 
 
-bool CacheItem::dontHaveProps(const CacheItem& lProps) const
+bool CacheItem::dontHaveProps(o3tl::span< const css::beans::NamedValue > 
lProps) const
 {
 for (auto const& prop : lProps)
 {
@@ -296,7 +296,7 @@ bool CacheItem::dontHaveProps(const CacheItem& lProps) const
 //=> continue with next one, because
 //"excluding" means... "don't have it".
 //And "not exists" matches to "don't have it".
-const_iterator pItThis = find(prop.first);
+const_iterator pItThis = find(prop.Name);
 if (pItThis == end())
 {
 continue;
@@ -305,7 +305,7 @@ bool CacheItem::dontHaveProps(const CacheItem& lProps) const
 // ii) one item have the right value => return false
 // because this item has the requested property...
 // But we checked for "don't have it" here.
-if (isSubSet(prop.second, pItThis->second))
+if (isSubSet(prop.Value, pItThis->second))
 {
 return false;
 }
diff --git a/filter/source/config/cache/cacheitem.hxx 
b/filter/source/config/cache/cacheitem.hxx
index 965bf7a40126..b20bf72c805c 100644
--- a/filter/source/config/cache/cacheitem.hxx
+++ b/filter/source/config/cache/cacheitem.hxx
@@ -24,7 +24,7 @@
 #include 
 #include 
 #include 
-
+#include 
 
 namespace filter::config {
 
@@ -74,7 +74,7 @@ class CacheItem : public ::comphelper::SequenceAsHashMap
 @return sal_True if all given properties exists
 at this item; sal_False otherwise.
  */
-bool haveProps(const CacheItem& lProps) const;
+bool haveProps(o3tl::span< const css::beans::NamedValue > lProps) 
const;
 
 
 /** @short  check, if the given properties don't exist
@@ -90,7 +90,7 @@ class CacheItem : public ::comphelper::SequenceAsHashMap
 @return sal_False if at least on property exists at this item(!);
 sal_True otherwise.
  */
-bool dontHaveProps(const CacheItem& lProps) const;
+bool dontHaveProps

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

2022-05-23 Thread Andrea Gelmini (via logerrit)
 connectivity/source/drivers/dbase/dindexnode.cxx |2 +-
 sw/source/uibase/shells/basesh.cxx   |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2106dff67921ba9d8555bee285f55a4157662d33
Author: Andrea Gelmini 
AuthorDate: Mon May 23 11:53:10 2022 +0200
Commit: Julien Nabet 
CommitDate: Mon May 23 19:26:48 2022 +0200

Fix typos

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

diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx 
b/connectivity/source/drivers/dbase/dindexnode.cxx
index 422fef11ce20..3ac8b806499b 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -482,7 +482,7 @@ void ONDXPage::Merge(sal_uInt16 nParentNodePos, const 
ONDXPagePtr& xPage)
nMaxNodes_2 = nMaxNodes / 2;
 
 // Determine if page is right or left neighbour
-boolbRight= ((*xPage)[0].GetKey() > (*this)[0].GetKey()); // 
sal_True, whenn xPage the right side is
+boolbRight= ((*xPage)[0].GetKey() > (*this)[0].GetKey()); // true 
when xPage is at the right side
 sal_uInt16  nNewCount = (*xPage).Count() + Count();
 
 if (IsLeaf())
diff --git a/sw/source/uibase/shells/basesh.cxx 
b/sw/source/uibase/shells/basesh.cxx
index e63384824b43..4792e0af9f09 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -1903,7 +1903,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
 break;
 case FN_FRAME_WRAP_CONTOUR:
 bDisable |= bHtmlMode;
-//no contour available whenn no wrap or wrap 
through is set
+//no contour available when no wrap or wrap 
through is set
 bDisable |= (nSurround == 
css::text::WrapTextMode_NONE || nSurround == css::text::WrapTextMode_THROUGH);
 if( !bDisable )
 {


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

2022-05-23 Thread Caolán McNamara (via logerrit)
 vcl/unx/gtk3/gtkinst.cxx |   11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 97d90a9da36965f4f50293d50c8b2e5e043d3d9a
Author: Caolán McNamara 
AuthorDate: Mon May 23 12:23:22 2022 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 23 20:12:10 2022 +0200

gtk: fix leak in treeview tooltip

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

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index bc2fbc8a5c1f..481bb8b573f7 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -14077,12 +14077,13 @@ private:
 return false;
 #endif
 OUString aTooltip = 
pThis->signal_query_tooltip(GtkInstanceTreeIter(iter));
-if (aTooltip.isEmpty())
-return false;
-gtk_tooltip_set_text(tooltip, OUStringToOString(aTooltip, 
RTL_TEXTENCODING_UTF8).getStr());
-gtk_tree_view_set_tooltip_row(pTreeView, tooltip, pPath);
+if (!aTooltip.isEmpty())
+{
+gtk_tooltip_set_text(tooltip, OUStringToOString(aTooltip, 
RTL_TEXTENCODING_UTF8).getStr());
+gtk_tree_view_set_tooltip_row(pTreeView, tooltip, pPath);
+}
 gtk_tree_path_free(pPath);
-return true;
+return !aTooltip.isEmpty();
 }
 
 void last_child(GtkTreeModel* pModel, GtkTreeIter* result, GtkTreeIter* 
pParent, int nChildren) const


[Libreoffice-commits] core.git: sal/osl

2022-05-23 Thread Noel Grandin (via logerrit)
 sal/osl/unx/file.cxx  |   47 --
 sal/osl/unx/file_impl.hxx |2 -
 2 files changed, 26 insertions(+), 23 deletions(-)

New commits:
commit 476b1fa176f00ec8128ae72b48dfde11096ed85a
Author: Noel Grandin 
AuthorDate: Mon May 23 18:47:15 2022 +0200
Commit: Noel Grandin 
CommitDate: Mon May 23 20:14:33 2022 +0200

Revert "[API CHANGE] call ftruncate instead of ftruncate_by_name"

This reverts commit 1d58828f2285064635ed776e0641e83ee26d34da.

because we need the filename for "sandboxed LibreOffice on OS X" 
functionality

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

diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index caa7f5dd57e9..ac93ffacd13f 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -82,6 +82,7 @@ namespace {
 struct FileHandle_Impl
 {
 pthread_mutex_t m_mutex;
+OString m_strFilePath; /*< holds native file path */
 int m_fd;
 
 enum Kind
@@ -108,7 +109,7 @@ struct FileHandle_Impl
 rtl_String*  m_memstreambuf; /*< used for in-memory streams */
 #endif
 
-explicit FileHandle_Impl(int fd, Kind kind = KIND_FD);
+explicit FileHandle_Impl(int fd, Kind kind = KIND_FD, OString path = 
"");
 ~FileHandle_Impl();
 
 static size_t getpagesize();
@@ -181,8 +182,9 @@ FileHandle_Impl::Guard::~Guard()
 (void) pthread_mutex_unlock(m_mutex);
 }
 
-FileHandle_Impl::FileHandle_Impl(int fd, enum Kind kind)
-: m_fd  (fd),
+FileHandle_Impl::FileHandle_Impl(int fd, enum Kind kind, OString path)
+: m_strFilePath(std::move(path)),
+  m_fd  (fd),
   m_kind(kind),
   m_state   (State::Seekable | State::Readable),
   m_size(0),
@@ -242,7 +244,7 @@ sal_uInt64 FileHandle_Impl::getSize() const
 oslFileError FileHandle_Impl::setSize(sal_uInt64 uSize)
 {
 off_t const nSize = sal::static_int_cast< off_t >(uSize);
-if (ftruncate(m_fd, nSize) == -1)
+if (ftruncate_with_name(m_fd, nSize, m_strFilePath) == -1)
 {
 /* Failure. Save original result. Try fallback algorithm */
 oslFileError result = oslTranslateFileError(errno);
@@ -730,12 +732,12 @@ oslFileHandle osl::detail::createFileHandleFromFD(int fd)
 pImpl->m_size = sal::static_int_cast< sal_uInt64 >(aFileStat.st_size);
 }
 
-SAL_INFO("sal.file", "osl::detail::createFileHandleFromFD(" << pImpl->m_fd 
<< ", writeable)");
+SAL_INFO("sal.file", "osl::detail::createFileHandleFromFD(" << pImpl->m_fd 
<< ", writeable) => " << pImpl->m_strFilePath);
 
 return static_cast(pImpl);
 }
 
-static int osl_file_adjustLockFlags(const char* cpPath, int flags)
+static int osl_file_adjustLockFlags(const OString& path, int flags)
 {
 #ifdef MACOSX
 /*
@@ -746,7 +748,7 @@ static int osl_file_adjustLockFlags(const char* cpPath, int 
flags)
  * for the filesystem name.
  */
 struct statfs s;
-if(statfs(cpPath, &s) >= 0)
+if(statfs(path.getStr(), &s) >= 0)
 {
 if(strncmp("afpfs", s.f_fstypename, 5) == 0)
 {
@@ -760,7 +762,7 @@ static int osl_file_adjustLockFlags(const char* cpPath, int 
flags)
 }
 }
 #else
-(void) cpPath;
+(void) path;
 #endif
 
 return flags;
@@ -796,12 +798,13 @@ static bool osl_file_queryLocking(sal_uInt32 uFlags)
 namespace {
 
 static oslFileError openMemoryAsFile(const OString &rData,
- oslFileHandle *pHandle)
+ oslFileHandle *pHandle,
+ const OString& path)
 {
 const char *address = rData.getStr();
 size_t size = rData.getLength();
 
-FileHandle_Impl *pImpl = new FileHandle_Impl(-1, 
FileHandle_Impl::KIND_MEM);
+FileHandle_Impl *pImpl = new FileHandle_Impl(-1, 
FileHandle_Impl::KIND_MEM, path);
 pImpl->m_size = sal::static_int_cast< sal_uInt64 >(size);
 
 *pHandle = (oslFileHandle)(pImpl);
@@ -871,7 +874,7 @@ private:
 
 #endif
 
-oslFileError openFilePath(const char* cpFilePath, oslFileHandle* pHandle,
+oslFileError openFilePath(const OString& filePath, oslFileHandle* pHandle,
   sal_uInt32 uFlags, mode_t mode)
 {
 oslFileError eRet;
@@ -880,16 +883,16 @@ oslFileError openFilePath(const char* cpFilePath, 
oslFileHandle* pHandle,
 /* Opening a file from /assets read-only means
  * we should mmap it from the .apk file
  */
-if (o3tl::starts_with(cpFilePath, "/assets/"))
+if (o3tl::starts_with(filePath, "/assets/"))
 {
 OString aData;
 bool bCache = true;
 
-const char *cpAssetsPath = cpFilePath + sizeof("/assets/") - 1;
+const char *cpAssetsPath = filePath.getStr() + sizeof("/assets/") - 1;
 // some requests are /assets//foo...
 if (cpAssetsPath[0] == '/')
 {
-__android_log_print(ANDRO

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

2022-05-23 Thread Luboš Luňák (via logerrit)
 vcl/source/gdi/impglyphitem.cxx |   25 -
 1 file changed, 8 insertions(+), 17 deletions(-)

New commits:
commit 091e615912e123f9d714952b61e2d9b8ae48a043
Author: Luboš Luňák 
AuthorDate: Mon May 23 15:28:05 2022 +0200
Commit: Luboš Luňák 
CommitDate: Mon May 23 21:05:12 2022 +0200

don't use glyph subsets with complicated LTR/RTL setups

This should be a more generic solution for problems of some characters
having neutral direction (spaces, commas, etc.) and ending up with
different RTL flag depending on exactly what subset of the string
is wanted (e.g. a space on its own will end up treated as LRT but
if surrounded by RTL text then it'll be flagged as RTL too).
Previous attempts 5d02daa5198d5bff9234d5db698e934a5e31c95f
and 467f2c50a935efff6ff8911e7282ecea535665a3 still left some corner
cases, and it seems that simply requiring BiDiStrong and matching LTR/RTL
for this optimization covers the usual cases.

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

diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index a3ab689ff23e..ffed4d56c743 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -98,11 +98,18 @@ SalLayoutGlyphsImpl* 
SalLayoutGlyphsImpl::cloneCharRange(sal_Int32 index, sal_In
 copy->SetFlags(GetFlags());
 if (empty())
 return copy.release();
+bool rtl = front().IsRTLGlyph();
+// Avoid mixing LTR/RTL or layouts that do not have it set explicitly 
(BiDiStrong). Otherwise
+// the subset may not quite match what would a real layout call give (e.g. 
some characters with neutral
+// direction such as space might have different LTR/RTL flag). It seems 
bailing out here mostly
+// avoid relatively rare corner cases and doesn't matter for performance.
+if (!(GetFlags() & SalLayoutFlags::BiDiStrong)
+|| rtl != bool(GetFlags() & SalLayoutFlags::BiDiRtl))
+return nullptr;
 copy->reserve(std::min(size(), length));
 sal_Int32 beginPos = index;
 sal_Int32 endPos = index + length;
 const_iterator pos;
-bool rtl = front().IsRTLGlyph();
 if (rtl)
 {
 // Glyphs are in reverse order for RTL.
@@ -164,22 +171,6 @@ SalLayoutGlyphsImpl* 
SalLayoutGlyphsImpl::cloneCharRange(sal_Int32 index, sal_In
 if (!isSafeToBreak(pos, rtl))
 return nullptr;
 }
-// HACK: If mode is set to be RTL, but the last glyph is a non-RTL space,
-// then making a subset would give a different result than the actual 
layout,
-// because the weak BiDi mode code in ImplLayoutArgs ctor would interpret
-// the string subset ending with space as the space being RTL, but it would
-// treat it as non-RTL for the whole string if there would be more non-RTL
-// characters after the space. So bail out.
-if (GetFlags() & SalLayoutFlags::BiDiRtl && !rtl && !copy->empty() && 
copy->back().IsSpacing())
-{
-return nullptr;
-}
-// Similarly, if mode is not RTL but the last glyph is an RTL space.
-if (!(GetFlags() & SalLayoutFlags::BiDiRtl) && rtl && !copy->empty()
-&& copy->back().IsSpacing())
-{
-return nullptr;
-}
 return copy.release();
 }
 


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

2022-05-23 Thread Andrea Gelmini (via logerrit)
 vcl/source/window/dockwin.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 38751a8d5e07a448fe56c4602701f567538b139e
Author: Andrea Gelmini 
AuthorDate: Mon May 23 11:05:50 2022 +0200
Commit: Julien Nabet 
CommitDate: Mon May 23 21:24:44 2022 +0200

Removed duplicated include

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

diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index b799fbe6aad6..fb216913b803 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -36,8 +36,6 @@
 
 #include "impldockingwrapper.hxx"
 
-#include 
-
 #define DOCKWIN_FLOATSTYLES (WB_SIZEABLE | WB_MOVEABLE | WB_CLOSEABLE 
| WB_STANDALONE)
 
 class DockingWindow::ImplData


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

2022-05-23 Thread Stephan Bergmann (via logerrit)
 sw/source/filter/ww8/docxattributeoutput.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6f6d61ea5d7700fb18bfb49c6e1d16a55944e581
Author: Stephan Bergmann 
AuthorDate: Mon May 23 10:08:08 2022 +0200
Commit: Xisco Fauli 
CommitDate: Mon May 23 21:24:45 2022 +0200

tdf#149198 Fix use of nullptr

...which would have caused std::abort for non-production debug builds since
4f0c70fb5554325e0cc2129741175bf07de22029 "Avoid calling OString ctor with 
null
pointer", and started to erroneously pass a nullptr argument into a
std::string_view for all kinds of builds with
af16aa625682b649e8843237652b9246d519cbae "Improve loplugin:stringview"

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134758
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit c8d4ae2ad0cfdac770d897e7aca72fbb4a87765f, plus
follow-up f546767b4e9bf3de288ea50336cf1e15f1ee7435 "tdf#149198 Fix previous
fix")

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

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 6f8a24acd255..a6da6244898a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -3064,7 +3064,7 @@ void DocxAttributeOutput::WriteCollectedRunProperties()
 {
 const char* pVal = nullptr;
 m_pColorAttrList->getAsChar(FSNS(XML_w, XML_val), pVal);
-if (std::string_view("auto") != pVal)
+if (pVal == nullptr || std::string_view("auto") != pVal)
 {
 m_pSerializer->startElementNS(XML_w14, XML_textFill);
 m_pSerializer->startElementNS(XML_w14, XML_solidFill);


[Libreoffice-commits] core.git: external/libtiff

2022-05-23 Thread Stephan Bergmann (via logerrit)
 external/libtiff/UnpackedTarball_libtiff.mk |1 +
 external/libtiff/ubsan.patch|   11 +++
 2 files changed, 12 insertions(+)

New commits:
commit 91f408fd94cf38b27dcb26ced9cd6c4e1a9d1cd2
Author: Stephan Bergmann 
AuthorDate: Mon May 23 15:05:47 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 23 21:59:21 2022 +0200

external/libtiff: Silence invalid-null-argument

...during CppunitTest_vcl_filters_test,

> tif_dirread.c:4176:40: runtime error: null pointer passed as argument 2, 
which is declared to never be null
> /usr/include/string.h:44:28: note: nonnull attribute specified here
>  #0 in TIFFReadDirectory at 
workdir/UnpackedTarball/libtiff/libtiff/tif_dirread.c:4176:17 
(instdir/program/libvcllo.so +0xc4dbb6d)
>  #1 in ImportTiffGraphicImport(SvStream&, Graphic&) at 
vcl/source/filter/itiff/itiff.cxx:238:14 (instdir/program/libvcllo.so 
+0xa691680)
>  #2 in TiffFilterTest::load(rtl::OUString const&, rtl::OUString const&, 
rtl::OUString const&, SfxFilterFlags, SotClipboardFormatId, unsigned int) at 
vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx:70:12 
(workdir/LinkTarget/CppunitTest/libtest_vcl_filters_test.so +0x16dc48)
>  #3 in test::FiltersTest::recursiveScan(test::filterStatus, rtl::OUString 
const&, rtl::OUString const&, rtl::OUString const&, SfxFilterFlags, 
SotClipboardFormatId, unsigned int, bool) at 
unotest/source/cpp/filters-test.cxx:132:20 
(workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0xd8d5c)
>  #4 in test::FiltersTest::testDir(rtl::OUString const&, 
std::basic_string_view>, rtl::OUString 
const&, SfxFilterFlags, SotClipboardFormatId, unsigned int, bool) at 
unotest/source/cpp/filters-test.cxx:160:5 
(workdir/LinkTarget/CppunitTest/../Library/libunotest.so +0xdcc71)
>  #5 in TiffFilterTest::testCVEs() at 
vcl/qa/cppunit/graphicfilter/filters-tiff-test.cxx:76:5 
(workdir/LinkTarget/CppunitTest/libtest_vcl_filters_test.so +0x16e1c5)

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

diff --git a/external/libtiff/UnpackedTarball_libtiff.mk 
b/external/libtiff/UnpackedTarball_libtiff.mk
index ee3d4ab6cb27..f874d6d61743 100644
--- a/external/libtiff/UnpackedTarball_libtiff.mk
+++ b/external/libtiff/UnpackedTarball_libtiff.mk
@@ -16,6 +16,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libtiff,0))
 $(eval $(call gb_UnpackedTarball_add_patches,libtiff,\
 external/libtiff/libtiff.linknolibs.patch \
 external/libtiff/libtiff.16bitcielab.patch \
+external/libtiff/ubsan.patch \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/libtiff/ubsan.patch b/external/libtiff/ubsan.patch
new file mode 100644
index ..853d069ad795
--- /dev/null
+++ b/external/libtiff/ubsan.patch
@@ -0,0 +1,11 @@
+--- libtiff/tif_dirread.c
 libtiff/tif_dirread.c
+@@ -4173,7 +4173,7 @@
+ goto bad;
+ }
+ 
+-memcpy(new_sampleinfo, tif->tif_dir.td_sampleinfo, 
old_extrasamples * sizeof(uint16_t));
++if (old_extrasamples != 0) memcpy(new_sampleinfo, 
tif->tif_dir.td_sampleinfo, old_extrasamples * sizeof(uint16_t));
+ _TIFFsetShortArray(&tif->tif_dir.td_sampleinfo, 
new_sampleinfo, tif->tif_dir.td_extrasamples);
+ _TIFFfree(new_sampleinfo);
+ }


HarfBuzz 4.3 released. May be it's time to update it in LibreOffice? =)

2022-05-23 Thread Roman Kuznetsov
Hi.
The 4.3 version seems interesting with some speed improvements

https://github.com/harfbuzz/harfbuzz/releases/tag/4.3.0

May be someone can update HarfBuzz in LibreOffice to the 4.3 version?

ps: I would do it myself as Caolan did it in
6ebf46e332facfae5fd6027ec667ccd5993dd493 but I'm not sure if it needs some
additional .patch ...

Thanks
-- 
Best Regards, Roman Kuznetsov


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

2022-05-23 Thread Jim Raykowski (via logerrit)
 sw/source/uibase/utlui/glbltree.cxx |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit f817b3de1aa827d93e2a622735c4d570514f4849
Author: Jim Raykowski 
AuthorDate: Mon May 23 15:35:57 2022 -0800
Commit: Jim Raykowski 
CommitDate: Tue May 24 06:24:10 2022 +0200

tdf#149231 Fix crash on print preview of master

caused by commit 1f9a792a391f0811bbb5f570ad5c84d13312c539.

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

diff --git a/sw/source/uibase/utlui/glbltree.cxx 
b/sw/source/uibase/utlui/glbltree.cxx
index 7e044f64ad65..38abd661566c 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -773,7 +773,8 @@ void 
SwGlobalTree::ExecuteContextMenuAction(std::string_view rSelectedPopupEntry
 
 IMPL_LINK_NOARG(SwGlobalTree, Timeout, Timer *, void)
 {
-if (m_pActiveShell && m_pActiveShell->GetView().GetEditWin().HasFocus())
+SwView* pView = GetParentWindow()->GetCreateView();
+if (pView && pView->GetEditWin().HasFocus())
 {
 if (Update(false))
 Display();
@@ -877,14 +878,13 @@ bool SwGlobalTree::Update(bool bHard)
 bool bRet = false;
 if (pActView && pActView->GetWrtShellPtr())
 {
-SwWrtShell* pOldShell = m_pActiveShell;
+const SwWrtShell* pOldShell = m_pActiveShell;
 m_pActiveShell = pActView->GetWrtShellPtr();
 if(m_pActiveShell != pOldShell)
 {
-if (pOldShell)
-EndListening(*pOldShell->GetView().GetDocShell());
-StartListening(*m_pActiveShell->GetView().GetDocShell());
 m_pSwGlblDocContents.reset();
+if (!IsListening(*m_pActiveShell->GetView().GetDocShell()))
+StartListening(*m_pActiveShell->GetView().GetDocShell());
 }
 if(!m_pSwGlblDocContents)
 {


[Libreoffice-commits] core.git: svx/inc

2022-05-23 Thread Seth Chaiklin (via logerrit)
 svx/inc/swframeposstrings.hrc |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ac0163be9509d7e3f9761f904e853784f5e92867
Author: Seth Chaiklin 
AuthorDate: Tue May 24 03:13:00 2022 +0200
Commit: Mike Kaganski 
CommitDate: Tue May 24 08:05:22 2022 +0200

tdf#149252  adjust vertical/horizontal positioning labels for paragraphs

   The Position dialog for objects (shapes, images, frames, OLE objects)
   used "Margin" in the Vertical position dialog and "Paragraph area" in
   the Horizontal position dialog. They refer to the same region, so
   their labels are now unified as "Entire paragraph area", to
   differentiate it from "Paragraph text area", to better specify the
   nature of the region, and to make it more parallel to "Entire page"
   and "Entire frame" options.

   Only the labels are changed. No change to the underlying functionality.

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

diff --git a/svx/inc/swframeposstrings.hrc b/svx/inc/swframeposstrings.hrc
index fd9da2706ac9..23d98260caa9 100644
--- a/svx/inc/swframeposstrings.hrc
+++ b/svx/inc/swframeposstrings.hrc
@@ -33,7 +33,7 @@ const TranslateId RID_SVXSW_FRAMEPOSITIONS[] =
 NC_("RID_SVXSW_FRAMEPOSITIONS", "Inside"),
 NC_("RID_SVXSW_FRAMEPOSITIONS", "Outside"),
 NC_("RID_SVXSW_FRAMEPOSITIONS", "From inside"),
-NC_("RID_SVXSW_FRAMEPOSITIONS", "Paragraph area"),
+NC_("RID_SVXSW_FRAMEPOSITIONS", "Entire paragraph area"),
 NC_("RID_SVXSW_FRAMEPOSITIONS", "Paragraph text area"),
 NC_("RID_SVXSW_FRAMEPOSITIONS", "Left of page text area"),
 NC_("RID_SVXSW_FRAMEPOSITIONS", "Right of page text area"),
@@ -50,7 +50,7 @@ const TranslateId RID_SVXSW_FRAMEPOSITIONS[] =
 NC_("RID_SVXSW_FRAMEPOSITIONS", "Base line"),
 NC_("RID_SVXSW_FRAMEPOSITIONS", "Character"),
 NC_("RID_SVXSW_FRAMEPOSITIONS", "Row"),
-NC_("RID_SVXSW_FRAMEPOSITIONS", "Margin"),
+NC_("RID_SVXSW_FRAMEPOSITIONS", "Entire paragraph area"),
 NC_("RID_SVXSW_FRAMEPOSITIONS", "Paragraph text area"),
 NC_("RID_SVXSW_FRAMEPOSITIONS", "Left of frame text area"),
 NC_("RID_SVXSW_FRAMEPOSITIONS", "Right of frame text area"),


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

2022-05-23 Thread Noel Grandin (via logerrit)
 tools/source/fsys/urlobj.cxx |   33 +
 1 file changed, 13 insertions(+), 20 deletions(-)

New commits:
commit 967fa3b5e50968237d1734a158c209f47cf36295
Author: Noel Grandin 
AuthorDate: Mon May 23 17:20:01 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue May 24 08:07:10 2022 +0200

no need to call makeStringAndClear here

we are passing the OUStringBuffer to a method that takes a
u16string_view, which means makeStringAndClear() is wasted effort

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

diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 78c6d22af504..ad96d1eecf10 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -957,7 +957,7 @@ bool INetURLObject::setAbsURIRef(std::u16string_view 
rTheAbsURIRef,
PART_AUTHORITY, eCharset, false);
 }
 m_aHost.set(m_aAbsURIRef,
-aSynAuthority.makeStringAndClear(),
+aSynAuthority,
 m_aAbsURIRef.getLength());
 // misusing m_aHost to store the authority
 break;
@@ -993,7 +993,7 @@ bool INetURLObject::setAbsURIRef(std::u16string_view 
rTheAbsURIRef,
 return false;
 }
 m_aHost.set(m_aAbsURIRef,
-aSynAuthority.makeStringAndClear(),
+aSynAuthority,
 m_aAbsURIRef.getLength());
 // misusing m_aHost to store the authority
 }
@@ -1034,7 +1034,7 @@ bool INetURLObject::setAbsURIRef(std::u16string_view 
rTheAbsURIRef,
 else
 {
 m_aUser.set(m_aAbsURIRef,
-aSynUser.makeStringAndClear(),
+aSynUser,
 m_aAbsURIRef.getLength());
 m_aAbsURIRef.append("@");
 ++pPos;
@@ -1057,7 +1057,7 @@ bool INetURLObject::setAbsURIRef(std::u16string_view 
rTheAbsURIRef,
 return false;
 }
 m_aHost.set(m_aAbsURIRef,
-aSynAuthority.makeStringAndClear(),
+aSynAuthority,
 m_aAbsURIRef.getLength());
 // misusing m_aHost to store the authority
 break;
@@ -1341,8 +1341,7 @@ bool INetURLObject::setAbsURIRef(std::u16string_view 
rTheAbsURIRef,
 appendUCS4(aSynUser, nUTF32, eEscapeType, ePart,
eCharset, false);
 }
-m_aUser.set(m_aAbsURIRef, aSynUser.makeStringAndClear(),
-m_aAbsURIRef.getLength());
+m_aUser.set(m_aAbsURIRef, aSynUser, m_aAbsURIRef.getLength());
 if (bHasAuth)
 {
 if (bSupportsPassword)
@@ -1358,8 +1357,7 @@ bool INetURLObject::setAbsURIRef(std::u16string_view 
rTheAbsURIRef,
 appendUCS4(aSynAuth, nUTF32, eEscapeType,
ePart, eCharset, false);
 }
-m_aAuth.set(m_aAbsURIRef, aSynAuth.makeStringAndClear(),
-m_aAbsURIRef.getLength());
+m_aAuth.set(m_aAbsURIRef, aSynAuth, 
m_aAbsURIRef.getLength());
 }
 else
 {
@@ -1379,8 +1377,7 @@ bool INetURLObject::setAbsURIRef(std::u16string_view 
rTheAbsURIRef,
 appendUCS4(aSynAuth, nUTF32, eEscapeType,
ePart, eCharset, false);
 }
-m_aAuth.set(m_aAbsURIRef, aSynAuth.makeStringAndClear(),
-m_aAbsURIRef.getLength());
+m_aAuth.set(m_aAbsURIRef, aSynAuth, 
m_aAbsURIRef.getLength());
 }
 }
 if (pHostPortBegin)
@@ -1471,8 +1468,7 @@ bool INetURLObject::setAbsURIRef(std::u16string_view 
rTheAbsURIRef,
 appendUCS4(aSynQuery, nUTF32, eEscapeType,
PART_URIC, eCharset, true);
 }
-m_aQuery.set(m_aAbsURIRef, aSynQuery.makeStringAndClear(),
-m_aAbsURIRef.getLength());
+m_aQuery.set(m_aAbsURIRef, aSynQuery, m_aAbsURIRef.getLength());
 }
 
 // Parse #
@@ -1488,8 +1484,7 @@ bool INetURLObject::setAbsURIRef(std::u16string_view 
rTheAbsURIRef,
 appendUCS4(aSynFragment, nUTF32, eEscapeType, PART_URIC,
eCharset, true);
 }
-m_aFragment.set(m_aAbsURIRef, aSynFragment.makeStringAndClear(),
-m_aAbsURIRef.getLength());
+m_aFragment.set(m_aAbsURIRef, aSynFragment, m_aAbsURIRef.getLen

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

2022-05-23 Thread Noel Grandin (via logerrit)
 basic/source/basmgr/basicmanagerrepository.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 086e5347dcf71bab57c66afd23218ac08623b7ed
Author: Noel Grandin 
AuthorDate: Mon May 23 17:18:11 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue May 24 08:07:31 2022 +0200

elide OUString allocation

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

diff --git a/basic/source/basmgr/basicmanagerrepository.cxx 
b/basic/source/basmgr/basicmanagerrepository.cxx
index 0b34621bfcb8..aed39f9f2924 100644
--- a/basic/source/basmgr/basicmanagerrepository.cxx
+++ b/basic/source/basmgr/basicmanagerrepository.cxx
@@ -382,7 +382,7 @@ namespace basic
 try
 {
 // ensure there's a standard library in the basic container
-OUString aStdLibName( "Standard" );
+static constexpr OUStringLiteral aStdLibName( u"Standard" );
 if ( !_rxBasicLibraries->hasByName( aStdLibName ) )
 {
 _rxBasicLibraries->createLibrary( aStdLibName );


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

2022-05-23 Thread Noel Grandin (via logerrit)
 embeddedobj/source/commonembedding/embedobj.cxx |   72 +---
 embeddedobj/source/commonembedding/miscobj.cxx  |   36 
 embeddedobj/source/inc/commonembobj.hxx |2 
 3 files changed, 64 insertions(+), 46 deletions(-)

New commits:
commit c59ede12ff06f7c10670d9ea8a631b25237e9f02
Author: Noel Grandin 
AuthorDate: Mon May 23 17:18:32 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue May 24 08:07:49 2022 +0200

this data does not need to be per-object

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

diff --git a/embeddedobj/source/commonembedding/embedobj.cxx 
b/embeddedobj/source/commonembedding/embedobj.cxx
index 240112b2483e..0b1cb5785dac 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -48,6 +48,7 @@
 #include 
 #include "embedobj.hxx"
 #include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -71,6 +72,60 @@ awt::Rectangle GetRectangleInterception( const 
awt::Rectangle& aRect1, const awt
 return aResult;
 }
 
+namespace
+{
+using IntermediateStatesMap = std::array, NUM_SUPPORTED_STATES>, NUM_SUPPORTED_STATES>;
+const IntermediateStatesMap & getIntermediateStatesMap()
+{
+static const IntermediateStatesMap map = [] () {
+IntermediateStatesMap tmp;
+
+// intermediate states
+// In the following table the first index points to starting state,
+// the second one to the target state, and the sequence referenced 
by
+// first two indexes contains intermediate states, that should be
+// passed by object to reach the target state.
+// If the sequence is empty that means that indirect switch from 
start
+// state to the target state is forbidden, only if direct switch 
is possible
+// the state can be reached.
+
+tmp[0][2] = { embed::EmbedStates::RUNNING };
+
+tmp[0][3] = { embed::EmbedStates::RUNNING,
+
embed::EmbedStates::INPLACE_ACTIVE };
+
+tmp[0][4] = {embed::EmbedStates::RUNNING};
+
+tmp[1][3] = { embed::EmbedStates::INPLACE_ACTIVE };
+
+tmp[2][0] = { embed::EmbedStates::RUNNING };
+
+tmp[3][0] = { embed::EmbedStates::INPLACE_ACTIVE,
+embed::EmbedStates::RUNNING };
+
+tmp[3][1] = { embed::EmbedStates::INPLACE_ACTIVE };
+
+tmp[4][0] = { embed::EmbedStates::RUNNING };
+
+return tmp;
+}();
+return map;
+}
+
+// accepted states
+const css::uno::Sequence< sal_Int32 > & getAcceptedStates()
+{
+static const css::uno::Sequence< sal_Int32 > states {
+/* [0] */ embed::EmbedStates::LOADED,
+  /* [1] */ embed::EmbedStates::RUNNING,
+  /* [2] */ embed::EmbedStates::INPLACE_ACTIVE,
+  /* [3] */ embed::EmbedStates::UI_ACTIVE,
+  /* [4] */ embed::EmbedStates::ACTIVE };
+assert(states.getLength() == NUM_SUPPORTED_STATES);
+return states;
+}
+
+}
 
 sal_Int32 OCommonEmbeddedObject::ConvertVerbToState_Impl( sal_Int32 nVerb )
 {
@@ -389,27 +444,28 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 
nNextState )
 uno::Sequence< sal_Int32 > const & 
OCommonEmbeddedObject::GetIntermediateStatesSequence_Impl( sal_Int32 nNewState )
 {
 sal_Int32 nCurInd = 0;
-for ( nCurInd = 0; nCurInd < m_aAcceptedStates.getLength(); nCurInd++ )
-if ( m_aAcceptedStates[nCurInd] == m_nObjectState )
+auto & rAcceptedStates = getAcceptedStates();
+for ( nCurInd = 0; nCurInd < rAcceptedStates.getLength(); nCurInd++ )
+if ( rAcceptedStates[nCurInd] == m_nObjectState )
 break;
 
-if ( nCurInd == m_aAcceptedStates.getLength() )
+if ( nCurInd == rAcceptedStates.getLength() )
 throw embed::WrongStateException( "The object is in unacceptable 
state!",
   static_cast< ::cppu::OWeakObject* 
>(this) );
 
 sal_Int32 nDestInd = 0;
-for ( nDestInd = 0; nDestInd < m_aAcceptedStates.getLength(); nDestInd++ )
-if ( m_aAcceptedStates[nDestInd] == nNewState )
+for ( nDestInd = 0; nDestInd < rAcceptedStates.getLength(); nDestInd++ )
+if ( rAcceptedStates[nDestInd] == nNewState )
 break;
 
-if ( nDestInd == m_aAcceptedStates.getLength() )
+if ( nDestInd == rAcceptedStates.getLength() )
 throw embed::UnreachableStateException(
 "The state either not reachable, or the object allows the state 
only as an intermediate one!",
 static_cast< ::cppu::OWeakObject* >(this),
 m_nObjectState,
 nNewState );
 
-return m_p

[Libreoffice-commits] core.git: basic/source svx/source

2022-05-23 Thread Noel Grandin (via logerrit)
 basic/source/classes/sb.cxx  |2 +-
 svx/source/svdraw/presetooxhandleadjustmentrelations.cxx |   10 ++
 2 files changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 30f1ef51e59f00aad687b7b1f59592111feb1269
Author: Noel Grandin 
AuthorDate: Mon May 23 14:17:19 2022 +0200
Commit: Noel Grandin 
CommitDate: Tue May 24 08:08:07 2022 +0200

elide some OUString allocation

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

diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index def34b3718d6..570447246cf9 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1305,7 +1305,7 @@ SbxVariable* StarBASIC::Find( const OUString& rName, 
SbxClassType t )
 }
 }
 }
-OUString aMainStr("Main");
+static constexpr OUStringLiteral aMainStr(u"Main");
 if( !pRes && pNamed && ( t == SbxClassType::Method || t == 
SbxClassType::DontCare ) &&
 !pNamed->GetName().equalsIgnoreAsciiCase( aMainStr ) )
 {
diff --git a/svx/source/svdraw/presetooxhandleadjustmentrelations.cxx 
b/svx/source/svdraw/presetooxhandleadjustmentrelations.cxx
index 5e31fd3e6341..528c8b35cd50 100644
--- a/svx/source/svdraw/presetooxhandleadjustmentrelations.cxx
+++ b/svx/source/svdraw/presetooxhandleadjustmentrelations.cxx
@@ -25,7 +25,7 @@ struct HandleAdjRel
 // Shape name without leading "ooxml-", underscore, zero based handle index
 // e.g. The third handle in shape of type "ooxml-circularArrow" will be
 // identified by key "circularArrow_2"
-const OUString sShape_Handle;
+const char* sShape_Handle;
 
 // 4 tokens with separator "|"
 // first: RefX or RefR, na if not exists
@@ -35,13 +35,13 @@ struct HandleAdjRel
 // e.g. The third handle in shape  has in the preset
 // the tag  .
 // The resulting value in the map here is "RefR|adj5|na|na"
-const OUString sAdjReferences;
+const char* sAdjReferences;
 };
 
 // The array initializer has been extracted from
 // oox/source/drawingml/customshapes/presetShapeDefinitions.xml
 // by using an XSLT file. That file is attached to tdf#126512.
-const HandleAdjRel aHandleAdjRelArray[]
+constexpr HandleAdjRel aHandleAdjRelArray[]
 = { { "accentBorderCallout1_0", "RefX|adj2|RefY|adj1" },
 { "accentBorderCallout1_1", "RefX|adj4|RefY|adj3" },
 { "accentBorderCallout2_0", "RefX|adj2|RefY|adj1" },
@@ -308,8 +308,10 @@ void PresetOOXHandleAdj::GetOOXHandleAdjRelation(
 {
 static const HandleAdjRelHashMap s_HashMap = []() {
 HandleAdjRelHashMap aH;
+aH.reserve(std::size(aHandleAdjRelArray));
 for (const auto& item : aHandleAdjRelArray)
-aH[item.sShape_Handle] = item.sAdjReferences;
+aH.emplace(OUString::createFromAscii(item.sShape_Handle),
+   OUString::createFromAscii(item.sAdjReferences));
 return aH;
 }();
 


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

2022-05-23 Thread Miklos Vajna (via logerrit)
 sw/source/filter/html/htmlplug.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit e7fd5af6f65d17cbb3a753544bcab9501e5d1caa
Author: Miklos Vajna 
AuthorDate: Mon May 23 16:24:00 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue May 24 08:09:57 2022 +0200

sw HTML import: extend list of MIME types recognized as image objects

The HTML import sometimes imports  elements as embedded objects
and sometimes as Writer images.

This MIME-type based approach works great to differentiate plain images
(with PNG fallback) from real embedded objects, but analysis on some
larger document corpus pointed out a few missing entries in this
allow-list.

Fix the problem by adding a 2nd variant for BMP, TIFF and WMF, which
should also count as image, not object.

This could be improved further in a later commit by getting a full list
of image MIME types we support from VCL.

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

diff --git a/sw/source/filter/html/htmlplug.cxx 
b/sw/source/filter/html/htmlplug.cxx
index bd8446c9ca1e..710cd2f986c7 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ b/sw/source/filter/html/htmlplug.cxx
@@ -441,6 +441,9 @@ bool SwHTMLParser::InsertEmbed()
 u"image/svg+xml",
 u"image/tiff",
 u"image/x-emf",
+u"image/bmp",
+u"image/tif",
+u"image/wmf",
 };
 
 if (vAllowlist.find(aType) != vAllowlist.end() && m_aEmbeds.empty())


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

2022-05-23 Thread Miklos Vajna (via logerrit)
 sw/source/filter/inc/fltshell.hxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit cef860d8fd1c6952bac74053928107d048d16528
Author: Miklos Vajna 
AuthorDate: Mon May 23 20:14:48 2022 +0200
Commit: Miklos Vajna 
CommitDate: Tue May 24 08:11:00 2022 +0200

sw: document SwFltAnchorListener

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

diff --git a/sw/source/filter/inc/fltshell.hxx 
b/sw/source/filter/inc/fltshell.hxx
index d0d2b1be8507..f7c605414e5a 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -181,6 +181,7 @@ public:
   SwFrameFormat* GetFrameFormat() { return m_pFrameFormat; }
 };
 
+/// Used by SwFltAnchor, to listen to an SwFrameFormat (to be aware when it is 
replaced or deleted).
 class SwFltAnchorListener final : public SvtListener
 {
 SwFltAnchor* m_pFltAnchor;


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

2022-05-23 Thread offtkp (via logerrit)
 vcl/source/filter/graphicfilter2.cxx |   64 ---
 1 file changed, 60 insertions(+), 4 deletions(-)

New commits:
commit 063d641f023ac90f49116de105e32e38be72a1af
Author: offtkp 
AuthorDate: Sat May 21 11:23:01 2022 +0300
Commit: Bartosz Kosiorek 
CommitDate: Tue May 24 08:19:41 2022 +0200

tdf#149206 Set size correctly when loading EMF

Regression fixed, rolled back ImpDetectEMF function
to version before https://gerrit.libreoffice.org/c/core/+/132456,
changed type detection from extension checking back to
magic number checking. Also added a small uncompression
at the start to keep EMZ support.

Change-Id: Id4489da399a571c4c72ce137f841614f5c0d7bdc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134703
Reviewed-by: Bartosz Kosiorek 
Tested-by: Jenkins

diff --git a/vcl/source/filter/graphicfilter2.cxx 
b/vcl/source/filter/graphicfilter2.cxx
index eaef61b1d1e1..c02e9d557c44 100644
--- a/vcl/source/filter/graphicfilter2.cxx
+++ b/vcl/source/filter/graphicfilter2.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -29,6 +30,9 @@
 #include "graphicfilter_internal.hxx"
 
 #define DATA_SIZE   640
+constexpr sal_uInt32 EMF_CHECK_SIZE= 44;
+constexpr sal_uInt32 EMR_HEADER= 0x0001;
+constexpr sal_uInt32 ENHMETA_SIGNATURE = 0x464d4520;
 
 GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) :
 pFileStm( ::utl::UcbStreamHelper::CreateStream( rPath.GetMainURL( 
INetURLObject::DecodeMechanism::NONE ), StreamMode::READ ).release() ),
@@ -1086,12 +1090,64 @@ bool GraphicDescriptor::ImpDetectWMF( SvStream&, bool )
 return bRet;
 }
 
-bool GraphicDescriptor::ImpDetectEMF( SvStream&, bool )
+bool GraphicDescriptor::ImpDetectEMF(SvStream& rStm, bool bExtendedInfo)
 {
-bool bRet = aPathExt.startsWith( "emf" ) || aPathExt.startsWith( "emz" );
-if (bRet)
-nFormat = GraphicFileFormat::EMF;
+SvStream* aNewStream = &rStm;
+SvMemoryStream aMemStream;
+sal_uInt8 aUncompressedBuffer[EMF_CHECK_SIZE];
+if (ZCodec::IsZCompressed(rStm))
+{
+ZCodec aCodec;
+aCodec.BeginCompression(ZCODEC_DEFAULT_COMPRESSION, /*gzLib*/ true);
+auto nDecompressLength = aCodec.Read(rStm, aUncompressedBuffer, 
EMF_CHECK_SIZE);
+aCodec.EndCompression();
+if (nDecompressLength != EMF_CHECK_SIZE)
+return false;
+aMemStream.SetBuffer(aUncompressedBuffer, EMF_CHECK_SIZE, 
EMF_CHECK_SIZE);
+aNewStream = &aMemStream;
+}
+
+sal_uInt32 nRecordType = 0;
+bool bRet = false;
+sal_Int32 nStmPos = aNewStream->Tell();
+aNewStream->SetEndian(SvStreamEndian::LITTLE);
+aNewStream->ReadUInt32(nRecordType);
+if (nRecordType == EMR_HEADER)
+{
+sal_Int32 nBoundLeft = 0, nBoundTop = 0, nBoundRight = 0, nBoundBottom 
= 0;
+sal_Int32 nFrameLeft = 0, nFrameTop = 0, nFrameRight = 0, nFrameBottom 
= 0;
+sal_uInt32 nSignature = 0;
+
+aNewStream->SeekRel(4);
+aNewStream->ReadInt32(nBoundLeft);
+aNewStream->ReadInt32(nBoundTop);
+aNewStream->ReadInt32(nBoundRight);
+aNewStream->ReadInt32(nBoundBottom);
+aNewStream->ReadInt32(nFrameLeft);
+aNewStream->ReadInt32(nFrameTop);
+aNewStream->ReadInt32(nFrameRight);
+aNewStream->ReadInt32(nFrameBottom);
+aNewStream->ReadUInt32(nSignature);
+
+if (nSignature == ENHMETA_SIGNATURE)
+{
+nFormat = GraphicFileFormat::EMF;
+bRet = true;
+
+if (bExtendedInfo)
+{
+// size in pixels
+aPixSize.setWidth(nBoundRight - nBoundLeft + 1);
+aPixSize.setHeight(nBoundBottom - nBoundTop + 1);
+
+// size in 0.01mm units
+aLogSize.setWidth(nFrameRight - nFrameLeft + 1);
+aLogSize.setHeight(nFrameBottom - nFrameTop + 1);
+}
+}
+}
 
+rStm.Seek(nStmPos);
 return bRet;
 }
 


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

2022-05-23 Thread Xisco Fauli (via logerrit)
 sd/qa/unit/data/pptx/tdf149206.pptx |binary
 sd/qa/unit/import-tests2.cxx|   25 +
 2 files changed, 25 insertions(+)

New commits:
commit 504d61697bac45236da27fba23c7189daf8c171e
Author: Xisco Fauli 
AuthorDate: Mon May 23 13:39:52 2022 +0200
Commit: Bartosz Kosiorek 
CommitDate: Tue May 24 08:20:06 2022 +0200

tdf#149206: sd_import_tests2: Add unittest

Change-Id: I1ff0974d1fa2ae6eb45fc95115fad665eecc45bb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134818
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek 

diff --git a/sd/qa/unit/data/pptx/tdf149206.pptx 
b/sd/qa/unit/data/pptx/tdf149206.pptx
new file mode 100644
index ..ec39ec635cc9
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf149206.pptx differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index b06a699b04bd..fd875abe79cc 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -116,6 +116,7 @@ public:
   std::vector& rExpected);
 void testPatternImport();
 void testPptCrop();
+void testTdf149206();
 void testTdf120028();
 void testDescriptionImport();
 void testTdf83247();
@@ -178,6 +179,7 @@ public:
 CPPUNIT_TEST(testTdf77747);
 CPPUNIT_TEST(testTdf116266);
 CPPUNIT_TEST(testPptCrop);
+CPPUNIT_TEST(testTdf149206);
 CPPUNIT_TEST(testTdf120028);
 CPPUNIT_TEST(testDescriptionImport);
 CPPUNIT_TEST(testTdf83247);
@@ -1531,6 +1533,29 @@ void SdImportTest2::testPptCrop()
 xDocShRef->DoClose();
 }
 
+void SdImportTest2::testTdf149206()
+{
+// Check that the image is cropped
+::sd::DrawDocShellRef xDocShRef
+= 
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf149206.pptx"), 
PPTX);
+uno::Reference 
xDoc(xDocShRef->GetDoc()->getUnoModel(),
+ uno::UNO_QUERY);
+
+uno::Reference xPropertySet(
+getShapeFromPage(/*nShape=*/0, /*nPage=*/0, xDocShRef));
+text::GraphicCrop aCrop;
+xPropertySet->getPropertyValue("GraphicCrop") >>= aCrop;
+
+CPPUNIT_ASSERT_EQUAL(static_cast(0), aCrop.Top);
+
+// Without the fix in place, this test would have failed with
+// - Expected: 5937
+// - Actual  : 0
+CPPUNIT_ASSERT_EQUAL(static_cast(5937), aCrop.Bottom);
+CPPUNIT_ASSERT_EQUAL(static_cast(0), aCrop.Left);
+CPPUNIT_ASSERT_EQUAL(static_cast(0), aCrop.Right);
+}
+
 void SdImportTest2::testTdf120028()
 {
 // Check that the text shape has 4 columns.


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

2022-05-23 Thread offtkp (via logerrit)
 vcl/qa/cppunit/GraphicDescriptorTest.cxx |   15 +++
 1 file changed, 15 insertions(+)

New commits:
commit 5f30b778bccbcc417e4ed1da5997650babb942a8
Author: offtkp 
AuthorDate: Tue May 24 00:03:04 2022 +0300
Commit: Bartosz Kosiorek 
CommitDate: Tue May 24 08:20:45 2022 +0200

tdf#149206: Add EMF test in GraphicDescriptorTest

Add a testDetectEMF test case in GraphicDescriptorTest.cxx that tests
GraphicDescriptor for EMF detection and that the size metadata were
fetched.

Change-Id: I6fbe082bea4d5f1e8660b43a923a09bfcdf466b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134845
Tested-by: Jenkins
Reviewed-by: Bartosz Kosiorek 

diff --git a/vcl/qa/cppunit/GraphicDescriptorTest.cxx 
b/vcl/qa/cppunit/GraphicDescriptorTest.cxx
index ace1a6c90a28..c86d95edebdb 100644
--- a/vcl/qa/cppunit/GraphicDescriptorTest.cxx
+++ b/vcl/qa/cppunit/GraphicDescriptorTest.cxx
@@ -35,6 +35,7 @@ class GraphicDescriptorTest : public 
test::BootstrapFixtureBase
 void testDetectTIF();
 void testDetectBMP();
 void testDetectWEBP();
+void testDetectEMF();
 
 CPPUNIT_TEST_SUITE(GraphicDescriptorTest);
 CPPUNIT_TEST(testDetectPNG);
@@ -43,6 +44,7 @@ class GraphicDescriptorTest : public 
test::BootstrapFixtureBase
 CPPUNIT_TEST(testDetectTIF);
 CPPUNIT_TEST(testDetectBMP);
 CPPUNIT_TEST(testDetectWEBP);
+CPPUNIT_TEST(testDetectEMF);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -154,6 +156,19 @@ void GraphicDescriptorTest::testDetectWEBP()
 CPPUNIT_ASSERT_EQUAL(tools::Long(100), 
aDescriptor.GetSizePixel().Height());
 }
 
+void GraphicDescriptorTest::testDetectEMF()
+{
+SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.emf"), 
StreamMode::READ);
+GraphicDescriptor aDescriptor(aFileStream, nullptr);
+aDescriptor.Detect(true);
+CPPUNIT_ASSERT_EQUAL(GraphicFileFormat::EMF, aDescriptor.GetFileFormat());
+// Test that Bounds/Frame values are fetched from header
+CPPUNIT_ASSERT_EQUAL(tools::Long(142), aDescriptor.GetSizePixel().Width());
+CPPUNIT_ASSERT_EQUAL(tools::Long(142), 
aDescriptor.GetSizePixel().Height());
+CPPUNIT_ASSERT_EQUAL(tools::Long(300), 
aDescriptor.GetSize_100TH_MM().Width());
+CPPUNIT_ASSERT_EQUAL(tools::Long(300), 
aDescriptor.GetSize_100TH_MM().Height());
+}
+
 } // namespace
 
 CPPUNIT_TEST_SUITE_REGISTRATION(GraphicDescriptorTest);