]> git.lyx.org Git - features.git/commitdiff
Remove InsetGraphics noUnzip parameter
authorGeorg Baum <baum@lyx.org>
Thu, 16 Jul 2015 18:44:47 +0000 (20:44 +0200)
committerGeorg Baum <baum@lyx.org>
Thu, 16 Jul 2015 18:44:47 +0000 (20:44 +0200)
Being able to compile document with zipped .eps files was a useful feature of
the graphicxs package 20 years ago, but the LyX support is no longer relevant:
- The flag is ignored if preview is on
- If pdflatex is used then uncompressing happens during the compilation anyway
- If set, the flag prevents LyX from issuing proper error messages if
something with the image is wrong
- For hard disk capacities from 20 years ago not uncompressing is a useful
feature, but for current hard disk capacities it does not matter
- The external inset does not have it, and if we want to merge both insets
one day we would need to implement it there, which is even more difficult
than in InsetGraphics

28 files changed:
development/FORMAT
lib/doc/EmbeddedObjects.lyx
lib/doc/UserGuide.lyx
lib/doc/id/UserGuide.lyx
lib/lyx2lyx/LyX.py
lib/lyx2lyx/lyx_2_2.py
src/frontends/qt4/GuiGraphics.cpp
src/frontends/qt4/ui/GraphicsUi.ui
src/insets/InsetGraphics.cpp
src/insets/InsetGraphicsParams.cpp
src/insets/InsetGraphicsParams.h
src/tex2lyx/test/CJK.lyx.lyx
src/tex2lyx/test/CJKutf8.lyx.lyx
src/tex2lyx/test/DummyDocument.lyx.lyx
src/tex2lyx/test/Dummy~Document.lyx.lyx
src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
src/tex2lyx/test/algo2e.lyx.lyx
src/tex2lyx/test/box-color-size-space-align.lyx.lyx
src/tex2lyx/test/test-insets-basic.lyx.lyx
src/tex2lyx/test/test-insets.lyx.lyx
src/tex2lyx/test/test-memoir.lyx.lyx
src/tex2lyx/test/test-modules.lyx.lyx
src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
src/tex2lyx/test/test-scr.lyx.lyx
src/tex2lyx/test/test-structure.lyx.lyx
src/tex2lyx/test/test.lyx.lyx
src/tex2lyx/test/verbatim.lyx.lyx
src/version.h

index 770ceaa40dd47cdb9a3f3c64288d339456316f1c..f1a513a9e099a72e8406597655cb2dd76b1305b4 100644 (file)
@@ -11,6 +11,10 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx.
 
 -----------------------
 
+2015-07-16 Georg Baum  <Georg.Baum@post.rwth-aachen.de>
+       * Format incremented to 496
+         Remove noUnzip parameter of InsetGraphics
+
 2015-05-24 Jürgen Spitzmüller <spitz@lyx.org>
        * Format incremented to 495: Rename sub: refprefix to subsec: in order
           to prevent clash of \\subref command with subfloat package.
index 94502877ed37196a762ee3408179ad2a0638c810..33180fd35b8742b2188f49384f83be5b1cc85bd5 100644 (file)
@@ -603,88 +603,6 @@ mode
 \begin_inset Newline newline
 \end_inset
 
-The 
-\family sans
-Don't
-\begin_inset space ~
-\end_inset
-
-unzip
-\begin_inset space ~
-\end_inset
-
-on
-\begin_inset space ~
-\end_inset
-
-export
-\family default
- option only affects zipped EPS-graphics, e.
-\begin_inset space \thinspace{}
-\end_inset
-
-g.
-\begin_inset space \space{}
-\end_inset
-
-
-\emph on
-x.eps.gz
-\emph default
-.
- When the option is used the images will not be unzipped on export, since
- \SpecialChar LaTeX
- can handle them as they are.
-\begin_inset Newline newline
-\end_inset
-
-Zipped EPS-graphics are useful to save disk space when you choose PostScript
- as output format, see appendix
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset CommandInset ref
-LatexCommand ref
-reference "sec:PostScript"
-
-\end_inset
-
-.
- To zip EPS-graphics, use the following commands in a UNIX-shell or a Windows
- console:
-\begin_inset Newline newline
-\end_inset
-
-
-\series bold
-gzip x.eps
-\series default
-
-\begin_inset Newline newline
-\end_inset
-
-
-\series bold
-zgrep %%Bounding x.eps.gz > x.eps.bb
-\series default
-
-\begin_inset Newline newline
-\end_inset
-
-The second command creates the bounding box file 
-\begin_inset Quotes eld
-\end_inset
-
-x.eps.bb
-\begin_inset Quotes erd
-\end_inset
-
- that is needed by \SpecialChar LaTeX
- for zipped graphics.
-\begin_inset Newline newline
-\end_inset
-
 In the section 
 \family sans
 Graphics
