Commit 277cf202 authored by Joachim Eibl's avatar Joachim Eibl

By Maurice van der Pot: Regression test framework.

git-svn-id: https://kdiff3.svn.sourceforge.net/svnroot/kdiff3/trunk@160 c8aa9fed-2811-0410-8543-893ada326672
parent 0ef5fffc
- Memory usage optimized for comparison of large directories. (ca. 1/5 needed)
- On Windows use config file .kdiff3rc next to kdiff3.exe if exists.
- In overwiev for two way diff show if only one side contains text.
- Fix for Fedora by Neal Becker in src-QT4/kdiff3part.desktop.
- When word wrap is active toggling line numbers now recalculates the word wrap.
- Removed confusing "For compatibility ..." hint from option -qall
- Fixed mouse wheel problem. (Patch by David Hay)
- Change an encoding in diff text window via click on encoding label. (Patch by Alexey Kostromin)
- Fix for tab-key moving focus instead of adding a tab character in MergeResultWindow.
Version 0.9.96 - 2011-09-02
===========================
......
......@@ -20,7 +20,8 @@ set(kdiff3part_PART_SRCS
gnudiff_io.cpp
gnudiff_xmalloc.cpp
common.cpp
smalldialogs.cpp )
smalldialogs.cpp
progress.cpp )
kde4_add_plugin(kdiff3part WITH_PREFIX ${kdiff3part_PART_SRCS})
......
This diff is collapsed.
......@@ -24,11 +24,9 @@
#include <assert.h>
#include "common.h"
#include "fileaccess.h"
#include "optiondialog.h"
#include "options.h"
class OptionDialog;
// Each range with matching elements is followed by a range with differences on either side.
// Then again range of matching elements should follow.
struct Diff
......@@ -246,7 +244,7 @@ public:
SourceData();
~SourceData();
void setOptionDialog( OptionDialog* pOptionDialog );
void setOptions( Options* pOptions );
int getSizeLines() const;
int getSizeBytes() const;
......@@ -267,10 +265,11 @@ public:
bool isText(); // is it pure text (vs. binary data)
bool isIncompleteConversion(); // true if some replacement characters were found
bool isFromBuffer(); // was it set via setData() (vs. setFileAccess() or setFilename())
void setData( const QString& data );
QStringList setData( const QString& data );
bool isValid(); // Either no file is specified or reading was successful
void readAndPreprocess(QTextCodec* pEncoding, bool bAutoDetectUnicode );
// Returns a list of error messages if anything went wrong
QStringList readAndPreprocess(QTextCodec* pEncoding, bool bAutoDetectUnicode );
bool saveNormalDataAs( const QString& fileName );
bool isBinaryEqualWith( const SourceData& other ) const;
......@@ -284,7 +283,7 @@ private:
QTextCodec* detectEncoding( const QString& fileName, QTextCodec* pFallbackCodec );
QString m_aliasName;
FileAccess m_fileAccess;
OptionDialog* m_pOptionDialog;
Options* m_pOptions;
QString m_tempInputFileName;
struct FileData
......@@ -316,8 +315,6 @@ void calcWhiteDiff3Lines( Diff3LineList& d3ll, const LineData* pldA, const Lin
void calcDiff3LineVector( Diff3LineList& d3ll, Diff3LineVector& d3lv );
void debugLineCheck( Diff3LineList& d3ll, int size, int idx );
class Selection
......@@ -365,8 +362,6 @@ public:
firstLine<lastLine ? lastPos : firstPos; }
};
class OptionDialog;
// Helper class that swaps left and right for some commands.
class MyPainter : public QPainter
......@@ -423,6 +418,9 @@ public:
}
};
bool runDiff( const LineData* p1, int size1, const LineData* p2, int size2, DiffList& diffList, int winIdx1, int winIdx2,
ManualDiffHelpList *pManualDiffHelpList, Options *pOptions);
bool fineDiff(
Diff3LineList& diff3LineList,
int selector,
......
This diff is collapsed.
......@@ -20,11 +20,11 @@
#include "diff.h"
#include <QWidget>
#include <QLabel>
class QMenu;
class QStatusBar;
class OptionDialog;
class Options;
class DiffTextWindowData;
class DiffTextWindowFrame;
class EncodingLabel;
......@@ -36,7 +36,7 @@ public:
DiffTextWindow(
DiffTextWindowFrame* pParent,
QStatusBar* pStatusBar,
OptionDialog* pOptionDialog,
Options* pOptions,
int winIdx
);
......@@ -119,7 +119,7 @@ class DiffTextWindowFrame : public QWidget
{
Q_OBJECT
public:
DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusBar, OptionDialog* pOptionDialog, int winIdx, SourceData* psd);
DiffTextWindowFrame( QWidget* pParent, QStatusBar* pStatusBar, Options* pOptions, int winIdx, SourceData* psd);
~DiffTextWindowFrame();
DiffTextWindow* getDiffTextWindow();
void init();
......@@ -142,7 +142,7 @@ class EncodingLabel : public QLabel
{
Q_OBJECT
public:
EncodingLabel( const QString & text, DiffTextWindowFrame* pDiffTextWindowFrame, SourceData* psd, OptionDialog* pOptionDialog);
EncodingLabel( const QString & text, DiffTextWindowFrame* pDiffTextWindowFrame, SourceData* psd, Options* pOptions);
protected:
void mouseMoveEvent(QMouseEvent *ev);
void mousePressEvent(QMouseEvent *ev);
......@@ -153,7 +153,7 @@ private:
QMenu* m_pContextEncodingMenu;
SourceData* m_pSourceData; //SourceData to get access to "isEmpty()" and "isFromBuffer()" functions
static const int m_maxRecentEncodings = 5;
OptionDialog* m_pOptionDialog;
Options* m_pOptions;
void insertCodec( const QString& visibleCodecName, QTextCodec* pCodec, QList<int> &CodecEnumList, QMenu* pMenu, int currentTextCodecEnum);
};
......
......@@ -16,7 +16,8 @@
***************************************************************************/
#include "stable.h"
#include "directorymergewindow.h"
#include "optiondialog.h"
#include "options.h"
#include "progress.h"
#include <vector>
#include <map>
......@@ -320,7 +321,7 @@ public:
FileAccess m_dirC;
FileAccess m_dirDest;
FileAccess m_dirDestInternal;
OptionDialog* m_pOptions;
Options* m_pOptions;
void calcDirStatus( bool bThreeDirs, const QModelIndex& mi,
int& nofFiles, int& nofDirs, int& nofEqualFiles, int& nofManualMerges );
......@@ -646,8 +647,8 @@ public:
0 ;
if ( i!=0 )
{
OptionDialog* pOD = d->m_pOptions;
QColor c ( i==1 ? pOD->m_colorA : i==2 ? pOD->m_colorB : pOD->m_colorC );
Options* pOpts = d->m_pOptions;
QColor c ( i==1 ? pOpts->m_colorA : i==2 ? pOpts->m_colorB : pOpts->m_colorC );
p->setPen( c );// highlight() );
p->drawRect( x+2, y+yOffset, icon.width(), icon.height());
p->setPen( QPen( c, 0, Qt::DotLine) );
......@@ -681,7 +682,7 @@ public:
};
DirectoryMergeWindow::DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader )
DirectoryMergeWindow::DirectoryMergeWindow( QWidget* pParent, Options* pOptions, KIconLoader* pIconLoader )
: QTreeView( pParent )
{
d = new Data(this);
......
......@@ -26,7 +26,7 @@
#include "fileaccess.h"
#include "diff.h" //TotalDiffStatus
class OptionDialog;
class Options;
class KIconLoader;
class StatusInfo;
class DirectoryMergeInfo;
......@@ -60,7 +60,7 @@ class DirectoryMergeWindow : public QTreeView
{
Q_OBJECT
public:
DirectoryMergeWindow( QWidget* pParent, OptionDialog* pOptions, KIconLoader* pIconLoader );
DirectoryMergeWindow( QWidget* pParent, Options* pOptions, KIconLoader* pIconLoader );
~DirectoryMergeWindow();
void setDirectoryMergeInfo(DirectoryMergeInfo* p);
bool init(
......
This diff is collapsed.
......@@ -11,23 +11,30 @@
#ifndef FILEACCESS_H
#define FILEACCESS_H
#include <QDialog>
#include "progress.h"
#include <QDateTime>
#include <QEventLoop>
#include <QLabel>
#include <QProgressBar>
#include <kprogressdialog.h>
#include <kio/job.h>
#include <kio/jobclasses.h>
#include <kurl.h>
#include <list>
bool wildcardMultiMatch( const QString& wildcard, const QString& testString, bool bCaseSensitive );
class t_DirectoryList;
class QFileInfo;
class ProgressProxyExtender: public ProgressProxy
{
Q_OBJECT
public slots:
void slotListDirInfoMessage( KJob*, const QString& msg );
void slotPercent( KJob*, unsigned long percent );
};
class FileAccess
{
public:
......@@ -168,104 +175,9 @@ private slots:
void slotGetData(KJob*,const QByteArray&);
void slotPutData(KIO::Job*, QByteArray&);
void slotListDirInfoMessage( KJob*, const QString& msg );
void slotListDirProcessNewEntries( KIO::Job *, const KIO::UDSEntryList& l );
void slotPercent( KJob* pJob, unsigned long percent );
};
class ProgressDialog : public QDialog
{
Q_OBJECT
public:
ProgressDialog( QWidget* pParent );
void setStayHidden( bool bStayHidden );
void setInformation( const QString& info, bool bRedrawUpdate=true );
void setInformation( const QString& info, double dCurrent, bool bRedrawUpdate=true );
void setCurrent( double dCurrent, bool bRedrawUpdate=true );
void step( bool bRedrawUpdate=true );
void setMaxNofSteps( int dMaxNofSteps );
void push();
void pop(bool bRedrawUpdate=true);
// The progressbar goes from 0 to 1 usually.
// By supplying a subrange transformation the subCurrent-values
// 0 to 1 will be transformed to dMin to dMax instead.
// Requirement: 0 < dMin < dMax < 1
void setRangeTransformation( double dMin, double dMax );
void setSubRangeTransformation( double dMin, double dMax );
void exitEventLoop();
void enterEventLoop( KJob* pJob, const QString& jobInfo );
bool wasCancelled();
void show();
void hide();
virtual void timerEvent(QTimerEvent*);
private:
struct ProgressLevelData
{
ProgressLevelData()
{
m_dCurrent=0; m_maxNofSteps=1; m_dRangeMin=0; m_dRangeMax=1;
m_dSubRangeMin = 0; m_dSubRangeMax = 1;
}
double m_dCurrent;
int m_maxNofSteps; // when step() is used.
double m_dRangeMax;
double m_dRangeMin;
double m_dSubRangeMax;
double m_dSubRangeMin;
};
std::list<ProgressLevelData> m_progressStack;
int m_progressDelayTimer;
std::list<QEventLoop*> m_eventLoopStack;
QProgressBar* m_pProgressBar;
QProgressBar* m_pSubProgressBar;
QLabel* m_pInformation;
QLabel* m_pSubInformation;
QLabel* m_pSlowJobInfo;
QPushButton* m_pAbortButton;
void recalc(bool bRedrawUpdate);
QTime m_t1;
QTime m_t2;
bool m_bWasCancelled;
KJob* m_pJob;
QString m_currentJobInfo; // Needed if the job doesn't stop after a reasonable time.
bool m_bStayHidden;
protected:
virtual void reject();
private slots:
void delayedHide();
void slotAbort();
};
// When using the ProgressProxy you need not take care of the push and pop, except when explicit.
class ProgressProxy
{
public:
ProgressProxy();
~ProgressProxy();
void setInformation( const QString& info, bool bRedrawUpdate=true );
void setInformation( const QString& info, double dCurrent, bool bRedrawUpdate=true );
void setCurrent( double dCurrent, bool bRedrawUpdate=true );
void step( bool bRedrawUpdate=true );
void setMaxNofSteps( int dMaxNofSteps );
bool wasCancelled();
void setRangeTransformation( double dMin, double dMax );
void setSubRangeTransformation( double dMin, double dMax );
private:
};
extern ProgressDialog* g_pProgressDialog;
#endif
This diff is collapsed.
......@@ -300,6 +300,7 @@ class KDiff3App : public QSplitter
bool m_bTimerBlock; // Synchronisation
OptionDialog* m_pOptionDialog;
Options* m_pOptions;
FindDialog* m_pFindDialog;
void init( bool bAuto=false, TotalDiffStatus* pTotalDiffStatus=0, bool bLoadFiles=true, bool bUseCurrentEncoding = false);
......@@ -309,8 +310,6 @@ class KDiff3App : public QSplitter
bool improveFilenames(bool bCreateNewInstance);
bool runDiff( const LineData* p1, int size1, const LineData* p2, int size2, DiffList& diffList, int winIdx1, int winIdx2 );
bool runDiff( const LineData* p1, int size1, const LineData* p2, int size2, DiffList& diffList );
bool canContinue();
void choose(int choice);
......
......@@ -9,6 +9,8 @@ HEADERS = version.h \
kdiff3.h \
merger.h \
optiondialog.h \
options.h \
progress.h \
kreplacements/kreplacements.h \
directorymergewindow.h \
fileaccess.h \
......@@ -25,6 +27,7 @@ SOURCES = main.cpp \
pdiff.cpp \
directorymergewindow.cpp \
fileaccess.cpp \
progress.cpp \
smalldialogs.cpp \
kdiff3_shell.cpp \
kdiff3_part.cpp \
......
This diff is collapsed.
......@@ -31,7 +31,7 @@ class Overview : public QWidget
{
Q_OBJECT
public:
Overview( OptionDialog* pOptions );
Overview( Options* pOptions );
void init( Diff3LineList* pDiff3LineList, bool bTripleDiff );
void reset();
......@@ -49,7 +49,7 @@ signals:
void setLine(int);
private:
const Diff3LineList* m_pDiff3LineList;
OptionDialog* m_pOptions;
Options* m_pOptions;
bool m_bTripleDiff;
int m_firstLine;
int m_pageHeight;
......@@ -100,7 +100,7 @@ class MergeResultWindow : public QWidget
public:
MergeResultWindow(
QWidget* pParent,
OptionDialog* pOptionDialog,
Options* pOptions,
QStatusBar* pStatusBar
);
......@@ -176,7 +176,7 @@ private:
void merge(bool bAutoSolve, int defaultSelector, bool bConflictsOnly=false, bool bWhiteSpaceOnly=false );
QString getString( int lineIdx );
OptionDialog* m_pOptionDialog;
Options* m_pOptions;
const LineData* m_pldA;
const LineData* m_pldB;
......@@ -436,9 +436,9 @@ private:
QComboBox* m_pLineEndStyleSelector;
QLabel* m_pEncodingLabel;
QComboBox* m_pEncodingSelector;
OptionDialog* m_pOptionDialog;
Options* m_pOptions;
public:
WindowTitleWidget(OptionDialog* pOptionDialog);
WindowTitleWidget(Options* pOptions);
QTextCodec* getEncoding();
void setFileName(const QString& fileName );
QString getFileName();
......
This diff is collapsed.
......@@ -27,20 +27,14 @@
#include <list>
#include <kcmdlineargs.h>
#include "options.h"
class OptionItem;
class OptionCheckBox;
class OptionEncodingComboBox;
class OptionLineEdit;
class KKeyDialog;
enum e_LineEndStyle
{
eLineEndStyleUnix=0,
eLineEndStyleDos,
eLineEndStyleAutoDetect,
eLineEndStyleUndefined, // only one line exists
eLineEndStyleConflict // User must resolve manually
};
class OptionDialog : public KPageDialog
{
......@@ -53,119 +47,7 @@ public:
QString parseOptions( const QStringList& optionList );
QString calcOptionHelp();
// Some settings are not available in the option dialog:
QSize m_geometry;
QPoint m_position;
bool m_bMaximised;
bool m_bShowToolBar;
bool m_bShowStatusBar;
int m_toolBarPos;
// These are the results of the option dialog.
QFont m_font;
bool m_bItalicForDeltas;
QColor m_fgColor;
QColor m_bgColor;
QColor m_diffBgColor;
QColor m_colorA;
QColor m_colorB;
QColor m_colorC;
QColor m_colorForConflict;
QColor m_currentRangeBgColor;
QColor m_currentRangeDiffBgColor;
QColor m_oldestFileColor;
QColor m_midAgeFileColor;
QColor m_newestFileColor;
QColor m_missingFileColor;
QColor m_manualHelpRangeColor;
bool m_bWordWrap;
bool m_bReplaceTabs;
bool m_bAutoIndentation;
int m_tabSize;
bool m_bAutoCopySelection;
bool m_bSameEncoding;
QTextCodec* m_pEncodingA;
bool m_bAutoDetectUnicodeA;
QTextCodec* m_pEncodingB;
bool m_bAutoDetectUnicodeB;
QTextCodec* m_pEncodingC;
bool m_bAutoDetectUnicodeC;
QTextCodec* m_pEncodingOut;
bool m_bAutoSelectOutEncoding;
QTextCodec* m_pEncodingPP;
int m_lineEndStyle;
bool m_bPreserveCarriageReturn;
bool m_bTryHard;
bool m_bShowWhiteSpaceCharacters;
bool m_bShowWhiteSpace;
bool m_bShowLineNumbers;
bool m_bHorizDiffWindowSplitting;
bool m_bShowInfoDialogs;
bool m_bDiff3AlignBC;
int m_whiteSpace2FileMergeDefault;
int m_whiteSpace3FileMergeDefault;
bool m_bIgnoreCase;
bool m_bIgnoreNumbers;
bool m_bIgnoreComments;
QString m_PreProcessorCmd;
QString m_LineMatchingPreProcessorCmd;
bool m_bRunRegExpAutoMergeOnMergeStart;
QString m_autoMergeRegExp;
bool m_bRunHistoryAutoMergeOnMergeStart;
QString m_historyStartRegExp;
QString m_historyEntryStartRegExp;
bool m_bHistoryMergeSorting;
QString m_historyEntryStartSortKeyOrder;
int m_maxNofHistoryEntries;
QString m_IrrelevantMergeCmd;
bool m_bAutoSaveAndQuitOnMergeWithoutConflicts;
bool m_bAutoAdvance;
int m_autoAdvanceDelay;
QStringList m_recentAFiles;
QStringList m_recentBFiles;
QStringList m_recentCFiles;
QStringList m_recentEncodings;
QStringList m_recentOutputFiles;
// Directory Merge options
bool m_bDmSyncMode;
bool m_bDmRecursiveDirs;
bool m_bDmFollowFileLinks;
bool m_bDmFollowDirLinks;
bool m_bDmFindHidden;
bool m_bDmCreateBakFiles;
bool m_bDmBinaryComparison;
bool m_bDmFullAnalysis;
bool m_bDmTrustDate;
bool m_bDmTrustDateFallbackToBinary;
bool m_bDmTrustSize;
bool m_bDmCopyNewer;
//bool m_bDmShowOnlyDeltas;
bool m_bDmShowIdenticalFiles;
bool m_bDmUseCvsIgnore;
bool m_bDmWhiteSpaceEqual;
bool m_bDmCaseSensitiveFilenameComparison;
bool m_bDmUnfoldSubdirs;
bool m_bDmSkipDirStatus;
QString m_DmFilePattern;
QString m_DmFileAntiPattern;
QString m_DmDirAntiPattern;
QString m_language;
bool m_bRightToLeftLanguage;
QString m_ignorableCmdLineOptions;
bool m_bIntegrateWithClearCase;
bool m_bEscapeKeyQuits;
Options m_options;
void saveOptions(KSharedConfigPtr config);
void readOptions(KSharedConfigPtr config);
......
This diff is collapsed.
......@@ -19,7 +19,7 @@
***************************************************************************/
#include "smalldialogs.h"
#include "optiondialog.h"
#include "options.h"
#include "diff.h"
#include <QComboBox>
......@@ -41,7 +41,7 @@
OpenDialog::OpenDialog(
QWidget* pParent, const QString& n1, const QString& n2, const QString& n3,
bool bMerge, const QString& outputName, const char* slotConfigure, OptionDialog* pOptions )
bool bMerge, const QString& outputName, const char* slotConfigure, Options* pOptions )
: QDialog( pParent )
{
setObjectName("OpenDialog");
......
......@@ -23,7 +23,7 @@
#include <QDialog>
class OptionDialog;
class Options;
class QComboBox;
class QCheckBox;
class QLineEdit;
......@@ -34,7 +34,7 @@ class OpenDialog : public QDialog
public:
OpenDialog(
QWidget* pParent, const QString& n1, const QString& n2, const QString& n3,
bool bMerge, const QString& outputName, const char* slotConfigure, OptionDialog* pOptions );
bool bMerge, const QString& outputName, const char* slotConfigure, Options* pOptions );
QComboBox* m_pLineA;
QComboBox* m_pLineB;
......@@ -45,7 +45,7 @@ public:
virtual void accept();
virtual bool eventFilter(QObject* o, QEvent* e);
private:
OptionDialog* m_pOptions;
Options* m_pOptions;
void selectURL( QComboBox* pLine, bool bDir, int i, bool bSave );
bool m_bInputFileNameChanged;
private slots:
......@@ -102,7 +102,6 @@ private:
QLineEdit* m_pHistoryEntryStartExampleEdit;
QLineEdit* m_pHistoryEntryStartMatchResult;
QLineEdit* m_pHistorySortKeyResult;
OptionDialog* m_pOptionDialog;
public:
RegExpTester( QWidget* pParent, const QString& autoMergeRegExpToolTip, const QString& historyStartRegExpToolTip,
const QString& historyEntryStartRegExpToolTip, const QString& historySortKeyOrderToolTip );
......
// vim:sw=3:ts=3:expandtab
#include <iostream>
#include <stdio.h>
#include <QDirIterator>
#include <QTextCodec>
#include <QTextStream>
#include "diff.h"
#include "gnudiff_diff.h"
#include "options.h"
#include "progress.h"
#define i18n(s) s
Options *m_pOptions = NULL;
ManualDiffHelpList m_manualDiffHelpList;
bool g_bIgnoreWhiteSpace = true;
bool g_bIgnoreTrivialMatches = true;
void determineFileAlignment(SourceData &m_sd1, SourceData &m_sd2, SourceData &m_sd3, Diff3LineList &m_diff3LineList)
{
DiffList m_diffList12;
DiffList m_diffList23;
DiffList m_diffList13;
m_diff3LineList.clear();
// Run the diff.
if ( m_sd3.isEmpty() )
{
runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12,1,2,
&m_manualDiffHelpList, m_pOptions);
calcDiff3LineListUsingAB( &m_diffList12, m_diff3LineList );
fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay() );
}
else
{
runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12,1,2,
&m_manualDiffHelpList, m_pOptions);
runDiff( m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_sd3.getLineDataForDiff(), m_sd3.getSizeLines(), m_diffList23,2,3,
&m_manualDiffHelpList, m_pOptions);
runDiff( m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd3.getLineDataForDiff(), m_sd3.getSizeLines(), m_diffList13,1,3,
&m_manualDiffHelpList, m_pOptions);
calcDiff3LineListUsingAB( &m_diffList12, m_diff3LineList );
calcDiff3LineListUsingAC( &m_diffList13, m_diff3LineList );
correctManualDiffAlignment( m_diff3LineList, &m_manualDiffHelpList );
calcDiff3LineListTrim( m_diff3LineList, m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff(), &m_manualDiffHelpList );
if ( m_pOptions->m_bDiff3AlignBC )
{
calcDiff3LineListUsingBC( &m_diffList23, m_diff3LineList );
correctManualDiffAlignment( m_diff3LineList, &m_manualDiffHelpList );
calcDiff3LineListTrim( m_diff3LineList, m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff(), &m_manualDiffHelpList );
}
fineDiff( m_diff3LineList, 1, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay() );
fineDiff( m_diff3LineList, 2, m_sd2.getLineDataForDisplay(), m_sd3.getLineDataForDisplay() );
fineDiff( m_diff3LineList, 3, m_sd3.getLineDataForDisplay(), m_sd1.getLineDataForDisplay() );
}
calcWhiteDiff3Lines( m_diff3LineList, m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff() );
}
void printDiffList(const Diff3LineList &diff3LineList,
const SourceData &sd1,
const SourceData &sd2,
const SourceData &sd3)
{
const int columnsize = 30;
const int linenumsize = 6;
Diff3LineList::const_iterator i;
for ( i=diff3LineList.begin(); i!=diff3LineList.end(); ++i )
{
QTextStream out(stdout);
QString lineAText;
QString lineBText;
QString lineCText;
const Diff3Line& d3l = *i;
if(d3l.lineA != -1)
{
const LineData *pLineData = &sd1.getLineDataForDiff()[d3l.lineA];
lineAText = QString(pLineData->pLine, pLineData->size);
lineAText = QString("%1 %2").arg(d3l.lineA, linenumsize).arg(lineAText.left(columnsize - linenumsize - 1));
}
if(d3l.lineB != -1)
{
const LineData *pLineData = &sd2.getLineDataForDiff()[d3l.lineB];
lineBText = QString(pLineData->pLine, pLineData->size);
lineBText = QString("%1 %2").arg(d3l.lineB, linenumsize).arg(lineBText.left(columnsize - linenumsize - 1));
}