diff options
Diffstat (limited to 'sc/source/filter/html/htmlpars.cxx')
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 266 |
1 files changed, 133 insertions, 133 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index bdb142a2ba9f..c1f6cacd7eb6 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -71,7 +71,7 @@ using namespace ::com::sun::star; -SV_IMPL_VARARR_SORT( ScHTMLColOffset, ULONG ); +SV_IMPL_VARARR_SORT( ScHTMLColOffset, sal_uLong ); // ============================================================================ @@ -113,10 +113,10 @@ ScHTMLLayoutParser::ScHTMLLayoutParser( EditEngine* pEditP, const String& rBaseU nColOffsetStart(0), nMetaCnt(0), nOffsetTolerance( SC_HTML_OFFSET_TOLERANCE_SMALL ), - bTabInTabCell( FALSE ), - bFirstRow( TRUE ), - bInCell( FALSE ), - bInTitle( FALSE ) + bTabInTabCell( false ), + bFirstRow( sal_True ), + bInCell( false ), + bInTitle( false ) { MakeColNoRef( pLocalColOffset, 0, 0, 0, 0 ); MakeColNoRef( pColOffset, 0, 0, 0, 0 ); @@ -156,13 +156,13 @@ ScHTMLLayoutParser::~ScHTMLLayoutParser() } -ULONG ScHTMLLayoutParser::Read( SvStream& rStream, const String& rBaseURL ) +sal_uLong ScHTMLLayoutParser::Read( SvStream& rStream, const String& rBaseURL ) { Link aOldLink = pEdit->GetImportHdl(); pEdit->SetImportHdl( LINK( this, ScHTMLLayoutParser, HTMLImportHdl ) ); SfxObjectShell* pObjSh = mpDoc->GetDocumentShell(); - BOOL bLoading = pObjSh && pObjSh->IsLoading(); + sal_Bool bLoading = pObjSh && pObjSh->IsLoading(); SvKeyValueIteratorRef xValues; SvKeyValueIterator* pAttributes = NULL; @@ -185,17 +185,17 @@ ULONG ScHTMLLayoutParser::Read( SvStream& rStream, const String& rBaseURL ) } } - ULONG nErr = pEdit->Read( rStream, rBaseURL, EE_FORMAT_HTML, pAttributes ); + sal_uLong nErr = pEdit->Read( rStream, rBaseURL, EE_FORMAT_HTML, pAttributes ); pEdit->SetImportHdl( aOldLink ); // Spaltenbreiten erzeugen Adjust(); OutputDevice* pDefaultDev = Application::GetDefaultDevice(); - USHORT nCount = pColOffset->Count(); - const ULONG* pOff = (const ULONG*) pColOffset->GetData(); - ULONG nOff = *pOff++; + sal_uInt16 nCount = pColOffset->Count(); + const sal_uLong* pOff = (const sal_uLong*) pColOffset->GetData(); + sal_uLong nOff = *pOff++; Size aSize; - for ( USHORT j = 1; j < nCount; j++, pOff++ ) + for ( sal_uInt16 j = 1; j < nCount; j++, pOff++ ) { aSize.Width() = *pOff - nOff; aSize = pDefaultDev->PixelToLogic( aSize, MapMode( MAP_TWIP ) ); @@ -253,61 +253,61 @@ void ScHTMLLayoutParser::NextRow( ImportInfo* pInfo ) nRowMax = nRowCnt; nColCnt = nColCntStart; nColOffset = nColOffsetStart; - bFirstRow = FALSE; + bFirstRow = false; } -BOOL ScHTMLLayoutParser::SeekOffset( ScHTMLColOffset* pOffset, USHORT nOffset, - SCCOL* pCol, USHORT nOffsetTol ) +sal_Bool ScHTMLLayoutParser::SeekOffset( ScHTMLColOffset* pOffset, sal_uInt16 nOffset, + SCCOL* pCol, sal_uInt16 nOffsetTol ) { DBG_ASSERT( pOffset, "ScHTMLLayoutParser::SeekOffset - illegal call" ); - USHORT nPos; - BOOL bFound = pOffset->Seek_Entry( nOffset, &nPos ); + sal_uInt16 nPos; + sal_Bool bFound = pOffset->Seek_Entry( nOffset, &nPos ); *pCol = static_cast<SCCOL>(nPos); if ( bFound ) - return TRUE; - USHORT nCount = pOffset->Count(); + return sal_True; + sal_uInt16 nCount = pOffset->Count(); if ( !nCount ) - return FALSE; + return false; // nPos ist Einfuegeposition, da liegt der Naechsthoehere (oder auch nicht) if ( nPos < nCount && (((*pOffset)[nPos] - nOffsetTol) <= nOffset) ) - return TRUE; + return sal_True; // nicht kleiner als alles andere? dann mit Naechstniedrigerem vergleichen else if ( nPos && (((*pOffset)[nPos-1] + nOffsetTol) >= nOffset) ) { (*pCol)--; - return TRUE; + return sal_True; } - return FALSE; + return false; } -void ScHTMLLayoutParser::MakeCol( ScHTMLColOffset* pOffset, USHORT& nOffset, - USHORT& nWidth, USHORT nOffsetTol, USHORT nWidthTol ) +void ScHTMLLayoutParser::MakeCol( ScHTMLColOffset* pOffset, sal_uInt16& nOffset, + sal_uInt16& nWidth, sal_uInt16 nOffsetTol, sal_uInt16 nWidthTol ) { DBG_ASSERT( pOffset, "ScHTMLLayoutParser::MakeCol - illegal call" ); SCCOL nPos; if ( SeekOffset( pOffset, nOffset, &nPos, nOffsetTol ) ) - nOffset = (USHORT)(*pOffset)[nPos]; + nOffset = (sal_uInt16)(*pOffset)[nPos]; else pOffset->Insert( nOffset ); if ( nWidth ) { if ( SeekOffset( pOffset, nOffset + nWidth, &nPos, nWidthTol ) ) - nWidth = (USHORT)(*pOffset)[nPos] - nOffset; + nWidth = (sal_uInt16)(*pOffset)[nPos] - nOffset; else pOffset->Insert( nOffset + nWidth ); } } -void ScHTMLLayoutParser::MakeColNoRef( ScHTMLColOffset* pOffset, USHORT nOffset, - USHORT nWidth, USHORT nOffsetTol, USHORT nWidthTol ) +void ScHTMLLayoutParser::MakeColNoRef( ScHTMLColOffset* pOffset, sal_uInt16 nOffset, + sal_uInt16 nWidth, sal_uInt16 nOffsetTol, sal_uInt16 nWidthTol ) { DBG_ASSERT( pOffset, "ScHTMLLayoutParser::MakeColNoRef - illegal call" ); SCCOL nPos; if ( SeekOffset( pOffset, nOffset, &nPos, nOffsetTol ) ) - nOffset = (USHORT)(*pOffset)[nPos]; + nOffset = (sal_uInt16)(*pOffset)[nPos]; else pOffset->Insert( nOffset ); if ( nWidth ) @@ -318,31 +318,31 @@ void ScHTMLLayoutParser::MakeColNoRef( ScHTMLColOffset* pOffset, USHORT nOffset, } -void ScHTMLLayoutParser::ModifyOffset( ScHTMLColOffset* pOffset, USHORT& nOldOffset, - USHORT& nNewOffset, USHORT nOffsetTol ) +void ScHTMLLayoutParser::ModifyOffset( ScHTMLColOffset* pOffset, sal_uInt16& nOldOffset, + sal_uInt16& nNewOffset, sal_uInt16 nOffsetTol ) { DBG_ASSERT( pOffset, "ScHTMLLayoutParser::ModifyOffset - illegal call" ); SCCOL nPos; if ( !SeekOffset( pOffset, nOldOffset, &nPos, nOffsetTol ) ) { if ( SeekOffset( pOffset, nNewOffset, &nPos, nOffsetTol ) ) - nNewOffset = (USHORT)(*pOffset)[nPos]; + nNewOffset = (sal_uInt16)(*pOffset)[nPos]; else pOffset->Insert( nNewOffset ); return ; } - nOldOffset = (USHORT)(*pOffset)[nPos]; + nOldOffset = (sal_uInt16)(*pOffset)[nPos]; SCCOL nPos2; if ( SeekOffset( pOffset, nNewOffset, &nPos2, nOffsetTol ) ) { - nNewOffset = (USHORT)(*pOffset)[nPos2]; + nNewOffset = (sal_uInt16)(*pOffset)[nPos2]; return ; } - ULONG* pData = ((ULONG*) pOffset->GetData()) + nPos; //! QAD + sal_uLong* pData = ((sal_uLong*) pOffset->GetData()) + nPos; //! QAD long nDiff = nNewOffset - nOldOffset; if ( nDiff < 0 ) { - const ULONG* pStop = pOffset->GetData(); + const sal_uLong* pStop = pOffset->GetData(); do { *pData += nDiff; @@ -350,7 +350,7 @@ void ScHTMLLayoutParser::ModifyOffset( ScHTMLColOffset* pOffset, USHORT& nOldOff } else { - const ULONG* pStop = pOffset->GetData() + pOffset->Count(); + const sal_uLong* pStop = pOffset->GetData() + pOffset->Count(); do { *pData += nDiff; @@ -359,17 +359,17 @@ void ScHTMLLayoutParser::ModifyOffset( ScHTMLColOffset* pOffset, USHORT& nOldOff } -void ScHTMLLayoutParser::SkipLocked( ScEEParseEntry* pE, BOOL bJoin ) +void ScHTMLLayoutParser::SkipLocked( ScEEParseEntry* pE, sal_Bool bJoin ) { if ( ValidCol(pE->nCol) ) { // wuerde sonst bei ScAddress falschen Wert erzeugen, evtl. Endlosschleife! - BOOL bBadCol = FALSE; - BOOL bAgain; + sal_Bool bBadCol = false; + sal_Bool bAgain; ScRange aRange( pE->nCol, pE->nRow, 0, pE->nCol + pE->nColOverlap - 1, pE->nRow + pE->nRowOverlap - 1, 0 ); do { - bAgain = FALSE; + bAgain = false; for ( size_t i = 0, nRanges = xLockedList->size(); i < nRanges; ++i ) { ScRange* pR = (*xLockedList)[i]; @@ -378,10 +378,10 @@ void ScHTMLLayoutParser::SkipLocked( ScEEParseEntry* pE, BOOL bJoin ) pE->nCol = pR->aEnd.Col() + 1; SCCOL nTmp = pE->nCol + pE->nColOverlap - 1; if ( pE->nCol > MAXCOL || nTmp > MAXCOL ) - bBadCol = TRUE; + bBadCol = sal_True; else { - bAgain = TRUE; + bAgain = sal_True; aRange.aStart.SetCol( pE->nCol ); aRange.aEnd.SetCol( nTmp ); } @@ -401,11 +401,11 @@ void ScHTMLLayoutParser::Adjust() ScHTMLAdjustStack aStack; ScHTMLAdjustStackEntry* pS; - USHORT nTab = 0; + sal_uInt16 nTab = 0; SCCOL nLastCol = SCCOL_MAX; SCROW nNextRow = 0; SCROW nCurRow = 0; - USHORT nPageWidth = (USHORT) aPageSize.Width(); + sal_uInt16 nPageWidth = (sal_uInt16) aPageSize.Width(); Table* pTab = NULL; for ( size_t i = 0, nListSize = maList.size(); i < nListSize; ++i ) { @@ -431,7 +431,7 @@ void ScHTMLLayoutParser::Adjust() else nCurRow = nNextRow = pE->nRow; SCROW nR; - if ( pTab && ((nR = (SCROW)(ULONG)pTab->Get( nCurRow )) != 0) ) + if ( pTab && ((nR = (SCROW)(sal_uLong)pTab->Get( nCurRow )) != 0) ) nNextRow += nR; else nNextRow++; @@ -447,7 +447,7 @@ void ScHTMLLayoutParser::Adjust() pTab = (pTables ? (Table*) pTables->Get( nTab ) : NULL); // neuer Zeilenabstand SCROW nR; - if ( pTab && ((nR = (SCROW)(ULONG)pTab->Get( nCurRow )) != 0) ) + if ( pTab && ((nR = (SCROW)(sal_uLong)pTab->Get( nCurRow )) != 0) ) nNextRow = nCurRow + nR; else nNextRow = nCurRow + 1; @@ -461,7 +461,7 @@ void ScHTMLLayoutParser::Adjust() SCROW nRowSpan = pE->nRowOverlap; for ( SCROW j=0; j < nRowSpan; j++ ) { // aus merged Zeilen resultierendes RowSpan - SCROW nRows = (SCROW)(ULONG)pTab->Get( nRow+j ); + SCROW nRows = (SCROW)(sal_uLong)pTab->Get( nRow+j ); if ( nRows > 1 ) { pE->nRowOverlap += nRows - 1; @@ -478,18 +478,18 @@ void ScHTMLLayoutParser::Adjust() // echte Col SeekOffset( pColOffset, pE->nOffset, &pE->nCol, nOffsetTolerance ); SCCOL nColBeforeSkip = pE->nCol; - SkipLocked( pE, FALSE ); + SkipLocked( pE, false ); if ( pE->nCol != nColBeforeSkip ) { SCCOL nCount = (SCCOL)pColOffset->Count(); if ( nCount <= pE->nCol ) { - pE->nOffset = (USHORT) (*pColOffset)[nCount-1]; + pE->nOffset = (sal_uInt16) (*pColOffset)[nCount-1]; MakeCol( pColOffset, pE->nOffset, pE->nWidth, nOffsetTolerance, nOffsetTolerance ); } else { - pE->nOffset = (USHORT) (*pColOffset)[pE->nCol]; + pE->nOffset = (sal_uInt16) (*pColOffset)[pE->nCol]; } } SCCOL nPos; @@ -515,7 +515,7 @@ void ScHTMLLayoutParser::Adjust() } -USHORT ScHTMLLayoutParser::GetWidth( ScEEParseEntry* pE ) +sal_uInt16 ScHTMLLayoutParser::GetWidth( ScEEParseEntry* pE ) { if ( pE->nWidth ) return pE->nWidth; @@ -523,7 +523,7 @@ USHORT ScHTMLLayoutParser::GetWidth( ScEEParseEntry* pE ) nColCntStart + pE->nColOverlap), static_cast<sal_Int32>( pLocalColOffset->Count() - 1)); SCCOL nPos = (nTmp < 0 ? 0 : static_cast<SCCOL>(nTmp)); - USHORT nOff2 = (USHORT) (*pLocalColOffset)[nPos]; + sal_uInt16 nOff2 = (sal_uInt16) (*pLocalColOffset)[nPos]; if ( pE->nOffset < nOff2 ) return nOff2 - pE->nOffset; return 0; @@ -535,26 +535,26 @@ void ScHTMLLayoutParser::SetWidths() ScEEParseEntry* pE; SCCOL nCol; if ( !nTableWidth ) - nTableWidth = (USHORT) aPageSize.Width(); + nTableWidth = (sal_uInt16) aPageSize.Width(); SCCOL nColsPerRow = nMaxCol - nColCntStart; if ( nColsPerRow <= 0 ) nColsPerRow = 1; if ( pLocalColOffset->Count() <= 2 ) { // nur PageSize, es gab keine Width-Angabe - USHORT nWidth = nTableWidth / static_cast<USHORT>(nColsPerRow); - USHORT nOff = nColOffsetStart; - pLocalColOffset->Remove( (USHORT)0, pLocalColOffset->Count() ); + sal_uInt16 nWidth = nTableWidth / static_cast<sal_uInt16>(nColsPerRow); + sal_uInt16 nOff = nColOffsetStart; + pLocalColOffset->Remove( (sal_uInt16)0, pLocalColOffset->Count() ); for ( nCol = 0; nCol <= nColsPerRow; ++nCol, nOff = nOff + nWidth ) { MakeColNoRef( pLocalColOffset, nOff, 0, 0, 0 ); } - nTableWidth = (USHORT)((*pLocalColOffset)[pLocalColOffset->Count() -1 ] - (*pLocalColOffset)[0]); + nTableWidth = (sal_uInt16)((*pLocalColOffset)[pLocalColOffset->Count() -1 ] - (*pLocalColOffset)[0]); for ( size_t i = nFirstTableCell, nListSize = maList.size(); i < nListSize; ++i ) { pE = maList[ i ]; if ( pE->nTab == nTable ) { - pE->nOffset = (USHORT) (*pLocalColOffset)[pE->nCol - nColCntStart]; + pE->nOffset = (sal_uInt16) (*pLocalColOffset)[pE->nCol - nColCntStart]; pE->nWidth = 0; // to be recalculated later } } @@ -564,10 +564,10 @@ void ScHTMLLayoutParser::SetWidths() // wieso eigentlich kein pE ?!? if ( nFirstTableCell < maList.size() ) { - USHORT* pOffsets = new USHORT[ nColsPerRow+1 ]; - memset( pOffsets, 0, (nColsPerRow+1) * sizeof(USHORT) ); - USHORT* pWidths = new USHORT[ nColsPerRow ]; - memset( pWidths, 0, nColsPerRow * sizeof(USHORT) ); + sal_uInt16* pOffsets = new sal_uInt16[ nColsPerRow+1 ]; + memset( pOffsets, 0, (nColsPerRow+1) * sizeof(sal_uInt16) ); + sal_uInt16* pWidths = new sal_uInt16[ nColsPerRow ]; + memset( pWidths, 0, nColsPerRow * sizeof(sal_uInt16) ); pOffsets[0] = nColOffsetStart; for ( size_t i = nFirstTableCell, nListSize = maList.size(); i < nListSize; ++i ) { @@ -584,8 +584,8 @@ void ScHTMLLayoutParser::SetWidths() } else { // try to find a single undefined width - USHORT nTotal = 0; - BOOL bFound = FALSE; + sal_uInt16 nTotal = 0; + sal_Bool bFound = false; SCCOL nHere = 0; SCCOL nStop = Min( static_cast<SCCOL>(nCol + pE->nColOverlap), nColsPerRow ); for ( ; nCol < nStop; nCol++ ) @@ -596,10 +596,10 @@ void ScHTMLLayoutParser::SetWidths() { if ( bFound ) { - bFound = FALSE; + bFound = false; break; // for } - bFound = TRUE; + bFound = sal_True; nHere = nCol; } } @@ -609,8 +609,8 @@ void ScHTMLLayoutParser::SetWidths() } } } - USHORT nWidths = 0; - USHORT nUnknown = 0; + sal_uInt16 nWidths = 0; + sal_uInt16 nUnknown = 0; for ( nCol = 0; nCol < nColsPerRow; nCol++ ) { if ( pWidths[nCol] ) @@ -620,7 +620,7 @@ void ScHTMLLayoutParser::SetWidths() } if ( nUnknown ) { - USHORT nW = ((nWidths < nTableWidth) ? + sal_uInt16 nW = ((nWidths < nTableWidth) ? ((nTableWidth - nWidths) / nUnknown) : (nTableWidth / nUnknown)); for ( nCol = 0; nCol < nColsPerRow; nCol++ ) @@ -633,7 +633,7 @@ void ScHTMLLayoutParser::SetWidths() { pOffsets[nCol] = pOffsets[nCol-1] + pWidths[nCol-1]; } - pLocalColOffset->Remove( (USHORT)0, pLocalColOffset->Count() ); + pLocalColOffset->Remove( (sal_uInt16)0, pLocalColOffset->Count() ); for ( nCol = 0; nCol <= nColsPerRow; nCol++ ) { MakeColNoRef( pLocalColOffset, pOffsets[nCol], 0, 0, 0 ); @@ -664,7 +664,7 @@ void ScHTMLLayoutParser::SetWidths() } if ( pLocalColOffset->Count() ) { - USHORT nMax = (USHORT) (*pLocalColOffset)[pLocalColOffset->Count() - 1]; + sal_uInt16 nMax = (sal_uInt16) (*pLocalColOffset)[pLocalColOffset->Count() - 1]; if ( aPageSize.Width() < nMax ) aPageSize.Width() = nMax; } @@ -698,12 +698,12 @@ void ScHTMLLayoutParser::Colonize( ScEEParseEntry* pE ) nCol = pE->nCol - nColCntStart; SCCOL nCount = static_cast<SCCOL>(pLocalColOffset->Count()); if ( nCol < nCount ) - nColOffset = (USHORT) (*pLocalColOffset)[nCol]; + nColOffset = (sal_uInt16) (*pLocalColOffset)[nCol]; else - nColOffset = (USHORT) (*pLocalColOffset)[nCount - 1]; + nColOffset = (sal_uInt16) (*pLocalColOffset)[nCount - 1]; } pE->nOffset = nColOffset; - USHORT nWidth = GetWidth( pE ); + sal_uInt16 nWidth = GetWidth( pE ); MakeCol( pLocalColOffset, pE->nOffset, nWidth, nOffsetTolerance, nOffsetTolerance ); if ( pE->nWidth ) pE->nWidth = nWidth; @@ -715,10 +715,10 @@ void ScHTMLLayoutParser::Colonize( ScEEParseEntry* pE ) void ScHTMLLayoutParser::CloseEntry( ImportInfo* pInfo ) { - bInCell = FALSE; + bInCell = false; if ( bTabInTabCell ) { // in TableOff vom Stack geholt - bTabInTabCell = FALSE; + bTabInTabCell = false; bool found = false; for ( size_t i = 0, nListSize = maList.size(); i < nListSize; ++i ) { @@ -734,7 +734,7 @@ void ScHTMLLayoutParser::CloseEntry( ImportInfo* pInfo ) return ; } if ( pActEntry->nTab == 0 ) - pActEntry->nWidth = (USHORT) aPageSize.Width(); + pActEntry->nWidth = (sal_uInt16) aPageSize.Width(); Colonize( pActEntry ); nColCnt = pActEntry->nCol + pActEntry->nColOverlap; if ( nMaxCol < nColCnt ) @@ -759,7 +759,7 @@ void ScHTMLLayoutParser::CloseEntry( ImportInfo* pInfo ) rSel.nEndPara = rSel.nStartPara; } if ( rSel.HasRange() ) - pActEntry->aItemSet.Put( SfxBoolItem( ATTR_LINEBREAK, TRUE ) ); + pActEntry->aItemSet.Put( SfxBoolItem( ATTR_LINEBREAK, true ) ); maList.push_back( pActEntry ); NewActEntry( pActEntry ); // neuer freifliegender pActEntry } @@ -783,9 +783,9 @@ IMPL_LINK( ScHTMLLayoutParser, HTMLImportHdl, ImportInfo*, pInfo ) // If text remains: create paragraph, without calling CloseEntry(). if( bInCell ) // ...but only in opened table cells. { - bInCell = FALSE; + bInCell = false; NextRow( pInfo ); - bInCell = TRUE; + bInCell = sal_True; } CloseEntry( pInfo ); } @@ -848,11 +848,11 @@ void ScHTMLLayoutParser::TableDataOn( ImportInfo* pInfo ) OSL_FAIL( "Dummbatz-Dok! <TH> oder <TD> ohne vorheriges <TABLE>" ); TableOn( pInfo ); } - bInCell = TRUE; - BOOL bHorJustifyCenterTH = (pInfo->nToken == HTML_TABLEHEADER_ON); + bInCell = sal_True; + sal_Bool bHorJustifyCenterTH = (pInfo->nToken == HTML_TABLEHEADER_ON); const HTMLOptions* pOptions = ((HTMLParser*)pInfo->pParser)->GetOptions(); - USHORT nArrLen = pOptions->Count(); - for ( USHORT i = 0; i < nArrLen; i++ ) + sal_uInt16 nArrLen = pOptions->Count(); + for ( sal_uInt16 i = 0; i < nArrLen; i++ ) { const HTMLOption* pOption = (*pOptions)[i]; switch( pOption->GetToken() ) @@ -869,7 +869,7 @@ void ScHTMLLayoutParser::TableDataOn( ImportInfo* pInfo ) break; case HTML_O_ALIGN: { - bHorJustifyCenterTH = FALSE; + bHorJustifyCenterTH = false; SvxCellHorJustify eVal; const String& rOptVal = pOption->GetString(); if ( rOptVal.CompareIgnoreCaseToAscii( OOO_STRING_SVTOOLS_HTML_AL_right ) == COMPARE_EQUAL ) @@ -961,25 +961,25 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo ) if ( ++nTableLevel > 1 ) { // Table in Table - USHORT nTmpColOffset = nColOffset; // wird in Colonize noch angepasst + sal_uInt16 nTmpColOffset = nColOffset; // wird in Colonize noch angepasst Colonize( pActEntry ); aTableStack.Push( new ScHTMLTableStackEntry( pActEntry, xLockedList, pLocalColOffset, nFirstTableCell, nColCnt, nRowCnt, nColCntStart, nMaxCol, nTable, nTableWidth, nColOffset, nColOffsetStart, bFirstRow ) ); - USHORT nLastWidth = nTableWidth; + sal_uInt16 nLastWidth = nTableWidth; nTableWidth = GetWidth( pActEntry ); if ( nTableWidth == nLastWidth && nMaxCol - nColCntStart > 1 ) { // es muss mehr als einen geben, also kann dieser nicht alles sein - nTableWidth = nLastWidth / static_cast<USHORT>((nMaxCol - nColCntStart)); + nTableWidth = nLastWidth / static_cast<sal_uInt16>((nMaxCol - nColCntStart)); } nLastWidth = nTableWidth; if ( pInfo->nToken == HTML_TABLE_ON ) { // es kann auch TD oder TH sein, wenn es vorher kein TABLE gab const HTMLOptions* pOptions = ((HTMLParser*)pInfo->pParser)->GetOptions(); - USHORT nArrLen = pOptions->Count(); - for ( USHORT i = 0; i < nArrLen; i++ ) + sal_uInt16 nArrLen = pOptions->Count(); + for ( sal_uInt16 i = 0; i < nArrLen; i++ ) { const HTMLOption* pOption = (*pOptions)[i]; switch( pOption->GetToken() ) @@ -998,15 +998,15 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo ) } } } - bInCell = FALSE; + bInCell = false; if ( bTabInTabCell && !(nTableWidth < nLastWidth) ) { // mehrere Tabellen in einer Zelle, untereinander - bTabInTabCell = FALSE; + bTabInTabCell = false; NextRow( pInfo ); } else { // in dieser Zelle geht's los, oder nebeneinander - bTabInTabCell = FALSE; + bTabInTabCell = false; nColCntStart = nColCnt; nColOffset = nTmpColOffset; nColOffsetStart = nColOffset; @@ -1036,8 +1036,8 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo ) if ( pInfo->nToken == HTML_TABLE_ON ) { // es kann auch TD oder TH sein, wenn es vorher kein TABLE gab const HTMLOptions* pOptions = ((HTMLParser*)pInfo->pParser)->GetOptions(); - USHORT nArrLen = pOptions->Count(); - for ( USHORT i = 0; i < nArrLen; i++ ) + sal_uInt16 nArrLen = pOptions->Count(); + for ( sal_uInt16 i = 0; i < nArrLen; i++ ) { const HTMLOption* pOption = (*pOptions)[i]; switch( pOption->GetToken() ) @@ -1058,7 +1058,7 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo ) } } nTable = ++nMaxTable; - bFirstRow = TRUE; + bFirstRow = true; nFirstTableCell = maList.size(); pLocalColOffset = new ScHTMLColOffset; @@ -1087,7 +1087,7 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo ) if ( nRows > 1 ) { // Groesse der Tabelle an dieser Position eintragen SCROW nRow = pS->nRowCnt; - USHORT nTab = pS->nTable; + sal_uInt16 nTab = pS->nTable; if ( !pTables ) pTables = new Table; // Hoehen der aeusseren Table @@ -1127,8 +1127,8 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo ) { // aussen for ( SCROW j=0; j < nRowSpan; j++ ) { - ULONG nRowKey = nRow + j; - SCROW nR = (SCROW)(ULONG)pTab1->Get( nRowKey ); + sal_uLong nRowKey = nRow + j; + SCROW nR = (SCROW)(sal_uLong)pTab1->Get( nRowKey ); if ( !nR ) pTab1->Insert( nRowKey, (void*)(sal_IntPtr)nRowsPerRow1 ); else if ( nRowsPerRow1 > nR ) @@ -1141,7 +1141,7 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo ) nR += nAdd; if ( (nR % nRows) == 0 ) { // nur wenn abbildbar - SCROW nR2 = (SCROW)(ULONG)pTab1->Get( nRowKey+1 ); + SCROW nR2 = (SCROW)(sal_uLong)pTab1->Get( nRowKey+1 ); if ( nR2 > nAdd ) { // nur wenn wirklich Platz pTab1->Replace( nRowKey, (void*)(sal_IntPtr)nR ); @@ -1161,8 +1161,8 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo ) } for ( SCROW j=0; j < nRows; j++ ) { - ULONG nRowKey = nRow + j; - SCROW nR = (SCROW)(ULONG)pTab2->Get( nRowKey ); + sal_uLong nRowKey = nRow + j; + SCROW nR = (SCROW)(sal_uLong)pTab2->Get( nRowKey ); if ( !nR ) pTab2->Insert( nRowKey, (void*)(sal_IntPtr)nRowsPerRow2 ); else if ( nRowsPerRow2 > nR ) @@ -1178,10 +1178,10 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo ) pE->nWidth = nTableWidth; else if ( pE->nWidth < nTableWidth ) { - USHORT nOldOffset = pE->nOffset + pE->nWidth; - USHORT nNewOffset = pE->nOffset + nTableWidth; + sal_uInt16 nOldOffset = pE->nOffset + pE->nWidth; + sal_uInt16 nNewOffset = pE->nOffset + nTableWidth; ModifyOffset( pS->pLocalColOffset, nOldOffset, nNewOffset, nOffsetTolerance ); - USHORT nTmp = nNewOffset - pE->nOffset - pE->nWidth; + sal_uInt16 nTmp = nNewOffset - pE->nOffset - pE->nWidth; pE->nWidth = nNewOffset - pE->nOffset; pS->nTableWidth = pS->nTableWidth + nTmp; if ( pS->nColOffset >= nOldOffset ) @@ -1209,8 +1209,8 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo ) pActEntry = pE; delete pS; } - bTabInTabCell = TRUE; - bInCell = TRUE; + bTabInTabCell = sal_True; + bInCell = sal_True; } else { // einfache Table beendet @@ -1234,8 +1234,8 @@ void ScHTMLLayoutParser::Image( ImportInfo* pInfo ) ScHTMLImage* pImage = new ScHTMLImage; pActEntry->maImageList.push_back( pImage ); const HTMLOptions* pOptions = ((HTMLParser*)pInfo->pParser)->GetOptions(); - USHORT nArrLen = pOptions->Count(); - for ( USHORT i = 0; i < nArrLen; i++ ) + sal_uInt16 nArrLen = pOptions->Count(); + for ( sal_uInt16 i = 0; i < nArrLen; i++ ) { const HTMLOption* pOption = (*pOptions)[i]; switch( pOption->GetToken() ) @@ -1283,7 +1283,7 @@ void ScHTMLLayoutParser::Image( ImportInfo* pInfo ) return ; } - USHORT nFormat; + sal_uInt16 nFormat; Graphic* pGraphic = new Graphic; GraphicFilter* pFilter = GraphicFilter::GetGraphicFilter(); if ( GRFILTER_OK != GraphicFilter::LoadGraphic( pImage->aURL, pImage->aFilterName, @@ -1294,7 +1294,7 @@ void ScHTMLLayoutParser::Image( ImportInfo* pInfo ) } if ( !pActEntry->bHasGraphic ) { // discard any ALT text in this cell if we have any image - pActEntry->bHasGraphic = TRUE; + pActEntry->bHasGraphic = sal_True; pActEntry->aAltText.Erase(); } pImage->aFilterName = pFilter->GetImportFormatName( nFormat ); @@ -1327,15 +1327,15 @@ void ScHTMLLayoutParser::Image( ImportInfo* pInfo ) void ScHTMLLayoutParser::ColOn( ImportInfo* pInfo ) { const HTMLOptions* pOptions = ((HTMLParser*)pInfo->pParser)->GetOptions(); - USHORT nArrLen = pOptions->Count(); - for ( USHORT i = 0; i < nArrLen; i++ ) + sal_uInt16 nArrLen = pOptions->Count(); + for ( sal_uInt16 i = 0; i < nArrLen; i++ ) { const HTMLOption* pOption = (*pOptions)[i]; switch( pOption->GetToken() ) { case HTML_O_WIDTH: { - USHORT nVal = GetWidthPixel( pOption ); + sal_uInt16 nVal = GetWidthPixel( pOption ); MakeCol( pLocalColOffset, nColOffset, nVal, 0, 0 ); nColOffset = nColOffset + nVal; } @@ -1345,13 +1345,13 @@ void ScHTMLLayoutParser::ColOn( ImportInfo* pInfo ) } -USHORT ScHTMLLayoutParser::GetWidthPixel( const HTMLOption* pOption ) +sal_uInt16 ScHTMLLayoutParser::GetWidthPixel( const HTMLOption* pOption ) { const String& rOptVal = pOption->GetString(); if ( rOptVal.Search('%') != STRING_NOTFOUND ) { // Prozent - USHORT nW = (nTableWidth ? nTableWidth : (USHORT) aPageSize.Width()); - return (USHORT)((pOption->GetNumber() * nW) / 100); + sal_uInt16 nW = (nTableWidth ? nTableWidth : (sal_uInt16) aPageSize.Width()); + return (sal_uInt16)((pOption->GetNumber() * nW) / 100); } else { @@ -1361,7 +1361,7 @@ USHORT ScHTMLLayoutParser::GetWidthPixel( const HTMLOption* pOption ) return 0; } else - return (USHORT)pOption->GetNumber(); // Pixel + return (sal_uInt16)pOption->GetNumber(); // Pixel } } @@ -1369,8 +1369,8 @@ USHORT ScHTMLLayoutParser::GetWidthPixel( const HTMLOption* pOption ) void ScHTMLLayoutParser::AnchorOn( ImportInfo* pInfo ) { const HTMLOptions* pOptions = ((HTMLParser*)pInfo->pParser)->GetOptions(); - USHORT nArrLen = pOptions->Count(); - for ( USHORT i = 0; i < nArrLen; i++ ) + sal_uInt16 nArrLen = pOptions->Count(); + for ( sal_uInt16 i = 0; i < nArrLen; i++ ) { const HTMLOption* pOption = (*pOptions)[i]; switch( pOption->GetToken() ) @@ -1385,7 +1385,7 @@ void ScHTMLLayoutParser::AnchorOn( ImportInfo* pInfo ) } -BOOL ScHTMLLayoutParser::IsAtBeginningOfText( ImportInfo* pInfo ) +sal_Bool ScHTMLLayoutParser::IsAtBeginningOfText( ImportInfo* pInfo ) { ESelection& rSel = pActEntry->aSel; return rSel.nStartPara == rSel.nEndPara && @@ -1399,8 +1399,8 @@ void ScHTMLLayoutParser::FontOn( ImportInfo* pInfo ) if ( IsAtBeginningOfText( pInfo ) ) { // nur am Anfang des Textes, gilt dann fuer gesamte Zelle const HTMLOptions* pOptions = ((HTMLParser*)pInfo->pParser)->GetOptions(); - USHORT nArrLen = pOptions->Count(); - for ( USHORT i = 0; i < nArrLen; i++ ) + sal_uInt16 nArrLen = pOptions->Count(); + for ( sal_uInt16 i = 0; i < nArrLen; i++ ) { const HTMLOption* pOption = (*pOptions)[i]; switch( pOption->GetToken() ) @@ -1426,7 +1426,7 @@ void ScHTMLLayoutParser::FontOn( ImportInfo* pInfo ) break; case HTML_O_SIZE : { - USHORT nSize = (USHORT) pOption->GetNumber(); + sal_uInt16 nSize = (sal_uInt16) pOption->GetNumber(); if ( nSize == 0 ) nSize = 1; else if ( nSize > SC_HTML_FONTSIZES ) @@ -1450,7 +1450,7 @@ void ScHTMLLayoutParser::FontOn( ImportInfo* pInfo ) void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo ) { - BOOL bSetLastToken = TRUE; + sal_Bool bSetLastToken = sal_True; switch ( pInfo->nToken ) { case HTML_META: @@ -1465,7 +1465,7 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo ) break; case HTML_TITLE_ON: { - bInTitle = TRUE; + bInTitle = sal_True; aString.Erase(); } break; @@ -1481,7 +1481,7 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo ) uno::UNO_QUERY_THROW); xDPS->getDocumentProperties()->setTitle(aString); } - bInTitle = FALSE; + bInTitle = false; } break; case HTML_TABLE_ON: @@ -1498,7 +1498,7 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo ) { if ( bInCell ) CloseEntry( pInfo ); - // bInCell nicht TRUE setzen, das macht TableDataOn + // bInCell nicht sal_True setzen, das macht TableDataOn pActEntry->aItemSet.Put( SvxWeightItem( WEIGHT_BOLD, ATTR_FONT_WEIGHT) ); } // fall thru @@ -1612,7 +1612,7 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo ) break; default: { // nLastToken nicht setzen! - bSetLastToken = FALSE; + bSetLastToken = false; } } if ( bSetLastToken ) @@ -2731,7 +2731,7 @@ ScHTMLQueryParser::~ScHTMLQueryParser() { } -ULONG ScHTMLQueryParser::Read( SvStream& rStrm, const String& rBaseURL ) +sal_uLong ScHTMLQueryParser::Read( SvStream& rStrm, const String& rBaseURL ) { SvKeyValueIteratorRef xValues; SvKeyValueIterator* pAttributes = 0; @@ -2759,7 +2759,7 @@ ULONG ScHTMLQueryParser::Read( SvStream& rStrm, const String& rBaseURL ) Link aOldLink = pEdit->GetImportHdl(); pEdit->SetImportHdl( LINK( this, ScHTMLQueryParser, HTMLImportHdl ) ); - ULONG nErr = pEdit->Read( rStrm, rBaseURL, EE_FORMAT_HTML, pAttributes ); + sal_uLong nErr = pEdit->Read( rStrm, rBaseURL, EE_FORMAT_HTML, pAttributes ); pEdit->SetImportHdl( aOldLink ); mxGlobTable->Recalc(); |