21,7 → 21,6 |
#include <qfile.h> |
#include <qtextstream.h> |
extern void Level2Layer(ScribusDoc *doc, struct Layer *ll, int Level); |
extern QString Path2Relative(QString Path); |
|
QString Name() |
{ |
69,12 → 68,9 |
elem.setAttribute("width", plug->doc->PageB); |
elem.setAttribute("height", plug->doc->PageH); |
Page *Seite; |
Seite = plug->doc->ActPage; |
GradCount = 0; |
ClipCount = 0; |
Seite = plug->view->MasterPages.at(plug->view->MasterNames[plug->doc->ActPage->MPageNam]); |
ProcessPage(plug, Seite, &docu, &elem); |
Seite = plug->doc->ActPage; |
ProcessPage(plug, Seite, &docu, &elem); |
QFile f(fName); |
if(!f.open(IO_WriteOnly)) |
return; |
88,7 → 84,7 |
|
void SVGExPlug::ProcessPage(ScribusApp *plug, Page *Seite, QDomDocument *docu, QDomElement *elem) |
{ |
QString tmp, trans, fill, stroke, strokeW, strokeLC, strokeLJ, strokeDA, gradi, Clipi; |
QString tmp, trans, fill, stroke, strokeW, strokeLC, strokeLJ, strokeDA, gradi; |
uint d; |
struct Pti *hl; |
int Lnr = 0; |
99,7 → 95,6 |
QDomText tp1; |
PageItem *Item; |
gradi = "Grad"; |
Clipi = "Clip"; |
for (uint la = 0; la < plug->doc->Layers.count(); la++) |
{ |
Level2Layer(plug->doc, &ll, Lnr); |
121,7 → 116,6 |
else |
grad = docu->createElement("linearGradient"); |
grad.setAttribute("id", gradi+IToStr(GradCount)); |
grad.setAttribute("gradientUnits", "userSpaceOnUse"); |
switch (Item->GrType) |
{ |
case 1: |
166,7 → 160,7 |
fill = "fill:url(#"+gradi+IToStr(GradCount)+");"; |
GradCount++; |
} |
fill += " fill-rule:evenodd;"; |
fill += " fill-rule:even-odd;"; |
if (Item->Transparency != 0) |
fill += " fill-opacity:"+FToStr(1.0 - Item->Transparency)+";"; |
} |
180,7 → 174,7 |
} |
else |
stroke = "stroke:none;"; |
trans = "translate("+FToStr(Item->Xpos)+", "+FToStr(Item->Ypos)+")"; |
trans = "translate("+FToStr(Item->Xpos)+" "+FToStr(Item->Ypos)+")"; |
if (Item->Rot != 0) |
trans += " rotate("+FToStr(Item->Rot)+")"; |
strokeW = "stroke-width:"+FToStr(Item->Pwidth)+";"; |
258,30 → 252,6 |
ob.setAttribute("d", SetClipPath(Item)+"Z"); |
break; |
case 2: |
if (Item->Pcolor != "None") |
{ |
ob = docu->createElement("path"); |
ob.setAttribute("d", SetClipPath(Item)+"Z"); |
ob.setAttribute("style", fill); |
gr.appendChild(ob); |
} |
if ((Item->PicAvail) && (Item->Pfile != "")) |
{ |
/* ob = docu->createElement("clipPath"); |
ob.setAttribute("id", Clipi+IToStr(ClipCount)); |
ob.setAttribute("clipPathUnits", "userSpaceOnUse"); |
QDomElement cl = docu->createElement("path"); |
cl.setAttribute("d", SetClipPath(Item)+"Z"); |
ob.appendChild(cl); |
gr.appendChild(ob); |
ob = docu->createElement("image"); |
ob.setAttribute("clip-path", "url(#"+Clipi+IToStr(ClipCount)+")"); |
ob.setAttribute("clip-rule", "evenodd"); */ |
ob = docu->createElement("image"); |
ob.setAttribute("transform", "translate("+FToStr(Item->LocalX)+", "+FToStr(Item->LocalY)+") scale("+FToStr(Item->LocalScX)+", "+FToStr(Item->LocalScY)+")"); |
ob.setAttribute("xlink:href", Path2Relative(Item->Pfile)); |
ClipCount++; |
} |
break; |
case 7: |
ob = docu->createElement("path"); |