Fix caption numbering of child documents.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24866 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-05-20 11:54:23 +00:00
parent be310e33ca
commit b630a55d77
3 changed files with 11 additions and 6 deletions

View File

@ -21,6 +21,8 @@
namespace lyx {
namespace frontend {
class QWindowsMimeMetafile;
/**
* The Qt4 version of the Clipboard.
*/
@ -52,6 +54,8 @@ private Q_SLOTS:
void on_dataChanged();
private:
/// WMF Mime handler for Windows clipboard.
QWindowsMimeMetafile * wmf_mime_;
bool text_clipboard_empty_;
bool has_lyx_contents_;
bool has_graphics_contents_;

View File

@ -280,27 +280,28 @@ int InsetCaption::getCaptionText(odocstream & os,
void InsetCaption::updateLabels(ParIterator const & it)
{
DocumentClass const & tclass = buffer().params().documentClass();
Buffer const & master = *buffer().masterBuffer();
DocumentClass const & tclass = master.params().documentClass();
Counters & cnts = tclass.counters();
string const & type = cnts.current_float();
// Memorize type for addToToc().
type_ = type;
in_subfloat_ = cnts.isSubfloat();
if (type.empty())
full_label_ = buffer().B_("Senseless!!! ");
full_label_ = master.B_("Senseless!!! ");
else {
// FIXME: life would be _much_ simpler if listings was
// listed in Floating.
docstring name;
if (type == "listing")
name = buffer().B_("Listing");
name = master.B_("Listing");
else
name = buffer().B_(tclass.floats().getType(type).name());
name = master.B_(tclass.floats().getType(type).name());
docstring counter = from_utf8(type);
if (in_subfloat_) {
counter = "sub-" + from_utf8(type);
name = bformat(_("Sub-%1$s"),
buffer().B_(tclass.floats().getType(type).name()));
master.B_(tclass.floats().getType(type).name()));
}
if (cnts.hasCounter(counter)) {
cnts.step(counter);

View File

@ -191,7 +191,7 @@ bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
void InsetFloat::updateLabels(ParIterator const & it)
{
Counters & cnts = buffer().params().documentClass().counters();
Counters & cnts = buffer().masterBuffer()->params().documentClass().counters();
string const saveflt = cnts.current_float();
bool const savesubflt = cnts.isSubfloat();