]> git.lyx.org Git - features.git/commitdiff
Helge's wrapfig patch:
authorUwe Stöhr <uwestoehr@web.de>
Sun, 9 Sep 2007 23:47:22 +0000 (23:47 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Sun, 9 Sep 2007 23:47:22 +0000 (23:47 +0000)
- Format incremented to 284
- LaTeX-package wrapfig is now used instead of flotflt for wrap floats (this allows us to implement now also a table wrap float)

(the optional overhang argument of wrapfig will be implemented later)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20185 a592a061-630c-0410-9148-cb99ea01b6c8

development/FORMAT
lib/chkconfig.ltx
lib/doc/LaTeXConfig.lyx.in
lib/lyx2lyx/LyX.py
lib/lyx2lyx/lyx_1_6.py
src/Buffer.cpp
src/LaTeXFeatures.cpp
src/factory.cpp
src/frontends/qt4/GuiWrap.cpp
src/frontends/qt4/ui/WrapUi.ui
src/insets/InsetWrap.cpp

index 3f1a1aed07272637f3ffe7c9418dc310e4811bee..52d1c85e685a50d1984ff84a2a27828e499164c8 100644 (file)
@@ -1,6 +1,14 @@
 LyX file-format changes
 -----------------------
 
+2007-09-09 Helge Hafting
+       * Format incremented to 284: LyX now implements wrapped figures
+         using wrapfig.sty instead of floatflt.sty. The latter
+         is rather buggy, the former also has more options.
+         No conversion as the .lyx doesn't change.
+         The .tex export is slightly different, necessitating the
+         format increase.
+
 2007-09-08 Martin Vermeer
 
        * format incremented to 283: CharStyle insets are now 
@@ -831,3 +839,4 @@ renamed as "size_kind" and "lyxsize_kind" respectively.
  \end_inset
 
 
+
index 7b106aa17c88e38bdfc3d4f160433f0b432be1ee..76399b4dd7e0ca4a07dcf20f3f7562d67cd8c468 100644 (file)
 \TestPackage{esint}
 \TestPackage{fancybox}
 \TestPackage{fancyhdr}
-\TestPackage{floatflt}
+\TestPackage{wrapfig}
 \TestPackage{framed}
 \TestPackage{geometry}
 \TestPackage{jurabib}
index 516bebb7ab55e07a6dff9e87804d00c9432b45a1..2770e2afffe62fccff6287fab6fef692b3eeb1b8 100644 (file)
@@ -1,5 +1,5 @@
-#LyX 1.5.0rc1 created this file. For more info see http://www.lyx.org/
-\lyxformat 271
+#LyX 1.6.0svn created this file. For more info see http://www.lyx.org/
+\lyxformat 284
 \begin_document
 \begin_header
 \textclass article
@@ -33,9 +33,8 @@
 \paperpagestyle plain
 \tracking_changes false
 \output_changes false
-\author "Jürgen Spitzmüller" 
-\author "usti" 
-\author "Jean-Marc Lasgouttes" 
+\author "" 
+\author "" 
 \end_header
 
 \begin_body
@@ -2913,38 +2912,6 @@ fancy
  It provides alternate headers and footers to your pages.
 \end_layout
 
-\begin_layout Subsection
-floatflt
-\end_layout
-
-\begin_layout Description
-Found: @chk_floatflt@
-\end_layout
-
-\begin_layout Description
-CTAN: 
-\family typewriter
-macros/latex/contrib/floatflt/
-\end_layout
-
-\begin_layout Description
-Notes: The package 
-\family sans
-floatflt
-\family default
- (an extension of 
-\family sans
-floatfig
-\family default
-) is used by LyX if you select the ``floatflt'' type in 
-\family sans
-Layout->Paragraph->ExtraOpt
-\family default
- in the paragraph of a figure float.
- It allows you to create a figure float which is narrower than the full
- page and wrap the text around it.
-\end_layout
-
 \begin_layout Subsection
 jurabib
 \end_layout
@@ -3230,6 +3197,35 @@ url
  is needed by LyX to be able to output url's corrently.
 \end_layout
 
+\begin_layout Subsection
+wrapfig
+\end_layout
+
+\begin_layout Description
+Found: @chk_wrapfig@
+\end_layout
+
+\begin_layout Description
+CTAN: 
+\family typewriter
+macros/latex/contrib/wrapfig/
+\end_layout
+
+\begin_layout Description
+Notes: The package 
+\family typewriter
+wrapfig
+\family default
+ is used by LyX if you insert text wrap floats (menu 
+\family sans
+Insert\SpecialChar \menuseparator
+Float)
+\family default
+.
+ It allows you to create a figure float which is narrower than the full
+ page and wrap the text around it.
+\end_layout
+
 \begin_layout Subsection
 xcolor
 \end_layout
index 447f954428abfbde586b1790e55a387ae5c20ad4..8b8fddb38eb538b194856524d025769ad1103261 100644 (file)
@@ -78,7 +78,7 @@ format_relation = [("0_06",    [200], generate_minor_versions("0.6" , 4)),
                    ("1_3",     [221], generate_minor_versions("1.3" , 7)),
                    ("1_4", range(222,246), generate_minor_versions("1.4" , 5)),
                    ("1_5", range(246,277), generate_minor_versions("1.5" , 1)),
-                   ("1_6", range(277,284), generate_minor_versions("1.6" , 0))]
+                   ("1_6", range(277,285), generate_minor_versions("1.6" , 0))]
 
 
 def formats_list():
index 51f077cc34b9236e624e08db0ec0edbf2267fac0..93e275b478881bc7d3c7bb0db545320fe89c24ad 100644 (file)
@@ -187,10 +187,12 @@ convert = [
            [280, [axe_show_label]],
            [281, []],
            [282, []],
-           [283, [convert_flex]]
+           [283, [convert_flex]],
+           [284, []]
           ]
 
 revert =  [
+           [283, []],
            [282, [revert_flex]],
            [281, []],
            [280, [revert_begin_modules]],
index a7bca7bd371d498cb5e050d5c2ec106451f920c2..404efdf6fb438651832f1b669c062f2732af6bf4 100644 (file)
@@ -142,7 +142,7 @@ namespace fs = boost::filesystem;
 
 namespace {
 
-int const LYX_FORMAT = 283;
+int const LYX_FORMAT = 284;
 
 } // namespace anon
 
index 44811fcfec248e008a26b4cb8346f8b3f77a1ffe..4fee7fdf1eb651bddfdc15f0fb788a506d3b93b4 100644 (file)
@@ -397,7 +397,7 @@ char const * simplefeatures[] = {
        "latexsym",
        "pifont",
        "subfigure",
-       "floatflt",
+       "wrapfig",
        "varioref",
        "prettyref",
        "float",
index 3e63e0e896bb228d8522dd5e89dc5d375cef2110..681b8e5fbc53b47bbbc74c167605483bdec2a7a1 100644 (file)
@@ -173,7 +173,7 @@ Inset * createInset(BufferView * bv, FuncRequest const & cmd)
                        string const argument = to_utf8(cmd.argument());
                        if (argument == "figure")
                                return new InsetWrap(params, argument);
-                       lyxerr << "Non-existent floatflt type: " << argument << endl;
+                       lyxerr << "Non-existent wrapfig type: " << argument << endl;
                        return 0;
                }
 
index 943c7c5aac8139941d000743b1c1d6f44d83044c..28fb5a86d06b915240a55ce59be0eaf4b9868d56 100644 (file)
@@ -35,7 +35,7 @@ GuiWrapDialog::GuiWrapDialog(LyXView & lv)
        : GuiDialog(lv, "wrap")
 {
        setupUi(this);
-       setViewTitle(_("Text Wrap Settings"));
+       setViewTitle(_("Wrap Float Settings"));
        setController(new ControlWrap(*this));
 
        connect(restorePB, SIGNAL(clicked()), this, SLOT(slotRestore()));
@@ -94,16 +94,16 @@ void GuiWrapDialog::applyView()
 
        switch (valignCO->currentIndex()) {
        case 0:
-               params.placement.erase();
+               params.placement = "o";
                break;
        case 1:
-               params.placement = "l";
+               params.placement = "i";
                break;
        case 2:
-               params.placement = "r";
+               params.placement = "l";
                break;
        case 3:
-               params.placement = "p";
+               params.placement = "r";
                break;
        }
 }
@@ -112,10 +112,9 @@ void GuiWrapDialog::applyView()
 static string const numtostr(double val)
 {
        string a = convert<string>(val);
-       // FIXME: Will this test ever trigger? (Lgb)
-       if (a == "0")
-               a.erase();
        return a;
+       //0pt is a legal width now, it yields a
+       //wrapfloat just wide enough for the contents.
 }
 
 
@@ -128,11 +127,11 @@ void GuiWrapDialog::update_contents()
        unitsLC->setCurrentItem(len.unit());
 
        int item = 0;
-       if (params.placement == "l")
+       if (params.placement == "i")
                item = 1;
-       else if (params.placement == "r")
+       else if (params.placement == "l")
                item = 2;
-       else if (params.placement == "p")
+       else if (params.placement == "r")
                item = 3;
 
        valignCO->setCurrentIndex(item);
index dd8ff3121b3816802eb1db112818229a6d857f7c..22c6bd43785bab5b068f61758f0f381f7ae88952 100644 (file)
        </property>
        <item>
         <property name="text" >
-         <string>Default (outer)</string>
+         <string>Outer (default)</string>
         </property>
        </item>
        <item>
         <property name="text" >
-         <string>Left</string>
+         <string>Inner</string>
         </property>
        </item>
        <item>
         <property name="text" >
-         <string>Right</string>
+         <string>Left</string>
         </property>
        </item>
        <item>
         <property name="text" >
-         <string>Outer</string>
+         <string>Right</string>
         </property>
        </item>
       </widget>
@@ -78,7 +78,7 @@
       </widget>
      </item>
      <item row="1" column="1" >
-      <widget class="LengthCombo" name="unitsLC" >
+      <widget class="LengthCombo" native="1" name="unitsLC" >
        <property name="sizePolicy" >
         <sizepolicy>
          <hsizetype>3</hsizetype>
    </item>
   </layout>
  </widget>
- <pixmapfunction></pixmapfunction>
- <includes>
-  <include location="local" >qt_helpers.h</include>
- </includes>
  <customwidgets>
   <customwidget>
    <class>LengthCombo</class>
-   <extends></extends>
+   <extends>QWidget</extends>
    <header>LengthCombo.h</header>
-   <container>0</container>
-   <pixmap></pixmap>
   </customwidget>
  </customwidgets>
  <tabstops>
   <tabstop>applyPB</tabstop>
   <tabstop>closePB</tabstop>
  </tabstops>
+ <includes>
+  <include location="local" >qt_helpers.h</include>
+ </includes>
  <resources/>
  <connections/>
 </ui>
index 8c72fc8571dee743455cec2c6e336601457d8f33..1d0eea89eda28717c8e85b5b5c32882792598f8f 100644 (file)
@@ -175,7 +175,7 @@ void InsetWrap::read(Buffer const & buf, Lexer & lex)
 
 void InsetWrap::validate(LaTeXFeatures & features) const
 {
-       features.require("floatflt");
+       features.require("wrapfig");
        InsetCollapsable::validate(features);
 }
 
@@ -195,12 +195,13 @@ docstring const InsetWrap::editMessage() const
 int InsetWrap::latex(Buffer const & buf, odocstream & os,
                     OutputParams const & runparams) const
 {
-       os << "\\begin{floating" << from_ascii(params_.type) << '}';
+       os << "\\begin{wrap" << from_ascii(params_.type) << '}';
        if (!params_.placement.empty())
-               os << '[' << from_ascii(params_.placement) << ']';
+               os << '{' << from_ascii(params_.placement) << '}';
+               else os << "{o}"; //Outer is default in the current UI
        os << '{' << from_ascii(params_.width.asLatexString()) << "}%\n";
        int const i = InsetText::latex(buf, os, runparams);
-       os << "\\end{floating" << from_ascii(params_.type) << "}%\n";
+       os << "\\end{wrap" << from_ascii(params_.type) << "}%\n";
        return i + 2;
 }