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

2023-12-03 Thread Caolán McNamara (via logerrit)
 connectivity/source/parse/sqlnode.cxx |8 
 include/connectivity/sqlnode.hxx  |4 ++--
 svx/source/fmcomp/gridcell.cxx|2 +-
 svx/source/form/filtnav.cxx   |2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit abd967ed31dbb1916003a1417bf337ed0fd3a5da
Author: Caolán McNamara 
AuthorDate: Fri Dec 1 11:55:54 2023 +
Commit: Caolán McNamara 
CommitDate: Sun Dec 3 20:20:05 2023 +0100

cid#1546453 COPY_INSTEAD_OF_MOVE

a sample commit

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

diff --git a/connectivity/source/parse/sqlnode.cxx 
b/connectivity/source/parse/sqlnode.cxx
index ad91f618d9fc..45030592cf65 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -252,13 +252,13 @@ void OSQLParseNode::parseNodeToPredicateStr(OUString& 
rString,
   const Reference< XConnection >& 
_rxConnection,
   const Reference< 
XNumberFormatter > & xFormatter,
   const css::lang::Locale& rIntl,
-  OUString _sDec,
+  const OUString& rDec,
   const IParseContext* pContext ) 
const
 {
 OSL_ENSURE(xFormatter.is(), "OSQLParseNode::parseNodeToPredicateStr:: no 
formatter!");
 
 if (xFormatter.is())
-parseNodeToStr(rString, _rxConnection, xFormatter, nullptr, 
OUString(), rIntl, pContext, true, true, _sDec, true);
+parseNodeToStr(rString, _rxConnection, xFormatter, nullptr, 
OUString(), rIntl, pContext, true, true, rDec, true);
 }
 
 
@@ -268,13 +268,13 @@ void OSQLParseNode::parseNodeToPredicateStr(OUString& 
rString,
   const Reference< XPropertySet > 
& _xField,
   const OUString 
&_sPredicateTableAlias,
   const css::lang::Locale& rIntl,
-  OUString _sDec,
+  const OUString& rDec,
   const IParseContext* pContext ) 
const
 {
 OSL_ENSURE(xFormatter.is(), "OSQLParseNode::parseNodeToPredicateStr:: no 
formatter!");
 
 if (xFormatter.is())
-parseNodeToStr( rString, _rxConnection, xFormatter, _xField, 
_sPredicateTableAlias, rIntl, pContext, true, true, _sDec, true );
+parseNodeToStr( rString, _rxConnection, xFormatter, _xField, 
_sPredicateTableAlias, rIntl, pContext, true, true, rDec, true );
 }
 
 
diff --git a/include/connectivity/sqlnode.hxx b/include/connectivity/sqlnode.hxx
index 630e6e1afc65..6724090392a4 100644
--- a/include/connectivity/sqlnode.hxx
+++ b/include/connectivity/sqlnode.hxx
@@ -316,7 +316,7 @@ namespace connectivity
  const css::uno::Reference< 
css::sdbc::XConnection >& _rxConnection,
  const css::uno::Reference< 
css::util::XNumberFormatter > & xFormatter,
  const css::lang::Locale& rIntl,
- OUString _sDec,
+ const OUString& rDec,
  const IParseContext* pContext = nullptr ) 
const;
 
 void parseNodeToPredicateStr(OUString& rString,
@@ -325,7 +325,7 @@ namespace connectivity
  const css::uno::Reference< 
css::beans::XPropertySet > & _xField,
  const OUString &_sTableAlias,
  const css::lang::Locale& rIntl,
- OUString strDec,
+ const OUString& rStrDec,
  const IParseContext* pContext = nullptr ) 
const;
 
 OSQLParseNode* getByRule(OSQLParseNode::Rule eRule) const;
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 4a44887fcf72..e8c56fb0ac38 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -2964,7 +2964,7 @@ bool DbFilterField::commitControl()
 m_rColumn.GetField(),
 OUString(),
 aAppLocale,
-OUString("."),
+".",
 getParseContext());
 m_aText = aPreparedText;
 }
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 

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

2023-06-15 Thread Noel Grandin (via logerrit)
 connectivity/source/parse/sqlbison.y  |2 +-
 connectivity/source/parse/sqlnode.cxx |   15 +++
 include/connectivity/sqlparse.hxx |3 ++-
 3 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit e469a171833c2d88c4e129f339415c15a3a14b1e
Author: Noel Grandin 
AuthorDate: Thu Jun 15 15:34:40 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Jun 15 18:39:31 2023 +0200

wrap OSQLParser::s_xLocaleData in vcl::DeleteOnDeinit

since my adaption of i18npool to use OUStringLiteral, this
data structure might get torn down after the i18npool data is
has pointers to.

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

diff --git a/connectivity/source/parse/sqlbison.y 
b/connectivity/source/parse/sqlbison.y
index cbad86149fc2..0c5d359d083e 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -4493,7 +4493,7 @@ sal_Int32 OSQLParser::s_nRefCount = 0;
 // ::osl::MutexOSQLParser::s_aMutex;
 OSQLScanner*   OSQLParser::s_pScanner = nullptr;
 OSQLParseNodesGarbageCollector*OSQLParser::s_pGarbageCollector 
= nullptr;
-css::uno::Reference< css::i18n::XLocaleData4>  OSQLParser::s_xLocaleData = 
nullptr;
+vcl::DeleteOnDeinit> 
OSQLParser::s_xLocaleData(vcl::DeleteOnDeinitFlag::Empty);
 
 void setParser(OSQLParser* _pParser)
 {
diff --git a/connectivity/source/parse/sqlnode.cxx 
b/connectivity/source/parse/sqlnode.cxx
index 4f213bf4f902..1153a216cffd 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -803,7 +803,7 @@ void OSQLParser::killThousandSeparator(OSQLParseNode* 
pLiteral)
 {
 if ( pLiteral )
 {
-if ( s_xLocaleData->getLocaleItem( m_pData->aLocale 
).decimalSeparator.toChar() == ',' )
+if ( s_xLocaleData.get()->get()->getLocaleItem( m_pData->aLocale 
).decimalSeparator.toChar() == ',' )
 {
 pLiteral->m_aNodeValue = pLiteral->m_aNodeValue.replace('.', 
sal_Unicode());
 // and replace decimal
@@ -1118,7 +1118,7 @@ OUString OSQLParser::stringToDouble(const OUString& 
_rValue,sal_Int16 _nScale)
 OUString aValue;
 if(!m_xCharClass.is())
 m_xCharClass  = CharacterClassification::create( m_xContext );
-if( s_xLocaleData.is() )
+if( s_xLocaleData.get() )
 {
 try
 {
@@ -1129,7 +1129,8 @@ OUString OSQLParser::stringToDouble(const OUString& 
_rValue,sal_Int16 _nScale)
 sal_Int32 nPos = aValue.lastIndexOf('.');
 if((nPos+_nScale) < aValue.getLength())
 aValue = 
aValue.replaceAt(nPos+_nScale,aValue.getLength()-nPos-_nScale, u"");
-aValue = 
aValue.replaceAt(aValue.lastIndexOf('.'),1,s_xLocaleData->getLocaleItem(m_pData->aLocale).decimalSeparator);
+OUString sDecimalSeparator = 
s_xLocaleData.get()->get()->getLocaleItem(m_pData->aLocale).decimalSeparator;
+aValue = aValue.replaceAt(aValue.lastIndexOf('.'), 1, 
sDecimalSeparator);
 return aValue;
 }
 }
@@ -1247,7 +1248,7 @@ std::unique_ptr 
OSQLParser::predicateTree(OUString& rErrorMessage
 s_pScanner->SetRule(OSQLScanner::GetSTRINGRule());
 break;
 default:
-if ( s_xLocaleData->getLocaleItem( m_pData->aLocale 
).decimalSeparator.toChar() == ',' )
+if ( s_xLocaleData.get()->get()->getLocaleItem( 
m_pData->aLocale ).decimalSeparator.toChar() == ',' )
 s_pScanner->SetRule(OSQLScanner::GetGERRule());
 else
 s_pScanner->SetRule(OSQLScanner::GetENGRule());
@@ -1330,8 +1331,8 @@ OSQLParser::OSQLParser(css::uno::Reference< 
css::uno::XComponentContext > xConte
 s_pScanner->setScanner();
 s_pGarbageCollector = new OSQLParseNodesGarbageCollector();
 
-if(!s_xLocaleData.is())
-s_xLocaleData = LocaleData::create(m_xContext);
+if(!s_xLocaleData.get())
+s_xLocaleData.set(LocaleData::create(m_xContext));
 
 // reset to UNKNOWN_RULE
 static_assert(OSQLParseNode::UNKNOWN_RULE==0, "UNKNOWN_RULE must be 0 
for memset to 0 to work");
@@ -1482,8 +1483,6 @@ OSQLParser::~OSQLParser()
 
 delete s_pGarbageCollector;
 s_pGarbageCollector = nullptr;
-// Is only set the first time, so we should delete it only when there 
are no more instances
-s_xLocaleData = nullptr;
 
 RuleIDMap().swap(s_aReverseRuleIDLookup);
 }
diff --git a/include/connectivity/sqlparse.hxx 
b/include/connectivity/sqlparse.hxx
index c3314c470c6b..15400c112240 100644
--- a/include/connectivity/sqlparse.hxx
+++ b/include/connectivity/sqlparse.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ 

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

2022-09-17 Thread Caolán McNamara (via logerrit)
 connectivity/source/drivers/ado/APreparedStatement.cxx |2 
 connectivity/source/parse/sqlbison.y   |3 -
 connectivity/source/parse/sqlnode.cxx  |   46 +++--
 include/connectivity/sqlnode.hxx   |2 
 4 files changed, 22 insertions(+), 31 deletions(-)

New commits:
commit 4616938e017a94a1859ba206fd9e4e1e9106
Author: Caolán McNamara 
AuthorDate: Fri Sep 16 16:24:31 2022 +0100
Commit: Caolán McNamara 
CommitDate: Sat Sep 17 10:52:40 2022 +0200

cid#1500499 Resource leak

the only change should be to the two trailing cases in
OSQLParseNode::substituteParameterNames which do seem to leak.  The
closest I got to triggering the actual code is toggling into sqlview
mode of a query but couldn't quite construct a sql statement to trigger
it.

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

diff --git a/connectivity/source/drivers/ado/APreparedStatement.cxx 
b/connectivity/source/drivers/ado/APreparedStatement.cxx
index cf2339fdc951..9e17d71b0bed 100644
--- a/connectivity/source/drivers/ado/APreparedStatement.cxx
+++ b/connectivity/source/drivers/ado/APreparedStatement.cxx
@@ -442,7 +442,7 @@ void 
OPreparedStatement::replaceParameterNodeName(OSQLParseNode const * _pNode,
 if(SQL_ISRULE(pChildNode,parameter) && pChildNode->count() == 1)
 {
 OSQLParseNode* pNewNode = new OSQLParseNode(OUString(":") 
,SQLNodeType::Punctuation,0);
-delete pChildNode->replace(pChildNode->getChild(0),pNewNode);
+pChildNode->replaceAndDelete(pChildNode->getChild(0), pNewNode);
 OUString sParameterName = _sDefaultName + 
OUString::number(++_rParameterCount);
 pChildNode->append(new OSQLParseNode( 
sParameterName,SQLNodeType::Name,0));
 }
diff --git a/connectivity/source/parse/sqlbison.y 
b/connectivity/source/parse/sqlbison.y
index 59d8b2532430..6db0da9a4180 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -4749,8 +4749,7 @@ sal_Int16 OSQLParser::buildStringNodes(OSQLParseNode*& 
pLiteral)
OSQLParseNode* pParent = pLiteral->getParent();
 
OSQLParseNode* pNewNode = new 
OSQLInternalNode(pLiteral->getTokenValue(), SQLNodeType::String);
-   pParent->replace(pLiteral, pNewNode);
-   delete pLiteral;
+   pParent->replaceAndDelete(pLiteral, pNewNode);
pLiteral = nullptr;
return 1;
}
diff --git a/connectivity/source/parse/sqlnode.cxx 
b/connectivity/source/parse/sqlnode.cxx
index f9bee9da69b6..44e0c2bba2a9 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -92,8 +92,7 @@ namespace
 
 void replaceAndReset(connectivity::OSQLParseNode*& 
_pResetNode,connectivity::OSQLParseNode* _pNewNode)
 {
-_pResetNode->getParent()->replace(_pResetNode, _pNewNode);
-delete _pResetNode;
+_pResetNode->getParent()->replaceAndDelete(_pResetNode, _pNewNode);
 _pResetNode = _pNewNode;
 }
 
@@ -1500,7 +1499,7 @@ void 
OSQLParseNode::substituteParameterNames(OSQLParseNode const * _pNode)
 if(SQL_ISRULE(pChildNode,parameter) && pChildNode->count() > 1)
 {
 OSQLParseNode* pNewNode = new OSQLParseNode("?" 
,SQLNodeType::Punctuation,0);
-delete pChildNode->replace(pChildNode->getChild(0),pNewNode);
+pChildNode->replaceAndDelete(pChildNode->getChild(0), pNewNode);
 sal_Int32 nChildCount = pChildNode->count();
 for(sal_Int32 j=1;j < nChildCount;++j)
 delete pChildNode->removeAt(1);
@@ -1865,9 +1864,9 @@ void OSQLParseNode::disjunctiveNormalForm(OSQLParseNode*& 
pSearchCondition)
 disjunctiveNormalForm(pSearchCondition);
 }
 else if(SQL_ISRULE(pLeft,boolean_primary) && 
(!SQL_ISRULE(pLeft->getChild(1),search_condition) || 
!SQL_ISRULE(pLeft->getChild(1),boolean_term)))
-pSearchCondition->replace(pLeft, pLeft->removeAt(1));
+pSearchCondition->replaceAndDelete(pLeft, pLeft->removeAt(1));
 else if(SQL_ISRULE(pRight,boolean_primary) && 
(!SQL_ISRULE(pRight->getChild(1),search_condition) || 
!SQL_ISRULE(pRight->getChild(1),boolean_term)))
-pSearchCondition->replace(pRight, pRight->removeAt(1));
+pSearchCondition->replaceAndDelete(pRight, pRight->removeAt(1));
 }
 }
 
@@ -1954,8 +1953,7 @@ void OSQLParseNode::negateSearchCondition(OSQLParseNode*& 
pSearchCondition, bool
 assert(SQL_ISTOKEN(pNot,NOT));
 pNotNot = new 
OSQLParseNode(OUString(),SQLNodeType::Rule,OSQLParser::RuleID(OSQLParseNode::sql_not));
 }
-pComparison->replace(pNot, pNotNot);
-delete pNot;
+

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

2021-11-27 Thread Noel Grandin (via logerrit)
 connectivity/source/drivers/ado/ATables.cxx|4 ++--
 connectivity/source/drivers/hsqldb/HTables.cxx |4 ++--
 connectivity/source/drivers/mysql_jdbc/YTables.cxx |4 ++--
 connectivity/source/sdbcx/VCollection.cxx  |8 
 include/connectivity/sdbcx/VCollection.hxx |6 +++---
 5 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit fdae440a4d877f93bee430a03dd55841ccbe7876
Author: Noel Grandin 
AuthorDate: Mon Nov 22 21:17:01 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Nov 27 15:26:22 2021 +0100

use more OInterfaceContainerHelper3 in connectivity::sdbcx::OCollection

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

diff --git a/connectivity/source/drivers/ado/ATables.cxx 
b/connectivity/source/drivers/ado/ATables.cxx
index b8f6fb9d2c72..61a057344ff1 100644
--- a/connectivity/source/drivers/ado/ATables.cxx
+++ b/connectivity/source/drivers/ado/ATables.cxx
@@ -94,9 +94,9 @@ void OTables::appendNew(const OUString& _rsNewTable)
 
 // notify our container listeners
 ContainerEvent aEvent(static_cast(this), 
makeAny(_rsNewTable), Any(), Any());
-OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
+OInterfaceIteratorHelper3 aListenerLoop(m_aContainerListeners);
 while (aListenerLoop.hasMoreElements())
-
static_cast(aListenerLoop.next())->elementInserted(aEvent);
+aListenerLoop.next()->elementInserted(aEvent);
 }
 
 
diff --git a/connectivity/source/drivers/hsqldb/HTables.cxx 
b/connectivity/source/drivers/hsqldb/HTables.cxx
index e92629bbb0f2..de818686b49d 100644
--- a/connectivity/source/drivers/hsqldb/HTables.cxx
+++ b/connectivity/source/drivers/hsqldb/HTables.cxx
@@ -161,9 +161,9 @@ void OTables::appendNew(const OUString& _rsNewTable)
 
 // notify our container listeners
 ContainerEvent aEvent(static_cast(this), 
makeAny(_rsNewTable), Any(), Any());
-OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
+OInterfaceIteratorHelper3 aListenerLoop(m_aContainerListeners);
 while (aListenerLoop.hasMoreElements())
-
static_cast(aListenerLoop.next())->elementInserted(aEvent);
+aListenerLoop.next()->elementInserted(aEvent);
 }
 
 OUString OTables::getNameForObject(const sdbcx::ObjectType& _xObject)
diff --git a/connectivity/source/drivers/mysql_jdbc/YTables.cxx 
b/connectivity/source/drivers/mysql_jdbc/YTables.cxx
index 9d598892d32b..f1ab3ee1e7b3 100644
--- a/connectivity/source/drivers/mysql_jdbc/YTables.cxx
+++ b/connectivity/source/drivers/mysql_jdbc/YTables.cxx
@@ -179,9 +179,9 @@ void OTables::appendNew(const OUString& _rsNewTable)
 
 // notify our container listeners
 ContainerEvent aEvent(static_cast(this), 
makeAny(_rsNewTable), Any(), Any());
-OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
+OInterfaceIteratorHelper3 aListenerLoop(m_aContainerListeners);
 while (aListenerLoop.hasMoreElements())
-
static_cast(aListenerLoop.next())->elementInserted(aEvent);
+aListenerLoop.next()->elementInserted(aEvent);
 }
 
 OUString OTables::getNameForObject(const sdbcx::ObjectType& _xObject)
diff --git a/connectivity/source/sdbcx/VCollection.cxx 
b/connectivity/source/sdbcx/VCollection.cxx
index 0aa6c0d3c627..8ab9072f004c 100644
--- a/connectivity/source/sdbcx/VCollection.cxx
+++ b/connectivity/source/sdbcx/VCollection.cxx
@@ -425,9 +425,9 @@ void OCollection::notifyElementRemoved(const OUString& 
_sName)
 {
 ContainerEvent aEvent(static_cast(this), makeAny(_sName), 
Any(), Any());
 // note that xExistent may be empty, in case somebody removed the data 
source while it is not alive at this moment
-OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
+OInterfaceIteratorHelper3 aListenerLoop(m_aContainerListeners);
 while (aListenerLoop.hasMoreElements())
-
static_cast(aListenerLoop.next())->elementRemoved(aEvent);
+aListenerLoop.next()->elementRemoved(aEvent);
 }
 
 sal_Int32 SAL_CALL OCollection::findColumn( const OUString& columnName )
@@ -519,9 +519,9 @@ void OCollection::renameObject(const OUString& _sOldName, 
const OUString& _sNewN
 {
 ContainerEvent aEvent(static_cast(this), 
makeAny(_sNewName), 
makeAny(m_pElements->getObject(_sNewName)),makeAny(_sOldName));
 // note that xExistent may be empty, in case somebody removed the data 
source while it is not alive at this moment
-OInterfaceIteratorHelper2 aListenerLoop(m_aContainerListeners);
+OInterfaceIteratorHelper3 aListenerLoop(m_aContainerListeners);
 while (aListenerLoop.hasMoreElements())
-
static_cast(aListenerLoop.next())->elementReplaced(aEvent);
+aListenerLoop.next()->elementReplaced(aEvent);
 }
 }
 
diff --git a/include/connectivity/sdbcx/VCollection.hxx 

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

2021-11-26 Thread Noel Grandin (via logerrit)
 connectivity/source/commontools/parameters.cxx |4 ++--
 include/connectivity/parameters.hxx|4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 203ba801eee12f9d6bffb2ae49ad82ba7bf191c1
Author: Noel Grandin 
AuthorDate: Mon Nov 22 21:03:58 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Nov 27 08:10:17 2021 +0100

use more OInterfaceContainerHelper3 in dbtools::ParameterManager

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

diff --git a/connectivity/source/commontools/parameters.cxx 
b/connectivity/source/commontools/parameters.cxx
index 380c4658ae43..117282fbd7f3 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -707,14 +707,14 @@ namespace dbtools
 // TODO: shouldn't we subtract all the parameters which were 
already visited?
 if ( nParamsLeft )
 {
-::comphelper::OInterfaceIteratorHelper2 aIter( 
m_aParameterListeners );
+::comphelper::OInterfaceIteratorHelper3 aIter( 
m_aParameterListeners );
 Reference< XPropertySet > xProp = m_xComponent;
 OSL_ENSURE(xProp.is(),"Some already released my component!");
 DatabaseParameterEvent aEvent( xProp, m_pOuterParameters );
 
 _rClearForNotifies.clear();
 while ( aIter.hasMoreElements() && !bCanceled )
-bCanceled = !static_cast< XDatabaseParameterListener* >( 
aIter.next() )->approveParameter( aEvent );
+bCanceled = !aIter.next()->approveParameter( aEvent );
 _rClearForNotifies.reset();
 }
 
diff --git a/include/connectivity/parameters.hxx 
b/include/connectivity/parameters.hxx
index 50026521ab69..f2196af12bac 100644
--- a/include/connectivity/parameters.hxx
+++ b/include/connectivity/parameters.hxx
@@ -27,7 +27,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 namespace com::sun::star::beans { class XPropertySet; }
 namespace com::sun::star::container { class XIndexAccess; }
@@ -98,7 +98,7 @@ namespace dbtools
 
 private:
 ::osl::Mutex&   m_rMutex;
-::comphelper::OInterfaceContainerHelper2  m_aParameterListeners;
+
::comphelper::OInterfaceContainerHelper3 
m_aParameterListeners;
 
 css::uno::Reference< css::uno::XComponentContext >
 m_xContext;


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

2021-09-27 Thread Caolán McNamara (via logerrit)
 connectivity/source/parse/sqliterator.cxx |   11 ++-
 include/connectivity/sqliterator.hxx  |3 +++
 2 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 138c6e793882fcf8477e7e75f7f31d5327022aa5
Author: Caolán McNamara 
AuthorDate: Sun Sep 26 21:09:23 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Sep 27 15:42:33 2021 +0200

split getUniqueColumnName

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

diff --git a/connectivity/source/parse/sqliterator.cxx 
b/connectivity/source/parse/sqliterator.cxx
index f20bef933395..ef7873a6c302 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -1716,15 +1716,24 @@ void OSQLParseTreeIterator::setSelectColumnName(const 
OUString & rColumnName,con
 }
 }
 
