Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 25197 → Rev 25198

/branches/Version15x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
632,12 → 632,12
layerToSetActive = nl->ID;
}
m_Doc->setActiveLayer(layerToSetActive);
if (!EffVal.isEmpty())
if (!pdfPresEffects.isEmpty())
{
for (int pdoE = 0; pdoE < EffVal.count(); ++pdoE)
for (int pdoE = 0; pdoE < pdfPresEffects.count(); ++pdoE)
{
if (pdoE < m_Doc->Pages->count())
m_Doc->Pages->at(pdoE)->PresentVals = EffVal[pdoE];
m_Doc->Pages->at(pdoE)->PresentVals = pdfPresEffects[pdoE];
}
}
 
1693,7 → 1693,7
ef.Dm = attrs.valueAsInt("Dm");
ef.M = attrs.valueAsInt("M");
ef.Di = attrs.valueAsInt("Di");
EffVal.append(ef);
pdfPresEffects.append(ef);
}
}
return !reader.hasError();
/branches/Version15x/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h
130,7 → 130,7
QMap<int, int> itemRemapM;
QMap<int, int> itemNextM;
QList<PageItem*> FrameItems;
QList<PDFPresentationData> EffVal;
QList<PDFPresentationData> pdfPresEffects;
 
int itemCount;
int itemCountM;
/branches/Version15x/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
725,7 → 725,7
{
QTransform ma;
ma.rotate(-gItem->rotation());
FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
FPoint n(cItem->gXpos, cItem->gYpos);
cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
cItem->setRotation(cItem->rotation() - gItem->rotation());
756,7 → 756,7
{
QTransform ma;
ma.rotate(-gItem->rotation());
FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
FPoint n(cItem->gXpos, cItem->gYpos);
cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
cItem->setRotation(cItem->rotation() - gItem->rotation());
787,7 → 787,7
{
QTransform ma;
ma.rotate(-gItem->rotation());
FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
FPoint n(cItem->gXpos, cItem->gYpos);
cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
cItem->setRotation(cItem->rotation() - gItem->rotation());
1468,7 → 1468,7
{
QTransform ma;
ma.rotate(-gItem->rotation());
FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
FPoint n(cItem->gXpos, cItem->gYpos);
cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
cItem->setRotation(cItem->rotation() - gItem->rotation());
1499,7 → 1499,7
{
QTransform ma;
ma.rotate(-gItem->rotation());
FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
FPoint n(cItem->gXpos, cItem->gYpos);
cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
cItem->setRotation(cItem->rotation() - gItem->rotation());
1530,7 → 1530,7
{
QTransform ma;
ma.rotate(-gItem->rotation());
FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
FPoint n(cItem->gXpos, cItem->gYpos);
cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
cItem->setRotation(cItem->rotation() - gItem->rotation());
2200,12 → 2200,12
 
if (m_Doc->Layers.count() == 0)
m_Doc->Layers.newLayer( QObject::tr("Background") );
if (!EffVal.isEmpty())
if (!pdfPresEffects.isEmpty())
{
for (int pdoE = 0; pdoE < EffVal.count(); ++pdoE)
for (int pdoE = 0; pdoE < pdfPresEffects.count(); ++pdoE)
{
if (pdoE < m_Doc->Pages->count())
m_Doc->Pages->at(pdoE)->PresentVals = EffVal[pdoE];
m_Doc->Pages->at(pdoE)->PresentVals = pdfPresEffects[pdoE];
}
}
 
2225,7 → 2225,7
{
QTransform ma;
ma.rotate(-gItem->rotation());
FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
FPoint n(cItem->gXpos, cItem->gYpos);
cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
cItem->setRotation(cItem->rotation() - gItem->rotation());
2256,7 → 2256,7
{
QTransform ma;
ma.rotate(-gItem->rotation());
FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
FPoint n(cItem->gXpos, cItem->gYpos);
cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
cItem->setRotation(cItem->rotation() - gItem->rotation());
2287,7 → 2287,7
{
QTransform ma;
ma.rotate(-gItem->rotation());
FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
FPoint n(cItem->gXpos, cItem->gYpos);
cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
cItem->setRotation(cItem->rotation() - gItem->rotation());
2414,7 → 2414,7
 
}// namespace
 
void Scribus150Format::readDocAttributes(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
void Scribus150Format::readDocAttributes(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const
{
m_Doc->setPageSize(attrs.valueAsString("PAGESIZE"));
m_Doc->setPageOrientation(attrs.valueAsInt("ORIENTATION", 0));
2496,7 → 2496,7
readTypographicSettings(doc, attrs);
}
 
void Scribus150Format::readCMSSettings(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
void Scribus150Format::readCMSSettings(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const
{
doc->cmsSettings().SoftProofOn = attrs.valueAsBool("DPSo", false);
doc->cmsSettings().SoftProofFullOn = attrs.valueAsBool("DPSFo", false);
2516,7 → 2516,7
doc->cmsSettings().DefaultIntentImages = (eRenderIntent) attrs.valueAsInt("DIIm", 0);
}
 
void Scribus150Format::readDocumentInfo(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
void Scribus150Format::readDocumentInfo(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const
{
DocumentInformation di;
di.setAuthor(attrs.valueAsString("AUTHOR"));
2538,7 → 2538,7
doc->setDocumentInfo(di);
}
 
void Scribus150Format::readGuideSettings(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
void Scribus150Format::readGuideSettings(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const
{
PrefsManager& prefsManager = PrefsManager::instance();
doc->guidesPrefs().minorGridSpacing = attrs.valueAsDouble("MINGRID", prefsManager.appPrefs.guidesPrefs.minorGridSpacing);
2592,7 → 2592,7
doc->guidesPrefs().grabRadius = attrs.valueAsInt("GRAB", 4);
}
 
void Scribus150Format::readToolSettings(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
void Scribus150Format::readToolSettings(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const
{
const ItemToolPrefs& defToolPrefs = PrefsManager::instance().appPrefs.itemToolPrefs;
 
2678,7 → 2678,7
doc->itemToolPrefs().imageStrokeColorShade = attrs.valueAsInt("PICTSSHADE", 100);
}
 
void Scribus150Format::readTypographicSettings(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
void Scribus150Format::readTypographicSettings(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const
{
doc->typographicPrefs().valueSuperScript = attrs.valueAsInt("VHOCH");
doc->typographicPrefs().scalingSuperScript = attrs.valueAsInt("VHOCHSC");
2695,7 → 2695,7
doc->typographicPrefs().valueStrikeThruWidth = attrs.valueAsInt("StrikeThruWidth", -1);
}
 
bool Scribus150Format::readPageSets(ScribusDoc* doc, ScXmlStreamReader& reader)
bool Scribus150Format::readPageSets(ScribusDoc* doc, ScXmlStreamReader& reader) const
{
struct PageSet pageS;
ScXmlStreamAttributes attrs;
2737,7 → 2737,7
return !reader.hasError();
}
 
bool Scribus150Format::readCheckProfile(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
bool Scribus150Format::readCheckProfile(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const
{
struct CheckerPrefs checkerSettings;
 
2769,7 → 2769,7
return true;
}
 
void Scribus150Format::readColor(ColorList& colors, ScXmlStreamAttributes& attrs)
void Scribus150Format::readColor(ColorList& colors, const ScXmlStreamAttributes& attrs) const
{
ScColor color;
if (attrs.hasAttribute("SPACE"))
2825,7 → 2825,7
colors.insert(name, color);
}
 
bool Scribus150Format::readGradient(ScribusDoc *doc, VGradient &gra, ScXmlStreamReader& reader)
bool Scribus150Format::readGradient(ScribusDoc *doc, VGradient &gra, ScXmlStreamReader& reader) const
{
gra = VGradient(VGradient::linear);
gra.clearStops();
2849,7 → 2849,7
return !reader.hasError();
}
 
void Scribus150Format::readCharacterStyleAttrs(ScribusDoc *doc, ScXmlStreamAttributes& attrs, CharStyle & newStyle)
void Scribus150Format::readCharacterStyleAttrs(ScribusDoc *doc, const ScXmlStreamAttributes& attrs, CharStyle & newStyle) const
{
static const QString CPARENT("CPARENT");
if (attrs.hasAttribute(CPARENT))
2987,7 → 2987,7
newStyle.setWordTracking(attrs.valueAsDouble(WORDTRACK));
}
 
void Scribus150Format::readNamedCharacterStyleAttrs(ScribusDoc *doc, ScXmlStreamAttributes& attrs, CharStyle & newStyle)
void Scribus150Format::readNamedCharacterStyleAttrs(ScribusDoc *doc, const ScXmlStreamAttributes& attrs, CharStyle & newStyle) const
{
static const QString CNAME("CNAME");
if (attrs.hasAttribute(CNAME))
3010,7 → 3010,7
newStyle.setParent(QString());
}
 
void Scribus150Format::readParagraphStyle(ScribusDoc *doc, ScXmlStreamReader& reader, ParagraphStyle& newStyle)
void Scribus150Format::readParagraphStyle(ScribusDoc *doc, ScXmlStreamReader& reader, ParagraphStyle& newStyle) const
{
ScXmlStreamAttributes attrs = reader.scAttributes();
 
3229,7 → 3229,7
fixLegacyParStyle(newStyle);
}
 
void Scribus150Format::readTableStyle(ScribusDoc *doc, ScXmlStreamReader& reader, TableStyle& newStyle)
void Scribus150Format::readTableStyle(ScribusDoc *doc, ScXmlStreamReader& reader, TableStyle& newStyle) const
{
ScXmlStreamAttributes attrs = reader.scAttributes();
newStyle.erase();
3289,7 → 3289,7
}
}
 
void Scribus150Format::readTableBorderLines(ScribusDoc* /*doc*/, ScXmlStreamReader& reader, TableBorder& border)
void Scribus150Format::readTableBorderLines(ScribusDoc* /*doc*/, ScXmlStreamReader& reader, TableBorder& border) const
{
QStringView tagName = reader.name();
while (!reader.atEnd() && !reader.hasError())
3315,7 → 3315,7
}
}
 
void Scribus150Format::readCellStyle(ScribusDoc *doc, ScXmlStreamReader& reader, CellStyle& newStyle)
void Scribus150Format::readCellStyle(ScribusDoc *doc, ScXmlStreamReader& reader, CellStyle& newStyle) const
{
ScXmlStreamAttributes attrs = reader.scAttributes();
newStyle.erase();
3384,7 → 3384,7
}
}
 
void Scribus150Format::readLayers(ScLayer& layer, ScXmlStreamAttributes& attrs)
void Scribus150Format::readLayers(ScLayer& layer, const ScXmlStreamAttributes& attrs) const
{
int lId = attrs.valueAsInt("NUMMER");
int level = attrs.valueAsInt("LEVEL");
3401,9 → 3401,10
layer.markerColor = QColor(attrs.valueAsString("LAYERC","#000000"));
}
 
bool Scribus150Format::readArrows(ScribusDoc* doc, ScXmlStreamAttributes& attrs)
bool Scribus150Format::readArrows(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const
{
double xa, ya;
double xa;
double ya;
struct ArrowDesc arrow;
arrow.name = attrs.valueAsString("Name");
arrow.userArrow = true;
3421,7 → 3422,7
return true;
}
 
bool Scribus150Format::readMultiline(multiLine& ml, ScXmlStreamReader& reader)
bool Scribus150Format::readMultiline(multiLine& ml, ScXmlStreamReader& reader) const
{
ml = multiLine();
ScXmlStreamAttributes rattrs = reader.scAttributes();
3448,7 → 3449,7
return !reader.hasError();
}
 
bool Scribus150Format::readBookMark(ScribusDoc::BookMa& bookmark, int& elem, ScXmlStreamAttributes& attrs)
bool Scribus150Format::readBookMark(ScribusDoc::BookMa& bookmark, int& elem, const ScXmlStreamAttributes& attrs) const
{
elem = attrs.valueAsInt("Element");
bookmark.PageObject = nullptr;
3573,13 → 3574,13
ef.Dm = attrs.valueAsInt("Dm");
ef.M = attrs.valueAsInt("M");
ef.Di = attrs.valueAsInt("Di");
EffVal.append(ef);
pdfPresEffects.append(ef);
}
}
return !reader.hasError();
}
 
bool Scribus150Format::readPrinterOptions(ScribusDoc* doc, ScXmlStreamReader& reader)
bool Scribus150Format::readPrinterOptions(ScribusDoc* doc, ScXmlStreamReader& reader) const
{
ScXmlStreamAttributes attrs = reader.scAttributes();
doc->Print_Options.firstUse = attrs.valueAsBool("firstUse");
3637,7 → 3638,7
return !reader.hasError();
}
 
bool Scribus150Format::readDocItemAttributes(ScribusDoc *doc, ScXmlStreamReader& reader)
bool Scribus150Format::readDocItemAttributes(ScribusDoc *doc, ScXmlStreamReader& reader) const
{
QStringRef tagName = reader.name();
doc->clearItemAttributes();
3663,7 → 3664,7
return !reader.hasError();
}
 
bool Scribus150Format::readTableOfContents(ScribusDoc* doc, ScXmlStreamReader& reader)
bool Scribus150Format::readTableOfContents(ScribusDoc* doc, ScXmlStreamReader& reader) const
{
QStringRef tagName = reader.name();
m_Doc->clearTocSetups();
3694,7 → 3695,7
return !reader.hasError();
}
 
bool Scribus150Format::readNotesStyles(ScribusDoc* doc, ScXmlStreamReader& reader)
bool Scribus150Format::readNotesStyles(ScribusDoc* /*doc*/, ScXmlStreamReader& reader) const
{
QStringRef tagName = reader.name();
while (!reader.atEnd() && !reader.hasError())
3796,7 → 3797,7
return !reader.hasError();
}
 
bool Scribus150Format::readNotes(ScribusDoc* doc, ScXmlStreamReader& reader)
bool Scribus150Format::readNotes(ScribusDoc* /*doc*/, ScXmlStreamReader& reader)
{
//read notes
QStringRef tagName = reader.name();
3871,7 → 3872,7
return !reader.hasError();
}
 
bool Scribus150Format::readSections(ScribusDoc* doc, ScXmlStreamReader& reader)
bool Scribus150Format::readSections(ScribusDoc* doc, ScXmlStreamReader& reader) const
{
QStringRef tagName = reader.name();
while (!reader.atEnd() && !reader.hasError())
3927,7 → 3928,7
return !reader.hasError();
}
 
bool Scribus150Format::readHyphen(ScribusDoc *doc, ScXmlStreamReader& reader)
bool Scribus150Format::readHyphen(ScribusDoc *doc, ScXmlStreamReader& reader) const
{
if (!doc->docHyphenator)
doc->createHyphenator();
4327,8 → 4328,7
if (tName == "OSGViews")
{
currentView.angleFOV = tAtt.valueAsDouble("angleFOV");
QString tmp = "";
tmp = tAtt.valueAsString("trackM");
QString tmp = tAtt.valueAsString("trackM");
ScTextStream fp(&tmp, QIODevice::ReadOnly);
double m1, m2, m3, m4;
double m5, m6, m7, m8;
4339,18 → 4339,16
fp >> m9 >> m10 >> m11 >> m12;
fp >> m13 >> m14 >> m15 >> m16;
currentView.trackerMatrix.set(m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15, m16);
tmp = "";
tmp.clear();
tmp = tAtt.valueAsString("trackC");
ScTextStream fp2(&tmp, QIODevice::ReadOnly);
double v1, v2, v3;
fp2 >> v1 >> v2 >> v3;
currentView.trackerCenter.set(v1, v2, v3);
tmp = "";
tmp = tAtt.valueAsString("cameraP");
ScTextStream fp3(&tmp, QIODevice::ReadOnly);
fp3 >> v1 >> v2 >> v3;
currentView.cameraPosition.set(v1, v2, v3);
tmp = "";
tmp = tAtt.valueAsString("cameraU");
ScTextStream fp4(&tmp, QIODevice::ReadOnly);
fp4 >> v1 >> v2 >> v3;
4781,7 → 4779,7
{
QTransform ma;
ma.rotate(-gItem->rotation());
FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
FPoint n(cItem->gXpos, cItem->gYpos);
cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
cItem->setRotation(cItem->rotation() - gItem->rotation());
4799,7 → 4797,8
int itemCount2 = m_Doc->Items->count();
if (itemCount2 > itemCount1)
{
PageItem* currItem = doc->Items->at(itemCount1), *newItem;
PageItem* currItem = doc->Items->at(itemCount1);
PageItem* newItem;
double minx = std::numeric_limits<double>::max();
double miny = std::numeric_limits<double>::max();
double maxx = -std::numeric_limits<double>::max();
4835,7 → 4834,7
return success;
}
 
bool Scribus150Format::readStoryText(ScribusDoc *doc, ScXmlStreamReader& reader, StoryText& story, PageItem* item)
bool Scribus150Format::readStoryText(ScribusDoc *doc, ScXmlStreamReader& reader, StoryText& story, PageItem* item) const
{
QStringRef tagName = reader.name();
ScXmlStreamAttributes attrs = reader.scAttributes();
5000,7 → 4999,7
return !reader.hasError();
}
 
bool Scribus150Format::readItemText(StoryText& story, ScXmlStreamAttributes& attrs, LastStyles* last)
bool Scribus150Format::readItemText(StoryText& story, const ScXmlStreamAttributes& attrs, LastStyles* last) const
{
QString tmp2;
CharStyle newStyle;
5118,7 → 5117,7
return true;
}
 
bool Scribus150Format::readPageItemAttributes(PageItem* item, ScXmlStreamReader& reader)
bool Scribus150Format::readPageItemAttributes(PageItem* item, ScXmlStreamReader& reader) const
{
QStringRef tagName = reader.name();
ObjAttrVector pageItemAttributes;
5145,7 → 5144,7
return !reader.hasError();
}
 
PageItem* Scribus150Format::pasteItem(ScribusDoc *doc, ScXmlStreamAttributes& attrs, const QString& baseDir, PageItem::ItemKind itemKind, int pageNr)
PageItem* Scribus150Format::pasteItem(ScribusDoc *doc, const ScXmlStreamAttributes& attrs, const QString& baseDir, PageItem::ItemKind itemKind, int pageNr)
{
int z = 0;
struct ImageLoadRequest loadingInfo;
5156,7 → 5155,8
bool isNoteFrameFlag = attrs.valueAsBool("isNoteFrame", false);
if (isNoteFrameFlag && (pt == PageItem::TextFrame))
pt = PageItem::NoteFrame;
double xf, yf;
double xf;
double yf;
double x = attrs.valueAsDouble("XPOS");
double y = attrs.valueAsDouble("YPOS");
x = Xp + x - GrX;
5175,8 → 5175,9
if (Pcolor2.isEmpty())
Pcolor2 = CommonStrings::None;
QColor tmpc;
PageItem *currItem=nullptr;
QString tmp, clPath;
PageItem *currItem = nullptr;
QString tmp;
QString clPath;
switch (pt)
{
// OBSOLETE CR 2005-02-06
5614,9 → 5615,6
tableitem->insertRows(1, rows - 1);
tableitem->insertColumns(1, cols - 1);
tableitem->setStyle(attrs.valueAsString("TableStyle"));
// QString rowPositions(attrs.valueAsString("RowPositions"));
// QStringList slRowPositions=rowPositions.split(" ");
// qDebug()<<"RowCount"<<rows<<"row positions"<<slRowPositions.count();
doc->dontResize = true;
 
QString rowHeights(attrs.valueAsString("RowHeights",""));
5623,12 → 5621,14
if (!rowHeights.isEmpty())
{
QStringList slRowHeights = rowHeights.split(" ");
int i=0;
int i = 0;
foreach(const QString& pos, slRowHeights)
tableitem->resizeRow(i++, pos.toDouble());
{
tableitem->resizeRow(i, pos.toDouble());
++i;
}
}
// QString colPositions(attrs.valueAsString("ColumnPositions"));
// QStringList slColPositions=colPositions.split(" ");
 
QString colWidths(attrs.valueAsString("ColumnWidths",""));
if (!colWidths.isEmpty())
{
5635,8 → 5635,12
QStringList slColWidths = colWidths.split(" ");
int i = 0;
foreach(const QString& pos, slColWidths)
tableitem->resizeColumn(i++, pos.toDouble());
{
tableitem->resizeColumn(i, pos.toDouble());
++i;
}
}
 
QString cellAreas(attrs.valueAsString("CellAreas"));
if (!cellAreas.isEmpty())
{
5709,7 → 5713,7
if (!found)
currItem->setLayer(doc->firstLayerID());
}
tmp = "";
tmp.clear();
if ((attrs.hasAttribute("NUMDASH")) && (attrs.valueAsInt("NUMDASH", 0) != 0))
{
tmp = attrs.valueAsString("DASHS");
5721,7 → 5725,7
dgv >> xf;
currItem->DashValues.append(xf);
}
tmp = "";
tmp.clear();
}
else
currItem->DashValues.clear();
5759,12 → 5763,12
}
else
{
tmp = "";
tmp.clear();
if (attrs.hasAttribute("NUMPO"))
{
currItem->PoLine.resize(attrs.valueAsUInt("NUMPO"));
tmp = attrs.valueAsString("POCOOR");
double maxVal = std::numeric_limits<double>::max() / 2.0;
constexpr double maxVal = std::numeric_limits<double>::max() / 2.0;
ScTextStream fp(&tmp, QIODevice::ReadOnly);
uint numPo = attrs.valueAsUInt("NUMPO");
for (uint cx=0; cx < numPo; ++cx)
5784,15 → 5788,15
currItem->PoLine.parseSVG(attrs.valueAsString("path"));
}
}
tmp = "";
tmp.clear();
if (attrs.hasAttribute("NUMCO"))
{
currItem->ContourLine.resize(attrs.valueAsUInt("NUMCO"));
tmp = attrs.valueAsString("COCOOR");
double maxVal = std::numeric_limits<double>::max() / 2.0;
constexpr double maxVal = std::numeric_limits<double>::max() / 2.0;
ScTextStream fp(&tmp, QIODevice::ReadOnly);
uint numCo = attrs.valueAsUInt("NUMCO");
for (uint cx=0; cx < numCo; ++cx)
for (uint cx = 0; cx < numCo; ++cx)
{
fp >> xf;
fp >> yf;
6053,7 → 6057,7
return currItem;
}
 
bool Scribus150Format::readItemTableData(PageItem_Table* item, ScXmlStreamReader& reader, ScribusDoc* doc)
bool Scribus150Format::readItemTableData(PageItem_Table* item, ScXmlStreamReader& reader, ScribusDoc* doc) const
{
ScXmlStreamAttributes attrs = reader.scAttributes();
QString fColor = attrs.valueAsString("FillColor");
6170,7 → 6174,7
return !reader.hasError();
}
 
bool Scribus150Format::readItemTableCell(PageItem_Table* item, ScXmlStreamReader& reader, ScribusDoc *doc)
bool Scribus150Format::readItemTableCell(PageItem_Table* item, ScXmlStreamReader& reader, ScribusDoc *doc) const
{
QStringRef tagName = reader.name();
ScXmlStreamAttributes tAtt = reader.scAttributes();
6318,7 → 6322,7
return !reader.hasError();
}
 
bool Scribus150Format::readLatexInfo(PageItem_LatexFrame* latexitem, ScXmlStreamReader& reader)
bool Scribus150Format::readLatexInfo(PageItem_LatexFrame* latexitem, ScXmlStreamReader& reader) const
{
ScXmlStreamAttributes attrs = reader.scAttributes();
QStringRef tagName = reader.name();
6353,9 → 6357,9
bool Scribus150Format::loadPage(const QString & fileName, int pageNumber, bool Mpage, const QString& renamedPageName)
{
// qDebug() << QString("loading page %2 from file '%1' from 1.3.x plugin").arg(fileName).arg(pageNumber);
if (m_Doc==nullptr || m_AvailableFonts==nullptr)
if (m_Doc == nullptr || m_AvailableFonts == nullptr)
{
Q_ASSERT(m_Doc==nullptr || m_AvailableFonts==nullptr);
Q_ASSERT(m_Doc == nullptr || m_AvailableFonts == nullptr);
return false;
}
 
6381,12 → 6385,14
QStack<int> groupStackFI2;
QStack<int> groupStackMI2;
QStack<int> groupStackPI2;
double pageX = 0, pageY = 0;
double pageX = 0;
double pageY = 0;
QMap<int,int> layerTrans;
int maxLayer = 0, maxLevel = 0, a = 0;
int maxLayer = 0;
int maxLevel = 0;
 
layerTrans.clear();
uint layerCount=m_Doc->layerCount();
uint layerCount = m_Doc->layerCount();
for (uint la2 = 0; la2 < layerCount; ++la2)
{
maxLayer = qMax(m_Doc->Layers[la2].ID, maxLayer);
6563,8 → 6569,8
{
if (Mpage && (tagName != "MASTERPAGE"))
continue;
a = m_Doc->currentPage()->pageNr();
newPage = m_Doc->Pages->at(a);
int pageNr = m_Doc->currentPage()->pageNr();
newPage = m_Doc->Pages->at(pageNr);
SimpleState *ss = nullptr;
if (UndoManager::undoEnabled())
{
6967,7 → 6973,7
{
QTransform ma;
ma.rotate(-gItem->rotation());
FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
FPoint n(cItem->gXpos, cItem->gYpos);
cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
cItem->setRotation(cItem->rotation() - gItem->rotation());
6998,7 → 7004,7
{
QTransform ma;
ma.rotate(-gItem->rotation());
FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
FPoint n(cItem->gXpos, cItem->gYpos);
cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
cItem->setRotation(cItem->rotation() - gItem->rotation());
7029,7 → 7035,7
{
QTransform ma;
ma.rotate(-gItem->rotation());
FPoint n = FPoint(cItem->gXpos, cItem->gYpos);
FPoint n(cItem->gXpos, cItem->gYpos);
cItem->gXpos = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
cItem->gYpos = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
cItem->setRotation(cItem->rotation() - gItem->rotation());
/branches/Version15x/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
121,44 → 121,44
void getStyle(ParagraphStyle& style, ScXmlStreamReader& reader, StyleSet<ParagraphStyle> *docParagraphStyles, ScribusDoc* doc, bool equiv);
void getStyle(CharStyle& style, ScXmlStreamReader& reader, StyleSet<CharStyle> *docCharStyles, ScribusDoc* doc, bool equiv);
 
void readDocAttributes(ScribusDoc* doc, ScXmlStreamAttributes& attrs);
void readCMSSettings(ScribusDoc* doc, ScXmlStreamAttributes& attrs);
void readDocumentInfo(ScribusDoc* doc, ScXmlStreamAttributes& attrs);
void readGuideSettings(ScribusDoc* doc, ScXmlStreamAttributes& attrs);
void readToolSettings(ScribusDoc* doc, ScXmlStreamAttributes& attrs);
void readTypographicSettings(ScribusDoc* doc, ScXmlStreamAttributes& attrs);
void readDocAttributes(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const;
void readCMSSettings(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const;
void readDocumentInfo(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const;
void readGuideSettings(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const;
void readToolSettings(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const;
void readTypographicSettings(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const;
 
bool readArrows(ScribusDoc* doc, ScXmlStreamAttributes& attrs);
bool readBookMark(ScribusDoc::BookMa& bookmark, int& elem, ScXmlStreamAttributes& attrs);
bool readCheckProfile(ScribusDoc* doc, ScXmlStreamAttributes& attrs);
void readColor(ColorList& colors, ScXmlStreamAttributes& attrs);
bool readGradient(ScribusDoc *doc, VGradient &gra, ScXmlStreamReader& reader);
void readCharacterStyleAttrs(ScribusDoc *doc, ScXmlStreamAttributes& attrs, CharStyle & newStyle);
void readNamedCharacterStyleAttrs(ScribusDoc *doc, ScXmlStreamAttributes& attrs, CharStyle & newStyle);
bool readDocItemAttributes(ScribusDoc *doc, ScXmlStreamReader& reader);
bool readHyphen(ScribusDoc *doc, ScXmlStreamReader& reader);
bool readStoryText(ScribusDoc *doc, ScXmlStreamReader& reader, StoryText& story, PageItem* item);
bool readItemText(StoryText& story, ScXmlStreamAttributes& attrs, LastStyles* last);
bool readItemTableData(PageItem_Table* item, ScXmlStreamReader& reader, ScribusDoc *doc);
bool readItemTableCell(PageItem_Table* item, ScXmlStreamReader& reader, ScribusDoc *doc);
bool readLatexInfo(PageItem_LatexFrame* item, ScXmlStreamReader& reader);
void readLayers(ScLayer& layer, ScXmlStreamAttributes& attrs);
bool readMultiline(multiLine& ml, ScXmlStreamReader& reader);
bool readArrows(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const;
bool readBookMark(ScribusDoc::BookMa& bookmark, int& elem, const ScXmlStreamAttributes& attrs) const;
bool readCheckProfile(ScribusDoc* doc, const ScXmlStreamAttributes& attrs) const;
void readColor(ColorList& colors, const ScXmlStreamAttributes& attrs) const;
bool readGradient(ScribusDoc *doc, VGradient &gra, ScXmlStreamReader& reader) const;
void readCharacterStyleAttrs(ScribusDoc *doc, const ScXmlStreamAttributes& attrs, CharStyle & newStyle) const;
void readNamedCharacterStyleAttrs(ScribusDoc *doc, const ScXmlStreamAttributes& attrs, CharStyle & newStyle) const;
bool readDocItemAttributes(ScribusDoc *doc, ScXmlStreamReader& reader) const;
bool readHyphen(ScribusDoc *doc, ScXmlStreamReader& reader) const;
bool readStoryText(ScribusDoc *doc, ScXmlStreamReader& reader, StoryText& story, PageItem* item) const;
bool readItemText(StoryText& story, const ScXmlStreamAttributes& attrs, LastStyles* last) const;
bool readItemTableData(PageItem_Table* item, ScXmlStreamReader& reader, ScribusDoc *doc) const;
bool readItemTableCell(PageItem_Table* item, ScXmlStreamReader& reader, ScribusDoc *doc) const;
bool readLatexInfo(PageItem_LatexFrame* item, ScXmlStreamReader& reader) const;
void readLayers(ScLayer& layer, const ScXmlStreamAttributes& attrs) const;
bool readMultiline(multiLine& ml, ScXmlStreamReader& reader) const;
bool readObject(ScribusDoc* doc, ScXmlStreamReader& reader, const ReadObjectParams& loadParams, ItemInfo& info);
bool readPage(ScribusDoc* doc, ScXmlStreamReader& reader);
bool readPageItemAttributes(PageItem* item, ScXmlStreamReader& reader);
bool readPageSets(ScribusDoc* doc, ScXmlStreamReader& reader);
void readParagraphStyle(ScribusDoc *doc, ScXmlStreamReader& reader, ParagraphStyle& newStyle);
void readTableStyle(ScribusDoc *doc, ScXmlStreamReader& reader, TableStyle& newStyle);
void readTableBorderLines(ScribusDoc* doc, ScXmlStreamReader& reader, TableBorder& border);
void readCellStyle(ScribusDoc *doc, ScXmlStreamReader& reader, CellStyle& newStyle);
bool readPageItemAttributes(PageItem* item, ScXmlStreamReader& reader) const;
bool readPageSets(ScribusDoc* doc, ScXmlStreamReader& reader) const;
void readParagraphStyle(ScribusDoc *doc, ScXmlStreamReader& reader, ParagraphStyle& newStyle) const;
void readTableStyle(ScribusDoc *doc, ScXmlStreamReader& reader, TableStyle& newStyle) const;
void readTableBorderLines(ScribusDoc* doc, ScXmlStreamReader& reader, TableBorder& border) const;
void readCellStyle(ScribusDoc *doc, ScXmlStreamReader& reader, CellStyle& newStyle) const;
bool readPattern(ScribusDoc* doc, ScXmlStreamReader& reader, const QString& baseDir);
bool readPDFOptions(ScribusDoc* doc, ScXmlStreamReader& reader);
bool readPrinterOptions(ScribusDoc* doc, ScXmlStreamReader& reader);
bool readSections(ScribusDoc* doc, ScXmlStreamReader& reader);
bool readTableOfContents(ScribusDoc* doc, ScXmlStreamReader& reader);
bool readPrinterOptions(ScribusDoc* doc, ScXmlStreamReader& reader) const;
bool readSections(ScribusDoc* doc, ScXmlStreamReader& reader) const;
bool readTableOfContents(ScribusDoc* doc, ScXmlStreamReader& reader) const;
bool readNotes(ScribusDoc* doc, ScXmlStreamReader& reader);
bool readNotesStyles(ScribusDoc* doc, ScXmlStreamReader& reader);
bool readNotesStyles(ScribusDoc* doc, ScXmlStreamReader& reader) const;
bool readNotesFrames(ScXmlStreamReader &reader);
bool readMarks(ScribusDoc* doc, ScXmlStreamReader& reader);
 
168,7 → 168,8
QMap<QString, int> nsetRangeItemNamesMap;
QMap<QString, TextNote*> notesMasterMarks;
QMap<TextNote*, QString> notesNSets;
struct NoteFrameData {
struct NoteFrameData
{
QString NSname;
int myID;
int itemID;
176,11 → 177,11
NumerationRange NSrange;
};
QList<NoteFrameData> notesFramesData;
QList<PDFPresentationData> EffVal;
QList<PDFPresentationData> pdfPresEffects;
void updateNames2Ptr(); //after document load items pointers should be updated in markeredItemList
 
PageItem* pasteItem(ScribusDoc *doc, ScXmlStreamAttributes& attrs, const QString& baseDir, PageItem::ItemKind itemKind, int pageNr = -2 /* currentPage*/);
PageItem* pasteItem(ScribusDoc *doc, const ScXmlStreamAttributes& attrs, const QString& baseDir, PageItem::ItemKind itemKind, int pageNr = -2 /* currentPage*/);
 
void writeCheckerProfiles(ScXmlStreamWriter& docu);
void writeLineStyles(ScXmlStreamWriter& docu);