Tag: cws_src680_dba24d
User: oj      
Date: 2007-11-26 07:52:27+0000
Modified:
   dba/connectivity/source/inc/flat/ETable.hxx
   dba/connectivity/source/drivers/flat/ETable.cxx

Log:
 #i31385# read multiline string

File Changes:

Directory: /dba/connectivity/source/inc/flat/
=============================================

File [changed]: ETable.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/inc/flat/ETable.hxx?r1=1.15&r2=1.15.212.1
Delta lines:  +4 -5
-------------------
--- ETable.hxx  2006-06-20 02:02:42+0000        1.15
+++ ETable.hxx  2007-11-26 07:52:24+0000        1.15.212.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ETable.hxx,v $
  *
- *  $Revision: 1.15 $
+ *  $Revision: 1.15.212.1 $
  *
- *  last change: $Author: hr $ $Date: 2006/06/20 02:02:42 $
+ *  last change: $Author: oj $ $Date: 2007/11/26 07:52:24 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -73,11 +73,10 @@
                        ::com::sun::star::uno::Reference< 
::com::sun::star::util::XNumberFormatter > m_xNumberFormatter;
                        sal_Int32                                               
m_nRowPos;
                        sal_Int32                                               
m_nMaxRowCount; // will be set if stream is once eof
-               public: 
-               
                private:                                        
                        void fillColumns(const ::com::sun::star::lang::Locale& 
_aLocale);
                        BOOL CreateFile(const INetURLObject& aFile, BOOL& 
bCreateMemo);
+            sal_Bool readLine(sal_Int32& _rnCurrentPos);
 
                        sal_Bool checkHeaderLine();
                public:

Directory: /dba/connectivity/source/drivers/flat/
=================================================

File [changed]: ETable.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/flat/ETable.cxx?r1=1.58&r2=1.58.20.1
Delta lines:  +36 -23
---------------------
--- ETable.cxx  2007-09-26 14:29:25+0000        1.58
+++ ETable.cxx  2007-11-26 07:52:25+0000        1.58.20.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ETable.cxx,v $
  *
- *  $Revision: 1.58 $
+ *  $Revision: 1.58.20.1 $
  *
- *  last change: $Author: hr $ $Date: 2007/09/26 14:29:25 $
+ *  last change: $Author: oj $ $Date: 2007/11/26 07:52:25 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -683,7 +683,6 @@
 {
        if ( !m_pFileStream )
                return sal_False;
-       OFlatConnection* pConnection = (OFlatConnection*)m_pConnection;
        // ----------------------------------------------------------
        // Positionierung vorbereiten:
 
@@ -707,13 +706,12 @@
 
                        
m_aRowToFilePos.insert(::std::map<sal_Int32,sal_Int32>::value_type(m_nRowPos,m_nFilePos));
 
-                       
m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
-                       if (m_pFileStream->IsEof())
+                       if ( !readLine(nCurPos))
                        {
                                m_nMaxRowCount = m_nRowPos;
                                return sal_False;
                        }
-                       nCurPos = m_pFileStream->Tell();
+                       
                        break;
                case IResultSetHelper::PRIOR:
                        --m_nRowPos;
@@ -723,10 +721,8 @@
                                m_pFileStream->Seek(m_nFilePos);
                                if (m_pFileStream->IsEof() || 
!checkHeaderLine())
                                        return sal_False;
-                               
m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
-                               if (m_pFileStream->IsEof())
+                               if ( !readLine(nCurPos) )
                                        return sal_False;
-                               nCurPos = m_pFileStream->Tell();
                        }
                        else
                                m_nRowPos = 0;
@@ -740,10 +736,9 @@
                                m_pFileStream->Seek(m_nFilePos);
                                if (m_pFileStream->IsEof() || 
!checkHeaderLine())
                                        return sal_False;
-                               
m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
-                               if (m_pFileStream->IsEof())
+                               
+                               if ( !readLine(nCurPos) )
                                        return sal_False;
-                               nCurPos = m_pFileStream->Tell();
                        }
                        else
                        {
@@ -775,10 +770,8 @@
                                        m_pFileStream->Seek(m_nFilePos);
                                        if (m_pFileStream->IsEof() || 
!checkHeaderLine())
                                                return sal_False;
-                                       
m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
-                                       if (m_pFileStream->IsEof())
+                                       if ( !readLine(nCurPos) )
                                                return sal_False;
-                                       nCurPos = m_pFileStream->Tell();
                                }
                                else if(m_nMaxRowCount && nOffset > 
m_nMaxRowCount) // offset is outside the table
                                {
@@ -803,10 +796,8 @@
                                                m_pFileStream->Seek(m_nFilePos);
                                                if (m_pFileStream->IsEof() || 
!checkHeaderLine())
                                                        return sal_False;
-                                               
m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
-                                               if (m_pFileStream->IsEof())
+                                               if ( !readLine(nCurPos) )
                                                        return sal_False;
-                                               nCurPos = m_pFileStream->Tell();
                                        }
                                }
                        }
@@ -818,10 +809,9 @@
                                return sal_False;
 
                        m_nFilePos = m_pFileStream->Tell();     // 
Byte-Position in der Datei merken (am ZeilenANFANG)
-                       
m_pFileStream->ReadByteStringLine(m_aCurrentLine,pConnection->getTextEncoding());
-                       if (m_pFileStream->IsEof())
+                       
+                       if ( !readLine(nCurPos) )
                                return sal_False;
-                       nCurPos  = m_pFileStream->Tell();
                        break;
        }
 
@@ -829,3 +819,26 @@
        return sal_True;
 }
 // 
-----------------------------------------------------------------------------
+sal_Bool OFlatTable::readLine(sal_Int32& _rnCurrentPos)
+{
+    
m_pFileStream->ReadByteStringLine(m_aCurrentLine,m_pConnection->getTextEncoding());
+       if (m_pFileStream->IsEof())
+               return sal_False;
+
+    OFlatConnection* pConnection = 
static_cast<OFlatConnection*>(m_pConnection);
+    QuotedTokenizedString sLine = m_aCurrentLine;
+    while( (sLine.GetTokenCount(pConnection->getStringDelimiter()) % 2) != 1 )
+    {
+        
m_pFileStream->ReadByteStringLine(sLine,m_pConnection->getTextEncoding());
+        if ( !m_pFileStream->IsEof() )
+        {
+            m_aCurrentLine.Append('\n');
+            m_aCurrentLine += sLine;
+            sLine = m_aCurrentLine;
+        }
+        else
+            break;
+    }
+    _rnCurrentPos = m_pFileStream->Tell();
+    return sal_True;
+}
\ No newline at end of file




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to