diff options
author | Christian Barth <Christian.Barth@zoho.com> | 2017-08-11 19:52:08 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-08-12 13:34:22 +0200 |
commit | 1d2b564ecbb758d70bde1cb2a9bef741bd895443 (patch) | |
tree | 80db737f34be6fcf397deea23a4bf811e2d11352 | |
parent | 0375de72a5d53463cb9ce12ca7a12adf1037cd07 (diff) |
tdf#107197: Replace relationship URI
Replaced URIs in sd/source
Change-Id: If035c10c680fc106eeddb08d127a337701adb85c
Signed-off-by: Christian Barth <Christian.Barth@zoho.com>
Reviewed-on: https://gerrit.libreoffice.org/41056
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | include/oox/token/relationship.hxx | 6 | ||||
-rw-r--r-- | oox/source/token/relationship.inc | 6 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-epptooxml.cxx | 33 |
3 files changed, 29 insertions, 16 deletions
diff --git a/include/oox/token/relationship.hxx b/include/oox/token/relationship.hxx index 8d91fd651904..08b999a87a29 100644 --- a/include/oox/token/relationship.hxx +++ b/include/oox/token/relationship.hxx @@ -18,6 +18,7 @@ enum class Relationship ACTIVEXCONTROLBINARY, CHART, COMMENTS, + COMMENTAUTHORS, CONTROL, CUSTOMXML, CUSTOMXMLPROPS, @@ -36,11 +37,16 @@ enum class Relationship HEADER, HYPERLINK, IMAGE, + NOTESSLIDE, + NOTESMASTER, NUMBERING, OFFICEDOCUMENT, OLEOBJECT, PACKAGE, SETTINGS, + SLIDE, + SLIDELAYOUT, + SLIDEMASTER, STYLES, THEME, VBAPROJECT, diff --git a/oox/source/token/relationship.inc b/oox/source/token/relationship.inc index f07cfd7f99b2..56b4426dcc9b 100644 --- a/oox/source/token/relationship.inc +++ b/oox/source/token/relationship.inc @@ -1,6 +1,7 @@ {Relationship::ACTIVEXCONTROLBINARY, "http://schemas.microsoft.com/office/2006/relationships/activeXControlBinary"}, {Relationship::CHART, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"}, {Relationship::COMMENTS, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"}, +{Relationship::COMMENTAUTHORS, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors"}, {Relationship::CONTROL, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/control"}, {Relationship::CUSTOMXML, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml"}, {Relationship::CUSTOMXMLPROPS, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps"}, @@ -19,11 +20,16 @@ {Relationship::HEADER, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header"}, {Relationship::HYPERLINK, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"}, {Relationship::IMAGE, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"}, +{Relationship::NOTESSLIDE, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"}, +{Relationship::NOTESMASTER, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster"}, {Relationship::NUMBERING, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"}, {Relationship::OFFICEDOCUMENT, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"}, {Relationship::OLEOBJECT, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"}, {Relationship::PACKAGE, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"}, {Relationship::SETTINGS, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"}, +{Relationship::SLIDE, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide"}, +{Relationship::SLIDELAYOUT, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout"}, +{Relationship::SLIDEMASTER, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster"}, {Relationship::STYLES, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"}, {Relationship::THEME, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"}, {Relationship::VBAPROJECT, "http://schemas.microsoft.com/office/2006/relationships/vbaProject"}, diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 667f7ef6bbba..c8d3532617b7 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -22,6 +22,7 @@ #include <oox/drawingml/chart/chartconverter.hxx> #include <oox/token/namespaces.hxx> #include <oox/token/tokens.hxx> +#include <oox/token/relationship.hxx> #include <oox/ole/vbaproject.hxx> #include <epptooxml.hxx> #include <epptdef.hxx> @@ -373,7 +374,7 @@ bool PowerPointExport::exportDocument() //write document properties writeDocumentProperties(); - addRelation("http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", "ppt/presentation.xml"); + addRelation(oox::getRelationship(Relationship::OFFICEDOCUMENT), "ppt/presentation.xml"); // PPTM needs a different media type for the presentation.xml stream. OUString aMediaType("application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"); @@ -383,7 +384,7 @@ bool PowerPointExport::exportDocument() mPresentationFS = openFragmentStreamWithSerializer("ppt/presentation.xml", aMediaType); addRelation(mPresentationFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme", + oox::getRelationship(Relationship::THEME), "theme/theme1.xml"); mPresentationFS->startElementNS(XML_p, XML_presentation, PNMSS, FSEND); @@ -1524,7 +1525,7 @@ void PowerPointExport::WriteAuthors() FSHelperPtr pFS = openFragmentStreamWithSerializer("ppt/commentAuthors.xml", "application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml"); addRelation(mPresentationFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors", + oox::getRelationship(Relationship::COMMENTAUTHORS), "commentAuthors.xml"); pFS->startElementNS(XML_p, XML_cmAuthorLst, @@ -1647,7 +1648,7 @@ void PowerPointExport::WriteVBA() comphelper::OStorageHelper::CopyInputToOutput(xMacrosStream, xOutputStream); // Write the relationship. - addRelation(mPresentationFS->getOutputStream(), "http://schemas.microsoft.com/office/2006/relationships/vbaProject", "vbaProject.bin"); + addRelation(mPresentationFS->getOutputStream(), oox::getRelationship(Relationship::VBAPROJECT), "vbaProject.bin"); } void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum, sal_uInt16 /* nMode */, @@ -1661,7 +1662,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum // add explicit relation of presentation to this slide OUString sRelId = addRelation(mPresentationFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide", + oox::getRelationship(Relationship::SLIDE), OUStringBuffer() .append("slides/slide") .append((sal_Int32) nPageNum + 1) @@ -1719,7 +1720,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum // add implicit relation to slide layout addRelation(pFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout", + oox::getRelationship(Relationship::SLIDELAYOUT), OUStringBuffer() .append("../slideLayouts/slideLayout") .append(GetLayoutFileId(GetPPTXLayoutId(GetLayoutOffset(mXPagePropSet)), nMasterNum)) @@ -1729,7 +1730,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum if (WriteComments(nPageNum)) // add implicit relation to slide comments addRelation(pFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments", + oox::getRelationship(Relationship::COMMENTS), OUStringBuffer() .append("../comments/comment") .append((sal_Int32) nPageNum + 1) @@ -1765,7 +1766,7 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum) // add implicit relation to slide addRelation(pFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide", + oox::getRelationship(Relationship::SLIDE), OUStringBuffer() .append("../slides/slide") .append((sal_Int32) nPageNum + 1) @@ -1775,7 +1776,7 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum) // add slide implicit relation to notes if (mpSlidesFSArray.size() >= nPageNum) addRelation(mpSlidesFSArray[ nPageNum ]->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide", + oox::getRelationship(Relationship::NOTESSLIDE), OUStringBuffer() .append("../notesSlides/notesSlide") .append((sal_Int32) nPageNum + 1) @@ -1784,7 +1785,7 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum) // add implicit relation to notes master addRelation(pFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster", + oox::getRelationship(Relationship::NOTESMASTER), "../notesMasters/notesMaster1.xml"); SAL_INFO("sd.eppt", "-----------------"); @@ -1794,7 +1795,7 @@ void PowerPointExport::AddLayoutIdAndRelation(const FSHelperPtr& pFS, sal_Int32 { // add implicit relation of slide master to slide layout OUString sRelId = addRelation(pFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout", + oox::getRelationship(Relationship::SLIDELAYOUT), OUStringBuffer() .append("../slideLayouts/slideLayout") .append(nLayoutFileId) @@ -1816,7 +1817,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro mPresentationFS->startElementNS(XML_p, XML_sldMasterIdLst, FSEND); OUString sRelId = addRelation(mPresentationFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster", + oox::getRelationship(Relationship::SLIDEMASTER), OUStringBuffer() .append("slideMasters/slideMaster") .append((sal_Int32) nPageNum + 1) @@ -1844,7 +1845,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro // add implicit relation to the presentation theme addRelation(pFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme", + oox::getRelationship(Relationship::THEME), OUStringBuffer() .append("../theme/theme") .append((sal_Int32) nPageNum + 1) @@ -1957,7 +1958,7 @@ void PowerPointExport::ImplWritePPTXLayout(sal_Int32 nOffset, sal_uInt32 nMaster // add implicit relation of slide layout to slide master addRelation(pFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster", + oox::getRelationship(Relationship::SLIDEMASTER), OUStringBuffer() .append("../slideMasters/slideMaster") .append((sal_Int32) nMasterNum + 1) @@ -2369,7 +2370,7 @@ bool PowerPointExport::WriteNotesMaster() mPresentationFS->startElementNS(XML_p, XML_notesMasterIdLst, FSEND); OUString sRelId = addRelation(mPresentationFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster", + oox::getRelationship(Relationship::NOTESMASTER), "notesMasters/notesMaster1.xml"); mPresentationFS->singleElementNS(XML_p, XML_notesMasterId, @@ -2386,7 +2387,7 @@ bool PowerPointExport::WriteNotesMaster() // add implicit relation to the presentation theme addRelation(pFS->getOutputStream(), - "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme", + oox::getRelationship(Relationship::THEME), OUStringBuffer() .append("../theme/theme") .append((sal_Int32) mnMasterPages + 1) |