diff options
Diffstat (limited to 'sw/source/filter/rtf/rtftbl.cxx')
-rw-r--r-- | sw/source/filter/rtf/rtftbl.cxx | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/sw/source/filter/rtf/rtftbl.cxx b/sw/source/filter/rtf/rtftbl.cxx index eea1a02a30a4..e275c64a45e6 100644 --- a/sw/source/filter/rtf/rtftbl.cxx +++ b/sw/source/filter/rtf/rtftbl.cxx @@ -58,13 +58,13 @@ SV_DECL_PTRARR( SwBoxFrmFmts, SwTableBoxFmtPtr, 25, 50 ) class SwShareBoxFmts; extern void _DeleteBox( SwTable& rTbl, SwTableBox* pBox, SwUndo* = 0, - BOOL = TRUE, const BOOL = TRUE, SwShareBoxFmts* = 0 ); + sal_Bool = sal_True, const sal_Bool = sal_True, SwShareBoxFmts* = 0 ); struct Row { bool mbUseLeftRowPad, mbUseRightRowPad, mbUseTopRowPad, mbUseBottomRowPad; long mnLeftRowPad, mnRightRowPad, mnTopRowPad, mnBottomRowPad; - USHORT mnBrdDist; + sal_uInt16 mnBrdDist; Row() : mbUseLeftRowPad(false), mbUseRightRowPad(false), mbUseTopRowPad(false), mbUseBottomRowPad(false), @@ -77,22 +77,22 @@ static void SetRowBorder(SfxItemSet& rSet, const Row &rRow) { #if 1 SvxBoxItem aBox((const SvxBoxItem&)rSet.Get(RES_BOX, false)); - aBox.SetDistance( static_cast< USHORT >(rRow.mbUseLeftRowPad ? rRow.mnLeftRowPad : rRow.mnBrdDist), + aBox.SetDistance( static_cast< sal_uInt16 >(rRow.mbUseLeftRowPad ? rRow.mnLeftRowPad : rRow.mnBrdDist), BOX_LINE_LEFT); - aBox.SetDistance( static_cast< USHORT >(rRow.mbUseRightRowPad ? rRow.mnRightRowPad : rRow.mnBrdDist), + aBox.SetDistance( static_cast< sal_uInt16 >(rRow.mbUseRightRowPad ? rRow.mnRightRowPad : rRow.mnBrdDist), BOX_LINE_RIGHT); - aBox.SetDistance( static_cast< USHORT >(rRow.mbUseTopRowPad ? rRow.mnTopRowPad : 0), + aBox.SetDistance( static_cast< sal_uInt16 >(rRow.mbUseTopRowPad ? rRow.mnTopRowPad : 0), BOX_LINE_TOP); - aBox.SetDistance( static_cast< USHORT >(rRow.mbUseBottomRowPad ? rRow.mnBottomRowPad : 0), + aBox.SetDistance( static_cast< sal_uInt16 >(rRow.mbUseBottomRowPad ? rRow.mnBottomRowPad : 0), BOX_LINE_BOTTOM); rSet.Put(aBox); #else const SfxPoolItem* pItem; - if (SFX_ITEM_SET == rSet.GetItemState(RES_BOX, FALSE, &pItem)) + if (SFX_ITEM_SET == rSet.GetItemState(RES_BOX, sal_False, &pItem)) { SvxBoxItem aBox( *(SvxBoxItem*)pItem ); aBox.SetDistance(rRow.mbUseLeftRowPad ? rRow.mnLeftRowPad : rRow.mnBrdDist, @@ -160,7 +160,7 @@ void SwRTFParser::ReadTable( int nToken ) // verhinder Tabelle in Tabelle/Footnote SwTwips nTblSz = 0; - int bReadNewCell = FALSE, bChkExistTbl = FALSE; + int bReadNewCell = sal_False, bChkExistTbl = sal_False; enum Limits {eMAXCELLS=64000}; @@ -176,26 +176,26 @@ void SwRTFParser::ReadTable( int nToken ) // Flag for delete merged boxes aMergeBoxes.clear(); - aMergeBoxes.push_back( (BOOL)FALSE ); + aMergeBoxes.push_back( (sal_Bool)sal_False ); m_nCurrentBox = 0; // wenn schon in einer Tabellen, dann splitte oder benutze // die bisherigen Boxen weiter - bChkExistTbl = 0 != pDoc->GetNodes()[ pPam->GetPoint()->nNode ]->FindTableNode(); + bChkExistTbl = 0 != pPam->GetPoint()->nNode.GetNode().FindTableNode(); } else { - bReadNewCell = TRUE; + bReadNewCell = sal_True; SwTableLines& rLns = pTableNode->GetTable().GetTabLines(); SwTableLine* pLine = rLns[ rLns.Count()-1 ]; // very robust to avoid crashes like bug 127425 + crash reports 118743 if( pLine ) { - USHORT nTmpBox = m_nCurrentBox; + sal_uInt16 nTmpBox = m_nCurrentBox; if( nTmpBox > pLine->GetTabBoxes().Count() ) nTmpBox = pLine->GetTabBoxes().Count(); - for (USHORT n = nTmpBox; n; ) + for (sal_uInt16 n = nTmpBox; n; ) { const SwTableBox *pTmp = pLine->GetTabBoxes()[ --n ]; if( pTmp ) @@ -226,7 +226,7 @@ void SwRTFParser::ReadTable( int nToken ) SvxFrameDirection eDir = FRMDIR_HORI_LEFT_TOP; bool bCantSplit = false; - int bWeiter = TRUE; + int bWeiter = sal_True; do { switch( nToken ) { @@ -289,7 +289,7 @@ void SwRTFParser::ReadTable( int nToken ) // the first cell cannot be merged with earlier ones. if (nBoxCnt != 0) { - aMergeBoxes.back() = TRUE; + aMergeBoxes.back() = sal_True; } break; @@ -326,7 +326,7 @@ void SwRTFParser::ReadTable( int nToken ) // if (nSize<=2*aRow.mnBrdDist) { aRow.mnRightRowPad=0; - aRow.mbUseRightRowPad=TRUE; + aRow.mbUseRightRowPad=sal_True; } SetRowBorder((SfxItemSet&)pBoxFmt->GetAttrSet(), aRow); aBoxFmts.Insert( pBoxFmt, aBoxFmts.Count() ); @@ -337,22 +337,22 @@ void SwRTFParser::ReadTable( int nToken ) nSize = COL_DFLT_WIDTH; pFmt->SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, nSize, 0 )); nTblSz = nTokenValue; - aMergeBoxes.push_back( (BOOL)FALSE ); + aMergeBoxes.push_back( (sal_Bool)sal_False ); ++nBoxCnt; SvxBoxItem aBox(pFmt->GetBox()); if (bUseRightCellPad) - aBox.SetDistance( static_cast< USHORT >(nRightCellPad), BOX_LINE_RIGHT); + aBox.SetDistance( static_cast< sal_uInt16 >(nRightCellPad), BOX_LINE_RIGHT); if (bUseBottomCellPad) - aBox.SetDistance( static_cast< USHORT >(nBottomCellPad), BOX_LINE_BOTTOM); + aBox.SetDistance( static_cast< sal_uInt16 >(nBottomCellPad), BOX_LINE_BOTTOM); //Yes, these are the wrong way around, there appears to //be a bug in word where these are swapped. if (bUseLeftCellPad) - aBox.SetDistance( static_cast< USHORT >(nLeftCellPad), BOX_LINE_TOP); + aBox.SetDistance( static_cast< sal_uInt16 >(nLeftCellPad), BOX_LINE_TOP); if (bUseTopCellPad) - aBox.SetDistance( static_cast< USHORT >(nTopCellPad), BOX_LINE_LEFT); + aBox.SetDistance( static_cast< sal_uInt16 >(nTopCellPad), BOX_LINE_LEFT); /*#106415# The Cell Borders are now balanced on import to @@ -364,8 +364,8 @@ void SwRTFParser::ReadTable( int nToken ) SwTableBoxFmt* prevpFmt = aBoxFmts[ aBoxFmts.Count()-2 ]; SvxBoxItem prevaBox(prevpFmt->GetBox()); - USHORT prevWidthRight=0; - USHORT currWidthLeft=0; + sal_uInt16 prevWidthRight=0; + sal_uInt16 currWidthLeft=0; bool bDoubleLine=false; const SvxBorderLine* brdrline ; const Color* pPrevRightColor; @@ -388,7 +388,7 @@ void SwRTFParser::ReadTable( int nToken ) if((currWidthLeft >0 || prevWidthRight >0) && !bDoubleLine) { - USHORT newBorderWidth=(currWidthLeft+prevWidthRight)/2 ; + sal_uInt16 newBorderWidth=(currWidthLeft+prevWidthRight)/2 ; if(newBorderWidth /2 ==DEF_LINE_WIDTH_0 ) { newBorderWidth =DEF_LINE_WIDTH_0; @@ -433,7 +433,7 @@ void SwRTFParser::ReadTable( int nToken ) case RTF_TRGAPH: //$flr bug #117887#: RTF: wrong internal table cell margin imported (A13) - aRow.mnBrdDist = (nTokenValue>0?(USHORT)nTokenValue:0); // filter out negative values of \trgaph + aRow.mnBrdDist = (nTokenValue>0?(sal_uInt16)nTokenValue:0); // filter out negative values of \trgaph break; case RTF_TRQL: eAdjust = text::HoriOrientation::LEFT; break; @@ -488,7 +488,7 @@ void SwRTFParser::ReadTable( int nToken ) if( aMergeBoxes.back() ) break; ReadBackgroundAttr( nToken, - (SfxItemSet&)pBoxFmt->GetAttrSet(), TRUE ); + (SfxItemSet&)pBoxFmt->GetAttrSet(), sal_True ); } else if( ( nToken & ~(0xff | RTF_TABLEDEF) ) == RTF_BRDRDEF || IsBorderToken(nToken)) @@ -498,7 +498,7 @@ void SwRTFParser::ReadTable( int nToken ) SfxItemSet& rSet = (SfxItemSet&)pBoxFmt->GetAttrSet(); if(!IsBorderToken( nToken )) - ReadBorderAttr( nToken, rSet, TRUE ); + ReadBorderAttr( nToken, rSet, sal_True ); else NextToken( nToken ); } @@ -507,7 +507,7 @@ void SwRTFParser::ReadTable( int nToken ) if( RTF_UNKNOWNCONTROL == nToken ) NextToken( nToken ); else - bWeiter = FALSE; + bWeiter = sal_False; } break; } @@ -535,7 +535,7 @@ void SwRTFParser::ReadTable( int nToken ) nTblSz -= nLSpace; - int bNewTbl = TRUE; + int bNewTbl = sal_True; SwTableLine* pNewLine; bTrowdRead=true; @@ -604,7 +604,7 @@ void SwRTFParser::ReadTable( int nToken ) pBox = (*pLns)[ 0 ]->GetTabBoxes()[ 0 ]; SwNodeIndex aTmpIdx( *pBox->GetSttNd() ); - pDoc->GetNodes().SplitTable( aTmpIdx, HEADLINE_NONE, FALSE ); + pDoc->GetNodes().SplitTable( aTmpIdx, HEADLINE_NONE, sal_False ); pTableNode = pPam->GetNode()->FindTableNode(); pFmt = pTableNode->GetTable().GetFrmFmt(); @@ -624,8 +624,8 @@ void SwRTFParser::ReadTable( int nToken ) pNewLine = (*pLns)[ pLns->Count() - 1 ]; // jetzt die Boxen abgleichen - USHORT nBoxes = Min( pNewLine->GetTabBoxes().Count(), aBoxFmts.Count() ); - USHORT n; + sal_uInt16 nBoxes = Min( pNewLine->GetTabBoxes().Count(), aBoxFmts.Count() ); + sal_uInt16 n; for( n = 0; n < nBoxes; ++n ) { @@ -645,11 +645,11 @@ void SwRTFParser::ReadTable( int nToken ) pPam->SetMark(); pPam->DeleteMark(); while( n < pNewLine->GetTabBoxes().Count() ) _DeleteBox( pTableNode->GetTable(), - pNewLine->GetTabBoxes()[ n ], 0, FALSE, FALSE ); + pNewLine->GetTabBoxes()[ n ], 0, sal_False, sal_False ); } pOldTblNd = pTableNode; - bNewTbl = FALSE; + bNewTbl = sal_False; { // JP 13.08.98: TabellenUmrandungen optimieren - Bug 53525 @@ -710,7 +710,7 @@ void SwRTFParser::ReadTable( int nToken ) pNewLine->GetFrmFmt()->ResetFmtAttr( RES_FRM_SIZE ); rLns.C40_INSERT( SwTableLine, pNewLine, rLns.Count() ); } - bNewTbl = FALSE; + bNewTbl = sal_False; } else { @@ -718,7 +718,7 @@ void SwRTFParser::ReadTable( int nToken ) const SwTable *pTable = pDoc->InsertTable( SwInsertTableOptions( tabopts::HEADLINE_NO_BORDER, 0 ), - *pPam->GetPoint(), 1, 1, eAdjust, 0, 0, FALSE, FALSE ); + *pPam->GetPoint(), 1, 1, eAdjust, 0, 0, sal_False, sal_False ); bContainsTablePara=true; //#117881# pTableNode = pTable ? pTable->GetTableNode() : 0; @@ -778,7 +778,7 @@ void SwRTFParser::ReadTable( int nToken ) if( !pColl ) pColl = pDoc->GetTxtCollFromPool( RES_POOLCOLL_STANDARD, false ); - USHORT nStt = 0; + sal_uInt16 nStt = 0; if( bNewTbl ) { SwTableBox* pBox = pNewLine->GetTabBoxes()[0]; @@ -893,16 +893,16 @@ void SwRTFParser::GotoNextBox() if (++m_nCurrentBox >= aMergeBoxes.size()) { OSL_ENSURE(aMergeBoxes.size() < SAL_MAX_UINT16, "too many boxes?"); - m_nCurrentBox = static_cast<USHORT>(aMergeBoxes.size()-1); + m_nCurrentBox = static_cast<sal_uInt16>(aMergeBoxes.size()-1); } if (!aMergeBoxes[ m_nCurrentBox ]) { - int bMove = TRUE; + int bMove = sal_True; if( pBox->GetSttIdx() > pPam->GetPoint()->nNode.GetIndex() ) { - USHORT nRealBox = 0; - for (USHORT nTmp = 0; nTmp < m_nCurrentBox; ++nTmp) + sal_uInt16 nRealBox = 0; + for (sal_uInt16 nTmp = 0; nTmp < m_nCurrentBox; ++nTmp) if( !aMergeBoxes[ nTmp ] ) ++nRealBox; @@ -910,7 +910,7 @@ void SwRTFParser::GotoNextBox() { pPam->GetPoint()->nNode = *rBoxes[ nRealBox ]->GetSttNd()->EndOfSectionNode(); pPam->Move( fnMoveBackward, fnGoCntnt ); - bMove = FALSE; + bMove = sal_False; } } @@ -919,7 +919,7 @@ void SwRTFParser::GotoNextBox() // dann hinter die Tabelle pPam->Move( fnMoveForward, fnGoNode ); } - else if( !pDoc->GetNodes()[ pPam->GetPoint()->nNode ]->IsCntntNode() ) + else if (pPam->GetPoint()->nNode.GetNode().IsCntntNode()) // dann in die vorherige ans Ende pPam->Move( fnMoveBackward, fnGoCntnt ); } @@ -930,7 +930,7 @@ void SwRTFParser::NewTblLine() nInsTblRow = USHRT_MAX; // erweiter die aktuelle um eine neue Line - BOOL bMakeCopy = FALSE; + sal_Bool bMakeCopy = sal_False; SwNode* pNd = pDoc->GetNodes()[ pPam->GetPoint()->nNode.GetIndex()-1 ]; if( !pNd->IsEndNode() || !(pNd = pNd->StartOfSectionNode())->IsTableNode() ) @@ -938,7 +938,7 @@ void SwRTFParser::NewTblLine() if( !pOldTblNd ) return ; - bMakeCopy = TRUE; + bMakeCopy = sal_True; pNd = pOldTblNd; } pTableNode = (SwTableNode*)pNd; @@ -954,7 +954,7 @@ void SwRTFParser::NewTblLine() if( !bMakeCopy && 64000 < pTableNode->GetTable().GetTabSortBoxes().Count() ) { - bMakeCopy = TRUE; // spaetestens jetzt eine neue anfangen! + bMakeCopy = sal_True; // spaetestens jetzt eine neue anfangen! } if( bMakeCopy ) @@ -963,8 +963,8 @@ void SwRTFParser::NewTblLine() SwSelBoxes aBoxes; pTableNode->GetTable().SelLineFromBox( pBox, aBoxes ); pTableNode->GetTable().MakeCopy( pDoc, *pPam->GetPoint(), - aBoxes, FALSE ); - ULONG nNd = pPam->GetPoint()->nNode.GetIndex()-1; + aBoxes, sal_False ); + sal_uLong nNd = pPam->GetPoint()->nNode.GetIndex()-1; pTableNode = pDoc->GetNodes()[ nNd ]->FindTableNode(); pOldTblNd = pTableNode; @@ -978,7 +978,7 @@ void SwRTFParser::NewTblLine() pBox = (*pLns)[ pLns->Count()-1 ]->GetTabBoxes()[0]; - ULONG nOldPos = pPam->GetPoint()->nNode.GetIndex(); + sal_uLong nOldPos = pPam->GetPoint()->nNode.GetIndex(); pPam->GetPoint()->nNode = *pBox->GetSttNd(); pPam->Move( fnMoveForward ); m_nCurrentBox = 0; @@ -1015,7 +1015,7 @@ void SwRTFParser::NewTblLine() SvxRTFItemStack& rAttrStk = GetAttrStack(); const SvxRTFItemStackType* pStk; for( size_t n = 0; n < rAttrStk.size(); ++n ) - if( ( pStk = rAttrStk[ n ])->GetSttNodeIdx() == ULONG(nOldPos) && + if( ( pStk = rAttrStk[ n ])->GetSttNodeIdx() == sal_uLong(nOldPos) && !pStk->GetSttCnt() ) ((SvxRTFItemStackType*)pStk)->SetStartPos( SwxPosition( pPam ) ); } |