[Libreoffice-commits] core.git: include/oox oox/source sc/source

Christian Barth Christian.Barth at zoho.com
Sat Aug 12 12:44:37 UTC 2017


 include/oox/token/relationship.hxx   |    9 +++++++--
 oox/source/token/relationship.inc    |    9 +++++++--
 sc/source/filter/excel/xecontent.cxx |    2 +-
 sc/source/filter/excel/xeescher.cxx  |    3 ++-
 sc/source/filter/excel/xelink.cxx    |    3 ++-
 sc/source/filter/excel/xestream.cxx  |    5 +++--
 sc/source/filter/excel/xestyle.cxx   |    3 ++-
 sc/source/filter/xcl97/xcl97rec.cxx  |    7 ++++---
 8 files changed, 28 insertions(+), 13 deletions(-)

New commits:
commit 6d34c6eed0a35ac5db918baf742692241c2dc5e9
Author: Christian Barth <Christian.Barth at zoho.com>
Date:   Fri Aug 11 20:30:53 2017 +0200

    tdf#107197: Replace relationship URI
    
    Replaced URIs in sc/source
    
    Change-Id: I5227d4d471cf7e579c8c6ec43e0ea3d04b65b331
    Signed-off-by: Christian Barth <Christian.Barth at zoho.com>
    Reviewed-on: https://gerrit.libreoffice.org/41062
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/include/oox/token/relationship.hxx b/include/oox/token/relationship.hxx
index 08b999a87a29..d00552e02560 100644
--- a/include/oox/token/relationship.hxx
+++ b/include/oox/token/relationship.hxx
@@ -27,7 +27,9 @@ enum class Relationship
     DIAGRAMDRAWING,
     DIAGRAMLAYOUT,
     DIAGRAMQUICKSTYLE,
+    DRAWING,
     ENDNOTES,
+    EXTERNALLINKPATH,
     FONT,
     FONTTABLE,
     FOOTER,
@@ -37,20 +39,23 @@ enum class Relationship
     HEADER,
     HYPERLINK,
     IMAGE,
-    NOTESSLIDE,
     NOTESMASTER,
+    NOTESSLIDE,
     NUMBERING,
     OFFICEDOCUMENT,
     OLEOBJECT,
     PACKAGE,
     SETTINGS,
+    SHAREDSTRINGS,
     SLIDE,
     SLIDELAYOUT,
     SLIDEMASTER,
     STYLES,
     THEME,
     VBAPROJECT,
-    WORDVBADATA
+    VMLDRAWING,
+    WORDVBADATA,
+    WORKSHEET
 };
 
 OUString OOX_DLLPUBLIC getRelationship(Relationship eRelationship);
