mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-29 13:04:58 +00:00
Indicate change of content in label of collapsed collapsible
Fixes #8645
This commit is contained in:
parent
9490a88e18
commit
b321bb1aed
@ -445,9 +445,13 @@ docstring const InsetCollapsible::getNewLabel(docstring const & l) const
|
|||||||
pos_type const n = min(max_length, p_siz);
|
pos_type const n = min(max_length, p_siz);
|
||||||
pos_type i = 0;
|
pos_type i = 0;
|
||||||
pos_type j = 0;
|
pos_type j = 0;
|
||||||
|
bool changed_content = false;
|
||||||
for (; i < n && j < p_siz; ++j) {
|
for (; i < n && j < p_siz; ++j) {
|
||||||
|
if (paragraphs().begin()->isChanged(j)) {
|
||||||
|
changed_content = true;
|
||||||
if (paragraphs().begin()->isDeleted(j))
|
if (paragraphs().begin()->isDeleted(j))
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
if (paragraphs().begin()->isInset(j)) {
|
if (paragraphs().begin()->isInset(j)) {
|
||||||
if (!paragraphs().begin()->getInset(j)->isChar())
|
if (!paragraphs().begin()->getInset(j)->isChar())
|
||||||
continue;
|
continue;
|
||||||
@ -459,7 +463,11 @@ docstring const InsetCollapsible::getNewLabel(docstring const & l) const
|
|||||||
if (paragraphs().size() > 1 || (i > 0 && j < p_siz)) {
|
if (paragraphs().size() > 1 || (i > 0 && j < p_siz)) {
|
||||||
label << "...";
|
label << "...";
|
||||||
}
|
}
|
||||||
docstring const lbl = label.str();
|
docstring lbl;
|
||||||
|
// indicate changed content in label (#8645)
|
||||||
|
if (changed_content)
|
||||||
|
lbl = char_type(0x270E);// ✎ U+270E LOWER RIGHT PENCIL
|
||||||
|
lbl += label.str();
|
||||||
return lbl.empty() ? l : lbl;
|
return lbl.empty() ? l : lbl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1077,6 +1077,7 @@ docstring InsetText::toolTipText(docstring prefix, size_t const len) const
|
|||||||
ParagraphList::const_iterator end = paragraphs().end();
|
ParagraphList::const_iterator end = paragraphs().end();
|
||||||
ParagraphList::const_iterator it = beg;
|
ParagraphList::const_iterator it = beg;
|
||||||
bool ref_printed = false;
|
bool ref_printed = false;
|
||||||
|
bool changed_content = false;
|
||||||
|
|
||||||
for (; it != end; ++it) {
|
for (; it != end; ++it) {
|
||||||
if (it != beg)
|
if (it != beg)
|
||||||
@ -1084,12 +1085,14 @@ docstring InsetText::toolTipText(docstring prefix, size_t const len) const
|
|||||||
if ((*it).isRTL(buffer().params()))
|
if ((*it).isRTL(buffer().params()))
|
||||||
oss << "<div dir=\"rtl\">";
|
oss << "<div dir=\"rtl\">";
|
||||||
writePlaintextParagraph(buffer(), *it, oss, rp, ref_printed, len);
|
writePlaintextParagraph(buffer(), *it, oss, rp, ref_printed, len);
|
||||||
if ((*it).isRTL(buffer().params()))
|
if ((*it).isChanged(0, (*it).size()))
|
||||||
oss << "</div>";
|
changed_content = true;
|
||||||
if (oss.tellp() >= 0 && size_t(oss.tellp()) > len)
|
if (oss.tellp() >= 0 && size_t(oss.tellp()) > len)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
docstring str = oss.str();
|
docstring str = oss.str();
|
||||||
|
if (changed_content)
|
||||||
|
str += from_ascii("\n\n") + _("[contains tracked changes]");
|
||||||
support::truncateWithEllipsis(str, len);
|
support::truncateWithEllipsis(str, len);
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user