summaryrefslogtreecommitdiff
path: root/tools/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-01-13 16:38:27 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-01-13 16:46:34 +0000
commit17fe34ec569f3e14f35f3958cc5885a00bd6cff9 (patch)
tree1e3069d3f51148bd173f57e0c2b5f3e92ed18b0b /tools/source
parente5ac3524f2d72bf3113c571de105f8aa52a558d2 (diff)
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
Diffstat (limited to 'tools/source')
-rw-r--r--tools/source/stream/stream.cxx87
1 files changed, 0 insertions, 87 deletions
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 8c0efb66c6f2..fea6025e5263 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1019,93 +1019,6 @@ sal_Bool SvStream::StartReadingUnicodeText( rtl_TextEncoding eReadBomCharSet )
/*************************************************************************
|*
-|* Stream::ReadCsvLine()
-|*
-*************************************************************************/
-
-// Precondition: pStr is guaranteed to be non-NULL and points to a 0-terminated
-// array.
-inline const sal_Unicode* lcl_UnicodeStrChr( const sal_Unicode* pStr,
- sal_Unicode c )
-{
- while (*pStr)
- {
- if (*pStr == c)
- return pStr;
- ++pStr;
- }
- return 0;
-}
-
-void SvStream::ReadCsvLine( String& rStr, sal_Bool bEmbeddedLineBreak,
- const String& rFieldSeparators, sal_Unicode cFieldQuote,
- sal_Bool bAllowBackslashEscape)
-{
- ReadUniOrByteStringLine(rStr, GetStreamCharSet());
-
- if (bEmbeddedLineBreak)
- {
- const sal_Unicode* pSeps = rFieldSeparators.GetBuffer();
-
- // See if the separator(s) include tab.
- bool bTabSep = lcl_UnicodeStrChr(pSeps, '\t') != NULL;
-
- xub_StrLen nLastOffset = 0;
- xub_StrLen nQuotes = 0;
- while (!IsEof() && rStr.Len() < STRING_MAXLEN)
- {
- bool bBackslashEscaped = false;
- const sal_Unicode *p, *pStart;
- p = pStart = rStr.GetBuffer();
- p += nLastOffset;
- while (*p)
- {
- if (nQuotes)
- {
- if (bTabSep && *p == '\t' && (nQuotes % 2) != 0)
- {
- // When tab-delimited, tab char ends quoted sequence
- // even if we haven't reached the end quote. Doing
- // this helps keep mal-formed rows from damaging
- // other, well-formed rows.
- nQuotes = 0;
- break;
- }
-
- if (*p == cFieldQuote && !bBackslashEscaped)
- ++nQuotes;
- else if (bAllowBackslashEscape)
- {
- if (*p == '\\')
- bBackslashEscaped = !bBackslashEscaped;
- else
- bBackslashEscaped = false;
- }
- }
- else if (*p == cFieldQuote && (p == pStart ||
- lcl_UnicodeStrChr( pSeps, p[-1])))
- nQuotes = 1;
- // A quote character inside a field content does not start
- // a quote.
- ++p;
- }
-
- if (nQuotes % 2 == 0)
- break;
- else
- {
- nLastOffset = rStr.Len();
- String aNext;
- ReadUniOrByteStringLine(aNext, GetStreamCharSet());
- rStr += sal_Unicode(_LF);
- rStr += aNext;
- }
- }
- }
-}
-
-/*************************************************************************
-|*
|* Stream::SeekRel()
|*
*************************************************************************/