[Libreoffice-commits] core.git: 5 commits - formula/source include/formula sc/CppunitTest_sc_ucalc.mk sc/Library_sc.mk sc/qa sc/source xmloff/source

Markus Mohrhard markus.mohrhard at googlemail.com
Sun Jun 16 07:10:20 PDT 2013


 formula/source/core/resource/core_resource.src |   11 +
 include/formula/compiler.hrc                   |    6 
 include/formula/opcode.hxx                     |    2 
 sc/CppunitTest_sc_ucalc.mk                     |    7 
 sc/Library_sc.mk                               |    3 
 sc/qa/unit/ucalc.cxx                           |    4 
 sc/source/core/inc/interpre.hxx                |    3 
 sc/source/core/tool/interpr4.cxx               |    2 
 sc/source/core/tool/interpr7.cxx               |  194 +++++++++++++++++++++++++
 sc/source/ui/src/scfuncs.src                   |   53 ++++++
 xmloff/source/chart/SchXMLTableContext.cxx     |    4 
 11 files changed, 280 insertions(+), 9 deletions(-)

New commits:
commit 7f73b52db74dd3df2784de1ac40e2a4c535446ae
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Jun 16 15:33:30 2013 +0200

    some small improvements for the FILTERXML function
    
    Change-Id: I4b4e814d90592f318afb3a9a6965ad8e3df07cae

diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index 510dedd..b3363bc 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -107,35 +107,46 @@ void ScInterpreter::ScFilterXML()
                             aResult = OUString::createFromAscii((char*)pChar2.get());
                         }
                     }
+                    else
+                    {
+                        PushError( errNoValue );
+                        return;
+                    }
                 }
+                PushString(aResult);
                 break;
             case XPATH_BOOLEAN:
-                assert(false);
+                {
+                    bool bVal = pXPathObj->boolval != 0;
+                    PushDouble(bVal);
+                }
                 break;
             case XPATH_NUMBER:
-                assert(false);
+                {
+                    double fVal = pXPathObj->floatval;
+                    PushDouble(fVal);
+                }
                 break;
             case XPATH_STRING:
-                assert(false);
+                PushString(OUString::createFromAscii((char*)pXPathObj->stringval));
                 break;
             case XPATH_POINT:
-                assert(false);
+                PushNoValue();
                 break;
             case XPATH_RANGE:
-                assert(false);
+                PushNoValue();
                 break;
             case XPATH_LOCATIONSET:
-                assert(false);
+                PushNoValue();
                 break;
             case XPATH_USERS:
-                assert(false);
+                PushNoValue();
                 break;
             case XPATH_XSLT_TREE:
-                assert(false);
+                PushNoValue();
                 break;
 
         }
-        PushString(aResult);
     }
 }
 
commit a29d20932c89685e7a72f05efb25177cb178fd22
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Jun 16 14:00:56 2013 +0200

    add initial version of WEBSERVICE function
    
    Change-Id: I8a835278c0d1b8f3a463aa5765b145410605aba4

diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src
index e0123f5..e6d3474 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -363,6 +363,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
     String SC_OPCODE_ERROR_NUM     { Text = "#NUM!"   ; };
     String SC_OPCODE_ERROR_NA      { Text = "#N/A"    ; };
     String SC_OPCODE_FILTERXML     { Text = "COM.MICROSOFT.FILTERXML";};
+    String SC_OPCODE_WEBSERVICE    { Text = "COM.MICROSOFT.WEBSERVICE"; };
     /* END defined ERROR.TYPE() values. */
 };
 // DO NOT CHANGE!
@@ -2001,6 +2002,10 @@ Resource RID_STRLIST_FUNCTION_NAMES
     {
         Text [ en-US ] = "FILTERXML";
     };
+    String SC_OPCODE_WEBSERVICE
+    {
+        Text [ en-US ] = "WEBSERVICE";
+    };
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index fd7453d..91a3d3f 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -408,9 +408,10 @@
 #define SC_OPCODE_LEFTB             410
 #define SC_OPCODE_MIDB              412
 #define SC_OPCODE_FILTERXML         413
-#define SC_OPCODE_LAST_OPCODE_ID    414     /* last OpCode */
+#define SC_OPCODE_WEBSERVICE        414
+#define SC_OPCODE_LAST_OPCODE_ID    415     /* last OpCode */
 
