From 68b7ef25fb7d2da230d3eb11d6737701abfc2e64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Sat, 3 Apr 2004 08:37:12 +0000 Subject: [PATCH] simple ws changes only git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8594 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Bidi.h | 4 +- src/BufferView.C | 2 +- src/BufferView.h | 4 +- src/BufferView_pimpl.C | 6 +-- src/CutAndPaste.C | 6 +-- src/FontIterator.C | 2 +- src/FontIterator.h | 2 +- src/InsetList.h | 2 +- src/LColor.C | 8 ++-- src/LaTeXFeatures.C | 4 +- src/ParagraphList_fwd.h | 4 +- src/ParagraphParameters.C | 1 - src/buffer.C | 2 +- src/bufferparams.C | 4 +- src/cursor.C | 6 +-- src/cursor.h | 8 ++-- src/dociterator.C | 15 ++++---- src/dociterator.h | 2 +- src/factory.C | 2 +- src/frontends/controllers/ControlCitation.C | 6 +-- src/frontends/controllers/ControlDocument.C | 26 ++++++------- src/frontends/controllers/ControlPrefs.C | 6 +-- src/frontends/controllers/ControlPrint.C | 2 +- .../controllers/ControlSpellchecker.C | 4 +- src/frontends/controllers/Kernel.h | 2 +- src/frontends/gnome/Dialogs3.C | 2 +- src/frontends/gnome/GPreamble.C | 6 +-- src/frontends/gnome/GView.h | 2 +- src/frontends/gnome/GnomeBase.h | 2 +- src/frontends/gnome/gnome_helpers.C | 1 - src/frontends/gtk/GXpmBtnTbl.C | 4 +- src/frontends/qt2/QBibtex.C | 12 +++--- src/frontends/qt2/QCitation.C | 16 ++++---- src/frontends/qt2/QCitationDialog.C | 2 +- src/frontends/qt2/QFloatDialog.C | 2 +- src/frontends/qt2/QRef.C | 20 +++++----- src/frontends/qt2/QRef.h | 2 +- src/frontends/qt2/QVSpaceDialog.C | 1 - src/frontends/qt2/QWorkArea.C | 30 +++++++-------- src/frontends/qt2/checkedwidgets.C | 6 +-- src/frontends/qt2/floatplacement.C | 2 +- src/frontends/qt2/lyx_gui.C | 6 +-- src/frontends/qt2/qfont_loader.C | 12 +++--- src/frontends/screen.C | 2 +- src/frontends/xforms/FormBibtex.C | 14 +++---- src/frontends/xforms/FormBox.C | 1 - src/frontends/xforms/FormCitation.C | 4 +- src/frontends/xforms/FormDocument.C | 14 +++---- src/frontends/xforms/FormDocument.h | 2 +- src/frontends/xforms/FormExternal.C | 12 +++--- src/frontends/xforms/FormFloat.C | 4 +- src/frontends/xforms/FormMathsDelim.C | 2 +- src/frontends/xforms/FormSearch.C | 2 +- src/frontends/xforms/xforms_helpers.C | 4 +- src/funcrequest.C | 6 +-- src/insets/ExternalTransforms.C | 2 +- src/insets/insetbase.h | 16 ++++---- src/insets/insetbibtex.C | 15 ++++---- src/insets/insetbox.C | 2 +- src/insets/insetcharstyle.C | 2 +- src/insets/insetcite.C | 12 +++--- src/insets/insetcollapsable.C | 2 +- src/insets/insetcollapsable.h | 2 +- src/insets/insetcommand.C | 2 +- src/insets/insetcommandparams.C | 6 +-- src/insets/insetfloat.C | 6 +-- src/insets/insettabular.C | 7 ++-- src/insets/insettext.h | 2 +- src/insets/insetwrap.C | 2 +- src/lyxfind.C | 2 - src/lyxfunc.C | 8 ++-- src/lyxlex.C | 1 - src/lyxrc.C | 4 +- src/lyxrow.C | 1 - src/lyxsocket.h | 2 +- src/lyxtext.h | 8 ++-- src/mathed/math_colorinset.C | 2 +- src/mathed/math_diminset.h | 2 +- src/mathed/math_mboxinset.h | 4 +- src/mathed/math_nestinset.C | 4 +- src/mathed/math_scriptinset.C | 2 +- src/mathed/ref_inset.C | 2 +- src/output_docbook.C | 37 +++++++++---------- src/output_linuxdoc.C | 4 +- src/output_linuxdoc.h | 2 +- src/paragraph.C | 2 - src/paragraph_funcs.C | 2 +- src/paragraph_funcs.h | 2 +- src/sgml.h | 2 +- src/support/forkedcontr.h | 2 +- src/text.C | 10 ++--- src/text2.C | 16 ++++---- src/text3.C | 14 +++---- src/undo.C | 2 +- src/undo.h | 2 +- src/vspace.C | 8 ++-- 96 files changed, 267 insertions(+), 283 deletions(-) diff --git a/src/Bidi.h b/src/Bidi.h index d556bc8944..cad9891de4 100644 --- a/src/Bidi.h +++ b/src/Bidi.h @@ -46,8 +46,8 @@ struct Bidi { /// void computeTables(Paragraph const & par, Buffer const &, Row const & row); -private: - /// +private: + /// bool same_direction_; /// std::vector log2vis_list_; diff --git a/src/BufferView.C b/src/BufferView.C index e1176d8f32..9a73624ef4 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -405,7 +405,7 @@ void BufferView::putSelectionAt(DocIterator const & cur, LyXText & text = *cur[0].text(); setCursor(par, cur.pos()); - + // hack for the chicken and egg problem top_y(text.getPar(par.outerPar()).y); diff --git a/src/BufferView.h b/src/BufferView.h index a7f3c952d5..11df875780 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -115,7 +115,7 @@ public: /// return the parent language of the given inset Language const * getParentLanguage(InsetOld * inset) const; - /// simple replacing. Use the font of the first selected character + /// simple replacing. Use the font of the first selected character void replaceSelectionWithString(std::string const & str); /// move cursor to the named label @@ -163,7 +163,7 @@ public: FuncStatus getStatus(FuncRequest const & cmd); /// execute the given function bool dispatch(FuncRequest const & argument); - + /// clear the X selection void unsetXSel(); diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index 20fefddfd6..50c5ea8b5e 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -878,7 +878,7 @@ bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & cmd0) lyxerr << "created temp cursor:\n" << cur << endl; // Try to dispatch to an non-editable inset near this position - // via the temp cursor. If the inset wishes to change the real + // via the temp cursor. If the inset wishes to change the real // cursor it has to do so explicitly by using // cur.bv().cursor() = cur; (or similar)' DispatchResult res; @@ -890,7 +890,7 @@ bool BufferView::Pimpl::workAreaDispatch(FuncRequest const & cmd0) if (!res.dispatched()) res = cur.dispatch(cmd); - // If the request was dispatched the temp cursor should have been + // If the request was dispatched the temp cursor should have been // in a way to be used as new 'real' cursor. if (res.dispatched()) bv_->cursor() = cur; @@ -924,7 +924,7 @@ FuncStatus BufferView::Pimpl::getStatus(FuncRequest const & cmd) Buffer * buf = bv_->buffer(); FuncStatus flag; - + switch (cmd.action) { case LFUN_UNDO: diff --git a/src/CutAndPaste.C b/src/CutAndPaste.C index f5d263ef8a..8202bb0ed4 100644 --- a/src/CutAndPaste.C +++ b/src/CutAndPaste.C @@ -84,7 +84,7 @@ int SwitchLayoutsBetweenClasses(textclass_type c1, textclass_type c2, InsetText in; std::swap(in.paragraphs(), pars); - + ParIterator end = par_iterator_end(in); for (ParIterator it = par_iterator_begin(in); it != end; ++it) { string const name = it->layout()->name(); @@ -330,7 +330,7 @@ pasteSelection(Buffer const & buffer, ParagraphList & pars, } } std::swap(in.paragraphs(), insertion); - + // Split the paragraph for inserting the buf if necessary. bool did_split = false; if (pars[pit].size() || pit + 1 == par_type(pars.size())) { @@ -343,7 +343,7 @@ pasteSelection(Buffer const & buffer, ParagraphList & pars, mergeParagraph(buffer.params(), pars, pit); par_type last_paste = pit + insertion.size() - 1; - + // Store the new cursor position. pit = last_paste; pos = pars[last_paste].size(); diff --git a/src/FontIterator.C b/src/FontIterator.C index f4fe4ade5c..ad185696b8 100644 --- a/src/FontIterator.C +++ b/src/FontIterator.C @@ -6,7 +6,7 @@ * \author Alfredo Braunstein * * Full author contact details are available in file CREDITS. - * + * */ diff --git a/src/FontIterator.h b/src/FontIterator.h index e52c67b175..7d0250bd4d 100644 --- a/src/FontIterator.h +++ b/src/FontIterator.h @@ -32,7 +32,7 @@ class FontIterator : std::iterator public: /// FontIterator(LyXText const & text, lyx::par_type pit, lyx::pos_type pos); - /// + /// LyXFont operator*() const; /// FontIterator & operator++(); diff --git a/src/InsetList.h b/src/InsetList.h index 7c0e150b22..9a2ed973c8 100644 --- a/src/InsetList.h +++ b/src/InsetList.h @@ -52,7 +52,7 @@ public: /// bool empty() const { return list.empty(); } /// - iterator insetIterator(lyx::pos_type pos); + iterator insetIterator(lyx::pos_type pos); /// const_iterator insetIterator(lyx::pos_type pos) const; /// diff --git a/src/LColor.C b/src/LColor.C index e515ed5dc8..1642e4f6c3 100644 --- a/src/LColor.C +++ b/src/LColor.C @@ -223,7 +223,7 @@ bool LColor::setColor(LColor::color col, string const & x11name) << " may not be redefined" << endl; return false; } - + it->second.x11name = x11name; return true; } @@ -233,8 +233,8 @@ bool LColor::setColor(string const & lyxname, string const &x11name) { string const lcname = ascii_lowercase(lyxname); if (pimpl_->transform.find(lcname) == pimpl_->transform.end()) { - lyxerr[Debug::GUI] - << "LColor::setColor: Unknown color \"" + lyxerr[Debug::GUI] + << "LColor::setColor: Unknown color \"" << lyxname << '"' << endl; addColor(static_cast(pimpl_->infotab.size()), lcname); } @@ -267,7 +267,7 @@ LColor::color LColor::getFromLyXName(string const & lyxname) const { string const lcname = ascii_lowercase(lyxname); if (pimpl_->transform.find(lcname) == pimpl_->transform.end()) { - lyxerr << "LColor::getFromLyXName: Unknown color \"" + lyxerr << "LColor::getFromLyXName: Unknown color \"" << lyxname << '"' << endl; return none; } diff --git a/src/LaTeXFeatures.C b/src/LaTeXFeatures.C index 9120330be0..e7f52c7954 100644 --- a/src/LaTeXFeatures.C +++ b/src/LaTeXFeatures.C @@ -306,7 +306,7 @@ string const LaTeXFeatures::getPackages() const } packages << "]{natbib}\n"; } - + // bibtopic -- the dot provides the aux file naming which // LyX can detect. if (isRequired("bibtopic")) { @@ -420,7 +420,7 @@ string const LaTeXFeatures::getTClassPreamble() const if (isRequired(cs->name)) tcpreamble << cs->preamble; } - + return tcpreamble.str(); } diff --git a/src/ParagraphList_fwd.h b/src/ParagraphList_fwd.h index 8febea1383..a937a89180 100644 --- a/src/ParagraphList_fwd.h +++ b/src/ParagraphList_fwd.h @@ -16,13 +16,13 @@ class Paragraph; -class ParagraphList : public std::vector +class ParagraphList : public std::vector { public: /// typedef std::vector base_type; /// - ParagraphList(); + ParagraphList(); /// template ParagraphList(Iter beg, Iter end) diff --git a/src/ParagraphParameters.C b/src/ParagraphParameters.C index 757ab074f6..9f7343d5a1 100644 --- a/src/ParagraphParameters.C +++ b/src/ParagraphParameters.C @@ -304,4 +304,3 @@ bool operator==(ParagraphParameeters const & ps1, && ps1.leftindent == ps2.leftindent; } */ - diff --git a/src/buffer.C b/src/buffer.C index 6c1f27df81..d73a4b6764 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -647,7 +647,7 @@ bool Buffer::readFile(LyXLex & lex, string const & filename, par_type pit) " that it is probably corrupted."), filename)); } -#endif +#endif pimpl_->file_fully_loaded = true; return true; } diff --git a/src/bufferparams.C b/src/bufferparams.C index bad20e7492..a26ea38935 100644 --- a/src/bufferparams.C +++ b/src/bufferparams.C @@ -937,7 +937,7 @@ bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features, << features.getBabelOptions(); texrow.newline(); } - + // Now insert the LyX specific LaTeX commands... // The optional packages; @@ -1006,7 +1006,7 @@ bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features, lyxpreamble += bullets_def + "}\n\n"; // We try to load babel late, in case it interferes - // with other packages. + // with other packages. // Jurabib has to be called after babel, though. if (use_babel && !features.isRequired("jurabib")) { lyxpreamble += babelCall(language_options.str()) + '\n'; diff --git a/src/cursor.C b/src/cursor.C index 5b27a79b7c..ecb5c9837e 100644 --- a/src/cursor.C +++ b/src/cursor.C @@ -125,7 +125,7 @@ DispatchResult LCursor::dispatch(FuncRequest const & cmd0) BOOST_ASSERT(idx() <= lastidx()); BOOST_ASSERT(par() <= lastpar()); - // The common case is 'LFUN handled, need update', so make the + // The common case is 'LFUN handled, need update', so make the // LFUN handler's life easier by assuming this as default value. // The handler can reset the update and val flags if necessary. disp_.update(true); @@ -1112,7 +1112,7 @@ bool LCursor::bruteFind(int x, int y, int xlow, int xhigh, int ylow, int yhigh) { BOOST_ASSERT(!empty()); par_type beg, end; - CursorSlice bottom = operator[](0); + CursorSlice bottom = operator[](0); LyXText * text = bottom.text(); BOOST_ASSERT(text); getParsInRange(text->paragraphs(), ylow, yhigh, beg, end); @@ -1324,7 +1324,7 @@ Encoding const * LCursor::getEncoding() const CursorSlice const & sl = operator[](s); LyXText & text = *sl.text(); LyXFont font = text.getPar(sl.par()).getFont( - bv().buffer()->params(), sl.pos(), outerFont(sl.par(), text.paragraphs())); + bv().buffer()->params(), sl.pos(), outerFont(sl.par(), text.paragraphs())); return font.language()->encoding(); } diff --git a/src/cursor.h b/src/cursor.h index ad3cf1fbb8..4791212fd0 100644 --- a/src/cursor.h +++ b/src/cursor.h @@ -152,9 +152,9 @@ public: /// cache the absolute coordinate from the top inset void updatePos(); /// sets anchor to cursor position - void resetAnchor(); + void resetAnchor(); /// access to owning BufferView - BufferView & bv() const; + BufferView & bv() const; /// get some interesting description of top position void info(std::ostream & os) const; /// are we in math mode (2), text mode (1) or unsure (0)? @@ -182,8 +182,8 @@ public: //private: /// the anchor position DocIterator anchor_; - - /// + + /// DispatchResult disp_; private: diff --git a/src/dociterator.C b/src/dociterator.C index 97630288c3..264df01127 100644 --- a/src/dociterator.C +++ b/src/dociterator.C @@ -56,7 +56,7 @@ InsetBase * DocIterator::nextInset() BOOST_ASSERT(!empty()); if (pos() == lastpos()) return 0; - if (inMathed()) + if (inMathed()) return nextAtom().nucleus(); return paragraph().isInset(pos()) ? paragraph().getInset(pos()) : 0; } @@ -67,7 +67,7 @@ InsetBase * DocIterator::prevInset() BOOST_ASSERT(!empty()); if (pos() == 0) return 0; - if (inMathed()) + if (inMathed()) return prevAtom().nucleus(); return paragraph().isInset(pos() - 1) ? paragraph().getInset(pos() - 1) : 0; } @@ -78,7 +78,7 @@ InsetBase const * DocIterator::prevInset() const BOOST_ASSERT(!empty()); if (pos() == 0) return 0; - if (inMathed()) + if (inMathed()) return prevAtom().nucleus(); return paragraph().isInset(pos() - 1) ? paragraph().getInset(pos() - 1) : 0; } @@ -339,13 +339,13 @@ void DocIterator::forwardChar() { forwardPos(); while (size() != 0 && pos() == lastpos()) - forwardPos(); + forwardPos(); } void DocIterator::forwardInset() { - forwardPos(); + forwardPos(); while (size() != 0 && (pos() == lastpos() || nextInset() == 0)) forwardPos(); } @@ -355,7 +355,7 @@ void DocIterator::backwardChar() { backwardPos(); while (size() != 0 && pos() == lastpos()) - backwardPos(); + backwardPos(); } @@ -390,7 +390,7 @@ void DocIterator::backwardPos() // move into an inset to the left if possible InsetBase * n = 0; - + if (inMathed()) { n = (top.cell().begin() + top.pos())->nucleus(); } else { @@ -449,4 +449,3 @@ std::ostream & operator<<(std::ostream & os, StableDocIterator const & dit) os << " " << dit.data_[i] << "\n"; return os; } - diff --git a/src/dociterator.h b/src/dociterator.h index 9d6119d426..d00add62d4 100644 --- a/src/dociterator.h +++ b/src/dociterator.h @@ -66,7 +66,7 @@ public: CursorSlice & top() { return back(); } /// access to tip CursorSlice const & top() const { return back(); } - /// access to outermost slice + /// access to outermost slice CursorSlice & bottom() { return front(); } /// access to outermost slicetip CursorSlice const & bottom() const { return front(); } diff --git a/src/factory.C b/src/factory.C index 10e11708e8..a5c1d4de80 100644 --- a/src/factory.C +++ b/src/factory.C @@ -341,7 +341,7 @@ InsetBase * readInset(LyXLex & lex, Buffer const & buf) auto_ptr inset; LyXTextClass tclass = buf.params().getLyXTextClass(); - + lex.next(); string tmptok = lex.getString(); diff --git a/src/frontends/controllers/ControlCitation.C b/src/frontends/controllers/ControlCitation.C index d5e37aee72..9b48f2c9d6 100644 --- a/src/frontends/controllers/ControlCitation.C +++ b/src/frontends/controllers/ControlCitation.C @@ -37,9 +37,9 @@ bool ControlCitation::initialiseParams(string const & data) kernel().buffer().fillWithBibKeys(blist); bool use_styles = (usingNatbib() || usingJurabib()); - + typedef std::map::value_type InfoMapValue; - + for (vector >::size_type i = 0; i < blist.size(); ++i) { bibkeysInfo_.insert(InfoMapValue(blist[i].first, @@ -51,7 +51,7 @@ bool ControlCitation::initialiseParams(string const & data) else { if ((use_styles && citeStyles_.size() == 1) || (!use_styles && citeStyles_.size() != 1)) - citeStyles_ = biblio::getCiteStyles(usingNatbib(), + citeStyles_ = biblio::getCiteStyles(usingNatbib(), usingJurabib()); } diff --git a/src/frontends/controllers/ControlDocument.C b/src/frontends/controllers/ControlDocument.C index e353dece32..25c3212de7 100644 --- a/src/frontends/controllers/ControlDocument.C +++ b/src/frontends/controllers/ControlDocument.C @@ -68,10 +68,10 @@ namespace { void dispatch_bufferparams(Kernel const & kernel, BufferParams const & bp, kb_action lfun) { - ostringstream ss; - bp.writeFile(ss); - ss << "\\end_header\n"; - kernel.dispatch(FuncRequest(lfun, ss.str())); + ostringstream ss; + bp.writeFile(ss); + ss << "\\end_header\n"; + kernel.dispatch(FuncRequest(lfun, ss.str())); } } // namespace anon @@ -83,17 +83,17 @@ void ControlDocument::dispatchParams() setLanguage(); // Set the document class. - lyx::textclass_type const old_class = + lyx::textclass_type const old_class = kernel().buffer().params().textclass; - lyx::textclass_type const new_class = bp_->textclass; + lyx::textclass_type const new_class = bp_->textclass; - if (new_class != old_class) { - string const name = textclasslist[new_class].name(); + if (new_class != old_class) { + string const name = textclasslist[new_class].name(); kernel().dispatch(FuncRequest(LFUN_TEXTCLASS_APPLY, name)); } // Apply the BufferParams. - dispatch_bufferparams(kernel(), params(), LFUN_BUFFERPARAMS_APPLY); + dispatch_bufferparams(kernel(), params(), LFUN_BUFFERPARAMS_APPLY); // Generate the colours requested by each new branch. BranchList & branchlist = params().branchlist(); @@ -123,10 +123,10 @@ void ControlDocument::setLanguage() const { Language const * const newL = bp_->language; if (kernel().buffer().params().language == newL) - return; + return; - string const lang_name = newL->lang(); - kernel().dispatch(FuncRequest(LFUN_LANGUAGE_BUFFER, lang_name)); + string const lang_name = newL->lang(); + kernel().dispatch(FuncRequest(LFUN_LANGUAGE_BUFFER, lang_name)); } @@ -143,5 +143,5 @@ bool ControlDocument::loadTextclass(lyx::textclass_type tc) const void ControlDocument::saveAsDefault() const { - dispatch_bufferparams(kernel(), params(), LFUN_SAVE_AS_DEFAULT); + dispatch_bufferparams(kernel(), params(), LFUN_SAVE_AS_DEFAULT); } diff --git a/src/frontends/controllers/ControlPrefs.C b/src/frontends/controllers/ControlPrefs.C index d1f70d1b07..3aa72c32be 100644 --- a/src/frontends/controllers/ControlPrefs.C +++ b/src/frontends/controllers/ControlPrefs.C @@ -62,9 +62,9 @@ bool ControlPrefs::initialiseParams(std::string const &) void ControlPrefs::dispatchParams() { - ostringstream ss; - rc_.write(ss); - kernel().dispatch(FuncRequest(LFUN_LYXRC_APPLY, ss.str())); + ostringstream ss; + rc_.write(ss); + kernel().dispatch(FuncRequest(LFUN_LYXRC_APPLY, ss.str())); // FIXME: these need lfuns bufferlist.setCurrentAuthor(rc_.user_name, rc_.user_email); diff --git a/src/frontends/controllers/ControlPrint.C b/src/frontends/controllers/ControlPrint.C index 9daba95957..747e55b2bc 100644 --- a/src/frontends/controllers/ControlPrint.C +++ b/src/frontends/controllers/ControlPrint.C @@ -128,7 +128,7 @@ void ControlPrint::dispatchParams() string const target = (pp.target == PrinterParams::PRINTER) ? "printer" : "file"; - + string const target_name = (pp.target == PrinterParams::PRINTER) ? (pp.printer_name.empty() ? "default" : pp.printer_name) : pp.file_name; diff --git a/src/frontends/controllers/ControlSpellchecker.C b/src/frontends/controllers/ControlSpellchecker.C index 0592fc7bc7..a069f6e329 100644 --- a/src/frontends/controllers/ControlSpellchecker.C +++ b/src/frontends/controllers/ControlSpellchecker.C @@ -161,10 +161,10 @@ void ControlSpellchecker::check() ptrdiff_t start = 0, total = 0; DocIterator it = DocIterator(kernel().buffer().inset()); for (start = 0; it != cur; it.forwardPos()) - ++start; + ++start; for (total = start; it; it.forwardPos()) - ++total; + ++total; for (; cur && isLetter(cur); cur.forwardPos()) ++start; diff --git a/src/frontends/controllers/Kernel.h b/src/frontends/controllers/Kernel.h index 726722a570..4655552da7 100644 --- a/src/frontends/controllers/Kernel.h +++ b/src/frontends/controllers/Kernel.h @@ -81,7 +81,7 @@ public: /** A request that the GUI be redrawn, * e.g. because the colors have been remapped. */ - void redrawGUI() const; + void redrawGUI() const; /** \name Kernel Nasties * Unpleasantly public internals of the LyX kernel. diff --git a/src/frontends/gnome/Dialogs3.C b/src/frontends/gnome/Dialogs3.C index b3fa428734..0c3f81e9cc 100644 --- a/src/frontends/gnome/Dialogs3.C +++ b/src/frontends/gnome/Dialogs3.C @@ -84,7 +84,7 @@ private: bool Dialogs::isValidName(string const & name) const { - return std::find_if(dialognames, end_dialognames, + return std::find_if(dialognames, end_dialognames, cmpCStr(name.c_str())) != end_dialognames; } diff --git a/src/frontends/gnome/GPreamble.C b/src/frontends/gnome/GPreamble.C index c80919eec7..4b7837c384 100644 --- a/src/frontends/gnome/GPreamble.C +++ b/src/frontends/gnome/GPreamble.C @@ -41,9 +41,9 @@ void GPreamble::build() void GPreamble::apply() { -// controller().params() = preamble()->get_buffer()->get_text(preamble()->get_buffer()->get_start_iter(), -// preamble()->get_buffer()->get_end_iter(), -// false); +// controller().params() = preamble()->get_buffer()->get_text(preamble()->get_buffer()->get_start_iter(), +// preamble()->get_buffer()->get_end_iter(), +// false); } diff --git a/src/frontends/gnome/GView.h b/src/frontends/gnome/GView.h index 966a816bce..a8a55ce100 100644 --- a/src/frontends/gnome/GView.h +++ b/src/frontends/gnome/GView.h @@ -111,7 +111,7 @@ T* GView::getWidget(const string & name) const template class GControlledView : public GView { public: - GControlledView(string const & name); + GControlledView(string const & name); protected: Controller & controller(); }; diff --git a/src/frontends/gnome/GnomeBase.h b/src/frontends/gnome/GnomeBase.h index 123efd2b3a..9c12a97565 100644 --- a/src/frontends/gnome/GnomeBase.h +++ b/src/frontends/gnome/GnomeBase.h @@ -111,7 +111,7 @@ T* GnomeBase::getWidget(const string & name) const template class GnomeCB : public GnomeBase { public: - GnomeCB(string const & name); + GnomeCB(string const & name); protected: Controller & controller(); }; diff --git a/src/frontends/gnome/gnome_helpers.C b/src/frontends/gnome/gnome_helpers.C index c4b32c9d49..3a126c67ca 100644 --- a/src/frontends/gnome/gnome_helpers.C +++ b/src/frontends/gnome/gnome_helpers.C @@ -25,4 +25,3 @@ void addDefaultTags(Glib::RefPtr & buf) { buf->get_tag_table()->add(boldTag); } - diff --git a/src/frontends/gtk/GXpmBtnTbl.C b/src/frontends/gtk/GXpmBtnTbl.C index 0a323089e4..d22495e4ba 100644 --- a/src/frontends/gtk/GXpmBtnTbl.C +++ b/src/frontends/gtk/GXpmBtnTbl.C @@ -70,7 +70,7 @@ void GXpmBtnTbl::construct() GXpmBtn * btn; int row, col; - for (row = 0; row < rows_; ++row) + for (row = 0; row < rows_; ++row) for (col = 0; col < cols_; ++col) { btn = &btns_[index(row, col)]; btn->setRow(row); @@ -85,7 +85,7 @@ void GXpmBtnTbl::construct() void GXpmBtnTbl::setBtnXpm(XpmData xpms[]) { int row, col; - for (row = 0; row < rows_; ++row) + for (row = 0; row < rows_; ++row) for (col = 0; col < cols_; ++col) btns_[index(row, col)].setXpm(xpms[index(row, col)]); } diff --git a/src/frontends/qt2/QBibtex.C b/src/frontends/qt2/QBibtex.C index 3bc72f18ae..93660b23d4 100644 --- a/src/frontends/qt2/QBibtex.C +++ b/src/frontends/qt2/QBibtex.C @@ -107,17 +107,17 @@ void QBibtex::update_contents() dialog_->bibtocCB->setChecked(false); dialog_->bibtocCB->setEnabled(!bibtopic); - + string btprint(controller().params().getSecOptions()); int btp = 0; if (btprint == "btPrintNotCited") btp = 1; else if (btprint == "btPrintAll") btp = 2; - + dialog_->btPrintCO->setCurrentItem(btp); dialog_->btPrintCO->setEnabled(bibtopic); - + dialog_->styleCB->clear(); int item_nr(-1); @@ -168,13 +168,13 @@ void QBibtex::apply() // command! controller().params().setOptions(bibstyle); } - + // bibtopic allows three kinds of sections: // 1. sections that include all cited references of the database(s) // 2. sections that include all uncited references of the database(s) // 3. sections that include all references of the database(s), cited or not int btp = dialog_->btPrintCO->currentItem(); - + switch (btp) { case 0: controller().params().setSecOptions("btPrintCited"); @@ -186,7 +186,7 @@ void QBibtex::apply() controller().params().setSecOptions("btPrintAll"); break; } - + if (!controller().usingBibtopic()) controller().params().setSecOptions(""); } diff --git a/src/frontends/qt2/QCitation.C b/src/frontends/qt2/QCitation.C index 7160e2f48c..ac82d14eca 100644 --- a/src/frontends/qt2/QCitation.C +++ b/src/frontends/qt2/QCitation.C @@ -62,10 +62,10 @@ void QCitation::apply() string const before = fromqstr(dialog_->textBeforeED->text()); controller().params().setSecOptions(before); - + string const after = fromqstr(dialog_->textAfterED->text()); controller().params().setOptions(after); - + style_ = choice; open_find_ = false; } @@ -100,7 +100,7 @@ void QCitation::build_dialog() bcview().addReadOnly(dialog_->fulllistCB); bcview().addReadOnly(dialog_->textBeforeED); bcview().addReadOnly(dialog_->textAfterED); - + open_find_ = true; } @@ -125,7 +125,7 @@ void QCitation::fillStyles() vector const & sty = controller().getCiteStrings(key); - bool const use_styles = (controller().usingNatbib() || + bool const use_styles = (controller().usingNatbib() || controller().usingJurabib()); dialog_->citationStyleCO->setEnabled(!sty.empty() && use_styles); dialog_->citationStyleLA->setEnabled(!sty.empty() && use_styles); @@ -146,7 +146,7 @@ void QCitation::updateStyle() dialog_->fulllistCB->setEnabled(natbib); dialog_->forceuppercaseCB->setEnabled(natbib); - dialog_->textBeforeED->setEnabled(natbib || + dialog_->textBeforeED->setEnabled(natbib || controller().usingJurabib()); string const & command = controller().params().getCmdName(); @@ -158,8 +158,8 @@ void QCitation::updateStyle() vector::const_iterator cit = find(styles.begin(), styles.end(), cs.style); - - // restore the latest natbib style + + // restore the latest natbib style if (style_ >= 0 && style_ < dialog_->citationStyleCO->count()) dialog_->citationStyleCO->setCurrentItem(style_); else @@ -197,7 +197,7 @@ void QCitation::update_contents() fillStyles(); updateStyle(); - + // open the find dialog if nothing has been selected (yet) // the bool prevents that this is also done after "apply" if (open_find_) diff --git a/src/frontends/qt2/QCitationDialog.C b/src/frontends/qt2/QCitationDialog.C index 09715ca59f..020a50e85d 100644 --- a/src/frontends/qt2/QCitationDialog.C +++ b/src/frontends/qt2/QCitationDialog.C @@ -78,7 +78,7 @@ void QCitationDialog::openFind() { if (form_->readOnly()) return; - + if (selectedLB->count() == 0 && add_->availableLB->count() != 0){ // open the find dialog add(); diff --git a/src/frontends/qt2/QFloatDialog.C b/src/frontends/qt2/QFloatDialog.C index cfb1b27298..76811dcbba 100644 --- a/src/frontends/qt2/QFloatDialog.C +++ b/src/frontends/qt2/QFloatDialog.C @@ -36,7 +36,7 @@ QFloatDialog::QFloatDialog(QFloat * form) // enable span columns checkbox floatFP->useWide(); - + // enable sideways checkbox floatFP->useSideways(); diff --git a/src/frontends/qt2/QRef.C b/src/frontends/qt2/QRef.C index bbf59eadc5..50171b3b14 100644 --- a/src/frontends/qt2/QRef.C +++ b/src/frontends/qt2/QRef.C @@ -55,7 +55,7 @@ void QRef::build_dialog() bcview().addReadOnly(dialog_->referenceED); bcview().addReadOnly(dialog_->typeCO); bcview().addReadOnly(dialog_->bufferCO); - + restored_buffer_ = -1; } @@ -63,14 +63,14 @@ void QRef::build_dialog() void QRef::update_contents() { InsetCommandParams const & params = controller().params(); - + int orig_type = dialog_->typeCO->currentItem(); - + dialog_->referenceED->setText(toqstr(params.getContents())); dialog_->nameED->setText(toqstr(params.getOptions())); dialog_->nameED->setReadOnly(!nameAllowed() && !readOnly()); - + // restore type settings for new insets if (params.getContents().empty()) dialog_->typeCO->setCurrentItem(orig_type); @@ -90,7 +90,7 @@ void QRef::update_contents() dialog_->bufferCO->insertItem(toqstr(*it)); } // restore the buffer combo setting for new insets - if (params.getContents().empty() && restored_buffer_ != -1 + if (params.getContents().empty() && restored_buffer_ != -1 && restored_buffer_ < dialog_->bufferCO->count()) dialog_->bufferCO->setCurrentItem(restored_buffer_); else @@ -107,7 +107,7 @@ void QRef::apply() params.setCmdName(InsetRef::getName(dialog_->typeCO->currentItem())); params.setContents(fromqstr(dialog_->referenceED->text())); params.setOptions(fromqstr(dialog_->nameED->text())); - + restored_buffer_ = dialog_->bufferCO->currentItem(); } @@ -164,7 +164,7 @@ void QRef::gotoRef() void QRef::redoRefs() { int lastref = dialog_->refsLB->currentItem(); - + dialog_->refsLB->setAutoUpdate(false); dialog_->refsLB->clear(); @@ -181,12 +181,12 @@ void QRef::redoRefs() dialog_->refsLB->sort(); dialog_->referenceED->setText(tmp); - + // restore the last selection for new insets - if (tmp.isEmpty() && lastref != -1 + if (tmp.isEmpty() && lastref != -1 && lastref < int(dialog_->refsLB->count())) dialog_->refsLB->setCurrentItem(lastref); - else + else for (unsigned int i = 0; i < dialog_->refsLB->count(); ++i) { if (tmp == dialog_->refsLB->text(i)) dialog_->refsLB->setCurrentItem(i); diff --git a/src/frontends/qt2/QRef.h b/src/frontends/qt2/QRef.h index ac77af1835..6b20057324 100644 --- a/src/frontends/qt2/QRef.h +++ b/src/frontends/qt2/QRef.h @@ -62,7 +62,7 @@ private: /// at a reference ? bool at_ref_; - + /// store the buffer settings int restored_buffer_; diff --git a/src/frontends/qt2/QVSpaceDialog.C b/src/frontends/qt2/QVSpaceDialog.C index bc2f6a3eb0..521a206136 100644 --- a/src/frontends/qt2/QVSpaceDialog.C +++ b/src/frontends/qt2/QVSpaceDialog.C @@ -56,4 +56,3 @@ void QVSpaceDialog::enableCustom(int) valueLE->setEnabled(enable); unitCO->setEnabled(enable); } - diff --git a/src/frontends/qt2/QWorkArea.C b/src/frontends/qt2/QWorkArea.C index d987ea63ab..8070c266c3 100644 --- a/src/frontends/qt2/QWorkArea.C +++ b/src/frontends/qt2/QWorkArea.C @@ -110,55 +110,55 @@ OSErr checkAppleEventForMissingParams(const AppleEvent& theAppleEvent) { DescType returnedType; Size actualSize; - OSErr err = AEGetAttributePtr(&theAppleEvent, keyMissedKeywordAttr, - typeWildCard, &returnedType, nil, 0, + OSErr err = AEGetAttributePtr(&theAppleEvent, keyMissedKeywordAttr, + typeWildCard, &returnedType, nil, 0, &actualSize); switch (err) { case errAEDescNotFound: - return noErr; - case noErr: + return noErr; + case noErr: return errAEEventNotHandled; default: - return err; + return err; } } } -pascal OSErr handleOpenDocuments(const AppleEvent* inEvent, - AppleEvent* /*reply*/, long /*refCon*/) +pascal OSErr handleOpenDocuments(const AppleEvent* inEvent, + AppleEvent* /*reply*/, long /*refCon*/) { QString s_arg; AEDescList documentList; - OSErr err = AEGetParamDesc(inEvent, keyDirectObject, typeAEList, + OSErr err = AEGetParamDesc(inEvent, keyDirectObject, typeAEList, &documentList); - if (err != noErr) + if (err != noErr) return err; err = checkAppleEventForMissingParams(*inEvent); if (err == noErr) { long documentCount; err = AECountItems(&documentList, &documentCount); - for (long documentIndex = 1; - err == noErr && documentIndex <= documentCount; + for (long documentIndex = 1; + err == noErr && documentIndex <= documentCount; documentIndex++) { DescType returnedType; Size actualSize; AEKeyword keyword; FSRef ref; char qstr_buf[1024]; - err = AESizeOfNthItem(&documentList, documentIndex, + err = AESizeOfNthItem(&documentList, documentIndex, &returnedType, &actualSize); if (err == noErr) { err = AEGetNthPtr(&documentList, documentIndex, typeFSRef, &keyword, - &returnedType, (Ptr)&ref, + &returnedType, (Ptr)&ref, sizeof(FSRef), &actualSize); if (err == noErr) { - FSRefMakePath(&ref, (UInt8*)qstr_buf, + FSRefMakePath(&ref, (UInt8*)qstr_buf, 1024); s_arg=QString::fromUtf8(qstr_buf); wa_ptr->dispatch( - FuncRequest(LFUN_FILE_OPEN, + FuncRequest(LFUN_FILE_OPEN, fromqstr(s_arg))); break; } diff --git a/src/frontends/qt2/checkedwidgets.C b/src/frontends/qt2/checkedwidgets.C index 5deef77b14..e6bf240e63 100644 --- a/src/frontends/qt2/checkedwidgets.C +++ b/src/frontends/qt2/checkedwidgets.C @@ -22,7 +22,7 @@ void addCheckedLineEdit(BCView & bcview, { bcview.addCheckedWidget(new CheckedLineEdit(input, label)); } - + namespace { @@ -38,14 +38,14 @@ void setWarningColor(QWidget * widget) widget->setPalette(pal); } - + void setWidget(bool valid, QLineEdit * input, QLabel * label) { if (valid) input->unsetPalette(); else setWarningColor(input); - + if (!label) return; diff --git a/src/frontends/qt2/floatplacement.C b/src/frontends/qt2/floatplacement.C index 27cbd35176..224f1e6a2e 100644 --- a/src/frontends/qt2/floatplacement.C +++ b/src/frontends/qt2/floatplacement.C @@ -162,7 +162,7 @@ void FloatPlacement::set(InsetFloatParams const & params) spanCB->setChecked(params.wide); sidewaysCB->setChecked(params.sideways); - sidewaysCB->setEnabled(params.type == "figure" + sidewaysCB->setEnabled(params.type == "figure" || params.type == "table"); checkAllowed(); } diff --git a/src/frontends/qt2/lyx_gui.C b/src/frontends/qt2/lyx_gui.C index 2636e2805c..f05705c795 100644 --- a/src/frontends/qt2/lyx_gui.C +++ b/src/frontends/qt2/lyx_gui.C @@ -93,7 +93,7 @@ extern bool lyxX11EventFilter(XEvent * xev); #ifdef Q_WS_MACX extern bool macEventFilter(EventRef event); extern pascal OSErr -handleOpenDocuments(const AppleEvent* inEvent, AppleEvent* /*reply*/, +handleOpenDocuments(const AppleEvent* inEvent, AppleEvent* /*reply*/, long /*refCon*/); #endif @@ -127,13 +127,13 @@ LQApplication::~LQApplication() #ifdef Q_WS_MACX -bool LQApplication::macEventFilter(EventRef event) +bool LQApplication::macEventFilter(EventRef event) { if (GetEventClass(event) == kEventClassAppleEvent) { EventRecord eventrec; ConvertEventRefToEventRecord(event, &eventrec); AEProcessAppleEvent(&eventrec); - + return false; } return false; diff --git a/src/frontends/qt2/qfont_loader.C b/src/frontends/qt2/qfont_loader.C index 7d545405e1..3348a7b3c7 100644 --- a/src/frontends/qt2/qfont_loader.C +++ b/src/frontends/qt2/qfont_loader.C @@ -75,11 +75,11 @@ void addFontPath() FSRef fontDirRef; FSSpec fontDirSpec; CFStringRef filePath = CFStringCreateWithBytes(kCFAllocatorDefault, - (UInt8 *) "Fonts", strlen("Fonts"), + (UInt8 *) "Fonts", strlen("Fonts"), kCFStringEncodingISOLatin1, false); myAppResourcesURL = CFBundleCopyResourcesDirectoryURL(myAppBundle); - FontsURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault, + FontsURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorDefault, myAppResourcesURL, filePath, true); if (lyxerr.debugging(Debug::FONT)) { UInt8 buf[255]; @@ -87,12 +87,12 @@ void addFontPath() lyxerr << "Adding Fonts directory: " << buf << endl; } CFURLGetFSRef (FontsURL, &fontDirRef); - OSStatus err = FSGetCatalogInfo (&fontDirRef, kFSCatInfoNone, + OSStatus err = FSGetCatalogInfo (&fontDirRef, kFSCatInfoNone, NULL, NULL, &fontDirSpec, NULL); - if (err) + if (err) lyxerr << "FSGetCatalogInfo err = " << err << endl; - err = FMActivateFonts (&fontDirSpec, NULL, NULL, - kFMLocalActivationContext); + err = FMActivateFonts (&fontDirSpec, NULL, NULL, + kFMLocalActivationContext); if (err) lyxerr << "FMActivateFonts err = " << err << endl; #endif diff --git a/src/frontends/screen.C b/src/frontends/screen.C index 93f30487b8..bb7d2fac55 100644 --- a/src/frontends/screen.C +++ b/src/frontends/screen.C @@ -215,7 +215,7 @@ bool LyXScreen::fitCursor(BufferView * bv) bv->cursor().getDim(asc, desc); //lyxerr << "LyXScreen::fitCursor: x: " << x << " y: " << y // << " top_y: " << top_y << endl; - + bool const big_row = h / 4 < asc + desc && asc + desc < h; if (y + desc - top_y >= h) { diff --git a/src/frontends/xforms/FormBibtex.C b/src/frontends/xforms/FormBibtex.C index 4f4e5f4879..4a8a0c1bcc 100644 --- a/src/frontends/xforms/FormBibtex.C +++ b/src/frontends/xforms/FormBibtex.C @@ -78,7 +78,7 @@ void FormBibtex::build() // callback for double click in browser fl_set_browser_dblclick_callback(dialog_->browser_styles, C_FormDialogView_InputCB, 2); - + fl_addto_choice(dialog_->choice_btprint, _(" all cited references " "| all uncited references " @@ -113,7 +113,7 @@ void FormBibtex::build() "the styles which are in directories where TeX finds them " "are listed!"); tooltips().init(dialog_->button_rescan, str); - + str = _("The bibliography section contains..."); tooltips().init(dialog_->choice_btprint, str); } @@ -198,14 +198,14 @@ void FormBibtex::update() } } fl_set_input(dialog_->input_style, bibstyle.c_str()); - + string btprint = controller().params().getSecOptions(); int btp = 1; if (btprint == "btPrintNotCited") btp = 2; else if (btprint == "btPrintAll") btp = 3; - + fl_set_choice(dialog_->choice_btprint, btp); setEnabled(dialog_->choice_btprint, bibtopic); @@ -260,11 +260,11 @@ void FormBibtex::apply() controller().params().setOptions(bibtotoc + ',' + bibstyle); } else { - // At least one of addtotoc and bibstyle is empty. + // At least one of addtotoc and bibstyle is empty. // No harm to output both! controller().params().setOptions(bibtotoc + bibstyle); } - + // bibtopic allows three kinds of sections: // 1. sections that include all cited references of the database(s) // 2. sec. that include all uncited references of the database(s) @@ -283,7 +283,7 @@ void FormBibtex::apply() break; } } - + else controller().params().setSecOptions(""); } diff --git a/src/frontends/xforms/FormBox.C b/src/frontends/xforms/FormBox.C index 5174639b14..3e02a095e9 100644 --- a/src/frontends/xforms/FormBox.C +++ b/src/frontends/xforms/FormBox.C @@ -285,4 +285,3 @@ ButtonPolicy::SMInput FormBox::input(FL_OBJECT * ob, long) return ButtonPolicy::SMI_VALID; } - diff --git a/src/frontends/xforms/FormCitation.C b/src/frontends/xforms/FormCitation.C index ffa4567d73..6213575e7d 100644 --- a/src/frontends/xforms/FormCitation.C +++ b/src/frontends/xforms/FormCitation.C @@ -117,7 +117,7 @@ void FormCitation::apply() string const before = getString(dialog_->input_before); controller().params().setSecOptions(before); - + string const after = getString(dialog_->input_after); controller().params().setOptions(after); } @@ -464,7 +464,7 @@ void FormCitation::update() fl_set_input(dialog_->input_after, controller().params().getOptions().c_str()); - fl_set_input(dialog_->input_before, + fl_set_input(dialog_->input_before, controller().params().getSecOptions().c_str()); } diff --git a/src/frontends/xforms/FormDocument.C b/src/frontends/xforms/FormDocument.C index c64a5d34e8..b1607f444e 100644 --- a/src/frontends/xforms/FormDocument.C +++ b/src/frontends/xforms/FormDocument.C @@ -315,12 +315,12 @@ void FormDocument::build() bcview().addReadOnly(options_->choice_citation_format); bcview().addReadOnly(options_->input_float_placement); bcview().addReadOnly(options_->choice_postscript_driver); - + // add cite style radio buttons citestyle_.init(options_->radio_use_defcite, DEFCITE); citestyle_.init(options_->radio_use_natbib, NATBIB); citestyle_.init(options_->radio_use_jurabib, JURABIB); - + // set up the tooltips for optionss form string str = _("Use LaTeX's default citation style"); tooltips().init(options_->radio_use_defcite, str); @@ -535,8 +535,8 @@ ButtonPolicy::SMInput FormDocument::input(FL_OBJECT * ob, long) fl_set_choice_text(class_->choice_skip_units, default_unit.c_str()); - } else if (ob == options_->radio_use_jurabib || - ob == options_->radio_use_defcite || + } else if (ob == options_->radio_use_jurabib || + ob == options_->radio_use_defcite || ob == options_->radio_use_natbib) { setEnabled(options_->choice_citation_format, fl_get_button(options_->radio_use_natbib)); @@ -784,12 +784,12 @@ void FormDocument::branch_input(FL_OBJECT * ob) bool const selecting = ob == branch_->button_select; string current_branch; - - // When selecting, take highlighted item from left browser, + + // When selecting, take highlighted item from left browser, // when deselecting, from right browser: if (selecting) { int const i = fl_get_browser(branch_->browser_all_branches); - current_branch = + current_branch = fl_get_browser_line(branch_->browser_all_branches, i); } else { int const i = fl_get_browser(branch_->browser_selection); diff --git a/src/frontends/xforms/FormDocument.h b/src/frontends/xforms/FormDocument.h index c93ff2ebca..99024e76b9 100644 --- a/src/frontends/xforms/FormDocument.h +++ b/src/frontends/xforms/FormDocument.h @@ -133,7 +133,7 @@ private: std::vector lang_; /// Contains all legal branches for this doc BranchList branchlist_; - + /// citation style buttons RadioButtonGroup citestyle_; }; diff --git a/src/frontends/xforms/FormExternal.C b/src/frontends/xforms/FormExternal.C index dfc7d0c4a2..4ce8a69ffb 100644 --- a/src/frontends/xforms/FormExternal.C +++ b/src/frontends/xforms/FormExternal.C @@ -367,14 +367,14 @@ void FormExternal::build() bcview().addReadOnly(options_->input_option); // initial setting -// addCheckedPositiveFloat(bcview(), scale_->input_width); +// addCheckedPositiveFloat(bcview(), scale_->input_width); // As I haven't written addCheckedPositiveFloat, we default to // always checking that it is a valide LyXLength, even when // I'm 'scaling'. No harm done, just not as strict as it might be. addCheckedLyXLength(bcview(), scale_->input_width); addCheckedLyXLength(bcview(), scale_->input_height); -// addCheckedPositiveFloat(bcview(), input_displayscale); +// addCheckedPositiveFloat(bcview(), input_displayscale); fl_set_input_filter(lyxview_->input_displayscale, fl_unsigned_int_filter); @@ -745,10 +745,10 @@ void FormExternal::widthUnitChanged() bool useHeight = fl_get_choice(scale_->choice_width) > 1; -// if (useHeight) -// widthED->setValidator(unsignedLengthValidator(widthED)); -// else -// widthED->setValidator(new QDoubleValidator(0, 1000, 2, widthED)); +// if (useHeight) +// widthED->setValidator(unsignedLengthValidator(widthED)); +// else +// widthED->setValidator(new QDoubleValidator(0, 1000, 2, widthED)); setEnabled(scale_->input_height, useHeight); setEnabled(scale_->choice_height, useHeight); diff --git a/src/frontends/xforms/FormFloat.C b/src/frontends/xforms/FormFloat.C index 85c8e48cc4..ac27dcbf39 100644 --- a/src/frontends/xforms/FormFloat.C +++ b/src/frontends/xforms/FormFloat.C @@ -230,13 +230,13 @@ ButtonPolicy::SMInput FormFloat::input(FL_OBJECT * ob, long) setEnabled(dialog_->check_here, alternatives && !wide); setEnabled(dialog_->radio_here_definitely, !wide); setEnabled(dialog_->check_bottom, alternatives && !wide); - + } else if (ob == dialog_->check_sideways) { setEnabled(dialog_->radio_default, !sideways); setEnabled(dialog_->radio_alternatives, !sideways); setEnabled(dialog_->radio_here_definitely, !wide && !sideways); setEnabled(dialog_->check_top, alternatives && !sideways); - setEnabled(dialog_->check_bottom, + setEnabled(dialog_->check_bottom, alternatives && !wide && !sideways); setEnabled(dialog_->check_page, alternatives && !sideways); setEnabled(dialog_->check_here, alternatives && !wide && !sideways); diff --git a/src/frontends/xforms/FormMathsDelim.C b/src/frontends/xforms/FormMathsDelim.C index a13a9cae87..a6c366c368 100644 --- a/src/frontends/xforms/FormMathsDelim.C +++ b/src/frontends/xforms/FormMathsDelim.C @@ -37,7 +37,7 @@ int const delim_rversion[] = { 1,1,3,3,4,5,7,7,9,9,10,11, 3,13,15,15,16,17,19,19,20,21,22 }; -int const delim_size = +int const delim_size = sizeof(delim_rversion) / sizeof(delim_rversion[0]); char const * delim_values[] = { diff --git a/src/frontends/xforms/FormSearch.C b/src/frontends/xforms/FormSearch.C index 7c386786aa..4cf9b97e74 100644 --- a/src/frontends/xforms/FormSearch.C +++ b/src/frontends/xforms/FormSearch.C @@ -85,7 +85,7 @@ ButtonPolicy::SMInput FormSearch::input(FL_OBJECT * ob, long) getString(dialog_->input_replace), fl_get_button(dialog_->check_casesensitive), fl_get_button(dialog_->check_matchword), - !fl_get_button(dialog_->check_searchbackwards), + !fl_get_button(dialog_->check_searchbackwards), all); } diff --git a/src/frontends/xforms/xforms_helpers.C b/src/frontends/xforms/xforms_helpers.C index d8e49c4cea..4fafa0127c 100644 --- a/src/frontends/xforms/xforms_helpers.C +++ b/src/frontends/xforms/xforms_helpers.C @@ -325,7 +325,7 @@ bool XformsColor::read(string const & filename) if (f.readable() && !lexrc.setFile(filename)) { lyxerr << "XformsColor::read(" << filename << ")\n" << _("Failed to open file.") << std::endl; - return false; + return false; } while (lexrc.isOK()) { @@ -370,7 +370,7 @@ bool XformsColor::write(string const & filename) if (!os) { lyxerr << "XformsColor::write(" << filename << ")\n" << _("Failed to open file.") << std::endl; - return false; + return false; } os << "###" diff --git a/src/funcrequest.C b/src/funcrequest.C index c3b0c2d4bc..9e36053e06 100644 --- a/src/funcrequest.C +++ b/src/funcrequest.C @@ -91,8 +91,8 @@ bool operator==(FuncRequest const & lhs, FuncRequest const & rhs) std::ostream & operator<<(std::ostream & os, FuncRequest const & cmd) { return os - << " action: " << cmd.action + << " action: " << cmd.action << " arg: '" << cmd.argument << "'" - << " x: " << cmd.x - << " y: " << cmd.y; + << " x: " << cmd.x + << " y: " << cmd.y; } diff --git a/src/insets/ExternalTransforms.C b/src/insets/ExternalTransforms.C index 05b66b7b05..ee31553ba4 100644 --- a/src/insets/ExternalTransforms.C +++ b/src/insets/ExternalTransforms.C @@ -112,7 +112,7 @@ string const ResizeLatexCommand::front_impl() const if (!data.height.zero()) height = data.height.asLatexString(); } - + os << "\\resizebox{" << width << "}{" << height << "}{"; diff --git a/src/insets/insetbase.h b/src/insets/insetbase.h index e0749aedcc..02910c88ab 100644 --- a/src/insets/insetbase.h +++ b/src/insets/insetbase.h @@ -67,7 +67,7 @@ public: virtual MathInset * asMathInset() { return 0; } /// identification as non-math inset virtual UpdatableInset * asUpdatableInset() { return 0; } - /// true for 'math' math inset, but not for e.g. mbox + /// true for 'math' math inset, but not for e.g. mbox virtual bool inMathed() const { return false; } // the real dispatcher @@ -107,7 +107,7 @@ public: virtual bool covers(int x, int y) const; /// get the screen positions of the cursor (see note in cursor.C) virtual void getCursorPos(CursorSlice const & cur, int & x, int & y) const; - + /// is this an inset that can be moved into? virtual bool isActive() const { return nargs() > 0; } /// Where should we go when we press the up or down cursor key? @@ -147,12 +147,12 @@ public: virtual int cellXOffset(idx_type) const { return 0; } /// any additional y-offset when drawing a cell? virtual int cellYOffset(idx_type) const { return 0; } - /// number of embedded cells - virtual size_t nargs() const { return 0; } - /// number of rows in gridlike structures - virtual size_t nrows() const { return 0; } - /// number of columns in gridlike structures - virtual size_t ncols() const { return 0; } + /// number of embedded cells + virtual size_t nargs() const { return 0; } + /// number of rows in gridlike structures + virtual size_t nrows() const { return 0; } + /// number of columns in gridlike structures + virtual size_t ncols() const { return 0; } /// is called when the cursor leaves this inset virtual void notifyCursorLeaves(idx_type) {} diff --git a/src/insets/insetbibtex.C b/src/insets/insetbibtex.C index b877351948..feec01537b 100644 --- a/src/insets/insetbibtex.C +++ b/src/insets/insetbibtex.C @@ -77,7 +77,7 @@ void InsetBibtex::priv_dispatch(LCursor & cur, FuncRequest & cmd) setParams(p); break; } - + default: InsetCommand::priv_dispatch(cur, cmd); break; @@ -103,7 +103,7 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os, // 2. \begin{btSect}{database} // 3. \btPrint{Cited|NotCited|All} // 4. \end{btSect} - + // the database string string adb; string db_in = getContents(); @@ -115,8 +115,8 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os, while (!adb.empty()) { if (!runparams.nice && IsFileReadable(MakeAbsPath(adb, buffer.filePath())+".bib")) - adb = os::external_path(MakeAbsPath(adb, - buffer.filePath())); + adb = os::external_path(MakeAbsPath(adb, + buffer.filePath())); db_out += adb; db_out += ','; db_in = split(db_in, adb,','); @@ -132,7 +132,7 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os, style = split(style, bibtotoc, ','); } } - + // line count int i = 0; @@ -145,7 +145,7 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os, os << "\\bibliographystyle{" << style << "}\n"; i += 1; } - + if (buffer.params().use_bibtopic){ os << "\\begin{btSect}{" << db_out << "}\n"; string btprint = getSecOptions(); @@ -186,7 +186,7 @@ int InsetBibtex::latex(Buffer const & buffer, ostream & os, os << "\\bibliography{" << db_out << "}\n"; i += 1; } - + return i; } @@ -290,4 +290,3 @@ void InsetBibtex::validate(LaTeXFeatures & features) const if (features.bufferParams().use_bibtopic) features.require("bibtopic"); } - diff --git a/src/insets/insetbox.C b/src/insets/insetbox.C index fc2559d3ac..4f8124fff5 100644 --- a/src/insets/insetbox.C +++ b/src/insets/insetbox.C @@ -154,7 +154,7 @@ void InsetBox::setButtonLabel() void InsetBox::metrics(MetricsInfo & m, Dimension & dim) const { MetricsInfo mi = m; - mi.base.textwidth = params_.width.inPixels(m.base.textwidth); + mi.base.textwidth = params_.width.inPixels(m.base.textwidth); InsetCollapsable::metrics(mi, dim); //if (params_.inner_box && isOpen()) // dim.wid = mi.base.textwidth; diff --git a/src/insets/insetcharstyle.C b/src/insets/insetcharstyle.C index dc5d78a9c9..da213d2483 100644 --- a/src/insets/insetcharstyle.C +++ b/src/insets/insetcharstyle.C @@ -130,7 +130,7 @@ void InsetCharStyle::draw(PainterInfo & pi, int x, int y) const int a = 0; int d = 0; font_metrics::rectText(params_.type, font, w, a, d); - pi.pain.rectText(x + (dim_.wid - w) / 2, + pi.pain.rectText(x + (dim_.wid - w) / 2, y + InsetText::descent() + a, params_.type, font, LColor::none, LColor::none); } diff --git a/src/insets/insetcite.C b/src/insets/insetcite.C index 48c717b96f..0699b955d6 100644 --- a/src/insets/insetcite.C +++ b/src/insets/insetcite.C @@ -101,8 +101,8 @@ string const getNatbibLabel(Buffer const & buffer, cite_type == "citeyearpar") before_str = before + ' '; // In CITE (jurabib), the "before" string is used to attach - // the annotator (of legal texts) to the author(s) of the - // first reference. + // the annotator (of legal texts) to the author(s) of the + // first reference. else if (cite_type == "cite") before_str = '/' + before; } @@ -143,7 +143,7 @@ string const getNatbibLabel(Buffer const & buffer, label += author + before_str + sep_str; else label += author + sep_str; - + // (authors1 ( year); ... ; // authors_last ( year, ) } else if (cite_type == "citet") { @@ -286,7 +286,7 @@ InsetCitation::Cache::Style InsetCitation::getStyle(Buffer const & buffer) const style = Cache::NATBIB_AY; } } - + if (buffer.params().use_jurabib) style = Cache::JURABIB; @@ -344,7 +344,7 @@ int InsetCitation::latex(Buffer const & buffer, ostream & os, if (buffer.params().use_natbib) os << getCmdName(); else if (buffer.params().use_jurabib) { - // jurabib does not (yet) support "force upper case" + // jurabib does not (yet) support "force upper case" // and "full author name". Fallback. string cmd = getCmdName(); if (cmd[0] == 'C') @@ -358,7 +358,7 @@ int InsetCitation::latex(Buffer const & buffer, ostream & os, string const before = getSecOptions(); string const after = getOptions(); - if (!before.empty() + if (!before.empty() && (buffer.params().use_natbib || buffer.params().use_jurabib)) os << '[' << before << "][" << after << ']'; else if (!after.empty()) diff --git a/src/insets/insetcollapsable.C b/src/insets/insetcollapsable.C index 36ea94d817..5871a073e7 100644 --- a/src/insets/insetcollapsable.C +++ b/src/insets/insetcollapsable.C @@ -183,7 +183,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const if (openinlined_) InsetText::draw(pi, x + dimc.width(), y - aa + textdim_.asc); - else + else InsetText::draw(pi, x, dimc.height() + y - aa + textdim_.asc); } diff --git a/src/insets/insetcollapsable.h b/src/insets/insetcollapsable.h index ebb05fbec4..4e30b609a5 100644 --- a/src/insets/insetcollapsable.h +++ b/src/insets/insetcollapsable.h @@ -64,7 +64,7 @@ public: void setLabel(std::string const & l); /// virtual void setButtonLabel() {} - /// + /// void setLabelFont(LyXFont & f); /// int scroll(bool recursive = true) const; diff --git a/src/insets/insetcommand.C b/src/insets/insetcommand.C index 40fde7b7fc..a1bcc72279 100644 --- a/src/insets/insetcommand.C +++ b/src/insets/insetcommand.C @@ -104,7 +104,7 @@ void InsetCommand::priv_dispatch(LCursor & cur, FuncRequest & cmd) case LFUN_INSET_MODIFY: { InsetCommandParams p; InsetCommandMailer::string2params(mailer_name_, cmd.argument, p); - if (p.getCmdName().empty()) { + if (p.getCmdName().empty()) { cur.undispatched(); } else { setParams(p); diff --git a/src/insets/insetcommandparams.C b/src/insets/insetcommandparams.C index b21d050771..14ddc15674 100644 --- a/src/insets/insetcommandparams.C +++ b/src/insets/insetcommandparams.C @@ -29,7 +29,7 @@ InsetCommandParams::InsetCommandParams(string const & n, string const & c, string const & o, string const & s) - : cmdname(n), contents(c), options(o), sec_options(s), + : cmdname(n), contents(c), options(o), sec_options(s), preview_(false) {} @@ -39,7 +39,7 @@ void InsetCommandParams::scanCommand(string const & cmd) string tcmdname, toptions, tsecoptions, tcontents; if (cmd.empty()) return; - + enum { WS, CMDNAME, OPTION, SECOPTION, CONTENT } state = WS; // Used to handle things like \command[foo[bar]]{foo{bar}} @@ -100,7 +100,7 @@ void InsetCommandParams::scanCommand(string const & cmd) << "> == <" << getCommand() << "> == <" << getCmdName() << '|' << getContents() - << '|' << getOptions() + << '|' << getOptions() << '|' << getSecOptions() << '>' << endl; } diff --git a/src/insets/insetfloat.C b/src/insets/insetfloat.C index b6f68d6de5..9f2aa8d9fd 100644 --- a/src/insets/insetfloat.C +++ b/src/insets/insetfloat.C @@ -182,7 +182,7 @@ void InsetFloat::priv_dispatch(LCursor & cur, FuncRequest & cmd) InsetCollapsable::priv_dispatch(cur, cmd); break; } - + default: InsetCollapsable::priv_dispatch(cur, cmd); break; @@ -201,7 +201,7 @@ void InsetFloatParams::write(ostream & os) const os << "wide true\n"; else os << "wide false\n"; - + if (sideways) os << "sideways true\n"; else @@ -261,7 +261,7 @@ void InsetFloat::validate(LaTeXFeatures & features) const if (contains(params_.placement, 'H')) { features.require("float"); } - + if (params_.sideways) features.require("rotating"); diff --git a/src/insets/insettabular.C b/src/insets/insettabular.C index 3e99fad906..e876192212 100644 --- a/src/insets/insettabular.C +++ b/src/insets/insettabular.C @@ -471,7 +471,7 @@ void InsetTabular::priv_dispatch(LCursor & cur, FuncRequest & cmd) } break; - case LFUN_LEFTSEL: + case LFUN_LEFTSEL: case LFUN_LEFT: cell(cur.idx()).dispatch(cur, cmd); cur.dispatched(); // override the cell's decision @@ -695,7 +695,7 @@ bool InsetTabular::getStatus(LCursor & cur, FuncRequest const & cmd, switch (cmd.action) { case LFUN_TABULAR_FEATURE: { int actcell = cur.idx(); - int action = LyXTabular::LAST_ACTION; + int action = LyXTabular::LAST_ACTION; int i = 0; for (; tabularFeature[i].action != LyXTabular::LAST_ACTION; ++i) { string const tmp = tabularFeature[i].feature; @@ -1540,7 +1540,7 @@ void InsetTabular::cutSelection(LCursor & cur) bool const track = cur.bv().buffer()->params().tracking_changes; int rs, re, cs, ce; - getSelection(cur, rs, re, cs, ce); + getSelection(cur, rs, re, cs, ce); for (int i = rs; i <= re; ++i) for (int j = cs; j <= ce; ++j) cell(tabular.getCellNumber(i, j)).clear(track); @@ -1801,4 +1801,3 @@ string const InsetTabularMailer::params2string(InsetTabular const & inset) data << "\\end_inset\n"; return data.str(); } - diff --git a/src/insets/insettext.h b/src/insets/insettext.h index df3472db78..907fc179a8 100644 --- a/src/insets/insettext.h +++ b/src/insets/insettext.h @@ -150,7 +150,7 @@ public: bool insetAllowed(Code) const { return true; } /// bool allowSpellCheck() const { return true; } - + protected: /// void priv_dispatch(LCursor & cur, FuncRequest & cmd); diff --git a/src/insets/insetwrap.C b/src/insets/insetwrap.C index 2c07cf2a17..a307258d99 100644 --- a/src/insets/insetwrap.C +++ b/src/insets/insetwrap.C @@ -95,7 +95,7 @@ void InsetWrap::priv_dispatch(LCursor & cur, FuncRequest & cmd) case LFUN_INSET_DIALOG_UPDATE: InsetWrapMailer(*this).updateDialog(&cur.bv()); break; - + case LFUN_MOUSE_RELEASE: { if (cmd.button() == mouse_button::button3 && hitButton(cmd)) { InsetWrapMailer(*this).showDialog(&cur.bv()); diff --git a/src/lyxfind.C b/src/lyxfind.C index bca895c002..cfee2c9f04 100644 --- a/src/lyxfind.C +++ b/src/lyxfind.C @@ -367,5 +367,3 @@ bool findNextChange(BufferView * bv) } // find namespace } // lyx namespace - - diff --git a/src/lyxfunc.C b/src/lyxfunc.C index 550b627fe3..c7bb537973 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -488,7 +488,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const break; default: - + cur.getStatus(cmd, flag); if (!flag.enabled()) flag = view()->getStatus(cmd); @@ -562,7 +562,7 @@ void loadTextclass(string const & name) Alert::error(_("Could not change class"), s); } } - + } //namespace anon @@ -1342,14 +1342,14 @@ void LyXFunc::dispatch(FuncRequest const & cmd, bool verbose) case LFUN_LYXRC_APPLY: { istringstream ss(argument); bool const success = lyxrc.read(ss) == 0; - + if (!success) { lyxerr << "Warning in LFUN_LYXRC_APPLY!\n" << "Unable to read lyxrc data" << endl; } break; - } + } default: { DispatchResult res = view()->cursor().dispatch(cmd); diff --git a/src/lyxlex.C b/src/lyxlex.C index afda6e35eb..bff5266e19 100644 --- a/src/lyxlex.C +++ b/src/lyxlex.C @@ -320,4 +320,3 @@ LyXLex & LyXLex::operator>>(bool & s) } return *this; } - diff --git a/src/lyxrc.C b/src/lyxrc.C index 2a9adb6156..1952b1b6bc 100644 --- a/src/lyxrc.C +++ b/src/lyxrc.C @@ -580,7 +580,7 @@ int LyXRC::read(LyXLex & lexrc) chktex_command = lexrc.getString(); } break; - + case RC_BIBTEX_COMMAND: if (lexrc.next()) { bibtex_command = lexrc.getString(); @@ -2012,7 +2012,7 @@ string const LyXRC::getDescription(LyXRCTags tag) case RC_CHKTEX_COMMAND: str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation."); break; - + case RC_BIBTEX_COMMAND: str = _("Define the options of bibtex (cf. man bibtex) or select and alternative compiler (e.g. mlbibtex or bibulus)."); break; diff --git a/src/lyxrow.C b/src/lyxrow.C index 901de6dd2b..5416e69b1b 100644 --- a/src/lyxrow.C +++ b/src/lyxrow.C @@ -124,4 +124,3 @@ void Row::dump(const char * s) const << " top_of_text: " << top_of_text_ << " y_offset: " << y_offset_ << std::endl; } - diff --git a/src/lyxsocket.h b/src/lyxsocket.h index cadea4cbe7..6779ccb567 100644 --- a/src/lyxsocket.h +++ b/src/lyxsocket.h @@ -78,7 +78,7 @@ public: int fd() const; /// Connection status bool connected() const; - /// Line buffered input from the socket + /// Line buffered input from the socket bool readln(std::string &); /// Write the string + '\n' to the socket void writeln(std::string const &); diff --git a/src/lyxtext.h b/src/lyxtext.h index ddfc3aedd0..99f69b30d5 100644 --- a/src/lyxtext.h +++ b/src/lyxtext.h @@ -51,7 +51,7 @@ public: typedef lyx::pos_type pos_type; /// typedef lyx::par_type par_type; - + /// constructor explicit LyXText(BufferView *); /// @@ -265,7 +265,7 @@ public: /// current text heigth int height() const; - + /// updates all counters void updateCounters(); /// Returns an inset if inset was hit, or 0 if not. @@ -299,7 +299,7 @@ public: ParagraphList & paragraphs() const; /// return true if this is the main text bool isMainText() const; - + /// return first row of text RowList::iterator firstRow() const; /// return last row of text @@ -377,7 +377,7 @@ private: /// return past-the-last paragraph influenced by a layout /// change on pit par_type undoSpan(par_type pit); - + /// rebreaks the given par void redoParagraphInternal(par_type pit); /// used in setlayout diff --git a/src/mathed/math_colorinset.C b/src/mathed/math_colorinset.C index fcc1fc1f15..f4aa3481bf 100644 --- a/src/mathed/math_colorinset.C +++ b/src/mathed/math_colorinset.C @@ -82,7 +82,7 @@ void MathColorInset::write(WriteStream & os) const { if (oldstyle_) os << "{\\color" << '{' << cell(0) << '}' << cell(1) << '}'; - else + else os << "\\textcolor" << '{' << cell(0) << "}{" << cell(1) << '}'; } diff --git a/src/mathed/math_diminset.h b/src/mathed/math_diminset.h index 908b23f01a..f0b206b2d7 100644 --- a/src/mathed/math_diminset.h +++ b/src/mathed/math_diminset.h @@ -22,7 +22,7 @@ class PainterInfo; class MathDimInset : public MathInset { public: /// - MathDimInset(); + MathDimInset(); /// Dimension dimensions() const { return dim_; } diff --git a/src/mathed/math_mboxinset.h b/src/mathed/math_mboxinset.h index a512b9b9d8..24dfe866c4 100644 --- a/src/mathed/math_mboxinset.h +++ b/src/mathed/math_mboxinset.h @@ -39,11 +39,11 @@ public: bool inMathed() const { return false; } /// - LyXText * getText(int) const; + LyXText * getText(int) const; /// void getCursorPos(CursorSlice const & cur, int & x, int & y) const; protected: - /// + /// mutable LyXText text_; /// BufferView * const bv_; diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index 632ee7c150..e5a83e6ce5 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -543,9 +543,9 @@ void MathNestInset::priv_dispatch(LCursor & cur, FuncRequest & cmd) break; case LFUN_ESCAPE: - if (cur.selection()) + if (cur.selection()) cur.selClear(); - else + else cmd = FuncRequest(LFUN_FINISHED_LEFT); break; diff --git a/src/mathed/math_scriptinset.C b/src/mathed/math_scriptinset.C index f884901e52..a2c397ad53 100644 --- a/src/mathed/math_scriptinset.C +++ b/src/mathed/math_scriptinset.C @@ -111,7 +111,7 @@ void MathScriptInset::ensure(bool up) // just nucleus so far cells_.push_back(MathArray()); cell_1_is_up_ = up; - } else if (nargs() == 2 && !has(up)) { + } else if (nargs() == 2 && !has(up)) { if (up) { cells_.push_back(cell(1)); cell(1).clear(); diff --git a/src/mathed/ref_inset.C b/src/mathed/ref_inset.C index c1804cdb47..cfd5f60865 100644 --- a/src/mathed/ref_inset.C +++ b/src/mathed/ref_inset.C @@ -60,7 +60,7 @@ void RefInset::priv_dispatch(LCursor & cur, FuncRequest & cmd) if (cmd.getArg(0) == "ref") { MathArray ar; if (createMathInset_fromDialogStr(cmd.argument, ar)) { - *this = *ar[0].nucleus()->asRefInset(); + *this = *ar[0].nucleus()->asRefInset(); break; } } diff --git a/src/output_docbook.C b/src/output_docbook.C index 69340132f0..7caa4b518c 100644 --- a/src/output_docbook.C +++ b/src/output_docbook.C @@ -68,14 +68,14 @@ void docbookParagraphs(Buffer const & buf, ParagraphList::iterator pend = const_cast(paragraphs).end(); Counters & counters = buf.params().getLyXTextClass().counters(); - + for (; par != pend; ++par) { LyXLayout_ptr const & style = par->layout(); // environment tag closing for (; depth > par->params().depth(); --depth) { - sgml::closeEnvTags(os, false, environment_inner[depth], + sgml::closeEnvTags(os, false, environment_inner[depth], item_tag, command_depth + depth); sgml::closeTag(os, depth + command_depth, false, environment_stack[depth]); environment_stack[depth].erase(); @@ -85,14 +85,14 @@ void docbookParagraphs(Buffer const & buf, if (depth == par->params().depth() && environment_stack[depth] != style->latexname() && !environment_stack[depth].empty()) { - sgml::closeEnvTags(os, false, environment_inner[depth], + sgml::closeEnvTags(os, false, environment_inner[depth], item_tag, command_depth + depth); sgml::closeTag(os, depth + command_depth, false, environment_stack[depth]); environment_stack[depth].erase(); environment_inner[depth].erase(); } - + string ls = ""; bool labelid = false; // Write opening SGML tags. @@ -111,11 +111,11 @@ void docbookParagraphs(Buffer const & buf, if (depth != 0) //error(ErrorItem(_("Error"), _("Wrong depth for LatexType Command."), par->id(), 0, par->size())); ; - + command_name = style->latexname(); cmd_depth = style->commanddepth; - + if (command_flag) { if (cmd_depth < command_base) { for (Paragraph::depth_type j = command_depth; @@ -160,25 +160,25 @@ void docbookParagraphs(Buffer const & buf, if (!labelid && !style->latexparam().empty()) { ls = style->latexparam(); if (ls.find('#') != string::npos) { - string el = expandLabel(buf.params().getLyXTextClass(), + string el = expandLabel(buf.params().getLyXTextClass(), style, false); ls = subst(ls, "#", el); - } + } } - + sgml::openTag(os, depth + command_depth, false, command_name, ls); // Label around sectioning number: if (!style->labeltag().empty()) { - sgml::openTag(os, depth + 1 + command_depth, false, + sgml::openTag(os, depth + 1 + command_depth, false, style->labeltag()); os << expandLabel(buf.params().getLyXTextClass(), style, false); - sgml::closeTag(os, depth + 1 + command_depth, false, + sgml::closeTag(os, depth + 1 + command_depth, false, style->labeltag()); } // Inner tagged header text, e.g. for sectioning: - sgml::openTag(os, depth + 1 + command_depth, false, + sgml::openTag(os, depth + 1 + command_depth, false, style->innertag()); break; @@ -197,10 +197,10 @@ void docbookParagraphs(Buffer const & buf, environment_stack[depth] = style->latexname(); environment_inner[depth] = "!-- --"; // outputs <environment_stack[depth] latexparam()> - sgml::openTag(os, depth + command_depth, false, + sgml::openTag(os, depth + command_depth, false, environment_stack[depth], style->latexparam()); } else { - sgml::closeEnvTags(os, false, environment_inner[depth], + sgml::closeEnvTags(os, false, environment_inner[depth], style->itemtag(), command_depth + depth); } @@ -209,7 +209,7 @@ void docbookParagraphs(Buffer const & buf, if (style->innertag() == "CDATA") os << "<![CDATA["; else - sgml::openTag(os, depth + command_depth, false, + sgml::openTag(os, depth + command_depth, false, style->innertag()); } break; @@ -234,7 +234,7 @@ void docbookParagraphs(Buffer const & buf, // write closing SGML tags switch (style->latextype) { case LATEX_COMMAND: - sgml::closeTag(os, depth + command_depth, false, + sgml::closeTag(os, depth + command_depth, false, style->innertag()); break; case LATEX_ENVIRONMENT: @@ -242,7 +242,7 @@ void docbookParagraphs(Buffer const & buf, if (style->innertag() == "CDATA") os << "]]>"; else - sgml::closeTag(os, depth + command_depth, false, + sgml::closeTag(os, depth + command_depth, false, style->innertag()); } break; @@ -261,7 +261,7 @@ void docbookParagraphs(Buffer const & buf, // Close open tags for (int d = depth; d >= 0; --d) { if (!environment_stack[depth].empty()) { - sgml::closeEnvTags(os, false, environment_inner[depth], + sgml::closeEnvTags(os, false, environment_inner[depth], item_tag, command_depth + depth); } } @@ -272,4 +272,3 @@ void docbookParagraphs(Buffer const & buf, os << endl; } } - diff --git a/src/output_linuxdoc.C b/src/output_linuxdoc.C index cdf5cce3cc..c51f2f2c63 100644 --- a/src/output_linuxdoc.C +++ b/src/output_linuxdoc.C @@ -36,7 +36,7 @@ void linuxdocParagraphs(Buffer const & buf, ostream & os, OutputParams const & runparams) { - + Paragraph::depth_type depth = 0; // paragraph depth string item_name; vector<string> environment_stack(5); @@ -160,5 +160,3 @@ void linuxdocParagraphs(Buffer const & buf, for (int i = depth; i >= 0; --i) sgml::closeTag(os, depth, false, environment_stack[i]); } - - diff --git a/src/output_linuxdoc.h b/src/output_linuxdoc.h index 263c65d045..37a9012611 100644 --- a/src/output_linuxdoc.h +++ b/src/output_linuxdoc.h @@ -24,6 +24,6 @@ void linuxdocParagraphs(Buffer const & buf, ParagraphList const & paragraphs, std::ostream & os, OutputParams const & runparams); - + #endif diff --git a/src/paragraph.C b/src/paragraph.C index 7a91061cd0..cd356aa777 100644 --- a/src/paragraph.C +++ b/src/paragraph.C @@ -1881,5 +1881,3 @@ unsigned char Paragraph::transformChar(unsigned char c, pos_type pos) const return Encodings::TransformChar(c, Encodings::FORM_ISOLATED); } } - - diff --git a/src/paragraph_funcs.C b/src/paragraph_funcs.C index 1cac51313c..09072f861b 100644 --- a/src/paragraph_funcs.C +++ b/src/paragraph_funcs.C @@ -341,7 +341,7 @@ Paragraph const & ownerPar(Buffer const & buf, InsetBase const * inset) } -/// return the range of pars [beg, end[ owning the range of y [ystart, yend] +/// return the range of pars [beg, end[ owning the range of y [ystart, yend] void getParsInRange(ParagraphList & pars, int ystart, int yend, par_type & beg, par_type & end) { diff --git a/src/paragraph_funcs.h b/src/paragraph_funcs.h index bce1f343a5..6a573f458f 100644 --- a/src/paragraph_funcs.h +++ b/src/paragraph_funcs.h @@ -64,7 +64,7 @@ lyx::par_type outerPar(Buffer const & buf, InsetBase const * inset); /// find owning paragraph containing an inset Paragraph const & ownerPar(Buffer const & buf, InsetBase const * inset); -/// return the range of pars [beg, end[ owning the range of y [ystart, yend] +/// return the range of pars [beg, end[ owning the range of y [ystart, yend] void getParsInRange(ParagraphList & plist, int ystart, int yend, lyx::par_type & beg, diff --git a/src/sgml.h b/src/sgml.h index d247402f44..e3f65c49e0 100644 --- a/src/sgml.h +++ b/src/sgml.h @@ -37,7 +37,7 @@ int closeTag(std::ostream & os, lyx::depth_type depth, bool mixcont, std::string const & latexname); /// -unsigned int closeEnvTags(std::ostream & os, +unsigned int closeEnvTags(std::ostream & os, bool mixcont, std::string const & environment_inner_depth, std::string const & item_tag, diff --git a/src/support/forkedcontr.h b/src/support/forkedcontr.h index 8768015be9..b5dbe72340 100644 --- a/src/support/forkedcontr.h +++ b/src/support/forkedcontr.h @@ -38,7 +38,7 @@ public: /** Those child processes that are found to have finished are removed * from the list and their callback function is passed the final * return state. - */ + */ void handleCompletedProcesses(); /// Add a new child process to the list of controlled processes. diff --git a/src/text.C b/src/text.C index c5a35fca69..0de1cb693c 100644 --- a/src/text.C +++ b/src/text.C @@ -623,7 +623,7 @@ int LyXText::leftMargin(par_type pit, pos_type pos) const break; } } - + if (!pars_[pit].params().leftIndent().zero()) x += pars_[pit].params().leftIndent().inPixels(maxwidth_); @@ -791,7 +791,7 @@ void LyXText::rowBreakPoint(par_type pit, Row & row) const break; } } - + if (!pars_[pit].isInset(i) || pars_[pit].getInset(i)->isChar()) { // some insets are line separators too if (pars_[pit].isLineSeparator(i)) { @@ -1397,7 +1397,7 @@ void LyXText::cursorLeftOneWord(LCursor & cur) if (cur.pos() == 0 && cur.par() != 0) { --cur.par(); cur.pos() = cur.lastpos(); - } else { + } else { // Skip through initial nonword stuff. // Treat floats and insets as words. while (cur.pos() != 0 && !cur.paragraph().isWord(cur.pos() - 1)) @@ -1587,7 +1587,7 @@ void LyXText::Delete(LCursor & cur) CursorSlice sl = cur.top(); cursorRight(cur); if (sl != cur.top()) { - recordUndo(cur, Undo::DELETE, cur.par(), + recordUndo(cur, Undo::DELETE, cur.par(), max(par_type(0), cur.par() - 1)); backspace(cur); } @@ -2019,7 +2019,7 @@ int LyXText::cursorX(CursorSlice const & cur) const return xo_; Row const & row = *pars_[pit].getRow(cur.pos()); - + pos_type pos = cur.pos(); pos_type cursor_vpos = 0; diff --git a/src/text2.C b/src/text2.C index f1725de2a1..6e88247530 100644 --- a/src/text2.C +++ b/src/text2.C @@ -336,7 +336,7 @@ bool changeDepthAllowed(LyXText::DEPTH_CHANGE type, bool LyXText::changeDepthAllowed(LCursor & cur, DEPTH_CHANGE type) const { BOOST_ASSERT(this == cur.text()); - par_type beg, end; + par_type beg, end; getSelectionSpan(cur, beg, end); int max_depth = 0; if (beg != 0) @@ -412,8 +412,8 @@ void LyXText::setFont(LCursor & cur, LyXFont const & font, bool toggleall) par_type const beg = cur.selBegin().par(); par_type const end = cur.selEnd().par(); - DocIterator pos = cur.selectionBegin(); - DocIterator posend = cur.selectionEnd(); + DocIterator pos = cur.selectionBegin(); + DocIterator posend = cur.selectionEnd(); BufferParams const & params = bv()->buffer()->params(); @@ -422,7 +422,7 @@ void LyXText::setFont(LCursor & cur, LyXFont const & font, bool toggleall) f.update(font, params.language, toggleall); setCharFont(pos.par(), pos.pos(), f); } - + redoParagraphs(beg, end + 1); } @@ -819,7 +819,7 @@ void LyXText::updateCounters() bv()->buffer()->params().getLyXTextClass().counters().reset(); bool update_pos = false; - + par_type end = paragraphs().size(); for (par_type pit = 0; pit != end; ++pit) { string const oldLabel = pars_[pit].params().labelString(); @@ -949,7 +949,7 @@ void LyXText::setCursor(CursorSlice & cur, par_type par, // This shouldn't happen. BOOST_ASSERT(false); } - + if (pos < row.pos()) { lyxerr << "dont like 3 please report pos:" << pos << " size: " << para.size() @@ -1017,7 +1017,7 @@ pos_type LyXText::getColumnNearX(par_type pit, { x -= xo_; RowMetrics const r = computeRowMetrics(pit, row); - + pos_type vc = row.pos(); pos_type end = row.endpos(); pos_type c = 0; @@ -1198,7 +1198,7 @@ void LyXText::cursorRight(LCursor & cur) } if (cur.pos() != cur.lastpos()) { - if (!checkAndActivateInset(cur, true)) { + if (!checkAndActivateInset(cur, true)) { setCursor(cur, cur.par(), cur.pos() + 1, true, false); if (false && bidi.isBoundary(*bv()->buffer(), cur.paragraph(), cur.pos())) diff --git a/src/text3.C b/src/text3.C index 8fcea9ed27..feb6c59df4 100644 --- a/src/text3.C +++ b/src/text3.C @@ -595,7 +595,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) if (!cur.mark()) cur.clearSelection(); finishChange(cur, false); - if (cur.par() == 0 && cur.textRow().pos() == 0) { + if (cur.par() == 0 && cur.textRow().pos() == 0) { cur.undispatched(); cmd = FuncRequest(LFUN_FINISHED_UP); } else { @@ -1001,21 +1001,21 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) c = par.getChar(pos - 1); LyXLayout_ptr const & style = par.layout(); - + BufferParams const & bufparams = bv->buffer()->params(); if (!style->pass_thru && par.getFontSettings(bufparams, pos).language()->lang() != "hebrew") { - string arg = cmd.argument; + string arg = cmd.argument; if (arg == "single") cur.insert(new InsetQuotes(c, - bufparams.quotes_language, + bufparams.quotes_language, InsetQuotes::SingleQ)); else if (arg == "double") cur.insert(new InsetQuotes(c, - bufparams.quotes_language, + bufparams.quotes_language, InsetQuotes::DoubleQ)); else - cur.insert(new InsetQuotes(c, bufparams)); + cur.insert(new InsetQuotes(c, bufparams)); } else bv->owner()->dispatch(FuncRequest(LFUN_SELFINSERT, "\"")); @@ -1756,7 +1756,7 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd, case LFUN_LDOTS: case LFUN_END_OF_SENTENCE: case LFUN_SPACE_INSERT: - case LFUN_INSET_DIALOG_SHOW: + case LFUN_INSET_DIALOG_SHOW: break; case LFUN_EMPH: diff --git a/src/undo.C b/src/undo.C index ed7445bba7..06f2b6f4aa 100644 --- a/src/undo.C +++ b/src/undo.C @@ -95,7 +95,7 @@ void recordUndo(Undo::undo_kind kind, undo.pars = ParagraphList(first, last); } - // push the undo entry to undo stack + // push the undo entry to undo stack //lyxerr << "undo record: " << stack.top() << std::endl; stack.push(undo); diff --git a/src/undo.h b/src/undo.h index 67a0bfddc9..b7dfdba70b 100644 --- a/src/undo.h +++ b/src/undo.h @@ -17,7 +17,7 @@ #define UNDO_H #include "dociterator.h" -#include "ParagraphList_fwd.h" +#include "ParagraphList_fwd.h" #include "support/types.h" diff --git a/src/vspace.C b/src/vspace.C index 030af3d647..906bc3432c 100644 --- a/src/vspace.C +++ b/src/vspace.C @@ -83,12 +83,12 @@ char nextToken(string & data) lyx_advance(data, 1); return '+'; } - + if (prefixIs(data, "plus")) { lyx_advance(data, 4); return '+'; } - + if (data[0] == '-') { lyx_advance(data, 1); return '-'; @@ -467,7 +467,7 @@ string const VSpace::asLatexCommand(BufferParams const & params) const case VFILL: return keep_ ? "\\vspace*{\\fill}" : "\\vfill{}"; - case LENGTH: + case LENGTH: return keep_ ? "\\vspace*{" + len_.asLatexString() + '}' : "\\vspace{" + len_.asLatexString() + '}'; @@ -482,7 +482,7 @@ string const VSpace::asLatexCommand(BufferParams const & params) const int VSpace::inPixels(BufferView const & bv) const { // Height of a normal line in pixels (zoom factor considered) - int const default_height = defaultRowHeight(); + int const default_height = defaultRowHeight(); switch (kind_) {