]> git.lyx.org Git - features.git/commitdiff
A few tweaks needed by cxx
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 15 Sep 2000 10:24:15 +0000 (10:24 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 15 Sep 2000 10:24:15 +0000 (10:24 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1020 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
po/POTFILES.in
src/Lsstream.h
src/LyXView.C
src/buffer.C
src/frontends/kde/FormCitation.h
src/frontends/kde/FormToc.h
src/frontends/kde/GUIRunTime.C
src/mathed/math_defs.h
src/mathed/math_inset.C
src/support/copy.C

index e9be3ff21493d2e09eec94cee6037bb9fb285340..bb0ffe22ccb2c5abaab8bf098811ff0d866e13be 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2000-09-15  Angus Leeming  <a.leeming@ic.ac.uk>
+
+       * src/frontends/kde/FormCitation.h: added some using directives.
+
+       * src/frontends/kde/FormToc.h: corrected definition of doTree.
+
+       * src/frontends/kde/GUIRunTime.C (initApplication): use lyxerr not
+       cerr. 
+
+       * src/mathed/math_defs.h: redefine SetAlign to use string rather
+       than char *.
+       
+2000-09-15  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * src/buffer.C (pop_tag): revert for the second time a change by
+       Lars, who seems to really hate having non-local loop variables :)
+
+       * src/Lsstream.h: add "using" statements.
+
+       * src/support/copy.C (copy): add a bunch of std:: qualifiers
+       * src/buffer.C (writeFile): ditto
+
 2000-09-14  Lars Gullik Bjønnes  <larsbj@lyx.org>
 
        * src/buffer.C (writeFile): try to fix the locale modified format
index 70efb80a26b9d5b8cfd57f7e54f15ac9d1215a54..a70f1b39b2df2e1025e53d75b8a5cfecd45a685d 100644 (file)
@@ -119,6 +119,7 @@ src/mathed/formulamacro.C
 src/mathed/math_forms.C
 src/mathed/math_panel.C
 src/MenuBackend.C
+src/menus.C
 src/minibuffer.C
 src/PaperLayout.C
 src/paragraph.C
index 8d171d215642096862f95447ed432b0e03c9c21a..89676b8a4ed6f446dc8287928333efe24d28790a 100644 (file)
@@ -14,6 +14,8 @@
 
 #ifdef HAVE_SSTREAM
 #include <sstream>
+using std::istringstream;
+using std::ostringstream;
 #else
 #include "support/sstream.h"
 #endif
index 5f0deb8c66cf1ece1d9af17e0d4fb6260c83da40..4fc8f999b5c286424f389c29c078e101a7dcff82 100644 (file)
@@ -453,7 +453,7 @@ void LyXView::updateWindowTitle()
        if (view()->available()) {
                string cur_title = buffer()->fileName();
                if (!cur_title.empty()){
-                       title += ": " + OnlyFilename(cur_title);
+                       title += ": " + MakeDisplayPath(cur_title);
                        if (!buffer()->isLyxClean())
                                title += _(" (Changed)");
                        if (buffer()->isReadonly())
index a363f8e4ce483b1dbcfdaaeca9335ddac35984e9..143aab75dc0a85d7991be923a7e041a8f0101631 100644 (file)
@@ -1268,7 +1268,7 @@ bool Buffer::writeFile(string const & fname, bool flag) const
 
 #ifdef HAVE_LOCALE
        // Use the standard "C" locale for file output.
-       ofs.imbue(locale::classic());
+       ofs.imbue(std::locale::classic());
 #endif
 
        // The top of the file should not be written by params.
@@ -2662,16 +2662,22 @@ void Buffer::push_tag(ostream & os, string const & tag,
 void Buffer::pop_tag(ostream & os, string const & tag,
                      int & pos, char stack[5][3])
 {
+#ifdef WITH_WARNINGS
 #warning Use a real stack! (Lgb)
+#endif
+       // Please, Lars, do not remove the global variable. I already
+       // had to reintroduce it twice! (JMarc) 
+       int j;
+       
         // pop all tags till specified one
-        for (int j = pos; (j >= 0) && (strcmp(stack[j], tag.c_str())); --j)
+        for (j = pos; (j >= 0) && (strcmp(stack[j], tag.c_str())); --j)
                 os << "</" << stack[j] << ">";
 
         // closes the tag
         os << "</" << tag << ">";
-
+       
         // push all tags, but the specified one
-        for (int j = j + 1; j <= pos; ++j) {
+        for (j = j + 1; j <= pos; ++j) {
                 os << "<" << stack[j] << ">";
                 strcpy(stack[j-1], stack[j]);
         }
index 29417f026e9719fba5fc59d356a893b781c610bd..aedf93d1048344ae343df04f67e651a87fe7f71d 100644 (file)
@@ -102,7 +102,7 @@ private:
        Connection ih_;
 
        /// available citation keys
-       std::vector<pair<string, string> > keys;
+       std::vector<std::pair<string, string> > keys;
        /// chosen citation keys
        std::vector<string> chosenkeys;
  
index 15cd6984c4a2359fade40f435b898226908867ae..cdf878bbd8a5d7fea6360dc54d19508c54cfef03 100644 (file)
@@ -55,7 +55,7 @@ private:
        void showTOC(InsetCommand * const);
         
        /// hierarchical tree
-       int FormToc::doTree(vector < Buffer::TocItem>::const_iterator & , int, int, int);
+       int doTree(vector < Buffer::TocItem>::const_iterator & , int, int, int);
        /// update the Toc
        void updateToc(void);
 
index cc7c335c5df5f27597f9cd6918a56601c64a9bbe..15cc4f1ce8cb08f2d6355e9dd9b8f1e3795b435f 100644 (file)
@@ -54,7 +54,7 @@ int GUIRunTime::initApplication(int argc, char * argv[])
        // }
        int xforms_lib_version = fl_library_version(0, 0);
        if (xforms_include_version != xforms_lib_version) {
-               cerr << "You are either running LyX with wrong "
+               lyxerr << "You are either running LyX with wrong "
                        "version of a dynamic XForms library\n"
                        "or you have build LyX with conflicting header "
                        "and library (different\n"
index 99dbf57038cac4f2817ca5a93274669cadafb78b..8ade1d3a5aeb36dd3f33073e6def38434f4980e1 100644 (file)
@@ -490,7 +490,7 @@ class MathMatrixInset: public MathParInset {
     ///
     void SetData(LyxArrayBase *);
     ///
-    void SetAlign(char, char const *);
+    void SetAlign(char, string const &);
     ///
     char * GetAlign(char * vv) {
        *vv = v_align;
index dfcce43cd83360797b01f5bc4644c91eb1454747..4b5660f3f0452ddb9b78816e34215c347bc1cfd7 100644 (file)
@@ -373,10 +373,10 @@ MathedInset * MathMatrixInset::Clone()
 }
 
 
-void MathMatrixInset::SetAlign(char vv, char const * hh)
+void MathMatrixInset::SetAlign(char vv, string const & hh)
 {
    v_align = vv;
-   strncpy(h_align, hh, nc);
+   strncpy(h_align, hh.c_str(), nc);
 }
 
 
index 29eb28394bc3c7030852e57a3ddfad82cfcdc9dc..7324d445681efc00ab011cf22b5a32e9714fb75f 100644 (file)
@@ -16,9 +16,9 @@ bool lyx::copy(string const & from, string const & to)
        return Systemcalls().startscript(Systemcalls::System,
                                         command) == 0;
 #else
-       ifstream ifs(from.c_str());
+       std::ifstream ifs(from.c_str());
        if (!ifs) return false;
-       ofstream ofs(to.c_str(), ios::out|ios::trunc);
+       std::ofstream ofs(to.c_str(), std::ios::out|std::ios::trunc);
        if (!ofs) return false;
        ofs << ifs.rdbuf();
        if (ofs.good()) return true;