diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-03-10 16:55:21 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-03-10 20:21:13 -0500 |
commit | 12343c15568dcc2c9209d8ca41fda2263122448f (patch) | |
tree | 3212a89c6cd8ea2e0aee7103aa9669bbb8a6f307 /sc/source/core/tool/autoform.cxx | |
parent | 99745dbcbb25b61437914c9782475d0b67a4b0bd (diff) | |
parent | ce6308e4fad2281241bf4ca78280eba29f744d43 (diff) |
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
Diffstat (limited to 'sc/source/core/tool/autoform.cxx')
-rw-r--r-- | sc/source/core/tool/autoform.cxx | 234 |
1 files changed, 117 insertions, 117 deletions
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index 24b22ad1ed20..7492f52ecaa2 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -59,43 +59,43 @@ const sal_Char *linker_dummy = ""; static const sal_Char sAutoTblFmtName[] = "autotbl.fmt"; // bis SO5PF -const USHORT AUTOFORMAT_ID_X = 9501; -const USHORT AUTOFORMAT_ID_358 = 9601; -const USHORT AUTOFORMAT_DATA_ID_X = 9502; +const sal_uInt16 AUTOFORMAT_ID_X = 9501; +const sal_uInt16 AUTOFORMAT_ID_358 = 9601; +const sal_uInt16 AUTOFORMAT_DATA_ID_X = 9502; // ab SO5 //! in nachfolgenden Versionen muss der Betrag dieser IDs groesser sein -const USHORT AUTOFORMAT_ID_504 = 9801; -const USHORT AUTOFORMAT_DATA_ID_504 = 9802; +const sal_uInt16 AUTOFORMAT_ID_504 = 9801; +const sal_uInt16 AUTOFORMAT_DATA_ID_504 = 9802; -const USHORT AUTOFORMAT_ID_552 = 9901; -const USHORT AUTOFORMAT_DATA_ID_552 = 9902; +const sal_uInt16 AUTOFORMAT_ID_552 = 9901; +const sal_uInt16 AUTOFORMAT_DATA_ID_552 = 9902; // --- from 641 on: CJK and CTL font settings -const USHORT AUTOFORMAT_ID_641 = 10001; -const USHORT AUTOFORMAT_DATA_ID_641 = 10002; +const sal_uInt16 AUTOFORMAT_ID_641 = 10001; +const sal_uInt16 AUTOFORMAT_DATA_ID_641 = 10002; // --- from 680/dr14 on: diagonal frame lines -const USHORT AUTOFORMAT_ID_680DR14 = 10011; -const USHORT AUTOFORMAT_DATA_ID_680DR14 = 10012; +const sal_uInt16 AUTOFORMAT_ID_680DR14 = 10011; +const sal_uInt16 AUTOFORMAT_DATA_ID_680DR14 = 10012; // --- from 680/dr25 on: store strings as UTF-8 -const USHORT AUTOFORMAT_ID_680DR25 = 10021; -const USHORT AUTOFORMAT_DATA_ID_680DR25 = 10022; +const sal_uInt16 AUTOFORMAT_ID_680DR25 = 10021; +const sal_uInt16 AUTOFORMAT_DATA_ID_680DR25 = 10022; // --- from DEV300/overline2 on: overline support -const USHORT AUTOFORMAT_ID_300OVRLN = 10031; -const USHORT AUTOFORMAT_DATA_ID_300OVRLN = 10032; +const sal_uInt16 AUTOFORMAT_ID_300OVRLN = 10031; +const sal_uInt16 AUTOFORMAT_DATA_ID_300OVRLN = 10032; // aktuelle Version -const USHORT AUTOFORMAT_ID = AUTOFORMAT_ID_300OVRLN; -const USHORT AUTOFORMAT_DATA_ID = AUTOFORMAT_DATA_ID_300OVRLN; +const sal_uInt16 AUTOFORMAT_ID = AUTOFORMAT_ID_300OVRLN; +const sal_uInt16 AUTOFORMAT_DATA_ID = AUTOFORMAT_DATA_ID_300OVRLN; #ifdef READ_OLDVERS -const USHORT AUTOFORMAT_OLD_ID_OLD = 4201; -const USHORT AUTOFORMAT_OLD_DATA_ID = 4202; -const USHORT AUTOFORMAT_OLD_ID_NEW = 4203; +const sal_uInt16 AUTOFORMAT_OLD_ID_OLD = 4201; +const sal_uInt16 AUTOFORMAT_OLD_DATA_ID = 4202; +const sal_uInt16 AUTOFORMAT_OLD_ID_NEW = 4203; #endif @@ -104,34 +104,34 @@ const USHORT AUTOFORMAT_OLD_ID_NEW = 4203; struct ScAfVersions { public: - USHORT nFontVersion; - USHORT nFontHeightVersion; - USHORT nWeightVersion; - USHORT nPostureVersion; - USHORT nUnderlineVersion; - USHORT nOverlineVersion; - USHORT nCrossedOutVersion; - USHORT nContourVersion; - USHORT nShadowedVersion; - USHORT nColorVersion; - USHORT nBoxVersion; - USHORT nLineVersion; - USHORT nBrushVersion; - - USHORT nAdjustVersion; - - USHORT nHorJustifyVersion; - USHORT nVerJustifyVersion; - USHORT nOrientationVersion; - USHORT nMarginVersion; - USHORT nBoolVersion; - USHORT nInt32Version; - USHORT nRotateModeVersion; - - USHORT nNumFmtVersion; + sal_uInt16 nFontVersion; + sal_uInt16 nFontHeightVersion; + sal_uInt16 nWeightVersion; + sal_uInt16 nPostureVersion; + sal_uInt16 nUnderlineVersion; + sal_uInt16 nOverlineVersion; + sal_uInt16 nCrossedOutVersion; + sal_uInt16 nContourVersion; + sal_uInt16 nShadowedVersion; + sal_uInt16 nColorVersion; + sal_uInt16 nBoxVersion; + sal_uInt16 nLineVersion; + sal_uInt16 nBrushVersion; + + sal_uInt16 nAdjustVersion; + + sal_uInt16 nHorJustifyVersion; + sal_uInt16 nVerJustifyVersion; + sal_uInt16 nOrientationVersion; + sal_uInt16 nMarginVersion; + sal_uInt16 nBoolVersion; + sal_uInt16 nInt32Version; + sal_uInt16 nRotateModeVersion; + + sal_uInt16 nNumFmtVersion; ScAfVersions(); - void Load( SvStream& rStream, USHORT nVer ); + void Load( SvStream& rStream, sal_uInt16 nVer ); static void Write(SvStream& rStream); }; @@ -161,7 +161,7 @@ ScAfVersions::ScAfVersions() : { } -void ScAfVersions::Load( SvStream& rStream, USHORT nVer ) +void ScAfVersions::Load( SvStream& rStream, sal_uInt16 nVer ) { rStream >> nFontVersion; rStream >> nFontHeightVersion; @@ -201,8 +201,8 @@ void ScAfVersions::Write(SvStream& rStream) rStream << SvxUnderlineItem(UNDERLINE_NONE, ATTR_FONT_UNDERLINE).GetVersion(SOFFICE_FILEFORMAT_40); rStream << SvxOverlineItem(UNDERLINE_NONE, ATTR_FONT_OVERLINE).GetVersion(SOFFICE_FILEFORMAT_40); rStream << SvxCrossedOutItem(STRIKEOUT_NONE, ATTR_FONT_CROSSEDOUT).GetVersion(SOFFICE_FILEFORMAT_40); - rStream << SvxContourItem(sal_False, ATTR_FONT_CONTOUR).GetVersion(SOFFICE_FILEFORMAT_40); - rStream << SvxShadowedItem(sal_False, ATTR_FONT_SHADOWED).GetVersion(SOFFICE_FILEFORMAT_40); + rStream << SvxContourItem(false, ATTR_FONT_CONTOUR).GetVersion(SOFFICE_FILEFORMAT_40); + rStream << SvxShadowedItem(false, ATTR_FONT_SHADOWED).GetVersion(SOFFICE_FILEFORMAT_40); rStream << SvxColorItem(ATTR_FONT_COLOR).GetVersion(SOFFICE_FILEFORMAT_40); rStream << SvxBoxItem(ATTR_BORDER).GetVersion(SOFFICE_FILEFORMAT_40); rStream << SvxLineItem(SID_FRAME_LINESTYLE).GetVersion(SOFFICE_FILEFORMAT_40); @@ -218,7 +218,7 @@ void ScAfVersions::Write(SvStream& rStream) rStream << SfxInt32Item(ATTR_ROTATE_VALUE).GetVersion(SOFFICE_FILEFORMAT_40); rStream << SvxRotateModeItem(SVX_ROTATE_MODE_STANDARD,0).GetVersion(SOFFICE_FILEFORMAT_40); - rStream << (USHORT)0; // Num-Format + rStream << (sal_uInt16)0; // Num-Format } // --------------------------------------------------------------------------- @@ -242,8 +242,8 @@ ScAutoFormatDataField::ScAutoFormatDataField() : aUnderline( UNDERLINE_NONE,ATTR_FONT_UNDERLINE ), aOverline( UNDERLINE_NONE,ATTR_FONT_OVERLINE ), aCrossedOut( STRIKEOUT_NONE, ATTR_FONT_CROSSEDOUT ), - aContour( sal_False, ATTR_FONT_CONTOUR ), - aShadowed( sal_False, ATTR_FONT_SHADOWED ), + aContour( false, ATTR_FONT_CONTOUR ), + aShadowed( false, ATTR_FONT_SHADOWED ), aColor( ATTR_FONT_COLOR ), aBox( ATTR_BORDER ), aTLBR( ATTR_BORDER_TLBR ), @@ -310,7 +310,7 @@ void ScAutoFormatDataField::SetAdjust( const SvxAdjustItem& rAdjust ) aItem = *(ItemType*)pNew; \ delete pNew; -BOOL ScAutoFormatDataField::Load( SvStream& rStream, const ScAfVersions& rVersions, USHORT nVer ) +sal_Bool ScAutoFormatDataField::Load( SvStream& rStream, const ScAfVersions& rVersions, sal_uInt16 nVer ) { SfxPoolItem* pNew; SvxOrientationItem aOrientation( SVX_ORIENTATION_STANDARD, 0 ); @@ -394,7 +394,7 @@ BOOL ScAutoFormatDataField::Load( SvStream& rStream, const ScAfVersions& rVersio } #ifdef READ_OLDVERS -BOOL ScAutoFormatDataField::LoadOld( SvStream& rStream, const ScAfVersions& rVersions ) +sal_Bool ScAutoFormatDataField::LoadOld( SvStream& rStream, const ScAfVersions& rVersions ) { SfxPoolItem* pNew; SvxOrientationItem aOrientation( SVX_ORIENTATION_STANDARD, 0 ); @@ -427,7 +427,7 @@ BOOL ScAutoFormatDataField::LoadOld( SvStream& rStream, const ScAfVersions& rVer } #endif -BOOL ScAutoFormatDataField::Save( SvStream& rStream ) +sal_Bool ScAutoFormatDataField::Save( SvStream& rStream ) { SvxOrientationItem aOrientation( aRotateAngle.GetValue(), aStacked.GetValue(), 0 ); @@ -489,10 +489,10 @@ ScAutoFormatData::ScAutoFormatData() bIncludeJustify = bIncludeFrame = bIncludeBackground = - bIncludeWidthHeight = TRUE; + bIncludeWidthHeight = sal_True; ppDataField = new ScAutoFormatDataField*[ 16 ]; - for( USHORT nIndex = 0; nIndex < 16; ++nIndex ) + for( sal_uInt16 nIndex = 0; nIndex < 16; ++nIndex ) ppDataField[ nIndex ] = new ScAutoFormatDataField; } @@ -508,32 +508,32 @@ ScAutoFormatData::ScAutoFormatData( const ScAutoFormatData& rData ) : bIncludeWidthHeight( rData.bIncludeWidthHeight ) { ppDataField = new ScAutoFormatDataField*[ 16 ]; - for( USHORT nIndex = 0; nIndex < 16; ++nIndex ) + for( sal_uInt16 nIndex = 0; nIndex < 16; ++nIndex ) ppDataField[ nIndex ] = new ScAutoFormatDataField( rData.GetField( nIndex ) ); } ScAutoFormatData::~ScAutoFormatData() { - for( USHORT nIndex = 0; nIndex < 16; ++nIndex ) + for( sal_uInt16 nIndex = 0; nIndex < 16; ++nIndex ) delete ppDataField[ nIndex ]; delete[] ppDataField; } -ScAutoFormatDataField& ScAutoFormatData::GetField( USHORT nIndex ) +ScAutoFormatDataField& ScAutoFormatData::GetField( sal_uInt16 nIndex ) { DBG_ASSERT( nIndex < 16, "ScAutoFormatData::GetField - illegal index" ); DBG_ASSERT( ppDataField && ppDataField[ nIndex ], "ScAutoFormatData::GetField - no data" ); return *ppDataField[ nIndex ]; } -const ScAutoFormatDataField& ScAutoFormatData::GetField( USHORT nIndex ) const +const ScAutoFormatDataField& ScAutoFormatData::GetField( sal_uInt16 nIndex ) const { DBG_ASSERT( nIndex < 16, "ScAutoFormatData::GetField - illegal index" ); DBG_ASSERT( ppDataField && ppDataField[ nIndex ], "ScAutoFormatData::GetField - no data" ); return *ppDataField[ nIndex ]; } -const SfxPoolItem* ScAutoFormatData::GetItem( USHORT nIndex, USHORT nWhich ) const +const SfxPoolItem* ScAutoFormatData::GetItem( sal_uInt16 nIndex, sal_uInt16 nWhich ) const { const ScAutoFormatDataField& rField = GetField( nIndex ); switch( nWhich ) @@ -571,7 +571,7 @@ const SfxPoolItem* ScAutoFormatData::GetItem( USHORT nIndex, USHORT nWhich ) con return NULL; } -void ScAutoFormatData::PutItem( USHORT nIndex, const SfxPoolItem& rItem ) +void ScAutoFormatData::PutItem( sal_uInt16 nIndex, const SfxPoolItem& rItem ) { ScAutoFormatDataField& rField = GetField( nIndex ); switch( rItem.Which() ) @@ -608,21 +608,21 @@ void ScAutoFormatData::PutItem( USHORT nIndex, const SfxPoolItem& rItem ) } } -void ScAutoFormatData::CopyItem( USHORT nToIndex, USHORT nFromIndex, USHORT nWhich ) +void ScAutoFormatData::CopyItem( sal_uInt16 nToIndex, sal_uInt16 nFromIndex, sal_uInt16 nWhich ) { const SfxPoolItem* pItem = GetItem( nFromIndex, nWhich ); if( pItem ) PutItem( nToIndex, *pItem ); } -const ScNumFormatAbbrev& ScAutoFormatData::GetNumFormat( USHORT nIndex ) const +const ScNumFormatAbbrev& ScAutoFormatData::GetNumFormat( sal_uInt16 nIndex ) const { return GetField( nIndex ).GetNumFormat(); } -BOOL ScAutoFormatData::IsEqualData( USHORT nIndex1, USHORT nIndex2 ) const +sal_Bool ScAutoFormatData::IsEqualData( sal_uInt16 nIndex1, sal_uInt16 nIndex2 ) const { - BOOL bEqual = TRUE; + sal_Bool bEqual = sal_True; const ScAutoFormatDataField& rField1 = GetField( nIndex1 ); const ScAutoFormatDataField& rField2 = GetField( nIndex2 ); @@ -679,7 +679,7 @@ BOOL ScAutoFormatData::IsEqualData( USHORT nIndex1, USHORT nIndex2 ) const return bEqual; } -void ScAutoFormatData::FillToItemSet( USHORT nIndex, SfxItemSet& rItemSet, ScDocument& rDoc ) const +void ScAutoFormatData::FillToItemSet( sal_uInt16 nIndex, SfxItemSet& rItemSet, ScDocument& rDoc ) const { const ScAutoFormatDataField& rField = GetField( nIndex ); @@ -754,7 +754,7 @@ void ScAutoFormatData::FillToItemSet( USHORT nIndex, SfxItemSet& rItemSet, ScDoc rItemSet.Put( rField.GetBackground() ); } -void ScAutoFormatData::GetFromItemSet( USHORT nIndex, const SfxItemSet& rItemSet, const ScNumFormatAbbrev& rNumFormat ) +void ScAutoFormatData::GetFromItemSet( sal_uInt16 nIndex, const SfxItemSet& rItemSet, const ScNumFormatAbbrev& rNumFormat ) { ScAutoFormatDataField& rField = GetField( nIndex ); @@ -789,10 +789,10 @@ void ScAutoFormatData::GetFromItemSet( USHORT nIndex, const SfxItemSet& rItemSet rField.SetRotateMode ( (const SvxRotateModeItem&) rItemSet.Get( ATTR_ROTATE_MODE ) ); } -BOOL ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions ) +sal_Bool ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions ) { - BOOL bRet = TRUE; - USHORT nVer = 0; + sal_Bool bRet = sal_True; + sal_uInt16 nVer = 0; rStream >> nVer; bRet = 0 == rStream.GetError(); if( bRet && (nVer == AUTOFORMAT_DATA_ID_X || @@ -804,7 +804,7 @@ BOOL ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions ) if( AUTOFORMAT_DATA_ID_552 <= nVer ) { rStream >> nStrResId; - USHORT nId = RID_SVXSTR_TBLAFMT_BEGIN + nStrResId; + sal_uInt16 nId = RID_SVXSTR_TBLAFMT_BEGIN + nStrResId; if( RID_SVXSTR_TBLAFMT_BEGIN <= nId && nId < RID_SVXSTR_TBLAFMT_END ) { @@ -814,7 +814,7 @@ BOOL ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions ) nStrResId = USHRT_MAX; } - BOOL b; + sal_Bool b; rStream >> b; bIncludeFont = b; rStream >> b; bIncludeJustify = b; rStream >> b; bIncludeFrame = b; @@ -823,25 +823,25 @@ BOOL ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions ) rStream >> b; bIncludeWidthHeight = b; bRet = 0 == rStream.GetError(); - for( USHORT i = 0; bRet && i < 16; ++i ) + for( sal_uInt16 i = 0; bRet && i < 16; ++i ) bRet = GetField( i ).Load( rStream, rVersions, nVer ); } else - bRet = FALSE; + bRet = false; return bRet; } #ifdef READ_OLDVERS -BOOL ScAutoFormatData::LoadOld( SvStream& rStream, const ScAfVersions& rVersions ) +sal_Bool ScAutoFormatData::LoadOld( SvStream& rStream, const ScAfVersions& rVersions ) { - BOOL bRet = TRUE; - USHORT nVal = 0; + sal_Bool bRet = sal_True; + sal_uInt16 nVal = 0; rStream >> nVal; bRet = (rStream.GetError() == 0); if (bRet && (nVal == AUTOFORMAT_OLD_DATA_ID)) { rStream.ReadByteString( aName, rStream.GetStreamCharSet() ); - BOOL b; + sal_Bool b; rStream >> b; bIncludeFont = b; rStream >> b; bIncludeJustify = b; rStream >> b; bIncludeFrame = b; @@ -850,19 +850,19 @@ BOOL ScAutoFormatData::LoadOld( SvStream& rStream, const ScAfVersions& rVersions rStream >> b; bIncludeWidthHeight = b; bRet = 0 == rStream.GetError(); - for (USHORT i=0; bRet && i < 16; i++) + for (sal_uInt16 i=0; bRet && i < 16; i++) bRet = GetField( i ).LoadOld( rStream, rVersions ); } else - bRet = FALSE; + bRet = false; return bRet; } #endif -BOOL ScAutoFormatData::Save(SvStream& rStream) +sal_Bool ScAutoFormatData::Save(SvStream& rStream) { - USHORT nVal = AUTOFORMAT_DATA_ID; - BOOL b; + sal_uInt16 nVal = AUTOFORMAT_DATA_ID; + sal_Bool b; rStream << nVal; // --- from 680/dr25 on: store strings as UTF-8 rStream.WriteByteString( aName, RTL_TEXTENCODING_UTF8 ); @@ -875,8 +875,8 @@ BOOL ScAutoFormatData::Save(SvStream& rStream) rStream << ( b = bIncludeValueFormat ); rStream << ( b = bIncludeWidthHeight ); - BOOL bRet = 0 == rStream.GetError(); - for (USHORT i = 0; bRet && (i < 16); i++) + sal_Bool bRet = 0 == rStream.GetError(); + for (sal_uInt16 i = 0; bRet && (i < 16); i++) bRet = GetField( i ).Save( rStream ); return bRet; @@ -885,9 +885,9 @@ BOOL ScAutoFormatData::Save(SvStream& rStream) //--------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------- -ScAutoFormat::ScAutoFormat(USHORT nLim, USHORT nDel, BOOL bDup): +ScAutoFormat::ScAutoFormat(sal_uInt16 nLim, sal_uInt16 nDel, sal_Bool bDup): ScSortedCollection (nLim, nDel, bDup), - bSaveLater (FALSE) + bSaveLater (false) { // create default autoformat ScAutoFormatData* pData = new ScAutoFormatData; @@ -933,7 +933,7 @@ ScAutoFormat::ScAutoFormat(USHORT nLim, USHORT nDel, BOOL bDup): SvxBrushItem aGray70Back( Color(0x4d, 0x4d, 0x4d), ATTR_BACKGROUND ); SvxBrushItem aGray20Back( Color(0xcc, 0xcc, 0xcc), ATTR_BACKGROUND ); - for (USHORT i=0; i<16; i++) + for (sal_uInt16 i=0; i<16; i++) { pData->PutItem( i, aBox ); pData->PutItem( i, aFontItem ); @@ -972,7 +972,7 @@ ScAutoFormat::ScAutoFormat(USHORT nLim, USHORT nDel, BOOL bDup): ScAutoFormat::ScAutoFormat(const ScAutoFormat& rAutoFormat) : ScSortedCollection (rAutoFormat), - bSaveLater (FALSE) + bSaveLater (false) {} ScAutoFormat::~ScAutoFormat() @@ -984,7 +984,7 @@ ScAutoFormat::~ScAutoFormat() Save(); } -void ScAutoFormat::SetSaveLater( BOOL bSet ) +void ScAutoFormat::SetSaveLater( sal_Bool bSet ) { bSaveLater = bSet; } @@ -1003,9 +1003,9 @@ short ScAutoFormat::Compare(ScDataObject* pKey1, ScDataObject* pKey2) const return (short) ScGlobal::GetpTransliteration()->compareString( aStr1, aStr2 ); } -BOOL ScAutoFormat::Load() +sal_Bool ScAutoFormat::Load() { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; INetURLObject aURL; SvtPathOptions aPathOpt; @@ -1013,14 +1013,14 @@ BOOL ScAutoFormat::Load() aURL.setFinalSlash(); aURL.Append( String( RTL_CONSTASCII_USTRINGPARAM( sAutoTblFmtName ) ) ); - SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READ, TRUE ); + SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_READ, sal_True ); SvStream* pStream = aMedium.GetInStream(); bRet = (pStream && pStream->GetError() == 0); if (bRet) { SvStream& rStream = *pStream; // Achtung hier muss ein allgemeiner Header gelesen werden - USHORT nVal = 0; + sal_uInt16 nVal = 0; rStream >> nVal; bRet = 0 == rStream.GetError(); @@ -1031,11 +1031,11 @@ BOOL ScAutoFormat::Load() if( nVal == AUTOFORMAT_ID_358 || (AUTOFORMAT_ID_504 <= nVal && nVal <= AUTOFORMAT_ID) ) { - UINT16 nFileVers = SOFFICE_FILEFORMAT_40; - BYTE nChrSet, nCnt; + sal_uInt16 nFileVers = SOFFICE_FILEFORMAT_40; + sal_uInt8 nChrSet, nCnt; long nPos = rStream.Tell(); rStream >> nCnt >> nChrSet; - if( rStream.Tell() != ULONG(nPos + nCnt) ) + if( rStream.Tell() != sal_uLong(nPos + nCnt) ) { DBG_ERRORFILE( "Der Header enthaelt mehr/neuere Daten" ); rStream.Seek( nPos + nCnt ); @@ -1050,10 +1050,10 @@ BOOL ScAutoFormat::Load() aVersions.Load( rStream, nVal ); // Item-Versionen ScAutoFormatData* pData; - USHORT nAnz = 0; + sal_uInt16 nAnz = 0; rStream >> nAnz; bRet = (rStream.GetError() == 0); - for (USHORT i=0; bRet && (i < nAnz); i++) + for (sal_uInt16 i=0; bRet && (i < nAnz); i++) { pData = new ScAutoFormatData(); bRet = pData->Load(rStream, aVersions); @@ -1087,10 +1087,10 @@ BOOL ScAutoFormat::Load() AUTOFORMAT_OLD_ID_NEW == nVal ) { ScAutoFormatData* pData; - USHORT nAnz = 0; + sal_uInt16 nAnz = 0; rStream >> nAnz; bRet = 0 == rStream.GetError(); - for( USHORT i=0; bRet && (i < nAnz); ++i ) + for( sal_uInt16 i=0; bRet && (i < nAnz); ++i ) { pData = new ScAutoFormatData(); bRet = pData->LoadOld( rStream, aVersions ); @@ -1098,18 +1098,18 @@ BOOL ScAutoFormat::Load() } } else - bRet = FALSE; + bRet = false; } #endif } } - bSaveLater = FALSE; + bSaveLater = false; return bRet; } -BOOL ScAutoFormat::Save() +sal_Bool ScAutoFormat::Save() { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; INetURLObject aURL; SvtPathOptions aPathOpt; @@ -1117,7 +1117,7 @@ BOOL ScAutoFormat::Save() aURL.setFinalSlash(); aURL.Append( String( RTL_CONSTASCII_USTRINGPARAM( sAutoTblFmtName ) ) ); - SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_WRITE, TRUE ); + SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), STREAM_WRITE, sal_True ); SvStream* pStream = aMedium.GetOutStream(); bRet = (pStream && pStream->GetError() == 0); if (bRet) @@ -1126,32 +1126,32 @@ BOOL ScAutoFormat::Save() rStream.SetVersion( SOFFICE_FILEFORMAT_40 ); // Achtung hier muss ein allgemeiner Header gespeichert werden - USHORT nVal = AUTOFORMAT_ID; + sal_uInt16 nVal = AUTOFORMAT_ID; rStream << nVal - << (BYTE)2 // Anzahl von Zeichen des Headers incl. diesem - << (BYTE)::GetSOStoreTextEncoding( - gsl_getSystemTextEncoding(), sal::static_int_cast<USHORT>(rStream.GetVersion()) ); + << (sal_uInt8)2 // Anzahl von Zeichen des Headers incl. diesem + << (sal_uInt8)::GetSOStoreTextEncoding( + gsl_getSystemTextEncoding(), sal::static_int_cast<sal_uInt16>(rStream.GetVersion()) ); ScAfVersions::Write(rStream); // Item-Versionen bRet = (rStream.GetError() == 0); //----------------------------------------------------------- - rStream << (USHORT)(nCount - 1); + rStream << (sal_uInt16)(nCount - 1); bRet = (rStream.GetError() == 0); - for (USHORT i=1; bRet && (i < nCount); i++) + for (sal_uInt16 i=1; bRet && (i < nCount); i++) bRet = ((ScAutoFormatData*)pItems[i])->Save(rStream); rStream.Flush(); aMedium.Commit(); } - bSaveLater = FALSE; + bSaveLater = false; return bRet; } -USHORT ScAutoFormat::FindIndexPerName( const String& rName ) const +sal_uInt16 ScAutoFormat::FindIndexPerName( const String& rName ) const { String aName; - for( USHORT i=0; i<nCount ; i++ ) + for( sal_uInt16 i=0; i<nCount ; i++ ) { ScAutoFormatData* pItem = (ScAutoFormatData*)pItems[i]; pItem->GetName( aName ); |