fix some compilation warnings

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_5_X@24636 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2008-05-06 13:20:07 +00:00
parent 8481a30711
commit 2e4c330f26
8 changed files with 23 additions and 16 deletions

View File

@ -636,7 +636,7 @@ bool Paragraph::Pimpl::simpleTeXBlanks(Encoding const & encoding,
int Paragraph::Pimpl::writeScriptChars(odocstream & os,
value_type c,
value_type /*c*/,
docstring const & ltx,
Change & runningChange,
Encoding const & encoding,

View File

@ -336,17 +336,18 @@ RowMetrics TextMetrics::computeRowMetrics(pit_type const pit,
// The test on par.size() is to catch zero-size pars, which
// would trigger the assert in Paragraph::getInset().
//inset = par.size() ? par.getInset(row.pos()) : 0;
if (row.pos() < par.size()
&& par.isInset(row.pos()))
{
switch(par.getInset(row.pos())->display()) {
if (row.pos() < par.size() && par.isInset(row.pos())) {
switch(par.getInset(row.pos())->display()) {
case Inset::AlignLeft:
align = LYX_ALIGN_BLOCK;
break;
case Inset::AlignCenter:
align = LYX_ALIGN_CENTER;
break;
// other types unchanged (use align)
case Inset::Inline:
case Inset::AlignRight:
// unchanged (use align)
break;
}
}

View File

@ -43,7 +43,7 @@ TearOff::TearOff(QWidget * parent)
}
void TearOff::mouseReleaseEvent(QMouseEvent * event)
void TearOff::mouseReleaseEvent(QMouseEvent * /*event*/)
{
// signal
tearOff();
@ -66,7 +66,7 @@ void TearOff::leaveEvent(QEvent * event)
}
void TearOff::paintEvent(QPaintEvent * event)
void TearOff::paintEvent(QPaintEvent * /*event*/)
{
QPainter p(this);
const int fw = style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0, this);
@ -149,7 +149,7 @@ void IconPalette::clicked(QAction * action)
}
void IconPalette::showEvent(QShowEvent * event)
void IconPalette::showEvent(QShowEvent * /*event*/)
{
resize(sizeHint());
setMaximumSize(sizeHint());
@ -227,7 +227,7 @@ void IconPalette::updateParent()
}
void IconPalette::paintEvent(QPaintEvent * event)
void IconPalette::paintEvent(QPaintEvent * /*event*/)
{
// draw border
const int fw = style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0, this);

View File

@ -93,13 +93,16 @@ Length widgetsToLength(QLineEdit const * input, QComboBox const * combo)
}
namespace {
void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
Length const & len, Length::UNIT defaultUnit)
Length const & len)
{
combo->setCurrentItem(Length(len).unit());
input->setText(toqstr(convert<string>(Length(len).value())));
}
}
void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
string const & len, Length::UNIT defaultUnit)
@ -113,7 +116,7 @@ void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
combo->setCurrentItem(defaultUnit);
input->setText(toqstr(len));
} else {
lengthToWidgets(input, combo, Length(len), defaultUnit);
lengthToWidgets(input, combo, Length(len));
}
}
@ -124,7 +127,7 @@ void lengthAutoToWidgets(QLineEdit * input, LengthCombo * combo,
if (len.value() == 0)
lengthToWidgets(input, combo, "auto", defaultUnit);
else
lengthToWidgets(input, combo, len, defaultUnit);
lengthToWidgets(input, combo, len);
}

View File

@ -165,7 +165,8 @@ int InsetListings::latex(Buffer const & buf, odocstream & os,
++lines;
}
}
char const * delimiter;
// FIXME: use C++ code instead of this thing.
char const * delimiter = 0;
if (lstinline) {
for (delimiter = lstinline_delimiters; delimiter != '\0'; ++delimiter)
if (!contains(code, *delimiter))

View File

@ -72,7 +72,7 @@ bool InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const
break;
case ENSPACE:
case ENSKIP:
dim.wid = 0.5 * fm.width(char_type('M'));
dim.wid = fm.width(char_type('M')) / 2;
break;
}
bool const changed = dim_ != dim;

View File

@ -87,7 +87,7 @@ InsetText::InsetText(BufferParams const & bp)
InsetText::InsetText(InsetText const & in)
: Inset(in), text_(), fixed_width_(fixed_width_)
: Inset(in), fixed_width_(fixed_width_), text_()
{
text_.autoBreakRows_ = in.text_.autoBreakRows_;
drawFrame_ = in.drawFrame_;

View File

@ -216,3 +216,5 @@ What's new
fails (bug 4638)
- fix the problems with compilation on gcc 4.3.0 with disabled pch headers.
- fix some compilation warnings.