diff options
Diffstat (limited to 'sc/source/filter/html/htmlpars.cxx')
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 274 |
1 files changed, 137 insertions, 137 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index 85e77fc3124b..8e9fbc046f02 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -69,7 +69,7 @@ using namespace ::com::sun::star; -SV_IMPL_VARARR_SORT( ScHTMLColOffset, ULONG ); +SV_IMPL_VARARR_SORT( ScHTMLColOffset, sal_uLong ); // ============================================================================ @@ -111,10 +111,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( sal_False ), + bFirstRow( sal_True ), + bInCell( sal_False ), + bInTitle( sal_False ) { MakeColNoRef( pLocalColOffset, 0, 0, 0, 0 ); MakeColNoRef( pColOffset, 0, 0, 0, 0 ); @@ -145,13 +145,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; @@ -174,17 +174,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 ) ); @@ -242,61 +242,61 @@ void ScHTMLLayoutParser::NextRow( ImportInfo* pInfo ) nRowMax = nRowCnt; nColCnt = nColCntStart; nColOffset = nColOffsetStart; - bFirstRow = FALSE; + bFirstRow = sal_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 sal_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 sal_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 ) @@ -307,31 +307,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; @@ -339,7 +339,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; @@ -348,17 +348,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 = sal_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 = sal_False; for ( ScRange* pR = xLockedList->First(); pR; pR = xLockedList->Next() ) { if ( pR->Intersects( aRange ) ) @@ -366,10 +366,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 ); } @@ -390,11 +390,11 @@ void ScHTMLLayoutParser::Adjust() xLockedList->Clear(); 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 ( ScEEParseEntry* pE = pList->First(); pE; pE = pList->Next() ) { @@ -419,7 +419,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++; @@ -435,7 +435,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; @@ -449,7 +449,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; @@ -466,18 +466,18 @@ void ScHTMLLayoutParser::Adjust() // echte Col SeekOffset( pColOffset, pE->nOffset, &pE->nCol, nOffsetTolerance ); SCCOL nColBeforeSkip = pE->nCol; - SkipLocked( pE, FALSE ); + SkipLocked( pE, sal_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; @@ -503,7 +503,7 @@ void ScHTMLLayoutParser::Adjust() } -USHORT ScHTMLLayoutParser::GetWidth( ScEEParseEntry* pE ) +sal_uInt16 ScHTMLLayoutParser::GetWidth( ScEEParseEntry* pE ) { if ( pE->nWidth ) return pE->nWidth; @@ -511,7 +511,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; @@ -523,26 +523,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]); pE = pList->Seek( nFirstTableCell ); while ( pE ) { 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 } pE = pList->Next(); @@ -554,10 +554,10 @@ void ScHTMLLayoutParser::SetWidths() // #36350# wieso eigentlich kein pE ?!? if ( pE ) { - 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; while ( pE ) { @@ -573,8 +573,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 = sal_False; SCCOL nHere = 0; SCCOL nStop = Min( static_cast<SCCOL>(nCol + pE->nColOverlap), nColsPerRow ); for ( ; nCol < nStop; nCol++ ) @@ -585,10 +585,10 @@ void ScHTMLLayoutParser::SetWidths() { if ( bFound ) { - bFound = FALSE; + bFound = sal_False; break; // for } - bFound = TRUE; + bFound = sal_True; nHere = nCol; } } @@ -599,8 +599,8 @@ void ScHTMLLayoutParser::SetWidths() } pE = pList->Next(); } - USHORT nWidths = 0; - USHORT nUnknown = 0; + sal_uInt16 nWidths = 0; + sal_uInt16 nUnknown = 0; for ( nCol = 0; nCol < nColsPerRow; nCol++ ) { if ( pWidths[nCol] ) @@ -610,7 +610,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++ ) @@ -623,7 +623,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 ); @@ -655,7 +655,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; } @@ -690,12 +690,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; @@ -707,17 +707,17 @@ void ScHTMLLayoutParser::Colonize( ScEEParseEntry* pE ) void ScHTMLLayoutParser::CloseEntry( ImportInfo* pInfo ) { - bInCell = FALSE; + bInCell = sal_False; if ( bTabInTabCell ) { // in TableOff vom Stack geholt - bTabInTabCell = FALSE; + bTabInTabCell = sal_False; if ( pList->GetPos( pActEntry ) == LIST_ENTRY_NOTFOUND ) delete pActEntry; NewActEntry( pList->Last() ); // neuer freifliegender pActEntry 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 ) @@ -742,7 +742,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, sal_True ) ); pList->Insert( pActEntry, LIST_APPEND ); NewActEntry( pActEntry ); // neuer freifliegender pActEntry } @@ -754,9 +754,9 @@ IMPL_LINK( ScHTMLLayoutParser, HTMLImportHdl, ImportInfo*, pInfo ) static ESelection aDebugSel; static String aDebugStr; static SvFileStream* pDebugStrm = NULL; - static ULONG nDebugStrmPos = 0; - static ULONG nDebugCount = 0; - static ULONG nDebugCountAll = 0; + static sal_uLong nDebugStrmPos = 0; + static sal_uLong nDebugCount = 0; + static sal_uLong nDebugCountAll = 0; static const sal_Char* sDebugState[15] = { "RTFIMP_START", "RTFIMP_END", "RTFIMP_NEXTTOKEN", "RTFIMP_UNKNOWNATTR", @@ -800,7 +800,7 @@ IMPL_LINK( ScHTMLLayoutParser, HTMLImportHdl, ImportInfo*, pInfo ) SvFileStream& rS = *pDebugStrm; rS.WriteNumber( nDebugCountAll ); rS << ".: "; rS.WriteNumber( nDebugCount ); rS << ". State: "; - rS.WriteNumber( (USHORT) pInfo->eState ); + rS.WriteNumber( (sal_uInt16) pInfo->eState ); rS << ' ' << sDebugState[pInfo->eState] << endl; rS << "SPar,SPos EPar,EPos: "; rS.WriteNumber( aDebugSel.nStartPara ); rS << ','; @@ -865,9 +865,9 @@ IMPL_LINK( ScHTMLLayoutParser, HTMLImportHdl, ImportInfo*, pInfo ) // If text remains: create paragraph, without calling CloseEntry(). if( bInCell ) // #108269# ...but only in opened table cells. { - bInCell = FALSE; + bInCell = sal_False; NextRow( pInfo ); - bInCell = TRUE; + bInCell = sal_True; } CloseEntry( pInfo ); } @@ -930,11 +930,11 @@ void ScHTMLLayoutParser::TableDataOn( ImportInfo* pInfo ) DBG_ERROR( "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() ) @@ -951,7 +951,7 @@ void ScHTMLLayoutParser::TableDataOn( ImportInfo* pInfo ) break; case HTML_O_ALIGN: { - bHorJustifyCenterTH = FALSE; + bHorJustifyCenterTH = sal_False; SvxCellHorJustify eVal; const String& rOptVal = pOption->GetString(); if ( rOptVal.CompareIgnoreCaseToAscii( OOO_STRING_SVTOOLS_HTML_AL_right ) == COMPARE_EQUAL ) @@ -1044,25 +1044,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() ) @@ -1081,15 +1081,15 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo ) } } } - bInCell = FALSE; + bInCell = sal_False; if ( bTabInTabCell && !(nTableWidth < nLastWidth) ) { // mehrere Tabellen in einer Zelle, untereinander - bTabInTabCell = FALSE; + bTabInTabCell = sal_False; NextRow( pInfo ); } else { // in dieser Zelle geht's los, oder nebeneinander - bTabInTabCell = FALSE; + bTabInTabCell = sal_False; nColCntStart = nColCnt; nColOffset = nTmpColOffset; nColOffsetStart = nColOffset; @@ -1119,8 +1119,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() ) @@ -1141,7 +1141,7 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo ) } } nTable = ++nMaxTable; - bFirstRow = TRUE; + bFirstRow = sal_True; nFirstTableCell = pList->Count(); pLocalColOffset = new ScHTMLColOffset; @@ -1170,7 +1170,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 @@ -1210,8 +1210,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*) nRowsPerRow1 ); else if ( nRowsPerRow1 > nR ) @@ -1224,7 +1224,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*) nR ); @@ -1244,8 +1244,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*) nRowsPerRow2 ); else if ( nRowsPerRow2 > nR ) @@ -1261,10 +1261,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 ) @@ -1292,8 +1292,8 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo ) pActEntry = pE; delete pS; } - bTabInTabCell = TRUE; - bInCell = TRUE; + bTabInTabCell = sal_True; + bInCell = sal_True; } else { // einfache Table beendet @@ -1320,8 +1320,8 @@ void ScHTMLLayoutParser::Image( ImportInfo* pInfo ) ScHTMLImage* pImage = new ScHTMLImage; pIL->Insert( pImage, LIST_APPEND ); 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() ) @@ -1369,7 +1369,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, @@ -1380,7 +1380,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 ); @@ -1412,15 +1412,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; } @@ -1430,13 +1430,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 { @@ -1446,7 +1446,7 @@ USHORT ScHTMLLayoutParser::GetWidthPixel( const HTMLOption* pOption ) return 0; } else - return (USHORT)pOption->GetNumber(); // Pixel + return (sal_uInt16)pOption->GetNumber(); // Pixel } } @@ -1454,8 +1454,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() ) @@ -1470,7 +1470,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 && @@ -1484,8 +1484,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() ) @@ -1511,7 +1511,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 ) @@ -1535,7 +1535,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: @@ -1550,7 +1550,7 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo ) break; case HTML_TITLE_ON: { - bInTitle = TRUE; + bInTitle = sal_True; aString.Erase(); } break; @@ -1566,7 +1566,7 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo ) uno::UNO_QUERY_THROW); xDPS->getDocumentProperties()->setTitle(aString); } - bInTitle = FALSE; + bInTitle = sal_False; } break; case HTML_TABLE_ON: @@ -1583,7 +1583,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 @@ -1697,7 +1697,7 @@ void ScHTMLLayoutParser::ProcToken( ImportInfo* pInfo ) break; default: { // nLastToken nicht setzen! - bSetLastToken = FALSE; + bSetLastToken = sal_False; } } if ( bSetLastToken ) @@ -2800,7 +2800,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; @@ -2828,7 +2828,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(); |