From 1050cc44714f8b78e233d6a559ead3d7a8b6aa56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ridderstr=C3=B6m?= Date: Fri, 10 Aug 2007 11:47:12 +0000 Subject: [PATCH] Converted '#warning ...' into FIXME-comments git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19397 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 4 +--- src/Counters.cpp | 5 ++--- src/Cursor.cpp | 12 +++--------- src/LyXFunc.cpp | 4 +--- src/ParIterator.cpp | 8 ++------ src/Paragraph.cpp | 16 +++++----------- src/Text.cpp | 4 +--- src/Text2.cpp | 10 +++------- src/Text3.cpp | 8 ++------ src/Trans.cpp | 2 +- src/factory.cpp | 4 +--- src/frontends/qt4/QPrefs.cpp | 4 +--- src/frontends/qt4/QWrap.cpp | 4 +--- src/insets/InsetGraphicsParams.cpp | 4 +--- src/insets/InsetInclude.cpp | 6 ++---- src/insets/InsetTabular.cpp | 8 ++------ src/insets/InsetTheorem.cpp | 4 +--- src/mathed/InsetFormulaMacro.cpp | 4 +--- src/mathed/InsetMath.cpp | 5 ----- src/mathed/InsetMathHull.cpp | 12 +++--------- src/mathed/InsetMathNest.cpp | 4 +--- src/mathed/MathData.cpp | 4 +--- src/mathed/MathMacroTemplate.cpp | 4 +--- src/mathed/MathParser.cpp | 4 +--- src/support/copy.cpp | 4 +--- src/support/filetools.cpp | 4 +--- src/support/mkdir.cpp | 12 +++--------- 27 files changed, 43 insertions(+), 121 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 8a52b65bc7..9777f3bd9b 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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) { diff --git a/src/Counters.cpp b/src/Counters.cpp index a3db807959..ac7c68394d 100644 --- a/src/Counters.cpp +++ b/src/Counters.cpp @@ -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) diff --git a/src/Cursor.cpp b/src/Cursor.cpp index bb9b91dec6..7147f8152a 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -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(); diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index e724ed0c78..19fd449c9d 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -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 diff --git a/src/ParIterator.cpp b/src/ParIterator.cpp index 80f35de25f..867e86ca54 100644 --- a/src/ParIterator.cpp +++ b/src/ParIterator.cpp @@ -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) { diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index a07f33eca7..1ec43ed163 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -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; } diff --git a/src/Text.cpp b/src/Text.cpp index f454a2fc60..c1dfaf15d2 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -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) diff --git a/src/Text2.cpp b/src/Text2.cpp index 7b1206a96c..ba0b09fe92 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -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() diff --git a/src/Text3.cpp b/src/Text3.cpp index 3c3b937993..7231f07cfa 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -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; diff --git a/src/Trans.cpp b/src/Trans.cpp index b3cc6d97fe..3105a40c36 100644 --- a/src/Trans.cpp +++ b/src/Trans.cpp @@ -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)) { diff --git a/src/factory.cpp b/src/factory.cpp index a30aba41dd..fc6468056b 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -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(inset.get()); diff --git a/src/frontends/qt4/QPrefs.cpp b/src/frontends/qt4/QPrefs.cpp index b7b446b1cb..744bc4bc51 100644 --- a/src/frontends/qt4/QPrefs.cpp +++ b/src/frontends/qt4/QPrefs.cpp @@ -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(); diff --git a/src/frontends/qt4/QWrap.cpp b/src/frontends/qt4/QWrap.cpp index f2fff95e03..dca6f212f9 100644 --- a/src/frontends/qt4/QWrap.cpp +++ b/src/frontends/qt4/QWrap.cpp @@ -131,9 +131,7 @@ void QWrap::apply() static string const numtostr(double val) { string a = convert(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; diff --git a/src/insets/InsetGraphicsParams.cpp b/src/insets/InsetGraphicsParams.cpp index b7d97400b8..6478228bd5 100644 --- a/src/insets/InsetGraphicsParams.cpp +++ b/src/insets/InsetGraphicsParams.cpp @@ -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(token(tmp, ' ', 0)); unsigned int const bb_orig_yb = convert(token(tmp, ' ', 1)); diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 90f776e215..16f46f7bb7 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -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(); diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index e89f59af84..b352e9566d 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -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.")); diff --git a/src/insets/InsetTheorem.cpp b/src/insets/InsetTheorem.cpp index 8e663a4310..7927d2ce3d 100644 --- a/src/insets/InsetTheorem.cpp +++ b/src/insets/InsetTheorem.cpp @@ -60,9 +60,7 @@ void Inset.heorem::write(Buffer const * buf, ostream & os) const auto_ptr 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 result(new InsetTheorem); result->setCollapsed(!isOpen()); diff --git a/src/mathed/InsetFormulaMacro.cpp b/src/mathed/InsetFormulaMacro.cpp index 6e5b65a7ec..c0148fcac2 100644 --- a/src/mathed/InsetFormulaMacro.cpp +++ b/src/mathed/InsetFormulaMacro.cpp @@ -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)) diff --git a/src/mathed/InsetMath.cpp b/src/mathed/InsetMath.cpp index fe22ce7825..855b4902e9 100644 --- a/src/mathed/InsetMath.cpp +++ b/src/mathed/InsetMath.cpp @@ -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(); diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 17e83d5e7b..38d6c7a305 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -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; diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 078989809e..5955bd66e2 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -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" diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp index a911cc839a..67be300ef9 100644 --- a/src/mathed/MathData.cpp +++ b/src/mathed/MathData.cpp @@ -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 } diff --git a/src/mathed/MathMacroTemplate.cpp b/src/mathed/MathMacroTemplate.cpp index e6e439163b..e0fc3d63c6 100644 --- a/src/mathed/MathMacroTemplate.cpp +++ b/src/mathed/MathMacroTemplate.cpp @@ -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)) diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index 255dbadc9e..3063d7a200 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -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(); diff --git a/src/support/copy.cpp b/src/support/copy.cpp index 15b674ccdc..0516870954 100644 --- a/src/support/copy.cpp +++ b/src/support/copy.cpp @@ -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; } diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp index 6e255d277e..fe5d73b34a 100644 --- a/src/support/filetools.cpp +++ b/src/support/filetools.cpp @@ -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); } diff --git a/src/support/mkdir.cpp b/src/support/mkdir.cpp index a7dae33d2a..410c05722b 100644 --- a/src/support/mkdir.cpp +++ b/src/support/mkdir.cpp @@ -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