summaryrefslogtreecommitdiff
path: root/unodevtools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-04-08 08:45:37 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-04-09 09:44:33 +0200
commit02a8e8acd1f0cbb512868fd9849363f9d069db95 (patch)
treece8a68631b45d663d583646c89d3aaaeb2a4e402 /unodevtools
parent209d6a0fcca942a0168eb10ca3ab8f5f0d2ba9be (diff)
[API CHANGE] WIP: Experimental new binary type.rdb format
Make cppumaker work on top of unoidl/ instead of registry/, as a first step to change all the various codemakers. * API CHANGE: cppumaker no longer supports the -B switch, as that is meaningless with the new format. When reading from an old-format .rdb file, /UCR is hard-coded as the prefix now. * TODO: The new format does not yet support deprecation annotations, so the generated .hdl/.hpp files lack any SAL_DEPRECATED_INTERNALs for now. * codemaker/typemanager.hxx is extended with access to unoidl/ functionality, so the various codemakers can use registry/ and unoidl/ in parallel for now. The access to registry/ functionality will be removed. (Added small throwaway helper functions u2b/b2u to easily map between OString and OUString at the remaining seams for now.) * Includes a selective revert of ba044b1e9613ed30906a9a540b7da8392923e4e3 "remove needless forward rtl::OUString declarations" in those parts of codemaker, unodevtools, unoidl that were covered by this local work-in-progress patch; I would otherwise have hard a hard time re-applying it. * The generated .hdl/.hpp files are mostly unchanged, except for a few minor things: ** Any SAL_DEPRECATED_INTERNALs are missing (see above). ** In comprehensive getCppuType definitions, some members were erroneously classified as TypeCalss_UNKNOWN. ** In comprehensive getCppuType definitions, some unnecessary calls like ::cppu::UnoType< ::sal_Int32 >::get(); can be removed. ** For typedef sequence<X>, the .hdl file need not include X.hdl, but only needs to forward-declare it. ** Unnecessary includes for optional bases of interfaces can be removed. ** Some numbering of local variable names (sMethodName1, ...) has changed. Change-Id: Icad98f248ac15177337f1b4ab709a755a8af6238
Diffstat (limited to 'unodevtools')
-rw-r--r--unodevtools/Executable_skeletonmaker.mk1
-rw-r--r--unodevtools/source/skeletonmaker/cppcompskeleton.cxx144
-rw-r--r--unodevtools/source/skeletonmaker/cpptypemaker.cxx22
-rw-r--r--unodevtools/source/skeletonmaker/javacompskeleton.cxx5
-rw-r--r--unodevtools/source/skeletonmaker/javatypemaker.cxx14
-rw-r--r--unodevtools/source/skeletonmaker/skeletoncommon.cxx72
-rw-r--r--unodevtools/source/skeletonmaker/skeletonmaker.cxx2
7 files changed, 121 insertions, 139 deletions
diff --git a/unodevtools/Executable_skeletonmaker.mk b/unodevtools/Executable_skeletonmaker.mk
index 1d00f3bcf978..b39dca0b3f10 100644
--- a/unodevtools/Executable_skeletonmaker.mk
+++ b/unodevtools/Executable_skeletonmaker.mk
@@ -43,6 +43,7 @@ $(eval $(call gb_Executable_use_libraries,uno-skeletonmaker,\
salhelper \
cppu \
cppuhelper \
+ unoidl \
))
$(eval $(call gb_Executable_use_static_libraries,uno-skeletonmaker,\
diff --git a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
index 309f3c76ddad..bfea9a03ced7 100644
--- a/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
+++ b/unodevtools/source/skeletonmaker/cppcompskeleton.cxx
@@ -120,8 +120,8 @@ OString generateCompHelperDeclaration(std::ostream & o,
// generate component/service helper functions
o << "// component and service helper functions:\n"
- "OUString SAL_CALL _getImplementationName();\n"
- "css::uno::Sequence< OUString > SAL_CALL "
+ "::rtl::OUString SAL_CALL _getImplementationName();\n"
+ "css::uno::Sequence< ::rtl::OUString > SAL_CALL "
"_getSupportedServiceNames();\n"
"css::uno::Reference< css::uno::XInterface > SAL_CALL _create("
" css::uno::Reference< css::uno::XComponentContext > const & "
@@ -143,19 +143,19 @@ void generateCompHelperDefinition(std::ostream & o,
OString nm;
short nbrackets = generateNamespace(o, implname, true, nm);
- o << "OUString SAL_CALL _getImplementationName() {\n"
- << " return OUString(\n"
+ o << "::rtl::OUString SAL_CALL _getImplementationName() {\n"
+ << " return ::rtl::OUString(\n"
<< " \"" << implname << "\");\n}\n\n";
- o << "css::uno::Sequence< OUString > SAL_CALL "
+ o << "css::uno::Sequence< ::rtl::OUString > SAL_CALL "
"_getSupportedServiceNames()\n{\n css::uno::Sequence< "
- << "OUString >" << " s(" << services.size() << ");\n";
+ << "::rtl::OUString >" << " s(" << services.size() << ");\n";
boost::unordered_set< OString, OStringHash >::const_iterator iter = services.begin();
short i=0;
while (iter != services.end())
{
- o << " s[" << i++ << "] = OUString(\""
+ o << " s[" << i++ << "] = ::rtl::OUString(\""
<< (*iter).replace('/','.') << "\");\n";
++iter;
}
@@ -206,7 +206,7 @@ void generateXPropertySetBodies(std::ostream& o,
<< propertyhelper
<< " >::getPropertySetInfo();\n}\n\n";
- o << "void SAL_CALL " << classname << "setPropertyValue(const OUString"
+ o << "void SAL_CALL " << classname << "setPropertyValue(const ::rtl::OUString"
" & aPropertyName, const css::uno::Any & aValue) throw ("
"css::uno::RuntimeException, css::beans::UnknownPropertyException, "
"css::beans::PropertyVetoException, css::lang::IllegalArgumentException, "
@@ -215,13 +215,13 @@ void generateXPropertySetBodies(std::ostream& o,
o << "css::uno::Any SAL_CALL " << classname << "getPropertyValue(const "
- "OUString & aPropertyName) throw (css::uno::RuntimeException, "
+ "::rtl::OUString & aPropertyName) throw (css::uno::RuntimeException, "
"css::beans::UnknownPropertyException, css::lang::WrappedTargetException)"
"\n{\n return ::cppu::PropertySetMixin< "
<< propertyhelper << " >::getPropertyValue(aPropertyName);\n}\n\n";
o << "void SAL_CALL " << classname << "addPropertyChangeListener(const "
- "OUString & aPropertyName, const css::uno::Reference< "
+ "::rtl::OUString & aPropertyName, const css::uno::Reference< "
"css::beans::XPropertyChangeListener > & xListener) throw ("
"css::uno::RuntimeException, css::beans::UnknownPropertyException, "
"css::lang::WrappedTargetException)\n{\n ::cppu::PropertySetMixin< "
@@ -229,7 +229,7 @@ void generateXPropertySetBodies(std::ostream& o,
<< " >::addPropertyChangeListener(aPropertyName, xListener);\n}\n\n";
o << "void SAL_CALL " << classname << "removePropertyChangeListener(const "
- "OUString & aPropertyName, const css::uno::Reference< "
+ "::rtl::OUString & aPropertyName, const css::uno::Reference< "
"css::beans::XPropertyChangeListener > & xListener) throw ("
"css::uno::RuntimeException, css::beans::UnknownPropertyException, "
"css::lang::WrappedTargetException)\n{\n ::cppu::PropertySetMixin< "
@@ -237,7 +237,7 @@ void generateXPropertySetBodies(std::ostream& o,
<< " >::removePropertyChangeListener(aPropertyName, xListener);\n}\n\n";
o << "void SAL_CALL " << classname << "addVetoableChangeListener(const "
- "OUString & aPropertyName, const css::uno::Reference< "
+ "::rtl::OUString & aPropertyName, const css::uno::Reference< "
"css::beans::XVetoableChangeListener > & xListener) throw ("
"css::uno::RuntimeException, css::beans::UnknownPropertyException, "
"css::lang::WrappedTargetException)\n{\n ::cppu::PropertySetMixin< "
@@ -245,7 +245,7 @@ void generateXPropertySetBodies(std::ostream& o,
<< " >::addVetoableChangeListener(aPropertyName, xListener);\n}\n\n";
o << "void SAL_CALL " << classname << "removeVetoableChangeListener(const "
- "OUString & aPropertyName, const css::uno::Reference< "
+ "::rtl::OUString & aPropertyName, const css::uno::Reference< "
"css::beans::XVetoableChangeListener > & xListener) throw ("
"css::uno::RuntimeException, css::beans::UnknownPropertyException, "
"css::lang::WrappedTargetException)\n{\n ::cppu::PropertySetMixin< "
@@ -309,54 +309,54 @@ void generateXAddInBodies(std::ostream& o, const OString & classname)
{
o << "// css::sheet::XAddIn:\n";
- o << "OUString SAL_CALL " << classname << "getProgrammaticFuntionName("
- "const OUString & aDisplayName) throw (css::uno::RuntimeException)"
- "\n{\n OUString ret;\n try {\n css::uno::Reference< "
+ o << "::rtl::OUString SAL_CALL " << classname << "getProgrammaticFuntionName("
+ "const ::rtl::OUString & aDisplayName) throw (css::uno::RuntimeException)"
+ "\n{\n ::rtl::OUString ret;\n try {\n css::uno::Reference< "
"css::container::XNameAccess > xNAccess(m_xHAccess, css::uno::UNO_QUERY);\n"
- " css::uno::Sequence< OUString > functions = "
+ " css::uno::Sequence< ::rtl::OUString > functions = "
"xNAccess->getElementNames();\n sal_Int32 len = functions."
- "getLength();\n OUString sDisplayName;\n"
+ "getLength();\n ::rtl::OUString sDisplayName;\n"
" for (sal_Int32 i=0; i < len; ++i) {\n"
" sDisplayName = getAddinProperty(functions[i], "
- "OUString(),\n "
+ "::rtl::OUString(),\n "
"sDISPLAYNAME);\n if (sDisplayName.equals(aDisplayName))\n"
" return functions[i];\n }\n }\n"
" catch ( const css::uno::RuntimeException & e ) {\n throw e;\n }\n"
" catch ( css::uno::Exception & ) {\n }\n return ret;\n}\n\n";
- o << "OUString SAL_CALL " << classname << "getDisplayFunctionName(const "
- "OUString & aProgrammaticName) throw (css::uno::RuntimeException)\n"
- "{\n return getAddinProperty(aProgrammaticName, OUString(), "
+ o << "::rtl::OUString SAL_CALL " << classname << "getDisplayFunctionName(const "
+ "::rtl::OUString & aProgrammaticName) throw (css::uno::RuntimeException)\n"
+ "{\n return getAddinProperty(aProgrammaticName, ::rtl::OUString(), "
"sDISPLAYNAME);\n}\n\n";
- o << "OUString SAL_CALL " << classname << "getFunctionDescription(const "
- "OUString & aProgrammaticName) throw (css::uno::RuntimeException)\n"
- "{\n return getAddinProperty(aProgrammaticName, OUString(), "
+ o << "::rtl::OUString SAL_CALL " << classname << "getFunctionDescription(const "
+ "::rtl::OUString & aProgrammaticName) throw (css::uno::RuntimeException)\n"
+ "{\n return getAddinProperty(aProgrammaticName, ::rtl::OUString(), "
"sDESCRIPTION);\n}\n\n";
- o << "OUString SAL_CALL " << classname << "getDisplayArgumentName(const "
- "OUString & aProgrammaticFunctionName, ::sal_Int32 nArgument) throw "
+ o << "::rtl::OUString SAL_CALL " << classname << "getDisplayArgumentName(const "
+ "::rtl::OUString & aProgrammaticFunctionName, ::sal_Int32 nArgument) throw "
"(css::uno::RuntimeException)\n{\n return getAddinProperty("
"aProgrammaticFunctionName,\n m_functionMap["
"aProgrammaticFunctionName][nArgument],\n"
" sDISPLAYNAME);\n}\n\n";
- o << "OUString SAL_CALL " << classname << "getArgumentDescription(const "
- "OUString & aProgrammaticFunctionName, ::sal_Int32 nArgument) throw "
+ o << "::rtl::OUString SAL_CALL " << classname << "getArgumentDescription(const "
+ "::rtl::OUString & aProgrammaticFunctionName, ::sal_Int32 nArgument) throw "
"(css::uno::RuntimeException)\n{\n return getAddinProperty("
"aProgrammaticFunctionName,\n "
"m_functionMap[aProgrammaticFunctionName][nArgument],\n"
" sDESCRIPTION);\n}\n\n";
- o << "OUString SAL_CALL " << classname << "getProgrammaticCategoryName("
- "const OUString & aProgrammaticFunctionName) throw ("
+ o << "::rtl::OUString SAL_CALL " << classname << "getProgrammaticCategoryName("
+ "const ::rtl::OUString & aProgrammaticFunctionName) throw ("
"css::uno::RuntimeException)\n{\n return getAddinProperty("
- "aProgrammaticFunctionName, OUString(), sCATEGORY);\n}\n\n";
+ "aProgrammaticFunctionName, ::rtl::OUString(), sCATEGORY);\n}\n\n";
- o << "OUString SAL_CALL " << classname << "getDisplayCategoryName(const "
- "OUString & aProgrammaticFunctionName) throw ("
+ o << "::rtl::OUString SAL_CALL " << classname << "getDisplayCategoryName(const "
+ "::rtl::OUString & aProgrammaticFunctionName) throw ("
"css::uno::RuntimeException)\n{\n return getAddinProperty("
- "aProgrammaticFunctionName, OUString(), "
+ "aProgrammaticFunctionName, ::rtl::OUString(), "
"sCATEGORYDISPLAYNAME);\n}\n\n";
}
@@ -364,26 +364,26 @@ void generateXCompatibilityNamesBodies(std::ostream& o, const OString & classnam
{
o << "// css::sheet::XCompatibilityNames:\n"
"css::uno::Sequence< css::sheet::LocalizedName > SAL_CALL " << classname
- << "getCompatibilityNames(const OUString & aProgrammaticName) throw "
+ << "getCompatibilityNames(const ::rtl::OUString & aProgrammaticName) throw "
"(css::uno::RuntimeException)\n{\n css::uno::Sequence< "
"css::sheet::LocalizedName > seqLocalizedNames;\n try {\n "
- "OUStringBuffer buf("
+ "::rtl::OUStringBuffer buf("
"aProgrammaticName);\n buf.appendAscii(\"/CompatibilityName\");\n"
- " OUString hname(buf.makeStringAndClear());\n\n "
+ " ::rtl::OUString hname(buf.makeStringAndClear());\n\n "
"if ( m_xCompAccess->hasByHierarchicalName(hname) ) {\n"
" css::uno::Reference< css::container::XNameAccess > "
"xNameAccess(\n"
" m_xCompAccess->getByHierarchicalName(hname), "
- "css::uno::UNO_QUERY);\n\n css::uno::Sequence< OUString"
+ "css::uno::UNO_QUERY);\n\n css::uno::Sequence< ::rtl::OUString"
" > elems = \n xNameAccess->getElementNames();"
"\n ::sal_Int32 len = elems.getLength();\n\n "
- "seqLocalizedNames.realloc(len);\n\n OUString "
+ "seqLocalizedNames.realloc(len);\n\n ::rtl::OUString "
"sCompatibilityName;\n for (::sal_Int32 i=0; i < len; ++i) {\n"
- " OUString sLocale(elems[i]);\n "
+ " ::rtl::OUString sLocale(elems[i]);\n "
"xNameAccess->getByName(sLocale) >>= sCompatibilityName;\n\n"
" css::lang::Locale aLocale;\n "
"::sal_Int32 nIndex = 0, nToken = 0;\n "
- "do {\n OUString aToken = sLocale.getToken(0, '-', "
+ "do {\n ::rtl::OUString aToken = sLocale.getToken(0, '-', "
"nIndex);\n switch (nToken++) {\n "
"case 0:\n aLocale.Language = aToken;\n"
" break;\n case 1:\n"
@@ -461,7 +461,7 @@ void generateXDispatchProvider(std::ostream& o,
o << "// css::frame::XDispatchProvider:\n"
"css::uno::Reference< css::frame::XDispatch > SAL_CALL " << classname
<< "queryDispatch( const css::util::URL& aURL,"
- " const OUString& sTargetFrameName, sal_Int32 nSearchFlags ) "
+ " const ::rtl::OUString& sTargetFrameName, sal_Int32 nSearchFlags ) "
"throw(css::uno::RuntimeException)\n{\n css::uno::Reference< "
"css::frame::XDispatch > xRet;\n"
" if ( !m_xFrame.is() )\n return 0;\n\n";
@@ -513,20 +513,20 @@ void generateAddinConstructorAndHelper(std::ostream& o,
o << " css::uno::Reference< css::lang::XMultiServiceFactory > xProvider"
"(\n m_xContext->getServiceManager()->createInstanceWithContext"
- "(\n OUString(\n "
+ "(\n ::rtl::OUString(\n "
" \"com.sun.star.configuration.ConfigurationProvider\"),"
"\n m_xContext ), css::uno::UNO_QUERY );\n\n";
- o << " OUString sReadOnlyView(\n"
+ o << " ::rtl::OUString sReadOnlyView(\n"
" \"com.sun.star.configuration.ConfigurationAccess\");\n\n";
- o << " OUStringBuffer sPath(OUString(\n"
+ o << " ::rtl::OUStringBuffer sPath(::rtl::OUString(\n"
" \"/org.openoffice.Office.CalcAddIns/AddInInfo/\"));\n"
" sPath.appendAscii(sADDIN_SERVICENAME);\n"
" sPath.appendAscii(\"/AddInFunctions\");\n\n"
" // create arguments: nodepath\n"
" css::beans::PropertyValue aArgument;\n"
- " aArgument.Name = OUString(\"nodepath\");\n"
+ " aArgument.Name = ::rtl::OUString(\"nodepath\");\n"
" aArgument.Value <<= sPath.makeStringAndClear();\n\n"
" css::uno::Sequence< css::uno::Any > aArguments(1);\n"
" aArguments[0] <<= aArgument;\n\n";
@@ -541,8 +541,8 @@ void generateAddinConstructorAndHelper(std::ostream& o,
o << " // extend arguments to create a view for all locales to get "
"simple\n // access to the compatibilityname property\n"
- " aArgument.Name = OUString(\"locale\");\n"
- " aArgument.Value <<= OUString(\"*\");\n"
+ " aArgument.Name = ::rtl::OUString(\"locale\");\n"
+ " aArgument.Value <<= ::rtl::OUString(\"*\");\n"
" aArguments.realloc(2);\n"
" aArguments[1] <<= aArgument;\n\n"
" // create view for all locales\n"
@@ -553,12 +553,12 @@ void generateAddinConstructorAndHelper(std::ostream& o,
o << " }\n catch ( css::uno::Exception & ) {\n }\n}\n\n";
- o << "// addin configuration property helper function:\nOUString "
- "SAL_CALL " << classname << "::getAddinProperty(const OUString &"
- " funcName, const OUString & paramName, const char * propName) "
+ o << "// addin configuration property helper function:\n::rtl::OUString "
+ "SAL_CALL " << classname << "::getAddinProperty(const ::rtl::OUString &"
+ " funcName, const ::rtl::OUString & paramName, const char * propName) "
"throw (css::uno::RuntimeException)\n{\n"
- " OUString ret;\n try {\n "
- "OUStringBuffer buf(funcName);\n"
+ " ::rtl::OUString ret;\n try {\n "
+ "::rtl::OUStringBuffer buf(funcName);\n"
" if (!paramName.isEmpty()) {\n"
" buf.appendAscii(\"/Parameters/\");\n"
" buf.append(paramName);\n }\n\n"
@@ -566,7 +566,7 @@ void generateAddinConstructorAndHelper(std::ostream& o,
" m_xHAccess->getByHierarchicalName(\n"
" buf.makeStringAndClear()), css::uno::UNO_QUERY);\n"
" xPropSet->getPropertyValue(\n "
- "OUString(propName)) >>= ret;\n }\n"
+ "::rtl::OUString(propName)) >>= ret;\n }\n"
" catch ( const css::uno::RuntimeException & e ) {\n throw e;\n }\n"
" catch ( css::uno::Exception & ) {\n }\n return ret;\n";
}
@@ -665,8 +665,8 @@ OString generateClassDefinition(std::ostream& o,
// generate component/service helper functions
// o << " // component and service helper functions:\n"
-// << " static OUString SAL_CALL _getImplementationName();\n"
-// << " static css::uno::Sequence< OUString > SAL_CALL "
+// << " static ::rtl::OUString SAL_CALL _getImplementationName();\n"
+// << " static css::uno::Sequence< ::rtl::OUString > SAL_CALL "
// << "_getSupportedServiceNames();\n"
// << " static css::uno::Reference< css::uno::XInterface > SAL_CALL _create("
// << "\n css::uno::Reference< css::uno::XComponentContext > const & "
@@ -717,12 +717,12 @@ OString generateClassDefinition(std::ostream& o,
<< " virtual ~" << classname << "() {}\n\n";
if (options.componenttype == 2) {
- o << " typedef boost::unordered_map< ::sal_Int32, OUString, "
+ o << " typedef boost::unordered_map< ::sal_Int32, rtl::OUString, "
"boost::hash<::sal_Int32> > ParamMap;\n"
- " typedef boost::unordered_map< OUString, ParamMap, "
- "OUStringHash > FunctionMap;\n\n"
- " OUString SAL_CALL getAddinProperty(const OUString & "
- "funcName, const OUString & paramName, const char * propName) "
+ " typedef boost::unordered_map< rtl::OUString, ParamMap, "
+ "rtl::OUStringHash > FunctionMap;\n\n"
+ " ::rtl::OUString SAL_CALL getAddinProperty(const ::rtl::OUString & "
+ "funcName, const ::rtl::OUString & paramName, const char * propName) "
"throw (css::uno::RuntimeException);\n\n";
}
@@ -829,7 +829,7 @@ OString generateClassDefinition(std::ostream& o,
buffer.append("IMPLEMENTS_PROPERTY_ACCESS");
}
o << buffer.makeStringAndClear()
- << "), css::uno::Sequence< OUString >()),\n";
+ << "), css::uno::Sequence< ::rtl::OUString >()),\n";
}
o << " m_xContext(context)";
@@ -858,20 +858,20 @@ void generateXServiceInfoBodies(std::ostream& o,
OString const & comphelpernamespace)
{
o << "// com.sun.star.uno.XServiceInfo:\n"
- << "OUString SAL_CALL " << classname << "getImplementationName() "
+ << "::rtl::OUString SAL_CALL " << classname << "getImplementationName() "
<< "throw (css::uno::RuntimeException)\n{\n "
<< "return " << comphelpernamespace << "::_getImplementationName();\n}\n\n";
o << "::sal_Bool SAL_CALL " << classname
- << "supportsService(OUString const & "
+ << "supportsService(::rtl::OUString const & "
<< "serviceName) throw (css::uno::RuntimeException)\n{\n "
- << "css::uno::Sequence< OUString > serviceNames = "
+ << "css::uno::Sequence< ::rtl::OUString > serviceNames = "
<< comphelpernamespace << "::_getSupportedServiceNames();\n "
<< "for (::sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {\n "
<< " if (serviceNames[i] == serviceName)\n return sal_True;\n"
<< " }\n return sal_False;\n}\n\n";
- o << "css::uno::Sequence< OUString > SAL_CALL " << classname
+ o << "css::uno::Sequence< ::rtl::OUString > SAL_CALL " << classname
<< "getSupportedServiceNames() throw (css::uno::RuntimeException)\n{\n "
<< "return " << comphelpernamespace
<< "::_getSupportedServiceNames();\n}\n\n";
@@ -1073,9 +1073,8 @@ void generateSkeleton(ProgramOptions const & options,
delete pofs;
OSL_VERIFY(makeValidTypeFile(compFileName, tmpFileName, sal_False));
}
- } catch(const CannotDumpException& e) {
-
- std::cerr << "ERROR: " << e.m_message.getStr() << "\n";
+ } catch (CannotDumpException & e) {
+ std::cerr << "ERROR: " << e.getMessage() << "\n";
if ( !standardout ) {
if (pofs && ((std::ofstream*)pofs)->is_open()) {
((std::ofstream*)pofs)->close();
@@ -1237,9 +1236,8 @@ void generateCalcAddin(ProgramOptions const & options,
delete pofs;
OSL_VERIFY(makeValidTypeFile(compFileName, tmpFileName, sal_False));
}
- } catch(const CannotDumpException& e) {
-
- std::cerr << "ERROR: " << e.m_message.getStr() << "\n";
+ } catch (CannotDumpException & e) {
+ std::cerr << "ERROR: " << e.getMessage() << "\n";
if ( !standardout ) {
if (pofs && ((std::ofstream*)pofs)->is_open()) {
((std::ofstream*)pofs)->close();
diff --git a/unodevtools/source/skeletonmaker/cpptypemaker.cxx b/unodevtools/source/skeletonmaker/cpptypemaker.cxx
index 2a99b842fe87..5d2c3fde7c8b 100644
--- a/unodevtools/source/skeletonmaker/cpptypemaker.cxx
+++ b/unodevtools/source/skeletonmaker/cpptypemaker.cxx
@@ -56,7 +56,7 @@ void printType(std::ostream & o,
case codemaker::UnoType::SORT_STRING:
case codemaker::UnoType::SORT_TYPE:
case codemaker::UnoType::SORT_ANY:
- case codemaker::UnoType::SORT_COMPLEX:
+ case codemaker::UnoType::SORT_COMPLEX: default: //TODO
break;
}
}
@@ -147,7 +147,7 @@ bool printConstructorParameters(std::ostream & o,
codemaker::convertString(reader.getSuperTypeName(0)));
typereg::Reader superReader(manager->getTypeReader(super));
if (!superReader.isValid())
- throw CannotDumpException("Bad type library entity " + super);
+ throw CannotDumpException("Bad type library entity " + b2u(super));
previous = printConstructorParameters(o,
options, manager, superReader, outerReader, arguments);
@@ -318,10 +318,10 @@ void printSetPropertyMixinBody(std::ostream & o,
o << " v <<= " << buffer2.makeStringAndClear() << ";\n\n";
}
- o << " prepareSet(\n OUString(\""
+ o << " prepareSet(\n rtl::OUString(\""
<< fieldname << "\"),\n css::uno::Any(), v, ";
} else {
- o << " prepareSet(\n OUString(\""
+ o << " prepareSet(\n rtl::OUString(\""
<< fieldname << "\"),\n css::uno::Any(), css::uno::Any(), ";
}
@@ -409,9 +409,9 @@ void printMethods(std::ostream & o,
if (body && options.componenttype == 2) {
if (type.equals("com/sun/star/lang/XServiceName")) {
o << "// ::com::sun::star::lang::XServiceName:\n"
- "OUString SAL_CALL " << classname << "getServiceName() "
+ "::rtl::OUString SAL_CALL " << classname << "getServiceName() "
"throw (css::uno::RuntimeException)\n{\n "
- "return OUString("
+ "return ::rtl::OUString("
"sADDIN_SERVICENAME);\n}\n";
generated.add(type);
return;
@@ -461,9 +461,7 @@ void printMethods(std::ostream & o,
reader.getSuperTypeName(i))));
if (!super.isValid()) {
throw CannotDumpException(
- "Bad type library entity "
- + codemaker::convertString(
- reader.getSuperTypeName(i)));
+ "Bad type library entity " + reader.getSuperTypeName(i));
}
printMethods(o, options, manager, super, generated, delegate,
@@ -732,7 +730,7 @@ void generateDocumentation(std::ostream & o,
OString const & type, OString const & delegate)
{
if (type.indexOf('/') >= 0)
- throw CannotDumpException("Illegal type name " + type);
+ throw CannotDumpException("Illegal type name " + b2u(type));
OString binType(type.replace('.', '/'));
RTTypeClass typeClass;
@@ -762,7 +760,7 @@ void generateDocumentation(std::ostream & o,
} else {
typereg::Reader reader(manager->getTypeReader(name));
if (!reader.isValid())
- throw CannotDumpException("Bad type library entity " + name);
+ throw CannotDumpException("Bad type library entity " + b2u(name));
switch (typeClass)
{
@@ -841,7 +839,7 @@ void generateDocumentation(std::ostream & o,
} else {
typereg::Reader reader(manager->getTypeReader(name));
if (!reader.isValid())
- throw CannotDumpException("Bad type library entity " + name);
+ throw CannotDumpException("Bad type library entity " + b2u(name));
switch (typeClass)
{
diff --git a/unodevtools/source/skeletonmaker/javacompskeleton.cxx b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
index 6110e9c57704..2e9efeda3696 100644
--- a/unodevtools/source/skeletonmaker/javacompskeleton.cxx
+++ b/unodevtools/source/skeletonmaker/javacompskeleton.cxx
@@ -940,9 +940,8 @@ void generateSkeleton(ProgramOptions const & options,
delete pofs;
OSL_VERIFY(makeValidTypeFile(compFileName, tmpFileName, sal_False));
}
- } catch(const CannotDumpException& e) {
-
- std::cerr << "ERROR: " << e.m_message.getStr() << "\n";
+ } catch (CannotDumpException & e) {
+ std::cerr << "ERROR: " << e.getMessage() << "\n";
if ( !standardout ) {
if (pofs && ((std::ofstream*)pofs)->is_open()) {
((std::ofstream*)pofs)->close();
diff --git a/unodevtools/source/skeletonmaker/javatypemaker.cxx b/unodevtools/source/skeletonmaker/javatypemaker.cxx
index 155bd0517dc2..420bf4864a4a 100644
--- a/unodevtools/source/skeletonmaker/javatypemaker.cxx
+++ b/unodevtools/source/skeletonmaker/javatypemaker.cxx
@@ -60,7 +60,7 @@ void printType(std::ostream & o,
case codemaker::UnoType::SORT_STRING:
case codemaker::UnoType::SORT_TYPE:
case codemaker::UnoType::SORT_ANY:
- case codemaker::UnoType::SORT_COMPLEX:
+ case codemaker::UnoType::SORT_COMPLEX: default: //TODO
break;
}
}
@@ -140,7 +140,7 @@ bool printConstructorParameters(std::ostream & o,
codemaker::convertString(reader.getSuperTypeName(0)));
typereg::Reader superReader(manager->getTypeReader(super));
if ( !superReader.isValid() ) {
- throw CannotDumpException("Bad type library entity " + super);
+ throw CannotDumpException("Bad type library entity " + b2u(super));
}
previous = printConstructorParameters(o,
options, manager, superReader, outerReader, arguments);
@@ -389,9 +389,7 @@ void printMethods(std::ostream & o,
reader.getSuperTypeName(i))));
if ( !super.isValid() ) {
throw CannotDumpException(
- "Bad type library entity "
- + codemaker::convertString(
- reader.getSuperTypeName(i)));
+ "Bad type library entity " + reader.getSuperTypeName(i));
}
printMethods(o, options, manager, super, generated, delegate,
indentation, defaultvalue, usepropertymixin);
@@ -632,7 +630,7 @@ void generateDocumentation(std::ostream & o,
OString const & type, OString const & delegate)
{
if ( type.indexOf('/') >= 0 ) {
- throw CannotDumpException("Illegal type name " + type);
+ throw CannotDumpException("Illegal type name " + b2u(type));
}
OString binType(type.replace('.', '/'));
RTTypeClass typeClass;
@@ -660,7 +658,7 @@ void generateDocumentation(std::ostream & o,
} else {
typereg::Reader reader(manager->getTypeReader(name));
if ( !reader.isValid() ) {
- throw CannotDumpException("Bad type library entity " + name);
+ throw CannotDumpException("Bad type library entity " + b2u(name));
}
switch ( typeClass ) {
case RT_TYPE_INTERFACE:
@@ -738,7 +736,7 @@ void generateDocumentation(std::ostream & o,
} else {
typereg::Reader reader(manager->getTypeReader(name));
if ( !reader.isValid() ) {
- throw CannotDumpException("Bad type library entity " + name);
+ throw CannotDumpException("Bad type library entity " + b2u(name));
}
switch ( typeClass ) {
case RT_TYPE_INTERFACE:
diff --git a/unodevtools/source/skeletonmaker/skeletoncommon.cxx b/unodevtools/source/skeletonmaker/skeletoncommon.cxx
index 27703c7e3f40..16ffd28933c1 100644
--- a/unodevtools/source/skeletonmaker/skeletoncommon.cxx
+++ b/unodevtools/source/skeletonmaker/skeletoncommon.cxx
@@ -32,7 +32,7 @@ using namespace ::codemaker::cpp;
namespace skeletonmaker {
-void printLicenseHeader(std::ostream& o, OString const & filename)
+void printLicenseHeader(std::ostream& o, rtl::OString const & filename)
{
sal_Int32 index = -1;
#ifdef SAL_UNX
@@ -77,9 +77,8 @@ bool getOutputStream(ProgramOptions const & options,
if( !file.isValid() )
{
- OString message("cannot open ");
- message += targetSourceFileName + " for writing";
- throw CannotDumpException(message);
+ throw CannotDumpException(
+ "cannot open " + b2u(targetSourceFileName) + " for writing");
} else {
tmpSourceFileName = file.getName();
}
@@ -145,8 +144,7 @@ void checkAttributes(rtl::Reference< TypeManager > const & manager,
reader.getSuperTypeName(i))));
if ( !supertype.isValid() ) {
throw CannotDumpException(
- "Bad type library entity "
- + codemaker::convertString(reader.getSuperTypeName(i)));
+ "Bad type library entity " + reader.getSuperTypeName(i));
}
checkAttributes(manager, supertype, attributes, propinterfaces);
}
@@ -177,7 +175,7 @@ void checkType(rtl::Reference< TypeManager > const & manager,
OString binType(type.replace('.', '/'));
typereg::Reader reader(manager->getTypeReader(binType));
if ( !reader.isValid() ) {
- throw CannotDumpException("Bad type library entity " + binType);
+ throw CannotDumpException("Bad type library entity " + b2u(binType));
}
switch ( reader.getTypeClass() )
@@ -211,7 +209,7 @@ void checkType(rtl::Reference< TypeManager > const & manager,
if ( !supertype.isValid() ) {
throw CannotDumpException(
"Bad type library entity "
- + codemaker::convertString(reader.getSuperTypeName(0)));
+ + reader.getSuperTypeName(0));
}
}
@@ -343,8 +341,7 @@ OString checkPropertyHelper(
if ( !supertype.isValid() ) {
throw CannotDumpException(
"Bad type library entity "
- + codemaker::convertString(
- reader.getSuperTypeName(0)));
+ + reader.getSuperTypeName(0));
}
checkAttributes(manager, supertype, attributes, propinterfaces);
@@ -385,9 +382,7 @@ bool checkXComponentSupport(rtl::Reference< TypeManager > const & manager,
reader.getSuperTypeName(i))));
if ( !super.isValid() ) {
throw CannotDumpException(
- "Bad type library entity "
- + codemaker::convertString(
- reader.getSuperTypeName(i)));
+ "Bad type library entity " + reader.getSuperTypeName(i));
}
if ( checkXComponentSupport(manager, super) )
return true;
@@ -529,12 +524,10 @@ void checkAddInTypes(rtl::Reference< TypeManager > const & manager,
if ( !checkAddinType(
manager, sReturnType, bLastAny, bHasXPropertySet, true) )
{
- OStringBuffer msg("the return type of the calc add-in function '");
- msg.append(sType);
- msg.append(":");
- msg.append(sMethod);
- msg.append("' is invalid. Please check your IDL defintion.");
- throw CannotDumpException(msg.makeStringAndClear());
+ throw CannotDumpException(
+ "the return type of the calc add-in function '" + b2u(sType)
+ + ":" + b2u(sMethod)
+ + "' is invalid. Please check your IDL defintion.");
}
bHasXPropertySet = false;
@@ -546,21 +539,20 @@ void checkAddInTypes(rtl::Reference< TypeManager > const & manager,
bLastAny, bHasXPropertySet, false) ||
bLastAny )
{
- OStringBuffer msg("the type of the ");
- msg.append((sal_Int32)p+1);
- msg.append(". parameter of the calc add-in function '");
- msg.append(sType);
- msg.append(":");
- msg.append(sMethod);
- msg.append("' is invalid.");
- if ( bLastAny )
- msg.append(" The type 'sequence<any>' is allowed as last "
- "parameter only.");
- if ( bHasXPropertySet )
- msg.append(" The type 'XPropertySet' is allowed only once.");
-
- msg.append(" Please check your IDL definition.");
- throw CannotDumpException(msg.makeStringAndClear());
+ throw CannotDumpException(
+ "the type of the " + OUString::number(p + 1)
+ + ". parameter of the calc add-in function '" + b2u(sType)
+ + ":" + b2u(sMethod) + "' is invalid."
+ + (bLastAny
+ ? OUString(
+ " The type 'sequence<any>' is allowed as last"
+ " parameter only.")
+ : OUString())
+ + (bHasXPropertySet
+ ? OUString(
+ " The type 'XPropertySet' is allowed only once.")
+ : OUString())
+ + " Please check your IDL definition.");
}
}
}
@@ -595,9 +587,7 @@ void generateFunctionParamterMap(std::ostream& o,
reader.getSuperTypeName(i))));
if ( !super.isValid() ) {
throw CannotDumpException(
- "Bad type library entity "
- + codemaker::convertString(
- reader.getSuperTypeName(i)));
+ "Bad type library entity " + reader.getSuperTypeName(i));
}
generateFunctionParamterMap(o, options, manager, super, generated, bFirst);
}
@@ -639,7 +629,7 @@ void generateFunctionParamterMap(std::ostream& o,
for ( sal_uInt16 p = 0; p < reader.getMethodParameterCount(m); ++p ) {
if ( options.language == 2 ) {
o << " fpm[" << p
- << "] = OUString(\""
+ << "] = ::rtl::OUString(\""
<< codemaker::convertString(reader.getMethodParameterName(m, p))
<< "\");\n";
}
@@ -658,7 +648,7 @@ void generateFunctionParamterMap(std::ostream& o,
}
if ( options.language == 2 ) {
- o << " m_functionMap[OUString(\""
+ o << " m_functionMap[::rtl::OUString(\""
<< sMethod << "\")] = fpm;\n\n";
}
else {
@@ -679,9 +669,7 @@ void generateFunctionParameterMap(std::ostream& o,
typereg::Reader reader(manager->getTypeReader((*iter).replace('.','/')));
if (!reader.isValid()) {
throw CannotDumpException(
- "Bad type library entity "
- + codemaker::convertString(
- reader.getTypeName()));
+ "Bad type library entity " + reader.getTypeName());
}
generateFunctionParamterMap(o, options, manager, reader, generated, bFirst);
diff --git a/unodevtools/source/skeletonmaker/skeletonmaker.cxx b/unodevtools/source/skeletonmaker/skeletonmaker.cxx
index 42eb62c81329..8dd5d638325c 100644
--- a/unodevtools/source/skeletonmaker/skeletonmaker.cxx
+++ b/unodevtools/source/skeletonmaker/skeletonmaker.cxx
@@ -330,7 +330,7 @@ SAL_IMPLEMENT_MAIN()
} catch (const CannotDumpException & e) {
std::cout.flush();
- std::cerr << "\nError: " << e.m_message << std::endl;
+ std::cerr << "\nError: " << e.getMessage() << std::endl;
} catch(const Exception& e) {
std::cout.flush();
std::cerr