Tag: cws_src680_warnings01
User: sb      
Date: 06/05/23 16:57:45

Modified:
 /dba/dbaccess/source/ui/misc/
  HtmlReader.cxx

Log:
 RESYNC: (1.22-1.24); FILE MERGED

File Changes:

Directory: /dba/dbaccess/source/ui/misc/
========================================

File [changed]: HtmlReader.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/HtmlReader.cxx?r1=1.22.4.1&r2=1.22.4.2
Delta lines:  +50 -65
---------------------
--- HtmlReader.cxx      24 Mar 2006 15:36:21 -0000      1.22.4.1
+++ HtmlReader.cxx      23 May 2006 23:57:43 -0000      1.22.4.2
@@ -211,9 +211,10 @@
                                                 const Reference< 
::com::sun::star::util::XNumberFormatter >& _rxNumberF,
                                                 const 
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory 
>& _rM,
                                                 const TColumnVector* pList,
-                                                const OTypeInfoMap* _pInfoMap)
+                                                const OTypeInfoMap* _pInfoMap,
+                         sal_Bool _bAutoIncrementEnabled)
        : HTMLParser(rIn)
-       ,ODatabaseExport(nRows,_rColumnPositions,_rxNumberF,_rM,pList,_pInfoMap)
+       
,ODatabaseExport(nRows,_rColumnPositions,_rxNumberF,_rM,pList,_pInfoMap,_bAutoIncrementEnabled)
        ,m_nTableCount(0)
        ,m_nColumnWidth(87)
        ,m_bMetaOptions(sal_False)
@@ -306,11 +307,11 @@
                                }
                                break;
                        case HTML_TABLEROW_ON:
-                               if ( m_xResultSetUpdate.is() )
+                               if ( m_pUpdateHelper.get() )
                                {
                                        try
                                        {
-                                               
m_xResultSetUpdate->moveToInsertRow(); // sonst neue Zeile anh"angen
+                                               
m_pUpdateHelper->moveToInsertRow(); // sonst neue Zeile anh"angen
                                        }
                                        catch(SQLException& e)
                                        // UpdateFehlerbehandlung
@@ -323,33 +324,11 @@
                                break;
                        case HTML_TEXTTOKEN:
                        case HTML_SINGLECHAR:
-                               if ( m_bInTbl && !m_bSDNum ) // wichtig, da wir 
sonst auch die Namen der Fonts bekommen
+                               if ( m_bInTbl ) //&& !m_bSDNum ) // wichtig, da 
wir sonst auch die Namen der Fonts bekommen
                                        m_sTextToken += aToken;
                                break;
                        case HTML_TABLEDATA_ON:
-                               {
-                                       m_bInTbl = TRUE;
-                                       const HTMLOptions* pHtmlOptions = 
GetOptions();
-                                       sal_Int16 nArrLen = 
pHtmlOptions->Count();
-                                       for ( sal_Int16 i = 0; i < nArrLen; i++ 
)
-                                       {
-                                               const HTMLOption* pOption = 
(*pHtmlOptions)[i];
-                                               switch( pOption->GetToken() )
-                                               {
-                                                       case HTML_O_SDVAL:
-                                                       {
-                                                               m_sTextToken = 
pOption->GetString();
-                                                               m_bSDNum = 
sal_True;
-                                                       }
-                                                       break;
-                                                       case HTML_O_SDNUM:
-                                                       {
-                                                               //      pValue 
= new String( pOption->GetString() );
-                                                       }
-                                                       break;
-                                               }
-                                       }
-                               }
+                fetchOptions();
                                break;
                        case HTML_TABLEDATA_OFF:
                                {
@@ -363,12 +342,12 @@
                                                showErrorDialog(e);
                                        }
                                        m_nColumnPos++;
-                                       m_sTextToken.Erase();
+                    eraseTokens();
                                        m_bSDNum = m_bInTbl = sal_False;
                                }
                                break;
                        case HTML_TABLEROW_OFF:
-                               if ( !m_xResultSetUpdate.is() )
+                               if ( !m_pUpdateHelper.get() )
                                {
                                        m_bError = sal_True;
                                        break;
@@ -377,8 +356,8 @@
                                {
                                        m_nRowCount++;
                                        if (m_bIsAutoIncrement) // if 
bSetAutoIncrement then I have to set the autoincrement
-                                               
m_xRowUpdate->updateInt(1,m_nRowCount);
-                                       m_xResultSetUpdate->insertRow();
+                                               
m_pUpdateHelper->updateInt(1,m_nRowCount);
+                                       m_pUpdateHelper->insertRow();
                                }
                                catch(SQLException& e)
                                
//////////////////////////////////////////////////////////////////////
@@ -407,40 +386,46 @@
                                break;
                        case HTML_TABLEDATA_ON:
                        case HTML_TABLEHEADER_ON:
-                               m_bInTbl = TRUE;
+                               fetchOptions();
                                break;
                        case HTML_TEXTTOKEN:
                        case HTML_SINGLECHAR:
-                               if(m_bInTbl)
+                if ( m_bInTbl ) // && !m_bSDNum ) // wichtig, da wir sonst 
auch die Namen der Fonts bekommen
                                        m_sTextToken += aToken;
                                break;
                        case HTML_TABLEDATA_OFF:
-                               if(m_sTextToken.Len())
-                               {
-                                       sal_Int32 nColPos = 
m_vColumns[m_nColumnPos].first;
-                                       if ( nColPos != 
COLUMN_POSITION_NOT_FOUND )
-                                       {
-                                               m_vFormatKey[nColPos] = 
CheckString(m_sTextToken,m_vFormatKey[nColPos]);
-                                               m_vColumnSize[nColPos] = 
::std::max<sal_Int32>((sal_Int32)m_vColumnSize[nColPos],(sal_Int32)m_sTextToken.Len());
-                                       }
-                                       m_sTextToken.Erase();
-                               }
+                adjustFormat();
                                m_nColumnPos++;
-                               m_bInTbl = sal_False;
+                               m_bSDNum = m_bInTbl = sal_False;
                                break;
                        case HTML_TABLEROW_OFF:
-                               if(m_sTextToken.Len())
+                adjustFormat();
+                               m_nColumnPos = 0;
+                               m_nRows--;
+                               break;
+               }
+       }
+}
+// 
-----------------------------------------------------------------------------
+void OHTMLReader::fetchOptions()
+{
+       m_bInTbl = TRUE;
+       const HTMLOptions* pOptions = GetOptions();
+       sal_Int16 nArrLen = pOptions->Count();
+       for ( sal_Int16 i = 0; i < nArrLen; i++ )
+       {
+               const HTMLOption* pOption = (*pOptions)[i];
+               switch( pOption->GetToken() )
                                {
-                                       sal_Int32 nColPos = 
m_vColumns[m_nColumnPos].first;
-                                       if ( nColPos != 
COLUMN_POSITION_NOT_FOUND )
+                       case HTML_O_SDVAL:
                                        {
-                                               m_vFormatKey[nColPos] = 
CheckString(m_sTextToken,m_vFormatKey[nColPos]);
-                                               m_vColumnSize[nColPos] = 
::std::max<sal_Int32>((sal_Int32)m_vColumnSize[nColPos],(sal_Int32)m_sTextToken.Len());
-                                       }
-                                       m_sTextToken.Erase();
+                m_sValToken = pOption->GetString();
+                               //m_sTextToken = pOption->GetString();
+                               m_bSDNum = sal_True;
                                }
-                               m_nColumnPos = 0;
-                               m_nRows--;
+                       break;
+                       case HTML_O_SDNUM:
+                m_sNumToken = pOption->GetString();
                                break;
                }
        }
@@ -473,12 +458,12 @@
                        break;
                        case HTML_O_SDVAL:
                        {
-                               pValue = new String( pOption->GetString() );
+                               //pValue = new String( pOption->GetString() );
                        }
                        break;
                        case HTML_O_SDNUM:
                        {
-                               pValue = new String( pOption->GetString() );
+                               //pValue = new String( pOption->GetString() );
                        }
                        break;
                        case HTML_O_BGCOLOR:




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

Reply via email to