diff options
author | Joachim Lingner <jl@openoffice.org> | 2004-04-27 14:22:15 +0000 |
---|---|---|
committer | Joachim Lingner <jl@openoffice.org> | 2004-04-27 14:22:15 +0000 |
commit | c6ee6abeaf48d85946a022c4867d5ed54742f446 (patch) | |
tree | aaab6fbca5bcbba239488c1f22ee456af68aacf2 /jvmfwk/source | |
parent | f17a9b4b44a1c01dd128916e07e047584db98538 (diff) |
#i20052#
Diffstat (limited to 'jvmfwk/source')
-rw-r--r-- | jvmfwk/source/elements.cxx | 97 | ||||
-rw-r--r-- | jvmfwk/source/framework.cxx | 54 | ||||
-rw-r--r-- | jvmfwk/source/fwkutil.cxx | 58 | ||||
-rw-r--r-- | jvmfwk/source/libxmlutil.cxx | 18 | ||||
-rw-r--r-- | jvmfwk/source/libxmlutil.hxx | 12 | ||||
-rw-r--r-- | jvmfwk/source/makefile.mk | 7 |
6 files changed, 140 insertions, 106 deletions
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx index 306ab28ffc44..64d3edde0e93 100644 --- a/jvmfwk/source/elements.cxx +++ b/jvmfwk/source/elements.cxx @@ -2,9 +2,9 @@ * * $RCSfile: elements.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: jl $ $Date: 2004-04-26 15:52:14 $ + * last change: $Author: jl $ $Date: 2004-04-27 15:22:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,7 +67,7 @@ #include <algorithm> #include "libxml/parser.h" #include "libxml/xpath.h" -#include "libxml/xpathinternals.h" +#include "libxml/xpathInternals.h" // #define NS_JAVA_FRAMEWORK "http://openoffice.org/2004/java/framework/1.0" // #define NS_SCHEMA_INSTANCE "http://www.w3.org/2001/XMLSchema-instance" @@ -98,18 +98,19 @@ javaFrameworkError getElementUpdated(rtl::OString & sValue) javaFrameworkError errcode = JFW_E_NONE; //Prepare the xml document and context rtl::OString sSettingsPath = jfw::getVendorSettingsPath(); - jfw::CXmlDocPtr doc = xmlParseFile(sSettingsPath.getStr()); + jfw::CXmlDocPtr doc(xmlParseFile(sSettingsPath.getStr())); if (doc == NULL) { OSL_ASSERT(0); return JFW_E_CONFIG_READWRITE; } - jfw::CXPathContextPtr context = xmlXPathNewContext(doc); + jfw::CXPathContextPtr context(xmlXPathNewContext(doc)); int reg = xmlXPathRegisterNs(context, (xmlChar*) "jf", (xmlChar*) NS_JAVA_FRAMEWORK); if (reg == -1) return JFW_E_ERROR; - CXPathObjectPtr pathObj = xmlXPathEvalExpression( + CXPathObjectPtr pathObj; + pathObj = xmlXPathEvalExpression( (xmlChar*)"/jf:javaSelection/jf:updated/text()", context); if (xmlXPathNodeSetIsEmpty(pathObj->nodesetval)) return JFW_E_FORMAT_STORE; @@ -133,7 +134,7 @@ javaFrameworkError createUserSettingsDocument() return JFW_E_ERROR; //javasettings.xml does not exist yet - CXmlDocPtr doc = xmlNewDoc((xmlChar *)"1.0"); + CXmlDocPtr doc(xmlNewDoc((xmlChar *)"1.0")); if (! doc) return JFW_E_ERROR; //Create a comment @@ -283,7 +284,7 @@ javaFrameworkError copyShareSettings(xmlDoc * doc, xmlNode * userParent) //Prepare access to share javasettings.xml rtl::OString sSettings = getSharedSettingsPathNoPlatformSuffix(); - CXmlDocPtr docShare = xmlParseFile(sSettings.getStr()); + CXmlDocPtr docShare(xmlParseFile(sSettings.getStr())); if (docShare == NULL) return JFW_E_CONFIG_READWRITE; contextShare = xmlXPathNewContext(docShare); @@ -298,7 +299,8 @@ javaFrameworkError copyShareSettings(xmlDoc * doc, xmlNode * userParent) if ( ! pathObj || xmlXPathNodeSetIsEmpty(pathObj->nodesetval)) return JFW_E_FORMAT_STORE; - CXmlCharPtr sClasses = xmlNodeListGetString( + CXmlCharPtr sClasses; + sClasses = xmlNodeListGetString( docShare, pathObj->nodesetval->nodeTab[0], 1); xmlNode* userClasses = @@ -316,7 +318,7 @@ javaFrameworkError prepareSettingsDocument() return errcode; rtl::OString sSettings = getUserSettingsPath(); - CXmlDocPtr doc = xmlParseFile(sSettings.getStr()); + CXmlDocPtr doc(xmlParseFile(sSettings.getStr())); if (!doc) return JFW_E_CONFIG_READWRITE; @@ -409,13 +411,14 @@ javaFrameworkError CNodeJava::loadUserSettings() if (cur == NULL || cur->children == NULL) return JFW_E_FORMAT_STORE; + CXmlCharPtr sNil; cur = cur->children; while (cur != NULL) { if (xmlStrcmp(cur->name, (xmlChar*) "enabled") == 0) { //only overwrite share settings if xsi:nil="false" - CXmlCharPtr sNil = xmlGetNsProp( + sNil = xmlGetNsProp( cur, (xmlChar*) "nil", (xmlChar*) NS_SCHEMA_INSTANCE); if (sNil == NULL) { @@ -424,7 +427,8 @@ javaFrameworkError CNodeJava::loadUserSettings() } if (xmlStrcmp(sNil, (xmlChar*) "false") == 0) { - CXmlCharPtr sEnabled = xmlNodeListGetString( + CXmlCharPtr sEnabled; + sEnabled = xmlNodeListGetString( docUser, cur->children, 1); if (xmlStrcmp(sEnabled, (xmlChar*) "true") == 0) m_bEnabled = sal_True; @@ -436,13 +440,14 @@ javaFrameworkError CNodeJava::loadUserSettings() } else if (xmlStrcmp(cur->name, (xmlChar*) "classesDirectory") == 0) { - CXmlCharPtr sCls = xmlNodeListGetString( + CXmlCharPtr sCls; + sCls = xmlNodeListGetString( docUser, cur->children, 1); m_sClassesDirectory = sCls; } else if (xmlStrcmp(cur->name, (xmlChar*) "userClassPath") == 0) { - CXmlCharPtr sNil = xmlGetNsProp( + sNil = xmlGetNsProp( cur, (xmlChar*) "nil", (xmlChar*) NS_SCHEMA_INSTANCE); if (sNil == NULL) { @@ -451,14 +456,15 @@ javaFrameworkError CNodeJava::loadUserSettings() } if (xmlStrcmp(sNil, (xmlChar*) "false") == 0) { - CXmlCharPtr sUser = xmlNodeListGetString( + CXmlCharPtr sUser; + sUser = xmlNodeListGetString( docUser, cur->children, 1); m_sUserClassPath = sUser; } } else if (xmlStrcmp(cur->name, (xmlChar*) "javaInfo") == 0) { - CXmlCharPtr sNil = xmlGetNsProp( + sNil = xmlGetNsProp( cur, (xmlChar*) "nil", (xmlChar*) NS_SCHEMA_INSTANCE); if (sNil == NULL) { @@ -472,7 +478,7 @@ javaFrameworkError CNodeJava::loadUserSettings() } else if (xmlStrcmp(cur->name, (xmlChar*) "vmParameters") == 0) { - CXmlCharPtr sNil = xmlGetNsProp( + sNil = xmlGetNsProp( cur, (xmlChar*) "nil", (xmlChar*) NS_SCHEMA_INSTANCE); if (sNil == NULL) { @@ -488,7 +494,8 @@ javaFrameworkError CNodeJava::loadUserSettings() { if (xmlStrcmp(pOpt->name, (xmlChar*) "param") == 0) { - CXmlCharPtr sOpt = xmlNodeListGetString( + CXmlCharPtr sOpt; + sOpt = xmlNodeListGetString( docUser, pOpt->children, 1); m_arVmParameters.push_back(sOpt); } @@ -498,7 +505,7 @@ javaFrameworkError CNodeJava::loadUserSettings() } else if (xmlStrcmp(cur->name, (xmlChar*) "jreLocations") == 0) { - CXmlCharPtr sNil = xmlGetNsProp( + sNil = xmlGetNsProp( cur, (xmlChar*) "nil", (xmlChar*) NS_SCHEMA_INSTANCE); if (sNil == NULL) { @@ -514,7 +521,8 @@ javaFrameworkError CNodeJava::loadUserSettings() { if (xmlStrcmp(pLoc->name, (xmlChar*) "location") == 0) { - CXmlCharPtr sLoc = xmlNodeListGetString( + CXmlCharPtr sLoc; + sLoc = xmlNodeListGetString( docUser, pLoc->children, 1); m_arJRELocations.push_back(sLoc); } @@ -549,11 +557,13 @@ javaFrameworkError CNodeJava::loadShareSettings() if (cur->children == NULL) return JFW_E_NONE; cur = cur->children; + while (cur != NULL) { if (xmlStrcmp(cur->name, (xmlChar*) "enabled") == 0) { - CXmlCharPtr sEnabled = xmlNodeListGetString( + CXmlCharPtr sEnabled; + sEnabled = xmlNodeListGetString( docShare, cur->children, 1); if (xmlStrcmp(sEnabled, (xmlChar*) "true") == 0) m_bEnabled = sal_True; @@ -564,13 +574,15 @@ javaFrameworkError CNodeJava::loadShareSettings() } else if (xmlStrcmp(cur->name, (xmlChar*) "classesDirectory") == 0) { - CXmlCharPtr sCls = xmlNodeListGetString( + CXmlCharPtr sCls; + sCls = xmlNodeListGetString( docShare, cur->children, 1); m_sClassesDirectory = sCls; } else if (xmlStrcmp(cur->name, (xmlChar*) "userClassPath") == 0) { - CXmlCharPtr sUser = xmlNodeListGetString( + CXmlCharPtr sUser; + sUser = xmlNodeListGetString( docShare, cur->children, 1); m_sUserClassPath = sUser; } @@ -585,11 +597,12 @@ javaFrameworkError CNodeJava::loadShareSettings() { if (xmlStrcmp(pOpt->name, (xmlChar*) "param") == 0) { - CXmlCharPtr sOpt = xmlNodeListGetString( + CXmlCharPtr sOpt; + sOpt = xmlNodeListGetString( docShare, pOpt->children, 1); m_arVmParameters.push_back(sOpt); } - pOpt = pOpt->next; + pOpt = pOpt->next; } } else if (xmlStrcmp(cur->name, (xmlChar*) "jreLocations") == 0) @@ -599,7 +612,8 @@ javaFrameworkError CNodeJava::loadShareSettings() { if (xmlStrcmp(pLoc->name, (xmlChar*) "location") == 0) { - CXmlCharPtr sLoc = xmlNodeListGetString( + CXmlCharPtr sLoc; + sLoc = xmlNodeListGetString( docShare, pLoc->children, 1); m_arJRELocations.push_back(sLoc); } @@ -993,7 +1007,8 @@ javaFrameworkError CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInf if (pJavaInfo->children == NULL) return JFW_E_NONE; //Get the xsi:nil attribute; - CXmlCharPtr sNil = xmlGetNsProp( + CXmlCharPtr sNil; + sNil = xmlGetNsProp( pJavaInfo, (xmlChar*) "nil", (xmlChar*) NS_SCHEMA_INSTANCE); if ( ! sNil) return JFW_E_FORMAT_STORE; @@ -1012,7 +1027,8 @@ javaFrameworkError CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInf { if (xmlStrcmp(cur->name, (xmlChar*) "vendor") == 0) { - CXmlCharPtr xmlVendor = xmlNodeListGetString( + CXmlCharPtr xmlVendor; + xmlVendor = xmlNodeListGetString( pDoc, cur->children, 1); if (! xmlVendor) return JFW_E_NONE; @@ -1020,33 +1036,38 @@ javaFrameworkError CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInf } else if (xmlStrcmp(cur->name, (xmlChar*) "location") == 0) { - CXmlCharPtr xmlLocation = xmlNodeListGetString( + CXmlCharPtr xmlLocation; + xmlLocation = xmlNodeListGetString( pDoc, cur->children, 1); sLocation = xmlLocation; } else if (xmlStrcmp(cur->name, (xmlChar*) "version") == 0) { - CXmlCharPtr xmlVersion = xmlNodeListGetString( + CXmlCharPtr xmlVersion; + xmlVersion = xmlNodeListGetString( pDoc, cur->children, 1); sVersion = xmlVersion; } else if (xmlStrcmp(cur->name, (xmlChar*) "features")== 0) { - CXmlCharPtr xmlFeatures = xmlNodeListGetString( + CXmlCharPtr xmlFeatures; + xmlFeatures = xmlNodeListGetString( pDoc, cur->children, 1); rtl::OUString sFeatures = xmlFeatures; nFeatures = sFeatures.toInt64(16); } else if (xmlStrcmp(cur->name, (xmlChar*) "requirements") == 0) { - CXmlCharPtr xmlRequire = xmlNodeListGetString( + CXmlCharPtr xmlRequire; + xmlRequire = xmlNodeListGetString( pDoc, cur->children, 1); rtl::OUString sRequire = xmlRequire; nRequirements = sRequire.toInt64(16); } else if (xmlStrcmp(cur->name, (xmlChar*) "vendorData") == 0) { - CXmlCharPtr xmlData = xmlNodeListGetString( + CXmlCharPtr xmlData; + xmlData = xmlNodeListGetString( pDoc, cur->children, 1); xmlChar* _data = (xmlChar*) xmlData; if (_data) @@ -1059,13 +1080,13 @@ javaFrameworkError CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInf } //Get the javainfo attributes - CXmlCharPtr sVendorUpdate = xmlGetProp(pJavaInfo, - (xmlChar*) "vendorUpdate"); + CXmlCharPtr sVendorUpdate; + sVendorUpdate = xmlGetProp(pJavaInfo, + (xmlChar*) "vendorUpdate"); if ( ! sVendorUpdate) return JFW_E_FORMAT_STORE; sAttrVendorUpdate = sVendorUpdate; - return errcode; } @@ -1189,10 +1210,10 @@ JavaInfo * CNodeJavaInfo::makeJavaInfo() const { if (bNil == true) return NULL; - JavaInfo * pInfo = (JavaInfo*) rtl_allocateMemory(sizeof JavaInfo); + JavaInfo * pInfo = (JavaInfo*) rtl_allocateMemory(sizeof(JavaInfo)); if (pInfo == NULL) return NULL; - memset(pInfo, 0, sizeof JavaInfo); + memset(pInfo, 0, sizeof(JavaInfo)); pInfo->sVendor = sVendor.pData; rtl_uString_acquire(pInfo->sVendor); pInfo->sLocation = sLocation.pData; diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx index 253d05cd9aa9..cdb2bd3035e1 100644 --- a/jvmfwk/source/framework.cxx +++ b/jvmfwk/source/framework.cxx @@ -2,9 +2,9 @@ * * $RCSfile: framework.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: jl $ $Date: 2004-04-26 15:52:15 $ + * last change: $Author: jl $ $Date: 2004-04-27 15:22:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -69,7 +69,7 @@ #include "osl/mutex.hxx" #include "libxml/parser.h" #include "libxml/xpath.h" -#include "libxml/xpathinternals.h" +#include "libxml/xpathInternals.h" #include <vector> #include <algorithm> #include <functional> @@ -90,6 +90,12 @@ namespace { JavaVM * g_pJavaVM = NULL; + +sal_Bool SAL_CALL areEqualJavaInfo( + JavaInfo const * pInfoA,JavaInfo const * pInfoB) +{ + return jfw_areEqualJavaInfo(pInfoA, pInfoB); +} } javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSize) @@ -101,13 +107,13 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi //Prepare the xml document and context rtl::OString sSettingsPath = jfw::getVendorSettingsPath(); - jfw::CXmlDocPtr doc = xmlParseFile(sSettingsPath.getStr()); + jfw::CXmlDocPtr doc(xmlParseFile(sSettingsPath.getStr())); if (doc == NULL) { OSL_ASSERT(0); return JFW_E_ERROR; } - jfw::CXPathContextPtr context = xmlXPathNewContext(doc); + jfw::CXPathContextPtr context(xmlXPathNewContext(doc)); int reg = xmlXPathRegisterNs(context, (xmlChar*) "jf", (xmlChar*) NS_JAVA_FRAMEWORK); if (reg == -1) @@ -212,11 +218,11 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi return JFW_E_ERROR; } typedef std::vector<rtl::OString>::const_iterator citLoc; - for (citLoc i = vecJRELocations.begin(); - i != vecJRELocations.end(); i++) + for (citLoc ii = vecJRELocations.begin(); + ii != vecJRELocations.end(); ii++) { rtl::OUString sLocation = - rtl::OStringToOUString(*i, RTL_TEXTENCODING_UTF8); + rtl::OStringToOUString(*ii, RTL_TEXTENCODING_UTF8); JavaInfo* pInfo = NULL; plerr = (*getJavaInfoByPathFunc)( sLocation.pData, @@ -243,11 +249,11 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi //Check which JavaInfo from vector vecInfoManual is already //contained in vecInfo. If it already exists then remove it from //vecInfoManual - for (it_info i = vecInfo.begin(); i != vecInfo.end(); i++) + for (it_info j = vecInfo.begin(); j != vecInfo.end(); j++) { it_info it_duplicate = std::find_if(vecInfoManual.begin(), vecInfoManual.end(), - std::bind2nd(std::ptr_fun(jfw_areEqualJavaInfo), *i)); + std::bind2nd(std::ptr_fun(areEqualJavaInfo), *j)); if (it_duplicate != vecInfoManual.end()) vecInfoManual.erase(it_duplicate); } @@ -264,11 +270,11 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi typedef std::vector<JavaInfo*>::iterator it; int index = 0; //Add the automatically detected JREs - for (it i = vecInfo.begin(); i != vecInfo.end(); i++) - (*pparInfo)[index++] = *i; + for (it k = vecInfo.begin(); k != vecInfo.end(); k++) + (*pparInfo)[index++] = *k; //Add the manually detected JREs - for (it i = vecInfoManual.begin();i != vecInfoManual.end(); i++) - (*pparInfo)[index++] = *i; + for (it l = vecInfoManual.begin(); l != vecInfoManual.end(); l++) + (*pparInfo)[index++] = *l; *pSize = nSize; return errcode; @@ -292,7 +298,7 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti return errcode; //get the current java setting (javaInfo) - jfw::CJavaInfo aInfo = javaSettings.getJavaInfo(); + jfw::CJavaInfo aInfo(javaSettings.getJavaInfo()); //check if a Java has ever been selected if (aInfo == NULL) return JFW_E_NO_SELECT; @@ -390,10 +396,10 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti index ++; } //add all options of the arOptions argument - for (int i = 0; i < cOptions; i++) + for (int ii = 0; ii < cOptions; ii++) { - arOpt[index].optionString = arOptions[i].optionString; - arOpt[index].extraInfo = arOptions[i].extraInfo; + arOpt[index].optionString = arOptions[ii].optionString; + arOpt[index].extraInfo = arOptions[ii].extraInfo; index++; } //start Java @@ -425,13 +431,13 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo) jfw::CJavaInfo aCurrentInfo; //Prepare the xml document and context rtl::OString sSettingsPath = jfw::getVendorSettingsPath(); - jfw::CXmlDocPtr doc = xmlParseFile(sSettingsPath.getStr()); + jfw::CXmlDocPtr doc(xmlParseFile(sSettingsPath.getStr())); if (doc == NULL) { OSL_ASSERT(0); return JFW_E_ERROR; } - jfw::CXPathContextPtr context = xmlXPathNewContext(doc); + jfw::CXPathContextPtr context(xmlXPathNewContext(doc)); int reg = xmlXPathRegisterNs(context, (xmlChar*) "jf", (xmlChar*) NS_JAVA_FRAMEWORK); if (reg == -1) @@ -662,7 +668,7 @@ javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInfo) errcode = aSettings.loadFromSettings(); if (errcode == JFW_E_NONE) { - jfw::CJavaInfo aInfo = aSettings.getJavaInfo(); + jfw::CJavaInfo aInfo(aSettings.getJavaInfo()); if (aInfo == NULL) return JFW_E_NO_SELECT; //If the javavendors.xml has changed, then the current selected @@ -700,13 +706,13 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath( javaFrameworkError errcode = JFW_E_NONE; //Prepare the xml document and context rtl::OString sSettingsPath = jfw::getVendorSettingsPath(); - jfw::CXmlDocPtr doc = xmlParseFile(sSettingsPath.getStr()); + jfw::CXmlDocPtr doc(xmlParseFile(sSettingsPath.getStr())); if (doc == NULL) { OSL_ASSERT(0); return JFW_E_ERROR; } - jfw::CXPathContextPtr context = xmlXPathNewContext(doc); + jfw::CXPathContextPtr context(xmlXPathNewContext(doc)); int reg = xmlXPathRegisterNs(context, (xmlChar*) "jf", (xmlChar*) NS_JAVA_FRAMEWORK); if (reg == -1) @@ -969,7 +975,7 @@ JavaInfo * CJavaInfo::copyJavaInfo(const JavaInfo * pInfo) if (pInfo == NULL) return NULL; JavaInfo* newInfo = - (JavaInfo*) rtl_allocateMemory(sizeof JavaInfo); + (JavaInfo*) rtl_allocateMemory(sizeof(JavaInfo)); if (newInfo) { rtl_copyMemory(newInfo, pInfo, sizeof(JavaInfo)); diff --git a/jvmfwk/source/fwkutil.cxx b/jvmfwk/source/fwkutil.cxx index 8db02e06af30..1fd415d61ad4 100644 --- a/jvmfwk/source/fwkutil.cxx +++ b/jvmfwk/source/fwkutil.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fwkutil.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: jl $ $Date: 2004-04-26 15:52:15 $ + * last change: $Author: jl $ $Date: 2004-04-27 15:22:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,7 +73,7 @@ #include "rtl/uri.hxx" #include "rtl/process.h" #include "osl/getglobalmutex.hxx" -#include "libxml/xpathinternals.h" +#include "libxml/xpathInternals.h" #include "framework.hxx" #include "elements.hxx" @@ -223,7 +223,7 @@ javaFrameworkError getPluginLibrary(rtl::OUString & sLibUrl) if ((errcode = javaNode.loadFromSettings()) != JFW_E_NONE) return errcode; - CJavaInfo aInfo = javaNode.getJavaInfo(); + CJavaInfo aInfo(javaNode.getJavaInfo()); if (aInfo == NULL) return JFW_E_NO_SELECT; @@ -248,11 +248,13 @@ javaFrameworkError getPluginLibrary(rtl::OUString & sLibUrl) rtl::OUString ouExpr = usBuffer.makeStringAndClear(); rtl::OString sExpression = rtl::OUStringToOString(ouExpr, osl_getThreadTextEncoding()); - CXPathObjectPtr pathObjVendor = xmlXPathEvalExpression( + CXPathObjectPtr pathObjVendor; + pathObjVendor = xmlXPathEvalExpression( (xmlChar*) sExpression.getStr(), contextVendor); if (xmlXPathNodeSetIsEmpty(pathObjVendor->nodesetval)) return JFW_E_FORMAT_STORE; - CXmlCharPtr xmlCharPlugin = + CXmlCharPtr xmlCharPlugin; + xmlCharPlugin = xmlNodeListGetString( docVendor,pathObjVendor->nodesetval->nodeTab[0], 1); @@ -273,7 +275,8 @@ javaFrameworkError getVendorPluginURLs( OSL_ASSERT(vecPlugins && doc && context); //get the nodeset for the library elements - jfw::CXPathObjectPtr result = xmlXPathEvalExpression( + jfw::CXPathObjectPtr result; + result = xmlXPathEvalExpression( (xmlChar*)"/jf:javaSelection/jf:plugins/jf:library", context); if (xmlXPathNodeSetIsEmpty(result->nodesetval)) { @@ -288,10 +291,9 @@ javaFrameworkError getVendorPluginURLs( //between library elements are also text elements if (cur->type == XML_ELEMENT_NODE) { - jfw::CXmlCharPtr sAttrVendor = - xmlGetProp(cur, (xmlChar*) "vendor"); - jfw::CXmlCharPtr sTextLibrary = - xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); + jfw::CXmlCharPtr sAttrVendor(xmlGetProp(cur, (xmlChar*) "vendor")); + jfw::CXmlCharPtr sTextLibrary( + xmlNodeListGetString(doc, cur->xmlChildrenNode, 1)); PluginLibrary plugin; plugin.sVendor = rtl::OString((sal_Char*)(xmlChar*) sAttrVendor); //create the file URL to the library @@ -485,7 +487,8 @@ javaFrameworkError getVersionInformation( "/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") + sVendor + rtl::OString("\"]/jf:minVersion"); - jfw::CXPathObjectPtr xPathObjectMin = + jfw::CXPathObjectPtr xPathObjectMin; + xPathObjectMin = xmlXPathEvalExpression((xmlChar*) sExpresion.getStr(), context); if (xmlXPathNodeSetIsEmpty(xPathObjectMin->nodesetval)) { @@ -493,8 +496,9 @@ javaFrameworkError getVersionInformation( } else { - jfw::CXmlCharPtr sVersion = xmlNodeListGetString(doc, - xPathObjectMin->nodesetval->nodeTab[0]->xmlChildrenNode, 1); + jfw::CXmlCharPtr sVersion; + sVersion = xmlNodeListGetString( + doc, xPathObjectMin->nodesetval->nodeTab[0]->xmlChildrenNode, 1); rtl::OString osVersion((sal_Char*)(xmlChar*) sVersion); pVersionInfo->sMinVersion = rtl::OStringToOUString( osVersion, RTL_TEXTENCODING_UTF8); @@ -503,16 +507,18 @@ javaFrameworkError getVersionInformation( //Get maxVersion sExpresion = rtl::OString("/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") + sVendor + rtl::OString("\"]/jf:maxVersion"); - jfw::CXPathObjectPtr xPathObjectMax = - xmlXPathEvalExpression((xmlChar*) sExpresion.getStr(), context); + jfw::CXPathObjectPtr xPathObjectMax; + xPathObjectMax = xmlXPathEvalExpression( + (xmlChar*) sExpresion.getStr(), context); if (xmlXPathNodeSetIsEmpty(xPathObjectMax->nodesetval)) { pVersionInfo->sMaxVersion = rtl::OUString(); } else { - jfw::CXmlCharPtr sVersion = xmlNodeListGetString(doc, - xPathObjectMax->nodesetval->nodeTab[0]->xmlChildrenNode, 1); + jfw::CXmlCharPtr sVersion; + sVersion = xmlNodeListGetString( + doc,xPathObjectMax->nodesetval->nodeTab[0]->xmlChildrenNode, 1); rtl::OString osVersion((sal_Char*) (xmlChar*) sVersion); pVersionInfo->sMaxVersion = rtl::OStringToOUString( osVersion, RTL_TEXTENCODING_UTF8); @@ -521,9 +527,9 @@ javaFrameworkError getVersionInformation( //Get excludeVersions sExpresion = rtl::OString("/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") + sVendor + rtl::OString("\"]/jf:excludeVersions/jf:version"); - jfw::CXPathObjectPtr xPathObjectVersions = - xmlXPathEvalExpression((xmlChar*) sExpresion.getStr(), - context); + jfw::CXPathObjectPtr xPathObjectVersions; + xPathObjectVersions = + xmlXPathEvalExpression((xmlChar*) sExpresion.getStr(), context); xmlNode* cur = xPathObjectVersions->nodesetval->nodeTab[0]; while (cur != NULL) { @@ -531,8 +537,8 @@ javaFrameworkError getVersionInformation( { if (xmlStrcmp(cur->name, (xmlChar*) "version") == 0) { - jfw::CXmlCharPtr sVersion = xmlNodeListGetString(doc, - cur->xmlChildrenNode, 1); + jfw::CXmlCharPtr sVersion; + sVersion = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); rtl::OString osVersion((sal_Char*)(xmlChar*) sVersion); rtl::OUString usVersion = rtl::OStringToOUString( osVersion, RTL_TEXTENCODING_UTF8); @@ -601,11 +607,11 @@ rtl::ByteSequence decodeBase16(const rtl::ByteSequence& data) pData++; curChar = *pData; //find the index for the next 4bits - for (int ii = 0; ii < 16; ii++) + for (int j = 0; j < 16; j++) { - if (curChar == decodingTable[ii]) + if (curChar == decodingTable[j]) { - nibble |= ii; + nibble |= j; break; } } diff --git a/jvmfwk/source/libxmlutil.cxx b/jvmfwk/source/libxmlutil.cxx index 37d258c383c0..96f01a979f3c 100644 --- a/jvmfwk/source/libxmlutil.cxx +++ b/jvmfwk/source/libxmlutil.cxx @@ -2,9 +2,9 @@ * * $RCSfile: libxmlutil.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: jl $ $Date: 2004-04-19 15:55:25 $ + * last change: $Author: jl $ $Date: 2004-04-27 15:22:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,7 +95,7 @@ CXPathObjectPtr::operator xmlXPathObject*() return _object; } //=========================================================== -CXPathContextPtr::CXPathContextPtr(xmlXPathContext* aContext) +CXPathContextPtr::CXPathContextPtr(xmlXPathContextPtr aContext) : _object(aContext) { } @@ -109,7 +109,7 @@ CXPathContextPtr::~CXPathContextPtr() xmlXPathFreeContext(_object); } -CXPathContextPtr & CXPathContextPtr::operator = (xmlXPathContext* pObj) +CXPathContextPtr & CXPathContextPtr::operator = (xmlXPathContextPtr pObj) { if (_object == pObj) return *this; @@ -193,7 +193,7 @@ CXmlDocPtr::operator xmlDoc*() // } //=========================================================== -CXmlCharPtr::CXmlCharPtr(xmlChar* aChar) +CXmlCharPtr::CXmlCharPtr(xmlChar * aChar) : _object(aChar) { } @@ -215,10 +215,10 @@ CXmlCharPtr & CXmlCharPtr::operator = (xmlChar* pObj) _object = pObj; return *this; } -xmlChar* CXmlCharPtr::operator ->() -{ - return _object; -} +// xmlChar* CXmlCharPtr::operator ->() +// { +// return _object; +// } CXmlCharPtr::operator xmlChar*() { diff --git a/jvmfwk/source/libxmlutil.hxx b/jvmfwk/source/libxmlutil.hxx index 7fac55e47a4c..0326d7fba218 100644 --- a/jvmfwk/source/libxmlutil.hxx +++ b/jvmfwk/source/libxmlutil.hxx @@ -2,9 +2,9 @@ * * $RCSfile: libxmlutil.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: jl $ $Date: 2004-04-19 15:56:06 $ + * last change: $Author: jl $ $Date: 2004-04-27 15:22:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -91,12 +91,12 @@ class CXPathContextPtr { xmlXPathContext* _object; - CXPathContextPtr(const CXPathContextPtr&); + CXPathContextPtr(const jfw::CXPathContextPtr&); CXPathContextPtr & operator = (const CXPathContextPtr&); public: CXPathContextPtr(); - CXPathContextPtr(xmlXPathContext* aContext); - CXPathContextPtr & operator = (xmlXPathContext* pObj); + CXPathContextPtr(xmlXPathContextPtr aContext); + CXPathContextPtr & operator = (xmlXPathContextPtr pObj); ~CXPathContextPtr(); xmlXPathContext* operator -> (); operator xmlXPathContext* (); @@ -150,7 +150,7 @@ public: CXmlCharPtr(xmlChar* aDoc); ~CXmlCharPtr(); CXmlCharPtr & operator = (xmlChar* pObj); - xmlChar* operator -> (); +// xmlChar* operator -> (); operator xmlChar* (); operator rtl::OUString (); operator rtl::OString (); diff --git a/jvmfwk/source/makefile.mk b/jvmfwk/source/makefile.mk index e9582e10ff56..aa7ff8e55e8d 100644 --- a/jvmfwk/source/makefile.mk +++ b/jvmfwk/source/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.3 $ +# $Revision: 1.4 $ # -# last change: $Author: jl $ $Date: 2004-04-20 10:01:50 $ +# last change: $Author: jl $ $Date: 2004-04-27 15:22:15 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -97,7 +97,8 @@ SHL1TARGET = $(FRAMEWORKLIB) SHL1DEPN= SHL1IMPLIB = i$(FRAMEWORKLIB) SHL1LIBS = $(SLB)$/$(TARGET).lib -SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) $(SALHELPERLIB) ixml2.lib +SHL1STDLIBS = $(CPPULIB) $(CPPUHELPERLIB) $(SALLIB) $(SALHELPERLIB) $(XML2LIB) + SHL1VERSIONMAP = framework.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME = $(SHL1TARGET) |