[Libreoffice-commits] core.git: Branch 'distro/vector/vector-5.4' - 7 commits - jvmfwk/inc jvmfwk/plugins jvmfwk/source offapi/com sw/inc sw/qa sw/source xmloff/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Fri May 31 06:52:30 UTC 2019


 jvmfwk/inc/fwkbase.hxx                              |   11 
 jvmfwk/inc/libxmlutil.hxx                           |    4 
 jvmfwk/inc/vendorplugin.hxx                         |   94 +-----
 jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx        |   12 
 jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx |  143 +++------
 jvmfwk/plugins/sunmajor/pluginlib/util.cxx          |   11 
 jvmfwk/plugins/sunmajor/pluginlib/util.hxx          |    2 
 jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx    |   37 +-
 jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx    |   17 -
 jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx    |    5 
 jvmfwk/source/elements.cxx                          |   19 -
 jvmfwk/source/framework.cxx                         |  290 ++++++--------------
 jvmfwk/source/fwkbase.cxx                           |   18 +
 jvmfwk/source/libxmlutil.cxx                        |    2 
 offapi/com/sun/star/text/CellProperties.idl         |    7 
 offapi/com/sun/star/text/TextFrame.idl              |    8 
 sw/inc/cmdid.h                                      |    1 
 sw/inc/unoframe.hxx                                 |    1 
 sw/inc/unoprnms.hxx                                 |    1 
 sw/inc/unotbl.hxx                                   |    1 
 sw/qa/extras/odfexport/data/user-field-decl-fly.odt |binary
 sw/qa/extras/odfexport/data/user-field-decl.odt     |binary
 sw/qa/extras/odfexport/odfexport.cxx                |   17 +
 sw/source/core/unocore/unoframe.cxx                 |   12 
 sw/source/core/unocore/unomap.cxx                   |    1 
 sw/source/core/unocore/unomapproperties.hxx         |    1 
 sw/source/core/unocore/unotbl.cxx                   |   23 +
 sw/source/filter/xml/xmlfmte.cxx                    |    1 
 xmloff/source/text/txtflde.cxx                      |   29 +-
 29 files changed, 342 insertions(+), 426 deletions(-)

New commits:
commit 7f1940b1c8667538e2892a9bc3b898d0944b544b
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu May 30 14:56:40 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri May 31 08:39:35 2019 +0200

    ODT export: fix lost <text:user-field-decl> for fields in frames in headers
    
    This is similar to commit 6bb241ccc61c6904efec95978fa17e33c0eb1df3 (ODT
    export: fix lost <text:user-field-decl> for fields in tables in headers,
    2019-05-29), but here the container we want to ignore (between the
    header and the field) is a text frame, not a table cell.
    
    (cherry picked from commit 6f179ce5c5469d1c53e4bb7736384b2d9ce51926)
    
    Conflicts:
            sw/inc/unoframe.hxx
            sw/source/core/unocore/unomapproperties.hxx
    
    Change-Id: I6e8006fbd666802070cfeb88ca4528c66cc6d559
    Reviewed-on: https://gerrit.libreoffice.org/73205
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
    Tested-by: Jenkins

diff --git a/offapi/com/sun/star/text/TextFrame.idl b/offapi/com/sun/star/text/TextFrame.idl
index 68a73141b1fd..44f4139d92f7 100644
--- a/offapi/com/sun/star/text/TextFrame.idl
+++ b/offapi/com/sun/star/text/TextFrame.idl
@@ -142,6 +142,14 @@ published service TextFrame
         @since LibreOffice 4.3
     */
     [optional, property] com::sun::star::drawing::TextVerticalAdjust TextVerticalAdjust;
+
+    /** Parent text of this text frame.
+
+        This might be a header text, body text, etc.
+
+        @since LibreOffice 6.3
+     */
+    [optional, readonly, property] com::sun::star::text::XText ParentText;
 };
 
 
diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx
index 4bf9e3aa0647..3396d00b1d92 100644
--- a/sw/inc/unoframe.hxx
+++ b/sw/inc/unoframe.hxx
@@ -70,6 +70,7 @@ private:
     OUString                        m_sName;
 
     SwPaM*                          m_pCopySource;
+    css::uno::Reference<css::text::XText> m_xParentText;
 
 protected:
     css::uno::Reference< css::beans::XPropertySet > mxStyleData;
diff --git a/sw/qa/extras/odfexport/data/user-field-decl-fly.odt b/sw/qa/extras/odfexport/data/user-field-decl-fly.odt
new file mode 100644
index 000000000000..2ffe3ae55532
Binary files /dev/null and b/sw/qa/extras/odfexport/data/user-field-decl-fly.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index e6dc81d274e0..94c04287c0bb 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -159,6 +159,15 @@ DECLARE_ODFEXPORT_TEST(testUserFieldDecl, "user-field-decl.odt")
         assertXPath(pXmlDoc, "//style:header/text:user-field-decls/text:user-field-decl", 2);
 }
 
+DECLARE_ODFEXPORT_TEST(testUserFieldDeclFly, "user-field-decl-fly.odt")
+{
+    if (xmlDocPtr pXmlDoc = parseExport("styles.xml"))
+        // Without the accompanying fix in place, this test would have failed with 'Expected: 2;
+        // Actual: 1', i.e. the in-textframe field had no declaration (in the header), while the
+        // outside-textframe one had the declaration.
+        assertXPath(pXmlDoc, "//style:header/text:user-field-decls/text:user-field-decl", 2);
+}
+
 DECLARE_ODFEXPORT_TEST(testFramebackgrounds, "framebackgrounds.odt")
 {
    //Counting the Number of Frames and checking with the expected count
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 64c0a7c443ca..549b2b75d415 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2268,6 +2268,18 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
                 aAny <<= awt::Size( aMM100Size.Width(), aMM100Size.Height() );
             }
         }
