Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 16051 → Rev 16052

/trunk/Scribus/scribus/pdflib_core.cpp
1016,7 → 1016,7
{
StdFonts.insert("/Helvetica", "");
} */
QStringList patterns = doc.getUsedPatterns();
QStringList patterns = doc.getPatternDependencyList(doc.getUsedPatterns());
for (int c = 0; c < patterns.count(); ++c)
{
ScPattern pa = doc.docPatterns[patterns[c]];
/trunk/Scribus/scribus/scribusdoc.cpp
2835,12 → 2835,24
results.append(FrameItems.at(c)->patternMask());
}
}
for (int c = 0; c < results.count(); ++c)
for (QMap<QString, ScPattern>::Iterator it = docPatterns.begin(); it != docPatterns.end(); ++it)
{
QStringList pats = getUsedPatternsHelper(results[c], results);
if (!pats.isEmpty())
results += pats;
for (int c = 0; c < it.value().items.count(); ++c)
{
if ((it.value().items.at(c)->GrType == 8) || (it.value().items.at(c)->itemType() == PageItem::Symbol))
{
const QString& patName = it.value().items.at(c)->pattern();
if (!patName.isEmpty() && !results.contains(patName))
results.append(patName);
}
const QString& pat2 = it.value().items.at(c)->strokePattern();
if (!pat2.isEmpty() && !results.contains(pat2))
results.append(pat2);
const QString& pat3 = it.value().items.at(c)->patternMask();
if (!pat3.isEmpty() && !results.contains(pat3))
results.append(pat3);
}
}
return results;
}
 
2867,14 → 2879,21
if (!pat3.isEmpty() && !results.contains(pat3))
results.append(currItem->patternMask());
}
QStringList results2 = results;
for (int c = 0; c < results.count(); ++c)
{
QStringList pats = getUsedPatternsHelper(results[c], results);
QStringList pats = getUsedPatternsHelper(results[c], results2);
if (!pats.isEmpty())
results += pats;
{
for (int cc = 0; cc < pats.count(); cc++)
{
if (!results2.contains(pats[cc]))
results2.append(pats[cc]);
}
return results;
}
}
return results2;
}
else
return QStringList();
}
2881,6 → 2900,8
 
QStringList ScribusDoc::getUsedPatternsHelper(QString pattern, QStringList &results)
{
if (!docPatterns.contains(pattern))
return QStringList();
ScPattern *pat = &docPatterns[pattern];
QStringList pats;
pats.clear();
2901,15 → 2922,58
}
if (!pats.isEmpty())
{
results = pats;
results += pats;
for (int c = 0; c < pats.count(); ++c)
{
getUsedPatternsHelper(pats[c], results);
QStringList pp = getUsedPatternsHelper(pats[c], results);
if (!pp.isEmpty())
{
for (int cc = 0; cc < pp.count(); cc++)
{
if (!results.contains(pp[cc]))
results.append(pp[cc]);
}
}
}
}
return results;
}
 
QStringList ScribusDoc::getPatternDependencyList(QStringList used)
{
QStringList results;
QStringList pp;
QStringList pats = used;
QStack<QStringList> patternStack;
patternStack.push(pats);
while (!pats.isEmpty())
{
for (int c = 0; c < pats.count(); ++c)
{
pp = getUsedPatternsHelper(pats[c], results);
if (!pp.isEmpty())
results += pp;
}
pats = results;
results.clear();
if (!pats.isEmpty())
patternStack.push(pats);
}
results.clear();
while (patternStack.count() != 0)
{
pp = patternStack.pop();
for (int c = 0; c < pp.count(); c++)
{
if (!results.contains(pp[c]))
results.append(pp[c]);
}
if (patternStack.count() == 0)
break;
}
return results;
}
 
QStringList ScribusDoc::getUsedSymbols()
{
QStringList results;
2945,12 → 3009,19
results.append(FrameItems.at(c)->strokePattern());
}
}
for (int c = 0; c < results.count(); ++c)
for (QMap<QString, ScPattern>::Iterator it = docPatterns.begin(); it != docPatterns.end(); ++it)
{
QStringList pats = getUsedSymbolsHelper(results[c], results);
if (!pats.isEmpty())
results += pats;
for (int c = 0; c < it.value().items.count(); ++c)
{
if ((!results.contains(it.value().items.at(c)->pattern())) && (it.value().items.at(c)->itemType() == PageItem::Symbol) && (!it.value().items.at(c)->pattern().isEmpty()))
results.append(it.value().items.at(c)->pattern());
if ((!it.value().items.at(c)->strokePattern().isEmpty()) && (it.value().items.at(c)->patternStrokePath))
{
if (!results.contains(it.value().items.at(c)->strokePattern()))
results.append(it.value().items.at(c)->strokePattern());
}
}
}
return results;
}
 
5503,6 → 5574,16
docPatterns[currentEditedSymbol].pattern = currItem->DrawObj_toImage();
docPatterns[currentEditedSymbol].width = currItem->gWidth;
docPatterns[currentEditedSymbol].height = currItem->gHeight;
if (m_ScMW->patternsDependingOnThis.count() > 1)
{
for (int a = 1; a < m_ScMW->patternsDependingOnThis.count(); a++)
{
Items = &docPatterns[m_ScMW->patternsDependingOnThis[a]].items;
renumberItemsInListOrder();
currItem = Items->at(0);
docPatterns[m_ScMW->patternsDependingOnThis[a]].pattern = currItem->DrawObj_toImage();
}
}
if (masterPageMode())
{
Pages = &MasterPages;
/trunk/Scribus/scribus/scribusXml.cpp
2450,7 → 2450,7
}
}
}
QStringList patterns = doc->getUsedPatternsSelection(selection);
QStringList patterns = doc->getPatternDependencyList(doc->getUsedPatternsSelection(selection));
for (int c = 0; c < patterns.count(); ++c)
{
ScPattern& pa = doc->docPatterns[patterns[c]];
/trunk/Scribus/scribus/scribusdoc.h
622,6 → 622,7
QStringList getUsedPatterns();
QStringList getUsedPatternsSelection(Selection* customSelection);
QStringList getUsedPatternsHelper(QString pattern, QStringList &results);
QStringList getPatternDependencyList(QStringList used);
/*!
* @brief Builds a QStringList of the symbols used within the document
*/
/trunk/Scribus/scribus/scribusview.cpp
2903,10 → 2903,12
 
void ScribusView::hideSymbolPage()
{
updatesOn(false);
Deselect(true);
if (Doc->symbolEditMode())
this->requestMode(modeNormal);
Doc->setSymbolEditMode(false);
updatesOn(true);
Doc->setCurrentPage(Doc->Pages->at(0));
pageSelector->setEnabled(true);
resizeContents(qRound((Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()) * m_canvas->scale()), qRound((Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()) * m_canvas->scale()));
/trunk/Scribus/scribus/scribus.cpp
8567,7 → 8567,7
scrActions["toolsPDFAnnot3D"]->setEnabled(false);
#endif
pagePalette->enablePalette(false);
QStringList patterns2Del;
patternsDependingOnThis.clear();
QStringList mainPatterns = doc->docPatterns.keys();
for (int a = 0; a < mainPatterns.count(); a++)
{
8576,13 → 8576,13
QStringList subPatterns;
subPatterns = doc->getUsedPatternsHelper(mainPatterns[a], subPatterns);
if (subPatterns.contains(temp))
patterns2Del.append(mainPatterns[a]);
patternsDependingOnThis.prepend(mainPatterns[a]);
}
}
patterns2Del.append(temp);
symbolPalette->editingStart(patterns2Del);
propertiesPalette->Cpal->hideEditedPatterns(patterns2Del);
propertiesPalette->Tpal->hideEditedPatterns(patterns2Del);
patternsDependingOnThis.prepend(temp);
symbolPalette->editingStart(patternsDependingOnThis);
propertiesPalette->Cpal->hideEditedPatterns(patternsDependingOnThis);
propertiesPalette->Tpal->hideEditedPatterns(patternsDependingOnThis);
updateActiveWindowCaption( tr("Editing Symbol: %1").arg(temp));
}
}
8589,7 → 8589,6
 
void ScribusMainWindow::editSymbolEnd()
{
view->setScale(storedViewScale);
view->hideSymbolPage();
slotSelect();
scrActions["editMasterPages"]->setEnabled(true);
8629,6 → 8628,7
#endif
pagePalette->enablePalette(true);
pagePalette->rebuildMasters();
view->setScale(storedViewScale);
doc->setCurrentPage(doc->DocPages.at(storedPageNum));
view->setContentsPos(static_cast<int>(storedViewXCoor * storedViewScale), static_cast<int>(storedViewYCoor * storedViewScale));
view->DrawNew();
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
913,12 → 913,12
 
void Scribus150Format::writePatterns(ScXmlStreamWriter & docu, const QString& baseDir)
{
QMap<QString, ScPattern>::Iterator itPat;
for (itPat = m_Doc->docPatterns.begin(); itPat != m_Doc->docPatterns.end(); ++itPat)
QStringList patterns = m_Doc->getPatternDependencyList(m_Doc->docPatterns.keys());
for (int a = 0; a < patterns.count(); a++)
{
docu.writeStartElement("Pattern");
docu.writeAttribute("Name",itPat.key());
ScPattern pa = itPat.value();
docu.writeAttribute("Name", patterns[a]);
ScPattern pa = m_Doc->docPatterns[patterns[a]];
docu.writeAttribute("width", pa.width);
docu.writeAttribute("height", pa.height);
docu.writeAttribute("scaleX", pa.scaleX);
/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
1945,7 → 1945,7
 
void SVGExPlug::writeBasePatterns()
{
QStringList patterns = m_Doc->getUsedPatterns();
QStringList patterns = m_Doc->getPatternDependencyList(m_Doc->getUsedPatterns());
for (int c = 0; c < patterns.count(); ++c)
{
QStack<PageItem*> groupStack;
/trunk/Scribus/scribus/scribus.h
252,6 → 252,7
ScMWMenuManager* scrMenuMgr;
ActionManager* actionManager;
QStringList RecentDocs;
QStringList patternsDependingOnThis;
 
public slots:
void languageChange();
/trunk/Scribus/scribus/pslib.cpp
463,7 → 463,7
PutStream(GrayCalc);
Optimization optim = optimization;
optimization = OptimizeSize;
QStringList patterns = m_Doc->getUsedPatterns();
QStringList patterns = m_Doc->getPatternDependencyList(m_Doc->getUsedPatterns());
for (int c = 0; c < patterns.count(); ++c)
{
ScPattern pa = m_Doc->docPatterns[patterns[c]];