diff --git a/oox/source/token/relationship.inc b/oox/source/token/relationship.inc
index 56b4426dcc9b..85a459d49697 100644
--- a/oox/source/token/relationship.inc
+++ b/oox/source/token/relationship.inc
@@ -10,7 +10,9 @@
 {Relationship::DIAGRAMDRAWING, "http://schemas.microsoft.com/office/2007/relationships/diagramDrawing"},
 {Relationship::DIAGRAMLAYOUT, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramLayout"},
 {Relationship::DIAGRAMQUICKSTYLE, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramQuickStyle"},
+{Relationship::DRAWING, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing"},
 {Relationship::ENDNOTES, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes"},
+{Relationship::EXTERNALLINKPATH, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath"},
 {Relationship::FONT, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/font"},
 {Relationship::FONTTABLE, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"},
 {Relationship::FOOTER, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer"},
@@ -20,17 +22,20 @@
 {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::NOTESSLIDE, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide"},
 {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::SHAREDSTRINGS, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings"},
 {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"},
-{Relationship::WORDVBADATA, "http://schemas.microsoft.com/office/2006/relationships/wordVbaData"}
+{Relationship::VMLDRAWING, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing"},
+{Relationship::WORDVBADATA, "http://schemas.microsoft.com/office/2006/relationships/wordVbaData"},
+{Relationship::WORKSHEET, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet"}
diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index 62682e07d405..5a0045753612 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -203,7 +203,7 @@ void XclExpSstImpl::SaveXml( XclExpXmlStream& rStrm )
             "sharedStrings.xml",
             rStrm.GetCurrentStream()->getOutputStream(),
             "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",
-            "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" );
+            rtl::OUStringToOString(oox::getRelationship(Relationship::SHAREDSTRINGS), RTL_TEXTENCODING_UTF8).getStr());
     rStrm.PushStream( pSst );
 
     pSst->startElement( XML_sst,
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index f0409324377b..2e32dbb906af 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -72,6 +72,7 @@
 #include <svx/xlnstit.hxx>
 
 #include <oox/token/tokens.hxx>
+#include <oox/token/relationship.hxx>
 #include <oox/export/drawingml.hxx>
 #include <oox/export/chartexport.hxx>
 #include <oox/export/utils.hxx>
@@ -1425,7 +1426,7 @@ void XclExpComments::SaveXml( XclExpXmlStream& rStrm )
             XclXmlUtils::GetStreamName( "../", "comments", mnTab + 1 ),
             rStrm.GetCurrentStream()->getOutputStream(),
             "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",
-            "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" );
+            rtl::OUStringToOString(oox::getRelationship(Relationship::COMMENTS), RTL_TEXTENCODING_UTF8).getStr());
     rStrm.PushStream( rComments );
 
     if( rStrm.getVersion() == oox::core::ISOIEC_29500_2008 )
diff --git a/sc/source/filter/excel/xelink.cxx b/sc/source/filter/excel/xelink.cxx
index b2e8c329f323..6fc4a8294e29 100644
--- a/sc/source/filter/excel/xelink.cxx
+++ b/sc/source/filter/excel/xelink.cxx
@@ -22,6 +22,7 @@
 #include <algorithm>
 #include <formula/errorcodes.hxx>
 #include <oox/token/namespaces.hxx>
+#include <oox/token/relationship.hxx>
 #include <unotools/collatorwrapper.hxx>
 #include <svl/zforlist.hxx>
 #include "document.hxx"
@@ -1671,7 +1672,7 @@ void XclExpSupbook::SaveXml( XclExpXmlStream& rStrm )
     sal_uInt16 nLevel = 0;
     bool bRel = true;
     OUString sId = rStrm.addRelation( pExternalLink->getOutputStream(),
-            "http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLinkPath",
+            oox::getRelationship(Relationship::EXTERNALLINKPATH),
             XclExpHyperlink::BuildFileName( nLevel, bRel, maUrl, GetRoot(), true),
             true );
 
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 4813869a945e..e4ef28b4e4dd 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -48,6 +48,7 @@
 #include <excdoc.hxx>
 
 #include <oox/token/tokens.hxx>
+#include <oox/token/relationship.hxx>
 #include <formula/grammar.hxx>
 #include <oox/export/drawingml.hxx>
 #include <oox/ole/vbaexport.hxx>
@@ -1079,7 +1080,7 @@ bool XclExpXmlStream::exportDocument()
     PushStream( CreateOutputStream( workbook, workbook,
                                     uno::Reference <XOutputStream>(),
                                     pWorkbookContentType,
-                                    "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" ) );
+                                    rtl::OUStringToOString(oox::getRelationship(Relationship::OFFICEDOCUMENT), RTL_TEXTENCODING_UTF8).getStr() ) );
 
     if (mbExportVBA)
     {
@@ -1096,7 +1097,7 @@ bool XclExpXmlStream::exportDocument()
                 openFragmentStream("xl/vbaProject.bin", "application/vnd.ms-office.vbaProject");
             comphelper::OStorageHelper::CopyInputToOutput(xVBAStream, xVBAOutput);
 
-            addRelation(GetCurrentStream()->getOutputStream(), "http://schemas.microsoft.com/office/2006/relationships/vbaProject", "vbaProject.bin");
+            addRelation(GetCurrentStream()->getOutputStream(), oox::getRelationship(Relationship::VBAPROJECT), "vbaProject.bin");
         }
     }
 
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 93c269544ffc..f51232e9692a 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -54,6 +54,7 @@
 #include <oox/export/utils.hxx>
 #include <oox/token/tokens.hxx>
 #include <oox/token/namespaces.hxx>
+#include <oox/token/relationship.hxx>
 #include <o3tl/make_unique.hxx>
 
 using namespace ::com::sun::star;
@@ -3138,7 +3139,7 @@ void XclExpXmlStyleSheet::SaveXml( XclExpXmlStream& rStrm )
             "styles.xml",
             rStrm.GetCurrentStream()->getOutputStream(),
             "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",
-            "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" );
+            rtl::OUStringToOString(oox::getRelationship(Relationship::STYLES), RTL_TEXTENCODING_UTF8).getStr());
     rStrm.PushStream( aStyleSheet );
 
     aStyleSheet->startElement( XML_styleSheet,
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index 85d7ceac9dfb..96f6670ec1d0 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -75,6 +75,7 @@
 #include <com/sun/star/chart2/XChartTypeContainer.hpp>
 #include <oox/token/tokens.hxx>
 #include <oox/token/namespaces.hxx>
+#include <oox/token/relationship.hxx>
 #include <oox/export/shapes.hxx>
 #include <oox/export/utils.hxx>
 #include <oox/export/vmlexport.hxx>
@@ -253,7 +254,7 @@ void SaveDrawingMLObjects( XclExpObjList& rList, XclExpXmlStream& rStrm, sal_Int
             XclXmlUtils::GetStreamName( "../", "drawings/drawing", nDrawing ),
             rStrm.GetCurrentStream()->getOutputStream(),
             "application/vnd.openxmlformats-officedocument.drawing+xml",
-            "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",
+            rtl::OUStringToOString(oox::getRelationship(Relationship::DRAWING), RTL_TEXTENCODING_UTF8).getStr(),
             &sId );
 
     rStrm.GetCurrentStream()->singleElement( XML_drawing,
@@ -287,7 +288,7 @@ void SaveVmlObjects( XclExpObjList& rList, XclExpXmlStream& rStrm, sal_Int32& nV
             XclXmlUtils::GetStreamName( "../", "drawings/vmlDrawing", nDrawing ),
             rStrm.GetCurrentStream()->getOutputStream(),
             "application/vnd.openxmlformats-officedocument.vmlDrawing",
-            "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing",
+            rtl::OUStringToOString(oox::getRelationship(Relationship::VMLDRAWING), RTL_TEXTENCODING_UTF8).getStr(),
             &sId );
 
     rStrm.GetCurrentStream()->singleElement( XML_legacyDrawing,
@@ -1267,7 +1268,7 @@ void ExcBundlesheet8::SaveXml( XclExpXmlStream& rStrm )
             XclXmlUtils::GetStreamName( nullptr, "worksheets/sheet", nTab+1),
             rStrm.GetCurrentStream()->getOutputStream(),
             "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",
-            "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet",
+            rtl::OUStringToOString(oox::getRelationship(Relationship::WORKSHEET), RTL_TEXTENCODING_UTF8).getStr(),
             &sId );
 
     rStrm.GetCurrentStream()->singleElement( XML_sheet,


More information about the Libreoffice-commits mailing list