r22638 by craig - clazy and clang fixes, part 16
scribus-commit
scribus-commit at lists.scribus.net
Mon Aug 20 19:01:43 UTC 2018
Author: craig
Date: Mon Aug 20 19:01:43 2018
New Revision: 22638
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22638
Log:
clazy and clang fixes, part 16
Modified:
trunk/Scribus/scribus/actionmanager.cpp
trunk/Scribus/scribus/appmodehelper.cpp
trunk/Scribus/scribus/canvasgesture_linemove.cpp
trunk/Scribus/scribus/canvasgesture_resize.cpp
trunk/Scribus/scribus/canvasmode.cpp
trunk/Scribus/scribus/canvasmode_create.cpp
trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
trunk/Scribus/scribus/canvasmode_editgradient.cpp
trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
trunk/Scribus/scribus/canvasmode_editweldpoint.cpp
trunk/Scribus/scribus/canvasmode_imageimport.cpp
trunk/Scribus/scribus/canvasmode_nodeedit.cpp
trunk/Scribus/scribus/canvasmode_normal.cpp
trunk/Scribus/scribus/documentchecker.cpp
trunk/Scribus/scribus/downloadmanager/scdlmgr.cpp
trunk/Scribus/scribus/exif.cpp
trunk/Scribus/scribus/filewatcher.cpp
trunk/Scribus/scribus/fontlistmodel.cpp
trunk/Scribus/scribus/gtaction.cpp
trunk/Scribus/scribus/imagedataloaders/scimgdataloader_kra.cpp
trunk/Scribus/scribus/imagedataloaders/scimgdataloader_psd.cpp
trunk/Scribus/scribus/imagedataloaders/scimgdataloader_wpg.cpp
trunk/Scribus/scribus/ioapi.c
trunk/Scribus/scribus/langmgr.cpp
trunk/Scribus/scribus/latexhelpers.cpp
trunk/Scribus/scribus/localemgr.cpp
trunk/Scribus/scribus/pageitem.cpp
trunk/Scribus/scribus/pageitem_imageframe.cpp
trunk/Scribus/scribus/pageitem_polyline.cpp
trunk/Scribus/scribus/pageitem_spiral.cpp
trunk/Scribus/scribus/pageitem_textframe.cpp
trunk/Scribus/scribus/palettes/cxftristimulusspec.cpp
trunk/Scribus/scribus/pdflib_core.cpp
trunk/Scribus/scribus/pdfoptionsio.cpp
trunk/Scribus/scribus/pdfwriter.cpp
trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
trunk/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp
trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp
trunk/Scribus/scribus/plugins/scriptplugin/cmdannotations.cpp
trunk/Scribus/scribus/plugins/scriptplugin/cmdcolor.cpp
trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp
trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp
trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp
trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.cpp
trunk/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
trunk/Scribus/scribus/plugins/short-words/swdialog.cpp
trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
trunk/Scribus/scribus/prefscontext.cpp
trunk/Scribus/scribus/prefsfile.cpp
trunk/Scribus/scribus/prefsmanager.cpp
trunk/Scribus/scribus/pslib.cpp
trunk/Scribus/scribus/scfonts.cpp
trunk/Scribus/scribus/scpainterex_ps2.cpp
trunk/Scribus/scribus/scpaths.cpp
trunk/Scribus/scribus/scprintengine_ps.cpp
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribusapp.cpp
trunk/Scribus/scribus/scribuscore.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/scribusview.cpp
trunk/Scribus/scribus/styles/tablestyle.cpp
trunk/Scribus/scribus/text/storytext.cpp
trunk/Scribus/scribus/ui/about.cpp
trunk/Scribus/scribus/ui/colorsandfills.cpp
trunk/Scribus/scribus/ui/cpalette.cpp
trunk/Scribus/scribus/ui/customfdialog.cpp
trunk/Scribus/scribus/ui/effectsdialog.cpp
trunk/Scribus/scribus/ui/filedialogeventcatcher.cpp
trunk/Scribus/scribus/ui/fontcombo.cpp
trunk/Scribus/scribus/ui/fontembeddingmodel.cpp
trunk/Scribus/scribus/ui/gradientaddedit.cpp
trunk/Scribus/scribus/ui/helpbrowser.cpp
trunk/Scribus/scribus/ui/hruler.cpp
trunk/Scribus/scribus/ui/inlinepalette.cpp
trunk/Scribus/scribus/ui/latexeditor.cpp
trunk/Scribus/scribus/ui/newfile.cpp
trunk/Scribus/scribus/ui/pdfexportdialog.cpp
trunk/Scribus/scribus/ui/picstatus.cpp
trunk/Scribus/scribus/ui/prefs_documentsections.cpp
trunk/Scribus/scribus/ui/prefs_externaltools.cpp
trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
trunk/Scribus/scribus/ui/preview.cpp
trunk/Scribus/scribus/ui/propertiespalette_group.cpp
trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
trunk/Scribus/scribus/ui/propertiespalette_text.cpp
trunk/Scribus/scribus/ui/proptree.cpp
trunk/Scribus/scribus/ui/query.cpp
trunk/Scribus/scribus/ui/scmenu.cpp
trunk/Scribus/scribus/ui/scrapbookpalette.cpp
trunk/Scribus/scribus/ui/search.cpp
trunk/Scribus/scribus/ui/smcellstylewidget.cpp
trunk/Scribus/scribus/ui/smcstylewidget.cpp
trunk/Scribus/scribus/ui/smpstylewidget.cpp
trunk/Scribus/scribus/ui/smtablestylewidget.cpp
trunk/Scribus/scribus/ui/smtextstyles.cpp
trunk/Scribus/scribus/ui/storyeditor.cpp
trunk/Scribus/scribus/ui/stylemanager.cpp
trunk/Scribus/scribus/ui/symbolpalette.cpp
trunk/Scribus/scribus/ui/tabpdfoptions.cpp
trunk/Scribus/scribus/ui/tabruler.cpp
trunk/Scribus/scribus/ui/unicodesearch.cpp
Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp (original)
+++ trunk/Scribus/scribus/actionmanager.cpp Mon Aug 20 19:01:43 2018
@@ -2039,7 +2039,7 @@
void ActionManager::createDefaultMenus()
{ //CB TODO use this to also create the menus
- if (defMenuNames.size()==0)
+ if (defMenuNames.empty())
createDefaultMenuNames();
defMenus.clear();
@@ -2405,7 +2405,7 @@
void ActionManager::createDefaultNonMenuActions()
{ //CB TODO use this to also create the menus
- if (defNonMenuNames.size()==0)
+ if (defNonMenuNames.empty())
createDefaultNonMenuNames();
defNonMenuActions.clear();
Modified: trunk/Scribus/scribus/appmodehelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/appmodehelper.cpp
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.cpp (original)
+++ trunk/Scribus/scribus/appmodehelper.cpp Mon Aug 20 19:01:43 2018
@@ -76,7 +76,6 @@
a_actMgr->disconnectModeActions();
setModeActionsPerMode(newMode);
a_actMgr->connectModeActions();
- return;
}
void AppModeHelper::setApplicationMode(ScribusMainWindow* scmw, ScribusDoc* doc, int newMode)
@@ -1166,7 +1165,7 @@
if (b2)
{
(*a_scrActions)["fileSave"]->setEnabled(!doc->isConverted);
- bool setter = doc->DocPages.count() > 1 ? true : false;
+ bool setter = doc->DocPages.count() > 1;
(*a_scrActions)["pageDelete"]->setEnabled(setter);
(*a_scrActions)["pageMove"]->setEnabled(setter);
}
@@ -1211,7 +1210,7 @@
(*a_scrActions)["fileSave"]->setEnabled(!doc->isConverted);
if ( ScCore->haveGS() || ScCore->isWinGUI() )
(*a_scrActions)["PrintPreview"]->setEnabled(true);
- bool setter = doc->DocPages.count() > 1 ? true : false;
+ bool setter = doc->DocPages.count() > 1;
(*a_scrActions)["pageDelete"]->setEnabled(setter);
(*a_scrActions)["pageMove"]->setEnabled(setter);
}
@@ -1259,7 +1258,7 @@
(*a_scrActions)["fileSave"]->setEnabled(!doc->isConverted);
if ( ScCore->haveGS() || ScCore->isWinGUI() )
(*a_scrActions)["PrintPreview"]->setEnabled(true);
- bool setter = doc->DocPages.count() > 1 ? true : false;
+ bool setter = doc->DocPages.count() > 1;
(*a_scrActions)["pageDelete"]->setEnabled(setter);
(*a_scrActions)["pageMove"]->setEnabled(setter);
}
@@ -1453,7 +1452,7 @@
(*a_scrActions)["toolsPDFAnnot3D"]->setEnabled(true);
#endif
(*a_scrActions)["toolsPreflightVerifier"]->setEnabled(true);
- bool setter = doc->DocPages.count() > 1 ? true : false;
+ bool setter = doc->DocPages.count() > 1;
(*a_scrActions)["pageDelete"]->setEnabled(setter);
(*a_scrActions)["pageMove"]->setEnabled(setter);
(*a_scrActions)["pageInsert"]->setEnabled(true);
@@ -1514,7 +1513,7 @@
if (!doc->isModified())
{
- bool setter = doc->DocPages.count() > 1 ? true : false;
+ bool setter = doc->DocPages.count() > 1;
(*a_scrActions)["pageDelete"]->setEnabled(setter);
(*a_scrActions)["pageMove"]->setEnabled(setter);
}
Modified: trunk/Scribus/scribus/canvasgesture_linemove.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/canvasgesture_linemove.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_linemove.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_linemove.cpp Mon Aug 20 19:01:43 2018
@@ -65,8 +65,7 @@
double rot = xy2Deg(m_bounds.width(), m_bounds.height());
if (rot < 0.0)
return 360 + rot;
- else
- return rot;
+ return rot;
}
Modified: trunk/Scribus/scribus/canvasgesture_resize.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/canvasgesture_resize.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_resize.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_resize.cpp Mon Aug 20 19:01:43 2018
@@ -57,7 +57,7 @@
m_handle = Canvas::OUTSIDE;
return;
}
- else if (m_doc->m_Selection->isMultipleSelection())
+ if (m_doc->m_Selection->isMultipleSelection())
{
double ex, ey, eh, ew;
m_doc->m_Selection->getGroupRect(&ex, &ey, &ew, &eh);
Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Mon Aug 20 19:01:43 2018
@@ -75,7 +75,6 @@
#include <QPointF>
CanvasMode::CanvasMode (ScribusView* view) :
- QObject(),
m_view(view),
m_canvas(view->m_canvas),
m_doc(view->Doc),
Modified: trunk/Scribus/scribus/canvasmode_create.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/canvasmode_create.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_create.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_create.cpp Mon Aug 20 19:01:43 2018
@@ -69,7 +69,7 @@
inItemCreation = false;
createObjectMode = 0;
createObjectSubMode = 0;
- modifiers = 0;
+ modifiers = Qt::NoModifier;
m_MouseButtonPressed = false;
m_createTransaction = nullptr;
}
Modified: trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp Mon Aug 20 19:01:43 2018
@@ -117,7 +117,7 @@
{
double newXF = mousePointDoc.x(); //m_view->translateToDoc(m->x(), m->y()).x();
double newYF = mousePointDoc.y(); //m_view->translateToDoc(m->x(), m->y()).y();
- if (RecordP.size() > 0)
+ if (!RecordP.empty())
{
if (FPoint(newXF, newYF) != RecordP.point(RecordP.size()-1))
RecordP.addPoint(FPoint(newXF, newYF));
Modified: trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawfreehand.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_drawfreehand.cpp Mon Aug 20 19:01:43 2018
@@ -112,7 +112,7 @@
{
double newXF = mousePointDoc.x(); //m_view->translateToDoc(m->x(), m->y()).x();
double newYF = mousePointDoc.y(); //m_view->translateToDoc(m->x(), m->y()).y();
- if (RecordP.size() > 0)
+ if (!RecordP.empty())
{
if (FPoint(newXF, newYF) != RecordP.point(RecordP.size()-1))
RecordP.addPoint(FPoint(newXF, newYF));
Modified: trunk/Scribus/scribus/canvasmode_editgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/canvasmode_editgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editgradient.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editgradient.cpp Mon Aug 20 19:01:43 2018
@@ -294,13 +294,10 @@
}
return;
}
- else
- {
- if (!(GetItem(&currItem) && (m_doc->appMode == modeEdit) && currItem->asTextFrame()))
- {
- mousePressEvent(m);
- return;
- }
+ if (!(GetItem(&currItem) && (m_doc->appMode == modeEdit) && currItem->asTextFrame()))
+ {
+ mousePressEvent(m);
+ return;
}
}
}
Modified: trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editmeshgradient.cpp Mon Aug 20 19:01:43 2018
@@ -554,13 +554,10 @@
}
return;
}
- else
- {
- if (!(GetItem(&currItem) && (m_doc->appMode == modeEdit) && currItem->asTextFrame()))
- {
- mousePressEvent(m);
- return;
- }
+ if (!(GetItem(&currItem) && (m_doc->appMode == modeEdit) && currItem->asTextFrame()))
+ {
+ mousePressEvent(m);
+ return;
}
}
}
Modified: trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editmeshpatch.cpp Mon Aug 20 19:01:43 2018
@@ -265,7 +265,7 @@
{
psx->drawPoint(m_clickPointPolygon.value(col));
}
- if (m_clickPointPolygon.size() > 0)
+ if (!m_clickPointPolygon.empty())
{
psx->setPen(p1bd);
psx->drawLine(m_clickPointPolygon.value(m_clickPointPolygon.count() - 1), m_currentPoint);
@@ -553,13 +553,10 @@
}
return;
}
- else
- {
- if (!(GetItem(&m_currItem) && (m_doc->appMode == modeEdit) && m_currItem->asTextFrame()))
- {
- mousePressEvent(m);
- return;
- }
+ if (!(GetItem(&m_currItem) && (m_doc->appMode == modeEdit) && m_currItem->asTextFrame()))
+ {
+ mousePressEvent(m);
+ return;
}
}
}
Modified: trunk/Scribus/scribus/canvasmode_editweldpoint.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/canvasmode_editweldpoint.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_editweldpoint.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_editweldpoint.cpp Mon Aug 20 19:01:43 2018
@@ -335,13 +335,10 @@
}
return;
}
- else
- {
- if (!(GetItem(&m_currItem) && (m_doc->appMode == modeEdit) && m_currItem->asTextFrame()))
- {
- mousePressEvent(m);
- return;
- }
+ if (!(GetItem(&m_currItem) && (m_doc->appMode == modeEdit) && m_currItem->asTextFrame()))
+ {
+ mousePressEvent(m);
+ return;
}
}
}
Modified: trunk/Scribus/scribus/canvasmode_imageimport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/canvasmode_imageimport.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_imageimport.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_imageimport.cpp Mon Aug 20 19:01:43 2018
@@ -191,7 +191,7 @@
m->accept();
m_view->registerMousePress(m->globalPos());
PageItem *item;
- if(m_imageList.size()>0)
+ if(!m_imageList.empty())
{
if((item = m_canvas->itemUnderCursor(m->globalPos())) != nullptr)
{
Modified: trunk/Scribus/scribus/canvasmode_nodeedit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/canvasmode_nodeedit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.cpp Mon Aug 20 19:01:43 2018
@@ -67,7 +67,7 @@
p->setPen(QPen(Qt::blue, 1 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
p->setBrush(Qt::NoBrush);
- if ((m_doc->nodeEdit.isContourLine()) && (currItem->ContourLine.size() != 0))
+ if ((m_doc->nodeEdit.isContourLine()) && (!currItem->ContourLine.empty()))
cli = currItem->ContourLine;
else
{
Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Mon Aug 20 19:01:43 2018
@@ -537,8 +537,8 @@
if (abs(dX) > abs(dY))
dY=0;
else
- if (abs(dY) > abs(dX))
- dX=0;
+ if (abs(dY) > abs(dX))
+ dX=0;
erf=false;
dX+=qRound(m_dragConstrainInitPtX-currItem->xPos());
dY+=qRound(m_dragConstrainInitPtY-currItem->yPos());
@@ -1614,13 +1614,10 @@
// qDebug()<<"Out Of SeleItem"<<__LINE__;
return true;
}
- else
- {
// If we call startGesture now, a new guide is created each time.
// ### could be a weakness to avoid calling it tho.
// m_view->startGesture(guideMoveGesture);
- m_guideMoveGesture->mouseSelectGuide(m);
- }
+ m_guideMoveGesture->mouseSelectGuide(m);
}
}
}
Modified: trunk/Scribus/scribus/documentchecker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/documentchecker.cpp
==============================================================================
--- trunk/Scribus/scribus/documentchecker.cpp (original)
+++ trunk/Scribus/scribus/documentchecker.cpp Mon Aug 20 19:01:43 2018
@@ -328,7 +328,7 @@
itemError.insert(DeviceColorsAndOutputIntent, 0);
break;
}
- else if (currPrintProfCS == ColorSpace_Rgb && (usedColorSpaces[i] == CS_DeviceCMYK || usedColorSpaces[i] == CS_DeviceGray))
+ if (currPrintProfCS == ColorSpace_Rgb && (usedColorSpaces[i] == CS_DeviceCMYK || usedColorSpaces[i] == CS_DeviceGray))
{
itemError.insert(DeviceColorsAndOutputIntent, 0);
break;
@@ -577,7 +577,7 @@
itemError.insert(DeviceColorsAndOutputIntent, 0);
break;
}
- else if (currPrintProfCS == ColorSpace_Rgb && (usedColorSpaces[i] == CS_DeviceCMYK || usedColorSpaces[i] == CS_DeviceGray))
+ if (currPrintProfCS == ColorSpace_Rgb && (usedColorSpaces[i] == CS_DeviceCMYK || usedColorSpaces[i] == CS_DeviceGray))
{
itemError.insert(DeviceColorsAndOutputIntent, 0);
break;
Modified: trunk/Scribus/scribus/downloadmanager/scdlmgr.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/downloadmanager/scdlmgr.cpp
==============================================================================
--- trunk/Scribus/scribus/downloadmanager/scdlmgr.cpp (original)
+++ trunk/Scribus/scribus/downloadmanager/scdlmgr.cpp Mon Aug 20 19:01:43 2018
@@ -7,7 +7,7 @@
#include <QStringList>
#include <QTimer>
-#include <stdio.h>
+#include <cstdio>
#include "util_file.h"
@@ -19,7 +19,7 @@
connect(m_thread, SIGNAL(fileReceived(const QString &)), this, SLOT(dlReceived(const QString&)));
connect(m_thread, SIGNAL(fileFailed(const QString &)), this, SLOT(dlFailed(const QString&)));
connect(m_thread, SIGNAL(fileStarted(const QString &)), this, SLOT(dlStarted(const QString &)));
- connect(m_thread, SIGNAL(fileDownloadProgress(qint64, qint64)), this, SIGNAL(fileDownloadProgress(qint64, qint64)));
+ connect(m_thread, SIGNAL(fileDownloadProgress(qint64,qint64)), this, SIGNAL(fileDownloadProgress(qint64,qint64)));
//connect(thread, SIGNAL(finished()), this, SIGNAL(finished()));
connect(m_thread, SIGNAL(finished()), this, SLOT(moveFinishedDownloads()));
}
Modified: trunk/Scribus/scribus/exif.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/exif.cpp
==============================================================================
--- trunk/Scribus/scribus/exif.cpp (original)
+++ trunk/Scribus/scribus/exif.cpp Mon Aug 20 19:01:43 2018
@@ -351,13 +351,8 @@
int ExifData::Get16u ( void * Short )
{
if ( MotorolaOrder )
- {
return ( ( ( uchar * ) Short ) [0] << 8 ) | ( ( uchar * ) Short ) [1];
- }
- else
- {
- return ( ( ( uchar * ) Short ) [1] << 8 ) | ( ( uchar * ) Short ) [0];
- }
+ return ( ( ( uchar * ) Short ) [1] << 8 ) | ( ( uchar * ) Short ) [0];
}
//--------------------------------------------------------------------------
@@ -368,13 +363,10 @@
if ( MotorolaOrder )
{
return ( ( ( char * ) Long ) [0] << 24 ) | ( ( ( uchar * ) Long ) [1] << 16 )
- | ( ( ( uchar * ) Long ) [2] << 8 ) | ( ( ( uchar * ) Long ) [3] << 0 );
- }
- else
- {
- return ( ( ( char * ) Long ) [3] << 24 ) | ( ( ( uchar * ) Long ) [2] << 16 )
- | ( ( ( uchar * ) Long ) [1] << 8 ) | ( ( ( uchar * ) Long ) [0] << 0 );
- }
+ | ( ( ( uchar * ) Long ) [2] << 8 ) | ( ( ( uchar * ) Long ) [3] << 0 );
+ }
+ return ( ( ( char * ) Long ) [3] << 24 ) | ( ( ( uchar * ) Long ) [2] << 16 )
+ | ( ( ( uchar * ) Long ) [1] << 8 ) | ( ( ( uchar * ) Long ) [0] << 0 );
}
//--------------------------------------------------------------------------
Modified: trunk/Scribus/scribus/filewatcher.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/filewatcher.cpp
==============================================================================
--- trunk/Scribus/scribus/filewatcher.cpp (original)
+++ trunk/Scribus/scribus/filewatcher.cpp Mon Aug 20 19:01:43 2018
@@ -169,71 +169,59 @@
toRemove.append(it.key());
continue;
}
- else
+ it.value().pendingCount = 5;
+ it.value().pending = true;
+ emit statePending(it.key());
+ continue;
+ }
+ if (it.value().pendingCount != 0)
+ {
+ it.value().pendingCount--;
+ continue;
+ }
+ it.value().pending = false;
+ if (it.value().isDir)
+ emit dirDeleted(it.key());
+ else
+ emit fileDeleted(it.key());
+ if (m_stateFlags & FileCheckMustStop)
+ break;
+ it.value().refCount--;
+ if (it.value().refCount == 0)
+ toRemove.append(it.key());
+ continue;
+ }
+ //qDebug()<<it.key();
+ it.value().pending = false;
+ time = it.value().info.lastModified();
+ if (time != it.value().timeInfo)
+ {
+ // qDebug()<<"Times different: last modified:"<<time<<"\t recorded time:"<<it.value().timeInfo;
+ if (it.value().isDir)
+ {
+ // qDebug()<<"dir, ignoring"<<it.key();
+ it.value().timeInfo = time;
+ if (!(m_stateFlags & FileCheckMustStop))
+ emit dirChanged(it.key());
+ }
+ else
+ {
+ uint sizeo = it.value().info.size();
+ usleep(100);
+ it.value().info.refresh();
+ uint sizen = it.value().info.size();
+ // qDebug()<<"Size comparison"<<sizeo<<sizen<<it.key();
+ while (sizen != sizeo)
{
- it.value().pendingCount = 5;
- it.value().pending = true;
- emit statePending(it.key());
- continue;
- }
- }
- else
- {
- if (it.value().pendingCount != 0)
- {
- it.value().pendingCount--;
- continue;
- }
- else
- {
- it.value().pending = false;
- if (it.value().isDir)
- emit dirDeleted(it.key());
- else
- emit fileDeleted(it.key());
- if (m_stateFlags & FileCheckMustStop)
- break;
- it.value().refCount--;
- if (it.value().refCount == 0)
- toRemove.append(it.key());
- continue;
- }
- }
- }
- else
- {
- //qDebug()<<it.key();
- it.value().pending = false;
- time = it.value().info.lastModified();
- if (time != it.value().timeInfo)
- {
-// qDebug()<<"Times different: last modified:"<<time<<"\t recorded time:"<<it.value().timeInfo;
- if (it.value().isDir)
- {
-// qDebug()<<"dir, ignoring"<<it.key();
- it.value().timeInfo = time;
- if (!(m_stateFlags & FileCheckMustStop))
- emit dirChanged(it.key());
- }
- else
- {
- uint sizeo = it.value().info.size();
+ sizeo = sizen;
usleep(100);
it.value().info.refresh();
- uint sizen = it.value().info.size();
-// qDebug()<<"Size comparison"<<sizeo<<sizen<<it.key();
- while (sizen != sizeo)
- {
- sizeo = sizen;
- usleep(100);
- it.value().info.refresh();
- sizen = it.value().info.size();
- }
- it.value().timeInfo = time;
- if (m_stateFlags & FileCheckMustStop)
- break;
- emit fileChanged(it.key());
+ sizen = it.value().info.size();
}
+ it.value().timeInfo = time;
+ if (m_stateFlags & FileCheckMustStop)
+ break;
+ emit fileChanged(it.key());
}
}
}
Modified: trunk/Scribus/scribus/fontlistmodel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/fontlistmodel.cpp
==============================================================================
--- trunk/Scribus/scribus/fontlistmodel.cpp (original)
+++ trunk/Scribus/scribus/fontlistmodel.cpp Mon Aug 20 19:01:43 2018
@@ -232,8 +232,7 @@
if (index.column() == FontListModel::FontUsable
|| index.column() == FontListModel::FontSubset)
return Qt::ItemIsUserCheckable | /*Qt::ItemIsEditable |*/ defaultFlags;
- else
- return defaultFlags;
+ return defaultFlags;
}
bool FontListModel::setData(const QModelIndex & idx,
Modified: trunk/Scribus/scribus/gtaction.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/gtaction.cpp
==============================================================================
--- trunk/Scribus/scribus/gtaction.cpp (original)
+++ trunk/Scribus/scribus/gtaction.cpp Mon Aug 20 19:01:43 2018
@@ -356,8 +356,7 @@
m_noteStory = nullptr;
return;
}
- else
- story->insertChars(pos, QString(ch));
+ story->insertChars(pos, QString(ch));
if (ch == SpecialChars::PARSEP)
{
if (paraStyle.hasName())
Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_kra.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_kra.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_kra.cpp (original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_kra.cpp Mon Aug 20 19:01:43 2018
@@ -19,7 +19,7 @@
void ScImgDataLoader_KRA::initSupportedFormatList()
{
m_supportedFormats.clear();
- m_supportedFormats.append("kra");
+ m_supportedFormats.append("kra");
}
void ScImgDataLoader_KRA::loadEmbeddedProfile(const QString& fn, int /*page*/)
@@ -43,47 +43,47 @@
m_imageInfoRecord.PDSpathData.clear();
ScZipHandler *uz = new ScZipHandler();
- if (!uz->open(fn))
+ if (!uz->open(fn))
{
delete uz;
return false;
}
- // if thumbnail is set to true, this function is loading the thumbnail image into the preview area
- // if thumbnail is set to false, this function is loading the main image
+ // if thumbnail is set to true, this function is loading the thumbnail image into the preview area
+ // if thumbnail is set to false, this function is loading the main image
if (thumbnail)
{
- if (uz->contains("preview.png"))
+ if (uz->contains("preview.png"))
{
- QByteArray im;
+ QByteArray im;
- if (uz->read("preview.png", im))
+ if (uz->read("preview.png", im))
{
- m_image = QImage::fromData(im);
+ m_image = QImage::fromData(im);
- if (uz->contains("maindoc.xml"))
+ if (uz->contains("maindoc.xml"))
{
QByteArray f;
- if (uz->read("maindoc.xml", f))
+ if (uz->read("maindoc.xml", f))
{
QDomDocument designMapDom;
if(designMapDom.setContent(f))
- {
- QDomElement docElem = designMapDom.documentElement().firstChildElement("IMAGE");
- m_imageInfoRecord.exifInfo.height = docElem.attribute("height", "0").toInt();
- m_imageInfoRecord.exifInfo.width = docElem.attribute("width", "0").toInt();
+ {
+ QDomElement docElem = designMapDom.documentElement().firstChildElement("IMAGE");
+ m_imageInfoRecord.exifInfo.height = docElem.attribute("height", "0").toInt();
+ m_imageInfoRecord.exifInfo.width = docElem.attribute("width", "0").toInt();
- // sanitize values for x-res and y-res. some older versions of Krita had resolutions like "76,0000023"
- QString xResClean = docElem.attribute("x-res", "72").replace(",", ".");
- QString yResClean = docElem.attribute("y-res", "72").replace(",", ".");
+ // sanitize values for x-res and y-res. some older versions of Krita had resolutions like "76,0000023"
+ QString xResClean = docElem.attribute("x-res", "72").replace(",", ".");
+ QString yResClean = docElem.attribute("y-res", "72").replace(",", ".");
- // strip out all decimal stuff since we cannot have that.
- xResClean = xResClean.split(".").at(0);
- yResClean = yResClean.split(".").at(0);
+ // strip out all decimal stuff since we cannot have that.
+ xResClean = xResClean.split(".").at(0);
+ yResClean = yResClean.split(".").at(0);
- m_imageInfoRecord.xres = xResClean.toInt();
- m_imageInfoRecord.yres = yResClean.toInt();
+ m_imageInfoRecord.xres = xResClean.toInt();
+ m_imageInfoRecord.yres = yResClean.toInt();
}
}
}
@@ -93,38 +93,38 @@
else
{
- delete uz;
+ delete uz;
return false;
}
}
}
else
{
- if (uz->contains("maindoc.xml"))
+ if (uz->contains("maindoc.xml"))
{
QByteArray f;
- if (uz->read("maindoc.xml", f))
+ if (uz->read("maindoc.xml", f))
{
- QDomDocument designMapDom;
+ QDomDocument designMapDom;
if(designMapDom.setContent(f))
{
- QDomElement docElem = designMapDom.documentElement().firstChildElement("IMAGE");
- m_imageInfoRecord.exifInfo.height = docElem.attribute("height", "0").toInt();
- m_imageInfoRecord.exifInfo.width = docElem.attribute("width", "0").toInt();
+ QDomElement docElem = designMapDom.documentElement().firstChildElement("IMAGE");
+ m_imageInfoRecord.exifInfo.height = docElem.attribute("height", "0").toInt();
+ m_imageInfoRecord.exifInfo.width = docElem.attribute("width", "0").toInt();
- // sanitize values for x-res and y-res. some older versions of Krita had resolutions like "76,0000023"
- QString xResClean = docElem.attribute("x-res", "72").replace(",", ".");
- QString yResClean = docElem.attribute("y-res", "72").replace(",", ".");
+ // sanitize values for x-res and y-res. some older versions of Krita had resolutions like "76,0000023"
+ QString xResClean = docElem.attribute("x-res", "72").replace(",", ".");
+ QString yResClean = docElem.attribute("y-res", "72").replace(",", ".");
- // strip out all decimal stuff since we cannot have that.
- xResClean = xResClean.split(".").at(0);
- yResClean = yResClean.split(".").at(0);
+ // strip out all decimal stuff since we cannot have that.
+ xResClean = xResClean.split(".").at(0);
+ yResClean = yResClean.split(".").at(0);
- m_imageInfoRecord.xres = xResClean.toInt();
- m_imageInfoRecord.yres = yResClean.toInt();
+ m_imageInfoRecord.xres = xResClean.toInt();
+ m_imageInfoRecord.yres = yResClean.toInt();
m_image = QImage(m_imageInfoRecord.exifInfo.width, m_imageInfoRecord.exifInfo.height, QImage::Format_ARGB32_Premultiplied);
@@ -135,24 +135,24 @@
return false;
}
- // load the mergedimage.png into the painter
- if (uz->contains("mergedimage.png"))
- {
- QByteArray im;
+ // load the mergedimage.png into the painter
+ if (uz->contains("mergedimage.png"))
+ {
+ QByteArray im;
- if (uz->read("mergedimage.png", im))
- {
- m_image.fill( qRgba(0, 0, 0, 0) );
- m_image = QImage::fromData(im);
- }
- }
+ if (uz->read("mergedimage.png", im))
+ {
+ m_image.fill( qRgba(0, 0, 0, 0) );
+ m_image = QImage::fromData(im);
+ }
+ }
- m_image = m_image.convertToFormat(QImage::Format_ARGB32);
+ m_image = m_image.convertToFormat(QImage::Format_ARGB32);
m_imageInfoRecord.valid = true;
m_image.setDotsPerMeterX((int) (m_imageInfoRecord.xres / 0.0254));
m_image.setDotsPerMeterY((int) (m_imageInfoRecord.yres / 0.0254));
m_imageInfoRecord.BBoxX = 0;
- m_imageInfoRecord.BBoxH = m_image.height();
+ m_imageInfoRecord.BBoxH = m_image.height();
m_imageInfoRecord.colorspace = ColorSpaceRGB;
m_pixelFormat = Format_BGRA_8;
}
Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_psd.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_psd.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_psd.cpp (original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_psd.cpp Mon Aug 20 19:01:43 2018
@@ -904,7 +904,7 @@
}
}
if (!hasAlpha)
- r2_image.fill(255);
+ r2_image.fill('\xff');
for(uint channel = 0; channel < channel_num; channel++)
{
if (layerInfo[layer].channelType[channel] == -2)
@@ -1344,7 +1344,7 @@
return false;
}
uint channel_num = header.channel_count;
- r_image.fill(255);
+ r_image.fill('\xff');
const uint pixel_count = header.height * header.width;
static const uint components[5] = {0, 1, 2, 3, 4};
if( compression )
Modified: trunk/Scribus/scribus/imagedataloaders/scimgdataloader_wpg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/imagedataloaders/scimgdataloader_wpg.cpp
==============================================================================
--- trunk/Scribus/scribus/imagedataloaders/scimgdataloader_wpg.cpp (original)
+++ trunk/Scribus/scribus/imagedataloaders/scimgdataloader_wpg.cpp Mon Aug 20 19:01:43 2018
@@ -259,9 +259,9 @@
imagePainter.setBrush(currentBrush);
}
if (!path.framed)
- imagePainter.setPen(Qt::NoPen);
- else
- imagePainter.setPen(currentPen);
+ imagePainter.setPen(Qt::NoPen);
+ else
+ imagePainter.setPen(currentPen);
if(path.closed)
Coords.closeSubpath();
imagePainter.drawPath(Coords);
Modified: trunk/Scribus/scribus/ioapi.c
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ioapi.c
==============================================================================
--- trunk/Scribus/scribus/ioapi.c (original)
+++ trunk/Scribus/scribus/ioapi.c Mon Aug 20 19:01:43 2018
@@ -72,20 +72,19 @@
const char* filename;
int mode;
{
- FILE* file = NULL;
- const char* mode_fopen = NULL;
- if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
- mode_fopen = "rb";
- else
- if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
- mode_fopen = "r+b";
- else
- if (mode & ZLIB_FILEFUNC_MODE_CREATE)
- mode_fopen = "wb";
-
- if ((filename!=NULL) && (mode_fopen != NULL))
- file = fopen(filename, mode_fopen);
- return file;
+ FILE* file = NULL;
+ const char* mode_fopen = NULL;
+ if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
+ mode_fopen = "rb";
+ else
+ if (mode & ZLIB_FILEFUNC_MODE_EXISTING)
+ mode_fopen = "r+b";
+ else
+ if (mode & ZLIB_FILEFUNC_MODE_CREATE)
+ mode_fopen = "wb";
+ if ((filename!=NULL) && (mode_fopen != NULL))
+ file = fopen(filename, mode_fopen);
+ return file;
}
Modified: trunk/Scribus/scribus/langmgr.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/langmgr.cpp
==============================================================================
--- trunk/Scribus/scribus/langmgr.cpp (original)
+++ trunk/Scribus/scribus/langmgr.cpp Mon Aug 20 19:01:43 2018
@@ -766,8 +766,7 @@
{
if (getTranslated)
return m_langTable[i].m_transName;
- else
- return m_langTable[i].m_name;
+ return m_langTable[i].m_name;
}
//qDebug()<<langAbbrev<<"not found";
return "";
Modified: trunk/Scribus/scribus/latexhelpers.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/latexhelpers.cpp
==============================================================================
--- trunk/Scribus/scribus/latexhelpers.cpp (original)
+++ trunk/Scribus/scribus/latexhelpers.cpp Mon Aug 20 19:01:43 2018
@@ -88,8 +88,7 @@
QFileInfo fi(fn);
if (!fi.exists())
return configBase() + fn;
- else
- return fn;
+ return fn;
}
//TODO: Pass this information to LatexEditor, so the second parser can be removed
@@ -308,8 +307,7 @@
QString command = PrefsManager::instance()->latexCommands()[fileName];
if (command.isEmpty())
return m_executable;
- else
- return command;
+ return command;
}
QString I18nXmlStreamReader::readI18nText(bool unindent)
@@ -324,70 +322,85 @@
while (!atEnd()) {
readNext();
if (isWhitespace() || isComment()) continue;
- if (isStartElement() && name() == startTag) {
+ if (isStartElement() && name() == startTag)
+ {
raiseError("Invalid nested elements.");
return "Error";
}
- if (isEndElement() && name() == startTag) {
- if (!unindent) {
+ if (isEndElement() && name() == startTag)
+ {
+ if (!unindent)
return result.trimmed();
- } else {
- QStringList splitted = result.split("\n");
- int i;
- int minspaces = 0xffff;
- /* NOTE: First line contains no leading whitespace so we start at 1 */
- for (i = 1; i < splitted.size(); i++) {
- if (splitted[i].trimmed().isEmpty()) continue;
- int spaces;
- QString tmp = splitted[i];
- for (spaces = 0; spaces < tmp.length(); spaces++) {
- if (!tmp[spaces].isSpace()) break;
- }
- if (spaces < minspaces) minspaces = spaces;
+ QStringList splitted = result.split("\n");
+ int i;
+ int minspaces = 0xffff;
+ /* NOTE: First line contains no leading whitespace so we start at 1 */
+ for (i = 1; i < splitted.size(); i++) {
+ if (splitted[i].trimmed().isEmpty()) continue;
+ int spaces;
+ QString tmp = splitted[i];
+ for (spaces = 0; spaces < tmp.length(); spaces++) {
+ if (!tmp[spaces].isSpace()) break;
}
- for (i = 1; i < splitted.size(); i++) {
- splitted[i] = splitted[i].mid(minspaces);
+ if (spaces < minspaces) minspaces = spaces;
+ }
+ for (i = 1; i < splitted.size(); i++) {
+ splitted[i] = splitted[i].mid(minspaces);
+ }
+ return splitted.join("\n").trimmed();
+ }
+ if (i18n)
+ {
+ if (isEndElement())
+ {
+ if (name() == "i18n")
+ {
+ i18n = false;
}
- return splitted.join("\n").trimmed();
- }
- }
- if (i18n) {
- if (isEndElement()) {
- if (name() == "i18n") {
- i18n = false;
- } else {
+ else
+ {
raiseError("Invalid end element "+ name().toString());
}
continue;
}
- if (!isStartElement()) {
+ if (!isStartElement())
+ {
raiseError("Unexpected data!");
}
- if (name() == language) {
+ if (name() == language)
+ {
matchquality = 2; //Perfect match
result = readElementText();
- } else if (language.startsWith(name().toString()) && matchquality <= 1) {
+ }
+ else if (language.startsWith(name().toString()) && matchquality <= 1)
+ {
matchquality = 1; //Only beginning part matches
result = readElementText();
- } else if (result.isEmpty()) {
+ }
+ else if (result.isEmpty())
+ {
matchquality = 0;
result = readElementText();
- } else {
+ }
+ else
+ {
readElementText(); //Ignore the text
}
- } else {
- if (isStartElement()) {
- if (name() == "i18n") {
+ }
+ else
+ {
+ if (isStartElement())
+ {
+ if (name() == "i18n")
+ {
i18n = true;
continue;
- } else {
- raiseError("Tag " + name().toString() +
- "found, but \"i18n\" or string data expected.");
- continue;
}
- } else if (isCharacters()) {
+ raiseError("Tag " + name().toString() + "found, but \"i18n\" or string data expected.");
+ continue;
+ }
+ if (isCharacters())
result = result + text().toString();
- }
}
}
raiseError("Unexpected end of XML file");
Modified: trunk/Scribus/scribus/localemgr.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/localemgr.cpp
==============================================================================
--- trunk/Scribus/scribus/localemgr.cpp (original)
+++ trunk/Scribus/scribus/localemgr.cpp Mon Aug 20 19:01:43 2018
@@ -112,8 +112,7 @@
//No, we don't translate these, they are internal use that don't get to the GUI
if (m_sysLocale.measurementSystem()==0)
return "A4";
- else
- return "Letter";
+ return "Letter";
// qFatal("Page Size not found in LocaleManager");
// return "";
}
@@ -129,8 +128,7 @@
//No, we don't translate these, they are internal use that don't get to the GUI
if (m_sysLocale.measurementSystem()==0)
return "mm";
- else
- return "in";
+ return "in";
// qFatal("Unit not found in LocaleManager");
// return "";
}
Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Mon Aug 20 19:01:43 2018
@@ -2033,7 +2033,7 @@
p->strokePath();
if (itemType()==ImageFrame)
{
- if (imageClip.size() != 0)
+ if (!imageClip.empty())
{
p->setupPolygon(&imageClip);
p->strokePath();
@@ -10208,7 +10208,7 @@
{
if (m_Doc->appMode == modeDrawBezierLine)
return;
- if (ContourLine.size() == 0)
+ if (ContourLine.empty())
ContourLine = PoLine.copy();
int ph = static_cast<int>(qMax(1.0, lineWidth() / 2.0));
bool clipBackup = ClipEdited;
Modified: trunk/Scribus/scribus/pageitem_imageframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/pageitem_imageframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_imageframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_imageframe.cpp Mon Aug 20 19:01:43 2018
@@ -154,7 +154,7 @@
p->translate(0, m_height);
p->scale(1, -1);
}
- if (imageClip.size() != 0)
+ if (!imageClip.empty())
{
p->setupPolygon(&imageClip);
p->setClipPath();
@@ -356,7 +356,7 @@
}
}
if (dX != 0.0 || dY != 0.0)
- if (imageClip.size() != 0)
+ if (!imageClip.empty())
{
imageClip = pixm.imgInfo.PDSpathData[pixm.imgInfo.usedPath].copy();
QTransform cl;
Modified: trunk/Scribus/scribus/pageitem_polyline.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/pageitem_polyline.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_polyline.cpp (original)
+++ trunk/Scribus/scribus/pageitem_polyline.cpp Mon Aug 20 19:01:43 2018
@@ -219,7 +219,7 @@
{
PageItem::getBoundingRect(x1, y1, x2, y2);
QRectF totalRect = QRectF(QPointF(*x1, *y1), QPointF(*x2, *y2));
- if (m_startArrowIndex != 0 && PoLine.size() > 0)
+ if (m_startArrowIndex != 0 && !PoLine.empty())
{
QTransform arrowTrans;
FPointArray arrow = m_Doc->arrowStyles().at(m_startArrowIndex-1).points.copy();
@@ -294,7 +294,7 @@
{
PageItem::getVisualBoundingRect(x1, y1, x2, y2);
QRectF totalRect(QPointF(*x1, *y1), QPointF(*x2, *y2));
- if (m_startArrowIndex != 0 && PoLine.size() > 0)
+ if (m_startArrowIndex != 0 && !PoLine.empty())
{
QTransform arrowTrans;
FPointArray arrow = m_Doc->arrowStyles().at(m_startArrowIndex-1).points.copy();
Modified: trunk/Scribus/scribus/pageitem_spiral.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/pageitem_spiral.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_spiral.cpp (original)
+++ trunk/Scribus/scribus/pageitem_spiral.cpp Mon Aug 20 19:01:43 2018
@@ -354,7 +354,7 @@
{
PageItem::getBoundingRect(x1, y1, x2, y2);
QRectF totalRect = QRectF(QPointF(*x1, *y1), QPointF(*x2, *y2));
- if (m_startArrowIndex != 0 && PoLine.size() > 0)
+ if (m_startArrowIndex != 0 && !PoLine.empty())
{
QTransform arrowTrans;
FPointArray arrow = m_Doc->arrowStyles().at(m_startArrowIndex-1).points.copy();
@@ -429,7 +429,7 @@
{
PageItem::getVisualBoundingRect(x1, y1, x2, y2);
QRectF totalRect(QPointF(*x1, *y1), QPointF(*x2, *y2));
- if (m_startArrowIndex != 0 && PoLine.size() > 0)
+ if (m_startArrowIndex != 0 && !PoLine.empty())
{
QTransform arrowTrans;
FPointArray arrow = m_Doc->arrowStyles().at(m_startArrowIndex-1).points.copy();
Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Mon Aug 20 19:01:43 2018
@@ -117,13 +117,13 @@
}
res = QRegion(bb.toRect());
}
- else if ((docItem->textFlowUsesImageClipping()) && (docItem->imageClip.size() != 0))
+ else if ((docItem->textFlowUsesImageClipping()) && (!docItem->imageClip.empty()))
{
QList<uint> Segs;
QPolygon Clip2 = FlattenPath(docItem->imageClip, Segs);
res = QRegion(pp.map(Clip2)).intersected(QRegion(pp.map(docItem->Clip)));
}
- else if ((docItem->textFlowUsesContourLine()) && (docItem->ContourLine.size() != 0))
+ else if ((docItem->textFlowUsesContourLine()) && (!docItem->ContourLine.empty()))
{
QList<uint> Segs;
QPolygon Clip2 = FlattenPath(docItem->ContourLine, Segs);
@@ -1158,10 +1158,9 @@
}
static bool implicitBreak(QChar f, QChar s) {
- if (SpecialChars::isCJK(f.unicode()) && SpecialChars::isCJK(s.unicode())) {
+ if (SpecialChars::isCJK(f.unicode()) && SpecialChars::isCJK(s.unicode()))
return allowedCJKBreakAfter(f) && allowedCJKBreakBefore(s);
- } else
- return false;
+ return false;
}
static double findRealOverflowEnd(const QRegion& shape, QRect pt, double maxX)
@@ -1613,8 +1612,7 @@
current.glyphs[currentIndex].setFlag(ScLayout_SuppressSpace);
continue;
}
- else
- current.glyphs[currentIndex].clearFlag(ScLayout_SuppressSpace);
+ current.glyphs[currentIndex].clearFlag(ScLayout_SuppressSpace);
}
else // from 134 on use NBSPACE for this effect
{
@@ -1623,8 +1621,7 @@
current.glyphs[currentIndex].setFlag(ScLayout_SuppressSpace);
continue;
}
- else
- current.glyphs[currentIndex].clearFlag(ScLayout_SuppressSpace);
+ current.glyphs[currentIndex].clearFlag(ScLayout_SuppressSpace);
}
if (current.isEmpty)
{
@@ -2041,11 +2038,8 @@
newColumn = true;
break;
}
- else
- {
- MaxChars = a;
- goto NoRoom;
- }
+ MaxChars = a;
+ goto NoRoom;
}
}
if (newColumn)
@@ -2868,11 +2862,8 @@
i = current.restartLine(false,true);
continue;
}
- else
- {
-// qDebug() << "breakline B no more text @" << i;
- current.breakLine(i);
- }
+// qDebug() << "breakline B no more text @" << i;
+ current.breakLine(i);
}
}
}
@@ -3306,7 +3297,7 @@
p->restore();
return;
}
- else if (annotation().Type() == Annotation::Textfield)
+ if (annotation().Type() == Annotation::Textfield)
{
int wdt = annotation().Bwid();
m_textDistanceMargins.set(wdt, wdt, wdt, wdt);
@@ -3779,7 +3770,7 @@
p->setupSharpPolygon(&PoLine);
p->strokePath();
}
- if ((m_Doc->guidesPrefs().framesShown) && textFlowUsesContourLine() && (ContourLine.size() != 0))
+ if ((m_Doc->guidesPrefs().framesShown) && textFlowUsesContourLine() && (!ContourLine.empty()))
{
p->setPen(Qt::darkGray, 0, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
p->setupSharpPolygon(&ContourLine);
@@ -5554,18 +5545,15 @@
{ //check if any notes are in frame or whole chain
if (!inChain)
return !m_notesFramesMap.isEmpty();
- else
- {
- PageItem* item = this;
- item = firstInChain();
- while (item != nullptr)
- {
- if (item->asTextFrame()->hasNoteFrame(nullptr, false))
- return true;
- item = item->nextInChain();
- }
- return false;
- }
+ PageItem* item = this;
+ item = firstInChain();
+ while (item != nullptr)
+ {
+ if (item->asTextFrame()->hasNoteFrame(nullptr, false))
+ return true;
+ item = item->nextInChain();
+ }
+ return false;
}
PageItem* item = this;
if (inChain)
Modified: trunk/Scribus/scribus/palettes/cxftristimulusspec.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/palettes/cxftristimulusspec.cpp
==============================================================================
--- trunk/Scribus/scribus/palettes/cxftristimulusspec.cpp (original)
+++ trunk/Scribus/scribus/palettes/cxftristimulusspec.cpp Mon Aug 20 19:01:43 2018
@@ -36,8 +36,6 @@
bool CxfTristimulusSpec::parse(QDomElement& elem)
{
bool parsingError = false;
- QString txt;
-
reset();
QDomNodeList childNodes = elem.childNodes();
@@ -86,4 +84,4 @@
m_illuminant = cxfIlluminantUnknown;
m_observer = cxfObserverUnknown;
m_convMethod = cxfMethodUnknown;
-}
+}
Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Mon Aug 20 19:01:43 2018
@@ -809,10 +809,9 @@
{
if (in.length() < 1)
return QByteArray();
- else if (!Options.Encrypt)
+ if (!Options.Encrypt)
return in;
- else
- return writer.encryptBytes(in, ObjNum);
+ return writer.encryptBytes(in, ObjNum);
// rc4_context_t rc4;
// QByteArray tmp(in);
// QByteArray us(tmp.length(), ' ');
@@ -3800,10 +3799,10 @@
// #8773 - incorrect page position if MPageNam.isEmpty()
/*if (!pag->MPageNam.isEmpty())
{*/
- getBleeds(ActPageP, bleedLeft, bleedRight, bleedBottom, bleedTop);
- PutPage("1 0 0 1 "+FToStr(bleedLeft+markOffs)+" "+FToStr(Options.bleeds.bottom()+markOffs)+" cm\n");
- bleedDisplacementX = bleedLeft+markOffs;
- bleedDisplacementY = Options.bleeds.bottom()+markOffs;
+ getBleeds(ActPageP, bleedLeft, bleedRight, bleedBottom, bleedTop);
+ PutPage("1 0 0 1 "+FToStr(bleedLeft+markOffs)+" "+FToStr(Options.bleeds.bottom()+markOffs)+" cm\n");
+ bleedDisplacementX = bleedLeft+markOffs;
+ bleedDisplacementY = Options.bleeds.bottom()+markOffs;
/*}*/
//#9385 : clip to BleedBox
if ((Options.cropMarks) || (Options.bleedMarks) || (Options.registrationMarks) || (Options.colorMarks) || (Options.docInfoMarks))
@@ -9949,7 +9948,7 @@
return true;
}
- else if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Array)//Page contents might be an array
+ if (contents && contents->GetDataType() == PoDoFo::ePdfDataType_Array)//Page contents might be an array
{
QMap<PoDoFo::PdfReference, PdfId> importedObjects;
QList<PoDoFo::PdfReference> referencedObjects;
Modified: trunk/Scribus/scribus/pdfoptionsio.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/pdfoptionsio.cpp
==============================================================================
--- trunk/Scribus/scribus/pdfoptionsio.cpp (original)
+++ trunk/Scribus/scribus/pdfoptionsio.cpp Mon Aug 20 19:01:43 2018
@@ -418,23 +418,19 @@
double d=0.0;
if (!readElem(m_root, "bleedTop", &d))
return false;
- else
- m_opts->bleeds.setTop(d);
+ m_opts->bleeds.setTop(d);
d=0.0;
if (!readElem(m_root, "bleedLeft", &d))
return false;
- else
- m_opts->bleeds.setLeft(d);
+ m_opts->bleeds.setLeft(d);
d=0.0;
if (!readElem(m_root, "bleedBottom", &d))
return false;
- else
- m_opts->bleeds.setBottom(d);
+ m_opts->bleeds.setBottom(d);
d=0.0;
if (!readElem(m_root, "bleedRight", &d))
return false;
- else
- m_opts->bleeds.setRight(d);
+ m_opts->bleeds.setRight(d);
if (!readElem(m_root, "encrypt", &m_opts->Encrypt))
return false;
if (!readElem(m_root, "passOwner", &m_opts->PassOwner))
@@ -456,37 +452,33 @@
m_opts->Version = PDFOptions::PDFVersion_X1a;
return true;
}
- else if (pdfVersString == "X3")
+ if (pdfVersString == "X3")
{
m_opts->Version = PDFOptions::PDFVersion_X3;
return true;
}
- else if (pdfVersString == "X4")
+ if (pdfVersString == "X4")
{
m_opts->Version = PDFOptions::PDFVersion_X4;
return true;
}
- else if (pdfVersString == "13")
+ if (pdfVersString == "13")
{
m_opts->Version = PDFOptions::PDFVersion_13;
return true;
}
- else if (pdfVersString == "14")
+ if (pdfVersString == "14")
{
m_opts->Version = PDFOptions::PDFVersion_14;
return true;
}
- else if (pdfVersString == "15")
+ if (pdfVersString == "15")
{
m_opts->Version = PDFOptions::PDFVersion_15;
return true;
}
- else
- {
- m_error = QObject::tr("Unable to read settings XML: %1")
- .arg(QObject::tr("<pdfVersion> invalid", "Load PDF settings"));
- return false;
- }
+ m_error = QObject::tr("Unable to read settings XML: %1").arg(QObject::tr("<pdfVersion> invalid", "Load PDF settings"));
+ return false;
}
bool PDFOptionsIO::readPDFFontEmbeddingMode()
@@ -588,19 +580,13 @@
(*value) = true;
return true;
}
- else if (elementText == "false")
+ if (elementText == "false")
{
(*value) = false;
return true;
}
- else
- {
- m_error = QObject::tr("Unable to read settings XML: %1")
- .arg(QObject::tr("element <%1> value must be `true' or `false'", "Load PDF settings")
- .arg(name)
- );
- return false;
- }
+ m_error = QObject::tr("Unable to read settings XML: %1").arg(QObject::tr("element <%1> value must be `true' or `false'", "Load PDF settings").arg(name));
+ return false;
}
bool PDFOptionsIO::readElem(QDomElement& parent, const QString& name, int* value)
@@ -615,10 +601,7 @@
(*value) = result;
else
{
- m_error = QObject::tr("Unable to read settings XML: %1")
- .arg(QObject::tr("element <%1> value must be an integer", "Load PDF settings")
- .arg(name)
- );
+ m_error = QObject::tr("Unable to read settings XML: %1").arg(QObject::tr("element <%1> value must be an integer", "Load PDF settings").arg(name));
return false;
}
return ok;
@@ -636,10 +619,7 @@
(*value) = result;
else
{
- m_error = QObject::tr("Unable to read settings XML: %1")
- .arg(QObject::tr("element <%1> value must be a double", "Load PDF settings")
- .arg(name)
- );
+ m_error = QObject::tr("Unable to read settings XML: %1").arg(QObject::tr("element <%1> value must be a double", "Load PDF settings").arg(name));
return false;
}
return ok;
Modified: trunk/Scribus/scribus/pdfwriter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/pdfwriter.cpp
==============================================================================
--- trunk/Scribus/scribus/pdfwriter.cpp (original)
+++ trunk/Scribus/scribus/pdfwriter.cpp Mon Aug 20 19:01:43 2018
@@ -531,10 +531,7 @@
QByteArray step1 = ComputeRC4Key(objId);
return new ScRC4EncodeFilter(&m_outStream, step1.data(), qMin(m_KeyLen+5, 16));
}
- else
- {
- return new ScNullEncodeFilter(&m_outStream);
- }
+ return new ScNullEncodeFilter(&m_outStream);
}
Modified: trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp (original)
+++ trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp Mon Aug 20 19:01:43 2018
@@ -62,31 +62,31 @@
f.close();
QRegExp rx(
- "[\\r\\n]+% --BEGIN (RESOURCE|RENDERER|ENCODER) ([\\w-]+)--[\\r\\n]+"
- "(.*[\\r\\n]+)?"
- "(%%BeginResource.*[\\r\\n]+)"
- "% --END \\1 \\2--[\\r\\n]+");
+ "[\\r\\n]+% --BEGIN (RESOURCE|RENDERER|ENCODER) ([\\w-]+)--[\\r\\n]+"
+ "(.*[\\r\\n]+)?"
+ "(%%BeginResource.*[\\r\\n]+)"
+ "% --END \\1 \\2--[\\r\\n]+");
rx.setMinimal(true);
int pos = 0;
while ( (pos = rx.indexIn(bwipp, pos)) != -1 )
{
int len=rx.matchedLength();
QString restype=rx.cap(1);
- QString resname=rx.cap(2);
- QString reshead=rx.cap(3);
- QString resbody=rx.cap(4);
-
- resbodys[resname]=resbody;
-
- if (restype=="ENCODER")
+ QString resname=rx.cap(2);
+ QString reshead=rx.cap(3);
+ QString resbody=rx.cap(4);
+
+ resbodys[resname]=resbody;
+
+ if (restype=="ENCODER")
{
QRegExp rxhead(
- "% --REQUIRES (.*)--[\\r\\n]+"
- "% --DESC:(.*)[\\r\\n]+"
- "% --EXAM:(.*)[\\r\\n]+"
- "% --EXOP:(.*)[\\r\\n]+"
- "% --RNDR:(.*)[\\r\\n]+"
- );
+ "% --REQUIRES (.*)--[\\r\\n]+"
+ "% --DESC:(.*)[\\r\\n]+"
+ "% --EXAM:(.*)[\\r\\n]+"
+ "% --EXOP:(.*)[\\r\\n]+"
+ "% --RNDR:(.*)[\\r\\n]+"
+ );
rxhead.indexIn(reshead);
resreqs[resname]=rxhead.cap(1).trimmed();
resdescs[resname]=rxhead.cap(2).trimmed();
@@ -94,7 +94,7 @@
resexops[resname]=rxhead.cap(4).trimmed();
resrndrs[resname]=rxhead.cap(5).trimmed();
encoderlist.append(resname);
- }
+ }
pos+=len;
}
@@ -103,10 +103,10 @@
/*
* Ultimately all of this static data about the capabilities of each barcode
- * encoder will be replaced by data read from the barcode.ps metadata, when
+ * encoder will be replaced by data read from the barcode.ps metadata, when
* such data exists...
*
- */
+ */
// Content for the version and ecc combos
resvers["qrcode"]="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40";
@@ -150,39 +150,39 @@
// Which options checkboxes are enabled for each encoder
QStringList includetextAvail=encoderlist;
foreach (const QString& enc, includetextAvail)
- resincludetextAvail[enc]=true;
+ resincludetextAvail[enc]=true;
QStringList guardwhitespaceAvail;
guardwhitespaceAvail << "ean13" << "ean8" << "isbn" << "ismn" << "issn" << "ean13composite" << "ean8composite";
foreach (const QString& enc, guardwhitespaceAvail)
- resguardwhitespaceAvail[enc]=true;
+ resguardwhitespaceAvail[enc]=true;
QStringList includecheckAvail;
includecheckAvail << "bc412" << "channelcode" << "code11" << "code2of5" << "coop2of5" << "datalogic2of5"
<< "iata2of5" << "industrial2of5" << "matrix2of5" << "code39" << "code39ext"
<< "code93" << "code93ext" << "interleaved2of5" << "msi" << "rationalizedCodabar";
foreach (const QString& enc, includecheckAvail)
- resincludecheckAvail[enc]=true;
+ resincludecheckAvail[enc]=true;
QStringList includecheckintextAvail;
includecheckintextAvail << "bc412" << "code11" << "code2of5" << "coop2of5" << "datalogic2of5" << "iata2of5"
<< "industrial2of5" << "matrix2of5" << "code39" << "code39ext" << "interleaved2of5"
<< "japanpost" << "msi" << "planet" << "plessey" << "postnet" << "rationalizedCodabar" << "royalmail";
foreach (const QString& enc, includecheckintextAvail)
- resincludecheckintextAvail[enc]=true;
+ resincludecheckintextAvail[enc]=true;
QStringList parseAvail;
parseAvail << "azteccode" << "azteccodecompact" << "codablockf" << "hibccodablockf" << "code128" << "hibccode128" << "code16k" << "code39ext" << "code49"
<< "code93ext" << "codeone" << "datamatrix" << "hibcdatamatrix" << "maxicode" << "micropdf417" << "hibcmicropdf417" << "pdf417" << "hibcpdf417"
<< "pdf417compact" << "posicode" << "qrcode" << "hibcqrcode" << "microqrcode" << "telepen" << "hanxin" << "dotcode" << "ultracode";
foreach (const QString& enc, parseAvail)
- resparseAvail[enc]=true;
+ resparseAvail[enc]=true;
QStringList parsefncAvail;
parsefncAvail << "codablockf" << "code128" << "code16k" << "code49" << "code93" << "codeone"
<< "datamatrix" << "posicode" << "qrcode" << "microqrcode" << "dotcode" << "ultracode";
foreach (const QString& enc, parsefncAvail)
- resparsefncAvail[enc]=true;
+ resparsefncAvail[enc]=true;
// Building up the bcFamilyCombo grouping the formats for readablity
ui.bcFamilyCombo->addItem(tr("Select a barcode family")); // to prevent 1st gs call
@@ -266,7 +266,7 @@
ui.bcFamilyCombo->addItems(familyList);
/*
- * End of the hard-coded data
+ * End of the hard-coded data
*
*/
@@ -442,7 +442,7 @@
void BarcodeGenerator::enqueuePaintBarcode(int delay)
{
ui.okButton->setEnabled(false);
-// paintBarcode();
+ // paintBarcode();
paintBarcodeTimer->start(delay);
}
@@ -457,17 +457,17 @@
}
else
{
- opts.replace(QRegExp("\\bincludetext\\b")," ");
+ opts.replace(QRegExp("\\bincludetext\\b")," ");
}
if (ui.guardwhitespaceCheck->isChecked())
{
- if (!opts.contains(QRegExp("\\bguardwhitespace\\b")))
+ if (!opts.contains(QRegExp("\\bguardwhitespace\\b")))
opts.append(" guardwhitespace");
}
else
{
- opts.replace(QRegExp("\\bguardwhitespace\\b")," ");
+ opts.replace(QRegExp("\\bguardwhitespace\\b")," ");
}
if (ui.includecheckCheck->isChecked())
@@ -502,7 +502,7 @@
if (ui.parsefncCheck->isChecked())
{
- if (!opts.contains(QRegExp("\\bparsefnc\\b")))
+ if (!opts.contains(QRegExp("\\bparsefnc\\b")))
opts.append(" parsefnc");
}
else
@@ -513,10 +513,10 @@
QString enc=map[ui.bcCombo->currentText()].command;
QString vlbl=resvlbl[enc]!="" ? resvlbl[enc].toLower() : "version";
- if (ui.formatCombo->currentIndex() != 0)
+ if (ui.formatCombo->currentIndex() != 0)
{
QString t=ui.formatCombo->currentText();
- if (!opts.contains(QRegExp("\\b"+QRegExp::escape(vlbl)+"=.*\\b")))
+ if (!opts.contains(QRegExp("\\b"+QRegExp::escape(vlbl)+"=.*\\b")))
opts.append(" "+vlbl+"="+t);
else
opts.replace(QRegExp("\\b"+QRegExp::escape(vlbl)+"=\\S*\\b"),vlbl+"="+t);
@@ -529,7 +529,7 @@
if (ui.eccCombo->currentIndex() != 0)
{
QString t=ui.eccCombo->currentText();
- if (!opts.contains(QRegExp("\\beclevel=.*\\b")))
+ if (!opts.contains(QRegExp("\\beclevel=.*\\b")))
opts.append(" eclevel="+t);
else
opts.replace(QRegExp("\\beclevel=\\S*\\b"),"eclevel="+t);
@@ -547,35 +547,35 @@
void BarcodeGenerator::updateUIFromOptionsText()
{
- ui.includetextCheck->blockSignals(true);
+ ui.includetextCheck->blockSignals(true);
ui.includetextCheck->setChecked(ui.optionsEdit->text().contains(QRegExp("\\bincludetext\\b")));
- ui.includetextCheck->blockSignals(false);
-
- ui.guardwhitespaceCheck->blockSignals(true);
+ ui.includetextCheck->blockSignals(false);
+
+ ui.guardwhitespaceCheck->blockSignals(true);
ui.guardwhitespaceCheck->setChecked(ui.optionsEdit->text().contains(QRegExp("\\bguardwhitespace\\b")));
- ui.guardwhitespaceCheck->blockSignals(false);
-
- ui.includecheckCheck->blockSignals(true);
+ ui.guardwhitespaceCheck->blockSignals(false);
+
+ ui.includecheckCheck->blockSignals(true);
ui.includecheckCheck->setChecked(ui.optionsEdit->text().contains(QRegExp("\\bincludecheck\\b")));
- ui.includecheckCheck->blockSignals(false);
-
- ui.includecheckintextCheck->blockSignals(true);
+ ui.includecheckCheck->blockSignals(false);
+
+ ui.includecheckintextCheck->blockSignals(true);
ui.includecheckintextCheck->setChecked(ui.optionsEdit->text().contains(QRegExp("\\bincludecheckintext\\b")));
- ui.includecheckintextCheck->blockSignals(false);
-
- ui.parseCheck->blockSignals(true);
+ ui.includecheckintextCheck->blockSignals(false);
+
+ ui.parseCheck->blockSignals(true);
ui.parseCheck->setChecked(ui.optionsEdit->text().contains(QRegExp("\\bparse\\b")));
- ui.parseCheck->blockSignals(false);
-
- ui.parsefncCheck->blockSignals(true);
+ ui.parseCheck->blockSignals(false);
+
+ ui.parsefncCheck->blockSignals(true);
ui.parsefncCheck->setChecked(ui.optionsEdit->text().contains(QRegExp("\\bparsefnc\\b")));
- ui.parsefncCheck->blockSignals(false);
+ ui.parsefncCheck->blockSignals(false);
QString enc=map[ui.bcCombo->currentText()].command;
QString vlbl=resvlbl[enc]!="" ? resvlbl[enc].toLower() : "version";
QRegExp rxf("\\b"+QRegExp::escape(vlbl)+"=(\\S*)\\b");
- ui.formatCombo->blockSignals(true);
+ ui.formatCombo->blockSignals(true);
if (ui.optionsEdit->text().contains(rxf))
{
int idx=ui.formatCombo->findText(rxf.cap(1));
@@ -587,10 +587,10 @@
{
ui.formatCombo->setCurrentIndex(0);
}
- ui.formatCombo->blockSignals(false);
+ ui.formatCombo->blockSignals(false);
QRegExp rxe("\\beclevel=(\\S*)\\b");
- ui.eccCombo->blockSignals(true);
+ ui.eccCombo->blockSignals(true);
if (ui.optionsEdit->text().contains(rxe))
{
int idx=ui.eccCombo->findText(rxe.cap(1));
@@ -722,11 +722,11 @@
if (UndoManager::undoEnabled())
{
tran = UndoManager::instance()->beginTransaction(
- ScCore->primaryMainWindow()->doc->currentPage()->getUName(),
- Um::IImageFrame,
- Um::ImportBarcode,
- ui.bcCombo->currentText() + " (" + ui.codeEdit->text() + ")",
- Um::IEPS);
+ ScCore->primaryMainWindow()->doc->currentPage()->getUName(),
+ Um::IImageFrame,
+ Um::ImportBarcode,
+ ui.bcCombo->currentText() + " (" + ui.codeEdit->text() + ")",
+ Um::IEPS);
}
if (fmt)
@@ -756,11 +756,8 @@
void BarcodeGenerator::paintBarcode()
{
-
QString coloropts("barcolor=%1 showbackground backgroundcolor=%2 textcolor=%3");
- coloropts = coloropts.arg(lnColor.name().replace('#', "")) \
- .arg(bgColor.name().replace('#', "")) \
- .arg(txtColor.name().replace('#', ""));
+ coloropts = coloropts.arg(lnColor.name().replace('#', ""), bgColor.name().replace('#', ""), txtColor.name().replace('#', ""));
QString opts=ui.optionsEdit->text()+" "+coloropts;
@@ -768,30 +765,30 @@
QString psCommand="%!PS-Adobe-2.0 EPSF-2.0\n";
QString req;
QString enc=map[ui.bcCombo->currentText()].command;
- foreach (req, resreqs[enc].split(" "))
+ foreach (req, resreqs[enc].split(" "))
psCommand.append(resbodys[req]);
psCommand.append(resbodys[enc]);
psCommand.append(
- "errordict begin\n"
- "/handleerror {\n"
- "$error begin\n"
- "errorname dup length string cvs 0 6 getinterval (bwipp.) eq {\n"
- "(%stderr) (w) file\n"
- "dup (\nBWIPP ERROR: ) writestring\n"
- "dup errorname dup length string cvs writestring\n"
- "dup ( ) writestring\n"
- "dup errorinfo dup length string cvs writestring\n"
- "dup (\n) writestring\n"
- "dup flushfile end quit\n"
- "} if\n"
- "end //handleerror exec\n"
- "} bind def\n"
- "end\n"
- );
+ "errordict begin\n"
+ "/handleerror {\n"
+ "$error begin\n"
+ "errorname dup length string cvs 0 6 getinterval (bwipp.) eq {\n"
+ "(%stderr) (w) file\n"
+ "dup (\nBWIPP ERROR: ) writestring\n"
+ "dup errorname dup length string cvs writestring\n"
+ "dup ( ) writestring\n"
+ "dup errorinfo dup length string cvs writestring\n"
+ "dup (\n) writestring\n"
+ "dup flushfile end quit\n"
+ "} if\n"
+ "end //handleerror exec\n"
+ "} bind def\n"
+ "end\n"
+ );
QString comm("20 10 moveto <%1> <%2> /%3 /uk.co.terryburton.bwipp findresource exec\n");
QString bcdata(ui.codeEdit->text().toLatin1().toHex());
QString bcopts(opts.toLatin1().toHex());
- comm = comm.arg(bcdata).arg(bcopts).arg(map[ui.bcCombo->currentText()].command);
+ comm = comm.arg(bcdata, bcopts, map[ui.bcCombo->currentText()].command);
psCommand.append(comm);
psCommand.append("showpage\n");
Modified: trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp Mon Aug 20 19:01:43 2018
@@ -842,7 +842,7 @@
current_x += gl.xadvance;
}
indices.chop(1);
- glyph.setAttribute("Indices", QString("%1%2").arg(gcMap).arg(indices));
+ glyph.setAttribute("Indices", QString("%1%2").arg(gcMap, indices));
m_group.appendChild(glyph);
}
Modified: trunk/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp (original)
+++ trunk/Scribus/scribus/plugins/gettext/sxwim/stylereader.cpp Mon Aug 20 19:01:43 2018
@@ -4,7 +4,7 @@
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
- /***************************************************************************
+/***************************************************************************
* Copyright (C) 2004 by Riku Leino *
* tsoots at gmail.com *
* *
@@ -23,44 +23,44 @@
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-
- #include "stylereader.h"
-
- #include <scribusstructs.h>
- #include <gtmeasure.h>
- #include <gtparagraphstyle.h>
- #include <gtframestyle.h>
- #include <gtfont.h>
+
+#include "stylereader.h"
+
+#include <scribusstructs.h>
+#include <gtmeasure.h>
+#include <gtparagraphstyle.h>
+#include <gtframestyle.h>
+#include <gtfont.h>
#include <QByteArray>
-
- StyleReader* StyleReader::sreader = nullptr;
-
- extern xmlSAXHandlerPtr sSAXHandler;
-
+
+StyleReader* StyleReader::sreader = nullptr;
+
+extern xmlSAXHandlerPtr sSAXHandler;
+
StyleReader::StyleReader(const QString& documentName, gtWriter *w, bool textOnly, bool prefix, bool combineStyles)
{
- sreader = this;
+ sreader = this;
docname = documentName;
- readProperties = false;
- writer = w;
- importTextOnly = textOnly;
- usePrefix = prefix;
+ readProperties = false;
+ writer = w;
+ importTextOnly = textOnly;
+ usePrefix = prefix;
packStyles = combineStyles;
currentStyle = nullptr;
parentStyle = nullptr;
- inList = false;
- currentList = "";
+ inList = false;
+ currentList = "";
defaultStyleCreated = false;
}
-
- bool StyleReader::startElement(const QString&, const QString&, const QString &name, const QXmlAttributes &attrs)
- {
- if (name == "style:default-style")
- defaultStyle(attrs);
- else if (name == "style:properties")
- styleProperties(attrs);
- else if (name == "style:style")
- {
+
+bool StyleReader::startElement(const QString&, const QString&, const QString &name, const QXmlAttributes &attrs)
+{
+ if (name == "style:default-style")
+ defaultStyle(attrs);
+ else if (name == "style:properties")
+ styleProperties(attrs);
+ else if (name == "style:style")
+ {
/*if (!defaultStyleCreated)
{
gtParagraphStyle* pstyle = new gtParagraphStyle(*(writer->getDefaultStyle()));
@@ -69,249 +69,249 @@
currentStyle->setName("default-style");
defaultStyleCreated = true;
}*/
- styleStyle(attrs);
- }
- else if (name == "style:tab-stop")
- tabStop(attrs);
- else if (name == "text:list-style")
- {
- for (int i = 0; i < attrs.count(); ++i)
- if (attrs.localName(i) == "style:name")
- currentList = attrs.value(i);
- inList = true;
- }
- else if (((name == "text:list-level-style-bullet") ||
- (name == "text:list-level-style-number") ||
- (name == "text:list-level-style-image")) && (inList))
- {
- for (int i = 0; i < attrs.count(); ++i)
- {
- if (attrs.localName(i) == "text:level")
- {
- gtStyle *plist;
- if (attrs.value(i) == "1")
- {
- plist = listParents[currentList];
- }
- else
- {
- int level = (attrs.value(i)).toInt();
- --level;
- plist = styles[QString(currentList + "_%1").arg(level)];
- }
- gtParagraphStyle *pstyle;
+ styleStyle(attrs);
+ }
+ else if (name == "style:tab-stop")
+ tabStop(attrs);
+ else if (name == "text:list-style")
+ {
+ for (int i = 0; i < attrs.count(); ++i)
+ if (attrs.localName(i) == "style:name")
+ currentList = attrs.value(i);
+ inList = true;
+ }
+ else if (((name == "text:list-level-style-bullet") ||
+ (name == "text:list-level-style-number") ||
+ (name == "text:list-level-style-image")) && (inList))
+ {
+ for (int i = 0; i < attrs.count(); ++i)
+ {
+ if (attrs.localName(i) == "text:level")
+ {
+ gtStyle *plist;
+ if (attrs.value(i) == "1")
+ {
+ plist = listParents[currentList];
+ }
+ else
+ {
+ int level = (attrs.value(i)).toInt();
+ --level;
+ plist = styles[QString(currentList + "_%1").arg(level)];
+ }
+ gtParagraphStyle *pstyle;
if (plist == nullptr)
- plist = new gtStyle(*(styles["default-style"]));
-
- if (plist->target() == "paragraph")
- {
- pstyle = dynamic_cast<gtParagraphStyle*>(plist);
+ plist = new gtStyle(*(styles["default-style"]));
+
+ if (plist->target() == "paragraph")
+ {
+ pstyle = dynamic_cast<gtParagraphStyle*>(plist);
assert(pstyle != nullptr);
- gtParagraphStyle* tmp = new gtParagraphStyle(*pstyle);
- currentStyle = tmp;
- }
- else
- {
- gtParagraphStyle* tmp = new gtParagraphStyle(*plist);
- currentStyle = tmp;
- }
- currentStyle->setName(currentList + "_" + attrs.value(i));
- }
- }
- readProperties = true;
- }
- else if ((name == "style:drop-cap") && (readProperties))
- {
- if (currentStyle->target() == "paragraph")
- {
- for (int i = 0; i < attrs.count(); ++i)
- {
- if (attrs.localName(i) == "style:lines")
- {
- bool ok = false;
- QString sd = attrs.value(i);
- int dh = sd.toInt(&ok);
- if (ok)
- {
- gtParagraphStyle* s = dynamic_cast<gtParagraphStyle*>(currentStyle);
+ gtParagraphStyle* tmp = new gtParagraphStyle(*pstyle);
+ currentStyle = tmp;
+ }
+ else
+ {
+ gtParagraphStyle* tmp = new gtParagraphStyle(*plist);
+ currentStyle = tmp;
+ }
+ currentStyle->setName(currentList + "_" + attrs.value(i));
+ }
+ }
+ readProperties = true;
+ }
+ else if ((name == "style:drop-cap") && (readProperties))
+ {
+ if (currentStyle->target() == "paragraph")
+ {
+ for (int i = 0; i < attrs.count(); ++i)
+ {
+ if (attrs.localName(i) == "style:lines")
+ {
+ bool ok = false;
+ QString sd = attrs.value(i);
+ int dh = sd.toInt(&ok);
+ if (ok)
+ {
+ gtParagraphStyle* s = dynamic_cast<gtParagraphStyle*>(currentStyle);
assert(s != nullptr);
- s->setDropCapHeight(dh);
- s->setDropCap(true);
- }
- }
- }
- }
- }
- else if (name == "style:font-decl")
- {
- QString key = "";
- QString family = "";
- QString style = "";
- for (int i = 0; i < attrs.count(); ++i)
- {
- if (attrs.localName(i) == "style:name")
- key = attrs.value(i);
- else if (attrs.localName(i) == "fo:font-family")
- {
- family = attrs.value(i);
- family = family.remove("'");
- }
- else if (attrs.localName(i) == "style:font-style-name")
- style += attrs.value(i) + " ";
- }
- QString name = family + " " + style;
+ s->setDropCapHeight(dh);
+ s->setDropCap(true);
+ }
+ }
+ }
+ }
+ }
+ else if (name == "style:font-decl")
+ {
+ QString key = "";
+ QString family = "";
+ QString style = "";
+ for (int i = 0; i < attrs.count(); ++i)
+ {
+ if (attrs.localName(i) == "style:name")
+ key = attrs.value(i);
+ else if (attrs.localName(i) == "fo:font-family")
+ {
+ family = attrs.value(i);
+ family = family.remove("'");
+ }
+ else if (attrs.localName(i) == "style:font-style-name")
+ style += attrs.value(i) + " ";
+ }
+ QString name = family + " " + style;
name = name.simplified();
- fonts[key] = name;
- }
- return true;
- }
-
- void StyleReader::defaultStyle(const QXmlAttributes& attrs)
- {
+ fonts[key] = name;
+ }
+ return true;
+}
+
+void StyleReader::defaultStyle(const QXmlAttributes& attrs)
+{
currentStyle = nullptr;
- for (int i = 0; i < attrs.count(); ++i)
- if (attrs.localName(i) == "style:family")
- if (attrs.value(i) == "paragraph")
- {
- gtParagraphStyle* pstyle = new gtParagraphStyle(*(writer->getDefaultStyle()));
+ for (int i = 0; i < attrs.count(); ++i)
+ if (attrs.localName(i) == "style:family")
+ if (attrs.value(i) == "paragraph")
+ {
+ gtParagraphStyle* pstyle = new gtParagraphStyle(*(writer->getDefaultStyle()));
pstyle->setDefaultStyle(true);
currentStyle = dynamic_cast<gtStyle*>(pstyle);
currentStyle->setName("default-style");
- readProperties = true;
+ readProperties = true;
defaultStyleCreated = true;
- }
- }
-
- void StyleReader::styleProperties(const QXmlAttributes& attrs)
- {
- if ((currentStyle == nullptr) || (!readProperties))
- return;
- gtParagraphStyle* pstyle = nullptr;
- if (currentStyle->target() == "paragraph")
- pstyle = dynamic_cast<gtParagraphStyle*>(currentStyle);
- else
- pstyle = nullptr;
- QString align;
- QString force;
- bool hasColorTag = false;
- for (int i = 0; i < attrs.count(); ++i)
- {
- if ((attrs.localName(i) == "style:font-name") && (!inList))
- currentStyle->getFont()->setName(getFont(attrs.value(i)));
- else if (attrs.localName(i) == "fo:font-size")
- {
- double size = 0.0;
- double psize = 0.0;
- if (parentStyle != nullptr)
- psize = static_cast<double>(parentStyle->getFont()->getSize());
- else if (styles.contains("default-style"))
- psize = static_cast<double>(styles["default-style"]->getFont()->getSize());
-
- psize = psize / 10;
- size = getSize(attrs.value(i), psize);
- int nsize = static_cast<int>(size * 10);
- currentStyle->getFont()->setSize(nsize);
- if (pstyle)
- pstyle->setLineSpacing(writer->getPreferredLineSpacing(nsize));
- }
- else if ((attrs.localName(i) == "fo:line-height") && (parentStyle != nullptr))
- {
- gtParagraphStyle* ppstyle;
- if (parentStyle->target() == "paragraph")
- {
- ppstyle = dynamic_cast<gtParagraphStyle*>(parentStyle);
- assert(ppstyle != nullptr);
- ppstyle->setLineSpacing(getSize(attrs.value(i), writer->getPreferredLineSpacing(currentStyle->getFont()->getSize())));
- }
- }
- else if (attrs.localName(i) == "fo:color")
- {
- currentStyle->getFont()->setColor(attrs.value(i));
- hasColorTag = true;
- }
- else if ((attrs.localName(i) == "style:use-window-font-color") && (attrs.value(i) == "true"))
- {
- currentStyle->getFont()->setColor("Black");
- hasColorTag = true;
- }
- else if ((attrs.localName(i) == "fo:font-weight") && (attrs.value(i) == "bold"))
- currentStyle->getFont()->setWeight(BOLD);
- else if ((attrs.localName(i) == "fo:font-style") && (attrs.value(i) == "italic"))
- currentStyle->getFont()->setSlant(ITALIC);
- else if ((attrs.localName(i) == "style:text-underline") && (attrs.value(i) != "none"))
- currentStyle->getFont()->toggleEffect(UNDERLINE);
- else if ((attrs.localName(i) == "style:text-crossing-out") && (attrs.value(i) != "none"))
- currentStyle->getFont()->toggleEffect(STRIKETHROUGH);
- else if ((attrs.localName(i) == "fo:font-variant") && (attrs.value(i) == "small-caps"))
- currentStyle->getFont()->toggleEffect(SMALL_CAPS);
- else if ((attrs.localName(i) == "style:text-outline") && (attrs.value(i) == "true"))
- {
- currentStyle->getFont()->toggleEffect(OUTLINE);
- currentStyle->getFont()->setStrokeColor("Black");
- currentStyle->getFont()->setColor("White");
- }
- else if (attrs.localName(i) == "fo:letter-spacing")
- currentStyle->getFont()->setKerning(static_cast<int>(getSize(attrs.value(i), -1.0)));
- else if (attrs.localName(i) == "style:text-scale")
- currentStyle->getFont()->setHscale(static_cast<int>(getSize(attrs.value(i), -1.0)));
- else if ((attrs.localName(i) == "style:text-position") &&
- (((attrs.value(i)).indexOf("sub") != -1) ||
- (((attrs.value(i)).left(1) == "-") && ((attrs.value(i)).left(1) != "0"))))
- currentStyle->getFont()->toggleEffect(SUBSCRIPT);
- else if ((attrs.localName(i) == "style:text-position") &&
- (((attrs.value(i)).indexOf("super") != -1) ||
- (((attrs.value(i)).left(1) != "-") && ((attrs.value(i)).left(1) != "0"))))
- currentStyle->getFont()->toggleEffect(SUPERSCRIPT);
- else if ((attrs.localName(i) == "fo:margin-top") && (pstyle != nullptr))
- pstyle->setSpaceAbove(getSize(attrs.value(i)));
- else if ((attrs.localName(i) == "fo:margin-bottom") && (pstyle != nullptr))
- pstyle->setSpaceBelow(getSize(attrs.value(i)));
- else if ((attrs.localName(i) == "fo:margin-left") && (pstyle != nullptr))
- {
- if (inList)
- pstyle->setIndent(pstyle->getIndent() + getSize(attrs.value(i)));
- else
- pstyle->setIndent(getSize(attrs.value(i)));
- }
- else if ((attrs.localName(i) == "text:space-before") && (pstyle != nullptr))
- {
- if (inList)
- pstyle->setIndent(pstyle->getIndent() + getSize(attrs.value(i)));
- else
- pstyle->setIndent(getSize(attrs.value(i)));
- }
- else if ((attrs.localName(i) == "fo:text-indent") && (pstyle != nullptr))
- pstyle->setFirstLineIndent(getSize(attrs.value(i)));
- else if ((attrs.localName(i) == "fo:text-align") && (pstyle != nullptr))
- align = attrs.value(i);
- else if ((attrs.localName(i) == "style:justify-single-word") && (pstyle != nullptr))
- force = attrs.value(i);
- }
- if (!align.isEmpty() && (pstyle != nullptr))
- {
- if (align == "end")
- pstyle->setAlignment(RIGHT);
- else if (align == "center")
- pstyle->setAlignment(CENTER);
- else if (align == "justify")
- {
- if (force == "false")
- pstyle->setAlignment(BLOCK);
- else
- pstyle->setAlignment(FORCED);
- }
- }
- if (!hasColorTag)
- currentStyle->getFont()->setColor("Black");
- }
-
- void StyleReader::styleStyle(const QXmlAttributes& attrs)
- {
+ }
+}
+
+void StyleReader::styleProperties(const QXmlAttributes& attrs)
+{
+ if ((currentStyle == nullptr) || (!readProperties))
+ return;
+ gtParagraphStyle* pstyle = nullptr;
+ if (currentStyle->target() == "paragraph")
+ pstyle = dynamic_cast<gtParagraphStyle*>(currentStyle);
+ else
+ pstyle = nullptr;
+ QString align;
+ QString force;
+ bool hasColorTag = false;
+ for (int i = 0; i < attrs.count(); ++i)
+ {
+ if ((attrs.localName(i) == "style:font-name") && (!inList))
+ currentStyle->getFont()->setName(getFont(attrs.value(i)));
+ else if (attrs.localName(i) == "fo:font-size")
+ {
+ double size = 0.0;
+ double psize = 0.0;
+ if (parentStyle != nullptr)
+ psize = static_cast<double>(parentStyle->getFont()->getSize());
+ else if (styles.contains("default-style"))
+ psize = static_cast<double>(styles["default-style"]->getFont()->getSize());
+
+ psize = psize / 10;
+ size = getSize(attrs.value(i), psize);
+ int nsize = static_cast<int>(size * 10);
+ currentStyle->getFont()->setSize(nsize);
+ if (pstyle)
+ pstyle->setLineSpacing(writer->getPreferredLineSpacing(nsize));
+ }
+ else if ((attrs.localName(i) == "fo:line-height") && (parentStyle != nullptr))
+ {
+ gtParagraphStyle* ppstyle;
+ if (parentStyle->target() == "paragraph")
+ {
+ ppstyle = dynamic_cast<gtParagraphStyle*>(parentStyle);
+ assert(ppstyle != nullptr);
+ ppstyle->setLineSpacing(getSize(attrs.value(i), writer->getPreferredLineSpacing(currentStyle->getFont()->getSize())));
+ }
+ }
+ else if (attrs.localName(i) == "fo:color")
+ {
+ currentStyle->getFont()->setColor(attrs.value(i));
+ hasColorTag = true;
+ }
+ else if ((attrs.localName(i) == "style:use-window-font-color") && (attrs.value(i) == "true"))
+ {
+ currentStyle->getFont()->setColor("Black");
+ hasColorTag = true;
+ }
+ else if ((attrs.localName(i) == "fo:font-weight") && (attrs.value(i) == "bold"))
+ currentStyle->getFont()->setWeight(BOLD);
+ else if ((attrs.localName(i) == "fo:font-style") && (attrs.value(i) == "italic"))
+ currentStyle->getFont()->setSlant(ITALIC);
+ else if ((attrs.localName(i) == "style:text-underline") && (attrs.value(i) != "none"))
+ currentStyle->getFont()->toggleEffect(UNDERLINE);
+ else if ((attrs.localName(i) == "style:text-crossing-out") && (attrs.value(i) != "none"))
+ currentStyle->getFont()->toggleEffect(STRIKETHROUGH);
+ else if ((attrs.localName(i) == "fo:font-variant") && (attrs.value(i) == "small-caps"))
+ currentStyle->getFont()->toggleEffect(SMALL_CAPS);
+ else if ((attrs.localName(i) == "style:text-outline") && (attrs.value(i) == "true"))
+ {
+ currentStyle->getFont()->toggleEffect(OUTLINE);
+ currentStyle->getFont()->setStrokeColor("Black");
+ currentStyle->getFont()->setColor("White");
+ }
+ else if (attrs.localName(i) == "fo:letter-spacing")
+ currentStyle->getFont()->setKerning(static_cast<int>(getSize(attrs.value(i), -1.0)));
+ else if (attrs.localName(i) == "style:text-scale")
+ currentStyle->getFont()->setHscale(static_cast<int>(getSize(attrs.value(i), -1.0)));
+ else if ((attrs.localName(i) == "style:text-position") &&
+ (((attrs.value(i)).indexOf("sub") != -1) ||
+ (((attrs.value(i)).left(1) == "-") && ((attrs.value(i)).left(1) != "0"))))
+ currentStyle->getFont()->toggleEffect(SUBSCRIPT);
+ else if ((attrs.localName(i) == "style:text-position") &&
+ (((attrs.value(i)).indexOf("super") != -1) ||
+ (((attrs.value(i)).left(1) != "-") && ((attrs.value(i)).left(1) != "0"))))
+ currentStyle->getFont()->toggleEffect(SUPERSCRIPT);
+ else if ((attrs.localName(i) == "fo:margin-top") && (pstyle != nullptr))
+ pstyle->setSpaceAbove(getSize(attrs.value(i)));
+ else if ((attrs.localName(i) == "fo:margin-bottom") && (pstyle != nullptr))
+ pstyle->setSpaceBelow(getSize(attrs.value(i)));
+ else if ((attrs.localName(i) == "fo:margin-left") && (pstyle != nullptr))
+ {
+ if (inList)
+ pstyle->setIndent(pstyle->getIndent() + getSize(attrs.value(i)));
+ else
+ pstyle->setIndent(getSize(attrs.value(i)));
+ }
+ else if ((attrs.localName(i) == "text:space-before") && (pstyle != nullptr))
+ {
+ if (inList)
+ pstyle->setIndent(pstyle->getIndent() + getSize(attrs.value(i)));
+ else
+ pstyle->setIndent(getSize(attrs.value(i)));
+ }
+ else if ((attrs.localName(i) == "fo:text-indent") && (pstyle != nullptr))
+ pstyle->setFirstLineIndent(getSize(attrs.value(i)));
+ else if ((attrs.localName(i) == "fo:text-align") && (pstyle != nullptr))
+ align = attrs.value(i);
+ else if ((attrs.localName(i) == "style:justify-single-word") && (pstyle != nullptr))
+ force = attrs.value(i);
+ }
+ if (!align.isEmpty() && (pstyle != nullptr))
+ {
+ if (align == "end")
+ pstyle->setAlignment(RIGHT);
+ else if (align == "center")
+ pstyle->setAlignment(CENTER);
+ else if (align == "justify")
+ {
+ if (force == "false")
+ pstyle->setAlignment(BLOCK);
+ else
+ pstyle->setAlignment(FORCED);
+ }
+ }
+ if (!hasColorTag)
+ currentStyle->getFont()->setColor("Black");
+}
+
+void StyleReader::styleStyle(const QXmlAttributes& attrs)
+{
QString name;
QString listName;
bool setDefaultStyle = false;
- bool isParaStyle = false;
- bool create = true;
+ bool isParaStyle = false;
+ bool create = true;
if (!defaultStyleCreated)
{
@@ -324,445 +324,445 @@
parentStyle = currentStyle;
}
- for (int i = 0; i < attrs.count(); ++i)
- {
- if (attrs.localName(i) == "style:family")
- {
- if (attrs.value(i) == "paragraph")
- {
- isParaStyle = true;
- readProperties = true;
- }
- else if (attrs.value(i) == "text")
- {
- isParaStyle = false;
- readProperties = true;
- }
- else
- {
- readProperties = false;
- return;
- }
- }
- else if (attrs.localName(i) == "style:name")
- name = attrs.value(i);
- else if (attrs.localName(i) == "style:parent-style-name")
- {
- if (styles.contains(attrs.value(i)))
- parentStyle = styles[attrs.value(i)];
- else
+ for (int i = 0; i < attrs.count(); ++i)
+ {
+ if (attrs.localName(i) == "style:family")
+ {
+ if (attrs.value(i) == "paragraph")
+ {
+ isParaStyle = true;
+ readProperties = true;
+ }
+ else if (attrs.value(i) == "text")
+ {
+ isParaStyle = false;
+ readProperties = true;
+ }
+ else
+ {
+ readProperties = false;
+ return;
+ }
+ }
+ else if (attrs.localName(i) == "style:name")
+ name = attrs.value(i);
+ else if (attrs.localName(i) == "style:parent-style-name")
+ {
+ if (styles.contains(attrs.value(i)))
+ parentStyle = styles[attrs.value(i)];
+ else
parentStyle = nullptr;
- }
- else if (attrs.localName(i) == "style:list-style-name")
- listName = attrs.value(i);
- }
+ }
+ else if (attrs.localName(i) == "style:list-style-name")
+ listName = attrs.value(i);
+ }
if ((parentStyle == nullptr) && (styles.contains("default-style")))
- parentStyle = styles["default-style"];
-
- if (create)
- {
+ parentStyle = styles["default-style"];
+
+ if (create)
+ {
if (parentStyle == nullptr)
- {
- parentStyle = new gtStyle("tmp-parent");
- }
- if (isParaStyle)
- {
- gtParagraphStyle *tmpP;
- if (parentStyle->target() == "paragraph")
- {
- tmpP = dynamic_cast<gtParagraphStyle*>(parentStyle);
+ {
+ parentStyle = new gtStyle("tmp-parent");
+ }
+ if (isParaStyle)
+ {
+ gtParagraphStyle *tmpP;
+ if (parentStyle->target() == "paragraph")
+ {
+ tmpP = dynamic_cast<gtParagraphStyle*>(parentStyle);
assert(tmpP != nullptr);
- gtParagraphStyle* tmp = new gtParagraphStyle(*tmpP);
- // tmp->setAutoLineSpacing(true);
- currentStyle = tmp;
- }
- else
- {
- gtParagraphStyle* tmp = new gtParagraphStyle(*parentStyle);
- // tmp->setAutoLineSpacing(true);
- currentStyle = tmp;
- }
+ gtParagraphStyle* tmp = new gtParagraphStyle(*tmpP);
+ // tmp->setAutoLineSpacing(true);
+ currentStyle = tmp;
+ }
+ else
+ {
+ gtParagraphStyle* tmp = new gtParagraphStyle(*parentStyle);
+ // tmp->setAutoLineSpacing(true);
+ currentStyle = tmp;
+ }
if (!listName.isEmpty())
- {
- listParents[listName] = currentStyle;
- }
- }
- else
- currentStyle = new gtStyle(*parentStyle);
-
- currentStyle->setName(name);
+ {
+ listParents[listName] = currentStyle;
+ }
+ }
+ else
+ currentStyle = new gtStyle(*parentStyle);
+
+ currentStyle->setName(name);
if (setDefaultStyle)
{
gtParagraphStyle* tmp = dynamic_cast<gtParagraphStyle*>(currentStyle);
if (tmp)
tmp->setDefaultStyle(true);
}
- }
- else
+ }
+ else
currentStyle = nullptr;
- }
-
- void StyleReader::tabStop(const QXmlAttributes& attrs)
- {
- if (currentStyle->target() == "paragraph")
- {
- gtParagraphStyle* pstyle = dynamic_cast<gtParagraphStyle*>(currentStyle);
+}
+
+void StyleReader::tabStop(const QXmlAttributes& attrs)
+{
+ if (currentStyle->target() == "paragraph")
+ {
+ gtParagraphStyle* pstyle = dynamic_cast<gtParagraphStyle*>(currentStyle);
assert(pstyle != nullptr);
QString pos;
QString type;
- for (int i = 0; i < attrs.count(); ++i)
- {
- if (attrs.localName(i) == "style:position")
- pos = attrs.value(i);
- else if (attrs.localName(i) == "style:type")
- type = attrs.value(i);
-
- }
+ for (int i = 0; i < attrs.count(); ++i)
+ {
+ if (attrs.localName(i) == "style:position")
+ pos = attrs.value(i);
+ else if (attrs.localName(i) == "style:type")
+ type = attrs.value(i);
+
+ }
if (!pos.isEmpty())
- {
+ {
if (!type.isEmpty())
- type = "left";
- double posd = getSize(pos);
- if (type == "left")
- pstyle->setTabValue(posd, LEFT_T);
- else if (type == "right")
- pstyle->setTabValue(posd, RIGHT_T);
- else if (type == "center")
- pstyle->setTabValue(posd, CENTER_T);
- else
- pstyle->setTabValue(posd, CENTER_T);
- }
- }
- }
-
- bool StyleReader::endElement(const QString&, const QString&, const QString &name)
- {
+ type = "left";
+ double posd = getSize(pos);
+ if (type == "left")
+ pstyle->setTabValue(posd, LEFT_T);
+ else if (type == "right")
+ pstyle->setTabValue(posd, RIGHT_T);
+ else if (type == "center")
+ pstyle->setTabValue(posd, CENTER_T);
+ else
+ pstyle->setTabValue(posd, CENTER_T);
+ }
+ }
+}
+
+bool StyleReader::endElement(const QString&, const QString&, const QString &name)
+{
if ((name == "style:default-style") && (currentStyle != nullptr) && (readProperties))
- {
- setStyle(currentStyle->getName(), currentStyle);
+ {
+ setStyle(currentStyle->getName(), currentStyle);
currentStyle = nullptr;
parentStyle = nullptr;
- readProperties = false;
- }
- else if (((name == "style:style") ||
- (name == "text:list-level-style-bullet") ||
- (name == "text:list-level-style-number") ||
+ readProperties = false;
+ }
+ else if (((name == "style:style") ||
+ (name == "text:list-level-style-bullet") ||
+ (name == "text:list-level-style-number") ||
(name == "text:list-level-style-image")) && (currentStyle != nullptr))
- {
- setStyle(currentStyle->getName(), currentStyle);
+ {
+ setStyle(currentStyle->getName(), currentStyle);
currentStyle = nullptr;
parentStyle = nullptr;
- readProperties = false;
- }
- else if (name == "text:list-style")
- {
- inList = false;
- }
-
- return true;
- }
-
- void StyleReader::parse(const QString& fileName)
- {
+ readProperties = false;
+ }
+ else if (name == "text:list-style")
+ {
+ inList = false;
+ }
+
+ return true;
+}
+
+void StyleReader::parse(const QString& fileName)
+{
#if defined(_WIN32)
QString fname = QDir::toNativeSeparators(fileName);
QByteArray fn = (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based) ? fname.toUtf8() : fname.toLocal8Bit();
#else
QByteArray fn(fileName.toLocal8Bit());
#endif
- xmlSAXParseFile(sSAXHandler, fn.data(), 1);
- }
-
- gtStyle* StyleReader::getDefaultStyle(void)
- {
- gtStyle* defStyle = writer->getDefaultStyle();
- StyleMap::Iterator it, itEnd = styles.end();
- for (it = styles.begin(); it != itEnd; ++it)
- {
- gtParagraphStyle *pStyle = dynamic_cast<gtParagraphStyle*> (it.value());
- if (pStyle && pStyle->isDefaultStyle())
- {
- defStyle = pStyle;
- break;
- }
- }
- return defStyle;
- }
-
- gtStyle* StyleReader::getStyle(const QString& name)
- {
- if (styles.contains(name))
- {
- gtStyle* tmp = styles[name];
- QString tname = tmp->getName();
- if ((tname.indexOf(docname) == -1) && (usePrefix))
- tmp->setName(docname + "_" + tname);
-
- return tmp;
- }
+ xmlSAXParseFile(sSAXHandler, fn.data(), 1);
+}
+
+gtStyle* StyleReader::getDefaultStyle(void)
+{
+ gtStyle* defStyle = writer->getDefaultStyle();
+ StyleMap::Iterator it, itEnd = styles.end();
+ for (it = styles.begin(); it != itEnd; ++it)
+ {
+ gtParagraphStyle *pStyle = dynamic_cast<gtParagraphStyle*> (it.value());
+ if (pStyle && pStyle->isDefaultStyle())
+ {
+ defStyle = pStyle;
+ break;
+ }
+ }
+ return defStyle;
+}
+
+gtStyle* StyleReader::getStyle(const QString& name)
+{
+ if (styles.contains(name))
+ {
+ gtStyle* tmp = styles[name];
+ QString tname = tmp->getName();
+ if ((tname.indexOf(docname) == -1) && (usePrefix))
+ tmp->setName(docname + "_" + tname);
+
+ return tmp;
+ }
return getDefaultStyle();
- }
-
- void StyleReader::setStyle(const QString& name, gtStyle* style)
- {
- gtParagraphStyle *s;
- QString tname = style->getName();
- if ((style->target() == "paragraph") && (packStyles))
- {
- s = dynamic_cast<gtParagraphStyle*>(style);
+}
+
+void StyleReader::setStyle(const QString& name, gtStyle* style)
+{
+ gtParagraphStyle *s;
+ QString tname = style->getName();
+ if ((style->target() == "paragraph") && (packStyles))
+ {
+ s = dynamic_cast<gtParagraphStyle*>(style);
assert(s != nullptr);
- QString nameByAttrs = QString("%1-").arg(s->getSpaceAbove());
- nameByAttrs += QString("%1-").arg(s->getSpaceBelow());
- nameByAttrs += QString("%1-").arg(s->getLineSpacing());
- nameByAttrs += QString("%1-").arg(s->getIndent());
- nameByAttrs += QString("%1-").arg(s->getFirstLineIndent());
- nameByAttrs += QString("%1-").arg(s->getAlignment());
- nameByAttrs += QString("%1-").arg(s->hasDropCap());
- nameByAttrs += QString("%1-").arg(s->getFont()->getColor());
- nameByAttrs += QString("%1-").arg(s->getFont()->getStrokeColor());
-// TODO is this important ??
-/* QValueList<double>* tmp = s->getTabValues();
- for (uint i = 0; i < tmp->count(); ++i)
- {
- double td = (*tmp)[i];
- nameByAttrs += QString("%1-").arg(td);
- } */
- if (attrsStyles.contains(nameByAttrs))
- {
- tname = attrsStyles[nameByAttrs]->getName();
- ++pstyleCounts[nameByAttrs];
- style->setName(tname);
- }
- else
- {
- attrsStyles[nameByAttrs] = style;
- pstyleCounts[nameByAttrs] = 1;
- tname = style->getName();
- }
- }
- else if (!packStyles)
- {
- attrsStyles[name] = style;
- pstyleCounts[name] = 1;
- tname = style->getName();
- }
- if (!styles.contains(name))
- {
- if ((tname.indexOf(docname) == -1) && (usePrefix))
- style->setName(docname + "_" + tname);
- styles[name] = style;
- }
- }
-
- QString StyleReader::getFont(const QString& key)
- {
- if (fonts.contains(key))
- return fonts[key];
+ QString nameByAttrs = QString("%1-").arg(s->getSpaceAbove());
+ nameByAttrs += QString("%1-").arg(s->getSpaceBelow());
+ nameByAttrs += QString("%1-").arg(s->getLineSpacing());
+ nameByAttrs += QString("%1-").arg(s->getIndent());
+ nameByAttrs += QString("%1-").arg(s->getFirstLineIndent());
+ nameByAttrs += QString("%1-").arg(s->getAlignment());
+ nameByAttrs += QString("%1-").arg(s->hasDropCap());
+ nameByAttrs += QString("%1-").arg(s->getFont()->getColor());
+ nameByAttrs += QString("%1-").arg(s->getFont()->getStrokeColor());
+ // TODO is this important ??
+ /* QValueList<double>* tmp = s->getTabValues();
+ for (uint i = 0; i < tmp->count(); ++i)
+ {
+ double td = (*tmp)[i];
+ nameByAttrs += QString("%1-").arg(td);
+ } */
+ if (attrsStyles.contains(nameByAttrs))
+ {
+ tname = attrsStyles[nameByAttrs]->getName();
+ ++pstyleCounts[nameByAttrs];
+ style->setName(tname);
+ }
+ else
+ {
+ attrsStyles[nameByAttrs] = style;
+ pstyleCounts[nameByAttrs] = 1;
+ tname = style->getName();
+ }
+ }
+ else if (!packStyles)
+ {
+ attrsStyles[name] = style;
+ pstyleCounts[name] = 1;
+ tname = style->getName();
+ }
+ if (!styles.contains(name))
+ {
+ if ((tname.indexOf(docname) == -1) && (usePrefix))
+ style->setName(docname + "_" + tname);
+ styles[name] = style;
+ }
+}
+
+QString StyleReader::getFont(const QString& key)
+{
+ if (fonts.contains(key))
+ return fonts[key];
return key;
- }
-
- void StyleReader::setupFrameStyle()
- {
+}
+
+void StyleReader::setupFrameStyle()
+{
QString fstyleName;
- int count = 0;
- CounterMap::Iterator it;
- for (it = pstyleCounts.begin(); it != pstyleCounts.end(); ++it)
- {
- if (it.value() > count)
- {
- count = it.value();
- fstyleName = it.key();
- }
- }
- gtFrameStyle* fstyle;
- gtParagraphStyle* pstyle = dynamic_cast<gtParagraphStyle*>(attrsStyles[fstyleName]);
- fstyle = new gtFrameStyle(*pstyle);
-
- if (!importTextOnly)
- writer->setFrameStyle(fstyle);
- delete fstyle;
- }
-
- bool StyleReader::updateStyle(gtStyle* style, gtStyle* parent2Style, const QString& key, const QString& value)
- {
- gtParagraphStyle* pstyle = nullptr;
- if (style->target() == "paragraph")
- pstyle = dynamic_cast<gtParagraphStyle*>(style);
- else
- pstyle = nullptr;
- QString align;
- QString force;
-
- if (key == "style:font-name")
- style->getFont()->setName(getFont(value));
- else if (key == "fo:font-size")
- {
- double size = 0;
- double psize = 0;
- if (parent2Style != nullptr)
- psize = static_cast<double>(parent2Style->getFont()->getSize());
- else if (styles.contains("default-style"))
- psize = static_cast<double>(styles["default-style"]->getFont()->getSize());
- psize = psize / 10;
- size = getSize(value, psize);
- int nsize = static_cast<int>(size * 10);
- style->getFont()->setSize(nsize);
- if (pstyle)
- pstyle->setLineSpacing(writer->getPreferredLineSpacing(nsize));
- }
- else if ((key == "fo:line-height") && (parent2Style != nullptr))
- {
- gtParagraphStyle* ppstyle;
- if (parent2Style->target() == "paragraph")
- {
- ppstyle = dynamic_cast<gtParagraphStyle*>(parent2Style);
- assert(ppstyle != nullptr);
- ppstyle->setLineSpacing(getSize(value, writer->getPreferredLineSpacing(style->getFont()->getSize())));
- }
- }
- else if (key == "fo:color")
- style->getFont()->setColor(value);
- else if ((key == "style:use-window-font-color") && (value == "true"))
- style->getFont()->setColor("Black");
- else if ((key == "fo:font-weight") && (value == "bold"))
- style->getFont()->setWeight(BOLD);
- else if ((key == "fo:font-style") && (value == "italic"))
- style->getFont()->setSlant(ITALIC);
- else if ((key == "style:text-underline") && (value != "none"))
- style->getFont()->toggleEffect(UNDERLINE);
- else if ((key == "style:text-crossing-out") && (value != "none"))
- style->getFont()->toggleEffect(STRIKETHROUGH);
- else if ((key == "fo:font-variant") && (value == "small-caps"))
- style->getFont()->toggleEffect(SMALL_CAPS);
- else if ((key == "style:text-outline") && (value == "true"))
- {
- style->getFont()->toggleEffect(OUTLINE);
- style->getFont()->setStrokeColor("Black");
- style->getFont()->setColor("White");
- }
- else if (key == "fo:letter-spacing")
- style->getFont()->setKerning(static_cast<int>(getSize(value, -1.0)));
- else if (key == "style:text-scale")
- style->getFont()->setHscale(static_cast<int>(getSize(value, -1.0)));
- else if ((key == "style:text-position") &&
- (((value).indexOf("sub") != -1) ||
- (((value).left(1) == "-") && ((value).left(1) != "0"))))
- style->getFont()->toggleEffect(SUBSCRIPT);
- else if ((key == "style:text-position") &&
- (((value).indexOf("super") != -1) ||
- (((value).left(1) != "-") && ((value).left(1) != "0"))))
- style->getFont()->toggleEffect(SUPERSCRIPT);
- else if ((key == "fo:margin-top") && (pstyle != nullptr))
- pstyle->setSpaceAbove(getSize(value));
- else if ((key == "fo:margin-bottom") && (pstyle != nullptr))
- pstyle->setSpaceBelow(getSize(value));
- else if ((key == "fo:margin-left") && (pstyle != nullptr))
- {
- if (inList)
- pstyle->setIndent(pstyle->getIndent() + getSize(value));
- else
- pstyle->setIndent(getSize(value));
- }
- else if ((key == "text:space-before") && (pstyle != nullptr))
- {
- if (inList)
- pstyle->setIndent(pstyle->getIndent() + getSize(value));
- else
- pstyle->setIndent(getSize(value));
- }
- else if ((key == "fo:text-indent") && (pstyle != nullptr))
- pstyle->setFirstLineIndent(getSize(value));
- else if ((key == "fo:text-align") && (pstyle != nullptr))
- align = value;
- else if ((key == "style:justify-single-word") && (pstyle != nullptr))
- force = value;
-
- if (!align.isEmpty() && (pstyle != nullptr))
- {
- if (align == "end")
- pstyle->setAlignment(RIGHT);
- else if (align == "center")
- pstyle->setAlignment(CENTER);
- else if (align == "justify")
- {
- if (force != "false")
- pstyle->setAlignment(FORCED);
- else
- pstyle->setAlignment(BLOCK);
- }
- }
-
- return true;
- }
-
- double StyleReader::getSize(const QString& s, double parentSize)
- {
+ int count = 0;
+ CounterMap::Iterator it;
+ for (it = pstyleCounts.begin(); it != pstyleCounts.end(); ++it)
+ {
+ if (it.value() > count)
+ {
+ count = it.value();
+ fstyleName = it.key();
+ }
+ }
+ gtFrameStyle* fstyle;
+ gtParagraphStyle* pstyle = dynamic_cast<gtParagraphStyle*>(attrsStyles[fstyleName]);
+ fstyle = new gtFrameStyle(*pstyle);
+
+ if (!importTextOnly)
+ writer->setFrameStyle(fstyle);
+ delete fstyle;
+}
+
+bool StyleReader::updateStyle(gtStyle* style, gtStyle* parent2Style, const QString& key, const QString& value)
+{
+ gtParagraphStyle* pstyle = nullptr;
+ if (style->target() == "paragraph")
+ pstyle = dynamic_cast<gtParagraphStyle*>(style);
+ else
+ pstyle = nullptr;
+ QString align;
+ QString force;
+
+ if (key == "style:font-name")
+ style->getFont()->setName(getFont(value));
+ else if (key == "fo:font-size")
+ {
+ double size = 0;
+ double psize = 0;
+ if (parent2Style != nullptr)
+ psize = static_cast<double>(parent2Style->getFont()->getSize());
+ else if (styles.contains("default-style"))
+ psize = static_cast<double>(styles["default-style"]->getFont()->getSize());
+ psize = psize / 10;
+ size = getSize(value, psize);
+ int nsize = static_cast<int>(size * 10);
+ style->getFont()->setSize(nsize);
+ if (pstyle)
+ pstyle->setLineSpacing(writer->getPreferredLineSpacing(nsize));
+ }
+ else if ((key == "fo:line-height") && (parent2Style != nullptr))
+ {
+ gtParagraphStyle* ppstyle;
+ if (parent2Style->target() == "paragraph")
+ {
+ ppstyle = dynamic_cast<gtParagraphStyle*>(parent2Style);
+ assert(ppstyle != nullptr);
+ ppstyle->setLineSpacing(getSize(value, writer->getPreferredLineSpacing(style->getFont()->getSize())));
+ }
+ }
+ else if (key == "fo:color")
+ style->getFont()->setColor(value);
+ else if ((key == "style:use-window-font-color") && (value == "true"))
+ style->getFont()->setColor("Black");
+ else if ((key == "fo:font-weight") && (value == "bold"))
+ style->getFont()->setWeight(BOLD);
+ else if ((key == "fo:font-style") && (value == "italic"))
+ style->getFont()->setSlant(ITALIC);
+ else if ((key == "style:text-underline") && (value != "none"))
+ style->getFont()->toggleEffect(UNDERLINE);
+ else if ((key == "style:text-crossing-out") && (value != "none"))
+ style->getFont()->toggleEffect(STRIKETHROUGH);
+ else if ((key == "fo:font-variant") && (value == "small-caps"))
+ style->getFont()->toggleEffect(SMALL_CAPS);
+ else if ((key == "style:text-outline") && (value == "true"))
+ {
+ style->getFont()->toggleEffect(OUTLINE);
+ style->getFont()->setStrokeColor("Black");
+ style->getFont()->setColor("White");
+ }
+ else if (key == "fo:letter-spacing")
+ style->getFont()->setKerning(static_cast<int>(getSize(value, -1.0)));
+ else if (key == "style:text-scale")
+ style->getFont()->setHscale(static_cast<int>(getSize(value, -1.0)));
+ else if ((key == "style:text-position") &&
+ (((value).indexOf("sub") != -1) ||
+ (((value).left(1) == "-") && ((value).left(1) != "0"))))
+ style->getFont()->toggleEffect(SUBSCRIPT);
+ else if ((key == "style:text-position") &&
+ (((value).indexOf("super") != -1) ||
+ (((value).left(1) != "-") && ((value).left(1) != "0"))))
+ style->getFont()->toggleEffect(SUPERSCRIPT);
+ else if ((key == "fo:margin-top") && (pstyle != nullptr))
+ pstyle->setSpaceAbove(getSize(value));
+ else if ((key == "fo:margin-bottom") && (pstyle != nullptr))
+ pstyle->setSpaceBelow(getSize(value));
+ else if ((key == "fo:margin-left") && (pstyle != nullptr))
+ {
+ if (inList)
+ pstyle->setIndent(pstyle->getIndent() + getSize(value));
+ else
+ pstyle->setIndent(getSize(value));
+ }
+ else if ((key == "text:space-before") && (pstyle != nullptr))
+ {
+ if (inList)
+ pstyle->setIndent(pstyle->getIndent() + getSize(value));
+ else
+ pstyle->setIndent(getSize(value));
+ }
+ else if ((key == "fo:text-indent") && (pstyle != nullptr))
+ pstyle->setFirstLineIndent(getSize(value));
+ else if ((key == "fo:text-align") && (pstyle != nullptr))
+ align = value;
+ else if ((key == "style:justify-single-word") && (pstyle != nullptr))
+ force = value;
+
+ if (!align.isEmpty() && (pstyle != nullptr))
+ {
+ if (align == "end")
+ pstyle->setAlignment(RIGHT);
+ else if (align == "center")
+ pstyle->setAlignment(CENTER);
+ else if (align == "justify")
+ {
+ if (force != "false")
+ pstyle->setAlignment(FORCED);
+ else
+ pstyle->setAlignment(BLOCK);
+ }
+ }
+
+ return true;
+}
+
+double StyleReader::getSize(const QString& s, double parentSize)
+{
QString dbl("0.0");
- QString lowerValue = s.toLower();
- double ret = 0.0;
- if (lowerValue.indexOf("pt") != -1)
- {
- dbl = lowerValue.remove("pt");
- ret = gtMeasure::d2d(dbl.toDouble(), SC_PT);
- }
- else if (lowerValue.indexOf("mm") != -1)
- {
- dbl = lowerValue.remove("mm");
- ret = gtMeasure::d2d(dbl.toDouble(), SC_MM);
- }
- else if (lowerValue.indexOf("cm") != -1)
- {
- dbl = lowerValue.remove("cm");
- ret = gtMeasure::d2d(dbl.toDouble() * 10, SC_MM);
- }
- else if (lowerValue.indexOf("in") != -1)
- {
- dbl = lowerValue.remove("inch");
- dbl = lowerValue.remove("in");
- ret = gtMeasure::d2d(dbl.toDouble(), SC_IN);
- }
- else if (lowerValue.indexOf("pi") != -1)
- {
- dbl = lowerValue.remove("pica");
- dbl = lowerValue.remove("pi");
- ret = gtMeasure::d2d(dbl.toDouble(), SC_P);
- }
- else if (lowerValue.indexOf("c") != -1)
- {
- dbl = lowerValue.remove("cicero");
- dbl = lowerValue.remove("c");
- ret = gtMeasure::d2d(dbl.toDouble(), SC_C);
- }
- else if (lowerValue.indexOf("%") != -1)
- {
- dbl = lowerValue.remove("%");
- double factor = dbl.toDouble();
- if (parentSize != -1.0)
- {
- factor = factor / 100;
- ret = factor * parentSize;
- }
- else
- ret = factor;
- }
- return ret;
- }
-
- StyleReader::~StyleReader()
- {
+ QString lowerValue = s.toLower();
+ double ret = 0.0;
+ if (lowerValue.indexOf("pt") != -1)
+ {
+ dbl = lowerValue.remove("pt");
+ ret = gtMeasure::d2d(dbl.toDouble(), SC_PT);
+ }
+ else if (lowerValue.indexOf("mm") != -1)
+ {
+ dbl = lowerValue.remove("mm");
+ ret = gtMeasure::d2d(dbl.toDouble(), SC_MM);
+ }
+ else if (lowerValue.indexOf("cm") != -1)
+ {
+ dbl = lowerValue.remove("cm");
+ ret = gtMeasure::d2d(dbl.toDouble() * 10, SC_MM);
+ }
+ else if (lowerValue.indexOf("in") != -1)
+ {
+ dbl = lowerValue.remove("inch");
+ dbl = lowerValue.remove("in");
+ ret = gtMeasure::d2d(dbl.toDouble(), SC_IN);
+ }
+ else if (lowerValue.indexOf("pi") != -1)
+ {
+ dbl = lowerValue.remove("pica");
+ dbl = lowerValue.remove("pi");
+ ret = gtMeasure::d2d(dbl.toDouble(), SC_P);
+ }
+ else if (lowerValue.indexOf("c") != -1)
+ {
+ dbl = lowerValue.remove("cicero");
+ dbl = lowerValue.remove("c");
+ ret = gtMeasure::d2d(dbl.toDouble(), SC_C);
+ }
+ else if (lowerValue.indexOf("%") != -1)
+ {
+ dbl = lowerValue.remove("%");
+ double factor = dbl.toDouble();
+ if (parentSize != -1.0)
+ {
+ factor = factor / 100;
+ ret = factor * parentSize;
+ }
+ else
+ ret = factor;
+ }
+ return ret;
+}
+
+StyleReader::~StyleReader()
+{
sreader = nullptr;
- StyleMap::Iterator it;
- for (it = styles.begin(); it != styles.end(); ++it)
- {
- if (it.value())
- {
- delete it.value();
+ StyleMap::Iterator it;
+ for (it = styles.begin(); it != styles.end(); ++it)
+ {
+ if (it.value())
+ {
+ delete it.value();
it.value() = nullptr;
- }
- }
- }
-
- xmlSAXHandler sSAXHandlerStruct = {
+ }
+ }
+}
+
+xmlSAXHandler sSAXHandlerStruct = {
nullptr, // internalSubset,
nullptr, // isStandalone,
nullptr, // hasInternalSubset,
@@ -777,8 +777,8 @@
nullptr, // setDocumentLocator,
nullptr, // startDocument,
nullptr, // endDocument,
- StyleReader::startElement,
- StyleReader::endElement,
+ StyleReader::startElement,
+ StyleReader::endElement,
nullptr, // reference,
nullptr, // characters
nullptr, // ignorableWhitespace,
@@ -790,30 +790,30 @@
nullptr, // getParameterEntity,
nullptr, // cdata,
nullptr,
- 1
- #ifdef HAVE_XML26
- ,
+ 1
+ #ifdef HAVE_XML26
+ ,
nullptr,
nullptr,
nullptr,
nullptr
- #endif
- };
-
- xmlSAXHandlerPtr sSAXHandler = &sSAXHandlerStruct;
-
- void StyleReader::startElement(void*, const xmlChar * fullname, const xmlChar ** atts)
- {
- QString name = QString((const char*) fullname).toLower();
- QXmlAttributes attrs;
- for(const xmlChar** cur = atts; cur && *cur; cur += 2)
+ #endif
+};
+
+xmlSAXHandlerPtr sSAXHandler = &sSAXHandlerStruct;
+
+void StyleReader::startElement(void*, const xmlChar * fullname, const xmlChar ** atts)
+{
+ QString name = QString((const char*) fullname).toLower();
+ QXmlAttributes attrs;
+ for(const xmlChar** cur = atts; cur && *cur; cur += 2)
attrs.append(QString((char*)*cur), nullptr, QString((char*)*cur), QString((char*)*(cur + 1)));
sreader->startElement(nullptr, nullptr, name, attrs);
- }
-
- void StyleReader::endElement(void*, const xmlChar * name)
- {
- QString nname = QString((const char*) name).toLower();
+}
+
+void StyleReader::endElement(void*, const xmlChar * name)
+{
+ QString nname = QString((const char*) name).toLower();
sreader->endElement(nullptr, nullptr, nname);
- }
-
+}
+
Modified: trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/xfig/importxfig.cpp Mon Aug 20 19:01:43 2018
@@ -48,9 +48,6 @@
#include "util.h"
#include "util_formats.h"
#include "util_math.h"
-
-
-extern SCRIBUS_API ScribusQApp * ScQApp;
XfigPlug::XfigPlug(ScribusDoc* doc, int flags)
{
Modified: trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp (original)
+++ trunk/Scribus/scribus/plugins/picbrowser/previewimage.cpp Mon Aug 20 19:01:43 2018
@@ -132,15 +132,11 @@
void previewImages::createPreviewImagesList ( const imageCollection *collection )
{
//if there are already previewimages allocated, remove them
- if ( previewImagesList.size() > 0 )
- {
+ if (!previewImagesList.empty())
clearPreviewImagesList();
- }
-
- if ( collection->imageFiles.isEmpty() )
- {
+
+ if (collection->imageFiles.isEmpty())
return;
- }
int s = collection->imageFiles.size();
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdannotations.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdannotations.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdannotations.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdannotations.cpp Mon Aug 20 19:01:43 2018
@@ -61,7 +61,7 @@
PyObject *rv = Py_BuildValue("(sO)", name3, drv);
return rv;
}
- else if (atype == Annotation::Link && actype == Annotation::Action_URI)
+ if (atype == Annotation::Link && actype == Annotation::Action_URI)
{
const char uri[] = "uri";
PyObject *ukey = PyString_FromString(uri);
@@ -72,7 +72,7 @@
PyObject *rv = Py_BuildValue("(sO)", name4, drv);
return rv;
}
- else if (atype == Annotation::Link)
+ if (atype == Annotation::Link)
{
getLinkData(drv, a.Ziel(), a.Action());
const char name2[] = "Link";
@@ -80,49 +80,49 @@
PyObject *rv = Py_BuildValue("(sO)", name2, drv);
return rv;
}
- else if (atype == Annotation::Button)
+ if (atype == Annotation::Button)
{
const char name5[] = "Button";
add_text_to_dict(drv, i);
PyObject *rv = Py_BuildValue("(sO)", name5, drv);
return rv;
}
- else if (atype == Annotation::RadioButton)
+ if (atype == Annotation::RadioButton)
{
const char name4[] = "RadioButton";
add_text_to_dict(drv, i);
PyObject *rv = Py_BuildValue("(sO)", name4, drv);
return rv;
}
- else if (atype == Annotation::Textfield)
+ if (atype == Annotation::Textfield)
{
const char name6[] = "Textfield";
add_text_to_dict(drv, i);
PyObject *rv = Py_BuildValue("(sO)", name6, drv);
return rv;
}
- else if (atype == Annotation::Checkbox)
+ if (atype == Annotation::Checkbox)
{
const char name7[] = "Checkbox";
add_text_to_dict(drv, i);
PyObject *rv = Py_BuildValue("(sO)", name7, drv);
return rv;
}
- else if (atype == Annotation::Combobox)
+ if (atype == Annotation::Combobox)
{
const char name4[] = "Combobox";
add_text_to_dict(drv, i);
PyObject *rv = Py_BuildValue("(sO)", name4, drv);
return rv;
}
- else if (atype == Annotation::Listbox)
+ if (atype == Annotation::Listbox)
{
const char name8[] = "Listbox";
add_text_to_dict(drv, i);
PyObject *rv = Py_BuildValue("(sO)", name8, drv);
return rv;
}
- else if (atype == Annotation::Text)
+ if (atype == Annotation::Text)
{
/** icons: 0 "Note", 1 "Comment", 2 "Key",
3 "Help", 4 "NewParagraph", 5 "Paragraph", 6 "Insert",
@@ -153,18 +153,15 @@
PyObject *rv = Py_BuildValue("(sO)", name9, drv);
return rv;
}
- else if (atype == Annotation::Annot3D)
+ if (atype == Annotation::Annot3D)
{
const char a3dname[] = "Annot3D";
PyObject *rv = Py_BuildValue("(sO)",a3dname, drv);
return rv;
}
- else
- {
- const char unknown[] = "Unknown Annotation";
- PyObject *rv = Py_BuildValue("(sO)", unknown, drv);
- return rv;
- }
+ const char unknown[] = "Unknown Annotation";
+ PyObject *rv = Py_BuildValue("(sO)", unknown, drv);
+ return rv;
}
Py_RETURN_NONE;
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdcolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdcolor.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdcolor.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdcolor.cpp Mon Aug 20 19:01:43 2018
@@ -620,14 +620,9 @@
}
QString col = QString::fromUtf8(Name);
if (ScCore->primaryMainWindow()->doc->PageColors.contains(col))
- {
return PyBool_FromLong(static_cast<long>(ScCore->primaryMainWindow()->doc->PageColors[col].isSpotColor()));
- }
- else
- {
- PyErr_SetString(NotFoundError, QObject::tr("Color not found.","python error").toLocal8Bit().constData());
- return nullptr;
- }
+ PyErr_SetString(NotFoundError, QObject::tr("Color not found.","python error").toLocal8Bit().constData());
+ return nullptr;
// Py_RETURN_NONE;
}
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdgetsetprop.cpp Mon Aug 20 19:01:43 2018
@@ -19,7 +19,7 @@
// It's a string. Look for a pageItem by that name. Do NOT accept a
// selection.
return getPageItemByName(QString::fromUtf8(PyString_AsString(arg)));
- else if (PyCObject_Check(arg))
+ if (PyCObject_Check(arg))
{
// It's a PyCObject, ie a wrapped pointer. Check it's not nullptr
// and return it.
@@ -30,15 +30,11 @@
PyErr_SetString(PyExc_TypeError, "INTERNAL: Passed nullptr PyCObject");
return nullptr;
}
- else
- return tempObject;
- }
- else
- {
- // It's not a type we know what to do with
- PyErr_SetString(PyExc_TypeError, QObject::tr("Argument must be page item name, or PyCObject instance").toLocal8Bit().constData());
- return nullptr;
- }
+ return tempObject;
+ }
+ // It's not a type we know what to do with
+ PyErr_SetString(PyExc_TypeError, QObject::tr("Argument must be page item name, or PyCObject instance").toLocal8Bit().constData());
+ return nullptr;
}
@@ -327,8 +323,7 @@
assert(PyErr_Occurred());
return nullptr;
}
- else
- return resultobj;
+ return resultobj;
}
@@ -469,8 +464,7 @@
Py_DECREF(objRepr);
// And return an error
- PyErr_SetString(PyExc_TypeError,
- QObject::tr("Couldn't convert '%1' to property type '%2'").arg(reprString).arg(propertyType).toLocal8Bit().constData());
+ PyErr_SetString(PyExc_TypeError, QObject::tr("Couldn't convert '%1' to property type '%2'").arg(reprString, propertyType).toLocal8Bit().constData());
return nullptr;
}
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdmani.cpp Mon Aug 20 19:01:43 2018
@@ -465,9 +465,8 @@
return nullptr;
if ((i < static_cast<int>(ScCore->primaryMainWindow()->doc->m_Selection->count())) && (i > -1))
return PyString_FromString(ScCore->primaryMainWindow()->doc->m_Selection->itemAt(i)->itemName().toUtf8());
- else
- // FIXME: Should probably return None if no selection?
- return PyString_FromString("");
+ // FIXME: Should probably return None if no selection?
+ return PyString_FromString("");
}
PyObject *scribus_selcount(PyObject* /* self */)
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdmisc.cpp Mon Aug 20 19:01:43 2018
@@ -133,21 +133,19 @@
// set in that case.
return stringPython;
}
- else
+
// Save the pixmap to a file, since the filename is non-empty
- {
- ret = pm.save(QString::fromUtf8(FileName), format);
- if (!ret)
- {
- PyErr_SetString(PyExc_Exception, QObject::tr("Unable to save pixmap","scripter error").toLocal8Bit().constData());
- return nullptr;
- }
- // For historical reasons, we need to return true on success.
-// Py_INCREF(Py_True);
-// return Py_True;
-// Py_RETURN_TRUE;
- return PyBool_FromLong(static_cast<long>(true));
- }
+ ret = pm.save(QString::fromUtf8(FileName), format);
+ if (!ret)
+ {
+ PyErr_SetString(PyExc_Exception, QObject::tr("Unable to save pixmap","scripter error").toLocal8Bit().constData());
+ return nullptr;
+ }
+ // For historical reasons, we need to return true on success.
+ // Py_INCREF(Py_True);
+ // return Py_True;
+ // Py_RETURN_TRUE;
+ return PyBool_FromLong(static_cast<long>(true));
}
PyObject *scribus_getlayers(PyObject* /* self */)
Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdtext.cpp Mon Aug 20 19:01:43 2018
@@ -68,8 +68,7 @@
return PyFloat_FromDouble(static_cast<double>(it->itemText.charStyle(b).fontSize() / 10.0));
return nullptr;
}
- else
- return PyFloat_FromDouble(static_cast<double>(it->currentCharStyle().fontSize() / 10.0));
+ return PyFloat_FromDouble(static_cast<double>(it->currentCharStyle().fontSize() / 10.0));
}
PyObject *scribus_getfont(PyObject* /* self */, PyObject* args)
@@ -94,8 +93,7 @@
return PyString_FromString(it->itemText.charStyle(b).font().scName().toUtf8());
return nullptr;
}
- else
- return PyString_FromString(it->currentCharStyle().font().scName().toUtf8());
+ return PyString_FromString(it->currentCharStyle().font().scName().toUtf8());
}
PyObject *scribus_gettextsize(PyObject* /* self */, PyObject* args)
@@ -174,8 +172,7 @@
return PyString_FromString(it->itemText.charStyle(b).fontFeatures().toUtf8());
return nullptr;
}
- else
- return PyString_FromString(it->currentCharStyle().fontFeatures().toUtf8());
+ return PyString_FromString(it->currentCharStyle().fontFeatures().toUtf8());
}
PyObject *scribus_getlinespace(PyObject* /* self */, PyObject* args)
@@ -822,9 +819,7 @@
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text fill on a non-text frame.","python error").toLocal8Bit().constData());
return nullptr;
}
- else
- {
- ApplyCharstyleHelper<QString>(it, QString::fromUtf8(Color)).apply(&CharStyle::setFillColor, 0, it->itemText.length());
+ ApplyCharstyleHelper<QString>(it, QString::fromUtf8(Color)).apply(&CharStyle::setFillColor, 0, it->itemText.length());
// for (int b = 0; b < it->itemText.length(); b++)
// {
// //FIXME: doc method
@@ -837,7 +832,6 @@
// it->itemText.item(b)->setFillColor(QString::fromUtf8(Color));
// }
// it->TxtFill = QString::fromUtf8(Color);
- }
// Py_INCREF(Py_None);
// return Py_None;
Py_RETURN_NONE;
@@ -859,9 +853,7 @@
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text stroke on a non-text frame.","python error").toLocal8Bit().constData());
return nullptr;
}
- else
- {
- ApplyCharstyleHelper<QString>(it, QString::fromUtf8(Color)).apply(&CharStyle::setStrokeColor, 0, it->itemText.length());
+ ApplyCharstyleHelper<QString>(it, QString::fromUtf8(Color)).apply(&CharStyle::setStrokeColor, 0, it->itemText.length());
// for (int b = 0; b < it->itemText.length(); b++)
// {
// //FIXME:NLS use document method for this
@@ -874,7 +866,6 @@
// it->itemText.item(b)->setStrokeColor(QString::fromUtf8(Color));
// }
// it->TxtStroke = QString::fromUtf8(Color);
- }
// Py_INCREF(Py_None);
// return Py_None;
Py_RETURN_NONE;
@@ -973,9 +964,7 @@
PyErr_SetString(WrongFrameTypeError, QObject::tr("Cannot set text shade on a non-text frame.","python error").toLocal8Bit().constData());
return nullptr;
}
- else
- {
- ApplyCharstyleHelper<double>(it, w).apply(&CharStyle::setFillShade, 0, it->itemText.length());
+ ApplyCharstyleHelper<double>(it, w).apply(&CharStyle::setFillShade, 0, it->itemText.length());
// //FIXME:NLS use document method for that
// for (int b = 0; b < it->itemText.length(); ++b)
// {
@@ -988,7 +977,6 @@
// it->itemText.item(b)->setFillShade(w);
// }
// it->ShTxtFill = w;
- }
// Py_INCREF(Py_None);
// return Py_None;
Py_RETURN_NONE;
Modified: trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/objpdffile.cpp Mon Aug 20 19:01:43 2018
@@ -29,18 +29,18 @@
{
if (val < min)
return min;
- else if (val > max)
+ if (val > max)
return max;
- else return val;
+ return val;
}
static double minmaxd(double val, double min, double max)
{
if (val < min)
return min;
- else if (val > max)
+ if (val > max)
return max;
- else return val;
+ return val;
}
typedef struct
Modified: trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/runscriptdialog.cpp Mon Aug 20 19:01:43 2018
@@ -45,8 +45,7 @@
{
if (m_extEnable)
return extChk->isChecked();
- else
- return false;
+ return false;
}
QString RunScriptDialog::selectedFile()
Modified: trunk/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp Mon Aug 20 19:01:43 2018
@@ -547,12 +547,12 @@
QString docstring = content.section("\"\"\"", 1, 1);
if (!docstring.isEmpty())
{
- html += QString("<h1>%1 %2</h1>").arg( tr("Documentation for:")).arg(fi.fileName());
+ html += QString("<h1>%1 %2</h1>").arg( tr("Documentation for:"), fi.fileName());
html += QString("<p>%1</p>").arg(docstring.replace("\n\n", "<br><br>"));
}
else
{
- html += QString("<p><b>%1 %2 %3</b></p>").arg( tr("Script")).arg(fi.fileName()).arg( tr(" doesn't contain any docstring!"));
+ html += QString("<p><b>%1 %2 %3</b></p>").arg( tr("Script")).arg(fi.fileName(), tr(" doesn't contain any docstring!"));
html += QString("<pre>%4</pre>").arg(content);
}
html += "</body></html>";
@@ -617,8 +617,7 @@
"Error details were printed to stderr. "));
return false;
}
- else
- return true;
+ return true;
}
void ScripterCore::setStartupScript(const QString& newScript)
Modified: trunk/Scribus/scribus/plugins/short-words/swdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/short-words/swdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/short-words/swdialog.cpp (original)
+++ trunk/Scribus/scribus/plugins/short-words/swdialog.cpp Mon Aug 20 19:01:43 2018
@@ -80,9 +80,9 @@
{
if (frameRadio->isChecked())
return 0;
- else if (pageRadio->isChecked())
+ if (pageRadio->isChecked())
return 1;
- else if (allRadio->isChecked())
+ if (allRadio->isChecked())
return 2;
return 0;
}
Modified: trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp (original)
+++ trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp Mon Aug 20 19:01:43 2018
@@ -95,8 +95,7 @@
ignoreAllPushButton->setEnabled(false);
return;
}
- else
- statusLabel->setText("");
+ statusLabel->setText("");
currWF=m_wfList->at(m_wfListIndex);
setLanguageCombo(currWF.lang);
updateSuggestions(currWF.replacements);
Modified: trunk/Scribus/scribus/prefscontext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/prefscontext.cpp
==============================================================================
--- trunk/Scribus/scribus/prefscontext.cpp (original)
+++ trunk/Scribus/scribus/prefscontext.cpp Mon Aug 20 19:01:43 2018
@@ -58,7 +58,7 @@
bool PrefsContext::isEmpty()
{
- return (values.size() == 0 && tables.size() == 0);
+ return (values.empty() && tables.empty());
}
bool PrefsContext::contains(const QString& key)
Modified: trunk/Scribus/scribus/prefsfile.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/prefsfile.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsfile.cpp (original)
+++ trunk/Scribus/scribus/prefsfile.cpp Mon Aug 20 19:01:43 2018
@@ -86,7 +86,7 @@
void PrefsFile::write()
{
- if ((!m_ioEnabled) || ((m_contexts.size() == 0) && (m_pluginContexts.size() == 0)))
+ if ((!m_ioEnabled) || ((m_contexts.empty()) && (m_pluginContexts.empty())))
return; // No prefs file path set -> can't write or no prefs to write
QFile* prefsXML = new QFile(m_prefsFilePath);
if (prefsXML->open(QIODevice::WriteOnly))
@@ -95,19 +95,19 @@
stream.setCodec("UTF-8");
stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
stream << "<preferences>\n";
- if (m_contexts.size() > 0)
+ if (!m_contexts.empty())
{
stream << "\t<level name=\"application\">\n";
writeContexts(&m_contexts, stream);
stream << "\t</level>\n";
}
- if (m_userprefsContexts.size() > 0)
+ if (!m_userprefsContexts.empty())
{
stream << "\t<level name=\"plugin\">\n";
writeContexts(&m_userprefsContexts, stream);
stream << "\t</level>\n";
}
- if (m_pluginContexts.size() > 0)
+ if (!m_pluginContexts.empty())
{
stream << "\t<level name=\"plugin\">\n";
writeContexts(&m_pluginContexts, stream);
Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Mon Aug 20 19:01:43 2018
@@ -63,7 +63,6 @@
#include "ui/modetoolbar.h"
#include "ui/prefs_keyboardshortcuts.h"
-extern ScribusQApp* ScQApp;
extern bool emergencyActivated;
PrefsManager* PrefsManager::m_instance = nullptr;
Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Mon Aug 20 19:01:43 2018
@@ -1215,17 +1215,17 @@
}
else
{
- PutStream("%%BeginDocument: " + fi.fileName() + "\n");
- if (getDouble(tmp.mid(0, 4), true) == 0xC5D0D3C6)
- {
- char* data = tmp.data();
- uint startPos = getDouble(tmp.mid(4, 4), false);
- uint length = getDouble(tmp.mid(8, 4), false);
- PutStream(data+startPos, length, false);
- }
- else
- PutStream(tmp);
- PutStream("\n%%EndDocument\n");
+ PutStream("%%BeginDocument: " + fi.fileName() + "\n");
+ if (getDouble(tmp.mid(0, 4), true) == 0xC5D0D3C6)
+ {
+ char* data = tmp.data();
+ uint startPos = getDouble(tmp.mid(4, 4), false);
+ uint length = getDouble(tmp.mid(8, 4), false);
+ PutStream(data+startPos, length, false);
+ }
+ else
+ PutStream(tmp);
+ PutStream("\n%%EndDocument\n");
}
PutStream("eEPS\n");
return true;
@@ -1248,7 +1248,7 @@
resolution = item->asLatexFrame()->realDpi();
else if (item->pixm.imgInfo.type == ImageType7)
resolution = 72;
-// int resolution = (item->pixm.imgInfo.type == ImageType7) ? 72 : 300;
+ // int resolution = (item->pixm.imgInfo.type == ImageType7) ? 72 : 300;
if ( !image.loadPicture(fn, item->pixm.imgInfo.actualPageNumber, cms, ScImage::CMYKData, resolution, &dummy) )
{
PS_Error_ImageLoadFailure(fn);
@@ -1266,7 +1266,7 @@
scalex *= PrefsManager::instance()->appPrefs.extToolPrefs.gs_Resolution / 300.0;
scaley *= PrefsManager::instance()->appPrefs.extToolPrefs.gs_Resolution / 300.0;
}
-// PutStream(ToStr(x*scalex) + " " + ToStr(y*scaley) + " tr\n");
+ // PutStream(ToStr(x*scalex) + " " + ToStr(y*scaley) + " tr\n");
PutStream(ToStr(qRound(scalex*w)) + " " + ToStr(qRound(scaley*h)) + " sc\n");
PutStream(((!DoSep) && (!GraySc)) ? "/DeviceCMYK setcolorspace\n" : "/DeviceGray setcolorspace\n");
QByteArray maskArray;
@@ -1285,8 +1285,8 @@
return false;
}
}
- if ((maskArray.size() > 0) && (item->pixm.imgInfo.type != ImageType7))
- {
+ if ((maskArray.size() > 0) && (item->pixm.imgInfo.type != ImageType7))
+ {
int plate = DoSep ? Plate : (GraySc ? -2 : -1);
// JG - Experimental code using Type3 image instead of patterns
PutStream("<< /ImageType 3\n");
@@ -1480,7 +1480,7 @@
qDebug("%s", message.toLocal8Bit().data());
}
-void PSLib::PS_Error_ImageDataWriteFailure(void)
+void PSLib::PS_Error_ImageDataWriteFailure()
{
PS_Error( tr("Failed to write data for an image"));
}
@@ -1495,7 +1495,7 @@
PS_Error( tr("Failed to load an image mask : %1").arg(fileName) );
}
-void PSLib::PS_Error_InsufficientMemory(void)
+void PSLib::PS_Error_InsufficientMemory()
{
PS_Error( tr("Insufficient memory for processing an image"));
}
@@ -1763,7 +1763,7 @@
progressDialog->close();
if (errorOccured)
return 1;
- else if (abortExport)
+ if (abortExport)
return 2; //CB Lets leave 1 for general error condition
return 0;
}
@@ -1832,7 +1832,7 @@
PS_translate(0, -item->height());
PS_scale(1, -1);
}
- if (item->imageClip.size() != 0)
+ if (!item->imageClip.empty())
SetPathAndClip(item->imageClip, true);
if ((item->imageIsAvailable) && (!item->Pfile.isEmpty()))
{
@@ -3872,22 +3872,22 @@
PutStream("fill\n");
return;
}
- else if (GType == 9)
+ if (GType == 9)
{
HandleTensorGradient(item);
return;
}
- else if (GType == 10)
+ if (GType == 10)
{
HandleDiamondGradient(item);
return;
}
- else if ((GType == 11) || (GType == 13))
+ if ((GType == 11) || (GType == 13))
{
HandleMeshGradient(item);
return;
}
- else if (GType == 12)
+ if (GType == 12)
{
HandlePatchMeshGradient(item);
return;
@@ -4531,7 +4531,7 @@
}
}
-const QString& PSLib::errorMessage(void)
+const QString& PSLib::errorMessage()
{
return ErrorMessage;
}
Modified: trunk/Scribus/scribus/scfonts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/scfonts.cpp
==============================================================================
--- trunk/Scribus/scribus/scfonts.cpp (original)
+++ trunk/Scribus/scribus/scfonts.cpp Mon Aug 20 19:01:43 2018
@@ -346,11 +346,11 @@
{
if (a.encoding_id == TT_MS_ID_UCS_4)
return true;
- else if (b.encoding_id == TT_MS_ID_UCS_4)
+ if (b.encoding_id == TT_MS_ID_UCS_4)
return false;
- else if (a.encoding_id == TT_MS_ID_UNICODE_CS)
+ if (a.encoding_id == TT_MS_ID_UNICODE_CS)
return true;
- else if (b.encoding_id == TT_MS_ID_UNICODE_CS)
+ if (b.encoding_id == TT_MS_ID_UNICODE_CS)
return false;
}
}
@@ -661,9 +661,7 @@
FT_Done_Face(face);
checkedFonts.insert(filename, foCache);
if (showFontInformation)
- sDebug(QObject::tr("Font %1 is broken, discarding it. Error message: \"%2\"")
- .arg(filename)
- .arg(getFtError(error)));
+ sDebug(QObject::tr("Font %1 is broken, discarding it. Error message: \"%2\"").arg(filename, getFtError(error)));
return true;
}
getFontFormat(face, format, type);
@@ -878,7 +876,7 @@
//debug
QByteArray bb;
t->rawData(bb);
- QFile dump(QString("/tmp/fonts/%1-%2").arg(ts).arg(psName));
+ QFile dump(QString("/tmp/fonts/%1-%2").arg(ts, psName));
dump.open(IO_WriteOnly);
QDataStream os(&dump);
os.writeRawBytes(bb.data(), bb.size());
Modified: trunk/Scribus/scribus/scpainterex_ps2.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/scpainterex_ps2.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainterex_ps2.cpp (original)
+++ trunk/Scribus/scribus/scpainterex_ps2.cpp Mon Aug 20 19:01:43 2018
@@ -470,7 +470,7 @@
m_stream << QString("%1 setgray stroke\n").arg(gray);
return;
}
- else if (m_options.hProfile && m_options.rgbToOutputColorTransform && m_options.cmykToOutputColorTransform)
+ if (m_options.hProfile && m_options.rgbToOutputColorTransform && m_options.cmykToOutputColorTransform)
{
unsigned long colorIn[4];
unsigned long colorOut[4];
Modified: trunk/Scribus/scribus/scpaths.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/scpaths.cpp
==============================================================================
--- trunk/Scribus/scribus/scpaths.cpp (original)
+++ trunk/Scribus/scribus/scpaths.cpp Mon Aug 20 19:01:43 2018
@@ -166,21 +166,18 @@
CFRelease(macPath);
return QString("%1").arg(pathPtr);
}
- else
- {
- char buf[2048];
- CFStringGetCString (macPath, buf, 2048, kCFStringEncodingUTF8);
- QString q_pathPtr=QString::fromUtf8(buf);
- if (q_pathPtr.endsWith("/bin"))
- q_pathPtr.chop(4);
- if (q_pathPtr.endsWith("/MacOS"))
- q_pathPtr.chop(6);
- if (q_pathPtr.endsWith("/Contents"))
- q_pathPtr.chop(9);
- CFRelease(pluginRef);
- CFRelease(macPath);
- return q_pathPtr;
- }
+ char buf[2048];
+ CFStringGetCString (macPath, buf, 2048, kCFStringEncodingUTF8);
+ QString q_pathPtr=QString::fromUtf8(buf);
+ if (q_pathPtr.endsWith("/bin"))
+ q_pathPtr.chop(4);
+ if (q_pathPtr.endsWith("/MacOS"))
+ q_pathPtr.chop(6);
+ if (q_pathPtr.endsWith("/Contents"))
+ q_pathPtr.chop(9);
+ CFRelease(pluginRef);
+ CFRelease(macPath);
+ return q_pathPtr;
#endif
return QString::null;
}
Modified: trunk/Scribus/scribus/scprintengine_ps.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/scprintengine_ps.cpp
==============================================================================
--- trunk/Scribus/scribus/scprintengine_ps.cpp (original)
+++ trunk/Scribus/scribus/scprintengine_ps.cpp Mon Aug 20 19:01:43 2018
@@ -40,11 +40,8 @@
QFile::remove(filename);
if (psCreationRetVal==2)
return true;
- else
- {
- m_errorMessage = dd->errorMessage();
- return false;
- }
+ m_errorMessage = dd->errorMessage();
+ return false;
}
if (options.prnEngine != PostScript3 && ScCore->haveGS())
{
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Mon Aug 20 19:01:43 2018
@@ -5954,12 +5954,12 @@
if (!doc->m_Selection->isEmpty())
{
PageItem *currItem = doc->m_Selection->itemAt(0);
- nodePalette->EditCont->setEnabled(currItem->ContourLine.size() != 0);
+ nodePalette->EditCont->setEnabled(!currItem->ContourLine.empty());
nodePalette->ResetCont->setEnabled(false);
nodePalette->ResetContClip->setEnabled(false);
nodePalette->PolyStatus(currItem->itemType(), currItem->PoLine.size());
nodePalette->setDefaults(currItem);
- if ((currItem->asImageFrame()) && (currItem->imageClip.size() != 0))
+ if ((currItem->asImageFrame()) && (!currItem->imageClip.empty()))
{
nodePalette->ResetContClip->setSizePolicy(QSizePolicy(static_cast<QSizePolicy::Policy>(3), static_cast<QSizePolicy::Policy>(3)));
nodePalette->ResetContClip->show();
@@ -7854,7 +7854,7 @@
msgBox.exec();
if (msgBox.clickedButton() == abortButton)
return;
- else if (msgBox.clickedButton() == lockButton)
+ if (msgBox.clickedButton() == lockButton)
lockObject = true;
modifyLock = true;
}
@@ -8733,17 +8733,14 @@
accepted = true;
break;
}
- else
+ QUrl url( fileUrls[i] );
+ FileLoader *fileLoader = new FileLoader(url.path());
+ int testResult = fileLoader->testFile();
+ delete fileLoader;
+ if ((testResult != -1) && (testResult >= FORMATID_FIRSTUSER))
{
- QUrl url( fileUrls[i] );
- FileLoader *fileLoader = new FileLoader(url.path());
- int testResult = fileLoader->testFile();
- delete fileLoader;
- if ((testResult != -1) && (testResult >= FORMATID_FIRSTUSER))
- {
- accepted = true;
- break;
- }
+ accepted = true;
+ break;
}
}
}
Modified: trunk/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/scribusapp.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusapp.cpp (original)
+++ trunk/Scribus/scribus/scribusapp.cpp Mon Aug 20 19:01:43 2018
@@ -97,9 +97,6 @@
extern const char ARG_CONSOLE[] = "--console";
extern const char ARG_CONSOLE_SHORT[] = "-cl";
-extern ScribusQApp* ScQApp;
-extern ScribusCore* ScCore;
-
bool ScribusQApp::useGUI=false;
ScribusQApp::ScribusQApp( int & argc, char ** argv ) : QApplication(argc, argv),
@@ -586,11 +583,11 @@
printArgLine(ts, ARG_AVAILLANG_SHORT, ARG_AVAILLANG, tr("List the currently installed interface languages") );
printArgLine(ts, ARG_NOSPLASH_SHORT, ARG_NOSPLASH, tr("Do not show the splashscreen on startup") );
printArgLine(ts, ARG_NEVERSPLASH_SHORT, ARG_NEVERSPLASH, tr("Stop showing the splashscreen on startup. Writes an empty file called .neversplash in ~/.config/scribus") );
- printArgLine(ts, ARG_PREFS_SHORT, qPrintable(QString("%1 <%2>").arg(ARG_PREFS).arg(tr("path"))), tr("Use path for user given preferences location") );
+ printArgLine(ts, ARG_PREFS_SHORT, qPrintable(QString("%1 <%2>").arg(ARG_PREFS, tr("path"))), tr("Use path for user given preferences location") );
printArgLine(ts, ARG_PROFILEINFO_SHORT, ARG_PROFILEINFO, tr("Show location of ICC profile information on console while starting") );
printArgLine(ts, ARG_UPGRADECHECK_SHORT, ARG_UPGRADECHECK, tr("Download a file from the Scribus website and show the latest available version") );
printArgLine(ts, ARG_VERSION_SHORT, ARG_VERSION, tr("Output version information and exit") );
- printArgLine(ts, ARG_PYTHONSCRIPT_SHORT, qPrintable(QString("%1 <%2> [%3] ").arg(ARG_PYTHONSCRIPT).arg(tr("script")).arg(tr("arguments ..."))), tr("Run script in Python [with optional arguments]. This option must be last option used") );
+ printArgLine(ts, ARG_PYTHONSCRIPT_SHORT, qPrintable(QString("%1 <%2> [%3] ").arg(ARG_PYTHONSCRIPT).arg(tr("script"), tr("arguments ..."))), tr("Run script in Python [with optional arguments]. This option must be last option used") );
printArgLine(ts, ARG_NOGUI_SHORT, ARG_NOGUI, tr("Do not start GUI") );
ts << (QString(" %1").arg(CMD_OPTIONS_END,-39)) << tr("Explicit end of command line options"); endl(ts);
Modified: trunk/Scribus/scribus/scribuscore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/scribuscore.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuscore.cpp (original)
+++ trunk/Scribus/scribus/scribuscore.cpp Mon Aug 20 19:01:43 2018
@@ -407,7 +407,7 @@
break;
}
if (showInfo)
- sDebug( QString("Color profile %1 loaded from %2").arg(profileName).arg(profInfo.file) );
+ sDebug( QString("Color profile %1 loaded from %2").arg(profileName, profInfo.file) );
}
}
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Mon Aug 20 19:01:43 2018
@@ -3545,9 +3545,7 @@
{
if (UndoManager::undoEnabled())
{
- SimpleState *ss = new SimpleState(Um::SetLayerName,
- QString(Um::FromTo).arg(Layers[i].Name).arg(newName),
- Um::IDown);
+ SimpleState *ss = new SimpleState(Um::SetLayerName, QString(Um::FromTo).arg(Layers[i].Name).arg(newName), Um::IDown);
ss->set("CHANGE_NAME");
ss->set("ACTIVE", m_ActiveLayer);
ss->set("NEW_NAME", newName);
@@ -4790,7 +4788,7 @@
{
if (DocPages.at(pageNumber)->MPageNam != pageName)
{
- SimpleState *ss = new SimpleState(Um::ApplyMasterPage, QString(Um::FromTo).arg(DocPages.at(pageNumber)->MPageNam).arg(pageName));
+ SimpleState *ss = new SimpleState(Um::ApplyMasterPage, QString(Um::FromTo).arg(DocPages.at(pageNumber)->MPageNam, pageName));
ss->set("PAGE_NUMBER", pageNumber);
ss->set("OLD_MASTERPAGE", DocPages.at(pageNumber)->MPageNam);
ss->set("NEW_MASTERPAGE", pageName);
@@ -14246,7 +14244,7 @@
QString ohString = QString::number(currItem->oldHeight * m_docUnitRatio, 'f', unitPrecision) + " " + unitSuffix;
QString nwString = QString::number(newX * m_docUnitRatio, 'f', unitPrecision) + " " + unitSuffix;
QString nhString = QString::number(newY * m_docUnitRatio, 'f', unitPrecision) + " " + unitSuffix;
- QString transacDesc = QString(Um::ResizeFromTo).arg(owString).arg(ohString).arg(nwString).arg(nhString);
+ QString transacDesc = QString(Um::ResizeFromTo).arg(owString, ohString, nwString, nhString);
activeTransaction = m_undoManager->beginTransaction(currItem->getUName(), currItem->getUPixmap(), Um::Resize, transacDesc, Um::IResize);
}
int ph = static_cast<int>(qMax(1.0, currItem->lineWidth() / 2.0));
@@ -18112,7 +18110,7 @@
if (NS.range() == NS2->range())
{
if ((NS.getType() == NS2->getType()) && (NS.prefix() == NS2->prefix()) && (NS.suffix() == NS2->suffix()))
- errStr.append(tr("%1 note style has document as range and provide same numbering style as set %2").arg(NS.name()).arg(NS2->name()) + "\n");
+ errStr.append(tr("%1 note style has document as range and provide same numbering style as set %2").arg(NS.name(), NS2->name()) + "\n");
}
}
Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Mon Aug 20 19:01:43 2018
@@ -176,7 +176,7 @@
setWidget(m_canvas);
//already done by QScrollArea: widget()->installEventFilter(this);
installEventFilter(this); // FIXME:av
-// viewport()->setBackgroundMode(Qt::PaletteBackground);
+ // viewport()->setBackgroundMode(Qt::PaletteBackground);
setFocusPolicy(Qt::ClickFocus);
QFont fo = QFont(font());
// #8058: Better not use too small font size on Windows
@@ -210,17 +210,17 @@
redrawMarker->hide();
m_canvas->newRedrawPolygon();
m_canvas->resetRenderMode();
-// #13101 : "viewPreviewMode" is checked if necessary in ScribusMainWindow::newActWin()
-// At this point the view and parent window may not be able to perform all what is necessary to
-// enable preview mode anyway, especially when loading an existing doc.
-// m_ScMW->scrActions["viewPreviewMode"]->setChecked(m_canvas->m_viewMode.viewAsPreview);
+ // #13101 : "viewPreviewMode" is checked if necessary in ScribusMainWindow::newActWin()
+ // At this point the view and parent window may not be able to perform all what is necessary to
+ // enable preview mode anyway, especially when loading an existing doc.
+ // m_ScMW->scrActions["viewPreviewMode"]->setChecked(m_canvas->m_viewMode.viewAsPreview);
m_mousePointDoc = FPoint(0,0);
Doc->regionsChanged()->connectObserver(this);
connect(this, SIGNAL(HaveSel()), Doc, SLOT(selectionChanged()));
-// Commented out to fix bug #7865
-// m_dragTimer = new QTimer(this);
-// connect(m_dragTimer, SIGNAL(timeout()), this, SLOT(dragTimerTimeOut()));
-// m_dragTimer->stop();
+ // Commented out to fix bug #7865
+ // m_dragTimer = new QTimer(this);
+ // connect(m_dragTimer, SIGNAL(timeout()), this, SLOT(dragTimerTimeOut()));
+ // m_dragTimer->stop();
m_dragTimerFired = false;
clockLabel = new ClockWidget(this, Doc);
clockLabel->setGeometry(m_vhRulerHW + 1, height() - m_vhRulerHW - 61, 60, 60);
@@ -310,7 +310,7 @@
// as from #4346: Add a preview for daltonian - PV
if (Doc->HasCMS && Doc->Gamut)
ScMessageBox::information(m_ScMW, tr("Preview Mode"),
- "<qt>" + tr("CMS is active. Therefore the color display may not match the perception by visually impaired") + "</qt>");
+ "<qt>" + tr("CMS is active. Therefore the color display may not match the perception by visually impaired") + "</qt>");
}
else
{
@@ -349,7 +349,7 @@
int newCanvasWidth = qRound((Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()) * scale);
int newCanvasHeight = qRound((Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()) * scale);
if (!re.isValid() && // don't check this all the time
- ( m_oldCanvasWidth != newCanvasWidth || m_oldCanvasHeight != newCanvasHeight))
+ ( m_oldCanvasWidth != newCanvasWidth || m_oldCanvasHeight != newCanvasHeight))
{
QSize maxViewport = maximumViewportSize();
horizontalScrollBar()->setRange(qRound(Doc->minCanvasCoordinate.x() * scale),
@@ -414,8 +414,8 @@
if (PrefsManager::instance()->appPrefs.uiPrefs.stickyTools)
{
m_canvas->setForcedRedraw(true);
-// Doc->m_Selection->clear();
-// emit HaveSel();
+ // Doc->m_Selection->clear();
+ // emit HaveSel();
m_canvas->resetRenderMode();
updateContents();
}
@@ -433,7 +433,7 @@
void ScribusView::requestMode(int appMode)
{
bool updateNecessary = false;
-// qDebug() << "request mode:" << appMode;
+ // qDebug() << "request mode:" << appMode;
switch(appMode) // filter submodes
{
case submodePaintingDone: // return to normal mode
@@ -667,11 +667,11 @@
dragH = gh;
DraggedGroup = true;
getDragRectScreen(&gx, &gy, &gw, &gh);
-// QPoint evP = viewport()->mapToGlobal(e->pos());
-// evP -= QPoint(contentsX(), contentsY());
-// redrawMarker->setGeometry(QRect(evP.x() + 1, evP.y() + 1, qRound(gw), qRound(gh)).normalized());
-// if (!redrawMarker->isVisible())
-// redrawMarker->show();
+ // QPoint evP = viewport()->mapToGlobal(e->pos());
+ // evP -= QPoint(contentsX(), contentsY());
+ // redrawMarker->setGeometry(QRect(evP.x() + 1, evP.y() + 1, qRound(gw), qRound(gh)).normalized());
+ // if (!redrawMarker->isVisible())
+ // redrawMarker->show();
emit ItemGeom();
}
}
@@ -686,23 +686,23 @@
text = e->mimeData()->text();
if (DraggedGroup)
{
-// double gx, gy, gw, gh;
+ // double gx, gy, gw, gh;
FPoint dragPosDoc = m_canvas->globalToCanvas(widget()->mapToGlobal(e->pos()));
dragX = dragPosDoc.x(); //e->pos().x() / m_canvas->scale();
dragY = dragPosDoc.y(); //e->pos().y() / m_canvas->scale();
-// getDragRectScreen(&gx, &gy, &gw, &gh);
-// QPoint evP = viewport()->mapToGlobal(e->pos());
-// evP -= QPoint(contentsX(), contentsY());
-// redrawMarker->setGeometry(QRect(evP.x() + 2, evP.y() + 2, qRound(gw - 2), qRound(gh - 2)).normalized());
-// if (!redrawMarker->isVisible())
-// redrawMarker->show();
+ // getDragRectScreen(&gx, &gy, &gw, &gh);
+ // QPoint evP = viewport()->mapToGlobal(e->pos());
+ // evP -= QPoint(contentsX(), contentsY());
+ // redrawMarker->setGeometry(QRect(evP.x() + 2, evP.y() + 2, qRound(gw - 2), qRound(gh - 2)).normalized());
+ // if (!redrawMarker->isVisible())
+ // redrawMarker->show();
emit MousePos(dragX, dragY); //+Doc->minCanvasCoordinate.x(), dragY+Doc->minCanvasCoordinate.y());
QPoint pos = m_canvas->canvasToLocal(dragPosDoc);
horizRuler->Draw(pos.x());
vertRuler->Draw(pos.y());
-// return;
- }
-/* QUrl ur(text);
+ // return;
+ }
+ /* QUrl ur(text);
QFileInfo fi = QFileInfo(ur.toLocalFile());
QString ext = fi.extension(false).toUpper();
QStrList imfo = QImageIO::inputFormats();
@@ -737,7 +737,7 @@
{
DraggedGroup = false;
m_canvas->resetRenderMode();
-// redrawMarker->hide();
+ // redrawMarker->hide();
updateContents();
}
}
@@ -926,7 +926,7 @@
}
}
-// qDebug() << "ScribusView::contentsDropEvent" << e->mimeData()->formats() << url;
+ // qDebug() << "ScribusView::contentsDropEvent" << e->mimeData()->formats() << url;
if (url.isEmpty())
{
e->ignore();
@@ -974,7 +974,7 @@
if ((text.startsWith("<SCRIBUSELEM")) || (text.startsWith("SCRIBUSFRAGMENT")))
vectorFile = true;
}
-// qDebug() << "drop - img:" << img << "file:" << fi.exists() << "suffix:" << fi.suffix() << "select by drag:" << selectedItemByDrag;
+ // qDebug() << "drop - img:" << img << "file:" << fi.exists() << "suffix:" << fi.suffix() << "select by drag:" << selectedItemByDrag;
//CB When we drag an image to a page from outside
//SeleItemPos is from 1.2.x. Needs reenabling for dragging *TO* a frame
if ((fi.exists()) && (img) && !selectedItemByDrag && !vectorFile)// && (!SeleItemPos(e->pos())))
@@ -1017,7 +1017,7 @@
return;
}
//if ((SeleItemPos(e->pos())) && (!text.startsWith("<SCRIBUSELEM")))
-// if (Doc->m_Selection->count()>0 && (m_canvas->frameHitTest(dropPosDocQ, Doc->m_Selection->itemAt(0)) >= Canvas::INSIDE) && !vectorFile) // && (img))
+ // if (Doc->m_Selection->count()>0 && (m_canvas->frameHitTest(dropPosDocQ, Doc->m_Selection->itemAt(0)) >= Canvas::INSIDE) && !vectorFile) // && (img))
if (selectedItemByDrag && (m_canvas->frameHitTest(dropPosDocQ, Doc->m_Selection->itemAt(0)) >= Canvas::INSIDE) && ((!vectorFile) || (img)))
{
PageItem *b = Doc->m_Selection->itemAt(0);
@@ -1026,57 +1026,58 @@
if ((fi.exists()) && (img))
Doc->loadPict(url.toLocalFile(), b);
}
- else if (b->itemType() == PageItem::TextFrame)
- {
- if ((fi.exists()) && (!img))
+ else
+ if (b->itemType() == PageItem::TextFrame)
{
- gtGetText* gt = new gtGetText(Doc);
- QStringList exts = gt->getSupportedTypes();
- if (exts.contains(fi.suffix().toLower()))
+ if ((fi.exists()) && (!img))
{
- ImportSetup impsetup;
- impsetup.runDialog = true;
- impsetup.encoding = "";
- impsetup.prefixNames = true;
- impsetup.textOnly = false;
- impsetup.importer = -1;
- impsetup.filename = url.toLocalFile();
- if (b->itemText.length() != 0)
+ gtGetText* gt = new gtGetText(Doc);
+ QStringList exts = gt->getSupportedTypes();
+ if (exts.contains(fi.suffix().toLower()))
{
- int t = ScMessageBox::warning(this, CommonStrings::trWarning, tr("Do you really want to clear all your text?"),
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::No, // GUI default
- QMessageBox::Yes); // batch default
- if (t == QMessageBox::No)
+ ImportSetup impsetup;
+ impsetup.runDialog = true;
+ impsetup.encoding = "";
+ impsetup.prefixNames = true;
+ impsetup.textOnly = false;
+ impsetup.importer = -1;
+ impsetup.filename = url.toLocalFile();
+ if (b->itemText.length() != 0)
{
- delete gt;
- return;
+ int t = ScMessageBox::warning(this, CommonStrings::trWarning, tr("Do you really want to clear all your text?"),
+ QMessageBox::Yes | QMessageBox::No,
+ QMessageBox::No, // GUI default
+ QMessageBox::Yes); // batch default
+ if (t == QMessageBox::No)
+ {
+ delete gt;
+ return;
+ }
+ }
+ gt->launchImporter(impsetup.importer, impsetup.filename, impsetup.textOnly, impsetup.encoding, false, impsetup.prefixNames, b);
+ m_ScMW->updateFromDrop();
+ }
+ else
+ {
+ QByteArray file;
+ QTextCodec *codec = QTextCodec::codecForLocale();
+ // TODO create a Dialog for selecting the codec
+ if (loadRawText(url.toLocalFile(), file))
+ {
+ QString txt = codec->toUnicode( file.data() );
+ txt.replace(QRegExp("\r"), QChar(13));
+ txt.replace(QRegExp("\n"), QChar(13));
+ txt.replace(QRegExp("\t"), QChar(9));
+ b->itemText.insertChars(txt, true);
}
}
- gt->launchImporter(impsetup.importer, impsetup.filename, impsetup.textOnly, impsetup.encoding, false, impsetup.prefixNames, b);
- m_ScMW->updateFromDrop();
+ if (Doc->docHyphenator->AutoCheck)
+ Doc->docHyphenator->slotHyphenate(b);
+ b->invalidateLayout();
+ b->update();
+ delete gt;
}
- else
- {
- QByteArray file;
- QTextCodec *codec = QTextCodec::codecForLocale();
- // TODO create a Dialog for selecting the codec
- if (loadRawText(url.toLocalFile(), file))
- {
- QString txt = codec->toUnicode( file.data() );
- txt.replace(QRegExp("\r"), QChar(13));
- txt.replace(QRegExp("\n"), QChar(13));
- txt.replace(QRegExp("\t"), QChar(9));
- b->itemText.insertChars(txt, true);
- }
- }
- if (Doc->docHyphenator->AutoCheck)
- Doc->docHyphenator->slotHyphenate(b);
- b->invalidateLayout();
- b->update();
- delete gt;
}
- }
emit DocChanged();
update();
}
@@ -1160,16 +1161,16 @@
PageItem *newItem = Doc->m_Selection->itemAt(0);
if ((newItem->width() > Doc->currentPage()->width()) || (newItem->height() > Doc->currentPage()->height()))
{
- // QMenu *pmen = new QMenu();
- // pmen->addAction( tr("Keep original Size"));
- // pmen->addAction( tr("Scale to Page Size"));
- // re = pmen->actions().indexOf(pmen->exec(QCursor::pos()));
- // delete pmen;
- // if (re == 1)
- // {
- Doc->rescaleGroup(newItem, qMin(qMin(Doc->currentPage()->width() / newItem->width(), Doc->currentPage()->height() / newItem->height()), 1.0));
- newItem->update();
- // }
+ // QMenu *pmen = new QMenu();
+ // pmen->addAction( tr("Keep original Size"));
+ // pmen->addAction( tr("Scale to Page Size"));
+ // re = pmen->actions().indexOf(pmen->exec(QCursor::pos()));
+ // delete pmen;
+ // if (re == 1)
+ // {
+ Doc->rescaleGroup(newItem, qMin(qMin(Doc->currentPage()->width() / newItem->width(), Doc->currentPage()->height() / newItem->height()), 1.0));
+ newItem->update();
+ // }
}
}
activeTransaction.commit();
@@ -1377,7 +1378,7 @@
void ScribusView::getDragRectScreen(double *x, double *y, double *w, double *h)
{
QPoint in(qRound(dragX*m_canvas->scale()), qRound(dragY*m_canvas->scale()));
-// in -= QPoint(qRound(Doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(Doc->minCanvasCoordinate.y() * m_canvas->scale()));
+ // in -= QPoint(qRound(Doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(Doc->minCanvasCoordinate.y() * m_canvas->scale()));
QPoint out = contentsToViewport(in);
*x = static_cast<double>(out.x());
*y = static_cast<double>(out.y());
@@ -1390,7 +1391,7 @@
double gx, gy, gh, gw;
Doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
QPoint in(qRound(gx*m_canvas->scale()), qRound(gy*m_canvas->scale()));
-// in -= QPoint(qRound(Doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(Doc->minCanvasCoordinate.y() * m_canvas->scale()));
+ // in -= QPoint(qRound(Doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(Doc->minCanvasCoordinate.y() * m_canvas->scale()));
QPoint out = contentsToViewport(in);
*x = static_cast<double>(out.x());
*y = static_cast<double>(out.y());
@@ -1486,65 +1487,65 @@
currItem->ContourLine.translate(-qRound((tp.x() + tp2.x()) / 2.0), -qRound((tp.y() + tp2.y()) / 2.0));
switch (mode)
{
- case 0:
- ma.rotate(-rot);
- break;
- case 1:
- ma.rotate(rot);
- break;
- case 2:
- ma.scale(1.0 - (scaling / 100.0), 1.0 - (scaling / 100.0));
- break;
- case 3:
- ma.scale(1.0 + (scaling / 100.0), 1.0 + (scaling / 100.0));
- break;
- case 4:
- ma.shear(0.017455, 0);
- break;
- case 5:
- ma.shear(-0.017455, 0);
- break;
- case 6:
- ma.shear(0, -0.017455);
- break;
- case 7:
- ma.shear(0, 0.017455);
- break;
- case 8:
- ma.scale(1.0 - (scaling / tpS.x()),1.0 - (scaling / tpS.y()));
- break;
- case 9:
- ma.scale(1.0 + (scaling / tpS.x()),1.0 + (scaling / tpS.y()));
- break;
- //10-13 are for scaling the contour line in shape edit mode
- case 10:
- {
- double s=1.0 - (scaling/(tp2.x() - tp.x()));
- ma.scale(s, 1);
- ma.translate(-scaling/s/2,0);
- }
- break;
- case 11:
- {
- double s=1.0 - (scaling/(tp2.x() - tp.x()));
- ma.scale(s, 1);
- ma.translate(scaling/s/2,0);
- }
- break;
- case 12:
- {
- double s=1.0 - (scaling/(tp2.y() - tp.y()));
- ma.scale(1, s);
- ma.translate(0,-scaling/s/2);
- }
- break;
- case 13:
- {
- double s=1.0 - (scaling/(tp2.y() - tp.y()));
- ma.scale(1, s);
- ma.translate(0,scaling/s/2);
- }
- break;
+ case 0:
+ ma.rotate(-rot);
+ break;
+ case 1:
+ ma.rotate(rot);
+ break;
+ case 2:
+ ma.scale(1.0 - (scaling / 100.0), 1.0 - (scaling / 100.0));
+ break;
+ case 3:
+ ma.scale(1.0 + (scaling / 100.0), 1.0 + (scaling / 100.0));
+ break;
+ case 4:
+ ma.shear(0.017455, 0);
+ break;
+ case 5:
+ ma.shear(-0.017455, 0);
+ break;
+ case 6:
+ ma.shear(0, -0.017455);
+ break;
+ case 7:
+ ma.shear(0, 0.017455);
+ break;
+ case 8:
+ ma.scale(1.0 - (scaling / tpS.x()),1.0 - (scaling / tpS.y()));
+ break;
+ case 9:
+ ma.scale(1.0 + (scaling / tpS.x()),1.0 + (scaling / tpS.y()));
+ break;
+ //10-13 are for scaling the contour line in shape edit mode
+ case 10:
+ {
+ double s=1.0 - (scaling/(tp2.x() - tp.x()));
+ ma.scale(s, 1);
+ ma.translate(-scaling/s/2,0);
+ }
+ break;
+ case 11:
+ {
+ double s=1.0 - (scaling/(tp2.x() - tp.x()));
+ ma.scale(s, 1);
+ ma.translate(scaling/s/2,0);
+ }
+ break;
+ case 12:
+ {
+ double s=1.0 - (scaling/(tp2.y() - tp.y()));
+ ma.scale(1, s);
+ ma.translate(0,-scaling/s/2);
+ }
+ break;
+ case 13:
+ {
+ double s=1.0 - (scaling/(tp2.y() - tp.y()));
+ ma.scale(1, s);
+ ma.translate(0,scaling/s/2);
+ }
+ break;
}
currItem->ContourLine.map(ma);
currItem->ContourLine.translate(qRound((tp.x() + tp2.x()) / 2.0), qRound((tp.y() + tp2.y()) / 2.0));
@@ -1575,36 +1576,36 @@
ma.translate(-offsX, -offsY);
switch (mode)
{
- case 0:
- ma.rotate(-rot);
- break;
- case 1:
- ma.rotate(rot);
- break;
- case 2:
- ma.scale(1.0 - (scaling / 100.0), 1.0 - (scaling / 100.0));
- break;
- case 3:
- ma.scale(1.0 + (scaling / 100.0), 1.0 + (scaling / 100.0));
- break;
- case 4:
- ma.shear(0.017455, 0);
- break;
- case 5:
- ma.shear(-0.017455, 0);
- break;
- case 6:
- ma.shear(0, -0.017455);
- break;
- case 7:
- ma.shear(0, 0.017455);
- break;
- case 8:
- ma.scale(1.0 - (scaling / oldWidth),1.0 - (scaling / oldHeight));
- break;
- case 9:
- ma.scale(1.0 + (scaling / oldWidth),1.0 + (scaling / oldHeight));
- break;
+ case 0:
+ ma.rotate(-rot);
+ break;
+ case 1:
+ ma.rotate(rot);
+ break;
+ case 2:
+ ma.scale(1.0 - (scaling / 100.0), 1.0 - (scaling / 100.0));
+ break;
+ case 3:
+ ma.scale(1.0 + (scaling / 100.0), 1.0 + (scaling / 100.0));
+ break;
+ case 4:
+ ma.shear(0.017455, 0);
+ break;
+ case 5:
+ ma.shear(-0.017455, 0);
+ break;
+ case 6:
+ ma.shear(0, -0.017455);
+ break;
+ case 7:
+ ma.shear(0, 0.017455);
+ break;
+ case 8:
+ ma.scale(1.0 - (scaling / oldWidth),1.0 - (scaling / oldHeight));
+ break;
+ case 9:
+ ma.scale(1.0 + (scaling / oldWidth),1.0 + (scaling / oldHeight));
+ break;
}
currItem->PoLine.map(ma);
currItem->PoLine.translate(offsX, offsY);
@@ -1616,36 +1617,36 @@
FPoint n(-offsX, -offsY);
switch (mode)
{
- case 0:
- ma2.rotate(-rot);
- break;
- case 1:
- ma2.rotate(rot);
- break;
- case 2:
- ma2.scale(1.0 - (scaling / 100.0), 1.0 - (scaling / 100.0));
- break;
- case 3:
- ma2.scale(1.0 + (scaling / 100.0), 1.0 + (scaling / 100.0));
- break;
- case 4:
- ma2.shear(0.017455, 0);
- break;
- case 5:
- ma2.shear(-0.017455, 0);
- break;
- case 6:
- ma2.shear(0, -0.017455);
- break;
- case 7:
- ma2.shear(0, 0.017455);
- break;
- case 8:
- ma2.scale(1.0 - (scaling / oldWidth),1.0 - (scaling / oldHeight));
- break;
- case 9:
- ma2.scale(1.0 + (scaling / oldWidth),1.0 + (scaling / oldHeight));
- break;
+ case 0:
+ ma2.rotate(-rot);
+ break;
+ case 1:
+ ma2.rotate(rot);
+ break;
+ case 2:
+ ma2.scale(1.0 - (scaling / 100.0), 1.0 - (scaling / 100.0));
+ break;
+ case 3:
+ ma2.scale(1.0 + (scaling / 100.0), 1.0 + (scaling / 100.0));
+ break;
+ case 4:
+ ma2.shear(0.017455, 0);
+ break;
+ case 5:
+ ma2.shear(-0.017455, 0);
+ break;
+ case 6:
+ ma2.shear(0, -0.017455);
+ break;
+ case 7:
+ ma2.shear(0, 0.017455);
+ break;
+ case 8:
+ ma2.scale(1.0 - (scaling / oldWidth),1.0 - (scaling / oldHeight));
+ break;
+ case 9:
+ ma2.scale(1.0 + (scaling / oldWidth),1.0 + (scaling / oldHeight));
+ break;
}
double x = ma2.m11() * n.x() + ma2.m21() * n.y() + ma2.dx();
double y = ma2.m22() * n.y() + ma2.m12() * n.x() + ma2.dy();
@@ -1759,14 +1760,14 @@
{
m_dragTimerFired = true;
// #0007865
-// qApp->changeOverrideCursor(QCursor(loadIcon("dragpix.png")));
+ // qApp->changeOverrideCursor(QCursor(loadIcon("dragpix.png")));
}
void ScribusView::HandleCurs(PageItem *currItem, QRect mpo)
{
QPoint tx, tx2;
QTransform ma;
-// ma.translate(-Doc->minCanvasCoordinate.x()*m_canvas->scale(), -Doc->minCanvasCoordinate.y()*m_canvas->scale());
+ // ma.translate(-Doc->minCanvasCoordinate.x()*m_canvas->scale(), -Doc->minCanvasCoordinate.y()*m_canvas->scale());
m_canvas->Transform(currItem, ma);
tx = ma.map(QPoint(static_cast<int>(currItem->width()), 0));
tx2 = ma.map(QPoint(0, static_cast<int>(currItem->height())));
@@ -1806,7 +1807,7 @@
{
double rr = fabs(currItem->rotation());
if (((rr >= 0.0) && (rr < 45.0)) || ((rr >= 135.0) && (rr < 225.0)) ||
- ((rr >= 315.0) && (rr <= 360.0)))
+ ((rr >= 315.0) && (rr <= 360.0)))
setCursor(QCursor(Qt::SizeFDiagCursor));
if (((rr >= 45.0) && (rr < 135.0)) || ((rr >= 225.0) && (rr < 315.0)))
setCursor(QCursor(Qt::SizeBDiagCursor));
@@ -1830,7 +1831,7 @@
Doc->m_Selection->addItem(currItem);
currItem->isSingleSel = true;
updateContents();
-// updateContents(currItem->getRedrawBounding(m_canvas->scale()));
+ // updateContents(currItem->getRedrawBounding(m_canvas->scale()));
}
else
{
@@ -1853,15 +1854,15 @@
Doc->m_Selection->getGroupRect(&x, &y, &w, &h);
getGroupRectScreen(&x, &y, &w, &h);
updateContents();
- // updateContents(QRect(static_cast<int>(x-5), static_cast<int>(y-5), static_cast<int>(w+10), static_cast<int>(h+10)));
+ // updateContents(QRect(static_cast<int>(x-5), static_cast<int>(y-5), static_cast<int>(w+10), static_cast<int>(h+10)));
//CB move in here as the emitAllToGUI will do it otherwise
emit ItemGeom();
emit HaveSel();
}
//CB done by addItem for single selection or the frame data is already there
//else
- //EmitValues(currItem);
- //currItem->emitAllToGUI();
+ //EmitValues(currItem);
+ //currItem->emitAllToGUI();
}
}
@@ -1900,7 +1901,7 @@
}
}
- // FIXME:av -> CanvasMode_legacy / Doc
+// FIXME:av -> CanvasMode_legacy / Doc
//CB Remove emit/start pasting objects
void ScribusView::PasteToPage()
{
@@ -1992,7 +1993,7 @@
void ScribusView::resizeEvent ( QResizeEvent * event )
{
-// qDebug() << "ScribusView::resizeEvent";
+ // qDebug() << "ScribusView::resizeEvent";
QScrollArea::resizeEvent(event);
horizRuler->setGeometry(m_vhRulerHW, 1, width()-m_vhRulerHW-1, m_vhRulerHW);
vertRuler->setGeometry(1, m_vhRulerHW, m_vhRulerHW, height()-m_vhRulerHW-1);
@@ -2136,13 +2137,13 @@
horizRuler->shift(x / m_canvas->scale());
vertRuler->shift(y / m_canvas->scale());
}
-// horizRuler->offs += qRound(Doc->minCanvasCoordinate.x() - 1 - Doc->rulerXoffset);
-// vertRuler->offs += qRound(Doc->minCanvasCoordinate.y() - 1 - Doc->rulerYoffset);
+ // horizRuler->offs += qRound(Doc->minCanvasCoordinate.x() - 1 - Doc->rulerXoffset);
+ // vertRuler->offs += qRound(Doc->minCanvasCoordinate.y() - 1 - Doc->rulerYoffset);
horizRuler->shiftRel(0*Doc->minCanvasCoordinate.x() - Doc->rulerXoffset);
vertRuler->shiftRel(0*Doc->minCanvasCoordinate.y() - Doc->rulerYoffset);
horizRuler->update();
vertRuler->update();
-// evSpon = true;
+ // evSpon = true;
QString newStatusBarText(" ");
if ((verticalScrollBar()->isSliderDown()) || (horizontalScrollBar()->isSliderDown()))
{
@@ -2156,7 +2157,7 @@
int ws = static_cast<int>(Doc->Pages->at(i)->width() * m_canvas->scale());
int hs = static_cast<int>(Doc->Pages->at(i)->height() * m_canvas->scale());
QRect drawRect = QRect(x, y, visibleWidth(), visibleHeight());
-// drawRect.moveBy(qRound(-Doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(-Doc->minCanvasCoordinate.y() * m_canvas->scale()));
+ // drawRect.moveBy(qRound(-Doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(-Doc->minCanvasCoordinate.y() * m_canvas->scale()));
if (drawRect.intersects(QRect(xs, ys, ws, hs)))
pag.append(i+1);
}
@@ -2176,7 +2177,7 @@
if (fe==nullptr)
return nullptr;
//Note this picks up the new page or master page depending on the mode.
-// reformPages(mov);
+ // reformPages(mov);
Doc->reformPages(mov);
m_ScMW->slotSetCurrentPage(nr);
m_canvas->m_viewMode.m_MouseButtonPressed = false;
@@ -2188,8 +2189,8 @@
Magnify = false;
Doc->nodeEdit.setEdPoints(true);
DraggedGroup = false;
-//FIXME:av MoveGY = false;
-//FIXME:av MoveGX = false;
+ //FIXME:av MoveGY = false;
+ //FIXME:av MoveGX = false;
Doc->nodeEdit.setIsContourLine(false);
return fe;
}
@@ -2232,9 +2233,9 @@
upperLeft.setY(qMax(0, upperLeft.y()-10));
lowerRight.setX(qMax(0, lowerRight.x()+10));
lowerRight.setY(qMax(0, lowerRight.y()+10));
-// qDebug() << "updateCanvas:" << upperLeft << lowerRight;
+ // qDebug() << "updateCanvas:" << upperLeft << lowerRight;
m_canvas->update(upperLeft.x(), upperLeft.y(), lowerRight.x()-upperLeft.x(), lowerRight.y()-upperLeft.y());
-/* double scale = m_canvas->scale();
+ /* double scale = m_canvas->scale();
double x = box.x() * scale;
double y = box.y() * scale;
double w = box.width() * scale;
@@ -2491,8 +2492,8 @@
void ScribusView::DrawNew()
{
-// qDebug("ScribusView::DrawNew");
-// printBacktrace(24);
+ // qDebug("ScribusView::DrawNew");
+ // printBacktrace(24);
if (m_ScMW->scriptIsRunning())
return;
m_canvas->setForcedRedraw(true);
@@ -2500,9 +2501,9 @@
updateContents();
setRulerPos(contentsX(), contentsY());
m_ScMW->slotSetCurrentPage(Doc->currentPage()->pageNr());
-// disconnect(m_ScMW->zoomSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setZoom()));
-// m_ScMW->zoomSpinBox->setValue(m_canvas->scale()/Prefs->displayPrefs.displayScale*100);
-// connect(m_ScMW->zoomSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setZoom()));
+ // disconnect(m_ScMW->zoomSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setZoom()));
+ // m_ScMW->zoomSpinBox->setValue(m_canvas->scale()/Prefs->displayPrefs.displayScale*100);
+ // connect(m_ScMW->zoomSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setZoom()));
}
void ScribusView::SetCCPo(double x, double y)
@@ -2511,7 +2512,7 @@
return;
QPoint nx = m_canvas->canvasToLocal(FPoint(x, y));
QSize viewsize = viewport()->size();
-// qDebug() << "setCCPo" << nx << viewsize;
+ // qDebug() << "setCCPo" << nx << viewsize;
setContentsPos(nx.x() - viewsize.width() / 2, nx.y() - viewsize.height() / 2);
}
@@ -3074,44 +3075,123 @@
// anyone who wants to fix and knows how to test it.
class TextToPathPainter: public TextLayoutPainter
{
- ScribusView* m_view;
- PageItem* m_item;
- QList<PageItem*> &m_group;
- int m_counter;
-
-public:
- TextToPathPainter(ScribusView* view, PageItem* item, QList<PageItem*> &group)
- : m_view(view)
- , m_item(item)
- , m_group(group)
- , m_counter(0)
- {}
-
- void drawGlyph(const GlyphCluster& gc)
- {
- for (const GlyphLayout& gl : gc.glyphs())
- {
- FPointArray outline = font().glyphOutline(gl.glyph);
- if (outline.size() < 4)
- return;
- QTransform transform;
- if (m_item->isPathText())
- transform = matrix();
- if (m_item->imageFlippedH())
+ ScribusView* m_view;
+ PageItem* m_item;
+ QList<PageItem*> &m_group;
+ int m_counter;
+
+ public:
+ TextToPathPainter(ScribusView* view, PageItem* item, QList<PageItem*> &group)
+ : m_view(view)
+ , m_item(item)
+ , m_group(group)
+ , m_counter(0)
+ {}
+
+ void drawGlyph(const GlyphCluster& gc)
+ {
+ for (const GlyphLayout& gl : gc.glyphs())
{
- transform.translate(m_item->width(), 0);
- transform.scale(-1, 1);
+ FPointArray outline = font().glyphOutline(gl.glyph);
+ if (outline.size() < 4)
+ return;
+ QTransform transform;
+ if (m_item->isPathText())
+ transform = matrix();
+ if (m_item->imageFlippedH())
+ {
+ transform.translate(m_item->width(), 0);
+ transform.scale(-1, 1);
+ }
+ if (m_item->imageFlippedV())
+ {
+ transform.translate(0, m_item->height());
+ transform.scale(1, -1);
+ }
+ transform.translate(x(), y());
+ transform.translate(0, -(fontSize() * gl.scaleV));
+ transform.scale(gl.scaleH * fontSize() / 10.0, gl.scaleV * fontSize() / 10.0);
+ outline.map(transform);
+ int z = m_view->Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, m_item->xPos(), m_item->yPos(), m_item->width(), m_item->height(), 0, fillColor().color, CommonStrings::None);
+ PageItem* item = m_view->Doc->Items->at(z);
+ m_view->undoManager->setUndoEnabled(false);
+ item->setTextFlowMode(m_item->textFlowMode());
+ item->setSizeLocked(m_item->sizeLocked());
+ item->setLocked(m_item->locked());
+ item->NamedLStyle = m_item->NamedLStyle;
+ item->setItemName(m_item->itemName() + "+U" + QString::number(m_counter++));
+ item->PoLine = outline.copy();
+ if (!m_item->asPathText())
+ item->setRotation(m_item->rotation());
+ item->setFillColor(fillColor().color);
+ item->setFillShade(fillColor().shade);
+ m_view->Doc->adjustItemSize(item);
+ item->ContourLine = item->PoLine.copy();
+ item->ClipEdited = true;
+ item->FrameType = 3;
+ item->OldB2 = item->width();
+ item->OldH2 = item->height();
+ m_view->Doc->setRedrawBounding(item);
+ m_view->undoManager->setUndoEnabled(true);
+ m_group.append(m_view->Doc->Items->takeAt(z));
}
- if (m_item->imageFlippedV())
+ }
+ void drawGlyphOutline(const GlyphCluster& gc, bool fill)
+ {
+ for (const GlyphLayout& gl : gc.glyphs())
{
- transform.translate(0, m_item->height());
- transform.scale(1, -1);
+ FPointArray outline = font().glyphOutline(gl.glyph);
+ if (outline.size() < 4)
+ return;
+ QTransform transform;
+ if (m_item->isPathText())
+ transform = matrix();
+ if (m_item->imageFlippedH())
+ {
+ transform.translate(m_item->width(), 0);
+ transform.scale(-1, 1);
+ }
+ if (m_item->imageFlippedV())
+ {
+ transform.translate(0, m_item->height());
+ transform.scale(1, -1);
+ }
+ transform.translate(x(), y());
+ transform.translate(0, -(fontSize() * gl.scaleV));
+ transform.scale(gl.scaleH * fontSize() / 10.0, gl.scaleV * fontSize() / 10.0);
+ outline.map(transform);
+ int z = m_view->Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, m_item->xPos(), m_item->yPos(), m_item->width(), m_item->height(), strokeWidth(), fillColor().color, strokeColor().color);
+ PageItem* item = m_view->Doc->Items->at(z);
+ m_view->undoManager->setUndoEnabled(false);
+ item->setTextFlowMode(m_item->textFlowMode());
+ item->setSizeLocked(m_item->sizeLocked());
+ item->setLocked(m_item->locked());
+ item->NamedLStyle = m_item->NamedLStyle;
+ item->setItemName(m_item->itemName() + "+U" + QString::number(m_counter++));
+ item->PoLine = outline.copy();
+ if (!m_item->asPathText())
+ item->setRotation(m_item->rotation());
+ item->setFillColor(fillColor().color);
+ item->setFillShade(fillColor().shade);
+ item->setLineColor(strokeColor().color);
+ item->setLineShade(strokeColor().shade);
+ item->setLineWidth(strokeWidth());
+ m_view->Doc->adjustItemSize(item);
+ item->ContourLine = item->PoLine.copy();
+ item->ClipEdited = true;
+ item->FrameType = 3;
+ item->OldB2 = item->width();
+ item->OldH2 = item->height();
+ m_view->Doc->setRedrawBounding(item);
+ m_view->undoManager->setUndoEnabled(true);
+ m_group.append(m_view->Doc->Items->takeAt(z));
}
+ }
+ void drawLine(QPointF start, QPointF end)
+ {
+ QTransform transform = matrix();
transform.translate(x(), y());
- transform.translate(0, -(fontSize() * gl.scaleV));
- transform.scale(gl.scaleH * fontSize() / 10.0, gl.scaleV * fontSize() / 10.0);
- outline.map(transform);
- int z = m_view->Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, m_item->xPos(), m_item->yPos(), m_item->width(), m_item->height(), 0, fillColor().color, CommonStrings::None);
+ int z = m_view->Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, m_item->xPos(), m_item->yPos(), m_item->width(), m_item->height(), m_item->lineWidth(), m_item->lineColor(), m_item->fillColor());
PageItem* item = m_view->Doc->Items->at(z);
m_view->undoManager->setUndoEnabled(false);
item->setTextFlowMode(m_item->textFlowMode());
@@ -3119,61 +3199,11 @@
item->setLocked(m_item->locked());
item->NamedLStyle = m_item->NamedLStyle;
item->setItemName(m_item->itemName() + "+U" + QString::number(m_counter++));
- item->PoLine = outline.copy();
- if (!m_item->asPathText())
- item->setRotation(m_item->rotation());
- item->setFillColor(fillColor().color);
- item->setFillShade(fillColor().shade);
- m_view->Doc->adjustItemSize(item);
- item->ContourLine = item->PoLine.copy();
- item->ClipEdited = true;
- item->FrameType = 3;
- item->OldB2 = item->width();
- item->OldH2 = item->height();
- m_view->Doc->setRedrawBounding(item);
- m_view->undoManager->setUndoEnabled(true);
- m_group.append(m_view->Doc->Items->takeAt(z));
- }
- }
- void drawGlyphOutline(const GlyphCluster& gc, bool fill)
- {
- for (const GlyphLayout& gl : gc.glyphs())
- {
- FPointArray outline = font().glyphOutline(gl.glyph);
- if (outline.size() < 4)
- return;
- QTransform transform;
- if (m_item->isPathText())
- transform = matrix();
- if (m_item->imageFlippedH())
- {
- transform.translate(m_item->width(), 0);
- transform.scale(-1, 1);
- }
- if (m_item->imageFlippedV())
- {
- transform.translate(0, m_item->height());
- transform.scale(1, -1);
- }
- transform.translate(x(), y());
- transform.translate(0, -(fontSize() * gl.scaleV));
- transform.scale(gl.scaleH * fontSize() / 10.0, gl.scaleV * fontSize() / 10.0);
- outline.map(transform);
- int z = m_view->Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, m_item->xPos(), m_item->yPos(), m_item->width(), m_item->height(), strokeWidth(), fillColor().color, strokeColor().color);
- PageItem* item = m_view->Doc->Items->at(z);
- m_view->undoManager->setUndoEnabled(false);
- item->setTextFlowMode(m_item->textFlowMode());
- item->setSizeLocked(m_item->sizeLocked());
- item->setLocked(m_item->locked());
- item->NamedLStyle = m_item->NamedLStyle;
- item->setItemName(m_item->itemName() + "+U" + QString::number(m_counter++));
- item->PoLine = outline.copy();
- if (!m_item->asPathText())
- item->setRotation(m_item->rotation());
- item->setFillColor(fillColor().color);
- item->setFillShade(fillColor().shade);
- item->setLineColor(strokeColor().color);
- item->setLineShade(strokeColor().shade);
+ item->PoLine.resize(0);
+ item->PoLine.addQuadPoint(FPoint(start), FPoint(start), FPoint(end), FPoint(end));
+ item->PoLine.map(transform);
+ item->setLineColor(fillColor().color);
+ item->setLineShade(fillColor().shade);
item->setLineWidth(strokeWidth());
m_view->Doc->adjustItemSize(item);
item->ContourLine = item->PoLine.copy();
@@ -3185,37 +3215,8 @@
m_view->undoManager->setUndoEnabled(true);
m_group.append(m_view->Doc->Items->takeAt(z));
}
- }
- void drawLine(QPointF start, QPointF end)
- {
- QTransform transform = matrix();
- transform.translate(x(), y());
- int z = m_view->Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, m_item->xPos(), m_item->yPos(), m_item->width(), m_item->height(), m_item->lineWidth(), m_item->lineColor(), m_item->fillColor());
- PageItem* item = m_view->Doc->Items->at(z);
- m_view->undoManager->setUndoEnabled(false);
- item->setTextFlowMode(m_item->textFlowMode());
- item->setSizeLocked(m_item->sizeLocked());
- item->setLocked(m_item->locked());
- item->NamedLStyle = m_item->NamedLStyle;
- item->setItemName(m_item->itemName() + "+U" + QString::number(m_counter++));
- item->PoLine.resize(0);
- item->PoLine.addQuadPoint(FPoint(start), FPoint(start), FPoint(end), FPoint(end));
- item->PoLine.map(transform);
- item->setLineColor(fillColor().color);
- item->setLineShade(fillColor().shade);
- item->setLineWidth(strokeWidth());
- m_view->Doc->adjustItemSize(item);
- item->ContourLine = item->PoLine.copy();
- item->ClipEdited = true;
- item->FrameType = 3;
- item->OldB2 = item->width();
- item->OldH2 = item->height();
- m_view->Doc->setRedrawBounding(item);
- m_view->undoManager->setUndoEnabled(true);
- m_group.append(m_view->Doc->Items->takeAt(z));
- }
- void drawRect(QRectF rect) {}
- void drawObject(PageItem* item) {}
+ void drawRect(QRectF rect) {}
+ void drawObject(PageItem* item) {}
};
void ScribusView::TextToPath()
@@ -3388,7 +3389,7 @@
QVariant ScribusView::inputMethodQuery ( Qt::InputMethodQuery query ) const
{
-// qDebug() << "IMQ" << query;
+ // qDebug() << "IMQ" << query;
return QVariant();
}
@@ -3496,8 +3497,8 @@
bool ScribusView::eventFilter(QObject *obj, QEvent *event)
{
-// if (obj == horizRuler || obj == vertRuler || obj == rulerMover)
-// return true; // FIXME:av
+ // if (obj == horizRuler || obj == vertRuler || obj == rulerMover)
+ // return true; // FIXME:av
if (obj == widget() && event->type() == QEvent::MouseMove)
{
@@ -3510,7 +3511,7 @@
m_canvasMode->mouseMoveEvent(m);
return true;
}
- else if (obj == widget() && event->type() == QEvent::MouseButtonRelease)
+ if (obj == widget() && event->type() == QEvent::MouseButtonRelease)
{
QMouseEvent* m = static_cast<QMouseEvent*> (event);
m_canvasMode->mouseReleaseEvent(m);
@@ -3544,7 +3545,7 @@
}
return true;
}
- else if (obj == widget() && event->type() == QEvent::MouseButtonPress)
+ if (obj == widget() && event->type() == QEvent::MouseButtonPress)
{
QMouseEvent* m = static_cast<QMouseEvent*> (event);
bool linkmode = (Doc->appMode == modeLinkFrames);
@@ -3571,13 +3572,13 @@
m_canvas->m_viewMode.m_MouseButtonPressed = true;
return true;
}
- else if (obj == widget() && event->type() == QEvent::MouseButtonDblClick)
+ if (obj == widget() && event->type() == QEvent::MouseButtonDblClick)
{
QMouseEvent* m = static_cast<QMouseEvent*> (event);
m_canvasMode->mouseDoubleClickEvent(m);
return true;
}
- else if (event->type() == QEvent::KeyPress)
+ if (event->type() == QEvent::KeyPress)
{
QKeyEvent* m = static_cast<QKeyEvent*> (event);
if (m_canvasMode->handleKeyEvents())
@@ -3586,7 +3587,7 @@
m_ScMW->keyPressEvent(m);
return true;
}
- else if (event->type() == QEvent::KeyRelease)
+ if (event->type() == QEvent::KeyRelease)
{
QKeyEvent* m = static_cast<QKeyEvent*> (event);
if (m_canvasMode->handleKeyEvents())
@@ -3595,25 +3596,25 @@
m_ScMW->keyReleaseEvent(m);
return true;
}
- else if (obj == widget() && event->type() == QEvent::DragEnter)
+ if (obj == widget() && event->type() == QEvent::DragEnter)
{
QDragEnterEvent* d = static_cast<QDragEnterEvent*> (event);
contentsDragEnterEvent(d);
return true;
}
- else if (obj == widget() && event->type() == QEvent::DragLeave)
+ if (obj == widget() && event->type() == QEvent::DragLeave)
{
QDragLeaveEvent* d = static_cast<QDragLeaveEvent*> (event);
contentsDragLeaveEvent(d);
return true;
}
- else if (obj == widget() && event->type() == QEvent::DragMove)
+ if (obj == widget() && event->type() == QEvent::DragMove)
{
QDragMoveEvent* d = static_cast<QDragMoveEvent*> (event);
contentsDragMoveEvent(d);
return true;
}
- else if (obj == widget() && event->type() == QEvent::Drop)
+ if (obj == widget() && event->type() == QEvent::Drop)
{
QDropEvent* d = static_cast<QDropEvent*> (event);
contentsDropEvent(d);
@@ -3652,7 +3653,7 @@
void ScribusView::resizeContents(int w, int h) // deprecated
{
-// qDebug() << "ScribusView::resizeContents(" << w << "," << h << ")";
+ // qDebug() << "ScribusView::resizeContents(" << w << "," << h << ")";
int originX = qRound(Doc->minCanvasCoordinate.x() * scale());
int originY = qRound(Doc->minCanvasCoordinate.y() * scale());
widget()->resize(w - 0*originX, h - 0*originY);
Modified: trunk/Scribus/scribus/styles/tablestyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/styles/tablestyle.cpp
==============================================================================
--- trunk/Scribus/scribus/styles/tablestyle.cpp (original)
+++ trunk/Scribus/scribus/styles/tablestyle.cpp Mon Aug 20 19:01:43 2018
@@ -19,8 +19,7 @@
return CommonStrings::trDefaultTableStyle;
if (hasName() || !hasParent() || !m_context)
return name();
- else
- return parentStyle()->displayName() + "+";
+ return parentStyle()->displayName() + "+";
}
bool TableStyle::equiv(const BaseStyle& other) const
Modified: trunk/Scribus/scribus/text/storytext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/text/storytext.cpp
==============================================================================
--- trunk/Scribus/scribus/text/storytext.cpp (original)
+++ trunk/Scribus/scribus/text/storytext.cpp Mon Aug 20 19:01:43 2018
@@ -935,12 +935,11 @@
{
if (text(pos) == SpecialChars::PAGENUMBER)
return ExpansionPoint(ExpansionPoint::PageNumber);
- else if( text(pos) == SpecialChars::PAGECOUNT)
+ if( text(pos) == SpecialChars::PAGECOUNT)
return ExpansionPoint(ExpansionPoint::PageCount);
- else if (hasMark(pos))
+ if (hasMark(pos))
return ExpansionPoint(mark(pos));
- else
- return ExpansionPoint(ExpansionPoint::Invalid);
+ return ExpansionPoint(ExpansionPoint::Invalid);
}
@@ -1155,7 +1154,7 @@
// qDebug() << "storytext::charstyle: default";
return defaultStyle().charStyle();
}
- else if (pos == length())
+ if (pos == length())
{
qDebug() << "storytext::charstyle: access at end of text %i" << pos;
--pos;
@@ -1200,7 +1199,7 @@
if (pos >= length())
return that->d->trailingStyle;
- else if ( !that->d->at(pos)->parstyle )
+ if ( !that->d->at(pos)->parstyle )
{
ScText* current = that->d->at(pos);
qDebug("inserting default parstyle at %i", pos);
@@ -1835,7 +1834,7 @@
m_selLast = newPos - 1;
return;
}
- else if (m_selFirst == oldPos)
+ if (m_selFirst == oldPos)
{
m_selFirst = newPos;
return;
Modified: trunk/Scribus/scribus/ui/about.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/about.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/about.cpp (original)
+++ trunk/Scribus/scribus/ui/about.cpp Mon Aug 20 19:01:43 2018
@@ -169,7 +169,7 @@
gsver = tr("Using Ghostscript version %1").arg(gsver);
else
gsver = tr("No Ghostscript version available");
- buildID->setText( tr("<p align=\"center\"><b>%1 %2</b></p><p align=\"center\">%3<br>%4 %5<br>%6</p>").arg( tr("Scribus Version")).arg(version).arg(built).arg( tr("Build ID:")).arg(bu).arg(gsver));
+ buildID->setText( tr("<p align=\"center\"><b>%1 %2</b></p><p align=\"center\">%3<br>%4 %5<br>%6</p>").arg( tr("Scribus Version"), version, built, tr("Build ID:"), bu, gsver));
tabLayout1->addWidget( buildID, 0, Qt::AlignHCenter );
tabWidget2->addTab( tab, tr( "&About" ) );
Modified: trunk/Scribus/scribus/ui/colorsandfills.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/colorsandfills.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorsandfills.cpp (original)
+++ trunk/Scribus/scribus/ui/colorsandfills.cpp Mon Aug 20 19:01:43 2018
@@ -1072,7 +1072,7 @@
QString aiepsext(FormatsManager::instance()->extensionListForFormat(FormatsManager::EPS|FormatsManager::PS|FormatsManager::AI, 0));
QString ooexts(" *.acb *.aco *.ase *.cxf *.gpl *.sbz *.skp *.soc *.xml");
ooexts += extra;
- QString filter = tr("All Supported Formats (%1);;Documents (%2);;Other Files (%3);;All Files (*)").arg(docexts+" "+aiepsext+ooexts).arg(docexts).arg(aiepsext+ooexts);
+ QString filter = tr("All Supported Formats (%1);;Documents (%2);;Other Files (%3);;All Files (*)").arg(docexts+" "+aiepsext+ooexts, docexts, aiepsext+ooexts);
CustomFDialog dia(this, wdir, tr("Import Colors"), filter, fdHidePreviewCheckBox | fdDisableOk);
if (dia.exec() == QDialog::Accepted)
fileName = dia.selectedFile();
Modified: trunk/Scribus/scribus/ui/cpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/cpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/cpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/cpalette.cpp Mon Aug 20 19:01:43 2018
@@ -129,7 +129,7 @@
void Cpalette::connectSignals()
{
- connect(CGradDia, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)));
+ connect(CGradDia, SIGNAL(NewSpecial(double,double,double,double,double,double,double,double,double,double)), this, SIGNAL(NewSpecial(double,double,double,double,double,double,double,double,double,double)));
connect(CGradDia, SIGNAL(paletteShown(bool)), this, SLOT(setActiveGradDia(bool)));
connect(CGradDia, SIGNAL(editGradient(int)), this, SIGNAL(editGradient(int)));
connect(CGradDia, SIGNAL(createNewMesh()), this, SLOT(createNewMeshGradient()));
@@ -189,7 +189,7 @@
void Cpalette::disconnectSignals()
{
- disconnect(CGradDia, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)));
+ disconnect(CGradDia, SIGNAL(NewSpecial(double,double,double,double,double,double,double,double,double,double)), this, SIGNAL(NewSpecial(double,double,double,double,double,double,double,double,double,double)));
disconnect(CGradDia, SIGNAL(paletteShown(bool)), this, SLOT(setActiveGradDia(bool)));
disconnect(CGradDia, SIGNAL(editGradient(int)), this, SIGNAL(editGradient(int)));
disconnect(CGradDia, SIGNAL(createNewMesh()), this, SLOT(createNewMeshGradient()));
@@ -357,11 +357,11 @@
this->disconnect(SIGNAL(NewGradient(int)));
this->disconnect(SIGNAL(NewGradientS(int)));
this->disconnect(SIGNAL(NewPattern(QString)));
- this->disconnect(SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)));
+ this->disconnect(SIGNAL(NewPatternProps(double,double,double,double,double,double,double,bool,bool)));
this->disconnect(SIGNAL(NewOverprint(int)));
this->disconnect(SIGNAL(NewPatternS(QString)));
this->disconnect(SIGNAL(NewPatternTypeS(bool)));
- this->disconnect(SIGNAL(NewPatternPropsS(double, double, double, double, double, double, double, double, bool, bool)));
+ this->disconnect(SIGNAL(NewPatternPropsS(double,double,double,double,double,double,double,double,bool,bool)));
disconnect(displayAllColors, SIGNAL(clicked()), this, SLOT(toggleColorDisplay()));
if (currentDoc)
@@ -397,11 +397,11 @@
connect(this, SIGNAL(NewGradient(int)) , doc, SLOT(itemSelection_SetItemGradFill(int)));
connect(this, SIGNAL(NewGradientS(int)) , doc, SLOT(itemSelection_SetItemGradStroke(int)));
connect(this, SIGNAL(NewPattern(QString)) , doc, SLOT(itemSelection_SetItemPatternFill(QString)));
- connect(this, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), doc, SLOT(itemSelection_SetItemPatternProps(double, double, double, double, double, double, double, bool, bool)));
+ connect(this, SIGNAL(NewPatternProps(double,double,double,double,double,double,double,bool,bool)), doc, SLOT(itemSelection_SetItemPatternProps(double,double,double,double,double,double,double,bool,bool)));
connect(this, SIGNAL(NewOverprint(int)) , this, SLOT(handleOverprint(int)));
connect(this, SIGNAL(NewPatternS(QString)) , doc, SLOT(itemSelection_SetItemStrokePattern(QString)));
connect(this, SIGNAL(NewPatternTypeS(bool)), doc, SLOT(itemSelection_SetItemStrokePatternType(bool)));
- connect(this, SIGNAL(NewPatternPropsS(double, double, double, double, double, double, double, double, bool, bool)), doc, SLOT(itemSelection_SetItemStrokePatternProps(double, double, double, double, double, double, double, double, bool, bool)));
+ connect(this, SIGNAL(NewPatternPropsS(double,double,double,double,double,double,double,double,bool,bool)), doc, SLOT(itemSelection_SetItemStrokePatternProps(double,double,double,double,double,double,double,double,bool,bool)));
connect(displayAllColors, SIGNAL(clicked()), this, SLOT(toggleColorDisplay()));
connect(currentDoc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
@@ -1782,7 +1782,7 @@
dia->spinYSkew->setValue(asinb / (M_PI / 180.0));
dia->FlipH->setChecked(m_Pattern_mirrorX);
dia->FlipV->setChecked(m_Pattern_mirrorY);
- connect(dia, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), this, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)));
+ connect(dia, SIGNAL(NewPatternProps(double,double,double,double,double,double,double,bool,bool)), this, SIGNAL(NewPatternProps(double,double,double,double,double,double,double,bool,bool)));
dia->exec();
m_Pattern_scaleX = dia->spinXscaling->value();
m_Pattern_scaleY = dia->spinYscaling->value();
@@ -1838,7 +1838,7 @@
dia->spinYSkew->setValue(asinb / (M_PI / 180.0));
dia->FlipH->setChecked(m_Pattern_mirrorXS);
dia->FlipV->setChecked(m_Pattern_mirrorYS);
- connect(dia, SIGNAL(NewPatternPropsS(double, double, double, double, double, double, double, double, bool, bool)), this, SIGNAL(NewPatternPropsS(double, double, double, double, double, double, double, double, bool, bool)));
+ connect(dia, SIGNAL(NewPatternPropsS(double,double,double,double,double,double,double,double,bool,bool)), this, SIGNAL(NewPatternPropsS(double,double,double,double,double,double,double,double,bool,bool)));
dia->exec();
m_Pattern_scaleXS = dia->spinXscaling->value();
m_Pattern_scaleYS = dia->spinYscaling->value();
Modified: trunk/Scribus/scribus/ui/customfdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/customfdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/customfdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/customfdialog.cpp Mon Aug 20 19:01:43 2018
@@ -89,29 +89,24 @@
return QFileIconProvider::icon(fi);
if (fmts.contains(ext, Qt::CaseInsensitive))
return imagepm;
- else
- {
- ext = fi.completeSuffix().toLower();
- if (ext.endsWith("ps", Qt::CaseInsensitive))
- return pspm;
- else if (ext.endsWith("txt", Qt::CaseInsensitive))
- return txtpm;
- else if (ext.endsWith("scd", Qt::CaseInsensitive) || ext.endsWith("scd.gz", Qt::CaseInsensitive))
- return docpm;
- else if (ext.endsWith("sla", Qt::CaseInsensitive) || ext.endsWith("sla.gz", Qt::CaseInsensitive))
- return docpm;
- else if (ext.endsWith("pdf", Qt::CaseInsensitive))
- return pdfpm;
- else if (ext.endsWith("sxd", Qt::CaseInsensitive))
- return oosxdpm;
- else if (ext.endsWith("sxw", Qt::CaseInsensitive))
- return oosxwpm;
- else if (allFormatsV.contains(ext) || ext.endsWith("sce", Qt::CaseInsensitive) || ext.endsWith("shape", Qt::CaseInsensitive))
- return vectorpm;
- else
- return QFileIconProvider::icon(fi);
- }
- return QIcon();
+ ext = fi.completeSuffix().toLower();
+ if (ext.endsWith("ps", Qt::CaseInsensitive))
+ return pspm;
+ if (ext.endsWith("txt", Qt::CaseInsensitive))
+ return txtpm;
+ if (ext.endsWith("scd", Qt::CaseInsensitive) || ext.endsWith("scd.gz", Qt::CaseInsensitive))
+ return docpm;
+ if (ext.endsWith("sla", Qt::CaseInsensitive) || ext.endsWith("sla.gz", Qt::CaseInsensitive))
+ return docpm;
+ if (ext.endsWith("pdf", Qt::CaseInsensitive))
+ return pdfpm;
+ if (ext.endsWith("sxd", Qt::CaseInsensitive))
+ return oosxdpm;
+ if (ext.endsWith("sxw", Qt::CaseInsensitive))
+ return oosxwpm;
+ if (allFormatsV.contains(ext) || ext.endsWith("sce", Qt::CaseInsensitive) || ext.endsWith("shape", Qt::CaseInsensitive))
+ return vectorpm;
+ return QFileIconProvider::icon(fi);
}
FDialogPreview::FDialogPreview(QWidget *pa) : QLabel(pa)
Modified: trunk/Scribus/scribus/ui/effectsdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/effectsdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/effectsdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/effectsdialog.cpp Mon Aug 20 19:01:43 2018
@@ -843,13 +843,11 @@
void EffectsDialog::selectAvailEffectDbl(QListWidgetItem* c)
{
- if (c)
- {
- if (!(c->flags() & Qt::ItemIsSelectable))
- return;
- else
- moveToEffects();
- }
+ if (!c)
+ return;
+ if (!(c->flags() & Qt::ItemIsSelectable))
+ return;
+ moveToEffects();
}
void EffectsDialog::moveToEffects()
Modified: trunk/Scribus/scribus/ui/filedialogeventcatcher.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/filedialogeventcatcher.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/filedialogeventcatcher.cpp (original)
+++ trunk/Scribus/scribus/ui/filedialogeventcatcher.cpp Mon Aug 20 19:01:43 2018
@@ -58,33 +58,33 @@
}
}
else
- if (e->type() == QEvent::DragEnter)
- {
- e->accept();
- return true;
- }
- else
- if (e->type() == QEvent::Drop)
- {
- QDropEvent *dropEvent = static_cast<QDropEvent *>(e);
- if (dropEvent)
+ if (e->type() == QEvent::DragEnter)
{
- if ( dropEvent->mimeData()->hasFormat("text/uri-list"))
+ e->accept();
+ return true;
+ }
+ else
+ if (e->type() == QEvent::Drop)
{
- QString fileUrl;
- QList<QUrl> fileUrls = dropEvent->mimeData()->urls();
- if (fileUrls.count()>0)
+ QDropEvent *dropEvent = static_cast<QDropEvent *>(e);
+ if (dropEvent)
{
- fileUrl = fileUrls[0].toLocalFile();
- if (fileUrls[0].isLocalFile())
+ if ( dropEvent->mimeData()->hasFormat("text/uri-list"))
{
- emit dropLocation(fileUrl);
+ QString fileUrl;
+ QList<QUrl> fileUrls = dropEvent->mimeData()->urls();
+ if (fileUrls.count()>0)
+ {
+ fileUrl = fileUrls[0].toLocalFile();
+ if (fileUrls[0].isLocalFile())
+ {
+ emit dropLocation(fileUrl);
+ }
+ }
}
}
+ e->accept();
+ return true;
}
- }
- e->accept();
- return true;
- }
return QObject::eventFilter(o, e);
}
Modified: trunk/Scribus/scribus/ui/fontcombo.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/fontcombo.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/fontcombo.cpp (original)
+++ trunk/Scribus/scribus/ui/fontcombo.cpp Mon Aug 20 19:01:43 2018
@@ -181,10 +181,12 @@
fontStyle->addItems(slist);
if (slist.contains(curr))
setCurrentComboItem(fontStyle, curr);
- else if (slist.contains("Regular"))
- setCurrentComboItem(fontStyle, "Regular");
- else if (slist.contains("Roman"))
- setCurrentComboItem(fontStyle, "Roman");
+ else
+ if (slist.contains("Regular"))
+ setCurrentComboItem(fontStyle, "Regular");
+ else
+ if (slist.contains("Roman"))
+ setCurrentComboItem(fontStyle, "Roman");
emit fontSelected(fontFamily->itemText(id) + " " + fontStyle->currentText());
connect(fontStyle, SIGNAL(activated(int)), this, SLOT(styleSelected(int)));
}
@@ -298,7 +300,8 @@
// Replacement fonts were systematically discarded in previous code
/*if (fon.isReplacement())
fontFamily->addItem(substFont, it2a.value());
- else */if (type == ScFace::OTF)
+ else */
+ if (type == ScFace::OTF)
fontFamily->addItem(otfFont, it2a.key());
else if (type == ScFace::TYPE1)
fontFamily->addItem(psFont, it2a.key());
@@ -481,13 +484,10 @@
QFontDatabase::addApplicationFont(fon.fontFilePath());
return fon;
}
- else
- {
- const ScFace& scFace = availableFonts.findFont(text);
- if (!fontDb.families().contains(scFace.family()))
- QFontDatabase::addApplicationFont(scFace.fontFilePath());
- return scFace;
- }
+ const ScFace& scFace = availableFonts.findFont(text);
+ if (!fontDb.families().contains(scFace.family()))
+ QFontDatabase::addApplicationFont(scFace.fontFilePath());
+ return scFace;
}
FontFamilyDelegate::FontFamilyDelegate(QObject *parent)
Modified: trunk/Scribus/scribus/ui/fontembeddingmodel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/fontembeddingmodel.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/fontembeddingmodel.cpp (original)
+++ trunk/Scribus/scribus/ui/fontembeddingmodel.cpp Mon Aug 20 19:01:43 2018
@@ -54,9 +54,9 @@
Qt::ItemFlags FontEmbeddingModel::flags(const QModelIndex &index) const
{
if (!index.isValid())
- return 0;
+ return Qt::NoItemFlags;
- Qt::ItemFlags flags = 0;
+ Qt::ItemFlags flags = Qt::NoItemFlags;
if (m_enabledVec[index.row()])
flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
return flags;
Modified: trunk/Scribus/scribus/ui/gradientaddedit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/gradientaddedit.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/gradientaddedit.cpp (original)
+++ trunk/Scribus/scribus/ui/gradientaddedit.cpp Mon Aug 20 19:01:43 2018
@@ -70,9 +70,6 @@
gradientName->setFocus();
return;
}
- else
- accept();
}
- else
- accept();
+ accept();
}
Modified: trunk/Scribus/scribus/ui/helpbrowser.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/helpbrowser.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/helpbrowser.cpp (original)
+++ trunk/Scribus/scribus/ui/helpbrowser.cpp Mon Aug 20 19:01:43 2018
@@ -610,8 +610,7 @@
textBrowser->setSearchPaths(QStringList(finalBaseDir));
if (baseFi.exists())
{
- if (menuModel!=nullptr)
- delete menuModel;
+ delete menuModel;
menuModel=new ScHelpTreeModel(toLoad, "Topic", "Location", &quickHelpIndex);
helpNav->listView->setModel(menuModel);
Modified: trunk/Scribus/scribus/ui/hruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/hruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/hruler.cpp (original)
+++ trunk/Scribus/scribus/ui/hruler.cpp Mon Aug 20 19:01:43 2018
@@ -5,11 +5,11 @@
for which a new license (GPL+exception) is in place.
*/
/***************************************************************************
- hruler.cpp - description
- -------------------
- begin : Tue Apr 10 2001
- copyright : (C) 2001 by Franz Schmid
- email : Franz.Schmid at altmuehlnet.de
+ hruler.cpp - description
+ -------------------
+ begin : Tue Apr 10 2001
+ copyright : (C) 2001 by Franz Schmid
+ email : Franz.Schmid at altmuehlnet.de
***************************************************************************/
/***************************************************************************
@@ -47,9 +47,9 @@
#ifdef Q_OS_MAC
- #define topline 1
+#define topline 1
#else
- #define topline 3
+#define topline 3
#endif
#define bottomline 15
#define rulerheight (bottomline - topline)
@@ -58,8 +58,8 @@
enum ruler_code
{
- rc_none = 0,
- rc_leftFrameDist = 1,
+ rc_none = 0,
+ rc_leftFrameDist = 1,
rc_rightFrameDist = 2,
rc_indentFirst = 3,
rc_leftMargin = 4,
@@ -446,7 +446,7 @@
break;
}
MouseX = m->x();
-/* if (RulerCode != rc_none)
+ /* if (RulerCode != rc_none)
{
QPoint py = m_view->viewport()->mapFromGlobal(m->globalPos());
QPainter p;
@@ -456,7 +456,7 @@
QPoint out = m_view->contentsToViewport(QPoint(0, qRound(m_doc->currentPage()->yOffset() * Scaling)));
p.drawLine(Markp, out.y(), Markp, out.y()+qRound(m_doc->currentPage()->height() * Scaling));
p.drawLine(py.x(), out.y(), py.x(), out.y()+qRound(m_doc->currentPage()->height() * Scaling));
- p.end();
+ p.end();
Markp = py.x();
}*/
return;
@@ -466,7 +466,7 @@
setCursor(IconManager::instance()->loadCursor("tab.png", 3));
switch(findRulerHandle(m->pos(), m_doc->guidesPrefs().grabRadius))
{
- case rc_leftFrameDist:
+ case rc_leftFrameDist:
setCursor(QCursor(Qt::SplitHCursor));
break;
case rc_rightFrameDist:
@@ -776,32 +776,32 @@
switch (m_doc->unitIndex())
{
case SC_IN:
- {
- QString tx = "";
- int num1 = static_cast<int>((xl-Pos) / iter2 / cor);
- if (num1 != 0)
- tx = QString::number(num1);
- double frac = (xl / iter2 / cor) - num1;
- if ((frac > 0.24) && (frac < 0.26))
- tx += QChar(0xBC);
- if ((frac > 0.49) && (frac < 0.51))
- tx += QChar(0xBD);
- if ((frac > 0.74) && (frac < 0.76))
- tx += QChar(0xBE);
- if (Revers)
{
- p.save();
- p.translate(xli-2, 0);
- p.scale(-1,1);
- drawNumber(tx, 0, 17, p);
- //p.drawText(0, 17, tx);
- p.restore();
+ QString tx = "";
+ int num1 = static_cast<int>((xl-Pos) / iter2 / cor);
+ if (num1 != 0)
+ tx = QString::number(num1);
+ double frac = (xl / iter2 / cor) - num1;
+ if ((frac > 0.24) && (frac < 0.26))
+ tx += QChar(0xBC);
+ if ((frac > 0.49) && (frac < 0.51))
+ tx += QChar(0xBD);
+ if ((frac > 0.74) && (frac < 0.76))
+ tx += QChar(0xBE);
+ if (Revers)
+ {
+ p.save();
+ p.translate(xli-2, 0);
+ p.scale(-1,1);
+ drawNumber(tx, 0, 17, p);
+ //p.drawText(0, 17, tx);
+ p.restore();
+ }
+ else
+ drawNumber(tx, xli+2, 9, p);
+ //p.drawText(qRound((xl+2/sc) * sc), 9, tx);
+ break;
}
- else
- drawNumber(tx, xli+2, 9, p);
- //p.drawText(qRound((xl+2/sc) * sc), 9, tx);
- break;
- }
case SC_P:
if (Revers)
{
@@ -879,7 +879,7 @@
whereToDraw = where;
drawMark = true;
repaint(oldMark-3, 0, 7, 17);
-// drawMark = false;
+ // drawMark = false;
oldMark = currentCoor;
}
@@ -910,15 +910,15 @@
First = currentStyle.firstIndent();
Indent = currentStyle.leftMargin();
double columnWidth = (item->width() - (item->columnGap() * (item->columns() - 1))
- - item->textToFrameDistLeft() - item->textToFrameDistLeft()
- - 2*lineCorr) / item->columns();
+ - item->textToFrameDistLeft() - item->textToFrameDistLeft()
+ - 2*lineCorr) / item->columns();
RMargin = columnWidth - currentStyle.rightMargin();
if (item->imageFlippedH())
Revers = true;
else
Revers = false;
textEditMode = true;
- TabValues = currentStyle.tabValues();
+ TabValues = currentStyle.tabValues();
}
void Hruler::UpdateTabList()
@@ -962,12 +962,12 @@
if (sc < 0.3)
{
iter = unitRulerGetIter1FromIndex(docUnitIndex) * 3;
- iter2 = unitRulerGetIter2FromIndex(docUnitIndex) * 3;
+ iter2 = unitRulerGetIter2FromIndex(docUnitIndex) * 3;
}
else if (sc < 0.5)
{
iter = unitRulerGetIter1FromIndex(docUnitIndex) * 2;
- iter2 = unitRulerGetIter2FromIndex(docUnitIndex) * 2;
+ iter2 = unitRulerGetIter2FromIndex(docUnitIndex) * 2;
}
else
{
@@ -1025,12 +1025,12 @@
iter2 = 60.0*4;
}
else
- if (sc < 1)
- {
- cor = 1;
- iter = 12.0;
- iter2 = 60.0;
- }
+ if (sc < 1)
+ {
+ cor = 1;
+ iter = 12.0;
+ iter2 = 60.0;
+ }
break;
case SC_CM:
if (sc > 1 && sc <= 4)
@@ -1046,8 +1046,8 @@
else
{
iter = unitRulerGetIter1FromIndex(docUnitIndex) / cor;
- iter2 = unitRulerGetIter2FromIndex(docUnitIndex) / cor;
- }
+ iter2 = unitRulerGetIter2FromIndex(docUnitIndex) / cor;
+ }
break;
case SC_C:
iter = unitRulerGetIter1FromIndex(docUnitIndex);
@@ -1071,12 +1071,12 @@
iter2 = 72.0/25.4*4.512*5.0*10;
}
else
- if (sc < 1)
- {
- cor = 1;
- iter = 72.0/25.4*4.512;
- iter2 = 72.0/25.4*4.512*5.0;
- }
+ if (sc < 1)
+ {
+ cor = 1;
+ iter = 72.0/25.4*4.512;
+ iter2 = 72.0/25.4*4.512*5.0;
+ }
break;
default:
if (sc > 1 && sc <= 4)
@@ -1084,7 +1084,7 @@
if (sc > 4)
cor = 10;
iter = unitRulerGetIter1FromIndex(0) / cor;
- iter2 = unitRulerGetIter2FromIndex(0) / cor;
+ iter2 = unitRulerGetIter2FromIndex(0) / cor;
break;
}
}
Modified: trunk/Scribus/scribus/ui/inlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/inlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/inlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/inlinepalette.cpp Mon Aug 20 19:01:43 2018
@@ -196,7 +196,7 @@
{
QListWidgetItem* item = InlineViewWidget->item(a);
if (item)
- item->setFlags(0);
+ item->setFlags(Qt::NoItemFlags);
}
}
Modified: trunk/Scribus/scribus/ui/latexeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/latexeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/latexeditor.cpp (original)
+++ trunk/Scribus/scribus/ui/latexeditor.cpp Mon Aug 20 19:01:43 2018
@@ -65,14 +65,14 @@
connect(killPushButton, SIGNAL(clicked(bool)), frame, SLOT(killProcess()));
connect(externalEditorPushButton, SIGNAL(clicked(bool)), this, SLOT(extEditorClicked()));
connect(dpiSpinBox, SIGNAL(editingFinished()), this, SLOT(dpiChanged()));
- connect(frame, SIGNAL(formulaAutoUpdate(QString, QString)), this, SLOT(formulaChanged(QString, QString)));
+ connect(frame, SIGNAL(formulaAutoUpdate(QString,QString)), this, SLOT(formulaChanged(QString,QString)));
connect(frame, SIGNAL(latexFinished()), this, SLOT(latexFinished()));
connect(frame, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(stateChanged(QProcess::ProcessState)));
connect(programComboBox, SIGNAL(activated(int)), this, SLOT(applicationChanged()));
updateConfigFile();
extEditor = new QProcess();
- connect(extEditor, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(extEditorFinished(int, QProcess::ExitStatus)));
+ connect(extEditor, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(extEditorFinished(int,QProcess::ExitStatus)));
connect(extEditor, SIGNAL(error(QProcess::ProcessError)), this, SLOT(extEditorError(QProcess::ProcessError)));
extEditor->setProcessChannelMode(QProcess::MergedChannels);
@@ -665,7 +665,7 @@
class SCRIBUS_API XmlSpinBox : public XmlWidget, public QSpinBox
{
public:
- XmlSpinBox(I18nXmlStreamReader *xml) : XmlWidget(xml, false), QSpinBox()
+ XmlSpinBox(I18nXmlStreamReader *xml) : XmlWidget(xml, false)
{
setRange(
xml->attributes().value("min").toString().toInt(),
@@ -679,20 +679,17 @@
QString toString() const
{
- if (value() == minimum() && !specialValueText().isEmpty()) {
+ if (value() == minimum() && !specialValueText().isEmpty())
return specialValueText();
- } else {
- return QString::number(value());
- }
+ return QString::number(value());
}
void fromString(QString str)
{
- if (str == specialValueText()) {
+ if (str == specialValueText())
setValue(minimum());
- } else {
+ else
setValue(str.toInt());
- }
}
};
@@ -700,7 +697,7 @@
{
public:
XmlDoubleSpinBox(I18nXmlStreamReader *xml) :
- XmlWidget(xml, false), QDoubleSpinBox()
+ XmlWidget(xml, false)
{
setRange(
xml->attributes().value("min").toString().toDouble(),
@@ -732,7 +729,7 @@
class SCRIBUS_API XmlLineEdit : public XmlWidget, public QLineEdit
{
public:
- XmlLineEdit(I18nXmlStreamReader *xml) : XmlWidget(xml), QLineEdit() {
+ XmlLineEdit(I18nXmlStreamReader *xml) : XmlWidget(xml) {
fromString(m_defaultValue);
}
@@ -748,7 +745,7 @@
class SCRIBUS_API XmlTextEdit : public XmlWidget, public QTextEdit
{
public:
- XmlTextEdit(I18nXmlStreamReader *xml) : XmlWidget(xml), QTextEdit() {
+ XmlTextEdit(I18nXmlStreamReader *xml) : XmlWidget(xml) {
fromString(m_defaultValue);
}
Modified: trunk/Scribus/scribus/ui/newfile.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/newfile.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/newfile.cpp (original)
+++ trunk/Scribus/scribus/ui/newfile.cpp Mon Aug 20 19:01:43 2018
@@ -673,7 +673,7 @@
setWindowTitle(tr("Open Existing Document"));
else if (tab == 3)
setWindowTitle(tr("Open Recent Document"));
- else
+ else
setWindowTitle(tr("New Document"));
OKButton->setEnabled(tab!=2);
}
Modified: trunk/Scribus/scribus/ui/pdfexportdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/pdfexportdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pdfexportdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/pdfexportdialog.cpp Mon Aug 20 19:01:43 2018
@@ -171,7 +171,7 @@
}
}
- if ((pageNumbers.size() == 0) || hasInvalidPageRange)
+ if ((pageNumbers.empty()) || hasInvalidPageRange)
{
ScMessageBox::warning(this, CommonStrings::trWarning, tr("The range of pages to export is invalid.\nPlease check it and try again."));
return;
Modified: trunk/Scribus/scribus/ui/picstatus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/picstatus.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/picstatus.cpp (original)
+++ trunk/Scribus/scribus/ui/picstatus.cpp Mon Aug 20 19:01:43 2018
@@ -439,8 +439,9 @@
if (currItem->OnMasterPage.isEmpty() && m_Doc->masterPageMode())
ScCore->primaryMainWindow()->closeActiveWindowMasterPageEditor();
- else if (!currItem->OnMasterPage.isEmpty() && !m_Doc->masterPageMode())
- emit selectMasterPage(currItem->OnMasterPage);
+ else
+ if (!currItem->OnMasterPage.isEmpty() && !m_Doc->masterPageMode())
+ emit selectMasterPage(currItem->OnMasterPage);
emit selectElementByItem(currItem, true, 1);
}
Modified: trunk/Scribus/scribus/ui/prefs_documentsections.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/prefs_documentsections.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_documentsections.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_documentsections.cpp Mon Aug 20 19:01:43 2018
@@ -113,69 +113,69 @@
uint newDocPageSpec;
switch (col)
{
- case 0:
- m_localSections[row].name=sectionsTable->item(row, col)->text();
- break;
- case 1:
- m_localSections[row].active=(sectionsTable->item(row, col)->checkState()==Qt::Checked);
- break;
- case 2:
- m_localSections[row].reversed=(sectionsTable->item(row, col)->checkState()==Qt::Checked);
- break;
- case 3:
- case 4:
- // Validate to/from page specification before conversion to an index
- //!!! There is still a problem here if m_maxPageIndex == MAX_UINT ;)
- newDocPageSpec=sectionsTable->item(row, col)->text().toUInt();
- if (newDocPageSpec==0)
- {
- newDocPageSpec=1;
- outOfRange=true;
- }
- else
- if (newDocPageSpec>m_maxPageIndex+1)
- {
- newDocPageSpec=m_maxPageIndex+1;
- outOfRange=true;
- }
- // Now, since newDocPageSpec >= 1, convert to index
- --newDocPageSpec;
- if (col==3)
- m_localSections[row].fromindex=newDocPageSpec;
- else
- m_localSections[row].toindex=newDocPageSpec;
- break;
- case 5:
- {
- QComboBox* qcti=dynamic_cast<QComboBox*>(sectionsTable->cellWidget(row,col));
- if (qcti!=nullptr)
- {
- int index=qcti->currentIndex();
- if (index<m_styles.count()-1)
- m_localSections[row].type=(NumFormat)index;
+ case 0:
+ m_localSections[row].name=sectionsTable->item(row, col)->text();
+ break;
+ case 1:
+ m_localSections[row].active=(sectionsTable->item(row, col)->checkState()==Qt::Checked);
+ break;
+ case 2:
+ m_localSections[row].reversed=(sectionsTable->item(row, col)->checkState()==Qt::Checked);
+ break;
+ case 3:
+ case 4:
+ // Validate to/from page specification before conversion to an index
+ //!!! There is still a problem here if m_maxPageIndex == MAX_UINT ;)
+ newDocPageSpec=sectionsTable->item(row, col)->text().toUInt();
+ if (newDocPageSpec==0)
+ {
+ newDocPageSpec=1;
+ outOfRange=true;
+ }
+ else
+ if (newDocPageSpec>m_maxPageIndex+1)
+ {
+ newDocPageSpec=m_maxPageIndex+1;
+ outOfRange=true;
+ }
+ // Now, since newDocPageSpec >= 1, convert to index
+ --newDocPageSpec;
+ if (col==3)
+ m_localSections[row].fromindex=newDocPageSpec;
+ else
+ m_localSections[row].toindex=newDocPageSpec;
+ break;
+ case 5:
+ {
+ QComboBox* qcti=dynamic_cast<QComboBox*>(sectionsTable->cellWidget(row,col));
+ if (qcti!=nullptr)
+ {
+ int index=qcti->currentIndex();
+ if (index<m_styles.count()-1)
+ m_localSections[row].type=(NumFormat)index;
+ else
+ if (index==m_styles.count()-1)
+ m_localSections[row].type=Type_None;
+ }
+ }
+ break;
+ case 6:
+ m_localSections[row].sectionstartindex = sectionsTable->item(row, col)->text().toUInt();;
+ break;
+ case 7:
+ m_localSections[row].pageNumberWidth = sectionsTable->item(row, col)->text().toInt();
+ break;
+ case 8:
+ {
+ QString ch=sectionsTable->item(row, col)->text();
+ if (ch.length()>0)
+ m_localSections[row].pageNumberFillChar=ch.at(0);
else
- if (index==m_styles.count()-1)
- m_localSections[row].type=Type_None;
- }
- }
- break;
- case 6:
- m_localSections[row].sectionstartindex = sectionsTable->item(row, col)->text().toUInt();;
- break;
- case 7:
- m_localSections[row].pageNumberWidth = sectionsTable->item(row, col)->text().toInt();
- break;
- case 8:
- {
- QString ch=sectionsTable->item(row, col)->text();
- if (ch.length()>0)
- m_localSections[row].pageNumberFillChar=sectionsTable->item(row, col)->text().at(0);
- else
- m_localSections[row].pageNumberFillChar=QChar();
- }
- break;
- default:
- break;
+ m_localSections[row].pageNumberFillChar=QChar();
+ }
+ break;
+ default:
+ break;
}
if (outOfRange)
Modified: trunk/Scribus/scribus/ui/prefs_externaltools.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/prefs_externaltools.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_externaltools.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_externaltools.cpp Mon Aug 20 19:01:43 2018
@@ -306,9 +306,7 @@
item->setText(description);
else
{
- item->setText(QString("%1 (" + tr("Command: ") + "%2)" ).
- arg(description).
- arg(QDir::toNativeSeparators(QDir::cleanPath(command))));
- }
-}
-
+ item->setText(QString("%1 (" + tr("Command: ") + "%2)" ).arg(description, QDir::toNativeSeparators(QDir::cleanPath(command))));
+ }
+}
+
Modified: trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_keyboardshortcuts.cpp Mon Aug 20 19:01:43 2018
@@ -501,10 +501,7 @@
QString actionName = lviToActionMap[selectedLVI];
if (checkKey(keyCode))
{
- ScMessageBox::information(this, CommonStrings::trWarning,
- tr("The %1 key sequence is already in use by \"%2\"")
- .arg(getTrKeyText(keyCode))
- .arg(getAction(keyCode)));
+ ScMessageBox::information(this, CommonStrings::trWarning, tr("The %1 key sequence is already in use by \"%2\"").arg(getTrKeyText(keyCode),getAction(keyCode)));
selectedLVI->setText(1,keyMap[actionName].keySequence.toString(QKeySequence::NativeText));
keyDisplay->setText(keyMap[actionName].keySequence.toString(QKeySequence::NativeText));
}
Modified: trunk/Scribus/scribus/ui/preview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/preview.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/preview.cpp (original)
+++ trunk/Scribus/scribus/ui/preview.cpp Mon Aug 20 19:01:43 2018
@@ -549,7 +549,7 @@
args.append( "-dNOPAUSE" );
args.append( "-dPARANOIDSAFER" );
args.append( QString("-r%1").arg(tmp.setNum(res)) );
- args.append( QString("-g%1x%2").arg(tmp2.setNum(qRound(b))).arg(tmp3.setNum(qRound(h))) );
+ args.append( QString("-g%1x%2").arg(tmp2.setNum(qRound(b)), tmp3.setNum(qRound(h))) );
if (EnableCMYK->isChecked())
{
if (HaveTiffSep)
@@ -663,7 +663,7 @@
args1.append( "-dNOPAUSE" );
args1.append( "-dPARANOIDSAFER" );
args1.append( QString("-r%1").arg(tmp.setNum(res)) );
- args1.append( QString("-g%1x%2").arg(tmp2.setNum(qRound(b))).arg(tmp3.setNum(qRound(h))) );
+ args1.append( QString("-g%1x%2").arg(tmp2.setNum(qRound(b)), tmp3.setNum(qRound(h))) );
if (AntiAlias->isChecked())
{
args1.append("-dTextAlphaBits=4");
Modified: trunk/Scribus/scribus/ui/propertiespalette_group.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/propertiespalette_group.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_group.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_group.cpp Mon Aug 20 19:01:43 2018
@@ -354,23 +354,22 @@
{
if (!m_ScMW || m_ScMW->scriptIsRunning() || !m_haveItem)
return;
- if (m_item->isGroup())
- {
- if (mode == PageItem::TextFlowDisabled)
- textFlowDisabled->setChecked(true);
- else if (mode == PageItem::TextFlowUsesFrameShape)
- textFlowUsesFrameShape->setChecked(true);
- else if (mode == PageItem::TextFlowUsesBoundingBox)
- textFlowUsesBoundingBox->setChecked(true);
- else if (mode == PageItem::TextFlowUsesContourLine)
- textFlowUsesContourLine->setChecked(true);
- else if (mode == PageItem::TextFlowUsesImageClipping)
- textFlowUsesImageClipping->setChecked(true);
- if ((m_item->asImageFrame()) && (m_item->imageClip.size() != 0))
- textFlowUsesImageClipping->setEnabled(true);
- else
- textFlowUsesImageClipping->setEnabled(false);
- }
+ if (!m_item->isGroup())
+ return;
+ if (mode == PageItem::TextFlowDisabled)
+ textFlowDisabled->setChecked(true);
+ else if (mode == PageItem::TextFlowUsesFrameShape)
+ textFlowUsesFrameShape->setChecked(true);
+ else if (mode == PageItem::TextFlowUsesBoundingBox)
+ textFlowUsesBoundingBox->setChecked(true);
+ else if (mode == PageItem::TextFlowUsesContourLine)
+ textFlowUsesContourLine->setChecked(true);
+ else if (mode == PageItem::TextFlowUsesImageClipping)
+ textFlowUsesImageClipping->setChecked(true);
+ if ((m_item->asImageFrame()) && (!m_item->imageClip.empty()))
+ textFlowUsesImageClipping->setEnabled(true);
+ else
+ textFlowUsesImageClipping->setEnabled(false);
}
void PropertiesPalette_Group::updateColorList()
Modified: trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/propertiespalette_shape.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_shape.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_shape.cpp Mon Aug 20 19:01:43 2018
@@ -517,23 +517,22 @@
{
if (!m_ScMW || m_ScMW->scriptIsRunning() || !m_haveItem)
return;
- if (!m_item->isGroup())
- {
- if (mode == PageItem::TextFlowDisabled)
- textFlowDisabled->setChecked(true);
- else if (mode == PageItem::TextFlowUsesFrameShape)
- textFlowUsesFrameShape->setChecked(true);
- else if (mode == PageItem::TextFlowUsesBoundingBox)
- textFlowUsesBoundingBox->setChecked(true);
- else if (mode == PageItem::TextFlowUsesContourLine)
- textFlowUsesContourLine->setChecked(true);
- else if (mode == PageItem::TextFlowUsesImageClipping)
- textFlowUsesImageClipping->setChecked(true);
- if ((m_item->asImageFrame()) && (m_item->imageClip.size() != 0))
- textFlowUsesImageClipping->setEnabled(true);
- else
- textFlowUsesImageClipping->setEnabled(false);
- }
+ if (m_item->isGroup())
+ return;
+ if (mode == PageItem::TextFlowDisabled)
+ textFlowDisabled->setChecked(true);
+ else if (mode == PageItem::TextFlowUsesFrameShape)
+ textFlowUsesFrameShape->setChecked(true);
+ else if (mode == PageItem::TextFlowUsesBoundingBox)
+ textFlowUsesBoundingBox->setChecked(true);
+ else if (mode == PageItem::TextFlowUsesContourLine)
+ textFlowUsesContourLine->setChecked(true);
+ else if (mode == PageItem::TextFlowUsesImageClipping)
+ textFlowUsesImageClipping->setChecked(true);
+ if ((m_item->asImageFrame()) && (!m_item->imageClip.empty()))
+ textFlowUsesImageClipping->setEnabled(true);
+ else
+ textFlowUsesImageClipping->setEnabled(false);
}
void PropertiesPalette_Shape::languageChange()
Modified: trunk/Scribus/scribus/ui/propertiespalette_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/propertiespalette_text.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_text.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_text.cpp Mon Aug 20 19:01:43 2018
@@ -108,7 +108,7 @@
languageChange();
connect(lineSpacing , SIGNAL(valueChanged(double)), this, SLOT(handleLineSpacing()));
- connect(fonts , SIGNAL(fontSelected(QString )), this, SLOT(handleTextFont(QString)));
+ connect(fonts , SIGNAL(fontSelected(QString)), this, SLOT(handleTextFont(QString)));
connect(fontSize , SIGNAL(valueChanged(double)), this, SLOT(handleFontSize()));
connect(textAlignment , SIGNAL(State(int)) , this, SLOT(handleAlignment(int)));
connect(textDirection , SIGNAL(State(int)) , this, SLOT(handleDirection(int)));
Modified: trunk/Scribus/scribus/ui/proptree.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/proptree.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/proptree.cpp (original)
+++ trunk/Scribus/scribus/ui/proptree.cpp Mon Aug 20 19:01:43 2018
@@ -389,7 +389,7 @@
setDoubleValue(oldVal * newUnitRatio);
}
else
- setData(1, Qt::DisplayRole, QString("%1 %2").arg(data(1, Qt::UserRole).toString()).arg(unitGetSuffixFromIndex(m_unit)));
+ setData(1, Qt::DisplayRole, QString("%1 %2").arg(data(1, Qt::UserRole).toString(), unitGetSuffixFromIndex(m_unit)));
}
void PropTreeItem::setDecimalsValue(int unit)
@@ -398,7 +398,7 @@
if (m_type == DoubleSpinBox)
setData(1, Qt::DisplayRole, QString("%1 %2").arg(data(1, Qt::UserRole).toDouble(), 0, 'f', unit).arg(unitGetSuffixFromIndex(m_unit)));
else
- setData(1, Qt::DisplayRole, QString("%1 %2").arg(data(1, Qt::UserRole).toString()).arg(unitGetSuffixFromIndex(m_unit)));
+ setData(1, Qt::DisplayRole, QString("%1 %2").arg(data(1, Qt::UserRole).toString(), unitGetSuffixFromIndex(m_unit)));
}
void PropTreeItem::setComboStrings(const QStringList& value)
Modified: trunk/Scribus/scribus/ui/query.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/query.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/query.cpp (original)
+++ trunk/Scribus/scribus/ui/query.cpp Mon Aug 20 19:01:43 2018
@@ -86,8 +86,7 @@
QMessageBox::Yes); // batch default
if (ret == QMessageBox::No)
return;
- else
- accept();
+ accept();
}
else
{
Modified: trunk/Scribus/scribus/ui/scmenu.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/scmenu.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scmenu.cpp (original)
+++ trunk/Scribus/scribus/ui/scmenu.cpp Mon Aug 20 19:01:43 2018
@@ -122,8 +122,7 @@
m->setText(newSubMenu->getMenuText());
return true;
}
- else
- return false;
+ return false;
}
bool ScrPopupMenu::removeSubMenu(ScrPopupMenu* subMenu)
@@ -156,8 +155,7 @@
menuListHasNoIcons = act->icon().isNull();
break;
}
-
- else if (menuItemListClassName == "ScrPopupMenu")
+ if (menuItemListClassName == "ScrPopupMenu")
{
ScrPopupMenu * men = dynamic_cast<ScrPopupMenu *>(menuItem);
if (men!=nullptr)
@@ -173,8 +171,7 @@
localPopupMenu->addAction(newMenuAction);
return true;
}
- else
- return false;
+ return false;
}
/* Qt4
@@ -336,13 +333,13 @@
if (sca!=nullptr)
actNames->append(sca->objectName());
}
- else
- if (menuItemListClassName=="ScrPopupMenu")
- {
- ScrPopupMenu *scp=dynamic_cast<ScrPopupMenu *>(listObj);
- if (scp!=nullptr)
- scp->generateEntryList(actNames);
- }
+ else
+ if (menuItemListClassName=="ScrPopupMenu")
+ {
+ ScrPopupMenu *scp=dynamic_cast<ScrPopupMenu *>(listObj);
+ if (scp!=nullptr)
+ scp->generateEntryList(actNames);
+ }
++menuItemListIt;
}
return true;
Modified: trunk/Scribus/scribus/ui/scrapbookpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/scrapbookpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrapbookpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/scrapbookpalette.cpp Mon Aug 20 19:01:43 2018
@@ -139,7 +139,7 @@
if (e->source() == this)
return;
QString text = e->mimeData()->text();
- int startElemPos = text.left(512).indexOf("<SCRIBUSELEM");
+ int startElemPos = text.leftRef(512).indexOf("<SCRIBUSELEM");
if (startElemPos >= 0)
emit objDropped(text);
}
Modified: trunk/Scribus/scribus/ui/search.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/search.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/search.cpp (original)
+++ trunk/Scribus/scribus/ui/search.cpp Mon Aug 20 19:01:43 2018
@@ -523,14 +523,11 @@
m_replStart = a;
break;
}
- else
- {
- if (SText->isChecked())
- {
- for (int xx = m_replStart; xx < a+1; ++xx)
- m_item->itemText.select(qMin(xx, maxChar), 1, false);
- m_item->HasSel = false;
- }
+ if (SText->isChecked())
+ {
+ for (int xx = m_replStart; xx < a+1; ++xx)
+ m_item->itemText.select(qMin(xx, maxChar), 1, false);
+ m_item->HasSel = false;
}
}
if ((!found) || (a == m_item->itemText.length()))
Modified: trunk/Scribus/scribus/ui/smcellstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/smcellstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcellstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smcellstylewidget.cpp Mon Aug 20 19:01:43 2018
@@ -124,8 +124,7 @@
d = -30000;
break;
}
- else
- d = cellStyles[i]->fillShade();
+ d = cellStyles[i]->fillShade();
}
if (d == -30000)
fillShade->setText( tr("Shade"));
@@ -140,8 +139,7 @@
s = emptyString;
break;
}
- else
- s = cellStyles[i]->fillColor();
+ s = cellStyles[i]->fillColor();
}
if (s.isEmpty())
{
Modified: trunk/Scribus/scribus/ui/smcstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/smcstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smcstylewidget.cpp Mon Aug 20 19:01:43 2018
@@ -381,8 +381,7 @@
d = -30000;
break;
}
- else
- d = cstyles[i]->fontSize();
+ d = cstyles[i]->fontSize();
}
if (d == -30000)
fontSize_->clear();
@@ -397,8 +396,7 @@
d = -30000;
break;
}
- else
- d = cstyles[i]->scaleH();
+ d = cstyles[i]->scaleH();
}
if (d == -30000)
fontHScale_->clear();
@@ -413,8 +411,7 @@
d = -30000;
break;
}
- else
- d = cstyles[i]->scaleV();
+ d = cstyles[i]->scaleV();
}
if (d == -30000)
fontVScale_->clear();
@@ -429,8 +426,7 @@
d = -30000;
break;
}
- else
- d = cstyles[i]->baselineOffset();
+ d = cstyles[i]->baselineOffset();
}
if (d == -30000)
baselineOffset_->clear();
@@ -445,8 +441,7 @@
d = -30000;
break;
}
- else
- d = cstyles[i]->tracking();
+ d = cstyles[i]->tracking();
}
if (d == -30000)
tracking_->clear();
@@ -461,8 +456,7 @@
d = -30000;
break;
}
- else
- d = cstyles[i]->wordTracking();
+ d = cstyles[i]->wordTracking();
}
if (d == -30000)
widthSpaceSpin->clear();
@@ -480,8 +474,7 @@
d = -30000;
break;
}
- else
- d = static_cast<int>(cstyles[i]->effects());
+ d = static_cast<int>(cstyles[i]->effects());
}
if (d == -30000)
effects_->setStyle(0);
@@ -511,8 +504,7 @@
d = -30000;
break;
}
- else
- d = cstyles[i]->fillShade();
+ d = cstyles[i]->fillShade();
}
if (d == -30000)
fillShade_->setText( tr("Shade"));
@@ -527,8 +519,7 @@
d = -30000;
break;
}
- else
- d = cstyles[i]->strokeShade();
+ d = cstyles[i]->strokeShade();
}
if (d == -30000)
{
@@ -546,8 +537,7 @@
d = -30000;
break;
}
- else
- d = cstyles[i]->backShade();
+ d = cstyles[i]->backShade();
}
if (d == -30000)
{
@@ -566,8 +556,7 @@
s = emptyString;
break;
}
- else
- s = cstyles[i]->fillColor();
+ s = cstyles[i]->fillColor();
}
if (s.isEmpty())
{
@@ -586,8 +575,7 @@
s = emptyString;
break;
}
- else
- s = cstyles[i]->strokeColor();
+ s = cstyles[i]->strokeColor();
}
if (s.isEmpty())
{
@@ -606,8 +594,7 @@
s = emptyString;
break;
}
- else
- s = cstyles[i]->backColor();
+ s = cstyles[i]->backColor();
}
if (s.isEmpty())
{
@@ -630,8 +617,7 @@
s = emptyString;
break;
}
- else
- s = cstyles[i]->language();
+ s = cstyles[i]->language();
}
if (s.isEmpty())
{
@@ -654,8 +640,7 @@
s = tmp;
break;
}
- else
- s = cstyles[i]->hyphenWordMin();
+ s = cstyles[i]->hyphenWordMin();
}
smallestWordSpinBox->setValue(s);
}
@@ -671,8 +656,7 @@
ch = empty;
break;
}
- else
- ch = cstyles[i]->hyphenChar();
+ ch = cstyles[i]->hyphenChar();
}
hyphenCharLineEdit->setValue(QString::fromUcs4(&ch, 1));
}
@@ -696,11 +680,8 @@
featuresList = tmp2;
break;
}
- else
- {
- fontfeatures = cstyles[i]->fontFeatures();
- featuresList = cstyles[i]->font().fontFeatures();
- }
+ fontfeatures = cstyles[i]->fontFeatures();
+ featuresList = cstyles[i]->font().fontFeatures();
}
fontfeaturesSetting->setFontFeatures(fontfeatures, featuresList);
}
@@ -713,11 +694,7 @@
void SMCStyleWidget::slotColorChange()
{
int s = effects_->getStyle();
- bool enabled;
- if ((s & 4) || (s & 256))
- enabled = true;
- else
- enabled = false;
+ bool enabled= (s & 4) || (s & 256);
StrokeIcon->setEnabled(enabled);
strokeShade_->setEnabled(enabled);
strokeColor_->setEnabled(enabled);
Modified: trunk/Scribus/scribus/ui/smpstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/smpstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smpstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smpstylewidget.cpp Mon Aug 20 19:01:43 2018
@@ -24,7 +24,7 @@
}
-SMPStyleWidget::SMPStyleWidget(ScribusDoc* doc, StyleSet<CharStyle> *cstyles) : QWidget(),
+SMPStyleWidget::SMPStyleWidget(ScribusDoc* doc, StyleSet<CharStyle> *cstyles) :
m_hasParent(false),
m_parentDC(false),
m_parentBul(false),
@@ -537,8 +537,7 @@
d = -30000;
break;
}
- else
- d = cstyles[i]->backgroundShade();
+ d = cstyles[i]->backgroundShade();
}
if (d == -30000)
{
@@ -557,8 +556,7 @@
s = emptyString;
break;
}
- else
- s = cstyles[i]->backgroundColor();
+ s = cstyles[i]->backgroundColor();
}
if (s.isEmpty())
{
@@ -585,8 +583,7 @@
tmpLP = -1;
break;
}
- else
- tmpLP = pstyles[i]->lineSpacingMode();
+ tmpLP = pstyles[i]->lineSpacingMode();
}
if (tmpLP == -1)
@@ -606,8 +603,7 @@
tmpLS = -1.0;
break;
}
- else
- tmpLS = pstyles[i]->lineSpacing();
+ tmpLS = pstyles[i]->lineSpacing();
}
lineSpacing->setEnabled(true);
if (tmpLS < 0)
@@ -627,8 +623,7 @@
tmpA = -1.2;
break;
}
- else
- tmpA = pstyles[i]->gapBefore();
+ tmpA = pstyles[i]->gapBefore();
}
if (tmpA < 0)
@@ -674,8 +669,7 @@
lines = -1;
break;
}
- else
- lines = pstyles[i]->dropCapLines();
+ lines = pstyles[i]->dropCapLines();
}
if (lines == -1)
dropCapLines->clear();
@@ -711,8 +705,7 @@
chStr.clear();
break;
}
- else
- chStr = pstyles[i]->bulletStr();
+ chStr = pstyles[i]->bulletStr();
}
bulletStrEdit->setEditText(chStr);
@@ -731,8 +724,7 @@
prefix.clear();
break;
}
- else
- prefix = pstyles[i]->numPrefix();
+ prefix = pstyles[i]->numPrefix();
}
numPrefix->setText(prefix);
@@ -744,8 +736,7 @@
suffix.clear();
break;
}
- else
- suffix = pstyles[i]->numSuffix();
+ suffix = pstyles[i]->numSuffix();
}
numSuffix->setText(suffix);
@@ -937,8 +928,7 @@
l = -4000.0;
break;
}
- else
- l = pstyles[i]->leftMargin();
+ l = pstyles[i]->leftMargin();
}
if (l < -3800.0)
{
@@ -956,8 +946,7 @@
l = -4000.0;
break;
}
- else
- l = pstyles[i]->firstIndent();
+ l = pstyles[i]->firstIndent();
}
if (l < -3800.0)
{
@@ -975,8 +964,7 @@
l = -4000.0;
break;
}
- else
- l = pstyles[i]->rightMargin();
+ l = pstyles[i]->rightMargin();
}
if (l < -3800.0)
{
Modified: trunk/Scribus/scribus/ui/smtablestylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/smtablestylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtablestylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smtablestylewidget.cpp Mon Aug 20 19:01:43 2018
@@ -124,8 +124,7 @@
d = -30000;
break;
}
- else
- d = tableStyles[i]->fillShade();
+ d = tableStyles[i]->fillShade();
}
if (d == -30000)
fillShade->setText( tr("Shade"));
@@ -140,8 +139,7 @@
s = emptyString;
break;
}
- else
- s = tableStyles[i]->fillColor();
+ s = tableStyles[i]->fillColor();
}
if (s.isEmpty())
{
Modified: trunk/Scribus/scribus/ui/smtextstyles.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/smtextstyles.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smtextstyles.cpp (original)
+++ trunk/Scribus/scribus/ui/smtextstyles.cpp Mon Aug 20 19:01:43 2018
@@ -2086,7 +2086,7 @@
/******************************************************************************/
/******************************************************************************/
-SMCharacterStyle::SMCharacterStyle() : StyleItem(), m_widget(nullptr), m_page(nullptr), m_doc(nullptr), m_selectionIsDirty(false)
+SMCharacterStyle::SMCharacterStyle() : m_widget(nullptr), m_page(nullptr), m_doc(nullptr), m_selectionIsDirty(false)
{
m_widget = new QTabWidget();
Q_CHECK_PTR(m_widget);
Modified: trunk/Scribus/scribus/ui/storyeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/storyeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/storyeditor.cpp (original)
+++ trunk/Scribus/scribus/ui/storyeditor.cpp Mon Aug 20 19:01:43 2018
@@ -98,8 +98,8 @@
ScGuardedPtr<ScribusDoc> m_styledTextDoc;
public:
- const StoryText& styledText(void) const { return m_styledText; }
- const ScribusDoc* document(void) const { return m_styledTextDoc; }
+ const StoryText& styledText() const { return m_styledText; }
+ const ScribusDoc* document() const { return m_styledTextDoc; }
void setStyledText(const StoryText& text, ScribusDoc* doc)
{
@@ -2100,18 +2100,18 @@
connect(AlignTools, SIGNAL(newParaStyle(const QString&)), this, SLOT(newStyle(const QString&)));
connect(AlignTools, SIGNAL(newAlign(int)), this, SLOT(newAlign(int)));
connect(AlignTools, SIGNAL(newDirection(int)), this, SLOT(newDirection(int)));
- connect(FillTools, SIGNAL(NewColor(int, int)), this, SLOT(newTxFill(int, int)));
- connect(StrokeTools, SIGNAL(NewColor(int, int)), this, SLOT(newTxStroke(int, int)));
+ connect(FillTools, SIGNAL(NewColor(int,int)), this, SLOT(newTxFill(int,int)));
+ connect(StrokeTools, SIGNAL(NewColor(int,int)), this, SLOT(newTxStroke(int,int)));
connect(FontTools, SIGNAL(newSize(double)), this, SLOT(newTxSize(double)));
connect(FontTools, SIGNAL(newFont(const QString&)), this, SLOT(newTxFont(const QString&)));
connect(FontTools, SIGNAL(newScaleH(double)), this, SLOT(newTxScale()));
connect(FontTools, SIGNAL(newScaleV(double)), this, SLOT(newTxScaleV()));
connect(StyleTools, SIGNAL(NewKern(double)), this, SLOT(newTxKern(double)));
connect(StyleTools, SIGNAL(newStyle(int)), this, SLOT(newTxStyle(int)));
- connect(StyleTools, SIGNAL(NewShadow(double, double)), this, SLOT(newShadowOffs(double, double)));
+ connect(StyleTools, SIGNAL(NewShadow(double,double)), this, SLOT(newShadowOffs(double,double)));
connect(StyleTools, SIGNAL(newOutline(double)), this, SLOT(newTxtOutline(double)));
- connect(StyleTools, SIGNAL(newUnderline(double, double)), this, SLOT(newTxtUnderline(double, double)));
- connect(StyleTools, SIGNAL(newStrike(double, double)), this, SLOT(newTxtStrike(double, double)));
+ connect(StyleTools, SIGNAL(newUnderline(double,double)), this, SLOT(newTxtUnderline(double,double)));
+ connect(StyleTools, SIGNAL(newStrike(double,double)), this, SLOT(newTxtStrike(double,double)));
}
void StoryEditor::setCurrentDocumentAndItem(ScribusDoc *doc, PageItem *item)
Modified: trunk/Scribus/scribus/ui/stylemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/stylemanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/stylemanager.cpp (original)
+++ trunk/Scribus/scribus/ui/stylemanager.cpp Mon Aug 20 19:01:43 2018
@@ -908,11 +908,8 @@
}
if (postpone)
continue;
- else
- {
- qDebug() << QString("stylemanager: unknown parent '%1' of %2 style '%3'").arg(styles[i].second).arg(m_item->typeName()).arg(styles[i].first);
- sitem = new StyleViewItem(rootItem, styles[i].first, m_item->typeName());
- }
+ qDebug() << QString("stylemanager: unknown parent '%1' of %2 style '%3'").arg(styles[i].second, m_item->typeName(), styles[i].first);
+ sitem = new StyleViewItem(rootItem, styles[i].first, m_item->typeName());
}
sitems[styles[i].first] = sitem;
@@ -1053,7 +1050,7 @@
applyButton->setEnabled(false);
return;
}
- else if (uniqueLabel->isVisible())
+ if (uniqueLabel->isVisible())
{
uniqueLabel->hide();
okButton->setEnabled(true);
@@ -1322,10 +1319,8 @@
{
StyleViewItem *item = dynamic_cast<StyleViewItem*>(it);
if (!item)
- {
continue;
- }
- else if (typeName.isNull())
+ if (typeName.isNull())
typeName = item->rootName();
else if (!typeName.isNull() && typeName != item->rootName())
{
Modified: trunk/Scribus/scribus/ui/symbolpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/symbolpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/symbolpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/symbolpalette.cpp Mon Aug 20 19:01:43 2018
@@ -223,7 +223,7 @@
{
QList<QListWidgetItem*> items = SymbolViewWidget->findItems(names[a], Qt::MatchExactly);
if (items.count() > 0)
- items[0]->setFlags(0);
+ items[0]->setFlags(Qt::NoItemFlags);
}
}
@@ -301,7 +301,7 @@
p.end();
QListWidgetItem *item = new QListWidgetItem(pm2, patK[a], SymbolViewWidget);
if (editItemNames.contains(patK[a]))
- item->setFlags(0);
+ item->setFlags(Qt::NoItemFlags);
else
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled);
}
Modified: trunk/Scribus/scribus/ui/tabpdfoptions.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/tabpdfoptions.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tabpdfoptions.cpp (original)
+++ trunk/Scribus/scribus/ui/tabpdfoptions.cpp Mon Aug 20 19:01:43 2018
@@ -169,7 +169,7 @@
connect(ToSubset, SIGNAL(clicked()), this, SLOT(PutToSubset()));
connect(FromSubset, SIGNAL(clicked()), this, SLOT(RemoveSubset()));
connect(PagePrev, SIGNAL(clicked()), this, SLOT(PagePr()));
- connect(Pages, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(SetPgEff(QListWidgetItem*, QListWidgetItem*)));
+ connect(Pages, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(SetPgEff(QListWidgetItem*,QListWidgetItem*)));
connect(EffectType, SIGNAL(activated(int)), this, SLOT(SetEffOpts(int)));
connect(EDirection_2_2, SIGNAL(activated(int)), this, SLOT(ValidDI(int)));
connect(CheckBox10, SIGNAL(clicked()), this, SLOT(DoEffects()));
@@ -368,7 +368,7 @@
CQuality->setEnabled(false);
DSColor->setChecked(Opts.RecalcPic);
ValC->setValue(Opts.PicRes);
- ValC->setEnabled(DSColor->isChecked() ? true : false);
+ ValC->setEnabled(DSColor->isChecked());
m_docFonts = DocFonts.keys();
if (Opts.Version == PDFOptions::PDFVersion_X1a ||
@@ -838,7 +838,7 @@
void TabPDFOptions::ToggleEncr()
{
- bool setter = Encry->isChecked() ? true : false;
+ bool setter = Encry->isChecked();
groupSecSet->setEnabled(setter);
groupPass->setEnabled(setter);
}
@@ -965,7 +965,7 @@
if (EmbedProfs2->isChecked())
{
NoEmbedded->setEnabled(true);
- bool setter = NoEmbedded->isChecked() ? true : false;
+ bool setter = NoEmbedded->isChecked();
imageProfileLabel->setEnabled(setter);
imageIntentLabel->setEnabled(setter);
ImageP->setEnabled(setter);
@@ -983,7 +983,7 @@
void TabPDFOptions::EnablePGI2()
{
- bool setter = NoEmbedded->isChecked() ? true : false;
+ bool setter = NoEmbedded->isChecked();
imageProfileLabel->setEnabled(setter);
imageIntentLabel->setEnabled(setter);
ImageP->setEnabled(setter);
@@ -992,7 +992,7 @@
void TabPDFOptions::EnablePG()
{
- bool setter = EmbedProfs->isChecked() ? true : false;
+ bool setter = EmbedProfs->isChecked();
solidsProfileLabel->setEnabled(setter);
solidsIntentLabel->setEnabled(setter);
SolidPr->setEnabled(setter);
@@ -1095,10 +1095,10 @@
void TabPDFOptions::SelRange(bool e)
{
- bool setter = e ? false : true;
+ bool setter = !e;
PageNr->setEnabled( setter );
pageNrButton->setEnabled( setter );
- if (setter == false)
+ if (!setter)
CheckBM->setChecked(false);
}
@@ -1129,7 +1129,7 @@
void TabPDFOptions::DoEffects()
{
- bool setter = CheckBox10->isChecked() ? true : false;
+ bool setter = CheckBox10->isChecked();
Pages->setEnabled(setter);
Effects->setEnabled(setter);
PagePrev->setEnabled(setter);
@@ -1234,7 +1234,7 @@
void TabPDFOptions::PagePr()
{
- connect(Pages, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(SetPgEff(QListWidgetItem*, QListWidgetItem*)));
+ connect(Pages, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(SetPgEff(QListWidgetItem*,QListWidgetItem*)));
QString tmp;
QPixmap pm;
int ci = Pages->currentRow();
@@ -1263,7 +1263,7 @@
Pages->setCurrentRow(ci);
else
Pages->clearSelection();
- connect(Pages, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(SetPgEff(QListWidgetItem*, QListWidgetItem*)));
+ connect(Pages, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(SetPgEff(QListWidgetItem*,QListWidgetItem*)));
}
void TabPDFOptions::DoDownsample()
Modified: trunk/Scribus/scribus/ui/tabruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/tabruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/tabruler.cpp (original)
+++ trunk/Scribus/scribus/ui/tabruler.cpp Mon Aug 20 19:01:43 2018
@@ -102,7 +102,7 @@
{
case 2:
{
- QString tx = "";
+ QString tx;
int num1 = static_cast<int>(xl / iter2);
if (num1 != 0)
tx = QString::number(num1);
@@ -864,32 +864,35 @@
tabFillCombo->setEditable(false);
tabFillCombo->setCurrentIndex(0);
}
- else if (t == '.')
- {
- tabFillCombo->setEditable(false);
- tabFillCombo->setCurrentIndex(1);
- }
- else if (t == '-')
- {
- tabFillCombo->setEditable(false);
- tabFillCombo->setCurrentIndex(2);
- }
- else if (t == '_')
- {
- tabFillCombo->setEditable(false);
- tabFillCombo->setCurrentIndex(3);
- }
else
- {
- tabFillCombo->setCurrentIndex(4);
- tabFillCombo->setEditable(true);
- if (!t.isNull())
- {
- bool sigBlocked = tabFillCombo->blockSignals(true);
- tabFillCombo->setEditText(QString(t));
- tabFillCombo->blockSignals(sigBlocked);
- }
- }
+ if (t == '.')
+ {
+ tabFillCombo->setEditable(false);
+ tabFillCombo->setCurrentIndex(1);
+ }
+ else
+ if (t == '-')
+ {
+ tabFillCombo->setEditable(false);
+ tabFillCombo->setCurrentIndex(2);
+ }
+ else
+ if (t == '_')
+ {
+ tabFillCombo->setEditable(false);
+ tabFillCombo->setCurrentIndex(3);
+ }
+ else
+ {
+ tabFillCombo->setCurrentIndex(4);
+ tabFillCombo->setEditable(true);
+ if (!t.isNull())
+ {
+ bool sigBlocked = tabFillCombo->blockSignals(true);
+ tabFillCombo->setEditText(QString(t));
+ tabFillCombo->blockSignals(sigBlocked);
+ }
+ }
emit tabrulerChanged();
emit tabsChanged();
}
Modified: trunk/Scribus/scribus/ui/unicodesearch.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22638&path=/trunk/Scribus/scribus/ui/unicodesearch.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/unicodesearch.cpp (original)
+++ trunk/Scribus/scribus/ui/unicodesearch.cpp Mon Aug 20 19:01:43 2018
@@ -88,7 +88,6 @@
// }
UnicodeSearchModel::UnicodeSearchModel(QObject * /*parent*/)
- : QAbstractTableModel()
{
setObjectName("UnicodeSearchModel");
@@ -141,14 +140,11 @@
{
if (!index.isValid())
return QVariant();
- if (role == Qt::DisplayRole)
- {
- if (index.column() == 0)
- return m_unicode.at(index.row()).hex;
- else
- return m_unicode.at(index.row()).description;
- }
- return QVariant();
+ if (role != Qt::DisplayRole)
+ return QVariant();
+ if (index.column() == 0)
+ return m_unicode.at(index.row()).hex;
+ return m_unicode.at(index.row()).description;
}
QString UnicodeSearchModel::hexData(const QModelIndex & index)
More information about the scribus-commit
mailing list