Commit Graph

105 Commits

Author SHA1 Message Date
Caolán McNamara
3b4786b6b7 callcatcher: regenerate list 2012-02-13 11:02:46 +00:00
Noel Grandin
61451fec9b fdo#44981 - remove obsolete SWAPLONG macros 2012-01-30 13:18:38 +00:00
Caolán McNamara
bbc94edb9a refactor ConvertLineEnd 2012-01-30 13:18:38 +00:00
Caolán McNamara
905b84557d refresh unused code list 2012-01-25 15:37:20 +00:00
Caolán McNamara
39e54d0480 move ugly WriteLines out of SvStream to beside sole user 2012-01-25 15:37:19 +00:00
Caolán McNamara
3ee84cb27e use write_uInt16s_FromOUString pattern 2012-01-24 16:53:56 +00:00
Caolán McNamara
5f662f2540 all direct OUString readers are current little endian streams 2012-01-24 16:53:55 +00:00
Caolán McNamara
b1f74de031 ByteString->rtl::OString 2012-01-23 11:37:06 +00:00
Stephan Bergmann
75a6a51a9d Fix int/sal_Int32 mismatch. 2012-01-19 10:58:32 +01:00
Keith McRae
7b2a0e5415 fdo#39428 Remove/audit SvStream operator>>/<<(long)
Removed declarations & definitions for operator<<(long),(int)&(short)
Removed declarations & definitions for operator>>(long),(int)&(short)
Added (where necessary) operator<< for sal_Int & sal_uInt types
Added (where necessary) operator>> for sal_Int & sal_uInt types
Added SwapInt64 function, basically a copy of SwapUInt64
2012-01-18 22:56:12 -05:00
Caolán McNamara
94a8737a54 drop strange embedded null handling behaviour 2012-01-16 15:40:53 +00:00
Caolán McNamara
a8742cecc1 convert some old-school ByteStrings 2012-01-16 10:21:55 +00:00
Caolán McNamara
17fe34ec56 here calc, take ownership of this foul monstrosity only you use
SvStream::ReadCsvLine doesn't need to be a member of Stream and the subcomment
about what's wrong with the method is longer than the body of the method.

Only used by calc, so can go into calc.

foul monstrosity back
2012-01-13 16:46:34 +00:00
Caolán McNamara
20b7500645 noone checks the return value of ReadCsvLine 2012-01-13 09:06:00 +00:00
Caolán McNamara
e2f062ef7f force users of horrific ReadUniOrByteStringLine to provide the charset 2012-01-10 10:09:29 +00:00
Caolán McNamara
2d3203b2db make ReadUniOrByteString return a string 2012-01-06 09:52:42 +00:00
Caolán McNamara
6bbd168aac convert SvStream::WriteLine to rtl::OString 2012-01-05 09:18:18 +00:00
Kohei Yoshida
8173b0d297 Fix import of multi-line cell contents during csv import.
Regression from 3.3.x.

Import of tab-delimited csv documents containing multi-line cells
were unfortunately broken with my fix for handling malformed csv
documents.  The intent was to break out of the loop only when a tab
character is encountered before the closing quote is encountered, but
the old code would break out whenever a tab character is encountered
even outside the quotes.

This commit fixes it.
2012-01-03 13:59:28 -05:00
Caolán McNamara
f5eb8a2fc2 I hate you poxy msvc 2011-12-21 14:32:40 +00:00
Caolán McNamara
c1d49234e5 tweak for pre language-defect #77 2011-12-21 13:44:52 +00:00
Caolán McNamara
5c24789ca3 disentangle Read/WriteByteString OUString variants
The ones which use a definite 8-bit encoding read/write pascal-style
strings with a 16bit length prefix.

The ones which use a definite 16-bit encoding read/write pascal-style
UTF-16 strings with a 32bit length prefix, i.e. not ByteStrings at all

The "I dunno" ones might be UTF-16 strings or 8-bit strings, depending
on the charset. Rename to ReadUniOrByteString like the other
similar horrors to flag this misery
2011-12-21 13:44:52 +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
fffae28952 bah, need to tweak for pre c++0x
This reverts commit d00fc0e293.
2011-12-21 10:29:33 +00:00
Caolán McNamara
d00fc0e293 disentangle Read/WriteByteString OUString variants
The ones which use a definite 8-bit encoding read/write pascal-style
strings with a 16bit length prefix.

