From 897436efbb9bd641b61467d185a2dfae9839e575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Mon, 28 May 2007 22:27:45 +0000 Subject: [PATCH] Whitespace cleanup git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18550 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ASpell.cpp | 2 +- src/Bidi.cpp | 2 +- src/Buffer.cpp | 64 ++-- src/Buffer.h | 2 +- src/BufferParams.cpp | 14 +- src/BufferView.cpp | 64 ++-- src/BufferView.h | 2 +- src/Changes.cpp | 10 +- src/Changes.h | 2 +- src/Converter.cpp | 12 +- src/Converter.h | 8 +- src/ConverterCache.cpp | 40 +-- src/ConverterCache.h | 12 +- src/Counters.cpp | 2 +- src/Cursor.cpp | 6 +- src/CutAndPaste.cpp | 20 +- src/CutAndPaste.h | 4 +- src/DocIterator.cpp | 4 +- src/Encoding.cpp | 20 +- src/Encoding.h | 4 +- src/Font.cpp | 36 +-- src/Font.h | 12 +- src/Format.cpp | 8 +- src/Format.h | 6 +- src/KeyMap.cpp | 2 +- src/KeyMap.h | 4 +- src/KeySequence.h | 8 +- src/LaTeX.cpp | 12 +- src/LaTeX.h | 4 +- src/LaTeXFeatures.cpp | 20 +- src/Length.h | 2 +- src/Lexer.cpp | 8 +- src/Lexer.h | 10 +- src/LyX.cpp | 42 +-- src/LyX.h | 4 +- src/LyXFunc.cpp | 12 +- src/LyXFunc.h | 2 +- src/LyXRC.cpp | 2 +- src/LyXRC.h | 2 +- src/MenuBackend.cpp | 8 +- src/MenuBackend.h | 2 +- src/Messages.cpp | 2 +- src/Messages.h | 2 +- src/Mover.cpp | 4 +- src/Mover.h | 4 +- src/OutputParams.h | 8 +- src/Paragraph.cpp | 68 ++--- src/Paragraph.h | 16 +- src/ParagraphMetrics.h | 2 +- src/PrinterParams.h | 2 +- src/Server.h | 2 +- src/Session.cpp | 6 +- src/Session.h | 14 +- src/Text.cpp | 38 +-- src/Text.h | 4 +- src/Text2.cpp | 40 +-- src/Text3.cpp | 20 +- src/TextClass.cpp | 2 +- src/TextClassList.cpp | 8 +- src/TextClassList.h | 10 +- src/TextMetrics.cpp | 12 +- src/TextMetrics.h | 4 +- src/TocBackend.cpp | 6 +- src/TocBackend.h | 4 +- src/ToolbarBackend.cpp | 12 +- src/ToolbarBackend.h | 2 +- src/Trans.h | 2 +- src/buffer_funcs.cpp | 4 +- src/bufferview_funcs.cpp | 2 +- src/callback.cpp | 4 +- src/client/client.cpp | 1 - src/debug.h | 2 +- src/factory.cpp | 2 +- src/frontends/Alert_pimpl.h | 1 - src/frontends/Application.cpp | 2 +- src/frontends/Application.h | 22 +- src/frontends/FileDialog.h | 2 +- src/frontends/Gui.h | 6 +- src/frontends/LyXView.cpp | 4 +- src/frontends/LyXView.h | 2 +- src/frontends/NoGuiFontMetrics.h | 16 +- src/frontends/Painter.cpp | 2 +- src/frontends/Toolbars.cpp | 22 +- src/frontends/WorkArea.cpp | 10 +- src/frontends/WorkArea.h | 2 +- src/frontends/controllers/ControlCommand.cpp | 2 +- src/frontends/controllers/ControlCommand.h | 2 +- src/frontends/controllers/ControlDocument.cpp | 8 +- src/frontends/controllers/ControlExternal.cpp | 4 +- src/frontends/controllers/ControlExternal.h | 2 +- src/frontends/controllers/ControlMath.cpp | 36 +-- .../controllers/ControlParagraph.cpp | 2 +- src/frontends/controllers/ControlViewSource.h | 2 +- src/frontends/controllers/tests/biblio.cpp | 2 +- src/frontends/qt4/BulletsModule.cpp | 2 +- src/frontends/qt4/DockView.h | 4 +- src/frontends/qt4/EmptyTable.cpp | 4 +- src/frontends/qt4/FileDialog.cpp | 2 +- src/frontends/qt4/FloatPlacement.cpp | 2 - src/frontends/qt4/GuiClipboard.cpp | 4 +- src/frontends/qt4/GuiFontLoader.cpp | 2 +- src/frontends/qt4/GuiFontLoader.h | 4 +- src/frontends/qt4/GuiImplementation.cpp | 4 +- src/frontends/qt4/GuiImplementation.h | 2 +- src/frontends/qt4/GuiSelection.cpp | 4 +- src/frontends/qt4/GuiView.cpp | 32 +- src/frontends/qt4/GuiView.h | 2 +- src/frontends/qt4/GuiWorkArea.cpp | 8 +- src/frontends/qt4/GuiWorkArea.h | 2 +- src/frontends/qt4/IconPalette.cpp | 4 +- src/frontends/qt4/InsertTableWidget.h | 4 +- src/frontends/qt4/LyXFileDialog.cpp | 1 - src/frontends/qt4/PanelStack.cpp | 6 +- src/frontends/qt4/QBox.cpp | 3 +- src/frontends/qt4/QBranch.cpp | 2 +- src/frontends/qt4/QCitation.cpp | 6 +- src/frontends/qt4/QCitation.h | 2 +- src/frontends/qt4/QCitationDialog.cpp | 14 +- src/frontends/qt4/QDelimiterDialog.cpp | 8 +- src/frontends/qt4/QDocument.cpp | 16 +- src/frontends/qt4/QErrorList.cpp | 2 +- src/frontends/qt4/QExternal.cpp | 2 +- src/frontends/qt4/QGraphics.cpp | 26 +- src/frontends/qt4/QGraphicsDialog.cpp | 34 +-- src/frontends/qt4/QInclude.cpp | 2 +- src/frontends/qt4/QIndex.cpp | 2 +- src/frontends/qt4/QKeySymbol.cpp | 6 +- src/frontends/qt4/QLImage.cpp | 2 +- src/frontends/qt4/QLMenubar.cpp | 18 +- src/frontends/qt4/QLPainter.cpp | 9 +- src/frontends/qt4/QLPopupMenu.cpp | 2 +- src/frontends/qt4/QLToolbar.cpp | 8 +- src/frontends/qt4/QListings.cpp | 14 +- src/frontends/qt4/QListings.h | 2 +- src/frontends/qt4/QLog.cpp | 4 +- src/frontends/qt4/QNomencl.cpp | 4 +- src/frontends/qt4/QParagraph.cpp | 12 +- src/frontends/qt4/QParagraph.h | 2 +- src/frontends/qt4/QPrefs.cpp | 2 +- src/frontends/qt4/QRef.cpp | 22 +- src/frontends/qt4/QRef.h | 2 +- src/frontends/qt4/QSearch.cpp | 1 - src/frontends/qt4/QSendto.cpp | 8 +- src/frontends/qt4/QSetBorder.cpp | 10 +- src/frontends/qt4/QShowFile.cpp | 2 +- src/frontends/qt4/QTabular.cpp | 37 ++- src/frontends/qt4/QToc.cpp | 6 +- src/frontends/qt4/QToc.h | 2 +- src/frontends/qt4/QViewSource.cpp | 2 +- src/frontends/qt4/TocModel.cpp | 10 +- src/frontends/qt4/TocWidget.cpp | 26 +- src/frontends/qt4/Validator.cpp | 5 +- src/frontends/qt4/Validator.h | 4 +- src/frontends/qt4/qt_helpers.cpp | 16 +- src/frontends/qt4/qt_helpers.h | 10 +- src/graphics/GraphicsCacheItem.cpp | 2 +- src/graphics/GraphicsConverter.cpp | 58 ++-- src/graphics/GraphicsLoader.cpp | 2 +- src/graphics/PreviewLoader.cpp | 1 - src/insets/ExternalSupport.cpp | 18 +- src/insets/Inset.h | 6 +- src/insets/InsetBibitem.cpp | 34 +-- src/insets/InsetBibtex.cpp | 68 ++--- src/insets/InsetBox.cpp | 6 +- src/insets/InsetBranch.cpp | 6 +- src/insets/InsetBranch.h | 6 +- src/insets/InsetCaption.cpp | 10 +- src/insets/InsetCaption.h | 10 +- src/insets/InsetCharStyle.cpp | 14 +- src/insets/InsetCharStyle.h | 6 +- src/insets/InsetCitation.cpp | 10 +- src/insets/InsetCitation.h | 6 +- src/insets/InsetCollapsable.cpp | 6 +- src/insets/InsetCommand.cpp | 6 +- src/insets/InsetCommandParams.cpp | 8 +- src/insets/InsetERT.cpp | 2 +- src/insets/InsetERT.h | 2 +- src/insets/InsetEnvironment.cpp | 4 +- src/insets/InsetEnvironment.h | 4 +- src/insets/InsetExternal.cpp | 28 +- src/insets/InsetExternal.h | 6 +- src/insets/InsetFloat.cpp | 10 +- src/insets/InsetFloat.h | 6 +- src/insets/InsetFloatList.cpp | 6 +- src/insets/InsetFloatList.h | 6 +- src/insets/InsetFoot.cpp | 6 +- src/insets/InsetFoot.h | 6 +- src/insets/InsetGraphics.cpp | 28 +- src/insets/InsetGraphics.h | 6 +- src/insets/InsetHFill.cpp | 4 +- src/insets/InsetHFill.h | 2 +- src/insets/InsetInclude.cpp | 46 +-- src/insets/InsetInclude.h | 8 +- src/insets/InsetIndex.cpp | 2 +- src/insets/InsetLabel.cpp | 10 +- src/insets/InsetLine.cpp | 4 +- src/insets/InsetLine.h | 4 +- src/insets/InsetListings.cpp | 4 +- src/insets/InsetListingsParams.cpp | 288 +++++++++--------- src/insets/InsetListingsParams.h | 8 +- src/insets/InsetMarginal.cpp | 6 +- src/insets/InsetMarginal.h | 6 +- src/insets/InsetNewline.cpp | 2 +- src/insets/InsetNomencl.cpp | 2 +- src/insets/InsetNote.cpp | 6 +- src/insets/InsetOptArg.cpp | 6 +- src/insets/InsetOptArg.h | 6 +- src/insets/InsetPagebreak.cpp | 6 +- src/insets/InsetPagebreak.h | 10 +- src/insets/InsetQuotes.cpp | 8 +- src/insets/InsetRef.cpp | 22 +- src/insets/InsetSpace.cpp | 10 +- src/insets/InsetSpace.h | 6 +- src/insets/InsetSpecialChar.cpp | 12 +- src/insets/InsetSpecialChar.h | 6 +- src/insets/InsetTOC.cpp | 4 +- src/insets/InsetTOC.h | 4 +- src/insets/InsetTabular.cpp | 50 +-- src/insets/InsetTabular.h | 26 +- src/insets/InsetText.cpp | 8 +- src/insets/InsetUrl.cpp | 10 +- src/insets/InsetUrl.h | 6 +- src/insets/InsetVSpace.cpp | 6 +- src/insets/InsetVSpace.h | 6 +- src/insets/InsetWrap.cpp | 10 +- src/insets/InsetWrap.h | 6 +- src/insets/RenderBase.h | 2 +- src/insets/RenderButton.cpp | 2 +- src/insets/RenderGraphic.cpp | 2 +- src/lyxfind.cpp | 8 +- src/mathed/InsetFormulaMacro.cpp | 6 +- src/mathed/InsetFormulaMacro.h | 6 +- src/mathed/InsetMath.cpp | 6 +- src/mathed/InsetMath.h | 2 +- src/mathed/InsetMathBig.cpp | 2 +- src/mathed/InsetMathDelim.cpp | 2 +- src/mathed/InsetMathFrac.cpp | 12 +- src/mathed/InsetMathHull.cpp | 8 +- src/mathed/InsetMathHull.h | 4 +- src/mathed/InsetMathNest.cpp | 2 +- src/mathed/InsetMathRef.cpp | 2 +- src/mathed/InsetMathScript.cpp | 2 +- src/mathed/MacroTable.h | 4 +- src/mathed/MathData.h | 2 +- src/mathed/MathMacro.cpp | 32 +- src/mathed/MathMacroArgument.cpp | 2 +- src/mathed/MathMacroTemplate.cpp | 10 +- src/mathed/MathMacroTemplate.h | 2 +- src/mathed/MathParser.cpp | 2 +- src/output_docbook.cpp | 2 +- src/output_latex.cpp | 8 +- src/output_latex.h | 8 +- src/paragraph_funcs.cpp | 4 +- src/rowpainter.cpp | 30 +- src/sgml.cpp | 2 +- src/support/FileName.cpp | 4 +- src/support/docstream.cpp | 26 +- src/support/filetools.cpp | 10 +- src/support/filetools.h | 2 +- src/support/fs_extras.cpp | 11 +- src/support/kill.cpp | 2 +- src/support/lstrings.cpp | 6 +- src/support/lyxlib.h | 2 +- src/support/os_cygwin.cpp | 8 +- src/support/os_unix.cpp | 8 +- src/support/os_win32.cpp | 8 +- src/support/qstring_helpers.cpp | 2 +- src/tex2lyx/text.cpp | 16 +- src/toc.cpp | 2 +- 269 files changed, 1362 insertions(+), 1374 deletions(-) diff --git a/src/ASpell.cpp b/src/ASpell.cpp index cafa53b3d6..51d1ed4bf9 100644 --- a/src/ASpell.cpp +++ b/src/ASpell.cpp @@ -145,7 +145,7 @@ docstring const ASpell::nextMiss() docstring const ASpell::error() { char const * err = 0; - + if (spell_error_object && aspell_error_number(spell_error_object) != 0) { err = aspell_error_message(spell_error_object); } diff --git a/src/Bidi.cpp b/src/Bidi.cpp index df1f7495d6..5c482776c8 100644 --- a/src/Bidi.cpp +++ b/src/Bidi.cpp @@ -210,7 +210,7 @@ bool Bidi::isBoundary(Buffer const & buf, Paragraph const & par, } -bool reverseDirectionNeeded(Cursor const & cur) +bool reverseDirectionNeeded(Cursor const & cur) { /* * We determine the directions based on the direction of the diff --git a/src/Buffer.cpp b/src/Buffer.cpp index d4f1f9d77d..15246e680d 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -510,20 +510,20 @@ bool Buffer::readDocument(Lexer & lex) if (params().outputChanges) { bool dvipost = LaTeXFeatures::isAvailable("dvipost"); bool xcolorsoul = LaTeXFeatures::isAvailable("soul") && - LaTeXFeatures::isAvailable("xcolor"); - + LaTeXFeatures::isAvailable("xcolor"); + if (!dvipost && !xcolorsoul) { Alert::warning(_("Changes not shown in LaTeX output"), - _("Changes will not be highlighted in LaTeX output, " - "because neither dvipost nor xcolor/soul are installed.\n" - "Please install these packages or redefine " - "\\lyxadded and \\lyxdeleted in the LaTeX preamble.")); + _("Changes will not be highlighted in LaTeX output, " + "because neither dvipost nor xcolor/soul are installed.\n" + "Please install these packages or redefine " + "\\lyxadded and \\lyxdeleted in the LaTeX preamble.")); } else if (!xcolorsoul) { Alert::warning(_("Changes not shown in LaTeX output"), - _("Changes will not be highlighted in LaTeX output " - "when using pdflatex, because xcolor and soul are not installed.\n" - "Please install both packages or redefine " - "\\lyxadded and \\lyxdeleted in the LaTeX preamble.")); + _("Changes will not be highlighted in LaTeX output " + "when using pdflatex, because xcolor and soul are not installed.\n" + "Please install both packages or redefine " + "\\lyxadded and \\lyxdeleted in the LaTeX preamble.")); } } @@ -718,10 +718,10 @@ Buffer::ReadStatus Buffer::readFile(Lexer & lex, FileName const & filename, } ostringstream command; command << os::python() - << ' ' << quoteName(lyx2lyx.toFilesystemEncoding()) - << " -t " << convert(LYX_FORMAT) - << " -o " << quoteName(tmpfile.toFilesystemEncoding()) - << ' ' << quoteName(filename.toFilesystemEncoding()); + << ' ' << quoteName(lyx2lyx.toFilesystemEncoding()) + << " -t " << convert(LYX_FORMAT) + << " -o " << quoteName(tmpfile.toFilesystemEncoding()) + << ' ' << quoteName(filename.toFilesystemEncoding()); string const command_str = command.str(); LYXERR(Debug::INFO) << "Running '" @@ -776,16 +776,16 @@ bool Buffer::save() const backupName = FileName(fileName() + '~'); if (!lyxrc.backupdir_path.empty()) backupName = FileName(addName(lyxrc.backupdir_path, - subst(os::internal_path(backupName.absFilename()), '/', '!'))); + subst(os::internal_path(backupName.absFilename()), '/', '!'))); try { fs::copy_file(encodedFilename, backupName.toFilesystemEncoding(), false); madeBackup = true; } catch (fs::filesystem_error const & fe) { Alert::error(_("Backup failure"), - bformat(_("Cannot create backup file %1$s.\n" - "Please check whether the directory exists and is writeable."), - from_utf8(backupName.absFilename()))); + bformat(_("Cannot create backup file %1$s.\n" + "Please check whether the directory exists and is writeable."), + from_utf8(backupName.absFilename()))); LYXERR(Debug::DEBUG) << "Fs error: " << fe.what() << endl; } } @@ -1000,8 +1000,8 @@ void Buffer::writeLaTeXSource(odocstream & os, !params().language->babel().empty()) { // FIXME UNICODE os << from_utf8(subst(lyxrc.language_command_begin, - "$$lang", - params().language->babel())) + "$$lang", + params().language->babel())) << '\n'; texrow().newline(); } @@ -1047,8 +1047,8 @@ void Buffer::writeLaTeXSource(odocstream & os, if (!lyxrc.language_auto_end && !params().language->babel().empty()) { os << from_utf8(subst(lyxrc.language_command_end, - "$$lang", - params().language->babel())) + "$$lang", + params().language->babel())) << '\n'; texrow().newline(); } @@ -1098,7 +1098,7 @@ void Buffer::makeDocBookFile(FileName const & fname, LYXERR(Debug::LATEX) << "makeDocBookFile..." << endl; //ofstream ofs; - odocfstream ofs; + odocfstream ofs; if (!openFileWrite(ofs, fname)) return; @@ -1126,12 +1126,12 @@ void Buffer::writeDocBookSource(odocstream & os, string const & fname, if (runparams.flavor == OutputParams::XML) os << "\n"; - // FIXME UNICODE + // FIXME UNICODE os << "\n\n"; } @@ -1233,9 +1233,9 @@ void Buffer::validate(LaTeXFeatures & features) const if (params().outputChanges) { bool dvipost = LaTeXFeatures::isAvailable("dvipost"); bool xcolorsoul = LaTeXFeatures::isAvailable("soul") && - LaTeXFeatures::isAvailable("xcolor"); - - if (features.runparams().flavor == OutputParams::LATEX) { + LaTeXFeatures::isAvailable("xcolor"); + + if (features.runparams().flavor == OutputParams::LATEX) { if (dvipost) { features.require("ct-dvipost"); features.require("dvipost"); @@ -1243,7 +1243,7 @@ void Buffer::validate(LaTeXFeatures & features) const features.require("ct-xcolor-soul"); features.require("soul"); features.require("xcolor"); - } else { + } else { features.require("ct-none"); } } else if (features.runparams().flavor == OutputParams::PDFLATEX ) { @@ -1255,7 +1255,7 @@ void Buffer::validate(LaTeXFeatures & features) const } else { features.require("ct-none"); } - } + } } // AMS Style is at document level diff --git a/src/Buffer.h b/src/Buffer.h index 586c47db02..8a81bb0703 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -395,7 +395,7 @@ private: \return \c false if method fails. */ ReadStatus readFile(Lexer &, support::FileName const & filename, - bool fromString = false); + bool fromString = false); /// Use the Pimpl idiom to hide the internals. class Impl; diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index f8d23ba3af..f1ef2b4f89 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -474,11 +474,11 @@ string const BufferParams::readToken(Lexer & lex, string const & token) if (!getTextClass().isTeXClassAvailable()) { docstring const msg = bformat(_("The layout file requested by this document,\n" - "%1$s.layout,\n" - "is not usable. This is probably because a LaTeX\n" - "class or style file required by it is not\n" - "available. See the Customization documentation\n" - "for more information.\n"), from_utf8(classname)); + "%1$s.layout,\n" + "is not usable. This is probably because a LaTeX\n" + "class or style file required by it is not\n" + "available. See the Customization documentation\n" + "for more information.\n"), from_utf8(classname)); frontend::Alert::warning(_("Document class not available"), msg + _("LyX will not be able to produce output.")); } @@ -748,7 +748,7 @@ void BufferParams::writeFile(ostream & os) const << "\n\\papersides " << sides << "\n\\paperpagestyle " << pagestyle << '\n'; if (!listings_params.empty()) - os << "\\listings_params \"" << + os << "\\listings_params \"" << InsetListingsParams(listings_params).encodedString() << "\"\n"; for (int i = 0; i < 4; ++i) { if (user_defined_bullet(i) != ITEMIZE_DEFAULTS[i]) { @@ -794,7 +794,7 @@ bool BufferParams::writeLaTeX(odocstream & os, LaTeXFeatures & features, } // custom, A3, B3 and B4 paper sizes need geometry - bool nonstandard_papersize = papersize == PAPER_B3 + bool nonstandard_papersize = papersize == PAPER_B3 || papersize == PAPER_B4 || papersize == PAPER_A3 || papersize == PAPER_CUSTOM; diff --git a/src/BufferView.cpp b/src/BufferView.cpp index e89151d5ac..e5ded39267 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -208,9 +208,9 @@ void BufferView::setBuffer(Buffer * b) if (!buffer_) return; - + LYXERR(Debug::INFO) << BOOST_CURRENT_FUNCTION - << "Buffer addr: " << buffer_ << endl; + << "Buffer addr: " << buffer_ << endl; cursor_.push(buffer_->inset()); cursor_.resetAnchor(); buffer_->text().setCurrentFont(cursor_); @@ -228,7 +228,7 @@ void BufferView::setBuffer(Buffer * b) // example if this Buffer has been modified by another view. cursor_.fixIfBroken(); } - updateMetrics(false); + updateMetrics(false); if (graphics::Previews::status() != LyXRC::PREVIEW_OFF) graphics::Previews::get().generateBufferPreviews(*buffer_); } @@ -384,7 +384,7 @@ bool BufferView::update(Update::flags flags) return true; } - if (flags == Update::FitCursor + if (flags == Update::FitCursor || flags == (Update::Decoration | Update::FitCursor)) { bool const fit_cursor = fitCursor(); // tell the frontend to update the screen if needed. @@ -563,7 +563,7 @@ void BufferView::saveBookmark(unsigned int idx) { // tenatively save bookmark, id and pos will be used to // acturately locate a bookmark in a 'live' lyx session. - // pit and pos will be updated with bottom level pit/pos + // pit and pos will be updated with bottom level pit/pos // when lyx exits. LyX::ref().session().bookmarks().save( FileName(buffer_->fileName()), @@ -609,7 +609,7 @@ boost::tuple BufferView::moveToPosition(pit_type bottom } } // if top_id == 0, or searching through top_id failed - // This is the case for a 'restored' bookmark when only bottom + // This is the case for a 'restored' bookmark when only bottom // (document level) pit was saved. Because of this, bookmark // restoration is inaccurate. If a bookmark was within an inset, // it will be restored to the left of the outmost inset that contains @@ -619,7 +619,7 @@ boost::tuple BufferView::moveToPosition(pit_type bottom it.pit() = bottom_pit; it.pos() = min(bottom_pos, it.paragraph().size()); setCursor(it); - return boost::make_tuple(it.pit(), it.pos(), + return boost::make_tuple(it.pit(), it.pos(), it.paragraph().id()); } // both methods fail @@ -901,20 +901,20 @@ Update::flags BufferView::dispatch(FuncRequest const & cmd) if (buffer_->params().outputChanges) { bool dvipost = LaTeXFeatures::isAvailable("dvipost"); bool xcolorsoul = LaTeXFeatures::isAvailable("soul") && - LaTeXFeatures::isAvailable("xcolor"); - + LaTeXFeatures::isAvailable("xcolor"); + if (!dvipost && !xcolorsoul) { Alert::warning(_("Changes not shown in LaTeX output"), - _("Changes will not be highlighted in LaTeX output, " - "because neither dvipost nor xcolor/soul are installed.\n" - "Please install these packages or redefine " - "\\lyxadded and \\lyxdeleted in the LaTeX preamble.")); + _("Changes will not be highlighted in LaTeX output, " + "because neither dvipost nor xcolor/soul are installed.\n" + "Please install these packages or redefine " + "\\lyxadded and \\lyxdeleted in the LaTeX preamble.")); } else if (!xcolorsoul) { Alert::warning(_("Changes not shown in LaTeX output"), - _("Changes will not be highlighted in LaTeX output " - "when using pdflatex, because xcolor and soul are not installed.\n" - "Please install both packages or redefine " - "\\lyxadded and \\lyxdeleted in the LaTeX preamble.")); + _("Changes will not be highlighted in LaTeX output " + "when using pdflatex, because xcolor and soul are not installed.\n" + "Please install both packages or redefine " + "\\lyxadded and \\lyxdeleted in the LaTeX preamble.")); } } break; @@ -1148,7 +1148,7 @@ Inset const * BufferView::getCoveringInset(Text const & text, int x, int y) Inset * const inset = iit->inset; if (inset->covers(*this, x, y)) { if (!inset->descendable()) - // No need to go further down if the inset is not + // No need to go further down if the inset is not // descendable. return inset; @@ -1158,7 +1158,7 @@ Inset const * BufferView::getCoveringInset(Text const & text, int x, int y) Text const * inner_text = inset->getText(i); if (inner_text) { // Try deeper. - Inset const * inset_deeper = + Inset const * inset_deeper = getCoveringInset(*inner_text, x, y); if (inset_deeper) return inset_deeper; @@ -1199,11 +1199,11 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0) // make sure we stay within the screen... cmd.y = min(max(cmd.y, -1), height_); - + if (cmd.action == LFUN_MOUSE_MOTION && cmd.button() == mouse_button::none) { - + // Get inset under mouse, if there is one. - Inset const * covering_inset = + Inset const * covering_inset = getCoveringInset(buffer_->text(), cmd.x, cmd.y); if (covering_inset == last_inset_) // Same inset, no need to do anything... @@ -1224,9 +1224,9 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0) // not expose the button for redraw. We adjust here the metrics dimension // to enable a full redraw. // FIXME: It is possible to redraw only the area around the button! - if (need_redraw + if (need_redraw && metrics_info_.update_strategy == SingleParUpdate) { - // FIXME: It should be possible to redraw only the area around + // FIXME: It should be possible to redraw only the area around // the button by doing this: // //metrics_info_.singlepar = false; @@ -1252,7 +1252,7 @@ bool BufferView::workAreaDispatch(FuncRequest const & cmd0) // This should be changed if it is further utilized. return need_redraw; } - + // Build temporary cursor. Inset * inset = buffer_->text().editXY(cur, cmd.x, cmd.y); @@ -1340,7 +1340,7 @@ TextMetrics & BufferView::textMetrics(Text const * t) if (tmc_it == text_metrics_.end()) { tmc_it = text_metrics_.insert( make_pair(t, TextMetrics(this, const_cast(t)))).first; - } + } return tmc_it->second; } @@ -1381,7 +1381,7 @@ bool BufferView::checkDepm(Cursor & cur, Cursor & old) if (need_anchor_change) cur.resetAnchor(); - + if (!changed) return false; @@ -1415,8 +1415,8 @@ bool BufferView::mouseSetCursor(Cursor & cur) // position is in the nucleus of the inset, notifyCursorLeaves // will kill the script inset itself. So we check all the // elements of the cursor to make sure that they are correct. - // For an example, see bug 2933: - // http://bugzilla.lyx.org/show_bug.cgi?id=2933 + // For an example, see bug 2933: + // http://bugzilla.lyx.org/show_bug.cgi?id=2933 // The code below could maybe be moved to a DocIterator method. //lyxerr << "cur before " << cur <range.start = it->range.start; (it + 1)->change.changetime = max(it->change.changetime, - (it + 1)->change.changetime); + (it + 1)->change.changetime); table_.erase(it); // start again it = table_.begin(); @@ -314,7 +314,7 @@ int Changes::latexMarkChange(odocstream & os, BufferParams const & bparams, if (change.type == Change::DELETED) { docstring str = "\\lyxdeleted{" + bparams.authors().get(change.author).name() + "}{" + - chgTime + "}{"; + chgTime + "}{"; os << str; column += str.size(); } else if (change.type == Change::INSERTED) { diff --git a/src/Changes.h b/src/Changes.h index d7041480cb..1915533e96 100644 --- a/src/Changes.h +++ b/src/Changes.h @@ -79,7 +79,7 @@ public: /// output latex to mark a transition between two change types /// returns length of text outputted static int latexMarkChange(odocstream & os, BufferParams const & bparams, - Change const & oldChange, Change const & change); + Change const & oldChange, Change const & change); /// output .lyx file format for transitions between changes static void lyxMarkChange(std::ostream & os, int & column, diff --git a/src/Converter.cpp b/src/Converter.cpp index cd6ec60146..8aa0b4bbfa 100644 --- a/src/Converter.cpp +++ b/src/Converter.cpp @@ -288,10 +288,10 @@ OutputParams::FLAVOR Converters::getFlavor(Graph::EdgePath const & path) bool Converters::convert(Buffer const * buffer, - FileName const & from_file, FileName const & to_file, - FileName const & orig_from, - string const & from_format, string const & to_format, - ErrorList & errorList, int conversionflags) + FileName const & from_file, FileName const & to_file, + FileName const & orig_from, + string const & from_format, string const & to_format, + ErrorList & errorList, int conversionflags) { if (from_format == to_format) return move(from_format, from_file, to_file, false); @@ -401,10 +401,10 @@ bool Converters::convert(Buffer const * buffer, // FIXME UNICODE string const infile2 = (conv.original_dir) ? infile.absFilename() : to_utf8(makeRelPath(from_utf8(infile.absFilename()), - from_utf8(path))); + from_utf8(path))); string const outfile2 = (conv.original_dir) ? outfile.absFilename() : to_utf8(makeRelPath(from_utf8(outfile.absFilename()), - from_utf8(path))); + from_utf8(path))); string command = conv.command; command = subst(command, token_from, quoteName(infile2)); diff --git a/src/Converter.h b/src/Converter.h index 2849e877e4..56b83a3063 100644 --- a/src/Converter.h +++ b/src/Converter.h @@ -119,10 +119,10 @@ public: }; /// bool convert(Buffer const * buffer, - support::FileName const & from_file, support::FileName const & to_file, - support::FileName const & orig_from, - std::string const & from_format, std::string const & to_format, - ErrorList & errorList, int conversionflags = none); + support::FileName const & from_file, support::FileName const & to_file, + support::FileName const & orig_from, + std::string const & from_format, std::string const & to_format, + ErrorList & errorList, int conversionflags = none); /// void update(Formats const & formats); /// diff --git a/src/ConverterCache.cpp b/src/ConverterCache.cpp index 4ce7aca32a..16e0c7f747 100644 --- a/src/ConverterCache.cpp +++ b/src/ConverterCache.cpp @@ -62,7 +62,7 @@ class CacheItem { public: CacheItem() {} CacheItem(FileName const & orig_from, string const & to_format, - time_t t, unsigned long c) + time_t t, unsigned long c) : timestamp(t), checksum(c) { std::ostringstream os; @@ -70,9 +70,9 @@ public: << '-' << to_format; cache_name = FileName(addName(cache_dir.absFilename(), os.str())); LYXERR(Debug::FILES) << "Add file cache item " << orig_from - << ' ' << to_format << ' ' << cache_name - << ' ' << timestamp << ' ' << checksum - << '.' << std::endl; + << ' ' << to_format << ' ' << cache_name + << ' ' << timestamp << ' ' << checksum + << '.' << std::endl; } ~CacheItem() {} FileName cache_name; @@ -258,8 +258,8 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format, converted_file.empty()) return; LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from - << ' ' << to_format << ' ' << converted_file - << std::endl; + << ' ' << to_format << ' ' << converted_file + << std::endl; // Is the file in the cache already? CacheItem * item = pimpl_->find(orig_from, to_format); @@ -268,12 +268,12 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format, Mover const & mover = getMover(to_format); if (item) { LYXERR(Debug::FILES) << "ConverterCache::add(" << orig_from << "):\n" - "The file is already in the cache." - << std::endl; + "The file is already in the cache." + << std::endl; // First test for timestamp if (timestamp == item->timestamp) { LYXERR(Debug::FILES) << "Same timestamp." - << std::endl; + << std::endl; return; } else { // Maybe the contents is still the same? @@ -281,16 +281,16 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format, unsigned long const checksum = support::sum(orig_from); if (checksum == item->checksum) { LYXERR(Debug::FILES) << "Same checksum." - << std::endl; + << std::endl; return; } item->checksum = checksum; } if (!mover.copy(converted_file, item->cache_name, 0600)) LYXERR(Debug::FILES) << "ConverterCache::add(" - << orig_from << "):\n" - "Could not copy file." - << std::endl; + << orig_from << "):\n" + "Could not copy file." + << std::endl; } else { CacheItem new_item(orig_from, to_format, timestamp, support::sum(orig_from)); @@ -302,9 +302,9 @@ void ConverterCache::add(FileName const & orig_from, string const & to_format, format_cache.cache[to_format] = new_item; } else LYXERR(Debug::FILES) << "ConverterCache::add(" - << orig_from << "):\n" - "Could not copy file." - << std::endl; + << orig_from << "):\n" + "Could not copy file." + << std::endl; } } @@ -315,7 +315,7 @@ void ConverterCache::remove(FileName const & orig_from, if (!lyxrc.use_converter_cache || orig_from.empty()) return; LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from - << ' ' << to_format << std::endl; + << ' ' << to_format << std::endl; CacheType::iterator const it1 = pimpl_->cache.find(orig_from); if (it1 == pimpl_->cache.end()) @@ -376,7 +376,7 @@ bool ConverterCache::inCache(FileName const & orig_from, if (!lyxrc.use_converter_cache || orig_from.empty()) return false; LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from - << ' ' << to_format << std::endl; + << ' ' << to_format << std::endl; CacheItem * const item = pimpl_->find(orig_from, to_format); if (!item) { @@ -402,7 +402,7 @@ FileName const & ConverterCache::cacheName(FileName const & orig_from, string const & to_format) const { LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from - << ' ' << to_format << std::endl; + << ' ' << to_format << std::endl; CacheItem * const item = pimpl_->find(orig_from, to_format); BOOST_ASSERT(item); @@ -416,7 +416,7 @@ bool ConverterCache::copy(FileName const & orig_from, string const & to_format, if (!lyxrc.use_converter_cache || orig_from.empty() || dest.empty()) return false; LYXERR(Debug::FILES) << BOOST_CURRENT_FUNCTION << ' ' << orig_from - << ' ' << to_format << ' ' << dest << std::endl; + << ' ' << to_format << ' ' << dest << std::endl; CacheItem * const item = pimpl_->find(orig_from, to_format); BOOST_ASSERT(item); diff --git a/src/ConverterCache.h b/src/ConverterCache.h index d80b3af05c..4a55810d6f 100644 --- a/src/ConverterCache.h +++ b/src/ConverterCache.h @@ -63,30 +63,30 @@ public: * the cache if it is not already in or not up to date. */ void add(support::FileName const & orig_from, std::string const & to_format, - support::FileName const & converted_file) const; + support::FileName const & converted_file) const; /// Remove a file from the cache. void remove(support::FileName const & orig_from, - std::string const & to_format) const; + std::string const & to_format) const; /// Remove all cached \p from_format -> \p to_format conversions void remove_all(std::string const & from_format, - std::string const & to_format) const; + std::string const & to_format) const; /** * Returns \c true if \c orig_from converted to \c to_format is in * the cache and up to date. */ bool inCache(support::FileName const & orig_from, - std::string const & to_format) const; + std::string const & to_format) const; /// Get the name of the cached file support::FileName const & cacheName(support::FileName const & orig_from, - std::string const & to_format) const; + std::string const & to_format) const; /// Copy the file from the cache to \p dest bool copy(support::FileName const & orig_from, std::string const & to_format, - support::FileName const & dest) const; + support::FileName const & dest) const; private: /** Make the c-tor, d-tor private so we can control how many objects diff --git a/src/Counters.cpp b/src/Counters.cpp index 61a4a239c8..d38bd5d868 100644 --- a/src/Counters.cpp +++ b/src/Counters.cpp @@ -326,7 +326,7 @@ docstring Counters::counterLabel(docstring const & format) docstring const numbertype(label, i + 1, j - i - 1); docstring const counter(label, j + 1, k - j - 1); docstring const rep = labelItem(counter, numbertype); - label = docstring(label, 0, i) + rep + label = docstring(label, 0, i) + rep + docstring(label, k + 1, docstring::npos); //lyxerr << " : " << " (" << counter << "," // << numbertype << ") -> " << label << endl; diff --git a/src/Cursor.cpp b/src/Cursor.cpp index b0154fd320..123de2cd2d 100644 --- a/src/Cursor.cpp +++ b/src/Cursor.cpp @@ -250,7 +250,7 @@ namespace { odocstringstream ods; ods << '\n'; // only add blank line if we're not in an ERT or Listings inset - if (par.ownerCode() != Inset::ERT_CODE + if (par.ownerCode() != Inset::ERT_CODE && par.ownerCode() != Inset::LISTINGS_CODE) ods << '\n'; return ods.str(); @@ -785,7 +785,7 @@ bool Cursor::backspace() // If empty cell, and not part of a big cell if (lastpos() == 0 && inset().nargs() == 1) { popLeft(); - // Directly delete empty cell: [|[]] => [|] + // Directly delete empty cell: [|[]] => [|] if (inMathed()) { plainErase(); resetAnchor(); @@ -844,7 +844,7 @@ bool Cursor::erase() bool one_cell = inset().nargs() == 1; if (one_cell && lastpos() == 0) { popLeft(); - // Directly delete empty cell: [|[]] => [|] + // Directly delete empty cell: [|[]] => [|] if (inMathed()) { plainErase(); resetAnchor(); diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index 07c74cd3ed..85c6b122f7 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -146,10 +146,10 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist, // If we are in an inset which returns forceDefaultParagraphs, // set the paragraphs to default if (cur.inset().forceDefaultParagraphs(cur.idx())) { - Layout_ptr const layout = + Layout_ptr const layout = buffer.params().getTextClass().defaultLayout(); ParagraphList::iterator const end = insertion.end(); - for (ParagraphList::iterator par = insertion.begin(); + for (ParagraphList::iterator par = insertion.begin(); par != end; ++par) par->layout(layout); } @@ -198,7 +198,7 @@ pasteSelectionHelper(Cursor & cur, ParagraphList const & parlist, } tmpbuf->setChange(Change(buffer.params().trackChanges ? - Change::INSERTED : Change::UNCHANGED)); + Change::INSERTED : Change::UNCHANGED)); } bool const empty = pars[pit].empty(); @@ -335,7 +335,7 @@ PitPosPair eraseSelectionHelper(BufferParams const & params, void putClipboard(ParagraphList const & paragraphs, textclass_type textclass, - docstring const & plaintext) + docstring const & plaintext) { // For some strange reason gcc 3.2 and 3.3 do not accept // Buffer buffer(string(), false); @@ -382,7 +382,7 @@ void copySelectionHelper(Buffer const & buf, ParagraphList & pars, // to the buffer language. if (it->ownerCode() == Inset::ERT_CODE || it->ownerCode() == Inset::LISTINGS_CODE) { it->changeLanguage(buf.params(), latex_language, - buf.getLanguage()); + buf.getLanguage()); } it->setInsetOwner(0); } @@ -498,7 +498,7 @@ std::vector const availableSelections(Buffer const & buffer) asciiSel += pit->asString(buffer, false); if (asciiSel.size() > 25) { asciiSel.replace(22, docstring::npos, - from_ascii("...")); + from_ascii("...")); break; } } @@ -563,7 +563,7 @@ void cutSelection(Cursor & cur, bool doclear, bool realcut) cur.pit() = endpit; // sometimes necessary - if (doclear + if (doclear && text->paragraphs()[begpit].stripLeadingSpaces(bp.trackChanges)) cur.fixIfBroken(); @@ -651,7 +651,7 @@ void copySelectionToStack() void copySelection(Cursor & cur, docstring const & plaintext) { // In tablemode, because copy and paste actually use special table stack - // we do not attemp to get selected paragraphs under cursor. Instead, a + // we do not attemp to get selected paragraphs under cursor. Instead, a // paragraph with the plain text version is generated so that table cells // can be pasted as pure text somewhere else. if (cur.selBegin().idx() != cur.selEnd().idx()) { @@ -675,7 +675,7 @@ void saveSelection(Cursor & cur) LYXERR(Debug::ACTION) << BOOST_CURRENT_FUNCTION << ": `" << to_utf8(cur.selectionAsString(true)) << "'." << endl; - + if (cur.selection()) copySelectionToStack(cur, selectionBuffer); // tell X whether we now have a valid selection @@ -784,7 +784,7 @@ void pasteSelection(Cursor & cur, ErrorList & errorList) return; recordUndo(cur); pasteParagraphList(cur, selectionBuffer[0].first, - selectionBuffer[0].second, errorList); + selectionBuffer[0].second, errorList); cur.setSelection(); } diff --git a/src/CutAndPaste.h b/src/CutAndPaste.h index 5ede3f39d5..220e2e217f 100644 --- a/src/CutAndPaste.h +++ b/src/CutAndPaste.h @@ -56,7 +56,7 @@ void replaceSelection(Cursor & cur); * they get merged. * \param realcut If this is true: Push the selection to the cut buffer and * system clipboard. Set this to false to only delete the - * selection. + * selection. */ void cutSelection(Cursor & cur, bool doclear = true, bool realcut = true); /// Push the current selection to the cut buffer and the system clipboard. @@ -97,7 +97,7 @@ void pasteParagraphList(Cursor & cur, ParagraphList const & parlist, * It changes layouts and character styles. */ void switchBetweenClasses(textclass_type c1, textclass_type c2, - InsetText & in, ErrorList &); + InsetText & in, ErrorList &); /// Get the current selection as a string. Does not change the selection. /// Does only work if the whole selection is in mathed. diff --git a/src/DocIterator.cpp b/src/DocIterator.cpp index 8f2326f9eb..bdeff6980a 100644 --- a/src/DocIterator.cpp +++ b/src/DocIterator.cpp @@ -561,14 +561,14 @@ void DocIterator::updateInsets(Inset * inset) bool DocIterator::fixIfBroken() { bool fixed = false; - + for (size_t i = slices_.size() - 1; i != 0; --i) if (!slices_[i].isValid()) { pop_back(); fixed = true; } - // The top level CursorSlice should always be valid. + // The top level CursorSlice should always be valid. BOOST_ASSERT(slices_[0].isValid()); if (idx() > lastidx()) { diff --git a/src/Encoding.cpp b/src/Encoding.cpp index eb2a1e7362..e1001bf9ef 100644 --- a/src/Encoding.cpp +++ b/src/Encoding.cpp @@ -131,7 +131,7 @@ char_type const max_ucs4 = 0x110000; Encoding::Encoding(string const & n, string const & l, string const & i, - bool f, Encoding::Package p) + bool f, Encoding::Package p) : Name_(n), LatexName_(l), iconvName_(i), fixedwidth_(f), package_(p) { if (n == "ascii") { @@ -241,10 +241,10 @@ bool Encodings::isComposeChar_hebrew(char_type c) bool Encodings::is_arabic_special(char_type c) { return (c >= 0x0621 && c <= 0x0625) || - c == 0x0627 || c == 0x0629 || - c == 0x062f || c == 0x0648 || + c == 0x0627 || c == 0x0629 || + c == 0x062f || c == 0x0648 || (c >= 0x0630 && c <= 0x0632) || - c == 0x0649; + c == 0x0649; } @@ -356,8 +356,8 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile) info.force = true; else lyxerr << "Ignoring unknown flag `" << flag - << "' for symbol `0x" - << std::hex << symbol << std::dec + << "' for symbol `0x" + << std::hex << symbol << std::dec << "'." << endl; } @@ -405,7 +405,7 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile) fixedwidth = false; else lex.printError("Encodings::read: " - "Unknown width: `$$Token'"); + "Unknown width: `$$Token'"); lex.next(); string const p = lex.getString(); Encoding::Package package; @@ -417,11 +417,11 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile) package = Encoding::CJK; else lex.printError("Encodings::read: " - "Unknown package: `$$Token'"); + "Unknown package: `$$Token'"); LYXERR(Debug::INFO) << "Reading encoding " << name << endl; encodinglist[name] = Encoding(name, latexname, - iconvname, fixedwidth, - package); + iconvname, fixedwidth, + package); if (lex.lex() != et_end) lex.printError("Encodings::read: " "missing end"); diff --git a/src/Encoding.h b/src/Encoding.h index b8cf8c59d9..699153f1fd 100644 --- a/src/Encoding.h +++ b/src/Encoding.h @@ -38,7 +38,7 @@ public: Encoding() {} /// Encoding(std::string const & n, std::string const & l, - std::string const & i, bool f, Package p); + std::string const & i, bool f, Package p); /// void init() const; /// @@ -108,7 +108,7 @@ public: /// \param encfile encodings definition file /// \param symbolsfile unicode->LaTeX mapping file void read(support::FileName const & encfile, - support::FileName const & symbolsfile); + support::FileName const & symbolsfile); /// Get encoding from LyX name \p name Encoding const * getFromLyXName(std::string const & name) const; /// Get encoding from LaTeX name \p name diff --git a/src/Font.cpp b/src/Font.cpp index 697471a75a..78b79ed8c2 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -510,21 +510,21 @@ docstring const Font::stateText(BufferParams * params) const os << lcolor.getGUIName(color()) << ", "; if (emph() != INHERIT) os << bformat(_("Emphasis %1$s, "), - _(GUIMiscNames[emph()])); + _(GUIMiscNames[emph()])); if (underbar() != INHERIT) os << bformat(_("Underline %1$s, "), - _(GUIMiscNames[underbar()])); + _(GUIMiscNames[underbar()])); if (noun() != INHERIT) os << bformat(_("Noun %1$s, "), - _(GUIMiscNames[noun()])); + _(GUIMiscNames[noun()])); if (bits == inherit) os << _("Default") << ", "; if (!params || (language() != params->language)) os << bformat(_("Language: %1$s, "), - _(language()->display())); + _(language()->display())); if (number() != OFF) os << bformat(_(" Number %1$s"), - _(GUIMiscNames[number()])); + _(GUIMiscNames[number()])); return rtrim(os.str(), ", "); } @@ -740,9 +740,9 @@ void Font::lyxWriteChanges(Font const & orgfont, /// Writes the head of the LaTeX needed to impose this font // Returns number of chars written. int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams, - OutputParams const & runparams, - Font const & base, - Font const & prev) const + OutputParams const & runparams, + Font const & base, + Font const & prev) const { bool env = false; @@ -752,7 +752,7 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams, if (language()->lang() == "farsi") { os << "\\textFR{"; count += 8; - } else if (!isRightToLeft() && + } else if (!isRightToLeft() && base.language()->lang() == "farsi") { os << "\\textLR{"; count += 8; @@ -788,11 +788,11 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams, } // When the current language is Hebrew, Arabic, or Farsi - // the numbers are written Left-to-Right. ArabTeX package + // the numbers are written Left-to-Right. ArabTeX package // reorders the number automatically but the packages used // for Hebrew and Farsi (Arabi) do not. - if (number() == ON && prev.number() != ON - && (language()->lang() == "hebrew" + if (number() == ON && prev.number() != ON + && (language()->lang() == "hebrew" || language()->lang() == "farsi")) { os << "{\\beginL "; count += 9; @@ -864,9 +864,9 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams, // Returns number of chars written // This one corresponds to latexWriteStartChanges(). (Asger) int Font::latexWriteEndChanges(odocstream & os, BufferParams const & bparams, - OutputParams const & runparams, - Font const & base, - Font const & next) const + OutputParams const & runparams, + Font const & base, + Font const & next) const { int count = 0; bool env = false; @@ -921,11 +921,11 @@ int Font::latexWriteEndChanges(odocstream & os, BufferParams const & bparams, } // When the current language is Hebrew, Arabic, or Farsi - // the numbers are written Left-to-Right. ArabTeX package + // the numbers are written Left-to-Right. ArabTeX package // reorders the number automatically but the packages used // for Hebrew and Farsi (Arabi) do not. - if (number() == ON && next.number() != ON - && (language()->lang() == "hebrew" + if (number() == ON && next.number() != ON + && (language()->lang() == "hebrew" || language()->lang() == "farsi")) { os << "\\endL}"; count += 6; diff --git a/src/Font.h b/src/Font.h index 5cde02900d..6b4aafa00f 100644 --- a/src/Font.h +++ b/src/Font.h @@ -298,18 +298,18 @@ public: font state active now. */ int latexWriteStartChanges(odocstream &, BufferParams const & bparams, - OutputParams const & runparams, - Font const & base, - Font const & prev) const; + OutputParams const & runparams, + Font const & base, + Font const & prev) const; /** Writes the tail of the LaTeX needed to change to this font. Returns number of chars written. Base is the font state we want to achieve. */ int latexWriteEndChanges(odocstream &, BufferParams const & bparams, - OutputParams const & runparams, - Font const & base, - Font const & next) const; + OutputParams const & runparams, + Font const & base, + Font const & next) const; /// Build GUI description of font state diff --git a/src/Format.cpp b/src/Format.cpp index 651b1bb4b3..e2107a5bdc 100644 --- a/src/Format.cpp +++ b/src/Format.cpp @@ -97,7 +97,7 @@ bool operator<(Format const & a, Format const & b) Format::Format(string const & n, string const & e, string const & p, string const & s, string const & v, string const & ed, - int flags) + int flags) : name_(n), extension_(e), prettyname_(p), shortcut_(s), viewer_(v), editor_(ed), flags_(flags) {} @@ -220,15 +220,15 @@ void Formats::add(string const & name) void Formats::add(string const & name, string const & extension, string const & prettyname, string const & shortcut, - string const & viewer, string const & editor, - int flags) + string const & viewer, string const & editor, + int flags) { FormatList::iterator it = find_if(formatlist.begin(), formatlist.end(), FormatNamesEqual(name)); if (it == formatlist.end()) formatlist.push_back(Format(name, extension, prettyname, - shortcut, viewer, editor, flags)); + shortcut, viewer, editor, flags)); else *it = Format(name, extension, prettyname, shortcut, viewer, editor, flags); diff --git a/src/Format.h b/src/Format.h index 67a7a92188..295c5ab8bf 100644 --- a/src/Format.h +++ b/src/Format.h @@ -142,9 +142,9 @@ public: void add(std::string const & name); /// void add(std::string const & name, std::string const & extension, - std::string const & prettyname, std::string const & shortcut, - std::string const & viewer, std::string const & editor, - int flags); + std::string const & prettyname, std::string const & shortcut, + std::string const & viewer, std::string const & editor, + int flags); /// void erase(std::string const & name); /// diff --git a/src/KeyMap.cpp b/src/KeyMap.cpp index a9bcb59622..fe3092b509 100644 --- a/src/KeyMap.cpp +++ b/src/KeyMap.cpp @@ -253,7 +253,7 @@ void KeyMap::defkey(KeySequence * seq, FuncRequest const & func, unsigned int r) it->func.origin = FuncRequest::KEYBOARD; return; } else if (!it->table.get()) { - lyxerr << "Error: New binding for '" + lyxerr << "Error: New binding for '" << to_utf8(seq->print(false)) << "' is overriding old binding..." << endl; diff --git a/src/KeyMap.h b/src/KeyMap.h index 8cd372881e..9a9f2bd5df 100644 --- a/src/KeyMap.h +++ b/src/KeyMap.h @@ -47,8 +47,8 @@ public: /** * print all available keysyms - * @param forgui true if the string should use translations and - * special characters. + * @param forgui true if the string should use translations and + * special characters. */ docstring const print(bool forgui) const; diff --git a/src/KeySequence.h b/src/KeySequence.h index 7774f0a0ab..7882902d01 100644 --- a/src/KeySequence.h +++ b/src/KeySequence.h @@ -63,8 +63,8 @@ public: /** * Return the current sequence as a string. - * @param forgui true if the string should use translations and - * special characters. + * @param forgui true if the string should use translations and + * special characters. * @see parse() */ docstring const print(bool forgui) const; @@ -72,8 +72,8 @@ public: /** * Return the current sequence and available options as * a string. No options are added if no curmap kb map exists. - * @param forgui true if the string should use translations and - * special characters. + * @param forgui true if the string should use translations and + * special characters. */ docstring const printOptions(bool forgui) const; diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp index 44ce5e7227..8f6bd510d8 100644 --- a/src/LaTeX.cpp +++ b/src/LaTeX.cpp @@ -229,7 +229,7 @@ int LaTeX::run(TeXErrors & terr) head.update(); // Can't just check if anything has changed because it might // have aborted on error last time... in which cas we need - // to re-run latex and collect the error messages + // to re-run latex and collect the error messages // (even if they are the same). if (!fs::exists(output_file.toFilesystemEncoding())) { LYXERR(Debug::DEPEND) @@ -293,7 +293,7 @@ int LaTeX::run(TeXErrors & terr) // A second latex run is needed. FileName const idxfile(changeExtension(file.absFilename(), ".idx")); rerun = fs::exists(idxfile.toFilesystemEncoding()) && - fs::is_empty(idxfile.toFilesystemEncoding()); + fs::is_empty(idxfile.toFilesystemEncoding()); // run makeindex if (head.haschanged(idxfile)) { @@ -438,13 +438,13 @@ int LaTeX::startscript() bool LaTeX::runMakeIndex(string const & f, OutputParams const & runparams, - string const & params) + string const & params) { LYXERR(Debug::LATEX) << "idx file has been made, running makeindex on file " << f << endl; string tmp = lyxrc.index_command + ' '; - + tmp = subst(tmp, "$$lang", runparams.document_language); tmp += quoteName(f); tmp += params; @@ -965,7 +965,7 @@ void LaTeX::deplog(DepTable & head) // Sometimes, filenames are broken across lines. // We care for that and save suspicious lines. - // Here we exclude some cases where we are sure + // Here we exclude some cases where we are sure // that there is no continued filename if (!lastline.empty()) { static regex package_info("Package \\w+ Info: .*"); @@ -1035,7 +1035,7 @@ void LaTeX::deplog(DepTable & head) found_file = false; // (6) "Writing nomenclature file file.ext" } else if (regex_match(token, sub, regnomencl) || - regex_match(token, sub, regoldnomencl)) + regex_match(token, sub, regoldnomencl)) // check for dot found_file = checkLineBreak(sub.str(1), head); // (7) "\tf@toc=\write" (for MikTeX) diff --git a/src/LaTeX.h b/src/LaTeX.h index c6ff48a3c3..52b8ff7a0a 100644 --- a/src/LaTeX.h +++ b/src/LaTeX.h @@ -169,11 +169,11 @@ private: /// bool runMakeIndex(std::string const &, OutputParams const &, - std::string const & = std::string()); + std::string const & = std::string()); /// bool runMakeIndexNomencl(support::FileName const &, OutputParams const &, - std::string const &, std::string const &); + std::string const &, std::string const &); /// std::vector const scanAuxFiles(support::FileName const &); diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 114fb02576..b3442087d4 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -489,7 +489,7 @@ string const LaTeXFeatures::getPackages() const // shadecolor for shaded if (mustProvide("framed") && mustProvide("color")) { RGBColor c = RGBColor(lcolor.getX11Name(Color::shadedbg)); - packages << "\\definecolor{shadecolor}{rgb}{" + packages << "\\definecolor{shadecolor}{rgb}{" << c.r/255 << ',' << c.g/255 << ',' << c.b/255 << "}\n"; } @@ -523,13 +523,13 @@ string const LaTeXFeatures::getPackages() const } // amssymb.sty - if (mustProvide("amssymb") + if (mustProvide("amssymb") || params_.use_amsmath == BufferParams::package_on) packages << "\\usepackage{amssymb}\n"; // esint must be after amsmath and wasysym, since it will redeclare // inconsistent integral symbols - if (mustProvide("esint") + if (mustProvide("esint") && params_.use_esint != BufferParams::package_off) packages << "\\usepackage{esint}\n"; @@ -568,15 +568,15 @@ string const LaTeXFeatures::getPackages() const // but don't use the compatibility option since it is // incompatible to other packages. packages << "\\usepackage{nomencl}\n" - "% the following is useful when we have the old nomencl.sty package\n" - "\\providecommand{\\printnomenclature}{\\printglossary}\n" - "\\providecommand{\\makenomenclature}{\\makeglossary}\n" - "\\makenomenclature\n"; + "% the following is useful when we have the old nomencl.sty package\n" + "\\providecommand{\\printnomenclature}{\\printglossary}\n" + "\\providecommand{\\makenomenclature}{\\makeglossary}\n" + "\\makenomenclature\n"; } if (mustProvide("listings")) packages << "\\usepackage{listings}\n"; - + return packages.str(); } @@ -653,11 +653,11 @@ string const LaTeXFeatures::getMacros() const } if (mustProvide("ct-xcolor-soul")) { RGBColor cadd = RGBColor(lcolor.getX11Name(Color::addedtext)); - macros << "\\providecolor{lyxadded}{rgb}{" + macros << "\\providecolor{lyxadded}{rgb}{" << cadd.r/255 << ',' << cadd.g/255 << ',' << cadd.b/255 << "}\n"; RGBColor cdel = RGBColor(lcolor.getX11Name(Color::deletedtext)); - macros << "\\providecolor{lyxdeleted}{rgb}{" + macros << "\\providecolor{lyxdeleted}{rgb}{" << cdel.r/255 << ',' << cdel.g/255 << ',' << cdel.b/255 << "}\n"; macros << "\\newcommand{\\lyxadded}[3]{\\color{lyxadded}{#3}}\n" diff --git a/src/Length.h b/src/Length.h index 6dff8b3c89..725943503c 100644 --- a/src/Length.h +++ b/src/Length.h @@ -110,7 +110,7 @@ bool operator==(Length const & l1, Length const & l2); /// bool operator!=(Length const & l1, Length const & l2); /** Test whether \p data represents a valid length. - * + * * \returns whether \p data is a valid length * \param data Length in LyX format. Since the only difference between LyX * and LaTeX format is the representation of length variables as units (e.g. diff --git a/src/Lexer.cpp b/src/Lexer.cpp index 4406d07497..38465f92ed 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -417,7 +417,7 @@ bool Lexer::Pimpl::next(bool esc /* = false */) c = cc; // skip ','s - if (c == ',') + if (c == ',') continue; if (c == commentChar) { @@ -525,7 +525,7 @@ int Lexer::Pimpl::search_kw(char const * const tag) const int Lexer::Pimpl::lex() { //NOTE: possible bug. - if (next() && status == LEX_TOKEN) + if (next() && status == LEX_TOKEN) return search_kw(getString().c_str()); return status; } @@ -619,7 +619,7 @@ bool Lexer::Pimpl::nextToken() bool Lexer::Pimpl::inputAvailable() { - return is.good(); + return is.good(); } @@ -771,7 +771,7 @@ string const Lexer::getString() const docstring const Lexer::getDocString() const { lastReadOk_ = pimpl_->status == LEX_DATA || pimpl_->status == LEX_TOKEN; - + if (lastReadOk_) return pimpl_->getDocString(); diff --git a/src/Lexer.h b/src/Lexer.h index a8da886c8f..4088c75052 100644 --- a/src/Lexer.h +++ b/src/Lexer.h @@ -37,10 +37,10 @@ struct keyword_item { }; /** Generalized simple lexical analizer. - Use the method isOK() to check if there is still data available + Use the method isOK() to check if there is still data available for lexing. Use one of the the operators void* or ! to test if the last reading operation was successful. - + Example: int readParam(LyxLex &lex) { @@ -51,7 +51,7 @@ struct keyword_item { if (lex) param = p; // only use the input if reading was successful } return param; - } + } @see LyXRC.cpp for an example of usage. */ @@ -76,11 +76,11 @@ public: /// stream is open and end of stream is not reached /// FIXME: test also if pushTok is not empty - /// FIXME: the method should be renamed to something like + /// FIXME: the method should be renamed to something like /// dataAvailable(), in order to reflect the real behavior bool isOK() const; /// FIXME: The next two operators should be replaced by one method - /// called e.g. lastReadOk(), in order to reflect the real + /// called e.g. lastReadOk(), in order to reflect the real /// behavior /// last read operation was successful. operator void const *() const; diff --git a/src/LyX.cpp b/src/LyX.cpp index 48f30df4d1..4d8f10eafb 100644 --- a/src/LyX.cpp +++ b/src/LyX.cpp @@ -108,7 +108,7 @@ using std::system; /// are we using the GUI at all? -/** +/** * We default to true and this is changed to false when the export feature is used. */ bool use_gui = true; @@ -148,7 +148,7 @@ void reconfigureUserLyXDir() /// The main application class private implementation. -struct LyX::Singletons +struct LyX::Singletons { Singletons() { @@ -183,10 +183,10 @@ struct LyX::Singletons // The system converters copy after reading lyxrc.defaults. Converters system_converters_; - + /// Movers movers_; - + /// Movers system_movers_; }; @@ -269,14 +269,14 @@ LyXFunc const & LyX::lyxFunc() const Server & LyX::server() { BOOST_ASSERT(pimpl_->lyx_server_.get()); - return *pimpl_->lyx_server_.get(); + return *pimpl_->lyx_server_.get(); } -Server const & LyX::server() const +Server const & LyX::server() const { BOOST_ASSERT(pimpl_->lyx_server_.get()); - return *pimpl_->lyx_server_.get(); + return *pimpl_->lyx_server_.get(); } @@ -341,7 +341,7 @@ Messages & LyX::getMessages(std::string const & language) if (it != pimpl_->messages_.end()) return it->second; - std::pair::iterator, bool> result = + std::pair::iterator, bool> result = pimpl_->messages_.insert(std::make_pair(language, Messages(language))); BOOST_ASSERT(result.second); @@ -387,8 +387,8 @@ int LyX::exec(int & argc, char * argv[]) easyParse(argc, argv); try { support::init_package(to_utf8(from_local8bit(argv[0])), - cl_system_support, cl_user_support, - support::top_build_dir_is_one_level_up); + cl_system_support, cl_user_support, + support::top_build_dir_is_one_level_up); } catch (support::ExceptionMessage const & message) { if (message.type_ == support::ErrorException) { Alert::error(message.title_, message.details_); @@ -421,7 +421,7 @@ int LyX::exec(int & argc, char * argv[]) Buffer * buf = *I; bool success = false; buf->dispatch(batch_command, &success); - final_success |= success; + final_success |= success; } prepareExit(); return !final_success; @@ -456,12 +456,12 @@ int LyX::exec(int & argc, char * argv[]) // Note: socket callback must be registered after init(argc, argv) // such that package().temp_dir() is properly initialized. pimpl_->lyx_server_.reset(new Server(&pimpl_->lyxfunc_, lyxrc.lyxpipes)); - pimpl_->lyx_socket_.reset(new ServerSocket(&pimpl_->lyxfunc_, + pimpl_->lyx_socket_.reset(new ServerSocket(&pimpl_->lyxfunc_, FileName(package().temp_dir().absFilename() + "/lyxsocket"))); // Start the real execution loop. exit_status = pimpl_->application_->exec(); - + prepareExit(); // Restore original font resources after Application is destroyed. @@ -680,7 +680,7 @@ LyXView * LyX::newLyXView() posy = convert(val); } - if (!geometryArg.empty()) + if (!geometryArg.empty()) { width = 0; height = 0; @@ -808,7 +808,7 @@ void LyX::initGuiFont() lyxrc.sans_font_name = pimpl_->application_->sansFontName(); if (lyxrc.typewriter_font_name.empty()) - lyxrc.typewriter_font_name + lyxrc.typewriter_font_name = pimpl_->application_->typewriterFontName(); } @@ -936,8 +936,8 @@ bool LyX::init() } LYXERR(Debug::INIT) << "LyX tmp dir: `" - << package().temp_dir().absFilename() - << '\'' << endl; + << package().temp_dir().absFilename() + << '\'' << endl; LYXERR(Debug::INIT) << "Reading session information '.lyx/session'..." << endl; pimpl_->session_.reset(new Session(lyxrc.num_lastfiles)); @@ -1170,7 +1170,7 @@ bool LyX::readUIFile(string const & name, bool include) LYXERR(Debug::INIT) << "About to read " << name << "..." << endl; - + FileName ui_path; if (include) { ui_path = libFileSearch("ui", name, "inc"); @@ -1180,7 +1180,7 @@ bool LyX::readUIFile(string const & name, bool include) } else ui_path = libFileSearch("ui", name, "ui"); - + if (ui_path.empty()) { LYXERR(Debug::INIT) << "Could not find " << name << endl; showFileError(name); @@ -1250,10 +1250,10 @@ bool LyX::readLanguagesFile(string const & name) // Read the encodings file `name' bool LyX::readEncodingsFile(string const & enc_name, - string const & symbols_name) + string const & symbols_name) { LYXERR(Debug::INIT) << "About to read " << enc_name << " and " - << symbols_name << "..." << endl; + << symbols_name << "..." << endl; FileName const symbols_path = libFileSearch(string(), symbols_name); if (symbols_path.empty()) { diff --git a/src/LyX.h b/src/LyX.h index 0a0602e386..efd82fd83f 100644 --- a/src/LyX.h +++ b/src/LyX.h @@ -83,7 +83,7 @@ public: /// KeyMap & topLevelKeymap(); KeyMap const & topLevelKeymap() const; - + /// Converters & converters(); Converters & systemConverters(); @@ -157,7 +157,7 @@ private: /// \param enc_name encodings definition file /// \param symbols_name unicode->LaTeX mapping file bool readEncodingsFile(std::string const & enc_name, - std::string const & symbols_name); + std::string const & symbols_name); /// parsing of non-gui LyX options. void easyParse(int & argc, char * argv[]); /// shows up a parsing error on screen diff --git a/src/LyXFunc.cpp b/src/LyXFunc.cpp index 33c724a7cd..77ad4dcc3f 100644 --- a/src/LyXFunc.cpp +++ b/src/LyXFunc.cpp @@ -272,7 +272,7 @@ void LyXFunc::gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer) // see http://bugzilla.lyx.org/show_bug.cgi?id=3092 if (bm.bottom_pit != new_pit || bm.bottom_pos != new_pos || bm.top_id != new_id ) const_cast(bm).updatePos(new_pit, new_pos, new_id); - } + } } @@ -893,7 +893,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) menuWrite(lyx_view_->buffer()); lyx_view_->message(str + _(" done.")); } else { - writeAs(lyx_view_->buffer()); + writeAs(lyx_view_->buffer()); } updateFlags = Update::None; break; @@ -1424,7 +1424,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) // when the target is in the parent or another child document. lyx_view_->buffer()->setParentName(parentfilename); setMessage(bformat(_("Opening child document %1$s..."), - makeDisplayPath(filename.absFilename()))); + makeDisplayPath(filename.absFilename()))); } else setMessage(_("Document not loaded.")); break; @@ -1483,8 +1483,8 @@ void LyXFunc::dispatch(FuncRequest const & cmd) case LFUN_PREFERENCES_SAVE: { lyxrc.write(makeAbsPath("preferences", - package().user_support().absFilename()), - false); + package().user_support().absFilename()), + false); break; } @@ -1628,7 +1628,7 @@ void LyXFunc::dispatch(FuncRequest const & cmd) if (defaults.writeFile(FileName(defaults.fileName()))) setMessage(bformat(_("Document defaults saved in %1$s"), - makeDisplayPath(fname))); + makeDisplayPath(fname))); else setErrorMessage(from_ascii(N_("Unable to save document defaults"))); break; diff --git a/src/LyXFunc.h b/src/LyXFunc.h index 88e1294394..60862dc406 100644 --- a/src/LyXFunc.h +++ b/src/LyXFunc.h @@ -77,7 +77,7 @@ public: void handleKeyFunc(kb_action action); /// goto a bookmark /// openFile: whether or not open a file if the file is not opened - /// switchToBuffer: whether or not switch to buffer if the buffer is + /// switchToBuffer: whether or not switch to buffer if the buffer is /// not the current buffer void gotoBookmark(unsigned int idx, bool openFile, bool switchToBuffer); diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp index a24754c61a..5be68a39ef 100644 --- a/src/LyXRC.cpp +++ b/src/LyXRC.cpp @@ -1086,7 +1086,7 @@ int LyXRC::read(Lexer & lexrc) } } else { formats.add(format, extension, prettyname, - shortcut, viewer, editor, flgs); + shortcut, viewer, editor, flgs); } break; } diff --git a/src/LyXRC.h b/src/LyXRC.h index 1602324850..13a3481625 100644 --- a/src/LyXRC.h +++ b/src/LyXRC.h @@ -32,7 +32,7 @@ namespace support { class FileName; } class Lexer; /// This contains the runtime configuration of LyX -class LyXRC //: public noncopyable +class LyXRC //: public noncopyable // after 1.1.6 I will use a LyXRCStruct here and then this can be made // noncopyable again. For now I want to minimise changes. ARRae 20001010 { diff --git a/src/MenuBackend.cpp b/src/MenuBackend.cpp index fde7ab5680..bde9cc0a7b 100644 --- a/src/MenuBackend.cpp +++ b/src/MenuBackend.cpp @@ -486,7 +486,7 @@ void expandBookmarks(Menu & tomenu) docstring const label = convert(i) + ". " + makeDisplayPath(bm.bookmark(i).filename.absFilename(), 20) + char_type('|') + convert(i); - tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_BOOKMARK_GOTO, + tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_BOOKMARK_GOTO, convert(i)))); } } @@ -792,10 +792,10 @@ void expandToolbars(Menu & tomenu) // frontends are not supposed to turn on/off toolbars, if they cannot // update ToolbarBackend::flags. That is to say, ToolbarsBackend::flags // should reflect the true state of toolbars. - // - // menu is displayed as + // + // menu is displayed as // on/off review - // and + // and // review (auto) // in the case of auto. if (cit->flags & ToolbarInfo::AUTO) diff --git a/src/MenuBackend.h b/src/MenuBackend.h index 0ac9ee3e20..07c115a272 100644 --- a/src/MenuBackend.h +++ b/src/MenuBackend.h @@ -111,7 +111,7 @@ public: /// returns the status of the lfun associated with this entry void status(FuncStatus const & status) { status_ = status; } /** - * returns the binding associated to this action. + * returns the binding associated to this action. * Use the native UI format when \c forgui is true. */ docstring const binding(bool forgui) const; diff --git a/src/Messages.cpp b/src/Messages.cpp index 6ecfba3228..cbead21106 100644 --- a/src/Messages.cpp +++ b/src/Messages.cpp @@ -166,7 +166,7 @@ docstring const Messages::get(string const & m) const #endif setlocale(LC_CTYPE, oldCTYPE.c_str()); - std::pair result = + std::pair result = cache_.insert(std::make_pair(m, translated)); BOOST_ASSERT(result.second); diff --git a/src/Messages.h b/src/Messages.h index 801086f194..36ee74a4c7 100644 --- a/src/Messages.h +++ b/src/Messages.h @@ -29,7 +29,7 @@ public: private: /// std::string lang_; - /// Did we warn about unavailable locale already? + /// Did we warn about unavailable locale already? mutable bool warned_; /// typedef std::map TranslationCache; diff --git a/src/Mover.cpp b/src/Mover.cpp index aa1c2c46dc..cfe2034617 100644 --- a/src/Mover.cpp +++ b/src/Mover.cpp @@ -28,7 +28,7 @@ namespace lyx { using support::quoteName; bool Mover::copy(support::FileName const & from, support::FileName const & to, - unsigned long int mode) const + unsigned long int mode) const { return do_copy(from, to, to.absFilename(), mode); } @@ -42,7 +42,7 @@ bool Mover::do_copy(support::FileName const & from, support::FileName const & to bool Mover::rename(support::FileName const & from, - support::FileName const & to) const + support::FileName const & to) const { return do_rename(from, to, to.absFilename()); } diff --git a/src/Mover.h b/src/Mover.h index c07eeb3ee8..7c0c5021f0 100644 --- a/src/Mover.h +++ b/src/Mover.h @@ -82,7 +82,7 @@ public: protected: virtual bool do_copy(support::FileName const & from, support::FileName const & to, - std::string const &, unsigned long int mode) const; + std::string const &, unsigned long int mode) const; virtual bool do_rename(support::FileName const & from, support::FileName const & to, @@ -131,7 +131,7 @@ public: private: virtual bool do_copy(support::FileName const & from, support::FileName const & to, - std::string const & latex, unsigned long int mode) const; + std::string const & latex, unsigned long int mode) const; virtual bool do_rename(support::FileName const & from, support::FileName const & to, diff --git a/src/OutputParams.h b/src/OutputParams.h index 8ef73f58ee..2267ffcf1c 100644 --- a/src/OutputParams.h +++ b/src/OutputParams.h @@ -77,7 +77,7 @@ public: copy (e.g. in insets): \code int InsetFoo::latex(..., OutputParams const & runparams_in) const { - OutputParams runparams(runparams_in); + OutputParams runparams(runparams_in); runparams.inComment = true; ... InsetBla::latex(..., runparams); @@ -120,18 +120,18 @@ public: */ bool inComment; - /** allow output of only part of the top-level paragraphs + /** allow output of only part of the top-level paragraphs * par_begin: beginning paragraph */ pit_type par_begin; - /** allow output of only part of the top-level paragraphs + /** allow output of only part of the top-level paragraphs * par_end: par_end-1 is the ending paragraph * if par_begin=par_end, output all paragraphs */ pit_type par_end; - /** whether or not do actual file copying and image conversion + /** whether or not do actual file copying and image conversion * This mode will be used to preview the source code */ bool dryrun; diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 7afacfabce..796abf4617 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -176,21 +176,21 @@ public: /// Output the surrogate pair formed by \p c and \p next to \p os. /// \return the number of characters written. int latexSurrogatePair(odocstream & os, value_type c, value_type next, - Encoding const &); + Encoding const &); /// Output a space in appropriate formatting (or a surrogate pair /// if the next character is a combining character). /// \return whether a surrogate pair was output. bool simpleTeXBlanks(Encoding const &, - odocstream &, TexRow & texrow, + odocstream &, TexRow & texrow, pos_type & i, unsigned int & column, Font const & font, Layout const & style); /// void simpleTeXSpecialChars(Buffer const &, BufferParams const &, - odocstream &, - TexRow & texrow, OutputParams const &, - Font & running_font, + odocstream &, + TexRow & texrow, OutputParams const &, + Font & running_font, Font & basefont, Font const & outerfont, bool & open_font, @@ -445,7 +445,7 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c, Change const & cha // Update the font table. FontTable search_font(pos, Font()); - for (FontList::iterator it + for (FontList::iterator it = lower_bound(fontlist.begin(), fontlist.end(), search_font, matchFT()); it != fontlist.end(); ++it) { @@ -458,7 +458,7 @@ void Paragraph::Pimpl::insertChar(pos_type pos, value_type c, Change const & cha void Paragraph::Pimpl::insertInset(pos_type pos, Inset * inset, - Change const & change) + Change const & change) { BOOST_ASSERT(inset); BOOST_ASSERT(pos >= 0 && pos <= size()); @@ -480,7 +480,7 @@ bool Paragraph::Pimpl::eraseChar(pos_type pos, bool trackChanges) if (trackChanges) { Change change = changes_.lookup(pos); - // set the character to DELETED if + // set the character to DELETED if // a) it was previously unchanged or // b) it was inserted by a co-author @@ -580,8 +580,8 @@ int Paragraph::Pimpl::latexSurrogatePair(odocstream & os, value_type c, bool Paragraph::Pimpl::simpleTeXBlanks(Encoding const & encoding, - odocstream & os, TexRow & texrow, - pos_type & i, + odocstream & os, TexRow & texrow, + pos_type & i, unsigned int & column, Font const & font, Layout const & style) @@ -1204,7 +1204,7 @@ int Paragraph::eraseChars(pos_type start, pos_type end, bool trackChanges) void Paragraph::insert(pos_type start, docstring const & str, - Font const & font, Change const & change) + Font const & font, Change const & change) { for (size_t i = 0, n = str.size(); i != n ; ++i) insertChar(start + i, str[i], font, change); @@ -1212,24 +1212,24 @@ void Paragraph::insert(pos_type start, docstring const & str, void Paragraph::insertChar(pos_type pos, Paragraph::value_type c, - bool trackChanges) + bool trackChanges) { pimpl_->insertChar(pos, c, Change(trackChanges ? - Change::INSERTED : Change::UNCHANGED)); + Change::INSERTED : Change::UNCHANGED)); } void Paragraph::insertChar(pos_type pos, Paragraph::value_type c, - Font const & font, bool trackChanges) + Font const & font, bool trackChanges) { pimpl_->insertChar(pos, c, Change(trackChanges ? - Change::INSERTED : Change::UNCHANGED)); + Change::INSERTED : Change::UNCHANGED)); setFont(pos, font); } void Paragraph::insertChar(pos_type pos, Paragraph::value_type c, - Font const & font, Change const & change) + Font const & font, Change const & change) { pimpl_->insertChar(pos, c, change); setFont(pos, font); @@ -1237,14 +1237,14 @@ void Paragraph::insertChar(pos_type pos, Paragraph::value_type c, void Paragraph::insertInset(pos_type pos, Inset * inset, - Change const & change) + Change const & change) { pimpl_->insertInset(pos, inset, change); } void Paragraph::insertInset(pos_type pos, Inset * inset, - Font const & font, Change const & change) + Font const & font, Change const & change) { pimpl_->insertInset(pos, inset, change); setFont(pos, font); @@ -1765,7 +1765,7 @@ void adjust_row_column(string const & str, TexRow & texrow, int & column) // This could go to ParagraphParameters if we want to int Paragraph::startTeXParParams(BufferParams const & bparams, - odocstream & os, TexRow & texrow, + odocstream & os, TexRow & texrow, bool moving_arg) const { int column = 0; @@ -1829,8 +1829,8 @@ int Paragraph::startTeXParParams(BufferParams const & bparams, // This could go to ParagraphParameters if we want to -int Paragraph::endTeXParParams(BufferParams const & bparams, - odocstream & os, TexRow & texrow, +int Paragraph::endTeXParParams(BufferParams const & bparams, + odocstream & os, TexRow & texrow, bool moving_arg) const { int column = 0; @@ -1982,7 +1982,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf, } if (!asdefault) - column += startTeXParParams(bparams, os, + column += startTeXParParams(bparams, os, texrow, runparams.moving_arg); } @@ -2009,7 +2009,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf, } ++column; - + value_type const c = getChar(i); // Fully instantiated font @@ -2047,8 +2047,8 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf, i != body_pos - 1) { column += font.latexWriteStartChanges(os, bparams, - runparams, basefont, - last_font); + runparams, basefont, + last_font); running_font = font; open_font = true; } @@ -2114,7 +2114,7 @@ bool Paragraph::simpleTeXOnePar(Buffer const & buf, } if (!asdefault) { - column += endTeXParParams(bparams, os, texrow, + column += endTeXParParams(bparams, os, texrow, runparams.moving_arg); } @@ -2220,7 +2220,7 @@ pos_type Paragraph::getFirstWord(Buffer const & buf, odocstream & os, OutputPara if (c == ' ') break; os << sgml::escapeChar(c); - } + } } return i; } @@ -2280,9 +2280,9 @@ void Paragraph::simpleDocBookOnePar(Buffer const & buf, value_type c = getChar(i); if (style->pass_thru) - os.put(c); + os.put(c); else - os << sgml::escapeChar(c); + os << sgml::escapeChar(c); } font_old = font; } @@ -2595,7 +2595,7 @@ bool Paragraph::hfillExpansion(Row const & row, pos_type pos) const int Paragraph::checkBiblio(bool track_changes) { //FIXME From JS: - //This is getting more and more a mess. ...We really should clean + //This is getting more and more a mess. ...We really should clean //up this bibitem issue for 1.6. See also bug 2743. // Add bibitem insets if necessary @@ -2633,18 +2633,18 @@ int Paragraph::checkBiblio(bool track_changes) //have to erase one. if (hasbibitem && erasedInsetPosition < 0) return 0; - - //There was an InsetBibitem at the beginning and we did have to + + //There was an InsetBibitem at the beginning and we did have to //erase one. So we give its properties to the beginning inset. if (hasbibitem) { - InsetBibitem * inset = + InsetBibitem * inset = static_cast(insetlist.begin()->inset); if (!oldkey.empty()) inset->setParam("key", oldkey); inset->setParam("label", oldlabel); return -erasedInsetPosition; } - + //There was no inset at the beginning, so we need to create one with //the key and label of the one we erased. InsetBibitem * inset(new InsetBibitem(InsetCommandParams("bibitem"))); diff --git a/src/Paragraph.h b/src/Paragraph.h index 5c1261c087..ea1d679d7c 100644 --- a/src/Paragraph.h +++ b/src/Paragraph.h @@ -115,11 +115,11 @@ public: void validate(LaTeXFeatures &) const; /// - int startTeXParParams(BufferParams const &, odocstream &, TexRow &, + int startTeXParParams(BufferParams const &, odocstream &, TexRow &, bool) const; /// - int endTeXParParams(BufferParams const &, odocstream &, TexRow &, + int endTeXParParams(BufferParams const &, odocstream &, TexRow &, bool) const; @@ -293,21 +293,21 @@ public: pos_type endpos, Font_size def_size) const; /// void insert(pos_type pos, docstring const & str, - Font const & font, Change const & change); + Font const & font, Change const & change); /// void insertChar(pos_type pos, value_type c, bool trackChanges); /// void insertChar(pos_type pos, value_type c, - Font const &, bool trackChanges); + Font const &, bool trackChanges); /// void insertChar(pos_type pos, value_type c, - Font const &, Change const & change); + Font const &, Change const & change); /// void insertInset(pos_type pos, Inset * inset, - Change const & change); + Change const & change); /// void insertInset(pos_type pos, Inset * inset, - Font const &, Change const & change); + Font const &, Change const & change); /// bool insetAllowed(Inset_code code); /// @@ -341,7 +341,7 @@ public: /// returns -1 if inset not found int getPositionOfInset(Inset const * inset) const; - /// returns true if at least one line break or line separator has been deleted + /// returns true if at least one line break or line separator has been deleted /// at the beginning of the paragraph (either physically or logically) bool stripLeadingSpaces(bool trackChanges); diff --git a/src/ParagraphMetrics.h b/src/ParagraphMetrics.h index 78ace39b1f..6d9a3fa828 100644 --- a/src/ParagraphMetrics.h +++ b/src/ParagraphMetrics.h @@ -68,7 +68,7 @@ public: /// The painter and others use this RowList const & rows() const { return rows_; } /// The painter and others use this - std::vector const & rowChangeStatus() const + std::vector const & rowChangeStatus() const { return row_change_status_; } /// void updateRowChangeStatus(); diff --git a/src/PrinterParams.h b/src/PrinterParams.h index 23690ec06b..6ae9aa9be8 100644 --- a/src/PrinterParams.h +++ b/src/PrinterParams.h @@ -73,7 +73,7 @@ public: // bool duplex; /** Test that all the fields contain valid entries. It's unlikely - that the internal code will get this wrong however new ports + that the internal code will get this wrong however new ports and external scripts might drive the wrong values in. */ void testInvariant() const; diff --git a/src/Server.h b/src/Server.h index fb7cd4feed..eed1ce0129 100644 --- a/src/Server.h +++ b/src/Server.h @@ -145,4 +145,4 @@ extern Server & theServer(); } // namespace lyx -#endif // SERVER_H +#endif // SERVER_H diff --git a/src/Session.cpp b/src/Session.cpp index 53e3c663d4..8abc70051e 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -75,14 +75,14 @@ void LastFilesSection::read(istream & is) getline(is, tmp); if (tmp == "" || tmp[0] == '#' || tmp[0] == ' ' || !absolutePath(tmp)) continue; - + // read lastfiles FileName const file(tmp); if (fs::exists(file.toFilesystemEncoding()) && !fs::is_directory(file.toFilesystemEncoding()) && lastfiles.size() < num_lastfiles) lastfiles.push_back(file); - else + else LYXERR(Debug::INIT) << "LyX: Warning: Ignore last file: " << tmp << endl; } while (is.good()); } @@ -344,7 +344,7 @@ void ToolbarSection::read(istream & is) value >> posx; value >> posy; toolbars.push_back(boost::make_tuple(key, ToolbarInfo(state, location, posx, posy))); - } else + } else LYXERR(Debug::INIT) << "LyX: Warning: Ignore toolbar info: " << tmp << endl; } catch (...) { LYXERR(Debug::INIT) << "LyX: Warning: unknown Toolbar info: " << tmp << endl; diff --git a/src/Session.h b/src/Session.h index 213d56ff7e..e0b1d98197 100644 --- a/src/Session.h +++ b/src/Session.h @@ -182,7 +182,7 @@ public: /// top_id is determined when a bookmark is restored from session; and /// bottom_pit and bottom_pos are determined from top_id when a bookmark /// is save to session. (What a mess! :-) - /// + /// /// TODO: bottom level pit and pos will be replaced by StableDocIterator class Bookmark { public: @@ -203,7 +203,7 @@ public: : filename(f), bottom_pit(pit), bottom_pos(pos), top_id(id), top_pos(tpos) {} /// set bookmark top_id, this is because newly loaded bookmark /// may have zero par_id and par_pit can change during editing, see bug 3092 - void updatePos(pit_type pit, pos_type pos, int id) { + void updatePos(pit_type pit, pos_type pos, int id) { bottom_pit = pit; bottom_pos = pos; top_id = id; @@ -269,7 +269,7 @@ public: state(ON), location(NOTSET), posx(0), posy(0) { } /// ToolbarInfo(int s, int loc, int x=0, int y=0) : - state(static_cast(s)), + state(static_cast(s)), location(static_cast(loc)), posx(x), posy(y) @@ -301,7 +301,7 @@ public: /// y-position of the toolbar int posy; - + /// potentially, icons }; @@ -386,7 +386,7 @@ public: /// LastFilesSection & lastFiles() { return last_files; } - + /// LastFilesSection const & lastFiles() const { return last_files; } @@ -395,10 +395,10 @@ public: /// LastOpenedSection const & lastOpened() const { return last_opened; } - + /// LastFilePosSection & lastFilePos() { return last_file_pos; } - + /// LastFilePosSection const & lastFilePos() const { return last_file_pos; } diff --git a/src/Text.cpp b/src/Text.cpp index 6c810b9869..c05cc2130d 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -858,7 +858,7 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op) bool endsBeforeEndOfPar = (endPos < pars_[endPit].size()); // first, accept/reject changes within each individual paragraph (do not consider end-of-par) - + for (pit_type pit = begPit; pit <= endPit; ++pit) { pos_type parSize = pars_[pit].size(); @@ -872,7 +872,7 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op) continue; // do not consider last paragraph if the cursor ends at pos 0 - if (pit == endPit && endPos == 0) + if (pit == endPit && endPos == 0) break; // last iteration anyway pos_type left = (pit == begPit ? begPos : 0); @@ -884,9 +884,9 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op) pars_[pit].rejectChanges(cur.buffer().params(), left, right); } } - + // next, accept/reject imaginary end-of-par characters - + for (pit_type pit = begPit; pit <= endPit; ++pit) { pos_type pos = pars_[pit].size(); @@ -933,7 +933,7 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op) deleteEmptyParagraphMechanism(begPit, endPit, cur.buffer().params().trackChanges); - // + // finishUndo(); cur.clearSelection(); @@ -945,12 +945,12 @@ void Text::acceptOrRejectChanges(Cursor & cur, ChangeOp op) void Text::acceptChanges(BufferParams const & bparams) { - pit_type pars_size = static_cast(pars_.size()); + pit_type pars_size = static_cast(pars_.size()); // first, accept changes within each individual paragraph // (do not consider end-of-par) for (pit_type pit = 0; pit < pars_size; ++pit) { - if (!pars_[pit].empty()) // prevent assertion failure + if (!pars_[pit].empty()) // prevent assertion failure pars_[pit].acceptChanges(bparams, 0, pars_[pit].size()); } @@ -983,9 +983,9 @@ void Text::rejectChanges(BufferParams const & bparams) pit_type pars_size = static_cast(pars_.size()); // first, reject changes within each individual paragraph - // (do not consider end-of-par) + // (do not consider end-of-par) for (pit_type pit = 0; pit < pars_size; ++pit) { - if (!pars_[pit].empty()) // prevent assertion failure + if (!pars_[pit].empty()) // prevent assertion failure pars_[pit].rejectChanges(bparams, 0, pars_[pit].size()); } @@ -1102,7 +1102,7 @@ void Text::changeCase(Cursor & cur, Text::TextCase action) pos_type pos = (pit == begPit ? begPos : 0); right = (pit == endPit ? endPos : parSize); - // process sequences of modified characters; in change + // process sequences of modified characters; in change // tracking mode, this approach results in much better // usability than changing case on a char-by-char basis docstring changes; @@ -1240,7 +1240,7 @@ bool Text::erase(Cursor & cur) cur.text()->setCursor(cur.top(), cur.pit(), cur.pos()); checkBufferStructure(cur.buffer(), cur); } - + return needsUpdate; } @@ -1263,14 +1263,14 @@ bool Text::backspacePos0(Cursor & cur) Paragraph const & prevpar = prevcur.paragraph(); // is it an empty paragraph? - if (cur.lastpos() == 0 + if (cur.lastpos() == 0 || (cur.lastpos() == 1 && par.isSeparator(0))) { recordUndo(cur, Undo::ATOMIC, prevcur.pit(), cur.pit()); plist.erase(boost::next(plist.begin(), cur.pit())); needsUpdate = true; } // is previous par empty? - else if (prevcur.lastpos() == 0 + else if (prevcur.lastpos() == 0 || (prevcur.lastpos() == 1 && prevpar.isSeparator(0))) { recordUndo(cur, Undo::ATOMIC, prevcur.pit(), cur.pit()); plist.erase(boost::next(plist.begin(), prevcur.pit())); @@ -1853,7 +1853,7 @@ docstring Text::getPossibleLabel(Cursor & cur) const // types of insets and take our abbreviation from them. if (name.empty()) { Inset::Code const codes[] = { - Inset::FLOAT_CODE, + Inset::FLOAT_CODE, Inset::WRAP_CODE, Inset::FOOT_CODE }; @@ -1865,7 +1865,7 @@ docstring Text::getPossibleLabel(Cursor & cur) const } } } - + // Create a correct prefix for prettyref if (name == "theorem") name = from_ascii("thm"); @@ -1873,7 +1873,7 @@ docstring Text::getPossibleLabel(Cursor & cur) const name = from_ascii("fn"); else if (name == "listing") name = from_ascii("lst"); - + if (!name.empty()) text = name.substr(0, 3) + ':' + text; @@ -1916,7 +1916,7 @@ void Text::setCursorFromCoordinates(Cursor & cur, int const x, int const y) bool bound = false; int xx = x; - pos_type const pos = row.pos() + pos_type const pos = row.pos() + tm.getColumnNearX(pit, row, xx, bound); LYXERR(Debug::DEBUG) @@ -1943,7 +1943,7 @@ void Text::charsTranspose(Cursor & cur) Paragraph & par = cur.paragraph(); - // Get the positions of the characters to be transposed. + // Get the positions of the characters to be transposed. pos_type pos1 = pos - 1; pos_type pos2 = pos; @@ -1966,7 +1966,7 @@ void Text::charsTranspose(Cursor & cur) char_type char1 = par.getChar(pos1); Font const font1 = par.getFontSettings(cur.buffer().params(), pos1); - + char_type char2 = par.getChar(pos2); Font const font2 = par.getFontSettings(cur.buffer().params(), pos2); diff --git a/src/Text.h b/src/Text.h index edc2524a66..5e078964ba 100644 --- a/src/Text.h +++ b/src/Text.h @@ -165,7 +165,7 @@ public: /// just selects the word the cursor is in void selectWord(Cursor & cur, word_location loc); - /// what type of change operation to make + /// what type of change operation to make enum ChangeOp { ACCEPT, REJECT @@ -207,7 +207,7 @@ public: /// FIXME: cleanup to use BufferView::getCoveringInset() and /// setCursorFromCoordinates() instead of checkInsetHit(). Inset * editXY(Cursor & cur, int x, int y); - + /// Move cursor one line up. /** * Returns true if an update is needed after the move. diff --git a/src/Text2.cpp b/src/Text2.cpp index 2815dce159..ef0c3db464 100644 --- a/src/Text2.cpp +++ b/src/Text2.cpp @@ -271,7 +271,7 @@ void Text::setCharFont(Buffer const & buffer, pit_type pit, pos_type pos, Font const & fnt) { BOOST_ASSERT(!pars_[pit].isInset(pos) || - !pars_[pit].getInset(pos)->noFontChange()); + !pars_[pit].getInset(pos)->noFontChange()); Font font = fnt; Layout_ptr const & layout = pars_[pit].layout(); @@ -314,7 +314,7 @@ void Text::setInsetFont(Buffer const & buffer, pit_type pit, pos_type pos, Font const & font, bool toggleall) { BOOST_ASSERT(pars_[pit].isInset(pos) && - pars_[pit].getInset(pos)->noFontChange()); + pars_[pit].getInset(pos)->noFontChange()); Inset * const inset = pars_[pit].getInset(pos); DocIterator dit = doc_iterator_begin(*inset); @@ -489,7 +489,7 @@ void Text::setFont(Cursor & cur, Font const & font, bool toggleall) // And resolve it completely real_current_font.realize(layoutfont); - // if there is no selection that's all we need to do + // if there is no selection that's all we need to do if (!cur.selection()) return; @@ -497,7 +497,7 @@ void Text::setFont(Cursor & cur, Font const & font, bool toggleall) recordUndoSelection(cur); setFont(cur.buffer(), cur.selectionBegin(), cur.selectionEnd(), font, - toggleall); + toggleall); } @@ -674,9 +674,9 @@ void Text::insertInset(Cursor & cur, Inset * inset) { BOOST_ASSERT(this == cur.text()); BOOST_ASSERT(inset); - cur.paragraph().insertInset(cur.pos(), inset, + cur.paragraph().insertInset(cur.pos(), inset, Change(cur.buffer().params().trackChanges ? - Change::INSERTED : Change::UNCHANGED)); + Change::INSERTED : Change::UNCHANGED)); } @@ -767,7 +767,7 @@ void Text::setCurrentFont(Cursor & cur) if (cur.boundary() && pos > 0 && pos < cur.lastpos()) { --pos; - // We may have just moved to the previous row --- + // We may have just moved to the previous row --- // we're going to be needing its bidi tables! bidi.computeTables(par, cur.buffer(), cur.textRow()); } @@ -967,7 +967,7 @@ bool Text::checkAndActivateInset(Cursor & cur, bool front) * from which we are entering. Otherwise, cursor placement goes awry, * and when we exit from the beginning, we'll be placed *after* the * inset. - */ + */ if (!front) --cur.pos(); inset->edit(cur, front); @@ -988,21 +988,21 @@ bool Text::cursorLeft(Cursor & cur) // If checkAndActivateInset returns true, that means that // the cursor was placed inside it, so we're done if (!checkAndActivateInset(cur, false)) { - if (!cur.boundary() && - cur.textRow().pos() == cur.pos() + if (!cur.boundary() && + cur.textRow().pos() == cur.pos() // FIXME: the following two conditions are copied // from cursorRight; however, isLineSeparator() // is definitely wrong here, isNewline I'm not sure // about. I'm leaving them as comments for now, // until we understand why they should or shouldn't // be here. - /*&& + /*&& !cur.paragraph().isLineSeparator(cur.pos()-1) && !cur.paragraph().isNewline(cur.pos() - 1)*/) { - updateNeeded |= setCursor(cur, cur.pit(), cur.pos(), + updateNeeded |= setCursor(cur, cur.pit(), cur.pos(), true, true); } - updateNeeded |= setCursor(cur, cur.pit(),cur.pos() - 1, + updateNeeded |= setCursor(cur, cur.pit(),cur.pos() - 1, true, false); } return updateNeeded; @@ -1027,7 +1027,7 @@ bool Text::cursorRight(Cursor & cur) true, false); bool updateNeeded = false; - // If checkAndActivateInset returns true, that means that + // If checkAndActivateInset returns true, that means that // the cursor was placed inside it, so we're done if (!checkAndActivateInset(cur, true)) { if (cur.textRow().endpos() == cur.pos() + 1 && @@ -1065,9 +1065,9 @@ bool Text::cursorUp(Cursor & cur) cur.setTargetX(); // We want to keep the x-target on subsequent up movements // that cross beyond the end of short lines. Thus a special - // handling when the cursor is at the end of line: Use the new + // handling when the cursor is at the end of line: Use the new // x-target only if the old one was before the end of line. - if (cur.pos() != pm.rows()[row].endpos() + if (cur.pos() != pm.rows()[row].endpos() || (!isWithinRtlParagraph(cur) && x < cur.targetX()) || (isWithinRtlParagraph(cur) && x > cur.targetX())) { @@ -1132,9 +1132,9 @@ bool Text::cursorDown(Cursor & cur) cur.setTargetX(); // We want to keep the x-target on subsequent down movements // that cross beyond the end of short lines. Thus a special - // handling when the cursor is at the end of line: Use the new + // handling when the cursor is at the end of line: Use the new // x-target only if the old one was before the end of line. - if (cur.pos() != pm.rows()[row].endpos() + if (cur.pos() != pm.rows()[row].endpos() || (!isWithinRtlParagraph(cur) && x < cur.targetX()) || (isWithinRtlParagraph(cur) && x > cur.targetX())) { @@ -1156,7 +1156,7 @@ bool Text::cursorDown(Cursor & cur) Cursor dummy = cur; if (dummy == old) ++dummy.pos(); - + bool const changed = cur.bv().checkDepm(dummy, old); // Make sure that cur gets back whatever happened to dummy(Lgb) @@ -1350,7 +1350,7 @@ void Text::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool tra } // don't delete anything if this is the only remaining paragraph within the given range - // note: Text::acceptOrRejectChanges() sets the cursor to 'first' after calling DEPM + // note: Text::acceptOrRejectChanges() sets the cursor to 'first' after calling DEPM if (first == last) continue; diff --git a/src/Text3.cpp b/src/Text3.cpp index 4085b75a89..3ebb1db41b 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -334,7 +334,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) std::swap(pars_[pit], pars_[pit + 1]); ParIterator begin(cur); - // begin.pos() (== cur.pos()) may point beyond the end of the + // begin.pos() (== cur.pos()) may point beyond the end of the // paragraph referenced by begin. This would cause a crash // in updateLabels() begin.pos() = 0; @@ -353,7 +353,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) std::swap(pars_[pit], pars_[pit - 1]); ParIterator end = ParIterator(cur); - // end.pos() (== cur.pos()) may point beyond the end of the + // end.pos() (== cur.pos()) may point beyond the end of the // paragraph referenced by end. This would cause a crash // in boost::next() end.pos() = 0; @@ -734,7 +734,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) // FIXME (Abdel 01/02/2006): // What follows would be a partial fix for bug 2154: // http://bugzilla.lyx.org/show_bug.cgi?id=2154 - // This automatically put the label inset _after_ a + // This automatically put the label inset _after_ a // numbered section. It should be possible to extend the mechanism // to any kind of LateX environement. // The correct way to fix that bug would be at LateX generation. @@ -810,7 +810,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) break; case LFUN_CHARS_TRANSPOSE: - charsTranspose(cur); + charsTranspose(cur); break; case LFUN_PASTE: @@ -926,13 +926,13 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) case LFUN_CLIPBOARD_PASTE: cur.clearSelection(); pasteClipboard(cur, bv->buffer()->errorList("Paste"), - cmd.argument() == "paragraph"); + cmd.argument() == "paragraph"); bv->buffer()->errors("Paste"); break; case LFUN_PRIMARY_SELECTION_PASTE: pasteString(cur, theSelection().get(), - cmd.argument() == "paragraph"); + cmd.argument() == "paragraph"); break; case LFUN_UNICODE_INSERT: { @@ -949,7 +949,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) } break; } - + case LFUN_QUOTE_INSERT: { Paragraph & par = cur.paragraph(); pos_type pos = cur.pos(); @@ -1244,7 +1244,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) pars.push_back(Paragraph()); pars.back().setInsetOwner(pars[0].inInset()); pars.back().layout(tclass.defaultLayout()); - + } // reposition the cursor to the caption @@ -1602,7 +1602,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) // update flag treatment. if (singleParUpdate) { // Inserting characters does not change par height - ParagraphMetrics const & pms + ParagraphMetrics const & pms = cur.bv().parMetrics(cur.bottom().text(), cur.bottom().pit()); if (pms.dim().height() == olddim.height()) { @@ -1624,7 +1624,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) // //if (cur.result().update() != Update::FitCursor) // cur.noUpdate(); - // + // // But some LFUNs do not set Update::FitCursor when needed, so we // do it for all. This is not very harmfull as FitCursor will provoke // a full redraw only if needed but still, a proper review of all LFUN diff --git a/src/TextClass.cpp b/src/TextClass.cpp index 36aab53ac6..2072b08d78 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -259,7 +259,7 @@ bool TextClass::read(FileName const & filename, bool merge) if (tmp.empty()) { lexrc.printError("Could not find input" - "file: " + inc); + "file: " + inc); error = true; } else if (read(tmp, true)) { lexrc.printError("Error reading input" diff --git a/src/TextClassList.cpp b/src/TextClassList.cpp index 546e02e92c..aee1144668 100644 --- a/src/TextClassList.cpp +++ b/src/TextClassList.cpp @@ -103,7 +103,7 @@ bool TextClassList::read() if (real_file.empty()) { lyxerr << "TextClassList::Read: unable to find " - "textclass file `" + "textclass file `" << to_utf8(makeDisplayPath(real_file.absFilename(), 1000)) << "'. Exiting." << endl; return false; @@ -122,7 +122,7 @@ bool TextClassList::read() if (!lex.isOK()) { lyxerr << "TextClassList::Read: unable to open " - "textclass file `" + "textclass file `" << to_utf8(makeDisplayPath(real_file.absFilename(), 1000)) << "'\nCheck your installation. LyX can't continue." << endl; @@ -199,7 +199,7 @@ TextClassList::addTextClass(std::string const & textclass, std::string const & p // returns: whole string, classtype (not used here), first option, description BOOST_ASSERT(sub.size()==4); // now, add the layout to textclass. - TextClass tmpl(textclass, sub.str(2)==""?textclass:sub.str(2), + TextClass tmpl(textclass, sub.str(2)==""?textclass:sub.str(2), sub.str(3) + " <" + path + ">", true); if (lyxerr.debugging(Debug::TCLASS)) tmpl.load(path); @@ -211,7 +211,7 @@ TextClassList::addTextClass(std::string const & textclass, std::string const & p // If .layout is not in local directory, or an invalid layout is found, return false return make_pair(false, textclass_type(0)); } - + // Global variable: textclass table. TextClassList textclasslist; diff --git a/src/TextClassList.h b/src/TextClassList.h index 0defc16c07..6f8f963fc5 100644 --- a/src/TextClassList.h +++ b/src/TextClassList.h @@ -50,11 +50,11 @@ public: /// Read textclass list. Returns false if this fails. bool read(); - - /// add a textclass from user local directory. - /// Return ture/false, and textclass number - std::pair const - addTextClass(std::string const & textclass, std::string const & path); + + /// add a textclass from user local directory. + /// Return ture/false, and textclass number + std::pair const + addTextClass(std::string const & textclass, std::string const & path); private: /// diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 9fd56f6b6f..ba87f122d8 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -147,7 +147,7 @@ bool TextMetrics::metrics(MetricsInfo & mi, Dimension & dim) //lyxerr << "Text::metrics: width: " << mi.base.textwidth // << " maxWidth: " << max_width_ << "\nfont: " << mi.base.font << endl; - + bool changed = false; unsigned int h = 0; @@ -190,7 +190,7 @@ bool TextMetrics::redoParagraph(pit_type const pit) main_text_ = (text_ == &buffer.text()); bool changed = false; - // FIXME This check ought to be done somewhere else. It is the reason + // FIXME This check ought to be done somewhere else. It is the reason // why text_ is not const. But then, where else to do it? // Well, how can you end up with either (a) a biblio environment that // has no InsetBibitem or (b) a biblio environment with more than one @@ -419,7 +419,7 @@ int TextMetrics::labelFill(Paragraph const & par, Row const & row) const if (label.empty()) return 0; - FontMetrics const & fm + FontMetrics const & fm = theFontMetrics(text_->getLabelFont(buffer, par)); return max(0, fm.width(label) - w); @@ -782,8 +782,8 @@ void TextMetrics::setHeightOfRow(pit_type const pit, maxasc += int(layoutasc * 2 / (2 + pars[pit].getDepth())); maxdesc += int(layoutdesc * 2 / (2 + pars[pit].getDepth())); - // FIXME: the correct way is to do the following is to move the - // following code in another method specially tailored for the + // FIXME: the correct way is to do the following is to move the + // following code in another method specially tailored for the // main Text. The following test is thus bogus. // Top and bottom margin of the document (only at top-level) if (main_text_) { @@ -837,7 +837,7 @@ pos_type TextMetrics::getColumnNearX(pit_type const pit, return 0; } - frontend::FontMetrics const & fm + frontend::FontMetrics const & fm = theFontMetrics(text_->getLabelFont(buffer, par)); while (vc < end && tmpx <= x) { diff --git a/src/TextMetrics.h b/src/TextMetrics.h index b601af7bd2..3d2cae5e40 100644 --- a/src/TextMetrics.h +++ b/src/TextMetrics.h @@ -71,7 +71,7 @@ public: private: - /// + /// ParagraphMetrics & parMetrics(pit_type, bool redo_paragraph); /// the minimum space a manual label needs on the screen in pixels @@ -100,7 +100,7 @@ public: /// returns pos in given par at given x coord. pos_type x2pos(pit_type pit, int row, int x) const; - + // FIXME: is there a need for this? //int pos2x(pit_type pit, pos_type pos) const; diff --git a/src/TocBackend.cpp b/src/TocBackend.cpp index 103721213a..5adc71d486 100644 --- a/src/TocBackend.cpp +++ b/src/TocBackend.cpp @@ -123,7 +123,7 @@ Toc const & TocBackend::toc(std::string const & type) const void TocBackend::updateItem(ParConstIterator const & par_it) { - // TODO should not happen, + // TODO should not happen, // a call to TocBackend::update() is missing somewhere if (toc("tableofcontents").empty()) return; @@ -144,7 +144,7 @@ void TocBackend::updateItem(ParConstIterator const & par_it) if (inset.lyxCode() == Inset::OPTARG_CODE) { if (!tocstring.empty()) break; - Paragraph const & par = + Paragraph const & par = *static_cast(inset).paragraphs().begin(); if (!toc_item->par_it_->getLabelstring().empty()) tocstring = toc_item->par_it_->getLabelstring() + ' '; @@ -189,7 +189,7 @@ void TocBackend::update() case Inset::OPTARG_CODE: { if (!tocstring.empty()) break; - Paragraph const & par = + Paragraph const & par = *static_cast(inset).paragraphs().begin(); if (!pit->getLabelstring().empty()) tocstring = pit->getLabelstring() + ' '; diff --git a/src/TocBackend.h b/src/TocBackend.h index ca69b09237..75f0ea4ffd 100644 --- a/src/TocBackend.h +++ b/src/TocBackend.h @@ -58,7 +58,7 @@ public: /// the action corresponding to the goTo above FuncRequest action() const; - + protected: /// Current position of item. ParConstIterator par_it_; @@ -114,7 +114,7 @@ public: void writePlaintextTocList(std::string const & type, odocstream & os) const; private: - /// + /// TocList tocs_; /// Buffer const * buffer_; diff --git a/src/ToolbarBackend.cpp b/src/ToolbarBackend.cpp index 948a5ae9a1..9738b0597c 100644 --- a/src/ToolbarBackend.cpp +++ b/src/ToolbarBackend.cpp @@ -92,7 +92,7 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex) TO_ICONPALETTE, TO_LAST }; - + struct keyword_item toolTags[TO_LAST - 1] = { { "end", TO_ENDTOOLBAR }, { "iconpalette", TO_ICONPALETTE }, @@ -165,7 +165,7 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex) add(ToolbarItem(ToolbarItem::POPUPMENU, name, label)); } break; - + case TO_ICONPALETTE: if (lex.next(true)) { string const name = lex.getString(); @@ -174,12 +174,12 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex) add(ToolbarItem(ToolbarItem::ICONPALETTE, name, label)); } break; - + case TO_LAYOUTS: add(ToolbarItem(ToolbarItem::LAYOUTS, FuncRequest(kb_action(ToolbarItem::LAYOUTS)))); break; - + case TO_TABLEINSERT: if (lex.next(true)) { docstring const tooltip = lex.getDocString(); @@ -187,7 +187,7 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex) FuncRequest(kb_action(ToolbarItem::TABLEINSERT)), tooltip)); } break; - + case TO_ENDTOOLBAR: quit = true; break; @@ -218,7 +218,7 @@ void ToolbarBackend::readToolbars(Lexer & lex) TO_ENDTOOLBARSET, TO_LAST }; - + struct keyword_item toolTags[TO_LAST - 1] = { { "end", TO_ENDTOOLBARSET }, { "toolbar", TO_TOOLBAR } diff --git a/src/ToolbarBackend.h b/src/ToolbarBackend.h index c7d32cf449..4b6169110e 100644 --- a/src/ToolbarBackend.h +++ b/src/ToolbarBackend.h @@ -36,7 +36,7 @@ public: LAYOUTS, /// a special widget to insert tabulars TABLEINSERT, - /// + /// POPUPMENU, /// ICONPALETTE diff --git a/src/Trans.h b/src/Trans.h index ceb6536c0f..92cad9b0dc 100644 --- a/src/Trans.h +++ b/src/Trans.h @@ -149,7 +149,7 @@ private: docstring const & match(char_type c); /// void insertException(KmodException & exclist, char_type c, - docstring const & data, bool = false, + docstring const & data, bool = false, tex_accent = TEX_NOACCENT); /// void freeException(KmodException & exclist); diff --git a/src/buffer_funcs.cpp b/src/buffer_funcs.cpp index e53f897805..bed9c147ae 100644 --- a/src/buffer_funcs.cpp +++ b/src/buffer_funcs.cpp @@ -377,7 +377,7 @@ void setCaptionLabels(Inset & inset, string const & type, setCaptionLabels(icap, type, label, counters); if (icap.lyxCode() == Inset::CAPTION_CODE) { // We found a caption! - counters.step(counter); + counters.step(counter); int number = counters.value(counter); InsetCaption & ic = static_cast(icap); ic.setType(type); @@ -400,7 +400,7 @@ void setCaptions(Paragraph & par, TextClass const & textclass) InsetList::iterator end = par.insetlist.end(); for (; it != end; ++it) { Inset & inset = *it->inset; - if (inset.lyxCode() == Inset::FLOAT_CODE + if (inset.lyxCode() == Inset::FLOAT_CODE || inset.lyxCode() == Inset::WRAP_CODE) { docstring const name = inset.name(); if (name.empty()) diff --git a/src/bufferview_funcs.cpp b/src/bufferview_funcs.cpp index cf47bcf855..2f3b1d9494 100644 --- a/src/bufferview_funcs.cpp +++ b/src/bufferview_funcs.cpp @@ -204,7 +204,7 @@ Point coordOffset(BufferView const & bv, DocIterator const & dit, Point getPos(BufferView const & bv, DocIterator const & dit, bool boundary) { CursorSlice const & bot = dit.bottom(); - CoordCache::ParPosCache::const_iterator cache_it = + CoordCache::ParPosCache::const_iterator cache_it = bv.coordCache().getParPos().find(bot.text()); if (cache_it == bv.coordCache().getParPos().end()) return Point(-1, -1); diff --git a/src/callback.cpp b/src/callback.cpp index 05a89db245..3f6701a017 100644 --- a/src/callback.cpp +++ b/src/callback.cpp @@ -401,7 +401,7 @@ docstring const getContentsOfPlaintextFile(BufferView * bv, string const & f, // FIXME UNICODE: We don't know the encoding of the file docstring file_content = from_utf8(tmpstr); if (file_content.empty()) { - Alert::error(_("Reading not UTF-8 encoded file"), + Alert::error(_("Reading not UTF-8 encoded file"), _("The file is not UTF-8 encoded.\n" "It will be read as local 8Bit-encoded.\n" "If this does not give the correct result\n" @@ -409,7 +409,7 @@ docstring const getContentsOfPlaintextFile(BufferView * bv, string const & f, "to UTF-8 with a program other than LyX.\n")); file_content = from_local8bit(tmpstr); } - + return normalize_kc(file_content); } diff --git a/src/client/client.cpp b/src/client/client.cpp index 5a5fbae2a7..24d2391c0c 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -635,4 +635,3 @@ void assertion_failed(char const* a, char const* b, char const* c, long d) } } // namespace boost - diff --git a/src/debug.h b/src/debug.h index 7d4cf910d2..3648ec83d2 100644 --- a/src/debug.h +++ b/src/debug.h @@ -1,7 +1,7 @@ // -*- C++ -*- /** * \file debug.h - * + * * FIXME: It would be nice if, in lyx::use_gui mode, instead of * outputting to the console, we would pipe all messages onto a file * and visualise the contents dynamically in a Qt window if needed. diff --git a/src/factory.cpp b/src/factory.cpp index 09296591da..a0f0ee3537 100644 --- a/src/factory.cpp +++ b/src/factory.cpp @@ -264,7 +264,7 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd) InsetCollapsable::CollapseStatus st; InsetERTMailer::string2params(to_utf8(cmd.argument()), st); return new InsetERT(params, st); - + } else if (name == "listings") { InsetListingsParams par; InsetListingsMailer::string2params(to_utf8(cmd.argument()), par); diff --git a/src/frontends/Alert_pimpl.h b/src/frontends/Alert_pimpl.h index 70c3e3385a..c95892e3bf 100644 --- a/src/frontends/Alert_pimpl.h +++ b/src/frontends/Alert_pimpl.h @@ -31,4 +31,3 @@ void information_pimpl(docstring const & title, docstring const & warning); std::pair const askForText_pimpl(docstring const & msg, docstring const & dflt); } // namespace lyx - diff --git a/src/frontends/Application.cpp b/src/frontends/Application.cpp index aad1b54053..246476dd5a 100644 --- a/src/frontends/Application.cpp +++ b/src/frontends/Application.cpp @@ -53,7 +53,7 @@ LyXView & Application::createView(unsigned int width, { LyXView & view = gui().createRegisteredView(); int view_id = view.id(); - + theLyXFunc().setLyXView(&view); /*int workArea_id_ =*/ gui().newWorkArea(width, height, view_id); diff --git a/src/frontends/Application.h b/src/frontends/Application.h index f64ee45fc4..bfe4a9229f 100644 --- a/src/frontends/Application.h +++ b/src/frontends/Application.h @@ -38,7 +38,7 @@ initialisation should be done before the instanciation of this class. common to all frontends. Model/View/Controller separation in LyX: - + 1) The Model: \c Buffer The Buffer is the in-memory representation of a LyX file format. The @@ -46,10 +46,10 @@ common to all frontends. is represented on screen. There is one unique Buffer per opened LyX file. - + 2) The Controller: \c BufferView / \c Painter - The BufferView is a tool used by the view that translates a part of + The BufferView is a tool used by the view that translates a part of the Buffer contents into drawing routines. The BufferView asks each inset of the Buffer to draw itself onto the screen using the Painter. There can be only one Buffer displayed in a BufferView. While there @@ -60,12 +60,12 @@ common to all frontends. The \c Painter is just a virtual interface to formalize each kind of drawing routines (text, line, rectangle, etc). - + The \c BufferView also contains a Cursor which may or may not be visible on screen. The cursor is really just a bookmark to remember where the next Buffer insertion/deletion is going to take place. - + 3) The View: \c WorkArea (and it's qt4 specialisation GuiWorkArea) This contains the real screen area where the drawing is done by the @@ -81,9 +81,9 @@ common to all frontends. - select char - etc. - + 4) The Window: \c LyXView (and its qt4 specialisation \c GuiView) - + This is a full window containing a menubar, toolbars, a tabbar and a WorkArea. One LyXView could in theory contain multiple WorkArea (ex: with split window) but this number is limited to one only for @@ -95,7 +95,7 @@ common to all frontends. the WorkArea to switch to this another Buffer. With a TabWidget, each Tab would own its own \c WorkArea. Clicking on a tab - would switch a WorkArea instead of a Buffer. + would switch a WorkArea instead of a Buffer. */ class Application { @@ -174,11 +174,11 @@ public: LyXView & createView(unsigned int width, unsigned int height, int posx, int posy, int maximized, unsigned int iconSizeXY, const std::string & geometryArg); - - /// + + /// LyXView const * currentView() const; - /// + /// LyXView * currentView(); /// diff --git a/src/frontends/FileDialog.h b/src/frontends/FileDialog.h index ddf73a2b87..bd97a66dc4 100644 --- a/src/frontends/FileDialog.h +++ b/src/frontends/FileDialog.h @@ -22,7 +22,7 @@ namespace lyx { -namespace support { class FileFilterList; } +namespace support { class FileFilterList; } /** diff --git a/src/frontends/Gui.h b/src/frontends/Gui.h index 0d7ec628ab..5b84e39297 100644 --- a/src/frontends/Gui.h +++ b/src/frontends/Gui.h @@ -47,9 +47,9 @@ public: /// virtual LyXView& view(int id) const = 0; /// - std::vector const & viewIds() - { - return view_ids_; + std::vector const & viewIds() + { + return view_ids_; } diff --git a/src/frontends/LyXView.cpp b/src/frontends/LyXView.cpp index b6995e0e87..8086b69f65 100644 --- a/src/frontends/LyXView.cpp +++ b/src/frontends/LyXView.cpp @@ -170,7 +170,7 @@ bool LyXView::loadLyXFile(FileName const & filename, bool tolastfiles) if (hadBuffer) disconnectBuffer(); - bool const loaded = + bool const loaded = work_area_->bufferView().loadLyXFile(filename, tolastfiles); updateToc(); @@ -340,7 +340,7 @@ void LyXView::updateToolbars() bool const review = lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).enabled() && lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).onoff(true); - + toolbars_->update(math, table, review); // update redaonly status of open dialogs. This could also be in // updateMenubar(), but since updateToolbars() and updateMenubar() diff --git a/src/frontends/LyXView.h b/src/frontends/LyXView.h index be9dea615c..dc9b6df169 100644 --- a/src/frontends/LyXView.h +++ b/src/frontends/LyXView.h @@ -79,7 +79,7 @@ public: /// return the current WorkArea (the one that has the focus). frontend::WorkArea const * currentWorkArea() const; - /// FIXME: This non-const access is needed because of + /// FIXME: This non-const access is needed because of /// a mis-designed \c ControlSpellchecker. frontend::WorkArea * currentWorkArea(); diff --git a/src/frontends/NoGuiFontMetrics.h b/src/frontends/NoGuiFontMetrics.h index b989e6c1a9..c1680960aa 100644 --- a/src/frontends/NoGuiFontMetrics.h +++ b/src/frontends/NoGuiFontMetrics.h @@ -32,33 +32,33 @@ public: virtual int maxAscent() const { return 1; } virtual int maxDescent() const { return 1; } - + virtual Dimension const defaultDimension() const { return Dimension(1, 1, 1); } virtual int width(char_type) const { return 1; } virtual int ascent(char_type) const { return 1; } - + int descent(char_type) const { return 1; } - + virtual int lbearing(char_type) const { return 1; } - + virtual int rbearing(char_type) const { return 1; } - + virtual int width(docstring const & s) const { return s.size(); } - + virtual int signedWidth(docstring const & s) const { if (s.size() && s[0] == '-') return -width(s.substr(1, s.length() - 1)); return width(s); } - + virtual Dimension const dimension(char_type) const { return Dimension(1, 1, 1); } virtual void rectText(docstring const &, int & /*width*/, int & /*ascent*/, int & /*descent*/) const {} - + virtual void buttonText(docstring const &, int & /*width*/, int & /*ascent*/, int & /*descent*/) const {} }; diff --git a/src/frontends/Painter.cpp b/src/frontends/Painter.cpp index c95e33eef2..cba834ad50 100644 --- a/src/frontends/Painter.cpp +++ b/src/frontends/Painter.cpp @@ -69,7 +69,7 @@ void Painter::rectText(int x, int y, } -void Painter::buttonText(int x, int y, docstring const & str, +void Painter::buttonText(int x, int y, docstring const & str, Font const & font, bool mouseHover) { int width; diff --git a/src/frontends/Toolbars.cpp b/src/frontends/Toolbars.cpp index 20082cdd63..099cdafbfc 100644 --- a/src/frontends/Toolbars.cpp +++ b/src/frontends/Toolbars.cpp @@ -46,7 +46,7 @@ void Toolbars::initFlags(ToolbarInfo & tbinfo) unsigned int flags = static_cast(tbinfo.flags); - // Remove default.ui positions. Only when a valid postion is stored + // Remove default.ui positions. Only when a valid postion is stored // in the session file the default.ui value will be overwritten unsigned int save = flags; TurnOffFlag(TOP); @@ -86,16 +86,16 @@ void Toolbars::initFlags(ToolbarInfo & tbinfo) } /* std::cout << "State " << info.state << " FLAGS: " << flags - << " ON:" << (flags & ToolbarBackend::ON) + << " ON:" << (flags & ToolbarBackend::ON) << " OFF:" << (flags & ToolbarBackend::OFF) - << " L:" << (flags & ToolbarBackend::LEFT) - << " R:" << (flags & ToolbarBackend::RIGHT) - << " T:" << (flags & ToolbarBackend::TOP) - << " B:" << (flags & ToolbarBackend::BOTTOM) - << " MA:" << (flags & ToolbarBackend::MATH) - << " RE:" << (flags & ToolbarBackend::REVIEW) - << " TB:" << (flags & ToolbarBackend::TABLE) - << " AU:" << (flags & ToolbarBackend::AUTO) + << " L:" << (flags & ToolbarBackend::LEFT) + << " R:" << (flags & ToolbarBackend::RIGHT) + << " T:" << (flags & ToolbarBackend::TOP) + << " B:" << (flags & ToolbarBackend::BOTTOM) + << " MA:" << (flags & ToolbarBackend::MATH) + << " RE:" << (flags & ToolbarBackend::REVIEW) + << " TB:" << (flags & ToolbarBackend::TABLE) + << " AU:" << (flags & ToolbarBackend::AUTO) << std::endl; */ // now set the flags @@ -170,7 +170,7 @@ void Toolbars::display(string const & name, bool show) ToolbarInfo::Flags Toolbars::getToolbarState(string const & name) -{ +{ ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin(); ToolbarBackend::Toolbars::const_iterator end = toolbarbackend.end(); diff --git a/src/frontends/WorkArea.cpp b/src/frontends/WorkArea.cpp index 75b077888d..0190e2d23a 100644 --- a/src/frontends/WorkArea.cpp +++ b/src/frontends/WorkArea.cpp @@ -138,7 +138,7 @@ void WorkArea::redraw() return; } - // No need to do anything if this is the current view. The BufferView + // No need to do anything if this is the current view. The BufferView // metrics are already up to date. if (&lyx_view_ != theApp()->currentView()) { // FIXME: it would be nice to optimize for the off-screen case. @@ -208,7 +208,7 @@ void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k) // In order to avoid bad surprise in the middle of an operation, we better stop // the blinking cursor. - if (!(cmd.action == LFUN_MOUSE_MOTION + if (!(cmd.action == LFUN_MOUSE_MOTION && cmd.button() == mouse_button::none)) stopBlinkingCursor(); @@ -216,7 +216,7 @@ void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k) if (needRedraw) redraw(); - + // Skip these when selecting if (cmd.action != LFUN_MOUSE_MOTION) { lyx_view_.updateLayoutChoice(); @@ -225,7 +225,7 @@ void WorkArea::dispatch(FuncRequest const & cmd0, key_modifier::state k) } // GUI tweaks except with mouse motion with no button pressed. - if (!(cmd.action == LFUN_MOUSE_MOTION + if (!(cmd.action == LFUN_MOUSE_MOTION && cmd.button() == mouse_button::none)) { // Slight hack: this is only called currently when we // clicked somewhere, so we force through the display @@ -251,7 +251,7 @@ void WorkArea::resizeBufferView() void WorkArea::updateScrollbar() { - buffer_view_->updateScrollbar(); + buffer_view_->updateScrollbar(); ScrollbarParameters const & scroll_ = buffer_view_->scrollbarParameters(); setScrollbarParams(scroll_.height, scroll_.position, scroll_.lineScrollHeight); diff --git a/src/frontends/WorkArea.h b/src/frontends/WorkArea.h index 8b4ced6052..f45e2eefd6 100644 --- a/src/frontends/WorkArea.h +++ b/src/frontends/WorkArea.h @@ -67,7 +67,7 @@ public: /// \return true if has the keyboard input focus. virtual bool hasFocus() const = 0; - + /// return the width of the work area in pixels virtual int width() const = 0; diff --git a/src/frontends/controllers/ControlCommand.cpp b/src/frontends/controllers/ControlCommand.cpp index b77e3b2b5c..df6c8a1f23 100644 --- a/src/frontends/controllers/ControlCommand.cpp +++ b/src/frontends/controllers/ControlCommand.cpp @@ -22,7 +22,7 @@ namespace lyx { namespace frontend { ControlCommand::ControlCommand(Dialog & dialog, string const & command_name, - string const & lfun_name) + string const & lfun_name) : Dialog::Controller(dialog), params_(command_name), lfun_name_(lfun_name) {} diff --git a/src/frontends/controllers/ControlCommand.h b/src/frontends/controllers/ControlCommand.h index efad2ccf2e..36ca7e9260 100644 --- a/src/frontends/controllers/ControlCommand.h +++ b/src/frontends/controllers/ControlCommand.h @@ -30,7 +30,7 @@ public: 'Apply'. */ ControlCommand(Dialog &, std::string const & command_name, - std::string const & lfun_name); + std::string const & lfun_name); /// virtual ~ControlCommand() {} /// diff --git a/src/frontends/controllers/ControlDocument.cpp b/src/frontends/controllers/ControlDocument.cpp index 7d5544d339..3eabeed441 100644 --- a/src/frontends/controllers/ControlDocument.cpp +++ b/src/frontends/controllers/ControlDocument.cpp @@ -125,7 +125,7 @@ void ControlDocument::dispatchParams() // Apply the BufferParams. dispatch_bufferparams(kernel(), params(), LFUN_BUFFER_PARAMS_APPLY); - + // redo the numbering if necessary if (new_secnumdepth != old_secnumdepth) updateLabels(kernel().buffer()); @@ -185,13 +185,13 @@ void ControlDocument::saveAsDefault() const bool const ControlDocument::isFontAvailable(std::string const & font) const { - if (font == "default" || font == "cmr" + if (font == "default" || font == "cmr" || font == "cmss" || font == "cmtt") // these are standard return true; else if (font == "lmodern" || font == "lmss" || font == "lmtt") return LaTeXFeatures::isAvailable("lmodern"); - else if (font == "times" || font == "palatino" + else if (font == "times" || font == "palatino" || font == "helvet" || font == "courier") return LaTeXFeatures::isAvailable("psnfss"); else if (font == "cmbr" || font == "cmtl") @@ -199,7 +199,7 @@ bool const ControlDocument::isFontAvailable(std::string const & font) const else if (font == "utopia") return LaTeXFeatures::isAvailable("utopia") || LaTeXFeatures::isAvailable("fourier"); - else if (font == "beraserif" || font == "berasans" + else if (font == "beraserif" || font == "berasans" || font == "beramono") return LaTeXFeatures::isAvailable("bera"); else diff --git a/src/frontends/controllers/ControlExternal.cpp b/src/frontends/controllers/ControlExternal.cpp index 7319daf677..deeb8b6e90 100644 --- a/src/frontends/controllers/ControlExternal.cpp +++ b/src/frontends/controllers/ControlExternal.cpp @@ -150,7 +150,7 @@ ControlExternal::getTemplateFilters(string const & template_name) const external::Template const * const et_ptr = etm.getTemplateByName(template_name); - if (et_ptr) + if (et_ptr) return et_ptr->fileRegExp; return string(); @@ -163,7 +163,7 @@ docstring const ControlExternal::browse(docstring const & input, docstring const title = _("Select external file"); docstring const bufpath = lyx::from_utf8(kernel().bufferFilepath()); - FileFilterList const filter = + FileFilterList const filter = FileFilterList(lyx::from_utf8(getTemplateFilters(lyx::to_utf8(template_name)))); std::pair dir1(_("Documents|#o#O"), diff --git a/src/frontends/controllers/ControlExternal.h b/src/frontends/controllers/ControlExternal.h index e27c5fd9c3..a2afd568a4 100644 --- a/src/frontends/controllers/ControlExternal.h +++ b/src/frontends/controllers/ControlExternal.h @@ -65,7 +65,7 @@ public: /// external::Template getTemplate(int) const; /// - std::string const + std::string const getTemplateFilters(std::string const & template_name) const; /// docstring const browse(docstring const & input_file, diff --git a/src/frontends/controllers/ControlMath.cpp b/src/frontends/controllers/ControlMath.cpp index 9ea338cf04..77afe1f5eb 100644 --- a/src/frontends/controllers/ControlMath.cpp +++ b/src/frontends/controllers/ControlMath.cpp @@ -35,7 +35,7 @@ ControlMath::ControlMath(Dialog & dialog) : Dialog::Controller(dialog) { // FIXME: Ideally, those unicode codepoints would be defined - // in "lib/symbols". Unfortunately, some of those are already + // in "lib/symbols". Unfortunately, some of those are already // defined with non-unicode ids for use within mathed. // FIXME 2: We should fill-in this map with the parsed "symbols" // file done in MathFactory.cpp. @@ -139,11 +139,11 @@ MathSymbol const & ControlMath::mathSymbol(string tex_name) const { map::const_iterator it = math_symbols_.find(tex_name); - + static MathSymbol unknown_symbol; if (it == math_symbols_.end()) return unknown_symbol; - + return it->second; } @@ -152,11 +152,11 @@ std::string const & ControlMath::texName(char_type math_symbol) const { map::const_iterator it = tex_names_.find(math_symbol); - + static string empty_string; if (it == tex_names_.end()) return empty_string; - + return it->second; } @@ -196,10 +196,10 @@ char const * latex_arrow[] = { "Downarrow", "Uparrow", "Updownarrow", "Leftrightarrow", "Longleftrightarrow", "Longleftarrow", "Longrightarrow", "longleftrightarrow", "longleftarrow", "longrightarrow", - "leftharpoondown", "rightharpoondown", + "leftharpoondown", "rightharpoondown", "mapsto", "longmapsto", "nwarrow", "nearrow", - "leftharpoonup", "rightharpoonup", + "leftharpoonup", "rightharpoonup", "hookleftarrow", "hookrightarrow", "swarrow", "searrow", "rightleftharpoons", @@ -295,7 +295,7 @@ char const * latex_ams_misc[] = { int const nr_latex_ams_misc = sizeof(latex_ams_misc) / sizeof(char const *); char const * latex_ams_arrows[] = { - "dashleftarrow", "dashrightarrow", + "dashleftarrow", "dashrightarrow", "leftleftarrows", "leftrightarrows", "rightrightarrows", "rightleftarrows", "Lleftarrow", "Rrightarrow", @@ -322,7 +322,7 @@ char const * latex_ams_rel[] = { "leqq", "geqq", "leqslant", "geqslant", "eqslantless", "eqslantgtr", - "lesssim", "gtrsim", + "lesssim", "gtrsim", "lessapprox", "gtrapprox", "approxeq", "triangleq", "lessdot", "gtrdot", @@ -334,21 +334,21 @@ char const * latex_ams_rel[] = { "thicksim", "thickapprox", "backsim", "backsimeq", "subseteqq", "supseteqq", - "Subset", "Supset", + "Subset", "Supset", "sqsubset", "sqsupset", - "preccurlyeq", "succcurlyeq", - "curlyeqprec", "curlyeqsucc", - "precsim", "succsim", - "precapprox", "succapprox", - "vartriangleleft", "vartriangleright", + "preccurlyeq", "succcurlyeq", + "curlyeqprec", "curlyeqsucc", + "precsim", "succsim", + "precapprox", "succapprox", + "vartriangleleft", "vartriangleright", "trianglelefteq", "trianglerighteq", - "bumpeq", "Bumpeq", + "bumpeq", "Bumpeq", "doteqdot", "risingdotseq", "fallingdotseq", "vDash", "Vvdash", "Vdash", - "shortmid", "shortparallel", + "shortmid", "shortparallel", "smallsmile", "smallfrown", "blacktriangleleft", "blacktriangleright", - "because", "therefore", + "because", "therefore", "backepsilon", "varpropto", "between", diff --git a/src/frontends/controllers/ControlParagraph.cpp b/src/frontends/controllers/ControlParagraph.cpp index bc80c797cf..84dd61373c 100644 --- a/src/frontends/controllers/ControlParagraph.cpp +++ b/src/frontends/controllers/ControlParagraph.cpp @@ -157,7 +157,7 @@ bool ControlParagraph::inInset() const bool ControlParagraph::canIndent() const { - return kernel().buffer().params().paragraph_separation == + return kernel().buffer().params().paragraph_separation == BufferParams::PARSEP_INDENT; } diff --git a/src/frontends/controllers/ControlViewSource.h b/src/frontends/controllers/ControlViewSource.h index 9c21fcc4ba..43081f5658 100644 --- a/src/frontends/controllers/ControlViewSource.h +++ b/src/frontends/controllers/ControlViewSource.h @@ -38,7 +38,7 @@ public: /// bool canApply() const { return true; } - /// The title displayed by the dialog reflects source type. + /// The title displayed by the dialog reflects source type. docstring const title() const; /** get the source code of selected paragraphs, or the whole document diff --git a/src/frontends/controllers/tests/biblio.cpp b/src/frontends/controllers/tests/biblio.cpp index 6fe25a36b3..fc4e211b58 100644 --- a/src/frontends/controllers/tests/biblio.cpp +++ b/src/frontends/controllers/tests/biblio.cpp @@ -79,7 +79,7 @@ void test_RegexMatch() try { RegexMatch rm(im, "h.*o", false); - + cout << rm("hello") << endl; cout << rm("hei") << endl; } diff --git a/src/frontends/qt4/BulletsModule.cpp b/src/frontends/qt4/BulletsModule.cpp index 46cf50d547..d32ba53fb8 100644 --- a/src/frontends/qt4/BulletsModule.cpp +++ b/src/frontends/qt4/BulletsModule.cpp @@ -150,7 +150,7 @@ void BulletsModule::on_customCB_clicked(bool custom) current_font_ = bulletpaneCO->currentIndex(); return; } - + // unselect previous item selectItem(current_font_, current_char_, false); current_font_ = -1; diff --git a/src/frontends/qt4/DockView.h b/src/frontends/qt4/DockView.h index 1c2f13436e..d582081c71 100644 --- a/src/frontends/qt4/DockView.h +++ b/src/frontends/qt4/DockView.h @@ -27,7 +27,7 @@ namespace frontend { /// This template class that encapsulates a given Widget inside a /// DockWidget and presents a Dialog::View interface template -class DockView : public QDockWidget, public Dialog::View +class DockView : public QDockWidget, public Dialog::View { public: DockView( @@ -49,7 +49,7 @@ public: void apply() {} void hide() { QDockWidget::hide(); } void show() { QDockWidget::show(); } - bool isVisible() const + bool isVisible() const { return QDockWidget::isVisible(); } void redraw() {} void update() diff --git a/src/frontends/qt4/EmptyTable.cpp b/src/frontends/qt4/EmptyTable.cpp index bc233cbdca..6c354fcc36 100644 --- a/src/frontends/qt4/EmptyTable.cpp +++ b/src/frontends/qt4/EmptyTable.cpp @@ -81,7 +81,7 @@ void EmptyTable::setNumberColumns(int nr_cols) setColumnCount(nr_cols); resetCellSize(); updateGeometry(); - // emit signal + // emit signal colsChanged(nr_cols); } @@ -95,7 +95,7 @@ void EmptyTable::setNumberRows(int nr_rows) setRowCount(nr_rows); resetCellSize(); updateGeometry(); - // emit signal + // emit signal rowsChanged(nr_rows); } diff --git a/src/frontends/qt4/FileDialog.cpp b/src/frontends/qt4/FileDialog.cpp index 2ac380abb4..aa47cd41ba 100644 --- a/src/frontends/qt4/FileDialog.cpp +++ b/src/frontends/qt4/FileDialog.cpp @@ -124,7 +124,7 @@ FileDialog::Result const FileDialog::open(docstring const & path, docstring const startsWith = from_utf8( makeAbsPath(to_utf8(suggested), to_utf8(path)).absFilename()); result.second = from_utf8(internal_path(fromqstr( - QFileDialog::getOpenFileName(qApp->focusWidget(), + QFileDialog::getOpenFileName(qApp->focusWidget(), toqstr(title_), toqstr(startsWith), toqstr(filters.as_string()) )))); #else LyXFileDialog dlg(title_, path, filters, private_->b1, private_->b2); diff --git a/src/frontends/qt4/FloatPlacement.cpp b/src/frontends/qt4/FloatPlacement.cpp index fdb1a34d68..145c987071 100644 --- a/src/frontends/qt4/FloatPlacement.cpp +++ b/src/frontends/qt4/FloatPlacement.cpp @@ -238,5 +238,3 @@ void FloatPlacement::checkAllowed() //} // namespace lyx #include "FloatPlacement_moc.cpp" - - diff --git a/src/frontends/qt4/GuiClipboard.cpp b/src/frontends/qt4/GuiClipboard.cpp index dfb4665233..463bad4913 100644 --- a/src/frontends/qt4/GuiClipboard.cpp +++ b/src/frontends/qt4/GuiClipboard.cpp @@ -64,7 +64,7 @@ docstring const GuiClipboard::getAsText() const QString const str = qApp->clipboard()->text(QClipboard::Clipboard) .normalized(QString::NormalizationForm_KC); LYXERR(Debug::ACTION) << "GuiClipboard::getAsText(): `" - << fromqstr(str) << "'" << endl; + << fromqstr(str) << "'" << endl; if (str.isNull()) return docstring(); @@ -75,7 +75,7 @@ docstring const GuiClipboard::getAsText() const void GuiClipboard::put(string const & lyx, docstring const & text) { LYXERR(Debug::ACTION) << "GuiClipboard::put(`" << lyx << "' `" - << to_utf8(text) << "')" << endl; + << to_utf8(text) << "')" << endl; // We don't convert the encoding of lyx since the encoding of the // clipboard contents is specified in the data itself QMimeData * data = new QMimeData; diff --git a/src/frontends/qt4/GuiFontLoader.cpp b/src/frontends/qt4/GuiFontLoader.cpp index 62eb80b2d1..d50c3cc4f3 100644 --- a/src/frontends/qt4/GuiFontLoader.cpp +++ b/src/frontends/qt4/GuiFontLoader.cpp @@ -279,7 +279,7 @@ QLFontInfo::QLFontInfo(Font const & f) if (f.realShape() != Font::SMALLCAPS_SHAPE) { metrics.reset(new GuiFontMetrics(font)); } - else { + else { // handle small caps ourselves ... Font smallfont = f; smallfont.decSize().decSize().setShape(Font::UP_SHAPE); diff --git a/src/frontends/qt4/GuiFontLoader.h b/src/frontends/qt4/GuiFontLoader.h index 39b52fa1ef..8cd017e580 100644 --- a/src/frontends/qt4/GuiFontLoader.h +++ b/src/frontends/qt4/GuiFontLoader.h @@ -40,12 +40,12 @@ public: /// Hold info about a particular font -class GuiFontLoader : public FontLoader +class GuiFontLoader : public FontLoader { public: /// GuiFontLoader(); - + /// Destructor virtual ~GuiFontLoader() {} diff --git a/src/frontends/qt4/GuiImplementation.cpp b/src/frontends/qt4/GuiImplementation.cpp index 699bb8d599..8529b61ced 100644 --- a/src/frontends/qt4/GuiImplementation.cpp +++ b/src/frontends/qt4/GuiImplementation.cpp @@ -32,7 +32,7 @@ using boost::shared_ptr; namespace { template - void updateIds(std::map const & stdmap, std::vector & ids) + void updateIds(std::map const & stdmap, std::vector & ids) { ids.clear(); typename std::map::const_iterator it; @@ -103,7 +103,7 @@ bool GuiImplementation::closeAllViews() // TODO: return false when close event was ignored // e.g. quitWriteAll()->'Cancel' // maybe we need something like 'bool closeView()' - it->second->close(); + it->second->close(); // unregisterd by the CloseEvent } diff --git a/src/frontends/qt4/GuiImplementation.h b/src/frontends/qt4/GuiImplementation.h index 697bbd6d4d..0b30d572ca 100644 --- a/src/frontends/qt4/GuiImplementation.h +++ b/src/frontends/qt4/GuiImplementation.h @@ -53,7 +53,7 @@ private: /// Multiple views container. /** * Warning: This must not be a smart pointer as the destruction of the - * object is handled by Qt when the view is closed + * object is handled by Qt when the view is closed * \sa Qt::WA_DeleteOnClose attribute. */ std::map views_; diff --git a/src/frontends/qt4/GuiSelection.cpp b/src/frontends/qt4/GuiSelection.cpp index 17c60b3d82..1eb4e3c578 100644 --- a/src/frontends/qt4/GuiSelection.cpp +++ b/src/frontends/qt4/GuiSelection.cpp @@ -61,7 +61,7 @@ docstring const GuiSelection::get() const QString const str = qApp->clipboard()->text(QClipboard::Selection) .normalized(QString::NormalizationForm_KC); LYXERR(Debug::ACTION) << "GuiSelection::get: " << fromqstr(str) - << endl; + << endl; if (str.isNull()) return docstring(); @@ -74,7 +74,7 @@ void GuiSelection::put(docstring const & str) LYXERR(Debug::ACTION) << "GuiSelection::put: " << to_utf8(str) << endl; qApp->clipboard()->setText(toqstr(externalLineEnding(str)), - QClipboard::Selection); + QClipboard::Selection); } diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index bb7c89e747..a8fdc1435f 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -96,7 +96,7 @@ public: void clearTabbar() { - for (int i = tabbar->count() - 1; i >= 0; --i) + for (int i = tabbar->count() - 1; i >= 0; --i) tabbar->removeTab(i); } }; @@ -125,7 +125,7 @@ struct GuiView::GuiViewPrivate QMenu* toolBarPopup(GuiView *parent) { - // FIXME: translation + // FIXME: translation QMenu* menu = new QMenu(parent); QActionGroup *iconSizeGroup = new QActionGroup(parent); @@ -291,7 +291,7 @@ void GuiView::saveGeometry() // Then also the moveEvent, resizeEvent, and the // code for floatingGeometry_ can be removed; // adjust GuiView::setGeometry() - + QRect normal_geometry; int maximized; #ifdef Q_WS_WIN @@ -305,20 +305,20 @@ void GuiView::saveGeometry() normal_geometry = updateFloatingGeometry(); QDesktopWidget& dw = *qApp->desktop(); - QRect desk = dw.availableGeometry(dw.primaryScreen()); + QRect desk = dw.availableGeometry(dw.primaryScreen()); // Qt bug on Linux: load completely maximized, vert max. save-> frameGeometry().height() is wrong if (isMaximized() && desk.width() <= frameGeometry().width() && desk.height() <= frameGeometry().height()) { maximized = CompletelyMaximized; // maximizing does not work when the window is allready hor. or vert. maximized // Tested only on KDE - int dh = frameGeometry().height() - height(); - if (desk.height() <= normal_geometry.height() + dh) + int dh = frameGeometry().height() - height(); + if (desk.height() <= normal_geometry.height() + dh) normal_geometry.setHeight(normal_geometry.height() - 1); int dw = frameGeometry().width() - width(); - if (desk.width() <= normal_geometry.width() + dw) + if (desk.width() <= normal_geometry.width() + dw) normal_geometry.setWidth(normal_geometry.width() - 1); } else if (desk.height() <= frameGeometry().height()) { - maximized = VerticallyMaximized; + maximized = VerticallyMaximized; } else if (desk.width() <= frameGeometry().width()) { maximized = HorizontallyMaximized; } else { @@ -339,7 +339,7 @@ void GuiView::saveGeometry() } getToolbars().saveToolbarInfo(); } - + void GuiView::setGeometry(unsigned int width, unsigned int height, @@ -360,7 +360,7 @@ void GuiView::setGeometry(unsigned int width, if (width != 0 && height != 0) { if (posx != -1 && posy != -1) { // if there are startup positioning problems: - // http://doc.trolltech.com/4.2/qdesktopwidget.html + // http://doc.trolltech.com/4.2/qdesktopwidget.html QDesktopWidget& dw = *qApp->desktop(); if (dw.isVirtualDesktop()) { if(!dw.geometry().contains(posx, posy)) { @@ -391,11 +391,11 @@ void GuiView::setGeometry(unsigned int width, } else { #ifndef Q_WS_WIN // TODO How to set by the window manager? - // setWindowState(Qt::WindowVerticallyMaximized); + // setWindowState(Qt::WindowVerticallyMaximized); // is not possible QDesktopWidget& dw = *qApp->desktop(); QRect desk = dw.availableGeometry(dw.primaryScreen()); - if (maximized == VerticallyMaximized) + if (maximized == VerticallyMaximized) resize(width, desk.height()); if (maximized == HorizontallyMaximized) resize(desk.width(), height); @@ -432,7 +432,7 @@ void GuiView::setGeometry(unsigned int width, // we compensate the drift when storing the position d.posx_offset = 0; d.posy_offset = 0; - if (width != 0 && height != 0) + if (width != 0 && height != 0) if (posx != -1 && posy != -1) { #ifdef Q_WS_WIN d.posx_offset = posx - normalGeometry().x(); @@ -546,9 +546,9 @@ void GuiView::updateTab() cur_title = view()->buffer()->fileName(); } - // avoid unnecessary tabbar rebuild: + // avoid unnecessary tabbar rebuild: // check if something has changed - if (d.tabnames == names && d.cur_title == cur_title) + if (d.tabnames == names && d.cur_title == cur_title) return; d.tabnames = names; d.cur_title = cur_title; @@ -564,7 +564,7 @@ void GuiView::updateTab() // rebuild tabbar and function map from scratch if (names.size() > 1) { for(size_t i = 0; i < names.size(); i++) { - tabbar.addTab(toqstr(makeDisplayPath(names[i], 30))); + tabbar.addTab(toqstr(makeDisplayPath(names[i], 30))); // set current tab if (names[i] == cur_title) tabbar.setCurrentIndex(i); diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index 57116664d4..5d10faeda2 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -98,7 +98,7 @@ public Q_SLOTS: /// populate a toplevel menu and all its children on demand void updateMenu(QAction *); - void currentTabChanged (int index); + void currentTabChanged (int index); /// slots to change the icon size void smallSizedIcons(); diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 5c58a6d99f..7ae001d2ec 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -501,7 +501,7 @@ void GuiWorkArea::doGreyOut(QLPainter & pain) void GuiWorkArea::paintEvent(QPaintEvent * ev) { - QRect const rc = ev->rect(); + QRect const rc = ev->rect(); /* LYXERR(Debug::PAINTING) << "paintEvent begin: x: " << rc.x() << " y: " << rc.y() @@ -602,7 +602,7 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e) } } - // Hide the cursor during the kana-kanji transformation. + // Hide the cursor during the kana-kanji transformation. if (preedit_string.empty()) startBlinkingCursor(); else @@ -611,7 +611,7 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e) // last_width : for checking if last preedit string was/wasn't empty. static bool last_width = false; if (!last_width && preedit_string.empty()) { - // if last_width is last length of preedit string. + // if last_width is last length of preedit string. e->accept(); return; } @@ -699,7 +699,7 @@ void GuiWorkArea::inputMethodEvent(QInputMethodEvent * e) // that we are in selecting mode in the input method. // FIXME: rLength == preedit_length is not a changing condition // FIXME: should be put out of the loop. - if (pos >= rStart + if (pos >= rStart && pos < rStart + rLength && !(cursor_pos < rLength && rLength == preedit_length)) ps = Painter::preedit_selecting; diff --git a/src/frontends/qt4/GuiWorkArea.h b/src/frontends/qt4/GuiWorkArea.h index 67283d16d6..5a096d5574 100644 --- a/src/frontends/qt4/GuiWorkArea.h +++ b/src/frontends/qt4/GuiWorkArea.h @@ -165,7 +165,7 @@ private: /// double_click dc_event_; - /// + /// CursorWidget * cursor_; /// void updateScreen(); diff --git a/src/frontends/qt4/IconPalette.cpp b/src/frontends/qt4/IconPalette.cpp index e99084624c..e9452541d6 100644 --- a/src/frontends/qt4/IconPalette.cpp +++ b/src/frontends/qt4/IconPalette.cpp @@ -115,7 +115,7 @@ void IconPalette::hideEvent(QHideEvent * event ) void IconPalette::updateParent() { bool enable = false; - for (int i = 0; i < actions_.size(); ++i) + for (int i = 0; i < actions_.size(); ++i) if (actions_.at(i)->isEnabled()) { enable = true; break; @@ -169,7 +169,7 @@ void ButtonMenu::add(QAction * action) void ButtonMenu::updateParent() { bool enable = false; - for (int i = 0; i < actions_.size(); ++i) + for (int i = 0; i < actions_.size(); ++i) if (actions_.at(i)->isEnabled()) { enable = true; break; diff --git a/src/frontends/qt4/InsertTableWidget.h b/src/frontends/qt4/InsertTableWidget.h index 6c78c69608..f6a2b3cf7f 100644 --- a/src/frontends/qt4/InsertTableWidget.h +++ b/src/frontends/qt4/InsertTableWidget.h @@ -41,7 +41,7 @@ protected Q_SLOTS: void mouseReleaseEvent(QMouseEvent *); void mousePressEvent(QMouseEvent *); void paintEvent(QPaintEvent *); - + private: //! update the geometry void resetGeometry(); @@ -61,7 +61,7 @@ private: //! row of pointer int bottom_; //! column of pointer - int right_; + int right_; //! the lyxview we need to dispatch the funcrequest LyXView & lyxView_; //! widget under mouse diff --git a/src/frontends/qt4/LyXFileDialog.cpp b/src/frontends/qt4/LyXFileDialog.cpp index 920159664f..a77d08f186 100644 --- a/src/frontends/qt4/LyXFileDialog.cpp +++ b/src/frontends/qt4/LyXFileDialog.cpp @@ -85,4 +85,3 @@ void LyXFileDialog::buttonClicked() } // namespace lyx #include "LyXFileDialog_moc.cpp" - diff --git a/src/frontends/qt4/PanelStack.cpp b/src/frontends/qt4/PanelStack.cpp index 13e3100513..419897f3f7 100644 --- a/src/frontends/qt4/PanelStack.cpp +++ b/src/frontends/qt4/PanelStack.cpp @@ -43,9 +43,9 @@ PanelStack::PanelStack(QWidget * parent) list_->setColumnCount(1); // Hide the pointless list header list_->header()->hide(); -// QStringList HeaderLabels; -// HeaderLabels << QString("Category"); -// list_->setHeaderLabels(HeaderLabels); +// QStringList HeaderLabels; +// HeaderLabels << QString("Category"); +// list_->setHeaderLabels(HeaderLabels); connect(list_, SIGNAL(currentItemChanged (QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(switchPanel(QTreeWidgetItem *, QTreeWidgetItem*))); diff --git a/src/frontends/qt4/QBox.cpp b/src/frontends/qt4/QBox.cpp index a617cf35c2..18653245ab 100644 --- a/src/frontends/qt4/QBox.cpp +++ b/src/frontends/qt4/QBox.cpp @@ -161,7 +161,7 @@ void QBox::build_dialog() // add the special units to the height choice // width needs different handling box_gui_tokens_special_length(ids_spec_, gui_names_spec_); - for (unsigned int i = 1; i < gui_names_spec_.size(); ++i) + for (unsigned int i = 1; i < gui_names_spec_.size(); ++i) dialog_->heightUnitsLC->addItem(toqstr(gui_names_spec_[i])); bcview().addReadOnly(dialog_->typeCO); @@ -393,4 +393,3 @@ void QBox::setInnerType(bool frameless, int i) #include "QBox_moc.cpp" - diff --git a/src/frontends/qt4/QBranch.cpp b/src/frontends/qt4/QBranch.cpp index 757a69cdad..6bdf0f8626 100644 --- a/src/frontends/qt4/QBranch.cpp +++ b/src/frontends/qt4/QBranch.cpp @@ -40,7 +40,7 @@ QBranchDialog::QBranchDialog(QBranch * form) form, SLOT(slotOK())); connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose())); - connect(branchCO, SIGNAL( activated(int) ), + connect(branchCO, SIGNAL( activated(int) ), this, SLOT( change_adaptor() ) ); } diff --git a/src/frontends/qt4/QCitation.cpp b/src/frontends/qt4/QCitation.cpp index a5c64faca0..2c0e6219ad 100644 --- a/src/frontends/qt4/QCitation.cpp +++ b/src/frontends/qt4/QCitation.cpp @@ -63,7 +63,7 @@ QCitation::QCitation(Dialog & parent) void QCitation::apply(int const choice, bool const full, bool const force, - QString before, QString after) + QString before, QString after) { if (cited_keys_.isEmpty()) return; @@ -89,7 +89,7 @@ void QCitation::clearSelection() selected_model_.setStringList(cited_keys_); } - + QString QCitation::textBefore() { return toqstr(params()["before"]); @@ -155,7 +155,7 @@ void QCitation::findKey(QString const & str, bool only_keys, Qt::CaseSensitive: Qt::CaseInsensitive; QStringList keys; // If new string (str) contains the last searched one... - if (!last_searched_string.isEmpty() && str.size() > 1 + if (!last_searched_string.isEmpty() && str.size() > 1 && str.contains(last_searched_string, qtcase)) // ... then only search within already found list. keys = available_model_.stringList(); diff --git a/src/frontends/qt4/QCitation.h b/src/frontends/qt4/QCitation.h index a70100628a..66bcdcdd48 100644 --- a/src/frontends/qt4/QCitation.h +++ b/src/frontends/qt4/QCitation.h @@ -78,7 +78,7 @@ public: virtual void apply(int const choice, bool const full, bool const force, QString before, QString after); -private: +private: /// available keys. QStringListModel available_model_; diff --git a/src/frontends/qt4/QCitationDialog.cpp b/src/frontends/qt4/QCitationDialog.cpp index 159d666af1..f3f5f24bc0 100644 --- a/src/frontends/qt4/QCitationDialog.cpp +++ b/src/frontends/qt4/QCitationDialog.cpp @@ -126,7 +126,7 @@ bool QCitationDialog::isVisible() const { return QDialog::isVisible(); } - + void QCitationDialog::on_okPB_clicked() { @@ -159,7 +159,7 @@ void QCitationDialog::on_restorePB_clicked() void QCitationDialog::update() { if (selectedLV->selectionModel()->selectedIndexes().isEmpty()) { - if (availableLV->selectionModel()->selectedIndexes().isEmpty() + if (availableLV->selectionModel()->selectedIndexes().isEmpty() && availableLV->model()->rowCount() > 0) availableLV->setCurrentIndex(availableLV->model()->index(0,0)); updateInfo(availableLV->currentIndex()); @@ -239,7 +239,7 @@ void QCitationDialog::fillStyles() QStringList sty = form_->citationStyles(curr); - bool const basic_engine = + bool const basic_engine = (form_->getEngine() == biblio::ENGINE_BASIC); citationStyleCO->setEnabled(!sty.isEmpty() && !basic_engine); @@ -265,7 +265,7 @@ bool QCitationDialog::isSelected(const QModelIndex & idx) void QCitationDialog::setButtons() { int const arows = availableLV->model()->rowCount(); - addPB->setEnabled(arows > 0 && + addPB->setEnabled(arows > 0 && availableLV->currentIndex().isValid() && !isSelected(availableLV->currentIndex())); @@ -317,7 +317,7 @@ void QCitationDialog::availableChanged(const QModelIndex & idx, const QModelInde { if (!idx.isValid()) return; - + selectedLV->selectionModel()->reset(); update(); } @@ -355,10 +355,10 @@ void QCitationDialog::on_deletePB_clicked() { QModelIndex idx = selectedLV->currentIndex(); int nrows = selectedLV->model()->rowCount(); - + form_->deleteKey(idx); - if (idx.row() == nrows - 1) + if (idx.row() == nrows - 1) idx = idx.sibling(idx.row() - 1, idx.column()); if (nrows>1) diff --git a/src/frontends/qt4/QDelimiterDialog.cpp b/src/frontends/qt4/QDelimiterDialog.cpp index b4be8eee3d..7084862c46 100644 --- a/src/frontends/qt4/QDelimiterDialog.cpp +++ b/src/frontends/qt4/QDelimiterDialog.cpp @@ -114,7 +114,7 @@ QDelimiterDialog::QDelimiterDialog(QMathDelimiter * form, QWidget * parent) leftLW->setViewMode(QListView::IconMode); rightLW->setViewMode(QListView::IconMode); - + typedef std::map ListItems; ListItems list_items; // The last element is the empty one. @@ -164,7 +164,7 @@ void QDelimiterDialog::updateTeXCode(int size) tex_code_ = left_str + ' ' + right_str; else { tex_code_ = bigleft[size] + ' ' - + left_str + ' ' + + left_str + ' ' + bigright[size] + ' ' + right_str; } @@ -199,10 +199,10 @@ void QDelimiterDialog::on_insertPB_clicked() QString command = '"' + tex_code_ + '"'; command.replace(' ', "\" \""); form_->controller().dispatchBigDelim(fromqstr(command)); - } + } } - + void QDelimiterDialog::on_sizeCO_activated(int index) { updateTeXCode(index); diff --git a/src/frontends/qt4/QDocument.cpp b/src/frontends/qt4/QDocument.cpp index 1abbe1b9a8..6265f278db 100644 --- a/src/frontends/qt4/QDocument.cpp +++ b/src/frontends/qt4/QDocument.cpp @@ -79,12 +79,12 @@ char const * const tex_fonts_sans[] = {"default", "cmss", "lmss", "helvet", "ava }; -char const * tex_fonts_sans_gui[] = { N_("Default"), N_("Computer Modern Sans"), N_("Latin Modern Sans"), +char const * tex_fonts_sans_gui[] = { N_("Default"), N_("Computer Modern Sans"), N_("Latin Modern Sans"), N_("Helvetica"), N_("Avant Garde"), N_("Bera Sans"), N_("CM Bright"), "" }; -char const * const tex_fonts_monospaced[] = {"default", "cmtt", "lmtt", "courier", "beramono", +char const * const tex_fonts_monospaced[] = {"default", "cmtt", "lmtt", "courier", "beramono", "luximono", "cmtl", "" }; @@ -117,13 +117,13 @@ void PreambleModule::update(BufferParams const & params, BufferId id) { QString preamble = toqstr(params.preamble); // Nothing to do if the params and preamble are unchanged. - if (id == current_id_ + if (id == current_id_ && preamble == preambleTE->document()->toPlainText()) return; QTextCursor cur = preambleTE->textCursor(); // Save the coords before switching to the new one. - preamble_coords_[current_id_] = + preamble_coords_[current_id_] = make_pair(cur.position(), preambleTE->verticalScrollBar()->value()); // Save the params address for further use. @@ -153,7 +153,7 @@ void PreambleModule::closeEvent(QCloseEvent * e) { // Save the coords before closing. QTextCursor cur = preambleTE->textCursor(); - preamble_coords_[current_id_] = + preamble_coords_[current_id_] = make_pair(cur.position(), preambleTE->verticalScrollBar()->value()); e->accept(); } @@ -741,7 +741,7 @@ void QDocumentDialog::updateFontsize(string const & items, string const & sel) void QDocumentDialog::romanChanged(int item) { string const font = tex_fonts_roman[item]; - + fontModule->fontScCB->setEnabled( form_->controller().providesSC(font)); fontModule->fontOsfCB->setEnabled( @@ -820,7 +820,7 @@ void QDocumentDialog::updateNumbering() QTreeWidgetItem * item = 0; for ( ; cit != end ; ++cit) { int const toclevel = (*cit)->toclevel; - if (toclevel != Layout::NOT_IN_TOC + if (toclevel != Layout::NOT_IN_TOC && (*cit)->labeltype == LABEL_COUNTER) { item = new QTreeWidgetItem(numberingModule->tocTW); item->setText(0, qt_((*cit)->name())); @@ -1261,7 +1261,7 @@ void QDocumentDialog::updateParams(BufferParams const & params) textLayoutModule->twoColumnCB->setChecked( params.columns == 2); - + // break listings_params to multiple lines string lstparams = InsetListingsParams(params.listings_params).separatedParams(); diff --git a/src/frontends/qt4/QErrorList.cpp b/src/frontends/qt4/QErrorList.cpp index c4f73fbc18..4d0816aa53 100644 --- a/src/frontends/qt4/QErrorList.cpp +++ b/src/frontends/qt4/QErrorList.cpp @@ -38,7 +38,7 @@ QErrorListDialog::QErrorListDialog(QErrorList * form) form, SLOT(slotClose())); connect(errorsLW, SIGNAL( itemActivated(QListWidgetItem *)), form, SLOT(slotClose())); - connect( errorsLW, SIGNAL( itemClicked(QListWidgetItem *)), + connect( errorsLW, SIGNAL( itemClicked(QListWidgetItem *)), this, SLOT(select_adaptor(QListWidgetItem *))); } diff --git a/src/frontends/qt4/QExternal.cpp b/src/frontends/qt4/QExternal.cpp index 231683af63..83f009368f 100644 --- a/src/frontends/qt4/QExternal.cpp +++ b/src/frontends/qt4/QExternal.cpp @@ -182,7 +182,7 @@ void QExternalDialog::bbChanged() void QExternalDialog::browseClicked() { int const choice = externalCO->currentIndex(); - docstring const template_name = + docstring const template_name = from_utf8(form_->controller().getTemplate(choice).lyxName); docstring const str = form_->controller().browse(qstring_to_ucs4(fileED->text()), diff --git a/src/frontends/qt4/QGraphics.cpp b/src/frontends/qt4/QGraphics.cpp index 1ef6052ebb..dcd340dc77 100644 --- a/src/frontends/qt4/QGraphics.cpp +++ b/src/frontends/qt4/QGraphics.cpp @@ -227,7 +227,7 @@ void QGraphics::update_contents() dialog_->displayGB->setChecked(igp.display != graphics::NoDisplay); // the output section (width/height) - + dialog_->Scale->setText(toqstr(igp.scale)); //igp.scale defaults to 100, so we treat it as empty bool const scaleChecked = !igp.scale.empty() && igp.scale != "100"; @@ -235,32 +235,32 @@ void QGraphics::update_contents() dialog_->scaleCB->setChecked(scaleChecked); dialog_->scaleCB->blockSignals(false); dialog_->Scale->setEnabled(scaleChecked); - - lengthAutoToWidgets(dialog_->Width, dialog_->widthUnit, igp.width, + + lengthAutoToWidgets(dialog_->Width, dialog_->widthUnit, igp.width, unitDefault); - bool const widthChecked = !dialog_->Width->text().isEmpty() && + bool const widthChecked = !dialog_->Width->text().isEmpty() && dialog_->Width->text() != "auto"; dialog_->WidthCB->blockSignals(true); dialog_->WidthCB->setChecked(widthChecked); dialog_->WidthCB->blockSignals(false); dialog_->Width->setEnabled(widthChecked); dialog_->widthUnit->setEnabled(widthChecked); - - lengthAutoToWidgets(dialog_->Height, dialog_->heightUnit, igp.height, + + lengthAutoToWidgets(dialog_->Height, dialog_->heightUnit, igp.height, unitDefault); - bool const heightChecked = !dialog_->Height->text().isEmpty() + bool const heightChecked = !dialog_->Height->text().isEmpty() && dialog_->Height->text() != "auto"; dialog_->HeightCB->blockSignals(true); dialog_->HeightCB->setChecked(heightChecked); dialog_->HeightCB->blockSignals(false); dialog_->Height->setEnabled(heightChecked); dialog_->heightUnit->setEnabled(heightChecked); - + dialog_->scaleCB->setEnabled(!widthChecked && !heightChecked); dialog_->WidthCB->setEnabled(!scaleChecked); dialog_->HeightCB->setEnabled(!scaleChecked); dialog_->aspectratio->setEnabled(widthChecked && heightChecked); - + dialog_->setAutoText(); dialog_->angle->setText(toqstr(igp.rotateAngle)); @@ -343,7 +343,7 @@ void QGraphics::apply() if (!dialog_->displayGB->isChecked()) igp.display = graphics::NoDisplay; - + //the graphics section if (dialog_->scaleCB->isChecked() && !dialog_->Scale->text().isEmpty()) { igp.scale = fromqstr(dialog_->Scale->text()); @@ -352,12 +352,12 @@ void QGraphics::apply() igp.keepAspectRatio = false; } else { igp.scale = string(); - igp.width = dialog_->WidthCB->isChecked() ? + igp.width = dialog_->WidthCB->isChecked() ? //Note that this works even if dialog_->Width is "auto", since in //that case we get "0pt". - Length(widgetsToLength(dialog_->Width, dialog_->widthUnit)): + Length(widgetsToLength(dialog_->Width, dialog_->widthUnit)): Length("0pt"); - igp.height = dialog_->HeightCB->isChecked() ? + igp.height = dialog_->HeightCB->isChecked() ? Length(widgetsToLength(dialog_->Height, dialog_->heightUnit)) : Length("0pt"); igp.keepAspectRatio = dialog_->aspectratio->isEnabled() && diff --git a/src/frontends/qt4/QGraphicsDialog.cpp b/src/frontends/qt4/QGraphicsDialog.cpp index d22da47f55..b0beb48359 100644 --- a/src/frontends/qt4/QGraphicsDialog.cpp +++ b/src/frontends/qt4/QGraphicsDialog.cpp @@ -51,7 +51,7 @@ QGraphicsDialog::QGraphicsDialog(QGraphics * form) form, SLOT(slotClose())); connect(restorePB, SIGNAL(clicked()), form, SLOT(slotRestore())); - + //graphics pane connect(filename, SIGNAL(textChanged(const QString &)), this, SLOT(change_adaptor())); @@ -77,10 +77,10 @@ QGraphicsDialog::QGraphicsDialog(QGraphics * form) this, SLOT(change_adaptor())); connect(Scale, SIGNAL(textChanged(const QString &)), this, SLOT(change_adaptor())); - + filename->setValidator(new PathValidator(true, filename)); setFocusProxy(filename); - + QDoubleValidator * scaleValidator = new DoubleAutoValidator(Scale); scaleValidator->setBottom(0); scaleValidator->setDecimals(256); //I guess that will do @@ -110,7 +110,7 @@ QGraphicsDialog::QGraphicsDialog(QGraphics * form) this, SLOT(change_bb())); connect(getPB, SIGNAL(clicked()), this, SLOT(change_adaptor())); - + lbX->setValidator(new QDoubleValidator(lbX)); lbY->setValidator(new QDoubleValidator(lbY)); rtX->setValidator(new QDoubleValidator(rtX)); @@ -203,7 +203,7 @@ void QGraphicsDialog::on_filename_textChanged(const QString & filename) void QGraphicsDialog::setAutoText() { if (scaleCB->isChecked()) return; - if (!Scale->isEnabled() && Scale->text() != "100") + if (!Scale->isEnabled() && Scale->text() != "100") Scale->setText(QString("auto")); setAutoTextCB(WidthCB, Width, widthUnit); @@ -218,24 +218,24 @@ void QGraphicsDialog::on_scaleCB_toggled(bool setScale) Scale->setText("100"); Scale->setFocus(Qt::OtherFocusReason); } - + WidthCB->setDisabled(setScale); WidthCB->blockSignals(true); WidthCB->setChecked(false); WidthCB->blockSignals(false); Width->setEnabled(false); widthUnit->setEnabled(false); - + HeightCB->setDisabled(setScale); HeightCB->blockSignals(true); HeightCB->setChecked(false); HeightCB->blockSignals(false); Height->setEnabled(false); heightUnit->setEnabled(false); - + aspectratio->setDisabled(true); aspectratio->setChecked(true); - + setAutoText(); } @@ -245,18 +245,18 @@ void QGraphicsDialog::on_WidthCB_toggled(bool setWidth) widthUnit->setEnabled(setWidth); if (setWidth) Width->setFocus(Qt::OtherFocusReason); - + bool const setHeight = HeightCB->isChecked(); aspectratio->setEnabled(setWidth && setHeight); aspectratio->blockSignals(true); aspectratio->setChecked(!(setWidth && setHeight)); aspectratio->blockSignals(false); - + scaleCB->setEnabled(!setWidth && !setHeight); //already will be unchecked, so don't need to do that - Scale->setEnabled((!setWidth && !setHeight) //=scaleCB->isEnabled() + Scale->setEnabled((!setWidth && !setHeight) //=scaleCB->isEnabled() && scaleCB->isChecked()); //should be false, but let's check - + setAutoText(); } @@ -266,18 +266,18 @@ void QGraphicsDialog::on_HeightCB_toggled(bool setHeight) heightUnit->setEnabled(setHeight); if (setHeight) Height->setFocus(Qt::OtherFocusReason); - + bool const setWidth = WidthCB->isChecked(); aspectratio->setEnabled(setWidth && setHeight); aspectratio->blockSignals(true); aspectratio->setChecked(!(setWidth && setHeight)); aspectratio->blockSignals(false); - + scaleCB->setEnabled(!setWidth && !setHeight); //already unchecked - Scale->setEnabled((!setWidth && !setHeight) //=scaleCB->isEnabled() + Scale->setEnabled((!setWidth && !setHeight) //=scaleCB->isEnabled() && scaleCB->isChecked()); //should be false - + setAutoText(); } diff --git a/src/frontends/qt4/QInclude.cpp b/src/frontends/qt4/QInclude.cpp index 023e1f4345..64dbb48091 100644 --- a/src/frontends/qt4/QInclude.cpp +++ b/src/frontends/qt4/QInclude.cpp @@ -262,7 +262,7 @@ void QInclude::update_contents() // the rest is put to the extra edit box. string extra = getStringFromVector(pars); dialog_->listingsED->setPlainText(toqstr(InsetListingsParams(extra).separatedParams())); - } + } } diff --git a/src/frontends/qt4/QIndex.cpp b/src/frontends/qt4/QIndex.cpp index 3eb8d1b214..4fdaaa38f4 100644 --- a/src/frontends/qt4/QIndex.cpp +++ b/src/frontends/qt4/QIndex.cpp @@ -43,7 +43,7 @@ QIndexDialog::QIndexDialog(QIndex * form) connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK())); connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose())); - connect( keywordED, SIGNAL(textChanged(const QString &)), + connect( keywordED, SIGNAL(textChanged(const QString &)), this, SLOT(change_adaptor())); setFocusProxy(keywordED); diff --git a/src/frontends/qt4/QKeySymbol.cpp b/src/frontends/qt4/QKeySymbol.cpp index 366b48e811..c44e8e2f45 100644 --- a/src/frontends/qt4/QKeySymbol.cpp +++ b/src/frontends/qt4/QKeySymbol.cpp @@ -149,7 +149,7 @@ char_type QKeySymbol::getUCSEncoded() const << text_[i].unicode() << endl; } } - + // Only one UCS4 character at the end. docstring ucs4_text = qstring_to_ucs4(text_); return ucs4_text[0]; @@ -166,10 +166,10 @@ docstring const QKeySymbol::print(key_modifier::state mod, bool forgui) const tmpkey += Qt::CTRL; if (mod & key_modifier::alt) tmpkey += Qt::ALT; - + QKeySequence seq(tmpkey); - return qstring_to_ucs4(seq.toString(forgui ? QKeySequence::NativeText + return qstring_to_ucs4(seq.toString(forgui ? QKeySequence::NativeText : QKeySequence::PortableText)); } diff --git a/src/frontends/qt4/QLImage.cpp b/src/frontends/qt4/QLImage.cpp index e0027f3817..f21564e212 100644 --- a/src/frontends/qt4/QLImage.cpp +++ b/src/frontends/qt4/QLImage.cpp @@ -184,7 +184,7 @@ QImage & toGray(QImage & img) int const pixels = img.depth() > 8 ? img.width() * img.height() : img.numColors(); - unsigned int *data = img.depth() > 8 ? + unsigned int *data = img.depth() > 8 ? reinterpret_cast(img.bits()) : reinterpret_cast(&img.colorTable()[0]); diff --git a/src/frontends/qt4/QLMenubar.cpp b/src/frontends/qt4/QLMenubar.cpp index 9c8b5ab0c4..177679f73c 100644 --- a/src/frontends/qt4/QLMenubar.cpp +++ b/src/frontends/qt4/QLMenubar.cpp @@ -186,27 +186,27 @@ void QLMenubar::macxMenuBarInit() kb_action action; char const * arg; char const * label; - QAction::MenuRole role; + QAction::MenuRole role; }; MacMenuEntry entries[] = { - {LFUN_DIALOG_SHOW, "aboutlyx", "About LyX", + {LFUN_DIALOG_SHOW, "aboutlyx", "About LyX", QAction::AboutRole}, - {LFUN_DIALOG_SHOW, "prefs", "Preferences", + {LFUN_DIALOG_SHOW, "prefs", "Preferences", QAction::PreferencesRole}, - {LFUN_RECONFIGURE, "", "Reconfigure", + {LFUN_RECONFIGURE, "", "Reconfigure", QAction::ApplicationSpecificRole}, {LFUN_LYX_QUIT, "", "Quit LyX", QAction::QuitRole} }; const size_t num_entries = sizeof(entries) / sizeof(MacMenuEntry); - // the special menu for MenuBackend. + // the special menu for MenuBackend. Menu special; for (size_t i = 0 ; i < num_entries ; ++i) { - FuncRequest const func(entries[i].action, + FuncRequest const func(entries[i].action, from_utf8(entries[i].arg)); - special.add(MenuItem(MenuItem::Command, - from_utf8(entries[i].label), + special.add(MenuItem(MenuItem::Command, + from_utf8(entries[i].label), func)); } menubackend_.specialMenu(special); @@ -221,7 +221,7 @@ void QLMenubar::macxMenuBarInit() Menu::const_iterator cit = menubackend_.specialMenu().begin(); Menu::const_iterator end = menubackend_.specialMenu().end(); for (size_t i = 0 ; cit != end ; ++cit, ++i) { - Action * action = new Action(*owner_, cit->label(), + Action * action = new Action(*owner_, cit->label(), cit->func()); action->setMenuRole(entries[i].role); qMenu->addAction(action); diff --git a/src/frontends/qt4/QLPainter.cpp b/src/frontends/qt4/QLPainter.cpp index e06eeb4e10..4ed39cbdae 100644 --- a/src/frontends/qt4/QLPainter.cpp +++ b/src/frontends/qt4/QLPainter.cpp @@ -113,20 +113,20 @@ void QLPainter::lines(int const * xp, int const * yp, int np, { if (!isDrawingEnabled()) return; - + // double the size if needed static QVector points(32); if (np > points.size()) points.resize(2 * np); - + bool antialias = false; for (int i = 0; i < np; ++i) { points[i].setX(xp[i]); points[i].setY(yp[i]); - if (i != 0) + if (i != 0) antialias |= xp[i-1] != xp[i] && yp[i-1] != yp[i]; } - setQPainterPen(col, ls, lw); + setQPainterPen(col, ls, lw); bool const text_is_antialiased = renderHints() & TextAntialiasing; setRenderHint(Antialiasing, antialias && text_is_antialiased); drawPolyline(points.data(), np); @@ -286,4 +286,3 @@ int QLPainter::text(int x, int y, docstring const & s, } // namespace frontend } // namespace lyx - diff --git a/src/frontends/qt4/QLPopupMenu.cpp b/src/frontends/qt4/QLPopupMenu.cpp index f58364209d..37d9170248 100644 --- a/src/frontends/qt4/QLPopupMenu.cpp +++ b/src/frontends/qt4/QLPopupMenu.cpp @@ -66,7 +66,7 @@ void QLPopupMenu::update() owner_->backend().expand(fromLyxMenu, topLevelMenu_, owner_->view()->buffer()); if (!owner_->backend().hasMenu(topLevelMenu_.name())) { - LYXERR(Debug::GUI) << "\tWARNING: menu seems empty" + LYXERR(Debug::GUI) << "\tWARNING: menu seems empty" << to_utf8(topLevelMenu_.name()) << endl; } populate(this, &topLevelMenu_); diff --git a/src/frontends/qt4/QLToolbar.cpp b/src/frontends/qt4/QLToolbar.cpp index 31f89bd5b4..b7a5cdfd83 100644 --- a/src/frontends/qt4/QLToolbar.cpp +++ b/src/frontends/qt4/QLToolbar.cpp @@ -219,7 +219,7 @@ void QLToolbar::add(ToolbarItem const & item) ToolbarInfo const & tbinfo = toolbarbackend.getToolbar(item.name_); ToolbarInfo::item_iterator it = tbinfo.items.begin(); ToolbarInfo::item_iterator const end = tbinfo.items.end(); - for (; it != end; ++it) + for (; it != end; ++it) if (!getStatus(it->func_).unknown()) { Action * action = new Action(owner_, getIcon(it->func_), @@ -313,7 +313,7 @@ void QLToolbar::saveInfo(ToolbarSection::ToolbarInfo & tbinfo) else tbinfo.state = ToolbarSection::ToolbarInfo::OFF; } - // + // // no need to save it here. Qt::ToolBarArea loc = owner_.toolBarArea(this); @@ -327,8 +327,8 @@ void QLToolbar::saveInfo(ToolbarSection::ToolbarInfo & tbinfo) tbinfo.location = ToolbarSection::ToolbarInfo::LEFT; else tbinfo.location = ToolbarSection::ToolbarInfo::NOTSET; - - // save toolbar position. They are not used to restore toolbar position + + // save toolbar position. They are not used to restore toolbar position // now because move(x,y) does not work for toolbar. tbinfo.posx = pos().x(); tbinfo.posy = pos().y(); diff --git a/src/frontends/qt4/QListings.cpp b/src/frontends/qt4/QListings.cpp index 84e6d0efe3..3b36096264 100644 --- a/src/frontends/qt4/QListings.cpp +++ b/src/frontends/qt4/QListings.cpp @@ -167,11 +167,11 @@ QListingsDialog::QListingsDialog(QListings * form) : form_(form) { setupUi(this); - + connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK())); connect(applyPB, SIGNAL(clicked()), form_, SLOT(slotApply())); connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose())); - + connect(languageCO, SIGNAL(currentIndexChanged(int)), this, SLOT(change_adaptor())); connect(dialectCO, SIGNAL(currentIndexChanged(int)), this, SLOT(change_adaptor())); connect(inlineCB, SIGNAL(clicked()), this, SLOT(change_adaptor())); @@ -188,7 +188,7 @@ QListingsDialog::QListingsDialog(QListings * form) connect(spaceCB, SIGNAL(clicked()), this, SLOT(change_adaptor())); connect(spaceInStringCB, SIGNAL(clicked()), this, SLOT(change_adaptor())); connect(extendedcharsCB, SIGNAL(clicked()), this, SLOT(change_adaptor())); - + connect(listingsED, SIGNAL(textChanged()), this, SLOT(change_adaptor())); connect(listingsED, SIGNAL(textChanged()), this, SLOT(validate_listings_params())); @@ -240,7 +240,7 @@ string QListingsDialog::construct_params() } } } - + bool float_ = floatCB->isChecked(); string placement; if (placementLE->isEnabled()) @@ -265,7 +265,7 @@ string QListingsDialog::construct_params() string numberfontsize = font_sizes[numberFontSizeCO->currentIndex()]; string firstline = fromqstr(firstlineLE->text()); string lastline = fromqstr(lastlineLE->text()); - + string fontsize = font_sizes[fontsizeCO->currentIndex()]; string fontstyle = font_styles[fontstyleCO->currentIndex()]; string basicstyle; @@ -402,7 +402,7 @@ QListings::QListings(Dialog & parent) void QListings::build_dialog() { dialog_.reset(new QListingsDialog(this)); - + bcview().setOK(dialog_->okPB); bcview().setApply(dialog_->applyPB); bcview().setCancel(dialog_->closePB); @@ -437,7 +437,7 @@ string plainParam(std::string const & par) void QListings::update_contents() { - // set default values + // set default values dialog_->listingsTB->setPlainText( qt_("Input listings parameters on the right. Enter ? for a list of parameters.")); dialog_->languageCO->setCurrentIndex(findToken(languages, "no language")); diff --git a/src/frontends/qt4/QListings.h b/src/frontends/qt4/QListings.h index 1ab1880df8..134df30636 100644 --- a/src/frontends/qt4/QListings.h +++ b/src/frontends/qt4/QListings.h @@ -31,7 +31,7 @@ public: std::string construct_params(); protected Q_SLOTS: virtual void change_adaptor(); - /// AFAIK, QValidator only works for QLineEdit so + /// AFAIK, QValidator only works for QLineEdit so /// I have to validate listingsED (QTextEdit) manually. void validate_listings_params(); /// turn off inline when float is clicked diff --git a/src/frontends/qt4/QLog.cpp b/src/frontends/qt4/QLog.cpp index 4ca0adc1f8..64f9030d9a 100644 --- a/src/frontends/qt4/QLog.cpp +++ b/src/frontends/qt4/QLog.cpp @@ -39,7 +39,7 @@ QLogDialog::QLogDialog(QLog * form) connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose())); - connect( updatePB, SIGNAL( clicked() ), + connect( updatePB, SIGNAL( clicked() ), this, SLOT( updateClicked() ) ); } @@ -90,7 +90,7 @@ void LogHighlighter::highlightBlock(QString const & text) setFormat(index, length, warningFormat); index = text.indexOf(exprWarning, index + length); } - // ! error + // ! error QRegExp exprError("^!.*$"); index = text.indexOf(exprError); while (index >= 0) { diff --git a/src/frontends/qt4/QNomencl.cpp b/src/frontends/qt4/QNomencl.cpp index 6b4dd85cf3..d4e5c8fb0e 100644 --- a/src/frontends/qt4/QNomencl.cpp +++ b/src/frontends/qt4/QNomencl.cpp @@ -44,9 +44,9 @@ QNomenclDialog::QNomenclDialog(QNomencl * form) connect(okPB, SIGNAL(clicked()), form, SLOT(slotOK())); connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose())); connect(symbolED, SIGNAL(textChanged(const QString&)), - this, SLOT(change_adaptor())); + this, SLOT(change_adaptor())); connect(descriptionTE, SIGNAL(textChanged()), - this, SLOT(change_adaptor())); + this, SLOT(change_adaptor())); setFocusProxy(descriptionTE); } diff --git a/src/frontends/qt4/QParagraph.cpp b/src/frontends/qt4/QParagraph.cpp index 0145b87b41..be42310a51 100644 --- a/src/frontends/qt4/QParagraph.cpp +++ b/src/frontends/qt4/QParagraph.cpp @@ -56,12 +56,12 @@ QParagraphDialog::QParagraphDialog(QParagraph * form) connect(alignRightRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); connect(alignCenterRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); connect(linespacing, SIGNAL(activated(int)), this, SLOT(change_adaptor())); - connect(linespacing, SIGNAL(activated(int)), + connect(linespacing, SIGNAL(activated(int)), this, SLOT(enableLinespacingValue(int))); - connect(linespacingValue, SIGNAL(textChanged(const QString &)), + connect(linespacingValue, SIGNAL(textChanged(const QString &)), this, SLOT(change_adaptor())); connect(indentCB, SIGNAL(clicked()), this, SLOT(change_adaptor())); - connect(labelWidth, SIGNAL(textChanged(const QString &)), + connect(labelWidth, SIGNAL(textChanged(const QString &)), this, SLOT(change_adaptor())); linespacingValue->setValidator(new QDoubleValidator(linespacingValue)); @@ -138,14 +138,14 @@ void QParagraphDialog::alignmentToRadioButtons(LyXAlignment align) } } - lyxerr << BOOST_CURRENT_FUNCTION << "Unknown alignment " + lyxerr << BOOST_CURRENT_FUNCTION << "Unknown alignment " << align << std::endl; } LyXAlignment QParagraphDialog::getAlignmentFromDialog() { - if (alignDefaultCB->isChecked()) + if (alignDefaultCB->isChecked()) return LYX_ALIGN_LAYOUT; LyXAlignment alignment = LYX_ALIGN_NONE; QPRadioMap::const_iterator it = radioMap.begin(); @@ -245,7 +245,7 @@ void QParagraph::update_contents() // alignment LyXAlignment newAlignment = params.align(); LyXAlignment defaultAlignment = controller().alignDefault(); - bool alignmentIsDefault = + bool alignmentIsDefault = newAlignment == LYX_ALIGN_LAYOUT || newAlignment == defaultAlignment; dialog_->alignDefaultCB->blockSignals(true); dialog_->alignDefaultCB->setChecked(alignmentIsDefault); diff --git a/src/frontends/qt4/QParagraph.h b/src/frontends/qt4/QParagraph.h index 1ccb8aea01..b6f771cbf5 100644 --- a/src/frontends/qt4/QParagraph.h +++ b/src/frontends/qt4/QParagraph.h @@ -25,7 +25,7 @@ namespace lyx { namespace frontend { - + class QParagraph; class QParagraphDialog : public QDialog, public Ui::QParagraphUi { diff --git a/src/frontends/qt4/QPrefs.cpp b/src/frontends/qt4/QPrefs.cpp index 3b02c9065d..3840f7e249 100644 --- a/src/frontends/qt4/QPrefs.cpp +++ b/src/frontends/qt4/QPrefs.cpp @@ -1537,7 +1537,7 @@ void PrefFileformats::new_format() flags |= Format::vector; form_->formats().add(name, extension, prettyname, shortcut, viewer, - editor, flags); + editor, flags); form_->formats().sort(); form_->converters().update(form_->formats()); diff --git a/src/frontends/qt4/QRef.cpp b/src/frontends/qt4/QRef.cpp index 109085010f..fa57699794 100644 --- a/src/frontends/qt4/QRef.cpp +++ b/src/frontends/qt4/QRef.cpp @@ -53,25 +53,25 @@ QRefDialog::QRefDialog(QRef * form) connect(closePB, SIGNAL(clicked()), this, SLOT(reset_dialog())); connect(this, SIGNAL(rejected()), this, SLOT(reset_dialog())); - connect(typeCO, SIGNAL(activated(int)), + connect(typeCO, SIGNAL(activated(int)), this, SLOT(changed_adaptor())); - connect(referenceED, SIGNAL(textChanged(const QString &)), + connect(referenceED, SIGNAL(textChanged(const QString &)), this, SLOT(changed_adaptor())); - connect(nameED, SIGNAL(textChanged(const QString &)), + connect(nameED, SIGNAL(textChanged(const QString &)), this, SLOT(changed_adaptor())); - connect(refsLW, SIGNAL(itemClicked(QListWidgetItem *)), + connect(refsLW, SIGNAL(itemClicked(QListWidgetItem *)), this, SLOT(refHighlighted(QListWidgetItem *))); connect(refsLW, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged())); - connect(refsLW, SIGNAL(itemActivated(QListWidgetItem *)), + connect(refsLW, SIGNAL(itemActivated(QListWidgetItem *)), this, SLOT(refSelected(QListWidgetItem *))); connect(sortCB, SIGNAL(clicked(bool)), this, SLOT(sortToggled(bool))); - connect(gotoPB, SIGNAL(clicked()), + connect(gotoPB, SIGNAL(clicked()), this, SLOT(gotoClicked())); - connect(updatePB, SIGNAL(clicked()), + connect(updatePB, SIGNAL(clicked()), this, SLOT(updateClicked())); - connect(bufferCO, SIGNAL(activated(int)), + connect(bufferCO, SIGNAL(activated(int)), this, SLOT(updateClicked())); setFocusProxy(refsLW); @@ -98,7 +98,7 @@ void QRefDialog::selectionChanged() { if (form_->readOnly()) return; - + QList selections = refsLW->selectedItems(); if (selections.isEmpty()) return; @@ -254,7 +254,7 @@ void QRef::update_contents() void QRef::apply() { InsetCommandParams & params = controller().params(); - + last_reference_ = dialog_->referenceED->text(); params.setCmdName(InsetRef::getName(dialog_->typeCO->currentIndex())); @@ -320,7 +320,7 @@ void QRef::redoRefs() dialog_->refsLW->blockSignals(true); dialog_->referenceED->blockSignals(true); dialog_->refsLW->setUpdatesEnabled(false); - + dialog_->refsLW->clear(); // need this because Qt will send a highlight() here for diff --git a/src/frontends/qt4/QRef.h b/src/frontends/qt4/QRef.h index c175655afd..9e3e06aae6 100644 --- a/src/frontends/qt4/QRef.h +++ b/src/frontends/qt4/QRef.h @@ -101,7 +101,7 @@ private: /// went to a reference ? bool at_ref_; - + /// the last reference entered or examined QString last_reference_; diff --git a/src/frontends/qt4/QSearch.cpp b/src/frontends/qt4/QSearch.cpp index 6bd22eefb1..e06b0b325e 100644 --- a/src/frontends/qt4/QSearch.cpp +++ b/src/frontends/qt4/QSearch.cpp @@ -173,4 +173,3 @@ void QSearch::replace(docstring const & findstr, docstring const & replacestr, #include "QSearch_moc.cpp" - diff --git a/src/frontends/qt4/QSendto.cpp b/src/frontends/qt4/QSendto.cpp index 290ebe965f..2a673d292c 100644 --- a/src/frontends/qt4/QSendto.cpp +++ b/src/frontends/qt4/QSendto.cpp @@ -47,13 +47,13 @@ QSendtoDialog::QSendtoDialog(QSendto * form) connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose())); - connect( formatLW, SIGNAL( itemClicked(QListWidgetItem *) ), + connect( formatLW, SIGNAL( itemClicked(QListWidgetItem *) ), this, SLOT( slotFormatHighlighted(QListWidgetItem *) ) ); - connect( formatLW, SIGNAL( itemActivated(QListWidgetItem *) ), + connect( formatLW, SIGNAL( itemActivated(QListWidgetItem *) ), this, SLOT( slotFormatSelected(QListWidgetItem *) ) ); - connect( formatLW, SIGNAL( itemClicked(QListWidgetItem *) ), + connect( formatLW, SIGNAL( itemClicked(QListWidgetItem *) ), this, SLOT( changed_adaptor() ) ); - connect( commandCO, SIGNAL( textChanged(const QString&) ), + connect( commandCO, SIGNAL( textChanged(const QString&) ), this, SLOT( changed_adaptor() ) ); } diff --git a/src/frontends/qt4/QSetBorder.cpp b/src/frontends/qt4/QSetBorder.cpp index 4a96ed614f..c2e53a7a52 100644 --- a/src/frontends/qt4/QSetBorder.cpp +++ b/src/frontends/qt4/QSetBorder.cpp @@ -75,13 +75,13 @@ void QSetBorder::mousePressEvent(QMouseEvent * e) if (e->y() < height() - e->x()) { if (left_.enabled) { setLeft(!left_.set); - // emit signal + // emit signal leftSet(left_.set); } } else { if (bottom_.enabled) { setBottom(!bottom_.set); - // emit signal + // emit signal bottomSet(bottom_.set); } } @@ -89,19 +89,19 @@ void QSetBorder::mousePressEvent(QMouseEvent * e) if (e->y() < height() - e->x()) { if (top_.enabled) { setTop(!top_.set); - // emit signal + // emit signal topSet(top_.set); } } else { if (right_.enabled) { setRight(!right_.set); - // emit signal + // emit signal rightSet(right_.set); } } } update(); - // emit signal + // emit signal clicked(); } diff --git a/src/frontends/qt4/QShowFile.cpp b/src/frontends/qt4/QShowFile.cpp index 5e97418a7f..3687ff887a 100644 --- a/src/frontends/qt4/QShowFile.cpp +++ b/src/frontends/qt4/QShowFile.cpp @@ -45,7 +45,7 @@ void QShowFileDialog::closeEvent(QCloseEvent * e) ///////////////////////////////////////////////////////////////////// // -// QShowFile +// QShowFile // ///////////////////////////////////////////////////////////////////// diff --git a/src/frontends/qt4/QTabular.cpp b/src/frontends/qt4/QTabular.cpp index cc501c0a22..f5d9f69521 100644 --- a/src/frontends/qt4/QTabular.cpp +++ b/src/frontends/qt4/QTabular.cpp @@ -55,19 +55,19 @@ QTabularDialog::QTabularDialog(QTabular * form) interlinespaceED->setValidator(new LengthValidator(interlinespaceED)); connect(topspaceED, SIGNAL(returnPressed()), - this, SLOT(topspace_changed())); + this, SLOT(topspace_changed())); connect(topspaceUnit, SIGNAL(selectionChanged(lyx::Length::UNIT)), - this, SLOT(topspace_changed())); + this, SLOT(topspace_changed())); connect(topspaceCO, SIGNAL(activated(int)), this, SLOT(topspace_changed())); connect(bottomspaceED, SIGNAL(returnPressed()), - this, SLOT(bottomspace_changed())); + this, SLOT(bottomspace_changed())); connect(bottomspaceUnit, SIGNAL(selectionChanged(lyx::Length::UNIT)), - this, SLOT(bottomspace_changed())); + this, SLOT(bottomspace_changed())); connect(bottomspaceCO, SIGNAL(activated(int)), this, SLOT(bottomspace_changed())); connect(interlinespaceED, SIGNAL(returnPressed()), - this, SLOT(interlinespace_changed())); + this, SLOT(interlinespace_changed())); connect(interlinespaceUnit, SIGNAL(selectionChanged(lyx::Length::UNIT)), - this, SLOT(interlinespace_changed())); + this, SLOT(interlinespace_changed())); connect(interlinespaceCO, SIGNAL(activated(int)), this, SLOT(interlinespace_changed())); connect(booktabsRB, SIGNAL(clicked(bool)), this, SLOT(booktabsChanged(bool))); connect(borderDefaultRB, SIGNAL(clicked(bool)), this, SLOT(booktabsChanged(bool))); @@ -681,14 +681,14 @@ void QTabular::update_contents() dialog_->topspaceCO->setCurrentIndex(1); } else { dialog_->topspaceCO->setCurrentIndex(2); - lengthToWidgets(dialog_->topspaceED, + lengthToWidgets(dialog_->topspaceED, dialog_->topspaceUnit, tabular.row_info[row].top_space.asString(), default_unit); } - dialog_->topspaceED->setEnabled(!isReadonly + dialog_->topspaceED->setEnabled(!isReadonly && (dialog_->topspaceCO->currentIndex() == 2)); - dialog_->topspaceUnit->setEnabled(!isReadonly + dialog_->topspaceUnit->setEnabled(!isReadonly && (dialog_->topspaceCO->currentIndex() == 2)); dialog_->topspaceCO->setEnabled(!isReadonly); @@ -699,14 +699,14 @@ void QTabular::update_contents() dialog_->bottomspaceCO->setCurrentIndex(1); } else { dialog_->bottomspaceCO->setCurrentIndex(2); - lengthToWidgets(dialog_->bottomspaceED, + lengthToWidgets(dialog_->bottomspaceED, dialog_->bottomspaceUnit, tabular.row_info[row].bottom_space.asString(), default_unit); } - dialog_->bottomspaceED->setEnabled(!isReadonly + dialog_->bottomspaceED->setEnabled(!isReadonly && (dialog_->bottomspaceCO->currentIndex() == 2)); - dialog_->bottomspaceUnit->setEnabled(!isReadonly + dialog_->bottomspaceUnit->setEnabled(!isReadonly && (dialog_->bottomspaceCO->currentIndex() == 2)); dialog_->bottomspaceCO->setEnabled(!isReadonly); @@ -717,14 +717,14 @@ void QTabular::update_contents() dialog_->interlinespaceCO->setCurrentIndex(1); } else { dialog_->interlinespaceCO->setCurrentIndex(2); - lengthToWidgets(dialog_->interlinespaceED, + lengthToWidgets(dialog_->interlinespaceED, dialog_->interlinespaceUnit, tabular.row_info[row].interline_space.asString(), default_unit); } - dialog_->interlinespaceED->setEnabled(!isReadonly + dialog_->interlinespaceED->setEnabled(!isReadonly && (dialog_->interlinespaceCO->currentIndex() == 2)); - dialog_->interlinespaceUnit->setEnabled(!isReadonly + dialog_->interlinespaceUnit->setEnabled(!isReadonly && (dialog_->interlinespaceCO->currentIndex() == 2)); dialog_->interlinespaceCO->setEnabled(!isReadonly); @@ -937,7 +937,7 @@ void QTabular::closeGUI() break; case 2: controller().set(Tabular::SET_TOP_SPACE, - widgetsToLength(dialog_->topspaceED, + widgetsToLength(dialog_->topspaceED, dialog_->topspaceUnit)); break; } @@ -951,7 +951,7 @@ void QTabular::closeGUI() break; case 2: controller().set(Tabular::SET_BOTTOM_SPACE, - widgetsToLength(dialog_->bottomspaceED, + widgetsToLength(dialog_->bottomspaceED, dialog_->bottomspaceUnit)); break; } @@ -965,7 +965,7 @@ void QTabular::closeGUI() break; case 2: controller().set(Tabular::SET_INTERLINE_SPACE, - widgetsToLength(dialog_->interlinespaceED, + widgetsToLength(dialog_->interlinespaceED, dialog_->interlinespaceUnit)); break; } @@ -976,4 +976,3 @@ void QTabular::closeGUI() } // namespace lyx #include "QTabular_moc.cpp" - diff --git a/src/frontends/qt4/QToc.cpp b/src/frontends/qt4/QToc.cpp index f27677fc58..b02b382d9e 100644 --- a/src/frontends/qt4/QToc.cpp +++ b/src/frontends/qt4/QToc.cpp @@ -41,7 +41,7 @@ QToc::QToc(Dialog & dialog, QObject * parent) bool QToc::canOutline(int type) const { - if (type < 0) + if (type < 0) return false; return ControlToc::canOutline(type); @@ -93,7 +93,7 @@ QModelIndex const QToc::getCurrentIndex(int type) const void QToc::goTo(int type, QModelIndex const & index) { - if (type < 0 || !index.isValid() + if (type < 0 || !index.isValid() || index.model() != toc_models_[type]) { LYXERR(Debug::GUI) << "QToc::goTo(): QModelIndex is invalid!" @@ -104,7 +104,7 @@ void QToc::goTo(int type, QModelIndex const & index) BOOST_ASSERT(type >= 0 && type < int(toc_models_.size())); TocIterator const it = toc_models_[type]->tocIterator(index); - + LYXERR(Debug::GUI) << "QToc::goTo " << to_utf8(it->str()) << endl; ControlToc::goTo(*it); diff --git a/src/frontends/qt4/QToc.h b/src/frontends/qt4/QToc.h index c7d039446c..a0403aa517 100644 --- a/src/frontends/qt4/QToc.h +++ b/src/frontends/qt4/QToc.h @@ -40,7 +40,7 @@ public: void update(); /// bool canOutline(int type) const; - + QStandardItemModel * tocModel(int type); /// QModelIndex const getCurrentIndex(int type) const; diff --git a/src/frontends/qt4/QViewSource.cpp b/src/frontends/qt4/QViewSource.cpp index 543b063393..6c866764cb 100644 --- a/src/frontends/qt4/QViewSource.cpp +++ b/src/frontends/qt4/QViewSource.cpp @@ -84,7 +84,7 @@ LaTeXHighlighter::LaTeXHighlighter(QTextDocument * parent) void LaTeXHighlighter::highlightBlock(QString const & text) { - // $ $ + // $ $ QRegExp exprMath("\\$[^\\$]*\\$"); int index = text.indexOf(exprMath); while (index >= 0) { diff --git a/src/frontends/qt4/TocModel.cpp b/src/frontends/qt4/TocModel.cpp index 8f923d89f4..08f1d12419 100644 --- a/src/frontends/qt4/TocModel.cpp +++ b/src/frontends/qt4/TocModel.cpp @@ -47,7 +47,7 @@ TocModel const & TocModel::operator=(Toc const & toc) TocIterator const TocModel::tocIterator(QModelIndex const & index) const { TocMap::const_iterator map_it = toc_map_.find(index); - BOOST_ASSERT(map_it != toc_map_.end()); + BOOST_ASSERT(map_it != toc_map_.end()); return map_it->second; } @@ -59,7 +59,7 @@ QModelIndex const TocModel::modelIndex(TocIterator const & it) const if (map_it == model_map_.end()) return QModelIndex(); - + return map_it->second; } @@ -121,7 +121,7 @@ void TocModel::populate(Toc const & toc) ++iter; } - + setHeaderData(0, Qt::Horizontal, QVariant("title"), Qt::DisplayRole); // emit headerDataChanged(); } @@ -132,7 +132,7 @@ void TocModel::populate(TocIterator & iter, QModelIndex const & parent) { int curdepth = iter->depth() + 1; - + int current_row; QModelIndex child_item; @@ -148,7 +148,7 @@ void TocModel::populate(TocIterator & iter, --iter; return; } - + maxdepth_ = max(maxdepth_, iter->depth()); mindepth_ = min(mindepth_, iter->depth()); current_row = rowCount(parent); diff --git a/src/frontends/qt4/TocWidget.cpp b/src/frontends/qt4/TocWidget.cpp index 8cdd6e8994..778e304ff2 100644 --- a/src/frontends/qt4/TocWidget.cpp +++ b/src/frontends/qt4/TocWidget.cpp @@ -39,7 +39,7 @@ namespace lyx { using support::FileName; using support::libFileSearch; - + namespace frontend { TocWidget::TocWidget(QToc * form, QWidget * parent) @@ -49,7 +49,7 @@ TocWidget::TocWidget(QToc * form, QWidget * parent) connect(form, SIGNAL(modelReset()), SLOT(updateGui())); - + FileName icon_path = libFileSearch("images", "promote.xpm"); moveOutTB->setIcon(QIcon(toqstr(icon_path.absFilename()))); icon_path = libFileSearch("images", "demote.xpm"); @@ -60,7 +60,7 @@ TocWidget::TocWidget(QToc * form, QWidget * parent) moveDownTB->setIcon(QIcon(toqstr(icon_path.absFilename()))); icon_path = libFileSearch("images", "reload.xpm"); updateTB->setIcon(QIcon(toqstr(icon_path.absFilename()))); - + // avoid flickering tocTV->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); @@ -123,21 +123,21 @@ void TocWidget::setTreeDepth(int depth) { depth_ = depth; - // expanding and then collapsing is probably better, + // expanding and then collapsing is probably better, // but my qt 4.1.2 doesn't have expandAll().. - //tocTV->expandAll(); + //tocTV->expandAll(); QModelIndexList indices = tocTV->model()->match( tocTV->model()->index(0,0), - Qt::DisplayRole, "*", -1, + Qt::DisplayRole, "*", -1, Qt::MatchWildcard|Qt::MatchRecursive); - + int size = indices.size(); for (int i = 0; i < size; i++) { QModelIndex index = indices[i]; - if (getIndexDepth(index) < depth_) - tocTV->expand(index); + if (getIndexDepth(index) < depth_) + tocTV->expand(index); else - tocTV->collapse(index); + tocTV->collapse(index); } } @@ -208,7 +208,7 @@ void TocWidget::select(QModelIndex const & index) disconnectSelectionModel(); tocTV->setCurrentIndex(index); - tocTV->scrollTo(index); + tocTV->scrollTo(index); reconnectSelectionModel(); } @@ -295,7 +295,7 @@ void TocWidget::setTocModel(size_t type) if (toc_model) { LYXERR(Debug::GUI) - << "form_->tocModel()->rowCount " + << "form_->tocModel()->rowCount " << toc_model->rowCount() << "\nform_->tocModel()->columnCount " << toc_model->columnCount() @@ -317,7 +317,7 @@ void TocWidget::reconnectSelectionModel() void TocWidget::disconnectSelectionModel() { disconnect(tocTV->selectionModel(), - SIGNAL(currentChanged(const QModelIndex &, + SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(selectionChanged(const QModelIndex &, diff --git a/src/frontends/qt4/Validator.cpp b/src/frontends/qt4/Validator.cpp index e8e393a689..69d82329bd 100644 --- a/src/frontends/qt4/Validator.cpp +++ b/src/frontends/qt4/Validator.cpp @@ -113,12 +113,12 @@ LengthAutoValidator * unsignedLengthAutoValidator(QLineEdit * ed) } -DoubleAutoValidator::DoubleAutoValidator(QWidget * parent) : +DoubleAutoValidator::DoubleAutoValidator(QWidget * parent) : QDoubleValidator(parent) {} DoubleAutoValidator::DoubleAutoValidator(double bottom, - double top, int decimals, QObject * parent) : + double top, int decimals, QObject * parent) : QDoubleValidator(bottom, top, decimals, parent) {} @@ -210,4 +210,3 @@ PathValidator * getPathValidator(QLineEdit * ed) } // namespace lyx #include "Validator_moc.cpp" - diff --git a/src/frontends/qt4/Validator.h b/src/frontends/qt4/Validator.h index 682c247c3f..8257fd7a26 100644 --- a/src/frontends/qt4/Validator.h +++ b/src/frontends/qt4/Validator.h @@ -108,7 +108,7 @@ class DoubleAutoValidator : public QDoubleValidator { Q_OBJECT public: DoubleAutoValidator(QWidget * parent); - DoubleAutoValidator(double bottom, double top, int decimals, + DoubleAutoValidator(double bottom, double top, int decimals, QObject * parent); QValidator::State validate(QString & input, int & pos) const; }; @@ -116,7 +116,7 @@ class DoubleAutoValidator : public QDoubleValidator { // Forward declarations class LyXRC; -namespace frontend { class KernelDocType; } +namespace frontend { class KernelDocType; } /** A class to ascertain whether the data passed to the @c validate() diff --git a/src/frontends/qt4/qt_helpers.cpp b/src/frontends/qt4/qt_helpers.cpp index 5cf3cfb3a0..c39a245433 100644 --- a/src/frontends/qt4/qt_helpers.cpp +++ b/src/frontends/qt4/qt_helpers.cpp @@ -94,7 +94,7 @@ Length widgetsToLength(QLineEdit const * input, QComboBox const * combo) void lengthToWidgets(QLineEdit * input, LengthCombo * combo, - Length const & len, Length::UNIT defaultUnit) + Length const & len, Length::UNIT defaultUnit) { combo->setCurrentItem(Length(len).unit()); input->setText(toqstr(convert(Length(len).value()))); @@ -118,10 +118,10 @@ void lengthToWidgets(QLineEdit * input, LengthCombo * combo, } -void lengthAutoToWidgets(QLineEdit * input, LengthCombo * combo, +void lengthAutoToWidgets(QLineEdit * input, LengthCombo * combo, Length const & len, Length::UNIT defaultUnit) { - if (len.value() == 0) + if (len.value() == 0) lengthToWidgets(input, combo, "auto", defaultUnit); else lengthToWidgets(input, combo, len, defaultUnit); @@ -130,15 +130,15 @@ void lengthAutoToWidgets(QLineEdit * input, LengthCombo * combo, //NOTE "CB" here because we probably will want one of these //for labeled sets, as well. -void setAutoTextCB(QCheckBox * checkBox, QLineEdit * lineEdit, - LengthCombo * lengthCombo) +void setAutoTextCB(QCheckBox * checkBox, QLineEdit * lineEdit, + LengthCombo * lengthCombo) { - if (!checkBox->isChecked()) + if (!checkBox->isChecked()) lengthToWidgets(lineEdit, lengthCombo, - "auto", lengthCombo->currentLengthItem()); + "auto", lengthCombo->currentLengthItem()); else if (lineEdit->text() == "auto") lengthToWidgets(lineEdit, lengthCombo, string(), - lengthCombo->currentLengthItem()); + lengthCombo->currentLengthItem()); } diff --git a/src/frontends/qt4/qt_helpers.h b/src/frontends/qt4/qt_helpers.h index 29ecf5c353..d1623b5a78 100644 --- a/src/frontends/qt4/qt_helpers.h +++ b/src/frontends/qt4/qt_helpers.h @@ -39,22 +39,22 @@ Length widgetsToLength(QLineEdit const * input, QComboBox const * combo); //FIXME It would be nice if defaultUnit were a default argument /// method to set widgets from a Length -void lengthToWidgets(QLineEdit * input, LengthCombo * combo, +void lengthToWidgets(QLineEdit * input, LengthCombo * combo, Length const & len, Length::UNIT default_unit); /// method to set widgets from a string void lengthToWidgets(QLineEdit * input, LengthCombo * combo, std::string const & len, Length::UNIT default_unit); /// method to set widgets from a Length with optional "auto" if zero -void lengthAutoToWidgets(QLineEdit * input, LengthCombo * combo, +void lengthAutoToWidgets(QLineEdit * input, LengthCombo * combo, Length const & len, Length::UNIT defaultUnit); //FIXME setAutoTextCB should really take an argument, as indicated, that //determines what text is to be written for "auto". But making //that work involves more extensive revisions than we now want //to make, since "auto" also appears in update_contents() (see -//QGraphics.cpp). +//QGraphics.cpp). //The right way to do this, I think, would be to define a class -//checkedLengthSet (and a partnering labeledLengthSete) that encapsulated +//checkedLengthSet (and a partnering labeledLengthSete) that encapsulated //the checkbox, line edit, and length combo together, and then made e.g. //lengthToWidgets, widgetsToLength, etc, all public methods of that class. //Perhaps even the validator could be exposed through it. @@ -63,7 +63,7 @@ void lengthAutoToWidgets(QLineEdit * input, LengthCombo * combo, * checkbox is unchecked and clearing the line edit if it previously * said "text". */ -void setAutoTextCB(QCheckBox * checkBox, QLineEdit * lineEdit, +void setAutoTextCB(QCheckBox * checkBox, QLineEdit * lineEdit, LengthCombo * lengthCombo/*, string text = "auto"*/); diff --git a/src/graphics/GraphicsCacheItem.cpp b/src/graphics/GraphicsCacheItem.cpp index 565be61f2f..3b7c3e871b 100644 --- a/src/graphics/GraphicsCacheItem.cpp +++ b/src/graphics/GraphicsCacheItem.cpp @@ -422,7 +422,7 @@ void CacheItem::Impl::convertToDisplayFormat() if (ConverterCache::get().inCache(filename, to_)) { LYXERR(Debug::GRAPHICS) << "\tNo conversion needed (file in file cache)!" - << endl; + << endl; file_to_load_ = ConverterCache::get().cacheName(filename, to_); loadImage(); return; diff --git a/src/graphics/GraphicsConverter.cpp b/src/graphics/GraphicsConverter.cpp index 6fafbf2679..76572a00ef 100644 --- a/src/graphics/GraphicsConverter.cpp +++ b/src/graphics/GraphicsConverter.cpp @@ -257,13 +257,13 @@ static void build_conversion_command(string const & command, ostream & script) // If this occurs, move ${outfile}.0 to ${outfile} // and delete ${outfile}.? (ignore errors) script << "if not os.path.isfile(outfile):\n" - " if os.path.isfile(outfile + '.0'):\n" - " os.rename(outfile + '.0', outfile)\n" - " import glob\n" - " for file in glob.glob(outfile + '.?'):\n" - " unlinkNoThrow(file)\n" - " else:\n" - " sys.exit(1)\n\n"; + " if os.path.isfile(outfile + '.0'):\n" + " os.rename(outfile + '.0', outfile)\n" + " import glob\n" + " for file in glob.glob(outfile + '.?'):\n" + " unlinkNoThrow(file)\n" + " else:\n" + " sys.exit(1)\n\n"; // Delete the infile script << "unlinkNoThrow(infile)\n\n"; @@ -281,23 +281,23 @@ static void build_script(FileName const & from_file, typedef Converters::EdgePath EdgePath; script << "#!/usr/bin/env python\n" - "# -*- coding: utf-8 -*-\n" - "import os, shutil, sys, locale\n\n" - "def unlinkNoThrow(file):\n" - " ''' remove a file, do not throw if an error occurs '''\n" - " try:\n" - " os.unlink(file)\n" - " except:\n" - " pass\n\n" - "def utf8ToDefaultEncoding(file):\n" - " ''' if possible, convert to the default encoding '''\n" - " try:\n" - " language, output_encoding = locale.getdefaultlocale()\n" - " if output_encoding == None:\n" - " output_encoding = 'latin1'\n" - " return unicode(file, 'utf8').encode(output_encoding)\n" - " except:\n" - " return file\n\n"; + "# -*- coding: utf-8 -*-\n" + "import os, shutil, sys, locale\n\n" + "def unlinkNoThrow(file):\n" + " ''' remove a file, do not throw if an error occurs '''\n" + " try:\n" + " os.unlink(file)\n" + " except:\n" + " pass\n\n" + "def utf8ToDefaultEncoding(file):\n" + " ''' if possible, convert to the default encoding '''\n" + " try:\n" + " language, output_encoding = locale.getdefaultlocale()\n" + " if output_encoding == None:\n" + " output_encoding = 'latin1'\n" + " return unicode(file, 'utf8').encode(output_encoding)\n" + " except:\n" + " return file\n\n"; // we do not use ChangeExtension because this is a basename // which may nevertheless contain a '.' @@ -323,8 +323,8 @@ static void build_script(FileName const & from_file, script << "infile = utf8ToDefaultEncoding(" << quoteName(from_file.absFilename(), quote_python) << ")\n" - "outfile = " << quoteName(outfile, quote_python) << "\n" - "shutil.copy(infile, outfile)\n"; + "outfile = " << quoteName(outfile, quote_python) << "\n" + "shutil.copy(infile, outfile)\n"; // Some converters (e.g. lilypond) can only output files to the // current directory, so we need to change the current directory. @@ -344,7 +344,7 @@ static void build_script(FileName const & from_file, ostringstream os; os << support::os::python() << ' ' << libScriptSearch("$$s/scripts/convertDefault.py", - quote_python) << ' '; + quote_python) << ' '; if (!from_format.empty()) os << from_format << ':'; // The extra " quotes around infile and outfile are needed @@ -380,8 +380,8 @@ static void build_script(FileName const & from_file, // Store these names in the python script script << "infile = " << quoteName(infile, quote_python) << "\n" - "infile_base = " << quoteName(infile_base, quote_python) << "\n" - "outfile = " << quoteName(outfile, quote_python) << '\n'; + "infile_base = " << quoteName(infile_base, quote_python) << "\n" + "outfile = " << quoteName(outfile, quote_python) << '\n'; // See comment about extra " quotes above (although that // applies only for the first loop run here). diff --git a/src/graphics/GraphicsLoader.cpp b/src/graphics/GraphicsLoader.cpp index d7627481f6..14df775328 100644 --- a/src/graphics/GraphicsLoader.cpp +++ b/src/graphics/GraphicsLoader.cpp @@ -26,7 +26,7 @@ using std::string; namespace lyx { using support::FileName; - + namespace graphics { class Loader::Impl : public boost::signals::trackable { diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index e87f773d27..bb6c0a892f 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -761,4 +761,3 @@ void PreviewLoader::Impl::dumpData(odocstream & os, } // namespace graphics } // namespace lyx - diff --git a/src/insets/ExternalSupport.cpp b/src/insets/ExternalSupport.cpp index 673959cf05..a4ed7de42f 100644 --- a/src/insets/ExternalSupport.cpp +++ b/src/insets/ExternalSupport.cpp @@ -109,13 +109,13 @@ string const doSubstitution(InsetExternalParams const & params, // FIXME UNICODE string relToMasterPath = support::onlyPath( to_utf8(support::makeRelPath(from_utf8(absname), - from_utf8(masterpath)))); + from_utf8(masterpath)))); if (relToMasterPath == "./") relToMasterPath.clear(); // FIXME UNICODE string relToParentPath = support::onlyPath( to_utf8(support::makeRelPath(from_utf8(absname), - from_utf8(parentpath)))); + from_utf8(parentpath)))); if (relToParentPath == "./") relToParentPath.clear(); @@ -178,8 +178,8 @@ string const doSubstitution(InsetExternalParams const & params, string::size_type const send = s.find("\")", spos); string const file_template = s.substr(spos + 12, send - (spos + 12)); string const file = doSubstitution(params, buffer, - file_template, false, - external_in_tmpdir, what); + file_template, false, + external_in_tmpdir, what); string contents; FileName const absfile( @@ -206,8 +206,8 @@ void updateExternal(InsetExternalParams const & params, string const & format, Buffer const & buffer, ExportData & exportdata, - bool external_in_tmpdir, - bool dryrun) + bool external_in_tmpdir, + bool dryrun) { Template const * const et_ptr = getTemplatePtr(params); if (!et_ptr) @@ -317,8 +317,8 @@ void updateExternal(InsetExternalParams const & params, ErrorList el; bool const success = theConverters().convert(&buffer, temp_file, abs_to_file, - params.filename, from_format, to_format, el, - Converters::try_default | Converters::try_cache); + params.filename, from_format, to_format, el, + Converters::try_default | Converters::try_cache); if (!success) LYXERR(Debug::EXTERNAL) @@ -362,7 +362,7 @@ int writeExternal(InsetExternalParams const & params, if (!dryrun || support::contains(cit->second.product, "$$Contents")) updateExternal(params, format, buffer, exportdata, - external_in_tmpdir, dryrun); + external_in_tmpdir, dryrun); bool const use_latex_path = format == "LaTeX"; string str = doSubstitution(params, buffer, cit->second.product, diff --git a/src/insets/Inset.h b/src/insets/Inset.h index a326a49ed8..a99f66c688 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -214,10 +214,10 @@ public: /// return the number of characters; in case of multiple lines of /// output, add PLAINTEXT_NEWLINE to the number of chars in the last line virtual int plaintext(Buffer const &, odocstream &, - OutputParams const &) const = 0; + OutputParams const &) const = 0; /// docbook output virtual int docbook(Buffer const &, odocstream & os, - OutputParams const &) const; + OutputParams const &) const; /// the string that is passed to the TOC virtual void textString(Buffer const &, odocstream &) const {} @@ -386,7 +386,7 @@ public: AlignCenter, AlignRight }; - + /// should we have a non-filled line before this inset? virtual DisplayType display() const { return Inline; } /// should we break lines after this inset? diff --git a/src/insets/InsetBibitem.cpp b/src/insets/InsetBibitem.cpp index 602a3f601f..b315608498 100644 --- a/src/insets/InsetBibitem.cpp +++ b/src/insets/InsetBibitem.cpp @@ -62,7 +62,7 @@ void InsetBibitem::doDispatch(Cursor & cur, FuncRequest & cmd) InsetCommandParams p("bibitem"); InsetCommandMailer::string2params("bibitem", to_utf8(cmd.argument()), p); if (p.getCmdName().empty()) { - cur.noUpdate(); + cur.noUpdate(); break; } if (p["key"] != params()["key"]) @@ -109,7 +109,7 @@ docstring const InsetBibitem::getScreenLabel(Buffer const &) const int InsetBibitem::plaintext(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { odocstringstream oss; oss << '[' << getCounter() << "] "; @@ -131,22 +131,22 @@ docstring const bibitemWidest(Buffer const & buffer) // FIXME: this font is used unitialized for now but should be set to // a proportional font. Here is what Georg Baum has to say about it: /* - bibitemWidest() is supposed to find the bibitem with the widest label in the - output, because that is needed as an argument of the bibliography - environment to dtermine the correct indentation. To be 100% correct we - would need the metrics of the font that is used in the output, but usually + bibitemWidest() is supposed to find the bibitem with the widest label in the + output, because that is needed as an argument of the bibliography + environment to dtermine the correct indentation. To be 100% correct we + would need the metrics of the font that is used in the output, but usually we don't have access to these. - In practice, any proportional font is probably good enough, since we don't - need to know the final with, we only need to know the which label is the + In practice, any proportional font is probably good enough, since we don't + need to know the final with, we only need to know the which label is the widest. - Unless there is an easy way to get the metrics of the output font I suggest + Unless there is an easy way to get the metrics of the output font I suggest to use a hardcoded font like "Times" or so. - It is very important that the result of this function is the same both with - and without GUI. After thinking about this it is clear that no Font - metrics should be used here, since these come from the gui. If we can't - easily get the LaTeX font metrics we should make our own poor mans front - metrics replacement, e.g. by hardcoding the metrics of the standard TeX + It is very important that the result of this function is the same both with + and without GUI. After thinking about this it is clear that no Font + metrics should be used here, since these come from the gui. If we can't + easily get the LaTeX font metrics we should make our own poor mans front + metrics replacement, e.g. by hardcoding the metrics of the standard TeX font. */ Font font; @@ -157,16 +157,16 @@ docstring const bibitemWidest(Buffer const & buffer) for (; it != end; ++it) { if (it->bibitem()) { docstring const label = it->bibitem()->getBibLabel(); - + // FIXME: we can't be sure using the following that the GUI - // version and the command-line version will give the same + // version and the command-line version will give the same // result. // //int const wx = use_gui? // theFontMetrics(font).width(label): label.size(); // // So for now we just use the label size in order to be sure - // that GUI and no-GUI gives the same bibitem (even if that is + // that GUI and no-GUI gives the same bibitem (even if that is // potentially the wrong one. int const wx = label.size(); diff --git a/src/insets/InsetBibtex.cpp b/src/insets/InsetBibtex.cpp index 3d4ef56679..8029855233 100644 --- a/src/insets/InsetBibtex.cpp +++ b/src/insets/InsetBibtex.cpp @@ -123,7 +123,7 @@ string normalize_name(Buffer const & buffer, OutputParams const & runparams, else // FIXME UNICODE return to_utf8(makeRelPath(from_utf8(fname), - from_utf8(buffer.getMasterBuffer()->filePath()))); + from_utf8(buffer.getMasterBuffer()->filePath()))); } } @@ -338,14 +338,14 @@ namespace { typedef map VarMap; - /// remove whitespace characters, optionally a single comma, + /// remove whitespace characters, optionally a single comma, /// and further whitespace characters from the stream. /// @return true if a comma was found, false otherwise /// bool removeWSAndComma(idocfstream & ifs) { char_type ch; - if (!ifs) + if (!ifs) return false; // skip whitespace @@ -353,7 +353,7 @@ namespace { ifs.get(ch); } while (ifs && isSpace(ch)); - if (!ifs) + if (!ifs) return false; if (ch != ',') { @@ -384,15 +384,15 @@ namespace { /// delimChars, and remove further whitespace characters. /// /// @return true if a string of length > 0 could be read. - /// - bool readTypeOrKey(docstring & val, idocfstream & ifs, + /// + bool readTypeOrKey(docstring & val, idocfstream & ifs, docstring const & delimChars, charCase chCase) { char_type ch; val.clear(); - if (!ifs) + if (!ifs) return false; // skip whitespace @@ -400,10 +400,10 @@ namespace { ifs.get(ch); } while (ifs && isSpace(ch)); - if (!ifs) + if (!ifs) return false; - // read value + // read value while (ifs && !isSpace(ch) && delimChars.find(ch) == docstring::npos) { if (chCase == makeLowerCase) { val += lowercase(ch); @@ -426,7 +426,7 @@ namespace { } /// read subsequent bibtex values that are delimited with a #-character. - /// Concatenate all parts and replace names with the associated string in + /// Concatenate all parts and replace names with the associated string in /// the variable strings. /// @return true if reading was successfull (all single parts were delimited /// correctly) @@ -436,7 +436,7 @@ namespace { val.clear(); - if (!ifs) + if (!ifs) return false; do { @@ -473,7 +473,7 @@ namespace { ifs.get(ch); while (ifs && (nestLevel > 0 || ch != delim)) { val += ch; - + // update nesting level switch (ch) { case '{': @@ -528,7 +528,7 @@ namespace { return false; // continue reading next value on concatenate with '#' - } while (ch == '#'); + } while (ch == '#'); ifs.putback(ch); @@ -545,19 +545,19 @@ void InsetBibtex::fillWithBibKeys(Buffer const & buffer, for (vector::const_iterator it = files.begin(); it != files.end(); ++ it) { // This bibtex parser is a first step to parse bibtex files - // more precisely. - // + // more precisely. + // // - it reads the whole bibtex entry and does a syntax check // (matching delimiters, missing commas,... // - it recovers from errors starting with the next @-character - // - it reads @string definitions and replaces them in the + // - it reads @string definitions and replaces them in the // field values. - // - it accepts more characters in keys or value names than + // - it accepts more characters in keys or value names than // bibtex does. // // TODOS: - // - the entries are split into name = value pairs by the - // parser. These have to be merged again because of the + // - the entries are split into name = value pairs by the + // parser. These have to be merged again because of the // way lyx treats the entries ( pair<...>(...) ). The citation // mechanism in lyx should be changed such that it can use // the split entries. @@ -572,19 +572,19 @@ void InsetBibtex::fillWithBibKeys(Buffer const & buffer, // InsetBibitem can generate non-ASCII keys, and nonstandard // 8bit clean bibtex forks exist. idocfstream ifs(it->toFilesystemEncoding().c_str(), - std::ios_base::in, - buffer.params().encoding().iconvName()); - + std::ios_base::in, + buffer.params().encoding().iconvName()); + char_type ch; VarMap strings; while (ifs) { ifs.get(ch); - if (!ifs) + if (!ifs) break; - if (ch != '@') + if (ch != '@') continue; docstring entryType; @@ -596,10 +596,10 @@ void InsetBibtex::fillWithBibKeys(Buffer const & buffer, ifs.ignore(std::numeric_limits::max(), '\n'); continue; - } + } ifs.get(ch); - if (!ifs) + if (!ifs) break; if ((ch != '(') && (ch != '{')) { @@ -611,7 +611,7 @@ void InsetBibtex::fillWithBibKeys(Buffer const & buffer, // process the entry if (entryType == from_ascii("string")) { - // read string and add it to the strings map + // read string and add it to the strings map // (or replace it's old value) docstring name; docstring value; @@ -630,7 +630,7 @@ void InsetBibtex::fillWithBibKeys(Buffer const & buffer, } else if (entryType == from_ascii("preamble")) { - // preamble definitions are discarded. + // preamble definitions are discarded. // can they be of any use in lyx? docstring value; @@ -649,9 +649,9 @@ void InsetBibtex::fillWithBibKeys(Buffer const & buffer, if (!readTypeOrKey(key, ifs, from_ascii(",})"), keepCase) || !ifs) continue; - // now we have a key, so we will add an entry + // now we have a key, so we will add an entry // (even if it's empty, as bibtex does) - // + // // all items must be separated by a comma. If // it is missing the scanning of this entry is // stopped and the next is searched. @@ -673,19 +673,19 @@ void InsetBibtex::fillWithBibKeys(Buffer const & buffer, } // read field value - if (!readValue(value, ifs, strings)) + if (!readValue(value, ifs, strings)) break; // append field to the total entry string. // - // TODO: Here is where the fields can be put in + // TODO: Here is where the fields can be put in // a more intelligent structure that preserves // the already known parts. fields += commaNewline; fields += name + from_ascii(" = {") + value + '}'; - if (!commaNewline.length()) - commaNewline = from_ascii(",\n"); + if (!commaNewline.length()) + commaNewline = from_ascii(",\n"); readNext = removeWSAndComma(ifs); } diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp index dfd8fe6086..1ca10c186b 100644 --- a/src/insets/InsetBox.cpp +++ b/src/insets/InsetBox.cpp @@ -259,7 +259,7 @@ bool InsetBox::getStatus(Cursor & cur, FuncRequest const & cmd, int InsetBox::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { BoxType btype = boxtranslator().find(params_.type); @@ -396,7 +396,7 @@ int InsetBox::latex(Buffer const & buf, odocstream & os, int InsetBox::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { BoxType const btype = boxtranslator().find(params_.type); @@ -426,7 +426,7 @@ int InsetBox::plaintext(Buffer const & buf, odocstream & os, int InsetBox::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { return InsetText::docbook(buf, os, runparams); } diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp index 2ca92f23cd..152ce58f03 100644 --- a/src/insets/InsetBranch.cpp +++ b/src/insets/InsetBranch.cpp @@ -222,7 +222,7 @@ bool InsetBranch::isBranchSelected(Buffer const & buffer) const int InsetBranch::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { return isBranchSelected(buf) ? InsetText::latex(buf, os, runparams) : 0; @@ -230,7 +230,7 @@ int InsetBranch::latex(Buffer const & buf, odocstream & os, int InsetBranch::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { if (!isBranchSelected(buf)) return 0; @@ -244,7 +244,7 @@ int InsetBranch::plaintext(Buffer const & buf, odocstream & os, int InsetBranch::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { return isBranchSelected(buf) ? InsetText::docbook(buf, os, runparams) : 0; diff --git a/src/insets/InsetBranch.h b/src/insets/InsetBranch.h index 682e8ffd39..72d30a263f 100644 --- a/src/insets/InsetBranch.h +++ b/src/insets/InsetBranch.h @@ -56,13 +56,13 @@ public: bool showInsetDialog(BufferView *) const; /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// void textString(Buffer const & buf, odocstream &) const; /// diff --git a/src/insets/InsetCaption.cpp b/src/insets/InsetCaption.cpp index 56d8543280..81643de19f 100644 --- a/src/insets/InsetCaption.cpp +++ b/src/insets/InsetCaption.cpp @@ -233,7 +233,7 @@ bool InsetCaption::getStatus(Cursor & cur, FuncRequest const & cmd, int InsetCaption::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams_in) const + OutputParams const & runparams_in) const { // This is a bit too simplistic to take advantage of // caption options we must add more later. (Lgb) @@ -255,7 +255,7 @@ int InsetCaption::latex(Buffer const & buf, odocstream & os, int InsetCaption::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { computeFullLabel(buf); @@ -268,7 +268,7 @@ int InsetCaption::plaintext(Buffer const & buf, odocstream & os, int InsetCaption::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { int ret; os << ""; @@ -279,14 +279,14 @@ int InsetCaption::docbook(Buffer const & buf, odocstream & os, int InsetCaption::getArgument(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { return InsetText::latex(buf, os, runparams); } int InsetCaption::getOptArg(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { return latexOptArgInsets(buf, paragraphs()[0], os, runparams, 1); } diff --git a/src/insets/InsetCaption.h b/src/insets/InsetCaption.h index 9d1973fba6..2e5fe4febd 100644 --- a/src/insets/InsetCaption.h +++ b/src/insets/InsetCaption.h @@ -62,19 +62,19 @@ public: virtual bool wide() const { return false; } /// int latex(Buffer const & buf, odocstream & os, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const; + OutputParams const & runparams) const; /// int docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const; + OutputParams const & runparams) const; /// return the mandatory argument (LaTeX format) only int getArgument(Buffer const & buf, odocstream & os, - OutputParams const &) const; + OutputParams const &) const; /// return the optional argument(s) only int getOptArg(Buffer const & buf, odocstream & os, - OutputParams const &) const; + OutputParams const &) const; /// void setCount(int c) { counter_ = c; } /// diff --git a/src/insets/InsetCharStyle.cpp b/src/insets/InsetCharStyle.cpp index 9bb7ae2774..adbe85f5c3 100644 --- a/src/insets/InsetCharStyle.cpp +++ b/src/insets/InsetCharStyle.cpp @@ -238,7 +238,7 @@ void InsetCharStyle::doDispatch(Cursor & cur, FuncRequest & cmd) { setInlined(); switch (cmd.action) { - + case LFUN_MOUSE_RELEASE: if (cmd.button() == mouse_button::button3) params_.show_label = !params_.show_label; @@ -283,7 +283,7 @@ bool InsetCharStyle::getStatus(Cursor & cur, FuncRequest const & cmd, int InsetCharStyle::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { if (!undefined()) { // FIXME UNICODE @@ -300,23 +300,23 @@ int InsetCharStyle::latex(Buffer const & buf, odocstream & os, int InsetCharStyle::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { return InsetText::plaintext(buf, os, runparams); } int InsetCharStyle::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { ParagraphList::const_iterator beg = paragraphs().begin(); ParagraphList::const_iterator par = paragraphs().begin(); ParagraphList::const_iterator end = paragraphs().end(); if (!undefined()) - // FIXME UNICODE - sgml::openTag(os, params_.latexname, - par->getID(buf, runparams) + params_.latexparam); + // FIXME UNICODE + sgml::openTag(os, params_.latexname, + par->getID(buf, runparams) + params_.latexparam); for (; par != end; ++par) { par->simpleDocBookOnePar(buf, os, runparams, diff --git a/src/insets/InsetCharStyle.h b/src/insets/InsetCharStyle.h index fae9de679b..84e4349a5c 100644 --- a/src/insets/InsetCharStyle.h +++ b/src/insets/InsetCharStyle.h @@ -79,13 +79,13 @@ public: bool forceDefaultParagraphs(idx_type) const { return true; } /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// the string that is passed to the TOC virtual void textString(Buffer const &, odocstream &) const; /// diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp index e1a727c4c4..f0812e5b8f 100644 --- a/src/insets/InsetCitation.cpp +++ b/src/insets/InsetCitation.cpp @@ -360,7 +360,7 @@ docstring const InsetCitation::getScreenLabel(Buffer const & buffer) const int InsetCitation::plaintext(Buffer const & buffer, odocstream & os, - OutputParams const &) const + OutputParams const &) const { docstring str; @@ -398,11 +398,11 @@ docstring const cleanupWhitespace(docstring const & citelist) } int InsetCitation::docbook(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << "<citation>" - << cleanupWhitespace(getParam("key")) - << "</citation>"; + << cleanupWhitespace(getParam("key")) + << "</citation>"; return 0; } @@ -419,7 +419,7 @@ int InsetCitation::textString(Buffer const & buf, odocstream & os, // citations and then changes his mind, turning natbib support off. The output // should revert to \cite[]{} int InsetCitation::latex(Buffer const & buffer, odocstream & os, - OutputParams const &) const + OutputParams const &) const { biblio::CiteEngine cite_engine = buffer.params().getEngine(); // FIXME UNICODE diff --git a/src/insets/InsetCitation.h b/src/insets/InsetCitation.h index 032ed379ef..e705fcb6bd 100644 --- a/src/insets/InsetCitation.h +++ b/src/insets/InsetCitation.h @@ -36,13 +36,13 @@ public: Inset::Code lyxCode() const { return Inset::CITE_CODE; } /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// the string that is passed to the TOC virtual int textString(Buffer const &, odocstream &, OutputParams const &) const; diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index d0cd2ed838..895cc381d9 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -63,7 +63,7 @@ InsetCollapsable::InsetCollapsable InsetCollapsable::InsetCollapsable(InsetCollapsable const & rhs) - : InsetText(rhs), + : InsetText(rhs), labelfont_(rhs.labelfont_), button_dim(rhs.button_dim), topx(rhs.topx), @@ -160,7 +160,7 @@ bool InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const if (status() == Open) { InsetText::metrics(mi, textdim_); // This expression should not contain mi.base.texwidth - openinlined_ = !hasFixedWidth() + openinlined_ = !hasFixedWidth() && textdim_.wid < 0.5 * mi.base.bv->workWidth(); if (openinlined_) { // Correct for button width, and re-fit @@ -239,7 +239,7 @@ void InsetCollapsable::drawSelection(PainterInfo & pi, int x, int y) const } -void InsetCollapsable::cursorPos(BufferView const & bv, +void InsetCollapsable::cursorPos(BufferView const & bv, CursorSlice const & sl, bool boundary, int & x, int & y) const { BOOST_ASSERT(status() != Collapsed); diff --git a/src/insets/InsetCommand.cpp b/src/insets/InsetCommand.cpp index 74cb845855..ea52598dc1 100644 --- a/src/insets/InsetCommand.cpp +++ b/src/insets/InsetCommand.cpp @@ -86,7 +86,7 @@ void InsetCommand::setParams(InsetCommandParams const & p) int InsetCommand::latex(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << getCommand(); return 0; @@ -94,7 +94,7 @@ int InsetCommand::latex(Buffer const &, odocstream & os, int InsetCommand::plaintext(Buffer const & buf, odocstream & os, - OutputParams const &) const + OutputParams const &) const { docstring const str = "[" + buf.B_("LaTeX Command: ") + from_utf8(getCmdName()) + "]"; os << str; @@ -103,7 +103,7 @@ int InsetCommand::plaintext(Buffer const & buf, odocstream & os, int InsetCommand::docbook(Buffer const &, odocstream &, - OutputParams const &) const + OutputParams const &) const { return 0; } diff --git a/src/insets/InsetCommandParams.cpp b/src/insets/InsetCommandParams.cpp index 8b6b827412..7c0807793c 100644 --- a/src/insets/InsetCommandParams.cpp +++ b/src/insets/InsetCommandParams.cpp @@ -364,7 +364,7 @@ std::string const InsetCommandParams::getOptions() const if (info_->optional[i]) return to_utf8(params_[i]); lyxerr << "Programming error: get nonexisting option in " - << name_ << " inset." << endl;; + << name_ << " inset." << endl;; return string(); } @@ -381,7 +381,7 @@ std::string const InsetCommandParams::getSecOptions() const } // Happens in InsetCitation lyxerr << "Programming error: get nonexisting second option in " - << name_ << " inset." << endl;; + << name_ << " inset." << endl;; return string(); } @@ -404,7 +404,7 @@ void InsetCommandParams::setOptions(std::string const & o) return; } lyxerr << "Programming error: set nonexisting option in " - << name_ << " inset." << endl;; + << name_ << " inset." << endl;; } @@ -422,7 +422,7 @@ void InsetCommandParams::setSecOptions(std::string const & s) } // Happens in InsetCitation lyxerr << "Programming error: set nonexisting second option in " - << name_ << " inset." << endl;; + << name_ << " inset." << endl;; } diff --git a/src/insets/InsetERT.cpp b/src/insets/InsetERT.cpp index fbe18a8c2e..8de1e170de 100644 --- a/src/insets/InsetERT.cpp +++ b/src/insets/InsetERT.cpp @@ -169,7 +169,7 @@ int InsetERT::latex(Buffer const &, odocstream & os, int InsetERT::plaintext(Buffer const &, odocstream &, - OutputParams const &) const + OutputParams const &) const { return 0; // do not output TeX code } diff --git a/src/insets/InsetERT.h b/src/insets/InsetERT.h index 7a2c31e090..ba448b9aa8 100644 --- a/src/insets/InsetERT.h +++ b/src/insets/InsetERT.h @@ -58,7 +58,7 @@ public: OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, OutputParams const &) const; diff --git a/src/insets/InsetEnvironment.cpp b/src/insets/InsetEnvironment.cpp index b576573b5c..e7973d0bb7 100644 --- a/src/insets/InsetEnvironment.cpp +++ b/src/insets/InsetEnvironment.cpp @@ -67,7 +67,7 @@ docstring const InsetEnvironment::editMessage() const int InsetEnvironment::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { // FIXME UNICODE os << from_utf8(layout_->latexheader); @@ -81,7 +81,7 @@ int InsetEnvironment::latex(Buffer const & buf, odocstream & os, int InsetEnvironment::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << '[' << to_utf8(name()) << ":\n"; InsetText::plaintext(buf, os, runparams); diff --git a/src/insets/InsetEnvironment.h b/src/insets/InsetEnvironment.h index ceefab862a..bdb6b71625 100644 --- a/src/insets/InsetEnvironment.h +++ b/src/insets/InsetEnvironment.h @@ -32,10 +32,10 @@ public: Inset::Code lyxCode() const { return Inset::ENVIRONMENT_CODE; } /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// virtual docstring const editMessage() const; /// diff --git a/src/insets/InsetExternal.cpp b/src/insets/InsetExternal.cpp index 56d9401ce5..d3a6cb3a25 100644 --- a/src/insets/InsetExternal.cpp +++ b/src/insets/InsetExternal.cpp @@ -675,7 +675,7 @@ void InsetExternal::read(Buffer const & buffer, Lexer & lex) int InsetExternal::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { if (params_.draft) { // FIXME UNICODE @@ -706,37 +706,37 @@ int InsetExternal::latex(Buffer const & buf, odocstream & os, if (cit != et.formats.end()) { return external::writeExternal(params_, "PDFLaTeX", - buf, os, - *(runparams.exportdata), - external_in_tmpdir, - dryrun); - } + buf, os, + *(runparams.exportdata), + external_in_tmpdir, + dryrun); + } } return external::writeExternal(params_, "LaTeX", buf, os, - *(runparams.exportdata), - external_in_tmpdir, - dryrun); + *(runparams.exportdata), + external_in_tmpdir, + dryrun); } int InsetExternal::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << '\n'; // output external material on a new line external::writeExternal(params_, "Ascii", buf, os, - *(runparams.exportdata), false, - runparams.dryrun || runparams.inComment); + *(runparams.exportdata), false, + runparams.dryrun || runparams.inComment); return PLAINTEXT_NEWLINE; } int InsetExternal::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { return external::writeExternal(params_, "DocBook", buf, os, *(runparams.exportdata), false, - runparams.dryrun || runparams.inComment); + runparams.dryrun || runparams.inComment); } diff --git a/src/insets/InsetExternal.h b/src/insets/InsetExternal.h index 96e9ebab42..31af0458a1 100644 --- a/src/insets/InsetExternal.h +++ b/src/insets/InsetExternal.h @@ -126,13 +126,13 @@ public: /// \returns the number of rows (\n's) of generated code. int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// Update needed features for this inset. virtual void validate(LaTeXFeatures & features) const; diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp index deda6e189c..1809f6bbcd 100644 --- a/src/insets/InsetFloat.cpp +++ b/src/insets/InsetFloat.cpp @@ -279,7 +279,7 @@ docstring const InsetFloat::editMessage() const int InsetFloat::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { FloatList const & floats = buf.params().getTextClass().floats(); string tmptype = (params_.wide ? params_.type + "*" : params_.type); @@ -328,7 +328,7 @@ int InsetFloat::latex(Buffer const & buf, odocstream & os, int InsetFloat::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << '[' << buf.B_("float") << ' ' << floatName(params_.type, buf.params()) << ":\n"; InsetText::plaintext(buf, os, runparams); @@ -339,10 +339,10 @@ int InsetFloat::plaintext(Buffer const & buf, odocstream & os, int InsetFloat::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { - // FIXME UNICODE - os << '<' << from_ascii(params_.type) << '>'; + // FIXME UNICODE + os << '<' << from_ascii(params_.type) << '>'; int const i = InsetText::docbook(buf, os, runparams); os << "</" << from_ascii(params_.type) << '>'; diff --git a/src/insets/InsetFloat.h b/src/insets/InsetFloat.h index 18251f9dcc..febbc1dd21 100644 --- a/src/insets/InsetFloat.h +++ b/src/insets/InsetFloat.h @@ -62,13 +62,13 @@ public: virtual bool wide() const { return false; } /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// virtual docstring const editMessage() const; /// diff --git a/src/insets/InsetFloatList.cpp b/src/insets/InsetFloatList.cpp index 0001f890a1..ec8cf428c2 100644 --- a/src/insets/InsetFloatList.cpp +++ b/src/insets/InsetFloatList.cpp @@ -80,7 +80,7 @@ void InsetFloatList::read(Buffer const & buf, Lexer & lex) if (lex.eatLine()) { setParam("type", lex.getDocString()); LYXERR(Debug::INSETS) << "FloatList::float_type: " - << to_ascii(getParam("type")) << endl; + << to_ascii(getParam("type")) << endl; if (!floats.typeExist(to_ascii(getParam("type")))) lex.printError("InsetFloatList: Unknown float type: `$$Token'"); } else @@ -99,7 +99,7 @@ void InsetFloatList::read(Buffer const & buf, Lexer & lex) int InsetFloatList::latex(Buffer const & buf, odocstream & os, - OutputParams const &) const + OutputParams const &) const { FloatList const & floats = buf.params().getTextClass().floats(); FloatList::const_iterator cit = floats[to_ascii(getParam("type"))]; @@ -129,7 +129,7 @@ int InsetFloatList::latex(Buffer const & buf, odocstream & os, int InsetFloatList::plaintext(Buffer const & buffer, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << getScreenLabel(buffer) << "\n\n"; diff --git a/src/insets/InsetFloatList.h b/src/insets/InsetFloatList.h index c9c1048f31..e837889221 100644 --- a/src/insets/InsetFloatList.h +++ b/src/insets/InsetFloatList.h @@ -40,13 +40,13 @@ public: void read(Buffer const &, Lexer &); /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const { return 0; } + OutputParams const &) const { return 0; } /// int plaintext(Buffer const &, odocstream &, - OutputParams const & runparams) const; + OutputParams const & runparams) const; /// void validate(LaTeXFeatures & features) const; private: diff --git a/src/insets/InsetFoot.cpp b/src/insets/InsetFoot.cpp index 4c0a95999a..6e31e9bee4 100644 --- a/src/insets/InsetFoot.cpp +++ b/src/insets/InsetFoot.cpp @@ -59,7 +59,7 @@ docstring const InsetFoot::editMessage() const int InsetFoot::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams_in) const + OutputParams const & runparams_in) const { OutputParams runparams = runparams_in; // footnotes in titling commands like \title have moving arguments @@ -81,7 +81,7 @@ int InsetFoot::latex(Buffer const & buf, odocstream & os, int InsetFoot::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << '[' << buf.B_("footnote") << ":\n"; InsetText::plaintext(buf, os, runparams); @@ -92,7 +92,7 @@ int InsetFoot::plaintext(Buffer const & buf, odocstream & os, int InsetFoot::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << "<footnote>"; int const i = InsetText::docbook(buf, os, runparams); diff --git a/src/insets/InsetFoot.h b/src/insets/InsetFoot.h index dcb150f963..f10c11097d 100644 --- a/src/insets/InsetFoot.h +++ b/src/insets/InsetFoot.h @@ -31,13 +31,13 @@ public: docstring name() const { return from_ascii("Foot"); } /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// virtual docstring const editMessage() const; protected: diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index 23dda7899f..a5cff0d6f8 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -726,8 +726,8 @@ string const InsetGraphics::prepareFile(Buffer const & buf, // FIXME (Abdel 12/08/06): Is there a need to show these errors? ErrorList el; if (theConverters().convert(&buf, temp_file, to_file, params().filename, - from, to, el, - Converters::try_default | Converters::try_cache)) { + from, to, el, + Converters::try_default | Converters::try_cache)) { runparams.exportdata->addExternalFile(tex_format, to_file, output_to_file); runparams.exportdata->addExternalFile("dvi", @@ -739,7 +739,7 @@ string const InsetGraphics::prepareFile(Buffer const & buf, int InsetGraphics::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { // If there is no file specified or not existing, // just output a message about it in the latex output. @@ -751,7 +751,7 @@ int InsetGraphics::latex(Buffer const & buf, odocstream & os, params().filename.relFilename(buf.filePath()); bool const file_exists = !params().filename.empty() && - isFileReadable(params().filename); + isFileReadable(params().filename); string const message = file_exists ? string() : string("bb = 0 0 200 100, draft, type=eps"); // if !message.empty() then there was no existing file @@ -809,7 +809,7 @@ int InsetGraphics::latex(Buffer const & buf, odocstream & os, int InsetGraphics::plaintext(Buffer const & buf, odocstream & os, - OutputParams const &) const + OutputParams const &) const { // No graphics in ascii output. Possible to use gifscii to convert // images to ascii approximation. @@ -820,7 +820,7 @@ int InsetGraphics::plaintext(Buffer const & buf, odocstream & os, // FIXME: We have no idea what the encoding of the filename is docstring const str = bformat(buf.B_("Graphics file: %1$s"), - from_utf8(params().filename.absFilename())); + from_utf8(params().filename.absFilename())); os << '<' << str << '>'; return 2 + str.size(); @@ -830,20 +830,20 @@ int InsetGraphics::plaintext(Buffer const & buf, odocstream & os, namespace { int writeImageObject(char * format, odocstream & os, OutputParams const & runparams, - docstring const graphic_label, docstring const attributes) + docstring const graphic_label, docstring const attributes) { if (runparams.flavor != OutputParams::XML) { os << "<![ %output.print." - << format - << "; [" - << std::endl; + << format + << "; [" + << std::endl; } os <<"<imageobject><imagedata fileref=\"&" << graphic_label - << ";." - << format - << "\" " - << attributes; + << ";." + << format + << "\" " + << attributes; if (runparams.flavor == OutputParams::XML) { os << " role=\"" << format << "\"/>" ; } diff --git a/src/insets/InsetGraphics.h b/src/insets/InsetGraphics.h index 4e30dfb0e7..c5a6bba052 100644 --- a/src/insets/InsetGraphics.h +++ b/src/insets/InsetGraphics.h @@ -48,13 +48,13 @@ public: fragile commands by adding a #\protect# before. */ int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /** Tell LyX what the latex features you need i.e. what latex packages you need to be included. diff --git a/src/insets/InsetHFill.cpp b/src/insets/InsetHFill.cpp index 681b3f1a0f..2c071f659f 100644 --- a/src/insets/InsetHFill.cpp +++ b/src/insets/InsetHFill.cpp @@ -50,10 +50,10 @@ docstring const InsetHFill::getScreenLabel(Buffer const &) const int InsetHFill::plaintext(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << " "; - return 5; + return 5; } diff --git a/src/insets/InsetHFill.h b/src/insets/InsetHFill.h index ec1eac8118..6461e8a3cf 100644 --- a/src/insets/InsetHFill.h +++ b/src/insets/InsetHFill.h @@ -30,7 +30,7 @@ public: Inset::Code lyxCode() const { return Inset::HFILL_CODE; } /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, OutputParams const &) const; diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index c49b76ecdd..05bc607bb0 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -161,7 +161,7 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd) break; case LFUN_MOUSE_RELEASE: - if (!cur.selection()) + if (!cur.selection()) InsetIncludeMailer(*this).showDialog(&cur.bv()); break; @@ -230,7 +230,7 @@ bool isVerbatim(InsetCommandParams const & params) } -bool isInputOrInclude(InsetCommandParams const & params) +bool isInputOrInclude(InsetCommandParams const & params) { Types const t = type(params); return (t == INPUT) || (t == INCLUDE); @@ -321,7 +321,7 @@ void InsetInclude::read(Lexer & lex) } if (token != "\\end_inset") { lex.printError("Missing \\end_inset at this point. " - "Read: `$$Token'"); + "Read: `$$Token'"); } } @@ -376,7 +376,7 @@ Buffer * getChildBuffer(Buffer const & buffer, InsetCommandParams const & params return 0; Buffer * childBuffer = theBufferList().getBuffer(included_file); - + //FIXME RECURSIVE INCLUDES if (childBuffer == & buffer) return 0; @@ -416,7 +416,7 @@ bool loadIfNeeded(Buffer const & buffer, InsetCommandParams const & params) int InsetInclude::latex(Buffer const & buffer, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { string incfile(to_utf8(params_["filename"])); @@ -425,17 +425,17 @@ int InsetInclude::latex(Buffer const & buffer, odocstream & os, return 0; FileName const included_file(includedFilename(buffer, params_)); - + //Check we're not trying to include ourselves. //FIXME RECURSIVE INCLUDE //This isn't sufficient, as the inclusion could be downstream. //But it'll have to do for now. if (isInputOrInclude(params_) && - buffer.fileName() == included_file.absFilename()) + buffer.fileName() == included_file.absFilename()) { - Alert::error(_("Recursive input"), - bformat(_("Attempted to include file %1$s in itself! " - "Ignoring inclusion."), from_utf8(incfile))); + Alert::error(_("Recursive input"), + bformat(_("Attempted to include file %1$s in itself! " + "Ignoring inclusion."), from_utf8(incfile))); return 0; } @@ -446,12 +446,12 @@ int InsetInclude::latex(Buffer const & buffer, odocstream & os, if (!absolutePath(incfile)) { // FIXME UNICODE incfile = to_utf8(makeRelPath(from_utf8(included_file.absFilename()), - from_utf8(m_buffer->filePath()))); + from_utf8(m_buffer->filePath()))); } // write it to a file (so far the complete file) string const exportfile = changeExtension(incfile, ".tex"); - string const mangled = + string const mangled = DocFileName(changeExtension(included_file.absFilename(),".tex")). mangledFilename(); FileName const writefile(makeAbsPath(mangled, m_buffer->temppath())); @@ -465,13 +465,13 @@ int InsetInclude::latex(Buffer const & buffer, odocstream & os, if (runparams.inComment || runparams.dryrun) { //Don't try to load or copy the file if we're //in a comment or doing a dryrun - } else if (isInputOrInclude(params_) && - isLyXFilename(included_file.absFilename())) { + } else if (isInputOrInclude(params_) && + isLyXFilename(included_file.absFilename())) { //if it's a LyX file and we're inputting or including, //try to load it so we can write the associated latex if (!loadIfNeeded(buffer, params_)) return false; - + Buffer * tmp = theBufferList().getBuffer(included_file.absFilename()); if (tmp->params().textclass != m_buffer->params().textclass) { @@ -504,8 +504,8 @@ int InsetInclude::latex(Buffer const & buffer, odocstream & os, runparams.encoding = oldEnc; } else { // In this case, it's not a LyX file, so we copy the file - // to the temp dir, so that .aux files etc. are not created - // in the original dir. Files included by this file will be + // to the temp dir, so that .aux files etc. are not created + // in the original dir. Files included by this file will be // found via input@path, see ../Buffer.cpp. unsigned long const checksum_in = sum(included_file); unsigned long const checksum_out = sum(writefile); @@ -573,7 +573,7 @@ int InsetInclude::latex(Buffer const & buffer, odocstream & os, int InsetInclude::plaintext(Buffer const & buffer, odocstream & os, - OutputParams const &) const + OutputParams const &) const { if (isVerbatim(params_) || isListings(params_)) { os << '[' << getScreenLabel(buffer) << '\n'; @@ -592,7 +592,7 @@ int InsetInclude::plaintext(Buffer const & buffer, odocstream & os, int InsetInclude::docbook(Buffer const & buffer, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { string incfile = to_utf8(params_["filename"]); @@ -607,9 +607,9 @@ int InsetInclude::docbook(Buffer const & buffer, odocstream & os, //This isn't sufficient, as the inclusion could be downstream. //But it'll have to do for now. if (buffer.fileName() == included_file) { - Alert::error(_("Recursive input"), - bformat(_("Attempted to include file %1$s in itself! " - "Ignoring inclusion."), from_utf8(incfile))); + Alert::error(_("Recursive input"), + bformat(_("Attempted to include file %1$s in itself! " + "Ignoring inclusion."), from_utf8(incfile))); return 0; } @@ -643,7 +643,7 @@ int InsetInclude::docbook(Buffer const & buffer, odocstream & os, << '&' << include_label << ';' << "\" format=\"linespecific\">"; } else - os << '&' << include_label << ';'; + os << '&' << include_label << ';'; return 0; } diff --git a/src/insets/InsetInclude.h b/src/insets/InsetInclude.h index b1a4e48568..34acab4a41 100644 --- a/src/insets/InsetInclude.h +++ b/src/insets/InsetInclude.h @@ -83,13 +83,13 @@ public: void read(Buffer const &, Lexer &); /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// void validate(LaTeXFeatures &) const; /// @@ -100,7 +100,7 @@ public: void updateLabels(Buffer const & buffer) const; /// bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const; - /// if this inset contains lstinputlisting and has a caption, + /// if this inset contains lstinputlisting and has a caption, /// update internal counter and passed counter void updateCounter(Counters & counters); protected: diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index 6ac5cb54eb..35508a8e9f 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -47,7 +47,7 @@ int InsetIndex::docbook(Buffer const &, odocstream & os, OutputParams const &) const { os << "<indexterm><primary>" - << sgml::escapeString(getParam("name")) + << sgml::escapeString(getParam("name")) << "</primary></indexterm>"; return 0; } diff --git a/src/insets/InsetLabel.cpp b/src/insets/InsetLabel.cpp index 2a6663561b..95fb3e6bb5 100644 --- a/src/insets/InsetLabel.cpp +++ b/src/insets/InsetLabel.cpp @@ -86,7 +86,7 @@ void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd) int InsetLabel::latex(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << escape(getCommand()); return 0; @@ -94,7 +94,7 @@ int InsetLabel::latex(Buffer const &, odocstream & os, int InsetLabel::plaintext(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { docstring const str = getParam("name"); os << '<' << str << '>'; @@ -103,11 +103,11 @@ int InsetLabel::plaintext(Buffer const &, odocstream & os, int InsetLabel::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << "<!-- anchor id=\"" - << sgml::cleanID(buf, runparams, getParam("name")) - << "\" -->"; + << sgml::cleanID(buf, runparams, getParam("name")) + << "\" -->"; return 0; } diff --git a/src/insets/InsetLine.cpp b/src/insets/InsetLine.cpp index 7b763cee94..bf90bad2cb 100644 --- a/src/insets/InsetLine.cpp +++ b/src/insets/InsetLine.cpp @@ -61,7 +61,7 @@ void InsetLine::draw(PainterInfo & pi, int x, int y) const int InsetLine::latex(Buffer const &, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << "\\lyxline{\\" << from_ascii(runparams.local_font->latexSize()) << '}'; @@ -70,7 +70,7 @@ int InsetLine::latex(Buffer const &, odocstream & os, int InsetLine::plaintext(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << "\n-------------------------------------------\n"; return PLAINTEXT_NEWLINE; diff --git a/src/insets/InsetLine.h b/src/insets/InsetLine.h index aa76cfd24e..89802d2a30 100644 --- a/src/insets/InsetLine.h +++ b/src/insets/InsetLine.h @@ -30,10 +30,10 @@ public: void draw(PainterInfo & pi, int x, int y) const; int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; int docbook(Buffer const &, odocstream &, OutputParams const &) const; diff --git a/src/insets/InsetListings.cpp b/src/insets/InsetListings.cpp index 7723e5f09b..60dc22eb64 100644 --- a/src/insets/InsetListings.cpp +++ b/src/insets/InsetListings.cpp @@ -193,7 +193,7 @@ int InsetListings::latex(Buffer const & buf, odocstream & os, } os << code; if (lstinline) - os << *delimiter; + os << *delimiter; else { os << "\n\\end{lstlisting}\n\\endgroup\n"; lines += 3; @@ -213,7 +213,7 @@ void InsetListings::doDispatch(Cursor & cur, FuncRequest & cmd) } case LFUN_INSET_DIALOG_UPDATE: InsetListingsMailer(*this).updateDialog(&cur.bv()); - break; + break; case LFUN_MOUSE_RELEASE: { if (cmd.button() == mouse_button::button3 && hitButton(cmd)) { InsetListingsMailer(*this).showDialog(&cur.bv()); diff --git a/src/insets/InsetListingsParams.cpp b/src/insets/InsetListingsParams.cpp index 6fc727975d..80eb0607bb 100644 --- a/src/insets/InsetListingsParams.cpp +++ b/src/insets/InsetListingsParams.cpp @@ -78,7 +78,7 @@ public: /// for option with value "true", "false". /// if onoff is true, /// "true": option - /// "false": + /// "false": /// "other": option="other" /// onoff is false, /// "true": option=true @@ -117,7 +117,7 @@ docstring ListingsParam::validate(string const & par) const par2 = par.substr(1); unclosed = true; } - + switch (type_) { case ALL: @@ -199,7 +199,7 @@ docstring ListingsParam::validate(string const & par) const } // otherwise, produce a meaningful error message. string matching_names; - for (vector<string>::iterator it = lists.begin(); + for (vector<string>::iterator it = lists.begin(); it != lists.end(); ++it) { if (it->size() >= par2.size() && it->substr(0, par2.size()) == par2) { if (matching_names.empty()) @@ -234,7 +234,7 @@ docstring ListingsParam::validate(string const & par) const /// languages and language/dialect combinations -char const * allowed_languages = +char const * allowed_languages = "no language\nABAP\n[R/2 4.3]ABAP\n[R/2 5.0]ABAP\n[R/3 3.1]ABAP\n" "[R/3 4.6C]ABAP\n[R/3 6.10]ABAP\nACSL\nAda\n[2005]Ada\n[83]Ada\n" "[95]Ada\nALGOL\n[60]ALGOL\n[68]ALGOL\nAssembler\n" @@ -259,7 +259,7 @@ char const * allowed_languages = /// ListingsParam Validator. -/// This class is aimed to be a singleton which is instantiated in +/// This class is aimed to be a singleton which is instantiated in /// \c InsetListingsParams::addParam(). // FIXME: transfer this validator to the frontend. // FIXME: avoid the use of exception. @@ -301,280 +301,280 @@ ParValidator::ParValidator() /// options copied from page 26 of listings manual // FIXME: add default parameters ... (which is not used now) - all_params_["float"] = + all_params_["float"] = ListingsParam("false", true, SUBSETOF, "*tbph", empty_hint); - all_params_["floatplacement"] = + all_params_["floatplacement"] = ListingsParam("tbp", false, SUBSETOF, "tbp", empty_hint); - all_params_["aboveskip"] = + all_params_["aboveskip"] = ListingsParam("\\medskipamount", false, LENGTH, "", empty_hint); - all_params_["belowskip"] = + all_params_["belowskip"] = ListingsParam("\\medskipamount", false, LENGTH, "", empty_hint); - all_params_["lineskip"] = + all_params_["lineskip"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["boxpos"] = + all_params_["boxpos"] = ListingsParam("", false, SUBSETOF, "bct", empty_hint); - all_params_["print"] = + all_params_["print"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["firstline"] = + all_params_["firstline"] = ListingsParam("", false, INTEGER, "", empty_hint); - all_params_["lastline"] = + all_params_["lastline"] = ListingsParam("", false, INTEGER, "", empty_hint); all_params_["showlines"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["emptylines"] = + all_params_["emptylines"] = ListingsParam("", false, ALL, "", _( "Expect a number with an optional * before it")); - all_params_["gobble"] = + all_params_["gobble"] = ListingsParam("", false, INTEGER, "", empty_hint); - all_params_["style"] = + all_params_["style"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["language"] = + all_params_["language"] = ListingsParam("", false, ONEOF, allowed_languages, empty_hint); - all_params_["alsolanguage"] = + all_params_["alsolanguage"] = ListingsParam("", false, ONEOF, allowed_languages, empty_hint); - all_params_["defaultdialect"] = + all_params_["defaultdialect"] = ListingsParam("", false, ONEOF, allowed_languages, empty_hint); - all_params_["printpod"] = + all_params_["printpod"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["usekeywordsintag"] = + all_params_["usekeywordsintag"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["tagstyle"] = + all_params_["tagstyle"] = ListingsParam("", false, ALL, "", style_hint); - all_params_["markfirstintag"] = + all_params_["markfirstintag"] = ListingsParam("", false, ALL, "", style_hint); - all_params_["makemacrouse"] = + all_params_["makemacrouse"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["basicstyle"] = + all_params_["basicstyle"] = ListingsParam("", false, ALL, "", style_hint); - all_params_["identifierstyle"] = + all_params_["identifierstyle"] = ListingsParam("", false, ALL, "", style_hint); - all_params_["commentstyle"] = + all_params_["commentstyle"] = ListingsParam("", false, ALL, "", style_hint); - all_params_["stringstyle"] = + all_params_["stringstyle"] = ListingsParam("", false, ALL, "", style_hint); - all_params_["keywordstyle"] = + all_params_["keywordstyle"] = ListingsParam("", false, ALL, "", style_hint); - all_params_["ndkeywordstyle"] = + all_params_["ndkeywordstyle"] = ListingsParam("", false, ALL, "", style_hint); - all_params_["classoffset"] = + all_params_["classoffset"] = ListingsParam("", false, INTEGER, "", empty_hint); - all_params_["texcsstyle"] = + all_params_["texcsstyle"] = ListingsParam("", false, ALL, "", style_hint); - all_params_["directivestyle"] = + all_params_["directivestyle"] = ListingsParam("", false, ALL, "", style_hint); - all_params_["emph"] = + all_params_["emph"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["moreemph"] = + all_params_["moreemph"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["deleteemph"] = + all_params_["deleteemph"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["emphstyle"] = + all_params_["emphstyle"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["delim"] = + all_params_["delim"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["moredelim"] = + all_params_["moredelim"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["deletedelim"] = + all_params_["deletedelim"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["extendedchars"] = + all_params_["extendedchars"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["inputencoding"] = + all_params_["inputencoding"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["upquote"] = + all_params_["upquote"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["tabsize"] = + all_params_["tabsize"] = ListingsParam("", false, INTEGER, "", empty_hint); - all_params_["showtabs"] = + all_params_["showtabs"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["tab"] = + all_params_["tab"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["showspaces"] = + all_params_["showspaces"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["showstringspaces"] = + all_params_["showstringspaces"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["formfeed"] = + all_params_["formfeed"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["numbers"] = + all_params_["numbers"] = ListingsParam("", false, ONEOF, "none\nleft\nright", empty_hint); - all_params_["stepnumber"] = + all_params_["stepnumber"] = ListingsParam("", false, INTEGER, "", empty_hint); - all_params_["numberfirstline"] = + all_params_["numberfirstline"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["numberstyle"] = + all_params_["numberstyle"] = ListingsParam("", false, ALL, "", style_hint); - all_params_["numbersep"] = + all_params_["numbersep"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["numberblanklines"] = + all_params_["numberblanklines"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["firstnumber"] = + all_params_["firstnumber"] = ListingsParam("", false, ALL, "", _("auto, last or a number")); - all_params_["name"] = + all_params_["name"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["thelstnumber"] = + all_params_["thelstnumber"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["title"] = + all_params_["title"] = ListingsParam("", false, ALL, "", empty_hint); // this option is not handled in the parameter box - all_params_["caption"] = + all_params_["caption"] = ListingsParam("", false, ALL, "", _( "This parameter should not be entered here. Please use caption " "editbox (Include dialog) or insert->caption (listings inset)")); // this option is not handled in the parameter box - all_params_["label"] = + all_params_["label"] = ListingsParam("", false, ALL, "",_( "This parameter should not be entered here. Please use label " "editbox (Include dialog) or insert->caption (listings inset)")); - all_params_["nolol"] = + all_params_["nolol"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["captionpos"] = + all_params_["captionpos"] = ListingsParam("", false, SUBSETOF, "tb", empty_hint); - all_params_["abovecaptionskip"] = + all_params_["abovecaptionskip"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["belowcaptionskip"] = + all_params_["belowcaptionskip"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["linewidth"] = + all_params_["linewidth"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["xleftmargin"] = + all_params_["xleftmargin"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["xrightmargin"] = + all_params_["xrightmargin"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["resetmargins"] = + all_params_["resetmargins"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["breaklines"] = + all_params_["breaklines"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["prebreak"] = + all_params_["prebreak"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["postbreak"] = + all_params_["postbreak"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["breakindent"] = + all_params_["breakindent"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["breakautoindent"] = + all_params_["breakautoindent"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["frame"] = + all_params_["frame"] = ListingsParam("", false, ALL, "", frame_hint); - all_params_["frameround"] = + all_params_["frameround"] = ListingsParam("", false, SUBSETOF, "tf", frameround_hint); - all_params_["framesep"] = + all_params_["framesep"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["rulesep"] = + all_params_["rulesep"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["framerule"] = + all_params_["framerule"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["framexleftmargin"] = + all_params_["framexleftmargin"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["framexrightmargin"] = + all_params_["framexrightmargin"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["framextopmargin"] = + all_params_["framextopmargin"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["framexbottommargin"] = + all_params_["framexbottommargin"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["backgroundcolor"] = + all_params_["backgroundcolor"] = ListingsParam("", false, ALL, "", color_hint ); - all_params_["rulecolor"] = + all_params_["rulecolor"] = ListingsParam("", false, ALL, "", color_hint ); - all_params_["fillcolor"] = + all_params_["fillcolor"] = ListingsParam("", false, ALL, "", color_hint ); - all_params_["rulesepcolor"] = + all_params_["rulesepcolor"] = ListingsParam("", false, ALL, "", color_hint ); - all_params_["frameshape"] = + all_params_["frameshape"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["index"] = + all_params_["index"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["moreindex"] = + all_params_["moreindex"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["deleteindex"] = + all_params_["deleteindex"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["indexstyle"] = + all_params_["indexstyle"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["columns"] = + all_params_["columns"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["flexiblecolumns"] = + all_params_["flexiblecolumns"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["keepspaces"] = + all_params_["keepspaces"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["basewidth"] = + all_params_["basewidth"] = ListingsParam("", false, LENGTH, "", empty_hint); - all_params_["fontadjust"] = + all_params_["fontadjust"] = ListingsParam("", true, TRUEFALSE, "", empty_hint); - all_params_["texcl"] = + all_params_["texcl"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["mathescape"] = + all_params_["mathescape"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["escapechar"] = + all_params_["escapechar"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["escapeinside"] = + all_params_["escapeinside"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["escepeinside"] = + all_params_["escepeinside"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["escepebegin"] = + all_params_["escepebegin"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["escepeend"] = + all_params_["escepeend"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["fancyvrb"] = + all_params_["fancyvrb"] = ListingsParam("", false, TRUEFALSE, "", empty_hint); - all_params_["fvcmdparams"] = + all_params_["fvcmdparams"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["morefvcmdparams"] = + all_params_["morefvcmdparams"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["keywordsprefix"] = + all_params_["keywordsprefix"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["keywords"] = + all_params_["keywords"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["morekeywords"] = + all_params_["morekeywords"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["deletekeywords"] = + all_params_["deletekeywords"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["ndkeywords"] = + all_params_["ndkeywords"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["morendkeywords"] = + all_params_["morendkeywords"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["deletendkeywords"] = + all_params_["deletendkeywords"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["texcs"] = + all_params_["texcs"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["moretexcs"] = + all_params_["moretexcs"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["deletetexcs"] = + all_params_["deletetexcs"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["directives"] = + all_params_["directives"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["moredirectives"] = + all_params_["moredirectives"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["deletedirectives"] = + all_params_["deletedirectives"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["sensitive"] = + all_params_["sensitive"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["alsoletter"] = + all_params_["alsoletter"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["alsodigit"] = + all_params_["alsodigit"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["alsoother"] = + all_params_["alsoother"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["otherkeywords"] = + all_params_["otherkeywords"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["tag"] = + all_params_["tag"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["string"] = + all_params_["string"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["morestring"] = + all_params_["morestring"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["deletestring"] = + all_params_["deletestring"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["comment"] = + all_params_["comment"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["morecomment"] = + all_params_["morecomment"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["deletecomment"] = + all_params_["deletecomment"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["keywordcomment"] = + all_params_["keywordcomment"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["morekeywordcomment"] = + all_params_["morekeywordcomment"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["deletekeywordcomment"] = + all_params_["deletekeywordcomment"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["keywordcommentsemicolon"] = + all_params_["keywordcommentsemicolon"] = ListingsParam("", false, ALL, "", empty_hint); - all_params_["podcomment"] = + all_params_["podcomment"] = ListingsParam("", false, ALL, "", empty_hint); ListingsParams::const_iterator it = all_params_.begin(); @@ -687,7 +687,7 @@ string InsetListingsParams::params(string const & sep) const void InsetListingsParams::addParam(string const & key, string const & value) -{ +{ if (key.empty()) return; @@ -706,7 +706,7 @@ void InsetListingsParams::addParam(string const & key, string const & value) // if the parameter is surrounded with {}, good else if (prefixIs(value, "{") && suffixIs(value, "}")) params_[key] = value; - // otherwise, check if {} is needed. Add {} to all values with + // otherwise, check if {} is needed. Add {} to all values with // non-ascii/number characters, just to be safe else { bool has_special_char = false; @@ -748,10 +748,10 @@ void InsetListingsParams::addParams(string const & par) continue; } else if (par[i] == '{' && par[i - 1] == '=') braces ++; - else if (par[i] == '}' + else if (par[i] == '}' && (i == par.size() - 1 || par[i + 1] == ',' || par[i + 1] == '\n')) braces --; - + if (isValue) value += par[i]; else @@ -772,14 +772,14 @@ void InsetListingsParams::setParams(string const & par) string InsetListingsParams::encodedString() const { // Encode string! - // '"' is handled differently because it will + // '"' is handled differently because it will // terminate a lyx token. string par = params(); // '"' is now " ==> '"' is now &quot; par = subst(par, "&", "&"); // '"' is now &quot; ==> '"' is now &quot; par = subst(par, "\"", """); - return par; + return par; } diff --git a/src/insets/InsetListingsParams.h b/src/insets/InsetListingsParams.h index 452f363fcd..341d73d507 100644 --- a/src/insets/InsetListingsParams.h +++ b/src/insets/InsetListingsParams.h @@ -36,13 +36,13 @@ public: /// valid parameter string std::string params(std::string const & sep=",") const; - + /// add key=value to params_ void addParam(std::string const & key, std::string const & value); /// add a few parameters void addParams(std::string const & par); - + /// set params_ with par, throw an exception if par is valid void setParams(std::string const & par); @@ -57,7 +57,7 @@ public: /// get parameter from encoded string void fromEncodedString(std::string const & par); - /// + /// bool isInline() const { return inline_; } /// @@ -79,7 +79,7 @@ private: /// inline or normal listings bool inline_; - /// key-value pairs of the parameters + /// key-value pairs of the parameters std::map<std::string, std::string> params_; /// collapsable status diff --git a/src/insets/InsetMarginal.cpp b/src/insets/InsetMarginal.cpp index 52a4d83def..7761980d93 100644 --- a/src/insets/InsetMarginal.cpp +++ b/src/insets/InsetMarginal.cpp @@ -55,7 +55,7 @@ docstring const InsetMarginal::editMessage() const int InsetMarginal::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << "%\n\\marginpar{"; int const i = InsetText::latex(buf, os, runparams); @@ -65,7 +65,7 @@ int InsetMarginal::latex(Buffer const & buf, odocstream & os, int InsetMarginal::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << '[' << buf.B_("margin") << ":\n"; InsetText::plaintext(buf, os, runparams); @@ -76,7 +76,7 @@ int InsetMarginal::plaintext(Buffer const & buf, odocstream & os, int InsetMarginal::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << "<note role=\"margin\">"; int const i = InsetText::docbook(buf, os, runparams); diff --git a/src/insets/InsetMarginal.h b/src/insets/InsetMarginal.h index c3f8300192..e261f7d9f6 100644 --- a/src/insets/InsetMarginal.h +++ b/src/insets/InsetMarginal.h @@ -32,13 +32,13 @@ public: docstring name() const { return from_ascii("Marginal"); } /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const & runparams) const; + OutputParams const & runparams) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const & runparams) const; + OutputParams const & runparams) const; /// virtual docstring const editMessage() const; protected: diff --git a/src/insets/InsetNewline.cpp b/src/insets/InsetNewline.cpp index 38513b3d8b..ee06ef9c7d 100644 --- a/src/insets/InsetNewline.cpp +++ b/src/insets/InsetNewline.cpp @@ -63,7 +63,7 @@ int InsetNewline::latex(Buffer const &, odocstream &, int InsetNewline::plaintext(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << '\n'; return PLAINTEXT_NEWLINE; diff --git a/src/insets/InsetNomencl.cpp b/src/insets/InsetNomencl.cpp index d3bf218c0e..850a670cc4 100644 --- a/src/insets/InsetNomencl.cpp +++ b/src/insets/InsetNomencl.cpp @@ -97,7 +97,7 @@ int InsetPrintNomencl::docbook(Buffer const & buf, odocstream & os, newlines += static_cast<InsetNomencl const &>(*it).docbookGlossary(os); ++it; } else if(it->lyxCode() == Inset::NOTE_CODE && - static_cast<InsetNote const &>(*it).params().type == InsetNoteParams::Note) { + static_cast<InsetNote const &>(*it).params().type == InsetNoteParams::Note) { // Don't output anything nested in note insets size_t const depth = it.depth(); ++it; diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp index cff547b5b2..1a0cadc5fe 100644 --- a/src/insets/InsetNote.cpp +++ b/src/insets/InsetNote.cpp @@ -309,7 +309,7 @@ int InsetNote::latex(Buffer const & buf, odocstream & os, int InsetNote::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams_in) const + OutputParams const & runparams_in) const { if (params_.type == InsetNoteParams::Note) return 0; @@ -329,7 +329,7 @@ int InsetNote::plaintext(Buffer const & buf, odocstream & os, int InsetNote::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams_in) const + OutputParams const & runparams_in) const { if (params_.type == InsetNoteParams::Note) return 0; @@ -349,7 +349,7 @@ int InsetNote::docbook(Buffer const & buf, odocstream & os, // Return how many newlines we issued. //return int(count(str.begin(), str.end(), '\n')); - return n + 1 + 2; + return n + 1 + 2; } diff --git a/src/insets/InsetOptArg.cpp b/src/insets/InsetOptArg.cpp index 5d88cae11e..71d9a2b63d 100644 --- a/src/insets/InsetOptArg.cpp +++ b/src/insets/InsetOptArg.cpp @@ -68,21 +68,21 @@ void InsetOptArg::write(Buffer const & buf, ostream & os) const int InsetOptArg::latex(Buffer const &, odocstream &, - OutputParams const &) const + OutputParams const &) const { return 0; } int InsetOptArg::plaintext(Buffer const &, odocstream &, - OutputParams const &) const + OutputParams const &) const { return 0; // do not output optional arguments } int InsetOptArg::docbook(Buffer const &, odocstream &, - OutputParams const &) const + OutputParams const &) const { return 0; } diff --git a/src/insets/InsetOptArg.h b/src/insets/InsetOptArg.h index 7f57c87a5f..4f8c14ae08 100644 --- a/src/insets/InsetOptArg.h +++ b/src/insets/InsetOptArg.h @@ -36,13 +36,13 @@ public: /// Standard LaTeX output -- short-circuited int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// Standard plain text output -- short-circuited int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// Standard DocBook output -- short-circuited int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// Outputting the optional parameter of a LaTeX command int latexOptional(Buffer const &, odocstream &, diff --git a/src/insets/InsetPagebreak.cpp b/src/insets/InsetPagebreak.cpp index 9b0ff4c6a3..f6d2987eb1 100644 --- a/src/insets/InsetPagebreak.cpp +++ b/src/insets/InsetPagebreak.cpp @@ -80,7 +80,7 @@ void InsetPagebreak::draw(PainterInfo & pi, int x, int y) const int InsetPagebreak::latex(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << from_ascii(getCmdName()) << "{}"; return 0; @@ -88,7 +88,7 @@ int InsetPagebreak::latex(Buffer const &, odocstream & os, int InsetPagebreak::plaintext(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << '\n'; return PLAINTEXT_NEWLINE; @@ -96,7 +96,7 @@ int InsetPagebreak::plaintext(Buffer const &, odocstream & os, int InsetPagebreak::docbook(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << '\n'; return 0; diff --git a/src/insets/InsetPagebreak.h b/src/insets/InsetPagebreak.h index c0a066b746..83515a180a 100644 --- a/src/insets/InsetPagebreak.h +++ b/src/insets/InsetPagebreak.h @@ -30,13 +30,13 @@ public: void draw(PainterInfo & pi, int x, int y) const; int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; void read(Buffer const &, Lexer & lex); @@ -63,7 +63,7 @@ public: InsetClearPage() {} docstring insetLabel() const { return _("Clear Page"); } - + std::string getCmdName() const { return "\\clearpage"; } private: @@ -79,7 +79,7 @@ public: InsetClearDoublePage() {} docstring insetLabel() const { return _("Clear Double Page"); } - + std::string getCmdName() const { return "\\cleardoublepage"; } private: diff --git a/src/insets/InsetQuotes.cpp b/src/insets/InsetQuotes.cpp index 49e925f5aa..c8f6e5e61f 100644 --- a/src/insets/InsetQuotes.cpp +++ b/src/insets/InsetQuotes.cpp @@ -204,7 +204,7 @@ docstring const InsetQuotes::dispString(Language const * loclang) const #endif else retdisp = lyx::from_ascii(disp); - + // in french, spaces are added inside double quotes if (times_ == DoubleQ && prefixIs(loclang->code(), "fr")) { if (side_ == LeftQ) @@ -292,7 +292,7 @@ void InsetQuotes::read(Buffer const &, Lexer & lex) int InsetQuotes::latex(Buffer const &, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { const int quoteind = quote_index[side_][language_]; string qstr; @@ -325,7 +325,7 @@ int InsetQuotes::latex(Buffer const &, odocstream & os, int InsetQuotes::plaintext(Buffer const & buf, odocstream & os, - OutputParams const &) const + OutputParams const &) const { docstring const str = dispString(buf.params().language); os << str; @@ -334,7 +334,7 @@ int InsetQuotes::plaintext(Buffer const & buf, odocstream & os, int InsetQuotes::docbook(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { if (times_ == DoubleQ) { if (side_ == LeftQ) diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp index 075344047a..a1c9f55e41 100644 --- a/src/insets/InsetRef.cpp +++ b/src/insets/InsetRef.cpp @@ -48,9 +48,9 @@ void InsetRef::doDispatch(Cursor & cur, FuncRequest & cmd) case LFUN_MOUSE_RELEASE: // Eventually trigger dialog with button 3 not 1 if (cmd.button() == mouse_button::button3) - lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO, + lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO, getParam("reference"))); - else + else InsetCommand::doDispatch(cur, cmd); break; @@ -80,7 +80,7 @@ docstring const InsetRef::getScreenLabel(Buffer const &) const int InsetRef::latex(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { // Don't output p_["name"], this is only used in docbook InsetCommandParams p(getCmdName()); @@ -91,7 +91,7 @@ int InsetRef::latex(Buffer const &, odocstream & os, int InsetRef::plaintext(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { docstring const str = getParam("reference"); os << '[' << str << ']'; @@ -100,23 +100,23 @@ int InsetRef::plaintext(Buffer const &, odocstream & os, int InsetRef::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { docstring const & name = getParam("name"); if (name.empty()) { if (runparams.flavor == OutputParams::XML) { - os << "<xref linkend=\"" - << sgml::cleanID(buf, runparams, getParam("reference")) + os << "<xref linkend=\"" + << sgml::cleanID(buf, runparams, getParam("reference")) << "\" />"; } else { - os << "<xref linkend=\"" - << sgml::cleanID(buf, runparams, getParam("reference")) + os << "<xref linkend=\"" + << sgml::cleanID(buf, runparams, getParam("reference")) << "\">"; } } else { - os << "<link linkend=\"" + os << "<link linkend=\"" << sgml::cleanID(buf, runparams, getParam("reference")) - << "\">" + << "\">" << getParam("name") << "</link>"; } diff --git a/src/insets/InsetSpace.cpp b/src/insets/InsetSpace.cpp index 2c1639cf0f..168862236b 100644 --- a/src/insets/InsetSpace.cpp +++ b/src/insets/InsetSpace.cpp @@ -58,11 +58,11 @@ bool InsetSpace::metrics(MetricsInfo & mi, Dimension & dim) const switch (kind_) { case THIN: case NEGTHIN: - dim.wid = fm.width(char_type('x')) / 3; + dim.wid = fm.width(char_type('x')) / 3; break; case PROTECTED: case NORMAL: - dim.wid = fm.width(char_type('x')); + dim.wid = fm.width(char_type('x')); break; case QUAD: dim.wid = 20; @@ -167,7 +167,7 @@ void InsetSpace::read(Buffer const &, Lexer & lex) int InsetSpace::latex(Buffer const &, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { switch (kind_) { case NORMAL: @@ -200,7 +200,7 @@ int InsetSpace::latex(Buffer const &, odocstream & os, int InsetSpace::plaintext(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << ' '; return 1; @@ -208,7 +208,7 @@ int InsetSpace::plaintext(Buffer const &, odocstream & os, int InsetSpace::docbook(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { switch (kind_) { case NORMAL: diff --git a/src/insets/InsetSpace.h b/src/insets/InsetSpace.h index 040316fc6d..e285117b11 100644 --- a/src/insets/InsetSpace.h +++ b/src/insets/InsetSpace.h @@ -65,13 +65,13 @@ public: void read(Buffer const &, Lexer & lex); /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// the string that is passed to the TOC virtual int textString(Buffer const &, odocstream &, OutputParams const &) const; diff --git a/src/insets/InsetSpecialChar.cpp b/src/insets/InsetSpecialChar.cpp index 27dc69999d..178034136d 100644 --- a/src/insets/InsetSpecialChar.cpp +++ b/src/insets/InsetSpecialChar.cpp @@ -57,7 +57,7 @@ bool InsetSpecialChar::metrics(MetricsInfo & mi, Dimension & dim) const case MENU_SEPARATOR: s = " x "; break; case HYPHENATION: s = "-"; break; } - docstring ds(s.begin(), s.end()); + docstring ds(s.begin(), s.end()); dim.wid = fm.width(ds); if (kind_ == HYPHENATION && dim.wid > 5) dim.wid -= 2; // to make it look shorter @@ -93,8 +93,8 @@ void InsetSpecialChar::draw(PainterInfo & pi, int x, int y) const case LDOTS: { font.setColor(Color::special); - string ell = ". . . "; - docstring dell(ell.begin(), ell.end()); + string ell = ". . . "; + docstring dell(ell.begin(), ell.end()); pi.pain.text(x, y, dell, font); break; } @@ -104,7 +104,7 @@ void InsetSpecialChar::draw(PainterInfo & pi, int x, int y) const theFontMetrics(font); // A triangle the width and height of an 'x' - int w = fm.width(char_type('x')); + int w = fm.width(char_type('x')); int ox = fm.width(char_type(' ')) + x; int h = fm.ascent(char_type('x')); int xp[4], yp[4]; @@ -192,7 +192,7 @@ int InsetSpecialChar::latex(Buffer const &, odocstream & os, int InsetSpecialChar::plaintext(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { switch (kind_) { case HYPHENATION: @@ -213,7 +213,7 @@ int InsetSpecialChar::plaintext(Buffer const &, odocstream & os, int InsetSpecialChar::docbook(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { switch (kind_) { case HYPHENATION: diff --git a/src/insets/InsetSpecialChar.h b/src/insets/InsetSpecialChar.h index 548f4fea78..d54e993d10 100644 --- a/src/insets/InsetSpecialChar.h +++ b/src/insets/InsetSpecialChar.h @@ -57,13 +57,13 @@ public: void read(Buffer const &, Lexer & lex); /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// the string that is passed to the TOC virtual int textString(Buffer const &, odocstream &, OutputParams const &) const; diff --git a/src/insets/InsetTOC.cpp b/src/insets/InsetTOC.cpp index 2c74aea5f2..51234af7cd 100644 --- a/src/insets/InsetTOC.cpp +++ b/src/insets/InsetTOC.cpp @@ -57,7 +57,7 @@ Inset::Code InsetTOC::lyxCode() const int InsetTOC::plaintext(Buffer const & buffer, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << getScreenLabel(buffer) << "\n\n"; @@ -68,7 +68,7 @@ int InsetTOC::plaintext(Buffer const & buffer, odocstream & os, int InsetTOC::docbook(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { if (getCmdName() == "tableofcontents") os << "<toc></toc>"; diff --git a/src/insets/InsetTOC.h b/src/insets/InsetTOC.h index f38643bb9a..c4a6f8d99f 100644 --- a/src/insets/InsetTOC.h +++ b/src/insets/InsetTOC.h @@ -33,10 +33,10 @@ public: DisplayType display() const { return AlignCenter; } /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; private: virtual std::auto_ptr<Inset> doClone() const; }; diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index f9c8d3fe52..005bf08933 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -1534,11 +1534,11 @@ void Tabular::read(Buffer const & buf, Lexer & lex) getTokenValue(line, "topline", row_info[i].top_line); getTokenValue(line, "bottomline", row_info[i].bottom_line); getTokenValue(line, "topspace", row_info[i].top_space, - row_info[i].top_space_default); + row_info[i].top_space_default); getTokenValue(line, "bottomspace", row_info[i].bottom_space, - row_info[i].bottom_space_default); + row_info[i].bottom_space_default); getTokenValue(line, "interlinespace", row_info[i].interline_space, - row_info[i].interline_space_default); + row_info[i].interline_space_default); getTokenValue(line, "endfirsthead", row_info[i].endfirsthead); getTokenValue(line, "endhead", row_info[i].endhead); getTokenValue(line, "endfoot", row_info[i].endfoot); @@ -2270,7 +2270,7 @@ int Tabular::TeXRow(odocstream & os, row_type i, Buffer const & buf, } ++ret; } - + for (col_type j = 0; j < columns_; ++j) { if (isPartOfMultiColumn(i, j)) continue; @@ -2577,7 +2577,7 @@ int Tabular::docbook(Buffer const & buf, odocstream & os, bool Tabular::plaintextTopHLine(odocstream & os, row_type row, - vector<unsigned int> const & clen) const + vector<unsigned int> const & clen) const { idx_type const fcell = getFirstCellInRow(row); idx_type const n = numberOfCellsInRow(fcell) + fcell; @@ -2625,7 +2625,7 @@ bool Tabular::plaintextTopHLine(odocstream & os, row_type row, bool Tabular::plaintextBottomHLine(odocstream & os, row_type row, - vector<unsigned int> const & clen) const + vector<unsigned int> const & clen) const { idx_type const fcell = getFirstCellInRow(row); idx_type const n = numberOfCellsInRow(fcell) + fcell; @@ -2724,8 +2724,8 @@ void Tabular::plaintextPrintCell(Buffer const & buf, odocstream & os, void Tabular::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams, int const depth, - bool onlydata, unsigned char delim) const + OutputParams const & runparams, int const depth, + bool onlydata, unsigned char delim) const { // first calculate the width of the single columns vector<unsigned int> clen(columns_); @@ -2771,7 +2771,7 @@ void Tabular::plaintext(Buffer const & buf, odocstream & os, if (onlydata && j > 0) os << delim; plaintextPrintCell(buf, os, runparams, - cell, i, j, clen, onlydata); + cell, i, j, clen, onlydata); ++cell; } os << endl; @@ -3183,8 +3183,8 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) case LFUN_MOUSE_PRESS: //lyxerr << "# InsetTabular::MousePress\n" << cur.bv().cursor() << endl; - if (cmd.button() == mouse_button::button1 - || (cmd.button() == mouse_button::button3 + if (cmd.button() == mouse_button::button1 + || (cmd.button() == mouse_button::button3 && (&bvcur.selBegin().inset() != this || !tablemode(bvcur)))) { if (!bvcur.selection() && !cur.bv().mouseSetCursor(cur)) cur.noUpdate(); @@ -3204,7 +3204,7 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) cmd = FuncRequest(LFUN_PASTE, "0"); } else { cmd = FuncRequest(LFUN_PRIMARY_SELECTION_PASTE, - "paragraph"); + "paragraph"); } doDispatch(cur, cmd); } @@ -3661,12 +3661,12 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, case Tabular::TOGGLE_ROTATE_CELL: case Tabular::SET_ROTATE_CELL: - status.setOnOff(!oneCellHasRotationState(false, + status.setOnOff(!oneCellHasRotationState(false, sel_row_start, sel_row_end, sel_col_start, sel_col_end)); break; case Tabular::UNSET_ROTATE_CELL: - status.setOnOff(!oneCellHasRotationState(true, + status.setOnOff(!oneCellHasRotationState(true, sel_row_start, sel_row_end, sel_col_start, sel_col_end)); break; @@ -3791,14 +3791,14 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, int InsetTabular::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { return tabular.latex(buf, os, runparams); } int InsetTabular::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << '\n'; // output table on a new line int const dp = runparams.linelen > 0 ? runparams.depth : 0; @@ -3808,7 +3808,7 @@ int InsetTabular::plaintext(Buffer const & buf, odocstream & os, int InsetTabular::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { int ret = 0; Inset * master = 0; @@ -4053,7 +4053,7 @@ bool InsetTabular::tabularFeatures(Cursor & cur, string const & what) if (tmp == what.substr(0, tmp.length())) { //if (!compare(tabularFeatures[i].feature.c_str(), what.c_str(), - //tabularFeatures[i].feature.length())) + //tabularFeatures[i].feature.length())) action = tabularFeature[i].action; break; } @@ -4087,12 +4087,12 @@ static void checkLongtableSpecial(Tabular::ltType & ltt, } bool InsetTabular::oneCellHasRotationState(bool rotated, - row_type row_start, row_type row_end, + row_type row_start, row_type row_end, col_type col_start, col_type col_end) const { for (row_type i = row_start; i <= row_end; ++i) { for (col_type j = col_start; j <= col_end; ++j) { - if (tabular.getRotateCell(tabular.getCellNumber(i, j)) + if (tabular.getRotateCell(tabular.getCellNumber(i, j)) == rotated) { return true; } @@ -4382,10 +4382,10 @@ void InsetTabular::tabularFeatures(Cursor & cur, { bool oneNotRotated = oneCellHasRotationState(false, sel_row_start, sel_row_end, sel_col_start, sel_col_end); - + for (row_type i = sel_row_start; i <= sel_row_end; ++i) for (col_type j = sel_col_start; j <= sel_col_end; ++j) - tabular.setRotateCell(tabular.getCellNumber(i, j), + tabular.setRotateCell(tabular.getCellNumber(i, j), oneNotRotated); } break; @@ -4595,7 +4595,7 @@ bool InsetTabular::pasteClipboard(Cursor & cur) tabular.setCellInset(r2, c2, inset); // FIXME: change tracking (MG) inset->setChange(Change(cur.buffer().params().trackChanges ? - Change::INSERTED : Change::UNCHANGED)); + Change::INSERTED : Change::UNCHANGED)); cur.pos() = 0; } } @@ -4764,7 +4764,7 @@ bool InsetTabular::insertPlaintextString(BufferView & bv, docstring const & buf, Paragraph & par = inset->text_.getPar(0); Font const font = inset->text_.getFont(buffer, par, 0); inset->setText(buf.substr(op, p - op), font, - buffer.params().trackChanges); + buffer.params().trackChanges); ++cols; ++cell; } @@ -4776,7 +4776,7 @@ bool InsetTabular::insertPlaintextString(BufferView & bv, docstring const & buf, Paragraph & par = inset->text_.getPar(0); Font const font = inset->text_.getFont(buffer, par, 0); inset->setText(buf.substr(op, p - op), font, - buffer.params().trackChanges); + buffer.params().trackChanges); } cols = ocol; ++row; diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index bc8c36a27d..5c3fb27f05 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -66,7 +66,7 @@ class OutputParams; // // A helper struct for tables -// +// class Tabular { public: /// @@ -356,8 +356,8 @@ public: int docbook(Buffer const & buf, odocstream & os, OutputParams const &) const; /// void plaintext(Buffer const &, odocstream &, - OutputParams const & runparams, int const depth, - bool onlydata, unsigned char delim) const; + OutputParams const & runparams, int const depth, + bool onlydata, unsigned char delim) const; /// bool isMultiColumn(idx_type cell) const; /// @@ -644,16 +644,16 @@ public: // helper functions for plain text /// bool plaintextTopHLine(odocstream &, row_type row, - std::vector<unsigned int> const &) const; + std::vector<unsigned int> const &) const; /// bool plaintextBottomHLine(odocstream &, row_type row, - std::vector<unsigned int> const &) const; + std::vector<unsigned int> const &) const; /// void plaintextPrintCell(Buffer const &, odocstream &, - OutputParams const &, - idx_type cell, row_type row, col_type column, - std::vector<unsigned int> const &, - bool onlydata) const; + OutputParams const &, + idx_type cell, row_type row, col_type column, + std::vector<unsigned int> const &, + bool onlydata) const; /// auxiliary function for docbook int docbookRow(Buffer const & buf, odocstream & os, row_type, OutputParams const &) const; @@ -700,13 +700,13 @@ public: DisplayType display() const { return tabular.isLongTabular() ? AlignCenter : Inline; } /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// void validate(LaTeXFeatures & features) const; /// @@ -816,7 +816,7 @@ private: /// test the rotation state of the give cell range. bool oneCellHasRotationState(bool rotated, - row_type row_start, row_type row_end, + row_type row_start, row_type row_end, col_type col_start, col_type col_end) const; /// Buffer const * buffer_; diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index b256384209..2682a8a63e 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -293,7 +293,7 @@ void InsetText::rejectChanges(BufferParams const & bparams) int InsetText::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { TexRow texrow; latexParagraphs(buf, paragraphs(), os, texrow, runparams); @@ -302,7 +302,7 @@ int InsetText::latex(Buffer const & buf, odocstream & os, int InsetText::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { ParagraphList::const_iterator beg = paragraphs().begin(); ParagraphList::const_iterator end = paragraphs().end(); @@ -329,7 +329,7 @@ int InsetText::plaintext(Buffer const & buf, odocstream & os, int InsetText::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { docbookParagraphs(paragraphs(), buf, os, runparams); return 0; @@ -421,7 +421,7 @@ void InsetText::appendParagraphs(Buffer * buffer, ParagraphList & plist) std::distance(pl.begin(), ins) - 1); for_each(pit, plist.end(), - bind(&ParagraphList::push_back, ref(pl), _1)); + bind(&ParagraphList::push_back, ref(pl), _1)); } diff --git a/src/insets/InsetUrl.cpp b/src/insets/InsetUrl.cpp index dded3eb4e3..93a17e4388 100644 --- a/src/insets/InsetUrl.cpp +++ b/src/insets/InsetUrl.cpp @@ -58,7 +58,7 @@ docstring const InsetUrl::getScreenLabel(Buffer const &) const int InsetUrl::latex(Buffer const &, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { docstring const & name = getParam("name"); if (!name.empty()) @@ -71,7 +71,7 @@ int InsetUrl::latex(Buffer const &, odocstream & os, int InsetUrl::plaintext(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { odocstringstream oss; @@ -88,11 +88,11 @@ int InsetUrl::plaintext(Buffer const &, odocstream & os, int InsetUrl::docbook(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { - os << "<ulink url=\"" + os << "<ulink url=\"" << subst(getParam("target"), from_ascii("&"), from_ascii("&")) - << "\">" + << "\">" << getParam("name") << "</ulink>"; return 0; diff --git a/src/insets/InsetUrl.h b/src/insets/InsetUrl.h index bb72b2a6cf..af99115441 100644 --- a/src/insets/InsetUrl.h +++ b/src/insets/InsetUrl.h @@ -39,13 +39,13 @@ public: DisplayType display() const { return Inline; } /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// the string that is passed to the TOC virtual int textString(Buffer const &, odocstream &, OutputParams const &) const; diff --git a/src/insets/InsetVSpace.cpp b/src/insets/InsetVSpace.cpp index 70b9d6abb2..e4be451014 100644 --- a/src/insets/InsetVSpace.cpp +++ b/src/insets/InsetVSpace.cpp @@ -204,7 +204,7 @@ void InsetVSpace::draw(PainterInfo & pi, int x, int y) const int InsetVSpace::latex(Buffer const & buf, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << from_ascii(space_.asLatexCommand(buf.params())) << '\n'; return 1; @@ -212,7 +212,7 @@ int InsetVSpace::latex(Buffer const & buf, odocstream & os, int InsetVSpace::plaintext(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << "\n\n"; return PLAINTEXT_NEWLINE; @@ -220,7 +220,7 @@ int InsetVSpace::plaintext(Buffer const &, odocstream & os, int InsetVSpace::docbook(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { os << '\n'; return 1; diff --git a/src/insets/InsetVSpace.h b/src/insets/InsetVSpace.h index daaa02f713..97b53f529d 100644 --- a/src/insets/InsetVSpace.h +++ b/src/insets/InsetVSpace.h @@ -34,13 +34,13 @@ public: void draw(PainterInfo & pi, int x, int y) const; /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// void read(Buffer const &, Lexer & lex); /// diff --git a/src/insets/InsetWrap.cpp b/src/insets/InsetWrap.cpp index 10d12d0967..45a5d8ebdf 100644 --- a/src/insets/InsetWrap.cpp +++ b/src/insets/InsetWrap.cpp @@ -179,7 +179,7 @@ docstring const InsetWrap::editMessage() const int InsetWrap::latex(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << "\\begin{floating" << from_ascii(params_.type) << '}'; if (!params_.placement.empty()) @@ -192,7 +192,7 @@ int InsetWrap::latex(Buffer const & buf, odocstream & os, int InsetWrap::plaintext(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { os << '[' << buf.B_("wrap") << ' ' << floatName(params_.type, buf.params()) << ":\n"; InsetText::plaintext(buf, os, runparams); @@ -203,10 +203,10 @@ int InsetWrap::plaintext(Buffer const & buf, odocstream & os, int InsetWrap::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { - // FIXME UNICODE - os << '<' << from_ascii(params_.type) << '>'; + // FIXME UNICODE + os << '<' << from_ascii(params_.type) << '>'; int const i = InsetText::docbook(buf, os, runparams); os << "</" << from_ascii(params_.type) << '>'; return i; diff --git a/src/insets/InsetWrap.h b/src/insets/InsetWrap.h index 13619f6afe..c2ec7d9716 100644 --- a/src/insets/InsetWrap.h +++ b/src/insets/InsetWrap.h @@ -54,13 +54,13 @@ public: Inset::Code lyxCode() const { return Inset::WRAP_CODE; } /// int latex(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// virtual docstring const editMessage() const; /// diff --git a/src/insets/RenderBase.h b/src/insets/RenderBase.h index 098614e249..d56a4ffc12 100644 --- a/src/insets/RenderBase.h +++ b/src/insets/RenderBase.h @@ -42,7 +42,7 @@ public: /// render state, exact meaning of state is render-specific void setRenderState(int state) { state_ = state; } /// get render state - int renderState() const { return state_; } + int renderState() const { return state_; } /// equivalent to dynamic_cast virtual RenderButton * asButton() { return 0; } diff --git a/src/insets/RenderButton.cpp b/src/insets/RenderButton.cpp index a861acc539..6a8372f77c 100644 --- a/src/insets/RenderButton.cpp +++ b/src/insets/RenderButton.cpp @@ -49,7 +49,7 @@ bool RenderButton::metrics(MetricsInfo &, Dimension & dim) const font.decSize(); frontend::FontMetrics const & fm = theFontMetrics(font); - + if (editable_) fm.buttonText(text_, dim.wid, dim.asc, dim.des); else diff --git a/src/insets/RenderGraphic.cpp b/src/insets/RenderGraphic.cpp index d305024192..3e9232edf2 100644 --- a/src/insets/RenderGraphic.cpp +++ b/src/insets/RenderGraphic.cpp @@ -157,7 +157,7 @@ bool RenderGraphic::metrics(MetricsInfo & mi, Dimension & dim) const msgFont.setFamily(Font::SANS_FAMILY); // FIXME UNICODE - docstring const justname = + docstring const justname = from_utf8(onlyFilename(params_.filename.absFilename())); if (!justname.empty()) { msgFont.setSize(Font::SIZE_FOOTNOTE); diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 1db6322b49..ebfa51968e 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -134,7 +134,7 @@ bool searchAllowed(BufferView * bv, docstring const & str) { if (str.empty()) { frontend::Alert::error(_("Search error"), - _("Search string is empty")); + _("Search string is empty")); return false; } return bv->buffer(); @@ -184,8 +184,8 @@ int replaceAll(BufferView * bv, int striked = ssize - cur.paragraph().eraseChars(pos, pos + ssize, buf.params().trackChanges); cur.paragraph().insert(pos, replacestr, font, - Change(buf.params().trackChanges ? - Change::INSERTED : Change::UNCHANGED)); + Change(buf.params().trackChanges ? + Change::INSERTED : Change::UNCHANGED)); for (int i = 0; i < rsize + striked; ++i) cur.forwardChar(); ++num; @@ -357,7 +357,7 @@ bool findNextChange(BufferView * bv) } // avoid crash (assertion violation) if the imaginary end-of-par - // character of the last paragraph of the document is marked as changed + // character of the last paragraph of the document is marked as changed if (cur == et) { cur = ok; } diff --git a/src/mathed/InsetFormulaMacro.cpp b/src/mathed/InsetFormulaMacro.cpp index 1a64d33af4..6e5b65a7ec 100644 --- a/src/mathed/InsetFormulaMacro.cpp +++ b/src/mathed/InsetFormulaMacro.cpp @@ -76,7 +76,7 @@ void InsetFormulaMacro::write(Buffer const &, ostream & os) const int InsetFormulaMacro::latex(Buffer const &, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { //lyxerr << "InsetFormulaMacro::latex" << endl; WriteStream wi(os, runparams.moving_arg, true); @@ -86,7 +86,7 @@ int InsetFormulaMacro::latex(Buffer const &, odocstream & os, int InsetFormulaMacro::plaintext(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { odocstringstream oss; WriteStream wi(oss, false, true); @@ -99,7 +99,7 @@ int InsetFormulaMacro::plaintext(Buffer const &, odocstream & os, int InsetFormulaMacro::docbook(Buffer const & buf, ostream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { return plaintext(buf, os, runparams); } diff --git a/src/mathed/InsetFormulaMacro.h b/src/mathed/InsetFormulaMacro.h index 55b3176159..db33b839dc 100644 --- a/src/mathed/InsetFormulaMacro.h +++ b/src/mathed/InsetFormulaMacro.h @@ -45,13 +45,13 @@ public: void write(Buffer const &, std::ostream & os) const; /// int latex(Buffer const &, odocstream & os, - OutputParams const &) const; + OutputParams const &) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// std::auto_ptr<Inset> clone() const; diff --git a/src/mathed/InsetMath.cpp b/src/mathed/InsetMath.cpp index 89f1f20538..fe22ce7825 100644 --- a/src/mathed/InsetMath.cpp +++ b/src/mathed/InsetMath.cpp @@ -84,7 +84,7 @@ void InsetMath::write(WriteStream & os) const int InsetMath::plaintext(Buffer const &, odocstream &, - OutputParams const &) const + OutputParams const &) const { // all math plain text output shall take place in InsetMathHull BOOST_ASSERT(false); @@ -128,8 +128,8 @@ void InsetMath::mathematica(MathematicaStream & os) const void InsetMath::mathmlize(MathStream & os) const { - NormalStream ns(os.os()); - normalize(ns); + NormalStream ns(os.os()); + normalize(ns); } diff --git a/src/mathed/InsetMath.h b/src/mathed/InsetMath.h index 934ea1f60e..eaf6a40af9 100644 --- a/src/mathed/InsetMath.h +++ b/src/mathed/InsetMath.h @@ -184,7 +184,7 @@ public: /// plain text output in ucs4 encoding int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// dump content to stderr for debugging virtual void dump() const; diff --git a/src/mathed/InsetMathBig.cpp b/src/mathed/InsetMathBig.cpp index 13d8a3686c..3c5950b69c 100644 --- a/src/mathed/InsetMathBig.cpp +++ b/src/mathed/InsetMathBig.cpp @@ -85,7 +85,7 @@ void InsetMathBig::draw(PainterInfo & pi, int x, int y) const docstring const delim = (delim_ == "\\|") ? from_ascii("Vert") : (delim_ == "\\\\") ? from_ascii("\\") : support::ltrim(delim_, "\\"); mathed_draw_deco(pi, x + 1, y - dim_.ascent(), 4, dim_.height(), - delim); + delim); setPosCache(pi, x, y); } diff --git a/src/mathed/InsetMathDelim.cpp b/src/mathed/InsetMathDelim.cpp index 7e03e24afe..af612d5e9f 100644 --- a/src/mathed/InsetMathDelim.cpp +++ b/src/mathed/InsetMathDelim.cpp @@ -31,7 +31,7 @@ static docstring convertDelimToLatexName(docstring const & name) { if (name.size() == 1) { char_type const c = name[0]; - if (c == '<' || c == '(' || c == '[' || c == '.' + if (c == '<' || c == '(' || c == '[' || c == '.' || c == '>' || c == ')' || c == ']' || c == '/' || c == '|') return name; } diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp index 6ba3d797b0..f1663aea79 100644 --- a/src/mathed/InsetMathFrac.cpp +++ b/src/mathed/InsetMathFrac.cpp @@ -79,22 +79,22 @@ void InsetMathFrac::draw(PainterInfo & pi, int x, int y) const int m = x + dim_.wid / 2; FracChanger dummy(pi.base); if (kind_ == NICEFRAC) { - cell(0).draw(pi, x + 2, + cell(0).draw(pi, x + 2, y - cell(0).descent() - 5); cell(1).draw(pi, x + cell(0).width() + 5, y + cell(1).ascent() / 2); - pi.pain.line(x + cell(0).width(), - y + dim_.des - 2, - x + cell(0).width() + 5, + pi.pain.line(x + cell(0).width(), + y + dim_.des - 2, + x + cell(0).width() + 5, y - dim_.asc + 2, Color::math); } else { - cell(0).draw(pi, m - cell(0).width() / 2, + cell(0).draw(pi, m - cell(0).width() / 2, y - cell(0).descent() - 2 - 5); cell(1).draw(pi, m - cell(1).width() / 2, y + cell(1).ascent() + 2 - 5); } if (kind_ == FRAC || kind_ == OVER) - pi.pain.line(x + 1, y - 5, + pi.pain.line(x + 1, y - 5, x + dim_.wid - 2, y - 5, Color::math); drawMarkers(pi, x, y); } diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 2c17d3e8dd..5f874f4469 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -340,7 +340,7 @@ void InsetMathHull::draw(PainterInfo & pi, int x, int y) const // background of mathed under focus is not painted because // selection at the top level of nested inset is difficult to handle. if (!editing(pi.base.bv)) - pi.pain.fillRectangle(x + 1, y - ascent() + 1, width() - 2, + pi.pain.fillRectangle(x + 1, y - ascent() + 1, width() - 2, ascent() + descent() - 1, Color::mathbg); if (use_preview_) { @@ -1328,7 +1328,7 @@ void InsetMathHull::edit(Cursor & cur, bool left) left ? idxFirst(cur) : idxLast(cur); // The inset formula dimension is not necessarily the same as the // one of the instant preview image, so we have to indicate to the - // BufferView that a metrics update is needed. + // BufferView that a metrics update is needed. cur.updateFlags(Update::Force); } @@ -1446,7 +1446,7 @@ void InsetMathHull::read(Buffer const &, Lexer & lex) int InsetMathHull::plaintext(Buffer const &, odocstream & os, - OutputParams const &) const + OutputParams const &) const { if (0 && display()) { Dimension dim; @@ -1471,7 +1471,7 @@ int InsetMathHull::plaintext(Buffer const &, odocstream & os, int InsetMathHull::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { MathStream ms(os); int res = 0; diff --git a/src/mathed/InsetMathHull.h b/src/mathed/InsetMathHull.h index 92375e193e..7afdc0eb1b 100644 --- a/src/mathed/InsetMathHull.h +++ b/src/mathed/InsetMathHull.h @@ -104,10 +104,10 @@ public: void read(Buffer const &, Lexer & lex); /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// int docbook(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// the string that is passed to the TOC virtual void textString(Buffer const &, odocstream &) const; diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index 9d2f839786..188fa3a525 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -1427,7 +1427,7 @@ bool InsetMathNest::interpretString(Cursor & cur, docstring const & str) } -bool InsetMathNest::script(Cursor & cur, bool up, +bool InsetMathNest::script(Cursor & cur, bool up, docstring const & save_selection) { // Hack to get \^ and \_ working diff --git a/src/mathed/InsetMathRef.cpp b/src/mathed/InsetMathRef.cpp index 501e67b979..2c2bd8517d 100644 --- a/src/mathed/InsetMathRef.cpp +++ b/src/mathed/InsetMathRef.cpp @@ -152,7 +152,7 @@ void InsetMathRef::validate(LaTeXFeatures & features) const int InsetMathRef::docbook(Buffer const & buf, odocstream & os, - OutputParams const & runparams) const + OutputParams const & runparams) const { if (cell(1).empty()) { os << "<xref linkend=\"" diff --git a/src/mathed/InsetMathScript.cpp b/src/mathed/InsetMathScript.cpp index ebb90bad29..3773f1dcc8 100644 --- a/src/mathed/InsetMathScript.cpp +++ b/src/mathed/InsetMathScript.cpp @@ -340,7 +340,7 @@ void InsetMathScript::draw(PainterInfo & pi, int x, int y) const else { nuc().setXY(*pi.base.bv, x + dxx(), y); if (editing(pi.base.bv)) - pi.draw(x + dxx(), y, char_type('.')); + pi.draw(x + dxx(), y, char_type('.')); } ScriptChanger dummy(pi.base); if (hasUp()) diff --git a/src/mathed/MacroTable.h b/src/mathed/MacroTable.h index 1909c04de4..25664a1820 100644 --- a/src/mathed/MacroTable.h +++ b/src/mathed/MacroTable.h @@ -47,7 +47,7 @@ public: /// is it being drawn? bool locked() const { return lockCount_ != 0; } /// - void unlock() const { --lockCount_; BOOST_ASSERT(lockCount_ >= 0); } + void unlock() const { --lockCount_; BOOST_ASSERT(lockCount_ >= 0); } /// bool operator==(MacroData const & x) const { @@ -58,7 +58,7 @@ public: } /// bool operator!=(MacroData const & x) const { return !operator==(x); } - + private: /// docstring def_; diff --git a/src/mathed/MathData.h b/src/mathed/MathData.h index f2cde1223f..6f890a017d 100644 --- a/src/mathed/MathData.h +++ b/src/mathed/MathData.h @@ -159,7 +159,7 @@ public: int sshift() const { return sshift_; } /// superscript kerning int kerning() const { return kerning_; } - /// + /// void swap(MathData & ar) { base_type::swap(ar); } protected: diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index ba1c34a37f..a2dc9cea2d 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -33,18 +33,18 @@ using std::endl; using std::vector; -/// This class is the value of a macro argument, technically +/// This class is the value of a macro argument, technically /// a wrapper of the cells of MathMacro. class MathMacroArgumentValue : public InsetMath { public: /// - MathMacroArgumentValue(MathMacro const & mathMacro, size_t idx) + MathMacroArgumentValue(MathMacro const & mathMacro, size_t idx) : mathMacro_(mathMacro), idx_(idx) {} /// bool metrics(MetricsInfo & mi, Dimension & dim) const; /// void draw(PainterInfo &, int x, int y) const; - + private: std::auto_ptr<Inset> doClone() const; MathMacro const & mathMacro_; @@ -52,13 +52,13 @@ private: }; -auto_ptr<Inset> MathMacroArgumentValue::doClone() const +auto_ptr<Inset> MathMacroArgumentValue::doClone() const { return auto_ptr<Inset>(new MathMacroArgumentValue(*this)); } -bool MathMacroArgumentValue::metrics(MetricsInfo & mi, Dimension & dim) const +bool MathMacroArgumentValue::metrics(MetricsInfo & mi, Dimension & dim) const { // unlock outer macro in arguments, and lock it again later MacroData const & macro = MacroTable::globalMacros().get(mathMacro_.name()); @@ -73,7 +73,7 @@ bool MathMacroArgumentValue::metrics(MetricsInfo & mi, Dimension & dim) const } -void MathMacroArgumentValue::draw(PainterInfo & pi, int x, int y) const +void MathMacroArgumentValue::draw(PainterInfo & pi, int x, int y) const { // unlock outer macro in arguments, and lock it again later MacroData const & macro = MacroTable::globalMacros().get(mathMacro_.name()); @@ -118,10 +118,10 @@ bool MathMacro::metrics(MetricsInfo & mi, Dimension & dim) const mathed_string_dim(mi.base.font, "Unknown: " + name(), dim); } else { MacroData const & macro = MacroTable::globalMacros().get(name()); - + if (macroBackup_ != macro) updateExpansion(); - + if (macro.locked()) { mathed_string_dim(mi.base.font, "Self reference: " + name(), dim); } else if (editing(mi.base.bv)) { @@ -161,11 +161,11 @@ void MathMacro::draw(PainterInfo & pi, int x, int y) const drawStrRed(pi, x, y, "Unknown: " + name()); } else { MacroData const & macro = MacroTable::globalMacros().get(name()); - + // warm up cache for (size_t i = 0; i < nargs(); ++i) cell(i).setXY(*pi.base.bv, x, y); - + if (macro.locked()) { // FIXME UNICODE drawStrRed(pi, x, y, "Self reference: " + name()); @@ -194,8 +194,8 @@ void MathMacro::draw(PainterInfo & pi, int x, int y) const expanded_.draw(pi, x, y); macro.unlock(); } - - // edit mode changed? + + // edit mode changed? if (editing_ != editing(pi.base.bv) || macroBackup_ != macro) pi.base.bv->cursor().updateFlags(Update::Force); } @@ -240,14 +240,14 @@ Inset * MathMacro::editXY(Cursor & cur, int x, int y) } -bool MathMacro::idxFirst(Cursor & cur) const +bool MathMacro::idxFirst(Cursor & cur) const { cur.updateFlags(Update::Force); return InsetMathNest::idxFirst(cur); } -bool MathMacro::idxLast(Cursor & cur) const +bool MathMacro::idxLast(Cursor & cur) const { cur.updateFlags(Update::Force); return InsetMathNest::idxLast(cur); @@ -285,10 +285,10 @@ void MathMacro::octave(OctaveStream & os) const void MathMacro::updateExpansion() const { MacroData const & macro = MacroTable::globalMacros().get(name()); - + // create MathMacroArgumentValue object pointing to the cells of the macro vector<MathData> values(nargs()); - for (size_t i = 0; i != nargs(); ++i) + for (size_t i = 0; i != nargs(); ++i) values[i].insert(0, MathAtom(new MathMacroArgumentValue(*this, i))); macro.expand(values, expanded_); asArray(macro.def(), tmpl_); diff --git a/src/mathed/MathMacroArgument.cpp b/src/mathed/MathMacroArgument.cpp index d1735f1544..eb3d86a86d 100644 --- a/src/mathed/MathMacroArgument.cpp +++ b/src/mathed/MathMacroArgument.cpp @@ -32,7 +32,7 @@ MathMacroArgument::MathMacroArgument(size_t n) lyxerr << "MathMacroArgument::MathMacroArgument: wrong Argument id: " << n << endl; } - // The profiler tells us not to use + // The profiler tells us not to use // str_ = '#' + convert<docstring>(n); // so we do the conversion of n to ASCII manually. // This works because 1 <= n <= 9. diff --git a/src/mathed/MathMacroTemplate.cpp b/src/mathed/MathMacroTemplate.cpp index 8ae135a132..e6e439163b 100644 --- a/src/mathed/MathMacroTemplate.cpp +++ b/src/mathed/MathMacroTemplate.cpp @@ -123,10 +123,10 @@ bool MathMacroTemplate::metrics(MetricsInfo & mi, Dimension & dim) const + theFontMetrics(mi.base.font).width(dp); dim.asc = std::max(cell(0).ascent(), cell(1).ascent()) + 7; dim.des = std::max(cell(0).descent(), cell(1).descent()) + 7; - + if (lockMacro) MacroTable::globalMacros().get(name_).unlock(); - + if (dim_ == dim) return false; dim_ = dim; @@ -139,7 +139,7 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const bool lockMacro = MacroTable::globalMacros().has(name_); if (lockMacro) MacroTable::globalMacros().get(name_).lock(); - + setPosCache(p, x, y); // label @@ -180,7 +180,7 @@ void MathMacroTemplate::draw(PainterInfo & p, int x, int y) const cell(1).draw(pi, x + 8 + w0, y + 1); pi.pain.rectangle(x + w0 + 6, y - dim_.ascent() + 3, w1 + 4, dim_.height() - 6, Color::mathline); - + if (lockMacro) MacroTable::globalMacros().get(name_).unlock(); } @@ -236,7 +236,7 @@ void MathMacroTemplate::write(WriteStream & os) const int MathMacroTemplate::plaintext(Buffer const & buf, odocstream & os, - OutputParams const &) const + OutputParams const &) const { static docstring const str = '[' + buf.B_("math macro") + ']'; diff --git a/src/mathed/MathMacroTemplate.h b/src/mathed/MathMacroTemplate.h index 7dd81890a9..c24fd16f80 100644 --- a/src/mathed/MathMacroTemplate.h +++ b/src/mathed/MathMacroTemplate.h @@ -46,7 +46,7 @@ public: void write(WriteStream & os) const; /// int plaintext(Buffer const &, odocstream &, - OutputParams const &) const; + OutputParams const &) const; /// Number of arguments int numargs() const; diff --git a/src/mathed/MathParser.cpp b/src/mathed/MathParser.cpp index 3ce4770b59..255dbadc9e 100644 --- a/src/mathed/MathParser.cpp +++ b/src/mathed/MathParser.cpp @@ -292,7 +292,7 @@ ostream & operator<<(ostream & os, Token const & t) docstring const & cs = t.cs(); // FIXME: For some strange reason, the stream operator instanciate // a new Token before outputting the contents of t.cs(). - // Because of this the line + // Because of this the line // os << '\\' << cs; // below becomes recursive. // In order to avoid that we return early: diff --git a/src/output_docbook.cpp b/src/output_docbook.cpp index bcef420524..83f2e40295 100644 --- a/src/output_docbook.cpp +++ b/src/output_docbook.cpp @@ -319,7 +319,7 @@ void docbookParagraphs(ParagraphList const & paragraphs, const_cast<OutputParams&>(runparams).par_begin = 0; const_cast<OutputParams&>(runparams).par_end = 0; } - + while (par != pend) { Layout_ptr const & style = par->layout(); ParagraphList::const_iterator lastpar = par; diff --git a/src/output_latex.cpp b/src/output_latex.cpp index 96502ccb62..10a4191c03 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -315,7 +315,7 @@ TeXOnePar(Buffer const & buf, pit->getFontSettings(bparams, i).language()->encoding(); if (encoding->package() == Encoding::inputenc && switchEncoding(os, bparams, false, - *(runparams.encoding), *encoding) > 0) { + *(runparams.encoding), *encoding) > 0) { runparams.encoding = encoding; os << '\n'; texrow.newline(); @@ -569,7 +569,7 @@ void latexParagraphs(Buffer const & buf, par = TeXOnePar(buf, paragraphs, par, os, texrow, runparams, everypar); } else if (layout->isEnvironment() || - !par->params().leftIndent().zero()) { + !par->params().leftIndent().zero()) { par = TeXEnvironment(buf, paragraphs, par, os, texrow, runparams); } else { @@ -599,8 +599,8 @@ void latexParagraphs(Buffer const & buf, int switchEncoding(odocstream & os, BufferParams const & bparams, - bool moving_arg, Encoding const & oldEnc, - Encoding const & newEnc) + bool moving_arg, Encoding const & oldEnc, + Encoding const & newEnc) { if ((bparams.inputenc != "auto" || moving_arg) && bparams.inputenc != "default") diff --git a/src/output_latex.h b/src/output_latex.h index 70045d304f..f108f1b360 100644 --- a/src/output_latex.h +++ b/src/output_latex.h @@ -27,8 +27,8 @@ class TexRow; /// Export up to \p number optarg insets int latexOptArgInsets(Buffer const & buf, Paragraph const & par, - odocstream & os, OutputParams const & runparams, - int number); + odocstream & os, OutputParams const & runparams, + int number); /** Export \p paragraphs of buffer \p buf to LaTeX. Don't use a temporary stringstream for \p os if the final output is @@ -45,8 +45,8 @@ void latexParagraphs(Buffer const & buf, /// Switch the encoding of \p os from \p oldEnc to \p newEnc if needed. /// \return the number of characters written to \p os. int switchEncoding(odocstream & os, BufferParams const & bparams, - bool moving_arg, Encoding const & oldEnc, - Encoding const & newEnc); + bool moving_arg, Encoding const & oldEnc, + Encoding const & newEnc); } // namespace lyx diff --git a/src/paragraph_funcs.cpp b/src/paragraph_funcs.cpp index cbac6caee1..66ff44d749 100644 --- a/src/paragraph_funcs.cpp +++ b/src/paragraph_funcs.cpp @@ -118,7 +118,7 @@ void breakParagraph(BufferParams const & bparams, // Move over the end-of-par change information tmp->setChange(tmp->size(), par.lookupChange(par.size())); par.setChange(par.size(), Change(bparams.trackChanges ? - Change::INSERTED : Change::UNCHANGED)); + Change::INSERTED : Change::UNCHANGED)); if (pos) { // Make sure that we keep the language when @@ -171,7 +171,7 @@ void breakParagraphConservative(BufferParams const & bparams, // Move over the end-of-par change information tmp.setChange(tmp.size(), par.lookupChange(par.size())); par.setChange(par.size(), Change(bparams.trackChanges ? - Change::INSERTED : Change::UNCHANGED)); + Change::INSERTED : Change::UNCHANGED)); } } diff --git a/src/rowpainter.cpp b/src/rowpainter.cpp index 1d17a3b5ac..5f0f6c5330 100644 --- a/src/rowpainter.cpp +++ b/src/rowpainter.cpp @@ -205,15 +205,15 @@ void RowPainter::paintInset(pos_type const pos, Font const & font) int const w = max_witdh_ - leftMargin() - right_margin; MetricsInfo mi(&bv_, font, w); inset->metrics(mi, dim); - if (inset->width() > dim.wid) + if (inset->width() > dim.wid) lyxerr << "Error: inset " << to_ascii(inset->getInsetName()) << " draw width " << inset->width() << "> metrics width " << dim.wid << "." << std::endl; - if (inset->ascent() > dim.asc) + if (inset->ascent() > dim.asc) lyxerr << "Error: inset " << to_ascii(inset->getInsetName()) << " draw ascent " << inset->ascent() << "> metrics ascent " << dim.asc << "." << std::endl; - if (inset->descent() > dim.des) + if (inset->descent() > dim.des) lyxerr << "Error: inset " << to_ascii(inset->getInsetName()) << " draw ascent " << inset->descent() << "> metrics descent " << dim.des << "." << std::endl; @@ -337,7 +337,7 @@ void RowPainter::paintChars(pos_type & vpos, Font const & font, * Arabic characters, but rather paint them one at a time. * See also http://thread.gmane.org/gmane.editors.lyx.devel/79740 */ - if (hebrew) + if (hebrew) break; /* FIXME: these checks are irrelevant, since 'arabic' and @@ -670,11 +670,11 @@ void RowPainter::paintLast() FontMetrics const & fm = theFontMetrics(bv_.buffer()->params().getFont()); int const length = fm.maxAscent() / 2; Color::color col = par_.isInserted(par_.size()) ? Color::addedtext : Color::deletedtext; - + pain_.line(int(x_) + 1, yo_ + 2, int(x_) + 1, yo_ + 2 - length, col, - Painter::line_solid, Painter::line_thick); + Painter::line_solid, Painter::line_thick); pain_.line(int(x_) + 1 - length, yo_ + 2, int(x_) + 1, yo_ + 2, col, - Painter::line_solid, Painter::line_thick); + Painter::line_solid, Painter::line_thick); } // draw an endlabel @@ -775,7 +775,7 @@ void RowPainter::paintText() // We also don't paint across things like tables if (running_strikeout && (highly_editable_inset || !is_struckout)) { // Calculate 1/3 height of the buffer's default font - FontMetrics const & fm + FontMetrics const & fm = theFontMetrics(bv_.buffer()->params().getFont()); int const middle = yo_ - fm.maxAscent() / 3; pain_.line(last_strikeout_x, middle, int(x_), middle, @@ -833,7 +833,7 @@ void RowPainter::paintText() // if we reach the end of a struck out range, paint it if (running_strikeout) { // calculate 1/3 height of the buffer's default font - FontMetrics const & fm + FontMetrics const & fm = theFontMetrics(bv_.buffer()->params().getFont()); int const middle = yo_ - fm.maxAscent() / 3; pain_.line(last_strikeout_x, middle, int(x_), middle, @@ -887,7 +887,7 @@ bool inNarrowInset(PainterInfo & pi) for (int i = cur.depth() - 1; --i >= 0; ) { Inset * const in = &cur[i].inset(); if (in) { - InsetText * t = + InsetText * t = const_cast<InsetText *>(in->asTextInset()); if (t) return !t->wide(); @@ -928,7 +928,7 @@ void paintPar bool cursor_on_row = CursorOnRow(pi, pit, rit, text); bool in_inset_alone_on_row = innerCursorOnRow(pi, pit, rit, text); - bool leftEdgeFixed = + bool leftEdgeFixed = (par.getAlign() == LYX_ALIGN_LEFT || par.getAlign() == LYX_ALIGN_BLOCK); bool inNarrowIns = inNarrowInset(pi); @@ -964,7 +964,7 @@ void paintPar // Clear background of this row // (if paragraph background was not cleared) if (!repaintAll && - (!(in_inset_alone_on_row && leftEdgeFixed) + (!(in_inset_alone_on_row && leftEdgeFixed) || row_has_changed)) { pi.pain.fillRectangle(x, y - rit->ascent(), rp.maxWidth(), rit->height(), @@ -990,7 +990,7 @@ void paintPar rp.paintChangeBar(); if (rit == rb) rp.paintFirst(); - rp.paintText(); + rp.paintText(); if (rit + 1 == re) rp.paintLast(); } @@ -1015,7 +1015,7 @@ void paintText(BufferView & bv, Text & text = buffer.text(); bool const select = bv.cursor().selection(); ViewMetricsInfo const & vi = bv.viewMetricsInfo(); - + PainterInfo pi(const_cast<BufferView *>(&bv), pain); // Should the whole screen, including insets, be refreshed? // FIXME: We should also distinguish DecorationUpdate to avoid text @@ -1062,7 +1062,7 @@ void paintTextInset(Text const & text, PainterInfo & pi, int x, int y) // This flag cannot be set from within same inset: bool repaintAll = refreshInside; for (int pit = 0; pit < int(text.paragraphs().size()); ++pit) { - ParagraphMetrics const & pmi + ParagraphMetrics const & pmi = pi.base.bv->parMetrics(&text, pit); y += pmi.ascent(); paintPar(pi, text, pit, x, y, repaintAll); diff --git a/src/sgml.cpp b/src/sgml.cpp index a9fc1ca848..ff84339a37 100644 --- a/src/sgml.cpp +++ b/src/sgml.cpp @@ -181,7 +181,7 @@ docstring sgml::cleanID(Buffer const & buf, OutputParams const & runparams, void sgml::openTag(odocstream & os, string const & name, string const & attribute) { - // FIXME UNICODE + // FIXME UNICODE // This should be fixed in layout files later. string param = subst(attribute, "<", "\""); param = subst(param, ">", "\""); diff --git a/src/support/FileName.cpp b/src/support/FileName.cpp index 247cdd4fa2..b8cd5b3c43 100644 --- a/src/support/FileName.cpp +++ b/src/support/FileName.cpp @@ -177,8 +177,8 @@ string const DocFileName::mangledFilename(std::string const & dir) const // On windows it is not possible to create files with '<', '>' or '?' // in the name. static string const keep = "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "+,-0123456789;="; + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "+,-0123456789;="; string::size_type pos = 0; while ((pos = mname.find_first_not_of(keep, pos)) != string::npos) mname[pos++] = '_'; diff --git a/src/support/docstream.cpp b/src/support/docstream.cpp index 48f3e88712..c2193c8273 100644 --- a/src/support/docstream.cpp +++ b/src/support/docstream.cpp @@ -47,7 +47,7 @@ public: in_cd_ = iconv_open(ucs4_codeset, encoding.c_str()); if (in_cd_ == (iconv_t)(-1)) { fprintf(stderr, "Error %d returned from iconv_open(in_cd_): %s\n", - errno, strerror(errno)); + errno, strerror(errno)); fflush(stderr); throw lyx::iconv_codecvt_facet_exception(); } @@ -57,7 +57,7 @@ public: out_cd_ = iconv_open(encoding.c_str(), ucs4_codeset); if (out_cd_ == (iconv_t)(-1)) { fprintf(stderr, "Error %d returned from iconv_open(out_cd_): %s\n", - errno, strerror(errno)); + errno, strerror(errno)); fflush(stderr); throw lyx::iconv_codecvt_facet_exception(); } @@ -70,13 +70,13 @@ protected: if (in_cd_ != (iconv_t)(-1)) if (iconv_close(in_cd_) == -1) { fprintf(stderr, "Error %d returned from iconv_close(in_cd_): %s\n", - errno, strerror(errno)); + errno, strerror(errno)); fflush(stderr); } if (out_cd_ != (iconv_t)(-1)) if (iconv_close(out_cd_) == -1) { fprintf(stderr, "Error %d returned from iconv_close(out_cd_): %s\n", - errno, strerror(errno)); + errno, strerror(errno)); fflush(stderr); } } @@ -94,9 +94,9 @@ protected: &inbytesleft, &to_next, &outbytesleft); if (retval == base::error) { fprintf(stderr, - "Error %d returned from iconv when converting from %s to %s: %s\n", - errno, ucs4_codeset, encoding_.c_str(), - strerror(errno)); + "Error %d returned from iconv when converting from %s to %s: %s\n", + errno, ucs4_codeset, encoding_.c_str(), + strerror(errno)); fputs("Converted input:", stderr); for (intern_type const * i = from; i < from_next; ++i) { unsigned int const c = *i; @@ -144,9 +144,9 @@ protected: &outbytesleft); if (retval == base::error) { fprintf(stderr, - "Error %d returned from iconv when converting from %s to %s: %s\n", - errno, encoding_.c_str(), ucs4_codeset, - strerror(errno)); + "Error %d returned from iconv when converting from %s to %s: %s\n", + errno, encoding_.c_str(), ucs4_codeset, + strerror(errno)); fputs("Converted input:", stderr); for (extern_type const * i = from; i < from_next; ++i) { // extern_type may be signed, avoid output of @@ -262,9 +262,9 @@ idocfstream::idocfstream(string const & encoding) : base() imbue(locale); } - + idocfstream::idocfstream(const char* s, std::ios_base::openmode mode, - string const & encoding) + string const & encoding) : base() { // We must imbue the stream before openening the file @@ -284,7 +284,7 @@ odocfstream::odocfstream(string const & encoding) : base() odocfstream::odocfstream(const char* s, std::ios_base::openmode mode, - string const & encoding) + string const & encoding) : base() { // We must imbue the stream before openening the file diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp index 14b3ece1cf..8fc53ae1a4 100644 --- a/src/support/filetools.cpp +++ b/src/support/filetools.cpp @@ -245,7 +245,7 @@ vector<FileName> const dirList(FileName const & dir, string const & ext) // Returns the real name of file name in directory path, with optional // extension ext. FileName const fileSearch(string const & path, string const & name, - string const & ext, search_mode mode) + string const & ext, search_mode mode) { // if `name' is an absolute path, we ignore the setting of `path' // Expand Environmentvariables in 'name' @@ -327,7 +327,7 @@ FileName const i18nLibFileSearch(string const & dir, string const & name, token(l, '_', 0) + '_' + name, ext); if (!tmpold.empty()) { - lyxerr << "i18nLibFileSearch: File `" << tmpold + lyxerr << "i18nLibFileSearch: File `" << tmpold << "' has been found by the old method" <<endl; return tmpold; } @@ -356,7 +356,7 @@ string const libScriptSearch(string const & command_in, quote_style style) (command.size() - start_script) : pos2 - start_script; // Does this script file exist? - string const script = + string const script = libFileSearch(".", command.substr(start_script, size_script)).absFilename(); if (script.empty()) { @@ -999,7 +999,7 @@ docstring const makeDisplayPath(string const & path, unsigned int threshold) // If file is from LyXDir, display it as if it were relative. string const system = package().system_support().absFilename(); if (prefixIs(str, system) && str != system) - return from_utf8("[" + str.erase(0, system.length()) + "]"); + return from_utf8("[" + str.erase(0, system.length()) + "]"); // replace /home/blah with ~/ string const home = package().home_dir().absFilename(); @@ -1145,7 +1145,7 @@ FileName const findtexfile(string const & fil, string const & /*format*/) << '\'' << endl; if (c.first != -1) return FileName(os::internal_path(rtrim(to_utf8(from_filesystem8bit(c.second)), - "\n\r"))); + "\n\r"))); else return FileName(); } diff --git a/src/support/filetools.h b/src/support/filetools.h index 25c3a35e21..c8872ebce1 100644 --- a/src/support/filetools.h +++ b/src/support/filetools.h @@ -224,7 +224,7 @@ std::string const unzippedFileName(std::string const & zipped_file); Will overwrite an already existing unzipped file without warning. */ FileName const unzipFile(FileName const & zipped_file, - std::string const & unzipped_file = std::string()); + std::string const & unzipped_file = std::string()); /// Returns true is path is absolute bool absolutePath(std::string const & path); diff --git a/src/support/fs_extras.cpp b/src/support/fs_extras.cpp index 2dc84339c0..de2f272514 100644 --- a/src/support/fs_extras.cpp +++ b/src/support/fs_extras.cpp @@ -109,9 +109,9 @@ void copy_file(path const & source, path const & target, bool noclobber) int err = errno; ::close(infile); boost::throw_exception(filesystem_path_error( - "boost::filesystem::copy_file", - source, target, - fs::lookup_errno(err))); + "boost::filesystem::copy_file", + source, target, + fs::lookup_errno(err))); } int const flags = O_WRONLY | O_CREAT | (noclobber ? O_EXCL : O_TRUNC); @@ -148,8 +148,8 @@ void copy_file(path const & source, path const & target, bool noclobber) int err = errno; - ::close(infile); - ::close(outfile); + ::close(infile); + ::close(outfile); if (in == -1 || out == -1) boost::throw_exception( @@ -173,4 +173,3 @@ void copy_file(path const & source, path const & target, bool noclobber) } } - diff --git a/src/support/kill.cpp b/src/support/kill.cpp index af346799fd..f3ee53dd2c 100644 --- a/src/support/kill.cpp +++ b/src/support/kill.cpp @@ -30,7 +30,7 @@ namespace lyx { int support::kill(int pid, int sig) { #ifdef _WIN32 - if (pid == (int)GetCurrentProcessId()) + if (pid == (int)GetCurrentProcessId()) return -raise(sig); HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid); if (!hProcess) { diff --git a/src/support/lstrings.cpp b/src/support/lstrings.cpp index de206d0084..cb0d82b7b0 100644 --- a/src/support/lstrings.cpp +++ b/src/support/lstrings.cpp @@ -714,7 +714,7 @@ string const rsplit(string const & a, string & piece, char delim) docstring const escape(docstring const & lab) { char_type hexdigit[16] = { '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; docstring enc; for (docstring::size_type i = 0; i < lab.length(); ++i) { char_type c = lab[i]; @@ -779,14 +779,14 @@ getVectorFromStringT(String const & str, String const & delim) vector<string> const getVectorFromString(string const & str, - string const & delim) + string const & delim) { return getVectorFromStringT<string>(str, delim); } vector<docstring> const getVectorFromString(docstring const & str, - docstring const & delim) + docstring const & delim) { return getVectorFromStringT<docstring>(str, delim); } diff --git a/src/support/lyxlib.h b/src/support/lyxlib.h index 0b7469794a..b7859b9e99 100644 --- a/src/support/lyxlib.h +++ b/src/support/lyxlib.h @@ -36,7 +36,7 @@ bool chmod(FileName const & file, unsigned long int mode); bool rename(FileName const & from, FileName const & to); /// copy a file, returns false it it fails bool copy(FileName const & from, FileName const & to, - unsigned long int mode = (unsigned long int)-1); + unsigned long int mode = (unsigned long int)-1); /// generates a checksum of a file unsigned long sum(FileName const & file); /// FIXME: some point to this hmm ? diff --git a/src/support/os_cygwin.cpp b/src/support/os_cygwin.cpp index 886711e89b..7f5c22d982 100644 --- a/src/support/os_cygwin.cpp +++ b/src/support/os_cygwin.cpp @@ -22,7 +22,7 @@ #include <windows.h> #include <io.h> #include <windef.h> -#include <shellapi.h> +#include <shellapi.h> #include <shlwapi.h> #include <sys/cygwin.h> @@ -154,7 +154,7 @@ void os::init(int, char *[]) if (var == "TEMP") temp_seen = true; - + if (GetEnvironmentVariable(var.c_str(), curval, 2) == 0 && GetLastError() == ERROR_ENVVAR_NOT_FOUND) { /* Convert to Windows style where necessary */ @@ -329,7 +329,7 @@ void addFontResources() #ifdef X_DISPLAY_MISSING // Windows only: Add BaKoMa TrueType font resources string const fonts_dir = addPath(package().system_support().absFilename(), "fonts"); - + for (int i = 0 ; i < num_fonts_truetype ; ++i) { string const font_current = to_local8bit(from_utf8(convert_path( addName(fonts_dir, win_fonts_truetype[i] + ".ttf"), @@ -345,7 +345,7 @@ void restoreFontResources() #ifdef X_DISPLAY_MISSING // Windows only: Remove BaKoMa TrueType font resources string const fonts_dir = addPath(package().system_support().absFilename(), "fonts"); - + for(int i = 0 ; i < num_fonts_truetype ; ++i) { string const font_current = to_local8bit(from_utf8(convert_path( addName(fonts_dir, win_fonts_truetype[i] + ".ttf"), diff --git a/src/support/os_unix.cpp b/src/support/os_unix.cpp index 0378e369a3..b580a99fd3 100644 --- a/src/support/os_unix.cpp +++ b/src/support/os_unix.cpp @@ -135,7 +135,7 @@ bool canAutoOpenFile(string const & ext, auto_open_mode const mode) (void)mode; LSRolesMask role = kLSRolesAll; FSRef outAppRef; - OSStatus status = + OSStatus status = LSGetApplicationForInfo(kLSUnknownType, kLSUnknownCreator, cfs_ext, role, &outAppRef, NULL); CFRelease(cfs_ext); @@ -158,11 +158,11 @@ bool autoOpenFile(string const & filename, auto_open_mode const mode) #ifdef __APPLE__ // Reference: http://developer.apple.com/documentation/Carbon/Reference/LaunchServicesReference/ FSRef fileref; - OSStatus status = + OSStatus status = FSPathMakeRef((UInt8 *) filename.c_str(), &fileref, NULL); if (status != 0) return false; - + // this is what we would like to do but it seems that the // viewer for PDF is often quicktime... //LSRolesMask role = (mode == VIEW) ? kLSRolesViewer : kLSRolesEditor; @@ -183,7 +183,7 @@ bool autoOpenFile(string const & filename, auto_open_mode const mode) inLaunchSpec.asyncRefCon = NULL; status = LSOpenFromRefSpec(&inLaunchSpec, NULL); - return status != kLSApplicationNotFoundErr; + return status != kLSApplicationNotFoundErr; #else // silence compiler warnings (void)filename; diff --git a/src/support/os_win32.cpp b/src/support/os_win32.cpp index 80e60e6811..662693466a 100644 --- a/src/support/os_win32.cpp +++ b/src/support/os_win32.cpp @@ -53,7 +53,7 @@ #include <direct.h> // _getdrive #include <shlobj.h> // SHGetFolderPath #include <windef.h> -#include <shellapi.h> +#include <shellapi.h> #include <shlwapi.h> // Must define SHGFP_TYPE_CURRENT for older versions of MinGW. @@ -144,7 +144,7 @@ void init(int /* argc */, char * argv[]) * shell scripts failed, for mysterious reasons... * * I've chosen for now, therefore, to simply add Ruurd's original - * code as-is. A wrapper program hidecmd.c has been added to + * code as-is. A wrapper program hidecmd.c has been added to * development/Win32 which hides the console window of lyx when * lyx is invoked as a parameter of hidecmd.exe. */ @@ -407,7 +407,7 @@ void addFontResources() { // Windows only: Add BaKoMa TrueType font resources string const fonts_dir = addPath(package().system_support().absFilename(), "fonts"); - + for (int i = 0 ; i < num_fonts_truetype ; ++i) { string const font_current = addName(fonts_dir, win_fonts_truetype[i] + ".ttf"); @@ -420,7 +420,7 @@ void restoreFontResources() { // Windows only: Remove BaKoMa TrueType font resources string const fonts_dir = addPath(package().system_support().absFilename(), "fonts"); - + for(int i = 0 ; i < num_fonts_truetype ; ++i) { string const font_current = addName(fonts_dir, win_fonts_truetype[i] + ".ttf"); diff --git a/src/support/qstring_helpers.cpp b/src/support/qstring_helpers.cpp index f6e8efdb7b..724e58b066 100644 --- a/src/support/qstring_helpers.cpp +++ b/src/support/qstring_helpers.cpp @@ -26,7 +26,7 @@ QString const toqstr(docstring const & str) { // This does not properly convert surrogate pairs QString s; - int i = static_cast<int>(str.size()); + int i = static_cast<int>(str.size()); s.resize(i); for (; --i >= 0;) s[i] = ucs4_to_qchar(str[i]); diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 1efb58ba74..ade15f3f18 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -1025,7 +1025,7 @@ void fix_relative_filename(string & name) // FIXME UNICODE encoding of name may be wrong (makeAbsPath expects // utf8) name = to_utf8(makeRelPath(from_utf8(makeAbsPath(name, getMasterFilePath()).absFilename()), - from_utf8(getParentFilePath()))); + from_utf8(getParentFilePath()))); } @@ -1193,7 +1193,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, check_space(p, os, context); else if (t.character() == '[' && noweb_mode && - p.next_token().character() == '[') { + p.next_token().character() == '[') { // These can contain underscores p.putback(); string const s = p.getFullOpt() + ']'; @@ -1425,8 +1425,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, eat_whitespace(p, os, context, false); string name = p.get_token().cs(); eat_whitespace(p, os, context, false); - - // parameter text + + // parameter text bool simple = true; string paramtext; int arity = 0; @@ -1435,7 +1435,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, // # found p.get_token(); paramtext += "#"; - + // followed by number? if (p.next_token().cat() == catOther) { char c = p.getChar(); @@ -1452,7 +1452,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, simple = false; } } - + // only output simple (i.e. compatible) macro as FormulaMacros string ert = "\\def\\" + name + ' ' + paramtext + '{' + p.verbatim_item() + '}'; if (simple) { @@ -2155,7 +2155,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, } else if (t.cs() == "i" || t.cs() == "j" || t.cs() == "l" || - t.cs() == "L") { + t.cs() == "L") { context.check_layout(os); os << "\\i \\" << t.cs() << "{}\n"; skip_braces(p); // eat {} @@ -2304,7 +2304,7 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, string const ert = name + '{' + command + '}' + opt1 + opt2 + '{' + p.verbatim_item() + '}'; - + if (opt2.empty()) { context.check_layout(os); begin_inset(os, "FormulaMacro"); diff --git a/src/toc.cpp b/src/toc.cpp index 301fa389d0..1cb974941e 100644 --- a/src/toc.cpp +++ b/src/toc.cpp @@ -88,7 +88,7 @@ void outline(OutlineOp mode, Cursor & cur) } case Down: { // Go down out of current header: - if (finish != end) + if (finish != end) ++finish; // Find next same-level header: for (; finish != end; ++finish) {