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

2023-05-12 Thread Noel Grandin (via logerrit)
 include/com/sun/star/uno/Any.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 4b704b530c072c22dc4d66fdad407f3291fdd7e2
Author: Noel Grandin 
AuthorDate: Fri May 12 09:51:30 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri May 12 11:27:50 2023 +0200

add a toAny variant that takes a && value

to avoid some unnecessary construction - we hit this path when going
through the comphelper makeProperty functions sometimes

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

diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index 7909f1cb239e..75ae40b48f26 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -250,6 +250,8 @@ template<> Any toAny(Any const & value) { return value; }
 
 #if defined LIBO_INTERNAL_ONLY
 
+inline Any toAny(Any&& value) { return std::move(value); }
+
 template
 Any toAny(rtl::OUStringConcat && value)
 { return Any(std::move(value)); }


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

2023-03-24 Thread Mike Kaganski (via logerrit)
 include/com/sun/star/uno/Any.h|9 +
 include/com/sun/star/uno/Reference.hxx|   12 
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx |3 +--
 3 files changed, 22 insertions(+), 2 deletions(-)

New commits:
commit 2a145d8667196838bd5e1bf635234fce564faea6
Author: Mike Kaganski 
AuthorDate: Fri Mar 24 19:56:23 2023 +0300
Commit: Mike Kaganski 
CommitDate: Fri Mar 24 18:38:26 2023 +

Introduce query() and queryThrow() to css::uno::Any

Similar to commit f3ffdc1a5fe965016550f20ada405ef638bf5f75
(Introduce non-static query() and queryThrow() to css::uno::Reference,
2023-03-23), this adds a syntactic sugar for css::uno::Reference ctors:

  css::uno::Reference 
xSomeInterface(anAny, css::uno::UNO_QUERY);

would become

  auto xSomeInterface(anAny.query());

and

  css::uno::Reference 
xSomeInterface(anAny, css::uno::UNO_QUERY_THROW);

would become

  auto 
xSomeInterface(anAny.queryThrow());

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

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index b453f5fa5b0c..181b58ae4b4a 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -44,6 +44,7 @@ namespace uno
 {
 
 class Type;
+template class Reference;
 
 /** C++ class representing an IDL any.
 This class is used to transport any type defined in IDL. The class 
inherits from the
@@ -287,6 +288,14 @@ public:
 */
 inline bool SAL_CALL operator != ( const Any & rAny ) const;
 
+#if defined LIBO_INTERNAL_ONLY
+// Similar to Reference::query/queryThrow, these allow to simplify calling 
constructors of
+// Reference taking Any. queryThrow is functionally similar to get(), but 
doesn't require
+// to specify the full Reference type explicitly, only the interface type.
+template inline Reference query() 
const;
+template inline Reference 
queryThrow() const;
+#endif
+
 private:
 #if !defined LIBO_INTERNAL_ONLY
 /// @cond INTERNAL
diff --git a/include/com/sun/star/uno/Reference.hxx 
b/include/com/sun/star/uno/Reference.hxx
index 40297cc086d7..76b01b6c57cf 100644
--- a/include/com/sun/star/uno/Reference.hxx
+++ b/include/com/sun/star/uno/Reference.hxx
@@ -397,6 +397,18 @@ inline Reference< other_type > Reference< interface_type 
>::queryThrow() const
 {
 return Reference< other_type >(*this, UNO_QUERY_THROW);
 }
+
+template< class interface_type >
+inline Reference< interface_type > Any::query() const
+{
+return Reference< interface_type >(*this, UNO_QUERY);
+}
+
+template< class interface_type >
+inline Reference< interface_type > Any::queryThrow() const
+{
+return Reference< interface_type >(*this, UNO_QUERY_THROW);
+}
 #endif
 
 
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index c12c5deeac1c..6436d68ec89e 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -1043,8 +1043,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154319)
 
 auto 
xSupplier(mxComponent.queryThrow());
 auto xIndexes = xSupplier->getDocumentIndexes();
-css::uno::Reference 
xTOCIndex(xIndexes->getByIndex(0),
-
css::uno::UNO_QUERY_THROW);
+auto 
xTOCIndex(xIndexes->getByIndex(0).queryThrow());
 css::uno::Reference xLevelFormats;
 CPPUNIT_ASSERT(xTOCIndex->getPropertyValue("LevelFormat") >>= 
xLevelFormats);
 CPPUNIT_ASSERT_EQUAL(sal_Int32(11), xLevelFormats->getCount());


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

2023-03-23 Thread Mike Kaganski (via logerrit)
 include/com/sun/star/uno/Reference.h   |4 ++--
 include/com/sun/star/uno/Reference.hxx |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 53c39db4cfbeec29c0972df8ade4b12a23074f10
Author: Mike Kaganski 
AuthorDate: Thu Mar 23 19:38:07 2023 +
Commit: Mike Kaganski 
CommitDate: Fri Mar 24 05:44:56 2023 +

These must be const

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

diff --git a/include/com/sun/star/uno/Reference.h 
b/include/com/sun/star/uno/Reference.h
index 1a6e6a10cee5..417d28b0418b 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -566,14 +566,14 @@ public:
 
 @return new reference
 */
-template< class other_type > inline Reference< other_type > query();
+template< class other_type > inline Reference< other_type > query() const;
 /** Queries this for the required interface, and returns the requested 
reference, or throws
 on failure. A syntactic sugar for 'Reference< other_type > 
xOther(xThis, UNO_QUERY_THROW)'
 that avoids some verbocity.
 
 @return new reference
 */
-template< class other_type > inline Reference< other_type > queryThrow();
+template< class other_type > inline Reference< other_type > queryThrow() 
const;
 #endif
 };
 
diff --git a/include/com/sun/star/uno/Reference.hxx 
b/include/com/sun/star/uno/Reference.hxx
index 12511d7d280f..40297cc086d7 100644
--- a/include/com/sun/star/uno/Reference.hxx
+++ b/include/com/sun/star/uno/Reference.hxx
@@ -387,13 +387,13 @@ inline Reference< interface_type > Reference< 
interface_type >::query(
 
 #if defined LIBO_INTERNAL_ONLY
 template< class interface_type > template< class other_type >
-inline Reference< other_type > Reference< interface_type >::query()
+inline Reference< other_type > Reference< interface_type >::query() const
 {
 return Reference< other_type >(*this, UNO_QUERY);
 }
 
 template< class interface_type > template< class other_type >
-inline Reference< other_type > Reference< interface_type >::queryThrow()
+inline Reference< other_type > Reference< interface_type >::queryThrow() const
 {
 return Reference< other_type >(*this, UNO_QUERY_THROW);
 }


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

2023-03-23 Thread Mike Kaganski (via logerrit)
 include/com/sun/star/uno/Reference.h  |   16 
 include/com/sun/star/uno/Reference.hxx|   14 ++
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx |3 +--
 3 files changed, 31 insertions(+), 2 deletions(-)

New commits:
commit f3ffdc1a5fe965016550f20ada405ef638bf5f75
Author: Mike Kaganski 
AuthorDate: Thu Mar 23 10:14:45 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Mar 23 11:31:17 2023 +

Introduce non-static query() and queryThrow() to css::uno::Reference

As a syntactic sugar for the respective ctors:

  css::uno::Reference 
xSomeInterface(xAnotherInterface, css::uno::UNO_QUERY);

would become

  auto 
xSomeInterface(xAnotherInterface.query());

and

  css::uno::Reference 
xSomeInterface(xAnotherInterface, css::uno::UNO_QUERY_THROW);

would become

  auto 
xSomeInterface(xAnotherInterface.queryThrow());

Change-Id: Ic42da364562b702cd468cc708fbda70394c4f2a2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149368
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/include/com/sun/star/uno/Reference.h 
b/include/com/sun/star/uno/Reference.h
index 85c0d929ea9c..1a6e6a10cee5 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -559,6 +559,22 @@ public:
 @return interface reference of demanded type (may be null)
 */
 SAL_WARN_UNUSED_RESULT inline static Reference< interface_type > SAL_CALL 
query( XInterface * pInterface );
+#if defined LIBO_INTERNAL_ONLY
+/** Queries this for the required interface, and returns the requested 
reference, possibly empty.
+A syntactic sugar for 'Reference< other_type > xOther(xThis, 
UNO_QUERY)' that avoids some
+verbocity.
+
+@return new reference
+*/
+template< class other_type > inline Reference< other_type > query();
+/** Queries this for the required interface, and returns the requested 
reference, or throws
+on failure. A syntactic sugar for 'Reference< other_type > 
xOther(xThis, UNO_QUERY_THROW)'
+that avoids some verbocity.
+
+@return new reference
+*/
+template< class other_type > inline Reference< other_type > queryThrow();
+#endif
 };
 
 }
diff --git a/include/com/sun/star/uno/Reference.hxx 
b/include/com/sun/star/uno/Reference.hxx
index 7632c55045ca..12511d7d280f 100644
--- a/include/com/sun/star/uno/Reference.hxx
+++ b/include/com/sun/star/uno/Reference.hxx
@@ -385,6 +385,20 @@ inline Reference< interface_type > Reference< 
interface_type >::query(
 castFromXInterface(iquery( pInterface )), SAL_NO_ACQUIRE );
 }
 
