Ich schrieb:

The attached patch backports the patch to use wrapfig instead of floatflt to branch.

There was a bug in there: "wrapfig" must be loaded after "float".
Attached is the corrected patch.

regards Uwe
Index: lib/chkconfig.ltx
===================================================================
--- lib/chkconfig.ltx	(revision 22813)
+++ lib/chkconfig.ltx	(working copy)
@@ -230,7 +230,6 @@
 \TestPackage{esint}
 \TestPackage{fancybox}
 \TestPackage{fancyhdr}
-\TestPackage{floatflt}
 \TestPackage{framed}
 \TestPackage{geometry}
 \TestPackage{jurabib}
@@ -247,8 +246,9 @@
 \TestPackage{soul}
 \TestPackage{subfigure}
 \TestPackage{textcomp}
+\TestPackage{url}
 \TestPackage{varioref}
-\TestPackage{url}
+\TestPackage{wrapfig}
 \TestPackage{xcolor}
 
 
Index: lib/doc/LaTeXConfig.lyx.in
===================================================================
--- lib/doc/LaTeXConfig.lyx.in	(revision 22813)
+++ lib/doc/LaTeXConfig.lyx.in	(working copy)
@@ -1,4 +1,4 @@
-#LyX 1.5.2svn created this file. For more info see http://www.lyx.org/
+#LyX 1.5.4svn created this file. For more info see http://www.lyx.org/
 \lyxformat 276
 \begin_document
 \begin_header
@@ -2913,35 +2913,6 @@
 \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 insert text wrap floats (menu Insert\SpecialChar \menuseparator
-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
 
@@ -3227,6 +3198,35 @@
 \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 fullpage
+ and wrap the text around it.
+\end_layout
+
+\begin_layout Subsection
 xcolor
 \end_layout
 
Index: src/factory.cpp
===================================================================
--- src/factory.cpp	(revision 22813)
+++ src/factory.cpp	(working copy)
@@ -176,7 +176,7 @@
 			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: src/frontends/qt4/QWrap.cpp
===================================================================
--- src/frontends/qt4/QWrap.cpp	(revision 22813)
+++ src/frontends/qt4/QWrap.cpp	(working copy)
@@ -80,7 +80,7 @@
 typedef QController<ControlWrap, QView<QWrapDialog> > wrap_base_class;
 
 QWrap::QWrap(Dialog & parent)
-	: wrap_base_class(parent, _("Text Wrap Settings"))
+	: wrap_base_class(parent, _("Wrap Float Settings"))
 {
 }
 
@@ -113,16 +113,16 @@
 
 	switch (dialog_->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;
 	}
 }
@@ -131,12 +131,9 @@
 static string const numtostr(double val)
 {
 	string a = convert<string>(val);
-#ifdef WITH_WARNINGS
-#warning Will this test ever trigger? (Lgb)
-#endif
-	if (a == "0")
-		a.erase();
 	return a;
+	//0pt is a legal width now, it yields a 
+	//wrapfloat just wide enough for the contents.
 }
 
 
@@ -149,11 +146,11 @@
 	dialog_->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;
 
 	dialog_->valignCO->setCurrentIndex(item);
Index: src/frontends/qt4/ui/WrapUi.ui
===================================================================
--- src/frontends/qt4/ui/WrapUi.ui	(revision 22813)
+++ src/frontends/qt4/ui/WrapUi.ui	(working copy)
@@ -1,7 +1,4 @@
 <ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
  <class>QWrapUi</class>
  <widget class="QDialog" name="QWrapUi" >
   <property name="geometry" >
@@ -19,20 +16,41 @@
    <bool>true</bool>
   </property>
   <layout class="QVBoxLayout" >
-   <property name="margin" >
-    <number>11</number>
-   </property>
    <property name="spacing" >
     <number>6</number>
    </property>
+   <property name="leftMargin" >
+    <number>11</number>
+   </property>
+   <property name="topMargin" >
+    <number>11</number>
+   </property>
+   <property name="rightMargin" >
+    <number>11</number>
+   </property>
+   <property name="bottomMargin" >
+    <number>11</number>
+   </property>
    <item>
     <layout class="QGridLayout" >
-     <property name="margin" >
+     <property name="leftMargin" >
       <number>0</number>
      </property>
-     <property name="spacing" >
+     <property name="topMargin" >
+      <number>0</number>
+     </property>
+     <property name="rightMargin" >
+      <number>0</number>
+     </property>
+     <property name="bottomMargin" >
+      <number>0</number>
+     </property>
+     <property name="horizontalSpacing" >
       <number>6</number>
      </property>
+     <property name="verticalSpacing" >
+      <number>6</number>
+     </property>
      <item row="0" column="0" >
       <widget class="QLabel" name="widthLA" >
        <property name="text" >
@@ -50,22 +68,22 @@
        </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>
@@ -81,11 +99,9 @@
       </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>
-         <vsizetype>0</vsizetype>
+        <sizepolicy vsizetype="Fixed" hsizetype="MinimumExpanding" >
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
@@ -107,9 +123,7 @@
      <item row="1" column="0" >
       <widget class="QLineEdit" name="widthED" >
        <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>1</hsizetype>
-         <vsizetype>0</vsizetype>
+        <sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
          <horstretch>0</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
@@ -149,12 +163,21 @@
    </item>
    <item>
     <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
      <property name="spacing" >
       <number>6</number>
      </property>
+     <property name="leftMargin" >
+      <number>0</number>
+     </property>
+     <property name="topMargin" >
+      <number>0</number>
+     </property>
+     <property name="rightMargin" >
+      <number>0</number>
+     </property>
+     <property name="bottomMargin" >
+      <number>0</number>
+     </property>
      <item>
       <widget class="QPushButton" name="restorePB" >
        <property name="toolTip" >
@@ -224,17 +247,11 @@
    </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>
@@ -246,6 +263,9 @@
   <tabstop>applyPB</tabstop>
   <tabstop>closePB</tabstop>
  </tabstops>
+ <includes>
+  <include location="local" >qt_helpers.h</include>
+ </includes>
  <resources/>
  <connections/>
 </ui>
Index: src/insets/InsetWrap.cpp
===================================================================
--- src/insets/InsetWrap.cpp	(revision 22813)
+++ src/insets/InsetWrap.cpp	(working copy)
@@ -160,7 +160,7 @@
 
 void InsetWrap::validate(LaTeXFeatures & features) const
 {
-	features.require("floatflt");
+	features.require("wrapfig");
 	InsetCollapsable::validate(features);
 }
 
@@ -180,12 +180,13 @@
 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;
 }
 
Index: src/LaTeXFeatures.cpp
===================================================================
--- src/LaTeXFeatures.cpp	(revision 22813)
+++ src/LaTeXFeatures.cpp	(working copy)
@@ -415,10 +415,14 @@
 	"latexsym",
 	"pifont",
 	"subfigure",
-	"floatflt",
 	"varioref",
 	"prettyref",
+	/*For a successful cooperation of the `wrapfig' package with the
+	  `float' package you should load the `wrapfig' package *after*
+	  the `float' package. See the caption package documentation
+	  for explanation.*/
 	"float",
+	"wrapfig",
 	"booktabs",
 	"dvipost",
 	"fancybox",

Reply via email to