View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0015975 | Scribus | Import / Export | public | 2019-11-29 16:35 | 2019-12-08 21:24 |
Reporter | ale | Assigned To | ale | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.5.6.svn | ||||
Fixed in Version | 1.5.6.svn | ||||
Summary | 0015975: IDML: guides on pages are not imported | ||||
Description | when importing the attached idml file, scribus ignores the guides. the patch detects the horizontal and vertical guides. | ||||
Tags | No tags attached. | ||||
Patch | Yes | ||||
|
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)) |
|
There is an obvious bug with this patch... |
|
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)) |
|
The bug is still not fixed. |
|
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)) |
|
Still not fixed :-D Look for a likely copy/paste error. |
|
... 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)) |
|
Ask it in your letter for Santa Claus :-D |
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 |