+#if defined LIBO_INTERNAL_ONLY
+template< class interface_type > template< class other_type >
+inline Reference< other_type > Reference< interface_type >::query()
+{
+return Reference< other_type >(*this, UNO_QUERY);
+}
+
+template< class interface_type > template< class other_type >
+inline Reference< other_type > Reference< interface_type >::queryThrow()
+{
+return Reference< other_type >(*this, UNO_QUERY_THROW);
+}
+#endif
+
 
 inline bool BaseReference::operator == ( XInterface * pInterface ) const
 {
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index e556d3e08625..ba97147876e7 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -1041,8 +1041,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154319)
 {
 createSwDoc("tdf154319-ToC_with_s_and_d.docx");
 
-css::uno::Reference 
xSupplier(mxComponent,
-   
css::uno::UNO_QUERY_THROW);
+auto 
xSupplier(mxComponent.queryThrow());
 auto xIndexes = xSupplier->getDocumentIndexes();
 css::uno::Reference 
xTOCIndex(xIndexes->getByIndex(0),
 
css::uno::UNO_QUERY_THROW);


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

2023-03-22 Thread Mike Kaganski (via logerrit)
 include/com/sun/star/uno/Any.h|4 
 include/com/sun/star/uno/Any.hxx  |8 
 sw/qa/extras/ooxmlimport/data/tdf154319-ToC_with_s_and_d.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx |   50 +++
 writerfilter/source/dmapper/DomainMapper_Impl.cxx |  150 ++
 5 files changed, 162 insertions(+), 50 deletions(-)

New commits:
commit 76777c82fa4bb5080c135e2241c3f7122dcbb298
Author: Mike Kaganski 
AuthorDate: Tue Mar 21 21:35:58 2023 +0300
Commit: Mike Kaganski 
CommitDate: Thu Mar 23 04:39:28 2023 +

tdf#154319: fix TOC field codes parsing

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

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index f232ccd90fe9..b453f5fa5b0c 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -451,6 +451,10 @@ template<>
 inline bool SAL_CALL operator >>= ( const Any & rAny, ::rtl::OUString & value 
);
 template<>
 inline bool SAL_CALL operator == ( const Any & rAny, const ::rtl::OUString & 
value );
+#if defined LIBO_INTERNAL_ONLY
+template
+inline bool SAL_CALL operator == (const Any& rAny, const 
rtl::OUStringLiteral& value);
+#endif
 // type
 template<>
 inline bool SAL_CALL operator >>= ( const Any & rAny, Type & value );
diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index d73b2a586d61..6267d41e733c 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -600,6 +600,14 @@ inline bool SAL_CALL operator == ( const Any & rAny, const 
::rtl::OUString & val
 return (typelib_TypeClass_STRING == rAny.pType->eTypeClass &&
 value == * static_cast< const ::rtl::OUString * >( rAny.pData ) );
 }
+
+#if defined LIBO_INTERNAL_ONLY
+template
+inline bool SAL_CALL operator == (const Any& rAny, const 
rtl::OUStringLiteral& value)
+{
+return operator ==(rAny, rtl::OUString(value));
+}
+#endif
 // type
 
 template<>
diff --git a/sw/qa/extras/ooxmlimport/data/tdf154319-ToC_with_s_and_d.docx 
b/sw/qa/extras/ooxmlimport/data/tdf154319-ToC_with_s_and_d.docx
new file mode 100644
index ..dc5a67824c9d
Binary files /dev/null and 
b/sw/qa/extras/ooxmlimport/data/tdf154319-ToC_with_s_and_d.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index 09de11d4c0bb..e556d3e08625 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -1037,6 +1037,56 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf153791)
 CPPUNIT_ASSERT_EQUAL(COL_AUTO, getProperty(xRun, "CharColor"));
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf154319)
+{
+createSwDoc("tdf154319-ToC_with_s_and_d.docx");
+
+css::uno::Reference 
xSupplier(mxComponent,
+   
css::uno::UNO_QUERY_THROW);
+auto xIndexes = xSupplier->getDocumentIndexes();
+css::uno::Reference 
xTOCIndex(xIndexes->getByIndex(0),
+
css::uno::UNO_QUERY_THROW);
+css::uno::Reference xLevelFormats;
+CPPUNIT_ASSERT(xTOCIndex->getPropertyValue("LevelFormat") >>= 
xLevelFormats);
+CPPUNIT_ASSERT_EQUAL(sal_Int32(11), xLevelFormats->getCount());
+
+const auto checkPropVal = [](const auto& expected, const 
css::beans::PropertyValues& entry,
+ const OUString& name) {
+auto it
+= std::find_if(entry.begin(), entry.end(),
+   [](const css::beans::PropertyValue& p) { 
return p.Name == name; });
+OString msg = "Property: " + name.toUtf8();
+CPPUNIT_ASSERT_MESSAGE(msg.getStr(), it != entry.end());
+CPPUNIT_ASSERT_EQUAL_MESSAGE(msg.getStr(), css::uno::Any(expected), 
it->Value);
+};
+
+//start with level 1, 0 is the header level
+for (sal_Int32 nLevel = 1; nLevel < xLevelFormats->getCount(); ++nLevel)
+{
+css::uno::Sequence aLevel;
+xLevelFormats->getByIndex(nLevel) >>= aLevel;
+
+CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aLevel.getLength());
+
+checkPropVal(OUString("TokenHyperlinkStart"), aLevel[0], "TokenType");
+
+checkPropVal(OUString("TokenEntryNumber"), aLevel[1], "TokenType");
+
+checkPropVal(OUString("TokenEntryText"), aLevel[2], "TokenType");
+
+checkPropVal(OUString("TokenTabStop"), aLevel[3], "TokenType");
+
+checkPropVal(OUString("TokenChapterInfo"), aLevel[4], "TokenType");
+
+checkPropVal(OUString("TokenText"), aLevel[5], "TokenType");
+checkPropVal(OUString("\""), aLevel[5], "Text");
+
+checkPropVal(OUString("TokenPageNumber"), aLevel[6], "TokenType");
+
+checkPropVal(OUString("TokenHyperlinkEnd"), aLevel[7], "TokenType");
+ 

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

2022-11-29 Thread Mike Kaganski (via logerrit)
 include/com/sun/star/uno/Any.h   |1 
 include/com/sun/star/uno/Any.hxx |2 
 sw/qa/extras/ooxmlexport/data/glossaryWithEmail.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx|   11 +
 sw/source/filter/ww8/docxexport.cxx  |   42 +++-
 writerfilter/inc/ooxml/OOXMLDocument.hxx |3 
 writerfilter/source/ooxml/OOXMLDocumentImpl.cxx  |  163 +--
 writerfilter/source/ooxml/OOXMLDocumentImpl.hxx  |4 
 8 files changed, 132 insertions(+), 94 deletions(-)

New commits:
commit dda4867a0b5a2d29d8a01a3656e0c8dac7626d2f
Author: Mike Kaganski 
AuthorDate: Tue Nov 29 20:23:13 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Nov 30 06:52:09 2022 +0100

tdf#152289: implement external glossary relations roundtrip

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

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index 123952142517..f232ccd90fe9 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -88,6 +88,7 @@ public:
 explicit Any(rtl::OUStringConcat const &) = delete;
 template explicit inline Any(rtl::OUStringNumber && value);
 template explicit Any(rtl::OUStringNumber const &) = delete;
+template  explicit inline Any(const 
rtl::OUStringLiteral& value);
 #endif
 
 /** Copy constructor: Sets value of the given any.
diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index fbceffa5e241..d73b2a586d61 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -86,6 +86,8 @@ Any::Any(rtl::OUStringConcat && value):
 {}
 template
 Any::Any(rtl::OUStringNumber && value): 
Any(rtl::OUString(std::move(value))) {}
+template 
+Any::Any(const rtl::OUStringLiteral& value): Any(rtl::OUString(value)) {}
 #endif
 
 inline Any::Any( const Any & rAny )
diff --git a/sw/qa/extras/ooxmlexport/data/glossaryWithEmail.docx 
b/sw/qa/extras/ooxmlexport/data/glossaryWithEmail.docx
new file mode 100644
index ..5ec375adf3ac
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/glossaryWithEmail.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index fe1aa44d75e7..9930fa27b768 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -991,6 +991,17 @@ CPPUNIT_TEST_FIXTURE(Test, testGlossary)
 assertXPath(pXmlDoc, "/w:glossaryDocument", "Ignorable", "w14 wp14");
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testGlossaryWithEmail)
+{
+// tdf#152289
+loadAndSave("glossaryWithEmail.docx");
+xmlDocUniquePtr pXmlDoc = 
parseExport("word/glossary/_rels/document.xml.rels");
+assertXPath(pXmlDoc, "/rels:Relationships/rels:Relationship[@Id='rId4' "
+"and 
@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink'
 "
+"and @Target='mailto:emailgoesh...@example.com' "
+"and @TargetMode='External']");
+}
+
 DECLARE_OOXMLEXPORT_TEST(testFdo71785, "fdo71785.docx")
 {
 // crashtest
diff --git a/sw/source/filter/ww8/docxexport.cxx 
b/sw/source/filter/ww8/docxexport.cxx
index 97875b28817d..ea59775eda15 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1484,6 +1484,7 @@ void DocxExport::WriteTheme()
 uno::Sequence< beans::StringPair >() );
 }
 
+// See OOXMLDocumentImpl::resolveGlossaryStream
 void DocxExport::WriteGlossary()
 {
 uno::Reference< beans::XPropertySet > xPropSet( 
m_rDoc.GetDocShell()->GetBaseModel(), uno::UNO_QUERY_THROW );
@@ -1494,7 +1495,7 @@ void DocxExport::WriteGlossary()
 return;
 
 uno::Reference glossaryDocDom;
-uno::Sequence< uno::Sequence< uno::Any> > glossaryDomList;
+uno::Sequence< uno::Sequence > glossaryDomList;
 uno::Sequence< beans::PropertyValue > propList;
 xPropSet->getPropertyValue( aName ) >>= propList;
 sal_Int32 collectedProperties = 0;
@@ -1532,20 +1533,43 @@ void DocxExport::WriteGlossary()
 serializer->serialize( uno::Reference< xml::sax::XDocumentHandler >( 
writer, uno::UNO_QUERY_THROW ),
 uno::Sequence< beans::StringPair >() );
 
-for ( const uno::Sequence< uno::Any>& glossaryElement : 
std::as_const(glossaryDomList))
+for (const uno::Sequence& glossaryElement : 
glossaryDomList)
 {
-OUString gTarget, gType, gId, contentType;
+OUString gTarget, gType, gId, contentType, targetMode;
 uno::Reference xDom;
-glossaryElement[0] >>= xDom;
-glossaryElement[1] >>= gId;
-glossaryElement[2] >>= gType;
-glossaryElement[3] >>= gTarget;
-glossaryElement[4] >>= contentType;
+for (const auto& [name, value] : glossaryElement)
+{
+if (name == "Id")
+  

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

2022-05-20 Thread Noel Grandin (via logerrit)
 include/com/sun/star/uno/Any.hxx |   35 +--
 1 file changed, 17 insertions(+), 18 deletions(-)

New commits:
commit 084b2b068ad6729775f7fa5965429fc5cc3c2ae3
Author: Noel Grandin 
AuthorDate: Wed May 18 20:57:45 2022 +0200
Commit: Noel Grandin 
CommitDate: Fri May 20 09:40:38 2022 +0200

optimise Any::operator=(&&) a little

uno_any_destruct will get called by the other Any anyway, so no need to
do it ourselves.
And inline the helper now, since it is only used in the one spot.

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

diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index 5613269c2b57..fbceffa5e241 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -131,31 +131,30 @@ inline Any & Any::operator = ( const Any & rAny )
 
 #if defined LIBO_INTERNAL_ONLY
 
-namespace detail {
-
-inline void moveAnyInternals(Any & from, Any & to) noexcept {
-uno_any_construct(, nullptr, nullptr, _acquire);
-std::swap(from.pType, to.pType);
-std::swap(from.pData, to.pData);
-std::swap(from.pReserved, to.pReserved);
-if (to.pData == ) {
-to.pData = 
+Any::Any(Any && other) noexcept {
+uno_any_construct(this, nullptr, nullptr, _acquire);
+std::swap(other.pType, pType);
+std::swap(other.pData, pData);
+std::swap(other.pReserved, pReserved);
+if (pData == ) {
+pData = 
 }
-// This leaves from.pData (where "from" is now VOID) dangling to somewhere 
(cf.
+// This leaves other.pData (where "other" is now VOID) dangling to 
somewhere (cf.
 // CONSTRUCT_EMPTY_ANY, cppu/source/uno/prim.hxx), but what's relevant is
 // only that it isn't a nullptr (as e.g. >>= -> uno_type_assignData ->
 // _assignData takes a null pSource to mean "construct a default value").
 }
 
-}
-
-Any::Any(Any && other) noexcept {
-detail::moveAnyInternals(other, *this);
-}
-
 Any & Any::operator =(Any && other) noexcept {
-uno_any_destruct(this, _release);
-detail::moveAnyInternals(other, *this);
+std::swap(other.pType, pType);
+std::swap(other.pData, pData);
+std::swap(other.pReserved, pReserved);
+if (pData == ) {
+pData = 
+}
+if (other.pData == ) {
+other.pData = 
+}
 return *this;
 }
 


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

2022-05-02 Thread Stephan Bergmann (via logerrit)
 include/com/sun/star/uno/Any.h   |2 ++
 include/com/sun/star/uno/Any.hxx |2 ++
 2 files changed, 4 insertions(+)

New commits:
commit 36783678bb93210284adede7f9c48332aa8d8b15
Author: Stephan Bergmann 
AuthorDate: Sun May 1 23:11:49 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Mon May 2 08:25:42 2022 +0200

Add css::uno::Any(OUStringNumber) overload

...like was already present for css::uno::makeAny, in preparation of 
getting rid
of makeAny

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

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index c53ddff68373..e2fc8af41f62 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -86,6 +86,8 @@ public:
 explicit inline Any(rtl::OUStringConcat && value);
 template
 explicit Any(rtl::OUStringConcat const &) = delete;
+template explicit inline Any(rtl::OUStringNumber && value);
+template explicit Any(rtl::OUStringNumber const &) = delete;
 #endif
 
 /** Copy constructor: Sets value of the given any.
diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index eb2b5267791a..1427cb4c14f6 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -84,6 +84,8 @@ template
 Any::Any(rtl::OUStringConcat && value):
 Any(rtl::OUString(std::move(value)))
 {}
+template
+Any::Any(rtl::OUStringNumber && value): 
Any(rtl::OUString(std::move(value))) {}
 #endif
 
 inline Any::Any( const Any & rAny )


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

2022-01-09 Thread Luboš Luňák (via logerrit)
 include/com/sun/star/uno/Sequence.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 9e7e63b8f812977b253b05db8a02dd0444de375a
Author: Luboš Luňák 
AuthorDate: Fri Jan 7 10:01:46 2022 +0100
Commit: Luboš Luňák 
CommitDate: Sun Jan 9 15:42:22 2022 +0100

uno sequences with different sizes are not equal

This should often the case, and should be way faster than the UNO
data comparison.

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

diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index c078124f96fc..e6643a2ec2f4 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -146,6 +146,8 @@ inline bool Sequence< E >::operator == ( const Sequence & 
rSeq ) const
 {
 if (_pSequence == rSeq._pSequence)
 return true;
+if (_pSequence->nElements != rSeq._pSequence->nElements)
+return false;
 const Type & rType = ::cppu::getTypeFavourUnsigned( this );
 return ::uno_type_equalData(
 const_cast< Sequence * >( this ), rType.getTypeLibType(),


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

2021-12-20 Thread Stephan Bergmann (via logerrit)
 include/com/sun/star/uno/Sequence.h   |4 
 include/com/sun/star/uno/Sequence.hxx |7 +++
 2 files changed, 11 insertions(+)

New commits:
commit 7cf387c43562a78192a59bd8fcfeea9b67d96f09
Author: Stephan Bergmann 
AuthorDate: Mon Dec 20 16:59:44 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Dec 20 20:10:42 2021 +0100

Add css::uno::Sequence move assignment operator

Coverity had reported it as lacking, which
b0b2d7f040c6a7c5dc1f3949693b368ca54ea3b5 "cid#1495784 Missing move 
assignment
operator" and c4aa4b55e21915ca072daa7db93edabc043f26ab "cid#1495784 Missing 
move
assignment operator" had worked around by instead modifying the calling 
code.
But even though a move constructor would be of little benefit, a move 
assignment
operator does have the slight performance benefit of avoiding some refcount
manipulation, so add it anyway.

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

diff --git a/include/com/sun/star/uno/Sequence.h 
b/include/com/sun/star/uno/Sequence.h
index 4f481914c52b..1b9f6a2aac77 100644
--- a/include/com/sun/star/uno/Sequence.h
+++ b/include/com/sun/star/uno/Sequence.h
@@ -141,6 +141,10 @@ public:
 */
 inline Sequence & SAL_CALL operator = ( const Sequence & rSeq );
 
+#if defined LIBO_INTERNAL_ONLY
+inline Sequence & operator =(Sequence && other);
+#endif
+
 /** Gets length of the sequence.
 
 @return length of sequence
diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index 7aa873e91223..c078124f96fc 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -134,6 +134,13 @@ inline Sequence< E > & Sequence< E >::operator = ( const 
Sequence & rSeq )
 return *this;
 }
 
+#if defined LIBO_INTERNAL_ONLY
+template Sequence & Sequence::operator =(Sequence && other) {
+std::swap(_pSequence, other._pSequence);
+return *this;
+}
+#endif
+
 template< class E >
 inline bool Sequence< E >::operator == ( const Sequence & rSeq ) const
 {


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

2021-11-12 Thread Mike Kaganski (via logerrit)
 include/com/sun/star/uno/Sequence.h |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 3e8214734f9695d7f16c4a37f1a497aeb229d677
Author: Mike Kaganski 
AuthorDate: Fri Nov 12 15:49:57 2021 +0300
Commit: Mike Kaganski 
CommitDate: Fri Nov 12 16:01:37 2021 +0100

Add a comment clarifying intended replacement for non-const operator[]

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

diff --git a/include/com/sun/star/uno/Sequence.h 
b/include/com/sun/star/uno/Sequence.h
index b557ec87b4ca..4f481914c52b 100644
--- a/include/com/sun/star/uno/Sequence.h
+++ b/include/com/sun/star/uno/Sequence.h
@@ -217,6 +217,8 @@ public:
 */
 inline E const * end() const;
 
+// Non-const operator[] is not available in internal code. Consider explicit 
use
+// of getArray(), out of tight loops if possible to avoid unneeded COW 
overhead.
 #if !defined LIBO_INTERNAL_ONLY
 /** Non-const index operator: Obtains a reference to element indexed at
 given position.


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

2021-11-05 Thread Mike Kaganski (via logerrit)
 include/com/sun/star/uno/Sequence.h|2 ++
 include/com/sun/star/uno/Sequence.hxx  |2 ++
 oox/source/drawingml/customshapeproperties.cxx |   15 +++
 3 files changed, 15 insertions(+), 4 deletions(-)

New commits:
commit fb3c04bd1930eedacd406874e1a285d62bbf27d9
Author: Mike Kaganski 
AuthorDate: Fri Oct 29 10:30:22 2021 +0300
Commit: Mike Kaganski 
CommitDate: Fri Nov 5 12:30:28 2021 +0100

Drop non-const Sequence::operator[] in internal code

This makes all non-const operations on Sequence explicit, to avoid
repeated COW checks in loops. Generally it would be desirable to
replace uses of Sequence with general-purpose containers wherever
possible, and only use Sequence for UNO API calls.

This change uncovered a very serious pre-existing problem inherent
to the Sequences used e.g. in range-based loops in our code: taking
a non-const reference to elements of a sequence, and then modifying
them at some later stage, brings a danger to also modify copies of
the Sequence, that were created between the points of taking the
reference and modifying it. This caused the change to
oox/source/drawingml/customshapeproperties.cxx, where
CustomShapeProperties::pushToPropSet took begin()/end() non-const
iterators to aGeoPropSeq at the start of the loop, and then in the
loop modified its elements and copied the Sequence passing it to
XPropertySet::setPropertyValue. This was the same also prior to
2484de6728bd11bb7949003d112f1ece2223c7a1, and only happened to not
cause problems because of *accidental* use of non-const operator[]
on the copy of the Sequence inside SdrCustomShapeGeometryItem ctor,
which *inadvertently* triggered COW, detaching the two copies one
from another.
This only emphasizes that we should minimize use of Sequences in
the codebase. I anticipate other similar problems uncovered by this
change, that happened to not break existing unit tests.

Change-Id: Id691d994a06eb14297c487ebb84d8e062e29fd47
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123725
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/include/com/sun/star/uno/Sequence.h 
b/include/com/sun/star/uno/Sequence.h
index cc2c515f1322..b557ec87b4ca 100644
--- a/include/com/sun/star/uno/Sequence.h
+++ b/include/com/sun/star/uno/Sequence.h
@@ -217,6 +217,7 @@ public:
 */
 inline E const * end() const;
 
+#if !defined LIBO_INTERNAL_ONLY
 /** Non-const index operator: Obtains a reference to element indexed at
 given position.
 The implementation does not check for array bounds!
@@ -228,6 +229,7 @@ public:
 @return non-const C++ reference to element
 */
 inline E & SAL_CALL operator [] ( sal_Int32 nIndex );
+#endif
 
 /** Const index operator: Obtains a reference to element indexed at
 given position.  The implementation does not check for array bounds!
diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index 73e51a9bc7f5..7aa873e91223 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -180,6 +180,7 @@ template E * Sequence::end() { return begin() + 
getLength(); }
 template E const * Sequence::end() const
 { return begin() + getLength(); }
 
+#if !defined LIBO_INTERNAL_ONLY
 template< class E >
 inline E & Sequence< E >::operator [] ( sal_Int32 nIndex )
 {
@@ -187,6 +188,7 @@ inline E & Sequence< E >::operator [] ( sal_Int32 nIndex )
 assert(nIndex >= 0 && static_cast(nIndex) < 
static_cast(getLength()));
 return getArray()[ nIndex ];
 }
+#endif
 
 template< class E >
 inline const E & Sequence< E >::operator [] ( sal_Int32 nIndex ) const
diff --git a/oox/source/drawingml/customshapeproperties.cxx 
b/oox/source/drawingml/customshapeproperties.cxx
index 37c42b5119dc..0aba70b7a337 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -182,8 +182,11 @@ void CustomShapeProperties::pushToPropSet(
 static const OUStringLiteral sType = u"Type";
 if ( aGeoPropSet >>= aGeoPropSeq )
 {
-for ( auto& rGeoProp : asNonConstRange(aGeoPropSeq) )
+// aGeoPropSeq gets modified in the loop, and gets copied 
elsewhere;
+// don't use range-based for here
+for ( sal_Int32 i = 0; i < aGeoPropSeq.getLength(); ++i )
 {
+const auto& rGeoProp = aGeoPropSeq[i];
 if ( rGeoProp.Name == sAdjustmentValues )
 {
 uno::Sequence< 
css::drawing::EnhancedCustomShapeAdjustmentValue > aAdjustmentSeq;
@@ -216,16 +219,20 @@ void CustomShapeProperties::pushToPropSet(
 }
 }
 }
-

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

2021-06-24 Thread Noel Grandin (via logerrit)
 include/com/sun/star/uno/Type.h   |4 
 include/com/sun/star/uno/Type.hxx |   10 --
 2 files changed, 14 deletions(-)

New commits:
commit 350fe112c20106e9a53fec4c2f3c0f7fdc496e3f
Author: Noel Grandin 
AuthorDate: Thu Jun 24 10:00:47 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Jun 24 20:49:17 2021 +0200

remove uno::Type move constructor

not necessary for the optimisation I was going for, and actually less
efficient than just using the copy constructor

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

diff --git a/include/com/sun/star/uno/Type.h b/include/com/sun/star/uno/Type.h
index 364d9eb5959e..5dc1b41e0bc2 100644
--- a/include/com/sun/star/uno/Type.h
+++ b/include/com/sun/star/uno/Type.h
@@ -119,10 +119,6 @@ public:
 */
 inline Type( const Type & rType );
 
-#if defined LIBO_INTERNAL_ONLY
-inline Type( Type && );
-#endif
-
 /** Destructor: Releases acquired C type description reference.
 */
 ~Type()
diff --git a/include/com/sun/star/uno/Type.hxx 
b/include/com/sun/star/uno/Type.hxx
index 5c95adc3bd85..f62d0a17b63a 100644
--- a/include/com/sun/star/uno/Type.hxx
+++ b/include/com/sun/star/uno/Type.hxx
@@ -82,16 +82,6 @@ inline Type::Type( const Type & rType )
 ::typelib_typedescriptionreference_acquire( _pType );
 }
 
