Get a sensible prefix inside figure and tabular floats (bug 1999).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@13393 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2006-03-16 14:03:29 +00:00
parent 4836399ae8
commit d1bf49434e
3 changed files with 26 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2006-03-16 Jürgen Spitzmüller <j.spitzmueller@gmx.de>
* text.C (getPossibleLabel): get a sensible prefix inside figure and
tabular floats (bug 1999).
2006-03-16 John Spray <spray@lyx.org> 2006-03-16 John Spray <spray@lyx.org>
* lyxfunc.C (getStatus): disable LFUN_MENUWRITE when document is * lyxfunc.C (getStatus): disable LFUN_MENUWRITE when document is

View File

@ -2264,8 +2264,25 @@ string LyXText::getPossibleLabel(LCursor & cur) const
} }
} }
string text = layout->latexname().substr(0, 3); string name = layout->latexname();
if (layout->latexname() == "theorem")
// for captions, we want the abbreviation of the float type
if (layout->labeltype == LABEL_SENSITIVE) {
// Search for the first float or wrap inset in the iterator
size_t i = cur.depth();
while (i > 0) {
--i;
InsetBase * const in = &cur[i].inset();
if (in->lyxCode() == InsetBase::FLOAT_CODE
|| in->lyxCode() == InsetBase::WRAP_CODE) {
name = in->getInsetName();
break;
}
}
}
string text = name.substr(0, 3);
if (name == "theorem")
text = "thm"; // Create a correct prefix for prettyref text = "thm"; // Create a correct prefix for prettyref
text += ':'; text += ':';

View File

@ -41,6 +41,8 @@ What's new
- Fix jurabib error with Spanish documents (bug 2365). - Fix jurabib error with Spanish documents (bug 2365).
- More sensible default label in table and figure captions (bug 1999).
- Do not skip change in "Merge changes..." dialog (bug 2212). - Do not skip change in "Merge changes..." dialog (bug 2212).
- Improve handling of the labeling environment in KOMA letters (bug 2246). - Improve handling of the labeling environment in KOMA letters (bug 2246).