The ones which use a definite 16-bit encoding read/write pascal-style
UTF-16 strings with a 32bit length prefix, i.e. not ByteStrings at all

The "I dunno" ones might be UTF-16 strings or 8-bit strings, depending
on the charset. Rename to ReadUniOrByteString like the other
similar horrors to flag this misery
2011-12-21 10:10:58 +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
Matúš Kukan
f958657cc5 gcc-trunk: fix error: unable to find string literal operator 'operator"" FOO' 2011-12-16 21:20:08 +01:00
Caolán McNamara
66c3655a07 convert ReadCString from ByteString to OString
Nobody ever checked the return value anyway, so just return the string
and use the stream state bits if necessary to find failures.

Doesn't need to be a member, make a standalone function

Rename it to read_zeroTerminated_uInt8s_AsO[U]String, stupid perhaps,
but *shrug*, unambiguous.

Drop misleading overloaded String variants use:
read_zeroTerminated_uInt8s_AsOString or
read_zeroTerminated_uInt8s_AsOUString

added a unit test, valgrinded it, found and fixed invalid read
in original implementation.
2011-12-15 12:22:49 +00:00
Norbert Thiebaud
5f7649aead remove include of pch header from tools 2011-11-27 13:25:56 -06:00
Caolán McNamara
4e7fff380a remove ENABLE_BYTESTRING_STREAM_OPERATORS 2011-11-19 21:11:02 +00:00
Markus Mohrhard
125aa32e71 we need to assign this value also for non unix platforms (fdo#40801) 2011-11-01 01:00:24 +01:00
Caolán McNamara
2d25e3c354 tidy this a little bit 2011-10-10 08:51:15 +01:00
Tor Lillqvist
588a0d58d2 Silly attempts at humour not appreciated 2011-10-04 11:07:46 +03:00
Tor Lillqvist
bee695a32d WaE: potentially uninitialized local variable 'n' used 2011-10-04 10:27:04 +03:00
Tor Lillqvist
c963747ed8 WaE: unreferenced formal parameter 2011-10-04 10:27:02 +03:00
Caolán McNamara
5d73752cc7 rework this in terms of read_uInt8s_AsOString 2011-09-19 09:59:20 +01:00
Caolán McNamara
e99a072c0e add a fairly efficient read_LEuInt16s_AsOUString, merge similar things 2011-09-05 10:54:19 +01:00
Caolán McNamara
0ee8ec18c4 add a way to better construct an OString of len X from a SvStream 2011-09-02 09:54:18 +01:00
Caolán McNamara
050b80a6fc ditch deprecated api 2011-08-23 10:35:45 +01:00
Caolán McNamara
ef6add9a7e callcatcher: remove unused code 2011-07-31 23:49:35 +01:00
Caolán McNamara
8291b5884c make stream operators leave variables in original state on failure
this aligns them with the behaviour of std::stream, and makes things
like

sal_uInt32 n(0);
rSt >> n;
if (n)
{
   ...
}

safe if there was a short read of e.g. 3 bytes instead of the required 4
2011-07-29 10:56:42 +01:00
Caolán McNamara
5f2acb1726 add a SvStream::remainingSize 2011-07-18 12:21:26 +01:00
Caolán McNamara
a3b0ee88be strip out unused methods 2011-07-11 09:05:06 +01:00
Caolán McNamara
6575317bf6 callcatcher: remove unused WriteUniStringLines 2011-07-11 09:05:06 +01:00
Christina Rossmanith
7ae4abd293 Added SvStream::ReadLine( rtl::OString& ) 2011-07-05 21:57:25 +02:00
Caolán McNamara
1ed472827b can shrink these buffers to minimum required 2011-06-14 15:19:49 +01:00
Caolán McNamara
e881c80269 and now we can remove FormatString 2011-06-14 15:19:49 +01:00
Caolán McNamara
fa3adcf3c1 remove unused filler and width 2011-06-14 09:56:45 +01:00
Caolán McNamara
77e481f595 Precision unused 2011-06-14 09:56:45 +01:00
Caolán McNamara
0f1969d04b remove unused justification 2011-06-14 09:56:44 +01:00