Commit Graph
96 Commits
Author SHA1 Message Date
Stephan Bergmann 635d4b0eb8 Clarify some INetURLObject::setExtension behavior
Change-Id: I1a9e7233b2861a3d09661a08c07d2043c9c0c3c1
2017-01-24 10:07:31 +01:00
Miklos Vajna a0ab0c79fd CppunitTest_tools_test: fix loplugin:cppunitassertequals warnings
Change-Id: I6738b6b5159403f1654b401a27f08fc829521e73
2016-12-09 12:07:19 +01:00
Noel Grandin 50151db9f7 convert FSysStyle to o3tl::typed_flags
Change-Id: I58a63a0e6f619442f21827064644ecd8ca57b8ff
2016-12-05 12:49:02 +02:00
Noel Grandin bfde4866e0 convert DecodeMechanism to scoped enum
Change-Id: I5c56634b1bca8e37fa73d02d2428645301b6c547
2016-12-05 12:49:02 +02:00
Stephan Bergmann 613213240a clang-cl loplugin: tools
Change-Id: I6f02d9607405e144727f925c8f8a1de6041688b9
Reviewed-on: https://gerrit.libreoffice.org/29844
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-10-15 07:59:10 +00:00
Michael Stahl b647996a9b replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)
... except in include/rtl, include/sal, include/uno, where sal_Size is
retained for compatibility, and where callers of rtl functions pass in
pointers that are incompatible on MSVC.

Change-Id: I8344453780689f5120ba0870e44965b6d292450c
2016-09-15 12:01:11 +02:00
Eike Rathke 6d4f2dcc7c Resolves: tdf#100452 class Date full (BCE,CE) proleptic Gregorian calendar
... implementing signed years with year 0 gap.
Date(31,12,-1) last day BCE
Date(1,1,1) first day CE

New class Date member functions:
* AddYears(sal_Int16) to be used instead of
  aDate.SetYear(aDate.GetYear()+sal_Int16) to handle year 0 gap.
* convenience GetNextYear() to be used insted of GetYear()+1
* convenience GetPrevYear() to be used insted of GetYear()-1
* AddMonths(sal_Int32)
* operator=(const css::util::Date&)

New class DateTime member functions:
* operator=(const css::util::DateTime&)

Made some conversion ctors explicit, specifically Date(sal_Int32)

Adapted hopefully all places that used a sal_uInt16 year to use
sal_Int16 where appropriate.

Eliminated some quirks in date handling found on the fly.

Added era handling to i18npool icu calendar setting interface, which
missing was responsible for 0001-01-01 entered in Calc being set as
-0001-01-01, hence subtracting one day resulted in -0002-12-31.

Change-Id: I77b39fba9599ebd5067d7864f6c9ebe01f6f578f
Reviewed-on: https://gerrit.libreoffice.org/27049
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-08 20:41:02 +00:00
Michael Stahl 62d270116b tools: rename SvStream::Read/Write to ReadBytes/WriteBytes
Change-Id: Ib788a30d413436aa03f813aa2fddcbc4d6cd2f9a
Reviewed-on: https://gerrit.libreoffice.org/25972
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-06-06 18:09:11 +00:00
Chirag Manwani cc84aaf70a tdf#97703 removed empty setUp/tearDown methods
Change-Id: I244d481bce4723d172e26c0d31aab0a541334604
Reviewed-on: https://gerrit.libreoffice.org/22959
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-03-07 09:13:53 +00:00
Noel Grandin 2087484c65 use consistent #define checks for the Windows platform
stage 2 of replacing usage of various checks for the windows platform
with the compiler-defined '_WIN32' macro

In this stage we focus on replacing usage of the WIN macro

Change-Id: Ie8a4a63198a6de96bd158ecd707dadafb9c8ea84
Reviewed-on: https://gerrit.libreoffice.org/22393
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-17 11:33:57 +00:00
Noel Grandin ce43d0ae92 use consistent #define checks for the Windows platform
stage 1 of replacing usage of various checks for the windows platform
with the compiler-defined '_WIN32' macro

Change-Id: Iece73abdee530937e0737190b1aa97a46cd3075f
Reviewed-on: https://gerrit.libreoffice.org/22390
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-02-16 10:37:55 +00:00
Chris Sherlock a238b1f8d3 Remove excess newlines
A ridiculously fast way of doing this is:

for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \
  --exclude-dir=workdir --exclude-dir=instdir '^
{3,}' .)
do
    perl -0777 -i -pe 's/^
{3,}/

/gm' $i
done

Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c
Reviewed-on: https://gerrit.libreoffice.org/22224
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09 08:18:05 +00:00
Noel Grandin b14224fe97 loplugin:unusedmethods
using an idea from dtardon:

<dtardon> noelgrandin, hi. could you try to run the unusedmethods clang
plugin with "make build-nocheck"? that would catch functions that are
only used in tests. e.g., i just removed the whole o3tl::range class,
which has not been used in many years, but htere was a test for it...
<noelgrandin> dtardon, interesting idea! Sure, I can do that.

