From 75746be0d89aa1ec26c7facbf1b27c0c2936b668 Mon Sep 17 00:00:00 2001 From: joshua Date: Tue, 17 Oct 2023 22:13:30 +0200 Subject: [PATCH] remove unnecessary setters --- sources/bordertitleblock.cpp | 87 ++++++------------------------------ sources/bordertitleblock.h | 8 ---- 2 files changed, 13 insertions(+), 82 deletions(-) diff --git a/sources/bordertitleblock.cpp b/sources/bordertitleblock.cpp index d281fd88c..4184426ed 100644 --- a/sources/bordertitleblock.cpp +++ b/sources/bordertitleblock.cpp @@ -311,23 +311,26 @@ TitleBlockProperties BorderTitleBlock::exportTitleBlock() @brief BorderTitleBlock::importTitleBlock @param ip the new properties of titleblock */ -void BorderTitleBlock::importTitleBlock(const TitleBlockProperties &ip) { - setAuthor(ip.author); - setDate(ip.date); +void BorderTitleBlock::importTitleBlock(const TitleBlockProperties &ip) +{ + btb_author_ = ip.author; + btb_date_ = ip.date; + btb_filename_ = ip.filename; + btb_plant_ = ip.plant; + btb_locmach_ = ip.locmach; + btb_indexrev_ = ip.indexrev; + btb_version_ = QetVersion::displayedVersion(); + btb_auto_page_num_ = ip.auto_page_num; + additional_fields_ = ip.context; + setTitle(ip.title); - setFileName(ip.filename); - setPlant(ip.plant); - setLocMach(ip.locmach); - setIndicerev(ip.indexrev); - setVersion(QetVersion::displayedVersion()); setFolio(ip.folio); - setAutoPageNum(ip.auto_page_num); + if (m_edge != ip.display_at) { m_edge = ip.display_at; emit(displayChanged()); } - additional_fields_ = ip.context; emit(needFolioData()); // Note: we expect additional data to be provided // through setFolioData(), @@ -883,22 +886,6 @@ DiagramPosition BorderTitleBlock::convertPosition(const QPointF &pos) return(DiagramPosition(letter, row_number)); } -/** - @brief BorderTitleBlock::setAuthor - @param author the new value of the "Author" field -*/ -void BorderTitleBlock::setAuthor(const QString &author) { - btb_author_ = author; -} - -/** - @brief BorderTitleBlock::setDate - @param date the new value of the "Date" field -*/ -void BorderTitleBlock::setDate(const QDate &date) { - btb_date_ = date; -} - /** @brief BorderTitleBlock::setTitle @param title the new value of the "Title" field @@ -1036,54 +1023,6 @@ void BorderTitleBlock::setFolioData( updateDiagramContextForTitleBlock(project_properties); } -/** - @brief BorderTitleBlock::setPlant - @param plant the new value of the "plant" field -*/ -void BorderTitleBlock::setPlant(const QString &plant) { - btb_plant_ = plant; -} - -/** - @brief BorderTitleBlock::setLocMach - @param locmach the new value of the "locmach" field -*/ -void BorderTitleBlock::setLocMach(const QString &locmach) { - btb_locmach_ = locmach; -} - -/** - @brief BorderTitleBlock::setIndicerev - @param indexrev the new value of the "indexrev" field -*/ -void BorderTitleBlock::setIndicerev(const QString &indexrev) { - btb_indexrev_ = indexrev; -} - -/** - @brief BorderTitleBlock::setFileName - @param filename the new value of the "filename" field -*/ -void BorderTitleBlock::setFileName(const QString &filename) { - btb_filename_ = filename; -} - -/** - @brief BorderTitleBlock::setVersion - @param version the new value of the "version" field -*/ -void BorderTitleBlock::setVersion(const QString &version) { - btb_version_ = version; -} - -/** - @brief BorderTitleBlock::setAutoPageNum - @param auto_page_num the new value of the "auto_page_num" field -*/ -void BorderTitleBlock::setAutoPageNum(const QString &auto_page_num) { - btb_auto_page_num_ = auto_page_num; -} - /** @brief BorderTitleBlock::setPreviousFolioNum @param previous the new value of the "previous-folio-num" field diff --git a/sources/bordertitleblock.h b/sources/bordertitleblock.h index 4102d65b7..5eba493a8 100644 --- a/sources/bordertitleblock.h +++ b/sources/bordertitleblock.h @@ -159,18 +159,10 @@ class BorderTitleBlock : public QObject DiagramPosition convertPosition(const QPointF &); // methods to set title block basic data - void setAuthor(const QString &author); - void setDate(const QDate &date); void setTitle(const QString &title); void setFolio(const QString &folio); void setFolioData(int, int, const QString& = nullptr, const DiagramContext & = DiagramContext()); - void setPlant(const QString &plant); - void setLocMach(const QString &locmach); - void setIndicerev(const QString &indexrev); - void setFileName(const QString &filename); - void setVersion(const QString &version); - void setAutoPageNum(const QString &auto_page_num); void setPreviousFolioNum(const QString &previous); void setNextFolioNum(const QString &next);