index 9facac2600353b09976cebcb2019f5017ffa33a9..12cd21d7eec8e93302941453ee8ac3ded7858e60 100644 (file)
@@ -18355,35 +18355,6 @@ mode
 \family default
  has the effect that the image doesn't appear in the output, only a frame
  with the image size is printed.
- The option 
-\family sans
-Don't
-\begin_inset space ~
-\end_inset
-
-unzip
-\begin_inset space ~
-\end_inset
-
-on
-\begin_inset space ~
-\end_inset
-
-export
-\family default
- is explained in the 
-\emph on
-Embedded
-\begin_inset space ~
-\end_inset
-
-Objects
-\emph default
- manual in section 
-\emph on
-Graphics Dialog
-\emph default
-.
 \end_layout
 
 \begin_layout Standard
index 505f0c38e0beb9e0bd7912a3ab862b28125f96d7..0817500d16e1020ba093ea542b8bf7e3b153af6a 100644 (file)
@@ -17110,31 +17110,6 @@ mode
 \family default
  has the effect that the image doesn't appear in the output, only a frame
  with the image size is printed.
- The option 
-\family sans
-Don't
-\begin_inset space ~
-\end_inset
-
-unzip
-\begin_inset space ~
-\end_inset
-
-on
-\begin_inset space ~
-\end_inset
-
-export
-\family default
- is explained in the 
-\emph on
-Embedded Objects
-\emph default
- manual in section 
-\emph on
-Graphics Dialog
-\emph default
-.
 \end_layout
 
 \begin_layout Standard
index 73818fa827557f1492dcf405823f4b15576b6c1b..1beccdba1b018c53cca401196dbc8e1cd30d2523 100644 (file)
@@ -85,7 +85,7 @@ format_relation = [("0_06",    [200], minor_versions("0.6" , 4)),
                    ("1_6", list(range(277,346)), minor_versions("1.6" , 10)),
                    ("2_0", list(range(346,414)), minor_versions("2.0" , 8)),
                    ("2_1", list(range(414,475)), minor_versions("2.1" , 0)),
-                   ("2_2", list(range(475,496)), minor_versions("2.2" , 0))
+                   ("2_2", list(range(475,497)), minor_versions("2.2" , 0))
                   ]
 
 ####################################################################
index 65b1268538df071f024588ddf7c43cfc403296db..aa13aa63b88ad971f95066983ad70584f1a2ffa3 100644 (file)
@@ -1505,6 +1505,28 @@ def revert_subref(document):
         i += 1
 
 
+def convert_nounzip(document):
+    " remove the noUnzip parameter of graphics insets "
+
+    rx = re.compile(r'\s*noUnzip\s*$')
+    i = 0
+    while True:
+        i = find_token(document.body, "\\begin_inset Graphics", i)
+        if i == -1:
+            break
+        j = find_end_of_inset(document.body, i)
+        if j == -1:
+            document.warning("Malformed LyX document: Can't find end of graphics inset at line " + str(i))
+            i += 1
+            continue
+
+        k = find_re(document.body, rx, i, j)
+        if k != -1:
+          del document.body[k]
+          j = j - 1
+        i = j + 1
+
+
 ##
 # Conversion hub
 #
@@ -1534,10 +1556,12 @@ convert = [
            [492, [convert_colorbox]],
            [493, []],
            [494, []],
-           [495, [convert_subref]]
+           [495, [convert_subref]],
+           [496, [convert_nounzip]]
           ]
 
 revert =  [
+           [495, []], # nothing to do since the noUnzip parameter was optional
            [494, [revert_subref]],
            [493, [revert_jss]],
            [492, [revert_mathmulticol]],
index 04f768567f82b0fbaa44490d3dd6b1bbc0965eba..979cd2774e5c5f8ef81de455d4c66f7985a26e80 100644 (file)
@@ -196,8 +196,6 @@ GuiGraphics::GuiGraphics(GuiView & lv)
                this, SLOT(change_adaptor()));
        connect(draftCB, SIGNAL(stateChanged(int)),
                this, SLOT(change_adaptor()));
-       connect(unzipCB, SIGNAL(stateChanged(int)),
-               this, SLOT(change_adaptor()));
        // FIXME: we should connect to clicked() when we move to Qt 4.2 because
        // the toggled(bool) signal is also trigged when we update the widgets
        // (rgh-4/07) this isn't as much or a problem as it was, because we're now
@@ -223,11 +221,9 @@ GuiGraphics::GuiGraphics(GuiView & lv)
        bc().addReadOnly(filenameL);
        bc().addReadOnly(filename);
        bc().addReadOnly(browsePB);
