Commit 3d743cb0 authored by Joachim Eibl's avatar Joachim Eibl

0.9.80


git-svn-id: https://kdiff3.svn.sourceforge.net/svnroot/kdiff3/trunk@54 c8aa9fed-2811-0410-8543-893ada326672
parent 2d3108cc
Version 0.9.80 - 2003/12/08
===========================
New Text Diff/Merge Features:
- Now using GNU-diff algorithms internally. (Option "External Diff" removed.)
- Option for treating C/C++ comments as whitespace during diff.
- Bugfix for locale character encoding (+ new option "Use string encoding")
- Option for suppressing highlighting in white-space changes.
(Also suppresses highlighting in comments and numbers when the
respective options are active.)
- Merge-menu: Choose A/B/C for all unsolved conflicts.
Choose A/B/C for all unsolved whitespace conflicts.
- Options to automatically choose a certain source for whitespace conflicts.
- Shorcut F5 now used to reload the current file.
New Directory-Comparison/Merge Features:
- Option to trust filesize. (Some directory services don't copy the date/time correctly.)
- Shortcut F7 now starts complete directory merge (previously F5).
- Do the selected merge operation for the selected file/dir only
"Run Operation For Current Item" (F6).
- Shortcuts for selecting the merge operation for the selected item.
Ctrl-1/2/3/4/Del select A/B/C/Merge/Delete respectively.
Other Improvements:
- Several i18n-corrections (by Stephan Binner)
- Bugfix for option CVS-ignore: Didn't work correctly in subdirectories.
- Bugfix for remote operations: Operation can now be aborted, when KIO-slaves doesn't respond.
- Cancel-Button in progress bar.
- Default diff-view now again side by side instead of one above the other.
Version 0.9.71 - 2003/10/14
===========================
- Windows-Installer by Sebastien Fricker.
......
......@@ -3,7 +3,7 @@ KDiff3-Readme
Author: Joachim Eibl (joachim.eibl@gmx.de)
Copyright: (C) 2002-2003 by Joachim Eibl
KDiff3-Version: 0.9.70
KDiff3-Version: 0.9.80
KDiff3 is a program that
......@@ -42,12 +42,12 @@ Exception from the GPL:
Requirements & Installation:
Version 0.9.70 provides special support for KDE3, but it can also be
Version 0.9.80 provides special support for KDE3, but it can also be
built without KDE3 if the Qt-libraries are available.
(I also tested the program under Windows.)
You always need
- kdiff3-0.9.70.tar.gz
- kdiff3-0.9.80.tar.gz
For building the KDE3-version
- KDE>=3.1 and QT>=3.1-libraries.
......@@ -64,7 +64,7 @@ Installation for KDE3:
- Make sure your shell-variable QTDIR is correct. (echo $QTDIR).
If it doesn't contain the correct path, type
export QTDIR=your_path_to_qt (e.g. /usr/lib/qt3)
- cd into the directory kdiff3-0.9.70 and type
- cd into the directory kdiff3-0.9.80 and type
- ./configure --prefix=/opt/kde3 (your KDE3 directory here)
- (make clean) (Required if you already compiled once.)
- make (Run compilation)
......@@ -93,7 +93,7 @@ Installation for the Qt-only-platforms for Un*x:
- Make sure your shell-variable QTDIR is correct. (echo $QTDIR).
If it doesn't contain the correct path, type
export QTDIR=your_path_to_qt (e.g. /usr/lib/qt)
- cd into the directory kdiff3-0.9.70/src and type
- cd into the directory kdiff3-0.9.80/src and type
- make -f Makefile.qt
- make -f Makefile.qt install (You must have root-rights for this step.)
(copies the files into /usr/local/bin and /usr/local/share/doc/kdiff3)
......@@ -110,7 +110,7 @@ Build for Windows:
set QTDIR=your_path_to_qt (e.g. c:\qt)
- Make sure your VC6 environment variables are set. Run VCVARS32.BAT.
(Typically located in "c:\programs\Microsoft Visual Studio\VC98\bin")
- cd into the directory kdiff3-0.9.70\src and type
- cd into the directory kdiff3-0.9.80\src and type
- nmake /f Makefile.win_qt230
- For execution the Qt-DLL must be in the path or in the same directory.
For newer versions of Qt, use qmake and kdiff3.pro to generate
......
......@@ -3,7 +3,7 @@ KDiff3-Readme for Windows
Author: Joachim Eibl (joachim.eibl@gmx.de)
Copyright: (C) 2002-2003 by Joachim Eibl
KDiff3-Version: 0.9.71
KDiff3-Version: 0.9.80
Homepage: http://kdiff3.sourceforge.net
KDiff3 is a program that
......
......@@ -6,6 +6,4 @@ TODO
- Automatic line wrap in the difference windows
- Printing of the diff-windows (requires automatic line wrap)
- Undo function in the merge-editor.
- Diff should allow to treat C/C++-comments as white space.
- A inserted or removed linefeed should be detected and treated like white space.
- More viewing options for directory widget.
This diff is collapsed.
......@@ -5,7 +5,7 @@ INCLUDES = $(all_includes)
# these are the headers for your project
noinst_HEADERS = kdiff3_part.h kdiff3_shell.h \
kdiff3.h common.h diff.h directorymergewindow.h \
merger.h optiondialog.h fileaccess.h
merger.h optiondialog.h fileaccess.h version.h
# let automoc handle all of the meta source files (moc)
METASOURCES = AUTO
......@@ -44,7 +44,8 @@ kde_module_LTLIBRARIES = libkdiff3part.la
# the Part's source, library search path, and link libraries
libkdiff3part_la_SOURCES = kdiff3_part.cpp kdiff3.cpp directorymergewindow.cpp \
merger.cpp pdiff.cpp difftextwindow.cpp diff.cpp \
optiondialog.cpp mergeresultwindow.cpp fileaccess.cpp
optiondialog.cpp mergeresultwindow.cpp fileaccess.cpp \
gnudiff_analyze.cpp gnudiff_io.cpp gnudiff_xmalloc.cpp
libkdiff3part_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
libkdiff3part_la_LIBADD = $(LIB_KPARTS) $(LIB_KFILE)
......
#############################################################################
# Makefile for building: kdiff3
# Generated by qmake (1.05a) (Qt 3.1.2-snapshot-20030618) on: Thu Oct 2 22:13:20 2003
# Generated by qmake (1.06c) (Qt 3.2.1) on: Mon Dec 8 20:06:47 2003
# Project: kdiff3.pro
# Template: app
# Command: $(QMAKE) -o Makefile kdiff3.pro
......@@ -12,8 +12,8 @@ CC = gcc
CXX = g++
LEX = flex
YACC = yacc
CFLAGS = -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -DNO_DEBUG -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -DNO_DEBUG -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT
CXXFLAGS = -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -DNO_DEBUG -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -DNO_DEBUG -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT
CFLAGS = -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT
CXXFLAGS = -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -Wall -W -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -fPIC -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT
LEXFLAGS =
YACCFLAGS= -d
INCPATH = -I$(QTDIR)/mkspecs/default -I. -Ikreplacements -I/usr/include -I$(QTDIR)/include
......@@ -28,8 +28,8 @@ QMAKE = qmake
TAR = tar -cf
GZIP = gzip -9f
COPY = cp -f
COPY_FILE= $(COPY) -p
COPY_DIR = $(COPY) -pR
COPY_FILE= $(COPY)
COPY_DIR = $(COPY) -r
DEL_FILE = rm -f
SYMLINK = ln -sf
DEL_DIR = rmdir
......@@ -43,7 +43,8 @@ OBJECTS_DIR = ./
####### Files
HEADERS = diff.h \
HEADERS = version.h \
diff.h \
kdiff3.h \
merger.h \
optiondialog.h \
......@@ -64,7 +65,10 @@ SOURCES = diff.cpp \
fileaccess.cpp \
kdiff3_shell.cpp \
kdiff3_part.cpp \
kreplacements/kreplacements.cpp
kreplacements/kreplacements.cpp \
gnudiff_analyze.cpp \
gnudiff_io.cpp \
gnudiff_xmalloc.cpp
OBJECTS = diff.o \
difftextwindow.o \
kdiff3.o \
......@@ -77,7 +81,10 @@ OBJECTS = diff.o \
fileaccess.o \
kdiff3_shell.o \
kdiff3_part.o \
kreplacements.o
kreplacements.o \
gnudiff_analyze.o \
gnudiff_io.o \
gnudiff_xmalloc.o
FORMS =
UICDECLS =
UICIMPLS =
......@@ -105,7 +112,7 @@ TARGET = kdiff3
first: all
####### Implicit rules
.SUFFIXES: .c .cpp .cc .cxx .C
.SUFFIXES: .c .o .cpp .cc .cxx .C
.cpp.o:
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
......@@ -126,10 +133,11 @@ first: all
all: $(TARGET)
$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)
$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) $(OBJCOMP)
mocables: $(SRCMOC)
uicables: $(UICDECLS) $(UICIMPLS)
$(MOC):
( cd $(QTDIR)/src/moc ; $(MAKE) )
......@@ -146,7 +154,7 @@ uiclean:
yaccclean:
lexclean:
clean: mocclean
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core
......@@ -191,10 +199,10 @@ kdiff3.o: kdiff3.cpp diff.h \
xpm/autoadvance.xpm \
xpm/showwhitespace.xpm \
xpm/showlinenumbers.xpm \
xpm/startmerge.xpm \
common.h
main.o: main.cpp kdiff3_shell.h
main.o: main.cpp kdiff3_shell.h \
version.h
merger.o: merger.cpp merger.h \
diff.h \
......@@ -216,10 +224,13 @@ pdiff.o: pdiff.cpp diff.h \
kdiff3.h \
optiondialog.h \
fileaccess.h \
common.h
gnudiff_diff.h \
common.h \
gnudiff_system.h
directorymergewindow.o: directorymergewindow.cpp directorymergewindow.h \
optiondialog.h \
xpm/startmerge.xpm \
common.h \
fileaccess.h
......@@ -243,6 +254,16 @@ kreplacements.o: kreplacements/kreplacements.cpp kreplacements/kreplacements.h \
kreplacements/kreplacements.moc
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o kreplacements.o kreplacements/kreplacements.cpp
gnudiff_analyze.o: gnudiff_analyze.cpp gnudiff_diff.h \
gnudiff_xalloc.h \
gnudiff_system.h
gnudiff_io.o: gnudiff_io.cpp gnudiff_diff.h \
gnudiff_xalloc.h \
gnudiff_system.h
gnudiff_xmalloc.o: gnudiff_xmalloc.cpp gnudiff_xalloc.h
moc_diff.o: moc_diff.cpp diff.h common.h \
fileaccess.h
......@@ -302,7 +323,6 @@ uninstall_documentation:
install_target:
@$(CHK_DIR_EXISTS) "$(INSTALL_ROOT)/usr/local/bin/" || $(MKDIR) "$(INSTALL_ROOT)/usr/local/bin/"
-$(COPY) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
-strip "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
uninstall_target:
-$(DEL_FILE) "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
......
#############################################################################
# Makefile for building kdiff3
# Generated by tmake at 22:40, 2003/10/01
# Generated by tmake at 12:39, 2003/12/06
# Project: kdiff3_tmake
# Template: app
#############################################################################
......@@ -43,7 +43,10 @@ SOURCES = diff.cpp \
fileaccess.cpp \
kdiff3_shell.cpp \
kdiff3_part.cpp \
kreplacements\kreplacements.cpp
kreplacements\kreplacements.cpp \
gnudiff_analyze.cpp \
gnudiff_io.cpp \
gnudiff_xmalloc.cpp
OBJECTS = diff.obj \
difftextwindow.obj \
kdiff3.obj \
......@@ -56,7 +59,10 @@ OBJECTS = diff.obj \
fileaccess.obj \
kdiff3_shell.obj \
kdiff3_part.obj \
kreplacements\kreplacements.obj
kreplacements\kreplacements.obj \
gnudiff_analyze.obj \
gnudiff_io.obj \
gnudiff_xmalloc.obj
INTERFACES =
UICDECLS =
UICIMPLS =
......@@ -128,6 +134,9 @@ clean:
-del kdiff3_shell.obj
-del kdiff3_part.obj
-del kreplacements\kreplacements.obj
-del gnudiff_analyze.obj
-del gnudiff_io.obj
-del gnudiff_xmalloc.obj
-del moc_diff.cpp
-del moc_kdiff3.cpp
-del moc_optiondialog.cpp
......@@ -182,11 +191,11 @@ kdiff3.obj: kdiff3.cpp \
xpm\iconC.xpm \
xpm\autoadvance.xpm \
xpm\showwhitespace.xpm \
xpm\showlinenumbers.xpm \
xpm\startmerge.xpm
xpm\showlinenumbers.xpm
main.obj: main.cpp \
kdiff3_shell.h
kdiff3_shell.h \
version.h
merger.obj: merger.cpp \
merger.h \
......@@ -212,7 +221,9 @@ pdiff.obj: pdiff.cpp \
fileaccess.h \
directorymergewindow.h \
kdiff3.h \
optiondialog.h
optiondialog.h \
gnudiff_diff.h \
gnudiff_system.h
directorymergewindow.obj: directorymergewindow.cpp \
directorymergewindow.h \
......@@ -225,7 +236,8 @@ directorymergewindow.obj: directorymergewindow.cpp \
xpm\not_there.xpm \
xpm\link_arrow.xpm \
xpm\file.xpm \
xpm\folder.xpm
xpm\folder.xpm \
xpm\startmerge.xpm
fileaccess.obj: fileaccess.cpp \
fileaccess.h \
......@@ -251,6 +263,19 @@ kreplacements\kreplacements.obj: kreplacements\kreplacements.cpp \
kreplacements\..\xpm\fileopen.xpm \
kreplacements\..\xpm\filesave.xpm
gnudiff_analyze.obj: gnudiff_analyze.cpp \
gnudiff_diff.h \
gnudiff_system.h \
gnudiff_xalloc.h
gnudiff_io.obj: gnudiff_io.cpp \
gnudiff_diff.h \
gnudiff_system.h \
gnudiff_xalloc.h
gnudiff_xmalloc.obj: gnudiff_xmalloc.cpp \
gnudiff_xalloc.h
moc_diff.obj: moc_diff.cpp \
diff.h \
common.h \
......
......@@ -15,13 +15,6 @@
* *
***************************************************************************/
/***************************************************************************
* $Log$
* Revision 1.1 2003/10/06 18:38:48 joachim99
* KDiff3 version 0.9.70
* *
***************************************************************************/
#ifndef _COMMON_H
#define _COMMON_H
......
This diff is collapsed.
......@@ -15,13 +15,6 @@
* *
***************************************************************************/
/***************************************************************************
* $Log$
* Revision 1.1 2003/10/06 18:38:48 joachim99
* KDiff3 version 0.9.70
* *
***************************************************************************/
#ifndef DIFF_H
#define DIFF_H
......@@ -108,7 +101,7 @@ public:
bool bTextAEqB;
};
void calcDiff3LineListUsingAB(
void calcDiff3LineListUsingAB(
const DiffList* pDiffListAB,
Diff3LineList& d3ll
);
......@@ -129,10 +122,11 @@ struct LineData
const char* pFirstNonWhiteChar;
int size;
LineData(){ pLine=0; size=0; occurances=0; }
LineData(){ pLine=0; size=0; occurances=0; bContainsPureComment=false; }
int width(); // Calcs width considering tabs.
int occurances;
bool whiteLine(){ return pFirstNonWhiteChar-pLine == size; }
bool bContainsPureComment;
};
void prepareOccurances( LineData* p, int size );
......@@ -150,9 +144,10 @@ public:
bool m_bPreserve;
void reset();
void readPPFile( bool bPreserveCR, const QString& ppCmd, bool bUpCase );
void readLMPPFile( SourceData* pOrigSource, const QString& ppCmd, bool bUpCase );
void readLMPPFile( SourceData* pOrigSource, const QString& ppCmd, bool bUpCase, bool bRemoveComments );
void readFile(const QString& filename, bool bFollowLinks, bool bUpCase );
void preprocess(bool bPreserveCR );
void removeComments( LineData* pLD );
void setData( const QString& data, bool bUpCase );
void setFilename(const QString& filename);
void setFileAccess( const FileAccess& fa );
......@@ -218,6 +213,8 @@ public:
class OptionDialog;
QString decodeString( const char*s , OptionDialog* );
class DiffTextWindow : public QWidget
{
Q_OBJECT
......@@ -337,6 +334,7 @@ public:
public slots:
void setFirstLine(int firstLine);
void slotRedraw();
signals:
void setLine(int);
private:
......@@ -376,6 +374,12 @@ enum e_MergeDetails
void mergeOneLine( const Diff3Line& d, e_MergeDetails& mergeDetails, bool& bConflict, bool& bLineRemoved, int& src, bool bTwoInputs );
enum e_MergeSrcSelector
{
A=1,
B=2,
C=3
};
class MergeResultWindow : public QWidget
{
......@@ -398,6 +402,7 @@ public:
bool saveDocument( const QString& fileName );
int getNrOfUnsolvedConflicts();
void choose(int selector);
void chooseGlobal(int selector, bool bConflictsOnly, bool bWhiteSpaceOnly );
int getNofColumns();
int getNofLines();
......@@ -430,12 +435,6 @@ public slots:
void slotGoNextUnsolvedConflict();
void slotGoPrevConflict();
void slotGoNextConflict();
void slotChooseA();
void slotChooseB();
void slotChooseC();
void slotChooseAEverywhere();
void slotChooseBEverywhere();
void slotChooseCEverywhere();
void slotAutoSolve();
void slotUnsolve();
void slotSetFastSelectorLine(int);
......@@ -452,7 +451,7 @@ signals:
void showPopupMenu( const QPoint& point );
private:
void merge(bool bAutoSolve, int defaultSelector);
void merge(bool bAutoSolve, int defaultSelector, bool bConflictsOnly=false, bool bWhiteSpaceOnly=false );
QCString getString( int lineIdx );
OptionDialog* m_pOptionDialog;
......@@ -517,12 +516,16 @@ private:
struct MergeLine
{
MergeLine()
{ srcSelect=0; mergeDetails=eDefault; d3lLineIdx = -1; srcRangeLength=0; bConflict=false; bDelta=false;}
{
srcSelect=0; mergeDetails=eDefault; d3lLineIdx = -1; srcRangeLength=0;
bConflict=false; bDelta=false; bWhiteSpaceConflict=false;
}
Diff3LineList::const_iterator id3l;
e_MergeDetails mergeDetails;
int d3lLineIdx; // Needed to show the correct window pos.
int srcRangeLength; // how many src-lines have this properties
bool bConflict;
bool bWhiteSpaceConflict;
bool bDelta;
int srcSelect;
MergeEditLineList mergeEditLineList;
......@@ -596,189 +599,12 @@ void fineDiff(
int selector,
LineData* v1,
LineData* v2,
int maxSearchLength,
bool& bTextsTotalEqual
);
bool equal( const LineData& l1, const LineData& l2, bool bStrict );
inline bool equal( char c1, char c2, bool /*bStrict*/ )
{
// If bStrict then white space doesn't match
//if ( bStrict && ( c1==' ' || c1=='\t' ) )
// return false;
return c1==c2;
}
// My own diff-invention:
template <class T>
void calcDiff( const T* p1, int size1, const T* p2, int size2, DiffList& diffList, int match, int maxSearchRange )
{
diffList.clear();
const T* p1start = p1;
const T* p2start = p2;
const T* p1end=p1+size1;
const T* p2end=p2+size2;
for(;;)
{
int nofEquals = 0;
while( p1!=p1end && p2!=p2end && equal(*p1, *p2, false) )
{
++p1;
++p2;
++nofEquals;
}
bool bBestValid=false;
int bestI1=0;
int bestI2=0;
int i1=0;
int i2=0;
for( i1=0; ; ++i1 )
{
if ( &p1[i1]==p1end || ( bBestValid && i1>= bestI1+bestI2))
{
break;
}
for(i2=0;i2<maxSearchRange;++i2)
{
if( &p2[i2]==p2end || ( bBestValid && i1+i2>=bestI1+bestI2) )
{
break;
}
else if( equal( p2[i2], p1[i1], true ) &&
( match==1 || abs(i1-i2)<3 || ( &p2[i2+1]==p2end && &p1[i1+1]==p1end ) ||
( &p2[i2+1]!=p2end && &p1[i1+1]!=p1end && equal( p2[i2+1], p1[i1+1], false ))
)
)
{
if ( i1+i2 < bestI1+bestI2 || bBestValid==false )
{
bestI1 = i1;
bestI2 = i2;
bBestValid = true;
break;
}
}
}
}
// The match was found using the strict search. Go back if there are non-strict
// matches.
while( bestI1>=1 && bestI2>=1 && equal( p1[bestI1-1], p2[bestI2-1], false ) )
{
--bestI1;
--bestI2;
}
bool bEndReached = false;
if (bBestValid)
{
// continue somehow
Diff d(nofEquals, bestI1, bestI2);
diffList.push_back( d );
p1 += bestI1;
p2 += bestI2;
}
else
{
// Nothing else to match.
Diff d(nofEquals, p1end-p1, p2end-p2);
diffList.push_back( d );
bEndReached = true; //break;
}
// Sometimes the algorithm that chooses the first match unfortunately chooses
// a match where later actually equal parts don't match anymore.
// A different match could be achieved, if we start at the end.
// Do it, if it would be a better match.
int nofUnmatched = 0;
const T* pu1 = p1-1;
const T* pu2 = p2-1;
while ( pu1>=p1start && pu2>=p2start && equal( *pu1, *pu2, false ) )
{
++nofUnmatched;
--pu1;
--pu2;
}
Diff d = diffList.back();
if ( nofUnmatched > 0 )
{
// We want to go backwards the nofUnmatched elements and redo
// the matching
d = diffList.back();
Diff origBack = d;
diffList.pop_back();
while ( nofUnmatched > 0 )
{
if ( d.diff1 > 0 && d.diff2 > 0 )
{
--d.diff1;
--d.diff2;
--nofUnmatched;
}
else if ( d.nofEquals > 0 )
{
--d.nofEquals;
--nofUnmatched;
}
if ( d.nofEquals==0 && (d.diff1==0 || d.diff2==0) && nofUnmatched>0 )
{
if ( diffList.empty() )
break;
d.nofEquals += diffList.back().nofEquals;
d.diff1 += diffList.back().diff1;
d.diff2 += diffList.back().diff2;
diffList.pop_back();
bEndReached = false;
}
}
if ( bEndReached )
diffList.push_back( origBack );
else
{
p1 = pu1 + 1 + nofUnmatched;
p2 = pu2 + 1 + nofUnmatched;
diffList.push_back( d );
}
}
if ( bEndReached )
break;
}
#ifndef NDEBUG
// Verify difflist
{
int l1=0;
int l2=0;
DiffList::iterator i;
for( i = diffList.begin(); i!=diffList.end(); ++i )
{
l1+= i->nofEquals + i->diff1;
l2+= i->nofEquals + i->diff2;
}
//if( l1!=p1-p1start || l2!=p2-p2start )
if( l1!=size1 || l2!=size2 )
assert( false );
}
#endif
}
......
......@@ -15,15 +15,6 @@
* *
***************************************************************************/
/***************************************************************************
* $Log$
* Revision 1.2 2003/10/11 12:47:09 joachim99
* Avoid QWidget::setFont() in paintEvent()
*
* Revision 1.1 2003/10/06 18:38:48 joachim99
* KDiff3 version 0.9.70
***************************************************************************/
#include <iostream>
#include "diff.h"
#include "merger.h"
......@@ -37,6 +28,7 @@
#include <optiondialog.h>
#include <math.h>
#include <qdragobject.h>
#include <klocale.h>
#define leftInfoWidth (4+m_lineNumberWidth) // Nr of information columns on left side
......@@ -500,7 +492,7 @@ void DiffTextWindow::writeLine(
}
p.fillRect( leftInfoWidth*fontWidth, yOffset, width(), fontHeight, bgColor );
if (pld!=0)
{
// First calculate the "changed" information for each character.
......@@ -548,11 +540,18 @@ void DiffTextWindow::writeLine(
c = m_cDiffBoth;
}
if ( c!=m_pOptionDialog->m_fgColor && whatChanged2==0 && !m_pOptionDialog->m_bShowWhiteSpace )
{
// The user doesn't want to see highlighted white space.
c = m_pOptionDialog->m_fgColor;
}
QRect outRect( xOffset + fontWidth*outPos, yOffset, fontWidth*spaces, fontHeight );
if ( m_invalidRect.intersects( outRect ) )
{
if( !selection.within( line, outPos ) )
{
if( c!=m_pOptionDialog->m_fgColor )
{
QColor lightc = diffBgColor;
......@@ -564,7 +563,7 @@ void DiffTextWindow::writeLine(
p.setPen( c );
if ( s[0]==' ' && c!=m_pOptionDialog->m_fgColor && charChanged[i]!=0 )
{
if ( m_pOptionDialog->m_bShowWhiteSpace )
if ( m_pOptionDialog->m_bShowWhiteSpaceCharacters && m_pOptionDialog->m_bShowWhiteSpace)
{
p.fillRect( xOffset + fontWidth*outPos, yOffset+fontAscent,
fontWidth*spaces-1, fontDescent+1, c );
......@@ -572,7 +571,7 @@ void DiffTextWindow::writeLine(
}
else
{
p.drawText( xOffset + fontWidth*outPos, yOffset + fontAscent, QString::fromUtf8(s) );
p.drawText( xOffset + fontWidth*outPos, yOffset + fontAscent, decodeString(s,m_pOptionDialog) );
}