-OUString OSQLParseTreeIterator::getUniqueColumnName(const OUString& 
rColumnName) const
+std::vector OSQLParseTreeIterator::getSelectColumnNames() const
 {
 ::comphelper::UStringMixLess aCompare(isCaseSensitive());
+
 std::vector aColumnNames;
 OUString sPropertyName = 
OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME);
 for (const auto& col : *m_aSelectColumns)
 
aColumnNames.push_back(getString(col->getPropertyValue(sPropertyName)));
 std::sort(aColumnNames.begin(), aColumnNames.end(), aCompare);
 
+return aColumnNames;
+}
+
+OUString OSQLParseTreeIterator::getUniqueColumnName(const OUString& 
rColumnName) const
+{
+std::vector aColumnNames(getSelectColumnNames());
+
+::comphelper::UStringMixLess aCompare(isCaseSensitive());
 if (!std::binary_search(aColumnNames.begin(), aColumnNames.end(), 
rColumnName, aCompare))
 return rColumnName;
 
diff --git a/include/connectivity/sqliterator.hxx 
b/include/connectivity/sqliterator.hxx
index 9693192a7a04..6c529c69b37f 100644
--- a/include/connectivity/sqliterator.hxx
+++ b/include/connectivity/sqliterator.hxx
@@ -105,6 +105,9 @@ namespace connectivity
 const OSQLParseNode*getTableNode( OSQLTables& _rTables, const 
OSQLParseNode* pTableRef, OUString& aTableRange );
 voidgetQualified_join( OSQLTables& _rTables, const 
OSQLParseNode *pTableRef, OUString& aTableRange );
 voidgetSelect_statement(OSQLTables& _rTables,const 
OSQLParseNode* pSelect);
+// get all the column names of m_aSelectColumns and return in a vector 
sorted by a UStringMixLess that's constructed from
+// isCaseSensitive()
+std::vector getSelectColumnNames() const;
 OUString getUniqueColumnName(const OUString & rColumnName)
const;
 
 /** finds the column with a given name, belonging to a given table, in 
a given tables collection


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

2021-09-27 Thread Caolán McNamara (via logerrit)
 connectivity/source/parse/sqliterator.cxx |8 
 include/connectivity/sqliterator.hxx  |2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit fefc215592ab3e11afb957e59016f1b9d6a00593
Author: Caolán McNamara 
AuthorDate: Sun Sep 26 21:03:11 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Sep 27 14:41:50 2021 +0200

appendColumns is always called with m_aSelectColumns as 1st arg

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

diff --git a/connectivity/source/parse/sqliterator.cxx 
b/connectivity/source/parse/sqliterator.cxx
index 752caa841473..f20bef933395 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -1523,7 +1523,7 @@ OSQLTable OSQLParseTreeIterator::impl_createTableObject( 
const OUString& rTableN
 return aReturnTable;
 }
 
-void OSQLParseTreeIterator::appendColumns(::rtl::Reference const 
& _rColumns,const OUString& _rTableAlias,const OSQLTable& _rTable)
+void OSQLParseTreeIterator::appendColumns(const OUString& _rTableAlias, const 
OSQLTable& _rTable)
 {
 if (!_rTable.is())
 return;
@@ -1560,7 +1560,7 @@ void 
OSQLParseTreeIterator::appendColumns(::rtl::Reference const &
 
 pColumn->setTableName(_rTableAlias);
 pColumn->setRealName(*pBegin);
-_rColumns->push_back(pColumn);
+m_aSelectColumns->push_back(pColumn);
 }
 else
 impl_appendError( IParseContext::ErrorCode::InvalidColumn, pBegin, 
&_rTableAlias );
@@ -1572,14 +1572,14 @@ void OSQLParseTreeIterator::setSelectColumnName(const 
OUString & rColumnName,con
 if(rColumnName.toChar() == '*' && rTableRange.isEmpty())
 {   // SELECT * ...
 for (auto const& table : *m_pImpl->m_pTables)
-appendColumns(m_aSelectColumns, table.first, table.second);
+appendColumns(table.first, table.second);
 }
 else if( rColumnName.toChar() == '*' && !rTableRange.isEmpty() )
 {   // SELECT .*
 OSQLTables::const_iterator aFind = 
m_pImpl->m_pTables->find(rTableRange);
 
 if(aFind != m_pImpl->m_pTables->end())
-appendColumns(m_aSelectColumns, rTableRange, aFind->second);
+appendColumns(rTableRange, aFind->second);
 }
 else if ( rTableRange.isEmpty() )
 {   // SELECT  ...
diff --git a/include/connectivity/sqliterator.hxx 
b/include/connectivity/sqliterator.hxx
index 9cb6ce4e9976..9693192a7a04 100644
--- a/include/connectivity/sqliterator.hxx
+++ b/include/connectivity/sqliterator.hxx
@@ -142,7 +142,7 @@ namespace connectivity
 std::u16string_view rColumnName );
 
 void setSelectColumnName(const OUString& rColumnName, const OUString& 
rColumnAlias, const OUString& rTableRange, bool bFkt = false, sal_Int32 _nType 
= css::sdbc::DataType::VARCHAR, bool bAggFkt = false);
-void appendColumns(::rtl::Reference const & 
_rColumns,const OUString& _rTableAlias,const OSQLTable& _rTable);
+void appendColumns(const OUString& _rTableAlias, const OSQLTable& 
_rTable);
 // Other member variables that should be available in the "set" 
functions
 // can be defined in the derived class. They can be initialized
 // in its constructor and, after the "traverse" routines have been 
used,


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

2021-09-27 Thread Caolán McNamara (via logerrit)
 connectivity/source/parse/sqliterator.cxx |   24 +++-
 include/connectivity/sqliterator.hxx  |2 +-
 2 files changed, 12 insertions(+), 14 deletions(-)

New commits:
commit b63c5ade3554a42def4bce94f9fd67ea66528214
Author: Caolán McNamara 
AuthorDate: Sun Sep 26 20:57:29 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon Sep 27 13:01:49 2021 +0200

setSelectColumnName is always called with m_aSelectColumns as 1st arg

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

diff --git a/connectivity/source/parse/sqliterator.cxx 
b/connectivity/source/parse/sqliterator.cxx
index 95c0cd875a93..752caa841473 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -852,7 +852,7 @@ bool OSQLParseTreeIterator::traverseSelectColumnNames(const 
OSQLParseNode* pSele
 if (pSelectNode->getChild(2)->isRule() && 
SQL_ISPUNCTUATION(pSelectNode->getChild(2)->getChild(0),"*"))
 {
 // SELECT * ...
-setSelectColumnName(m_aSelectColumns, "*", "", "");
+setSelectColumnName("*", "", "");
 }
 else if (SQL_ISRULE(pSelectNode->getChild(2),scalar_exp_commalist))
 {
@@ -872,7 +872,7 @@ bool OSQLParseTreeIterator::traverseSelectColumnNames(const 
OSQLParseNode* pSele
 // All the table's columns
 OUString aTableRange;
 pColumnRef->getChild(0)->parseNodeToStr( aTableRange, 
m_pImpl->m_xConnection, nullptr, false, false );
-setSelectColumnName(m_aSelectColumns, "*", "", aTableRange);
+setSelectColumnName("*", "", aTableRange);
 continue;
 }
 else if (SQL_ISRULE(pColumnRef,derived_column))
@@ -924,7 +924,7 @@ bool OSQLParseTreeIterator::traverseSelectColumnNames(const 
OSQLParseNode* pSele
 */
 if(aColumnAlias.isEmpty())
 aColumnAlias = sColumnName;
-
setSelectColumnName(m_aSelectColumns,sColumnName,aColumnAlias,aTableRange,bFkt,nType,SQL_ISRULE(pColumnRef,general_set_fct)
 || SQL_ISRULE(pColumnRef,set_fct_spec));
+
setSelectColumnName(sColumnName,aColumnAlias,aTableRange,bFkt,nType,SQL_ISRULE(pColumnRef,general_set_fct)
 || SQL_ISRULE(pColumnRef,set_fct_spec));
 }
 }
 }
@@ -1567,21 +1567,19 @@ void 
OSQLParseTreeIterator::appendColumns(::rtl::Reference const &
 }
 }
 
-void OSQLParseTreeIterator::setSelectColumnName(::rtl::Reference 
const & _rColumns,const OUString & rColumnName,const OUString & rColumnAlias, 
const OUString & rTableRange, bool bFkt, sal_Int32 _nType, bool bAggFkt)
+void OSQLParseTreeIterator::setSelectColumnName(const OUString & 
rColumnName,const OUString & rColumnAlias, const OUString & rTableRange, bool 
bFkt, sal_Int32 _nType, bool bAggFkt)
 {
 if(rColumnName.toChar() == '*' && rTableRange.isEmpty())
 {   // SELECT * ...
-OSL_ENSURE(_rColumns == m_aSelectColumns,"Invalid columns used here!");
 for (auto const& table : *m_pImpl->m_pTables)
-appendColumns(_rColumns,table.first,table.second);
+appendColumns(m_aSelectColumns, table.first, table.second);
 }
 else if( rColumnName.toChar() == '*' && !rTableRange.isEmpty() )
 {   // SELECT .*
-OSL_ENSURE(_rColumns == m_aSelectColumns,"Invalid columns used here!");
 OSQLTables::const_iterator aFind = 
m_pImpl->m_pTables->find(rTableRange);
 
 if(aFind != m_pImpl->m_pTables->end())
-appendColumns(_rColumns,rTableRange,aFind->second);
+appendColumns(m_aSelectColumns, rTableRange, aFind->second);
 }
 else if ( rTableRange.isEmpty() )
 {   // SELECT  ...
@@ -1642,7 +1640,7 @@ void 
OSQLParseTreeIterator::setSelectColumnName(::rtl::Reference co
 pColumn->setRealName( rColumnName );
 }
 
-_rColumns->push_back( xNewColumn );
+m_aSelectColumns->push_back( xNewColumn );
 }
 else
 {
@@ -1655,7 +1653,7 @@ void 
OSQLParseTreeIterator::setSelectColumnName(::rtl::Reference co
 pColumn->setAggregateFunction(bAggFkt);
 pColumn->setRealName(rColumnName);
 
-_rColumns->push_back(pColumn);
+m_aSelectColumns->push_back(pColumn);
 }
 }
 else// ColumnName and TableName exist
@@ -1679,7 +1677,7 @@ void 
OSQLParseTreeIterator::setSelectColumnName(::rtl::Reference co
 assert(false);
 pColumn->setTableName(aFind->first);
 
-_rColumns->push_back(pColumn);
+m_aSelectColumns->push_back(pColumn);
 }
 else
 {
@@ -1693,7 +1691,7 @@ void 
OSQLParseTreeIterator::setSelectColumnName(::rtl::Reference co
 pColumn->setRealName(rColumnName);
  

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

2021-09-24 Thread Caolán McNamara (via logerrit)
 connectivity/source/commontools/dbexception.cxx |   71 +++-
 include/connectivity/dbexception.hxx|6 ++
 2 files changed, 40 insertions(+), 37 deletions(-)

New commits:
commit fa89349b360945d726db0c5f85cd4ccb0822417f
Author: Caolán McNamara 
AuthorDate: Fri Sep 24 10:41:27 2021 +0100
Commit: Caolán McNamara 
CommitDate: Fri Sep 24 13:43:57 2021 +0200

make SQLExceptionInfo utilities available for external use

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

diff --git a/connectivity/source/commontools/dbexception.cxx 
b/connectivity/source/commontools/dbexception.cxx
index 17f54b8bcaad..e6663f7d188b 100644
--- a/connectivity/source/commontools/dbexception.cxx
+++ b/connectivity/source/commontools/dbexception.cxx
@@ -187,49 +187,46 @@ void SQLExceptionInfo::prepend( const OUString& 
_rErrorMessage )
 m_eType = TYPE::SQLException;
 }
 
-namespace
+// create the to-be-appended exception
+Any SQLExceptionInfo::createException(TYPE eType, const OUString& 
rErrorMessage, const OUString& rSQLState, const sal_Int32 nErrorCode)
 {
-// create the to-be-appended exception
-Any createException(SQLExceptionInfo::TYPE eType, const OUString& 
rErrorMessage, const OUString& rSQLState, const sal_Int32 nErrorCode)
+Any aAppend;
+switch (eType)
 {
-Any aAppend;
-switch (eType)
-{
-case SQLExceptionInfo::TYPE::SQLException:
-aAppend <<= SQLException();
-break;
-case SQLExceptionInfo::TYPE::SQLWarning:
-aAppend <<= SQLWarning();
-break;
-case SQLExceptionInfo::TYPE::SQLContext:
-aAppend <<= SQLContext();
-break;
-default:
-TOOLS_WARN_EXCEPTION("connectivity.commontools", 
"SQLExceptionInfo::createException: invalid exception type: this will crash!");
-break;
-}
-
-SQLException& pAppendException = const_cast(*o3tl::forceAccess(aAppend));
-pAppendException.Message = rErrorMessage;
-pAppendException.SQLState = rSQLState;
-pAppendException.ErrorCode = nErrorCode;
-
-return aAppend;
+case TYPE::SQLException:
+aAppend <<= SQLException();
+break;
+case TYPE::SQLWarning:
+aAppend <<= SQLWarning();
+break;
+case TYPE::SQLContext:
+aAppend <<= SQLContext();
+break;
+default:
+TOOLS_WARN_EXCEPTION("connectivity.commontools", 
"SQLExceptionInfo::createException: invalid exception type: this will crash!");
+break;
 }
 
-// find the end of the exception chain
-SQLException* getLastException(SQLException* pLastException)
+SQLException& pAppendException = const_cast(*o3tl::forceAccess(aAppend));
+pAppendException.Message = rErrorMessage;
+pAppendException.SQLState = rSQLState;
+pAppendException.ErrorCode = nErrorCode;
+
+return aAppend;
+}
+
+// find the end of the exception chain
+SQLException* SQLExceptionInfo::getLastException(SQLException* pLastException)
+{
+SQLException* pException = pLastException;
+while (pException)
 {
-SQLException* pException = pLastException;
-while (pException)
-{
-pException = 
const_cast(o3tl::tryAccess(pException->NextException));
-if (!pException)
-break;
-pLastException = pException;
-}
-return pLastException;
+pException = 
const_cast(o3tl::tryAccess(pException->NextException));
+if (!pException)
+break;
+pLastException = pException;
 }
+return pLastException;
 }
 
 void SQLExceptionInfo::append( TYPE _eType, const OUString& _rErrorMessage, 
const OUString& _rSQLState, const sal_Int32 _nErrorCode )
diff --git a/include/connectivity/dbexception.hxx 
b/include/connectivity/dbexception.hxx
index 4edd174e5635..8c9dfad33efe 100644
--- a/include/connectivity/dbexception.hxx
+++ b/include/connectivity/dbexception.hxx
@@ -131,6 +131,12 @@ public:
 m_eType = TYPE::Undefined;
 }
 
+// create an exception
+static css::uno::Any createException(TYPE eType, const OUString& 
rErrorMessage, const OUString& rSQLState, const sal_Int32 nErrorCode);
+
+// find the end of the exception chain
+static css::sdbc::SQLException* getLastException(css::sdbc::SQLException* 
pLastException);
+
 private:
 void implDetermineType();
 };


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

2021-02-22 Thread Noel (via logerrit)
 connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx |   38 
 connectivity/source/commontools/TColumnsHelper.cxx |2 
 connectivity/source/commontools/TDatabaseMetaDataBase.cxx  |5 -
 connectivity/source/commontools/TIndexColumns.cxx  |   21 ++--
 connectivity/source/commontools/TIndexes.cxx   |3 
 connectivity/source/commontools/TKeyColumns.cxx|   25 ++---
 connectivity/source/commontools/TKeys.cxx  |6 -
 connectivity/source/commontools/dbtools.cxx|9 --
 connectivity/source/commontools/dbtools2.cxx   |3 
 connectivity/source/commontools/parameters.cxx |9 --
 connectivity/source/commontools/predicateinput.cxx |2 
 connectivity/source/cpool/ZPoolCollection.cxx  |6 -
 connectivity/source/drivers/calc/CConnection.cxx   |6 -
 connectivity/source/drivers/calc/CDatabaseMetaData.cxx |7 -
 connectivity/source/drivers/calc/CDriver.cxx   |5 -
 connectivity/source/drivers/calc/CTable.cxx|5 -
 connectivity/source/drivers/calc/CTables.cxx   |5 -
 connectivity/source/drivers/component/CDatabaseMetaData.cxx|   10 --
 connectivity/source/drivers/dbase/DConnection.cxx  |7 -
 connectivity/source/drivers/dbase/DDatabaseMetaData.cxx|   15 +--
 connectivity/source/drivers/dbase/DDriver.cxx  |5 -
 connectivity/source/drivers/dbase/DIndexes.cxx |2 
 connectivity/source/drivers/dbase/DTable.cxx   |4 
 connectivity/source/drivers/dbase/DTables.cxx  |5 -
 connectivity/source/drivers/file/FColumns.cxx  |3 
 connectivity/source/drivers/file/FConnection.cxx   |3 
 connectivity/source/drivers/file/FDatabaseMetaData.cxx |   19 +---
 connectivity/source/drivers/file/FDriver.cxx   |5 -
 connectivity/source/drivers/firebird/DatabaseMetaData.cxx  |   45 
--
 connectivity/source/drivers/firebird/Driver.cxx|5 -
 connectivity/source/drivers/flat/EConnection.cxx   |   16 +--
 connectivity/source/drivers/flat/EDatabaseMetaData.cxx |   10 --
 connectivity/source/drivers/flat/EDriver.cxx   |5 -
 connectivity/source/drivers/flat/ETable.cxx|5 -
 connectivity/source/drivers/flat/ETables.cxx   |5 -
 connectivity/source/drivers/hsqldb/HDriver.cxx |2 
 connectivity/source/drivers/hsqldb/HTable.cxx  |9 --
 connectivity/source/drivers/hsqldb/HTables.cxx |3 
 connectivity/source/drivers/hsqldb/HUsers.cxx  |3 
 connectivity/source/drivers/hsqldb/HViews.cxx  |3 
 connectivity/source/drivers/jdbc/DatabaseMetaData.cxx  |2 
 connectivity/source/drivers/jdbc/JConnection.cxx   |6 -
 connectivity/source/drivers/jdbc/JDriver.cxx   |2 
 connectivity/source/drivers/mysql_jdbc/YTable.cxx  |   11 +-
 connectivity/source/drivers/mysql_jdbc/YTables.cxx |7 -
 connectivity/source/drivers/mysql_jdbc/YUsers.cxx  |6 -
 connectivity/source/drivers/mysql_jdbc/YViews.cxx  |2 
 connectivity/source/drivers/mysqlc/mysqlc_driver.cxx   |5 -
 connectivity/source/drivers/odbc/ODatabaseMetaData.cxx |   37 
 connectivity/source/drivers/odbc/ODriver.cxx   |5 -
 connectivity/source/drivers/odbc/OPreparedStatement.cxx|4 
 connectivity/source/drivers/odbc/OStatement.cxx|4 
 connectivity/source/drivers/writer/WConnection.cxx |7 -
 connectivity/source/drivers/writer/WDatabaseMetaData.cxx   |8 -
 connectivity/source/drivers/writer/WDriver.cxx |5 -
 connectivity/source/drivers/writer/WTable.cxx  |5 -
 connectivity/source/drivers/writer/WTables.cxx |   12 +-
 connectivity/source/inc/odbc/OPreparedStatement.hxx|2 
 connectivity/source/inc/odbc/OStatement.hxx|2 
 connectivity/source/parse/PColumn.cxx  |6 -
 connectivity/source/parse/sqliterator.cxx  |   41 -
 connectivity/source/sdbcx/VColumn.cxx  |3 
 connectivity/source/sdbcx/VTable.cxx   |2 
 include/connectivity/PColumn.hxx   |2 
 64 files changed, 227 insertions(+), 305 deletions(-)

New commits:
commit dffe94959ada5297c7c719497395f5dfe66c4d2f
Author: Noel 
AuthorDate: Mon Feb 22 10:48:51 2021 +0200
Commit: Noel Grandin 
CommitDate: Mon Feb 22 13:37:53 2021 +0100

loplugin:refcounting in connectivity

  

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

2020-05-13 Thread Noel Grandin (via logerrit)
 connectivity/source/parse/sqliterator.cxx |   12 +++-
 include/connectivity/sqliterator.hxx  |7 ---
 2 files changed, 11 insertions(+), 8 deletions(-)

New commits:
commit bc059c08d86ccdeca4f340078b0de39053bc0888
Author: Noel Grandin 
AuthorDate: Wed May 13 11:02:41 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed May 13 14:06:49 2020 +0200

use std::optional for this error field

otherwise when I add source/line to the uno::Exception in an
upcoming change, the message becomes non-empty, and hasErrors()
return true.

I note that we throw SQLException in lots of places without a
message, so it is possible that this change will cause us to notice
errors we previously missed.

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

diff --git a/connectivity/source/parse/sqliterator.cxx 
b/connectivity/source/parse/sqliterator.cxx
index 7af9dc9ab9ee..ba3f274e65ef 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -209,7 +210,7 @@ void OSQLParseTreeIterator::setParseTree(const 
OSQLParseNode * pNewParseTree)
 if ( !m_pImpl->m_xTableContainer.is() )
 return;
 
-m_aErrors = SQLException();
+m_xErrors.reset();
 
 
 // Determine statement type ...