-#define SC_OPCODE_STOP_FUNCTION     415
+#define SC_OPCODE_STOP_FUNCTION     416
 
 /*** Internal ***/
 #define SC_OPCODE_INTERNAL_BEGIN   9999
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 5ebaa6b..2df6e79 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -402,6 +402,7 @@ enum OpCodeEnum
         ocGetPivotData      = SC_OPCODE_GET_PIVOT_DATA,
         ocEuroConvert       = SC_OPCODE_EUROCONVERT,
         ocFilterXML         = SC_OPCODE_FILTERXML,
+        ocWebservice        = SC_OPCODE_WEBSERVICE,
     // internal stuff
         ocInternalBegin     = SC_OPCODE_INTERNAL_BEGIN,
         ocTTT               = SC_OPCODE_TTT,
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index d3be23c..1e66b52 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5392,6 +5392,7 @@ void Test::testFunctionLists()
         "UNICODE",
         "UPPER",
         "VALUE",
+        "WEBSERVICE",
         0
     };
 
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 36109ee..df9ffaa 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -794,6 +794,7 @@ void ScLeftB();
 void ScMidB();
 
 void ScFilterXML();
+void ScWebservice();
 
 static const double fMaxGammaArgument;
 
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 016345a..101b2bf 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -4029,7 +4029,8 @@ StackVar ScInterpreter::Interpret()
                 case ocZW               : ScZW();                       break;
                 case ocZZR              : ScZZR();                      break;
                 case ocZins             : ScZins();                     break;
-                case ocFilterXML        : ScFilterXML();                     break;
+                case ocFilterXML        : ScFilterXML();                break;
+                case ocWebservice       : ScWebservice();               break;
                 case ocZinsZ            : ScZinsZ();                    break;
                 case ocKapz             : ScKapz();                     break;
                 case ocKumZinsZ         : ScKumZinsZ();                 break;
diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index 52b3620..510dedd 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -11,9 +11,18 @@
  */
 
 #include "interpre.hxx"
+#include <rtl/strbuf.hxx>
+
+#include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
+#include <com/sun/star/ucb/SimpleFileAccess.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+
 #include "libxml/xpath.h"
 
 #include <boost/shared_ptr.hpp>
+#include <cstring>
+
+using namespace com::sun::star;
 
 // TODO: Add new methods for ScInterpreter here.
 
