[Libreoffice-commits] core.git: codemaker/source dbaccess/source editeng/source forms/source oox/source sc/source sdext/source slideshow/source stoc/source sw/source toolkit/source

2023-12-04 Thread Julien Nabet (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx |8 ++--
 dbaccess/source/core/api/KeySet.cxx |4 +++-
 editeng/source/misc/svxacorr.cxx|   10 +++---
 forms/source/xforms/propertysetbase.cxx |2 +-
 oox/source/drawingml/texteffectscontext.cxx |5 +++--
 sc/source/ui/namedlg/namedlg.cxx|   12 ++--
 sdext/source/pdfimport/tree/pdfiprocessor.cxx   |1 +
 slideshow/source/engine/box2dtools.cxx  |5 -
 stoc/source/invocation_adapterfactory/iafactory.cxx |2 +-
 sw/source/uibase/utlui/uitool.cxx   |9 ++---
 toolkit/source/controls/unocontrolmodel.cxx |4 +++-
 11 files changed, 45 insertions(+), 17 deletions(-)

New commits:
commit 67c2a4786154a5c246998f119c3349e4d725e43b
Author: Julien Nabet 
AuthorDate: Mon Dec 4 18:59:43 2023 +0100
Commit: Julien Nabet 
CommitDate: Mon Dec 4 22:10:20 2023 +0100

cid#1545597 Using invalid iterator

and :

cid#1545537 Using invalid iterator
cid#1545508 Using invalid iterator
cid#1545494 Using invalid iterator
cid#1545478 Using invalid iterator
cid#1545427 Using invalid iterator
cid#1545420 Using invalid iterator
cid#1545400 Using invalid iterator
cid#1545300 Using invalid iterator
cid#1545258 Using invalid iterator
cid#1545257 Using invalid iterator
cid#1545200 Using invalid iterator
cid#1545183 Using invalid iterator

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

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 301714911a3b..1995ed73c9ea 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -2279,8 +2279,10 @@ void 
PlainStructType::dumpComprehensiveGetCppuType(FileStream & out)
 for (std::vector< unoidl::PlainStructTypeEntity::Member >::const_iterator 
i(
  entity_->getDirectMembers().begin());
  i != entity_->getDirectMembers().end();) {
+const auto iter = types.find(i->type);
+assert(iter != types.end());
 out << indent() << "{ { " << getTypeClass(i->type, true)
-<< ", the_tname" << types.find(i->type)->second
+<< ", the_tname" << iter->second
 << ".pData, the_name" << n++ << ".pData }, false }";
 ++i;
 out << (i == entity_->getDirectMembers().end() ? " };" : ",") << "\n";
@@ -2851,8 +2853,10 @@ void 
PolyStructType::dumpComprehensiveGetCppuType(FileStream & out)
 sal_uInt32 k = parameters.find(i->type)->second;
 out << "the_pclass" << k << ", the_pname" << k << ".pData";
 } else {
+const auto iter = types.find(i->type);
+assert(iter != types.end());
 out << getTypeClass(i->type, true) << ", the_tname"
-<< types.find(i->type)->second << ".pData";
+<< iter->second << ".pData";
 }
 out << ", the_name" << n++ << ".pData }, "
 << (i->parameterized ? "true" : "false") << " }";
diff --git a/dbaccess/source/core/api/KeySet.cxx 
b/dbaccess/source/core/api/KeySet.cxx
index 7a2ec55fa5c2..cfbec6afecef 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -912,7 +912,9 @@ void OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const 
connectivity::OSQLTa
 if(m_bDeleted)
 {
 sal_Int32 nBookmark = 
::comphelper::getINT32((*_rDeleteRow)[0].getAny());
-if(m_aKeyIter == m_aKeyMap.find(nBookmark) && m_aKeyIter != 
m_aKeyMap.end())
+const auto iter = m_aKeyMap.find(nBookmark);
+assert(iter != m_aKeyMap.end());
+if(m_aKeyIter == iter && m_aKeyIter != m_aKeyMap.end())
 ++m_aKeyIter;
 m_aKeyMap.erase(nBookmark);
 m_bDeleted = true;
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index c8891889b01d..15cbecc32db3 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1687,7 +1687,9 @@ SvxAutoCorrectLanguageLists& 
SvxAutoCorrect::GetLanguageList_(
 LanguageTag aLanguageTag( eLang);
 if (m_aLangTable.find(aLanguageTag) == m_aLangTable.end())
 (void)CreateLanguageFile(aLanguageTag);
-return m_aLangTable.find(aLanguageTag)->second;
+const auto iter = m_aLangTable.find(aLanguageTag);
+assert(iter != m_aLangTable.end());
+return iter->second;
 }
 
 void SvxAutoCorrect::SaveCplSttExceptList( LanguageType eLang )
@@ -1912,14 +1914,16 @@ void SvxAutoCorrect::MakeCombinedChanges( 
std::vector& aNewEntr
   LanguageType eLang )
 {
 LanguageTag aLanguageTag( eLang);
-auto const iter = m_aLangTable.find(aLanguageTag);
+auto iter = 

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

2023-10-13 Thread Stephan Bergmann (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx |3 +++
 include/comphelper/errcode.hxx  |4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 27e7a6199231b8b9942724c86d0a22126e71862e
Author: Stephan Bergmann 
AuthorDate: Fri Oct 13 13:36:19 2023 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Oct 13 16:46:07 2023 +0200

Follow-up on "Make sure __cpp_lib_source_location is consistently defined"

(113e064117b2632974a696b950634229d70c5b96).  Mike pointed out that I forgot 
to
fix the generated code and that
"https://en.cppreference.com/w/cpp/compiler_support/20 lists  as
supported since gcc libstdc++ 9, and README.md requires libstdc++ 8.5."

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

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 235e55017610..514e99915834 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3014,6 +3014,9 @@ void ExceptionType::dumpHdlFile(
 if (name_ == "com.sun.star.uno.Exception")
 {
 includes.addCustom("#if defined(LIBO_INTERNAL_ONLY)");
+includes.addCustom("#if __has_include()");
+includes.addCustom("#include ");
+includes.addCustom("#endif");
 includes.addCustom("#if defined(__cpp_lib_source_location) && 
__cpp_lib_source_location >= 201907");
 includes.addCustom("#include ");
 includes.addCustom("#define LIBO_USE_SOURCE_LOCATION std");
diff --git a/include/comphelper/errcode.hxx b/include/comphelper/errcode.hxx
index 662ec139164b..8198512ff3e1 100644
--- a/include/comphelper/errcode.hxx
+++ b/include/comphelper/errcode.hxx
@@ -23,9 +23,11 @@
 #include 
 #include 
 #include 
-#include 
 
 #if defined(DBG_UTIL)
+#if __has_include()
+#include 
+#endif
 #if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907
 #include 
 #define LIBO_ERRMSG_USE_SOURCE_LOCATION std


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

2023-10-12 Thread Noel Grandin (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx |   21 -
 include/comphelper/errcode.hxx  |   26 ++
 2 files changed, 26 insertions(+), 21 deletions(-)

New commits:
commit 9c5f597fc80a8a910c1f898556ef2a3226dfe40c
Author: Noel Grandin 
AuthorDate: Tue Oct 3 11:30:34 2023 +0200
Commit: Mike Kaganski 
CommitDate: Thu Oct 12 20:59:45 2023 +0200

use std::source_location instead of std::experimental::source_location

https://en.cppreference.com/w/cpp/compiler_support says that this is
supported in

  GCC >= 11
  CLANG >= 16
  Visual Studio >= VS 2019 16.10

And our Visual Studio baseline is now 2019.

We still need to make the ifdef conditional check clang, because
__has_include will happily return true even if the current clang
does not support the necessary builtins.

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

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 47b3d8f488a5..235e55017610 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3013,13 +3013,16 @@ void ExceptionType::dumpHdlFile(
 {
 if (name_ == "com.sun.star.uno.Exception")
 {
-// LIBO_INTERNAL_ONLY implies GCC >= 7, which we need for this
-// libstdc++ header.
-includes.addCustom("#if defined LIBO_INTERNAL_ONLY && (defined 
__GNUC__ || defined __clang__) && 
__has_include()");
-includes.addCustom("#define LIBO_USE_SOURCE_LOCATION");
+includes.addCustom("#if defined(LIBO_INTERNAL_ONLY)");
+includes.addCustom("#if defined(__cpp_lib_source_location) && 
__cpp_lib_source_location >= 201907");
+includes.addCustom("#include ");
+includes.addCustom("#define LIBO_USE_SOURCE_LOCATION std");
+includes.addCustom("#elif 
__has_include()");
+includes.addCustom("#include ");
+includes.addCustom("#define LIBO_USE_SOURCE_LOCATION 
std::experimental");
+includes.addCustom("#endif");
 includes.addCustom("#endif");
 includes.addCustom("#if defined LIBO_USE_SOURCE_LOCATION");
-includes.addCustom("#include ");
 includes.addCustom("#include ");
 includes.addCustom("#endif");
 }
@@ -3059,7 +3062,7 @@ void ExceptionType::dumpHppFile(
 // default constructor
 out << "\ninline " << id_ << "::" << id_ << "(\n";
 out << "#if defined LIBO_USE_SOURCE_LOCATION\n";
-out << "std::experimental::source_location location\n";
+out << "LIBO_USE_SOURCE_LOCATION::source_location location\n";
 out << "#endif\n";
 out << ")\n";
 inc();
@@ -3114,7 +3117,7 @@ void ExceptionType::dumpHppFile(
 bFirst = false;
 }
 out << "\n#if defined LIBO_USE_SOURCE_LOCATION\n";
-out << "" << (bFirst ? "" : ", ") << 
"std::experimental::source_location location\n";
+out << "" << (bFirst ? "" : ", ") << 
"LIBO_USE_SOURCE_LOCATION::source_location location\n";
 out << "#endif\n";
 out << ")\n";
 inc();
@@ -3375,7 +3378,7 @@ void ExceptionType::dumpDeclaration(FileStream & out)
 // default constructor
 out << indent() << "inline CPPU_GCC_DLLPRIVATE " << id_ << "(\n";
 out << "#if defined LIBO_USE_SOURCE_LOCATION\n";
-out << "std::experimental::source_location location = 
std::experimental::source_location::current()\n";
+out << "LIBO_USE_SOURCE_LOCATION::source_location location = 
LIBO_USE_SOURCE_LOCATION::source_location::current()\n";
 out << "#endif\n\n";
 out << ");\n";
 
@@ -3393,7 +3396,7 @@ void ExceptionType::dumpDeclaration(FileStream & out)
 bFirst = false;
 }
 out << "\n#if defined LIBO_USE_SOURCE_LOCATION\n";
-out << ", std::experimental::source_location location = 
std::experimental::source_location::current()\n";
+out << ", LIBO_USE_SOURCE_LOCATION::source_location location = 
LIBO_USE_SOURCE_LOCATION::source_location::current()\n";
 out << "#endif\n";
 out << ");\n\n";
 }
diff --git a/include/comphelper/errcode.hxx b/include/comphelper/errcode.hxx
index 3d3773fadf50..567400f101f8 100644
--- a/include/comphelper/errcode.hxx
+++ b/include/comphelper/errcode.hxx
@@ -24,12 +24,14 @@
 #include 
 #include 
 
-#if (defined DBG_UTIL) && ((defined __GNUC__ && !defined __clang__) || 
(defined __clang__ && __clang_major__ >= 9)) && 
__has_include()
-#define LIBO_ERRMSG_USE_SOURCE_LOCATION
-#endif
-
-#ifdef LIBO_ERRMSG_USE_SOURCE_LOCATION
+#if defined(DBG_UTIL)
+#if defined(__cpp_lib_source_location) && __cpp_lib_source_location >= 201907
+#include 
+#define LIBO_ERRMSG_USE_SOURCE_LOCATION std
+#elif __has_include()
 #include 
+#define LIBO_ERRMSG_USE_SOURCE_LOCATION std::experimental
+#endif

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

2023-09-26 Thread Sarper Akdemir (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

New commits:
commit da38a44b2839480cc333c18f312979d61324d6b9
Author: Sarper Akdemir 
AuthorDate: Mon Sep 25 09:26:01 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Tue Sep 26 08:51:50 2023 +0200

WASM: Embind: get rid of redundant EMSCRIPTEN conditional

As suggested by Stephan Bergmann in
https://gerrit.libreoffice.org/c/core/+/156273/comments/4087f8b8_8ab9a1bc

It appears whole thing was redundant since the template specialization of
emscripten::internal::raw_destructor in
codemaker/source/cppumaker/cpputype.cxx:1228.

Likely this bit causes memory leaks when the API is used and it is a
temporary workaround.

Change-Id: Ifb015754f16ddff1065b3285268acf8a339f975b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157234
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 124f323630bf..47b3d8f488a5 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -1208,23 +1208,20 @@ void InterfaceType::dumpDeclaration(FileStream & out)
 << ("static inline ::css::uno::Type const & SAL_CALL"
 " static_type(void * = 0);\n\n");
 dec();
-#ifdef EMSCRIPTEN
-out << "#ifndef EMSCRIPTEN\n";
-#endif
 out << "protected:\n";
 inc();
 out << indent() << "~" << id_
 << ("() SAL_NOEXCEPT {} // avoid warnings about virtual members and"
 " non-virtual dtor\n");
-#ifdef EMSCRIPTEN
-out << "#endif\n";
-#endif
 dec();
 out << "};\n\n";
 }
 
 void InterfaceType::dumpEmbindDeclaration(FileStream & out)
 {
+// TODO: This is a temporary workaround that likely causes the Embind UNO
+// bindings to leak memory. Reference counting and cloning mechanisms of
+// Embind should be investigated to figure out what exactly we need here.
 out << "namespace emscripten { namespace internal { \n"
"template<> void raw_destructor<" << 
codemaker::cpp::scopedCppName(u2b(name_))
 << ">(" << codemaker::cpp::scopedCppName(u2b(name_)) << "*){}\n"


[Libreoffice-commits] core.git: codemaker/source sal/qa sal/rtl

2023-09-24 Thread Stephan Bergmann (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx |6 ++
 sal/qa/rtl/oustring/rtl_OUString2.cxx   |   15 ---
 sal/rtl/ustring.cxx |   15 ---
 3 files changed, 2 insertions(+), 34 deletions(-)

New commits:
commit 414316a04fe9479dafcb36e3617ee1f5813c6a30
Author: Stephan Bergmann 
AuthorDate: Sun Sep 24 12:07:26 2023 +0300
Commit: Stephan Bergmann 
CommitDate: Sun Sep 24 17:32:22 2023 +0200

Drop some newly obsolete __clang_major__ version checks

...after 6ef2d358ac053ce0f6de9cf0f8f25e8bae66d441 "Adapt Clang and GCC 
minimum
version checks"

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

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index cb3422de16d0..124f323630bf 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3017,10 +3017,8 @@ void ExceptionType::dumpHdlFile(
 if (name_ == "com.sun.star.uno.Exception")
 {
 // LIBO_INTERNAL_ONLY implies GCC >= 7, which we need for this
-// Merely checking __has_include is not enough because some systems 
have the header,
-// but do not have a new enough Clang 9 supporting 
__builtin_FILE/LINE/FUNCTION as used by
-// that libstdc++ header.
-includes.addCustom("#if defined LIBO_INTERNAL_ONLY && ((defined 
__GNUC__ && !defined __clang__) || (defined __clang__ && __clang_major__ >= 9)) 
&& __has_include()");
+// libstdc++ header.
+includes.addCustom("#if defined LIBO_INTERNAL_ONLY && (defined 
__GNUC__ || defined __clang__) && 
__has_include()");
 includes.addCustom("#define LIBO_USE_SOURCE_LOCATION");
 includes.addCustom("#endif");
 includes.addCustom("#if defined LIBO_USE_SOURCE_LOCATION");
diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx 
b/sal/qa/rtl/oustring/rtl_OUString2.cxx
index b633af15626c..bff3a0d145f1 100644
--- a/sal/qa/rtl/oustring/rtl_OUString2.cxx
+++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx
@@ -38,23 +38,8 @@ namespace rtl_OUString
 
 namespace {
 
-// Avoid -fsanitize=undefined warning e.g. "runtime error: value 1e+99 is
-// outside the range of representable values of type 'float'" with Clang prior 
to
-// 

 "Treat the
-// range of representable values of floating-point types as [-inf, +inf] not 
as [-max, +max]"
-// (ENABLE_RUNTIME_OPTIMIZATIONS is an approximation for checking whether 
building is done without
-// -fsanitize=undefined):
 float doubleToFloat(double x) {
-#if !defined __clang__ || __clang_major__ >= 9 || ENABLE_RUNTIME_OPTIMIZATIONS
 return static_cast(x);
-#else
-return
-x < -std::numeric_limits::max()
-? -std::numeric_limits::infinity()
-: x > std::numeric_limits::max()
-? std::numeric_limits::infinity()
-: static_cast(x);
-#endif
 }
 
 }
diff --git a/sal/rtl/ustring.cxx b/sal/rtl/ustring.cxx
index ed039c4685da..6bc595b7f3bf 100644
--- a/sal/rtl/ustring.cxx
+++ b/sal/rtl/ustring.cxx
@@ -97,23 +97,8 @@ sal_Int32 SAL_CALL rtl_ustr_valueOfDouble(sal_Unicode * 
pStr, double d)
 
 namespace {
 
-// Avoid -fsanitize=undefined warning e.g. "runtime error: value 1e+99 is
-// outside the range of representable values of type 'float'" with Clang prior 
to
-// 

 "Treat the
-// range of representable values of floating-point types as [-inf, +inf] not 
as [-max, +max]"
-// (ENABLE_RUNTIME_OPTIMIZATIONS is an approximation for checking whether 
building is done without
-// -fsanitize=undefined):
 float doubleToFloat(double x) {
-#if !defined __clang__ || __clang_major__ >= 9 || ENABLE_RUNTIME_OPTIMIZATIONS
 return static_cast(x);
-#else
-return
-x < -std::numeric_limits::max()
-? -std::numeric_limits::infinity()
-: x > std::numeric_limits::max()
-? std::numeric_limits::infinity()
-: static_cast(x);
-#endif
 }
 
 }


[Libreoffice-commits] core.git: codemaker/source desktop/Executable_soffice_bin.mk solenv/gbuild static/README.wasm.md static/source

2023-09-18 Thread Sarper Akdemir (via logerrit)
 codemaker/source/cppumaker/cppuoptions.cxx |   18 +
 codemaker/source/cppumaker/cpputype.cxx|  250 +++--
 codemaker/source/cppumaker/cpputype.hxx|9 
 codemaker/source/cppumaker/dumputils.cxx   |   14 +
 codemaker/source/cppumaker/dumputils.hxx   |3 
 codemaker/source/cppumaker/includes.cxx|   19 -
 codemaker/source/cppumaker/includes.hxx|5 
 desktop/Executable_soffice_bin.mk  |5 
 solenv/gbuild/UnoApi.mk|   17 +
 solenv/gbuild/UnoApiTarget.mk  |   18 +
 solenv/gbuild/platform/unxgcc.mk   |   14 +
 static/README.wasm.md  |   39 +++
 static/source/unoembindhelpers/PrimaryBindings.cxx |  121 ++
 13 files changed, 505 insertions(+), 27 deletions(-)

New commits:
commit 841f898574affb526a516224d7c3db9b137ea62b
Author: Sarper Akdemir 
AuthorDate: Mon Aug 7 14:41:32 2023 +0300
Commit: Sarper Akdemir 
CommitDate: Mon Sep 18 19:59:57 2023 +0200

JavaScript uno bindings for WASM with Embind - first cut

A rough implementation of uno bindings for LOWA using embind.

Adds new parameter '-W' to cppumaker to generate _embind.cxx
files alongside .hdl & .hpp.

For usage examples see static/README.wasm.md

Change-Id: Iee5d05e37bfba8e101c08212b15c05f7f2fa6c33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156273
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir 

diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index 0a2ad962381a..f4ccf69b1ae7 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -216,6 +216,24 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 
 m_options["-G"] = OString();
 break;
+case 'W': // generate embind javascript bindings for LOWA
+if (av[i][2] != '\0')
+{
+OString tmp("'-W', please check");
+if (i <= ac - 1)
+{
+tmp += OString::Concat(" your input '") + av[i] + 
"'";
+}
+
+throw IllegalArgument(tmp);
+}
+
+if (!isValid("-C") && !isValid("-CS") && !isValid("-L"))
+{
+throw IllegalArgument("'-W' requires '-C' or '-CS' or 
'-L' option");
+}
+m_options["-W"] = OString();
+break;
 case 'X': // support for eXtra type rdbs
 {
 if (av[i][2] == '\0')
diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index bb8e3ed7d33c..cb3422de16d0 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -53,6 +53,8 @@
 namespace
 {
 
+using FileType = codemaker::cppumaker::FileType;
+
 bool isBootstrapType(OUString const & name)
 {
 static char const * const names[] = {
@@ -150,6 +152,17 @@ bool isBootstrapType(OUString const & name)
 return std::any_of(std::begin(names), std::end(names), pred);
 }
 
+OString getFileExtension(FileType eFileType)
+{
+switch(eFileType)
+{
+default:
+case FileType::HDL: return ".hdl";
+case FileType::HPP: return ".hpp";
+case FileType::EMBIND_CXX: return "_embind.cxx";
+}
+}
+
 class CppuType
 {
 public:
@@ -163,7 +176,7 @@ public:
 void dump(CppuOptions const & options);
 
 void dumpFile(
-std::u16string_view uri, std::u16string_view name, bool hpp,
+std::u16string_view uri, std::u16string_view name, FileType eFileType,
 CppuOptions const & options);
 
 void dumpDependedTypes(
@@ -176,6 +189,8 @@ public:
 
 virtual void dumpHppFile(FileStream& o, codemaker::cppumaker::Includes & 
includes) = 0;
 
+virtual void dumpEmbindCppFile(FileStream& o);
+
 OUString dumpHeaderDefine(FileStream& o, std::u16string_view extension) 
const;
 
 void dumpGetCppuType(FileStream & out);
@@ -226,6 +241,8 @@ protected:
 assert(false);// this cannot happen
 }
 
+virtual void dumpEmbindDeclaration(FileStream &) {};
+
 virtual void dumpFiles(OUString const & uri, CppuOptions const & options);
 
 virtual void addLightGetCppuTypeIncludes(
@@ -305,8 +322,10 @@ const
 
 void CppuType::dumpFiles(OUString const & uri, CppuOptions const & options)
 {
-dumpFile(uri, name_, false, options);
-dumpFile(uri, name_, true, options);
+dumpFile(uri, name_, FileType::HDL, options);
+dumpFile(uri, name_, FileType::HPP, options);
+if(options.isValid("-W"))
+dumpFile(uri, name_, FileType::EMBIND_CXX, options);
 }
 
 void 

[Libreoffice-commits] core.git: codemaker/source cppu/qa stoc/CppunitTest_stoc_dump.mk stoc/Library_reflection.mk stoc/Module_stoc.mk stoc/source stoc/test udkapi/com udkapi/UnoApi_udkapi.mk

2023-03-22 Thread Stephan Bergmann (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx |  159 --
 cppu/qa/cppumaker/test_cppumaker.cxx|   32 --
 stoc/CppunitTest_stoc_dump.mk   |   33 ++
 stoc/Library_reflection.mk  |1 
 stoc/Module_stoc.mk |1 
 stoc/source/corereflection/dump.cxx |  358 
 stoc/source/corereflection/reflection.component |5 
 stoc/test/dump.cxx  |  152 ++
 stoc/test/dump.idl  |   85 +
 udkapi/UnoApi_udkapi.mk |2 
 udkapi/com/sun/star/reflection/Dump.idl |   22 +
 udkapi/com/sun/star/reflection/XDump.idl|   58 +++
 12 files changed, 717 insertions(+), 191 deletions(-)

New commits:
commit 9111536f1bbaed489ed3ed36315e05d4b3940f5b
Author: Stephan Bergmann 
AuthorDate: Tue Mar 21 23:16:35 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Mar 22 08:46:35 2023 +

Introduce css.reflection.Dump singleton

...and revert e1c6f36d8bcc0799281e3a7e244175f682d97cb2 "Add a to_string()
function to the code generated for UNO IDL constant groups".  (But keep the
constants groups the latter had added to cppu/qa/cppumaker/types.idl, and 
use
them in the newly added CppunitTest_stoc_dump, for better or worse.)

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

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index c4ccbbb7ad0c..bb8e3ed7d33c 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -21,7 +21,6 @@
 #include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -1661,7 +1660,6 @@ void ConstantGroup::dumpHdlFile(
 OUString headerDefine(dumpHeaderDefine(out, u"HDL"));
 out << "\n";
 addDefaultHIncludes(includes);
-includes.addRtlUstringHxx();
 includes.dump(out, nullptr, true);
 out << "\n";
 if (codemaker::cppumaker::dumpNamespaceOpen(out, name_, true)) {
@@ -1687,10 +1685,6 @@ void ConstantGroup::dumpHppFile(
 
 void ConstantGroup::dumpDeclaration(FileStream & out)
 {
-unoidl::ConstantValue::Type largestType = 
unoidl::ConstantValue::TYPE_BOOLEAN;
-OUString largestTypeName = "sal_Bool";
-bool haveFloatingPoint = false;
-
 for (const unoidl::ConstantGroupEntity::Member& member : 
entity_->getMembers()) {
 out << "static const ";
 switch (member.value.type) {
@@ -1699,60 +1693,30 @@ void ConstantGroup::dumpDeclaration(FileStream & out)
 break;
 case unoidl::ConstantValue::TYPE_BYTE:
 out << "::sal_Int8";
-if (largestType < unoidl::ConstantValue::TYPE_BYTE) {
-largestType = unoidl::ConstantValue::TYPE_BYTE;
-largestTypeName = "sal_Int8";
-}
 break;
 case unoidl::ConstantValue::TYPE_SHORT:
 out << "::sal_Int16";
-if (largestType < unoidl::ConstantValue::TYPE_SHORT) {
-largestType = unoidl::ConstantValue::TYPE_SHORT;
-largestTypeName = "sal_Int16";
-}
 break;
 case unoidl::ConstantValue::TYPE_UNSIGNED_SHORT:
 out << "::sal_uInt16";
-if (largestType < unoidl::ConstantValue::TYPE_UNSIGNED_SHORT) {
-largestType = unoidl::ConstantValue::TYPE_UNSIGNED_SHORT;
-largestTypeName = "sal_uInt16";
-}
 break;
 case unoidl::ConstantValue::TYPE_LONG:
 out << "::sal_Int32";
-if (largestType < unoidl::ConstantValue::TYPE_LONG) {
-largestType = unoidl::ConstantValue::TYPE_LONG;
-largestTypeName = "sal_Int32";
-}
 break;
 case unoidl::ConstantValue::TYPE_UNSIGNED_LONG:
 out << "::sal_uInt32";
-if (largestType < unoidl::ConstantValue::TYPE_UNSIGNED_LONG) {
-largestType = unoidl::ConstantValue::TYPE_UNSIGNED_LONG;
-largestTypeName = "sal_uInt32";
-}
 break;
 case unoidl::ConstantValue::TYPE_HYPER:
 out << "::sal_Int64";
-if (largestType < unoidl::ConstantValue::TYPE_HYPER) {
-largestType = unoidl::ConstantValue::TYPE_HYPER;
-largestTypeName = "sal_Int64";
-}
 break;
 case unoidl::ConstantValue::TYPE_UNSIGNED_HYPER:
 out << "::sal_uInt64";
-if (largestType < unoidl::ConstantValue::TYPE_UNSIGNED_HYPER) {
-largestType = unoidl::ConstantValue::TYPE_UNSIGNED_HYPER;
-largestTypeName = "sal_uInt64";
-}
 break;
 case unoidl::ConstantValue::TYPE_FLOAT:
 out << "float";
-  

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

2023-03-17 Thread Tor Lillqvist (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx |  159 
 cppu/qa/cppumaker/test_cppumaker.cxx|   32 ++
 cppu/qa/cppumaker/types.idl |   54 ++
 3 files changed, 245 insertions(+)

New commits:
commit e1c6f36d8bcc0799281e3a7e244175f682d97cb2
Author: Tor Lillqvist 
AuthorDate: Thu Mar 16 15:32:10 2023 +0200
Commit: Tor Lillqvist 
CommitDate: Fri Mar 17 11:46:36 2023 +

Add a to_string() function to the code generated for UNO IDL constant groups

If the inpt matches one of the constants exactly, the result is the
name of that constant. If the input matches some combination of
constant values that are single bits, the result is the sequence of
the names of those constants joined with plus signs.

For instance, if the IDL has:

constants Constants {
const byte BIT0 = 1;
const byte BIT1 = 2;
const byte BIT2 = 4;
const byte BIT3 = 8;
}

The result of Constants::to_string(5) is "BIT0+BIT2", and the result
of Constants::to_string(17) is "17".

I am sure there are corner cases that aren't handled as would be
intuitive, especially with types that include unsigned values.
Correspondingly, the semantics of the generated to_string() functions
is not formally defined.

Also add a unit test for the new functionality.

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

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index bb8e3ed7d33c..c4ccbbb7ad0c 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -21,6 +21,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1660,6 +1661,7 @@ void ConstantGroup::dumpHdlFile(
 OUString headerDefine(dumpHeaderDefine(out, u"HDL"));
 out << "\n";
 addDefaultHIncludes(includes);
+includes.addRtlUstringHxx();
 includes.dump(out, nullptr, true);
 out << "\n";
 if (codemaker::cppumaker::dumpNamespaceOpen(out, name_, true)) {
@@ -1685,6 +1687,10 @@ void ConstantGroup::dumpHppFile(
 
 void ConstantGroup::dumpDeclaration(FileStream & out)
 {
+unoidl::ConstantValue::Type largestType = 
unoidl::ConstantValue::TYPE_BOOLEAN;
+OUString largestTypeName = "sal_Bool";
+bool haveFloatingPoint = false;
+
 for (const unoidl::ConstantGroupEntity::Member& member : 
entity_->getMembers()) {
 out << "static const ";
 switch (member.value.type) {
@@ -1693,30 +1699,60 @@ void ConstantGroup::dumpDeclaration(FileStream & out)
 break;
 case unoidl::ConstantValue::TYPE_BYTE:
 out << "::sal_Int8";
+if (largestType < unoidl::ConstantValue::TYPE_BYTE) {
+largestType = unoidl::ConstantValue::TYPE_BYTE;
+largestTypeName = "sal_Int8";
+}
 break;
 case unoidl::ConstantValue::TYPE_SHORT:
 out << "::sal_Int16";
+if (largestType < unoidl::ConstantValue::TYPE_SHORT) {
+largestType = unoidl::ConstantValue::TYPE_SHORT;
+largestTypeName = "sal_Int16";
+}
 break;
 case unoidl::ConstantValue::TYPE_UNSIGNED_SHORT:
 out << "::sal_uInt16";
+if (largestType < unoidl::ConstantValue::TYPE_UNSIGNED_SHORT) {
+largestType = unoidl::ConstantValue::TYPE_UNSIGNED_SHORT;
+largestTypeName = "sal_uInt16";
+}
 break;
 case unoidl::ConstantValue::TYPE_LONG:
 out << "::sal_Int32";
+if (largestType < unoidl::ConstantValue::TYPE_LONG) {
+largestType = unoidl::ConstantValue::TYPE_LONG;
+largestTypeName = "sal_Int32";
+}
 break;
 case unoidl::ConstantValue::TYPE_UNSIGNED_LONG:
 out << "::sal_uInt32";
+if (largestType < unoidl::ConstantValue::TYPE_UNSIGNED_LONG) {
+largestType = unoidl::ConstantValue::TYPE_UNSIGNED_LONG;
+largestTypeName = "sal_uInt32";
+}
 break;
 case unoidl::ConstantValue::TYPE_HYPER:
 out << "::sal_Int64";
+if (largestType < unoidl::ConstantValue::TYPE_HYPER) {
+largestType = unoidl::ConstantValue::TYPE_HYPER;
+largestTypeName = "sal_Int64";
+}
 break;
 case unoidl::ConstantValue::TYPE_UNSIGNED_HYPER:
 out << "::sal_uInt64";
+if (largestType < unoidl::ConstantValue::TYPE_UNSIGNED_HYPER) {
+largestType = unoidl::ConstantValue::TYPE_UNSIGNED_HYPER;
+largestTypeName = "sal_uInt64";
+}
 break;
 case 

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

2022-12-05 Thread Stephan Bergmann (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx |2 +-
 sd/source/ui/inc/futext.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c08e5db055c9d34d3f0b0b9d2a192d7ebdcd9576
Author: Stephan Bergmann 
AuthorDate: Mon Dec 5 11:24:49 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Dec 5 21:59:45 2022 +

Make check for complete type more explicit

When 485c9d4f0e59e13e772da8f8a7975f0ddd77c33e "Clarify the use of
untools::WeakReference" introduced cppu::detail::isUnoInterfaceType and its 
use
in the requires-clause of unotools::WeakReference::get, its commit message
argued that while isUnoInterfaceType only works if the given type is 
complete,
that would already be taken care of via the use of std::is_convertible_v in 
the
implementation of unotools::WeakReference::get.  But while 
std::is_convertible_v
nominally requires its argument types to be complete (unless they are void, 
or
arrays of unknown bound), typical implementations like recent libc++ or
libstdc++ do not seem to enforce that (and just return false in such a 
case).

So better make isUnoInterfaceType explicitly require that the given type is
complete.  Which turned up one case where it isn't at the point where
unotools::WeakReference::get is called.  (And while the 
resulting
call to dynamic_cast(...) in the implementation of that 
function
would cause an error when SdrTextObj is not complete, compilers happened to
instantiate that template specialization only at the end of the TU, by which
time SdrTextObj happened to be a complete type in the TUs including that
sd/source/ui/inc/futext.hxx.  So all happened to work out OK.)

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

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 2c8f938e6bb1..bb8e3ed7d33c 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -1198,7 +1198,7 @@ void InterfaceType::dumpHppFile(
 if (name_ == "com.sun.star.uno.XInterface") {
 out << "template struct IsUnoInterfaceType: 
::std::false_type {};\n"
"template inline constexpr auto isUnoInterfaceType 
="
-   " IsUnoInterfaceType::value;\n";
+   " sizeof (T) && IsUnoInterfaceType::value;\n";
 }
 out << "template<> struct IsUnoInterfaceType<";
 dumpType(out, name_, false, false, true);
diff --git a/sd/source/ui/inc/futext.hxx b/sd/source/ui/inc/futext.hxx
index 310df1455af1..681597b4cd6d 100644
--- a/sd/source/ui/inc/futext.hxx
+++ b/sd/source/ui/inc/futext.hxx
@@ -20,9 +20,9 @@
 #pragma once
 
 #include "fuconstr.hxx"
+#include 
 #include 
 
-class SdrTextObj;
 class FontList;
 class OutlinerView;
 


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

2022-12-02 Thread Stephan Bergmann (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx |   12 ++--
 include/unotools/weakref.hxx|7 ++-
 2 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit 485c9d4f0e59e13e772da8f8a7975f0ddd77c33e
Author: Stephan Bergmann 
AuthorDate: Fri Dec 2 17:01:02 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Sat Dec 3 07:09:38 2022 +

Clarify the use of untools::WeakReference

...which had been introduced in 78040af9acea0ab681aa54ff23844b647bc9b4f3
"loplugin:refcounting in sc" as a variation on css::uno::WeakReference from
include/cppuhelper/weakref.hxx, but without giving much of a rationale.

And, at least for --with-latest-c++ builds using a capable C++20 compiler,
ensure that the given interface_type is such that the static_cast and
dynamic_cast in the implementation of unotools::WeakReference::get are 
actually
sound:  If interface_type could be a UNO interface type, that would imply 
that
the xInterface obtained from the underlying WeakReferenceHelper::get() 
could be
a proxy from the C++ UNO bridge, which could (a) be a proxy for only a 
subtype
of interface_type (e.g., just for XInterface), so that the static_cast 
would be
broken, and (b) be a proxy for which the vtable's RTTI slot is not set up 
(see
e.g. the ENABLE_RUNTIME_OPTIMIZATIONS code in
bridges::cpp_uno::shared::VtableFactory::initializeBlock in
bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx), so that the 
dynamic_cast
could crash.  (These issues can even happen when the given interface_type 
is a
C++ implementation class type, but the given object has been bridged over 
some
C++ to C++ UNO ("purpose") bridge, but lets leave it at that...)

This required adding some cppu::detail::isUnoInterfaceType predicate to the
include files generated by cppumaker, which can be useful in other places 
too.
(For the call to isUnoInterfaceType in the requires-clause of
unotools::WeakReference::get to give the correct answer, it 
is
important that interface_type is a complete type---i.e., the corresponding
codemaker-generated .hpp having been included if interface_type actually 
were a
UNO include type.  But that is already nicely required by the call to
std::is_convertible_v in the implementation of that function, anyway.)

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

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 03fcd033beca..2c8f938e6bb1 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -1184,7 +1184,7 @@ void InterfaceType::dumpHppFile(
 out << "\n";
 addDefaultHxxIncludes(includes);
 includes.dump(out, _, !(m_cppuTypeLeak || m_cppuTypeDynamic));
-out << "\n";
+out << "\n#if defined LIBO_INTERNAL_ONLY\n#include 
\n#endif\n\n";
 dumpGetCppuType(out);
 out << "\n::css::uno::Type const & "
 << codemaker::cpp::scopedCppName(u2b(name_))
@@ -1194,7 +1194,15 @@ void InterfaceType::dumpHppFile(
 dumpType(out, name_, false, false, true);
 out << " >::get();\n";
 dec();
-out << "}\n\n#endif // "<< headerDefine << "\n";
+out << "}\n\n#if defined LIBO_INTERNAL_ONLY\nnamespace cppu::detail {\n";
+if (name_ == "com.sun.star.uno.XInterface") {
+out << "template struct IsUnoInterfaceType: 
::std::false_type {};\n"
+   "template inline constexpr auto isUnoInterfaceType 
="
+   " IsUnoInterfaceType::value;\n";
+}
+out << "template<> struct IsUnoInterfaceType<";
+dumpType(out, name_, false, false, true);
+out << ">: ::std::true_type {};\n}\n#endif\n\n#endif // "<< headerDefine 
<< "\n";
 }
 
 void InterfaceType::dumpAttributes(FileStream & out) const
diff --git a/include/unotools/weakref.hxx b/include/unotools/weakref.hxx
index 554bd433b687..1d9b29f82e70 100644
--- a/include/unotools/weakref.hxx
+++ b/include/unotools/weakref.hxx
@@ -42,7 +42,9 @@ namespace unotools
 behind it *is* thread-safe, so multiple threads can have their own
 WeakReferences to the same XWeak object.
 
-@tparam interface_type type of interface
+@tparam interface_type Must be a C++ implementation class type, not a UNO 
interface type.  (See
+the C++20 requires-clause on the get member.  That clause is not put on 
the class as a whole to
+avoid overly tight requirements on when interface_type needs to be 
complete.)
 */
 template 
 class SAL_WARN_UNUSED WeakReference : public 
com::sun::star::uno::WeakReferenceHelper
@@ -113,6 +115,9 @@ public:
  @return hard reference or null, if the weakly referenced interface 
has gone
 */
 rtl::Reference SAL_CALL get() const
+#if __cplusplus >= 202002L
+requires(!cppu::detail::isUnoInterfaceType)

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

2022-05-18 Thread Noel Grandin (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx |   12 -
 codemaker/source/cppumaker/includes.cxx |5 ++-
 codemaker/source/cppumaker/includes.hxx |2 -
 codemaker/source/javamaker/javatype.cxx |   42 
 include/codemaker/exceptiontree.hxx |5 ++-
 include/codemaker/global.hxx|3 +-
 include/codemaker/options.hxx   |5 ++-
 7 files changed, 39 insertions(+), 35 deletions(-)

New commits:
commit 225328b1e3994fcd6b293f007fee10c27e98291e
Author: Noel Grandin 
AuthorDate: Wed May 18 11:52:59 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed May 18 14:08:28 2022 +0200

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

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

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index e5436c9049f5..03fcd033beca 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -152,8 +153,7 @@ bool isBootstrapType(OUString const & name)
 class CppuType
 {
 public:
-CppuType(
-OUString const & name, rtl::Reference< TypeManager > const & typeMgr);
+CppuType(OUString name, rtl::Reference< TypeManager > const & typeMgr);
 
 virtual ~CppuType() {}
 
@@ -273,12 +273,12 @@ private:
 };
 
 CppuType::CppuType(
-OUString const & name, rtl::Reference< TypeManager > const & typeMgr):
+OUString name, rtl::Reference< TypeManager > const & typeMgr):
 m_inheritedMemberCount(0)
 , m_cppuTypeLeak(false)
 , m_cppuTypeDynamic(true)
 , m_indentLength(0)
-, name_(name)
+, name_(std::move(name))
 , id_(name_.copy(name_.lastIndexOf('.') + 1))
 , m_typeMgr(typeMgr)
 , m_dependencies(typeMgr, name_)
@@ -1051,9 +1051,9 @@ class BaseOffset
 {
 public:
 BaseOffset(
-rtl::Reference< TypeManager > const & manager,
+rtl::Reference< TypeManager > manager,
 rtl::Reference< unoidl::InterfaceTypeEntity > const & entity):
-manager_(manager), offset_(0) {
+manager_(std::move(manager)), offset_(0) {
 calculateBases(entity);
 }
 BaseOffset(const BaseOffset&) = delete;
diff --git a/codemaker/source/cppumaker/includes.cxx 
b/codemaker/source/cppumaker/includes.cxx
index db7dae46bccc..9dacdf268265 100644
--- a/codemaker/source/cppumaker/includes.cxx
+++ b/codemaker/source/cppumaker/includes.cxx
@@ -33,14 +33,15 @@
 #include 
 #include 
 
+#include 
 #include 
 
 using codemaker::cppumaker::Includes;
 
 Includes::Includes(
-rtl::Reference< TypeManager > const & manager,
+rtl::Reference< TypeManager > manager,
 codemaker::cppumaker::Dependencies const & dependencies, bool hpp):
-m_manager(manager), m_map(dependencies.getMap()), m_hpp(hpp),
+m_manager(std::move(manager)), m_map(dependencies.getMap()), m_hpp(hpp),
 m_includeCassert(false),
 m_includeAny(dependencies.hasAnyDependency()), m_includeReference(false),
 m_includeSequence(dependencies.hasSequenceDependency()),
diff --git a/codemaker/source/cppumaker/includes.hxx 
b/codemaker/source/cppumaker/includes.hxx
index 0362c417ac2a..8cd830b4a731 100644
--- a/codemaker/source/cppumaker/includes.hxx
+++ b/codemaker/source/cppumaker/includes.hxx
@@ -33,7 +33,7 @@ namespace codemaker::cppumaker {
 class Includes {
 public:
 Includes(
-rtl::Reference< TypeManager > const & manager,
+rtl::Reference< TypeManager > manager,
 Dependencies const & dependencies, bool hpp);
 
 ~Includes();
diff --git a/codemaker/source/javamaker/javatype.cxx 
b/codemaker/source/javamaker/javatype.cxx
index 563506221721..3db9572e5c7c 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -320,7 +320,7 @@ SpecialType getFieldDescriptor(
 class MethodDescriptor {
 public:
 MethodDescriptor(
-rtl::Reference< TypeManager > const & manager,
+rtl::Reference< TypeManager > manager,
 std::set * dependencies, std::u16string_view returnType,
 SpecialType * specialReturnType,
 PolymorphicUnoType * polymorphicUnoType);
@@ -346,10 +346,10 @@ private:
 };
 
 MethodDescriptor::MethodDescriptor(
-rtl::Reference< TypeManager > const & manager, std::set * 
dependencies,
+rtl::Reference< TypeManager > manager, std::set * dependencies,
 std::u16string_view returnType, SpecialType * specialReturnType,
 PolymorphicUnoType * polymorphicUnoType):
-m_manager(manager), m_dependencies(dependencies), m_needsSignature(false)
+m_manager(std::move(manager)), m_dependencies(dependencies), 
m_needsSignature(false)
 {
 assert(dependencies != nullptr);
 m_descriptorStart.append('(');
@@ -400,20 +400,20 @@ public:
 
 // KIND_MEMBER:
 TypeInfo(
- 

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

2022-04-29 Thread Noel Grandin (via logerrit)
 codemaker/source/codemaker/unotype.cxx  |   20 ++--
 codemaker/source/cppumaker/includes.cxx |2 +-
 codemaker/source/cppumaker/includes.hxx |2 +-
 include/codemaker/unotype.hxx   |3 +--
 4 files changed, 13 insertions(+), 14 deletions(-)

New commits:
commit fa88fd0fc8434a4a6077dd80afcd47464669d907
Author: Noel Grandin 
AuthorDate: Fri Apr 29 09:30:29 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 29 11:12:54 2022 +0200

Revert "use more string_view in codemaker"

This reverts commit 9463550eabd0455c374c1369bc72388108baccad.

Reason for revert: The codemaker::UnoType::decompose was previously mostly 
returning the same OString it receives, so this change is likely a pessimisation

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

diff --git a/codemaker/source/codemaker/unotype.cxx 
b/codemaker/source/codemaker/unotype.cxx
index 2b8a2bfc6d1f..8c25ac8ae0dd 100644
--- a/codemaker/source/codemaker/unotype.cxx
+++ b/codemaker/source/codemaker/unotype.cxx
@@ -26,25 +26,25 @@
 
 
 OString codemaker::UnoType::decompose(
-std::string_view type, sal_Int32 * rank,
+OString const & type, sal_Int32 * rank,
 std::vector< OString > * arguments)
 {
-size_t len = type.size();
-size_t i = 0;
+sal_Int32 len = type.getLength();
+sal_Int32 i = 0;
 while (len - i > 1 && type[i + 1] == ']') {
 i += 2;
 }
 if (rank != nullptr) {
 *rank = i / 2;
 }
-size_t j = arguments == nullptr ? std::string_view::npos : type.find('<', 
i);
-if (j == std::string_view::npos) {
-return OString(type.substr(i));
+sal_Int32 j = arguments == nullptr ? -1 : type.indexOf('<', i);
+if (j < 0) {
+return type.copy(i);
 }
-size_t k = j;
+sal_Int32 k = j;
 do {
 ++k; // skip '<' or ','
-size_t l = k;
+sal_Int32 l = k;
 for (sal_Int32 level = 0; l != len; ++l) {
 char c = type[l];
 if (c == ',') {
@@ -60,11 +60,11 @@ OString codemaker::UnoType::decompose(
 --level;
 }
 }
-arguments->push_back(OString(type.substr(k, l - k)));
+arguments->push_back(type.copy(k, l - k));
 k = l;
 } while (k != len && type[k] != '>');
 OSL_ASSERT(k == len - 1 && type[k] == '>');
-return OString(type.substr(i, j - i));
+return type.copy(i, j - i);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/source/cppumaker/includes.cxx 
b/codemaker/source/cppumaker/includes.cxx
index 470d59ef3554..db7dae46bccc 100644
--- a/codemaker/source/cppumaker/includes.cxx
+++ b/codemaker/source/cppumaker/includes.cxx
@@ -68,7 +68,7 @@ Includes::Includes(
 Includes::~Includes()
 {}
 
-void Includes::add(std::string_view entityName) {
+void Includes::add(OString const & entityName) {
 sal_Int32 k;
 std::vector< OString > args;
 OUString n(b2u(codemaker::UnoType::decompose(entityName, , )));
diff --git a/codemaker/source/cppumaker/includes.hxx 
b/codemaker/source/cppumaker/includes.hxx
index 00c784408077..0362c417ac2a 100644
--- a/codemaker/source/cppumaker/includes.hxx
+++ b/codemaker/source/cppumaker/includes.hxx
@@ -38,7 +38,7 @@ public:
 
 ~Includes();
 
-void add(std::string_view entityName);
+void add(OString const & entityName);
 void addCassert() { m_includeCassert = true; }
 void addAny() { m_includeAny = true; }
 void addReference() { m_includeReference = true; }
diff --git a/include/codemaker/unotype.hxx b/include/codemaker/unotype.hxx
index 38c66f6441b8..606321873242 100644
--- a/include/codemaker/unotype.hxx
+++ b/include/codemaker/unotype.hxx
@@ -22,7 +22,6 @@
 
 #include 
 
-#include 
 #include 
 
 namespace rtl { class OString; }
@@ -79,7 +78,7 @@ namespace codemaker::UnoType {
@return the base part of the given type
  */
 rtl::OString decompose(
-std::string_view type, sal_Int32 * rank = nullptr,
+rtl::OString const & type, sal_Int32 * rank = nullptr,
 std::vector< rtl::OString > * arguments = nullptr);
 
 }


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

2022-04-27 Thread Noel Grandin (via logerrit)
 codemaker/source/codemaker/unotype.cxx  |   20 ++--
 codemaker/source/cppumaker/includes.cxx |2 +-
 codemaker/source/cppumaker/includes.hxx |2 +-
 include/codemaker/unotype.hxx   |3 ++-
 4 files changed, 14 insertions(+), 13 deletions(-)

New commits:
commit 9463550eabd0455c374c1369bc72388108baccad
Author: Noel Grandin 
AuthorDate: Wed Apr 27 14:26:06 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 27 16:45:41 2022 +0200

use more string_view in codemaker

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

diff --git a/codemaker/source/codemaker/unotype.cxx 
b/codemaker/source/codemaker/unotype.cxx
index 8c25ac8ae0dd..2b8a2bfc6d1f 100644
--- a/codemaker/source/codemaker/unotype.cxx
+++ b/codemaker/source/codemaker/unotype.cxx
@@ -26,25 +26,25 @@
 
 
 OString codemaker::UnoType::decompose(
-OString const & type, sal_Int32 * rank,
+std::string_view type, sal_Int32 * rank,
 std::vector< OString > * arguments)
 {
-sal_Int32 len = type.getLength();
-sal_Int32 i = 0;
+size_t len = type.size();
+size_t i = 0;
 while (len - i > 1 && type[i + 1] == ']') {
 i += 2;
 }
 if (rank != nullptr) {
 *rank = i / 2;
 }
-sal_Int32 j = arguments == nullptr ? -1 : type.indexOf('<', i);
-if (j < 0) {
-return type.copy(i);
+size_t j = arguments == nullptr ? std::string_view::npos : type.find('<', 
i);
+if (j == std::string_view::npos) {
+return OString(type.substr(i));
 }
-sal_Int32 k = j;
+size_t k = j;
 do {
 ++k; // skip '<' or ','
-sal_Int32 l = k;
+size_t l = k;
 for (sal_Int32 level = 0; l != len; ++l) {
 char c = type[l];
 if (c == ',') {
@@ -60,11 +60,11 @@ OString codemaker::UnoType::decompose(
 --level;
 }
 }
-arguments->push_back(type.copy(k, l - k));
+arguments->push_back(OString(type.substr(k, l - k)));
 k = l;
 } while (k != len && type[k] != '>');
 OSL_ASSERT(k == len - 1 && type[k] == '>');
-return type.copy(i, j - i);
+return OString(type.substr(i, j - i));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/source/cppumaker/includes.cxx 
b/codemaker/source/cppumaker/includes.cxx
index db7dae46bccc..470d59ef3554 100644
--- a/codemaker/source/cppumaker/includes.cxx
+++ b/codemaker/source/cppumaker/includes.cxx
@@ -68,7 +68,7 @@ Includes::Includes(
 Includes::~Includes()
 {}
 
-void Includes::add(OString const & entityName) {
+void Includes::add(std::string_view entityName) {
 sal_Int32 k;
 std::vector< OString > args;
 OUString n(b2u(codemaker::UnoType::decompose(entityName, , )));
diff --git a/codemaker/source/cppumaker/includes.hxx 
b/codemaker/source/cppumaker/includes.hxx
index 0362c417ac2a..00c784408077 100644
--- a/codemaker/source/cppumaker/includes.hxx
+++ b/codemaker/source/cppumaker/includes.hxx
@@ -38,7 +38,7 @@ public:
 
 ~Includes();
 
-void add(OString const & entityName);
+void add(std::string_view entityName);
 void addCassert() { m_includeCassert = true; }
 void addAny() { m_includeAny = true; }
 void addReference() { m_includeReference = true; }
diff --git a/include/codemaker/unotype.hxx b/include/codemaker/unotype.hxx
index 606321873242..38c66f6441b8 100644
--- a/include/codemaker/unotype.hxx
+++ b/include/codemaker/unotype.hxx
@@ -22,6 +22,7 @@
 
 #include 
 
+#include 
 #include 
 
 namespace rtl { class OString; }
@@ -78,7 +79,7 @@ namespace codemaker::UnoType {
@return the base part of the given type
  */
 rtl::OString decompose(
-rtl::OString const & type, sal_Int32 * rank = nullptr,
+std::string_view type, sal_Int32 * rank = nullptr,
 std::vector< rtl::OString > * arguments = nullptr);
 
 }


[Libreoffice-commits] core.git: codemaker/source cppuhelper/source include/codemaker include/unoidl unoidl/source

2022-04-22 Thread Noel Grandin (via logerrit)
 codemaker/source/codemaker/typemanager.cxx |8 
 cppuhelper/source/typemanager.cxx  |4 ++--
 cppuhelper/source/typemanager.hxx  |2 +-
 include/codemaker/typemanager.hxx  |4 ++--
 include/unoidl/unoidl.hxx  |8 
 unoidl/source/legacyprovider.cxx   |5 ++---
 unoidl/source/legacyprovider.hxx   |2 +-
 unoidl/source/sourcefileprovider.cxx   |5 ++---
 unoidl/source/sourcefileprovider.hxx   |2 +-
 unoidl/source/sourcetreeprovider.cxx   |3 +--
 unoidl/source/sourcetreeprovider.hxx   |2 +-
 unoidl/source/unoidl-read.cxx  |2 +-
 unoidl/source/unoidl-write.cxx |2 +-
 unoidl/source/unoidl.cxx   |7 +++
 unoidl/source/unoidlprovider.cxx   |   14 +++---
 unoidl/source/unoidlprovider.hxx   |2 +-
 16 files changed, 34 insertions(+), 38 deletions(-)

New commits:
commit 9820f11ad2b1ef32e5527eec519b0a7c766e2602
Author: Noel Grandin 
AuthorDate: Thu Apr 21 21:09:07 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 22 13:27:56 2022 +0200

address review comments on "use more string in unoidl.."

on
commit 2d9291b9433c9645b0870525211f74bfb1151555
Author: Noel Grandin 
Date:   Thu Apr 21 12:53:15 2022 +0200
use more string_view in unoidl,codemaker

Primarily reverting the findEntity call-chain to use OUString
instead of std::u16string_view.

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

diff --git a/codemaker/source/codemaker/typemanager.cxx 
b/codemaker/source/codemaker/typemanager.cxx
index c684d048782b..194840ca9d5b 100644
--- a/codemaker/source/codemaker/typemanager.cxx
+++ b/codemaker/source/codemaker/typemanager.cxx
@@ -33,15 +33,15 @@ TypeManager::TypeManager(): manager_(new unoidl::Manager) {}
 
 TypeManager::~TypeManager() {}
 
-void TypeManager::loadProvider(std::u16string_view uri, bool primary) {
+void TypeManager::loadProvider(OUString const & uri, bool primary) {
 rtl::Reference< unoidl::Provider > prov(manager_->addProvider(uri));
 if (primary) {
 primaryProviders_.push_back(prov);
 }
 }
 
-bool TypeManager::foundAtPrimaryProvider(std::u16string_view name) const {
-if (name.empty()) {
+bool TypeManager::foundAtPrimaryProvider(OUString const & name) const {
+if (name.isEmpty()) {
 return !primaryProviders_.empty();
 }
 for (const rtl::Reference< unoidl::Provider >& xProvider : 
primaryProviders_)
@@ -51,7 +51,7 @@ bool TypeManager::foundAtPrimaryProvider(std::u16string_view 
name) const {
 }
 }
 if (!manager_->findEntity(name).is()) {
-throw CannotDumpException(OUString::Concat("Unknown entity '") + name 
+ "'");
+throw CannotDumpException("Unknown entity '" + name + "'");
 }
 return false;
 }
diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index 0b19954f92d5..44105df033fa 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -2102,7 +2102,7 @@ css::uno::Any 
cppuhelper::TypeManager::getInstantiatedStruct(
 OUString const & name, sal_Int32 separator)
 {
 assert(name.indexOf('<') == separator && separator != -1);
-rtl::Reference< unoidl::Entity > ent(findEntity(name.subView(0, 
separator)));
+rtl::Reference< unoidl::Entity > ent(findEntity(name.copy(0, separator)));
 if (!ent.is()
 || (ent->getSort()
 != unoidl::Entity::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE))
@@ -2289,7 +2289,7 @@ css::uno::Any cppuhelper::TypeManager::getConstant(
 }
 
 rtl::Reference< unoidl::Entity > cppuhelper::TypeManager::findEntity(
-std::u16string_view name)
+OUString const & name)
 {
 try {
 return manager_->findEntity(name);
diff --git a/cppuhelper/source/typemanager.hxx 
b/cppuhelper/source/typemanager.hxx
index 615495ca7f80..28c193191267 100644
--- a/cppuhelper/source/typemanager.hxx
+++ b/cppuhelper/source/typemanager.hxx
@@ -115,7 +115,7 @@ private:
 rtl::Reference< unoidl::ConstantGroupEntity > const & entity,
 OUString const & member);
 
-rtl::Reference< unoidl::Entity > findEntity(std::u16string_view name);
+rtl::Reference< unoidl::Entity > findEntity(OUString const & name);
 
 rtl::Reference< unoidl::Manager > manager_;
 };
diff --git a/include/codemaker/typemanager.hxx 
b/include/codemaker/typemanager.hxx
index 0fa75caa359c..3e6f67fe4b3f 100644
--- a/include/codemaker/typemanager.hxx
+++ b/include/codemaker/typemanager.hxx
@@ -43,9 +43,9 @@ class TypeManager final : public 
salhelper::SimpleReferenceObject {
 public:
 TypeManager();
 
-void loadProvider(std::u16string_view uri, bool primary);
+void loadProvider(OUString const & uri, bool primary);
 
-bool 

[Libreoffice-commits] core.git: codemaker/source cppuhelper/source include/codemaker include/unoidl unoidl/source

2022-04-21 Thread Noel Grandin (via logerrit)
 codemaker/source/codemaker/typemanager.cxx |8 ++---
 cppuhelper/source/typemanager.cxx  |4 +-
 cppuhelper/source/typemanager.hxx  |2 -
 include/codemaker/typemanager.hxx  |4 +-
 include/unoidl/unoidl.hxx  |8 ++---
 unoidl/source/legacyprovider.cxx   |5 +--
 unoidl/source/legacyprovider.hxx   |2 -
 unoidl/source/sourcefileprovider.cxx   |5 +--
 unoidl/source/sourcefileprovider.hxx   |2 -
 unoidl/source/sourceprovider-parser.y  |4 +-
 unoidl/source/sourcetreeprovider.cxx   |3 +
 unoidl/source/sourcetreeprovider.hxx   |2 -
 unoidl/source/unoidl-read.cxx  |   44 ++---
 unoidl/source/unoidl-write.cxx |2 -
 unoidl/source/unoidl.cxx   |7 ++--
 unoidl/source/unoidlprovider.cxx   |   41 +--
 unoidl/source/unoidlprovider.hxx   |2 -
 17 files changed, 75 insertions(+), 70 deletions(-)

New commits:
commit 2d9291b9433c9645b0870525211f74bfb1151555
Author: Noel Grandin 
AuthorDate: Thu Apr 21 12:53:15 2022 +0200
Commit: Noel Grandin 
CommitDate: Thu Apr 21 13:53:26 2022 +0200

use more string_view in unoidl,codemaker

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

diff --git a/codemaker/source/codemaker/typemanager.cxx 
b/codemaker/source/codemaker/typemanager.cxx
index 194840ca9d5b..c684d048782b 100644
--- a/codemaker/source/codemaker/typemanager.cxx
+++ b/codemaker/source/codemaker/typemanager.cxx
@@ -33,15 +33,15 @@ TypeManager::TypeManager(): manager_(new unoidl::Manager) {}
 
 TypeManager::~TypeManager() {}
 
-void TypeManager::loadProvider(OUString const & uri, bool primary) {
+void TypeManager::loadProvider(std::u16string_view uri, bool primary) {
 rtl::Reference< unoidl::Provider > prov(manager_->addProvider(uri));
 if (primary) {
 primaryProviders_.push_back(prov);
 }
 }
 
-bool TypeManager::foundAtPrimaryProvider(OUString const & name) const {
-if (name.isEmpty()) {
+bool TypeManager::foundAtPrimaryProvider(std::u16string_view name) const {
+if (name.empty()) {
 return !primaryProviders_.empty();
 }
 for (const rtl::Reference< unoidl::Provider >& xProvider : 
primaryProviders_)
@@ -51,7 +51,7 @@ bool TypeManager::foundAtPrimaryProvider(OUString const & 
name) const {
 }
 }
 if (!manager_->findEntity(name).is()) {
-throw CannotDumpException("Unknown entity '" + name + "'");
+throw CannotDumpException(OUString::Concat("Unknown entity '") + name 
+ "'");
 }
 return false;
 }
diff --git a/cppuhelper/source/typemanager.cxx 
b/cppuhelper/source/typemanager.cxx
index 44105df033fa..0b19954f92d5 100644
--- a/cppuhelper/source/typemanager.cxx
+++ b/cppuhelper/source/typemanager.cxx
@@ -2102,7 +2102,7 @@ css::uno::Any 
cppuhelper::TypeManager::getInstantiatedStruct(
 OUString const & name, sal_Int32 separator)
 {
 assert(name.indexOf('<') == separator && separator != -1);
-rtl::Reference< unoidl::Entity > ent(findEntity(name.copy(0, separator)));
+rtl::Reference< unoidl::Entity > ent(findEntity(name.subView(0, 
separator)));
 if (!ent.is()
 || (ent->getSort()
 != unoidl::Entity::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE))
@@ -2289,7 +2289,7 @@ css::uno::Any cppuhelper::TypeManager::getConstant(
 }
 
 rtl::Reference< unoidl::Entity > cppuhelper::TypeManager::findEntity(
-OUString const & name)
+std::u16string_view name)
 {
 try {
 return manager_->findEntity(name);
diff --git a/cppuhelper/source/typemanager.hxx 
b/cppuhelper/source/typemanager.hxx
index 28c193191267..615495ca7f80 100644
--- a/cppuhelper/source/typemanager.hxx
+++ b/cppuhelper/source/typemanager.hxx
@@ -115,7 +115,7 @@ private:
 rtl::Reference< unoidl::ConstantGroupEntity > const & entity,
 OUString const & member);
 
-rtl::Reference< unoidl::Entity > findEntity(OUString const & name);
+rtl::Reference< unoidl::Entity > findEntity(std::u16string_view name);
 
 rtl::Reference< unoidl::Manager > manager_;
 };
diff --git a/include/codemaker/typemanager.hxx 
b/include/codemaker/typemanager.hxx
index 3e6f67fe4b3f..0fa75caa359c 100644
--- a/include/codemaker/typemanager.hxx
+++ b/include/codemaker/typemanager.hxx
@@ -43,9 +43,9 @@ class TypeManager final : public 
salhelper::SimpleReferenceObject {
 public:
 TypeManager();
 
-void loadProvider(OUString const & uri, bool primary);
+void loadProvider(std::u16string_view uri, bool primary);
 
-bool foundAtPrimaryProvider(OUString const & name) const;
+bool foundAtPrimaryProvider(std::u16string_view name) const;
 
 codemaker::UnoType::Sort getSort(
 OUString const & name, rtl::Reference< unoidl::Entity > * entity = 
nullptr,
diff --git 

[Libreoffice-commits] core.git: codemaker/source include/o3tl o3tl/qa sal/osl

2022-04-09 Thread Noel Grandin (via logerrit)
 codemaker/source/cppumaker/cppumaker.cxx |   13 ++-
 codemaker/source/cppumaker/dumputils.cxx |5 -
 codemaker/source/cppumaker/dumputils.hxx |2 
 codemaker/source/javamaker/javamaker.cxx |   13 ++-
 include/o3tl/string_view.hxx |   44 
 o3tl/qa/test-string_view.cxx |  107 +++
 sal/osl/all/debugbase.cxx|3 
 7 files changed, 171 insertions(+), 16 deletions(-)

New commits:
commit 2bf56582475179faa9d71573532a0d416cb64bfc
Author: Noel Grandin 
AuthorDate: Fri Apr 8 13:49:01 2022 +0200
Commit: Noel Grandin 
CommitDate: Sat Apr 9 09:08:56 2022 +0200

add a more complete o3tl::getToken

so we avoid OUString copying (mostly when doing stuff like parsing
numbers of out of strings)

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

diff --git a/codemaker/source/cppumaker/cppumaker.cxx 
b/codemaker/source/cppumaker/cppumaker.cxx
index 384e2b5aa079..b2556655b361 100644
--- a/codemaker/source/cppumaker/cppumaker.cxx
+++ b/codemaker/source/cppumaker/cppumaker.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "cppuoptions.hxx"
 #include "cpputype.hxx"
@@ -57,13 +58,13 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
 if (options.isValid("-T")) {
 OUString names(b2u(options.getOption("-T")));
 for (sal_Int32 i = 0; i != -1;) {
-OUString name(names.getToken(0, ';', i));
-if (!name.isEmpty()) {
+std::u16string_view name(o3tl::getToken(names, 0, ';', i));
+if (!name.empty()) {
 produce(
-(name == "*"
- ? ""
- : name.endsWith(".*")
- ? name.copy(0, name.getLength() - std::strlen(".*"))
+OUString(name == u"*"
+ ? u""
+ : o3tl::ends_with(name, u".*")
+ ? name.substr(0, name.size() - std::strlen(".*"))
  : name),
 typeMgr, generated, options);
 }
diff --git a/codemaker/source/cppumaker/dumputils.cxx 
b/codemaker/source/cppumaker/dumputils.cxx
index 8524b1962ce2..2a3e809e70f3 100644
--- a/codemaker/source/cppumaker/dumputils.cxx
+++ b/codemaker/source/cppumaker/dumputils.cxx
@@ -24,17 +24,18 @@
 
 #include 
 #include 
+#include 
 
 
 namespace codemaker::cppumaker {
 
 bool dumpNamespaceOpen(
-FileStream & out, OUString const & entityName, bool fullModuleType)
+FileStream & out, std::u16string_view entityName, bool fullModuleType)
 {
 bool bOutput = false;
 bool bFirst = true;
 for (sal_Int32 i = 0; i >= 0;) {
-OUString id(entityName.getToken(0, '.', i));
+std::u16string_view id(o3tl::getToken(entityName, 0, '.', i));
 if (fullModuleType || i >= 0) {
 if (!bFirst) {
 out << " ";
diff --git a/codemaker/source/cppumaker/dumputils.hxx 
b/codemaker/source/cppumaker/dumputils.hxx
index 2fcd708c43fb..24e5bae3bede 100644
--- a/codemaker/source/cppumaker/dumputils.hxx
+++ b/codemaker/source/cppumaker/dumputils.hxx
@@ -30,7 +30,7 @@ class FileStream;
 
 namespace codemaker::cppumaker
 {
-bool dumpNamespaceOpen(FileStream& out, rtl::OUString const& entityName, bool 
fullModuleType);
+bool dumpNamespaceOpen(FileStream& out, std::u16string_view entityName, bool 
fullModuleType);
 
 bool dumpNamespaceClose(FileStream& out, std::u16string_view entityName, bool 
fullModuleType);
 
diff --git a/codemaker/source/javamaker/javamaker.cxx 
b/codemaker/source/javamaker/javamaker.cxx
index 044292bf6b8f..ee376c8cc484 100644
--- a/codemaker/source/javamaker/javamaker.cxx
+++ b/codemaker/source/javamaker/javamaker.cxx
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "javaoptions.hxx"
 #include "javatype.hxx"
@@ -57,13 +58,13 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
 if (options.isValid("-T")) {
 OUString names(b2u(options.getOption("-T")));
 for (sal_Int32 i = 0; i != -1;) {
-OUString name(names.getToken(0, ';', i));
-if (!name.isEmpty()) {
+std::u16string_view name(o3tl::getToken(names, 0, ';', i));
+if (!name.empty()) {
 produce(
-(name == "*"
- ? ""
- : name.endsWith(".*")
- ? name.copy(0, name.getLength() - std::strlen(".*"))
+OUString(name == u"*"
+ ? u""
+ : o3tl::ends_with(name, u".*")
+ ? name.substr(0, name.size() - std::strlen(".*"))
  : name),
 typeMgr, 

[Libreoffice-commits] core.git: codemaker/source compilerplugins/clang configmgr/source svx/source unodevtools/source vcl/source writerfilter/source

2022-02-08 Thread Stephan Bergmann (via logerrit)
 codemaker/source/javamaker/javatype.cxx   |2 -
 compilerplugins/clang/stringview.cxx  |   24 --
 compilerplugins/clang/test/stringview.cxx |   14 ++
 configmgr/source/components.cxx   |2 -
 svx/source/svdraw/svdmrkv.cxx |2 -
 unodevtools/source/skeletonmaker/cppcompskeleton.cxx  |2 -
 vcl/source/filter/ipdf/pdfdocument.cxx|6 ++--
 writerfilter/source/rtftok/rtfdispatchdestination.cxx |5 +--
 writerfilter/source/rtftok/rtfdocumentimpl.cxx|2 -
 9 files changed, 41 insertions(+), 18 deletions(-)

New commits:
commit b01e0483ee14826057c42dfa58c3d6200a474791
Author: Stephan Bergmann 
AuthorDate: Mon Feb 7 23:21:27 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Feb 8 09:09:32 2022 +0100

Extend loplugin:stringview to O[U]StringBuffer::toString

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

diff --git a/codemaker/source/javamaker/javatype.cxx 
b/codemaker/source/javamaker/javatype.cxx
index c7c84a208b3a..2bd624299a30 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -328,7 +328,7 @@ public:
 
 OString getDescriptor() const;
 
-OString getSignature() const { return m_needsSignature ? 
m_signatureStart.toString() + m_signatureEnd : OString();}
+OString getSignature() const { return m_needsSignature ? m_signatureStart 
+ m_signatureEnd : OString();}
 
 private:
 rtl::Reference< TypeManager > m_manager;
diff --git a/compilerplugins/clang/stringview.cxx 
b/compilerplugins/clang/stringview.cxx
index b3a0323d2923..4c31c348b357 100644
--- a/compilerplugins/clang/stringview.cxx
+++ b/compilerplugins/clang/stringview.cxx
@@ -268,19 +268,29 @@ void StringView::handleCXXConstructExpr(CXXConstructExpr 
const* expr)
 
 void StringView::handleCXXMemberCallExpr(CXXMemberCallExpr const* expr)
 {
-auto const dc = 
loplugin::DeclCheck(expr->getMethodDecl()).Function("copy");
-if (!dc)
+auto const dc1 = loplugin::DeclCheck(expr->getMethodDecl());
+if (auto const dc2 = dc1.Function("copy"))
 {
+if (dc2.Class("OString").Namespace("rtl").GlobalNamespace()
+|| dc2.Class("OUString").Namespace("rtl").GlobalNamespace())
+{
+report(DiagnosticsEngine::Warning, "rather than copy, pass with a 
view using subView()",
+   expr->getExprLoc())
+<< expr->getSourceRange();
+}
 return;
 }
-if (!(dc.Class("OString").Namespace("rtl").GlobalNamespace()
-  || dc.Class("OUString").Namespace("rtl").GlobalNamespace()))
+if (auto const dc2 = dc1.Function("toString"))
 {
+if (dc2.Class("OStringBuffer").Namespace("rtl").GlobalNamespace()
+|| dc2.Class("OUStringBuffer").Namespace("rtl").GlobalNamespace())
+{
+report(DiagnosticsEngine::Warning, "rather than call toString, 
pass with a view",
+   expr->getExprLoc())
+<< expr->getSourceRange();
+}
 return;
 }
-report(DiagnosticsEngine::Warning, "rather than copy, pass with a view 
using subView()",
-   expr->getExprLoc())
-<< expr->getSourceRange();
 }
 
 /** check for calls to O[U]StringBuffer::append that could be passed as a
diff --git a/compilerplugins/clang/test/stringview.cxx 
b/compilerplugins/clang/test/stringview.cxx
index c03fbb84cb32..16e294a6eeb7 100644
--- a/compilerplugins/clang/test/stringview.cxx
+++ b/compilerplugins/clang/test/stringview.cxx
@@ -59,6 +59,20 @@ void f1(OString s1)
 // expected-error@+1 {{rather than copy, pass with a view using subView() 
[loplugin:stringview]}}
 ConstructWithView(s1.copy(1));
 }
+void f1(OUStringBuffer s1)
+{
+// expected-error@+1 {{rather than call toString, pass with a view 
[loplugin:stringview]}}
+call_view(s1.toString());
+// expected-error@+1 {{rather than call toString, pass with a view 
[loplugin:stringview]}}
+ConstructWithView(s1.toString());
+}
+void f1(OStringBuffer s1)
+{
+// expected-error@+1 {{rather than call toString, pass with a view 
[loplugin:stringview]}}
+call_view(s1.toString());
+// expected-error@+1 {{rather than call toString, pass with a view 
[loplugin:stringview]}}
+ConstructWithView(s1.toString());
+}
 }
 
 namespace test2
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 65bc00da9517..3863103e2763 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -843,7 +843,7 @@ void Components::parseXcsXcuIniLayer(
 }
 }
 prefix.append(':');
-OUString urls(prefix.toString() + "SCHEMA}");
+OUString urls(prefix + "SCHEMA}");
 rtl::Bootstrap::expandMacros(urls);
 if (!urls.isEmpty()) {
   

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

2022-01-23 Thread Stephan Bergmann (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx |4 ++--
 tools/source/debug/debug.cxx|3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 162017cd9abd9c1ca63a6b671a084464b896e85c
Author: Stephan Bergmann 
AuthorDate: Sat Jan 22 18:20:05 2022 +0100
Commit: Stephan Bergmann 
CommitDate: Sun Jan 23 09:50:33 2022 +0100

Improve DBG_UNHANDLED_EXCEPTION output a bit

For example, in de3898aecb11307789644a1814e9cbb1ee4cc29b "Add missing test
dependency" it would have output

> warn:svx:680849:680849:svx/source/unodraw/unoshape.cxx:1779: 
DBG_UNHANDLED_EXCEPTION in setPropertyValues exception: 
com.sun.star.beans.UnknownPropertyException message: "URL at 
svx/source/unodraw/unoshape.cxx:1600"

rather than

> warn:svx:680849:680849:svx/source/unodraw/unoshape.cxx:1779: 
DBG_UNHANDLED_EXCEPTION in setPropertyValues exception: 
com.sun.star.beans.UnknownPropertyException message: URL 
svx/source/unodraw/unoshape.cxx:1600

making it slightly clearer that what follows "URL" is not the value of that 
URL
but rather the source location where the exception was thrown.

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

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index dab77fa42292..d64c79a36c2c 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -2871,7 +2871,7 @@ void ExceptionType::dumpHppFile(
 out << "\n#if defined LIBO_USE_SOURCE_LOCATION\n";
 out << "if (!Message.isEmpty())\n";
 out << "Message += \" \";\n";
-out << "Message += o3tl::runtimeToOUString(location.file_name()) + 
\":\" + OUString::number(location.line());\n";
+out << "Message += \"at \" + 
o3tl::runtimeToOUString(location.file_name()) + \":\" + 
OUString::number(location.line());\n";
 out << "#endif\n";
 }
 out << "}\n\n";
@@ -2924,7 +2924,7 @@ void ExceptionType::dumpHppFile(
 out << "\n#if defined LIBO_USE_SOURCE_LOCATION\n";
 out << "if (!Message.isEmpty())\n";
 out << "Message += \" \";\n";
-out << "Message += 
o3tl::runtimeToOUString(location.file_name()) + \":\" + 
OUString::number(location.line());\n";
+out << "Message += \"at \" + 
o3tl::runtimeToOUString(location.file_name()) + \":\" + 
OUString::number(location.line());\n";
 out << "#endif\n";
 }
 out << "}\n\n";
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index 82406a3624ff..167bd95639ec 100644
--- a/tools/source/debug/debug.cxx
+++ b/tools/source/debug/debug.cxx
@@ -105,8 +105,9 @@ static void exceptionToStringImpl(OStringBuffer& sMessage, 
const css::uno::Any &
 caught >>= exception;
 if ( !exception.Message.isEmpty() )
 {
-sMessage.append(" message: ");
+sMessage.append(" message: \"");
 sMessage.append(toOString(exception.Message));
+sMessage.append("\"");
 }
 /*  TODO FIXME (see https://gerrit.libreoffice.org/#/c/83245/)
 if ( exception.Context.is() )


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

2021-10-14 Thread Stephan Bergmann (via logerrit)
 codemaker/source/codemaker/global.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 900ba7d24e1bfa7e9a2abcb7cb410261f680155a
Author: Stephan Bergmann 
AuthorDate: Thu Oct 14 09:24:27 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Oct 14 10:42:31 2021 +0200

Use more appropriate type for OString-length related variable

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

diff --git a/codemaker/source/codemaker/global.cxx 
b/codemaker/source/codemaker/global.cxx
index 1b2b11db0f7e..6d831b45dca8 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -67,7 +67,7 @@ OString createFileNameFromType( const OString& destination,
 {
 OString type(typeName.replace('.', '/'));
 
-sal_uInt32 length = destination.getLength();
+sal_Int32 length = destination.getLength();
 
 bool bWithPoint = false;
 if (length == 0)


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

2021-06-26 Thread Arnaud Versini (via logerrit)
 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: codemaker/source

2021-05-18 Thread Stephan Bergmann (via logerrit)
 codemaker/source/codemaker/global.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2b3879c748adb8d48606339cecaf81a12c19f697
Author: Stephan Bergmann 
AuthorDate: Mon May 17 17:39:17 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Tue May 18 08:29:18 2021 +0200

Use implicit conversion from OStringBuffer to std::string_view

...instead of going via raw `char const *`.  (This changes the code's 
semantics
if buffer can contain embedded NULs, but it is unlikely that the original 
code
using getStr() was even meant to stop comparison at the first embedded NUL.)

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

diff --git a/codemaker/source/codemaker/global.cxx 
b/codemaker/source/codemaker/global.cxx
index e302d7c7742c..1b2b11db0f7e 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -119,7 +119,7 @@ OString createFileNameFromType( const OString& destination,
 if( nIndex == -1 )
 break;
 
-if (buffer.isEmpty() || std::string_view(".") == buffer.getStr())
+if (buffer.isEmpty() || std::string_view(".") == buffer)
 {
 buffer.append(token);
 continue;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-30 Thread Stephan Bergmann (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx |2 +-
 include/sal/types.h |   16 
 2 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 6a113a4f14808ac7f4bbdb4a5baff9383541d49a
Author: Stephan Bergmann 
AuthorDate: Fri Apr 30 13:23:07 2021 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Apr 30 22:46:39 2021 +0200

throw() -> noexcept, part 1/3: Manual scaffolding

The legacy `throw()` dynamic exception specification is gone for good from 
C++20
(even if compilers typically still accept it, but e.g. Clang has
-Wdeprecated-dynamic-exception-spec to at least warn about it).

Introduce SAL_NOEXCEPT for use in URE interface include files.  (For both 
the
existing SAL_THROW_EXTERN_C and the new SAL_NOEXCEPT, base usage of 
`noexept`
not on LIBO_INTERNAL_ONLY, but on the actual compiler C++ version, so that 
e.g.
building CppunitTest_cppu_any-external, which uses
gb_CppunitTest_set_external_code but not gb_CXX03FLAGS, will not potentially
complain about those macros expanding to the legacy `throw()`, like when
building with Clang -Wdeprecated-dynamic-exception-spec manually enabled.)

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

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 1ab587040b82..be1b2c2b5cc2 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -1173,7 +1173,7 @@ void InterfaceType::dumpDeclaration(FileStream & out)
 out << "protected:\n";
 inc();
 out << indent() << "~" << id_
-<< ("() throw () {} // avoid warnings about virtual members and"
+<< ("() SAL_NOEXCEPT {} // avoid warnings about virtual members and"
 " non-virtual dtor\n");
 dec();
 out << "};\n\n";
diff --git a/include/sal/types.h b/include/sal/types.h
index 7733920f20be..5fac8e8f9d3b 100644
--- a/include/sal/types.h
+++ b/include/sal/types.h
@@ -328,7 +328,11 @@ typedef struct _sal_Sequence
 This is a macro so it can expand to nothing in C code.
 */
 #if defined __cplusplus
+#if __cplusplus >= 201103L
+#define SAL_THROW_EXTERN_C() noexcept
+#else
 #define SAL_THROW_EXTERN_C() throw ()
+#endif
 #else
 #define SAL_THROW_EXTERN_C()
 #endif
@@ -400,6 +404,18 @@ namespace css = ::com::sun::star;
 #define SAL_CONSTEXPR
 #endif
 
+/** Macro for C++11 "noexcept" vs. "throw ()" exception specification.
+
+The latter has has been removed completely from C++20.
+
+@since LibreOffice 7.2
+ */
+#if __cplusplus >= 201103L
+#define SAL_NOEXCEPT noexcept
+#else
+#define SAL_NOEXCEPT throw ()
+#endif
+
 #endif /* __cplusplus */
 
 #ifdef __cplusplus
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-04-29 Thread Caolán McNamara (via logerrit)
 codemaker/source/cppumaker/cppumaker.cxx |1 +
 codemaker/source/javamaker/javamaker.cxx |1 +
 2 files changed, 2 insertions(+)

New commits:
commit b550d72293582e37112dcc1349e845a69bfe1414
Author: Caolán McNamara 
AuthorDate: Wed Apr 28 19:43:32 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 29 12:17:00 2021 +0200

cid#1473812 Untrusted value as argument

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

diff --git a/codemaker/source/cppumaker/cppumaker.cxx 
b/codemaker/source/cppumaker/cppumaker.cxx
index b1769eda87a6..384e2b5aa079 100644
--- a/codemaker/source/cppumaker/cppumaker.cxx
+++ b/codemaker/source/cppumaker/cppumaker.cxx
@@ -36,6 +36,7 @@
 #include "cppuoptions.hxx"
 #include "cpputype.hxx"
 
+// coverity[tainted_data] - this is a build time tool
 SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
 CppuOptions options;
 try {
diff --git a/codemaker/source/javamaker/javamaker.cxx 
b/codemaker/source/javamaker/javamaker.cxx
index 3a35be56a39b..044292bf6b8f 100644
--- a/codemaker/source/javamaker/javamaker.cxx
+++ b/codemaker/source/javamaker/javamaker.cxx
@@ -36,6 +36,7 @@
 #include "javaoptions.hxx"
 #include "javatype.hxx"
 
+// coverity[tainted_data] - this is a build time tool
 SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
 JavaOptions options;
 try {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: codemaker/source comphelper/source compilerplugins/clang extensions/source filter/source idlc/inc include/tools jvmfwk/source pyuno/source reportdesign/source sal/osl s

2021-04-21 Thread Noel Grandin (via logerrit)
 codemaker/source/cppumaker/cppuoptions.cxx   |   20 -
 codemaker/source/javamaker/javaoptions.cxx   |   12 ++---
 comphelper/source/misc/storagehelper.cxx |2 
 compilerplugins/clang/stringadd.cxx  |   15 +--
 compilerplugins/clang/test/stringadd.cxx |9 ++--
 extensions/source/update/check/updatecheckconfig.cxx |2 
 filter/source/msfilter/rtfutil.cxx   |2 
 idlc/inc/astsequence.hxx |2 
 include/tools/diagnose_ex.h  |8 +--
 jvmfwk/source/fwkbase.cxx|2 
 pyuno/source/module/pyuno_module.cxx |8 +--
 pyuno/source/module/pyuno_type.cxx   |2 
 reportdesign/source/core/misc/reportformula.cxx  |2 
 sal/osl/unx/file_misc.cxx|2 
 sal/osl/unx/pipe.cxx |4 -
 sal/qa/osl/file/osl_File.cxx |2 
 sc/qa/unit/subsequent_export-test.cxx|6 +-
 sc/qa/unit/ucalc_formula.cxx |6 +-
 sc/source/core/data/segmenttree.cxx  |4 -
 sc/source/filter/qpro/qproform.cxx   |2 
 sc/source/ui/vba/vbaeventshelper.cxx |8 +--
 sd/qa/unit/export-tests.cxx  |8 +--
 sdext/source/pdfimport/test/pdfunzip.cxx |4 -
 sfx2/source/control/msg.cxx  |2 
 sfx2/source/statbar/stbitem.cxx  |2 
 sfx2/source/view/lokhelper.cxx   |4 -
 shell/source/unix/exec/shellexec.cxx |2 
 svl/qa/unit/svl.cxx  |6 +-
 sw/qa/extras/globalfilter/globalfilter.cxx   |   39 +--
 sw/qa/extras/ooxmlexport/ooxmlexport11.cxx   |2 
 sw/qa/extras/uiwriter/uiwriter.cxx   |2 
 sw/qa/extras/uiwriter/uiwriter2.cxx  |4 -
 sw/qa/extras/ww8export/ww8export2.cxx|2 
 sw/qa/unit/swmodeltestbase.cxx   |4 -
 sw/source/core/crsr/bookmrk.cxx  |2 
 sw/source/core/fields/reffld.cxx |2 
 sw/source/filter/html/css1atr.cxx|2 
 sw/source/filter/html/htmlatr.cxx|4 -
 sw/source/filter/html/htmlforw.cxx   |8 +--
 sw/source/filter/html/htmlnumwriter.cxx  |2 
 sw/source/filter/html/wrthtml.cxx|5 --
 sw/source/uibase/wrtsh/wrtsh1.cxx|2 
 test/source/xmltesttools.cxx |   26 ++--
 unotest/source/cpp/macros_test.cxx   |2 
 vbahelper/source/vbahelper/vbacommandbarhelper.cxx   |2 
 vcl/qa/cppunit/complextext.cxx   |2 
 vcl/qt5/Qt5Instance.cxx  |4 -
 vcl/skia/salbmp.cxx  |8 +--
 vcl/unx/generic/fontmanager/fontconfig.cxx   |2 
 vcl/unx/generic/fontmanager/helper.cxx   |2 
 vcl/unx/generic/printer/printerinfomanager.cxx   |2 
 xmloff/source/text/txtfldi.cxx   |2 
 xmloff/source/text/txtvfldi.cxx  |4 -
 53 files changed, 146 insertions(+), 138 deletions(-)

New commits:
commit 7049328fb2d656d8454d4f704ad75d057e766c0b
Author: Noel Grandin 
AuthorDate: Tue Apr 20 21:07:42 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Apr 21 13:15:32 2021 +0200

loplugin:stringadd replace OUStringLiteral temporaries with OUString::Concat

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

diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index 90f16fdd3332..43376278b285 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -76,7 +76,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 OString tmp("'-O', please check");
 if (i <= ac - 1)
 {
-tmp += OStringLiteral(" your input '") + 
av[i+1] + "'";
+tmp += OString::Concat(" your input '") + 
av[i+1] + "'";
 }
 
 throw IllegalArgument(tmp);
@@ -92,7 +92,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 case 'n':
 if (av[i][2] != 'D' || av[i][3] != '\0')
 {
-OString tmp = OStringLiteral("'-nD', please check your 
input '") + av[i] + "'";
+OString tmp = OString::Concat("'-nD', 

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

2020-09-04 Thread George Bateman (via logerrit)
 codemaker/source/cppumaker/cppuoptions.hxx  |5 +
 codemaker/source/cppumaker/cpputype.hxx |5 +
 codemaker/source/cppumaker/dependencies.hxx |5 +
 codemaker/source/cppumaker/dumputils.hxx|5 +
 codemaker/source/cppumaker/includes.hxx |5 +
 codemaker/source/javamaker/classfile.hxx|5 +
 codemaker/source/javamaker/javaoptions.hxx  |5 +
 codemaker/source/javamaker/javatype.hxx |5 +
 8 files changed, 8 insertions(+), 32 deletions(-)

New commits:
commit ce73b526c459bf1ab15220fe78afae44cb436184
Author: George Bateman 
AuthorDate: Wed Aug 5 15:39:00 2020 +
Commit: Julien Nabet 
CommitDate: Fri Sep 4 11:13:46 2020 +0200

tdf#124176 Use #pragma once in codemaker

This commit was carried out by a Python script, source of which
is at https://bugs.documentfoundation.org/show_bug.cgi?id=124176#c97.

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

diff --git a/codemaker/source/cppumaker/cppuoptions.hxx 
b/codemaker/source/cppumaker/cppuoptions.hxx
index 16b7ca75f829..76dba06b1210 100644
--- a/codemaker/source/cppumaker/cppuoptions.hxx
+++ b/codemaker/source/cppumaker/cppuoptions.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_CPPUOPTIONS_HXX
-#define INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_CPPUOPTIONS_HXX
+#pragma once
 
 #include 
 
@@ -37,6 +36,4 @@ public:
 protected:
 };
 
-#endif // INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_CPPUOPTIONS_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/source/cppumaker/cpputype.hxx 
b/codemaker/source/cppumaker/cpputype.hxx
index 91226c0165e2..40fc94f26c29 100644
--- a/codemaker/source/cppumaker/cpputype.hxx
+++ b/codemaker/source/cppumaker/cpputype.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_CPPUTYPE_HXX
-#define INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_CPPUTYPE_HXX
+#pragma once
 
 #include 
 
@@ -33,6 +32,4 @@ void produce(
 OUString const & name, rtl::Reference< TypeManager > const & manager,
 codemaker::GeneratedTypeSet & generated, CppuOptions const & options);
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/source/cppumaker/dependencies.hxx 
b/codemaker/source/cppumaker/dependencies.hxx
index 2116404f60dc..9d805f382aae 100644
--- a/codemaker/source/cppumaker/dependencies.hxx
+++ b/codemaker/source/cppumaker/dependencies.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_DEPENDENCIES_HXX
-#define INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_DEPENDENCIES_HXX
+#pragma once
 
 #include 
 
@@ -123,6 +122,4 @@ private:
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/source/cppumaker/dumputils.hxx 
b/codemaker/source/cppumaker/dumputils.hxx
index c89b40df994b..965b64eda93f 100644
--- a/codemaker/source/cppumaker/dumputils.hxx
+++ b/codemaker/source/cppumaker/dumputils.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_DUMPUTILS_HXX
-#define INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_DUMPUTILS_HXX
+#pragma once
 
 #include 
 
@@ -37,6 +36,4 @@ void dumpTypeIdentifier(FileStream & out, rtl::OUString const 
& entityName);
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/source/cppumaker/includes.hxx 
b/codemaker/source/cppumaker/includes.hxx
index fb193233dea6..d8070217fe3b 100644
--- a/codemaker/source/cppumaker/includes.hxx
+++ b/codemaker/source/cppumaker/includes.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_INCLUDES_HXX
-#define INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_INCLUDES_HXX
+#pragma once
 
 #include 
 #include 
@@ -97,6 +96,4 @@ private:
 
 }
 
-#endif // INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_INCLUDES_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/source/javamaker/classfile.hxx 
b/codemaker/source/javamaker/classfile.hxx
index 9b8970748f9d..ebfef07820ee 100644
--- a/codemaker/source/javamaker/classfile.hxx
+++ b/codemaker/source/javamaker/classfile.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_CODEMAKER_SOURCE_JAVAMAKER_CLASSFILE_HXX
-#define INCLUDED_CODEMAKER_SOURCE_JAVAMAKER_CLASSFILE_HXX
+#pragma once
 
 #include 
 #include 
@@ -237,6 +236,4 @@ private:
 
 }
 
-#endif // INCLUDED_CODEMAKER_SOURCE_JAVAMAKER_CLASSFILE_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/codemaker/source/javamaker/javaoptions.hxx 

[Libreoffice-commits] core.git: codemaker/source compilerplugins/clang config_host/config_global.h.in configure.ac i18npool/source include/rtl sal/qa

2020-09-02 Thread Stephan Bergmann (via logerrit)
 codemaker/source/javamaker/javaoptions.cxx  |2 
 compilerplugins/clang/compat.hxx|   24 
 compilerplugins/clang/stringconcatliterals.cxx  |2 
 compilerplugins/clang/test/stringconcatliterals.cxx |2 
 compilerplugins/clang/unusedmember.cxx  |3 
 config_host/config_global.h.in  |4 
 configure.ac|   13 ++
 i18npool/source/breakiterator/breakiterator_unicode.cxx |2 
 include/rtl/string.hxx  |   90 +---
 sal/qa/rtl/digest/rtl_digest.cxx|   15 +-
 sal/qa/rtl/strings/test_ostring_concat.cxx  |   10 +
 sal/qa/rtl/textenc/rtl_textcvt.cxx  |2 
 12 files changed, 118 insertions(+), 51 deletions(-)

New commits:
commit 4b9e440c51be3e40326bc90c33ae69885bfb51e4
Author: Stephan Bergmann 
AuthorDate: Mon Aug 31 21:19:22 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Sep 2 08:12:04 2020 +0200

Turn OStringLiteral into a consteval'ed, static-refcound rtl_String

...from which an OString can cheaply be instantiated.

The one downside is that OStringLiteral now needs to be a template 
abstracting
over the string length.  But any uses for which that is a problem (e.g., as 
the
element type of a containers that would no longer be homogeneous, or in the
signature of a function that shall not be turned into a template for one 
reason
or another) can be replaced with std::string_view, without loss of 
efficiency
compared to the original OStringLiteral, and without loss of expressivity 
(esp.
with the newly introduced OString(std::string_view) ctor).

The new OStringLiteral ctor code would probably not be very efficient if it 
were
ever executed at runtime, but it is intended to be only executed at compile
time.  Where available, C++20 "consteval" is used to statically ensure that.

The intended use of the new OStringLiteral is in all cases where an
object that shall itself not be an OString (e.g., because it shall be a
global static variable for which the OString ctor/dtor would be detrimental 
at
library load/unload) must be converted to an OString instance in at least 
one
place.  Other string literal abstractions could use std::string_view (or 
just
plain char const[N]), but interestingly OStringLiteral might be more 
efficient
than constexpr std::string_view even for such cases, as it should not need 
any
relocations at library load time.  For now, no existing uses of 
OUStringLiteral
have been changed to some other abstraction (unless technically necessary as
discussed above), and no additional places that would benefit from
OUStringLiteral have been changed to use it.

sal/qa/rtl/strings/test_ostring_concat.cxx documents some workarounds for 
GCC
bug  "Failed class 
template
argument deduction in unevaluated, parenthesized context".  Those places, as
well as uses of OStringLiteral in 
incodemaker/source/javamaker/javaoptions.cxx
and i18npool/source/breakiterator/breakiterator_unicode.cxx, which have been
replaced with OString::Concat (and which is arguably a better choice, 
anyway),
also caused failures with at least Clang 5.0.2 (but would not have caused
failures with at least recent Clang 12 trunk, so appear to be bugs in Clang 
that
have meanwhile been fixed).

This change also revealed a bug in at least recent Clang 12 trunk
CastExpr::getSubExprAsWritten (still to be reported to LLVM), triggered at 
least
in some calls from loplugin code (for which it can be fixed for now in the
existing compat::getSubStringAsWritten).

A similar commit for OUStringLiteral is planned, too.

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

diff --git a/codemaker/source/javamaker/javaoptions.cxx 
b/codemaker/source/javamaker/javaoptions.cxx
index 31e43414c68c..c86f35e6cf15 100644
--- a/codemaker/source/javamaker/javaoptions.cxx
+++ b/codemaker/source/javamaker/javaoptions.cxx
@@ -86,7 +86,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 case 'n':
 if (av[i][2] != 'D' || av[i][3] != '\0')
 {
-OString tmp(OStringLiteral("'-nD', please check your 
input '") + av[i] + "'");
+OString tmp(OString::Concat("'-nD', please check your 
input '") + av[i] + "'");
 throw IllegalArgument(tmp);
 }
 
diff --git a/compilerplugins/clang/compat.hxx b/compilerplugins/clang/compat.hxx
index fb8791f978b4..70b462e54e4b 100644
--- a/compilerplugins/clang/compat.hxx

[Libreoffice-commits] core.git: codemaker/source connectivity/source i18npool/source idlc/source include/rtl oox/source opencl/source sal/qa sdext/source sfx2/source stoc/source svtools/source sw/sour

2020-08-30 Thread Stephan Bergmann (via logerrit)
 codemaker/source/javamaker/javatype.cxx   |2 
 connectivity/source/drivers/postgresql/pq_preparedstatement.cxx   |2 
 i18npool/source/breakiterator/breakiterator_unicode.cxx   |2 
 i18npool/source/breakiterator/xdictionary.cxx |4 
 i18npool/source/localedata/localedata.cxx |   10 -
 idlc/source/options.cxx   |5 
 include/rtl/strbuf.hxx|   19 +-
 include/rtl/string.hxx|   25 ++
 include/rtl/stringconcat.hxx  |   87 
--
 include/rtl/ustrbuf.hxx   |   19 +-
 include/rtl/ustring.hxx   |   25 ++
 oox/source/core/relationshandler.cxx  |6 
 opencl/source/openclwrapper.cxx   |2 
 sal/qa/rtl/strings/test_ostring_concat.cxx|   17 +
 sal/qa/rtl/strings/test_oustring_concat.cxx   |   18 +-
 sdext/source/pdfimport/sax/emitcontext.cxx|2 
 sfx2/source/appl/appuno.cxx   |4 
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx |2 
 svtools/source/svhtml/htmlout.cxx |2 
 sw/source/filter/html/htmlftn.cxx |2 
 tools/source/fsys/urlobj.cxx  |8 
 ucb/source/ucp/webdav/SerfPutReqProcImpl.cxx  |2 
 vcl/source/gdi/pdfwriter_impl.cxx |2 
 vcl/source/opengl/OpenGLHelper.cxx|2 
 24 files changed, 172 insertions(+), 97 deletions(-)

New commits:
commit 2e21240f23ac2191a3535d697a7308b29303c67c
Author: Stephan Bergmann 
AuthorDate: Fri Aug 28 17:14:50 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Sun Aug 30 20:42:56 2020 +0200

Goodbye O[U]StringView, welcome O[U]String::Concat

O[U]StringView had an odd mixture of uses.  For one, it was used like
std::[u16]string_view, for which directly using the latter std types is 
clearly
the better alternative.  For another, it was used in concatenation 
sequences,
when neither of the two leading terms were of our rtl string-related types.

For that second use case introduce O[U]String::Concat (as 
std::[u16]string_view
can obviously not be used, those not being one of our rtl string-related 
types).
Also, O[U]StringLiteral is occasionally used for this, but the planned 
changes
outlined in the 33ecd0d5c4fff9511a8436513936a3f7044a775a "Change 
OUStringLiteral
from char[] to char16_t[]" commit message will make that no longer work, so
O[U]String::Concat will be the preferred solution in such use cases going
forward, too.

O[U]StringView was also occasionally used to include O[U]StringBuffer 
values in
concatenation sequences, for which a more obvious alternative is to make
O[U]StringBuffer participate directly in the ToStringHelper/O[U]StringConcat
machinery.

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

diff --git a/codemaker/source/javamaker/javatype.cxx 
b/codemaker/source/javamaker/javatype.cxx
index f800d7365852..3fdf79abe300 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -379,7 +379,7 @@ void MethodDescriptor::addTypeParameter(OUString const & 
name) {
 }
 
 OString MethodDescriptor::getDescriptor() const {
-return rtl::OStringView(m_descriptorStart) + m_descriptorEnd;
+return m_descriptorStart + m_descriptorEnd;
 }
 
 
diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx 
b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
index 30d386a6cd3c..5c827b3bc0b7 100644
--- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
@@ -489,7 +489,7 @@ void PreparedStatement::setBytes(
 *this, OUString(), 1, Any() );
 }
 m_vars[parameterIndex-1]
-= "'" + rtl::OStringView(reinterpret_cast(escapedString.get()), len -1) + "'";
+= OString::Concat("'") + std::string_view(reinterpret_cast(escapedString.get()), len -1) + "'";
 }
 
 
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx 
b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index 7c79b99ec028..bb8d7d9862aa 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -199,7 +199,7 @@ void BreakIterator_Unicode::loadICUBreakIterator(const 
css::lang::Locale& rLocal
   

[Libreoffice-commits] core.git: codemaker/source stoc/test testtools/source

2020-05-18 Thread Noel Grandin (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx|   76 +++--
 codemaker/source/cppumaker/includes.cxx|2 
 codemaker/source/cppumaker/includes.hxx|4 +
 stoc/test/testiadapter.cxx |8 +--
 testtools/source/bridgetest/bridgetest.cxx |6 +-
 5 files changed, 83 insertions(+), 13 deletions(-)

New commits:
commit 1d0bc2139759f087d50432f8a2116060676f34e1
Author: Noel Grandin 
AuthorDate: Sat May 9 18:25:33 2020 +0200
Commit: Noel Grandin 
CommitDate: Mon May 18 08:35:44 2020 +0200

use std::experimental::source_location in uno::Exception

Clang and gcc have moved this out of experimental and into 
std::source_location,
but only in their very latest releases.

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

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 12c951205c54..e2288c961133 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -2750,6 +2750,9 @@ public:
 }
 
 private:
+virtual void dumpHdlFile(
+FileStream & out, codemaker::cppumaker::Includes & includes) override;
+
 virtual void dumpHppFile(
 FileStream & out, codemaker::cppumaker::Includes & includes) override;
 
@@ -2777,6 +2780,25 @@ private:
 rtl::Reference< unoidl::ExceptionTypeEntity > entity_;
 };
 
+void ExceptionType::dumpHdlFile(
+FileStream & out, codemaker::cppumaker::Includes & includes)
+{
+if (name_ == "com.sun.star.uno.Exception")
+{
+// LIBO_INTERNAL_ONLY implies GCC >= 7, which we need for this
+// Merely checking __has_include is not enough because some systems 
have the header,
+// but do not have a new enough clang for it to work.
+includes.addCustom("#if defined LIBO_INTERNAL_ONLY && ((defined 
__GNUC__ && !defined __clang__) || (defined __clang__ && __clang_major__ >= 8)) 
&& __has_include()");
+includes.addCustom("#define LIBO_USE_SOURCE_LOCATION");
+includes.addCustom("#endif");
+includes.addCustom("#if defined LIBO_USE_SOURCE_LOCATION");
+includes.addCustom("#include ");
+includes.addCustom("#include ");
+includes.addCustom("#endif");
+}
+dumpHFileContent(out, includes);
+}
+
 void ExceptionType::addComprehensiveGetCppuTypeIncludes(
 codemaker::cppumaker::Includes & includes) const
 {
@@ -2806,13 +2828,23 @@ void ExceptionType::dumpHppFile(
 if (codemaker::cppumaker::dumpNamespaceOpen(out, name_, false)) {
 out << "\n";
 }
-out << "\ninline " << id_ << "::" << id_ << "()\n";
+
+// default constructor
+out << "\ninline " << id_ << "::" << id_ << "(\n";
+out << "#if defined LIBO_USE_SOURCE_LOCATION\n";
+out << "std::experimental::source_location location\n";
+out << "#endif\n";
+out << ")\n";
 inc();
 OUString base(entity_->getDirectBase());
 bool bFirst = true;
 if (!base.isEmpty()) {
 out << indent() << ": " << codemaker::cpp::scopedCppName(u2b(base))
-<< "()\n";
+<< "(\n";
+out << "#if defined LIBO_USE_SOURCE_LOCATION\n";
+out << "location\n";
+out << "#endif\n";
+out << ")\n";
 bFirst = false;
 }
 for (const unoidl::ExceptionTypeEntity::Member& member : 
entity_->getDirectMembers()) {
@@ -2832,7 +2864,17 @@ void ExceptionType::dumpHppFile(
 } else {
 out << " ";
 }
+if (name_ == "com.sun.star.uno.Exception")
+{
+out << "\n#if defined LIBO_USE_SOURCE_LOCATION\n";
+out << "if (!Message.isEmpty())\n";
+out << "Message += \" \";\n";
+out << "Message += o3tl::runtimeToOUString(location.file_name()) + 
\":\" + OUString::number(location.line());\n";
+out << "#endif\n";
+}
 out << "}\n\n";
+
+// fields constructor
 if (!entity_->getDirectMembers().empty() || getInheritedMemberCount() > 0) 
{
 out << indent() << "inline " << id_ << "::" << id_ << "(";
 bFirst = !dumpBaseMembers(out, base, true, false);
@@ -2844,6 +2886,9 @@ void ExceptionType::dumpHppFile(
 out << " " << member.name << "_";
 bFirst = false;
 }
+out << "\n#if defined LIBO_USE_SOURCE_LOCATION\n";
+out << "" << (bFirst ? "" : ", ") << 
"std::experimental::source_location location\n";
+out << "#endif\n";
 out << ")\n";
 inc();
 bFirst = true;
@@ -2851,6 +2896,9 @@ void ExceptionType::dumpHppFile(
 out << indent() << ": " << codemaker::cpp::scopedCppName(u2b(base))
 << "(";
 dumpBaseMembers(out, base, false, false);
+out << "\n#if defined LIBO_USE_SOURCE_LOCATION\n";
+out << ", location\n";
+out << 

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

2020-04-18 Thread Noel Grandin (via logerrit)
 codemaker/source/codemaker/exceptiontree.cxx |   37 ++--
 codemaker/source/cppumaker/cpputype.cxx  |  204 +--
 codemaker/source/javamaker/javatype.cxx  |   94 ++--
 3 files changed, 170 insertions(+), 165 deletions(-)

New commits:
commit ed0097845a07b6129f4e56cd28b90ce9b9368cf5
Author: Noel Grandin 
AuthorDate: Sat Apr 18 11:37:53 2020 +0200
Commit: Noel Grandin 
CommitDate: Sat Apr 18 21:46:13 2020 +0200

loplugin:flatten in codemaker

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

diff --git a/codemaker/source/codemaker/exceptiontree.cxx 
b/codemaker/source/codemaker/exceptiontree.cxx
index b6c2aeee6f87..148f017b6877 100644
--- a/codemaker/source/codemaker/exceptiontree.cxx
+++ b/codemaker/source/codemaker/exceptiontree.cxx
@@ -63,27 +63,28 @@ void ExceptionTree::add(
 getDirectBase());
 assert(!n.isEmpty());
 }
-if (!bRuntimeException) {
-ExceptionTreeNode * node = _root;
-for (std::vector< OString >::reverse_iterator i(list.rbegin());
- !node->present; ++i)
+if (bRuntimeException)
+return;
+
+ExceptionTreeNode * node = _root;
+for (std::vector< OString >::reverse_iterator i(list.rbegin());
+ !node->present; ++i)
+{
+if (i == list.rend()) {
+node->setPresent();
+break;
+}
+for (ExceptionTreeNode::Children::iterator j(
+ node->children.begin());;
+ ++j)
 {
-if (i == list.rend()) {
-node->setPresent();
+if (j == node->children.end()) {
+node = node->add(*i);
 break;
 }
-for (ExceptionTreeNode::Children::iterator j(
- node->children.begin());;
- ++j)
-{
-if (j == node->children.end()) {
-node = node->add(*i);
-break;
-}
-if ((*j)->name == *i) {
-node = j->get();
-break;
-}
+if ((*j)->name == *i) {
+node = j->get();
+break;
 }
 }
 }
diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index dcec84ccdc3f..12c951205c54 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -1441,115 +1441,117 @@ void 
InterfaceType::addComprehensiveGetCppuTypeIncludes(
 
 void InterfaceType::dumpCppuAttributes(FileStream & out, sal_uInt32 & index)
 {
-if (!entity_->getDirectAttributes().empty()) {
-out << "\n" << indent()
-<< "typelib_InterfaceAttributeTypeDescription * pAttribute = 0;\n";
-std::vector< unoidl::InterfaceTypeEntity::Attribute >::size_type n = 0;
-for (const unoidl::InterfaceTypeEntity::Attribute& attr : 
entity_->getDirectAttributes()) {
-OUString type(resolveAllTypedefs(attr.type));
-out << indent() << "{\n";
-inc();
-out << indent() << "::rtl::OUString sAttributeType" << n << "( \""
-<< type << "\" );\n" << indent()
-<< "::rtl::OUString sAttributeName" << n << "( \"" << name_
-<< "::" << attr.name << "\" );\n";
-sal_Int32 getExcn = dumpExceptionTypeNames(
-out, "get", attr.getExceptions, false);
-sal_Int32 setExcn = dumpExceptionTypeNames(
-out, "set", attr.setExceptions, false);
-out << indent()
-<< ("typelib_typedescription_newExtendedInterfaceAttribute("
-" ,\n");
-inc();
-out << indent() << index++ << ", sAttributeName" << n
-<< ".pData,\n" << indent() << "(typelib_TypeClass)"
-<< getTypeClass(type) << ", sAttributeType" << n << ".pData,\n"
-<< indent() << "sal_" << (attr.readOnly ? "True" : "False")
-<< ", " << getExcn << ", "
-<< (getExcn == 0 ? "0" : "the_getExceptions") << ", " << 
setExcn
-<< ", " << (setExcn == 0 ? "0" : "the_setExceptions")
-<< " );\n";
-dec();
-out << indent()
-<< ("typelib_typedescription_register("
-" (typelib_TypeDescription**) );\n");
-dec();
-out << indent() << "}\n";
-++n;
-}
+if (entity_->getDirectAttributes().empty())
+return;
+
+out << "\n" << indent()
+<< "typelib_InterfaceAttributeTypeDescription * pAttribute = 0;\n";
+std::vector< unoidl::InterfaceTypeEntity::Attribute >::size_type n = 0;
+for (const 

[Libreoffice-commits] core.git: codemaker/source comphelper/source compilerplugins/clang cppu/source filter/source formula/source idlc/source io/source lotuswordpro/source sal/qa sc/source sfx2/source

2019-10-28 Thread Noel Grandin (via logerrit)
 codemaker/source/cppumaker/cppuoptions.cxx  |4 
 codemaker/source/javamaker/javaoptions.cxx  |4 
 comphelper/source/misc/backupfilehelper.cxx |3 
 compilerplugins/clang/stringadd.cxx |   59 ++---
 compilerplugins/clang/test/stringadd.cxx|   16 +-
 cppu/source/uno/EnvStack.cxx|3 
 filter/source/msfilter/msdffimp.cxx |4 
 formula/source/ui/dlg/funcutl.cxx   |3 
 idlc/source/options.cxx |7 -
 io/source/acceptor/acc_socket.cxx   |8 -
 io/source/connector/ctr_socket.cxx  |8 -
 lotuswordpro/source/filter/lwptblformula.cxx|6 
 lotuswordpro/source/filter/xfilter/xfdrawpath.cxx   |6 
 lotuswordpro/source/filter/xfilter/xfdrawpolygon.cxx|6 
 lotuswordpro/source/filter/xfilter/xfdrawpolyline.cxx   |6 
 sal/qa/osl/file/osl_File.cxx|   18 +-
 sc/source/ui/unoobj/cellvaluebinding.cxx|6 
 sfx2/source/control/request.cxx |4 
 sot/source/sdstor/ucbstorage.cxx|   10 -
 svl/qa/unit/svl.cxx |4 
 svx/source/dialog/hexcolorcontrol.cxx   |3 
 svx/source/form/fmcontrollayout.cxx |4 
 svx/source/form/fmtextcontrolshell.cxx  |6 
 svx/source/gallery2/galtheme.cxx|4 
 svx/source/svdraw/svdmrkv.cxx   |   17 +-
 sw/qa/extras/layout/layout.cxx  |7 -
 sw/qa/extras/rtfexport/rtfexport2.cxx   |3 
 sw/source/core/doc/dbgoutsw.cxx |   75 +---
 sw/source/filter/html/htmlnumwriter.cxx |3 
 sw/source/filter/xml/xmltexte.cxx   |3 
 sw/source/uibase/dbui/dbmgr.cxx |   22 +--
 ucb/source/ucp/ftp/ftpurl.cxx   |6 
 writerfilter/source/dmapper/OLEHandler.cxx  |3 
 xmlhelp/source/cxxhelp/provider/urlparameter.cxx|   10 -
 xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx |3 
 xmloff/source/draw/sdxmlexp.cxx |4 
 36 files changed, 177 insertions(+), 181 deletions(-)

New commits:
commit bc539bd3c04964471af6b5ca54264215c8995696
Author: Noel Grandin 
AuthorDate: Mon Oct 28 10:35:49 2019 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 28 12:07:54 2019 +0100

loplugin:stringadd improve detection

if one side of the expression is a compile-time-constant, we don't need
to worry about side-effects on the other side

Change-Id: Iee71ea51b327ef244bf39f128f921ac325d74e2b
Reviewed-on: https://gerrit.libreoffice.org/81589
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index 05c941b2c68a..90f16fdd3332 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -311,8 +311,8 @@ OString CppuOptions::prepareHelp()
 "-nD= no dependent types are generated.\n"
 "-G = generate only target files which does not exists.\n"
 "-Gc= generate only target files which content will be 
changed.\n"
-"-X   = extra types which will not be taken into account for 
generation.\n\n";
-help += prepareVersion();
+"-X   = extra types which will not be taken into account for 
generation.\n\n" +
+prepareVersion();
 
 return help;
 }
diff --git a/codemaker/source/javamaker/javaoptions.cxx 
b/codemaker/source/javamaker/javaoptions.cxx
index 795d1bbf8955..31e43414c68c 100644
--- a/codemaker/source/javamaker/javaoptions.cxx
+++ b/codemaker/source/javamaker/javaoptions.cxx
@@ -234,8 +234,8 @@ OString JavaOptions::prepareHelp()
 "-nD= no dependent types are generated.\n"
 "-G = generate only target files which does not exists.\n"
 "-Gc= generate only target files which content will be 
changed.\n"
-"-X   = extra types which will not be taken into account for 
generation.\n\n";
-help += prepareVersion();
+"-X   = extra types which will not be taken into account for 
generation.\n\n" +
+prepareVersion();
 
 return help;
 }
diff --git a/comphelper/source/misc/backupfilehelper.cxx 
b/comphelper/source/misc/backupfilehelper.cxx
index 749b9896cb0b..5421f1510ba4 100644
--- a/comphelper/source/misc/backupfilehelper.cxx
+++ b/comphelper/source/misc/backupfilehelper.cxx
@@ -1702,8 +1702,7 @@ namespace comphelper
 

[Libreoffice-commits] core.git: codemaker/source comphelper/qa comphelper/source editeng/source i18npool/qa i18npool/source idlc/source include/comphelper registry/source sax/qa sax/source tools/sourc

2019-10-23 Thread Noel Grandin (via logerrit)
 codemaker/source/commonjava/commonjava.cxx|2 
 codemaker/source/cppumaker/cpputype.cxx   |   55 --
 codemaker/source/javamaker/javatype.cxx   |   25 ++-
 comphelper/qa/unit/base64_test.cxx|   16 ---
 comphelper/source/misc/docpasswordhelper.cxx  |2 
 editeng/source/editeng/editdoc.cxx|2 
 editeng/source/editeng/impedit2.cxx   |2 
 i18npool/qa/cppunit/test_breakiterator.cxx|   16 +++
 i18npool/source/breakiterator/xdictionary.cxx |   10 ++--
 i18npool/source/collator/gencoll_rule.cxx |6 ++
 i18npool/source/indexentry/genindex_data.cxx  |3 -
 idlc/source/aststructinstance.cxx |3 -
 idlc/source/idlccompile.cxx   |   12 +
 idlc/source/idlcproduce.cxx   |2 
 include/comphelper/unwrapargs.hxx |   14 +++---
 registry/source/keyimpl.cxx   |3 -
 registry/source/regimpl.cxx   |2 
 sax/qa/cppunit/test_converter.cxx |6 +-
 sax/source/fastparser/fastparser.cxx  |3 -
 tools/source/ref/globname.cxx |2 
 xmloff/source/core/nmspmap.cxx|2 
 21 files changed, 123 insertions(+), 65 deletions(-)

New commits:
commit c68be56c295c8dda3043c80d4641575ec2799e55
Author: Noel Grandin 
AuthorDate: Thu Oct 17 20:33:50 2019 +0200
Commit: Noel Grandin 
CommitDate: Wed Oct 23 08:55:00 2019 +0200

size some stringbuffer to prevent re-alloc

Change-Id: I385587a922c555c320a45dcc6d644315b72510e9
Reviewed-on: https://gerrit.libreoffice.org/81278
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/commonjava/commonjava.cxx 
b/codemaker/source/commonjava/commonjava.cxx
index 955a0ba5e7cd..bdb1b02b63a7 100644
--- a/codemaker/source/commonjava/commonjava.cxx
+++ b/codemaker/source/commonjava/commonjava.cxx
@@ -39,7 +39,7 @@ namespace codemaker { namespace java {
 OString translateUnoToJavaType(
 codemaker::UnoType::Sort sort, OString const & nucleus, bool referenceType)
 {
-OStringBuffer buf;
+OStringBuffer buf(128);
 if (sort <= codemaker::UnoType::Sort::Any) {
 OString const 
javaTypes[static_cast(codemaker::UnoType::Sort::Any) + 1][2] = {
 { "void", "java/lang/Void" },
diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index a16256d4c353..dcec84ccdc3f 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -2400,6 +2400,28 @@ void PolyStructType::dumpLightGetCppuType(FileStream & 
out)
 << "static ::typelib_TypeDescriptionReference * the_type = 0;\n"
 << indent() << "if (the_type == 0) {\n";
 inc();
+
+out << "#ifdef LIBO_INTERNAL_ONLY\n";
+
+out << indent() << "::rtl::OString the_buffer = \"" << name_
+<< "<\" +\n";
+for (std::vector< OUString >::const_iterator i(
+ entity_->getTypeParameters().begin());
+ i != entity_->getTypeParameters().end();) {
+out << indent()
+<< ("::rtl::OUStringToOString("
+"::cppu::getTypeFavourChar(static_cast< ");
+dumpTypeParameterName(out, *i);
+out << " * >(0)).getTypeName(), RTL_TEXTENCODING_UTF8) +\n";
+++i;
+if (i != entity_->getTypeParameters().end()) {
+out << indent() << "\",\" +\n";
+}
+}
+out << indent() << "\">\";\n";
+
+out << "#else\n";
+
 out << indent() << "::rtl::OStringBuffer the_buffer(\"" << name_
 << "<\");\n";
 for (std::vector< OUString >::const_iterator i(
@@ -2415,9 +2437,14 @@ void PolyStructType::dumpLightGetCppuType(FileStream & 
out)
 out << indent() << "the_buffer.append(',');\n";
 }
 }
-out << indent() << "the_buffer.append('>');\n" << indent()
+out << indent() << "the_buffer.append('>');\n";
+
+out << "#endif\n";
+
+out << indent()
 << "::typelib_static_type_init(_type, " << getTypeClass(name_, 
true)
 << ", the_buffer.getStr());\n";
+
 dec();
 out << indent() << "}\n" << indent()
 << "return *reinterpret_cast< ::css::uno::Type * >(_type);\n";
@@ -2506,6 +2533,27 @@ void 
PolyStructType::dumpComprehensiveGetCppuType(FileStream & out)
 out << indent() << "::css::uno::Type * operator()() const\n"
 << indent() << "{\n";
 inc();
+
+out << "#ifdef LIBO_INTERNAL_ONLY\n";
+out << indent()
+<< "::rtl::OUString the_name =\n";
+out << indent() << "\"" << name_ << "<\" +\n";
+for (std::vector< OUString >::const_iterator i(
+ entity_->getTypeParameters().begin());
+ i != entity_->getTypeParameters().end();) {
+out << indent()
+<< "::cppu::getTypeFavourChar(static_cast< ";
+dumpTypeParameterName(out, *i);
+out << " * >(0)).getTypeName() +\n";
+++i;
+if (i != 

[Libreoffice-commits] core.git: codemaker/source configmgr/source desktop/source framework/source i18npool/source idl/source include/xmlreader sal/Module_sal.mk sal/osl sal/rtl stoc/source stoc/test s

2019-10-21 Thread Noel Grandin (via logerrit)
 codemaker/source/cppumaker/cpputype.cxx   |6 +-
 configmgr/source/childaccess.cxx  |2 
 configmgr/source/data.cxx |7 +-
 configmgr/source/xcsparser.cxx|2 
 configmgr/source/xcuparser.cxx|2 
 desktop/source/deployment/misc/dp_misc.cxx|4 -
 framework/source/accelerators/storageholder.cxx   |2 
 framework/source/fwi/classes/protocolhandlercache.cxx |   12 ++--
 framework/source/services/substitutepathvars.cxx  |2 
 framework/source/services/urltransformer.cxx  |2 
 framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx |   17 ++---
 framework/source/uiconfiguration/uiconfigurationmanager.cxx   |   17 ++---
 i18npool/source/localedata/localedata.cxx |   29 
--
 idl/source/cmptools/lex.cxx   |4 -
 idl/source/objects/object.cxx |3 -
 idl/source/objects/types.cxx  |2 
 idl/source/prj/database.cxx   |2 
 include/xmlreader/pad.hxx |2 
 sal/Module_sal.mk |1 
 sal/osl/unx/file_url.cxx  |9 +--
 sal/osl/unx/tempfile.cxx  |   12 ++--
 sal/rtl/bootstrap.cxx |6 +-
 sal/rtl/uri.cxx   |4 -
 stoc/source/inspect/introspection.cxx |2 
 stoc/source/uriproc/ExternalUriReferenceTranslator.cxx|4 -
 stoc/source/uriproc/UriReference.cxx  |2 
 stoc/source/uriproc/UriReferenceFactory.cxx   |7 +-
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx |9 +--
 stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx  |2 
 stoc/test/uriproc/test_uriproc.cxx|2 
 svl/source/numbers/zforlist.cxx   |   29 
--
 svl/source/numbers/zformat.cxx|4 -
 svx/source/gengal/gengal.cxx  |2 
 tools/source/fsys/urlobj.cxx  |   25 

 tools/source/inet/inetmime.cxx|4 -
 tools/source/misc/extendapplicationenvironment.cxx|2 
 ucb/source/core/ucb.cxx   |2 
 ucb/source/ucp/inc/urihelper.hxx  |2 
 ucb/source/ucp/webdav-neon/NeonUri.cxx|3 -
 unoidl/source/sourceprovider-parser.y |3 -
 unotools/source/config/pathoptions.cxx|2 
 vcl/source/window/syswin.cxx  |2 
 xmloff/source/draw/xexptran.cxx   |2 
 43 files changed, 131 insertions(+), 128 deletions(-)

New commits:
commit 0f874472c672175135520101837ff0c9d4701d7f
Author: Noel Grandin 
AuthorDate: Thu Oct 17 20:33:50 2019 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 21 08:36:01 2019 +0200

size some stringbuffer to prevent re-alloc

found by the simple expidient of putting asserts in
the resize routine. Where an explicit const size is used,
I started with 32 and kept doubling until that site
did not need resizing anymore.

Change-Id: I998787edc940d0a3ba23b5ac37131ab9ecd300f4
Reviewed-on: https://gerrit.libreoffice.org/81138
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 67b842f0c3d1..a16256d4c353 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -1004,7 +1004,7 @@ OUString CppuType::resolveAllTypedefs(OUString const & 
name) const
 u2b(dynamic_cast(*ent).getType()), ));
 k1 += k2; //TODO: overflow
 }
-OUStringBuffer b;
+OUStringBuffer b(k1*2 + n.getLength());
 for (sal_Int32 i = 0; i != k1; ++i) {
 b.append("[]");
 }
@@ -2675,7 +2675,7 @@ OUString typeToIdentifier(OUString const & name)
 {
 sal_Int32 k;
 OUString n(b2u(codemaker::UnoType::decompose(u2b(name), )));
-OUStringBuffer b;
+OUStringBuffer b(4*k + n.getLength());
 for (sal_Int32 i = 0; i != k; ++i) {
 b.append("seq_");
 }
@@ -3587,7 +3587,7 @@ void ServiceType::dumpHppFile(
 for (const 
unoidl::SingleInterfaceBasedServiceEntity::Constructor::Parameter& param :

[Libreoffice-commits] core.git: codemaker/source compilerplugins/clang connectivity/source dbaccess/source include/rtl sc/source sfx2/source uui/source vcl/workben

2019-10-17 Thread Noel Grandin (via logerrit)
 codemaker/source/javamaker/javatype.cxx   |4 --
 compilerplugins/clang/bufferadd.cxx   |   21 --
 compilerplugins/clang/test/bufferadd.cxx  |   18 
 connectivity/source/drivers/firebird/DatabaseMetaData.cxx |   16 --
 dbaccess/source/core/recovery/settingsimport.cxx  |3 --
 include/rtl/strbuf.hxx|7 
 include/rtl/ustrbuf.hxx   |7 
 sc/source/core/data/documen4.cxx  |9 ++
 sc/source/filter/excel/xecontent.cxx  |4 +-
 sfx2/source/view/lokhelper.cxx|   10 +++---
 uui/source/iahndl.cxx |9 +-
 vcl/workben/svpclient.cxx |8 ++---
 12 files changed, 58 insertions(+), 58 deletions(-)

New commits:
commit 3ebbb150242cf049a9ddab7f498c63f3a44aa034
Author: Noel Grandin 
AuthorDate: Thu Oct 17 15:14:02 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Oct 17 18:16:28 2019 +0200

loplugin:buffereadd find stuff involving adding *StringBuffer

and create conversion methods on *StringBuffer to make this work

Change-Id: I3cf5ee3e139826168894b46eff8ee4bcde00cb7e
Reviewed-on: https://gerrit.libreoffice.org/80949
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/javamaker/javatype.cxx 
b/codemaker/source/javamaker/javatype.cxx
index 28d6081e8c8b..0616d8f08771 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -378,9 +378,7 @@ void MethodDescriptor::addTypeParameter(OUString const & 
name) {
 }
 
 OString MethodDescriptor::getDescriptor() const {
-OStringBuffer buf(m_descriptorStart);
-buf.append(m_descriptorEnd);
-return buf.makeStringAndClear();
+return rtl::OStringView(m_descriptorStart) + m_descriptorEnd;
 }
 
 
diff --git a/compilerplugins/clang/bufferadd.cxx 
b/compilerplugins/clang/bufferadd.cxx
index 659b110403e3..4346e9ca28b2 100644
--- a/compilerplugins/clang/bufferadd.cxx
+++ b/compilerplugins/clang/bufferadd.cxx
@@ -175,19 +175,6 @@ void BufferAdd::findBufferAssignOrAdd(const Stmt* 
parentStmt, Stmt const* stmt)
 auto cxxConstructExpr = 
dyn_cast(ignore(varDeclLHS->getInit()));
 if (cxxConstructExpr)
 {
-if (cxxConstructExpr->getNumArgs() == 0)
-{
-addToGoodMap(varDeclLHS, parentStmt);
-return;
-}
-auto tc2 = 
loplugin::TypeCheck(cxxConstructExpr->getArg(0)->getType());
-if (tc2.LvalueReference().Class("OUStringBuffer")
-|| tc2.LvalueReference().Class("OStringBuffer")
-|| tc2.Class("OUStringBuffer") || 
tc2.Class("OStringBuffer"))
-{
-badMap.insert(varDeclLHS);
-return;
-}
 addToGoodMap(varDeclLHS, parentStmt);
 return;
 }
@@ -286,10 +273,6 @@ bool BufferAdd::isMethodOkToMerge(CXXMemberCallExpr const* 
memberCall)
 auto methodDecl = memberCall->getMethodDecl();
 if (methodDecl->getNumParams() == 0)
 return true;
-auto tc2 = loplugin::TypeCheck(methodDecl->getParamDecl(0)->getType());
-if (tc2.LvalueReference().Class("OUStringBuffer")
-|| tc2.LvalueReference().Class("OStringBuffer"))
-return false;
 
 auto name = methodDecl->getName();
 if (name == "appendUninitialized" || name == "setLength" || name == 
"remove" || name == "insert"
@@ -338,9 +321,7 @@ bool BufferAdd::isSideEffectFree(Expr const* expr)
 if (auto calleeMethodDecl = 
dyn_cast_or_null(callExpr->getCalleeDecl()))
 if (calleeMethodDecl && calleeMethodDecl->getIdentifier())
 {
-auto name = calleeMethodDecl->getName();
-if (callExpr->getNumArgs() > 0
-&& (name == "number" || name == "unacquired" || name == 
"boolean"))
+if (callExpr->getNumArgs() > 0)
 {
 auto tc = 
loplugin::TypeCheck(calleeMethodDecl->getParent());
 if (tc.Class("OUString") || tc.Class("OString"))
diff --git a/compilerplugins/clang/test/bufferadd.cxx 
b/compilerplugins/clang/test/bufferadd.cxx
index 7d8d9a693b9f..a9f28b13b55a 100644
--- a/compilerplugins/clang/test/bufferadd.cxx
+++ b/compilerplugins/clang/test/bufferadd.cxx
@@ -46,6 +46,24 @@ void f4(sal_Unicode const* pPathBegin)
 v.append(pPathBegin, 12);
 v.append("");
 }
+void f5(OUStringBuffer& input)
+{
+// expected-error@+1 {{convert this append sequence into a *String + 
sequence [loplugin:bufferadd]}}
+OUStringBuffer v(input);
+v.append("");
+}

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

2019-09-05 Thread Noel Grandin (via logerrit)
 codemaker/source/javamaker/classfile.cxx |4 ++--
 codemaker/source/javamaker/classfile.hxx |2 +-
 codemaker/source/javamaker/javatype.cxx  |   20 ++--
 3 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit cecbf4e87f6b9229d87b65d67575861ee61b0cdb
Author: Noel Grandin 
AuthorDate: Thu Sep 5 14:52:30 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Sep 5 16:54:20 2019 +0200

loplugin:useuniqueptr in ClassFile

Change-Id: I6ca5ae6f700747e726e531231b3a5cd1586c54d7
Reviewed-on: https://gerrit.libreoffice.org/78652
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/javamaker/classfile.cxx 
b/codemaker/source/javamaker/classfile.cxx
index bf5a02cd6ef4..67177a718529 100644
--- a/codemaker/source/javamaker/classfile.cxx
+++ b/codemaker/source/javamaker/classfile.cxx
@@ -479,8 +479,8 @@ ClassFile::ClassFile(
 
 ClassFile::~ClassFile() {}
 
-ClassFile::Code * ClassFile::newCode() {
-return new Code(*this);
+std::unique_ptr ClassFile::newCode() {
+return std::unique_ptr(new Code(*this));
 }
 
 sal_uInt16 ClassFile::addIntegerInfo(sal_Int32 value) {
diff --git a/codemaker/source/javamaker/classfile.hxx 
b/codemaker/source/javamaker/classfile.hxx
index 6f536802b50c..db6388a3e958 100644
--- a/codemaker/source/javamaker/classfile.hxx
+++ b/codemaker/source/javamaker/classfile.hxx
@@ -156,7 +156,7 @@ public:
 
 ~ClassFile();
 
-Code * newCode();
+std::unique_ptr newCode();
 
 sal_uInt16 addIntegerInfo(sal_Int32 value);
 sal_uInt16 addFloatInfo(float value);
diff --git a/codemaker/source/javamaker/javatype.cxx 
b/codemaker/source/javamaker/javatype.cxx
index 3130389e916b..28d6081e8c8b 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -718,7 +718,7 @@ void handleEnumType(
 ClassFile::ACC_PRIVATE,
 "", "(I)V", code.get(),
 std::vector< OString >(), "");
-code.reset(cf->newCode());
+code = cf->newCode();
 code->instrGetstatic(
 className,
 codemaker::convertString(entity->getMembers()[0].name),
@@ -730,7 +730,7 @@ void handleEnumType(
 ClassFile::ACC_PUBLIC | ClassFile::ACC_STATIC),
 "getDefault", "()" + classDescriptor,
 code.get(), std::vector< OString >(), "");
-code.reset(cf->newCode());
+code = cf->newCode();
 code->loadLocalInteger(0);
 std::map< sal_Int32, OString > map;
 sal_Int32 min = SAL_MAX_INT32;
@@ -793,7 +793,7 @@ void handleEnumType(
 ClassFile::ACC_PUBLIC | ClassFile::ACC_STATIC),
 "fromInt", "(I)" + classDescriptor, code.get(),
 std::vector< OString >(), "");
-code.reset(cf->newCode());
+code = cf->newCode();
 for (const unoidl::EnumTypeEntity::Member& member : entity->getMembers())
 {
 code->instrNew(className);
@@ -1405,7 +1405,7 @@ void handlePlainStructType(
 ClassFile::ACC_PUBLIC, "", "()V", code.get(),
 std::vector< OString >(), "");
 MethodDescriptor desc(manager, dependencies, "void", nullptr, nullptr);
-code.reset(cf->newCode());
+code = cf->newCode();
 code->loadLocalReference(0);
 sal_uInt16 index2 = 1;
 if (!entity->getDirectBase().isEmpty()) {
@@ -1495,7 +1495,7 @@ void handlePolyStructType(
 ClassFile::ACC_PUBLIC, "", "()V", code.get(),
 std::vector< OString >(), "");
 MethodDescriptor desc(manager, dependencies, "void", nullptr, nullptr);
-code.reset(cf->newCode());
+code = cf->newCode();
 code->loadLocalReference(0);
 sal_uInt16 index2 = 1;
 code->instrInvokespecial(
@@ -1632,7 +1632,7 @@ void handleExceptionType(
 
 
 // create (Throwable Cause) constructor
-code.reset(cf->newCode());
+code = cf->newCode();
 code->loadLocalReference(0);
 code->loadLocalReference(1);
 code->instrInvokespecial(superClass, "", "(Ljava/lang/Throwable;)V");
@@ -1663,7 +1663,7 @@ void handleExceptionType(
 std::vector< OString >(), "");
 
 // create (Throwable Cause, String Message) constructor
-code.reset(cf->newCode());
+code = cf->newCode();
 code->loadLocalReference(0);
 if (baseException || baseRuntimeException) {
 code->loadLocalReference(2);
@@ -1701,7 +1701,7 @@ void handleExceptionType(
 std::vector< OString >(), "");
 
 // create (String Message) constructor
-code.reset(cf->newCode());
+code = cf->newCode();
 code->loadLocalReference(0);
 code->loadLocalReference(1);
 code->instrInvokespecial(superClass, "", "(Ljava/lang/String;)V");
@@ -1734,7 +1734,7 @@ void handleExceptionType(
 
 // create (String Message, Object Context, T1 m1, ..., Tn mn) constructor
 MethodDescriptor desc1(manager, dependencies, "void", nullptr, nullptr);
-code.reset(cf->newCode());
+code = cf->newCode();
 code->loadLocalReference(0);
 sal_uInt16 index2 = 1;
 code->loadLocalReference(index2++);
@@ -1774,7 

[Libreoffice-commits] core.git: codemaker/source cui/source dbaccess/source lotuswordpro/source oox/source reportdesign/source sc/source sdext/source sfx2/source starmath/source sw/qa sw/source vcl/qa

2019-04-14 Thread Mike Kaganski (via logerrit)
 codemaker/source/codemaker/typemanager.cxx |3 -
 cui/source/tabpages/tppattern.cxx  |4 +
 dbaccess/source/ext/macromigration/macromigrationpages.cxx |4 +
 lotuswordpro/source/filter/lwpcelllayout.cxx   |1 
 lotuswordpro/source/filter/lwpfribsection.cxx  |4 -
 lotuswordpro/source/filter/lwprowlayout.cxx|1 
 lotuswordpro/source/filter/lwptablelayout.cxx  |   16 -
 oox/source/ole/vbacontrol.cxx  |2 
 oox/source/ppt/presentationfragmenthandler.cxx |1 
 reportdesign/source/ui/report/ReportController.cxx |2 
 sc/source/ui/app/scmod.cxx |3 -
 sc/source/ui/vba/vbarange.cxx  |1 
 sc/source/ui/view/tabvwsh4.cxx |1 
 sdext/source/pdfimport/tree/writertreevisiting.cxx |   17 +++---
 sfx2/source/dialog/templdlg.cxx|2 
 sfx2/source/doc/Metadatable.cxx|1 
 starmath/source/view.cxx   |7 +-
 sw/qa/extras/uiwriter/uiwriter.cxx |5 +
 sw/source/core/attr/swatrset.cxx   |5 +
 sw/source/core/docnode/section.cxx |4 +
 sw/source/core/txtnode/ndtxt.cxx   |1 
 sw/source/filter/xml/xmlimp.cxx|8 ++
 sw/source/uibase/uiview/srcview.cxx|   35 -
 sw/source/uibase/uno/unotxdoc.cxx  |3 +
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |1 
 vcl/source/gdi/print2.cxx  |2 
 vcl/source/graphic/UnoGraphicProvider.cxx  |2 
 vcl/workben/vcldemo.cxx|8 ++
 xmloff/source/draw/ximpshap.cxx|8 +-
 29 files changed, 103 insertions(+), 49 deletions(-)

New commits:
commit 0869895063bd528893707cb74c6cf4c461fef066
Author: Mike Kaganski 
AuthorDate: Sun Apr 14 13:58:14 2019 +0300
Commit: Mike Kaganski 
CommitDate: Sun Apr 14 14:14:36 2019 +0200

tdf#120703 PVS: Silence V522 warnings

V522 There might be dereferencing of a potential null pointer.

Change-Id: Ie4bc74a734a6d5a73838a27e0d80cc8e51595839
Reviewed-on: https://gerrit.libreoffice.org/70730
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/codemaker/source/codemaker/typemanager.cxx 
b/codemaker/source/codemaker/typemanager.cxx
index cf638f0ca4eb..12a00495ee56 100644
--- a/codemaker/source/codemaker/typemanager.cxx
+++ b/codemaker/source/codemaker/typemanager.cxx
@@ -220,8 +220,7 @@ codemaker::UnoType::Sort TypeManager::decompose(
 return s;
 case codemaker::UnoType::Sort::PolymorphicStructTemplate:
 if (args.size()
-!= (dynamic_cast<
-unoidl::PolymorphicStructTypeTemplateEntity * 
>(ent.get())->
+!= 
(dynamic_cast(*ent).
 getTypeParameters().size()))
 {
 throw CannotDumpException(
diff --git a/cui/source/tabpages/tppattern.cxx 
b/cui/source/tabpages/tppattern.cxx
index 0bb433f00c65..0a73dfdf3e52 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -392,7 +392,9 @@ IMPL_LINK_NOARG(SvxPatternTabPage, ClickAddHdl_Impl, 
weld::Button&, void)
 
 if(SfxItemState::SET == m_rOutAttrs.GetItemState(XATTR_FILLBITMAP, 
true, ))
 {
-pEntry.reset(new XBitmapEntry(dynamic_cast(pPoolItem)->GetGraphicObject(), aName));
+auto pFillBmpItem = dynamic_cast(pPoolItem);
+assert(pFillBmpItem);
+pEntry.reset(new 
XBitmapEntry(pFillBmpItem->GetGraphicObject(), aName));
 }
 else
 assert(!"SvxPatternTabPage::ClickAddHdl_Impl(), XBitmapEntry* 
pEntry == nullptr ?");
diff --git a/dbaccess/source/ext/macromigration/macromigrationpages.cxx 
b/dbaccess/source/ext/macromigration/macromigrationpages.cxx
index d4b84e5982e6..d2b19ed7608f 100644
--- a/dbaccess/source/ext/macromigration/macromigrationpages.cxx
+++ b/dbaccess/source/ext/macromigration/macromigrationpages.cxx
@@ -41,7 +41,9 @@ namespace dbmm
 
 MacroMigrationDialog& MacroMigrationPage::getDialog()
 {
-return *dynamic_cast< MacroMigrationDialog* >( GetParentDialog() );
+auto pDialog = dynamic_cast(GetParentDialog());
+assert(pDialog);
+return *pDialog;
 }
 
 // PreparationPage
diff --git a/lotuswordpro/source/filter/lwpcelllayout.cxx 
b/lotuswordpro/source/filter/lwpcelllayout.cxx
index 373656132adb..17f516a7897a 100644
--- a/lotuswordpro/source/filter/lwpcelllayout.cxx
+++ b/lotuswordpro/source/filter/lwpcelllayout.cxx
@@ -348,6 +348,7 @@ LwpPara* 

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

2019-04-13 Thread Noel Grandin (via logerrit)
 codemaker/source/cppumaker/cppuoptions.cxx  |3 +--
 codemaker/source/javamaker/javaoptions.cxx  |3 +--
 connectivity/source/commontools/RowFunctionParser.cxx   |4 +---
 connectivity/source/commontools/TIndexes.cxx|6 ++
 connectivity/source/commontools/TTableHelper.cxx|3 +--
 connectivity/source/commontools/dbtools2.cxx|6 ++
 connectivity/source/drivers/evoab2/NStatement.cxx   |3 +--
 connectivity/source/drivers/file/FDatabaseMetaData.cxx  |3 +--
 connectivity/source/drivers/firebird/DatabaseMetaData.cxx   |3 +--
 connectivity/source/drivers/firebird/StatementCommonBase.cxx|4 +---
 connectivity/source/drivers/jdbc/Timestamp.cxx  |9 
+++--
 connectivity/source/drivers/mork/MorkParser.cxx |6 ++
 connectivity/source/drivers/mysql_jdbc/YDriver.cxx  |3 +--
 connectivity/source/drivers/mysqlc/mysqlc_connection.cxx|6 ++
 connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx |3 +--
 connectivity/source/drivers/odbc/OResultSet.cxx |3 +--
 connectivity/source/drivers/odbc/OTools.cxx |6 ++
 connectivity/source/drivers/postgresql/pq_xindex.cxx|8 ++--
 connectivity/source/drivers/postgresql/pq_xkey.cxx  |8 ++--
 connectivity/source/drivers/postgresql/pq_xtable.cxx|8 ++--
 connectivity/source/drivers/postgresql/pq_xuser.cxx |4 +---
 connectivity/source/drivers/postgresql/pq_xview.cxx |4 +---
 22 files changed, 32 insertions(+), 74 deletions(-)

New commits:
commit ad4c8fed1b1b95fb502a011bb5fce5b8cb9d840d
Author: Noel Grandin 
AuthorDate: Thu Apr 11 14:38:08 2019 +0200
Commit: Noel Grandin 
CommitDate: Sat Apr 13 08:06:01 2019 +0200

loplugin:sequentialassign in codemaker..connectivity

Change-Id: I9776431ebce95a88ae42715aaba2ddc28fb52471
Reviewed-on: https://gerrit.libreoffice.org/70642
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index d9077dc43d7e..054e810ca084 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -124,8 +124,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 
 if (m_options.count("-T") > 0)
 {
-OString tmp(m_options["-T"]);
-tmp = tmp + ";" + s;
+OString tmp = m_options["-T"] + ";" + s;
 m_options["-T"] = tmp;
 }
 else
diff --git a/codemaker/source/javamaker/javaoptions.cxx 
b/codemaker/source/javamaker/javaoptions.cxx
index 2d583e51ac3f..6338e9472aa0 100644
--- a/codemaker/source/javamaker/javaoptions.cxx
+++ b/codemaker/source/javamaker/javaoptions.cxx
@@ -116,8 +116,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 
 if (m_options.count("-T") > 0)
 {
-OString tmp(m_options["-T"]);
-tmp = tmp + ";" + s;
+OString tmp = m_options["-T"] + ";" + s;
 m_options["-T"] = tmp;
 } else
 {
diff --git a/connectivity/source/commontools/RowFunctionParser.cxx 
b/connectivity/source/commontools/RowFunctionParser.cxx
index 0bf991deabd1..e93e7b01e424 100644
--- a/connectivity/source/commontools/RowFunctionParser.cxx
+++ b/connectivity/source/commontools/RowFunctionParser.cxx
@@ -411,11 +411,9 @@ std::shared_ptr const & 
FunctionParser::parseFunction( const OUS
 StringIteratorT aStart( rAsciiFunction.getStr() );
 StringIteratorT aEnd( rAsciiFunction.getStr()+rAsciiFunction.getLength() );
 
-ParserContextSharedPtr pContext;
-
 // static parser context, because the actual
 // Spirit parser is also a static object
-pContext = getParserContext();
+ParserContextSharedPtr pContext = getParserContext();
 
 ExpressionGrammar aExpressionGrammer( pContext );
 
diff --git a/connectivity/source/commontools/TIndexes.cxx 
b/connectivity/source/commontools/TIndexes.cxx
index 218bd441e907..a40d2c7fa5de 100644
--- a/connectivity/source/commontools/TIndexes.cxx
+++ b/connectivity/source/commontools/TIndexes.cxx
@@ -149,9 +149,8 @@ sdbcx::ObjectType OIndexesHelper::appendObject( const 
OUString& _rForName, const
 
 OUString aCatalog,aSchema,aTable;
 
dbtools::qualifiedNameComponents(m_pTable->getMetaData(),m_pTable->getName(),aCatalog,aSchema,aTable,::dbtools::EComposeRule::InDataManipulation);
-OUString aComposedName;
 
-aComposedName = 

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

2019-04-05 Thread Mike Kaganski (via logerrit)
 codemaker/source/codemaker/exceptiontree.cxx  |6 
 codemaker/source/codemaker/typemanager.cxx|4 
 codemaker/source/commoncpp/commoncpp.cxx  |3 
 codemaker/source/cppumaker/cppumaker.cxx  |2 
 codemaker/source/cppumaker/cpputype.cxx   |  128 +-
 codemaker/source/cppumaker/dependencies.cxx   |4 
 codemaker/source/cppumaker/includes.cxx   |   14 -
 codemaker/source/javamaker/javamaker.cxx  |2 
 codemaker/source/javamaker/javatype.cxx   |   10 -
 include/codemaker/typemanager.hxx |9 +
 unodevtools/source/skeletonmaker/cppcompskeleton.cxx  |   18 +-
 unodevtools/source/skeletonmaker/cpptypemaker.cxx |   59 
 unodevtools/source/skeletonmaker/javacompskeleton.cxx |   18 +-
 unodevtools/source/skeletonmaker/javatypemaker.cxx|   40 ++---
 unodevtools/source/skeletonmaker/skeletoncommon.cxx   |6 
 15 files changed, 167 insertions(+), 156 deletions(-)

New commits:
commit dacde2c0394d33a04bc9ad929df394465c14b093
Author: Mike Kaganski 
AuthorDate: Fri Apr 5 11:41:39 2019 +0100
Commit: Mike Kaganski 
CommitDate: Fri Apr 5 16:13:14 2019 +0200

Revert "Get rid of b2u/u2b helpers; use OUString's toUtf8/fromUtf8 instead"

This reverts commit 84662e9030a855c8db7cd40d9ce354b773d78c16.

Change-Id: I1cc98d3201390609ae3615baa8e92c926cdcde9a
Reviewed-on: https://gerrit.libreoffice.org/70294
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/codemaker/source/codemaker/exceptiontree.cxx 
b/codemaker/source/codemaker/exceptiontree.cxx
index 796f52671ce3..b6c2aeee6f87 100644
--- a/codemaker/source/codemaker/exceptiontree.cxx
+++ b/codemaker/source/codemaker/exceptiontree.cxx
@@ -55,10 +55,12 @@ void ExceptionTree::add(
 }
 list.push_back(n);
 rtl::Reference< unoidl::Entity > ent;
-codemaker::UnoType::Sort s = manager->getSort(OUString::fromUtf8(n), 
);
+codemaker::UnoType::Sort s = manager->getSort(b2u(n), );
 (void) s; // WaE: unused variable
 assert(s == codemaker::UnoType::Sort::Exception);
-n = 
static_cast(ent.get())->getDirectBase().toUtf8();
+n = u2b(
+static_cast< unoidl::ExceptionTypeEntity * >(ent.get())->
+getDirectBase());
 assert(!n.isEmpty());
 }
 if (!bRuntimeException) {
diff --git a/codemaker/source/codemaker/typemanager.cxx 
b/codemaker/source/codemaker/typemanager.cxx
index f723ee699948..cf638f0ca4eb 100644
--- a/codemaker/source/codemaker/typemanager.cxx
+++ b/codemaker/source/codemaker/typemanager.cxx
@@ -164,7 +164,7 @@ codemaker::UnoType::Sort TypeManager::decompose(
 {
 sal_Int32 k;
 std::vector< OString > args;
-OUString n = 
OUString::fromUtf8(codemaker::UnoType::decompose(name.toUtf8(), , ));
+OUString n = b2u(codemaker::UnoType::decompose(u2b(name), , ));
 for (;;) {
 rtl::Reference< unoidl::Entity > ent;
 codemaker::UnoType::Sort s = getSort(n, );
@@ -238,7 +238,7 @@ codemaker::UnoType::Sort TypeManager::decompose(
 arguments->clear();
 for (const OString& rArg : args)
 {
-arguments->push_back(OUString::fromUtf8(rArg));
+arguments->push_back(b2u(rArg));
 }
 }
 if (entity != nullptr) {
diff --git a/codemaker/source/commoncpp/commoncpp.cxx 
b/codemaker/source/commoncpp/commoncpp.cxx
index 07b689a39b06..6774aedf4fba 100644
--- a/codemaker/source/commoncpp/commoncpp.cxx
+++ b/codemaker/source/commoncpp/commoncpp.cxx
@@ -79,7 +79,8 @@ OString translateUnoToCppType(
 {
 buf.append("::css::uno::XInterface");
 } else {
-buf.append(nucleus.toUtf8()); // nucleus must be a valid UTF-16
+//TODO: check that nucleus is a valid (UTF-8) identifier
+buf.append(u2b(nucleus));
 }
 }
 return buf.makeStringAndClear();
diff --git a/codemaker/source/cppumaker/cppumaker.cxx 
b/codemaker/source/cppumaker/cppumaker.cxx
index 9adf31d07d36..b1769eda87a6 100644
--- a/codemaker/source/cppumaker/cppumaker.cxx
+++ b/codemaker/source/cppumaker/cppumaker.cxx
@@ -54,7 +54,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
 }
 codemaker::GeneratedTypeSet generated;
 if (options.isValid("-T")) {
-OUString names(OUString::fromUtf8(options.getOption("-T")));
+OUString names(b2u(options.getOption("-T")));
 for (sal_Int32 i = 0; i != -1;) {
 OUString name(names.getToken(0, ';', i));
 if (!name.isEmpty()) {
diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index a32e8dd1d0ca..368cfb6e72f1 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -408,7 +408,7 @@ void 

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

2019-04-04 Thread Mike Kaganski (via logerrit)
 codemaker/source/codemaker/exceptiontree.cxx  |6 
 codemaker/source/codemaker/typemanager.cxx|4 
 codemaker/source/commoncpp/commoncpp.cxx  |3 
 codemaker/source/cppumaker/cppumaker.cxx  |2 
 codemaker/source/cppumaker/cpputype.cxx   |  128 +-
 codemaker/source/cppumaker/dependencies.cxx   |4 
 codemaker/source/cppumaker/includes.cxx   |   14 -
 codemaker/source/javamaker/javamaker.cxx  |2 
 codemaker/source/javamaker/javatype.cxx   |   10 -
 include/codemaker/typemanager.hxx |9 -
 unodevtools/source/skeletonmaker/cppcompskeleton.cxx  |   18 +-
 unodevtools/source/skeletonmaker/cpptypemaker.cxx |   58 
 unodevtools/source/skeletonmaker/javacompskeleton.cxx |   18 +-
 unodevtools/source/skeletonmaker/javatypemaker.cxx|   40 ++---
 unodevtools/source/skeletonmaker/skeletoncommon.cxx   |6 
 15 files changed, 155 insertions(+), 167 deletions(-)

New commits:
commit 84662e9030a855c8db7cd40d9ce354b773d78c16
Author: Mike Kaganski 
AuthorDate: Thu Apr 4 12:27:22 2019 +0300
Commit: Mike Kaganski 
CommitDate: Thu Apr 4 20:36:11 2019 +0200

Get rid of b2u/u2b helpers; use OUString's toUtf8/fromUtf8 instead

These helpers are used in code generator code; so any invalid UTF-8
or UTF-16 in the conversion is programmer's error which needs fixing.
Thus, the behavior of toUtf8/fromUtf8 which asserts the validity is
fine here.

Change-Id: I3004e233c9de59f8e348455f1f04d23e8c51ed3d
Reviewed-on: https://gerrit.libreoffice.org/70249
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Mike Kaganski 

diff --git a/codemaker/source/codemaker/exceptiontree.cxx 
b/codemaker/source/codemaker/exceptiontree.cxx
index b6c2aeee6f87..796f52671ce3 100644
--- a/codemaker/source/codemaker/exceptiontree.cxx
+++ b/codemaker/source/codemaker/exceptiontree.cxx
@@ -55,12 +55,10 @@ void ExceptionTree::add(
 }
 list.push_back(n);
 rtl::Reference< unoidl::Entity > ent;
-codemaker::UnoType::Sort s = manager->getSort(b2u(n), );
+codemaker::UnoType::Sort s = manager->getSort(OUString::fromUtf8(n), 
);
 (void) s; // WaE: unused variable
 assert(s == codemaker::UnoType::Sort::Exception);
-n = u2b(
-static_cast< unoidl::ExceptionTypeEntity * >(ent.get())->
-getDirectBase());
+n = 
static_cast(ent.get())->getDirectBase().toUtf8();
 assert(!n.isEmpty());
 }
 if (!bRuntimeException) {
diff --git a/codemaker/source/codemaker/typemanager.cxx 
b/codemaker/source/codemaker/typemanager.cxx
index cf638f0ca4eb..f723ee699948 100644
--- a/codemaker/source/codemaker/typemanager.cxx
+++ b/codemaker/source/codemaker/typemanager.cxx
@@ -164,7 +164,7 @@ codemaker::UnoType::Sort TypeManager::decompose(
 {
 sal_Int32 k;
 std::vector< OString > args;
-OUString n = b2u(codemaker::UnoType::decompose(u2b(name), , ));
+OUString n = 
OUString::fromUtf8(codemaker::UnoType::decompose(name.toUtf8(), , ));
 for (;;) {
 rtl::Reference< unoidl::Entity > ent;
 codemaker::UnoType::Sort s = getSort(n, );
@@ -238,7 +238,7 @@ codemaker::UnoType::Sort TypeManager::decompose(
 arguments->clear();
 for (const OString& rArg : args)
 {
-arguments->push_back(b2u(rArg));
+arguments->push_back(OUString::fromUtf8(rArg));
 }
 }
 if (entity != nullptr) {
diff --git a/codemaker/source/commoncpp/commoncpp.cxx 
b/codemaker/source/commoncpp/commoncpp.cxx
index 6774aedf4fba..07b689a39b06 100644
--- a/codemaker/source/commoncpp/commoncpp.cxx
+++ b/codemaker/source/commoncpp/commoncpp.cxx
@@ -79,8 +79,7 @@ OString translateUnoToCppType(
 {
 buf.append("::css::uno::XInterface");
 } else {
-//TODO: check that nucleus is a valid (UTF-8) identifier
-buf.append(u2b(nucleus));
+buf.append(nucleus.toUtf8()); // nucleus must be a valid UTF-16
 }
 }
 return buf.makeStringAndClear();
diff --git a/codemaker/source/cppumaker/cppumaker.cxx 
b/codemaker/source/cppumaker/cppumaker.cxx
index b1769eda87a6..9adf31d07d36 100644
--- a/codemaker/source/cppumaker/cppumaker.cxx
+++ b/codemaker/source/cppumaker/cppumaker.cxx
@@ -54,7 +54,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
 }
 codemaker::GeneratedTypeSet generated;
 if (options.isValid("-T")) {
-OUString names(b2u(options.getOption("-T")));
+OUString names(OUString::fromUtf8(options.getOption("-T")));
 for (sal_Int32 i = 0; i != -1;) {
 OUString name(names.getToken(0, ';', i));
 if (!name.isEmpty()) {
diff --git a/codemaker/source/cppumaker/cpputype.cxx 

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

2019-02-08 Thread Libreoffice Gerrit user
 codemaker/source/javamaker/javaoptions.cxx  |7 -
 comphelper/source/container/embeddedobjectcontainer.cxx |6 -
 comphelper/source/misc/accessiblewrapper.cxx|2 
 comphelper/source/misc/instancelocker.cxx   |2 
 comphelper/source/misc/numberedcollection.cxx   |   66 
 comphelper/source/misc/sequenceashashmap.cxx|6 -
 comphelper/source/property/propertystatecontainer.cxx   |6 -
 comphelper/source/property/propstate.cxx|3 
 8 files changed, 50 insertions(+), 48 deletions(-)

New commits:
commit 3b9dcfee6492474398011755a92d77320a226604
Author: Noel Grandin 
AuthorDate: Fri Feb 8 09:30:19 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 8 10:01:40 2019 +0100

loplugin:indentation in codemaker..comphelper

Change-Id: I8dee6245cfa1f7998591b31a3752bbbae13f499d
Reviewed-on: https://gerrit.libreoffice.org/67527
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/javamaker/javaoptions.cxx 
b/codemaker/source/javamaker/javaoptions.cxx
index 612b3d6b2d97..2d583e51ac3f 100644
--- a/codemaker/source/javamaker/javaoptions.cxx
+++ b/codemaker/source/javamaker/javaoptions.cxx
@@ -86,8 +86,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 case 'n':
 if (av[i][2] != 'D' || av[i][3] != '\0')
 {
-OString tmp("'-nD', please check");
-tmp += " your input '" + OString(av[i]) + "'";
+OString tmp("'-nD', please check your input '" + 
OString(av[i]) + "'");
 throw IllegalArgument(tmp);
 }
 
@@ -189,8 +188,8 @@ bool JavaOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 if (av[i][0] == '@')
 {
 FILE* cmdFile = fopen(av[i]+1, "r");
-  if( cmdFile == nullptr )
-  {
+if( cmdFile == nullptr )
+{
 fprintf(stderr, "%s", prepareHelp().getStr());
 ret = false;
 } else
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx 
b/comphelper/source/container/embeddedobjectcontainer.cxx
index 81e5064f34e2..c2e61bcc6f72 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -614,7 +614,7 @@ uno::Reference < embed::XEmbeddedObject > 
EmbeddedObjectContainer::InsertEmbedde
 pImpl->mxStorage, rNewName, aMedium, aObjDescr ), 
uno::UNO_QUERY );
 uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY 
);
 
-   OSL_ENSURE( !xObj.is() || xObj->getCurrentState() != 
embed::EmbedStates::LOADED,
+OSL_ENSURE( !xObj.is() || xObj->getCurrentState() != 
embed::EmbedStates::LOADED,
 "A freshly create object should be running always!" );
 
 // possible optimization: store later!
@@ -646,7 +646,7 @@ uno::Reference < embed::XEmbeddedObject > 
EmbeddedObjectContainer::InsertEmbedde
 
 uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY 
);
 
-   OSL_ENSURE( !xObj.is() || xObj->getCurrentState() != 
embed::EmbedStates::LOADED,
+OSL_ENSURE( !xObj.is() || xObj->getCurrentState() != 
embed::EmbedStates::LOADED,
 "A freshly create object should be running always!" );
 
 // possible optimization: store later!
@@ -791,7 +791,7 @@ uno::Reference < embed::XEmbeddedObject > 
EmbeddedObjectContainer::CopyAndGetEmb
 }
 }
 
-   if ( xResult.is() )
+if ( xResult.is() )
 AddEmbeddedObject( xResult, rName );
 }
 catch (const uno::Exception&)
diff --git a/comphelper/source/misc/accessiblewrapper.cxx 
b/comphelper/source/misc/accessiblewrapper.cxx
index b28b2a240e56..9736b031f618 100644
--- a/comphelper/source/misc/accessiblewrapper.cxx
+++ b/comphelper/source/misc/accessiblewrapper.cxx
@@ -242,7 +242,7 @@ namespace comphelper
 #if OSL_DEBUG_LEVEL > 0
 if ( m_aChildrenMap.end() == aDisposedPos )
 {
-   OSL_FAIL( "OWrappedAccessibleChildrenManager::disposing: where 
did this come from?" );
+OSL_FAIL( "OWrappedAccessibleChildrenManager::disposing: where did 
this come from?" );
 // helper for diagnostics
 Reference< XAccessible > xOwningAccessible( m_aOwningAccessible );
 Reference< XAccessibleContext > xContext;
diff --git a/comphelper/source/misc/instancelocker.cxx 
b/comphelper/source/misc/instancelocker.cxx
index 61b6338b67ca..43991cec43b1 100644
--- a/comphelper/source/misc/instancelocker.cxx
+++ b/comphelper/source/misc/instancelocker.cxx
@@ -68,7 +68,7 @@ void SAL_CALL OInstanceLocker::dispose()
 if ( m_bDisposed )

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

2018-10-31 Thread Libreoffice Gerrit user
 codemaker/source/javamaker/classfile.cxx |6 +++---
 codemaker/source/javamaker/classfile.hxx |3 ++-
 codemaker/source/javamaker/javatype.cxx  |9 ++---
 3 files changed, 7 insertions(+), 11 deletions(-)

New commits:
commit a3d5248b4e508ccacf7e90116df0bed347719e33
Author: Noel Grandin 
AuthorDate: Mon Oct 29 14:25:59 2018 +0200
Commit: Noel Grandin 
CommitDate: Wed Oct 31 07:31:26 2018 +0100

loplugin:useuniqueptr in codemaker

Change-Id: I1d6ec5a5c06a32242773c857444bb63b7b4207b6
Reviewed-on: https://gerrit.libreoffice.org/62648
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/javamaker/classfile.cxx 
b/codemaker/source/javamaker/classfile.cxx
index 1df31aea6947..23bc000248bb 100644
--- a/codemaker/source/javamaker/classfile.cxx
+++ b/codemaker/source/javamaker/classfile.cxx
@@ -312,7 +312,7 @@ void ClassFile::Code::instrSwap() {
 
 void ClassFile::Code::instrTableswitch(
 Code const * defaultBlock, sal_Int32 low,
-std::vector< Code * > const & blocks)
+std::vector< std::unique_ptr > const & blocks)
 {
 // tableswitch <0--3 byte pad>   
 //  
@@ -331,7 +331,7 @@ void ClassFile::Code::instrTableswitch(
 pos2 += defaultBlock->m_code.size(); //FIXME: overflow
 appendU4(m_code, static_cast< sal_uInt32 >(low));
 appendU4(m_code, static_cast< sal_uInt32 >(low + (size - 1)));
-for (Code *pCode : blocks)
+for (std::unique_ptr const & pCode : blocks)
 {
 if (pCode == nullptr) {
 appendU4(m_code, defaultOffset);
@@ -342,7 +342,7 @@ void ClassFile::Code::instrTableswitch(
 }
 }
 appendStream(m_code, defaultBlock->m_code);
-for (Code *pCode : blocks)
+for (std::unique_ptr const & pCode : blocks)
 {
 if (pCode != nullptr) {
 appendStream(m_code, pCode->m_code);
diff --git a/codemaker/source/javamaker/classfile.hxx 
b/codemaker/source/javamaker/classfile.hxx
index be6e3a36abe4..179fea21ef77 100644
--- a/codemaker/source/javamaker/classfile.hxx
+++ b/codemaker/source/javamaker/classfile.hxx
@@ -24,6 +24,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -107,7 +108,7 @@ public:
 
 void instrTableswitch(
 Code const * defaultBlock, sal_Int32 low,
-std::vector< Code * > const & blocks);
+std::vector< std::unique_ptr > const & blocks);
 
 void loadIntegerConstant(sal_Int32 value);
 void loadStringConstant(rtl::OString const & value);
diff --git a/codemaker/source/javamaker/javatype.cxx 
b/codemaker/source/javamaker/javatype.cxx
index 9d683a53ce08..4cd5b50050b0 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -749,7 +749,7 @@ void handleEnumType(
 std::unique_ptr< ClassFile::Code > defCode(cf->newCode());
 defCode->instrAconstNull();
 defCode->instrAreturn();
-std::vector< ClassFile::Code * > blocks;
+std::vector< std::unique_ptr > blocks;
 //FIXME: pointers contained in blocks may leak
 sal_Int32 last = SAL_MAX_INT32;
 for (const auto& pair : map)
@@ -764,14 +764,9 @@ void handleEnumType(
 std::unique_ptr< ClassFile::Code > blockCode(cf->newCode());
 blockCode->instrGetstatic(className, pair.second, classDescriptor);
 blockCode->instrAreturn();
-blocks.push_back(blockCode.get());
-blockCode.release();
+blocks.push_back(std::move(blockCode));
 }
 code->instrTableswitch(defCode.get(), min, blocks);
-for (ClassFile::Code *p : blocks)
-{
-delete p;
-}
 } else{
 std::unique_ptr< ClassFile::Code > defCode(cf->newCode());
 defCode->instrAconstNull();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-21 Thread Libreoffice Gerrit user
 codemaker/source/codemaker/global.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8dc236124ab6f441853d4b23dd0154da9ca0da74
Author: Caolán McNamara 
AuthorDate: Sat Oct 20 19:24:45 2018 +0100
Commit: Caolán McNamara 
CommitDate: Sun Oct 21 17:08:48 2018 +0200

pvs-studio: The condition 'nIndex != - 1' of loop is always true

Change-Id: I5b74d8ac2701adbd63816360812687201f645c39
Reviewed-on: https://gerrit.libreoffice.org/62097
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/codemaker/source/codemaker/global.cxx 
b/codemaker/source/codemaker/global.cxx
index e9a9b8f415c1..5b95332c1007 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -135,7 +135,7 @@ OString createFileNameFromType( const OString& destination,
 }
 
 buffer.append(token);
-} while( nIndex != -1 );
+} while(true);
 
 OUString uSysFileName;
 OSL_VERIFY( FileBase::getSystemPathFromFileURL(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-09-10 Thread Libreoffice Gerrit user
 codemaker/source/cppumaker/cpputype.cxx|2 +-
 desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx |2 --
 sc/source/ui/vba/vbachart.cxx  |5 ++---
 3 files changed, 3 insertions(+), 6 deletions(-)

New commits:
commit a55711ad4f6f0a39fd26bcd682a1a81b4a6c6fb6
Author: Stephan Bergmann 
AuthorDate: Mon Sep 10 08:22:19 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Sep 10 14:49:23 2018 +0200

Generate UNO exception classes as SAL_WARN_UNUSED

...to find more places like 09978dd1fc18ce1ae707bc9e4ea1d2745ff07b61 
"clang-tidy
bugprone-unused-return-value"

Change-Id: Ibe8b6790c701dc8270295dd1e2cbc9023b5ce018
Reviewed-on: https://gerrit.libreoffice.org/60234
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index dd6476ff9f89..722846b0efa6 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3035,7 +3035,7 @@ void 
ExceptionType::dumpComprehensiveGetCppuType(FileStream & out)
 
 void ExceptionType::dumpDeclaration(FileStream & out)
 {
-out << "\nclass CPPU_GCC_DLLPUBLIC_EXPORT " << id_;
+out << "\nclass CPPU_GCC_DLLPUBLIC_EXPORT SAL_WARN_UNUSED " << id_;
 OUString base(entity_->getDirectBase());
 if (!base.isEmpty()) {
 out << " : public " << codemaker::cpp::scopedCppName(u2b(base));
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx 
b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
index 22489894bba3..96b086878f58 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
@@ -213,8 +213,6 @@ void CommandEnvironmentImpl::handle(
 deployment::LicenseException licExc;
 deployment::InstallException instExc;
 deployment::PlatformException platExc;
-deployment::VersionException verExc;
-
 
 if (request >>= wtExc) {
 // ignore intermediate errors of legacy packages, i.e.
diff --git a/sc/source/ui/vba/vbachart.cxx b/sc/source/ui/vba/vbachart.cxx
index 50c78108ba8b..a49255b1d564 100644
--- a/sc/source/ui/vba/vbachart.cxx
+++ b/sc/source/ui/vba/vbachart.cxx
@@ -971,9 +971,8 @@ ScVbaChart::getStockUpDownValue(sal_Int32 _nUpDown, 
sal_Int32 _nNotUpDown)
 }
 catch (const uno::Exception&)
 {
-script::BasicErrorException( OUString(), uno::Reference< 
uno::XInterface >(), sal_uInt32(ERRCODE_BASIC_METHOD_FAILED), OUString() );
+throw script::BasicErrorException( OUString(), uno::Reference< 
uno::XInterface >(), sal_uInt32(ERRCODE_BASIC_METHOD_FAILED), OUString() );
 }
-return _nNotUpDown;
 }
 
 bool
@@ -988,7 +987,7 @@ ScVbaChart::hasMarkers()
 }
 catch (const uno::Exception&)
 {
-script::BasicErrorException( OUString(), uno::Reference< 
uno::XInterface >(), sal_uInt32(ERRCODE_BASIC_METHOD_FAILED), OUString() );
+throw script::BasicErrorException( OUString(), uno::Reference< 
uno::XInterface >(), sal_uInt32(ERRCODE_BASIC_METHOD_FAILED), OUString() );
 }
 return bHasMarkers;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-27 Thread Libreoffice Gerrit user
 codemaker/source/cppumaker/cpputype.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 1a400fc39023bcf471a6d4448acbf1a2afcb274c
Author: Stephan Bergmann 
AuthorDate: Thu Jul 26 15:00:49 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jul 27 08:28:02 2018 +0200

codemaker: avoid -Werror=deprecated-copy (GCC trunk towards GCC 9)

...by explicitly defaulting the copy/move functions (and, where needed in 
turn,
also a default ctor) for classes that have a user-declared dtor that does
nothing other than an implicitly-defined one would do, but needs to be user-
declared because it is virtual and potentially serves as a key function to
emit the vtable, or is non-public, etc.  (For LIBO_INTERNAL_ONLY, in 
cppumaker-
genered code.)

Change-Id: Ia13d945c10600f5793a3247f85a464170ede483d
Reviewed-on: https://gerrit.libreoffice.org/58116
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 6252a0ec603b..dd6476ff9f89 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -1162,6 +1162,12 @@ void InterfaceType::dumpDeclaration(FileStream & out)
 }
 out << "\n{\npublic:\n";
 inc();
+out << "#if defined LIBO_INTERNAL_ONLY\n"
+<< indent() << id_ << "() = default;\n"
+<< indent() << id_ << "(" << id_ << " const &) = default;\n"
+<< indent() << id_ << "(" << id_ << " &&) = default;\n"
+<< indent() << id_ << " & operator =(" << id_ << " const &) = 
default;\n"
+<< indent() << id_ << " & operator =(" << id_ << " &&) = 
default;\n#endif\n\n";
 dumpAttributes(out);
 dumpMethods(out);
 out << "\n" << indent()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-25 Thread Libreoffice Gerrit user
 codemaker/source/cppumaker/dependencies.hxx |3 +++
 codemaker/source/cppumaker/includes.cxx |2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 082c7caecef2658920998b0877683f513c35db34
Author: Muhammet Kara 
AuthorDate: Wed Jul 25 17:00:20 2018 +0300
Commit: Muhammet Kara 
CommitDate: Wed Jul 25 19:28:03 2018 +0200

Add missing method hasUnsignedLongDependency()

m_unsignedLongDependency was already set but never used.

Behavior of Includes::Includes ctor is now in consistency with
the related switch cases in Includes::add (see: m_includeSalTypesH)

Change-Id: I4cca1bab014ac280b73b7532aadfd5ff2b0b9894
Reviewed-on: https://gerrit.libreoffice.org/57792
Reviewed-by: Noel Grandin 
Reviewed-by: Julien Nabet 
Tested-by: Jenkins

diff --git a/codemaker/source/cppumaker/dependencies.hxx 
b/codemaker/source/cppumaker/dependencies.hxx
index 718dac392c87..c7eae1dfc6b6 100644
--- a/codemaker/source/cppumaker/dependencies.hxx
+++ b/codemaker/source/cppumaker/dependencies.hxx
@@ -82,6 +82,9 @@ public:
 
 bool hasLongDependency() const { return m_longDependency; }
 
+bool hasUnsignedLongDependency() const
+{ return m_unsignedLongDependency; }
+
 bool hasHyperDependency() const { return m_hyperDependency; }
 
 bool hasUnsignedHyperDependency() const
diff --git a/codemaker/source/cppumaker/includes.cxx 
b/codemaker/source/cppumaker/includes.cxx
index ddd541640671..53ca16afcd4d 100644
--- a/codemaker/source/cppumaker/includes.cxx
+++ b/codemaker/source/cppumaker/includes.cxx
@@ -57,7 +57,7 @@ Includes::Includes(
 || dependencies.hasShortDependency()
 || dependencies.hasUnsignedShortDependency()
 || dependencies.hasLongDependency()
-|| dependencies.hasUnsignedShortDependency()
+|| dependencies.hasUnsignedLongDependency()
 || dependencies.hasHyperDependency()
 || dependencies.hasUnsignedHyperDependency()
 || dependencies.hasCharDependency()),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: codemaker/source cppuhelper/source cppu/source dbaccess/source desktop/source

2018-06-29 Thread Arkadiy Illarionov
 codemaker/source/javamaker/javatype.cxx|   60 ++---
 cppu/source/uno/lbmap.cxx  |5 -
 cppuhelper/source/propertysetmixin.cxx |8 +-
 dbaccess/source/core/dataaccess/datasource.cxx |5 -
 dbaccess/source/ui/browser/genericcontroller.cxx   |2 
 dbaccess/source/ui/dlg/ConnectionHelper.cxx|2 
 dbaccess/source/ui/dlg/DbAdminImpl.cxx |4 -
 dbaccess/source/ui/dlg/DbAdminImpl.hxx |1 
 dbaccess/source/ui/dlg/adminpages.cxx  |2 
 dbaccess/source/ui/dlg/dsselect.cxx|6 +-
 dbaccess/source/ui/dlg/dsselect.hxx|4 -
 dbaccess/source/ui/dlg/odbcconfig.cxx  |2 
 dbaccess/source/ui/dlg/odbcconfig.hxx  |3 -
 dbaccess/source/ui/inc/commontypes.hxx |4 -
 dbaccess/source/ui/querydesign/QueryDesignView.cxx |9 +--
 desktop/source/deployment/registry/dp_registry.cxx |3 -
 16 files changed, 54 insertions(+), 66 deletions(-)

New commits:
commit 5437eb15ad3975b11c6eefe77dfd6687e0e73f81
Author: Arkadiy Illarionov 
Date:   Thu Jun 28 23:32:05 2018 +0300

tdf#96099 Remove trivial std::map typedefs in [cd]*

Change-Id: I043d265d3d73a3e16f05d5ca7e29a09341651d82
Reviewed-on: https://gerrit.libreoffice.org/56639
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/javamaker/javatype.cxx 
b/codemaker/source/javamaker/javatype.cxx
index 71f4faa16117..5530392b278b 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -94,8 +94,6 @@ OUString createUnoName(
 return buf.makeStringAndClear();
 }
 
-typedef std::set< OUString > Dependencies;
-
 enum SpecialType {
 SPECIAL_TYPE_NONE,
 SPECIAL_TYPE_ANY,
@@ -128,7 +126,7 @@ struct PolymorphicUnoType {
 
 SpecialType translateUnoTypeToDescriptor(
 rtl::Reference< TypeManager > const & manager, OUString const & type,
-bool array, bool classType, Dependencies * dependencies,
+bool array, bool classType, std::set * dependencies,
 OStringBuffer * descriptor, OStringBuffer * signature,
 bool * needsSignature, PolymorphicUnoType * polymorphicUnoType);
 
@@ -136,7 +134,7 @@ SpecialType translateUnoTypeToDescriptor(
 rtl::Reference< TypeManager > const & manager,
 codemaker::UnoType::Sort sort, OUString const & nucleus, sal_Int32 rank,
 std::vector< OUString > const & arguments, bool array, bool classType,
-Dependencies * dependencies, OStringBuffer * descriptor,
+std::set * dependencies, OStringBuffer * descriptor,
 OStringBuffer * signature, bool * needsSignature,
 PolymorphicUnoType * polymorphicUnoType)
 {
@@ -274,7 +272,7 @@ SpecialType translateUnoTypeToDescriptor(
 
 SpecialType translateUnoTypeToDescriptor(
 rtl::Reference< TypeManager > const & manager, OUString const & type,
-bool array, bool classType, Dependencies * dependencies,
+bool array, bool classType, std::set * dependencies,
 OStringBuffer * descriptor, OStringBuffer * signature,
 bool * needsSignature, PolymorphicUnoType * polymorphicUnoType)
 {
@@ -290,7 +288,7 @@ SpecialType translateUnoTypeToDescriptor(
 }
 
 SpecialType getFieldDescriptor(
-rtl::Reference< TypeManager > const & manager, Dependencies * dependencies,
+rtl::Reference< TypeManager > const & manager, std::set * 
dependencies,
 OUString const & type, OString * descriptor, OString * signature,
 PolymorphicUnoType * polymorphicUnoType)
 {
@@ -316,7 +314,7 @@ class MethodDescriptor {
 public:
 MethodDescriptor(
 rtl::Reference< TypeManager > const & manager,
-Dependencies * dependencies, OUString const & returnType,
+std::set * dependencies, OUString const & returnType,
 SpecialType * specialReturnType,
 PolymorphicUnoType * polymorphicUnoType);
 
@@ -332,7 +330,7 @@ public:
 
 private:
 rtl::Reference< TypeManager > m_manager;
-Dependencies * m_dependencies;
+std::set * m_dependencies;
 OStringBuffer m_descriptorStart;
 OString m_descriptorEnd;
 OStringBuffer m_signatureStart;
@@ -341,7 +339,7 @@ private:
 };
 
 MethodDescriptor::MethodDescriptor(
-rtl::Reference< TypeManager > const & manager, Dependencies * dependencies,
+rtl::Reference< TypeManager > const & manager, std::set * 
dependencies,
 OUString const & returnType, SpecialType * specialReturnType,
 PolymorphicUnoType * polymorphicUnoType):
 m_manager(manager), m_dependencies(dependencies), m_needsSignature(false)
@@ -412,11 +410,11 @@ public:
 bool inParameter, bool outParameter, OString const & methodName,
 sal_Int32 index, PolymorphicUnoType const & polymorphicUnoType);
 
-sal_uInt16 generateCode(ClassFile::Code & code, Dependencies * 
dependencies)
+sal_uInt16 generateCode(ClassFile::Code & code, std::set * 
dependencies)
 const;
 
 void generatePolymorphicUnoTypeCode(

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

2018-06-06 Thread Miklos Vajna
 codemaker/source/cppumaker/includes.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit a96a260a5fd6303eeebb26aee4be24ddf88391d1
Author: Miklos Vajna 
Date:   Tue Jun 5 22:14:44 2018 +0200

tdf#117918 codemaker: avoid including ourselves in .hpp files

It's pointless, include guards will make sure it's a NOP, but it
confuses tools like IWYU.

Change-Id: Ic1f56ef267954cdf8bf3cb4f4a5e841d5e4bb82a
Reviewed-on: https://gerrit.libreoffice.org/55354
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/codemaker/source/cppumaker/includes.cxx 
b/codemaker/source/cppumaker/includes.cxx
index e33262ee7f6c..ddd541640671 100644
--- a/codemaker/source/cppumaker/includes.cxx
+++ b/codemaker/source/cppumaker/includes.cxx
@@ -161,7 +161,10 @@ void Includes::dump(
 if (m_hpp || pair.second == Dependencies::KIND_BASE
 || !isInterfaceType(u2b(pair.first)))
 {
-dumpInclude(out, u2b(pair.first), m_hpp);
+// If we know our name, then avoid including ourselves.
+if (!companionHdl || *companionHdl != pair.first) {
+dumpInclude(out, u2b(pair.first), m_hpp);
+}
 } else {
 bool ns = dumpNamespaceOpen(out, pair.first, false);
 if (ns) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-26 Thread Caolán McNamara
 codemaker/source/cppumaker/cpputype.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4e5cb9fdbac5c7afef599648737bdcfe37af6ccf
Author: Caolán McNamara 
Date:   Fri Jan 26 13:01:10 2018 +

coverity#1019311 silence Unchecked return value

Change-Id: Ife2bfed0eecff5fe247d0fef6ee7d77626d9f0be

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 15e1f116d638..c8b52857c648 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -449,7 +449,7 @@ void CppuType::dumpFile(
 throw;
 }
 out.close();
-makeValidTypeFile(
+(void)makeValidTypeFile(
u2b(fileUri), u2b(tmpUri), exists && options.isValid("-Gc"));
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: codemaker/source connectivity/source dbaccess/source editeng/source filter/source framework/inc framework/source hwpfilter/source include/rtl include/sfx2 include/svx q

2017-12-29 Thread Andrea Gelmini
 codemaker/source/cppumaker/dependencies.hxx |2 -
 connectivity/source/inc/file/FTable.hxx |2 -
 dbaccess/source/ui/misc/UITools.cxx |2 -
 editeng/source/editeng/editdoc.cxx  |2 -
 filter/source/xslt/import/wordml/wordml2ooo_draw.xsl|   12 
+-
 filter/source/xslt/import/wordml/wordml2ooo_path.xsl|2 -
 framework/inc/jobs/configaccess.hxx |2 -
 framework/inc/jobs/job.hxx  |2 -
 framework/source/inc/loadenv/loadenvexception.hxx   |2 -
 hwpfilter/source/hbox.h |2 -
 include/rtl/uuid.h  |2 -
 include/sfx2/docmacromode.hxx   |2 -
 include/svx/fmdpage.hxx |2 -
 qadevOOo/tests/java/ifc/awt/_XWindow.java   |2 -
 qadevOOo/tests/java/ifc/container/_XContainer.java  |2 -
 qadevOOo/tests/java/ifc/document/_XFilter.java  |2 -
 qadevOOo/tests/java/ifc/form/_XChangeBroadcaster.java   |2 -
 qadevOOo/tests/java/ifc/frame/_XFrame.java  |2 -
 qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory.java  |2 -
 qadevOOo/tests/java/ifc/script/_XInvocationAdapterFactory2.java |2 -
 qadevOOo/tests/java/ifc/ui/dialogs/_XExecutableDialog.java  |4 +--
 qadevOOo/tests/java/ifc/view/_XPrintable.java   |2 -
 qadevOOo/tests/java/mod/_dbaccess/ORowSet.java  |2 -
 qadevOOo/tests/java/mod/_sw/SwAccessibleFooterView.java |2 -
 qadevOOo/tests/java/mod/_sw/SwAccessibleHeaderView.java |2 -
 sc/qa/complex/dataPilot/_XDataPilotDescriptor.java  |2 -
 sc/source/core/tool/interpr5.cxx|2 -
 sd/xsl/effect.xsl   |2 -
 svtools/source/table/gridtablerenderer.cxx  |2 -
 svx/source/sdr/contact/viewcontactofsdrole2obj.cxx  |2 -
 sw/source/core/edit/edattr.cxx  |4 +--
 sw/source/core/txtnode/thints.cxx   |2 -
 sw/source/filter/html/htmltab.cxx   |2 -
 sw/source/filter/ww8/ww8atr.cxx |4 +--
 sw/source/filter/ww8/ww8struc.hxx   |2 -
 sw/source/ui/dbui/mmgreetingspage.cxx   |2 -
 36 files changed, 44 insertions(+), 44 deletions(-)

New commits:
commit a2ef65b09da20aa1d0c15b883a58056df2dbad6b
Author: Andrea Gelmini 
Date:   Fri Dec 29 00:35:10 2017 +0100

Fix typos

Change-Id: I0e56430afa65b6b5826d56212ac501c0244fce9b
Reviewed-on: https://gerrit.libreoffice.org/47145
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/codemaker/source/cppumaker/dependencies.hxx 
b/codemaker/source/cppumaker/dependencies.hxx
index b74ae489d076..718dac392c87 100644
--- a/codemaker/source/cppumaker/dependencies.hxx
+++ b/codemaker/source/cppumaker/dependencies.hxx
@@ -34,7 +34,7 @@ class TypeManager;
 namespace codemaker { namespace cppumaker {
 
 /**
-   A simple class to track which other entites a given entity depends on.
+   A simple class to track which other entities a given entity depends on.
 
This class is not multi-threadsafe.
  */
diff --git a/connectivity/source/inc/file/FTable.hxx 
b/connectivity/source/inc/file/FTable.hxx
index 3a234674b620..a13437a052fd 100644
--- a/connectivity/source/inc/file/FTable.hxx
+++ b/connectivity/source/inc/file/FTable.hxx
@@ -44,7 +44,7 @@ namespace connectivity
 sal_Int32   m_nFilePos;
 // current IResultSetHelper::Movement
 sal_uInt8*  m_pBuffer;
 sal_uInt16  m_nBufferSize; 
 // size of the ReadBuffer, if pBuffer != NULL
-boolm_bWriteable;   // 
svstream cann't say if we are writeable
+boolm_bWriteable;   // 
svstream can't say if we are writeable

 // so we have to
 
 virtual void FileClose();
diff --git a/dbaccess/source/ui/misc/UITools.cxx 
b/dbaccess/source/ui/misc/UITools.cxx
index cc7eb2c97f78..ee94235457fb 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -1126,7 +1126,7 @@ TOTypeInfoSP queryPrimaryKeyType(const OTypeInfoMap& 
_rTypeInfo)
 if ( !pTypeInfo.get() ) // just a fallback
 pTypeInfo 

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

2017-11-25 Thread Julien Nabet
 codemaker/source/javamaker/classfile.cxx |8 
 codemaker/source/javamaker/classfile.hxx |5 ++---
 codemaker/source/javamaker/javatype.cxx  |5 ++---
 3 files changed, 8 insertions(+), 10 deletions(-)

New commits:
commit 10593acac0bc42878fea34fe7da3f389f256c317
Author: Julien Nabet 
Date:   Sat Nov 25 18:33:25 2017 +0100

Replace most lists by vectors in codemaker

Change-Id: Id867b497514d2d795504ae5c9e7d0ad356524ad5
Reviewed-on: https://gerrit.libreoffice.org/45274
Reviewed-by: Noel Grandin 
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/codemaker/source/javamaker/classfile.cxx 
b/codemaker/source/javamaker/classfile.cxx
index 37858991edec..1df31aea6947 100644
--- a/codemaker/source/javamaker/classfile.cxx
+++ b/codemaker/source/javamaker/classfile.cxx
@@ -227,12 +227,12 @@ void ClassFile::Code::instrInvokevirtual(
 
 void ClassFile::Code::instrLookupswitch(
 Code const * defaultBlock,
-std::list< std::pair< sal_Int32, Code * > > const & blocks)
+std::vector< std::pair< sal_Int32, Code * > > const & blocks)
 {
 // lookupswitch <0--3 byte pad>   

 // 
 // :
-std::list< std::pair< sal_Int32, Code * > >::size_type size = 
blocks.size();
+std::vector< std::pair< sal_Int32, Code * > >::size_type size = 
blocks.size();
 if (size > SAL_MAX_INT32) {
 throw CannotDumpException("Lookup-switch too large for Java class file 
format");
 }
@@ -312,7 +312,7 @@ void ClassFile::Code::instrSwap() {
 
 void ClassFile::Code::instrTableswitch(
 Code const * defaultBlock, sal_Int32 low,
-std::list< Code * > const & blocks)
+std::vector< Code * > const & blocks)
 {
 // tableswitch <0--3 byte pad>   
 //  
@@ -323,7 +323,7 @@ void ClassFile::Code::instrTableswitch(
 for (int i = 0; i < pad; ++i) {
 appendU1(m_code, 0);
 }
-std::list< Code * >::size_type size = blocks.size();
+std::vector< Code * >::size_type size = blocks.size();
 Position pos2 = pos1 + 1 + pad + 12 + size * 4; //FIXME: overflow
 sal_uInt32 defaultOffset = static_cast< sal_uInt32 >(pos2 - pos1);
 //FIXME: overflow
diff --git a/codemaker/source/javamaker/classfile.hxx 
b/codemaker/source/javamaker/classfile.hxx
index 6e5466d5b701..be6e3a36abe4 100644
--- a/codemaker/source/javamaker/classfile.hxx
+++ b/codemaker/source/javamaker/classfile.hxx
@@ -23,7 +23,6 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -89,7 +88,7 @@ public:
 
 void instrLookupswitch(
 Code const * defaultBlock,
-std::list< std::pair< sal_Int32, Code * > > const & blocks);
+std::vector< std::pair< sal_Int32, Code * > > const & blocks);
 
 void instrNew(rtl::OString const & type);
 void instrNewarray(codemaker::UnoType::Sort sort);
@@ -108,7 +107,7 @@ public:
 
 void instrTableswitch(
 Code const * defaultBlock, sal_Int32 low,
-std::list< Code * > const & blocks);
+std::vector< Code * > const & blocks);
 
 void loadIntegerConstant(sal_Int32 value);
 void loadStringConstant(rtl::OString const & value);
diff --git a/codemaker/source/javamaker/javatype.cxx 
b/codemaker/source/javamaker/javatype.cxx
index dae125e7a3bb..71f4faa16117 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -22,7 +22,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -752,7 +751,7 @@ void handleEnumType(
 std::unique_ptr< ClassFile::Code > defCode(cf->newCode());
 defCode->instrAconstNull();
 defCode->instrAreturn();
-std::list< ClassFile::Code * > blocks;
+std::vector< ClassFile::Code * > blocks;
 //FIXME: pointers contained in blocks may leak
 sal_Int32 last = SAL_MAX_INT32;
 for (const auto& pair : map)
@@ -779,7 +778,7 @@ void handleEnumType(
 std::unique_ptr< ClassFile::Code > defCode(cf->newCode());
 defCode->instrAconstNull();
 defCode->instrAreturn();
-std::list< std::pair< sal_Int32, ClassFile::Code * > > blocks;
+std::vector< std::pair< sal_Int32, ClassFile::Code * > > blocks;
 //FIXME: pointers contained in blocks may leak
 for (const auto& pair : map )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: codemaker/source include/codemaker include/registry registry/source sal/textenc store/source

2017-10-20 Thread Noel Grandin
 codemaker/source/codemaker/global.cxx  |2 
 codemaker/source/cppumaker/cppuoptions.cxx |2 
 codemaker/source/cppumaker/cppuoptions.hxx |2 
 codemaker/source/cppumaker/cpputype.cxx|   36 +++
 codemaker/source/javamaker/javaoptions.cxx |2 
 codemaker/source/javamaker/javaoptions.hxx |2 
 include/codemaker/global.hxx   |4 
 include/codemaker/options.hxx  |2 
 include/registry/registry.hxx  |   10 +-
 include/registry/writer.hxx|2 
 registry/source/keyimpl.cxx|4 
 registry/source/keyimpl.hxx|4 
 registry/source/reflread.cxx   |  144 ++---
 registry/source/reflwrit.cxx   |   12 +-
 sal/textenc/textenc.cxx|2 
 store/source/storbios.cxx  |8 -
 store/source/storbios.hxx  |8 -
 store/source/stordata.cxx  |8 -
 store/source/stordata.hxx  |   10 +-
 store/source/stortree.cxx  |4 
 store/source/stortree.hxx  |4 
 21 files changed, 136 insertions(+), 136 deletions(-)

New commits:
commit 14d45665433eec974acd96f813f2bf314bdb3eba
Author: Noel Grandin 
Date:   Thu Oct 19 11:09:13 2017 +0200

loplugin:constmethod in codemaker,registry,store

Change-Id: Ie75875974f054ff79bd64b1c261e79e2b78eb7fc
Reviewed-on: https://gerrit.libreoffice.org/43540
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/codemaker/global.cxx 
b/codemaker/source/codemaker/global.cxx
index 46d5a07e35a6..30484f7e6111 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -273,7 +273,7 @@ FileStream::~FileStream()
 osl_closeFile(m_file);
 }
 
-bool FileStream::isValid()
+bool FileStream::isValid() const
 {
 if ( m_file )
 return true;
diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index af644af1538f..d4575968b784 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -320,7 +320,7 @@ OString CppuOptions::prepareHelp()
 return help;
 }
 
-OString CppuOptions::prepareVersion()
+OString CppuOptions::prepareVersion() const
 {
 OString version = m_program + " Version 2.0\n\n";
 return version;
diff --git a/codemaker/source/cppumaker/cppuoptions.hxx 
b/codemaker/source/cppumaker/cppuoptions.hxx
index 497fbd96402b..882dfa66dbef 100644
--- a/codemaker/source/cppumaker/cppuoptions.hxx
+++ b/codemaker/source/cppumaker/cppuoptions.hxx
@@ -32,7 +32,7 @@ public:
 
 OString  prepareHelp() override;
 
-OString  prepareVersion();
+OString  prepareVersion() const;
 
 protected:
 };
diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index dafbe682fd8b..bff92a920d57 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -167,7 +167,7 @@ public:
 CppuOptions const & options);
 
 void dumpDependedTypes(
-codemaker::GeneratedTypeSet & generated, CppuOptions const & options);
+codemaker::GeneratedTypeSet & generated, CppuOptions const & options) 
const;
 
 virtual void dumpHdlFile(
 FileStream & out, codemaker::cppumaker::Includes & includes) {
@@ -176,7 +176,7 @@ public:
 
 virtual void dumpHppFile(FileStream& o, codemaker::cppumaker::Includes & 
includes) = 0;
 
-OUString dumpHeaderDefine(FileStream& o, OUString const & extension);
+OUString dumpHeaderDefine(FileStream& o, OUString const & extension) const;
 
 void dumpGetCppuType(FileStream & out);
 
@@ -198,7 +198,7 @@ public:
 OUString getTypeClass(OUString const & name, bool cStyle = false);
 
 void dumpCppuGetType(
-FileStream & out, OUString const & name, OUString const * ownName = 
nullptr);
+FileStream & out, OUString const & name, OUString const * ownName = 
nullptr) const;
 
 sal_uInt32 getInheritedMemberCount();
 
@@ -454,7 +454,7 @@ bool CppuType::dumpFile(
 }
 
 void CppuType::dumpDependedTypes(
-codemaker::GeneratedTypeSet & generated, CppuOptions const & options)
+codemaker::GeneratedTypeSet & generated, CppuOptions const & options) const
 {
 if (!options.isValid("-nD")) {
 codemaker::cppumaker::Dependencies::Map const & map
@@ -466,7 +466,7 @@ void CppuType::dumpDependedTypes(
 }
 
 OUString CppuType::dumpHeaderDefine(
-FileStream & out, OUString const & extension)
+FileStream & out, OUString const & extension) const
 {
 OUString def(
 "INCLUDED_" + name_.replace('.', '_').toAsciiUpperCase() + "_"
@@ -849,7 +849,7 @@ void CppuType::dumpType(
 }
 
 void CppuType::dumpCppuGetType(
-FileStream & out, OUString const & name, OUString const * ownName)
+

[Libreoffice-commits] core.git: codemaker/source comphelper/source compilerplugins/clang jurt/source solenv/CompilerTest_compilerplugins_clang.mk soltools/cpp soltools/mkdepend

2017-08-14 Thread Noel Grandin
 codemaker/source/cppumaker/cppuoptions.cxx  |2 
 codemaker/source/javamaker/javaoptions.cxx  |2 
 comphelper/source/misc/backupfilehelper.cxx |8 
 compilerplugins/clang/droplong.cxx  |  123 
++
 compilerplugins/clang/test/droplong.cxx |   20 +
 jurt/source/pipe/com_sun_star_lib_connections_pipe_PipeConnection.c |2 
 solenv/CompilerTest_compilerplugins_clang.mk|1 
 soltools/cpp/_eval.c|6 
 soltools/mkdepend/def.h |2 
 9 files changed, 155 insertions(+), 11 deletions(-)

New commits:
commit 0c3bd1d482ece1f2217cc87069179161f6a5bb56
Author: Noel Grandin 
Date:   Mon Aug 14 08:28:13 2017 +0200

new loplugin:droplong

The types 'long' and 'unsigned long' are different sizes on different
platforms, making them wholy unsuitable for portable code.
And when I mean different sizes, I mean 64bit Linux and 64bit Windows
have different bit sizes.

Change-Id: Id4d8cd709bf71a3f85ed6515fae2b0a21ae8c25d
Reviewed-on: https://gerrit.libreoffice.org/41130
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index d6f31e89aeee..b399de19147e 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -278,7 +278,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 
 ret = initOptions(rargc, rargv, bCmdFile);
 
-for (long j=0; j < rargc; j++)
+for (int j=0; j < rargc; j++)
 {
 free(rargv[j]);
 }
diff --git a/codemaker/source/javamaker/javaoptions.cxx 
b/codemaker/source/javamaker/javaoptions.cxx
index a09107a99b53..08c5a7f4dbf8 100644
--- a/codemaker/source/javamaker/javaoptions.cxx
+++ b/codemaker/source/javamaker/javaoptions.cxx
@@ -208,7 +208,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 
 ret = initOptions(rargc, rargv, bCmdFile);
 
-for (long j=0; j < rargc; j++)
+for (int j=0; j < rargc; j++)
 {
 free(rargv[j]);
 }
diff --git a/comphelper/source/misc/backupfilehelper.cxx 
b/comphelper/source/misc/backupfilehelper.cxx
index ebf93aeb8282..abc8579a542b 100644
--- a/comphelper/source/misc/backupfilehelper.cxx
+++ b/comphelper/source/misc/backupfilehelper.cxx
@@ -654,9 +654,9 @@ namespace
 
 if (aList.is())
 {
-const long nLength(aList->getLength());
+const sal_Int32 nLength(aList->getLength());
 
-for (long a(0); a < nLength; a++)
+for (sal_Int32 a(0); a < nLength; a++)
 {
 const uno::Reference< xml::dom::XElement > 
aChild(aList->item(a), uno::UNO_QUERY);
 
@@ -765,9 +765,9 @@ namespace
 
 if (aList.is())
 {
-const long nLength(aList->getLength());
+const sal_Int32 nLength(aList->getLength());
 
-for (long a(0); a < nLength; a++)
+for (sal_Int32 a(0); a < nLength; a++)
 {
 const uno::Reference< xml::dom::XElement > 
aChild(aList->item(a), uno::UNO_QUERY);
 
diff --git a/compilerplugins/clang/droplong.cxx 
b/compilerplugins/clang/droplong.cxx
new file mode 100644
index ..78129e78c323
--- /dev/null
+++ b/compilerplugins/clang/droplong.cxx
@@ -0,0 +1,123 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "plugin.hxx"
+#include "check.hxx"
+
+/**
+The types 'long' and 'unsigned long' are different sizes on different 
platforms, making them wholy unsuitable
+for portable code.
+And when I mean different sizes, I mean 64bit Linux and 64bit Windows have 
different sizes.
+ */
+namespace {
+
+static bool startswith(const std::string& rStr, const char* pSubStr) {
+return rStr.compare(0, strlen(pSubStr), pSubStr) == 0;
+}
+
+class DropLong:
+public RecursiveASTVisitor, public loplugin::Plugin
+{
+public:
+explicit 

[Libreoffice-commits] core.git: codemaker/source idlc/inc idlc/source idl/inc idl/source include/codemaker

2017-07-18 Thread Noel Grandin
 codemaker/source/codemaker/global.cxx |4 ++--
 idl/inc/bastype.hxx   |6 +++---
 idl/inc/database.hxx  |2 +-
 idl/inc/lex.hxx   |2 +-
 idl/inc/parser.hxx|8 
 idl/inc/types.hxx |2 +-
 idl/source/objects/bastype.cxx|6 +++---
 idl/source/objects/slot.cxx   |2 +-
 idl/source/objects/types.cxx  |2 +-
 idl/source/prj/database.cxx   |2 +-
 idl/source/prj/parser.cxx |8 
 idlc/inc/astscope.hxx |2 +-
 idlc/inc/errorhandler.hxx |6 +++---
 idlc/inc/fehelper.hxx |2 +-
 idlc/source/astscope.cxx  |2 +-
 idlc/source/errorhandler.cxx  |8 
 idlc/source/fehelper.cxx  |2 +-
 idlc/source/parser.y  |2 +-
 include/codemaker/global.hxx  |4 ++--
 19 files changed, 36 insertions(+), 36 deletions(-)

New commits:
commit 41dc56df37596ff20c0476ae44fbd07b8b4678a1
Author: Noel Grandin 
Date:   Tue Jul 18 11:33:26 2017 +0200

loplugin:constparams codemaker,idl,idlc

Change-Id: Ic72b7525cfbfbd3c5afb12fe9ea814176e6c8c9d
Reviewed-on: https://gerrit.libreoffice.org/40126
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/codemaker/global.cxx 
b/codemaker/source/codemaker/global.cxx
index 49ce44be7908..46d5a07e35a6 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -345,7 +345,7 @@ FileStream <<(FileStream& o, char const * s) {
 osl_writeFile(o.m_file, s, strlen(s), );
 return o;
 }
-FileStream <<(FileStream& o, ::rtl::OString* s) {
+FileStream <<(FileStream& o, ::rtl::OString const * s) {
 sal_uInt64 writtenBytes;
 osl_writeFile(o.m_file, s->getStr(), s->getLength() * sizeof(sal_Char), 
);
 return o;
@@ -356,7 +356,7 @@ FileStream <<(FileStream& o, const ::rtl::OString& 
s) {
 return o;
 
 }
-FileStream <<(FileStream& o, ::rtl::OStringBuffer* s) {
+FileStream <<(FileStream& o, ::rtl::OStringBuffer const * s) {
 sal_uInt64 writtenBytes;
 osl_writeFile(o.m_file, s->getStr(), s->getLength() * sizeof(sal_Char), 
);
 return o;
diff --git a/idl/inc/bastype.hxx b/idl/inc/bastype.hxx
index df04891384e8..de659276472a 100644
--- a/idl/inc/bastype.hxx
+++ b/idl/inc/bastype.hxx
@@ -41,7 +41,7 @@ public:
 operatorbool() const { return bVal; }
 boolIsSet() const { return bSet; }
 
-boolReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm );
+boolReadSvIdl( SvStringHashEntry const * pName, SvTokenStream & 
rInStm );
 };
 
 
@@ -56,7 +56,7 @@ public:
 voidsetString(const OString& rStr) { m_aStr = rStr; }
 const OString& getString() const { return m_aStr; }
 
-boolReadSvIdl( SvStringHashEntry * pName, SvTokenStream & rInStm );
+boolReadSvIdl( SvStringHashEntry const * pName, SvTokenStream & 
rInStm );
 boolIsSet() const
 {
 return !m_aStr.isEmpty() || nValue != 0;
@@ -68,7 +68,7 @@ public:
 };
 
 
-boolReadStringSvIdl( SvStringHashEntry * pName, SvTokenStream & 
rInStm, OString& aString );
+boolReadStringSvIdl( SvStringHashEntry const * pName, SvTokenStream & 
rInStm, OString& aString );
 
 
 #endif // INCLUDED_IDL_INC_BASTYPE_HXX
diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx
index 110b6172..7994aa51463a 100644
--- a/idl/inc/database.hxx
+++ b/idl/inc/database.hxx
@@ -114,7 +114,7 @@ public:
 
 voidWrite(const OString& rText);
 voidWriteError( SvTokenStream & rInStm );
-voidSetError( const OString& rError, SvToken& rTok );
+voidSetError( const OString& rError, SvToken const & 
rTok );
 voidSetAndWriteError( SvTokenStream & rInStm, const 
OString& rError );
 voidPush( SvMetaObject * pObj );
 sal_uInt32  GetUniqueId() { return ++nUniqueId; }
diff --git a/idl/inc/lex.hxx b/idl/inc/lex.hxx
index 8a71349971c5..4fa4ff2be648 100644
--- a/idl/inc/lex.hxx
+++ b/idl/inc/lex.hxx
@@ -85,7 +85,7 @@ public:
 
 voidSetHash( SvStringHashEntry * pHashP )
 { pHash = pHashP; nType = SVTOKENTYPE::HashId; }
-boolIs( SvStringHashEntry * pEntry ) const
+boolIs( SvStringHashEntry const * pEntry ) const
 { return IsIdentifierHash() && pHash == pEntry; }
 };
 
diff --git a/idl/inc/parser.hxx b/idl/inc/parser.hxx
index cc2696b1e7c7..811908f073e8 100644
--- a/idl/inc/parser.hxx
+++ b/idl/inc/parser.hxx
@@ -56,15 +56,15 @@ public:
 SvMetaClass* ReadKnownClass();
 SvMetaType*  ReadKnownType();
 void Read(char cChar);
-bool 

[Libreoffice-commits] core.git: codemaker/source compilerplugins/clang connectivity/source cppu/source cui/source dbaccess/source editeng/source embeddedobj/source filter/source hwpfilter/source io/so

2017-07-07 Thread Noel Grandin
 codemaker/source/cppumaker/cppuoptions.cxx |2 -
 codemaker/source/javamaker/javaoptions.cxx |2 -
 compilerplugins/clang/test/unnecessaryparen.cxx|2 +
 compilerplugins/clang/unnecessaryparen.cxx |   31 -
 connectivity/source/drivers/mork/MResultSet.cxx|2 -
 cppu/source/typelib/typelib.cxx|4 +-
 cui/source/options/cfgchart.cxx|2 -
 dbaccess/source/ui/querydesign/JoinTableView.cxx   |2 -
 editeng/source/editeng/impedit4.cxx|2 -
 embeddedobj/source/general/dummyobject.cxx |2 -
 embeddedobj/source/msole/olepersist.cxx|2 -
 filter/source/graphicfilter/etiff/etiff.cxx|2 -
 filter/source/xsltdialog/typedetectionimport.cxx   |2 -
 filter/source/xsltdialog/xmlfilterjar.cxx  |2 -
 hwpfilter/source/hcode.cxx |4 +-
 io/source/stm/odata.cxx|2 -
 lotuswordpro/source/filter/lwpdrawobj.cxx  |4 +-
 package/source/xstor/xstorage.cxx  |2 -
 rsc/source/parser/rsckey.cxx   |3 --
 rsc/source/res/rscclass.cxx|4 +-
 rsc/source/res/rscconst.cxx|2 -
 sal/osl/unx/socket.cxx |2 -
 sal/rtl/locale.cxx |2 -
 sc/source/core/tool/compiler.cxx   |8 ++---
 sc/source/core/tool/interpr2.cxx   |2 -
 sc/source/core/tool/token.cxx  |4 +-
 sc/source/ui/Accessibility/AccessibleDocument.cxx  |2 -
 sc/source/ui/vba/vbarange.cxx  |2 -
 sc/source/ui/view/tabcont.cxx  |4 +-
 sd/source/core/CustomAnimationEffect.cxx   |6 ++--
 sd/source/core/EffectMigration.cxx |4 +-
 sd/source/filter/eppt/epptso.cxx   |   20 ++---
 sd/source/filter/html/htmlex.cxx   |   19 +++-
 sd/source/ui/animations/CustomAnimationDialog.cxx  |2 -
 sd/source/ui/animations/CustomAnimationPane.cxx|2 -
 sd/source/ui/annotations/annotationmanager.cxx |2 -
 sd/source/ui/unoidl/unoobj.cxx |2 -
 slideshow/source/engine/slide/userpaintoverlay.cxx |4 +-
 starmath/source/dialog.cxx |2 -
 svl/source/numbers/zforfind.cxx|6 ++--
 svx/source/gallery2/galbrws2.cxx   |2 -
 svx/source/svdraw/svdtrans.cxx |2 -
 svx/source/table/svdotable.cxx |2 -
 sw/source/core/doc/DocumentStylePoolManager.cxx|2 -
 sw/source/filter/ww8/rtfattributeoutput.cxx|2 -
 sw/source/filter/ww8/ww8par6.cxx   |6 ++--
 sw/source/ui/table/tabledlg.cxx|4 +-
 sw/source/uibase/shells/grfsh.cxx  |2 -
 sw/source/uibase/shells/tabsh.cxx  |5 ++-
 sw/source/uibase/uiview/viewtab.cxx|4 +-
 ucb/source/core/ucbstore.cxx   |2 -
 ucb/source/ucp/webdav-neon/ContentProperties.cxx   |4 +-
 vcl/source/bitmap/BitmapProcessor.cxx  |6 ++--
 vcl/source/filter/wmf/wmfwr.cxx|2 -
 vcl/source/gdi/print2.cxx  |6 ++--
 vcl/unx/generic/gdi/salgdi.cxx |4 +-
 vcl/unx/generic/print/genpspgraphics.cxx   |2 -
 xmloff/source/draw/sdxmlexp.cxx|4 +-
 xmloff/source/style/impastpl.cxx   |4 +-
 59 files changed, 138 insertions(+), 102 deletions(-)

New commits:
commit 868d8c8f0fdf376b0a3eb545ee841c9c12ffee3b
Author: Noel Grandin 
Date:   Fri Jul 7 08:42:54 2017 +0200

loplugin:unnecessaryparen handle parens inside call expr

stick to single-arg function calls, sometimes parens in multi-arg calls
might be there for clarity

Change-Id: Ib80190c571ce65b5d219a88056687042de749e74
Reviewed-on: https://gerrit.libreoffice.org/39676
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index 2a15f3497283..ea15907cc1e5 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -43,7 +43,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 
 OString name(av[0]);
 sal_Int32 index = name.lastIndexOf(SEPARATOR);
-m_program = name.copy((index > 0 ? index+1 : 0));
+m_program = name.copy(index > 0 ? index+1 : 0);
 
 if (ac < 2)
 {
diff --git a/codemaker/source/javamaker/javaoptions.cxx 
b/codemaker/source/javamaker/javaoptions.cxx
index cffc74451ac7..a09107a99b53 100644
--- 

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

2017-06-20 Thread Noel Grandin
 codemaker/source/codemaker/global.cxx   |2 
 comphelper/source/container/embeddedobjectcontainer.cxx |3 
 comphelper/source/property/ChainablePropertySet.cxx |4 
 comphelper/source/property/MasterPropertySet.cxx|4 
 comphelper/source/property/opropertybag.cxx |2 
 comphelper/source/streaming/oslfile2streamwrap.cxx  |3 
 connectivity/source/commontools/FValue.cxx  |3 
 connectivity/source/commontools/TIndexColumns.cxx   |3 
 connectivity/source/commontools/TIndexes.cxx|3 
 connectivity/source/drivers/calc/CTable.cxx |3 
 connectivity/source/drivers/dbase/DTable.cxx|3 
 connectivity/source/drivers/firebird/Connection.cxx |3 
 connectivity/source/drivers/firebird/DatabaseMetaData.cxx   |   21 +---
 connectivity/source/drivers/firebird/StatementCommonBase.cxx|3 
 connectivity/source/drivers/hsqldb/HDriver.cxx  |3 
 connectivity/source/drivers/jdbc/CallableStatement.cxx  |   10 -
 connectivity/source/drivers/jdbc/ResultSet.cxx  |   10 -
 connectivity/source/drivers/mork/MDatabaseMetaData.cxx  |   51 
+++---
 connectivity/source/drivers/mork/MStatement.cxx |3 
 connectivity/source/drivers/mysql/YCatalog.cxx  |4 
 connectivity/source/drivers/mysql/YTables.cxx   |2 
 connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx |3 
 connectivity/source/drivers/postgresql/pq_tools.cxx |3 
 connectivity/source/drivers/postgresql/pq_xuser.cxx |3 
 24 files changed, 54 insertions(+), 98 deletions(-)

New commits:
commit 8ed77fae3e5e9e5f7409e03d5e4586f428a65c86
Author: Noel Grandin 
Date:   Tue Jun 20 09:26:05 2017 +0200

loplugin:oncevar in codemaker..connectivity

Change-Id: Ia479d9d3d459a699dfc5c1148d01c35e8bc973bd
Reviewed-on: https://gerrit.libreoffice.org/39000
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/codemaker/global.cxx 
b/codemaker/source/codemaker/global.cxx
index 7f80faec432a..49ce44be7908 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -294,7 +294,7 @@ void FileStream::createTempFile(const OString& sPath)
 
 if (osl_createTempFile(sTmpPath.pData, _file, ) == 
osl_File_E_None) {
 #ifdef SAL_UNX
-sal_uInt64 uAttr = osl_File_Attribute_OwnWrite |
+sal_uInt64 const uAttr = osl_File_Attribute_OwnWrite |
osl_File_Attribute_OwnRead |
osl_File_Attribute_GrpWrite |
osl_File_Attribute_GrpRead |
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx 
b/comphelper/source/container/embeddedobjectcontainer.cxx
index 89068adafc19..2a045edf863c 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -214,12 +214,11 @@ void EmbeddedObjectContainer::CloseEmbeddedObjects()
 
 OUString EmbeddedObjectContainer::CreateUniqueObjectName()
 {
-OUString aPersistName("Object ");
 OUString aStr;
 sal_Int32 i=1;
 do
 {
-aStr = aPersistName + OUString::number( i++ );
+aStr = "Object " + OUString::number( i++ );
 }
 while( HasEmbeddedObject( aStr ) );
 // TODO/LATER: should we consider deleted objects?
diff --git a/comphelper/source/property/ChainablePropertySet.cxx 
b/comphelper/source/property/ChainablePropertySet.cxx
index c847b393030b..258b6dad0495 100644
--- a/comphelper/source/property/ChainablePropertySet.cxx
+++ b/comphelper/source/property/ChainablePropertySet.cxx
@@ -194,9 +194,7 @@ PropertyState SAL_CALL 
ChainablePropertySet::getPropertyState( const OUString& P
 if( aIter == mxInfo->maMap.end())
 throw UnknownPropertyException( PropertyName, static_cast< 
XPropertySet* >( this ) );
 
-PropertyState aState(PropertyState_AMBIGUOUS_VALUE);
-
-return aState;
+return PropertyState_AMBIGUOUS_VALUE;
 }
 
 Sequence< PropertyState > SAL_CALL ChainablePropertySet::getPropertyStates( 
const Sequence< OUString >& rPropertyNames )
diff --git a/comphelper/source/property/MasterPropertySet.cxx 
b/comphelper/source/property/MasterPropertySet.cxx
index f4df2305e6c6..3f83b12b2be4 100644
--- a/comphelper/source/property/MasterPropertySet.cxx
+++ b/comphelper/source/property/MasterPropertySet.cxx
@@ -322,8 +322,6 @@ PropertyState SAL_CALL MasterPropertySet::getPropertyState( 
const OUString& Prop
 if( aIter == mxInfo->maMap.end())
 throw UnknownPropertyException( PropertyName, static_cast< 
XPropertySet* >( this ) );
 
-PropertyState aState(PropertyState_AMBIGUOUS_VALUE);
-
 

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

2017-06-04 Thread Arnaud Versini
 codemaker/source/cppumaker/cppuoptions.cxx |   12 ++--
 codemaker/source/javamaker/javaoptions.cxx |6 +++---
 l10ntools/source/xrmmerge.cxx  |   18 +-
 oox/source/export/drawingml.cxx|2 +-
 sw/source/filter/ww8/docxsdrexport.cxx |2 +-
 5 files changed, 20 insertions(+), 20 deletions(-)

New commits:
commit c4ac732d8132b36b3817e65d2651599ebe16a7f2
Author: Arnaud Versini 
Date:   Sun Jun 4 13:52:35 2017 +0200

Remove usage of OString("")

Change-Id: I0874f81c35573048d05b3842806daa0db67f7887
Reviewed-on: https://gerrit.libreoffice.org/38386
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index c0b578c197ac..2a15f3497283 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -98,7 +98,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 throw IllegalArgument(tmp);
 }
 
-m_options["-nD"] = OString("");
+m_options["-nD"] = OString();
 break;
 case 'T':
 if (av[i][2] == '\0')
@@ -152,7 +152,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 OString tmp("'-L' could not be combined with '-C' or 
'-CS' option");
 throw IllegalArgument(tmp);
 }
-m_options["-L"] = OString("");
+m_options["-L"] = OString();
 break;
 case 'C':
 if (av[i][2] == 'S')
@@ -173,7 +173,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 OString tmp("'-CS' could not be combined with '-L' 
or '-C' option");
 throw IllegalArgument(tmp);
 }
-m_options["-CS"] = OString("");
+m_options["-CS"] = OString();
 break;
 }
 else if (av[i][2] != '\0')
@@ -192,7 +192,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 OString tmp("'-C' could not be combined with '-L' or 
'-CS' option");
 throw IllegalArgument(tmp);
 }
-m_options["-C"] = OString("");
+m_options["-C"] = OString();
 break;
 case 'G':
 if (av[i][2] == 'c')
@@ -208,7 +208,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 throw IllegalArgument(tmp);
 }
 
-m_options["-Gc"] = OString("");
+m_options["-Gc"] = OString();
 break;
 }
 else if (av[i][2] != '\0')
@@ -222,7 +222,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 throw IllegalArgument(tmp);
 }
 
-m_options["-G"] = OString("");
+m_options["-G"] = OString();
 break;
 case 'X': // support for eXtra type rdbs
 {
diff --git a/codemaker/source/javamaker/javaoptions.cxx 
b/codemaker/source/javamaker/javaoptions.cxx
index 510fedc4b4b3..cffc74451ac7 100644
--- a/codemaker/source/javamaker/javaoptions.cxx
+++ b/codemaker/source/javamaker/javaoptions.cxx
@@ -91,7 +91,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 throw IllegalArgument(tmp);
 }
 
-m_options["-nD"] = OString("");
+m_options["-nD"] = OString();
 break;
 case 'T':
 if (av[i][2] == '\0')
@@ -139,7 +139,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 throw IllegalArgument(tmp);
 }
 
-m_options["-Gc"] = OString("");
+m_options["-Gc"] = OString();
 break;
 } else if (av[i][2] != '\0')
 {
@@ -152,7 +152,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 throw IllegalArgument(tmp);
 }
 
-m_options["-G"] = OString("");
+m_options["-G"] = OString();
 break;
 case 'X': // support for eXtra type rdbs
 {
diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index 

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

2017-04-30 Thread Julien Nabet
 codemaker/source/cppumaker/cpputype.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 097bec4b78160d688f3afc7e0cd87b21aad51e4e
Author: Julien Nabet 
Date:   Sun Apr 30 23:10:43 2017 +0200

cppcheck: duplicateBreak

Change-Id: Ia33dddfba35da3b495aae4edabe80b1a560674cd
Reviewed-on: https://gerrit.libreoffice.org/37111
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index d4dac2e011d5..a29c6610bfa3 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -530,7 +530,6 @@ void CppuType::dumpInitializer(
 << (dynamic_cast< unoidl::EnumTypeEntity * >(ent.get())->
 getMembers()[0].name);
 break;
-break;
 case codemaker::UnoType::Sort::String:
 case codemaker::UnoType::Sort::Type:
 case codemaker::UnoType::Sort::Any:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-04-04 Thread Stephan Bergmann
 codemaker/source/cppumaker/cpputype.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a2d1a73304a2ff378ca05ff87848e04dbfdc0e4e
Author: Stephan Bergmann 
Date:   Tue Apr 4 14:45:01 2017 +0200

More commit resurrection

(why do people do such silly reformatting?)

Change-Id: Ie9d45d7dfccb000f53fa5e8dc456f1e7c033af18

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 9b721695faf6..3d442d9c625d 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -554,8 +554,8 @@ void CppuType::dumpHFileContent(
 dumpHeaderDefine(out, "HDL");
 out << "\n";
 includes.dump(out, nullptr, false);
-// 'exceptions = false' would be wrong for services/singletons, but
-// those don't dump .hdl files anyway
+// 'exceptions = false' would be wrong for services/singletons, but
+// those don't dump .hdl files anyway
 out << ("\nnamespace com { namespace sun { namespace star { namespace uno"
 " { class Type; } } } }\n\n");
 if (codemaker::cppumaker::dumpNamespaceOpen(out, name_, false)) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-04-04 Thread Stephan Bergmann
 codemaker/source/cppumaker/cpputype.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 13adffdfeb5b6068502cfdeb52dd206d2a8f3bf1
Author: Stephan Bergmann 
Date:   Tue Apr 4 14:41:14 2017 +0200

Move comment back to where it makes sense

It appertains to the preceding code, not the following, so it was indented 
for a
subtle reason.

Change-Id: I032033f04a1ca3a91024c11de74ef96527562b41

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index a657389d6a4d..9b721695faf6 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -138,9 +138,8 @@ bool isBootstrapType(OUString const & name)
 "com.sun.star.uno.XReference",
 "com.sun.star.uno.XUnloadingPreference",
 "com.sun.star.uno.XWeak",
-"com.sun.star.util.XMacroExpander"
-};
-// cf. cppuhelper/unotypes/Makefile UNOTYPES (plus missing dependencies)
+"com.sun.star.util.XMacroExpander" };
+// cf. cppuhelper/unotypes/Makefile UNOTYPES (plus missing 
dependencies)
 for (std::size_t i = 0; i < SAL_N_ELEMENTS(names); ++i) {
 if (name.equalsAscii(names[i])) {
 return true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: codemaker/source connectivity/source cppu/qa desktop/qa desktop/source extensions/source filter/source forms/source framework/inc framework/source i18npool/qa i18npool/

2017-04-04 Thread Noel Grandin
 codemaker/source/commoncpp/commoncpp.cxx   |1 
 codemaker/source/cppumaker/cpputype.cxx|  958 
+-
 connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx |2 
 connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx |   12 
 connectivity/source/drivers/postgresql/pq_tools.cxx|   30 
 cppu/qa/cppumaker/test_cppumaker.cxx   |9 
 cppu/qa/test_unotype.cxx   |   65 
 desktop/qa/desktop_lib/test_desktop_lib.cxx|9 
 desktop/source/lib/lokinteractionhandler.cxx   |4 
 extensions/source/propctrlr/formcomponenthandler.cxx   |   10 
 extensions/source/propctrlr/pushbuttonnavigation.cxx   |   25 
 extensions/source/propctrlr/pushbuttonnavigation.hxx   |3 
 filter/source/msfilter/escherex.cxx|2 
 filter/source/svg/svgexport.cxx|4 
 forms/source/component/DatabaseForm.cxx|6 
 framework/inc/uielement/uielement.hxx  |6 
 framework/source/layoutmanager/helpers.cxx |2 
 framework/source/layoutmanager/helpers.hxx |2 
 framework/source/layoutmanager/layoutmanager.cxx   |2 
 framework/source/layoutmanager/toolbarlayoutmanager.cxx|  116 -
 framework/source/services/frame.cxx|2 
 i18npool/qa/cppunit/test_textsearch.cxx|2 
 i18npool/source/inputchecker/inputsequencechecker.cxx  |   11 
 i18npool/source/transliteration/transliterationImpl.cxx|   40 
 pyuno/source/module/pyuno_runtime.cxx  |   45 
 sw/qa/extras/rtfexport/rtfexport.cxx   |   70 
 sw/qa/extras/rtfimport/rtfimport.cxx   |   56 
 27 files changed, 717 insertions(+), 777 deletions(-)

New commits:
commit 5676ced82539d9e40bde6196d2aa3b2e4c7b3fdb
Author: Noel Grandin 
Date:   Wed Feb 22 16:39:20 2017 +0200

make UNO enums scoped for internal LO code

this modifies codemaker so that, for an UNO enum, we generate code
that effectively looks like:

   #ifdef LIBO_INTERNAL_ONLY && HAVE_CX11_CONSTEXPR
   enum class XXX {
   ONE = 1
   };
   constexpr auto ONE = XXX_ONE;
   #else
  ...the old normal way..
   #endif

which means that for LO internal code, the enums are scoped.

The "constexpr auto" trick acts like an alias so we don't have to
use scoped naming everywhere.

Change-Id: I3054ecb230e8666ce98b4a9cb87b384df5f64fb4
Reviewed-on: https://gerrit.libreoffice.org/34546
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/commoncpp/commoncpp.cxx 
b/codemaker/source/commoncpp/commoncpp.cxx
index 4f1840c54e43..a4279e3a98dd 100644
--- a/codemaker/source/commoncpp/commoncpp.cxx
+++ b/codemaker/source/commoncpp/commoncpp.cxx
@@ -63,7 +63,6 @@ OString scopedCppName(OString const & type, bool ns_alias)
 return s;
 }
 
-
 OString translateUnoToCppType(
 codemaker::UnoType::Sort sort, OUString const & nucleus)
 {
diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 659061a8fd34..a657389d6a4d 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -46,9 +46,11 @@
 #include "dumputils.hxx"
 #include "includes.hxx"
 
-namespace {
+namespace
+{
 
-bool isBootstrapType(OUString const & name) {
+bool isBootstrapType(OUString const & name)
+{
 static char const * const names[] = {
 "com.sun.star.beans.Property",
 "com.sun.star.beans.PropertyAttribute",
@@ -136,8 +138,9 @@ bool isBootstrapType(OUString const & name) {
 "com.sun.star.uno.XReference",
 "com.sun.star.uno.XUnloadingPreference",
 "com.sun.star.uno.XWeak",
-"com.sun.star.util.XMacroExpander" };
-// cf. cppuhelper/unotypes/Makefile UNOTYPES (plus missing 
dependencies)
+"com.sun.star.util.XMacroExpander"
+};
+// cf. cppuhelper/unotypes/Makefile UNOTYPES (plus missing dependencies)
 for (std::size_t i = 0; i < SAL_N_ELEMENTS(names); ++i) {
 if (name.equalsAscii(names[i])) {
 return true;
@@ -146,7 +149,8 @@ bool isBootstrapType(OUString const & name) {
 return false;
 }
 
-class CppuType {
+class CppuType
+{
 public:
 CppuType(
 OUString const & name, rtl::Reference< TypeManager > const & typeMgr);
@@ -166,8 +170,9 @@ public:
 codemaker::GeneratedTypeSet & generated, CppuOptions const & options);
 
 virtual void dumpHdlFile(

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

2017-02-25 Thread Stephan Bergmann
 codemaker/source/cppumaker/cppuoptions.cxx |2 +-
 codemaker/source/javamaker/javaoptions.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 5222dd86dd3516c106a2e77e77885e074e1f7577
Author: Stephan Bergmann 
Date:   Sat Feb 25 10:10:02 2017 +0100

loplugin:loopvartoosmall

Change-Id: Ifd83cb180072304511ad8eb031dcf2a867e97e62

diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index 3a0bdb5..c0b578c 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -35,7 +35,7 @@ using ::rtl::OString;
 bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile)
 {
 boolret = true;
-sal_uInt16  i=0;
+int i=0;
 
 if (!bCmdFile)
 {
diff --git a/codemaker/source/javamaker/javaoptions.cxx 
b/codemaker/source/javamaker/javaoptions.cxx
index 97eef36..510fedc 100644
--- a/codemaker/source/javamaker/javaoptions.cxx
+++ b/codemaker/source/javamaker/javaoptions.cxx
@@ -33,7 +33,7 @@
 bool JavaOptions::initOptions(int ac, char* av[], bool bCmdFile)
 {
 boolret = true;
-sal_uInt16  i=0;
+int i=0;
 
 if (!bCmdFile)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-02-08 Thread Stephan Bergmann
 codemaker/source/cppumaker/cpputype.cxx |   26 ++---
 codemaker/source/cppumaker/dependencies.cxx |   48 +---
 codemaker/source/cppumaker/dependencies.hxx |9 ++--
 codemaker/source/cppumaker/includes.cxx |   54 +---
 codemaker/source/cppumaker/includes.hxx |5 +-
 5 files changed, 72 insertions(+), 70 deletions(-)

New commits:
commit 55717b14e0482c085595069d124ac9dd0c4e69c5
Author: Stephan Bergmann 
Date:   Wed Feb 8 08:48:28 2017 +0100

Remove newly-unnecessary #includes from cppumaker-generated files

...after e57ca02849c3d87142ff5ff9099a212e72b8139c "Remove dynamic exception
specifications" dropped uses of UNO exception types from those generated 
files.
This needed first adapting client code that implicitly depended on those
#includes in the generated files it included ("Add missing #includes":
6dce9c6757823b9e89863716ae70ff4e8ddd4e60,
a34d9150b419ee7471b96599d877ff1091d6b567,
fed3783e77e00635e50622e7229b06c9e25451f1).

Change-Id: Ia1defda2d586b69092f53feef3644875192cbea4
Reviewed-on: https://gerrit.libreoffice.org/34014
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 6432bae..659061a 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -468,7 +468,6 @@ void 
CppuType::addDefaultHIncludes(codemaker::cppumaker::Includes & includes)
 if (m_typeMgr->getSort(name_)
 == codemaker::UnoType::Sort::Interface)
 {
-includes.addException();
 includes.addReference();
 }
 }
@@ -481,7 +480,6 @@ void 
CppuType::addDefaultHxxIncludes(codemaker::cppumaker::Includes & includes)
 if (m_typeMgr->getSort(name_)
 == codemaker::UnoType::Sort::Interface)
 {
-includes.addException();
 includes.addReference();
 }
 }
@@ -542,7 +540,9 @@ void CppuType::dumpHFileContent(
 addDefaultHIncludes(includes);
 dumpHeaderDefine(out, "HDL");
 out << "\n";
-includes.dump(out, nullptr);
+includes.dump(out, nullptr, false);
+// 'exceptions = false' would be wrong for services/singletons, but
+// those don't dump .hdl files anyway
 out << ("\nnamespace com { namespace sun { namespace star { namespace uno"
 " { class Type; } } } }\n\n");
 if (codemaker::cppumaker::dumpNamespaceOpen(out, name_, false)) {
@@ -1156,7 +1156,7 @@ void InterfaceType::dumpHppFile(
 OUString headerDefine(dumpHeaderDefine(out, "HPP"));
 out << "\n";
 addDefaultHxxIncludes(includes);
-includes.dump(out, _);
+includes.dump(out, _, !(m_cppuTypeLeak || m_cppuTypeDynamic));
 out << "\n";
 dumpGetCppuType(out);
 out << "\n::css::uno::Type const & "
@@ -1632,7 +1632,7 @@ void ConstantGroup::dumpHdlFile(
 OUString headerDefine(dumpHeaderDefine(out, "HDL"));
 out << "\n";
 addDefaultHIncludes(includes);
-includes.dump(out, nullptr);
+includes.dump(out, nullptr, true);
 out << "\n";
 if (codemaker::cppumaker::dumpNamespaceOpen(out, name_, true)) {
 out << "\n";
@@ -1845,7 +1845,7 @@ void PlainStructType::dumpHppFile(
 {
 OUString headerDefine(dumpHeaderDefine(out, "HPP"));
 out << "\n";
-includes.dump(out, _);
+includes.dump(out, _, true);
 out << "\n";
 if (codemaker::cppumaker::dumpNamespaceOpen(out, name_, false)) {
 out << "\n";
@@ -2240,7 +2240,7 @@ void PolyStructType::dumpHppFile(
 {
 OUString headerDefine(dumpHeaderDefine(out, "HPP"));
 out << "\n";
-includes.dump(out, _);
+includes.dump(out, _, true);
 out << "\n";
 if (codemaker::cppumaker::dumpNamespaceOpen(out, name_, false)) {
 out << "\n";
@@ -2732,7 +2732,7 @@ void ExceptionType::dumpHppFile(
 OUString headerDefine(dumpHeaderDefine(out, "HPP"));
 out << "\n";
 addDefaultHxxIncludes(includes);
-includes.dump(out, _);
+includes.dump(out, _, true);
 out << "\n";
 if (codemaker::cppumaker::dumpNamespaceOpen(out, name_, false)) {
 out << "\n";
@@ -3161,7 +3161,7 @@ void EnumType::dumpHppFile(
 o << "\n";
 
 addDefaultHxxIncludes(includes);
-includes.dump(o, _);
+includes.dump(o, _, true);
 o << "\n";
 
 dumpGetCppuType(o);
@@ -3295,7 +3295,7 @@ void Typedef::dumpHdlFile(
 o << "\n";
 
 addDefaultHIncludes(includes);
-includes.dump(o, nullptr);
+includes.dump(o, nullptr, true);
 o << "\n";
 
 if (codemaker::cppumaker::dumpNamespaceOpen(o, name_, false)) {
@@ -3325,7 +3325,7 @@ void Typedef::dumpHppFile(
 o << "\n";
 
 addDefaultHxxIncludes(includes);
-includes.dump(o, _);
+includes.dump(o, _, true);
 o << "\n";
 
 o << "\n#endif // "<< headerDefine << "\n";
@@ -3445,7 +3445,7 @@ void ServiceType::dumpHppFile(
 

[Libreoffice-commits] core.git: codemaker/source compilerplugins/clang cppcanvas/source cui/source editeng/source filter/source hwpfilter/source i18npool/source include/codemaker l10ntools/source lotu

2017-02-01 Thread Noel Grandin
 codemaker/source/codemaker/exceptiontree.cxx |9 -
 codemaker/source/cppumaker/cpputype.cxx  |8 -
 codemaker/source/javamaker/javatype.cxx  |4 
 compilerplugins/clang/useuniqueptr.cxx   |   47 +
 cppcanvas/source/mtfrenderer/emfplus.cxx |7 
 cui/source/dialogs/hltpbase.cxx  |5 
 editeng/source/outliner/outlvw.cxx   |5 
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx |   10 -
 hwpfilter/source/hwpreader.cxx   |4 
 i18npool/source/localedata/LocaleNode.cxx|   17 --
 include/codemaker/exceptiontree.hxx  |3 
 l10ntools/source/lngmerge.cxx|7 
 l10ntools/source/propmerge.cxx   |6 
 lotuswordpro/source/filter/lwpgrfobj.cxx |5 
 lotuswordpro/source/filter/lwpidxmgr.cxx |   19 +-
 lotuswordpro/source/filter/lwppara.cxx   |4 
 lotuswordpro/source/filter/lwptablelayout.cxx|5 
 o3tl/qa/test-sorted_vector.cxx   |  150 ---
 registry/source/reflwrit.cxx |4 
 registry/source/regimpl.cxx  |7 
 sal/qa/osl/process/osl_Thread.cxx|   10 -
 sal/qa/rtl/oustring/rtl_OUString2.cxx|5 
 sal/qa/rtl/process/rtl_Process.cxx   |5 
 sal/qa/rtl/random/rtl_random.cxx |   50 ++
 sc/source/core/tool/chartpos.cxx |3 
 sc/source/core/tool/rangeutl.cxx |8 -
 sc/source/filter/rtf/eeimpars.cxx|7 
 sc/source/ui/view/formatsh.cxx   |3 
 sccomp/source/solver/LpsolveSolver.cxx   |6 
 scripting/source/stringresource/stringresource.cxx   |8 -
 sd/source/filter/eppt/pptexsoundcollection.cxx   |7 
 sd/source/filter/ppt/pptin.cxx   |8 -
 sd/source/filter/ppt/propread.cxx|   47 ++---
 sd/source/ui/docshell/docshel2.cxx   |5 
 sd/source/ui/unoidl/unomodel.cxx |8 -
 starmath/source/mathmlexport.cxx |   12 -
 stoc/source/inspect/introspection.cxx|7 
 svtools/source/contnr/svtabbx.cxx|5 
 sw/source/core/access/accfrmobjmap.cxx   |   11 -
 sw/source/core/access/accpara.cxx|7 
 sw/source/core/crsr/crsrsh.cxx   |7 
 sw/source/core/doc/doccomp.cxx   |   19 +-
 sw/source/core/frmedt/fecopy.cxx |9 -
 sw/source/core/layout/paintfrm.cxx   |3 
 sw/source/core/text/pormulti.cxx |5 
 sw/source/core/txtnode/fntcache.cxx  |   72 -
 sw/source/core/unocore/unodraw.cxx   |5 
 sw/source/filter/html/swhtml.cxx |4 
 sw/source/filter/ww8/wrtw8esh.cxx|7 
 sw/source/filter/ww8/wrtww8.cxx  |8 -
 sw/source/filter/ww8/wrtww8gr.cxx|3 
 sw/source/filter/ww8/ww8par2.cxx |7 
 sw/source/filter/ww8/ww8scan.cxx |   36 ++--
 sw/source/ui/chrdlg/chardlg.cxx  |3 
 sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx |7 
 tools/source/generic/poly.cxx|3 
 tools/source/inet/inetmime.cxx   |7 
 vcl/source/gdi/bitmap4.cxx   |6 
 vcl/source/gdi/impgraph.cxx  |8 -
 vcl/source/gdi/salgdilayout.cxx  |   10 -
 60 files changed, 341 insertions(+), 436 deletions(-)

New commits:
commit 2489000d3fd66319a8355fd4e37cfdfda47296d0
Author: Noel Grandin 
Date:   Tue Jan 31 14:46:38 2017 +0200

loplugin:useuniqueptr extend to check local vars

just the simple and obvious case for now, of a local var being allocated
and deleted inside a single local block, and the delete happening at the
end of the block

Change-Id: I3a7a094da543debdcd2374737c2ecff91d644625
Reviewed-on: https://gerrit.libreoffice.org/33749
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/codemaker/exceptiontree.cxx 
b/codemaker/source/codemaker/exceptiontree.cxx
index 0f63a5b..e9edd6d 100644
--- a/codemaker/source/codemaker/exceptiontree.cxx
+++ b/codemaker/source/codemaker/exceptiontree.cxx
@@ -36,14 +36,11 @@ using codemaker::ExceptionTreeNode;
 
 ExceptionTreeNode * ExceptionTreeNode::add(rtl::OString const & theName) {
 std::unique_ptr< ExceptionTreeNode > node(new ExceptionTreeNode(theName));
-children.push_back(node.get());
-return node.release();
+

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

2017-01-20 Thread Stephan Bergmann
 codemaker/source/cppumaker/cpputype.cxx |   56 ++--
 1 file changed, 5 insertions(+), 51 deletions(-)

New commits:
commit 550e0e42d9ccef1244299b2d6cbda18549f8af19
Author: Stephan Bergmann 
Date:   Fri Jan 20 12:33:07 2017 +0100

Remove dynamic exception specifications from cppumaker-generated code

See the mail thread starting at


"Dynamic Exception Specifications" for details.

This leaves some #include <...Exception.hpp> in the generated code that are 
no
longer needed by the generated files themselves.  But C++ implementation 
classes
still use dynamic exception specifications and usually don't repeat the 
relevant
#includes, so postpone removal until the implementation classes are cleaned 
up
in a later step.

Change-Id: Ifb7df3bb12f7f10c655b85cb0626afe5050479a4

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index e3ce817..47aab6c 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -1103,10 +1103,6 @@ private:
 virtual sal_uInt32 checkInheritedMemberCount() const override
 { return BaseOffset(m_typeMgr, entity_).get(); }
 
-static void dumpExceptionSpecification(
-FileStream & out, std::vector< OUString > const & exceptions,
-bool runtimeException);
-
 void dumpExceptionTypeName(
 FileStream & out, OUString const & prefix, sal_uInt32 index,
 OUString const & name);
@@ -1185,18 +1181,14 @@ void InterfaceType::dumpAttributes(FileStream & out) {
 dumpDeprecation(out, depr);
 out << "virtual ";
 dumpType(out, attr.type);
-out << " SAL_CALL get" << attr.name << "()";
-dumpExceptionSpecification(out, attr.getExceptions, true);
-out << " = 0;\n";
+out << " SAL_CALL get" << attr.name << "() = 0;\n";
 if (!attr.readOnly) {
 bool byRef = passByReference(attr.type);
 out << indent();
 dumpDeprecation(out, depr);
 out << "virtual void SAL_CALL set" << attr.name << "( ";
 dumpType(out, attr.type, byRef, byRef);
-out << " _" << attr.name.toAsciiLowerCase() << " )";
-dumpExceptionSpecification(out, attr.setExceptions, true);
-out << " = 0;\n";
+out << " _" << attr.name.toAsciiLowerCase() << " ) = 0;\n";
 }
 }
 }
@@ -1212,9 +1204,7 @@ void InterfaceType::dumpMethods(FileStream & out) {
 out << "virtual ";
 dumpType(out, method.returnType);
 out << " SAL_CALL " << method.name << "(";
-if (method.parameters.empty()) {
-out << ")";
-} else {
+if (!method.parameters.empty()) {
 out << " ";
 for (std::vector< unoidl::InterfaceTypeEntity::Method::Parameter 
>::
  const_iterator j(method.parameters.begin());
@@ -1239,11 +1229,9 @@ void InterfaceType::dumpMethods(FileStream & out) {
 out << ", ";
 }
 }
-out << " )";
+out << " ";
 }
-dumpExceptionSpecification(
-out, method.exceptions, method.name != "acquire" && method.name != 
"release");
-out << " = 0;\n";
+out << ") = 0;\n";
 }
 }
 
@@ -1582,40 +1570,6 @@ void InterfaceType::dumpMethodsCppuDecl(
 }
 }
 
-void InterfaceType::dumpExceptionSpecification(
-FileStream & out, std::vector< OUString > const & exceptions,
-bool runtimeException)
-{
-// Exception specifications are undesirable in production code, but make
-// for useful assertions in debug builds (on platforms where they are
-// enforced at runtime):
-#if !defined DBG_UTIL
-out << " /*";
-#endif
-out << " throw (";
-bool bFirst = true;
-for (const OUString& ex : exceptions)
-{
-if (ex != "com.sun.star.uno.RuntimeException") {
-if (!bFirst) {
-out << ", ";
-}
-out << codemaker::cpp::scopedCppName(u2b(ex));
-bFirst = false;
-}
-}
-if (runtimeException) {
-if (!bFirst) {
-out << ", ";
-}
-out << "::css::uno::RuntimeException, ::std::exception";
-}
-out << ")";
-#if !defined DBG_UTIL
-out << " */";
-#endif
-}
-
 void InterfaceType::dumpExceptionTypeName(
 FileStream & out, OUString const & prefix, sal_uInt32 index,
 OUString const & name)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: codemaker/source compilerplugins/clang sal/qa sdext/source sw/source

2017-01-11 Thread Stephan Bergmann
 codemaker/source/codemaker/global.cxx   |2 
 compilerplugins/clang/stringconstant.cxx|  142 +---
 sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx |4 
 sal/qa/rtl/strings/test_oustring_convert.cxx|   24 +-
 sal/qa/rtl/strings/test_oustring_endswith.cxx   |5 
 sdext/source/pdfimport/pdfparse/pdfentries.cxx  |2 
 sw/source/filter/html/css1atr.cxx   |4 
 7 files changed, 139 insertions(+), 44 deletions(-)

New commits:
commit 584262fed1368dba382d88dfd25fe35ac7d4b349
Author: Stephan Bergmann 
Date:   Wed Jan 11 16:39:20 2017 +0100

loplugin:stringconstant: handle OStringBuffer::append

Change-Id: I283da52c0ee2b63c19e31e9a61ab24997c037a6a

diff --git a/codemaker/source/codemaker/global.cxx 
b/codemaker/source/codemaker/global.cxx
index c3dc266..1772309 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -99,7 +99,7 @@ OString createFileNameFromType( const OString& destination,
 fileNameBuf.append(destination.getStr(), destination.getLength());
 
 if (bWithSeparator)
-fileNameBuf.append("/", 1);
+fileNameBuf.append("/");
 
 fileNameBuf.append(type.getStr(), type.getLength());
 fileNameBuf.append(postfix.getStr(), postfix.getLength());
diff --git a/compilerplugins/clang/stringconstant.cxx 
b/compilerplugins/clang/stringconstant.cxx
index 259cee7..cab25bb 100644
--- a/compilerplugins/clang/stringconstant.cxx
+++ b/compilerplugins/clang/stringconstant.cxx
@@ -106,7 +106,7 @@ private:
 std::string describeChangeKind(ChangeKind kind);
 
 bool isStringConstant(
-Expr const * expr, unsigned * size, bool * nonAscii,
+Expr const * expr, unsigned * size, bool * nonArray, bool * nonAscii,
 bool * embeddedNuls, bool * terminatingNul);
 
 bool isZero(Expr const * expr);
@@ -477,11 +477,13 @@ bool StringConstant::VisitCallExpr(CallExpr const * expr) 
{
 && fdecl->getNumParams() == 1)
 {
 unsigned n;
+bool nonArray;
 bool non;
 bool emb;
 bool trm;
 if (!isStringConstant(
-expr->getArg(0)->IgnoreParenImpCasts(), , , , ))
+expr->getArg(0)->IgnoreParenImpCasts(), , , ,
+, ))
 {
 return true;
 }
@@ -516,12 +518,13 @@ bool StringConstant::VisitCallExpr(CallExpr const * expr) 
{
 {
 for (unsigned i = 0; i != 2; ++i) {
 unsigned n;
+bool nonArray;
 bool non;
 bool emb;
 bool trm;
 if (!isStringConstant(
-expr->getArg(i)->IgnoreParenImpCasts(), , , ,
-))
+expr->getArg(i)->IgnoreParenImpCasts(), , , 
,
+, ))
 {
 continue;
 }
@@ -560,12 +563,13 @@ bool StringConstant::VisitCallExpr(CallExpr const * expr) 
{
 {
 for (unsigned i = 0; i != 2; ++i) {
 unsigned n;
+bool nonArray;
 bool non;
 bool emb;
 bool trm;
 if (!isStringConstant(
-expr->getArg(i)->IgnoreParenImpCasts(), , , ,
-))
+expr->getArg(i)->IgnoreParenImpCasts(), , , 
,
+, ))
 {
 continue;
 }
@@ -603,11 +607,13 @@ bool StringConstant::VisitCallExpr(CallExpr const * expr) 
{
 && fdecl->getNumParams() == 1)
 {
 unsigned n;
+bool nonArray;
 bool non;
 bool emb;
 bool trm;
 if (!isStringConstant(
-expr->getArg(1)->IgnoreParenImpCasts(), , , , ))
+expr->getArg(1)->IgnoreParenImpCasts(), , , ,
+, ))
 {
 return true;
 }
@@ -658,6 +664,78 @@ bool StringConstant::VisitCallExpr(CallExpr const * expr) {
 TreatEmpty::Error);
 return true;
 }
+if (dc.Function("append").Class("OStringBuffer").Namespace("rtl")
+.GlobalNamespace())
+{
+switch (fdecl->getNumParams()) {
+case 1:
+{
+// char const * const s = "foo"; b.append(s) ->
+// char const s[] = "foo"; b.append(s):
+unsigned n;
+bool nonArray;
+bool non;
+bool emb;
+bool trm;
+if (!isStringConstant(
+expr->getArg(0)->IgnoreParenImpCasts(), , ,
+, , ))
+{
+return true;
+}
+if (non || emb) {
+return true;
+}
+if (!trm) {
+report(
+DiagnosticsEngine::Warning,
+("call of %0 with string 

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

2016-09-23 Thread Stephan Bergmann
 codemaker/source/cppumaker/cpputype.cxx |   11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 18cd08ae42b0fbd1e8ded8c046a5c801b30b968c
Author: Stephan Bergmann 
Date:   Fri Sep 23 15:17:30 2016 +0200

cid#1371162 etc.: Move semantics for cppumaker-generated UNO exception 
classes

For UNO ABI reasons, these classes need to be CPPU_GCC_DLLPUBLIC_EXPORT (so
their RTTI symbols get exported), so they are careful to explicitly declare 
any
special member functions that would otherwise be declared implicitly, to 
mark
them CPPU_GCC_DLLPRIVATE.  But for LIBO_INTERNAL_ONLY, we always use
-fvisibility-inlines-hidden (except for MSVC, where it doesn't matter, as
CPPU_GCC_DLLPRIVATE expands to nothing there, either), so can leave those
functions implicitly declared, so not to prevent move ctor and move assign 
op
from being implicitly declared.

This covers cid#s 1371143, 1371162, 1371185, 1371189, 1371290, and 1371308.

Change-Id: I468088750a02f85a4790d956c37f4c30de03f00c

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 7eac4f0..e87fed0 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -2851,8 +2851,8 @@ void ExceptionType::dumpHppFile(
 }
 out << "}\n\n";
 }
-out << indent() << id_ << "::" << id_ << "(" << id_
-<< " const & the_other)";
+out << "#if !defined LIBO_INTERNAL_ONLY\n" << indent() << id_ << "::" << 
id_
+<< "(" << id_ << " const & the_other)";
 bFirst = true;
 if (!base.isEmpty()) {
 out << ": " << codemaker::cpp::scopedCppName(u2b(base))
@@ -2882,7 +2882,7 @@ void ExceptionType::dumpHppFile(
 }
 out << indent() << "return *this;\n";
 dec();
-out << indent() << "}\n\n";
+out << indent() << "}\n#endif\n\n";
 if (codemaker::cppumaker::dumpNamespaceClose(out, name_, false)) {
 out << "\n";
 }
@@ -3066,10 +3066,11 @@ void ExceptionType::dumpDeclaration(FileStream & out) {
 }
 out << ");\n\n";
 }
-out << indent() << "inline CPPU_GCC_DLLPRIVATE " << id_ << "(" << id_
+out << "#if !defined LIBO_INTERNAL_ONLY\n" << indent()
+<< "inline CPPU_GCC_DLLPRIVATE " << id_ << "(" << id_
 << " const &);\n\n" << indent() << "inline CPPU_GCC_DLLPRIVATE ~"
 << id_ << "();\n\n" << indent() << "inline CPPU_GCC_DLLPRIVATE " << id_
-<< " & operator =(" << id_ << " const &);\n\n";
+<< " & operator =(" << id_ << " const &);\n#endif\n\n";
 for (std::vector< unoidl::ExceptionTypeEntity::Member >::const_iterator i(
  entity_->getDirectMembers().begin());
  i != entity_->getDirectMembers().end(); ++i)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-08-01 Thread nadith
 codemaker/source/cppumaker/cppuoptions.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit b38a2d57160fcb0204b05055190d3df6315f51b1
Author: nadith 
Date:   Sat Jul 30 02:01:21 2016 +0530

tdf#101185 OString concatanations for efficiently coding

example of bug fixed

Change-Id: Id9f911fa1ec43425018b00af5172e23be1274638
Reviewed-on: https://gerrit.libreoffice.org/27705
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index 209c0f2..2f7724b 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -95,8 +95,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool 
bCmdFile)
 case 'n':
 if (av[i][2] != 'D' || av[i][3] != '\0')
 {
-OString tmp("'-nD', please check");
-tmp += " your input '" + OString(av[i]) + "'";
+OString tmp = "'-nD', please check your input '" + 
OString(av[i]) + "'";
 throw IllegalArgument(tmp);
 }
 
@@ -327,8 +326,7 @@ OString CppuOptions::prepareHelp()
 
 OString CppuOptions::prepareVersion()
 {
-OString version(m_program);
-version += " Version 2.0\n\n";
+OString version = m_program + " Version 2.0\n\n";
 return version;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-06-24 Thread Noel Grandin
 codemaker/source/cppumaker/includes.cxx |6 +-
 codemaker/source/cppumaker/includes.hxx |1 -
 2 files changed, 1 insertion(+), 6 deletions(-)

New commits:
commit 19ebfdbadc214ea3f8dc27d926ce46674b1f184c
Author: Noel Grandin 
Date:   Fri Jun 24 11:30:08 2016 +0200

loplugin:singlevalfields in codemaker

Change-Id: I77e6ed891f4712aadb9085549d7699435c2da558

diff --git a/codemaker/source/cppumaker/includes.cxx 
b/codemaker/source/cppumaker/includes.cxx
index 500f8e9..0b5bc23 100644
--- a/codemaker/source/cppumaker/includes.cxx
+++ b/codemaker/source/cppumaker/includes.cxx
@@ -46,7 +46,7 @@ Includes::Includes(
 m_includeSequence(dependencies.hasSequenceDependency()),
 m_includeType(dependencies.hasTypeDependency()),
 m_includeCppuMacrosHxx(false), m_includeCppuUnotypeHxx(false),
-m_includeOslDoublecheckedlockingH(false), m_includeOslMutexHxx(false),
+m_includeOslMutexHxx(false),
 m_includeRtlStrbufHxx(false), m_includeRtlStringH(false),
 m_includeRtlTextencH(false), m_includeRtlUstrbufHxx(false),
 m_includeRtlUstringH(false),
@@ -210,10 +210,6 @@ void Includes::dump(FileStream & out, OUString const * 
companionHdl) {
 dumpEmptyLineBeforeFirst(out, );
 out << ("#include \"cppu/unotype.hxx\"\n");
 }
-if (m_includeOslDoublecheckedlockingH) {
-dumpEmptyLineBeforeFirst(out, );
-out << ("#include \"osl/doublecheckedlocking.h\"\n");
-}
 if (m_includeOslMutexHxx) {
 dumpEmptyLineBeforeFirst(out, );
 out << "#include \"osl/mutex.hxx\"\n";
diff --git a/codemaker/source/cppumaker/includes.hxx 
b/codemaker/source/cppumaker/includes.hxx
index e08923c..2a76529 100644
--- a/codemaker/source/cppumaker/includes.hxx
+++ b/codemaker/source/cppumaker/includes.hxx
@@ -81,7 +81,6 @@ private:
 bool m_includeType;
 bool m_includeCppuMacrosHxx;
 bool m_includeCppuUnotypeHxx;
-bool m_includeOslDoublecheckedlockingH;
 bool m_includeOslMutexHxx;
 bool m_includeRtlStrbufHxx;
 bool m_includeRtlStringH;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-05-12 Thread Stephan Bergmann
 codemaker/source/cppumaker/cpputype.cxx |6 +++---
 codemaker/source/javamaker/javatype.cxx |   10 --
 2 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 0dc02bb9618e9852c5b3326a678910283922ffd7
Author: Stephan Bergmann 
Date:   Thu May 12 14:14:54 2016 +0200

Silence -Werror,-Wimplicit-fallthrough under NDEBUG

Change-Id: I6abfef139197379f04e1a9df80e974c5d4021890

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 0c7be86..28411ba 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -5,7 +5,7 @@
  * 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/.
- *
+*
  * This file incorporates work covered by the following license notice:
  *
  *   Licensed to the Apache Software Foundation (ASF) under one or more
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -870,8 +871,7 @@ void CppuType::dumpCppuGetType(
 }
 break;
 case codemaker::UnoType::Sort::Typedef:
-assert(false); // this cannot happen
-// fall through
+for (;;) std::abort(); // this cannot happen
 default:
 throw CannotDumpException(
 "unexpected entity \"" + name
diff --git a/codemaker/source/javamaker/javatype.cxx 
b/codemaker/source/javamaker/javatype.cxx
index c39230a..038cd32 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -937,8 +938,7 @@ sal_uInt16 addFieldInit(
 }
 case codemaker::UnoType::Sort::Sequence:
 case codemaker::UnoType::Sort::Typedef:
-assert(false); // this cannot happen
-// fall through
+for (;;) std::abort(); // this cannot happen
 default:
 throw CannotDumpException(
 "unexpected entity \"" + fieldType
@@ -1241,8 +1241,7 @@ sal_uInt16 addLoadLocal(
 break;
 case codemaker::UnoType::Sort::Sequence:
 case codemaker::UnoType::Sort::Typedef:
-assert(false); // this cannot happen
-// fall through
+for (;;) std::abort(); // this cannot happen
 default:
 throw CannotDumpException(
 "unexpected entity \"" + type
@@ -1280,8 +1279,7 @@ sal_uInt16 addLoadLocal(
 break;
 case codemaker::UnoType::Sort::Sequence:
 case codemaker::UnoType::Sort::Typedef:
-assert(false); // this cannot happen
-// fall through
+for (;;) std::abort(); // this cannot happen
 default:
 throw CannotDumpException(
 "unexpected entity \"" + type
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-05-12 Thread Stephan Bergmann
 codemaker/source/codemaker/typemanager.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 6d12687bc111271aac1e3a01bb3ba872e4eba2d9
Author: Stephan Bergmann 
Date:   Thu May 12 14:04:54 2016 +0200

Silence -Werror,-Wimplicit-fallthrough under NDEBUG

Change-Id: Id6dd53d8802f19fd7b78d4613ba2085d093a35be

diff --git a/codemaker/source/codemaker/typemanager.cxx 
b/codemaker/source/codemaker/typemanager.cxx
index 32769f7..bc8dbde 100644
--- a/codemaker/source/codemaker/typemanager.cxx
+++ b/codemaker/source/codemaker/typemanager.cxx
@@ -248,8 +248,7 @@ codemaker::UnoType::Sort TypeManager::decompose(
 return
 codemaker::UnoType::Sort::InstantiatedPolymorphicStruct;
 case codemaker::UnoType::Sort::Sequence:
-assert(false); // this cannot happen
-// fall through
+for (;;) std::abort(); // this cannot happen
 default:
 throw CannotDumpException(
 "unexpected \"" + n + "\" resolved from \"" + name
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: codemaker/source cppuhelper/source cppu/qa

2016-04-08 Thread Jochen Nitschke
 codemaker/source/cppumaker/cpputype.cxx |   10 +++---
 codemaker/source/cppumaker/dependencies.hxx |6 --
 cppu/qa/test_any.cxx|6 --
 cppu/qa/test_reference.cxx  |6 --
 cppuhelper/source/servicemanager.cxx|   24 
 cppuhelper/source/servicemanager.hxx|   23 +--
 cppuhelper/source/typemanager.cxx   |6 --
 cppuhelper/source/weak.cxx  |   15 +++
 8 files changed, 67 insertions(+), 29 deletions(-)

New commits:
commit 98d7b02f2b69f2f88a03054183933df7f190017d
Author: Jochen Nitschke 
Date:   Thu Apr 7 20:26:54 2016 +0200

tdf#94306 replace boost::noncopyable in cppuhelper

and related modules.
Replace with C++11 delete copy-constructur
and copy-assignment.

Change-Id: I18aa9fe4ff696f9b5472cbe4cd0097cb174618b7
Reviewed-on: https://gerrit.libreoffice.org/23904
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 7189405..0c7be86 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -26,7 +26,6 @@
 #include 
 #include 
 
-#include "boost/noncopyable.hpp"
 #include "rtl/alloc.h"
 #include "rtl/ref.hxx"
 #include "rtl/ustrbuf.hxx"
@@ -146,13 +145,16 @@ bool isBootstrapType(OUString const & name) {
 return false;
 }
 
-class CppuType: private boost::noncopyable {
+class CppuType {
 public:
 CppuType(
 OUString const & name, rtl::Reference< TypeManager > const & typeMgr);
 
 virtual ~CppuType() {}
 
+CppuType(const CppuType&) = delete;
+const CppuType& operator=(const CppuType&) = delete;
+
 void dump(CppuOptions const & options);
 
 bool dumpFile(
@@ -1030,12 +1032,14 @@ void dumpDeprecation(FileStream & out, bool deprecated) 
{
 }
 }
 
-class BaseOffset: private boost::noncopyable {
+class BaseOffset {
 public:
 BaseOffset(
 rtl::Reference< TypeManager > const & manager,
 rtl::Reference< unoidl::InterfaceTypeEntity > const & entity):
 manager_(manager), offset_(0) { calculateBases(entity); }
+BaseOffset(const BaseOffset&) = delete;
+const BaseOffset& operator=(const BaseOffset&) = delete;
 
 sal_Int32 get() const { return offset_; }
 
diff --git a/codemaker/source/cppumaker/dependencies.hxx 
b/codemaker/source/cppumaker/dependencies.hxx
index afd902b..e1513a3 100644
--- a/codemaker/source/cppumaker/dependencies.hxx
+++ b/codemaker/source/cppumaker/dependencies.hxx
@@ -24,7 +24,6 @@
 
 #include 
 
-#include "boost/noncopyable.hpp"
 #include "rtl/ref.hxx"
 
 namespace rtl { class OUString; }
@@ -39,7 +38,7 @@ namespace codemaker { namespace cppumaker {
 
This class is not multi-threadsafe.
  */
-class Dependencies: private boost::noncopyable {
+class Dependencies {
 public:
 /**
Flags to distinguish whether or not one entity depends on another entity
@@ -66,6 +65,9 @@ public:
 
 ~Dependencies();
 
+Dependencies(const Dependencies&) = delete;
+const Dependencies& operator=(const Dependencies&) = delete;
+
 Map const & getMap() const { return m_map; }
 
 bool hasBooleanDependency() const { return m_booleanDependency; }
diff --git a/cppu/qa/test_any.cxx b/cppu/qa/test_any.cxx
index 4fdd4a4..e173b10 100644
--- a/cppu/qa/test_any.cxx
+++ b/cppu/qa/test_any.cxx
@@ -43,7 +43,6 @@
 #include "Struct2.hpp"
 #include "Struct2a.hpp"
 #include "Struct2b.hpp"
-#include "boost/noncopyable.hpp"
 #include "boost/type_traits/is_same.hpp"
 #include "com/sun/star/uno/Any.hxx"
 #include "com/sun/star/uno/Reference.hxx"
@@ -59,10 +58,13 @@
 
 namespace {
 
-class Base: private boost::noncopyable {
+class Base {
 public:
 Base(): m_count(0) {}
 
+Base(const Base&) = delete;
+const Base& operator=(const Base&) = delete;
+
 void acquire() {
 if (osl_atomic_increment(_count) == SAL_MAX_INT32) {
 abort();
diff --git a/cppu/qa/test_reference.cxx b/cppu/qa/test_reference.cxx
index 0187766..c04b8b1 100644
--- a/cppu/qa/test_reference.cxx
+++ b/cppu/qa/test_reference.cxx
@@ -19,7 +19,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 #include 
@@ -39,7 +38,7 @@ using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::RuntimeException;
 using ::com::sun::star::uno::UNO_SET_THROW;
 
-class Foo: public Interface1, private boost::noncopyable
+class Foo: public Interface1
 {
 public:
 Foo()
@@ -47,6 +46,9 @@ public:
 {
 }
 
+Foo(const Foo&) = delete;
+const Foo& operator=(const Foo&) = delete;
+
 virtual Any SAL_CALL queryInterface(const Type & _type)
 throw (RuntimeException, std::exception) override
 {
diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index fe761fe..cd4d817 100644
--- 

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

2016-02-09 Thread Noel Grandin
 codemaker/source/cppumaker/cpputype.cxx |   40 
 1 file changed, 20 insertions(+), 20 deletions(-)

New commits:
commit 0dba1425d2bd0446ec7e54189d8068455ece91c3
Author: Noel Grandin 
Date:   Tue Feb 9 13:49:32 2016 +0200

rename dumpHxxFile to dumpHppFile

since we generate .hpp files, not .hxx files

Change-Id: I694364c9b0e7c78777201a031435c40b10cfd1ed

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 7a07751..4ecf52f 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -166,7 +166,7 @@ public:
 FileStream & out, codemaker::cppumaker::Includes & includes)
 { dumpHFileContent(out, includes); }
 
-virtual void dumpHxxFile(FileStream& o, codemaker::cppumaker::Includes & 
includes) = 0;
+virtual void dumpHppFile(FileStream& o, codemaker::cppumaker::Includes & 
includes) = 0;
 
 OUString dumpHeaderDefine(FileStream& o, OUString const & extension);
 
@@ -415,7 +415,7 @@ bool CppuType::dumpFile(
 try {
 if (hpp) {
 addGetCppuTypeIncludes(includes);
-dumpHxxFile(out, includes);
+dumpHppFile(out, includes);
 } else {
 dumpHFile(out, includes);
 }
@@ -1084,7 +1084,7 @@ public:
 OUString const & name, rtl::Reference< TypeManager > const & typeMgr);
 
 virtual void dumpDeclaration(FileStream& o) override;
-void dumpHxxFile(FileStream& o, codemaker::cppumaker::Includes & includes) 
override;
+void dumpHppFile(FileStream& o, codemaker::cppumaker::Includes & includes) 
override;
 
 voiddumpAttributes(FileStream& o);
 voiddumpMethods(FileStream& o);
@@ -1155,7 +1155,7 @@ void InterfaceType::dumpDeclaration(FileStream & out) {
 out << "};\n\n";
 }
 
-void InterfaceType::dumpHxxFile(
+void InterfaceType::dumpHppFile(
 FileStream & out, codemaker::cppumaker::Includes & includes)
 {
 OUString headerDefine(dumpHeaderDefine(out, "HPP"));
@@ -1694,7 +1694,7 @@ private:
 virtual void dumpHFile(
 FileStream & out, codemaker::cppumaker::Includes & includes) override;
 
-virtual void dumpHxxFile(
+virtual void dumpHppFile(
 FileStream & out, codemaker::cppumaker::Includes & includes) override;
 
 virtual void dumpDeclaration(FileStream & out) override;
@@ -1722,7 +1722,7 @@ void ConstantGroup::dumpHFile(
 out << "\n#endif // "<< headerDefine << "\n";
 }
 
-void ConstantGroup::dumpHxxFile(
+void ConstantGroup::dumpHppFile(
 FileStream & out, codemaker::cppumaker::Includes &)
 {
 OUString headerDefine(dumpHeaderDefine(out, "HPP"));
@@ -1843,7 +1843,7 @@ private:
 
 virtual void dumpDeclaration(FileStream& o) override;
 
-void dumpHxxFile(FileStream& o, codemaker::cppumaker::Includes & includes) 
override;
+void dumpHppFile(FileStream& o, codemaker::cppumaker::Includes & includes) 
override;
 
 virtual void dumpLightGetCppuType(FileStream & out) override;
 
@@ -1920,7 +1920,7 @@ void PlainStructType::dumpDeclaration(FileStream & out) {
 out << "};\n\n#ifdef SAL_W32\n#   pragma pack(pop)\n#endif\n\n";
 }
 
-void PlainStructType::dumpHxxFile(
+void PlainStructType::dumpHppFile(
 FileStream & out, codemaker::cppumaker::Includes & includes)
 {
 OUString headerDefine(dumpHeaderDefine(out, "HPP"));
@@ -2230,7 +2230,7 @@ public:
 private:
 virtual void dumpDeclaration(FileStream& o) override;
 
-void dumpHxxFile(FileStream& o, codemaker::cppumaker::Includes & includes) 
override;
+void dumpHppFile(FileStream& o, codemaker::cppumaker::Includes & includes) 
override;
 
 virtual void dumpLightGetCppuType(FileStream & out) override;
 
@@ -2299,7 +2299,7 @@ void PolyStructType::dumpDeclaration(FileStream & out) {
 out << "};\n\n#ifdef SAL_W32\n#   pragma pack(pop)\n#endif\n\n";
 }
 
-void PolyStructType::dumpHxxFile(
+void PolyStructType::dumpHppFile(
 FileStream & out, codemaker::cppumaker::Includes & includes)
 {
 OUString headerDefine(dumpHeaderDefine(out, "HPP"));
@@ -2724,7 +2724,7 @@ public:
 { assert(entity.is()); }
 
 private:
-virtual void dumpHxxFile(
+virtual void dumpHppFile(
 FileStream & out, codemaker::cppumaker::Includes & includes) override;
 
 virtual void addComprehensiveGetCppuTypeIncludes(
@@ -2757,7 +2757,7 @@ void ExceptionType::addComprehensiveGetCppuTypeIncludes(
 includes.addRtlInstanceHxx(); // using rtl::StaticWithInit
 }
 
-void ExceptionType::dumpHxxFile(
+void ExceptionType::dumpHppFile(
 FileStream & out, codemaker::cppumaker::Includes & includes)
 {
 OUString headerDefine(dumpHeaderDefine(out, "HPP"));
@@ -3171,7 +3171,7 @@ private:
 virtual void addComprehensiveGetCppuTypeIncludes(
 codemaker::cppumaker::Includes & includes) const override;
 
-void dumpHxxFile(FileStream& o, codemaker::cppumaker::Includes & includes) 
override;
+void 

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

2015-12-01 Thread Stephan Bergmann
 codemaker/source/cppumaker/cpputype.cxx |   38 +---
 1 file changed, 16 insertions(+), 22 deletions(-)

New commits:
commit 03b9d1e720aa3c28a2406ddcc2e8758da1c9bc0b
Author: Stephan Bergmann 
Date:   Tue Dec 1 09:29:18 2015 +0100

Reduce space needed for string literals

...as had been done in 68ba6ddef50ec4aa92f55fa610c84c9f0d134e67 "codemaker:
Allow compiler to share these generated strings" and
2188a7ac2eb37aee89f8f305bdf99db9b05b20bf "Reduce the amount of strings in 
the
release builds," and then undone in 759eb79d886b70c7e7ab86b48e63d1b627b7dc44
"give useful details in non-debug mode too"

Change-Id: Ic888d6c47449da3b3a084f863a7e0526f201a967

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index bd74149..7a07751 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3442,13 +3442,11 @@ private:
 rtl::Reference< unoidl::SingleInterfaceBasedServiceEntity > entity_;
 };
 
-static OUString failsToSupply(const OUString& name_, const OString& baseName)
+static void failsToSupply(
+FileStream & o, OUString const & service, OString const & type)
 {
-return OUString(
-"\n"
-"\n"
-"::rtl::OUString(\"component context fails to 
supply service '" + name_ + "' of type '" + OStringToOUString(baseName, 
RTL_TEXTENCODING_UTF8) + "'\")\n"
-"\n");
+o << "::rtl::OUString(\"component context fails to supply service \") + \""
+  << service << "\" + \" of type \" + \"" << type << "\"";
 }
 
 void ServiceType::dumpHxxFile(
@@ -3586,18 +3584,16 @@ void ServiceType::dumpHxxFile(
 o << indent()
   << ("} catch (const ::css::uno::Exception & the_exception) 
{\n");
 inc();
-o << indent()
-  << "throw ::css::uno::DeploymentException("
-  << failsToSupply(name_, baseName)
-  << " + \": \" + the_exception.Message, the_context);\n";
+o << indent() << "throw ::css::uno::DeploymentException(";
+failsToSupply(o, name_, baseName);
+o << " + \": \" + the_exception.Message, the_context);\n";
 dec();
 o << indent() << "}\n" << indent()
   << "if (!the_instance.is()) {\n";
 inc();
-o << indent()
-  << "throw ::css::uno::DeploymentException("
-  << failsToSupply(name_, baseName)
-  << ", the_context);\n";
+o << indent() << "throw ::css::uno::DeploymentException(";
+failsToSupply(o, name_, baseName);
+o << ", the_context);\n";
 dec();
 o << indent() << "}\n" << indent() << "return the_instance;\n";
 dec();
@@ -3747,19 +3743,17 @@ void ServiceType::dumpHxxFile(
   << ("} catch (const ::css::uno::Exception &"
   " the_exception) {\n");
 inc();
-o << indent()
-  << "throw ::css::uno::DeploymentException("
-  << failsToSupply(name_, baseName)
-  << " + \": \" + the_exception.Message, the_context);\n";
+o << indent() << "throw ::css::uno::DeploymentException(";
+failsToSupply(o, name_, baseName);
+o << " + \": \" + the_exception.Message, the_context);\n";
 dec();
 o << indent() << "}\n";
 }
 o << indent() << "if (!the_instance.is()) {\n";
 inc();
-o << indent()
-  << "throw ::css::uno::DeploymentException("
-  << failsToSupply(name_, baseName)
-  << ", the_context);\n";
+o << indent() << "throw ::css::uno::DeploymentException(";
+failsToSupply(o, name_, baseName);
+o << ", the_context);\n";
 dec();
 o << indent() << "}\n" << indent() << "return the_instance;\n";
 dec();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: codemaker/source compilerplugins/clang i18npool/source include/rtl l10ntools/source sal/qa store/source

2015-08-11 Thread Noel Grandin
 codemaker/source/cppumaker/dependencies.cxx |2 
 compilerplugins/clang/defaultparams.cxx |   80 
 i18npool/source/breakiterator/gendict.cxx   |2 
 include/rtl/string.hxx  |2 
 include/rtl/ustring.hxx |4 -
 l10ntools/source/export.cxx |2 
 l10ntools/source/xmlparse.cxx   |2 
 sal/qa/osl/file/osl_File.cxx|6 +-
 store/source/storbios.cxx   |2 
 9 files changed, 91 insertions(+), 11 deletions(-)

New commits:
commit 9d307abeec2a80e59af0f0af10dc42d90cd7441a
Author: Noel Grandin n...@peralex.com
Date:   Fri Aug 7 08:35:12 2015 +0200

new loplugin: defaultparams

find places where we do not need to be passing a parameter to a
function, because that function has a default value which matches the
value we are passing.

Change-Id: I04d1fd6275204dd4925e6563282464f461123632

diff --git a/codemaker/source/cppumaker/dependencies.cxx 
b/codemaker/source/cppumaker/dependencies.cxx
index b56bacf..ebcd839 100644
--- a/codemaker/source/cppumaker/dependencies.cxx
+++ b/codemaker/source/cppumaker/dependencies.cxx
@@ -301,7 +301,7 @@ void Dependencies::insert(OUString const  name, bool base) 
{
 for (std::vector OString ::iterator i(args.begin()); i != args.end();
  ++i)
 {
-insert(b2u(*i), false);
+insert(b2u(*i));
 }
 // fall through
 case UnoType::SORT_SEQUENCE_TYPE:
diff --git a/compilerplugins/clang/defaultparams.cxx 
b/compilerplugins/clang/defaultparams.cxx
new file mode 100644
index 000..173cc5e
--- /dev/null
+++ b/compilerplugins/clang/defaultparams.cxx
@@ -0,0 +1,80 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include string
+#include set
+
+#include plugin.hxx
+
+// Find places where we call a method with values == the values specified in 
the parameter defaults.
+// i.e. where the code might as well not specify anything.
+
+namespace {
+
+class DefaultParams:
+public RecursiveASTVisitorDefaultParams, public loplugin::Plugin
+{
+public:
+explicit DefaultParams(InstantiationData const  data): Plugin(data) {}
+
+virtual void run() override { 
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
+
+bool VisitCallExpr(const CallExpr * callExpr);
+};
+
+bool DefaultParams::VisitCallExpr(const CallExpr * callExpr) {
+if (ignoreLocation(callExpr)) {
+return true;
+}
+if (callExpr-getNumArgs() == 0) {
+return true;
+}
+if (callExpr-getDirectCallee() == nullptr) {
+return true;
+}
+const FunctionDecl* functionDecl = 
callExpr-getDirectCallee()-getCanonicalDecl();
+unsigned i = callExpr-getNumArgs() - 1;
+const Expr* arg = callExpr-getArg(i);
+// variadic functions
+if (i = functionDecl-getNumParams()) {
+return true;
+}
+const ParmVarDecl* parmVarDecl = functionDecl-getParamDecl(i);
+const Expr* defaultArgExpr = parmVarDecl-getDefaultArg();
+if (!arg-isDefaultArgument() 
+arg-isIntegerConstantExpr(compiler.getASTContext()) 
+parmVarDecl-hasDefaultArg() 
+!parmVarDecl-hasUninstantiatedDefaultArg() 
+defaultArgExpr-isIntegerConstantExpr(compiler.getASTContext()))
+{
+APSInt x1, x2;
+if (arg-EvaluateAsInt(x1, compiler.getASTContext()) 
+defaultArgExpr-EvaluateAsInt(x2, compiler.getASTContext()) 
+x1 == x2)
+{
+report(
+DiagnosticsEngine::Warning,
+not necessary to pass this argument, it defaults to the same 
value,
+callExpr-getSourceRange().getBegin())
+   callExpr-getSourceRange();
+report(
+DiagnosticsEngine::Warning,
+default method parameter declaration here,
+parmVarDecl-getSourceRange().getBegin())
+   parmVarDecl-getSourceRange();
+}
+}
+return true;
+}
+
+loplugin::Plugin::Registration DefaultParams  X(defaultparams, false);
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/i18npool/source/breakiterator/gendict.cxx 
b/i18npool/source/breakiterator/gendict.cxx
index 3e649dd..493d053 100644
--- a/i18npool/source/breakiterator/gendict.cxx
+++ b/i18npool/source/breakiterator/gendict.cxx
@@ -126,7 +126,7 @@ static inline void printDataArea(FILE *dictionary_fp, FILE 
*source_fp, vectorsa
 const sal_Int32 len = Ostr.getLength();
 
 sal_Int32 i=0;
-Ostr.iterateCodePoints(i, 1);
+Ostr.iterateCodePoints(i);
 if (len == i)
 

[Libreoffice-commits] core.git: codemaker/source include/comphelper include/sal include/svl

2015-01-22 Thread Stephan Bergmann
 codemaker/source/cppumaker/cpputype.cxx|8 
 include/comphelper/embeddedobjectcontainer.hxx |2 +-
 include/sal/types.h|8 
 include/svl/undo.hxx   |2 +-
 4 files changed, 14 insertions(+), 6 deletions(-)

New commits:
commit b4f6b26b5a1a78fecfa95ec2eb7ac8b80495d8aa
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Jan 22 09:26:38 2015 +0100

SAL_DLLPUBLIC_RTTI for proper RTTI visibility for LLVM

The Itanium C++ ABI mandates that for a unique (complete) C++ type a single
unique symbol for the type's RTTI name is used across a process's dynamic
objects (so type equivalence can be determined via pointer comparison on the
RTTI names).

GCC nowadays deviates from that, using strcmp to determine equivalence, so 
it is
resilient to RTTI names being bound locally within dynamic objects (which 
has
performance benefits, but also makes it impossible to have unrelated types 
that
happen to have the same name encapsulated in individual dynamic objects---
whether or not that would violate the ODR would be open to interpretation 
of how
dynamic objects fit into the C++ Standard).

LLVM sticks to the Itanium ABI, which becomes notable in at least two 
places:

For one, libc++abi's __dynamic_cast uses strict checking.  It still has a
_LIBCXX_DYNAMIC_FALLBACK for now that additionally uses strcmp checking and
syslogs visibility violations.  Mac OS X uses libc++abi with
_LIBCXX_DYNAMIC_FALLBACK enabled, and running LO routinely logs dynamic_cast
errors to the Console there.

For another, RTTI-based UBSan checks unconditionally only use strict 
checking
(cf. isDerivedFromAtOffset in lib/ubsan/ubsan_type_hash.cc).  This causes 
false
positives from Clang -fsanitize=function and -fsanitize=vptr even on Linux 
not
using libc++abi.

Therefore, introduce SAL_DLLPUBLIC_RTTI to mark types for which RTTI needs 
to
have default visibility under the Itanium/LLVM semantics.  There is
unfortunately no way to mark only the (implicitly generated) RTTI symbols 
for
default visibility, but at least with the cases where SAL_DLLPUBLIC_RTTI is 
used
for now that is no real problem---any class type marked SAL_DLLPUBLIC_RTTI 
only
has inline (covered by -fvisibility-inlines-hidden) or undefined pure 
virtual
functions.  It appears that even the vtables of those classes remain 
hidden, at
least with Mach-O on Mac OS X.  (That also means there is no need for a
SAL_DLLPRIVATE_RTTI marker analoguous to the---also superfluous in 
retrospect---
CPPU_GCC_DLLPRIVATE one.)

Nevertheless, the number of exported symbols of course increases when
SAL_DLLPUBLIC_RTTI is active.  For a full-blown --enable-dbgutil build on 
Mac
OS X,

  find instdir/LibreOffice.app/Contents -name \*.dylib\* -exec nm -gU {} 
\; \
wc -l

increased from 125541 to 139239.  For Linux, an option might be to 
activate
SAL_DLLPUBLIC_RTTI only for __clang__ plus !ENABLE_RUNTIME_OPTIMIZATIONS.

The set of types marked SAL_DLLPUBLIC_RTTI with this patch (wholesale 
cppumaker-
generated UNO enum, struct, and interface types; plus some IEmbeddedHelper 
and
IUndoManager) is chosen so that a full make check on Mac OS X no longer
syslogs any dynamic_cast errors to the Console.

Change-Id: I42fa6ec01c2503ec24bcd9c0518abb112afa3235

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 3e27729..64ac18b 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -1072,7 +1072,7 @@ InterfaceType::InterfaceType(
 }
 
 void InterfaceType::dumpDeclaration(FileStream  out) {
-out  \nclass SAL_NO_VTABLE   id_;
+out  \nclass SAL_NO_VTABLE SAL_DLLPUBLIC_RTTI   id_;
 for (std::vector unoidl::AnnotatedReference ::const_iterator i(
  entity_-getDirectMandatoryBases().begin());
  i != entity_-getDirectMandatoryBases().end(); ++i)
@@ -1812,7 +1812,7 @@ private:
 
 void PlainStructType::dumpDeclaration(FileStream  out) {
 out  \n#ifdef SAL_W32\n#   pragma pack(push, 8)\n#endif\n\n  indent()
- struct   id_;
+ struct SAL_DLLPUBLIC_RTTI   id_;
 OUString base(entity_-getDirectBase());
 if (!base.isEmpty()) {
 out  : public   codemaker::cpp::scopedCppName(u2b(base));
@@ -2198,7 +2198,7 @@ private:
 void PolyStructType::dumpDeclaration(FileStream  out) {
 out  \n#ifdef SAL_W32\n#   pragma pack(push, 8)\n#endif\n\n  
indent();
 dumpTemplateHead(out);
-out  struct   id_   {\n;
+out  struct SAL_DLLPUBLIC_RTTI   id_   {\n;
 inc();
 out  indent()  inline   id_  ();\n;
 if (!entity_-getMembers().empty()) {
@@ -3127,7 +3127,7 @@ void EnumType::addComprehensiveGetCppuTypeIncludes(
 
 void EnumType::dumpDeclaration(FileStream o)

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

2014-12-10 Thread Stephan Bergmann
 codemaker/source/javamaker/javatype.cxx |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 662e3299c578e2bff8a1cb9884e6266353ea1ebe
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed Dec 10 13:34:04 2014 +0100

Fix generation of com.sun.star.uno.[Runtime]Exception classes

Change-Id: If9bd4d906906e0e6cd7c5bb61f8a67a163218395

diff --git a/codemaker/source/javamaker/javatype.cxx 
b/codemaker/source/javamaker/javatype.cxx
index 4dc7f5c..f60b163 100644
--- a/codemaker/source/javamaker/javatype.cxx
+++ b/codemaker/source/javamaker/javatype.cxx
@@ -1825,18 +1825,22 @@ void handleExceptionType(
 MethodDescriptor desc2(manager, dependencies, void, 0, 0);
 code.reset(cf-newCode());
 code-loadLocalReference(0);
-sal_uInt16 index3 = 1;
-code-loadLocalReference(index3++);
-code-loadLocalReference(index3++);
+sal_uInt16 index3 = 3;
 // Note that we hack in the java.lang.Throwable parameter further down,
 // because MethodDescriptor does not know how to handle it.
 desc2.addParameter(string, false, true, 0);
-if (!(baseException || baseRuntimeException)) {
+if (baseException || baseRuntimeException) {
+code-loadLocalReference(2);
+code-loadLocalReference(1);
+code-instrInvokespecial(superClass, init, 
(Ljava/lang/String;Ljava/lang/Throwable;)V);
+} else {
+code-loadLocalReference(1);
+code-loadLocalReference(2);
 addExceptionBaseArguments(
 manager, dependencies, desc2, code.get(), entity-getDirectBase(),
 index3);
+code-instrInvokespecial(superClass, init, 
(Ljava/lang/Throwable; + desc2.getDescriptor().copy(1));
 }
-code-instrInvokespecial(superClass, init, (Ljava/lang/Throwable; + 
desc2.getDescriptor().copy(1));
 sal_uInt16 maxSize2 = index3;
 if (baseRuntimeException) {
 maxSize2 = std::max(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-12-08 Thread Stephan Bergmann
 codemaker/source/cppumaker/cpputype.cxx |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 9d5e53b67c7c131ab4cdc8e103373be2be7830c2
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Dec 8 10:34:21 2014 +0100

protected - private

Change-Id: I807b31eaa0b0cd68e0ca018b6df4269c1aab5763

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index ccd908d..5c015c9 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -1039,17 +1039,13 @@ public:
 void dumpAttributesCppuDecl(FileStream  out, std::set OUString  * seen);
 void dumpMethodsCppuDecl(FileStream  out, std::set OUString  * seen);
 
-protected:
+private:
 virtual void addComprehensiveGetCppuTypeIncludes(
 codemaker::cppumaker::Includes  includes) const SAL_OVERRIDE;
 
 virtual sal_uInt32 checkInheritedMemberCount() const SAL_OVERRIDE
 { return BaseOffset(m_typeMgr, entity_).get(); }
 
-sal_uInt32  m_inheritedMemberCount;
-boolm_isDeprecated;
-
-private:
 void dumpExceptionSpecification(
 FileStream  out, std::vector OUString  const  exceptions,
 bool runtimeException);
@@ -1063,16 +1059,16 @@ private:
 std::vector OUString  const  exceptions, bool runtimeException);
 
 rtl::Reference unoidl::InterfaceTypeEntity  entity_;
+bool m_isDeprecated;
 };
 
 InterfaceType::InterfaceType(
 rtl::Reference unoidl::InterfaceTypeEntity  const  entity,
 OUString const  name, rtl::Reference TypeManager  const  typeMgr):
-CppuType(name, typeMgr), entity_(entity)
+CppuType(name, typeMgr), entity_(entity),
+m_isDeprecated(isDeprecated(entity-getAnnotations()))
 {
 assert(entity.is());
-m_inheritedMemberCount = 0;
-m_isDeprecated = isDeprecated(entity-getAnnotations());
 }
 
 void InterfaceType::dumpDeclaration(FileStream  out) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: codemaker/source idlc/inc include/salhelper sal/osl sal/qa sal/rtl sal/textenc store/source vcl/generic vcl/inc

2014-11-18 Thread Riccardo Magliocchetti
 codemaker/source/codemaker/unotype.cxx|1 -
 codemaker/source/cppumaker/dumputils.cxx  |1 -
 idlc/inc/idlc/aststructinstance.hxx   |1 -
 include/salhelper/simplereferenceobject.hxx   |1 -
 sal/osl/unx/file_path_helper.hxx  |1 -
 sal/qa/osl/process/osl_process_child.cxx  |2 --
 sal/rtl/digest.cxx|1 -
 sal/rtl/hash.hxx  |1 -
 sal/rtl/strimp.hxx|1 -
 sal/textenc/context.hxx   |1 -
 sal/textenc/convertisciidevangari.cxx |1 +
 sal/textenc/convertiso2022cn.cxx  |1 -
 sal/textenc/convertiso2022jp.cxx  |1 -
 sal/textenc/convertiso2022kr.cxx  |1 -
 sal/textenc/convertsinglebytetobmpunicode.cxx |1 -
 sal/textenc/convertsinglebytetobmpunicode.hxx |1 -
 store/source/object.cxx   |4 
 store/source/object.hxx   |1 -
 vcl/generic/fontmanager/parseAFM.cxx  |3 ---
 vcl/generic/fontmanager/parseAFM.hxx  |1 -
 vcl/inc/bmpfast.hxx   |2 --
 21 files changed, 1 insertion(+), 27 deletions(-)

New commits:
commit 2c1bf30bda6b914611134317b652402e4488fd03
Author: Riccardo Magliocchetti riccardo.magliocche...@gmail.com
Date:   Fri Nov 14 12:07:01 2014 +0100

More iwyu suggested headers removal

Signed-off-by: Riccardo Magliocchetti riccardo.magliocche...@gmail.com
Signed-off-by: Stephan Bergmann sberg...@redhat.com, undid one remove 
that was
detrimental to loplugin:unreffun

Change-Id: I18d8252084d828f94ef7a954e1dbfb45743d7970

diff --git a/codemaker/source/codemaker/unotype.cxx 
b/codemaker/source/codemaker/unotype.cxx
index 5b76a04..38de2a7 100644
--- a/codemaker/source/codemaker/unotype.cxx
+++ b/codemaker/source/codemaker/unotype.cxx
@@ -24,7 +24,6 @@
 #include rtl/string.hxx
 #include sal/types.h
 
-#include vector
 
 OString codemaker::UnoType::decompose(
 OString const  type, sal_Int32 * rank,
diff --git a/codemaker/source/cppumaker/dumputils.cxx 
b/codemaker/source/cppumaker/dumputils.cxx
index 4c82824..8f720f6 100644
--- a/codemaker/source/cppumaker/dumputils.cxx
+++ b/codemaker/source/cppumaker/dumputils.cxx
@@ -21,7 +21,6 @@
 #include dumputils.hxx
 
 #include codemaker/global.hxx
-#include codemaker/commoncpp.hxx
 
 #include rtl/ustring.hxx
 #include sal/types.h
diff --git a/idlc/inc/idlc/aststructinstance.hxx 
b/idlc/inc/idlc/aststructinstance.hxx
index ebc7f6c..706d6cb 100644
--- a/idlc/inc/idlc/aststructinstance.hxx
+++ b/idlc/inc/idlc/aststructinstance.hxx
@@ -23,7 +23,6 @@
 #include idlc/asttype.hxx
 #include idlc/idlctypes.hxx
 
-class AstDeclaration;
 class AstScope;
 
 class AstStructInstance: public AstType {
diff --git a/include/salhelper/simplereferenceobject.hxx 
b/include/salhelper/simplereferenceobject.hxx
index b150fb2..67626b1 100644
--- a/include/salhelper/simplereferenceobject.hxx
+++ b/include/salhelper/simplereferenceobject.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SALHELPER_SIMPLEREFERENCEOBJECT_HXX
 
 #include osl/interlck.h
-#include sal/types.h
 #include salhelper/salhelperdllapi.h
 
 #include cstddef
diff --git a/sal/osl/unx/file_path_helper.hxx b/sal/osl/unx/file_path_helper.hxx
index 6b1418d..6396ddbe 100644
--- a/sal/osl/unx/file_path_helper.hxx
+++ b/sal/osl/unx/file_path_helper.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_SAL_OSL_UNX_FILE_PATH_HELPER_HXX
 
 #include file_path_helper.h
-
 #include rtl/ustring.hxx
 
 namespace osl
diff --git a/sal/qa/osl/process/osl_process_child.cxx 
b/sal/qa/osl/process/osl_process_child.cxx
index ee5ecf5..feabd1d 100644
--- a/sal/qa/osl/process/osl_process_child.cxx
+++ b/sal/qa/osl/process/osl_process_child.cxx
@@ -29,11 +29,9 @@
 
 #include stdio.h
 #include stdlib.h
-#include iostream
 #include fstream
 #include string.h
 
-#include rtl/ustring.hxx
 
 #ifdef UNX
 #if defined( MACOSX )
diff --git a/sal/rtl/digest.cxx b/sal/rtl/digest.cxx
index 75cf209..b35700e 100644
--- a/sal/rtl/digest.cxx
+++ b/sal/rtl/digest.cxx
@@ -20,7 +20,6 @@
 #include string.h
 
 #include sal/types.h
-#include sal/macros.h
 #include osl/endian.h
 #include rtl/alloc.h
 #include rtl/digest.h
diff --git a/sal/rtl/hash.hxx b/sal/rtl/hash.hxx
index 5997118..9f80448 100644
--- a/sal/rtl/hash.hxx
+++ b/sal/rtl/hash.hxx
@@ -20,7 +20,6 @@
 #ifndef INCLUDED_SAL_RTL_HASH_HXX
 #define INCLUDED_SAL_RTL_HASH_HXX
 
-#include sal/types.h
 #include rtl/ustring.h
 
 /* These functions are not multi-thread safe: */
diff --git a/sal/rtl/strimp.hxx b/sal/rtl/strimp.hxx
index d737077..b7589cd 100644
--- a/sal/rtl/strimp.hxx
+++ b/sal/rtl/strimp.hxx
@@ -25,7 +25,6 @@
 #include sys/sdt.h
 #endif
 
-#include osl/interlck.h
 
 #include sal/types.h
 
diff --git a/sal/textenc/context.hxx b/sal/textenc/context.hxx
index 1f8eb48..83b4d1e 100644
--- a/sal/textenc/context.hxx
+++ b/sal/textenc/context.hxx
@@ -20,7 +20,6 @@
 #ifndef 

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

2014-05-23 Thread Noel Grandin
 codemaker/source/cppumaker/cpputype.cxx |   18 --
 1 file changed, 8 insertions(+), 10 deletions(-)

New commits:
commit 7d4924a4028963697952af17a27c32c1ec4e13ef
Author: Noel Grandin n...@peralex.com
Date:   Fri May 23 16:33:08 2014 +0200

improve parameter flow in cpputype.cxx

after commit
  c5d47c327a57df55
  add default value for Context param in uno::Exception constructors

Change-Id: Ib429b58c559ecd48764a8df2f49d5470057c2c63

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 29f4b15..1ef6506 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -2682,7 +2682,7 @@ private:
 
 bool dumpBaseMembers(
 FileStream  out, OUString const  base, bool withType,
-bool withDefaults, bool parentsHadDirectMember);
+bool eligibleForDefaults);
 
 sal_uInt32 getTotalMemberCount(OUString const  base) const;
 
@@ -2732,7 +2732,7 @@ void ExceptionType::dumpHxxFile(
 out  }\n\n;
 if (!entity_-getDirectMembers().empty() || getInheritedMemberCount()  0) 
{
 out  indent()  inline   id_  ::  id_  (;
-first = !dumpBaseMembers(out, base, true, false, false);
+first = !dumpBaseMembers(out, base, true, false);
 for (std::vector unoidl::ExceptionTypeEntity::Member ::const_iterator
  i(entity_-getDirectMembers().begin());
  i != entity_-getDirectMembers().end(); ++i)
@@ -2750,7 +2750,7 @@ void ExceptionType::dumpHxxFile(
 if (!base.isEmpty()) {
 out  indent()  :   codemaker::cpp::scopedCppName(u2b(base))
  (;
-dumpBaseMembers(out, base, false, false, false);
+dumpBaseMembers(out, base, false, false);
 out  )\n;
 first = false;
 }
@@ -2986,9 +2986,8 @@ void ExceptionType::dumpDeclaration(FileStream  out) {
  () SAL_THROW(());\n\n;
 if (!entity_-getDirectMembers().empty() || getInheritedMemberCount()  0) 
{
 out  indent()  inline CPPU_GCC_DLLPRIVATE   id_  (;
-bool withDefaults = true;
-bool parentsHadDirectMembers = !entity_-getDirectMembers().empty();
-bool first = !dumpBaseMembers(out, base, true, withDefaults, 
parentsHadDirectMembers);
+bool eligibleForDefaults = entity_-getDirectMembers().empty();
+bool first = !dumpBaseMembers(out, base, true, eligibleForDefaults);
 for (std::vector unoidl::ExceptionTypeEntity::Member ::const_iterator
  i(entity_-getDirectMembers().begin());
  i != entity_-getDirectMembers().end(); ++i)
@@ -3027,7 +3026,7 @@ void ExceptionType::dumpDeclaration(FileStream  out) {
 }
 
 bool ExceptionType::dumpBaseMembers(
-FileStream  out, OUString const  base, bool withType, bool withDefaults, 
bool parentsHadDirectMember)
+FileStream  out, OUString const  base, bool withType, bool 
eligibleForDefaults)
 {
 bool hasMember = false;
 if (!base.isEmpty()) {
@@ -3041,7 +3040,7 @@ bool ExceptionType::dumpBaseMembers(
 dynamic_cast unoidl::ExceptionTypeEntity * (ent.get()));
 assert(ent2.is());
 hasMember = dumpBaseMembers( out, ent2-getDirectBase(), withType,
-withDefaults, parentsHadDirectMember || 
!ent2-getDirectMembers().empty() );
+eligibleForDefaults  
ent2-getDirectMembers().empty() );
 int memberCount = 0;
 for (std::vector unoidl::ExceptionTypeEntity::Member ::const_iterator
  i(ent2-getDirectMembers().begin());
@@ -3058,8 +3057,7 @@ bool ExceptionType::dumpBaseMembers(
 // We want to provide a default parameter value for uno::Exception 
subtype
 // constructors, since most of the time we don't pass a Context 
object in to the exception
 // throw sites.
-if (withDefaults
-   !parentsHadDirectMember
+if (eligibleForDefaults
base == com.sun.star.uno.Exception
memberCount == 1
i-name == Context
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-27 Thread Alexander Wilms
 codemaker/source/codemaker/global.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0bb7b87a7e0b810ac9ff4d4da0bbf7c7c273fb19
Author: Alexander Wilms f.alexander.wi...@gmail.com
Date:   Tue Feb 25 17:51:20 2014 +0100

Remove visual noise from codemaker

Change-Id: I098c636ed8794c858317fdbefa9ffa1c6d81c320
Reviewed-on: https://gerrit.libreoffice.org/8241
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/codemaker/source/codemaker/global.cxx 
b/codemaker/source/codemaker/global.cxx
index 9549763..9ec4d6b 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -269,9 +269,9 @@ OUString convertToFileUrl(const OString fileName)
 }
 
 
-//*
+
 // FileStream
-//*
+
 FileStream::FileStream()
 : m_file(NULL)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-28 Thread Matúš Kukan
 codemaker/source/cppumaker/cpputype.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit fb92c8d6a456bf99eff5b5786b3c9fe22d547615
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Tue Jan 28 19:47:27 2014 +0100

copypaste typo

Change-Id: I528a6a747e88fe2a4b4abfd9372daddf4e8aa502

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index d172d29..691aa75 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3778,7 +3778,7 @@ void SingletonType::dumpHxxFile(
name_.replaceAll(., _dot_)
)  defined LO_URE_CTOR_FUN_
name_.replaceAll(., _dot_)  \n  indent()
-   the_instance = ::css::uno::Reference   scopedBaseName
+   instance = ::css::uno::Reference   scopedBaseName
( (::css::uno::Reference ::css::uno::XInterface (
   static_cast ::css::uno::XInterface * ((*
   LO_URE_CTOR_FUN_)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-27 Thread Jan Holesovsky
 codemaker/source/cppumaker/cpputype.cxx |   16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 68ba6ddef50ec4aa92f55fa610c84c9f0d134e67
Author: Jan Holesovsky ke...@collabora.com
Date:   Mon Jan 27 11:36:16 2014 +0100

codemaker: Allow compiler to share these generated strings.

There is really no need to see tons of

component context fails to supply service something long of type 
something else long:

and

component context fails to supply service something long of type 
something else long

in the binary ;-) - let's split the strings to parts that the linker can
share easily.

Change-Id: I07f149a587c05985045028c3b6530c6efd081ff5

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index d3898d9..7af4fb4 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3484,9 +3484,11 @@ void ServiceType::dumpHxxFile(
 o  indent()
(throw ::css::uno::DeploymentException(
   ::rtl::OUString( 
-  \component context fails to supply service )
-   name_   of type   baseName
-   : \ ) + the_exception.Message, the_context);\n;
+  \component context fails to supply service \ ) + )
+   \  name_  \ + 
+   \ of type \ + 
+   \  baseName  \ + 
+   \: \ + the_exception.Message, the_context);\n;
 dec();
 o  indent()  }\n  indent()
if (!the_instance.is()) {\n;
@@ -3494,9 +3496,11 @@ void ServiceType::dumpHxxFile(
 o  indent()
(throw ::css::uno::DeploymentException(
   ::rtl::OUString( 
-  \component context fails to supply service )
-   name_   of type   baseName
-   \ ), the_context);\n;
+  \component context fails to supply service \ ) + )
+   \  name_  \ + 
+   \ of type \ + 
+   \  baseName  \
+   , the_context);\n;
 dec();
 o  indent()  }\n  indent()  return the_instance;\n;
 dec();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-20 Thread Matúš Kukan
 codemaker/source/cppumaker/cpputype.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 2dc9f1791a24ef1858737eac3ce64c5e2c261744
Author: Matúš Kukan matus.ku...@collabora.com
Date:   Sun Jan 19 21:58:48 2014 +0100

Fix declaration for ctor functions in generated headers.

Change-Id: I329ff80da68c629d7a82921253c4412563743b34

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index accb1d1..d3898d9 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3357,7 +3357,6 @@ void ServiceType::dumpHxxFile(
 includes.addReference();
 includes.addRtlUstringH();
 includes.addRtlUstringHxx();
-includes.add(com.sun.star.lang.XInitialization);
 includes.add(com.sun.star.uno.DeploymentException);
 includes.add(com.sun.star.uno.XComponentContext);
 for (std::vector
@@ -3411,14 +3410,17 @@ void ServiceType::dumpHxxFile(
 includes.dump(o, 0);
 if (!entity_-getConstructors().empty()) {
 o  (\n#if defined ANDROID || defined IOS //TODO\n
+  #include com/sun/star/lang/XInitialization.hpp\n
   #include osl/detail/component-defines.h\n#endif\n\n
   #if defined LO_URE_CURRENT_ENV  defined LO_URE_CTOR_ENV_)
name_.replaceAll(., _dot_)
  (LO_URE_CURRENT_ENV) == (LO_URE_CTOR_ENV_
name_.replaceAll(., _dot_)  )  defined LO_URE_CTOR_FUN_
name_.replaceAll(., _dot_)
-   \nextern \C\ void * SAL_CALL LO_URE_CTOR_FUN_
-   name_.replaceAll(., _dot_)  (void *, void *);\n#endif\n;
+   \nextern \C\ ::css::uno::XInterface * SAL_CALL 
LO_URE_CTOR_FUN_
+   name_.replaceAll(., _dot_)
+   (::css::uno::XComponentContext *, ::css::uno::Sequence 
+ ::css::uno::Any  const );\n#endif\n;
 }
 o  \n;
 if (codemaker::cppumaker::dumpNamespaceOpen(o, name_, false)) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-01-10 Thread Stephan Bergmann
 codemaker/source/codemaker/global.cxx |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit d320760dc1c9d6501d84849219b4d9fc6c62b85b
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Jan 10 10:16:48 2014 +0100

codemaker: fix^2 invalid string index access

...originally the past-the-end checks in destination where always true, and 
thus
happend to work as intended for empty destionation, but
614e04019a672cdd61b86699d99250d80f169f95 broke that, so calling cppumaker 
w/o
-O was broken now.

Change-Id: I8d41dfe8d4c12e4a73a9782d4d5e7c9fa4d9df81

diff --git a/codemaker/source/codemaker/global.cxx 
b/codemaker/source/codemaker/global.cxx
index ba3f424..54ceeb1 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -87,11 +87,8 @@ OString createFileNameFromType( const OString destination,
 length += prefix.getLength() + type.getLength() + postfix.getLength();
 
 sal_Bool withSeparator = sal_False;
-if (!destination.isEmpty() 
-destination[destination.getLength() - 1] != '\\' 
-destination[destination.getLength() - 1] != '/' 
-type[0] != '\\' 
-type[0] != '/')
+if (!(destination.endsWith(\\) || destination.endsWith(/))
+ !(type.startsWith(\\) || type.startsWith(/)))
 {
 length++;
 withSeparator = sal_True;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-12-19 Thread Stephan Bergmann
 codemaker/source/cppumaker/cpputype.cxx |   29 ++---
 1 file changed, 26 insertions(+), 3 deletions(-)

New commits:
commit e500b25b08fdab927b987949139588c198edc40b
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Dec 19 16:54:36 2013 +0100

...and support direct calls of non-default ctors, too

Change-Id: I507a5664e642c75f6e9e9fe0c95c97ea76a8e5b3

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index dc5874c..4bd7a98 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -3581,8 +3581,31 @@ void ServiceType::dumpHxxFile(
 o  indent()  try {\n;
 inc();
 }
-o  indent()
-   the_instance = ::css::uno::Reference 
+o  (#if defined LO_URE_CURRENT_ENV  defined 
+  LO_URE_CTOR_ENV_)
+   name_.replaceAll(., _dot_)
+ (LO_URE_CURRENT_ENV) == (LO_URE_CTOR_ENV_
+   name_.replaceAll(., _dot_)
+   )  defined LO_URE_CTOR_FUN_
+   name_.replaceAll(., _dot_)  \n  indent()
+   the_instance = ::css::uno::Reference   scopedBaseName
+   ( (::css::uno::Reference ::css::uno::XInterface (
+  static_cast ::css::uno::XInterface * ((*
+  LO_URE_CTOR_FUN_)
+   name_.replaceAll(., _dot_)
+   )(the_context.get(), ;
+if (rest) {
+o  codemaker::cpp::translateUnoToCppIdentifier(
+u2b(i-parameters.back().name), param,
+codemaker::cpp::ITM_NONGLOBAL);
+} else if (i-parameters.empty()) {
+o  (::css::uno::Sequence ::css::uno::Any ());
+} else {
+o  the_arguments;
+}
+o  (.get())), ::SAL_NO_ACQUIRE), ::css::uno::UNO_QUERY);\n
+  #else\n)
+   indent()  the_instance = ::css::uno::Reference 
scopedBaseName
( (the_context-getServiceManager()-
   createInstanceWithArgumentsAndContext(::rtl::OUString(
@@ -3597,7 +3620,7 @@ void ServiceType::dumpHxxFile(
 } else {
 o  the_arguments;
 }
-o  , the_context), ::css::uno::UNO_QUERY);\n;
+o  , the_context), ::css::uno::UNO_QUERY);\n#endif\n;
 if (!tree.getRoot()-present) {
 dec();
 o  indent()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-12-17 Thread Caolán McNamara
 codemaker/source/cppumaker/cppuoptions.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 944a086d9223a84e1ae8d7839433fccaff361b79
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Dec 17 10:26:21 2013 +

if there is one typo, its guaranteed to duplicated somewhere

Change-Id: Ia81069afa47fa5790b973247c68bead7de87d718

diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index 3e70b68..1308803 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -327,7 +327,7 @@ OString CppuOptions::prepareHelp()
 help += -L = UNO type functions are generated lightweight, 
that means only\n;
 help +=  the name and typeclass are given and everything 
else is retrieved\n;
 help +=  from the type library dynamically. The default 
is that UNO type\n;
-help +=  functions provides enough type information for 
boostrapping C++.\n;
+help +=  functions provides enough type information for 
bootstrapping C++.\n;
 help +=  '-L' should be the default for external 
components.\n;
 help += -C = UNO type functions are generated comprehensive 
that means all\n;
 help +=  necessary information is available for bridging 
the type in UNO.\n;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-10-01 Thread Stephan Bergmann
 codemaker/source/cppumaker/cpputype.cxx |   37 ++--
 1 file changed, 26 insertions(+), 11 deletions(-)

New commits:
commit 254f59f623f58c320175a06a2c93bcee7868b623
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Oct 1 14:33:56 2013 +0200

rhbz#1014010: Missing dependencies in isBootstrapType list

...the list has been fixed now by copying its elements into an ENTRIES file 
and
running unoidl-write udkapi/ @ENTITIES TEMP  unoidl-read TEMP 
/dev/null and
adding any reported unknown entities until it succeeds.

However, the updated list lead to deadlock when css.reflection.ParamInfo 
UnoType
resolves css.reflection.XIdlClass UnoType resolves css.reflection.XIdlMethod
UnoType resolves css.reflection.ParamInfo UnoType, so broke the circle by no
longer resolving the interface methods' return and parameter types in
InterfaceType::dumpMethodsCppuDecl (which is why those type infos are only
generated on demand anyway; looks like this had been a careless thinko in 
the
generation of comprehensive type info that had remained unnoticed all the 
time).

Change-Id: I50ef2fde16242298e055c6fa5971e70fad1a2b68

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 8f8cdf3..7f073e4 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -49,18 +49,25 @@ namespace {
 
 bool isBootstrapType(OUString const  name) {
 static char const * const names[] = {
+com.sun.star.beans.Property,
 com.sun.star.beans.PropertyAttribute,
+com.sun.star.beans.PropertyChangeEvent,
 com.sun.star.beans.PropertyState,
 com.sun.star.beans.PropertyValue,
 com.sun.star.beans.XFastPropertySet,
 com.sun.star.beans.XMultiPropertySet,
+com.sun.star.beans.XPropertiesChangeListener,
 com.sun.star.beans.XPropertyAccess,
+com.sun.star.beans.XPropertyChangeListener,
 com.sun.star.beans.XPropertySet,
+com.sun.star.beans.XPropertySetInfo,
 com.sun.star.beans.XPropertySetOption,
+com.sun.star.beans.XVetoableChangeListener,
 com.sun.star.bridge.UnoUrlResolver,
 com.sun.star.bridge.XUnoUrlResolver,
 com.sun.star.connection.SocketPermission,
 com.sun.star.container.XElementAccess,
+com.sun.star.container.XEnumeration,
 com.sun.star.container.XEnumerationAccess,
 com.sun.star.container.XHierarchicalNameAccess,
 com.sun.star.container.XNameAccess,
@@ -70,6 +77,7 @@ bool isBootstrapType(OUString const  name) {
 com.sun.star.io.FilePermission,
 com.sun.star.io.IOException,
 com.sun.star.lang.DisposedException,
+com.sun.star.lang.EventObject,
 com.sun.star.lang.WrappedTargetRuntimeException,
 com.sun.star.lang.XComponent,
 com.sun.star.lang.XEventListener,
@@ -81,11 +89,19 @@ bool isBootstrapType(OUString const  name) {
 com.sun.star.lang.XSingleServiceFactory,
 com.sun.star.lang.XTypeProvider,
 com.sun.star.loader.XImplementationLoader,
+com.sun.star.reflection.FieldAccessMode,
+com.sun.star.reflection.MethodMode,
+com.sun.star.reflection.ParamInfo,
+com.sun.star.reflection.ParamMode,
+com.sun.star.reflection.TypeDescriptionSearchDepth,
 com.sun.star.reflection.XArrayTypeDescription,
 com.sun.star.reflection.XCompoundTypeDescription,
 com.sun.star.reflection.XEnumTypeDescription,
+com.sun.star.reflection.XIdlArray,
 com.sun.star.reflection.XIdlClass,
+com.sun.star.reflection.XIdlField,
 com.sun.star.reflection.XIdlField2,
+com.sun.star.reflection.XIdlMethod,
 com.sun.star.reflection.XIdlReflection,
 com.sun.star.reflection.XIndirectTypeDescription,
 com.sun.star.reflection.XInterfaceAttributeTypeDescription,
@@ -97,18 +113,28 @@ bool isBootstrapType(OUString const  name) {
 com.sun.star.reflection.XMethodParameter,
 com.sun.star.reflection.XStructTypeDescription,
 com.sun.star.reflection.XTypeDescription,
+com.sun.star.reflection.XTypeDescriptionEnumeration,
 com.sun.star.reflection.XTypeDescriptionEnumerationAccess,
 com.sun.star.reflection.XUnionTypeDescription,
+com.sun.star.registry.RegistryKeyType,
+com.sun.star.registry.RegistryValueType,
 com.sun.star.registry.XImplementationRegistration,
 com.sun.star.registry.XRegistryKey,
 com.sun.star.registry.XSimpleRegistry,
 com.sun.star.security.RuntimePermission,
+com.sun.star.security.XAccessControlContext,
 com.sun.star.security.XAccessController,
+com.sun.star.security.XAction,
 com.sun.star.uno.DeploymentException,
 com.sun.star.uno.RuntimeException,
+com.sun.star.uno.TypeClass,
+

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

2013-09-12 Thread Stephan Bergmann
 codemaker/source/cppumaker/cppumaker.cxx   |   20 +---
 codemaker/source/cppumaker/cppuoptions.cxx |   11 +++
 codemaker/source/cppumaker/cpputype.cxx|   15 +--
 3 files changed, 33 insertions(+), 13 deletions(-)

New commits:
commit 54dd4ae0ddc92b3fbc02e104e9844b587e694a99
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Sep 12 15:28:11 2013 +0200

Add cppumaker -nD no dependent types are generated

...just like javamaker.

Change-Id: I7634a65a948ca7abdb7ad75d0aeca8becb38ab87

diff --git a/codemaker/source/cppumaker/cppumaker.cxx 
b/codemaker/source/cppumaker/cppumaker.cxx
index 3f0c665..2a698f4 100644
--- a/codemaker/source/cppumaker/cppumaker.cxx
+++ b/codemaker/source/cppumaker/cppumaker.cxx
@@ -78,13 +78,19 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
 } else {
 produce(, typeMgr, generated, options);
 }
-// C++ header files generated for the following UNO types are included
-// in header files in cppu/inc/com/sun/star/uno (Any.hxx, 
Reference.hxx,
-// Type.h), so it seems best to always generate those C++ header files:
-produce(
-com.sun.star.uno.RuntimeException, typeMgr, generated, options);
-produce(com.sun.star.uno.TypeClass, typeMgr, generated, options);
-produce(com.sun.star.uno.XInterface, typeMgr, generated, options);
+if (!options.isValid(-nD)) {
+// C++ header files generated for the following UNO types are
+// included in header files in cppu/inc/com/sun/star/uno (Any.hxx,
+// Reference.hxx, Type.h), so it seems best to always generate 
those
+// C++ header files:
+produce(
+com.sun.star.uno.RuntimeException, typeMgr, generated,
+options);
+produce(
+com.sun.star.uno.TypeClass, typeMgr, generated, options);
+produce(
+com.sun.star.uno.XInterface, typeMgr, generated, options);
+}
 } catch (CannotDumpException  e) {
 std::cerr  ERROR:   e.getMessage()  '\n';
 return EXIT_FAILURE;
diff --git a/codemaker/source/cppumaker/cppuoptions.cxx 
b/codemaker/source/cppumaker/cppuoptions.cxx
index 3446134..3e70b68 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -94,6 +94,16 @@ sal_Bool CppuOptions::initOptions(int ac, char* av[], 
sal_Bool bCmdFile)
 
 m_options[-O] = OString(s);
 break;
+case 'n':
+if (av[i][2] != 'D' || av[i][3] != '\0')
+{
+OString tmp('-nD', please check);
+tmp +=  your input ' + OString(av[i]) + ';
+throw IllegalArgument(tmp);
+}
+
+m_options[-nD] = OString();
+break;
 case 'T':
 if (av[i][2] == '\0')
 {
@@ -321,6 +331,7 @@ OString CppuOptions::prepareHelp()
 help +=  '-L' should be the default for external 
components.\n;
 help += -C = UNO type functions are generated comprehensive 
that means all\n;
 help +=  necessary information is available for bridging 
the type in UNO.\n;
+help += -nD= no dependent types are generated.\n;
 help += -G = generate only target files which does not 
exists.\n;
 help += -Gc= generate only target files which content will be 
changed.\n;
 help += -Xfile   = extra types which will not be taken into account 
for generation.\n\n;
diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index b03e472..8f8cdf3 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -409,12 +409,15 @@ void CppuType::dumpFile(
 void CppuType::dumpDependedTypes(
 codemaker::GeneratedTypeSet  generated, CppuOptions const  options)
 {
-codemaker::cppumaker::Dependencies::Map const  map
-= m_dependencies.getMap();
-for (codemaker::cppumaker::Dependencies::Map::const_iterator 
i(map.begin());
- i != map.end(); ++i)
-{
-produce(i-first, m_typeMgr, generated, options);
+if (!options.isValid(-nD)) {
+codemaker::cppumaker::Dependencies::Map const  map
+= m_dependencies.getMap();
+for (codemaker::cppumaker::Dependencies::Map::const_iterator i(
+ map.begin());
+ i != map.end(); ++i)
+{
+produce(i-first, m_typeMgr, generated, options);
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-09-10 Thread Stephan Bergmann
 codemaker/source/javamaker/javaoptions.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4b0a692668e37f55ea8b4c10af4d31fb314f9d0b
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Sep 10 15:48:03 2013 +0200

Stray space at end of usage text line

Change-Id: I886c543d9de63595a9183f4e5f108f08b2ba25ef

diff --git a/codemaker/source/javamaker/javaoptions.cxx 
b/codemaker/source/javamaker/javaoptions.cxx
index ef57eec..db7d896 100644
--- a/codemaker/source/javamaker/javaoptions.cxx
+++ b/codemaker/source/javamaker/javaoptions.cxx
@@ -246,7 +246,7 @@ OString JavaOptions::prepareHelp()
 help += -Opath   = path describes the root directory for the 
generated output.\n;
 help +=  The output directory tree is generated under 
this directory.\n;
 help += -Tname   = name specifies a type or a list of types. The 
output for this\n;
-help +=   [t1;...]   type and all dependent types are generated. If 
no '-T' option is \n;
+help +=   [t1;...]   type and all dependent types are generated. If 
no '-T' option is\n;
 help +=  specified, then output for all types is 
generated.\n;
 help +=  Example: 'com.sun.star.uno.XInterface' is a 
valid type.\n;
 help += -nD= no dependent types are generated.\n;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-09-03 Thread Stephan Bergmann
 codemaker/source/codemaker/global.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ea7ce8cf08521a7609d2ffc0969b1541fbbb9d0c
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Sep 3 11:04:28 2013 +0200

Write integers as signed sal_Int32

...this was a regression introduced with
64b993e046f23baaacaff1572b7d2a816588b5ef finish deprecation of
O(U)String::valueOf() and it caused e.g. the value -0x100 of the enum 
member
css.i18n.TranliterationModules.IGNORE_MASK to be written as 4294967040 
rather
than as -256.  (Though the relevant code is dead ugly, for sure.)

Change-Id: Icb3d3365135bc2a07e438317b70abdf9d74d6d7a

diff --git a/codemaker/source/codemaker/global.cxx 
b/codemaker/source/codemaker/global.cxx
index 6516b17..17c6fec 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -355,7 +355,7 @@ bool FileStream::write(void const * buffer, sal_uInt64 
size) {
 
 FileStream operator(FileStream o, sal_uInt32 i) {
 sal_uInt64 writtenBytes;
-OString s = OString::number(i);
+OString s = OString::number((sal_Int32)i);
 osl_writeFile(o.m_file, s.getStr(), s.getLength() * sizeof(sal_Char), 
writtenBytes);
 return o;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-06-17 Thread Jelle van der Waa
 codemaker/source/codemaker/global.cxx |2 +-
 starmath/inc/visitors.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2f731e7a19f2c36da64b9631cf4f2de0f6d2a86e
Author: Jelle van der Waa je...@vdwaa.nl
Date:   Mon Jun 17 17:29:32 2013 +0200

fdo#43460 startmath,codemaker: use isEmpty()

Change-Id: I55d3f4546f40a321ebf4b08db33536592f451944
Reviewed-on: https://gerrit.libreoffice.org/4318
Reviewed-by: Marcos Souza marcos.souza@gmail.com
Reviewed-by: Noel Power noel.po...@suse.com
Tested-by: Noel Power noel.po...@suse.com

diff --git a/codemaker/source/codemaker/global.cxx 
b/codemaker/source/codemaker/global.cxx
index 4324cb6..645fd06 100644
--- a/codemaker/source/codemaker/global.cxx
+++ b/codemaker/source/codemaker/global.cxx
@@ -135,7 +135,7 @@ OString createFileNameFromType( const OString destination,
 if( nIndex == -1 )
 break;
 
-if (buffer.getLength() == 0 || OString(.) == buffer.getStr())
+if (buffer.isEmpty() || OString(.) == buffer.getStr())
 {
 buffer.append(token);
 continue;
diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx
index d864c45..ef21763 100644
--- a/starmath/inc/visitors.hxx
+++ b/starmath/inc/visitors.hxx
@@ -477,7 +477,7 @@ private:
 }
 /** Append a blank for separation, if needed */
 inline void Separate( ){
-if( !aCmdText.getLength() || aCmdText[ aCmdText.getLength() - 1 ] != ' 
' )
+if( aCmdText.isEmpty() || aCmdText[ aCmdText.getLength() - 1 ] != ' ' )
 aCmdText.append(' ');
 }
 /** Output text generated from the pNodes */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-05-12 Thread Julien Nabet
 codemaker/source/cppumaker/cpputype.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 53d7ae8c6b4de6ef50472639979609afa542038a
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sun May 12 22:53:28 2013 +0200

cppcheck: unusedVariable (parameters)

Change-Id: I0a7f230cb7e36857079de20a535cd883e30fd46f

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 8411f58..5d01a9f 100755
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -1986,7 +1986,6 @@ void 
PlainStructType::dumpComprehensiveGetCppuType(FileStream  out) {
  indent()  {\n;
 inc();
 out  indent()  ::rtl::OUString the_name( \  name_  \ );\n;
-std::map OUString, sal_uInt32  parameters;
 std::map OUString, sal_uInt32  types;
 std::vector unoidl::PlainStructTypeEntity::Member ::size_type n = 0;
 for (std::vector unoidl::PlainStructTypeEntity::Member ::const_iterator 
i(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-04-15 Thread Stephan Bergmann
 codemaker/source/codemaker/typemanager.cxx |1 
 codemaker/source/cppumaker/cpputype.cxx|   46 +
 2 files changed, 23 insertions(+), 24 deletions(-)

New commits:
commit 4b73d334a9c5d8ae1fe16b2cc04100b9f333595a
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Apr 15 10:38:01 2013 +0200

Further adapt CppuType::dumpCppuGetType to using unoidl/ instead of 
registry/

Change-Id: Ib46d7b8934f63d88ea953707fa1fbfb51c524efd

diff --git a/codemaker/source/codemaker/typemanager.cxx 
b/codemaker/source/codemaker/typemanager.cxx
index e07b553..5116aba 100644
--- a/codemaker/source/codemaker/typemanager.cxx
+++ b/codemaker/source/codemaker/typemanager.cxx
@@ -492,6 +492,7 @@ codemaker::UnoType::Sort TypeManager::decompose(
 case codemaker::UnoType::SORT_ANY:
 case codemaker::UnoType::SORT_ENUM_TYPE:
 case codemaker::UnoType::SORT_PLAIN_STRUCT_TYPE:
+case codemaker::UnoType::SORT_EXCEPTION_TYPE:
 case codemaker::UnoType::SORT_INTERFACE_TYPE:
 if (nucleus != 0) {
 *nucleus = n;
diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index 446e1f9..7540c02 100755
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -162,7 +162,8 @@ public:
 
 OUString getTypeClass(OUString const  name, bool cStyle = false);
 
-void dumpCppuGetType(FileStream  out, OUString const  name);
+void dumpCppuGetType(
+FileStream  out, OUString const  name, OUString const * ownName = 0);
 
 sal_uInt32 getInheritedMemberCount();
 
@@ -799,8 +800,15 @@ void CppuType::dumpType(
 }
 }
 
-void CppuType::dumpCppuGetType(FileStream  out, OUString const  name) {
-switch (m_typeMgr-getSort(resolveOuterTypedefs(name))) {
+void CppuType::dumpCppuGetType(
+FileStream  out, OUString const  name, OUString const * ownName)
+{
+//TODO: What are these calls good for?
+OUString nucleus;
+sal_Int32 rank;
+codemaker::UnoType::Sort sort = m_typeMgr-decompose(
+name, true, nucleus, rank, 0, 0);
+switch (rank == 0 ? sort : codemaker::UnoType::SORT_SEQUENCE_TYPE) {
 case codemaker::UnoType::SORT_VOID:
 case codemaker::UnoType::SORT_BOOLEAN:
 case codemaker::UnoType::SORT_BYTE:
@@ -823,10 +831,16 @@ void CppuType::dumpCppuGetType(FileStream  out, OUString 
const  name) {
 case codemaker::UnoType::SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE:
 case codemaker::UnoType::SORT_EXCEPTION_TYPE:
 case codemaker::UnoType::SORT_INTERFACE_TYPE:
-out  indent()  ::cppu::UnoType ;
-dumpType(out, name, false, false, false, true);
-out   ::get();\n;
+// Take care of recursion like struct S { sequenceS x; }:
+if (ownName == 0 || nucleus != *ownName) {
+out  indent()  ::cppu::UnoType ;
+dumpType(out, name, false, false, false, true);
+out   ::get();\n;
+}
 break;
+case codemaker::UnoType::SORT_TYPEDEF:
+assert(false); // this cannot happen
+// fall through
 default:
 throw CannotDumpException(
 unexpected entity \ + name
@@ -1984,15 +1998,7 @@ void 
PlainStructType::dumpComprehensiveGetCppuType(FileStream  out) {
 i-type, static_cast sal_uInt32 (types.size(.
 second)
 {
-if ((codemaker::UnoType::getSort(u2b(i-type))
- == codemaker::UnoType::SORT_COMPLEX)
- b2u(codemaker::UnoType::decompose(u2b(i-type))) != name_)
-// take care of recursion like struct S { sequenceS x; };
-{
-out  indent()  ::cppu::UnoType ;
-dumpType(out, i-type, false, false, false, true);
-out   ::get();\n;
-}
+dumpCppuGetType(out, i-type, name_);
 // For typedefs, use the resolved type name, as there will be no
 // information available about the typedef itself at runtime (the
 // above getCppuType call will make available information about the
@@ -2488,15 +2494,7 @@ void 
PolyStructType::dumpComprehensiveGetCppuType(FileStream  out) {
i-type, static_cast sal_uInt32 (types.size(.
second)
 {
-if ((codemaker::UnoType::getSort(u2b(i-type))
- == codemaker::UnoType::SORT_COMPLEX)
- b2u(codemaker::UnoType::decompose(u2b(i-type))) != name_)
-// take care of recursion like struct S { sequenceS x; };
-{
-out  indent()  ::cppu::UnoType ;
-dumpType(out, i-type, false, false, false, true);
-out   ::get();\n;
-}
+dumpCppuGetType(out, i-type, name_);
 // For typedefs, use the resolved type name, as there will be no
 // information available about the typedef 

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

2013-03-11 Thread Stephan Bergmann
 codemaker/source/cppumaker/cpputype.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 8d7cc6792aa84003e5f2e09c1f1baa7657de9621
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Mar 11 12:16:37 2013 +0100

css.beans.PropertyValue references css.beans.PropertyState

...so include the latter in isBootstrapType too, see
dee53a32a9feba2021782db5762b5a9a034efae4 Temporary hack around
cppu_detail_getCppuType variants violating ODR.

Change-Id: I613cf3d8699eccb149e0e1d31f4398a426ce0966

diff --git a/codemaker/source/cppumaker/cpputype.cxx 
b/codemaker/source/cppumaker/cpputype.cxx
index c348729..5513d24 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -73,6 +73,7 @@ rtl::OString translateSimpleUnoType(rtl::OString const  
unoType, bool cppuUnoTy
 bool isBootstrapType(rtl::OString const  name) {
 static char const * const names[] = {
 com/sun/star/beans/PropertyAttribute,
+com/sun/star/beans/PropertyState,
 com/sun/star/beans/PropertyValue,
 com/sun/star/beans/XFastPropertySet,
 com/sun/star/beans/XMultiPropertySet,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-03-09 Thread Marcos Paulo de Souza
 codemaker/source/codemaker/codemaker.cxx   |   14 ++-
 codemaker/source/codemaker/typemanager.cxx |   34 -
 codemaker/source/cppumaker/cppumaker.cxx   |2 -
 codemaker/source/cppumaker/cpputype.cxx|   58 ++---
 codemaker/source/javamaker/classfile.cxx   |   22 ++-
 codemaker/source/javamaker/javamaker.cxx   |2 -
 codemaker/source/javamaker/javatype.cxx|8 +---
 7 files changed, 60 insertions(+), 80 deletions(-)

New commits:
commit 9edeb948a26d60168415e936c4498aa653cdb53c
Author: Marcos Paulo de Souza marcos.souza@gmail.com
Date:   Fri Mar 8 14:17:51 2013 -0300

Removed last RTL_CONST* macros from codemaker

Also, change .equals fro == and drop a useless function.

Change-Id: I5ce4fd2cc7c62a18e059e945b42cc01425802aa0
Reviewed-on: https://gerrit.libreoffice.org/2605
Reviewed-by: Olivier Hallot olivier.hal...@alta.org.br
Tested-by: Olivier Hallot olivier.hal...@alta.org.br

diff --git a/codemaker/source/codemaker/codemaker.cxx 
b/codemaker/source/codemaker/codemaker.cxx
index b6169b8..bf5b618 100644
--- a/codemaker/source/codemaker/codemaker.cxx
+++ b/codemaker/source/codemaker/codemaker.cxx
@@ -62,10 +62,6 @@ rtl::OString convertString(rtl::OUString const  string) {
 return s;
 }
 
-OString errorMsg(OString const  desc, OString const  type) {
-return desc + type;
-}
-
 codemaker::UnoType::Sort decomposeAndResolve(
 TypeManager const  manager, rtl::OString const  type,
 bool resolveTypedefs, bool allowVoid, bool allowExtraEntities,
@@ -78,7 +74,7 @@ codemaker::UnoType::Sort decomposeAndResolve(
 sal_Int32 n = 0;
 *name = codemaker::UnoType::decompose(t, n, arguments);
 if (n  SAL_MAX_INT32 - *rank) {
-throw CannotDumpException(errorMsg(Bad type information: , 
type));
+throw CannotDumpException(Bad type information:  + type);
 //TODO
 }
 *rank += n;
@@ -90,7 +86,7 @@ codemaker::UnoType::Sort decomposeAndResolve(
 switch (sort) {
 case codemaker::UnoType::SORT_VOID:
 if (!allowVoid) {
-throw CannotDumpException( errorMsg(Bad type information: , 
type));
+throw CannotDumpException(Bad type information:  + type);
 //TODO
 }
 default:
@@ -113,7 +109,7 @@ codemaker::UnoType::Sort decomposeAndResolve(
 || (static_cast sal_uInt16 (arguments-size())
 != reader.getReferenceCount(
 {
-throw CannotDumpException(errorMsg(Bad type information: 
, type));
+throw CannotDumpException(Bad type information:  + type);
 //TODO
 }
 return sort;
@@ -124,7 +120,7 @@ codemaker::UnoType::Sort decomposeAndResolve(
 case RT_TYPE_SINGLETON:
 case RT_TYPE_CONSTANTS:
 if (!allowExtraEntities) {
-throw CannotDumpException(errorMsg(Bad type information: 
, type));
+throw CannotDumpException(Bad type information:  + type);
 //TODO
 }
 checkNoTypeArguments(*arguments);
@@ -146,7 +142,7 @@ codemaker::UnoType::Sort decomposeAndResolve(
 }
 }
 default:
-throw CannotDumpException(errorMsg(Bad type information: , 
type));
+throw CannotDumpException(Bad type information:  + type);
 //TODO
 }
 }
diff --git a/codemaker/source/codemaker/typemanager.cxx 
b/codemaker/source/codemaker/typemanager.cxx
index d223e48..4e53e5f 100644
--- a/codemaker/source/codemaker/typemanager.cxx
+++ b/codemaker/source/codemaker/typemanager.cxx
@@ -56,35 +56,35 @@ sal_Int32 TypeManager::release()
 
 sal_Bool TypeManager::isBaseType(const ::rtl::OString name)
 {
-if ( name.equals(OString(short)) )
+if ( name == short )
 return sal_True;
-if ( name.equals(OString(unsigned short)) )
+if ( name == unsigned short )
 return sal_True;
-if ( name.equals(OString(long)) )
+if ( name == long )
 return sal_True;
-if ( name.equals(OString(unsigned long)) )
+if ( name == unsigned long )
 return sal_True;
-if ( name.equals(OString(hyper)) )
+if ( name == hyper )
 return sal_True;
-if ( name.equals(OString(unsigned hyper)) )
+if ( name == unsigned hyper )
 return sal_True;
-if ( name.equals(OString(string)) )
+if ( name == string )
 return sal_True;
-if ( name.equals(OString(boolean)) )
+if ( name == boolean )
 return sal_True;
-if ( name.equals(OString(char)) )
+if ( name == char )
 return sal_True;
-if ( name.equals(OString(byte)) )
+if ( name == byte )
 return sal_True;
-if ( name.equals(OString(any)) )
+if ( name == any )
   

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

2013-03-07 Thread Marcos Paulo de Souza
 codemaker/source/codemaker/codemaker.cxx   |7 --
 codemaker/source/commoncpp/commoncpp.cxx   |   18 ++---
 codemaker/source/commonjava/commonjava.cxx |   16 +---
 codemaker/source/cppumaker/cpputype.cxx|   13 +--
 codemaker/source/javamaker/javatype.cxx|   98 +++--
 5 files changed, 44 insertions(+), 108 deletions(-)

New commits:
commit 75e6856b081ca29e3e0f19493780d9f8fa6d315c
Author: Marcos Paulo de Souza marcos.souza@gmail.com
Date:   Thu Mar 7 10:25:27 2013 -0300

fdo#57950: Remove chained appends in codemaker

And another cleanups like removing RTL_CONST* macros and other simple
things.

Much more can be done inside codemaker.

Change-Id: I338e1c0e88558124741c6202896355533535a129
Reviewed-on: https://gerrit.libreoffice.org/2583
Reviewed-by: Thomas Arnhold tho...@arnhold.org
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/codemaker/source/codemaker/codemaker.cxx 
b/codemaker/source/codemaker/codemaker.cxx
index 454f59c..6c203bf 100644
--- a/codemaker/source/codemaker/codemaker.cxx
+++ b/codemaker/source/codemaker/codemaker.cxx
@@ -66,11 +66,8 @@ rtl::OString convertString(rtl::OUString const  string) {
 return s;
 }
 
-rtl::OString errorMsg(rtl::OString const  desc, rtl::OString const  type) {
-rtl::OStringBuffer msg(128);
-msg.append(desc);
-msg.append(type);
-return msg.makeStringAndClear();
+OString errorMsg(OString const  desc, OString const  type) {
+return desc + type;
 }
 
 codemaker::UnoType::Sort decomposeAndResolve(
diff --git a/codemaker/source/commoncpp/commoncpp.cxx 
b/codemaker/source/commoncpp/commoncpp.cxx
index 989052d..5db10d4 100644
--- a/codemaker/source/commoncpp/commoncpp.cxx
+++ b/codemaker/source/commoncpp/commoncpp.cxx
@@ -37,7 +37,7 @@
 
 namespace codemaker { namespace cpp {
 
-rtl::OString scopedCppName(rtl::OString const  type, bool ns_alias)
+OString scopedCppName(OString const  type, bool ns_alias)
 {
 char c('/');
 sal_Int32 nPos = type.lastIndexOf( c );
@@ -49,12 +49,11 @@ rtl::OString scopedCppName(rtl::OString const  type, bool 
ns_alias)
 c = '.';
 }
 
-rtl::OStringBuffer tmpBuf(type.getLength()*2);
+OStringBuffer tmpBuf(type.getLength()*2);
 nPos = 0;
 do
 {
-tmpBuf.append(::);
-tmpBuf.append(type.getToken(0, c, nPos));
+tmpBuf.append(:: + type.getToken(0, c, nPos));
 } while( nPos != -1 );
 
 rtl::OString s(tmpBuf.makeStringAndClear());
@@ -67,16 +66,16 @@ rtl::OString scopedCppName(rtl::OString const  type, bool 
ns_alias)
 }
 
 
-rtl::OString translateUnoToCppType(
+OString translateUnoToCppType(
 codemaker::UnoType::Sort sort, RTTypeClass typeClass,
-rtl::OString const  nucleus, bool shortname)
+OString const  nucleus, bool shortname)
 {
 rtl::OStringBuffer buf;
 if (sort == codemaker::UnoType::SORT_COMPLEX) {
 if (typeClass == RT_TYPE_INTERFACE
  nucleus == rtl::OString(com/sun/star/uno/XInterface))
 {
-
buf.append(RTL_CONSTASCII_STRINGPARAM(::com::sun::star::uno::XInterface));
+buf.append(::com::sun::star::uno::XInterface);
 } else {
 //TODO: check that nucleus is a valid (UTF-8) identifier
 buf.append(nucleus);
@@ -303,10 +302,7 @@ rtl::OString translateUnoToCppIdentifier(
 || unoIdentifier == NDEBUG
 || (forbidden != 0  unoIdentifier == *forbidden) )
 {
-rtl::OStringBuffer buf(prefix);
-buf.append('_');
-buf.append(unoIdentifier);
-return buf.makeStringAndClear();
+return prefix + _ + unoIdentifier;
 } else {
 return unoIdentifier;
 }
diff --git a/codemaker/source/commonjava/commonjava.cxx 
b/codemaker/source/commonjava/commonjava.cxx
index 8c01be9..e5f6eca 100644
--- a/codemaker/source/commonjava/commonjava.cxx
+++ b/codemaker/source/commonjava/commonjava.cxx
@@ -39,16 +39,15 @@
 
 namespace codemaker { namespace java {
 
-rtl::OString translateUnoToJavaType(
+OString translateUnoToJavaType(
 codemaker::UnoType::Sort sort, RTTypeClass typeClass,
-rtl::OString const  nucleus, bool referenceType)
+OString const  nucleus, bool referenceType)
 {
-rtl::OStringBuffer buf;
+OStringBuffer buf;
 if (sort == codemaker::UnoType::SORT_COMPLEX) {
-if (typeClass == RT_TYPE_INTERFACE
- nucleus == rtl::OString(com/sun/star/uno/XInterface))
+if (typeClass == RT_TYPE_INTERFACE  nucleus == 
com/sun/star/uno/XInterface)
 {
-buf.append(RTL_CONSTASCII_STRINGPARAM(java/lang/Object));
+buf.append(java/lang/Object);
 } else {
 //TODO: check that nucleus is a valid (Java-modified UTF-8)
 // identifier
@@ -145,10 +144,7 @@ rtl::OString translateUnoToJavaIdentifier(
 || identifier == volatile
 ||