@@ -1468,7 +1469,7 @@ void OSQLParseTreeIterator::traverseAll()
 void OSQLParseTreeIterator::impl_traverse( TraversalParts _nIncludeMask )
 {
 // resets our errors
-m_aErrors = css::sdbc::SQLException();
+m_xErrors.reset();
 
 m_pImpl->m_nIncludeMask = _nIncludeMask;
 
@@ -2006,15 +2007,16 @@ void OSQLParseTreeIterator::impl_appendError( 
IParseContext::ErrorCode _eError,
 
 void OSQLParseTreeIterator::impl_appendError( const SQLException& _rError )
 {
-if ( !m_aErrors.Message.isEmpty() )
+SAL_WARN("connectivity.parse", "Adding error " << 
exceptionToString(Any(_rError)));
+if ( m_xErrors )
 {
-SQLException* pErrorChain = _aErrors;
+SQLException* pErrorChain = &*m_xErrors;
 while ( pErrorChain->NextException.hasValue() )
 pErrorChain = static_cast< SQLException* >( 
pErrorChain->NextException.pData );
 pErrorChain->NextException <<= _rError;
 }
 else
-m_aErrors = _rError;
+m_xErrors = _rError;
 }
 
 sal_Int32 OSQLParseTreeIterator::getFunctionReturnType(const OSQLParseNode* 
_pNode )
diff --git a/include/connectivity/sqliterator.hxx 
b/include/connectivity/sqliterator.hxx
index f77df204d52c..e4f0450ea4bb 100644
--- a/include/connectivity/sqliterator.hxx
+++ b/include/connectivity/sqliterator.hxx
@@ -27,6 +27,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -78,7 +79,7 @@ namespace connectivity
 class OOO_DLLPUBLIC_DBTOOLS OSQLParseTreeIterator final
 {
 private:
-css::sdbc::SQLException m_aErrors; 
 // contains the error while iterating through the statement
+std::optional  m_xErrors; 
 // contains the error while iterating through the statement
 const OSQLParseNode*m_pParseTree;  
 // current ParseTree
 const OSQLParser&   m_rParser; 
 // if set used for general error messages from the context
 OSQLStatementType   m_eStatementType;
@@ -178,8 +179,8 @@ namespace connectivity
 
 The returned object contains a chain (via 
SQLException::NextException) of SQLExceptions.
 */
-const css::sdbc::SQLException&   getErrors() const { return m_aErrors; 
}
-bool hasErrors() const { return !m_aErrors.Message.isEmpty(); }
+const css::sdbc::SQLException&   getErrors() const { return 
*m_xErrors; }
+bool hasErrors() const { return bool(m_xErrors); }
 
 // statement type (already set in setParseTree):
 OSQLStatementType getStatementType() const { return m_eStatementType; }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-04 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/commontools/dbtools.cxx   |3 +++
 connectivity/source/commontools/statementcomposer.cxx |   11 +++
 include/connectivity/statementcomposer.hxx|1 +
 3 files changed, 15 insertions(+)

New commits:
commit 97a2c1fc5e376c0c00968f17a0392c6d3a5ed565
Author: Lionel Elie Mamane 
AuthorDate: Mon May 4 22:58:31 2020 +0200
Commit: Lionel Elie Mamane 
CommitDate: Tue May 5 01:07:34 2020 +0200

tdf#122408 make StatementComposer apply HAVING clause

Change-Id: I381c918e8cac2800367bc586f8c230d46bcd71e5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93448
Tested-by: Jenkins
Reviewed-by: Lionel Elie Mamane 

diff --git a/connectivity/source/commontools/dbtools.cxx 
b/connectivity/source/commontools/dbtools.cxx
index 36161735ebb2..a16549ba3b50 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -1246,7 +1246,10 @@ static Reference< XSingleSelectQueryComposer > 
getComposedRowSetStatement( const
 bool bApplyFilter = true;
 _rxRowSet->getPropertyValue("ApplyFilter") >>= bApplyFilter;
 if ( bApplyFilter )
+{
 aComposer.setFilter( getString( 
_rxRowSet->getPropertyValue("Filter") ) );
+aComposer.setHavingClause( getString( 
_rxRowSet->getPropertyValue("HavingClause") ) );
+}
 
 aComposer.getQuery();
 
diff --git a/connectivity/source/commontools/statementcomposer.cxx 
b/connectivity/source/commontools/statementcomposer.cxx
index a21c8cf1a41d..01f20e9c1e3c 100644
--- a/connectivity/source/commontools/statementcomposer.cxx
+++ b/connectivity/source/commontools/statementcomposer.cxx
@@ -60,6 +60,7 @@ namespace dbtools
 Reference< XSingleSelectQueryComposer > xComposer;
 OUString sCommand;
 OUString sFilter;
+OUString sHavingClause;
 OUString sOrder;
 sal_Int32   nCommandType;
 boolbEscapeProcessing;
@@ -189,6 +190,8 @@ namespace dbtools
 OUString sFilter;
 OSL_VERIFY( xQuery->getPropertyValue("Filter") >>= 
sFilter );
 xComposer->setFilter( sFilter );
+OSL_VERIFY( 
xQuery->getPropertyValue("HavingClause") >>= sFilter );
+xComposer->setHavingClause( sFilter );
 }
 
 // the composed statement
@@ -212,6 +215,7 @@ namespace dbtools
 // append sort/filter
 xComposer->setOrder( _rData.sOrder );
 xComposer->setFilter( _rData.sFilter );
+xComposer->setHavingClause( _rData.sHavingClause );
 
 sStatement = xComposer->getQuery();
 
@@ -262,6 +266,13 @@ namespace dbtools
 }
 
 
+void StatementComposer::setHavingClause( const OUString& _rHavingClause )
+{
+m_pData->sHavingClause = _rHavingClause;
+m_pData->bComposerDirty = true;
+}
+
+
 void StatementComposer::setOrder( const OUString& _rOrder )
 {
 m_pData->sOrder = _rOrder;
diff --git a/include/connectivity/statementcomposer.hxx 
b/include/connectivity/statementcomposer.hxx
index 944a4321b12a..88fa61f553b1 100644
--- a/include/connectivity/statementcomposer.hxx
+++ b/include/connectivity/statementcomposer.hxx
@@ -68,6 +68,7 @@ namespace dbtools
 voidsetDisposeComposer( bool _bDoDispose );
 
 voidsetFilter( const OUString& _rFilter );
+voidsetHavingClause( const OUString& _rHavingClause );
 voidsetOrder( const OUString& _rOrder );
 
 /** returns the composer which has been fed with the current settings
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-09 Thread Stephan Bergmann (via logerrit)
 connectivity/source/cpool/ZConnectionPool.hxx |8 
 include/connectivity/DriversConfig.hxx|4 ++--
 pyuno/source/module/pyuno_impl.hxx|   12 ++--
 unoxml/source/dom/document.cxx|4 ++--
 4 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 2cfa5fbc3e15060c0eb462df25219c96f8aa5935
Author: Stephan Bergmann 
AuthorDate: Sun Feb 9 21:54:50 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Feb 10 08:03:05 2020 +0100

-Werror,-Wnon-c-typedef-for-linkage

...with recent Clant trunk, see 
 " Implement P1766R1: diagnose 
giving non-C-compatible classes a typedef name for linkage purposes."

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

diff --git a/connectivity/source/cpool/ZConnectionPool.hxx 
b/connectivity/source/cpool/ZConnectionPool.hxx
index 2037b014f8e3..b05c7d1ff275 100644
--- a/connectivity/source/cpool/ZConnectionPool.hxx
+++ b/connectivity/source/cpool/ZConnectionPool.hxx
@@ -61,11 +61,11 @@ namespace connectivity
 typedef std::vector< css::uno::Reference< css::sdbc::XPooledConnection> > 
TPooledConnections;
 
  // contains the currently pooled connections
-typedef struct
+struct TConnectionPool
 {
 TPooledConnections  aConnections;
 sal_Int32   nALiveCount; // will be decremented every time a 
time says to, when will reach zero the pool will be deleted
-} TConnectionPool;
+};
 
 struct TDigestHolder
 {
@@ -93,11 +93,11 @@ namespace connectivity
 typedef std::map< TDigestHolder,TConnectionPool,TDigestLess> 
TConnectionMap;
 
 // contains additional information about an activeconnection which is 
needed to put it back to the pool
-typedef struct
+struct TActiveConnectionInfo
 {
 TConnectionMap::iterator aPos;
 css::uno::Reference< css::sdbc::XPooledConnection> xPooledConnection;
-} TActiveConnectionInfo;
+};
 
 typedef std::map< css::uno::Reference< css::sdbc::XConnection>,
 TActiveConnectionInfo> TActiveConnectionMap;
diff --git a/include/connectivity/DriversConfig.hxx 
b/include/connectivity/DriversConfig.hxx
index a415f42cb665..f64a5a63882c 100644
--- a/include/connectivity/DriversConfig.hxx
+++ b/include/connectivity/DriversConfig.hxx
@@ -31,14 +31,14 @@
 
 namespace connectivity
 {
-typedef struct
+struct TInstalledDriver
 {
 ::comphelper::NamedValueCollection aProperties;
 ::comphelper::NamedValueCollection aFeatures;
 ::comphelper::NamedValueCollection aMetaData;
 OUString sDriverFactory;
 OUString sDriverTypeDisplayName;
-} TInstalledDriver;
+};
 typedef std::map TInstalledDrivers;
 
 class DriversConfigImpl
diff --git a/pyuno/source/module/pyuno_impl.hxx 
b/pyuno/source/module/pyuno_impl.hxx
index 91c24b4e7a88..8af2da85639d 100644
--- a/pyuno/source/module/pyuno_impl.hxx
+++ b/pyuno/source/module/pyuno_impl.hxx
@@ -212,11 +212,11 @@ PyRef PyUNOStruct_new (
 const css::uno::Any ,
 const  css::uno::Reference  );
 
-typedef struct
+struct PyUNOInternals
 {
 css::uno::Reference  xInvocation;
 css::uno::Any wrappedObject;
-} PyUNOInternals;
+};
 
 typedef struct
 {
@@ -227,10 +227,10 @@ typedef struct
 PyObject* PyUNO_iterator_new (
 const css::uno::Reference& xEnumeration);
 
-typedef struct
+struct PyUNO_iterator_Internals
 {
 css::uno::Reference  xEnumeration;
-} PyUNO_iterator_Internals;
+};
 
 typedef struct
 {
@@ -241,11 +241,11 @@ typedef struct
 PyObject* PyUNO_list_iterator_new (
 const css::uno::Reference );
 
-typedef struct
+struct PyUNO_list_iterator_Internals
 {
 css::uno::Reference  xIndexAccess;
 int index;
-} PyUNO_list_iterator_Internals;
+};
 
 typedef struct
 {
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx
index be96f69c9035..fe6994df2191 100644
--- a/unoxml/source/dom/document.cxx
+++ b/unoxml/source/dom/document.cxx
@@ -326,10 +326,10 @@ namespace DOM
 namespace {
 
 // IO context functions for libxml2 interaction
-typedef struct {
+struct IOContext {
 Reference< XOutputStream > stream;
 bool const allowClose;
-} IOContext;
+};
 
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-12-02 Thread Stephan Bergmann (via logerrit)
 connectivity/source/commontools/sqlerror.cxx |   45 +++
 include/connectivity/sqlerror.hxx|   12 +++
 2 files changed, 25 insertions(+), 32 deletions(-)

New commits:
commit 5da0f455a63ea22b500943d7ff4c28fbb7a90cfb
Author: Stephan Bergmann 
AuthorDate: Mon Dec 2 13:36:23 2019 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Dec 2 17:48:06 2019 +0100

Simplify SQLError::ParamValue to just o3tl::optional

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

diff --git a/connectivity/source/commontools/sqlerror.cxx 
b/connectivity/source/commontools/sqlerror.cxx
index 11d672929094..88758dd1b531 100644
--- a/connectivity/source/commontools/sqlerror.cxx
+++ b/connectivity/source/commontools/sqlerror.cxx
@@ -44,13 +44,6 @@ namespace connectivity
 using ::com::sun::star::sdbc::SQLException;
 using ::com::sun::star::uno::Type;
 
-//using SQLError::ParamValue; // GCC (unxlngi6) does not like this
-namespace
-{
-typedef SQLError::ParamValue ParamValue;
-}
-
-
 class SQLError_Impl
 {
 public:
@@ -58,12 +51,12 @@ namespace connectivity
 
 // versions of the public SQLError methods which are just delegated to 
this impl-class
 static const OUString& getMessagePrefix();
-OUString getErrorMessage( const ErrorCondition _eCondition, const 
ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const ParamValue& 
_rParamValue3 );
+OUString getErrorMessage( const ErrorCondition _eCondition, const 
o3tl::optional& _rParamValue1, const o3tl::optional& 
_rParamValue2, const o3tl::optional& _rParamValue3 );
 static ErrorCodegetErrorCode( const ErrorCondition _eCondition );
-voidraiseException( const ErrorCondition _eCondition, 
const Reference< XInterface >& _rxContext, const ParamValue& _rParamValue1, 
const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 );
-voidraiseException( const ErrorCondition _eCondition, 
const ParamValue& _rParamValue1, const ParamValue& _rParamValue2, const 
ParamValue& _rParamValue3 );
-voidraiseTypedException( const ErrorCondition 
_eCondition, const Reference< XInterface >& _rxContext, const Type& 
_rExceptionType, const ParamValue& _rParamValue1, const ParamValue& 
_rParamValue2, const ParamValue& _rParamValue3 );
-SQLExceptiongetSQLException( const ErrorCondition _eCondition, 
const Reference< XInterface >& _rxContext, const ParamValue& _rParamValue1, 
const ParamValue& _rParamValue2, const ParamValue& _rParamValue3 );
+voidraiseException( const ErrorCondition _eCondition, 
const Reference< XInterface >& _rxContext, const o3tl::optional& 
_rParamValue1, const o3tl::optional& _rParamValue2, const 
o3tl::optional& _rParamValue3 );
+voidraiseException( const ErrorCondition _eCondition, 
const o3tl::optional& _rParamValue1, const o3tl::optional& 
_rParamValue2, const o3tl::optional& _rParamValue3 );
+voidraiseTypedException( const ErrorCondition 
_eCondition, const Reference< XInterface >& _rxContext, const Type& 
_rExceptionType, const o3tl::optional& _rParamValue1, const 
o3tl::optional& _rParamValue2, const o3tl::optional& 
_rParamValue3 );
+SQLExceptiongetSQLException( const ErrorCondition _eCondition, 
const Reference< XInterface >& _rxContext, const o3tl::optional& 
_rParamValue1, const o3tl::optional& _rParamValue2, const 
o3tl::optional& _rParamValue3 );
 
 private:
 /// returns the basic error message associated with the given error 
condition, without any parameter replacements
@@ -77,7 +70,7 @@ namespace connectivity
 /// returns an SQLException describing the given error condition
 SQLException
 impl_buildSQLException( const ErrorCondition _eCondition, 
const Reference< XInterface >& _rxContext,
-const ParamValue& _rParamValue1, const ParamValue& 
_rParamValue2, const ParamValue& _rParamValue3 );
+const o3tl::optional& _rParamValue1, const 
o3tl::optional& _rParamValue2, const o3tl::optional& 
_rParamValue3 );
 private:
 std::locale m_aResources;
 };
@@ -98,13 +91,13 @@ namespace connectivity
 
 /** substitutes a given placeholder in the given message with the 
given value
 */
-void lcl_substitutePlaceholder(OUString& _rMessage, const sal_Char* 
_pPlaceholder, const ParamValue& rParamValue)
+void lcl_substitutePlaceholder(OUString& _rMessage, const sal_Char* 
_pPlaceholder, const o3tl::optional& rParamValue)
 {
 size_t nPlaceholderLen( strlen( _pPlaceholder ) );
 sal_Int32 nIndex = _rMessage.indexOfAsciiL( _pPlaceholder, 

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

2019-08-22 Thread Noel Grandin (via logerrit)
 connectivity/source/drivers/dbase/DIndex.cxx   |2 +-
 connectivity/source/drivers/evoab2/NConnection.hxx |2 +-
 connectivity/source/drivers/evoab2/NStatement.cxx  |2 +-
 connectivity/source/drivers/evoab2/NStatement.hxx  |2 +-
 connectivity/source/drivers/flat/ETable.cxx|2 +-
 connectivity/source/drivers/hsqldb/HTable.cxx  |2 +-
 connectivity/source/drivers/mork/MConnection.hxx   |2 +-
 connectivity/source/drivers/mork/MDriver.hxx   |4 ++--
 connectivity/source/drivers/mysql_jdbc/YTable.cxx  |2 +-
 connectivity/source/inc/dbase/DIndex.hxx   |4 ++--
 connectivity/source/inc/dbase/dindexnode.hxx   |8 
 connectivity/source/inc/file/FTable.hxx|2 +-
 connectivity/source/inc/flat/ETable.hxx|2 +-
 connectivity/source/inc/hsqldb/HTable.hxx  |2 +-
 connectivity/source/inc/mysql/YTable.hxx   |2 +-
 connectivity/source/inc/odbc/OBoundParam.hxx   |4 ++--
 include/connectivity/paramwrapper.hxx  |2 +-
 17 files changed, 23 insertions(+), 23 deletions(-)

New commits:
commit b1dc8e2379b53c3d57283d43655cf4d51d586ec0
Author: Noel Grandin 
AuthorDate: Wed Aug 21 20:21:35 2019 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 22 09:35:02 2019 +0200

loplugin:constmethod in connectivity

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

diff --git a/connectivity/source/drivers/dbase/DIndex.cxx 
b/connectivity/source/drivers/dbase/DIndex.cxx
index f9ad5295a088..23a5d28f9fd9 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -379,7 +379,7 @@ SvStream& connectivity::dbase::WriteODbaseIndex(SvStream 
, ODbaseIndex&
 return rStream;
 }
 
-OUString ODbaseIndex::getCompletePath()
+OUString ODbaseIndex::getCompletePath() const
 {
 OUString sDir = m_pTable->getConnection()->getURL() +
 OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DELIMITER) +
diff --git a/connectivity/source/drivers/evoab2/NConnection.hxx 
b/connectivity/source/drivers/evoab2/NConnection.hxx
index 9ece2b65b280..2b2737927b53 100644
--- a/connectivity/source/drivers/evoab2/NConnection.hxx
+++ b/connectivity/source/drivers/evoab2/NConnection.hxx
@@ -64,7 +64,7 @@ namespace connectivity
 /// @throws css::sdbc::SQLException
 void construct(const OUString& _rUrl,const css::uno::Sequence< 
css::beans::PropertyValue >& _rInfo );
 
-OString const & getPassword() { return m_aPassword; }
+OString const & getPassword() const { return m_aPassword; }
 void setPassword( OString const & aStr ) { m_aPassword = 
aStr; }
 // own methods
 const OEvoabDriver& getDriver() const { return m_rDriver; }
diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx 
b/connectivity/source/drivers/evoab2/NStatement.cxx
index ab44ad948a2f..8f6d7959f222 100644
--- a/connectivity/source/drivers/evoab2/NStatement.cxx
+++ b/connectivity/source/drivers/evoab2/NStatement.cxx
@@ -401,7 +401,7 @@ EBookQuery *OCommonStatement::whereAnalysis( const 
OSQLParseNode* parseTree )
 return pResult;
 }
 
-OUString OCommonStatement::getTableName()
+OUString OCommonStatement::getTableName() const
 {
 OUString aTableName;
 
diff --git a/connectivity/source/drivers/evoab2/NStatement.hxx 
b/connectivity/source/drivers/evoab2/NStatement.hxx
index a2f918af0b9b..a36e524af5c2 100644
--- a/connectivity/source/drivers/evoab2/NStatement.hxx
+++ b/connectivity/source/drivers/evoab2/NStatement.hxx
@@ -185,7 +185,7 @@ namespace connectivity
 void parseSql( const OUString& sql, QueryData& 
_out_rQueryData );
 EBookQuery  *whereAnalysis( const OSQLParseNode*  parseTree );
 void orderByAnalysis( const OSQLParseNode* 
_pOrderByClause, SortDescriptor& _out_rSort );
-OUString getTableName();
+OUString getTableName() const;
 
 public:
 
diff --git a/connectivity/source/drivers/flat/ETable.cxx 
b/connectivity/source/drivers/flat/ETable.cxx
index ff753ce484eb..b535c35ae627 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -449,7 +449,7 @@ void OFlatTable::construct()
 }
 }
 
-OUString OFlatTable::getEntry()
+OUString OFlatTable::getEntry() const
 {
 OUString sURL;
 try
diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx 
b/connectivity/source/drivers/hsqldb/HTable.cxx
index ec73225d3abd..b7a841a76ff4 100644
--- a/connectivity/source/drivers/hsqldb/HTable.cxx
+++ b/connectivity/source/drivers/hsqldb/HTable.cxx
@@ -301,7 +301,7 @@ void OHSQLTable::dropDefaultValue(const OUString& _rColName)
 executeStatement(sSql);
 }
 
-OUString OHSQLTable::getAlterTableColumnPart()
+OUString 

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

2019-08-05 Thread Arkadiy Illarionov (via logerrit)
 connectivity/source/sdbcx/VCollection.cxx  |3 ++-
 connectivity/source/sdbcx/VDescriptor.cxx  |   16 
 include/connectivity/sdbcx/VDescriptor.hxx |3 +--
 3 files changed, 7 insertions(+), 15 deletions(-)

New commits:
commit f0390929d3e71ab434f9ce8d88c2dc2f4cc0ea6e
Author: Arkadiy Illarionov 
AuthorDate: Sun Aug 4 15:55:12 2019 +0300
Commit: Stephan Bergmann 
CommitDate: Mon Aug 5 09:48:03 2019 +0200

tdf#39593 Drop connectivity::sdbcx::ODescriptor::getImplementation

Replace with comphelper::getUnoTunnelImplementation.

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

diff --git a/connectivity/source/sdbcx/VCollection.cxx 
b/connectivity/source/sdbcx/VCollection.cxx
index 7ccb08c4d21c..56060cb2ea9a 100644
--- a/connectivity/source/sdbcx/VCollection.cxx
+++ b/connectivity/source/sdbcx/VCollection.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -373,7 +374,7 @@ void SAL_CALL OCollection::appendByDescriptor( const 
Reference< XPropertySet >&
 if ( !xNewlyCreated.is() )
 throw RuntimeException();
 
-ODescriptor* pDescriptor = ODescriptor::getImplementation( xNewlyCreated );
+ODescriptor* pDescriptor = 
comphelper::getUnoTunnelImplementation( xNewlyCreated );
 if ( pDescriptor )
 pDescriptor->setNew( false );
 
diff --git a/connectivity/source/sdbcx/VDescriptor.cxx 
b/connectivity/source/sdbcx/VDescriptor.cxx
index 0be99ce8b164..cde97530a186 100644
--- a/connectivity/source/sdbcx/VDescriptor.cxx
+++ b/connectivity/source/sdbcx/VDescriptor.cxx
@@ -19,6 +19,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -48,21 +49,12 @@ namespace connectivity
 // css::lang::XUnoTunnel
 sal_Int64 SAL_CALL ODescriptor::getSomething( const Sequence< sal_Int8 
>& rId )
 {
-return (rId.getLength() == 16 && 0 == 
memcmp(getUnoTunnelImplementationId().getConstArray(),  rId.getConstArray(), 16 
) )
+return (rId.getLength() == 16 && 0 == 
memcmp(getUnoTunnelId().getConstArray(),  rId.getConstArray(), 16 ) )
 ? reinterpret_cast< sal_Int64 >( this )
 : 0;
 }
 
 
-ODescriptor* ODescriptor::getImplementation( const Reference< 
XInterface >& _rxSomeComp )
-{
-Reference< XUnoTunnel > xTunnel( _rxSomeComp, UNO_QUERY );
-if ( xTunnel.is() )
-return reinterpret_cast< ODescriptor* >( 
xTunnel->getSomething( getUnoTunnelImplementationId() ) );
-return nullptr;
-}
-
-
 namespace
 {
 struct ResetROAttribute
@@ -98,12 +90,12 @@ namespace connectivity
 
 bool ODescriptor::isNew( const Reference< XInterface >& _rxDescriptor )
 {
-ODescriptor* pImplementation = getImplementation( _rxDescriptor );
+ODescriptor* pImplementation = 
comphelper::getUnoTunnelImplementation( _rxDescriptor );
 return pImplementation && pImplementation->isNew();
 }
 
 
-Sequence< sal_Int8 > ODescriptor::getUnoTunnelImplementationId()
+Sequence< sal_Int8 > ODescriptor::getUnoTunnelId()
 {
 static ::cppu::OImplementationId implId;
 
diff --git a/include/connectivity/sdbcx/VDescriptor.hxx 
b/include/connectivity/sdbcx/VDescriptor.hxx
index b68689d16035..51737e190f0f 100644
--- a/include/connectivity/sdbcx/VDescriptor.hxx
+++ b/include/connectivity/sdbcx/VDescriptor.hxx
@@ -72,9 +72,8 @@ namespace connectivity
 
 // css::lang::XUnoTunnel
 virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-static css::uno::Sequence< sal_Int8 > 
getUnoTunnelImplementationId();
+static css::uno::Sequence< sal_Int8 > getUnoTunnelId();
 
-static ODescriptor* getImplementation( const css::uno::Reference< 
css::uno::XInterface >& _rxSomeComp );
 // retrieves the ODescriptor implementation of a given UNO 
component, and returns its ->isNew flag
 static bool isNew( const css::uno::Reference< css::uno::XInterface 
>& _rxDescriptor );
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-05-31 Thread Michael Stahl (via logerrit)
 connectivity/source/commontools/TIndex.cxx   |4 ++--
 connectivity/source/commontools/TKey.cxx |2 +-
 connectivity/source/drivers/ado/AGroup.cxx   |2 +-
 connectivity/source/drivers/ado/AIndex.cxx   |2 +-
 connectivity/source/drivers/ado/AKey.cxx |2 +-
 connectivity/source/drivers/ado/AUser.cxx|2 +-
 connectivity/source/drivers/dbase/DIndex.cxx |2 +-
 include/connectivity/sdbcx/VGroup.hxx|3 ++-
 include/connectivity/sdbcx/VIndex.hxx|3 ++-
 include/connectivity/sdbcx/VKey.hxx  |3 ++-
 include/connectivity/sdbcx/VUser.hxx |3 ++-
 11 files changed, 16 insertions(+), 12 deletions(-)

New commits:
commit 6bd751f9f577f25b058fb8a5479c0de7552c3ffc
Author: Michael Stahl 
AuthorDate: Wed May 29 13:18:37 2019 +0200
Commit: Michael Stahl 
CommitDate: Fri May 31 10:19:21 2019 +0200

connectivity: fix memory leaks caused by OConnection::acquire()

Followup to 58f121ef2e680697e10453add43bab9b771d153a;
OConnection must not be held by rtl::Reference as that creates a cycle.

(regression from 497e40ad03c27837978551ba15491c3fb2a0bf53)

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

diff --git a/connectivity/source/commontools/TIndex.cxx 
b/connectivity/source/commontools/TIndex.cxx
index 2b5be27e337a..cba83f780137 100644
--- a/connectivity/source/commontools/TIndex.cxx
+++ b/connectivity/source/commontools/TIndex.cxx
@@ -37,7 +37,7 @@ OIndexHelper::OIndexHelper( OTableHelper* _pTable) : 
connectivity::sdbcx::OIndex
 {
 construct();
 std::vector< OUString> aVector;
-m_pColumns = new OIndexColumns(this,m_aMutex,aVector);
+m_pColumns.reset(new OIndexColumns(this,m_aMutex,aVector));
 }
 
 OIndexHelper::OIndexHelper( OTableHelper* _pTable,
@@ -93,7 +93,7 @@ void OIndexHelper::refreshColumns()
 if(m_pColumns)
 m_pColumns->reFill(aVector);
 else
-m_pColumns = new OIndexColumns(this,m_aMutex,aVector);
+m_pColumns.reset(new OIndexColumns(this,m_aMutex,aVector));
 }
 
 
diff --git a/connectivity/source/commontools/TKey.cxx 
b/connectivity/source/commontools/TKey.cxx
index 7720adcc0a19..16910f558ef4 100644
--- a/connectivity/source/commontools/TKey.cxx
+++ b/connectivity/source/commontools/TKey.cxx
@@ -100,7 +100,7 @@ void OTableKeyHelper::refreshColumns()
 if ( m_pColumns )
 m_pColumns->reFill(aVector);
 else
-m_pColumns = new OKeyColumnsHelper(this,m_aMutex,aVector);
+m_pColumns.reset(new OKeyColumnsHelper(this,m_aMutex,aVector));
 }
 
 
diff --git a/connectivity/source/drivers/ado/AGroup.cxx 
b/connectivity/source/drivers/ado/AGroup.cxx
index e0c8b49a2d01..0b251a6f2cf3 100644
--- a/connectivity/source/drivers/ado/AGroup.cxx
+++ b/connectivity/source/drivers/ado/AGroup.cxx
@@ -78,7 +78,7 @@ void OAdoGroup::refreshUsers()
 if(m_pUsers)
 m_pUsers->reFill(aVector);
 else
-m_pUsers = new 
OUsers(m_pCatalog,m_aMutex,aVector,aUsers,isCaseSensitive());
+m_pUsers.reset(new OUsers(m_pCatalog, m_aMutex, aVector, aUsers, 
isCaseSensitive()));
 }
 
 Sequence< sal_Int8 > OAdoGroup::getUnoTunnelImplementationId()
diff --git a/connectivity/source/drivers/ado/AIndex.cxx 
b/connectivity/source/drivers/ado/AIndex.cxx
index 29ecf4d4d74b..0888fa1bf2b8 100644
--- a/connectivity/source/drivers/ado/AIndex.cxx
+++ b/connectivity/source/drivers/ado/AIndex.cxx
@@ -66,7 +66,7 @@ void OAdoIndex::refreshColumns()
 if ( m_pColumns )
 m_pColumns->reFill(aVector);
 else
-m_pColumns = new 
OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection);
+m_pColumns.reset(new OColumns(*this, m_aMutex, aVector, aColumns, 
isCaseSensitive(), m_pConnection));
 }
 
 
diff --git a/connectivity/source/drivers/ado/AKey.cxx 
b/connectivity/source/drivers/ado/AKey.cxx
index 4393666d40be..25ffeb6eece6 100644
--- a/connectivity/source/drivers/ado/AKey.cxx
+++ b/connectivity/source/drivers/ado/AKey.cxx
@@ -63,7 +63,7 @@ void OAdoKey::refreshColumns()
 if(m_pColumns)
 m_pColumns->reFill(aVector);
 else
-m_pColumns = new 
OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection);
+m_pColumns.reset(new OColumns(*this, m_aMutex, aVector, aColumns, 
isCaseSensitive(), m_pConnection));
 }
 
 Sequence< sal_Int8 > OAdoKey::getUnoTunnelImplementationId()
