diff --git a/sources/autoNum/ui/numparteditorw.cpp b/sources/autoNum/ui/numparteditorw.cpp index 8ab2fe52e..9257247dd 100644 --- a/sources/autoNum/ui/numparteditorw.cpp +++ b/sources/autoNum/ui/numparteditorw.cpp @@ -290,7 +290,7 @@ void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) { * @param t, type used */ void NumPartEditorW::setCurrentIndex(NumPartEditorW::type t) { - int i; + int i=-1; if (t == unit) i = ui->type_cb->findText(tr("Chiffre 1")); else if (t == unitfolio) diff --git a/sources/elementspanel.cpp b/sources/elementspanel.cpp index 278c25c04..c62d8188e 100644 --- a/sources/elementspanel.cpp +++ b/sources/elementspanel.cpp @@ -123,7 +123,11 @@ void ElementsPanel::panelContentChange() { @param project Projet a inserer dans le panel d'elements @return Le QTreeWidgetItem insere le plus haut */ -QTreeWidgetItem *ElementsPanel::addProject(QETProject *project) { +QTreeWidgetItem *ElementsPanel::addProject(QETProject *project, QTreeWidgetItem *parent_item, PanelOptions options) +{ + Q_UNUSED(parent_item) + Q_UNUSED(options) + bool first_add = (first_reload_ || !projects_to_display_.contains(project)); // create the QTreeWidgetItem representing the project diff --git a/sources/elementspanel.h b/sources/elementspanel.h index dd6d445fa..76bdca5e1 100644 --- a/sources/elementspanel.h +++ b/sources/elementspanel.h @@ -74,9 +74,9 @@ class ElementsPanel : public GenericPanel { void panelContentChange(); private: - virtual QTreeWidgetItem *addProject (QETProject *); - QTreeWidgetItem *updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions = AddAllChild, bool = false) override; - QTreeWidgetItem *updateTemplateItem (QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions, bool = false) override; + QTreeWidgetItem *addProject (QETProject *, QTreeWidgetItem * = nullptr, PanelOptions = AddAllChild) override; + QTreeWidgetItem *updateTemplatesCollectionItem(QTreeWidgetItem *, TitleBlockTemplatesCollection *, PanelOptions = AddAllChild, bool = false) override; + QTreeWidgetItem *updateTemplateItem (QTreeWidgetItem *, const TitleBlockTemplateLocation &, PanelOptions, bool = false) override; // attributes private: diff --git a/sources/qetgraphicsitem/conductor.cpp b/sources/qetgraphicsitem/conductor.cpp index 934002b0a..7f19df165 100644 --- a/sources/qetgraphicsitem/conductor.cpp +++ b/sources/qetgraphicsitem/conductor.cpp @@ -1020,7 +1020,13 @@ QDomElement Conductor::toXml(QDomDocument &dom_document, QHash // Export the properties and text m_properties. toXml(dom_element); - m_text_item -> toXml(dom_element); + if(m_text_item->wasMovedByUser()) + { + dom_element.setAttribute("userx", QString::number(m_text_item->pos().x())); + dom_element.setAttribute("usery", QString::number(m_text_item->pos().y())); + } + if(m_text_item->wasRotateByUser()) + dom_element.setAttribute("rotation", QString::number(m_text_item->rotation())); return(dom_element); } diff --git a/sources/qetgraphicsitem/conductortextitem.cpp b/sources/qetgraphicsitem/conductortextitem.cpp index 62a9160f8..e2415bbe2 100644 --- a/sources/qetgraphicsitem/conductortextitem.cpp +++ b/sources/qetgraphicsitem/conductortextitem.cpp @@ -78,22 +78,6 @@ void ConductorTextItem::fromXml(const QDomElement &e) { } } -/** - * @brief ConductorTextItem::toXml - * Export the properties of this text in the attribute of the xml element given in parameter - * The properties exported are position and rotation (only if moved or rotate by user) - * @param xml - */ -void ConductorTextItem::toXml(QDomElement &xml) const { - if (moved_by_user_) { - xml.setAttribute("userx", QString("%1").arg(pos().x())); - xml.setAttribute("usery", QString("%1").arg(pos().y())); - } - if (rotate_by_user_) { - xml.setAttribute("rotation", QString("%1").arg(rotation())); - } -} - /** @return true si ce champ de texte a ete explictement deplace par l'utilisateur, false sinon diff --git a/sources/qetgraphicsitem/conductortextitem.h b/sources/qetgraphicsitem/conductortextitem.h index c618c55e5..5e471bd5b 100644 --- a/sources/qetgraphicsitem/conductortextitem.h +++ b/sources/qetgraphicsitem/conductortextitem.h @@ -42,7 +42,6 @@ class ConductorTextItem : public DiagramTextItem enum { Type = UserType + 1006 }; Conductor *parentConductor() const; void fromXml(const QDomElement &) override; - virtual void toXml (QDomElement &xml) const; int type() const override { return Type; } virtual bool wasMovedByUser() const; virtual bool wasRotateByUser() const; diff --git a/sources/qetgraphicsitem/crossrefitem.cpp b/sources/qetgraphicsitem/crossrefitem.cpp index 763b3c2c1..c272a8db0 100644 --- a/sources/qetgraphicsitem/crossrefitem.cpp +++ b/sources/qetgraphicsitem/crossrefitem.cpp @@ -75,7 +75,7 @@ void CrossRefItem::init() { if(!m_element->diagram()) { - qDebug() << "CrossRefItem constructor", "element is not in a diagram"; + qDebug() << "CrossRefItem constructor" << "element is not in a diagram"; return; } @@ -253,6 +253,7 @@ bool CrossRefItem::sceneEvent(QEvent *event) case QEvent::GraphicsSceneMouseDoubleClick: mouseDoubleClickEvent(static_cast(event)); break; + default:break; } return true; } diff --git a/sources/qetgraphicsitem/customelement.cpp b/sources/qetgraphicsitem/customelement.cpp index d78c070ca..a7a3244c7 100644 --- a/sources/qetgraphicsitem/customelement.cpp +++ b/sources/qetgraphicsitem/customelement.cpp @@ -648,6 +648,7 @@ bool CustomElement::parsePolygon(QDomElement &e, QPainter &qp, bool addtolist) { @return true si l'analyse reussit, false sinon */ bool CustomElement::parseText(QDomElement &e, QPainter &qp, bool addtolist) { + Q_UNUSED(addtolist); qreal pos_x, pos_y; int size; if ( diff --git a/sources/qetgraphicsitem/dynamicelementtextitem.cpp b/sources/qetgraphicsitem/dynamicelementtextitem.cpp index 607beb36c..79f1dba85 100644 --- a/sources/qetgraphicsitem/dynamicelementtextitem.cpp +++ b/sources/qetgraphicsitem/dynamicelementtextitem.cpp @@ -963,7 +963,7 @@ void DynamicElementTextItem::clearFormulaConnection() void DynamicElementTextItem::updateReportFormulaConnection() { - if(!m_parent_element.data()->linkType() & Element::AllReport) + if(!(m_parent_element.data()->linkType() & Element::AllReport)) return; removeConnectionForReportFormula(m_report_formula); @@ -977,7 +977,7 @@ void DynamicElementTextItem::updateReportFormulaConnection() */ void DynamicElementTextItem::updateReportText() { - if(!m_parent_element.data()->linkType() & Element::AllReport) + if(!(m_parent_element.data()->linkType() & Element::AllReport)) return; if (m_text_from == ElementInfo && m_info_name == "label" && m_other_report) diff --git a/sources/qetgraphicsitem/element.cpp b/sources/qetgraphicsitem/element.cpp index 01153eff4..f716ccb37 100644 --- a/sources/qetgraphicsitem/element.cpp +++ b/sources/qetgraphicsitem/element.cpp @@ -356,12 +356,6 @@ bool Element::valideXml(QDomElement &e) { */ bool Element::fromXml(QDomElement &e, QHash &table_id_adr, bool handle_inputs_rotation) { - QDomDocument doc = e.ownerDocument(); - QDomElement root = doc.documentElement(); - double saved_version = -1; - if(root.tagName() == "project") - saved_version = root.attribute("version", "-1").toDouble(); - /* les bornes vont maintenant etre recensees pour associer leurs id a leur adresse reelle ce recensement servira lors de la mise en place des fils @@ -776,7 +770,7 @@ QDomElement Element::toXml(QDomDocument &document, QHash &table //Dynamic texts QDomElement dyn_text = document.createElement("dynamic_texts"); for (DynamicElementTextItem *deti : m_dynamic_text_list) - dyn_text.appendChild(deti->toXml(document)); + dyn_text.appendChild(deti->toXml(document)); QDomElement texts_group = document.createElement("texts_groups"); diff --git a/sources/richtext/richtexteditor.cpp b/sources/richtext/richtexteditor.cpp index 239274c48..73672c475 100644 --- a/sources/richtext/richtexteditor.cpp +++ b/sources/richtext/richtexteditor.cpp @@ -78,11 +78,11 @@ QT_BEGIN_NAMESPACE -static const char RichTextDialogGroupC[] = "RichTextDialog"; -static const char GeometryKeyC[] = "Geometry"; -static const char TabKeyC[] = "Tab"; +//static const char RichTextDialogGroupC[] = "RichTextDialog"; +//static const char GeometryKeyC[] = "Geometry"; +//static const char TabKeyC[] = "Tab"; -const bool simplifyRichTextDefault = true; +//const bool simplifyRichTextDefault = true; namespace qdesigner_internal { // Richtext simplification filter helpers: Elements to be discarded diff --git a/sources/titleblock/qettemplateeditor.cpp b/sources/titleblock/qettemplateeditor.cpp index da539d990..15df34e96 100644 --- a/sources/titleblock/qettemplateeditor.cpp +++ b/sources/titleblock/qettemplateeditor.cpp @@ -687,9 +687,9 @@ void QETTitleBlockTemplateEditor::updateEditorTitle() { void QETTitleBlockTemplateEditor::updateActions() { save_ -> setEnabled(!read_only_); - bool can_merge; - bool can_split; - int count; + bool can_merge = true; + bool can_split = true; + int count = 0; if (!read_only_) { template_edition_area_view_ -> analyzeSelectedCells(&can_merge, &can_split, &count); } diff --git a/sources/ui/dynamicelementtextmodel.cpp b/sources/ui/dynamicelementtextmodel.cpp index 228b30821..bdf8ffedb 100644 --- a/sources/ui/dynamicelementtextmodel.cpp +++ b/sources/ui/dynamicelementtextmodel.cpp @@ -1255,6 +1255,7 @@ void DynamicElementTextModel::updateDataFromText(DynamicElementTextItem *deti, V qsi->child(width_txt_row,1)->setData(deti->textWidth(), Qt::EditRole); break; } + default:break; } m_block_dataChanged = false; @@ -1296,6 +1297,7 @@ void DynamicElementTextModel::updateDataFromGroup(ElementTextItemGroup *group, D enableGroupRotation(group); break; } + default:break; } m_block_dataChanged = false; @@ -1540,6 +1542,7 @@ bool DynamicTextItemDelegate::eventFilter(QObject *object, QEvent *event) emit commitData(sb); break; case QEvent::Wheel: emit commitData(sb); break; + default:break; } return true; } diff --git a/sources/ui/imagepropertieswidget.cpp b/sources/ui/imagepropertieswidget.cpp index 171988044..af5d81496 100644 --- a/sources/ui/imagepropertieswidget.cpp +++ b/sources/ui/imagepropertieswidget.cpp @@ -130,7 +130,7 @@ bool ImagePropertiesWidget::setLiveEdit(bool live_edit) * @return the change in an undo command (ItemResizerCommand). * If there is no change return nullptr */ -QUndoCommand* ImagePropertiesWidget::associatedUndo() +QUndoCommand* ImagePropertiesWidget::associatedUndo() const { qreal value = ui->m_scale_slider->value(); diff --git a/sources/ui/imagepropertieswidget.h b/sources/ui/imagepropertieswidget.h index 56203adde..6f4177a09 100644 --- a/sources/ui/imagepropertieswidget.h +++ b/sources/ui/imagepropertieswidget.h @@ -42,7 +42,7 @@ class ImagePropertiesWidget : public PropertiesEditorWidget void apply() override; void reset() override; bool setLiveEdit(bool live_edit) override; - QUndoCommand* associatedUndo(); + QUndoCommand* associatedUndo() const override; private: void updateUi() override; diff --git a/sources/undocommand/rotateselectioncommand.cpp b/sources/undocommand/rotateselectioncommand.cpp index f98e55a9c..eb7d77c6e 100644 --- a/sources/undocommand/rotateselectioncommand.cpp +++ b/sources/undocommand/rotateselectioncommand.cpp @@ -31,8 +31,7 @@ RotateSelectionCommand::RotateSelectionCommand(Diagram *diagram, qreal angle, QUndoCommand *parent) : QUndoCommand(parent), -m_diagram(diagram), -m_angle(angle) +m_diagram(diagram) { setText(QObject::tr("Pivoter la selection")); diff --git a/sources/undocommand/rotateselectioncommand.h b/sources/undocommand/rotateselectioncommand.h index b34210ab5..56dfa852d 100644 --- a/sources/undocommand/rotateselectioncommand.h +++ b/sources/undocommand/rotateselectioncommand.h @@ -40,7 +40,6 @@ class RotateSelectionCommand : public QUndoCommand private: Diagram *m_diagram =nullptr; - qreal m_angle; QList> m_cond_text; QHash m_rotate_by_user;