mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-25 00:14:15 +02:00
Fix a folio report pointing back at its partner's old place after its information changes
A folio report's label shows where its partner is (updateReportText()).
Changing any other information of the report -- a comment, a function --
ran elementInfoChanged(), which set the text from the label stored in
the report's information instead: the partner's position when the file
was last saved. Move the partner from column 4 to column 9, give the
report a comment, and it showed (and saved) 1-C4 again.
With lazy folios the partner is often built after the change, so the
report was recomputed and the two modes saved different files; that is
how this was found (FINDINGS F116, tools/lazy-folios/edit-diff.py).
New tst_reporttextafterinfo: move the partner, comment the report, save,
check the report says 1-C9, with folios built when needed and with every
folio built. Both rows fail without this change ("1-C4").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1098,6 +1098,19 @@ void DynamicElementTextItem::handlerMouseReleaseEvent(QetGraphicsHandlerItem *ha
|
||||
|
||||
void DynamicElementTextItem::elementInfoChanged()
|
||||
{
|
||||
//A folio report's label shows where its partner is
|
||||
//(updateReportText()); the label in its information is only where
|
||||
//the partner was when last saved, and changing any other
|
||||
//information wrote that stale position back (F116)
|
||||
if (m_text_from == ElementInfo && m_info_name == QLatin1String("label")
|
||||
&& m_parent_element && (m_parent_element.data()->linkType() & Element::AllReport)
|
||||
&& m_other_report) {
|
||||
setupFormulaConnection();
|
||||
updateReportText();
|
||||
emit plainTextChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
DiagramContext dc;
|
||||
Element *element = elementUseForInfo();
|
||||
if(element) {
|
||||
|
||||
Reference in New Issue
Block a user