diff --git a/connectivity/source/drivers/ado/AUser.cxx 
b/connectivity/source/drivers/ado/AUser.cxx
index cff7695c757d..4e595de36bac 100644
--- a/connectivity/source/drivers/ado/AUser.cxx
+++ b/connectivity/source/drivers/ado/AUser.cxx
@@ -62,7 +62,7 @@ void OAdoUser::refreshGroups()
 if(m_pGroups)
 m_pGroups->reFill(aVector);
 else
-m_pGroups = new 
OGroups(m_pCatalog,m_aMutex,aVector,aGroups,isCaseSensitive());
+m_pGroups.reset(new OGroups(m_pCatalog, m_aMutex, 

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

2018-07-27 Thread Libreoffice Gerrit user
 connectivity/source/commontools/dbcharset.cxx   |   13 -
 connectivity/source/commontools/dbexception.cxx |8 
 connectivity/source/parse/sqlnode.cxx   |5 -
 include/connectivity/dbcharset.hxx  |3 ---
 include/connectivity/dbexception.hxx|2 --
 include/connectivity/sqlnode.hxx|1 -
 6 files changed, 32 deletions(-)

New commits:
commit 322acaa9ad58f4dc9a7025eacedd748dd2c1a1a1
Author: Stephan Bergmann 
AuthorDate: Thu Jul 26 12:05:45 2018 +0200
Commit: Stephan Bergmann 
CommitDate: Fri Jul 27 08:19:22 2018 +0200

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

...by removing explicitly user-provided functions that do the same as their
implicitly-defined counterparts, but may prevent implicitly declared copy
functions from being defined as non-deleted in the future.  (Even if such a
user-provided function was declared non-inline in an include file, the
apparently-used implicitly-defined copy functions are already inline, so why
bother with non-inline functions.)

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

diff --git a/connectivity/source/commontools/dbcharset.cxx 
b/connectivity/source/commontools/dbcharset.cxx
index 9fc7923dbc70..ebe45c028207 100644
--- a/connectivity/source/commontools/dbcharset.cxx
+++ b/connectivity/source/commontools/dbcharset.cxx
@@ -142,19 +142,6 @@ namespace dbtools
 OSL_ENSURE( m_pContainer, 
"OCharsetMap::CharsetIterator::CharsetIterator : invalid container!" );
 }
 
-
-OCharsetMap::CharsetIterator::CharsetIterator(const CharsetIterator& 
_rSource)
-:m_pContainer( _rSource.m_pContainer )
-,m_aPos( _rSource.m_aPos )
-{
-}
-
-
-OCharsetMap::CharsetIterator::~CharsetIterator()
-{
-}
-
-
 CharsetIteratorDerefHelper OCharsetMap::CharsetIterator::operator*() const
 {
 OSL_ENSURE( m_aPos != m_pContainer->m_aEncodings.end(), 
"OCharsetMap::CharsetIterator::operator*: invalid position!");
diff --git a/connectivity/source/commontools/dbexception.cxx 
b/connectivity/source/commontools/dbexception.cxx
index 961720f4bc59..718bbdf4d674 100644
--- a/connectivity/source/commontools/dbexception.cxx
+++ b/connectivity/source/commontools/dbexception.cxx
@@ -72,14 +72,6 @@ SQLExceptionInfo::SQLExceptionInfo( const OUString& 
_rSimpleErrorMessage )
 implDetermineType();
 }
 
-
-SQLExceptionInfo::SQLExceptionInfo(const SQLExceptionInfo& _rCopySource)
-:m_aContent(_rCopySource.m_aContent)
-,m_eType(_rCopySource.m_eType)
-{
-}
-
-
 SQLExceptionInfo& SQLExceptionInfo::operator=(const css::sdbc::SQLException& 
_rError)
 {
 m_aContent <<= _rError;
diff --git a/connectivity/source/parse/sqlnode.cxx 
b/connectivity/source/parse/sqlnode.cxx
index 5b0007f24011..ada5d32d4275 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -209,11 +209,6 @@ SQLParseNodeParameter::SQLParseNodeParameter( const 
Reference< XConnection >& _r
 {
 }
 
-
-SQLParseNodeParameter::~SQLParseNodeParameter()
-{
-}
-
 OUString OSQLParseNode::convertDateString(const SQLParseNodeParameter& rParam, 
const OUString& rString)
 {
 Date aDate = DBTypeConversion::toDate(rString);
diff --git a/include/connectivity/dbcharset.hxx 
b/include/connectivity/dbcharset.hxx
index 0830c1d00862..a4a4abe43a33 100644
--- a/include/connectivity/dbcharset.hxx
+++ b/include/connectivity/dbcharset.hxx
@@ -127,9 +127,6 @@ namespace dbtools
 OCharsetMap::TextEncBag::const_iterator m_aPos;
 
 public:
-CharsetIterator(const CharsetIterator& _rSource);
-~CharsetIterator();
-
 CharsetIteratorDerefHelper operator*() const;
 // no -> operator
 // this would require us to a) store CharsetIteratorDerefHelper 
instances ourself so that we
diff --git a/include/connectivity/dbexception.hxx 
b/include/connectivity/dbexception.hxx
index e273cf8cb14c..e016e7f7e1b5 100644
--- a/include/connectivity/dbexception.hxx
+++ b/include/connectivity/dbexception.hxx
@@ -82,8 +82,6 @@ public:
 */
 SQLExceptionInfo( const OUString& _rSimpleErrorMessage );
 
-SQLExceptionInfo(const SQLExceptionInfo& _rCopySource);
-
 // use for events got via XSQLErrorListener::errorOccured
 SQLExceptionInfo(const css::uno::Any& _rError);
 // use with the Reason member of an SQLErrorEvent or with 
NextElement of an SQLException
diff --git a/include/connectivity/sqlnode.hxx b/include/connectivity/sqlnode.hxx
index e2198499baed..1b5ef59392c3 100644
--- a/include/connectivity/sqlnode.hxx
+++ b/include/connectivity/sqlnode.hxx
@@ -103,7 +103,6 @@ namespace connectivity
 bool _bPredicate,
 bool _bParseToSDBC
 );
-~SQLParseNodeParameter();
 };
 
 //= OSQLParseNode

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

2018-01-31 Thread Mike Kaganski
 connectivity/source/drivers/firebird/Connection.cxx |   12 +++--
 connectivity/source/drivers/mork/post_include_windows.h |   24 ---
 connectivity/source/drivers/mork/pre_include_windows.h  |   25 
 connectivity/source/inc/ado/Aolevariant.hxx |2 
 connectivity/source/inc/ado/Awrapado.hxx|2 
 connectivity/source/inc/ado/Awrapadox.hxx   |2 
 connectivity/source/inc/ado/WrapColumn.hxx  |2 
 connectivity/source/inc/ado/ado_post_sys_include.h  |   26 
 connectivity/source/inc/ado/ado_pre_sys_include.h   |   33 
 connectivity/source/inc/ado/adoimp.hxx  |2 
 connectivity/source/parse/sqlbison.y|   13 +++---
 connectivity/source/parse/sqlflex.l |   14 --
 include/connectivity/odbc.hxx   |9 
 13 files changed, 23 insertions(+), 143 deletions(-)

New commits:
commit b7c5ddcdd05ceba73acb1a298500892d6157f360
Author: Mike Kaganski 
Date:   Wed Jan 31 12:29:46 2018 +0300

connectivity: MSVC: pragma warning: make more specific, remove obsolete

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

diff --git a/connectivity/source/drivers/firebird/Connection.cxx 
b/connectivity/source/drivers/firebird/Connection.cxx
index 619f324720e9..9cb9fc340cc8 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -55,11 +55,6 @@
 
 #include 
 
-#ifdef _WIN32
-// for ADD_SPB_NUMERIC
-#pragma warning(disable: 4310) // cast truncates data
-#endif
-
 using namespace connectivity::firebird;
 using namespace connectivity;
 
@@ -637,7 +632,14 @@ void Connection::runBackupService(const short nAction)
 aRequest.append(char(isc_spb_options)); // 4-Byte bitmask
 char sOptions[4];
 char * pOptions = sOptions;
+#ifdef _WIN32
+#pragma warning(push)
+#pragma warning(disable: 4310) // cast truncates data
+#endif
 ADD_SPB_NUMERIC(pOptions, isc_spb_res_create);
+#ifdef _WIN32
+#pragma warning(pop)
+#endif
 aRequest.append(sOptions, 4);
 }
 
diff --git a/connectivity/source/drivers/mork/post_include_windows.h 
b/connectivity/source/drivers/mork/post_include_windows.h
deleted file mode 100644
index bd49753b7bd7..
--- a/connectivity/source/drivers/mork/post_include_windows.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mork/pre_include_windows.h 
b/connectivity/source/drivers/mork/pre_include_windows.h
deleted file mode 100644
index 7d68ce298f9e..
--- a/connectivity/source/drivers/mork/pre_include_windows.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifdef _MSC_VER
-#pragma warning(push,1)
-#pragma warning(disable:4668 4917)
-#endif
-
-/* vim:set shiftwidth=4 

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

2018-01-28 Thread Noel Grandin
 connectivity/source/drivers/ado/ACatalog.cxx   |8 
 connectivity/source/drivers/calc/CCatalog.cxx  |2 +-
 connectivity/source/drivers/dbase/DCatalog.cxx |2 +-
 connectivity/source/drivers/evoab2/NCatalog.cxx|4 ++--
 connectivity/source/drivers/file/FCatalog.cxx  |2 +-
 connectivity/source/drivers/firebird/Catalog.cxx   |8 
 connectivity/source/drivers/flat/ECatalog.cxx  |2 +-
 connectivity/source/drivers/hsqldb/HCatalog.cxx|6 +++---
 connectivity/source/drivers/macab/MacabCatalog.cxx |4 ++--
 connectivity/source/drivers/mork/MCatalog.cxx  |4 ++--
 connectivity/source/drivers/mysql/YCatalog.cxx |6 +++---
 connectivity/source/drivers/writer/WCatalog.cxx|2 +-
 connectivity/source/inc/ado/ACatalog.hxx   |2 +-
 connectivity/source/inc/hsqldb/HCatalog.hxx|4 ++--
 connectivity/source/inc/mysql/YCatalog.hxx |4 ++--
 connectivity/source/sdbcx/VCatalog.cxx |   12 
 include/connectivity/sdbcx/VCatalog.hxx|9 +
 17 files changed, 39 insertions(+), 42 deletions(-)

New commits:
commit 53d21a31435c6fc781fe34400e18abb34a6b04d8
Author: Noel Grandin 
Date:   Tue Jan 23 16:55:44 2018 +0200

loplugin:useuniqueptr in OCatalog

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

diff --git a/connectivity/source/drivers/ado/ACatalog.cxx 
b/connectivity/source/drivers/ado/ACatalog.cxx
index cb44200f7920..5e80bedbc031 100644
--- a/connectivity/source/drivers/ado/ACatalog.cxx
+++ b/connectivity/source/drivers/ado/ACatalog.cxx
@@ -69,7 +69,7 @@ void OCatalog::refreshTables()
 if(m_pTables)
 m_pTables->reFill(aVector);
 else
-m_pTables = new 
OTables(this,m_aMutex,aVector,aTables,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
+m_pTables.reset( new 
OTables(this,m_aMutex,aVector,aTables,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers())
 );
 }
 
 void OCatalog::refreshViews()
@@ -82,7 +82,7 @@ void OCatalog::refreshViews()
 if(m_pViews)
 m_pViews->reFill(aVector);
 else
-m_pViews = new 
OViews(this,m_aMutex,aVector,aViews,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
+m_pViews.reset( new 
OViews(this,m_aMutex,aVector,aViews,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers())
 );
 }
 
 void OCatalog::refreshGroups()
@@ -95,7 +95,7 @@ void OCatalog::refreshGroups()
 if(m_pGroups)
 m_pGroups->reFill(aVector);
 else
-m_pGroups = new 
OGroups(this,m_aMutex,aVector,aGroups,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
+m_pGroups.reset( new 
OGroups(this,m_aMutex,aVector,aGroups,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers())
 );
 }
 
 void OCatalog::refreshUsers()
@@ -108,7 +108,7 @@ void OCatalog::refreshUsers()
 if(m_pUsers)
 m_pUsers->reFill(aVector);
 else
-m_pUsers = new 
OUsers(this,m_aMutex,aVector,aUsers,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers());
+m_pUsers.reset( new 
OUsers(this,m_aMutex,aVector,aUsers,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers())
 );
 }
 
 
diff --git a/connectivity/source/drivers/calc/CCatalog.cxx 
b/connectivity/source/drivers/calc/CCatalog.cxx
index 7ac5af5398d4..6853a5f9dbc3 100644
--- a/connectivity/source/drivers/calc/CCatalog.cxx
+++ b/connectivity/source/drivers/calc/CCatalog.cxx
@@ -53,7 +53,7 @@ void OCalcCatalog::refreshTables()
 if(m_pTables)
 m_pTables->reFill(aVector);
 else
-m_pTables = new OCalcTables(m_xMetaData,*this,m_aMutex,aVector);
+m_pTables.reset( new OCalcTables(m_xMetaData,*this,m_aMutex,aVector) );
 
 // this avoids that the document will be loaded a 2nd time when one table 
will be accessed.
 //if ( m_pTables && m_pTables->hasElements() )
diff --git a/connectivity/source/drivers/dbase/DCatalog.cxx 
b/connectivity/source/drivers/dbase/DCatalog.cxx
index 8bc06bb98141..c35af1f28e62 100644
--- a/connectivity/source/drivers/dbase/DCatalog.cxx
+++ b/connectivity/source/drivers/dbase/DCatalog.cxx
@@ -52,7 +52,7 @@ void ODbaseCatalog::refreshTables()
 if(m_pTables)
 m_pTables->reFill(aVector);
 else
-m_pTables = new ODbaseTables(m_xMetaData,*this,m_aMutex,aVector);
+m_pTables.reset( new ODbaseTables(m_xMetaData,*this,m_aMutex,aVector) 
);
 }
 
 
diff --git a/connectivity/source/drivers/evoab2/NCatalog.cxx 
b/connectivity/source/drivers/evoab2/NCatalog.cxx
index 1d8c2924a081..fb010b8dce5d 100644
--- a/connectivity/source/drivers/evoab2/NCatalog.cxx
+++ b/connectivity/source/drivers/evoab2/NCatalog.cxx
@@ -58,7 +58,7 @@ void 

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

2018-01-11 Thread Miklos Vajna
 connectivity/source/drivers/writer/WConnection.cxx   |   23 +--
 connectivity/source/drivers/writer/WDatabaseMetaData.cxx |6 +--
 connectivity/source/drivers/writer/WDriver.cxx   |2 -
 connectivity/source/drivers/writer/WTable.cxx|6 +--
 connectivity/source/drivers/writer/Wservices.cxx |   16 
 connectivity/source/inc/writer/WCatalog.hxx  |2 -
 connectivity/source/inc/writer/WConnection.hxx   |   29 +++
 connectivity/source/inc/writer/WDatabaseMetaData.hxx |6 +--
 connectivity/source/inc/writer/WDriver.hxx   |6 +--
 connectivity/source/inc/writer/WTable.hxx|8 ++--
 connectivity/source/inc/writer/WTables.hxx   |4 +-
 include/connectivity/CommonTools.hxx |6 +--
 12 files changed, 55 insertions(+), 59 deletions(-)

New commits:
commit 74b3924a98dfeeec719f7bc27a2e0a2e1a597167
Author: Miklos Vajna 
Date:   Thu Jan 11 08:35:48 2018 +0100

connectivity: various small cleanups in the Writer driver

Change-Id: I91735c3e92262fd37966c53f973d5eee1522cd61
Reviewed-on: https://gerrit.libreoffice.org/47741
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins 

diff --git a/connectivity/source/drivers/writer/WConnection.cxx 
b/connectivity/source/drivers/writer/WConnection.cxx
index d0e6b2983c14..bbcd869f2271 100644
--- a/connectivity/source/drivers/writer/WConnection.cxx
+++ b/connectivity/source/drivers/writer/WConnection.cxx
@@ -34,10 +34,10 @@
 #include 
 #include 
 
-typedef connectivity::file::OConnection OConnection_BASE;
-
 using namespace ::com::sun::star;
 
+using OConnection_BASE = connectivity::file::OConnection;
+
 namespace connectivity
 {
 namespace writer
@@ -45,20 +45,17 @@ namespace writer
 
 OWriterConnection::OWriterConnection(ODriver* _pDriver) : 
OConnection(_pDriver),m_nDocCount(0)
 {
-// m_aFilenameExtension is not used
 }
 
-OWriterConnection::~OWriterConnection()
-{
-}
+OWriterConnection::~OWriterConnection() = default;
 
-void OWriterConnection::construct(const OUString& url,const uno::Sequence< 
beans::PropertyValue >& info)
+void OWriterConnection::construct(const OUString& rURL, const uno::Sequence< 
beans::PropertyValue >& rInfo)
 {
 //  open file
 
-sal_Int32 nLen = url.indexOf(':');
-nLen = url.indexOf(':',nLen+1);
-OUString aDSN(url.copy(nLen+1));
+sal_Int32 nLen = rURL.indexOf(':');
+nLen = rURL.indexOf(':',nLen+1);
+OUString aDSN(rURL.copy(nLen+1));
 
 m_aFileName = aDSN;
 INetURLObject aURL;
@@ -78,8 +75,8 @@ void OWriterConnection::construct(const OUString& url,const 
uno::Sequence< beans
 m_sPassword.clear();
 const char pPwd[] = "password";
 
-const beans::PropertyValue* pIter  = info.getConstArray();
-const beans::PropertyValue* pEnd   = pIter + info.getLength();
+const beans::PropertyValue* pIter  = rInfo.getConstArray();
+const beans::PropertyValue* pEnd   = pIter + rInfo.getLength();
 for (; pIter != pEnd; ++pIter)
 {
 if (pIter->Name == pPwd)
@@ -210,7 +207,7 @@ css::uno::Reference< css::sdbcx::XTablesSupplier > 
OWriterConnection::createCata
 uno::Reference< css::sdbcx::XTablesSupplier > xTab = m_xCatalog;
 if (!xTab.is())
 {
-OWriterCatalog* pCat = new OWriterCatalog(this);
+auto pCat = new OWriterCatalog(this);
 xTab = pCat;
 m_xCatalog = xTab;
 }
diff --git a/connectivity/source/drivers/writer/WDatabaseMetaData.cxx 
b/connectivity/source/drivers/writer/WDatabaseMetaData.cxx
index 5dcad41d3eb2..f811205666a2 100644
--- a/connectivity/source/drivers/writer/WDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/writer/WDatabaseMetaData.cxx
@@ -32,9 +32,7 @@ 
OWriterDatabaseMetaData::OWriterDatabaseMetaData(file::OConnection* pConnection)
 {
 }
 
-OWriterDatabaseMetaData::~OWriterDatabaseMetaData()
-{
-}
+OWriterDatabaseMetaData::~OWriterDatabaseMetaData() = default;
 
 OUString SAL_CALL OWriterDatabaseMetaData::getURL()
 {
@@ -50,7 +48,7 @@ uno::Reference SAL_CALL 
OWriterDatabaseMetaData::getTables(
 {
 ::osl::MutexGuard aGuard(m_aMutex);
 
-ODatabaseMetaDataResultSet* pResult = new 
ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTables);
+auto pResult = new 
ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTables);
 uno::Reference xRef = pResult;
 
 // check if ORowSetValue type is given
diff --git a/connectivity/source/drivers/writer/WDriver.cxx 
b/connectivity/source/drivers/writer/WDriver.cxx
index d07d2f326b31..55b5111b7e55 100644
--- a/connectivity/source/drivers/writer/WDriver.cxx
+++ b/connectivity/source/drivers/writer/WDriver.cxx
@@ -60,7 +60,7 @@ uno::Reference< sdbc::XConnection > SAL_CALL 
ODriver::connect(const OUString& ur
 if (! acceptsURL(url))
 return nullptr;
 
-OWriterConnection* pCon = new 

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

2017-12-28 Thread Noel Grandin
 connectivity/source/commontools/RowFunctionParser.cxx |2 +-
 connectivity/source/commontools/TTableHelper.cxx  |   10 +-
 connectivity/source/commontools/statementcomposer.cxx |2 +-
 connectivity/source/inc/RowFunctionParser.hxx |2 +-
 include/connectivity/TTableHelper.hxx |   10 +-
 include/connectivity/statementcomposer.hxx|2 +-
 sdext/source/presenter/PresenterPaneBorderPainter.cxx |4 ++--
 ucb/source/cacher/cachedcontentresultset.cxx  |2 +-
 ucb/source/cacher/cachedcontentresultset.hxx  |2 +-
 ucb/source/core/providermap.hxx   |4 ++--
 ucb/source/ucp/webdav-neon/NeonSession.hxx|2 +-
 11 files changed, 21 insertions(+), 21 deletions(-)

New commits:
commit 31f71635a136daf36d554e0c20db9ae0d1686c23
Author: Noel Grandin 
Date:   Thu Dec 28 13:48:31 2017 +0200

loplugin:passstuffbyref improved return in ucb,connectivity

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

diff --git a/connectivity/source/commontools/RowFunctionParser.cxx 
b/connectivity/source/commontools/RowFunctionParser.cxx
index 2b3fa75b324c..afdbac9c9a52 100644
--- a/connectivity/source/commontools/RowFunctionParser.cxx
+++ b/connectivity/source/commontools/RowFunctionParser.cxx
@@ -400,7 +400,7 @@ const ParserContextSharedPtr& getParserContext()
 
 }
 
-std::shared_ptr FunctionParser::parseFunction( const OUString& 
_sFunction)
+std::shared_ptr const & FunctionParser::parseFunction( const 
OUString& _sFunction)
 {
 // TODO(Q1): Check if a combination of the RTL_UNICODETOTEXT_FLAGS_*
 // gives better conversion robustness here (we might want to map space
diff --git a/connectivity/source/commontools/TTableHelper.cxx 
b/connectivity/source/commontools/TTableHelper.cxx
index a30a19985394..2124e3366b08 100644
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ b/connectivity/source/commontools/TTableHelper.cxx
@@ -594,27 +594,27 @@ OUString OTableHelper::getTypeCreatePattern() const
 return OUString();
 }
 
-Reference< XConnection> OTableHelper::getConnection() const
+Reference< XConnection> const & OTableHelper::getConnection() const
 {
 return m_pImpl->m_xConnection;
 }
 
-Reference< css::sdb::tools::XTableRename>  
OTableHelper::getRenameService() const
+Reference< css::sdb::tools::XTableRename> const & 
OTableHelper::getRenameService() const
 {
 return m_pImpl->m_xRename;
 }
 
-Reference< css::sdb::tools::XTableAlteration>  OTableHelper::getAlterService() 
const
+Reference< css::sdb::tools::XTableAlteration> const & 
OTableHelper::getAlterService() const
 {
 return m_pImpl->m_xAlter;
 }
 
-Reference< css::sdb::tools::XKeyAlteration>  OTableHelper::getKeyService() 
const
+Reference< css::sdb::tools::XKeyAlteration> const & 
OTableHelper::getKeyService() const
 {
 return m_pImpl->m_xKeyAlter;
 }
 
-Reference< css::sdb::tools::XIndexAlteration>  OTableHelper::getIndexService() 
const
+Reference< css::sdb::tools::XIndexAlteration> const & 
OTableHelper::getIndexService() const
 {
 return m_pImpl->m_xIndexAlter;
 }
diff --git a/connectivity/source/commontools/statementcomposer.cxx 
b/connectivity/source/commontools/statementcomposer.cxx
index f72afe40f2c1..499e7f167e39 100644
--- a/connectivity/source/commontools/statementcomposer.cxx
+++ b/connectivity/source/commontools/statementcomposer.cxx
@@ -266,7 +266,7 @@ namespace dbtools
 }
 
 
-Reference< XSingleSelectQueryComposer > StatementComposer::getComposer()
+Reference< XSingleSelectQueryComposer > const & 
StatementComposer::getComposer()
 {
 lcl_ensureUpToDateComposer_nothrow( *m_pData );
 return m_pData->xComposer;
diff --git a/connectivity/source/inc/RowFunctionParser.hxx 
b/connectivity/source/inc/RowFunctionParser.hxx
index df2c7ba2bf4e..b338d34e2cfe 100644
--- a/connectivity/source/inc/RowFunctionParser.hxx
+++ b/connectivity/source/inc/RowFunctionParser.hxx
@@ -97,7 +97,7 @@ public:
 @return the generated function object.
*/
 
-static std::shared_ptr parseFunction( const OUString& 
_sFunction);
+static std::shared_ptr const & parseFunction( const 
OUString& _sFunction);
 
 private:
 // disabled constructor/destructor, since this is
diff --git a/include/connectivity/TTableHelper.hxx 
b/include/connectivity/TTableHelper.hxx
index aa462dd50fc3..54d941421860 100644
--- a/include/connectivity/TTableHelper.hxx
+++ b/include/connectivity/TTableHelper.hxx
@@ -136,7 +136,7 @@ namespace connectivity
 );
 
 virtual css::uno::Reference< css::sdbc::XDatabaseMetaData> 
