| 110 | } |
| 111 | |
| 112 | void determineFileAlignment(SourceData &m_sd1, SourceData &m_sd2, SourceData &m_sd3, Diff3LineList &m_diff3LineList) |
| 113 | { |
| 114 | DiffList m_diffList12; |
| 115 | DiffList m_diffList23; |
| 116 | DiffList m_diffList13; |
| 117 | |
| 118 | m_diff3LineList.clear(); |
| 119 | |
| 120 | // Run the diff. |
| 121 | if ( m_sd3.isEmpty() ) |
| 122 | { |
| 123 | m_manualDiffHelpList.runDiff(m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12, e_SrcSelector::A, e_SrcSelector::B); |
| 124 | m_diff3LineList.calcDiff3LineListUsingAB( &m_diffList12); |
| 125 | m_diff3LineList.fineDiff(e_SrcSelector::A, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), IgnoreFlag::none); |
| 126 | } |
| 127 | else |
| 128 | { |
| 129 | m_manualDiffHelpList.runDiff(m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_diffList12, e_SrcSelector::A, e_SrcSelector::B); |
| 130 | m_manualDiffHelpList.runDiff(m_sd2.getLineDataForDiff(), m_sd2.getSizeLines(), m_sd3.getLineDataForDiff(), m_sd3.getSizeLines(), m_diffList23, e_SrcSelector::B, e_SrcSelector::C); |
| 131 | m_manualDiffHelpList.runDiff(m_sd1.getLineDataForDiff(), m_sd1.getSizeLines(), m_sd3.getLineDataForDiff(), m_sd3.getSizeLines(), m_diffList13, e_SrcSelector::A, e_SrcSelector::C); |
| 132 | |
| 133 | if (verbose) |
| 134 | { |
| 135 | printDiffList("m_diffList12", m_diffList12); |
| 136 | printDiffList("m_diffList23", m_diffList23); |
| 137 | printDiffList("m_diffList13", m_diffList13); |
| 138 | } |
| 139 | |
| 140 | m_diff3LineList.calcDiff3LineListUsingAB( &m_diffList12); |
| 141 | if (verbose) printDiff3List("after calcDiff3LineListUsingAB", m_diff3LineList, m_sd1, m_sd2, m_sd3); |
| 142 | |
| 143 | m_diff3LineList.calcDiff3LineListUsingAC( &m_diffList13); |
| 144 | if (verbose) printDiff3List("after calcDiff3LineListUsingAC", m_diff3LineList, m_sd1, m_sd2, m_sd3); |
| 145 | |
| 146 | m_diff3LineList.correctManualDiffAlignment(&m_manualDiffHelpList ); |
| 147 | m_diff3LineList.calcDiff3LineListTrim(m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff(), &m_manualDiffHelpList ); |
| 148 | if (verbose) printDiff3List("after 1st calcDiff3LineListTrim", m_diff3LineList, m_sd1, m_sd2, m_sd3); |
| 149 | |
| 150 | if(gOptions->m_bDiff3AlignBC) |
| 151 | { |
| 152 | m_diff3LineList.calcDiff3LineListUsingBC( &m_diffList23); |
| 153 | if (verbose) printDiff3List("after calcDiff3LineListUsingBC", m_diff3LineList, m_sd1, m_sd2, m_sd3); |
| 154 | m_diff3LineList.correctManualDiffAlignment( &m_manualDiffHelpList ); |
| 155 | m_diff3LineList.calcDiff3LineListTrim(m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff(), &m_manualDiffHelpList ); |
| 156 | if (verbose) printDiff3List("after 2nd calcDiff3LineListTrim", m_diff3LineList, m_sd1, m_sd2, m_sd3); |
| 157 | } |
| 158 | |
| 159 | m_diff3LineList.fineDiff(e_SrcSelector::A, m_sd1.getLineDataForDisplay(), m_sd2.getLineDataForDisplay(), IgnoreFlag::none ); |
| 160 | m_diff3LineList.fineDiff(e_SrcSelector::B, m_sd2.getLineDataForDisplay(), m_sd3.getLineDataForDisplay(), IgnoreFlag::none ); |
| 161 | m_diff3LineList.fineDiff(e_SrcSelector::C, m_sd3.getLineDataForDisplay(), m_sd1.getLineDataForDisplay(), IgnoreFlag::none ); |
| 162 | } |
| 163 | m_diff3LineList.calcWhiteDiff3Lines( m_sd1.getLineDataForDiff(), m_sd2.getLineDataForDiff(), m_sd3.getLineDataForDiff(), false); |
| 164 | } |
| 165 | |
| 166 | QString getLineFromSourceData(const SourceData &sd, int line) |
| 167 | { |
no test coverage detected