"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/c2bCiterView.cpp" between
cb2bib-2.0.0.tar.gz and cb2bib-2.0.1.tar.gz

About: cb2Bib is a multiplatform application for rapidly extracting unformatted, or unstandardized bibliographic references from email alerts, journal Web pages, and PDF files.

c2bCiterView.cpp  (cb2bib-2.0.0):c2bCiterView.cpp  (cb2bib-2.0.1)
/*************************************************************************** /***************************************************************************
* Copyright (C) 2004-2019 by Pere Constans * Copyright (C) 2004-2021 by Pere Constans
* constans@molspaces.com * constans@molspaces.com
* cb2Bib version 2.0.0. Licensed under the GNU GPL version 3. * cb2Bib version 2.0.1. Licensed under the GNU GPL version 3.
* See the LICENSE file that comes with this distribution. * See the LICENSE file that comes with this distribution.
***************************************************************************/ ***************************************************************************/
#include "c2bCiterView.h" #include "c2bCiterView.h"
#include "c2bCiterExcerptView.h" #include "c2bCiterExcerptView.h"
#include <bibSearcher.h> #include <bibSearcher.h>
#include <QApplication> #include <QApplication>
#include <QHeaderView> #include <QHeaderView>
skipping to change at line 222 skipping to change at line 222
const int nc(_citationsP->columnCount()); const int nc(_citationsP->columnCount());
if (nc < 1) if (nc < 1)
return; return;
const int vp_w(viewport()->size().width()); const int vp_w(viewport()->size().width());
if (nc == 1) if (nc == 1)
{ {
setColumnWidth(0, vp_w); setColumnWidth(0, vp_w);
return; return;
} }
QList<int> w = _citationsP->sizeHintForColumns(); QList<int> w = _citationsP->sizeHintForColumns();
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
const int char_w(fontMetrics().horizontalAdvance(QLatin1Char('N')));
#else
const int char_w(fontMetrics().width(QLatin1Char('N'))); const int char_w(fontMetrics().width(QLatin1Char('N')));
#endif
for (int i = 0; i < nc; ++i) for (int i = 0; i < nc; ++i)
w[i] *= char_w; w[i] *= char_w;
int required_w(w.at(0)); int required_w(w.at(0));
if (required_w >= vp_w) if (required_w >= vp_w)
{ {
setColumnWidth(0, vp_w); setColumnWidth(0, vp_w);
for (int i = 1; i < nc; ++i) for (int i = 1; i < nc; ++i)
setColumnWidth(i, 0); setColumnWidth(i, 0);
return; return;
} }
 End of changes. 4 change blocks. 
2 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)