getMetaData() const override;
-css::uno::Reference< css::sdbc::XConnection> getConnection() const;
+css::uno::Reference< css::sdbc::XConnection> const 

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

2017-11-07 Thread Noel Grandin
 connectivity/source/cpool/ZDriverWrapper.hxx  |5 +--
 connectivity/source/drivers/evoab2/NColumns.hxx   |3 --
 connectivity/source/drivers/evoab2/NDriver.hxx|4 --
 connectivity/source/drivers/evoab2/NPreparedStatement.hxx |9 +-
 connectivity/source/drivers/evoab2/NResultSet.hxx |4 --
 connectivity/source/drivers/mork/MColumns.hxx |3 --
 connectivity/source/drivers/mork/MConnection.hxx  |4 --
 connectivity/source/drivers/mork/MPreparedStatement.hxx   |6 +---
 connectivity/source/drivers/mork/MQueryHelper.hxx |8 ++---
 connectivity/source/drivers/mork/MorkParser.hxx   |7 ++--
 connectivity/source/drivers/postgresql/pq_updateableresultset.hxx |4 +-
 connectivity/source/drivers/postgresql/pq_xcolumns.hxx|4 +-
 connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx   |8 ++---
 connectivity/source/drivers/postgresql/pq_xindexes.hxx|8 ++---
 connectivity/source/drivers/postgresql/pq_xkeycolumns.hxx |4 +-
 connectivity/source/drivers/postgresql/pq_xkeys.hxx   |8 ++---
 connectivity/source/drivers/postgresql/pq_xusers.hxx  |   15 
+-
 connectivity/source/inc/ParameterSubstitution.hxx |4 +-
 connectivity/source/inc/TKeyValue.hxx |4 --
 connectivity/source/inc/file/fcomp.hxx|4 +-
 connectivity/source/inc/hsqldb/HDriver.hxx|4 +-
 connectivity/source/inc/hsqldb/HTables.hxx|3 --
 connectivity/source/inc/hsqldb/HViews.hxx |5 +--
 connectivity/source/inc/java/LocalRef.hxx |3 --
 connectivity/source/inc/java/io/Reader.hxx|3 --
 connectivity/source/inc/java/sql/ResultSetMetaData.hxx|3 --
 connectivity/source/inc/mysql/YTables.hxx |3 --
 connectivity/source/inc/mysql/YViews.hxx  |4 --
 connectivity/source/inc/odbc/ODatabaseMetaData.hxx|3 --
 connectivity/source/inc/odbc/OPreparedStatement.hxx   |4 --
 connectivity/source/inc/odbc/OResultSetMetaData.hxx   |3 --
 connectivity/source/manager/mdrivermanager.hxx|5 +--
 include/connectivity/dbexception.hxx  |7 ++--
 include/connectivity/sqliterator.hxx  |7 
 34 files changed, 67 insertions(+), 106 deletions(-)

New commits:
commit ded02dafbce173f2f1a23e10deee8002f73317b2
Author: Noel Grandin 
Date:   Tue Nov 7 10:08:18 2017 +0200

loplugin:finalclasses in connectivity

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

diff --git a/connectivity/source/cpool/ZDriverWrapper.hxx 
b/connectivity/source/cpool/ZDriverWrapper.hxx
index 23c5c8d753bf..854542c31c76 100644
--- a/connectivity/source/cpool/ZDriverWrapper.hxx
+++ b/connectivity/source/cpool/ZDriverWrapper.hxx
@@ -34,9 +34,8 @@ namespace connectivity
 
 typedef ::cppu::WeakImplHelper< css::sdbc::XDriver >  ODriverWrapper_BASE;
 
-class ODriverWrapper : public ODriverWrapper_BASE
+class ODriverWrapper final : public ODriverWrapper_BASE
 {
-protected:
 css::uno::Reference< css::uno::XAggregation >
 m_xDriverAggregate;
 css::uno::Reference< css::sdbc::XDriver >
@@ -58,7 +57,7 @@ namespace connectivity
 // XInterface
 virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& 
aType ) override;
 
-protected:
+private:
 /// dtor
 virtual ~ODriverWrapper() override;
 // XDriver
diff --git a/connectivity/source/drivers/evoab2/NColumns.hxx 
b/connectivity/source/drivers/evoab2/NColumns.hxx
index e7e2065a5ac5..2f04047fb78c 100644
--- a/connectivity/source/drivers/evoab2/NColumns.hxx
+++ b/connectivity/source/drivers/evoab2/NColumns.hxx
@@ -27,9 +27,8 @@ namespace connectivity
 {
 namespace evoab
 {
-class OEvoabColumns : public sdbcx::OCollection
+class OEvoabColumns final : public sdbcx::OCollection
 {
-protected:
 OEvoabTable*m_pTable;
 
 virtual sdbcx::ObjectType createObject(const OUString& _rName) 
override;
diff --git a/connectivity/source/drivers/evoab2/NDriver.hxx 
b/connectivity/source/drivers/evoab2/NDriver.hxx
index 788eed1d4b05..df7cd46c6e3c 100644
--- a/connectivity/source/drivers/evoab2/NDriver.hxx
+++ b/connectivity/source/drivers/evoab2/NDriver.hxx
@@ -41,10 +41,8 @@ namespace connectivity

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

2017-01-16 Thread Noel Grandin
 connectivity/source/commontools/TIndex.cxx |4 ++--
 connectivity/source/commontools/TKey.cxx   |4 ++--
 connectivity/source/drivers/ado/AGroup.cxx |2 +-
 connectivity/source/drivers/ado/AIndex.cxx |2 +-
 connectivity/source/drivers/ado/AKey.cxx   |2 +-
 connectivity/source/drivers/ado/AUser.cxx  |2 +-
 connectivity/source/drivers/dbase/DIndex.cxx   |2 +-
 connectivity/source/drivers/dbase/dindexnode.cxx   |3 +--
 connectivity/source/drivers/mork/MDatabaseMetaData.cxx |3 +--
 connectivity/source/drivers/mork/MDatabaseMetaData.hxx |3 ++-
 connectivity/source/inc/dbase/dindexnode.hxx   |3 ++-
 connectivity/source/sdbcx/VGroup.cxx   |3 +--
 connectivity/source/sdbcx/VIndex.cxx   |3 +--
 connectivity/source/sdbcx/VKey.cxx |3 +--
 connectivity/source/sdbcx/VUser.cxx|3 +--
 include/connectivity/sdbcx/VGroup.hxx  |2 +-
 include/connectivity/sdbcx/VIndex.hxx  |2 +-
 include/connectivity/sdbcx/VKey.hxx|2 +-
 include/connectivity/sdbcx/VUser.hxx   |2 +-
 19 files changed, 23 insertions(+), 27 deletions(-)

New commits:
commit d9884a62a23b2a410e5b364308e06c37a67f9422
Author: Noel Grandin 
Date:   Mon Jan 16 09:21:14 2017 +0200

new loplugin: useuniqueptr: connectivity

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

diff --git a/connectivity/source/commontools/TIndex.cxx 
b/connectivity/source/commontools/TIndex.cxx
index 88f5d68..0adbc70 100644
--- a/connectivity/source/commontools/TIndex.cxx
+++ b/connectivity/source/commontools/TIndex.cxx
@@ -37,7 +37,7 @@ OIndexHelper::OIndexHelper( OTableHelper* _pTable) : 
connectivity::sdbcx::OIndex
 {
 construct();
 ::std::vector< OUString> aVector;
-m_pColumns  = new OIndexColumns(this,m_aMutex,aVector);
+m_pColumns.reset( new OIndexColumns(this,m_aMutex,aVector) );
 }
 
 OIndexHelper::OIndexHelper( OTableHelper* _pTable,
@@ -93,7 +93,7 @@ void OIndexHelper::refreshColumns()
 if(m_pColumns)
 m_pColumns->reFill(aVector);
 else
-m_pColumns  = new OIndexColumns(this,m_aMutex,aVector);
+m_pColumns.reset( new OIndexColumns(this,m_aMutex,aVector) );
 }
 
 
diff --git a/connectivity/source/commontools/TKey.cxx 
b/connectivity/source/commontools/TKey.cxx
index 057dce0..783aa53 100644
--- a/connectivity/source/commontools/TKey.cxx
+++ b/connectivity/source/commontools/TKey.cxx
@@ -98,9 +98,9 @@ void OTableKeyHelper::refreshColumns()
 
 
 if ( m_pColumns )
-m_pColumns ->reFill(aVector);
+m_pColumns->reFill(aVector);
 else
-m_pColumns  = new OKeyColumnsHelper(this,m_aMutex,aVector);
+m_pColumns.reset( new OKeyColumnsHelper(this,m_aMutex,aVector) );
 }
 
 
diff --git a/connectivity/source/drivers/ado/AGroup.cxx 
b/connectivity/source/drivers/ado/AGroup.cxx
index 2ff16b1..ab1eb1f 100644
--- a/connectivity/source/drivers/ado/AGroup.cxx
+++ b/connectivity/source/drivers/ado/AGroup.cxx
@@ -79,7 +79,7 @@ void OAdoGroup::refreshUsers()
 if(m_pUsers)
 m_pUsers->reFill(aVector);
 else
-m_pUsers = new 
OUsers(m_pCatalog,m_aMutex,aVector,aUsers,isCaseSensitive());
+m_pUsers.reset( new 
OUsers(m_pCatalog,m_aMutex,aVector,aUsers,isCaseSensitive()) );
 }
 
 Sequence< sal_Int8 > OAdoGroup::getUnoTunnelImplementationId()
diff --git a/connectivity/source/drivers/ado/AIndex.cxx 
b/connectivity/source/drivers/ado/AIndex.cxx
index d5b4417..b907873 100644
--- a/connectivity/source/drivers/ado/AIndex.cxx
+++ b/connectivity/source/drivers/ado/AIndex.cxx
@@ -68,7 +68,7 @@ void OAdoIndex::refreshColumns()
 if ( m_pColumns )
 m_pColumns->reFill(aVector);
 else
-m_pColumns = new 
OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection);
+m_pColumns.reset( new 
OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection) );
 }
 
 
diff --git a/connectivity/source/drivers/ado/AKey.cxx 
b/connectivity/source/drivers/ado/AKey.cxx
index 8c3657d..cc1e13c 100644
--- a/connectivity/source/drivers/ado/AKey.cxx
+++ b/connectivity/source/drivers/ado/AKey.cxx
@@ -64,7 +64,7 @@ void OAdoKey::refreshColumns()
 if(m_pColumns)
 m_pColumns->reFill(aVector);
 else
-m_pColumns = new 
OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection);
+m_pColumns.reset( new 
OColumns(*this,m_aMutex,aVector,aColumns,isCaseSensitive(),m_pConnection) );
 }
 
 Sequence< sal_Int8 > OAdoKey::getUnoTunnelImplementationId()
