void ORTFReader::NextToken( int nToken )
{ if(m_bError || !m_nRows) // if there is an error or no more rows to check, return immediately return;
if(m_xConnection.is()) // names, which CTOR was called and hence, if a table should be created
{ switch(nToken)
{ case RTF_COLORTBL:
{
int nTmpToken2 = GetNextToken(); do
{
Color aColor; do
{ switch(nTmpToken2)
{ case RTF_RED: aColor.SetRed(static_cast<sal_uInt8>(nTokenValue)); break; case RTF_BLUE: aColor.SetBlue(static_cast<sal_uInt8>(nTokenValue)); break; case RTF_GREEN: aColor.SetGreen(static_cast<sal_uInt8>(nTokenValue)); break; default: break;
}
nTmpToken2 = GetNextToken();
} while(aToken[0] != ';' && eState != SvParserState::Error && eState != SvParserState::Accepted);
m_vecColor.push_back(aColor.GetRGBColor());
nTmpToken2 = GetNextToken();
} while(nTmpToken2 == RTF_RED && eState != SvParserState::Error && eState != SvParserState::Accepted);
SkipToken();
} break;
case RTF_TROWD:
{ if ( !m_xTable.is() ) // use first line as header
{
sal_uInt64 const nTell = rInput.Tell(); // perhaps alters position of the stream
m_bError = !CreateTable(nToken); if ( m_bAppendFirstLine )
{
rInput.Seek(nTell);
rInput.ResetError();
}
}
} break; case RTF_INTBL: if(m_bInTbl)
{
eraseTokens();
}
m_bInTbl = true; // Now we are in a table description break; case RTF_TEXTTOKEN: case RTF_SINGLECHAR: if(m_bInTbl) // important, as otherwise we also get the names of the fonts
m_sTextToken += aToken; break; case RTF_CELL:
{ try
{
insertValueIntoColumn();
} catch(SQLException& e) // handling update failure
{
showErrorDialog(e);
}
m_nColumnPos++;
eraseTokens();
} break; case RTF_ROW: // it can happen that the last cell is not concluded with \cell try
{
insertValueIntoColumn();
m_nRowCount++; if(m_bIsAutoIncrement) // if bSetAutoIncrement then I have to set the autoincrement
m_pUpdateHelper->updateInt(1,m_nRowCount);
m_pUpdateHelper->insertRow();
} catch(SQLException& e) // handling update failure
{
showErrorDialog(e);
}
m_nColumnPos = 0; break;
}
} else// branch only valid for type checking
{ switch(nToken)
{ case RTF_TROWD: // The head of the column is not included if(m_bHead)
{ do
{} while(GetNextToken() != RTF_ROW && eState != SvParserState::Error && eState != SvParserState::Accepted);
m_bHead = false;
} break; case RTF_INTBL:
m_bInTbl = true; break; case RTF_TEXTTOKEN: case RTF_SINGLECHAR: if(m_bInTbl)
m_sTextToken += aToken; break; case RTF_CELL:
adjustFormat();
m_nColumnPos++; break; case RTF_ROW:
adjustFormat();
m_nColumnPos = 0;
m_nRows--; break;
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.