[Libreoffice-commits] core.git: writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Sun Sep 14 00:34:49 PDT 2014


 writerfilter/source/ooxml/OOXMLFastContextHandler.cxx |    7 ++-----
 writerfilter/source/ooxml/factoryimpl.py              |    4 ++--
 2 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit df344855e1c90e6be333afc143044bb04114c683
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sun Sep 14 09:20:38 2014 +0200

    Use oox::getNamespace()
    
    Change-Id: I43df705a6cf5371ee495336d9dbe2b87020cf0e0

diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 268400d..634af43 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -1797,9 +1797,8 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
     bool bGroupShape = Element == Token_t(NMSP_vml | XML_group);
     // drawingML version also counts as a group shape.
     bGroupShape |= mrShapeContext->getStartToken() == Token_t(NMSP_wpg | XML_wgp);
-    sal_uInt32 nNamespace = Element & 0xffff0000;
 
-    switch (nNamespace)
+    switch (oox::getNamespace(Element))
     {
         case NMSP_doc:
         case NMSP_vmlWord:
@@ -1977,9 +1976,7 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext
 {
     uno::Reference< xml::sax::XFastContextHandler > xResult;
 
-    Id nNameSpace = Element & 0xffff0000;
-
-    bool bInNamespaces = mMyNamespaces.find(nNameSpace) != mMyNamespaces.end();
+    bool bInNamespaces = mMyNamespaces.find(oox::getNamespace(Element)) != mMyNamespaces.end();
     bool bInTokens = mMyTokens.find( Element ) != mMyTokens.end( );
 
     // We have methods to _add_ individual tokens or whole namespaces to be
diff --git a/writerfilter/source/ooxml/factoryimpl.py b/writerfilter/source/ooxml/factoryimpl.py
index dcd6248..c2a627d 100644
--- a/writerfilter/source/ooxml/factoryimpl.py
+++ b/writerfilter/source/ooxml/factoryimpl.py
@@ -64,7 +64,7 @@ def getFactoryForNamespace(model):
 {
     OOXMLFactory_ns::Pointer_t pResult;
 
-    switch (nId & 0xffff0000)
+    switch (oox::getNamespace(nId))
     {""")
 
     for namespace in [ns.getAttribute("name") for ns in model.getElementsByTagName("namespace")]:
@@ -122,7 +122,7 @@ std::string fastTokenToId(sal_uInt32 nToken)
 
     std::string sResult;
 
-    switch (nToken & 0xffff0000)
+    switch (oox::getNamespace(nToken))
     {""")
 
     aliases = []


More information about the Libreoffice-commits mailing list