diff --git a/connectivity/source/drivers/ado/AUser.cxx 

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

2017-01-05 Thread Stephan Bergmann
 connectivity/source/commontools/filtermanager.cxx |   22 +++---
 include/connectivity/filtermanager.hxx|2 +-
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 21033d04fd55470cb8b693bca4af2058da2a8dcc
Author: Stephan Bergmann 
Date:   Thu Jan 5 14:24:28 2017 +0100

Clean up a usage of OUStringBuffer

Change-Id: I8435865f1a67a3a6d889c1b8a3d30e632ffc61fd

diff --git a/connectivity/source/commontools/filtermanager.cxx 
b/connectivity/source/commontools/filtermanager.cxx
index 63fe39c..ba2d2df 100644
--- a/connectivity/source/commontools/filtermanager.cxx
+++ b/connectivity/source/commontools/filtermanager.cxx
@@ -120,7 +120,7 @@ namespace dbtools
 }
 
 
-bool FilterManager::isThereAtMostOneComponent( OUStringBuffer& 
o_singleComponent ) const
+bool FilterManager::isThereAtMostOneComponent( OUString& o_singleComponent 
) const
 {
 if (m_bApplyPublicFilter) {
 if (!m_aPublicFilterComponent.isEmpty() && 
!m_aLinkFilterComponent.isEmpty())
@@ -130,13 +130,13 @@ namespace dbtools
 else if (!m_aLinkFilterComponent.isEmpty())
 o_singleComponent = m_aLinkFilterComponent;
 else
-o_singleComponent.setLength(0);
+o_singleComponent.clear();
 return true;
 }
 else
 {
 if (m_aLinkFilterComponent.isEmpty())
-o_singleComponent.setLength(0);
+o_singleComponent.clear();
 else
 o_singleComponent = m_aLinkFilterComponent;
 return true;
@@ -146,17 +146,17 @@ namespace dbtools
 
 OUString FilterManager::getComposedFilter( ) const
 {
-OUStringBuffer aComposedFilter;
-
 // if we have only one non-empty component, then there's no need to 
compose anything
-if ( !isThereAtMostOneComponent( aComposedFilter ) )
+OUString singleComponent;
+if ( isThereAtMostOneComponent( singleComponent ) )
 {
-// append the single components
-if (m_bApplyPublicFilter)
-appendFilterComponent( aComposedFilter, 
m_aPublicFilterComponent );
-appendFilterComponent( aComposedFilter, m_aLinkFilterComponent );
+return singleComponent;
 }
-
+// append the single components
+OUStringBuffer aComposedFilter(singleComponent);
+if (m_bApplyPublicFilter)
+appendFilterComponent( aComposedFilter, m_aPublicFilterComponent );
+appendFilterComponent( aComposedFilter, m_aLinkFilterComponent );
 return aComposedFilter.makeStringAndClear();
 }
 
diff --git a/include/connectivity/filtermanager.hxx 
b/include/connectivity/filtermanager.hxx
index 73e9e87..4999ded 100644
--- a/include/connectivity/filtermanager.hxx
+++ b/include/connectivity/filtermanager.hxx
@@ -97,7 +97,7 @@ namespace dbtools
 static void  appendFilterComponent( OUStringBuffer& io_appendTo, 
const OUString& i_component );
 
 /// checks whether there is only one (or even no) non-empty filter 
component
-boolisThereAtMostOneComponent( OUStringBuffer& o_singleComponent ) 
const;
+boolisThereAtMostOneComponent( OUString& o_singleComponent ) const;
 };
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-08-25 Thread Noel Grandin
 connectivity/source/commontools/FValue.cxx |   17 +
 include/connectivity/FValue.hxx|1 +
 2 files changed, 18 insertions(+)

New commits:
commit 0e74870782bd46a9654e63e19d081528fcccb6fa
Author: Noel Grandin 
Date:   Thu Aug 25 10:42:11 2016 +0200

cid#1371320 Missing move assignment operator

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

diff --git a/connectivity/source/commontools/FValue.cxx 
b/connectivity/source/commontools/FValue.cxx
index 62861bf..974363f 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -464,6 +464,23 @@ ORowSetValue& ORowSetValue::operator=(const ORowSetValue& 
_rRH)
 return *this;
 }
 
+ORowSetValue& ORowSetValue::operator=(ORowSetValue&& _rRH)
+{
+if ( m_eTypeKind != _rRH.m_eTypeKind || !m_bNull)
+free();
+if(!_rRH.m_bNull)
+{
+m_aValue= _rRH.m_aValue;
+memset(&_rRH.m_aValue, 0, sizeof(_rRH.m_aValue));
+}
+m_bBound= _rRH.m_bBound;
+m_eTypeKind = _rRH.m_eTypeKind;
+m_bSigned   = _rRH.m_bSigned;
+m_bNull = _rRH.m_bNull;
+_rRH.m_bNull = true;
+return *this;
+}
+
 
 ORowSetValue& ORowSetValue::operator=(const Date& _rRH)
 {
diff --git a/include/connectivity/FValue.hxx b/include/connectivity/FValue.hxx
index 55341f8..3964f3a 100644
--- a/include/connectivity/FValue.hxx
+++ b/include/connectivity/FValue.hxx
@@ -286,6 +286,7 @@ namespace connectivity
 {  }
 
 ORowSetValue& operator=(const ORowSetValue& _rRH);
+ORowSetValue& operator=(ORowSetValue&& _rRH);
 
 // simple types
 ORowSetValue& operator=(bool _rRH);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-07-12 Thread Stephan Bergmann
 connectivity/source/commontools/dbtools.cxx |   10 --
 include/connectivity/OSubComponent.hxx  |4 ++--
 2 files changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 9624bde1c36a3c1b86d8d88f97bc729ac4d65853
Author: Stephan Bergmann 
Date:   Tue Jul 12 15:05:41 2016 +0200

tdf#100866: Don't let exception pass connectivity::release

...which is only ever called from onexcept XInterface::release overrides:
connectivity::release itself appears to be only called from
connectivity::OSubComponent::relase_ChildImpl [sic], which in turn is only
called from various XInterface::release overrides across connectivity.

Change-Id: I94b682ec531acecd0ef9f8c100f67a71c361941e

diff --git a/connectivity/source/commontools/dbtools.cxx 
b/connectivity/source/commontools/dbtools.cxx
index 701c64d..1c1dbfe 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -1965,7 +1965,7 @@ namespace connectivity
 void release(oslInterlockedCount& _refCount,
  ::cppu::OBroadcastHelper& rBHelper,
  Reference< XInterface >& _xInterface,
- css::lang::XComponent* _pObject)
+ css::lang::XComponent* _pObject) throw ()
 {
 if (osl_atomic_decrement( &_refCount ) == 0)
 {
@@ -1982,7 +1982,13 @@ void release(oslInterlockedCount& _refCount,
 }
 
 // First dispose
-_pObject->dispose();
+try {
+_pObject->dispose();
+} catch (css::uno::RuntimeException & e) {
+SAL_WARN(
+"connectivity.commontools",
+"Caught exception during dispose, " << e.Message);
+}
 
 // only the alive ref holds the object
 OSL_ASSERT( _refCount == 1 );
diff --git a/include/connectivity/OSubComponent.hxx 
b/include/connectivity/OSubComponent.hxx
index 8f80e8e..1955c54 100644
--- a/include/connectivity/OSubComponent.hxx
+++ b/include/connectivity/OSubComponent.hxx
@@ -43,7 +43,7 @@ namespace connectivity
 void release(oslInterlockedCount& _refCount,
  ::cppu::OBroadcastHelper& rBHelper,
  css::uno::Reference< css::uno::XInterface >& _xInterface,
- css::lang::XComponent* _pObject);
+ css::lang::XComponent* _pObject) throw ();
 
 // OSubComponent
 
@@ -70,7 +70,7 @@ namespace connectivity
 ::osl::MutexGuard aGuard( 
m_pDerivedImplementation->WEAK::rBHelper.rMutex );
 m_xParent.clear();
 }