@@ -24,16 +33,29 @@ void ScInterpreter::ScFilterXML()
     {
         OUString aXPathExpression = GetString();
         OUString aString = GetString();
+        if(aString.isEmpty() || aXPathExpression.isEmpty())
+        {
+            PushError( errNoValue );
+            return;
+        }
 
-        const char* pXPathExpr = OUStringToOString( aXPathExpression, RTL_TEXTENCODING_UTF8 ).getStr();
-        const char* pXML = OUStringToOString( aString, RTL_TEXTENCODING_UTF8 ).getStr();
+        OString aOXPathExpression = OUStringToOString( aXPathExpression, RTL_TEXTENCODING_UTF8 );
+        const char* pXPathExpr = aOXPathExpression.getStr();
+        OString aOString = OUStringToOString( aString, RTL_TEXTENCODING_UTF8 );
+        const char* pXML = aOString.getStr();
 
         boost::shared_ptr<xmlParserCtxt> pContext(
                 xmlNewParserCtxt(), xmlFreeParserCtxt );
 
-        boost::shared_ptr<xmlDoc> pDoc( xmlParseMemory( pXML, aString.getLength() ),
+        boost::shared_ptr<xmlDoc> pDoc( xmlParseMemory( pXML, aOString.getLength() ),
                 xmlFreeDoc );
 
+        if(!pDoc)
+        {
+            PushError( errNoValue );
+            return;
+        }
+
 
         boost::shared_ptr<xmlXPathContext> pXPathCtx( xmlXPathNewContext(pDoc.get()),
                 xmlXPathFreeContext );
@@ -41,6 +63,14 @@ void ScInterpreter::ScFilterXML()
         boost::shared_ptr<xmlXPathObject> pXPathObj( xmlXPathEvalExpression(BAD_CAST(pXPathExpr), pXPathCtx.get()),
                 xmlXPathFreeObject );
 
+        if(!pXPathObj)
+        {
+            PushError( errNoValue );
+            return;
+        }
+
+        rtl::OUString aResult;
+
         switch(pXPathObj->type)
         {
             case XPATH_UNDEFINED:
@@ -48,6 +78,12 @@ void ScInterpreter::ScFilterXML()
             case XPATH_NODESET:
                 {
                     xmlNodeSetPtr pNodeSet = pXPathObj->nodesetval;
+                    if(!pNodeSet)
+                    {
+                        PushError( errNoValue );
+                        return;
+                    }
+
                     size_t nSize = pNodeSet->nodeNr;
                     if( nSize >= 1 )
                     {
@@ -56,22 +92,19 @@ void ScInterpreter::ScFilterXML()
                             xmlNsPtr ns = (xmlNsPtr)pNodeSet->nodeTab[0];
                             xmlNodePtr cur = (xmlNodePtr)ns->next;
                             boost::shared_ptr<xmlChar> pChar2(xmlNodeGetContent(cur), xmlFree);
-                            OUString aResult = OUString::createFromAscii((char*)pChar2.get());
-                            PushString(aResult);
+                            aResult = OUString::createFromAscii((char*)pChar2.get());
                         }
                         else if(pNodeSet->nodeTab[0]->type == XML_ELEMENT_NODE)
                         {
                             xmlNodePtr cur = pNodeSet->nodeTab[0];
                             boost::shared_ptr<xmlChar> pChar2(xmlNodeGetContent(cur), xmlFree);
-                            OUString aResult = OUString::createFromAscii((char*)pChar2.get());
-                            PushString(aResult);
+                            aResult = OUString::createFromAscii((char*)pChar2.get());
                         }
                         else
                         {
                             xmlNodePtr cur = pNodeSet->nodeTab[0];
                             boost::shared_ptr<xmlChar> pChar2(xmlNodeGetContent(cur), xmlFree);
-                            OUString aResult = OUString::createFromAscii((char*)pChar2.get());
-                            PushString(aResult);
+                            aResult = OUString::createFromAscii((char*)pChar2.get());
                         }
                     }
                 }
@@ -102,9 +135,66 @@ void ScInterpreter::ScFilterXML()
                 break;
 
         }
-
+        PushString(aResult);
     }
+}
+
+void ScInterpreter::ScWebservice()
+{
+    sal_uInt8 nParamCount = GetByte();
+    if (MustHaveParamCount( nParamCount, 1 ) )
+    {
+        OUString aURI = GetString();
 
+        if(aURI.isEmpty())
+        {
+            PushError( errNoValue );
+            return;
+        }
+
+        uno::Reference< ucb::XSimpleFileAccess3 > xFileAccess( ucb::SimpleFileAccess::create( comphelper::getProcessComponentContext() ), uno::UNO_QUERY );
+        if(!xFileAccess.is())
+        {
+            PushError( errNoValue );
+            return;
+        }
+
+        uno::Reference< io::XInputStream > xStream;
+        try {
+            xStream = xFileAccess->openFileRead( aURI );
+        }
+        catch (...)
+        {
+            // don't let any exceptions pass
+            PushError( errNoValue );
+            return;
+        }
+        if ( !xStream.is() )
+        {
+            PushError( errNoValue );
+            return;
+        }
+
+        const sal_Int32 BUF_LEN = 8000;
+        uno::Sequence< sal_Int8 > buffer( BUF_LEN );
+        OStringBuffer aBuffer( 64000 );
+
+        sal_Int32 nRead = 0;
+        while ( ( nRead = xStream->readBytes( buffer, BUF_LEN ) ) == BUF_LEN )
+        {
+            aBuffer.append( reinterpret_cast< const char* >( buffer.getConstArray() ), nRead );
+        }
+
+        if ( nRead > 0 )
+        {
+            aBuffer.append( reinterpret_cast< const char* >( buffer.getConstArray() ), nRead );
+        }
+
+        xStream->closeInput();
+
+        OUString aContent = OStringToOUString( aBuffer.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
+        PushString( aContent );
+    }
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index 702abcd..079af96 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -9762,6 +9762,29 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
             Text [ en-US ] = "String containing a valid XPath expression";
         };
     };