-       bc().addReadOnly(unzipCB);
        bc().addReadOnly(bbFrame);
        bc().addReadOnly(draftCB);
        bc().addReadOnly(clip);
-       bc().addReadOnly(unzipCB);
        bc().addReadOnly(displayGB);
        bc().addReadOnly(sizeGB);
        bc().addReadOnly(rotationGB);
@@ -582,7 +578,6 @@ void GuiGraphics::paramsToDialog(InsetGraphicsParams const & igp)
        // Update the draft and clip mode
        draftCB->setChecked(igp.draft);
        clip->setChecked(igp.clip);
-       unzipCB->setChecked(igp.noUnzip);
        displayGB->setChecked(igp.display);
        displayscale->setText(toqstr(convert<string>(igp.lyxscale)));
 
@@ -732,7 +727,6 @@ void GuiGraphics::applyView()
                igp.keepAspectRatio = aspectratio->isChecked();
        }
 
-       igp.noUnzip = unzipCB->isChecked();
        igp.lyxscale = displayscale->text().toInt();
        igp.rotateAngle = widgetToDoubleStr(angle);
 
index 5ee064c2a3c0702bde7d48cfcf821be2908e082f..3942651e83b03b2fdbc6ac38ef454aafe00b4b83 100644 (file)
        <property name="spacing" >
         <number>6</number>
        </property>
-       <item row="2" column="0" colspan="3" >
-        <widget class="QCheckBox" name="unzipCB" >
-         <property name="toolTip" >
-          <string>Don't uncompress image before exporting to LaTeX</string>
-         </property>
-         <property name="text" >
-          <string>Don't un&amp;zip on export</string>
-         </property>
-        </widget>
-       </item>
        <item row="0" column="2" >
         <spacer>
          <property name="orientation" >
   <tabstop>getPB</tabstop>
   <tabstop>latexoptions</tabstop>
   <tabstop>draftCB</tabstop>
-  <tabstop>unzipCB</tabstop>
   <tabstop>displayGB</tabstop>
  </tabstops>
  <includes>
index 25726690f8fa23247a2af4e2e873247fa1eab208..b3293ce37c8c48312a210a1bf2371e71577518b6 100644 (file)
@@ -627,44 +627,7 @@ string InsetGraphics::prepareFile(OutputParams const & runparams) const
        // determine the export format
        string const tex_format = flavor2format(runparams.flavor);
 
