Commit Graph
66 Commits
Author SHA1 Message Date
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
Thomas Arnhold 8449225508 fix-includes.pl: tools
Change-Id: I66b3dc79998de018eae1c7eff8ce23f95e3c3f33
2014-05-22 12:50:45 +02:00
Tomaž Vajngerl 599328b0a9 tools: add AsRGBHexString to Color + unit test
AsRGBHexString returns the Color as a RGB hex string. For example
"00ff00" for green color.

Change-Id: Ia95c7f9eb6d9aefc3ca989046fa8d76b7b7f9e8f
2014-05-15 19:51:06 +02:00
Stephan Bergmann 70cc2b191b First batch of adding SAL_OVERRRIDE to overriding function declarations
...mostly done with a rewriting Clang plugin, with just some manual tweaking
necessary to fix poor macro usage.

Change-Id: I71fa20213e86be10de332ece0aa273239df7b61a
2014-03-26 16:39:26 +01: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 b2878af322 more SvStream:operator>> conversion
Convert the template based read_lenPrefixed methods to regular
methods.

Change-Id: Ifd0e93aca055e55a0575e4377ec2b8e266dfb019
Reviewed-on: https://gerrit.libreoffice.org/7895
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2014-02-12 15:32:11 +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
Noel Grandin fcd1637d51 convert OUString compareToAscii == 0 to equalsAscii
Convert code like
   aStr.compareToAscii("XXX") == 0
to
  aStr.equalsAscii("XXX")
which is both easier to read and faster.

Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
2013-11-11 12:58:13 +02:00
Stephan Bergmann 44ddacb232 fdo#33605: Handle http etc. URLs with no path but fragment
Change-Id: I8c47cc55e7ad53e514c0bd46130cbbe6a1bb0357
2013-07-26 17:41:08 +02:00
Michael Meeks 03993b47c5 targetted clean of redundant header piece from 62badf3828
Change-Id: Ic1240114d667fb7797afae4847427cc889f3cb48
2013-07-26 14:18:52 +01:00
Norbert Thiebaud 710f41b7ae Clean String and sal_Bool in tools
Change-Id: I6a92196f33d7a5278c7dcc426112e9c56d582655
Reviewed-on: https://gerrit.libreoffice.org/4627
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
2013-06-30 04:58:49 +00:00
Michael Meeks 72e5d0c8fb Move to MPLv2 license headers, with ESC decision and author's permission. 2013-04-30 13:34:06 +01:00
Michael Meeks 62badf3828 Move to MPLv2 license headers, with ESC decision and author's permission. 2013-04-22 09:37:38 +01:00
Luboš Luňák 1946794ae0 mass removal of rtl:: prefixes for O(U)String*
Modules sal, salhelper, cppu, cppuhelper, codemaker (selectively) and odk
have kept them, in order not to break external API (the automatic using declaration
is LO-internal).

Change-Id: I588fc9e0c45b914f824f91c0376980621d730f09
2013-04-07 14:23:11 +02:00
Caolán McNamara 67bdb8f14b use SAL_N_ELEMENTS
Change-Id: I6610f8e888389d09b673504f1eb9387dd38fb6c1
2013-03-16 21:25:16 +00:00
Chr. Rossmanith fdb41140bf Remove STRINGPARAM in tools (qa)
Change-Id: I1bff00d261c24e37f9ed41322c49c670850a940f
Reviewed-on: https://gerrit.libreoffice.org/2768
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
2013-03-16 17:09:37 +00:00
Cédric Bosdonnat 4cc2571e49 CMIS urls: remove +atom in the internal URLS as the binding is guessed
Change-Id: I9ae0704f1e5203778e97de5843efe777ba717271
2012-10-31 12:03:28 +01:00
Norbert Thiebaud b854de954f deprecate oustringostreaminserter.hxx
the intent of this header has canged over time. now it is already
systematically included with ustring.hxx and the operator overload it
provide fit nicely there...

Just to be safe, since that include as been added to the api during the
3.5 timeframe and therefore is already in 'production'
the header remain and simply attempt to include ustring.hxx
but a warning is issued indicating that this header should not be used
anymore... in a couple of major release we will thenr emove it completely

All internal users of that header are converted.

