}
-InsetBase * BufferView::Pimpl::getInsetByCode(InsetBase::Code code)
+InsetBase * BufferView::Pimpl::getInsetByCode(InsetBase::Code /*code*/)
{
#warning Does not work for mathed
// Ok, this is a little bit too brute force but it
// should work for now. Better infrastructure is coming. (Lgb)
+#warning FIXME
+#if 0
Buffer * buf = bv_->buffer();
Buffer::inset_iterator beg = buf->inset_iterator_begin();
Buffer::inset_iterator end = buf->inset_iterator_end();
bool cursor_par_seen = false;
LCursor & cur = bv_->cursor();
-#warning FIXME
-#if 0
LyXText * = bv_->getLyXText();
ParagraphList::iterator pit = text->getPar(cur.par());
+2004-03-26 Angus Leeming <leeming@lyx.org>
+
+ * src/BufferView_pimpl.C:
+ * src/CutAndPaste.C:
+ * src/buffer.C:
+ * src/iterators.C:
+ * src/output_plaintext.C:
+ * src/outputparams.h:
+ * src/paragraph_funcs.C:
+ * src/rowpainter.C:
+ * src/text.C:
+ * src/text2.C:
+ * src/frontends/controllers/ControlErrorList.C:
+ * src/frontends/gtk/FileDialogPrivate.C:
+ * src/frontends/gtk/GPainter.C:
+ * src/frontends/gtk/GToolbar.C:
+ * src/frontends/qt2/QRef.C:
+ * src/mathed/math_scriptinset.C: squash compiler warnings.
+
2004-03-26 Angus Leeming <leeming@lyx.org>
* ispell.C (LaunchIspell::start):
par_type startpit, par_type endpit,
int startpos, int endpos, bool doclear)
{
- if (startpit == pars.size() || (startpos > pars[startpit].size()))
+ if (startpit == par_type(pars.size()) ||
+ (startpos > pars[startpit].size()))
return PitPosPair(endpit, endpos);
- if (endpit == pars.size() || startpit == endpit) {
+ if (endpit == par_type(pars.size()) ||
+ startpit == endpit) {
endpos -= pars[startpit].erase(startpos, endpos);
return PitPosPair(endpit, endpos);
}
par_type pit = startpit + 1;
- while (pit != endpit && pit != pars.size()) {
+ while (pit != endpit && pit != par_type(pars.size())) {
par_type const next = pit + 1;
// "erase" the contents of the par
pars[pit].erase(0, pars[pit].size());
}
#endif
- if (startpit + 1 == pars.size())
+ if (startpit + 1 == par_type(pars.size()))
return PitPosPair(endpit, endpos);
if (doclear) {
// Split the paragraph for inserting the buf if necessary.
bool did_split = false;
- if (pars[pit].size() || pit + 1 == pars.size()) {
+ if (pars[pit].size() || pit + 1 == par_type(pars.size())) {
breakParagraphConservative(buffer.params(), pars, pit, pos);
did_split = true;
}
pos = pars[last_paste].size();
// Maybe some pasting.
- if (did_split && last_paste + 1 != pars.size()) {
+ if (did_split && last_paste + 1 != par_type(pars.size())) {
if (pars[last_paste + 1].hasSameLayout(pars[last_paste])) {
mergeParagraph(buffer.params(), pars, last_paste);
} else if (pars[last_paste + 1].empty()) {
void Buffer::inset_iterator::setParagraph()
{
- while (pit != pars_->size()) {
+ while (pit != par_type(pars_->size())) {
it = (*pars_)[pit].insetlist.begin();
if (it != (*pars_)[pit].insetlist.end())
return;
Buffer::inset_iterator & Buffer::inset_iterator::operator++()
{
- if (pit != pars_->size()) {
+ if (pit != par_type(pars_->size())) {
++it;
if (it == (*pars_)[pit].insetlist.end()) {
++pit;
// Now make the selection.
#warning FIXME (goto error)
+#warning This should be implemented using an LFUN. (Angus)
#if 0
PosIterator const pos(pit, start);
kernel().bufferview()->putSelectionAt(pos, range, false);
FileDialog::Private::Private(string const & title,
kb_action action,
- FileDialog::Button b1,
- FileDialog::Button b2) :
+ FileDialog::Button /*b1*/,
+ FileDialog::Button /*b2*/) :
action_(action)
{
fileSelection_.set_title(title);
void GPainter::setLineParam(Glib::RefPtr<Gdk::GC> gc,
line_style ls, line_width lw)
{
- int width;
- Gdk::LineStyle style;
+ int width = 0;
switch (lw) {
case Painter::line_thin:
width = 0;
break;
}
+ Gdk::LineStyle style = Gdk::LINE_SOLID;
switch (ls) {
case Painter::line_solid:
style = Gdk::LINE_SOLID;
ToolbarBackend::Item * item =
reinterpret_cast<ToolbarBackend::Item*>(
widget->get_data(gToolData));
- if (item->first.action == ToolbarBackend::LAYOUTS) {
+ if (item->first.action == int(ToolbarBackend::LAYOUTS)) {
LyXFunc const & lf = view_->getLyXFunc();
bool const sensitive =
lf.getStatus(FuncRequest(LFUN_LAYOUT)).enabled();
// restore the last selection for new insets
if (tmp.isEmpty() && lastref != -1
- && lastref < dialog_->refsLB->count())
+ && lastref < int(dialog_->refsLB->count()))
dialog_->refsLB->setCurrentItem(lastref);
else
for (unsigned int i = 0; i < dialog_->refsLB->count(); ++i) {
ParPosition::ParPosition(par_type p, ParagraphList const & pl)
: pit(p), plist(&pl)
{
- if (p != pl.size())
+ if (p != par_type(pl.size()))
it.reset(const_cast<InsetList&>(pl[p].insetlist).begin());
}
}
// Try to go to the next paragarph
- if (p.pit + 1 != p.plist->size() || positions_.size() == 1) {
+ if (p.pit + 1 != par_type(p.plist->size()) ||
+ positions_.size() == 1) {
++p.pit;
p.index.reset();
p.it.reset();
}
// Try to go to the next paragarph
- if (p.pit + 1 != p.plist->size() || positions_.size() == 1) {
+ if (p.pit + 1 != par_type(p.plist->size()) ||
+ positions_.size() == 1) {
++p.pit;
p.index.reset();
p.it.reset();
if (nargs() == 3)
return up ? 1 : 2;
BOOST_ASSERT(false);
+ // Silence compiler
+ return 0;
}
default:
word += c;
if (runparams.linelen > 0 &&
- currlinelen + word.length() > runparams.linelen)
+ currlinelen + word.length() > runparams.linelen)
{
os << "\n";
pair<int, string> p = addDepth(depth, ltype_depth);
#ifndef OUTPUTPARAMS_H
#define OUTPUTPARAMS_H
+#include "support/types.h"
+
struct OutputParams {
enum FLAVOR {
LATEX,
/** Line lenght to use with ascii export.
*/
- int linelen;
+ lyx::size_type linelen;
};
#endif // LATEXRUNPARAMS_H
{
par_type pit = p;
Paragraph::depth_type par_depth = pars[p].getDepth();
- while (pit != pars.size()) {
+ while (pit != par_type(pars.size())) {
LyXLayout_ptr const & layout = pars[pit].layout();
int const endlabeltype = layout->endlabeltype;
if (endlabeltype != END_LABEL_NO_LABEL) {
- if (p + 1 == pars.size())
+ if (p + 1 == par_type(pars.size()))
return endlabeltype;
Paragraph::depth_type const next_depth =
if (par_depth == 0)
break;
pit = outerHook(pit, pars);
- if (pit != pars.size())
+ if (pit != par_type(pars.size()))
par_depth = pars[pit].getDepth();
}
return END_LABEL_NO_LABEL;
LyXFont tmpfont(LyXFont::ALL_INHERIT);
// Resolve against environment font information
- while (pit != pars.size() && par_depth && !tmpfont.resolved()) {
+ while (pit != par_type(pars.size())
+ && par_depth
+ && !tmpfont.resolved()) {
pit = outerHook(pit, pars);
- if (pit != pars.size()) {
+ if (pit != par_type(pars.size())) {
tmpfont.realize(pars[pit].layout()->font);
par_depth = pars[pit].getDepth();
}
y -= bv.top_y();
ParagraphList & pars = text.paragraphs();
- for ( ; pit != pars.size(); ++pit) {
+ for ( ; pit != par_type(pars.size()); ++pit) {
RowList::iterator row = pars[pit].rows.begin();
RowList::iterator rend = pars[pit].rows.end();
// Make a corresponding row. Need to call leftMargin()
// to check whether it is a sufficent paragraph.
- if (newpar != pars_.size()
+ if (newpar != par_type(pars_.size())
&& pars_[newpar].layout()->isEnvironment()) {
x = leftMargin(newpar);
}
- if (newpar != paragraphs().size()
+ if (newpar != par_type(paragraphs().size())
&& pars_[pit].layout() == tclass.defaultLayout()) {
if (pars_[newpar].params().noindent())
parindent.erase();
}
prev = outerHook(pit, pars_);
- if (prev != pars_.size()) {
+ if (prev != par_type(pars_.size())) {
maxasc += int(pars_[prev].layout()->parsep * dh);
} else if (pit != 0) {
if (pars_[pit - 1].getDepth() != 0 ||
// a section, or between the items of a itemize or enumerate
// environment
par_type nextpit = pit + 1;
- if (nextpit != pars_.size()) {
+ if (nextpit != par_type(pars_.size())) {
par_type cpit = pit;
double usual = 0;
double unusual = 0;
++rit;
if (rit == pars_[pit].rows.end()) {
++pit;
- if (pit == paragraphs().size())
+ if (pit == par_type(paragraphs().size()))
--pit;
else
rit = pars_[pit].rows.begin();
bool LyXText::isLastRow(par_type pit, Row const & row) const
{
- return row.endpos() >= pars_[pit].size() && pit + 1 == paragraphs().size();
+ return row.endpos() >= pars_[pit].size()
+ && pit + 1 == par_type(paragraphs().size());
}
if (x < xo_)
xx = xo_ - x;
- else if (x > xo_ + width_)
+ else if (x > xo_ + int(width_))
xx = x - xo_ - width_;
if (y < yo_ - ascent())
if (pars_[pit].getDepth()) {
par_type tp = pit;
while (!layoutfont.resolved() &&
- tp != paragraphs().size() &&
+ tp != par_type(paragraphs().size()) &&
pars_[tp].getDepth()) {
tp = outerHook(tp, paragraphs());
- if (tp != paragraphs().size())
+ if (tp != par_type(paragraphs().size()))
layoutfont.realize(pars_[tp].layout()->font);
}
}