mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-24 18:43:37 +00:00
fix parse error in FormPreferences, make LyX be able to compile with gcc 2.97, use mktemp if mkstemp is not available
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1218 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8548953e99
commit
676e29b916
6
ANNOUNCE
6
ANNOUNCE
@ -1,4 +1,4 @@
|
||||
Public release of LyX version 1.1.5cvs
|
||||
Public release of LyX version 1.1.6pre
|
||||
===================================
|
||||
|
||||
What is LyX?
|
||||
@ -67,8 +67,8 @@ with mirrors at
|
||||
|
||||
The source code package is available at:
|
||||
|
||||
ftp://ftp.lyx.org/pub/lyx/stable/lyx-1.1.5.tar.gz
|
||||
ftp://ftp.devel.lyx.org/pub/lyx/lyx-1.1.5.tar.gz
|
||||
ftp://ftp.lyx.org/pub/lyx/stable/lyx-1.1.6.tar.gz
|
||||
ftp://ftp.devel.lyx.org/pub/lyx/lyx-1.1.6.tar.gz
|
||||
|
||||
and at the mirrors listed above.
|
||||
|
||||
|
35
ChangeLog
35
ChangeLog
@ -1,3 +1,38 @@
|
||||
2000-11-15 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* src/support/lyxfunctional.h: make back_insert_fun_iterator(s)
|
||||
match the requirements from the standard better. This is required
|
||||
to work with gnu libstdc++-v3
|
||||
|
||||
* src/frontends/xforms/FormPreferences.C: add explict pair
|
||||
arguments to browse calls. include support/lyxmanip.h remvoe
|
||||
extern fmt. whitespace changes. reorder variables in
|
||||
FormPreferences.h, to match initalizaton order.
|
||||
|
||||
* several files: constify more local variables.
|
||||
|
||||
* src/buffer.C: remove some commented functions.
|
||||
|
||||
* src/DepTable.C (remove_files_with_extension): temporary
|
||||
work around for gcc 2.97
|
||||
* src/filedlg.C (find): ditto
|
||||
* src/Variables.C (set): ditto
|
||||
* src/LyXAction.C (searchActionArg): ditto
|
||||
(retrieveActionArg): ditto
|
||||
|
||||
* configure.in: check for mktemp too
|
||||
|
||||
* UPGRADING: prepare for 1.1.6
|
||||
|
||||
* Makefile.am (lgbtags): add backup tags for when etags are
|
||||
different than usual.
|
||||
|
||||
* ANNOUNCE: prepare for 1.1.6
|
||||
|
||||
* src/support/tempname.C (make_tempfile): new function, wrapper
|
||||
around mkstemp and mktemp. Only mkstemp has been tested.
|
||||
(tempName): call it.
|
||||
|
||||
2000-11-14 Rob Lahaye <lahaye@postech.edu>
|
||||
|
||||
* default.ui: capitalized some menu items to improve shortcuts.
|
||||
|
@ -54,3 +54,6 @@ sourcedoc:
|
||||
mkdir sourcedoc
|
||||
cd sourcedoc ; \
|
||||
doc++ -p `find ../$(top_srcdir)/src -name \*.h`
|
||||
|
||||
lgbtags:
|
||||
etags --totals=yes --recurse=yes -o TAGS $(top_srcdir)/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
How do I upgrade my existing LyX system to version 1.1.5?
|
||||
How do I upgrade my existing LyX system to version 1.1.6?
|
||||
---------------------------------------------------------
|
||||
|
||||
If you upgrade from version 0.12.0 or 1.0.x, you shouldn't have
|
||||
@ -14,9 +14,9 @@ Document transfer
|
||||
-----------------
|
||||
|
||||
In general, you don't need to convert any documents saved with LyX
|
||||
v0.10, v0.12.0 or v1.0.x to use them with LyX v1.1.5.
|
||||
v0.10, v0.12.0 or v1.0.x to use them with LyX v1.1.6.
|
||||
|
||||
LyX v1.1.5 can read all documents saved with lyx-0.12.0 and later correctly.
|
||||
LyX v1.1.6 can read all documents saved with lyx-0.12.0 and later correctly.
|
||||
Documents saved with lyx-0.10.x are read correctly up to the old math
|
||||
mode, which is not supported anymore. If you have documents with such
|
||||
math formulas, you convert it using the program COLD, written by Preben
|
||||
@ -27,5 +27,5 @@ Rhandol. COLD can be found at:
|
||||
|
||||
or at one of LyX archive mirror sites listed in README.
|
||||
|
||||
Documents saved with LyX version 1.1.5 can be read correctly by
|
||||
Documents saved with LyX version 1.1.6 can be read correctly by
|
||||
LyX v0.12.0 and v1.0.x, except for new and a couple of changed features.
|
||||
|
@ -253,7 +253,7 @@ if test "x$lyx_broken_headers" = "xyes"; then
|
||||
[Define on SunOS 4 and SCO, were some functions are missing from the headers])
|
||||
fi
|
||||
AC_CHECK_FUNCS(memmove memset strchr putenv setenv mkfifo snprintf vsnprintf)
|
||||
AC_CHECK_FUNCS(mkstemp)
|
||||
AC_CHECK_FUNCS(mkstemp mktemp)
|
||||
|
||||
dnl Until this is fixed in autoconf we provide our own version
|
||||
LYX_FUNC_SELECT_ARGTYPES
|
||||
|
@ -113,7 +113,8 @@ bool DepTable::exist(string const & fil) const
|
||||
void DepTable::remove_files_with_extension(string const & suf)
|
||||
{
|
||||
DepList tmp;
|
||||
for (DepList::const_iterator cit = deplist.begin();
|
||||
// we want const_iterator (Lgb)
|
||||
for (DepList::iterator cit = deplist.begin();
|
||||
cit != deplist.end(); ++cit) {
|
||||
if (!suffixIs((*cit).first, suf))
|
||||
tmp[(*cit).first] = (*cit).second;
|
||||
|
@ -453,7 +453,8 @@ LyXAction::LyXAction()
|
||||
// if it doesn't exist.
|
||||
int LyXAction::searchActionArg(kb_action action, string const & arg) const
|
||||
{
|
||||
arg_map::const_iterator pit = lyx_arg_map.find(action);
|
||||
// we really want to use const_iterator (Lgb)
|
||||
arg_map::iterator pit = lyx_arg_map.find(action);
|
||||
|
||||
if (pit == lyx_arg_map.end()) {
|
||||
// the action does not have any pseudoactions
|
||||
@ -463,7 +464,8 @@ int LyXAction::searchActionArg(kb_action action, string const & arg) const
|
||||
return LFUN_UNKNOWN_ACTION;
|
||||
}
|
||||
|
||||
arg_item::const_iterator aci = (*pit).second.find(arg);
|
||||
// we really want to use const_iterator (Lgb)
|
||||
arg_item::iterator aci = (*pit).second.find(arg);
|
||||
|
||||
if (aci == (*pit).second.end()) {
|
||||
// the action does not have any pseudoactions with this arg
|
||||
@ -519,7 +521,8 @@ kb_action LyXAction::retrieveActionArg(int pseudo, string & arg) const
|
||||
{
|
||||
arg.erase(); // clear it to be sure.
|
||||
|
||||
pseudo_map::const_iterator pit = lyx_pseudo_map.find(pseudo);
|
||||
// we really want to use const_iterator (Lgb)
|
||||
pseudo_map::iterator pit = lyx_pseudo_map.find(pseudo);
|
||||
|
||||
if (pit != lyx_pseudo_map.end()) {
|
||||
lyxerr[Debug::ACTION] << "Found the pseudoaction: ["
|
||||
|
@ -20,7 +20,8 @@
|
||||
|
||||
void Variables::set(string const & var, string const & val)
|
||||
{
|
||||
Vars::const_iterator cit = vars_.find(var);
|
||||
// We want to use const_iterator (Lgb)
|
||||
Vars::iterator cit = vars_.find(var);
|
||||
if (cit != vars_.end())
|
||||
vars_.erase(var);
|
||||
vars_[var] = val;;
|
||||
|
221
src/buffer.C
221
src/buffer.C
@ -1265,225 +1265,6 @@ bool Buffer::writeFile(string const & fname, bool flag) const
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
void Buffer::writeFileAscii(string const & fname, int linelen)
|
||||
{
|
||||
Inset * inset;
|
||||
char c;
|
||||
char footnoteflag = 0;
|
||||
char depth = 0;
|
||||
string tmp;
|
||||
LyXParagraph::size_type i;
|
||||
int j;
|
||||
int ltype = 0;
|
||||
int ltype_depth = 0;
|
||||
int actcell = 0;
|
||||
int actpos = 0;
|
||||
int currlinelen = 0;
|
||||
int fpos = 0;
|
||||
bool ref_printed = false;
|
||||
|
||||
ofstream ofs(fname.c_str());
|
||||
if (!ofs) {
|
||||
WriteFSAlert(_("Error: Cannot write file:"), fname);
|
||||
return;
|
||||
}
|
||||
|
||||
string const fname1 = lyx::tempName(); //TmpFileName();
|
||||
LyXParagraph * par = paragraph;
|
||||
while (par) {
|
||||
int noparbreak = 0;
|
||||
int islatex = 0;
|
||||
if (
|
||||
#ifndef NEW_INSETS
|
||||
par->footnoteflag != LyXParagraph::NO_FOOTNOTE ||
|
||||
#endif
|
||||
!par->previous
|
||||
#ifndef NEW_INSETS
|
||||
|| par->previous->footnoteflag == LyXParagraph::NO_FOOTNOTE
|
||||
#endif
|
||||
){
|
||||
|
||||
#ifndef NEW_INSETS
|
||||
/* begins a footnote environment ? */
|
||||
if (footnoteflag != par->footnoteflag) {
|
||||
footnoteflag = par->footnoteflag;
|
||||
if (footnoteflag) {
|
||||
j = strlen(string_footnotekinds[par->footnotekind])+4;
|
||||
if (currlinelen + j > linelen)
|
||||
ofs << "\n";
|
||||
ofs << "(["
|
||||
<< string_footnotekinds[par->footnotekind] << "] ";
|
||||
currlinelen += j;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* begins or ends a deeper area ?*/
|
||||
if (depth != par->depth) {
|
||||
if (par->depth > depth) {
|
||||
while (par->depth > depth) {
|
||||
++depth;
|
||||
}
|
||||
}
|
||||
else {
|
||||
while (par->depth < depth) {
|
||||
--depth;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* First write the layout */
|
||||
tmp = textclasslist.NameOfLayout(params.textclass, par->layout);
|
||||
if (tmp == "Itemize") {
|
||||
ltype = 1;
|
||||
ltype_depth = depth+1;
|
||||
} else if (tmp == "Enumerate") {
|
||||
ltype = 2;
|
||||
ltype_depth = depth+1;
|
||||
} else if (contains(tmp, "ection")) {
|
||||
ltype = 3;
|
||||
ltype_depth = depth+1;
|
||||
} else if (contains(tmp, "aragraph")) {
|
||||
ltype = 4;
|
||||
ltype_depth = depth+1;
|
||||
} else if (tmp == "Description") {
|
||||
ltype = 5;
|
||||
ltype_depth = depth+1;
|
||||
} else if (tmp == "Abstract") {
|
||||
ltype = 6;
|
||||
ltype_depth = 0;
|
||||
} else if (tmp == "Bibliography") {
|
||||
ltype = 7;
|
||||
ltype_depth = 0;
|
||||
} else {
|
||||
ltype = 0;
|
||||
ltype_depth = 0;
|
||||
}
|
||||
|
||||
/* maybe some vertical spaces */
|
||||
|
||||
/* the labelwidthstring used in lists */
|
||||
|
||||
/* some lines? */
|
||||
|
||||
/* some pagebreaks? */
|
||||
|
||||
/* noindent ? */
|
||||
|
||||
/* what about the alignment */
|
||||
} else {
|
||||
#ifndef NEW_INSETS
|
||||
/* dummy layout, that means a footnote ended */
|
||||
footnoteflag = LyXParagraph::NO_FOOTNOTE;
|
||||
ofs << ") ";
|
||||
noparbreak = 1;
|
||||
#else
|
||||
lyxerr << "Should this ever happen?" << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
LyXFont font1 =
|
||||
LyXFont(LyXFont::ALL_INHERIT, params.language);
|
||||
actcell = 0;
|
||||
for (i = 0, actpos = 1; i < par->size(); ++i, ++actpos) {
|
||||
if (!i && !footnoteflag && !noparbreak){
|
||||
ofs << "\n\n";
|
||||
for (j = 0; j < depth; ++j)
|
||||
ofs << " ";
|
||||
currlinelen = depth * 2;
|
||||
switch (ltype) {
|
||||
case 0: /* Standard */
|
||||
case 4: /* (Sub)Paragraph */
|
||||
case 5: /* Description */
|
||||
break;
|
||||
case 6: /* Abstract */
|
||||
ofs << "Abstract\n\n";
|
||||
break;
|
||||
case 7: /* Bibliography */
|
||||
if (!ref_printed) {
|
||||
ofs << "References\n\n";
|
||||
ref_printed = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ofs << par->labelstring << " ";
|
||||
break;
|
||||
}
|
||||
if (ltype_depth > depth) {
|
||||
for (j = ltype_depth - 1; j > depth; --j)
|
||||
ofs << " ";
|
||||
currlinelen += (ltype_depth-depth)*2;
|
||||
}
|
||||
}
|
||||
LyXFont font2 = par->GetFontSettings(params, i);
|
||||
if (font1.latex() != font2.latex()) {
|
||||
if (font2.latex() == LyXFont::OFF)
|
||||
islatex = 0;
|
||||
else
|
||||
islatex = 1;
|
||||
} else {
|
||||
islatex = 0;
|
||||
}
|
||||
c = par->GetChar(i);
|
||||
if (islatex)
|
||||
continue;
|
||||
switch (c) {
|
||||
case LyXParagraph::META_INSET:
|
||||
if ((inset = par->GetInset(i))) {
|
||||
fpos = ofs.tellp();
|
||||
inset->Ascii(this, ofs);
|
||||
currlinelen += (ofs.tellp() - fpos);
|
||||
actpos += (ofs.tellp() - fpos) - 1;
|
||||
}
|
||||
break;
|
||||
case LyXParagraph::META_NEWLINE:
|
||||
ofs << "\n";
|
||||
for (j = 0; j < depth; ++j)
|
||||
ofs << " ";
|
||||
currlinelen = depth * 2;
|
||||
if (ltype_depth > depth) {
|
||||
for (j = ltype_depth;
|
||||
j > depth; --j)
|
||||
ofs << " ";
|
||||
currlinelen += (ltype_depth - depth) * 2;
|
||||
}
|
||||
break;
|
||||
case LyXParagraph::META_HFILL:
|
||||
ofs << "\t";
|
||||
break;
|
||||
case '\\':
|
||||
ofs << "\\";
|
||||
break;
|
||||
default:
|
||||
if (currlinelen > linelen - 10
|
||||
&& c == ' ' && i + 2 < par->size()) {
|
||||
ofs << "\n";
|
||||
for (j = 0; j < depth; ++j)
|
||||
ofs << " ";
|
||||
currlinelen = depth * 2;
|
||||
if (ltype_depth > depth) {
|
||||
for (j = ltype_depth;
|
||||
j > depth; --j)
|
||||
ofs << " ";
|
||||
currlinelen += (ltype_depth-depth)*2;
|
||||
}
|
||||
} else if (c != '\0')
|
||||
ofs << c;
|
||||
else if (c == '\0')
|
||||
lyxerr.debug() << "writeAsciiFile: NULL char in structure." << endl;
|
||||
++currlinelen;
|
||||
break;
|
||||
}
|
||||
}
|
||||
par = par->next;
|
||||
}
|
||||
|
||||
ofs << "\n";
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
#else
|
||||
//----------------------------------------------------------------------------
|
||||
string const Buffer::asciiParagraph(LyXParagraph const * par,
|
||||
unsigned int linelen) const
|
||||
{
|
||||
@ -1722,7 +1503,7 @@ void Buffer::writeFileAscii(ostream & ofs, int linelen)
|
||||
}
|
||||
ofs << "\n";
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void Buffer::makeLaTeXFile(string const & fname,
|
||||
string const & original_path,
|
||||
|
@ -72,7 +72,7 @@ Buffer * BufferStorage::newBuffer(string const & s, bool ronly)
|
||||
{
|
||||
Buffer * tmpbuf = new Buffer(s, ronly);
|
||||
tmpbuf->params.useClassDefaults();
|
||||
lyxerr.debug() << "Assigning to buffer "
|
||||
lyxerr[Debug::INFO] << "Assigning to buffer "
|
||||
<< container.size() << endl;
|
||||
container.push_back(tmpbuf);
|
||||
return tmpbuf;
|
||||
|
@ -81,7 +81,8 @@ class UserCache {
|
||||
public:
|
||||
/// seeks user name from group ID
|
||||
string const & find(uid_t ID) const {
|
||||
Users::const_iterator cit = users.find(ID);
|
||||
// We really want to use const_iterator. (Lgb)
|
||||
Users::iterator cit = users.find(ID);
|
||||
if (cit == users.end()) {
|
||||
add(ID);
|
||||
return users[ID];
|
||||
@ -97,6 +98,7 @@ private:
|
||||
mutable Users users;
|
||||
};
|
||||
|
||||
|
||||
void UserCache::add(uid_t ID) const
|
||||
{
|
||||
string pszNewName;
|
||||
@ -128,15 +130,19 @@ private:
|
||||
mutable Groups groups;
|
||||
};
|
||||
|
||||
|
||||
string const & GroupCache::find(gid_t ID) const
|
||||
{
|
||||
Groups::const_iterator cit = groups.find(ID);
|
||||
// We really want to use const_iterator. (Lgb)
|
||||
Groups::iterator cit = groups.find(ID);
|
||||
if (cit == groups.end()) {
|
||||
add(ID);
|
||||
return groups[ID];
|
||||
}
|
||||
return (*cit).second;
|
||||
}
|
||||
|
||||
|
||||
void GroupCache::add(gid_t ID) const
|
||||
{
|
||||
string pszNewName;
|
||||
@ -151,10 +157,12 @@ void GroupCache::add(gid_t ID) const
|
||||
groups[ID] = pszNewName;
|
||||
}
|
||||
|
||||
|
||||
// static instances
|
||||
static UserCache lyxUserCache;
|
||||
static GroupCache lyxGroupCache;
|
||||
|
||||
|
||||
// some "C" wrappers around callbacks
|
||||
extern "C" void C_LyXFileDlg_FileDlgCB(FL_OBJECT *, long lArgument);
|
||||
extern "C" void C_LyXFileDlg_DoubleClickCB(FL_OBJECT *, long);
|
||||
@ -192,7 +200,7 @@ void LyXFileDlg::Reread()
|
||||
if (!pDirectory) {
|
||||
WriteFSAlert(_("Warning! Couldn't open directory."),
|
||||
pszDirectory);
|
||||
pszDirectory = lyx::getcwd(); //GetCWD();
|
||||
pszDirectory = lyx::getcwd();
|
||||
pDirectory = ::opendir(pszDirectory.c_str());
|
||||
}
|
||||
|
||||
@ -331,7 +339,7 @@ void LyXFileDlg::Reread()
|
||||
// Add them to directory box
|
||||
for (DirEntries::const_iterator cit = direntries.begin();
|
||||
cit != direntries.end(); ++cit) {
|
||||
string temp = line + (*cit).pszDisplayed;
|
||||
string const temp = line + (*cit).pszDisplayed;
|
||||
fl_add_browser_line(pFileDlgForm->List, temp.c_str());
|
||||
}
|
||||
fl_set_browser_topline(pFileDlgForm->List, iDepth);
|
||||
@ -450,7 +458,6 @@ bool LyXFileDlg::RunDialog()
|
||||
|
||||
// event loop
|
||||
while(true) {
|
||||
|
||||
FL_OBJECT * pObject = fl_do_forms();
|
||||
|
||||
if (pObject == pFileDlgForm->Ready) {
|
||||
@ -530,7 +537,7 @@ extern "C" void C_LyXFileDlg_FileDlgCB(FL_OBJECT * ob, long data)
|
||||
void LyXFileDlg::HandleListHit()
|
||||
{
|
||||
// set info line
|
||||
int iSelect = fl_get_browser(pFileDlgForm->List);
|
||||
int const iSelect = fl_get_browser(pFileDlgForm->List);
|
||||
if (iSelect > iDepth) {
|
||||
SetInfoLine(direntries[iSelect - iDepth - 1].pszLsEntry);
|
||||
} else {
|
||||
@ -547,11 +554,13 @@ void LyXFileDlg::DoubleClickCB(FL_OBJECT *, long)
|
||||
pCurrentDlg->Force(false);
|
||||
}
|
||||
|
||||
|
||||
extern "C" void C_LyXFileDlg_DoubleClickCB(FL_OBJECT * ob, long data)
|
||||
{
|
||||
LyXFileDlg::DoubleClickCB(ob, data);
|
||||
}
|
||||
|
||||
|
||||
// Handle double click from list
|
||||
bool LyXFileDlg::HandleDoubleClick()
|
||||
{
|
||||
@ -559,7 +568,7 @@ bool LyXFileDlg::HandleDoubleClick()
|
||||
|
||||
// set info line
|
||||
bool isDir = true;
|
||||
int iSelect = fl_get_browser(pFileDlgForm->List);
|
||||
int const iSelect = fl_get_browser(pFileDlgForm->List);
|
||||
if (iSelect > iDepth) {
|
||||
pszTemp = direntries[iSelect - iDepth - 1].pszName;
|
||||
SetInfoLine(direntries[iSelect - iDepth - 1].pszLsEntry);
|
||||
@ -623,12 +632,13 @@ bool LyXFileDlg::HandleOK()
|
||||
}
|
||||
|
||||
// Handle return from list
|
||||
int select = fl_get_browser(pFileDlgForm->List);
|
||||
int const select = fl_get_browser(pFileDlgForm->List);
|
||||
if (select > iDepth) {
|
||||
string temp = direntries[select - iDepth - 1].pszName;
|
||||
string const temp = direntries[select - iDepth - 1].pszName;
|
||||
if (!suffixIs(temp, '/')) {
|
||||
// If user didn't type anything, use browser
|
||||
string name = fl_get_input(pFileDlgForm->Filename);
|
||||
string const name =
|
||||
fl_get_input(pFileDlgForm->Filename);
|
||||
if (name.empty()) {
|
||||
fl_set_input(pFileDlgForm->Filename, temp.c_str());
|
||||
}
|
||||
@ -689,11 +699,12 @@ string const LyXFileDlg::Select(string const & title, string const & path,
|
||||
|
||||
// highlight the suggested file in the browser, if it exists.
|
||||
int sel = 0;
|
||||
string filename = OnlyFilename(suggested);
|
||||
string const filename = OnlyFilename(suggested);
|
||||
if (!filename.empty()) {
|
||||
for (int i = 0;
|
||||
i < fl_get_browser_maxline(pFileDlgForm->List); ++i) {
|
||||
string s = fl_get_browser_line(pFileDlgForm->List, i+1);
|
||||
string s =
|
||||
fl_get_browser_line(pFileDlgForm->List, i + 1);
|
||||
s = strip(frontStrip(s));
|
||||
if (s == filename) {
|
||||
sel = i + 1;
|
||||
@ -703,7 +714,7 @@ string const LyXFileDlg::Select(string const & title, string const & path,
|
||||
}
|
||||
|
||||
if (sel != 0) fl_select_browser_line(pFileDlgForm->List, sel);
|
||||
int top = max(sel - 5, 1);
|
||||
int const top = max(sel - 5, 1);
|
||||
fl_set_browser_topline(pFileDlgForm->List, top);
|
||||
|
||||
// checks whether dialog can be started
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "FormTabularCreate.h"
|
||||
#include "FormToc.h"
|
||||
#include "FormUrl.h"
|
||||
#include "debug.h"
|
||||
//#include "debug.h"
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation
|
||||
@ -73,7 +73,7 @@ Dialogs::~Dialogs()
|
||||
for (vector<DialogBase *>::iterator iter = dialogs_.begin();
|
||||
iter != dialogs_.end();
|
||||
++iter) {
|
||||
lyxerr << "delete *iter" << endl;
|
||||
//lyxerr << "delete *iter" << endl;
|
||||
delete *iter;
|
||||
}
|
||||
}
|
||||
|
@ -12,9 +12,10 @@
|
||||
* FormPreferences Interface Class Implementation
|
||||
*/
|
||||
|
||||
#include <utility>
|
||||
#include <config.h>
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include FORMS_H_LOCATION
|
||||
|
||||
#ifdef __GNUG_
|
||||
@ -42,6 +43,7 @@
|
||||
#include "xform_macros.h"
|
||||
#include "converter.h"
|
||||
#include "support/lyxfunctional.h"
|
||||
#include "support/lyxmanip.h"
|
||||
|
||||
|
||||
#ifdef SIGC_CXX_NAMESPACES
|
||||
@ -55,8 +57,8 @@ using std::pair;
|
||||
using std::max;
|
||||
using std::sort;
|
||||
using std::vector;
|
||||
using std::make_pair;
|
||||
|
||||
extern string fmt(char const * fmtstr ...);
|
||||
extern string system_lyxdir;
|
||||
extern string user_lyxdir;
|
||||
extern Languages languages;
|
||||
@ -518,7 +520,9 @@ bool FormPreferences::Colors::input( FL_OBJECT const * const ob )
|
||||
|
||||
} else if (ob == dialog_->button_browse) {
|
||||
return parent_.browse(dialog_->input_name,
|
||||
_("X11 color database"), "*.txt" );
|
||||
_("X11 color database"), "*.txt",
|
||||
make_pair(string(), string()),
|
||||
make_pair(string(), string()));
|
||||
|
||||
} else if (ob == dialog_->browser_lyx_objs) {
|
||||
return BrowserLyX();
|
||||
@ -1676,14 +1680,16 @@ bool FormPreferences::Language::input( FL_OBJECT const * const ob )
|
||||
pair<string, string> dir1(name, dir);
|
||||
|
||||
parent_.browse(dialog_->input_kbmap1,
|
||||
_("Keyboard map"), "*.kmap", dir1 );
|
||||
_("Keyboard map"), "*.kmap", dir1,
|
||||
pair<string, string>());
|
||||
} else if (ob == dialog_->button_kbmap2_browse) {
|
||||
string dir = system_lyxdir + string("kbd");
|
||||
string name = N_("Key maps");
|
||||
pair<string, string> dir1(name, dir);
|
||||
|
||||
parent_.browse(dialog_->input_kbmap2,
|
||||
_("Keyboard map"), "*.kmap", dir1 );
|
||||
_("Keyboard map"), "*.kmap", dir1,
|
||||
pair<string, string>());
|
||||
}
|
||||
|
||||
return activate;
|
||||
@ -1831,7 +1837,7 @@ void FormPreferences::OutputsMisc::apply() const
|
||||
(fl_get_counter_value(dialog_->counter_line_len));
|
||||
lyxrc.fontenc = fl_get_input(dialog_->input_tex_encoding);
|
||||
|
||||
int choice =
|
||||
int const choice =
|
||||
fl_get_choice(dialog_->choice_default_papersize) - 1;
|
||||
lyxrc.default_papersize = static_cast<BufferParams::PAPER_SIZE>(choice);
|
||||
|
||||
@ -2087,21 +2093,30 @@ bool FormPreferences::Paths::input( FL_OBJECT const * const ob )
|
||||
|
||||
if (ob == dialog_->button_default_path_browse) {
|
||||
parent_.browse(dialog_->input_default_path,
|
||||
_("Default path"), string() );
|
||||
_("Default path"), string(),
|
||||
pair<string, string>(),
|
||||
pair<string, string>());
|
||||
} else if (ob == dialog_->button_template_path_browse) {
|
||||
parent_.browse(dialog_->input_template_path,
|
||||
_("Template path"), string() );
|
||||
_("Template path"), string(),
|
||||
pair<string, string>(),
|
||||
pair<string, string>());
|
||||
} else if (ob == dialog_->button_temp_dir_browse) {
|
||||
parent_.browse(dialog_->input_temp_dir,
|
||||
_("Temp dir"), string() );
|
||||
_("Temp dir"), string(),
|
||||
pair<string, string>(),
|
||||
pair<string, string>());
|
||||
} else if (ob == dialog_->button_lastfiles_browse) {
|
||||
pair<string, string> dir(_("User"), user_lyxdir);
|
||||
|
||||
parent_.browse(dialog_->input_lastfiles,
|
||||
_("Lastfiles"), string(), dir );
|
||||
_("Lastfiles"), string(), dir,
|
||||
pair<string, string>());
|
||||
} else if (ob == dialog_->button_backup_path_browse) {
|
||||
parent_.browse( dialog_->input_backup_path,
|
||||
_("Backup path"), string() );
|
||||
_("Backup path"), string(),
|
||||
pair<string, string>(),
|
||||
pair<string, string>());
|
||||
} else if (ob == dialog_->button_serverpipe_browse) {
|
||||
// Not sure how to do this!!!
|
||||
}
|
||||
@ -2808,7 +2823,9 @@ bool FormPreferences::SpellChecker::input( FL_OBJECT const * const ob )
|
||||
|
||||
if( ob == dialog_->button_personal_dict) {
|
||||
parent_.browse(dialog_->input_personal_dict,
|
||||
_("Personal dictionary"), "*.ispell" );
|
||||
_("Personal dictionary"), "*.ispell",
|
||||
pair<string, string>(),
|
||||
pair<string, string>());
|
||||
}
|
||||
|
||||
return true; // All input is valid!
|
||||
@ -2936,25 +2953,11 @@ bool FormPreferences::WriteableFile(string const & name,
|
||||
str = N_("WARNING! The absolute path is required.");
|
||||
}
|
||||
|
||||
#if 0
|
||||
// This is not a nice way to use FileInfo (Lgb)
|
||||
FileInfo d;
|
||||
|
||||
{
|
||||
FileInfo d1(dir);
|
||||
FileInfo d2(name);
|
||||
if (d2.isDir() )
|
||||
d = d2;
|
||||
else
|
||||
d = d1;
|
||||
}
|
||||
#else
|
||||
// This should be equivalent (Lgb)
|
||||
FileInfo d(name);
|
||||
if (!d.isDir()) {
|
||||
d.newFile(dir);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (success && !d.isDir()) {
|
||||
success = false;
|
||||
str = N_("WARNING! Directory does not exist.");
|
||||
@ -3042,7 +3045,7 @@ void FormPreferences::printWarning( string const & warning )
|
||||
{
|
||||
warningPosted = true;
|
||||
|
||||
string str = formatted( warning, dialog_->text_warning->w-10,
|
||||
string const str = formatted(warning, dialog_->text_warning->w - 10,
|
||||
FL_SMALL_SIZE, FL_NORMAL_STYLE);
|
||||
|
||||
fl_set_object_label(dialog_->text_warning, str.c_str());
|
||||
@ -3100,7 +3103,7 @@ FormPreferences::browseFile( string const & filename,
|
||||
bool error = false;
|
||||
string buf;
|
||||
do {
|
||||
string p = fileDlg.Select(title,
|
||||
string const p = fileDlg.Select(title,
|
||||
lastPath,
|
||||
pattern, filename);
|
||||
|
||||
@ -3172,3 +3175,4 @@ void FormPreferences::setPreHandler(FL_OBJECT * ob) const
|
||||
Assert(ob);
|
||||
fl_set_object_prehandler(ob, C_FormPreferencesFeedbackCB);
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "FormBase.h"
|
||||
#include "Color.h"
|
||||
#include "LString.h"
|
||||
|
||||
#ifdef __GNUG_
|
||||
#pragma interface
|
||||
@ -106,20 +107,18 @@ private:
|
||||
///
|
||||
bool browse(FL_OBJECT * input,
|
||||
string const & title, string const & pattern,
|
||||
std::pair<string,string> const & dir1 =
|
||||
std::pair<string,string>(),
|
||||
std::pair<string,string> const & dir2 =
|
||||
std::pair<string,string>() );
|
||||
std::pair<string,string> const & dir1 //=
|
||||
//std::pair<string,string>()
|
||||
,
|
||||
std::pair<string,string> const & dir2 //=
|
||||
//std::pair<string,string>()
|
||||
);
|
||||
/// called from browse()
|
||||
string const browseFile( string const & filename,
|
||||
string const & title, string const & pattern,
|
||||
std::pair<string,string> const & dir1,
|
||||
std::pair<string,string> const & dir2 ) const;
|
||||
|
||||
/** Flag whether a warning has been posted to the text window.
|
||||
If so, don't redraw the window when the mouse leaves an object. */
|
||||
bool warningPosted;
|
||||
|
||||
/// Type definitions from the fdesign produced header file.
|
||||
FD_form_preferences * build_preferences();
|
||||
///
|
||||
@ -151,17 +150,21 @@ private:
|
||||
|
||||
/// Real GUI implementation.
|
||||
FD_form_preferences * dialog_;
|
||||
/// Converters tabfolder
|
||||
FD_form_outer_tab * converters_tab_;
|
||||
/// reLyX and other import/input stuff
|
||||
FD_form_outer_tab * inputs_tab_;
|
||||
/// HCI configuration
|
||||
FD_form_outer_tab * look_n_feel_tab_;
|
||||
/// Converters tabfolder
|
||||
FD_form_outer_tab * converters_tab_;
|
||||
/// Outputs tabfolder
|
||||
FD_form_outer_tab * outputs_tab_;
|
||||
/// Spellchecker, language stuff, etc
|
||||
FD_form_outer_tab * usage_tab_;
|
||||
|
||||
/** Flag whether a warning has been posted to the text window.
|
||||
If so, don't redraw the window when the mouse leaves an object. */
|
||||
bool warningPosted;
|
||||
|
||||
/** Each tab folder is encapsulated in its own class.
|
||||
*/
|
||||
|
||||
@ -571,10 +574,10 @@ private:
|
||||
///
|
||||
Converters converters_;
|
||||
///
|
||||
Formats formats_;
|
||||
///
|
||||
InputsMisc inputs_misc_;
|
||||
///
|
||||
Formats formats_;
|
||||
///
|
||||
Interface interface_;
|
||||
///
|
||||
Language language_;
|
||||
|
@ -339,7 +339,9 @@ void InsetGraphicsParams::Write(Buffer const * buf, ostream & os) const
|
||||
os << " rotateAngle " << rotateAngle << endl;
|
||||
}
|
||||
|
||||
static void readResize(InsetGraphicsParams * igp, bool height,
|
||||
|
||||
static
|
||||
void readResize(InsetGraphicsParams * igp, bool height,
|
||||
string const & token)
|
||||
{
|
||||
InsetGraphicsParams::Resize resize = InsetGraphicsParams::DEFAULT_SIZE;
|
||||
@ -369,7 +371,9 @@ static void readResize(InsetGraphicsParams * igp, bool height,
|
||||
igp->widthResize = resize;
|
||||
}
|
||||
|
||||
static void readOrigin(InsetGraphicsParams * igp, string const & token)
|
||||
|
||||
static
|
||||
void readOrigin(InsetGraphicsParams * igp, string const & token)
|
||||
{ // TODO: complete this function.
|
||||
igp->rotateOrigin = originTranslator.find(token);
|
||||
}
|
||||
|
@ -54,7 +54,6 @@ using std::isdigit;
|
||||
using std::isalpha;
|
||||
#endif
|
||||
|
||||
//extern char * mathed_label;
|
||||
extern string mathed_label;
|
||||
|
||||
extern char const * latex_special_chars;
|
||||
|
@ -175,7 +175,7 @@ string const lowercase(string const & a)
|
||||
}
|
||||
#else
|
||||
// We want to use this one. (Lgb)
|
||||
transform(tmp.begin(), tmp.end(), tmp.begin(), tolower);
|
||||
transform(tmp.begin(), tmp.end(), tmp.begin(), lowercase);
|
||||
#endif
|
||||
return tmp;
|
||||
}
|
||||
@ -193,7 +193,7 @@ string const uppercase(string const & a)
|
||||
}
|
||||
#else
|
||||
// We want to use this one. (Lgb)
|
||||
transform(tmp.begin(), tmp.end(), tmp.begin(), toupper);
|
||||
transform(tmp.begin(), tmp.end(), tmp.begin(), uppercase);
|
||||
#endif
|
||||
return tmp;
|
||||
}
|
||||
|
@ -3,6 +3,8 @@
|
||||
#ifndef LYX_FUNCTIONAL_H
|
||||
#define LYX_FUNCTIONAL_H
|
||||
|
||||
#include <iterator>
|
||||
|
||||
//namespace lyx {
|
||||
|
||||
template<class R, class C, class A>
|
||||
@ -50,21 +52,28 @@ class_fun(C & c, void(C::*f)(A))
|
||||
template <class Cont, class Type, class MemRet>
|
||||
class back_insert_fun_iterator {
|
||||
protected:
|
||||
Cont & container;
|
||||
Cont * container;
|
||||
MemRet(Type::*pmf)();
|
||||
public:
|
||||
typedef Cont container_type;
|
||||
typedef std::output_iterator_tag iterator_category;
|
||||
typedef void value_type;
|
||||
typedef void difference_type;
|
||||
typedef void pointer;
|
||||
typedef void reference;
|
||||
|
||||
back_insert_fun_iterator(Cont & x, MemRet(Type::*p)())
|
||||
: container(x), pmf(p) {}
|
||||
: container(&x), pmf(p) {}
|
||||
|
||||
back_insert_fun_iterator &
|
||||
operator=(Type * val) {
|
||||
container.push_back((val->*pmf)());
|
||||
container->push_back((val->*pmf)());
|
||||
return *this;
|
||||
}
|
||||
|
||||
back_insert_fun_iterator &
|
||||
operator=(Type & val) {
|
||||
container.push_back((val.*pmf)());
|
||||
container->push_back((val.*pmf)());
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -83,21 +92,30 @@ public:
|
||||
template <class Cont, class Type, class MemRet>
|
||||
class const_back_insert_fun_iterator {
|
||||
protected:
|
||||
Cont & container;
|
||||
Cont * container;
|
||||
MemRet(Type::*pmf)() const;
|
||||
public:
|
||||
typedef Cont container_type;
|
||||
typedef std::output_iterator_tag iterator_category;
|
||||
typedef void value_type;
|
||||
typedef void difference_type;
|
||||
typedef void pointer;
|
||||
typedef void reference;
|
||||
|
||||
const_back_insert_fun_iterator(Cont & x, MemRet(Type::*p)() const)
|
||||
: container(x), pmf(p) {}
|
||||
: container(&x), pmf(p) {}
|
||||
|
||||
~const_back_insert_fun_iterator() {}
|
||||
|
||||
const_back_insert_fun_iterator &
|
||||
operator=(Type const * val) {
|
||||
container.push_back((val->*pmf)());
|
||||
container->push_back((val->*pmf)());
|
||||
return *this;
|
||||
}
|
||||
|
||||
const_back_insert_fun_iterator &
|
||||
operator=(Type const & val) {
|
||||
container.push_back((val.*pmf)());
|
||||
container->push_back((val.*pmf)());
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,22 @@ using std::endl;
|
||||
|
||||
extern string system_tempdir;
|
||||
|
||||
static inline
|
||||
int make_tempfile(char * templ)
|
||||
{
|
||||
#ifdef HAVE_MKSTEMP
|
||||
return ::mkstemp(templ);
|
||||
#else
|
||||
#ifdef HAVE_MKTEMP
|
||||
// This probably just barely works...
|
||||
::mktemp(templ);
|
||||
return ::open(templ, O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
|
||||
#else
|
||||
#warning FIX FIX FIX
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
string const lyx::tempName(string const & dir, string const & mask)
|
||||
{
|
||||
string const tmpdir(dir.empty() ? system_tempdir : dir);
|
||||
@ -24,7 +40,7 @@ string const lyx::tempName(string const & dir, string const & mask)
|
||||
tmpfl.copy(tmpl, string::npos);
|
||||
tmpl[tmpfl.length()] = '\0'; // terminator
|
||||
|
||||
int const tmpf = ::mkstemp(tmpl);
|
||||
int const tmpf = make_tempfile(tmpl);
|
||||
if (tmpf != -1) {
|
||||
string const t(tmpl);
|
||||
::close(tmpf);
|
||||
|
@ -342,6 +342,8 @@ void LyXTabular::set_row_column_number_info(bool oldformat)
|
||||
}
|
||||
#else
|
||||
// Isn't this the same as the while above? (Lgb)
|
||||
#warning Please check this Jürgen.
|
||||
// if ok please delete the #if 0 section above. (Lgb)
|
||||
for (int row = 0, column = 0, c = 0;
|
||||
c < numberofcells && row < rows_ && column < columns_;) {
|
||||
rowofcell[c] = row;
|
||||
@ -2364,12 +2366,7 @@ static
|
||||
inline
|
||||
void print_n_chars(ostream & os, unsigned char ch, int n)
|
||||
{
|
||||
#if 0
|
||||
for (int i = 0; i < n; ++i)
|
||||
os << ch;
|
||||
#else
|
||||
os << string(n, ch);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -2390,6 +2387,8 @@ int LyXTabular::AsciiTopHLine(ostream & os, int row,
|
||||
return 0;
|
||||
#else
|
||||
// Isn't this equivalent? (Lgb)
|
||||
#warning Please check this Jürgen.
|
||||
// If ok please delete the abofe #if 0 section. (Lgb)
|
||||
for (int i = fcell; i < n; ++i) {
|
||||
if (TopLine(i))
|
||||
return 0;
|
||||
@ -2444,6 +2443,8 @@ int LyXTabular::AsciiBottomHLine(ostream & os, int row,
|
||||
return 0;
|
||||
#else
|
||||
// Isn't this equivalent? (Lgb)
|
||||
#warning Please check this Jürgen.
|
||||
// If ok, please delete the above #if 0 section. (Lgb)
|
||||
for (int i = fcell; i < n; ++i) {
|
||||
if (BottomLine(i))
|
||||
return 0;
|
||||
|
@ -18,4 +18,4 @@
|
||||
|
||||
#include "tracer.h"
|
||||
|
||||
int DebugTracer::depth = 0;
|
||||
int Trace::depth = 0;
|
||||
|
21
src/tracer.h
21
src/tracer.h
@ -20,20 +20,20 @@
|
||||
#include "LString.h"
|
||||
|
||||
///
|
||||
class DebugTracer {
|
||||
class Trace {
|
||||
public:
|
||||
///
|
||||
explicit
|
||||
DebugTracer(string const & s) : str(s) {
|
||||
lyxerr << string(depth, ' ') << "Trace begin : "
|
||||
Trace(string const & s) : str(s) {
|
||||
lyxerr << string(depth, ' ') << "TRACE IN: "
|
||||
<< str << std::endl;
|
||||
++depth;
|
||||
depth += 2;
|
||||
|
||||
}
|
||||
///
|
||||
~DebugTracer() {
|
||||
--depth;
|
||||
lyxerr << string(depth, ' ') << "Trace end : "
|
||||
~Trace() {
|
||||
depth -= 2;
|
||||
lyxerr << string(depth, ' ') << "TRACE OUT: "
|
||||
<< str << std::endl;
|
||||
}
|
||||
private:
|
||||
@ -43,4 +43,11 @@ private:
|
||||
static int depth;
|
||||
};
|
||||
|
||||
// To avoid wrong usage:
|
||||
// Trace("BufferView::update"); // wrong
|
||||
// Trace t("BufferView::update"); // right
|
||||
// we add this macro:
|
||||
///
|
||||
#define Trace(x) unnamed_Trace;
|
||||
// Tip gotten from Bobby Schmidt's column in C/C++ Users Journal
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user