Commit Graph

1203 Commits

Author SHA1 Message Date
2bd856e643 ORowSetValue: clean up sign/unsigned union member
Also switch BOOLEAN constructor from sal_Bool to bool.

old/new signed/unsigned storage situation:

-------------------------------------------------------
 SQL type | signed    | unsigned old     | unsigned new
-------------------------------------------------------
 TINYINT  | sal_Int8  | sal_Int16        | sal_uInt8
 SMALLINT | sal_Int16 | sal_Int32        | sal_uInt16
 INTEGER  | sal_Int32 | sal_Int64        | sal_uInt32
 BIGINT   | sal_Int64 | pValue (String*) | sal_uInt64
-------------------------------------------------------

When sticking an UNSIGNED TINYINT into an Any,
silently promote it to UNSIGNED SMALLINT (that is sal_uInt16),
else Any would take it as a sal_Bool and normalise to
sal_True (1) or sal_False (0).

When constructing an ORowSetValue from a sal_Bool,
silently keep it as an unsigned 8 bit integer
(that is understand it as a sal_uInt8).
This will work in most cases,
since when asked back for a bool or sal_Bool,
we'll give back the right value.
Only code looking at the type tag could possibly
make a "wrong" decision.
The main (hopefully only?) path
through which this would happen is
through an implementation of
  XParameters::setBoolean
  XRowUpdate::updateBoolean
that would use its sal_Bool argument
to construct an ORowSetValue.
So make sure each implementation
constructs a proper BOOLEAN so as not to get confused.

For authorship/copyright purposes, this patch is a cooperation between
 Lionel Elie Mamane <lionel@mamane.lu>
and
 David Ostrovsky <david@ostrovsky.org>

Change-Id: I3f1f08716127147f077bff4edb6ec558b1b09e09
2013-02-05 15:46:17 +01:00
614e31aa24 fdo#46808, Adapt sdb::TableDefinition UNO service to new style
The service already existed, it just did not have an IDL file

Change-Id: Iaac84da8baa3a060eef339d8e477f86ca49fae08
2013-01-28 08:23:11 +02:00
1cf1f9338c fdo#57950: dbaccess: STRINGPARAM and more chained appends
Change-Id: Iab1ba5eb6702d386e2775d7426c3398b606d2d97
Reviewed-on: https://gerrit.libreoffice.org/1706
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Tested-by: Luboš Luňák <l.lunak@suse.cz>
2013-01-16 19:00:12 +00:00
36e1e0ce12 fdo#57950: Remove some chained appends in dbaccess
Also simplify logic a little bit.

Change-Id: I342f8d1d22e70023d23c6c8ca3976d501e18fb90
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/1559
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Tested-by: Luboš Luňák <l.lunak@suse.cz>
2013-01-07 13:53:20 +00:00
2b0b5f7df0 fdo#57950: More fixes for chained appends in dbaccess
And also:
	Remove some RTL_* macros
	Remove ::rtl prefix

Change-Id: I9c3902672518559e8a139c37bc1933843bebfe5d
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/1561
Reviewed-by: Luboš Luňák <l.lunak@suse.cz>
Tested-by: Luboš Luňák <l.lunak@suse.cz>
2013-01-07 13:50:36 +00:00
2e22005234 fdo#57950: Remove some chained appends and more in dbaccess
- Sanitized some OUStringBuilder, avoiding creating a new one and after
	make some appends
 - Removed some ::rtl prefixes
 - Remove RTL_* macro

Change-Id: Ide3d78f20c68774cd4864b82cb8d29784228d1cd
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/1552
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
2013-01-07 09:36:27 +00:00
b9a4a0b965 fdo#46808, Convert connectivity::SQLError to use XComponentContext...
...instead of comphelper::ComponentContext.

Change-Id: I40384c2d7cfcabd06506321d686dd8e7c7c5f266
2012-12-10 08:05:49 +02:00
dbafb1663e Don't force refresh when higher up code did not request it
Change-Id: I0f415c96fc05c1d776d14885751aef020c42f4ae
2012-12-06 19:39:08 +01:00
bd60c90f85 fdo#53281 Don't cache whole row in KeySet
This was done for the sake of ODBC,
but the cost was imposed on all backends.

The ODBC problems are now solved cleanly (and more efficiently)
in the SDBC<->ODBC layer.

Change-Id: Ib8a864da08deaaacc96a379fb72b3b7cbb34598c
2012-12-06 19:38:28 +01:00
773ad75b0d fdo#46808, Adapt util::NumberFormatsSupplier UNO service to new style
Change-Id: I58436d9eea0c38d14cde2dc01aa463d5d71912e9
2012-12-06 13:20:31 +02:00
38cc919efb fdo#46808, use service constructor for sdbc::ConnectionPool
Change-Id: Id12226af5e537b1eeacbb062ad937a3551e245c0
2012-11-28 13:06:18 +01:00
91fff62c87 Typo in comment
Change-Id: I63e866d5ad6ae76c8e19d04f3be1476f82966e31
2012-11-26 06:56:58 +01:00
af60316514 some i18n wrappers with LanguageTag
Change-Id: I2ceaa3159e8669c2c569fa8559c1e061dcad399d
2012-11-23 23:09:16 +01:00
0666e43c45 fdo#46808, use service constructor for i18n::CharacterClassification
Change-Id: I0499ad7de27b1539e97f01ab8aa0ef2d6713ae76
2012-11-05 18:05:00 +01:00
25a868011c include stl headers for used features
Change-Id: I6b0d3b3feea88b6e3605f751df9e1154e4231127
2012-11-02 12:21:47 +01:00
10359585eb Columns should know their table
For example dbaccess::OSingleSelectQueryComposer::appendOrderByColumn expects it
(via impl_getColumnName_throw via getTableAlias)

There is some vagueness:
Should the TableName property contain just the table name,
or the *composed* table name
(that is with catalog and/or schema if used by this DB)?
In the case of a query, should it contain the table name (alias)
*in* *the* *query* or of the original table?
In the former case, what meaning do SchemaName and CatalogName have?
They should be empty?

For now, commit as such and deal with the fallout, if any,
when it hits the fan.

If we really need to store these *different* values,
(that is, some code validly needs them)
it would be easier / cleaner / ...
to define *different* properties
for these *different* notions.

Change-Id: I032e619a60e7563cd51478db16cb5e0e5452bfde
2012-11-02 10:54:12 +01:00
76dd7fc60b Don't abort when column has no (Catalog|Schema|Table)Name
Especially since the rest of the function is prepared to handle
no/empty (Catalog|Schema|Table)Name.

Change-Id: Ic0bb59ead5789e671c90887ef850588f4924f5e7
2012-11-02 10:50:55 +01:00
806d18ae7b optimisation: take ref to OUString instead of constructing temp object
Change-Id: I9dcb821cd71f89fa5b3d8274fd93facc1f43863f
2012-11-02 10:50:52 +01:00
9e716494a8 fix some VS 2010 specific issues
Change-Id: Iae27a96c1e2ed72d2744fcbe100d6ada7dc41c82
Reviewed-on: https://gerrit.libreoffice.org/914
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2012-10-28 18:09:02 +00:00
f7a24eff2d mark lcl_ functions static or rename them if they are not local at all
http://lists.freedesktop.org/archives/libreoffice/2012-October/039639.html

Change-Id: I231f0b367bf0b513c6c1ce4c4cfdb7c3dc8660d5
2012-10-12 13:34:47 +02:00
df706c23dc missing system header
Change-Id: Ieb97d877238941d06aab1aa2ef67186bbc3a995a
2012-10-01 16:11:38 -05:00
afb28ae04a missing system header
Change-Id: Icba29c0ebfd30af36b18eb59a23643287985f8c8
2012-10-01 16:08:10 -05:00
36a2db3722 Replace usage of rtl_*Memory with equivalent from string.h
Change-Id: I50ffc10f007f03c3252ef0196b59b881429cc159
Reviewed-on: https://gerrit.libreoffice.org/734
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2012-10-01 18:48:05 +00:00
286a7733ac re-base on ALv2 code. 2012-09-29 15:07:42 +01:00
a00c4e02ac Improvements on previous commit
* Made XDatabaseContext inherit XDatabaseRegistrations non-optionally, adapted
  call-sites to just use XDatabaseContext w/o querying.  (The previous commit
  had inadvertantly effectively removed support for XDatabaseRegistrations from
  the ODatabaseContext implementation, as an optional UNO super-interface does
  not lead to a super-class in the corresponding C++ class hierarchy, but making
  the super-interface non-optional fixes that anyway.)

* Adapted some more call-sites to just use XDatabaseContext w/o querying.

* Added @since tag.

* Replaced new uses of comphelper::ComponentContext::getUNOContext with
  comphelper::getComponentContext (see 03a9f139bd9ea1a4f9096fc982e6b326def58532
  "ComponentContext::getUnoContext -> getComponentContext simplification;" I
  intend to get rid of comphelper/componentcontext.hxx much sooner than of
  comphelper/processfactory.hxx).

Change-Id: I68d09f2dbe651629f79ed21cd40cdb6d6b32c624
2012-09-27 15:03:32 +02:00
9c00e38b43 fdo#46808, Adapt sdb::DatabaseContext UNO service to new style
Create a merged XDatabaseContext interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.

Quite a few IDL files had to be marked as published for this to work.

Change-Id: Ie9a0da88d8c33cc83fc9d2334ff83ab2744c222f
2012-09-27 15:03:32 +02:00
750fc20611 replace remaining InterlockedCount() with inlined version
Change-Id: Ifcfa48fc87f905a91470a5b0fd597b02f220784c
Reviewed-on: https://gerrit.libreoffice.org/671
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2012-09-25 01:55:38 +00:00
369e3fdcda fdo#46808, Adapt i18n::LocaleData UNO service to new style
The implementation of the LocaleData implements the optional XLocaleData4,
so rather than creating a new interface for the new-style service, we simply
make the service implement XLocaleData4, which in turn implements
XLocaleData3, XLocaleData2, XLocaleData.

