r20689 by fschmid -
scribus-commit
scribus-commit at lists.scribus.net
Sun Jan 17 10:32:02 UTC 2016
Author: fschmid
Date: Sun Jan 17 10:32:02 2016
New Revision: 20689
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20689
Log:
Fixed Bug #12771: Some patterns imported to incorrect level and therefore aren't visible
Modified:
trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
trunk/Scribus/scribus/plugins/import/svg/svgplugin.h
Modified: trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20689&path=/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp Sun Jan 17 10:32:02 2016
@@ -595,8 +595,10 @@
gc->matrix = mat * gc->matrix;
}
-void SVGPlug::finishNode( const QDomNode &e, PageItem* item)
-{
+PageItem *SVGPlug::finishNode(const QDomNode &e, PageItem* item)
+{
+ PageItem* startArrow = NULL;
+ PageItem* endArrow = NULL;
SvgStyle *gc = m_gc.top();
QTransform gcm = gc->matrix;
double BaseX = m_Doc->currentPage()->xOffset();
@@ -860,10 +862,12 @@
arrowTrans.translate(-dX, -dY);
FPoint ba = FPoint(0.0, 0.0).transformPoint(arrowTrans, false);
int z = m_Doc->itemAdd(PageItem::Symbol, PageItem::Unspecified, ba.x(), ba.y(), dX * 2.0, dY * 2.0, 0, CommonStrings::None, CommonStrings::None);
- PageItem* ite = m_Doc->Items->at(z);
- ite->setPattern(importedPattTrans[gc->endMarker]);
- ite->setRotation(r, true);
- Elements.append(ite);
+ endArrow = m_Doc->Items->at(z);
+ endArrow->setPattern(importedPattTrans[gc->endMarker]);
+ endArrow->setRotation(r, true);
+ endArrow->setRedrawBounding();
+ endArrow->OwnPage = m_Doc->OnPage(endArrow);
+ // Elements.append(ite);
break;
}
}
@@ -891,15 +895,28 @@
arrowTrans.translate(-dX, -dY);
FPoint ba = FPoint(0.0, 0.0).transformPoint(arrowTrans, false);
int z = m_Doc->itemAdd(PageItem::Symbol, PageItem::Unspecified, ba.x(), ba.y(), dX * 2.0, dY * 2.0, 0, CommonStrings::None, CommonStrings::None);
- PageItem* ite = m_Doc->Items->at(z);
- ite->setPattern(importedPattTrans[gc->startMarker]);
- ite->setRotation(r, true);
- Elements.append(ite);
+ startArrow = m_Doc->Items->at(z);
+ startArrow->setPattern(importedPattTrans[gc->startMarker]);
+ startArrow->setRotation(r, true);
+ startArrow->setRedrawBounding();
+ startArrow->OwnPage = m_Doc->OnPage(startArrow);
+ // Elements.append(ite);
break;
}
}
}
}
+ if ((endArrow != NULL) || (startArrow != NULL))
+ {
+ QList<PageItem*> aElements;
+ aElements.append(item);
+ if (startArrow != NULL)
+ aElements.append(startArrow);
+ if (endArrow != NULL)
+ aElements.append(endArrow);
+ return m_Doc->groupObjectsList(aElements);
+ }
+ return item;
}
bool SVGPlug::isIgnorableNode( const QDomElement &e )
@@ -1611,7 +1628,7 @@
ite->PoLine.setPoint(1, FPoint(x1, y1));
ite->PoLine.setPoint(2, FPoint(x2, y2));
ite->PoLine.setPoint(3, FPoint(x2, y2));
- finishNode(e, ite);
+ ite = finishNode(e, ite);
LElements.append(ite);
delete( m_gc.pop() );
return LElements;
@@ -1640,7 +1657,7 @@
}
else
{
- finishNode(e, ite);
+ ite = finishNode(e, ite);
PElements.append(ite);
}
delete( m_gc.pop() );
@@ -1697,7 +1714,7 @@
}
else
{
- finishNode(e, ite);
+ ite = finishNode(e, ite);
PElements.append(ite);
}
}
Modified: trunk/Scribus/scribus/plugins/import/svg/svgplugin.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20689&path=/trunk/Scribus/scribus/plugins/import/svg/svgplugin.h
==============================================================================
--- trunk/Scribus/scribus/plugins/import/svg/svgplugin.h (original)
+++ trunk/Scribus/scribus/plugins/import/svg/svgplugin.h Sun Jan 17 10:32:02 2016
@@ -241,7 +241,7 @@
void addGraphicContext();
void setupNode( const QDomElement &e );
void setupTransform( const QDomElement &e );
- void finishNode( const QDomNode &e, PageItem* item);
+ PageItem* finishNode( const QDomNode &e, PageItem* item);
bool isIgnorableNode( const QDomElement &e );
bool isIgnorableNodeName( const QString &n );
FPoint parseTextPosition(const QDomElement &e, const FPoint* pos = NULL);
More information about the scribus-commit
mailing list