r15050 by jghali - #9083, svg export : incorrect export of master page elements
scribus-commit
scribus-commit at lists.scribus.net
Thu May 6 23:20:45 CEST 2010
Revision: 15050
Author: jghali
Date: 2010-05-06T21:11:33.209756Z
Commit message: #9083, svg export : incorrect export of master page elements
Changeset:
M /branches/Version135/Scribus/scribus/plugins/svgexplugin/svgexplugin.h
M /branches/Version135/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
Diffs:
Index: scribus/plugins/svgexplugin/svgexplugin.h
===================================================================
--- scribus/plugins/svgexplugin/svgexplugin.h (revision 15049)
+++ scribus/plugins/svgexplugin/svgexplugin.h (revision 15050)
@@ -77,7 +77,7 @@
\brief Process a page to export to SVG format
\param Seite Page *
*/
- void ProcessPage(Page *Seite);
+ void ProcessPage(Page *page);
void ProcessItemOnPage(double xOffset, double yOffset, PageItem *Item, QDomElement *parentElem);
QDomElement processPolyItem(PageItem *Item, QString trans, QString fill, QString stroke);
QDomElement processLineItem(PageItem *Item, QString trans, QString stroke);
Index: scribus/plugins/svgexplugin/svgexplugin.cpp
===================================================================
--- scribus/plugins/svgexplugin/svgexplugin.cpp (revision 15049)
+++ scribus/plugins/svgexplugin/svgexplugin.cpp (revision 15050)
@@ -195,7 +195,7 @@
Options = Opts;
QFileInfo fiBase(fName);
baseDir = fiBase.absolutePath();
- Page *Seite;
+ Page *page;
GradCount = 0;
ClipCount = 0;
PattCount = 0;
@@ -203,9 +203,9 @@
QString vo = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
QString st = "<svg></svg>";
docu.setContent(st);
- Seite = m_Doc->currentPage();
- double pageWidth = Seite->width();
- double pageHeight = Seite->height();
+ page = m_Doc->currentPage();
+ double pageWidth = page->width();
+ double pageHeight = page->height();
docElement = docu.documentElement();
docElement.setAttribute("width", FToStr(pageWidth)+"pt");
docElement.setAttribute("height", FToStr(pageHeight)+"pt");
@@ -239,10 +239,10 @@
backG.setAttribute("style", "fill:"+m_Doc->papColor.name()+";" + "stroke:none;");
docElement.appendChild(backG);
}
- Seite = m_Doc->MasterPages.at(m_Doc->MasterNames[m_Doc->currentPage()->MPageNam]);
- ProcessPage(Seite);
- Seite = m_Doc->currentPage();
- ProcessPage(Seite);
+ page = m_Doc->MasterPages.at(m_Doc->MasterNames[m_Doc->currentPage()->MPageNam]);
+ ProcessPage(page);
+ page = m_Doc->currentPage();
+ ProcessPage(page);
if(Options.compressFile)
{
// zipped saving
@@ -265,7 +265,7 @@
return true;
}
-void SVGExPlug::ProcessPage(Page *Seite)
+void SVGExPlug::ProcessPage(Page *page)
{
int Lnr = 0;
ScLayer ll;
@@ -277,13 +277,13 @@
QStack<PageItem*> groupStack;
QStack<QDomElement> groupStack2;
Page* SavedAct = m_Doc->currentPage();
- if (Seite->pageName().isEmpty())
+ if (page->pageName().isEmpty())
Items = m_Doc->DocItems;
else
Items = m_Doc->MasterItems;
if (Items.count() == 0)
return;
- m_Doc->setCurrentPage(Seite);
+ m_Doc->setCurrentPage(page);
for (int la = 0; la < m_Doc->Layers.count(); la++)
{
m_Doc->Layers.levelToLayer(ll, Lnr);
@@ -300,16 +300,18 @@
continue;
if (!Item->printEnabled())
continue;
- double x = Seite->xOffset();
- double y = Seite->yOffset();
- double w = Seite->width();
- double h = Seite->height();
+ double x = page->xOffset();
+ double y = page->yOffset();
+ double w = page->width();
+ double h = page->height();
double x2 = Item->BoundingX;
double y2 = Item->BoundingY;
double w2 = Item->BoundingW;
double h2 = Item->BoundingH;
if (!( qMax( x, x2 ) <= qMin( x+w, x2+w2 ) && qMax( y, y2 ) <= qMin( y+h, y2+h2 )))
continue;
+ if ((!page->pageName().isEmpty()) && (Item->OwnPage != static_cast<int>(page->pageNr())) && (Item->OwnPage != -1))
+ continue;
if (Item->isGroupControl)
{
groupStack.push(Item->groupsLastItem);
@@ -323,7 +325,7 @@
ob.setAttribute("id", "Clip"+IToStr(ClipCount));
QDomElement cl = docu.createElement("path");
cl.setAttribute("d", SetClipPath(&Item->PoLine, true));
- QString trans = "translate("+FToStr(Item->xPos()-Seite->xOffset())+", "+FToStr(Item->yPos()-Seite->yOffset())+")";
+ QString trans = "translate("+FToStr(Item->xPos()-page->xOffset())+", "+FToStr(Item->yPos()-page->yOffset())+")";
if (Item->rotation() != 0)
trans += " rotate("+FToStr(Item->rotation())+")";
cl.setAttribute("transform", trans);
@@ -333,7 +335,7 @@
ClipCount++;
continue;
}
- ProcessItemOnPage(Item->xPos()-Seite->xOffset(), Item->yPos()-Seite->yOffset(), Item, &layerGroup);
+ ProcessItemOnPage(Item->xPos()-page->xOffset(), Item->yPos()-page->yOffset(), Item, &layerGroup);
if (groupStack.count() != 0)
{
while (Item == groupStack.top())
@@ -353,10 +355,10 @@
continue;
if (!Item->printEnabled())
continue;
- double x = Seite->xOffset();
- double y = Seite->yOffset();
- double w = Seite->width();
- double h = Seite->height();
+ double x = page->xOffset();
+ double y = page->yOffset();
+ double w = page->width();
+ double h = page->height();
double x2 = Item->BoundingX;
double y2 = Item->BoundingY;
double w2 = Item->BoundingW;
@@ -369,7 +371,7 @@
continue;
if ((Item->TopLine) || (Item->RightLine) || (Item->BottomLine) || (Item->LeftLine))
{
- QString trans = "translate("+FToStr(Item->xPos()-Seite->xOffset())+", "+FToStr(Item->yPos()-Seite->yOffset())+")";
+ QString trans = "translate("+FToStr(Item->xPos()-page->xOffset())+", "+FToStr(Item->yPos()-page->yOffset())+")";
if (Item->rotation() != 0)
trans += " rotate("+FToStr(Item->rotation())+")";
QString stroke = getStrokeStyle(Item);
More information about the scribus-commit
mailing list