diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-08-23 15:20:20 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-08-23 15:20:20 +0200 |
commit | 4dc9c2aaf6a6b07c7afbc3620e2f34085a838294 (patch) | |
tree | c9977bbeaa286c1c906376b3f836d05eb43adea3 /unodevtools/source/skeletonmaker/javacompskeleton.cxx | |
parent | c7eab7eed6263bdc62f91a2336cc60fdc3d69a49 (diff) |
recreated tag libreoffice-3.3.3.1 which had these commits:
commit 1d0f0ac667d24a5e2584e81a20cf8aa52e784aa7 (tag: refs/tags/libreoffice-3.3.3.1)
Author: Petr Mladek <pmladek@suse.cz>
Date: Tue May 31 17:39:08 2011 +0200
Version 3.3.3.1, tag libreoffice-3.3.3.1 (3.3.3-rc1)
Notes
split repo tag: sdk_libreoffice-3.3.3.1
split repo tag: sdk_libreoffice-3.3.4.1
Diffstat (limited to 'unodevtools/source/skeletonmaker/javacompskeleton.cxx')
-rw-r--r-- | unodevtools/source/skeletonmaker/javacompskeleton.cxx | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx b/unodevtools/source/skeletonmaker/javacompskeleton.cxx index 5659066b0d1c..898b7d6c4068 100644 --- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx +++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -79,7 +79,7 @@ void generateImports(std::ostream & o, ProgramOptions const & options, } } - + // std::hash_set< OString, OStringHash >::const_iterator iter = // interfaces.begin(); // while (iter != interfaces.end()) @@ -104,7 +104,7 @@ void generateCompFunctions(std::ostream & o, const OString & classname) " return Factory.writeRegistryServiceInfo(m_implementationName,\n" " m_serviceNames,\n" " xRegistryKey);\n" - " }\n\n"; + " }\n\n"; } void generateXServiceInfoBodies(std::ostream& o) @@ -214,7 +214,7 @@ bool checkAttribute(OStringBuffer& attributeValue, sal_uInt16 attribute) /* com::sun::star::beans::PropertyValue::MAYBEAMBIGIOUS */ 32, /* com::sun::star::beans::PropertyValue::MAYBEDEFAULT */ 64, /* com::sun::star::beans::PropertyValue::REMOVEABLE */ 128, - /* com::sun::star::beans::PropertyValue::OPTIONAL */ 256 }; + /* com::sun::star::beans::PropertyValue::OPTIONAL */ 256 }; for (sal_uInt16 i = 0; i < 9; i++) { @@ -259,7 +259,7 @@ bool checkAttribute(OStringBuffer& attributeValue, sal_uInt16 attribute) attributeValue.insert(0, '('); attributeValue.append(')'); } - + return cast; } @@ -280,7 +280,7 @@ void registerProperties(std::ostream& o, cast = true; attributeValue.append('0'); } - + o << indentation << "registerProperty(\"" << i->first << "\", \"m_" << i->first << "\",\n" << indentation << " "; @@ -289,7 +289,7 @@ void registerProperties(std::ostream& o, o << attributeValue.makeStringAndClear() << ");\n"; } - } + } } void generateXLocalizableBodies(std::ostream& o) { @@ -357,7 +357,7 @@ void generateXAddInBodies(std::ostream& o, ProgramOptions const & options) "get(\n new Integer(nArgument))" ", sDISPLAYNAME);\n }\n\n"; } - + // getArgumentDescription o << " public String getArgumentDescription(String " "aProgrammaticFunctionName, int nArgument)\n {\n"; @@ -453,12 +453,12 @@ void generateXDispatchBodies(std::ostream& o, ProgramOptions const & options) o << " // com.sun.star.frame.XDispatch:\n" " public void dispatch( com.sun.star.util.URL aURL,\n" " com.sun.star.beans.PropertyValue[] aArguments )\n {\n"; - + ProtocolCmdMap::const_iterator iter = options.protocolCmdMap.begin(); while (iter != options.protocolCmdMap.end()) { o << " if ( aURL.Protocol.compareTo(\"" << (*iter).first << "\") == 0 )\n {\n"; - + for (std::vector< OString >::const_iterator i = (*iter).second.begin(); i != (*iter).second.end(); ++i) { o << " if ( aURL.Path.compareTo(\"" << (*i) << "\") == 0 )\n" @@ -470,12 +470,12 @@ void generateXDispatchBodies(std::ostream& o, ProgramOptions const & options) iter++; } o << " }\n\n"; - + // addStatusListener o << " public void addStatusListener( com.sun.star.frame.XStatusListener xControl,\n" " com.sun.star.util.URL aURL )\n {\n" " // add your own code here\n }\n\n"; - + // com.sun.star.frame.XDispatch o << " public void removeStatusListener( com.sun.star.frame.XStatusListener xControl,\n" " com.sun.star.util.URL aURL )\n {\n" @@ -495,7 +495,7 @@ void generateXDispatchProviderBodies(std::ostream& o, ProgramOptions const & opt while (iter != options.protocolCmdMap.end()) { o << " if ( aURL.Protocol.compareTo(\"" << (*iter).first << "\") == 0 )\n {\n"; - + for (std::vector< OString >::const_iterator i = (*iter).second.begin(); i != (*iter).second.end(); ++i) { o << " if ( aURL.Path.compareTo(\"" << (*i) << "\") == 0 )\n" @@ -578,7 +578,7 @@ void generateMethodBodies(std::ostream& o, generated.add(type); continue; } - } + } typereg::Reader reader(manager.getTypeReader(type.replace('.','/'))); printMethods(o, options, manager, reader, generated, "_", indentation, true, usepropertymixin); @@ -608,16 +608,16 @@ void generateAddinConstructorAndHelper(std::ostream& o, " {\n m_xContext = context;\n }\n\n"; return; } - + // get the one and only add-in service for later use std::hash_set< OString, OStringHash >::const_iterator iter = services.begin(); OString sAddinService = (*iter).replace('/', '.'); if (sAddinService.equals("com.sun.star.sheet.AddIn")) { sAddinService = (*(++iter)).replace('/', '.'); - } - + } + // add-in specific fields o << "\n private static final String sADDIN_SERVICENAME = \"" << sAddinService << "\";\n\n"; @@ -651,7 +651,7 @@ void generateAddinConstructorAndHelper(std::ostream& o, } else { o << " m_functionMap = new java.util.Hashtable();\n\n"; } - + generateFunctionParameterMap(o, options, manager, interfaces); o << " com.sun.star.lang.XMultiServiceFactory xProvider = \n" @@ -676,7 +676,7 @@ void generateAddinConstructorAndHelper(std::ostream& o, " aArgument.Name = \"nodepath\";\n" " aArgument.Value = new com.sun.star.uno.Any(\n" " com.sun.star.uno.Type.STRING, sPath.toString());\n\n"; - + o << " Object aArguments[] = new Object[1];\n" " aArguments[0] = new com.sun.star.uno.Any(" " new com.sun.star.uno.Type(\n" @@ -734,7 +734,7 @@ void generateAddinConstructorAndHelper(std::ostream& o, " catch ( com.sun.star.uno.RuntimeException e ) {\n" " throw e;\n }\n" " catch ( com.sun.star.uno.Exception e ) {\n }\n" - " return \"\";\n }\n\n"; + " return \"\";\n }\n\n"; } @@ -767,7 +767,7 @@ void generateClassDefinition(std::ostream& o, iter++; if (iter != interfaces.end()) o << ",\n "; - } + } } o << "\n{\n"; @@ -777,11 +777,11 @@ void generateClassDefinition(std::ostream& o, if (options.componenttype == 3) { o << " private com.sun.star.frame.XFrame m_xFrame;\n"; } - + // check property helper if (propertyhelper.getLength() > 1) o << " private final PropertySetMixin m_prophlp;\n"; - + o << " private static final String m_implementationName = " << classname << ".class.getName();\n"; @@ -796,7 +796,7 @@ void generateClassDefinition(std::ostream& o, o << ",\n"; else o << " };\n\n"; - } + } } // attribute/property members @@ -808,13 +808,13 @@ void generateClassDefinition(std::ostream& o, o << " protected "; printType(o, options, manager, iter->second.first.replace('.','/'), false, false); - o << " m_" << iter->first << ";\n"; + o << " m_" << iter->first << ";\n"; iter++; } } else if (!attributes.empty()) { AttributeInfo::const_iterator iter = attributes.begin(); - o << " // attributes\n"; + o << " // attributes\n"; while (iter != attributes.end()) { o << " private "; printType(o, options, manager, iter->second.first.replace('.','/'), @@ -822,11 +822,11 @@ void generateClassDefinition(std::ostream& o, o << " m_" << iter->first << " = "; printType(o, options, manager, iter->second.first.replace('.','/'), false, true); - o <<";\n"; + o <<";\n"; iter++; } } - + // special handling of calc add-ins if (options.componenttype == 2) { @@ -846,15 +846,15 @@ void generateClassDefinition(std::ostream& o, } } o << " };\n\n"; - + } if (!services.empty()) generateCompFunctions(o, classname); - + generateMethodBodies(o, options, manager, interfaces, - " ", propertyhelper.getLength() > 1); - + " ", propertyhelper.getLength() > 1); + // end of class definition o << "}\n"; } @@ -887,12 +887,12 @@ void generateSkeleton(ProgramOptions const & options, interfaces, services, properties); checkType(manager, "com.sun.star.frame.XDispatch", interfaces, services, properties); - - + + // ProtocolCmdMap::const_iterator iter2 = options.protocolCmdMap.begin(); // while (iter2 != options.protocolCmdMap.end()) { // fprintf(stdout, "prt=%s\n", (*iter2).first.getStr()); - + // for (std::vector< OString >::const_iterator i = (*iter2).second.begin(); // i != (*iter2).second.end(); ++i) { // fprintf(stdout, "cmd=%s\n", (*i).getStr()); @@ -901,7 +901,7 @@ void generateSkeleton(ProgramOptions const & options, // } // return; } - + if (options.componenttype == 2) { if (services.size() != 1) { throw CannotDumpException( @@ -927,11 +927,11 @@ void generateSkeleton(ProgramOptions const & options, } } - + // check if service object or simple UNO object if (!services.empty()) - serviceobject = true; - + serviceobject = true; + OString propertyhelper = checkPropertyHelper( options, manager, services, interfaces, attributes, propinterfaces); checkDefaultInterfaces(interfaces, services, propertyhelper); @@ -941,7 +941,7 @@ void generateSkeleton(ProgramOptions const & options, std::cerr << "WARNING: interfaces specifying calc add-in functions " "shouldn't support attributes!\n"; } - + supportxcomponent = checkXComponentSupport(manager, interfaces); OString compFileName; @@ -954,7 +954,7 @@ void generateSkeleton(ProgramOptions const & options, if (!standardout && options.license) { printLicenseHeader(*pofs, compFileName); } - + generatePackage(*pofs, options.implname); generateImports(*pofs, options, interfaces, propertyhelper, @@ -967,8 +967,8 @@ void generateSkeleton(ProgramOptions const & options, generateClassDefinition(*pofs, options, manager, classname, services, interfaces, properties, attributes, propertyhelper, - supportxcomponent); - + supportxcomponent); + if ( !standardout && pofs && ((std::ofstream*)pofs)->is_open()) { ((std::ofstream*)pofs)->close(); delete pofs; @@ -976,21 +976,21 @@ void generateSkeleton(ProgramOptions const & options, } } catch(CannotDumpException& e) { - std::cerr << "ERROR: " << e.m_message.getStr() << "\n"; + std::cerr << "ERROR: " << e.m_message.getStr() << "\n"; if ( !standardout ) { if (pofs && ((std::ofstream*)pofs)->is_open()) { - ((std::ofstream*)pofs)->close(); + ((std::ofstream*)pofs)->close(); delete pofs; } // remove existing type file if something goes wrong to ensure // consistency if (fileExists(compFileName)) removeTypeFile(compFileName); - + // remove tmp file if something goes wrong removeTypeFile(tmpFileName); } - } + } } } } |