View Issue Details

IDProjectCategoryView StatusLast Update
0015975ScribusImport / Exportpublic2019-12-08 21:24
Reporterale Assigned Toale  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.5.6.svn 
Fixed in Version1.5.6.svn 
Summary0015975: IDML: guides on pages are not imported
Descriptionwhen importing the attached idml file, scribus ignores the guides.

the patch detects the horizontal and vertical guides.
TagsNo tags attached.
PatchYes

Activities

ale

2019-11-29 16:35

manager  

idml-spread-guides.diff (1,563 bytes)   
diff --git a/scribus/plugins/import/idml/importidml.cpp b/scribus/plugins/import/idml/importidml.cpp
index c08b5e471..bb6dacb42 100644
--- a/scribus/plugins/import/idml/importidml.cpp
+++ b/scribus/plugins/import/idml/importidml.cpp
@@ -33,6 +33,7 @@ for which a new license (GPL+exception) is in place.
 #include "importidml.h"
 
 #include "commonstrings.h"
+#include "guidemanagercore.h"
 #include "loadsaveplugin.h"
 #include "pageitem_table.h"
 #include "pagesize.h"
@@ -1579,6 +1580,25 @@ void IdmlPlug::parseSpreadXMLNode(const QDomElement& spNode)
 							m_Doc->applyMasterPage(mp, m_Doc->currentPageNumber());
 						}
 					}
+					if (spe.hasAttribute("AppliedMaster"))
+					{
+						QString mSpr = spe.attribute("AppliedMaster");
+					}
+					if (spe.hasChildNodes())
+					{
+						for (QDomNode pageNode = spe.firstChild(); !pageNode.isNull(); pageNode = pageNode.nextSibling())
+						{
+							QDomElement pageElement = pageNode.toElement();
+							if (pageElement.tagName() == "Guide" && pageElement.hasAttribute("Location"))
+							{
+								auto location = pageElement.attribute("Location").toDouble();
+								if (pageElement.attribute("Orientation") == "Vertical")
+									m_Doc->currentPage()->guides.addVertical(location, GuideManagerCore::Standard);
+								else if (pageElement.attribute("Orientation") == "Vertical")
+									m_Doc->currentPage()->guides.addHorizontal(location, GuideManagerCore::Standard);
+							}
+						}
+					}
 				}
 			}
 			if ((facingPages) && (pagecount % 2 == 0))
idml-spread-guides.diff (1,563 bytes)   

jghali

2019-11-29 23:40

administrator   ~0047167

There is an obvious bug with this patch...

ale

2019-11-30 08:01

manager   ~0047168

new patch...
idml-spread-guides-2.diff (1,444 bytes)   
diff --git a/scribus/plugins/import/idml/importidml.cpp b/scribus/plugins/import/idml/importidml.cpp
index c08b5e471..bb6dacb42 100644
--- a/scribus/plugins/import/idml/importidml.cpp
+++ b/scribus/plugins/import/idml/importidml.cpp
@@ -33,6 +33,7 @@ for which a new license (GPL+exception) is in place.
 #include "importidml.h"
 
 #include "commonstrings.h"
+#include "guidemanagercore.h"
 #include "loadsaveplugin.h"
 #include "pageitem_table.h"
 #include "pagesize.h"
@@ -1579,6 +1580,25 @@ void IdmlPlug::parseSpreadXMLNode(const QDomElement& spNode)
 							m_Doc->applyMasterPage(mp, m_Doc->currentPageNumber());
 						}
 					}
+					if (spe.hasChildNodes())
+					{
+						for (QDomNode pageNode = spe.firstChild(); !pageNode.isNull(); pageNode = pageNode.nextSibling())
+						{
+							QDomElement pageElement = pageNode.toElement();
+							if (pageElement.tagName() == "Guide" && pageElement.hasAttribute("Location"))
+							{
+								auto location = pageElement.attribute("Location").toDouble();
+								if (pageElement.attribute("Orientation") == "Vertical")
+									m_Doc->currentPage()->guides.addVertical(location, GuideManagerCore::Standard);
+								else if (pageElement.attribute("Orientation") == "Vertical")
+									m_Doc->currentPage()->guides.addHorizontal(location, GuideManagerCore::Standard);
+							}
+						}
+					}
 				}
 			}
 			if ((facingPages) && (pagecount % 2 == 0))
idml-spread-guides-2.diff (1,444 bytes)   

jghali

2019-11-30 11:25

administrator   ~0047170

The bug is still not fixed.

ale

2019-11-30 13:28

manager   ~0047171

now?
idml-spread-guides-3.diff (1,487 bytes)   
diff --git a/scribus/plugins/import/idml/importidml.cpp b/scribus/plugins/import/idml/importidml.cpp
index c08b5e471..bb6dacb42 100644
--- a/scribus/plugins/import/idml/importidml.cpp
+++ b/scribus/plugins/import/idml/importidml.cpp
@@ -33,6 +33,7 @@ for which a new license (GPL+exception) is in place.
 #include "importidml.h"
 
 #include "commonstrings.h"