-void relase_ChildImpl()
+void relase_ChildImpl() throw ()
 {
 #if 0
 ::connectivity::release(m_pDerivedImplementation->m_refCount,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-06-06 Thread Xisco Fauli
 connectivity/source/commontools/TColumnsHelper.cxx |5 +
 include/connectivity/TColumnsHelper.hxx|2 +-
 2 files changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 8a9559c59c0ee78cdab929b3e01fcd4bc9d569b2
Author: Xisco Fauli 
Date:   Sat Jun 4 23:14:20 2016 +0200

tdf#89329: use unique_ptr for pImpl in TColumnHelper

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

diff --git a/connectivity/source/commontools/TColumnsHelper.cxx 
b/connectivity/source/commontools/TColumnsHelper.cxx
index 5d6fcf8..6cf821b 100644
--- a/connectivity/source/commontools/TColumnsHelper.cxx
+++ b/connectivity/source/commontools/TColumnsHelper.cxx
@@ -64,15 +64,12 @@ OColumnsHelper::OColumnsHelper( ::cppu::OWeakObject& 
_rParent
 ,const TStringVector &_rVector
 ,bool _bUseHardRef
 ) : 
OCollection(_rParent,_bCase,_rMutex,_rVector,false,_bUseHardRef)
-,m_pImpl(nullptr)
 ,m_pTable(nullptr)
 {
 }
 
 OColumnsHelper::~OColumnsHelper()
 {
-delete m_pImpl;
-m_pImpl = nullptr;
 }
 
 
@@ -82,7 +79,7 @@ sdbcx::ObjectType OColumnsHelper::createObject(const 
OUString& _rName)
 Reference xConnection = m_pTable->getConnection();
 
 if ( !m_pImpl )
-m_pImpl = new OColumnsHelperImpl(isCaseSensitive());
+m_pImpl.reset(new OColumnsHelperImpl(isCaseSensitive()));
 
 bool bQueryInfo = true;
 bool bAutoIncrement = false;
diff --git a/include/connectivity/TColumnsHelper.hxx 
b/include/connectivity/TColumnsHelper.hxx
index 0c970ae..d4e5296 100644
--- a/include/connectivity/TColumnsHelper.hxx
+++ b/include/connectivity/TColumnsHelper.hxx
@@ -33,7 +33,7 @@ namespace connectivity
 */
 class OOO_DLLPUBLIC_DBTOOLS OColumnsHelper : public sdbcx::OCollection
 {
-OColumnsHelperImpl* m_pImpl;
+std::unique_ptr m_pImpl;
 protected:
 OTableHelper*   m_pTable;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2016-04-06 Thread Stephan Bergmann
 connectivity/source/commontools/TIndex.cxx  |8 +-
 connectivity/source/commontools/TKey.cxx|4 -
 connectivity/source/commontools/TTableHelper.cxx|   20 +++---
 connectivity/source/commontools/dbexception.cxx |   14 ++--
 connectivity/source/commontools/dbtools.cxx |   22 +++
 connectivity/source/cpool/ZConnectionPool.hxx   |4 -
 connectivity/source/drivers/calc/CTable.cxx |   20 +++---
 connectivity/source/drivers/dbase/DTable.cxx|   20 +++---
 connectivity/source/drivers/file/FTable.cxx |   20 +++---
 connectivity/source/drivers/firebird/Connection.cxx |4 -
 connectivity/source/drivers/flat/ETable.cxx |   20 +++---
 connectivity/source/drivers/hsqldb/HConnection.cxx  |   14 ++--
 connectivity/source/drivers/hsqldb/HTable.cxx   |   20 +++---
 connectivity/source/drivers/hsqldb/HUser.cxx|4 -
 connectivity/source/drivers/jdbc/tools.cxx  |   12 ++--
 connectivity/source/drivers/macab/MacabTable.cxx|   20 +++---
 connectivity/source/drivers/macab/MacabTable.hxx|   10 +--
 connectivity/source/drivers/mork/MTable.cxx |4 -
 connectivity/source/drivers/mork/MTable.hxx |6 +-
 connectivity/source/drivers/mysql/YTable.cxx|   20 +++---
 connectivity/source/drivers/mysql/YUser.cxx |4 -
 connectivity/source/inc/calc/CTable.hxx |   10 +--
 connectivity/source/inc/dbase/DIndex.hxx|2 
 connectivity/source/inc/dbase/DTable.hxx|   10 +--
 connectivity/source/inc/file/FTable.hxx |   10 +--
 connectivity/source/inc/flat/ETable.hxx |   10 +--
 connectivity/source/inc/hsqldb/HTable.hxx   |   10 +--
 connectivity/source/inc/hsqldb/HUser.hxx|2 
 connectivity/source/inc/java/tools.hxx  |4 -
 connectivity/source/inc/mysql/YTable.hxx|   10 +--
 connectivity/source/inc/mysql/YUser.hxx |2 
 connectivity/source/inc/odbc/OPreparedStatement.hxx |2 
 connectivity/source/parse/PColumn.cxx   |   52 -
 connectivity/source/parse/internalnode.cxx  |8 +-
 connectivity/source/sdbcx/VColumn.cxx   |   58 ++--
 connectivity/source/sdbcx/VGroup.cxx|4 -
 connectivity/source/sdbcx/VIndex.cxx|8 +-
 connectivity/source/sdbcx/VIndexColumn.cxx  |   56 +--
 connectivity/source/sdbcx/VKey.cxx  |4 -
 connectivity/source/sdbcx/VKeyColumn.cxx|   56 +--
 connectivity/source/sdbcx/VTable.cxx|   16 ++---
 connectivity/source/sdbcx/VUser.cxx |4 -
 connectivity/source/sdbcx/VView.cxx |   20 +++---
 include/connectivity/CommonTools.hxx|   24 
 include/connectivity/PColumn.hxx|   26 
 include/connectivity/TIndex.hxx |4 -
 include/connectivity/TKey.hxx   |2 
 include/connectivity/TTableHelper.hxx   |   10 +--
 include/connectivity/dbexception.hxx|8 +-
 include/connectivity/sdbcx/VColumn.hxx  |   28 -
 include/connectivity/sdbcx/VGroup.hxx   |2 
 include/connectivity/sdbcx/VIndex.hxx   |4 -
 include/connectivity/sdbcx/VIndexColumn.hxx |   28 -
 include/connectivity/sdbcx/VKey.hxx |   18 +++---
 include/connectivity/sdbcx/VKeyColumn.hxx   |   28 -
 include/connectivity/sdbcx/VTable.hxx   |   10 +--
 include/connectivity/sdbcx/VUser.hxx|2 
 57 files changed, 411 insertions(+), 411 deletions(-)

New commits:
commit 5aadbc15a5ab18441026a3dfc75a35dba0146337
Author: Stephan Bergmann 
Date:   Wed Apr 6 15:30:36 2016 +0200

Avoid reserved identifiers

Change-Id: I2217920ced336189a94c0a5d1e3ac0ccd3912881

diff --git a/connectivity/source/commontools/TIndex.cxx 
b/connectivity/source/commontools/TIndex.cxx
index c6fe22e..5d7ca6a 100644
--- a/connectivity/source/commontools/TIndex.cxx
+++ b/connectivity/source/commontools/TIndex.cxx
@@ -41,13 +41,13 @@ OIndexHelper::OIndexHelper( OTableHelper* _pTable) : 
connectivity::sdbcx::OIndex
 }
 
 OIndexHelper::OIndexHelper( OTableHelper* _pTable,
-const OUString& _Name,
-const OUString& _Catalog,
+const OUString& Name,
+const OUString& Catalog,
 bool _isUnique,
 bool _isPrimaryKeyIndex,
 bool _isClustered
-) : connectivity::sdbcx::OIndex(_Name,
-  _Catalog,
+) : connectivity::sdbcx::OIndex(Name,
+  Catalog,
   _isUnique,
   _isPrimaryKeyIndex,
  

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

2016-02-08 Thread Noel Grandin
 connectivity/source/commontools/parameters.cxx |   51 +
 include/connectivity/parameters.hxx|4 -
 2 files changed, 29 insertions(+), 26 deletions(-)

New commits:
commit f2a26b7474eb77e74f056e1281a7f7df59bc341b
Author: Noel Grandin 
Date:   Sun Feb 7 11:42:18 2016 +0200

sequence->vector in ParameterManager

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

diff --git a/connectivity/source/commontools/parameters.cxx 
b/connectivity/source/commontools/parameters.cxx
index 1a034ee..d3e318c 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -102,8 +102,8 @@ namespace dbtools
 m_nInnerCount= 0;
 ParameterInformation aEmptyInfo;
 m_aParameterInformation.swap( aEmptyInfo );
-m_aMasterFields.realloc( 0 );
-m_aDetailFields.realloc( 0 );
+m_aMasterFields.clear();
+m_aDetailFields.clear();
 m_sIdentifierQuoteString.clear();
 m_sSpecialCharacters.clear();
 m_xConnectionMetadata.clear();
@@ -242,7 +242,7 @@ namespace dbtools
 void ParameterManager::classifyLinks( const Reference< XNameAccess >& 
_rxParentColumns,
 const Reference< XNameAccess >& _rxColumns, ::std::vector< OUString >& 
_out_rAdditionalFilterComponents )
 {
-OSL_PRECOND( m_aMasterFields.getLength() == 
m_aDetailFields.getLength(),
+OSL_PRECOND( m_aMasterFields.size() == m_aDetailFields.size(),
 "ParameterManager::classifyLinks: master and detail fields should 
have the same length!" );
 OSL_ENSURE( _rxColumns.is(), "ParameterManager::classifyLinks: invalid 
columns!" );
 
@@ -257,10 +257,10 @@ namespace dbtools
 bool bNeedExchangeLinks = false;
 
 // classify the links
-const OUString* pMasterFields = m_aMasterFields.getConstArray();
-const OUString* pDetailFields = m_aDetailFields.getConstArray();
-const OUString* pDetailFieldsEnd = pDetailFields + 
m_aDetailFields.getLength();
-for ( ; pDetailFields < pDetailFieldsEnd; ++pDetailFields, 
++pMasterFields )
+auto pMasterFields = m_aMasterFields.begin();
+auto pDetailFields = m_aDetailFields.begin();
+auto pDetailFieldsEnd = m_aDetailFields.end();
+for ( ; pDetailFields != pDetailFieldsEnd; ++pDetailFields, 
++pMasterFields )
 {
 if ( pMasterFields->isEmpty() || pDetailFields->isEmpty() )
 continue;
@@ -328,8 +328,8 @@ namespace dbtools
 
 if ( bNeedExchangeLinks )
 {
-m_aMasterFields = Sequence< OUString >( 
aStrippedMasterFields.data(), aStrippedMasterFields.size() );
-m_aDetailFields = Sequence< OUString >( 
aStrippedDetailFields.data(), aStrippedDetailFields.size() );
+m_aMasterFields.swap(aStrippedMasterFields);
+m_aDetailFields.swap(aStrippedDetailFields);
 }
 }
 
@@ -345,22 +345,25 @@ namespace dbtools
 {
 // the links as determined by the  properties
 Reference< XPropertySet > xProp = m_xComponent;
-OSL_ENSURE(xProp.is(),"Some already released my component!");
+OSL_ENSURE(xProp.is(),"Someone already released my component!");
 if ( xProp.is() )
 {
-xProp->getPropertyValue( 
OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MASTERFIELDS) ) >>= 
m_aMasterFields;
-xProp->getPropertyValue( 
OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DETAILFIELDS) ) >>= 
m_aDetailFields;
+Sequence aTmp;
+if (xProp->getPropertyValue( 
OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_MASTERFIELDS) ) >>= 
aTmp)
+ comphelper::sequenceToContainer(m_aMasterFields, aTmp);
+if (xProp->getPropertyValue( 
OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DETAILFIELDS) ) >>= 
aTmp)
+comphelper::sequenceToContainer(m_aDetailFields, aTmp);
 }
 
 {
 // normalize to equal length
-sal_Int32 nMasterLength = m_aMasterFields.getLength();
-sal_Int32 nDetailLength = m_aDetailFields.getLength();
+sal_Int32 nMasterLength = m_aMasterFields.size();
+sal_Int32 nDetailLength = m_aDetailFields.size();
 
 if ( nMasterLength > nDetailLength )
-m_aMasterFields.realloc( nDetailLength );
+m_aMasterFields.resize( nDetailLength );
 else if ( nDetailLength > nMasterLength )
-m_aDetailFields.realloc( nMasterLength );
+m_aDetailFields.resize( nMasterLength );
 }
 
 

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

2015-06-17 Thread Lionel Elie Mamane
 connectivity/source/commontools/parameters.cxx |   34 +
 include/connectivity/parameters.hxx|3 +-
 2 files changed, 26 insertions(+), 11 deletions(-)

New commits:
commit 09a490ddf516289b4ce2f70a19603b9590917632
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Wed Jun 17 14:32:29 2015 +0200

parameter handling: fix confusion between column name and realname

Change-Id: I81fd45276183b911e4560ca785221894ea2ebc88

diff --git a/connectivity/source/commontools/parameters.cxx 
b/connectivity/source/commontools/parameters.cxx
index 8459ae9..1f94a59 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -105,6 +105,8 @@ namespace dbtools
 m_aMasterFields.realloc( 0 );
 m_aDetailFields.realloc( 0 );
 m_sIdentifierQuoteString.clear();
+m_sSpecialCharacters.clear();
+m_xConnectionMetadata.clear();
 ::std::vector bool  aEmptyArray;
 m_aParametersVisited.swap( aEmptyArray );
 m_bUpToDate = false;
@@ -208,24 +210,32 @@ namespace dbtools
 
 
 OUString ParameterManager::createFilterConditionFromColumnLink(
-const OUString _rMasterColumn, const OUString _rDetailLink, 
OUString _rNewParamName )
+const OUString _rMasterColumn, const Reference  XPropertySet  
xDetailField, OUString o_rNewParamName )
 {
 OUString sFilter;
-
 // format is:
 // detail_column = :new_param_name
-sFilter = quoteName( m_sIdentifierQuoteString, _rDetailLink );
-sFilter +=  = :;
+{
+OUString tblName;
+xDetailField-getPropertyValue(TableName) = tblName;
+if (!tblName.isEmpty())
+sFilter = ::dbtools::quoteTableName( m_xConnectionMetadata, 
tblName, ::dbtools::eInDataManipulation ) + .;
+}
+{
+OUString colName;
+xDetailField-getPropertyValue(RealName) = colName;
+sFilter += quoteName( m_sIdentifierQuoteString, colName ) +  = :;
+}
 
 // generate a parameter name which is not already used
-_rNewParamName = link_from_;
-_rNewParamName += convertName2SQLName( _rMasterColumn, 
m_sSpecialCharacters );
-while ( m_aParameterInformation.find( _rNewParamName ) != 
m_aParameterInformation.end() )
+o_rNewParamName = link_from_;
+o_rNewParamName += convertName2SQLName( _rMasterColumn, 
m_sSpecialCharacters );
+while ( m_aParameterInformation.find( o_rNewParamName ) != 
m_aParameterInformation.end() )
 {
-_rNewParamName += _;
+o_rNewParamName += _;
 }
 
-return sFilter += _rNewParamName;
+return sFilter += o_rNewParamName;
 }
 
 
@@ -279,8 +289,11 @@ namespace dbtools
 // does the detail name denote a column?
 if ( _rxColumns-hasByName( *pDetailFields ) )
 {
+Reference XPropertySet  
xDetailField(_rxColumns-getByName( *pDetailFields ), UNO_QUERY);
+assert(xDetailField.is());
+
 OUString sNewParamName;
-const OUString sFilterCondition = 
createFilterConditionFromColumnLink( *pMasterFields, *pDetailFields, 
sNewParamName );
+const OUString sFilterCondition = 
createFilterConditionFromColumnLink( *pMasterFields, xDetailField, 
sNewParamName );
 OSL_PRECOND( !sNewParamName.isEmpty(), 
ParameterManager::classifyLinks: createFilterConditionFromColumnLink returned 
nonsense! );
 
 // remember meta information about this new parameter
@@ -754,6 +767,7 @@ namespace dbtools
 xMeta = xConnection-getMetaData();
 if ( xMeta.is() )
 {
+m_xConnectionMetadata = xMeta;
 m_sIdentifierQuoteString = xMeta-getIdentifierQuoteString();
 m_sSpecialCharacters = xMeta-getExtraNameCharacters();
 }
diff --git a/include/connectivity/parameters.hxx 
b/include/connectivity/parameters.hxx
index dce18c7..ce49959 100644
--- a/include/connectivity/parameters.hxx
+++ b/include/connectivity/parameters.hxx
@@ -126,6 +126,7 @@ namespace dbtools
 
 OUString m_sIdentifierQuoteString;
 OUString m_sSpecialCharacters;
+::com::sun::star::uno::Reference 
::com::sun::star::sdbc::XDatabaseMetaData  m_xConnectionMetadata;
 
 ::std::vector boolm_aParametersVisited;
 
@@ -244,7 +245,7 @@ namespace dbtools
 OUString
 createFilterConditionFromColumnLink(
 const OUString /* [in]  */ _rMasterColumn,
-const OUString /* [in]  */ _rDetailColumn,
+const ::com::sun::star::uno::Reference 
::com::sun::star::beans::XPropertySet  /* [in]  */ xDetailColumn,
   OUString /* [out] */ 

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

2015-06-08 Thread Stephan Bergmann
 connectivity/source/parse/sqlflex.l   |   10 +-
 connectivity/source/parse/sqlnode.cxx |   10 +-
 include/connectivity/sqlscan.hxx  |   12 ++--
 3 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit 615f4b23c62b43360e7a29735bf07091bd5a73a2
Author: Stephan Bergmann sberg...@redhat.com
Date:   Mon Jun 8 12:55:36 2015 +0200

loplugin:staticmethods

Change-Id: I22af41840410ee78aee739e0dec49bb43cda874b

diff --git a/connectivity/source/parse/sqlflex.l 
b/connectivity/source/parse/sqlflex.l
index 1e50927..be74010 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -788,11 +788,11 @@ IParseContext::InternationalKeyCode 
OSQLScanner::getInternationalTokenID(const s
 return (m_bInternational) ? 
m_pContext-getIntlKeyCode(::rtl::OString(sToken) ) : IParseContext::KEY_NONE;
 }
 // -
-sal_Int32  OSQLScanner::GetGERRule() const { return PREDICATE_GER; 
}
-sal_Int32  OSQLScanner::GetENGRule() const { return PREDICATE_ENG; 
}
-sal_Int32  OSQLScanner::GetSQLRule() const { return SQL; }
-sal_Int32  OSQLScanner::GetDATERule() const{ return DATE; }
-sal_Int32  OSQLScanner::GetSTRINGRule() const  { return STRING; }
+sal_Int32  OSQLScanner::GetGERRule()   { return PREDICATE_GER; 
}
+sal_Int32  OSQLScanner::GetENGRule()   { return PREDICATE_ENG; 
}
+sal_Int32  OSQLScanner::GetSQLRule()   { return SQL; }
+sal_Int32  OSQLScanner::GetDATERule()  { return DATE; }
+sal_Int32  OSQLScanner::GetSTRINGRule(){ return STRING; }
 // -
 void OSQLScanner::setScanner(bool _bNull)
 {
diff --git a/connectivity/source/parse/sqlnode.cxx 
b/connectivity/source/parse/sqlnode.cxx
index 5144ea8..d335027 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -1238,24 +1238,24 @@ OSQLParseNode* OSQLParser::predicateTree(OUString 
rErrorMessage, const OUString
 case DataType::DATE:
 case DataType::TIME:
 case DataType::TIMESTAMP:
-s_pScanner-SetRule(s_pScanner-GetDATERule());
+s_pScanner-SetRule(OSQLScanner::GetDATERule());
 break;
 case DataType::CHAR:
 case DataType::VARCHAR:
 case DataType::LONGVARCHAR:
 case DataType::CLOB:
-s_pScanner-SetRule(s_pScanner-GetSTRINGRule());
+s_pScanner-SetRule(OSQLScanner::GetSTRINGRule());
 break;
 default:
 if ( s_xLocaleData-getLocaleItem( m_pData-aLocale 
).decimalSeparator.toChar() == ',' )
-s_pScanner-SetRule(s_pScanner-GetGERRule());
+s_pScanner-SetRule(OSQLScanner::GetGERRule());
 else
-s_pScanner-SetRule(s_pScanner-GetENGRule());
+s_pScanner-SetRule(OSQLScanner::GetENGRule());
 }
 
 }
 else
-s_pScanner-SetRule(s_pScanner-GetSQLRule());
+s_pScanner-SetRule(OSQLScanner::GetSQLRule());
 
 s_pScanner-prepareScan(rStatement, m_pContext, true);
 
diff --git a/include/connectivity/sqlscan.hxx b/include/connectivity/sqlscan.hxx
index 009a2d6..1506c74 100644
--- a/include/connectivity/sqlscan.hxx
+++ b/include/connectivity/sqlscan.hxx
@@ -64,16 +64,16 @@ namespace connectivity
 const OUString getErrorMessage() const {return m_sErrorMessage;}
 OString getStatement() const { return m_sStatement; }
 
-sal_Int32 SQLlex();
+static sal_Int32 SQLlex();
 // set this as scanner for flex
 void setScanner(bool _bNull=false);
 // rules settings
 void SetRule(sal_Int32 nRule) {m_nRule = nRule;}
-sal_Int32   GetGERRule() const;
-sal_Int32   GetENGRule() const;
-sal_Int32   GetSQLRule() const;
-sal_Int32   GetDATERule() const;
-sal_Int32   GetSTRINGRule() const;
+static sal_Int32 GetGERRule();
+static sal_Int32 GetENGRule();
+static sal_Int32 GetSQLRule();
+static sal_Int32 GetDATERule();
+static sal_Int32 GetSTRINGRule();
 inline sal_Int32 GetCurrentPos() const { return m_nCurrentPos; }
 };
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: connectivity/source include/connectivity include/sfx2 include/sot include/svx sfx2/source sot/source svx/source sw/inc sw/source unusedcode.easy

2015-05-08 Thread Caolán McNamara
 connectivity/source/commontools/dbtools.cxx |5 -
 include/connectivity/dbtools.hxx|2 
 include/sfx2/mnuitem.hxx|   24 +-
 include/sot/stg.hxx |2 
 include/svx/dlgctrl.hxx |1 
 sfx2/source/menu/mnuitem.cxx|   93 --
 sfx2/source/sidebar/Deck.cxx|5 -
 sfx2/source/sidebar/Deck.hxx|1 
 sfx2/source/sidebar/SidebarController.cxx   |1 
 sot/source/sdstor/ucbstorage.cxx|   97 
 svx/source/dialog/dlgctrl.cxx   |   17 
 sw/inc/unotxdoc.hxx |1 
 sw/source/uibase/uno/unotxdoc.cxx   |9 --
 unusedcode.easy |3 
 14 files changed, 10 insertions(+), 251 deletions(-)

New commits:
commit efdd215124df0ab98a33525ac01a9d8ff4a542d4
Author: Caolán McNamara caol...@redhat.com
Date:   Fri May 8 09:21:42 2015 +0100

callcatcher: update unused code

Change-Id: I8563922204d3ec93bf138cbd1aaba620c0215bf7

diff --git a/connectivity/source/commontools/dbtools.cxx 
b/connectivity/source/commontools/dbtools.cxx
index adbb61f..f49bdc6 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -737,11 +737,6 @@ Sequence OUString  getFieldNamesByCommandDescriptor( 
const Reference XConnect
 return aNames;
 }
 
-SQLContext prependContextInfo(const SQLException _rException, const 
Reference XInterface  _rxContext, const OUString _rContextDescription, 
const OUString _rContextDetails)
-{
-return SQLContext( _rContextDescription, _rxContext, OUString(), 0, 
makeAny( _rException ), _rContextDetails );
-}
-
 SQLException prependErrorInfo( const SQLException _rChainedException, const 
Reference XInterface  _rxContext,
 const OUString _rAdditionalError, const StandardSQLState _eSQLState, 
const sal_Int32 _nErrorCode )
 {
diff --git a/include/connectivity/dbtools.hxx b/include/connectivity/dbtools.hxx
index 77ed4fd..02b3f06 100644
--- a/include/connectivity/dbtools.hxx
+++ b/include/connectivity/dbtools.hxx
@@ -302,8 +302,6 @@ namespace dbtools
 /** create a new ::com::sun::star::sdbc::SQLContext, fill it with the 
given descriptions and the given source,
 and iappend/i _rException (i.e. put it into the NextException 
member of the SQLContext).
 */
-OOO_DLLPUBLIC_DBTOOLS ::com::sun::star::sdb::SQLContext 
prependContextInfo(const ::com::sun::star::sdbc::SQLException _rException, 
const ::com::sun::star::uno::Reference ::com::sun::star::uno::XInterface  
_rxContext, const OUString _rContextDescription, const OUString 
_rContextDetails );
-
 OOO_DLLPUBLIC_DBTOOLS
 ::com::sun::star::sdbc::SQLException prependErrorInfo(
 const ::com::sun::star::sdbc::SQLException _rChainedException,
diff --git a/include/sfx2/mnuitem.hxx b/include/sfx2/mnuitem.hxx
index 0d40854..8e5e0cd 100644
--- a/include/sfx2/mnuitem.hxx
+++ b/include/sfx2/mnuitem.hxx
@@ -120,27 +120,13 @@ inline SfxVirtualMenu* SfxMenuControl::GetPopupMenu() 
const
{ SfxMenuControl::RegisterMenuControl( pMod, new 
SfxMenuCtrlFactory( \
 Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); }
 
-class SfxAppMenuControl_Impl : public SfxMenuControl
+struct ExecuteInfo
 {
-PopupMenu*  pMenu;
-OUStringm_sIconTheme;
-boolm_bShowMenuImages;
+::com::sun::star::uno::Reference ::com::sun::star::frame::XDispatch  
xDispatch;
+::com::sun::star::util::URL
aTargetURL;
+::com::sun::star::uno::Sequence ::com::sun::star::beans::PropertyValue   
aArgs;
 
-protected:
-DECL_LINK_TYPED( Activate, Menu *, bool ); // Needed to support high 
contrast images
-
-public:
-SfxAppMenuControl_Impl( sal_uInt16 nPos, Menu rMenu, SfxBindings 
rBindings );
-virtual ~SfxAppMenuControl_Impl();
-
-struct ExecuteInfo
-{
-::com::sun::star::uno::Reference ::com::sun::star::frame::XDispatch  
xDispatch;
-::com::sun::star::util::URL
aTargetURL;
-::com::sun::star::uno::Sequence 
::com::sun::star::beans::PropertyValue   aArgs;
-};
-
-DECL_STATIC_LINK( SfxAppMenuControl_Impl, ExecuteHdl_Impl, ExecuteInfo* );
+DECL_STATIC_LINK( ExecuteInfo, ExecuteHdl_Impl, ExecuteInfo* );
 };
 
 #endif
diff --git a/include/sot/stg.hxx b/include/sot/stg.hxx
index a6be7ce..5f4ba36 100644
--- a/include/sot/stg.hxx
+++ b/include/sot/stg.hxx
@@ -284,9 +284,7 @@ protected:
 virtual ~UCBStorage();
 public:
 static bool IsStorageFile( SvStream* );
-static bool IsDiskSpannedFile( SvStream* );
 static OUString GetLinkedFile( SvStream );
-static OUString CreateLinkFile( const OUString rName );
 
 

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

2014-09-26 Thread Lionel Elie Mamane
 connectivity/source/parse/sqlbison.y  |2 +-
 connectivity/source/parse/sqliterator.cxx |4 ++--
 include/connectivity/IParseContext.hxx|4 ++--
 svx/source/form/ParseContext.cxx  |2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 325ce86b56131f1e874e8cb2c5948fed719afe07
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Fri Sep 26 16:26:22 2014 +0200

fix build  better name for ERROR_INVALID_TABLE

Change-Id: Ic7253575859766f18869159e4a8dd6b3d715850d

diff --git a/connectivity/source/parse/sqlbison.y 
b/connectivity/source/parse/sqlbison.y
index 4d8039d..89b524c 100644
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -4329,7 +4329,7 @@ OUString OParseContext::getErrorMessage(ErrorCode _eCode) 
const
case ERROR_INVALID_INT_COMPARE: aMsg = The field can 
not be compared with a number.; break;
case ERROR_INVALID_DATE_COMPARE:aMsg = The field can 
not be compared with a date.; break;
case ERROR_INVALID_REAL_COMPARE:aMsg = The field can 
not be compared with a floating point number.; break;
-   case ERROR_INVALID_TABLE1:  aMsg = The 
database does not contain a table named \#\.; break;
+   case ERROR_INVALID_TABLE_NOSUCH:aMsg = 
The database does not contain a table named \#\.; break;
case ERROR_INVALID_TABLE_OR_QUERY:  aMsg = The database does 
contain neither a table nor a query named \#\.; break;
case ERROR_INVALID_COLUMN:  aMsg = The 
column \#1\ is unknown in the table \#2\.; break;
case ERROR_INVALID_TABLE_EXIST: aMsg = The database 
already contains a table or view with name \#\.; break;
diff --git a/connectivity/source/parse/sqliterator.cxx 
b/connectivity/source/parse/sqliterator.cxx
index 99cb341..d8fd801 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -416,13 +416,13 @@ OSQLTable OSQLParseTreeIterator::impl_locateRecordSource( 
const OUString _rComp
 // m_xQueryContainer would not have been set), so emit a 
better error message
 impl_appendError( 
IParseContext::ERROR_INVALID_TABLE_OR_QUERY, sName );
 else
-impl_appendError( IParseContext::ERROR_INVALID_TABLE1, 
sName );
+impl_appendError( IParseContext::ERROR_INVALID_NOSUCH, 
sName );
 }
 }
 }
 catch(Exception)
 {
-impl_appendError( IParseContext::ERROR_INVALID_TABLE1, sComposedName 
);
+impl_appendError( IParseContext::ERROR_INVALID_TABLE_NOSUCH, 
sComposedName );
 }
 
 return aReturn;
diff --git a/include/connectivity/IParseContext.hxx 
b/include/connectivity/IParseContext.hxx
index a012932..078ae89 100644
--- a/include/connectivity/IParseContext.hxx
+++ b/include/connectivity/IParseContext.hxx
@@ -43,12 +43,12 @@ namespace connectivity
 ERROR_INVALID_INT_COMPARE,  // The field can not be compared 
with a number.
 ERROR_INVALID_DATE_COMPARE, // The field can not be compared 
with a date.
 ERROR_INVALID_REAL_COMPARE, // The field can not be compared 
with a floating point number.
-ERROR_INVALID_TABLE1,   // The database does not contain 
a table named \#\.
+ERROR_INVALID_TABLE_NOSUCH, // The database does not contain 
a table named \#\.
 // Named like this to avoid 
conflict with a #define in the Windows system ODBC headers.
 ERROR_INVALID_TABLE_OR_QUERY,   // The database does contain 
neither a table nor a query named \#\.
 ERROR_INVALID_COLUMN,   // The column \#1\ is unknown 
in the table \#2\.
 ERROR_INVALID_TABLE_EXIST,  // The database already contains 
a table or view with name \#\.
-ERROR_INVALID_QUERY_EXIST,   // The database already contains 
a query with name \#\.;
+ERROR_INVALID_QUERY_EXIST   // The database already contains 
a query with name \#\.;
 };
 
 enumInternationalKeyCode
diff --git a/svx/source/form/ParseContext.cxx b/svx/source/form/ParseContext.cxx
index 9c3c760..0ea76ae 100644
--- a/svx/source/form/ParseContext.cxx
+++ b/svx/source/form/ParseContext.cxx
@@ -65,7 +65,7 @@ OUString OSystemParseContext::getErrorMessage(ErrorCode 
_eCode) const
 case ERROR_INVALID_INT_COMPARE: aMsg = 
SVX_RESSTR(RID_STR_SVT_SQL_SYNTAX_INT_NO_VALID); break;
 case ERROR_INVALID_DATE_COMPARE:aMsg = 
SVX_RESSTR(RID_STR_SVT_SQL_SYNTAX_ACCESS_DAT_NO_VALID); break;
 case ERROR_INVALID_REAL_COMPARE:aMsg = 
SVX_RESSTR(RID_STR_SVT_SQL_SYNTAX_REAL_NO_VALID); break;
-case ERROR_INVALID_TABLE1:   aMsg = 
SVX_RESSTR(RID_STR_SVT_SQL_SYNTAX_TABLE); break;
+  

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

2014-09-12 Thread Stephan Bergmann
 connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx|   10 -
 connectivity/source/drivers/evoab2/NDriver.cxx  |2 
 connectivity/source/drivers/evoab2/NDriver.hxx  |2 
 connectivity/source/drivers/evoab2/NResultSet.cxx   |2 
 connectivity/source/drivers/evoab2/NServices.cxx|2 
 connectivity/source/drivers/evoab2/NStatement.cxx   |2 
 connectivity/source/drivers/evoab2/NStatement.hxx   |2 
 connectivity/source/drivers/kab/KDatabaseMetaData.cxx   |   10 -
 connectivity/source/drivers/kab/KDatabaseMetaData.hxx   |2 
 connectivity/source/drivers/kab/KDriver.cxx |4 
 connectivity/source/drivers/kab/KPreparedStatement.cxx  |2 
 connectivity/source/drivers/kab/KPreparedStatement.hxx  |2 
 connectivity/source/drivers/kab/KResultSet.cxx  |2 
 connectivity/source/drivers/kab/KResultSet.hxx  |2 
 connectivity/source/drivers/kab/KServices.cxx   |2 
 connectivity/source/drivers/kab/KStatement.cxx  |   12 +-
 connectivity/source/drivers/kab/KStatement.hxx  |2 
 connectivity/source/drivers/kab/kcondition.cxx  |   64 ++--
 connectivity/source/drivers/kab/kcondition.hxx  |   42 +++
 connectivity/source/drivers/kab/korder.cxx  |2 
 connectivity/source/drivers/kab/korder.hxx  |4 
 connectivity/source/drivers/mork/MPreparedStatement.cxx |2 
 connectivity/source/drivers/mork/MPreparedStatement.hxx |2 
 connectivity/source/drivers/mork/MStatement.cxx |4 
 connectivity/source/drivers/mork/MStatement.hxx |2 
 connectivity/source/drivers/odbc/OStatement.cxx |4 
 connectivity/source/drivers/postgresql/pq_baseresultset.cxx |   18 +--
 connectivity/source/drivers/postgresql/pq_baseresultset.hxx |2 
 connectivity/source/inc/odbc/OStatement.hxx |2 
 connectivity/source/simpledbt/staticdbtools_s.cxx   |4 
 connectivity/source/simpledbt/staticdbtools_s.hxx   |4 
 include/connectivity/virtualdbtools.hxx |4 
 32 files changed, 111 insertions(+), 111 deletions(-)

New commits:
commit ed95e1c5619e2cb2a8f6d93a1b7c45f36f1524dd
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Sep 12 13:11:40 2014 +0200

connectivity: sal_Bool - bool

Change-Id: Id9458a3aa0928eedc87aec39f305b206e2638e67

diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx 
b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
index 12605cb..c53523b 100644
--- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
@@ -176,7 +176,7 @@ namespace connectivity
 guint findEvoabField(const OUString aColName)
 {
 guint nRet = (guint)-1;
-sal_Bool bFound = sal_False;
+bool bFound = false;
 initFields();
 for (guint i=0;(i  nFields)  !bFound;i++)
 {
@@ -184,7 +184,7 @@ namespace connectivity
 if (aName == aColName)
 {
 nRet = i;
-bFound = sal_True;
+bFound = true;
 }
 }
 return nRet;
@@ -1105,11 +1105,11 @@ Reference XResultSet  SAL_CALL 
OEvoabDatabaseMetaData::getTables(
 
 const OUString aTable(TABLE);
 
-sal_Bool bTableFound = sal_True;
+bool bTableFound = true;
 sal_Int32 nLength = types.getLength();
 if(nLength)
 {
-bTableFound = sal_False;
+bTableFound = false;
 
 const OUString* pBegin = types.getConstArray();
 const OUString* pEnd = pBegin + nLength;
@@ -1117,7 +1117,7 @@ Reference XResultSet  SAL_CALL 
OEvoabDatabaseMetaData::getTables(
 {
 if(*pBegin == aTable)
 {
-bTableFound = sal_True;
+bTableFound = true;
 break;
 }
 }
diff --git a/connectivity/source/drivers/evoab2/NDriver.cxx 
b/connectivity/source/drivers/evoab2/NDriver.cxx
index acb2955..b46eac9 100644
--- a/connectivity/source/drivers/evoab2/NDriver.cxx
+++ b/connectivity/source/drivers/evoab2/NDriver.cxx
@@ -165,7 +165,7 @@ sal_Int32 SAL_CALL OEvoabDriver::getMinorVersion(  ) 
throw(RuntimeException, std
 return 0;
 }
 
-sal_Bool OEvoabDriver::acceptsURL_Stat( const OUString url )
+bool OEvoabDriver::acceptsURL_Stat( const OUString url )
 {
 return ( url == sdbc:address:evolution:local || url == 
sdbc:address:evolution:groupwise || url == sdbc:address:evolution:ldap )  
EApiInit();
 }
diff --git a/connectivity/source/drivers/evoab2/NDriver.hxx 
b/connectivity/source/drivers/evoab2/NDriver.hxx
index ba71a4b..9b8fe33 100644
--- a/connectivity/source/drivers/evoab2/NDriver.hxx

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

2014-03-28 Thread Stephan Bergmann
 connectivity/source/commontools/paramwrapper.cxx |   11 ++-
 include/connectivity/paramwrapper.hxx|6 +++---
 2 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 8b533d84f3ae211fdfafc2adc8d8567f366771d4
Author: Stephan Bergmann sberg...@redhat.com
Date:   Fri Mar 28 11:16:38 2014 +0100

Missing XTypeProvider base class

Change-Id: I4e457b55d7d5cd255a0931030f35150d1dd6bf09

diff --git a/connectivity/source/commontools/paramwrapper.cxx 
b/connectivity/source/commontools/paramwrapper.cxx
index 84e4720..9c4af0e 100644
--- a/connectivity/source/commontools/paramwrapper.cxx
+++ b/connectivity/source/commontools/paramwrapper.cxx
@@ -103,11 +103,12 @@ namespace param
 
 Sequence Type  SAL_CALL ParameterWrapper::getTypes(   ) 
throw(RuntimeException, std::exception)
 {
-Sequence Type  aTypes( 4 );
-aTypes[ 1 ] = ::getCppuType( static_cast Reference XWeak *  
   ( NULL ) );
-aTypes[ 1 ] = ::getCppuType( static_cast Reference XPropertySet *   
   ( NULL ) );
-aTypes[ 2 ] = ::getCppuType( static_cast Reference XFastPropertySet 
*  ( NULL ) );
-aTypes[ 3 ] = ::getCppuType( static_cast Reference XMultiPropertySet 
* ( NULL ) );
+Sequence Type  aTypes( 5 );
+aTypes[ 0 ] = ::getCppuType( static_cast Reference XWeak *  
   ( NULL ) );
+aTypes[ 1 ] = ::getCppuType( static_cast Reference XTypeProvider * 
( NULL ) );
+aTypes[ 2 ] = ::getCppuType( static_cast Reference XPropertySet *   
   ( NULL ) );
+aTypes[ 3 ] = ::getCppuType( static_cast Reference XFastPropertySet 
*  ( NULL ) );
+aTypes[ 4 ] = ::getCppuType( static_cast Reference XMultiPropertySet 
* ( NULL ) );
 return aTypes;
 }
 
diff --git a/include/connectivity/paramwrapper.hxx 
b/include/connectivity/paramwrapper.hxx
index 8d284aa..60ff2cc 100644
--- a/include/connectivity/paramwrapper.hxx
+++ b/include/connectivity/paramwrapper.hxx
@@ -51,6 +51,7 @@ namespace param
 property Value, which is forwarded to an XParameters interface
 */
 class OOO_DLLPUBLIC_DBTOOLS ParameterWrapper  :public ::cppu::OWeakObject
+,public css::lang::XTypeProvider
 ,public ::comphelper::OMutexAndBroadcastHelper
 ,public ::cppu::OPropertySetHelper
 {
@@ -91,9 +92,8 @@ namespace param
 
 DECLARE_XINTERFACE()
 
-//TODO: are these actually used (given they are not SAL_OVERRIDE)?
-virtual ::com::sun::star::uno::Sequence ::com::sun::star::uno::Type  
SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException, 
std::exception);
-virtual ::com::sun::star::uno::Sequence sal_Int8  SAL_CALL 
getImplementationId(  ) throw (::com::sun::star::uno::RuntimeException, 
std::exception);
+virtual ::com::sun::star::uno::Sequence ::com::sun::star::uno::Type  
SAL_CALL getTypes(  ) throw (::com::sun::star::uno::RuntimeException, 
std::exception) SAL_OVERRIDE;
+virtual ::com::sun::star::uno::Sequence sal_Int8  SAL_CALL 
getImplementationId(  ) throw (::com::sun::star::uno::RuntimeException, 
std::exception) SAL_OVERRIDE;
 
 // XPropertySet
 virtual ::com::sun::star::uno::Reference 
::com::sun::star::beans::XPropertySetInfo  SAL_CALL getPropertySetInfo() 
throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2013-12-21 Thread Lionel Elie Mamane
 connectivity/source/commontools/dbconversion.cxx |   16 +---
 include/connectivity/dbconversion.hxx|2 +-
 2 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit a5ce8c77a0b2dca2ab5a3564feed1cd3b8104eaa
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Sat Dec 21 10:37:11 2013 +0100

fdo#72916 correct rounding of time part of DateTime

Change-Id: I135478755f9e5a844119129b470fef8de2cd0409

diff --git a/connectivity/source/commontools/dbconversion.cxx 
b/connectivity/source/commontools/dbconversion.cxx
index b15dc92..d6e4831 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -26,6 +26,7 @@
 #include com/sun/star/util/Time.hpp
 #include com/sun/star/util/DateTime.hpp
 #include rtl/ustrbuf.hxx
+#include rtl/math.hxx
 #include unotools/datetime.hxx
 #include sstream
 #include iomanip
@@ -322,10 +323,15 @@ namespace dbtools
 return aRet;
 }
 // 
-
-utl::Time DBTypeConversion::toTime(double dVal)
+utl::Time DBTypeConversion::toTime(double dVal, short nDigits)
 {
 sal_Int32 nDays = (sal_Int32)dVal;
-sal_Int64 nNS = static_castsal_Int64((dVal - (double)nDays) * 
fNanoSecondsPerDay + 0.5);
+sal_Int64 nNS;
+{
+double fSeconds((dVal - (double)nDays) * (fNanoSecondsPerDay / 
nanoSecInSec));
+fSeconds = ::rtl::math::round( fSeconds, nDigits );
+nNS = fSeconds * nanoSecInSec;
+}
 
 sal_Int16 nSign;
 if ( nNS  0 )
@@ -368,7 +374,11 @@ namespace dbtools
 utl::DateTime DBTypeConversion::toDateTime(double dVal, const utl::Date 
_rNullDate)
 {
 utl::Date aDate = toDate(dVal, _rNullDate);
-utl::Time aTime = toTime(dVal);
+// there is not enough precision in a double to have both a date
+// and a time up to nanoseconds - limit to microseconds to have
+// correct rounding, that is e.g. 13:00:00.0 instead of
+// 12:59:59.99790
+utl::Time aTime = toTime(dVal, 6);
 
 utl::DateTime xRet;
 
diff --git a/include/connectivity/dbconversion.hxx 
b/include/connectivity/dbconversion.hxx
index 3fe7c0c0..82345b1 100644
--- a/include/connectivity/dbconversion.hxx
+++ b/include/connectivity/dbconversion.hxx
@@ -105,7 +105,7 @@ namespace dbtools
 
 static ::com::sun::star::util::Date toDate(double dVal, const 
::com::sun::star::util::Date _rNullDate = getStandardDate());
 static ::com::sun::star::util::Date toDate(const OUString 
_sSQLDate);
-static ::com::sun::star::util::Time toTime(double dVal);
+static ::com::sun::star::util::Time toTime(double dVal, short 
nDigits = 9);
 static ::com::sun::star::util::Time toTime(const OUString 
_sSQLDate);
 static ::com::sun::star::util::DateTime toDateTime(double dVal, const 
::com::sun::star::util::Date _rNullDate = getStandardDate());
 static ::com::sun::star::util::DateTime toDateTime(const OUString 
_sSQLDate);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: connectivity/source include/connectivity include/svx include/tools include/vcl oox/source sc/source sd/source svx/source tools/source unusedcode.easy vcl/source

2013-09-01 Thread Marcos Paulo de Souza
 connectivity/source/commontools/dbconversion.cxx |   38 -
 include/connectivity/dbconversion.hxx|6 --
 include/svx/AffineMatrixItem.hxx |2 
 include/tools/stream.hxx |4 -
 include/vcl/menu.hxx |5 --
 include/vcl/status.hxx   |3 -
 oox/source/core/filterbase.cxx   |   19 
 sc/source/filter/inc/sheetdatabuffer.hxx |1 
 sc/source/filter/inc/stylesbuffer.hxx|2 
 sc/source/filter/oox/sheetdatabuffer.cxx |   15 --
 sc/source/filter/oox/stylesbuffer.cxx|8 ---
 sd/source/ui/framework/tools/FrameworkHelper.cxx |   27 
 sd/source/ui/inc/framework/FrameworkHelper.hxx   |   21 -
 svx/source/xoutdev/xattr2.cxx|5 --
 tools/source/stream/strmunx.cxx  |9 
 unusedcode.easy  |   17 ---
 vcl/source/window/menu.cxx   |   40 --
 vcl/source/window/status.cxx |   50 ---
 18 files changed, 1 insertion(+), 271 deletions(-)

New commits:
commit 1d3483ed279982278b2f9fb1bab63485523e48c5
Author: Marcos Paulo de Souza marcos.souza@gmail.com
Date:   Sat Aug 31 13:10:23 2013 -0300

Remove some unused code from unusedcode.easy

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

diff --git a/connectivity/source/commontools/dbconversion.cxx 
b/connectivity/source/commontools/dbconversion.cxx
index cd2b1c3..1449b99 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -136,44 +136,6 @@ namespace dbtools
 return aReturn;
 }
 
-
//--
-sal_Int32 DBTypeConversion::toINT32(const utl::Date rVal)
-{
-return ((sal_Int32)(rVal.Day%100)) +
-(((sal_Int32)(rVal.Month%100))*100) +
-(((sal_Int32) rVal.Year%1)*1);
-}
-
-
//--
-sal_Int64 DBTypeConversion::toINT64(const utl::Time rVal)
-{
-// normalize time
-sal_Int32 nSeconds  = rVal.Seconds + rVal.NanoSeconds / 
nanoSecInSec;
-sal_Int32 nNanoSeconds  = rVal.NanoSeconds % nanoSecInSec;
-sal_Int32 nMinutes  = rVal.Minutes + nSeconds / secInMin;
-nSeconds= nSeconds % secInMin;
-sal_Int32 nHours= rVal.Hours + nMinutes / minInHour;
-nMinutes= nMinutes % minInHour;
-
-// assemble time
-return nNanoSeconds +
-   nSeconds * secMask +
-   nMinutes * minMask +
-   nHours   * hourMask;
-}
-
-
//--
-sal_Int32 DBTypeConversion::getMsFromTime(const utl::Time rVal)
-{
-sal_Int32   nHour = rVal.Hours;
-sal_Int32   nMin  = rVal.Minutes;
-sal_Int32   nSec  = rVal.Seconds;
-sal_Int32   nNanoSec  = rVal.NanoSeconds;
-
-return ((nHour*360)+(nMin*6)+(nSec*1000)+(nNanoSec/100));
-}
-
-
//--
 sal_Int64 DBTypeConversion::getNsFromTime(const utl::Time rVal)
 {
 sal_Int32   nHour = rVal.Hours;
diff --git a/include/connectivity/dbconversion.hxx 
b/include/connectivity/dbconversion.hxx
index 4bc0ed7..d579d0e 100644
--- a/include/connectivity/dbconversion.hxx
+++ b/include/connectivity/dbconversion.hxx
@@ -110,9 +110,6 @@ namespace dbtools
 static ::com::sun::star::util::DateTime toDateTime(double dVal, const 
::com::sun::star::util::Date _rNullDate = getStandardDate());
 static ::com::sun::star::util::DateTime toDateTime(const OUString 
_sSQLDate);
 
-
-// TODO: consider removing getMsFromTime
-static sal_Int32 getMsFromTime(const ::com::sun::star::util::Time 
rVal);
 static sal_Int64 getNsFromTime(const ::com::sun::star::util::Time 
rVal);
 
 static sal_Int32 toDays(const ::com::sun::star::util::Date _rVal, 
const ::com::sun::star::util::Date _rNullDate = getStandardDate());
@@ -121,9 +118,6 @@ namespace dbtools
 static double   toDouble(const ::com::sun::star::util::Time rVal);
 static double   toDouble(const ::com::sun::star::util::DateTime rVal, 
const ::com::sun::star::util::Date _rNullDate = getStandardDate());
 
-static sal_Int32toINT32(const ::com::sun::star::util::Date rVal);
-static sal_Int64toINT64(const ::com::sun::star::util::Time rVal);
-
  

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

2013-08-19 Thread Andrzej J . R . Hunt
 connectivity/source/commontools/dbtools2.cxx |   26 --
 include/connectivity/dbtools.hxx |   16 
 2 files changed, 36 insertions(+), 6 deletions(-)

New commits:
commit acd9f66f2834c16650d37109650ed47e491a0241
Author: Andrzej J.R. Hunt andr...@ahunt.org
Date:   Thu Aug 15 10:02:26 2013 +0100

Split type-description out of createStandardColumnPart.

createStandardColumnPart returns a string that is usable in table creation,
the type descriptor (e.g. CHAR(N)) is also useful in column-type altering
statements, hence this is split into a separate function.

This is needed primarily in the firebird driver where column-type alter
statements are in a different form to most dbs.

Change-Id: If44554f979f6dd14bf679455978f3f0b44784bf5
Reviewed-on: https://gerrit.libreoffice.org/5432
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/connectivity/source/commontools/dbtools2.cxx 
b/connectivity/source/commontools/dbtools2.cxx
index bf9fad6..055a3bd 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -60,7 +60,7 @@ namespace dbtools
 using namespace connectivity;
 using namespace comphelper;
 
-OUString createStandardColumnPart(const Reference XPropertySet  
xColProp,const Reference XConnection _xConnection,ISQLStatementHelper* 
_pHelper,const OUString _sCreatePattern)
+OUString createStandardTypePart(const Reference XPropertySet  
xColProp,const Reference XConnection _xConnection,ISQLStatementHelper* 
_pHelper,const OUString _sCreatePattern)
 {
 
 ReferenceXDatabaseMetaData xMetaData = _xConnection-getMetaData();
@@ -72,11 +72,6 @@ OUString createStandardColumnPart(const Reference 
XPropertySet  xColProp,cons
 sal_Int32   nPrecision  = 0;
 sal_Int32   nScale  = 0;
 
-const OUString sQuoteString = xMetaData-getIdentifierQuoteString();
-OUStringBuffer aSql = 
::dbtools::quoteName(sQuoteString,::comphelper::getString(xColProp-getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME;
-
-aSql.appendAscii( );
-
 nDataType = nPrecision = nScale = 0;
 sal_Bool bIsAutoIncrement = sal_False;
 xColProp-getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_TYPENAME))  
 = sTypeName;
@@ -85,6 +80,8 @@ OUString createStandardColumnPart(const Reference 
XPropertySet  xColProp,cons
 xColProp-getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCALE)) 
 = nScale;
 
xColProp-getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_ISAUTOINCREMENT))
= bIsAutoIncrement;
 
+OUStringBuffer aSql;
+
 // check if the user enter a specific string to create autoincrement values
 OUString sAutoIncrementValue;
 ReferenceXPropertySetInfo xPropInfo = xColProp-getPropertySetInfo();
@@ -180,6 +177,23 @@ OUString createStandardColumnPart(const Reference 
XPropertySet  xColProp,cons
 
 return aSql.makeStringAndClear();
 }
+
+OUString createStandardColumnPart(const Reference XPropertySet  
xColProp,const Reference XConnection _xConnection,ISQLStatementHelper* 
_pHelper,const OUString _sCreatePattern)
+{
+ReferenceXDatabaseMetaData xMetaData = _xConnection-getMetaData();
+
+::dbtools::OPropertyMap rPropMap = OMetaConnection::getPropMap();
+
+const OUString sQuoteString = xMetaData-getIdentifierQuoteString();
+OUStringBuffer aSql = 
::dbtools::quoteName(sQuoteString,::comphelper::getString(xColProp-getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME;
+
+aSql.appendAscii( );
+
+aSql.append(createStandardTypePart(xColProp, _xConnection, _pHelper, 
_sCreatePattern));
+
+return aSql.makeStringAndClear();
+}
+
 // 
-
 
 OUString createStandardCreateStatement(const Reference XPropertySet  
descriptor,const Reference XConnection _xConnection,ISQLStatementHelper* 
_pHelper,const OUString _sCreatePattern)
diff --git a/include/connectivity/dbtools.hxx b/include/connectivity/dbtools.hxx
index 4242373..8064355 100644
--- a/include/connectivity/dbtools.hxx
+++ b/include/connectivity/dbtools.hxx
@@ -645,6 +645,22 @@ namespace dbtools
 OUString createStandardKeyStatement( const 
::com::sun::star::uno::Reference ::com::sun::star::beans::XPropertySet  
descriptor,
 const 
::com::sun::star::uno::Reference ::com::sun::star::sdbc::XConnection 
_xConnection);
 
+/** creates the standard sql statement for the type part of a create or 
alter table statement.
+@param  _pHelper
+Allow to add special SQL constructs.
+@param  descriptor
+The descriptor of the column.
+@param  _xConnection
+The connection.
+@param  _pHelper
+Allow to add special SQL constructs.
+*/
+

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

2013-06-28 Thread Lionel Elie Mamane
 connectivity/source/commontools/CommonTools.cxx |   44 
 connectivity/source/commontools/FValue.cxx  |6 +--
 include/connectivity/CommonTools.hxx|5 --
 3 files changed, 3 insertions(+), 52 deletions(-)

New commits:
commit d6bba47bcb3030163fffd0b8f01c03d038989dea
Author: Lionel Elie Mamane lio...@mamane.lu
Date:   Thu Jun 27 09:28:48 2013 +0200

remove ::connectivity::to(Date)?(Time)?String; same as DBTypeConversion::*

Change-Id: I5f2ef1ecff7e2071b55c27b9dc60e7d92950435c
Reviewed-on: https://gerrit.libreoffice.org/4563
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/connectivity/source/commontools/CommonTools.cxx 
b/connectivity/source/commontools/CommonTools.cxx
index 48357f2..414987e 100644
--- a/connectivity/source/commontools/CommonTools.cxx
+++ b/connectivity/source/commontools/CommonTools.cxx
@@ -111,50 +111,6 @@ namespace connectivity
 return ( *pStr == 0 )  ( *pWild == 0 );
 }
 //--
-OUString toDateString(const ::com::sun::star::util::Date rDate)
-{
-sal_Char s[11];
-snprintf(s,
-sizeof(s),
-%04d-%02d-%02d,
-(int)rDate.Year,
-(int)rDate.Month,
-(int)rDate.Day);
-s[10] = 0;
-return OUString::createFromAscii(s);
-}
-
-//--
-OUString toTimeString(const ::com::sun::star::util::Time rTime)
-{
-sal_Char s[9];
-snprintf(s,
-sizeof(s),
-%02d:%02d:%02d,
-(int)rTime.Hours,
-(int)rTime.Minutes,
-(int)rTime.Seconds);
-s[8] = 0;
-return OUString::createFromAscii(s);
-}
-
-//--
-OUString toDateTimeString(const ::com::sun::star::util::DateTime 
rDateTime)
-{
-sal_Char s[20];
-snprintf(s,
-sizeof(s),
-%04d-%02d-%02d %02d:%02d:%02d,
-(int)rDateTime.Year,
-(int)rDateTime.Month,
-(int)rDateTime.Day,
-(int)rDateTime.Hours,
-(int)rDateTime.Minutes,
-(int)rDateTime.Seconds);
-s[19] = 0;
-return OUString::createFromAscii(s);
-}
-
 #ifdef SOLAR_JAVA
 ::rtl::Reference jvmaccess::VirtualMachine  getJavaVM(const 
ReferenceXComponentContext  _rxContext)
 {
diff --git a/connectivity/source/commontools/FValue.cxx 
b/connectivity/source/commontools/FValue.cxx
index f3aaeeb..bf78289 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -983,13 +983,13 @@ OUString ORowSetValue::getString( ) const
 aRet = OUString::number(static_castdouble(*this));
 break;
 case DataType::DATE:
-aRet = connectivity::toDateString(*this);
+aRet = DBTypeConversion::toDateString(*this);
 break;
 case DataType::TIME:
-aRet = connectivity::toTimeString(*this);
+aRet = DBTypeConversion::toTimeString(*this);
 break;
 case DataType::TIMESTAMP:
-aRet = connectivity::toDateTimeString(*this);
+aRet = DBTypeConversion::toDateTimeString(*this);
 break;
 case DataType::BINARY:
 case DataType::VARBINARY:
diff --git a/include/connectivity/CommonTools.hxx 
b/include/connectivity/CommonTools.hxx
index c13b97d..294ec3f 100644
--- a/include/connectivity/CommonTools.hxx
+++ b/include/connectivity/CommonTools.hxx
@@ -53,11 +53,6 @@ namespace connectivity
 {
 return match(rWild.getStr(), rStr.getStr(), cEscape);
 }
-
//--
-OOO_DLLPUBLIC_DBTOOLS OUString toDateString(const 
::com::sun::star::util::Date rDate);
-OOO_DLLPUBLIC_DBTOOLS OUString toTimeString(const 
::com::sun::star::util::Time rTime);
-OOO_DLLPUBLIC_DBTOOLS OUString toDateTimeString(const 
::com::sun::star::util::DateTime rDateTime);
-
 // typedefs
 typedef std::vector ::com::sun::star::uno::WeakReferenceHelper  
OWeakRefArray;
 typedef ::com::sun::star::uno::Reference 
::com::sun::star::sdbcx::XColumnsSupplierOSQLTable;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits