Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 18801 → Rev 18800

/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
2372,7 → 2372,7
 
for (int poi=0; poi<ite->size()-3; poi += 4)
{
if (ite->isMarker(poi))
if (ite->point(poi).x() > 900000)
{
nPath = true;
continue;
/trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
1514,7 → 1514,7
meshGradientPatch patch;
patch.BL = cP;
patch.BR = cP;
if (item->PoLine.isMarker(poi))
if (item->PoLine.point(poi).x() > 900000)
continue;
meshPoint tL;
tL.resetTo(item->PoLine.point(poi));
/trunk/Scribus/scribus/plugins/import/pub/importpub.cpp
1315,7 → 1315,7
meshGradientPatch patch;
patch.BL = cP;
patch.BR = cP;
if (ite->PoLine.isMarker(poi))
if (ite->PoLine.point(poi).x() > 900000)
continue;
meshPoint tL;
tL.resetTo(ite->PoLine.point(poi));
/trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
200,7 → 200,6
bool ret = false;
firstPage = true;
pagecount = 1;
mpagecount = 0;
QFileInfo fi = QFileInfo(fName);
if ( !ScCore->usingGUI() )
{
390,8 → 389,10
bool retVal = true;
importedColors.clear();
importedPatterns.clear();
m_StyleSheets.clear();
m_currentStyleSheet = "";
m_objStyles.clear();
m_parStyles.clear();
m_chrStyles.clear();
m_layoutStyles.clear();
if(progressDialog)
{
progressDialog->setOverallProgress(2);
487,53 → 488,9
baseX = m_Doc->currentPage()->xOffset();
baseY = m_Doc->currentPage()->yOffset();
}
else if (drawPag.tagName() == "sl:section-prototypes")
{
for(QDomElement sp = drawPag.firstChildElement(); !sp.isNull(); sp = sp.nextSiblingElement() )
{
if (sp.tagName() == "sl:prototype")
{
QString pageNam = sp.attribute("sl:name");
if (!pageNam.isEmpty())
{
if (importerFlags & LoadSavePlugin::lfCreateDoc)
{
m_Doc->setMasterPageMode(true);
ScPage *oldCur = m_Doc->currentPage();
ScPage *addedPage = m_Doc->addMasterPage(mpagecount, pageNam);
m_Doc->setCurrentPage(addedPage);
addedPage->MPageNam = "";
m_Doc->view()->addPage(mpagecount, true);
baseX = addedPage->xOffset();
baseY = addedPage->yOffset();
mpagecount++;
for(QDomElement spd = sp.firstChildElement(); !spd.isNull(); spd = spd.nextSiblingElement() )
{
if (spd.tagName() == "sl:stylesheet")
{
parseStyleSheets(spd);
m_currentStyleSheet = spd.attribute("sfa:ID");
}
else if (spd.tagName() == "sl:drawables")
{
for(QDomElement spe = spd.firstChildElement(); !spe.isNull(); spe = spe.nextSiblingElement() )
{
if (spe.tagName() == "sl:page-group")
parsePageReference(spe);
}
}
}
m_Doc->setCurrentPage(oldCur);
m_Doc->setMasterPageMode(false);
}
}
}
}
}
else if (drawPag.tagName() == "sl:stylesheet")
{
parseStyleSheets(drawPag);
m_currentStyleSheet = drawPag.attribute("sfa:ID");
}
else if (drawPag.tagName() == "sl:drawables")
{
587,101 → 544,6
}
}
}
else if (drawPag.tagName() == "sf:text-storage")
{
for(QDomElement spf = drawPag.firstChildElement(); !spf.isNull(); spf = spf.nextSiblingElement() )
{
if (spf.tagName() == "sf:stylesheet-ref")
{
m_currentStyleSheet = spf.attribute("sfa:IDREF");
}
else if (spf.tagName() == "sf:text-body")
{
int txPage = 0;
StoryText itemText;
itemText.clear();
itemText.setDoc(m_Doc);
int posC = 0;
QString pStyle = CommonStrings::DefaultParagraphStyle;
ParagraphStyle newStyle;
newStyle.setDefaultStyle(false);
newStyle.setParent(pStyle);
ParagraphStyle ttx = m_Doc->paragraphStyle(pStyle);
CharStyle nstyle = ttx.charStyle();
newStyle.setLineSpacingMode(ParagraphStyle::FixedLineSpacing);
newStyle.setLineSpacing(nstyle.fontSize() / 10.0);
itemText.setDefaultStyle(newStyle);
for(QDomElement spg = spf.firstChildElement(); !spg.isNull(); spg = spg.nextSiblingElement() )
{
if (spg.tagName() == "sf:container-hint")
{
txPage = spg.attribute("sf:page-index").toInt();
}
else if (spg.tagName() == "sf:p")
{
ParagraphStyle tmpStyle = newStyle;
if (!spg.attribute("sf:style").isEmpty())
{
if (m_Doc->styleExists(spg.attribute("sf:style")))
tmpStyle = m_Doc->paragraphStyle(spg.attribute("sf:style"));
else
{
tmpStyle.setName(spg.attribute("sf:style"));
applyParagraphAttrs(tmpStyle, tmpStyle.charStyle(), spg.attribute("sf:style"));
StyleSet<ParagraphStyle>tmp;
tmp.create(tmpStyle);
m_Doc->redefineStyles(tmp, false);
}
}
int totalCount = 0;
if (spg.hasChildNodes())
{
for(QDomElement sph = spg.firstChildElement(); !sph.isNull(); sph = sph.nextSiblingElement() )
{
totalCount += sph.text().length();
if (sph.tagName() == "sf:container-hint")
{
txPage = sph.attribute("sf:page-index").toInt();
}
}
}
int count = spg.text().length();
QString tgText = spg.text();
tgText = tgText.left(count - totalCount);
if (tgText.length() > 0)
{
itemText.insertChars(posC, tgText);
itemText.applyStyle(posC, tmpStyle);
itemText.applyCharStyle(posC, count - totalCount, tmpStyle.charStyle());
posC = itemText.length();
}
if (spg.hasChildNodes())
{
for(QDomElement sph = spg.firstChildElement(); !sph.isNull(); sph = sph.nextSiblingElement() )
{
if (sph.tagName() == "sf:span")
{
CharStyle tmpCStyle = tmpStyle.charStyle();
applyCharAttrs(tmpCStyle, sph.attribute("sf:style"));
int count = sph.text().length();
if (count > 0)
{
itemText.insertChars(posC, sph.text());
itemText.applyStyle(posC, tmpStyle);
itemText.applyCharStyle(posC, count, tmpCStyle);
posC = itemText.length();
}
}
}
}
itemText.insertChars(posC, SpecialChars::PARSEP);
itemText.applyStyle(posC, tmpStyle);
posC = itemText.length();
}
}
}
}
}
}
return true;
}
688,8 → 550,6
 
void PagesPlug::parseStyleSheets(QDomElement &drawPag)
{
QString sheetName = drawPag.attribute("sfa:ID");
StyleSheet styleSH;
for(QDomElement sp = drawPag.firstChildElement(); !sp.isNull(); sp = sp.nextSiblingElement() )
{
if ((sp.tagName() == "sf:styles") || (sp.tagName() == "sf:anon-styles"))
792,11 → 652,11
QString i = spd.attribute("sf:ident");
QString i2 = spd.attribute("sf:name");
if (!id.isEmpty())
styleSH.m_chrStyles.insert(id, currStyle);
m_chrStyles.insert(id, currStyle);
else if (!i.isEmpty())
styleSH.m_chrStyles.insert(i, currStyle);
m_chrStyles.insert(i, currStyle);
else if (!i2.isEmpty())
styleSH.m_chrStyles.insert(i2, currStyle);
m_chrStyles.insert(i2, currStyle);
}
if (spd.tagName() == "sf:paragraphstyle")
{
903,11 → 763,11
QString i = spd.attribute("sf:ident");
QString i2 = spd.attribute("sf:name");
if (!id.isEmpty())
styleSH.m_parStyles.insert(id, currStyle);
m_parStyles.insert(id, currStyle);
else if (!i.isEmpty())
styleSH.m_parStyles.insert(i, currStyle);
m_parStyles.insert(i, currStyle);
else if (!i2.isEmpty())
styleSH.m_parStyles.insert(i2, currStyle);
m_parStyles.insert(i2, currStyle);
}
else if (spd.tagName() == "sf:layoutstyle")
{
941,11 → 801,11
QString i = spd.attribute("sf:ident");
QString i2 = spd.attribute("sf:name");
if (!id.isEmpty())
styleSH.m_layoutStyles.insert(id, currStyle);
m_layoutStyles.insert(id, currStyle);
else if (!i.isEmpty())
styleSH.m_layoutStyles.insert(i, currStyle);
m_layoutStyles.insert(i, currStyle);
else if (!i2.isEmpty())
styleSH.m_layoutStyles.insert(i2, currStyle);
m_layoutStyles.insert(i2, currStyle);
}
else if (spd.tagName() == "sf:graphic-style")
{
1110,16 → 970,15
QString i = spd.attribute("sf:ident");
QString i2 = spd.attribute("sf:name");
if (!id.isEmpty())
styleSH.m_objStyles.insert(id, currStyle);
m_objStyles.insert(id, currStyle);
else if (!i.isEmpty())
styleSH.m_objStyles.insert(i, currStyle);
m_objStyles.insert(i, currStyle);
else if (!i2.isEmpty())
styleSH.m_objStyles.insert(i2, currStyle);
m_objStyles.insert(i2, currStyle);
}
}
}
}
m_StyleSheets.insert(sheetName, styleSH);
}
 
void PagesPlug::parsePageReference(QDomElement &drawPag)
1559,20 → 1418,17
 
