Remove leading white spaces in blank lines to make them really empty

This commit is contained in:
Jekyll Wu
2011-11-05 07:29:21 +08:00
parent 8cd63d9698
commit cf92cece2b
59 changed files with 385 additions and 385 deletions

View File

@@ -115,7 +115,7 @@ void HistoryFile::add(const unsigned char* bytes, int len)
{
if ( _fileMap )
unmap();
_readWriteBalance++;
int rc = 0;
@@ -196,7 +196,7 @@ HistoryScrollFile::HistoryScrollFile(const QString &logFileName)
HistoryScrollFile::~HistoryScrollFile()
{
}
int HistoryScrollFile::getLines()
{
return index.len() / sizeof(int);
@@ -222,10 +222,10 @@ int HistoryScrollFile::startOfLine(int lineno)
if (lineno <= 0) return 0;
if (lineno <= getLines())
{
if (!index.isMapped())
index.map();
int res;
index.get((unsigned char*)&res,sizeof(int),(lineno-1)*sizeof(int));
return res;
@@ -319,7 +319,7 @@ int HistoryScrollBuffer::getLineLen(int lineNumber)
bool HistoryScrollBuffer::isWrappedLine(int lineNumber)
{
Q_ASSERT( lineNumber >= 0 && lineNumber < _maxLineCount );
if (lineNumber < _usedLines)
{
//kDebug() << "Line" << lineNumber << "wrapped is" << _wrappedLine[bufferIndex(lineNumber)];
@@ -340,7 +340,7 @@ void HistoryScrollBuffer::getCells(int lineNumber, int startColumn, int count, C
memset(buffer, 0, count * sizeof(Character));
return;
}
const HistoryLine& line = _historyBuffer[bufferIndex(lineNumber)];
//kDebug() << "startCol " << startColumn;
@@ -348,7 +348,7 @@ void HistoryScrollBuffer::getCells(int lineNumber, int startColumn, int count, C
//kDebug() << "count " << count;
Q_ASSERT( startColumn <= line.size() - count );
memcpy(buffer, line.constData() + startColumn , count * sizeof(Character));
}
@@ -356,12 +356,12 @@ void HistoryScrollBuffer::setMaxNbLines(unsigned int lineCount)
{
HistoryLine* oldBuffer = _historyBuffer;
HistoryLine* newBuffer = new HistoryLine[lineCount];
for ( int i = 0 ; i < qMin(_usedLines,(int)lineCount) ; i++ )
{
newBuffer[i] = oldBuffer[bufferIndex(i)];
}
_usedLines = qMin(_usedLines,(int)lineCount);
_maxLineCount = lineCount;
_head = ( _usedLines == _maxLineCount ) ? 0 : _usedLines-1;
@@ -484,7 +484,7 @@ void HistoryScrollBlockArray::getCells(int lineno, int colno,
void HistoryScrollBlockArray::addCells(const Character a[], int count)
{
Block *b = m_blockArray.lastBlock();
if (!b) return;
// put cells in block's data
@@ -549,7 +549,7 @@ void* CompactHistoryBlockList::allocate(size_t size)
void CompactHistoryBlockList::deallocate(void* ptr)
{
Q_ASSERT( !list.isEmpty());
int i=0;
CompactHistoryBlock *block = list.at(i);
while ( i<list.size() && !block->contains(ptr) )
@@ -559,7 +559,7 @@ void CompactHistoryBlockList::deallocate(void* ptr)
}
Q_ASSERT( i<list.size() );
block->deallocate();
if (!block->isInUse())
@@ -586,11 +586,11 @@ CompactHistoryLine::CompactHistoryLine ( const TextLine& line, CompactHistoryBlo
formatLength(0)
{
length=line.size();
if (line.size() > 0) {
formatLength=1;
int k=1;
// count number of different formats in this text line
Character c = line[0];
while ( k<length )
@@ -602,21 +602,21 @@ CompactHistoryLine::CompactHistoryLine ( const TextLine& line, CompactHistoryBlo
}
k++;
}
//kDebug() << "number of different formats in string: " << formatLength;
formatArray = (CharacterFormat*) blockList.allocate(sizeof(CharacterFormat)*formatLength);
Q_ASSERT (formatArray!=NULL);
text = (quint16*) blockList.allocate(sizeof(quint16)*line.size());
Q_ASSERT (text!=NULL);
length=line.size();
wrapped=false;
// record formats and their positions in the format array
c=line[0];
formatArray[0].setFormat ( c );
formatArray[0].startPos=0; // there's always at least 1 format (for the entire line, unless a change happens)
k=1; // look for possible format changes
int j=1;
while ( k<length && j<formatLength )
@@ -631,7 +631,7 @@ CompactHistoryLine::CompactHistoryLine ( const TextLine& line, CompactHistoryBlo
}
k++;
}
// copy character values
for ( int i=0; i<line.size(); i++ )
{