r21646 by craig - Some clean up work

scribus-commit scribus-commit at lists.scribus.net
Mon Dec 12 22:14:14 UTC 2016


Author: craig
Date: Mon Dec 12 22:14:13 2016
New Revision: 21646

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21646
Log:
Some clean up work

Modified:
    trunk/Scribus/scribus/canvasmode_normal.cpp
    trunk/Scribus/scribus/chartablemodel.h
    trunk/Scribus/scribus/ui/charselect.cpp
    trunk/Scribus/scribus/ui/charselect.h
    trunk/Scribus/scribus/ui/charselect.ui
    trunk/Scribus/scribus/ui/charselectenhanced.cpp
    trunk/Scribus/scribus/ui/propertywidget_distance.cpp

Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21646&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp	Mon Dec 12 22:14:13 2016
@@ -821,6 +821,7 @@
 
 void CanvasMode_Normal::mousePressEvent(QMouseEvent *m)
 {
+//	qDebug("CanvasMode_Normal::mousePressEvent");
 	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
 	PageItem *currItem;
 
@@ -994,7 +995,7 @@
 
 void CanvasMode_Normal::mouseReleaseEvent(QMouseEvent *m)
 {
-// 	qDebug("CanvasMode_Normal::mouseReleaseEvent");
+//	qDebug("CanvasMode_Normal::mouseReleaseEvent");
 #ifdef GESTURE_FRAME_PREVIEW
         clearPixmapCache();
 #endif // GESTURE_FRAME_PREVIEW
@@ -1006,15 +1007,18 @@
 	m_view->setRedrawMarkerShown(false);
 //	m_view->stopDragTimer();
 	//m_canvas->update(); //ugly in a mouseReleaseEvent!!!!!!!
-	if ((!GetItem(&currItem)) && (m->button() == Qt::RightButton) && (!m_doc->DragP) && (!m_doc->drawAsPreview))
-	{
-		createContextMenu(NULL, mousePointDoc.x(), mousePointDoc.y());
-		return;
-	}
-	if ((GetItem(&currItem)) && (m->button() == Qt::RightButton) && (!m_doc->DragP) && (!(m_doc->drawAsPreview && !m_doc->editOnPreview)))
-	{
-		createContextMenu(currItem, mousePointDoc.x(), mousePointDoc.y());
-		return;
+	if (m->button() == Qt::RightButton && (!m_doc->DragP) )
+	{
+		if ((!GetItem(&currItem)) && (!m_doc->drawAsPreview))
+		{
+			createContextMenu(NULL, mousePointDoc.x(), mousePointDoc.y());
+			return;
+		}
+		if ((GetItem(&currItem)) && (!(m_doc->drawAsPreview && !m_doc->editOnPreview)))
+		{
+			createContextMenu(currItem, mousePointDoc.x(), mousePointDoc.y());
+			return;
+		}
 	}
 	//<<#10116: Click on overflow icon to get into link frame mode
 	PageItem* clickedItem=NULL;

Modified: trunk/Scribus/scribus/chartablemodel.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21646&path=/trunk/Scribus/scribus/chartablemodel.h
==============================================================================
--- trunk/Scribus/scribus/chartablemodel.h	(original)
+++ trunk/Scribus/scribus/chartablemodel.h	Mon Dec 12 22:14:13 2016
@@ -50,7 +50,7 @@
 	void addCharacter(QString ch);
 	CharClassDef characters() {
 		return m_characters;
-	};
+	}
 
 	QStringList fonts() { return m_fonts; }
 

Modified: trunk/Scribus/scribus/ui/charselect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21646&path=/trunk/Scribus/scribus/ui/charselect.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/charselect.cpp	(original)
+++ trunk/Scribus/scribus/ui/charselect.cpp	Mon Dec 12 22:14:13 2016
@@ -30,7 +30,7 @@
 
 	paletteFileMask = tr("Scribus Char Palette (*.ucp);;All Files (*)");
 
-	hideButton->setIcon(IconManager::instance()->loadIcon("16/insert-table.png"));
+	enhancedDialogButton->setIcon(IconManager::instance()->loadIcon("16/insert-table.png"));
 	unicodeButton->setIcon(IconManager::instance()->loadIcon("find.png"));
 	uniLoadButton->setIcon(IconManager::instance()->loadIcon("16/document-open.png"));
 	uniSaveButton->setIcon(IconManager::instance()->loadIcon("16/document-save.png"));
@@ -49,7 +49,7 @@
 	connect(m_userTable->selectionModel(), SIGNAL(selectionChanged(const QItemSelection& ,const QItemSelection&)), this, SLOT(slot_selectionChanged(const QItemSelection&, const QItemSelection&)) );
 	connect(m_userTableModel, SIGNAL(rowAppended()), m_userTable, SLOT(resizeLastRow()));
 	connect(unicodeButton, SIGNAL(chosenUnicode(const QString &)), m_userTableModel, SLOT(appendUnicode(const QString &)));
-	connect(hideButton, SIGNAL(toggled(bool)), this, SLOT(hideButton_toggled(bool)));
+	connect(enhancedDialogButton, SIGNAL(toggled(bool)), this, SLOT(enhancedDialogButton_toggled(bool)));
 	connect(this, SIGNAL(insertUserSpecialChar(QChar, QString)), this, SLOT(slot_insertUserSpecialChar(QChar, QString)));
 	connect(uniLoadButton, SIGNAL(clicked()), this, SLOT(uniLoadButton_clicked()));
 	connect(uniSaveButton, SIGNAL(clicked()), this, SLOT(uniSaveButton_clicked()));
@@ -193,7 +193,7 @@
 	QApplication::changeOverrideCursor(QCursor(Qt::WaitCursor));
 	m_enhanced = new CharSelectEnhanced(this);
 	connect(m_enhanced, SIGNAL(insertSpecialChars(const QVector<uint> &)), this, SLOT(slot_insertSpecialChars(const QVector<uint> &)));
-	connect(m_enhanced, SIGNAL(paletteShown(bool)), hideButton, SLOT(setChecked(bool)));
+	connect(m_enhanced, SIGNAL(paletteShown(bool)), enhancedDialogButton, SLOT(setChecked(bool)));
 	m_enhanced->setDoc(m_doc);
 	m_enhanced->setEnabled(this->isEnabled());
 	m_enhanced->show();
@@ -205,20 +205,20 @@
 	if (!m_enhanced)
 		return;
 
-	hideButton->blockSignals(true);
-	hideButton->setChecked(false);
-	hideButton->blockSignals(false);
+	enhancedDialogButton->blockSignals(true);
+	enhancedDialogButton->setChecked(false);
+	enhancedDialogButton->blockSignals(false);
 
 	disconnect(m_enhanced, SIGNAL(insertSpecialChars(const QVector<uint> &)), this, SLOT(slot_insertSpecialChars(const QVector<uint> &)));
-	disconnect(m_enhanced, SIGNAL(paletteShown(bool)), hideButton, SLOT(setChecked(bool)));
+	disconnect(m_enhanced, SIGNAL(paletteShown(bool)), enhancedDialogButton, SLOT(setChecked(bool)));
 	m_enhanced->close();
 	delete m_enhanced;
 	m_enhanced = 0;
 }
 
-void CharSelect::hideButton_toggled(bool state)
-{
-//     tDebug("hideButton_toggled start");
+void CharSelect::enhancedDialogButton_toggled(bool state)
+{
+//     tDebug("enhancedDialogButton_toggled start");
 	if (!m_doc)
 		return;
 
@@ -227,7 +227,7 @@
 	else
 		openEnhanced();
 
-//     tDebug("hideButton_toggled end");
+//     tDebug("enhancedDialogButton_toggled end");
 }
 
 void CharSelect::hide()

Modified: trunk/Scribus/scribus/ui/charselect.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21646&path=/trunk/Scribus/scribus/ui/charselect.h
==============================================================================
--- trunk/Scribus/scribus/ui/charselect.h	(original)
+++ trunk/Scribus/scribus/ui/charselect.h	Mon Dec 12 22:14:13 2016
@@ -83,15 +83,16 @@
 	void closeEnhanced();
 
 private slots:
-	void userNewChar(uint i, QString font);
-	void hideButton_toggled(bool);
+	void enhancedDialogButton_toggled(bool);
 	void slot_insertSpecialChar();
 	void slot_insertSpecialChars(const QVector<uint> & chars);
 	void slot_insertUserSpecialChar(QChar, QString font);
 	void slot_selectionChanged( const QItemSelection&, const QItemSelection& );
+	void uniClearButton_clicked();
 	void uniLoadButton_clicked();
 	void uniSaveButton_clicked();
-	void uniClearButton_clicked();
+	void userNewChar(uint i, QString font);
+
 };
 
 #endif

Modified: trunk/Scribus/scribus/ui/charselect.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21646&path=/trunk/Scribus/scribus/ui/charselect.ui
==============================================================================
--- trunk/Scribus/scribus/ui/charselect.ui	(original)
+++ trunk/Scribus/scribus/ui/charselect.ui	Mon Dec 12 22:14:13 2016
@@ -20,7 +20,7 @@
       <number>1</number>
      </property>
      <item>
-      <widget class="QPushButton" name="hideButton">
+      <widget class="QPushButton" name="enhancedDialogButton">
        <property name="toolTip">
         <string>Show/Hide Enhanced Palette</string>
        </property>
@@ -103,7 +103,7 @@
   </customwidget>
  </customwidgets>
  <tabstops>
-  <tabstop>hideButton</tabstop>
+  <tabstop>enhancedDialogButton</tabstop>
   <tabstop>unicodeButton</tabstop>
   <tabstop>uniLoadButton</tabstop>
   <tabstop>uniSaveButton</tabstop>

Modified: trunk/Scribus/scribus/ui/charselectenhanced.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21646&path=/trunk/Scribus/scribus/ui/charselectenhanced.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/charselectenhanced.cpp	(original)
+++ trunk/Scribus/scribus/ui/charselectenhanced.cpp	Mon Dec 12 22:14:13 2016
@@ -37,8 +37,7 @@
 	connect(m_charTable, SIGNAL(selectChar(uint, QString)), this, SLOT(newChar(uint, QString)));
 	connect(fontSelector, SIGNAL(activated(int)), this, SLOT(newFont(int)));
 	connect(rangeSelector, SIGNAL(activated(int)), this, SLOT(newCharClass(int)));
-	connect(hexLineEdit, SIGNAL(returnPressed()),
-			this, SLOT(hexLineEdit_returnPressed()));
+	connect(hexLineEdit, SIGNAL(returnPressed()), this, SLOT(hexLineEdit_returnPressed()));
 }
 
 CharSelectEnhanced::~CharSelectEnhanced()

