]> git.lyx.org Git - features.git/commit
Introduce a wrapper class for odocstream to help ensuring that no
authorEnrico Forestieri <forenr@lyx.org>
Sat, 29 Jan 2011 02:41:13 +0000 (02:41 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Sat, 29 Jan 2011 02:41:13 +0000 (02:41 +0000)
commit1ef605f6254ef3f3b8cec5440a2e67e6f23a707b
tree1ec8fa4f7f0a83bbe846efe6da9fe20403d617d1
parent021618142fe7730b8c603f43feef04367a60ce1e
Introduce a wrapper class for odocstream to help ensuring that no
blank lines may be inadvertently output. This is achieved by using two
special iomanip-like variables (breakln and safebreakln) in the lyx::
namespace. When they are inserted in the stream, a newline is output
only if not already at the beginning of a line. The difference between
breakln and safebreakln is that, if needed, the former outputs '\n'
and the latter "%\n".
In future, the new class will also be used for counting the number of
newlines issued. Even if the infractrure for doing that is already in
place, the counting is essentially still done the old way.
There are still places in the code where the functionality of the
class could be used, most probably. ATM, it is used for InsetTabular,
InsetListings, InsetFloat, and InsetText.
The Comment and GreyedOut insets required a special treatment and a
new InsetLayout parameter (Display) has been introduced. The default
for Display is "true", meaning that the corresponding latex
environment is of "display" type, i.e., it stands on its own, whereas
"false" means that the contents appear inline with the text. The
latter is the case for both Comment and GreyedOut insets.
Mostly, the only visible effects on latex exports should be the
disappearing of some redundant % chars and the appearing/disappearing
of null {} latex groups after a comment or lyxgreyedout environments
(they are related to the presence or absence of a space immediately
after those environments), as well as the fact that math environments
are now started on their own lines.
As a last thing, only the latex code between \begin{document} and
\end{document} goes through the new class, the preamble being directly
output through odocstream, as usual.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37360 a592a061-630c-0410-9148-cb99ea01b6c8
89 files changed:
lib/layouts/stdinsets.inc
src/Buffer.cpp
src/Changes.cpp
src/Changes.h
src/Font.cpp
src/Font.h
src/LaTeXFeatures.cpp
src/Paragraph.cpp
src/Paragraph.h
src/frontends/qt4/FindAndReplace.cpp
src/insets/Inset.h
src/insets/InsetArgument.cpp
src/insets/InsetArgument.h
src/insets/InsetBibtex.cpp
src/insets/InsetBibtex.h
src/insets/InsetBox.cpp
src/insets/InsetBox.h
src/insets/InsetBranch.cpp
src/insets/InsetBranch.h
src/insets/InsetCaption.cpp
src/insets/InsetCaption.h
src/insets/InsetCitation.cpp
src/insets/InsetCitation.h
src/insets/InsetCommand.cpp
src/insets/InsetCommand.h
src/insets/InsetExternal.cpp
src/insets/InsetExternal.h
src/insets/InsetFloat.cpp
src/insets/InsetFloat.h
src/insets/InsetFloatList.cpp
src/insets/InsetFloatList.h
src/insets/InsetFoot.cpp
src/insets/InsetFoot.h
src/insets/InsetGraphics.cpp
src/insets/InsetGraphics.h
src/insets/InsetHyperlink.cpp
src/insets/InsetHyperlink.h
src/insets/InsetInclude.cpp
src/insets/InsetInclude.h
src/insets/InsetIndex.cpp
src/insets/InsetIndex.h
src/insets/InsetLayout.cpp
src/insets/InsetLayout.h
src/insets/InsetLine.cpp
src/insets/InsetLine.h
src/insets/InsetListings.cpp
src/insets/InsetListings.h
src/insets/InsetNewline.cpp
src/insets/InsetNewline.h
src/insets/InsetNewpage.cpp
src/insets/InsetNewpage.h
src/insets/InsetNomencl.cpp
src/insets/InsetNomencl.h
src/insets/InsetNote.cpp
src/insets/InsetNote.h
src/insets/InsetPhantom.cpp
src/insets/InsetPhantom.h
src/insets/InsetPreview.cpp
src/insets/InsetQuotes.cpp
src/insets/InsetQuotes.h
src/insets/InsetRef.cpp
src/insets/InsetRef.h
src/insets/InsetScript.cpp
src/insets/InsetScript.h
src/insets/InsetSpace.cpp
src/insets/InsetSpace.h
src/insets/InsetSpecialChar.cpp
src/insets/InsetSpecialChar.h
src/insets/InsetTabular.cpp
src/insets/InsetTabular.h
src/insets/InsetText.cpp
src/insets/InsetText.h
src/insets/InsetVSpace.cpp
src/insets/InsetVSpace.h
src/insets/InsetWrap.cpp
src/insets/InsetWrap.h
src/lyxfind.cpp
src/mathed/InsetFormulaMacro.cpp
src/mathed/InsetFormulaMacro.h
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathMBox.cpp
src/mathed/InsetMathMBox.h
src/mathed/InsetMathNest.cpp
src/mathed/InsetMathNest.h
src/mathed/MathFactory.cpp
src/output_latex.cpp
src/output_latex.h
src/support/docstream.cpp
src/support/docstream.h