]> git.lyx.org Git - features.git/commitdiff
gcc 3.0 fixes
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 27 Jun 2001 15:33:55 +0000 (15:33 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 27 Jun 2001 15:33:55 +0000 (15:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2146 a592a061-630c-0410-9148-cb99ea01b6c8

17 files changed:
src/ChangeLog
src/LaTeXFeatures.C
src/insets/ChangeLog
src/insets/insetfloatlist.C
src/lyxtext.h
src/mathed/ChangeLog
src/mathed/array.C
src/mathed/math_bigopinset.C
src/mathed/math_fracinset.C
src/mathed/math_macrotemplate.C
src/mathed/math_matrixinset.C
src/mathed/math_matrixinset.h
src/mathed/math_root.C
src/mathed/math_scriptinset.C
src/mathed/math_sizeinset.C
src/paragraph_pimpl.C
src/text.C

index a1d1778f5aa6ae5492e102ebd534a328e00f6105..ce555ac05e5d754d3b8aab796453cb9ba7a15c31 100644 (file)
@@ -1,3 +1,7 @@
+2001-06-27  Lars Gullik Bjønnes  <larsbj@birdstep.com>
+
+       * LaTeXFeatures.C (getFloatDefinitions): std:: qualify ostream
+
 2001-06-27  Juergen Vigna  <jug@sad.it>
 
        * text.C (cursorLeftOneWord): changed to return the cursor and added
index 324ff4ccce875d65d600b38e36032fae8ea3b06d..b291666dc27b6ab45c6de470f0390e0678d2b0b6 100644 (file)
@@ -390,7 +390,7 @@ BufferParams const & LaTeXFeatures::bufferParams() const
 }
 
 
-void LaTeXFeatures::getFloatDefinitions(ostream & os) const
+void LaTeXFeatures::getFloatDefinitions(std::ostream & os) const
 {
        // Here we will output the code to create the needed float styles.
        // We will try to do this as minimal as possible.
index 595e40e97ac0dc6d6fa403bf75168ef054d914cf..89c71ae0038918d3183eb8b8cb39f685ac058b5d 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-27  Lars Gullik Bjønnes  <larsbj@birdstep.com>
+
+       * insetfloatlist.C (Write): std:: qualify ostream
+       (Latex): ditto
+
 2001-06-26  The LyX Project  <lyx@violet.home.sad.it>
 
        * figinset.C:
index 1fd96558ba142bd711133acc95547b34c34d43dd..56be31185c7283e73c7b5f20229ab6e570c08d16 100644 (file)
@@ -29,7 +29,7 @@ Inset::Code InsetFloatList::LyxCode() const
 }
 
 
-void InsetFloatList::Write(Buffer const *, ostream & os) const
+void InsetFloatList::Write(Buffer const *, std::ostream & os) const
 {
        os << "FloatList " << float_type << "\n";
 }
@@ -68,7 +68,7 @@ void InsetFloatList::Edit(BufferView *, int, int, unsigned int)
 }
 
 
