Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 13423 → Rev 13422

/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
957,14 → 957,11
//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;
}
int docGc = m_Doc->GroupCounter;
m_Doc->GroupCounter = 0;
Neu = PasteItem(&pg, m_Doc, fileDir, pagenr);
Neu = PasteItem(&pg, m_Doc, fileDir);
Neu->setRedrawBounding();
if (pg.tagName()=="MASTEROBJECT")
Neu->OwnPage = m_Doc->OnPage(Neu);
1992,7 → 1989,7
fixLegacyParStyle(vg);
}
 
PageItem* Scribus134Format::PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir, int pagenr)
PageItem* Scribus134Format::PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir)
{
struct ImageLoadRequest loadingInfo;
int z = 0;
2023,8 → 2020,6
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:
2031,8 → 2026,6
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())
2171,15 → 2164,11
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);
2204,8 → 2193,6
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);
2230,20 → 2217,14
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);
/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, int pagenr = -2 /* currentPage*/);
PageItem* PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir);
void GetStyle(QDomElement *pg, ParagraphStyle *vg, StyleSet<ParagraphStyle> *docParagraphStyles, ScribusDoc* doc, bool fl);
QString readSLA(const QString & fileName);
 
/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
863,12 → 863,8
//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")
{
879,9 → 875,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, pagenr);
Neu = PasteItem(&pg, m_Doc, fileDir);
Neu->setRedrawBounding();
if (pg.tagName()=="MASTEROBJECT")
Neu->OwnPage = m_Doc->OnPage(Neu);
1972,7 → 1968,7
}
}
 
PageItem* Scribus13Format::PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir, int pagenr)
PageItem* Scribus13Format::PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir)
{
struct ImageLoadRequest loadingInfo;
int z = 0;
2007,15 → 2003,11
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);
2089,15 → 2081,11
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);
2122,8 → 2110,6
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);
2148,20 → 2134,14
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, int pagenr = -2 /* currentPage*/);
PageItem* PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir);
void GetStyle(QDomElement *pg, ParagraphStyle *vg, StyleSet<ParagraphStyle> *tempParagraphStyles, ScribusDoc* doc, bool fl);
QString readSLA(const QString & fileName);
QString AskForFont(QString fStr, ScribusDoc *doc);