r19198 by jghali - some cleanups
scribus-commit
scribus-commit at lists.scribus.net
Mon Jun 9 14:54:08 UTC 2014
Author: jghali
Date: Mon Jun 9 14:54:08 2014
New Revision: 19198
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19198
Log:
some cleanups
Modified:
branches/Version14x/Scribus/scribus/smlinestyle.cpp
Modified: branches/Version14x/Scribus/scribus/smlinestyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19198&path=/branches/Version14x/Scribus/scribus/smlinestyle.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/smlinestyle.cpp (original)
+++ branches/Version14x/Scribus/scribus/smlinestyle.cpp Mon Jun 9 14:54:08 2014
@@ -698,23 +698,24 @@
pm.fill(Qt::white);
QPainter p;
p.begin(&pm);
+
multiLine *tmpLine = selection_.begin().value();
-
- for (int it = (*tmpLine).size()-1; it > -1; it--)
+ for (int it = tmpLine->size()-1; it > -1; it--)
{
QPen pen;
- QVector<qreal> m_array;
- if ((*tmpLine)[it].Dash == 1)
+ const SingleLine& singleLine = tmpLine->at(it);
+ if (singleLine.Dash == 1)
pen.setStyle(Qt::SolidLine);
else
{
- getDashArray((*tmpLine)[it].Dash, 1, m_array);
- pen.setDashPattern(m_array);
- }
- pen.setColor(calcFarbe((*tmpLine)[it].Color, (*tmpLine)[it].Shade));
- pen.setWidth(qMax(static_cast<int>((*tmpLine)[it].Width), 1));
- pen.setCapStyle(static_cast<Qt::PenCapStyle>((*tmpLine)[it].LineEnd));
- pen.setJoinStyle(static_cast<Qt::PenJoinStyle>((*tmpLine)[it].LineJoin));
+ QVector<qreal> dashArray;
+ getDashArray(singleLine.Dash, 1, dashArray);
+ pen.setDashPattern(dashArray);
+ }
+ pen.setColor(calcFarbe(singleLine.Color, singleLine.Shade));
+ pen.setWidth(qMax(static_cast<int>(singleLine.Width), 1));
+ pen.setCapStyle(static_cast<Qt::PenCapStyle>(singleLine.LineEnd));
+ pen.setJoinStyle(static_cast<Qt::PenJoinStyle>(singleLine.LineJoin));
p.setPen(pen);
p.drawLine(17, 18, 183, 18);
}
@@ -747,37 +748,37 @@
int cc = 0;
struct SingleLine sl;
multiLine *tmpLine = selection_.begin().value();
-
sl.Color = (*tmpLine)[currentLine_].Color;
sl.Shade = (*tmpLine)[currentLine_].Shade;
sl.Dash = (*tmpLine)[currentLine_].Dash;
sl.LineEnd = (*tmpLine)[currentLine_].LineEnd;
sl.LineJoin = (*tmpLine)[currentLine_].LineJoin;
sl.Width = (*tmpLine)[currentLine_].Width;
+
multiLine::iterator it3;
- for (it3 = (*tmpLine).begin(); it3 != (*tmpLine).end(); ++it3)
+ for (it3 = tmpLine->begin(); it3 != tmpLine->end(); ++it3)
{
if (cc == currentLine_)
{
- (*tmpLine).erase(it3);
+ tmpLine->erase(it3);
break;
}
cc++;
}
cc = 0;
bool fo = false;
- for (multiLine::iterator it2 = (*tmpLine).begin(); it2 != (*tmpLine).end(); ++it2)
- {
- if (sl.Width < (*it2).Width)
- {
- (*tmpLine).insert(it2, sl);
+ for (multiLine::iterator it2 = tmpLine->begin(); it2 != tmpLine->end(); ++it2)
+ {
+ if (sl.Width < it2->Width)
+ {
+ tmpLine->insert(it2, sl);
fo = true;
break;
}
cc++;
}
if (!fo)
- (*tmpLine).push_back(sl);
+ tmpLine->push_back(sl);
currentLine_ = cc;
rebuildList();
widget_->showStyle(*tmpLine, doc_->PageColors, cc);
More information about the scribus-commit
mailing list