]> git.lyx.org Git - lyx.git/commitdiff
lowercase.diff
authorLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 29 Jun 2001 06:30:53 +0000 (06:30 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 29 Jun 2001 06:30:53 +0000 (06:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2155 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/Spacing.C
src/insets/ChangeLog
src/insets/insettext.C
src/insets/insettoc.C
src/insets/insettoc.h
src/insets/inseturl.C
src/insets/inseturl.h
src/lyxfunc.C
src/mathed/formulabase.C

index 0cb38a8c545ef2261ec9eaa44a2debd8379c5f68..2d115a0151c8c59c1220b9a51bc382f06385f574 100644 (file)
@@ -398,17 +398,16 @@ void BufferView::Pimpl::updateScrollbar()
        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);
 }
 
@@ -2599,7 +2598,7 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
                        cur_value = par->params().spacing().getValue();
                }
                
-               istringstream istr(argument.c_str());
+               istringstream istr(argument);
 
                string tmp;
                istr >> tmp;
index 103eb91fdcb0689cac04f3719037859f50b54a8f..61cf42bbcecc320dcab1feeaa958a914f2dfeaa0 100644 (file)
@@ -59,7 +59,7 @@ void Spacing::set(Spacing::Space sp, float val)
 void Spacing::set(Spacing::Space sp, string const & val)
 {
        float fval;
-       istringstream istr(val.c_str());
+       istringstream istr(val);
        istr >> fval;
        set(sp, fval);
 }
index 34fef6c4cacd3b7933cec68578b20335f4259b5c..406c3d18229dfb0b03d508df3c39579e0033eede 100644 (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>
 
        * Change a lot of method names to begin with a small char.
index 82f7eeba193a27f87e597fe5c0b3001cce5488e2..18b49617ed1e7e21ee52dbc88716519c6d1e80c3 100644 (file)
@@ -1056,7 +1056,7 @@ InsetText::localDispatch(BufferView * bv,
                        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;
index 0e9685fb5bb6f1583ed089c4e3baadd7853c06c9..48652ba3d5c5934fed86d1b762637fb3f5aca6f8 100644 (file)
@@ -24,7 +24,7 @@ string const InsetTOC::getScreenLabel() const
 }
 
 
-Inset::Code InsetTOC::LyxCode() const
+Inset::Code InsetTOC::lyxCode() const
 {
        string const cmdname(getCmdName());
        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);
 }
 
 
-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";
 
@@ -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")
                os << "<toc>";
index 4be7d1ade6ea5ae8185b670fa303ced830d12722..9be3b6bdd80fb7096b9e67fd5efdbd0752fd7714 100644 (file)
@@ -31,17 +31,17 @@ public:
        ///
        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;
 };
index cb3fe5f22ebf5cdd9bc918baab110a94920f801e..0f515834638e25aac6de72cea44629439809023e 100644 (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 );
 }
@@ -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
 {
        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())
                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()
           << " 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;
 }
index 5d3f07f5927389080d12b331db0c5a1927afb6be..a93367b5dc80d7e6d15132844fe4c1403e34ce67 100644 (file)
@@ -31,24 +31,24 @@ public:
                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;
 };
index f123166106065c16c8e0f58aa2e9d85565844b1b..311ad0edbd2278a85af0016f4e6d2aea4f30b22a 100644 (file)
@@ -656,7 +656,14 @@ string const LyXFunc::Dispatch(int ac,
                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())
@@ -1250,19 +1257,26 @@ string const LyXFunc::Dispatch(int ac,
 
        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);
 
@@ -1273,13 +1287,16 @@ string const LyXFunc::Dispatch(int ac,
 
        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);
index 08c49402b6af5c48ff3f0a2ab22019f4a45f4c7c..ae6c3f1c924b4989a8096033d444ee2c0c28563f 100644 (file)
@@ -549,8 +549,11 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
        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);
@@ -662,8 +665,9 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
                        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]);
@@ -684,8 +688,9 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
                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";