sc/inc/orcusxml.hxx                   |    2 --
 sc/source/core/tool/orcusxml.cxx      |    8 --------
 sc/source/filter/orcus/xmlcontext.cxx |   20 +++++++-------------
 3 files changed, 7 insertions(+), 23 deletions(-)

New commits:
commit dab53b371a10a341dcea647cb62273a65c984d98
Author: Kohei Yoshida <kohei.yosh...@gmail.com>
Date:   Wed Nov 21 21:19:58 2012 -0500

    Use the method from orcus to get the short version of xml namespace name.
    
    Change-Id: I5d64ae380982c09f53dacb1eac721430674e9a31

diff --git a/sc/inc/orcusxml.hxx b/sc/inc/orcusxml.hxx
index 87be8a2..36c41dd 100644
--- a/sc/inc/orcusxml.hxx
+++ b/sc/inc/orcusxml.hxx
@@ -76,8 +76,6 @@ struct ScOrcusImportXMLParam
     std::vector<size_t> maNamespaces;
     CellLinksType maCellLinks;
     RangeLinksType maRangeLinks;
-
-    SC_DLLPUBLIC static rtl::OString getShortNamespaceName(size_t nIndex);
 };
 
 #endif
diff --git a/sc/source/core/tool/orcusxml.cxx b/sc/source/core/tool/orcusxml.cxx
index cef0333..b3cbd46 100644
--- a/sc/source/core/tool/orcusxml.cxx
+++ b/sc/source/core/tool/orcusxml.cxx
@@ -28,12 +28,4 @@ const ScOrcusXMLTreeParam::EntryData* 
ScOrcusXMLTreeParam::getUserData(const SvT
 ScOrcusImportXMLParam::CellLink::CellLink(const ScAddress& rPos, const 
OString& rPath) :
     maPos(rPos), maPath(rPath) {}
 
-OString ScOrcusImportXMLParam::getShortNamespaceName(size_t nIndex)
-{
-    OStringBuffer aBuf;
-    aBuf.append("ns");
-    aBuf.append(static_cast<sal_Int32>(nIndex));
-    return aBuf.makeStringAndClear();
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/orcus/xmlcontext.cxx 
b/sc/source/filter/orcus/xmlcontext.cxx
index 3ad6951..c62d39b 100644
--- a/sc/source/filter/orcus/xmlcontext.cxx
+++ b/sc/source/filter/orcus/xmlcontext.cxx
@@ -21,6 +21,8 @@
 #include <orcus/orcus_xml.hpp>
 #include <orcus/global.hpp>
 
+#include <string>
+
 namespace {
 
 ScOrcusXMLTreeParam::EntryData& setUserDataToEntry(
@@ -43,17 +45,9 @@ OUString toString(const 
orcus::xml_structure_tree::entity_name& entity, const or
     OUStringBuffer aBuf;
     if (entity.ns)
     {
-        // Namespace exists.  Namespaces are displayed as ns0, ns1, ns2, ....
-        size_t index = walker.get_xmlns_index(entity.ns);
-        if (index == orcus::xml_structure_tree::walker::index_not_found)
-            // This namespace doesn't exist in this context. Something has 
gone wrong.
-            aBuf.append("???");
-        else
-        {
-            OString aName = 
ScOrcusImportXMLParam::getShortNamespaceName(index);
-            aBuf.append(OUString(aName.getStr(), aName.getLength(), 
RTL_TEXTENCODING_UTF8));
-        }
-
+        // Namespace exists.  Use the short version of the xml namespace name 
for display.
+        std::string aShortName = walker.get_xmlns_short_name(entity.ns);
+        aBuf.appendAscii(aShortName.c_str());
         aBuf.append(':');
     }
     aBuf.append(OUString(entity.name.get(), entity.name.size(), 
RTL_TEXTENCODING_UTF8));
@@ -212,8 +206,8 @@ public:
         if (nsid == orcus::XMLNS_UNKNOWN_ID)
             return;
 
-        OString aAlias = ScOrcusImportXMLParam::getShortNamespaceName(index);
-        mrFilter.set_namespace_alias(aAlias.getStr(), nsid);
+        std::string alias = mrNsRepo.get_short_name(index);
+        mrFilter.set_namespace_alias(alias.c_str(), nsid);
     }
 };
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to