A few tweaks needed by cxx

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1020 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2000-09-15 10:24:15 +00:00
parent 45a03f4f67
commit 160dc67127
11 changed files with 44 additions and 13 deletions

View File

@ -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

View 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

View File

@ -14,6 +14,8 @@
#ifdef HAVE_SSTREAM
#include <sstream>
using std::istringstream;
using std::ostringstream;
#else
#include "support/sstream.h"
#endif

View 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())

View 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]);
}

View 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;

View 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);

View 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"

View 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;

View 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);
}

View 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;