void PagesPlug::applyParagraphAttrs(ParagraphStyle &newStyle, CharStyle &tmpCStyle, QString pAttrs)
{
if (!m_StyleSheets.contains(m_currentStyleSheet))
return;
StyleSheet currSH = m_StyleSheets[m_currentStyleSheet];
if (currSH.m_parStyles.contains(pAttrs))
if (m_parStyles.contains(pAttrs))
{
ParStyle actStyle;
ParStyle currStyle = currSH.m_parStyles[pAttrs];
ParStyle currStyle = m_parStyles[pAttrs];
QStringList parents;
while (currStyle.parentStyle.valid)
{
if (currSH.m_parStyles.contains(currStyle.parentStyle.value))
if (m_parStyles.contains(currStyle.parentStyle.value))
{
parents.prepend(currStyle.parentStyle.value);
currStyle = currSH.m_parStyles[currStyle.parentStyle.value];
currStyle = m_parStyles[currStyle.parentStyle.value];
}
else
break;
1582,7 → 1438,7
{
for (int p = 0; p < parents.count(); p++)
{
currStyle = currSH.m_parStyles[parents[p]];
currStyle = m_parStyles[parents[p]];
if (currStyle.fontName.valid)
actStyle.fontName = AttributeValue(currStyle.fontName.value);
if (currStyle.fontSize.valid)
1618,20 → 1474,17
 
void PagesPlug::applyCharAttrs(CharStyle &tmpCStyle, QString pAttrs)
{
if (!m_StyleSheets.contains(m_currentStyleSheet))
return;
StyleSheet currSH = m_StyleSheets[m_currentStyleSheet];
if (currSH.m_chrStyles.contains(pAttrs))
if (m_chrStyles.contains(pAttrs))
{
ChrStyle actStyle;
ChrStyle currStyle = currSH.m_chrStyles[pAttrs];
ChrStyle currStyle = m_chrStyles[pAttrs];
QStringList parents;
while (currStyle.parentStyle.valid)
{
if (currSH.m_chrStyles.contains(currStyle.parentStyle.value))
if (m_chrStyles.contains(currStyle.parentStyle.value))
{
parents.prepend(currStyle.parentStyle.value);
currStyle = currSH.m_chrStyles[currStyle.parentStyle.value];
currStyle = m_chrStyles[currStyle.parentStyle.value];
}
else
break;
1641,7 → 1494,7
{
for (int p = 0; p < parents.count(); p++)
{
currStyle = currSH.m_chrStyles[parents[p]];
currStyle = m_chrStyles[parents[p]];
if (currStyle.fontName.valid)
actStyle.fontName = AttributeValue(currStyle.fontName.value);
if (currStyle.fontSize.valid)
1670,143 → 1523,139
item->OldH2 = item->height();
item->updateClip();
item->OwnPage = m_Doc->OnPage(item);
if (m_StyleSheets.contains(m_currentStyleSheet))
if (!obState.layoutStyleRef.isEmpty())
{
StyleSheet currSH = m_StyleSheets[m_currentStyleSheet];
if (!obState.layoutStyleRef.isEmpty())
if (m_layoutStyles.contains(obState.layoutStyleRef))
{
if (currSH.m_layoutStyles.contains(obState.layoutStyleRef))
LayoutStyle actStyle;
LayoutStyle currStyle = m_layoutStyles[obState.layoutStyleRef];
QStringList parents;
while (currStyle.parentStyle.valid)
{
LayoutStyle actStyle;
LayoutStyle currStyle = currSH.m_layoutStyles[obState.layoutStyleRef];
QStringList parents;
while (currStyle.parentStyle.valid)
if (m_layoutStyles.contains(currStyle.parentStyle.value))
{
if (currSH.m_layoutStyles.contains(currStyle.parentStyle.value))
{
parents.prepend(currStyle.parentStyle.value);
currStyle = currSH.m_layoutStyles[currStyle.parentStyle.value];
}
else
break;
parents.prepend(currStyle.parentStyle.value);
currStyle = m_layoutStyles[currStyle.parentStyle.value];
}
parents.append(obState.layoutStyleRef);
double textMarginLeft = 0.0;
double textMarginRight = 0.0;
double textMarginTop = 0.0;
double textMarginBottom = 0.0;
double textColumnGap = 0.0;
int textColumnCount = 1;
if (!parents.isEmpty())
else
break;
}
parents.append(obState.layoutStyleRef);
double textMarginLeft = 0.0;
double textMarginRight = 0.0;
double textMarginTop = 0.0;
double textMarginBottom = 0.0;
double textColumnGap = 0.0;
int textColumnCount = 1;
if (!parents.isEmpty())
{
for (int p = 0; p < parents.count(); p++)
{
for (int p = 0; p < parents.count(); p++)
{
currStyle = currSH.m_layoutStyles[parents[p]];
if (currStyle.Extra.valid)
actStyle.Extra = AttributeValue(currStyle.Extra.value);
if (currStyle.RExtra.valid)
actStyle.RExtra = AttributeValue(currStyle.RExtra.value);
if (currStyle.TExtra.valid)
actStyle.TExtra = AttributeValue(currStyle.TExtra.value);
if (currStyle.BExtra.valid)
actStyle.BExtra = AttributeValue(currStyle.BExtra.value);
if (currStyle.TextColumnGutter.valid)
actStyle.TextColumnGutter = AttributeValue(currStyle.TextColumnGutter.value);
if (currStyle.TextColumnCount.valid)
actStyle.TextColumnCount = AttributeValue(currStyle.TextColumnCount.value);
}
currStyle = m_layoutStyles[parents[p]];
if (currStyle.Extra.valid)
actStyle.Extra = AttributeValue(currStyle.Extra.value);
if (currStyle.RExtra.valid)
actStyle.RExtra = AttributeValue(currStyle.RExtra.value);
if (currStyle.TExtra.valid)
actStyle.TExtra = AttributeValue(currStyle.TExtra.value);
if (currStyle.BExtra.valid)
actStyle.BExtra = AttributeValue(currStyle.BExtra.value);
if (currStyle.TextColumnGutter.valid)
actStyle.TextColumnGutter = AttributeValue(currStyle.TextColumnGutter.value);
if (currStyle.TextColumnCount.valid)
actStyle.TextColumnCount = AttributeValue(currStyle.TextColumnCount.value);
}
if (actStyle.Extra.valid)
textMarginLeft = actStyle.Extra.value.toDouble();
if (actStyle.RExtra.valid)
textMarginRight = actStyle.RExtra.value.toDouble();
if (actStyle.TExtra.valid)
textMarginTop = actStyle.TExtra.value.toDouble();
if (actStyle.BExtra.valid)
textMarginBottom = actStyle.BExtra.value.toDouble();
if (actStyle.TextColumnGutter.valid)
textColumnGap = actStyle.TextColumnGutter.value.toDouble();
if (actStyle.TextColumnCount.valid)
textColumnCount = actStyle.TextColumnCount.value.toInt();
item->setTextToFrameDist(textMarginLeft, textMarginRight, textMarginTop, textMarginBottom);
item->setColumns(textColumnCount);
item->setColumnGap(textColumnGap);
}
if (actStyle.Extra.valid)
textMarginLeft = actStyle.Extra.value.toDouble();
if (actStyle.RExtra.valid)
textMarginRight = actStyle.RExtra.value.toDouble();
if (actStyle.TExtra.valid)
textMarginTop = actStyle.TExtra.value.toDouble();
if (actStyle.BExtra.valid)
textMarginBottom = actStyle.BExtra.value.toDouble();
if (actStyle.TextColumnGutter.valid)
textColumnGap = actStyle.TextColumnGutter.value.toDouble();
if (actStyle.TextColumnCount.valid)
textColumnCount = actStyle.TextColumnCount.value.toInt();
item->setTextToFrameDist(textMarginLeft, textMarginRight, textMarginTop, textMarginBottom);
item->setColumns(textColumnCount);
item->setColumnGap(textColumnGap);
}
if (!obState.styleRef.isEmpty())
}
if (!obState.styleRef.isEmpty())
{
if (m_objStyles.contains(obState.styleRef))
{
if (currSH.m_objStyles.contains(obState.styleRef))
ObjStyle actStyle;
ObjStyle currStyle = m_objStyles[obState.styleRef];
QStringList parents;
while (currStyle.parentStyle.valid)
{
ObjStyle actStyle;
ObjStyle currStyle = currSH.m_objStyles[obState.styleRef];
QStringList parents;
while (currStyle.parentStyle.valid)
if (m_objStyles.contains(currStyle.parentStyle.value))
{
if (currSH.m_objStyles.contains(currStyle.parentStyle.value))
{
parents.prepend(currStyle.parentStyle.value);
currStyle = currSH.m_objStyles[currStyle.parentStyle.value];
}
else
break;
parents.prepend(currStyle.parentStyle.value);
currStyle = m_objStyles[currStyle.parentStyle.value];
}
parents.append(obState.styleRef);
if (!parents.isEmpty())
else
break;
}
parents.append(obState.styleRef);
if (!parents.isEmpty())
{
for (int p = 0; p < parents.count(); p++)
{
for (int p = 0; p < parents.count(); p++)
{
currStyle = currSH.m_objStyles[parents[p]];
if (currStyle.CurrColorFill.valid)
actStyle.CurrColorFill = AttributeValue(currStyle.CurrColorFill.value);
if (currStyle.CurrColorStroke.valid)
actStyle.CurrColorStroke = AttributeValue(currStyle.CurrColorStroke.value);
if (currStyle.fillOpacity.valid)
actStyle.fillOpacity = AttributeValue(currStyle.fillOpacity.value);
if (currStyle.strokeOpacity.valid)
actStyle.strokeOpacity = AttributeValue(currStyle.strokeOpacity.value);
if (currStyle.opacity.valid)
actStyle.opacity = AttributeValue(currStyle.opacity.value);
if (currStyle.LineW.valid)
actStyle.LineW = AttributeValue(currStyle.LineW.value);
if (currStyle.CapStyle.valid)
actStyle.CapStyle = AttributeValue(currStyle.CapStyle.value);
if (currStyle.JoinStyle.valid)
actStyle.JoinStyle = AttributeValue(currStyle.JoinStyle.value);
}
currStyle = m_objStyles[parents[p]];
if (currStyle.CurrColorFill.valid)
actStyle.CurrColorFill = AttributeValue(currStyle.CurrColorFill.value);
if (currStyle.CurrColorStroke.valid)
actStyle.CurrColorStroke = AttributeValue(currStyle.CurrColorStroke.value);
if (currStyle.fillOpacity.valid)
actStyle.fillOpacity = AttributeValue(currStyle.fillOpacity.value);
if (currStyle.strokeOpacity.valid)
actStyle.strokeOpacity = AttributeValue(currStyle.strokeOpacity.value);
if (currStyle.opacity.valid)
actStyle.opacity = AttributeValue(currStyle.opacity.value);
if (currStyle.LineW.valid)
actStyle.LineW = AttributeValue(currStyle.LineW.value);
if (currStyle.CapStyle.valid)
actStyle.CapStyle = AttributeValue(currStyle.CapStyle.value);
if (currStyle.JoinStyle.valid)
actStyle.JoinStyle = AttributeValue(currStyle.JoinStyle.value);
}
if (actStyle.CurrColorFill.valid)
item->setFillColor(actStyle.CurrColorFill.value);
if (actStyle.CurrColorStroke.valid)
item->setLineColor(actStyle.CurrColorStroke.value);
if (actStyle.fillOpacity.valid)
item->setFillTransparency(actStyle.fillOpacity.value.toDouble());
if (actStyle.strokeOpacity.valid)
item->setLineTransparency(actStyle.strokeOpacity.value.toDouble());
if (actStyle.LineW.valid)
item->setLineWidth(actStyle.LineW.value.toDouble());
if (actStyle.CapStyle.valid)
{
if (actStyle.CapStyle.value == "butt")
item->setLineEnd(Qt::FlatCap);
else if (actStyle.CapStyle.value == "round")
item->setLineEnd(Qt::RoundCap);
else if (actStyle.CapStyle.value == "square")
item->setLineEnd(Qt::SquareCap);
else
item->setLineEnd(Qt::FlatCap);
}
if (actStyle.JoinStyle.valid)
{
if (actStyle.JoinStyle.value == "miter")
item->setLineJoin(Qt::MiterJoin);
else if (actStyle.JoinStyle.value == "round")
item->setLineJoin(Qt::RoundJoin);
else if (actStyle.JoinStyle.value == "bevel")
item->setLineJoin(Qt::BevelJoin);
else
item->setLineJoin(Qt::MiterJoin);
}
}
if (actStyle.CurrColorFill.valid)
item->setFillColor(actStyle.CurrColorFill.value);
if (actStyle.CurrColorStroke.valid)
item->setLineColor(actStyle.CurrColorStroke.value);
if (actStyle.fillOpacity.valid)
item->setFillTransparency(actStyle.fillOpacity.value.toDouble());
if (actStyle.strokeOpacity.valid)
item->setLineTransparency(actStyle.strokeOpacity.value.toDouble());
if (actStyle.LineW.valid)
item->setLineWidth(actStyle.LineW.value.toDouble());
if (actStyle.CapStyle.valid)
{
if (actStyle.CapStyle.value == "butt")
item->setLineEnd(Qt::FlatCap);
else if (actStyle.CapStyle.value == "round")
item->setLineEnd(Qt::RoundCap);
else if (actStyle.CapStyle.value == "square")
item->setLineEnd(Qt::SquareCap);
else
item->setLineEnd(Qt::FlatCap);
}
if (actStyle.JoinStyle.valid)
{
if (actStyle.JoinStyle.value == "miter")
item->setLineJoin(Qt::MiterJoin);
else if (actStyle.JoinStyle.value == "round")
item->setLineJoin(Qt::RoundJoin);
else if (actStyle.JoinStyle.value == "bevel")
item->setLineJoin(Qt::BevelJoin);
else
item->setLineJoin(Qt::MiterJoin);
}
}
}
/* double xp = item->xPos() - m_Doc->currentPage()->xOffset();
/trunk/Scribus/scribus/plugins/import/pages/importpages.h
160,14 → 160,6
QString styleRef;
QString layoutStyleRef;
};
struct StyleSheet
{
QHash<QString, ObjStyle> m_objStyles;
QHash<QString, ParStyle> m_parStyles;
QHash<QString, ChrStyle> m_chrStyles;
QHash<QString, LayoutStyle> m_layoutStyles;
};
 
bool convert(QString fn);
bool parseDocReference(QString designMap, bool compressed);
void parseStyleSheets(QDomElement &drawPag);
190,7 → 182,6
QStringList importedPatterns;
bool firstPage;
int pagecount;
int mpagecount;
double topMargin;
double leftMargin;
double rightMargin;
199,8 → 190,10
double pgGap;
QString papersize;
QHash<int, QString> imageResources;
QHash<QString, StyleSheet> m_StyleSheets;
QString m_currentStyleSheet;
QHash<QString, ObjStyle> m_objStyles;
QHash<QString, ParStyle> m_parStyles;
QHash<QString, ChrStyle> m_chrStyles;
QHash<QString, LayoutStyle> m_layoutStyles;
 
PageItem* addClip(PageItem* retObj, ObjState &obState);
 
/trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
3650,10 → 3650,10
}
else
{
double minx = std::numeric_limits<double>::max();
double miny = std::numeric_limits<double>::max();
double maxx = -std::numeric_limits<double>::max();
double maxy = -std::numeric_limits<double>::max();
double minx = 999999.9;
double miny = 999999.9;
double maxx = -999999.9;
double maxy = -999999.9;
PageItem* groupItem = Elements.at(gg.index);
for (int a = gg.index+1; a < Elements.count(); ++a)
{
/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
1648,16 → 1648,8
ite->PoLine.svgClosePath();
else
ite->convertTo(PageItem::PolyLine);
if (ite->PoLine.size() < 4)
{
tmpSel->addItem(ite);
m_Doc->itemSelection_DeleteItem(tmpSel);
}
else
{
finishNode(e, ite);
PElements.append(ite);
}
finishNode(e, ite);
PElements.append(ite);
}
delete( m_gc.pop() );
return PElements;
/trunk/Scribus/scribus/plugins/xpsexport/xpsexplugin.cpp
2529,7 → 2529,7
 
for (int poi=0; poi<ite->size()-3; poi += 4)
{
if (ite->isMarker(poi))
if (ite->point(poi).x() > 900000)
{
nPath = true;
continue;
/trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.cpp
121,7 → 121,7
uint psize = currItem->ContourLine.size();
for (uint a = 0; a < psize-3; a += 4)
{
if (currItem->ContourLine.isMarker(a))
if (currItem->ContourLine.point(a).x() > 900000)
{
points.setMarker();
continue;
165,7 → 165,7
uint psize = currItem->PoLine.size();
for (uint a = 0; a < psize-3; a += 4)
{
if (currItem->PoLine.isMarker(a))
if (currItem->PoLine.point(a).x() > 900000)
{
points.setMarker();
continue;
/trunk/Scribus/scribus/scribusdoc.cpp
2519,7 → 2519,7
symNewLine.addQuadPoint(0.96875, 3.125, 0.96875, 3.125, 6.75, 3.125, 6.75, 3.125);
symNewLine.addQuadPoint(6.75, 3.125, 6.75, 3.125, 6.51562, 2.625, 6.51562, 2.625);
symNewLine.addQuadPoint(6.51562, 2.625, 6.51562, 2.625, 6.51562, 2.625, 6.51562, 2.625);
symNewLine.setMarker();
symNewLine.addQuadPoint(999999, 999999, 999999, 999999, 999999, 999999, 999999, 999999);
symNewLine.addQuadPoint(6.875, 0, 6.875, 0, 6.51562, 0, 6.51562, 0);
symNewLine.addQuadPoint(6.51562, 0, 6.51562, 0, 6.51562, 2.84375, 6.51562, 2.84375);
symNewLine.addQuadPoint(6.51562, 2.84375, 6.51562, 2.84375, 6.75, 3.125, 6.51562, 3.125);
13514,7 → 13514,7
{
ite = allItems.at(ii);
if (ite->LayerID == layerID)
ite->invalidateLayout();
ite->invalidateLayout();
}
allItems.clear();
}
15620,7 → 15620,7
m_Selection->addItem(currItem);
for (uint a = EndInd-1; a > 0; --a)
{
if (currItem->PoLine.isMarker(a))
if (currItem->PoLine.point(a).x() > 900000)
{
StartInd = a + 1;
bb = new PageItem_Polygon(*currItem);
16043,7 → 16043,7
uint StartInd = 0;
for (int n = ClRe; n < Clip.size(); ++n)
{
if (Clip.isMarker(n))
if (Clip.point(n).x() > 900000)
{
EndInd = n;
break;
16055,7 → 16055,7
{
if (n2 == 0)
break;
if (Clip.isMarker(n2))
if (Clip.point(n2).x() > 900000)
{
StartInd = n2 + 1;
break;
16273,7 → 16273,7
int StartInd = 0;
for (int n = ClRe; n < Clip.size(); ++n)
{
if (Clip.isMarker(n))
if (Clip.point(n).x() > 900000)
{
EndInd = n;
break;
16285,7 → 16285,7
{
if (n2 == 0)
break;
if (Clip.isMarker(n2))
if (Clip.point(n2).x() > 900000)
{
StartInd = n2 + 1;
break;
/trunk/Scribus/scribus/pdflib_core.cpp
1225,10 → 1225,10
UsedFontsP.insert(it.key(), "/Fo"+QString::number(a));
uint SubFonts = 0;
int glyphCount = 0;
double minx = std::numeric_limits<double>::max();
double miny = std::numeric_limits<double>::max();
double maxx = -std::numeric_limits<double>::max();
double maxy = -std::numeric_limits<double>::max();
double minx = 999999.9;
double miny = 999999.9;
double maxx = -999999.9;
double maxy = -999999.9;
QList<uint> glyphWidths;
QStringList charProcs;
QString encoding = "<< /Type /Encoding\n/Differences [ 0\n";
1252,7 → 1252,7
gly.translate(0, 1000);
for (int poi = 0; poi < gly.size()-3; poi += 4)
{
if (gly.isMarker(poi))
if (gly.point(poi).x() > 900000)
{
fon += "h\n";
nPath = true;
1339,10 → 1339,10
// glyphMapping.clear();
glyphCount = 0;
++SubFonts;
minx = std::numeric_limits<double>::max();
miny = std::numeric_limits<double>::max();
maxx = -std::numeric_limits<double>::max();
maxy = -std::numeric_limits<double>::max();
minx = 999999.9;
miny = 999999.9;
maxx = -999999.9;
maxy = -999999.9;
encoding = "<< /Type /Encoding\n/Differences [ 0\n";
}
}
1366,7 → 1366,7
gly.map(mat);
for (int poi = 0; poi < gly.size()-3; poi += 4)
{
if (gly.isMarker(poi))
if (gly.point(poi).x() > 900000)
{
fon += "h\n";
nPath = true;
5472,7 → 5472,7
{
for (int poi=0; poi<gly.size()-3; poi += 4)
{
if (gly.isMarker(poi))
if (gly.point(poi).x() > 900000)
{
tmp2 += "h\n";
nPath = true;
5577,7 → 5577,7
{
for (int poi=0; poi<gly.size()-3; poi += 4)
{
if (gly.isMarker(poi))
if (gly.point(poi).x() > 900000)
{
tmp2 += "h\n";
nPath = true;
5866,7 → 5866,7
 
for (int poi=0; poi<ite->PoLine.size()-3; poi += 4)
{
if (ite->PoLine.isMarker(poi))
if (ite->PoLine.point(poi).x() > 900000)
{
nPath = true;
continue;
5910,7 → 5910,7
 
for (int poi=0; poi<ite->size()-3; poi += 4)
{
if (ite->isMarker(poi))
if (ite->point(poi).x() > 900000)
{
nPath = true;
continue;
5952,7 → 5952,7
bool nPath = true;
for (int poi=0; poi<ite->imageClip.size()-3; poi += 4)
{
if (ite->imageClip.isMarker(poi))
if (ite->imageClip.point(poi).x() > 900000)
{
tmp += "h\n";
nPath = true;
/trunk/Scribus/scribus/pslib.cpp
170,7 → 170,7
{
for (int poi = 0; poi < ig.value().size()-3; poi += 4)
{
if (ig.value().isMarker(poi))
if (ig.value().point(poi).x() > 900000)
{
FontDesc += "cl\n";
nPath = true;
1463,10 → 1463,10
uint docSelectionCount=Doc->m_Selection->count();
if ((!psExport) && (docSelectionCount != 0))
{
double minx = std::numeric_limits<double>::max();
double miny = std::numeric_limits<double>::max();
double maxx = -std::numeric_limits<double>::max();
double maxy = -std::numeric_limits<double>::max();
double minx = 999999.9;
double miny = 999999.9;
double maxx = -999999.9;
double maxy = -999999.9;
for (uint ep = 0; ep < docSelectionCount; ++ep)
{
PageItem* currItem = Doc->m_Selection->itemAt(ep);
5443,7 → 5443,7
 
for (int poi=0; poi < c->size()-3; poi += 4)
{
if (c->isMarker(poi))
if (c->point(poi).x() > 900000)
{
nPath = true;
continue;
/trunk/Scribus/scribus/scpainter.cpp
1643,7 → 1643,7
newPath();
for (int poi=0; poi<points->size()-3; poi += 4)
{
if (points->isMarker(poi))
if (points->point(poi).x() > 900000)
{
nPath = true;
continue;
1685,7 → 1685,7
newPath();
for (int poi=0; poi<points->size()-3; poi += 4)
{
if (points->isMarker(poi))
if (points->point(poi).x() > 900000)
{
nPath = true;
continue;
/trunk/Scribus/scribus/third_party/lib2geom/scribushelper.cpp
114,7 → 114,7
{
for (int poi=0; poi < p.size()-3; poi += 4)
{
if (p.isMarker(poi))
if (p.point(poi).x() > 900000)
{
if (closed)
ret.close();
/trunk/Scribus/scribus/fpointarray.cpp
33,7 → 33,6
#include <QVector>
 
#include "util.h"
#include "sclimits.h"
 
using namespace std;
 
184,7 → 183,7
pend += QVector<FPoint>::count();
for (Iterator p = begin(); p != pend; p++)
{
if (!isMarkerI(p))
if (p->x() < 900000)
*p += pt;
}
}
195,8 → 194,9
pend += QVector<FPoint>::count();
for (Iterator p = begin(); p != pend; p++)
{
if (!isMarkerI(p))
if (p->x() < 900000) {
p->setXY(p->x() * sx, p->y() * sy);
}
}
}
 
213,7 → 213,7
miny = maxy = pd->yp;
for ( ++pd; pd != pend; ++pd )
{ // find min+max x and y
if (isMarkerI(pd))
if (pd->xp > 900000)
{
continue;
}
244,7 → 244,7
pend += QVector<FPoint>::count();
for (Iterator p = begin(); p != pend; p++)
{
if (isMarkerD(p->xp, p->yp))
if (p->xp > 900000)
{
mx = p->xp;
my = p->yp;
261,29 → 261,12
 
void FPointArray::setMarker()
{
double maxVal = std::numeric_limits<double>::max() / 2.0;
addQuadPoint(maxVal, maxVal, maxVal, maxVal, maxVal, maxVal, maxVal, maxVal);
addQuadPoint(999999.0, 999999.0,
999999.0, 999999.0,
999999.0, 999999.0,
999999.0, 999999.0);
}
 
bool FPointArray::isMarker(int pos) const
{
double maxVal = std::numeric_limits<double>::max() / 3.0;
const FPoint& p = QVector<FPoint>::at(pos);
return ((p.x() >= maxVal) && (p.y() >= maxVal));
}
 
bool FPointArray::isMarkerI(ConstIterator p) const
{
double maxVal = std::numeric_limits<double>::max() / 3.0;
return ((p->xp >= maxVal) && (p->yp >= maxVal));
}
 
bool FPointArray::isMarkerD(double x, double y) const
{
double maxVal = std::numeric_limits<double>::max() / 3.0;
return ((x >= maxVal) && (y >= maxVal));
}
 
void FPointArray::addPoint(double x, double y)
{
QVector<FPoint>::append(FPoint(x, y));
502,7 → 485,7
{
for (int poi=0; poi < size()-3; poi += 4)
{
if (isMarker(poi))
if (point(poi).x() > 900000)
{
nPath = true;
continue;
544,7 → 527,7
{
for (int poi = 0; poi < size()-3; poi += 4)
{
if (isMarker(poi))
if (point(poi).x() > 900000)
{
nPath = true;
continue;
/trunk/Scribus/scribus/scpageoutput.cpp
1270,7 → 1270,7
Start = item->PoLine.point(n);
firstp = false;
}
if (item->PoLine.isMarker(n))
if (item->PoLine.point(n).x() > 900000)
{
cli.addPoint(item->PoLine.point(n-2));
cli.addPoint(item->PoLine.point(n-2));
1436,7 → 1436,7
Start = item->PoLine.point(n);
firstp = false;
}
if (item->PoLine.isMarker(n))
if (item->PoLine.point(n).x() > 900000)
{
cli.addPoint(item->PoLine.point(n-2));
cli.addPoint(item->PoLine.point(n-2));
/trunk/Scribus/scribus/canvasmode_nodeedit.cpp
91,7 → 91,7
{
for (int poi=0; poi<cli.size()-3; poi += 4)
{
if (cli.isMarker(poi))
if (cli.point(poi).x() > 900000)
continue;
p->setPen(QPen(Qt::blue, onePerScale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin));
FPoint a1 = cli.point(poi);
110,7 → 110,7
// draw points
for (int a = 0; a < cli.size()-1; a += 2)
{
if (cli.isMarker(a))
if (cli.point(a).x() > 900000)
continue;
if (m_doc->nodeEdit.EdPoints)
{
198,7 → 198,7
}
for (int a = 0; a < Clip.size(); ++a)
{
if (Clip.isMarker(a))
if (Clip.point(a).x() > 900000)
continue;
FPoint np = Clip.point(a);
FPoint npf2 = np.transformPoint(pm2, false);
564,7 → 564,7
{
for (int n = m_doc->nodeEdit.ClRe; n < Clip.size(); ++n)
{
if (Clip.isMarker(n))
if (Clip.point(n).x() > 900000)
{
EndInd = n;
break;
574,7 → 574,7
{
if (n2 == 0)
break;
if (Clip.isMarker(n2))
if (Clip.point(n2).x() > 900000)
{
StartInd = n2 + 1;
break;
665,7 → 665,7
StartInd = 0;
for (int n = m_doc->nodeEdit.ClRe; n < Clip.size(); ++n)
{
if (Clip.isMarker(n))
if (Clip.point(n).x() > 900000)
{
EndInd = n;
break;
677,7 → 677,7
{
if (n2 == 0)
break;
if (Clip.isMarker(n2))
if (Clip.point(n2).x() > 900000)
{
StartInd = n2 + 1;
break;
/trunk/Scribus/scribus/scpainterex_ps2.cpp
886,7 → 886,7
newPath();
for (int poi=0; poi<points->size()-3; poi += 4)
{
if (points->isMarker(poi))
if (points->point(poi).x() > 900000)
{
nPath = true;
continue;
1369,7 → 1369,7
for (int i = 0; i < points->size(); i++ )
{
point = points->point(i);
if( points->isMarker(i) )
if( point.x() > 900000 )
continue;
transformPoint(point, point);
if( point.x() < left ) left = point.x();
/trunk/Scribus/scribus/fpointarray.h
64,9 → 64,6
FPointArray &operator=( const FPointArray &a );
FPointArray copy() const;
void setMarker();
bool isMarker(int pos) const;
bool isMarkerI(ConstIterator p) const;
bool isMarkerD(double x, double y) const;
void addPoint(double x, double y);
void addPoint(FPoint p);
bool hasLastQuadPoint(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) const;
/trunk/Scribus/scribus/util_math.cpp
400,7 → 400,7
{
for (int poi=0; poi<ina.size()-3; poi += 4)
{
if (ina.isMarker(poi)) // && cli.size() > 0)
if (ina.point(poi).x() > 900000) // && cli.size() > 0)
{
// outa << cli.point(cli.size()-1);
Segs.append(outa.size());
434,7 → 434,7
for (uint c = 0; c < clipSize; ++c)
{
np = Clip->point(c);
if (Clip->isMarker(c))
if (np.x() > 900000)
continue;
if (np.x() > mx)
mx = np.x();
454,7 → 454,7
for (uint c = 0; c < clipSize; ++c)
{
np = Clip->point(c);
if (Clip->isMarker(c))
if (np.x() > 900000)
continue;
if (np.x() < mx)
mx = np.x();
/trunk/Scribus/scribus/scpainterex_cairo.cpp
557,7 → 557,7
newPath();
for (int poi=0; poi<points->size()-3; poi += 4)
{
if (points->isMarker(poi))
if (points->point(poi).x() > 900000)
{
nPath = true;
continue;
/trunk/Scribus/scribus/pageitem_spiral.cpp
75,7 → 75,7
Start = PoLine.point(n);
firstp = false;
}
if (PoLine.isMarker(n))
if (PoLine.point(n).x() > 900000)
{
cli.addPoint(PoLine.point(n-2));
cli.addPoint(PoLine.point(n-2));
/trunk/Scribus/scribus/pageitem_polyline.cpp
69,7 → 69,7
Start = PoLine.point(n);
firstp = false;
}
if (PoLine.isMarker(n))
if (PoLine.point(n).x() > 900000)
{
cli.addPoint(PoLine.point(n-2));
cli.addPoint(PoLine.point(n-2));