jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx | 1 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 4 +- jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx | 1 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx | 20 +---------- jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx | 36 ++++++++++---------- 5 files changed, 23 insertions(+), 39 deletions(-)
New commits: commit 5dcfbe57c8c35814d0e8e20c7069be340151da8f Author: Stephan Bergmann <sberg...@redhat.com> Date: Mon Oct 20 17:58:30 2014 +0200 Clean up VendorBase (virtual) member functions Change-Id: I1377dfded1246c8e96db3addc28489886c7f2d99 diff --git a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx index 2c2b1b7..d95a9a4 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/otherjre.hxx @@ -34,7 +34,6 @@ public: static rtl::Reference<VendorBase> createInstance(); - using VendorBase::getLibraryPaths; virtual char const* const* getRuntimePaths(int * size) SAL_OVERRIDE; virtual char const* const* getLibraryPaths(int* size) SAL_OVERRIDE; virtual int compareVersions(const OUString& sSecond) const SAL_OVERRIDE; diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx index db58c54..3d4e3f4 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx @@ -157,10 +157,10 @@ JavaInfo* createJavaInfo(const rtl::Reference<VendorBase> & info) pInfo->nRequirements = info->needsRestart() ? JFW_REQUIRE_NEEDRESTART : 0; OUStringBuffer buf(1024); buf.append(info->getRuntimeLibrary()); - if (!info->getLibraryPaths().isEmpty()) + if (!info->getLibraryPath().isEmpty()) { buf.appendAscii("\n"); - buf.append(info->getLibraryPaths()); + buf.append(info->getLibraryPath()); buf.appendAscii("\n"); } diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx index a25a8e5..1d63794 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjre.hxx @@ -33,7 +33,6 @@ public: static rtl::Reference<VendorBase> createInstance(); - using VendorBase::getLibraryPaths; virtual char const* const* getRuntimePaths(int * size) SAL_OVERRIDE; virtual char const* const* getLibraryPaths(int* size) SAL_OVERRIDE; diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx index c72ac27..563c850 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx @@ -54,12 +54,6 @@ VendorBase::VendorBase(): m_bAccessibility(false) { } -rtl::Reference<VendorBase> VendorBase::createInstance() -{ - VendorBase *pBase = new VendorBase(); - return rtl::Reference<VendorBase>(pBase); -} - bool VendorBase::initialize(vector<pair<OUString, OUString> > props) { //get java.vendor, java.version, java.home, @@ -209,7 +203,7 @@ const OUString & VendorBase::getHome() const return m_sHome; } -const OUString & VendorBase::getLibraryPaths() const +const OUString & VendorBase::getLibraryPath() const { return m_sLD_LIBRARY_PATH; } @@ -225,21 +219,11 @@ bool VendorBase::supportsAccessibility() const bool VendorBase::needsRestart() const { - if (!getLibraryPaths().isEmpty()) + if (!getLibraryPath().isEmpty()) return true; return false; } -int VendorBase::compareVersions(const OUString& /*sSecond*/) const -{ - OSL_FAIL("[Java framework] VendorBase::compareVersions must be " - "overridden in derived class."); - return 0; -} - - - - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx index 29f2641..7210173 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.hxx @@ -88,7 +88,9 @@ class VendorBase: public salhelper::SimpleReferenceObject { public: VendorBase(); - /* returns relative paths to the java executable as + /* static char const* const * getJavaExePaths(int* size); + + returns relative paths to the java executable as file URLs. For example "bin/java.exe". You need @@ -103,9 +105,10 @@ public: The signature of this function must correspond to getJavaExePaths_func. */ - static char const* const * getJavaExePaths(int* size); - /* creates an instance of this class. MUST be overridden + /* static rtl::Reference<VendorBase> createInstance(); + + creates an instance of this class. MUST be overridden in a derived class. #################################################### OVERRIDE in derived class @@ -113,7 +116,6 @@ public: @param Key - value pairs of the system properties of the JRE. */ - static rtl::Reference<VendorBase> createInstance(); /* called automatically on the instance created by createInstance. @@ -132,18 +134,18 @@ public: virtual char const* const* getLibraryPaths(int* size); - virtual const OUString & getVendor() const; - virtual const OUString & getVersion() const; - virtual const OUString & getHome() const; - virtual const OUString & getRuntimeLibrary() const; - virtual const OUString & getLibraryPaths() const; - virtual bool supportsAccessibility() const; - /* determines if prior to running java something has to be done, - like setting the LD_LIBRARY_PATH. This implementation checks - if an LD_LIBRARY_PATH (getLD_LIBRARY_PATH) needs to be set and - if so, needsRestart returns true. - */ - virtual bool needsRestart() const; + const OUString & getVendor() const; + const OUString & getVersion() const; + const OUString & getHome() const; + const OUString & getRuntimeLibrary() const; + const OUString & getLibraryPath() const; + bool supportsAccessibility() const; + /* determines if prior to running java something has to be done, + like setting the LD_LIBRARY_PATH. This implementation checks + if an LD_LIBRARY_PATH (getLD_LIBRARY_PATH) needs to be set and + if so, needsRestart returns true. + */ + bool needsRestart() const; /* compares versions of this vendor. MUST be overridden in a derived class. @@ -158,7 +160,7 @@ public: @throw MalformedVersionException if the version string was not recognized. */ - virtual int compareVersions(const OUString& sSecond) const; + virtual int compareVersions(const OUString& sSecond) const = 0; protected: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits