Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 8561 → Rev 8562

/branches/Version135x/Scribus/scribus/gtaction.cpp
197,7 → 197,7
}
}
it->itemText.applyCharStyle(lastStyleStart, it->itemText.length()-lastStyleStart, lastStyle);
it->itemText.applyStyle(QMAX(0,it->itemText.length()-1), textFrame->doc()->paragraphStyles()[paragraphStyle]);
it->itemText.applyStyle(qMax(0,it->itemText.length()-1), textFrame->doc()->paragraphStyles()[paragraphStyle]);
lastCharWasLineChange = text.right(1) == "\n";
inPara = style->target() == "paragraph";
/branches/Version135x/Scribus/scribus/util.cpp
662,7 → 662,7
}
while (nextItem != 0)
{
for (int a = QMAX(nextItem->firstInFrame(),0); a <= nextItem->lastInFrame() && a < nextItem->itemText.length(); ++a)
for (int a = qMax(nextItem->firstInFrame(),0); a <= nextItem->lastInFrame() && a < nextItem->itemText.length(); ++a)
{
QChar b = nextItem->itemText.text(a);
if (b == SpecialChars::PARSEP)
/branches/Version135x/Scribus/scribus/createrange.cpp
174,7 → 174,7
basicRangeListBox->clearSelection();
Q3ListBoxItem* clbi=basicRangeListBox->item(index);
basicRangeListBox->takeItem(clbi);
basicRangeListBox->insertItem(clbi, QMAX(0, index-1));
basicRangeListBox->insertItem(clbi, qMax(0, index-1));
basicRangeListBox->setCurrentItem(clbi);
}
 
/branches/Version135x/Scribus/scribus/gradienteditor.cpp
97,7 → 97,7
{
int center = qRound(cstops.at(a)->rampPoint * (width()-20))+10;
pw.setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
if (StopM[QMAX(ActStop,0)] == center)
if (StopM[qMax(ActStop,0)] == center)
pw.setBrush(Qt::red);
else
pw.setBrush(Qt::blue);
/branches/Version135x/Scribus/scribus/newfile.cpp
329,7 → 329,7
recentDocLayout = new Q3VBoxLayout(recentDocFrame, 5, 5, "recentDocLayout");
recentDocListBox = new Q3ListBox(recentDocFrame, "recentDocListBox");
recentDocLayout->addWidget(recentDocListBox);
uint max = QMIN(prefsManager->appPrefs.RecentDCount, recentDocList.count());
uint max = qMin(prefsManager->appPrefs.RecentDCount, recentDocList.count());
for (uint m = 0; m < max; ++m)
recentDocListBox->insertItem( QDir::convertSeparators(recentDocList[m]) );
}
/branches/Version135x/Scribus/scribus/tabdisplay.cpp
191,7 → 191,7
 
void TabDisplay::setDisScale()
{
DisScale = QMAX((150.0 + CaliSlider->value()) / 100.0, 0.01);
DisScale = qMax((150.0 + CaliSlider->value()) / 100.0, 0.01);
drawRuler();
CaliAnz->setText(QString::number(DisScale*100, 'f', 2)+" %");
}
/branches/Version135x/Scribus/scribus/rawimage.cpp
85,9 → 85,9
if (cmyk)
{
ck = src[3];
cr = 255 - QMIN(255, src[0] + ck);
cg = 255 - QMIN(255, src[1] + ck);
cb = 255 - QMIN(255, src[2] + ck);
cr = 255 - qMin(255, src[0] + ck);
cg = 255 - qMin(255, src[1] + ck);
cb = 255 - qMin(255, src[2] + ck);
if (chans > 4)
{
ca = src[4];
/branches/Version135x/Scribus/scribus/mspinbox.cpp
116,7 → 116,7
bool controlB=k->state() & Qt::ControlButton;
if (k->key() == Qt::Key_Shift && !controlB)
{
QSpinBox::setLineStep(QMAX(currLineStep / 10, 1));
QSpinBox::setLineStep(qMax(currLineStep / 10, 1));
retval = true;
qApp->sendEvent( this, ev );
return retval;
123,7 → 123,7
}
else if (k->key() == Qt::Key_Control && !shiftB)
{
QSpinBox::setLineStep(QMAX(currLineStep * 10, 1));
QSpinBox::setLineStep(qMax(currLineStep * 10, 1));
retval = true;
qApp->sendEvent( this, ev );
return retval;
130,7 → 130,7
}
else if ((k->key() == Qt::Key_Control && shiftB) || (k->key() == Qt::Key_Shift && controlB))
{
QSpinBox::setLineStep(QMAX(currLineStep / 100, 1));
QSpinBox::setLineStep(qMax(currLineStep / 100, 1));
retval = true;
qApp->sendEvent( this, ev );
return retval;
158,7 → 158,7
}
else if (k->key() == Qt::Key_Shift && controlB)
{
QSpinBox::setLineStep(QMAX(currLineStep * 10, 1));
QSpinBox::setLineStep(qMax(currLineStep * 10, 1));
retval = true;
qApp->sendEvent( this, ev );
return retval;
165,7 → 165,7
}
else if (k->key() == Qt::Key_Control && shiftB)
{
QSpinBox::setLineStep(QMAX(currLineStep / 10, 1));
QSpinBox::setLineStep(qMax(currLineStep / 10, 1));
retval = true;
qApp->sendEvent( this, ev );
return retval;
181,7 → 181,7
bool controlB=k->state() & Qt::ControlButton;
if (shiftB && !controlB)
{
QSpinBox::setLineStep(QMAX(currLineStep / 10, 1));
QSpinBox::setLineStep(qMax(currLineStep / 10, 1));
retval = true;
qApp->sendEvent( this, ev );
return retval;
188,7 → 188,7
}
else if (!shiftB && controlB)
{
QSpinBox::setLineStep(QMAX(currLineStep * 10, 1));
QSpinBox::setLineStep(qMax(currLineStep * 10, 1));
retval = true;
qApp->sendEvent( this, ev );
return retval;
195,7 → 195,7
}
else if (shiftB && controlB)
{
QSpinBox::setLineStep(QMAX(currLineStep / 100, 1));
QSpinBox::setLineStep(qMax(currLineStep / 100, 1));
retval = true;
qApp->sendEvent( this, ev );
return retval;
/branches/Version135x/Scribus/scribus/multiline.cpp
162,7 → 162,7
for (int it = TempVorl.size()-1; it > -1; it--)
{
p.setPen(QPen(calcFarbe(TempVorl[it].Color, TempVorl[it].Shade),
QMAX(static_cast<int>(TempVorl[it].Width), 1),
qMax(static_cast<int>(TempVorl[it].Width), 1),
static_cast<Qt::PenStyle>(TempVorl[it].Dash),
static_cast<Qt::PenCapStyle>(TempVorl[it].LineEnd),
static_cast<Qt::PenJoinStyle>(TempVorl[it].LineJoin)));
/branches/Version135x/Scribus/scribus/fonts/scface_ttf.cpp
185,7 → 185,7
else {
sDebug(QObject::tr("Font %1 is broken (read stream), no embedding").arg(fontFile).arg(gindex));
str += "\n] def\n";
status = QMAX(status,ScFace::BROKENGLYPHS);
status = qMax(status,ScFace::BROKENGLYPHS);
return false;
}
} while (length==65534);
/branches/Version135x/Scribus/scribus/fonts/scfontmetrics.cpp
263,7 → 263,7
{
gly.translate(static_cast<double>(pen_x) / 6400.0, a);
gp = getMaxClipF(&gly);
ymax = QMAX(ymax, gp.y());
ymax = qMax(ymax, gp.y());
p->setupPolygon(&gly);
p->fillPath();
}
284,7 → 284,7
{
gly.translate(static_cast<double>(pen_x) / 6400.0, a);
gp = getMaxClipF(&gly);
ymax = QMAX(ymax, gp.y());
ymax = qMax(ymax, gp.y());
p->setupPolygon(&gly);
p->fillPath();
}
292,7 → 292,7
}
}
p->end();
pm.resize(QMIN(qRound(gp.x()), w), QMIN(qRound(ymax), h));
pm.resize(qMin(qRound(gp.x()), w), qMin(qRound(ymax), h));
delete p;
FT_Done_FreeType( library );
return pm;
504,7 → 504,7
double uniEM = static_cast<double>(face->units_per_EM);
w = (face->glyph->metrics.width + fabs((double)face->glyph->metrics.horiBearingX)) / uniEM * (Size / 10.0);
ww = face->glyph->metrics.horiAdvance / uniEM * (Size / 10.0);
return QMAX(ww, w);
return qMax(ww, w);
}
else
sDebug(QString("internal error: missing glyph: %1 (char %2) error=%3").arg(c1).arg(ch).arg(error));
/branches/Version135x/Scribus/scribus/fonts/ftface.cpp
235,7 → 235,7
FT_Error error = FT_Load_Glyph( face, gl, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP );
if (!error) {
double w = (face->glyph->metrics.width + QABS((double)face->glyph->metrics.horiBearingX)) / m_uniEM * sz;
result.width = QMAX(w, face->glyph->metrics.horiAdvance / m_uniEM * sz);
result.width = qMax(w, face->glyph->metrics.horiAdvance / m_uniEM * sz);
double height = face->glyph->metrics.height / m_uniEM * sz;
result.ascent = face->glyph->metrics.horiBearingY / m_uniEM * sz;
result.descent = height - result.ascent;
301,7 → 301,7
{
qDebug(QObject::tr("Font %1 is broken (read stream), no embedding").arg(fontFile));
bb.resize(0);
status = QMAX(status, ScFace::BROKENGLYPHS);
status = qMax(status, ScFace::BROKENGLYPHS);
}
/*
// if (showFontInformation)
/branches/Version135x/Scribus/scribus/fonts/scface.h
135,7 → 135,7
m_glyphOutline.clear();
m_cMap.clear();
 
status = QMAX(cachedStatus, ScFace::LOADED);
status = qMax(cachedStatus, ScFace::LOADED);
}
virtual void unload() const
322,7 → 322,7
double glyphWidth(uint gl, double sz=1.0) const { return gl < CONTROL_GLYPHS ? m->glyphWidth(gl, sz) : 0; }
 
/// returns the glyph kerning between 'gl1' and 'gl2' at size 'sz'
double glyphKerning(uint gl1, uint gl2, double sz=1.0) const { return QMAX(gl1,gl2) < CONTROL_GLYPHS ? m->glyphKerning(gl1, gl2, sz) : 0; }
double glyphKerning(uint gl1, uint gl2, double sz=1.0) const { return qMax(gl1,gl2) < CONTROL_GLYPHS ? m->glyphKerning(gl1, gl2, sz) : 0; }
 
/// returns the glyphs bounding box at size 'sz', ie. the area where this glyph will produce marks
GlyphMetrics glyphBBox(uint gl, double sz=1.0) const { return m->glyphBBox(gl < CONTROL_GLYPHS? gl : 0, sz); }
/branches/Version135x/Scribus/scribus/prefsmanager.cpp
721,7 → 721,7
{
mw->setDefaultPrinter(appPrefs.PrinterName, appPrefs.PrinterFile, appPrefs.PrinterCommand);
 
uint max = QMIN(appPrefs.RecentDCount, appPrefs.RecentDocs.count());
uint max = qMin(appPrefs.RecentDCount, appPrefs.RecentDocs.count());
for (uint m = 0; m < max; ++m)
{
QFileInfo fd(appPrefs.RecentDocs[m]);
772,7 → 772,7
appPrefs.mainWinSettings.maximized = ScCore->primaryMainWindow()->isMaximized();
 
appPrefs.RecentDocs.clear();
uint max = QMIN(appPrefs.RecentDCount, ScCore->primaryMainWindow()->RecentDocs.count());
uint max = qMin(appPrefs.RecentDCount, ScCore->primaryMainWindow()->RecentDocs.count());
for (uint m = 0; m < max; ++m)
{
appPrefs.RecentDocs.append(ScCore->primaryMainWindow()->RecentDocs[m]);
/branches/Version135x/Scribus/scribus/selection.cpp
356,18 → 356,18
pb.setPoint(3, FPoint(0.0, currItem->height(), currItem->xPos(), currItem->yPos(), currItem->rotation(), 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
minx = qMin(minx, pb.point(pc).x());
miny = qMin(miny, pb.point(pc).y());
maxx = qMax(maxx, pb.point(pc).x());
maxy = qMax(maxy, pb.point(pc).y());
}
}
else
{
minx = QMIN(minx, currItem->xPos());
miny = QMIN(miny, currItem->yPos());
maxx = QMAX(maxx, currItem->xPos() + currItem->width());
maxy = QMAX(maxy, currItem->yPos() + currItem->height());
minx = qMin(minx, currItem->xPos());
miny = qMin(miny, currItem->yPos());
maxx = qMax(maxx, currItem->xPos() + currItem->width());
maxy = qMax(maxy, currItem->yPos() + currItem->height());
}
}
groupX = minx;
/branches/Version135x/Scribus/scribus/sccolorengine.cpp
81,9 → 81,9
}
else if (model == colorModelCMYK)
{
rgb.r = 255 - QMIN(255, color.CR + color.K);
rgb.g = 255 - QMIN(255, color.MG + color.K);
rgb.b = 255 - QMIN(255, color.YB + color.K);
rgb.r = 255 - qMin(255, color.CR + color.K);
rgb.g = 255 - qMin(255, color.MG + color.K);
rgb.b = 255 - qMin(255, color.YB + color.K);
}
else
{
131,7 → 131,7
}
else if (model == colorModelRGB)
{
cmyk.k = QMIN(QMIN(255 - color.CR, 255 - color.MG), 255 - color.YB);
cmyk.k = qMin(qMin(255 - color.CR, 255 - color.MG), 255 - color.YB);
cmyk.c = 255 - color.CR - cmyk.k;
cmyk.m = 255 - color.MG - cmyk.k;
cmyk.y = 255 - color.YB - cmyk.k;
386,9 → 386,9
}
else
{
r = 255 - QMIN(255, cmyk.c + cmyk.k);
g = 255 - QMIN(255, cmyk.m + cmyk.k);
b = 255 - QMIN(255, cmyk.y + cmyk.k);
r = 255 - qMin(255, cmyk.c + cmyk.k);
g = 255 - qMin(255, cmyk.m + cmyk.k);
b = 255 - qMin(255, cmyk.y + cmyk.k);
}
return QColor(r, g, b);
}
435,9 → 435,9
}
else
{
r = 255 - QMIN(255, cmyk.c + cmyk.k);
g = 255 - QMIN(255, cmyk.m + cmyk.k);
b = 255 - QMIN(255, cmyk.y + cmyk.k);
r = 255 - qMin(255, cmyk.c + cmyk.k);
g = 255 - qMin(255, cmyk.m + cmyk.k);
b = 255 - qMin(255, cmyk.y + cmyk.k);
}
return QColor(r, g, b);
}
496,10 → 496,10
{
CMYKColor cmyk;
getCMYKValues(color, doc, cmyk);
int k = QMIN(QMIN(cmyk.c, cmyk.m), cmyk.y);
int k = qMin(qMin(cmyk.c, cmyk.m), cmyk.y);
color.CR = cmyk.c - k;
color.MG = cmyk.m - k;
color.YB = cmyk.y - k;
color.K = QMIN((cmyk.k + k), 255);
color.K = qMin((cmyk.k + k), 255);
}
}
/branches/Version135x/Scribus/scribus/scribusXml.cpp
156,8 → 156,8
*/
style.setStrokeColor(stroke);
style.setStrokeShade(shade2);
style.setScaleH(QMIN(QMAX(scale, 100), 4000));
style.setScaleV(QMIN(QMAX(scalev, 100), 4000));
style.setScaleH(qMin(qMax(scale, 100), 4000));
style.setScaleV(qMin(qMax(scalev, 100), 4000));
style.setBaselineOffset(base);
style.setShadowXOffset(shX);
style.setShadowYOffset(shY);
788,7 → 788,7
{
fg >> x;
OB.Groups.push(x+doc->GroupCounter);
GrMax = QMAX(GrMax, x+doc->GroupCounter);
GrMax = qMax(GrMax, x+doc->GroupCounter);
}
tmp = "";
}
950,7 → 950,7
{
fg >> x;
OB.Groups.push(x+doc->GroupCounter);
GrMax = QMAX(GrMax, x+doc->GroupCounter);
GrMax = qMax(GrMax, x+doc->GroupCounter);
}
tmp = "";
}
1135,10 → 1135,10
pb.setPoint(3, FPoint(0.0, item->height(), xpo, ypo, item->rotation(), 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
minx = qMin(minx, pb.point(pc).x());
miny = qMin(miny, pb.point(pc).y());
maxx = qMax(maxx, pb.point(pc).x());
maxy = qMax(maxy, pb.point(pc).y());
}
elem.setAttribute("W", maxx - minx);
elem.setAttribute("H", maxy - miny);
/branches/Version135x/Scribus/scribus/edit1format.cpp
554,7 → 554,7
}
}
parstyle.setLineSpacing(LineSpVal->value());
parstyle.setLeftMargin(QMAX(TabList->getLeftIndent(), 0.0));
parstyle.setLeftMargin(qMax(TabList->getLeftIndent(), 0.0));
parstyle.setFirstIndent(TabList->getFirstLine());
parstyle.setGapBefore(AboveV->value() / parentDoc->unitRatio());
parstyle.setGapAfter(BelowV->value() / parentDoc->unitRatio());
/branches/Version135x/Scribus/scribus/scimgdataloader_psd.cpp
210,7 → 210,7
cc = 255 - qRed(*s);
cm = 255 - qGreen(*s);
cy = 255 - qBlue(*s);
ck = QMIN(QMIN(cc, cm), cy);
ck = qMin(qMin(cc, cm), cy);
d[0] = cc-ck;
d[1] = cm-ck;
d[2] = cy-ck;
422,7 → 422,7
curveTable1.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable1[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(tmcu, x / 255.0) * 255)));
curveTable1[x] = qMin(255, qMax(0, qRound(getCurveYValue(tmcu, x / 255.0) * 255)));
}
}
else if (cda == 1)
430,7 → 430,7
curveTable2.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable2[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(tmcu, x / 255.0) * 255)));
curveTable2[x] = qMin(255, qMax(0, qRound(getCurveYValue(tmcu, x / 255.0) * 255)));
}
}
else if (cda == 2)
438,7 → 438,7
curveTable3.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable3[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(tmcu, x / 255.0) * 255)));
curveTable3[x] = qMin(255, qMax(0, qRound(getCurveYValue(tmcu, x / 255.0) * 255)));
}
}
else if (cda == 3)
446,7 → 446,7
curveTable4.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable4[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(tmcu, x / 255.0) * 255)));
curveTable4[x] = qMin(255, qMax(0, qRound(getCurveYValue(tmcu, x / 255.0) * 255)));
}
}
}
552,7 → 552,7
s >> right;
lay.width = right - left;
s >> numChannels;
maxChannels = QMAX(maxChannels, numChannels);
maxChannels = qMax(maxChannels, numChannels);
if (numChannels > 6) // we don't support images with more than 6 channels yet
{
m_imageInfoRecord.layerInfo.clear();
841,12 → 841,12
bool createOk = false;
if (header.color_mode == CM_CMYK)
{
createOk = r2_image.create(layerInfo[layer].width, layerInfo[layer].height, QMAX(channel_num, 5));
createOk = r2_image.create(layerInfo[layer].width, layerInfo[layer].height, qMax(channel_num, 5));
r2_image.fill(0);
}
else
{
createOk = r2_image.create(layerInfo[layer].width, layerInfo[layer].height, QMAX(channel_num, 4));
createOk = r2_image.create(layerInfo[layer].width, layerInfo[layer].height, qMax(channel_num, 4));
r2_image.fill(0);
}
if( !createOk )
858,7 → 858,7
s.device()->at( base2 );
return false;
}
channel_num = QMIN(channel_num, 39);
channel_num = qMin(channel_num, 39);
uint components[40];
for(uint channel = 0; channel < channel_num; channel++)
{
1034,13 → 1034,13
{
unsigned char *s;
unsigned char *d;
for( int yi=static_cast<int>(startSrcY); yi < QMIN(r2_image.height(), r_image.height()); ++yi )
for( int yi=static_cast<int>(startSrcY); yi < qMin(r2_image.height(), r_image.height()); ++yi )
{
s = r2_image.scanLine( yi );
d = r_image.scanLine( QMIN(static_cast<int>(startDstY), r_image.height()-1) );
d += QMIN(static_cast<int>(startDstX), r_image.width()-1) * r_image.channels();
s += QMIN(static_cast<int>(startSrcX), r2_image.width()-1) * r2_image.channels();
for(int xi=static_cast<int>(startSrcX); xi < QMIN(r2_image.width(), r_image.width()); ++xi )
d = r_image.scanLine( qMin(static_cast<int>(startDstY), r_image.height()-1) );
d += qMin(static_cast<int>(startDstX), r_image.width()-1) * r_image.channels();
s += qMin(static_cast<int>(startSrcX), r2_image.width()-1) * r2_image.channels();
for(int xi=static_cast<int>(startSrcX); xi < qMin(r2_image.width(), r_image.width()); ++xi )
{
d[0] = s[0];
d[1] = s[1];
1077,19 → 1077,19
unsigned int maxDestX;
for (int i = static_cast<int>(startSrcY); i < layerInfo[layer].height; i++)
{
d = r_image.scanLine(QMIN(static_cast<int>(startDstY), r_image.height()-1));
s = r2_image.scanLine(QMIN(i, r2_image.height()-1));
d += QMIN(static_cast<int>(startDstX), r_image.width()-1) * r_image.channels();
s += QMIN(static_cast<int>(startSrcX), r2_image.width()-1) * r2_image.channels();
d = r_image.scanLine(qMin(static_cast<int>(startDstY), r_image.height()-1));
s = r2_image.scanLine(qMin(i, r2_image.height()-1));
d += qMin(static_cast<int>(startDstX), r_image.width()-1) * r_image.channels();
s += qMin(static_cast<int>(startSrcX), r2_image.width()-1) * r2_image.channels();
sm = 0;
if (hasMask)
{
sm = mask.scanLine(QMIN(i, mask.height()-1));
sm += QMIN(static_cast<int>(startSrcXm), mask.width()-1) * mask.channels();
sm = mask.scanLine(qMin(i, mask.height()-1));
sm += qMin(static_cast<int>(startSrcXm), mask.width()-1) * mask.channels();
}
startDstY++;
maxDestX = r_image.width() - startDstX + startSrcX - 1;
for (unsigned int j = startSrcX; j < QMIN(maxDestX, static_cast<unsigned int>(layerInfo[layer].width)); j++)
for (unsigned int j = startSrcX; j < qMin(maxDestX, static_cast<unsigned int>(layerInfo[layer].width)); j++)
{
src_r = s[0];
src_g = s[1];
1578,25 → 1578,25
if (colorTableSc.count() == 1)
{
colorTableSc[0].getRawRGBColor(&c, &m, &y);
ptr[0] = QMIN((c * curveTable1[(int)cbyte]) >> 8, 255);
ptr[1] = QMIN((m * curveTable1[(int)cbyte]) >> 8, 255);
ptr[2] = QMIN((y * curveTable1[(int)cbyte]) >> 8, 255);
ptr[0] = qMin((c * curveTable1[(int)cbyte]) >> 8, 255);
ptr[1] = qMin((m * curveTable1[(int)cbyte]) >> 8, 255);
ptr[2] = qMin((y * curveTable1[(int)cbyte]) >> 8, 255);
}
else if (colorTableSc.count() == 2)
{
ScColorEngine::getCMYKValues(colorTableSc[0], NULL, cmyk);
cmyk.getValues(c, m, y, k);
c = QMIN((c * curveTable1[(int)cb]) >> 8, 255);
m = QMIN((m * curveTable1[(int)cb]) >> 8, 255);
y = QMIN((y * curveTable1[(int)cb]) >> 8, 255);
k = QMIN((k * curveTable1[(int)cb]) >> 8, 255);
c = qMin((c * curveTable1[(int)cb]) >> 8, 255);
m = qMin((m * curveTable1[(int)cb]) >> 8, 255);
y = qMin((y * curveTable1[(int)cb]) >> 8, 255);
k = qMin((k * curveTable1[(int)cb]) >> 8, 255);
ScColorEngine::getCMYKValues(colorTableSc[1], NULL, cmyk);
cmyk.getValues(c1, m1, y1, k1);
c1 = QMIN((c1 * curveTable2[(int)cb]) >> 8, 255);
m1 = QMIN((m1 * curveTable2[(int)cb]) >> 8, 255);
y1 = QMIN((y1 * curveTable2[(int)cb]) >> 8, 255);
k1 = QMIN((k1 * curveTable2[(int)cb]) >> 8, 255);
col = ScColor(QMIN(c+c1, 255), QMIN(m+m1, 255), QMIN(y+y1, 255), QMIN(k+k1, 255));
c1 = qMin((c1 * curveTable2[(int)cb]) >> 8, 255);
m1 = qMin((m1 * curveTable2[(int)cb]) >> 8, 255);
y1 = qMin((y1 * curveTable2[(int)cb]) >> 8, 255);
k1 = qMin((k1 * curveTable2[(int)cb]) >> 8, 255);
col = ScColor(qMin(c+c1, 255), qMin(m+m1, 255), qMin(y+y1, 255), qMin(k+k1, 255));
col.getRawRGBColor(&c, &m, &y);
ptr[0] = c;
ptr[1] = m;
1606,23 → 1606,23
{
ScColorEngine::getCMYKValues(colorTableSc[0], NULL, cmyk);
cmyk.getValues(c, m, y, k);
c = QMIN((c * curveTable1[(int)cb]) >> 8, 255);
m = QMIN((m * curveTable1[(int)cb]) >> 8, 255);
y = QMIN((y * curveTable1[(int)cb]) >> 8, 255);
k = QMIN((k * curveTable1[(int)cb]) >> 8, 255);
c = qMin((c * curveTable1[(int)cb]) >> 8, 255);
m = qMin((m * curveTable1[(int)cb]) >> 8, 255);
y = qMin((y * curveTable1[(int)cb]) >> 8, 255);
k = qMin((k * curveTable1[(int)cb]) >> 8, 255);
ScColorEngine::getCMYKValues(colorTableSc[1], NULL, cmyk);
cmyk.getValues(c1, m1, y1, k1);
c1 = QMIN((c1 * curveTable2[(int)cb]) >> 8, 255);
m1 = QMIN((m1 * curveTable2[(int)cb]) >> 8, 255);
y1 = QMIN((y1 * curveTable2[(int)cb]) >> 8, 255);
k1 = QMIN((k1 * curveTable2[(int)cb]) >> 8, 255);
c1 = qMin((c1 * curveTable2[(int)cb]) >> 8, 255);
m1 = qMin((m1 * curveTable2[(int)cb]) >> 8, 255);
y1 = qMin((y1 * curveTable2[(int)cb]) >> 8, 255);
k1 = qMin((k1 * curveTable2[(int)cb]) >> 8, 255);
ScColorEngine::getCMYKValues(colorTableSc[2], NULL, cmyk);
cmyk.getValues(c2, m2, y2, k2);
c2 = QMIN((c2 * curveTable3[(int)cb]) >> 8, 255);
m2 = QMIN((m2 * curveTable3[(int)cb]) >> 8, 255);
y2 = QMIN((y2 * curveTable3[(int)cb]) >> 8, 255);
k2 = QMIN((k2 * curveTable3[(int)cb]) >> 8, 255);
col = ScColor(QMIN(c+c1+c2, 255), QMIN(m+m1+m2, 255), QMIN(y+y1+y2, 255), QMIN(k+k1+k2, 255));
c2 = qMin((c2 * curveTable3[(int)cb]) >> 8, 255);
m2 = qMin((m2 * curveTable3[(int)cb]) >> 8, 255);
y2 = qMin((y2 * curveTable3[(int)cb]) >> 8, 255);
k2 = qMin((k2 * curveTable3[(int)cb]) >> 8, 255);
col = ScColor(qMin(c+c1+c2, 255), qMin(m+m1+m2, 255), qMin(y+y1+y2, 255), qMin(k+k1+k2, 255));
col.getRawRGBColor(&c, &m, &y);
ptr[0] = c;
ptr[1] = m;
1632,29 → 1632,29
{
ScColorEngine::getCMYKValues(colorTableSc[0], NULL, cmyk);
cmyk.getValues(c, m, y, k);
c = QMIN((c * curveTable1[(int)cb]) >> 8, 255);
m = QMIN((m * curveTable1[(int)cb]) >> 8, 255);
y = QMIN((y * curveTable1[(int)cb]) >> 8, 255);
k = QMIN((k * curveTable1[(int)cb]) >> 8, 255);
c = qMin((c * curveTable1[(int)cb]) >> 8, 255);
m = qMin((m * curveTable1[(int)cb]) >> 8, 255);
y = qMin((y * curveTable1[(int)cb]) >> 8, 255);
k = qMin((k * curveTable1[(int)cb]) >> 8, 255);
ScColorEngine::getCMYKValues(colorTableSc[1], NULL, cmyk);
cmyk.getValues(c1, m1, y1, k1);
c1 = QMIN((c1 * curveTable2[(int)cb]) >> 8, 255);
m1 = QMIN((m1 * curveTable2[(int)cb]) >> 8, 255);
y1 = QMIN((y1 * curveTable2[(int)cb]) >> 8, 255);
k1 = QMIN((k1 * curveTable2[(int)cb]) >> 8, 255);
c1 = qMin((c1 * curveTable2[(int)cb]) >> 8, 255);
m1 = qMin((m1 * curveTable2[(int)cb]) >> 8, 255);
y1 = qMin((y1 * curveTable2[(int)cb]) >> 8, 255);
k1 = qMin((k1 * curveTable2[(int)cb]) >> 8, 255);
ScColorEngine::getCMYKValues(colorTableSc[2], NULL, cmyk);
cmyk.getValues(c2, m2, y2, k2);
c2 = QMIN((c2 * curveTable3[(int)cb]) >> 8, 255);
m2 = QMIN((m2 * curveTable3[(int)cb]) >> 8, 255);
y2 = QMIN((y2 * curveTable3[(int)cb]) >> 8, 255);
k2 = QMIN((k2 * curveTable3[(int)cb]) >> 8, 255);
c2 = qMin((c2 * curveTable3[(int)cb]) >> 8, 255);
m2 = qMin((m2 * curveTable3[(int)cb]) >> 8, 255);
y2 = qMin((y2 * curveTable3[(int)cb]) >> 8, 255);
k2 = qMin((k2 * curveTable3[(int)cb]) >> 8, 255);
ScColorEngine::getCMYKValues(colorTableSc[3], NULL, cmyk);
cmyk.getValues(c3, m3, y3, k3);
c3 = QMIN((c3 * curveTable4[(int)cb]) >> 8, 255);
m3 = QMIN((m3 * curveTable4[(int)cb]) >> 8, 255);
y3 = QMIN((y3 * curveTable4[(int)cb]) >> 8, 255);
k3 = QMIN((k3 * curveTable4[(int)cb]) >> 8, 255);
col = ScColor(QMIN(c+c1+c2+c3, 255), QMIN(m+m1+m2+m3, 255), QMIN(y+y1+y2+y3, 255), QMIN(k+k1+k2+k3, 255));
c3 = qMin((c3 * curveTable4[(int)cb]) >> 8, 255);
m3 = qMin((m3 * curveTable4[(int)cb]) >> 8, 255);
y3 = qMin((y3 * curveTable4[(int)cb]) >> 8, 255);
k3 = qMin((k3 * curveTable4[(int)cb]) >> 8, 255);
col = ScColor(qMin(c+c1+c2+c3, 255), qMin(m+m1+m2+m3, 255), qMin(y+y1+y2+y3, 255), qMin(k+k1+k2+k3, 255));
col.getRawRGBColor(&c, &m, &y);
ptr[0] = c;
ptr[1] = m;
/branches/Version135x/Scribus/scribus/colorutil.cpp
332,13 → 332,13
b = blue;
if ( r > g )
{
max = QMAX( r, b );
min = QMIN( g, b );
max = qMax( r, b );
min = qMin( g, b );
}
else
{
max = QMAX( g, b );
min = QMIN( r, b );
max = qMax( g, b );
min = qMin( r, b );
}
v = max;
if ( max != 0 )
427,8 → 427,8
double var_R = ( red / 255.0 );
double var_G = ( green / 255.0 );
double var_B = ( blue / 255.0 );
double var_Min = QMIN( var_R, QMIN(var_G, var_B) ); //Min. value of RGB
double var_Max = QMAX( var_R, QMAX(var_G, var_B) ); //Max. value of RGB
double var_Min = qMin( var_R, qMin(var_G, var_B) ); //Min. value of RGB
double var_Max = qMax( var_R, qMax(var_G, var_B) ); //Max. value of RGB
double del_Max = var_Max - var_Min; //Delta RGB value
double L = ( var_Max + var_Min ) / 2.0;
double H = 0;
595,8 → 595,8
void clipColor(double& red, double& green, double& blue)
{
double l = LumD(red, green, blue);
double n = QMIN(red, QMIN(green, blue));
double x = QMAX(red, QMAX(green, blue));
double n = qMin(red, qMin(green, blue));
double x = qMax(red, qMax(green, blue));
if (n < 0.0)
{
red = l + (((red - l) * l) / (l - n));
/branches/Version135x/Scribus/scribus/tabruler.cpp
59,9 → 59,9
else
{
Width = wid;
setMinimumSize(QSize(QMIN(static_cast<int>(Width), 400),25));
setMinimumSize(QSize(qMin(static_cast<int>(Width), 400),25));
setMaximumSize(QSize(4000,25));
resize(QMIN(static_cast<int>(wid), 400), 25);
resize(qMin(static_cast<int>(wid), 400), 25);
}
}
 
/branches/Version135x/Scribus/scribus/scpageoutput.cpp
535,12 → 535,12
if (style.underlineWidth() != -1)
lw = (style.underlineWidth() / 1000.0) * (style.fontSize() / 10.0);
else
lw = QMAX(style.font().strokeWidth(style.fontSize() / 10.0), 1);
lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1);
}
else
{
st = style.font().underlinePos(style.fontSize() / 10.0);
lw = QMAX(style.font().strokeWidth(style.fontSize() / 10.0), 1);
lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1);
}
if (style.baselineOffset() != 0)
st += (style.fontSize() / 10.0) * glyphs.scaleV * (style.baselineOffset() / 1000.0);
608,12 → 608,12
if (style.strikethruWidth() != -1)
lw = (style.strikethruWidth() / 1000.0) * (style.fontSize() / 10.0);
else
lw = QMAX(style.font().strokeWidth(style.fontSize() / 10.0), 1);
lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1);
}
else
{
st = style.font().strikeoutPos(style.fontSize() / 10.0);
lw = QMAX(style.font().strokeWidth(style.fontSize() / 10.0), 1);
lw = qMax(style.font().strokeWidth(style.fontSize() / 10.0), 1);
}
if (style.baselineOffset() != 0)
st += (style.fontSize() / 10.0) * glyphs.scaleV * (style.baselineOffset() / 1000.0);
712,13 → 712,13
break;
case Line:
case PolyLine:
embedded->m_lineWidth = pws * QMIN(hl->scale / 1000.0, hl->scalev / 1000.0);
embedded->m_lineWidth = pws * qMin(hl->scale / 1000.0, hl->scalev / 1000.0);
embedded->DrawObj_Item(p, e, sc);
break;
default:
break;
}
embedded->m_lineWidth = pws * QMIN(hl->scale / 1000.0, hl->scalev / 1000.0);
embedded->m_lineWidth = pws * qMin(hl->scale / 1000.0, hl->scalev / 1000.0);
embedded->DrawObj_Post(p);
*/
p->restore();
805,10 → 805,10
double kyb = (ipb.y() - it->gYpos) / patHeight;
double kyc = (ipc.y() - it->gYpos) / patHeight;
double kyd = (ipd.y() - it->gYpos) / patHeight;
int kxMin = floor( QMIN(QMIN(kxa, kxb), QMIN(kxc, kxd)) );
int kxMax = ceil ( QMAX(QMAX(kxa, kxb), QMAX(kxc, kxd)) );
int kyMin = floor( QMIN(QMIN(kya, kyb), QMIN(kyc, kyd)) );
int kyMax = ceil ( QMAX(QMAX(kya, kyb), QMAX(kyc, kyd)) );
int kxMin = floor( qMin(qMin(kxa, kxb), qMin(kxc, kxd)) );
int kxMax = ceil ( qMax(qMax(kxa, kxb), qMax(kxc, kxd)) );
int kyMin = floor( qMin(qMin(kya, kyb), qMin(kyc, kyd)) );
int kyMax = ceil ( qMax(qMax(kya, kyb), qMax(kyc, kyd)) );
 
double itx = it->xPos();
double ity = it->yPos();
/branches/Version135x/Scribus/scribus/extimageprops.cpp
231,7 → 231,7
Path.translate(-min.x(), -min.y());
FPoint max = Path.WidthHeight();
QMatrix mm;
mm.scale(34.0 / QMAX(max.x(), max.y()), 34.0 / QMAX(max.x(), max.y()));
mm.scale(34.0 / qMax(max.x(), max.y()), 34.0 / qMax(max.x(), max.y()));
Path.map(mm);
p->setupPolygon(&Path);
p->setPen(Qt::black);
/branches/Version135x/Scribus/scribus/pageitem.cpp
672,7 → 672,7
int PageItem::lastInFrame() const
{
#ifndef NLS_PROTO
return QMIN(signed(MaxChars), itemText.length()) - 1;
return qMin(signed(MaxChars), itemText.length()) - 1;
#else
return itemText.length() - 1;
#endif
871,7 → 871,7
void PageItem::setGridDistance(double) { } // FIXME
void PageItem::setColumns(int n)
{
Cols = QMAX(1, n); //FIXME: undo
Cols = qMax(1, n); //FIXME: undo
}
void PageItem::setColumnGap(double gap)
{
1283,13 → 1283,13
break;
case Line:
case PolyLine:
embedded->m_lineWidth = pws * QMIN(style.scaleH() / 1000.0, style.scaleV() / 1000.0);
embedded->m_lineWidth = pws * qMin(style.scaleH() / 1000.0, style.scaleV() / 1000.0);
embedded->DrawObj_Item(p, e, sc);
break;
default:
break;
}
embedded->m_lineWidth = pws * QMIN(style.scaleH() / 1000.0, style.scaleV() / 1000.0);
embedded->m_lineWidth = pws * qMin(style.scaleH() / 1000.0, style.scaleV() / 1000.0);
embedded->DrawObj_Post(p);
p->restore();
if (groupStack.count() != 0)
1374,7 → 1374,7
if (NamedLStyle.isEmpty())
{
lw2 = qRound(m_lineWidth * sc / 2.0);
lw = qRound(QMAX(m_lineWidth * sc, 1.0));
lw = qRound(qMax(m_lineWidth * sc, 1.0));
le = PLineEnd;
}
else
1381,7 → 1381,7
{
multiLine ml = m_Doc->MLineStyles[NamedLStyle];
lw2 = qRound(ml[ml.size()-1].Width * sc / 2.0);
lw = qRound(QMAX(ml[ml.size()-1].Width * sc, 1.0));
lw = qRound(qMax(ml[ml.size()-1].Width * sc, 1.0));
le = static_cast<Qt::PenCapStyle>(ml[ml.size()-1].LineEnd);
}
if (asLine())
1492,18 → 1492,18
pb.setPoint(3, FPoint(0.0, currItem->height(), currItem->xPos(), currItem->yPos(), currItem->rotation(), 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
minx = qMin(minx, pb.point(pc).x());
miny = qMin(miny, pb.point(pc).y());
maxx = qMax(maxx, pb.point(pc).x());
maxy = qMax(maxy, pb.point(pc).y());
}
}
else
{
minx = QMIN(minx, currItem->xPos());
miny = QMIN(miny, currItem->yPos());
maxx = QMAX(maxx, currItem->xPos() + currItem->width());
maxy = QMAX(maxy, currItem->yPos() + currItem->height());
minx = qMin(minx, currItem->xPos());
miny = qMin(miny, currItem->yPos());
maxx = qMax(maxx, currItem->xPos() + currItem->width());
maxy = qMax(maxy, currItem->yPos() + currItem->height());
}
}
}
1529,18 → 1529,18
pb.setPoint(3, FPoint(0.0, height(), xPos(), yPos(), rotation(), 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
minx = qMin(minx, pb.point(pc).x());
miny = qMin(miny, pb.point(pc).y());
maxx = qMax(maxx, pb.point(pc).x());
maxy = qMax(maxy, pb.point(pc).y());
}
}
else
{
minx = QMIN(minx, xPos());
miny = QMIN(miny, yPos());
maxx = QMAX(maxx, xPos() + width());
maxy = QMAX(maxy, yPos() + height());
minx = qMin(minx, xPos());
miny = qMin(miny, yPos());
maxx = qMax(maxx, xPos() + width());
maxy = qMax(maxy, yPos() + height());
}
gXpos = xPos() - minx;
gYpos = yPos() - miny;
1691,13 → 1691,13
{
retval -= asce * m_Doc->typographicSettings.valueSuperScript / 100.0;
layout.yoffset -= asce * m_Doc->typographicSettings.valueSuperScript / 100.0;
layout.scaleV = layout.scaleH = QMAX(m_Doc->typographicSettings.scalingSuperScript / 100.0, 10.0 / style.fontSize());
layout.scaleV = layout.scaleH = qMax(m_Doc->typographicSettings.scalingSuperScript / 100.0, 10.0 / style.fontSize());
}
else if (chst & ScStyle_Subscript)
{
retval += asce * m_Doc->typographicSettings.valueSubScript / 100.0;
layout.yoffset += asce * m_Doc->typographicSettings.valueSubScript / 100.0;
layout.scaleV = layout.scaleH = QMAX(m_Doc->typographicSettings.scalingSubScript / 100.0, 10.0 / style.fontSize());
layout.scaleV = layout.scaleH = qMax(m_Doc->typographicSettings.scalingSubScript / 100.0, 10.0 / style.fontSize());
}
else {
layout.scaleV = layout.scaleH = 1.0;
2102,7 → 2102,7
{
SetFarbe(&tmp, ml[it].Color, ml[it].Shade);
p->setPen(QPen(tmp,
QMAX(static_cast<int>(ml[it].Width* view->scale()), 1),
qMax(static_cast<int>(ml[it].Width* view->scale()), 1),
static_cast<Qt::PenStyle>(ml[it].Dash),
static_cast<Qt::PenCapStyle>(ml[it].LineEnd),
static_cast<Qt::PenJoinStyle>(ml[it].LineJoin)));
2120,7 → 2120,7
{
SetFarbe(&tmp, ml[it].Color, ml[it].Shade);
p->setPen(QPen(tmp,
QMAX(static_cast<int>(ml[it].Width* view->scale()), 1),
qMax(static_cast<int>(ml[it].Width* view->scale()), 1),
static_cast<Qt::PenStyle>(ml[it].Dash),
static_cast<Qt::PenCapStyle>(ml[it].LineEnd),
static_cast<Qt::PenJoinStyle>(ml[it].LineJoin)));
2139,7 → 2139,7
{
SetFarbe(&tmp, ml[it].Color, ml[it].Shade);
p->setPen(QPen(tmp,
QMAX(static_cast<int>(ml[it].Width*view->scale()), 1),
qMax(static_cast<int>(ml[it].Width*view->scale()), 1),
static_cast<Qt::PenStyle>(ml[it].Dash),
static_cast<Qt::PenCapStyle>(ml[it].LineEnd),
static_cast<Qt::PenJoinStyle>(ml[it].LineJoin)));
3767,7 → 3767,7
 
void PageItem::SetFrameRound()
{
setCornerRadius(QMIN(RadRect, QMIN(Width,Height)/2));
setCornerRadius(qMin(RadRect, qMin(Width,Height)/2));
PoLine.resize(0);
double rr = fabs(RadRect);
double bezierFactor=0.552284749; //Bezier Control Point Factor: 8/3*(sin(45)-0.5)
3817,10 → 3817,10
pb.addPoint(FPoint( 0.0, Height, Xpos, Ypos, Rot, 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
minx = qMin(minx, pb.point(pc).x());
miny = qMin(miny, pb.point(pc).y());
maxx = qMax(maxx, pb.point(pc).x());
maxy = qMax(maxy, pb.point(pc).y());
}
*x1 = minx;
*y1 = miny;
4160,8 → 4160,8
double ys = Height / static_cast<double>(OrigH);
if (AspectRatio)
{
LocalScX = QMIN(xs, ys);
LocalScY = QMIN(xs, ys);
LocalScX = qMin(xs, ys);
LocalScY = qMin(xs, ys);
}
else
{
4311,8 → 4311,8
const CharStyle& hl (itemText.charStyle(a));
int des = static_cast<int>(hl.font().descent(hl.fontSize() / 10.0));
int asc = static_cast<int>(hl.font().ascent(hl.fontSize() / 10.0));
asce = QMAX(asce, asc);
desc = QMAX(desc, des);
asce = qMax(asce, asc);
desc = qMax(desc, des);
}
setPolyClip(static_cast<int>(asce-BaseOffs), static_cast<int>(desc-BaseOffs));
}
4518,7 → 4518,7
{
if (m_Doc->appMode == modeDrawBezierLine)
return;
int ph = static_cast<int>(QMAX(1.0, lineWidth() / 2.0));
int ph = static_cast<int>(qMax(1.0, lineWidth() / 2.0));
switch (itemType())
{
case PageItem::Line:
/branches/Version135x/Scribus/scribus/scribusview.cpp
1303,10 → 1303,10
//Draw the grid lines
if (Doc->guidesSettings.gridShown)
{
double lowerBx = QMAX(clip.x() / Scale + Doc->minCanvasCoordinate.x() - page->xOffset(), 0);
double lowerBy = QMAX(clip.y() / Scale + Doc->minCanvasCoordinate.y() - page->yOffset(), 0);
double highBx = QMIN(lowerBx + clip.width() / Scale, pageWidth);
double highBy = QMIN(lowerBy + clip.height() / Scale, pageHeight);
double lowerBx = qMax(clip.x() / Scale + Doc->minCanvasCoordinate.x() - page->xOffset(), 0);
double lowerBy = qMax(clip.y() / Scale + Doc->minCanvasCoordinate.y() - page->yOffset(), 0);
double highBx = qMin(lowerBx + clip.width() / Scale, pageWidth);
double highBy = qMin(lowerBy + clip.height() / Scale, pageHeight);
if (Scale > 0.49)
{
double i,start;
1316,13 → 1316,13
start*=i;
for (double b = start; b <= highBy; b+=i)
{
p->drawLine(FPoint(QMAX(lowerBx, 0), b), FPoint(QMIN(pageWidth, highBx), b));
p->drawLine(FPoint(qMax(lowerBx, 0), b), FPoint(qMin(pageWidth, highBx), b));
}
start=floor(lowerBx/i);
start*=i;
for (double b = start; b <= highBx; b+=i)
{
p->drawLine(FPoint(b, QMAX(lowerBy, 0)), FPoint(b, QMIN(pageHeight, highBy)));
p->drawLine(FPoint(b, qMax(lowerBy, 0)), FPoint(b, qMin(pageHeight, highBy)));
}
i = Doc->guidesSettings.minorGrid;
p->setPen(Doc->guidesSettings.minorColor, lineWidth, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
1330,13 → 1330,13
start*=i;
for (double b = start; b <= highBy; b+=i)
{
p->drawLine(FPoint(QMAX(lowerBx, 0), b), FPoint(QMIN(pageWidth, highBx), b));
p->drawLine(FPoint(qMax(lowerBx, 0), b), FPoint(qMin(pageWidth, highBx), b));
}
start=floor(lowerBx/i);
start*=i;
for (double b = start; b <= highBx; b+=i)
{
p->drawLine(FPoint(b, QMAX(lowerBy, 0)), FPoint(b, QMIN(pageHeight, highBy)));
p->drawLine(FPoint(b, qMax(lowerBy, 0)), FPoint(b, qMin(pageHeight, highBy)));
}
}
}
3900,9 → 3900,9
scx = scx != scy ? scx / scy : 1.0;
if (currItem->itemText.length() != 0)
{
// currItem->setFontSize(QMAX(qRound(currItem->fontSize() * scy), 1));
// currItem->setFontSize(qMax(qRound(currItem->fontSize() * scy), 1));
// currItem->setLineSpacing(((currItem->fontSize() / 10.0)* static_cast<double>(Doc->typographicSettings.autoLineSpacing) / 100) + (currItem->fontSize() / 10.0));
// currItem->TxtScale = QMIN(QMAX(qRound(currItem->TxtScale * scx), 25), 400);
// currItem->TxtScale = qMin(qMax(qRound(currItem->TxtScale * scx), 25), 400);
/* Doc->currTextScale = currItem->TxtScale;
Doc->CurrFontSize = currItem->fontSize();
Doc->CurrTextBase = currItem->TxtBase;
3927,8 → 3927,8
#ifndef NLS_PROTO
for (int aa = 0; aa < currItem->itemText.length(); ++aa)
{
currItem->itemText.item(aa)->setFontSize(QMAX(qRound(currItem->itemText.item(aa)->fontSize()*scy), 1));
currItem->itemText.item(aa)->setScaleH(QMAX(QMIN(qRound(currItem->itemText.item(aa)->scaleH()*scx), 4000), 100));
currItem->itemText.item(aa)->setFontSize(qMax(qRound(currItem->itemText.item(aa)->fontSize()*scy), 1));
currItem->itemText.item(aa)->setScaleH(qMax(qMin(qRound(currItem->itemText.item(aa)->scaleH()*scx), 4000), 100));
}
#endif
}
4203,7 → 4203,7
p.end();
normalizeSelectionRect();
FPoint nx = translateToDoc(Mxp*sc, Myp*sc);
setScale(visibleWidth() / static_cast<double>(QMAX(abs(SeRx-Mxp), 1)));
setScale(visibleWidth() / static_cast<double>(qMax(abs(SeRx-Mxp), 1)));
slotDoZoom();
SetCPo(nx.x(), nx.y());
if (sc == Scale)
4281,7 → 4281,7
else
{
Doc->SizeItem(currItem->PoLine.WidthHeight().x(), currItem->PoLine.WidthHeight().y(), currItem->ItemNr, false, false, false);
// currItem->setPolyClip(qRound(QMAX(currItem->lineWidth() / 2, 1)));
// currItem->setPolyClip(qRound(qMax(currItem->lineWidth() / 2, 1)));
Doc->AdjustItemSize(currItem);
currItem->Sizing = ssiz;
currItem->ContourLine = currItem->PoLine.copy();
4305,7 → 4305,7
else
{
Doc->SizeItem(currItem->PoLine.WidthHeight().x(), currItem->PoLine.WidthHeight().y(), currItem->ItemNr, false, false);
// currItem->setPolyClip(qRound(QMAX(currItem->lineWidth() / 2.0, 1)));
// currItem->setPolyClip(qRound(qMax(currItem->lineWidth() / 2.0, 1)));
Doc->AdjustItemSize(currItem);
currItem->ContourLine = currItem->PoLine.copy();
}
5754,7 → 5754,7
currItem->ClipEdited = true;
edited = true;
Doc->EditClipMode = 0;
currItem->setPolyClip(qRound(QMAX(currItem->lineWidth() / 2.0, 1)));
currItem->setPolyClip(qRound(qMax(currItem->lineWidth() / 2.0, 1)));
emit PolyOpen();
}
}
6449,7 → 6449,7
Doc->MoveItem(0, npf2.y(), currItem);
}
Doc->SizeItem(currItem->PoLine.WidthHeight().x(), currItem->PoLine.WidthHeight().y(), currItem->ItemNr, false, false, false);
currItem->setPolyClip(qRound(QMAX(currItem->lineWidth() / 2, 1)));
currItem->setPolyClip(qRound(qMax(currItem->lineWidth() / 2, 1)));
currItem->paintObj();
break;
case modeInsertPDFButton:
6760,18 → 6760,18
// pb.setPoint(3, FPoint(0.0, currItem->height(), currItem->xPos(), currItem->yPos(), currItem->rotation(), 1.0, 1.0));
// for (uint pc = 0; pc < 4; ++pc)
// {
// minx = QMIN(minx, pb.point(pc).x());
// miny = QMIN(miny, pb.point(pc).y());
// maxx = QMAX(maxx, pb.point(pc).x());
// maxy = QMAX(maxy, pb.point(pc).y());
// minx = qMin(minx, pb.point(pc).x());
// miny = qMin(miny, pb.point(pc).y());
// maxx = qMax(maxx, pb.point(pc).x());
// maxy = qMax(maxy, pb.point(pc).y());
// }
// }
// else
// {
// minx = QMIN(minx, currItem->xPos());
// miny = QMIN(miny, currItem->yPos());
// maxx = QMAX(maxx, currItem->xPos() + currItem->width());
// maxy = QMAX(maxy, currItem->yPos() + currItem->height());
// minx = qMin(minx, currItem->xPos());
// miny = qMin(miny, currItem->yPos());
// maxx = qMax(maxx, currItem->xPos() + currItem->width());
// maxy = qMax(maxy, currItem->yPos() + currItem->height());
// }
// }
// GroupX = minx;
6886,10 → 6886,10
fpNew.map(matrix);
if (dx < 8.0) dx = 8.0;
if (dy < 8.0) dy = 8.0;
int grl = (int) floor( QMIN(fpNew.point(0).x(), fpNew.point(1).x()) - dx );
int grr = (int) ceil ( QMAX(fpNew.point(0).x(), fpNew.point(1).x()) + dx );
int grb = (int) ceil ( QMAX(fpNew.point(0).y(), fpNew.point(1).y()) + dy );
int grt = (int) floor( QMIN(fpNew.point(0).y(), fpNew.point(1).y()) - dy );
int grl = (int) floor( qMin(fpNew.point(0).x(), fpNew.point(1).x()) - dx );
int grr = (int) ceil ( qMax(fpNew.point(0).x(), fpNew.point(1).x()) + dx );
int grb = (int) ceil ( qMax(fpNew.point(0).y(), fpNew.point(1).y()) + dy );
int grt = (int) floor( qMin(fpNew.point(0).y(), fpNew.point(1).y()) - dy );
rect |= QRect(grl, grt, grr-grl, grb-grt);
updateContents(rect);
}
7660,11 → 7660,11
// /*
// if (!currItem->asLine())
// {
// newX = QMAX(newX, 1);
// newY = QMAX(newY, 1);
// newX = qMax(newX, 1);
// newY = qMax(newY, 1);
// }
// */
// int ph = static_cast<int>(QMAX(1.0, currItem->lineWidth() / 2.0));
// int ph = static_cast<int>(qMax(1.0, currItem->lineWidth() / 2.0));
// QWMatrix ma;
// ma.rotate(currItem->rotation());
// double dX = ma.m11() * (currItem->width() - newX) + ma.m21() * (currItem->height() - newY) + ma.dx();
7684,7 → 7684,7
// moveY=0.0;
// Doc->MoveItem(moveX, moveY, currItem);
// }
// currItem->setCornerRadius(QMIN(currItem->cornerRadius(), QMIN(currItem->width(),currItem->height())/2));
// currItem->setCornerRadius(qMin(currItem->cornerRadius(), qMin(currItem->width(),currItem->height())/2));
// if ((currItem->asImageFrame()) && (!currItem->Sizing) && (!Doc->EditClip))
// {
// currItem->AdjustPictScale();
7900,7 → 7900,7
if (currItem->NamedLStyle.isEmpty())
{
lw2 = qRound(currItem->lineWidth() / 2.0);
lw = qRound(QMAX(currItem->lineWidth(), 1.0));
lw = qRound(qMax(currItem->lineWidth(), 1.0));
le = currItem->PLineEnd;
}
else
7907,7 → 7907,7
{
multiLine ml = Doc->MLineStyles[currItem->NamedLStyle];
lw2 = qRound(ml[ml.size()-1].Width / 2.0);
lw = qRound(QMAX(ml[ml.size()-1].Width, 1.0));
lw = qRound(qMax(ml[ml.size()-1].Width, 1.0));
le = static_cast<Qt::PenCapStyle>(ml[ml.size()-1].LineEnd);
}
if (le != Qt::FlatCap)
7945,8 → 7945,8
PenCapStyle le = Qt::FlatCap;
if (currItem->NamedLStyle.isEmpty())
{
lw2 = qRound(QMAX(currItem->lineWidth() / 2.0, 1.0));
lw = qRound(QMAX(currItem->lineWidth(), 1.0));
lw2 = qRound(qMax(currItem->lineWidth() / 2.0, 1.0));
lw = qRound(qMax(currItem->lineWidth(), 1.0));
le = currItem->PLineEnd;
}
else
7953,7 → 7953,7
{
multiLine ml = Doc->MLineStyles[currItem->NamedLStyle];
lw2 = qRound(ml[ml.size()-1].Width / 2.0);
lw = qRound(QMAX(ml[ml.size()-1].Width, 1.0));
lw = qRound(qMax(ml[ml.size()-1].Width, 1.0));
le = static_cast<Qt::PenCapStyle>(ml[ml.size()-1].LineEnd);
}
if (le != Qt::FlatCap)
8106,7 → 8106,7
h -= g;
FPoint h1(h.x(), h.y(), 0, 0, 0, scx, scy);
if (bb->Groups.count() != 0) // change the LineWidth only when the item is within a real Group
bb->setLineWidth(QMAX(bb->lineWidth()*((scx+scy)/2), 0.01));
bb->setLineWidth(qMax(bb->lineWidth()*((scx+scy)/2), 0.01));
if (bb->itemType() == PageItem::Line)
{
bb->setRotation(atan2(t1.y()-b1.y(),t1.x()-b1.x())*(180.0/M_PI));
8145,12 → 8145,12
if (scaleText)
{
#ifndef NLS_PROTO
// bb->setFontSize(QMAX(qRound(bb->fontSize()*((scx+scy)/2)), 1));
// bb->setFontSize(qMax(qRound(bb->fontSize()*((scx+scy)/2)), 1));
if ((bb->itemText.length() != 0) && (!bb->isTableItem))
{
// bb->setLineSpacing(((bb->fontSize() / 10.0) * static_cast<double>(Doc->typographicSettings.autoLineSpacing) / 100) + (bb->fontSize() / 10.0));
for (aa = 0; aa < bb->itemText.length(); ++aa)
bb->itemText.item(aa)->setFontSize(QMAX(qRound(bb->itemText.item(aa)->fontSize()*((scx+scy)/2)), 1));
bb->itemText.item(aa)->setFontSize(qMax(qRound(bb->itemText.item(aa)->fontSize()*((scx+scy)/2)), 1));
if (bb->asPathText())
bb->updatePolyClip();
}
8299,7 → 8299,7
// currItem->ClipEdited = true;
// currItem->PoLine = Clip.copy();
// if (currItem->asPolyLine())
// currItem->setPolyClip(qRound(QMAX(currItem->lineWidth() / 2, 1)));
// currItem->setPolyClip(qRound(qMax(currItem->lineWidth() / 2, 1)));
// else
// currItem->Clip = FlattenPath(currItem->PoLine, currItem->Segments);
// currItem->Sizing = siz;
8624,7 → 8624,7
if (currItem->invalid)
return;
// textframe->lastTextItem = QMIN(textframe->lastTextItem,
// textframe->lastTextItem = qMin(textframe->lastTextItem,
// signed(textframe->itemText.nrOfItems()) - 1);
if (textframe->firstInFrame() >= 0
8679,8 → 8679,8
else if (textframe->CPos > textframe->itemText.endOfItem(textframe->lastInFrame())
|| textframe->CPos >= textframe->itemText.length())
{
FRect bbox = textframe->itemText.boundingBox(QMAX(0,QMIN(textframe->lastInFrame(), textframe->itemText.length()-1)));
x = static_cast<int>(bbox.x() + textframe->itemText.item(QMAX(0,QMIN(textframe->lastInFrame(), textframe->itemText.length()-1)))->glyph.wide());
FRect bbox = textframe->itemText.boundingBox(qMax(0,qMin(textframe->lastInFrame(), textframe->itemText.length()-1)));
x = static_cast<int>(bbox.x() + textframe->itemText.item(qMax(0,qMin(textframe->lastInFrame(), textframe->itemText.length()-1)))->glyph.wide());
y = static_cast<int>(bbox.y());
if (bbox.height() <= 2)
y1 = static_cast<int>(bbox.y() + textframe->itemText.defaultStyle().charStyle().fontSize() / 30);
8704,8 → 8704,8
p.setRasterOp(XorROP);
if (draw)
{
p.drawLine(x, QMIN(QMAX(y,0),static_cast<int>(currItem->height())),
x, QMIN(QMAX(y1,0),static_cast<int>(currItem->height())));
p.drawLine(x, qMin(qMax(y,0),static_cast<int>(currItem->height())),
x, qMin(qMax(y1,0),static_cast<int>(currItem->height())));
m_cursorVisible = !m_cursorVisible;
if (Doc->CurTimer != 0)
{
8718,8 → 8718,8
if (Doc->CurTimer != 0)
Doc->CurTimer->stop();
if (m_cursorVisible)
p.drawLine(x, QMIN(QMAX(y,0),static_cast<int>(currItem->height())),
x, QMIN(QMAX(y1,0),static_cast<int>(currItem->height())));
p.drawLine(x, qMin(qMax(y,0),static_cast<int>(currItem->height())),
x, qMin(qMax(y1,0),static_cast<int>(currItem->height())));
m_cursorVisible = false;
}
p.end();
9584,8 → 9584,8
currItem = Doc->m_Selection->itemAt(c);
if (currItem->isTableItem && currItem->isSingleSel)
return;
low = QMIN(currItem->ItemNr, low);
high = QMAX(currItem->ItemNr, high);
low = qMin(currItem->ItemNr, low);
high = qMax(currItem->ItemNr, high);
}
if (low == 0)
return;
9641,8 → 9641,8
currItem = Doc->m_Selection->itemAt(c);
if (currItem->isTableItem && currItem->isSingleSel)
return;
low = QMIN(currItem->ItemNr, low);
high = QMAX(currItem->ItemNr, high);
low = qMin(currItem->ItemNr, low);
high = qMax(currItem->ItemNr, high);
}
if (high == Doc->Items->count()-1)
return;
9996,9 → 9996,9
disconnect(this, SIGNAL(contentsMoving(int, int)), this, SLOT(setRulerPos(int, int)));
int oldDX = contentsX();
int oldDY = contentsY();
int nw = QMAX(qRound(width * Scale), contentsWidth() + qRound(dX * Scale) * 2);
int nh = QMAX(qRound(height * Scale), contentsHeight() + qRound(dY * Scale) * 2);
resizeContents(QMAX(nw, visibleWidth() + qRound(dX * Scale) * 2), QMAX(nh, visibleHeight() + qRound(dY * Scale) * 2));
int nw = qMax(qRound(width * Scale), contentsWidth() + qRound(dX * Scale) * 2);
int nh = qMax(qRound(height * Scale), contentsHeight() + qRound(dY * Scale) * 2);
resizeContents(qMax(nw, visibleWidth() + qRound(dX * Scale) * 2), qMax(nh, visibleHeight() + qRound(dY * Scale) * 2));
setContentsPos(oldDX + qRound(dX * Scale), oldDY + qRound(dY * Scale));
setRulerPos(contentsX(), contentsY());
connect(this, SIGNAL(contentsMoving(int, int)), this, SLOT(setRulerPos(int, int)));
10028,8 → 10028,8
return;
}
updatesOn(false);
int nw = QMAX(qRound((Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()) * Scale), visibleWidth());
int nh = QMAX(qRound((Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()) * Scale), visibleHeight());
int nw = qMax(qRound((Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()) * Scale), visibleWidth());
int nh = qMax(qRound((Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()) * Scale), visibleHeight());
resizeContents(nw, nh);
if (Doc->m_Selection->count() != 0)
{
10045,10 → 10045,10
 
void ScribusView::setZoom()
{
int x = qRound(QMAX(contentsX() / Scale, 0));
int y = qRound(QMAX(contentsY() / Scale, 0));
int w = qRound(QMIN(visibleWidth() / Scale, Doc->currentPage()->width()));
int h = qRound(QMIN(visibleHeight() / Scale, Doc->currentPage()->height()));
int x = qRound(qMax(contentsX() / Scale, 0));
int y = qRound(qMax(contentsY() / Scale, 0));
int w = qRound(qMin(visibleWidth() / Scale, Doc->currentPage()->width()));
int h = qRound(qMin(visibleHeight() / Scale, Doc->currentPage()->height()));
rememberOldZoomLocation(w / 2 + x,h / 2 + y);
setScale(zoomSpinBox->value() / 100.0 * Prefs->DisScale);
slotDoZoom();
10057,10 → 10057,10
 
void ScribusView::slotZoom100()
{
int x = qRound(QMAX(contentsX() / Scale, Doc->minCanvasCoordinate.x()));
int y = qRound(QMAX(contentsY() / Scale, Doc->minCanvasCoordinate.y()));
int w = qRound(QMIN(visibleWidth() / Scale, Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()));
int h = qRound(QMIN(visibleHeight() / Scale, Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()));
int x = qRound(qMax(contentsX() / Scale, Doc->minCanvasCoordinate.x()));
int y = qRound(qMax(contentsY() / Scale, Doc->minCanvasCoordinate.y()));
int w = qRound(qMin(visibleWidth() / Scale, Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()));
int h = qRound(qMin(visibleHeight() / Scale, Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()));
rememberOldZoomLocation(w / 2 + x,h / 2 + y);
setScale(Prefs->DisScale);
reformPages(false);
10071,10 → 10071,10
{
if ((mx == 0) && (my == 0))
{
int x = qRound(QMAX(contentsX() / Scale, Doc->minCanvasCoordinate.x()));
int y = qRound(QMAX(contentsY() / Scale, Doc->minCanvasCoordinate.y()));
int w = qRound(QMIN(visibleWidth() / Scale, Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()));
int h = qRound(QMIN(visibleHeight() / Scale, Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()));
int x = qRound(qMax(contentsX() / Scale, Doc->minCanvasCoordinate.x()));
int y = qRound(qMax(contentsY() / Scale, Doc->minCanvasCoordinate.y()));
int w = qRound(qMin(visibleWidth() / Scale, Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()));
int h = qRound(qMin(visibleHeight() / Scale, Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()));
rememberOldZoomLocation(w/2+x, h/2+y);
}
else
10088,10 → 10088,10
{
if ((mx == 0) && (my == 0))
{
int x = qRound(QMAX(contentsX() / Scale, Doc->minCanvasCoordinate.x()));
int y = qRound(QMAX(contentsY() / Scale, Doc->minCanvasCoordinate.y()));
int w = qRound(QMIN(visibleWidth() / Scale, Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()));
int h = qRound(QMIN(visibleHeight() / Scale, Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()));
int x = qRound(qMax(contentsX() / Scale, Doc->minCanvasCoordinate.x()));
int y = qRound(qMax(contentsY() / Scale, Doc->minCanvasCoordinate.y()));
int w = qRound(qMin(visibleWidth() / Scale, Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()));
int h = qRound(qMin(visibleHeight() / Scale, Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()));
rememberOldZoomLocation(w/2+x, h/2+y);
}
else
10333,7 → 10333,7
QImage im;
double sx = maxGr / Doc->Pages->at(Nr)->width();
double sy = maxGr / Doc->Pages->at(Nr)->height();
double sc = QMIN(sx, sy);
double sc = qMin(sx, sy);
int clipx = static_cast<int>(Doc->Pages->at(Nr)->xOffset() * sc);
int clipy = static_cast<int>(Doc->Pages->at(Nr)->yOffset() * sc);
int clipw = qRound(Doc->Pages->at(Nr)->width() * sc);
10857,12 → 10857,12
if (it == NULL)
nstyle.setScaleH(1000);
else
nstyle.setScaleH(QMIN(QMAX((*it).toInt(), 100), 4000));
nstyle.setScaleH(qMin(qMax((*it).toInt(), 100), 4000));
it++;
if (it == NULL)
nstyle.setScaleV(1000);
else
nstyle.setScaleV(QMIN(QMAX((*it).toInt(), 100), 4000));
nstyle.setScaleV(qMin(qMax((*it).toInt(), 100), 4000));
it++;
nstyle.setBaselineOffset(it == NULL ? 0 : (*it).toInt());
it++;
11033,7 → 11033,7
}
else
{
int ph = static_cast<int>(QMAX(1.0, currItem->lineWidth() / 2.0));
int ph = static_cast<int>(qMax(1.0, currItem->lineWidth() / 2.0));
currItem->Segments.clear();
currItem->PoLine.resize(0);
currItem->Clip.setPoints(4, -ph,-ph, static_cast<int>(currItem->width()+ph),-ph,
11319,7 → 11319,7
{
if (chstr.upper() != chstr)
{
chs = QMAX(static_cast<int>(hl->fontSize() * Doc->typographicSettings.valueSmallCaps / 100), 1);
chs = qMax(static_cast<int>(hl->fontSize() * Doc->typographicSettings.valueSmallCaps / 100), 1);
chstr = chstr.upper();
}
}
11428,7 → 11428,7
{
if (chstr.upper() != chstr)
{
chs = QMAX(static_cast<int>(hl->fontSize() * Doc->typographicSettings.valueSmallCaps / 100), 1);
chs = qMax(static_cast<int>(hl->fontSize() * Doc->typographicSettings.valueSmallCaps / 100), 1);
chstr = chstr.upper();
}
}
11454,12 → 11454,12
if (charStyle.underlineWidth() != -1)
lw = (charStyle.underlineWidth() / 1000.0) * (charStyle.fontSize() / 10.0);
else
lw = QMAX(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1);
lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1);
}
else
{
st = charStyle.font().underlinePos(charStyle.fontSize() / 10.0);
lw = QMAX(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1);
lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1);
}
if (charStyle.baselineOffset() != 0)
st += (charStyle.fontSize() / 10.0) * hl->glyph.scaleV * (charStyle.baselineOffset() / 1000.0);
11577,12 → 11577,12
if (charStyle.strikethruWidth() != -1)
lw = (charStyle.strikethruWidth() / 1000.0) * (charStyle.fontSize() / 10.0);
else
lw = QMAX(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1);
lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1);
}
else
{
st = charStyle.font().strikeoutPos(charStyle.fontSize() / 10.0);
lw = QMAX(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1);
lw = qMax(charStyle.font().strokeWidth(charStyle.fontSize() / 10.0), 1);
}
if (charStyle.baselineOffset() != 0)
st += (charStyle.fontSize() / 10.0) * hl->glyph.scaleV * (charStyle.baselineOffset() / 1000.0);
11636,7 → 11636,7
bb->ClipEdited = true;
bb->FrameType = 3;
bb->setRotation(currItem->rotation());
// bb->setPolyClip(qRound(QMAX(bb->lineWidth() / 2, 1)));
// bb->setPolyClip(qRound(qMax(bb->lineWidth() / 2, 1)));
Doc->AdjustItemSize(bb);
newGroupedItems.append(Doc->Items->take(z));
}
/branches/Version135x/Scribus/scribus/pageitem_textframe.cpp
403,7 → 403,7
double endOfLine(const QRegion& shape, const QPainter& pf2, double ascent, double descent, double morespace = 0)
{
double EndX = floor(QMAX(line.x, breakXPos - 1));
double EndX = floor(qMax(line.x, breakXPos - 1));
QPoint pt1, pt2;
// qDebug(QString("endx start=%1, hl is '%2'").arg(EndX).arg(hl->ch));
do {
497,7 → 497,7
leftCorr -= itemText.charStyle(b).font().charWidth(QChar(' '), chs / 10.0);
// double leftCorr2 = itemText.charStyle(a).font().charWidth(QChar('K'), chs / 10.0, chr);
// leftCorr2 -= itemText.charStyle(a).font().charWidth(QChar('K'), chs / 10.0);
// leftCorr = QMIN(leftCorr, leftCorr2);
// leftCorr = qMin(leftCorr, leftCorr2);
}
return leftCorr;
}
1218,11 → 1218,11
else if (tabs.active && tabs.status == TabCENTER) // center tab
{
current.xPos += (wide+kernVal) / 2;
current.xPos = QMAX(current.xPos, current.colLeft);
current.xPos = qMax(current.xPos, current.colLeft);
}
else // other tabs.active
{
current.xPos = QMAX(current.xPos, current.colLeft);
current.xPos = qMax(current.xPos, current.colLeft);
}
1325,7 → 1325,7
current.xPos += style.dropCapOffset();
hl->glyph.xadvance += style.dropCapOffset();
// qDebug(QString("dropcapoffset: %1 -> %2").arg(current.xPos-style.dropCapOffset()).arg(current.xPos));
current.xPos = QMAX(current.xPos, current.colLeft);
current.xPos = qMax(current.xPos, current.colLeft);
maxDX = current.xPos;
Q3PointArray tcli(4);
if (style.lineSpacingMode() == ParagraphStyle::BaselineGridLineSpacing)
1565,7 → 1565,7
break;
}
current.xPos--;
current.xPos = QMAX(current.xPos, current.colLeft);
current.xPos = qMax(current.xPos, current.colLeft);
}
}
else
1620,7 → 1620,7
if ((itemText.text(current.line.firstItem) == SpecialChars::PARSEP) || (itemText.text(current.line.firstItem) == SpecialChars::LINEBREAK))
currasce = itemText.charStyle(current.line.firstItem).font().ascent(itemText.charStyle(current.line.firstItem).fontSize() / 10.0);
else if (itemText.object(current.line.firstItem) != 0)
currasce = QMAX(currasce, (itemText.object(current.line.firstItem)->gHeight + itemText.object(current.line.firstItem)->lineWidth()) * (itemText.charStyle(current.line.firstItem).scaleV() / 1000.0));
currasce = qMax(currasce, (itemText.object(current.line.firstItem)->gHeight + itemText.object(current.line.firstItem)->lineWidth()) * (itemText.charStyle(current.line.firstItem).scaleV() / 1000.0));
else //if (itemText.charStyle(current.line.firstItem).effects() & ScStyle_DropCap == 0)
currasce = itemText.charStyle(current.line.firstItem).font().realCharAscent(itemText.text(current.line.firstItem), itemText.charStyle(current.line.firstItem).fontSize() / 10.0);
for (int zc = 0; zc < current.itemsInLine; ++zc)
1633,9 → 1633,9
|| (ch == SpecialChars::FRAMEBREAK) || (ch == SpecialChars::NBSPACE))
continue;
if (itemText.object(current.line.firstItem + zc) != 0)
currasce = QMAX(currasce, (itemText.object(current.line.firstItem + zc)->gHeight + itemText.object(current.line.firstItem + zc)->lineWidth()) * (cStyle.scaleV() / 1000.0));
currasce = qMax(currasce, (itemText.object(current.line.firstItem + zc)->gHeight + itemText.object(current.line.firstItem + zc)->lineWidth()) * (cStyle.scaleV() / 1000.0));
else //if (itemText.charStyle(current.line.firstItem + zc).effects() & ScStyle_DropCap == 0)
currasce = QMAX(currasce, cStyle.font().realCharAscent(ch, cStyle.fontSize() / 10.0));
currasce = qMax(currasce, cStyle.font().realCharAscent(ch, cStyle.fontSize() / 10.0));
}
double adj = firstasce - currasce;
current.line.ascent = currasce;
1648,7 → 1648,7
double firstasce = style.lineSpacing();
double currasce = 0;
if (itemText.object(current.line.firstItem) != 0)
currasce = QMAX(currasce, (itemText.object(current.line.firstItem)->gHeight + itemText.object(current.line.firstItem)->lineWidth()) * (itemText.charStyle(current.line.firstItem).scaleV() / 1000.0));
currasce = qMax(currasce, (itemText.object(current.line.firstItem)->gHeight + itemText.object(current.line.firstItem)->lineWidth()) * (itemText.charStyle(current.line.firstItem).scaleV() / 1000.0));
else //if (itemText.charStyle(current.line.firstItem).effects() & ScStyle_DropCap == 0)
currasce = itemText.charStyle(current.line.firstItem).font().height(itemText.charStyle(current.line.firstItem).fontSize() / 10.0);
for (int zc = 0; zc < current.itemsInLine; ++zc)
1660,9 → 1660,9
|| (ch == SpecialChars::LINEBREAK) || (ch == SpecialChars::NBSPACE))
continue;
if (itemText.object(current.line.firstItem + zc) != 0)
currasce = QMAX(currasce, (itemText.object(current.line.firstItem + zc)->gHeight + itemText.object(current.line.firstItem + zc)->lineWidth()) * (itemText.charStyle(current.line.firstItem + zc).scaleV() / 1000.0));
currasce = qMax(currasce, (itemText.object(current.line.firstItem + zc)->gHeight + itemText.object(current.line.firstItem + zc)->lineWidth()) * (itemText.charStyle(current.line.firstItem + zc).scaleV() / 1000.0));
else //if (itemText.charStyle(current.line.firstItem + zc).effects() & ScStyle_DropCap == 0)
currasce = QMAX(currasce, itemText.charStyle(current.line.firstItem + zc).font().height(itemText.charStyle(current.line.firstItem + zc).fontSize() / 10.0));
currasce = qMax(currasce, itemText.charStyle(current.line.firstItem + zc).font().height(itemText.charStyle(current.line.firstItem + zc).fontSize() / 10.0));
}
double adj = firstasce - currasce;
1794,7 → 1794,7
if ((itemText.text(current.line.firstItem) == SpecialChars::PARSEP) || (itemText.text(current.line.firstItem) == SpecialChars::LINEBREAK))
currasce = itemText.charStyle(current.line.firstItem).font().ascent(itemText.charStyle(current.line.firstItem).fontSize() / 10.0);
else if (itemText.object(current.line.firstItem) != 0)
currasce = QMAX(currasce, (itemText.object(current.line.firstItem)->gHeight + itemText.object(current.line.firstItem)->lineWidth()) * (itemText.charStyle(current.line.firstItem).scaleV() / 1000.0));
currasce = qMax(currasce, (itemText.object(current.line.firstItem)->gHeight + itemText.object(current.line.firstItem)->lineWidth()) * (itemText.charStyle(current.line.firstItem).scaleV() / 1000.0));
else //if (itemText.charStyle(current.line.firstItem).effects() & ScStyle_DropCap == 0)
currasce = itemText.charStyle(current.line.firstItem).font().realCharAscent(itemText.text(current.line.firstItem), itemText.charStyle(current.line.firstItem).fontSize() / 10.0);
for (int zc = 0; zc < current.itemsInLine; ++zc)
1805,9 → 1805,9
|| (itemText.text(current.line.firstItem+zc) == SpecialChars::LINEBREAK) || (itemText.text(current.line.firstItem+zc) == SpecialChars::NBSPACE))
continue;
if (itemText.object(current.line.firstItem+zc) != 0)
currasce = QMAX(currasce, (itemText.object(current.line.firstItem+zc)->gHeight + itemText.object(current.line.firstItem+zc)->lineWidth()) * itemText.charStyle(current.line.firstItem+zc).scaleV() / 1000.0);
currasce = qMax(currasce, (itemText.object(current.line.firstItem+zc)->gHeight + itemText.object(current.line.firstItem+zc)->lineWidth()) * itemText.charStyle(current.line.firstItem+zc).scaleV() / 1000.0);
else //if (itemText.charStyle(current.line.firstItem+zc).effects() & ScStyle_DropCap == 0)
currasce = QMAX(currasce, itemText.charStyle(current.line.firstItem+zc).font().realCharAscent(itemText.text(current.line.firstItem+zc), itemText.charStyle(current.line.firstItem+zc).fontSize() / 10.0));
currasce = qMax(currasce, itemText.charStyle(current.line.firstItem+zc).font().realCharAscent(itemText.text(current.line.firstItem+zc), itemText.charStyle(current.line.firstItem+zc).fontSize() / 10.0));
}
double adj = firstasce - currasce;
current.line.ascent = currasce;
1819,7 → 1819,7
double firstasce = style.lineSpacing();
double currasce = 0;
if (itemText.object(current.line.firstItem) != 0)
currasce = QMAX(currasce, (itemText.object(current.line.firstItem)->gHeight + itemText.object(current.line.firstItem)->lineWidth()) * (itemText.charStyle(current.line.firstItem).scaleV() / 1000.0));
currasce = qMax(currasce, (itemText.object(current.line.firstItem)->gHeight + itemText.object(current.line.firstItem)->lineWidth()) * (itemText.charStyle(current.line.firstItem).scaleV() / 1000.0));
else //if (itemText.charStyle(current.line.firstItem).effects() & ScStyle_DropCap == 0)
currasce = itemText.charStyle(current.line.firstItem).font().height(itemText.charStyle(current.line.firstItem).fontSize() / 10.0);
for (int zc = 0; zc < current.itemsInLine; ++zc)
1830,9 → 1830,9
|| (itemText.text(current.line.firstItem+zc) == SpecialChars::LINEBREAK) || (itemText.text(current.line.firstItem+zc) == SpecialChars::NBSPACE))
continue;
if (itemText.object(current.line.firstItem+zc) != 0)
currasce = QMAX(currasce, (itemText.object(current.line.firstItem+zc)->gHeight + itemText.object(current.line.firstItem+zc)->lineWidth()) * (itemText.charStyle(current.line.firstItem+zc).scaleV() / 1000.0));
currasce = qMax(currasce, (itemText.object(current.line.firstItem+zc)->gHeight + itemText.object(current.line.firstItem+zc)->lineWidth()) * (itemText.charStyle(current.line.firstItem+zc).scaleV() / 1000.0));
else //if (itemText.charStyle(current.line.firstItem+zc).effects() & ScStyle_DropCap == 0)
currasce = QMAX(currasce, itemText.charStyle(current.line.firstItem+zc).font().height(itemText.charStyle(current.line.firstItem+zc).fontSize() / 10.0));
currasce = qMax(currasce, itemText.charStyle(current.line.firstItem+zc).font().height(itemText.charStyle(current.line.firstItem+zc).fontSize() / 10.0));
}
double adj = firstasce - currasce;
current.line.ascent = currasce;
1882,7 → 1882,7
if (m_Doc->appMode == modeEdit)
{
// OwnPage->Deselect(true);
next->CPos = QMAX(nCP, signed(MaxChars));
next->CPos = qMax(nCP, signed(MaxChars));
// Doc->currentPage = NextBox->OwnPage;
// NextBox->OwnPage->SelectItemNr(NextBox->ItemNr);
// qDebug("textframe: len=%d, leaving relayout in editmode && Tinput", itemText.length());
2166,7 → 2166,7
}
if ((!isEmbedded) && (!m_Doc->RePos))
{
double scpInv = 1.0 / (QMAX(view->scale(), 1.0));
double scpInv = 1.0 / (qMax(view->scale(), 1.0));
if ((Frame) && (m_Doc->guidesSettings.framesShown) && ((itemType() == ImageFrame) || (itemType() == TextFrame) || (itemType() == PathText)))
{
p->setPen(PrefsManager::instance()->appPrefs.DFrameNormColor, scpInv, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
2629,7 → 2629,7
// Tinput = false;
if ((cr == QChar(13)) && (itemText.length() != 0))
{
// m_Doc->chAbStyle(this, findParagraphStyle(m_Doc, itemText.paragraphStyle(QMAX(CPos-1,0))));
// m_Doc->chAbStyle(this, findParagraphStyle(m_Doc, itemText.paragraphStyle(qMax(CPos-1,0))));
// Tinput = false;
}
m_Doc->scMW()->setTBvals(this);
2648,7 → 2648,7
}
if (itemText.length() == 0)
break;
cr = itemText.text(QMAX(CPos-1,0),1);
cr = itemText.text(qMax(CPos-1,0),1);
if (itemText.lengthOfSelection() == 0)
{
--CPos;
2658,7 → 2658,7
// Tinput = false;
if ((cr == QChar(13)) && (itemText.length() != 0))
{
// m_Doc->chAbStyle(this, findParagraphStyle(m_Doc, itemText.paragraphStyle(QMAX(CPos-1,0))));
// m_Doc->chAbStyle(this, findParagraphStyle(m_Doc, itemText.paragraphStyle(qMax(CPos-1,0))));
// Tinput = false;
}
m_Doc->scMW()->setTBvals(this);
2925,7 → 2925,7
void PageItem_TextFrame::drawOverflowMarker(ScPainter *p)
{
/*CB Old large corner indicator.
double scp1 = 1.0/QMAX(ScMW->view->getScale(), 1);
double scp1 = 1.0/qMax(ScMW->view->getScale(), 1);
double scp16 = 16.0*scp1;
double scp14 = 14.0*scp1;
double scp3 = 3.0*scp1;
/branches/Version135x/Scribus/scribus/prefsdialogbase.cpp
106,7 → 106,7
for (uint cc = 0; cc < prefsSelection->count(); ++cc)
{
int w = ic->width();
maxWidth = QMAX(w, maxWidth);
maxWidth = qMax(w, maxWidth);
ic = ic->nextItem();
}
ic = prefsSelection->firstItem();
/branches/Version135x/Scribus/scribus/text/frect.cpp
819,10 → 819,10
if ( isValid() ) {
if ( r.isValid() ) {
FRect tmp;
tmp.setLeft( QMIN( x1, r.x1 ) );
tmp.setRight( QMAX( x2, r.x2 ) );
tmp.setTop( QMIN( y1, r.y1 ) );
tmp.setBottom( QMAX( y2, r.y2 ) );
tmp.setLeft( qMin( x1, r.x1 ) );
tmp.setRight( qMax( x2, r.x2 ) );
tmp.setTop( qMin( y1, r.y1 ) );
tmp.setBottom( qMax( y2, r.y2 ) );
return tmp;
} else {
return *this;
853,10 → 853,10
FRect FRect::operator&( const FRect &r ) const
{
FRect tmp;
tmp.x1 = QMAX( x1, r.x1 );
tmp.x2 = QMIN( x2, r.x2 );
tmp.y1 = QMAX( y1, r.y1 );
tmp.y2 = QMIN( y2, r.y2 );
tmp.x1 = qMax( x1, r.x1 );
tmp.x2 = qMin( x2, r.x2 );
tmp.y1 = qMax( y1, r.y1 );
tmp.y2 = qMin( y2, r.y2 );
return tmp;
}
 
879,8 → 879,8
 
bool FRect::intersects( const FRect &r ) const
{
return ( QMAX( x1, r.x1 ) <= QMIN( x2, r.x2 ) &&
QMAX( y1, r.y1 ) <= QMIN( y2, r.y2 ) );
return ( qMax( x1, r.x1 ) <= qMin( x2, r.x2 ) &&
qMax( y1, r.y1 ) <= qMin( y2, r.y2 ) );
}
 
 
/branches/Version135x/Scribus/scribus/text/fsize.h
222,12 → 222,12
 
inline FSize FSize::expandedTo( const FSize & otherSize ) const
{
return FSize( QMAX(wd,otherSize.wd), QMAX(ht,otherSize.ht) );
return FSize( qMax(wd,otherSize.wd), qMax(ht,otherSize.ht) );
}
 
inline FSize FSize::boundedTo( const FSize & otherSize ) const
{
return FSize( QMIN(wd,otherSize.wd), QMIN(ht,otherSize.ht) );
return FSize( qMin(wd,otherSize.wd), qMin(ht,otherSize.ht) );
}
 
 
/branches/Version135x/Scribus/scribus/text/storytext.cpp
586,7 → 586,7
// qDebug(QString("applying parstyle %1 as defaultstyle for %2").arg(paragraphStyle(pos).name()).arg(pos));
d->trailingStyle.applyStyle(style);
}
invalidate(pos, QMIN(i, length()));
invalidate(pos, qMin(i, length()));
}
 
void StoryText::eraseStyle(int pos, const ParagraphStyle& style)
618,7 → 618,7
// qDebug(QString("applying parstyle %1 as defaultstyle for %2").arg(paragraphStyle(pos).name()).arg(pos));
d->trailingStyle.eraseStyle(style);
}
invalidate(pos, QMIN(i, length()));
invalidate(pos, qMin(i, length()));
}
 
 
772,7 → 772,7
int StoryText::nextWord(int pos)
{
int len = length();
pos = QMIN(len, pos+1);
pos = qMin(len, pos+1);
while (pos < len && wordBoundaries.find(text(pos)) < 0)
++pos;
return pos < len ? pos + 1 : pos;
779,7 → 779,7
}
int StoryText::prevWord(int pos)
{
pos = QMAX(0, pos-1);
pos = qMax(0, pos-1);
while (pos > 0 && wordBoundaries.find(text(pos)) < 0)
--pos;
return wordBoundaries.find(text(pos)) < 0 ? pos + 1 : pos;
787,7 → 787,7
int StoryText::nextSentence(int pos)
{
int len = length();
pos = QMIN(len, pos+1);
pos = qMin(len, pos+1);
while (pos < len && sentenceBoundaries.find(text(pos)) < 0)
++pos;
return pos < len ? pos + 1 : pos;
794,7 → 794,7
}
int StoryText::prevSentence(int pos)
{
pos = QMAX(0, pos-1);
pos = qMax(0, pos-1);
while (pos > 0 && sentenceBoundaries.find(text(pos)) < 0)
--pos;
return sentenceBoundaries.find(text(pos)) < 0 ? pos + 1 : pos;
802,7 → 802,7
int StoryText::nextParagraph(int pos)
{
int len = length();
pos = QMIN(len, pos+1);
pos = qMin(len, pos+1);
while (pos < len && text(pos) != SpecialChars::PARSEP)
++pos;
return pos;
809,7 → 809,7
}
int StoryText::prevParagraph(int pos)
{
pos = QMAX(0, pos-1);
pos = qMax(0, pos-1);
while (pos > 0 && text(pos) != SpecialChars::PARSEP)
--pos;
return pos;
955,9 → 955,9
if (on) {
// extend if possible
if (selected(pos - 1))
selLast = QMAX(selLast, pos + static_cast<int>(len) - 1);
selLast = qMax(selLast, pos + static_cast<int>(len) - 1);
else if (selected(pos + len))
selFirst = QMIN(selFirst, pos);
selFirst = qMin(selFirst, pos);
else {
selFirst = pos;
selLast = pos + len - 1;
1082,7 → 1082,7
else if (xpos < ls.x + 0.01 && maxx >= coord.x()) // check for empty line
return ls.firstItem;
}
return QMAX(lastFrameItem+1, firstFrameItem);
return qMax(lastFrameItem+1, firstFrameItem);
}
 
 
/branches/Version135x/Scribus/scribus/text/storytext.h
241,8 → 241,8
lastFrameItem = ls.lastItem;
}
else {
firstFrameItem = QMIN(firstFrameItem, ls.firstItem);
lastFrameItem = QMAX(lastFrameItem, ls.lastItem);
firstFrameItem = qMin(firstFrameItem, ls.firstItem);
lastFrameItem = qMax(lastFrameItem, ls.lastItem);
}
}
/branches/Version135x/Scribus/scribus/scpainterex_gdi.cpp
409,8 → 409,8
m_lineWidth = w;
m_lineEnd = ca;
m_lineJoin = jo;
double Dt = QMAX(2*w, 1);
double Da = QMAX(6*w, 1);
double Dt = qMax(2*w, 1);
double Da = qMax(6*w, 1);
Q3ValueList<double> tmp;
m_array.clear();
m_offset = 0;
/branches/Version135x/Scribus/scribus/scribus.cpp
1031,7 → 1031,7
{
if (currItem->itemText.length() != 0)
{
// int ChPos = QMIN(currItem->CPos, static_cast<int>(currItem->itemText.length()-1));
// int ChPos = qMin(currItem->CPos, static_cast<int>(currItem->itemText.length()-1));
const ParagraphStyle& currPStyle(currItem->currentStyle());
setAbsValue(currPStyle.alignment());
propertiesPalette->setParStyle(currPStyle.parent());
1108,9 → 1108,9
if (currItem->CPos-1>0)
{
#if 0
StyleFlag fl = currItem->itemText.item(QMAX(currItem->CPos-1,0))->effects();
StyleFlag fl = currItem->itemText.item(qMax(currItem->CPos-1,0))->effects();
fl |= ScStyle_HyphenationPossible;
currItem->itemText.item(QMAX(currItem->CPos-1,0))->setEffects(fl);
currItem->itemText.item(qMax(currItem->CPos-1,0))->setEffects(fl);
#else
currItem->itemText.insertChars(currItem->CPos, QString(SpecialChars::SHYPHEN));
currItem->CPos += 1;
1275,7 → 1275,7
else
{
doc->SizeItem(currItem->PoLine.WidthHeight().x(), currItem->PoLine.WidthHeight().y(), currItem->ItemNr, false, false);
currItem->setPolyClip(qRound(QMAX(currItem->lineWidth() / 2.0, 1)));
currItem->setPolyClip(qRound(qMax(currItem->lineWidth() / 2.0, 1)));
doc->AdjustItemSize(currItem);
currItem->ContourLine = currItem->PoLine.copy();
currItem->ClipEdited = true;
1964,7 → 1964,7
doc->setPage(width, height, topMargin, leftMargin, rightMargin, bottomMargin, columnDistance, columnCount, autoTextFrames, pageArrangement);
doc->setMasterPageMode(false);
doc->addMasterPage(0, CommonStrings::masterPageNormal);
int createCount=QMAX(pageCount,1);
int createCount=qMax(pageCount,1);
for (int i = 0; i < createCount; ++i)
doc->addPage(i, CommonStrings::masterPageNormal, true);
doc->addSection();
2592,7 → 2592,7
for (uint a=0; a<doc->m_Selection->count(); ++a)
{
currItem = doc->m_Selection->itemAt(a);
lowestItem = QMIN(lowestItem, currItem->ItemNr);
lowestItem = qMin(lowestItem, currItem->ItemNr);
}
currItem = doc->Items->at(lowestItem);
// doc->m_Selection->removeItem(currItem);
3120,7 → 3120,7
scrMenuMgr->removeMenuItem((*it), recentFileMenuName);
 
scrRecentFileActions.clear();
uint max = QMIN(prefsManager->appPrefs.RecentDCount, RecentDocs.count());
uint max = qMin(prefsManager->appPrefs.RecentDCount, RecentDocs.count());
QString strippedName, localName;
for (uint m = 0; m < max; ++m)
{
3139,7 → 3139,7
scrMenuMgr->removeMenuItem((*it), recentPasteMenuName);
 
scrRecentPasteActions.clear();
uint max = QMIN(static_cast<uint>(prefsManager->appPrefs.numScrapbookCopies), scrapbookPalette->tempBView->objectMap.count());
uint max = qMin(static_cast<uint>(prefsManager->appPrefs.numScrapbookCopies), scrapbookPalette->tempBView->objectMap.count());
if (max > 0)
{
QMap<QString,BibView::Elem>::Iterator it;
4799,7 → 4799,7
if (it == NULL)
nstyle.setScaleV(1000);
else
nstyle.setScaleV(QMIN(QMAX((*it).toInt(), 100), 4000));
nstyle.setScaleV(qMin(qMax((*it).toInt(), 100), 4000));
it++;
nstyle.setBaselineOffset(it == NULL ? 0 : (*it).toInt());
it++;
5327,10 → 5327,10
finalZoomFactor = zoomFactor*prefsManager->displayScale()/100.0;
if (finalZoomFactor == view->scale())
return;
int x = qRound(QMAX(view->contentsX() / view->scale(), 0));
int y = qRound(QMAX(view->contentsY() / view->scale(), 0));
int w = qRound(QMIN(view->visibleWidth() / view->scale(), doc->currentPage()->width()));
int h = qRound(QMIN(view->visibleHeight() / view->scale(), doc->currentPage()->height()));
int x = qRound(qMax(view->contentsX() / view->scale(), 0));
int y = qRound(qMax(view->contentsY() / view->scale(), 0));
int w = qRound(qMin(view->visibleWidth() / view->scale(), doc->currentPage()->width()));
int h = qRound(qMin(view->visibleHeight() / view->scale(), doc->currentPage()->height()));
if (zoomFactor==-200.0)
view->rememberOldZoomLocation(qRound(doc->currentPage()->xOffset() + doc->currentPage()->width() / 2.0), qRound(doc->currentPage()->yOffset() + doc->currentPage()->height() / 2.0));
else
6179,7 → 6179,7
undoManager->setUndoEnabled(false); // ugly hack to prevent object moving when undoing page deletion
view->reformPages();
undoManager->setUndoEnabled(true); // ugly hack continues
view->GotoPage(QMIN(doc->Pages->count()-1, oldPg));
view->GotoPage(qMin(doc->Pages->count()-1, oldPg));
view->DrawNew();
if (outlinePalette->isVisible())
outlinePalette->BuildTree();
6261,7 → 6261,7
undoManager->setUndoEnabled(false); // ugly hack to disable object moving when undoing page deletion
view->reformPages();
undoManager->setUndoEnabled(true); // ugly hack continues
view->GotoPage(QMIN(doc->Pages->count()-1, oldPg));
view->GotoPage(qMin(doc->Pages->count()-1, oldPg));
view->DrawNew();
if (outlinePalette->isVisible())
outlinePalette->BuildTree();
6504,8 → 6504,8
{
if ((doc->appMode == modeEdit) && (currItem->itemText.length() != 0))
{
la = currItem->itemText.charStyle(QMIN(currItem->CPos, static_cast<int>(currItem->itemText.length()-1))).fillColor();
lb = currItem->itemText.charStyle(QMIN(currItem->CPos, static_cast<int>(currItem->itemText.length()-1))).fillShade();
la = currItem->itemText.charStyle(qMin(currItem->CPos, static_cast<int>(currItem->itemText.length()-1))).fillColor();
lb = currItem->itemText.charStyle(qMin(currItem->CPos, static_cast<int>(currItem->itemText.length()-1))).fillShade();
}
else
{
7263,11 → 7263,11
double mx = currItem->xPos() + ((x1 + x2)/2.0);
double my = currItem->yPos() + ((y1 + y2)/2.0);
double viewScale=view->scale();
if ((qRound((currItem->xPos() + QMAX(x1, x2)) * viewScale) > view->contentsWidth()) ||
(qRound((currItem->yPos() + QMAX(y1, y2)) * viewScale) > view->contentsHeight()))
view->resizeContents(QMAX(qRound((currItem->xPos() + QMAX(x1, x2)) * viewScale),
if ((qRound((currItem->xPos() + qMax(x1, x2)) * viewScale) > view->contentsWidth()) ||
(qRound((currItem->yPos() + qMax(y1, y2)) * viewScale) > view->contentsHeight()))
view->resizeContents(qMax(qRound((currItem->xPos() + qMax(x1, x2)) * viewScale),
view->contentsWidth()),
QMAX(qRound((currItem->yPos() + QMAX(y1, y2)) * viewScale), view->contentsHeight()));
qMax(qRound((currItem->yPos() + qMax(y1, y2)) * viewScale), view->contentsHeight()));
view->SetCCPo(mx, my);
}
else
7276,8 → 7276,8
if ((qRound((currItem->xPos() + currItem->width()) * viewScale) > view->contentsWidth()) ||
(qRound((currItem->yPos() + currItem->height()) * viewScale) > view->contentsHeight())
)
view->resizeContents(QMAX(qRound((currItem->xPos() + currItem->width()) * viewScale), view->contentsWidth()),
QMAX(qRound((currItem->yPos() + currItem->height()) * viewScale), view->contentsHeight()));
view->resizeContents(qMax(qRound((currItem->xPos() + currItem->width()) * viewScale), view->contentsWidth()),
qMax(qRound((currItem->yPos() + currItem->height()) * viewScale), view->contentsHeight()));
view->SetCCPo(currItem->xPos() + currItem->width() / 2.0, currItem->yPos() + currItem->height() / 2.0);
}
}
8123,8 → 8123,8
currItem->gYpos = currItem->yPos() - y;
currItem->gWidth = w;
currItem->gHeight = h;
lowestItem = QMIN(lowestItem, currItem->ItemNr);
highestItem = QMAX(highestItem, currItem->ItemNr);
lowestItem = qMin(lowestItem, currItem->ItemNr);
highestItem = qMax(highestItem, currItem->ItemNr);
}
double minx = 99999.9;
double miny = 99999.9;
8144,18 → 8144,18
pb.addPoint(FPoint(-lw, currItem->height()+lw*2.0, currItem->xPos()-lw, currItem->yPos()-lw, currItem->rotation(), 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
minx = qMin(minx, pb.point(pc).x());
miny = qMin(miny, pb.point(pc).y());
maxx = qMax(maxx, pb.point(pc).x());
maxy = qMax(maxy, pb.point(pc).y());
}
}
else
{
minx = QMIN(minx, currItem->xPos()-lw);
miny = QMIN(miny, currItem->yPos()-lw);
maxx = QMAX(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = QMAX(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
minx = qMin(minx, currItem->xPos()-lw);
miny = qMin(miny, currItem->yPos()-lw);
maxx = qMax(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = qMax(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
}
}
double gx = minx;
8224,7 → 8224,7
{
currItem = doc->m_Selection->itemAt(a);
currItem->Groups.pop();
lowestItem = QMIN(lowestItem, currItem->ItemNr);
lowestItem = qMin(lowestItem, currItem->ItemNr);
}
if (doc->Items->at(lowestItem)->isGroupControl)
{
8385,7 → 8385,7
for (uint a=0; a<docSelectionCount; ++a)
{
currItem = doc->m_Selection->itemAt(a);
lowestItem = QMIN(lowestItem, currItem->ItemNr);
lowestItem = qMin(lowestItem, currItem->ItemNr);
}
if ((lowestItem > 0) && (doc->Items->at(lowestItem-1)->Groups.count() != 0))
{
8424,7 → 8424,7
for (uint a=0; a<docSelectionCount; ++a)
{
currItem = doc->m_Selection->itemAt(a);
lowestItem = QMIN(lowestItem, currItem->ItemNr);
lowestItem = qMin(lowestItem, currItem->ItemNr);
}
if ((lowestItem > 0) && (doc->Items->at(lowestItem-1)->Groups.count() != 0))
{
/branches/Version135x/Scribus/scribus/shadebutton.cpp
53,7 → 53,7
{
c = dia->getEditText().toInt(&ok);
if (ok)
b = QMAX(QMIN(c, 100),0);
b = qMax(qMin(c, 100),0);
else
b = 100;
delete dia;
/branches/Version135x/Scribus/scribus/cmykfw.cpp
957,7 → 957,7
 
void CMYKChoose::setColor2(int h, int s, bool ende)
{
QColor tm = QColor(QMAX(QMIN(359,h),0), QMAX(QMIN(255,255-s),0), 255-BlackComp, QColor::Hsv);
QColor tm = QColor(qMax(qMin(359,h),0), qMax(qMin(255,255-s),0), 255-BlackComp, QColor::Hsv);
int r, g, b;
tm.rgb(&r, &g, &b);
ScColor tmp;
/branches/Version135x/Scribus/scribus/vgradient.cpp
135,11 → 135,11
VGradient::addStop( const QColor &color, double rampPoint, double midPoint, double opa, QString name, int shade )
{
// Clamping between 0.0 and 1.0
rampPoint = QMAX( 0.0, rampPoint );
rampPoint = QMIN( 1.0, rampPoint );
rampPoint = qMax( 0.0, rampPoint );
rampPoint = qMin( 1.0, rampPoint );
// Clamping between 0.0 and 1.0
midPoint = QMAX( 0.0, midPoint );
midPoint = QMIN( 1.0, midPoint );
midPoint = qMax( 0.0, midPoint );
midPoint = qMin( 1.0, midPoint );
 
m_colorStops.inSort( new VColorStop( rampPoint, midPoint, color, opa, name, shade ) );
}
/branches/Version135x/Scribus/scribus/sclistboxpixmap.h
45,8 → 45,8
int ScListBoxPixmap<pixWidth, pixHeight>::width(const Q3ListBox* lb) const
{
if ( text().isEmpty() )
return QMAX( pmap->width() + 6, QApplication::globalStrut().width() );
return QMAX( pmap->width() + lb->fontMetrics().width(text()) + 6,QApplication::globalStrut().width() );
return qMax( pmap->width() + 6, QApplication::globalStrut().width() );
return qMax( pmap->width() + lb->fontMetrics().width(text()) + 6,QApplication::globalStrut().width() );
};
 
template<unsigned int pixWidth, unsigned int pixHeight>
56,8 → 56,8
if ( text().isEmpty() )
h = pmap->height();
else
h = QMAX( pmap->height(), lb->fontMetrics().lineSpacing() + 2 );
return QMAX( h, QApplication::globalStrut().height() );
h = qMax( pmap->height(), lb->fontMetrics().lineSpacing() + 2 );
return qMax( h, QApplication::globalStrut().height() );
};
 
template<unsigned int pixWidth, unsigned int pixHeight>
/branches/Version135x/Scribus/scribus/lineformats.cpp
265,7 → 265,7
const ScColor& col = doc->PageColors[mLine[its].Color];
tmpf = ScColorEngine::getDisplayColor(col, doc, mLine[its].Shade);
p.setPen(QPen(tmpf,
QMAX(static_cast<int>(mLine[its].Width), 1),
qMax(static_cast<int>(mLine[its].Width), 1),
static_cast<Qt::PenStyle>(mLine[its].Dash),
static_cast<Qt::PenCapStyle>(mLine[its].LineEnd),
static_cast<Qt::PenJoinStyle>(mLine[its].LineJoin)));
/branches/Version135x/Scribus/scribus/scimgdataloader_ps.cpp
489,7 → 489,7
cc = 255 - qRed(*s);
cm = 255 - qGreen(*s);
cy = 255 - qBlue(*s);
ck = QMIN(QMIN(cc, cm), cy);
ck = qMin(qMin(cc, cm), cy);
*s = qRgba(cc-ck,cm-ck,cy-ck,ck);
s++;
}
1519,10 → 1519,10
cyan = 255 - qRed(*pq);
if (cyan != 0)
{
(c == 0) ? cc = qRed(*p) : cc = QMIN(c * cyan / 255 + qRed(*p), 255);
(m == 0) ? mm = qGreen(*p) : mm = QMIN(m * cyan / 255 + qGreen(*p), 255);
(yc == 0) ? yy = qBlue(*p) : yy = QMIN(yc * cyan / 255 + qBlue(*p), 255);
(k == 0) ? kk = qAlpha(*p) : kk = QMIN(k * cyan / 255 + qAlpha(*p), 255);
(c == 0) ? cc = qRed(*p) : cc = qMin(c * cyan / 255 + qRed(*p), 255);
(m == 0) ? mm = qGreen(*p) : mm = qMin(m * cyan / 255 + qGreen(*p), 255);
(yc == 0) ? yy = qBlue(*p) : yy = qMin(yc * cyan / 255 + qBlue(*p), 255);
(k == 0) ? kk = qAlpha(*p) : kk = qMin(k * cyan / 255 + qAlpha(*p), 255);
*p = qRgba(cc, mm, yy, kk);
}
p++;
/branches/Version135x/Scribus/scribus/polygonwidget.cpp
186,7 → 186,7
if ((br.height() > 100) || (br.width() > 100))
{
QMatrix ma;
double sca = 100.0 / static_cast<double>(QMAX(br.width(), br.height()));
double sca = 100.0 / static_cast<double>(qMax(br.width(), br.height()));
ma.scale(sca, sca);
pp = pp * ma;
}
/branches/Version135x/Scribus/scribus/mpalette.cpp
1322,7 → 1322,7
PageItem_TextFrame* i2=i->asTextFrame();
if (i2!=0)
{
DCol->setMaxValue(QMAX(qRound(i2->width() / QMAX(i2->ColGap, 10.0)), 1));
DCol->setMaxValue(qMax(qRound(i2->width() / qMax(i2->ColGap, 10.0)), 1));
DCol->setMinValue(1);
DCol->setValue(i2->Cols);
dGap->setMinValue(0);
1329,12 → 1329,12
// if (colgapLabel->getState())
if (colgapLabel->currentItem() == 0)
{
dGap->setMaxValue(QMAX((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*Umrech, 0));
dGap->setMaxValue(qMax((i2->width() / i2->Cols - i2->textToFrameDistLeft() - i2->textToFrameDistRight())*Umrech, 0));
dGap->setValue(i2->ColGap*Umrech);
}
else
{
dGap->setMaxValue(QMAX((i2->width() / i2->Cols)*Umrech, 0));
dGap->setMaxValue(qMax((i2->width() / i2->Cols)*Umrech, 0));
dGap->setValue(i2->columnWidth()*Umrech);
}
}
2028,7 → 2028,7
for (uint a=0; a<doc->m_Selection->count(); ++a)
{
i = doc->m_Selection->itemAt(a);
lowestItem = QMIN(lowestItem, i->ItemNr);
lowestItem = qMin(lowestItem, i->ItemNr);
}
i = doc->Items->at(lowestItem);
SetCurItem(i);
2209,8 → 2209,8
}
else
{
RoundRect->setMaxValue(QMIN(x, y)/2*Umrech);
RoundRect->setMinValue(-QMIN(x, y)/2*Umrech);
RoundRect->setMaxValue(qMin(x, y)/2*Umrech);
RoundRect->setMinValue(-qMin(x, y)/2*Umrech);
Width->setValue(x*Umrech);
Height->setValue(y*Umrech);
}
/branches/Version135x/Scribus/scribus/preview.cpp
286,7 → 286,7
Anz->setPixmap(CreatePreview(0, 72));
Anzeige->addChild(Anz, 0, 0);
int w = Anz->width() + tbWidth + 50;
resize(QMIN(QApplication::desktop()->width()-30,w), 500);
resize(qMin(QApplication::desktop()->width()-30,w), 500);
if (!PrefsManager::instance()->appPrefs.PrPr_Mode)
{
if (HaveTiffSep != 0)
437,7 → 437,7
scaleFactor = Anzeige->viewport()->height() / doc->Pages->at(APage)->height();
break;
case 6:
scaleFactor = QMIN(Anzeige->viewport()->height() / doc->Pages->at(APage)->height(), Anzeige->viewport()->width() / doc->Pages->at(APage)->width());
scaleFactor = qMin(Anzeige->viewport()->height() / doc->Pages->at(APage)->height(), Anzeige->viewport()->width() / doc->Pages->at(APage)->width());
break;
default:
scaleFactor = 1.0;
726,8 → 726,8
//FIXME: if source and target have different sizesomething went wrong.
// eg. loadPicture() failed and returned a 1x1 image
int h = QMIN(target.height(),source.height());
int w = QMIN(target.width(),source.width());
int h = qMin(target.height(),source.height());
int w = qMin(target.width(),source.width());
int cyan, c, m, yc, k, cc, mm, yy, kk;
col.getCMYK(&c, &m, &yc, &k);
for (int y=0; y < h; ++y )
739,10 → 739,10
cyan = 255 - qRed(*pq);
if (cyan != 0)
{
(c == 0) ? cc = qRed(*p) : cc = QMIN(c * cyan / 255 + qRed(*p), 255);
(m == 0) ? mm = qGreen(*p) : mm = QMIN(m * cyan / 255 + qGreen(*p), 255);
(yc == 0) ? yy = qBlue(*p) : yy = QMIN(yc * cyan / 255 + qBlue(*p), 255);
(k == 0) ? kk = qAlpha(*p) : kk = QMIN(k * cyan / 255 + qAlpha(*p), 255);
(c == 0) ? cc = qRed(*p) : cc = qMin(c * cyan / 255 + qRed(*p), 255);
(m == 0) ? mm = qGreen(*p) : mm = qMin(m * cyan / 255 + qGreen(*p), 255);
(yc == 0) ? yy = qBlue(*p) : yy = qMin(yc * cyan / 255 + qBlue(*p), 255);
(k == 0) ? kk = qAlpha(*p) : kk = qMin(k * cyan / 255 + qAlpha(*p), 255);
*p = qRgba(cc, mm, yy, kk);
}
p++;
921,7 → 921,7
yellow = qBlue(*q);
black = qAlpha(*q);
if ((cyan != 0) || (magenta != 0) || (yellow != 0 ) || (black != 0))
*q = qRgba(255-QMIN(255, cyan+black), 255-QMIN(255,magenta+black), 255-QMIN(255,yellow+black), 255);
*q = qRgba(255-qMin(255, cyan+black), 255-qMin(255,magenta+black), 255-qMin(255,yellow+black), 255);
else
{
if (!AliasTr->isChecked())
1013,7 → 1013,7
alpha = 0;
else
alpha = 255;
*p = qRgba(255-QMIN(255, cyan+black), 255-QMIN(255,magenta+black), 255-QMIN(255,yellow+black), alpha);
*p = qRgba(255-qMin(255, cyan+black), 255-qMin(255,magenta+black), 255-qMin(255,yellow+black), alpha);
p++;
}
}
/branches/Version135x/Scribus/scribus/chartable.cpp
67,7 → 67,7
if (!m_doc || m_fontInUse.isEmpty())
return QRect(0, 0, 1, 1);
 
int widthHeight = QMAX(18 + qRound(-(*m_doc->AllFonts)[m_fontInUse].descent() * 18) + 5, 18);
int widthHeight = qMax(18 + qRound(-(*m_doc->AllFonts)[m_fontInUse].descent() * 18) + 5, 18);
return QRect(0, 0, widthHeight, widthHeight+20);
}
 
109,7 → 109,7
p->setupPolygon(&gly);
p->fillPath();
p->end();
int x = QMAX(0, (cr.width() - sz.width()) / 2);
int x = qMax(0, (cr.width() - sz.width()) / 2);
qp->drawPixmap(x, 1, pixm);
QString tmp;
tmp.sprintf("%04X", m_characters[row*numCols()+col]);
/branches/Version135x/Scribus/scribus/search.cpp
471,10 → 471,10
Item->itemText.select(a, 1, false);
}
if ( Word->isChecked() && inde == sText.length() &&
! Item->itemText.text(QMIN(a+1, maxChar)).isSpace() )
! Item->itemText.text(qMin(a+1, maxChar)).isSpace() )
{
for (int xx = ReplStart; xx < a+1; ++xx)
Item->itemText.select(QMIN(xx, maxChar), 1, false);
Item->itemText.select(qMin(xx, maxChar), 1, false);
Item->HasSel = false;
inde = 0;
found = false;
493,7 → 493,7
if (SText->isChecked())
{
for (int xx = ReplStart; xx < a+1; ++xx)
Item->itemText.select(QMIN(xx, maxChar), 1, false);
Item->itemText.select(qMin(xx, maxChar), 1, false);
Item->HasSel = false;
}
inde = 0;
/branches/Version135x/Scribus/scribus/scgzfile.cpp
44,7 → 44,7
// as a starting point for loading. We'll expand this buffer by powers
// of two if we run out of space.
const QFileInfo fi(fname);
uint bufSize = QMIN(4096, fi.size()*gzipExpansionFactor);
uint bufSize = qMin(4096, fi.size()*gzipExpansionFactor);
barray.resize(bufSize);
char* buf = barray.data();
uint bytesRead = 0;
/branches/Version135x/Scribus/scribus/arrowchooser.cpp
50,7 → 50,7
mm2.scale(-1, 1);
mm2.translate(-max.x(), 0);
}
mm.scale(16.0 / QMAX(max.x(), max.y()), 16.0 / QMAX(max.x(), max.y()));
mm.scale(16.0 / qMax(max.x(), max.y()), 16.0 / qMax(max.x(), max.y()));
Path.map(mm2 * mm);
painter->setupPolygon(&Path);
painter->setLineWidth(1.0);
/branches/Version135x/Scribus/scribus/effectsdialog.cpp
88,7 → 88,7
image.createLowRes(sx);
else
image.createLowRes(sy);
imageScale = QMIN(sx, sy);
imageScale = qMin(sx, sy);
}
layout16 = new Q3VBoxLayout( 0, 0, 5, "layout16");
pixmapLabel1 = new QLabel( this, "pixmapLabel1" );
/branches/Version135x/Scribus/scribus/tabpdfoptions.cpp
1378,7 → 1378,7
if (enable)
PDFVersionCombo->insertItem("PDF/X-3");
else
a = QMIN(a, 3);
a = qMin(a, 3);
PDFVersionCombo->setCurrentItem(a);
EnablePr(1);
connect(PDFVersionCombo, SIGNAL(activated(int)), this, SLOT(EnablePDFX(int)));
/branches/Version135x/Scribus/scribus/annot.cpp
628,12 → 628,12
SpinBox11 = new QSpinBox( GroupBox11, "SpinBox1" );
SpinBox11->setMinValue(1);
SpinBox11->setMaxValue(item->annotation().ActionType() == 7 ? 1000 : Seite);
SpinBox11->setValue(QMIN(item->annotation().Ziel()+1, Seite));
SpinBox11->setValue(qMin(item->annotation().Ziel()+1, Seite));
GroupBox11Layout->addWidget( SpinBox11, 1, 1 );
if (item->annotation().ActionType() == 7)
Pg1 = new Navigator( GroupBox11, 100, item->annotation().Ziel()+1, view, item->annotation().Extern());
else
Pg1 = new Navigator( GroupBox11, 100, QMIN(item->annotation().Ziel(), Seite-1), view);
Pg1 = new Navigator( GroupBox11, 100, qMin(item->annotation().Ziel(), Seite-1), view);
Pg1->setMinimumSize(QSize(Pg1->pmx.width(), Pg1->pmx.height()));
GroupBox11Layout->addMultiCellWidget(Pg1, 1, 3, 2, 2);
TextLabel41 = new QLabel( GroupBox11, "TextLabel4" );
1102,7 → 1102,7
QToolTip::add(NoScroll, tr( "Flag is ignored for PDF 1.3" ) );
QToolTip::add(CalcFields, tr( "Enter a comma separated list of fields here" ) );
QToolTip::add(IconNR, tr("You need at least the Icon for Normal to use Icons for Buttons"));
SetPg(QMIN(SpinBox11->value(), MaxSeite));
SetPg(qMin(SpinBox11->value(), MaxSeite));
SetCross();
}
 
1142,7 → 1142,7
int h = item->pixm.height();
double sw = item->width() / w;
double sh = item->height() / h;
double sc = QMIN(sw, sh);
double sc = qMin(sw, sh);
if (dia->IcScaleH == 3)
{
item->setImageXYScale(1.0, 1.0);
1230,7 → 1230,7
int h = item->pixm.height();
double sw = item->width() / w;
double sh = item->height() / h;
double sc = QMIN(sw,sh);
double sc = qMin(sw,sh);
item->setImageXYScale(sc, sc);
item->setImageXYOffset(((item->width()-(w*sc))/2)/sc, ((item->height()-(h*sc))/2)/sc);
IconNR->setEnabled(true);
1682,8 → 1682,8
}
else
{
Pg1->SetSeite(QMIN(v-1, MaxSeite-1), 100);
SpinBox11->setValue(QMIN(v, MaxSeite));
Pg1->SetSeite(qMin(v-1, MaxSeite-1), 100);
SpinBox11->setValue(qMin(v, MaxSeite));
Breite = OriBreite;
Hoehe = OriHoehe;
// SetCo(0,0);
1975,7 → 1975,7
/* PFJ - 28/02/04 - Altered from uint to int and varname */
for (uint prop = 0; prop < array_act; ++prop)
ActionCombo->insertItem(tmp_actcom[prop]);
ActionCombo->setCurrentItem(QMIN(tmpac,5));
ActionCombo->setCurrentItem(qMin(tmpac,5));
setter = item->annotation().ActionType() != 7 ? true : false;
Destfile->setEnabled(setter);
ChFile->setEnabled(setter);
2008,7 → 2008,7
ActionCombo->clear();
ActionCombo->insertItem( tr( "None" ) );
ActionCombo->insertItem( tr( "JavaScript" ) );
ActionCombo->setCurrentItem(QMIN(tmpac, 1));
ActionCombo->setCurrentItem(qMin(tmpac, 1));
SetActTyp(tmpac);
break;
default:
2045,7 → 2045,7
enable = false;
// Destfile->setEnabled(false);
// ChFile->setEnabled(false);
SetPg(QMIN(SpinBox11->value(), MaxSeite));
SetPg(qMin(SpinBox11->value(), MaxSeite));
}
else
{
2065,7 → 2065,7
LExtern->setChecked(false);
}
}
SetPg(QMIN(SpinBox11->value(), MaxSeite));
SetPg(qMin(SpinBox11->value(), MaxSeite));
}
Destfile->setEnabled(enable);
ChFile->setEnabled(enable);
2091,7 → 2091,7
setter = item->annotation().ActionType() != 7 ? true : false;
Destfile->setEnabled(setter);
ChFile->setEnabled(setter);
SetPg(QMIN(SpinBox11->value(), MaxSeite));
SetPg(qMin(SpinBox11->value(), MaxSeite));
break;
case 1:
Fram2->raiseWidget(2);
/branches/Version135x/Scribus/scribus/scribusdoc.cpp
1608,7 → 1608,7
for (nx = itemToCopy->Groups.begin(); nx != itemToCopy->Groups.end(); ++nx)
{
tmpGroup.push((*nx)+GroupCounter);
GrMax = QMAX(GrMax, (*nx)+GroupCounter);
GrMax = qMax(GrMax, (*nx)+GroupCounter);
}
for (nx = tmpGroup.begin(); nx != tmpGroup.end(); ++nx)
{
3641,18 → 3641,18
pb.addPoint(p3);
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
minx = qMin(minx, pb.point(pc).x());
miny = qMin(miny, pb.point(pc).y());
maxx = qMax(maxx, pb.point(pc).x());
maxy = qMax(maxy, pb.point(pc).y());
}
}
else
{
minx = QMIN(minx, currItem->xPos());
miny = QMIN(miny, currItem->yPos());
maxx = QMAX(maxx, currItem->xPos() + currItem->width());
maxy = QMAX(maxy, currItem->yPos() + currItem->height());
minx = qMin(minx, currItem->xPos());
miny = qMin(miny, currItem->yPos());
maxx = qMax(maxx, currItem->xPos() + currItem->width());
maxy = qMax(maxy, currItem->yPos() + currItem->height());
}
}
minPoint.setX(minx);
3711,7 → 3711,7
double y2 = currItem->BoundingY;
double w2 = currItem->BoundingW;
double h2 = currItem->BoundingH;
if (( QMAX( x, x2 ) <= QMIN( x+w, x2+w2 ) && QMAX( y, y2 ) <= QMIN( y+h1, y2+h2 )))
if (( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h1, y2+h2 )))
retw = currentPage()->pageNr();
}
else
3727,7 → 3727,7
double y2 = currItem->BoundingY;
double w2 = currItem->BoundingW;
double h2 = currItem->BoundingH;
if (( QMAX( x, x2 ) <= QMIN( x+w, x2+w2 ) && QMAX( y, y2 ) <= QMIN( y+h1, y2+h2 )))
if (( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h1, y2+h2 )))
{
retw = static_cast<int>(a);
break;
3772,9 → 3772,9
for (uint a = 0; a < objectCount; ++a)
{
int res = OnPage(Objects.at(a));
Off_Page = QMAX(Off_Page, res);
Off_Page = qMax(Off_Page, res);
if (res != -1)
On_Page = QMIN(On_Page, res);
On_Page = qMin(On_Page, res);
}
int final = -1;
if (Off_Page != -1)
3837,7 → 3837,7
if (counter < pageSets[currentPageLayout].Columns-1)
{
currentXPos += Seite->width() + pageSets[currentPageLayout].GapHorizontal;
lastYPos = QMAX(lastYPos, Seite->height());
lastYPos = qMax(lastYPos, Seite->height());
if (counter == 0)
{
Seite->Margins.Left = Seite->initialMargins.Right;
3853,10 → 3853,10
{
currentXPos = scratch.Left;
if (pageSets[currentPageLayout].Columns > 1)
currentYPos += QMAX(lastYPos, Seite->height())+pageSets[currentPageLayout].GapVertical;
currentYPos += qMax(lastYPos, Seite->height())+pageSets[currentPageLayout].GapVertical;
else
currentYPos += Seite->height()+pageSets[currentPageLayout].GapVertical;
// lastYPos = QMAX(lastYPos, Seite->height());
// lastYPos = qMax(lastYPos, Seite->height());
lastYPos = 0;
Seite->Margins.Right = Seite->initialMargins.Right;
Seite->Margins.Left = Seite->initialMargins.Left;
3875,8 → 3875,8
}
Seite->Margins.Top = Seite->initialMargins.Top;
Seite->Margins.Bottom = Seite->initialMargins.Bottom;
maxXPos = QMAX(maxXPos, Seite->xOffset()+Seite->width()+scratch.Right);
maxYPos = QMAX(maxYPos, Seite->yOffset()+Seite->height()+scratch.Bottom);
maxXPos = qMax(maxXPos, Seite->xOffset()+Seite->width()+scratch.Right);
maxYPos = qMax(maxYPos, Seite->yOffset()+Seite->height()+scratch.Bottom);
}
if (!isLoading())
{
3917,8 → 3917,8
{
FPoint minPoint, maxPoint;
canvasMinMax(minPoint, maxPoint);
FPoint maxSize(QMAX(maxXPos, maxPoint.x()+scratch.Right), QMAX(maxYPos, maxPoint.y()+scratch.Bottom));
adjustCanvas(FPoint(QMIN(0, minPoint.x()-scratch.Left),QMIN(0, minPoint.y()-scratch.Top)), maxSize, true);
FPoint maxSize(qMax(maxXPos, maxPoint.x()+scratch.Right), qMax(maxYPos, maxPoint.y()+scratch.Bottom));
adjustCanvas(FPoint(qMin(0, minPoint.x()-scratch.Left),qMin(0, minPoint.y()-scratch.Top)), maxSize, true);
changed();
}
else
4081,7 → 4081,7
polyLineItem->ClipEdited = true;
polyLineItem->FrameType = 3;
polyLineItem->setRotation(currItem->rotation());
// polyLineItem->setPolyClip(qRound(QMAX(polyLineItem->lineWidth() / 2, 1)));
// polyLineItem->setPolyClip(qRound(qMax(polyLineItem->lineWidth() / 2, 1)));
AdjustItemSize(polyLineItem);
 
newItem->setLineColor(CommonStrings::None);
4111,7 → 4111,7
case PageItem::PolyLine:
newItem->convertTo(PageItem::PolyLine);
newItem->ClipEdited = true;
// newItem->setPolyClip(qRound(QMAX(newItem->lineWidth() / 2, 1)));
// newItem->setPolyClip(qRound(qMax(newItem->lineWidth() / 2, 1)));
AdjustItemSize(newItem);
break;
case PageItem::PathText:
4766,10 → 4766,10
//currItem->Oldm_lineWidth = currItem->lineWidth();
currItem->setLineWidth(w);
if (currItem->asPolyLine())
currItem->setPolyClip(qRound(QMAX(currItem->lineWidth() / 2, 1)));
currItem->setPolyClip(qRound(qMax(currItem->lineWidth() / 2, 1)));
if (currItem->asLine())
{
int ph = static_cast<int>(QMAX(1.0, w / 2.0));
int ph = static_cast<int>(qMax(1.0, w / 2.0));
currItem->Clip.setPoints(4, -ph,-ph, static_cast<int>(currItem->width()+ph),-ph,
static_cast<int>(currItem->width()+ph),static_cast<int>(currItem->height()+ph),
-ph,static_cast<int>(currItem->height()+ph));
5279,7 → 5279,7
start = currItem->itemText.startOfSelection();
stop = currItem->itemText.endOfSelection();
if (start >= stop)
start = stop = QMAX(0, QMIN(currItem->itemText.length(), currItem->CPos));
start = stop = qMax(0, qMin(currItem->itemText.length(), currItem->CPos));
}
for (int pos=start; pos < stop; ++pos)
{
5328,7 → 5328,7
start = currItem->itemText.startOfSelection();
stop = currItem->itemText.endOfSelection();
if (start >= stop)
start = stop = QMAX(0, QMIN(currItem->itemText.length(), currItem->CPos));
start = stop = qMax(0, qMin(currItem->itemText.length(), currItem->CPos));
}
for (int pos=start; pos < stop; ++pos)
{
5377,7 → 5377,7
start = currItem->itemText.startOfSelection();
stop = currItem->itemText.endOfSelection();
if (start >= stop)
start = stop = QMAX(0, QMIN(currItem->itemText.length(), currItem->CPos));
start = stop = qMax(0, qMin(currItem->itemText.length(), currItem->CPos));
}
for (int pos=start; pos < stop; ++pos)
{
5441,11 → 5441,11
}
else
{
start = QMAX(currItem->firstInFrame(), currItem->CPos);
start = qMax(currItem->firstInFrame(), currItem->CPos);
length = 1;
}
}
currItem->itemText.applyCharStyle(start, QMAX(0, length), newStyle);
currItem->itemText.applyCharStyle(start, qMax(0, length), newStyle);
currItem->invalid = true;
}
else
5493,7 → 5493,7
}
else
{
start = QMAX(currItem->firstInFrame(), currItem->CPos);
start = qMax(currItem->firstInFrame(), currItem->CPos);
length = 1;
}
}
5544,7 → 5544,7
}
else
{
start = QMAX(currItem->firstInFrame(), currItem->CPos);
start = qMax(currItem->firstInFrame(), currItem->CPos);
length = 1;
}
}
5764,10 → 5764,10
}
else
{
newMaxX = QMAX(maxCanvasCoordinate.x(), maxPos.x());
newMaxY = QMAX(maxCanvasCoordinate.y(), maxPos.y());
newMinX = QMIN(minCanvasCoordinate.x(), minPos.x());
newMinY = QMIN(minCanvasCoordinate.y(), minPos.y());
newMaxX = qMax(maxCanvasCoordinate.x(), maxPos.x());
newMaxY = qMax(maxCanvasCoordinate.y(), maxPos.y());
newMinX = qMin(minCanvasCoordinate.x(), minPos.x());
newMinY = qMin(minCanvasCoordinate.y(), minPos.y());
}
if ((newMaxX != maxCanvasCoordinate.x()) || (newMaxY != maxCanvasCoordinate.y())
|| (newMinX != minCanvasCoordinate.x()) || (newMinY != minCanvasCoordinate.y()))
6805,10 → 6805,10
{
if (AObjects[a2].Group == ObjGroup)
{
AObjects[a2].x1 = QMIN(AObjects[a2].x1, Object.x1);
AObjects[a2].y1 = QMIN(AObjects[a2].y1, Object.y1);
AObjects[a2].x2 = QMAX(AObjects[a2].x2, Object.x2);
AObjects[a2].y2 = QMAX(AObjects[a2].y2, Object.y2);
AObjects[a2].x1 = qMin(AObjects[a2].x1, Object.x1);
AObjects[a2].y1 = qMin(AObjects[a2].y1, Object.y1);
AObjects[a2].x2 = qMax(AObjects[a2].x2, Object.x2);
AObjects[a2].y2 = qMax(AObjects[a2].y2, Object.y2);
AObjects[a2].Objects.append(currItem);
found = true;
break;
6913,7 → 6913,7
break;
case alignSelection:
for (uint a = 0; a < alignObjectsCount; ++a)
newX = QMIN(AObjects[a].x1, newX);
newX = qMin(AObjects[a].x1, newX);
break;
}
for (int i = loopStart; i <= loopEnd; ++i)
6955,7 → 6955,7
break;
case alignSelection:
for (uint a = 0; a < alignObjectsCount; ++a)
newX = QMIN(AObjects[a].x1, newX);
newX = qMin(AObjects[a].x1, newX);
break;
}
for (int i = loopStart; i <= loopEnd; ++i)
7004,8 → 7004,8
double minX=99999.9, maxX=-99999.9;
for (uint a = 0; a < alignObjectsCount; ++a)
{
minX = QMIN(AObjects[a].x1, minX);
maxX = QMAX(AObjects[a].x2, maxX);
minX = qMin(AObjects[a].x1, minX);
maxX = qMax(AObjects[a].x2, maxX);
}
newX = minX + (maxX-minX)/2;
break;
7051,7 → 7051,7
break;
case alignSelection:
for (uint a = 0; a < alignObjectsCount; ++a)
newX = QMAX(AObjects[a].x2, newX);
newX = qMax(AObjects[a].x2, newX);
break;
}
for (int i = loopStart; i <= loopEnd; ++i)
7095,7 → 7095,7
break;
case alignSelection:
for (uint a = 0; a < alignObjectsCount; ++a)
newX = QMAX(AObjects[a].x2, newX);
newX = qMax(AObjects[a].x2, newX);
break;
}
for (int i = loopStart; i <= loopEnd; ++i)
7137,7 → 7137,7
break;
case alignSelection:
for (uint a = 0; a < alignObjectsCount; ++a)
newY = QMIN(AObjects[a].y1, newY);
newY = qMin(AObjects[a].y1, newY);
break;
}
for (int i = loopStart; i <= loopEnd; ++i)
7179,7 → 7179,7
break;
case alignSelection:
for (uint a = 0; a < alignObjectsCount; ++a)
newY = QMIN(AObjects[a].y1, newY);
newY = qMin(AObjects[a].y1, newY);
break;
}
for (int i = loopStart; i <= loopEnd; ++i)
7229,8 → 7229,8
double minY=99999.9, maxY=-99999.9;
for (uint a = 0; a < alignObjectsCount; ++a)
{
minY = QMIN(AObjects[a].y1, minY);
maxY = QMAX(AObjects[a].y2, maxY);
minY = qMin(AObjects[a].y1, minY);
maxY = qMax(AObjects[a].y2, maxY);
}
newY = minY + (maxY-minY)/2;
break;
7277,7 → 7277,7
break;
case alignSelection:
for (uint a = 0; a < alignObjectsCount; ++a)
newY = QMAX(AObjects[a].y2, newY);
newY = qMax(AObjects[a].y2, newY);
break;
}
for (int i = loopStart; i <= loopEnd; ++i)
7321,7 → 7321,7
break;
case alignSelection:
for (uint a = 0; a < alignObjectsCount; ++a)
newY = QMAX(AObjects[a].y2, newY);
newY = qMax(AObjects[a].y2, newY);
break;
}
for (int i = loopStart; i <= loopEnd; ++i)
8035,7 → 8035,7
void ScribusDoc::createNewDocPages(int pageCount)
{
int setcol = pageSets[currentPageLayout].Columns;
int createCount=QMAX(pageCount,1);
int createCount=qMax(pageCount,1);
if (setcol == 1)
{
for (int i = 0; i < createCount; ++i)
8365,11 → 8365,11
/*
if (!currItem->asLine())
{
newX = QMAX(newX, 1);
newY = QMAX(newY, 1);
newX = qMax(newX, 1);
newY = qMax(newY, 1);
}
*/
int ph = static_cast<int>(QMAX(1.0, currItem->lineWidth() / 2.0));
int ph = static_cast<int>(qMax(1.0, currItem->lineWidth() / 2.0));
QMatrix ma;
ma.rotate(currItem->rotation());
double dX = ma.m11() * (currItem->width() - newX) + ma.m21() * (currItem->height() - newY) + ma.dx();
8389,7 → 8389,7
moveY=0.0;
MoveItem(moveX, moveY, currItem);
}
currItem->setCornerRadius(QMIN(currItem->cornerRadius(), QMIN(currItem->width(),currItem->height())/2));
currItem->setCornerRadius(qMin(currItem->cornerRadius(), qMin(currItem->width(),currItem->height())/2));
if ((currItem->asImageFrame()) && (!currItem->Sizing) && (!EditClip))
{
currItem->AdjustPictScale();
8578,7 → 8578,7
currItem->ClipEdited = true;
currItem->PoLine = Clip.copy();
if (currItem->asPolyLine())
currItem->setPolyClip(qRound(QMAX(currItem->lineWidth() / 2, 1)));
currItem->setPolyClip(qRound(qMax(currItem->lineWidth() / 2, 1)));
else if (currItem->asPathText())
currItem->updatePolyClip();
else
/branches/Version135x/Scribus/scribus/pdflib.cpp
291,7 → 291,7
data[dlen++] = 0;
QByteArray step1(16);
step1 = ComputeMD5Sum(&data);
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), QMIN(KeyLen+5, 16));
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), qMin(KeyLen+5, 16));
rc4_encrypt(&rc4, reinterpret_cast<uchar*>(us.data()), reinterpret_cast<uchar*>(ou.data()), tmp.length());
QString uk = "";
for (int cl = 0; cl < tmp.length(); ++cl)
323,7 → 323,7
data[dlen++] = 0;
QByteArray step1(16);
step1 = ComputeMD5Sum(&data);
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), QMIN(KeyLen+5, 16));
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), qMin(KeyLen+5, 16));
rc4_encrypt(&rc4, reinterpret_cast<uchar*>(in.data()), reinterpret_cast<uchar*>(out.data()), in.size());
return out;
}
357,7 → 357,7
data[dlen++] = 0;
QByteArray step1(16);
step1 = ComputeMD5Sum(&data);
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), QMIN(KeyLen+5, 16));
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), qMin(KeyLen+5, 16));
rc4_encrypt(&rc4, reinterpret_cast<uchar*>(us.data()), reinterpret_cast<uchar*>(ou.data()), tmp.length());
QString uk = "";
for (int cl = 0; cl < tmp.length(); ++cl)
400,7 → 400,7
data[dlen++] = 0;
QByteArray step1(16);
step1 = ComputeMD5Sum(&data);
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), QMIN(KeyLen+5, 16));
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), qMin(KeyLen+5, 16));
rc4_encrypt(&rc4, reinterpret_cast<uchar*>(us.data()), reinterpret_cast<uchar*>(ou.data()), ou.size());
QString uk = "";
for (int cl = 0; cl < ou.size(); ++cl)
867,10 → 867,10
np1 = FPoint(0, 0);
}
fon.prepend(QString::number(qRound(np1.x())) + " 0 "+QString::number(qRound(np.x()))+" "+QString::number(qRound(np.y()))+" "+QString::number(qRound(np1.x()))+ " "+QString::number(qRound(np1.y()))+" d1\n");
minx = QMIN(minx, np.x());
miny = QMIN(miny, np.y());
maxx = QMAX(maxx, np1.x());
maxy = QMAX(maxy, np1.y());
minx = qMin(minx, np.x());
miny = qMin(miny, np.y());
maxx = qMax(maxx, np1.x());
maxy = qMax(maxy, np1.y());
glyphWidths.append(qRound(np1.x()));
charProcs.append("/"+gl[ig.key()].second+" "+QString::number(ObjCounter)+" 0 R\n");
encoding += "/"+gl[ig.key()].second+" ";
1543,7 → 1543,7
double y2 = ite->BoundingY - ilw / 2.0;
double w2 = ite->BoundingW + ilw;
double h2 = ite->BoundingH + ilw;
if (!( QMAX( x, x2 ) <= QMIN( x+w, x2+w2 ) && QMAX( y, y2 ) <= QMIN( y+h1, y2+h2 )))
if (!( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h1, y2+h2 )))
continue;
if (ite->ChangedMasterItem)
continue;
2681,7 → 2681,7
double y2 = ite->BoundingY - ilw / 2.0;
double w2 = ite->BoundingW + ilw;
double h2 = ite->BoundingH + ilw;
if (!( QMAX( x, x2 ) <= QMIN( x+w, x2+w2 ) && QMAX( y, y2 ) <= QMIN( y+h1, y2+h2 )))
if (!( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h1, y2+h2 )))
continue;
if (ite->ChangedMasterItem)
continue;
3141,7 → 3141,7
{
// qDebug(QString("pdflib process item: pagename=%1 ownpage=%2 pagenr=%3 changedMP=%4").arg(pag->pageName()).arg(ite->OwnPage).arg(pag->pageNr()).arg(ite->ChangedMasterItem));
// qDebug(QString("pdflib process item: x=%1 x2=%2 y=%3 y2=%4 w=%5 w2=%6 h1=%7 h2=%8 ilw=%9").arg(x).arg(x2).arg(y).arg(y2).arg(w).arg(w2).arg(h1).arg(h2).arg(ilw));
if (!( QMAX( x, x2 ) <= QMIN( x+w, x2+w2 ) && QMAX( y, y2 ) <= QMIN( y+h1, y2+h2 )))
if (!( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h1, y2+h2 )))
return tmp;
// qDebug("bb test done");
if (ite->ChangedMasterItem)
4332,7 → 4332,7
}
if (hl->glyph.scaleV != 1.0)
tmp2 += "1 0 0 1 0 "+FToStr( (((tsz / 10.0) - (tsz / 10.0) * (hl->glyph.scaleV)) / (tsz / 10.0)) * -1)+" cm\n";
tmp2 += FToStr(QMAX(hl->glyph.scaleH, 0.1))+" 0 0 "+FToStr(QMAX(hl->glyph.scaleV, 0.1))+" 0 0 cm\n";
tmp2 += FToStr(qMax(hl->glyph.scaleH, 0.1))+" 0 0 "+FToStr(qMax(hl->glyph.scaleV, 0.1))+" 0 0 cm\n";
if (style.fillColor() != CommonStrings::None)
tmp2 += "/"+style.font().psName().replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "_" )+QString::number(glyph)+" Do\n";
if (style.effects() & ScStyle_Outline)
4406,13 → 4406,13
if (ite->reversed())
{
double wtr = hl->glyph.xadvance;
tmp += FToStr(-QMAX(hl->glyph.scaleH, 0.1))+" 0 0 "+FToStr(QMAX(hl->glyph.scaleV, 0.1)) +" "+FToStr(x+hl->glyph.xoffset+wtr)+" "+FToStr(-y-hl->glyph.yoffset+(style.fontSize() / 10.0) * (style.baselineOffset() / 1000.0))+" Tm\n";
tmp += FToStr(-qMax(hl->glyph.scaleH, 0.1))+" 0 0 "+FToStr(qMax(hl->glyph.scaleV, 0.1)) +" "+FToStr(x+hl->glyph.xoffset+wtr)+" "+FToStr(-y-hl->glyph.yoffset+(style.fontSize() / 10.0) * (style.baselineOffset() / 1000.0))+" Tm\n";
}
else
tmp += FToStr(QMAX(hl->glyph.scaleH, 0.1))+" 0 0 "+FToStr(QMAX(hl->glyph.scaleV, 0.1))+" "+FToStr(x+hl->glyph.xoffset)+" "+FToStr(-y-hl->glyph.yoffset+(style.fontSize() / 10.0) * (style.baselineOffset() / 1000.0))+" Tm\n";
tmp += FToStr(qMax(hl->glyph.scaleH, 0.1))+" 0 0 "+FToStr(qMax(hl->glyph.scaleV, 0.1))+" "+FToStr(x+hl->glyph.xoffset)+" "+FToStr(-y-hl->glyph.yoffset+(style.fontSize() / 10.0) * (style.baselineOffset() / 1000.0))+" Tm\n";
}
else
tmp += FToStr(QMAX(hl->glyph.scaleH, 0.1))+" 0 0 "+FToStr(QMAX(hl->glyph.scaleV, 0.1))+" 0 0 Tm\n";
tmp += FToStr(qMax(hl->glyph.scaleH, 0.1))+" 0 0 "+FToStr(qMax(hl->glyph.scaleV, 0.1))+" 0 0 Tm\n";
uchar idx2;
if (Options.SubsetList.contains(style.font().replacementName()))
idx2 = Type3Fonts[UsedFontsP[style.font().replacementName()]][idx] % 255;
5468,7 → 5468,7
PutDoc("/FT /Tx\n");
PutDoc("/V "+EncString("("+bm+")",ObjCounter-1)+"\n");
PutDoc("/DV "+EncString("("+bm+")",ObjCounter-1)+"\n");
PutDoc("/Q "+QString::number(QMIN(ite->itemText.defaultStyle().alignment(),2))+"\n");
PutDoc("/Q "+QString::number(qMin(ite->itemText.defaultStyle().alignment(),2))+"\n");
PutDoc("/AP << /N "+QString::number(ObjCounter)+" 0 R >>\n");
if (ite->annotation().MaxChar() != -1)
PutDoc("/MaxLen "+QString::number(ite->annotation().MaxChar())+"\n");
5557,7 → 5557,7
if ((ite->width()/ite->imageXScale() - ite->pixm.width()) != 0)
{
if (ite->annotation().ScaleW() == 3)
PutDoc(FToStr(QMAX(ite->imageXOffset() / (ite->width()/ite->imageXScale() - ite->pixm.width()), 0.01)));
PutDoc(FToStr(qMax(ite->imageXOffset() / (ite->width()/ite->imageXScale() - ite->pixm.width()), 0.01)));
else
PutDoc("0.5 ");
}
5566,7 → 5566,7
if ((ite->height()/ite->imageYScale() - ite->pixm.height()) != 0)
{
if (ite->annotation().ScaleW() == 3)
PutDoc(FToStr(QMAX(ite->imageYOffset() / (ite->height()/ite->imageYScale() - ite->pixm.height()), 0.01)));
PutDoc(FToStr(qMax(ite->imageYOffset() / (ite->height()/ite->imageYScale() - ite->pixm.height()), 0.01)));
else
PutDoc("0.5");
}
5981,7 → 5981,7
QString tmpFile = QDir::convertSeparators(ScPaths::getTempFileDir() + "sc.png");
if (Options.RecalcPic)
{
afl = QMIN(Options.PicRes, Options.Resolution);
afl = qMin(Options.PicRes, Options.Resolution);
aufl = afl / 72.0;
}
else
6086,9 → 6086,9
img.LoadPicture(fn, cms, Embedded, true, ScImage::CMYKData, 72, &realCMYK);
}
}
if ((Options.RecalcPic) && (Options.PicRes < (QMAX(72.0 / c->imageXScale(), 72.0 / c->imageYScale()))))
if ((Options.RecalcPic) && (Options.PicRes < (qMax(72.0 / c->imageXScale(), 72.0 / c->imageYScale()))))
{
double afl = QMIN(Options.PicRes, Options.Resolution);
double afl = qMin(Options.PicRes, Options.Resolution);
a2 = (72.0 / sx) / afl;
a1 = (72.0 / sy) / afl;
origWidth = img.width();
6203,7 → 6203,7
origWidth = img.width();
origHeight = img.height();
img.applyEffect(c->effectsInUse, c->doc()->PageColors, imgE);
if (!((Options.RecalcPic) && (Options.PicRes < (QMAX(72.0 / c->imageXScale(), 72.0 / c->imageYScale())))))
if (!((Options.RecalcPic) && (Options.PicRes < (qMax(72.0 / c->imageXScale(), 72.0 / c->imageYScale())))))
{
sxn = sx * (1.0 / aufl);
syn = sy * (1.0 / aufl);
6287,13 → 6287,13
bool specialCMYK = false;
if (((ext == "jpg") || (ext == "jpeg")) && (cm != 3))
{
if (((Options.UseRGB || Options.UseProfiles2) && (cm == 0) && (c->effectsInUse.count() == 0) && (img.imgInfo.colorspace == 0)) && (!img.imgInfo.progressive) && (!((Options.RecalcPic) && (Options.PicRes < (QMAX(72.0 / c->imageXScale(), 72.0 / c->imageYScale()))))))
if (((Options.UseRGB || Options.UseProfiles2) && (cm == 0) && (c->effectsInUse.count() == 0) && (img.imgInfo.colorspace == 0)) && (!img.imgInfo.progressive) && (!((Options.RecalcPic) && (Options.PicRes < (qMax(72.0 / c->imageXScale(), 72.0 / c->imageYScale()))))))
{
im.resize(0);
loadRawBytes(fn, im);
cm = 1;
}
else if (((!Options.UseRGB) && (!Options.isGrayscale) && (!Options.UseProfiles2)) && (cm== 0) && (c->effectsInUse.count() == 0) && (img.imgInfo.colorspace == 1) && (!((Options.RecalcPic) && (Options.PicRes < (QMAX(72.0 / c->imageXScale(), 72.0 / c->imageYScale()))))) && (!img.imgInfo.progressive))
else if (((!Options.UseRGB) && (!Options.isGrayscale) && (!Options.UseProfiles2)) && (cm== 0) && (c->effectsInUse.count() == 0) && (img.imgInfo.colorspace == 1) && (!((Options.RecalcPic) && (Options.PicRes < (qMax(72.0 / c->imageXScale(), 72.0 / c->imageYScale()))))) && (!img.imgInfo.progressive))
{
im.resize(0);
loadRawBytes(fn, im);
/branches/Version135x/Scribus/scribus/vgradientex.cpp
154,11 → 154,11
VGradientEx::addStop( const ScColor &color, double rampPoint, double midPoint, double opa, QString name, int shade )
{
// Clamping between 0.0 and 1.0
rampPoint = QMAX( 0.0, rampPoint );
rampPoint = QMIN( 1.0, rampPoint );
rampPoint = qMax( 0.0, rampPoint );
rampPoint = qMin( 1.0, rampPoint );
// Clamping between 0.0 and 1.0
midPoint = QMAX( 0.0, midPoint );
midPoint = QMIN( 1.0, midPoint );
midPoint = qMax( 0.0, midPoint );
midPoint = qMin( 1.0, midPoint );
 
m_colorStops.inSort( new VColorStopEx( rampPoint, midPoint, color, opa, name, shade ) );
}
/branches/Version135x/Scribus/scribus/marginWidget.cpp
249,8 → 249,8
 
void MarginWidget::setPageWidth(double width)
{
rightR->setMaxValue(QMAX(0.0, width * m_unitRatio - leftR->value()));
leftR->setMaxValue(QMAX(0.0,width * m_unitRatio - rightR->value()));
rightR->setMaxValue(qMax(0.0, width * m_unitRatio - leftR->value()));
leftR->setMaxValue(qMax(0.0,width * m_unitRatio - rightR->value()));
pageWidth = width;
setPreset();
}
257,8 → 257,8
 
void MarginWidget::setPageHeight(double height)
{
topR->setMaxValue(QMAX(0.0, height * m_unitRatio - bottomR->value()));
bottomR->setMaxValue(QMAX(0.0,height * m_unitRatio - topR->value()));
topR->setMaxValue(qMax(0.0, height * m_unitRatio - bottomR->value()));
bottomR->setMaxValue(qMax(0.0,height * m_unitRatio - topR->value()));
pageHeight = height;
setPreset();
}
266,7 → 266,7
void MarginWidget::setTop()
{
RandT = topR->value() / m_unitRatio;
bottomR->setMaxValue(QMAX(0.0, pageHeight * m_unitRatio - topR->value()));
bottomR->setMaxValue(qMax(0.0, pageHeight * m_unitRatio - topR->value()));
setPreset();
}
 
273,7 → 273,7
void MarginWidget::setBottom()
{
RandB = bottomR->value() / m_unitRatio;
topR->setMaxValue(QMAX(0.0, pageHeight * m_unitRatio - bottomR->value()));
topR->setMaxValue(qMax(0.0, pageHeight * m_unitRatio - bottomR->value()));
setPreset();
}
 
280,7 → 280,7
void MarginWidget::setLeft()
{
RandL = leftR->value() / m_unitRatio;
rightR->setMaxValue(QMAX(0.0, pageWidth * m_unitRatio - leftR->value()));
rightR->setMaxValue(qMax(0.0, pageWidth * m_unitRatio - leftR->value()));
setPreset();
}
 
287,7 → 287,7
void MarginWidget::setRight()
{
RandR = rightR->value() / m_unitRatio;
leftR->setMaxValue(QMAX(0.0, pageWidth * m_unitRatio - rightR->value()));
leftR->setMaxValue(qMax(0.0, pageWidth * m_unitRatio - rightR->value()));
setPreset();
}
 
356,18 → 356,18
facingPages ? presetCombo->setEnabled(true) : presetCombo->setEnabled(false);
if (presetCombo->needUpdate() && facingPages)
{
leftR->setValue(QMAX(0.0, marg.Left));
rightR->setValue(QMAX(0.0, marg.Right));
topR->setValue(QMAX(0.0, marg.Top));
bottomR->setValue(QMAX(0.0, marg.Bottom));
leftR->setValue(qMax(0.0, marg.Left));
rightR->setValue(qMax(0.0, marg.Right));
topR->setValue(qMax(0.0, marg.Top));
bottomR->setValue(qMax(0.0, marg.Bottom));
RandT = topR->value() / m_unitRatio;
RandB = bottomR->value() / m_unitRatio;
RandL = leftR->value() / m_unitRatio;
RandR = rightR->value() / m_unitRatio;
bottomR->setMaxValue(QMAX(0.0, pageHeight * m_unitRatio - topR->value()));
topR->setMaxValue(QMAX(0.0, pageHeight * m_unitRatio - bottomR->value()));
rightR->setMaxValue(QMAX(0.0, pageWidth * m_unitRatio - leftR->value()));
leftR->setMaxValue(QMAX(0.0, pageWidth * m_unitRatio - rightR->value()));
bottomR->setMaxValue(qMax(0.0, pageHeight * m_unitRatio - topR->value()));
topR->setMaxValue(qMax(0.0, pageHeight * m_unitRatio - bottomR->value()));
rightR->setMaxValue(qMax(0.0, pageWidth * m_unitRatio - leftR->value()));
leftR->setMaxValue(qMax(0.0, pageWidth * m_unitRatio - rightR->value()));
rightR->setEnabled(false);
topR->setEnabled(false);
bottomR->setEnabled(false);
409,10 → 409,10
RandL = l;
RandR = r;
 
bottomR->setMaxValue((QMAX(0.0, pageHeight - t) * m_unitRatio));
topR->setMaxValue((QMAX(0.0, pageHeight - b) * m_unitRatio));
rightR->setMaxValue((QMAX(0.0, pageWidth - l) * m_unitRatio));
leftR->setMaxValue((QMAX(0.0, pageWidth - r) * m_unitRatio));
bottomR->setMaxValue((qMax(0.0, pageHeight - t) * m_unitRatio));
topR->setMaxValue((qMax(0.0, pageHeight - b) * m_unitRatio));
rightR->setMaxValue((qMax(0.0, pageWidth - l) * m_unitRatio));
leftR->setMaxValue((qMax(0.0, pageWidth - r) * m_unitRatio));
 
rightR->setEnabled(true);
topR->setEnabled(true);
/branches/Version135x/Scribus/scribus/stencilreader.cpp
78,7 → 78,7
parseGroupProperties(data, group, DOC, groupElemCounter, minXCoor, minYCoor, maxXCoor, maxYCoor, firstCheck);
GrW = maxXCoor - minXCoor;
GrH = maxYCoor - minYCoor;
Conversion = 100.0 / QMAX(GrW, GrH);
Conversion = 100.0 / qMax(GrW, GrH);
GrW *= Conversion;
GrH *= Conversion;
Dx = minXCoor * Conversion;
652,10 → 652,10
}
else
{
minXCoor = QMIN(minXCoor, tp2.x());
minYCoor = QMIN(minYCoor, tp2.y());
maxXCoor = QMAX(maxXCoor, tp2.x() + wh.x());
maxYCoor = QMAX(maxYCoor, tp2.y() + wh.y());
minXCoor = qMin(minXCoor, tp2.x());
minYCoor = qMin(minYCoor, tp2.y());
maxXCoor = qMax(maxXCoor, tp2.x() + wh.x());
maxYCoor = qMax(maxYCoor, tp2.y() + wh.y());
}
DOC = DOC.nextSibling();
}
1100,7 → 1100,7
QDomElement dims = list.item(0).toElement();
GrW = dims.attribute("w","50").toDouble()+10;
GrH = dims.attribute("h","50").toDouble()+10;
pmmax = 60 / QMAX(GrW, GrH);
pmmax = 60 / qMax(GrW, GrH);
tmp = QPixmap(static_cast<int>(GrW), static_cast<int>(GrH));
pS = new ScPainter(&tmp, tmp.width(), tmp.height());
pS->translate(5, 5);
/branches/Version135x/Scribus/scribus/sccolor.cpp
118,9 → 118,9
}
else
{
*r = 255-QMIN(255, CR + K);
*g = 255-QMIN(255, MG + K);
*b = 255-QMIN(255, YB + K);
*r = 255-qMin(255, CR + K);
*g = 255-qMin(255, MG + K);
*b = 255-qMin(255, YB + K);
}
}
 
128,7 → 128,7
{
if (Model == colorModelRGB)
return QColor(CR, MG, YB);
return QColor(255-QMIN(255, CR + K), 255-QMIN(255, MG + K), 255 - QMIN(255, YB + K));
return QColor(255-qMin(255, CR + K), 255-qMin(255, MG + K), 255 - qMin(255, YB + K));
}
 
void ScColor::getRGB(int *r, int *g, int *b) const
/branches/Version135x/Scribus/scribus/docsections.cpp
284,7 → 284,7
localSections.insert(i++, it.data());
}
int newCount=localSections.count();
//int preIndex=QMAX(currentIndex-1, 0);
//int preIndex=qMax(currentIndex-1, 0);
localSections[0].fromindex=0;
localSections[newCount-1].toindex=m_maxpageindex;
updateTable();
/branches/Version135x/Scribus/scribus/scimgdataloader_tiff.cpp
651,7 → 651,7
cc = 255 - qRed(*s);
cm = 255 - qGreen(*s);
cy = 255 - qBlue(*s);
ck = QMIN(QMIN(cc, cm), cy);
ck = qMin(qMin(cc, cm), cy);
d[0] = cc-ck;
d[1] = cm-ck;
d[2] = cy-ck;
1110,12 → 1110,12
bool createOk = false;
if (header.color_mode == CM_CMYK)
{
createOk = r2_image.create(layerInfo[layer].width, layerInfo[layer].height, QMAX(channel_num, 5));
createOk = r2_image.create(layerInfo[layer].width, layerInfo[layer].height, qMax(channel_num, 5));
r2_image.fill(0);
}
else
{
createOk = r2_image.create(layerInfo[layer].width, layerInfo[layer].height, QMAX(channel_num, 4));
createOk = r2_image.create(layerInfo[layer].width, layerInfo[layer].height, qMax(channel_num, 4));
r2_image.fill(0);
}
if( !createOk )
1127,7 → 1127,7
s.device()->at( base2 );
return false;
}
channel_num = QMIN(channel_num, 39);
channel_num = qMin(channel_num, 39);
uint components[40];
for(uint channel = 0; channel < channel_num; channel++)
{
1286,13 → 1286,13
}
if (*firstLayer)
{
for( int yi=static_cast<int>(startSrcY); yi < QMIN(r2_image.height(), r_image.height()); ++yi )
for( int yi=static_cast<int>(startSrcY); yi < qMin(r2_image.height(), r_image.height()); ++yi )
{
unsigned char *s = r2_image.scanLine( yi );
unsigned char *d = r_image.scanLine( QMIN(static_cast<int>(startDstY), r_image.height()-1) );
d += QMIN(static_cast<int>(startDstX), r_image.width()-1) * r_image.channels();
s += QMIN(static_cast<int>(startSrcX), r2_image.width()-1) * r2_image.channels();
for(int xi=static_cast<int>(startSrcX); xi < QMIN(r2_image.width(), r_image.width()); ++xi )
unsigned char *d = r_image.scanLine( qMin(static_cast<int>(startDstY), r_image.height()-1) );
d += qMin(static_cast<int>(startDstX), r_image.width()-1) * r_image.channels();
s += qMin(static_cast<int>(startSrcX), r2_image.width()-1) * r2_image.channels();
for(int xi=static_cast<int>(startSrcX); xi < qMin(r2_image.width(), r_image.width()); ++xi )
{
d[0] = s[0];
d[1] = s[1];
1322,21 → 1322,21
{
for (int i = static_cast<int>(startSrcY); i < layerInfo[layer].height; i++)
{
unsigned char *d = r_image.scanLine(QMIN(static_cast<int>(startDstY), r_image.height()-1));
unsigned char *s = r2_image.scanLine(QMIN(i, r2_image.height()-1));
d += QMIN(static_cast<int>(startDstX), r_image.width()-1) * r_image.channels();
s += QMIN(static_cast<int>(startSrcX), r2_image.width()-1) * r2_image.channels();
unsigned char *d = r_image.scanLine(qMin(static_cast<int>(startDstY), r_image.height()-1));
unsigned char *s = r2_image.scanLine(qMin(i, r2_image.height()-1));
d += qMin(static_cast<int>(startDstX), r_image.width()-1) * r_image.channels();
s += qMin(static_cast<int>(startSrcX), r2_image.width()-1) * r2_image.channels();
unsigned char *sm = 0;
if (hasMask)
{
sm = mask.scanLine(QMIN(i, mask.height()-1));
sm += QMIN(static_cast<int>(startSrcXm), mask.width()-1) * mask.channels();
sm = mask.scanLine(qMin(i, mask.height()-1));
sm += qMin(static_cast<int>(startSrcXm), mask.width()-1) * mask.channels();
}
startDstY++;
unsigned char r, g, b, src_r, src_g, src_b, src_a, src_alpha, dst_alpha;
unsigned char a = 0;
unsigned int maxDestX = r_image.width() - startDstX + startSrcX - 1;
for (unsigned int j = startSrcX; j < QMIN(maxDestX, static_cast<unsigned int>(layerInfo[layer].width)); j++)
for (unsigned int j = startSrcX; j < qMin(maxDestX, static_cast<unsigned int>(layerInfo[layer].width)); j++)
{
src_r = s[0];
src_g = s[1];
/branches/Version135x/Scribus/scribus/story.cpp
433,7 → 433,7
if (hasSelectedText())
deleteSel();
getCursorPosition(&p, &i);
int pos = QMIN(StyledText.startOfParagraph(p) + i, StyledText.length());
int pos = qMin(StyledText.startOfParagraph(p) + i, StyledText.length());
StyledText.insertChars(pos, t);
}
 
445,7 → 445,7
if (hasSelectedText())
deleteSel();
getCursorPosition(&p, &i);
int pos = QMIN(StyledText.startOfParagraph(p) + i, StyledText.length());
int pos = qMin(StyledText.startOfParagraph(p) + i, StyledText.length());
StyledText.insert(pos, cBuffer);
}
 
1301,14 → 1301,14
void StoryEditor::loadPrefs()
{
prefs = PrefsManager::instance()->prefsFile->getPluginContext("StoryEditor");
int vleft = QMAX(-80, prefs->getInt("left", 10));
int vleft = qMax(-80, prefs->getInt("left", 10));
#if defined(QT_MAC) || defined(_WIN32)
int vtop = QMAX(64, prefs->getInt("top", 10));
int vtop = qMax(64, prefs->getInt("top", 10));
#else
int vtop = QMAX(-80, prefs->getInt("top", 10));
int vtop = qMax(-80, prefs->getInt("top", 10));
#endif
int vwidth = QMAX(600, prefs->getInt("width", 600));
int vheight = QMAX(400, prefs->getInt("height", 400));
int vwidth = qMax(600, prefs->getInt("width", 600));
int vheight = qMax(400, prefs->getInt("height", 400));
// Check values against current screen size
QRect scr = QApplication::desktop()->screen()->geometry();
QSize gStrut = QApplication::globalStrut();
1317,9 → 1317,9
if ( vtop >= scr.height() )
vtop = 64;
if ( vwidth >= scr.width() )
vwidth = QMAX( gStrut.width(), scr.width() - vleft );
vwidth = qMax( gStrut.width(), scr.width() - vleft );
if ( vheight >= scr.height() )
vheight = QMAX( gStrut.height(), scr.height() - vtop );
vheight = qMax( gStrut.height(), scr.height() - vtop );
setGeometry(vleft, vtop, vwidth, vheight);
int side = prefs->getInt("side", -1);
int txtarea = prefs->getInt("main", -1);
2162,12 → 2162,12
Editor->getSelection(&PStart, &SelStart, &PEnd, &SelEnd);
start = Editor->StyledText.startOfParagraph(PStart);
if (SelStart >= 0 && start + SelStart < Editor->StyledText.endOfParagraph(PStart))
start = QMIN(start + SelStart, Editor->StyledText.endOfParagraph(PStart)-1);
start = qMin(start + SelStart, Editor->StyledText.endOfParagraph(PStart)-1);
else
start = QMIN(start + QMAX(ch-1, 0), Editor->StyledText.endOfParagraph(p)-1);
start = qMin(start + qMax(ch-1, 0), Editor->StyledText.endOfParagraph(p)-1);
}
else
start = QMIN(Editor->StyledText.startOfParagraph(p) + QMAX(ch-1, 0), Editor->StyledText.endOfParagraph(p)-1);
start = qMin(Editor->StyledText.startOfParagraph(p) + qMax(ch-1, 0), Editor->StyledText.endOfParagraph(p)-1);
if (start >= Editor->StyledText.length())
start = Editor->StyledText.length() - 1;
if (start < 0)
/branches/Version135x/Scribus/scribus/scimgdataloader_qt.cpp
41,11 → 41,11
int resInf = m_imageInfoRecord.lowResType;
m_image = m_image.convertDepth(32);
m_image.setAlphaBuffer(true);
m_image.setDotsPerMeterX (QMAX(2834, (int) (xres / 0.0254)));
m_image.setDotsPerMeterY (QMAX(2834, (int) (yres / 0.0254)));
m_image.setDotsPerMeterX (qMax(2834, (int) (xres / 0.0254)));
m_image.setDotsPerMeterY (qMax(2834, (int) (yres / 0.0254)));
m_imageInfoRecord.colorspace = 0;
m_imageInfoRecord.xres = QMAX(72, qRound(xres));
m_imageInfoRecord.yres = QMAX(72, qRound(yres));
m_imageInfoRecord.xres = qMax(72, qRound(xres));
m_imageInfoRecord.yres = qMax(72, qRound(yres));
m_imageInfoRecord.lowResType = resInf;
m_imageInfoRecord.BBoxX = 0;
m_imageInfoRecord.BBoxH = m_image.height();
/branches/Version135x/Scribus/scribus/scrpalettebase.cpp
137,22 → 137,22
if (palettePrefs->contains("left"))
{
// all palettes should have enough room for 3x3 min widgets
int vwidth = QMIN(QMAX(3*gStrut.width(), palettePrefs->getInt("width")),
int vwidth = qMin(qMax(3*gStrut.width(), palettePrefs->getInt("width")),
d->width());
int vheight = QMIN(QMAX(3*gStrut.height(), palettePrefs->getInt("height")),
int vheight = qMin(qMax(3*gStrut.height(), palettePrefs->getInt("height")),
d->height());
// palettes should not use too much screen space
if (vwidth > d->width()/3 && vheight > d->height()/3)
vwidth = d->width()/3;
// and should be partly visible
int vleft = QMIN(QMAX(-vwidth + gStrut.width(), palettePrefs->getInt("left")),
int vleft = qMin(qMax(-vwidth + gStrut.width(), palettePrefs->getInt("left")),
d->width() - gStrut.width());
int vtop = QMIN(palettePrefs->getInt("top"), d->height() - gStrut.height());
int vtop = qMin(palettePrefs->getInt("top"), d->height() - gStrut.height());
#if defined(QT_MAC) || defined(_WIN32)
// on Mac and Windows you're dead if the titlebar is not on screen
vtop = QMAX(64, vtop);
vtop = qMax(64, vtop);
#else
vtop = QMAX(-vheight + gStrut.height(), vtop);
vtop = qMax(-vheight + gStrut.height(), vtop);
#endif
// Check values against current screen size
QRect scr = QApplication::desktop()->screen()->geometry();
161,9 → 161,9
if ( vtop >= scr.height() )
vtop = 64;
if ( vwidth >= scr.width() )
vwidth = QMAX( gStrut.width(), scr.width() - vleft );
vwidth = qMax( gStrut.width(), scr.width() - vleft );
if ( vheight >= scr.height() )
vheight = QMAX( gStrut.height(), scr.height() - vtop );
vheight = qMax( gStrut.height(), scr.height() - vtop );
// qDebug(QString("root %1x%2 %7 palette %3x%4 @ (%5,%6)").arg(d->width()).arg(d->height())
// .arg(vwidth).arg(vheight).arg(vleft).arg(vtop).arg(name()));
// setGeometry(vleft, vtop, vwidth, vheight);
/branches/Version135x/Scribus/scribus/smlinestyle.cpp
859,7 → 859,7
for (int it = (*tmpLine).size()-1; it > -1; it--)
{
p.setPen(QPen(calcFarbe((*tmpLine)[it].Color, (*tmpLine)[it].Shade),
QMAX(static_cast<int>((*tmpLine)[it].Width), 1),
qMax(static_cast<int>((*tmpLine)[it].Width), 1),
static_cast<Qt::PenStyle>((*tmpLine)[it].Dash),
static_cast<Qt::PenCapStyle>((*tmpLine)[it].LineEnd),
static_cast<Qt::PenJoinStyle>((*tmpLine)[it].LineJoin)));
/branches/Version135x/Scribus/scribus/scpainter.cpp
493,15 → 493,15
}
else if (m_blendMode == 10)
{
src_r = src_r == 255 ? QMIN(255, dst_r * 256) : QMIN(255, ((dst_r * 256) / (255-src_r)));
src_g = src_g == 255 ? QMIN(255, dst_g * 256) : QMIN(255, ((dst_g * 256) / (255-src_g)));
src_b = src_b == 255 ? QMIN(255, dst_b * 256) : QMIN(255, ((dst_b * 256) / (255-src_b)));
src_r = src_r == 255 ? qMin(255, dst_r * 256) : qMin(255, ((dst_r * 256) / (255-src_r)));
src_g = src_g == 255 ? qMin(255, dst_g * 256) : qMin(255, ((dst_g * 256) / (255-src_g)));
src_b = src_b == 255 ? qMin(255, dst_b * 256) : qMin(255, ((dst_b * 256) / (255-src_b)));
}
else if (m_blendMode == 11)
{
src_r = QMAX(1, src_r);
src_g = QMAX(1, src_g);
src_b = QMAX(1, src_b);
src_r = qMax(1, src_r);
src_g = qMax(1, src_g);
src_b = qMax(1, src_b);
src_r = static_cast<int>(255 - (((255-dst_r) * 256) / src_r)) < 0 ? 0 : 255 - (((255-dst_r) * 256) / src_r);
src_g = static_cast<int>(255 - (((255-dst_g) * 256) / src_g)) < 0 ? 0 : 255 - (((255-dst_g) * 256) / src_g);
src_b = static_cast<int>(255 - (((255-dst_b) * 256) / src_b)) < 0 ? 0 : 255 - (((255-dst_b) * 256) / src_b);
511,15 → 511,15
/* This code is a blendmode that simulates the effect of overprinting
Works by converting source and destination colour to CMYK and adding them together
Finally the result is converted back to RGB */
/* int K1 = QMIN(QMIN(255 - src_r, 255 - src_g), 255 - src_b);
int K2 = QMIN(QMIN(255 - dst_r, 255 - dst_g), 255 - dst_b);
int C = QMIN(QMIN(255 - src_r - K1, 255) + QMIN(255 - dst_r - K2, 255), 255);
int M = QMIN(QMIN(255 - src_g - K1, 255) + QMIN(255 - dst_g - K2, 255), 255) ;
int Y = QMIN(QMIN(255 - src_b - K1, 255) + QMIN(255 - dst_b - K2, 255), 255) ;
int K = QMIN(K1 + K2, 255);
src_r = 255 - QMIN(255, C + K);
src_g = 255 - QMIN(255, M + K);
src_b = 255 - QMIN(255, Y+ K);
/* int K1 = qMin(qMin(255 - src_r, 255 - src_g), 255 - src_b);
int K2 = qMin(qMin(255 - dst_r, 255 - dst_g), 255 - dst_b);
int C = qMin(qMin(255 - src_r - K1, 255) + qMin(255 - dst_r - K2, 255), 255);
int M = qMin(qMin(255 - src_g - K1, 255) + qMin(255 - dst_g - K2, 255), 255) ;
int Y = qMin(qMin(255 - src_b - K1, 255) + qMin(255 - dst_b - K2, 255), 255) ;
int K = qMin(K1 + K2, 255);
src_r = 255 - qMin(255, C + K);
src_g = 255 - qMin(255, M + K);
src_b = 255 - qMin(255, Y+ K);
} */
else if (m_blendMode == 12)
{
1050,8 → 1050,8
LineWidth = w;
PLineEnd = ca;
PLineJoin = jo;
double Dt = QMAX(2*w, 1);
double Da = QMAX(6*w, 1);
double Dt = qMax(2*w, 1);
double Da = qMax(6*w, 1);
Q3ValueList<double> tmp;
m_array.clear();
m_offset = 0;
1786,14 → 1786,14
 
void ScPainter::clampToViewport( int &x0, int &y0, int &x1, int &y1 )
{
x0 = QMAX( x0, 0 );
x0 = QMIN( x0, static_cast<int>( m_width ) );
y0 = QMAX( y0, 0 );
y0 = QMIN( y0, static_cast<int>( m_height ) );
x1 = QMAX( x1, 0 );
x1 = QMIN( x1, static_cast<int>( m_width ) );
y1 = QMAX( y1, 0 );
y1 = QMIN( y1, static_cast<int>( m_height ) );
x0 = qMax( x0, 0 );
x0 = qMin( x0, static_cast<int>( m_width ) );
y0 = qMax( y0, 0 );
y0 = qMin( y0, static_cast<int>( m_height ) );
x1 = qMax( x1, 0 );
x1 = qMin( x1, static_cast<int>( m_width ) );
y1 = qMax( y1, 0 );
y1 = qMin( y1, static_cast<int>( m_height ) );
}
 
void ScPainter::clampToViewport( const _ArtSVP &svp, int &x0, int &y0, int &x1, int &y1 )
1801,17 → 1801,17
ArtDRect bbox;
art_drect_svp( &bbox, &svp );
x0 = static_cast<int>( bbox.x0 );
x0 = QMAX( x0, 0 );
x0 = QMIN( x0, static_cast<int>( m_width ) );
x0 = qMax( x0, 0 );
x0 = qMin( x0, static_cast<int>( m_width ) );
y0 = static_cast<int>( bbox.y0 );
y0 = QMAX( y0, 0 );
y0 = QMIN( y0, static_cast<int>( m_height ) );
y0 = qMax( y0, 0 );
y0 = qMin( y0, static_cast<int>( m_height ) );
x1 = static_cast<int>( bbox.x1 ) + 1;
x1 = QMAX( x1, 0 );
x1 = QMIN( x1, static_cast<int>( m_width ) );
x1 = qMax( x1, 0 );
x1 = qMin( x1, static_cast<int>( m_width ) );
y1 = static_cast<int>( bbox.y1 ) + 1;
y1 = QMAX( y1, 0 );
y1 = QMIN( y1, static_cast<int>( m_height ) );
y1 = qMax( y1, 0 );
y1 = qMin( y1, static_cast<int>( m_height ) );
}
 
void ScPainter::applyGradient( _ArtSVP *svp, bool fill )
/branches/Version135x/Scribus/scribus/scimage.cpp
379,7 → 379,7
int fk = qRound(255 / factor);
for (int i = 0; i < 256; ++i)
{
curveTable[i] = QMIN(255, static_cast<int>(i / fk) * fk);
curveTable[i] = qMin(255, static_cast<int>(i / fk) * fk);
}
applyCurve(cmyk);
}
405,7 → 405,7
int *a = new int[wh];
int rsum, gsum, bsum, asum, x, y, i, yp, yi, yw;
QRgb p;
int *vmin = new int[QMAX(w,h)];
int *vmin = new int[qMax(w,h)];
 
int divsum = (div+1)>>1;
divsum *= divsum;
435,7 → 435,7
= routsum = goutsum = boutsum = aoutsum
= rsum = gsum = bsum = asum = 0;
for(i =- radius; i <= radius; ++i) {
p = pix[yi+QMIN(wm,QMAX(i,0))];
p = pix[yi+qMin(wm,qMax(i,0))];
sir = stack[i+radius];
sir[0] = qRed(p);
sir[1] = qGreen(p);
483,7 → 483,7
aoutsum -= sir[3];
 
if (y == 0) {
vmin[x] = QMIN(x+radius+1,wm);
vmin[x] = qMin(x+radius+1,wm);
}
p = pix[yw+vmin[x]];
 
527,7 → 527,7
yp =- radius * w;
for(i=-radius; i <= radius; ++i) {
yi=QMAX(0,yp)+x;
yi=qMax(0,yp)+x;
 
sir = stack[i+radius];
 
580,7 → 580,7
aoutsum -= sir[3];
 
if (x==0){
vmin[y] = QMIN(y+r1,hm)*w;
vmin[y] = qMin(y+r1,hm)*w;
}
p = x+vmin[y];
 
766,7 → 766,7
double mc = (p1.y() - p2.y()) / (double)(p1.x() - p2.x());
for (int i = 0; i < 256; ++i)
{
curveTable[i] = QMIN(255, QMAX(0, int(i * mc) + p1.y()));
curveTable[i] = qMin(255, qMax(0, int(i * mc) + p1.y()));
}
applyCurve(cmyk);
}
779,7 → 779,7
double mc = (p1.y() - p2.y()) / (double)(p1.x() - p2.x());
for (int i = 0; i < 256; ++i)
{
curveTable[i] = QMIN(255, QMAX(0, int(i * mc) + p1.y()));
curveTable[i] = qMin(255, qMax(0, int(i * mc) + p1.y()));
}
applyCurve(cmyk);
}
789,7 → 789,7
curveTable.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(curve, x / 255.0, linear) * 255)));
curveTable[x] = qMin(255, qMax(0, qRound(getCurveYValue(curve, x / 255.0, linear) * 255)));
}
applyCurve(cmyk);
}
812,13 → 812,13
if (cmyk)
{
p = (unsigned char *) s;
rc = 255 - QMIN(255, p[0] + p[3]);
gc = 255 - QMIN(255, p[1] + p[3]);
bc = 255 - QMIN(255, p[2] + p[3]);
rc = 255 - qMin(255, p[0] + p[3]);
gc = 255 - qMin(255, p[1] + p[3]);
bc = 255 - qMin(255, p[2] + p[3]);
c = 255 - curveTable[(int)rc];
m = 255 - curveTable[(int)gc];
y = 255 - curveTable[(int)bc];
k = QMIN(QMIN(c, m), y);
k = qMin(qMin(c, m), y);
*s = qRgba(y - k, m - k, c - k, k );
}
else
867,12 → 867,12
r = *s;
if (cmyk)
{
k = QMIN(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r) + qAlpha(r)), 255) / 255.0;
*s = qRgba(QMIN(qRound(cc*k), 255), QMIN(qRound(cm*k), 255), QMIN(qRound(cy*k), 255), QMIN(qRound(ck*k), 255));
k = qMin(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r) + qAlpha(r)), 255) / 255.0;
*s = qRgba(qMin(qRound(cc*k), 255), qMin(qRound(cm*k), 255), qMin(qRound(cy*k), 255), qMin(qRound(ck*k), 255));
}
else
{
k2 = 255 - QMIN(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r)), 255);
k2 = 255 - qMin(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r)), 255);
tmpR.setRgb(cc, cm, cy);
tmpR.hsv(&hu, &sa, &v);
tmpR.setHsv(hu, sa * k2 / 255, 255 - ((255 - v) * k2 / 255));
901,12 → 901,12
curveTable1.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable1[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(curve1, x / 255.0, lin1) * 255)));
curveTable1[x] = qMin(255, qMax(0, qRound(getCurveYValue(curve1, x / 255.0, lin1) * 255)));
}
curveTable2.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable2[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(curve2, x / 255.0, lin2) * 255)));
curveTable2[x] = qMin(255, qMax(0, qRound(getCurveYValue(curve2, x / 255.0, lin2) * 255)));
}
for( int yi=0; yi < h; ++yi )
{
915,18 → 915,18
{
QRgb r=*s;
if (cmyk)
cb = QMIN(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r) + qAlpha(r)), 255);
cb = qMin(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r) + qAlpha(r)), 255);
else
cb = 255 - QMIN(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r)), 255);
cn = QMIN((c * curveTable1[(int)cb]) >> 8, 255);
mn = QMIN((m * curveTable1[(int)cb]) >> 8, 255);
yn = QMIN((y * curveTable1[(int)cb]) >> 8, 255);
kn = QMIN((k * curveTable1[(int)cb]) >> 8, 255);
c1n = QMIN((c1 * curveTable1[(int)cb]) >> 8, 255);
m1n = QMIN((m1 * curveTable2[(int)cb]) >> 8, 255);
y1n = QMIN((y1 * curveTable2[(int)cb]) >> 8, 255);
k1n = QMIN((k1 * curveTable2[(int)cb]) >> 8, 255);
ScColor col = ScColor(QMIN(cn+c1n, 255), QMIN(mn+m1n, 255), QMIN(yn+y1n, 255), QMIN(kn+k1n, 255));
cb = 255 - qMin(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r)), 255);
cn = qMin((c * curveTable1[(int)cb]) >> 8, 255);
mn = qMin((m * curveTable1[(int)cb]) >> 8, 255);
yn = qMin((y * curveTable1[(int)cb]) >> 8, 255);
kn = qMin((k * curveTable1[(int)cb]) >> 8, 255);
c1n = qMin((c1 * curveTable1[(int)cb]) >> 8, 255);
m1n = qMin((m1 * curveTable2[(int)cb]) >> 8, 255);
y1n = qMin((y1 * curveTable2[(int)cb]) >> 8, 255);
k1n = qMin((k1 * curveTable2[(int)cb]) >> 8, 255);
ScColor col = ScColor(qMin(cn+c1n, 255), qMin(mn+m1n, 255), qMin(yn+y1n, 255), qMin(kn+k1n, 255));
if (cmyk)
col.getCMYK(&cn, &mn, &yn, &kn);
else
960,17 → 960,17
curveTable1.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable1[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(curve1, x / 255.0, lin1) * 255)));
curveTable1[x] = qMin(255, qMax(0, qRound(getCurveYValue(curve1, x / 255.0, lin1) * 255)));
}
curveTable2.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable2[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(curve2, x / 255.0, lin2) * 255)));
curveTable2[x] = qMin(255, qMax(0, qRound(getCurveYValue(curve2, x / 255.0, lin2) * 255)));
}
curveTable3.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable3[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(curve2, x / 255.0, lin3) * 255)));
curveTable3[x] = qMin(255, qMax(0, qRound(getCurveYValue(curve2, x / 255.0, lin3) * 255)));
}
for( int yi=0; yi < h; ++yi )
{
979,22 → 979,22
{
QRgb r=*s;
if (cmyk)
cb = QMIN(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r) + qAlpha(r)), 255);
cb = qMin(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r) + qAlpha(r)), 255);
else
cb = 255 - QMIN(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r)), 255);
cn = QMIN((c * curveTable1[(int)cb]) >> 8, 255);
mn = QMIN((m * curveTable1[(int)cb]) >> 8, 255);
yn = QMIN((y * curveTable1[(int)cb]) >> 8, 255);
kn = QMIN((k * curveTable1[(int)cb]) >> 8, 255);
c1n = QMIN((c1 * curveTable2[(int)cb]) >> 8, 255);
m1n = QMIN((m1 * curveTable2[(int)cb]) >> 8, 255);
y1n = QMIN((y1 * curveTable2[(int)cb]) >> 8, 255);
k1n = QMIN((k1 * curveTable2[(int)cb]) >> 8, 255);
c2n = QMIN((c2 * curveTable3[(int)cb]) >> 8, 255);
m2n = QMIN((m2 * curveTable3[(int)cb]) >> 8, 255);
y2n = QMIN((y2 * curveTable3[(int)cb]) >> 8, 255);
k2n = QMIN((k2 * curveTable3[(int)cb]) >> 8, 255);
ScColor col = ScColor(QMIN(cn+c1n+c2n, 255), QMIN(mn+m1n+m2n, 255), QMIN(yn+y1n+y2n, 255), QMIN(kn+k1n+k2n, 255));
cb = 255 - qMin(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r)), 255);
cn = qMin((c * curveTable1[(int)cb]) >> 8, 255);
mn = qMin((m * curveTable1[(int)cb]) >> 8, 255);
yn = qMin((y * curveTable1[(int)cb]) >> 8, 255);
kn = qMin((k * curveTable1[(int)cb]) >> 8, 255);
c1n = qMin((c1 * curveTable2[(int)cb]) >> 8, 255);
m1n = qMin((m1 * curveTable2[(int)cb]) >> 8, 255);
y1n = qMin((y1 * curveTable2[(int)cb]) >> 8, 255);
k1n = qMin((k1 * curveTable2[(int)cb]) >> 8, 255);
c2n = qMin((c2 * curveTable3[(int)cb]) >> 8, 255);
m2n = qMin((m2 * curveTable3[(int)cb]) >> 8, 255);
y2n = qMin((y2 * curveTable3[(int)cb]) >> 8, 255);
k2n = qMin((k2 * curveTable3[(int)cb]) >> 8, 255);
ScColor col = ScColor(qMin(cn+c1n+c2n, 255), qMin(mn+m1n+m2n, 255), qMin(yn+y1n+y2n, 255), qMin(kn+k1n+k2n, 255));
if (cmyk)
col.getCMYK(&cn, &mn, &yn, &kn);
else
1031,22 → 1031,22
curveTable1.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable1[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(curve1, x / 255.0, lin1) * 255)));
curveTable1[x] = qMin(255, qMax(0, qRound(getCurveYValue(curve1, x / 255.0, lin1) * 255)));
}
curveTable2.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable2[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(curve2, x / 255.0, lin2) * 255)));
curveTable2[x] = qMin(255, qMax(0, qRound(getCurveYValue(curve2, x / 255.0, lin2) * 255)));
}
curveTable3.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable3[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(curve3, x / 255.0, lin3) * 255)));
curveTable3[x] = qMin(255, qMax(0, qRound(getCurveYValue(curve3, x / 255.0, lin3) * 255)));
}
curveTable4.resize(256);
for (int x = 0 ; x < 256 ; x++)
{
curveTable4[x] = QMIN(255, QMAX(0, qRound(getCurveYValue(curve4, x / 255.0, lin4) * 255)));
curveTable4[x] = qMin(255, qMax(0, qRound(getCurveYValue(curve4, x / 255.0, lin4) * 255)));
}
for( int yi=0; yi < h; ++yi )
{
1055,26 → 1055,26
{
QRgb r=*s;
if (cmyk)
cb = QMIN(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r) + qAlpha(r)), 255);
cb = qMin(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r) + qAlpha(r)), 255);
else
cb = 255 - QMIN(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r)), 255);
cn = QMIN((c * curveTable1[(int)cb]) >> 8, 255);
mn = QMIN((m * curveTable1[(int)cb]) >> 8, 255);
yn = QMIN((y * curveTable1[(int)cb]) >> 8, 255);
kn = QMIN((k * curveTable1[(int)cb]) >> 8, 255);
c1n = QMIN((c1 * curveTable2[(int)cb]) >> 8, 255);
m1n = QMIN((m1 * curveTable2[(int)cb]) >> 8, 255);
y1n = QMIN((y1 * curveTable2[(int)cb]) >> 8, 255);
k1n = QMIN((k1 * curveTable2[(int)cb]) >> 8, 255);
c2n = QMIN((c2 * curveTable3[(int)cb]) >> 8, 255);
m2n = QMIN((m2 * curveTable3[(int)cb]) >> 8, 255);
y2n = QMIN((y2 * curveTable3[(int)cb]) >> 8, 255);
k2n = QMIN((k2 * curveTable3[(int)cb]) >> 8, 255);
c3n = QMIN((c3 * curveTable4[(int)cb]) >> 8, 255);
m3n = QMIN((m3 * curveTable4[(int)cb]) >> 8, 255);
y3n = QMIN((y3 * curveTable4[(int)cb]) >> 8, 255);
k3n = QMIN((k3 * curveTable4[(int)cb]) >> 8, 255);
ScColor col = ScColor(QMIN(cn+c1n+c2n+c3n, 255), QMIN(mn+m1n+m2n+m3n, 255), QMIN(yn+y1n+y2n+y3n, 255), QMIN(kn+k1n+k2n+k3n, 255));
cb = 255 - qMin(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r)), 255);
cn = qMin((c * curveTable1[(int)cb]) >> 8, 255);
mn = qMin((m * curveTable1[(int)cb]) >> 8, 255);
yn = qMin((y * curveTable1[(int)cb]) >> 8, 255);
kn = qMin((k * curveTable1[(int)cb]) >> 8, 255);
c1n = qMin((c1 * curveTable2[(int)cb]) >> 8, 255);
m1n = qMin((m1 * curveTable2[(int)cb]) >> 8, 255);
y1n = qMin((y1 * curveTable2[(int)cb]) >> 8, 255);
k1n = qMin((k1 * curveTable2[(int)cb]) >> 8, 255);
c2n = qMin((c2 * curveTable3[(int)cb]) >> 8, 255);
m2n = qMin((m2 * curveTable3[(int)cb]) >> 8, 255);
y2n = qMin((y2 * curveTable3[(int)cb]) >> 8, 255);
k2n = qMin((k2 * curveTable3[(int)cb]) >> 8, 255);
c3n = qMin((c3 * curveTable4[(int)cb]) >> 8, 255);
m3n = qMin((m3 * curveTable4[(int)cb]) >> 8, 255);
y3n = qMin((y3 * curveTable4[(int)cb]) >> 8, 255);
k3n = qMin((k3 * curveTable4[(int)cb]) >> 8, 255);
ScColor col = ScColor(qMin(cn+c1n+c2n+c3n, 255), qMin(mn+m1n+m2n+m3n, 255), qMin(yn+y1n+y2n+y3n, 255), qMin(kn+k1n+k2n+k3n, 255));
if (cmyk)
col.getCMYK(&cn, &mn, &yn, &kn);
else
1103,10 → 1103,10
if (cmyk)
{
p = (unsigned char *) s;
c = 255 - QMIN(255, p[0] + p[3]);
m = 255 - QMIN(255, p[1] + p[3]);
y = 255 - QMIN(255, p[2] + p[3]);
k = QMIN(QMIN(c, m), y);
c = 255 - qMin(255, p[0] + p[3]);
m = 255 - qMin(255, p[1] + p[3]);
y = 255 - qMin(255, p[2] + p[3]);
k = qMin(qMin(c, m), y);
p[0] = c - k;
p[1] = m - k;
p[2] = y - k;
1134,12 → 1134,12
r = *s;
if (cmyk)
{
k = QMIN(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r) + qAlpha(r)), 255);
k = qMin(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r) + qAlpha(r)), 255);
*s = qRgba(0, 0, 0, k);
}
else
{
k = QMIN(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r)), 255);
k = qMin(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r)), 255);
*s = qRgba(k, k, k, qAlpha(r));
}
s++;
1324,7 → 1324,7
for( int xi=0; xi < w; ++xi )
{
r = *s;
k = QMIN(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r)), 255);
k = qMin(qRound(0.3 * qRed(r) + 0.59 * qGreen(r) + 0.11 * qBlue(r)), 255);
*s = qRgba(k, 0, 0, 0);
imgArray[i++] = k;
s++;
1369,7 → 1369,7
c = 255 - qRed(r);
m = 255 - qGreen(r);
y = 255 - qBlue(r);
k = QMIN(QMIN(c, m), y);
k = qMin(qMin(c, m), y);
imgArray[i++] = static_cast<unsigned char> (c - k);
imgArray[i++] = static_cast<unsigned char> (m - k);
imgArray[i++] = static_cast<unsigned char> (y - k);
1416,7 → 1416,7
else
{
if (pl == -2)
imgArray[i++] = static_cast<unsigned char> (QMIN(255, qRound(0.3 * c + 0.59 * m + 0.11 * y + k)));
imgArray[i++] = static_cast<unsigned char> (qMin(255, qRound(0.3 * c + 0.59 * m + 0.11 * y + k)));
if (pl == 1)
imgArray[i++] = static_cast<unsigned char> (c);
if (pl == 2)
1440,7 → 1440,7
c = 255 - qRed(r);
m = 255 - qGreen(r);
y = 255 - qBlue(r);
k = QMIN(QMIN(c, m), y);
k = qMin(qMin(c, m), y);
if (pl == -1)
{
imgArray[i++] = static_cast<unsigned char> (c - k);
1451,7 → 1451,7
else
{
if (pl == -2)
imgArray[i++] = static_cast<unsigned char> (QMIN(255, qRound(0.3 * c + 0.59 * m + 0.11 * y + k)));
imgArray[i++] = static_cast<unsigned char> (qMin(255, qRound(0.3 * c + 0.59 * m + 0.11 * y + k)));
if (pl == 1)
imgArray[i++] = static_cast<unsigned char> (c - k);
if (pl == 2)
2177,7 → 2177,7
cc = 255 - qRed(*ptr);
cm = 255 - qGreen(*ptr);
cy = 255 - qBlue(*ptr);
ck = QMIN(QMIN(cc, cm), cy);
ck = qMin(qMin(cc, cm), cy);
*ptr++ = qRgba(cc-ck,cm-ck,cy-ck,ck);
}
}
2211,9 → 2211,9
for (int j = 0; j < width(); j++)
{
ck = qAlpha(*ptr);
cr = 255 - QMIN(255, qRed(*ptr) + ck);
cg = 255 - QMIN(255, qGreen(*ptr) + ck);
cb = 255 - QMIN(255, qBlue(*ptr) + ck);
cr = 255 - qMin(255, qRed(*ptr) + ck);
cg = 255 - qMin(255, qGreen(*ptr) + ck);
cb = 255 - qMin(255, qBlue(*ptr) + ck);
*ptr++ = qRgba(cr,cg,cb,255);
}
}
2239,8 → 2239,8
}
if (((reqType == CMYKData) || ((reqType == RawData) && isCMYK)) && !bilevel)
setAlphaBuffer(false);
setDotsPerMeterX (QMAX(2834, (int) (imgInfo.xres / 0.0254)));
setDotsPerMeterY (QMAX(2834, (int) (imgInfo.yres / 0.0254)));
setDotsPerMeterX (qMax(2834, (int) (imgInfo.xres / 0.0254)));
setDotsPerMeterY (qMax(2834, (int) (imgInfo.yres / 0.0254)));
if (ScCore->usingGUI() && pDataLoader->issuedWarningMsg() && showMsg)
{
QMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, pDataLoader->getMessage(), 1, 0, 0);
/branches/Version135x/Scribus/scribus/scimgdataloader_jpeg.cpp
157,7 → 157,7
cc = 255 - qRed(*s);
cm = 255 - qGreen(*s);
cy = 255 - qBlue(*s);
ck = QMIN(QMIN(cc, cm), cy);
ck = qMin(qMin(cc, cm), cy);
*s = qRgba(cc-ck,cm-ck,cy-ck,ck);
s++;
}
330,7 → 330,7
cc = 255 - qRed(*s);
cm = 255 - qGreen(*s);
cy = 255 - qBlue(*s);
ck = QMIN(QMIN(cc, cm), cy);
ck = qMin(qMin(cc, cm), cy);
*d = qRgba(cc-ck,cm-ck,cy-ck,ck);
s++;
d++;
/branches/Version135x/Scribus/scribus/annota.cpp
198,8 → 198,8
}
else
{
Pg->SetSeite(QMIN(v-1, MaxSeite-1), 100);
SpinBox1->setValue(QMIN(v, MaxSeite));
Pg->SetSeite(qMin(v-1, MaxSeite-1), 100);
SpinBox1->setValue(qMin(v, MaxSeite));
Breite = OriBreite;
Hoehe = OriHoehe;
}
273,7 → 273,7
Destfile->hide();
ChFile->hide();
item->annotation().setActionType(2);
SetPg(QMIN(SpinBox1->value(), MaxSeite));
SetPg(qMin(SpinBox1->value(), MaxSeite));
break;
case 2:
Fram->raiseWidget(1);
295,7 → 295,7
}
else
item->annotation().setActionType(7);
SetPg(QMIN(SpinBox1->value(), MaxSeite));
SetPg(qMin(SpinBox1->value(), MaxSeite));
break;
case 3:
Fram->raiseWidget(1);
333,7 → 333,7
SpinBox3->hide();
}
if (Pg->isVisible())
SetPg(QMIN(SpinBox1->value(), MaxSeite));
SetPg(qMin(SpinBox1->value(), MaxSeite));
break;
default:
Fram->raiseWidget(2);
/branches/Version135x/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
111,7 → 111,7
menuMgr->removeMenuItem((*it), "RecentScripts");
 
scrRecentScriptActions.clear();
uint max = QMIN(PrefsManager::instance()->appPrefs.RecentDCount, RecentScripts.count());
uint max = qMin(PrefsManager::instance()->appPrefs.RecentDCount, RecentScripts.count());
for (uint m = 0; m < max; ++m)
{
QString strippedName=RecentScripts[m];
128,7 → 128,7
scrRecentScriptActions.clear();
if (SavedRecentScripts.count() != 0)
{
uint max = QMIN(PrefsManager::instance()->appPrefs.RecentDCount, SavedRecentScripts.count());
uint max = qMin(PrefsManager::instance()->appPrefs.RecentDCount, SavedRecentScripts.count());
for (uint m = 0; m < max; ++m)
{
QFileInfo fd(SavedRecentScripts[m]);
/branches/Version135x/Scribus/scribus/plugins/pixmapexport/dialog.cpp
166,7 → 166,7
double ph = (OnePageRadio->isOn() && m_doc->currentPage()) ? m_doc->currentPage()->height() : m_doc->pageHeight;
(ph > pw) ? pixmapSize = ph : pixmapSize = pw;
int maxGr = qRound(pixmapSize * EnlargementBox->value() * (DPIBox->value() / 72.0) / 100.0);
double sc = QMIN(maxGr / pw, maxGr / ph);
double sc = qMin(maxGr / pw, maxGr / ph);
textLabel6->setText(QString("%1 x %2 px").arg(qRound(pw * sc)).arg(qRound(ph * sc)));
}
 
/branches/Version135x/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
357,8 → 357,8
{
Elements.at(a)->Groups.push(m_Doc->GroupCounter);
PageItem* currItem = Elements.at(a);
lowestItem = QMIN(lowestItem, currItem->ItemNr);
highestItem = QMAX(highestItem, currItem->ItemNr);
lowestItem = qMin(lowestItem, currItem->ItemNr);
highestItem = qMax(highestItem, currItem->ItemNr);
double lw = currItem->lineWidth() / 2.0;
if (currItem->rotation() != 0)
{
370,18 → 370,18
pb.addPoint(FPoint(-lw, currItem->height()+lw*2.0, currItem->xPos()-lw, currItem->yPos()-lw, currItem->rotation(), 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
minx = qMin(minx, pb.point(pc).x());
miny = qMin(miny, pb.point(pc).y());
maxx = qMax(maxx, pb.point(pc).x());
maxy = qMax(maxy, pb.point(pc).y());
}
}
else
{
minx = QMIN(minx, currItem->xPos()-lw);
miny = QMIN(miny, currItem->yPos()-lw);
maxx = QMAX(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = QMAX(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
minx = qMin(minx, currItem->xPos()-lw);
miny = qMin(miny, currItem->yPos()-lw);
maxx = qMax(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = qMax(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
}
}
double gx = minx;
544,7 → 544,7
FPoint wh = getMaxClipF(&item->PoLine);
item->setWidthHeight(wh.x(), wh.y());
// if (item->asPolyLine())
// item->setPolyClip(qRound(QMAX(item->lineWidth() / 2.0, 1)));
// item->setPolyClip(qRound(qMax(item->lineWidth() / 2.0, 1)));
// else
// item->Clip = FlattenPath(item->PoLine, item->Segments);
m_Doc->AdjustItemSize(item);
835,18 → 835,18
pb.addPoint(FPoint(-lw, currItem->height()+lw*2.0, currItem->xPos()-lw, currItem->yPos()-lw, currItem->rotation(), 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
minx = qMin(minx, pb.point(pc).x());
miny = qMin(miny, pb.point(pc).y());
maxx = qMax(maxx, pb.point(pc).x());
maxy = qMax(maxy, pb.point(pc).y());
}
}
else
{
minx = QMIN(minx, currItem->xPos()-lw);
miny = QMIN(miny, currItem->yPos()-lw);
maxx = QMAX(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = QMAX(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
minx = qMin(minx, currItem->xPos()-lw);
miny = qMin(miny, currItem->yPos()-lw);
maxx = qMax(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = qMax(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
}
}
double gx = minx;
1148,7 → 1148,7
PageItem* ite = m_Doc->Items->at(z);
if ((rx != 0) || (ry != 0))
{
ite->setCornerRadius(QMAX(rx, ry));
ite->setCornerRadius(qMax(rx, ry));
ite->SetFrameRound();
m_Doc->setRedrawBounding(ite);
}
1204,7 → 1204,7
Q3PtrList<PageItem> GElements;
// QFont ff(m_Doc->UsedFonts[m_gc.current()->Family]);
QFont ff(m_gc.current()->Family);
ff.setPointSize(QMAX(qRound(m_gc.current()->FontSize / 10.0), 1));
ff.setPointSize(qMax(qRound(m_gc.current()->FontSize / 10.0), 1));
QFontMetrics fontMetrics(ff);
int desc = fontMetrics.descent();
double BaseX = m_Doc->currentPage()->xOffset();
1299,13 → 1299,13
maxHeight = (tempH > maxHeight) ? tempH : maxHeight;
if (ch == SpecialChars::PARSEP)
{
ite->setWidthHeight(QMAX(ite->width(), tempW), ite->height() + lineSpacing+desc);
ite->setWidthHeight(qMax(ite->width(), tempW), ite->height() + lineSpacing+desc);
tempW = 0;
}
}
double xpos = ite->xPos();
double ypos = ite->yPos();
ite->setWidthHeight(QMAX(ite->width(), maxWidth), QMAX(ite->height(), maxHeight));
ite->setWidthHeight(qMax(ite->width(), maxWidth), qMax(ite->height(), maxHeight));
double xoffset = 0.0, yoffset = 0.0;
if( gc->textAnchor == "middle" )
{
/branches/Version135x/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
241,10 → 241,10
else
m_Doc->pageWidth=dc.attribute("PAGEWITH").toDouble();
m_Doc->pageHeight=dc.attribute("PAGEHEIGHT").toDouble();
m_Doc->pageMargins.Left=QMAX(0.0, dc.attribute("BORDERLEFT").toDouble());
m_Doc->pageMargins.Right=QMAX(0.0, dc.attribute("BORDERRIGHT").toDouble());
m_Doc->pageMargins.Top=QMAX(0.0, dc.attribute("BORDERTOP").toDouble());
m_Doc->pageMargins.Bottom=QMAX(0.0, dc.attribute("BORDERBOTTOM").toDouble());
m_Doc->pageMargins.Left=qMax(0.0, dc.attribute("BORDERLEFT").toDouble());
m_Doc->pageMargins.Right=qMax(0.0, dc.attribute("BORDERRIGHT").toDouble());
m_Doc->pageMargins.Top=qMax(0.0, dc.attribute("BORDERTOP").toDouble());
m_Doc->pageMargins.Bottom=qMax(0.0, dc.attribute("BORDERBOTTOM").toDouble());
m_Doc->PageOri = dc.attribute("ORIENTATION", "0").toInt();
m_Doc->m_pageSize = dc.attribute("PAGESIZE");
m_Doc->FirstPnum = dc.attribute("FIRSTNUM", "1").toInt();
983,8 → 983,8
style.setEffects(static_cast<StyleFlag>(cstyle));
style.setStrokeColor(stroke);
style.setStrokeShade(shade2);
style.setScaleH(QMIN(QMAX(scale, 100), 4000));
style.setScaleV(QMIN(QMAX(scalev, 100), 4000));
style.setScaleH(qMin(qMax(scale, 100), 4000));
style.setScaleV(qMin(qMax(scalev, 100), 4000));
style.setBaselineOffset(base);
style.setShadowXOffset(shX);
style.setShadowYOffset(shY);
1044,8 → 1044,8
uint layerCount=m_Doc->layerCount();
for (uint la2 = 0; la2 < layerCount; ++la2)
{
maxLayer = QMAX(m_Doc->Layers[la2].LNr, maxLayer);
maxLevel = QMAX(m_Doc->Layers[la2].Level, maxLevel);
maxLayer = qMax(m_Doc->Layers[la2].LNr, maxLayer);
maxLevel = qMax(m_Doc->Layers[la2].Level, maxLevel);
}
DoVorl.clear();
DoFonts.clear();
/branches/Version135x/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
308,10 → 308,10
else
m_Doc->pageWidth=dc.attribute("PAGEWITH").toDouble();
m_Doc->pageHeight=dc.attribute("PAGEHEIGHT").toDouble();
m_Doc->pageMargins.Left=QMAX(0.0, dc.attribute("BORDERLEFT").toDouble());
m_Doc->pageMargins.Right=QMAX(0.0, dc.attribute("BORDERRIGHT").toDouble());
m_Doc->pageMargins.Top=QMAX(0.0, dc.attribute("BORDERTOP").toDouble());
m_Doc->pageMargins.Bottom=QMAX(0.0, dc.attribute("BORDERBOTTOM").toDouble());
m_Doc->pageMargins.Left=qMax(0.0, dc.attribute("BORDERLEFT").toDouble());
m_Doc->pageMargins.Right=qMax(0.0, dc.attribute("BORDERRIGHT").toDouble());
m_Doc->pageMargins.Top=qMax(0.0, dc.attribute("BORDERTOP").toDouble());
m_Doc->pageMargins.Bottom=qMax(0.0, dc.attribute("BORDERBOTTOM").toDouble());
m_Doc->Automatic = static_cast<bool>(dc.attribute("AUTOMATIC", "1").toInt());
m_Doc->AutoCheck = static_cast<bool>(dc.attribute("AUTOCHECK", "0").toInt());
m_Doc->GuideLock = static_cast<bool>(dc.attribute("GUIDELOCK", "0").toInt());
835,10 → 835,10
Apage->setHeight(pg.attribute("PAGEHEIGHT").toDouble());
Apage->setInitialHeight(Apage->height());
Apage->setInitialWidth(Apage->width());
Apage->initialMargins.Top = QMAX(0.0, pg.attribute("BORDERTOP").toDouble());
Apage->initialMargins.Bottom = QMAX(0.0, pg.attribute("BORDERBOTTOM").toDouble());
Apage->initialMargins.Left = QMAX(0.0, pg.attribute("BORDERLEFT").toDouble());
Apage->initialMargins.Right = QMAX(0.0, pg.attribute("BORDERRIGHT").toDouble());
Apage->initialMargins.Top = qMax(0.0, pg.attribute("BORDERTOP").toDouble());
Apage->initialMargins.Bottom = qMax(0.0, pg.attribute("BORDERBOTTOM").toDouble());
Apage->initialMargins.Left = qMax(0.0, pg.attribute("BORDERLEFT").toDouble());
Apage->initialMargins.Right = qMax(0.0, pg.attribute("BORDERRIGHT").toDouble());
Apage->Margins.Top = Apage->initialMargins.Top;
Apage->Margins.Bottom = Apage->initialMargins.Bottom;
m_Doc->setMasterPageMode(false);
1805,10 → 1805,10
newStyle.setStrokeShade(sShade);
if (it->hasAttribute("CSCALE"))
newStyle.setScaleH(QMIN(QMAX(qRound(it->attribute("CSCALE", "100").toDouble() * 10), 100), 4000));
newStyle.setScaleH(qMin(qMax(qRound(it->attribute("CSCALE", "100").toDouble() * 10), 100), 4000));
if (it->hasAttribute("CSCALEV"))
newStyle.setScaleV(QMIN(QMAX(qRound(it->attribute("CSCALEV", "100").toDouble() * 10), 100), 4000));
newStyle.setScaleV(qMin(qMax(qRound(it->attribute("CSCALEV", "100").toDouble() * 10), 100), 4000));
if (it->hasAttribute("CBASE"))
newStyle.setBaselineOffset(qRound(it->attribute("CBASE", "0").toDouble() * 10));
2420,7 → 2420,7
currItem->Clip = FlattenPath(currItem->PoLine, currItem->Segments);
else
{
int ph = static_cast<int>(QMAX(1.0, currItem->lineWidth() / 2.0));
int ph = static_cast<int>(qMax(1.0, currItem->lineWidth() / 2.0));
currItem->Segments.clear();
currItem->PoLine.resize(0);
currItem->Clip.setPoints(4, -ph,-ph, static_cast<int>(currItem->width()+ph),-ph,
2522,8 → 2522,8
uint layerCount=m_Doc->layerCount();
for (uint la2 = 0; la2 < layerCount; ++la2)
{
maxLayer = QMAX(m_Doc->Layers[la2].LNr, maxLayer);
maxLevel = QMAX(m_Doc->Layers[la2].Level, maxLevel);
maxLayer = qMax(m_Doc->Layers[la2].LNr, maxLayer);
maxLevel = qMax(m_Doc->Layers[la2].Level, maxLevel);
}
DoVorl.clear();
DoVorl[0] = "";
2712,10 → 2712,10
Apage->setHeight(pg.attribute("PAGEHEIGHT").toDouble());
Apage->setInitialHeight(Apage->height());
Apage->setInitialWidth(Apage->width());
Apage->initialMargins.Top = QMAX(0.0, pg.attribute("BORDERTOP").toDouble());
Apage->initialMargins.Bottom = QMAX(0.0, pg.attribute("BORDERBOTTOM").toDouble());
Apage->initialMargins.Left = QMAX(0.0, pg.attribute("BORDERLEFT").toDouble());
Apage->initialMargins.Right = QMAX(0.0, pg.attribute("BORDERRIGHT").toDouble());
Apage->initialMargins.Top = qMax(0.0, pg.attribute("BORDERTOP").toDouble());
Apage->initialMargins.Bottom = qMax(0.0, pg.attribute("BORDERBOTTOM").toDouble());
Apage->initialMargins.Left = qMax(0.0, pg.attribute("BORDERLEFT").toDouble());
Apage->initialMargins.Right = qMax(0.0, pg.attribute("BORDERRIGHT").toDouble());
Apage->Margins.Top = Apage->initialMargins.Top;
Apage->Margins.Bottom = Apage->initialMargins.Bottom;
pageX = pg.attribute("PAGEXPOS").toDouble();
/branches/Version135x/Scribus/scribus/plugins/fileloader/oodraw/oodrawimp.cpp
441,8 → 441,8
{
Elements.at(a)->Groups.push(m_Doc->GroupCounter);
PageItem* currItem = Elements.at(a);
lowestItem = QMIN(lowestItem, currItem->ItemNr);
highestItem = QMAX(highestItem, currItem->ItemNr);
lowestItem = qMin(lowestItem, currItem->ItemNr);
highestItem = qMax(highestItem, currItem->ItemNr);
double lw = currItem->lineWidth() / 2.0;
if (currItem->rotation() != 0)
{
454,18 → 454,18
pb.addPoint(FPoint(-lw, currItem->height()+lw*2.0, currItem->xPos()-lw, currItem->yPos()-lw, currItem->rotation(), 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
minx = qMin(minx, pb.point(pc).x());
miny = qMin(miny, pb.point(pc).y());
maxx = qMax(maxx, pb.point(pc).x());
maxy = qMax(maxy, pb.point(pc).y());
}
}
else
{
minx = QMIN(minx, currItem->xPos()-lw);
miny = QMIN(miny, currItem->yPos()-lw);
maxx = QMAX(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = QMAX(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
minx = qMin(minx, currItem->xPos()-lw);
miny = qMin(miny, currItem->yPos()-lw);
maxx = qMax(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = qMax(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
}
}
double gx = minx;
617,18 → 617,18
pb.addPoint(FPoint(-lw, currItem->height()+lw*2.0, currItem->xPos()-lw, currItem->yPos()-lw, currItem->rotation(), 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
minx = qMin(minx, pb.point(pc).x());
miny = qMin(miny, pb.point(pc).y());
maxx = qMax(maxx, pb.point(pc).x());
maxy = qMax(maxy, pb.point(pc).y());
}
}
else
{
minx = QMIN(minx, currItem->xPos()-lw);
miny = QMIN(miny, currItem->yPos()-lw);
maxx = QMAX(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = QMAX(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
minx = qMin(minx, currItem->xPos()-lw);
miny = qMin(miny, currItem->yPos()-lw);
maxx = qMax(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = qMax(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
}
}
double gx = minx;
/branches/Version135x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
320,10 → 320,10
else
m_Doc->pageWidth=dc.attribute("PAGEWITH").toDouble();
m_Doc->pageHeight=dc.attribute("PAGEHEIGHT").toDouble();
m_Doc->pageMargins.Left=QMAX(0.0, dc.attribute("BORDERLEFT").toDouble());
m_Doc->pageMargins.Right=QMAX(0.0, dc.attribute("BORDERRIGHT").toDouble());
m_Doc->pageMargins.Top=QMAX(0.0, dc.attribute("BORDERTOP").toDouble());
m_Doc->pageMargins.Bottom=QMAX(0.0, dc.attribute("BORDERBOTTOM").toDouble());
m_Doc->pageMargins.Left=qMax(0.0, dc.attribute("BORDERLEFT").toDouble());
m_Doc->pageMargins.Right=qMax(0.0, dc.attribute("BORDERRIGHT").toDouble());
m_Doc->pageMargins.Top=qMax(0.0, dc.attribute("BORDERTOP").toDouble());
m_Doc->pageMargins.Bottom=qMax(0.0, dc.attribute("BORDERBOTTOM").toDouble());
m_Doc->bleeds.Top = dc.attribute("BleedTop", "0").toDouble();
m_Doc->bleeds.Left = dc.attribute("BleedLeft", "0").toDouble();
m_Doc->bleeds.Right = dc.attribute("BleedRight", "0").toDouble();
911,10 → 911,10
Apage->setHeight(pg.attribute("PAGEHEIGHT").toDouble());
Apage->setInitialHeight(Apage->height());
Apage->setInitialWidth(Apage->width());
Apage->initialMargins.Top = QMAX(0.0, pg.attribute("BORDERTOP").toDouble());
Apage->initialMargins.Bottom = QMAX(0.0, pg.attribute("BORDERBOTTOM").toDouble());
Apage->initialMargins.Left = QMAX(0.0, pg.attribute("BORDERLEFT").toDouble());
Apage->initialMargins.Right = QMAX(0.0, pg.attribute("BORDERRIGHT").toDouble());
Apage->initialMargins.Top = qMax(0.0, pg.attribute("BORDERTOP").toDouble());
Apage->initialMargins.Bottom = qMax(0.0, pg.attribute("BORDERBOTTOM").toDouble());
Apage->initialMargins.Left = qMax(0.0, pg.attribute("BORDERLEFT").toDouble());
Apage->initialMargins.Right = qMax(0.0, pg.attribute("BORDERRIGHT").toDouble());
Apage->Margins.Top = Apage->initialMargins.Top;
Apage->Margins.Bottom = Apage->initialMargins.Bottom;
m_Doc->setMasterPageMode(false);
1713,10 → 1713,10
newStyle.setStrokeShade(it->attribute("CSHADE2", "100").toInt());
if (it->hasAttribute("CSCALE"))
newStyle.setScaleH(QMIN(QMAX(qRound(it->attribute("CSCALE", "100").toDouble() * 10), 100), 4000));
newStyle.setScaleH(qMin(qMax(qRound(it->attribute("CSCALE", "100").toDouble() * 10), 100), 4000));
if (it->hasAttribute("CSCALEV"))
newStyle.setScaleV(QMIN(QMAX(qRound(it->attribute("CSCALEV", "100").toDouble() * 10), 100), 4000));
newStyle.setScaleV(qMin(qMax(qRound(it->attribute("CSCALEV", "100").toDouble() * 10), 100), 4000));
if (it->hasAttribute("CBASE"))
newStyle.setBaselineOffset(qRound(it->attribute("CBASE", "0").toDouble() * 10));
2385,7 → 2385,7
currItem->Clip = FlattenPath(currItem->PoLine, currItem->Segments);
else
{
int ph = static_cast<int>(QMAX(1.0, currItem->lineWidth() / 2.0));
int ph = static_cast<int>(qMax(1.0, currItem->lineWidth() / 2.0));
currItem->Segments.clear();
currItem->PoLine.resize(0);
currItem->Clip.setPoints(4, -ph,-ph, static_cast<int>(currItem->width()+ph),-ph,
2501,8 → 2501,8
uint layerCount=m_Doc->layerCount();
for (uint la2 = 0; la2 < layerCount; ++la2)
{
maxLayer = QMAX(m_Doc->Layers[la2].LNr, maxLayer);
maxLevel = QMAX(m_Doc->Layers[la2].Level, maxLevel);
maxLayer = qMax(m_Doc->Layers[la2].LNr, maxLayer);
maxLevel = qMax(m_Doc->Layers[la2].Level, maxLevel);
}
DoVorl.clear();
DoVorl[0] = "0";
2693,10 → 2693,10
Apage->setHeight(pg.attribute("PAGEHEIGHT").toDouble());
Apage->setInitialHeight(Apage->height());
Apage->setInitialWidth(Apage->width());
Apage->initialMargins.Top = QMAX(0.0, pg.attribute("BORDERTOP").toDouble());
Apage->initialMargins.Bottom = QMAX(0.0, pg.attribute("BORDERBOTTOM").toDouble());
Apage->initialMargins.Left = QMAX(0.0, pg.attribute("BORDERLEFT").toDouble());
Apage->initialMargins.Right = QMAX(0.0, pg.attribute("BORDERRIGHT").toDouble());
Apage->initialMargins.Top = qMax(0.0, pg.attribute("BORDERTOP").toDouble());
Apage->initialMargins.Bottom = qMax(0.0, pg.attribute("BORDERBOTTOM").toDouble());
Apage->initialMargins.Left = qMax(0.0, pg.attribute("BORDERLEFT").toDouble());
Apage->initialMargins.Right = qMax(0.0, pg.attribute("BORDERRIGHT").toDouble());
Apage->Margins.Top = Apage->initialMargins.Top;
Apage->Margins.Bottom = Apage->initialMargins.Bottom;
pageX = pg.attribute("PAGEXPOS").toDouble();
/branches/Version135x/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
272,7 → 272,7
double y2 = Item->BoundingY;
double w2 = Item->BoundingW;
double h2 = Item->BoundingH;
if (!( QMAX( x, x2 ) <= QMIN( x+w, x2+w2 ) && QMAX( y, y2 ) <= QMIN( y+h, y2+h2 )))
if (!( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h, y2+h2 )))
continue;
if ((Item->fillColor() != CommonStrings::None) || (Item->GrType != 0))
{
313,7 → 313,7
grad.setAttribute("y2", "0");
break;
case 5:
grad.setAttribute("r", FToStr(QMAX(Item->width() / 2, Item->height() / 2)));
grad.setAttribute("r", FToStr(qMax(Item->width() / 2, Item->height() / 2)));
grad.setAttribute("cx", FToStr(Item->width() / 2));
grad.setAttribute("cy", FToStr(Item->height() / 2));
break;
324,7 → 324,7
grad.setAttribute("y2", FToStr(Item->GrEndY));
break;
case 7:
grad.setAttribute("r", FToStr(QMAX(Item->width() / 2, Item->height() / 2)));
grad.setAttribute("r", FToStr(qMax(Item->width() / 2, Item->height() / 2)));
grad.setAttribute("cx", FToStr(Item->GrStartX));
grad.setAttribute("cy", FToStr(Item->GrStartY));
break;
407,8 → 407,8
}
else
{
QString Dt = FToStr(QMAX(2*Item->lineWidth(), 1));
QString Da = FToStr(QMAX(6*Item->lineWidth(), 1));
QString Dt = FToStr(qMax(2*Item->lineWidth(), 1));
QString Da = FToStr(qMax(6*Item->lineWidth(), 1));
switch (Item->PLineArt)
{
case Qt::SolidLine:
820,8 → 820,8
break;
}
tmp += " stroke-dasharray:";
QString Dt = FToStr(QMAX(2*sl->Width, 1));
QString Da = FToStr(QMAX(6*sl->Width, 1));
QString Dt = FToStr(qMax(2*sl->Width, 1));
QString Da = FToStr(qMax(6*sl->Width, 1));
switch (static_cast<Qt::PenStyle>(sl->Dash))
{
case Qt::SolidLine:
/branches/Version135x/Scribus/scribus/plugins/psimport/importps.cpp
254,8 → 254,8
{
Elements.at(a)->Groups.push(m_Doc->GroupCounter);
PageItem* currItem = Elements.at(a);
lowestItem = QMIN(lowestItem, currItem->ItemNr);
highestItem = QMAX(highestItem, currItem->ItemNr);
lowestItem = qMin(lowestItem, currItem->ItemNr);
highestItem = qMax(highestItem, currItem->ItemNr);
double lw = currItem->lineWidth() / 2.0;
if (currItem->rotation() != 0)
{
267,18 → 267,18
pb.addPoint(FPoint(-lw, currItem->height()+lw*2.0, currItem->xPos()-lw, currItem->yPos()-lw, currItem->rotation(), 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
minx = qMin(minx, pb.point(pc).x());
miny = qMin(miny, pb.point(pc).y());
maxx = qMax(maxx, pb.point(pc).x());
maxy = qMax(maxy, pb.point(pc).y());
}
}
else
{
minx = QMIN(minx, currItem->xPos()-lw);
miny = QMIN(miny, currItem->yPos()-lw);
maxx = QMAX(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = QMAX(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
minx = qMin(minx, currItem->xPos()-lw);
miny = qMin(miny, currItem->yPos()-lw);
maxx = qMax(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = qMax(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
}
}
double gx = minx;
635,7 → 635,7
{
if (Coords.size() != 0)
{
LineW = QMAX(LineW, 0.1); // Set Linewidth to be a least 0.1 pts, a Stroke without a Linewidth makes no sense
LineW = qMax(LineW, 0.1); // Set Linewidth to be a least 0.1 pts, a Stroke without a Linewidth makes no sense
if ((Elements.count() != 0) && (lastPath == currPath))
{
ite = Elements.at(Elements.count()-1);
/branches/Version135x/Scribus/scribus/scpreview.cpp
82,7 → 82,7
double GrY = elem.attribute("YP").toDouble();
double GrW = elem.attribute("W").toDouble();
double GrH = elem.attribute("H").toDouble();
double pmmax = 60 / QMAX(GrW+50, GrH+50);
double pmmax = 60 / qMax(GrW+50, GrH+50);
#ifdef HAVE_CAIRO
QImage tmp = QImage(static_cast<int>(GrW)+50, static_cast<int>(GrH)+50, 32);
tmp.fill( qRgba(255, 255, 255, 0) );
668,7 → 668,7
{
SetFarbe(&tmpfa, ml[it].Color, ml[it].Shade);
pS->setPen(tmpfa,
QMAX(static_cast<int>(ml[it].Width), 1),
qMax(static_cast<int>(ml[it].Width), 1),
static_cast<Qt::PenStyle>(ml[it].Dash),
static_cast<Qt::PenCapStyle>(ml[it].LineEnd),
static_cast<Qt::PenJoinStyle>(ml[it].LineJoin));
1038,13 → 1038,13
if (Style & 16)
{
double st = prefsManager->appPrefs.AvailFonts[ZFo].strikeoutPos() * (Siz / 10.0);
p->setLineWidth(QMAX(prefsManager->appPrefs.AvailFonts[ZFo].strokeWidth() * (Siz / 10.0), 1));
p->setLineWidth(qMax(prefsManager->appPrefs.AvailFonts[ZFo].strokeWidth() * (Siz / 10.0), 1));
p->drawLine(FPoint(xco, yco-st), FPoint(xco+wide, yco-st));
}
if (Style & 8)
{
double st = prefsManager->appPrefs.AvailFonts[ZFo].underlinePos() * (Siz / 10.0);
p->setLineWidth(QMAX(prefsManager->appPrefs.AvailFonts[ZFo].strokeWidth() * (Siz / 10.0), 1));
p->setLineWidth(qMax(prefsManager->appPrefs.AvailFonts[ZFo].strokeWidth() * (Siz / 10.0), 1));
p->drawLine(FPoint(xco, yco-st), FPoint(xco+wide, yco-st));
}
}
/branches/Version135x/Scribus/scribus/pslib.cpp
831,8 → 831,8
 
void PSLib::PS_setdash(Qt::PenStyle st, double offset, Q3ValueList<double> dash)
{
QString Dt = ToStr(QMAX(2*LineW, 1));
QString Da = ToStr(QMAX(6*LineW, 1));
QString Dt = ToStr(qMax(2*LineW, 1));
QString Da = ToStr(qMax(6*LineW, 1));
if (dash.count() != 0)
{
PutSeite("[ ");
1678,18 → 1678,18
pb.addPoint(FPoint(-lw, currItem->height()+lw*2.0, currItem->xPos()-lw, currItem->yPos()-lw, currItem->rotation(), 1.0, 1.0));
for (uint pc = 0; pc < 4; ++pc)
{
minx = QMIN(minx, pb.point(pc).x());
miny = QMIN(miny, pb.point(pc).y());
maxx = QMAX(maxx, pb.point(pc).x());
maxy = QMAX(maxy, pb.point(pc).y());
minx = qMin(minx, pb.point(pc).x());
miny = qMin(miny, pb.point(pc).y());
maxx = qMax(maxx, pb.point(pc).x());
maxy = qMax(maxy, pb.point(pc).y());
}
}
else
{
minx = QMIN(minx, currItem->xPos()-lw);
miny = QMIN(miny, currItem->yPos()-lw);
maxx = QMAX(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = QMAX(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
minx = qMin(minx, currItem->xPos()-lw);
miny = qMin(miny, currItem->yPos()-lw);
maxx = qMax(maxx, currItem->xPos()-lw + currItem->width()+lw*2.0);
maxy = qMax(maxy, currItem->yPos()-lw + currItem->height()+lw*2.0);
}
}
gx = minx;
1709,8 → 1709,8
for (uint aa = 0; aa < pageNs.size(); ++aa)
{
a = pageNs[aa]-1;
maxWidth = QMAX(Doc->Pages->at(a)->width(), maxWidth);
maxHeight = QMAX(Doc->Pages->at(a)->height(), maxHeight);
maxWidth = qMax(Doc->Pages->at(a)->width(), maxWidth);
maxHeight = qMax(Doc->Pages->at(a)->height(), maxHeight);
}
PS_begin_doc(Doc, 0.0, 0.0, maxWidth, maxHeight, pageNs.size()*pagemult, doDev, sep, farb, Ic, gcr, over);
}
1757,7 → 1757,7
double y2 = it->BoundingY - ilw / 2.0;
double w2 = it->BoundingW + ilw;
double h2 = it->BoundingH + ilw;
if (!( QMAX( x, x2 ) <= QMIN( x+w, x2+w2 ) && QMAX( y, y2 ) <= QMIN( y+h1, y2+h2 )))
if (!( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h1, y2+h2 )))
continue;
if ((it->OwnPage != static_cast<int>(Doc->MasterPages.at(ap)->pageNr())) && (it->OwnPage != -1))
continue;
2242,7 → 2242,7
{
if ((c->itemText.text(d) == QChar(13)) || (c->itemText.text(d) == QChar(10)) || (c->itemText.text(d) == QChar(28)))
break;
bm += "\\"+cc.setNum(QMAX(c->itemText.text(d).unicode(), 32), 8);
bm += "\\"+cc.setNum(qMax(c->itemText.text(d).unicode(), 32), 8);
}
PDF_Bookmark(bm, a->pageNr()+1);
}
2252,7 → 2252,7
QString cc;
for (int d = 0; d < c->itemText.length(); ++d)
{
bm += "\\"+cc.setNum(QMAX(c->itemText.text(d).unicode(), 32), 8);
bm += "\\"+cc.setNum(qMax(c->itemText.text(d).unicode(), 32), 8);
}
PDF_Annotation(bm, 0, 0, c->width(), -c->height());
break;
2825,7 → 2825,7
double y2 = c->BoundingY - ilw / 2.0;
double w2 = c->BoundingW + ilw;
double h2 = c->BoundingH + ilw;
if (!( QMAX( x, x2 ) <= QMIN( x+w, x2+w2 ) && QMAX( y, y2 ) <= QMIN( y+h1, y2+h2 )))
if (!( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h1, y2+h2 )))
continue;
if (c->ChangedMasterItem)
continue;
2874,7 → 2874,7
double y2 = c->BoundingY - ilw / 2.0;
double w2 = c->BoundingW + ilw;
double h2 = c->BoundingH + ilw;
if (!( QMAX( x, x2 ) <= QMIN( x+w, x2+w2 ) && QMAX( y, y2 ) <= QMIN( y+h1, y2+h2 )))
if (!( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h1, y2+h2 )))
continue;
if (c->ChangedMasterItem)
continue;
3029,7 → 3029,7
SetFarbe(cstops.at(cst)->name, cstops.at(cst)->shade, &ch, &cs, &cv, &ck, gcr);
QString GCol;
if (GraySc)
GCol = hs.setNum((255.0 - QMIN(0.3 * ch + 0.59 * cs + 0.11 * cv + ck, 255.0)) / 255.0);
GCol = hs.setNum((255.0 - qMin(0.3 * ch + 0.59 * cs + 0.11 * cv + ck, 255.0)) / 255.0);
else
GCol = hs.setNum(ch / 255.0)+" "+ss.setNum(cs / 255.0)+" "+vs.setNum(cv / 255.0)+" "+ks.setNum(ck / 255.0);
Gcolors.prepend(GCol);
3050,7 → 3050,7
SetFarbe(cstops.at(cst)->name, cstops.at(cst)->shade, &ch, &cs, &cv, &ck, gcr);
QString GCol;
if (GraySc)
GCol = hs.setNum((255.0 - QMIN(0.3 * ch + 0.59 * cs + 0.11 * cv + ck, 255.0)) / 255.0);
GCol = hs.setNum((255.0 - qMin(0.3 * ch + 0.59 * cs + 0.11 * cv + ck, 255.0)) / 255.0);
else
GCol = hs.setNum(ch / 255.0)+" "+ss.setNum(cs / 255.0)+" "+vs.setNum(cv / 255.0)+" "+ks.setNum(ck / 255.0);
Gcolors.append(GCol);
3465,12 → 3465,12
if (hl->strikethruWidth() != -1)
lw = (hl->strikethruWidth() / 1000.0) * (hl->fontSize() / 10.0);
else
lw = QMAX(hl->font().strokeWidth(hl->fontSize() / 10.0), 1);
lw = qMax(hl->font().strokeWidth(hl->fontSize() / 10.0), 1);
}
else
{
Upos = hl->font().strikeoutPos(hl->fontSize() / 10.0);
lw = QMAX(hl->font().strokeWidth(hl->fontSize() / 10.0), 1);
lw = qMax(hl->font().strokeWidth(hl->fontSize() / 10.0), 1);
}
if (hl->baselineOffset() != 0)
Upos += (hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0);
3503,12 → 3503,12
if (hl->underlineWidth() != -1)
lw = (hl->underlineWidth() / 1000.0) * (hl->fontSize() / 10.0);
else
lw = QMAX(hl->font().strokeWidth(hl->fontSize() / 10.0), 1);
lw = qMax(hl->font().strokeWidth(hl->fontSize() / 10.0), 1);
}
else
{
Upos = hl->font().underlinePos(hl->fontSize() / 10.0);
lw = QMAX(hl->font().strokeWidth(hl->fontSize() / 10.0), 1);
lw = qMax(hl->font().strokeWidth(hl->fontSize() / 10.0), 1);
}
if (hl->baselineOffset() != 0)
Upos += (hl->fontSize() / 10.0) * (hl->baselineOffset() / 1000.0);
3669,12 → 3669,12
if (cstyle.underlineWidth() != -1)
lw = (cstyle.underlineWidth() / 1000.0) * (cstyle.fontSize() / 10.0);
else
lw = QMAX(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1);
lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1);
}
else
{
Upos = cstyle.font().underlinePos(cstyle.fontSize() / 10.0);
lw = QMAX(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1);
lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1);
}
if (cstyle.baselineOffset() != 0)
Upos += (cstyle.fontSize() / 10.0) * (cstyle.baselineOffset() / 1000.0);
3816,12 → 3816,12
if (cstyle.strikethruWidth() != -1)
lw = (cstyle.strikethruWidth() / 1000.0) * (cstyle.fontSize() / 10.0);
else
lw = QMAX(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1);
lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1);
}
else
{
Upos = cstyle.font().strikeoutPos(cstyle.fontSize() / 10.0);
lw = QMAX(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1);
lw = qMax(cstyle.font().strokeWidth(cstyle.fontSize() / 10.0), 1);
}
if (cstyle.baselineOffset() != 0)
Upos += (cstyle.fontSize() / 10.0) * (cstyle.baselineOffset() / 1000.0);
/branches/Version135x/Scribus/scribus/pagelayout.cpp
213,7 → 213,7
for (uint cc = 0; cc < layoutsView->count(); ++cc)
{
int w = ic->width();
maxWidth = QMAX(w, maxWidth);
maxWidth = qMax(w, maxWidth);
ic = ic->nextItem();
}
ic = layoutsView->firstItem();