lowercase.diff

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2155 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2001-06-29 06:30:53 +00:00
parent d3f456cf28
commit 94c15c0ed7
10 changed files with 70 additions and 41 deletions

View File

@ -398,17 +398,16 @@ void BufferView::Pimpl::updateScrollbar()
current_scrollbar_value = tmp_scrollbar_value; current_scrollbar_value = tmp_scrollbar_value;
long const height_diff = text_height - work_height; long const height_diff = text_height - work_height;
if (height_diff <= 0) { if (height_diff <= 0) {
workarea_.setScrollbar(0, 1.0); workarea_.setScrollbar(0, 1.0);
return; return;
} }
workarea_.setScrollbarBounds(0, height_diff); workarea_.setScrollbarBounds(0, height_diff);
double const lineh = bv_->text->defaultHeight(); double const lineh = bv_->text->defaultHeight();
workarea_.setScrollbarIncrements(lineh); 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); workarea_.setScrollbar(current_scrollbar_value, slider_size);
} }
@ -2599,7 +2598,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
cur_value = par->params().spacing().getValue(); cur_value = par->params().spacing().getValue();
} }
istringstream istr(argument.c_str()); istringstream istr(argument);
string tmp; string tmp;
istr >> tmp; istr >> tmp;

View File

@ -59,7 +59,7 @@ void Spacing::set(Spacing::Space sp, float val)
void Spacing::set(Spacing::Space sp, string const & val) void Spacing::set(Spacing::Space sp, string const & val)
{ {
float fval; float fval;
istringstream istr(val.c_str()); istringstream istr(val);
istr >> fval; istr >> fval;
set(sp, fval); set(sp, fval);
} }

View File

@ -1,3 +1,11 @@
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> 2001-06-28 Lars Gullik Bjønnes <larsbj@birdstep.com>
* Change a lot of method names to begin with a small char. * Change a lot of method names to begin with a small char.

View File

@ -1056,7 +1056,7 @@ InsetText::localDispatch(BufferView * bv,
cur_value = par->params().spacing().getValue(); cur_value = par->params().spacing().getValue();
} }
std::istringstream istr(arg.c_str()); std::istringstream istr(arg);
string tmp; string tmp;
istr >> tmp; istr >> tmp;
Spacing::Space new_spacing = cur_spacing; Spacing::Space new_spacing = cur_spacing;

View File

@ -24,7 +24,7 @@ string const InsetTOC::getScreenLabel() const
} }
Inset::Code InsetTOC::LyxCode() const Inset::Code InsetTOC::lyxCode() const
{ {
string const cmdname(getCmdName()); string const cmdname(getCmdName());
if (cmdname == "tableofcontents") if (cmdname == "tableofcontents")
@ -33,13 +33,13 @@ Inset::Code InsetTOC::LyxCode() const
} }
void InsetTOC::Edit(BufferView * bv, int, int, unsigned int) void InsetTOC::edit(BufferView * bv, int, int, unsigned int)
{ {
bv->owner()->getDialogs()->showTOC(this); 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"; os << getScreenLabel() << "\n\n";
@ -63,7 +63,7 @@ int InsetTOC::Ascii(Buffer const * buffer, std::ostream & os, int) const
} }
int InsetTOC::Linuxdoc(Buffer const *, std::ostream & os) const int InsetTOC::linuxdoc(Buffer const *, std::ostream & os) const
{ {
if (getCmdName() == "tableofcontents") if (getCmdName() == "tableofcontents")
os << "<toc>"; os << "<toc>";

View File

@ -31,17 +31,17 @@ public:
/// ///
string const getScreenLabel() const; 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; } 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; int DocBook(Buffer const *, std::ostream &) const;
}; };

View File

@ -20,7 +20,7 @@ InsetUrl::InsetUrl(InsetCommandParams const & p)
{} {}
void InsetUrl::Edit(BufferView * bv, int, int, unsigned int) void InsetUrl::edit(BufferView * bv, int, int, unsigned int)
{ {
bv->owner()->getDialogs()->showUrl( this ); bv->owner()->getDialogs()->showUrl( this );
} }
@ -43,7 +43,7 @@ string const InsetUrl::getScreenLabel() const
} }
int InsetUrl::Latex(Buffer const *, ostream & os, int InsetUrl::latex(Buffer const *, ostream & os,
bool fragile, bool /*free_spc*/) const bool fragile, bool /*free_spc*/) const
{ {
if (!getOptions().empty()) if (!getOptions().empty())
@ -55,7 +55,7 @@ int InsetUrl::Latex(Buffer const *, ostream & os,
} }
int InsetUrl::Ascii(Buffer const *, ostream & os, int) const int InsetUrl::ascii(Buffer const *, ostream & os, int) const
{ {
if (getOptions().empty()) if (getOptions().empty())
os << "[" << getContents() << "]"; os << "[" << getContents() << "]";
@ -65,7 +65,7 @@ int InsetUrl::Ascii(Buffer const *, ostream & os, int) const
} }
int InsetUrl::Linuxdoc(Buffer const *, ostream & os) const int InsetUrl::linuxdoc(Buffer const *, ostream & os) const
{ {
os << "<" << getCmdName() os << "<" << getCmdName()
<< " url=\"" << getContents() << "\"" << " url=\"" << getContents() << "\""
@ -83,7 +83,7 @@ int InsetUrl::DocBook(Buffer const *, ostream & os) const
} }
void InsetUrl::Validate(LaTeXFeatures & features) const void InsetUrl::validate(LaTeXFeatures & features) const
{ {
features.url = true; features.url = true;
} }

View File

@ -31,24 +31,24 @@ public:
return new InsetUrl(params()); 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; 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; } bool display() const { return false; }
/// ///
int Latex(Buffer const *, std::ostream &, int latex(Buffer const *, std::ostream &,
bool fragile, bool free_spc) const; 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; int DocBook(Buffer const *, std::ostream &) const;
}; };

View File

@ -656,7 +656,14 @@ string const LyXFunc::Dispatch(int ac,
if (!do_not_use_this_arg.empty()) if (!do_not_use_this_arg.empty())
argument = do_not_use_this_arg; // except here 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; selection_possible = false;
if (owner->view()->available()) if (owner->view()->available())
@ -1250,19 +1257,26 @@ string const LyXFunc::Dispatch(int ac,
case LFUN_GOTOFILEROW: case LFUN_GOTOFILEROW:
{ {
#if 0
char file_name[100]; char file_name[100];
int row; int row;
::sscanf(argument.c_str(), " %s %d", file_name, &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 // 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 // Either change buffer or load the file
if (bufferlist.exists(s)) if (bufferlist.exists(s)) {
owner->view()->buffer(bufferlist.getBuffer(s)); owner->view()->buffer(bufferlist.getBuffer(s));
else } else {
owner->view()->buffer(bufferlist.loadLyXFile(s)); owner->view()->buffer(bufferlist.loadLyXFile(s));
}
// Set the cursor // Set the cursor
owner->view()->setCursorFromRow(row); owner->view()->setCursorFromRow(row);
@ -1273,13 +1287,16 @@ string const LyXFunc::Dispatch(int ac,
case LFUN_GOTO_PARAGRAPH: case LFUN_GOTO_PARAGRAPH:
{ {
istringstream istr(argument.c_str()); istringstream istr(argument);
int id; int id;
istr >> id; istr >> id;
Paragraph * par = TEXT()->getParFromID(id); Paragraph * par = TEXT()->getParFromID(id);
if (par == 0) if (par == 0) {
lyxerr[Debug::INFO] << "No matching paragraph found! ["
<< id << "]" << std::endl;
break; break;
}
// Set the cursor // Set the cursor
TEXT()->setCursor(owner->view(), par, 0); TEXT()->setCursor(owner->view(), par, 0);

View File

@ -549,8 +549,11 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
case LFUN_SETXY: case LFUN_SETXY:
{ {
lyxerr << "LFUN_SETXY broken!\n"; lyxerr << "LFUN_SETXY broken!\n";
int x, y, x1, y1; int x;
istringstream is(arg.c_str()); int y;
int x1;
int y1;
istringstream is(arg);
is >> x >> y; is >> x >> y;
lyxerr << "LFUN_SETXY: x: " << x << " y: " << y << "\n"; lyxerr << "LFUN_SETXY: x: " << x << " y: " << y << "\n";
par_->GetXY(x1, y1); par_->GetXY(x1, y1);
@ -662,8 +665,9 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
bv->lockedInsetStoreUndo(Undo::INSERT); bv->lockedInsetStoreUndo(Undo::INSERT);
int m = 1; int m = 1;
int n = 1; int n = 1;
string v_align, h_align; string v_align;
istringstream is(arg.c_str()); string h_align;
istringstream is(arg);
is >> m >> n >> v_align >> h_align; is >> m >> n >> v_align >> h_align;
MathArrayInset * p = new MathArrayInset(m, n); MathArrayInset * p = new MathArrayInset(m, n);
p->valign(v_align[0]); p->valign(v_align[0]);
@ -684,8 +688,9 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
if (arg.empty()) if (arg.empty())
break; break;
istringstream is(arg.c_str()); istringstream is(arg);
string lt, rt; string lt;
string rt;
is >> lt >> rt; is >> lt >> rt;
lyxerr << "formulabase::LFUN_MATH_DELIM, lt: '" << lt << "'\n"; lyxerr << "formulabase::LFUN_MATH_DELIM, lt: '" << lt << "'\n";
lyxerr << "formulabase::LFUN_MATH_DELIM, rt: '" << rt << "'\n"; lyxerr << "formulabase::LFUN_MATH_DELIM, rt: '" << rt << "'\n";