diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-08-26 16:00:41 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-08-26 16:20:50 +0200 |
commit | 3cb10e9220da27ca7db2f68007be9e310bdefc4d (patch) | |
tree | 485da09801dad613e86a2607b250769900d91fd0 | |
parent | 975e230f08a664c5afc596d07ea9165e667c28f0 (diff) |
unodevtools: drop support for skeletonmaker --java4 parameter
Minimum requirement has been Java 1.5 for years now.
Change-Id: Id512507db1fc12c92d8f7662505eda6866da2fc6
-rw-r--r-- | odk/docs/tools.html | 3 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/javacompskeleton.cxx | 57 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/javatypemaker.cxx | 10 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/skeletoncommon.cxx | 26 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/skeletoncommon.hxx | 3 | ||||
-rw-r--r-- | unodevtools/source/skeletonmaker/skeletonmaker.cxx | 10 |
6 files changed, 34 insertions, 75 deletions
diff --git a/odk/docs/tools.html b/odk/docs/tools.html index 1fdf392ecb6f..a3e5571ffd85 100644 --- a/odk/docs/tools.html +++ b/odk/docs/tools.html @@ -714,9 +714,8 @@ types the specified types depend on.</p> <td class="cell85">list all interface methods, not only the direct ones</td> </tr> <tr> - <td class="cell15"><code>--(java4|java5|cpp)</code></td> + <td class="cell15"><code>--(java5|cpp)</code></td> <td class="cell85">select the target language<br/> - --java4 generate output for Java 1.4 or earlier<br/> --java5 generate output for Java 1.5 or later (is currently the default)<br/> --cpp generate output for C++</td> </tr> diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx b/unodevtools/source/skeletonmaker/javacompskeleton.cxx index 7306b12d674a..0f4ef7613501 100644 --- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx +++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx @@ -290,7 +290,7 @@ void generateXLocalizableBodies(std::ostream& o) { " return m_locale;\n }\n\n"; } -void generateXAddInBodies(std::ostream& o, ProgramOptions const & options) +void generateXAddInBodies(std::ostream& o, ProgramOptions const &) { // com.sun.star.sheet.XAddIn: // getProgrammaticFuntionName @@ -330,36 +330,21 @@ void generateXAddInBodies(std::ostream& o, ProgramOptions const & options) // getDisplayArgumentName o << " public String getDisplayArgumentName(String " "aProgrammaticFunctionName, int nArgument)\n {\n"; - if (options.java5) { - o << " return getAddinProperty(aProgrammaticFunctionName,\n" - " m_functionMap.get(\n" - " aProgrammaticFunctionName).get(" - "nArgument),\n" - " sDISPLAYNAME);\n }\n\n"; - } else { - o << " return getAddinProperty(aProgrammaticFunctionName, (String)\n" - " ((java.util.Hashtable)m_functionMap." - "get(\n aProgrammaticFunctionName))." - "get(\n new Integer(nArgument))" - ", sDISPLAYNAME);\n }\n\n"; - } + o << " return getAddinProperty(aProgrammaticFunctionName,\n" + " m_functionMap.get(\n" + " aProgrammaticFunctionName).get(" + "nArgument),\n" + " sDISPLAYNAME);\n }\n\n"; // getArgumentDescription o << " public String getArgumentDescription(String " "aProgrammaticFunctionName, int nArgument)\n {\n"; - if (options.java5) { - o << " return getAddinProperty(aProgrammaticFunctionName,\n" - " m_functionMap.get(\n" - " aProgrammaticFunctionName).get(" - "nArgument),\n" - " sDESCRIPTION);\n }\n\n"; - } else { - o << " return getAddinProperty(aProgrammaticFunctionName, (String)\n" - " ((java.util.Hashtable)m_functionMap." - "get(\n aProgrammaticFunctionName))." - "get(\n new Integer(nArgument))" - ", sDESCRIPTION);\n }\n\n"; - } + o << " return getAddinProperty(aProgrammaticFunctionName,\n" + " m_functionMap.get(\n" + " aProgrammaticFunctionName).get(" + "nArgument),\n" + " sDESCRIPTION);\n }\n\n"; + // getProgrammaticCategoryName o << " public String getProgrammaticCategoryName(String " "aProgrammaticFunctionName)\n {\n" @@ -618,24 +603,16 @@ void generateAddinConstructorAndHelper(std::ostream& o, "m_xHAccess = null;\n" " private com.sun.star.container.XHierarchicalNameAccess " "m_xCompAccess = null;\n"; - if (options.java5) { - o << " private java.util.Hashtable<\n String, " - "java.util.Hashtable< Integer, String> > m_functionMap = null;\n\n"; - } else { - o << " private java.util.Hashtable m_functionMap = null;\n\n"; - } + o << " private java.util.Hashtable<\n String, " + "java.util.Hashtable< Integer, String> > m_functionMap = null;\n\n"; + // Constructor o << "\n public " << classname << "( XComponentContext context )\n {\n" " m_xContext = context;\n\n" " try {\n"; - if (options.java5) { - o << " m_functionMap = new java.util.Hashtable<\n" - " String, java.util.Hashtable< Integer, " - "String > >();\n\n"; - } else { - o << " m_functionMap = new java.util.Hashtable();\n\n"; - } + o << " m_functionMap = new java.util.Hashtable<\n" + " String, java.util.Hashtable< Integer, String > >();\n\n"; generateFunctionParameterMap(o, options, manager, interfaces); diff --git a/unodevtools/source/skeletonmaker/javatypemaker.cxx b/unodevtools/source/skeletonmaker/javatypemaker.cxx index d6b29b00cf26..e959e0cfa1a8 100644 --- a/unodevtools/source/skeletonmaker/javatypemaker.cxx +++ b/unodevtools/source/skeletonmaker/javatypemaker.cxx @@ -83,7 +83,7 @@ void printType( sType = sType.copy(std::strlen("java.lang.")); } o << sType; - if (!arguments.empty() && options.java5) { + if (!arguments.empty()) { o << '<'; for (std::vector< OUString >::const_iterator i(arguments.begin()); i != arguments.end(); ++i) @@ -614,7 +614,7 @@ void printConstructors( o << ", "; printType(o, options, manager, j->type, false); if (j->rest) { - o << (options.java5 ? "..." : "[]"); + o << "..."; } o << ' ' << codemaker::java::translateUnoToJavaIdentifier( @@ -672,7 +672,7 @@ void printMapsToJavaType( codemaker::UnoType::Sort sort, OUString const & nucleus, sal_Int32 rank, std::vector< OUString > const & arguments, const char * javaTypeSort) { - o << "maps to Java " << (options.java5 ? "1.5" : "1.4") << " "; + o << "maps to Java " << "1.5" << " "; if (javaTypeSort != 0) { o << javaTypeSort << ' '; } @@ -819,7 +819,7 @@ void generateDocumentation(std::ostream & o, case codemaker::UnoType::SORT_POLYMORPHIC_STRUCT_TYPE_TEMPLATE: printMapsToJavaType( o, options, manager, sort, nucleus, rank, arguments, - options.java5 ? "generic class" : "class"); + "generic class"); o << "; full constructor:\n"; printConstructor( o, options, manager, @@ -830,7 +830,7 @@ void generateDocumentation(std::ostream & o, case codemaker::UnoType::SORT_INSTANTIATED_POLYMORPHIC_STRUCT_TYPE: printMapsToJavaType( o, options, manager, sort, nucleus, rank, arguments, - options.java5 ? "generic class instantiation" : "class"); + "generic class instantiation"); o << "; full constructor:\n"; printConstructor( o, options, manager, diff --git a/unodevtools/source/skeletonmaker/skeletoncommon.cxx b/unodevtools/source/skeletonmaker/skeletoncommon.cxx index e66b39acb981..37af9d5c57a0 100644 --- a/unodevtools/source/skeletonmaker/skeletoncommon.cxx +++ b/unodevtools/source/skeletonmaker/skeletoncommon.cxx @@ -610,12 +610,8 @@ void generateFunctionParameterMap(std::ostream& o, o << " ParamMap fpm;\n"; } else { - if ( options.java5 ) - o << " java.util.Hashtable< Integer, String > fpm = " - "new java.util.Hashtable< Integer, String >();\n"; - else - o << " java.util.Hashtable fpm = " - "new java.util.Hashtable();\n"; + o << " java.util.Hashtable< Integer, String > fpm = " + "new java.util.Hashtable< Integer, String >();\n"; } bFirst = false; } else @@ -623,11 +619,8 @@ void generateFunctionParameterMap(std::ostream& o, o << " fpm = ParamMap();\n"; } else { - if ( options.java5 ) - o << " fpm = new java.util.Hashtable< " - "Integer, String >();\n"; - else - o << " fpm = new java.util.Hashtable();\n"; + o << " fpm = new java.util.Hashtable< " + "Integer, String >();\n"; } std::vector< unoidl::InterfaceTypeEntity::Method::Parameter >::size_type @@ -643,14 +636,9 @@ void generateFunctionParameterMap(std::ostream& o, << "\");\n"; } else { - if ( options.java5 ) - o << " fpm.put(" << n << ", \"" - << j->name - << "\");\n"; - else - o << " fpm.put(new Integer(" << n << "), \"" - << j->name - << "\");\n"; + o << " fpm.put(" << n << ", \"" + << j->name + << "\");\n"; } ++n; } diff --git a/unodevtools/source/skeletonmaker/skeletoncommon.hxx b/unodevtools/source/skeletonmaker/skeletoncommon.hxx index 48425b119be3..5a33ebe20720 100644 --- a/unodevtools/source/skeletonmaker/skeletoncommon.hxx +++ b/unodevtools/source/skeletonmaker/skeletoncommon.hxx @@ -40,11 +40,10 @@ typedef ::std::vector< unoidl::AccumulationBasedServiceEntity::Property > AttributeInfo; struct ProgramOptions { - ProgramOptions(): java5(true), all(false), dump(false), license(false), + ProgramOptions(): all(false), dump(false), license(false), shortnames(false), supportpropertysetmixin(false), backwardcompatible(false), language(1), componenttype(1) {} - bool java5; bool all; bool dump; bool license; diff --git a/unodevtools/source/skeletonmaker/skeletonmaker.cxx b/unodevtools/source/skeletonmaker/skeletonmaker.cxx index 5904f2922235..b2d54618e3a0 100644 --- a/unodevtools/source/skeletonmaker/skeletonmaker.cxx +++ b/unodevtools/source/skeletonmaker/skeletonmaker.cxx @@ -52,8 +52,7 @@ static const char usageText[] = "\n options:\n" " -a, --all list all interface methods, not only the direct\n" " ones\n" -" --(java4|java5|cpp) select the target language\n" -" --java4 generate output for Java 1.4 or earlier\n" +" --(java5|cpp) select the target language\n" " --java5 generate output for Java 1.5 or later (is \n" " currently the default)\n" " --cpp generate output for C++\n" @@ -186,17 +185,14 @@ SAL_IMPLEMENT_MAIN() continue; } if ( readOption( &bOption, "java4", &nPos, arg) ) { - options.java5 = false; - options.language = 1; - continue; + std::cerr << + "\nError: Java 1.4 is no longer supported, use --java5 instead\n"; } if ( readOption( &bOption, "java5", &nPos, arg) ) { - options.java5 = true; options.language = 1; continue; } if ( readOption( &bOption, "cpp", &nPos, arg) ) { - options.java5 = false; options.language = 2; continue; } |