current_scrollbar_value = tmp_scrollbar_value;
long const height_diff = text_height - work_height;
-
+
if (height_diff <= 0) {
workarea_.setScrollbar(0, 1.0);
return;
}
-
workarea_.setScrollbarBounds(0, height_diff);
double const lineh = bv_->text->defaultHeight();
workarea_.setScrollbarIncrements(lineh);
- double const slider_size = 1.0 / double(height_diff) ;
+ double const slider_size = 1.0 / (double(height_diff) + work_height);
workarea_.setScrollbar(current_scrollbar_value, slider_size);
}
cur_value = par->params().spacing().getValue();
}
- istringstream istr(argument.c_str());
+ istringstream istr(argument);
string tmp;
istr >> tmp;
void Spacing::set(Spacing::Space sp, string const & val)
{
float fval;
- istringstream istr(val.c_str());
+ istringstream istr(val);
istr >> fval;
set(sp, fval);
}
+2001-06-29 John Levon <moz@compsoc.man.ac.uk>
+
+ * insettoc.h:
+ * insettoc.C:
+ * inseturl.h:
+ * inseturl.C: fix method names in these to begin
+ with small char too, so they inherit
+
2001-06-28 Lars Gullik Bjønnes <larsbj@birdstep.com>
* Change a lot of method names to begin with a small char.
cur_value = par->params().spacing().getValue();
}
- std::istringstream istr(arg.c_str());
+ std::istringstream istr(arg);
string tmp;
istr >> tmp;
Spacing::Space new_spacing = cur_spacing;
}
-Inset::Code InsetTOC::LyxCode() const
+Inset::Code InsetTOC::lyxCode() const
{
string const cmdname(getCmdName());
if (cmdname == "tableofcontents")
}
-void InsetTOC::Edit(BufferView * bv, int, int, unsigned int)
+void InsetTOC::edit(BufferView * bv, int, int, unsigned int)
{
bv->owner()->getDialogs()->showTOC(this);
}
-int InsetTOC::Ascii(Buffer const * buffer, std::ostream & os, int) const
+int InsetTOC::ascii(Buffer const * buffer, std::ostream & os, int) const
{
os << getScreenLabel() << "\n\n";
}
-int InsetTOC::Linuxdoc(Buffer const *, std::ostream & os) const
+int InsetTOC::linuxdoc(Buffer const *, std::ostream & os) const
{
if (getCmdName() == "tableofcontents")
os << "<toc>";
///
string const getScreenLabel() const;
///
- void Edit(BufferView * bv, int, int, unsigned int);
+ void edit(BufferView * bv, int, int, unsigned int);
///
- EDITABLE Editable() const { return IS_EDITABLE; }
+ EDITABLE editable() const { return IS_EDITABLE; }
///
bool display() const { return true; }
///
- Inset::Code LyxCode() const;
+ Inset::Code lyxCode() const;
///
- int Ascii(Buffer const *, std::ostream &, int linelen) const;
+ int ascii(Buffer const *, std::ostream &, int linelen) const;
///
- int Linuxdoc(Buffer const *, std::ostream &) const;
+ int linuxdoc(Buffer const *, std::ostream &) const;
///
int DocBook(Buffer const *, std::ostream &) const;
};
{}
-void InsetUrl::Edit(BufferView * bv, int, int, unsigned int)
+void InsetUrl::edit(BufferView * bv, int, int, unsigned int)
{
bv->owner()->getDialogs()->showUrl( this );
}
}
-int InsetUrl::Latex(Buffer const *, ostream & os,
+int InsetUrl::latex(Buffer const *, ostream & os,
bool fragile, bool /*free_spc*/) const
{
if (!getOptions().empty())
}
-int InsetUrl::Ascii(Buffer const *, ostream & os, int) const
+int InsetUrl::ascii(Buffer const *, ostream & os, int) const
{
if (getOptions().empty())
os << "[" << getContents() << "]";
}
-int InsetUrl::Linuxdoc(Buffer const *, ostream & os) const
+int InsetUrl::linuxdoc(Buffer const *, ostream & os) const
{
os << "<" << getCmdName()
<< " url=\"" << getContents() << "\""
}
-void InsetUrl::Validate(LaTeXFeatures & features) const
+void InsetUrl::validate(LaTeXFeatures & features) const
{
features.url = true;
}
return new InsetUrl(params());
}
///
- Inset::Code LyxCode() const { return Inset::URL_CODE; }
+ Inset::Code lyxCode() const { return Inset::URL_CODE; }
///
- void Validate(LaTeXFeatures &) const;
+ void validate(LaTeXFeatures &) const;
///
string const getScreenLabel() const;
///
- EDITABLE Editable() const { return IS_EDITABLE; }
+ EDITABLE editable() const { return IS_EDITABLE; }
///
- void Edit(BufferView *, int, int, unsigned int);
+ void edit(BufferView *, int, int, unsigned int);
///
bool display() const { return false; }
///
- int Latex(Buffer const *, std::ostream &,
+ int latex(Buffer const *, std::ostream &,
bool fragile, bool free_spc) const;
///
- int Ascii(Buffer const *, std::ostream &, int linelen) const;
+ int ascii(Buffer const *, std::ostream &, int linelen) const;
///
- int Linuxdoc(Buffer const *, std::ostream &) const;
+ int linuxdoc(Buffer const *, std::ostream &) const;
///
int DocBook(Buffer const *, std::ostream &) const;
};
if (!do_not_use_this_arg.empty())
argument = do_not_use_this_arg; // except here
}
-
+
+#ifdef NEW_DISPATCHER
+ // We try do call the most specific dispatcher first:
+ // 1. the lockinginset's dispatch
+ // 2. the bufferview's dispatch
+ // 3. the lyxview's dispatch
+#endif
+
selection_possible = false;
if (owner->view()->available())
case LFUN_GOTOFILEROW:
{
+#if 0
char file_name[100];
int row;
::sscanf(argument.c_str(), " %s %d", file_name, &row);
-
+#else
+ string file_name;
+ int row;
+ istringstream istr(argument);
+ istr >> filename >> row;
+#endif
// Must replace extension of the file to be .lyx and get full path
- string s = ChangeExtension(string(file_name), ".lyx");
+ string const s(ChangeExtension(file_name, ".lyx"));
// Either change buffer or load the file
- if (bufferlist.exists(s))
+ if (bufferlist.exists(s)) {
owner->view()->buffer(bufferlist.getBuffer(s));
- else
+ } else {
owner->view()->buffer(bufferlist.loadLyXFile(s));
-
+ }
+
// Set the cursor
owner->view()->setCursorFromRow(row);
case LFUN_GOTO_PARAGRAPH:
{
- istringstream istr(argument.c_str());
+ istringstream istr(argument);
int id;
istr >> id;
Paragraph * par = TEXT()->getParFromID(id);
- if (par == 0)
+ if (par == 0) {
+ lyxerr[Debug::INFO] << "No matching paragraph found! ["
+ << id << "]" << std::endl;
break;
+ }
// Set the cursor
TEXT()->setCursor(owner->view(), par, 0);
case LFUN_SETXY:
{
lyxerr << "LFUN_SETXY broken!\n";
- int x, y, x1, y1;
- istringstream is(arg.c_str());
+ int x;
+ int y;
+ int x1;
+ int y1;
+ istringstream is(arg);
is >> x >> y;
lyxerr << "LFUN_SETXY: x: " << x << " y: " << y << "\n";
par_->GetXY(x1, y1);
bv->lockedInsetStoreUndo(Undo::INSERT);
int m = 1;
int n = 1;
- string v_align, h_align;
- istringstream is(arg.c_str());
+ string v_align;
+ string h_align;
+ istringstream is(arg);
is >> m >> n >> v_align >> h_align;
MathArrayInset * p = new MathArrayInset(m, n);
p->valign(v_align[0]);
if (arg.empty())
break;
- istringstream is(arg.c_str());
- string lt, rt;
+ istringstream is(arg);
+ string lt;
+ string rt;
is >> lt >> rt;
lyxerr << "formulabase::LFUN_MATH_DELIM, lt: '" << lt << "'\n";
lyxerr << "formulabase::LFUN_MATH_DELIM, rt: '" << rt << "'\n";