+    Resource SC_OPCODE_WEBSERVICE
+    {
+        String 1 // Description
+        {
+            Text [ en-US] = "Get some webcontent from an URI.";
+        };
+        ExtraData =
+        {
+            0;
+            ID_FUNCTION_GRP_TEXT;
+            U2S( HID_FUNC_BITLSHIFT );
+            1; 0; 0;
+            0;
+        };
+        String 2 // Name of Parameter 1
+        {
+            Text [ en-US ] = "URI";
+        };
+        String 3 // Description of Parameter 1
+        {
+            Text [ en-US ] = "URI of the webservice";
+        };
+    };
 };
 
 #if defined(U2S)
commit 6e283043ee0e268b97653de5819b90e08e1944ad
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Jun 16 01:19:56 2013 +0200

    use ASSERT_EQUAL to get better diagnostic message
    
    Change-Id: I51d92e6d7a012bb9daf5eba5f982fa4bffbba28e

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 734b172..d3be23c 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5422,7 +5422,7 @@ void Test::testFunctionLists()
         for (sal_uInt32 j = 0; j < nFuncCount; ++j)
         {
             const formula::IFunctionDescription* pFunc = pCat->getFunction(j);
-            CPPUNIT_ASSERT_MESSAGE("Unexpected function name", pFunc->getFunctionName().equalsAscii(aTests[i].Functions[j]));
+            CPPUNIT_ASSERT_EQUAL_MESSAGE("Unexpected function name", pFunc->getFunctionName(), OUString::createFromAscii(aTests[i].Functions[j]));
         }
     }
 }
commit 3b9620e18bdcb91a229e9aefef5192f346030b52
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Jun 16 01:19:22 2013 +0200

    inital work on FILTERXML function
    
    Change-Id: Ifb884a52b275df818812f8be6cd7650dcb97849d

diff --git a/formula/source/core/resource/core_resource.src b/formula/source/core/resource/core_resource.src
index f4c5f96..e0123f5 100644
--- a/formula/source/core/resource/core_resource.src
+++ b/formula/source/core/resource/core_resource.src
@@ -362,6 +362,7 @@ Resource RID_STRLIST_FUNCTION_NAMES_ENGLISH_ODFF
     String SC_OPCODE_ERROR_NAME    { Text = "#NAME?"  ; };
     String SC_OPCODE_ERROR_NUM     { Text = "#NUM!"   ; };
     String SC_OPCODE_ERROR_NA      { Text = "#N/A"    ; };
+    String SC_OPCODE_FILTERXML     { Text = "COM.MICROSOFT.FILTERXML";};
     /* END defined ERROR.TYPE() values. */
 };
 // DO NOT CHANGE!
@@ -1995,6 +1996,11 @@ Resource RID_STRLIST_FUNCTION_NAMES
         Text [ en-US ] = "#N/A" ;
     };
     /* END defined ERROR.TYPE() values. */
+
+    String SC_OPCODE_FILTERXML
+    {
+        Text [ en-US ] = "FILTERXML";
+    };
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/formula/compiler.hrc b/include/formula/compiler.hrc
index e6c6ef3..fd7453d 100644
--- a/include/formula/compiler.hrc
+++ b/include/formula/compiler.hrc
@@ -407,9 +407,10 @@
 #define SC_OPCODE_RIGHTB            409
 #define SC_OPCODE_LEFTB             410
 #define SC_OPCODE_MIDB              412
-#define SC_OPCODE_LAST_OPCODE_ID    413     /* last OpCode */
+#define SC_OPCODE_FILTERXML         413
+#define SC_OPCODE_LAST_OPCODE_ID    414     /* last OpCode */
 
-#define SC_OPCODE_STOP_FUNCTION     412
+#define SC_OPCODE_STOP_FUNCTION     415
 
 /*** Internal ***/
 #define SC_OPCODE_INTERNAL_BEGIN   9999
diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx
index 47e2cdc..5ebaa6b 100644
--- a/include/formula/opcode.hxx
+++ b/include/formula/opcode.hxx
@@ -401,6 +401,7 @@ enum OpCodeEnum
         ocHyperLink         = SC_OPCODE_HYPERLINK,
         ocGetPivotData      = SC_OPCODE_GET_PIVOT_DATA,
         ocEuroConvert       = SC_OPCODE_EUROCONVERT,
