core.git: vcl/source
vcl/source/window/builder.cxx | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) New commits: commit af9b429a138e9cd6403fd8e399080c2913cde739 Author: Arnaud VERSINI AuthorDate: Sun Sep 22 14:07:07 2024 +0200 Commit: Michael Weghorn CommitDate: Mon Sep 23 08:17:04 2024 +0200 vcl builder : no need to use OUString here Change-Id: I82219272ae06db45968f2aecf2583c0b7196e3b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173768 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index c91fe95bd0f5..9a95b64294e3 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -3838,7 +3838,7 @@ void VclBuilder::applyPackingProperties(vcl::Window* pCurrent, vcl::Window* pPar for (auto const& [rKey, rValue] : rPackingProperties) { -if (rKey == u"expand"_ustr || rKey == u"resize"_ustr) +if (rKey == u"expand" || rKey == u"resize") { bool bTrue = toBool(rValue); if (pToolBoxParent) @@ -3851,54 +3851,54 @@ void VclBuilder::applyPackingProperties(vcl::Window* pCurrent, vcl::Window* pPar if (pToolBoxParent) continue; -if (rKey == u"fill"_ustr) +if (rKey == u"fill") { pCurrent->set_fill(toBool(rValue)); } -else if (rKey == u"pack-type"_ustr) +else if (rKey == u"pack-type") { VclPackType ePackType = (!rValue.isEmpty() && (rValue[0] == 'e' || rValue[0] == 'E')) ? VclPackType::End : VclPackType::Start; pCurrent->set_pack_type(ePackType); } -else if (rKey == u"left-attach"_ustr) +else if (rKey == u"left-attach") { pCurrent->set_grid_left_attach(rValue.toInt32()); } -else if (rKey == u"top-attach"_ustr) +else if (rKey == u"top-attach") { pCurrent->set_grid_top_attach(rValue.toInt32()); } -else if (rKey == u"width"_ustr) +else if (rKey == u"width") { pCurrent->set_grid_width(rValue.toInt32()); } -else if (rKey == u"height"_ustr) +else if (rKey == u"height") { pCurrent->set_grid_height(rValue.toInt32()); } -else if (rKey == u"padding"_ustr) +else if (rKey == u"padding") { pCurrent->set_padding(rValue.toInt32()); } -else if (rKey == u"position"_ustr) +else if (rKey == u"position") { set_window_packing_position(pCurrent, rValue.toInt32()); } -else if (rKey == u"secondary"_ustr) +else if (rKey == u"secondary") { pCurrent->set_secondary(toBool(rValue)); } -else if (rKey == u"non-homogeneous"_ustr) +else if (rKey == u"non-homogeneous") { pCurrent->set_non_homogeneous(toBool(rValue)); } -else if (rKey == "homogeneous") +else if (rKey == u"homogeneous") { pCurrent->set_non_homogeneous(!toBool(rValue)); } else { -SAL_WARN_IF(rKey != "shrink", "vcl.builder", "unknown packing: " << rKey); +SAL_WARN_IF(rKey != u"shrink", "vcl.builder", "unknown packing: " << rKey); } } }
core.git: package/source
package/source/zippackage/ZipPackage.cxx | 54 +-- 1 file changed, 24 insertions(+), 30 deletions(-) New commits: commit 7eef225e423698a51912cb09e0c247141062d24d Author: Arnaud VERSINI AuthorDate: Sun Sep 1 16:53:45 2024 +0200 Commit: Mike Kaganski CommitDate: Tue Sep 10 06:25:25 2024 +0200 package : reduce varaible scope and use string_view Change-Id: I3d159edc47390375aae6857fa972c582e13f2774 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172725 Reviewed-by: Mike Kaganski Tested-by: Jenkins diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index d78e6d1cc78d..906acf4d7860 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -615,13 +615,10 @@ void ZipPackage::parseContentType() void ZipPackage::getZipFileContents() { ZipEnumeration aEnum = m_pZipFile->entries(); -OUString sTemp, sDirName; -sal_Int32 nOldIndex, nStreamIndex; -FolderHash::iterator aIter; +OUString sDirName; while (aEnum.hasMoreElements()) { -nOldIndex = 0; ZipPackageFolder* pCurrent = m_xRootFolder.get(); const ZipEntry & rEntry = *aEnum.nextElement(); OUString rName = rEntry.sPath; @@ -633,11 +630,11 @@ void ZipPackage::getZipFileContents() rName = rName.replace( '\', '/' ); } -nStreamIndex = rName.lastIndexOf ( '/' ); +sal_Int32 nStreamIndex = rName.lastIndexOf ( '/' ); if ( nStreamIndex != -1 ) { sDirName = rName.copy ( 0, nStreamIndex ); -aIter = m_aRecent.find ( sDirName ); +FolderHash::iterator aIter = m_aRecent.find ( sDirName ); if ( aIter != m_aRecent.end() ) pCurrent = ( *aIter ).second; } @@ -645,9 +642,10 @@ void ZipPackage::getZipFileContents() if ( pCurrent == m_xRootFolder.get() ) { sal_Int32 nIndex; +sal_Int32 nOldIndex = 0; while ( ( nIndex = rName.indexOf( '/', nOldIndex ) ) != -1 ) { -sTemp = rName.copy ( nOldIndex, nIndex - nOldIndex ); +OUString sTemp = rName.copy ( nOldIndex, nIndex - nOldIndex ); if ( nIndex == nOldIndex ) break; if ( !pCurrent->hasByName( sTemp ) ) @@ -676,7 +674,7 @@ void ZipPackage::getZipFileContents() if ( rName.getLength() -1 != nStreamIndex ) { nStreamIndex++; -sTemp = rName.copy( nStreamIndex ); +OUString sTemp = rName.copy( nStreamIndex ); if (!pCurrent->hasByName(sTemp)) { @@ -908,16 +906,15 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) { -OUString sTemp, sDirName; +OUString sDirName; sal_Int32 nOldIndex, nStreamIndex; -FolderHash::iterator aIter; - -sal_Int32 nIndex = aName.getLength(); if (aName == "/") // root directory. return Any ( uno::Reference( cppu::getXWeak(m_xRootFolder.get()) ) ); +sal_Int32 nIndex = aName.getLength(); + nStreamIndex = aName.lastIndexOf ( '/' ); bool bFolder = nStreamIndex == nIndex-1; // last character is '/'. @@ -925,7 +922,7 @@ Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) { // The name contains '/'. sDirName = aName.copy ( 0, nStreamIndex ); -aIter = m_aRecent.find ( sDirName ); +FolderHash::iterator aIter = m_aRecent.find ( sDirName ); if ( aIter != m_aRecent.end() ) { // There is a cached entry for this name. @@ -936,7 +933,7 @@ Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) { // Determine the directory name. sal_Int32 nDirIndex = aName.lastIndexOf ( '/', nStreamIndex ); -sTemp = aName.copy ( nDirIndex == -1 ? 0 : nDirIndex+1, nStreamIndex-nDirIndex-1 ); +std::u16string_view sTemp = aName.subView ( nDirIndex == -1 ? 0 : nDirIndex+1, nStreamIndex-nDirIndex-1 ); if (pFolder && sTemp == pFolder->getName()) return Any(uno::Reference(cppu::getXWeak(pFolder))); @@ -944,7 +941,7 @@ Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) else { // Determine the file name. -sTemp = aName.copy ( nStreamIndex + 1 ); +OUString sTemp = aName.copy ( nStreamIndex + 1 ); if (pFolder && pFolder->hasByName(sTemp)) return pFolder->getByName(sTemp); @@ -967,7 +964,7 @@ Any SAL_CALL ZipPackage::getByHierarchicalName( const OUString& aName ) while ( ( nIndex = aName.indexOf( '/', nOldIndex )) != -1 ) { -sTemp
core.git: package/inc
package/inc/ByteGrabber.hxx |2 -- 1 file changed, 2 deletions(-) New commits: commit e099249fd13a9379525de15a94acec531b7d4d00 Author: Arnaud VERSINI AuthorDate: Sun Aug 18 21:29:57 2024 +0200 Commit: Arnaud Versini CommitDate: Mon Aug 19 08:31:13 2024 +0200 Remove now useless include in package Change-Id: I8085fb69a752e69820113cf3074bf5e4e7c942de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172020 Reviewed-by: Arnaud Versini Tested-by: Jenkins diff --git a/package/inc/ByteGrabber.hxx b/package/inc/ByteGrabber.hxx index 075ff56d142d..04a5b35f3547 100644 --- a/package/inc/ByteGrabber.hxx +++ b/package/inc/ByteGrabber.hxx @@ -22,8 +22,6 @@ #include #include -#include - namespace com::sun::star { namespace io { class XSeekable; class XInputStream; } }
core.git: i18npool/source
i18npool/source/characterclassification/characterclassificationImpl.cxx |3 +-- i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx |3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) New commits: commit be1c9ee5b3fd326d16f41c45a53123053507687e Author: Arnaud VERSINI AuthorDate: Wed May 1 17:27:46 2024 +0200 Commit: Arnaud Versini CommitDate: Sun Jul 14 15:00:25 2024 +0200 i18npool : use new OUtring literals Change-Id: I2000f4c5409d988c9030e2eec70247d8f79059e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166970 Reviewed-by: Arnaud Versini Tested-by: Jenkins diff --git a/i18npool/source/characterclassification/characterclassificationImpl.cxx b/i18npool/source/characterclassification/characterclassificationImpl.cxx index e317638d4650..161b39e39d8e 100644 --- a/i18npool/source/characterclassification/characterclassificationImpl.cxx +++ b/i18npool/source/characterclassification/characterclassificationImpl.cxx @@ -32,8 +32,7 @@ namespace i18npool { CharacterClassificationImpl::CharacterClassificationImpl( const Reference < XComponentContext >& rxContext ) : m_xContext( rxContext ) { -static constexpr OUStringLiteral sUnicode = u"Unicode"; -if (createLocaleSpecificCharacterClassification(sUnicode, Locale())) +if (createLocaleSpecificCharacterClassification(u"Unicode"_ustr, Locale())) xUCI = cachedItem->xCI; } diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index 1ba942ca3b51..980356b0c4f5 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -461,8 +461,7 @@ static void lcl_formatPersianWord( sal_Int32 nNumber, OUString& rsResult ) { OUStringBuffer aTemp(64); -static constexpr OUStringLiteral asPersianWord_conjunction_data = u" \u0648 "; -OUString asPersianWord_conjunction( asPersianWord_conjunction_data ); +OUString asPersianWord_conjunction = u" \u0648 "_ustr; unsigned char nSection = 0; while (int nPart = nNumber % 1000)
core.git: basic/source
basic/source/sbx/sbxres.cxx | 94 ++-- 1 file changed, 47 insertions(+), 47 deletions(-) New commits: commit a123c5b39a4e936121f51c4fc705f5652db3a700 Author: Arnaud VERSINI AuthorDate: Mon Apr 29 10:00:04 2024 +0200 Commit: Arnaud Versini CommitDate: Sun May 5 14:44:04 2024 +0200 basic : use more OUString literals Change-Id: I38f57c64c0d110e892982eaed2619c0915fe93b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166825 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Arnaud Versini diff --git a/basic/source/sbx/sbxres.cxx b/basic/source/sbx/sbxres.cxx index 125969e3efd9..d29383cf076c 100644 --- a/basic/source/sbx/sbxres.cxx +++ b/basic/source/sbx/sbxres.cxx @@ -22,59 +22,59 @@ #include -static const char* pSbxRes[] = { -"Empty", -"Null", -"Integer", -"Long", -"Single", -"Double", -"Currency", -"Date", -"String", -"Object", -"Error", -"Boolean", -"Variant", -"Any", -"Type14", -"Type15", -"Char", -"Byte", -"UShort", -"ULong", -"Long64", -"ULong64", -"Int", -"UInt", -"Void", -"HResult", -"Pointer", -"DimArray", -"CArray", -"Any", -"LpStr", -"LpWStr", -" As ", -"Optional ", -"Byref ", +constexpr OUString pSbxRes[] = { +u"Empty"_ustr, +u"Null"_ustr, +u"Integer"_ustr, +u"Long"_ustr, +u"Single"_ustr, +u"Double"_ustr, +u"Currency"_ustr, +u"Date"_ustr, +u"String"_ustr, +u"Object"_ustr, +u"Error"_ustr, +u"Boolean"_ustr, +u"Variant"_ustr, +u"Any"_ustr, +u"Type14"_ustr, +u"Type15"_ustr, +u"Char"_ustr, +u"Byte"_ustr, +u"UShort"_ustr, +u"ULong"_ustr, +u"Long64"_ustr, +u"ULong64"_ustr, +u"Int"_ustr, +u"UInt"_ustr, +u"Void"_ustr, +u"HResult"_ustr, +u"Pointer"_ustr, +u"DimArray"_ustr, +u"CArray"_ustr, +u"Any"_ustr, +u"LpStr"_ustr, +u"LpWStr"_ustr, +u" As "_ustr, +u"Optional "_ustr, +u"Byref "_ustr, -"Name", -"Parent", -"Application", -"Count", -"Add", -"Item", -"Remove", +u"Name"_ustr, +u"Parent"_ustr, +u"Application"_ustr, +u"Count"_ustr, +u"Add"_ustr, +u"Item"_ustr, +u"Remove"_ustr, -"Error ", // with blank! -"False", -"True" +u"Error "_ustr, // with blank! +u"False"_ustr, +u"True"_ustr }; OUString GetSbxRes( StringId nId ) { -return OUString::createFromAscii( ( nId > StringId::LastValue ) ? "???" : pSbxRes[ static_cast( nId ) ] ); +return ( nId > StringId::LastValue ) ? u"???"_ustr : pSbxRes[ static_cast( nId ) ]; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
core.git: basic/source
basic/source/sbx/sbxform.cxx | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-) New commits: commit 7ab8d335226a74b864dc61775050b2fbddfaa18a Author: Arnaud VERSINI AuthorDate: Sun May 5 09:45:16 2024 +0200 Commit: Arnaud Versini CommitDate: Sun May 5 13:42:05 2024 +0200 basic : use std::u16string_view and new OUString literal Change-Id: Id3cd708b98e1b0551955562afe3ac594bdc6e50a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167153 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Arnaud Versini diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx index 84e5f22fd8da..49d45ccc5f38 100644 --- a/basic/source/sbx/sbxform.cxx +++ b/basic/source/sbx/sbxform.cxx @@ -62,24 +62,24 @@ COMMENT: Visual-Basic treats the following (invalid) format-strings #define FORMAT_SEPARATOR';' // predefined formats for the Format$()-command: -constexpr OUString BASICFORMAT_GENERALNUMBER = u"General Number"_ustr; -constexpr OUString BASICFORMAT_CURRENCY = u"Currency"_ustr; -constexpr OUString BASICFORMAT_FIXED = u"Fixed"_ustr; -constexpr OUString BASICFORMAT_STANDARD = u"Standard"_ustr; -constexpr OUString BASICFORMAT_PERCENT = u"Percent"_ustr; -constexpr OUString BASICFORMAT_SCIENTIFIC = u"Scientific"_ustr; -constexpr OUString BASICFORMAT_YESNO = u"Yes/No"_ustr; -constexpr OUString BASICFORMAT_TRUEFALSE = u"True/False"_ustr; -constexpr OUString BASICFORMAT_ONOFF = u"On/Off"_ustr; +constexpr std::u16string_view BASICFORMAT_GENERALNUMBER = u"General Number"; +constexpr std::u16string_view BASICFORMAT_CURRENCY = u"Currency"; +constexpr std::u16string_view BASICFORMAT_FIXED = u"Fixed"; +constexpr std::u16string_view BASICFORMAT_STANDARD = u"Standard"; +constexpr std::u16string_view BASICFORMAT_PERCENT = u"Percent"; +constexpr std::u16string_view BASICFORMAT_SCIENTIFIC = u"Scientific"; +constexpr std::u16string_view BASICFORMAT_YESNO = u"Yes/No"; +constexpr std::u16string_view BASICFORMAT_TRUEFALSE = u"True/False"; +constexpr std::u16string_view BASICFORMAT_ONOFF = u"On/Off"; // Comment: Visual-Basic has a maximum of 12 positions after the // decimal point for floating-point-numbers. // all format-strings are compatible to Visual-Basic: -constexpr OUStringLiteral GENERALNUMBER_FORMAT = u"0."; -constexpr OUStringLiteral FIXED_FORMAT = u"0.00"; -constexpr OUStringLiteral STANDARD_FORMAT = u"@0.00"; -constexpr OUStringLiteral PERCENT_FORMAT = u"0.00%"; -constexpr OUStringLiteral SCIENTIFIC_FORMAT = u"#.00E+00"; +constexpr OUString GENERALNUMBER_FORMAT = u"0."_ustr; +constexpr OUString FIXED_FORMAT = u"0.00"_ustr; +constexpr OUString STANDARD_FORMAT = u"@0.00"_ustr; +constexpr OUString PERCENT_FORMAT = u"0.00%"_ustr; +constexpr OUString SCIENTIFIC_FORMAT = u"#.00E+00"_ustr; // Comment: the character @ means that thousand-separators shall // be generated. That's a StarBasic 'extension'.
core.git: i18npool/source
i18npool/source/transliteration/transliteration_Numeric.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 7b8ef7cf923c5dfbc54871e88b780ddaeb9436c5 Author: Arnaud VERSINI AuthorDate: Wed May 1 17:23:11 2024 +0200 Commit: Noel Grandin CommitDate: Thu May 2 10:02:37 2024 +0200 i18npoool : use rtl::isAsciiDigit instead of local isnumber Change-Id: I1e9df1b048169767e649fc825f7a49dac16c040f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166969 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/i18npool/source/transliteration/transliteration_Numeric.cxx b/i18npool/source/transliteration/transliteration_Numeric.cxx index e0717379ed4c..fb01072a2302 100644 --- a/i18npool/source/transliteration/transliteration_Numeric.cxx +++ b/i18npool/source/transliteration/transliteration_Numeric.cxx @@ -22,6 +22,7 @@ #include #include +#include #include using namespace com::sun::star::i18n; @@ -54,7 +55,6 @@ Sequence< OUString > SAL_CALL } -#define isNumber(c) ((c) >= 0x30 && (c) <= 0x39) #define NUMBER_ZERO 0x30 OUString @@ -74,7 +74,7 @@ transliteration_Numeric::transliterateBullet( std::u16string_view inStr, sal_Int auto ppOffset = pOffset ? pOffset->getArray() : nullptr; for (sal_Int32 i = startPos; i < endPos; i++) { -if (isNumber(inStr[i])) +if (rtl::isAsciiDigit(inStr[i])) { if (number == -1) { startPos = i; @@ -127,7 +127,7 @@ sal_Unicode SAL_CALL transliteration_Numeric::transliterateChar2Char( sal_Unicode inChar ) { if (tableSize) { -if (isNumber(inChar)) { +if (rtl::isAsciiDigit(inChar)) { sal_Int16 number = inChar - NUMBER_ZERO; if (number <= tableSize || recycleSymbol) return table[--number % tableSize];
core.git: i18npool/source
i18npool/source/localedata/LocaleNode.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 190156976dd4f1c023279eddd1eed61bfd037e7a Author: Arnaud VERSINI AuthorDate: Sun Apr 21 13:38:14 2024 +0200 Commit: Arnaud Versini CommitDate: Mon Apr 29 18:45:26 2024 +0200 tdf#147021 : use std::size instead of SAL_N_ELEMENTS in generated code too Change-Id: Ib11a703c0250b1f80b7e79fe24e3bda915e7198b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166385 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index 809129ab5d50..4aca351fc2c4 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -274,7 +274,7 @@ void LCInfoNode::generateCode (const OFileWriter &of) const of.writeAsciiString(" countryDefaultName, "); of.writeAsciiString(" Variant "); of.writeAsciiString("}; "); -of.writeOUStringFunction("getLCInfo_", "SAL_N_ELEMENTS(LCInfoArray)", "LCInfoArray"); +of.writeOUStringFunction("getLCInfo_", "std::size(LCInfoArray)", "LCInfoArray"); } @@ -503,7 +503,7 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const of.writeAsciiString(" LongDateYearSeparator, "); of.writeAsciiString(" decimalSeparatorAlternative "); of.writeAsciiString("}; "); -of.writeOUStringFunction("getLocaleItem_", "SAL_N_ELEMENTS(LCType)", "LCType"); +of.writeOUStringFunction("getLocaleItem_", "std::size(LCType)", "LCType"); }
core.git: i18npool/source
i18npool/source/localedata/saxparser.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit b6c2ff2f05f94637feb537cb4cea5d7f040f9031 Author: Arnaud VERSINI AuthorDate: Sun Apr 21 13:42:51 2024 +0200 Commit: Arnaud Versini CommitDate: Mon Apr 29 14:21:32 2024 +0200 i18npool : remove useless stdio include generation Change-Id: Ib37f2c7553de2045496a090cda7006257fcf5e20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166386 Reviewed-by: Arnaud Versini Tested-by: Jenkins diff --git a/i18npool/source/localedata/saxparser.cxx b/i18npool/source/localedata/saxparser.cxx index 603d91450b06..eb95c7973fa5 100644 --- a/i18npool/source/localedata/saxparser.cxx +++ b/i18npool/source/localedata/saxparser.cxx @@ -190,7 +190,6 @@ public: // ExtendedDocumentHandler printf( "parsing document %s started ", theLocale.c_str()); of.writeAsciiString("#include "); of.writeAsciiString("#include "); -of.writeAsciiString("#include "); of.writeAsciiString("extern \"C\" { "); }
core.git: i18npool/inc i18npool/source
i18npool/inc/localedata.hxx | 12 i18npool/source/localedata/localedata.cxx | 607 +++--- 2 files changed, 322 insertions(+), 297 deletions(-) New commits: commit 91d67c32f67f1fccf30cbb7980aeab83a9af1008 Author: Arnaud VERSINI AuthorDate: Sun Apr 14 14:21:19 2024 +0200 Commit: Noel Grandin CommitDate: Sun Apr 21 17:42:11 2024 +0200 i18npool : limit string comparison using an enum class Change-Id: Iec5327b6f0125b22a2a4ee8ccb789b5403a7fdb4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166070 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/i18npool/inc/localedata.hxx b/i18npool/inc/localedata.hxx index f4cd15a30254..06cf68fa7fdf 100644 --- a/i18npool/inc/localedata.hxx +++ b/i18npool/inc/localedata.hxx @@ -48,14 +48,22 @@ struct LocaleDataLookupTableItem; namespace i18npool { +enum class DataLocaleLibrary { +EN, +ES, +EURO, +OTHERS +}; + + struct LocaleDataLookupTableItem { -const char* dllName; +DataLocaleLibrary dllName; osl::Module *module; const char* localeName; css::lang::Locale aLocale; -LocaleDataLookupTableItem(const char *name, osl::Module* m, const char* lname) : dllName(name), module(m), localeName(lname) +LocaleDataLookupTableItem(DataLocaleLibrary name, osl::Module* m, const char* lname) : dllName(std::move(name)), module(m), localeName(lname) { } bool equals(const css::lang::Locale& rLocale) const diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 64350b9532d3..7f59dabda5fb 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -41,6 +41,7 @@ using namespace com::sun::star::i18n; using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace com::sun::star; +using i18npool::DataLocaleLibrary; typedef OUString const * (* MyFuncOUString_Type)( sal_Int16&); typedef OUString const ** (* MyFunc_Type2)( sal_Int16&, sal_Int16& ); @@ -49,296 +50,319 @@ typedef OUString const * (* MyFunc_FormatCode)( sal_Int16&, sal_Unicode const *& #ifndef DISABLE_DYNLOADING -static const char *lcl_DATA_EN = "localedata_en"; -static const char *lcl_DATA_ES = "localedata_es"; -static const char *lcl_DATA_EURO = "localedata_euro"; -static const char *lcl_DATA_OTHERS = "localedata_others"; +#ifdef SAL_DLLPREFIX +// mostly "lib*.so" +constexpr const char* lcl_DATA_EN = SAL_DLLPREFIX "localedata_en" SAL_DLLEXTENSION; +constexpr const char* lcl_DATA_ES = SAL_DLLPREFIX "localedata_es" SAL_DLLEXTENSION; +constexpr const char* lcl_DATA_EURO = SAL_DLLPREFIX "localedata_euro" SAL_DLLEXTENSION; +constexpr const char* lcl_DATA_OTHERS = SAL_DLLPREFIX "localedata_others" SAL_DLLEXTENSION; +#else +// mostly "*.dll" +constexpr const char* lcl_DATA_EN = "localedata_en" SAL_DLLEXTENSION; +constexpr const char* lcl_DATA_ES = "localedata_es" SAL_DLLEXTENSION; +constexpr const char* lcl_DATA_EURO = "localedata_euro" SAL_DLLEXTENSION; +constexpr const char* lcl_DATA_OTHERS = "localedata_others" SAL_DLLEXTENSION; +#endif + +static const char* getLibraryName(DataLocaleLibrary aLib) { +switch(aLib) { +case DataLocaleLibrary::EN: +return lcl_DATA_EN; +case DataLocaleLibrary::ES: +return lcl_DATA_ES; +case DataLocaleLibrary::EURO: +return lcl_DATA_EURO; +case DataLocaleLibrary::OTHERS: +return lcl_DATA_OTHERS; +} +return nullptr; +} -const struct { +constexpr struct { const char* pLocale; -const char* pLib; +i18npool::DataLocaleLibrary pLib; } aLibTable[] = { -{ "en_US", lcl_DATA_EN }, -{ "en_AU", lcl_DATA_EN }, -{ "en_BZ", lcl_DATA_EN }, -{ "en_CA", lcl_DATA_EN }, -{ "en_GB", lcl_DATA_EN }, -{ "en_IE", lcl_DATA_EN }, -{ "en_JM", lcl_DATA_EN }, -{ "en_NZ", lcl_DATA_EN }, -{ "en_PH", lcl_DATA_EN }, -{ "en_TT", lcl_DATA_EN }, -{ "en_ZA", lcl_DATA_EN }, -{ "en_ZW", lcl_DATA_EN }, -{ "en_NA", lcl_DATA_EN }, -{ "en_GH", lcl_DATA_EN }, -{ "en_MW", lcl_DATA_EN }, -{ "en_GM", lcl_DATA_EN }, -{ "en_BW", lcl_DATA_EN }, -{ "en_ZM", lcl_DATA_EN }, -{ "en_LK", lcl_DATA_EN }, -{ "en_NG", lcl_DATA_EN }, -{ "en_KE", lcl_DATA_EN }, -{ "en_DK", lcl_DATA_EN }, -{ "en_MU", lcl_DATA_EN }, - -{ "es_ES", lcl_DATA_ES }, -{ "es_AR", lcl_DATA_ES }, -{ "es_BO", lcl_DATA_ES }, -{ "es_CL", lcl_DATA_ES }, -{ "es_CO", lcl_DATA_ES }, -{ "es_CR", lcl_DATA_ES }, -{ "es_DO", lcl_DATA_ES }, -{ "es_EC", lcl_DATA_ES }, -{ "es_GT", lcl_DATA_ES }, -{ "es_HN", lcl_DATA_ES }, -{ "es_MX", lcl_DATA_ES }, -{ "es_NI", lcl_DATA_ES }, -{ "es_PA", lcl_DATA_ES }, -{ "es_PE", lcl_DATA_ES }, -{ "es_PR", lcl_DATA_ES }, -{ "es_PY", lcl_DATA_ES }, -{ "es_SV", lcl_DATA_ES }, -{
core.git: i18npool/inc i18npool/source
i18npool/inc/breakiterator_unicode.hxx |3 +- i18npool/inc/calendar_gregorian.hxx |2 - i18npool/source/breakiterator/breakiterator_cjk.cxx | 10 i18npool/source/breakiterator/breakiterator_th.cxx |2 - i18npool/source/breakiterator/breakiterator_unicode.cxx |7 ++--- i18npool/source/calendar/calendar_gregorian.cxx | 19 +++- i18npool/source/calendar/calendar_hijri.cxx |2 - i18npool/source/calendar/calendar_jewish.cxx|2 - 8 files changed, 23 insertions(+), 24 deletions(-) New commits: commit 8dacc3e636ff85f7f2edb971ff6e269ed031aaaf Author: Arnaud VERSINI AuthorDate: Mon Apr 8 11:13:40 2024 +0200 Commit: Noel Grandin CommitDate: Mon Apr 8 23:18:31 2024 +0200 i18npool : use OUString literal Change-Id: I202f09303fd385cfcaa468411d0fae8b1707cf88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165884 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/i18npool/inc/breakiterator_unicode.hxx b/i18npool/inc/breakiterator_unicode.hxx index d468a2ebf941..d2cf5339f7d8 100644 --- a/i18npool/inc/breakiterator_unicode.hxx +++ b/i18npool/inc/breakiterator_unicode.hxx @@ -70,7 +70,8 @@ public: virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; protected: -const char *cBreakIterator, *lineRule; +OUString cBreakIterator; +const char *lineRule; /** Used as map value. */ struct BI_ValueData diff --git a/i18npool/inc/calendar_gregorian.hxx b/i18npool/inc/calendar_gregorian.hxx index 1ee7cabaab1e..e19698875f85 100644 --- a/i18npool/inc/calendar_gregorian.hxx +++ b/i18npool/inc/calendar_gregorian.hxx @@ -102,7 +102,7 @@ protected: const Era *eraArray; std::unique_ptr body; rtl::Reference mxNatNum; -const char* cCalendar; +OUString cCalendar; css::lang::Locale aLocale; sal_uInt32 fieldSet; sal_Int16 fieldValue[FIELD_INDEX_COUNT]; diff --git a/i18npool/source/breakiterator/breakiterator_cjk.cxx b/i18npool/source/breakiterator/breakiterator_cjk.cxx index 00dc5e9db0f6..22ac459a72a4 100644 --- a/i18npool/source/breakiterator/breakiterator_cjk.cxx +++ b/i18npool/source/breakiterator/breakiterator_cjk.cxx @@ -34,7 +34,7 @@ namespace i18npool { BreakIterator_CJK::BreakIterator_CJK() { -cBreakIterator = "com.sun.star.i18n.BreakIterator_CJK"; +cBreakIterator = u"com.sun.star.i18n.BreakIterator_CJK"_ustr; } Boundary SAL_CALL @@ -146,7 +146,7 @@ BreakIterator_zh::BreakIterator_zh() m_oDict.emplace("zh"); assert(hangingCharacters.pData); hangingCharacters = LocaleDataImpl::get()->getHangingCharacters(LOCALE("zh", "CN")); -cBreakIterator = "com.sun.star.i18n.BreakIterator_zh"; +cBreakIterator = u"com.sun.star.i18n.BreakIterator_zh"_ustr; } // @@ -157,7 +157,7 @@ BreakIterator_zh_TW::BreakIterator_zh_TW() m_oDict.emplace("zh"); assert(hangingCharacters.pData); hangingCharacters = LocaleDataImpl::get()->getHangingCharacters(LOCALE("zh", "TW")); -cBreakIterator = "com.sun.star.i18n.BreakIterator_zh_TW"; +cBreakIterator = u"com.sun.star.i18n.BreakIterator_zh_TW"_ustr; } // @@ -169,7 +169,7 @@ BreakIterator_ja::BreakIterator_ja() m_oDict->setJapaneseWordBreak(); assert(hangingCharacters.pData); hangingCharacters = LocaleDataImpl::get()->getHangingCharacters(LOCALE("ja", "JP")); -cBreakIterator = "com.sun.star.i18n.BreakIterator_ja"; +cBreakIterator = u"com.sun.star.i18n.BreakIterator_ja"_ustr; } // @@ -179,7 +179,7 @@ BreakIterator_ko::BreakIterator_ko() { assert(hangingCharacters.pData); hangingCharacters = LocaleDataImpl::get()->getHangingCharacters(LOCALE("ko", "KR")); -cBreakIterator = "com.sun.star.i18n.BreakIterator_ko"; +cBreakIterator = u"com.sun.star.i18n.BreakIterator_ko"_ustr; } } diff --git a/i18npool/source/breakiterator/breakiterator_th.cxx b/i18npool/source/breakiterator/breakiterator_th.cxx index 531107b2a102..8d9245a4bf62 100644 --- a/i18npool/source/breakiterator/breakiterator_th.cxx +++ b/i18npool/source/breakiterator/breakiterator_th.cxx @@ -34,7 +34,7 @@ namespace i18npool { */ BreakIterator_th::BreakIterator_th() { -cBreakIterator = "com.sun.star.i18n.BreakIterator_th"; +cBreakIterator = u"com.sun.star.i18n.BreakIterator_th"_ustr; // to improve performance, alloc big enough memory in construct. m_aNextCellIndex.assign(512, 0); m_aPreviousCellIndex.assign(512, 0); diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx b/i18npool/source/breakiterator/breakiterator_unicode.cxx index 4927a82293fc..0caca6ab31ce 100644 --- a/i18npool/source/breakiterator/breakiterator_unicode.cxx +++ b/i18npool/source/breakiterator/
core.git: i18npool/source
i18npool/source/breakiterator/breakiteratorImpl.cxx |4 ++-- i18npool/source/calendar/calendarImpl.cxx |4 ++-- i18npool/source/characterclassification/cclass_unicode.cxx |4 ++-- i18npool/source/characterclassification/characterclassificationImpl.cxx |4 ++-- i18npool/source/characterclassification/unoscripttypedetector.cxx |4 ++-- i18npool/source/collator/collatorImpl.cxx |4 ++-- i18npool/source/localedata/localedata.cxx |6 +++--- i18npool/source/nativenumber/nativenumbersupplier.cxx |2 +- i18npool/source/numberformatcode/numberformatcode.cxx |4 ++-- i18npool/source/search/textsearch.cxx |4 ++-- i18npool/source/textconversion/textconversionImpl.cxx |4 ++-- i18npool/source/transliteration/transliterationImpl.cxx |4 ++-- i18npool/source/transliteration/transliteration_commonclass.cxx |2 +- 13 files changed, 25 insertions(+), 25 deletions(-) New commits: commit 6182f236a27d6f12527daa7fba82ddc56f95f0d3 Author: Arnaud VERSINI AuthorDate: Mon Apr 1 16:21:05 2024 +0200 Commit: Arnaud Versini CommitDate: Wed Apr 3 12:59:48 2024 +0200 i18npool : use OUString literal for XInterface implementation Change-Id: I7843e1e873c9272c8ad3eb4cad0b2ea48cafeb7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165638 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx index df2c298ca388..5a2304757603 100644 --- a/i18npool/source/breakiterator/breakiteratorImpl.cxx +++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx @@ -661,7 +661,7 @@ BreakIteratorImpl::getLocaleSpecificBreakIterator(const Locale& rLocale) OUString SAL_CALL BreakIteratorImpl::getImplementationName() { -return "com.sun.star.i18n.BreakIterator"; +return u"com.sun.star.i18n.BreakIterator"_ustr; } sal_Bool SAL_CALL @@ -673,7 +673,7 @@ BreakIteratorImpl::supportsService(const OUString& rServiceName) Sequence< OUString > SAL_CALL BreakIteratorImpl::getSupportedServiceNames() { -return { "com.sun.star.i18n.BreakIterator" }; +return { u"com.sun.star.i18n.BreakIterator"_ustr }; } } diff --git a/i18npool/source/calendar/calendarImpl.cxx b/i18npool/source/calendar/calendarImpl.cxx index 4e364696cf20..1dde59ef2b55 100644 --- a/i18npool/source/calendar/calendarImpl.cxx +++ b/i18npool/source/calendar/calendarImpl.cxx @@ -350,7 +350,7 @@ CalendarImpl::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_Int16 nNativ OUString SAL_CALL CalendarImpl::getImplementationName() { -return "com.sun.star.i18n.CalendarImpl"; +return u"com.sun.star.i18n.CalendarImpl"_ustr; } sal_Bool SAL_CALL @@ -362,7 +362,7 @@ CalendarImpl::supportsService(const OUString& rServiceName) Sequence< OUString > SAL_CALL CalendarImpl::getSupportedServiceNames() { -return { "com.sun.star.i18n.LocaleCalendar", "com.sun.star.i18n.LocaleCalendar2" }; +return { u"com.sun.star.i18n.LocaleCalendar"_ustr, u"com.sun.star.i18n.LocaleCalendar2"_ustr }; } } diff --git a/i18npool/source/characterclassification/cclass_unicode.cxx b/i18npool/source/characterclassification/cclass_unicode.cxx index e3c27e9bc0fa..2884cfb62adc 100644 --- a/i18npool/source/characterclassification/cclass_unicode.cxx +++ b/i18npool/source/characterclassification/cclass_unicode.cxx @@ -282,7 +282,7 @@ ParseResult SAL_CALL cclass_Unicode::parsePredefinedToken( OUString SAL_CALL cclass_Unicode::getImplementationName() { -return "com.sun.star.i18n.CharacterClassification_Unicode"; +return u"com.sun.star.i18n.CharacterClassification_Unicode"_ustr; } sal_Bool SAL_CALL cclass_Unicode::supportsService(const OUString& rServiceName) @@ -292,7 +292,7 @@ sal_Bool SAL_CALL cclass_Unicode::supportsService(const OUString& rServiceName) Sequence< OUString > SAL_CALL cclass_Unicode::getSupportedServiceNames() { -return { "com.sun.star.i18n.CharacterClassification_Unicode" }; +return { u"com.sun.star.i18n.CharacterClassification_Unicode"_ustr }; } } diff --git a/i18npool/source/characterclassification/characterclassificationImpl.cxx b/i18npool/source/characterclassification/characterclassificationImpl.cxx index aff424d8bef7..e317638d4650 100644 --- a/i18npool/source/characterclassification/characterclassificationImpl.cxx +++ b/i18npool/source/characterclassification/characterclassificationImpl.cxx @@ -191,7 +191,7 @@ CharacterClassificationImpl::getLocaleSpecificCharacterClassification(const Loca OUString SAL_CALL CharacterClassificationImpl::getImplementationName() { -return "com.sun.star.i18n.CharacterClassification"; +return u"com.sun.star.i18n.CharacterClassification"_ustr; }
core.git: xmloff/source
xmloff/source/script/XMLEventExport.cxx |2 +- xmloff/source/script/XMLScriptExportHandler.cxx |2 +- xmloff/source/style/prstylei.cxx|8 3 files changed, 6 insertions(+), 6 deletions(-) New commits: commit f16d04c95f6952c811b67c3891c27bd01a4824df Author: Arnaud VERSINI AuthorDate: Sun Mar 24 17:18:36 2024 +0100 Commit: Arnaud Versini CommitDate: Mon Mar 25 17:30:27 2024 +0100 xmloff : no need to use OUString literal for comparison Change-Id: I2b8f75ec56d93003d8c9c14b3cad1e3978cc6a39 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165227 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/xmloff/source/script/XMLEventExport.cxx b/xmloff/source/script/XMLEventExport.cxx index 839944a2676d..3d37095f0b5e 100644 --- a/xmloff/source/script/XMLEventExport.cxx +++ b/xmloff/source/script/XMLEventExport.cxx @@ -185,7 +185,7 @@ void XMLEventExport::ExportEvent( { // search for EventType value and then delegate to EventHandler const PropertyValue* pValue = std::find_if(rEventValues.begin(), rEventValues.end(), -[](const PropertyValue& rValue) { return u"EventType"_ustr == rValue.Name; }); +[](const PropertyValue& rValue) { return u"EventType" == rValue.Name; }); if (pValue == rEventValues.end()) return; diff --git a/xmloff/source/script/XMLScriptExportHandler.cxx b/xmloff/source/script/XMLScriptExportHandler.cxx index 6b5075d02112..b60a3f27be75 100644 --- a/xmloff/source/script/XMLScriptExportHandler.cxx +++ b/xmloff/source/script/XMLScriptExportHandler.cxx @@ -53,7 +53,7 @@ void XMLScriptExportHandler::Export( for(const auto& rValue : rValues) { -if (u"Script"_ustr == rValue.Name) +if (u"Script" == rValue.Name) { OUString sTmp; rValue.Value >>= sTmp; diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 95a869653fd9..a10fbbaed299 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -627,16 +627,16 @@ void XMLPropStyleContext::translateNameBasedDrawingLayerFillStyleDefinitionsToSt const OUString& rPropName = rMapper->GetEntryAPIName(a.mnIndex); XmlStyleFamily aStyleFamily(XmlStyleFamily::DATA_STYLE); -if(rPropName == u"FillGradientName"_ustr - || rPropName == u"FillTransparenceGradientName"_ustr) +if(rPropName == u"FillGradientName" + || rPropName == u"FillTransparenceGradientName") { aStyleFamily = XmlStyleFamily::SD_GRADIENT_ID; } -else if(rPropName == u"FillHatchName"_ustr) +else if(rPropName == u"FillHatchName") { aStyleFamily = XmlStyleFamily::SD_HATCH_ID; } -else if(rPropName == u"FillBitmapName"_ustr) +else if(rPropName == u"FillBitmapName") { aStyleFamily = XmlStyleFamily::SD_FILL_IMAGE_ID; }
core.git: svx/source
svx/source/form/fmscriptingenv.cxx | 1055 ++--- 1 file changed, 528 insertions(+), 527 deletions(-) New commits: commit 2ced3022d2c3a534a1e3ac6f5cd12cdf870c2151 Author: Arnaud VERSINI AuthorDate: Tue Dec 26 18:21:29 2023 +0100 Commit: Noel Grandin CommitDate: Wed Mar 13 17:23:22 2024 +0100 svx : use string view to avoid OUString creation Change-Id: I3e3488ed15cf314ff6a666c7ec4bd5b41f96100e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161331 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx index db7904174b0a..dd01ddf842bc 100644 --- a/svx/source/form/fmscriptingenv.cxx +++ b/svx/source/form/fmscriptingenv.cxx @@ -41,6 +41,7 @@ #include #include +#include using std::pair; @@ -102,7 +103,7 @@ namespace svxform @return if and only if the method is declared oneway, i.e. can be called asynchronously */ -static bool impl_allowAsynchronousCall_nothrow( const OUString& _rListenerType, const OUString& _rMethodName ); +static bool impl_allowAsynchronousCall_nothrow( std::u16string_view _rListenerType, std::u16string_view _rMethodName ); /** determines whether the instance is already disposed */ @@ -140,538 +141,538 @@ namespace svxform } -bool FormScriptListener::impl_allowAsynchronousCall_nothrow( const OUString& _rListenerType, const OUString& _rMethodName ) +bool FormScriptListener::impl_allowAsynchronousCall_nothrow( std::u16string_view _rListenerType, std::u16string_view _rMethodName ) { // This used to be implemented as: // is (_rListenerType + "::" + _rMethodName) a oneway function? // since we got rid of the notion of oneway, this is the list // of oneway methods, autogenerated by postprocessing of // commitdiff 90eac3e69749a9227c4b6902b1f3cef1e338c6d1 -static const o3tl::sorted_vector> delayed_event_listeners{ - pair("com.sun.star.accessibility.XAccessibleComponent","grabFocus"), - pair("com.sun.star.accessibility.XAccessibleEventBroadcaster","addAccessibleEventListener"), - pair("com.sun.star.accessibility.XAccessibleEventBroadcaster","removeAccessibleEventListener"), - pair("com.sun.star.accessibility.XAccessibleSelection","clearAccessibleSelection"), - pair("com.sun.star.accessibility.XAccessibleSelection","selectAllAccessibleChildren"), - pair("com.sun.star.awt.XActionListener","actionPerformed"), - pair("com.sun.star.awt.XActivateListener","windowActivated"), - pair("com.sun.star.awt.XActivateListener","windowDeactivated"), - pair("com.sun.star.awt.XAdjustmentListener","adjustmentValueChanged"), - pair("com.sun.star.awt.XButton","addActionListener"), - pair("com.sun.star.awt.XButton","removeActionListener"), -pair("com.sun.star.awt.XButton","setLabel"), - pair("com.sun.star.awt.XButton","setActionCommand"), - pair("com.sun.star.awt.XCheckBox","addItemListener"), - pair("com.sun.star.awt.XCheckBox","removeItemListener"), -pair("com.sun.star.awt.XCheckBox","setState"), -pair("com.sun.star.awt.XCheckBox","setLabel"), - pair("com.sun.star.awt.XCheckBox","enableTriState"), - pair("com.sun.star.awt.XComboBox","addItemListener"), - pair("com.sun.star.awt.XComboBox","removeItemListener"), - pair("com.sun.star.awt.XComboBox","addActionListener"), - pair("com.sun.star.awt.XComboBox","removeActionListener"), -pair("com.sun.star.awt.XComboBox","addItem"), -pair("com.sun.star.awt.XComboBox","addItems"), - pair("com.sun.star.awt.XComboBox","removeItems"), - pair("com.sun.star.awt.XComboBox","setDropDownLineCount"), -pair("com.sun.star.awt.XControl","setContext"), -pair("com.sun.star.awt.XControl","createPeer"), - pair("com.sun.star.awt.XControl","setDesignMode"), - pair("com.sun.star.awt.XControlContainer","setStatusText"), - pair("com.sun.star.awt.XControlContainer","addControl"), - pair("com.sun.star.awt.XControlContainer","removeControl"), - pair("com.sun.star.awt.XCurrencyField","setValue"), - pair("com.sun.star.awt.XCurrencyField","setMin"), - pair("com.sun.star.awt.XCurrencyField","setMax"), - pair("com.sun.star.awt.XCurrencyField","setFirst"), - pair("com.sun.star.awt.XCurrencyField","setLast"), - pair("com.sun.star.awt.XCurrencyField","setSpinSize"), - pair("com.sun.star.awt.XCurrencyField","setDecimalDigits"), - pair("com.sun.star.awt.XCurrencyField","setStrictFormat"), -pair("com.sun.star.awt.XDateF
core.git: basic/source
basic/source/uno/dlgcont.cxx|6 +++--- basic/source/uno/scriptcont.cxx |6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) New commits: commit 68b73e7a290a340be48c8b9ed4d9f970d9a56204 Author: Arnaud VERSINI AuthorDate: Sun Mar 3 16:30:39 2024 +0100 Commit: Arnaud Versini CommitDate: Mon Mar 11 08:32:32 2024 +0100 basic : use OUstring literal for XServiceInfo implementation Change-Id: Ic4501ec887bb3f1249ab4a8da1eae07f6b2a22ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164305 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index 666b6d355a00..170a5c0c01cd 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -471,13 +471,13 @@ SfxDialogLibraryContainer:: HasExecutableCode( const OUString& /*Library*/ ) OUString SAL_CALL SfxDialogLibraryContainer::getImplementationName( ) { -return "com.sun.star.comp.sfx2.DialogLibraryContainer"; +return u"com.sun.star.comp.sfx2.DialogLibraryContainer"_ustr; } Sequence< OUString > SAL_CALL SfxDialogLibraryContainer::getSupportedServiceNames( ) { -return {"com.sun.star.script.DocumentDialogLibraryContainer", -"com.sun.star.script.DialogLibraryContainer"}; // for compatibility +return {u"com.sun.star.script.DocumentDialogLibraryContainer"_ustr, +u"com.sun.star.script.DialogLibraryContainer"_ustr}; // for compatibility } // Implementation class SfxDialogLibrary diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 2a5a1249a017..2f5cb5f15198 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -1113,13 +1113,13 @@ sal_Bool SAL_CALL SfxScriptLibraryContainer:: HasExecutableCode( const OUString& // Service OUString SAL_CALL SfxScriptLibraryContainer::getImplementationName( ) { -return "com.sun.star.comp.sfx2.ScriptLibraryContainer"; +return u"com.sun.star.comp.sfx2.ScriptLibraryContainer"_ustr; } Sequence< OUString > SAL_CALL SfxScriptLibraryContainer::getSupportedServiceNames( ) { -return {"com.sun.star.script.DocumentScriptLibraryContainer", -"com.sun.star.script.ScriptLibraryContainer"}; // for compatibility +return {u"com.sun.star.script.DocumentScriptLibraryContainer"_ustr, +u"com.sun.star.script.ScriptLibraryContainer"_ustr}; // for compatibility } // Implementation class SfxScriptLibrary
core.git: basegfx/source
basegfx/source/tools/unopolypolygon.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit be6243144eb39838294258a80b1f153bcd3e7029 Author: Arnaud VERSINI AuthorDate: Sun Mar 3 16:33:19 2024 +0100 Commit: Arnaud Versini CommitDate: Sun Mar 10 17:17:00 2024 +0100 basegfx : use OUstring literal for XServiceInfo implementation Change-Id: I18a17e38897c1feda7fbba330c14a79c9b6d6f93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164306 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/basegfx/source/tools/unopolypolygon.cxx b/basegfx/source/tools/unopolypolygon.cxx index 41f149731965..323e06a96f18 100644 --- a/basegfx/source/tools/unopolypolygon.cxx +++ b/basegfx/source/tools/unopolypolygon.cxx @@ -421,7 +421,7 @@ namespace basegfx::unotools OUString SAL_CALL UnoPolyPolygon::getImplementationName() { -return "gfx::internal::UnoPolyPolygon"; +return u"gfx::internal::UnoPolyPolygon"_ustr; } sal_Bool SAL_CALL UnoPolyPolygon::supportsService( const OUString& ServiceName ) @@ -431,7 +431,7 @@ namespace basegfx::unotools uno::Sequence< OUString > SAL_CALL UnoPolyPolygon::getSupportedServiceNames() { -return { "com.sun.star.rendering.PolyPolygon2D" }; +return { u"com.sun.star.rendering.PolyPolygon2D"_ustr }; } B2DPolyPolygon UnoPolyPolygon::getPolyPolygon() const
core.git: basctl/source
basctl/source/accessibility/accessibledialogcontrolshape.cxx |4 ++-- basctl/source/accessibility/accessibledialogwindow.cxx |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) New commits: commit b7b029cd71cf008117e7035fe7f883cc09e58247 Author: Arnaud VERSINI AuthorDate: Sun Mar 3 16:15:25 2024 +0100 Commit: Arnaud Versini CommitDate: Sun Mar 10 16:42:20 2024 +0100 basctl : use OUstring literal for XServiceInfo implementation Change-Id: Iee7585585b5e01fad4609f37a06d2aeeff492123 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164304 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/basctl/source/accessibility/accessibledialogcontrolshape.cxx b/basctl/source/accessibility/accessibledialogcontrolshape.cxx index 62a260948ff9..c19741c95afa 100644 --- a/basctl/source/accessibility/accessibledialogcontrolshape.cxx +++ b/basctl/source/accessibility/accessibledialogcontrolshape.cxx @@ -280,7 +280,7 @@ void AccessibleDialogControlShape::propertyChange( const beans::PropertyChangeEv // XServiceInfo OUString AccessibleDialogControlShape::getImplementationName() { -return "com.sun.star.comp.basctl.AccessibleShape"; +return u"com.sun.star.comp.basctl.AccessibleShape"_ustr; } sal_Bool AccessibleDialogControlShape::supportsService( const OUString& rServiceName ) @@ -290,7 +290,7 @@ sal_Bool AccessibleDialogControlShape::supportsService( const OUString& rService Sequence< OUString > AccessibleDialogControlShape::getSupportedServiceNames() { -return { "com.sun.star.drawing.AccessibleShape" }; +return { u"com.sun.star.drawing.AccessibleShape"_ustr }; } // XAccessible diff --git a/basctl/source/accessibility/accessibledialogwindow.cxx b/basctl/source/accessibility/accessibledialogwindow.cxx index d5c702616d9f..e9b4513294fb 100644 --- a/basctl/source/accessibility/accessibledialogwindow.cxx +++ b/basctl/source/accessibility/accessibledialogwindow.cxx @@ -505,7 +505,7 @@ void AccessibleDialogWindow::disposing() // XServiceInfo OUString AccessibleDialogWindow::getImplementationName() { -return "com.sun.star.comp.basctl.AccessibleWindow"; +return u"com.sun.star.comp.basctl.AccessibleWindow"_ustr; } sal_Bool AccessibleDialogWindow::supportsService( const OUString& rServiceName ) @@ -515,7 +515,7 @@ sal_Bool AccessibleDialogWindow::supportsService( const OUString& rServiceName ) Sequence< OUString > AccessibleDialogWindow::getSupportedServiceNames() { -return { "com.sun.star.awt.AccessibleWindow" }; +return { u"com.sun.star.awt.AccessibleWindow"_ustr }; } // XAccessible
core.git: avmedia/source
avmedia/source/gstreamer/gstplayer.cxx |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) New commits: commit 140a3719f870381a81f5bc2e3531568123f439eb Author: Arnaud VERSINI AuthorDate: Mon Feb 5 16:08:45 2024 +0100 Commit: Arnaud Versini CommitDate: Sun Mar 10 15:32:52 2024 +0100 avmedia : no need to use constexpr here Change-Id: I1b9975841a702d7ad3e05adef3d849c63ddf264a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163009 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index fd1407b3ca4f..1a91a689299e 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -50,8 +50,6 @@ #include #include -constexpr OUStringLiteral AVMEDIA_GST_PLAYER_IMPLEMENTATIONNAME = u"com.sun.star.comp.avmedia.Player_GStreamer"; -constexpr OUString AVMEDIA_GST_PLAYER_SERVICENAME= u"com.sun.star.media.Player_GStreamer"_ustr; #define AVVERSION "gst 1.0: " using namespace ::com::sun::star; @@ -951,7 +949,7 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() OUString SAL_CALL Player::getImplementationName() { -return AVMEDIA_GST_PLAYER_IMPLEMENTATIONNAME; +return u"com.sun.star.comp.avmedia.Player_GStreamer"_ustr; } @@ -963,7 +961,7 @@ sal_Bool SAL_CALL Player::supportsService( const OUString& ServiceName ) uno::Sequence< OUString > SAL_CALL Player::getSupportedServiceNames() { -return { AVMEDIA_GST_PLAYER_SERVICENAME }; +return { u"com.sun.star.media.Player_GStreamer"_ustr }; } } // namespace
core.git: canvas/source
canvas/source/cairo/cairo_canvas.cxx |4 ++-- canvas/source/cairo/cairo_canvasbitmap.cxx |4 ++-- canvas/source/cairo/cairo_canvascustomsprite.cxx |4 ++-- canvas/source/cairo/cairo_canvasfont.cxx |4 ++-- canvas/source/cairo/cairo_spritecanvas.cxx |2 +- canvas/source/cairo/cairo_textlayout.cxx |4 ++-- canvas/source/tools/cachedprimitivebase.cxx |4 ++-- canvas/source/tools/parametricpolypolygon.cxx|4 ++-- canvas/source/vcl/canvas.cxx |4 ++-- canvas/source/vcl/canvasbitmap.cxx |4 ++-- canvas/source/vcl/canvascustomsprite.cxx |4 ++-- canvas/source/vcl/canvasfont.cxx |4 ++-- canvas/source/vcl/textlayout.cxx |4 ++-- 13 files changed, 25 insertions(+), 25 deletions(-) New commits: commit 6a831189367528d8d9eea0eb6826af401f756cc6 Author: Arnaud VERSINI AuthorDate: Tue Feb 6 13:04:11 2024 +0100 Commit: Mike Kaganski CommitDate: Thu Feb 8 04:37:27 2024 +0100 canvas : use more OUString literals Change-Id: I539e1e6d04299154bfe1ad2cf0362bdf3d96537b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163051 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx index 1a16a9f813cb..100ee51c0aa2 100644 --- a/canvas/source/cairo/cairo_canvas.cxx +++ b/canvas/source/cairo/cairo_canvas.cxx @@ -110,7 +110,7 @@ namespace cairocanvas OUString SAL_CALL Canvas::getServiceName( ) { -return "com.sun.star.rendering.Canvas.Cairo"; +return u"com.sun.star.rendering.Canvas.Cairo"_ustr; } // XServiceInfo @@ -121,7 +121,7 @@ namespace cairocanvas } OUString Canvas::getImplementationName() { -return "com.sun.star.comp.rendering.Canvas.Cairo"; +return u"com.sun.star.comp.rendering.Canvas.Cairo"_ustr; } css::uno::Sequence< OUString > Canvas::getSupportedServiceNames() { diff --git a/canvas/source/cairo/cairo_canvasbitmap.cxx b/canvas/source/cairo/cairo_canvasbitmap.cxx index 9f18be80824a..c4de75ee2fce 100644 --- a/canvas/source/cairo/cairo_canvasbitmap.cxx +++ b/canvas/source/cairo/cairo_canvasbitmap.cxx @@ -145,7 +145,7 @@ namespace cairocanvas OUString SAL_CALL CanvasBitmap::getImplementationName( ) { -return "CairoCanvas.CanvasBitmap"; +return u"CairoCanvas.CanvasBitmap"_ustr; } sal_Bool SAL_CALL CanvasBitmap::supportsService( const OUString& ServiceName ) @@ -155,7 +155,7 @@ namespace cairocanvas uno::Sequence< OUString > SAL_CALL CanvasBitmap::getSupportedServiceNames( ) { -return { "com.sun.star.rendering.CanvasBitmap" }; +return { u"com.sun.star.rendering.CanvasBitmap"_ustr }; } } diff --git a/canvas/source/cairo/cairo_canvascustomsprite.cxx b/canvas/source/cairo/cairo_canvascustomsprite.cxx index f7fffb6e50be..72fb291ebf35 100644 --- a/canvas/source/cairo/cairo_canvascustomsprite.cxx +++ b/canvas/source/cairo/cairo_canvascustomsprite.cxx @@ -134,7 +134,7 @@ namespace cairocanvas OUString SAL_CALL CanvasCustomSprite::getImplementationName() { -return "CairoCanvas.CanvasCustomSprite"; +return u"CairoCanvas.CanvasCustomSprite"_ustr; } sal_Bool SAL_CALL CanvasCustomSprite::supportsService( const OUString& ServiceName ) @@ -144,7 +144,7 @@ namespace cairocanvas uno::Sequence< OUString > SAL_CALL CanvasCustomSprite::getSupportedServiceNames() { -return { "com.sun.star.rendering.CanvasCustomSprite" }; +return { u"com.sun.star.rendering.CanvasCustomSprite"_ustr }; } } diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx index 2445f408853c..a2650811b721 100644 --- a/canvas/source/cairo/cairo_canvasfont.cxx +++ b/canvas/source/cairo/cairo_canvasfont.cxx @@ -139,7 +139,7 @@ namespace cairocanvas OUString SAL_CALL CanvasFont::getImplementationName() { -return "CairoCanvas::CanvasFont"; +return u"CairoCanvas::CanvasFont"_ustr; } sal_Bool SAL_CALL CanvasFont::supportsService( const OUString& ServiceName ) @@ -149,7 +149,7 @@ namespace cairocanvas uno::Sequence< OUString > SAL_CALL CanvasFont::getSupportedServiceNames() { -return { "com.sun.star.rendering.CanvasFont" }; +return { u"com.sun.star.rendering.CanvasFont"_ustr }; } vcl::Font const & CanvasFont::getVCLFont() const diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx index 5af40370c57f..be26b17774d7 100644 --- a/canvas/source/cairo/cairo_spritecanvas.cxx +++ b/canvas/source/cairo/cairo_spritecanvas.cxx @@ -144,7 +144,7 @@ namespace cairocanvas } OUString SpriteCanvas::getImplementationName() { -return "com.sun.star.comp.rendering.SpriteCanvas.Cairo";
core.git: starmath/inc starmath/IwyuFilter_starmath.yaml starmath/Library_sm.mk starmath/source
starmath/IwyuFilter_starmath.yaml |3 starmath/Library_sm.mk |1 starmath/inc/mathml/attribute.hxx | 16 starmath/source/mathml/def.cxx | 124 - starmath/source/mathml/element.cxx | 138 +++-- 5 files changed, 117 insertions(+), 165 deletions(-) New commits: commit fe012b3571e214a37fc0b952295a2235f1296591 Author: Arnaud VERSINI AuthorDate: Thu Feb 1 16:09:57 2024 +0100 Commit: Noel Grandin CommitDate: Wed Feb 7 09:00:43 2024 +0100 starmath : move static data to usage location Change-Id: Id6e500f84ee6d121bdd67e78a8eccfbc10b6ef27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162884 Reviewed-by: Michael Meeks Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/starmath/IwyuFilter_starmath.yaml b/starmath/IwyuFilter_starmath.yaml index 72047b7c8ecc..3da2213e83fa 100644 --- a/starmath/IwyuFilter_starmath.yaml +++ b/starmath/IwyuFilter_starmath.yaml @@ -46,9 +46,6 @@ excludelist: - register.hxx # Needed for template - com/sun/star/frame/XModel.hpp -starmath/source/mathml/def.cxx: -# Needed for extern -- mathml/attribute.hxx starmath/source/mathml/mathmlexport.cxx: # Needed for rtl::math::round - rtl/math.hxx diff --git a/starmath/Library_sm.mk b/starmath/Library_sm.mk index b50cef47e3dd..9791ffdd5b97 100644 --- a/starmath/Library_sm.mk +++ b/starmath/Library_sm.mk @@ -110,7 +110,6 @@ $(eval $(call gb_Library_add_exception_objects,sm,\ starmath/source/mathml/iterator \ starmath/source/mathml/attribute \ starmath/source/mathml/element \ -starmath/source/mathml/def \ starmath/source/mathml/starmathdatabase \ )) diff --git a/starmath/inc/mathml/attribute.hxx b/starmath/inc/mathml/attribute.hxx index 946e9f463e9c..6d991c50c853 100644 --- a/starmath/inc/mathml/attribute.hxx +++ b/starmath/inc/mathml/attribute.hxx @@ -184,20 +184,4 @@ public: void setMlSymmetric(const SmMlSymmetric* aSymmetric); }; -/* element's attributes */ -/*/ - -namespace starmathdatabase -{ -extern SmMlAttributePos MlAttributeListEmpty[1]; -extern SmMlAttributePos MlAttributeListMath[1]; -extern SmMlAttributePos MlAttributeListMi[7]; -extern SmMlAttributePos MlAttributeListMerror[4]; -extern SmMlAttributePos MlAttributeListMn[7]; -extern SmMlAttributePos MlAttributeListMo[18]; -extern SmMlAttributePos MlAttributeListMrow[4]; -extern SmMlAttributePos MlAttributeListMtext[7]; -extern SmMlAttributePos MlAttributeListMstyle[18]; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/starmath/source/mathml/def.cxx b/starmath/source/mathml/def.cxx deleted file mode 100644 index 484dcd665393.. --- a/starmath/source/mathml/def.cxx +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -#include - -SmMlAttributePos starmathdatabase::MlAttributeListEmpty[] = { -// clang-format off -{ SmMlAttributeValueType::NMlEmpty, 0 } -// clang-format on -}; - -SmMlAttributePos starmathdatabase::MlAttributeListMath[] = { -// clang-format off -{ SmMlAttributeValueType::NMlEmpty, 0 } -// clang-format on -}; - -SmMlAttributePos starmathdatabase::MlAttributeListMi[] = { -// clang-format off -{ SmMlAttributeValueType::MlHref, 0 }, -{ SmMlAttributeValueType::MlDir, 1 }, -{ SmMlAttributeValueType::MlMathbackground, 2 }, -{ SmMlAttributeValueType::MlMathcolor, 3 }, -{ SmMlAttributeValueType::MlDisplaystyle, 4 }, -{ SmMlAttributeValueType::MlMathsize, 5 }, -{ SmMlAttributeValueType::MlMathvariant, 6 } -// clang-format on -}; - -SmMlAttributePos starmathdatabase::MlAttributeListMerror[] = { -// clang-format off -{ SmMlAttributeValueType::MlHref, 0 }, -{ SmMlAttributeValueType::MlMathbackground, 1 }, -{ SmMlAttributeValueType::MlMathcolor, 2 }, -{ SmMlAttributeValueType::MlDisplaystyle, 3 } -// clang-format on -}; - -SmMlAttributePos starmathdatabase::MlAttributeListMn[] = { -// clang-format off -{ SmMlAttributeValueType::MlHref, 0 }, -{ SmMlAttributeValueType::MlDir, 1 }, -{ SmMlAttributeValueType::MlMathbackground, 2 }, -{ SmMlAttributeValueType::MlMathcolor, 3 }, -{ SmMlAttributeValueType::MlDisplaystyle, 4 }, -{ SmMlAttributeValueType::MlMathsize, 5 }, -{ SmMlAttributeValueType::MlMathvariant, 6 } -// clang-format on -}; - -SmMlAttributePos starmathdatabase::MlAttributeListMo[] = { -// clang-format of
core.git: writerfilter/source
writerfilter/source/dmapper/PropertyMap.cxx | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) New commits: commit f504b2de4abd204d87be25ee85ac7b31521757ac Author: Arnaud VERSINI AuthorDate: Thu Dec 28 15:13:39 2023 +0100 Commit: Noel Grandin CommitDate: Sun Jan 21 13:51:57 2024 +0100 writerfilter : use constexpr frozen unordered_set instead of std::unordered_set Change-Id: I37b4b5ec56f846b5c46faeaa5aebb88340ac3c6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161385 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/writerfilter/source/dmapper/PropertyMap.cxx b/writerfilter/source/dmapper/PropertyMap.cxx index 29444d809b1e..41c25ce50816 100644 --- a/writerfilter/source/dmapper/PropertyMap.cxx +++ b/writerfilter/source/dmapper/PropertyMap.cxx @@ -20,7 +20,6 @@ #include #include -#include #include "PropertyMap.hxx" #include "TagLogger.hxx" @@ -67,6 +66,10 @@ #include #include +#include +#include +#include + using namespace com::sun::star; namespace writerfilter::dmapper { @@ -1399,12 +1402,12 @@ void SectionPropertyMap::CreateEvenOddPageStyleCopy(DomainMapper_Impl& rDM_Impl, const uno::Sequence propertyList(pagePropertiesInfo->getProperties()); // Ignore write-only properties. -static const std::unordered_set staticDenylist = { -"FooterBackGraphicURL", "BackGraphicURL", "HeaderBackGraphicURL", -"HeaderIsOn", "FooterIsOn", -"HeaderIsShared", "FooterIsShared", "FirstIsShared", -"HeaderText", "HeaderTextLeft", "HeaderTextFirst", -"FooterText", "FooterTextLeft", "FooterTextFirst" }; +static constexpr frozen::unordered_set staticDenylist = { +u"FooterBackGraphicURL", u"BackGraphicURL", u"HeaderBackGraphicURL", +u"HeaderIsOn", u"FooterIsOn", +u"HeaderIsShared", u"FooterIsShared", u"FirstIsShared", +u"HeaderText", u"HeaderTextLeft", u"HeaderTextFirst", +u"FooterText", u"FooterTextLeft", u"FooterTextFirst" }; for (const auto& rProperty : propertyList) {
core.git: animations/source
animations/source/animcore/animcore.cxx | 48 1 file changed, 24 insertions(+), 24 deletions(-) New commits: commit c4fb690e6f4aedde124c045bd136f8f7c1e974a4 Author: Arnaud VERSINI AuthorDate: Sun Jan 7 13:39:23 2024 +0100 Commit: Noel Grandin CommitDate: Sun Jan 21 13:51:07 2024 +0100 animations : use string OUString literals in a11y for XServiceInfo impl Change-Id: Ifd23fd38e5fa289e9606ba0a8d5a04449ddcb0ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161738 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx index 66b24a2b52b5..a8511a4051f2 100644 --- a/animations/source/animcore/animcore.cxx +++ b/animations/source/animcore/animcore.cxx @@ -512,122 +512,122 @@ AnimationNode::AnimationNode( const AnimationNode& rNode ) static Sequence getSupportedServiceNames_PAR() { -return { "com.sun.star.animations.ParallelTimeContainer" }; +return { u"com.sun.star.animations.ParallelTimeContainer"_ustr }; } static OUString getImplementationName_PAR() { -return "animcore::ParallelTimeContainer"; +return u"animcore::ParallelTimeContainer"_ustr; } static Sequence getSupportedServiceNames_SEQ() { -return { "com.sun.star.animations.SequenceTimeContainer" }; +return { u"com.sun.star.animations.SequenceTimeContainer"_ustr }; } static OUString getImplementationName_SEQ() { -return "animcore::SequenceTimeContainer"; +return u"animcore::SequenceTimeContainer"_ustr; } static Sequence getSupportedServiceNames_ITERATE() { -return { "com.sun.star.animations.IterateContainer" }; +return { u"com.sun.star.animations.IterateContainer"_ustr }; } static OUString getImplementationName_ITERATE() { -return "animcore::IterateContainer"; +return u"animcore::IterateContainer"_ustr; } static Sequence getSupportedServiceNames_ANIMATE() { -return { "com.sun.star.animations.Animate" }; +return { u"com.sun.star.animations.Animate"_ustr }; } static OUString getImplementationName_ANIMATE() { -return "animcore::Animate"; +return u"animcore::Animate"_ustr; } static Sequence getSupportedServiceNames_SET() { -return { "com.sun.star.animations.AnimateSet" }; +return { u"com.sun.star.animations.AnimateSet"_ustr }; } static OUString getImplementationName_SET() { -return "animcore::AnimateSet"; +return u"animcore::AnimateSet"_ustr; } static Sequence getSupportedServiceNames_ANIMATECOLOR() { -return { "com.sun.star.animations.AnimateColor" }; +return { u"com.sun.star.animations.AnimateColor"_ustr }; } static OUString getImplementationName_ANIMATECOLOR() { -return "animcore::AnimateColor"; +return u"animcore::AnimateColor"_ustr; } static Sequence getSupportedServiceNames_ANIMATEMOTION() { -return { "com.sun.star.animations.AnimateMotion" }; +return { u"com.sun.star.animations.AnimateMotion"_ustr }; } static OUString getImplementationName_ANIMATEMOTION() { -return "animcore::AnimateMotion"; +return u"animcore::AnimateMotion"_ustr; } static Sequence getSupportedServiceNames_ANIMATEPHYSICS() { -return { "com.sun.star.animations.AnimatePhysics" }; +return { u"com.sun.star.animations.AnimatePhysics"_ustr }; } static OUString getImplementationName_ANIMATEPHYSICS() { -return "animcore::AnimatePhysics"; +return u"animcore::AnimatePhysics"_ustr; } static Sequence getSupportedServiceNames_ANIMATETRANSFORM() { -return { "com.sun.star.animations.AnimateTransform" }; +return { u"com.sun.star.animations.AnimateTransform"_ustr }; } static OUString getImplementationName_ANIMATETRANSFORM() { -return "animcore::AnimateTransform"; +return u"animcore::AnimateTransform"_ustr; } static Sequence getSupportedServiceNames_TRANSITIONFILTER() { -return { "com.sun.star.animations.TransitionFilter" }; +return { u"com.sun.star.animations.TransitionFilter"_ustr }; } static OUString getImplementationName_TRANSITIONFILTER() { -return "animcore::TransitionFilter"; +return u"animcore::TransitionFilter"_ustr; } static Sequence getSupportedServiceNames_AUDIO() { -return { "com.sun.star.animations.Audio" }; +return { u"com.sun.star.animations.Audio"_ustr }; } static OUString getImplementationName_AUDIO() { -return "animcore::Audio"; +return u"animcore::Audio"_ustr; } static Sequence getSupportedServiceNames_COMMAND() { -return { "com.sun.star.animations.Command" }; +return { u"com.sun.star.animations.Command"_ustr }; } static OUString getImplementationName_COMMAND() { -return "animcore::Command"; +return u"animcore::Command"_ustr; } // XInterface
core.git: starmath/source
starmath/source/mathml/iterator.cxx |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) New commits: commit 5b93f1f7cbbec881d13e573a5901a5d353e0dd54 Author: Arnaud VERSINI AuthorDate: Thu Dec 28 15:35:33 2023 +0100 Commit: Arnaud Versini CommitDate: Sat Dec 30 15:26:05 2023 +0100 starmath : remove useless delete indirection Change-Id: Ib308ce7735bdd1dea8611b08a8b73dd2686ca0d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161387 Tested-by: Jenkins Reviewed-by: Noel Grandin Reviewed-by: Arnaud Versini diff --git a/starmath/source/mathml/iterator.cxx b/starmath/source/mathml/iterator.cxx index 24de35c18323..fa19f11b019b 100644 --- a/starmath/source/mathml/iterator.cxx +++ b/starmath/source/mathml/iterator.cxx @@ -16,8 +16,6 @@ namespace mathml { -static inline void deleteElement(SmMlElement* aSmMlElement, void*) { delete aSmMlElement; } - static inline void cloneElement(SmMlElement* aSmMlElement, void* aData) { // Prepare data @@ -58,7 +56,7 @@ void SmMlIteratorFree(SmMlElement* pMlElementTree) { SmMlIteratorFree(pMlElementTree->getSubElement(i)); } -deleteElement(pMlElementTree, nullptr); +delete pMlElementTree; } SmMlElement* SmMlIteratorCopy(SmMlElement* pMlElementTree)
core.git: accessibility/source
accessibility/source/extended/AccessibleBrowseBox.cxx |2 +- accessibility/source/extended/AccessibleBrowseBoxBase.cxx |2 +- accessibility/source/extended/AccessibleBrowseBoxCheckBoxCell.cxx |2 +- accessibility/source/extended/AccessibleBrowseBoxHeaderBar.cxx|2 +- accessibility/source/extended/AccessibleBrowseBoxHeaderCell.cxx |2 +- accessibility/source/extended/AccessibleBrowseBoxTable.cxx|2 +- accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx|2 +- accessibility/source/extended/AccessibleGridControl.cxx |2 +- accessibility/source/extended/AccessibleGridControlBase.cxx |2 +- accessibility/source/extended/AccessibleGridControlHeader.cxx |2 +- accessibility/source/extended/AccessibleGridControlHeaderCell.cxx |2 +- accessibility/source/extended/AccessibleGridControlTable.cxx |2 +- accessibility/source/extended/AccessibleGridControlTableCell.cxx |2 +- accessibility/source/extended/accessibleeditbrowseboxcell.cxx |2 +- accessibility/source/extended/accessibleiconchoicectrl.cxx|8 accessibility/source/extended/accessibleiconchoicectrlentry.cxx |8 accessibility/source/extended/accessiblelistbox.cxx |8 accessibility/source/extended/accessiblelistboxentry.cxx |8 accessibility/source/extended/accessibletabbar.cxx|4 ++-- accessibility/source/extended/accessibletabbarpage.cxx|4 ++-- accessibility/source/extended/accessibletabbarpagelist.cxx|4 ++-- accessibility/source/extended/accessibletablistboxtable.cxx |2 +- accessibility/source/standard/vclxaccessiblebutton.cxx|4 ++-- accessibility/source/standard/vclxaccessiblecheckbox.cxx |4 ++-- accessibility/source/standard/vclxaccessiblecombobox.cxx |4 ++-- accessibility/source/standard/vclxaccessibledropdowncombobox.cxx |4 ++-- accessibility/source/standard/vclxaccessibledropdownlistbox.cxx |4 ++-- accessibility/source/standard/vclxaccessibleedit.cxx |4 ++-- accessibility/source/standard/vclxaccessiblefixedhyperlink.cxx|4 ++-- accessibility/source/standard/vclxaccessiblefixedtext.cxx |4 ++-- accessibility/source/standard/vclxaccessibleheaderbar.cxx |4 ++-- accessibility/source/standard/vclxaccessiblemenu.cxx |4 ++-- accessibility/source/standard/vclxaccessiblepopupmenu.cxx |4 ++-- accessibility/source/standard/vclxaccessiblescrollbar.cxx |4 ++-- accessibility/source/standard/vclxaccessiblestatusbar.cxx |4 ++-- accessibility/source/standard/vclxaccessiblestatusbaritem.cxx |4 ++-- accessibility/source/standard/vclxaccessibletabcontrol.cxx|4 ++-- accessibility/source/standard/vclxaccessibletabpage.cxx |4 ++-- accessibility/source/standard/vclxaccessibletextfield.cxx |4 ++-- accessibility/source/standard/vclxaccessibletoolbox.cxx |4 ++-- accessibility/source/standard/vclxaccessibletoolboxitem.cxx | 10 +- 41 files changed, 78 insertions(+), 78 deletions(-) New commits: commit 0f6f5048d223731aa52b768a77244d0208711391 Author: Arnaud VERSINI AuthorDate: Tue Dec 26 14:18:14 2023 +0100 Commit: Michael Weghorn CommitDate: Fri Dec 29 00:36:51 2023 +0100 use string OUString literals in a11y for XServiceInfo impl. Used in getImplementationName and getSupportedServiceNames Change-Id: I003db960123c66d4d47b99aec678b156bf4c4d91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161301 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/accessibility/source/extended/AccessibleBrowseBox.cxx b/accessibility/source/extended/AccessibleBrowseBox.cxx index 6085ff9ec3ce..8408c0abe23a 100644 --- a/accessibility/source/extended/AccessibleBrowseBox.cxx +++ b/accessibility/source/extended/AccessibleBrowseBox.cxx @@ -171,7 +171,7 @@ void SAL_CALL AccessibleBrowseBox::grabFocus() OUString SAL_CALL AccessibleBrowseBox::getImplementationName() { -return "com.sun.star.comp.svtools.AccessibleBrowseBox"; +return u"com.sun.star.comp.svtools.AccessibleBrowseBox"_ustr; } diff --git a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx index 121655d78823..8d9a0577e638 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxBase.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxBase.cxx @@ -304,7 +304,7 @@ sal_Bool SAL_CALL AccessibleBrowseBoxBase::supportsService( Sequence< OUString > SAL_CALL AccessibleBrowseBoxBase::getSupportedServiceNames() { -return { "com.sun.star.accessibility.AccessibleContext" }; +return { u"com.sun.star.accessibility.AccessibleContext"_ustr }; } // other public methods
[Libreoffice-commits] core.git: vcl/unx
vcl/unx/gtk3/gtkinst.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 2bbacaf8170a119099fb1a6d89ab608051194625 Author: Arnaud VERSINI AuthorDate: Sun Nov 12 16:17:44 2023 +0100 Commit: Mike Kaganski CommitDate: Mon Nov 20 07:24:19 2023 +0100 vcl gtk3 : no need to use ClearableMutexGuard instead of Guard Change-Id: I3dc75125fa89f6b584d4caa1a950e0ec9a461fc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159347 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 22b0e0273381..e3369c163f44 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -1456,14 +1456,14 @@ std::vector VclToGtkHelper::FormatsToGtk(const css::uno::Sequenc IMPL_LINK_NOARG(VclGtkClipboard, AsyncSetGtkClipboard, void*, void) { -osl::ClearableMutexGuard aGuard( m_aMutex ); +osl::Guard aGuard( m_aMutex ); m_pSetClipboardEvent = nullptr; SetGtkClipboard(); } void VclGtkClipboard::SyncGtkClipboard() { -osl::ClearableMutexGuard aGuard(m_aMutex); +osl::Guard aGuard(m_aMutex); if (m_pSetClipboardEvent) { Application::RemoveUserEvent(m_pSetClipboardEvent); @@ -1569,14 +1569,14 @@ sal_Int8 VclGtkClipboard::getRenderingCapabilities() void VclGtkClipboard::addClipboardListener( const Reference< datatransfer::clipboard::XClipboardListener >& listener ) { -osl::ClearableMutexGuard aGuard( m_aMutex ); +osl::Guard aGuard( m_aMutex ); m_aListeners.push_back( listener ); } void VclGtkClipboard::removeClipboardListener( const Reference< datatransfer::clipboard::XClipboardListener >& listener ) { -osl::ClearableMutexGuard aGuard( m_aMutex ); +osl::Guard aGuard( m_aMutex ); m_aListeners.erase(std::remove(m_aListeners.begin(), m_aListeners.end(), listener), m_aListeners.end()); }
[Libreoffice-commits] core.git: accessibility/source
accessibility/source/helper/characterattributeshelper.cxx | 26 +++--- 1 file changed, 13 insertions(+), 13 deletions(-) New commits: commit 9b462abdb36ce73ad627a0b603b24d3f35ffc1ee Author: Arnaud Versini AuthorDate: Thu Sep 21 11:25:30 2023 +0200 Commit: Mike Kaganski CommitDate: Tue Oct 3 16:06:42 2023 +0200 accessibility: avoid OUString creation by using unicode OUString literals Change-Id: I0f1f8c4e7601c68af607d6c540527e2979520586 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157136 Reviewed-by: Mike Kaganski Tested-by: Mike Kaganski diff --git a/accessibility/source/helper/characterattributeshelper.cxx b/accessibility/source/helper/characterattributeshelper.cxx index 1d6120ff483c..7e2a2334bf57 100644 --- a/accessibility/source/helper/characterattributeshelper.cxx +++ b/accessibility/source/helper/characterattributeshelper.cxx @@ -28,19 +28,19 @@ using namespace ::com::sun::star::beans; CharacterAttributesHelper::CharacterAttributesHelper( const vcl::Font& rFont, sal_Int32 nBackColor, sal_Int32 nColor ) { -m_aAttributeMap.emplace( OUString( "CharBackColor" ), Any( nBackColor ) ); -m_aAttributeMap.emplace( OUString( "CharColor" ), Any( nColor ) ); -m_aAttributeMap.emplace( OUString( "CharFontCharSet" ), Any( static_cast(rFont.GetCharSet()) ) ); -m_aAttributeMap.emplace( OUString( "CharFontFamily" ),Any( static_cast(rFont.GetFamilyType()) ) ); -m_aAttributeMap.emplace( OUString( "CharFontName" ), Any( rFont.GetFamilyName() ) ); -m_aAttributeMap.emplace( OUString( "CharFontPitch" ), Any( static_cast(rFont.GetPitch()) ) ); -m_aAttributeMap.emplace( OUString( "CharFontStyleName" ), Any( rFont.GetStyleName() ) ); -m_aAttributeMap.emplace( OUString( "CharHeight" ),Any( static_cast(rFont.GetFontSize().Height()) ) ); -m_aAttributeMap.emplace( OUString( "CharScaleWidth" ),Any( static_cast(rFont.GetFontSize().Width()) ) ); -m_aAttributeMap.emplace( OUString( "CharStrikeout" ), Any( static_cast(rFont.GetStrikeout()) ) ); -m_aAttributeMap.emplace( OUString( "CharUnderline" ), Any( static_cast(rFont.GetUnderline()) ) ); -m_aAttributeMap.emplace( OUString( "CharWeight" ),Any( static_cast(rFont.GetWeight()) ) ); -m_aAttributeMap.emplace( OUString( "CharPosture" ), Any( vcl::unohelper::ConvertFontSlant(rFont.GetItalic()) ) ); +m_aAttributeMap.emplace( u"CharBackColor"_ustr, Any( nBackColor ) ); +m_aAttributeMap.emplace( u"CharColor"_ustr, Any( nColor ) ); +m_aAttributeMap.emplace( u"CharFontCharSet"_ustr, Any( static_cast(rFont.GetCharSet()) ) ); +m_aAttributeMap.emplace( u"CharFontFamily"_ustr,Any( static_cast(rFont.GetFamilyType()) ) ); +m_aAttributeMap.emplace( u"CharFontName"_ustr, Any( rFont.GetFamilyName() ) ); +m_aAttributeMap.emplace( u"CharFontPitch"_ustr, Any( static_cast(rFont.GetPitch()) ) ); +m_aAttributeMap.emplace( u"CharFontStyleName"_ustr, Any( rFont.GetStyleName() ) ); +m_aAttributeMap.emplace( u"CharHeight"_ustr,Any( static_cast(rFont.GetFontSize().Height()) ) ); +m_aAttributeMap.emplace( u"CharScaleWidth"_ustr,Any( static_cast(rFont.GetFontSize().Width()) ) ); +m_aAttributeMap.emplace( u"CharStrikeout"_ustr, Any( static_cast(rFont.GetStrikeout()) ) ); +m_aAttributeMap.emplace( u"CharUnderline"_ustr, Any( static_cast(rFont.GetUnderline()) ) ); +m_aAttributeMap.emplace( u"CharWeight"_ustr,Any( static_cast(rFont.GetWeight()) ) ); +m_aAttributeMap.emplace( u"CharPosture"_ustr, Any( vcl::unohelper::ConvertFontSlant(rFont.GetItalic()) ) ); }
[Libreoffice-commits] core.git: animations/source
animations/source/animcore/animcore.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit da9582aacb3fa9f00f172e0698b3b53aedee87f9 Author: Arnaud Versini AuthorDate: Thu Sep 21 13:58:29 2023 +0200 Commit: Arnaud Versini CommitDate: Sat Sep 23 11:29:24 2023 +0200 animations : remove useless use of XComponentContext Change-Id: Ie7aa03a9ff1127f2c73ab30528dd2b732f6c4b68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157143 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx index 7592109c4855..66b24a2b52b5 100644 --- a/animations/source/animcore/animcore.cxx +++ b/animations/source/animcore/animcore.cxx @@ -72,7 +72,6 @@ using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::uno::XInterface; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Reference; -using ::com::sun::star::uno::XComponentContext; using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::XWeak; using ::com::sun::star::uno::Type;
[Libreoffice-commits] core.git: basic/source
basic/source/runtime/basrdll.cxx |9 - 1 file changed, 4 insertions(+), 5 deletions(-) New commits: commit 08a2de20238e250d5ddf8cc43341a9f48ed9d759 Author: Arnaud Versini AuthorDate: Tue Sep 19 16:17:38 2023 +0200 Commit: Noel Grandin CommitDate: Wed Sep 20 08:07:30 2023 +0200 basic : remove useless allocation in BasicDLLImpl Change-Id: I8e2628da08cb621087915dcfb4d55ddacfeaabc1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157048 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx index ba94fd7b9d2b..853863b4fcfd 100644 --- a/basic/source/runtime/basrdll.cxx +++ b/basic/source/runtime/basrdll.cxx @@ -37,12 +37,11 @@ struct BasicDLLImpl : public SvRefBase boolbDebugMode; boolbBreakEnabled; -std::unique_ptr xSbxAppData; +SbxAppData aSbxAppData; BasicDLLImpl() : bDebugMode(false) , bBreakEnabled(true) -, xSbxAppData(new SbxAppData) { } static BasicDLLImpl* BASIC_DLL; @@ -69,7 +68,7 @@ BasicDLL::~BasicDLL() std::scoped_lock aGuard(BasicDLLImpl::getMutex()); const bool bLastRef = m_xImpl->GetRefCount() == 1; if (bLastRef) { -BasicDLLImpl::BASIC_DLL->xSbxAppData->m_aGlobErr.clear(); +BasicDLLImpl::BASIC_DLL->aSbxAppData.m_aGlobErr.clear(); } m_xImpl.clear(); // only reset BASIC_DLL after the object had been destroyed @@ -122,12 +121,12 @@ void BasicDLL::BasicBreak() SbxAppData& GetSbxData_Impl() { -return *BasicDLLImpl::BASIC_DLL->xSbxAppData; +return BasicDLLImpl::BASIC_DLL->aSbxAppData; } bool IsSbxData_Impl() { -return BasicDLLImpl::BASIC_DLL && BasicDLLImpl::BASIC_DLL->xSbxAppData; +return BasicDLLImpl::BASIC_DLL; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
[Libreoffice-commits] core.git: xmlsecurity/inc xmlsecurity/source
xmlsecurity/inc/digitalsignaturesdialog.hxx|3 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 141 - 2 files changed, 68 insertions(+), 76 deletions(-) New commits: commit 0c4913e03e8427a576138601958f2dbf13b8c37b Author: Arnaud VERSINI AuthorDate: Mon Aug 14 16:16:12 2023 +0200 Commit: Noel Grandin CommitDate: Tue Sep 19 11:29:49 2023 +0200 xmlsecurity : simplify DigitalSignature Change-Id: I0531f1d69b5714942411401afb5fd605d726 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155668 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlsecurity/inc/digitalsignaturesdialog.hxx b/xmlsecurity/inc/digitalsignaturesdialog.hxx index 09a9bd0780b4..218c3e99c8b3 100644 --- a/xmlsecurity/inc/digitalsignaturesdialog.hxx +++ b/xmlsecurity/inc/digitalsignaturesdialog.hxx @@ -89,9 +89,6 @@ private: voidImplGetSignatureInformations(bool bUseTempStream, bool bCacheLastSignature); voidImplFillSignaturesBox(); voidImplShowSignaturesDetails(); -boolIsThereCertificateMgr(); -voidGetCertificateManager(OUString& aPath, OUString& sExecutable, OUString& sFoundGUIServer); -boolGetPathAllOS(OUString& aPath); css::uno::Reference getCertificate(const SignatureInformation& rInfo); css::uno::Reference getSecurityEnvironmentForCertificate( diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 5a7f16faf64b..4f886bc74f00 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -125,7 +125,73 @@ namespace constexpr std::u16string_view aGUIServers[] = { u"kleopatra", u"seahorse", u"gpa", u"kgpg"}; #endif + +bool GetPathAllOS(OUString& aPath) +{ +#ifdef _WIN32 +sal::systools::CoTaskMemAllocated sPath; +HRESULT hr += SHGetKnownFolderPath(FOLDERID_ProgramFilesX86, KF_FLAG_DEFAULT, nullptr, &sPath); + +if (FAILED(hr)) +return false; +aPath = o3tl::toU(sPath); +#else +const char* cPath = getenv("PATH"); +if (!cPath) +return false; +aPath = OUString(cPath, strlen(cPath), osl_getThreadTextEncoding()); +#endif +return (!aPath.isEmpty()); +} + +void GetCertificateManager(OUString& sExecutable) +{ +OUString aPath, aFoundGUIServer; +if (!GetPathAllOS(aPath)) +return; + +OUString aCetMgrConfig = officecfg::Office::Common::Security::Scripting::CertMgrPath::get(); +if (!aCetMgrConfig.isEmpty()) +{ +#ifdef _WIN32 +sal_Int32 nLastBackslashIndex = aCetMgrConfig.lastIndexOf('\\'); +#else +sal_Int32 nLastBackslashIndex = aCetMgrConfig.lastIndexOf('/'); +#endif +osl::FileBase::RC searchError = osl::File::searchFileURL( +aCetMgrConfig.copy(0, nLastBackslashIndex + 1), aPath, +aFoundGUIServer); +if (searchError == osl::FileBase::E_None) +return; +} + +for (const auto& rServer: aGUIServers) +{ +osl::FileBase::RC searchError = osl::File::searchFileURL( +OUString(rServer), aPath, +aFoundGUIServer); +if (searchError == osl::FileBase::E_None) +{ +osl::File::getSystemPathFromFileURL(aFoundGUIServer, sExecutable); +std::shared_ptr pBatch( +comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Security::Scripting::CertMgrPath::set(sExecutable, + pBatch); +pBatch->commit(); + +return; +} +} +} + +bool IsThereCertificateMgr() +{ +OUString sExecutable; +GetCertificateManager(sExecutable); +return (!sExecutable.isEmpty()); } +}//anonymous namespace DigitalSignaturesDialog::DigitalSignaturesDialog( weld::Window* pParent, @@ -480,82 +546,11 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, RemoveButtonHdl, weld::Button&, void) } } -bool DigitalSignaturesDialog::GetPathAllOS(OUString& aPath) -{ -#ifdef _WIN32 -aPath = [] -{ -sal::systools::CoTaskMemAllocated sPath; -HRESULT hr -= SHGetKnownFolderPath(FOLDERID_ProgramFilesX86, KF_FLAG_DEFAULT, nullptr, &sPath); -if (SUCCEEDED(hr)) -return OUString(o3tl::toU(sPath)); -return OUString(); -}(); -if (aPath.isEmpty()) -return false; -#else -const char* cPath = getenv("PATH"); -if (!cPath) -return false; -aPath = OUString(cPath, strlen(cPath), osl_getThreadTextEncoding()); -#endif -return (!aPath.isEmpty()); -} - -void DigitalSignaturesDialog::GetCertificateManager(OUString& aPath, OUString& sExecutable, -OUString& sFoundGUIServer) -{ -OUString aCetMgrConfig = offi
[Libreoffice-commits] core.git: svx/source
svx/source/accessibility/AccessibleControlShape.cxx | 44 +++- 1 file changed, 16 insertions(+), 28 deletions(-) New commits: commit aa3eea21fcf302ef4ddbba5841037378945f9d5e Author: Arnaud VERSINI AuthorDate: Sun Aug 27 18:44:21 2023 +0200 Commit: Noel Grandin CommitDate: Sun Aug 27 20:46:23 2023 +0200 svx : replace local function with OUStringLiteral Change-Id: Ica39cd5b6da3c97dd03aa9844e2dd8d99c279697 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156170 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/accessibility/AccessibleControlShape.cxx b/svx/source/accessibility/AccessibleControlShape.cxx index 8fe42db6dada..e625beaec508 100644 --- a/svx/source/accessibility/AccessibleControlShape.cxx +++ b/svx/source/accessibility/AccessibleControlShape.cxx @@ -61,29 +61,18 @@ using namespace ::com::sun::star::container; namespace { -OUString lcl_getNamePropertyName( ) -{ -return "Name"; -} -OUString lcl_getDescPropertyName( ) -{ -return "HelpText"; -} -OUString lcl_getLabelPropertyName( ) -{ -return "Label"; -} -OUString lcl_getLabelControlPropertyName( ) -{ -return "LabelControl"; -} +constexpr OUStringLiteral NAME_PROPERTY_NAME = u"Name"; +constexpr OUStringLiteral DESC_PROPERTY_NAME = u"HelpText"; +constexpr OUStringLiteral LABEL_PROPERTY_NAME = u"Label"; +constexpr OUStringLiteral LABEL_CONTROL_PROPERTY_NAME = u"LabelControl"; + // return the property which should be used as AccessibleName OUString lcl_getPreferredAccNameProperty( const Reference< XPropertySetInfo >& _rxPSI ) { -if ( _rxPSI.is() && _rxPSI->hasPropertyByName( lcl_getLabelPropertyName() ) ) -return lcl_getLabelPropertyName(); +if ( _rxPSI.is() && _rxPSI->hasPropertyByName( LABEL_PROPERTY_NAME ) ) +return LABEL_PROPERTY_NAME; else -return lcl_getNamePropertyName(); +return NAME_PROPERTY_NAME; } // determines whether or not a state which belongs to the inner context needs to be forwarded to the "composed" @@ -325,7 +314,7 @@ OUString case DRAWING_CONTROL: { // check if we can obtain the "Desc" property from the model -OUString sDesc( getControlModelStringProperty( lcl_getDescPropertyName() ) ); +OUString sDesc( getControlModelStringProperty( DESC_PROPERTY_NAME ) ); if ( sDesc.isEmpty() ) { // no -> use the default aDG.Initialize (STR_ObjNameSingulUno); @@ -333,7 +322,7 @@ OUString aDG.AddProperty ( "ControlBorder", DescriptionGenerator::PropertyType::Integer); } // ensure that we are listening to the Name property -m_bListeningForDesc = ensureListeningState( m_bListeningForDesc, true, lcl_getDescPropertyName() ); +m_bListeningForDesc = ensureListeningState( m_bListeningForDesc, true, DESC_PROPERTY_NAME ); } break; @@ -357,14 +346,14 @@ void SAL_CALL AccessibleControlShape::propertyChange( const PropertyChangeEvent& ::osl::MutexGuard aGuard( m_aMutex ); // check if it is the name or the description -if ( _rEvent.PropertyName == lcl_getNamePropertyName() -|| _rEvent.PropertyName == lcl_getLabelPropertyName() ) +if ( _rEvent.PropertyName == NAME_PROPERTY_NAME +|| _rEvent.PropertyName == LABEL_PROPERTY_NAME ) { SetAccessibleName( CreateAccessibleName(), AccessibleContextBase::AutomaticallyCreated); } -else if ( _rEvent.PropertyName == lcl_getDescPropertyName() ) +else if ( _rEvent.PropertyName == DESC_PROPERTY_NAME ) { SetAccessibleDescription( CreateAccessibleDescription(), @@ -612,7 +601,7 @@ void SAL_CALL AccessibleControlShape::disposing() { // ensure we're not listening m_bListeningForName = ensureListeningState( m_bListeningForName, false, lcl_getPreferredAccNameProperty( m_xModelPropsMeta ) ); -m_bListeningForDesc = ensureListeningState( m_bListeningForDesc, false, lcl_getDescPropertyName() ); +m_bListeningForDesc = ensureListeningState( m_bListeningForDesc, false, DESC_PROPERTY_NAME ); if ( m_bMultiplexingStates ) stopStateMultiplexing( ); @@ -843,12 +832,11 @@ AccessibleControlShape* AccessibleControlShape::GetLabeledByControlShape( ) { if(m_xControlModel.is()) { -const OUString& rAccLabelControlProperty = lcl_getLabelControlPropertyName(); Any sCtlLabelBy; // get the "label by" property value of the control -if (::comphelper::hasProperty(rAccLabelControlProperty, m_xControlModel)) +if (::comphelper::hasProperty(LABEL_CONTROL_PROPERTY_NAME, m_xControlModel)) { -sCtlLabelBy = m_xControlModel->getPropertyValue(rAccLabelControl
[Libreoffice-commits] core.git: cpputools/source
cpputools/source/sp2bv/sp2bv.cxx | 35 +-- 1 file changed, 17 insertions(+), 18 deletions(-) New commits: commit 7c5188cbd483c1aab8c7bb55a29efcd935196fa1 Author: Arnaud VERSINI AuthorDate: Sun Mar 19 17:20:44 2023 +0100 Commit: Noel Grandin CommitDate: Mon Aug 14 15:01:16 2023 +0200 sp2bv : no need to use fprintf without any formating Change-Id: Ieb276dcbd91873bd5121ae7534f0e120c88a88d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149114 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cpputools/source/sp2bv/sp2bv.cxx b/cpputools/source/sp2bv/sp2bv.cxx index 9998e7cdb7c4..7e525f7fefcd 100644 --- a/cpputools/source/sp2bv/sp2bv.cxx +++ b/cpputools/source/sp2bv/sp2bv.cxx @@ -24,35 +24,34 @@ static bool hasOption(char const * szOption, int argc, char** argv); - -#define HELP_TEXT\ -"SYNOPSIS \n\n" \ -"\tsp2bv [-h] [-?] string \n\n" \ -"DESCRIPTION\n\n" \ -"\tsp2bv stands for \"system path to bootstrap variable\"." \ -" First the system path is converted into a file URL. Then all " \ -"characters which have a special meaning in bootstrap variables, " \ -"such as \'$\' are escaped. The resulting string is written to " \ -"stdout and can be assigned to a bootstrap variable.\n" \ -"\n\n" \ -"OPTIONS \n\n" \ -"\tThe following options are supported: \n" \ -"-?\n " \ -"--help" \ -"Display help information.\n" +const char* HELP_TEXT = +"SYNOPSIS \n\n" +"\tsp2bv [-h] [-?] string \n\n" +"DESCRIPTION\n\n" +"\tsp2bv stands for \"system path to bootstrap variable\"." +" First the system path is converted into a file URL. Then all " +"characters which have a special meaning in bootstrap variables, " +"such as \'$\' are escaped. The resulting string is written to " +"stdout and can be assigned to a bootstrap variable.\n" +"\n\n" +"OPTIONS \n\n" +"\tThe following options are supported: \n" +"-?\n " +"--help" +"Display help information.\n"; int main(int argc, char **argv) { if( hasOption("--help",argc, argv) || hasOption("-h", argc, argv)) { -fprintf(stdout, HELP_TEXT);// default +fputs(HELP_TEXT, stdout);// default return 0; } if (argc != 2) { -fprintf(stdout, HELP_TEXT); +fputs(HELP_TEXT, stdout); return -1; }
[Libreoffice-commits] core.git: avmedia/source
avmedia/source/gstreamer/gstplayer.cxx | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) New commits: commit 4d54aeb67a43a42acf8f3cd94d83584f6870ade2 Author: Arnaud Versini AuthorDate: Sun Oct 24 16:49:50 2021 +0200 Commit: Arnaud Versini CommitDate: Tue Aug 8 14:35:37 2023 +0200 avmedia : use std::recursive_mutex instead of osl::Mutex. Mostly reverts 621143588b3cb438baf27fb6893ab02e7b06f9dd but using recursive_mutex instead. Change-Id: I4b23410720834e19c5dd28c43bc84ed1b3e08072 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153236 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index 0bd3485efd9a..259185c197ec 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -98,7 +99,7 @@ private: DECL_STATIC_LINK(MissingPluginInstaller, launchUi, void*, void); -osl::Mutex mutex_; +std::recursive_mutex mutex_; std::set reported_; std::map>> queued_; rtl::Reference currentThread_; @@ -110,7 +111,7 @@ private: MissingPluginInstaller::~MissingPluginInstaller() { -osl::MutexGuard g(mutex_); +std::unique_lock g(mutex_); SAL_WARN_IF(currentThread_.is(), "avmedia.gstreamer", "unjoined thread"); inCleanUp_ = true; } @@ -138,7 +139,7 @@ void MissingPluginInstaller::report( rtl::Reference join; rtl::Reference launch; { -osl::MutexGuard g(mutex_); +std::unique_lock g(mutex_); if (reported_.find(detStr) != reported_.end()) { return; } @@ -183,7 +184,7 @@ void eraseSource(std::set> & set, Player const * source) void MissingPluginInstaller::detach(Player const * source) { rtl::Reference join; { -osl::MutexGuard g(mutex_); +std::unique_lock g(mutex_); if (inCleanUp_) { // Guard against ~MissingPluginInstaller with erroneously un-joined // currentThread_ (thus non-empty currentSources_) calling @@ -257,7 +258,7 @@ void MissingPluginInstallerThread::execute() { for (;;) { std::vector details; { -osl::MutexGuard g(inst.mutex_); +std::unique_lock g(inst.mutex_); assert(!inst.currentDetails_.empty()); details.swap(inst.currentDetails_); } @@ -270,7 +271,7 @@ void MissingPluginInstallerThread::execute() { args.push_back(nullptr); gst_install_plugins_sync(args.data(), nullptr); { -osl::MutexGuard g(inst.mutex_); +std::unique_lock g(inst.mutex_); if (inst.queued_.empty() || inst.launchNewThread_) { inst.launchNewThread_ = true; break;
[Libreoffice-commits] core.git: xmlsecurity/source
xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 112 +++-- 1 file changed, 48 insertions(+), 64 deletions(-) New commits: commit 127a55391c90e8503aa1007c35d8f683a4b8acbc Author: Arnaud VERSINI AuthorDate: Sun Jul 16 17:06:54 2023 +0200 Commit: Arnaud Versini CommitDate: Mon Aug 7 11:28:40 2023 +0200 xmlsecurity : simplify DigitalSignaturesDialog Change-Id: I460d56a5a13dde1bd77f21e0bb6467dd00cb3f40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154498 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 4c8c2fea56b7..4e29cbf836d2 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -110,29 +110,21 @@ namespace nullptr ); } -std::vector& GetGUIServers() -{ - #ifdef _WIN32 -static std::vector aGUIServers -= { u"Gpg4win\\kleopatra.exe", -u"Gpg4win\\bin\\kleopatra.exe", -u"GNU\\GnuPG\\kleopatra.exe", -u"GNU\\GnuPG\\launch-gpa.exe", -u"GNU\\GnuPG\\gpa.exe", -u"GnuPG\\bin\\gpa.exe", -u"GNU\\GnuPG\\bin\\kleopatra.exe", -u"GNU\\GnuPG\\bin\\launch-gpa.exe", -u"GNU\\GnuPG\\bin\\gpa.exe", - officecfg::Office::Common::Security::Scripting::CertMgrPath::get() }; +constexpr std::u16string_view aGUIServers[] += { u"Gpg4win\\kleopatra.exe", +u"Gpg4win\\bin\\kleopatra.exe", +u"GNU\\GnuPG\\kleopatra.exe", +u"GNU\\GnuPG\\launch-gpa.exe", +u"GNU\\GnuPG\\gpa.exe", +u"GnuPG\\bin\\gpa.exe", +u"GNU\\GnuPG\\bin\\kleopatra.exe", +u"GNU\\GnuPG\\bin\\launch-gpa.exe", +u"GNU\\GnuPG\\bin\\gpa.exe"}; #else -static std::vector aGUIServers -= { u"kleopatra", u"seahorse", u"gpa", u"kgpg", - officecfg::Office::Common::Security::Scripting::CertMgrPath::get() }; +constexpr std::u16string_view aGUIServers[] += { u"kleopatra", u"seahorse", u"gpa", u"kgpg"}; #endif -return aGUIServers; -} - } DigitalSignaturesDialog::DigitalSignaturesDialog( @@ -272,16 +264,14 @@ bool DigitalSignaturesDialog::canAddRemove() { //FIXME: this func needs some cleanup, such as real split between //'canAdd' and 'canRemove' case -bool ret = true; - uno::Reference xNameAccess = maSignatureManager.getStore(); if (xNameAccess.is() && xNameAccess->hasByName("[Content_Types].xml")) // It's always possible to append an OOXML signature. -return ret; +return true; if (!maSignatureManager.getStore().is()) // It's always possible to append a PDF signature. -return ret; +return true; OSL_ASSERT(maSignatureManager.getStore().is()); bool bDoc1_1 = DocumentSignatureHelper::isODFPre_1_2(m_sODFVersion); @@ -298,14 +288,13 @@ bool DigitalSignaturesDialog::canAddRemove() VclMessageType::Warning, VclButtonsType::Ok, XsResId(STR_XMLSECDLG_OLD_ODF_FORMAT))); xBox->run(); -ret = false; +return false; } //As of OOo 3.2 the document signature includes in macrosignatures.xml. That is //adding a macro signature will break an existing document signature. //The sfx2 will remove the documentsignature when the user adds a macro signature -if (maSignatureManager.getSignatureMode() == DocumentSignatureMode::Macros -&& ret) +if (maSignatureManager.getSignatureMode() == DocumentSignatureMode::Macros) { if (m_bHasDocumentSignature && !m_bWarningShowSignMacro) { @@ -318,12 +307,12 @@ bool DigitalSignaturesDialog::canAddRemove() m_xDialog.get(), VclMessageType::Question, VclButtonsType::YesNo, XsResId(STR_XMLSECDLG_QUERY_REMOVEDOCSIGNBEFORESIGN))); if (xBox->run() == RET_NO) -ret = false; -else -m_bWarningShowSignMacro = true; +return false; + +m_bWarningShowSignMacro = true; } } -return ret; +return true; } bool DigitalSignaturesDialog::canAdd() { return canAddRemove(); } @@ -517,44 +506,36 @@ bool DigitalSignaturesDialog::GetPathAllOS(OUString& aPath) void DigitalSignaturesDialog::GetCertificateManager(OUString& aPath, OUString& sExecutable, OUString& sFoundGUIServer) { -GetGUIServers().pop_back(); - GetGUIServers().push_back(officecfg::Office::Common::Security::Scripting::CertMgrPath::get()); - -for (auto it = GetGUIServers().rbegin(); it != GetGUIServers().rend(); ++it) +OUString aC
[Libreoffice-commits] core.git: sc/source
sc/source/filter/xml/xmlcelli.cxx |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) New commits: commit 71f2aea3151b82ba4793eb21a2251d587e425511 Author: Arnaud VERSINI AuthorDate: Mon Apr 17 20:47:31 2023 +0200 Commit: Arnaud Versini CommitDate: Mon Jul 17 20:30:14 2023 +0200 sc : small simplification in ScXMLTableRowCellContext::IsPossibleErrorString Change-Id: I3c5bd6b53528b1cc1d695fb48f89b6f19f5c0f6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150532 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index c041251c0119..3e94b576c679 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1489,10 +1489,9 @@ void ScXMLTableRowCellContext::HasSpecialCaseFormulaText() bool ScXMLTableRowCellContext::IsPossibleErrorString() const { -if(mbNewValueType && !mbErrorValue) -return false; -else if(mbNewValueType && mbErrorValue) -return true; +if(mbNewValueType) +return mbErrorValue; + return mbPossibleErrorCell || (mbCheckWithCompilerForError && maStringValue && GetScImport().GetFormulaErrorConstant(*maStringValue) != FormulaError::NONE); }
[Libreoffice-commits] core.git: xmlsecurity/source
xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx |8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) New commits: commit d22ab7b444a4e16dc2bd1f7d15fa36a848eaaaed Author: Arnaud VERSINI AuthorDate: Mon Jul 10 21:26:15 2023 +0200 Commit: Arnaud Versini CommitDate: Mon Jul 17 10:58:27 2023 +0200 xmlsecurity : simplify DigitalSignaturesDialog::canAddRemove. (!a && b) || (a && b) => b Change-Id: Iee9ae38d9dc5f6aa94eaff61b3937633f5da7af1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154285 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 9a6222c59e1e..2e14e609773f 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -91,11 +91,6 @@ namespace public: virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override; SaveODFItem(); -//See group ODF in Common.xcs -bool isLessODF1_2() const -{ -return m_nODF < 3; -} }; void SaveODFItem::ImplCommit() {} @@ -295,13 +290,12 @@ bool DigitalSignaturesDialog::canAddRemove() OSL_ASSERT(maSignatureManager.getStore().is()); bool bDoc1_1 = DocumentSignatureHelper::isODFPre_1_2(m_sODFVersion); SaveODFItem item; -bool bSave1_1 = item.isLessODF1_2(); // see specification //cvs: specs/www/appwide/security/Electronic_Signatures_and_Security.sxw //Paragraph 'Behavior with regard to ODF 1.2' //For both, macro and document -if ( (!bSave1_1 && bDoc1_1) || (bSave1_1 && bDoc1_1) ) +if ( bDoc1_1 ) { //#4 std::unique_ptr xBox(Application::CreateMessageDialog(m_xDialog.get(),
[Libreoffice-commits] core.git: xmlsecurity/source
xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx |8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) New commits: commit f57bb8bbadf086873155401445b03bdb971ecc6f Author: Arnaud VERSINI AuthorDate: Sun Jul 2 22:07:15 2023 +0200 Commit: Arnaud Versini CommitDate: Fri Jul 7 07:59:51 2023 +0200 xmlsecurity : remove deadcode and usage of array template Change-Id: I282e2af395471aa4818bfb4586ac06c7850c8a61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153862 Reviewed-by: Mike Kaganski Reviewed-by: Arnaud Versini Tested-by: Arnaud Versini diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 2a3cd3049a13..921dedbca49d 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -19,7 +19,6 @@ #include -#include #include #include @@ -117,7 +116,7 @@ namespace m_nODF = nTmp; } #ifdef _WIN32 -constexpr std::array aGUIServers = { u"Gpg4win\\kleopatra.exe", +constexpr std::u16string_view aGUIServers[] = { u"Gpg4win\\kleopatra.exe", u"Gpg4win\\bin\\kleopatra.exe", u"GNU\\GnuPG\\kleopatra.exe", u"GNU\\GnuPG\\launch-gpa.exe", @@ -127,7 +126,7 @@ namespace u"GNU\\GnuPG\\bin\\launch-gpa.exe", u"GNU\\GnuPG\\bin\\gpa.exe"}; #else -constexpr std::array aGUIServers = { u"kleopatra", u"seahorse", u"gpa", u"kgpg" }; +constexpr std::u16string_view aGUIServers[] = { u"kleopatra", u"seahorse", u"gpa", u"kgpg" }; #endif } @@ -551,9 +550,6 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, CertMgrButtonHdl, weld::Button&, void) OUString aPath(cPath, strlen(cPath), osl_getThreadTextEncoding()); #endif -if (aGUIServers.empty()) -return; - OUString sFoundGUIServer, sExecutable; for ( auto const &rServer : aGUIServers)
[Libreoffice-commits] core.git: xmlsecurity/source
xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx | 18 ++--- 1 file changed, 7 insertions(+), 11 deletions(-) New commits: commit 66e25cfe4f50c142077a54f005d09cee2bb63dab Author: Arnaud VERSINI AuthorDate: Sun Jun 25 20:13:36 2023 +0200 Commit: Noel Grandin CommitDate: Mon Jun 26 07:56:01 2023 +0200 xmlsecurity : remove unneccessary static variables Change-Id: Ie7ecba234f33cc09ebd4cf5a390919acb4bc7e08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153567 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index ed73366234df..2a3cd3049a13 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -19,6 +19,7 @@ #include +#include #include #include @@ -115,7 +116,8 @@ namespace m_nODF = nTmp; } -const std::vector aGUIServersWindows = { u"Gpg4win\\kleopatra.exe", +#ifdef _WIN32 +constexpr std::array aGUIServers = { u"Gpg4win\\kleopatra.exe", u"Gpg4win\\bin\\kleopatra.exe", u"GNU\\GnuPG\\kleopatra.exe", u"GNU\\GnuPG\\launch-gpa.exe", @@ -124,7 +126,10 @@ namespace u"GNU\\GnuPG\\bin\\kleopatra.exe", u"GNU\\GnuPG\\bin\\launch-gpa.exe", u"GNU\\GnuPG\\bin\\gpa.exe"}; -const std::vector aGUIServersNix = { u"kleopatra", u"seahorse", u"gpa", u"kgpg" }; +#else +constexpr std::array aGUIServers = { u"kleopatra", u"seahorse", u"gpa", u"kgpg" }; +#endif + } DigitalSignaturesDialog::DigitalSignaturesDialog( @@ -490,7 +495,6 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, RemoveButtonHdl, weld::Button&, void) bool DigitalSignaturesDialog::IsThereCertificateMgr() { -static std::vector aGUIServers; #ifdef _WIN32 static const OUString aPath = [] { sal::systools::CoTaskMemAllocated sPath; @@ -502,18 +506,13 @@ bool DigitalSignaturesDialog::IsThereCertificateMgr() }(); if (aPath.isEmpty()) return false; -aGUIServers = aGUIServersWindows; #else const char* cPath = getenv("PATH"); if (!cPath) return false; OUString aPath(cPath, strlen(cPath), osl_getThreadTextEncoding()); -aGUIServers = aGUIServersNix; #endif -if (aGUIServers.empty()) -return false; - OUString sFoundGUIServer, sExecutable; for ( auto const &rServer : aGUIServers ) @@ -531,7 +530,6 @@ bool DigitalSignaturesDialog::IsThereCertificateMgr() IMPL_LINK_NOARG(DigitalSignaturesDialog, CertMgrButtonHdl, weld::Button&, void) { -static std::vector aGUIServers; #ifdef _WIN32 // FIXME: call GpgME::dirInfo("bindir") somewhere in // SecurityEnvironmentGpg or whatnot @@ -546,13 +544,11 @@ IMPL_LINK_NOARG(DigitalSignaturesDialog, CertMgrButtonHdl, weld::Button&, void) }(); if (aPath.isEmpty()) return; -aGUIServers = aGUIServersWindows; #else const char* cPath = getenv("PATH"); if (!cPath) return; OUString aPath(cPath, strlen(cPath), osl_getThreadTextEncoding()); -aGUIServers = aGUIServersNix; #endif if (aGUIServers.empty())
[Libreoffice-commits] core.git: desktop/source
desktop/source/app/appinit.cxx |1 - desktop/source/app/cmdlineargs.cxx |4 2 files changed, 5 deletions(-) New commits: commit 5582b8c6da7e9d8cbcf20b381a8b0f5344b4d743 Author: Arnaud VERSINI AuthorDate: Mon May 8 16:57:12 2023 +0200 Commit: Bartosz Kosiorek CommitDate: Wed May 10 12:01:08 2023 +0200 desktop : remove useless using namespace Change-Id: I23a2932402120d9097ab6bd9793d4b4e92be03e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151538 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 8596f80aaafc..926ad1bfa6b7 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -43,7 +43,6 @@ #include #include -using namespace desktop; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 432bff1f4efc..e7f315204048 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -42,10 +42,6 @@ #include -using namespace com::sun::star::lang; -using namespace com::sun::star::uri; -using namespace com::sun::star::uno; - namespace desktop {
[Libreoffice-commits] core.git: sw/source
sw/source/core/docnode/ndsect.cxx | 62 +- 1 file changed, 28 insertions(+), 34 deletions(-) New commits: commit b5de1ab530912153a9fcc571efb300c2888e Author: Arnaud VERSINI AuthorDate: Mon Apr 10 19:32:38 2023 +0200 Commit: Noel Grandin CommitDate: Tue Apr 11 19:06:06 2023 +0200 sw : small code simplification in lcl_IsInSameTableBox Change-Id: Ic72a49deee17d907639e67ef31e0ca932bf66215 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150188 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index f4fe9b9a3ec4..cf96e1d5094b 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -75,42 +75,36 @@ static bool lcl_IsInSameTableBox( SwNodes const & _rNds, // determine index to be checked. Its assumed that a previous/next exist. SwNodeIndex aChkIdx( _rNd ); + +// determine index of previous/next - skip hidden ones, which are +// inside the table. +// If found one is before/after table, this one isn't in the same +// table box as <_rNd>. +for(;;) { -// determine index of previous/next - skip hidden ones, which are -// inside the table. -// If found one is before/after table, this one isn't in the same -// table box as <_rNd>. -bool bFound = false; -do +if ( _bPrev +? !SwNodes::GoPrevSection( &aChkIdx, false, false ) +: !_rNds.GoNextSection( &aChkIdx, false, false ) ) { -if ( _bPrev - ? !SwNodes::GoPrevSection( &aChkIdx, false, false ) - : !_rNds.GoNextSection( &aChkIdx, false, false ) ) -{ -OSL_FAIL( " - no previous/next!" ); -return false; -} -else -{ -if ( aChkIdx < pTableNd->GetIndex() || - aChkIdx > pTableNd->EndOfSectionNode()->GetIndex() ) -{ -return false; -} -else -{ -// check, if found one isn't inside a hidden section, which -// is also inside the table. -SwSectionNode* pSectNd = aChkIdx.GetNode().FindSectionNode(); -if ( !pSectNd || - pSectNd->GetIndex() < pTableNd->GetIndex() || - !pSectNd->GetSection().IsHiddenFlag() ) -{ -bFound = true; -} -} -} -} while ( !bFound ); +OSL_FAIL( " - no previous/next!" ); +return false; +} + +if ( aChkIdx < pTableNd->GetIndex() || +aChkIdx > pTableNd->EndOfSectionNode()->GetIndex() ) +{ +return false; +} + +// check, if found one isn't inside a hidden section, which +// is also inside the table. +SwSectionNode* pSectNd = aChkIdx.GetNode().FindSectionNode(); +if ( !pSectNd || +pSectNd->GetIndex() < pTableNd->GetIndex() || +!pSectNd->GetSection().IsHiddenFlag() ) +{ +break; +} } // Find the Box's StartNode
[Libreoffice-commits] core.git: cppuhelper/source
cppuhelper/source/factory.cxx | 32 ++-- 1 file changed, 14 insertions(+), 18 deletions(-) New commits: commit 048d01ff0f0869be3b63ad62ea15e52f3727f617 Author: Arnaud VERSINI AuthorDate: Sun Mar 19 17:00:20 2023 +0100 Commit: Noel Grandin CommitDate: Mon Mar 20 05:45:35 2023 + cppuhelper : use BaseMutex instead of OFactoryComponentHelper_Mutex Change-Id: I49ed178310b6d8441d8cfdd208b26b8d13ef39ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149091 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index 85d32383a0ce..9a08674d7bdd 100644 --- a/cppuhelper/source/factory.cxx +++ b/cppuhelper/source/factory.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -58,13 +59,8 @@ namespace cppu namespace { -struct OFactoryComponentHelper_Mutex -{ -Mutex aMutex; -}; - class OFactoryComponentHelper -: public OFactoryComponentHelper_Mutex +: public cppu::BaseMutex , public WeakComponentImplHelper< XServiceInfo, XSingleServiceFactory, @@ -79,7 +75,7 @@ public: ComponentFactoryFunc fptr, const Sequence< OUString > * pServiceNames_, bool bOneInstance_ ) -: WeakComponentImplHelper( aMutex ) +: WeakComponentImplHelper( m_aMutex ) , bOneInstance( bOneInstance_ ) , xSMgr( rServiceManager ) , pCreateFunction( pCreateFunction_ ) @@ -188,7 +184,7 @@ Reference OFactoryComponentHelper::createInstance() { if( !xTheInstance.is() ) { -MutexGuard aGuard( aMutex ); +MutexGuard aGuard( m_aMutex ); if( !xTheInstance.is() ) xTheInstance = createInstanceEveryTime( Reference< XComponentContext >() ); } @@ -204,7 +200,7 @@ Reference OFactoryComponentHelper::createInstanceWithArguments( { if( !xTheInstance.is() ) { -MutexGuard aGuard( aMutex ); +MutexGuard aGuard( m_aMutex ); // OSL_ENSURE( !xTheInstance.is(), "### arguments will be ignored!" ); if( !xTheInstance.is() ) xTheInstance = createInstanceWithArgumentsEveryTime( @@ -224,7 +220,7 @@ Reference< XInterface > OFactoryComponentHelper::createInstanceWithContext( { if( !xTheInstance.is() ) { -MutexGuard aGuard( aMutex ); +MutexGuard aGuard( m_aMutex ); // OSL_ENSURE( !xTheInstance.is(), "### context will be ignored!" ); if( !xTheInstance.is() ) xTheInstance = createInstanceEveryTime( xContext ); @@ -242,7 +238,7 @@ Reference< XInterface > OFactoryComponentHelper::createInstanceWithArgumentsAndC { if( !xTheInstance.is() ) { -MutexGuard aGuard( aMutex ); +MutexGuard aGuard( m_aMutex ); // OSL_ENSURE( !xTheInstance.is(), "### context and arguments will be ignored!" ); if( !xTheInstance.is() ) xTheInstance = createInstanceWithArgumentsEveryTime( rArguments, xContext ); @@ -291,7 +287,7 @@ void OFactoryComponentHelper::disposing() Reference x; { // do not delete in the guard section -MutexGuard aGuard( aMutex ); +MutexGuard aGuard( m_aMutex ); x = xTheInstance; xTheInstance.clear(); } @@ -449,7 +445,7 @@ Sequence< Type > ORegistryFactoryHelper::getTypes() Reference< beans::XPropertySetInfo > ORegistryFactoryHelper::getPropertySetInfo() { -::osl::MutexGuard guard( aMutex ); +::osl::MutexGuard guard( m_aMutex ); if (! m_xInfo.is()) m_xInfo = createPropertySetInfo( getInfoHelper() ); return m_xInfo; @@ -459,7 +455,7 @@ ORegistryFactoryHelper::getPropertySetInfo() IPropertyArrayHelper & ORegistryFactoryHelper::getInfoHelper() { -::osl::MutexGuard guard( aMutex ); +::osl::MutexGuard guard( m_aMutex ); if (m_property_array_helper == nullptr) { beans::Property prop( @@ -516,7 +512,7 @@ Reference ORegistryFactoryHelper::createInstanceEveryTime( Reference< XInterface > x( createModuleFactory() ); if (x.is()) { -MutexGuard aGuard( aMutex ); +MutexGuard aGuard( m_aMutex ); if( !xModuleFactory.is() && !xModuleFactoryDepr.is() ) { xModuleFactory.set( x, UNO_QUERY ); @@ -544,7 +540,7 @@ Reference SAL_CALL ORegistryFactoryHelper::createInstanceWithArgume Reference< XInterface > x( createModuleFactory() ); if (x.is()) { -MutexGuard aGuard( aMutex ); +MutexGuard aGuard( m_aMutex ); if( !xModuleFactory.is() && !xModuleFactoryDepr.is() ) { xModuleFactory.set( x, UNO_QUERY ); @@ -574,7 +570,7 @@ Reference< XInterface > ORegistryFactoryHelper::createIns
[Libreoffice-commits] core.git: cppuhelper/source
cppuhelper/source/access_control.cxx | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) New commits: commit d4822aa45017349fcff36e9a61e1e5b0237b208f Author: Arnaud VERSINI AuthorDate: Sun Mar 19 17:06:40 2023 +0100 Commit: Noel Grandin CommitDate: Mon Mar 20 05:45:07 2023 + cppuhelper : use constexpr OUStringLiteral instead of a function Change-Id: Icc25698e4213edbeaae1a997dccbee0ff529ce3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149092 Reviewed-by: Noel Grandin Tested-by: Noel Grandin diff --git a/cppuhelper/source/access_control.cxx b/cppuhelper/source/access_control.cxx index 0e18ef78684a..da8343648a95 100644 --- a/cppuhelper/source/access_control.cxx +++ b/cppuhelper/source/access_control.cxx @@ -30,20 +30,14 @@ using namespace ::osl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -namespace -{ -OUString str_ac_singleton() -{ -return "/singletons/com.sun.star.security.theAccessController"; -} -} +constexpr OUStringLiteral ACCESS_CONTROLLER_SINGLETON = u"/singletons/com.sun.star.security.theAccessController"; namespace cppu { AccessControl::AccessControl( Reference< XComponentContext > const & xContext ) { -if (! (xContext->getValueByName( str_ac_singleton() ) >>= m_xController)) +if (! (xContext->getValueByName( ACCESS_CONTROLLER_SINGLETON ) >>= m_xController)) { throw SecurityException( "no access controller!" ); }
[Libreoffice-commits] core.git: bridges/source
bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx |2 -- bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx|4 3 files changed, 8 deletions(-) New commits: commit 4825d1f15585211a942ed711d1b372b77b718ce7 Author: Arnaud Versini AuthorDate: Sat Feb 25 04:50:21 2023 +0100 Commit: Noel Grandin CommitDate: Thu Mar 2 14:10:58 2023 + bridge linux x86-64 : remove useless includes Change-Id: Ibd3b9a76b700a5efbf7855454714646daf612d13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147675 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx index 680e8da819f2..b0f699dba1c7 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx @@ -19,8 +19,6 @@ #include -#include - #include #include #include diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx index 7466d0e225bc..bd6d9e61796d 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx @@ -18,8 +18,6 @@ */ -#include -#include #include #include diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx index 2a92dba37475..daee12731ef1 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx @@ -17,10 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - -#include -#include - #include #include
[Libreoffice-commits] core.git: cppuhelper/source desktop/source package/source slideshow/source stoc/source sw/source testtools/source toolkit/source ucb/source vcl/source vcl/unx vcl/workben
cppuhelper/source/bootstrap.cxx |3 ++- desktop/source/app/officeipcthread.cxx| 16 desktop/source/deployment/misc/dp_misc.cxx|3 ++- package/source/zipapi/ZipOutputStream.cxx |4 +++- slideshow/source/engine/slideshowimpl.cxx |3 ++- stoc/source/javaloader/javaloader.cxx |5 +++-- sw/source/core/docnode/finalthreadmanager.cxx |5 +++-- testtools/source/bridgetest/cppobj.cxx|3 ++- toolkit/source/awt/vclxtoolkit.cxx|3 ++- ucb/source/ucp/webdav-curl/SerfLockStore.cxx |7 +++ vcl/source/opengl/OpenGLContext.cxx |3 ++- vcl/unx/generic/dtrans/X11_selection.cxx |5 +++-- vcl/workben/vcldemo.cxx |3 ++- 13 files changed, 33 insertions(+), 30 deletions(-) New commits: commit 555f4333182abd0ca4aa06b354763f6dfbc3eb20 Author: Arnaud VERSINI AuthorDate: Sun Nov 6 17:04:20 2022 +0100 Commit: Stephan Bergmann CommitDate: Mon Jan 9 08:37:35 2023 + use std::this_thread::sleep_for instead of osl equivalent Change-Id: I5b4edc5417e5bb5e082688df616e1d5735717d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142357 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/cppuhelper/source/bootstrap.cxx b/cppuhelper/source/bootstrap.cxx index f468518ba456..bd975460f06c 100644 --- a/cppuhelper/source/bootstrap.cxx +++ b/cppuhelper/source/bootstrap.cxx @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -215,7 +216,7 @@ Reference< XComponentContext > SAL_CALL bootstrap() catch ( connection::NoConnectException & ) { // wait 500 ms, then try to connect again -::osl::Thread::wait( std::chrono::milliseconds(500) ); +std::this_thread::sleep_for(std::chrono::milliseconds(500)); } } } diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index 45b8906c3b42..74f838939bfa 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #if ENABLE_DBUS #include @@ -792,10 +793,7 @@ RequestHandler::Status PipeIpcThread::enable(rtl::Reference * thread) else { // Pipe connection failed (other office exited or crashed) -TimeValue tval; -tval.Seconds = 0; -tval.Nanosec = 5; -salhelper::Thread::wait( tval ); +std::this_thread::sleep_for( std::chrono::milliseconds(500) ); } } else @@ -805,10 +803,7 @@ RequestHandler::Status PipeIpcThread::enable(rtl::Reference * thread) return RequestHandler::IPC_STATUS_PIPE_ERROR; // Wait for second office to be ready -TimeValue aTimeValue; -aTimeValue.Seconds = 0; -aTimeValue.Nanosec = 1000; // 10ms -salhelper::Thread::wait( aTimeValue ); +std::this_thread::sleep_for( std::chrono::milliseconds(10) ); } } while ( nPipeMode == PIPEMODE_DONTKNOW ); @@ -1206,10 +1201,7 @@ void PipeIpcThread::execute() } SAL_WARN( "desktop.app", "Error on accept: " << static_cast(nError)); -TimeValue tval; -tval.Seconds = 1; -tval.Nanosec = 0; -salhelper::Thread::wait( tval ); +std::this_thread::sleep_for( std::chrono::seconds(1) ); } } while( schedule() ); } diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index 2983de24b959..bbe3a085fc68 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -447,7 +448,7 @@ Reference resolveUnoURL( catch (const connection::NoConnectException &) { if (i < 40) { -::osl::Thread::wait( std::chrono::milliseconds(500) ); +std::this_thread::sleep_for( std::chrono::milliseconds(500) ); } else throw; } diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx index 9b582c4691e8..df21f1ffeb13 100644 --- a/package/source/zipapi/ZipOutputStream.cxx +++ b/package/source/zipapi/ZipOutputStream.cxx @@ -32,6 +32,8 @@ #include #include +#include + using namespace com::sun::star; using namespace com::sun::star::io; using namespace com::sun::star::uno; @@ -151,7 +153,7 @@ void ZipOutputStream::reduceScheduledThreadTasksToGivenNumberOrLess(std::size_t if(m_aEntries.size() > nThreadTasks) { -osl::Thread::wait(std::chrono::microseconds(100)); +std::this_thread::sle
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/compiler.hxx |1 - sc/source/core/tool/compiler.cxx | 12 +--- 2 files changed, 9 insertions(+), 4 deletions(-) New commits: commit 3ab8349a37215d8e355e79b93d66f631144e7c57 Author: Arnaud VERSINI AuthorDate: Sat Dec 31 19:22:03 2022 +0100 Commit: Eike Rathke CommitDate: Thu Jan 5 22:13:35 2023 + sc : use std::mutex for CharClass initialisation Change-Id: I0427109da1bfed1d3d467455ab1ab3c68569f60b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144886 Tested-by: Jenkins Reviewed-by: Eike Rathke diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index 0097486c223c..fbf5073743e1 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -258,7 +258,6 @@ public: private: -static osl::Mutex maMutex; static const CharClass *pCharClassEnglish; // character classification for en_US locale static const CharClass *pCharClassLocalized; // character classification for UI locale static const Convention *pConventions[ formula::FormulaGrammar::CONV_LAST ]; diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 371ee5aad209..f3861e4ddbbe 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -21,6 +21,7 @@ #include +#include #include #include #include @@ -77,7 +78,6 @@ using namespace formula; using namespace ::com::sun::star; using ::std::vector; -osl::Mutex ScCompiler::maMutex; const CharClass*ScCompiler::pCharClassEnglish = nullptr; const CharClass*ScCompiler::pCharClassLocalized = nullptr; const ScCompiler::Convention* ScCompiler::pConventions[ ] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; @@ -222,11 +222,17 @@ bool ScCompiler::IsEnglishSymbol( const OUString& rName ) return !aIntName.isEmpty(); // no valid function name } +static std::mutex& getCharClassMutex() +{ +static std::mutex aMutex; +return aMutex; +} + const CharClass* ScCompiler::GetCharClassEnglish() { if (!pCharClassEnglish) { -osl::MutexGuard aGuard(maMutex); +std::scoped_lock aGuard(getCharClassMutex()); if (!pCharClassEnglish) { pCharClassEnglish = new CharClass( ::comphelper::getProcessComponentContext(), @@ -242,7 +248,7 @@ const CharClass* ScCompiler::GetCharClassLocalized() { // Switching UI language requires restart; if not, we would have to // keep track of that. -osl::MutexGuard aGuard(maMutex); +std::scoped_lock aGuard(getCharClassMutex()); if (!pCharClassLocalized) { pCharClassLocalized = new CharClass( ::comphelper::getProcessComponentContext(),
[Libreoffice-commits] core.git: sal/rtl
sal/rtl/bootstrap.cxx | 24 1 file changed, 12 insertions(+), 12 deletions(-) New commits: commit 4e81e3b6c0acad2f3e59564184f8bf70d166557d Author: Arnaud VERSINI AuthorDate: Sat Dec 3 15:44:57 2022 +0100 Commit: Noel Grandin CommitDate: Sun Dec 4 13:07:32 2022 + rtl bootsratp : use enum class Change-Id: Iea433a2a7be9b62f04b57883dbefaf25586f21d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143616 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx index 6188406cab5d..422411190ea4 100644 --- a/sal/rtl/bootstrap.cxx +++ b/sal/rtl/bootstrap.cxx @@ -85,9 +85,9 @@ bool resolvePathnameUrl(OUString * url) return false; } -enum LookupMode { -LOOKUP_MODE_NORMAL, LOOKUP_MODE_URE_BOOTSTRAP, -LOOKUP_MODE_URE_BOOTSTRAP_EXPANSION }; +enum class LookupMode { +NORMAL, URE_BOOTSTRAP, +URE_BOOTSTRAP_EXPANSION }; struct ExpandRequestLink { ExpandRequestLink const * next; @@ -401,7 +401,7 @@ struct FundamentalIniData OUString uri; ini = (get_static_bootstrap_handle()->getValue( -"URE_BOOTSTRAP", &uri.pData, nullptr, LOOKUP_MODE_NORMAL, false, +"URE_BOOTSTRAP", &uri.pData, nullptr, LookupMode::NORMAL, false, nullptr) && resolvePathnameUrl(&uri)) ? rtl_bootstrap_args_open(uri.pData) : nullptr; @@ -426,8 +426,8 @@ bool Bootstrap_Impl::getValue( LookupMode mode, bool override, ExpandRequestLink const * requestStack) const { -if (mode == LOOKUP_MODE_NORMAL && key == "URE_BOOTSTRAP") -mode = LOOKUP_MODE_URE_BOOTSTRAP; +if (mode == LookupMode::NORMAL && key == "URE_BOOTSTRAP") +mode = LookupMode::URE_BOOTSTRAP; if (override && getDirectValue(key, value, mode, requestStack)) return true; @@ -518,7 +518,7 @@ bool Bootstrap_Impl::getValue( if (!override && getDirectValue(key, value, mode, requestStack)) return true; -if (mode == LOOKUP_MODE_NORMAL) +if (mode == LookupMode::NORMAL) { FundamentalIniData const & d = FundamentalIni(); Bootstrap_Impl const * b = static_cast(d.ini); @@ -579,12 +579,12 @@ void Bootstrap_Impl::expandValue( { rtl_uString_assign( value, -(mode == LOOKUP_MODE_URE_BOOTSTRAP && isPathnameUrl(text) ? +(mode == LookupMode::URE_BOOTSTRAP && isPathnameUrl(text) ? text : recursivelyExpandMacros( this, text, - (mode == LOOKUP_MODE_URE_BOOTSTRAP ? - LOOKUP_MODE_URE_BOOTSTRAP_EXPANSION : mode), + (mode == LookupMode::URE_BOOTSTRAP ? + LookupMode::URE_BOOTSTRAP_EXPANSION : mode), requestFile, requestKey, requestStack)).pData); } @@ -698,7 +698,7 @@ sal_Bool SAL_CALL rtl_bootstrap_get_from_handle( handle = get_static_bootstrap_handle(); found = static_cast< Bootstrap_Impl * >(handle)->getValue( -pName, ppValue, pDefault, LOOKUP_MODE_NORMAL, false, nullptr ); +pName, ppValue, pDefault, LookupMode::NORMAL, false, nullptr ); } return found; @@ -775,7 +775,7 @@ void SAL_CALL rtl_bootstrap_expandMacros_from_handle( OUString expanded(expandMacros(static_cast< Bootstrap_Impl * >(handle), OUString::unacquired(macro), - LOOKUP_MODE_NORMAL, nullptr)); +LookupMode::NORMAL, nullptr)); rtl_uString_assign(macro, expanded.pData); }
[Libreoffice-commits] core.git: sal/osl
sal/osl/all/log.cxx |2 -- 1 file changed, 2 deletions(-) New commits: commit d64aed0b44f3070b4a7ec2fecd6ea80a0b8c4bc8 Author: Arnaud VERSINI AuthorDate: Sat Dec 3 16:03:35 2022 +0100 Commit: Noel Grandin CommitDate: Sun Dec 4 13:07:02 2022 + osl : remove useless includes Change-Id: Ic350a924d3e5b58e8f1a60621edc701553d8cbab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143617 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sal/osl/all/log.cxx b/sal/osl/all/log.cxx index 405d5599ccae..235c7267d22e 100644 --- a/sal/osl/all/log.cxx +++ b/sal/osl/all/log.cxx @@ -17,8 +17,6 @@ #include #include -#include -#include #include #include
[Libreoffice-commits] core.git: sal/osl
sal/osl/w32/file.cxx | 73 + sal/osl/w32/thread.cxx | 11 --- 2 files changed, 32 insertions(+), 52 deletions(-) New commits: commit d5f29872f5a149fc7905cdf340215c07af0d4da8 Author: Arnaud VERSINI AuthorDate: Sun Nov 20 17:46:10 2022 +0100 Commit: Noel Grandin CommitDate: Mon Nov 21 09:15:59 2022 +0100 sal/osl win32 : use non recursive mutexes in file and thread Change-Id: I7e0e7f7a8bdc3fa92beca10935bb3c62d57f92fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143002 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sal/osl/w32/file.cxx b/sal/osl/w32/file.cxx index be921aede733..4c4c06f462fa 100644 --- a/sal/osl/w32/file.cxx +++ b/sal/osl/w32/file.cxx @@ -34,6 +34,7 @@ #include #include #include +#include #ifdef max /* conflict w/ std::numeric_limits::max() */ #undef max @@ -64,7 +65,7 @@ namespace { */ struct FileHandle_Impl { -CRITICAL_SECTION m_mutex; +std::mutex m_mutex; HANDLE m_hFile; StateBits m_state; @@ -127,32 +128,10 @@ struct FileHandle_Impl SIZE_T nBytes); oslFileError syncFile(); - -/** Guard. - */ -class Guard -{ -LPCRITICAL_SECTION m_mutex; - -public: -explicit Guard(LPCRITICAL_SECTION pMutex); -~Guard(); -}; }; } -FileHandle_Impl::Guard::Guard(LPCRITICAL_SECTION pMutex) -: m_mutex (pMutex) -{ -assert(pMutex); -::EnterCriticalSection (m_mutex); -} - -FileHandle_Impl::Guard::~Guard() -{ -::LeaveCriticalSection (m_mutex); -} FileHandle_Impl::FileHandle_Impl(HANDLE hFile) : m_hFile (hFile), @@ -165,7 +144,6 @@ FileHandle_Impl::FileHandle_Impl(HANDLE hFile) m_bufsiz (getpagesize()), m_buffer (nullptr) { -::InitializeCriticalSection (&m_mutex); m_buffer = static_cast(calloc(m_bufsiz, 1)); } @@ -173,7 +151,6 @@ FileHandle_Impl::~FileHandle_Impl() { free(m_buffer); m_buffer = nullptr; -::DeleteCriticalSection (&m_mutex); } SIZE_T FileHandle_Impl::getpagesize() @@ -679,7 +656,7 @@ oslFileError SAL_CALL osl_syncFile(oslFileHandle Handle) if ((!pImpl) || !IsValidHandle(pImpl->m_hFile)) return osl_File_E_INVAL; -FileHandle_Impl::Guard lock(&(pImpl->m_mutex)); +std::lock_guard lock(pImpl->m_mutex); oslFileError result = pImpl->syncFile(); if (result != osl_File_E_None) @@ -697,21 +674,23 @@ oslFileError SAL_CALL osl_closeFile(oslFileHandle Handle) if ((!pImpl) || !IsValidHandle(pImpl->m_hFile)) return osl_File_E_INVAL; -::EnterCriticalSection(&(pImpl->m_mutex)); - -oslFileError result = pImpl->syncFile(); -if (result != osl_File_E_None) -{ -/* ignore double failure */ -(void)::CloseHandle(pImpl->m_hFile); -} -else if (!::CloseHandle(pImpl->m_hFile)) +oslFileError result; { -/* translate error code */ -result = oslTranslateFileError(GetLastError()); +std::lock_guard lock(pImpl->m_mutex); + +result = pImpl->syncFile(); +if (result != osl_File_E_None) +{ +/* ignore double failure */ +(void)::CloseHandle(pImpl->m_hFile); +} +else if (!::CloseHandle(pImpl->m_hFile)) +{ +/* translate error code */ +result = oslTranslateFileError(GetLastError()); +} } -::LeaveCriticalSection(&(pImpl->m_mutex)); delete pImpl; return result; } @@ -820,7 +799,7 @@ SAL_CALL osl_readLine( sal_uInt64 uBytesRead = 0; // read at current filepos; filepos += uBytesRead; -FileHandle_Impl::Guard lock(&(pImpl->m_mutex)); +std::lock_guard lock(pImpl->m_mutex); oslFileError result = pImpl->readLineAt( pImpl->m_filepos, ppSequence, &uBytesRead); if (result == osl_File_E_None) @@ -839,7 +818,7 @@ oslFileError SAL_CALL osl_readFile( return osl_File_E_INVAL; // read at current filepos; filepos += *pBytesRead; -FileHandle_Impl::Guard lock(&(pImpl->m_mutex)); +std::lock_guard lock(pImpl->m_mutex); oslFileError result = pImpl->readFileAt( pImpl->m_filepos, pBuffer, uBytesRequested, pBytesRead); if (result == osl_File_E_None) @@ -859,7 +838,7 @@ oslFileError SAL_CALL osl_writeFile( return osl_File_E_INVAL; // write at current filepos; filepos += *pBytesWritten; -FileHandle_Impl::Guard lock(&(pImpl->m_mutex)); +std::lock_guard lock(pImpl->m_mutex); oslFileError result = pImpl->writeFileAt( pImpl->m_filepos, pBuffer, uBytesToWrite, pBytesWritten); if (result == osl_File_E_None) @@ -899,7 +878,7 @@ oslFileError SAL_CALL osl_readFileAt( LONGLONG const nOffset = sal::static_int_cast< LONGLONG >(uOffset); // read at specified fileptr -FileHandle_Impl::Guard lock (&(pImpl->m_mutex)); +std::lock_guard lock (pImpl->m_mutex); return pImpl->readFileAt(nOffs
[Libreoffice-commits] core.git: svl/source
svl/source/notify/broadcast.cxx | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) New commits: commit 4ab8efd367dc09203a77983e5dcd3d6e9bfa7ddd Author: Arnaud Versini AuthorDate: Tue Sep 27 16:29:23 2022 +0200 Commit: Eike Rathke CommitDate: Mon Oct 3 17:49:26 2022 +0200 svl : use uintptr_t instead of sal_uInt32 or sal_uInt64 Change-Id: I57a860ee67cc986936b1488f4ab59b5c47f2fd15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140657 Tested-by: Jenkins Reviewed-by: Eike Rathke diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx index 042d1dacaae3..c13cfa3b736e 100644 --- a/svl/source/notify/broadcast.cxx +++ b/svl/source/notify/broadcast.cxx @@ -49,20 +49,12 @@ static bool isDeletedPtr(SvtListener* p) /** mark deleted entries by toggling the last bit,which is effectively unused, since the struct we point * to is at least 16-bit aligned. This allows the binary search to continue working even when we have * deleted entries */ -#if SAL_TYPES_SIZEOFPOINTER == 4 -return (reinterpret_cast(p) & 0x01) == 0x01; -#else -return (reinterpret_cast(p) & 0x01) == 0x01; -#endif +return (reinterpret_cast(p) & 0x01) == 0x01; } static void markDeletedPtr(SvtListener*& rp) { -#if SAL_TYPES_SIZEOFPOINTER == 4 -reinterpret_cast(rp) |= 0x01; -#else -reinterpret_cast(rp) |= 0x01; -#endif +reinterpret_cast(rp) |= 0x01; } static void sortListeners(std::vector& listeners, size_t firstUnsorted)
[Libreoffice-commits] core.git: sal/rtl
sal/rtl/uuid.cxx | 12 1 file changed, 12 deletions(-) New commits: commit 49279212597db3993e1f8f1f70be873a2e22fe2f Author: Arnaud VERSINI AuthorDate: Sat Aug 13 14:42:19 2022 +0200 Commit: Michael Stahl CommitDate: Tue Sep 27 10:59:22 2022 +0200 rtl uuid : remove useless endian conversion Change-Id: I65a4dad0aceb83f2449c86c438cb478937c8b90a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138229 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sal/rtl/uuid.cxx b/sal/rtl/uuid.cxx index 5d348cb8f8e7..22e7f0fe0416 100644 --- a/sal/rtl/uuid.cxx +++ b/sal/rtl/uuid.cxx @@ -25,14 +25,6 @@ #include #include -#define SWAP_INT32_TO_NETWORK(x)\ - { sal_uInt32 y = x;\ - sal_uInt8 *p = reinterpret_cast(&(x)); \ - p[0] = static_cast( ( y >> 24 ) & 0xff );\ - p[1] = static_cast( ( y >> 16 ) & 0xff );\ - p[2] = static_cast( ( y >> 8 ) & 0xff );\ - p[3] = static_cast( ( y ) & 0xff);\ - } #define SWAP_INT16_TO_NETWORK(x)\ { sal_uInt16 y = x;\ sal_uInt8 *p = reinterpret_cast(&(x)); \ @@ -75,8 +67,6 @@ static void write_v3( sal_uInt8 *pUuid ) // copy to avoid alignment problems memcpy(&uuid, pUuid, 16); -SWAP_NETWORK_TO_INT32(uuid.time_low); -SWAP_NETWORK_TO_INT16(uuid.time_mid); SWAP_NETWORK_TO_INT16(uuid.time_hi_and_version); /* put in the variant and version bits */ @@ -85,8 +75,6 @@ static void write_v3( sal_uInt8 *pUuid ) uuid.clock_seq_hi_and_reserved &= 0x3F; uuid.clock_seq_hi_and_reserved |= 0x80; -SWAP_INT32_TO_NETWORK(uuid.time_low); -SWAP_INT16_TO_NETWORK(uuid.time_mid); SWAP_INT16_TO_NETWORK(uuid.time_hi_and_version); memcpy(pUuid, &uuid, 16);
[Libreoffice-commits] core.git: desktop/source
desktop/source/app/cmdlineargs.cxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit ebd697df0cfed7078346e61c069891cf02c2cc54 Author: Arnaud VERSINI AuthorDate: Mon Sep 5 16:16:59 2022 +0200 Commit: Noel Grandin CommitDate: Tue Sep 6 18:07:05 2022 +0200 desktop : use a std::mutex instead of a osl::Mutex Change-Id: I149af335196eaa31cbd11965e1656c3dfe7431ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139440 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index 9f9251064fb2..f1949cbd0bbf 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -40,6 +40,8 @@ #include #include +#include + using namespace com::sun::star::lang; using namespace com::sun::star::uri; using namespace com::sun::star::uno; @@ -198,8 +200,8 @@ CommandLineEvent CheckWebQuery(/* in,out */ OUString& arg, CommandLineEvent curE if (!arg.endsWithIgnoreAsciiCase(".iqy")) return curEvt; -static osl::Mutex aMutex; -osl::MutexGuard aGuard(aMutex); +static std::mutex aMutex; +std::lock_guard aGuard(aMutex); try {
[Libreoffice-commits] core.git: sc/source
sc/source/core/inc/cellkeytranslator.hxx |1 - sc/source/core/tool/cellkeytranslator.cxx | 21 +++-- 2 files changed, 7 insertions(+), 15 deletions(-) New commits: commit 604edde1946d4e0ced67ad9a7514253a6fe7fa40 Author: Arnaud VERSINI AuthorDate: Mon Sep 5 19:10:36 2022 +0200 Commit: Noel Grandin CommitDate: Tue Sep 6 18:06:34 2022 +0200 sc : remove useless lock and init in cellkeytranslator Change-Id: Ibad2dfb721e4df390ddaf955a8b7fcdf676773e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139447 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/core/inc/cellkeytranslator.hxx b/sc/source/core/inc/cellkeytranslator.hxx index 1e42d1cf1182..953e0c99ed59 100644 --- a/sc/source/core/inc/cellkeytranslator.hxx +++ b/sc/source/core/inc/cellkeytranslator.hxx @@ -70,7 +70,6 @@ public: private: ScCellKeywordTranslator(); -void init(); void addToMap(const OUString& rKey, const char* pName, const css::lang::Locale& rLocale, OpCode eOpCode); void addToMap(const TransItem* pItems, const css::lang::Locale& rLocale); diff --git a/sc/source/core/tool/cellkeytranslator.cxx b/sc/source/core/tool/cellkeytranslator.cxx index 1192e3c04f83..8e2218f9313a 100644 --- a/sc/source/core/tool/cellkeytranslator.cxx +++ b/sc/source/core/tool/cellkeytranslator.cxx @@ -171,17 +171,6 @@ void ScCellKeywordTranslator::transKeyword(OUString& rName, const lang::Locale* lclMatchKeyword(rName, spInstance->maStringNameMap, eOpCode, pLocale); } -ScCellKeywordTranslator::ScCellKeywordTranslator() : -maTransWrapper( ::comphelper::getProcessComponentContext(), -TransliterationFlags::LOWERCASE_UPPERCASE ) -{ -init(); -} - -ScCellKeywordTranslator::~ScCellKeywordTranslator() -{ -} - struct TransItem { const sal_Unicode* from; @@ -189,10 +178,10 @@ struct TransItem OpCode func; }; -void ScCellKeywordTranslator::init() +ScCellKeywordTranslator::ScCellKeywordTranslator() : +maTransWrapper( ::comphelper::getProcessComponentContext(), +TransliterationFlags::LOWERCASE_UPPERCASE ) { -::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - // The file below has been autogenerated by sc/workben/celltrans/parse.py. // To add new locale keywords, edit sc/workben/celltrans/keywords_utf16.txt // and re-run the parse.py script. @@ -206,6 +195,10 @@ void ScCellKeywordTranslator::init() #include "cellkeywords.inl" } +ScCellKeywordTranslator::~ScCellKeywordTranslator() +{ +} + void ScCellKeywordTranslator::addToMap(const OUString& rKey, const char* pName, const lang::Locale& rLocale, OpCode eOpCode) { ScCellKeyword aKeyItem( pName, eOpCode, rLocale );
[Libreoffice-commits] core.git: basic/source
basic/source/runtime/methods1.cxx | 438 +++--- 1 file changed, 178 insertions(+), 260 deletions(-) New commits: commit 6b3e66cd7a355061bf1dec76bbc4f389b6b60f2d Author: Arnaud VERSINI AuthorDate: Sun Jul 31 17:33:25 2022 +0200 Commit: Noel Grandin CommitDate: Mon Sep 5 16:04:25 2022 +0200 tdf147132 basic : flaten some functions Change-Id: I462cbac4183f304e9f4b296a6361a05a4615c7eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137650 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index f0c26ae5a9de..9e5356a6327b 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -338,15 +338,11 @@ void SbRtl_CInt(StarBASIC *, SbxArray & rPar, bool) // JSM void SbRtl_CLng(StarBASIC *, SbxArray & rPar, bool) // JSM { sal_Int32 nVal = 0; -if (rPar.Count() == 2) -{ -SbxVariable* pSbxVariable = rPar.Get(1); -nVal = pSbxVariable->GetLong(); -} -else -{ -StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); -} +if (rPar.Count() != 2) +return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + +SbxVariable* pSbxVariable = rPar.Get(1); +nVal = pSbxVariable->GetLong(); rPar.Get(0)->PutLong(nVal); } @@ -382,16 +378,11 @@ void SbRtl_CSng(StarBASIC *, SbxArray & rPar, bool) // JSM void SbRtl_CStr(StarBASIC *, SbxArray & rPar, bool) // JSM { -OUString aString; -if (rPar.Count() == 2) -{ -SbxVariable* pSbxVariable = rPar.Get(1); -aString = pSbxVariable->GetOUString(); -} -else -{ -StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); -} +if (rPar.Count() != 2) +return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + +SbxVariable* pSbxVariable = rPar.Get(1); +OUString aString = pSbxVariable->GetOUString(); rPar.Get(0)->PutString(aString); } @@ -412,98 +403,76 @@ void SbRtl_CVar(StarBASIC *, SbxArray & rPar, bool) // JSM void SbRtl_CVErr(StarBASIC *, SbxArray & rPar, bool) { -sal_Int16 nErrCode = 0; -if (rPar.Count() == 2) -{ -SbxVariable* pSbxVariable = rPar.Get(1); -nErrCode = pSbxVariable->GetInteger(); -} -else -{ -StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); -} +if (rPar.Count() != 2) +return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + +SbxVariable* pSbxVariable = rPar.Get(1); +sal_Int16 nErrCode = pSbxVariable->GetInteger(); rPar.Get(0)->PutErr(nErrCode); } void SbRtl_Iif(StarBASIC *, SbxArray & rPar, bool) // JSM { -if (rPar.Count() == 4) +if (rPar.Count() != 4) +return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + +if (rPar.Get(1)->GetBool()) { -if (rPar.Get(1)->GetBool()) -{ -*rPar.Get(0) = *rPar.Get(2); -} -else -{ -*rPar.Get(0) = *rPar.Get(3); -} +*rPar.Get(0) = *rPar.Get(2); } else { -StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); +*rPar.Get(0) = *rPar.Get(3); } + } void SbRtl_GetSystemType(StarBASIC *, SbxArray & rPar, bool) { if (rPar.Count() != 1) -{ -StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); -} -else -{ +return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + // Removed for SRC595 -rPar.Get(0)->PutInteger(-1); -} +rPar.Get(0)->PutInteger(-1); } void SbRtl_GetGUIType(StarBASIC *, SbxArray & rPar, bool) { if (rPar.Count() != 1) -{ -StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); -} -else -{ +return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + // 17.7.2000 Make simple solution for testtool / fat office #if defined(_WIN32) -rPar.Get(0)->PutInteger(1); +rPar.Get(0)->PutInteger(1); #elif defined(UNX) -rPar.Get(0)->PutInteger(4); +rPar.Get(0)->PutInteger(4); #else -rPar.Get(0)->PutInteger(-1); +rPar.Get(0)->PutInteger(-1); #endif -} } void SbRtl_Red(StarBASIC *, SbxArray & rPar, bool) { if (rPar.Count() != 2) -{ -StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); -} -else -{ -sal_Int32 nRGB = rPar.Get(1)->GetLong(); -nRGB &= 0x00FF; -nRGB >>= 16; -rPar.Get(0)->PutInteger(static_cast(nRGB)); -} +return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + +sal_Int32 nRGB = rPar.Get(1)->GetLong(); +nRGB &= 0x00FF; +nRGB >>= 16; +rPar.Get(0)->PutInteger(static_cast(nRGB)); + } void SbRtl_Green(StarBASIC *, SbxArray & rPar, bool) { if (rPar.Count() != 2) -{ -StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); -} -else -{ -sal_Int32 nRGB = rPar.Get(1)->GetLong(); -nRGB &= 0xFF00; -nRGB >>= 8; -rPar.Get(0)->PutInteg
[Libreoffice-commits] core.git: basic/source
basic/source/runtime/methods.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit f2a98e85948451a9540831e0090422f08b945560 Author: Arnaud VERSINI AuthorDate: Sun Jul 24 20:07:25 2022 +0200 Commit: Noel Grandin CommitDate: Mon Sep 5 15:59:06 2022 +0200 BASIC : missing parameter check in SbRtl_CreateObject Change-Id: I44e8c17274e20eb080494b2eaf25f74d33a35b36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137394 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index c2f979f2cb8f..3b718d78a9af 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -182,6 +182,9 @@ static uno::Reference< ucb::XSimpleFileAccess3 > const & getFileAccess() void SbRtl_CreateObject(StarBASIC * pBasic, SbxArray & rPar, bool) { +if( rPar.Count() < 2 ) +return StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); + OUString aClass(rPar.Get(1)->GetOUString()); SbxObjectRef p = SbxBase::CreateObject( aClass ); if( !p.is() )
[Libreoffice-commits] core.git: sal/rtl
sal/rtl/uuid.cxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit 3329bfe698ecb65cbfbe2bf8f38fce45809fd436 Author: Arnaud VERSINI AuthorDate: Mon Aug 15 16:54:24 2022 +0200 Commit: Noel Grandin CommitDate: Tue Aug 16 09:25:31 2022 +0200 rtl : use a local std::mutex instead of the global mutex Change-Id: I95a35fe451e459276dcb8c9b90d515d0a34fe36c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138318 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sal/rtl/uuid.cxx b/sal/rtl/uuid.cxx index 130be12456d6..5d348cb8f8e7 100644 --- a/sal/rtl/uuid.cxx +++ b/sal/rtl/uuid.cxx @@ -17,10 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include #include #include -#include #include #include #include @@ -108,7 +108,9 @@ extern "C" void SAL_CALL rtl_createUuid(sal_uInt8 *pTargetUUID , return aPool; }(); -osl::MutexGuard g(osl::Mutex::getGlobalMutex()); +static std::mutex aMutex; + +std::scoped_lock g(aMutex); if (rtl_random_getBytes(pool, pTargetUUID, 16) != rtl_Random_E_None) { abort();
[Libreoffice-commits] core.git: bridges/source
bridges/source/jni_uno/jni_bridge.cxx |1 - bridges/source/jni_uno/jni_info.cxx |5 + bridges/source/jni_uno/jni_java2uno.cxx |2 +- bridges/source/jni_uno/jni_uno2java.cxx | 24 4 files changed, 14 insertions(+), 18 deletions(-) New commits: commit 642017c88a303cf10d291d94836564edea9df0d8 Author: Arnaud VERSINI AuthorDate: Sun Jul 31 17:42:53 2022 +0200 Commit: Noel Grandin CommitDate: Sat Aug 13 09:11:58 2022 +0200 bridges/jni : remove useless using and use css instead of com::sun::star Change-Id: I1b73d68b007ba0dfa54f99ff8f8fea55e94a1ed2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137651 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx index 341c466aa90c..be2e3d37ec12 100644 --- a/bridges/source/jni_uno/jni_bridge.cxx +++ b/bridges/source/jni_uno/jni_bridge.cxx @@ -31,7 +31,6 @@ #include #include -using namespace ::osl; using namespace ::jni_uno; namespace diff --git a/bridges/source/jni_uno/jni_info.cxx b/bridges/source/jni_uno/jni_info.cxx index 434322f3003c..4fd935987463 100644 --- a/bridges/source/jni_uno/jni_info.cxx +++ b/bridges/source/jni_uno/jni_info.cxx @@ -33,9 +33,6 @@ #include -using namespace ::std; -using namespace ::osl; - namespace jni_uno { @@ -942,7 +939,7 @@ JNI_info const * JNI_info::get_jni_info( jni_env, static_cast< jobject >(uno_vm->getClassLoader()), jo_class, jo_forName ); -ClearableMutexGuard g( Mutex::getGlobalMutex() ); +osl::ClearableMutexGuard g( osl::Mutex::getGlobalMutex() ); jni_info = reinterpret_cast< JNI_info const * >( jni->GetStaticLongField( diff --git a/bridges/source/jni_uno/jni_java2uno.cxx b/bridges/source/jni_uno/jni_java2uno.cxx index b6c4c6ea9b35..5edb2b7b3453 100644 --- a/bridges/source/jni_uno/jni_java2uno.cxx +++ b/bridges/source/jni_uno/jni_java2uno.cxx @@ -94,7 +94,7 @@ void Bridge::handle_uno_exc( JNI_context const & jni, uno_Any * uno_exc ) const { #if OSL_DEBUG_LEVEL > 0 // append java stack trace to Message member -static_cast< ::com::sun::star::uno::Exception * >( +static_cast< css::uno::Exception * >( uno_exc->pData )->Message += jni.get_stack_trace(); #endif SAL_INFO( diff --git a/bridges/source/jni_uno/jni_uno2java.cxx b/bridges/source/jni_uno/jni_uno2java.cxx index 8fd38ec31b15..bc908fc5db98 100644 --- a/bridges/source/jni_uno/jni_uno2java.cxx +++ b/bridges/source/jni_uno/jni_uno2java.cxx @@ -84,7 +84,7 @@ void Bridge::handle_java_exc( OUString exc_name( jstring_to_oustring( jni, static_cast(jo_class_name.get()) ) ); -::com::sun::star::uno::TypeDescription td( exc_name.pData ); +css::uno::TypeDescription td( exc_name.pData ); if (!td.is() || (td.get()->eTypeClass != typelib_TypeClass_EXCEPTION)) { // call toString() @@ -107,7 +107,7 @@ void Bridge::handle_java_exc( #if OSL_DEBUG_LEVEL > 0 // patch Message, append stack trace -reinterpret_cast< ::com::sun::star::uno::Exception * >( +reinterpret_cast< css::uno::Exception * >( uno_data.get() )->Message += jni.get_stack_trace( jo_exc.get() ); #endif @@ -137,9 +137,9 @@ void Bridge::call_java( static_cast(m_java_env->pContext)->machine); // assure fully initialized iface_td: -::com::sun::star::uno::TypeDescription iface_holder; +css::uno::TypeDescription iface_holder; if (! iface_td->aBase.bComplete) { -iface_holder = ::com::sun::star::uno::TypeDescription( +iface_holder = css::uno::TypeDescription( reinterpret_cast(iface_td) ); iface_holder.makeComplete(); if (! iface_holder.get()->bComplete) { @@ -778,22 +778,22 @@ void UNO_proxy_dispatch( buf.append( ": " ); buf.append( err.m_message ); // binary identical struct -::com::sun::star::uno::RuntimeException exc( +css::uno::RuntimeException exc( buf.makeStringAndClear(), -::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface >() ); -::com::sun::star::uno::Type const & exc_type = cppu::UnoType::get(); +css::uno::Reference< + css::uno::XInterface >() ); +css::uno::Type const & exc_type = cppu::UnoType::get(); uno_type_any_construct( *uno_exc, &exc, exc_type.getTypeLibType(), nullptr ); SAL_INFO("bridges", exc.Message); } catch (::jvmaccess::VirtualMachine::AttachGuard::CreationException &) { // binary identical struct -::com::sun::star::uno::RuntimeException exc( +css::uno::RuntimeException exc( "[jni_uno bridge error] attaching current thread to java failed!", -::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface >(
[Libreoffice-commits] core.git: toolkit/CppunitTest_toolkit_a11y.mk
toolkit/CppunitTest_toolkit_a11y.mk | 11 --- 1 file changed, 11 deletions(-) New commits: commit 5dc4274eb5ccf3c2cc29676280b70dfc5d5a43b3 Author: Arnaud VERSINI AuthorDate: Sat Jun 11 20:16:43 2022 +0200 Commit: Noel Grandin CommitDate: Mon Jul 18 10:02:57 2022 +0200 toolkit : remove useless comments Change-Id: I45565ae3259321e139f73071e36e94180dcfbffe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135672 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/toolkit/CppunitTest_toolkit_a11y.mk b/toolkit/CppunitTest_toolkit_a11y.mk index 9739ec7f9666..06468a49c286 100644 --- a/toolkit/CppunitTest_toolkit_a11y.mk +++ b/toolkit/CppunitTest_toolkit_a11y.mk @@ -51,15 +51,4 @@ $(eval $(call gb_CppunitTest_use_vcl,toolkit_a11y)) $(eval $(call gb_CppunitTest_use_rdb,toolkit_a11y,services)) -#~ $(eval $(call gb_CppunitTest_use_components,toolkit_a11y,\ -#~ comphelper/util/comphelp \ -#~ configmgr/source/configmgr \ -#~ framework/util/fwk \ -#~ i18npool/util/i18npool \ -#~ sfx2/util/sfx \ -#~ toolkit/util/tk \ -#~ ucb/source/core/ucb1 \ -#~ ucb/source/ucp/file/ucpfile1 \ -#~ )) - # vim: set noet sw=4 ts=4:
[Libreoffice-commits] core.git: animations/source
animations/source/animcore/animcore.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 2fffe41501aa694082da2ac92e925b98c704bffd Author: Arnaud VERSINI AuthorDate: Sat Jul 16 20:30:15 2022 +0200 Commit: Noel Grandin CommitDate: Sun Jul 17 19:29:22 2022 +0200 Animations : no need to use the global mutex here Change-Id: Ia63a570efdd15c60fc31d978a23e76102e466745 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137141 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx index 737da604a594..04e7a7daa879 100644 --- a/animations/source/animcore/animcore.cxx +++ b/animations/source/animcore/animcore.cxx @@ -745,7 +745,9 @@ Any SAL_CALL AnimationNode::queryInterface( const Type& aType ) void AnimationNode::initTypeProvider( sal_Int16 nNodeType ) noexcept { -::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); +static std::mutex aMutex; + +std::scoped_lock aGuard(aMutex); if( mpTypes[nNodeType] ) return;
[Libreoffice-commits] core.git: vcl/skia
vcl/skia/gdiimpl.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 1e8db42c878b0e0608717cec8e012269856e5934 Author: Arnaud VERSINI AuthorDate: Sat Apr 30 19:25:15 2022 +0200 Commit: Luboš Luňák CommitDate: Wed May 4 06:04:52 2022 +0200 vcl : avoid recursive call if skia context creation failed. To avoid this bactrace : https://crashreport.libreoffice.org/stats/crash_details/4d1984f3-3352-49fa-8569-ebf6994ed216 Change-Id: I45ae8b56191c546c551ccaf48d5ab27a20b8e0e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133662 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index c253ceb3a2df..82f25ad17c2d 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -301,7 +301,7 @@ void SkiaSalGraphicsImpl::createWindowSurface(bool forceRaster) createWindowSurfaceInternal(forceRaster); if (!mSurface) { -switch (renderMethodToUse()) +switch (forceRaster ? RenderRaster : renderMethodToUse()) { case RenderVulkan: SAL_WARN("vcl.skia",
[Libreoffice-commits] core.git: sal/inc sal/osl
sal/inc/signalshared.hxx |3 -- sal/osl/all/signalshared.cxx | 55 ++- 2 files changed, 18 insertions(+), 40 deletions(-) New commits: commit 583b2e6bdb5550ff435ce739dac4318bc4a650e0 Author: Arnaud Versini AuthorDate: Fri Apr 1 16:07:35 2022 +0200 Commit: Noel Grandin CommitDate: Sun Apr 10 12:08:22 2022 +0200 osl signalshared : use std::mutex instead of oslMutex. It also avoids possible double signal init and deinit. Change-Id: I4a24a011ee82d885e7a42abedea6a9fd96d3cab3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132434 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sal/inc/signalshared.hxx b/sal/inc/signalshared.hxx index fecedf52ff75..10bc0f57b974 100644 --- a/sal/inc/signalshared.hxx +++ b/sal/inc/signalshared.hxx @@ -21,7 +21,6 @@ #include #include -#include struct oslSignalHandlerImpl { @@ -30,8 +29,6 @@ struct oslSignalHandlerImpl oslSignalHandlerImpl* pNext; }; -extern bool bInitSignal; - oslSignalAction callSignalHandler(oslSignalInfo* pInfo); // platform-specific functions that need to be implemented diff --git a/sal/osl/all/signalshared.cxx b/sal/osl/all/signalshared.cxx index 2fc72c478fcc..530413f2604c 100644 --- a/sal/osl/all/signalshared.cxx +++ b/sal/osl/all/signalshared.cxx @@ -24,28 +24,17 @@ #include #include - -bool bInitSignal = false; +#include namespace { oslSignalHandlerImpl* SignalList; -oslMutex SignalListMutex; - -bool initSignal() -{ -SignalListMutex = osl_createMutex(); - -return onInitSignal(); -} +bool bInitSignal = false; -bool deInitSignal() +std::mutex& getSignalMutex() { -bool bRet = onDeInitSignal(); - -osl_destroyMutex(SignalListMutex); - -return bRet; +static std::mutex aMutex; +return aMutex; } } @@ -70,24 +59,22 @@ oslSignalHandler SAL_CALL osl_addSignalHandler(oslSignalHandlerFunction handler, if (!handler) return nullptr; -if (!bInitSignal) -bInitSignal = initSignal(); - oslSignalHandlerImpl* pHandler = static_cast(calloc(1, sizeof(oslSignalHandlerImpl))); +std::scoped_lock aGuard(getSignalMutex()); + +if (!bInitSignal) +bInitSignal = onInitSignal(); + if (pHandler) { pHandler->Handler = handler; pHandler->pData = pData; -osl_acquireMutex(SignalListMutex); - pHandler->pNext = SignalList; SignalList = pHandler; -osl_releaseMutex(SignalListMutex); - return pHandler; } @@ -96,10 +83,10 @@ oslSignalHandler SAL_CALL osl_addSignalHandler(oslSignalHandlerFunction handler, sal_Bool SAL_CALL osl_removeSignalHandler(oslSignalHandler handler) { -if (!bInitSignal) -bInitSignal = initSignal(); +std::scoped_lock aGuard(getSignalMutex()); -osl_acquireMutex(SignalListMutex); +if (!bInitSignal) +bInitSignal = onInitSignal(); oslSignalHandlerImpl* pHandler = SignalList; oslSignalHandlerImpl* pPrevious = nullptr; @@ -113,10 +100,8 @@ sal_Bool SAL_CALL osl_removeSignalHandler(oslSignalHandler handler) else SignalList = pHandler->pNext; -osl_releaseMutex(SignalListMutex); - -if (!SignalList) -bInitSignal = deInitSignal(); +if (SignalList == nullptr) +bInitSignal = onDeInitSignal(); free(pHandler); @@ -127,17 +112,15 @@ sal_Bool SAL_CALL osl_removeSignalHandler(oslSignalHandler handler) pHandler = pHandler->pNext; } -osl_releaseMutex(SignalListMutex); - return false; } oslSignalAction SAL_CALL osl_raiseSignal(sal_Int32 userSignal, void* userData) { -if (!bInitSignal) -bInitSignal = initSignal(); +std::scoped_lock aGuard(getSignalMutex()); -osl_acquireMutex(SignalListMutex); +if (!bInitSignal) +bInitSignal = onInitSignal(); oslSignalInfo info; info.Signal = osl_Signal_User; @@ -146,8 +129,6 @@ oslSignalAction SAL_CALL osl_raiseSignal(sal_Int32 userSignal, void* userData) oslSignalAction action = callSignalHandler(&info); -osl_releaseMutex(SignalListMutex); - return action; }
[Libreoffice-commits] core.git: cpputools/source
cpputools/source/unoexe/unoexe.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 8fa40be492f4ae85eb3f0db363bd8d2cf7c214a6 Author: Arnaud Versini AuthorDate: Wed Mar 30 11:00:10 2022 +0200 Commit: Noel Grandin CommitDate: Fri Apr 1 10:07:55 2022 +0200 cpputools : use std::mutex instead of osl::Mutex Change-Id: I75879a0f03d8212ac9392c04fb76113cf24d510e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132300 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index b9dca78b67ce..31d6d6bdfac2 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -18,6 +18,7 @@ */ #include +#include #include #include @@ -229,7 +230,7 @@ class OInstanceProvider { Reference< XComponentContext > _xContext; -Mutex _aSingleInstanceMutex; +std::mutex_aSingleInstanceMutex; Reference< XInterface > _xSingleInstance; bool _bSingleInstance; @@ -296,7 +297,7 @@ Reference< XInterface > OInstanceProvider::getInstance( const OUString & rName ) { if (! _xSingleInstance.is()) { -MutexGuard aGuard( _aSingleInstanceMutex ); +std::lock_guard aGuard( _aSingleInstanceMutex ); if (! _xSingleInstance.is()) { _xSingleInstance = createInstance();
[Libreoffice-commits] core.git: desktop/source
desktop/source/splash/splash.cxx | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) New commits: commit e96150520918d1bd008ba39485512e74cec3bc35 Author: Arnaud Versini AuthorDate: Tue Mar 29 16:52:08 2022 +0200 Commit: Noel Grandin CommitDate: Wed Mar 30 12:45:06 2022 +0200 desktop : use std::mutex instead of osl::Mutex Change-Id: I775baf9a2c9599b10eb855535ac0f8e438dd863b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132279 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 2389e14f4d11..6402d9f7e99b 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -34,6 +34,8 @@ #include #include +#include + #define NOT_LOADED (tools::Long(-1)) #define NOT_LOADED_COLOR (Color(ColorTransparency, 0x)) @@ -73,8 +75,6 @@ private: void SetScreenBitmap(BitmapEx &rBitmap); static void determineProgressRatioValues( double& rXRelPos, double& rYRelPos, double& rRelWidth, double& rRelHeight ); -static osl::Mutex _aMutex; - BitmapEx_aIntroBmp; Color _cProgressFrameColor; Color _cProgressBarColor; @@ -243,7 +243,8 @@ void SAL_CALL SplashScreen::setValue(sal_Int32 nValue) void SAL_CALL SplashScreen::initialize( const css::uno::Sequence< css::uno::Any>& aArguments ) { -osl::MutexGuard aGuard( _aMutex ); +static std::mutex aMutex; +std::lock_guard aGuard( aMutex ); if (!aArguments.hasElements()) return; @@ -616,10 +617,6 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const tools:: rRenderContext.DrawOutDev(Point(), GetOutputSizePixel(), Point(), _vdev->GetOutputSizePixel(), *_vdev); } - -// get service instance... -osl::Mutex SplashScreen::_aMutex; - } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
[Libreoffice-commits] core.git: bridges/source
bridges/source/jni_uno/jni_info.cxx | 18 +- bridges/source/jni_uno/jni_info.h |4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) New commits: commit 370b5dbe0d5e62c71b90c795f936dd7c9c240f36 Author: Arnaud Versini AuthorDate: Fri Mar 25 10:29:37 2022 +0100 Commit: Noel Grandin CommitDate: Fri Mar 25 12:35:12 2022 +0100 bridges : use std::mutex in java brige Change-Id: I07b215067b1cefc87919680fad3299d702ff6d1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132100 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/bridges/source/jni_uno/jni_info.cxx b/bridges/source/jni_uno/jni_info.cxx index 70839e168eb2..16a5a1ac4d5c 100644 --- a/bridges/source/jni_uno/jni_info.cxx +++ b/bridges/source/jni_uno/jni_info.cxx @@ -369,18 +369,18 @@ JNI_type_info const * JNI_info::create_type_info( // look up JNI_type_info * info; -ClearableMutexGuard guard( m_mutex ); +std::unique_lock guard( m_mutex ); JNI_type_info_holder & holder = m_type_map[ uno_name ]; if (holder.m_info == nullptr) // new insertion { holder.m_info = new_info; -guard.clear(); +guard.unlock(); info = new_info; } else // inserted in the meantime { info = holder.m_info; -guard.clear(); +guard.unlock(); new_info->destroy( jni.get_jni_env() ); } return info; @@ -397,12 +397,12 @@ JNI_type_info const * JNI_info::get_type_info( OUString const & uno_name = OUString::unacquired( &td->pTypeName ); JNI_type_info const * info; -ClearableMutexGuard guard( m_mutex ); +std::unique_lock guard( m_mutex ); t_str2type::const_iterator iFind( m_type_map.find( uno_name ) ); if (iFind == m_type_map.end()) { -guard.clear(); +guard.unlock(); info = create_type_info( jni, td ); } else @@ -424,11 +424,11 @@ JNI_type_info const * JNI_info::get_type_info( OUString const & uno_name = OUString::unacquired( &type->pTypeName ); JNI_type_info const * info; -ClearableMutexGuard guard( m_mutex ); +std::unique_lock guard( m_mutex ); t_str2type::const_iterator iFind( m_type_map.find( uno_name ) ); if (iFind == m_type_map.end()) { -guard.clear(); +guard.unlock(); TypeDescr td( type ); info = create_type_info( jni, td.get() ); } @@ -450,11 +450,11 @@ JNI_type_info const * JNI_info::get_type_info( } JNI_type_info const * info; -ClearableMutexGuard guard( m_mutex ); +std::unique_lock guard( m_mutex ); t_str2type::const_iterator iFind( m_type_map.find( uno_name ) ); if (iFind == m_type_map.end()) { -guard.clear(); +guard.unlock(); css::uno::TypeDescription td( uno_name ); if (! td.is()) { diff --git a/bridges/source/jni_uno/jni_info.h b/bridges/source/jni_uno/jni_info.h index ede5f1718316..7a18e553e400 100644 --- a/bridges/source/jni_uno/jni_info.h +++ b/bridges/source/jni_uno/jni_info.h @@ -25,7 +25,7 @@ #include "jni_base.h" -#include +#include #include #include #include @@ -122,7 +122,7 @@ typedef std::unordered_map< class JNI_info { -mutable ::osl::Mutexm_mutex; +mutable std::mutex m_mutex; mutable t_str2type m_type_map; public:
[Libreoffice-commits] core.git: binaryurp/source
binaryurp/source/bridge.cxx | 44 ++-- binaryurp/source/bridge.hxx |3 ++- binaryurp/source/writer.cxx |9 - binaryurp/source/writer.hxx |4 ++-- 4 files changed, 30 insertions(+), 30 deletions(-) New commits: commit 34df7e2cb95385d513e9c74cda5178e3a68d27df Author: Arnaud Versini AuthorDate: Thu Mar 24 12:56:28 2022 +0100 Commit: Noel Grandin CommitDate: Fri Mar 25 09:20:48 2022 +0100 binaryurp: use more std::mutex Change-Id: I1d16c4cbf60e78323b74e7df049736bd0d0ab591 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132072 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx index 3299cd0ed519..050ebec7403c 100644 --- a/binaryurp/source/bridge.cxx +++ b/binaryurp/source/bridge.cxx @@ -207,7 +207,7 @@ void Bridge::start() { rtl::Reference r(new Reader(this)); rtl::Reference w(new Writer(this)); { -osl::MutexGuard g(mutex_); +std::lock_guard g(mutex_); assert( state_ == STATE_INITIAL && threadPool_ == nullptr && !writer_.is() && !reader_.is()); @@ -237,7 +237,7 @@ void Bridge::terminate(bool final) { bool joinW; Listeners ls; { -osl::ClearableMutexGuard g(mutex_); +std::unique_lock g(mutex_); switch (state_) { case STATE_INITIAL: // via ~Bridge -> dispose -> terminate case STATE_FINAL: @@ -246,10 +246,10 @@ void Bridge::terminate(bool final) { break; case STATE_TERMINATED: if (final) { -g.clear(); +g.unlock(); terminated_.wait(); { -osl::MutexGuard g2(mutex_); +std::lock_guard g2(mutex_); tp = threadPool_; threadPool_ = nullptr; if (reader_.is()) { @@ -309,7 +309,7 @@ void Bridge::terminate(bool final) { uno_threadpool_dispose(tp); Stubs s; { -osl::MutexGuard g(mutex_); +std::lock_guard g(mutex_); s.swap(stubs_); } for (auto & stub : s) @@ -340,7 +340,7 @@ void Bridge::terminate(bool final) { uno_threadpool_destroy(tp); } { -osl::MutexGuard g(mutex_); +std::lock_guard g(mutex_); if (final) { threadPool_ = nullptr; } @@ -361,14 +361,14 @@ BinaryAny Bridge::mapCppToBinaryAny(css::uno::Any const & cppAny) { } uno_ThreadPool Bridge::getThreadPool() { -osl::MutexGuard g(mutex_); +std::lock_guard g(mutex_); checkDisposed(); assert(threadPool_ != nullptr); return threadPool_; } rtl::Reference< Writer > Bridge::getWriter() { -osl::MutexGuard g(mutex_); +std::lock_guard g(mutex_); checkDisposed(); assert(writer_.is()); return writer_; @@ -392,7 +392,7 @@ css::uno::UnoInterfaceReference Bridge::registerIncomingInterface( } else { obj.set(new Proxy(this, oid, type), SAL_NO_ACQUIRE); { -osl::MutexGuard g(mutex_); +std::lock_guard g(mutex_); assert(proxies_ < std::numeric_limits< std::size_t >::max()); ++proxies_; } @@ -419,7 +419,7 @@ OUString Bridge::registerOutgoingInterface( if (!Proxy::isProxy(this, object, &oid)) { binaryUno_.get()->pExtEnv->getObjectIdentifier( binaryUno_.get()->pExtEnv, &oid.pData, object.get()); -osl::MutexGuard g(mutex_); +std::lock_guard g(mutex_); Stubs::iterator i(stubs_.find(oid)); Stub newStub; Stub * stub = i == stubs_.end() ? &newStub : &i->second; @@ -458,7 +458,7 @@ css::uno::UnoInterfaceReference Bridge::findStub( OUString const & oid, css::uno::TypeDescription const & type) { assert(!oid.isEmpty() && type.is()); -osl::MutexGuard g(mutex_); +std::lock_guard g(mutex_); Stubs::iterator i(stubs_.find(oid)); if (i != stubs_.end()) { Stub::iterator j(i->second.find(type)); @@ -484,7 +484,7 @@ void Bridge::releaseStub( css::uno::UnoInterfaceReference obj; bool unused; { -osl::MutexGuard g(mutex_); +std::lock_guard g(mutex_); Stubs::iterator i(stubs_.find(oid)); if (i == stubs_.end()) { throw css::uno::RuntimeException("URP: release unknown stub"); @@ -538,7 +538,7 @@ void Bridge::freeProxy(Proxy & proxy) { } bool unused; { -osl::MutexGuard g(mutex_); +std::lock_guard g(mutex_); assert(proxies_ > 0); --proxies_; unused = becameUnused(); @@ -547,7 +547,7 @@ void Bridge::freeProxy(Proxy & proxy) { } void Bridge::incrementCalls(bool normalCall) noexcept { -osl::MutexGuard g(mutex_); +
[Libreoffice-commits] core.git: vcl/unx
vcl/unx/gtk3/gtkobject.cxx |2 -- 1 file changed, 2 deletions(-) New commits: commit ff3f11a7fa8b7f1096d0bb64a2aa41c4d1edae59 Author: Arnaud Versini AuthorDate: Thu Mar 24 14:33:19 2022 +0100 Commit: Arnaud Versini CommitDate: Thu Mar 24 17:31:03 2022 +0100 gtk3 VCL : remove useless check Change-Id: I45869f2160435da27f1b30acf41dbee76ce524e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132076 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/vcl/unx/gtk3/gtkobject.cxx b/vcl/unx/gtk3/gtkobject.cxx index 6f8fffd3f0a0..e5adb887cbeb 100644 --- a/vcl/unx/gtk3/gtkobject.cxx +++ b/vcl/unx/gtk3/gtkobject.cxx @@ -33,8 +33,6 @@ GtkSalObjectBase::GtkSalObjectBase(GtkSalFrame* pParent) , m_pParent(pParent) , m_pRegion(nullptr) { -if (!m_pParent) -return; } GtkSalObject::GtkSalObject(GtkSalFrame* pParent, bool bShow)
[Libreoffice-commits] core.git: comphelper/source
comphelper/source/misc/traceevent.cxx |9 + 1 file changed, 5 insertions(+), 4 deletions(-) New commits: commit c2424341ed444647d979a69ae55268e96fad3d56 Author: Arnaud VERSINI AuthorDate: Sun Jan 30 10:30:27 2022 +0100 Commit: Noel Grandin CommitDate: Thu Mar 24 15:28:46 2022 +0100 comphelper : use std::mutex in traceevent Change-Id: I959b8c189a9ad073167cf3e0620947cbda77196c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129159 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/comphelper/source/misc/traceevent.cxx b/comphelper/source/misc/traceevent.cxx index ab71853e1292..fb07e1caa771 100644 --- a/comphelper/source/misc/traceevent.cxx +++ b/comphelper/source/misc/traceevent.cxx @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -34,12 +35,12 @@ static thread_local int nProfileZoneNesting = 0; // Level of Nested Profile Zone namespace { std::vector g_aRecording; // recorded data -osl::Mutex g_aMutex; +std::mutex g_aMutex; } void TraceEvent::addRecording(const OUString& sObject) { -osl::MutexGuard aGuard(g_aMutex); +std::lock_guard aGuard(g_aMutex); g_aRecording.emplace_back(sObject); @@ -76,7 +77,7 @@ void TraceEvent::addInstantEvent(const char* sName, const std::map TraceEvent::getEventVectorAndClear() bool bRecording; std::vector aRecording; { -osl::MutexGuard aGuard(g_aMutex); +std::lock_guard aGuard(g_aMutex); bRecording = s_bRecording; stopRecording(); aRecording.swap(g_aRecording);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - starmath/inc starmath/source
starmath/inc/dialog.hxx|2 +- starmath/source/dialog.cxx |8 2 files changed, 5 insertions(+), 5 deletions(-) New commits: commit 55f3708c1a03e9e16879dec94793553b7fe25811 Author: Arnaud VERSINI AuthorDate: Sat Mar 5 20:50:08 2022 +0100 Commit: Xisco Fauli CommitDate: Mon Mar 7 10:43:05 2022 +0100 Fix tdf#147755 by copying the vector. Revert partially 224953d896a3dba5d85992394525ab8b54d8c314 Change-Id: Ic12d3b0a080ad3af69fa5c4e8c9b4d331305a663 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131066 Tested-by: Jenkins Reviewed-by: Noel Grandin (cherry picked from commit 82f9e12b737b3dbdf8cb9175c94d61005b666725) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131012 Reviewed-by: Xisco Fauli diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 6fbaaff7b819..fee12d9a5130 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -279,7 +279,7 @@ public: void calccols(const vcl::RenderContext& rRenderContext); voidSelectSymbol(sal_uInt16 nSymbol); sal_uInt16 GetSelectSymbol() const { return nSelectSymbol; } -void SetSymbolSet(SymbolPtrVec_t && rSymbolSet); +void SetSymbolSet(const SymbolPtrVec_t & rSymbolSet); void SetSelectHdl(const Link& rLink) { aSelectHdlLink = rLink; } void SetDblClickHdl(const Link& rLink) { aDblClickHdlLink = rLink; } }; diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index b7d875f94082..8cf4029c1bb6 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1103,9 +1103,9 @@ void SmShowSymbolSet::calccols(const vcl::RenderContext& rRenderContext) SetScrollBarRange(); } -void SmShowSymbolSet::SetSymbolSet(SymbolPtrVec_t && rSymbolSet) +void SmShowSymbolSet::SetSymbolSet(const SymbolPtrVec_t & rSymbolSet) { -aSymbolSet = std::move(rSymbolSet); +aSymbolSet = rSymbolSet; SetScrollBarRange(); Invalidate(); } @@ -1257,7 +1257,7 @@ IMPL_LINK_NOARG(SmSymbolDialog, EditClickHdl, weld::Button&, void) // just update display of current symbol set assert(aSymSetName == aSymSetName); //unexpected change in symbol set name aSymbolSet = rSymbolMgr.GetSymbolSet( aSymbolSetName ); -m_xSymbolSetDisplay->SetSymbolSet( std::vector(aSymbolSet) ); +m_xSymbolSetDisplay->SetSymbolSet( aSymbolSet ); } if (nSymPos >= aSymbolSet.size()) @@ -1350,7 +1350,7 @@ bool SmSymbolDialog::SelectSymbolSet(const OUString &rSymbolSetName) } ); const bool bEmptySymbolSet = aSymbolSet.empty(); -m_xSymbolSetDisplay->SetSymbolSet( std::move(aSymbolSet) ); +m_xSymbolSetDisplay->SetSymbolSet( aSymbolSet ); if (!bEmptySymbolSet) SelectSymbol(0);
[Libreoffice-commits] core.git: starmath/inc starmath/source
starmath/inc/dialog.hxx|2 +- starmath/source/dialog.cxx |8 2 files changed, 5 insertions(+), 5 deletions(-) New commits: commit 82f9e12b737b3dbdf8cb9175c94d61005b666725 Author: Arnaud VERSINI AuthorDate: Sat Mar 5 20:50:08 2022 +0100 Commit: Noel Grandin CommitDate: Sun Mar 6 14:37:20 2022 +0100 Fix tdf#147755 by copying the vector. Revert partially 224953d896a3dba5d85992394525ab8b54d8c314 Change-Id: Ic12d3b0a080ad3af69fa5c4e8c9b4d331305a663 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131066 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index 6fbaaff7b819..fee12d9a5130 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -279,7 +279,7 @@ public: void calccols(const vcl::RenderContext& rRenderContext); voidSelectSymbol(sal_uInt16 nSymbol); sal_uInt16 GetSelectSymbol() const { return nSelectSymbol; } -void SetSymbolSet(SymbolPtrVec_t && rSymbolSet); +void SetSymbolSet(const SymbolPtrVec_t & rSymbolSet); void SetSelectHdl(const Link& rLink) { aSelectHdlLink = rLink; } void SetDblClickHdl(const Link& rLink) { aDblClickHdlLink = rLink; } }; diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 559a7e55c789..66f42f6c662f 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1103,9 +1103,9 @@ void SmShowSymbolSet::calccols(const vcl::RenderContext& rRenderContext) SetScrollBarRange(); } -void SmShowSymbolSet::SetSymbolSet(SymbolPtrVec_t && rSymbolSet) +void SmShowSymbolSet::SetSymbolSet(const SymbolPtrVec_t & rSymbolSet) { -aSymbolSet = std::move(rSymbolSet); +aSymbolSet = rSymbolSet; SetScrollBarRange(); Invalidate(); } @@ -1257,7 +1257,7 @@ IMPL_LINK_NOARG(SmSymbolDialog, EditClickHdl, weld::Button&, void) // just update display of current symbol set assert(aSymSetName == aSymSetName); //unexpected change in symbol set name aSymbolSet = rSymbolMgr.GetSymbolSet( aSymbolSetName ); -m_xSymbolSetDisplay->SetSymbolSet( std::vector(aSymbolSet) ); +m_xSymbolSetDisplay->SetSymbolSet( aSymbolSet ); } if (nSymPos >= aSymbolSet.size()) @@ -1350,7 +1350,7 @@ bool SmSymbolDialog::SelectSymbolSet(const OUString &rSymbolSetName) } ); const bool bEmptySymbolSet = aSymbolSet.empty(); -m_xSymbolSetDisplay->SetSymbolSet( std::move(aSymbolSet) ); +m_xSymbolSetDisplay->SetSymbolSet( aSymbolSet ); if (!bEmptySymbolSet) SelectSymbol(0);
[Libreoffice-commits] core.git: animations/source
animations/source/animcore/animcore.cxx | 246 +++- 1 file changed, 122 insertions(+), 124 deletions(-) New commits: commit 63400fa8c2333a519f0c3180dd490d2b4204fbc7 Author: Arnaud VERSINI AuthorDate: Sun Jan 23 17:13:07 2022 +0100 Commit: Noel Grandin CommitDate: Sun Jan 30 07:32:41 2022 +0100 animations : use cppuhelper::BaseMutex Change-Id: Ife2b5480ad26c01388f5803f1cc5ae1e9e44a123 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128842 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx index 5f20fa16139b..f72c15701b53 100644 --- a/animations/source/animcore/animcore.cxx +++ b/animations/source/animcore/animcore.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -102,8 +103,8 @@ namespace animcore { namespace { - -class AnimationNodeBase : public XAnimateMotion, +class AnimationNodeBase : public cppu::BaseMutex, +public XAnimateMotion, public XAnimatePhysics, public XAnimateColor, public XTransitionFilter, @@ -120,12 +121,10 @@ class AnimationNodeBase : public XAnimateMotion, public XUnoTunnel, public OWeakObject { -public: -// our first, last and only protection from multi-threads! -Mutex maMutex; + }; -class AnimationNode final : public AnimationNodeBase +class AnimationNode final: public AnimationNodeBase { public: explicit AnimationNode(sal_Int16 nNodeType); @@ -367,7 +366,8 @@ private: }; -class TimeContainerEnumeration : public ::cppu::WeakImplHelper< XEnumeration > +class TimeContainerEnumeration : private cppu::BaseMutex, + public ::cppu::WeakImplHelper< XEnumeration > { public: explicit TimeContainerEnumeration( std::vector< Reference< XAnimationNode > >&& rChildren ); @@ -382,9 +382,6 @@ private: /** current iteration position */ std::vector< Reference< XAnimationNode > >::iterator maIter; - -/** our first, last and only protection from multi-threads! */ -Mutex maMutex; }; } @@ -398,14 +395,14 @@ TimeContainerEnumeration::TimeContainerEnumeration( std::vector< Reference< XAni // Methods sal_Bool SAL_CALL TimeContainerEnumeration::hasMoreElements() { -Guard< Mutex > aGuard( maMutex ); +Guard< Mutex > aGuard( m_aMutex ); return maIter != maChildren.end(); } Any SAL_CALL TimeContainerEnumeration::nextElement() { -Guard< Mutex > aGuard( maMutex ); +Guard< Mutex > aGuard( m_aMutex ); if( maIter == maChildren.end() ) throw NoSuchElementException(); @@ -417,7 +414,8 @@ Any SAL_CALL TimeContainerEnumeration::nextElement() std::array*, 13> AnimationNode::mpTypes = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr }; AnimationNode::AnimationNode( sal_Int16 nNodeType ) -: maChangeListener(maMutex), +: AnimationNodeBase(), +maChangeListener(m_aMutex), mnNodeType( nNodeType ), mnFill( AnimationFill::DEFAULT ), mnFillDefault( AnimationFill::INHERIT ), @@ -451,7 +449,7 @@ AnimationNode::AnimationNode( sal_Int16 nNodeType ) AnimationNode::AnimationNode( const AnimationNode& rNode ) : AnimationNodeBase(), -maChangeListener(maMutex), +maChangeListener(m_aMutex), mnNodeType( rNode.mnNodeType ), // attributes for the XAnimationNode interface implementation @@ -926,7 +924,7 @@ Sequence< OUString > AnimationNode::getSupportedServiceNames() // XAnimationNode sal_Int16 SAL_CALL AnimationNode::getType() { -Guard< Mutex > aGuard( maMutex ); +Guard< Mutex > aGuard( m_aMutex ); return mnNodeType; } @@ -934,7 +932,7 @@ sal_Int16 SAL_CALL AnimationNode::getType() // XAnimationNode Any SAL_CALL AnimationNode::getBegin() { -Guard< Mutex > aGuard( maMutex ); +Guard< Mutex > aGuard( m_aMutex ); return maBegin; } @@ -942,7 +940,7 @@ Any SAL_CALL AnimationNode::getBegin() // XAnimationNode void SAL_CALL AnimationNode::setBegin( const Any& _begin ) { -Guard< Mutex > aGuard( maMutex ); +Guard< Mutex > aGuard( m_aMutex ); if( _begin != maBegin ) { maBegin = _begin; @@ -954,7 +952,7 @@ void SAL_CALL AnimationNode::setBegin( const Any& _begin ) // XAnimationNode Any SAL_CALL AnimationNode::getDuration() { -Guard< Mutex > aGuard( maMutex ); +Guard< Mutex > aGuard( m_aMutex ); return maDuration; } @@ -962,7 +960,7 @@ Any SAL_CALL AnimationNode::getDuration() // XAnimationNode void SAL_CALL AnimationNode::setDuration( const Any& _duration ) { -Guard< Mutex > aGuard( maMutex ); +Guard< Mutex > aGuard( m_aMutex ); if( _duration != maDuration ) { maDuration = _
[Libreoffice-commits] core.git: g
g |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 5448ad57032df1113daf1c3899741febc069d8b3 Author: Arnaud VERSINI AuthorDate: Sun Jan 2 17:33:27 2022 +0100 Commit: Arnaud Versini CommitDate: Sat Jan 15 15:42:34 2022 +0100 Allow g to run git gc command Change-Id: Ibca338cbd99839b20a2373075a2e544e7ab638e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127870 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/g b/g index 8b733fc878c6..021ad6c41cde 100755 --- a/g +++ b/g @@ -24,7 +24,7 @@ usage() { git echo -echo "Usage: g [options] [git (checkout|clone|fetch|grep|pull|push|reset) [git options/args..]]" +echo "Usage: g [options] [git (checkout|clone|fetch|gc|grep|pull|push|reset) [git options/args..]]" echo "" echo " -z restore the git hooks and do other sanity checks" } @@ -362,6 +362,9 @@ case "$COMMAND" in (git fetch "$@" && git submodule foreach git fetch "$@" ) && git submodule update --progress ;; +gc) + (git gc "$@" && git submodule foreach git gc "$@" ) +;; grep) KEEP_GOING="||:" do_git_cmd "${COMMAND}" "$@"
[Libreoffice-commits] core.git: idl/source
idl/source/prj/globals.cxx |9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) New commits: commit 978acbeb8cb203ae94040d5253031be11d17d15e Author: Arnaud VERSINI AuthorDate: Sun Jan 2 17:10:11 2022 +0100 Commit: Noel Grandin CommitDate: Sun Jan 2 18:24:56 2022 +0100 idl : no need to use rtl::Static Change-Id: I8b53ab93010f500a61aa4930817c25d09cb2552d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127869 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/idl/source/prj/globals.cxx b/idl/source/prj/globals.cxx index 1540f53e6305..3e8160ac13ef 100644 --- a/idl/source/prj/globals.cxx +++ b/idl/source/prj/globals.cxx @@ -23,15 +23,10 @@ #include #include -namespace { - -struct TheIdlDll: public rtl::Static {}; - -} - IdlDll & GetIdlApp() { -return TheIdlDll::get(); +static IdlDll aIdlDll; +return aIdlDll; } IdlDll::IdlDll()
[Libreoffice-commits] core.git: avmedia/source
avmedia/source/gstreamer/gstplayer.cxx| 13 +++-- avmedia/source/viewer/mediaevent_impl.cxx | 12 ++-- avmedia/source/viewer/mediaevent_impl.hxx |4 +++- 3 files changed, 16 insertions(+), 13 deletions(-) New commits: commit 477fa6c3cb92f578032dee60482718efdb8f44f2 Author: Arnaud Versini AuthorDate: Sun Oct 24 16:49:50 2021 +0200 Commit: Noel Grandin CommitDate: Sun Jan 2 18:23:48 2022 +0100 avmedia : use std::mutex instead of osl::Mutex Change-Id: I0e779db4ef32ac74b9df18d1e162b49236b44b88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124122 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index f25ec5c6bb0c..b28be1678207 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -94,7 +95,7 @@ private: DECL_STATIC_LINK(MissingPluginInstaller, launchUi, void*, void); -osl::Mutex mutex_; +std::mutex mutex_; std::set reported_; std::map>> queued_; rtl::Reference currentThread_; @@ -106,7 +107,7 @@ private: MissingPluginInstaller::~MissingPluginInstaller() { -osl::MutexGuard g(mutex_); +std::unique_lock g(mutex_); SAL_WARN_IF(currentThread_.is(), "avmedia.gstreamer", "unjoined thread"); inCleanUp_ = true; } @@ -134,7 +135,7 @@ void MissingPluginInstaller::report( rtl::Reference join; rtl::Reference launch; { -osl::MutexGuard g(mutex_); +std::unique_lock g(mutex_); if (reported_.find(detStr) != reported_.end()) { return; } @@ -179,7 +180,7 @@ void eraseSource(std::set> & set, Player const * source) void MissingPluginInstaller::detach(Player const * source) { rtl::Reference join; { -osl::MutexGuard g(mutex_); +std::unique_lock g(mutex_); if (inCleanUp_) { // Guard against ~MissingPluginInstaller with erroneously un-joined // currentThread_ (thus non-empty currentSources_) calling @@ -251,7 +252,7 @@ void MissingPluginInstallerThread::execute() { for (;;) { std::vector details; { -osl::MutexGuard g(inst.mutex_); +std::unique_lock g(inst.mutex_); assert(!inst.currentDetails_.empty()); details.swap(inst.currentDetails_); } @@ -264,7 +265,7 @@ void MissingPluginInstallerThread::execute() { args.push_back(nullptr); gst_install_plugins_sync(args.data(), nullptr); { -osl::MutexGuard g(inst.mutex_); +std::unique_lock g(inst.mutex_); if (inst.queued_.empty() || inst.launchNewThread_) { inst.launchNewThread_ = true; break; diff --git a/avmedia/source/viewer/mediaevent_impl.cxx b/avmedia/source/viewer/mediaevent_impl.cxx index 62217f6d9473..d6a2c082c246 100644 --- a/avmedia/source/viewer/mediaevent_impl.cxx +++ b/avmedia/source/viewer/mediaevent_impl.cxx @@ -52,7 +52,7 @@ void SAL_CALL MediaEventListenersImpl::disposing( const css::lang::EventObject& void SAL_CALL MediaEventListenersImpl::keyPressed( const css::awt::KeyEvent& e ) { -const ::osl::MutexGuard aGuard( maMutex ); +const std::unique_lock aGuard( maMutex ); if( mpNotifyWindow ) { @@ -69,7 +69,7 @@ void SAL_CALL MediaEventListenersImpl::keyPressed( const css::awt::KeyEvent& e ) void SAL_CALL MediaEventListenersImpl::keyReleased( const css::awt::KeyEvent& e ) { -const ::osl::MutexGuard aGuard( maMutex ); +const std::unique_lock aGuard( maMutex ); if( mpNotifyWindow ) { @@ -85,7 +85,7 @@ void SAL_CALL MediaEventListenersImpl::keyReleased( const css::awt::KeyEvent& e void SAL_CALL MediaEventListenersImpl::mousePressed( const css::awt::MouseEvent& e ) { -const ::osl::MutexGuard aGuard( maMutex ); +const std::unique_lock aGuard( maMutex ); if( mpNotifyWindow ) { @@ -103,7 +103,7 @@ void SAL_CALL MediaEventListenersImpl::mousePressed( const css::awt::MouseEvent& void SAL_CALL MediaEventListenersImpl::mouseReleased( const css::awt::MouseEvent& e ) { -const ::osl::MutexGuard aGuard( maMutex ); +const std::unique_lock aGuard( maMutex ); const SolarMutexGuard aAppGuard; if( mpNotifyWindow ) @@ -132,7 +132,7 @@ void SAL_CALL MediaEventListenersImpl::mouseExited( const css::awt::MouseEvent& void SAL_CALL MediaEventListenersImpl::mouseDragged( const css::awt::MouseEvent& e ) { -const ::osl::MutexGuard aGuard( maMutex ); +const std::unique_lock aGuard( maMutex ); if( mpNotifyWindow ) { @@ -144,7 +144,7 @@ void SAL_CALL MediaEventListenersImpl::mouseDragged( const css::awt::MouseEvent& void SAL_CALL MediaEventListenersImpl::mouseMoved( const css::awt::MouseEvent& e ) { -const ::osl::MutexGu
[Libreoffice-commits] core.git: idl/source
idl/source/objects/types.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 335ecfee17f9971b431761e978ae3c89e742891c Author: Arnaud VERSINI AuthorDate: Fri Dec 31 18:40:44 2021 +0100 Commit: Arnaud Versini CommitDate: Sat Jan 1 18:48:07 2022 +0100 idl : use delegating constructor Change-Id: Ic3a23dfc1278a9f34d0b7a441d604903eadc2a8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127818 Reviewed-by: Mike Kaganski Tested-by: Jenkins diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx index a3dde07d96a7..08492b4b6ddb 100644 --- a/idl/source/objects/types.cxx +++ b/idl/source/objects/types.cxx @@ -126,8 +126,7 @@ SvMetaType::SvMetaType() } SvMetaType::SvMetaType( const OString& rName ) -: nType( MetaTypeType::Base ) -, bIsItem( false ) +: SvMetaType() { SetName( rName ); }
[Libreoffice-commits] core.git: idl/source
idl/source/objects/types.cxx | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) New commits: commit 7a6fb939053f0c4f5c3e653fe4b21bc2d904d7dc Author: Arnaud VERSINI AuthorDate: Fri Dec 24 20:23:28 2021 +0100 Commit: Mike Kaganski CommitDate: Sat Dec 25 08:32:26 2021 +0100 idl : remove useless define and copy the code directly ! Change-Id: I92d53beb110a44624b72f7ec76ab8d1089f9caf0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127438 Reviewed-by: Noel Grandin Reviewed-by: Mike Kaganski Tested-by: Mike Kaganski diff --git a/idl/source/objects/types.cxx b/idl/source/objects/types.cxx index 46262e7b98d9..a3dde07d96a7 100644 --- a/idl/source/objects/types.cxx +++ b/idl/source/objects/types.cxx @@ -119,17 +119,15 @@ void SvMetaAttribute::Insert(SvSlotElementList&) { } -#define CTOR\ -: nType( MetaTypeType::Base ) \ -, bIsItem( false ) \ - SvMetaType::SvMetaType() -CTOR +: nType( MetaTypeType::Base ) +, bIsItem( false ) { } SvMetaType::SvMetaType( const OString& rName ) -CTOR +: nType( MetaTypeType::Base ) +, bIsItem( false ) { SetName( rName ); }
[Libreoffice-commits] core.git: bridges/source
bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 82807f810b3300111820e9b2fa9a82e3e35a313a Author: Arnaud VERSINI AuthorDate: Sun Dec 19 12:34:40 2021 +0100 Commit: Noel Grandin CommitDate: Fri Dec 24 14:53:13 2021 +0100 bridges : remove redundant public Change-Id: I836412674448acb2a047d3d8b4711fa8d0b67257 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127410 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx index 242e2a476e23..206446a81d0c 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx @@ -57,7 +57,6 @@ private: }; class GeneratedPad: public Generated { -public: public: GeneratedPad(std::unique_ptr && pad): pad_(std::move(pad)) {};
[Libreoffice-commits] core.git: bridges/source
bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 587c530d13a5427ea6610d68d3db3fde27f50725 Author: Arnaud VERSINI AuthorDate: Sun Dec 19 12:34:40 2021 +0100 Commit: Stephan Bergmann CommitDate: Mon Dec 20 14:14:44 2021 +0100 bridges : use std mutex instead of osl::Mutex. The lock_guard moved from RTTI::GetRTTI to x86_64::getRtti to avoid recursive lock. Change-Id: I0e71581dd57a4fb2655d4b9040fb9d943f73ab9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127095 Reviewed-by: Stephan Bergmann Tested-by: Jenkins diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx index 6e022515b2d7..242e2a476e23 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -28,7 +29,6 @@ #include -#include #include #include #include @@ -74,7 +74,6 @@ class RTTI { typedef std::unordered_map< OUString, std::type_info * > t_rtti_map; -osl::Mutex m_mutex; t_rtti_map m_rttis; std::vector m_rttiNames; std::unordered_map> m_generatedRttis; @@ -108,7 +107,6 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription const & pTypeDescr) { OUString const & unoName = OUString::unacquired(&pTypeDescr.pTypeName); -osl::MutexGuard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind != m_rttis.end()) return iFind->second; @@ -268,6 +266,8 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription const & pTypeDescr) std::type_info * x86_64::getRtti(typelib_TypeDescription const & type) { static RTTI theRttiFactory; +static std::mutex theMutex; +std::lock_guard aGuard(theMutex); return theRttiFactory.getRTTI(type); }
[Libreoffice-commits] core.git: comphelper/source include/comphelper
comphelper/source/misc/numberedcollection.cxx | 54 +++--- include/comphelper/numberedcollection.hxx |8 ++- 2 files changed, 29 insertions(+), 33 deletions(-) New commits: commit ab4ee55a2a03ce93debcda41d817a95517a711f0 Author: Arnaud Versini AuthorDate: Sun Oct 24 19:44:12 2021 +0200 Commit: Noel Grandin CommitDate: Thu Dec 16 16:51:30 2021 +0100 comphelper : use std::mutex in numberedcollection Change-Id: Ifd8b1668ceac69f5393a279ffb19070655149e65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124126 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/comphelper/source/misc/numberedcollection.cxx b/comphelper/source/misc/numberedcollection.cxx index 0a771a333251..efadf0fd5a6d 100644 --- a/comphelper/source/misc/numberedcollection.cxx +++ b/comphelper/source/misc/numberedcollection.cxx @@ -28,7 +28,6 @@ constexpr OUStringLiteral ERRMSG_INVALID_COMPONENT_PARAM = u"NULL as component r NumberedCollection::NumberedCollection() -: ::cppu::BaseMutex () { } @@ -41,7 +40,7 @@ NumberedCollection::~NumberedCollection() void NumberedCollection::setOwner(const css::uno::Reference< css::uno::XInterface >& xOwner) { // SYNCHRONIZED -> -osl::MutexGuard aLock(m_aMutex); +std::scoped_lock aLock(m_aMutex); m_xOwner = xOwner; @@ -52,7 +51,7 @@ void NumberedCollection::setOwner(const css::uno::Reference< css::uno::XInterfac void NumberedCollection::setUntitledPrefix(const OUString& sPrefix) { // SYNCHRONIZED -> -osl::MutexGuard aLock(m_aMutex); +std::scoped_lock aLock(m_aMutex); m_sUntitledPrefix = sPrefix; @@ -63,7 +62,7 @@ void NumberedCollection::setUntitledPrefix(const OUString& sPrefix) ::sal_Int32 SAL_CALL NumberedCollection::leaseNumber(const css::uno::Reference< css::uno::XInterface >& xComponent) { // SYNCHRONIZED -> -osl::MutexGuard aLock(m_aMutex); +std::scoped_lock aLock(m_aMutex); if ( ! xComponent.is ()) throw css::lang::IllegalArgumentException(ERRMSG_INVALID_COMPONENT_PARAM, m_xOwner.get(), 1); @@ -98,7 +97,7 @@ void NumberedCollection::setUntitledPrefix(const OUString& sPrefix) void SAL_CALL NumberedCollection::releaseNumber(::sal_Int32 nNumber) { // SYNCHRONIZED -> -osl::MutexGuard aLock(m_aMutex); +std::scoped_lock aLock(m_aMutex); if (nNumber == css::frame::UntitledNumbersConst::INVALID_NUMBER) throw css::lang::IllegalArgumentException ("Special valkud INVALID_NUMBER not allowed as input parameter.", m_xOwner.get(), 1); @@ -135,7 +134,7 @@ void SAL_CALL NumberedCollection::releaseNumber(::sal_Int32 nNumber) void SAL_CALL NumberedCollection::releaseNumberForComponent(const css::uno::Reference< css::uno::XInterface >& xComponent) { // SYNCHRONIZED -> -osl::MutexGuard aLock(m_aMutex); +std::scoped_lock aLock(m_aMutex); if ( ! xComponent.is ()) throw css::lang::IllegalArgumentException(ERRMSG_INVALID_COMPONENT_PARAM, m_xOwner.get(), 1); @@ -157,7 +156,7 @@ void SAL_CALL NumberedCollection::releaseNumberForComponent(const css::uno::Refe OUString SAL_CALL NumberedCollection::getUntitledPrefix() { // SYNCHRONIZED -> -osl::MutexGuard aLock(m_aMutex); +std::scoped_lock aLock(m_aMutex); return m_sUntitledPrefix; @@ -191,36 +190,31 @@ OUString SAL_CALL NumberedCollection::getUntitledPrefix() for (i=1; i<=c; ++i) lPossibleNumbers.push_back (i); -// SYNCHRONIZED -> +TDeadItemList lDeadItems; + +for (const auto& [rComponent, rItem] : m_lComponents) { -osl::MutexGuard aLock(m_aMutex); -TDeadItemList lDeadItems; +const css::uno::Reference< css::uno::XInterface > xItem = rItem.xItem.get(); -for (const auto& [rComponent, rItem] : m_lComponents) +if ( ! xItem.is ()) { -const css::uno::Reference< css::uno::XInterface > xItem = rItem.xItem.get(); - -if ( ! xItem.is ()) -{ -lDeadItems.push_back(rComponent); -continue; -} - -std::vector< ::sal_Int32 >::iterator pPossible = std::find(lPossibleNumbers.begin (), lPossibleNumbers.end (), rItem.nNumber); -if (pPossible != lPossibleNumbers.end ()) -lPossibleNumbers.erase (pPossible); +lDeadItems.push_back(rComponent); +continue; } -impl_cleanUpDeadItems(m_lComponents, lDeadItems); +std::vector< ::sal_Int32 >::iterator pPossible = std::find(lPossibleNumbers.begin (), lPossibleNumbers.end (), rItem.nNumber); +if (pPossible != lPossibleNumbers.end ()) +lPossibleNumbers.erase (pPossible); +} -// a) non free numbers ... return INVALID_NUMBER -if (lPossibleNumbers.empty()) -return css::frame::UntitledNumbersConst::INVALID_NUMBER; +impl_cleanUpDeadItems(m_lComponents, lD
[Libreoffice-commits] core.git: comphelper/source include/comphelper
comphelper/source/container/enumhelper.cxx | 28 include/comphelper/enumhelper.hxx | 23 ++- 2 files changed, 22 insertions(+), 29 deletions(-) New commits: commit b439832fc36a05e4423f480f7a312428f2449cc6 Author: Arnaud Versini AuthorDate: Sun Oct 24 19:41:36 2021 +0200 Commit: Noel Grandin CommitDate: Thu Nov 4 20:23:25 2021 +0100 comphelper : use std::mutex in enumhelper Change-Id: I871c406e8ff94e646545cb82e0d1e2e2ec80c6e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124125 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/comphelper/source/container/enumhelper.cxx b/comphelper/source/container/enumhelper.cxx index edcb03c669cc..2487d3adf234 100644 --- a/comphelper/source/container/enumhelper.cxx +++ b/comphelper/source/container/enumhelper.cxx @@ -48,13 +48,15 @@ OEnumerationByName::OEnumerationByName(const css::uno::Reference m_nPos) return true; @@ -71,7 +73,7 @@ sal_Bool SAL_CALL OEnumerationByName::hasMoreElements( ) css::uno::Any SAL_CALL OEnumerationByName::nextElement( ) { -osl::MutexGuard aLock(m_aLock); +std::lock_guard aLock(m_aLock); css::uno::Any aRes; if (m_xAccess.is() && m_nPos < m_aNames.getLength()) @@ -92,7 +94,7 @@ css::uno::Any SAL_CALL OEnumerationByName::nextElement( ) void SAL_CALL OEnumerationByName::disposing(const css::lang::EventObject& aEvent) { -osl::MutexGuard aLock(m_aLock); +std::lock_guard aLock(m_aLock); if (aEvent.Source == m_xAccess) m_xAccess.clear(); @@ -101,8 +103,6 @@ void SAL_CALL OEnumerationByName::disposing(const css::lang::EventObject& aEvent void OEnumerationByName::impl_startDisposeListening() { -osl::MutexGuard aLock(m_aLock); - if (m_bListening) return; @@ -119,8 +119,6 @@ void OEnumerationByName::impl_startDisposeListening() void OEnumerationByName::impl_stopDisposeListening() { -osl::MutexGuard aLock(m_aLock); - if (!m_bListening) return; @@ -145,13 +143,15 @@ OEnumerationByIndex::OEnumerationByIndex(const css::uno::Reference< css::contain OEnumerationByIndex::~OEnumerationByIndex() { +std::lock_guard aLock(m_aLock); + impl_stopDisposeListening(); } sal_Bool SAL_CALL OEnumerationByIndex::hasMoreElements( ) { -osl::MutexGuard aLock(m_aLock); +std::lock_guard aLock(m_aLock); if (m_xAccess.is() && m_xAccess->getCount() > m_nPos) return true; @@ -168,7 +168,7 @@ sal_Bool SAL_CALL OEnumerationByIndex::hasMoreElements( ) css::uno::Any SAL_CALL OEnumerationByIndex::nextElement( ) { -osl::MutexGuard aLock(m_aLock); +std::lock_guard aLock(m_aLock); css::uno::Any aRes; if (m_xAccess.is() && m_nPos < m_xAccess->getCount()) @@ -188,7 +188,7 @@ css::uno::Any SAL_CALL OEnumerationByIndex::nextElement( ) void SAL_CALL OEnumerationByIndex::disposing(const css::lang::EventObject& aEvent) { -osl::MutexGuard aLock(m_aLock); +std::lock_guard aLock(m_aLock); if (aEvent.Source == m_xAccess) m_xAccess.clear(); @@ -197,8 +197,6 @@ void SAL_CALL OEnumerationByIndex::disposing(const css::lang::EventObject& aEven void OEnumerationByIndex::impl_startDisposeListening() { -osl::MutexGuard aLock(m_aLock); - if (m_bListening) return; @@ -215,8 +213,6 @@ void OEnumerationByIndex::impl_startDisposeListening() void OEnumerationByIndex::impl_stopDisposeListening() { -osl::MutexGuard aLock(m_aLock); - if (!m_bListening) return; @@ -244,7 +240,7 @@ OAnyEnumeration::~OAnyEnumeration() sal_Bool SAL_CALL OAnyEnumeration::hasMoreElements( ) { -osl::MutexGuard aLock(m_aLock); +std::lock_guard aLock(m_aLock); return (m_lItems.getLength() > m_nPos); } @@ -255,7 +251,7 @@ css::uno::Any SAL_CALL OAnyEnumeration::nextElement( ) if ( ! hasMoreElements()) throw css::container::NoSuchElementException(); -osl::MutexGuard aLock(m_aLock); +std::lock_guard aLock(m_aLock); sal_Int32 nPos = m_nPos; ++m_nPos; return m_lItems[nPos]; diff --git a/include/comphelper/enumhelper.hxx b/include/comphelper/enumhelper.hxx index 5e5e000d78df..52f3aa743ade 100644 --- a/include/comphelper/enumhelper.hxx +++ b/include/comphelper/enumhelper.hxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include namespace com::sun::star::container { class XIndexAccess; } @@ -32,23 +32,18 @@ namespace com::sun::star::container { class XNameAccess; } namespace comphelper { -struct OEnumerationLock -{ -public: -::osl::Mutex m_aLock; -}; - /** provides a com.sun.star.container::XEnumeration access based on an object implementing the com.sun.star.container::XNameAccess interface */ -class COMPHELPER_DLLPUBLIC OEnumerationByName final : private OEnumerationLock - , public ::cppu::WeakImplHelper< css::container::XEnumeration ,
[Libreoffice-commits] core.git: salhelper/source
salhelper/source/timer.cxx | 121 + 1 file changed, 36 insertions(+), 85 deletions(-) New commits: commit e0b04e19bd71ce00f81b111399dad3b9da79e224 Author: Arnaud Versini AuthorDate: Sun Oct 17 21:19:13 2021 +0200 Commit: Noel Grandin CommitDate: Mon Oct 18 08:41:48 2021 +0200 salhelper : simplify salhelper::TimerManager initalization and use std::mutex Change-Id: I48c59e267683e081ef45049b280eb38ce231a39c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123723 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/salhelper/source/timer.cxx b/salhelper/source/timer.cxx index 8101b23875fb..999eaa80abbd 100644 --- a/salhelper/source/timer.cxx +++ b/salhelper/source/timer.cxx @@ -23,6 +23,8 @@ #include #include +#include + using namespace salhelper; class salhelper::TimerManager : public osl::Thread @@ -30,8 +32,6 @@ class salhelper::TimerManager : public osl::Thread public: TimerManager(); -virtual ~TimerManager() override; - /// register timer void registerTimer(salhelper::Timer* pTimer); @@ -41,9 +41,6 @@ public: /// lookup timer bool lookupTimer(const salhelper::Timer* pTimer); -/// retrieves the "Singleton" TimerManager Instance -static TimerManager* getTimerManager(); - protected: /// worker-function of thread virtual void SAL_CALL run() override; @@ -51,21 +48,28 @@ protected: /// Checking and triggering of a timer event void checkForTimeout(); -/// cleanup Method -virtual void SAL_CALL onTerminated() override; - /// sorted-queue data salhelper::Timer* m_pHead; /// List Protection -osl::Mutex m_Lock; +std::mutex m_Lock; /// Signal the insertion of a timer osl::Condition m_notEmpty; /// "Singleton Pattern" -static salhelper::TimerManager* m_pManager; +//static salhelper::TimerManager* m_pManager; }; +namespace +{ +salhelper::TimerManager& getTimerManager() +{ +static salhelper::TimerManager aManager; +return aManager; +} +} + + Timer::Timer() : m_aTimeOut(0), m_aExpired(0), @@ -102,29 +106,18 @@ void Timer::start() if (!m_aTimeOut.isEmpty()) setRemainingTime(m_aTimeOut); -TimerManager *pManager = TimerManager::getTimerManager(); - -if (pManager) -pManager->registerTimer(this); +getTimerManager().registerTimer(this); } } void Timer::stop() { -TimerManager *pManager = TimerManager::getTimerManager(); - -if (pManager) -pManager->unregisterTimer(this); +getTimerManager().unregisterTimer(this); } sal_Bool Timer::isTicking() const { -TimerManager *pManager = TimerManager::getTimerManager(); - -if (pManager) -return pManager->lookupTimer(this); -else -return false; +return getTimerManager().lookupTimer(this); } sal_Bool Timer::isExpired() const @@ -201,14 +194,6 @@ TTimeValue Timer::getRemainingTime() const return TTimeValue(secs, nsecs); } -namespace -{ -// Synchronize access to TimerManager -struct theTimerManagerMutex : public rtl::Static< osl::Mutex, theTimerManagerMutex> {}; -} - -TimerManager* salhelper::TimerManager::m_pManager = nullptr; - /** The timer manager cleanup has been removed (no thread is killed anymore), so the thread leaks. @@ -219,49 +204,21 @@ TimerManager* salhelper::TimerManager::m_pManager = nullptr; when there are no timers anymore ! **/ -TimerManager::TimerManager() +TimerManager::TimerManager() : +m_pHead(nullptr) { -osl::MutexGuard Guard(theTimerManagerMutex::get()); - -assert(m_pManager == nullptr); - -m_pManager = this; -m_pHead= nullptr; m_notEmpty.reset(); // start thread create(); } -TimerManager::~TimerManager() -{ -osl::MutexGuard Guard(theTimerManagerMutex::get()); - -if (m_pManager == this) -m_pManager = nullptr; -} - -void TimerManager::onTerminated() -{ -delete this; // FIXME -} - -TimerManager* TimerManager::getTimerManager() -{ -osl::MutexGuard Guard(theTimerManagerMutex::get()); - -if (! m_pManager) -new TimerManager; - -return m_pManager; -} - void TimerManager::registerTimer(Timer* pTimer) { if (!pTimer) return; -osl::MutexGuard Guard(m_Lock); +std::lock_guard Guard(m_Lock); // try to find one with equal or lower remaining time. Timer** ppIter = &m_pHead; @@ -297,7 +254,7 @@ void TimerManager::unregisterTimer(Timer const * pTimer) return; // lock access -osl::MutexGuard Guard(m_Lock); +std::lock_guard Guard(m_Lock); Timer** ppIter = &m_pHead; @@ -319,7 +276,7 @@ bool TimerManager::lookupTimer(const Timer* pTimer) return false; // lock access -osl::MutexGuard Guard(m_Lock); +std::lock_guard Guard(m_Lock);
[Libreoffice-commits] core.git: basic/source
basic/source/comp/parser.cxx | 23 +++ basic/source/runtime/runtime.cxx |4 ++-- 2 files changed, 13 insertions(+), 14 deletions(-) New commits: commit 0f98bcdf4d47193fa0fe38a5fc04218bdbb7d886 Author: Arnaud Versini AuthorDate: Sat Oct 9 20:54:09 2021 +0200 Commit: Arnaud Versini CommitDate: Sun Oct 17 21:25:44 2021 +0200 basic: simplifiy class initialization Change-Id: I87fa2f606011aab8e34d9445d9e9299786f05747 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123324 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index dc0b3b16b348..777db4071615 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -115,24 +115,23 @@ const SbiStatement StmntTable [] = { { NIL, nullptr, N, N } }; - SbiParser::SbiParser( StarBASIC* pb, SbModule* pm ) : SbiTokenizer( pm->GetSource32(), pb ), + pStack(nullptr), + pProc(nullptr), + pWithVar(nullptr), + eEndTok(NIL), + bGblDefs(false), + bNewGblDefs(false), + bSingleLineIf(false), + bCodeCompleting(false), aGlobals( aGblStrings, SbGLOBAL, this ), aPublics( aGblStrings, SbPUBLIC, this ), aRtlSyms( aGblStrings, SbRTL, this ), - aGen( *pm, this ) + aGen( *pm, this ), + nBase(0), + bExplicit(false) { -eEndTok = NIL; -pProc= nullptr; -pStack = nullptr; -pWithVar = nullptr; -nBase= 0; -bGblDefs = -bNewGblDefs = -bSingleLineIf = -bCodeCompleting = -bExplicit = false; bClassModule = ( pm->GetModuleType() == css::script::ModuleType::CLASS ); pPool= &aPublics; for(SbxDataType & eDefType : eDefTypes) diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 5c27b84223f7..2d7b988d7647 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -290,9 +290,9 @@ const SbiRuntime::pStep2 SbiRuntime::aStep2[] = {// all opcodes with two operand // SbiRTLData SbiRTLData::SbiRTLData() +: nDirFlags(SbAttributes::NONE) +, nCurDirPos(0) { -nDirFlags = SbAttributes::NONE; -nCurDirPos = 0; } SbiRTLData::~SbiRTLData()
[Libreoffice-commits] core.git: sal/osl
sal/osl/all/debugbase.cxx |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) New commits: commit 96726f4a7f2f23972c987e9a4be75539f24fb0b7 Author: Arnaud Versini AuthorDate: Sat Oct 9 20:45:49 2021 +0200 Commit: Noel Grandin CommitDate: Sun Oct 10 19:46:36 2021 +0200 OSL : remove useless rtl::Static in debugbase Change-Id: I54ef4d1b492409265496c7f2b852568274bcf073 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123321 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx index 209dc55e1e32..208fa3e92a92 100644 --- a/sal/osl/all/debugbase.cxx +++ b/sal/osl/all/debugbase.cxx @@ -56,8 +56,6 @@ bool isSubStr( char const* pStr, OString const& subStr ) return rtl_str_indexOfStr( pStr, subStr.getStr() ) >= 0; } -struct DebugBaseMutex : rtl::Static {}; - } // anon namespace extern "C" { @@ -72,7 +70,8 @@ extern "C" { osl::Mutex & SAL_CALL osl_detail_ObjectRegistry_getMutex() SAL_THROW_EXTERN_C() { -return DebugBaseMutex::get(); +static osl::Mutex aMutex; +return aMutex; } #ifdef __clang__ #pragma clang diagnostic pop
[Libreoffice-commits] core.git: sal/osl
sal/osl/unx/backtraceapi.cxx |9 + 1 file changed, 5 insertions(+), 4 deletions(-) New commits: commit 82bc337c979f6d74cb08d0332b44f26b155f9554 Author: Arnaud Versini AuthorDate: Sat Oct 9 20:51:27 2021 +0200 Commit: Noel Grandin CommitDate: Sun Oct 10 14:43:21 2021 +0200 OSL : use std::mutex in backtraceapi Change-Id: I2df73d7959dd24882f75130f0fd03ff096dce8d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123322 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sal/osl/unx/backtraceapi.cxx b/sal/osl/unx/backtraceapi.cxx index 79fa3adf7296..e98d8d663f39 100644 --- a/sal/osl/unx/backtraceapi.cxx +++ b/sal/osl/unx/backtraceapi.cxx @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -68,7 +69,7 @@ struct FrameData }; typedef o3tl::lru_map FrameCache; -osl::Mutex frameCacheMutex; +std::mutex frameCacheMutex; FrameCache frameCache( 256 ); void process_file_addr2line( const char* file, std::vector& frameData ) @@ -164,7 +165,7 @@ void process_file_addr2line( const char* file, std::vector& frameData frame.info = function + " in " + file; else frame.info = function + " at " + source; -osl::MutexGuard guard(frameCacheMutex); +std::lock_guard guard(frameCacheMutex); frameCache.insert( { frame.addr, frame.info } ); } } @@ -183,9 +184,9 @@ OUString sal::backtrace_to_string(BacktraceState* backtraceState) { Dl_info dli; void* addr = backtraceState->buffer[i]; -osl::ClearableMutexGuard guard(frameCacheMutex); +std::unique_lock guard(frameCacheMutex); auto it = frameCache.find(addr); -guard.clear(); +guard.release(); if( it != frameCache.end()) { frameData[ i ].info = it->second;
[Libreoffice-commits] core.git: basic/source include/basic
basic/source/basmgr/basmgr.cxx | 107 - include/basic/basmgr.hxx | 11 ++-- 2 files changed, 49 insertions(+), 69 deletions(-) New commits: commit 34cba9eefa710b053da817dd2642d2376691824e Author: Arnaud Versini AuthorDate: Sun Aug 22 14:48:38 2021 +0200 Commit: Noel Grandin CommitDate: Sun Aug 29 08:52:48 2021 +0200 basic : remove BasicManagerImpl Change-Id: Ia2b2c5fdf7d61e0853f181a38840c5ae263f5c9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105141 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 1cbd407f2171..03fe6ef6597c 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -95,19 +95,6 @@ constexpr OStringLiteral szCryptingKey = "CryptedBasic"; const StreamMode eStreamReadMode = StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL; const StreamMode eStorageReadMode = StreamMode::READ | StreamMode::SHARE_DENYWRITE; - -// BasicManager impl data -struct BasicManagerImpl -{ -LibraryContainerInfomaContainerInfo; - -std::vector> aLibs; -OUString aBasicLibPath; - -BasicManagerImpl() -{} -}; - // BasMgrContainerListenerImpl @@ -435,11 +422,9 @@ BasicLibInfo* BasicLibInfo::Create( SotStorageStream& rSStream ) BasicManager::BasicManager( SotStorage& rStorage, const OUString& rBaseURL, StarBASIC* pParentFromStdLib, OUString const * pLibPath, bool bDocMgr ) : mbDocMgr( bDocMgr ) { -Init(); - if( pLibPath ) { -mpImpl->aBasicLibPath = *pLibPath; +aBasicLibPath = *pLibPath; } OUString aStorName( rStorage.GetName() ); maStorageName = INetURLObject(aStorName, INetProtocol::File).GetMainURL( INetURLObject::DecodeMechanism::NONE ); @@ -457,10 +442,10 @@ BasicManager::BasicManager( SotStorage& rStorage, const OUString& rBaseURL, Star // Should never happen, but if it happens we won't crash... pStdLib = new StarBASIC( nullptr, mbDocMgr ); -if (mpImpl->aLibs.empty()) +if (maLibs.empty()) CreateLibInfo(); -BasicLibInfo& rStdLibInfo = *mpImpl->aLibs.front(); +BasicLibInfo& rStdLibInfo = *maLibs.front(); rStdLibInfo.SetLib( pStdLib ); StarBASICRef xStdLib = rStdLibInfo.GetLib(); @@ -526,19 +511,19 @@ static void copyToLibraryContainer( StarBASIC* pBasic, const LibraryContainerInf const uno::Reference< script::XPersistentLibraryContainer >& BasicManager::GetDialogLibraryContainer() const { -return mpImpl->maContainerInfo.mxDialogCont; +return maContainerInfo.mxDialogCont; } const uno::Reference< script::XPersistentLibraryContainer >& BasicManager::GetScriptLibraryContainer() const { -return mpImpl->maContainerInfo.mxScriptCont; +return maContainerInfo.mxScriptCont; } void BasicManager::SetLibraryContainerInfo( const LibraryContainerInfo& rInfo ) { -mpImpl->maContainerInfo = rInfo; +maContainerInfo = rInfo; -uno::Reference< script::XLibraryContainer > xScriptCont( mpImpl->maContainerInfo.mxScriptCont ); +uno::Reference< script::XLibraryContainer > xScriptCont( maContainerInfo.mxScriptCont ); if( xScriptCont.is() ) { // Register listener for lib container @@ -566,7 +551,7 @@ void BasicManager::SetLibraryContainerInfo( const LibraryContainerInfo& rInfo ) else { // No libs? Maybe an 5.2 document already loaded -for (auto const& rpBasLibInfo : mpImpl->aLibs) +for (auto const& rpBasLibInfo : maLibs) { StarBASIC* pLib = rpBasLibInfo->GetLib().get(); if( !pLib ) @@ -577,11 +562,11 @@ void BasicManager::SetLibraryContainerInfo( const LibraryContainerInfo& rInfo ) } if( pLib ) { -copyToLibraryContainer( pLib, mpImpl->maContainerInfo ); +copyToLibraryContainer( pLib, maContainerInfo ); if (rpBasLibInfo->HasPassword()) { OldBasicPassword* pOldBasicPassword = -mpImpl->maContainerInfo.mpOldBasicPassword; +maContainerInfo.mpOldBasicPassword; if( pOldBasicPassword ) { pOldBasicPassword->setLibraryPassword( @@ -593,18 +578,17 @@ void BasicManager::SetLibraryContainerInfo( const LibraryContainerInfo& rInfo ) } } -SetGlobalUNOConstant( "BasicLibraries", uno::Any( mpImpl->maContainerInfo.mxScriptCont ) ); -SetGlobalUNOConstant( "DialogLibraries", uno::Any( mpImpl->maContainerInfo.mxDialogCont ) ); +SetGlobalUNOConstant( "BasicLibraries", uno::Any( maContainerInfo.mxScriptCont ) ); +SetGlobalUNOConstant( "DialogLibrar
[Libreoffice-commits] core.git: comphelper/source include/comphelper
comphelper/source/misc/accessiblecontexthelper.cxx | 63 + include/comphelper/accessiblecontexthelper.hxx |6 +- 2 files changed, 19 insertions(+), 50 deletions(-) New commits: commit 0ce90e21f11048d366b58e760b60aabf2eaa Author: Arnaud Versini AuthorDate: Sun Aug 22 14:24:38 2021 +0200 Commit: Noel Grandin CommitDate: Mon Aug 23 21:54:40 2021 +0200 comphelper : remove useless OContextHelper_Impl Change-Id: I41fc571695a64b432d6abf4979b99ef141a12b28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120842 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/comphelper/source/misc/accessiblecontexthelper.cxx b/comphelper/source/misc/accessiblecontexthelper.cxx index a4d11cb59c1a..ad2c63b1a1c0 100644 --- a/comphelper/source/misc/accessiblecontexthelper.cxx +++ b/comphelper/source/misc/accessiblecontexthelper.cxx @@ -31,40 +31,9 @@ namespace comphelper using namespace ::com::sun::star::lang; using namespace ::com::sun::star::accessibility; -/** implementation class for OAccessibleContextHelper. No own thread safety! -*/ -class OContextHelper_Impl -{ -private: -WeakReference< XAccessible >m_aCreator; // the XAccessible which created our XAccessibleContext - -AccessibleEventNotifier::TClientId m_nClientId; - -public: -Reference< XAccessible >getCreator( ) const { return m_aCreator; } -inline voidsetCreator( const Reference< XAccessible >& _rAcc ); - -AccessibleEventNotifier::TClientId -getClientId() const { return m_nClientId; } -voidsetClientId( const AccessibleEventNotifier::TClientId _nId ) - { m_nClientId = _nId; } - -public: -OContextHelper_Impl() -:m_nClientId( 0 ) -{ -} -}; - - -inline void OContextHelper_Impl::setCreator( const Reference< XAccessible >& _rAcc ) -{ -m_aCreator = _rAcc; -} - OAccessibleContextHelper::OAccessibleContextHelper( ) :OAccessibleContextHelper_Base( GetMutex() ) -,m_pImpl(new OContextHelper_Impl) +,m_nClientId( 0 ) { } @@ -84,10 +53,10 @@ namespace comphelper // do not lock m_Mutex because it may cause deadlock osl::Guard aGuard(SolarMutex::get()); -if ( m_pImpl->getClientId( ) ) +if ( m_nClientId ) { -AccessibleEventNotifier::revokeClientNotifyDisposing( m_pImpl->getClientId( ), *this ); -m_pImpl->setClientId( 0 ); +AccessibleEventNotifier::revokeClientNotifyDisposing( m_nClientId, *this ); +m_nClientId=0; } } @@ -107,10 +76,10 @@ namespace comphelper if ( _rxListener.is() ) { -if ( !m_pImpl->getClientId( ) ) -m_pImpl->setClientId( AccessibleEventNotifier::registerClient( ) ); +if ( !m_nClientId ) +m_nClientId = AccessibleEventNotifier::registerClient( ); -AccessibleEventNotifier::addEventListener( m_pImpl->getClientId( ), _rxListener ); +AccessibleEventNotifier::addEventListener( m_nClientId, _rxListener ); } } @@ -124,18 +93,18 @@ namespace comphelper if ( !isAlive() ) return; -if ( !(_rxListener.is() && m_pImpl->getClientId()) ) +if ( !(_rxListener.is() && m_nClientId) ) return; -sal_Int32 nListenerCount = AccessibleEventNotifier::removeEventListener( m_pImpl->getClientId( ), _rxListener ); +sal_Int32 nListenerCount = AccessibleEventNotifier::removeEventListener( m_nClientId, _rxListener ); if ( !nListenerCount ) { // no listeners anymore // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client), // and at least to us not firing any events anymore, in case somebody calls // NotifyAccessibleEvent, again -AccessibleEventNotifier::revokeClient( m_pImpl->getClientId( ) ); -m_pImpl->setClientId( 0 ); +AccessibleEventNotifier::revokeClient( m_nClientId ); +m_nClientId = 0; } } @@ -143,7 +112,7 @@ namespace comphelper void OAccessibleContextHelper::NotifyAccessibleEvent( const sal_Int16 _nEventId, const Any& _rOldValue, const Any& _rNewValue ) { -if ( !m_pImpl->getClientId( ) ) +if ( !m_nClientId ) // if we don't have a client id for the notifier, then we don't have listeners, then // we don't need to notify anything return; @@ -156,7 +125,7 @@ namespace comphelper aEvent.NewValue = _rNewValue; // let the notifier handle th
[Libreoffice-commits] core.git: cpputools/source
cpputools/source/unoexe/unoexe.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 057191fb50ea2ae9cca42ef84329581094047db8 Author: Arnaud Versini AuthorDate: Sun Jul 18 18:04:44 2021 +0200 Commit: Noel Grandin CommitDate: Mon Jul 26 13:45:34 2021 +0200 cpputools : no need to use fprintf for putting a string Change-Id: Icb7f0930713d7c9fe2553913dbdc5e36617f856a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119128 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx index add2d0e4a192..2181e850d7fe 100644 --- a/cpputools/source/unoexe/unoexe.cxx +++ b/cpputools/source/unoexe/unoexe.cxx @@ -67,7 +67,7 @@ static bool s_quiet = false; static void out( const char * pText ) { if (! s_quiet) -fprintf( stderr, "%s", pText ); +fputs( pText, stderr ); } static void out( std::u16string_view rText ) @@ -75,7 +75,7 @@ static void out( std::u16string_view rText ) if (! s_quiet) { OString aText( OUStringToOString( rText, RTL_TEXTENCODING_ASCII_US ) ); -fprintf( stderr, "%s", aText.getStr() ); +fputs( aText.getStr(), stderr ); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: binaryurp/source
binaryurp/source/outgoingrequests.cxx |7 +++ binaryurp/source/outgoingrequests.hxx |5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) New commits: commit 3785f97ec18feba9c5508559e5aed6d25cfc3aed Author: Arnaud Versini AuthorDate: Sun Jul 18 10:11:45 2021 +0200 Commit: Noel Grandin CommitDate: Sun Jul 18 11:37:21 2021 +0200 binaryurp : use std::mutex in outgoingrequests Change-Id: Ib0670af4596c5a40da27138d62b78df69bb77b9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119121 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/binaryurp/source/outgoingrequests.cxx b/binaryurp/source/outgoingrequests.cxx index 859aa8b9270d..ed15e5a1bda8 100644 --- a/binaryurp/source/outgoingrequests.cxx +++ b/binaryurp/source/outgoingrequests.cxx @@ -23,7 +23,6 @@ #include #include -#include #include "lessoperators.hxx" #include "outgoingrequest.hxx" @@ -38,12 +37,12 @@ OutgoingRequests::~OutgoingRequests() {} void OutgoingRequests::push( rtl::ByteSequence const & tid, OutgoingRequest const & request) { -osl::MutexGuard g(mutex_); +std::lock_guard g(mutex_); map_[tid].push_back(request); } OutgoingRequest OutgoingRequests::top(rtl::ByteSequence const & tid) { -osl::MutexGuard g(mutex_); +std::lock_guard g(mutex_); Map::iterator i(map_.find(tid)); if (i == map_.end()) { throw css::uno::RuntimeException( @@ -54,7 +53,7 @@ OutgoingRequest OutgoingRequests::top(rtl::ByteSequence const & tid) { } void OutgoingRequests::pop(rtl::ByteSequence const & tid) noexcept { -osl::MutexGuard g(mutex_); +std::lock_guard g(mutex_); Map::iterator i(map_.find(tid)); assert(i != map_.end()); i->second.pop_back(); diff --git a/binaryurp/source/outgoingrequests.hxx b/binaryurp/source/outgoingrequests.hxx index 294119693d02..698b6db9e417 100644 --- a/binaryurp/source/outgoingrequests.hxx +++ b/binaryurp/source/outgoingrequests.hxx @@ -22,10 +22,9 @@ #include #include +#include #include -#include - namespace binaryurp { struct OutgoingRequest; @@ -56,7 +55,7 @@ private: typedef std::map> Map; -osl::Mutex mutex_; +std::mutex mutex_; Map map_; }; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cppu/source
cppu/source/threadpool/threadpool.cxx |7 +++ cppu/source/threadpool/threadpool.hxx |2 +- 2 files changed, 4 insertions(+), 5 deletions(-) New commits: commit bd4ee5ea9b0b79cfb8c03aa1f1d6008565b71bff Author: Arnaud Versini AuthorDate: Sun Jun 27 17:05:35 2021 +0200 Commit: Arnaud Versini CommitDate: Sat Jul 17 19:02:18 2021 +0200 cppu : use std::mutex in DisposedCallerAdmin Change-Id: I3db567a9aed42167ea24eebcf673f19106595f83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117948 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/cppu/source/threadpool/threadpool.cxx b/cppu/source/threadpool/threadpool.cxx index 257155027955..86c280b4b352 100644 --- a/cppu/source/threadpool/threadpool.cxx +++ b/cppu/source/threadpool/threadpool.cxx @@ -25,7 +25,6 @@ #include #include -#include #include #include @@ -68,19 +67,19 @@ namespace cppu_threadpool void DisposedCallerAdmin::dispose( void const * nDisposeId ) { -MutexGuard guard( m_mutex ); +std::scoped_lock guard( m_mutex ); m_vector.push_back( nDisposeId ); } void DisposedCallerAdmin::destroy( void const * nDisposeId ) { -MutexGuard guard( m_mutex ); +std::scoped_lock guard( m_mutex ); m_vector.erase(std::remove(m_vector.begin(), m_vector.end(), nDisposeId), m_vector.end()); } bool DisposedCallerAdmin::isDisposed( void const * nDisposeId ) { -MutexGuard guard( m_mutex ); +std::scoped_lock guard( m_mutex ); return (std::find(m_vector.begin(), m_vector.end(), nDisposeId) != m_vector.end()); } diff --git a/cppu/source/threadpool/threadpool.hxx b/cppu/source/threadpool/threadpool.hxx index 5b758703579a..15d092a21062 100644 --- a/cppu/source/threadpool/threadpool.hxx +++ b/cppu/source/threadpool/threadpool.hxx @@ -89,7 +89,7 @@ namespace cppu_threadpool { bool isDisposed( void const * nDisposeId ); private: -::osl::Mutex m_mutex; +std::mutex m_mutex; std::vector< void const * > m_vector; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cppuhelper/source
cppuhelper/source/implbase_ex.cxx | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) New commits: commit c82914912f73f1fc9912d53fb60ca7a66379c560 Author: Arnaud Versini AuthorDate: Sat Jun 5 13:38:14 2021 +0200 Commit: Noel Grandin CommitDate: Wed Jul 14 19:12:01 2021 +0200 cppuhelper : use std::mutex and remove useless rtl::Static Change-Id: Idb272e664c4b745c4db96e505b60905c93937900 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116746 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/cppuhelper/source/implbase_ex.cxx b/cppuhelper/source/implbase_ex.cxx index 00eeaf376618..24b7a74582d7 100644 --- a/cppuhelper/source/implbase_ex.cxx +++ b/cppuhelper/source/implbase_ex.cxx @@ -24,28 +24,16 @@ #include +#include + using namespace ::cppu; using namespace ::osl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -namespace -{ -class theImplHelperInitMutex : public rtl::Static{}; -} - namespace cppu { -/** Shared mutex for implementation helper initialization. -Not for public use. -*/ -static ::osl::Mutex & getImplHelperInitMutex() -{ -return theImplHelperInitMutex::get(); -} - - static void checkInterface( Type const & rType ) { if (TypeClass_INTERFACE != rType.getTypeClass()) @@ -79,7 +67,8 @@ static type_entry * getTypeEntries( class_data * cd ) type_entry * pEntries = cd->m_typeEntries; if (! cd->m_storedTypeRefs) // not inited? { -MutexGuard guard( getImplHelperInitMutex() ); +static std::mutex aMutex; +std::lock_guard guard( aMutex ); if (! cd->m_storedTypeRefs) // not inited? { // get all types ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: codemaker/source
codemaker/source/cppumaker/cppuoptions.cxx |2 -- 1 file changed, 2 deletions(-) New commits: commit 3721f4a00e31eb1c08e492106f752db74d3daf7c Author: Arnaud Versini AuthorDate: Sun Jun 20 17:37:34 2021 +0200 Commit: Arnaud Versini CommitDate: Sat Jun 26 16:44:33 2021 +0200 codemaker : remove useless includes Change-Id: Idaac78579d7845a1908bc3c02ff917432ca6a7d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117513 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/codemaker/source/cppumaker/cppuoptions.cxx b/codemaker/source/cppumaker/cppuoptions.cxx index 43376278b285..0a2ad962381a 100644 --- a/codemaker/source/cppumaker/cppuoptions.cxx +++ b/codemaker/source/cppumaker/cppuoptions.cxx @@ -21,8 +21,6 @@ #include #include "cppuoptions.hxx" -#include -#include #ifdef SAL_UNX #define SEPARATOR '/' ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: vcl/unx
vcl/unx/generic/printer/ppdparser.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 80255dcde14755bb4a342b7392fb26d27580ff6d Author: Arnaud Versini AuthorDate: Sun May 30 19:29:07 2021 +0200 Commit: Arnaud Versini CommitDate: Sat Jun 5 11:28:02 2021 +0200 vcl unix : use std::thread in PPDParser::getParser Change-Id: Iff31fbdec6516b490590e31db6915397033c1027 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116413 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index c976a2f7519d..ea03299ed7fb 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -48,6 +47,7 @@ #include +#include #include #ifdef ENABLE_CUPS @@ -531,8 +531,8 @@ OUString PPDParser::getPPDFile( const OUString& rFile ) const PPDParser* PPDParser::getParser( const OUString& rFile ) { -static ::osl::Mutex aMutex; -::osl::Guard< ::osl::Mutex > aGuard( aMutex ); +static std::mutex aMutex; +std::lock_guard aGuard( aMutex ); OUString aFile = rFile; if( !rFile.startsWith( "CUPS:" ) && !rFile.startsWith( "CPD:" ) ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sdext/source
sdext/source/minimizer/pppoptimizertoken.cxx |9 + sdext/source/pdfimport/misc/pwdinteract.cxx | 11 ++- 2 files changed, 11 insertions(+), 9 deletions(-) New commits: commit d220fc00c2c3d7a2a24fd762599d1bfcc27f34d5 Author: Arnaud Versini AuthorDate: Sun May 30 19:32:41 2021 +0200 Commit: Noel Grandin CommitDate: Mon May 31 15:21:39 2021 +0200 sdext : use std::mutex when possible Change-Id: Ia610c0c46e017452db71945f6f53fedbcb6d1198 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116415 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sdext/source/minimizer/pppoptimizertoken.cxx b/sdext/source/minimizer/pppoptimizertoken.cxx index 9a5c2eac9a62..9130621ff762 100644 --- a/sdext/source/minimizer/pppoptimizertoken.cxx +++ b/sdext/source/minimizer/pppoptimizertoken.cxx @@ -19,16 +19,17 @@ #include "pppoptimizertoken.hxx" -#include + #include #include #include +#include typedef std::unordered_map< const char*, PPPOptimizerTokenEnum, rtl::CStringHash, rtl::CStringEqual> TypeNameHashMap; static TypeNameHashMap* pHashMap = nullptr; -static ::osl::Mutex& getHashMapMutex() +static std::mutex& getHashMapMutex() { -static osl::Mutex s_aHashMapProtection; +static std::mutex s_aHashMapProtection; return s_aHashMapProtection; } @@ -166,7 +167,7 @@ PPPOptimizerTokenEnum TKGet( const OUString& rToken ) { if ( !pHashMap ) { // init hash map -::osl::MutexGuard aGuard( getHashMapMutex() ); +std::lock_guard aGuard( getHashMapMutex() ); if ( !pHashMap ) { TypeNameHashMap* pH = new TypeNameHashMap; diff --git a/sdext/source/pdfimport/misc/pwdinteract.cxx b/sdext/source/pdfimport/misc/pwdinteract.cxx index 4179795cc073..9885a6606a54 100644 --- a/sdext/source/pdfimport/misc/pwdinteract.cxx +++ b/sdext/source/pdfimport/misc/pwdinteract.cxx @@ -20,6 +20,7 @@ #include #include +#include #include @@ -44,7 +45,7 @@ class PDFPasswordRequest: task::XInteractionRequest, task::XInteractionPassword > { private: -mutable osl::Mutexm_aMutex; +mutable std::mutexm_aMutex; uno::Any m_aRequest; OUString m_aPassword; bool m_bSelected; @@ -65,7 +66,7 @@ public: // XInteractionContinuation virtual void SAL_CALL select() override; -bool isSelected() const { osl::MutexGuard const guard( m_aMutex ); return m_bSelected; } +bool isSelected() const { std::scoped_lock const guard( m_aMutex ); return m_bSelected; } private: virtual ~PDFPasswordRequest() override {} @@ -98,21 +99,21 @@ uno::Sequence< uno::Reference< task::XInteractionContinuation > > PDFPasswordReq void PDFPasswordRequest::setPassword( const OUString& rPwd ) { -osl::MutexGuard const guard( m_aMutex ); +std::scoped_lock const guard( m_aMutex ); m_aPassword = rPwd; } OUString PDFPasswordRequest::getPassword() { -osl::MutexGuard const guard( m_aMutex ); +std::scoped_lock const guard( m_aMutex ); return m_aPassword; } void PDFPasswordRequest::select() { -osl::MutexGuard const guard( m_aMutex ); +std::scoped_lock const guard( m_aMutex ); m_bSelected = true; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: canvas/source
canvas/source/factory/cf_service.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 39aa29712fe4c7a1c432cecf03d9d491537c02e6 Author: Arnaud Versini AuthorDate: Sun May 30 19:36:59 2021 +0200 Commit: Noel Grandin CommitDate: Mon May 31 15:20:25 2021 +0200 canvas : use std::mutex in CanvasFactory Change-Id: Ic492f6b398ace3796d4b2cd45455d9ddec6cd728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116416 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/canvas/source/factory/cf_service.cxx b/canvas/source/factory/cf_service.cxx index 4e31197de2be..6919d56fb219 100644 --- a/canvas/source/factory/cf_service.cxx +++ b/canvas/source/factory/cf_service.cxx @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -34,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -58,7 +58,7 @@ class CanvasFactory typedef std::vector< CachePair >CacheVector; -mutable ::osl::Mutex m_mutex; +mutable std::mutexm_mutex; Reference m_xContext; Reference m_xCanvasConfigNameAccess; AvailVector m_aAvailableImplementations; @@ -288,7 +288,7 @@ Reference CanvasFactory::lookupAndUse( OUString const & serviceName, Sequence const & args, Reference const & xContext ) const { -::osl::MutexGuard guard(m_mutex); +std::lock_guard guard(m_mutex); // forcing last entry from impl list, if config flag set bool bForceLastEntry(false); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/source
sw/source/filter/ww8/ww8scan.hxx |1 + 1 file changed, 1 insertion(+) New commits: commit e718f0e703c0fb33a0b1b5efe7b13b02c25f3335 Author: Arnaud Versini AuthorDate: Sun May 30 19:30:05 2021 +0200 Commit: Caolán McNamara CommitDate: Sun May 30 22:12:28 2021 +0200 sw : missing std::optional include Change-Id: Ia5973a0ffd43962ef2391f431d3d6b544fe19879 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116414 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 66d3a651ff78..750b28252418 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: shell/source
shell/source/cmdmail/cmdmailmsg.cxx | 35 +-- shell/source/cmdmail/cmdmailmsg.hxx |3 ++- 2 files changed, 19 insertions(+), 19 deletions(-) New commits: commit 7a4fffb19fb3d573d9afd3f7136cd0e5b545b706 Author: Arnaud Versini AuthorDate: Sun Apr 18 16:28:49 2021 +0200 Commit: Michael Stahl CommitDate: Thu May 20 12:02:32 2021 +0200 shell : use std::mutex in CmdMailMsg Change-Id: I2aac780ce17e327a2f5ddbc835583bad1056bfc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114244 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/shell/source/cmdmail/cmdmailmsg.cxx b/shell/source/cmdmail/cmdmailmsg.cxx index bd8657577b75..2a6a5f843af2 100644 --- a/shell/source/cmdmail/cmdmailmsg.cxx +++ b/shell/source/cmdmail/cmdmailmsg.cxx @@ -21,7 +21,6 @@ using com::sun::star::container::NoSuchElementException; using com::sun::star::container::XNameAccess; -using osl::MutexGuard; using namespace cppu; using namespace com::sun::star::uno; @@ -29,91 +28,91 @@ using namespace com::sun::star::uno; void SAL_CALL CmdMailMsg::setBody( const OUString& aBody ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); m_aBody = aBody; } OUString SAL_CALL CmdMailMsg::getBody( ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); return m_aBody; } void SAL_CALL CmdMailMsg::setRecipient( const OUString& aRecipient ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); m_aRecipient = aRecipient; } OUString SAL_CALL CmdMailMsg::getRecipient( ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); return m_aRecipient; } void SAL_CALL CmdMailMsg::setCcRecipient( const Sequence< OUString >& aCcRecipient ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); m_CcRecipients = aCcRecipient; } Sequence< OUString > SAL_CALL CmdMailMsg::getCcRecipient( ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); return m_CcRecipients; } void SAL_CALL CmdMailMsg::setBccRecipient( const Sequence< OUString >& aBccRecipient ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); m_BccRecipients = aBccRecipient; } Sequence< OUString > SAL_CALL CmdMailMsg::getBccRecipient( ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); return m_BccRecipients; } void SAL_CALL CmdMailMsg::setOriginator( const OUString& aOriginator ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); m_aOriginator = aOriginator; } OUString SAL_CALL CmdMailMsg::getOriginator( ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); return m_aOriginator; } void SAL_CALL CmdMailMsg::setSubject( const OUString& aSubject ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); m_aSubject = aSubject; } OUString SAL_CALL CmdMailMsg::getSubject( ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); return m_aSubject; } void SAL_CALL CmdMailMsg::setAttachement( const Sequence< OUString >& aAttachment ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); m_Attachments = aAttachment; } Sequence< OUString > SAL_CALL CmdMailMsg::getAttachement( ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); return m_Attachments; } Any SAL_CALL CmdMailMsg::getByName( const OUString& aName ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); if( aName == "body" && !m_aBody.isEmpty() ) return makeAny( m_aBody ); @@ -142,7 +141,7 @@ Any SAL_CALL CmdMailMsg::getByName( const OUString& aName ) Sequence< OUString > SAL_CALL CmdMailMsg::getElementNames( ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); sal_Int32 nItems = 0; Sequence< OUString > aRet( 7 ); @@ -174,7 +173,7 @@ Sequence< OUString > SAL_CALL CmdMailMsg::getElementNames( ) sal_Bool SAL_CALL CmdMailMsg::hasByName( const OUString& aName ) { -MutexGuard aGuard( m_aMutex ); +std::scoped_lock aGuard( m_aMutex ); if( aName == "body" && !m_aBody.isEmpty() ) return true; diff --git a/shell/source/cmdmail/cmdmailmsg.hxx b/shell/source/cmdmail/cmdmailmsg.hxx index 43e40c1abf77..b481403953a5 100644 --- a/shell/source/cmdmail/cmdmailmsg.hxx +++ b/shell/source/cmdmail/cmdmailmsg.hxx @@ -20,6 +20,7 @@ #ifndef INCLUDED_SHELL_SOURCE_CMDMAIL_CMDMAILMSG_HXX #define INCLUDED_SHELL_SOURCE_CMDMAIL_CMDMAILMSG_HXX +#include #include #include @@ -41,7 +42,7 @@ class CmdMailMsg : css::uno::Sequence< OUString > m_BccRecipients; css::uno::Sequence< OUString > m_Attachments; -::osl::Mutexm_aMutex;
[Libreoffice-commits] core.git: sdext/source
sdext/source/presenter/PresenterTimer.cxx | 29 +++-- 1 file changed, 15 insertions(+), 14 deletions(-) New commits: commit b30170661fb3a87d6b0491d748b8eb0d8f3dc99e Author: Arnaud Versini AuthorDate: Mon Apr 19 10:50:06 2021 +0200 Commit: Arnaud Versini CommitDate: Fri May 7 15:52:16 2021 +0200 presenter : use std::mutex Change-Id: I53e081fd6c52fc040b29fad18dc3a758310f943a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114259 Tested-by: Jenkins Reviewed-by: Arnaud Versini diff --git a/sdext/source/presenter/PresenterTimer.cxx b/sdext/source/presenter/PresenterTimer.cxx index 196feeba62ef..f46fcd288ee0 100644 --- a/sdext/source/presenter/PresenterTimer.cxx +++ b/sdext/source/presenter/PresenterTimer.cxx @@ -28,6 +28,7 @@ #include #include +#include #include using namespace ::com::sun::star; @@ -99,14 +100,14 @@ public: private: static std::shared_ptr mpInstance; -static ::osl::Mutex maInstanceMutex; +static std::mutex maInstanceMutex; std::shared_ptr mpLateDestroy; // for clean exit static sal_Int32 mnTaskId; -::osl::Mutex maTaskContainerMutex; +std::mutex maTaskContainerMutex; typedef ::std::set TaskContainer; TaskContainer maScheduledTasks; -::osl::Mutex maCurrentTaskMutex; +std::mutex maCurrentTaskMutex; SharedTimerTask mpCurrentTask; ::osl::Condition m_Shutdown; @@ -177,13 +178,13 @@ void PresenterTimer::CancelTask (const sal_Int32 nTaskId) //= TimerScheduler std::shared_ptr TimerScheduler::mpInstance; -::osl::Mutex TimerScheduler::maInstanceMutex; +std::mutex TimerScheduler::maInstanceMutex; sal_Int32 TimerScheduler::mnTaskId = PresenterTimer::NotAValidTaskId; std::shared_ptr TimerScheduler::Instance( uno::Reference const& xContext) { -::osl::MutexGuard aGuard (maInstanceMutex); +std::lock_guard aGuard (maInstanceMutex); if (mpInstance == nullptr) { if (!xContext.is()) @@ -225,7 +226,7 @@ void TimerScheduler::ScheduleTask (const SharedTimerTask& rpTask) return; { -osl::MutexGuard aTaskGuard (maTaskContainerMutex); +std::lock_guard aTaskGuard (maTaskContainerMutex); maScheduledTasks.insert(rpTask); } } @@ -236,7 +237,7 @@ void TimerScheduler::CancelTask (const sal_Int32 nTaskId) // task ids. Therefore we have to do a linear search for the task to // cancel. { -::osl::MutexGuard aGuard (maTaskContainerMutex); +std::lock_guard aGuard (maTaskContainerMutex); auto iTask = std::find_if(maScheduledTasks.begin(), maScheduledTasks.end(), [nTaskId](const SharedTimerTask& rxTask) { return rxTask->mnTaskId == nTaskId; }); if (iTask != maScheduledTasks.end()) @@ -247,7 +248,7 @@ void TimerScheduler::CancelTask (const sal_Int32 nTaskId) // processed. Mark it with a flag that a) prevents a repeating task // from being scheduled again and b) tries to prevent its execution. { -::osl::MutexGuard aGuard (maCurrentTaskMutex); +std::lock_guard aGuard (maCurrentTaskMutex); if (mpCurrentTask && mpCurrentTask->mnTaskId == nTaskId) mpCurrentTask->mbIsCanceled = true; @@ -265,12 +266,12 @@ void TimerScheduler::NotifyTermination() } { -::osl::MutexGuard aGuard(pInstance->maTaskContainerMutex); +std::lock_guard aGuard(pInstance->maTaskContainerMutex); pInstance->maScheduledTasks.clear(); } { -::osl::MutexGuard aGuard(pInstance->maCurrentTaskMutex); +std::lock_guard aGuard(pInstance->maCurrentTaskMutex); if (pInstance->mpCurrentTask) { pInstance->mpCurrentTask->mbIsCanceled = true; @@ -302,7 +303,7 @@ void SAL_CALL TimerScheduler::run() SharedTimerTask pTask; sal_Int64 nDifference = 0; { -::osl::MutexGuard aGuard (maTaskContainerMutex); +std::lock_guard aGuard (maTaskContainerMutex); // There are no more scheduled task. Leave this loop, function and // live of the TimerScheduler. @@ -321,7 +322,7 @@ void SAL_CALL TimerScheduler::run() // Acquire a reference to the current task. { -::osl::MutexGuard aGuard (maCurrentTaskMutex); +std::lock_guard aGuard (maCurrentTaskMutex); mpCurrentTask = pTask; } @@ -355,13 +356,13 @@ void SAL_CALL TimerScheduler::run() // Release reference to the current task. { -::osl::MutexGuard aGuard (maCurrentTaskMutex); +std::lock_guard aGuard (maCurrentTaskMutex); mpCurrentTask.reset(); } } // While holding maInstanceMutex -osl::Guard< osl::Mutex > aInstance( maInstanceMutex ); +std::lock_guard aInstance( maInstanceMutex ); mpLateDestroy = mpInstance;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - svx/source
svx/source/svdraw/svdograf.cxx |4 1 file changed, 4 insertions(+) New commits: commit b4e6c12dec3ddb2d6e78f136230f24feffe73d58 Author: Arnaud Versini AuthorDate: Mon Apr 5 12:33:11 2021 +0200 Commit: Xisco Fauli CommitDate: Wed Apr 7 08:54:29 2021 +0200 tdf#141297 : remove link to the file Change-Id: I5c14f46f5fbd51d95eeb58ea0a6d3aa39afef3cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113597 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 7289b9a90f5f8349875856c552330d512004925e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113642 Reviewed-by: Xisco Fauli (cherry picked from commit 6494b99f09a29c22d51fb898423ced36ce02a9e7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113645 diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index be60f5697ca1..d17d039ff262 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -500,6 +500,10 @@ void SdrGrafObj::ReleaseGraphicLink() aFileName.clear(); aReferer.clear(); aFilterName.clear(); + +auto aGraphic = mpGraphicObject->GetGraphic(); +aGraphic.setOriginURL(""); +SetGraphic(aGraphic); } bool SdrGrafObj::IsLinkedGraphic() const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/source
svx/source/svdraw/svdograf.cxx |4 1 file changed, 4 insertions(+) New commits: commit 6494b99f09a29c22d51fb898423ced36ce02a9e7 Author: Arnaud Versini AuthorDate: Mon Apr 5 12:33:11 2021 +0200 Commit: Xisco Fauli CommitDate: Tue Apr 6 21:16:43 2021 +0200 tdf#141297 : remove link to the file Change-Id: I5c14f46f5fbd51d95eeb58ea0a6d3aa39afef3cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113597 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl (cherry picked from commit 7289b9a90f5f8349875856c552330d512004925e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113642 Reviewed-by: Xisco Fauli diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index f175f9c33181..6bf317f29c02 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -498,6 +498,10 @@ void SdrGrafObj::ReleaseGraphicLink() ImpDeregisterLink(); aFileName.clear(); aFilterName.clear(); + +auto aGraphic = mpGraphicObject->GetGraphic(); +aGraphic.setOriginURL(""); +SetGraphic(aGraphic); } bool SdrGrafObj::IsLinkedGraphic() const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdograf.cxx |4 1 file changed, 4 insertions(+) New commits: commit 7289b9a90f5f8349875856c552330d512004925e Author: Arnaud Versini AuthorDate: Mon Apr 5 12:33:11 2021 +0200 Commit: Tomaž Vajngerl CommitDate: Tue Apr 6 15:24:31 2021 +0200 tdf#141297 : remove link to the file Change-Id: I5c14f46f5fbd51d95eeb58ea0a6d3aa39afef3cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113597 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index f7a03a82278d..bc0e125d46c1 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -552,6 +552,10 @@ void SdrGrafObj::ReleaseGraphicLink() ImpDeregisterLink(); aFileName.clear(); aFilterName.clear(); + +auto aGraphic = mpGraphicObject->GetGraphic(); +aGraphic.setOriginURL(""); +SetGraphic(aGraphic); } bool SdrGrafObj::IsLinkedGraphic() const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: cppu/source
cppu/source/threadpool/thread.cxx | 15 +++ cppu/source/threadpool/threadpool.cxx | 18 +- cppu/source/threadpool/threadpool.hxx |9 + 3 files changed, 21 insertions(+), 21 deletions(-) New commits: commit 550a47f117cc35dbffbb6caef6db52acdd0c1453 Author: Arnaud Versini AuthorDate: Sat Mar 13 18:10:46 2021 +0100 Commit: Stephan Bergmann CommitDate: Tue Apr 6 10:22:34 2021 +0200 cppu : use std::mutex in threadpool Change-Id: I559a2c533accfe95740c29d726833d0bbab210fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112460 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/cppu/source/threadpool/thread.cxx b/cppu/source/threadpool/thread.cxx index 794d8f35e7ec..c0c3bc9ae61d 100644 --- a/cppu/source/threadpool/thread.cxx +++ b/cppu/source/threadpool/thread.cxx @@ -42,9 +42,8 @@ namespace cppu_threadpool { SAL_WARN_IF(m_deque.size(), "cppu.threadpool", m_deque.size() << "Threads left"); } -bool ThreadAdmin::add( rtl::Reference< ORequestThread > const & p ) +bool ThreadAdmin::add_locked( rtl::Reference< ORequestThread > const & p ) { -MutexGuard aGuard( m_mutex ); if( m_disposed ) { return false; @@ -60,21 +59,21 @@ namespace cppu_threadpool { void ThreadAdmin::remove( rtl::Reference< ORequestThread > const & p ) { -MutexGuard aGuard( m_mutex ); +std::scoped_lock aGuard( m_mutex ); remove_locked( p ); } void ThreadAdmin::join() { { -MutexGuard aGuard( m_mutex ); +std::scoped_lock aGuard( m_mutex ); m_disposed = true; } for (;;) { rtl::Reference< ORequestThread > pCurrent; { -MutexGuard aGuard( m_mutex ); +std::scoped_lock aGuard( m_mutex ); if( m_deque.empty() ) { break; @@ -118,8 +117,8 @@ namespace cppu_threadpool { // return value iff it causes osl::Thread::run to start executing: acquire(); ThreadAdmin & rThreadAdmin = m_aThreadPool->getThreadAdmin(); -osl::ClearableMutexGuard g(rThreadAdmin.m_mutex); -if (!rThreadAdmin.add( this )) { +std::unique_lock g(rThreadAdmin.m_mutex); +if (!rThreadAdmin.add_locked( this )) { return false; } try { @@ -128,7 +127,7 @@ namespace cppu_threadpool { } } catch (...) { rThreadAdmin.remove_locked( this ); -g.clear(); +g.release(); release(); throw; } diff --git a/cppu/source/threadpool/threadpool.cxx b/cppu/source/threadpool/threadpool.cxx index c5783dc19989..257155027955 100644 --- a/cppu/source/threadpool/threadpool.cxx +++ b/cppu/source/threadpool/threadpool.cxx @@ -99,7 +99,7 @@ namespace cppu_threadpool { m_DisposedCallerAdmin->dispose( nDisposeId ); -MutexGuard guard( m_mutex ); +std::scoped_lock guard( m_mutex ); for (auto const& item : m_mapQueue) { if( item.second.first ) @@ -127,7 +127,7 @@ namespace cppu_threadpool { WaitingThread waitingThread(pThread); { -MutexGuard guard( m_mutexWaitingThreadList ); +std::scoped_lock guard( m_mutexWaitingThreadList ); m_dequeThreads.push_front( &waitingThread ); } @@ -135,7 +135,7 @@ namespace cppu_threadpool waitingThread.condition.wait( std::chrono::seconds(2) ); { -MutexGuard guard ( m_mutexWaitingThreadList ); +std::scoped_lock guard ( m_mutexWaitingThreadList ); if( waitingThread.thread.is() ) { // thread wasn't reused, remove it from the list @@ -150,7 +150,7 @@ namespace cppu_threadpool void ThreadPool::joinWorkers() { { -MutexGuard guard( m_mutexWaitingThreadList ); +std::scoped_lock guard( m_mutexWaitingThreadList ); for (auto const& thread : m_dequeThreads) { // wake the threads up @@ -166,7 +166,7 @@ namespace cppu_threadpool { { // Can a thread be reused ? -MutexGuard guard( m_mutexWaitingThreadList ); +std::scoped_lock guard( m_mutexWaitingThreadList ); if( ! m_dequeThreads.empty() ) { // inform the thread and let it go @@ -190,7 +190,7 @@ namespace cppu_threadpool bool ThreadPool::revokeQueue( const ByteSequence &aThreadId, bool bAsynchron ) { -MutexGuard guard( m_mutex ); +std::scoped_lock guard( m_mutex ); ThreadIdHashMap::iterator ii = m_mapQueue.find( aThreadId ); OSL_ASSERT( ii != m_mapQueue.end() ); @@ -240,7 +240,7 @@ namespace cppu_threadpool bool bCreateThread = false;
[Libreoffice-commits] core.git: animations/source
animations/source/animcore/animcore.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3a5c7d98d9c875b4d87097883f1da56c17e79eea Author: Arnaud Versini AuthorDate: Sat Mar 13 11:34:45 2021 +0100 Commit: Arnaud Versini CommitDate: Sun Mar 21 12:37:18 2021 +0100 animcore : AnimationNode should be final Change-Id: I0be5e9d21b36823953e41cd8389f28ce36ed45e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112434 Tested-by: Jenkins Tested-by: Arnaud Versini Reviewed-by: Arnaud Versini diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx index adb41c26c0e7..493e1fa1d102 100644 --- a/animations/source/animcore/animcore.cxx +++ b/animations/source/animcore/animcore.cxx @@ -125,7 +125,7 @@ public: Mutex maMutex; }; -class AnimationNode : public AnimationNodeBase +class AnimationNode final : public AnimationNodeBase { public: explicit AnimationNode(sal_Int16 nNodeType); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: basctl/source
basctl/source/basicide/bastypes.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 486258be7950e06cacbb3ae403129b57e3625995 Author: Arnaud Versini AuthorDate: Sun Mar 7 11:38:09 2021 +0100 Commit: Noel Grandin CommitDate: Mon Mar 8 08:20:29 2021 +0100 BASIC : simplify BaseWindow initialization. Change-Id: If12b32fa7cf19341a2de1a4c0efb156075ff6ec5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112122 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index 27b19fa4b3b5..2d1cfa6f0b76 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -55,13 +55,13 @@ using namespace ::com::sun::star; BaseWindow::BaseWindow( vcl::Window* pParent, const ScriptDocument& rDocument, const OUString& aLibName, const OUString& aName ) :Window( pParent, WinBits( WB_3DLOOK ) ) +,pShellHScrollBar( nullptr) +,pShellVScrollBar( nullptr) +,nStatus( 0) ,m_aDocument( rDocument ) ,m_aLibName( aLibName ) ,m_aName( aName ) { -pShellHScrollBar = nullptr; -pShellVScrollBar = nullptr; -nStatus = 0; } BaseWindow::~BaseWindow() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits