Commit Graph

261 Commits

Author SHA1 Message Date
Noel Grandin
e9beb26470 convert SBI_ constants to enum class
Change-Id: I65e706f4e1adfe242808293d9514c9db8d22cc12
2015-03-02 08:59:18 +02:00
Noel Grandin
2f928b2d09 remove NUMBERFORMAT_ constants
.. in favour of just using the underlying constants from
css::util::NumberFormat

Change-Id: I0c6b128b66c91b268f5ae300f9c17c7792df5e99
2015-02-25 10:34:27 +02:00
Tor Lillqvist
b5938bf4b3 WaE: rewrite call of rtl::OUString::operator= ...
... with empty string constant argument as call of rtl::OUString::clear
[loplugin:stringconstant].

Actually, no need to clear the string here as it already is empty, surely?

Change-Id: Ib4b1a6e1b0c0f59c1c964fe58d26058b492c3821
2015-01-24 08:10:50 +02:00
Julien Nabet
b7d02d7a5a Resolves fdo#87834: strange behavior of mid()-function
See https://bugs.freedesktop.org/show_bug.cgi?id=87834
Thank you Michael Büssow for pointing these cases

Change-Id: I3a9b58360ddab529d1fb2f7eeba7f1c7ae69ba7c
Reviewed-on: https://gerrit.libreoffice.org/13707
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-01-23 20:32:52 +00:00
Noel Grandin
c32a5a3b8e simplify Date/Time/DateTime conversion code
add constructors to Date/DateTime/Time,
that take the css::util counterparts,
to simplify code converting between these type

Change-Id: I4b03da02c63f65b6ec18cb4d6ecc3859bdef1ff7
Reviewed-on: https://gerrit.libreoffice.org/13855
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
2015-01-13 15:24:04 +00:00
Tsutomu Uchino
bf964151a7 Related: #i94895# revert the part of revision 1650261
replaced string should be starting with the start postion if specified

(cherry picked from commit 68c6265584fb6cb0469098507dd287e6e1127324)

Conflicts:
	basic/source/runtime/methods.cxx

Change-Id: Ib729facfa78ffddebc258440324f05d037fae46f
2015-01-11 20:45:28 +00:00
Caolán McNamara
476f75802a Resolves: #i94895# fix illegal result of Replace runtime function"
and adjust the basic test-case, which is surely wrong

The syntax for REPLACE is:

// Replace(expression, find, replace[, start[, count[, compare]]])

surely in the case of a start of 3 the preceeding chars should
be returned unchanged in the result, not stripped off as before
this change.

This reverts commit 869402a587.

Change-Id: Ie710e4de9e7e35c84abe2770142a963532820af4
2015-01-09 12:05:37 +00:00
Caolán McNamara
869402a587 Revert "Resolves: #i94895# fix illegal result of Replace runtime function"
This reverts commit 340ca294d4 as CppunitTest_basic_vba
breaks, so needs revisiting to see which is right

Change-Id: I10168d454a8c67d91eee5bb8939aff74bba42954
2015-01-08 20:35:35 +00:00
Tsutomu Uchino
340ca294d4 Resolves: #i94895# fix illegal result of Replace runtime function
(cherry picked from commit a2700f75af61837033ff213607445cc1f74b36d6)

Conflicts:
	basic/source/runtime/methods.cxx

Change-Id: If9c671a612de87d8d37bfc40704a97a6062fd150
2015-01-08 16:51:10 +00:00
Noel Grandin
7f8f277b94 fdo#84938: convert STREAM_ #defines to 'enum class'
Change-Id: Ibbf14c7e9a5c1883c1311d4c86f948f74f8e473e
2015-01-07 11:20:44 +02:00
Stephan Bergmann
39ddeb53c0 basic: Use appropriate OUString functions on string constants
Change-Id: I43f99ba6759b0f8f633af784beaec583dbab0b9e
2014-12-18 14:12:23 +01:00
Caolán McNamara
ecc56da366 busted loop condition
regression from

commit 119873328a
Date:   Thu Oct 21 15:34:02 2010 -0500
    convert vos/process.hxx and related API

Change-Id: I36527a4f0109105b9853a79773b4c92f9bc4e902
2014-11-21 11:55:11 +00:00
Caolán McNamara
ef076fa1c1 coverity#1255390 Resource leak
Change-Id: I3631d6bbcf45986deb1e911fcdb0e6606a0c6d91
2014-11-21 11:55:10 +00:00
Caolán McNamara
12bcfec04f markup with event type not checker type
Change-Id: I14c0c5d90b67000cb4fe9e6be647854abfe784da
2014-11-05 14:58:00 +00:00
Caolán McNamara
cb0e009a9e document array_vs_singleton dismissals
Change-Id: I8d7eb4c01197e885abca717c7814c61a7641ac9d
2014-10-30 10:10:09 +00:00
Tor Lillqvist
9ecac3874d Replace DISABLE_SCRIPTING with HAVE_FEATURE_SCRIPTING
Feature test macros that govern conditional compilation should be
defined in config_*.h include files, not on the compilation command
line.

Change-Id: I40575a4762fd2564f10927b6f38a112dd9f9a3d7
2014-10-22 09:30:23 +03:00
Caolán McNamara
8f436d3de7 use comphelper::rng::uniform_*_distribution everywhere
and automatically seed from time on first use

coverity#1242393 Don't call rand
coverity#1242404 Don't call rand
coverity#1242410 Don't call rand and additionally allow 0xFF as a value
coverity#1242409 Don't call rand
coverity#1242399 Don't call rand
coverity#1242372 Don't call rand
coverity#1242377 Don't call rand
coverity#1242378 Don't call rand
coverity#1242379 Don't call rand
coverity#1242382 Don't call rand
coverity#1242383 Don't call rand
coverity#1242402 Don't call rand
coverity#1242397 Don't call rand
coverity#1242390 Don't call rand
coverity#1242389 Don't call rand
coverity#1242388 Don't call rand
coverity#1242386 Don't call rand
coverity#1242384 Don't call rand
coverity#1242394 Don't call rand

Change-Id: I241feab9cb370e091fd6ccaba2af941eb95bc7cf
2014-10-06 14:13:27 +01:00
Noel Grandin
fa537124ac loplugin: cstylecast
Change-Id: Ie3d13eccdf444d569cbe40befb45eb86941160b6
2014-10-01 13:08:41 +02:00
Noel Grandin
fc04f76336 fdo#82577: Handle Time
Put the TOOLS Time class in the tools namespace. Avoids clash with the X11
Time typedef.

Change-Id: Iac57d5aef35e81ace1ee0d5e6d76cb278f8ad866
Reviewed-on: https://gerrit.libreoffice.org/11684
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-01 07:34:23 +00:00
Noel Grandin
827c46e7d7 fdo#82577: Handle Window
Put the VCL Window class in the vcl namespace. Avoids clash with the X11
Window typedef.

Change-Id: Ib1beb7ab4ad75562a42aeb252732a073d25eff1a
2014-09-23 14:11:39 +03:00
Noel Grandin
37b9ea92ba convert SBX flag bits to type-safe enum
Change-Id: I18d5d6a27f06ee60a5cb3dc393bf05b51bba4817
Reviewed-on: https://gerrit.libreoffice.org/11070
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-08-26 04:30:03 -05:00
Noel Grandin
dac4ca5f68 new loplugin: externalandnotdefined
Find "missing headers," where a function is declared directly in the
.cxx (as extern) and not defined, and should arguably instead be declared
in an include file.

Change-Id: I6d83ee432b2ab0cd050aec2b27c3658d32ac02a2
2014-07-11 14:12:25 +02:00
Stephan Bergmann
e48a233960 loplugin:unreffun: also warn about redundant redeclarations
Change-Id: I9a812220b58cf6da00d854e65794f7c673ab239d
2014-06-27 15:27:39 +02:00
Stephan Bergmann
f8ef1fe95b loplugin:staticcall
Change-Id: I6cd46964c523c9393e9d249fdb43aaa38679fa06
2014-06-13 17:54:23 +02:00
Takeshi Abe
a71ae24a23 Avoid possible memory leaks in case of exceptions
Change-Id: Iac63a5d60478e5cd8e2b77c889c7b312d3d15f67
2014-05-29 09:29:15 +09:00
Thomas Arnhold
df466d79cb fdo#70474: Random number generation weak with Rnd in BASIC
Just reuse the rng functionality. This improves the randomness.

Initialize seed with system time if no argument for RANDOMIZE is given. As the help text
states: "If Number is omitted, the generator uses the current value of the system timer".

Change-Id: I5fa46e8344b2402dff66a8db2449d43e2ca27d6d
Reviewed-on: https://gerrit.libreoffice.org/9349
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-05-17 12:40:58 +00:00
Julien Nabet
68741d0055 Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part13
Change-Id: Ieecfd7ccb10c75ac639d0ba8e7cb588607097c2a
2014-05-15 22:52:22 +02:00
Thomas Arnhold
4aa690c2e4 basic: use prewin.h
Change-Id: I49b797b170b3fd74324eede9d3b6b6ec106e62e4
2014-05-14 17:57:32 +02:00
Noel Grandin
1eee88dd6b basic: sal_Bool->bool
Change-Id: I1c084ca86c0b1308eb2fc1451ba34d2e702c6a7f
2014-04-07 13:53:50 +02:00
Valentin Kettner
061130bd6d fdo#75280 Started cleaning up of sal_uIntPtr usage.
Converted wrong usage of sal_uIntPtr to appropriate other types in basic
module.

The bug is not fully fixed with this since many other occurences of sal_uIntPtr remain.

Update due to code review comments:
Fixed forgetting to change some declarations in iosys.cxx.
Cleaned up the one remaining sal_uIntPtr in iosys.cxx
Fixed adding a sal_uInt64 to a Date (uses long now instead) in methods.cxx
Fixed the VarDecFromUI4 call in sbxdec.cxx from sal_uLong to ULONG .

Conflicts:
	basic/source/runtime/iosys.cxx

Change-Id: Ia6460be04967deb68b92eb62d945da8814fae605
2014-03-28 20:08:46 +01:00
Takeshi Abe
dd52330db6 Avoid possible resource leaks by boost::scoped_array
Change-Id: I14e1f7ef217eb5e8e9db9f8962af868ab0a4ab81
2014-03-25 20:08:26 +09:00
Noel Grandin
39c7532933 basic: prefer passing OUString and OString by reference
Change-Id: I8121204cdb37d4e1d8967397f3e45bdab6aaddad
2014-03-13 08:39:26 +02:00
Alexander Wilms
6a38eace8c Remove visual noise from basic
Change-Id: I10865b94f67de39e9dbcbe71ede42aa94d81db61
Reviewed-on: https://gerrit.libreoffice.org/8234
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-25 21:09:17 +00:00
Norbert Thiebaud
295bc8703f basic: remove use of sal_uIntptr in favor of more appropriate type
Change-Id: Ie878f43c7245838519fe7477b039827b079dde63
Reviewed-on: https://gerrit.libreoffice.org/8214
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2014-02-25 00:26:43 +00:00
Alexander Wilms
0ce0c369aa Remove unneccessary comments
Change-Id: I939160ae72fecbe3d4a60ce755730bd4c38497fb
Reviewed-on: https://gerrit.libreoffice.org/8182
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-02-23 03:38:49 +00:00
Noel Grandin
15535e32dd convert SvStream::operator>> methods to ReadXXX methods
First, I updated the clang rewriter to do the conversion.
Then I lightly hand-tweaked the output for the few places where
the rewriter messed up, mostly when dealing with calls on "this".

Change-Id: I40a6a977959cd97415c678eafc8507de8aa3b1a9
Reviewed-on: https://gerrit.libreoffice.org/7879
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-02-12 15:31:40 +00:00
Stephan Bergmann
f96f38f8f8 bool improvements
Change-Id: I571354540f1ab108c55d32c20786d34a799c3bed
2014-01-28 20:26:30 +01:00
Julien Nabet
ff48f28f71 Resolves: fdo#73771 Non-standard behaviour for Function Mid
Change-Id: I90be516235228574dc219447a0eef3a34f83bee2
Reviewed-on: https://gerrit.libreoffice.org/7539
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-01-21 15:50:51 +00:00
Noel Grandin
c648d08720 convert SvStream::operator<< overloads to more explicit methods
This is in preparation for more conversion of SvStream::operator<< calls
to use more explicit method names.
This converts the subclasses that have their own convenience overloads
of operator<< to use normal methods.

Change-Id: I5efd5d9a24c264cb86d2471303dd5849bf91ba80
2014-01-16 16:08:34 +01:00
Stephan Bergmann
0d29aab156 bool improvements
Change-Id: Ic9ea40c430e0b0ab0d46bac3ba150ddac96c6acc
2014-01-14 18:11:10 +01:00
Tor Lillqvist
d76178b52d sbstdobj.hxx is private to basic
Change-Id: I131dfeded783edfea94208d1cf8d70a2090785fa
2013-12-11 10:48:12 +02:00
Tor Lillqvist
0a33e24d11 sbobjmod.hxx is private to basic
Change-Id: I4ad28b049de5f7268ee1ca2e8992e2f29ed05380
2013-12-11 10:39:57 +02:00
Herbert Dürr
3a437baee2 Resolves: #i74854# fix buttons in MsgBox with info icon
Patch by: hanya.runo@gmail.com
Found by: ooo@catcons.co.uk
Tested by: hdu@apache.org

(cherry picked from commit 02cc651a1b45cbfbdab0aca6b57bff7bdf9e4f2c)

Conflicts:
	basic/source/runtime/methods.cxx
	vcl/inc/vcl/msgbox.hxx

Change-Id: I1656263e189f1a6cfa58436741bfa74ae0e6fffa
2013-12-02 16:45:50 +00:00
Noel Grandin
e9c4ee996d remove unnecessary use of OUString constructor in BASIC module
Change-Id: Iee86ce9200285647d5031cb2f89266a52704dd44
2013-11-11 11:21:25 +02:00
Tor Lillqvist
a7724966ab Bin comments that claim to say why some header is included
They are practically always useless, often misleading or obsolete.

Change-Id: I2d32182a31349c9fb3b982498fd22d93e84c0c0c
2013-10-22 16:56:28 +03:00
Tor Lillqvist
b680e35254 Test WNT instead of the vague UNX
Change-Id: Icacdae592f05bcdcf50223d607976d687e182c96
2013-10-12 09:55:48 +03:00
Caolán McNamara
d22fb8a608 CID#1103740 uninitialized value
Change-Id: I2d10104277d8ad0781e3dd088d51d62fa759fe57
2013-10-11 09:12:38 +01:00
Noel Grandin
41dec09ed3 convert BASIC from String to OUString
Change-Id: I4b046e4c460305acad29862341092af948639215
2013-09-17 09:05:52 +02:00
Lionel Elie Mamane
b31f33bcc1 Easier conversion between Basic Date and UNO Date/Time
Utility functions to convert between Basic Date type
and the representations of Date and Time in UNO, namely:
 - com.sun.star.util.Date
 - com.sun.star.util.Time
 - com.sun.star.util.DateTime

Name of new functions:
 - CDateToUnoDate
 - CDateFromUnoDate
 - CDateToUnoTime
 - CDateFromUnoTime
 - CDateToUnoDateTime
 - CDateFromUnoDateTime

Change-Id: I2b971df20df1c0351d071023e042169b548894f1
Reviewed-on: https://gerrit.libreoffice.org/5897
Reviewed-by: Noel Power <noel.power@suse.com>
Tested-by: Noel Power <noel.power@suse.com>
2013-09-11 20:40:19 +00:00
Luboš Luňák
64b993e046 finish deprecation of O(U)String::valueOf()
Compiler plugin to replace with matching number(), boolean() or OUString ctor,
ran it, few manual tweaks, mark as really deprecated.

Change-Id: I4a79bdbcf4c460d21e73b635d2bd3725c22876b2
2013-08-21 15:10:35 +02:00