]> git.lyx.org Git - lyx.git/commitdiff
better fix to #7239. Actually the whole switch and kaboodle (see r37229) is needed...
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 25 Jan 2011 11:22:47 +0000 (11:22 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 25 Jan 2011 11:22:47 +0000 (11:22 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37322 a592a061-630c-0410-9148-cb99ea01b6c8

INSTALL
config/lyxinclude.m4
src/output_latex.cpp

diff --git a/INSTALL b/INSTALL
index 13ce2cb15a35c7992f98e106737d8d8b06481534..987b76a45ea7569db72ba1636486dcd089f5792d 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -103,20 +103,21 @@ to create the Makefile by typing
 
   ./configure
 
-For more complicated cases, LyX configure takes the following specific
+For more complicated cases, LyX configure honors the following specific
 flags:
 
   o --enable-build-type=[rel(ease), dev(elopment), pre(release)]
     allows to tweak the compiled code. The following table describes
     the settings in terms of various options that are described later
 
-                      release   prerelease  development
-    optimization        -O2         -O2         -O
+                      release   prerelease  development gprof
+    optimization        -O2         -O2         -O       -O2
     assertions                       X           X
     stdlib-debug                                 X
     concept-checks                   X           X
     warnings                         X           X
-    debug                            X           X
+    debug                            X           X         X
+    gprof                                                  X
 
     The default are as follows in terms of version number
     release: stable release (1.x.y)
index 20b7f94817feca212ab32d3e47794f009a9bcc3a..d1836acd2abe2743399646df14ad398666549692 100644 (file)
@@ -19,6 +19,8 @@ AC_ARG_ENABLE(build-type,
           build_type=development;;
     pre*) lyx_prerelease=yes
           build_type=prerelease;;
+    gp*)  lyx_profiling=yes
+          build_type=gprof;;
     rel*) ;;
     *) AC_ERROR([Bad build type specification \"$enableval\". Please use one of dev(elopment), rel(ease) or pre(release)]);;
    esac],
@@ -188,7 +190,7 @@ fi
 ### We might want to disable debug
 AC_ARG_ENABLE(debug,
   AC_HELP_STRING([--enable-debug],[enable debug information]),,
-  [ if test $lyx_devel_version = yes -o $lyx_prerelease = yes ; then
+  [ if test $lyx_devel_version = yes -o $lyx_prerelease = yes -o $lyx_profiling = yes ; then
        enable_debug=yes;
     else
        enable_debug=no;
@@ -212,7 +214,11 @@ AC_ARG_ENABLE(concept-checks,
 
 AC_ARG_ENABLE(gprof,
   AC_HELP_STRING([--enable-gprof],[enable profiling using gprof]),,
-  enable_gprof=no;)
+  [if test $build_type = gprof ; then
+      enable_gprof=yes;
+    else
+      enable_gprof=no;
+    fi;])
 
 ### set up optimization
 AC_ARG_ENABLE(optimization,
index 14014f4c1a6f5628a23220a8085a641e124110f3..0bf0ad8d4ed974c01bc3d84d991ccda7874019bb 100644 (file)
@@ -380,6 +380,40 @@ int latexArgInsets(Paragraph const & par, odocstream & os,
        return lines;
 }
 
+namespace {
+
+// output the proper paragraph start according to latextype.
+void parStartCommand(Paragraph const & par, odocstream & os, TexRow & texrow,
+                    OutputParams const & runparams,Layout const & style) 
+{
+       switch (style.latextype) {
+       case LATEX_COMMAND:
+               os << '\\' << from_ascii(style.latexname());
+
+               // Separate handling of optional argument inset.
+               if (style.optargs != 0 || style.reqargs != 0) {
+                       int ret = latexArgInsets(par, os, runparams, style.reqargs, style.optargs);
+                       while (ret > 0) {
+                               texrow.newline();
+                               --ret;
+                       }
+               }
+               else
+                       os << from_ascii(style.latexparam());
+               break;
+       case LATEX_ITEM_ENVIRONMENT:
+       case LATEX_LIST_ENVIRONMENT:
+               os << "\\item ";
+               break;
+       case LATEX_BIB_ENVIRONMENT:
+               // ignore this, the inset will write itself
+               break;
+       default:
+               break;
+       }
+}
+
+} // namespace anon
 
 // FIXME: this should be anonymous
 void TeXOnePar(Buffer const & buf,
@@ -444,23 +478,18 @@ void TeXOnePar(Buffer const & buf,
 
        if (style.pass_thru) {
                Font const outerfont = text.outerFont(pit);
-               // can we have pass_thru for lists? if so, we need to do the whole
-               // switch and kaboodle here.
-               os << '\\' << from_ascii(style.latexname());
+               parStartCommand(par, os, texrow,runparams, style);
 
-               // Separate handling of optional argument inset.
-               if (style.optargs != 0 || style.reqargs != 0) {
-                       int ret = latexArgInsets(par, os, runparams, style.reqargs, style.optargs);
-                       while (ret > 0) {
-                               texrow.newline();
-                               --ret;
-                       }
-               }
-               else
-                       os << from_ascii(style.latexparam());
                par.latex(bparams, outerfont, os, texrow, runparams, start_pos,
                        end_pos);
-               os << from_ascii("}\n");
+
+               // I did not create a parEndCommand for this minuscule
+               // task because in the other user of parStartCommand
+               // the code is different (JMarc)
+               if (style.isCommand())
+                       os << from_ascii("}\n");
+               else
+                       os << from_ascii("\n");
                texrow.newline();
                if (!style.parbreak_is_newline) {
                        os << '\n';
@@ -687,31 +716,7 @@ void TeXOnePar(Buffer const & buf,
                }
        }
 
-       switch (style.latextype) {
-       case LATEX_COMMAND:
-               os << '\\' << from_ascii(style.latexname());
-
-               // Separate handling of optional argument inset.
-               if (style.optargs != 0 || style.reqargs != 0) {
-                       int ret = latexArgInsets(par, os, runparams, style.reqargs, style.optargs);
-                       while (ret > 0) {
-                               texrow.newline();
-                               --ret;
-                       }
-               }
-               else
-                       os << from_ascii(style.latexparam());
-               break;
-       case LATEX_ITEM_ENVIRONMENT:
-       case LATEX_LIST_ENVIRONMENT:
-               os << "\\item ";
-               break;
-       case LATEX_BIB_ENVIRONMENT:
-               // ignore this, the inset will write itself
-               break;
-       default:
-               break;
-       }
+       parStartCommand(par, os, texrow,runparams, style);
 
        Font const outerfont = text.outerFont(pit);