Change-Id: I5653953a426a2186a1e43017212d87ffce520387
Reviewed-on: https://gerrit.libreoffice.org/22041
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-08 06:08:14 +00:00
Stephan Bergmann 1c4f33b5d8 loplugin:nullptr (automatic rewrite)
Change-Id: Ia5acfb564f913d52cd25b5d64d06b5280b94cb72
2015-11-10 10:31:54 +01:00
Stephan Bergmann e01e03ae6d loplugin:stringconstant: elide explicit ctor usage (automatic rewrite)
Change-Id: I88a3396746bf12c08265600072a368c9bbf5744e
2015-11-06 09:38:10 +01:00
Matteo Casalin 7e89e28274 sal_uIntPtr to sal_uInt64, sal_uLong to sal_Size for streams
Change-Id: I062f1f6c5b20ca47734a9a3cd1a229d51763a206
2015-10-27 13:59:09 +01:00
Stephan Bergmann b36963c0a6 Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY code
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-10-12 17:52:29 +02:00
Giuseppe Castagno 8ea85c264f Add isSchemeEqualTo(), isAnyKnownWebDAVScheme() to INetURLObject
...which will be used when rebasing
    <https://gerrit.libreoffice.org/#/c/17189>
"tdf#82744: fix WebDAV lock/unlock behaviour - part 3" on top of
 d3de490437
 "Add vnd.sun.star.webdavs URL scheme."

Change-Id: I19bd715d755a6f070b95ce897d8a1bbb4910d537
Reviewed-on: https://gerrit.libreoffice.org/18151
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2015-10-05 11:11:24 +00:00
Stephan Bergmann 984780243c HEADER_FIELD_TEXT is the only used HeaderFieldType
Change-Id: Ia4e5554e1aaed9e821bdea18b9b3acff001dd6e7
2015-09-17 22:19:23 +02:00
Tomaž Vajngerl 36d0f7795c disable an assert in color tests due to rounding error
Change-Id: I829cb4dd2d256a621a407b7715ffc12e90a939b6
2015-09-03 12:20:00 +09:00
Tomaž Vajngerl 1249262e97 Change color test to report expected values when assert fails
Change-Id: I8383dd317a4f8af5f057d81d8e90172b1f78edde
2015-09-03 09:38:51 +09:00
Tomaž Vajngerl eb2e1ab465 Report reference color and expected color if test fails
Change-Id: I7c8110b31171b247bcd46cee02f41972f59cbdcc
2015-09-03 08:50:52 +09:00
Noel Grandin 43691a15b3 tdf#93794 - spin buttons not rendered in gtk2/gtk3
for penance, introduce a unit test

Change-Id: I2c40285732be665e179c477e6e7603aa6f8be5d7
2015-08-31 13:59:55 +02:00
Stephan Bergmann cce0620a06 loplugin:passstuffbyref
Change-Id: I0244f12f1ee2e61ac577222a14b011aee5ddbd54
2015-08-27 08:01:52 +02:00
Tomaž Vajngerl a0ab7c31a2 Again add ability to change tint/shade of a color + unit test
Change-Id: I4c06290f09e5bfecd2c1de896e19cb5036a3a0e9
2015-08-27 08:30:49 +09:00
Tomaž Vajngerl 9125549453 add some unit tests for tools::Rectangle
Change-Id: Ic0323864455c248c926e69a0bb91d13adc963eca
2015-07-09 10:09:16 +09:00
Noel Grandin d3d4b86919 loplugin:unusedmethods tools
Change-Id: I45f5489233879126d4f9ee3d01db504d950bb597
Reviewed-on: https://gerrit.libreoffice.org/16656
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-02 06:37:53 +00:00
Tomaž Vajngerl c89e590fb0 extend color test - check read & write from stream
Change-Id: Iac3c8d30acff0984a98a4b705957c0361a5ead2f
2015-05-07 08:54:08 +09:00
Stephan Bergmann 54e87df11f Change INetProtocol enumerators to CamelCase
...to avoid clashes with macros and poor warnings about hiding global FILE

Change-Id: I444e8b958f029201b228937e088efabc4b6d3050
2015-04-02 18:33:37 +02:00
Stephan Bergmann 44b3e56bb4 Change INetProtocol to scoped enumeration
...and fix o3tl::enumarray::operator [] const overload