-int InsetFloatList::Latex(Buffer const *, ostream & os, bool, bool) const
+int InsetFloatList::Latex(Buffer const *, std::ostream & os, bool, bool) const
 {
        FloatList::const_iterator cit = floatList[float_type];
 
index 5d55c9ddff2513d63566f69e0a94bf517cc9691e..5b91dd1389f7d031325247e53182ae2a863181ec 100644 (file)
@@ -354,6 +354,11 @@ public:
        /// Change the case of the word at cursor position.
        void changeCase(BufferView *, TextCase action);
        ///
+       void LyXText::changeRegionCase(BufferView * bview,
+                                      LyXCursor const & from,
+                                      LyXCursor const & to,
+                                      LyXText::TextCase action);
+       ///
        void transposeChars(BufferView const &);
        
        /** returns a printed row in a pixmap. The y value is needed to
index 5e5591bd9107bd51176f480aabf4bf60532e63eb..80b9490e868d4784cbac7e3dcd81d8a421ed5a64 100644 (file)
@@ -1,3 +1,29 @@
+2001-06-27  Lars Gullik Bjønnes  <larsbj@birdstep.com>
+
+       * math_sizeinset.C: include support/LOstream.h
+
+       * math_scriptinset.C (Metrics): std:: qualify max
+
+       * math_root.C (Metrics): std:: qualify max
+       (Write): std:: qualify ostream
+       (WriteNormal): ditto
+
+       * math_matrixinset.C (getLabelList): std:: qualify vector
+       include vector
+       (Metrics): std:: qualify max
+       (header_write): std:: qualify ostream
+       (footer_write): ditto
+
+       * math_macrotemplate.C (Write): std:: qualify ostream
+
+       * math_bigopinset.C (Metrics): std:: qualify max, and include
+       functional 
+
+       * math_matrixinset.h: include vector and std:: qualify it.
+
+       * array.C (GetInset): get a pointer to the first element of bf_
+       not an iterator.
+
 2001-06-25  The LyX Project  <Asger>
 
        * math_scriptinset.C: Fix for entering with cursor up/down.
index 4ceaa578b0dfb75d8e499e625d5261259ac2660d..3a8f83e9d551ab05ca5c32886113f422281a136a 100644 (file)
@@ -96,7 +96,7 @@ MathInset * MathArray::GetInset(int pos) const
        if (!isInset(pos))
                return 0;
        MathInset * p;
-       memcpy(&p, bf_.begin() + pos + 1, sizeof(p));
+       memcpy(&p, &bf_[0] + pos + 1, sizeof(p));
        return p;
 }
 
index 9758426b9428a97154356868e64dcbcd23df7b9d..094cdcb5e45b220ea90d7b7b69f747a147d24494 100644 (file)
@@ -1,5 +1,7 @@
 #include <config.h>
 
+#include <functional>
+
 #include "math_bigopinset.h"
 #include "LColor.h"
 #include "Painter.h"
@@ -73,10 +75,10 @@ void MathBigopInset::Metrics(MathStyles st)
        if (hasLimits()) {
                ascent_  = asc + xcell(0).height() + 2;
                descent_ = des + xcell(1).height() + 2;
-               width_   = max(width_, wid);
+               width_   = std::max(width_, wid);
        } else {
-               ascent_  = max(ascent_, asc);
-               descent_ = max(descent_, des);
+               ascent_  = std::max(ascent_, asc);
+               descent_ = std::max(descent_, des);
                width_  += wid;
        }
 
index 09429072fb4444984d1a7bc19081353ee57b3118..895772568512e455d445b2a235a44d2f4ba399fd 100644 (file)
@@ -4,6 +4,8 @@
 #pragma implementation
 #endif
 
+#include <functional>
+
 #include "math_fracinset.h"
 #include "LColor.h"
 #include "Painter.h"
@@ -30,7 +32,7 @@ void MathFracInset::Metrics(MathStyles st)
        xcell(0).Metrics(st);
        xcell(1).Metrics(st);
        size_    = st;
-       width_   = max(xcell(0).width(), xcell(1).width()) + 4; 
+       width_   = std::max(xcell(0).width(), xcell(1).width()) + 4; 
        ascent_  = xcell(0).height() + 4 + 5;
        descent_ = xcell(1).height() + 4 - 5; 
 }
index 24895f621155d0dfadd6db4caa548a833e51e997..89012bdad260c646260941b0d93a8132ed20ea2f 100644 (file)
@@ -25,18 +25,20 @@ MathMacroTemplate * MathMacroTemplate::Clone() const
        return new MathMacroTemplate(*this);
 }
 
+
 int MathMacroTemplate::numargs() const
 {
        return numargs_;
 }
 
+
 void MathMacroTemplate::numargs(int numargs)
 {
        numargs_ = numargs;
 }
 
 
-void MathMacroTemplate::Write(ostream & os, bool fragile) const
+void MathMacroTemplate::Write(std::ostream & os, bool fragile) const
 {
        os << "\n\\newcommand{\\" << name_ << "}";
 
@@ -66,4 +68,3 @@ void MathMacroTemplate::draw(Painter & pain, int x, int y)
        xcell(0).draw(pain, x + 2, y + 1);
        pain.rectangle(x, y - ascent(), width(), height(), LColor::blue);
 }
-
index 96a4c0db74aa544adfedd9bac80419ca9ad47325..4d9024ed7b46075e4ce8034c9d43b25f2cf24503 100644 (file)
@@ -4,6 +4,9 @@
 #pragma implementation
 #endif
 
+#include <vector>
+#include <functional>
+
 #include "math_matrixinset.h"
 #include "debug.h"
 #include "support/LOstream.h"
@@ -15,7 +18,7 @@ LyXFont WhichFont(short type, int size);
 
 namespace {
 
-string getAlign(short int type, int cols)
+string const getAlign(short int type, int cols)
 {
        string align;
        switch (type) {
@@ -41,11 +44,12 @@ string getAlign(short int type, int cols)
 }
 
 
-string star(bool n)
+string const star(bool n)
 {
        return n ? "" : "*";
 }
 
+
 int getCols(short int type)
 {
        int col;
@@ -99,7 +103,7 @@ void MathMatrixInset::Metrics(MathStyles st)
        if (numberedType()) {
                int l = 0;
                for (int row = 0; row < nrows(); ++row)
-                       l = max(l, mathed_string_width(LM_TC_TEXTRM, size(), nicelabel(row)));
+                       l = std::max(l, mathed_string_width(LM_TC_TEXTRM, size(), nicelabel(row)));
 
                if (l)
                        width_ += 30 + l;
@@ -187,7 +191,7 @@ bool MathMatrixInset::display() const
 }
 
 
-vector<string> const MathMatrixInset::getLabelList() const
+std::vector<string> const MathMatrixInset::getLabelList() const
 {
        std::vector<string> res;
        for (int row = 0; row < nrows(); ++row)
@@ -253,7 +257,7 @@ void MathMatrixInset::Validate1(LaTeXFeatures & features)
 */
 
 
-void MathMatrixInset::header_write(ostream & os) const
+void MathMatrixInset::header_write(std::ostream & os) const
 {
        bool n = numberedType();
 
@@ -285,7 +289,7 @@ void MathMatrixInset::header_write(ostream & os) const
 }
 
 
-void MathMatrixInset::footer_write(ostream & os) const
+void MathMatrixInset::footer_write(std::ostream & os) const
 {
        bool n = numberedType();
 
index 07856b18dbf1c05c586475d39420d52817bca716..d19fa76474e6c8f8be56affc0201f73fb61b9475 100644 (file)
@@ -2,6 +2,8 @@
 #ifndef MATH_MATRIXINSET_H
 #define MATH_MATRIXINSET_H
 
+#include <vector>
+
 #include "math_grid.h"
 
 #ifdef __GNUG__
@@ -47,7 +49,7 @@ public:
        ///
        bool ams() const;
        ///
-       vector<string> const getLabelList() const;
+       std::vector<string> const getLabelList() const;
        ///
        void Validate(LaTeXFeatures & features);
 
index 6777f16cb415817b14dae5ff6cf3b214f8526e7a..6dcfbc0e032ca581821f36a60a2e87e25392cdf5 100644 (file)
@@ -17,6 +17,8 @@
 #pragma implementation
 #endif
 
+#include <functional>
+
 #include "math_root.h"
 #include "support/LOstream.h"
 #include "Painter.h"
@@ -36,8 +38,8 @@ void MathRootInset::Metrics(MathStyles st)
 {
        MathInset::Metrics(st);
        size_    = st;
-       ascent_  = max(xcell(0).ascent()  + 5, xcell(1).ascent())  + 2;
-       descent_ = max(xcell(1).descent() + 5, xcell(0).descent()) + 2;
+       ascent_  = std::max(xcell(0).ascent()  + 5, xcell(1).ascent())  + 2;
+       descent_ = std::max(xcell(1).descent() + 5, xcell(0).descent()) + 2;
        width_   = xcell(0).width() + xcell(1).width() + 10;
 }
 
@@ -62,7 +64,7 @@ void MathRootInset::draw(Painter & pain, int x, int y)
 }
 
 
-void MathRootInset::Write(ostream & os, bool fragile) const
+void MathRootInset::Write(std::ostream & os, bool fragile) const
 {
        os << "\\sqrt[";
        cell(0).Write(os, fragile);  
@@ -72,7 +74,7 @@ void MathRootInset::Write(ostream & os, bool fragile) const
 }
 
 
-void MathRootInset::WriteNormal(ostream & os) const
+void MathRootInset::WriteNormal(std::ostream & os) const
 {
        os << "[root ";
        cell(1).WriteNormal(os);  
index 7be748d1e277cc6027291a4004348cb5587fe376..26d58f5f6dbe4755b4b34c1db5bbca0836bcb2f9 100644 (file)
@@ -4,6 +4,8 @@
 #pragma implementation
 #endif
 
+#include <functional>
+
 #include "math_scriptinset.h"
 #include "LColor.h"
 #include "Painter.h"
@@ -31,11 +33,11 @@ void MathScriptInset::Metrics(MathStyles st)
 {
        MathInset::Metrics(st);
        size_    = st;
-       width_   = max(xcell(0).width(), xcell(1).width()) + 2; 
+       width_   = std::max(xcell(0).width(), xcell(1).width()) + 2; 
        if (up())
-               ascent_  = max(ascent_, xcell(0).height() + 9);
+               ascent_  = std::max(ascent_, xcell(0).height() + 9);
        if (down())
-               descent_ = max(descent_, xcell(1).height());
+               descent_ = std::max(descent_, xcell(1).height());
 }
 
 
index 38f3a7ede4b6556de542bf633d69d7e40352ef5a..f46065ade0236be17690aa250762b799e84a18c3 100644 (file)
@@ -5,6 +5,7 @@
 #endif
 
 #include "math_sizeinset.h"
+#include "support/LOstream.h"
 
 
 MathSizeInset::MathSizeInset(MathStyles st)
@@ -13,6 +14,7 @@ MathSizeInset::MathSizeInset(MathStyles st)
        name_ = verbose();
 }
 
+
 char const * MathSizeInset::verbose() const
 {
        switch (style_) {
@@ -28,6 +30,7 @@ char const * MathSizeInset::verbose() const
        return "unknownstyle";
 }
 
+
 MathInset * MathSizeInset::Clone() const
 {
        return new MathSizeInset(*this);
index 2d9891074c1b89ee35da93dad55227aca6eb515a..2c941a762a29427b6767c54849187292b3fe8986 100644 (file)
@@ -127,7 +127,7 @@ void Paragraph::Pimpl::insertInset(Paragraph::size_type pos,
                                             search_inset, matchIT());
        if (it != owner_->insetlist.end() && (*it).pos == pos) {
                lyxerr << "ERROR (Paragraph::InsertInset): "
-                       "there is an inset in position: " << pos << endl;
+                       "there is an inset in position: " << pos << std::endl;
        } else {
                owner_->insetlist.insert(it, InsetTable(pos, inset));
        }
@@ -198,10 +198,10 @@ void Paragraph::Pimpl::erase(Paragraph::size_type pos)
 }
 
 
-void Paragraph::Pimpl::simpleTeXBlanks(ostream & os, TexRow & texrow,
-                                  Paragraph::size_type const i,
-                                  int & column, LyXFont const & font,
-                                  LyXLayout const & style)
+void Paragraph::Pimpl::simpleTeXBlanks(std::ostream & os, TexRow & texrow,
+                                      Paragraph::size_type const i,
+                                      int & column, LyXFont const & font,
+                                      LyXLayout const & style)
 {
        if (column > tex_code_break_column
            && i 
@@ -249,7 +249,8 @@ void Paragraph::Pimpl::simpleTeXBlanks(ostream & os, TexRow & texrow,
 
 void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
                                             BufferParams const & bparams,
-                                            ostream & os, TexRow & texrow,
+                                            std::ostream & os,
+                                            TexRow & texrow,
                                             bool moving_arg,
                                             LyXFont & font,
                                             LyXFont & running_font,
@@ -517,9 +518,9 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const * buf,
 
 Paragraph * Paragraph::Pimpl::TeXDeeper(Buffer const * buf,
                                        BufferParams const & bparams,
-                                       ostream & os, TexRow & texrow)
+                                       std::ostream & os, TexRow & texrow)
 {
-       lyxerr[Debug::LATEX] << "TeXDeeper...     " << this << endl;
+       lyxerr[Debug::LATEX] << "TeXDeeper...     " << this << std::endl;
        Paragraph * par = owner_;
 
        while (par && par->params().depth() == owner_->params().depth()) {
@@ -532,7 +533,7 @@ Paragraph * Paragraph::Pimpl::TeXDeeper(Buffer const * buf,
                                             os, texrow, false);
                }
        }
-       lyxerr[Debug::LATEX] << "TeXDeeper...done " << par << endl;
+       lyxerr[Debug::LATEX] << "TeXDeeper...done " << par << std::endl;
 
        return par;
 }
index 55c8669e27ade97a48b48a3068cdcaff7623ff6b..06d534a349fc6755416cedc01cba1d864a57007d 100644 (file)
@@ -2406,6 +2406,9 @@ void LyXText::changeCase(BufferView * bview, LyXText::TextCase action)
        setUndo(bview->buffer(), Undo::FINISH,
                from.par()->previous(), to.par()->next()); 
 
+#if 1
+       changeRegionCase(bview, to, from, action);
+#else
        while(from != to) {
                unsigned char c = from.par()->getChar(from.pos());
                if (!IsInsetChar(c) && !IsHfillChar(c)) {
@@ -2435,6 +2438,49 @@ void LyXText::changeCase(BufferView * bview, LyXText::TextCase action)
                refresh_row = from.row();
                status = LyXText::NEED_MORE_REFRESH;
        }
+#endif
+}
+
+
+void LyXText::changeRegionCase(BufferView * bview,
+                              LyXCursor const & from,
+                              LyXCursor const & to,
+                              LyXText::TextCase action)
+{
+       setUndo(bview->buffer(), Undo::FINISH,
+               from.par()->previous(), to.par()->next());
+
+       LyXCursor tmp(from);
+       
+       while(tmp != to) {
+               unsigned char c = tmp.par()->getChar(tmp.pos());
+               if (!IsInsetChar(c) && !IsHfillChar(c)) {
+                       switch (action) {
+                       case text_lowercase:
+                               c = tolower(c);
+                               break;
+                       case text_capitalization:
+                               c = toupper(c);
+                               action = text_lowercase;
+                               break;
+                       case text_uppercase:
+                               c = toupper(c);
+                               break;
+                       }
+               }
+               tmp.par()->setChar(tmp.pos(), c);
+               checkParagraph(bview, tmp.par(), tmp.pos());
+               tmp.pos(tmp.pos() + 1);
+               if (tmp.pos() >= tmp.par()->size()) {
+                       tmp.par(tmp.par()->next());
+                       tmp.pos(0);
+               }
+       }
+       if (to.row() != tmp.row()) {
+               refresh_y = tmp.y() - tmp.row()->baseline();
+               refresh_row = tmp.row();
+               status = LyXText::NEED_MORE_REFRESH;
+       }
 }