+#include "guidemanagercore.h"
 #include "loadsaveplugin.h"
 #include "pageitem_table.h"
 #include "pagesize.h"
@@ -1579,6 +1580,25 @@ void IdmlPlug::parseSpreadXMLNode(const QDomElement& spNode)
 							m_Doc->applyMasterPage(mp, m_Doc->currentPageNumber());
 						}
 					}
+					if (spe.hasChildNodes())
+					{
+						for (QDomNode pageNode = spe.firstChild(); !pageNode.isNull(); pageNode = pageNode.nextSibling())
+						{
+							QDomElement pageElement = pageNode.toElement();
+							if (pageElement.tagName() == "Guide" && pageElement.hasAttribute("Location") && pageElement.hasAttribute("Orientation"))
+							{
+								auto location = pageElement.attribute("Location").toDouble();
+								if (pageElement.attribute("Orientation") == "Vertical")
+									m_Doc->currentPage()->guides.addVertical(location, GuideManagerCore::Standard);
+								else if (pageElement.attribute("Orientation") == "Vertical")
+									m_Doc->currentPage()->guides.addHorizontal(location, GuideManagerCore::Standard);
+							}
+						}
+					}
 				}
 			}
 			if ((facingPages) && (pagecount % 2 == 0))
idml-spread-guides-3.diff (1,487 bytes)   

jghali

2019-11-30 19:40

administrator   ~0047173

Last edited: 2019-11-30 19:43

Still not fixed :-D
Look for a likely copy/paste error.

ale

2019-11-30 19:54

manager   ~0047174

... i need something that creates IDML files for testing my patches...
idml-spread-guides-4.diff (1,489 bytes)   
diff --git a/scribus/plugins/import/idml/importidml.cpp b/scribus/plugins/import/idml/importidml.cpp
index c08b5e471..bb6dacb42 100644
--- a/scribus/plugins/import/idml/importidml.cpp
+++ b/scribus/plugins/import/idml/importidml.cpp
@@ -33,6 +33,7 @@ for which a new license (GPL+exception) is in place.
 #include "importidml.h"
 
 #include "commonstrings.h"
+#include "guidemanagercore.h"
 #include "loadsaveplugin.h"
 #include "pageitem_table.h"
 #include "pagesize.h"
@@ -1579,6 +1580,25 @@ void IdmlPlug::parseSpreadXMLNode(const QDomElement& spNode)
 							m_Doc->applyMasterPage(mp, m_Doc->currentPageNumber());
 						}
 					}
+					if (spe.hasChildNodes())
+					{
+						for (QDomNode pageNode = spe.firstChild(); !pageNode.isNull(); pageNode = pageNode.nextSibling())
+						{
+							QDomElement pageElement = pageNode.toElement();
+							if (pageElement.tagName() == "Guide" && pageElement.hasAttribute("Location") && pageElement.hasAttribute("Orientation"))
+							{
+								auto location = pageElement.attribute("Location").toDouble();
+								if (pageElement.attribute("Orientation") == "Vertical")
+									m_Doc->currentPage()->guides.addVertical(location, GuideManagerCore::Standard);
+								else if (pageElement.attribute("Orientation") == "Horizontal")
+									m_Doc->currentPage()->guides.addHorizontal(location, GuideManagerCore::Standard);
+							}
+						}
+					}
 				}
 			}
 			if ((facingPages) && (pagecount % 2 == 0))
idml-spread-guides-4.diff (1,489 bytes)   

jghali

2019-11-30 20:10

administrator   ~0047178

Ask it in your letter for Santa Claus :-D

Issue History

Date Modified Username Field Change
2019-11-29 16:35 ale New Issue
2019-11-29 16:35 ale File Added: 21 x 28 Photobook XT, Spreads matte photo paper, 18 pages.idml
2019-11-29 16:35 ale File Added: idml-spread-guides.diff
2019-11-29 23:40 jghali Note Added: 0047167
2019-11-30 08:01 ale File Added: idml-spread-guides-2.diff
2019-11-30 08:01 ale Note Added: 0047168
2019-11-30 11:25 jghali Note Added: 0047170
2019-11-30 13:28 ale File Added: idml-spread-guides-3.diff
2019-11-30 13:28 ale Note Added: 0047171
2019-11-30 19:40 jghali Note Added: 0047173
2019-11-30 19:43 jghali Note Edited: 0047173
2019-11-30 19:54 ale File Added: idml-spread-guides-4.diff
2019-11-30 19:54 ale Note Added: 0047174
2019-11-30 20:10 jghali Note Added: 0047178
2019-11-30 20:41 jghali Summary [PATCH] IDML: guides on pages are not imported => IDML: guides on pages are not imported
2019-11-30 20:42 jghali Assigned To => ale
2019-11-30 20:42 jghali Status new => resolved
2019-11-30 20:42 jghali Resolution open => fixed
2019-11-30 20:42 jghali Fixed in Version => 1.5.6.svn
2019-12-08 21:24 cbradney Status resolved => closed