[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - connectivity/source

2021-03-30 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/parse/sqliterator.cxx |   27 ++-
 1 file changed, 22 insertions(+), 5 deletions(-)

New commits:
commit 97b952d05320f90fe85b91122431d47f3a87ed5d
Author: Lionel Elie Mamane 
AuthorDate: Sat Mar 27 10:57:50 2021 +0100
Commit: Michael Stahl 
CommitDate: Tue Mar 30 11:31:19 2021 +0200

tdf#141115: correctly find the ORDER BY clause of a UNION

instead of blindly assuming a SELECT is not a UNION, leading to an
out-of-bounds array access when it is.

Change-Id: I8f904ae65acba8d8ee23b95299058207af68c0ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113189
(cherry picked from commit f4367cfd6978ae2fa896652175956bdbedd3c4bf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113128
Tested-by: Jenkins
Reviewed-by: Lionel Mamane 
Reviewed-by: Michael Stahl 

diff --git a/connectivity/source/parse/sqliterator.cxx 
b/connectivity/source/parse/sqliterator.cxx
index a91390eca2b8..4d8634d07eb5 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -1831,12 +1831,29 @@ const OSQLParseNode* 
OSQLParseTreeIterator::getOrderTree() const
 
 // Analyse parse tree (depending on statement type)
 // and set pointer to ORDER clause:
+
+assert(SQL_ISRULE(m_pParseTree, select_statement) || 
SQL_ISRULE(m_pParseTree, union_statement));
+
+auto pParseTree = m_pParseTree;
+if(SQL_ISRULE(m_pParseTree, union_statement))
+{
+assert(m_pParseTree->count() == 4);
+pParseTree = pParseTree->getChild(3);
+// since UNION is left-associative (at least in our grammar),
+// possibly the left-hand (m_pParseTree->getChild(0)) is a 
union_statement,
+// but the right hand cannot.
+assert(SQL_ISRULE(pParseTree, select_statement));
+}
+
 OSQLParseNode * pOrderClause = nullptr;
-OSL_ENSURE(m_pParseTree->count() >= 4,"ParseTreeIterator: error in parse 
tree!");
-OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
-OSL_ENSURE(pTableExp != nullptr,"OSQLParseTreeIterator: error in parse 
tree!");
-OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: error 
in parse tree!");
-OSL_ENSURE(pTableExp->count() == 
TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
+OSL_ENSURE(pParseTree->count() == 4, "OSQLParseTreeIterator::getOrderTree: 
expected a SELECT, and a SELECT must have exactly four children");
+OSQLParseNode * pTableExp = pParseTree->getChild(3);
+OSL_ENSURE(pTableExp != nullptr, "OSQLParseTreeIterator::getOrderTree: got 
NULL table_exp");
+OSL_ENSURE(SQL_ISRULE(pTableExp, table_exp), 
"OSQLParseTreeIterator::getOrderTree: expected table_exp but got something 
else");
+OSL_ENSURE(pTableExp->count() == 
TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator::getOrderTree: table_exp 
doesn't have the expected number of children");
+// tdf#141115 upgrade the above to an assert;
+// this cannot go well if there are too few children
+assert(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT);
 
 pOrderClause = pTableExp->getChild(ORDER_BY_CHILD_POS);
 // If it is an order_by, it must not be empty
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - connectivity/source

2021-03-30 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/drivers/file/FStatement.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 3e0714839d3c8cecbe02dea80b372364f4712373
Author: Lionel Elie Mamane 
AuthorDate: Sat Mar 27 15:44:08 2021 +0100
Commit: Michael Stahl 
CommitDate: Tue Mar 30 11:29:21 2021 +0200

tdf#141115 semi-userfriendly message on UNION query on file driver

Rather than silently returning only the first (left) part of the
UNION, error out.

Change-Id: I6ed1eba55ad33f149d9010933a3c7a835fce0451
(cherry picked from commit d0efd1e280c2b9759dce120dff64e8bac1ab19c1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113216
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/connectivity/source/drivers/file/FStatement.cxx 
b/connectivity/source/drivers/file/FStatement.cxx
index 08c4f7fdd844..31d435b62aab 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -394,6 +394,13 @@ void OStatement_Base::construct(const OUString& sql)
 case OSQLStatementType::Unknown:
 
m_pConnection->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,*this);
 break;
+case OSQLStatementType::Select:
+if(SQL_ISRULE(m_aSQLIterator.getParseTree(), union_statement))
+{
+m_pConnection->throwGenericSQLException(STR_QUERY_TOO_COMPLEX, 
*this);
+}
+assert(SQL_ISRULE(m_aSQLIterator.getParseTree(), 
select_statement));
+break;
 default:
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-27 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/drivers/file/FStatement.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit d0efd1e280c2b9759dce120dff64e8bac1ab19c1
Author: Lionel Elie Mamane 
AuthorDate: Sat Mar 27 15:44:08 2021 +0100
Commit: Lionel Mamane 
CommitDate: Sat Mar 27 17:34:13 2021 +0100

tdf#141115 semi-userfriendly message on UNION query on file driver

Rather than silently returning only the first (left) part of the
UNION, error out.

Change-Id: I6ed1eba55ad33f149d9010933a3c7a835fce0451
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113207
Reviewed-by: Julien Nabet 
Reviewed-by: Lionel Mamane 
Tested-by: Jenkins

diff --git a/connectivity/source/drivers/file/FStatement.cxx 
b/connectivity/source/drivers/file/FStatement.cxx
index e04e4fbe5d1b..d181798b2f1e 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -394,6 +394,13 @@ void OStatement_Base::construct(const OUString& sql)
 case OSQLStatementType::Unknown:
 
m_pConnection->throwGenericSQLException(STR_QUERY_TOO_COMPLEX,*this);
 break;
+case OSQLStatementType::Select:
+if(SQL_ISRULE(m_aSQLIterator.getParseTree(), union_statement))
+{
+m_pConnection->throwGenericSQLException(STR_QUERY_TOO_COMPLEX, 
*this);
+}
+assert(SQL_ISRULE(m_aSQLIterator.getParseTree(), 
select_statement));
+break;
 default:
 break;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2021-03-27 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/parse/sqliterator.cxx |   27 ++-
 1 file changed, 22 insertions(+), 5 deletions(-)

New commits:
commit f4367cfd6978ae2fa896652175956bdbedd3c4bf
Author: Lionel Elie Mamane 
AuthorDate: Sat Mar 27 10:57:50 2021 +0100
Commit: Julien Nabet 
CommitDate: Sat Mar 27 11:49:51 2021 +0100

tdf#141115: correctly find the ORDER BY clause of a UNION

instead of blindly assuming a SELECT is not a UNION, leading to an
out-of-bounds array access when it is.

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

diff --git a/connectivity/source/parse/sqliterator.cxx 
b/connectivity/source/parse/sqliterator.cxx
index e6e3e1c72535..5a7e152b1aa6 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -1826,12 +1826,29 @@ const OSQLParseNode* 
OSQLParseTreeIterator::getOrderTree() const
 
 // Analyse parse tree (depending on statement type)
 // and set pointer to ORDER clause:
+
+assert(SQL_ISRULE(m_pParseTree, select_statement) || 
SQL_ISRULE(m_pParseTree, union_statement));
+
+auto pParseTree = m_pParseTree;
+if(SQL_ISRULE(m_pParseTree, union_statement))
+{
+assert(m_pParseTree->count() == 4);
+pParseTree = pParseTree->getChild(3);
+// since UNION is left-associative (at least in our grammar),
+// possibly the left-hand (m_pParseTree->getChild(0)) is a 
union_statement,
+// but the right hand cannot.
+assert(SQL_ISRULE(pParseTree, select_statement));
+}
+
 OSQLParseNode * pOrderClause = nullptr;
-OSL_ENSURE(m_pParseTree->count() >= 4,"ParseTreeIterator: error in parse 
tree!");
-OSQLParseNode * pTableExp = m_pParseTree->getChild(3);
-OSL_ENSURE(pTableExp != nullptr,"OSQLParseTreeIterator: error in parse 
tree!");
-OSL_ENSURE(SQL_ISRULE(pTableExp,table_exp),"OSQLParseTreeIterator: error 
in parse tree!");
-OSL_ENSURE(pTableExp->count() == 
TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator: error in parse tree!");
+OSL_ENSURE(pParseTree->count() == 4, "OSQLParseTreeIterator::getOrderTree: 
expected a SELECT, and a SELECT must have exactly four children");
+OSQLParseNode * pTableExp = pParseTree->getChild(3);
+OSL_ENSURE(pTableExp != nullptr, "OSQLParseTreeIterator::getOrderTree: got 
NULL table_exp");
+OSL_ENSURE(SQL_ISRULE(pTableExp, table_exp), 
"OSQLParseTreeIterator::getOrderTree: expected table_exp but got something 
else");
+OSL_ENSURE(pTableExp->count() == 
TABLE_EXPRESSION_CHILD_COUNT,"OSQLParseTreeIterator::getOrderTree: table_exp 
doesn't have the expected number of children");
+// tdf#141115 upgrade the above to an assert;
+// this cannot go well if there are too few children
+assert(pTableExp->count() == TABLE_EXPRESSION_CHILD_COUNT);
 
 pOrderClause = pTableExp->getChild(ORDER_BY_CHILD_POS);
 // If it is an order_by, it must not be empty
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - connectivity/source

2021-01-28 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/drivers/postgresql/pq_baseresultset.cxx   |2 +-
 connectivity/source/drivers/postgresql/pq_connection.cxx  |9 
+
 connectivity/source/drivers/postgresql/pq_preparedstatement.cxx   |3 +--
 connectivity/source/drivers/postgresql/pq_tools.hxx   |8 

 connectivity/source/drivers/postgresql/pq_updateableresultset.cxx |2 +-
 5 files changed, 16 insertions(+), 8 deletions(-)

New commits:
commit 13091c7cf527a04cc373042370c4d4bbda839ba9
Author: Lionel Elie Mamane 
AuthorDate: Tue Nov 17 02:14:15 2020 +0100
Commit: Michael Stahl 
CommitDate: Thu Jan 28 10:55:41 2021 +0100

pgsql-sdbc: use libpq's custom free()...

... for stuff allocated by libpq

Their documentation says this is important on Microsoft Windows:

 It is particularly important that this function, rather than free(),
 be used on Microsoft Windows. This is because allocating memory in a
 DLL and releasing it in the application works only if
 multithreaded/single-threaded, release/debug, and static/dynamic
 flags are the same for the DLL and the application.

Also use const unique_ptr since we don't need the value to survive the
scope in any way.

Change-Id: If4637ea0cd1c05125d63e2f3d37dbeaf716973f9
(cherry picked from commit 177792660697f85763b39f455d7ebff0f83084fd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107907
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx 
b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
index 8fc7140e4817..9ff5e01e098a 100644
--- a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
@@ -456,7 +456,7 @@ Sequence< sal_Int8 > BaseResultSet::getBytes( sal_Int32 
columnIndex )
 char * res = reinterpret_cast(PQunescapeBytea( 
reinterpret_cast(val.getStr()), ));
 ret = Sequence< sal_Int8 > ( reinterpret_cast(res), length 
);
 if( res )
-free( res );
+PQfreemem( res );
 }
 return ret;
 }
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx 
b/connectivity/source/drivers/postgresql/pq_connection.cxx
index 66c30c893aed..9a51f0cd2833 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -42,6 +42,7 @@
 
 #include "pq_connection.hxx"
 #include "pq_statement.hxx"
+#include "pq_tools.hxx"
 #include "pq_preparedstatement.hxx"
 #include "pq_databasemetadata.hxx"
 #include "pq_xtables.hxx"
@@ -216,7 +217,7 @@ Reference< XPreparedStatement > 
Connection::prepareStatement( const OUString& sq
 MutexGuard guard( m_xMutex->GetMutex() );
 checkClosed();
 
-OString byteSql = OUStringToOString( sql, ConnectionSettings::encoding );
+OString byteSql = rtl::OUStringToOString( sql, 
ConnectionSettings::encoding );
 PreparedStatement *stmt = new PreparedStatement( m_xMutex, this, 
_settings, byteSql );
 Reference< XPreparedStatement > ret = stmt;
 
@@ -414,7 +415,7 @@ static void properties2arrays( const Sequence< 
PropertyValue > & args,
 {
 OUString value;
 tc->convertTo( prop.Value, cppu::UnoType::get() ) 
>>= value;
-char *v = strdup(OUStringToOString(value, enc).getStr());
+char *v = strdup(rtl::OUStringToOString(value, enc).getStr());
 values.push_back ( v );
 }
 else
@@ -460,7 +461,7 @@ void Connection::initialize( const Sequence< Any >& 
aArguments )
 nColon = url.indexOf( ':' , 1+ nColon );
 if( nColon != -1 )
 {
- o = OUStringToOString( url.getStr()+nColon+1, 
ConnectionSettings::encoding );
+ o = rtl::OUStringToOString( url.getStr()+nColon+1, 
ConnectionSettings::encoding );
 }
 }
 {
@@ -477,7 +478,7 @@ void Connection::initialize( const Sequence< Any >& 
aArguments )
 if ( err != nullptr)
 {
 errorMessage = OUString( err, strlen(err), 
ConnectionSettings::encoding );
-free(err);
+PQfreemem(err);
 }
 else
 errorMessage = "#no error message#";
diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx 
b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
index 2e352320353f..069cdfa13e35 100644
--- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
@@ -479,8 +479,7 @@ void PreparedStatement::setBytes(
 checkClosed();
 checkColumnIndex( parameterIndex );
 size_t len;
-s

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - connectivity/source

2020-12-18 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/drivers/postgresql/pq_baseresultset.cxx   |2 +-
 connectivity/source/drivers/postgresql/pq_connection.cxx  |3 ++-
 connectivity/source/drivers/postgresql/pq_preparedstatement.cxx   |2 +-
 connectivity/source/drivers/postgresql/pq_tools.hxx   |8 

 connectivity/source/drivers/postgresql/pq_updateableresultset.cxx |2 +-
 5 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 1ab014ddf72dd09b2ef30320b8b2936a26923b3a
Author: Lionel Elie Mamane 
AuthorDate: Tue Nov 17 02:14:15 2020 +0100
Commit: Michael Stahl 
CommitDate: Fri Dec 18 18:56:32 2020 +0100

pgsql-sdbc: use libpq's custom free()...

... for stuff allocated by libpq

Their documentation says this is important on Microsoft Windows:

 It is particularly important that this function, rather than free(),
 be used on Microsoft Windows. This is because allocating memory in a
 DLL and releasing it in the application works only if
 multithreaded/single-threaded, release/debug, and static/dynamic
 flags are the same for the DLL and the application.

Also use const unique_ptr since we don't need the value to survive the
scope in any way.

Change-Id: If4637ea0cd1c05125d63e2f3d37dbeaf716973f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105967
Tested-by: Lionel Mamane 
Reviewed-by: Lionel Mamane 
(cherry picked from commit 177792660697f85763b39f455d7ebff0f83084fd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107906
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx 
b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
index 8fc7140e4817..9ff5e01e098a 100644
--- a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
@@ -456,7 +456,7 @@ Sequence< sal_Int8 > BaseResultSet::getBytes( sal_Int32 
columnIndex )
 char * res = reinterpret_cast(PQunescapeBytea( 
reinterpret_cast(val.getStr()), ));
 ret = Sequence< sal_Int8 > ( reinterpret_cast(res), length 
);
 if( res )
-free( res );
+PQfreemem( res );
 }
 return ret;
 }
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx 
b/connectivity/source/drivers/postgresql/pq_connection.cxx
index d9889dea8091..ed3ed85e9c6c 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -41,6 +41,7 @@
 
 #include "pq_connection.hxx"
 #include "pq_statement.hxx"
+#include "pq_tools.hxx"
 #include "pq_preparedstatement.hxx"
 #include "pq_databasemetadata.hxx"
 #include "pq_xtables.hxx"
@@ -460,7 +461,7 @@ void Connection::initialize( const Sequence< Any >& 
aArguments )
 if ( err != nullptr)
 {
 errorMessage = OUString( err, strlen(err), 
ConnectionSettings::encoding );
-free(err);
+PQfreemem(err);
 }
 else
 errorMessage = "#no error message#";
diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx 
b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
index c1d9a4f66731..344c27175850 100644
--- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
@@ -481,7 +481,7 @@ void PreparedStatement::setBytes(
 checkClosed();
 checkColumnIndex( parameterIndex );
 size_t len;
-std::unique_ptr escapedString(
+const std::unique_ptr> 
escapedString(
 PQescapeBytea( reinterpret_cast(x.getConstArray()), x.getLength(), ));
 if( ! escapedString )
 {
diff --git a/connectivity/source/drivers/postgresql/pq_tools.hxx 
b/connectivity/source/drivers/postgresql/pq_tools.hxx
index af751f8e633b..7fbdb260d30b 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.hxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.hxx
@@ -49,6 +49,14 @@
 #include "pq_connection.hxx"
 #include 
 
+namespace
+{
+// helper to create one-time deleters
+template 
+using deleter_from_fn = std::integral_constant;
+
+}
+
 namespace pq_sdbc_driver
 {
 bool isWhitespace( sal_Unicode c );
diff --git a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx 
b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
index 880adc647c7e..d8780e76c563 100644
--- a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
@@ -481,7 +481,7 @@ void UpdateableResultSet::updateBytes( sal_Int32 
columnIndex, const css::uno::Se
 
 m_updateableField[columnIndex-1].value <<=
 OUString(

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

2020-12-17 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/drivers/postgresql/pq_baseresultset.cxx   |2 +-
 connectivity/source/drivers/postgresql/pq_connection.cxx  |3 ++-
 connectivity/source/drivers/postgresql/pq_preparedstatement.cxx   |2 +-
 connectivity/source/drivers/postgresql/pq_tools.hxx   |8 

 connectivity/source/drivers/postgresql/pq_updateableresultset.cxx |2 +-
 5 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 177792660697f85763b39f455d7ebff0f83084fd
Author: Lionel Elie Mamane 
AuthorDate: Tue Nov 17 02:14:15 2020 +0100
Commit: Lionel Mamane 
CommitDate: Fri Dec 18 08:49:56 2020 +0100

pgsql-sdbc: use libpq's custom free()...

... for stuff allocated by libpq

Their documentation says this is important on Microsoft Windows:

 It is particularly important that this function, rather than free(),
 be used on Microsoft Windows. This is because allocating memory in a
 DLL and releasing it in the application works only if
 multithreaded/single-threaded, release/debug, and static/dynamic
 flags are the same for the DLL and the application.

Also use const unique_ptr since we don't need the value to survive the
scope in any way.

Change-Id: If4637ea0cd1c05125d63e2f3d37dbeaf716973f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105967
Tested-by: Lionel Mamane 
Reviewed-by: Lionel Mamane 

diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx 
b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
index 8fc7140e4817..9ff5e01e098a 100644
--- a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
@@ -456,7 +456,7 @@ Sequence< sal_Int8 > BaseResultSet::getBytes( sal_Int32 
columnIndex )
 char * res = reinterpret_cast(PQunescapeBytea( 
reinterpret_cast(val.getStr()), ));
 ret = Sequence< sal_Int8 > ( reinterpret_cast(res), length 
);
 if( res )
-free( res );
+PQfreemem( res );
 }
 return ret;
 }
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx 
b/connectivity/source/drivers/postgresql/pq_connection.cxx
index 5d97f2b2436d..e4716fe8855d 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -41,6 +41,7 @@
 
 #include "pq_connection.hxx"
 #include "pq_statement.hxx"
+#include "pq_tools.hxx"
 #include "pq_preparedstatement.hxx"
 #include "pq_databasemetadata.hxx"
 #include "pq_xtables.hxx"
@@ -461,7 +462,7 @@ void Connection::initialize( const Sequence< Any >& 
aArguments )
 if ( err != nullptr)
 {
 errorMessage = OUString( err, strlen(err), 
ConnectionSettings::encoding );
-free(err);
+PQfreemem(err);
 }
 else
 errorMessage = "#no error message#";
diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx 
b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
index c1d9a4f66731..344c27175850 100644
--- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
@@ -481,7 +481,7 @@ void PreparedStatement::setBytes(
 checkClosed();
 checkColumnIndex( parameterIndex );
 size_t len;
-std::unique_ptr escapedString(
+const std::unique_ptr> 
escapedString(
 PQescapeBytea( reinterpret_cast(x.getConstArray()), x.getLength(), ));
 if( ! escapedString )
 {
diff --git a/connectivity/source/drivers/postgresql/pq_tools.hxx 
b/connectivity/source/drivers/postgresql/pq_tools.hxx
index 90490be81eb6..18b105870705 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.hxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.hxx
@@ -51,6 +51,14 @@
 #include 
 #include 
 
+namespace
+{
+// helper to create one-time deleters
+template 
+using deleter_from_fn = std::integral_constant;
+
+}
+
 namespace pq_sdbc_driver
 {
 bool isWhitespace( sal_Unicode c );
diff --git a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx 
b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
index 880adc647c7e..d8780e76c563 100644
--- a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
@@ -481,7 +481,7 @@ void UpdateableResultSet::updateBytes( sal_Int32 
columnIndex, const css::uno::Se
 
 m_updateableField[columnIndex-1].value <<=
 OUString( reinterpret_cast(escapedString), len, 
RTL_TEXTENCODING_ASCII_US );
-free( escapedString );
+PQfreemem( escapedString );
 }
 
 void UpdateableResultSet::updateDate( sal_Int32 columnIndex, const 
css::util::Date&a

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

2020-12-17 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/drivers/postgresql/pq_connection.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit b815bc466695cd1700a2c8d0cdc5201ed5a95032
Author: Lionel Elie Mamane 
AuthorDate: Tue Nov 17 02:23:56 2020 +0100
Commit: Lionel Mamane 
CommitDate: Fri Dec 18 08:48:29 2020 +0100

pgsql-sdbc small optimisation

1) use const unique_ptr since we don't need the value to survive the
   scope in any way.

2) put the custom deleter function (PQconninfoFree) in the ptr class
   rather than at runtime. Saves one pointer in the ptr class and
   reduces the ptr class overhead...

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

diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx 
b/connectivity/source/drivers/postgresql/pq_connection.cxx
index 4d56d52ec9a9..5d97f2b2436d 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -453,7 +453,8 @@ void Connection::initialize( const Sequence< Any >& 
aArguments )
 if ( o.getLength() > 0 )
 {
 char *err;
-std::shared_ptr 
oOpts(PQconninfoParse(o.getStr(), ), PQconninfoFree);
+const std::unique_ptr>
+oOpts(PQconninfoParse(o.getStr(), ));
 if (oOpts == nullptr)
 {
 OUString errorMessage;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - connectivity/source

2020-06-05 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/parse/sqlflex.l |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit ede39fd49c03f2f604507bb1b79ac32fe52da493
Author: Lionel Elie Mamane 
AuthorDate: Fri May 8 07:51:53 2020 +0200
Commit: Michael Stahl 
CommitDate: Fri Jun 5 11:19:51 2020 +0200

tdf#122461 SQL identifiers (names) can contain newlines

Change-Id: Ic58e6b65e146b2e0d9cb656aa5fa06cfe955d11d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93690
Tested-by: Jenkins
Reviewed-by: Lionel Elie Mamane 
(cherry picked from commit b6ab865a371f5c46f96d931721f03afde82b7ec1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93787
Reviewed-by: Michael Stahl 

diff --git a/connectivity/source/parse/sqlflex.l 
b/connectivity/source/parse/sqlflex.l
index 1002ecef7970..2269d1c6e52c 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -526,6 +526,8 @@ sal_Int32 gatherString(int delim, sal_Int32 nTyp)
 int ch;
 OStringBuffer sBuffer(256);
 
+assert(nTyp == 0 || nTyp == 1 || nTyp == 2);
+
 while (!checkeof(ch = yyinput()))
 {
 if (ch == delim)
@@ -554,7 +556,7 @@ sal_Int32 gatherString(int delim, sal_Int32 nTyp)
 }
 
 }
-else if (nTyp != 1 && (ch == '\r' || ch == '\n') )
+else if (nTyp == 2 && (ch == '\r' || ch == '\n') )
 break;
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - connectivity/source include/connectivity

2020-05-13 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 bfaa243b0cac1753330982bedb47f272724bfa1c
Author: Lionel Elie Mamane 
AuthorDate: Mon May 4 22:58:31 2020 +0200
Commit: Michael Stahl 
CommitDate: Wed May 13 10:04:52 2020 +0200

tdf#122408 make StatementComposer apply HAVING clause

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

diff --git a/connectivity/source/commontools/dbtools.cxx 
b/connectivity/source/commontools/dbtools.cxx
index 514b026b26c9..34d83e573a1e 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -1247,7 +1247,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: dbaccess/source

2020-05-10 Thread Lionel Elie Mamane (via logerrit)
 dbaccess/source/ui/inc/WCopyTable.hxx  |2 
 dbaccess/source/ui/misc/DExport.cxx|2 
 dbaccess/source/ui/misc/WCopyTable.cxx |  226 +++--
 dbaccess/source/ui/uno/copytablewizard.cxx |   10 -
 4 files changed, 132 insertions(+), 108 deletions(-)

New commits:
commit 0b81aaa36b5b78e208c5cc2cd36b4906b8d636a6
Author: Lionel Elie Mamane 
AuthorDate: Sat May 9 20:27:35 2020 +0200
Commit: Lionel Elie Mamane 
CommitDate: Sun May 10 09:33:06 2020 +0200

CopyTableWizard: make code less confusing

createTable looked into the requested operation, and depending on
that, either created the table or fetched the existing one. For a
function named createTable, that made for confusing reading.

Split that into:
 * createTable that creates the table
 * getTable that fetches the existing table
 * returnTable that automagically creates or fetches an existing
   table, depending on the requested operation.

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

diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx 
b/dbaccess/source/ui/inc/WCopyTable.hxx
index fffc3cf1dee4..0563232451f9 100644
--- a/dbaccess/source/ui/inc/WCopyTable.hxx
+++ b/dbaccess/source/ui/inc/WCopyTable.hxx
@@ -385,6 +385,8 @@ namespace dbaui
 */
 void clearDestColumns();
 
+css::uno::Reference< css::beans::XPropertySet > returnTable();
+css::uno::Reference< css::beans::XPropertySet > getTable();
 css::uno::Reference< css::beans::XPropertySet > createTable();
 css::uno::Reference< css::beans::XPropertySet > createView() const;
 sal_Int32 getMaxColumnNameLength() const;
diff --git a/dbaccess/source/ui/misc/DExport.cxx 
b/dbaccess/source/ui/misc/DExport.cxx
index 384703a6b573..cc24fe114c63 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -687,7 +687,7 @@ bool ODatabaseExport::executeWizard(const OUString& 
_rTableName, const Any& _aTe
 case CopyTableOperation::CopyDefinitionAndData:
 case CopyTableOperation::AppendData:
 {
-m_xTable = aWizard.createTable();
+m_xTable = aWizard.returnTable();
 bError = !m_xTable.is();
 if(m_xTable.is())
 {
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx 
b/dbaccess/source/ui/misc/WCopyTable.cxx
index 0a54f4982d0c..30ebf6f6a642 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -1135,6 +1135,28 @@ Reference< XPropertySet > OCopyTableWizard::createView() 
const
 return ::dbaui::createView( m_sName, m_xDestConnection, sCommand );
 }
 
+Reference< XPropertySet > OCopyTableWizard::returnTable()
+{
+if ( getOperation() == CopyTableOperation::AppendData )
+return getTable();
+else
+return createTable();
+}
+
+Reference< XPropertySet > OCopyTableWizard::getTable()
+{
+Reference< XPropertySet > xTable;
+
+Reference xSup( m_xDestConnection, UNO_QUERY );
+Reference< XNameAccess > xTables;
+if(xSup.is())
+xTables = xSup->getTables();
+if(xTables.is() && xTables->hasByName(m_sName))
+xTables->getByName(m_sName) >>= xTable;
+
+return xTable;
+}
+
 Reference< XPropertySet > OCopyTableWizard::createTable()
 {
 Reference< XPropertySet > xTable;
@@ -1143,126 +1165,122 @@ Reference< XPropertySet > 
OCopyTableWizard::createTable()
 Reference< XNameAccess > xTables;
 if(xSup.is())
 xTables = xSup->getTables();
-if ( getOperation() != CopyTableOperation::AppendData )
+Reference xFact(xTables,UNO_QUERY);
+OSL_ENSURE(xFact.is(),"No XDataDescriptorFactory available!");
+if(!xFact.is())
+return nullptr;
+
+xTable = xFact->createDataDescriptor();
+OSL_ENSURE(xTable.is(),"Could not create a new object!");
+if(!xTable.is())
+return nullptr;
+
+OUString sCatalog,sSchema,sTable;
+Reference< XDatabaseMetaData> xMetaData = m_xDestConnection->getMetaData();
+::dbtools::qualifiedNameComponents(xMetaData,
+   m_sName,
+   sCatalog,
+   sSchema,
+   sTable,
+   
::dbtools::EComposeRule::InDataManipulation);
+
+if ( sCatalog.isEmpty() && xMetaData->supportsCatalogsInTableDefinitions() 
)
 {
-Reference xFact(xTables,UNO_QUERY);
-OSL_ENSURE(xFact.is(),"No XDataDescriptorFactory available!");
- 

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

2020-05-09 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx |5 
 connectivity/source/drivers/mysqlc/mysqlc_statement.cxx |   25 +-
 connectivity/source/drivers/mysqlc/mysqlc_statement.hxx |   51 ++--
 sc/source/ui/app/inputhdl.cxx   |   77 +-
 sc/source/ui/view/cellsh3.cxx   |  121 
+-
 sc/source/ui/view/tabvwshc.cxx  |7 
 6 files changed, 227 insertions(+), 59 deletions(-)

New commits:
commit 244e1823c41221d53b0dc7b6d9595514930f8cca
Author: Lionel Elie Mamane 
AuthorDate: Sat May 9 16:01:12 2020 +0200
Commit: Lionel Elie Mamane 
CommitDate: Sun May 10 07:38:17 2020 +0200

mysql-sdbc: better separate what resultset provides what interface

PreparedStatement should not provide XStatement (!!)
since MySQL does not support multiple results for prepared statements,
PreparedStatement should not expose a XMultipleResults interface

Move those out of the common base to Statement itself.

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

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx 
b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx
index 3c4edaf411ac..0177b15dbd03 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx
@@ -93,11 +93,6 @@ public:
 sal_Bool SAL_CALL execute() override;
 Reference SAL_CALL getConnection() override;
 
-// XStatement
-using OCommonStatement::execute;
-using OCommonStatement::executeQuery;
-using OCommonStatement::executeUpdate;
-
 // XParameters
 void SAL_CALL setNull(sal_Int32 parameter, sal_Int32 sqlType) override;
 
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
index b7073be5e6ec..0082f96b61d1 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
@@ -88,6 +88,11 @@ Sequence SAL_CALL OCommonStatement::getTypes()
 return concatSequences(aTypes.getTypes(), 
OCommonStatement_IBase::getTypes());
 }
 
+Sequence SAL_CALL OStatement::getTypes()
+{
+return concatSequences(OStatement_BASE::getTypes(), 
OCommonStatement::getTypes());
+}
+
 void SAL_CALL OCommonStatement::cancel()
 {
 MutexGuard aGuard(m_aMutex);
@@ -114,7 +119,7 @@ void SAL_CALL OCommonStatement::close()
 // 
mysqlc_sdbc_driver::throwFeatureNotImplementedException("com:sun:star:sdbc:XBatchExecution");
 // }
 
-sal_Bool SAL_CALL OCommonStatement::execute(const OUString& sql)
+sal_Bool SAL_CALL OStatement::execute(const OUString& sql)
 {
 MutexGuard aGuard(m_aMutex);
 checkDisposed(rBHelper.bDisposed);
@@ -139,7 +144,7 @@ sal_Bool SAL_CALL OCommonStatement::execute(const OUString& 
sql)
 return getResult();
 }
 
-Reference SAL_CALL OCommonStatement::executeQuery(const OUString& 
sql)
+Reference SAL_CALL OStatement::executeQuery(const OUString& sql)
 {
 bool isRS(execute(sql));
 // if a MySQL error occurred, it was already thrown and the below is not 
executed
@@ -156,7 +161,7 @@ Reference SAL_CALL 
OCommonStatement::executeQuery(const OUString& sq
 return m_xResultSet;
 }
 
-Reference SAL_CALL OCommonStatement::getConnection()
+Reference SAL_CALL OStatement::getConnection()
 {
 MutexGuard aGuard(m_aMutex);
 checkDisposed(rBHelper.bDisposed);
@@ -165,14 +170,14 @@ Reference SAL_CALL 
OCommonStatement::getConnection()
 return m_xConnection.get();
 }
 
-sal_Int32 SAL_CALL OCommonStatement::getUpdateCount() { return 
m_nAffectedRows; }
+sal_Int32 SAL_CALL OStatement::getUpdateCount() { return m_nAffectedRows; }
 
 Any SAL_CALL OStatement::queryInterface(const Type& rType)
 {
-Any aRet = ::cppu::queryInterface(rType, static_cast(this));
+Any aRet = OCommonStatement::queryInterface(rType);
 if (!aRet.hasValue())
 {
-aRet = OCommonStatement::queryInterface(rType);
+aRet = OStatement_BASE::queryInterface(rType);
 }
 return aRet;
 }
@@ -193,7 +198,7 @@ Any SAL_CALL OStatement::queryInterface(const Type& rType)
 // 
mysqlc_sdbc_driver::throwFeatureNotImplementedException("com:sun:star:sdbc:XBatchExecution");
 // }
 
-sal_Int32 SAL_CALL OCommonStatement::executeUpdate(const OUString& sql)
+sal_Int32 SAL_CALL OStatement::executeUpdate(const OUString& sql)
 {
 MutexGuard aGuard(m_aMutex);
 checkDisposed(rBHelper.bDisposed);
@@ -202,7 +207,7 @@ sal_Int32 SAL_CALL OCommonStatement::executeUpdate(const 
OUString& sql)
 return m_nAffectedRows;
 }
 
-Reference SAL_CALL OCommonStatement::getResultSet()
+Reference SAL_CALL OStatement::getRes

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

2020-05-09 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx |   26 
+-
 connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx |   10 +--
 2 files changed, 19 insertions(+), 17 deletions(-)

New commits:
commit 2c3fdd1236fc22c5d2688f728e58818984b22298
Author: Lionel Elie Mamane 
AuthorDate: Sat May 9 15:34:42 2020 +0200
Commit: Lionel Elie Mamane 
CommitDate: Sun May 10 00:13:05 2020 +0200

mysql-sdbc: do not lie about supporting XPreparedBatchExecution

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

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
index 8c9ec1d250db..2b344843deb2 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
@@ -534,18 +534,20 @@ void SAL_CALL OPreparedStatement::clearParameters()
 }
 }
 
-void SAL_CALL OPreparedStatement::clearBatch()
-{
-
mysqlc_sdbc_driver::throwFeatureNotImplementedException("OPreparedStatement::clearBatch",
-*this);
-}
-
-void SAL_CALL OPreparedStatement::addBatch()
-{
-
mysqlc_sdbc_driver::throwFeatureNotImplementedException("OPreparedStatement::addBatch",
 *this);
-}
-
-Sequence SAL_CALL OPreparedStatement::executeBatch() { return 
Sequence(); }
+// void SAL_CALL OPreparedStatement::clearBatch()
+// {
+// 
mysqlc_sdbc_driver::throwFeatureNotImplementedException("OPreparedStatement::clearBatch",
+// *this);
+// }
+
+// void SAL_CALL OPreparedStatement::addBatch()
+// {
+// 
mysqlc_sdbc_driver::throwFeatureNotImplementedException("OPreparedStatement::addBatch",
 *this);
+// }
+
+// Sequence SAL_CALL OPreparedStatement::executeBatch() {
+// 
mysqlc_sdbc_driver::throwFeatureNotImplementedException("OPreparedStatement::executeBatch",
 *this);
+// }
 
 void OPreparedStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, 
const Any& rValue)
 {
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx 
b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx
index f488e285bc41..3c4edaf411ac 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace connectivity
 {
@@ -52,8 +53,7 @@ struct BindMetaData
 my_bool error = false;
 };
 
-typedef ::cppu::ImplHelper5
 OPreparedStatement_BASE;
 
@@ -149,9 +149,9 @@ public:
 void SAL_CALL clearParameters() override;
 
 // XPreparedBatchExecution
-void SAL_CALL addBatch() override;
-void SAL_CALL clearBatch() override;
-css::uno::Sequence SAL_CALL executeBatch() override;
+// void SAL_CALL addBatch() override;
+// void SAL_CALL clearBatch() override;
+// css::uno::Sequence SAL_CALL executeBatch() override;
 
 // XCloseable
 void SAL_CALL close() override;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-09 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/drivers/mysqlc/mysqlc_connection.cxx   |3 
 connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx |2 
 connectivity/source/drivers/mysqlc/mysqlc_statement.cxx|  104 
+++---
 connectivity/source/drivers/mysqlc/mysqlc_statement.hxx|1 
 4 files changed, 81 insertions(+), 29 deletions(-)

New commits:
commit 86c86719782243275b65f1f7f2cfdcc0e56c8cd4
Author: Lionel Elie Mamane 
AuthorDate: Sat May 9 14:24:03 2020 +0200
Commit: Lionel Elie Mamane 
CommitDate: Sun May 10 00:11:47 2020 +0200

tdf#112423: mysql-sdbc: implement XMultipleResults

Thanks to Julien Nabet for the pointers to MySQL's multiple results
API documentation:
https://dev.mysql.com/doc/refman/8.0/en/c-api-multiple-queries.html

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

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
index 045da3b41a77..600e131b89b1 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
@@ -175,7 +175,8 @@ void OConnection::construct(const OUString& url, const 
Sequence&
 
 // flags can also be passed as last parameter
 if (!mysql_real_connect(_mysql, host_str.getStr(), user_str.getStr(), 
pass_str.getStr(),
-schema_str.getStr(), nPort, socket_str.getStr(), 
0))
+schema_str.getStr(), nPort, socket_str.getStr(),
+CLIENT_MULTI_STATEMENTS))
 mysqlc_sdbc_driver::throwSQLExceptionWithMsg(
 mysql_error(_mysql), mysql_sqlstate(_mysql), 
mysql_errno(_mysql), *this,
 getConnectionEncoding());
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx
index 960b6c8875fc..db9b5c6e6b55 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx
@@ -271,7 +271,7 @@ sal_Bool SAL_CALL 
ODatabaseMetaData::supportsGroupByUnrelated() { return true; }
 
 sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleTransactions() { return 
true; }
 
-sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets() { return 
false; }
+sal_Bool SAL_CALL ODatabaseMetaData::supportsMultipleResultSets() { return 
true; }
 
 sal_Bool SAL_CALL ODatabaseMetaData::supportsLikeEscapeClause() { return true; 
}
 
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
index c6dab15c4b53..b7073be5e6ec 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
@@ -18,6 +18,7 @@
  */
 
 #include 
+#include 
 
 #include "mysqlc_connection.hxx"
 #include "mysqlc_propertyids.hxx"
@@ -118,6 +119,9 @@ sal_Bool SAL_CALL OCommonStatement::execute(const OUString& 
sql)
 MutexGuard aGuard(m_aMutex);
 checkDisposed(rBHelper.bDisposed);
 
+closeResultSet();
+m_nAffectedRows = -1;
+
 OString toExec = OUStringToOString(sql, 
m_xConnection->getConnectionSettings().encoding);
 
 MYSQL* pMySql = m_xConnection->getMysqlConnection();
@@ -127,41 +131,28 @@ sal_Bool SAL_CALL OCommonStatement::execute(const 
OUString& sql)
 // toExec = mysqlc_sdbc_driver::escapeSql(toExec);
 int failure = mysql_real_query(pMySql, toExec.getStr(), 
toExec.getLength());
 
-if (failure)
+if (failure || mysql_errno(pMySql))
 mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_error(pMySql), 
mysql_sqlstate(pMySql),
  mysql_errno(pMySql), 
*this,
  
m_xConnection->getConnectionEncoding());
-m_nAffectedRows = mysql_affected_rows(pMySql);
 
-return !failure;
+return getResult();
 }
 
 Reference SAL_CALL OCommonStatement::executeQuery(const OUString& 
sql)
 {
-MutexGuard aGuard(m_aMutex);
-checkDisposed(rBHelper.bDisposed);
-const OUString sSqlStatement = sql; // TODO 
m_xConnection->transFormPreparedStatement( sql );
-OString toExec
-= OUStringToOString(sSqlStatement, 
m_xConnection->getConnectionSettings().encoding);
-
-MYSQL* pMySql = m_xConnection->getMysqlConnection();
-// toExec = mysqlc_sdbc_driver::escapeSql(toExec);
-int failure = mysql_real_query(pMySql, toExec.getStr(), 
toExec.getLength());
-if (failure)
-mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_error(pMySql), 
mysql_sqlstate(pMySql),
- mysql_errno(pMySql), 
*this,
-

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

2020-05-09 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx |   18 
 connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx |1 
 connectivity/source/drivers/mysqlc/mysqlc_statement.cxx |7 +++---
 connectivity/source/drivers/mysqlc/mysqlc_statement.hxx |2 -
 4 files changed, 19 insertions(+), 9 deletions(-)

New commits:
commit 57cdc7f309f0863e1d8eef4a1780c3e9e2daadb5
Author: Lionel Elie Mamane 
AuthorDate: Sat May 9 13:53:23 2020 +0200
Commit: Lionel Elie Mamane 
CommitDate: Sat May 9 21:17:43 2020 +0200

mysql-sdbc: statement: rename disposeResultset to closeResultset

it does not actually dispose teh ResulteSet, it only lets go of the 
reference.
Change it to actually close the ResultSet.

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

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
index 3211fe09eff7..6b35b236361f 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
@@ -50,11 +50,12 @@ OCommonStatement::OCommonStatement(OConnection* 
_pConnection)
 
 OCommonStatement::~OCommonStatement() {}
 
-void OCommonStatement::disposeResultSet()
+void OCommonStatement::closeResultSet()
 {
-// free the cursor if alive
 if (m_xResultSet.is())
 {
+css::uno::Reference xClose(m_xResultSet, 
UNO_QUERY_THROW);
+xClose->close();
 m_xResultSet.clear();
 m_pMysqlResult = nullptr; // it is freed by XResultSet
 }
@@ -105,7 +106,7 @@ void SAL_CALL OCommonStatement::close()
 checkDisposed(rBHelper.bDisposed);
 }
 dispose();
-disposeResultSet();
+closeResultSet();
 }
 
 // void SAL_CALL OStatement::clearBatch()
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx 
b/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx
index 54d67bd9d901..9595c596401a 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx
@@ -71,7 +71,7 @@ protected:
 sal_Int32 m_nAffectedRows = 0;
 
 protected:
-void disposeResultSet();
+void closeResultSet();
 
 // OPropertyArrayUsageHelper
 ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
commit a79194007fc0522d134ca2922ef59129fe7aa354
Author:     Lionel Elie Mamane 
AuthorDate: Sat May 9 13:45:10 2020 +0200
Commit:     Lionel Elie Mamane 
CommitDate: Sat May 9 21:17:37 2020 +0200

mysql-sdbc: resultset: do not keep m_pResult after freeing it

and replace m_bResultFetched by (m_pResult == nullptr)

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

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
index bd405dea973d..75c229823004 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
@@ -111,12 +111,13 @@ OResultSet::OResultSet(OConnection& rConn, 
OCommonStatement* pStmt, MYSQL_RES* p
 , m_pResult(pResult)
 , m_encoding(_encoding)
 {
+assert(m_pResult);
 m_xMetaData = new OResultSetMetaData(rConn, m_pResult);
 }
 
 void OResultSet::ensureResultFetched()
 {
-if (!m_bResultFetched)
+if (m_pResult)
 {
 fetchResult();
 }
@@ -124,7 +125,7 @@ void OResultSet::ensureResultFetched()
 
 void OResultSet::ensureFieldInfoFetched()
 {
-if (m_bResultFetched)
+if (m_pResult == nullptr)
 return; // already fetched
 
 // it works only if result set is produced via mysql_store_result
@@ -165,8 +166,8 @@ void OResultSet::fetchResult()
 if (errorNum)
 mysqlc_sdbc_driver::throwSQLExceptionWithMsg(
 mysql_error(m_pMysql), mysql_sqlstate(m_pMysql), errorNum, *this, 
m_encoding);
-m_bResultFetched = true;
 mysql_free_result(m_pResult);
+m_pResult = nullptr;
 }
 
 void OResultSet::disposing()
@@ -175,6 +176,11 @@ void OResultSet::disposing()
 
 MutexGuard aGuard(m_aMutex);
 
+if (m_pResult != nullptr)
+{
+mysql_free_result(m_pResult);
+m_pResult = nullptr;
+}
 m_aStatement = nullptr;
 m_xMetaData = nullptr;
 }
@@ -575,7 +581,11 @@ void SAL_CALL OResultSet::close()
 MutexGuard aGuard(m_aMutex);
 checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
 
-m_pResult = nullptr;
+if (m_pResult != nullptr)
+{
+mysql_free_result(m_pResult);
+m_pResult = nullptr;
+}
 dispose();
 }
 
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx 
b/connectivity/source/drivers/mysqlc/mysqlc_resultset.hxx
index 027cc

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

2020-05-09 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/drivers/mysqlc/mysqlc_statement.cxx |   11 ---
 connectivity/source/drivers/mysqlc/mysqlc_statement.hxx |1 -
 2 files changed, 4 insertions(+), 8 deletions(-)

New commits:
commit 7c64b92665e13c1a09ee197bd36dac015989f00e
Author: Lionel Elie Mamane 
AuthorDate: Sat May 9 13:59:45 2020 +0200
Commit: Lionel Elie Mamane 
CommitDate: Sat May 9 21:18:13 2020 +0200

mysql-sdbc: statement::execute do not handle parameters

this is not a PreparedStatement, it is not allowed to have parameters

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

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
index 2301d040511b..c6dab15c4b53 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
@@ -117,10 +117,8 @@ sal_Bool SAL_CALL OCommonStatement::execute(const 
OUString& sql)
 {
 MutexGuard aGuard(m_aMutex);
 checkDisposed(rBHelper.bDisposed);
-const OUString sSqlStatement = 
m_xConnection->transFormPreparedStatement(sql);
 
-OString toExec
-= OUStringToOString(sSqlStatement, 
m_xConnection->getConnectionSettings().encoding);
+OString toExec = OUStringToOString(sql, 
m_xConnection->getConnectionSettings().encoding);
 
 MYSQL* pMySql = m_xConnection->getMysqlConnection();
 
commit f185b070fd72112a7c4c4b843ee6156c1860ac94
Author: Lionel Elie Mamane 
AuthorDate: Sat May 9 13:55:23 2020 +0200
Commit: Lionel Elie Mamane 
CommitDate: Sat May 9 21:17:58 2020 +0200

mysql-sdbc: statement: do not pointlessly keep pointer to result

in m_pMysqlResult since it is never actually used after being assigned,
except in the code block that assigned it.

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

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
index 6b35b236361f..2301d040511b 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
@@ -57,7 +57,6 @@ void OCommonStatement::closeResultSet()
 css::uno::Reference xClose(m_xResultSet, 
UNO_QUERY_THROW);
 xClose->close();
 m_xResultSet.clear();
-m_pMysqlResult = nullptr; // it is freed by XResultSet
 }
 }
 
@@ -155,15 +154,15 @@ Reference SAL_CALL 
OCommonStatement::executeQuery(const OUString& sq
  mysql_errno(pMySql), 
*this,
  
m_xConnection->getConnectionEncoding());
 
-m_pMysqlResult = mysql_store_result(pMySql);
-if (m_pMysqlResult == nullptr)
+MYSQL_RES* pMysqlResult = mysql_store_result(pMySql);
+if (pMysqlResult == nullptr)
 {
 mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_error(pMySql), 
mysql_sqlstate(pMySql),
  mysql_errno(pMySql), 
*this,
  
m_xConnection->getConnectionEncoding());
 }
 
-m_xResultSet = new OResultSet(*getOwnConnection(), this, m_pMysqlResult,
+m_xResultSet = new OResultSet(*getOwnConnection(), this, pMysqlResult,
   m_xConnection->getConnectionEncoding());
 return m_xResultSet;
 }
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx 
b/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx
index 9595c596401a..2ce417259b24 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx
@@ -65,7 +65,6 @@ protected:
 rtl::Reference m_xConnection; // The owning Connection object
 
 css::uno::Reference m_xResultSet;
-MYSQL_RES* m_pMysqlResult = nullptr;
 
 // number of rows affected by an UPDATE, DELETE or INSERT statement.
 sal_Int32 m_nAffectedRows = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-09 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx |2 
 connectivity/source/drivers/mysqlc/mysqlc_statement.cxx|   34 
+-
 connectivity/source/drivers/mysqlc/mysqlc_statement.hxx|   10 +-
 3 files changed, 23 insertions(+), 23 deletions(-)

New commits:
commit a69996aab61b1b9206d3e004e283db90d1ca87e2
Author: Lionel Elie Mamane 
AuthorDate: Sat May 9 13:36:54 2020 +0200
Commit: Lionel Elie Mamane 
CommitDate: Sat May 9 20:52:33 2020 +0200

mysql-sdbc: do not lie about supporting XBatchExecution

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

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx
index c9814a9da659..960b6c8875fc 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx
@@ -540,7 +540,7 @@ sal_Bool SAL_CALL 
ODatabaseMetaData::deletesAreDetected(sal_Int32 /*setType*/) {
 
 sal_Bool SAL_CALL ODatabaseMetaData::insertsAreDetected(sal_Int32 /*setType*/) 
{ return false; }
 
-sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates() { return true; }
+sal_Bool SAL_CALL ODatabaseMetaData::supportsBatchUpdates() { return false; }
 
 Reference SAL_CALL ODatabaseMetaData::getConnection() { return 
_rConnection; }
 
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
index 5e9128a80f1a..3211fe09eff7 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
@@ -108,10 +108,10 @@ void SAL_CALL OCommonStatement::close()
 disposeResultSet();
 }
 
-void SAL_CALL OStatement::clearBatch()
-{
-// if you support batches clear it here
-}
+// void SAL_CALL OStatement::clearBatch()
+// {
+// 
mysqlc_sdbc_driver::throwFeatureNotImplementedException("com:sun:star:sdbc:XBatchExecution");
+// }
 
 sal_Bool SAL_CALL OCommonStatement::execute(const OUString& sql)
 {
@@ -180,7 +180,7 @@ sal_Int32 SAL_CALL OCommonStatement::getUpdateCount() { 
return m_nAffectedRows;
 
 Any SAL_CALL OStatement::queryInterface(const Type& rType)
 {
-Any aRet = ::cppu::queryInterface(rType, 
static_cast(this));
+Any aRet = ::cppu::queryInterface(rType, static_cast(this));
 if (!aRet.hasValue())
 {
 aRet = OCommonStatement::queryInterface(rType);
@@ -188,19 +188,21 @@ Any SAL_CALL OStatement::queryInterface(const Type& rType)
 return aRet;
 }
 
-void SAL_CALL OStatement::addBatch(const OUString&)
-{
-MutexGuard aGuard(m_aMutex);
-checkDisposed(rBHelper.bDisposed);
-}
+// void SAL_CALL OStatement::addBatch(const OUString&)
+// {
+// MutexGuard aGuard(m_aMutex);
+// checkDisposed(rBHelper.bDisposed);
 
-Sequence SAL_CALL OStatement::executeBatch()
-{
-MutexGuard aGuard(m_aMutex);
-checkDisposed(rBHelper.bDisposed);
+// 
mysqlc_sdbc_driver::throwFeatureNotImplementedException("com:sun:star:sdbc:XBatchExecution");
+// }
 
-return Sequence();
-}
+// Sequence SAL_CALL OStatement::executeBatch()
+// {
+// MutexGuard aGuard(m_aMutex);
+// checkDisposed(rBHelper.bDisposed);
+
+// 
mysqlc_sdbc_driver::throwFeatureNotImplementedException("com:sun:star:sdbc:XBatchExecution");
+// }
 
 sal_Int32 SAL_CALL OCommonStatement::executeUpdate(const OUString& sql)
 {
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx 
b/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx
index 9b0d3c952763..54d67bd9d901 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.hxx
@@ -144,9 +144,7 @@ private:
 using ::cppu::OPropertySetHelper::getFastPropertyValue;
 };
 
-class OStatement final : public OCommonStatement,
- public css::sdbc::XBatchExecution,
- public css::lang::XServiceInfo
+class OStatement final : public OCommonStatement, public 
css::lang::XServiceInfo
 
 {
 virtual ~OStatement() override = default;
@@ -170,11 +168,11 @@ public:
 void SAL_CALL release() throw() override;
 
 // XBatchExecution
-void SAL_CALL addBatch(const OUString& sql) override;
+// void SAL_CALL addBatch(const OUString& sql) override;
 
-void SAL_CALL clearBatch() override;
+// void SAL_CALL clearBatch() override;
 
-css::uno::Sequence SAL_CALL executeBatch() override;
+// css::uno::Sequence SAL_CALL executeBatch() override;
 };
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-05-09 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/drivers/mysqlc/mysqlc_connection.cxx |   23 
++
 connectivity/source/drivers/mysqlc/mysqlc_general.cxx|   13 +++--
 connectivity/source/drivers/mysqlc/mysqlc_general.hxx|5 +-
 connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx |   12 ++---
 connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx  |   18 +--
 connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx  |4 -
 connectivity/source/drivers/mysqlc/mysqlc_statement.cxx  |   15 +++---
 7 files changed, 56 insertions(+), 34 deletions(-)

New commits:
commit c558ad61ba56d45a46e286c5f1329c436e009617
Author: Lionel Elie Mamane 
AuthorDate: Sat May 9 13:29:44 2020 +0200
Commit: Lionel Elie Mamane 
CommitDate: Sat May 9 20:51:12 2020 +0200

mysql-sdbc: fill SQLSTATE field of SQLException when throwing it

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

diff --git a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
index 1070dd1fd68f..045da3b41a77 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
@@ -176,8 +176,9 @@ void OConnection::construct(const OUString& url, const 
Sequence&
 // flags can also be passed as last parameter
 if (!mysql_real_connect(_mysql, host_str.getStr(), user_str.getStr(), 
pass_str.getStr(),
 schema_str.getStr(), nPort, socket_str.getStr(), 
0))
-mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_error(_mysql), 
mysql_errno(_mysql),
- *this, 
getConnectionEncoding());
+mysqlc_sdbc_driver::throwSQLExceptionWithMsg(
+mysql_error(_mysql), mysql_sqlstate(_mysql), 
mysql_errno(_mysql), *this,
+getConnectionEncoding());
 
 // Check if the server is 4.1 or above
 if (getMysqlVersion() < 40100)
@@ -231,7 +232,8 @@ Reference SAL_CALL 
OConnection::prepareStatement(const OUStr
 
 unsigned int nErrorNum = mysql_errno(_mysql);
 if (nErrorNum != 0)
-mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_error(_mysql), 
nErrorNum, *this,
+mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_error(_mysql),
+ mysql_sqlstate(_mysql), 
nErrorNum, *this,
  getConnectionEncoding());
 
 Reference xStatement = new OPreparedStatement(this, 
pStmt);
@@ -262,8 +264,9 @@ void SAL_CALL OConnection::setAutoCommit(sal_Bool 
autoCommit)
 MutexGuard aGuard(m_aMutex);
 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
 if (!mysql_autocommit(_mysql, autoCommit))
-mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_error(_mysql), 
mysql_errno(_mysql),
- *this, 
getConnectionEncoding());
+mysqlc_sdbc_driver::throwSQLExceptionWithMsg(
+mysql_error(_mysql), mysql_sqlstate(_mysql), 
mysql_errno(_mysql), *this,
+getConnectionEncoding());
 }
 
 sal_Bool SAL_CALL OConnection::getAutoCommit()
@@ -284,8 +287,9 @@ void SAL_CALL OConnection::commit()
 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
 
 if (!mysql_commit(_mysql))
-mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_error(_mysql), 
mysql_errno(_mysql),
- *this, 
getConnectionEncoding());
+mysqlc_sdbc_driver::throwSQLExceptionWithMsg(
+mysql_error(_mysql), mysql_sqlstate(_mysql), 
mysql_errno(_mysql), *this,
+getConnectionEncoding());
 }
 
 void SAL_CALL OConnection::rollback()
@@ -294,8 +298,9 @@ void SAL_CALL OConnection::rollback()
 checkDisposed(OConnection_BASE::rBHelper.bDisposed);
 
 if (!mysql_rollback(_mysql))
-mysqlc_sdbc_driver::throwSQLExceptionWithMsg(mysql_error(_mysql), 
mysql_errno(_mysql),
- *this, 
getConnectionEncoding());
+mysqlc_sdbc_driver::throwSQLExceptionWithMsg(
+mysql_error(_mysql), mysql_sqlstate(_mysql), 
mysql_errno(_mysql), *this,
+getConnectionEncoding());
 }
 
 sal_Bool SAL_CALL OConnection::isClosed()
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_general.cxx 
b/connectivity/source/drivers/mysqlc/mysqlc_general.cxx
index 90995ad31315..7ed11fe3ff13 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_general.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_general.cxx
@@ -104,14 +104,19 @@ void throwInvalidArgumentException(const char* 
_pAsciiFeatureName,
 throw SQLException(sMessage, _rxContext, "HYC00", 0, Any());
 }
 
-void throwSQLExceptionWithMsg(const char* msg, unsigne

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

2020-05-08 Thread Lionel Elie Mamane (via logerrit)
 connectivity/source/parse/sqlflex.l |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit b6ab865a371f5c46f96d931721f03afde82b7ec1
Author: Lionel Elie Mamane 
AuthorDate: Fri May 8 07:51:53 2020 +0200
Commit: Lionel Elie Mamane 
CommitDate: Fri May 8 11:03:37 2020 +0200

tdf#122461 SQL identifiers (names) can contain newlines

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

diff --git a/connectivity/source/parse/sqlflex.l 
b/connectivity/source/parse/sqlflex.l
index 62cdc0abb865..34a4067ea21c 100644
--- a/connectivity/source/parse/sqlflex.l
+++ b/connectivity/source/parse/sqlflex.l
@@ -526,6 +526,8 @@ sal_Int32 gatherString(int delim, sal_Int32 nTyp)
 int ch;
 OStringBuffer sBuffer(256);
 
+assert(nTyp == 0 || nTyp == 1 || nTyp == 2);
+
 while (!checkeof(ch = yyinput()))
 {
 if (ch == delim)
@@ -554,7 +556,7 @@ sal_Int32 gatherString(int delim, sal_Int32 nTyp)
 }
 
 }
-else if (nTyp != 1 && (ch == '\r' || ch == '\n') )
+else if (nTyp == 2 && (ch == '\r' || ch == '\n') )
 break;
 else
 {
___
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] online.git: net/Ssl.cpp wsd/Storage.cpp

2019-11-20 Thread Lionel Elie Mamane (via logerrit)
 net/Ssl.cpp |  112 +++-
 wsd/Storage.cpp |4 ++
 2 files changed, 74 insertions(+), 42 deletions(-)

New commits:
commit 1fbf148f098ba31464d7dc7040bb62464e8191e8
Author: Lionel Elie Mamane 
AuthorDate: Fri Oct 18 19:21:09 2019 +0200
Commit: Andras Timar 
CommitDate: Wed Nov 20 13:48:07 2019 +0100

modernise TLS setup

Some machines (e.g. Debian 10) by default will refuse DH groups
shorter than 2048 bits.

Change-Id: I3505bc392775d7c92069a8f705f574338666a8e7
Reviewed-on: https://gerrit.libreoffice.org/83300
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/net/Ssl.cpp b/net/Ssl.cpp
index ec14502d3..428239280 100644
--- a/net/Ssl.cpp
+++ b/net/Ssl.cpp
@@ -197,45 +197,59 @@ void SslContext::dynlockDestroy(struct 
CRYPTO_dynlock_value* lock, const char* /
 void SslContext::initDH()
 {
 #ifndef OPENSSL_NO_DH
-// 1024-bit MODP Group with 160-bit prime order subgroup (RFC5114)
-// -BEGIN DH PARAMETERS-
-// MIIBDAKBgQCxC4+WoIDgHd6S3l6uXVTsUsmfvPsGo8aaap3KUtI7YWBz4oZ1oj0Y
-// mDjvHi7mUsAT7LSuqQYRIySXXDzUm4O/rMvdfZDEvXCYSI6cIZpzck7/1vrlZEc4
-// +qMaT/VbzMChUa9fDci0vUW/N982XBpl5oz9p21NpwjfH7K8LkpDcQKBgQCk0cvV
-// w/00EmdlpELvuZkF+BBN0lisUH/WQGz/FCZtMSZv6h5cQVZLd35pD1UE8hMWAhe0
-// sBuIal6RVH+eJ0n01/vX07mpLuGQnQ0iY/gKdqaiTAh6CR9THb8KAWm2oorWYqTR
-// jnOvoy13nVkY0IvIhY9Nzvl8KiSFXm7rIrOy5QICAKA=
-// -END DH PARAMETERS-
-//
-
-static const unsigned char dh1024_p[] =
+// 2048-bit MODP Group with 256-bit prime order subgroup (RFC5114)
+
+static const unsigned char dh2048_p[] =
 {
-0xB1,0x0B,0x8F,0x96,0xA0,0x80,0xE0,0x1D,0xDE,0x92,0xDE,0x5E,
-0xAE,0x5D,0x54,0xEC,0x52,0xC9,0x9F,0xBC,0xFB,0x06,0xA3,0xC6,
-0x9A,0x6A,0x9D,0xCA,0x52,0xD2,0x3B,0x61,0x60,0x73,0xE2,0x86,
-0x75,0xA2,0x3D,0x18,0x98,0x38,0xEF,0x1E,0x2E,0xE6,0x52,0xC0,
-0x13,0xEC,0xB4,0xAE,0xA9,0x06,0x11,0x23,0x24,0x97,0x5C,0x3C,
-0xD4,0x9B,0x83,0xBF,0xAC,0xCB,0xDD,0x7D,0x90,0xC4,0xBD,0x70,
-0x98,0x48,0x8E,0x9C,0x21,0x9A,0x73,0x72,0x4E,0xFF,0xD6,0xFA,
-0xE5,0x64,0x47,0x38,0xFA,0xA3,0x1A,0x4F,0xF5,0x5B,0xCC,0xC0,
-0xA1,0x51,0xAF,0x5F,0x0D,0xC8,0xB4,0xBD,0x45,0xBF,0x37,0xDF,
-0x36,0x5C,0x1A,0x65,0xE6,0x8C,0xFD,0xA7,0x6D,0x4D,0xA7,0x08,
-0xDF,0x1F,0xB2,0xBC,0x2E,0x4A,0x43,0x71,
+0x87,0xA8,0xE6,0x1D,0xB4,0xB6,0x66,0x3C,0xFF,0xBB,0xD1,0x9C,
+0x65,0x19,0x59,0x99,0x8C,0xEE,0xF6,0x08,0x66,0x0D,0xD0,0xF2,
+0x5D,0x2C,0xEE,0xD4,0x43,0x5E,0x3B,0x00,0xE0,0x0D,0xF8,0xF1,
+0xD6,0x19,0x57,0xD4,0xFA,0xF7,0xDF,0x45,0x61,0xB2,0xAA,0x30,
+0x16,0xC3,0xD9,0x11,0x34,0x09,0x6F,0xAA,0x3B,0xF4,0x29,0x6D,
+0x83,0x0E,0x9A,0x7C,0x20,0x9E,0x0C,0x64,0x97,0x51,0x7A,0xBD,
+0x5A,0x8A,0x9D,0x30,0x6B,0xCF,0x67,0xED,0x91,0xF9,0xE6,0x72,
+0x5B,0x47,0x58,0xC0,0x22,0xE0,0xB1,0xEF,0x42,0x75,0xBF,0x7B,
+0x6C,0x5B,0xFC,0x11,0xD4,0x5F,0x90,0x88,0xB9,0x41,0xF5,0x4E,
+0xB1,0xE5,0x9B,0xB8,0xBC,0x39,0xA0,0xBF,0x12,0x30,0x7F,0x5C,
+0x4F,0xDB,0x70,0xC5,0x81,0xB2,0x3F,0x76,0xB6,0x3A,0xCA,0xE1,
+0xCA,0xA6,0xB7,0x90,0x2D,0x52,0x52,0x67,0x35,0x48,0x8A,0x0E,
+0xF1,0x3C,0x6D,0x9A,0x51,0xBF,0xA4,0xAB,0x3A,0xD8,0x34,0x77,
+0x96,0x52,0x4D,0x8E,0xF6,0xA1,0x67,0xB5,0xA4,0x18,0x25,0xD9,
+0x67,0xE1,0x44,0xE5,0x14,0x05,0x64,0x25,0x1C,0xCA,0xCB,0x83,
+0xE6,0xB4,0x86,0xF6,0xB3,0xCA,0x3F,0x79,0x71,0x50,0x60,0x26,
+0xC0,0xB8,0x57,0xF6,0x89,0x96,0x28,0x56,0xDE,0xD4,0x01,0x0A,
+0xBD,0x0B,0xE6,0x21,0xC3,0xA3,0x96,0x0A,0x54,0xE7,0x10,0xC3,
+0x75,0xF2,0x63,0x75,0xD7,0x01,0x41,0x03,0xA4,0xB5,0x43,0x30,
+0xC1,0x98,0xAF,0x12,0x61,0x16,0xD2,0x27,0x6E,0x11,0x71,0x5F,
+0x69,0x38,0x77,0xFA,0xD7,0xEF,0x09,0xCA,0xDB,0x09,0x4A,0xE9,
+0x1E,0x1A,0x15,0x97,
+
 };
 
-static const unsigned char dh1024_g[] =
+static const unsigned char dh2048_g[] =
 {
-0xA4,0xD1,0xCB,0xD5,0xC3,0xFD,0x34,0x12,0x67,0x65,0xA4,0x42,
-0xEF,0xB9,0x99,0x05,0xF8,0x10,0x4D,0xD2,0x58,0xAC,0x50,0x7F,
-0xD6,0x40,0x6C,0xFF,0x14,0x26,0x6D,0x31,0x26,0x6F,0xEA,0x1E,
-0x5C,0x41,0x56,0x4B,0x77,0x7E,0x69,0x0F,0x55,0x04,0xF2,0x13,
-0x16,0x02,0x17,0xB4,0xB0,0x1B,0x88,0x6A,0x5E,0x91,0x54,0x7F,
-0x9E,0x27,0x49,0xF4,0xD7,0xFB,0xD7,0xD3,0xB9,0xA9,0x2E,0xE1,
-0x90,0x9D,0x0D,0x22,0x63,0xF8,0x0A,0x76,0xA6,0xA2,0x4C,0x08,
-0x7A,0x09,0x1F,0x53,0x1D,0xBF,0x0A,0x01,0x69,0xB6,0xA2,0x8A,
-0xD6,0x62,0xA4,0xD1,0x8E,0x73,0xAF,0xA3,0x2D,0x77,0x9D,0x59,
-0x18,0xD0,0x8B,0xC8,0x85,0x8F,0x4D,0xCE,0xF9,0x7C,0x2A,0x24,
-0x85,0x5E,0x6E,0xEB,0x22,0xB3,0xB2,0xE5,
+0x3F,0xB3,0x2C,0x9B,0x73,0x13,0x4D,0x0B,0x2E,0x77,0x50,0x66,
+0x60,0xED,0xBD,0x48,0x4C,0xA7,0xB1,0x8F,0x21,0xEF,0x20,0x54,
+0x07,0xF4,0x79,0x3A,0x1A,0x0B,0xA1,0x25,0x10,0xDB,0xC1,0x50

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4-0' - debian/loolwsd.postrm

2019-10-19 Thread Lionel Elie Mamane (via logerrit)
 debian/loolwsd.postrm |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit d9c3d7df368fb8f19f969412f97ad6f26aa1a770
Author: Lionel Elie Mamane 
AuthorDate: Fri Oct 18 19:05:33 2019 +0200
Commit: Andras Timar 
CommitDate: Sat Oct 19 22:27:57 2019 +0200

debian package postrm: fix lintian warning

Change-Id: I7db7a5549f4fdf3597be0df13b4ff447522b7b92
Reviewed-on: https://gerrit.libreoffice.org/81089
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 
(cherry picked from commit 0c426536fac66a4cabf4b5feefd188022a56e594)
Reviewed-on: https://gerrit.libreoffice.org/81143

diff --git a/debian/loolwsd.postrm b/debian/loolwsd.postrm
index d4e1fd993..784ad65ba 100755
--- a/debian/loolwsd.postrm
+++ b/debian/loolwsd.postrm
@@ -1,3 +1,5 @@
 #!/bin/sh
 
-rm /etc/apt/apt.conf.d/25loolwsd
+set -e
+
+rm -f /etc/apt/apt.conf.d/25loolwsd
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - debian/loolwsd.postrm

2019-10-19 Thread Lionel Elie Mamane (via logerrit)
 debian/loolwsd.postrm |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 0c426536fac66a4cabf4b5feefd188022a56e594
Author: Lionel Elie Mamane 
AuthorDate: Fri Oct 18 19:05:33 2019 +0200
Commit: Andras Timar 
CommitDate: Sat Oct 19 22:27:30 2019 +0200

debian package postrm: fix lintian warning

Change-Id: I7db7a5549f4fdf3597be0df13b4ff447522b7b92
Reviewed-on: https://gerrit.libreoffice.org/81089
Reviewed-by: Andras Timar 
Tested-by: Andras Timar 

diff --git a/debian/loolwsd.postrm b/debian/loolwsd.postrm
index d4e1fd993..784ad65ba 100755
--- a/debian/loolwsd.postrm
+++ b/debian/loolwsd.postrm
@@ -1,3 +1,5 @@
 #!/bin/sh
 
-rm /etc/apt/apt.conf.d/25loolwsd
+set -e
+
+rm -f /etc/apt/apt.conf.d/25loolwsd
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-02 Thread Lionel Elie Mamane (via logerrit)
 configure.ac |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6d482d0ac21249d4d4987cda1bfe51f967c36dc8
Author: Lionel Elie Mamane 
AuthorDate: Wed Jul 10 13:58:46 2019 +0200
Commit: Miklos Vajna 
CommitDate: Fri Aug 2 11:44:57 2019 +0200

build fails with libxmlsec version 1.2.27

Due to indirect inclusion of C++ headers in scope of an 'extern "C"'.
Possibly it works with version 1.2.24 to 1.2.26.

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

diff --git a/configure.ac b/configure.ac
index b3f5390428fe..96f776280732 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8300,7 +8300,7 @@ libo_CHECK_SYSTEM_MODULE([expat], [EXPAT], [expat])
 dnl ===
 dnl Check for system xmlsec
 dnl ===
-libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.24])
+libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.28])
 
 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - i18npool/source

2019-07-30 Thread Lionel Elie Mamane (via logerrit)
 i18npool/source/calendar/calendarImpl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 913120fe50ee770e60bd82e2e60047242872111a
Author: Lionel Elie Mamane 
AuthorDate: Wed Jul 10 10:27:19 2019 +0200
Commit: Tomáš Chvátal 
CommitDate: Tue Jul 30 13:56:59 2019 +0200

build failure - disambiguate Calendar return class

Change-Id: I892281f85f6cc9c2de2c341ae63240ae85d302c4
Reviewed-on: https://gerrit.libreoffice.org/76595
Reviewed-by: Tomáš Chvátal 
Reviewed-by: Lionel Elie Mamane 
Tested-by: Jenkins

diff --git a/i18npool/source/calendar/calendarImpl.cxx 
b/i18npool/source/calendar/calendarImpl.cxx
index c9e22f7bc9b7..228bed358b09 100644
--- a/i18npool/source/calendar/calendarImpl.cxx
+++ b/i18npool/source/calendar/calendarImpl.cxx
@@ -128,7 +128,7 @@ CalendarImpl::getLoadedCalendar2()
 return xCalendar->getLoadedCalendar2();
 }
 
-Calendar SAL_CALL
+::css::i18n::Calendar SAL_CALL
 CalendarImpl::getLoadedCalendar()
 {
 if (!xCalendar.is())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-10 Thread Lionel Elie Mamane (via logerrit)
 i18npool/source/calendar/calendarImpl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2388ffc6d7f10bf0413bd2350e808a3337a99ff2
Author: Lionel Elie Mamane 
AuthorDate: Wed Jul 10 10:27:19 2019 +0200
Commit: Lionel Elie Mamane 
CommitDate: Wed Jul 10 10:27:50 2019 +0200

build failure - disambiguate Calendar return class

Change-Id: I892281f85f6cc9c2de2c341ae63240ae85d302c4

diff --git a/i18npool/source/calendar/calendarImpl.cxx 
b/i18npool/source/calendar/calendarImpl.cxx
index c9e22f7bc9b7..228bed358b09 100644
--- a/i18npool/source/calendar/calendarImpl.cxx
+++ b/i18npool/source/calendar/calendarImpl.cxx
@@ -128,7 +128,7 @@ CalendarImpl::getLoadedCalendar2()
 return xCalendar->getLoadedCalendar2();
 }
 
-Calendar SAL_CALL
+::css::i18n::Calendar SAL_CALL
 CalendarImpl::getLoadedCalendar()
 {
 if (!xCalendar.is())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Upstreaming LO Firebird patches

2019-02-11 Thread Lionel Elie Mamane
Hi everyone,

Your name/email appears as "Author" in a git commit that changes one
of the "patch" files in external/firebird.

Do you agree that these patches be contributed upstream? Thank you in
advance for your confirmation. Please keep
Julien Nabet 
CCed in your answers.

(This email follows some discussion on whether you did or not
 implicitly giving that permission by committing the patch in the
 LibreOffice git...)

Thanks in advance,

Lionel Mamane
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Trying to put LO Firebird patches upstream, license issue?

2019-02-11 Thread Lionel Elie Mamane
On Sat, Feb 09, 2019 at 11:16:11PM +0100, Julien Nabet wrote:
> On 09/02/2019 21:33, Kaganski Mike wrote:

>> Hmm... I'm sorry for not being clear. My point was that since our
>> patches (in our tree) were changing Firebird, they *automatically*
>> follow Firebird license - or otherwise we couldn't have modified
>> it. So I meant that whatever LibreOffice licensing is, the patches
>> in Firebird External subdirectory are already license-compatible
>> with upstream Firebird.

> So it seems, there may be some issue to use external patches. I
> don't anything about law, even less in international law, so I won't
> try to put any external patches upstream.

Julien, what Mike is saying is that there is *no* legal / licensing
issue to upstream the firebird external patches now in the LibreOffice
code tree, since per the firebird licence, the people that wrote those
patches already agreed to putting them under the same licence as
firebird.

I have no reason not to believe Mike; we might want to mail the
authors anyway, just to be legally sure they don't oppose the
upstreaming; I cannot imagine any of them would.

Best Regards,

Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Trying to put LO Firebird patches upstream, license issue?

2019-02-10 Thread Lionel Elie Mamane
On Mon, Feb 04, 2019 at 09:15:00PM +0100, Julien Nabet wrote:

> I should ask to Tamas and Lionel (let's put them in cc) if they
> accept to submit the configure part of this patch upstream?

Any patch / modification that I made to Firebird or its build system
or JDBC / ODBC / ... drivers or whatever, has my authorisation to be
integrated into the upstream project under the licence the respective
upstream project was under as of 1 February 2019.

I'm happy for that to happen, and I'm sorry I didn't organise this
myself as is good practice.

Best Regards,

Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


LO's filepicker

2019-01-17 Thread Lionel Elie Mamane
https://bugs.documentfoundation.org/show_bug.cgi?id=119569#c26
contains (tangentially) one user's reason for staying with OO 3.1
rather than LibO: "the file picker with preview is modified in such a
way that the file-preview pane is not enlargeable any more".

If it is useful feedback to anybody, here it is.

Hack responsibly,

Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Jenkins tb76-maggie crashed/hung git

2018-11-06 Thread Lionel Elie Mamane
See
https://ci.libreoffice.org/job/gerrit_linux_clang_dbgutil/19386/console

Checking out Revision dfd105903b22b33956cf571fd4c722c829f7c997 
(refs/changes/69/62969/2)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f dfd105903b22b33956cf571fd4c722c829f7c997 # timeout=30
hudson.plugins.git.GitException: Command "git checkout -f 
dfd105903b22b33956cf571fd4c722c829f7c997" returned status code 128:
stdout: 
stderr: fatal: Unable to create 
'/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_clang_dbgutil_64/.git/index.lock':
 File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [TDF infra] Announcing Gitiles VCS browser (gitweb replacement) and https:// anon git URIs

2018-10-23 Thread Lionel Elie Mamane
On Tue, Oct 23, 2018 at 07:34:54AM +0200, Guilhem Moulin wrote:
> On Mon, 22 Oct 2018 at 17:25:11 +0200, Lionel Elie Mamane wrote:
>> On Mon, Oct 22, 2018 at 04:33:21PM +0200, Guilhem Moulin wrote:

>>> Might be orthogonal to the git:// vs. https:// vs. ssh://
>>> discussion.  Gerrit uses JGit as Git implementation, while
>>> git-daemon(1) spawns “normal” (C-based) git-upload-pack(1)
>>> processes.

>> For us developers of LibreOffice, and thus consumers of the Gerrit
>> / Git service of freedesktop.org and TDF, whether the difference
>> comes from the protocol itself or a different git implementation on
>> the server to serve the different protocols is intellectually
>> interesting (thanks for that!), but materially inconsequential: if
>> using git: will be faster, we will use git:.

> Following the same logic, you want gerrit.libreoffice.org to serve
> content over plain http:// so you can save the two round-trips when
> you launch your browser to submit your reviews? Oo

Submission (write access) is something else entirely than code
download (read access); the security requirements are massively
different. (Yes, I would prefer to be certain that the code I get is
the right one; however, if I don't and try to submit a patch on top of
code that is not the on in the TDF repo, it will fail. Unless the
attacker also constructed git that exploits SHA collisions?)

(The above analysis does not apply to gerrit-as-a-website, because
 there the link between the code I see and the code I approve is not
 on my local machine, but depends on the security of the connection;
 and because I don't know how to secure reading but not writing on a
 website.)

If it is only two round-trips per operation, I'm likely to not notice
and thus be perfectly happy to use whatever protocol. If the two round
trips are multiplied by many many requests to serve one operation,
then I may notice. Where "operation" is one action for the user, not
one action for the program. E.g., "git fetch", "git push", "load a
complete web page with all images, javascript, dependencies, etc",
"post an answer to a gerrit change", as opposite to "get one
commit / changepack among 2473 to be downloaded", "get one image / one
javascript file", etc.

> Things have changed since 2012, encryption is faster (there are
> modern stream ciphers and hardware acceleration is more widespread),
> and for situations like this one there is no reason not to encrypt
> data in transit.

I would have thought symmetric encryption already wasn't a bottlneck,
at least on the client side (maybe on the server side it was?) in
2012; I think one could even back then easily saturate a 100Mbps
connection using less than 100% of one core of an entry-level desktop
CPU. Many public key crypto operations per seconds is (was?) another
issue altogether.

Possibly the difference I was very clearly feeling back then was
C git vs JGit, and not having a clue that different implementations
were being used, were just carelessly blamed on crypto overhead.

>>> Anyway, it's easy enough to benchmark no-op `git fetch` on core.
>>> master is currently at c99732d59bc6, and I'm fetching from the
>>> same datacenter to avoid metrics being polluted with network
>>> hiccups.

>> Yes, but no. You also test in an environment where a network RTT is
>> probably about one fifth to one third of a millisecond, and
>> bandwidth at least 100Mbps if not 1000Mbps? In that case,
>> everything will be fast. Time difference will be lost in noise.

> I was arguing that C git and Jgit's performances are
> indistinguishable on the current instance.

Ah, I understand now.

> Counting round-trips for SSH isn't trivial, but let me try:
> (...)  So if the latency is symmetric and the first key offered is
> accepted by the server, that makes a constant overhead of 8.5
> round-trips. (... ) Additionally, the sending side must wait for the
> client to adjust the window size when it's full.

Since we were feeling a difference between git: and ssh:, not between
git: and http(s): (which we didn't even consider), possibly that's
also a factor.

-- 
Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [TDF infra] Announcing Gitiles VCS browser (gitweb replacement) and https:// anon git URIs

2018-10-22 Thread Lionel Elie Mamane
On Mon, Oct 22, 2018 at 04:33:21PM +0200, Guilhem Moulin wrote:
> On Mon, 22 Oct 2018 at 11:51:35 +0200, Lionel Elie Mamane wrote:
>> On Wed, Oct 17, 2018 at 09:03:45PM +0200, Guilhem Moulin wrote:

>>> SSH is only used for transport, a git processed is exec()'ed on the
>>> remote just like for git-daemon(1), so the only overhead is
>>> crypto-related.  The handshake is a one-off thing, thus negligible
>>> when you're transferring a large amount of data at once; (...) As
>>> for symmetric crypto overhead, (...) the overhead should be
>>> negligible.

>> All I know is that about 1/2/3 years ago ('t was I think in some
>> coworking space in Brussels, probably a hackfest) I showed Michael
>> Meeks how to have a separate "push" url (with ssh: protocol) and
>> "pull" url (with git: protocol) and he was very happy at the
>> speed-up.

> Might be orthogonal to the git:// vs. https:// vs. ssh://
> discussion.  Gerrit uses JGit as Git implementation, while
> git-daemon(1) spawns “normal” (C-based) git-upload-pack(1)
> processes.

For us developers of LibreOffice, and thus consumers of the Gerrit /
Git service of freedesktop.org and TDF, whether the difference comes
from the protocol itself or a different git implementation on the
server to serve the different protocols is intellectually interesting
(thanks for that!), but materially inconsequential: if using git: will
be faster, we will use git:.

> I recall Norbert and I sat down during FOSDEM 2017 to solve perf
> issues with our JGit deployment.  Perhaps you configured your
> ‘remote..pushurl’ at the same time :-)

I can easily believe it was earlier.

> Anyway, it's easy enough to benchmark no-op `git fetch` on core.  master
> is currently at c99732d59bc6, and I'm fetching from the same datacenter
> to avoid metrics being polluted with network hiccups.

Yes, but no. You also test in an environment where a network RTT is
probably about one fifth to one third of a millisecond, and bandwidth
at least 100Mbps if not 1000Mbps? In that case, everything will be
fast. Time difference will be lost in noise. The interesting cases
will be:

1) Someone's out in the woods home DSL line in the woods; fiber hasn't
   come to that village yet, or has come to the town but not that
   particular street. RTT time about 50ms; bandwidth about 20 Mbps
   down (or less), much less up.

2) Case 1 added "on the other side of the world" (South-east asia?
   South America? New Zealand?), you can easily get RTT times of about
   300ms. Even if you are in a ultra-fast network (like university
   network). It is the other side of the world.

3) A coworking space that has good-for-typical-use connection, but
   then TDF does a hackfest there and a bunch of geeks (us) overflow
   the connection.

4) I'm at a conference, half listening to the presentation, half
   hacking on LibreOffice. The conference WiFi is overrun by everyone
   doing the same, people's laptops and pocket computers
   ("smartphones") automatically downloading updates (technical and
   social ones...), etc. How usable will it be? E.g. CCC (the Chaos
   Communication Congress) was known for having a totally overwhelmed
   WiFi; every year a new vendor would "gift" their better solution
   and this year the wireless network would actually be good! But
   every year it wasn't. (Has it actually improved in the last years
   that I didn't go?)

Are these protocols (or the *implementations* of these protocols) more
sensitive to RTT than another? They do more roundtrips? Or not?

-- 
Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: [TDF infra] Announcing Gitiles VCS browser (gitweb replacement) and https:// anon git URIs

2018-10-22 Thread Lionel Elie Mamane
On Wed, Oct 17, 2018 at 09:03:45PM +0200, Guilhem Moulin wrote:
> On Wed, 17 Oct 2018 at 14:05:27 +0200, Eike Rathke wrote:
>> On Wednesday, 2018-10-17 04:27:54 +0200, Guilhem Moulin wrote:

>>> Lastly, it's now possible to clone and fetch git repositories over
>>> https:// .  While git:// URLs will remain supported for the foreseeable
>>> future, they're intentionally no longer advertised in gerrit, and we
>>> encourage you to upgrade the scheme of your ‘remote..url’ to
>>> secure transports (SSH for authenticated access, or HTTPS for anonymous
>>> access).  We'll update ‘lode’ and chase remaining git:// URLs shortly.

>> Why is git:// deprecated? From what I know it's more efficient when
>> fetching/pulling than https:// (or ssh://?)

> Since v1.6.6 it's no longer true [0], cf. git-http-backend(1) and
> https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes

That webpage doesn't seem to contain a discussion of the efficiency of
the various protocols.

> We're using the so-called “smart” HTTP protocol, with a
> git-upload-pack(1) service on the server.

Interesting. Didn't know that. I'll fight less hard to use git: now.

> SSH is only used for transport, a git processed is exec()'ed on the
> remote just like for git-daemon(1), so the only overhead is
> crypto-related.  The handshake is a one-off thing, thus negligible
> when you're transferring a large amount of data at once; (...) As
> for symmetric crypto overhead, (...) the overhead should be
> negligible.

All I know is that about 1/2/3 years ago ('t was I think in some
coworking space in Brussels, probably a hackfest) I showed Michael
Meeks how to have a separate "push" url (with ssh: protocol) and
"pull" url (with git: protocol) and he was very happy at the
speed-up.

-- 
Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


scary / too subtle overload

2018-10-04 Thread Lionel Elie Mamane
In include/svtools/brwbox.hxx:

class SVT_DLLPUBLIC BrowseBox
{
public:
boolIsColumnSelected( sal_uInt16 nColumnId ) const;
// IAccessibleTableProvider
virtual boolIsColumnSelected( long _nColumn ) const 
override;
}

Function overload based on different integer types, one virtual, the
other not.  What could possibly go wrong? 

I'm tempted to rename one of the two... if it is LibreOffice-internal
only. I'm afraid both are part of our public API, but I'm not sure how
to check that again.

Any thoughts on that?

-- 
Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: OpenDocument spec tables row height [was: Writer - row-height, min-row-height and use-optimal-row-height]

2018-09-29 Thread Lionel Elie Mamane
In the absence of feedback from sw people, we just commit the change?

On Thu, Jul 26, 2018 at 03:10:37PM +0200, Lionel Elie Mamane wrote:
> Anybody?
> 
> On Sun, Jun 17, 2018 at 11:48:49AM +0200, Lionel Elie Mamane wrote:
> > Hi,
> > 
> > The Base report builder produces Writer (odt) documents directly (it
> > spits out XML, not using Writer to produce it), and then opens them in
> > Writer. It uses tables heavily.
> > 
> > In the context of
> > https://bugs.documentfoundation.org/show_bug.cgi?id=45789
> > https://gerrit.libreoffice.org/53977
> > Ilhan prepared a patch to make Report Builder mark some rows of some
> > tables as "fit to size" in row height. By reading the OpenDocument
> > specification, I thought this would happen by setting the
> > style:use-optimal-row-height attribute on the row. However, it turns
> > out that Ilhan had to change some sw code for that to work, and that
> > made me suspicious whether that was the right thing to do.
> > 
> > I looked into the XML generated by Writer with "Fit to Size" enabled
> > and disabled, and apparently that checkbox in writer replaces
> > "style:row-height" by "style:min-row-height, and
> > style:use-optimal-row-height is nowhere to be seen.
> > 
> > Could a Writer expert please look at the sw changes in
> > https://gerrit.libreoffice.org/53977
> > and let us know whether these changes are right or wrong with respect
> > to OpenDocument? Is style:use-optimal-row-height supposed to override
> > style:row-height or vice-versa?
> > 
> > Thanks in advance,
> > 
> ___
> LibreOffice mailing list
> LibreOffice@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


OpenDocument spec tables row height [was: Writer - row-height, min-row-height and use-optimal-row-height]

2018-07-26 Thread Lionel Elie Mamane
Anybody?

On Sun, Jun 17, 2018 at 11:48:49AM +0200, Lionel Elie Mamane wrote:
> Hi,
> 
> The Base report builder produces Writer (odt) documents directly (it
> spits out XML, not using Writer to produce it), and then opens them in
> Writer. It uses tables heavily.
> 
> In the context of
> https://bugs.documentfoundation.org/show_bug.cgi?id=45789
> https://gerrit.libreoffice.org/53977
> Ilhan prepared a patch to make Report Builder mark some rows of some
> tables as "fit to size" in row height. By reading the OpenDocument
> specification, I thought this would happen by setting the
> style:use-optimal-row-height attribute on the row. However, it turns
> out that Ilhan had to change some sw code for that to work, and that
> made me suspicious whether that was the right thing to do.
> 
> I looked into the XML generated by Writer with "Fit to Size" enabled
> and disabled, and apparently that checkbox in writer replaces
> "style:row-height" by "style:min-row-height, and
> style:use-optimal-row-height is nowhere to be seen.
> 
> Could a Writer expert please look at the sw changes in
> https://gerrit.libreoffice.org/53977
> and let us know whether these changes are right or wrong with respect
> to OpenDocument? Is style:use-optimal-row-height supposed to override
> style:row-height or vice-versa?
> 
> Thanks in advance,
> 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Writer - row-height, min-row-height and use use-optimal-row-height

2018-06-17 Thread Lionel Elie Mamane
Hi,

The Base report builder produces Writer (odt) documents directly (it
spits out XML, not using Writer to produce it), and then opens them in
Writer. It uses tables heavily.

In the context of
https://bugs.documentfoundation.org/show_bug.cgi?id=45789
https://gerrit.libreoffice.org/53977
Ilhan prepared a patch to make Report Builder mark some rows of some
tables as "fit to size" in row height. By reading the OpenDocument
specification, I thought this would happen by setting the
style:use-optimal-row-height attribute on the row. However, it turns
out that Ilhan had to change some sw code for that to work, and that
made me suspicious whether that was the right thing to do.

I looked into the XML generated by Writer with "Fit to Size" enabled
and disabled, and apparently that checkbox in writer replaces
"style:row-height" by "style:min-row-height, and
style:use-optimal-row-height is nowhere to be seen.

Could a Writer expert please look at the sw changes in
https://gerrit.libreoffice.org/53977
and let us know whether these changes are right or wrong with respect
to OpenDocument? Is style:use-optimal-row-height supposed to override
style:row-height or vice-versa?

Thanks in advance,

-- 
Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


tdf#117931 SuSE developer for library loading problem

2018-06-12 Thread Lionel Elie Mamane
https://bugs.documentfoundation.org/117931
appeared on a SuSE version upgrade for the user, and hasn't been
reproduced outside of this environment. The issue is that TDF build of
LibreOffice cannot anymore load a C++ library from an extension. At
first, my guess was that a C library being used by the C++ library was
wrongfully loaded from the system instead of from the extension, and
the upgrade yanked that library, but further testing suggests it is
not the case.

The problem is probably not that SuSE-specific, but that's the known
environment that triggers the problem; the weird thing is that the
first load attempt (just after the extension is installed) works, but
further attempts fail. My guess is something around LD_LIBRARY_PATH or
rpath or something like that.

Any SuSE-using developer wants to bite and trace/debug the library
loading attempt and why it fails?

The extension
https://extensions.libreoffice.org/extensions/mysql-native-connector/4.3
bundles both libmyqlcppconn.so and libmysqlclient_r.so. LibreOffice is
supposed to dlopen() first libmysqlclient_r.so, then libmyqlcppconn.so,
and some symbols used by libmyqlcppconn.so are in libmysqlclient_r.so
For some reason, the dlopen() of libmyqlcppconn.so fails.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


tdf#117333 dbahsql exception handling

2018-05-18 Thread Lionel Elie Mamane
Hi,

It looks to me like your patch will not keep subtypes (types derived
from) SQLException, but will instead "truncate" them to a
SQLException, and thus lose information.

Additionally, I would suggest, instead of silently suppressing all
subsequent errors, to chain all errors in one SQLException and then to
show them all in one dialog.

An SQLException has a "NextException" member, just stick the next
exception there. To avoid a Schlemiel the Painter / quadratic
algorithm, you can do something like (and factorise it in function,
I'd say), with the right Any-magic operators (<<=, >>=, etc) instead of
"=":

std::unique_ptr pTopException;
std::unique_ptr pBotException;

catch(SQLException )
{
  if (!pTopException)
  {
pTopException.reset(ex);
pLastException.reset(ex);
  }
  else
  {
assert(pLastException);
while(pLastException->NextException is not empty)
{
  pLastException.reset(pLastException->NextException);
  // This assumes pLastException will be a SQLException;
  // if it is not, I'm not sure what to do.
}
pLastException->NextException = ex;
  }
}

On Wed, May 16, 2018 at 09:11:40AM +, 
bugzilla-dae...@bugs.documentfoundation.org wrote:
> https://bugs.documentfoundation.org/show_bug.cgi?id=117333
> 
> --- Comment #3 from Commit Notification 
>  ---
> Tamas Bunth committed a patch related to this issue.
> It has been pushed to "master":
> 
> http://cgit.freedesktop.org/libreoffice/core/commit/?id=ea19b96b6beb0ce2f25705339d1d6342dc38b283
> 
> tdf#117333, tdf#117325 dbahsql: exception handling
> 
> It will be available in 6.1.0.
> 
> The patch should be included in the daily builds available at
> http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
> information about daily builds can be found at:
> http://wiki.documentfoundation.org/Testing_Daily_Builds
> 
> Affected users are encouraged to test the fix and report feedback.
> 
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2018-04-18 Thread Lionel Elie Mamane
 dbaccess/source/ui/dlg/DbAdminImpl.cxx |   13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

New commits:
commit d6fce54c82868b82bd6fa190db6047d69bbb3ecf
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Apr 18 18:54:05 2018 +0200

tdf#117053 create database wizard: set a property when it is supported

not only when we let the *user* set it in the "Advanced Settings" dialog.

There are two notions:
1) Does the driver/datasource support a property
2) Do we show the user any UI in "Advanced Settings" to change that
   property.

Notion 2 is called a _Feature_, notion 1 a _property_.

Database creation was saving properties only in case 2; the right
test is obviously case 1.

Change-Id: Ie740c9eb6768ae5f412a49119201e9211a9cd07d
Reviewed-on: https://gerrit.libreoffice.org/53121
    Reviewed-by: Lionel Elie Mamane <lio...@mamane.lu>
Tested-by: Jenkins <c...@libreoffice.org>

diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx 
b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 3f89b70a3845..49cdf5756619 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -690,18 +690,19 @@ void 
ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS
 // us)
 
 // first determine which of all the items are relevant for the data source 
(depends on the connection url)
-OUString eType = getDatasourceType(_rSource);
-std::vector< sal_Int32> aDetailIds;
-ODriversSettings::getSupportedIndirectSettings(eType, getORB(), 
aDetailIds);
+const OUString eType = getDatasourceType(_rSource);
+const ::connectivity::DriversConfig aDriverConfig(getORB());
+const ::comphelper::NamedValueCollection& aProperties = 
aDriverConfig.getProperties(eType);
 
 // collect the translated property values for the relevant items
 PropertyValueSet aRelevantSettings;
 MapInt2String::const_iterator aTranslation;
-for (auto const& detailId : aDetailIds)
+for (ItemID detailId = DSID_FIRST_ITEM_ID ; detailId <= DSID_LAST_ITEM_ID; 
++detailId)
 {
 const SfxPoolItem* pCurrent = 
_rSource.GetItem(static_cast(detailId));
 aTranslation = m_aIndirectPropTranslator.find(detailId);
-if ( pCurrent && (m_aIndirectPropTranslator.end() != aTranslation) )
+if ( pCurrent && (m_aIndirectPropTranslator.end() != aTranslation) &&
+ aProperties.has(aTranslation->second) )
 {
 if ( aTranslation->second == INFO_CHARSET )
 {
@@ -773,8 +774,6 @@ void 
ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS
 ::comphelper::removeElementAt(_rInfo, removeIndex);
 }
 
-::connectivity::DriversConfig aDriverConfig(getORB());
-const ::comphelper::NamedValueCollection& aProperties = 
aDriverConfig.getProperties(eType);
 Sequence< Any> aTypeSettings;
 aTypeSettings = aProperties.getOrDefault("TypeInfoSettings",aTypeSettings);
 // here we have a special entry for types from oracle
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-qa] HSQLDB to Firebird migration bugs and "regression" keyword

2018-04-13 Thread Lionel Elie Mamane
Hi,

I don't think it is reasonable to tag all bugs in the HSQLDB to
Firebird migration as regressions. These are bugs in a new feature, so
by definition cannot be regressions.

In the context of a mandatory migration, there is some argument to say
that they are regressions, but in case you didn't hear/read it yet, it
was agreed during the ESC call yesterday that the migration would be
_proposed_ to the user, and not launched without the user's consent.

Best Regards,

Lionel
___
List Name: Libreoffice-qa mailing list
Mail address: Libreoffice-qa@lists.freedesktop.org
Change settings: https://lists.freedesktop.org/mailman/listinfo/libreoffice-qa
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://lists.freedesktop.org/archives/libreoffice-qa/

HSQLDB to Firebird migration bugs and "regression" keyword

2018-04-13 Thread Lionel Elie Mamane
Hi,

I don't think it is reasonable to tag all bugs in the HSQLDB to
Firebird migration as regressions. These are bugs in a new feature, so
by definition cannot be regressions.

In the context of a mandatory migration, there is some argument to say
that they are regressions, but in case you didn't hear/read it yet, it
was agreed during the ESC call yesterday that the migration would be
_proposed_ to the user, and not launched without the user's consent.

Best Regards,

Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - connectivity/source

2018-04-11 Thread Lionel Elie Mamane
 connectivity/source/commontools/DateConversion.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4bb50524e385803fddc5047466fcf7ce19e1
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Apr 8 08:26:55 2018 +0200

SQL string quoting: escape "'" character also at beginning of string

Change-Id: I51db43c1a3b6d3c93a04a3419238ea286cab987e
Reviewed-on: https://gerrit.libreoffice.org/52578
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/connectivity/source/commontools/DateConversion.cxx 
b/connectivity/source/commontools/DateConversion.cxx
index 435a0cc21d19..4527fa6b4493 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -81,7 +81,7 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const 
Any& _rVal, bool b
 {
 OUString aTemp;
 _rxTypeConverter->convertToSimpleType(_rVal, 
TypeClass_STRING) >>= aTemp;
-sal_Int32 nIndex = (sal_Int32)-1;
+sal_Int32 nIndex = (sal_Int32)-2;
 const OUString sQuot("\'");
 do
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - dbaccess/source

2018-04-10 Thread Lionel Elie Mamane
 dbaccess/source/core/api/SingleSelectQueryComposer.cxx |   73 -
 dbaccess/source/core/inc/SingleSelectQueryComposer.hxx |2 
 2 files changed, 73 insertions(+), 2 deletions(-)

New commits:
commit 060e43da66c759de2c4799131e13c5156f01d492
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Apr 8 08:14:52 2018 +0200

tdf#116772 adapt handling of LIKE conditions to cleaned up StructuredFilter

Change-Id: Ifc60da9a95833ee7820a0e03354fa1a8c006e136
Reviewed-on: https://gerrit.libreoffice.org/52576
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx 
b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index 61859ffd1cca..17d4bd6806ee 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -1015,8 +1015,11 @@ bool OSingleSelectQueryComposer::setANDCriteria( 
OSQLParseNode const * pConditio
 {
 return 
setComparsionPredicate(pCondition,_rIterator,rFilter,xFormatter);
 }
-else if (SQL_ISRULE(pCondition,like_predicate) ||
- SQL_ISRULE(pCondition,test_for_null) ||
+else if (SQL_ISRULE(pCondition,like_predicate))
+{
+return setLikePredicate(pCondition,_rIterator,rFilter,xFormatter);
+}
+else if (SQL_ISRULE(pCondition,test_for_null) ||
  SQL_ISRULE(pCondition,in_predicate) ||
  SQL_ISRULE(pCondition,all_or_any_predicate) ||
  SQL_ISRULE(pCondition,between_predicate))
@@ -,6 +1114,72 @@ sal_Int32 
OSingleSelectQueryComposer::getPredicateType(OSQLParseNode const * _pP
 return nPredicate;
 }
 
+bool OSingleSelectQueryComposer::setLikePredicate(OSQLParseNode const * 
pCondition, OSQLParseTreeIterator const & _rIterator,
+std::vector < PropertyValue >& 
rFilter, const Reference< css::util::XNumberFormatter > & xFormatter) const
+{
+OSL_ENSURE(SQL_ISRULE(pCondition, like_predicate),"setLikePredicate: 
pCondition is not a LikePredicate");
+
+assert(pCondition->count() == 2);
+OSQLParseNode const *pRowValue = pCondition->getChild(0);
+OSQLParseNode const *pPart2 = pCondition->getChild(1);
+
+PropertyValue aItem;
+if ( SQL_ISTOKEN(pPart2->getChild(0),NOT) )
+aItem.Handle = SQLFilterOperator::NOT_LIKE;
+else
+aItem.Handle = SQLFilterOperator::LIKE;
+
+if (SQL_ISRULE(pRowValue, column_ref))
+{
+OUString aValue;
+
+// skip (optional "NOT") and "LIKE"
+for (size_t i=2; i < pPart2->count(); i++)
+{
+pPart2->getChild(i)->parseNodeToPredicateStr(
+aValue, m_xConnection, xFormatter, m_aLocale, 
static_cast(m_sDecimalSep.toChar() ) );
+}
+
+aItem.Name = getColumnName(pRowValue,_rIterator);
+aItem.Value <<= aValue;
+rFilter.push_back(aItem);
+}
+else if (SQL_ISRULE(pRowValue, set_fct_spec ) ||
+ SQL_ISRULE(pRowValue, general_set_fct))
+{
+OUString aValue;
+OUString aColumnName;
+
+pPart2->getChild(2)->parseNodeToPredicateStr(aValue, m_xConnection, 
xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) );
+pPart2->getChild(3)->parseNodeToPredicateStr(aValue, m_xConnection, 
xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) );
+pRowValue->parseNodeToPredicateStr( aColumnName, m_xConnection, 
xFormatter, m_aLocale, static_cast( m_sDecimalSep .toChar() ) );
+
+aItem.Name = getColumnName(pRowValue,_rIterator);
+aItem.Value <<= aValue;
+rFilter.push_back(aItem);
+}
+else // Can only be an expression
+{
+OUString aName, aValue;
+
+OSQLParseNode const *pValue = pPart2->getChild(2);
+
+// Field names
+for (size_t i=0;i< pRowValue->count();i++)
+ pRowValue->getChild(i)->parseNodeToPredicateStr( aName, 
m_xConnection, xFormatter, m_aLocale, static_cast( 
m_sDecimalSep.toChar() ) );
+
+// Criterion
+for(size_t i=0;i< pValue->count();i++)
+pValue->getChild(i)->parseNodeToPredicateStr(aValue, 
m_xConnection, xFormatter, m_aLocale, static_cast( 
m_sDecimalSep.toChar() ) );
+pPart2->getChild(3)->parseNodeToPredicateStr(aValue, m_xConnection, 
xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) );
+
+aItem.Name = aName;
+aItem.Value <<= aValue;
+rFilter.push_back(aItem);
+}
+return true;
+}
+
 bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode const * 
pCondition, OSQLParseTreeIterator const & _rIterator,
 std::vector < PropertyValue >& 
rFilter, const Reference<

[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - connectivity/source

2018-04-10 Thread Lionel Elie Mamane
 connectivity/source/commontools/DateConversion.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1ddb065adcd0c2f5666e86bdf841d818ab7a215e
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Apr 8 08:26:55 2018 +0200

SQL string quoting: escape "'" character also at beginning of string

Change-Id: I51db43c1a3b6d3c93a04a3419238ea286cab987e
Reviewed-on: https://gerrit.libreoffice.org/52577
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

diff --git a/connectivity/source/commontools/DateConversion.cxx 
b/connectivity/source/commontools/DateConversion.cxx
index 39acab5c1092..765937fe39c0 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -80,7 +80,7 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const 
Any& _rVal,
 {
 OUString aTemp;
 _rxTypeConverter->convertToSimpleType(_rVal, 
TypeClass_STRING) >>= aTemp;
-sal_Int32 nIndex = (sal_Int32)-1;
+sal_Int32 nIndex = (sal_Int32)-2;
 const OUString sQuot("\'");
 do
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-08 Thread Lionel Elie Mamane
 connectivity/source/commontools/DateConversion.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7f8d611b9fab034ed13202bcc41ff5ef0270c198
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Apr 8 08:26:55 2018 +0200

SQL string quoting: escape "'" character also at beginning of string

Change-Id: I51db43c1a3b6d3c93a04a3419238ea286cab987e
Reviewed-on: https://gerrit.libreoffice.org/52575
Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Lionel Elie Mamane <lio...@mamane.lu>

diff --git a/connectivity/source/commontools/DateConversion.cxx 
b/connectivity/source/commontools/DateConversion.cxx
index 4fa1c8c1deb7..967c8b5696db 100644
--- a/connectivity/source/commontools/DateConversion.cxx
+++ b/connectivity/source/commontools/DateConversion.cxx
@@ -80,7 +80,7 @@ OUString DBTypeConversion::toSQLString(sal_Int32 eType, const 
Any& _rVal,
 {
 OUString aTemp;
 _rxTypeConverter->convertToSimpleType(_rVal, 
TypeClass_STRING) >>= aTemp;
-sal_Int32 nIndex = sal_Int32(-1);
+sal_Int32 nIndex = sal_Int32(-2);
 const OUString sQuot("\'");
 do
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - dbaccess/source

2018-04-08 Thread Lionel Elie Mamane
 dbaccess/source/core/api/SingleSelectQueryComposer.cxx |   74 -
 dbaccess/source/core/inc/SingleSelectQueryComposer.hxx |2 
 2 files changed, 73 insertions(+), 3 deletions(-)

New commits:
commit e29435932d84076c4d9c443e6f6fd95a08799386
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Apr 8 08:14:52 2018 +0200

tdf#116772 adapt handling of LIKE conditions to cleaned up StructuredFilter

Change-Id: Ifc60da9a95833ee7820a0e03354fa1a8c006e136
Reviewed-on: https://gerrit.libreoffice.org/52573
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Lionel Elie Mamane <lio...@mamane.lu>

diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx 
b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index f35ee41c1f44..e7a7af6870e9 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -1003,8 +1003,11 @@ bool OSingleSelectQueryComposer::setANDCriteria( 
OSQLParseNode const * pConditio
 {
 return 
setComparsionPredicate(pCondition,_rIterator,rFilter,xFormatter);
 }
-else if (SQL_ISRULE(pCondition,like_predicate) ||
- SQL_ISRULE(pCondition,test_for_null) ||
+else if (SQL_ISRULE(pCondition,like_predicate))
+{
+return setLikePredicate(pCondition,_rIterator,rFilter,xFormatter);
+}
+else if (SQL_ISRULE(pCondition,test_for_null) ||
  SQL_ISRULE(pCondition,in_predicate) ||
  SQL_ISRULE(pCondition,all_or_any_predicate) ||
  SQL_ISRULE(pCondition,between_predicate))
@@ -1099,6 +1102,72 @@ sal_Int32 
OSingleSelectQueryComposer::getPredicateType(OSQLParseNode const * _pP
 return nPredicate;
 }
 
+bool OSingleSelectQueryComposer::setLikePredicate(OSQLParseNode const * 
pCondition, OSQLParseTreeIterator const & _rIterator,
+std::vector < PropertyValue >& 
rFilter, const Reference< css::util::XNumberFormatter > & xFormatter) const
+{
+OSL_ENSURE(SQL_ISRULE(pCondition, like_predicate),"setLikePredicate: 
pCondition is not a LikePredicate");
+
+assert(pCondition->count() == 2);
+OSQLParseNode const *pRowValue = pCondition->getChild(0);
+OSQLParseNode const *pPart2 = pCondition->getChild(1);
+
+PropertyValue aItem;
+if ( SQL_ISTOKEN(pPart2->getChild(0),NOT) )
+aItem.Handle = SQLFilterOperator::NOT_LIKE;
+else
+aItem.Handle = SQLFilterOperator::LIKE;
+
+if (SQL_ISRULE(pRowValue, column_ref))
+{
+OUString aValue;
+
+// skip (optional "NOT") and "LIKE"
+for (size_t i=2; i < pPart2->count(); i++)
+{
+pPart2->getChild(i)->parseNodeToPredicateStr(
+aValue, m_xConnection, xFormatter, m_aLocale, 
static_cast(m_sDecimalSep.toChar() ) );
+}
+
+aItem.Name = getColumnName(pRowValue,_rIterator);
+aItem.Value <<= aValue;
+rFilter.push_back(aItem);
+}
+else if (SQL_ISRULE(pRowValue, set_fct_spec ) ||
+ SQL_ISRULE(pRowValue, general_set_fct))
+{
+OUString aValue;
+OUString aColumnName;
+
+pPart2->getChild(2)->parseNodeToPredicateStr(aValue, m_xConnection, 
xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) );
+pPart2->getChild(3)->parseNodeToPredicateStr(aValue, m_xConnection, 
xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) );
+pRowValue->parseNodeToPredicateStr( aColumnName, m_xConnection, 
xFormatter, m_aLocale, static_cast( m_sDecimalSep .toChar() ) );
+
+aItem.Name = getColumnName(pRowValue,_rIterator);
+aItem.Value <<= aValue;
+rFilter.push_back(aItem);
+}
+else // Can only be an expression
+{
+OUString aName, aValue;
+
+OSQLParseNode const *pValue = pPart2->getChild(2);
+
+// Field names
+for (size_t i=0;i< pRowValue->count();i++)
+ pRowValue->getChild(i)->parseNodeToPredicateStr( aName, 
m_xConnection, xFormatter, m_aLocale, static_cast( 
m_sDecimalSep.toChar() ) );
+
+// Criterion
+for(size_t i=0;i< pValue->count();i++)
+pValue->getChild(i)->parseNodeToPredicateStr(aValue, 
m_xConnection, xFormatter, m_aLocale, static_cast( 
m_sDecimalSep.toChar() ) );
+pPart2->getChild(3)->parseNodeToPredicateStr(aValue, m_xConnection, 
xFormatter, m_aLocale, static_cast( m_sDecimalSep.toChar() ) );
+
+aItem.Name = aName;
+aItem.Value <<= aValue;
+rFilter.push_back(aItem);
+}
+return true;
+}
+
 bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode const * 
pCondition, OSQLParseTreeIterator const & _rIterator,
 std::vector < PropertyValue >& 
rFilter, const Reference<

Re: GSoC'18 Getting Started with Listbox separate Read Values from Input Values

2018-03-15 Thread Lionel Elie Mamane
Hi,

Your description is correct. Forms are a component that is not per se
strictly part of Base, it is shared with also at least Writer and
Calc. They are just used much more intensively by Base than by other
parts of LibreOffice :)

In first approximation, the work you describe would happen entirely
within the Forms component, files

forms/source/component/ListBox.cxx
forms/source/component/ListBox.hxx
forms/source/component/BaseListBox.hxx

plus the service/interface definition for a ListBox in

offapi/com/sun/star/form/component/ListBox.idl
offapi/com/sun/star/form/control/ListBox.idl

plus the low-level implementation

vcl/source/control/listbox.cxx
vcl/source/control/imp_listbox.cxx
vcl/inc/listbox.hxx

Best Regards,

Lionel

On Thu, Mar 15, 2018 at 05:54:27PM +0530, Hrishabh Rajput wrote:
> Currently, I am trying to understand the problem and sending patches to
> some easyhacks, but it would be nice if some guidance and resources are
> provided on the project topic in order to get a better understanding.
> 
> Thanks,
> Hrishabh
> 
> On Sun, Mar 4, 2018 at 2:28 PM, Hrishabh Rajput 
> wrote:
> 
> > Hello Community,
> >
> > I am Hrishabh Rajput, 2nd year undergraduate student from Indian Institute
> > of Technology, Kharagpur (IIT KGP). I performed my first build successfully
> > in September'17. Also, I am very well familiar with the C++ language. (IRC
> > Nick: hrishabh)
> >
> > I am interested in and would like to work on the GSoC project related to
> > LibreOffice Base, ListBox separate Read Values from Input Values:
> > https://wiki.documentfoundation.org/Development/GSoC/Ideas#
> > Listbox_separate_read_values_from_input_values. I have already started to
> > explore the project and to understand the implementation of ListBox.
> >
> > I found out that the Modules "connectivity" and "dbaccess" are under the
> > Database Access Project. And the modules "forms" and "svx" are also related
> > to Database Access, but are in different projects. Found this out from
> > https://www.openoffice.org/dba/development/project_structure.html.
> > Probably, I will be working in these modules for most of my time, if not
> > all, particularly in the file ListBox.cxx ( https://opengrok.libreoffice.
> > org/xref/core/forms/source/component/ListBox.cxx ).
> >
> > I also made myself familiar with LO Base, and tried to understand the
> > implementation of ListBox and it's terminology. What I got is that the list
> > entries are the strings that are shown to the user. These list entries are
> > mapped to the ValueList, and they together form the List Content. The
> > ValueList is mapped to the Datafield (which is a column of the Value Table
> > of the Database).
> >
> > It would be great if some insight and guidance is provided on the project
> > and correctness of the above information.
> >
> > Thank you.
> >
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Co-mentor sought: Listbox separate Read Values from Input Values

2018-03-15 Thread Lionel Elie Mamane
Anybody feels like co-mentoring that project with me?

Hrishabh, note that Google currently refuses to accept mail from me to
gmail.com addresses, and I am thus unable to email you.

On Sun, Mar 04, 2018 at 02:28:33PM +0530, Hrishabh Rajput wrote:
> Hello Community,
> 
> I am Hrishabh Rajput, 2nd year undergraduate student from Indian Institute
> of Technology, Kharagpur (IIT KGP). I performed my first build successfully
> in September'17. Also, I am very well familiar with the C++ language. (IRC
> Nick: hrishabh)
> 
> I am interested in and would like to work on the GSoC project related to
> LibreOffice Base, ListBox separate Read Values from Input Values:
> https://wiki.documentfoundation.org/Development/GSoC/Ideas#Listbox_separate_read_values_from_input_values.
> I have already started to explore the project and to understand the
> implementation of ListBox.
> 
> I found out that the Modules "connectivity" and "dbaccess" are under the
> Database Access Project. And the modules "forms" and "svx" are also related
> to Database Access, but are in different projects. Found this out from
> https://www.openoffice.org/dba/development/project_structure.html.
> Probably, I will be working in these modules for most of my time, if not
> all, particularly in the file ListBox.cxx (
> https://opengrok.libreoffice.org/xref/core/forms/source/component/ListBox.cxx
> ).
> 
> I also made myself familiar with LO Base, and tried to understand the
> implementation of ListBox and it's terminology. What I got is that the list
> entries are the strings that are shown to the user. These list entries are
> mapped to the ValueList, and they together form the List Content. The
> ValueList is mapped to the Datafield (which is a column of the Value Table
> of the Database).
> 
> It would be great if some insight and guidance is provided on the project
> and correctness of the above information.
> 
> Thank you.

> ___
> LibreOffice mailing list
> LibreOffice@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


spam in our bugzilla

2018-01-22 Thread Lionel Elie Mamane
Where are we supposed to report spam in our bugzilla?

see
https://bugs.documentfoundation.org/show_bug.cgi?id=104905#c14
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2018-01-07 Thread Lionel Elie Mamane
 connectivity/source/inc/java/sql/Connection.hxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 27da558d7c1fe45b58d0bcc28b961fabbc5f2f1a
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jan 7 07:53:05 2018 +0100

fixup tdf#104986 move named parameters substitution into generic layer

remove now unused class member

Change-Id: I30ffcf60833580a5f0029fa4efef80507d7918df
Reviewed-on: https://gerrit.libreoffice.org/47524
Reviewed-by: Lionel Elie Mamane <lio...@mamane.lu>
Tested-by: Jenkins <c...@libreoffice.org>

diff --git a/connectivity/source/inc/java/sql/Connection.hxx 
b/connectivity/source/inc/java/sql/Connection.hxx
index 117d502b2c5e..bab9329dfb1c 100644
--- a/connectivity/source/inc/java/sql/Connection.hxx
+++ b/connectivity/source/inc/java/sql/Connection.hxx
@@ -52,7 +52,6 @@ namespace connectivity
 jclass  m_Driver_theClass;
 java::sql::ConnectionLog
 m_aLogger;
-boolm_bParameterSubstitution;
 boolm_bIgnoreDriverPrivileges;
 boolm_bIgnoreCurrency;
 css::uno::Any   m_aCatalogRestriction;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: tdf#114788 help needed on SvTreeListBox usage

2018-01-04 Thread Lionel Elie Mamane
Apparently, "EditingEntry" is called. If it returns true, the edit is
allowed to proceed, if it returns false the item is not editable.

On Thu, Jan 04, 2018 at 10:26:31AM +0100, Lionel Elie Mamane wrote:
> Julien found it!
> 
> On Wed, Jan 03, 2018 at 04:25:15PM +0100, Lionel Elie Mamane wrote:
> 
> > So, Base has (file svx/source/form/filtnav.cxx) class
> > FmFilterNavigator which is a SvTreeListBox. (See
> > https://bugs.documentfoundation.org/114788 for how to display it.)
> 
> > The structure on screen looks like (for example):
> 
> > MainForm Or ID: 5 Or f1: 'blah' (...) I cannot for the life of me
> >  find the bit of code that decides what is editable and what is not.
> ___
> LibreOffice mailing list
> LibreOffice@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: tdf#114788 help needed on SvTreeListBox usage

2018-01-04 Thread Lionel Elie Mamane
Julien found it!

On Wed, Jan 03, 2018 at 04:25:15PM +0100, Lionel Elie Mamane wrote:

> So, Base has (file svx/source/form/filtnav.cxx) class
> FmFilterNavigator which is a SvTreeListBox. (See
> https://bugs.documentfoundation.org/114788 for how to display it.)

> The structure on screen looks like (for example):

> MainForm Or ID: 5 Or f1: 'blah' (...) I cannot for the life of me
>  find the bit of code that decides what is editable and what is not.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Jenkins incoherence

2018-01-04 Thread Lionel Elie Mamane
On Thu, Jan 04, 2018 at 08:15:14AM +0100, Markus Mohrhard wrote:
> On Thu, Jan 4, 2018 at 8:06 AM, Lionel Elie Mamane <lio...@mamane.lu> wrote:

>> https://ci.libreoffice.org/job/lo_gerrit/25062/
>> looks like Jenkins build different code on (Windows and MacOS X) vs
>> GNU/Linux. (...)

>> git checkout -f adf948a0895896976b138fb2e81c8b558c7af68f # timeout=30
>> vs
>> git checkout -f be4f19381ef0ae17c6ef964740fc671258ed0b78 # timeout=30

> Note that we nowadays only build OSX and Windows with jenkins if the linux
> build succeeds. As a result your job did not start a build on these
> platforms and you can notice that if you select the OSX build you'll get
> the results of the 25058 build instead of the 25062.

Indeed. At least in our usage of the tool, it is counter-intuitive
that on the page for 25062, one gets the result and a link to another
build. I assume the Jenkins devs have a reasoning for that. To satisfy
my curiosity, how is that "other build" chosen? Most recent? Most
recent successful?

Now that I look more closely, I also notice that the URL is
constructed the other way round:

 * this build:  
https://ci.libreoffice.org/job/lo_gerrit/${BUILD_NUMBER}/Config=${CONFIG}/
 * other build: 
https://ci.libreoffice.org/job/lo_gerrit/Config=${CONFIG}/${BUILD_NUMBER}/

Thanks for the explanation, now I will know what to look for :)

-- 
Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Jenkins incoherence

2018-01-03 Thread Lionel Elie Mamane
https://ci.libreoffice.org/job/lo_gerrit/25062/
looks like Jenkins build different code on (Windows and MacOS X) vs
GNU/Linux. Given the error on the GNU/Linux builds, I don't understand
how any other platform could build. At first I thought Jenkins build
without Firebird on MacOS X and Windows, but the build log shows
connectivity/source/drivers/firebird being built.

Indeed:

git checkout -f adf948a0895896976b138fb2e81c8b558c7af68f # timeout=30
vs
git checkout -f be4f19381ef0ae17c6ef964740fc671258ed0b78 # timeout=30
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2018-01-03 Thread Lionel Elie Mamane
 connectivity/registry/firebird/org/openoffice/Office/DataAccess/Drivers.xcu |  
 10 ++
 connectivity/source/commontools/dbmetadata.cxx  |  
  9 ++
 connectivity/source/drivers/firebird/Connection.cxx |  
 29 
 connectivity/source/drivers/firebird/Connection.hxx |  
  8 --
 connectivity/source/drivers/jdbc/JConnection.cxx|  
 36 --
 connectivity/source/drivers/odbc/OConnection.cxx|  
  3 
 connectivity/source/drivers/odbc/OPreparedStatement.cxx |  
 19 -
 connectivity/source/inc/odbc/OConnection.hxx|  
  2 
 connectivity/source/parse/sqlnode.cxx   |  
  5 +
 include/connectivity/dbmetadata.hxx |  
  4 +
 10 files changed, 31 insertions(+), 94 deletions(-)

New commits:
commit a29d97e6ddab8ec002ba9827bd5fc874117712e0
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Tue Jan 2 22:49:31 2018 +0100

tdf#104986 move named parameters substitution into generic layer

Previously, drivers were responsible for making the substitution themselves.
In practice they all (Firebird, ODBC and JDBC) used the LibreOffice SQL
parser to parse the SQL statement and do the substitution.

This had a few negative consequences:
 * The substitition was applied to _all_ SQL commands, including
   queries having the "execute SQL directly" bit set. Which means
   that the SQL was _not_ sent to the DBMS exactly as typed by
   the user. Even if there was no substitution to be made, since
   the SQL command was always round-tripped through the parser,
   thus "normalising" it (which is what led to tdf#104986).
 * "execute SQL directly" queries "magically" behaved slightly
   differently depending on whether the LibreOffice SQL parser
   succeeded in parsing them or not.

Change-Id: Ieedc643f33467435a139e2565a01e6f398af041f
Reviewed-on: https://gerrit.libreoffice.org/47283
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Lionel Elie Mamane <lio...@mamane.lu>

diff --git 
a/connectivity/registry/firebird/org/openoffice/Office/DataAccess/Drivers.xcu 
b/connectivity/registry/firebird/org/openoffice/Office/DataAccess/Drivers.xcu
index e5ff61f28262..03896aff4412 100644
--- 
a/connectivity/registry/firebird/org/openoffice/Office/DataAccess/Drivers.xcu
+++ 
b/connectivity/registry/firebird/org/openoffice/Office/DataAccess/Drivers.xcu
@@ -61,6 +61,11 @@
 false
   
 
+
+  
+true
+  
+
   
   
   
@@ -95,6 +100,11 @@
 false
   
 
+
+  
+true
+  
+
   
   
   
diff --git a/connectivity/source/commontools/dbmetadata.cxx 
b/connectivity/source/commontools/dbmetadata.cxx
index 50abe346fba2..e40cde6c4bcd 100644
--- a/connectivity/source/commontools/dbmetadata.cxx
+++ b/connectivity/source/commontools/dbmetadata.cxx
@@ -301,6 +301,15 @@ namespace dbtools
 return doGenerate;
 }
 
+bool DatabaseMetaData::shouldSubstituteParameterNames() const
+{
+bool doSubstitute( true );
+Any setting;
+if ( lcl_getConnectionSetting( "ParameterNameSubstitution", *m_pImpl, 
setting ) )
+OSL_VERIFY( setting >>= doSubstitute );
+return doSubstitute;
+}
+
 bool DatabaseMetaData::isAutoIncrementPrimaryKey() const
 {
 bool is( true );
diff --git a/connectivity/source/drivers/firebird/Connection.cxx 
b/connectivity/source/drivers/firebird/Connection.cxx
index 32e314029f7f..7d0937e3ae99 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -393,30 +393,6 @@ Reference< XStatement > SAL_CALL 
Connection::createStatement( )
 return xReturn;
 }
 
-OUString Connection::transformPreparedStatement(const OUString& _sSQL)
-{
-OUString sSqlStatement (_sSQL);
-try
-{
-OSQLParser aParser( m_xDriver->getContext() );
-OUString sErrorMessage;
-OUString sNewSql;
-OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,_sSQL);
-if(pNode)
-{   // special handling for parameters
-OSQLParseNode::substituteParameterNames(pNode);
-pNode->parseNodeToStr( sNewSql, this );
-delete pNode;
-sSqlStatement = sNewSql;
-}
-}
-catch(const Exception&)
-{
-SAL_WARN("connectivity.firebird", "failed to remove named parameters 
from '" << _sSQL << "'");
-}
-return sSqlStatement;
-}
-
 Reference< XPreparedStatement > SAL_CALL Connection::prepar

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

2018-01-03 Thread Lionel Elie Mamane
 connectivity/source/drivers/firebird/PreparedStatement.cxx |   28 +++--
 1 file changed, 16 insertions(+), 12 deletions(-)

New commits:
commit 1bbadad79d91005dc18a3c1e34de14d02660f6ab
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Tue Jan 2 22:55:45 2018 +0100

firebird-sdbc: check parameter index before setting in all cases

Change-Id: I291b0436a7cfde07879436a753329b52ff0c1049
Reviewed-on: https://gerrit.libreoffice.org/47284
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Lionel Elie Mamane <lio...@mamane.lu>

diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx 
b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index f951537fde28..8b00beb20626 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -348,6 +348,7 @@ void SAL_CALL OPreparedStatement::setNull(sal_Int32 nIndex, 
sal_Int32 /*nSqlType
 checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
 ensurePrepared();
 
+checkParameterIndex(nIndex);
 setParameterNull(nIndex);
 }
 
@@ -584,6 +585,7 @@ void OPreparedStatement::setClob( sal_Int32 
nParameterIndex, const OUString& rSt
 {
 ::osl::MutexGuard aGuard( m_aMutex );
 checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
+checkParameterIndex(nParameterIndex);
 
 #if SAL_TYPES_SIZEOFPOINTER == 8
 isc_blob_handle aBlobHandle = 0;
@@ -622,6 +624,7 @@ void SAL_CALL OPreparedStatement::setBlob(sal_Int32 
nParameterIndex,
 {
 ::osl::MutexGuard aGuard(m_aMutex);
 checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
+checkParameterIndex(nParameterIndex);
 
 #if SAL_TYPES_SIZEOFPOINTER == 8
 isc_blob_handle aBlobHandle = 0;
@@ -668,19 +671,19 @@ void SAL_CALL OPreparedStatement::setBlob(sal_Int32 
nParameterIndex,
 }
 
 
-void SAL_CALL OPreparedStatement::setArray( sal_Int32, const Reference< XArray 
>& )
+void SAL_CALL OPreparedStatement::setArray( sal_Int32 nIndex, const Reference< 
XArray >& )
 {
 ::osl::MutexGuard aGuard( m_aMutex );
 checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
+checkParameterIndex(nIndex);
 }
 
 
-void SAL_CALL OPreparedStatement::setRef( sal_Int32, const Reference< XRef >& )
+void SAL_CALL OPreparedStatement::setRef( sal_Int32 nIndex, const Reference< 
XRef >& )
 {
 ::osl::MutexGuard aGuard( m_aMutex );
 checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
+checkParameterIndex(nIndex);
 }
 
 
@@ -762,19 +765,19 @@ void SAL_CALL OPreparedStatement::setObjectWithInfo( 
sal_Int32 parameterIndex, c
 }
 
 
-void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32, sal_Int32, const 
::rtl::OUString& )
+void SAL_CALL OPreparedStatement::setObjectNull( sal_Int32 nIndex, sal_Int32, 
const ::rtl::OUString& )
 {
 ::osl::MutexGuard aGuard( m_aMutex );
 checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
+checkParameterIndex(nIndex);
 }
 
 
-void SAL_CALL OPreparedStatement::setObject( sal_Int32, const Any& )
+void SAL_CALL OPreparedStatement::setObject( sal_Int32 nIndex, const Any& )
 {
 ::osl::MutexGuard aGuard( m_aMutex );
 checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
+checkParameterIndex(nIndex);
 }
 
 void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex,
@@ -782,6 +785,7 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 
nParameterIndex,
 {
 ::osl::MutexGuard aGuard(m_aMutex);
 checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
+checkParameterIndex(nParameterIndex);
 
 #if SAL_TYPES_SIZEOFPOINTER == 8
 isc_blob_handle aBlobHandle = 0;
@@ -825,19 +829,19 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 
nParameterIndex,
 }
 
 
-void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32, const 
Reference< css::io::XInputStream >&, sal_Int32 )
+void SAL_CALL OPreparedStatement::setCharacterStream( sal_Int32 nIndex, const 
Reference< css::io::XInputStream >&, sal_Int32 )
 {
 ::osl::MutexGuard aGuard( m_aMutex );
 checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
+checkParameterIndex(nIndex);
 }
 
 
-void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32, const Reference< 
css::io::XInputStream >&, sal_Int32 )
+void SAL_CALL OPreparedStatement::setBinaryStream( sal_Int32 nIndex, const 
Reference< css::io::XInputStream >&, sal_Int32 )
 {
 ::osl::MutexGuard aGuard( m_aMutex );
 checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed);
-
+checkParameterIndex(nIndex);
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


tdf#114788 help needed on SvTreeListBox usage

2018-01-03 Thread Lionel Elie Mamane
Hi,

So, Base has (file svx/source/form/filtnav.cxx) class
FmFilterNavigator which is a SvTreeListBox. (See
https://bugs.documentfoundation.org/114788 for how to display it.)

The structure on screen looks like (for example):

MainForm
 Or
  ID: 5
 Or
  f1: 'blah'


The issue is:

 "MainForm" should _not_ be editable. If the user clicks on that, it
 should maybe expand/collapse children, BUT DON'T ALLOW THE USER TO
 EDIT the "MainForm" string.

 "Or" should likewise _not_ be editable.

 The children of "Or" should _be_ editable.

The situation now is that this is inverted. What should be editable is
not, and what should not be is. This has been traced back to
"somewhere between LibreOffice 5.0 and 5.1", but I cannot for the life
of me find the bit of code that decides what is editable and what is
not.

I looked at
 git log -p libreoffice-5-0..libreoffice-5-1 -- svx/source/form/filtnav.*

but that didn't bring any inspiration of why this regression was
introduced in 5.1.

Some kind soul that knows about SvListTreeBox could help us there?

Thanks in advance.

Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - dbaccess/source

2017-12-28 Thread Lionel Elie Mamane
 dbaccess/source/ui/dlg/directsql.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 31b0920a8018979bd8b0b5bf804edcf61f89fd67
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Dec 27 10:17:24 2017 +0100

tdf#114702 don't use XMultipleResultset unless DatabaseMetaData says we can

Change-Id: Icec98d35c2f60adf4a31e492c6cb708e82e47a58

(cherry picked from commit 3c567e55e6aed9e0da892d8b9fc09f8a0c784fcc)

Change-Id: Ibf153cf310fbd00012bb34603614f747f9012e4a
Reviewed-on: https://gerrit.libreoffice.org/47123
Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
Tested-by: Jenkins <c...@libreoffice.org>

diff --git a/dbaccess/source/ui/dlg/directsql.cxx 
b/dbaccess/source/ui/dlg/directsql.cxx
index 8d4cfc1946c7..8ea220d90d8e 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -191,9 +191,11 @@ namespace dbaui
 {
 // create a statement
 Reference< XStatement > xStatement = 
m_xConnection->createStatement();
+
+Reference xMeta = m_xConnection->getMetaData();
 css::uno::Reference< css::sdbc::XMultipleResults > xMR ( 
xStatement, UNO_QUERY );
 
-if (xMR.is())
+if (xMeta.is() && xMeta->supportsMultipleResultSets() && xMR.is())
 {
 bool hasRS = xStatement->execute(_rStatement);
 if(hasRS)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - dbaccess/source

2017-12-28 Thread Lionel Elie Mamane
 dbaccess/source/core/api/statement.cxx |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit feb476f67a906d01697d4e5b9ffca5b8da2fb987
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Thu Dec 28 06:16:30 2017 +0100

dbaccess OStatementBase: correctly check database metadata

the previous test didn't make any sense:
 * if xMeta.is(), then the test evaluated to false
 * if !xMeta.is(), then it called supportsMultipleResultSets
   (or supportsBatchUpdates, respectively) on a NULL pointer,
   which guaranteed a segfault / assert.

Change-Id: I6d6b93350557936b924a286732ae6d4f5ab2ce56

(cherry picked from commit 66d7540bcf3f82de906a588f01d1fbedc3d2928c)

Change-Id: Icb33a8d344cc5644fc4722e02aabfed6bbbc0e5d
Reviewed-on: https://gerrit.libreoffice.org/47125
Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
Tested-by: Jenkins <c...@libreoffice.org>

diff --git a/dbaccess/source/core/api/statement.cxx 
b/dbaccess/source/core/api/statement.cxx
index f25e08be6a43..54f412fcf065 100644
--- a/dbaccess/source/core/api/statement.cxx
+++ b/dbaccess/source/core/api/statement.cxx
@@ -321,7 +321,7 @@ Reference< XResultSet > SAL_CALL 
OStatementBase::getResultSet(  )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsMultipleResultSets())
+if (!xMeta.is() || !xMeta->supportsMultipleResultSets())
 throwFunctionSequenceException(*this);
 
 return Reference< XMultipleResults >(m_xAggregateAsSet, 
UNO_QUERY)->getResultSet();
@@ -334,7 +334,7 @@ sal_Int32 SAL_CALL OStatementBase::getUpdateCount(  )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsMultipleResultSets())
+if (!xMeta.is() || !xMeta->supportsMultipleResultSets())
 throwFunctionSequenceException(*this);
 
 return Reference< XMultipleResults >(m_xAggregateAsSet, 
UNO_QUERY)->getUpdateCount();
@@ -347,7 +347,7 @@ sal_Bool SAL_CALL OStatementBase::getMoreResults(  )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsMultipleResultSets())
+if (!xMeta.is() || !xMeta->supportsMultipleResultSets())
 throwFunctionSequenceException(*this);
 
 // free the previous results
@@ -364,7 +364,7 @@ void SAL_CALL OStatementBase::addBatch(  )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsBatchUpdates())
+if (!xMeta.is() || !xMeta->supportsBatchUpdates())
 throwFunctionSequenceException(*this);
 
 Reference< XPreparedBatchExecution >(m_xAggregateAsSet, 
UNO_QUERY)->addBatch();
@@ -377,7 +377,7 @@ void SAL_CALL OStatementBase::clearBatch(  )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsBatchUpdates())
+if (!xMeta.is() || !xMeta->supportsBatchUpdates())
 throwFunctionSequenceException(*this);
 
 Reference< XPreparedBatchExecution >(m_xAggregateAsSet, 
UNO_QUERY)->clearBatch();
@@ -390,7 +390,7 @@ Sequence< sal_Int32 > SAL_CALL 
OStatementBase::executeBatch(  )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsBatchUpdates())
+if (!xMeta.is() || !xMeta->supportsBatchUpdates())
 throwFunctionSequenceException(*this);
 
 // free the previous results
@@ -496,7 +496,7 @@ void OStatement::addBatch( const OUString& _rSQL )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsBatchUpdates())
+if (!xMeta.is() || !xMeta->supportsBatchUpdates())
 throwFunctionSequenceException(*this);
 
 OUString sSQL( impl_doEscapeProcessing_nothrow( _rSQL ) );
@@ -509,7 +509,7 @@ void OStatement::clearBatch( )
 ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsBatchUpdates())
+if (!xMeta.is() || !xMeta->supportsBatchUpdates())
 throwFunctionSequenceException(*this);
 
 Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->clearBatch();

[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - dbaccess/source

2017-12-28 Thread Lionel Elie Mamane
 dbaccess/source/ui/dlg/directsql.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit bec82bc44813fb170602f523e8f7d541d1c94dcb
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Dec 27 10:17:24 2017 +0100

tdf#114702 don't use XMultipleResultset unless DatabaseMetaData says we can

Change-Id: Icec98d35c2f60adf4a31e492c6cb708e82e47a58

(cherry picked from commit 3c567e55e6aed9e0da892d8b9fc09f8a0c784fcc)

Change-Id: If928bbe7985e36855dbf9d83fa09cdec2b48578e
Reviewed-on: https://gerrit.libreoffice.org/47124
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/dbaccess/source/ui/dlg/directsql.cxx 
b/dbaccess/source/ui/dlg/directsql.cxx
index dbb7a78eb8ca..1c3406693bfd 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -190,9 +190,11 @@ namespace dbaui
 {
 // create a statement
 Reference< XStatement > xStatement = 
m_xConnection->createStatement();
+
+Reference xMeta = m_xConnection->getMetaData();
 css::uno::Reference< css::sdbc::XMultipleResults > xMR ( 
xStatement, UNO_QUERY );
 
-if (xMR.is())
+if (xMeta.is() && xMeta->supportsMultipleResultSets() && xMR.is())
 {
 bool hasRS = xStatement->execute(_rStatement);
 if(hasRS)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-28 Thread Lionel Elie Mamane
 dbaccess/source/ui/dlg/directsql.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 3c567e55e6aed9e0da892d8b9fc09f8a0c784fcc
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Dec 27 10:17:24 2017 +0100

tdf#114702 don't use XMultipleResultset unless DatabaseMetaData says we can

Change-Id: Icec98d35c2f60adf4a31e492c6cb708e82e47a58
Reviewed-on: https://gerrit.libreoffice.org/47080
Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
Tested-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/dbaccess/source/ui/dlg/directsql.cxx 
b/dbaccess/source/ui/dlg/directsql.cxx
index 8d4cfc1946c7..8ea220d90d8e 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -191,9 +191,11 @@ namespace dbaui
 {
 // create a statement
 Reference< XStatement > xStatement = 
m_xConnection->createStatement();
+
+Reference xMeta = m_xConnection->getMetaData();
 css::uno::Reference< css::sdbc::XMultipleResults > xMR ( 
xStatement, UNO_QUERY );
 
-if (xMR.is())
+if (xMeta.is() && xMeta->supportsMultipleResultSets() && xMR.is())
 {
 bool hasRS = xStatement->execute(_rStatement);
 if(hasRS)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-28 Thread Lionel Elie Mamane
 connectivity/source/drivers/firebird/StatementCommonBase.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8375ab7b5024bad1bcf8bbb0c734ba1e5416445f
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Thu Dec 28 06:07:06 2017 +0100

firebird: return consistent (if wrong...) results for XMultipleResults

Just in case we are called by code not checking our DatabaseMetadata
to learn we don't support multiple resultsets.

Change-Id: I6d8c5f4ef04bcd9ec8b66a83881607281e125b7b
Reviewed-on: https://gerrit.libreoffice.org/47117
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.cxx 
b/connectivity/source/drivers/firebird/StatementCommonBase.cxx
index 0db1a86a619d..2dab23cdd34d 100644
--- a/connectivity/source/drivers/firebird/StatementCommonBase.cxx
+++ b/connectivity/source/drivers/firebird/StatementCommonBase.cxx
@@ -241,7 +241,7 @@ sal_Bool SAL_CALL OStatementCommonBase::getMoreResults()
 sal_Int32 SAL_CALL OStatementCommonBase::getUpdateCount()
 {
 // TODO: verify we really can't support this
-return 0;
+return -1;
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-28 Thread Lionel Elie Mamane
 dbaccess/source/core/api/statement.cxx |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 66d7540bcf3f82de906a588f01d1fbedc3d2928c
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Thu Dec 28 06:16:30 2017 +0100

dbaccess OStatementBase: correctly check database metadata

the previous test didn't make any sense:
 * if xMeta.is(), then the test evaluated to false
 * if !xMeta.is(), then it called supportsMultipleResultSets
   (or supportsBatchUpdates, respectively) on a NULL pointer,
   which guaranteed a segfault / assert.

Change-Id: I6d6b93350557936b924a286732ae6d4f5ab2ce56
Reviewed-on: https://gerrit.libreoffice.org/47118
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/dbaccess/source/core/api/statement.cxx 
b/dbaccess/source/core/api/statement.cxx
index f25e08be6a43..54f412fcf065 100644
--- a/dbaccess/source/core/api/statement.cxx
+++ b/dbaccess/source/core/api/statement.cxx
@@ -321,7 +321,7 @@ Reference< XResultSet > SAL_CALL 
OStatementBase::getResultSet(  )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsMultipleResultSets())
+if (!xMeta.is() || !xMeta->supportsMultipleResultSets())
 throwFunctionSequenceException(*this);
 
 return Reference< XMultipleResults >(m_xAggregateAsSet, 
UNO_QUERY)->getResultSet();
@@ -334,7 +334,7 @@ sal_Int32 SAL_CALL OStatementBase::getUpdateCount(  )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsMultipleResultSets())
+if (!xMeta.is() || !xMeta->supportsMultipleResultSets())
 throwFunctionSequenceException(*this);
 
 return Reference< XMultipleResults >(m_xAggregateAsSet, 
UNO_QUERY)->getUpdateCount();
@@ -347,7 +347,7 @@ sal_Bool SAL_CALL OStatementBase::getMoreResults(  )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsMultipleResultSets())
+if (!xMeta.is() || !xMeta->supportsMultipleResultSets())
 throwFunctionSequenceException(*this);
 
 // free the previous results
@@ -364,7 +364,7 @@ void SAL_CALL OStatementBase::addBatch(  )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsBatchUpdates())
+if (!xMeta.is() || !xMeta->supportsBatchUpdates())
 throwFunctionSequenceException(*this);
 
 Reference< XPreparedBatchExecution >(m_xAggregateAsSet, 
UNO_QUERY)->addBatch();
@@ -377,7 +377,7 @@ void SAL_CALL OStatementBase::clearBatch(  )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsBatchUpdates())
+if (!xMeta.is() || !xMeta->supportsBatchUpdates())
 throwFunctionSequenceException(*this);
 
 Reference< XPreparedBatchExecution >(m_xAggregateAsSet, 
UNO_QUERY)->clearBatch();
@@ -390,7 +390,7 @@ Sequence< sal_Int32 > SAL_CALL 
OStatementBase::executeBatch(  )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsBatchUpdates())
+if (!xMeta.is() || !xMeta->supportsBatchUpdates())
 throwFunctionSequenceException(*this);
 
 // free the previous results
@@ -496,7 +496,7 @@ void OStatement::addBatch( const OUString& _rSQL )
 
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsBatchUpdates())
+if (!xMeta.is() || !xMeta->supportsBatchUpdates())
 throwFunctionSequenceException(*this);
 
 OUString sSQL( impl_doEscapeProcessing_nothrow( _rSQL ) );
@@ -509,7 +509,7 @@ void OStatement::clearBatch( )
 ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);
 // first check the meta data
 Reference xMeta = Reference< XConnection > (m_xParent, 
UNO_QUERY)->getMetaData();
-if (!xMeta.is() && !xMeta->supportsBatchUpdates())
+if (!xMeta.is() || !xMeta->supportsBatchUpdates())
 throwFunctionSequenceException(*this);
 
 Reference< XBatchExecution >(m_xAggregateAsSet, UNO_QUERY)->clearBatch();
@@ -521,7 +521,7 @@ Sequence< sal_Int32 > OStatement::executeBatch( )
 ::connectivity::checkDisposed(OComponentHelper::rBHelper.bDisposed);

[Libreoffice-commits] core.git: Changes to 'private/lmamane/validation'

2017-12-24 Thread Lionel Elie Mamane
New branch 'private/lmamane/validation' available with the following commits:
commit 196c9bab6aaf91e30a6e275b84d21d0c9869306c
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Thu Aug 3 16:42:01 2017 +0200

form controls: validate *before* propagating value, but only on commit

*Before* propagating, because after it is propagated it is too late!

Only on commit (unless the control is not commitable), because
validating each time the control value changes leads to a validator
being called each time the user enters a character of the value.
So each validator necessarily has to accept any prefix of a valid
value, which often defeats the purpose. E.g. one cannot do a valiator
that enforces a minimum length, or minimum password complexity.

So validating on commit makes much more sense. That's when the user
is trying to actually set the value as a complete value.

Change-Id: Id3142367bacd81e07d093c8bee97d518df28cafe

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: dbaccess/inc dbaccess/source officecfg/registry reportbuilder/README reportbuilder/registry reportdesign/README wizards/com

2017-12-12 Thread Lionel Elie Mamane
 dbaccess/inc/strings.hrc|  
  2 +-
 dbaccess/source/ext/macromigration/migrationlog.cxx |  
  2 +-
 officecfg/registry/data/org/openoffice/Office/ExtendedColorScheme.xcu   |  
  2 +-
 officecfg/registry/data/org/openoffice/Setup.xcu|  
  2 +-
 officecfg/registry/schema/org/openoffice/Office/ReportDesign.xcs|  
  8 +---
 reportbuilder/README|  
  8 +++-
 reportbuilder/registry/data/org/openoffice/Setup.xcu|  
  3 +--
 reportdesign/README |  
  2 +-
 wizards/com/sun/star/wizards/report/IReportDocument.java|  
  2 +-
 wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java |  
  2 +-
 10 files changed, 16 insertions(+), 17 deletions(-)

New commits:
commit fe95086edda6a846b58f4ed568257e3fab46a0da
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Dec 13 04:27:13 2017 +0100

Remove traces of Report Builder's former status as extension

Change-Id: I63730632933cbb1d6e655f70d222ffaaabd3fa08
Reviewed-on: https://gerrit.libreoffice.org/46361
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/dbaccess/inc/strings.hrc b/dbaccess/inc/strings.hrc
index 47068f43d09e..d046ac5a299e 100644
--- a/dbaccess/inc/strings.hrc
+++ b/dbaccess/inc/strings.hrc
@@ -349,7 +349,7 @@
 #define STR_WARNINGS_DURING_CONNECT 
NC_("STR_WARNINGS_DURING_CONNECT", "Warnings were encountered while connecting 
to the data source. Press \"$buttontext$\" to view them.")
 #define STR_NAMED_OBJECT_ALREADY_EXISTS 
NC_("STR_NAMED_OBJECT_ALREADY_EXISTS", "The name '$#$' already exists.\nPlease 
enter another name." )
 // #i96130# use hard coded name
-#define RID_STR_EXTENSION_NOT_PRESENT   
NC_("RID_STR_EXTENSION_NOT_PRESENT", "The report, \"$file$\", requires the 
Oracle Report Builder feature.")
+#define RID_STR_EXTENSION_NOT_PRESENT   
NC_("RID_STR_EXTENSION_NOT_PRESENT", "The report, \"$file$\", requires the 
Report Builder feature.")
 
 #define STR_COULDNOTCREATE_DRIVERMANAGER
NC_("STR_COULDNOTCREATE_DRIVERMANAGER", "Cannot connect to the SDBC driver 
manager (#servicename#).")
 #define STR_NOREGISTEREDDRIVER  
NC_("STR_NOREGISTEREDDRIVER", "A driver is not registered for the URL 
#connurl#.")
diff --git a/dbaccess/source/ext/macromigration/migrationlog.cxx 
b/dbaccess/source/ext/macromigration/migrationlog.cxx
index 1d17c8fec1d7..b46894ac0a58 100644
--- a/dbaccess/source/ext/macromigration/migrationlog.cxx
+++ b/dbaccess/source/ext/macromigration/migrationlog.cxx
@@ -316,7 +316,7 @@ namespace dbmm
 break;
 
 case ERR_NEW_STYLE_REPORT:
-pAsciiErrorDescription = "#doc# could not be processed, since 
you don't have the Oracle Report Builder (TM) extension installed.";
+pAsciiErrorDescription = "#doc# could not be processed, since 
you don't have the Report Builder feature installed.";
 aParameterNames.emplace_back("#doc#");
 break;
 
diff --git 
a/officecfg/registry/data/org/openoffice/Office/ExtendedColorScheme.xcu 
b/officecfg/registry/data/org/openoffice/Office/ExtendedColorScheme.xcu
index 6bb41178bec2..137da86f2879 100644
--- a/officecfg/registry/data/org/openoffice/Office/ExtendedColorScheme.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/ExtendedColorScheme.xcu
@@ -143,7 +143,7 @@
   
 
   
-Oracle Report Builder
+Report Builder
   
   
 
diff --git a/officecfg/registry/data/org/openoffice/Setup.xcu 
b/officecfg/registry/data/org/openoffice/Setup.xcu
index 84a2bb68fa52..0472de91f20e 100644
--- a/officecfg/registry/data/org/openoffice/Setup.xcu
+++ b/officecfg/registry/data/org/openoffice/Setup.xcu
@@ -769,7 +769,7 @@
   GenericCategories
 
 
-  Base: Oracle Report Builder
+  Base: Report Builder
 
   
 
diff --git a/officecfg/registry/schema/org/openoffice/Office/ReportDesign.xcs 
b/officecfg/registry/schema/org/openoffice/Office/ReportDesign.xcs
index 98230cea7199..556ddb72c710 100644
--- a/officecfg/registry/schema/org/openoffice/Office/ReportDesign.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/ReportDesign.xcs
@@ -36,17 +36,11 @@
   
 specifies extension settings for the report designer.
   
-  
-
-  Direct download URL to the Oracle(tm) Report Builder 
extension.
-
-http://extensions.go-oo.org
-  
   
 

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

2017-10-09 Thread Lionel Elie Mamane
 connectivity/source/drivers/odbc/OResultSet.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 2399cf59fc0467028e7183877582821dc878120f
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Mon Oct 9 08:53:13 2017 +0200

Revert "Related tdf#112947: another fix about odbc"

Since the buffer pointed to by SQL_ATTR_FETCH_BOOKMARK_PTR is not 
free()/delete()ed by the destructor of OResultSet, this is not the right place 
to unregister it.

This reverts commit b76a087f73cdf3d1a8bcc56b1ed7a5959ca0f1bd.

Change-Id: I78e162c0ced1a15decc4a0f464c99f68fcac7ce5
Reviewed-on: https://gerrit.libreoffice.org/43270
    Reviewed-by: Lionel Elie Mamane <lio...@mamane.lu>
Tested-by: Lionel Elie Mamane <lio...@mamane.lu>

diff --git a/connectivity/source/drivers/odbc/OResultSet.cxx 
b/connectivity/source/drivers/odbc/OResultSet.cxx
index 97768116d1e9..7a74762a30c0 100644
--- a/connectivity/source/drivers/odbc/OResultSet.cxx
+++ b/connectivity/source/drivers/odbc/OResultSet.cxx
@@ -164,7 +164,6 @@ OResultSet::OResultSet(SQLHANDLE _pStatementHandle 
,OStatement_Base* pStmt) :
 
 OResultSet::~OResultSet()
 {
-setStmtOption<SQLLEN*, SQL_IS_POINTER>(SQL_ATTR_FETCH_BOOKMARK_PTR, 
nullptr);
 setStmtOption<SQLUSMALLINT*, SQL_IS_POINTER>(SQL_ATTR_ROW_STATUS_PTR, 
nullptr);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - connectivity/source

2017-08-08 Thread Lionel Elie Mamane
 connectivity/source/commontools/dbconversion.cxx |   32 ---
 1 file changed, 28 insertions(+), 4 deletions(-)

New commits:
commit de8c0152157bb32a6df9b6d4ac4102aef8e8a384
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Aug 2 15:27:57 2017 +0200

tdf#110997 protect calls to implBuildFromRelative from year overflow

Change-Id: I5c6768766673832b7271292af85db1b76e51042c
Reviewed-on: https://gerrit.libreoffice.org/40683
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Michael Stahl <mst...@redhat.com>

diff --git a/connectivity/source/commontools/dbconversion.cxx 
b/connectivity/source/commontools/dbconversion.cxx
index 5be258a7e698..9baca9bebb80 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -42,6 +42,16 @@ namespace
 const sal_Int64 hourMask = 10LL;
 
 const double fNanoSecondsPerDay = nanoSecInSec * secInMin * minInHour * 
24.0;
+
+//  32767-12-31 in "(days since 0001-01-01) + 1" format
+const sal_Int32 maxDays =  11967896;
+// -32768-01-01 in "(days since 0001-01-01) + 1" format
+// Yes, I know it is currently unused. Will have to be used
+// when we implement negative years. Writing down the correct
+// value for future reference.
+// *** Please don't remove just because it is unused ***
+// Lionel Élie Mamane 2017-08-02
+// const sal_Int32 minDays = -11968270;
 }
 
 
@@ -269,8 +279,15 @@ namespace dbtools
 sal_Int32   nTempDays = implRelativeToAbsoluteNull( _rDate );
 
 nTempDays += nDays;
-// TODO: can we remove that check? Would allow dates before 1900.
-if ( nTempDays <= 0 )
+if ( nTempDays > maxDays )
+{
+_rDate.Day  = 31;
+_rDate.Month= 12;
+_rDate.Year = ;
+}
+// TODO: can we replace that check by minDays? Would allow dates BCE
+//   implBuildFromRelative probably needs to be updated for the 
"no year 0" question
+else if ( nTempDays <= 0 )
 {
 _rDate.Day  = 1;
 _rDate.Month= 1;
@@ -285,8 +302,15 @@ namespace dbtools
 sal_Int32   nTempDays = implRelativeToAbsoluteNull( _rDate );
 
 nTempDays -= nDays;
-// TODO: can we remove that check? Would allow dates before 1900.
-if ( nTempDays <= 0 )
+if ( nTempDays > maxDays )
+{
+_rDate.Day  = 31;
+_rDate.Month= 12;
+_rDate.Year = ;
+}
+// TODO: can we replace that check by minDays? Would allow dates BCE
+//   implBuildFromRelative probably needs to be updated for the 
"no year 0" question
+else if ( nTempDays <= 0 )
 {
 _rDate.Day  = 1;
 _rDate.Month= 1;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


silencing warning "control reaches end of non-void function"

2017-08-02 Thread Lionel Elie Mamane
Hi,

Consider:

enum t {a, b};

OUString f(t i)
{
  switch(i)
  {
  case t::a;
return "it was an a";
  case t::b;
return "it was a b";
  }
}


gcc -Werror fails with
error: control reaches end of non-void function [-Werror=return-type]

But that is not true; since all possible values are treated and
return, it cannot fall through. How do I silence that spurious
warning-turned-error?

I tried adding "assert(false)", which solves the warning on my
machine, but not on Jenkins build linux_gcc_release_64, cf
https://ci.libreoffice.org/job/lo_gerrit/15859/Config=linux_gcc_release_64/

I don't want to add a fake
 return "never reached";
because I want compilation to fail if/when the switch is not
exhaustive (e.g. change of definition of enum t).

The "f" above is FilterManager::getFilterComponent in file
connectivity/source/commontools/filtermanager.cxx of
https://gerrit.libreoffice.org/40567

Thanks for you advice,

Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


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

2017-08-02 Thread Lionel Elie Mamane
 connectivity/source/commontools/dbconversion.cxx |   54 ---
 1 file changed, 39 insertions(+), 15 deletions(-)

New commits:
commit 764e7d873f8568ff4981de0139d09401d7f64c02
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Aug 2 15:28:40 2017 +0200

add a few const purely for documentation reasons

Change-Id: I6b7e5dac24e7aa5d48d6661235059ba29207e1d7

diff --git a/connectivity/source/commontools/dbconversion.cxx 
b/connectivity/source/commontools/dbconversion.cxx
index d863d299f60c..964b98672eb2 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -120,7 +120,7 @@ namespace dbtools
 return  aTemp.makeStringAndClear();
 }
 
-css::util::Date DBTypeConversion::toDate(sal_Int32 _nVal)
+css::util::Date DBTypeConversion::toDate(const sal_Int32 _nVal)
 {
 css::util::Date aReturn;
 aReturn.Day = (sal_uInt16)(_nVal % 100);
@@ -130,7 +130,7 @@ namespace dbtools
 }
 
 
-css::util::Time DBTypeConversion::toTime(sal_Int64 _nVal)
+css::util::Time DBTypeConversion::toTime(const sal_Int64 _nVal)
 {
 css::util::Time aReturn;
 sal_uInt64 unVal = static_cast(_nVal >= 0 ? _nVal : 
-_nVal);
@@ -202,7 +202,7 @@ namespace dbtools
 return nDays;
 }
 
-static void implBuildFromRelative( sal_Int32 nDays, sal_uInt16& rDay, 
sal_uInt16& rMonth, sal_Int16& rYear)
+static void implBuildFromRelative( const sal_Int32 nDays, sal_uInt16& 
rDay, sal_uInt16& rMonth, sal_Int16& rYear)
 {
 sal_Int32   nTempDays;
 sal_Int32   i = 0;
@@ -274,7 +274,7 @@ namespace dbtools
 return ((double)nTime) + toDouble(aTimePart);
 }
 
-static void addDays(sal_Int32 nDays, css::util::Date& _rDate)
+static void addDays(const sal_Int32 nDays, css::util::Date& _rDate)
 {
 sal_Int32   nTempDays = implRelativeToAbsoluteNull( _rDate );
 
@@ -291,13 +291,13 @@ namespace dbtools
 {
 _rDate.Day  = 1;
 _rDate.Month= 1;
-_rDate.Year = 00;
+_rDate.Year = 1;
 }
 else
 implBuildFromRelative( nTempDays, _rDate.Day, _rDate.Month, 
_rDate.Year );
 }
 
-static void subDays( sal_Int32 nDays, css::util::Date& _rDate )
+static void subDays(const sal_Int32 nDays, css::util::Date& _rDate )
 {
 sal_Int32   nTempDays = implRelativeToAbsoluteNull( _rDate );
 
@@ -314,13 +314,13 @@ namespace dbtools
 {
 _rDate.Day  = 1;
 _rDate.Month= 1;
-_rDate.Year = 00;
+_rDate.Year = 1;
 }
 else
 implBuildFromRelative( nTempDays, _rDate.Day, _rDate.Month, 
_rDate.Year );
 }
 
-css::util::Date DBTypeConversion::toDate(double dVal, const 
css::util::Date& _rNullDate)
+css::util::Date DBTypeConversion::toDate(const double dVal, const 
css::util::Date& _rNullDate)
 {
 css::util::Date aRet = _rNullDate;
 
@@ -333,9 +333,9 @@ namespace dbtools
 return aRet;
 }
 
-css::util::Time DBTypeConversion::toTime(double dVal, short nDigits)
+css::util::Time DBTypeConversion::toTime(const double dVal, short nDigits)
 {
-sal_Int32 nDays = (sal_Int32)dVal;
+const sal_Int32 nDays = (sal_Int32)dVal;
 sal_Int64 nNS;
 {
 double fSeconds((dVal - (double)nDays) * (fNanoSecondsPerDay / 
nanoSecInSec));
@@ -381,7 +381,7 @@ namespace dbtools
 return aRet;
 }
 
-css::util::DateTime DBTypeConversion::toDateTime(double dVal, const 
css::util::Date& _rNullDate)
+css::util::DateTime DBTypeConversion::toDateTime(const double dVal, const 
css::util::Date& _rNullDate)
 {
 css::util::Date aDate = toDate(dVal, _rNullDate);
 // there is not enough precision in a double to have both a date
commit 0ccbd58834259cd7724edacde283f4f0f6ed2db0
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Aug 2 15:27:57 2017 +0200

tdf#110997 protect calls to implBuildFromRelative from year overflow

Change-Id: I5c6768766673832b7271292af85db1b76e51042c

diff --git a/connectivity/source/commontools/dbconversion.cxx 
b/connectivity/source/commontools/dbconversion.cxx
index 61abe27d84b8..d863d299f60c 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -42,6 +42,16 @@ namespace
 const sal_Int64 hourMask = 10LL;
 
 const double fNanoSecondsPerDay = nanoSecInSec * secInMin * minInHour * 
24.0;
+
+//  32767-12-31 in "(days since 0001-01-01) + 1" format
+const sal_Int32 maxDays =  11967896;
+// -32768-01-01 in "(days since 0001-01-01) + 1" format
+// Yes, I know it is currently unused. Will have to be used
+// when we implement negative years. W

[Libreoffice-commits] core.git: Changes to 'private/lmamane/tdf110997'

2017-08-02 Thread Lionel Elie Mamane
New branch 'private/lmamane/tdf110997' available with the following commits:
commit d453817bbc3d0ed561bc604826efe2bc43d0f2c7
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Aug 2 15:28:40 2017 +0200

add a few const purely for documentation reasons

Change-Id: I6b7e5dac24e7aa5d48d6661235059ba29207e1d7

commit 05ee58ad751c91c4a48fd30ea565c43551e5a176
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Aug 2 15:27:57 2017 +0200

tdf#110997 protect calls to implBuildFromRelative from year overflow

Change-Id: I5c6768766673832b7271292af85db1b76e51042c

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - connectivity/source dbaccess/source forms/source include/connectivity sc/source

2017-07-30 Thread Lionel Elie Mamane
 connectivity/source/commontools/dbtools2.cxx   |   35 ++
 connectivity/source/commontools/filtermanager.cxx  |  108 +++--
 connectivity/source/commontools/parameters.cxx |   37 ++-
 dbaccess/source/core/misc/DatabaseDataProvider.cxx |2 
 dbaccess/source/ui/browser/brwctrlr.cxx|   16 ---
 dbaccess/source/ui/dlg/queryfilter.cxx |   16 +--
 dbaccess/source/ui/inc/queryfilter.hxx |8 -
 forms/source/component/DatabaseForm.cxx|   42 +++-
 forms/source/inc/frm_strings.hxx   |3 
 forms/source/inc/property.hxx  |2 
 forms/source/runtime/formoperations.cxx|   51 +++--
 forms/source/runtime/formoperations.hxx|   14 ++
 include/connectivity/dbtools.hxx   |   39 +++
 include/connectivity/filtermanager.hxx |   12 +-
 include/connectivity/parameters.hxx|8 +
 sc/source/ui/unoobj/filtuno.cxx|3 
 16 files changed, 335 insertions(+), 61 deletions(-)

New commits:
commit 875ec879c098f39bc4ed552d31f28e8e67942804
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jul 30 17:53:55 2017 +0200

janitorial

Change-Id: Icb8ec00635e42ac8a52e3a9d5ac360f11bf6e645

diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx 
b/dbaccess/source/ui/dlg/queryfilter.cxx
index f7d04f0f0a4b..445cf70886fc 100644
--- a/dbaccess/source/ui/dlg/queryfilter.cxx
+++ b/dbaccess/source/ui/dlg/queryfilter.cxx
@@ -267,7 +267,7 @@ sal_Int32 DlgFilterCrit::GetOSQLPredicateType( const 
OUString& _rSelectedPredica
 return nPredicateType;
 }
 
-sal_Int32 DlgFilterCrit::GetSelectionPos(sal_Int32 eType,const ListBox& 
rListBox)
+sal_Int32 DlgFilterCrit::GetSelectionPos(sal_Int32 eType, const ListBox& 
rListBox)
 {
 sal_Int32 nPos;
 switch(eType)
diff --git a/dbaccess/source/ui/inc/queryfilter.hxx 
b/dbaccess/source/ui/inc/queryfilter.hxx
index 5dd72f1e40ef..c593c3bfe65c 100644
--- a/dbaccess/source/ui/inc/queryfilter.hxx
+++ b/dbaccess/source/ui/inc/queryfilter.hxx
@@ -97,8 +97,8 @@ namespace dbaui
 voidSetLine( int nIdx, const css::beans::PropertyValue& 
_rItem, bool _bOr );
 voidEnableLines();
 sal_Int32   GetOSQLPredicateType( const OUString& 
_rSelectedPredicate ) const;
-static sal_Int32  GetSelectionPos(sal_Int32 eType,const ListBox& 
rListBox);
-boolgetCondition(const ListBox& _rField,const ListBox& 
_rComp,const Edit& _rValue,css::beans::PropertyValue& _rFilter) const;
+static sal_Int32  GetSelectionPos(sal_Int32 eType, const ListBox& 
rListBox);
+boolgetCondition(const ListBox& _rField, const ListBox& 
_rComp, const Edit& _rValue, css::beans::PropertyValue& _rFilter) const;
 voidfillLines(int , const css::uno::Sequence< 
css::uno::Sequence< css::beans::PropertyValue > >& _aValues);
 
 css::uno::Reference< css::beans::XPropertySet > getMatchingColumn( 
const Edit& _rValueInput ) const;
diff --git a/forms/source/inc/frm_strings.hxx b/forms/source/inc/frm_strings.hxx
index 790f279b1206..1ad4fce608ce 100644
--- a/forms/source/inc/frm_strings.hxx
+++ b/forms/source/inc/frm_strings.hxx
@@ -48,7 +48,7 @@ namespace frm
 #define PROPERTY_CYCLE"Cycle"
 #define PROPERTY_CONTROLSOURCE"DataField"
 #define PROPERTY_ENABLED  "Enabled"
-#define PROPERTY_ENABLEVISIBLE  "EnableVisible"
+#define PROPERTY_ENABLEVISIBLE"EnableVisible"
 #define PROPERTY_READONLY "ReadOnly"
 #define PROPERTY_RELEVANT "Relevant"
 #define PROPERTY_ISREADONLY   "IsReadOnly"
diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx
index c20dd62f1406..ce02ff831079 100644
--- a/sc/source/ui/unoobj/filtuno.cxx
+++ b/sc/source/ui/unoobj/filtuno.cxx
@@ -278,7 +278,8 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute()
 switch(load_CharSet( eEncoding, bExport, pInStream.get()))
 {
 case charsetSource::charset_from_file:
-  skipDialog = true;break;
+  skipDialog = true;
+  break;
 case charsetSource::charset_from_user_setting:
 case charsetSource::charset_default:
break;
commit 2b1d6f0d3b0b025148c81986ba7f109659d838af
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jul 30 17:57:14 2017 +0200

tdf#96370 rework filtering to be aware of WHERE vs HAVING clause

Several bugs (AFAIK not filed into tdf bugzilla) fixed.

Remaining problems:

When some filter clauses go into WHER

Re: silencing warning "control reaches end of non-void function"

2017-07-30 Thread Lionel Elie Mamane
On Sun, Jul 30, 2017 at 07:26:02PM +0200, Lionel Elie Mamane wrote:

> Consider:

> enum t {a, b};
> 
> OUString f(t i)
> {
>   switch(i)
>   {
>   case t::a;
> return "it was an a";
>   case t::b;
> return "it was a b";
>   }
> }
> 

> gcc -Werror fails with
> error: control reaches end of non-void function [-Werror=return-type]

An Internet search
https://stackoverflow.com/questions/33607284/control-reaches-end-of-non-void-function-with-fully-handled-case-switch-over-a
teaches me that it is legal to construct a value of an enum type that
is not among the enumerated values (when the number of enumerated
values is not a power of two). 

I added the fake return. I prefer not to put a default case in the
switch, so that the "switch is not exhaustive over enum" warning can
still appear.

-- 
Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - connectivity/source include/connectivity sc/CppunitTest_sc_ucalc.mk sc/Library_sc.mk sc/source

2017-07-04 Thread Lionel Elie Mamane
 connectivity/source/commontools/dbtools.cxx  |   83 +
 connectivity/source/drivers/dbase/DTable.cxx |   43 -
 include/connectivity/dbtools.hxx |   47 +
 sc/CppunitTest_sc_ucalc.mk   |1 
 sc/Library_sc.mk |1 
 sc/source/ui/docshell/docsh8.cxx |4 
 sc/source/ui/unoobj/filtuno.cxx  |  128 ++-
 7 files changed, 221 insertions(+), 86 deletions(-)

New commits:
commit 6e0eafe576436ec229c6d90f654ff1b11ff9bdfd
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jun 25 17:21:45 2017 +0200

tdf#108789: branch 5.4 only

 - Calc: make the complete "what encoding to use" decision before
 calling the connectivity driver, so that the driver has
 no ambiguity about whether it should override our setting
 or not.

 To this end, factorise the part of the driver that reads
 the encoding from the file header into dbtools.

- Calc: don't ask for encoding when the file's header give the encoding.

- don't confuse CP850 (the default) and "don't know", including:
  * don't ignore CP850 user setting
  * don't overwrite user setting with CP850

Cherry-pick:
- 
https://cgit.freedesktop.org/libreoffice/core/commit/?id=7f1465a9599e9665159dd2d823a6e9064cca5703
- 
https://cgit.freedesktop.org/libreoffice/core/commit/?id=857d64ed3ebbeb0ee4e8a75bfeaa4eb406944571
- 
https://cgit.freedesktop.org/libreoffice/core/commit/?id=9170d10cc57c3f0f3e82b27ce4b2cd9c897e669d

Change-Id: Id80b7c505858b88f717b0ce6bd890527909e5fd1
Reviewed-on: https://gerrit.libreoffice.org/39451
    Reviewed-by: Lionel Elie Mamane <lio...@mamane.lu>
Tested-by: Jenkins <c...@libreoffice.org>

diff --git a/connectivity/source/commontools/dbtools.cxx 
b/connectivity/source/commontools/dbtools.cxx
index 1b17eb112d49..d458c1509722 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -2035,6 +2035,89 @@ OSQLColumns::Vector::const_iterator 
find(OSQLColumns::Vector::const_iterator fir
 ++first;
 return first;
 }
+
+namespace dbase
+{
+bool dbfDecodeCharset(rtl_TextEncoding &_out_encoding, sal_uInt8 nType, 
sal_uInt8 nCodepage)
+{
+switch (nType)
+{
+case dBaseIII:
+case dBaseIV:
+case dBaseV:
+case VisualFoxPro:
+case VisualFoxProAuto:
+case dBaseFS:
+case dBaseFSMemo:
+case dBaseIVMemoSQL:
+case dBaseIIIMemo:
+case FoxProMemo:
+{
+if (nCodepage != 0x00)
+{
+auto eEncoding(RTL_TEXTENCODING_DONTKNOW);
+switch(nCodepage)
+{
+case 0x01: eEncoding = RTL_TEXTENCODING_IBM_437; break;   
// DOS USA  code page 437
+case 0x02: eEncoding = RTL_TEXTENCODING_IBM_850; break;   
// DOS Multilingual code page 850
+case 0x03: eEncoding = RTL_TEXTENCODING_MS_1252; break;   
// Windows ANSI code page 1252
+case 0x04: eEncoding = RTL_TEXTENCODING_APPLE_ROMAN; break;   
// Standard Macintosh
+case 0x64: eEncoding = RTL_TEXTENCODING_IBM_852; break;   
// EE MS-DOScode page 852
+case 0x65: eEncoding = RTL_TEXTENCODING_IBM_866; break;   
// Russian MS-DOS   code page 866
+case 0x66: eEncoding = RTL_TEXTENCODING_IBM_865; break;   
// Nordic MS-DOScode page 865
+case 0x67: eEncoding = RTL_TEXTENCODING_IBM_861; break;   
// Icelandic MS-DOS
+//case 0x68: eEncoding = ; break; // Kamenicky (Czech) 
MS-DOS
+//case 0x69: eEncoding = ; break; // Mazovia (Polish) 
MS-DOS
+case 0x6A: eEncoding = RTL_TEXTENCODING_IBM_737; break;   
// Greek MS-DOS (437G)
+case 0x6B: eEncoding = RTL_TEXTENCODING_IBM_857; break;   
// Turkish MS-DOS
+case 0x6C: eEncoding = RTL_TEXTENCODING_IBM_863; break;   
// MS-DOS, Canada
+case 0x78: eEncoding = RTL_TEXTENCODING_MS_950; break;
// Windows, Traditional Chinese
+case 0x79: eEncoding = RTL_TEXTENCODING_MS_949; break;
// Windows, Korean (Hangul)
+case 0x7A: eEncoding = RTL_TEXTENCODING_MS_936; break;
// Windows, Simplified Chinese
+case 0x7B: eEncoding = RTL_TEXTENCODING_MS_932; break;
// Windows, Japanese (Shift-jis)
+case 0x7C: eEncoding = RTL_TEXTENCODING_MS_874; break;
// Windows, Thai
+case 0x7D: eEncoding = RTL_TEXTENCODING_MS_1255; break;   
// Windows, Hebrew
+case 0x7E: eEncoding = RTL_TEXTENCODING_MS_1256; break;   
// Windows, Arabic
+case 0x96: eEncodin

[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - configure.ac

2017-07-03 Thread Lionel Elie Mamane
 configure.ac |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 2a276cdf540321be3c9c9b232fbe9ecf72fd65a7
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Jun 28 03:55:00 2017 +0200

we need gpgme header, too

not only gpgmepp headers

Change-Id: I46723ce751d631e165982c6c7bc2f820f9a5d0a8
Reviewed-on: https://gerrit.libreoffice.org/39484
Reviewed-by: Rene Engelhard <r...@debian.org>
Tested-by: Rene Engelhard <r...@debian.org>

diff --git a/configure.ac b/configure.ac
index bb34a49b61d1..34610c473bb3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10420,6 +10420,8 @@ if test "$_os" = "Linux"; then
 # checking for it also filters out older, KDE-dependent libgpgmepp 
versions
 AC_CHECK_LIB(gpgmepp, progress_callback, [ GPGMEPP_LIBS=-lgpgmepp ],
 [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
+AC_CHECK_HEADER(gpgme.h, [],
+[AC_MSG_ERROR([gpgme headers not found, install gpgme development 
package])], [])
 else
 AC_MSG_RESULT([internal])
 BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-07-02 Thread Lionel Elie Mamane
 include/connectivity/dbtools.hxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 857d64ed3ebbeb0ee4e8a75bfeaa4eb406944571
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jul 2 13:57:00 2017 +0200

looks like namespace syntax does not work like I think it does

Change-Id: I891bcc49a03ccb6c248065819f0cbbb5cd44d191

diff --git a/include/connectivity/dbtools.hxx b/include/connectivity/dbtools.hxx
index 4b493ee98267..f771ae9f3fbe 100644
--- a/include/connectivity/dbtools.hxx
+++ b/include/connectivity/dbtools.hxx
@@ -789,7 +789,9 @@ namespace dbtools
 
 }   // namespace dbtools
 
-namespace connectivity::dbase
+namespace connectivity
+{
+namespace dbase
 {
 enum DBFType  { dBaseIII = 0x03,
 dBaseIV  = 0x04,
@@ -831,7 +833,9 @@ namespace connectivity::dbase
 false if nothing was written to _out_nCharset
 */
 OOO_DLLPUBLIC_DBTOOLS bool dbfReadCharset(rtl_TextEncoding , 
SvStream* dbf_Stream);
+
 } // namespace connectivity::dbase
+} // namespace connectivity
 
 #endif // INCLUDED_CONNECTIVITY_DBTOOLS_HXX
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - configure.ac connectivity/source include/connectivity sc/CppunitTest_sc_ucalc.mk sc/Library_sc.mk sc/source

2017-07-02 Thread Lionel Elie Mamane
 configure.ac |2 
 connectivity/source/commontools/dbtools.cxx  |   83 
 connectivity/source/drivers/dbase/DTable.cxx |   43 
 include/connectivity/dbtools.hxx |   45 
 sc/CppunitTest_sc_ucalc.mk   |1 
 sc/Library_sc.mk |1 
 sc/source/ui/docshell/docsh8.cxx |4 
 sc/source/ui/unoobj/filtuno.cxx  |  140 +++
 8 files changed, 234 insertions(+), 85 deletions(-)

New commits:
commit 7f1465a9599e9665159dd2d823a6e9064cca5703
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jun 25 17:21:45 2017 +0200

tdf#108789 and others: overhaul DBase files encoding handling

 - Calc: make the complete "what encoding to use" decision before
 calling the connectivity driver, so that the driver has
 no ambiguity about whether it should override our setting
 or not.

 To this end, factorise the part of the driver that reads
 the encoding from the file header into dbtools.

 - Calc: don't ask for encoding when the file's header give the encoding.

 - don't confuse CP850 (the default) and "don't know", including:
   * don't ignore CP850 user setting
   * don't overwrite user setting with CP850

Thanks to Julien Nabet for the extensive collaboration on this.

Change-Id: Id80b7c505858b88f717b0ce6bd890527909e5fd1

diff --git a/connectivity/source/commontools/dbtools.cxx 
b/connectivity/source/commontools/dbtools.cxx
index 97316e5e2536..fa34331d85f9 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -2026,6 +2026,89 @@ OSQLColumns::Vector::const_iterator 
find(OSQLColumns::Vector::const_iterator fir
 ++first;
 return first;
 }
+
+namespace dbase
+{
+bool dbfDecodeCharset(rtl_TextEncoding &_out_encoding, sal_uInt8 nType, 
sal_uInt8 nCodepage)
+{
+switch (nType)
+{
+case dBaseIII:
+case dBaseIV:
+case dBaseV:
+case VisualFoxPro:
+case VisualFoxProAuto:
+case dBaseFS:
+case dBaseFSMemo:
+case dBaseIVMemoSQL:
+case dBaseIIIMemo:
+case FoxProMemo:
+{
+if (nCodepage != 0x00)
+{
+auto eEncoding(RTL_TEXTENCODING_DONTKNOW);
+switch(nCodepage)
+{
+case 0x01: eEncoding = RTL_TEXTENCODING_IBM_437; break;   
// DOS USA  code page 437
+case 0x02: eEncoding = RTL_TEXTENCODING_IBM_850; break;   
// DOS Multilingual code page 850
+case 0x03: eEncoding = RTL_TEXTENCODING_MS_1252; break;   
// Windows ANSI code page 1252
+case 0x04: eEncoding = RTL_TEXTENCODING_APPLE_ROMAN; break;   
// Standard Macintosh
+case 0x64: eEncoding = RTL_TEXTENCODING_IBM_852; break;   
// EE MS-DOScode page 852
+case 0x65: eEncoding = RTL_TEXTENCODING_IBM_866; break;   
// Russian MS-DOS   code page 866
+case 0x66: eEncoding = RTL_TEXTENCODING_IBM_865; break;   
// Nordic MS-DOScode page 865
+case 0x67: eEncoding = RTL_TEXTENCODING_IBM_861; break;   
// Icelandic MS-DOS
+//case 0x68: eEncoding = ; break; // Kamenicky (Czech) 
MS-DOS
+//case 0x69: eEncoding = ; break; // Mazovia (Polish) 
MS-DOS
+case 0x6A: eEncoding = RTL_TEXTENCODING_IBM_737; break;   
// Greek MS-DOS (437G)
+case 0x6B: eEncoding = RTL_TEXTENCODING_IBM_857; break;   
// Turkish MS-DOS
+case 0x6C: eEncoding = RTL_TEXTENCODING_IBM_863; break;   
// MS-DOS, Canada
+case 0x78: eEncoding = RTL_TEXTENCODING_MS_950; break;
// Windows, Traditional Chinese
+case 0x79: eEncoding = RTL_TEXTENCODING_MS_949; break;
// Windows, Korean (Hangul)
+case 0x7A: eEncoding = RTL_TEXTENCODING_MS_936; break;
// Windows, Simplified Chinese
+case 0x7B: eEncoding = RTL_TEXTENCODING_MS_932; break;
// Windows, Japanese (Shift-jis)
+case 0x7C: eEncoding = RTL_TEXTENCODING_MS_874; break;
// Windows, Thai
+case 0x7D: eEncoding = RTL_TEXTENCODING_MS_1255; break;   
// Windows, Hebrew
+case 0x7E: eEncoding = RTL_TEXTENCODING_MS_1256; break;   
// Windows, Arabic
+case 0x96: eEncoding = RTL_TEXTENCODING_APPLE_CYRILLIC; break; 
   // Russian Macintosh
+case 0x97: eEncoding = RTL_TEXTENCODING_APPLE_CENTEURO; break; 
   // Eastern European Macintosh
+case 0x98: eEncoding = RTL_TEXTENCODING_APPLE_GREEK; break;   
// Greek Macintosh
+case 0xC8: eEncoding = RTL_TEXTENCODING_MS_125

[Libreoffice-commits] core.git: Branch 'private/lmamane/for-julien2412-master' - 231 commits - accessibility/inc accessibility/source android/Bootstrap basctl/source basegfx/source basic/qa basic/sour

2017-07-02 Thread Lionel Elie Mamane
Rebased ref, commits from common ancestor:
commit d401b4a40d093210d5a3a7f1f3b0379f8cafc173
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jul 2 11:28:09 2017 +0200

factorisation du décodage

Change-Id: I0130945b5c616beaa3eaedb34e5ca77b1bd70547

diff --git a/connectivity/source/commontools/dbtools.cxx 
b/connectivity/source/commontools/dbtools.cxx
index 97316e5e2536..fa34331d85f9 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -2026,6 +2026,89 @@ OSQLColumns::Vector::const_iterator 
find(OSQLColumns::Vector::const_iterator fir
 ++first;
 return first;
 }
+
+namespace dbase
+{
+bool dbfDecodeCharset(rtl_TextEncoding &_out_encoding, sal_uInt8 nType, 
sal_uInt8 nCodepage)
+{
+switch (nType)
+{
+case dBaseIII:
+case dBaseIV:
+case dBaseV:
+case VisualFoxPro:
+case VisualFoxProAuto:
+case dBaseFS:
+case dBaseFSMemo:
+case dBaseIVMemoSQL:
+case dBaseIIIMemo:
+case FoxProMemo:
+{
+if (nCodepage != 0x00)
+{
+auto eEncoding(RTL_TEXTENCODING_DONTKNOW);
+switch(nCodepage)
+{
+case 0x01: eEncoding = RTL_TEXTENCODING_IBM_437; break;   
// DOS USA  code page 437
+case 0x02: eEncoding = RTL_TEXTENCODING_IBM_850; break;   
// DOS Multilingual code page 850
+case 0x03: eEncoding = RTL_TEXTENCODING_MS_1252; break;   
// Windows ANSI code page 1252
+case 0x04: eEncoding = RTL_TEXTENCODING_APPLE_ROMAN; break;   
// Standard Macintosh
+case 0x64: eEncoding = RTL_TEXTENCODING_IBM_852; break;   
// EE MS-DOScode page 852
+case 0x65: eEncoding = RTL_TEXTENCODING_IBM_866; break;   
// Russian MS-DOS   code page 866
+case 0x66: eEncoding = RTL_TEXTENCODING_IBM_865; break;   
// Nordic MS-DOScode page 865
+case 0x67: eEncoding = RTL_TEXTENCODING_IBM_861; break;   
// Icelandic MS-DOS
+//case 0x68: eEncoding = ; break; // Kamenicky (Czech) 
MS-DOS
+//case 0x69: eEncoding = ; break; // Mazovia (Polish) 
MS-DOS
+case 0x6A: eEncoding = RTL_TEXTENCODING_IBM_737; break;   
// Greek MS-DOS (437G)
+case 0x6B: eEncoding = RTL_TEXTENCODING_IBM_857; break;   
// Turkish MS-DOS
+case 0x6C: eEncoding = RTL_TEXTENCODING_IBM_863; break;   
// MS-DOS, Canada
+case 0x78: eEncoding = RTL_TEXTENCODING_MS_950; break;
// Windows, Traditional Chinese
+case 0x79: eEncoding = RTL_TEXTENCODING_MS_949; break;
// Windows, Korean (Hangul)
+case 0x7A: eEncoding = RTL_TEXTENCODING_MS_936; break;
// Windows, Simplified Chinese
+case 0x7B: eEncoding = RTL_TEXTENCODING_MS_932; break;
// Windows, Japanese (Shift-jis)
+case 0x7C: eEncoding = RTL_TEXTENCODING_MS_874; break;
// Windows, Thai
+case 0x7D: eEncoding = RTL_TEXTENCODING_MS_1255; break;   
// Windows, Hebrew
+case 0x7E: eEncoding = RTL_TEXTENCODING_MS_1256; break;   
// Windows, Arabic
+case 0x96: eEncoding = RTL_TEXTENCODING_APPLE_CYRILLIC; break; 
   // Russian Macintosh
+case 0x97: eEncoding = RTL_TEXTENCODING_APPLE_CENTEURO; break; 
   // Eastern European Macintosh
+case 0x98: eEncoding = RTL_TEXTENCODING_APPLE_GREEK; break;   
// Greek Macintosh
+case 0xC8: eEncoding = RTL_TEXTENCODING_MS_1250; break;   
// Windows EE   code page 1250
+case 0xC9: eEncoding = RTL_TEXTENCODING_MS_1251; break;   
// Russian Windows
+case 0xCA: eEncoding = RTL_TEXTENCODING_MS_1254; break;   
// Turkish Windows
+case 0xCB: eEncoding = RTL_TEXTENCODING_MS_1253; break;   
// Greek Windows
+case 0xCC: eEncoding = RTL_TEXTENCODING_MS_1257; break;   
// Windows, Baltic
+}
+if(eEncoding != RTL_TEXTENCODING_DONTKNOW)
+{
+_out_encoding = eEncoding;
+return true;
+}
+}
+}
+}
+return false;
+}
+
+bool dbfReadCharset(rtl_TextEncoding , SvStream* dbf_Stream)
+{
+sal_uInt8 nType=0;
+dbf_Stream->ReadUChar( nType );
+
+dbf_Stream->Seek(STREAM_SEEK_TO_BEGIN + 29);
+if (dbf_Stream->IsEof())
+{
+return false;
+}
+else
+{
+sal_uInt8 nEncoding=0;
+dbf_Stream->ReadUChar( nEncoding );
+return dbfDecodeCharset(nCharSet, nType, nEncoding);
+}
+}
+
+}
+
 } //namespace connectivity
 
 /* vim:set shiftwidth=4 softtabsto

[Libreoffice-commits] core.git: Branch 'private/lmamane/for-julien2412-master' - connectivity/source include/connectivity sc/CppunitTest_sc_ucalc.mk sc/Library_sc.mk sc/source

2017-07-02 Thread Lionel Elie Mamane
 connectivity/source/commontools/dbtools.cxx  |   83 
 connectivity/source/drivers/dbase/DTable.cxx |   10 +-
 include/connectivity/dbtools.hxx |   45 +++
 sc/CppunitTest_sc_ucalc.mk   |1 
 sc/Library_sc.mk |1 
 sc/source/ui/unoobj/filtuno.cxx  |  107 +--
 6 files changed, 159 insertions(+), 88 deletions(-)

New commits:
commit 678436cb4f4e96eae750c22d704c311d240b1f4a
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jul 2 11:28:09 2017 +0200

factorisation du décodage

Change-Id: I0130945b5c616beaa3eaedb34e5ca77b1bd70547

diff --git a/connectivity/source/commontools/dbtools.cxx 
b/connectivity/source/commontools/dbtools.cxx
index 97316e5e2536..fa34331d85f9 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -2026,6 +2026,89 @@ OSQLColumns::Vector::const_iterator 
find(OSQLColumns::Vector::const_iterator fir
 ++first;
 return first;
 }
+
+namespace dbase
+{
+bool dbfDecodeCharset(rtl_TextEncoding &_out_encoding, sal_uInt8 nType, 
sal_uInt8 nCodepage)
+{
+switch (nType)
+{
+case dBaseIII:
+case dBaseIV:
+case dBaseV:
+case VisualFoxPro:
+case VisualFoxProAuto:
+case dBaseFS:
+case dBaseFSMemo:
+case dBaseIVMemoSQL:
+case dBaseIIIMemo:
+case FoxProMemo:
+{
+if (nCodepage != 0x00)
+{
+auto eEncoding(RTL_TEXTENCODING_DONTKNOW);
+switch(nCodepage)
+{
+case 0x01: eEncoding = RTL_TEXTENCODING_IBM_437; break;   
// DOS USA  code page 437
+case 0x02: eEncoding = RTL_TEXTENCODING_IBM_850; break;   
// DOS Multilingual code page 850
+case 0x03: eEncoding = RTL_TEXTENCODING_MS_1252; break;   
// Windows ANSI code page 1252
+case 0x04: eEncoding = RTL_TEXTENCODING_APPLE_ROMAN; break;   
// Standard Macintosh
+case 0x64: eEncoding = RTL_TEXTENCODING_IBM_852; break;   
// EE MS-DOScode page 852
+case 0x65: eEncoding = RTL_TEXTENCODING_IBM_866; break;   
// Russian MS-DOS   code page 866
+case 0x66: eEncoding = RTL_TEXTENCODING_IBM_865; break;   
// Nordic MS-DOScode page 865
+case 0x67: eEncoding = RTL_TEXTENCODING_IBM_861; break;   
// Icelandic MS-DOS
+//case 0x68: eEncoding = ; break; // Kamenicky (Czech) 
MS-DOS
+//case 0x69: eEncoding = ; break; // Mazovia (Polish) 
MS-DOS
+case 0x6A: eEncoding = RTL_TEXTENCODING_IBM_737; break;   
// Greek MS-DOS (437G)
+case 0x6B: eEncoding = RTL_TEXTENCODING_IBM_857; break;   
// Turkish MS-DOS
+case 0x6C: eEncoding = RTL_TEXTENCODING_IBM_863; break;   
// MS-DOS, Canada
+case 0x78: eEncoding = RTL_TEXTENCODING_MS_950; break;
// Windows, Traditional Chinese
+case 0x79: eEncoding = RTL_TEXTENCODING_MS_949; break;
// Windows, Korean (Hangul)
+case 0x7A: eEncoding = RTL_TEXTENCODING_MS_936; break;
// Windows, Simplified Chinese
+case 0x7B: eEncoding = RTL_TEXTENCODING_MS_932; break;
// Windows, Japanese (Shift-jis)
+case 0x7C: eEncoding = RTL_TEXTENCODING_MS_874; break;
// Windows, Thai
+case 0x7D: eEncoding = RTL_TEXTENCODING_MS_1255; break;   
// Windows, Hebrew
+case 0x7E: eEncoding = RTL_TEXTENCODING_MS_1256; break;   
// Windows, Arabic
+case 0x96: eEncoding = RTL_TEXTENCODING_APPLE_CYRILLIC; break; 
   // Russian Macintosh
+case 0x97: eEncoding = RTL_TEXTENCODING_APPLE_CENTEURO; break; 
   // Eastern European Macintosh
+case 0x98: eEncoding = RTL_TEXTENCODING_APPLE_GREEK; break;   
// Greek Macintosh
+case 0xC8: eEncoding = RTL_TEXTENCODING_MS_1250; break;   
// Windows EE   code page 1250
+case 0xC9: eEncoding = RTL_TEXTENCODING_MS_1251; break;   
// Russian Windows
+case 0xCA: eEncoding = RTL_TEXTENCODING_MS_1254; break;   
// Turkish Windows
+case 0xCB: eEncoding = RTL_TEXTENCODING_MS_1253; break;   
// Greek Windows
+case 0xCC: eEncoding = RTL_TEXTENCODING_MS_1257; break;   
// Windows, Baltic
+}
+if(eEncoding != RTL_TEXTENCODING_DONTKNOW)
+{
+_out_encoding = eEncoding;
+return true;
+}
+}
+}
+}
+return false;
+}
+
+bool dbfReadCharset(rtl_TextEncoding , SvStream* dbf_Stream)
+{
+sal_uInt8 nType=0;
+dbf_Stream->Rea

[Libreoffice-commits] core.git: Branch 'private/lmamane/for-julien2412-master' - 3 commits - configure.ac sc/source

2017-06-27 Thread Lionel Elie Mamane
 configure.ac|2 
 sc/source/ui/unoobj/filtuno.cxx |  107 +++-
 2 files changed, 65 insertions(+), 44 deletions(-)

New commits:
commit 536768846427e9e9d1065c1ab91fd6205eaf2d52
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Jun 28 03:55:33 2017 +0200

check for end of file, correct comment

Change-Id: I8262651019364b5a2a927667cfd31555d03e6eab

diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx
index cacf6956110b..c58ba5a4914b 100644
--- a/sc/source/ui/unoobj/filtuno.cxx
+++ b/sc/source/ui/unoobj/filtuno.cxx
@@ -103,9 +103,8 @@ namespace
 dbf_Stream->SetEndian(SvStreamEndian::LITTLE);
 
 dbf_Stream->Seek(STREAM_SEEK_TO_BEGIN + 29);
-   // TODO : how to check this?
-   // if (seek_succeeded_ie_not_end_of_file)
-//{
+if (! dbf_Stream->IsEof())
+{
 sal_uInt8 nEncoding=0;
 dbf_Stream->ReadUChar( nEncoding );
 if (nEncoding != 0x00)
@@ -148,9 +147,8 @@ namespace
 return charsetSource::charset_from_file;
 }
 }
-//}
+}
 }
-// dbf_Stream goes out of scope, is automatically closed
 }
 {
 Sequence aValues;
@@ -361,6 +359,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute()
break;
 }
 bDBEnc = true;
+// pInStream goes out of scope, the stream is automatically closed
 }
 else if ( aFilterString == ScDocShell::GetDifFilterName() )
 {
commit df18d9d5d7acef2612916ede1e54902c6b440111
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Jun 28 03:55:00 2017 +0200

we need gpgme header, too

not only gpgmepp headers

Change-Id: I46723ce751d631e165982c6c7bc2f820f9a5d0a8

diff --git a/configure.ac b/configure.ac
index 36f6ccebf452..0eb7ed7150a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10281,6 +10281,8 @@ if test "$_os" = "Linux"; then
 # checking for it also filters out older, KDE-dependent libgpgmepp 
versions
 AC_CHECK_LIB(gpgmepp, progress_callback, [ GPGMEPP_LIBS=-lgpgmepp ],
 [AC_MSG_ERROR(gpgmepp not found or not functional)], [])
+AC_CHECK_HEADER(gpgme.h, [],
+[AC_MSG_ERROR([gpgme headers not found, install gpgme development 
package])], [])
 else
 AC_MSG_RESULT([internal])
 BUILD_TYPE="$BUILD_TYPE LIBGPGERROR LIBASSUAN GPGMEPP"
commit f3e471f6434bb7b84de1fd1c75545a4d339119d6
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Jun 28 03:03:02 2017 +0200

julien it compiles patch

Change-Id: I89fa48dda0d907fa0bdcc49be373ed1b1cfd8c73

diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx
index 6b0d56cfd565..cacf6956110b 100644
--- a/sc/source/ui/unoobj/filtuno.cxx
+++ b/sc/source/ui/unoobj/filtuno.cxx
@@ -68,13 +68,25 @@ namespace
 charset_from_user_setting,
 charset_default
 };
-
-charsetSource load_CharSet( rtl_TextEncoding , bool bExport, 
string_or_url fname )
+// TODO: use DTable.hxx instead
+enum DBFType  { dBaseIII = 0x03,
+dBaseIV  = 0x04,
+dBaseV   = 0x05,
+VisualFoxPro = 0x30,
+VisualFoxProAuto = 0x31, // Visual FoxPro with 
AutoIncrement field
+dBaseFS  = 0x43,
+dBaseFSMemo  = 0xB3,
+dBaseIIIMemo = 0x83,
+dBaseIVMemo  = 0x8B,
+dBaseIVMemoSQL   = 0x8E,
+FoxProMemo   = 0xF5
+  };
+
+charsetSource load_CharSet(rtl_TextEncoding , bool bExport, 
SvStream* dbf_Stream)
 {
 {
-lo_stream dbfStream(fname, ...);
 sal_uInt8 nType=0;
-dbfStream.ReadUChar( nType );
+dbf_Stream->ReadUChar( nType );
 
 switch (nType)
 {
@@ -88,56 +100,57 @@ namespace
 case dBaseIVMemoSQL:
 case dBaseIIIMemo:
 case FoxProMemo:
-dbfStream.SetEndian(SvStreamEndian::LITTLE);
+dbf_Stream->SetEndian(SvStreamEndian::LITTLE);
 
-dbf_stream.Seek(STREAM_SEEK_TO_BEGIN + 29);
-if (seek_succeeded_ie_not_end_of_file)
-{
+dbf_Stream->Seek(STREAM_SEEK_TO_BEGIN + 29);
+   // TODO : how to check this?
+   // if (seek_succeeded_ie_not_end_of_file)
+//{
 sal_u

[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - forms/source

2017-06-26 Thread Lionel Elie Mamane
 forms/source/component/ListBox.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 7173b70d665608f3823f4a3ff0653f84c0630ed3
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sat Jun 24 15:10:59 2017 +0200

tdf#108732 ListBox: in absence of a field, treat data as string

so that one meaningfully compare it; default is DataType::OTHER,
which is not comparable

Change-Id: Ifc1e1c9b801f45d0a95a83d30cc205b91e647880
Reviewed-on: https://gerrit.libreoffice.org/39212
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Michael Stahl <mst...@redhat.com>

diff --git a/forms/source/component/ListBox.cxx 
b/forms/source/component/ListBox.cxx
index 76eadaa64afa..f88c3cb77735 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -1078,7 +1078,9 @@ namespace frm
 
 sal_Int32 OListBoxModel::getValueType() const
 {
-return (m_nBoundColumnType != css::sdbc::DataType::SQLNULL) ? 
m_nBoundColumnType : getFieldType();
+return (m_nBoundColumnType != css::sdbc::DataType::SQLNULL) ?
+m_nBoundColumnType :
+( hasField() ? getFieldType() : DataType::VARCHAR);
 }
 
 ValueList OListBoxModel::impl_getValues() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - forms/source

2017-06-26 Thread Lionel Elie Mamane
 forms/source/component/ListBox.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 39ea36bf8602744c27c16369c88db2858653b59f
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sat Jun 24 15:10:59 2017 +0200

tdf#108732 ListBox: in absence of a field, treat data as string

so that one meaningfully compare it; default is DataType::OTHER,
which is not comparable

Change-Id: Ifc1e1c9b801f45d0a95a83d30cc205b91e647880
Reviewed-on: https://gerrit.libreoffice.org/39211
Reviewed-by: Michael Stahl <mst...@redhat.com>
Tested-by: Michael Stahl <mst...@redhat.com>

diff --git a/forms/source/component/ListBox.cxx 
b/forms/source/component/ListBox.cxx
index d5599d55859e..b875eef1d15c 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -1070,7 +1070,9 @@ namespace frm
 
 sal_Int32 OListBoxModel::getValueType() const
 {
-return (m_nBoundColumnType != css::sdbc::DataType::SQLNULL) ? 
m_nBoundColumnType : getFieldType();
+return (m_nBoundColumnType != css::sdbc::DataType::SQLNULL) ?
+m_nBoundColumnType :
+( hasField() ? getFieldType() : DataType::VARCHAR);
 }
 
 ValueList OListBoxModel::impl_getValues() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'private/lmamane/for-julien2412-master'

2017-06-25 Thread Lionel Elie Mamane
New branch 'private/lmamane/for-julien2412-master' available with the following 
commits:
commit 414f4a1a33b3d4ef8db9fc672c9207233f1292bc
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jun 25 18:02:01 2017 +0200

ne plus faire la détection automatioque une 2e fois

et lui faire confiance, i.e. ne plus écraser IBM_850
TODO: vérifier le cas base, où ce ne serait pas une 2e fois et il 
faudrait encore la faire

Conflicts:
connectivity/source/drivers/dbase/DTable.cxx

Change-Id: I401a93dce8ddf100031f1f04872df47ef453eb63

commit 3a3c95edea33bf709e74fd1dbe56e76df7ac206c
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jun 25 17:49:28 2017 +0200

utiliser la détection automatique

Change-Id: I355396794a883e131698d56046b9226095dd8414

commit 90460550db9a9c5a154024b34e677da6b90f2e3b
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jun 25 17:21:45 2017 +0200

détection automatique

Change-Id: Ic6b940b4bd5f3c181b022acffb211b719b99710f

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'private/lmamane/for-julien2412' - connectivity/source sc/source

2017-06-25 Thread Lionel Elie Mamane
 connectivity/source/drivers/dbase/DTable.cxx |   44 +--
 sc/source/ui/docshell/docsh8.cxx |4 --
 2 files changed, 3 insertions(+), 45 deletions(-)

New commits:
commit 63146e2a26274d33c12420937d13b88c527e5054
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jun 25 18:02:01 2017 +0200

ne plus faire la détection automatioque une 2e fois

et lui faire confiance, i.e. ne plus écraser IBM_850
TODO: vérifier le cas base, où ce ne serait pas une 2e fois et il 
faudrait encore la faire

Change-Id: I401a93dce8ddf100031f1f04872df47ef453eb63

diff --git a/connectivity/source/drivers/dbase/DTable.cxx 
b/connectivity/source/drivers/dbase/DTable.cxx
index 11d35d1359a1..604cde350986 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -240,47 +240,9 @@ void ODbaseTable::readHeader()
 case dBaseIVMemoSQL:
 case dBaseIIIMemo:
 case FoxProMemo:
-m_pFileStream->SetEndian(SvStreamEndian::LITTLE);
-if ( m_aHeader.db_frei[17] != 0x00
-&& !m_aHeader.db_frei[18] && !m_aHeader.db_frei[19] && 
getConnection()->isTextEncodingDefaulted() )
-{
-switch(m_aHeader.db_frei[17])
-{
-case 0x01: m_eEncoding = RTL_TEXTENCODING_IBM_437; 
break;   // DOS USA  code page 437
-case 0x02: m_eEncoding = RTL_TEXTENCODING_IBM_850; 
break;   // DOS Multilingual code page 850
-case 0x03: m_eEncoding = RTL_TEXTENCODING_MS_1252; 
break;   // Windows ANSI code page 1252
-case 0x04: m_eEncoding = RTL_TEXTENCODING_APPLE_ROMAN; 
break;   // Standard Macintosh
-case 0x64: m_eEncoding = RTL_TEXTENCODING_IBM_852; 
break;   // EE MS-DOScode page 852
-case 0x65: m_eEncoding = RTL_TEXTENCODING_IBM_865; 
break;   // Nordic MS-DOScode page 865
-case 0x66: m_eEncoding = RTL_TEXTENCODING_IBM_866; 
break;   // Russian MS-DOS   code page 866
-case 0x67: m_eEncoding = RTL_TEXTENCODING_IBM_861; 
break;   // Icelandic MS-DOS
-//case 0x68: m_eEncoding = ; break; // Kamenicky 
(Czech) MS-DOS
-//case 0x69: m_eEncoding = ; break; // Mazovia 
(Polish) MS-DOS
-case 0x6A: m_eEncoding = RTL_TEXTENCODING_IBM_737; 
break;   // Greek MS-DOS (437G)
-case 0x6B: m_eEncoding = RTL_TEXTENCODING_IBM_857; 
break;   // Turkish MS-DOS
-case 0x6C: m_eEncoding = RTL_TEXTENCODING_IBM_863; 
break;   // MS-DOS, Canada
-case 0x78: m_eEncoding = RTL_TEXTENCODING_MS_950; 
break;// Windows, Traditional Chinese
-case 0x79: m_eEncoding = RTL_TEXTENCODING_MS_949; 
break;// Windows, Korean (Hangul)
-case 0x7A: m_eEncoding = RTL_TEXTENCODING_MS_936; 
break;// Windows, Simplified Chinese
-case 0x7B: m_eEncoding = RTL_TEXTENCODING_MS_932; 
break;// Windows, Japanese (Shift-jis)
-case 0x7C: m_eEncoding = RTL_TEXTENCODING_MS_874; 
break;// Windows, Thai
-case 0x7D: m_eEncoding = RTL_TEXTENCODING_MS_1255; 
break;   // Windows, Hebrew
-case 0x7E: m_eEncoding = RTL_TEXTENCODING_MS_1256; 
break;   // Windows, Arabic
-case 0x96: m_eEncoding = 
RTL_TEXTENCODING_APPLE_CYRILLIC; break;// Russian Macintosh
-case 0x97: m_eEncoding = 
RTL_TEXTENCODING_APPLE_CENTEURO; break;// Eastern European Macintosh
-case 0x98: m_eEncoding = RTL_TEXTENCODING_APPLE_GREEK; 
break;   // Greek Macintosh
-case 0xC8: m_eEncoding = RTL_TEXTENCODING_MS_1250; 
break;   // Windows EE   code page 1250
-case 0xC9: m_eEncoding = RTL_TEXTENCODING_MS_1251; 
break;   // Russian Windows
-case 0xCA: m_eEncoding = RTL_TEXTENCODING_MS_1254; 
break;   // Turkish Windows
-case 0xCB: m_eEncoding = RTL_TEXTENCODING_MS_1253; 
break;   // Greek Windows
-case 0xCC: m_eEncoding = RTL_TEXTENCODING_MS_1257; 
break;   // Windows, Baltic
-default:
-// Default Encoding
-m_eEncoding = RTL_TEXTENCODING_IBM_850;
-break;
-}
-}
-break;
+// TODO: check that the code removed here is not needed when 
opening a DBF file
+// from something else than Calc. 

[Libreoffice-commits] core.git: Branch 'private/lmamane/for-julien2412' - sc/source

2017-06-25 Thread Lionel Elie Mamane
 sc/source/ui/unoobj/filtuno.cxx |   37 +
 1 file changed, 29 insertions(+), 8 deletions(-)

New commits:
commit a3735079d820c4d98d878061a02ac48bb59d1c52
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jun 25 17:49:28 2017 +0200

utiliser la détection automatique

Change-Id: I355396794a883e131698d56046b9226095dd8414

diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx
index 3b82771df6ae..2fdea70d8d11 100644
--- a/sc/source/ui/unoobj/filtuno.cxx
+++ b/sc/source/ui/unoobj/filtuno.cxx
@@ -298,6 +298,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() 
throw(uno::RuntimeException, st
 bool bMultiByte = true;
 bool bDBEnc = false;
 bool bAscii = false;
+bool skipDialog = false;
 
 sal_Unicode cStrDel = '"';
 sal_Unicode cAsciiDel = ';';
@@ -339,7 +340,11 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() 
throw(uno::RuntimeException, st
 //  dBase import
 aTitle = ScGlobal::GetRscString( STR_IMPORT_DBF );
 }
-load_CharSet( eEncoding, bExport );
+switch(load_CharSet( eEncoding, bExport, aFileName ))
+{
+case charset_from_file:
+skipDialog = true;
+}
 bDBEnc = true;
 }
 else if ( aFilterString == ScDocShell::GetDifFilterName() )
@@ -359,20 +364,36 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() 
throw(uno::RuntimeException, st
 }
 
 ScImportOptions aOptions( cAsciiDel, cStrDel, eEncoding);
-
-ScopedVclPtr 
pDlg(pFact->CreateScImportOptionsDlg(
+if(skipDialog)
+{
+// TODO: check we are not missing some of the stuff that 
ScImportOptionsDlg::GetImportOptions
+// (file sc/source/ui/dbgui/scuiimoptdlg.cxx) does
+// that is, if the dialog sets options that are not selected by 
the user (!)
+// then we are missing them here.
+// Then we may need to rip them out of the dialog.
+// Or we actually change the dialog to not display if 
skipDialog==true
+// in that case, add an argument skipDialog to 
CreateScImportOptionsDlg
+nRet = ui::dialogs::ExecutableDialogResults::OK;
+}
+else
+{
+ScopedVclPtr 
pDlg(pFact->CreateScImportOptionsDlg(
 
bAscii, , , bMultiByte, bDBEnc,
 
!bExport));
-OSL_ENSURE(pDlg, "Dialog create fail!");
-if ( pDlg->Execute() == RET_OK )
+OSL_ENSURE(pDlg, "Dialog create fail!");
+if ( pDlg->Execute() == RET_OK )
+{
+pDlg->GetImportOptions( aOptions );
+save_CharSet( aOptions.eCharSet, bExport );
+nRet = ui::dialogs::ExecutableDialogResults::OK;
+}
+}
+if (nRet == ui::dialogs::ExecutableDialogResults::OK)
 {
-pDlg->GetImportOptions( aOptions );
-save_CharSet( aOptions.eCharSet, bExport );
 if ( bAscii )
 aFilterOptions = aOptions.BuildString();
 else
 aFilterOptions = aOptions.aStrFont;
-nRet = ui::dialogs::ExecutableDialogResults::OK;
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'private/lmamane/for-julien2412'

2017-06-25 Thread Lionel Elie Mamane
New branch 'private/lmamane/for-julien2412' available with the following 
commits:
commit 960fbf5b6774f6d12b6cbddaba67f5788d68502f
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Jun 25 17:21:45 2017 +0200

détection automatique

Change-Id: Ic6b940b4bd5f3c181b022acffb211b719b99710f

commit 8ad1d7259226ed361ce79eb4799a07f5b6019630
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sat Jun 24 15:09:19 2017 +0200

janitorial; not useful; is actually used below

Change-Id: I87484b04d9f3feecdac3c53bc7eb3a5ec05e7af7

commit c24b0f0f93eff799f7c6ba1fc2415373deb8d856
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Mon Mar 6 17:49:36 2017 +0100

remove unused #include

Change-Id: I97111309432359968e890aacd0a285d068991307

commit 7a1f1d7ba2376877b50919c682ee6cca305a2fb3
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Mon Mar 6 17:49:17 2017 +0100

tdf#40575 remove obsolete MAX_DAYS check

Change-Id: Ifccf3a1fe27011a8e72464bf76cadcf16f5f5fa7

commit c6863993dbd92014efd2d65576172cde332ebac5
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Fri Mar 6 11:43:03 2015 +0100

recognise PostgreSQL interval

Change-Id: I3ce46215d3ae8043052b3291b7e570a302bba474

commit 1d1eb5411b80677bfda7f6f3e2b9ce24292d17fe
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Fri Oct 26 17:32:26 2012 +0200

LEM TODO

Change-Id: I044d70251f675c504a77bedc281243043cf29742

commit 388bc971c56b82fd4716d3b4fd16d0efed15e947
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Nov 30 15:55:07 2011 +0100

LEM TODO note

commit 31b8ba7f8a8efbc6e04023c6138e17738d07a490
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sun Nov 20 17:37:39 2011 +0100

LEM TODO note

commit 134a0b8cf0812865659b065055b488b480af19d3
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Wed Nov 23 21:34:18 2011 +0100

maximal debugging information

commit 5de33a5fb7f70fd087c19dd7e2017fe66f95b3c8
Author: Lionel Elie Mamane <lionel.mam...@gestman.lu>
Date:   Mon Jun 16 16:08:00 2014 +0200

Let Debian aclocal boost macros take effect

(they are fixed for multiarch)

Change-Id: I28a54b8b88b2a217249bcd4e8bcabbdd96ca7d12

commit 3aa20b929fd2888bc3f8542baae48dbc6e3362cb
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sat Jun 24 15:10:59 2017 +0200

tdf#108732 ListBox: in absence of a field, treat data as string

so that one meaningfully compare it; default is DataType::OTHER,
which is not comparable

Change-Id: Ifc1e1c9b801f45d0a95a83d30cc205b91e647880

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: 2 commits - forms/source

2017-06-24 Thread Lionel Elie Mamane
 forms/source/component/FormComponent.cxx |2 +-
 forms/source/component/ListBox.cxx   |4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 521d8d91cd0a1eb92c50d0b9d4ae163073dbff4b
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sat Jun 24 15:09:19 2017 +0200

janitorial; not useful; is actually used below

Change-Id: I87484b04d9f3feecdac3c53bc7eb3a5ec05e7af7

diff --git a/forms/source/component/FormComponent.cxx 
b/forms/source/component/FormComponent.cxx
index fc6394a70c24..212e02bbc3c8 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -2030,7 +2030,7 @@ void 
OBoundControlModel::impl_connectDatabaseColumn_noNotify( bool _bFromReload
 // consistency checks
 DBG_ASSERT( !( hasField() && !_bFromReload ),
 "OBoundControlModel::impl_connectDatabaseColumn_noNotify: the form is 
just *loaded*, but we already have a field!" );
-(void)_bFromReload;
+
 Reference< XRowSet > xRowSet( m_xAmbientForm, UNO_QUERY );
 OSL_ENSURE( xRowSet.is(), 
"OBoundControlModel::impl_connectDatabaseColumn_noNotify: no row set!" );
 if ( !xRowSet.is() )
commit ecdcf38a3250536d9b7f48a8ded50e23ccfcd1df
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Sat Jun 24 15:10:59 2017 +0200

tdf#108732 ListBox: in absence of a field, treat data as string

so that one meaningfully compare it; default is DataType::OTHER,
which is not comparable

Change-Id: Ifc1e1c9b801f45d0a95a83d30cc205b91e647880

diff --git a/forms/source/component/ListBox.cxx 
b/forms/source/component/ListBox.cxx
index 59e416451b96..fbd2ce67a7bd 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -1102,7 +1102,9 @@ namespace frm
 
 sal_Int32 OListBoxModel::getValueType() const
 {
-return (m_nBoundColumnType != css::sdbc::DataType::SQLNULL) ? 
m_nBoundColumnType : getFieldType();
+return (m_nBoundColumnType != css::sdbc::DataType::SQLNULL) ?
+m_nBoundColumnType :
+( hasField() ? getFieldType() : DataType::VARCHAR);
 }
 
 ValueList OListBoxModel::impl_getValues() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - forms/source

2017-05-26 Thread Lionel Elie Mamane
 forms/source/component/FormComponent.cxx |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit bb50f9d66540a87065f30da8fd8cadde8e730704
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Tue May 9 12:53:25 2017 +0200

tdf#107720 Bound Control initFromField: consider the case of the insert row

loplugin: simplifybool
(cherry picked from commit 95b25532d24bfb08c4846b991451a36475dd439f)

Change-Id: If18e161c994c926fd86453ab5736df1e89bb61de
Reviewed-on: https://gerrit.libreoffice.org/37427
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Michael Stahl <mst...@redhat.com>

diff --git a/forms/source/component/FormComponent.cxx 
b/forms/source/component/FormComponent.cxx
index 80e85758801c..743f4d47986b 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -1981,7 +1981,17 @@ void OBoundControlModel::initFromField( const Reference< 
XRowSet >& _rxRowSet )
 // but only if the rowset is positioned on a valid record
 if ( hasField() && _rxRowSet.is() )
 {
-if ( !_rxRowSet->isBeforeFirst() && !_rxRowSet->isAfterLast() )
+bool shouldTransfer(!_rxRowSet->isBeforeFirst() && 
!_rxRowSet->isAfterLast());
+if (!shouldTransfer)
+{
+const Reference< XPropertySet > xPS(_rxRowSet, UNO_QUERY);
+if (xPS.is())
+{
+assert(!shouldTransfer);
+xPS->getPropertyValue("IsNew") >>= shouldTransfer;
+}
+}
+if ( shouldTransfer )
 transferDbValueToControl();
 else
 // reset the field if the row set is empty
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-05-09 Thread Lionel Elie Mamane
 forms/source/component/FormComponent.cxx |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 24e05b48cb7ceb67c2566bbb212cbc1d752bb59e
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Tue May 9 12:53:25 2017 +0200

tdf#107720 Bound Control initFromField: consider the case of the insert row

Change-Id: If18e161c994c926fd86453ab5736df1e89bb61de

diff --git a/forms/source/component/FormComponent.cxx 
b/forms/source/component/FormComponent.cxx
index 97bea91aa8b9..db71eba8e285 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -1980,7 +1980,17 @@ void OBoundControlModel::initFromField( const Reference< 
XRowSet >& _rxRowSet )
 // but only if the rowset is positioned on a valid record
 if ( hasField() && _rxRowSet.is() )
 {
-if ( !_rxRowSet->isBeforeFirst() && !_rxRowSet->isAfterLast() )
+bool shouldTransfer(!_rxRowSet->isBeforeFirst() && 
!_rxRowSet->isAfterLast());
+if (!shouldTransfer)
+{
+const Reference< XPropertySet > xPS(_rxRowSet, UNO_QUERY);
+if (xPS.is())
+{
+assert(shouldTransfer == false);
+xPS->getPropertyValue("IsNew") >>= shouldTransfer;
+}
+}
+if ( shouldTransfer )
 transferDbValueToControl();
 else
 // reset the field if the row set is empty
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - connectivity/source

2017-05-02 Thread Lionel Elie Mamane
 connectivity/source/commontools/parameters.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit b78cabc850e0a71873714c892c46c9edb25fd364
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Fri Apr 28 17:19:44 2017 +0200

tdf#107457 don't quote columns referred by expression (not by name)

Change-Id: I4894313ec27d716e9899c885ddc6be38a2447689
Reviewed-on: https://gerrit.libreoffice.org/37078
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Michael Stahl <mst...@redhat.com>

diff --git a/connectivity/source/commontools/parameters.cxx 
b/connectivity/source/commontools/parameters.cxx
index 32c2cc0a520a..fa57c5750424 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -224,7 +224,12 @@ namespace dbtools
 {
 OUString colName;
 xDetailField->getPropertyValue("RealName") >>= colName;
-sFilter += quoteName( m_sIdentifierQuoteString, colName ) + " = :";
+sal_Bool isFunction(false);
+xDetailField->getPropertyValue("Function") >>= isFunction;
+if (isFunction)
+sFilter += colName;
+else
+sFilter += quoteName( m_sIdentifierQuoteString, colName );
 }
 
 // generate a parameter name which is not already used
@@ -235,7 +240,7 @@ namespace dbtools
 o_rNewParamName += "_";
 }
 
-return sFilter += o_rNewParamName;
+return sFilter += " =:" + o_rNewParamName;
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-04-28 Thread Lionel Elie Mamane
 connectivity/source/commontools/parameters.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 9e6b275a19b3f11e9a5d87d1cbb9ad192705572f
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Fri Apr 28 17:19:44 2017 +0200

tdf#107457 don't quote columns referred by expression (not by name)

Change-Id: I4894313ec27d716e9899c885ddc6be38a2447689

diff --git a/connectivity/source/commontools/parameters.cxx 
b/connectivity/source/commontools/parameters.cxx
index 4f0caca3b4de..3ef722a8fdf9 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -224,7 +224,12 @@ namespace dbtools
 {
 OUString colName;
 xDetailField->getPropertyValue("RealName") >>= colName;
-sFilter += quoteName( m_sIdentifierQuoteString, colName ) + " = :";
+sal_Bool isFunction(false);
+xDetailField->getPropertyValue("Function") >>= isFunction;
+if (isFunction)
+sFilter += colName;
+else
+sFilter += quoteName( m_sIdentifierQuoteString, colName );
 }
 
 // generate a parameter name which is not already used
@@ -235,7 +240,7 @@ namespace dbtools
 o_rNewParamName += "_";
 }
 
-return sFilter += o_rNewParamName;
+return sFilter += " =:" + o_rNewParamName;
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: DbGridControl's confusion of BrowseBox's column number vs. column ID

2017-03-10 Thread Lionel Elie Mamane
On Fri, Mar 10, 2017 at 01:52:36PM +0100, Stephan Bergmann wrote:
> svtools' BrowseBox class (include/svtools/brwbox.hxx; effectively a
> collection of BrowseColumn via the BrowseBox::pCols member) apparently
> distinguishes between a column's index/position/number (i.e., the
> BrowseColumn's position within the BrowseBox::pCols vector) and its ID
> (i.e., the BrowseColumn::_nId member, svtools/source/brwbox/datwin.hxx).

> Does anybody (Lionel?) known something about that DbGridControl code? Would
> this be a bug (if so, any idea how to reproduce it at the GUI?) or is it
> maybe an invariant of such a DbGridControl that it's columns' ID always
> match the columns' positions?

No, it is not an invariant. Consider

file fmgridcl.cxx function FmGridControl::InitColumnsByModels

for (i = 0; i < xColumns->getCount(); ++i)
{
...
AppendColumn(aName, (sal_uInt16)nWidth);
...
}
// now all columns are inserted with identical id and pos
...
for (i = 0; i < xColumns->getCount(); ++i)
{
Reference< css::beans::XPropertySet > xCol(
xColumns->getByIndex(i), css::uno::UNO_QUERY);
aHidden = xCol->getPropertyValue(FM_PROP_HIDDEN);
if (::comphelper::getBOOL(aHidden))
   HideColumn(GetColumnIdFromModelPos((sal_uInt16)i));
}

And HideColumn calls

DbGridControl::HideColumn(nId);
which calls
DbGridControl_base::HideColumn(nId);
that is
BrowseBox::RemoveColumn

which does

BrowserColumns::iterator it = pCols->begin();
::std::advance( it, nPos );
delete *it;
pCols->erase( it );

As soon as there is a hidden column, the position and id of the
columns after that one don't match anymore.

-- 
Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: DbGridControl's confusion of BrowseBox's column number vs. column ID

2017-03-10 Thread Lionel Elie Mamane
On Fri, Mar 10, 2017 at 01:52:36PM +0100, Stephan Bergmann wrote:

> svtools' BrowseBox class (include/svtools/brwbox.hxx; effectively a
> collection of BrowseColumn via the BrowseBox::pCols member) apparently
> distinguishes between a column's index/position/number (i.e., the
> BrowseColumn's position within the BrowseBox::pCols vector) and its ID
> (i.e., the BrowseColumn::_nId member, svtools/source/brwbox/datwin.hxx).

> Now, BrowseBox::GetColumnAtXPosPixel (svtools/source/brwbox/brwbox1.cxx)
> apparently always returned a column number,

> while DbGridControl::GetModelColumnPos (svx/source/fmcomp/gridctrl.cxx)
> apparently always expected a column ID as input,


> But there is two occurrences of code in svx/source/fmcomp/gridctrl.cxx that
> feeds the output of GetColumnAtXPosPixel as input into GetModelColumnPos,
> i.e., misinterprets a column number as a column ID. Meanwhile that code
> lives in DbGridControl::StartDrag,

> [...]
> > sal_uInt16 nColId = GetColumnAtXPosPixel(rPosPixel.X());
> > long   nRow = GetRowAtYPosPixel(rPosPixel.Y());
> > if (nColId != HandleColumnId && nRow >= 0)
> > {
> > if (GetDataWindow().IsMouseCaptured())
> > GetDataWindow().ReleaseMouse();
> > 
> > size_t Location = GetModelColumnPos( nColId );
> [...]

There are a few bugs around dragging columns that I know of, but they
don't look obviously directly caused by what you describe. Maybe in
combination with something else I'm not aware of. It is not known to
me that they appear only in the presence of hidden columns. One bug
that comes to mind is tdf#54021: dragging a column copies it instead
of moving it. But AFAIK this is a regression, so if this confusion was
"always" there... Maybe it was latent but exposed by another change.

> and DbGridControl::Command,
> 
> [...]
> > sal_uInt16 nColId = 
> > GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X());
> > long   nRow = GetRowAtYPosPixel(rEvt.GetMousePosPixel().Y());
> > 
> > if (nColId == HandleColumnId)
> > {
> > executeRowContextMenu( nRow, rEvt.GetMousePosPixel() );
> > }
> > else if (canCopyCellText(nRow, nColId))
> > {
> > ScopedVclPtrInstance 
> > aContextMenu(SVX_RES(RID_SVXMNU_CELL));
> > aContextMenu->RemoveDisabledEntries(true, true);
> > switch (aContextMenu->Execute(this, 
> > rEvt.GetMousePosPixel()))
> > {
> > case SID_COPY:
> > copyCellText(nRow, nColId);
> [...]
> 
> where DbGridControl::copyCellText (svx/source/fmcomp/gridctrl.cxx) calls
> GetModelColumnPos,
> 
> > void DbGridControl::copyCellText(sal_Int32 _nRow, sal_uInt16 _nColId)
> > {
> > DBG_ASSERT(canCopyCellText(_nRow, _nColId), 
> > "DbGridControl::copyCellText: invalid call!");
> > DbGridColumn* pColumn = m_aColumns[ GetModelColumnPos(_nColId) ];
> > SeekRow(_nRow);
> > OStringTransfer::CopyString( GetCurrentRowCellText( pColumn,m_xPaintRow 
> > ), this );
> > }

Look at DbGridControl::HideColumn:

DbGridControl_Base::RemoveColumn(nId);
 // don't use my own RemoveColumn, this would remove it from 
m_aColumns, too

I now realise there are *three* numbers linked to a column:

 - position in m_aColumns
 - position in pCols
 - stored (immutable?) id

See also the big comment in DbGridControl::ColumnMoved, where they are
called (I think in that order):

 - model pos
 - view pos
 - ID

It looks like ID and model pos could always be the same *initially*
but it looks like this is not the case when BrowseBox::SetColumnPos /
DbGridControl::ColumnMoved is called.


My reading now is that DbGridControl::copyCellText gets a "view pos"
and passes it to GetModelColumnPos which expects an id and returns a
"model pos".


It starts to look like bugs will appear if you:

1) Open a document with a form with a table control.

2) Move a column (which may be possible only pogrammatically or after
   tdf#54021 is fixed)

3) Try to copy the cell text (you'll copy from the wrong column)

-- 
Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - forms/source

2017-03-10 Thread Lionel Elie Mamane
 forms/source/component/ListBox.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 23b8a097090ad544c596e644cf477feb360c9469
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Thu Mar 9 19:44:38 2017 +0100

tdf#106462 old value and new value were swapped

in

commit 66ccfcd2908445b8194c364c89778056374b02af
Author: Jochen Nitschke <j.nitschke+loger...@ok.de>
Date:   Fri Oct 21 09:36:10 2016 +0200

remove use of tryPropertyValue Any specialisation

Change-Id: I3180cf5b9e63a3da9257b03ba02967a2d5402ec3
Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

Change-Id: I90dd3f6dba799eec9210dbb7560be105cb50e6d1
Reviewed-on: https://gerrit.libreoffice.org/35021
Tested-by: Jenkins <c...@libreoffice.org>
Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/forms/source/component/ListBox.cxx 
b/forms/source/component/ListBox.cxx
index 00e1e7a..d5599d5 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -421,8 +421,8 @@ namespace frm
 Any _rCurrentValue = getCurrentSingleValue();
 if (_rCurrentValue != _rValue)
 {
-_rOldValue = _rValue;
-_rConvertedValue = _rCurrentValue;
+_rOldValue = _rCurrentValue;
+_rConvertedValue = _rValue;
 bModified = true;
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-03-09 Thread Lionel Elie Mamane
 forms/source/component/ListBox.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4f4b06ce320305413bcac123a27b6f3f14655cdf
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Thu Mar 9 19:44:38 2017 +0100

tdf#106462 old value and new value were swapped

in

commit 66ccfcd2908445b8194c364c89778056374b02af
Author: Jochen Nitschke <j.nitschke+loger...@ok.de>
Date:   Fri Oct 21 09:36:10 2016 +0200

remove use of tryPropertyValue Any specialisation

Change-Id: I3180cf5b9e63a3da9257b03ba02967a2d5402ec3
Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

Change-Id: I90dd3f6dba799eec9210dbb7560be105cb50e6d1
Reviewed-on: https://gerrit.libreoffice.org/35023
Reviewed-by: Lionel Elie Mamane <lio...@mamane.lu>
    Tested-by: Lionel Elie Mamane <lio...@mamane.lu>

diff --git a/forms/source/component/ListBox.cxx 
b/forms/source/component/ListBox.cxx
index 2e1d52c..a57322e 100644
--- a/forms/source/component/ListBox.cxx
+++ b/forms/source/component/ListBox.cxx
@@ -425,8 +425,8 @@ namespace frm
 Any _rCurrentValue = getCurrentSingleValue();
 if (_rCurrentValue != _rValue)
 {
-_rOldValue = _rValue;
-_rConvertedValue = _rCurrentValue;
+_rOldValue = _rCurrentValue;
+_rConvertedValue = _rValue;
 bModified = true;
 }
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-03-06 Thread Lionel Elie Mamane
 connectivity/source/commontools/dbconversion.cxx |   20 
 connectivity/source/drivers/jdbc/Date.cxx|1 -
 2 files changed, 4 insertions(+), 17 deletions(-)

New commits:
commit c7637cf6df213a6fd620b5250e4e3875c9251aa4
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Mon Mar 6 17:49:36 2017 +0100

remove unused #include

Change-Id: I97111309432359968e890aacd0a285d068991307

diff --git a/connectivity/source/drivers/jdbc/Date.cxx 
b/connectivity/source/drivers/jdbc/Date.cxx
index 82c3ebf..3db5a56 100644
--- a/connectivity/source/drivers/jdbc/Date.cxx
+++ b/connectivity/source/drivers/jdbc/Date.cxx
@@ -19,7 +19,6 @@
 
 #include "java/util/Date.hxx"
 #include "java/tools.hxx"
-#include 
 using namespace connectivity;
 
 // Class: java.util.Date
commit 57909620b4493ae7c8fe950c47e2c826b3c164aa
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Mon Mar 6 17:49:17 2017 +0100

tdf#40575 remove obsolete MAX_DAYS check

Change-Id: Ifccf3a1fe27011a8e72464bf76cadcf16f5f5fa7

diff --git a/connectivity/source/commontools/dbconversion.cxx 
b/connectivity/source/commontools/dbconversion.cxx
index 63dc308..763eb6c 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -30,8 +30,6 @@
 #include 
 #include 
 
-#define MAX_DAYS3636532
-
 namespace
 {
 const sal_Int64 nanoSecInSec = 10;
@@ -270,13 +268,8 @@ namespace dbtools
 sal_Int32   nTempDays = implRelativeToAbsoluteNull( _rDate );
 
 nTempDays += nDays;
-if ( nTempDays > MAX_DAYS )
-{
-_rDate.Day  = 31;
-_rDate.Month= 12;
-_rDate.Year = ;
-}
-else if ( nTempDays <= 0 )
+// TODO: can we remove that check? Would allow dates before 1900.
+if ( nTempDays <= 0 )
 {
 _rDate.Day  = 1;
 _rDate.Month= 1;
@@ -291,13 +284,8 @@ namespace dbtools
 sal_Int32   nTempDays = implRelativeToAbsoluteNull( _rDate );
 
 nTempDays -= nDays;
-if ( nTempDays > MAX_DAYS )
-{
-_rDate.Day  = 31;
-_rDate.Month= 12;
-_rDate.Year = ;
-}
-else if ( nTempDays <= 0 )
+// TODO: can we remove that check? Would allow dates before 1900.
+if ( nTempDays <= 0 )
 {
 _rDate.Day  = 1;
 _rDate.Month= 1;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: Usage of ActiveX in Libre Office

2017-01-31 Thread Lionel Elie Mamane
I think what he meant is that rewriting their ERP to another API to
drive LibreOffice would be quite some work for them, and not gonna
happen except if forced kicking and screaming.

In principle, I like to support these kinds of universal (in this case
"universal on a platform") APIs; are we deprecating / yanking only
ActiveX or the whole COM Automation / OLE / ... bridge (insofar as
these differ, I'm a bit lost in the Microsoft terminology)?

On Fri, Jan 27, 2017 at 09:19:33PM +0100, Heiko Tietze wrote:
> It would be much nicer to have a Pascal bridge rather than to support
> the proprietary ActiveX protocol. Some references are on the
> Freepascal wiki http://wiki.freepascal.org/Office_Automation
> 
> 2017-01-23 15:42 GMT+01:00  :
> > We are recently switched from AOO to LO. In the release notes a possible
> > removal of ActiveX is announced.
> > You are asking for information about the use case so here we are:
> >
> > We are using in our company a selfmade ERP system which is grown for more
> > than 15 years now. For historical reasons the system is written in Delphi.
> > At the beginning MS Office was used as "office frontend", since about 10
> > years OOo/AOO/LO. The main workflow is using calc for business calculation
> > and writer as a kind of report tool. Most information from the main database
> > is delivered via ActiveX to calc. After working in calc the information are
> > read back and used to create documents in writer. The complete project and
> > document management (and many more) is done by our ERP.
> >
> > I know there are others and probably more elegant ways and about once a year
> > we are discussing to change that and finding the "big solution" - but this
> > is a huge and expensive project.
> >
> > Removing ActiveX from LO will be a showstopper and nail us to the last
> > supported release - or bring us back to AOO, who knows.
> >
> > Best regards
> > Joergen Pisarz
> > ___
> > LibreOffice mailing list
> > LibreOffice@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/libreoffice
> ___
> LibreOffice mailing list
> LibreOffice@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Java based connectivity drivers

2017-01-13 Thread Lionel Elie Mamane
On Fri, Jan 13, 2017 at 01:44:42PM +0100, Bunth Tamás wrote:

> I'd like to have a better understanding of how the hsqldb and jdbc
> drivers work.

> Is there any wiki page for them like "FirebirdSQL" for firebird that
> I couldn't find?

Nah, I don't think so, not on the TDF/LibreOffice wiki. There are some
on the OpenOffice wiki, but not what (I think) you are looking for:

https://wiki.openoffice.org/wiki/Base/connectivity/HSQLdb#HSQLDB
https://wiki.openoffice.org/wiki/HSQLDB_Integration
https://wiki.openoffice.org/wiki/HSQLDB:Tips_and_Tricks
https://wiki.openoffice.org/wiki/HSQLDB_Localization

> The code in connectivity/source/drivers/jdbc contains a bunch of java
> function calls afais. So where are the java codes, and how does the
> driver call them?

The Java code is in the JDBC driver, that is loaded from the
system. In the case of embedded HSQLDB, the JDBC driver is bundled
with LibreOffice and is handled in the build system by
external/hsqldb. It is installed as instdir/program/classes/hsqldb.jar
You'll find the source in workdir/UnpackedTarball/hsqldb/

There is also instdir/program/classes/sdbc_hsqldb.jar; I think this
contains the hack to redirect HSQLDB writes directly into the
in-memory ZIP structure of the ODB instead of to a file. The actual
source code to that is in connectivity/source/drivers/hsqldb/Storage*
and connectivity/com/sun/star/sdbcx/comp/hsqldb

The embedded HSQLDB is mostly just the JDBC driver, with some extras
specific to HSQLDB in connectivity/source/drivers/hsqldb

(In the case of HSQLDB, "JDBC driver" is a bit of a misnomer, since
JDBC is the native API of HSQLDB.)

-- 
Lionel
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - connectivity/source

2017-01-13 Thread Lionel Elie Mamane
 connectivity/source/drivers/jdbc/Reader.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9e03d012047101043c0b71d79f5497728125e089
Author: Lionel Elie Mamane <lio...@mamane.lu>
Date:   Fri Jan 13 10:50:35 2017 +0100

jdbc clob character stream: return 1 when returning a single odd byte

if at that point nBytesToRead is 0, it may be that it was 1, but we
have read one byte from the buffer (m_buf). So in this case, return 1,
not 0 (which would signal EOF).

Change-Id: I229e53f1c38c80f709df244a3509caccd69c8ecf
Reviewed-on: https://gerrit.libreoffice.org/33030
Reviewed-by: Caolán McNamara <caol...@redhat.com>
Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/connectivity/source/drivers/jdbc/Reader.cxx 
b/connectivity/source/drivers/jdbc/Reader.cxx
index 4e96bfa..be0fc05 100644
--- a/connectivity/source/drivers/jdbc/Reader.cxx
+++ b/connectivity/source/drivers/jdbc/Reader.cxx
@@ -124,7 +124,7 @@ sal_Int32 SAL_CALL java_io_Reader::readBytes( 
::com::sun::star::uno::Sequence< s
 }
 
 if(nBytesToRead == 0)
-return 0;
+return nBytesWritten;
 
 sal_Int32 nCharsToRead = (nBytesToRead + 1)/2;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   3   4   5   6   7   8   9   10   >