+        else if(pEntry->nWID == FN_UNO_PARENT_TEXT)
+        {
+            if (!m_xParentText.is())
+            {
+                const SwPosition* pContentAnchor = pFormat->GetAnchor().GetContentAnchor();
+                if (pContentAnchor)
+                {
+                    m_xParentText = sw::CreateParentXText(*pFormat->GetDoc(), *pContentAnchor);
+                }
+            }
+            aAny <<= m_xParentText;
+        }
         else
         {
             // standard UNO API read attributes
diff --git a/sw/source/core/unocore/unomapproperties.hxx b/sw/source/core/unocore/unomapproperties.hxx
index 633fd3db3e2e..fb3154246fe0 100644
--- a/sw/source/core/unocore/unomapproperties.hxx
+++ b/sw/source/core/unocore/unomapproperties.hxx
@@ -317,6 +317,7 @@
     { OUString(UNO_NAME_USER_DEFINED_ATTRIBUTES), RES_UNKNOWNATR_CONTAINER, cppu::UnoType<css::container::XNameContainer>::get(), PropertyAttribute::MAYBEVOID, 0 },\
     { OUString(UNO_NAME_Z_ORDER), FN_UNO_Z_ORDER,           cppu::UnoType<sal_Int32>::get(),       PROPERTY_NONE, 0}, \
     { OUString(UNO_NAME_IS_FOLLOWING_TEXT_FLOW), RES_FOLLOW_TEXT_FLOW,     cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, \
+    { OUString(UNO_NAME_PARENT_TEXT), FN_UNO_PARENT_TEXT, cppu::UnoType<text::XText>::get(), PropertyAttribute::MAYBEVOID | PropertyAttribute::READONLY, 0 }, \
     { OUString(UNO_NAME_WRAP_INFLUENCE_ON_POSITION), RES_WRAP_INFLUENCE_ON_OBJPOS, cppu::UnoType<sal_Int8>::get(), PROPERTY_NONE, MID_WRAP_INFLUENCE}, \
     { OUString(UNO_NAME_TITLE), FN_UNO_TITLE, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0}, \
     { OUString(UNO_NAME_DESCRIPTION), FN_UNO_DESCRIPTION, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0}, \
commit 4a504709498628378bcdf576a7e2da85d33e20a3
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed May 29 17:26:57 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu May 30 17:43:12 2019 +0200

    ODT export: fix lost <text:user-field-decl> for fields in tables in headers
    
    The problem was that XMLTextFieldExport::ExportFieldAutoStyle() assumed
    that the text of a field anchor is always the toplevel XText, which is
    true in case of body vs header text, but false in case header text vs
    text-in-table-in-header.
    
    So add an UNO property which exposes the parent of a table cell, this
    way text in header (regardless of it's in a table or not) will have the
    same XText, leading to writing the necessary <text:user-field-decl>
    element for the matching <text:user-field-get> definition.
    
    (cherry picked from commit 6bb241ccc61c6904efec95978fa17e33c0eb1df3)
    
    Conflicts:
            offapi/com/sun/star/text/CellProperties.idl
            sw/inc/cmdid.h
            sw/inc/unoprnms.hxx
            sw/source/filter/xml/xmlfmte.cxx
    
    Change-Id: I077b8d7e9dfae4062539894318637e266b925382
    Reviewed-on: https://gerrit.libreoffice.org/73176
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/offapi/com/sun/star/text/CellProperties.idl b/offapi/com/sun/star/text/CellProperties.idl
index 6144d9fc8530..f2a26fe9abd7 100644
--- a/offapi/com/sun/star/text/CellProperties.idl
+++ b/offapi/com/sun/star/text/CellProperties.idl
@@ -122,6 +122,13 @@ published service CellProperties
      */
     [property] short VertOrient;
 
+    /** Parent text of this table cell.
+
+        This might be a header text, body text, parent cell, etc.
+
+        @since LibreOffice 6.3
+     */
+    [optional, readonly, property] com::sun::star::text::XText ParentText;
 };
 
 
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index e626bbb93458..f91a1fd6489c 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -513,6 +513,7 @@
 #define FN_UNO_FOOTER                       (FN_EXTRA2 + 38)
 #define FN_UNO_FOOTER_LEFT                  (FN_EXTRA2 + 39)
 #define FN_UNO_FOOTER_RIGHT                 (FN_EXTRA2 + 40)
+#define FN_UNO_PARENT_TEXT (FN_EXTRA2 + 42)
 #define FN_UNO_FOLLOW_STYLE                 (FN_EXTRA2 + 59)
 
 #define FN_API_CALL                         (FN_EXTRA2 + 60)
diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx
index 24cc71cb8740..7a3aa2f95d32 100644
--- a/sw/inc/unoprnms.hxx
+++ b/sw/inc/unoprnms.hxx
@@ -391,6 +391,7 @@
 #define UNO_NAME_FOOTER_BODY_DISTANCE "FooterBodyDistance"
 #define UNO_NAME_FOOTER_IS_DYNAMIC_HEIGHT "FooterIsDynamicHeight"
 #define UNO_NAME_FOOTER_IS_SHARED "FooterIsShared"
+#define UNO_NAME_PARENT_TEXT "ParentText"
 
 #define UNO_NAME_FOOTER_HEIGHT "FooterHeight"
 #define UNO_NAME_FOOTER_IS_ON "FooterIsOn"
diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx
index 7b06cc143e6c..d649c51f8ac7 100644
--- a/sw/inc/unotbl.hxx
+++ b/sw/inc/unotbl.hxx
@@ -73,6 +73,7 @@ class SwXCell final : public SwXCellBaseClass,
 
     // table position where pBox was found last
     size_t nFndPos;
+    css::uno::Reference<css::text::XText> m_xParentText;
     static size_t const NOTFOUND = SAL_MAX_SIZE;
 
     virtual const SwStartNode *GetStartNode() const override;
diff --git a/sw/qa/extras/odfexport/data/user-field-decl.odt b/sw/qa/extras/odfexport/data/user-field-decl.odt
new file mode 100644
index 000000000000..f037f403ec68
Binary files /dev/null and b/sw/qa/extras/odfexport/data/user-field-decl.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index e9e458c4a243..e6dc81d274e0 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -150,6 +150,14 @@ DECLARE_ODFEXPORT_TEST(testTdf103567, "tdf103567.odt")
     CPPUNIT_ASSERT_EQUAL(sal_Int32( 408), rect.Height);
 }
 
+DECLARE_ODFEXPORT_TEST(testUserFieldDecl, "user-field-decl.odt")
+{
+    if (xmlDocPtr pXmlDoc = parseExport("styles.xml"))
+        // Without the accompanying fix in place, this test would have failed with 'Expected: 2;
+        // Actual: 1', i.e. the in-table field had no declaration (in the header), while the
+        // outside-table one had the declaration.
+        assertXPath(pXmlDoc, "//style:header/text:user-field-decls/text:user-field-decl", 2);
+}
 
 DECLARE_ODFEXPORT_TEST(testFramebackgrounds, "framebackgrounds.odt")
 {
diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx
index aa98dbbf7ab9..9c71545d6510 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -213,6 +213,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s
                     { OUString(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, 0 },
                     { OUString(UNO_NAME_ROW_SPAN),     FN_UNO_CELL_ROW_SPAN, cppu::UnoType<sal_Int32>::get(),  0, 0 },
                     { OUString(UNO_NAME_CELL_INTEROP_GRAB_BAG), RES_FRMATR_GRABBAG, cppu::UnoType< cppu::UnoSequenceType<css::beans::PropertyValue> >::get(), PROPERTY_NONE, 0 },
+                    { OUString(UNO_NAME_PARENT_TEXT), FN_UNO_PARENT_TEXT, cppu::UnoType<text::XText>::get(), PropertyAttribute::MAYBEVOID | PropertyAttribute::READONLY, 0 },
                     REDLINE_NODE_PROPERTIES
                     { OUString(), 0, css::uno::Type(), 0, 0 }
                 };
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 17c9819dc26a..2fc660b9a8a7 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1098,6 +1098,29 @@ uno::Any SwXCell::getPropertyValue(const OUString& rPropertyName)
             return SwXText::getPropertyValue(rPropertyName);
         }
         break;
+        case FN_UNO_PARENT_TEXT:
+        {
+            if (!m_xParentText.is())
+            {
+                const SwStartNode* pSttNd = pBox->GetSttNd();
+                if (!pSttNd)
+                    return uno::Any();
+
+                const SwTableNode* pTableNode = pSttNd->FindTableNode();
+                if (!pTableNode)
+                    return uno::Any();
+
+                SwPosition aPos(*pTableNode);
+                SwDoc* pDoc = aPos.GetDoc();
+                if (!pDoc)
+                    return uno::Any();
+
+                m_xParentText = sw::CreateParentXText(*pDoc, aPos);
+            }
+
+            return uno::makeAny(m_xParentText);
+        }
+        break;
         default:
         {
             const SwAttrSet& rSet = pBox->GetFrameFormat()->GetAttrSet();
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index 7ee76a429f9f..25d6ca8f9855 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -37,6 +37,7 @@
 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
 #include "xmlexp.hxx"
 #include <SwStyleNameMapper.hxx>
+#include <sal/log.hxx>
 
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::uno;
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 959b2e75162b..e37817ae7d70 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -156,6 +156,31 @@ static sal_Char const FIELD_SERVICE_MEASURE[] = "Measure";
 static sal_Char const FIELD_SERVICE_TABLE_FORMULA[] = "TableFormula";
 static sal_Char const FIELD_SERVICE_DROP_DOWN[] = "DropDown";
 
+namespace
+{
+/// Walks up the parent chain of xText and returns the topmost text.
+uno::Reference<text::XText> GetToplevelText(const uno::Reference<text::XText>& xText)
+{
+    uno::Reference<text::XText> xRet = xText;
+    while (true)
+    {
+        uno::Reference<beans::XPropertySet> xPropertySet(xRet, uno::UNO_QUERY);
+        if (!xPropertySet.is())
+            return xRet;
+
+        if (!xPropertySet->getPropertySetInfo()->hasPropertyByName("ParentText"))
+            return xRet;
+
+        uno::Reference<text::XText> xParent;
+        if (xPropertySet->getPropertyValue("ParentText") >>= xParent)
+            xRet = xParent;
+        else
+            return xRet;
+    }
+    return xRet;
+}
+}
+
 SvXMLEnumStringMapEntry<FieldIdEnum> const aFieldServiceNameMapping[] =
 {
     ENUM_STRING_MAP_ENTRY( FIELD_SERVICE_SENDER, FIELD_ID_SENDER ),
@@ -747,7 +772,9 @@ void XMLTextFieldExport::ExportFieldAutoStyle(
         Reference<XDependentTextField> xDepField(rTextField, UNO_QUERY);
         if (xDepField.is())
         {
-            Reference<XText> xOurText = rTextField->getAnchor()->getText();
+            // The direct parent may be just the table cell, while we want the topmost parent, e.g.
+            // a header text.
+            Reference<XText> xOurText = GetToplevelText(rTextField->getAnchor()->getText());
 
             map<Reference<XText>, set<OUString> >::iterator aMapIter =
                 pUsedMasters->find(xOurText);
commit 8a556a1509bbb04eb00bea41761f5616927ac773
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Apr 9 14:51:54 2019 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu May 30 16:34:52 2019 +0200

    tdf#124503: Support JRE installations with unknown java.vendor property
    
    After recent additions of 61c4f96d6ae6a80370774e53287edb27cbce8067 "Support
    AdoptOpenJDK" and 41507db590b24e1b9b45d95cad55c71ba2e4091d "Support Amazon
    Corretto" to our hard-coded list, there is now reports that at least Debian and
    Ubuntu tried to distribute versions of OpenJDK with the java.vendor propety set
    to string like "Debian" or "Ubuntu".  Instead of trying to catch up with an
    ever-growing hard-coded list, it is probably better to stop relying exclusively
    on such a hard-coded list, and for unknown vendor values, try out whether the
    SunInfo backend (which supports the "generic" OpenJDK) would be able to handle
    the given JRE.  (For simplicity, assume that any versions of such JREs are
    supported.  Our baseline is Java 6, and there are unlikely any older versions of
    JREs from unknown vendors out there.  If this turns out to be problematic, we
    could include information about problematic vendors after all, or add a general
    check that JREs from unknown vendors are at least Java 6.)
    
    Many functions in jvmfwk/inc/vendorplugin.hxx that used to take a set of
    sVendor/sMinVersion/sMaxVerison/arExcludeList paramters had to be revised to
    take a vendorSettings parameter instead, and
    VendorSettings::getVersionInformation has been changed to return a
    boost::optional, so that unknown vendors can be handled gracefully.
    
    Reviewed-on: https://gerrit.libreoffice.org/70460
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 3d27b2fa9c5a03f78e5145377402f8a88e3da1be)
    Conflicts:
            jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
            jvmfwk/source/framework.cxx
    
    (cherry picked from commit 90aa1f6e8070cadb26132e7187b47241004f26f8)
    
    Conflicts:
            jvmfwk/inc/fwkbase.hxx
            jvmfwk/inc/vendorplugin.hxx
            jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
            jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
            jvmfwk/source/elements.cxx
            jvmfwk/source/framework.cxx
            jvmfwk/source/fwkbase.cxx
            solenv/clang-format/blacklist
    
    Change-Id: Ibf915f2ddd59e09b77e2c03be688cac0547b9ac9
    Reviewed-on: https://gerrit.libreoffice.org/70587
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/jvmfwk/source/fwkbase.hxx b/jvmfwk/inc/fwkbase.hxx
similarity index 93%
rename from jvmfwk/source/fwkbase.hxx
rename to jvmfwk/inc/fwkbase.hxx
index 1a86cb9f6a1a..7cf88fbb5ec1 100644
--- a/jvmfwk/source/fwkbase.hxx
+++ b/jvmfwk/inc/fwkbase.hxx
@@ -16,10 +16,15 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_JVMFWK_SOURCE_FWKBASE_HXX
-#define INCLUDED_JVMFWK_SOURCE_FWKBASE_HXX
+#ifndef INCLUDED_JVMFWK_INC_FWKBASE_HXX
+#define INCLUDED_JVMFWK_INC_FWKBASE_HXX
+
+#include <sal/config.h>
+
+#include <boost/optional.hpp>
 
 #include "rtl/ustring.hxx"
+#include "elements.hxx"
 #include "libxmlutil.hxx"
 
 namespace jfw
@@ -34,7 +39,7 @@ class VendorSettings
 public:
     VendorSettings();
 
-    VersionInfo getVersionInformation(const OUString & sVendor);
+    boost::optional<VersionInfo> getVersionInformation(const OUString & sVendor) const;
 
     ::std::vector< OUString> getSupportedVendors();
 };
diff --git a/jvmfwk/source/libxmlutil.hxx b/jvmfwk/inc/libxmlutil.hxx
similarity index 96%
rename from jvmfwk/source/libxmlutil.hxx
rename to jvmfwk/inc/libxmlutil.hxx
index ac536306610e..6b9b18ec540b 100644
--- a/jvmfwk/source/libxmlutil.hxx
+++ b/jvmfwk/inc/libxmlutil.hxx
@@ -16,8 +16,8 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_JVMFWK_SOURCE_LIBXMLUTIL_HXX
-#define INCLUDED_JVMFWK_SOURCE_LIBXMLUTIL_HXX
+#ifndef INCLUDED_JVMFWK_INC_LIBXMLUTIL_HXX
+#define INCLUDED_JVMFWK_INC_LIBXMLUTIL_HXX
 
 #include "libxml/parser.h"
 #include "libxml/xpath.h"
diff --git a/jvmfwk/inc/vendorplugin.hxx b/jvmfwk/inc/vendorplugin.hxx
index a8a7a4b3c7ae..999dcda90dc6 100644
--- a/jvmfwk/inc/vendorplugin.hxx
+++ b/jvmfwk/inc/vendorplugin.hxx
@@ -28,10 +28,10 @@
 
 #include <memory>
 #include <vector>
-#include <utility>
-#include "elements.hxx"
 #include <vendorbase.hxx>
 
+namespace jfw { class VendorSettings; }
+
 /**
    @file
    <p>
@@ -56,7 +56,6 @@ enum class javaPluginError
     WrongVersionFormat,
     FailedVersion,
     NoJre,
-    WrongVendor,
     WrongArch,
     VmCreationFailed
 };
@@ -64,26 +63,14 @@ enum class javaPluginError
 
 /** obtains information about installations of Java Runtime Environments (JREs).
 
-    <p>The function gathers information about available JREs which have the same
-    vendor as determined by the <code>sVendor</code> parameter. Only information
+    <p>The function gathers information about available JREs. Only information
     about those JREs which match the version requirements are returned. These
-    requirements are specified by the parameters <code>sMinVersion</code>,
-    <code>sMaxVersion</code> and <code>arExcludeList</code>.
+    requirements are specified by the parameter <code>vendorSettings</code>.
     </p>
     <p>
     The JavaInfo structures returned in <code>parJavaInfo</code> should be ordered
     according to their version. The one, representing a JRE with the highest
     version should be the first in the array. </p>
-    @param sVendor
-        [in] only JREs from this vendor are examined. This parameter always contains
-        a vendor string. That is, the string it is not empty.
-    @param sMinVersion
-        [in] represents the minimum version of a JRE. The string can be empty.
-    @param sMaxVersion
-        [in] represents the maximum version of a JRE. The string can be empty.
-    @param arExcludeList
-        [in] contains a list of "bad" versions. JREs which have one of these
-        versions must not be returned by this function.
     @param parJavaInfo
         [out] if the function runs successfully then <code>parJavaInfo</code> contains
         on return a vector of pointers to <code>JavaInfo</code> objects.
@@ -91,40 +78,25 @@ enum class javaPluginError
     @return
     javaPluginError::NONE the function ran successfully.</br>
     javaPluginError::Error an error occurred during execution.</br>
-    javaPluginError::InvalidArg an argument was not valid.</br>
     javaPluginError::WrongVersionFormat the version strings in
-    <code>sMinVersion,sMaxVersion,arExcludeList</code> are not recognized as valid
+    <code>vendorSettings</code> are not recognized as valid
     version strings.
  */
 javaPluginError jfw_plugin_getAllJavaInfos(
     bool checkJavaHomeAndPath,
-    OUString const& sVendor,
-    OUString const& sMinVersion,
-    OUString const& sMaxVersion,
-    std::vector<OUString> const & arExcludeList,
+    jfw::VendorSettings const & vendorSettings,
     std::vector<std::unique_ptr<JavaInfo>> * parJavaInfo,
     std::vector<rtl::Reference<jfw_plugin::VendorBase>> & infos);
 
 /** obtains information for a JRE at a given location.
 
-   <p>If the given location belongs to a JRE whoose vendor matches the
-   sVendor argument and the JRE has a version which meets the requirements as
-   specified by <code>sMinVersion, sMaxVersion, arExcludeList</code> then
-   this function shall return a JavaInfo object for this JRE if this implementation
-   supports this vendor.</p>
+   <p>If the given location belongs to a JRE
+   and the JRE has a version which meets the requirements as
+   specified by <code>vendorSettings</code> then
+   this function shall return a JavaInfo object for this JRE.</p>
 
    @param sLocation
        [in] a file URL to the directory of the JRE.
-   @param sVendor
-      [in] a name of a vendor. This parameter always contains
-        a vendor string. That is, the string it is not empty.
-   @param sMinVersion
-       [in] represents the minimum version of a JRE.
-   @param sMaxVersion
-       [in] represents the maximum version of a JRE.
-   @param arExcludeList
-       [in] contains a list of "bad" versions. JREs which have one of these
-        versions must not be returned by this function.
    @param ppInfo
        [out] if the function runs successfully then <code>ppInfo</code> contains
         on return a pointer to a <code>JavaInfo</code> object.
@@ -134,37 +106,23 @@ javaPluginError jfw_plugin_getAllJavaInfos(
    javaPluginError::Error an error occurred during execution.</br>
    javaPluginError::InvalidArg an argument was not valid. For example, sLocation
     is an empty string.</br>
-   javaPluginError::WrongVersionFormat the version strings in
-    <code>sMinVersion,sMaxVersion,arExcludeList</code> are not recognized as valid
-    version strings.
    javaPluginError::FailedVersion there is a JRE at the given location but it does not
    meet the version requirements.
-   javaPluginError::NoJre no JRE could be detected at the given location. However, that
-   does not mean necessarily that there is no JRE. There could be a JRE but it has
-   a vendor which is not supported by this API implementation.
+   javaPluginError::NoJre no JRE could be detected at the given location.
  */
 javaPluginError jfw_plugin_getJavaInfoByPath(
     OUString const& sLocation,
-    OUString const& sVendor,
-    OUString const& sMinVersion,
-    OUString const& sMaxVersion,
-    std::vector<OUString> const &arExcludeList,
+    jfw::VendorSettings const & vendorSettings,
     std::unique_ptr<JavaInfo> * ppInfo);
 
 
 /** obtains information for a JRE referenced by the JAVA_HOME environment variable.
 
-   <p>If the JAVA_HOME environment variable is set and points to a JRE whoose vendor
-   matches the requirements given by vecVendorInfos (i.e. it has a vendor that is
-   given in vecVendorInfos and the version requirements for the vendor are met),
+   <p>If the JAVA_HOME environment variable is set and points to a JRE that
+   matches the requirements given by vendorSettings (i.e.
+   the version requirements, if any, for the vendor are met),
    then this function shall return a JavaInfo object for this JRE.</p>
 
-   @param vecVendorInfos
-       [in] vector specifying the vendor and version requirements that the JRE must fulfill.
-       The vector contains pairs of vendors and the respective version requirements
-       for those vendors. The JRE must support the requirements of one given pair in the
-       vector (i.e. it must be of one of the vendors and meet the version requirements
-       - minVersion, maxVersion, excludeVersions - for that specific vendor).
    @param ppInfo
        [out] if the JAVA_HOME environment variable is set and points to a suitable
        JRE, then <code>ppInfo</code> contains
@@ -173,12 +131,12 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
    @return
    javaPluginError::NONE the function ran successfully.</br>
    javaPluginError::NoJre no suitable JRE could be detected at the given location. However, that
-   does not mean necessarily that there is no JRE. There could be a JRE but it has
-   a vendor which is not supported by this API implementation or it does not
+   does not mean necessarily that there is no JRE. There could be a JRE but
+   it does not
    meet the version requirements.
  */
 javaPluginError jfw_plugin_getJavaInfoFromJavaHome(
-    std::vector<std::pair<OUString, jfw::VersionInfo>> const& vecVendorInfos,
+    jfw::VendorSettings const & vendorSettings,
     std::unique_ptr<JavaInfo> * ppInfo,
     std::vector<rtl::Reference<jfw_plugin::VendorBase>> & infos);
 
@@ -187,20 +145,14 @@ javaPluginError jfw_plugin_getJavaInfoFromJavaHome(
     whose executable is in the PATH.
 
     <p>The function gathers information about available JREs which are on the PATH
-    (PATH environment variable) and meet the vendor and version requirements given by
-    <code>vecVendorInfos</code> (i.e. they have a vendor that is given in
-    <code>vecVendorInfos</code> and the version requirements for the vendor are met).
+    (PATH environment variable) and meet the version requirements given by
+    <code>vendorSettings</code> (i.e.
+    the version requirements, if any, for the vendor are met).
     </p>
     <p>
     The JavaInfo structures returned in <code>vecJavaInfosFromPath</code> should be ordered
     according to their occurrence in the PATH. The one that is the first one on the PATH
     is also the first element in the vector.</p>
-    @param vecVendorInfos
-       [in] vector specifying the vendor and version requirements that the JRE must fulfill.
-       The vector contains pairs of vendors and the respective version requirements
-       for those vendors. The JRE must support the requirements of one given pair in the
-       vector (i.e. it must be of one of the vendors and meet the version requirements
-       - minVersion, maxVersion, excludeVersions - for that specific vendor).
     @param vecJavaInfosFromPath
         [out] if the function runs successfully then <code>vecJavaInfosFromPath</code>
         contains on return a vector of pointers to <code>JavaInfo</code> objects.
@@ -216,7 +168,7 @@ javaPluginError jfw_plugin_getJavaInfoFromJavaHome(
  */
 
 javaPluginError jfw_plugin_getJavaInfosFromPath(
-    std::vector<std::pair<OUString, jfw::VersionInfo>> const& vecVendorInfos,
+    jfw::VendorSettings const & vendorSettings,
     std::vector<std::unique_ptr<JavaInfo>> & vecJavaInfosFromPath,
     std::vector<rtl::Reference<jfw_plugin::VendorBase>> & infos);
 
@@ -256,8 +208,6 @@ javaPluginError jfw_plugin_getJavaInfosFromPath(
     @return
     javaPluginError::NONE the function ran successfully.</br>
     javaPluginError::Error an error occurred during execution.</br>
-    javaPluginError::WrongVendor the <code>JavaInfo</code> object was not created
-    in by this library and the VM cannot be started.</br>
     JFW_PLUGIN_E_VM_CREATION_FAILED a VM could not be created. The error was caused
     by the JRE.
  */
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 1f7e4e46624b..386805820d8d 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -52,6 +52,7 @@
 
 #include "jni.h"
 #include "rtl/byteseq.hxx"
+#include <fwkbase.hxx>
 #include "vendorplugin.hxx"
 #include "util.hxx"
 #include "sunversion.hxx"
@@ -292,19 +293,12 @@ javaPluginError checkJavaVersionRequirements(
 
 javaPluginError jfw_plugin_getAllJavaInfos(
     bool checkJavaHomeAndPath,
-    OUString const& sVendor,
-    OUString const& sMinVersion,
-    OUString const& sMaxVersion,
-    std::vector<OUString> const &arExcludeList,
+    jfw::VendorSettings const & vendorSettings,
     std::vector<std::unique_ptr<JavaInfo>>* parJavaInfo,
     std::vector<rtl::Reference<jfw_plugin::VendorBase>> & infos)
 {
     assert(parJavaInfo);
 
-    OSL_ASSERT(!sVendor.isEmpty());
-    if (sVendor.isEmpty())
-        return javaPluginError::InvalidArg;
-
     //Find all JREs
     vector<rtl::Reference<VendorBase> > vecInfos =
         addAllJREInfos(checkJavaHomeAndPath, infos);
@@ -312,17 +306,16 @@ javaPluginError jfw_plugin_getAllJavaInfos(
 
     for (auto const& vecInfo : vecInfos)
     {
+        if (auto const versionInfo = vendorSettings.getVersionInformation(vecInfo->getVendor()))
+        {
+            javaPluginError err = checkJavaVersionRequirements(
+                vecInfo, versionInfo->sMinVersion, versionInfo->sMaxVersion, versionInfo->vecExcludeVersions);
 
-        if (sVendor != vecInfo->getVendor())
-            continue;
-
-        javaPluginError err = checkJavaVersionRequirements(
-            vecInfo, sMinVersion, sMaxVersion, arExcludeList);
-
-        if (err == javaPluginError::FailedVersion || err == javaPluginError::WrongArch)
-            continue;
-        else if (err == javaPluginError::WrongVersionFormat)
-            return err;
+            if (err == javaPluginError::FailedVersion || err == javaPluginError::WrongArch)
+                continue;
+            else if (err == javaPluginError::WrongVersionFormat)
+                return err;
+        }
 
         vecVerifiedInfos.push_back(vecInfo);
     }
@@ -339,10 +332,7 @@ javaPluginError jfw_plugin_getAllJavaInfos(
 
 javaPluginError jfw_plugin_getJavaInfoByPath(
     OUString const& sPath,
-    OUString const& sVendor,
-    OUString const& sMinVersion,
-    OUString const& sMaxVersion,
-    std::vector<OUString> const &arExcludeList,
+    jfw::VendorSettings const & vendorSettings,
     std::unique_ptr<JavaInfo> * ppInfo)
 {
     assert(ppInfo != nullptr);
@@ -350,19 +340,17 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
     if (sPath.isEmpty())
         return javaPluginError::InvalidArg;
 
-    OSL_ASSERT(!sVendor.isEmpty());
-    if (sVendor.isEmpty())
-        return javaPluginError::InvalidArg;
-
     rtl::Reference<VendorBase> aVendorInfo = getJREInfoByPath(sPath);
     if (!aVendorInfo.is())
         return javaPluginError::NoJre;
 
     //Check if the detected JRE matches the version requirements
-    if (sVendor != aVendorInfo->getVendor())
-        return javaPluginError::NoJre;
-    javaPluginError errorcode = checkJavaVersionRequirements(
-            aVendorInfo, sMinVersion, sMaxVersion, arExcludeList);
+    javaPluginError errorcode = javaPluginError::NONE;
+    if (auto const versionInfo = vendorSettings.getVersionInformation(aVendorInfo->getVendor()))
+    {
+        errorcode = checkJavaVersionRequirements(
+            aVendorInfo, versionInfo->sMinVersion, versionInfo->sMaxVersion, versionInfo->vecExcludeVersions);
+    }
 
     if (errorcode == javaPluginError::NONE)
         *ppInfo = createJavaInfo(aVendorInfo);
@@ -371,7 +359,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
 }
 
 javaPluginError jfw_plugin_getJavaInfoFromJavaHome(
-    std::vector<pair<OUString, jfw::VersionInfo>> const& vecVendorInfos,
+    jfw::VendorSettings const & vendorSettings,
     std::unique_ptr<JavaInfo> * ppInfo,
     std::vector<rtl::Reference<VendorBase>> & infos)
 {
@@ -385,32 +373,24 @@ javaPluginError jfw_plugin_getJavaInfoFromJavaHome(
     assert(infoJavaHome.size() == 1);
 
     //Check if the detected JRE matches the version requirements
-    for (auto const& vendorInfo : vecVendorInfos)
-    {
-        const OUString& vendor = vendorInfo.first;
-        jfw::VersionInfo versionInfo = vendorInfo.second;
-
-        if (vendor == infoJavaHome[0]->getVendor())
-        {
-            javaPluginError errorcode = checkJavaVersionRequirements(
+    auto const versionInfo = vendorSettings.getVersionInformation(infoJavaHome[0]->getVendor());
+    if (!versionInfo
+        || (checkJavaVersionRequirements(
                 infoJavaHome[0],
-                versionInfo.sMinVersion,
-                versionInfo.sMaxVersion,
-                versionInfo.vecExcludeVersions);
-
-            if (errorcode == javaPluginError::NONE)
-            {
-                *ppInfo = createJavaInfo(infoJavaHome[0]);
-                return javaPluginError::NONE;
-            }
-        }
+                versionInfo->sMinVersion,
+                versionInfo->sMaxVersion,
+                versionInfo->vecExcludeVersions)
+            == javaPluginError::NONE))
+    {
+        *ppInfo = createJavaInfo(infoJavaHome[0]);
+        return javaPluginError::NONE;
     }
 
     return javaPluginError::NoJre;
 }
 
 javaPluginError jfw_plugin_getJavaInfosFromPath(
-    std::vector<std::pair<OUString, jfw::VersionInfo>> const& vecVendorInfos,
+    jfw::VendorSettings const & vendorSettings,
     std::vector<std::unique_ptr<JavaInfo>> & javaInfosFromPath,
     std::vector<rtl::Reference<jfw_plugin::VendorBase>> & infos)
 {
@@ -423,24 +403,16 @@ javaPluginError jfw_plugin_getJavaInfosFromPath(
     // copy infos of JREs that meet version requirements to vecVerifiedInfos
     for (auto const& infosFromPath : vecInfosFromPath)
     {
-        for (auto const& vendorInfo : vecVendorInfos)
-        {
-            const OUString& vendor = vendorInfo.first;
-            jfw::VersionInfo const & versionInfo = vendorInfo.second;
-
-            if (vendor == infosFromPath->getVendor())
-            {
-                javaPluginError errorcode = checkJavaVersionRequirements(
+        auto const versionInfo = vendorSettings.getVersionInformation(infosFromPath->getVendor());
+        if (!versionInfo
+            || (checkJavaVersionRequirements(
                     infosFromPath,
-                    versionInfo.sMinVersion,
-                    versionInfo.sMaxVersion,
-                    versionInfo.vecExcludeVersions);
-
-                if (errorcode == javaPluginError::NONE)
-                {
-                    vecVerifiedInfos.push_back(createJavaInfo(infosFromPath));
-                }
-            }
+                    versionInfo->sMinVersion,
+                    versionInfo->sMaxVersion,
+                    versionInfo->vecExcludeVersions)
+                == javaPluginError::NONE))
+        {
+            vecVerifiedInfos.push_back(createJavaInfo(infosFromPath));
         }
     }
 
@@ -619,9 +591,6 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
     // unless errorcode is volatile the following warning occurs on gcc:
     // warning: variable 'errorcode' might be clobbered by `longjmp' or `vfork'
     volatile javaPluginError errorcode = javaPluginError::NONE;
-    //Check if the Vendor (pInfo->sVendor) is supported by this plugin
-    if ( ! isVendorSupported(pInfo->sVendor))
-        return javaPluginError::WrongVendor;
 #ifdef MACOSX
     rtl::Reference<VendorBase> aVendorInfo = getJREInfoByPath( OUString( pInfo->sLocation ) );
     if ( !aVendorInfo.is() || aVendorInfo->compareVersions( OUString( pInfo->sVersion ) ) < 0 )
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 3bd50ffe04d4..39b296b483f3 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -1036,6 +1036,7 @@ rtl::Reference<VendorBase> getJREInfoByPath(
         }
     }
 
+    auto knownVendor = false;
     if (!sVendorName.isEmpty())
     {
         //find the creator func for the respective vendor name
@@ -1047,10 +1048,16 @@ rtl::Reference<VendorBase> getJREInfoByPath(
             if (sNameMap == sVendorName)
             {
                 ret = createInstance(gVendorMap[c].createFunc, props);
+                knownVendor = true;
                 break;
             }
         }
     }
+    // For unknown vendors, try SunInfo as fallback:
+    if (!knownVendor)
+    {
+        ret = createInstance(SunInfo::createInstance, props);
+    }
     if (!ret.is())
     {
         vecBadPaths.push_back(sFilePath);
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
index a08b237b62cd..9cdeb5c89c26 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.cxx
@@ -22,9 +22,6 @@
 #include "gnujre.hxx"
 #include "sunjre.hxx"
 #include "otherjre.hxx"
-#include "osl/thread.h"
-#include <stdio.h>
-
 
 namespace jfw_plugin
 {
@@ -51,20 +48,6 @@ BEGIN_VENDOR_MAP()
     VENDOR_MAP_ENTRY("Azul Systems, Inc.", OtherInfo)
 END_VENDOR_MAP()
 
-
-bool isVendorSupported(const OUString& sVendor)
-{
-    const size_t count = sizeof(gVendorMap) / sizeof (VendorSupportMapEntry) - 1;
-    for ( size_t pos = 0; pos < count; ++pos )
-    {
-        if (sVendor.equalsAscii(gVendorMap[pos].sVendorName))
-            return true;
-    }
-    SAL_INFO(
-        "jfw.level2", "sunjavaplugin does not support vendor: " << sVendor);
-    return false;
-}
-
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
index 3947a4d6756f..943fe2cfb2c1 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorlist.hxx
@@ -46,11 +46,6 @@ VendorSupportMapEntry gVendorMap[] ={
 #define END_VENDOR_MAP() \
     {nullptr, nullptr, nullptr} };
 
-/* Examines if the vendor supplied in parameter sVendor is part of the
-   list of supported vendors. That is the arry of VendorSupportMapEntry
-   is search for an respective entry.
-*/
-bool isVendorSupported(const OUString & sVendor);
 }
 
 #endif
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index c72870cb6c6f..35fa5939c6b1 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -26,9 +26,9 @@
 #include "osl/mutex.hxx"
 #include "osl/file.hxx"
 #include "fwkutil.hxx"
-#include "fwkbase.hxx"
+#include <fwkbase.hxx>
 #include "framework.hxx"
-#include "libxmlutil.hxx"
+#include <libxmlutil.hxx>
 #include "osl/thread.hxx"
 #include <algorithm>
 #include "libxml/parser.h"
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index a1a0fe47fd5a..14fcf5b64f0f 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -34,7 +34,7 @@
 #include "framework.hxx"
 #include "fwkutil.hxx"
 #include "elements.hxx"
-#include "fwkbase.hxx"
+#include <fwkbase.hxx>
 
 namespace {
 
@@ -58,8 +58,6 @@ javaFrameworkError jfw_findAllJREs(std::vector<std::unique_ptr<JavaInfo>> *pparI
         osl::MutexGuard guard(jfw::FwkMutex::get());
 
         jfw::VendorSettings aVendorSettings;
-        std::vector<OUString> vecVendors =
-            aVendorSettings.getSupportedVendors();
         //Add the JavaInfos found by jfw_plugin_getAllJavaInfos to the vector
         std::vector<std::unique_ptr<JavaInfo>> vecInfo;
         //get the list of paths to jre locations which have been
@@ -67,70 +65,48 @@ javaFrameworkError jfw_findAllJREs(std::vector<std::unique_ptr<JavaInfo>> *pparI
         const jfw::MergedSettings settings;
         const std::vector<OUString>& vecJRELocations =
             settings.getJRELocations();
-        //Use every plug-in library to get Java installations.
-        for (auto const & vendor: vecVendors)
-        {
-            jfw::VersionInfo versionInfo =
-                aVendorSettings.getVersionInformation(vendor);
+        //Use all plug-in libraries to get Java installations.
+        std::vector<std::unique_ptr<JavaInfo>> arInfos;
+        std::vector<rtl::Reference<jfw_plugin::VendorBase>> infos;
+        javaPluginError plerr = jfw_plugin_getAllJavaInfos(
+            true,
+            aVendorSettings,
+            & arInfos,
+            infos);
 
-            //get all installations of one vendor according to minVersion,
-            //maxVersion and excludeVersions
-            std::vector<std::unique_ptr<JavaInfo>> arInfos;
-            std::vector<rtl::Reference<jfw_plugin::VendorBase>> infos;
-            javaPluginError plerr = jfw_plugin_getAllJavaInfos(
-                true,
-                vendor,
-                versionInfo.sMinVersion,
-                versionInfo.sMaxVersion,
-                versionInfo.vecExcludeVersions,
-                & arInfos,
-                infos);
+        if (plerr != javaPluginError::NONE)
+            return JFW_E_ERROR;
 
-            if (plerr != javaPluginError::NONE)
-                return JFW_E_ERROR;
+        for (auto & j: arInfos)
+            vecInfo.push_back(std::move(j));
 
-            for (auto & j: arInfos)
-                vecInfo.push_back(std::move(j));
+        //Check if any plugin can detect JREs at the location
+        // of the paths added by jfw_addJRELocation
+        //Check every manually added location
+        for (auto const & ii: vecJRELocations)
+        {
+            std::unique_ptr<JavaInfo> aInfo;
+            plerr = jfw_plugin_getJavaInfoByPath(
+                ii,
+                aVendorSettings,
+                &aInfo);
+            if (plerr == javaPluginError::NoJre)
+                continue;
+            if (plerr == javaPluginError::FailedVersion)
+                continue;
+            else if (plerr != javaPluginError::NONE)
+                return JFW_E_ERROR;
 
-            //Check if the current plugin can detect JREs at the location
-            // of the paths added by jfw_addJRELocation
-            //Check every manually added location
-            for (auto const & ii: vecJRELocations)
+            // Was this JRE already added?
+            if (std::find_if(
+                    vecInfo.begin(), vecInfo.end(),
+                    [&aInfo](std::unique_ptr<JavaInfo> const & info) {
+                        return areEqualJavaInfo(
+                            info.get(), aInfo.get());
+                    })
+                == vecInfo.end())
             {
-                std::unique_ptr<JavaInfo> aInfo;
-                plerr = jfw_plugin_getJavaInfoByPath(
-                    ii,
-                    vendor,
-                    versionInfo.sMinVersion,
-                    versionInfo.sMaxVersion,
-                    versionInfo.vecExcludeVersions,
-                    &aInfo);
-                if (plerr == javaPluginError::NoJre)
-                    continue;
-                if (plerr == javaPluginError::FailedVersion)
-                    continue;
-                else if (plerr != javaPluginError::NONE)
-                    return JFW_E_ERROR;
-
-                // Was this JRE already added?  Different plugins could detect
-                // the same JRE.  Also make sure vecInfo contains only JavaInfos
-                // for the vendors for which there is a javaSelection/plugins/
-                // library entry in the javavendors.xml; jfw_getJavaInfoByPath
-                // can return a JavaInfo of any vendor:
-                if ((std::find_if(
-                         vecInfo.begin(), vecInfo.end(),
-                         [&aInfo](std::unique_ptr<JavaInfo> const & info) {
-                             return areEqualJavaInfo(
-                                 info.get(), aInfo.get());
-                         })
-                     == vecInfo.end())
-                    && (std::find(
-                            vecVendors.begin(), vecVendors.end(),
-                            aInfo->sVendor)
-                        != vecVendors.end()))
-                {
-                    vecInfo.push_back(std::move(aInfo));
-                }
+                vecInfo.push_back(std::move(aInfo));
             }
         }
 
@@ -298,7 +274,6 @@ javaFrameworkError jfw_startVM(
             g_pJavaVM = pVm;
             *ppVM = pVm;
         }
-        OSL_ASSERT(plerr != javaPluginError::WrongVendor);
     }
     catch (const jfw::FrameworkException& e)
     {
@@ -338,25 +313,13 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
 
         // get list of vendors for Java installations
         jfw::VendorSettings aVendorSettings;
-        std::vector<OUString> vecVendors =
-            aVendorSettings.getSupportedVendors();
-
-        // save vendors and respective version requirements pair-wise in a vector
-        std::vector<std::pair<OUString, jfw::VersionInfo>> versionInfos;
-        for (auto const & vendor : vecVendors)
-        {
-            jfw::VersionInfo versionInfo =
-                aVendorSettings.getVersionInformation(vendor);
-
-            versionInfos.emplace_back(vendor, versionInfo);
-        }
 
         std::vector<rtl::Reference<jfw_plugin::VendorBase>> infos;
 
         // first inspect Java installation that the JAVA_HOME
         // environment variable points to (if it is set)
         if (jfw_plugin_getJavaInfoFromJavaHome(
-                versionInfos, &aCurrentInfo, infos)
+                aVendorSettings, &aCurrentInfo, infos)
             == javaPluginError::NONE)
         {
             // compare features
@@ -374,7 +337,7 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
         {
             std::vector<std::unique_ptr<JavaInfo>> vecJavaInfosFromPath;
             if (jfw_plugin_getJavaInfosFromPath(
-                    versionInfos, vecJavaInfosFromPath, infos)
+                    aVendorSettings, vecJavaInfosFromPath, infos)
                 == javaPluginError::NONE)
             {
                 for (auto & pJInfo: vecJavaInfosFromPath)
@@ -400,31 +363,20 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
 
 
         // if no suitable Java installation has been found yet:
-        // first iterate over all vendors to find a suitable Java installation,
+        // first use jfw_plugin_getAllJavaInfos to find a suitable Java installation,
         // then try paths that have been added manually
         if (!bInfoFound)
         {
-            //Use every vendor to get Java installations. At the first usable
-            //Java the loop will break
-            for (auto const & vendor : vecVendors)
+            //get all installations
+            std::vector<std::unique_ptr<JavaInfo>> arInfos;
+            javaPluginError plerr = jfw_plugin_getAllJavaInfos(
+                false,
+                aVendorSettings,
+                & arInfos,
+                infos);
+
+            if (plerr == javaPluginError::NONE)
             {
-                jfw::VersionInfo versionInfo =
-                    aVendorSettings.getVersionInformation(vendor);
-
-                //get all installations of one vendor according to minVersion,
-                //maxVersion and excludeVersions
-                std::vector<std::unique_ptr<JavaInfo>> arInfos;
-                javaPluginError plerr = jfw_plugin_getAllJavaInfos(
-                    false,
-                    vendor,
-                    versionInfo.sMinVersion,
-                    versionInfo.sMaxVersion,
-                    versionInfo.vecExcludeVersions,
-                    & arInfos,
-                    infos);
-
-                if (plerr != javaPluginError::NONE)
-                    continue;
                 //iterate over all installations to find the best which has
                 //all features
                 for (auto & pJInfo: arInfos)
@@ -437,7 +389,6 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
                         //the just found Java implements all required features
                         //currently there is only accessibility!!!
                         aCurrentInfo = std::move(pJInfo);
-                        bInfoFound = true;
                         break;
                     }
                     else if (!aCurrentInfo)
@@ -447,12 +398,8 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
                         aCurrentInfo = std::move(pJInfo);
                     }
                 }
-
-                if (bInfoFound)
-                    break;
-                //All Java installations found by the current plug-in lib
-                //do not provide the required features. Try the next plug-in
             }
+
             if (!aCurrentInfo)
             {//The plug-ins did not find a suitable Java. Now try the paths which have been
             //added manually.
@@ -461,53 +408,41 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
                 //node.loadFromSettings();
                 const std::vector<OUString> & vecJRELocations =
                     settings.getJRELocations();
-                //use every plug-in to determine the JavaInfo objects
-                for (auto const & vendor : vecVendors)
+                //use all plug-ins to determine the JavaInfo objects
+                for (auto const & JRELocation : vecJRELocations)
                 {
-                    jfw::VersionInfo versionInfo =
-                        aVendorSettings.getVersionInformation(vendor);
-
-                    for (auto const & JRELocation : vecJRELocations)
+                    std::unique_ptr<JavaInfo> aInfo;
+                    javaPluginError err = jfw_plugin_getJavaInfoByPath(
+                        JRELocation,
+                        aVendorSettings,
+                        &aInfo);
+                    if (err == javaPluginError::NoJre)
+                        continue;
+                    if (err == javaPluginError::FailedVersion)
+                        continue;
+                    else if (err !=javaPluginError::NONE)
+                        return JFW_E_ERROR;
+
+                    if (aInfo)
                     {
-                        std::unique_ptr<JavaInfo> aInfo;
-                        javaPluginError err = jfw_plugin_getJavaInfoByPath(
-                            JRELocation,
-                            vendor,
-                            versionInfo.sMinVersion,
-                            versionInfo.sMaxVersion,
-                            versionInfo.vecExcludeVersions,
-                            &aInfo);
-                        if (err == javaPluginError::NoJre)
-                            continue;
-                        if (err == javaPluginError::FailedVersion)
-                            continue;
-                        else if (err !=javaPluginError::NONE)
-                            return JFW_E_ERROR;
-
-                        if (aInfo)
+                        // compare features
+                        // If the user does not require any features (nFeatureFlags = 0)
+                        // then the first installation is used
+                        if ((aInfo->nFeatures & nFeatureFlags) == nFeatureFlags)
                         {
-                            // compare features
-                            // If the user does not require any features (nFeatureFlags = 0)
-                            // then the first installation is used
-                            if ((aInfo->nFeatures & nFeatureFlags) == nFeatureFlags)
-                            {
-                                //the just found Java implements all required features
-                                //currently there is only accessibility!!!
-                                aCurrentInfo = std::move(aInfo);
-                                bInfoFound = true;
-                                break;
-                            }
-                            else if (!aCurrentInfo)
-                            {
-                                // We remember the very first installation in
-                                // aCurrentInfo:
-                                aCurrentInfo = std::move(aInfo);
-                            }
+                            //the just found Java implements all required features
+                            //currently there is only accessibility!!!
+                            aCurrentInfo = std::move(aInfo);
+                            break;
                         }
-                    }//end iterate over paths
-                    if (bInfoFound)
-                        break;
-                }// end iterate plug-ins
+                        else if (!aCurrentInfo)
+                        {
+                            // We remember the very first installation in
+                            // aCurrentInfo:
+                            aCurrentInfo = std::move(aInfo);
+                        }
+                    }
+                }//end iterate over paths
             }
         }
         if (aCurrentInfo)
@@ -621,43 +556,21 @@ javaFrameworkError jfw_getJavaInfoByPath(OUString const & pPath, std::unique_ptr
         osl::MutexGuard guard(jfw::FwkMutex::get());
 
         jfw::VendorSettings aVendorSettings;
-        std::vector<OUString> vecVendors =
-            aVendorSettings.getSupportedVendors();
 
-        //Use every plug-in library to determine if the path represents a
-        //JRE. If a plugin recognized it then the loop will break
-        for (auto const & vendor : vecVendors)
-        {
-            jfw::VersionInfo versionInfo =
-                aVendorSettings.getVersionInformation(vendor);
-
-            //ask the plugin if this is a JRE.
-            //If so check if it meets the version requirements.
-            //Only if it does return a JavaInfo
-            javaPluginError plerr = jfw_plugin_getJavaInfoByPath(
-                pPath,
-                vendor,
-                versionInfo.sMinVersion,
-                versionInfo.sMaxVersion,
-                versionInfo.vecExcludeVersions,
-                ppInfo);
+        //ask all plugins if this is a JRE.
+        //If so check if it meets the version requirements.
+        //Only if it does return a JavaInfo
+        javaPluginError plerr = jfw_plugin_getJavaInfoByPath(
+            pPath,
+            aVendorSettings,
+            ppInfo);
 
-            if (plerr == javaPluginError::NONE)
-            {
-                break;
-            }
-            else if(plerr == javaPluginError::FailedVersion)
-            {//found JRE but it has the wrong version
-                ppInfo->reset();
-                errcode = JFW_E_FAILED_VERSION;
-                break;
-            }
-            else if (plerr == javaPluginError::NoJre)
-            {// plugin does not recognize this path as belonging to JRE
-                continue;
-            }
-            OSL_ASSERT(false);
+        if(plerr == javaPluginError::FailedVersion)
+        {//found JRE but it has the wrong version
+            ppInfo->reset();
+            errcode = JFW_E_FAILED_VERSION;
         }
+        OSL_ASSERT(plerr == javaPluginError::NONE || plerr == javaPluginError::NoJre);
         if (!*ppInfo && errcode != JFW_E_FAILED_VERSION)
             errcode = JFW_E_NOT_RECOGNIZED;
     }
diff --git a/jvmfwk/source/fwkbase.cxx b/jvmfwk/source/fwkbase.cxx
index dbab7d4a9e7a..36f973f3e0a4 100644
--- a/jvmfwk/source/fwkbase.cxx
+++ b/jvmfwk/source/fwkbase.cxx
@@ -28,7 +28,7 @@
 #include "framework.hxx"
 #include "fwkutil.hxx"
 #include "elements.hxx"
-#include "fwkbase.hxx"
+#include <fwkbase.hxx>
 
 using namespace osl;
 
@@ -118,11 +118,23 @@ VendorSettings::VendorSettings():
     }
 }
 
-VersionInfo VendorSettings::getVersionInformation(const OUString & sVendor)
+boost::optional<VersionInfo> VendorSettings::getVersionInformation(const OUString & sVendor) const
 {
     OSL_ASSERT(!sVendor.isEmpty());
-    VersionInfo aVersionInfo;
     OString osVendor = OUStringToOString(sVendor, RTL_TEXTENCODING_UTF8);
+    CXPathObjectPtr pathObject;
+    pathObject = xmlXPathEvalExpression(
+        reinterpret_cast<xmlChar const *>(
+            OString(
+                "/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"" + osVendor
+                + "\"]/jf:minVersion").getStr()),
+        m_xmlPathContextVendorSettings);
+    if (xmlXPathNodeSetIsEmpty(pathObject->nodesetval))
+    {
+        return {};
+    }
+
+    VersionInfo aVersionInfo;
     //Get minVersion
     OString sExpression = OString(
         "/jf:javaSelection/jf:vendorInfos/jf:vendor[@name=\"") +
diff --git a/jvmfwk/source/libxmlutil.cxx b/jvmfwk/source/libxmlutil.cxx
index d2fe64e391a5..5f1ec5784eb5 100644
--- a/jvmfwk/source/libxmlutil.cxx
+++ b/jvmfwk/source/libxmlutil.cxx
@@ -17,7 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include "libxmlutil.hxx"
+#include <libxmlutil.hxx>
 
 namespace jfw
 {
commit 3f40dadbfeedf9cb2a214610bd39898f2b539edd
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Jan 22 08:12:50 2019 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu May 30 16:25:03 2019 +0200

    Silence bogus -Werror=clobbered (GCC 7 --enable-optimized)
    
    > In file included from gcc/include/c++/7.1.1/vector:69:0,
    >                  from jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx:39:
    > gcc/include/c++/7.1.1/bits/vector.tcc: In function ‘javaPluginError jfw_plugin_startJavaVirtualMachine(const JavaInfo*, const JavaVMOption*, sal_Int32, JavaVM**, JNIEnv**)’:
    > gcc/include/c++/7.1.1/bits/vector.tcc:407:15: error: variable ‘__new_finish’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Werror=clobbered]
    >        pointer __new_finish(__new_start);
    >                ^~~~~~~~~~~~
    
    Change-Id: Iefabac65871ed79bcfa333f0193fcbbd1369f7f1
    Reviewed-on: https://gerrit.libreoffice.org/66714
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    (cherry picked from commit 58f30cf1fe401452c0297703fe08a9aa14bd55f3)

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 0db41bec8e87..1f7e4e46624b 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -847,7 +847,14 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
 #endif
 
    return errorcode;
+#if defined __GNUC__ && __GNUC__ == 7 && !defined __clang__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wclobbered"
+#endif
 }
+#if defined __GNUC__ && __GNUC__ == 7 && !defined __clang__
+#pragma GCC diagnostic pop
+#endif
 
 javaPluginError jfw_plugin_existJRE(const JavaInfo *pInfo, bool *exist)
 {
commit ad4105e469bd80176e51919c32af19fe3cd37c3c
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Thu Oct 12 20:32:17 2017 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu May 30 16:22:30 2019 +0200

    Use loop ranges in jvmfwk
    
    to simplify and avoid all the typedefs
    
    (cherry picked from commit 2ea531c0578bb7f0a34ec7de0aaea595e0387928)
    
    Conflicts:
            jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
            jvmfwk/plugins/sunmajor/pluginlib/util.cxx
    
    Change-Id: Ia14337dd71b55fc24f162b5436af76aeeb8d2575
    Reviewed-on: https://gerrit.libreoffice.org/43346
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 1f4dac0e9e25..0db41bec8e87 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -310,31 +310,28 @@ javaPluginError jfw_plugin_getAllJavaInfos(
         addAllJREInfos(checkJavaHomeAndPath, infos);
     vector<rtl::Reference<VendorBase> > vecVerifiedInfos;
 
-    typedef vector<rtl::Reference<VendorBase> >::iterator it;
-    for (it i= vecInfos.begin(); i != vecInfos.end(); ++i)
+    for (auto const& vecInfo : vecInfos)
     {
-        const rtl::Reference<VendorBase>& cur = *i;
 
-        if (sVendor != cur->getVendor())
+        if (sVendor != vecInfo->getVendor())
             continue;
 
         javaPluginError err = checkJavaVersionRequirements(
-            cur, sMinVersion, sMaxVersion, arExcludeList);
+            vecInfo, sMinVersion, sMaxVersion, arExcludeList);
 
         if (err == javaPluginError::FailedVersion || err == javaPluginError::WrongArch)
             continue;
         else if (err == javaPluginError::WrongVersionFormat)
             return err;
 
-        vecVerifiedInfos.push_back(*i);
+        vecVerifiedInfos.push_back(vecInfo);
     }
     //Now vecVerifiedInfos contains all those JREs which meet the version requirements
     //Transfer them into the array that is passed out.
     parJavaInfo->clear();
-    typedef vector<rtl::Reference<VendorBase> >::const_iterator cit;
-    for (cit ii = vecVerifiedInfos.begin(); ii != vecVerifiedInfos.end(); ++ii)
+    for (auto const& vecVerifiedInfo : vecVerifiedInfos)
     {
-        parJavaInfo->push_back(createJavaInfo(*ii));
+        parJavaInfo->push_back(createJavaInfo(vecVerifiedInfo));
     }
 
     return javaPluginError::NONE;
@@ -388,11 +385,10 @@ javaPluginError jfw_plugin_getJavaInfoFromJavaHome(
     assert(infoJavaHome.size() == 1);
 
     //Check if the detected JRE matches the version requirements
-    typedef std::vector<pair<OUString, jfw::VersionInfo>>::const_iterator ci_pl;
-    for (ci_pl vendorInfo = vecVendorInfos.begin(); vendorInfo != vecVendorInfos.end(); ++vendorInfo)
+    for (auto const& vendorInfo : vecVendorInfos)
     {
-        const OUString& vendor = vendorInfo->first;
-        jfw::VersionInfo versionInfo = vendorInfo->second;
+        const OUString& vendor = vendorInfo.first;
+        jfw::VersionInfo versionInfo = vendorInfo.second;
 
         if (vendor == infoJavaHome[0]->getVendor())
         {
@@ -425,28 +421,24 @@ javaPluginError jfw_plugin_getJavaInfosFromPath(
     vector<std::unique_ptr<JavaInfo>> vecVerifiedInfos;
 
     // copy infos of JREs that meet version requirements to vecVerifiedInfos
-    typedef vector<rtl::Reference<VendorBase> >::iterator it;
-    for (it i= vecInfosFromPath.begin(); i != vecInfosFromPath.end(); ++i)
+    for (auto const& infosFromPath : vecInfosFromPath)
     {
-        const rtl::Reference<VendorBase>& currentInfo = *i;
-
-        typedef std::vector<pair<OUString, jfw::VersionInfo>>::const_iterator ci_pl;
-        for (ci_pl vendorInfo = vecVendorInfos.begin(); vendorInfo != vecVendorInfos.end(); ++vendorInfo)
+        for (auto const& vendorInfo : vecVendorInfos)
         {
-            const OUString& vendor = vendorInfo->first;
-            jfw::VersionInfo const & versionInfo = vendorInfo->second;
+            const OUString& vendor = vendorInfo.first;
+            jfw::VersionInfo const & versionInfo = vendorInfo.second;
 
-            if (vendor == currentInfo->getVendor())
+            if (vendor == infosFromPath->getVendor())
             {
                 javaPluginError errorcode = checkJavaVersionRequirements(
-                    currentInfo,
+                    infosFromPath,
                     versionInfo.sMinVersion,
                     versionInfo.sMaxVersion,
                     versionInfo.vecExcludeVersions);
 
                 if (errorcode == javaPluginError::NONE)
                 {
-                    vecVerifiedInfos.push_back(createJavaInfo(currentInfo));
+                    vecVerifiedInfos.push_back(createJavaInfo(infosFromPath));
                 }
             }
         }
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
index 1f7423045bc1..92be3f3c96db 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/vendorbase.cxx
@@ -58,32 +58,29 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
     //get java.vendor, java.version, java.home,
     //javax.accessibility.assistive_technologies from system properties
 
-    typedef vector<pair<OUString, OUString> >::const_iterator it_prop;
-
     bool bVersion = false;
     bool bVendor = false;
     bool bHome = false;
     bool bAccess = false;
     bool bArch = false;
 
-    typedef vector<pair<OUString, OUString> >::const_iterator it_prop;
-    for (it_prop i = props.begin(); i != props.end(); ++i)
+    for (auto const& prop : props)
     {
-        if(! bVendor && i->first == "java.vendor")
+        if(! bVendor && prop.first == "java.vendor")
         {
-            m_sVendor = i->second;
+            m_sVendor = prop.second;
             bVendor = true;
         }
-        else if (!bVersion && i->first == "java.version")
+        else if (!bVersion && prop.first == "java.version")
         {
-            m_sVersion = i->second;
+            m_sVersion = prop.second;
             bVersion = true;
         }
-        else if (!bHome && i->first == "java.home")
+        else if (!bHome && prop.first == "java.home")
         {
 #ifndef JVM_ONE_PATH_CHECK
            OUString fileURL;
-           if (osl_getFileURLFromSystemPath(i->second.pData,& fileURL.pData) ==
+           if (osl_getFileURLFromSystemPath(prop.second.pData,& fileURL.pData) ==
                osl_File_E_None)
            {
                //make sure that the drive letter have all the same case
@@ -96,19 +93,19 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
                }
            }
 #else
-           m_sHome = i->second;
+           m_sHome = prop.second;
            bHome = true;
 #endif
         }
-        else if (!bArch && i->first == "os.arch")
+        else if (!bArch && prop.first == "os.arch")
         {
-            m_sArch = i->second;
+            m_sArch = prop.second;
             bArch = true;
         }
         else if (!bAccess
-                 && i->first == "javax.accessibility.assistive_technologies")
+                 && prop.first == "javax.accessibility.assistive_technologies")
         {
-            if (!i->second.isEmpty())
+            if (!prop.second.isEmpty())
             {
                 m_bAccessibility = true;
                 bAccess = true;
@@ -130,11 +127,10 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
     vector<OUString> libpaths = getVectorFromCharArray(arRtPaths, size);
 
     bool bRt = false;
-    typedef vector<OUString>::const_iterator i_path;
-    for(i_path ip = libpaths.begin(); ip != libpaths.end(); ++ip)
+    for (auto const& libpath : libpaths)
     {
         //Construct an absolute path to the possible runtime
-        OUString usRt= m_sHome + *ip;
+        OUString usRt= m_sHome + libpath;
         DirectoryItem item;
         if(DirectoryItem::get(usRt, item) == File::E_None)
         {
@@ -157,9 +153,9 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
     OUString sPathSep= OUString::createFromAscii(arSep);
     bool bLdPath = true;
     int c = 0;
-    for(i_path il = ld_paths.begin(); il != ld_paths.end(); ++il, ++c)
+    for (auto const& ld_path : ld_paths)
     {
-        OUString usAbsUrl= m_sHome + *il;
+        OUString usAbsUrl= m_sHome + ld_path;
         // convert to system path
         OUString usSysPath;
         if(File::getSystemPathFromFileURL(usAbsUrl, usSysPath) == File::E_None)
@@ -174,6 +170,7 @@ bool VendorBase::initialize(vector<pair<OUString, OUString> > props)
             bLdPath = false;
             break;
         }
+        ++c;
     }
     return bLdPath;
 }
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 353eab37ba6f..c72870cb6c6f 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -496,11 +496,10 @@ void NodeJava::write() const
             xmlAddChild(vmParameters, nodeCrLf);
         }
 
-        typedef std::vector<OUString>::const_iterator cit;
-        for (cit i = m_vmParameters->begin(); i != m_vmParameters->end(); ++i)
+        for (auto const & vmParameter : *m_vmParameters)
         {
             xmlNewTextChild(vmParameters, nullptr, reinterpret_cast<xmlChar const *>("param"),
-                            CXmlCharPtr(*i));
+                            CXmlCharPtr(vmParameter));
             //add a new line
             xmlNode * nodeCrLf = xmlNewText(reinterpret_cast<xmlChar const *>("\n"));
             xmlAddChild(vmParameters, nodeCrLf);
@@ -537,11 +536,10 @@ void NodeJava::write() const
             xmlAddChild(jreLocationsNode, nodeCrLf);
         }
 
-        typedef std::vector<OUString>::const_iterator cit;
-        for (cit i = m_JRELocations->begin(); i != m_JRELocations->end(); ++i)
+        for (auto const & JRELocation : *m_JRELocations)
         {
             xmlNewTextChild(jreLocationsNode, nullptr, reinterpret_cast<xmlChar const *>("location"),
-                            CXmlCharPtr(*i));
+                            CXmlCharPtr(JRELocation));
             //add a new line
             xmlNode * nodeCrLf = xmlNewText(reinterpret_cast<xmlChar const *>("\n"));
             xmlAddChild(jreLocationsNode, nodeCrLf);
@@ -989,10 +987,9 @@ void MergedSettings::merge(const NodeJava & share, const NodeJava & user)
 ::std::vector< OString> MergedSettings::getVmParametersUtf8() const
 {
     ::std::vector< OString> ret;
-    typedef ::std::vector< OUString>::const_iterator cit;
-    for (cit i = m_vmParams.begin(); i != m_vmParams.end(); ++i)
+    for (auto const & vmParam : m_vmParams)
     {
-        ret.push_back( OUStringToOString(*i, RTL_TEXTENCODING_UTF8));
+        ret.push_back( OUStringToOString(vmParam, RTL_TEXTENCODING_UTF8));
     }
     return ret;
 }
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index 5d401a0486ca..a1a0fe47fd5a 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -264,10 +264,9 @@ javaFrameworkError jfw_startVM(
 
         //add the options set by options dialog
         int index = 2;
-        typedef std::vector<OString>::const_iterator cit;
-        for (cit i = vmParams.begin(); i != vmParams.end(); ++i)
+        for (auto const & vmParam : vmParams)
         {
-            arOpt[index].optionString = const_cast<sal_Char*>(i->getStr());
+            arOpt[index].optionString = const_cast<sal_Char*>(vmParam.getStr());
             arOpt[index].extraInfo = nullptr;
             index ++;
         }
@@ -344,10 +343,8 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
 
         // save vendors and respective version requirements pair-wise in a vector
         std::vector<std::pair<OUString, jfw::VersionInfo>> versionInfos;
-        typedef std::vector<OUString>::const_iterator ciVendor;
-        for (ciVendor i = vecVendors.begin(); i != vecVendors.end(); ++i)
+        for (auto const & vendor : vecVendors)
         {
-            const OUString & vendor = *i;
             jfw::VersionInfo versionInfo =
                 aVendorSettings.getVersionInformation(vendor);
 
@@ -409,10 +406,8 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
         {
             //Use every vendor to get Java installations. At the first usable
             //Java the loop will break
-            typedef std::vector<OUString>::const_iterator ci_pl;
-            for (ci_pl i = vecVendors.begin(); i != vecVendors.end(); ++i)
+            for (auto const & vendor : vecVendors)
             {
-                const OUString & vendor = *i;
                 jfw::VersionInfo versionInfo =
                     aVendorSettings.getVersionInformation(vendor);
 
@@ -467,19 +462,16 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
                 const std::vector<OUString> & vecJRELocations =
                     settings.getJRELocations();
                 //use every plug-in to determine the JavaInfo objects
-                for (ci_pl i = vecVendors.begin(); i != vecVendors.end(); ++i)
+                for (auto const & vendor : vecVendors)
                 {
-                    const OUString & vendor = *i;
                     jfw::VersionInfo versionInfo =
                         aVendorSettings.getVersionInformation(vendor);
 
-                    typedef std::vector<OUString>::const_iterator citLoc;
-                    for (citLoc it = vecJRELocations.begin();
-                        it != vecJRELocations.end(); ++it)
+                    for (auto const & JRELocation : vecJRELocations)
                     {
                         std::unique_ptr<JavaInfo> aInfo;
                         javaPluginError err = jfw_plugin_getJavaInfoByPath(
-                            *it,
+                            JRELocation,
                             vendor,
                             versionInfo.sMinVersion,
                             versionInfo.sMaxVersion,
@@ -634,10 +626,8 @@ javaFrameworkError jfw_getJavaInfoByPath(OUString const & pPath, std::unique_ptr
 
         //Use every plug-in library to determine if the path represents a
         //JRE. If a plugin recognized it then the loop will break
-        typedef std::vector<OUString>::const_iterator ci_pl;
-        for (ci_pl i = vecVendors.begin(); i != vecVendors.end(); ++i)
+        for (auto const & vendor : vecVendors)
         {
-            const OUString & vendor = *i;
             jfw::VersionInfo versionInfo =
                 aVendorSettings.getVersionInformation(vendor);
 
commit e19635027d39cda6b7ee4da5d6c7e974be17968a
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Sep 11 11:29:40 2017 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu May 30 16:13:03 2019 +0200

    clang-tidy modernize-use-emplace in hwpfilter..lotuswordpro
    
    (cherry picked from commit 7ca4ea54b4d610104df1b88ae5b04c2081a4a429)
    
    Change-Id: Ic11634ca28396fd156390c511087bae03bd5fb70
    Reviewed-on: https://gerrit.libreoffice.org/42156
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 65c5c9d8d748..1f4dac0e9e25 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -722,7 +722,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
     // JNI_CreateJavaVM. This happens when the LD_LIBRARY_PATH does not contain
     // all some directories of the Java installation. This is necessary for
     // all versions below 1.5.1
-    options.push_back(Option("abort", reinterpret_cast<void*>(abort_handler)));
+    options.emplace_back("abort", reinterpret_cast<void*>(abort_handler));
     bool hasStackSize = false;
     for (int i = 0; i < cOptions; i++)
     {
@@ -743,10 +743,10 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
         if (opt.startsWith("-Xss")) {
             hasStackSize = true;
         }
-        options.push_back(Option(opt, arOptions[i].extraInfo));
+        options.emplace_back(opt, arOptions[i].extraInfo);
     }
     if (addForceInterpreted) {
-        options.push_back(Option("-Xint", nullptr));
+        options.emplace_back("-Xint", nullptr);
     }
     if (!hasStackSize) {
 #if defined LINUX && (defined X86 || defined X86_64)
@@ -772,8 +772,7 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
                     "jfw", "huge RLIMIT_STACK " << l.rlim_cur << " -> 8192K");
                 l.rlim_cur = 8192 * 1024;
             }
-            options.push_back(
-                Option("-Xss" + OString::number(l.rlim_cur), nullptr));
+            options.emplace_back("-Xss" + OString::number(l.rlim_cur), nullptr);
         } else {
             int e = errno;
             SAL_WARN("jfw", "getrlimit(RLIMIT_STACK) failed with errno " << e);
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 8a0138eee239..3bd50ffe04d4 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -528,7 +528,7 @@ bool getJavaProps(const OUString & exePath,
         }
 #endif
 
-        props.push_back(std::make_pair(sKey, sVal));
+        props.emplace_back(sKey, sVal);
     }
 
     if (rs != FileHandleReader::RESULT_ERROR && !props.empty())
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index ddc5e6c19747..5d401a0486ca 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -351,8 +351,7 @@ javaFrameworkError jfw_findAndSelectJRE(std::unique_ptr<JavaInfo> *pInfo)
             jfw::VersionInfo versionInfo =
                 aVendorSettings.getVersionInformation(vendor);
 
-            versionInfos.push_back(
-                std::pair<OUString, jfw::VersionInfo>(vendor, versionInfo));
+            versionInfos.emplace_back(vendor, versionInfo);
         }
 
         std::vector<rtl::Reference<jfw_plugin::VendorBase>> infos;
commit 729f64daed2fd7dfaca48e338e2e57ddfebd5400
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jul 13 12:43:20 2017 +0200
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Thu May 30 16:09:17 2019 +0200

    use more OUString::operator== in forms..sal
    
    (cherry picked from commit 3697b87b70c69e17e1d0398e0192a11dab179fe3)
    
    Change-Id: I70d7e50f8c1e019524ccad915f0cca912c5035dc
    Reviewed-on: https://gerrit.libreoffice.org/39899
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
index 1750696ab018..b5da6f926324 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx
@@ -115,22 +115,22 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
     typedef vector<pair<OUString, OUString> >::const_iterator it_prop;
     for (it_prop i = props.begin(); i != props.end(); ++i)
     {
-        if(! bVendor && sVendorProperty.equals(i->first))
+        if(! bVendor && sVendorProperty == i->first)
         {
             m_sVendor = i->second;
             bVendor = true;
         }
-        else if (!bVersion && sVersionProperty.equals(i->first))
+        else if (!bVersion && sVersionProperty == i->first)
         {
             m_sVersion = i->second;
             bVersion = true;
         }
-        else if (!bHome && sGNUHomeProperty.equals(i->first))
+        else if (!bHome && sGNUHomeProperty == i->first)
         {
             m_sHome = i->second;
             bHome = true;
         }
-        else if (!bJavaHome && sJavaHomeProperty.equals(i->first))
+        else if (!bJavaHome && sJavaHomeProperty == i->first)
         {
            OUString fileURL;
            if (osl_getFileURLFromSystemPath(i->second.pData,& fileURL.pData) ==
@@ -146,13 +146,13 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props)
                }
            }
         }
-        else if (!bJavaLibraryPath && sJavaLibraryPathProperty.equals(i->first))
+        else if (!bJavaLibraryPath && sJavaLibraryPathProperty == i->first)
         {
             sal_Int32 nIndex = 0;
             osl_getFileURLFromSystemPath(i->second.getToken(0, ':', nIndex).pData, &sJavaLibraryPath.pData);
             bJavaLibraryPath = true;
         }
-        else if (!bAccess && sAccessProperty.equals(i->first))
+        else if (!bAccess && sAccessProperty == i->first)
         {
             if (!i->second.isEmpty())
             {
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 0bd412408b3b..65c5c9d8d748 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -315,7 +315,7 @@ javaPluginError jfw_plugin_getAllJavaInfos(
     {
         const rtl::Reference<VendorBase>& cur = *i;
 
-        if (!sVendor.equals(cur->getVendor()))
+        if (sVendor != cur->getVendor())
             continue;
 
         javaPluginError err = checkJavaVersionRequirements(
@@ -362,7 +362,7 @@ javaPluginError jfw_plugin_getJavaInfoByPath(
         return javaPluginError::NoJre;
 
     //Check if the detected JRE matches the version requirements
-    if (!sVendor.equals(aVendorInfo->getVendor()))
+    if (sVendor != aVendorInfo->getVendor())
         return javaPluginError::NoJre;
     javaPluginError errorcode = checkJavaVersionRequirements(
             aVendorInfo, sMinVersion, sMaxVersion, arExcludeList);
@@ -394,7 +394,7 @@ javaPluginError jfw_plugin_getJavaInfoFromJavaHome(
         const OUString& vendor = vendorInfo->first;
         jfw::VersionInfo versionInfo = vendorInfo->second;
 
-        if (vendor.equals(infoJavaHome[0]->getVendor()))
+        if (vendor == infoJavaHome[0]->getVendor())
         {
             javaPluginError errorcode = checkJavaVersionRequirements(
                 infoJavaHome[0],
@@ -436,7 +436,7 @@ javaPluginError jfw_plugin_getJavaInfosFromPath(
             const OUString& vendor = vendorInfo->first;
             jfw::VersionInfo const & versionInfo = vendorInfo->second;
 
-            if (vendor.equals(currentInfo->getVendor()))
+            if (vendor == currentInfo->getVendor())
             {
                 javaPluginError errorcode = checkJavaVersionRequirements(
                     currentInfo,
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index 3c31e60c63e6..8a0138eee239 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -1044,7 +1044,7 @@ rtl::Reference<VendorBase> getJREInfoByPath(
         {
             OUString sNameMap(gVendorMap[c].sVendorName, strlen(gVendorMap[c].sVendorName),
                               RTL_TEXTENCODING_ASCII_US);
-            if (sNameMap.equals(sVendorName))
+            if (sNameMap == sVendorName)
             {
                 ret = createInstance(gVendorMap[c].createFunc, props);
                 break;
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
index 74497337be90..413e6aa771f9 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.hxx
@@ -69,7 +69,7 @@ struct InfoFindSame
 
     bool operator () (const rtl::Reference<VendorBase> & aVendorInfo)
     {
-        return aVendorInfo->getHome().equals(sJava);
+        return aVendorInfo->getHome() == sJava;
     }
 };
 


More information about the Libreoffice-commits mailing list