Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 13422 → Rev 13423

/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
863,8 → 863,12
//m_Doc->Pages = &m_Doc->MasterPages;
m_Doc->setMasterPageMode(true);
}
int docGc = m_Doc->GroupCounter, pagenr = -1;
if ((!pg.attribute("OnMasterPage").isEmpty()) && (pg.tagName()=="MASTEROBJECT"))
{
m_Doc->setCurrentPage(m_Doc->MasterPages.at(m_Doc->MasterNames[pg.attribute("OnMasterPage")]));
pagenr = -2;
}
 
if (pg.tagName()=="PAGEOBJECT")
{
875,9 → 879,9
itemNext[m_Doc->Items->count()] = pg.attribute("NEXTITEM").toInt();
}
}
int docGc = m_Doc->GroupCounter;
m_Doc->GroupCounter = 0;
Neu = PasteItem(&pg, m_Doc, fileDir);
Neu = PasteItem(&pg, m_Doc, fileDir, pagenr);
Neu->setRedrawBounding();
if (pg.tagName()=="MASTEROBJECT")
Neu->OwnPage = m_Doc->OnPage(Neu);
1968,7 → 1972,7
}
}
 
PageItem* Scribus13Format::PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir)
PageItem* Scribus13Format::PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir, int pagenr)
{
struct ImageLoadRequest loadingInfo;
int z = 0;
2003,11 → 2007,15
case PageItem::ItemType1:
z = doc->itemAdd(PageItem::Polygon, PageItem::Ellipse, x, y, w, h, pw, Pcolor, Pcolor2, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
break;
//
case PageItem::ImageFrame:
z = doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, x, y, w, h, 1, doc->toolSettings.dBrushPict, CommonStrings::None, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
currItem->setImageXYScale(scx, scy);
currItem->setImageXYOffset(obj->attribute("LOCALX").toDouble(), obj->attribute("LOCALY").toDouble());
currItem->Pfile = Relative2Path(obj->attribute("PFILE"), baseDir);
2081,11 → 2089,15
case PageItem::ItemType3:
z = doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, x, y, w, h, pw, Pcolor, Pcolor2, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
break;
//
case PageItem::PathText:
z = doc->itemAdd(PageItem::PathText, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
if ((obj->attribute("ANNOTATION", "0").toInt()) && (static_cast<bool>(obj->attribute("ANICON", "0").toInt())))
{
currItem->setImageXYScale(scx, scy);
2110,6 → 2122,8
case PageItem::TextFrame:
z = doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
if ((obj->attribute("ANNOTATION", "0").toInt()) && (static_cast<bool>(obj->attribute("ANICON", "0").toInt())))
{
currItem->setImageXYScale(scx, scy);
2134,14 → 2148,20
case PageItem::Line:
z = doc->itemAdd(PageItem::Line, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor2, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
break;
case PageItem::Polygon:
z = doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, x, y, w, h, pw, Pcolor, Pcolor2, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
break;
case PageItem::PolyLine:
z = doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, w, h, pw, Pcolor, Pcolor2, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
break;
case PageItem::Multiple:
default:
/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h
51,7 → 51,7
//Scribus Doc vars, not plugin vars
void GetItemText(QDomElement *it, ScribusDoc *doc, PageItem* obj, LastStyles* last, bool impo=false, bool VorLFound=false);
void readParagraphStyle(ParagraphStyle& vg, const QDomElement& pg, ScribusDoc *doc);
PageItem* PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir);
PageItem* PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir, int pagenr = -2 /* currentPage*/);
void GetStyle(QDomElement *pg, ParagraphStyle *vg, StyleSet<ParagraphStyle> *tempParagraphStyles, ScribusDoc* doc, bool fl);
QString readSLA(const QString & fileName);
QString AskForFont(QString fStr, ScribusDoc *doc);
/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h
61,7 → 61,7
void GetItemText(QDomElement *it, ScribusDoc *doc, PageItem* obj, LastStyles* last, bool impo=false, bool VorLFound=false);
void GetCStyle(const QDomElement *it, ScribusDoc *doc, CharStyle & newStyle);
void readParagraphStyle(ParagraphStyle& vg, const QDomElement& pg, SCFonts &avail, ScribusDoc *doc);
PageItem* PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir);
PageItem* PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir, int pagenr = -2 /* currentPage*/);
void GetStyle(QDomElement *pg, ParagraphStyle *vg, StyleSet<ParagraphStyle> *docParagraphStyles, ScribusDoc* doc, bool fl);
QString readSLA(const QString & fileName);
 
/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
957,11 → 957,14
//m_Doc->Pages = &m_Doc->MasterPages;
m_Doc->setMasterPageMode(true);
}
int docGc = m_Doc->GroupCounter, pagenr = -1;
if ((!pg.attribute("OnMasterPage").isEmpty()) && (pg.tagName()=="MASTEROBJECT"))
{
m_Doc->setCurrentPage(m_Doc->MasterPages.at(m_Doc->MasterNames[pg.attribute("OnMasterPage")]));
int docGc = m_Doc->GroupCounter;
pagenr = -2;
}
m_Doc->GroupCounter = 0;
Neu = PasteItem(&pg, m_Doc, fileDir);
Neu = PasteItem(&pg, m_Doc, fileDir, pagenr);
Neu->setRedrawBounding();
if (pg.tagName()=="MASTEROBJECT")
Neu->OwnPage = m_Doc->OnPage(Neu);
1989,7 → 1992,7
fixLegacyParStyle(vg);
}
 
PageItem* Scribus134Format::PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir)
PageItem* Scribus134Format::PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir, int pagenr)
{
struct ImageLoadRequest loadingInfo;
int z = 0;
2020,6 → 2023,8
case PageItem::ItemType1:
z = doc->itemAdd(PageItem::Polygon, PageItem::Ellipse, x, y, w, h, pw, Pcolor, Pcolor2, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
break;
//
case PageItem::ImageFrame:
2026,6 → 2031,8
case PageItem::LatexFrame: /*Everything that is valid for image frames is also valid for latex frames*/
z = doc->itemAdd(pt, PageItem::Unspecified, x, y, w, h, 1, doc->toolSettings.dBrushPict, CommonStrings::None, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
currItem->setImageXYScale(scx, scy);
currItem->setImageXYOffset(obj->attribute("LOCALX").toDouble(), obj->attribute("LOCALY").toDouble());
if (currItem->asLatexFrame())
2164,11 → 2171,15
case PageItem::ItemType3:
z = doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, x, y, w, h, pw, Pcolor, Pcolor2, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
break;
//
case PageItem::PathText:
z = doc->itemAdd(PageItem::PathText, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
if ((obj->attribute("ANNOTATION", "0").toInt()) && (static_cast<bool>(obj->attribute("ANICON", "0").toInt())))
{
currItem->setImageXYScale(scx, scy);
2193,6 → 2204,8
case PageItem::TextFrame:
z = doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
if ((obj->attribute("ANNOTATION", "0").toInt()) && (static_cast<bool>(obj->attribute("ANICON", "0").toInt())))
{
currItem->setImageXYScale(scx, scy);
2217,14 → 2230,20
case PageItem::Line:
z = doc->itemAdd(PageItem::Line, PageItem::Unspecified, x, y, w, h, pw, CommonStrings::None, Pcolor2, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
break;
case PageItem::Polygon:
z = doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, x, y, w, h, pw, Pcolor, Pcolor2, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
break;
case PageItem::PolyLine:
z = doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, w, h, pw, Pcolor, Pcolor2, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
break;
case PageItem::Multiple:
Q_ASSERT(false);