Change-Id: I749b1b9d68686b03a97074253478d9d2d9d32b0b
2015-04-02 16:30:34 +02:00
Noel Grandin 7f8f277b94 fdo#84938: convert STREAM_ #defines to 'enum class'
Change-Id: Ibbf14c7e9a5c1883c1311d4c86f948f74f8e473e
2015-01-07 11:20:44 +02:00
Noel Grandin 8130714148 fdo#84938: replace NUMBERFORMAT_INT_ constants with 'enum class'
Change-Id: I9c67de31f5571b282adc132d973b79bccb35fdc9
2015-01-05 12:57:18 +02:00
Stephan Bergmann 09e071fddd tools: Use appropriate OUString functions on string constants
Change-Id: Idbca92ee8d38fe5839ec0aeb8ee02af3e326549d
2014-12-18 17:36:14 +01:00
Stephan Bergmann 9ce073bc17 tools: Use appropriate OUString functions on string constants
Change-Id: Ifeb1aa309db401c9bb6e3184489c17d399cf145f
2014-12-15 10:19:01 +01:00
Juan Picca 2ce0aedede fdo#81356: use boost::rational internally in Fraction
Change-Id: I6f40eafee7652209395bd471e3508fe3a3d19d73
Reviewed-on: https://gerrit.libreoffice.org/12085
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-10-28 17:15:10 +00:00
Stephan Bergmann 6a4b976bd0 Fix Fraction(-2147483648.0) for 32-bit wide long
Change-Id: I6465377de1edff5d0ccc0049fb6d24f6f1223fd2
2014-10-24 16:10:54 +02:00
Juan Picca 6805d77c70 Fract: enable tests
Change-Id: I00650503f15f2dcd45b07e3c529965336e8391e6
Reviewed-on: https://gerrit.libreoffice.org/12080
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-10-24 08:17:27 +00:00
Jan Holesovsky 31af61ea09 Fraction: Revert "fdo#81356: convert Fraction to boost::rational<long> - wip"
This reverts commit 47a2d7642d.

Conflicts:

	cui/source/tabpages/transfrm.cxx
	svx/source/svdraw/svdedtv1.cxx
	svx/source/svdraw/svdibrow.cxx
	sw/source/filter/ww1/w1filter.cxx
	tools/source/generic/rational.cxx

Change-Id: I4849916f5f277a4afef0e279b0135c76b36b9d15
2014-10-23 18:34:39 +02:00
Jan Holesovsky 858c2a2977 Fraction: Revert "fdo#84854 it seems long is not enough on 32 bit"
This reverts commit 582ef22d3e.

Conflicts:

	svx/source/svdraw/svdedtv1.cxx
	svx/source/svdraw/svdibrow.cxx
	sw/source/filter/ww1/w1filter.cxx

Change-Id: I80abc7abdeddc267eaabc9f8ab49611bb3f8ae83
2014-10-23 18:34:34 +02:00
David Tardon 18bb0ac9ee another blind attempt to fix the test
Change-Id: I7ac53b340cf3a9f72a90414e09ddd37148ecd28a
2014-10-17 23:25:04 +02:00
David Tardon a43ba14c53 correct cast
Change-Id: Ic79ce25bf4ceb4d715aabdabf3824304b02b1f38
2014-10-17 23:05:16 +02:00
David Tardon 69e8417e43 fix copypasta
Change-Id: I08383e3086eef8e7c8136293d51b7108807a7def
2014-10-17 15:22:47 +02:00
David Tardon c738c9fb2c fix comparison
Change-Id: Ia7f65d69c186056527a2beb72a18f4a66e4c6586
2014-10-17 14:44:20 +02:00
David Tardon 1dd736540f correct function name
Change-Id: Ibc3ab15bc830d68bf9d3d1d9ac9595d82c7fb6aa
2014-10-17 13:44:29 +02:00
David Tardon 968cadb825 allow construction of BigInt from sal_Int64 on 32 bit
Change-Id: Ib68920fc9bd693d2f2679b4fc27d9956dc42fc86
2014-10-17 13:17:21 +02:00
David Tardon 582ef22d3e fdo#84854 it seems long is not enough on 32 bit
Fraction used BigInt internally for computations, rational does nothing
like that.

Change-Id: I3e9b25074f979bc291208f7c6362c3c40eb77ff5
2014-10-16 17:44:44 +02:00
Juan Picca 47a2d7642d fdo#81356: convert Fraction to boost::rational<long> - wip
* Added rational util functions used by Fraction class not
  available in the boost::rational class.
* Replaced usage of Fraction by boost::rational<long>
* Removed code that relies on:
  1. fraction.IsValid() -- rational only allow valid values, ie
     denominator() != 0
  2. rational.denominator() == 0 -- always false
  3. rational.denominator() < 0 -- always false but implementation
     detail: http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation
* Simplified code that relies on:
  1. rational.denominator() != 0 -- always true
* BUGS EXIST because Fraction allows the creation of invalid values but
  boost::rational throws the exception boost::bad_rational

Change-Id: I84970a4956afb3f91ac0c8f726547466319420f9
Reviewed-on: https://gerrit.libreoffice.org/11551
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-10-09 11:33:33 +00:00
Michael Stahl ea2d767d44 tools: change INetURLObject::getData to return std::unique_ptr
Life-cycle becomes a lot more obvious this way.

Change-Id: I1ca99607f609a2223011c40447ad1cd9ca5ccaa5
2014-09-26 16:38:34 +02:00
Stephan Bergmann 805b57cd5b Various INetURLObject::getData() fixes
Change-Id: I5eafd6250bbde7227dcc0447a4280b7741c320de
2014-06-06 11:13:07 +02:00
Thomas Arnhold 9dd8a62147 cppcheck: add missing braket
Change-Id: I1e542455ad3e4ab1a445366517c92b102471840a
2014-05-22 12:50:48 +02:00