Converted '#warning ...' into FIXME-comments

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19397 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Christian Ridderström 2007-08-10 11:47:12 +00:00
parent 35fa399edd
commit 1050cc4471
27 changed files with 43 additions and 121 deletions

View File

@ -1613,9 +1613,7 @@ bool Buffer::isUnnamed() const
}
#ifdef WITH_WARNINGS
#warning this function should be moved to buffer_pimpl.C
#endif
// FIXME: this function should be moved to buffer_pimpl.C
void Buffer::markDirty()
{
if (pimpl_->lyx_clean) {

View File

@ -349,9 +349,8 @@ docstring Counters::counterLabel(docstring const & format)
{
docstring label = format;
while (true) {
#ifdef WITH_WARNINGS
#warning Using boost::regex or boost::spirit would make this code a lot simpler... (Lgb)
#endif
// FIXME: Using boost::regex or boost::spirit would make
// FIXME: this code a lot simpler... (Lgb)
size_t const i = label.find('\\', 0);
if (i == docstring::npos)

View File

@ -512,9 +512,7 @@ void Cursor::setSelection()
{
selection() = true;
// A selection with no contents is not a selection
#ifdef WITH_WARNINGS
#warning doesnt look ok
#endif
// FIXME: doesnt look ok
if (pit() == anchor().pit() && pos() == anchor().pos())
selection() = false;
}
@ -1012,9 +1010,7 @@ InsetMathUnknown * Cursor::activeMacro()
void Cursor::pullArg()
{
#ifdef WITH_WARNINGS
#warning Look here
#endif
// FIXME: Look here
MathData ar = cell();
if (popLeft() && inMathed()) {
plainErase();
@ -1028,9 +1024,7 @@ void Cursor::pullArg()
void Cursor::touch()
{
#ifdef WITH_WARNINGS
#warning look here
#endif
// FIXME: look here
#if 0
DocIterator::const_iterator it = begin();
DocIterator::const_iterator et = end();

View File

@ -1598,9 +1598,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
theApp()->updateColor(lcolor.getFromLyXName(lyx_name));
if (graphicsbg_changed) {
#ifdef WITH_WARNINGS
#warning FIXME!! The graphics cache no longer has a changeDisplay method.
#endif
// FIXME: The graphics cache no longer has a changeDisplay method.
#if 0
graphics::GCache::get().changeDisplay(true);
#endif

View File

@ -67,9 +67,7 @@ ParIterator ParIterator::operator++(int)
// should not be compiled/used. (Lgb)
ParIterator & ParIterator::operator--()
{
#ifdef WITH_WARNINGS
#warning look here
#endif
// FIXME: look here
// DocIterator::backwardPar();
return *this;
}
@ -179,9 +177,7 @@ bool operator!=(ParConstIterator const & iter1, ParConstIterator const & iter2)
}
#ifdef WITH_WARNINGS
#warning const correctness!
#endif
// FIXME: const correctness!
ParConstIterator par_const_iterator_begin(Inset const & inset)
{

View File

@ -751,12 +751,10 @@ void Paragraph::Pimpl::simpleTeXSpecialChars(Buffer const & buf,
close = true;
}
#ifdef WITH_WARNINGS
#warning Bug: we can have an empty font change here!
// FIXME: Bug: we can have an empty font change here!
// if there has just been a font change, we are going to close it
// right now, which means stupid latex code like \textsf{}. AFAIK,
// this does not harm dvi output. A minor bug, thus (JMarc)
#endif
// Some insets cannot be inside a font change command.
// However, even such insets *can* be placed in \L or \R
// or their equivalents (for RTL language switches), so we don't
@ -2168,11 +2166,9 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf,
runparams, basefont, basefont);
}
#else
#ifdef WITH_WARNINGS
//#warning For now we ALWAYS have to close the foreign font settings if they are
//#warning there as we start another \selectlanguage with the next paragraph if
//#warning we are in need of this. This should be fixed sometime (Jug)
#endif
//FIXME: For now we ALWAYS have to close the foreign font settings if they are
//FIXME: there as we start another \selectlanguage with the next paragraph if
//FIXME: we are in need of this. This should be fixed sometime (Jug)
running_font.latexWriteEndChanges(os, bparams, runparams,
basefont, basefont);
#endif
@ -2404,9 +2400,7 @@ Paragraph::getParLanguage(BufferParams const & bparams) const
{
if (!empty())
return getFirstFontSettings(bparams).language();
#ifdef WITH_WARNINGS
#warning FIXME we should check the prev par as well (Lgb)
#endif
// FIXME: we should check the prev par as well (Lgb)
return bparams.language;
}

View File

@ -523,9 +523,7 @@ int Text::leftMargin(Buffer const & buffer, int max_width,
// row in this paragraph.
RowList::iterator rit = par.rows().begin();
RowList::iterator end = par.rows().end();
#ifdef WITH_WARNINGS
#warning This is wrong.
#endif
// FIXME: This is wrong.
int minfill = max_width;
for ( ; rit != end; ++rit)
if (rit->fill() < minfill)

View File

@ -150,9 +150,7 @@ Font Text::getFont(Buffer const & buffer, Paragraph const & par,
BOOST_ASSERT(pos >= 0);
Layout_ptr const & layout = par.layout();
#ifdef WITH_WARNINGS
#warning broken?
#endif
// FIXME: broken?
BufferParams const & params = buffer.params();
pos_type const body_pos = par.beginOfBody();
@ -1147,12 +1145,10 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
&& oldpar.isLineSeparator(old.pos() - 1)
&& !oldpar.isDeleted(old.pos() - 1)) {
oldpar.eraseChar(old.pos() - 1, cur.buffer().params().trackChanges);
#ifdef WITH_WARNINGS
#warning This will not work anymore when we have multiple views of the same buffer
// FIXME: This will not work anymore when we have multiple views of the same buffer
// In this case, we will have to correct also the cursors held by
// other bufferviews. It will probably be easier to do that in a more
// automated way in CursorSlice code. (JMarc 26/09/2001)
#endif
// correct all cursor parts
if (same_par) {
fixCursorAfterDelete(cur.top(), old.top());
@ -1182,7 +1178,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
ParagraphList & plist = old.text()->paragraphs();
plist.erase(boost::next(plist.begin(), old.pit()));
// see #warning above
// see #warning (FIXME?) above
if (cur.depth() >= old.depth()) {
CursorSlice & curslice = cur[old.depth() - 1];
if (&curslice.inset() == &old.inset()

View File

@ -396,10 +396,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
Paragraph & par = cur.paragraph();
bool start = !par.params().startOfAppendix();
#ifdef WITH_WARNINGS
#warning The code below only makes sense at top level.
// FIXME: The code below only makes sense at top level.
// Should LFUN_APPENDIX be restricted to top-level paragraphs?
#endif
// ensure that we have only one start_of_appendix in this document
// FIXME: this don't work for multipart document!
for (pit_type tmp = 0, end = pars_.size(); tmp != end; ++tmp) {
@ -655,9 +653,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
case LFUN_DELETE_BACKWARD_SKIP:
// Reverse the effect of LFUN_BREAK_PARAGRAPH_SKIP.
if (!cur.selection()) {
#ifdef WITH_WARNINGS
#warning look here
#endif
// FIXME: look here
//CursorSlice cur = cursor();
backspace(cur);
//anchor() = cur;

View File

@ -244,7 +244,7 @@ int Trans::load(Lexer & lex)
return -1;
#if 1
//#warning This code should be removed...
// FIXME: This code should be removed...
// But we need to fix up all the kmap files first
// so that this field is not present anymore.
if (lex.next(true)) {

View File

@ -538,9 +538,7 @@ Inset * readInset(Lexer & lex, Buffer const & buf)
inset->read(buf, lex);
#ifdef WITH_WARNINGS
#warning hack..
#endif
// FIXME: hack..
if (inset->lyxCode() == Inset::MATHMACRO_CODE) {
MathMacroTemplate const * tmpl =
static_cast<MathMacroTemplate*>(inset.get());

View File

@ -666,9 +666,7 @@ void PrefDisplay::apply(LyXRC & rc) const
}
rc.display_graphics = dtype;
#ifdef WITH_WARNINGS
#warning FIXME!! The graphics cache no longer has a changeDisplay method.
#endif
// FIXME!! The graphics cache no longer has a changeDisplay method.
#if 0
if (old_value != rc.display_graphics) {
lyx::graphics::GCache & gc = lyx::graphics::GCache::get();

View File

@ -131,9 +131,7 @@ void QWrap::apply()
static string const numtostr(double val)
{
string a = convert<string>(val);
#ifdef WITH_WARNINGS
#warning Will this test ever trigger? (Lgb)
#endif
// FIXME: Will this test ever trigger? (Lgb)
if (a == "0")
a.erase();
return a;

View File

@ -284,9 +284,7 @@ graphics::Params InsetGraphicsParams::as_grfxParams() const
string const tmp = readBB_from_PSFile(filename);
LYXERR(Debug::GRAPHICS) << "BB_from_File: " << tmp << std::endl;
if (!tmp.empty()) {
#ifdef WITH_WARNINGS
# warning why not convert to unsigned int? (Lgb)
#endif
// FIXME: why not convert to unsigned int? (Lgb)
unsigned int const bb_orig_xl = convert<int>(token(tmp, ' ', 0));
unsigned int const bb_orig_yb = convert<int>(token(tmp, ' ', 1));

View File

@ -506,13 +506,11 @@ int InsetInclude::latex(Buffer const & buffer, odocstream & os,
tmp->markDepClean(m_buffer->temppath());
#ifdef WITH_WARNINGS
#warning handle non existing files
#warning Second argument is irrelevant!
// FIXME: handle non existing files
// FIXME: Second argument is irrelevant!
// since only_body is true, makeLaTeXFile will not look at second
// argument. Should we set it to string(), or should makeLaTeXFile
// make use of it somehow? (JMarc 20031002)
#endif
// The included file might be written in a different encoding
Encoding const * const oldEnc = runparams.encoding;
runparams.encoding = &tmp->params().encoding();

View File

@ -3797,9 +3797,7 @@ int InsetTabular::docbook(Buffer const & buf, odocstream & os,
int ret = 0;
Inset * master = 0;
#ifdef WITH_WARNINGS
#warning Why not pass a proper DocIterator here?
#endif
// FIXME: Why not pass a proper DocIterator here?
#if 0
// if the table is inside a float it doesn't need the informaltable
// wrapper. Search for it.
@ -4290,9 +4288,7 @@ void InsetTabular::tabularFeatures(Cursor & cur,
case Tabular::MULTICOLUMN: {
if (sel_row_start != sel_row_end) {
#ifdef WITH_WARNINGS
#warning Need I say it ? This is horrible.
#endif
// FIXME: Need I say it ? This is horrible.
// FIXME UNICODE
Alert::error(_("Error setting multicolumn"),
_("You cannot set multicolumn vertically."));

View File

@ -60,9 +60,7 @@ void Inset.heorem::write(Buffer const * buf, ostream & os) const
auto_ptr<Inset> Inset.heorem::doClone() const
{
#ifdef WITH_WARNINGS
#warning Is this inset used? If YES this is WRONG!!! (Jug)
#endif
// FIXME: Is this inset used? If YES this is WRONG!!! (Jug)
auto_ptr<Inset.heorem> result(new InsetTheorem);
result->setCollapsed(!isOpen());

View File

@ -156,9 +156,7 @@ void InsetFormulaMacro::draw(PainterInfo & p, int x, int y) const
pi.pain.fillRectangle(x, a, w, h, Color::mathmacrobg);
pi.pain.rectangle(x, a, w, h, Color::mathframe);
#ifdef WITH_WARNINGS
#warning FIXME
#endif
// FIXME
#if 0
Cursor & cur = p.base.bv->cursor();
if (cur.isInside(this))

View File

@ -57,21 +57,16 @@ void InsetMath::dump() const
void InsetMath::metricsT(TextMetricsInfo const &, Dimension &) const
{
#ifdef WITH_WARNINGS
lyxerr << "InsetMath::metricsT(Text) called directly!" << endl;
#endif
}
void InsetMath::drawT(TextPainter &, int, int) const
{
#ifdef WITH_WARNINGS
lyxerr << "InsetMath::drawT(Text) called directly!" << endl;
#endif
}
void InsetMath::write(WriteStream & os) const
{
docstring const s = name();

View File

@ -972,8 +972,7 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
extra = from_ascii("noextra");
std::string const lang = to_ascii(dlang);
#ifdef WITH_WARNINGS
#warning temporarily disabled
// FIXME: temporarily disabled
//if (cur.selection()) {
// MathData ar;
// selGet(cur.ar);
@ -981,7 +980,6 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
// insert(pipeThroughExtern(lang, extra, ar));
// return;
//}
#endif
MathData eq;
eq.push_back(MathAtom(new InsetMathChar('=')));
@ -1028,9 +1026,7 @@ void InsetMathHull::doExtern(Cursor & cur, FuncRequest & func)
cur.pos() = 0;
MathData ar = cur.cell();
lyxerr << "use cell: " << ar << endl;
#ifdef WITH_WARNINGS
#warning temporarily disabled
#endif
// FIXME: temporarily disabled
addRow(cur.row());
++cur.idx();
++cur.idx();
@ -1386,9 +1382,7 @@ Inset::Code InsetMathHull::lyxCode() const
bool InsetMathHull::searchForward(BufferView * bv, string const & str,
bool, bool)
{
#ifdef WITH_WARNINGS
#warning completely broken
#endif
// FIXME: completely broken
static InsetMathHull * lastformula = 0;
static CursorBase current = DocIterator(ibegin(nucleus()));
static MathData ar;

View File

@ -369,9 +369,7 @@ bool InsetMathNest::setMouseHover(bool mouse_hover)
bool InsetMathNest::notifyCursorLeaves(Cursor & /*cur*/)
{
#ifdef WITH_WARNINGS
#warning look here
#endif
// FIXME: look here
#if 0
MathData & ar = cur.cell();
// remove base-only "scripts"

View File

@ -160,11 +160,9 @@ void MathData::replace(ReplaceData & rep)
}
}
#ifdef WITH_WARNINGS
#warning temporarily disabled
// FIXME: temporarily disabled
// for (const_iterator it = begin(); it != end(); ++it)
// it->nucleus()->replace(rep);
#endif
}

View File

@ -159,9 +159,7 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const
//pi.pain.fillRectangle(x, a, w, h, Color::mathmacrobg);
pi.pain.rectangle(x, a, w, h, Color::mathframe);
#ifdef WITH_WARNINGS
#warning FIXME
#endif
// FIXME:
#if 0
Cursor & cur = p.base.bv->cursor();
if (cur.isInside(this))

View File

@ -1254,9 +1254,7 @@ void Parser::parse1(InsetMathGrid & grid, unsigned flags,
}
else if (t.cs() == "kern") {
#ifdef WITH_WARNINGS
#warning A hack...
#endif
// FIXME: A hack...
docstring s;
while (true) {
Token const & t = getToken();

View File

@ -38,9 +38,7 @@ bool lyx::support::chmod(FileName const & file, unsigned long int mode)
if (::chmod(file.toFilesystemEncoding().c_str(), mode_t(mode)) != 0)
return false;
#else
# ifdef WITH_WARNINGS
# warning "File permissions are ignored on this system."
# endif
// FIXME: "File permissions are ignored on this system."
#endif
return true;
}

View File

@ -1178,9 +1178,7 @@ void readBB_lyxerrMessage(FileName const & file, bool & zipped,
{
LYXERR(Debug::GRAPHICS) << "[readBB_from_PSFile] "
<< message << std::endl;
#ifdef WITH_WARNINGS
#warning Why is this func deleting a file? (Lgb)
#endif
// FIXME: Why is this func deleting a file? (Lgb)
if (zipped)
unlink(file);
}

View File

@ -41,9 +41,7 @@ int mkdir(FileName const & pathname, unsigned long int mode)
# if MKDIR_TAKES_ONE_ARG
// MinGW32
return ::mkdir(pathname.toFilesystemEncoding().c_str());
# ifdef WITH_WARNINGS
# warning "Permissions of created directories are ignored on this system."
# endif
// FIXME: "Permissions of created directories are ignored on this system."
# else
// POSIX
return ::mkdir(pathname.toFilesystemEncoding().c_str(), mode_t(mode));
@ -51,14 +49,10 @@ int mkdir(FileName const & pathname, unsigned long int mode)
#elif defined(_WIN32)
// plain Windows 32
return CreateDirectory(pathname.toFilesystemEncoding().c_str(), 0) != 0 ? 0 : -1;
# ifdef WITH_WARNINGS
# warning "Permissions of created directories are ignored on this system."
# endif
// FIXME: "Permissions of created directories are ignored on this system."
#elif HAVE__MKDIR
return ::_mkdir(pathname.toFilesystemEncoding().c_str());
# ifdef WITH_WARNINGS
# warning "Permissions of created directories are ignored on this system."
# endif
// FIXME: "Permissions of created directories are ignored on this system."
#else
# error "Don't know how to create a directory on this system."
#endif