Change-Id: I8934c55f089e29d78c0f5649b7c87b2ecf024bad
Reviewed-on: https://gerrit.libreoffice.org/634
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
2012-09-18 10:10:06 +00:00
Tor Lillqvist 60cfa64345 Bin no longer used iOS cppunit stuff that even breaks the build
Change-Id: I459f7fd097a81ef5977974f52b0cc2c2f155a810
2012-08-02 19:16:53 +03:00
Michael Meeks 535e83550e re-base on ALv2 code. Includes:
Avoid some uses of non portable #!/bin/bash in shell scripts.
    Patch contributed by Pedro Giffuni
    http://svn.apache.org/viewvc?view=revision&revision=1235297
    remove redundant namespace, patch contributed Mathias Bauer
    http://svn.apache.org/viewvc?view=revision&revision=1162610
    removal of OS/2 port changes, and preferring our similiar
    tools/inc/tools/solar.h DLLPOSTFIX cleanup.
    i118595 - Removal of the use of getopt() from rscdep.
    Patch contributed by Andre Fische
    http://svn.apache.org/viewvc?view=revision&revision=1202270
2012-07-11 18:12:35 +01:00
Michael Meeks 328e2263fb targetted re-work of cppunit pieces. 2012-06-27 19:13:11 +01:00
Cédric Bosdonnat fd32788092 CMIS UCP: changed URLs to have hierarchical path
Hierarchical path is assumed in loads of places, changed the URLs to the
following:
  * Binding URL is encoded in the authority part, the repository ID is
    set as a fragment of the binding URL.
  * The hierarchical path reflects one of the path to the document on
    the server
:x

Change-Id: I8214daeb1d9c9b0f6ab86bdf60875e7e4e5369f4
2012-06-04 13:28:14 +02:00
Caolán McNamara 3313f7a555 merge cppunit test dirs together
drop archaic makefile.mks and export.maps and use consistent naming
2012-02-23 10:31:24 +00:00
Caolán McNamara 55b71dcc18 convert workben inetmimetest to cppunit test 2012-02-23 10:31:23 +00:00
Olivier Hallot 81e50fb2e3 Fix for fdo43460 Part XXXIX getLength() to isEmpty()
Part XXXIX
Modules
testtools, toolkit, tools
2012-01-16 18:49:04 -02:00
Caolán McNamara 94a8737a54 drop strange embedded null handling behaviour 2012-01-16 15:40:53 +00:00
Caolán McNamara 9790e4457f document with unit test rather suspicious eof handling
ReadLine differs from std::getline with respect to final lines
that end at EOF with no EOL.

i.e. see Export::ConvertLineEnds in l10ntools/source/export2.cxx
which doesn't make a massive amount of sense the way things currently are.
2012-01-16 10:21:56 +00:00
Caolán McNamara 456853e96c document with unit test rather odd embedded null handling 2012-01-16 10:21:56 +00:00
Caolán McNamara c4f0efc237 convert ReadByteString/WriteByteString from ByteString to OString
Nobody ever used the return values anyway, so for reading just
return the string and for writing the number of bytes written

Doesn't need to be members, make standalone functions

Rename  to
read_lenPrefixed_uInt8s_ToO[U]String and
write_lenPrefixed_uInt8s_FromO[U]String, lengthy,
but much less unambiguous, seeing as a lot of users of it don't
seem to be aware that they read/write pascal-style length
prefixed strings, which isn't surprising given the
apparent simplicity of their original name.

added a unit test
2011-12-21 13:44:52 +00:00
Caolán McNamara 6708977331 needs more work first
This reverts commit 92f396733e.
2011-12-21 10:30:10 +00:00
Caolán McNamara 92f396733e convert ReadByteString/WriteByteString from ByteString to OString
Nobody ever used the return values anyway, so for reading just
return the string and for writing the number of bytes written

Doesn't need to be members, make standalone functions

Rename  to
read_lenPrefixed_uInt8s_ToO[U]String and
write_lenPrefixed_uInt8s_FromO[U]String, lengthy,
but much less unambiguous, seeing as a lot of users of it don't
seem to be aware that they read/write pascal-style length
prefixed strings, which isn't surprising given the
apparent simplicity of their original name.

added a unit test
2011-12-21 10:10:58 +00:00