Commit 98456f04 authored by Joachim Eibl's avatar Joachim Eibl

Fix crash on start if word wrap is on, and fix for storing utf-8 without

BOM.


git-svn-id: https://kdiff3.svn.sourceforge.net/svnroot/kdiff3/trunk@95 c8aa9fed-2811-0410-8543-893ada326672
parent c1c1fd4b
......@@ -139,6 +139,8 @@ KDiff3App::KDiff3App(QWidget* pParent, const char* name, KDiff3Part* pKDiff3Part
m_bFileSaved = false;
m_bTimerBlock = false;
m_pHScrollBar = 0;
m_pDiffVScrollBar = 0;
m_pMergeVScrollBar = 0;
viewToolBar = 0;
// Needed before any file operations via FileAccess happen.
......
......@@ -2733,7 +2733,10 @@ bool MergeResultWindow::saveDocument( const QString& fileName, QTextCodec* pEnco
QByteArray dataArray;
QTextStream textOutStream(&dataArray, QIODevice::WriteOnly);
textOutStream.setGenerateByteOrderMark( true ); // Only for UTF-16
if ( pEncoding->name()=="UTF-8" )
textOutStream.setGenerateByteOrderMark( false ); // Shouldn't be necessary. Bug in Qt or docs
else
textOutStream.setGenerateByteOrderMark( true ); // Only for UTF-16
textOutStream.setCodec( pEncoding );
int line = 0;
......
......@@ -1628,7 +1628,8 @@ void KDiff3App::recalcWordWrap(int nofVisibleColumns) // nofVisibleColumns is >=
m_pDiffTextWindow3->update();
}
m_pDiffVScrollBar->setRange(0, max2(0, m_neededLines+1 - m_DTWHeight) );
if ( m_pDiffVScrollBar )
m_pDiffVScrollBar->setRange(0, max2(0, m_neededLines+1 - m_DTWHeight) );
if ( m_pDiffTextWindow1 )
{
m_pDiffVScrollBar->setValue( m_pDiffTextWindow1->convertDiff3LineIdxToLine( firstD3LIdx ) );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment