xmloff: add a generic LibreOffice ODF extension namespace

XML_NAMESPACE_LO_EXT can be used for elements and attributes that are
not yet specified by OpenDocument.

Change-Id: Id29392533d46f6592d964ce79c05ffefa4d69ebc
Reviewed-on: https://gerrit.libreoffice.org/5419
Tested-by: Thorsten Behrens <tbehrens@suse.com>
Reviewed-by: Thorsten Behrens <tbehrens@suse.com>
diff --git a/include/xmloff/xmlnmspe.hxx b/include/xmloff/xmlnmspe.hxx
index b1646c3..e1b3fdb 100644
--- a/include/xmloff/xmlnmspe.hxx
+++ b/include/xmloff/xmlnmspe.hxx
@@ -82,8 +82,9 @@ XML_NAMESPACE_EXT( TABLE,       38U )
XML_NAMESPACE_EXT( CHART,       39U )
XML_NAMESPACE_EXT( DRAW,        40U )
XML_NAMESPACE_EXT( CALC,        41U )
XML_NAMESPACE_EXT( LO,          42U )

#define _XML_OLD_NAMESPACE_BASE 42U
#define _XML_OLD_NAMESPACE_BASE 43U

// namespaces used in the technical preview (SO 5.2)
XML_OLD_NAMESPACE( FO,      0U )
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 69282ce..be3bbde 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -152,6 +152,9 @@ namespace xmloff { namespace token {
        // calc extensions
        XML_NP_CALC_EXT,
        XML_N_CALC_EXT,
        // generic LO extensions
        XML_NP_LO_EXT,
        XML_N_LO_EXT,

        // units
        XML_UNIT_MM,
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index a8955ca..e5e5cee 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -353,6 +353,9 @@ void SvXMLExport::_InitCtor()
                GetXMLToken(XML_NP_CALC_EXT), GetXMLToken(XML_N_CALC_EXT), XML_NAMESPACE_CALC_EXT);
            mpNamespaceMap->Add(
                GetXMLToken(XML_NP_DRAW_EXT), GetXMLToken(XML_N_DRAW_EXT), XML_NAMESPACE_DRAW_EXT);
            mpNamespaceMap->Add(
                GetXMLToken(XML_NP_LO_EXT), GetXMLToken(XML_N_LO_EXT),
                XML_NAMESPACE_LO_EXT);
        }
    }
    if( (getExportFlags() & (EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 )
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index d59d8b8..b0ae11e 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -371,6 +371,8 @@ void SvXMLImport::_InitCtor()
        mpNamespaceMap->Add( OUString( sXML_np__css3text ), GetXMLToken(XML_N_CSS3TEXT), XML_NAMESPACE_CSS3TEXT );

        mpNamespaceMap->Add( "_calc_libo", GetXMLToken(XML_N_CALC_EXT), XML_NAMESPACE_CALC_EXT);
        mpNamespaceMap->Add( "_office_libo",
                             GetXMLToken(XML_N_LO_EXT), XML_NAMESPACE_LO_EXT);
    }

    msPackageProtocol = "vnd.sun.star.Package:";
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 2c97507..37742e3 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -157,6 +157,8 @@ namespace xmloff { namespace token {
        // extension namespace for calc extensions
        TOKEN( "calcext",                         XML_NP_CALC_EXT ),
        TOKEN( "urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0", XML_N_CALC_EXT ),
        TOKEN( "loext",                           XML_NP_LO_EXT ),
        TOKEN( "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0", XML_N_LO_EXT ),

        // units
        TOKEN( "mm",                              XML_UNIT_MM ),