From: Jürgen Spitzmüller Date: Thu, 5 Jun 2008 16:05:52 +0000 (+0000) Subject: Wrap figures can also have subfloats. I simply forgot that when implementing subfloat... X-Git-Tag: 1.6.10~4492 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=0f07e837332b5d7fa3dacd883868459d53aa0c24;p=features.git Wrap figures can also have subfloats. I simply forgot that when implementing subfloat support. 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 --- diff --git a/lib/lyx2lyx/lyx_1_6.py b/lib/lyx2lyx/lyx_1_6.py index 00dbfefa90..75e0ffe68a 100644 --- a/lib/lyx2lyx/lyx_1_6.py +++ b/lib/lyx2lyx/lyx_1_6.py @@ -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 diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp index a98d52170f..6b19e8cc83 100644 --- a/src/insets/InsetFloat.cpp +++ b/src/insets/InsetFloat.cpp @@ -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; diff --git a/src/insets/InsetWrap.cpp b/src/insets/InsetWrap.cpp index ad5036a26a..04013f680e 100644 --- a/src/insets/InsetWrap.cpp +++ b/src/insets/InsetWrap.cpp @@ -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;