diff --git a/main/l10ntools/source/cfglex.l b/main/l10ntools/source/cfglex.l index 4ee3994d06c..ce6de795029 100644 --- a/main/l10ntools/source/cfglex.l +++ b/main/l10ntools/source/cfglex.l @@ -53,16 +53,16 @@ /* external functions (C++ code, declared as extern "C" */ extern int WorkOnTokenSet( int, char* ); extern int InitCfgExport( char * , char *); -extern int EndCfgExport(); -extern int GetError(); -extern int SetError(); +extern int EndCfgExport(void); +extern int GetError(void); +extern int SetError(void); extern char *GetOutputFile( int argc, char* argv[]); -extern FILE *GetCfgFile(); -extern int isQuiet(); -extern void removeTempFile(); -extern char* getFilename(); +extern FILE *GetCfgFile(void); +extern int isQuiet(void); +extern void removeTempFile(void); +extern char* getFilename(void); /* forwards */ -void YYWarning(); +void YYWarning(char *); int bText=0; %} diff --git a/main/l10ntools/source/srclex.l b/main/l10ntools/source/srclex.l index 06a439f02a6..bab34a4b25f 100644 --- a/main/l10ntools/source/srclex.l +++ b/main/l10ntools/source/srclex.l @@ -55,17 +55,17 @@ extern int WorkOnTokenSet( int, char* ); extern int InitExport( char * , char * ); extern int Parse( int nTyp, char *pTokenText ); -extern int EndExport(); -extern int SetError(); -extern int GetError(); +extern int EndExport(void); +extern int SetError(void); +extern int GetError(void); extern char *GetOutputFile( int argc, char* argv[]); -extern FILE *GetNextFile(); -extern int isQuiet(); -extern void Close(); -extern char* getFilename(); +extern FILE *GetNextFile(void); +extern int isQuiet(void); +extern void Close(void); +extern char *getFilename(void); /* forwards */ -void YYWarning(); +void YYWarning(char *); %} %p 24000 diff --git a/main/l10ntools/source/xrmlex.l b/main/l10ntools/source/xrmlex.l index b8552014131..51fc8f71047 100644 --- a/main/l10ntools/source/xrmlex.l +++ b/main/l10ntools/source/xrmlex.l @@ -54,17 +54,17 @@ extern int WorkOnTokenSet( int, char* ); extern int Argument( char * ); extern int InitXrmExport( char * , char * ); -extern int EndXrmExport(); -extern int GetError(); -extern int SetError(); +extern int EndXrmExport(void); +extern int GetError(void); +extern int SetError(void); extern char *GetOutputFile( int argc, char* argv[]); -extern FILE *GetXrmFile(); -extern int isQuiet(); -extern void removeTempFile(); -extern char* getFilename(); +extern FILE *GetXrmFile(void); +extern int isQuiet(void); +extern void removeTempFile(void); +extern char* getFilename(void); /* forwards */ -void YYWarning(); +void YYWarning(char *); int bText=0; %} diff --git a/main/l10ntools/source/xrmmerge.cxx b/main/l10ntools/source/xrmmerge.cxx index 8b468c23107..6fa87904cb7 100644 --- a/main/l10ntools/source/xrmmerge.cxx +++ b/main/l10ntools/source/xrmmerge.cxx @@ -440,7 +440,7 @@ void XRMResParser::ConvertStringToDBFormat( ByteString &rString ) ByteString sResult; do { sResult = rString; - rString.EraseLeadingChars( _LF ); + rString.EraseLeadingChars( SAL_LF ); // rString.EraseLeadingChars( ' ' ); rString.EraseLeadingChars( '\t' ); // rString.EraseTrailingChars( ' ' ); diff --git a/main/rsc/source/rscpp/cpp3.c b/main/rsc/source/rscpp/cpp3.c index 522da4013dd..abff700ccad 100644 --- a/main/rsc/source/rscpp/cpp3.c +++ b/main/rsc/source/rscpp/cpp3.c @@ -111,7 +111,7 @@ void setincdirs() #endif #if HOST == SYS_VMS - extern char *getenv(); + // getenv declared in stdlib.h if (getenv("C$LIBRARY") != NULL) *incend++ = "C$LIBRARY:"; @@ -460,9 +460,7 @@ void initdefines() int i; time_t tvec; -#if !defined( ZTC ) && !defined( WNT ) && !defined(BLC) && !defined(G3) - extern char *ctime(); -#endif + // ctime declared in time.h /* * Predefine the built-in symbols. Allow the diff --git a/main/rsc/source/rscpp/cpp4.c b/main/rsc/source/rscpp/cpp4.c index c08dfdd47ec..2aea02c19d2 100644 --- a/main/rsc/source/rscpp/cpp4.c +++ b/main/rsc/source/rscpp/cpp4.c @@ -401,7 +401,7 @@ void expand(DEFBUF* tokenp) register int c; register FILEINFO *file; #ifndef ZTC /* BP */ - extern FILEINFO *getfile(); + extern FILEINFO *getfile(int bufsize, char *name); #endif #if OSL_DEBUG_LEVEL > 1 @@ -559,7 +559,7 @@ void expstuff(DEFBUF* tokenp) int string_magic; /* String formal hack */ FILEINFO *file; /* Funny #include */ #ifndef ZTC /* BP */ - extern FILEINFO *getfile(); + extern FILEINFO *getfile(int bufsize, char *name); #endif file = getfile(NBUFF, tokenp->name); diff --git a/main/rsc/source/rscpp/cpp5.c b/main/rsc/source/rscpp/cpp5.c index 25b23ac7991..0cd76fb9b58 100644 --- a/main/rsc/source/rscpp/cpp5.c +++ b/main/rsc/source/rscpp/cpp5.c @@ -232,7 +232,7 @@ eval() int value[NEXP]; /* Value stack */ OPTAB opstack[NEXP]; /* Operand stack */ #ifndef ZTC /* BP */ - extern int *evaleval(); /* Does actual evaluation */ + extern int *evaleval(int *, int, int); /* Does actual evaluation */ #endif valp = value; opp = opstack; diff --git a/main/rsc/source/rscpp/cpp6.c b/main/rsc/source/rscpp/cpp6.c index 3439cd6fd71..3028331cd4f 100644 --- a/main/rsc/source/rscpp/cpp6.c +++ b/main/rsc/source/rscpp/cpp6.c @@ -1030,7 +1030,7 @@ void ungetstring(char* text) { register FILEINFO *file; #ifndef ZTC /* BP */ - extern FILEINFO *getfile(); + extern FILEINFO *getfile(int bufsize, char *name); #endif file = getfile(strlen(text) + 1, ""); strcpy(file->buffer, text); diff --git a/main/sc/inc/formularesult.hxx b/main/sc/inc/formularesult.hxx index 287b4c12c62..f3fbb91f590 100644 --- a/main/sc/inc/formularesult.hxx +++ b/main/sc/inc/formularesult.hxx @@ -421,7 +421,7 @@ inline bool ScFormulaResult::IsMultiline() const if (meMultiline == MULTILINE_UNKNOWN) { const String& rStr = GetString(); - if (rStr.Len() && rStr.Search( _LF ) != STRING_NOTFOUND) + if (rStr.Len() && rStr.Search( SAL_LF ) != STRING_NOTFOUND) const_cast(this)->meMultiline = MULTILINE_TRUE; else const_cast(this)->meMultiline = MULTILINE_FALSE; diff --git a/main/sc/source/filter/html/htmlexp.cxx b/main/sc/source/filter/html/htmlexp.cxx index 82ecf310448..2e493137f08 100644 --- a/main/sc/source/filter/html/htmlexp.cxx +++ b/main/sc/source/filter/html/htmlexp.cxx @@ -1122,7 +1122,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) } else { - xub_StrLen nPos = aStrOut.Search( _LF ); + xub_StrLen nPos = aStrOut.Search( SAL_LF ); if ( nPos == STRING_NOTFOUND ) { OUT_STR( aStrOut ); @@ -1137,7 +1137,7 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab ) TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak ); nStartPos = nPos + 1; } - while( ( nPos = aStrOut.Search( _LF, nStartPos ) ) != STRING_NOTFOUND ); + while( ( nPos = aStrOut.Search( SAL_LF, nStartPos ) ) != STRING_NOTFOUND ); String aSingleLine( aStrOut, nStartPos, aStrOut.Len() - nStartPos ); OUT_STR( aSingleLine ); } diff --git a/main/sc/source/ui/docshell/docsh.cxx b/main/sc/source/ui/docshell/docsh.cxx index 8e725115088..c822958e3e1 100644 --- a/main/sc/source/ui/docshell/docsh.cxx +++ b/main/sc/source/ui/docshell/docsh.cxx @@ -1960,7 +1960,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt bool bNeedQuotes = rAsciiOpt.bQuoteAllText || ( nPos != STRING_NOTFOUND ) || ( aString.Search( cDelim ) != STRING_NOTFOUND ) || - ( aString.Search( sal_Unicode(_LF) ) != STRING_NOTFOUND ); + ( aString.Search( sal_Unicode(SAL_LF) ) != STRING_NOTFOUND ); while ( nPos != STRING_NOTFOUND ) { aString.Insert( cStrDelim, nPos ); @@ -1999,7 +1999,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt bool bNeedQuotes = rAsciiOpt.bQuoteAllText || ( nPos != STRING_NOTFOUND ) || ( aStrDec.Search( aDelimDecoded ) != STRING_NOTFOUND ) || - ( aStrDec.Search( sal_Unicode(_LF) ) != STRING_NOTFOUND ); + ( aStrDec.Search( sal_Unicode(SAL_LF) ) != STRING_NOTFOUND ); while ( nPos != STRING_NOTFOUND ) { aStrDec.Insert( aStrDelimDecoded, nPos ); @@ -2021,7 +2021,7 @@ void ScDocShell::AsciiSave( SvStream& rStream, const ScImportOptions& rAsciiOpt bool bNeedQuotes = rAsciiOpt.bQuoteAllText || ( nPos != STRING_NOTFOUND ) || ( aStrEnc.Search( aDelimEncoded ) != STRING_NOTFOUND ) || - ( aStrEnc.Search( sal_Char(_LF) ) != STRING_NOTFOUND ); + ( aStrEnc.Search( sal_Char(SAL_LF) ) != STRING_NOTFOUND ); while ( nPos != STRING_NOTFOUND ) { aStrEnc.Insert( aStrDelimEncoded, nPos ); diff --git a/main/sc/source/ui/docshell/impex.cxx b/main/sc/source/ui/docshell/impex.cxx index e1ea3af1789..47131dd20d2 100644 --- a/main/sc/source/ui/docshell/impex.cxx +++ b/main/sc/source/ui/docshell/impex.cxx @@ -592,13 +592,13 @@ void ScImportExport::WriteUnicodeOrByteEndl( SvStream& rStrm ) switch ( rStrm.GetLineDelimiter() ) { case LINEEND_CR : - rStrm << sal_Unicode(_CR); + rStrm << sal_Unicode(SAL_CR); break; case LINEEND_LF : - rStrm << sal_Unicode(_LF); + rStrm << sal_Unicode(SAL_LF); break; default: - rStrm << sal_Unicode(_CR) << sal_Unicode(_LF); + rStrm << sal_Unicode(SAL_CR) << sal_Unicode(SAL_LF); } } else @@ -672,7 +672,7 @@ void lcl_UnescapeSylk( String & rString, SylkVersion eVersion ) else rString.SearchAndReplaceAll( DOUBLE_DOUBLEQUOTE, '"' ); - rString.SearchAndReplaceAll( SYLK_LF, _LF ); + rString.SearchAndReplaceAll( SYLK_LF, SAL_LF ); } static const sal_Unicode* lcl_ScanSylkString( const sal_Unicode* p, @@ -1117,7 +1117,7 @@ static bool lcl_PutString( } // Standard or date not determined -> SetString / EditCell - if( rStr.Search( _LF ) == STRING_NOTFOUND ) + if( rStr.Search( SAL_LF ) == STRING_NOTFOUND ) pDoc->SetString( nCol, nRow, nTab, rStr, pFormatter, bDetectNumFormat ); else { @@ -1454,11 +1454,11 @@ sal_Bool ScImportExport::Doc2Text( SvStream& rStrm ) { pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCell ); - bool bMultiLineText = ( aCell.Search( _LF ) != STRING_NOTFOUND ); + bool bMultiLineText = ( aCell.Search( SAL_LF ) != STRING_NOTFOUND ); if( bMultiLineText ) { if( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSpace ) - aCell.SearchAndReplaceAll( _LF, ' ' ); + aCell.SearchAndReplaceAll( SAL_LF, ' ' ); else if ( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSystem && bConvertLF ) aCell.ConvertLineEnd(); } @@ -1486,11 +1486,11 @@ sal_Bool ScImportExport::Doc2Text( SvStream& rStrm ) { pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCell ); - bool bMultiLineText = ( aCell.Search( _LF ) != STRING_NOTFOUND ); + bool bMultiLineText = ( aCell.Search( SAL_LF ) != STRING_NOTFOUND ); if( bMultiLineText ) { if( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSpace ) - aCell.SearchAndReplaceAll( _LF, ' ' ); + aCell.SearchAndReplaceAll( SAL_LF, ' ' ); else if ( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSystem && bConvertLF ) aCell.ConvertLineEnd(); } @@ -1838,7 +1838,7 @@ sal_Bool ScImportExport::Doc2Sylk( SvStream& rStrm ) case CELLTYPE_EDIT: hasstring: pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCellStr ); - aCellStr.SearchAndReplaceAll( _LF, SYLK_LF ); + aCellStr.SearchAndReplaceAll( SAL_LF, SYLK_LF ); aBufStr.AssignAscii(RTL_CONSTASCII_STRINGPARAM( "C;X" )); aBufStr += String::CreateFromInt32( c ); diff --git a/main/soltools/checkdll/checkdll.c b/main/soltools/checkdll/checkdll.c index f8f0e409652..9947259f9e7 100644 --- a/main/soltools/checkdll/checkdll.c +++ b/main/soltools/checkdll/checkdll.c @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) if (!silent) printf("Checking DLL %s ...", argv[1]); fflush(stdout); - if ( (phandle = dlopen(argv[1], RTLD_NOW)) != NULL ) { + if ( (phandle = dlopen(argv[1], RTLD_LAZY)) != NULL ) { if ( (pfun = (char *(*)(void))dlsym(phandle, psymbol)) != NULL ) { if (!silent) printf(": ok\n"); } diff --git a/main/soltools/mkdepend/def.h b/main/soltools/mkdepend/def.h index 23ba1af7726..47da8bf0273 100644 --- a/main/soltools/mkdepend/def.h +++ b/main/soltools/mkdepend/def.h @@ -150,17 +150,17 @@ struct filepointer { char *malloc(), *realloc(); #endif /* macII */ #else -char *malloc(); -char *realloc(); +char *malloc(size_t); +char *realloc(void *, size_t); #endif -char *copy(); -char *base_name(); -char *get_line(); -char *isdefined(); -struct filepointer *getfile(); -struct inclist *newinclude(); -struct inclist *inc_path(); +char *copy(char *); +char *base_name(char *); +char *get_line(struct filepointer *); +char *isdefined(char *); +struct filepointer *getfile(char *); +struct inclist *newinclude(char *, char *); +struct inclist *inc_path(char *, char *, boolean, struct IncludesCollection*); void define( char *def, struct symhash **symbols ); void hash_define(char *name, char * val, struct symhash **symbols); diff --git a/main/soltools/mkdepend/ifparser.h b/main/soltools/mkdepend/ifparser.h index b32ef0508be..f63a0fcea99 100644 --- a/main/soltools/mkdepend/ifparser.h +++ b/main/soltools/mkdepend/ifparser.h @@ -63,12 +63,11 @@ typedef int Bool; typedef struct _if_parser { struct { /* functions */ - const char *(*handle_error) (/* struct _if_parser *, const char *, - const char * */); - int (*eval_variable) (/* struct _if_parser *, const char *, int */); - int (*eval_defined) (/* struct _if_parser *, const char *, int */); + const char *(*handle_error)(struct _if_parser *, const char *, const char *); + int (*eval_variable) (struct _if_parser *, const char *, int); + int (*eval_defined) (struct _if_parser *, const char *, int); } funcs; char *data; } IfParser; -const char *ParseIfExpression (/* IfParser *, const char *, int * */); +const char *ParseIfExpression(IfParser *, const char *, int *); diff --git a/main/svl/source/items/slstitm.cxx b/main/svl/source/items/slstitm.cxx index 2e396370dd3..88953ac4dfb 100644 --- a/main/svl/source/items/slstitm.cxx +++ b/main/svl/source/items/slstitm.cxx @@ -296,7 +296,7 @@ void SfxStringListItem::SetString( const XubString& rStr ) aStr.ConvertLineEnd(LINEEND_CR); do { - nDelimPos = aStr.Search( _CR, nStart ); + nDelimPos = aStr.Search( SAL_CR, nStart ); xub_StrLen nLen; if ( nDelimPos == STRING_NOTFOUND ) nLen = 0xffff; diff --git a/main/svtools/source/contnr/svimpicn.cxx b/main/svtools/source/contnr/svimpicn.cxx index 9da1bb0ba5d..f06c8bee7e8 100644 --- a/main/svtools/source/contnr/svimpicn.cxx +++ b/main/svtools/source/contnr/svimpicn.cxx @@ -256,7 +256,7 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo, c = pStr[i]; // Auf Zeilenende ermitteln - if ( (c == _CR) || (c == _LF) ) + if ( (c == SAL_CR) || (c == SAL_LF) ) bHardBreak = sal_True; else bHardBreak = sal_False; @@ -296,7 +296,7 @@ long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo, { nStartPos++; c2 = pStr[i+1]; - if ( (c != c2) && ((c2 == _CR) || (c2 == _LF)) ) + if ( (c != c2) && ((c2 == SAL_CR) || (c2 == SAL_LF)) ) { nStartPos++; i++; @@ -499,7 +499,7 @@ void DrawText( OutputDevice* pDev, const Rectangle& rRect, pLineInfo = aMultiLineInfo.GetLine( nFormatLines ); aLastLine = rStr.Copy( pLineInfo->GetIndex() ); aLastLine.ConvertLineEnd( LINEEND_LF ); - aLastLine.SearchAndReplace( _LF, ' ' ); + aLastLine.SearchAndReplace( SAL_LF, ' ' ); aLastLine = GetEllipsisString( pDev, aLastLine, nWidth, nStyle ); nStyle &= ~(TEXT_DRAW_VCENTER | TEXT_DRAW_BOTTOM); nStyle |= TEXT_DRAW_TOP; diff --git a/main/svtools/source/svhtml/parhtml.cxx b/main/svtools/source/svhtml/parhtml.cxx index bbbad839d18..6fb6e5f0f87 100644 --- a/main/svtools/source/svhtml/parhtml.cxx +++ b/main/svtools/source/svhtml/parhtml.cxx @@ -2175,8 +2175,8 @@ bool HTMLParser::ParseMetaOptionsImpl( if ( bHTTPEquiv || HTML_META_DESCRIPTION != nAction ) { // if it is not a Description, remove CRs and LFs from CONTENT - aContent.EraseAllChars( _CR ); - aContent.EraseAllChars( _LF ); + aContent.EraseAllChars( SAL_CR ); + aContent.EraseAllChars( SAL_LF ); } else { diff --git a/main/sw/source/filter/html/htmlform.cxx b/main/sw/source/filter/html/htmlform.cxx index c7ecf4eb75b..a5aec213ee2 100644 --- a/main/sw/source/filter/html/htmlform.cxx +++ b/main/sw/source/filter/html/htmlform.cxx @@ -1688,8 +1688,8 @@ void SwHTMLParser::InsertInput() // geloescht werden. if( !bKeepCRLFInValue ) { - sText.EraseAllChars( _CR ); - sText.EraseAllChars( _LF ); + sText.EraseAllChars( SAL_CR ); + sText.EraseAllChars( SAL_LF ); } const uno::Reference< XMultiServiceFactory > & rServiceFactory = diff --git a/main/sw/source/filter/html/swhtml.cxx b/main/sw/source/filter/html/swhtml.cxx index e14f58afd7a..3f3f09fc981 100644 --- a/main/sw/source/filter/html/swhtml.cxx +++ b/main/sw/source/filter/html/swhtml.cxx @@ -5339,8 +5339,8 @@ void SwHTMLParser::ParseMoreMetaOptions() aName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_content_script_type ) ) return; - aContent.EraseAllChars( _CR ); - aContent.EraseAllChars( _LF ); + aContent.EraseAllChars( SAL_CR ); + aContent.EraseAllChars( SAL_LF ); if( aName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_sdendnote ) ) { diff --git a/main/sw/source/ui/misc/redlndlg.cxx b/main/sw/source/ui/misc/redlndlg.cxx index 1a750407338..df1c3b1216b 100644 --- a/main/sw/source/ui/misc/redlndlg.cxx +++ b/main/sw/source/ui/misc/redlndlg.cxx @@ -568,7 +568,7 @@ void SwRedlineAcceptDlg::Activate() { // Nur Kommentar aktualisieren String sComment(rRedln.GetComment()); - sComment.SearchAndReplaceAll((sal_Unicode)_LF,(sal_Unicode)' '); + sComment.SearchAndReplaceAll((sal_Unicode)SAL_LF,(sal_Unicode)' '); pTable->SetEntryText(sComment, pParent->pTLBParent, 3); } pParent->sComment = rRedln.GetComment(); @@ -860,7 +860,7 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd) pRedlineParent->pData = pRedlineData; pRedlineParent->pNext = 0; String sComment(rRedln.GetComment()); - sComment.SearchAndReplaceAll((sal_Unicode)_LF,(sal_Unicode)' '); + sComment.SearchAndReplaceAll((sal_Unicode)SAL_LF,(sal_Unicode)' '); pRedlineParent->sComment = sComment; aRedlineParents.Insert(pRedlineParent, i); @@ -1300,7 +1300,7 @@ IMPL_LINK( SwRedlineAcceptDlg, CommandHdl, void*, EMPTYARG ) // Kommentar einfuegen bzw aendern pSh->SetRedlineComment(sMsg); - sMsg.SearchAndReplaceAll((sal_Unicode)_LF,(sal_Unicode)' '); + sMsg.SearchAndReplaceAll((sal_Unicode)SAL_LF,(sal_Unicode)' '); pTable->SetEntryText(sMsg, pEntry, 3); } diff --git a/main/tools/inc/tools/solar.h b/main/tools/inc/tools/solar.h index 61100e90f0e..d919559fffd 100644 --- a/main/tools/inc/tools/solar.h +++ b/main/tools/inc/tools/solar.h @@ -220,8 +220,8 @@ template inline T Abs(T a) { return (a>=0?a:-a); } #define _MAKE_NUMSTR( n ) # n #define MAKE_NUMSTR( n ) _MAKE_NUMSTR( n ) -#define _LF ((char)0x0A) -#define _CR ((char)0x0D) +#define SAL_LF ((char)0x0A) +#define SAL_CR ((char)0x0D) /*** pragmas ************************************************************/ diff --git a/main/tools/source/generic/config.cxx b/main/tools/source/generic/config.cxx index 035715cd714..684685c3400 100644 --- a/main/tools/source/generic/config.cxx +++ b/main/tools/source/generic/config.cxx @@ -459,18 +459,18 @@ static sal_uInt8* ImplGetConfigBuffer( const ImplConfigData* pData, sal_uIntPtr& if ( pData->meLineEnd == LINEEND_CR ) { - aLineEndBuf[0] = _CR; + aLineEndBuf[0] = SAL_CR; nLineEndLen = 1; } else if ( pData->meLineEnd == LINEEND_LF ) { - aLineEndBuf[0] = _LF; + aLineEndBuf[0] = SAL_LF; nLineEndLen = 1; } else { - aLineEndBuf[0] = _CR; - aLineEndBuf[1] = _LF; + aLineEndBuf[0] = SAL_CR; + aLineEndBuf[1] = SAL_LF; nLineEndLen = 2; } diff --git a/main/tools/source/stream/stream.cxx b/main/tools/source/stream/stream.cxx index b035c5d2851..7481a912d75 100644 --- a/main/tools/source/stream/stream.cxx +++ b/main/tools/source/stream/stream.cxx @@ -1283,7 +1283,7 @@ sal_Bool SvStream::ReadCsvLine( String& rStr, sal_Bool bEmbeddedLineBreak, nLastOffset = rStr.Len(); String aNext; ReadUniOrByteStringLine( aNext); - rStr += sal_Unicode(_LF); + rStr += sal_Unicode(SAL_LF); rStr += aNext; } else @@ -2541,11 +2541,11 @@ SvStream& endl( SvStream& rStr ) { LineEnd eDelim = rStr.GetLineDelimiter(); if ( eDelim == LINEEND_CR ) - rStr << _CR; + rStr << SAL_CR; else if( eDelim == LINEEND_LF ) - rStr << _LF; + rStr << SAL_LF; else - rStr << _CR << _LF; + rStr << SAL_CR << SAL_LF; return rStr; } @@ -2554,13 +2554,13 @@ SvStream& endlu( SvStream& rStrm ) switch ( rStrm.GetLineDelimiter() ) { case LINEEND_CR : - rStrm << sal_Unicode(_CR); + rStrm << sal_Unicode(SAL_CR); break; case LINEEND_LF : - rStrm << sal_Unicode(_LF); + rStrm << sal_Unicode(SAL_LF); break; default: - rStrm << sal_Unicode(_CR) << sal_Unicode(_LF); + rStrm << sal_Unicode(SAL_CR) << sal_Unicode(SAL_LF); } return rStrm; } @@ -2782,6 +2782,11 @@ sal_Size SvMemoryStream::PutData( const void* pData, sal_Size nCount ) } } } + if (!pBuf || nCount > (nSize - nPos)) + { + nCount = 0; + SetError( SVSTREAM_WRITE_ERROR ); + } DBG_ASSERT(pBuf,"Possibly Reallocate failed"); memcpy( pBuf+nPos, pData, (size_t)nCount); diff --git a/main/tools/source/string/strimp.cxx b/main/tools/source/string/strimp.cxx index 4fd19088a7b..e69be2939c6 100644 --- a/main/tools/source/string/strimp.cxx +++ b/main/tools/source/string/strimp.cxx @@ -1146,7 +1146,7 @@ STRING& STRING::ConvertLineEnd( LineEnd eLineEnd ) while ( i < mpData->mnLen ) { // Bei \r oder \n gibt es neuen Zeilenumbruch - if ( (pStr[i] == _CR) || (pStr[i] == _LF) ) + if ( (pStr[i] == SAL_CR) || (pStr[i] == SAL_LF) ) { if( nLen <= STRING_MAXLEN - nLineEndLen ) nLen = nLen + nLineEndLen; @@ -1157,17 +1157,17 @@ STRING& STRING::ConvertLineEnd( LineEnd eLineEnd ) if ( !bConvert ) { // Muessen wir Konvertieren - if ( ((eLineEnd != LINEEND_LF) && (pStr[i] == _LF)) || - ((eLineEnd == LINEEND_CRLF) && (pStr[i+1] != _LF)) || + if ( ((eLineEnd != LINEEND_LF) && (pStr[i] == SAL_LF)) || + ((eLineEnd == LINEEND_CRLF) && (pStr[i+1] != SAL_LF)) || ((eLineEnd == LINEEND_LF) && - ((pStr[i] == _CR) || (pStr[i+1] == _CR))) || + ((pStr[i] == SAL_CR) || (pStr[i+1] == SAL_CR))) || ((eLineEnd == LINEEND_CR) && - ((pStr[i] == _LF) || (pStr[i+1] == _LF))) ) + ((pStr[i] == SAL_LF) || (pStr[i+1] == SAL_LF))) ) bConvert = sal_True; } // \r\n oder \n\r, dann Zeichen ueberspringen - if ( ((pStr[i+1] == _CR) || (pStr[i+1] == _LF)) && + if ( ((pStr[i+1] == SAL_CR) || (pStr[i+1] == SAL_LF)) && (pStr[i] != pStr[i+1]) ) ++i; } @@ -1193,24 +1193,24 @@ STRING& STRING::ConvertLineEnd( LineEnd eLineEnd ) while ( i < mpData->mnLen ) { // Bei \r oder \n gibt es neuen Zeilenumbruch - if ( (pStr[i] == _CR) || (pStr[i] == _LF) ) + if ( (pStr[i] == SAL_CR) || (pStr[i] == SAL_LF) ) { if ( eLineEnd == LINEEND_CRLF ) { - pNewData->maStr[j] = _CR; - pNewData->maStr[j+1] = _LF; + pNewData->maStr[j] = SAL_CR; + pNewData->maStr[j+1] = SAL_LF; j += 2; } else { if ( eLineEnd == LINEEND_CR ) - pNewData->maStr[j] = _CR; + pNewData->maStr[j] = SAL_CR; else - pNewData->maStr[j] = _LF; + pNewData->maStr[j] = SAL_LF; ++j; } - if ( ((pStr[i+1] == _CR) || (pStr[i+1] == _LF)) && + if ( ((pStr[i+1] == SAL_CR) || (pStr[i+1] == SAL_LF)) && (pStr[i] != pStr[i+1]) ) ++i; } diff --git a/main/vcl/source/app/dbggui.cxx b/main/vcl/source/app/dbggui.cxx index c8eff484e13..19d81b43da0 100644 --- a/main/vcl/source/app/dbggui.cxx +++ b/main/vcl/source/app/dbggui.cxx @@ -718,7 +718,7 @@ void DbgWindow::InsertLine( const XubString& rLine ) { XubString aStr = rLine; aStr.ConvertLineEnd( LINEEND_LF ); - xub_StrLen nPos = aStr.Search( _LF ); + xub_StrLen nPos = aStr.Search( SAL_LF ); sal_Bool bFirstEntry = sal_True; while ( nPos != STRING_NOTFOUND ) { @@ -731,7 +731,7 @@ void DbgWindow::InsertLine( const XubString& rLine ) bFirstEntry = sal_False; aStr.Erase( 0, nPos+1 ); - nPos = aStr.Search( _LF ); + nPos = aStr.Search( SAL_LF ); } if ( maLstBox.GetEntryCount() >= DBGWIN_MAXLINES ) maLstBox.RemoveEntry( 0 ); @@ -1371,7 +1371,7 @@ void DbgInfoDialog::SetInfoText( const XubString& rStr ) sal_uInt16 nFoundIndex; do { - nFoundIndex = aStr.Search( _LF, nStrIndex ); + nFoundIndex = aStr.Search( SAL_LF, nStrIndex ); XubString aTextParagraph = aStr.Copy( nStrIndex, nFoundIndex-nStrIndex ); if ( mbHelpText ) { diff --git a/main/vcl/source/control/edit.cxx b/main/vcl/source/control/edit.cxx index 19c0101b17e..68f205ca6b2 100644 --- a/main/vcl/source/control/edit.cxx +++ b/main/vcl/source/control/edit.cxx @@ -781,8 +781,8 @@ void Edit::ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uI String Edit::ImplGetValidString( const String& rString ) const { String aValidString( rString ); - aValidString.EraseAllChars( _LF ); - aValidString.EraseAllChars( _CR ); + aValidString.EraseAllChars( SAL_LF ); + aValidString.EraseAllChars( SAL_CR ); aValidString.SearchAndReplaceAll( '\t', ' ' ); return aValidString; } diff --git a/main/vcl/source/gdi/outdev3.cxx b/main/vcl/source/gdi/outdev3.cxx index cfc993c2213..b8d0a3ae044 100644 --- a/main/vcl/source/gdi/outdev3.cxx +++ b/main/vcl/source/gdi/outdev3.cxx @@ -4823,7 +4823,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, { xub_StrLen nBreakPos = nPos; - while ( ( nBreakPos < nLen ) && ( rStr.GetChar( nBreakPos ) != _CR ) && ( rStr.GetChar( nBreakPos ) != _LF ) ) + while ( ( nBreakPos < nLen ) && ( rStr.GetChar( nBreakPos ) != SAL_CR ) && ( rStr.GetChar( nBreakPos ) != SAL_LF ) ) nBreakPos++; long nLineWidth = _rLayout.GetTextWidth( rStr, nPos, nBreakPos-nPos ); @@ -4976,11 +4976,11 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, nBreakPos++; nPos = nBreakPos; - if ( ( rStr.GetChar( nPos ) == _CR ) || ( rStr.GetChar( nPos ) == _LF ) ) + if ( ( rStr.GetChar( nPos ) == SAL_CR ) || ( rStr.GetChar( nPos ) == SAL_LF ) ) { nPos++; // CR/LF? - if ( ( nPos < nLen ) && ( rStr.GetChar( nPos ) == _LF ) && ( rStr.GetChar( nPos-1 ) == _CR ) ) + if ( ( nPos < nLen ) && ( rStr.GetChar( nPos ) == SAL_LF ) && ( rStr.GetChar( nPos-1 ) == SAL_CR ) ) nPos++; } } @@ -4990,8 +4990,8 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, { ImplTextLineInfo* pLine = rLineInfo.GetLine( nL ); String aLine( rStr, pLine->GetIndex(), pLine->GetLen() ); - DBG_ASSERT( aLine.Search( _CR ) == STRING_NOTFOUND, "ImplGetTextLines - Found CR!" ); - DBG_ASSERT( aLine.Search( _LF ) == STRING_NOTFOUND, "ImplGetTextLines - Found LF!" ); + DBG_ASSERT( aLine.Search( SAL_CR ) == STRING_NOTFOUND, "ImplGetTextLines - Found CR!" ); + DBG_ASSERT( aLine.Search( SAL_LF ) == STRING_NOTFOUND, "ImplGetTextLines - Found LF!" ); } #endif @@ -6440,7 +6440,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r xub_StrLen nLastLineLen = aLastLine.Len(); for ( i = 0; i < nLastLineLen; i++ ) { - if ( aLastLine.GetChar( i ) == _LF ) + if ( aLastLine.GetChar( i ) == SAL_LF ) aLastLine.SetChar( i, ' ' ); } aLastLine = ImplGetEllipsisString( rTargetDevice, aLastLine, nWidth, nStyle, _rLayout ); diff --git a/main/vcl/source/gdi/pdfwriter_impl.cxx b/main/vcl/source/gdi/pdfwriter_impl.cxx index e377467d70f..2690c156346 100644 --- a/main/vcl/source/gdi/pdfwriter_impl.cxx +++ b/main/vcl/source/gdi/pdfwriter_impl.cxx @@ -7851,7 +7851,7 @@ void PDFWriterImpl::drawText( const Rectangle& rRect, const String& rOrigStr, sa xub_StrLen nLastLineLen = aLastLine.Len(); for ( i = 0; i < nLastLineLen; i++ ) { - if ( aLastLine.GetChar( i ) == _LF ) + if ( aLastLine.GetChar( i ) == SAL_LF ) aLastLine.SetChar( i, ' ' ); } aLastLine = m_pReferenceDevice->GetEllipsisString( aLastLine, nWidth, nStyle ); diff --git a/main/vcl/source/window/status.cxx b/main/vcl/source/window/status.cxx index 74a6cf9d200..d620cda553c 100644 --- a/main/vcl/source/window/status.cxx +++ b/main/vcl/source/window/status.cxx @@ -405,7 +405,7 @@ void StatusBar::ImplDrawText( sal_Bool bOffScreen, long nOldTextWidth ) { // Position ermitteln XubString aStr = GetText(); - sal_uInt16 nPos = aStr.Search( _LF ); + sal_uInt16 nPos = aStr.Search( SAL_LF ); if ( nPos != STRING_NOTFOUND ) aStr.Erase( nPos );