diff options
Diffstat (limited to 'sc/source/core/data/attrib.cxx')
-rw-r--r-- | sc/source/core/data/attrib.cxx | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 98404f7a944e..7474fb580d72 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -75,30 +75,30 @@ TYPEINIT1(ScPageScaleToItem, SfxPoolItem); // allgemeine Hilfsfunktionen // -BOOL ScHasPriority( const SvxBorderLine* pThis, const SvxBorderLine* pOther ) +sal_Bool ScHasPriority( const SvxBorderLine* pThis, const SvxBorderLine* pOther ) { if (!pThis) - return FALSE; + return false; if (!pOther) - return TRUE; + return sal_True; - USHORT nThisSize = pThis->GetOutWidth() + pThis->GetDistance() + pThis->GetInWidth(); - USHORT nOtherSize = pOther->GetOutWidth() + pOther->GetDistance() + pOther->GetInWidth(); + sal_uInt16 nThisSize = pThis->GetOutWidth() + pThis->GetDistance() + pThis->GetInWidth(); + sal_uInt16 nOtherSize = pOther->GetOutWidth() + pOther->GetDistance() + pOther->GetInWidth(); if (nThisSize > nOtherSize) - return TRUE; + return sal_True; else if (nThisSize < nOtherSize) - return FALSE; + return false; else { if ( pOther->GetInWidth() && !pThis->GetInWidth() ) - return TRUE; + return sal_True; else if ( pThis->GetInWidth() && !pOther->GetInWidth() ) - return FALSE; + return false; else { - return TRUE; //! ??? + return sal_True; //! ??? } } } @@ -170,10 +170,10 @@ SfxPoolItem* ScMergeAttr::Clone( SfxItemPool * ) const //------------------------------------------------------------------------ -SfxPoolItem* ScMergeAttr::Create( SvStream& rStream, USHORT /* nVer */ ) const +SfxPoolItem* ScMergeAttr::Create( SvStream& rStream, sal_uInt16 /* nVer */ ) const { - INT16 nCol; - INT16 nRow; + sal_Int16 nCol; + sal_Int16 nRow; rStream >> nCol; rStream >> nRow; return new ScMergeAttr(static_cast<SCCOL>(nCol),static_cast<SCROW>(nRow)); @@ -190,7 +190,7 @@ ScMergeFlagAttr::ScMergeFlagAttr(): //------------------------------------------------------------------------ -ScMergeFlagAttr::ScMergeFlagAttr(INT16 nFlags): +ScMergeFlagAttr::ScMergeFlagAttr(sal_Int16 nFlags): SfxInt16Item(ATTR_MERGE_FLAG, nFlags) { } @@ -205,17 +205,17 @@ ScMergeFlagAttr::~ScMergeFlagAttr() ScProtectionAttr::ScProtectionAttr(): SfxPoolItem(ATTR_PROTECTION), - bProtection(TRUE), - bHideFormula(FALSE), - bHideCell(FALSE), - bHidePrint(FALSE) + bProtection(sal_True), + bHideFormula(false), + bHideCell(false), + bHidePrint(false) { } //------------------------------------------------------------------------ -ScProtectionAttr::ScProtectionAttr( BOOL bProtect, BOOL bHFormula, - BOOL bHCell, BOOL bHPrint): +ScProtectionAttr::ScProtectionAttr( sal_Bool bProtect, sal_Bool bHFormula, + sal_Bool bHCell, sal_Bool bHPrint): SfxPoolItem(ATTR_PROTECTION), bProtection(bProtect), bHideFormula(bHFormula), @@ -241,7 +241,7 @@ ScProtectionAttr::~ScProtectionAttr() //------------------------------------------------------------------------ -bool ScProtectionAttr::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool ScProtectionAttr::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) @@ -272,7 +272,7 @@ bool ScProtectionAttr::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool ScProtectionAttr::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool ScProtectionAttr::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { bool bRet = false; sal_Bool bVal = sal_Bool(); @@ -395,12 +395,12 @@ SfxPoolItem* ScProtectionAttr::Clone( SfxItemPool * ) const //------------------------------------------------------------------------ -SfxPoolItem* ScProtectionAttr::Create( SvStream& rStream, USHORT /* n */ ) const +SfxPoolItem* ScProtectionAttr::Create( SvStream& rStream, sal_uInt16 /* n */ ) const { - BOOL bProtect; - BOOL bHFormula; - BOOL bHCell; - BOOL bHPrint; + sal_Bool bProtect; + sal_Bool bHFormula; + sal_Bool bHCell; + sal_Bool bHPrint; rStream >> bProtect; rStream >> bHFormula; @@ -412,34 +412,34 @@ SfxPoolItem* ScProtectionAttr::Create( SvStream& rStream, USHORT /* n */ ) const //------------------------------------------------------------------------ -BOOL ScProtectionAttr::SetProtection( BOOL bProtect) +sal_Bool ScProtectionAttr::SetProtection( sal_Bool bProtect) { bProtection = bProtect; - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -BOOL ScProtectionAttr::SetHideFormula( BOOL bHFormula) +sal_Bool ScProtectionAttr::SetHideFormula( sal_Bool bHFormula) { bHideFormula = bHFormula; - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -BOOL ScProtectionAttr::SetHideCell( BOOL bHCell) +sal_Bool ScProtectionAttr::SetHideCell( sal_Bool bHCell) { bHideCell = bHCell; - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -BOOL ScProtectionAttr::SetHidePrint( BOOL bHPrint) +sal_Bool ScProtectionAttr::SetHidePrint( sal_Bool bHPrint) { bHidePrint = bHPrint; - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -510,7 +510,7 @@ ScTableListItem::ScTableListItem( const ScTableListItem& rCpy ) { pTabArr = new SCTAB [nCount]; - for ( USHORT i=0; i<nCount; i++ ) + for ( sal_uInt16 i=0; i<nCount; i++ ) pTabArr[i] = rCpy.pTabArr[i]; } else @@ -534,7 +534,7 @@ ScTableListItem& ScTableListItem::operator=( const ScTableListItem& rCpy ) if ( rCpy.nCount > 0 ) { pTabArr = new SCTAB [rCpy.nCount]; - for ( USHORT i=0; i<rCpy.nCount; i++ ) + for ( sal_uInt16 i=0; i<rCpy.nCount; i++ ) pTabArr[i] = rCpy.pTabArr[i]; } else @@ -552,11 +552,11 @@ int ScTableListItem::operator==( const SfxPoolItem& rAttr ) const DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); ScTableListItem& rCmp = (ScTableListItem&)rAttr; - BOOL bEqual = (nCount == rCmp.nCount); + sal_Bool bEqual = (nCount == rCmp.nCount); if ( nCount > 0 ) { - USHORT i=0; + sal_uInt16 i=0; bEqual = ( pTabArr && rCmp.pTabArr ); @@ -599,7 +599,7 @@ SfxItemPresentation ScTableListItem::GetPresentation { rText = '('; if ( nCount>0 && pTabArr ) - for ( USHORT i=0; i<nCount; i++ ) + for ( sal_uInt16 i=0; i<nCount; i++ ) { rText += String::CreateFromInt32( pTabArr[i] ); if ( i<(nCount-1) ) @@ -627,7 +627,7 @@ SfxItemPresentation ScTableListItem::GetPresentation // ScPageHFItem - Daten der Kopf-/Fusszeilen // ----------------------------------------------------------------------- -ScPageHFItem::ScPageHFItem( USHORT nWhichP ) +ScPageHFItem::ScPageHFItem( sal_uInt16 nWhichP ) : SfxPoolItem ( nWhichP ), pLeftArea ( NULL ), pCenterArea ( NULL ), @@ -662,7 +662,7 @@ ScPageHFItem::~ScPageHFItem() //------------------------------------------------------------------------ -bool ScPageHFItem::QueryValue( uno::Any& rVal, BYTE /* nMemberId */ ) const +bool ScPageHFItem::QueryValue( uno::Any& rVal, sal_uInt8 /* nMemberId */ ) const { uno::Reference<sheet::XHeaderFooterContent> xContent = new ScHeaderFooterContentObj( pLeftArea, pCenterArea, pRightArea ); @@ -671,7 +671,7 @@ bool ScPageHFItem::QueryValue( uno::Any& rVal, BYTE /* nMemberId */ ) const return true; } -bool ScPageHFItem::PutValue( const uno::Any& rVal, BYTE /* nMemberId */ ) +bool ScPageHFItem::PutValue( const uno::Any& rVal, sal_uInt8 /* nMemberId */ ) { bool bRet = false; uno::Reference<sheet::XHeaderFooterContent> xContent; @@ -698,7 +698,7 @@ bool ScPageHFItem::PutValue( const uno::Any& rVal, BYTE /* nMemberId */ ) if ( !pLeftArea || !pCenterArea || !pRightArea ) { // keine Texte auf NULL stehen lassen - ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), TRUE ); + ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), sal_True ); if (!pLeftArea) pLeftArea = aEngine.CreateTextObject(); if (!pCenterArea) @@ -758,11 +758,11 @@ void lcl_SetSpace( String& rStr, const ESelection& rSel ) rStr.SetChar( rSel.nStartPos, ' ' ); } -BOOL lcl_ConvertFields(EditEngine& rEng, const String* pCommands) +sal_Bool lcl_ConvertFields(EditEngine& rEng, const String* pCommands) { - BOOL bChange = FALSE; - USHORT nParCnt = rEng.GetParagraphCount(); - for (USHORT nPar = 0; nPar<nParCnt; nPar++) + sal_Bool bChange = false; + sal_uInt16 nParCnt = rEng.GetParagraphCount(); + for (sal_uInt16 nPar = 0; nPar<nParCnt; nPar++) { String aStr = rEng.GetText( nPar ); xub_StrLen nPos; @@ -771,37 +771,37 @@ BOOL lcl_ConvertFields(EditEngine& rEng, const String* pCommands) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[0].Len() ); rEng.QuickInsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), aSel ); - lcl_SetSpace(aStr, aSel ); bChange = TRUE; + lcl_SetSpace(aStr, aSel ); bChange = sal_True; } while ((nPos = aStr.Search(pCommands[1])) != STRING_NOTFOUND) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[1].Len() ); rEng.QuickInsertField( SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD), aSel ); - lcl_SetSpace(aStr, aSel ); bChange = TRUE; + lcl_SetSpace(aStr, aSel ); bChange = sal_True; } while ((nPos = aStr.Search(pCommands[2])) != STRING_NOTFOUND) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[2].Len() ); rEng.QuickInsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD), aSel ); - lcl_SetSpace(aStr, aSel ); bChange = TRUE; + lcl_SetSpace(aStr, aSel ); bChange = sal_True; } while ((nPos = aStr.Search(pCommands[3])) != STRING_NOTFOUND) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[3].Len() ); rEng.QuickInsertField( SvxFieldItem(SvxTimeField(), EE_FEATURE_FIELD ), aSel ); - lcl_SetSpace(aStr, aSel ); bChange = TRUE; + lcl_SetSpace(aStr, aSel ); bChange = sal_True; } while ((nPos = aStr.Search(pCommands[4])) != STRING_NOTFOUND) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[4].Len() ); rEng.QuickInsertField( SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), aSel ); - lcl_SetSpace(aStr, aSel ); bChange = TRUE; + lcl_SetSpace(aStr, aSel ); bChange = sal_True; } while ((nPos = aStr.Search(pCommands[5])) != STRING_NOTFOUND) { ESelection aSel( nPar,nPos, nPar,nPos+pCommands[5].Len() ); rEng.QuickInsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), aSel ); - lcl_SetSpace(aStr, aSel ); bChange = TRUE; + lcl_SetSpace(aStr, aSel ); bChange = sal_True; } } return bChange; @@ -809,7 +809,7 @@ BOOL lcl_ConvertFields(EditEngine& rEng, const String* pCommands) #define SC_FIELD_COUNT 6 -SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const +SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, sal_uInt16 nVer ) const { EditTextObject* pLeft = EditTextObject::Create(rStream); EditTextObject* pCenter = EditTextObject::Create(rStream); @@ -825,7 +825,7 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const // Excel import in 5.1 created broken TextObjects (#67442#) that are // corrected here to avoid saving wrong files again (#90487#). - ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), TRUE ); + ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), sal_True ); if ( pLeft == NULL || pLeft->GetParagraphCount() == 0 ) { delete pLeft; @@ -845,7 +845,7 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const if ( nVer < 1 ) // alte Feldbefehle umsetzen { - USHORT i; + sal_uInt16 i; const String& rDel = ScGlobal::GetRscString( STR_HFCMD_DELIMITER ); String aCommands[SC_FIELD_COUNT]; for (i=0; i<SC_FIELD_COUNT; i++) @@ -859,7 +859,7 @@ SfxPoolItem* ScPageHFItem::Create( SvStream& rStream, USHORT nVer ) const for (i=0; i<SC_FIELD_COUNT; i++) aCommands[i] += rDel; - ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), TRUE ); + ScEditEngineDefaulter aEngine( EditEngine::CreatePool(), sal_True ); aEngine.SetText(*pLeft); if (lcl_ConvertFields(aEngine,aCommands)) { @@ -932,15 +932,15 @@ void ScPageHFItem::SetArea( EditTextObject *pNew, int nArea ) // ScViewObjectModeItem - Darstellungsmodus von ViewObjekten //----------------------------------------------------------------------- -ScViewObjectModeItem::ScViewObjectModeItem( USHORT nWhichP ) +ScViewObjectModeItem::ScViewObjectModeItem( sal_uInt16 nWhichP ) : SfxEnumItem( nWhichP, VOBJ_MODE_SHOW ) { } //------------------------------------------------------------------------ -ScViewObjectModeItem::ScViewObjectModeItem( USHORT nWhichP, ScVObjMode eMode ) - : SfxEnumItem( nWhichP, sal::static_int_cast<USHORT>(eMode) ) +ScViewObjectModeItem::ScViewObjectModeItem( sal_uInt16 nWhichP, ScVObjMode eMode ) + : SfxEnumItem( nWhichP, sal::static_int_cast<sal_uInt16>(eMode) ) { } @@ -1005,7 +1005,7 @@ SfxItemPresentation ScViewObjectModeItem::GetPresentation //------------------------------------------------------------------------ -String ScViewObjectModeItem::GetValueText( USHORT nVal ) const +String ScViewObjectModeItem::GetValueText( sal_uInt16 nVal ) const { DBG_ASSERT( nVal <= VOBJ_MODE_HIDE, "enum overflow!" ); @@ -1014,7 +1014,7 @@ String ScViewObjectModeItem::GetValueText( USHORT nVal ) const //------------------------------------------------------------------------ -USHORT ScViewObjectModeItem::GetValueCount() const +sal_uInt16 ScViewObjectModeItem::GetValueCount() const { return 2; } @@ -1028,7 +1028,7 @@ SfxPoolItem* ScViewObjectModeItem::Clone( SfxItemPool* ) const //------------------------------------------------------------------------ -USHORT ScViewObjectModeItem::GetVersion( USHORT /* nFileVersion */ ) const +sal_uInt16 ScViewObjectModeItem::GetVersion( sal_uInt16 /* nFileVersion */ ) const { return 1; } @@ -1037,7 +1037,7 @@ USHORT ScViewObjectModeItem::GetVersion( USHORT /* nFileVersion */ ) const SfxPoolItem* ScViewObjectModeItem::Create( SvStream& rStream, - USHORT nVersion ) const + sal_uInt16 nVersion ) const { if ( nVersion == 0 ) { @@ -1046,11 +1046,11 @@ SfxPoolItem* ScViewObjectModeItem::Create( } else { - USHORT nVal; + sal_uInt16 nVal; rStream >> nVal; //#i80528# adapt to new range eventually - if((USHORT)VOBJ_MODE_HIDE < nVal) nVal = (USHORT)VOBJ_MODE_SHOW; + if((sal_uInt16)VOBJ_MODE_HIDE < nVal) nVal = (sal_uInt16)VOBJ_MODE_SHOW; return new ScViewObjectModeItem( Which(), (ScVObjMode)nVal); } @@ -1060,7 +1060,7 @@ SfxPoolItem* ScViewObjectModeItem::Create( // double // ----------------------------------------------------------------------- -ScDoubleItem::ScDoubleItem( USHORT nWhichP, double nVal ) +ScDoubleItem::ScDoubleItem( sal_uInt16 nWhichP, double nVal ) : SfxPoolItem ( nWhichP ), nValue ( nVal ) { @@ -1099,7 +1099,7 @@ SfxPoolItem* ScDoubleItem::Clone( SfxItemPool* ) const //------------------------------------------------------------------------ -SfxPoolItem* ScDoubleItem::Create( SvStream& rStream, USHORT /* nVer */ ) const +SfxPoolItem* ScDoubleItem::Create( SvStream& rStream, sal_uInt16 /* nVer */ ) const { double nTmp=0; rStream >> nTmp; @@ -1200,7 +1200,7 @@ SfxItemPresentation ScPageScaleToItem::GetPresentation( return ePres; } -bool ScPageScaleToItem::QueryValue( uno::Any& rAny, BYTE nMemberId ) const +bool ScPageScaleToItem::QueryValue( uno::Any& rAny, sal_uInt8 nMemberId ) const { bool bRet = true; switch( nMemberId ) @@ -1214,9 +1214,9 @@ bool ScPageScaleToItem::QueryValue( uno::Any& rAny, BYTE nMemberId ) const return bRet; } -bool ScPageScaleToItem::PutValue( const uno::Any& rAny, BYTE nMemberId ) +bool ScPageScaleToItem::PutValue( const uno::Any& rAny, sal_uInt8 nMemberId ) { - BOOL bRet = false; + sal_Bool bRet = false; switch( nMemberId ) { case SC_MID_PAGE_SCALETO_WIDTH: bRet = rAny >>= mnWidth; break; |