Change-Id: I3e9a48b031be6b2aa5e04b376b3940b942add85a
2012-09-17 14:28:21 +02:00
522b4c65dc fdo#37529 clear DataColumns read-only information when we clear DataColumns
Change-Id: I6f3b4f1646df1244d97ae98f56ba054bc26e3314
2012-09-13 16:33:30 +02:00
3a36408b73 fdo#46808, Adapt util::NumberFormatter UNO service to new style
Create a merged XNumberFormatter2 interface for this service to implement.
Which is backwards-compatible, but does not require creating a new service.

Change-Id: I57f35cde0a9dbbe91c1d2c3d068cb3a97c7245e3
2012-09-03 15:55:06 +02:00
cdadb1b4fb fdo#53557: use metadata's idea of column count to allocate a row
m_pColumnNames contains only the columns that come straight from a table, not calculated columns

Change-Id: I2706790e8c1447d1c4e144bbdef773deeca3e2e8
2012-08-31 18:18:03 +02:00
4a69252e2c -Werror,-Wunused-private-field (Clang towards 3.2)
Change-Id: I55ad905bef36b54fadc245bfb22f687e47d20c3a
2012-08-31 09:04:17 +02:00
3655f25465 fdo#48807 autofilter should not use LIKE operator
This demonstrates a confusion between *values* and *patterns*

Change-Id: I207aa53950166e915bbad22b022c88d07ee6300d
2012-08-30 05:23:06 +02:00
8638f1e72a fdo#46808, Adapt script::Converter service code to new style
Change-Id: I19b3ba7c978e02ce865360f0411007525012149c
2012-08-27 15:40:07 +02:00
7f424c4076 m_nEndPos==m_nStartPos is OK: empty window (for example, empty table)
Change-Id: I5525eb750dfbed282fea272de4a736e6c70e51a9
2012-08-21 19:30:14 +02:00
ed93117447 fdo#53061: Fix for C++11 #define NULL nullptr
Change-Id: Ia1805aab4bec7fef02c96ec4e7a7a0ed9991d3c3
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2012-08-14 10:39:13 +02:00
5b85f6c1ef nPos is 1-based, so allowed to be equal to row count
Change-Id: Idb37cd23a58816bd16c725fda49a2f9875450e79
2012-08-02 12:07:45 +02:00
1e89c6f3d1 fdo#51239 refresh row lazily (when data is requested)
This avoids fetching data that will not be requested when the "cursor" is only moved and no data requested. That is typically what RowSetCache does when its own cursor is moved within its window.

This basically makes the whole {next,previous,absolute,...}_checked story obsolete, by basically always being as fast as the i_bFetchRow==false case, but in a safer way.

Change-Id: I89eaf277069736b3077bde8b45325929db290f2d
2012-07-17 09:19:45 +02:00
607e4857bf debug unexpected exception
Change-Id: I404072caf6ddab0ed833586066507c7d332fcea4
2012-07-12 23:39:07 +02:00
eecb5ac9a4 removed useless forward declarations of class
Change-Id: I13cf52cc4e1cf8d5e2453d7ac4b68cc8c64cd011
2012-07-05 19:08:02 +09:00
278000a28b Remove unused defines
Some of them were commented out for documentation purpose.

Change-Id: I29a6b2cbe774b527f0c3a0be5675160817a7f3ce
2012-07-02 17:46:25 +02:00
57154616f0 Remove UNO includes comments
Change-Id: I48e193322967fb75e93eaf81e9e2110d3056f92a
2012-06-29 09:25:09 +02:00
ec5fa0164b replace all but one .hdl include with equivalent .hpp includes.
Change-Id: I15e94f112144549692d0c2babeb48c77adcb93a9
2012-06-21 19:28:47 +01:00
54e9a28390 typo: paramters, paramaters -> parameters
Change-Id: If58683331c50f2a95204e8e2dea11edbef3ccb63
2012-06-19 16:44:08 +02:00
577cf8ff67 re-base on ALv2 code. 2012-06-14 17:41:07 +01:00
2106d8e648 callcatcher: update unused code
Change-Id: Id5f730fc447b11000b266954f9e7f5287bad02f4
2012-06-11 14:46:45 +01:00
3770bbbdba Remove superfluous empty lines on top
More than two lines are removed for readability.

Change-Id: Ibff6cf68d7c512e240a54065b54a225bb23a782b
2012-06-09 04:57:58 +02:00
a519cacd61 -Werror,-Wself-assign (Clang)
Change-Id: I92f1271ad36e4ae1221182a3a446f36cf770e003
2012-06-06 14:07:37 +02:00
43f9468d35 bCheck is guaranteed by the for loop condition
Change-Id: Ia54eaa5cb1aa8bb4a052cea25396b07f048ff74c
2012-06-04 23:43:41 +02:00
1ca20c89c0 KeySet.cxx: fix boost include; also...
... BOOST_STATIC_ASSERT_MSG was added in boost 1.46, while the internal
boost is still at version 1.44, so use BOOST_STATIC_ASSERT instead.

Change-Id: I14f8e48e31956b34a1a907cd2c4e454a5715889b
2012-06-04 20:07:26 +02:00