r24785 by craig - Code cleanup
scribus-commit
scribus-commit at lists.scribus.net
Tue Dec 28 15:39:55 UTC 2021
Author: craig
Date: Tue Dec 28 15:39:55 2021
New Revision: 24785
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24785
Log:
Code cleanup
Modified:
trunk/Scribus/scribus/canvasmode_drawbezier.cpp
trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
trunk/Scribus/scribus/canvasmode_edit.cpp
trunk/Scribus/scribus/ui/annot.cpp
trunk/Scribus/scribus/ui/gtfiledialog.h
Modified: trunk/Scribus/scribus/canvasmode_drawbezier.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24785&path=/trunk/Scribus/scribus/canvasmode_drawbezier.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawbezier.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_drawbezier.cpp Tue Dec 28 15:39:55 2021
@@ -238,8 +238,6 @@
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
PageItem *currItem;
- FPoint npf, npf2;
-// QRect tx;
m->accept();
m_canvas->displayCorrectedXYHUD(m->globalPos(), mousePointDoc.x(), mousePointDoc.y());
// qDebug() << "legacy mode move:" << m->x() << m->y() << m_canvas->globalToCanvas(m->globalPos()).x() << m_canvas->globalToCanvas(m->globalPos()).y();
Modified: trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24785&path=/trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp Tue Dec 28 15:39:55 2021
@@ -109,8 +109,6 @@
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
PageItem *currItem;
- FPoint npf, npf2;
-// QRect tx;
m->accept();
m_canvas->displayCorrectedXYHUD(m->globalPos(), mousePointDoc.x(), mousePointDoc.y());
@@ -184,7 +182,6 @@
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
double Rxp = 0;
double Ryp = 0;
- FPoint npf, npf2;
QTransform pm;
m_mouseButtonPressed = true;
Modified: trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24785&path=/trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawfreehand.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_drawfreehand.cpp Tue Dec 28 15:39:55 2021
@@ -104,8 +104,6 @@
{
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
PageItem *currItem;
- FPoint npf, npf2;
-// QRect tx;
m->accept();
m_canvas->displayCorrectedXYHUD(m->globalPos(), mousePointDoc.x(), mousePointDoc.y());
if (commonMouseMove(m))
@@ -170,8 +168,6 @@
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
double Rxp = 0;
double Ryp = 0;
- FPoint npf, npf2;
-// QRect tx;
QTransform pm;
m_mouseButtonPressed = true;
m_view->HaveSelRect = false;
Modified: trunk/Scribus/scribus/canvasmode_edit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24785&path=/trunk/Scribus/scribus/canvasmode_edit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_edit.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_edit.cpp Tue Dec 28 15:39:55 2021
@@ -392,20 +392,17 @@
void CanvasMode_Edit::mouseMoveEvent(QMouseEvent *m)
{
-// const double mouseX = m->globalX();
-// const double mouseY = m->globalY();
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
double newX, newY;
PageItem *currItem;
- //bool erf = false;
m->accept();
if (commonMouseMove(m))
return;
if (GetItem(&currItem))
{
- newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
- newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
+ newX = qRound(mousePointDoc.x());
+ newY = qRound(mousePointDoc.y());
if (m_doc->DragP)
return;
if (m_canvas->m_viewMode.m_MouseButtonPressed && (m_doc->appMode == modeEdit))
@@ -502,7 +499,6 @@
}
else
{
-// setModeCursor();
m_view->setCursor(QCursor(Qt::ArrowCursor));
}
}
@@ -512,8 +508,8 @@
{
if ((m_canvas->m_viewMode.m_MouseButtonPressed) && (m->buttons() & Qt::LeftButton))
{
- newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
- newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
+ newX = qRound(mousePointDoc.x());
+ newY = qRound(mousePointDoc.y());
SeRx = newX;
SeRy = newY;
QPoint startP = m_canvas->canvasToGlobal(QPointF(Mxp, Myp));
@@ -541,27 +537,21 @@
ss->set("ETEA", QString(""));
}
}
-// const double mouseX = m->globalX();
-// const double mouseY = m->globalY();
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
bool inText;
PageItem *currItem;
m_canvas->PaintSizeRect(QRect());
- FPoint npf, npf2;
QTransform pm;
m_canvas->m_viewMode.m_MouseButtonPressed = true;
m_canvas->m_viewMode.operItemMoving = false;
m_view->HaveSelRect = false;
m_doc->DragP = false;
m_doc->leaveDrag = false;
-// oldClip = 0;
m->accept();
m_view->registerMousePress(m->globalPos());
- Mxp = mousePointDoc.x(); //qRound(m->x()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.x());
- Myp = mousePointDoc.y(); //qRound(m->y()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.y());
-// QRect mpo(m->x()-m_doc->guidesPrefs().grabRad, m->y()-m_doc->guidesPrefs().grabRad, m_doc->guidesPrefs().grabRad*2, m_doc->guidesPrefs().grabRad*2);
-// mpo.moveBy(qRound(m_doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(m_doc->minCanvasCoordinate.y() * m_canvas->scale()));
+ Mxp = mousePointDoc.x();
+ Myp = mousePointDoc.y();
SeRx = Mxp;
SeRy = Myp;
if (m->button() == Qt::MiddleButton)
Modified: trunk/Scribus/scribus/ui/annot.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24785&path=/trunk/Scribus/scribus/ui/annot.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/annot.cpp (original)
+++ trunk/Scribus/scribus/ui/annot.cpp Tue Dec 28 15:39:55 2021
@@ -763,7 +763,7 @@
void ScAnnot::DecodeCalc()
{
- QString tm = "";
+ QString tm;
QString tm2;
QString pfor = m_annotation.C_act();
int ss = pfor.lastIndexOf("(");
Modified: trunk/Scribus/scribus/ui/gtfiledialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24785&path=/trunk/Scribus/scribus/ui/gtfiledialog.h
==============================================================================
--- trunk/Scribus/scribus/ui/gtfiledialog.h (original)
+++ trunk/Scribus/scribus/ui/gtfiledialog.h Tue Dec 28 15:39:55 2021
@@ -29,20 +29,20 @@
QString selectedFile();
public slots:
- virtual void accept();
+ void accept() override;
void fileClicked(const QString &path);
void okClicked();
protected:
PrefsContext* m_fileDialogPrefs { nullptr };
- /** @brief Restore the geometry of the window when showing it. */
- void showEvent(QShowEvent *showEvent) override;
- /** @brief Captures the close event and changes it to hide */
- void closeEvent(QCloseEvent *closeEvent) override;
- /** @brief Stores the geometry of the window when hiding. */
- void hideEvent(QHideEvent* hideEvent) override;
-
+ /** @brief Restore the geometry of the window when showing it. */
+ void showEvent(QShowEvent *showEvent) override;
+ /** @brief Captures the close event and changes it to hide */
+ void closeEvent(QCloseEvent *closeEvent) override;
+ /** @brief Stores the geometry of the window when hiding. */
+ void hideEvent(QHideEvent* hideEvent) override;
+
void storeSize();
void loadSettings();
More information about the scribus-commit
mailing list