+2000-01-25 Lars Gullik Bjønnes <larsbj@lyx.org>
+
+ * several files: marked several lines with "DEL LINE", this is
+ lines that can be deleted without changing anything.
+ if (<ptr>) // DEL LINE /* this line is _never_ needed. Delete
+ checks this anyway */
+ delete <ptr>
+
+ * src/insets/insetlatexaccent.C: Changed some debugs to Debug::KEY
+
+ * src/DepTable.C (update): add a "+" at the end when the checksum
+ is different. (debugging string only)
+
+ * src/paragraph.C (ReturnNextInsetPointer): fix bug that caused
+ the next inset to not be displayed. This should also fix the list
+ of labels in the "Insert Crossreference" dialog.
+
2000-01-24 Lars Gullik Bjønnes <larsbj@lyx.org>
* src/support/LSubstring.C (LSubstring): set pos to string::npos
// Nuke old image
// screen is always deleted when the buffer is changed.
- if (screen)
+ if (screen) // DEL LINE
delete screen;
screen = 0;
void BufferView::updateScreen()
{
// Regenerate the screen.
- if (screen)
+ if (screen) // DEL LINE
delete screen;
screen = new LyXScreen(FL_ObjWin(work_area),
work_area->w,
Window tmpwin;
int tmp;
XGetInputFocus(fl_display, &tmpwin, &tmp);
- if (lyxerr.debugging(Debug::INFO)) {
- lyxerr << "tmpwin: " << tmpwin
- << "\nwindow: " << view->owner_->getForm()->window
- << "\nwork_area_focus: " << view->work_area_focus
- << "\nlyx_focus : " << view->lyx_focus
- << endl;
- }
+ // Commenting this out, we have not had problems with this
+ // for a long time. We will probably work on this code later
+ // and we can reenable this debug code then. Now it only
+ // anoying when debugging. (Lgb)
+ //if (lyxerr.debugging(Debug::INFO)) {
+ // lyxerr << "tmpwin: " << tmpwin
+ // << "\nwindow: " << view->owner_->getForm()->window
+ // << "\nwork_area_focus: " << view->work_area_focus
+ // << "\nlyx_focus : " << view->lyx_focus
+ // << endl;
+ //}
if (tmpwin != view->owner_->getForm()->window) {
view->lyx_focus = false;
goto skip_timer;
unsigned long one = (*itr).second.second;
unsigned long two = lyx::sum((*itr).first.c_str());
(*itr).second = make_pair(one, two);
- if (lyxerr.debugging()) {
- lyxerr << "update: " << (*itr).first << " "
- << one << " " << two << endl;
+ if (lyxerr.debugging(Debug::DEPEND)) {
+ lyxerr << "Update dep: " << (*itr).first << " "
+ << one << " " << two;
+ if (one != two)
+ lyxerr << " +";
+ lyxerr << endl;
}
}
}
return true;
}
}
-
return false;
}
for (DepList::const_iterator cit = deplist.begin();
cit != deplist.end();
++cit) {
- if (lyxerr.debugging()) {
+ if (lyxerr.debugging(Debug::DEPEND)) {
lyxerr << "Write dep: "
<< (*cit).first << " "
<< (*cit).second.first << " "
unsigned long one = 0;
unsigned long two = 0;
while(ifs >> nome >> one >> two) {
- if (lyxerr.debugging()) {
- lyxerr << "read dep: "
+ if (lyxerr.debugging(Debug::DEPEND)) {
+ lyxerr << "Read dep: "
<< nome << " "
<< one << " "
<< two << endl;
struct texfile_struct {
LaTeX::TEX_FILES file;
- char const *extension;
+ char const * extension;
};
static
// Update the checksums
head.update();
- lyxerr[Debug::LATEX] << "Dependency file exists" << endl;
+ lyxerr[Debug::DEPEND] << "Dependency file exists" << endl;
if (head.sumchange()) {
++count;
+ lyxerr[Debug::DEPEND]
+ << "Dependency file has changed" << endl;
lyxerr[Debug::LATEX]
- << "Dependency file has changed\n"
<< "Run #" << count << endl;
minib->Set(string(_("LaTeX run number ")) + tostr(count));
minib->Store();
if (scanres & LaTeX::ERRORS) return scanres; // return on error
run_bibtex = scanAux(head);
if (run_bibtex)
- lyxerr << "Bibtex demands rerun" << endl;
+ lyxerr[Debug::DEPEND]
+ << "Bibtex demands rerun" << endl;
} else {
- lyxerr[Debug::LATEX] << "return no_change" << endl;
+ lyxerr[Debug::DEPEND] << "return no_change" << endl;
return LaTeX::NO_CHANGE;
}
} else {
++count;
- lyxerr[Debug::LATEX] << "Dependency file does not exist\n"
- << "Run #" << count << endl;
+ lyxerr[Debug::DEPEND]
+ << "Dependency file does not exist" << endl;
+ lyxerr[Debug::LATEX]
+ << "Run #" << count << endl;
head.insert(file, true);
minib->Set(string(_("LaTeX run number ")) + tostr(count));
minib->Store();
if (rerun || head.sumchange()) {
rerun = false;
++count;
+ lyxerr[Debug::DEPEND]
+ << "Dep. file has changed or rerun requested" << endl;
lyxerr[Debug::LATEX]
- << "Dep. file has changed or rerun requested\n"
<< "Run #" << count << endl;
minib->Set(string(_("LaTeX run number ")) + tostr(count));
minib->Store();
deplog(head); // reads the latex log
head.update();
} else {
- lyxerr[Debug::LATEX] << "Dep. file has NOT changed" << endl;
+ lyxerr[Debug::DEPEND] << "Dep. file has NOT changed" << endl;
}
// 1.5
break;
foundfile += c;
}
- lyxerr[Debug::LATEX] << "Found file: "
+ lyxerr[Debug::DEPEND] << "Found file: "
<< foundfile << endl;
// Ok now we found a file.
// absolute path and should
// be inserted.
if (AbsolutePath(foundfile)) {
- lyxerr[Debug::LATEX] << "AbsolutePath file: "
+ lyxerr[Debug::DEPEND] << "AbsolutePath file: "
<< foundfile << endl;
// On inital insert we want to do the update at once
// since this file can not be a file generated by
// insert it into head
if (FileInfo(OnlyFilename(foundfile)).exist()) {
if (suffixIs(foundfile, ".aux")) {
- lyxerr[Debug::LATEX] << "We don't want "
+ lyxerr[Debug::DEPEND] << "We don't want "
<< OnlyFilename(foundfile)
<< " in the dep file"
<< endl;
// This is a tex file generated by LyX
// and latex is not likely to change this
// during its runs.
- lyxerr[Debug::LATEX] << "Tmpdir TeX file: "
+ lyxerr[Debug::DEPEND] << "Tmpdir TeX file: "
<< OnlyFilename(foundfile)
<< endl;
head.insert(foundfile, true);
} else {
- lyxerr[Debug::LATEX] << "In tmpdir file:"
+ lyxerr[Debug::DEPEND] << "In tmpdir file:"
<< OnlyFilename(foundfile)
<< endl;
head.insert(OnlyFilename(foundfile));
}
continue;
}
- lyxerr[Debug::LATEX]
+ lyxerr[Debug::DEPEND]
<< "Not a file or we are unable to find it."
<< endl;
}
tmp = ChangeExtension(file,
all_files[i].extension,
true);
- lyxerr[Debug::LATEX] << "deptex: " << tmp << endl;
+ lyxerr[Debug::DEPEND] << "deptex: " << tmp << endl;
if (fi.newFile(tmp).exist())
head.insert(tmp);
}
}
}
-
{
/// if this is a child document and the parent is already loaded
/// Use the parent's list instead [ale990407]
- if (!params.parentname.empty() && bufferlist.exists(params.parentname)) {
+ if (!params.parentname.empty()
+ && bufferlist.exists(params.parentname)) {
Buffer * tmp = bufferlist.getBuffer(params.parentname);
if (tmp)
- return tmp->getReferenceList(delim);
+ return tmp->getReferenceList(delim);
}
LyXParagraph * par = paragraph;
LyXParagraph::size_type pos;
Inset * inset;
string lst;
- while (par){
+ while (par) {
pos = -1;
while ((inset = par->ReturnNextInsetPointer(pos))){
for (int i = 0; i < inset->GetNumberOfLabels(); ++i) {
lst += inset->getLabel(i);
}
++pos;
- }
+ }
par = par->next;
}
lyxerr.debug() << "References(" << lst << ")" << endl;
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
{ Debug::LYXRC, "lyxrc", "Configuration files reading"},
{ Debug::KBMAP, "kbmap", "Custom keyboard definition"},
{ Debug::LATEX, "latex", "LaTeX generation/execution"},
+ { Debug::DEPEND, "depend", "Dependency information"},
{ Debug::MATHED, "mathed", "Math editor"},
{ Debug::FONT, "font", "Font handling"},
{ Debug::TCLASS, "tclass", "Textclass files reading"},
while (!v.empty()) {
string::size_type st = v.find(',');
string tmp(lowercase(v.substr(0, st)));
- if (tmp.empty())
+ if (tmp.empty())
break;
// Is it a number?
if (isStrInt(tmp))
///
ACTION = (1 << 14), // 16384
///
- LYXLEX = (1 << 15)
+ LYXLEX = (1 << 15),
+ ///
+ DEPEND = (1 << 16)
};
///
static const type ANY = type(INFO | INIT | KEY | TOOLBAR |
PARSER | LYXRC | KBMAP | LATEX |
MATHED | FONT | TCLASS | LYXVC |
- LYXSERVER | ROFF | ACTION | LYXLEX);
+ LYXSERVER | ROFF | ACTION | LYXLEX |
+ DEPEND);
///
friend inline void operator|=(Debug::type & d1, Debug::type d2);
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-1999 The LyX Team.
+ * Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
}
if (contents[0] != '\\') return; // demand that first char is a '\\'
- lyxerr.debug() << "Decode: " << contents << endl;
+ lyxerr[Debug::KEY] << "Decode: " << contents << endl;
remdot = false; plusasc = false; plusdesc = false;
break;
}
//ic = (modtype == DOT_LESS_J ? 'j' : 'i');
- lyxerr.debug() << "Contents: [" << contents << "]"
- << ", ic: " << ic
- << ", top: " << plusasc
- << ", bot: " << plusdesc
- << ", dot: " << remdot
- << ", mod: " << modtype << endl;
+ lyxerr[Debug::KEY] << "Contents: [" << contents << "]"
+ << ", ic: " << ic
+ << ", top: " << plusasc
+ << ", bot: " << plusdesc
+ << ", dot: " << remdot
+ << ", mod: " << modtype << endl;
// Special case for space
} else if (contents[3] == '}') {
ic = ' ';
if (contents[++i] != '}' && contents[++i]) return;
// fine, the char is properly decoded now (hopefully)
- lyxerr.debug() << "Contents: [" << contents << "]"
- << ", ic: " << ic
- << ", top: " << plusasc
- << ", bot: " << plusdesc
- << ", dot: " << remdot
- << ", mod: " << modtype << endl;
+ lyxerr[Debug::KEY] << "Contents: [" << contents << "]"
+ << ", ic: " << ic
+ << ", top: " << plusasc
+ << ", bot: " << plusdesc
+ << ", dot: " << remdot
+ << ", mod: " << modtype << endl;
}
candisp = true;
}
float tmpx = 0;
if (font.shape() == LyXFont::ITALIC_SHAPE)
tmpx += (8.0 * hg) / 10.0; // italic
- lyxerr.debug() << "Removing dot." << endl;
+ lyxerr[Debug::KEY] << "Removing dot." << endl;
// remove the dot first
scr.fillRectangle(gc_clear, int(x + tmpx),
tmpvar, wid,
{
if(!table) return;
for(kb_key * t = table; t->code != NoSymbol; ++t)
- if(t->table)
+ if(t->table) // DEL LINE
delete t->table;
delete table;
}
///
- ~kb_sequence()
- {
- if (sequence != staticseq) {
- delete sequence;
- delete modifiers;
- }
+ ~kb_sequence() {
+ if (sequence != staticseq) {
+ delete sequence;
+ delete modifiers;
}
+ }
/// Add a key to the key sequence and look it up in the curmap
/** Add a key to the key sequence and look it up in the curmap
{
// Lyxserver was created in this class so should be destroyed
// here. asierra-970604
- if (lyxserver) {
+ if (lyxserver) { // DEL LINE
delete lyxserver;
lyxserver = 0;
- }
+ } // DEL LINE
CloseLyXLookup();
}
// A destructor is always necessary (asierra-970604)
LyX::~LyX()
{
- if (lastfiles)
+ if (lastfiles) // DEL LINE
delete lastfiles;
- if (lyxGUI)
+ if (lyxGUI) // DEL LINE
delete lyxGUI;
}
fl_hide_form(browser->LaTeXLog);
fl_free_form(browser->LaTeXLog);
}
- if (vcs) {
+ if (vcs) { // DEL LINE
delete vcs;
- }
+ } // DEL LINE
}
///
~MathedRowSt() {
delete[] w;
- if (label) delete[] label;
+ if (label) // DEL LINE
+ delete[] label;
}
/// Should be const but...
MathedRowSt * getNext() const { return next; }
MathAccentInset::~MathAccentInset()
{
- if (inset)
+ if (inset) // DEL LINE
delete inset;
}
Reset();
while (OK()) {
if (IsInset()) {
- MathedInset* inset = GetInset();
+ MathedInset * inset = GetInset();
if (inset->GetType()!= LM_OT_MACRO_ARG)
delete inset;
Delete();
crow = r;
} else {
Delete();
- pos2--;
+ --pos2;
}
}
Next();
BitmapMenu::~BitmapMenu()
{
- if (next) delete next;
+ if (next) // DEL LINE
+ delete next;
if (form->visible) Hide();
fl_free_form(form);
delete[] bitmap;
os << "\n\\begin_float "
<< string_footnotekinds[footnotekind]
<< " ";
- }
- else {
+ } else {
os << "\n\\end_float ";
}
}
os << "\n\\begin_deeper ";
++dth;
}
- }
- else {
+ } else {
while (depth < dth) {
os << "\n\\end_deeper ";
--dth;
}
os << '\n';
}
- }
- else {
+ } else {
// Dummy layout. This means that a footnote ended.
os << "\n\\end_float ";
footflag = LyXParagraph::NO_FOOTNOTE;
while (insettable) {
tmpinset = insettable;
insettable = insettable->next;
- if (tmpinset->inset)
+ if (tmpinset->inset) // DEL LINE
delete tmpinset->inset;
delete tmpinset;
if (insettable && insettable->next == insettable) {
// somehow this recursion appears occasionally
// but I can't find where. This bandaid
// helps but isn't the best fix. (ARRae)
- if (insettable->inset) {
+ if (insettable->inset) { // DEL LINE
delete insettable->inset;
}
delete insettable;
#endif
/* table stuff -- begin*/
- if (table)
+ if (table) // DEL LINE
delete table;
/* table stuff -- end*/
// ale970302
- if (bibkey)
+ if (bibkey) // DEL LINE
delete bibkey;
}
tmpi = tmpi->next;
}
if (tmpi) { // this should always be true
- if (tmpi->inset) // delete the inset if it exists
+ if (tmpi->inset) // delete the inset if it exists // DEL LINE
delete tmpi->inset;
if (tmpi == insettable)
insettable = tmpi->next;
for (InsetList::iterator it = insetlist.begin();
it != insetlist.end(); ++it) {
if ((*it).pos >= pos) {
- if (it2 != insetlist.end() || (*it).pos < (*it2).pos)
+ if (it2 == insetlist.end() || (*it).pos < (*it2).pos)
it2 = it;
}
}
misses = static_cast<char**>(0);
}
~isp_result() {
- if (misses) delete[] misses;
+ if (misses) // DEL LINE
+ delete[] misses;
}
};
{
delete nullstream.rdbuf(0); // Without this we leak
delete rdbuf(0); // Without this we leak
- if (internal)
+ if (internal) // DEL LINE
delete internal;
}
row = 0;
column = 0;
- if (rowofcell)
+ if (rowofcell) // DEL LINE
delete [] rowofcell;
rowofcell = new int[numberofcells];
- if (columnofcell)
+ if (columnofcell) // DEL LINE
delete [] columnofcell;
columnofcell = new int[numberofcells];