Kaydet (Commit) 1d2b564e authored tarafından Christian Barth's avatar Christian Barth Kaydeden (comit) Markus Mohrhard

tdf#107197: Replace relationship URI

Replaced URIs in sd/source

Change-Id: If035c10c680fc106eeddb08d127a337701adb85c
Signed-off-by: 's avatarChristian Barth <Christian.Barth@zoho.com>
Reviewed-on: https://gerrit.libreoffice.org/41056Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 0375de72
...@@ -18,6 +18,7 @@ enum class Relationship ...@@ -18,6 +18,7 @@ enum class Relationship
ACTIVEXCONTROLBINARY, ACTIVEXCONTROLBINARY,
CHART, CHART,
COMMENTS, COMMENTS,
COMMENTAUTHORS,
CONTROL, CONTROL,
CUSTOMXML, CUSTOMXML,
CUSTOMXMLPROPS, CUSTOMXMLPROPS,
...@@ -36,11 +37,16 @@ enum class Relationship ...@@ -36,11 +37,16 @@ enum class Relationship
HEADER, HEADER,
HYPERLINK, HYPERLINK,
IMAGE, IMAGE,
NOTESSLIDE,
NOTESMASTER,
NUMBERING, NUMBERING,
OFFICEDOCUMENT, OFFICEDOCUMENT,
OLEOBJECT, OLEOBJECT,
PACKAGE, PACKAGE,
SETTINGS, SETTINGS,
SLIDE,
SLIDELAYOUT,
SLIDEMASTER,
STYLES, STYLES,
THEME, THEME,
VBAPROJECT, VBAPROJECT,
......
{Relationship::ACTIVEXCONTROLBINARY, "http://schemas.microsoft.com/office/2006/relationships/activeXControlBinary"}, {Relationship::ACTIVEXCONTROLBINARY, "http://schemas.microsoft.com/office/2006/relationships/activeXControlBinary"},
{Relationship::CHART, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"}, {Relationship::CHART, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart"},
{Relationship::COMMENTS, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"}, {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::CONTROL, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/control"},
{Relationship::CUSTOMXML, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml"}, {Relationship::CUSTOMXML, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml"},
{Relationship::CUSTOMXMLPROPS, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps"}, {Relationship::CUSTOMXMLPROPS, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps"},
...@@ -19,11 +20,16 @@ ...@@ -19,11 +20,16 @@
{Relationship::HEADER, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header"}, {Relationship::HEADER, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header"},
{Relationship::HYPERLINK, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"}, {Relationship::HYPERLINK, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"},
{Relationship::IMAGE, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"}, {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::NUMBERING, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"},
{Relationship::OFFICEDOCUMENT, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"}, {Relationship::OFFICEDOCUMENT, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"},
{Relationship::OLEOBJECT, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"}, {Relationship::OLEOBJECT, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"},
{Relationship::PACKAGE, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"}, {Relationship::PACKAGE, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"},
{Relationship::SETTINGS, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"}, {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::STYLES, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"},
{Relationship::THEME, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"}, {Relationship::THEME, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"},
{Relationship::VBAPROJECT, "http://schemas.microsoft.com/office/2006/relationships/vbaProject"}, {Relationship::VBAPROJECT, "http://schemas.microsoft.com/office/2006/relationships/vbaProject"},
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <oox/drawingml/chart/chartconverter.hxx> #include <oox/drawingml/chart/chartconverter.hxx>
#include <oox/token/namespaces.hxx> #include <oox/token/namespaces.hxx>
#include <oox/token/tokens.hxx> #include <oox/token/tokens.hxx>
#include <oox/token/relationship.hxx>
#include <oox/ole/vbaproject.hxx> #include <oox/ole/vbaproject.hxx>
#include <epptooxml.hxx> #include <epptooxml.hxx>
#include <epptdef.hxx> #include <epptdef.hxx>
...@@ -373,7 +374,7 @@ bool PowerPointExport::exportDocument() ...@@ -373,7 +374,7 @@ bool PowerPointExport::exportDocument()
//write document properties //write document properties
writeDocumentProperties(); 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. // PPTM needs a different media type for the presentation.xml stream.
OUString aMediaType("application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"); OUString aMediaType("application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml");
...@@ -383,7 +384,7 @@ bool PowerPointExport::exportDocument() ...@@ -383,7 +384,7 @@ bool PowerPointExport::exportDocument()
mPresentationFS = openFragmentStreamWithSerializer("ppt/presentation.xml", aMediaType); mPresentationFS = openFragmentStreamWithSerializer("ppt/presentation.xml", aMediaType);
addRelation(mPresentationFS->getOutputStream(), addRelation(mPresentationFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme", oox::getRelationship(Relationship::THEME),
"theme/theme1.xml"); "theme/theme1.xml");
mPresentationFS->startElementNS(XML_p, XML_presentation, PNMSS, FSEND); mPresentationFS->startElementNS(XML_p, XML_presentation, PNMSS, FSEND);
...@@ -1524,7 +1525,7 @@ void PowerPointExport::WriteAuthors() ...@@ -1524,7 +1525,7 @@ void PowerPointExport::WriteAuthors()
FSHelperPtr pFS = openFragmentStreamWithSerializer("ppt/commentAuthors.xml", FSHelperPtr pFS = openFragmentStreamWithSerializer("ppt/commentAuthors.xml",
"application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml"); "application/vnd.openxmlformats-officedocument.presentationml.commentAuthors+xml");
addRelation(mPresentationFS->getOutputStream(), addRelation(mPresentationFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/commentAuthors", oox::getRelationship(Relationship::COMMENTAUTHORS),
"commentAuthors.xml"); "commentAuthors.xml");
pFS->startElementNS(XML_p, XML_cmAuthorLst, pFS->startElementNS(XML_p, XML_cmAuthorLst,
...@@ -1647,7 +1648,7 @@ void PowerPointExport::WriteVBA() ...@@ -1647,7 +1648,7 @@ void PowerPointExport::WriteVBA()
comphelper::OStorageHelper::CopyInputToOutput(xMacrosStream, xOutputStream); comphelper::OStorageHelper::CopyInputToOutput(xMacrosStream, xOutputStream);
// Write the relationship. // 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 */, 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 ...@@ -1661,7 +1662,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum
// add explicit relation of presentation to this slide // add explicit relation of presentation to this slide
OUString sRelId = addRelation(mPresentationFS->getOutputStream(), OUString sRelId = addRelation(mPresentationFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide", oox::getRelationship(Relationship::SLIDE),
OUStringBuffer() OUStringBuffer()
.append("slides/slide") .append("slides/slide")
.append((sal_Int32) nPageNum + 1) .append((sal_Int32) nPageNum + 1)
...@@ -1719,7 +1720,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum ...@@ -1719,7 +1720,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum
// add implicit relation to slide layout // add implicit relation to slide layout
addRelation(pFS->getOutputStream(), addRelation(pFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout", oox::getRelationship(Relationship::SLIDELAYOUT),
OUStringBuffer() OUStringBuffer()
.append("../slideLayouts/slideLayout") .append("../slideLayouts/slideLayout")
.append(GetLayoutFileId(GetPPTXLayoutId(GetLayoutOffset(mXPagePropSet)), nMasterNum)) .append(GetLayoutFileId(GetPPTXLayoutId(GetLayoutOffset(mXPagePropSet)), nMasterNum))
...@@ -1729,7 +1730,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum ...@@ -1729,7 +1730,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum
if (WriteComments(nPageNum)) if (WriteComments(nPageNum))
// add implicit relation to slide comments // add implicit relation to slide comments
addRelation(pFS->getOutputStream(), addRelation(pFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments", oox::getRelationship(Relationship::COMMENTS),
OUStringBuffer() OUStringBuffer()
.append("../comments/comment") .append("../comments/comment")
.append((sal_Int32) nPageNum + 1) .append((sal_Int32) nPageNum + 1)
...@@ -1765,7 +1766,7 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum) ...@@ -1765,7 +1766,7 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum)
// add implicit relation to slide // add implicit relation to slide
addRelation(pFS->getOutputStream(), addRelation(pFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide", oox::getRelationship(Relationship::SLIDE),
OUStringBuffer() OUStringBuffer()
.append("../slides/slide") .append("../slides/slide")
.append((sal_Int32) nPageNum + 1) .append((sal_Int32) nPageNum + 1)
...@@ -1775,7 +1776,7 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum) ...@@ -1775,7 +1776,7 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum)
// add slide implicit relation to notes // add slide implicit relation to notes
if (mpSlidesFSArray.size() >= nPageNum) if (mpSlidesFSArray.size() >= nPageNum)
addRelation(mpSlidesFSArray[ nPageNum ]->getOutputStream(), addRelation(mpSlidesFSArray[ nPageNum ]->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide", oox::getRelationship(Relationship::NOTESSLIDE),
OUStringBuffer() OUStringBuffer()
.append("../notesSlides/notesSlide") .append("../notesSlides/notesSlide")
.append((sal_Int32) nPageNum + 1) .append((sal_Int32) nPageNum + 1)
...@@ -1784,7 +1785,7 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum) ...@@ -1784,7 +1785,7 @@ void PowerPointExport::ImplWriteNotes(sal_uInt32 nPageNum)
// add implicit relation to notes master // add implicit relation to notes master
addRelation(pFS->getOutputStream(), addRelation(pFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster", oox::getRelationship(Relationship::NOTESMASTER),
"../notesMasters/notesMaster1.xml"); "../notesMasters/notesMaster1.xml");
SAL_INFO("sd.eppt", "-----------------"); SAL_INFO("sd.eppt", "-----------------");
...@@ -1794,7 +1795,7 @@ void PowerPointExport::AddLayoutIdAndRelation(const FSHelperPtr& pFS, sal_Int32 ...@@ -1794,7 +1795,7 @@ void PowerPointExport::AddLayoutIdAndRelation(const FSHelperPtr& pFS, sal_Int32
{ {
// add implicit relation of slide master to slide layout // add implicit relation of slide master to slide layout
OUString sRelId = addRelation(pFS->getOutputStream(), OUString sRelId = addRelation(pFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout", oox::getRelationship(Relationship::SLIDELAYOUT),
OUStringBuffer() OUStringBuffer()
.append("../slideLayouts/slideLayout") .append("../slideLayouts/slideLayout")
.append(nLayoutFileId) .append(nLayoutFileId)
...@@ -1816,7 +1817,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro ...@@ -1816,7 +1817,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro
mPresentationFS->startElementNS(XML_p, XML_sldMasterIdLst, FSEND); mPresentationFS->startElementNS(XML_p, XML_sldMasterIdLst, FSEND);
OUString sRelId = addRelation(mPresentationFS->getOutputStream(), OUString sRelId = addRelation(mPresentationFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster", oox::getRelationship(Relationship::SLIDEMASTER),
OUStringBuffer() OUStringBuffer()
.append("slideMasters/slideMaster") .append("slideMasters/slideMaster")
.append((sal_Int32) nPageNum + 1) .append((sal_Int32) nPageNum + 1)
...@@ -1844,7 +1845,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro ...@@ -1844,7 +1845,7 @@ void PowerPointExport::ImplWriteSlideMaster(sal_uInt32 nPageNum, Reference< XPro
// add implicit relation to the presentation theme // add implicit relation to the presentation theme
addRelation(pFS->getOutputStream(), addRelation(pFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme", oox::getRelationship(Relationship::THEME),
OUStringBuffer() OUStringBuffer()
.append("../theme/theme") .append("../theme/theme")
.append((sal_Int32) nPageNum + 1) .append((sal_Int32) nPageNum + 1)
...@@ -1957,7 +1958,7 @@ void PowerPointExport::ImplWritePPTXLayout(sal_Int32 nOffset, sal_uInt32 nMaster ...@@ -1957,7 +1958,7 @@ void PowerPointExport::ImplWritePPTXLayout(sal_Int32 nOffset, sal_uInt32 nMaster
// add implicit relation of slide layout to slide master // add implicit relation of slide layout to slide master
addRelation(pFS->getOutputStream(), addRelation(pFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster", oox::getRelationship(Relationship::SLIDEMASTER),
OUStringBuffer() OUStringBuffer()
.append("../slideMasters/slideMaster") .append("../slideMasters/slideMaster")
.append((sal_Int32) nMasterNum + 1) .append((sal_Int32) nMasterNum + 1)
...@@ -2369,7 +2370,7 @@ bool PowerPointExport::WriteNotesMaster() ...@@ -2369,7 +2370,7 @@ bool PowerPointExport::WriteNotesMaster()
mPresentationFS->startElementNS(XML_p, XML_notesMasterIdLst, FSEND); mPresentationFS->startElementNS(XML_p, XML_notesMasterIdLst, FSEND);
OUString sRelId = addRelation(mPresentationFS->getOutputStream(), OUString sRelId = addRelation(mPresentationFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster", oox::getRelationship(Relationship::NOTESMASTER),
"notesMasters/notesMaster1.xml"); "notesMasters/notesMaster1.xml");
mPresentationFS->singleElementNS(XML_p, XML_notesMasterId, mPresentationFS->singleElementNS(XML_p, XML_notesMasterId,
...@@ -2386,7 +2387,7 @@ bool PowerPointExport::WriteNotesMaster() ...@@ -2386,7 +2387,7 @@ bool PowerPointExport::WriteNotesMaster()
// add implicit relation to the presentation theme // add implicit relation to the presentation theme
addRelation(pFS->getOutputStream(), addRelation(pFS->getOutputStream(),
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme", oox::getRelationship(Relationship::THEME),
OUStringBuffer() OUStringBuffer()
.append("../theme/theme") .append("../theme/theme")
.append((sal_Int32) mnMasterPages + 1) .append((sal_Int32) mnMasterPages + 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment