Author: jghali
Date: Wed Oct  9 15:23:25 2019
New Revision: 23244

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23244
Log:
Code style fixes

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: 
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23244&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp  (original)
+++ trunk/Scribus/scribus/pageitem.cpp  Wed Oct  9 15:23:25 2019
@@ -1607,14 +1607,14 @@
 
 void PageItem::setTextToFrameDistLeft(double newLeft)
 {
-       if (m_textDistanceMargins.left()==newLeft)
+       if (m_textDistanceMargins.left() == newLeft)
                return;
        if (UndoManager::undoEnabled())
        {
                SimpleState *ss = new SimpleState(Um::TextFrameDist, "", 
Um::ITextFrame);
                ss->set("LEFT_TEXTFRAMEDIST");
-               ss->set("OLD_DIST",m_textDistanceMargins.left());
-               ss->set("NEW_DIST",newLeft);
+               ss->set("OLD_DIST", m_textDistanceMargins.left());
+               ss->set("NEW_DIST", newLeft);
                undoManager->action(this, ss);
        }
        m_textDistanceMargins.setLeft(newLeft);
@@ -1623,14 +1623,14 @@
 
 void PageItem::setTextToFrameDistRight(double newRight)
 {
-       if (m_textDistanceMargins.right()==newRight)
+       if (m_textDistanceMargins.right() == newRight)
                return;
        if (UndoManager::undoEnabled())
        {
                SimpleState *ss = new SimpleState(Um::TextFrameDist, "", 
Um::ITextFrame);
                ss->set("RIGHT_TEXTFRAMEDIST");
-               ss->set("OLD_DIST",m_textDistanceMargins.right());
-               ss->set("NEW_DIST",newRight);
+               ss->set("OLD_DIST", m_textDistanceMargins.right());
+               ss->set("NEW_DIST", newRight);
                undoManager->action(this, ss);
        }
        m_textDistanceMargins.setRight(newRight);
@@ -1639,14 +1639,14 @@
 
 void PageItem::setTextToFrameDistTop(double newTop)
 {
-       if (m_textDistanceMargins.top()==newTop)
+       if (m_textDistanceMargins.top() == newTop)
                return;
        if (UndoManager::undoEnabled())
        {
                SimpleState *ss = new SimpleState(Um::TextFrameDist, "", 
Um::ITextFrame);
                ss->set("TOP_TEXTFRAMEDIST");
-               ss->set("OLD_DIST",m_textDistanceMargins.top());
-               ss->set("NEW_DIST",newTop);
+               ss->set("OLD_DIST", m_textDistanceMargins.top());
+               ss->set("NEW_DIST", newTop);
                undoManager->action(this, ss);
        }
        m_textDistanceMargins.setTop(newTop);
@@ -1655,14 +1655,14 @@
 
 void PageItem::setTextToFrameDistBottom(double newBottom)
 {
-       if (m_textDistanceMargins.bottom()==newBottom)
+       if (m_textDistanceMargins.bottom() == newBottom)
                return;
        if (UndoManager::undoEnabled())
        {
                SimpleState *ss = new SimpleState(Um::TextFrameDist, "", 
Um::ITextFrame);
                ss->set("BOTTOM_TEXTFRAMEDIST");
-               ss->set("OLD_DIST",m_textDistanceMargins.bottom());
-               ss->set("NEW_DIST",newBottom);
+               ss->set("OLD_DIST", m_textDistanceMargins.bottom());
+               ss->set("NEW_DIST", newBottom);
                undoManager->action(this, ss);
        }
        m_textDistanceMargins.setBottom(newBottom);
@@ -1753,8 +1753,8 @@
        {
                SimpleState *state = new 
SimpleState(Um::RoundCorner,"",Um::IBorder);
                state->set("CORNER_RADIUS");
-               state->set("OLD_RADIUS",m_roundedCorderRadius);
-               state->set("NEW_RADIUS",newRadius);
+               state->set("OLD_RADIUS", m_roundedCorderRadius);
+               state->set("NEW_RADIUS", newRadius);
                undoManager->action(this,state);
        }
        m_roundedCorderRadius=newRadius;
@@ -1784,7 +1784,7 @@
        DrawObj_Pre(p);
        if (m_Doc->layerOutline(m_layerID))
        {
-               if ((itemType()==TextFrame || itemType()==ImageFrame || 
itemType()==PathText || itemType()==Line || itemType()==PolyLine || 
itemType()==Group || itemType()==Symbol))
+               if ((itemType() == TextFrame || itemType() == ImageFrame || 
itemType() == PathText || itemType() == Line || itemType() == PolyLine || 
itemType() == Group || itemType() == Symbol))
                        DrawObj_Item(p, cullingArea);
        }
        else
@@ -2004,7 +2004,7 @@
                        p->setFillMode(ScPainter::None);
                        p->setBrushOpacity(1.0);
                        p->setPenOpacity(1.0);
-                       if (itemType()==PolyLine)
+                       if (itemType() == PolyLine)
                                p->setupPolygon(&PoLine, false);
                        else if (itemType() == PathText)
                        {
@@ -2017,7 +2017,7 @@
                                p->setupPolygon(&PoLine);
                        if (doStroke)
                                p->strokePath();
-                       if (itemType()==ImageFrame)
+                       if (itemType() == ImageFrame)
                        {
                                if (!imageClip.empty())
                                {
@@ -2033,8 +2033,8 @@
                {
                        p->setBlendModeFill(0);
                        p->setMaskMode(0);
-                       // TODO: Investigate whether itemType()==Table should 
really be here. I got artifacts without it so keeping it here for now. /estan
-                       if (itemType()==PathText || itemType()==PolyLine || 
itemType()==Spiral || itemType()==Line || itemType()==Symbol || 
itemType()==Group || itemType()==Table)
+                       // TODO: Investigate whether itemType() == Table should 
really be here. I got artifacts without it so keeping it here for now. /estan
+                       if (itemType() == PathText || itemType() == PolyLine || 
itemType() == Spiral || itemType() == Line || itemType() == Symbol || 
itemType() == Group || itemType() == Table)
                                doStroke=false;
                        if ((doStroke) && (!m_Doc->RePos))
                        {
@@ -2161,7 +2161,7 @@
                                if (m_Locked)
                                        
p->setPen(PrefsManager::instance().appPrefs.displayPrefs.frameLockColor, 
scpInv, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
                                p->setFillMode(0);
-                               if (itemType()==PathText)
+                               if (itemType() == PathText)
                                {
                                        if (Clip.count() != 0)
                                        {
@@ -2191,7 +2191,7 @@
                        p->setupSharpPolygon(&ContourLine);
                        p->strokePath();
                }
-               if (itemType()==ImageFrame)
+               if (itemType() == ImageFrame)
                {
                        double minres = 
m_Doc->checkerProfiles()[m_Doc->curCheckProfile()].minResolution;
                        double maxres = 
m_Doc->checkerProfiles()[m_Doc->curCheckProfile()].maxResolution;
@@ -3584,7 +3584,7 @@
 
 void PageItem::setMaskType(int val)
 {
-       if (GrMask==val)
+       if (GrMask == val)
                return;
        if (UndoManager::undoEnabled())
        {
@@ -4161,8 +4161,8 @@
        {
                SimpleState *ss = new 
SimpleState(Um::StartArrowScale,"",Um::IArrow);
                ss->set("START_ARROWSCALE");
-               ss->set("OLD_SCALE",m_startArrowScale);
-               ss->set("NEW_SCALE",newScale);
+               ss->set("OLD_SCALE", m_startArrowScale);
+               ss->set("NEW_SCALE", newScale);
                undoManager->action(this, ss);
        }
        m_startArrowScale = newScale;
@@ -4176,8 +4176,8 @@
        {
                SimpleState *ss = new 
SimpleState(Um::EndArrowScale,"",Um::IArrow);
                ss->set("END_ARROWSCALE");
-               ss->set("OLD_SCALE",m_endArrowScale);
-               ss->set("NEW_SCALE",newScale);
+               ss->set("OLD_SCALE", m_endArrowScale);
+               ss->set("NEW_SCALE", newScale);
                undoManager->action(this, ss);
        }
        m_endArrowScale = newScale;
@@ -4256,7 +4256,7 @@
 
 void PageItem::setOverprint(bool val)
 {
-       if (doOverprint==val)
+       if (doOverprint == val)
                return;
 
        if (UndoManager::undoEnabled())
@@ -6110,7 +6110,7 @@
                fill_gradient = is->getItem().first;
        else
                fill_gradient = is->getItem().second;
-       if (gradientType()==13)
+       if (gradientType() == 13)
                createConicalMesh();
        update();
 }
@@ -8171,7 +8171,7 @@
 
 void PageItem::setSnapToPatchGrid(bool val)
 {
-       if (snapToPatchGrid ==val)
+       if (snapToPatchGrid == val)
                return;
        if (UndoManager::undoEnabled())
        {
@@ -8367,7 +8367,7 @@
 
 void PageItem::setGradientControl2(const FPoint& val)
 {
-       if (GrControl2==val)
+       if (GrControl2 == val)
                return;
        if (UndoManager::undoEnabled())
        {
@@ -8381,7 +8381,7 @@
 
 void PageItem::setGradientControl3(const FPoint& val)
 {
-       if (GrControl3==val)
+       if (GrControl3 == val)
                return;
        if (UndoManager::undoEnabled())
        {
@@ -8395,7 +8395,7 @@
 
 void PageItem::setGradientControl4(const FPoint& val)
 {
-       if (GrControl4==val)
+       if (GrControl4 == val)
                return;
        if (UndoManager::undoEnabled())
        {
@@ -8409,7 +8409,7 @@
 
 void PageItem::setGradientControl5(const FPoint& val)
 {
-       if (GrControl5==val)
+       if (GrControl5 == val)
                return;
        if (UndoManager::undoEnabled())
        {
@@ -8423,7 +8423,7 @@
 
 void PageItem::setGradientStrokeScale(double val)
 {
-       if (GrStrokeScale==val)
+       if (GrStrokeScale == val)
                return;
        if (UndoManager::undoEnabled())
        {
@@ -8438,7 +8438,7 @@
 
 void PageItem::setGradientStrokeSkew(double val)
 {
-       if (GrStrokeSkew==val)
+       if (GrStrokeSkew == val)
                return;
        if (UndoManager::undoEnabled())
        {
@@ -10276,7 +10276,7 @@
        {
                SimpleState *ss = new 
SimpleState(Um::ResTyp,"",Um::IImageFrame);
                ss->set("SHOW_IMAGE");
-               ss->set("OLD",m_imageVisible);
+               ss->set("OLD", m_imageVisible);
                undoManager->action(this, ss);
        }
        m_imageVisible=isShown;

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: 
http://scribus.net/websvn/diff.php?repname=Scribus&rev=23244&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp        (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp        Wed Oct  9 15:23:25 2019
@@ -2446,7 +2446,7 @@
 
 ScPage* ScribusDoc::addPage(int pageIndex, const QString& masterPageName, bool 
addAutoFrame)
 {
-       assert(masterPageMode()==false);
+       assert(masterPageMode() == false);
        ScPage* addedPage = new 
ScPage(m_docPrefsData.displayPrefs.scratch.left(), 
DocPages.count()*(m_docPrefsData.docSetupPrefs.pageHeight+m_docPrefsData.displayPrefs.scratch.bottom()+m_docPrefsData.displayPrefs.scratch.top())+m_docPrefsData.displayPrefs.scratch.top(),
 m_docPrefsData.docSetupPrefs.pageWidth, 
m_docPrefsData.docSetupPrefs.pageHeight);
        assert(addedPage!=nullptr);
        addedPage->setDocument(this);
@@ -2512,7 +2512,7 @@
        int number = MasterNames[oldPageName];
        MasterNames.insert(newPageName, number);
        MasterNames.remove(oldPageName);
-       Q_ASSERT(MasterPages.at(number)->pageName()==oldPageName);
+       Q_ASSERT(MasterPages.at(number)->pageName() == oldPageName);
        MasterPages.at(number)->setPageName(newPageName);
        //Update any pages that were linking to our old name
        ScPage* docPage=nullptr;
@@ -5370,7 +5370,7 @@
        int z=-2;
        PageItem *prevItem=nullptr; //Previous item for text frame linking
        if (iafData.linkToExistingFrame && 
iafData.linkToExistingFramePtr!=nullptr &&
-                       
iafData.linkToExistingFramePtr->itemType()==PageItem::TextFrame &&
+                       iafData.linkToExistingFramePtr->itemType() == 
PageItem::TextFrame &&
                        DocItems.contains(iafData.linkToExistingFramePtr))
                prevItem=iafData.linkToExistingFramePtr;
        UndoTransaction transaction;
@@ -5497,7 +5497,7 @@
 void ScribusDoc::itemAddDetails(const PageItem::ItemType itemType, const 
PageItem::ItemFrameType frameType, PageItem* newItem)
 {
        ParagraphStyle defaultParagraphStyle;
-       Q_ASSERT(newItem->realItemType()==itemType);
+       Q_ASSERT(newItem->realItemType() == itemType);
        switch (itemType)
        {
                case PageItem::ImageFrame:
@@ -6306,7 +6306,7 @@
                        break;
                case PageItem::TextFrame:
                        newItem = new PageItem_TextFrame(*oldItem);
-                       if (UndoManager::undoEnabled() && 
oldItem->itemType()==PageItem::PathText)
+                       if (UndoManager::undoEnabled() && oldItem->itemType() 
== PageItem::PathText)
                                transactionConversion = 
m_undoManager->beginTransaction(m_currentPage->getUName(), nullptr, 
Um::TextFrame, "", Um::ITextFrame);
                        break;
                //We don't allow this
@@ -6327,13 +6327,13 @@
                        newItem = new PageItem_PathText(*oldItem);
                        break;
                default:
-                       newItem=nullptr;
+                       newItem = nullptr;
                        break;
        }
-       Q_ASSERT(newItem!=nullptr);
+       Q_ASSERT(newItem != nullptr);
        //If the new item is null, return. If converting Text to Path, start a 
transaction
        //as the old bezier will be deleted
-       if (newItem==nullptr)
+       if (newItem == nullptr)
        {
                if (transactionConversion)
                {
@@ -6351,7 +6351,7 @@
                        break;
                case PageItem::TextFrame:
                        newItem->convertTo(PageItem::TextFrame);
-                       if (oldItem->itemType()==PageItem::PathText)
+                       if (oldItem->itemType() == PageItem::PathText)
                        {
                                uint newPolyItemNo = 
itemAdd(PageItem::PolyLine, PageItem::Unspecified, currItem->xPos(), 
currItem->yPos(), currItem->width(), currItem->height(), currItem->lineWidth(), 
CommonStrings::None, currItem->lineColor());
                                PageItem *polyLineItem = 
Items->at(newPolyItemNo);
@@ -6374,7 +6374,7 @@
                        newItem->convertTo(PageItem::Polygon);
                        newItem->ClipEdited = true;
                        newItem->FrameType = 3;
-                       if (oldItem->itemType()==PageItem::PolyLine)
+                       if (oldItem->itemType() == PageItem::PolyLine)
                        {
                                
newItem->PoLine.addPoint(newItem->PoLine.point(newItem->PoLine.size()-2));
                                
newItem->PoLine.addPoint(newItem->PoLine.point(newItem->PoLine.size()-3));
@@ -6388,7 +6388,7 @@
                        newItem->convertTo(PageItem::PolyLine);
                        newItem->ClipEdited = true;
                        newItem->FrameType = 3;
-                       if (oldItem->itemType()==PageItem::Line)
+                       if (oldItem->itemType() == PageItem::Line)
                        {
                                QTransform ma;
                                newItem->FrameType = 3;
@@ -6423,7 +6423,7 @@
                        }
                        break;
                default:
-                       newItem=nullptr;
+                       newItem = nullptr;
                        break;
        }
        newItem->uniqueNr = oldItem->uniqueNr;
@@ -14588,7 +14588,7 @@
 {
        Selection* itemSelection = (customSelection!=nullptr) ? customSelection 
: m_Selection;
        Q_ASSERT(itemSelection != nullptr);
-       if (itemSelection->count()==0)
+       if (itemSelection->count() == 0)
                return;
        double gx, gy, gh, gw;
        FPoint rotationPoint(0, 0);
@@ -14610,7 +14610,7 @@
 {
        Selection* itemSelection = (customSelection!=nullptr) ? customSelection 
: m_Selection;
        Q_ASSERT(itemSelection != nullptr);
-       if (itemSelection->count()==0)
+       if (itemSelection->count() == 0)
                return;
        double gxS, gyS, ghS, gwS;
        double sc = 1; // FIXME:av Scale;
@@ -16041,7 +16041,7 @@
                for (int ii = 0; ii < allItems.count(); ii++)
                {
                        ite = allItems.at(ii);
-                       if (ite->itemType() == itemType && 
ite->nextInChain()==nullptr && !ite->isAutoFrame())
+                       if (ite->itemType() == itemType && ite->nextInChain() 
== nullptr && !ite->isAutoFrame())
                                namesMap.insert(ite, ite->itemName());
                }
                allItems.clear();


_______________________________________________
scribus-commit mailing list
[email protected]
http://lists.scribus.net/mailman/listinfo/scribus-commit

Reply via email to