-       // If the file is compressed and we have specified that it
-       // should not be uncompressed, then just return its name and
-       // let LaTeX do the rest!
        if (formats.isZippedFile(params().filename)) {
-               if (params().noUnzip) {
-                       // We don't know whether latex can actually handle
-                       // this file, but we can't check, because that would
-                       // mean to unzip the file and thereby making the
-                       // noUnzip parameter meaningless.
-                       LYXERR(Debug::GRAPHICS, "\tpass zipped file to LaTeX.");
-
-                       FileName const bb_orig_file =
-                               FileName(changeExtension(orig_file, "bb"));
-                       if (runparams.nice) {
-                               runparams.exportdata->addExternalFile(tex_format,
-                                               bb_orig_file,
-                                               changeExtension(output_file, "bb"));
-                       } else {
-                               // LaTeX needs the bounding box file in the
-                               // tmp dir
-                               FileName bb_file =
-                                       FileName(changeExtension(temp_file.absFileName(), "bb"));
-                               boost::tie(status, bb_file) =
-                                       copyFileIfNeeded(bb_orig_file, bb_file);
-                               if (status == FAILURE)
-                                       return orig_file;
-                               runparams.exportdata->addExternalFile(tex_format,
-                                               bb_file);
-                       }
-                       runparams.exportdata->addExternalFile(tex_format,
-                                       source_file, output_file);
-                       runparams.exportdata->addExternalFile("dvi",
-                                       source_file, output_file);
-                       // We can't strip the extension, because we don't know
-                       // the unzipped file format
-                       return latex_path(output_file, EXCLUDE_EXTENSION);
-               }
-
                FileName const unzipped_temp_file =
                        FileName(unzippedFileName(temp_file.absFileName()));
                output_file = unzippedFileName(output_file);
index f4cd119f6e34ffd762e24c1bf3b8ce52d8a2ced4..1a03fdd3919b0f0a041a2222f28863d4080eb996 100644 (file)
@@ -70,7 +70,6 @@ void InsetGraphicsParams::init()
        height = Length();
        keepAspectRatio = false;        // for LaTeX output
        draft = false;                  // draft mode
-       noUnzip = false;                // unzip files
        scaleBeforeRotation = false;    // scale image before rotating
 
        bb = string();                  // bounding box
@@ -93,7 +92,6 @@ void InsetGraphicsParams::copy(InsetGraphicsParams const & igp)
        height = igp.height;
        keepAspectRatio = igp.keepAspectRatio;
        draft = igp.draft;
-       noUnzip = igp.noUnzip;
        scaleBeforeRotation = igp.scaleBeforeRotation;
 
        bb = igp.bb;
@@ -117,7 +115,6 @@ bool operator==(InsetGraphicsParams const & left,
            left.height == right.height &&
            left.keepAspectRatio == right.keepAspectRatio &&
            left.draft == right.draft &&
-           left.noUnzip == right.noUnzip &&
            left.scaleBeforeRotation == right.scaleBeforeRotation &&
 
            left.bb == right.bb &&
@@ -160,8 +157,6 @@ void InsetGraphicsParams::Write(ostream & os, Buffer const & buffer) const
                os << "\tkeepAspectRatio\n";
        if (draft)                      // draft mode
                os << "\tdraft\n";
-       if (noUnzip)
-               os << "\tnoUnzip\n";
        if (scaleBeforeRotation)
                os << "\tscaleBeforeRotation\n";
 
@@ -209,8 +204,6 @@ bool InsetGraphicsParams::Read(Lexer & lex, string const & token, string const &
                keepAspectRatio = true;
        } else if (token == "draft") {
                draft = true;
-       } else if (token == "noUnzip") {
-               noUnzip = true;
        } else if (token == "scaleBeforeRotation") {
                scaleBeforeRotation = true;
        } else if (token == "BoundingBox") {
index 33471bf64392fa12bff8cbd14ae622820b8fc3c6..4e40dd703f9aae374562b411e9f5607c340c003f 100644 (file)
@@ -48,8 +48,6 @@ public:
        bool keepAspectRatio;
        /// draft mode
        bool draft;
-       /// what to do with zipped files
-       bool noUnzip;
        /// scale image before rotating
        bool scaleBeforeRotation;
 
index c1087e09ac3bd8925f5940c54f6cc30bce6f8e26..3c3dfff96e581bfd90a42ef01b0a124be1667ce1 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index 4eb58a75657a84de3613c33cc05abe98c05a945f..0e75b843f5ebf15a89601d75001d0cd0b7afca81 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index bc23e3aa56299fa7f72b18840abad4591b3a7be8..422680732f94f70ba3ecc5c05f145fac100d06d6 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index 7a00ca908a30ef7c812d3555b9beb1b927c0f825..1286c36946207cf170ced0ff935f2b6db3e1ff4f 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index 5e843d11697a1aebd9453aef22cb26aad471ae7b..18d89eb0fc9c23363396f5ebb12956a20953b6c7 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index a8b2c406b7864d973aaecaa1d1659a8e4830b768..580743dd63c0f94df20db77c60343a6908f72c73 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index 70a523cffbd459d74220a5c8e329959826093e02..ece2d4e9c45e9c7d32f2e617d4753d2e029f2836 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index e3b1ddc242a000181185f18e071f31d473b37a8d..a87825cb0de1aabb7189fd2f4614e369fa27aba9 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index 23a82b77ff3a8ecb9312f4e7c07e04b67ebc748f..392f1248d13cefdb4bcc006886687a60d7df3e3e 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index 70896f49207b90b1eff45d4199574caa3c1da476..624d75a5f7254e6d91db7c2fe77dfa18eded91da 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index f661dcffa431afb05df1f258396256a294563f9e..4220eff9ad32a105bf9de39f1b38e6f0d94803ae 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index 63e553f3afb4cbda742a978fa9b29453b00c5a92..bce3f15e3a72e5353294f75d3a7a82f63d94cd68 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index cca36f991254da8ce3caee234a51e36d7b5d71d9..9802206cbd6cca4fea472560acddd1050bb23c47 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index 3205f4223298edc6b191b1913203a16efdf21565..ed6345481748ddaf277373ad639d5917f70638ad 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index 6bcceaf1710d00ab1a14ac69334b348d2afd8152..380fec7c46a7cab195c1ffbe77e99977f50bba80 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index bee461c2912de33f0a105ba468ba873fddeac86e..cac06b293e43a1ad819fd6fb6cb128bb49c80763 100644 (file)
@@ -1,5 +1,5 @@
 #LyX file created by tex2lyx 2.2
-\lyxformat 495
+\lyxformat 496
 \begin_document
 \begin_header
 \origin roundtrip
index 79ea6cc9017eb3d761547444a3b58dc83a158cbf..4caaf1ce9885497cb06690e6f7361ebb66118dc2 100644 (file)
@@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 495 // spitz: subsection ref prefix change
-#define LYX_FORMAT_TEX2LYX 495
+#define LYX_FORMAT_LYX 496 // gb: remove noUnzip parameter of InsetGraphics
+#define LYX_FORMAT_TEX2LYX 496
 
 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
 #ifndef _MSC_VER