Modified: trunk/Scribus/scribus/ui/propertywidget_distance.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21646&path=/trunk/Scribus/scribus/ui/propertywidget_distance.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertywidget_distance.cpp	(original)
+++ trunk/Scribus/scribus/ui/propertywidget_distance.cpp	Mon Dec 12 22:14:13 2016
@@ -132,7 +132,7 @@
 	if (columnGapLabel->currentIndex() == 0)
 	{
 		columnGap->setMaximum(qMax((textItem->width() / textItem->Cols - textItem->textToFrameDistLeft() - textItem->textToFrameDistRight()) * m_unitRatio, 0.0));
-		columnGap->setValue(textItem->ColGap*m_unitRatio);
+		columnGap->setValue(textItem->ColGap * m_unitRatio);
 	}
 	else
 	{
@@ -318,17 +318,16 @@
 	PageItem *textItem = m_item;
 	if (m_doc->appMode == modeEditTable)
 		textItem = m_item->asTable()->activeCell().textFrame();
-	if (!textItem) return;
+	if (!textItem)
+		return;
 
 	if (columnGapLabel->currentIndex() == 0)
 		textItem->setColumnGap(columnGap->value() / m_unitRatio);
 	else
 	{
-		double lineCorr;
+		double lineCorr=0.0;
 		if ((textItem->lineColor() != CommonStrings::None) || (!textItem->strokePattern().isEmpty()))
 			lineCorr = textItem->lineWidth();
-		else
-			lineCorr = 0;
 		double newWidth = columnGap->value() / m_unitRatio;
 		double newGap = qMax(((textItem->width() - textItem->textToFrameDistLeft() - textItem->textToFrameDistRight() - lineCorr) - (newWidth * textItem->Cols)) / (textItem->Cols - 1), 0.0);
 		textItem->setColumnGap(newGap);




More information about the scribus-commit mailing list