-#if defined LIBO_INTERNAL_ONLY
-inline Type::Type( Type && rType )
-: _pType( rType._pType )
-{
-rType._pType = reinterpret_cast< const ::com::sun::star::uno::Type * >(
-::typelib_static_type_getByTypeClass( typelib_TypeClass_VOID ) 
)->getTypeLibType();
-::typelib_typedescriptionreference_acquire( rType._pType );
-}
-#endif
-
 inline ::rtl::OUString Type::getTypeName() const
 {
 return ::rtl::OUString( _pType->pTypeName );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-06-24 Thread Noel Grandin (via logerrit)
 include/com/sun/star/uno/Type.h   |8 
 include/com/sun/star/uno/Type.hxx |   18 ++
 2 files changed, 26 insertions(+)

New commits:
commit dd2d82cfb7c2f3fc5300bc6164608beaf7c3d0ba
Author: Noel Grandin 
AuthorDate: Wed Jun 23 10:34:06 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Jun 24 08:46:39 2021 +0200

uno::Type needs a move operator

speeds up some operations where Type is stored in a vector

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

diff --git a/include/com/sun/star/uno/Type.h b/include/com/sun/star/uno/Type.h
index c643e3c8de98..364d9eb5959e 100644
--- a/include/com/sun/star/uno/Type.h
+++ b/include/com/sun/star/uno/Type.h
@@ -119,6 +119,10 @@ public:
 */
 inline Type( const Type & rType );
 
+#if defined LIBO_INTERNAL_ONLY
+inline Type( Type && );
+#endif
+
 /** Destructor: Releases acquired C type description reference.
 */
 ~Type()
@@ -131,6 +135,10 @@ public:
 */
 inline Type & SAL_CALL operator = ( const Type & rType );
 
+#if defined LIBO_INTERNAL_ONLY
+inline Type & SAL_CALL operator = ( Type && );
+#endif
+
 /** Gets the type class of set type.
 
 @return type class of set type
diff --git a/include/com/sun/star/uno/Type.hxx 
b/include/com/sun/star/uno/Type.hxx
index 27fd7dd5149c..5c95adc3bd85 100644
--- a/include/com/sun/star/uno/Type.hxx
+++ b/include/com/sun/star/uno/Type.hxx
@@ -82,6 +82,16 @@ inline Type::Type( const Type & rType )
 ::typelib_typedescriptionreference_acquire( _pType );
 }
 
+#if defined LIBO_INTERNAL_ONLY
+inline Type::Type( Type && rType )
+: _pType( rType._pType )
+{
+rType._pType = reinterpret_cast< const ::com::sun::star::uno::Type * >(
+::typelib_static_type_getByTypeClass( typelib_TypeClass_VOID ) 
)->getTypeLibType();
+::typelib_typedescriptionreference_acquire( rType._pType );
+}
+#endif
+
 inline ::rtl::OUString Type::getTypeName() const
 {
 return ::rtl::OUString( _pType->pTypeName );
@@ -93,6 +103,14 @@ inline Type & Type::operator = ( const Type & rType )
 return *this;
 }
 
+#if defined LIBO_INTERNAL_ONLY
+inline Type & Type::operator = ( Type && rType )
+{
+std::swap(_pType, rType._pType);
+return *this;
+}
+#endif
+
 
 template< class T >
 typelib_TypeDescriptionReference * Array< T >::s_pType = NULL;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-02-15 Thread Noel (via logerrit)
 include/com/sun/star/uno/Reference.hxx  |2 
 reportdesign/source/core/api/FixedLine.cxx  |2 
 reportdesign/source/core/api/FixedText.cxx  |2 
 reportdesign/source/core/api/FormattedField.cxx |4 -
 reportdesign/source/core/api/ImageControl.cxx   |2 
 reportdesign/source/core/api/ReportDefinition.cxx   |   10 ++--
 reportdesign/source/core/api/Shape.cxx  |2 
 reportdesign/source/core/api/Tools.cxx  |4 -
 reportdesign/source/core/sdr/RptObject.cxx  |   12 ++---
 reportdesign/source/core/sdr/UndoActions.cxx|4 -
 reportdesign/source/core/sdr/UndoEnv.cxx|8 +--
 reportdesign/source/filter/xml/xmlCell.cxx  |   22 +-
 reportdesign/source/filter/xml/xmlExport.cxx|   26 ++--
 reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx |2 
 reportdesign/source/filter/xml/xmlFormatCondition.cxx   |2 
 reportdesign/source/filter/xml/xmlFormattedField.cxx|2 
 reportdesign/source/filter/xml/xmlGroup.cxx |2 
 reportdesign/source/filter/xml/xmlImage.cxx |2 
 reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx |6 +-
 reportdesign/source/filter/xml/xmlReport.cxx|4 -
 reportdesign/source/filter/xml/xmlReportElement.cxx |4 -
 reportdesign/source/filter/xml/xmlReportElementBase.cxx |4 -
 reportdesign/source/filter/xml/xmlSubDocument.cxx   |6 +-
 reportdesign/source/filter/xml/xmlTable.cxx |4 -
 reportdesign/source/filter/xml/xmlfilter.cxx|2 
 reportdesign/source/ui/dlg/AddField.cxx |2 
 reportdesign/source/ui/dlg/CondFormat.cxx   |8 +--
 reportdesign/source/ui/dlg/Condition.cxx|2 
 reportdesign/source/ui/dlg/Formula.cxx  |2 
 reportdesign/source/ui/dlg/GroupsSorting.cxx|8 +--
 reportdesign/source/ui/dlg/Navigator.cxx|6 +-
 reportdesign/source/ui/inspection/DataProviderHandler.cxx   |2 
 reportdesign/source/ui/inspection/GeometryHandler.cxx   |4 -
 reportdesign/source/ui/misc/RptUndo.cxx |2 
 reportdesign/source/ui/misc/UITools.cxx |2 
 reportdesign/source/ui/report/FixedTextColor.cxx|2 
 reportdesign/source/ui/report/FormattedFieldBeautifier.cxx  |2 
 reportdesign/source/ui/report/ReportController.cxx  |   10 ++--
 reportdesign/source/ui/report/ReportControllerObserver.cxx  |4 -
 reportdesign/source/ui/report/ReportSection.cxx |4 -
 reportdesign/source/ui/report/SectionWindow.cxx |6 +-
 reportdesign/source/ui/report/propbrw.cxx   |2 
 42 files changed, 104 insertions(+), 104 deletions(-)

New commits:
commit be92ed5799e7f8dab0d8d1042135afe38b7f258f
Author: Noel 
AuthorDate: Mon Feb 15 09:40:30 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 16 07:52:57 2021 +0100

loplugin:referencecasting in reportdesign

Also, I needed to add
castToXInterface()
to the upcasting Reference::Reference constructor,
to resolve ambiguity in casting to XInterface.

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

diff --git a/include/com/sun/star/uno/Reference.hxx 
b/include/com/sun/star/uno/Reference.hxx
index ee0117bda0fb..7632c55045ca 100644
--- a/include/com/sun/star/uno/Reference.hxx
+++ b/include/com/sun/star/uno/Reference.hxx
@@ -144,7 +144,7 @@ inline Reference< interface_type >::Reference(
 && !std::is_same_v, void *>)
 {
 interface_type * p = rRef.get();
-_pInterface = p;
+_pInterface = castToXInterface(p);
 if (_pInterface)
 _pInterface->acquire();
 }
diff --git a/reportdesign/source/core/api/FixedLine.cxx 
b/reportdesign/source/core/api/FixedLine.cxx
index 42082bfc3e95..6e83c1a25b21 100644
--- a/reportdesign/source/core/api/FixedLine.cxx
+++ b/reportdesign/source/core/api/FixedLine.cxx
@@ -330,7 +330,7 @@ uno::Reference< util::XCloneable > SAL_CALL 
OFixedLine::createClone(  )
 {
 uno::Reference< report::XReportComponent> xSource = this;
 uno::Reference< report::XFixedLine> 
xSet(cloneObject(xSource,m_aProps.aComponent.m_xFactory,SERVICE_FIXEDLINE),uno::UNO_QUERY_THROW);
-return xSet.get();
+return xSet;
 }
 
 
diff --git a/reportdesign/source/core/api/FixedText.cxx 
b/reportdesign/source/core/api/FixedText.cxx
index 589d68946406..e77eb4b3aa49 100644
--- a/reportdesign/source/core/api/FixedText.cxx
+++ b/reportdesign/source/core/api/FixedText.cxx
@@ -184,7 +184,7 @@ uno::Reference< util::XCloneable > SAL_CALL 

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

2021-02-01 Thread msrijita18 (via logerrit)
 include/com/sun/star/uno/Any.h |4 
 include/com/sun/star/uno/Any.hxx   |4 
 include/com/sun/star/uno/Reference.h   |4 
 include/com/sun/star/uno/Reference.hxx |4 
 include/com/sun/star/uno/Sequence.h|4 
 include/com/sun/star/uno/Sequence.hxx  |4 
 include/com/sun/star/uno/Type.h|4 
 include/com/sun/star/uno/Type.hxx  |4 
 include/com/sun/star/uno/genfunc.h |4 
 include/com/sun/star/uno/genfunc.hxx   |4 
 10 files changed, 40 insertions(+)

New commits:
commit 83f0ec0ac179feb188fc0c9184d5c57c1870fde4
Author: msrijita18 
AuthorDate: Wed Jan 27 19:09:26 2021 +0530
Commit: Stephan Bergmann 
CommitDate: Mon Feb 1 11:29:38 2021 +0100

tdf#130978 Add a comment to each published API

Added comment in include/com/sun/star/uno header files

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

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index 577b31344ae7..c53ddff68373 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -16,6 +16,10 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+
+/*
+ * This file is part of LibreOffice published API.
+ */
 #ifndef INCLUDED_COM_SUN_STAR_UNO_ANY_H
 #define INCLUDED_COM_SUN_STAR_UNO_ANY_H
 
diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index c7089a0b5810..28d45f1ec21d 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -16,6 +16,10 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+
+/*
+ * This file is part of LibreOffice published API.
+ */
 #ifndef INCLUDED_COM_SUN_STAR_UNO_ANY_HXX
 #define INCLUDED_COM_SUN_STAR_UNO_ANY_HXX
 
diff --git a/include/com/sun/star/uno/Reference.h 
b/include/com/sun/star/uno/Reference.h
index 0221f0ca5f54..da6d4ea9bd6a 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -16,6 +16,10 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+
+/*
+ * This file is part of LibreOffice published API.
+ */
 #ifndef INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
 #define INCLUDED_COM_SUN_STAR_UNO_REFERENCE_H
 
diff --git a/include/com/sun/star/uno/Reference.hxx 
b/include/com/sun/star/uno/Reference.hxx
index c78f2681e3d5..ee0117bda0fb 100644
--- a/include/com/sun/star/uno/Reference.hxx
+++ b/include/com/sun/star/uno/Reference.hxx
@@ -16,6 +16,10 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+
+/*
+ * This file is part of LibreOffice published API.
+ */
 #ifndef INCLUDED_COM_SUN_STAR_UNO_REFERENCE_HXX
 #define INCLUDED_COM_SUN_STAR_UNO_REFERENCE_HXX
 
diff --git a/include/com/sun/star/uno/Sequence.h 
b/include/com/sun/star/uno/Sequence.h
index 2ba8c71f8be8..6b19af68d8a1 100644
--- a/include/com/sun/star/uno/Sequence.h
+++ b/include/com/sun/star/uno/Sequence.h
@@ -16,6 +16,10 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+
+/*
+ * This file is part of LibreOffice published API.
+ */
 #ifndef INCLUDED_COM_SUN_STAR_UNO_SEQUENCE_H
 #define INCLUDED_COM_SUN_STAR_UNO_SEQUENCE_H
 
diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index af82925d5f1b..26a51350815b 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -16,6 +16,10 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+
+/*
+ * This file is part of LibreOffice published API.
+ */
 #ifndef INCLUDED_COM_SUN_STAR_UNO_SEQUENCE_HXX
 #define INCLUDED_COM_SUN_STAR_UNO_SEQUENCE_HXX
 
diff --git a/include/com/sun/star/uno/Type.h b/include/com/sun/star/uno/Type.h
index c159ff3a06cc..c643e3c8de98 100644
--- a/include/com/sun/star/uno/Type.h
+++ b/include/com/sun/star/uno/Type.h
@@ -16,6 +16,10 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+
+/*
+ * This file is part of LibreOffice published API.
+ */
 #ifndef INCLUDED_COM_SUN_STAR_UNO_TYPE_H
 #define INCLUDED_COM_SUN_STAR_UNO_TYPE_H
 
diff --git a/include/com/sun/star/uno/Type.hxx 
b/include/com/sun/star/uno/Type.hxx
index fdf45431e515..27fd7dd5149c 100644
--- a/include/com/sun/star/uno/Type.hxx
+++ b/include/com/sun/star/uno/Type.hxx
@@ -16,6 +16,10 @@
  *   except in compliance with the License. You may 

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

2020-09-22 Thread Caolán McNamara (via logerrit)
 include/com/sun/star/uno/Sequence.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b576e560073e7b08dcf0d1f172894ebff23d054d
Author: Caolán McNamara 
AuthorDate: Tue Sep 22 08:56:58 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 22 13:21:28 2020 +0200

__coverity_tainted_data_sanitize__ can't be const

apparently, so use const_cast on its input instead

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

diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index 62b8b1df96c3..3d0c024a1da3 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -74,7 +74,7 @@ inline Sequence< E >::Sequence(
 }
 
 #if defined(__COVERITY__)
-extern "C" void __coverity_tainted_data_sanitize__(const void *);
+extern "C" void __coverity_tainted_data_sanitize__(void *);
 #endif
 
 template< class E >
@@ -84,7 +84,7 @@ inline Sequence< E >::Sequence( const E * pElements, 
sal_Int32 len )
 
 #if defined(__COVERITY__)
 // cid#1448292 coverity has difficulty with css::uno::Sequence
-__coverity_tainted_data_sanitize__(pElements);
+__coverity_tainted_data_sanitize__(const_cast(pElements));
 #endif
 
 bool success =
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-09-20 Thread Caolán McNamara (via logerrit)
 include/com/sun/star/uno/Sequence.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7fc01e2c51607e0356b277ddc06f548127b8ff04
Author: Caolán McNamara 
AuthorDate: Sun Sep 20 12:34:15 2020 +0100
Commit: Caolán McNamara 
CommitDate: Sun Sep 20 14:28:33 2020 +0200

fix __coverity_tainted_data_sanitize__ signature

argument of type "const sal_Int8 *" is incompatible with parameter of type
"void *"

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

diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index 373d97624cd8..62b8b1df96c3 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -74,7 +74,7 @@ inline Sequence< E >::Sequence(
 }
 
 #if defined(__COVERITY__)
-extern "C" void __coverity_tainted_data_sanitize__(void *);
+extern "C" void __coverity_tainted_data_sanitize__(const void *);
 #endif
 
 template< class E >
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-04-23 Thread Stephan Bergmann (via logerrit)
 include/com/sun/star/uno/Reference.h   |   16 +---
 include/com/sun/star/uno/Reference.hxx |2 +-
 2 files changed, 6 insertions(+), 12 deletions(-)

New commits:
commit 39a1edd6fec902ef378acce8af42c4d7fba280d0
Author: Stephan Bergmann 
AuthorDate: Thu Apr 23 20:21:20 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Apr 23 21:50:20 2020 +0200

Make css::uno::Reference upcast ctor LIBO_INTERNAL_ONLY

It looks like an oversight that 904b3d1fceee5827076758ed2a81f80cb73493ca 
"Up-
cast conversion constructor for css::uno::Reference" added it also for 
external
code.  Making it LIBO_INTERNAL_ONLY allows to remove workarounds for old 
MSVC,
and may allow to simplify the code further in the future.  (Though using
std::is_base_of, as suggested in the comment, is not easily possible, as it
would cause errors like

> include/c++/v1/type_traits:1726:59: error: incomplete type 
'com::sun::star::lang::XMultiServiceFactory' used in type trait expression
> : public integral_constant {};
>   ^
> include/c++/v1/type_traits:1731:7: note: in instantiation of template 
class 'std::__1::is_base_of' requested here
> = is_base_of<_Bp, _Dp>::value;
>   ^
> include/com/sun/star/uno/Reference.h:277:18: note: in instantiation of 
variable template specialization 
'std::__1::is_base_of_v' requested here
> std::is_base_of_v
>  ^
> ucbhelper/source/provider/getcomponentcontext.cxx:34:9: note: while 
substituting deduced template arguments into function template 'Reference' 
[with derived_type = com::sun::star::lang::XMultiServiceFactory]
> css::uno::Reference< css::beans::XPropertySet >(
> ^
> include/ucbhelper/getcomponentcontext.hxx:29:28: note: forward 
declaration of 'com::sun::star::lang::XMultiServiceFactory'
> namespace lang { class XMultiServiceFactory; }
>^

with incomplete types.)

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

diff --git a/include/com/sun/star/uno/Reference.h 
b/include/com/sun/star/uno/Reference.h
index 50afd26a83b4..951902b356bd 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -167,6 +167,7 @@ enum UnoReference_SetThrow
 UNO_SET_THROW
 };
 
+#if defined LIBO_INTERNAL_ONLY
 /// @cond INTERNAL
 namespace detail {
 
@@ -179,7 +180,8 @@ namespace detail {
 // selm=df893da6.0301280859.522081f7%40posting.google.com> "SuperSubclass
 // (is_base_and_derived) complete implementation!" by Rani Sharoni and cites
 // Aleksey Gurtovoy for the workaround for MSVC), to avoid including Boost
-// headers in URE headers (could ultimately be based on C++11 std::is_base_of):
+// headers in URE headers (basing on C++11 std::is_base_of does not work when 
the types are
+// incomplete):
 
 template< typename T1, typename T2 > struct UpCast {
 private:
@@ -191,21 +193,12 @@ private:
 
 struct S { char c[2]; };
 
-#if defined _MSC_VER && _MSC_VER < 1800
-static char f(T2 *, long);
-static S f(T1 * const &, int);
-#else
 template< typename U > static char f(T2 *, U);
 static S f(T1 *, int);
-#endif
 
 struct H {
 H(); // avoid C2514 "class has no constructors" from MSVC
-#if defined _MSC_VER && _MSC_VER < 1800
-operator T1 * const & () const;
-#else
 operator T1 * () const;
-#endif
 operator T2 * ();
 };
 
@@ -217,6 +210,7 @@ template< typename T2 > struct UpCast< XInterface, T2 > {};
 
 }
 /// @endcond
+#endif
 
 /** Template reference class for interface type derived from BaseReference.
 A special constructor given the UNO_QUERY identifier queries interfaces
@@ -308,7 +302,6 @@ public:
 @param rRef another reference
 */
 inline Reference( Reference< interface_type > && rRef ) noexcept;
-#endif
 
 /** Up-casting conversion constructor: Copies interface reference.
 
@@ -322,6 +315,7 @@ public:
 inline Reference(
 const Reference< derived_type > & rRef,
 typename detail::UpCast< interface_type, derived_type >::t = 0 );
+#endif
 
 /** Constructor: Sets given interface pointer.
 
diff --git a/include/com/sun/star/uno/Reference.hxx 
b/include/com/sun/star/uno/Reference.hxx
index 9edbd70d0f88..b3c01aaa2391 100644
--- a/include/com/sun/star/uno/Reference.hxx
+++ b/include/com/sun/star/uno/Reference.hxx
@@ -131,7 +131,6 @@ inline Reference< interface_type >::Reference( Reference< 
interface_type > && rR
 _pInterface = rRef._pInterface;
 rRef._pInterface = nullptr;
 }
-#endif
 
 template< class interface_type > template< class derived_type >
 inline Reference< interface_type >::Reference(
@@ -143,6 +142,7 @@ inline Reference< interface_type >::Reference(
 if 

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

2019-12-06 Thread Stephan Bergmann (via logerrit)
 include/com/sun/star/uno/Sequence.hxx |4 ++--
 store/source/storbase.hxx |6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit a596dd99de287c696c70f0c789a774399381f36f
Author: Stephan Bergmann 
AuthorDate: Fri Dec 6 16:19:29 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Fri Dec 6 19:20:29 2019 +0100

loplugin:nullptr

...in non-dependent templated code that Clang trunk now apparently processes
more aggressively, presumably since  "Reapply 'Fix crash on 
switch
conditions of non-integer types in templates'"

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

diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index c31e43141ca3..373d97624cd8 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -55,7 +55,7 @@ inline Sequence< E >::Sequence()
 const Type & rType = ::cppu::getTypeFavourUnsigned( this );
 ::uno_type_sequence_construct(
 &_pSequence, rType.getTypeLibType(),
-0, 0, cpp_acquire );
+NULL, 0, cpp_acquire );
 // no bad_alloc, because empty sequence is statically allocated in cppu
 }
 
@@ -102,7 +102,7 @@ inline Sequence< E >::Sequence( sal_Int32 len )
 bool success =
 ::uno_type_sequence_construct(
 &_pSequence, rType.getTypeLibType(),
-0, len, cpp_acquire );
+NULL, len, cpp_acquire );
 if (! success)
 throw ::std::bad_alloc();
 }
diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx
index 0c21acbb3ad3..b9dc53247a8d 100644
--- a/store/source/storbase.hxx
+++ b/store/source/storbase.hxx
@@ -417,12 +417,12 @@ class PageHolderObject
 public:
 bool construct (rtl::Reference< PageData::Allocator > const & rxAllocator)
 {
-if ((m_xPage.get() == 0) && rxAllocator.is())
+if ((m_xPage.get() == nullptr) && rxAllocator.is())
 {
 std::shared_ptr tmp (rxAllocator->construct(), 
PageData::Deallocate(rxAllocator));
 m_xPage.swap (tmp);
 }
-return (m_xPage.get() != 0);
+return (m_xPage.get() != nullptr);
 }
 
 explicit PageHolderObject (std::shared_ptr const & rxPage = 
std::shared_ptr())
@@ -447,7 +447,7 @@ public:
 
 bool is() const
 {
-return (m_xPage.get() != 0);
+return (m_xPage.get() != nullptr);
 }
 
 std::shared_ptr & get() { return m_xPage; }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-12-03 Thread Stephan Bergmann (via logerrit)
 include/com/sun/star/uno/Any.hxx |2 +-
 sw/source/filter/ww8/docxattributeoutput.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e8cb5f2e11838060f85e7940540b5f7096d9eeb7
Author: Stephan Bergmann 
AuthorDate: Tue Dec 3 13:30:41 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Dec 3 19:44:37 2019 +0100

Adapt to C++20 deleted ostream << for sal_Unicode (aka char16_t)

 
"char8_t
backward compatibility remediation", as implemented now by 
 
"libstdc++:
P1423R3 char8_t remediation (2/4)" for -std=c++2a, deletes operator << 
overloads
that would print an integer rather than a (presumably expected) character.

But in these cases printing an integer is as expected, so add explicit 
casts.

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

diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index 05f032fc5b81..c7089a0b5810 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -720,7 +720,7 @@ inline std::basic_ostream 
<<(std::basic_ostream(any.getValue());
+  << unsigned(*static_cast(any.getValue()));
 o.setf(flgs);
 o.fill(fill);
 break;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index 91d77e81ddbb..c9b1835ab792 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2783,7 +2783,7 @@ void DocxAttributeOutput::RunText( const OUString& rText, 
rtl_TextEncoding /*eCh
 if ( *pIt < 0x0020 ) // filter out the control codes
 {
 impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt 
);
-SAL_INFO("sw.ww8", "Ignored control code in a text run: " 
<< *pIt );
+SAL_INFO("sw.ww8", "Ignored control code in a text run: " 
<< unsigned(*pIt) );
 }
 prevUnicode = *pIt;
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-30 Thread Noel Grandin (via logerrit)
 include/com/sun/star/uno/Any.h   |4 ++--
 include/com/sun/star/uno/Any.hxx |6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit f3fd63d63643b0c8710d80c00a532e97728acb84
Author: Noel Grandin 
AuthorDate: Fri Aug 30 08:34:09 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Aug 30 11:04:12 2019 +0200

loplugin:noexceptmove in Any

but we needed to make moveAnyInternals noexcept, which is fine because
uno_any_construct is already noexcept

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

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index 2a8cf3d05192..577b31344ae7 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -138,8 +138,8 @@ public:
 inline Any & SAL_CALL operator = ( const Any & rAny );
 
 #if defined LIBO_INTERNAL_ONLY
-inline Any(Any && other);
-inline Any & operator =(Any && other);
+inline Any(Any && other) noexcept;
+inline Any & operator =(Any && other) noexcept;
 #endif
 
 /** Gets the type of the set value.
diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index 2467a9c3d1f4..d7b3420baecc 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -127,7 +127,7 @@ inline Any & Any::operator = ( const Any & rAny )
 
 namespace detail {
 
-inline void moveAnyInternals(Any & from, Any & to) {
+inline void moveAnyInternals(Any & from, Any & to) noexcept {
 uno_any_construct(, nullptr, nullptr, _acquire);
 std::swap(from.pType, to.pType);
 std::swap(from.pData, to.pData);
@@ -143,11 +143,11 @@ inline void moveAnyInternals(Any & from, Any & to) {
 
 }
 
-Any::Any(Any && other) {
+Any::Any(Any && other) noexcept {
 detail::moveAnyInternals(other, *this);
 }
 
-Any & Any::operator =(Any && other) {
+Any & Any::operator =(Any && other) noexcept {
 uno_any_destruct(this, _release);
 detail::moveAnyInternals(other, *this);
 return *this;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-26 Thread Mike Kaganski (via logerrit)
 include/com/sun/star/uno/Sequence.h |   20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

New commits:
commit b5317b2a41e6369e2804462e2ab73f1447f1533a
Author: Mike Kaganski 
AuthorDate: Mon Aug 26 15:04:47 2019 +0200
Commit: Mike Kaganski 
CommitDate: Mon Aug 26 17:51:01 2019 +0200

Introduce Sequence::size() instead of specialization of std::size

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

diff --git a/include/com/sun/star/uno/Sequence.h 
b/include/com/sun/star/uno/Sequence.h
index 78d1124ba504..2ba8c71f8be8 100644
--- a/include/com/sun/star/uno/Sequence.h
+++ b/include/com/sun/star/uno/Sequence.h
@@ -27,6 +27,7 @@
 #include 
 
 #if defined LIBO_INTERNAL_ONLY
+#include 
 #include 
 #endif
 
@@ -151,6 +152,15 @@ public:
 bool SAL_CALL hasElements() const
 { return (_pSequence->nElements > 0); }
 
+#if defined LIBO_INTERNAL_ONLY
+/** This function allows to use Sequence in cases where  std::size is 
needed, and the like.
+
+@since LibreOffice 6.4
+*/
+sal_uInt32 size() const
+{ assert(getLength() >= 0); return 
static_cast(getLength()); }
+#endif
+
 /** Gets a pointer to elements array for reading.
 If the sequence has a length of 0, then the returned pointer is
 undefined.
@@ -272,16 +282,6 @@ inline ::com::sun::star::uno::Sequence< sal_Int8 > 
SAL_CALL toUnoSequence(
 }
 }
 
-#if defined LIBO_INTERNAL_ONLY
-namespace std
-{
-template  sal_Int32 size(const ::com::sun::star::uno::Sequence& s)
-{
-return s.getLength();
-}
-}
-#endif
-
 /** Gets the meta type of IDL sequence.
 
 There are cases (involving templates) where uses of getCppuType are known 
to
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-25 Thread Mike Kaganski (via logerrit)
 include/com/sun/star/uno/Sequence.h |   10 ++
 include/comphelper/sequence.hxx |7 +++
 2 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 8fc9c698ee643dd4363c5ad1daa7bbc0a13982d5
Author: Mike Kaganski 
AuthorDate: Mon Aug 26 01:26:34 2019 +0300
Commit: Mike Kaganski 
CommitDate: Mon Aug 26 07:25:18 2019 +0200

Generalize comphelper::concatSequences to accept other container types

... as second and following arguments.

Change-Id: I1c994ec234354805bc702632878fd67a54d271d6
Reviewed-on: https://gerrit.libreoffice.org/78092
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/include/com/sun/star/uno/Sequence.h 
b/include/com/sun/star/uno/Sequence.h
index f5c9c384eeef..78d1124ba504 100644
--- a/include/com/sun/star/uno/Sequence.h
+++ b/include/com/sun/star/uno/Sequence.h
@@ -272,6 +272,16 @@ inline ::com::sun::star::uno::Sequence< sal_Int8 > 
SAL_CALL toUnoSequence(
 }
 }
 
+#if defined LIBO_INTERNAL_ONLY
+namespace std
+{
+template  sal_Int32 size(const ::com::sun::star::uno::Sequence& s)
+{
+return s.getLength();
+}
+}
+#endif
+
 /** Gets the meta type of IDL sequence.
 
 There are cases (involving templates) where uses of getCppuType are known 
to
diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index 6c51311daf29..18e269173627 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -49,10 +49,9 @@ namespace comphelper
 inline css::uno::Sequence concatSequences(const css::uno::Sequence& 
rS1, const Ss&... rSn)
 {
 // unary fold to disallow empty parameter pack: at least have one 
sequence in rSn
-css::uno::Sequence aReturn(rS1.getLength() + (... + 
rSn.getLength()));
-T* pReturn;
-((pReturn = std::copy_n(rS1.getConstArray(), rS1.getLength(), 
aReturn.getArray())), ...,
- (pReturn = std::copy_n(rSn.getConstArray(), rSn.getLength(), 
pReturn)));
+css::uno::Sequence aReturn(std::size(rS1) + (... + std::size(rSn)));
+T* pReturn = std::copy(std::begin(rS1), std::end(rS1), 
aReturn.begin());
+(..., (pReturn = std::copy(std::begin(rSn), std::end(rSn), pReturn)));
 return aReturn;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-30 Thread Andrea Gelmini (via logerrit)
 include/com/sun/star/uno/Type.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 940e459f65b4741e5ba4757e2b8eed4e31220273
Author: Andrea Gelmini 
AuthorDate: Fri Jun 14 22:41:59 2019 +
Commit: Julien Nabet 
CommitDate: Sun Jun 30 09:48:46 2019 +0200

Fix typo

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

diff --git a/include/com/sun/star/uno/Type.h b/include/com/sun/star/uno/Type.h
index 5ca395e881fb..056f6ba5f379 100644
--- a/include/com/sun/star/uno/Type.h
+++ b/include/com/sun/star/uno/Type.h
@@ -179,7 +179,7 @@ public:
 */
 bool SAL_CALL operator == ( const Type & rType ) const
 { return ::typelib_typedescriptionreference_equals( _pType, 
rType._pType ); }
-/** Unequality operator: Compares two types.
+/** Inequality operator: Compares two types.
 
 @param rType another type
 @return false if both types refer the same type, true otherwise
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-30 Thread Andrea Gelmini (via logerrit)
 include/com/sun/star/uno/Any.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9eaf613f3116fbe32af1582a8cef56d1220bb7ef
Author: Andrea Gelmini 
AuthorDate: Sat Jun 29 15:58:26 2019 +
Commit: Julien Nabet 
CommitDate: Sun Jun 30 09:48:24 2019 +0200

Fix typo

Change-Id: I1b43e186bd6e9de7332513e60f3be1bbe9d8ff82
Reviewed-on: https://gerrit.libreoffice.org/74901
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index 4c52167a6b67..2a8cf3d05192 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -272,7 +272,7 @@ public:
 @return true if both any contains equal values
 */
 inline bool SAL_CALL operator == ( const Any & rAny ) const;
-/** Unequality operator: compares two anys.
+/** Inequality operator: compares two anys.
 The values need not be of equal type, e.g. a short integer is compared 
to a long integer.
 
 @param rAny another any (right side)
@@ -392,7 +392,7 @@ inline bool SAL_CALL operator >>= ( const Any & rAny, C & 
value );
 */
 template< class C >
 inline bool SAL_CALL operator == ( const Any & rAny, const C & value );
-/** Template unequality operator: compares set value of left side any to right 
side value.
+/** Template inequality operator: compares set value of left side any to right 
side value.
 The values need not be of equal type, e.g. a short integer is compared to 
a long integer.
 This operator can be implemented as template member function, if all 
supported compilers
 can cope with template member functions.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-30 Thread Andrea Gelmini (via logerrit)
 include/com/sun/star/uno/Sequence.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dc03b756795df156a14d00486825c6930a44b161
Author: Andrea Gelmini 
AuthorDate: Sat Jun 29 16:01:31 2019 +
Commit: Julien Nabet 
CommitDate: Sun Jun 30 09:46:51 2019 +0200

Fix typo

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

diff --git a/include/com/sun/star/uno/Sequence.h 
b/include/com/sun/star/uno/Sequence.h
index d86a4f6e5ca1..f5c9c384eeef 100644
--- a/include/com/sun/star/uno/Sequence.h
+++ b/include/com/sun/star/uno/Sequence.h
@@ -226,7 +226,7 @@ public:
 */
 inline bool SAL_CALL operator == ( const Sequence & rSeq ) const;
 
-/** Unequality operator: Compares two sequences.
+/** Inequality operator: Compares two sequences.
 
 @param rSeq another sequence of same type (right side)
 @return false if both sequences are equal, true otherwise
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-01 Thread Michael Weghorn (via logerrit)
 include/com/sun/star/uno/Sequence.h |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 05a06f4ebe89184d8006b9488752bc55378b62fd
Author: Michael Weghorn 
AuthorDate: Sat Jun 1 01:56:17 2019 +0200
Commit: Michael Weghorn 
CommitDate: Sat Jun 1 08:26:31 2019 +0200

Sequence: Fix typo in comments

Change-Id: I8477be28693f55bea857531707286437ea13d034
Reviewed-on: https://gerrit.libreoffice.org/73296
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/com/sun/star/uno/Sequence.h 
b/include/com/sun/star/uno/Sequence.h
index c6cb36cc71ff..d86a4f6e5ca1 100644
--- a/include/com/sun/star/uno/Sequence.h
+++ b/include/com/sun/star/uno/Sequence.h
@@ -171,28 +171,28 @@ public:
 */
 inline E * SAL_CALL getArray();
 
-/** This function allows to use Sequence in standard algorightms, like 
std::find
+/** This function allows to use Sequence in standard algorithms, like 
std::find
 and others.
 
 @since LibreOffice 4.2
 */
 inline E * begin();
 
-/** This function allows to use Sequence in standard algorightms, like 
std::find
+/** This function allows to use Sequence in standard algorithms, like 
std::find
 and others.
 
 @since LibreOffice 4.2
 */
 inline E const * begin() const;
 
-/** This function allows to use Sequence in standard algorightms, like 
std::find
+/** This function allows to use Sequence in standard algorithms, like 
std::find
 and others.
 
 @since LibreOffice 4.2
 */
 inline E * end();
 
-/** This function allows to use Sequence in standard algorightms, like 
std::find
+/** This function allows to use Sequence in standard algorithms, like 
std::find
 and others.
 
 @since LibreOffice 4.2
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-02-13 Thread Libreoffice Gerrit user
 include/com/sun/star/uno/Sequence.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e0dbab555bf6811e2ef5d908f481667fc0afef4f
Author: Michael Stahl 
AuthorDate: Wed Feb 13 14:14:35 2019 +0100
Commit: Michael Stahl 
CommitDate: Wed Feb 13 16:01:08 2019 +0100

fix Sequence ostream operator<< wrt. const

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

diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index 33014a81a4fd..83ddfb9d8101 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -254,7 +254,7 @@ void sequence_output_bytes( std::basic_ostream , const value_t
@since LibreOffice 6.1
 */
 template< typename value_t, typename charT, typename traits >
-inline std::basic_ostream <<(std::basic_ostream , css::uno::Sequence < value_t > )
+inline std::basic_ostream <<(std::basic_ostream , css::uno::Sequence const& v)
 {
 const value_t *pAry = v.getConstArray();
 sal_Int32 nLen = v.getLength();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2018-12-08 Thread Libreoffice Gerrit user
 include/com/sun/star/uno/Sequence.hxx |   21 ++---
 1 file changed, 6 insertions(+), 15 deletions(-)

New commits:
commit b297193296e6afd0a6045ab7cd9daf2374b3fb3a
Author: Stephan Bergmann 
AuthorDate: Sat Dec 8 18:09:58 2018 +0100
Commit: Stephan Bergmann 
CommitDate: Sat Dec 8 23:27:19 2018 +0100

Use constexpr if

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

diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index 64f84ffc7bc3..33014a81a4fd 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -245,9 +245,6 @@ void sequence_output_bytes( std::basic_ostream , const value_t
 os.setf(flags);
 }
 
-template
-struct negation : std::integral_constant { };
-
 }
 
 /**
@@ -257,21 +254,15 @@ struct negation : std::integral_constant { };
@since LibreOffice 6.1
 */
 template< typename value_t, typename charT, typename traits >
-inline typename std::enable_if>::value, std::basic_ostream>::type 
<<(std::basic_ostream , css::uno::Sequence < value_t 
> )
+inline std::basic_ostream <<(std::basic_ostream , css::uno::Sequence < value_t > )
 {
 const value_t *pAry = v.getConstArray();
 sal_Int32 nLen = v.getLength();
-uno_detail::sequence_output_elems(os, pAry, nLen, 
std::is_integral());
-return os;
-}
-
-template< typename value_t, typename charT, typename traits >
-inline typename std::enable_if::value, 
std::basic_ostream>::type <<(std::basic_ostream , css::uno::Sequence < value_t > )
-{
-// specialisation for signed bytes
-const sal_Int8 *pAry = v.getConstArray();
-sal_Int32 nLen = v.getLength();
-uno_detail::sequence_output_bytes(os, pAry, nLen);
+if constexpr (std::is_same::value) {
+uno_detail::sequence_output_bytes(os, pAry, nLen);
+} else {
+uno_detail::sequence_output_elems(os, pAry, nLen, 
std::is_integral());
+}
 return os;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-12 Thread Thorsten Behrens
 include/com/sun/star/uno/Sequence.hxx |   79 ++
 1 file changed, 79 insertions(+)

New commits:
commit 37b4b3ea042ab380106f4eca001b605d79980296
Author: Thorsten Behrens 
Date:   Thu Jan 11 23:14:11 2018 +0100

provide uno::Sequence with ostream output operator

Alongside Anys and other UNO data types, you can now also stream
out Sequences, e.g. in SAL_INFO or SAL_DEBUG statements.

Example code:

uno::Sequence aBuffer...
SAL_DEBUG("my buffer: " << aBuffer);

Would yield:

debug:: my buffer: 0xb6, 0x61, 0xa8, ...

Change-Id: I03b0789372c44a4dd057625824862f43b1b8dfdc
Reviewed-on: https://gerrit.libreoffice.org/47779
Reviewed-by: Stephan Bergmann 
Tested-by: Thorsten Behrens 

diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index 7fe9f0bda64f..64f84ffc7bc3 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -23,6 +23,10 @@
 
 #include 
 #include 
+#if defined LIBO_INTERNAL_ONLY
+# include 
+# include 
+#endif
 
 #include "osl/interlck.h"
 #include "com/sun/star/uno/Sequence.h"
@@ -200,6 +204,81 @@ inline ::com::sun::star::uno::Sequence< sal_Int8 > 
SAL_CALL toUnoSequence(
 return * reinterpret_cast< const ::com::sun::star::uno::Sequence< sal_Int8 
> * >(  );
 }
 
+#if defined LIBO_INTERNAL_ONLY
+
+/// @cond INTERNAL
+
+namespace uno_detail {
+
+template< typename value_t, typename charT, typename traits >
+void sequence_output_elems( std::basic_ostream , const 
value_t *pAry, sal_Int32 nLen, std::true_type )
+{
+// for integral types, use hex notation
+auto const flags = os.setf(std::ios_base::hex);
+for(sal_Int32 i=0; i 1 )
+os << "0x" << *pAry++;
+os.setf(flags);
+}
+
+template< typename value_t, typename charT, typename traits >
+void sequence_output_elems( std::basic_ostream , const 
value_t *pAry, sal_Int32 nLen, std::false_type )
+{
+// every other type: rely on their own ostream operator<<
+for(sal_Int32 i=0; i 1 )
+os << *pAry++;
+}
+
+template< typename value_t, typename charT, typename traits >
+void sequence_output_bytes( std::basic_ostream , const 
value_t *pAry, sal_Int32 nLen )
+{
+// special case bytes - ostream operator<< outputs those as char
+// values, but we need raw ints here
+auto const flags = os.setf(std::ios_base::hex);
+for(sal_Int32 i=0; i 1 )
+os << "0x" << (0xFF & +*pAry++);
+os.setf(flags);
+}
+
+template
+struct negation : std::integral_constant { };
+
+}
+
+/**
+   Support for Sequence in std::ostream (and thus in CPPUNIT_ASSERT or SAL_INFO
+   macros, for example).
+
+   @since LibreOffice 6.1
+*/
+template< typename value_t, typename charT, typename traits >
+inline typename std::enable_if>::value, std::basic_ostream>::type 
<<(std::basic_ostream , css::uno::Sequence < value_t 
> )
+{
+const value_t *pAry = v.getConstArray();
+sal_Int32 nLen = v.getLength();
+uno_detail::sequence_output_elems(os, pAry, nLen, 
std::is_integral());
+return os;
+}
+
+template< typename value_t, typename charT, typename traits >
+inline typename std::enable_if::value, 
std::basic_ostream>::type <<(std::basic_ostream , css::uno::Sequence < value_t > )
+{
+// specialisation for signed bytes
+const sal_Int8 *pAry = v.getConstArray();
+sal_Int32 nLen = v.getLength();
+uno_detail::sequence_output_bytes(os, pAry, nLen);
+return os;
+}
+
+/// @endcond
+
+#endif
+
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-08 Thread Stephan Bergmann
 include/com/sun/star/uno/Any.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 29ce7afd3502684206da5f31396daaed11baf629
Author: Stephan Bergmann 
Date:   Mon Jan 8 11:17:49 2018 +0100

Typo in comment ("from" vs. "to")

...which had been like that ever since the code got introduced with
0fbe22a77289a624e1346ab457734c2f64f8e6fb "css::uno::Any move semantics (for
LIBO_INTERNAL_ONLY)"

Change-Id: Iacd93a4434a92f2ee8f83ba1d59b0ef0a6c38a42

diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index ac1b43dd779e..3021fb2bade0 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -135,7 +135,7 @@ inline void moveAnyInternals(Any & from, Any & to) {
 if (to.pData == ) {
 to.pData = 
 }
-// This leaves to.pData (where "to" is now VOID) dangling to somewhere (cf.
+// This leaves from.pData (where "from" is now VOID) dangling to somewhere 
(cf.
 // CONSTRUCT_EMPTY_ANY, cppu/source/uno/prim.hxx), but what's relevant is
 // only that it isn't a nullptr (as e.g. >>= -> uno_type_assignData ->
 // _assignData takes a null pSource to mean "construct a default value").
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/com include/comphelper include/oox include/rtl include/sax sal/qa sc/qa

2017-11-10 Thread Stephan Bergmann
 include/com/sun/star/uno/Any.h  |4 ++
 include/com/sun/star/uno/Any.hxx|   18 ++--
 include/comphelper/propertyvalue.hxx|8 -
 include/oox/helper/propertymap.hxx  |5 ++-
 include/rtl/strbuf.hxx  |6 ++--
 include/rtl/string.hxx  |   11 ---
 include/rtl/ustrbuf.hxx |6 ++--
 include/rtl/ustring.hxx |   11 ---
 include/sax/fshelper.hxx|   33 +++
 sal/qa/rtl/strings/test_ostring_concat.cxx  |7 
 sal/qa/rtl/strings/test_oustring_concat.cxx |7 
 sc/qa/unit/ucalc_formula.cxx|   40 ++--
 12 files changed, 96 insertions(+), 60 deletions(-)

New commits:
commit 1fc79c3491906d85ed9972e161112459035b62ed
Author: Stephan Bergmann 
Date:   Fri Nov 10 17:46:57 2017 +0100

Avoid using O[U]StringConcat lvalues containing dangling refs to temporaries

...in code accidentally using auto like

> auto const aURL = uri->getUriReference() + "/"
> + INetURLObject::encode(
> m_sEmbeddedName, INetURLObject::PART_FPATH,
> INetURLObject::EncodeMechanism::All);
>
> uno::Reference 
xDataSource(xDatabaseContext->getByName(aURL), uno::UNO_QUERY);

in  "Properly construct
vnd.sun.star.pkg URL" did (causing hard to debug test failures there).

So make functions taking O[U]StringConcat take those by rvalue reference.
Unfortunately, that also needed adaption of various functions that just 
forward
their arguments.  And some code in sc/qa/unit/ucalc_formula.cxx used
CPPUNIT_ASSERT_EQUAL on OUStringConcat arguments in cases where that 
happened to
actually compile (because the structure of the two OUStringConcats was
identical), which needed adaption too (but which would arguably better use
CPPUNIT_ASSERT_EQUAL_MESSAGE, anyway).

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

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index 93be8c4ce5fd..2e216719b59e 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -79,7 +79,9 @@ public:
 
 #if defined LIBO_INTERNAL_ONLY
 template
-explicit inline Any(rtl::OUStringConcat const & value);
+explicit inline Any(rtl::OUStringConcat && value);
+template
+explicit Any(rtl::OUStringConcat const &) = delete;
 #endif
 
 /** Copy constructor: Sets value of the given any.
diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index 52ca0fc571fe..ac1b43dd779e 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -26,6 +26,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "com/sun/star/uno/Any.h"
 #include "uno/data.h"
@@ -76,7 +77,8 @@ inline Any::Any( bool value )
 
 #if defined LIBO_INTERNAL_ONLY
 template
-Any::Any(rtl::OUStringConcat const & value): Any(rtl::OUString(value))
+Any::Any(rtl::OUStringConcat && value):
+Any(rtl::OUString(std::move(value)))
 {}
 #endif
 
@@ -239,6 +241,14 @@ template<> Any toAny(Any const & value) { return value; }
 
 #if defined LIBO_INTERNAL_ONLY
 
+template
+Any makeAny(rtl::OUStringConcat && value)
+{ return Any(std::move(value)); }
+
+template
+Any toAny(rtl::OUStringConcat && value)
+{ return makeAny(std::move(value)); }
+
 template bool fromAny(Any const & any, T * value) {
 assert(value != nullptr);
 return any >>= *value;
@@ -275,14 +285,16 @@ inline void SAL_CALL operator <<= ( Any & rAny, bool 
const & value )
 
 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
 template< class C1, class C2 >
-inline void SAL_CALL operator <<= ( Any & rAny, const rtl::OUStringConcat< C1, 
C2 >& value )
+inline void SAL_CALL operator <<= ( Any & rAny, rtl::OUStringConcat< C1, C2 
>&& value )
 {
-const rtl::OUString str( value );
+const rtl::OUString str( std::move(value) );
 const Type & rType = ::cppu::getTypeFavourUnsigned();
 ::uno_type_any_assign(
 , const_cast< rtl::OUString * >(  ), rType.getTypeLibType(),
 cpp_acquire, cpp_release );
 }
+template
+void operator <<=(Any &, rtl::OUStringConcat const &) = delete;
 #endif
 
 #if defined LIBO_INTERNAL_ONLY
diff --git a/include/comphelper/propertyvalue.hxx 
b/include/comphelper/propertyvalue.hxx
index ba442c12a931..3415d2304f83 100644
--- a/include/comphelper/propertyvalue.hxx
+++ b/include/comphelper/propertyvalue.hxx
@@ -10,6 +10,10 @@
 #ifndef INCLUDED_COMPHELPER_PROPERTYVALUE_HXX
 #define INCLUDED_COMPHELPER_PROPERTYVALUE_HXX
 
+#include 
+
+#include 
+
 #include 
 
 namespace comphelper
@@ 

[Libreoffice-commits] core.git: include/com include/cppu include/cppuhelper include/osl include/rtl include/sal include/salhelper include/typelib include/uno

2017-10-23 Thread Stephan Bergmann
 include/com/sun/star/uno/Any.h  |   14 +++---
 include/com/sun/star/uno/Any.hxx|   20 ++--
 include/com/sun/star/uno/Reference.h|4 ++--
 include/com/sun/star/uno/Reference.hxx  |   12 ++--
 include/com/sun/star/uno/Sequence.h |8 
 include/com/sun/star/uno/Sequence.hxx   |   14 +++---
 include/com/sun/star/uno/Type.h |8 
 include/com/sun/star/uno/Type.hxx   |6 +++---
 include/com/sun/star/uno/genfunc.h  |2 +-
 include/com/sun/star/uno/genfunc.hxx|8 
 include/cppu/Enterable.hxx  |4 ++--
 include/cppu/EnvDcp.hxx |4 ++--
 include/cppu/EnvGuards.hxx  |2 +-
 include/cppu/Map.hxx|2 +-
 include/cppu/cppudllapi.h   |2 +-
 include/cppu/helper/purpenv/Environment.hxx |4 ++--
 include/cppu/helper/purpenv/Mapping.hxx |   10 +-
 include/cppu/macros.hxx |2 +-
 include/cppu/unotype.hxx|8 
 include/cppuhelper/access_control.hxx   |6 +++---
 include/cppuhelper/basemutex.hxx|2 +-
 include/cppuhelper/bootstrap.hxx|   10 +-
 include/cppuhelper/compbase.hxx |   22 +++---
 include/cppuhelper/compbase1.hxx|4 ++--
 include/cppuhelper/compbase10.hxx   |4 ++--
 include/cppuhelper/compbase11.hxx   |4 ++--
 include/cppuhelper/compbase12.hxx   |4 ++--
 include/cppuhelper/compbase2.hxx|4 ++--
 include/cppuhelper/compbase3.hxx|4 ++--
 include/cppuhelper/compbase4.hxx|4 ++--
 include/cppuhelper/compbase5.hxx|4 ++--
 include/cppuhelper/compbase6.hxx|4 ++--
 include/cppuhelper/compbase7.hxx|4 ++--
 include/cppuhelper/compbase8.hxx|4 ++--
 include/cppuhelper/compbase9.hxx|4 ++--
 include/cppuhelper/compbase_ex.hxx  |8 
 include/cppuhelper/component.hxx|   10 +-
 include/cppuhelper/component_context.hxx|   12 ++--
 include/cppuhelper/cppuhelperdllapi.h   |2 +-
 include/cppuhelper/exc_hlp.hxx  |4 ++--
 include/cppuhelper/factory.hxx  |   18 +-
 include/cppuhelper/findsofficepath.h|2 +-
 include/cppuhelper/implbase.hxx |   20 ++--
 include/cppuhelper/implbase1.hxx|4 ++--
 include/cppuhelper/implbase10.hxx   |4 ++--
 include/cppuhelper/implbase11.hxx   |4 ++--
 include/cppuhelper/implbase12.hxx   |4 ++--
 include/cppuhelper/implbase13.hxx   |4 ++--
 include/cppuhelper/implbase2.hxx|4 ++--
 include/cppuhelper/implbase3.hxx|4 ++--
 include/cppuhelper/implbase4.hxx|4 ++--
 include/cppuhelper/implbase5.hxx|4 ++--
 include/cppuhelper/implbase6.hxx|4 ++--
 include/cppuhelper/implbase7.hxx|4 ++--
 include/cppuhelper/implbase8.hxx|4 ++--
 include/cppuhelper/implbase9.hxx|4 ++--
 include/cppuhelper/implbase_ex.hxx  |6 +++---
 include/cppuhelper/implementationentry.hxx  |4 ++--
 include/cppuhelper/interfacecontainer.h |   18 +-
 include/cppuhelper/interfacecontainer.hxx   |4 ++--
 include/cppuhelper/propertysetmixin.hxx |   26 +-
 include/cppuhelper/propshlp.hxx |   14 +++---
 include/cppuhelper/proptypehlp.h|2 +-
 include/cppuhelper/proptypehlp.hxx  |6 +++---
 include/cppuhelper/queryinterface.hxx   |8 
 include/cppuhelper/shlib.hxx|6 +++---
 include/cppuhelper/supportsservice.hxx  |4 ++--
 include/cppuhelper/typeprovider.hxx |8 
 include/cppuhelper/unourl.hxx   |4 ++--
 include/cppuhelper/weak.hxx |8 
 include/cppuhelper/weakagg.hxx  |8 
 include/cppuhelper/weakref.hxx  |8 
 include/osl/conditn.h   |6 +++---
 include/osl/conditn.hxx |6 +++---
 include/osl/detail/file.h   |2 +-
 include/osl/diagnose.h  |8 
 include/osl/diagnose.hxx|   16 
 include/osl/endian.h|2 +-
 include/osl/file.h  |8 
 include/osl/file.hxx|   14 +++---
 include/osl/getglobalmutex.hxx  |2 +-
 include/osl/interlck.h  |6 +++---
 include/osl/module.h|8 
 include/osl/module.hxx   

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

2017-04-28 Thread Stephan Bergmann
 include/com/sun/star/uno/Reference.hxx |   14 ++
 include/com/sun/star/uno/Type.hxx  |   13 +
 2 files changed, 27 insertions(+)

New commits:
commit 06c1dc4c09ba816affb8b65e8215bcd56a81df91
Author: Stephan Bergmann 
Date:   Fri Apr 28 14:09:57 2017 +0200

LIBO_INTERNAL_ONLY: printing of css::uno::Reference/Type

...as will be needed by some upcoming replacements of CPPUNIT_ASSERT with
CPPUNIT_ASSERT_EQUAL

Change-Id: Ie2b2b982b02f2bf48e2e8be7ba642198029c8698

diff --git a/include/com/sun/star/uno/Reference.hxx 
b/include/com/sun/star/uno/Reference.hxx
index c4708f1956b9..f197007cb8ff 100644
--- a/include/com/sun/star/uno/Reference.hxx
+++ b/include/com/sun/star/uno/Reference.hxx
@@ -22,6 +22,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -432,6 +433,19 @@ inline bool BaseReference::operator != ( const 
BaseReference & rRef ) const
 return (! operator == ( rRef._pInterface ));
 }
 
+#if defined LIBO_INTERNAL_ONLY
+/**
+   Support for BaseReference in std::ostream (and thus in CPPUNIT_ASSERT or
+   SAL_INFO macros, for example).
+
+   @since LibreOffice 5.4
+*/
+template std::basic_ostream &
+operator <<(
+std::basic_ostream & stream, BaseReference const & ref)
+{ return stream << ref.get(); }
+#endif
+
 }
 }
 }
diff --git a/include/com/sun/star/uno/Type.hxx 
b/include/com/sun/star/uno/Type.hxx
index 36800ce7be78..4a7b86e72c05 100644
--- a/include/com/sun/star/uno/Type.hxx
+++ b/include/com/sun/star/uno/Type.hxx
@@ -22,6 +22,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -92,6 +93,18 @@ inline Type & Type::operator = ( const Type & rType )
 template< class T >
 typelib_TypeDescriptionReference * Array< T >::s_pType = NULL;
 
+#if defined LIBO_INTERNAL_ONLY
+/**
+   Support for Type in std::ostream (and thus in CPPUNIT_ASSERT or SAL_INFO
+   macros, for example).
+
+   @since LibreOffice 5.4
+*/
+template std::basic_ostream &
+operator <<(std::basic_ostream & stream, Type const & type)
+{ return stream << type.getTypeName(); }
+#endif
+
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-01-25 Thread Noel Grandin
 include/com/sun/star/uno/Reference.h |9 +
 include/rtl/ref.hxx  |8 
 include/tools/ref.hxx|2 ++
 3 files changed, 19 insertions(+)

New commits:
commit 1480a2d05aff1eb6984882aacf39570b6b78a5d5
Author: Noel Grandin 
Date:   Wed Jan 25 10:42:28 2017 +0200

add 'explicit operator bool' to our reference classes

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

diff --git a/include/com/sun/star/uno/Reference.h 
b/include/com/sun/star/uno/Reference.h
index e657fd8..af2dc29 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -93,6 +93,15 @@ public:
 inline bool SAL_CALL is() const
 { return (NULL != _pInterface); }
 
+#if defined LIBO_INTERNAL_ONLY
+/** Checks if reference is null.
+
+@return true if reference acquires an interface, i.e. true if it is 
not null
+*/
+inline explicit operator bool() const
+{ return is(); }
+#endif
+
 /** Equality operator: compares two interfaces
 Checks if both references are null or refer to the same object.
 
diff --git a/include/rtl/ref.hxx b/include/rtl/ref.hxx
index b70088b..5eeb857 100644
--- a/include/rtl/ref.hxx
+++ b/include/rtl/ref.hxx
@@ -195,6 +195,14 @@ public:
 return (m_pBody != NULL);
 }
 
+#if defined LIBO_INTERNAL_ONLY
+/** Returns True if the handle does point to a valid body.
+ */
+inline explicit operator bool() const
+{
+return is();
+}
+#endif
 
 /** Returns True if this points to pBody.
  */
diff --git a/include/tools/ref.hxx b/include/tools/ref.hxx
index c251a78..97a5b36 100644
--- a/include/tools/ref.hxx
+++ b/include/tools/ref.hxx
@@ -90,6 +90,8 @@ public:
 
 bool Is() const { return pObj != nullptr; }
 
+explicit operator bool() const { return Is(); }
+
 T * get() const { return pObj; }
 
 T * operator ->() const { assert(pObj != nullptr); return pObj; }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-06-06 Thread Stephan Bergmann
 include/com/sun/star/uno/Any.h   |5 +
 include/com/sun/star/uno/Any.hxx |   33 +
 2 files changed, 38 insertions(+)

New commits:
commit 0fbe22a77289a624e1346ab457734c2f64f8e6fb
Author: Stephan Bergmann 
Date:   Mon Jun 6 15:05:16 2016 +0200

css::uno::Any move semantics (for LIBO_INTERNAL_ONLY)

Change-Id: Ib582a744321e0f209395651ac2edffe30152ffba

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index 26127f4..d6c7477 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -135,6 +135,11 @@ public:
 */
 inline Any & SAL_CALL operator = ( const Any & rAny );
 
+#if defined LIBO_INTERNAL_ONLY
+inline Any(Any && other);
+inline Any & operator =(Any && other);
+#endif
+
 /** Gets the type of the set value.
 
 @return a Type object of the set value
diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index 8859fa7..1e1f24e 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -21,6 +21,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -120,6 +121,38 @@ inline Any & Any::operator = ( const Any & rAny )
 return *this;
 }
 
+#if defined LIBO_INTERNAL_ONLY
+
+namespace detail {
+
+inline void moveAnyInternals(Any & from, Any & to) {
+uno_any_construct(, nullptr, nullptr, _acquire);
+std::swap(from.pType, to.pType);
+std::swap(from.pData, to.pData);
+std::swap(from.pReserved, to.pReserved);
+if (to.pData == ) {
+to.pData = 
+}
+// This leaves to.pData (where "to" is now VOID) dangling to somewhere (cf.
+// CONSTRUCT_EMPTY_ANY, cppu/source/uno/prim.hxx), but what's relevant is
+// only that it isn't a nullptr (as e.g. >>= -> uno_type_assignData ->
+// _assignData takes a null pSource to mean "construct a default value").
+}
+
+}
+
+Any::Any(Any && other) {
+detail::moveAnyInternals(other, *this);
+}
+
+Any & Any::operator =(Any && other) {
+uno_any_destruct(this, _release);
+detail::moveAnyInternals(other, *this);
+return *this;
+}
+
+#endif
+
 inline ::rtl::OUString Any::getValueTypeName() const
 {
 return ::rtl::OUString( pType->pTypeName );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-05-03 Thread Stephan Bergmann
 include/com/sun/star/uno/Any.h   |6 ++
 include/com/sun/star/uno/Any.hxx |2 ++
 2 files changed, 8 insertions(+)

New commits:
commit dcfc07842be6ef540845413f17739747359ef1f8
Author: Stephan Bergmann 
Date:   Tue May 3 22:07:58 2016 +0200

Enable Any functions on sal_uInt16 for LIBO_INTERNAL_ONLY

...where sal_uInt16 no longer clashes with sal_Unicode after
e16fa715c43dcdf836ce8c400b6d54eae87b627d "Handle wchar_t as native C++11 
type on
windows".  This allows to consistently use Any ctor instead of makeAny,
regardless of argument type, in LIBO_INTERNAL_ONLY code.

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

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index 8367eca..7ed67e2 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -267,17 +267,21 @@ public:
 inline bool SAL_CALL operator != ( const Any & rAny ) const;
 
 private:
+#if !defined LIBO_INTERNAL_ONLY
 /// @cond INTERNAL
 // Forbid use with ambiguous type (sal_Unicode, sal_uInt16):
 explicit Any(sal_uInt16) SAL_DELETED_FUNCTION;
 /// @endcond
+#endif
 };
 
+#if !defined LIBO_INTERNAL_ONLY
 /// @cond INTERNAL
 // Forbid use with ambiguous type (sal_Unicode, sal_uInt16):
 template<> sal_uInt16 Any::get() const SAL_DELETED_FUNCTION;
 template<> bool Any::has() const SAL_DELETED_FUNCTION;
 /// @endcond
+#endif
 
 /** Template function to generically construct an any from a C++ value.
 
@@ -293,7 +297,9 @@ template<> bool Any::has() const 
SAL_DELETED_FUNCTION;
 template< class C >
 inline Any SAL_CALL makeAny( const C & value );
 
+#if !defined LIBO_INTERNAL_ONLY
 template<> inline Any SAL_CALL makeAny(sal_uInt16 const & value);
+#endif
 
 template<> Any SAL_CALL makeAny(Any const &) SAL_DELETED_FUNCTION;
 
diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index d0a4506..8859fa7 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -191,8 +191,10 @@ inline Any SAL_CALL makeAny( const C & value )
 return Any(value);
 }
 
+#if !defined LIBO_INTERNAL_ONLY
 template<> Any makeAny(sal_uInt16 const & value)
 { return Any(, cppu::UnoType::get()); }
+#endif
 
 template Any toAny(T const & value) { return makeAny(value); }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-05-03 Thread Stephan Bergmann
 include/com/sun/star/uno/Any.h   |   12 +++-
 include/com/sun/star/uno/Any.hxx |   27 ---
 2 files changed, 15 insertions(+), 24 deletions(-)

New commits:
commit bc4d465484c67fa27d6c59807176d5f57155d9f5
Author: Stephan Bergmann 
Date:   Tue May 3 18:23:59 2016 +0200

Clean up makeAny functions

Let the templated makeAny(v) just call Any(v), so that any special handling 
of
argument types needs to be only done for the Any ctor, not also for makeAny
(both the original makeAny implementation and the Any ctor implementation
internally use cppu::getTypeFavourUnsigned to determine the UNO type, so 
this
does not cause any difference in behavior):

* The specialization of makeAny for bool can be dropped.

* The overload of makeAny for OUStringConcat is replaced with an overloaded 
Any
  ctor, so that

Any(s + "foo")

  works now, too.

Curiously, only the Any ctor had been deleted for a sal_uInt16 argument 
(which
can conflict with sal_Unicode), but not makeAny.  So introduce a 
specialization
of makeAny for sal_uInt16, so that that continues to work.  (For backwards
compatiblity in the non-LIBO_INTERNAL_ONLY case; and in the 
LIBO_INIERNAL_ONLY
case we're moving away from the sal_uInt16/sal_Unicode clash anyway thanks 
to
C++11 char16_t, so it is arguably better to allow makeAny for sal_uIn16 
than to
prohibit it.)

Change-Id: I7803703769730024863bb4e5b1b3416b81bd8960

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index 90107d5..8367eca 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -23,14 +23,13 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
-namespace rtl { class OUString; }
-
 namespace com
 {
 namespace sun
@@ -78,6 +77,11 @@ public:
 /// Ctor support for C++ bool.
 explicit inline Any( bool value );
 
+#if defined LIBO_INTERNAL_ONLY
+template
+explicit inline Any(rtl::OUStringConcat const & value);
+#endif
+
 /** Copy constructor: Sets value of the given any.
 
 @param rAny another any
@@ -289,9 +293,7 @@ template<> bool Any::has() const 
SAL_DELETED_FUNCTION;
 template< class C >
 inline Any SAL_CALL makeAny( const C & value );
 
-// additionally specialized for C++ bool
-template<>
-inline Any SAL_CALL makeAny( bool const & value );
+template<> inline Any SAL_CALL makeAny(sal_uInt16 const & value);
 
 template<> Any SAL_CALL makeAny(Any const &) SAL_DELETED_FUNCTION;
 
diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index cbd8fb6..d0a4506 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -73,6 +73,11 @@ inline Any::Any( bool value )
 cpp_acquire );
 }
 
+#if defined LIBO_INTERNAL_ONLY
+template
+Any::Any(rtl::OUStringConcat const & value): Any(rtl::OUString(value))
+{}
+#endif
 
 inline Any::Any( const Any & rAny )
 {
@@ -183,27 +188,11 @@ inline bool Any::operator != ( const Any & rAny ) const
 template< class C >
 inline Any SAL_CALL makeAny( const C & value )
 {
-return Any( , ::cppu::getTypeFavourUnsigned() );
+return Any(value);
 }
 
-// additionally specialized for C++ bool
-
-template<>
-inline Any SAL_CALL makeAny( bool const & value )
-{
-const sal_Bool b = value;
-return Any( , cppu::UnoType::get() );
-}
-
-
-#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
-template< class C1, class C2 >
-inline Any SAL_CALL makeAny( const rtl::OUStringConcat< C1, C2 >& value )
-{
-const rtl::OUString str( value );
-return Any( , ::cppu::getTypeFavourUnsigned() );
-}
-#endif
+template<> Any makeAny(sal_uInt16 const & value)
+{ return Any(, cppu::UnoType::get()); }
 
 template Any toAny(T const & value) { return makeAny(value); }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-04-27 Thread Stephan Bergmann
 include/com/sun/star/uno/Any.h |5 +
 include/sal/types.h|   16 +---
 2 files changed, 14 insertions(+), 7 deletions(-)

New commits:
commit e02a29c0a733e4c2a98ed9c7c290928314bb307d
Author: Stephan Bergmann 
Date:   Wed Apr 27 13:48:07 2016 +0200

Improve documentation

Change-Id: I13683f971bf56f6c5e226d749e60ccb25af559a5

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index 3122af3..ad26da1 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -249,6 +249,11 @@ template<> bool Any::has() const 
SAL_DELETED_FUNCTION;
 
 /** Template function to generically construct an any from a C++ value.
 
+This can be useful with an explicitly specified template parameter, when 
the
+(UNO) type recorded in the Any instance shall be different from what would
+be deduced from the (C++) type of the argument if no template parameter 
were
+specified explicitly.
+
 @tparam C value type
 @param value a value
 @return an any
diff --git a/include/sal/types.h b/include/sal/types.h
index 86c7c73..5614c99 100644
--- a/include/sal/types.h
+++ b/include/sal/types.h
@@ -502,13 +502,15 @@ template< typename T1, typename T2 > inline T1 
static_int_cast(T2 n) {
 #endif
 
 /**
-   This macro is used to tag interfaces that are deprecated for both
-   internal and external API users, but where we are still writing
-   out the internal usage. Ultimately these should be replaced by
-   SAL_DEPRECATED, and then removed.
-
-   Use as follows:
-SAL_DEPRECATED_INTERNAL("Don't use, it's evil.") void doit(int nPara);
+   This macro is used in cppumaker-generated include files, to tag entities 
that
+   are marked as @deprecated in UNOIDL.
+
+   It causes deprecation warnings to be generated in external code, but for now
+   is silenced in internal code.  It would need some substantial clean-up of
+   internal code to fix all warnings/errors generated by it.  (Once that is
+   done, it can become a synonym for SAL_DEPRECATED under LIBO_INTERNAL_ONLY,
+   too.  Completely removing the macro then would be incompatible, in case 
thare
+   are include files still around generated with a cppumaker that emitted it.)
  */
 #ifdef LIBO_INTERNAL_ONLY
 #define SAL_DEPRECATED_INTERNAL(message)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-12-02 Thread Noel Grandin
 include/com/sun/star/uno/Reference.h   |   16 
 include/com/sun/star/uno/Reference.hxx |   21 +
 2 files changed, 37 insertions(+)

New commits:
commit 73ed1178034fb391882d348f99699579cdff643a
Author: Noel Grandin 
Date:   Wed Dec 2 12:58:50 2015 +0200

add move assignment and constructor to uno::Reference

"perf stat" says:
Before  14,009,233,975,201  cycles
After   13,660,876,595,941  cycles
i.e. shaved roughly 2% of the cycles

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

diff --git a/include/com/sun/star/uno/Reference.h 
b/include/com/sun/star/uno/Reference.h
index ba08688..8e266cd 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -293,6 +293,14 @@ public:
 */
 inline Reference( const Reference< interface_type > & rRef );
 
+#if defined LIBO_INTERNAL_ONLY
+/** Move constructor
+
+@param rRef another reference
+*/
+inline Reference( Reference< interface_type > && rRef );
+#endif
+
 /** Up-casting conversion constructor: Copies interface reference.
 
 Does not work for up-casts to ambiguous bases.  For the special case of
@@ -540,7 +548,15 @@ public:
 @return this reference
 */
 inline Reference< interface_type > & SAL_CALL operator = ( const 
Reference< interface_type > & rRef );
+#if defined LIBO_INTERNAL_ONLY
+/** Assignment move operator: Acquires given interface reference and sets 
reference.
+An interface already set will be released.
 
+@param rRef an interface reference
+@return this reference
+*/
+inline Reference< interface_type > & SAL_CALL operator = ( Reference< 
interface_type > && rRef );
+#endif
 /** Queries given interface reference for type interface_type.
 
 @param rRef interface reference
diff --git a/include/com/sun/star/uno/Reference.hxx 
b/include/com/sun/star/uno/Reference.hxx
index 498d5be..b25083d 100644
--- a/include/com/sun/star/uno/Reference.hxx
+++ b/include/com/sun/star/uno/Reference.hxx
@@ -124,6 +124,15 @@ inline Reference< interface_type >::Reference( const 
Reference< interface_type >
 _pInterface->acquire();
 }
 
+#if defined LIBO_INTERNAL_ONLY
+template< class interface_type >
+inline Reference< interface_type >::Reference( Reference< interface_type > && 
rRef )
+{
+_pInterface = rRef._pInterface;
+rRef._pInterface = nullptr;
+}
+#endif
+
 template< class interface_type > template< class derived_type >
 inline Reference< interface_type >::Reference(
 const Reference< derived_type > & rRef,
@@ -341,6 +350,18 @@ inline Reference< interface_type > & Reference< 
interface_type >::operator = (
 return *this;
 }
 
+#if defined LIBO_INTERNAL_ONLY
+template< class interface_type >
+inline Reference< interface_type > & Reference< interface_type >::operator = (
+ Reference< interface_type > && rRef )
+{
+if (_pInterface)
+_pInterface->release();
+_pInterface = rRef._pInterface;
+rRef._pInterface = nullptr;
+return *this;
+}
+#endif
 
 template< class interface_type >
 inline Reference< interface_type > Reference< interface_type >::query(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-11-16 Thread Stephan Bergmann
 include/com/sun/star/uno/Sequence.h   |8 
 include/com/sun/star/uno/Sequence.hxx |   12 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 8b34be0852d8c8ae350d192980d825211e37f7ee
Author: Stephan Bergmann 
Date:   Mon Nov 16 16:43:06 2015 +0100

Use injected class name

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

diff --git a/include/com/sun/star/uno/Sequence.h 
b/include/com/sun/star/uno/Sequence.h
index 4241851..d22bc1e 100644
--- a/include/com/sun/star/uno/Sequence.h
+++ b/include/com/sun/star/uno/Sequence.h
@@ -90,7 +90,7 @@ public:
 
 @param rSeq another sequence of same type
 */
-inline Sequence( const Sequence< E > & rSeq );
+inline Sequence( const Sequence & rSeq );
 
 /** Constructor: Takes over ownership of given sequence.
 
@@ -134,7 +134,7 @@ public:
 @param rSeq another sequence of same type
 @return this sequence
 */
-inline Sequence< E > & SAL_CALL operator = ( const Sequence< E > & rSeq );
+inline Sequence & SAL_CALL operator = ( const Sequence & rSeq );
 
 /** Gets length of the sequence.
 
@@ -224,14 +224,14 @@ public:
 @param rSeq another sequence of same type (right side)
 @return true if both sequences are equal, false otherwise
 */
-inline bool SAL_CALL operator == ( const Sequence< E > & rSeq ) const;
+inline bool SAL_CALL operator == ( const Sequence & rSeq ) const;
 
 /** Unequality operator: Compares two sequences.
 
 @param rSeq another sequence of same type (right side)
 @return false if both sequences are equal, true otherwise
 */
-inline bool SAL_CALL operator != ( const Sequence< E > & rSeq ) const;
+inline bool SAL_CALL operator != ( const Sequence & rSeq ) const;
 
 /** Reallocates sequence to new length.
 If the new length is smaller than the former, then upper elements will
diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index 8b69039..ab2c6bf 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -56,7 +56,7 @@ inline Sequence< E >::Sequence()
 }
 
 template< class E >
-inline Sequence< E >::Sequence( const Sequence< E > & rSeq )
+inline Sequence< E >::Sequence( const Sequence & rSeq )
 {
 osl_atomic_increment( _pSequence->nRefCount );
 _pSequence = rSeq._pSequence;
@@ -116,7 +116,7 @@ inline Sequence< E >::~Sequence()
 }
 
 template< class E >
-inline Sequence< E > & Sequence< E >::operator = ( const Sequence< E > & rSeq )
+inline Sequence< E > & Sequence< E >::operator = ( const Sequence & rSeq )
 {
 const Type & rType = ::cppu::getTypeFavourUnsigned( this );
 ::uno_type_sequence_assign(
@@ -125,20 +125,20 @@ inline Sequence< E > & Sequence< E >::operator = ( const 
Sequence< E > & rSeq )
 }
 
 template< class E >
-inline bool Sequence< E >::operator == ( const Sequence< E > & rSeq ) const
+inline bool Sequence< E >::operator == ( const Sequence & rSeq ) const
 {
 if (_pSequence == rSeq._pSequence)
 return true;
 const Type & rType = ::cppu::getTypeFavourUnsigned( this );
 return ::uno_type_equalData(
-const_cast< Sequence< E > * >( this ), rType.getTypeLibType(),
-const_cast< Sequence< E > * >(  ), rType.getTypeLibType(),
+const_cast< Sequence * >( this ), rType.getTypeLibType(),
+const_cast< Sequence * >(  ), rType.getTypeLibType(),
 cpp_queryInterface,
 cpp_release );
 }
 
 template< class E >
-inline bool Sequence< E >::operator != ( const Sequence< E > & rSeq ) const
+inline bool Sequence< E >::operator != ( const Sequence & rSeq ) const
 {
 return (! operator == ( rSeq ));
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/com include/cppu include/cppuhelper include/osl include/rtl include/salhelper include/typelib include/uno

2015-11-10 Thread Stephan Bergmann
 include/com/sun/star/uno/Any.hxx  |1 +
 include/com/sun/star/uno/Reference.h  |1 +
 include/com/sun/star/uno/Reference.hxx|4 
 include/com/sun/star/uno/Sequence.hxx |1 +
 include/com/sun/star/uno/Type.hxx |4 
 include/com/sun/star/uno/genfunc.hxx  |4 
 include/cppu/unotype.hxx  |2 ++
 include/cppuhelper/factory.hxx|4 
 include/cppuhelper/interfacecontainer.h   |1 +
 include/cppuhelper/interfacecontainer.hxx |4 
 include/cppuhelper/typeprovider.hxx   |4 
 include/cppuhelper/weak.hxx   |1 +
 include/cppuhelper/weakref.hxx|4 
 include/osl/conditn.hxx   |4 
 include/osl/diagnose.hxx  |1 +
 include/osl/file.hxx  |1 +
 include/osl/module.hxx|4 
 include/osl/pipe.hxx  |4 
 include/osl/security.hxx  |4 
 include/osl/socket_decl.hxx   |4 
 include/osl/thread.hxx|1 +
 include/rtl/bootstrap.hxx |5 +
 include/rtl/byteseq.hxx   |1 +
 include/rtl/instance.hxx  |2 ++
 include/rtl/math.hxx  |1 +
 include/rtl/strbuf.hxx|1 +
 include/rtl/ustrbuf.hxx   |1 +
 include/rtl/ustring.hxx   |1 +
 include/salhelper/singletonref.hxx|4 
 include/typelib/typedescription.hxx   |4 
 include/uno/current_context.hxx   |4 
 include/uno/dispatcher.hxx|4 
 include/uno/environment.hxx   |4 
 include/uno/mapping.hxx   |4 
 34 files changed, 94 insertions(+)

New commits:
commit 08138396828aea9961f836c203d9d4a683c98882
Author: Stephan Bergmann 
Date:   Tue Nov 10 13:14:21 2015 +0100

Missing includes (for NULL)

Change-Id: Id2359f6ff4bddb2afbc0b346e17cd858f00179e3

diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index 9f0de98..79f0cdb 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -22,6 +22,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
diff --git a/include/com/sun/star/uno/Reference.h 
b/include/com/sun/star/uno/Reference.h
index 58009a3..ba08688 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -22,6 +22,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 
diff --git a/include/com/sun/star/uno/Reference.hxx 
b/include/com/sun/star/uno/Reference.hxx
index 7e8b4db..498d5be 100644
--- a/include/com/sun/star/uno/Reference.hxx
+++ b/include/com/sun/star/uno/Reference.hxx
@@ -19,6 +19,10 @@
 #ifndef INCLUDED_COM_SUN_STAR_UNO_REFERENCE_HXX
 #define INCLUDED_COM_SUN_STAR_UNO_REFERENCE_HXX
 
+#include 
+
+#include 
+
 #include 
 #include 
 #include 
diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index c522932..8b69039 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -22,6 +22,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/include/com/sun/star/uno/Type.hxx 
b/include/com/sun/star/uno/Type.hxx
index 0d88928..36800ce 100644
--- a/include/com/sun/star/uno/Type.hxx
+++ b/include/com/sun/star/uno/Type.hxx
@@ -19,6 +19,10 @@
 #ifndef INCLUDED_COM_SUN_STAR_UNO_TYPE_HXX
 #define INCLUDED_COM_SUN_STAR_UNO_TYPE_HXX
 
+#include 
+
+#include 
+
 #include 
 #include 
 
diff --git a/include/com/sun/star/uno/genfunc.hxx 
b/include/com/sun/star/uno/genfunc.hxx
index 9583375..d32f2a3 100644
--- a/include/com/sun/star/uno/genfunc.hxx
+++ b/include/com/sun/star/uno/genfunc.hxx
@@ -19,6 +19,10 @@
 #ifndef INCLUDED_COM_SUN_STAR_UNO_GENFUNC_HXX
 #define INCLUDED_COM_SUN_STAR_UNO_GENFUNC_HXX
 
+#include 
+
+#include 
+
 #include 
 #include 
 #include 
diff --git a/include/cppu/unotype.hxx b/include/cppu/unotype.hxx
index 5b4cb4c..2ab7681 100644
--- a/include/cppu/unotype.hxx
+++ b/include/cppu/unotype.hxx
@@ -22,6 +22,8 @@
 
 #include 
 
+#include 
+
 #if defined LIBO_INTERNAL_ONLY
 #include 
 #endif
diff --git a/include/cppuhelper/factory.hxx b/include/cppuhelper/factory.hxx
index 7f69b76..ee8ac00 100644
--- a/include/cppuhelper/factory.hxx
+++ b/include/cppuhelper/factory.hxx
@@ -19,6 +19,10 @@
 #ifndef INCLUDED_CPPUHELPER_FACTORY_HXX
 #define INCLUDED_CPPUHELPER_FACTORY_HXX
 
+#include 
+
+#include 
+
 #include 
 #include 
 
diff --git a/include/cppuhelper/interfacecontainer.h 
b/include/cppuhelper/interfacecontainer.h
index 245b718..5aa75dd 100644
--- a/include/cppuhelper/interfacecontainer.h
+++ b/include/cppuhelper/interfacecontainer.h
@@ -21,6 +21,7 @@
 
 #include 
 
+#include 
 #include 
 #include 
 #include 
diff --git a/include/cppuhelper/interfacecontainer.hxx 

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

2015-08-01 Thread David Ostrovsky
 include/com/sun/star/uno/Any.h |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 7c7124a51e467b6ab4df4d0a38000aa657c35029
Author: David Ostrovsky da...@ostrovsky.org
Date:   Fri Jul 31 07:41:07 2015 +0200

Any.h: Fix declaration hides class member warning

This fixes warning C4458 issued by MSVC 14.0 (aka VS2015) compiler.

Change-Id: I48ed50bb54232d70460495d6d6a9e100fb90b869
Reviewed-on: https://gerrit.libreoffice.org/17444
Reviewed-by: David Ostrovsky da...@ostrovsky.org
Tested-by: David Ostrovsky da...@ostrovsky.org

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index b700a54..3122af3 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -97,9 +97,9 @@ public:
 /** Constructor: Sets a copy of the given data.
 
 @param pData_ value
-@param pType type of value
+@param pType_ type of value
 */
-inline Any( const void * pData_, typelib_TypeDescriptionReference * pType 
);
+inline Any( const void * pData_, typelib_TypeDescriptionReference * pType_ 
);
 
 /** Destructor: Destructs any content and frees memory.
 */
@@ -186,9 +186,9 @@ public:
 and its memory freed.
 
 @param pData_ pointer to value
-@param pType type of value
+@param pType_ type of value
 */
-inline void SAL_CALL setValue( const void * pData_, 
typelib_TypeDescriptionReference * pType );
+inline void SAL_CALL setValue( const void * pData_, 
typelib_TypeDescriptionReference * pType_ );
 /** Sets a value. If the any already contains a value, that value will be 
destructed
 and its memory freed.
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-07-06 Thread Stephan Bergmann
 include/com/sun/star/uno/Reference.h |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 8468436bf65b05ab77c3414e6cd5d532c6aea1d6
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Jul 6 15:24:44 2015 +0200

Workaround seems no longer necessary for MSVC 2013

...but C2514 is still there

Change-Id: I818fed066b0ddaf5c30e6057285151d8a575c373

diff --git a/include/com/sun/star/uno/Reference.h 
b/include/com/sun/star/uno/Reference.h
index 91db7f5..a4bdf7c 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -181,7 +181,7 @@ private:
 
 struct S { char c[2]; };
 
-#if defined _MSC_VER
+#if defined _MSC_VER  _MSC_VER  1800
 static char f(T2 *, long);
 static S f(T1 * const , int);
 #else
@@ -190,8 +190,8 @@ private:
 #endif
 
 struct H {
-H(); // avoid C2514 class has no constructors from MSVC 2008
-#if defined _MSC_VER
+H(); // avoid C2514 class has no constructors from MSVC
+#if defined _MSC_VER  _MSC_VER  1800
 operator T1 * const  () const;
 #else
 operator T1 * () const;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-01-05 Thread Stephan Bergmann
 include/com/sun/star/uno/Any.hxx   |9 -
 include/com/sun/star/uno/Reference.hxx |   13 +++--
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 682f94317f65b9b9694468b41ef5ae29392c5828
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Jan 5 17:46:09 2015 +0100

These extern C functions are in the global namespace

Change-Id: I75bdb9ac71a3d36eeaf0b846e25d22a0aa923895

diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index 9e9e7dc..4528935 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -35,6 +35,10 @@
 #include cppu/cppudllapi.h
 #include cppu/unotype.hxx
 
+extern C CPPU_DLLPUBLIC rtl_uString * SAL_CALL 
cppu_Any_extraction_failure_msg(
+uno_Any const * pAny, typelib_TypeDescriptionReference * pType )
+SAL_THROW_EXTERN_C();
+
 namespace com
 {
 namespace sun
@@ -577,11 +581,6 @@ inline bool SAL_CALL operator != ( const Any  rAny, const 
C  value )
 return (! operator == ( rAny, value ));
 }
 
-extern C CPPU_DLLPUBLIC rtl_uString * SAL_CALL 
cppu_Any_extraction_failure_msg(
-uno_Any const * pAny, typelib_TypeDescriptionReference * pType )
-SAL_THROW_EXTERN_C();
-
-
 template typename T
 T Any::get() const
 {
diff --git a/include/com/sun/star/uno/Reference.hxx 
b/include/com/sun/star/uno/Reference.hxx
index 456c35f..1ba4e48 100644
--- a/include/com/sun/star/uno/Reference.hxx
+++ b/include/com/sun/star/uno/Reference.hxx
@@ -25,6 +25,13 @@
 #include com/sun/star/uno/Any.hxx
 #include cppu/cppudllapi.h
 
+extern C CPPU_DLLPUBLIC rtl_uString * SAL_CALL cppu_unsatisfied_iquery_msg(
+typelib_TypeDescriptionReference * pType )
+SAL_THROW_EXTERN_C();
+extern C CPPU_DLLPUBLIC rtl_uString * SAL_CALL cppu_unsatisfied_iset_msg(
+typelib_TypeDescriptionReference * pType )
+SAL_THROW_EXTERN_C();
+
 namespace com
 {
 namespace sun
@@ -57,12 +64,6 @@ inline XInterface * Reference interface_type ::iquery(
 {
 return BaseReference::iquery(pInterface, interface_type::static_type());
 }
-extern C CPPU_DLLPUBLIC rtl_uString * SAL_CALL cppu_unsatisfied_iquery_msg(
-typelib_TypeDescriptionReference * pType )
-SAL_THROW_EXTERN_C();
-extern C CPPU_DLLPUBLIC rtl_uString * SAL_CALL cppu_unsatisfied_iset_msg(
-typelib_TypeDescriptionReference * pType )
-SAL_THROW_EXTERN_C();
 
 inline XInterface * BaseReference::iquery_throw(
 XInterface * pInterface, const Type  rType )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-09-24 Thread Caolán McNamara
 include/com/sun/star/uno/Any.hxx |8 
 1 file changed, 8 deletions(-)

New commits:
commit c09a0d8516b7a53e8e9dd802ba63c17ba6ee20d3
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Sep 23 20:53:31 2014 +0100

fix build with coverity 7.0.2 and gcc 4.8.3

these forbid use with ambiguous type things already appear with deleted
markup in Any.h which is included by Any.hxx

WARNING: cov-emit returned with code 2

coverity/include/com/sun/star/uno/Any.hxx, line 163: error #1810:
  function
  com::sun::star::uno::Any::hasT() const [with T=sal_uInt16]
  (declared at line 244 of
  coverity/include/com/sun/star/uno/Any.h)
  cannot be specialized because it is deleted
  bool Any::hassal_uInt16() const;
^

coverity/include/com/sun/star/uno/Any.hxx, line 604: error #1810:
  function
  com::sun::star::uno::Any::getT() const [with T=sal_uInt16]
  (declared at line 243 of
  coverity/include/com/sun/star/uno/Any.h)
  cannot be specialized because it is deleted
  sal_uInt16 Any::getsal_uInt16() const;

Change-Id: I7d8b8ee1015c3e598143a2240297ce81a9e36987
Reviewed-on: https://gerrit.libreoffice.org/11611
Reviewed-by: Stephan Bergmann sberg...@redhat.com
Tested-by: Stephan Bergmann sberg...@redhat.com

diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index edb0da4..8d5b7dd 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -158,11 +158,6 @@ inline bool Any::has() const
 (uno_ReleaseFunc) cpp_release );
 }
 
-// not impl: forbid use with ambiguous type (sal_Unicode, sal_uInt16)
-template 
-bool Any::hassal_uInt16() const;
-
-
 inline bool Any::operator == ( const Any  rAny ) const
 {
 return ::uno_type_equalData(
@@ -599,9 +594,6 @@ T Any::get() const
 }
 return value;
 }
-// not impl: forbid use with ambiguous type (sal_Unicode, sal_uInt16)
-template 
-sal_uInt16 Any::getsal_uInt16() const;
 
 /**
Support for Any in std::ostream (and thus in CPPUNIT_ASSERT or SAL_INFO
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-06-16 Thread Stephan Bergmann
 include/com/sun/star/uno/Reference.h |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7242fe6e3360843f9ef5ce07b447de729323a3c8
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Jun 16 10:22:31 2014 +0200

SAL_WARN_UNUSED_RESULT for static Reference::query function

...which the recent loplugin:staticcall changes showed was occasionally used
apparently under the assumption that it was non-static and changed the 
object
it was called on.

Change-Id: I989a2a4ed3886d7f370855c9e8c1867e646c059b

diff --git a/include/com/sun/star/uno/Reference.h 
b/include/com/sun/star/uno/Reference.h
index 3b72193..ec45f44 100644
--- a/include/com/sun/star/uno/Reference.h
+++ b/include/com/sun/star/uno/Reference.h
@@ -540,13 +540,13 @@ public:
 @param rRef interface reference
 @return interface reference of demanded type (may be null)
 */
-inline static Reference interface_type  SAL_CALL query( const 
BaseReference  rRef );
+inline static SAL_WARN_UNUSED_RESULT Reference interface_type  SAL_CALL 
query( const BaseReference  rRef );
 /** Queries given interface for type interface_type.
 
 @param pInterface interface pointer
 @return interface reference of demanded type (may be null)
 */
-inline static Reference interface_type  SAL_CALL query( XInterface * 
pInterface );
+inline static SAL_WARN_UNUSED_RESULT Reference interface_type  SAL_CALL 
query( XInterface * pInterface );
 };
 
 /// @cond INTERNAL
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-24 Thread Michael Stahl
 include/com/sun/star/uno/Sequence.hxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit c1158fbc1c8abb0842fb8eb307724ef42ac6e8e2
Author: Michael Stahl mst...@redhat.com
Date:   Thu Apr 24 12:57:26 2014 +0200

Sequence::operator[]: silence -Werror=strict-overflow warnings

GCC 4.8.2 warns when index is a subtraction expression; the real
problems in that case will be found by the index = 0 check.

Change-Id: I4c3f0bdb7996e433b1693eb7dcbafb9610b5dbcf

diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index 748fdcb..88fba66 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -156,7 +156,8 @@ templateclass E E const * SequenceE::end() const
 template class E 
 inline E  Sequence E ::operator [] ( sal_Int32 nIndex )
 {
-assert( nIndex = 0  nIndex  getLength() );
+// silence spurious -Werror=strict-overflow warnings from GCC 4.8.2
+assert(nIndex = 0  static_castsal_uInt32(nIndex)  getLength());
 return getArray()[ nIndex ];
 }
 
@@ -164,7 +165,8 @@ template class E 
 inline const E  Sequence E ::operator [] ( sal_Int32 nIndex ) const
 SAL_THROW(())
 {
-assert( nIndex = 0  nIndex  getLength() );
+// silence spurious -Werror=strict-overflow warnings from GCC 4.8.2
+assert(nIndex = 0  static_castsal_uInt32(nIndex)  getLength());
 return reinterpret_cast const E * ( _pSequence-elements )[ nIndex ];
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-04-24 Thread Michael Stahl
 include/com/sun/star/uno/Sequence.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 44d9e4960e7a373350e44fb88be7a3a8c2a81cfd
Author: Michael Stahl mst...@redhat.com
Date:   Thu Apr 24 13:10:56 2014 +0200

Sequence::operator[]: let's cast the other side to unsigned too

Change-Id: I30845477e5dfbf5c90702bb0b6acb7955fcbe684

diff --git a/include/com/sun/star/uno/Sequence.hxx 
b/include/com/sun/star/uno/Sequence.hxx
index 88fba66..347953c 100644
--- a/include/com/sun/star/uno/Sequence.hxx
+++ b/include/com/sun/star/uno/Sequence.hxx
@@ -157,7 +157,7 @@ template class E 
 inline E  Sequence E ::operator [] ( sal_Int32 nIndex )
 {
 // silence spurious -Werror=strict-overflow warnings from GCC 4.8.2
-assert(nIndex = 0  static_castsal_uInt32(nIndex)  getLength());
+assert(nIndex = 0  static_castsal_uInt32(nIndex)  
static_castsal_uInt32(getLength()));
 return getArray()[ nIndex ];
 }
 
@@ -166,7 +166,7 @@ inline const E  Sequence E ::operator [] ( sal_Int32 
nIndex ) const
 SAL_THROW(())
 {
 // silence spurious -Werror=strict-overflow warnings from GCC 4.8.2
-assert(nIndex = 0  static_castsal_uInt32(nIndex)  getLength());
+assert(nIndex = 0  static_castsal_uInt32(nIndex)  
static_castsal_uInt32(getLength()));
 return reinterpret_cast const E * ( _pSequence-elements )[ nIndex ];
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2014-02-18 Thread Stephan Bergmann
 include/com/sun/star/uno/Any.h   |   18 ++
 include/com/sun/star/uno/Any.hxx |   18 ++
 2 files changed, 36 insertions(+)

New commits:
commit 2224ef39728f0ee654d82c51a900aa1837e6663d
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Feb 18 17:07:45 2014 +0100

Any: consistently use explicit specialization instead of overloading

Should be transparent to client code.

Change-Id: I5632fba87242ff9cb9a6b3481a179fa3e92c618b

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index d9afd93..ca22957 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -270,6 +270,7 @@ template class C 
 inline void SAL_CALL operator = ( Any  rAny, const C  value ) 
SAL_THROW(());
 
 // additionally for C++ bool:
+template
 inline void SAL_CALL operator = ( Any  rAny, bool const  value )
 SAL_THROW(());
 
@@ -312,7 +313,9 @@ inline bool SAL_CALL operator != ( const Any  rAny, const 
C  value ) SAL_THROW
 
 // additional specialized = and == operators
 // bool
+template
 inline bool SAL_CALL operator = ( const Any  rAny, sal_Bool  value ) 
SAL_THROW(());
+template
 inline bool SAL_CALL operator == ( const Any  rAny, const sal_Bool  value ) 
SAL_THROW(());
 template
 inline bool SAL_CALL operator = ( Any const  rAny, bool  value )
@@ -321,29 +324,44 @@ template
 inline bool SAL_CALL operator == ( Any const  rAny, bool const  value )
 SAL_THROW(());
 // byte
+template
 inline bool SAL_CALL operator = ( const Any  rAny, sal_Int8  value ) 
SAL_THROW(());
 // short
+template
 inline bool SAL_CALL operator = ( const Any  rAny, sal_Int16  value ) 
SAL_THROW(());
+template
 inline bool SAL_CALL operator = ( const Any  rAny, sal_uInt16  value ) 
SAL_THROW(());
 // long
+template
 inline bool SAL_CALL operator = ( const Any  rAny, sal_Int32  value ) 
SAL_THROW(());
+template
 inline bool SAL_CALL operator = ( const Any  rAny, sal_uInt32  value ) 
SAL_THROW(());
 // hyper
+template
 inline bool SAL_CALL operator = ( const Any  rAny, sal_Int64  value ) 
SAL_THROW(());
+template
 inline bool SAL_CALL operator = ( const Any  rAny, sal_uInt64  value ) 
SAL_THROW(());
 // float
+template
 inline bool SAL_CALL operator = ( const Any  rAny, float  value ) 
SAL_THROW(());
 // double
+template
 inline bool SAL_CALL operator = ( const Any  rAny, double  value ) 
SAL_THROW(());
 // string
+template
 inline bool SAL_CALL operator = ( const Any  rAny, ::rtl::OUString  value 
) SAL_THROW(());
+template
 inline bool SAL_CALL operator == ( const Any  rAny, const ::rtl::OUString  
value ) SAL_THROW(());
 // type
+template
 inline bool SAL_CALL operator = ( const Any  rAny, Type  value ) 
SAL_THROW(());
+template
 inline bool SAL_CALL operator == ( const Any  rAny, const Type  value ) 
SAL_THROW(());
 // any
+template
 inline bool SAL_CALL operator = ( const Any  rAny, Any  value ) 
SAL_THROW(());
 // interface
+template
 inline bool SAL_CALL operator == ( const Any  rAny, const BaseReference  
value ) SAL_THROW(());
 
 }
diff --git a/include/com/sun/star/uno/Any.hxx b/include/com/sun/star/uno/Any.hxx
index d04527a..8046c0d 100644
--- a/include/com/sun/star/uno/Any.hxx
+++ b/include/com/sun/star/uno/Any.hxx
@@ -214,6 +214,7 @@ inline void SAL_CALL operator = ( Any  rAny, const C  
value ) SAL_THROW(())
 
 // additionally for C++ bool:
 
//__
+template
 inline void SAL_CALL operator = ( Any  rAny, bool const  value )
 SAL_THROW(())
 {
@@ -250,6 +251,7 @@ inline bool SAL_CALL operator = ( const Any  rAny, C  
value ) SAL_THROW(())
 
 // bool
 
//__
+template
 inline bool SAL_CALL operator = ( const ::com::sun::star::uno::Any  rAny, 
sal_Bool  value ) SAL_THROW(())
 {
 if (typelib_TypeClass_BOOLEAN == rAny.pType-eTypeClass)
@@ -260,6 +262,7 @@ inline bool SAL_CALL operator = ( const 
::com::sun::star::uno::Any  rAny, sal
 return false;
 }
 
//__
+template
 inline bool SAL_CALL operator == ( const Any  rAny, const sal_Bool  value ) 
SAL_THROW(())
 {
 return (typelib_TypeClass_BOOLEAN == rAny.pType-eTypeClass 
@@ -293,6 +296,7 @@ inline bool SAL_CALL operator == ( Any const  rAny, bool 
const  value )
 
 // byte
 
//__
+template
 inline bool SAL_CALL operator = ( const ::com::sun::star::uno::Any  rAny, 
sal_Int8  value ) SAL_THROW(())
 {
 if (typelib_TypeClass_BYTE == rAny.pType-eTypeClass)
@@ -304,6 +308,7 @@ inline bool SAL_CALL operator = ( const 
::com::sun::star::uno::Any  rAny, sal
 }
 // short
 
//__
+template
 inline bool SAL_CALL operator = ( const Any  rAny, 

[Libreoffice-commits] core.git: include/com include/osl include/rtl odk/pack offapi/com

2013-05-29 Thread Stephan Bergmann
 include/com/sun/star/uno/Any.h |7 +++
 include/osl/socket_decl.hxx|3 ++-
 include/rtl/strbuf.hxx |2 ++
 include/rtl/string.hxx |   10 +++---
 include/rtl/ustring.hxx|4 +++-
 odk/pack/gendocu/Doxyfile  |4 ++--
 offapi/com/sun/star/awt/DialogProvider.idl |2 +-
 7 files changed, 20 insertions(+), 12 deletions(-)

New commits:
commit 8c3657658a70523005c0dbb19a691aa025da039a
Author: Stephan Bergmann sberg...@redhat.com
Date:   Wed May 29 15:01:18 2013 +0200

Tweak comments

(Preventing documentation of macros via @cond ... @endcond is apparently at
least broken in Doxygen 1.8.3 and working in Doxygen 1.8.4.)

Change-Id: I2ee582119dba2c3d27db5298786d3076921af46d

diff --git a/include/com/sun/star/uno/Any.h b/include/com/sun/star/uno/Any.h
index f1d03e8..b4ead89 100644
--- a/include/com/sun/star/uno/Any.h
+++ b/include/com/sun/star/uno/Any.h
@@ -163,12 +163,11 @@ public:
 sal_Int32 myVal = myAny.getsal_Int32();
 /pre
 Widening conversion without data loss is taken into account.
-Throws a
-type scope=com::sun::star::unoRuntimeException/type
-if the specified type cannot be provided.
+Throws a com::sun::star::uno::RuntimeException if the specified type
+cannot be provided.
 
 @return value of specified type
-@exception type scope=com::sun::star::unoRuntimeException/type
+@exception com::sun::star::uno::RuntimeException
in case the specified type cannot be provided
 */
 template typename T
diff --git a/include/osl/socket_decl.hxx b/include/osl/socket_decl.hxx
index f51cca1..2bcbd6c 100644
--- a/include/osl/socket_decl.hxx
+++ b/include/osl/socket_decl.hxx
@@ -48,9 +48,10 @@ namespace osl
 
 /** The SocketAddr takes over the responsibility of the handle ( which 
means,
 that the handle gets destructed by the destructor of this 
reference)
+@param Addr a handle
 @param nocopy use SAL_NO_COPY
  */
-inline SocketAddr(const oslSocketAddr , __osl_socket_NoCopy nocopy );
+inline SocketAddr(const oslSocketAddr Addr, __osl_socket_NoCopy nocopy 
);
 
 /** Copyconstructs the oslSocketAddr handle.
  */
diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx
index 9ebd495..d04f828 100644
--- a/include/rtl/strbuf.hxx
+++ b/include/rtl/strbuf.hxx
@@ -47,6 +47,7 @@
 namespace rtl
 {
 
+/// @cond INTERNAL
 #ifdef RTL_STRING_UNITTEST
 #undef rtl
 // helper macro to make functions appear more readable
@@ -54,6 +55,7 @@ namespace rtl
 #else
 #define RTL_STRING_CONST_FUNCTION
 #endif
+/// @endcond
 
 /** A string buffer implements a mutable sequence of characters.
 p
diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx
index 6cb69c647..9432b74 100644
--- a/include/rtl/string.hxx
+++ b/include/rtl/string.hxx
@@ -53,6 +53,7 @@
 namespace rtl
 {
 
+/// @cond INTERNAL
 #ifdef RTL_STRING_UNITTEST
 #undef rtl
 // helper macro to make functions appear more readable
@@ -60,6 +61,7 @@ namespace rtl
 #else
 #define RTL_STRING_CONST_FUNCTION
 #endif
+/// @endcond
 
 /* === */
 
@@ -1638,8 +1640,10 @@ inline std::basic_ostreamcharT, traits  operator (
 return stream  OString( concat );
 }
 #else
-// non-RTL_FAST_CODE needs this to compile
+// non-RTL_FAST_STRING needs this to compile
+/// @cond INTERNAL
 typedef OString OStringLiteral;
+/// @endcond
 #endif
 
 
@@ -1663,14 +1667,14 @@ struct OStringHash
 { return (size_t)rString.hashCode(); }
 };
 
-/** Equality functor for classic c-strings (i.e. null-terminated char* 
strings) */
+/** Equality functor for classic c-strings (i.e., null-terminated char* 
strings). */
 struct CStringEqual
 {
 bool operator()( const char* p1, const char* p2) const
 { return rtl_str_compare(p1, p2) == 0; }
 };
 
-/** Hashing functor for classic c-strings (i.e. null-terminated char* strings) 
*/
+/** Hashing functor for classic c-strings (i.e., null-terminated char* 
strings). */
 struct CStringHash
 {
 size_t operator()(const char* p) const
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index f776da3..112486d 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -2287,8 +2287,10 @@ inline std::basic_ostreamcharT, traits  operator (
 return stream  OUString( concat );
 }
 #else
-// non-RTL_FAST_CODE needs this to compile
+// non-RTL_FAST_STRING needs this to compile
+/// @cond INTERNAL
 typedef OUString OUStringLiteral;
+/// @endcond
 #endif
 
 /** A helper to use OUStrings with hash maps.
diff --git a/odk/pack/gendocu/Doxyfile b/odk/pack/gendocu/Doxyfile
index 75460486..26c8893 100644
--- a/odk/pack/gendocu/Doxyfile
+++ b/odk/pack/gendocu/Doxyfile
@@ -34,6 +34,6 @@ MACRO_EXPANSION = YES
 EXPAND_ONLY_PREDEF = YES