summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/impex.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/docshell/impex.cxx')
-rw-r--r--sc/source/ui/docshell/impex.cxx314
1 files changed, 157 insertions, 157 deletions
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index a17279f409a9..244f80dd0d5a 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -112,9 +112,9 @@ enum SylkVersion
ScImportExport::ScImportExport( ScDocument* p )
: pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
- bFormulas( FALSE ), bIncludeFiltered( TRUE ),
- bAll( TRUE ), bSingle( TRUE ), bUndo( FALSE ),
- bOverflow( FALSE ), mbApi( true ), mExportTextOptions()
+ bFormulas( sal_False ), bIncludeFiltered( sal_True ),
+ bAll( sal_True ), bSingle( sal_True ), bUndo( sal_False ),
+ bOverflow( sal_False ), mbApi( true ), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -127,9 +127,9 @@ ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt )
: pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
aRange( rPt ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
- bFormulas( FALSE ), bIncludeFiltered( TRUE ),
- bAll( FALSE ), bSingle( TRUE ), bUndo( BOOL( pDocSh != NULL ) ),
- bOverflow( FALSE ), mbApi( true ), mExportTextOptions()
+ bFormulas( sal_False ), bIncludeFiltered( sal_True ),
+ bAll( sal_False ), bSingle( sal_True ), bUndo( sal_Bool( pDocSh != NULL ) ),
+ bOverflow( sal_False ), mbApi( true ), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -137,15 +137,15 @@ ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt )
// ctor with a range is only used for export
-//! ctor with a string (and bSingle=TRUE) is also used for DdeSetData
+//! ctor with a string (and bSingle=sal_True) is also used for DdeSetData
ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
: pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
aRange( r ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
- bFormulas( FALSE ), bIncludeFiltered( TRUE ),
- bAll( FALSE ), bSingle( FALSE ), bUndo( BOOL( pDocSh != NULL ) ),
- bOverflow( FALSE ), mbApi( true ), mExportTextOptions()
+ bFormulas( sal_False ), bIncludeFiltered( sal_True ),
+ bAll( sal_False ), bSingle( sal_False ), bUndo( sal_Bool( pDocSh != NULL ) ),
+ bOverflow( sal_False ), mbApi( true ), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -160,9 +160,9 @@ ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
ScImportExport::ScImportExport( ScDocument* p, const String& rPos )
: pDocSh( PTR_CAST(ScDocShell,p->GetDocumentShell()) ), pDoc( p ),
nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
- bFormulas( FALSE ), bIncludeFiltered( TRUE ),
- bAll( FALSE ), bSingle( TRUE ), bUndo( BOOL( pDocSh != NULL ) ),
- bOverflow( FALSE ), mbApi( true ), mExportTextOptions()
+ bFormulas( sal_False ), bIncludeFiltered( sal_True ),
+ bAll( sal_False ), bSingle( sal_True ), bUndo( sal_Bool( pDocSh != NULL ) ),
+ bOverflow( sal_False ), mbApi( true ), mExportTextOptions()
{
pUndoDoc = NULL;
pExtOptions = NULL;
@@ -174,7 +174,7 @@ ScImportExport::ScImportExport( ScDocument* p, const String& rPos )
ScRangeName* pRange = pDoc->GetRangeName();
if( pRange )
{
- USHORT nPos;
+ sal_uInt16 nPos;
if( pRange->SearchName( aPos, nPos ) )
{
ScRangeData* pData = (*pRange)[ nPos ];
@@ -187,12 +187,12 @@ ScImportExport::ScImportExport( ScDocument* p, const String& rPos )
formula::FormulaGrammar::AddressConvention eConv = pDoc->GetAddressConvention();
// Bereich?
if( aRange.Parse( aPos, pDoc, eConv ) & SCA_VALID )
- bSingle = FALSE;
+ bSingle = sal_False;
// Zelle?
else if( aRange.aStart.Parse( aPos, pDoc, eConv ) & SCA_VALID )
aRange.aEnd = aRange.aStart;
else
- bAll = TRUE;
+ bAll = sal_True;
}
@@ -217,9 +217,9 @@ void ScImportExport::SetExtOptions( const ScAsciiOptions& rOpt )
}
-BOOL ScImportExport::IsFormatSupported( ULONG nFormat )
+sal_Bool ScImportExport::IsFormatSupported( sal_uLong nFormat )
{
- return BOOL( nFormat == FORMAT_STRING
+ return sal_Bool( nFormat == FORMAT_STRING
|| nFormat == SOT_FORMATSTR_ID_SYLK
|| nFormat == SOT_FORMATSTR_ID_LINK
|| nFormat == SOT_FORMATSTR_ID_HTML
@@ -233,7 +233,7 @@ BOOL ScImportExport::IsFormatSupported( ULONG nFormat )
// Vorbereitung fuer Undo: Undo-Dokument erzeugen
-BOOL ScImportExport::StartPaste()
+sal_Bool ScImportExport::StartPaste()
{
if ( !bAll )
{
@@ -243,16 +243,16 @@ BOOL ScImportExport::StartPaste()
InfoBox aInfoBox(Application::GetDefDialogParent(),
ScGlobal::GetRscString( aTester.GetMessageId() ) );
aInfoBox.Execute();
- return FALSE;
+ return sal_False;
}
}
if( bUndo && pDocSh && pDoc->IsUndoEnabled())
{
pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() );
- pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, FALSE, pUndoDoc );
+ pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, sal_False, pUndoDoc );
}
- return TRUE;
+ return sal_True;
}
// Nachbereitung Insert: Undo/Redo-Aktionen erzeugen, Invalidate/Repaint
@@ -260,14 +260,14 @@ BOOL ScImportExport::StartPaste()
void ScImportExport::EndPaste()
{
- BOOL bHeight = pDocSh && pDocSh->AdjustRowHeight(
+ sal_Bool bHeight = pDocSh && pDocSh->AdjustRowHeight(
aRange.aStart.Row(), aRange.aEnd.Row(), aRange.aStart.Tab() );
if( pUndoDoc && pDoc->IsUndoEnabled() )
{
ScDocument* pRedoDoc = new ScDocument( SCDOCMODE_UNDO );
pRedoDoc->InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() );
- pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, FALSE, pRedoDoc );
+ pDoc->CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, sal_False, pRedoDoc );
ScMarkData aDestMark;
aDestMark.SelectOneTable( aRange.aStart.Tab() );
pDocSh->GetUndoManager()->AddUndoAction(
@@ -293,9 +293,9 @@ void ScImportExport::EndPaste()
#if 0
-BOOL ScImportExport::ImportData( SvData& rData )
+sal_Bool ScImportExport::ImportData( SvData& rData )
{
- ULONG nFmt = rData.GetFormat();
+ sal_uLong nFmt = rData.GetFormat();
if ( nFmt == SOT_FORMATSTR_ID_HTML_SIMPLE )
{
MSE40HTMLClipFormatObj aMSE40ClpObj;
@@ -304,12 +304,12 @@ BOOL ScImportExport::ImportData( SvData& rData )
SvStream* pStream = aMSE40ClpObj.GetStream();
return ImportStream( *pStream, nFmt );
}
- return FALSE;
+ return sal_False;
}
else
{
void* pMem;
- ULONG nSize = rData.GetMinMemorySize();
+ sal_uLong nSize = rData.GetMinMemorySize();
rData.GetData( &pMem, TRANSFER_REFERENCE );
if( nFmt == FORMAT_STRING
|| nFmt == FORMAT_RTF
@@ -336,14 +336,14 @@ BOOL ScImportExport::ImportData( SvData& rData )
#endif
-BOOL ScImportExport::ImportData( const String& /* rMimeType */,
+sal_Bool ScImportExport::ImportData( const String& /* rMimeType */,
const ::com::sun::star::uno::Any & /* rValue */ )
{
DBG_ASSERT( !this, "Implementation is missing" );
- return FALSE;
+ return sal_False;
}
-BOOL ScImportExport::ExportData( const String& rMimeType,
+sal_Bool ScImportExport::ExportData( const String& rMimeType,
::com::sun::star::uno::Any & rValue )
{
SvMemoryStream aStrm;
@@ -351,17 +351,17 @@ BOOL ScImportExport::ExportData( const String& rMimeType,
if( ExportStream( aStrm, String(),
SotExchange::GetFormatIdFromMimeType( rMimeType ) ))
{
- aStrm << (BYTE) 0;
+ aStrm << (sal_uInt8) 0;
rValue <<= ::com::sun::star::uno::Sequence< sal_Int8 >(
(sal_Int8*)aStrm.GetData(),
aStrm.Seek( STREAM_SEEK_TO_END ) );
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL ScImportExport::ImportString( const ::rtl::OUString& rText, ULONG nFmt )
+sal_Bool ScImportExport::ImportString( const ::rtl::OUString& rText, sal_uLong nFmt )
{
switch ( nFmt )
{
@@ -386,14 +386,14 @@ BOOL ScImportExport::ImportString( const ::rtl::OUString& rText, ULONG nFmt )
}
-BOOL ScImportExport::ExportString( ::rtl::OUString& rText, ULONG nFmt )
+sal_Bool ScImportExport::ExportString( ::rtl::OUString& rText, sal_uLong nFmt )
{
DBG_ASSERT( nFmt == FORMAT_STRING, "ScImportExport::ExportString: Unicode not supported for other formats than FORMAT_STRING" );
if ( nFmt != FORMAT_STRING )
{
rtl_TextEncoding eEnc = gsl_getSystemTextEncoding();
ByteString aTmp;
- BOOL bOk = ExportByteString( aTmp, eEnc, nFmt );
+ sal_Bool bOk = ExportByteString( aTmp, eEnc, nFmt );
rText = UniString( aTmp, eEnc );
return bOk;
}
@@ -409,16 +409,16 @@ BOOL ScImportExport::ExportString( ::rtl::OUString& rText, ULONG nFmt )
aStrm.Seek( STREAM_SEEK_TO_END );
rText = rtl::OUString( (const sal_Unicode*) aStrm.GetData() );
- return TRUE;
+ return sal_True;
}
rText = rtl::OUString();
- return FALSE;
+ return sal_False;
// ExportStream must handle RTL_TEXTENCODING_UNICODE
}
-BOOL ScImportExport::ExportByteString( ByteString& rText, rtl_TextEncoding eEnc, ULONG nFmt )
+sal_Bool ScImportExport::ExportByteString( ByteString& rText, rtl_TextEncoding eEnc, sal_uLong nFmt )
{
DBG_ASSERT( eEnc != RTL_TEXTENCODING_UNICODE, "ScImportExport::ExportByteString: Unicode not supported" );
if ( eEnc == RTL_TEXTENCODING_UNICODE )
@@ -436,74 +436,74 @@ BOOL ScImportExport::ExportByteString( ByteString& rText, rtl_TextEncoding eEnc,
aStrm << (sal_Char) 0;
aStrm.Seek( STREAM_SEEK_TO_END );
// Sicherheits-Check:
- if( aStrm.Tell() <= (ULONG) STRING_MAXLEN )
+ if( aStrm.Tell() <= (sal_uLong) STRING_MAXLEN )
{
rText = (const sal_Char*) aStrm.GetData();
- return TRUE;
+ return sal_True;
}
}
rText.Erase();
- return FALSE;
+ return sal_False;
}
-BOOL ScImportExport::ImportStream( SvStream& rStrm, const String& rBaseURL, ULONG nFmt )
+sal_Bool ScImportExport::ImportStream( SvStream& rStrm, const String& rBaseURL, sal_uLong nFmt )
{
if( nFmt == FORMAT_STRING )
{
if( ExtText2Doc( rStrm ) ) // pExtOptions auswerten
- return TRUE;
+ return sal_True;
}
if( nFmt == SOT_FORMATSTR_ID_SYLK )
{
if( Sylk2Doc( rStrm ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == SOT_FORMATSTR_ID_DIF )
{
if( Dif2Doc( rStrm ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == FORMAT_RTF )
{
if( RTF2Doc( rStrm, rBaseURL ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == SOT_FORMATSTR_ID_LINK )
- return TRUE; // Link-Import?
+ return sal_True; // Link-Import?
if ( nFmt == SOT_FORMATSTR_ID_HTML )
{
if( HTML2Doc( rStrm, rBaseURL ) )
- return TRUE;
+ return sal_True;
}
if ( nFmt == SOT_FORMATSTR_ID_HTML_SIMPLE )
{
MSE40HTMLClipFormatObj aMSE40ClpObj; // needed to skip the header data
SvStream* pHTML = aMSE40ClpObj.IsValid( rStrm );
if ( pHTML && HTML2Doc( *pHTML, rBaseURL ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
-BOOL ScImportExport::ExportStream( SvStream& rStrm, const String& rBaseURL, ULONG nFmt )
+sal_Bool ScImportExport::ExportStream( SvStream& rStrm, const String& rBaseURL, sal_uLong nFmt )
{
if( nFmt == FORMAT_STRING )
{
if( Doc2Text( rStrm ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == SOT_FORMATSTR_ID_SYLK )
{
if( Doc2Sylk( rStrm ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == SOT_FORMATSTR_ID_DIF )
{
if( Doc2Dif( rStrm ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == SOT_FORMATSTR_ID_LINK && !bAll )
{
@@ -521,7 +521,7 @@ BOOL ScImportExport::ExportStream( SvStream& rStrm, const String& rBaseURL, ULON
if( aDocName.Len() )
{
String aRefName;
- USHORT nFlags = SCA_VALID | SCA_TAB_3D;
+ sal_uInt16 nFlags = SCA_VALID | SCA_TAB_3D;
if( bSingle )
aRange.aStart.Format( aRefName, nFlags, pDoc, pDoc->GetAddressConvention() );
else
@@ -532,33 +532,33 @@ BOOL ScImportExport::ExportStream( SvStream& rStrm, const String& rBaseURL, ULON
}
String aAppName = Application::GetAppName();
- WriteUnicodeOrByteString( rStrm, aAppName, TRUE );
- WriteUnicodeOrByteString( rStrm, aDocName, TRUE );
- WriteUnicodeOrByteString( rStrm, aRefName, TRUE );
+ WriteUnicodeOrByteString( rStrm, aAppName, sal_True );
+ WriteUnicodeOrByteString( rStrm, aDocName, sal_True );
+ WriteUnicodeOrByteString( rStrm, aRefName, sal_True );
if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE )
rStrm << sal_Unicode(0);
else
rStrm << sal_Char(0);
- return BOOL( rStrm.GetError() == SVSTREAM_OK );
+ return sal_Bool( rStrm.GetError() == SVSTREAM_OK );
}
}
if( nFmt == SOT_FORMATSTR_ID_HTML )
{
if( Doc2HTML( rStrm, rBaseURL ) )
- return TRUE;
+ return sal_True;
}
if( nFmt == FORMAT_RTF )
{
if( Doc2RTF( rStrm ) )
- return TRUE;
+ return sal_True;
}
- return FALSE;
+ return sal_False;
}
//static
-void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const String& rString, BOOL bZero )
+void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const String& rString, sal_Bool bZero )
{
rtl_TextEncoding eEnc = rStrm.GetStreamCharSet();
if ( eEnc == RTL_TEXTENCODING_UNICODE )
@@ -622,10 +622,10 @@ static const sal_Unicode* lcl_ScanString( const sal_Unicode* p, String& rString,
sal_Unicode cStr, DoubledQuoteMode eMode )
{
p++; //! jump over opening quote
- BOOL bCont;
+ sal_Bool bCont;
do
{
- bCont = FALSE;
+ bCont = sal_False;
const sal_Unicode* p0 = p;
for( ;; )
{
@@ -643,7 +643,7 @@ static const sal_Unicode* lcl_ScanString( const sal_Unicode* p, String& rString,
break;
case DQM_ESCAPE :
p++; // one for us (breaking for-loop)
- bCont = TRUE; // and more
+ bCont = sal_True; // and more
break;
case DQM_CONCAT :
if ( p0+1 < p )
@@ -817,18 +817,18 @@ inline void lcl_WriteSimpleString( SvStream& rStrm, const String& rString )
//////////////////////////////////////////////////////////////////////////////
-BOOL ScImportExport::Text2Doc( SvStream& rStrm )
+sal_Bool ScImportExport::Text2Doc( SvStream& rStrm )
{
- BOOL bOk = TRUE;
+ sal_Bool bOk = sal_True;
SCCOL nStartCol = aRange.aStart.Col();
SCROW nStartRow = aRange.aStart.Row();
SCCOL nEndCol = aRange.aEnd.Col();
SCROW nEndRow = aRange.aEnd.Row();
- ULONG nOldPos = rStrm.Tell();
+ sal_uLong nOldPos = rStrm.Tell();
if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE )
rStrm.StartReadingUnicodeText();
- BOOL bData = BOOL( !bSingle );
+ sal_Bool bData = sal_Bool( !bSingle );
if( !bSingle)
bOk = StartPaste();
@@ -876,7 +876,7 @@ BOOL ScImportExport::Text2Doc( SvStream& rStrm )
pDoc->SetString( nCol, nRow, aRange.aStart.Tab(), aCell );
}
else // zuviele Spalten/Zeilen
- bOverflow = TRUE; // beim Import Warnung ausgeben
+ bOverflow = sal_True; // beim Import Warnung ausgeben
++nCol;
}
++nRow;
@@ -887,7 +887,7 @@ BOOL ScImportExport::Text2Doc( SvStream& rStrm )
aRange.aEnd.SetCol( nEndCol );
aRange.aEnd.SetRow( nEndRow );
bOk = StartPaste();
- bData = TRUE;
+ bData = sal_True;
}
else
break;
@@ -903,7 +903,7 @@ BOOL ScImportExport::Text2Doc( SvStream& rStrm )
static bool lcl_PutString(
- ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rStr, BYTE nColFormat,
+ ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rStr, sal_uInt8 nColFormat,
SvNumberFormatter* pFormatter, bool bDetectNumFormat,
::utl::TransliterationWrapper& rTransliteration, CalendarWrapper& rCalendar,
::utl::TransliterationWrapper* pSecondTransliteration, CalendarWrapper* pSecondCalendar )
@@ -935,12 +935,12 @@ static bool lcl_PutString(
}
else if ( nColFormat != SC_COL_STANDARD ) // Datumsformate
{
- const USHORT nMaxNumberParts = 7; // Y-M-D h:m:s.t
+ const sal_uInt16 nMaxNumberParts = 7; // Y-M-D h:m:s.t
xub_StrLen nLen = rStr.Len();
xub_StrLen nStart[nMaxNumberParts];
xub_StrLen nEnd[nMaxNumberParts];
- USHORT nDP, nMP, nYP;
+ sal_uInt16 nDP, nMP, nYP;
switch ( nColFormat )
{
case SC_COL_YMD: nDP = 2; nMP = 1; nYP = 0; break;
@@ -949,28 +949,28 @@ static bool lcl_PutString(
default: nDP = 0; nMP = 1; nYP = 2; break;
}
- USHORT nFound = 0;
- BOOL bInNum = FALSE;
+ sal_uInt16 nFound = 0;
+ sal_Bool bInNum = sal_False;
for ( xub_StrLen nPos=0; nPos<nLen && (bInNum ||
nFound<nMaxNumberParts); nPos++ )
{
if (bInNum && nFound == 3 && nColFormat == SC_COL_YMD &&
nPos <= nStart[nFound]+2 && rStr.GetChar(nPos) == 'T')
- bInNum = FALSE; // ISO-8601: YYYY-MM-DDThh:mm...
+ bInNum = sal_False; // ISO-8601: YYYY-MM-DDThh:mm...
else if ((((!bInNum && nFound==nMP) || (bInNum && nFound==nMP+1))
&& ScGlobal::pCharClass->isLetterNumeric( rStr, nPos))
|| ScGlobal::pCharClass->isDigit( rStr, nPos))
{
if (!bInNum)
{
- bInNum = TRUE;
+ bInNum = sal_True;
nStart[nFound] = nPos;
++nFound;
}
nEnd[nFound-1] = nPos;
}
else
- bInNum = FALSE;
+ bInNum = sal_False;
}
if ( nFound == 1 )
@@ -987,13 +987,13 @@ static bool lcl_PutString(
// 8 digits: 4 for year, 2 each for day and month
// 5 or 7 digits: first field is shortened by 1
- BOOL bLongYear = ( nDateLen >= 7 );
- BOOL bShortFirst = ( nDateLen == 5 || nDateLen == 7 );
+ sal_Bool bLongYear = ( nDateLen >= 7 );
+ sal_Bool bShortFirst = ( nDateLen == 5 || nDateLen == 7 );
- USHORT nFieldStart = nDateStart;
- for (USHORT nPos=0; nPos<3; nPos++)
+ sal_uInt16 nFieldStart = nDateStart;
+ for (sal_uInt16 nPos=0; nPos<3; nPos++)
{
- USHORT nFieldEnd = nFieldStart + 1; // default: 2 digits
+ sal_uInt16 nFieldEnd = nFieldStart + 1; // default: 2 digits
if ( bLongYear && nPos == nYP )
nFieldEnd += 2; // 2 extra digits for long year
if ( bShortFirst && nPos == 0 )
@@ -1010,9 +1010,9 @@ static bool lcl_PutString(
if ( nFound >= 3 )
{
using namespace ::com::sun::star;
- BOOL bSecondCal = FALSE;
- USHORT nDay = (USHORT) rStr.Copy( nStart[nDP], nEnd[nDP]+1-nStart[nDP] ).ToInt32();
- USHORT nYear = (USHORT) rStr.Copy( nStart[nYP], nEnd[nYP]+1-nStart[nYP] ).ToInt32();
+ sal_Bool bSecondCal = sal_False;
+ sal_uInt16 nDay = (sal_uInt16) rStr.Copy( nStart[nDP], nEnd[nDP]+1-nStart[nDP] ).ToInt32();
+ sal_uInt16 nYear = (sal_uInt16) rStr.Copy( nStart[nYP], nEnd[nYP]+1-nStart[nYP] ).ToInt32();
String aMStr = rStr.Copy( nStart[nMP], nEnd[nMP]+1-nStart[nMP] );
sal_Int16 nMonth = (sal_Int16) aMStr.ToInt32();
if (!nMonth)
@@ -1048,14 +1048,14 @@ static bool lcl_PutString(
pSecondTransliteration->isEqual( aMStr, xMonths[i].AbbrevName ) )
{
nMonth = sal::static_int_cast<sal_Int16>( i+1 );
- bSecondCal = TRUE;
+ bSecondCal = sal_True;
}
else if ( i == 8 && pSecondTransliteration->isEqual(
aMStr, aSepShortened ) )
{ // #102136# correct English abbreviation is SEPT,
// but data mostly contains SEP only
nMonth = sal::static_int_cast<sal_Int16>( i+1 );
- bSecondCal = TRUE;
+ bSecondCal = sal_True;
}
}
}
@@ -1111,12 +1111,12 @@ static bool lcl_PutString(
LanguageType eDocLang = eLatin; //! which language for date formats?
short nType = (nFound > 3 ? NUMBERFORMAT_DATETIME : NUMBERFORMAT_DATE);
- ULONG nFormat = pDocFormatter->GetStandardFormat( nType, eDocLang );
+ sal_uLong nFormat = pDocFormatter->GetStandardFormat( nType, eDocLang );
// maybe there is a special format including seconds or milliseconds
if (nFound > 5)
nFormat = pDocFormatter->GetStandardFormat( fDays, nFormat, nType, eDocLang);
- pDoc->PutCell( nCol, nRow, nTab, new ScValueCell(fDays), nFormat, FALSE );
+ pDoc->PutCell( nCol, nRow, nTab, new ScValueCell(fDays), nFormat, sal_False );
return bMultiLine; // success
}
@@ -1157,12 +1157,12 @@ String lcl_GetFixed( const String& rLine, xub_StrLen nStart, xub_StrLen nNext, b
return rLine.Copy(nStart, nSpace-nStart);
}
-BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
+sal_Bool ScImportExport::ExtText2Doc( SvStream& rStrm )
{
if (!pExtOptions)
return Text2Doc( rStrm );
- ULONG nOldPos = rStrm.Tell();
+ sal_uLong nOldPos = rStrm.Tell();
rStrm.Seek( STREAM_SEEK_TO_END );
::std::auto_ptr<ScProgress> xProgress( new ScProgress( pDocSh,
ScGlobal::GetRscString( STR_LOAD_DOC ), rStrm.Tell() - nOldPos ));
@@ -1170,21 +1170,21 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE )
rStrm.StartReadingUnicodeText();
- BOOL bOld = ScColumn::bDoubleAlloc;
- ScColumn::bDoubleAlloc = TRUE;
+ sal_Bool bOld = ScColumn::bDoubleAlloc;
+ ScColumn::bDoubleAlloc = sal_True;
SCCOL nStartCol = aRange.aStart.Col();
SCCOL nEndCol = aRange.aEnd.Col();
SCROW nStartRow = aRange.aStart.Row();
SCTAB nTab = aRange.aStart.Tab();
- BOOL bFixed = pExtOptions->IsFixedLen();
+ sal_Bool bFixed = pExtOptions->IsFixedLen();
const String& rSeps = pExtOptions->GetFieldSeps();
const sal_Unicode* pSeps = rSeps.GetBuffer();
- BOOL bMerge = pExtOptions->IsMergeSeps();
- USHORT nInfoCount = pExtOptions->GetInfoCount();
+ sal_Bool bMerge = pExtOptions->IsMergeSeps();
+ sal_uInt16 nInfoCount = pExtOptions->GetInfoCount();
const xub_StrLen* pColStart = pExtOptions->GetColStart();
- const BYTE* pColFormat = pExtOptions->GetColFormat();
+ const sal_uInt8* pColFormat = pExtOptions->GetColFormat();
long nSkipLines = pExtOptions->GetStartRow();
LanguageType eDocLang = pExtOptions->GetLanguage();
@@ -1211,7 +1211,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
}
String aLine, aCell;
- USHORT i;
+ sal_uInt16 i;
SCROW nRow = nStartRow;
while(--nSkipLines>0)
@@ -1233,7 +1233,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
bool bQuotedAsText = pExtOptions && pExtOptions->IsQuotedAsText();
- ULONG nOriginalStreamPos = rStrm.Tell();
+ sal_uLong nOriginalStreamPos = rStrm.Tell();
do
{
@@ -1254,11 +1254,11 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
// SC_COL_SKIP.
for ( i=0; i<nInfoCount && nCol <= MAXCOL+1; i++ )
{
- BYTE nFmt = pColFormat[i];
+ sal_uInt8 nFmt = pColFormat[i];
if (nFmt != SC_COL_SKIP) // sonst auch nCol nicht hochzaehlen
{
if (nCol > MAXCOL)
- bOverflow = TRUE; // display warning on import
+ bOverflow = sal_True; // display warning on import
else if (!bDetermineRange)
{
xub_StrLen nStart = pColStart[i];
@@ -1280,7 +1280,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
else // Nach Trennzeichen suchen
{
SCCOL nSourceCol = 0;
- USHORT nInfoStart = 0;
+ sal_uInt16 nInfoStart = 0;
const sal_Unicode* p = aLine.GetBuffer();
// Yes, the check is nCol<=MAXCOL+1, +1 because it is only an
// overflow if there is really data following to be put behind
@@ -1291,7 +1291,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
bool bIsQuoted = false;
p = ScImportExport::ScanNextFieldFromString( p, aCell, cStr, pSeps, bMerge, bIsQuoted );
- BYTE nFmt = SC_COL_STANDARD;
+ sal_uInt8 nFmt = SC_COL_STANDARD;
for ( i=nInfoStart; i<nInfoCount; i++ )
{
if ( pColStart[i] == nSourceCol + 1 ) // pColStart ist 1-basiert
@@ -1304,7 +1304,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
if ( nFmt != SC_COL_SKIP )
{
if (nCol > MAXCOL)
- bOverflow = TRUE; // display warning on import
+ bOverflow = sal_True; // display warning on import
else if (!bDetermineRange)
{
if (bIsQuoted && bQuotedAsText)
@@ -1333,7 +1333,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
++nRow;
if ( nRow > MAXROW )
{
- bOverflow = TRUE; // display warning on import
+ bOverflow = sal_True; // display warning on import
break; // for
}
}
@@ -1356,7 +1356,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
{
delete pEnglishTransliteration;
delete pEnglishCalendar;
- return FALSE;
+ return sal_False;
}
}
@@ -1365,7 +1365,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
if (!StartPaste())
{
EndPaste();
- return FALSE;
+ return sal_False;
}
}
@@ -1382,7 +1382,7 @@ BOOL ScImportExport::ExtText2Doc( SvStream& rStrm )
if (bRangeIsDetermined)
EndPaste();
- return TRUE;
+ return sal_True;
}
@@ -1428,7 +1428,7 @@ const sal_Unicode* ScImportExport::ScanNextFieldFromString( const sal_Unicode* p
//
-BOOL ScImportExport::Doc2Text( SvStream& rStrm )
+sal_Bool ScImportExport::Doc2Text( SvStream& rStrm )
{
SCCOL nCol;
SCROW nRow;
@@ -1453,7 +1453,7 @@ BOOL ScImportExport::Doc2Text( SvStream& rStrm )
{
if (bFormulas)
{
- pDoc->GetFormula( nCol, nRow, aRange.aStart.Tab(), aCell, TRUE );
+ pDoc->GetFormula( nCol, nRow, aRange.aStart.Tab(), aCell, sal_True );
if( aCell.Search( cSep ) != STRING_NOTFOUND )
lcl_WriteString( rStrm, aCell, cStr, cStr );
else
@@ -1525,14 +1525,14 @@ BOOL ScImportExport::Doc2Text( SvStream& rStrm )
}
}
- return BOOL( rStrm.GetError() == SVSTREAM_OK );
+ return sal_Bool( rStrm.GetError() == SVSTREAM_OK );
}
-BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
+sal_Bool ScImportExport::Sylk2Doc( SvStream& rStrm )
{
- BOOL bOk = TRUE;
- BOOL bMyDoc = FALSE;
+ sal_Bool bOk = sal_True;
+ sal_Bool bMyDoc = sal_False;
SylkVersion eVersion = SYLK_OTHER;
// US-English separators for StringToDouble
@@ -1543,8 +1543,8 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
SCROW nStartRow = aRange.aStart.Row();
SCCOL nEndCol = aRange.aEnd.Col();
SCROW nEndRow = aRange.aEnd.Row();
- ULONG nOldPos = rStrm.Tell();
- BOOL bData = BOOL( !bSingle );
+ sal_uLong nOldPos = rStrm.Tell();
+ sal_Bool bData = sal_Bool( !bSingle );
SvULongs aFormats;
if( !bSingle)
@@ -1572,7 +1572,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
if( cTag == 'C' ) // Content
{
if( *p++ != ';' )
- return FALSE;
+ return sal_False;
while( *p )
{
sal_Unicode ch = *p++;
@@ -1606,15 +1606,15 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
nEndCol = nCol;
break;
}
- BOOL bText;
+ sal_Bool bText;
if( *p == '"' )
{
- bText = TRUE;
+ bText = sal_True;
aText.Erase();
p = lcl_ScanSylkString( p, aText, eVersion);
}
else
- bText = FALSE;
+ bText = sal_False;
const sal_Unicode* q = p;
while( *q && *q != ';' )
q++;
@@ -1624,7 +1624,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
{
pDoc->PutCell( nCol, nRow, aRange.aStart.Tab(),
ScBaseCell::CreateTextCell( aText, pDoc),
- (BOOL) TRUE);
+ (sal_Bool) sal_True);
}
else
{
@@ -1668,7 +1668,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
if ( ch == 'M' )
{
ScMarkData aMark;
- aMark.SelectTable( aPos.Tab(), TRUE );
+ aMark.SelectTable( aPos.Tab(), sal_True );
pDoc->InsertMatrixFormula( nCol, nRow, nRefCol,
nRefRow, aMark, EMPTY_STRING, pCode );
}
@@ -1691,7 +1691,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
else if( cTag == 'F' ) // Format
{
if( *p++ != ';' )
- return FALSE;
+ return sal_False;
sal_Int32 nFormat = -1;
while( *p )
{
@@ -1733,7 +1733,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
}
if ( 0 <= nFormat && nFormat < aFormats.Count() )
{
- ULONG nKey = aFormats[(USHORT)nFormat];
+ sal_uLong nKey = aFormats[(sal_uInt16)nFormat];
pDoc->ApplyAttr( nCol, nRow, aRange.aStart.Tab(),
SfxUInt32Item( ATTR_VALUE_FORMAT, nKey ) );
}
@@ -1780,7 +1780,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
aRange.aEnd.SetCol( nEndCol );
aRange.aEnd.SetRow( nEndRow );
bOk = StartPaste();
- bData = TRUE;
+ bData = sal_True;
}
else
break;
@@ -1791,7 +1791,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
}
-BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
+sal_Bool ScImportExport::Doc2Sylk( SvStream& rStrm )
{
SCCOL nCol;
SCROW nRow;
@@ -1811,7 +1811,7 @@ BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
{
String aBufStr;
double nVal;
- BOOL bForm = FALSE;
+ sal_Bool bForm = sal_False;
SCROW r = nRow - nStartRow + 1;
SCCOL c = nCol - nStartCol + 1;
ScBaseCell* pCell;
@@ -1832,7 +1832,7 @@ BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
aValStr = ::rtl::math::doubleToUString( nVal,
rtl_math_StringFormat_Automatic,
- rtl_math_DecimalPlaces_Max, '.', TRUE );
+ rtl_math_DecimalPlaces_Max, '.', sal_True );
aBufStr.AssignAscii(RTL_CONSTASCII_STRINGPARAM( "C;X" ));
aBufStr += String::CreateFromInt32( c );
@@ -1931,35 +1931,35 @@ BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
}
lcl_WriteSimpleString( rStrm, String( 'E' ) );
WriteUnicodeOrByteEndl( rStrm );
- return BOOL( rStrm.GetError() == SVSTREAM_OK );
+ return sal_Bool( rStrm.GetError() == SVSTREAM_OK );
}
-BOOL ScImportExport::Doc2HTML( SvStream& rStrm, const String& rBaseURL )
+sal_Bool ScImportExport::Doc2HTML( SvStream& rStrm, const String& rBaseURL )
{
// CharSet is ignored in ScExportHTML, read from Load/Save HTML options
ScFormatFilter::Get().ScExportHTML( rStrm, rBaseURL, pDoc, aRange, RTL_TEXTENCODING_DONTKNOW, bAll,
aStreamPath, aNonConvertibleChars );
- return BOOL( rStrm.GetError() == SVSTREAM_OK );
+ return sal_Bool( rStrm.GetError() == SVSTREAM_OK );
}
-BOOL ScImportExport::Doc2RTF( SvStream& rStrm )
+sal_Bool ScImportExport::Doc2RTF( SvStream& rStrm )
{
// CharSet is ignored in ScExportRTF
ScFormatFilter::Get().ScExportRTF( rStrm, pDoc, aRange, RTL_TEXTENCODING_DONTKNOW );
- return BOOL( rStrm.GetError() == SVSTREAM_OK );
+ return sal_Bool( rStrm.GetError() == SVSTREAM_OK );
}
-BOOL ScImportExport::Doc2Dif( SvStream& rStrm )
+sal_Bool ScImportExport::Doc2Dif( SvStream& rStrm )
{
// for DIF in the clipboard, IBM_850 is always used
ScFormatFilter::Get().ScExportDif( rStrm, pDoc, aRange, RTL_TEXTENCODING_IBM_850 );
- return TRUE;
+ return sal_True;
}
-BOOL ScImportExport::Dif2Doc( SvStream& rStrm )
+sal_Bool ScImportExport::Dif2Doc( SvStream& rStrm )
{
SCTAB nTab = aRange.aStart.Tab();
ScDocument* pImportDoc = new ScDocument( SCDOCMODE_UNDO );
@@ -1978,12 +1978,12 @@ BOOL ScImportExport::Dif2Doc( SvStream& rStrm )
nEndRow = aRange.aStart.Row();
aRange.aEnd = ScAddress( nEndCol, nEndRow, nTab );
- BOOL bOk = StartPaste();
+ sal_Bool bOk = StartPaste();
if (bOk)
{
- USHORT nFlags = IDF_ALL & ~IDF_STYLES;
+ sal_uInt16 nFlags = IDF_ALL & ~IDF_STYLES;
pDoc->DeleteAreaTab( aRange, nFlags );
- pImportDoc->CopyToDocument( aRange, nFlags, FALSE, pDoc );
+ pImportDoc->CopyToDocument( aRange, nFlags, sal_False, pDoc );
EndPaste();
}
@@ -1993,7 +1993,7 @@ BOOL ScImportExport::Dif2Doc( SvStream& rStrm )
}
-BOOL ScImportExport::RTF2Doc( SvStream& rStrm, const String& rBaseURL )
+sal_Bool ScImportExport::RTF2Doc( SvStream& rStrm, const String& rBaseURL )
{
ScEEAbsImport *pImp = ScFormatFilter::Get().CreateRTFImport( pDoc, aRange );
if (!pImp)
@@ -2001,10 +2001,10 @@ BOOL ScImportExport::RTF2Doc( SvStream& rStrm, const String& rBaseURL )
pImp->Read( rStrm, rBaseURL );
aRange = pImp->GetRange();
- BOOL bOk = StartPaste();
+ sal_Bool bOk = StartPaste();
if (bOk)
{
- USHORT nFlags = IDF_ALL & ~IDF_STYLES;
+ sal_uInt16 nFlags = IDF_ALL & ~IDF_STYLES;
pDoc->DeleteAreaTab( aRange, nFlags );
pImp->WriteToDocument();
EndPaste();
@@ -2014,15 +2014,15 @@ BOOL ScImportExport::RTF2Doc( SvStream& rStrm, const String& rBaseURL )
}
-BOOL ScImportExport::HTML2Doc( SvStream& rStrm, const String& rBaseURL )
+sal_Bool ScImportExport::HTML2Doc( SvStream& rStrm, const String& rBaseURL )
{
- ScEEAbsImport *pImp = ScFormatFilter::Get().CreateHTMLImport( pDoc, rBaseURL, aRange, TRUE);
+ ScEEAbsImport *pImp = ScFormatFilter::Get().CreateHTMLImport( pDoc, rBaseURL, aRange, sal_True);
if (!pImp)
return false;
pImp->Read( rStrm, rBaseURL );
aRange = pImp->GetRange();
- BOOL bOk = StartPaste();
+ sal_Bool bOk = StartPaste();
if (bOk)
{
// ScHTMLImport may call ScDocument::InitDrawLayer, resulting in
@@ -2030,7 +2030,7 @@ BOOL ScImportExport::HTML2Doc( SvStream& rStrm, const String& rBaseURL )
if (pDocSh)
pDocSh->MakeDrawLayer();
- USHORT nFlags = IDF_ALL & ~IDF_STYLES;
+ sal_uInt16 nFlags = IDF_ALL & ~IDF_STYLES;
pDoc->DeleteAreaTab( aRange, nFlags );
pImp->WriteToDocument();
EndPaste();
@@ -2051,21 +2051,21 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin {
virtual FltError ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT ) RETURN_ERROR
virtual FltError ScImportStarCalc10( SvStream&, ScDocument* ) RETURN_ERROR
virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress&,
- const CharSet, UINT32 ) RETURN_ERROR
+ const CharSet, sal_uInt32 ) RETURN_ERROR
virtual FltError ScImportRTF( SvStream&, const String&, ScDocument*, ScRange& ) RETURN_ERROR
- virtual FltError ScImportHTML( SvStream&, const String&, ScDocument*, ScRange&, double, BOOL, SvNumberFormatter*, bool ) RETURN_ERROR
+ virtual FltError ScImportHTML( SvStream&, const String&, ScDocument*, ScRange&, double, sal_Bool, SvNumberFormatter*, bool ) RETURN_ERROR
virtual ScEEAbsImport *CreateRTFImport( ScDocument*, const ScRange& ) { return NULL; }
- virtual ScEEAbsImport *CreateHTMLImport( ScDocument*, const String&, const ScRange&, BOOL ) { return NULL; }
+ virtual ScEEAbsImport *CreateHTMLImport( ScDocument*, const String&, const ScRange&, sal_Bool ) { return NULL; }
virtual String GetHTMLRangeNameList( ScDocument*, const String& ) { return String(); }
#if ENABLE_LOTUS123_EXPORT
virtual FltError ScExportLotus123( SvStream&, ScDocument*, ExportFormatLotus, CharSet ) RETURN_ERROR
#endif
virtual FltError ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel, CharSet ) RETURN_ERROR
- virtual FltError ScExportDif( SvStream&, ScDocument*, const ScAddress&, const CharSet, UINT32 ) RETURN_ERROR
- virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange&, const CharSet, UINT32 ) RETURN_ERROR
- virtual FltError ScExportHTML( SvStream&, const String&, ScDocument*, const ScRange&, const CharSet, BOOL,
+ virtual FltError ScExportDif( SvStream&, ScDocument*, const ScAddress&, const CharSet, sal_uInt32 ) RETURN_ERROR
+ virtual FltError ScExportDif( SvStream&, ScDocument*, const ScRange&, const CharSet, sal_uInt32 ) RETURN_ERROR
+ virtual FltError ScExportHTML( SvStream&, const String&, ScDocument*, const ScRange&, const CharSet, sal_Bool,
const String&, String& ) RETURN_ERROR
virtual FltError ScExportRTF( SvStream&, ScDocument*, const ScRange&, const CharSet ) RETURN_ERROR
};