]> git.lyx.org Git - features.git/commitdiff
Wrap figures can also have subfloats. I simply forgot that when implementing subfloat...
authorJürgen Spitzmüller <spitz@lyx.org>
Thu, 5 Jun 2008 16:05:52 +0000 (16:05 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Thu, 5 Jun 2008 16:05:52 +0000 (16:05 +0000)
Well, here it is. Fixes one part of bug 4927. There's a remaining problem on conversion of onld subfigs with LaTeX content (e.g. \label). I'll fix that in a second step.

There's

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

lib/lyx2lyx/lyx_1_6.py
src/insets/InsetFloat.cpp
src/insets/InsetWrap.cpp

index 00dbfefa908b14adbd7c943bd3ee80f70246d4b1..75e0ffe68ad18fafcc629f71f1fab55346ac2176 100644 (file)
@@ -1838,7 +1838,7 @@ def revert_subfig(document):
     i = 0
     while 1:
         # whitespace intended (exclude \\begin_inset FloatList)
-        i = find_token(document.body, '\\begin_inset Float ', i)
+        i = find_tokens(document.body, ['\\begin_inset Float ', '\\begin_inset Wrap'], i)
         if i == -1:
             return
         j = 0
index a98d52170f57a932c5e43ea2bcb0f72da698e8f0..6b19e8cc835e7704b4c969d4402aa02545936a9b 100644 (file)
@@ -195,7 +195,8 @@ void InsetFloat::updateLabels(ParIterator const & it)
        string const saveflt = cnts.current_float();
        bool const savesubflt = cnts.isSubfloat();
 
-       bool const subflt = it.innerInsetOfType(FLOAT_CODE);
+       bool const subflt = (it.innerInsetOfType(FLOAT_CODE)
+                            || it.innerInsetOfType(WRAP_CODE));
        // floats can only embed subfloats of their own kind
        if (subflt)
                params_.type = saveflt;
index ad5036a26a9e4e5814c4a9a43e19e097136755de..04013f680e9c188b1415dd8bf3e4171bdadff7c0 100644 (file)
@@ -221,7 +221,7 @@ int InsetWrap::docbook(odocstream & os, OutputParams const & runparams) const
 bool InsetWrap::insetAllowed(InsetCode code) const
 {
        switch(code) {
-       case FLOAT_CODE:
+       case WRAP_CODE:
        case FOOT_CODE:
        case MARGIN_CODE:
                return false;