+        ocFilterXML         = SC_OPCODE_FILTERXML,
     // internal stuff
         ocInternalBegin     = SC_OPCODE_INTERNAL_BEGIN,
         ocTTT               = SC_OPCODE_TTT,
diff --git a/sc/CppunitTest_sc_ucalc.mk b/sc/CppunitTest_sc_ucalc.mk
index dd1e64d..0933cb5 100644
--- a/sc/CppunitTest_sc_ucalc.mk
+++ b/sc/CppunitTest_sc_ucalc.mk
@@ -23,13 +23,14 @@ endif
 
 $(eval $(call gb_CppunitTest_use_externals,sc_ucalc,\
 	boost_headers \
-	mdds_headers \
-	orcus \
-	orcus-parser \
     icu_headers \
     icudata \
     icui18n \
     icuuc \
+	libxml2 \
+	mdds_headers \
+	orcus \
+	orcus-parser \
 ))
 
 $(eval $(call gb_CppunitTest_use_libraries,sc_ucalc, \
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 189d7e2..dba982b 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -37,11 +37,12 @@ $(eval $(call gb_Library_use_sdk_api,sc))
 
 $(eval $(call gb_Library_use_externals,sc,\
 	boost_headers \
-	mdds_headers \
     icu_headers \
     icudata \
     icui18n \
     icuuc \
+	libxml2 \
+	mdds_headers \
 ))
 
 ifeq ($(ENABLE_TELEPATHY),TRUE)
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 686521d..734b172 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5365,6 +5365,7 @@ void Test::testFunctionLists()
         "DECIMAL",
         "DOLLAR",
         "EXACT",
+        "FILTERXML",
         "FIND",
         "FIXED",
         "JIS",
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index 102b9b0..36109ee 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -793,6 +793,8 @@ void ScRightB();
 void ScLeftB();
 void ScMidB();
 
+void ScFilterXML();
+
 static const double fMaxGammaArgument;
 
 double GetGammaContFraction(double fA,double fX);
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 60383f0..016345a 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -4029,6 +4029,7 @@ StackVar ScInterpreter::Interpret()
                 case ocZW               : ScZW();                       break;
                 case ocZZR              : ScZZR();                      break;
                 case ocZins             : ScZins();                     break;
+                case ocFilterXML        : ScFilterXML();                     break;
                 case ocZinsZ            : ScZinsZ();                    break;
                 case ocKapz             : ScKapz();                     break;
                 case ocKumZinsZ         : ScKumZinsZ();                 break;
diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index 1ea0f3b..52b3620 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -11,7 +11,100 @@
  */
 
 #include "interpre.hxx"
+#include "libxml/xpath.h"
+
+#include <boost/shared_ptr.hpp>
 
 // TODO: Add new methods for ScInterpreter here.
 
+void ScInterpreter::ScFilterXML()
+{
+    sal_uInt8 nParamCount = GetByte();
+    if (MustHaveParamCount( nParamCount, 2 ) )
+    {
+        OUString aXPathExpression = GetString();
+        OUString aString = GetString();
+
+        const char* pXPathExpr = OUStringToOString( aXPathExpression, RTL_TEXTENCODING_UTF8 ).getStr();
+        const char* pXML = OUStringToOString( aString, RTL_TEXTENCODING_UTF8 ).getStr();
+
+        boost::shared_ptr<xmlParserCtxt> pContext(
+                xmlNewParserCtxt(), xmlFreeParserCtxt );
+
+        boost::shared_ptr<xmlDoc> pDoc( xmlParseMemory( pXML, aString.getLength() ),
+                xmlFreeDoc );
+
+
+        boost::shared_ptr<xmlXPathContext> pXPathCtx( xmlXPathNewContext(pDoc.get()),
+                xmlXPathFreeContext );
+
+        boost::shared_ptr<xmlXPathObject> pXPathObj( xmlXPathEvalExpression(BAD_CAST(pXPathExpr), pXPathCtx.get()),
+                xmlXPathFreeObject );
+
+        switch(pXPathObj->type)
+        {
+            case XPATH_UNDEFINED:
+                break;
+            case XPATH_NODESET:
+                {
+                    xmlNodeSetPtr pNodeSet = pXPathObj->nodesetval;
+                    size_t nSize = pNodeSet->nodeNr;
+                    if( nSize >= 1 )
+                    {
+                        if(pNodeSet->nodeTab[0]->type == XML_NAMESPACE_DECL)
+                        {
+                            xmlNsPtr ns = (xmlNsPtr)pNodeSet->nodeTab[0];
+                            xmlNodePtr cur = (xmlNodePtr)ns->next;
+                            boost::shared_ptr<xmlChar> pChar2(xmlNodeGetContent(cur), xmlFree);
+                            OUString aResult = OUString::createFromAscii((char*)pChar2.get());
+                            PushString(aResult);
+                        }
+                        else if(pNodeSet->nodeTab[0]->type == XML_ELEMENT_NODE)
+                        {
+                            xmlNodePtr cur = pNodeSet->nodeTab[0];
+                            boost::shared_ptr<xmlChar> pChar2(xmlNodeGetContent(cur), xmlFree);
+                            OUString aResult = OUString::createFromAscii((char*)pChar2.get());
+                            PushString(aResult);
+                        }
+                        else
+                        {
+                            xmlNodePtr cur = pNodeSet->nodeTab[0];
+                            boost::shared_ptr<xmlChar> pChar2(xmlNodeGetContent(cur), xmlFree);
+                            OUString aResult = OUString::createFromAscii((char*)pChar2.get());
+                            PushString(aResult);
+                        }
+                    }
+                }
+                break;
+            case XPATH_BOOLEAN:
+                assert(false);
+                break;
+            case XPATH_NUMBER:
+                assert(false);
+                break;
+            case XPATH_STRING:
+                assert(false);
+                break;
+            case XPATH_POINT:
+                assert(false);
+                break;
+            case XPATH_RANGE:
+                assert(false);
+                break;
+            case XPATH_LOCATIONSET:
+                assert(false);
+                break;
+            case XPATH_USERS:
+                assert(false);
+                break;
+            case XPATH_XSLT_TREE:
+                assert(false);
+                break;
+
+        }
+
+    }
+
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/src/scfuncs.src b/sc/source/ui/src/scfuncs.src
index 87b9cdd..702abcd 100644
--- a/sc/source/ui/src/scfuncs.src
+++ b/sc/source/ui/src/scfuncs.src
@@ -9730,6 +9730,36 @@ Resource RID_SC_FUNCTION_DESCRIPTIONS2
         String 7 // Description of Parameter 3
         {
             Text [ en-US ] = "The number of characters for the text." ;
+        }
+    Resource SC_OPCODE_FILTERXML
+    {
+        ExtraData =
+        {
+            0;
+            ID_FUNCTION_GRP_TEXT;
+            U2S( HID_FUNC_BITLSHIFT );
+            2; 0; 0;
+            0;
+        }
+        String 1 // Description
+        {
+            Text [ en-US ] = "Apply an XPath expression to an XML document";
+        };
+        String 2 // Name of Parameter 1
+        {
+            Text [ en-US ] = "XML Document";
+        };
+        String 3 // Description of Parameter 1
+        {
+            Text [ en-US ] = "String containing a valid XML stream";
+        };
+        String 4 // Name of parameter 2
+        {
+            Text [ en-US ] = "XPath expression";
+        };
+        String 5 // Description of Parameter 2
+        {
+            Text [ en-US ] = "String containing a valid XPath expression";
         };
     };
 };
commit de8a82d9ac6ce02416aa820f82b5a3ea2598ec1c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Jun 14 09:46:37 2013 +0200

    use the implicit conversion
    
    Change-Id: I1d4739721c297e6d5605d93b6e86e114ea12db85

diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index 206e5e8..6d50672 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -859,8 +859,8 @@ void SchXMLTableHelper::applyTableToInternalDataProvider(
         try
         {
             Reference< beans::XPropertySet > xProps( xChartDoc, uno::UNO_QUERY_THROW );
-            xProps->setPropertyValue( OUString( "DisableDataTableDialog" ), uno::makeAny( sal_True ) );
-            xProps->setPropertyValue( OUString( "DisableComplexChartTypes" ), uno::makeAny( sal_True ) );
+            xProps->setPropertyValue( "DisableDataTableDialog", uno::makeAny( sal_True ) );
+            xProps->setPropertyValue( "DisableComplexChartTypes", uno::makeAny( sal_True ) );
         }
         catch ( uno::Exception& )
         {


More information about the Libreoffice-commits mailing list