mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
remove broken operator==() for Paragraphs
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7465 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
58fd3c844a
commit
42e43ec73d
@ -1116,7 +1116,7 @@ bool Paragraph::isMultiLingual(BufferParams const & bparams)
|
||||
for (; cit != end; ++cit)
|
||||
if (cit->font().language() != ignore_language &&
|
||||
cit->font().language() != latex_language &&
|
||||
cit->font().language() != doc_language)
|
||||
cit->font().language() != doc_language)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@ -1354,7 +1354,7 @@ bool Paragraph::isFreeSpacing() const
|
||||
// for now we just need this, later should we need this in some
|
||||
// other way we can always add a function to InsetOld::() too.
|
||||
if (pimpl_->inset_owner && pimpl_->inset_owner->owner())
|
||||
return (pimpl_->inset_owner->owner()->lyxCode() == InsetOld::ERT_CODE);
|
||||
return pimpl_->inset_owner->owner()->lyxCode() == InsetOld::ERT_CODE;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1364,13 +1364,6 @@ bool Paragraph::allowEmpty() const
|
||||
if (layout()->keepempty)
|
||||
return true;
|
||||
if (pimpl_->inset_owner && pimpl_->inset_owner->owner())
|
||||
return (pimpl_->inset_owner->owner()->lyxCode() == InsetOld::ERT_CODE);
|
||||
return pimpl_->inset_owner->owner()->lyxCode() == InsetOld::ERT_CODE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool operator==(Paragraph const & lhs, Paragraph const & rhs)
|
||||
{
|
||||
#warning FIXME this implementatoin must be completely wrong...
|
||||
return &lhs == &rhs;
|
||||
}
|
||||
|
@ -319,7 +319,4 @@ inline bool isDeletedText(Paragraph const & par, lyx::pos_type pos)
|
||||
return par.lookupChange(pos) == Change::DELETED;
|
||||
}
|
||||
|
||||
|
||||
bool operator==(Paragraph const & lhs, Paragraph const & rhs);
|
||||
|
||||
#endif // PARAGRAPH_H
|
||||
|
@ -150,9 +150,12 @@ int LyXText::workWidth() const
|
||||
|
||||
int LyXText::workWidth(InsetOld const * inset) const
|
||||
{
|
||||
ParagraphList::iterator par = std::find(ownerParagraphs().begin(),
|
||||
ownerParagraphs().end(),
|
||||
*inset->parOwner());
|
||||
ParagraphList::iterator par = ownerParagraphs().begin();
|
||||
ParagraphList::iterator end = ownerParagraphs().end();
|
||||
for ( ; par != end; ++par)
|
||||
if (&*par == inset->parOwner())
|
||||
break;
|
||||
|
||||
if (par == ownerParagraphs().end()) {
|
||||
lyxerr << "LyXText::workWidth: unexpected\n";
|
||||
return -1;
|
||||
|
12
src/text2.C
12
src/text2.C
@ -1101,19 +1101,23 @@ void LyXText::setCounter(Buffer const * buf, ParagraphList::iterator pit)
|
||||
|
||||
// the caption hack:
|
||||
if (layout->labeltype == LABEL_SENSITIVE) {
|
||||
ParagraphList::iterator end = ownerParagraphs().end();
|
||||
ParagraphList::iterator tmppit = pit;
|
||||
InsetOld * in = 0;
|
||||
bool isOK = false;
|
||||
while (tmppit != ownerParagraphs().end() &&
|
||||
tmppit->inInset()
|
||||
while (tmppit != end && tmppit->inInset()
|
||||
// the single '=' is intended below
|
||||
&& (in = tmppit->inInset()->owner())) {
|
||||
&& (in = tmppit->inInset()->owner()))
|
||||
{
|
||||
if (in->lyxCode() == InsetOld::FLOAT_CODE ||
|
||||
in->lyxCode() == InsetOld::WRAP_CODE) {
|
||||
isOK = true;
|
||||
break;
|
||||
} else {
|
||||
tmppit = std::find(ownerParagraphs().begin(), ownerParagraphs().end(), *in->parOwner());
|
||||
tmppit = ownerParagraphs().begin();
|
||||
for ( ; tmppit != end; ++tmppit)
|
||||
if (&*tmppit == in->parOwner())
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user