View | Details | Raw Unified | Return to issue 123862
Collapse All | Expand All

(-)codemaker/source/javamaker/javamaker.cxx (-1 / +1 lines)
Lines 191-197 Link Here
191
					} else
191
					} else
192
					{
192
					{
193
						tmpName = typeName.copy(0, typeName.lastIndexOf('.')).replace('.', '/');
193
						tmpName = typeName.copy(0, typeName.lastIndexOf('.')).replace('.', '/');
194
						if (tmpName.getLength() == 0) 
194
						if ( tmpName.isEmpty() )
195
							tmpName = "/";
195
							tmpName = "/";
196
						else
196
						else
197
							tmpName.replace('.', '/');
197
							tmpName.replace('.', '/');
(-)codemaker/source/javamaker/javatype.cxx (-2 / +2 lines)
Lines 874-880 Link Here
874
        RTConstValue fieldValue(reader.getFieldValue(i));
874
        RTConstValue fieldValue(reader.getFieldValue(i));
875
        if (fieldValue.m_type != RT_TYPE_INT32
875
        if (fieldValue.m_type != RT_TYPE_INT32
876
            || reader.getFieldFlags(i) != RT_ACCESS_CONST
876
            || reader.getFieldFlags(i) != RT_ACCESS_CONST
877
            || reader.getFieldTypeName(i).getLength() != 0)
877
            || !reader.getFieldTypeName(i).isEmpty())
878
        {
878
        {
879
            throw CannotDumpException(
879
            throw CannotDumpException(
880
                rtl::OString(
880
                rtl::OString(
Lines 2868-2874 Link Here
2868
        for (sal_uInt16 i = 0; i < methods; ++i) {
2868
        for (sal_uInt16 i = 0; i < methods; ++i) {
2869
            rtl::OString name(codemaker::convertString(
2869
            rtl::OString name(codemaker::convertString(
2870
                                  reader.getMethodName(i)));
2870
                                  reader.getMethodName(i)));
2871
            bool defaultCtor = name.getLength() == 0;
2871
            bool defaultCtor = name.isEmpty();
2872
            if (reader.getMethodFlags(i) != RT_MODE_TWOWAY
2872
            if (reader.getMethodFlags(i) != RT_MODE_TWOWAY
2873
                || (!reader.getMethodReturnTypeName(i).equalsAsciiL(
2873
                || (!reader.getMethodReturnTypeName(i).equalsAsciiL(
2874
                        RTL_CONSTASCII_STRINGPARAM("void")))
2874
                        RTL_CONSTASCII_STRINGPARAM("void")))
(-)codemaker/source/javamaker/classfile.cxx (-4 / +4 lines)
Lines 492-498 Link Here
492
{
492
{
493
    m_thisClass = addClassInfo(thisClass);
493
    m_thisClass = addClassInfo(thisClass);
494
    m_superClass = addClassInfo(superClass);
494
    m_superClass = addClassInfo(superClass);
495
    if (signature.getLength() != 0) {
495
    if ( !signature.isEmpty() ) {
496
        ++m_attributesCount;
496
        ++m_attributesCount;
497
        appendU2(
497
        appendU2(
498
            m_attributes,
498
            m_attributes,
Lines 605-611 Link Here
605
    appendU2(
605
    appendU2(
606
        m_fields,
606
        m_fields,
607
        ((constantValueIndex == 0 ? 0 : 1)
607
        ((constantValueIndex == 0 ? 0 : 1)
608
         + (signature.getLength() == 0 ? 0 : 1)));
608
         + (signature.isEmpty() ? 0 : 1)));
609
    if (constantValueIndex != 0) {
609
    if (constantValueIndex != 0) {
610
        appendU2(
610
        appendU2(
611
            m_fields,
611
            m_fields,
Lines 644-650 Link Here
644
    appendU2(
644
    appendU2(
645
        m_methods,
645
        m_methods,
646
        ((code == 0 ? 0 : 1) + (exceptions.empty() ? 0 : 1)
646
        ((code == 0 ? 0 : 1) + (exceptions.empty() ? 0 : 1)
647
         + (signature.getLength() == 0 ? 0 : 1)));
647
         + (signature.isEmpty() ? 0 : 1)));
648
    if (code != 0) {
648
    if (code != 0) {
649
        std::vector< unsigned char >::size_type codeSize = code->m_code.size();
649
        std::vector< unsigned char >::size_type codeSize = code->m_code.size();
650
        std::vector< unsigned char >::size_type exceptionTableSize
650
        std::vector< unsigned char >::size_type exceptionTableSize
Lines 891-897 Link Here
891
void ClassFile::appendSignatureAttribute(
891
void ClassFile::appendSignatureAttribute(
892
    std::vector< unsigned char > & stream, rtl::OString const & signature)
892
    std::vector< unsigned char > & stream, rtl::OString const & signature)
893
{
893
{
894
    if (signature.getLength() != 0) {
894
    if ( !signature.isEmpty() ) {
895
        appendU2(
895
        appendU2(
896
            stream,
896
            stream,
897
            addUtf8Info(rtl::OString(RTL_CONSTASCII_STRINGPARAM("Signature"))));
897
            addUtf8Info(rtl::OString(RTL_CONSTASCII_STRINGPARAM("Signature"))));
(-)codemaker/source/cunomaker/cunomaker.cxx (-1 / +1 lines)
Lines 136-142 Link Here
136
					} else
136
					} else
137
					{
137
					{
138
						tmpName = typeName.copy(0, typeName.lastIndexOf('.')).replace('.', '/');
138
						tmpName = typeName.copy(0, typeName.lastIndexOf('.')).replace('.', '/');
139
						if (tmpName.getLength() == 0) 
139
						if ( tmpName.isEmpty() )
140
							tmpName = "/";
140
							tmpName = "/";
141
						else
141
						else
142
							tmpName.replace('.', '/');
142
							tmpName.replace('.', '/');
(-)codemaker/source/cunomaker/cunotype.cxx (-23 / +23 lines)
Lines 233-239 Link Here
233
		if ((index = typeName.lastIndexOf(']')) > 0)
233
		if ((index = typeName.lastIndexOf(']')) > 0)
234
			typeName = typeName.copy(index + 1);
234
			typeName = typeName.copy(index + 1);
235
235
236
		if (getBaseType(typeName).getLength() == 0)
236
		if ( getBaseType(typeName).isEmpty() )
237
		{
237
		{
238
			if (!produceType(typeName,
238
			if (!produceType(typeName,
239
						   	 m_typeMgr,
239
						   	 m_typeMgr,
Lines 393-399 Link Here
393
				  << ">\n#endif\n";
393
				  << ">\n#endif\n";
394
			}
394
			}
395
395
396
			if (getBaseType(relType).getLength() == 0 &&
396
			if (getBaseType(relType).isEmpty() &&
397
				m_typeName != relType)
397
				m_typeName != relType)
398
			{
398
			{
399
				if (m_typeMgr.getTypeClass(relType) == RT_TYPE_INTERFACE
399
				if (m_typeMgr.getTypeClass(relType) == RT_TYPE_INTERFACE
Lines 582-588 Link Here
582
582
583
		OString superType(m_reader.getSuperTypeName());
583
		OString superType(m_reader.getSuperTypeName());
584
		sal_Bool bIsBaseException = sal_False;
584
		sal_Bool bIsBaseException = sal_False;
585
		if (superType.getLength() > 0)
585
		if ( !superType.isEmpty() )
586
		{
586
		{
587
			if ( superType.equals("com/sun/star/uno/Exception") )
587
			if ( superType.equals("com/sun/star/uno/Exception") )
588
			{
588
			{
Lines 642-648 Link Here
642
642
643
		o << indent() << "typelib_static_compound_type_init( &s_pType_" << typeName << ", "
643
		o << indent() << "typelib_static_compound_type_init( &s_pType_" << typeName << ", "
644
		  << getTypeClass(m_typeName, sal_True) << ", \"" << m_typeName.replace('/', '.') << "\", ";
644
		  << getTypeClass(m_typeName, sal_True) << ", \"" << m_typeName.replace('/', '.') << "\", ";
645
		if ( superType.getLength() > 0 || bIsBaseException )
645
		if ( !superType.isEmpty() || bIsBaseException )
646
		{
646
		{
647
			if ( bIsBaseException )
647
			if ( bIsBaseException )
648
			{
648
			{
Lines 703-709 Link Here
703
 	  << indent() << "typelib_TypeDescription * pTD = 0;\n";
703
 	  << indent() << "typelib_TypeDescription * pTD = 0;\n";
704
704
705
	OString superType(m_reader.getSuperTypeName());
705
	OString superType(m_reader.getSuperTypeName());
706
	if (superType.getLength() > 0)
706
	if ( !superType.isEmpty() )
707
		o << indent() << "typelib_TypeDescriptionReference * pSuperType = 0;\n";
707
		o << indent() << "typelib_TypeDescriptionReference * pSuperType = 0;\n";
708
708
709
	sal_uInt32 		count = getMemberCount();
709
	sal_uInt32 		count = getMemberCount();
Lines 728-734 Link Here
728
728
729
	o << indent() << "rtl_uString_newFromAscii( &pTypeName, \"" << m_typeName.replace('/', '.') << "\" );\n";
729
	o << indent() << "rtl_uString_newFromAscii( &pTypeName, \"" << m_typeName.replace('/', '.') << "\" );\n";
730
730
731
	if (superType.getLength() > 0)
731
	if ( !superType.isEmpty() )
732
	{
732
	{
733
		o << indent() << "typelib_typedescriptionreference_newByAsciiName(&pSuperType, typelib_TypeClass_INTERFACE, \""
733
		o << indent() << "typelib_typedescriptionreference_newByAsciiName(&pSuperType, typelib_TypeClass_INTERFACE, \""
734
		  << superType.replace('/', '.') << "\" );\n";
734
		  << superType.replace('/', '.') << "\" );\n";
Lines 766-772 Link Here
766
		o << indent() << "&pTD,\n" << indent()
766
		o << indent() << "&pTD,\n" << indent()
767
		  << getTypeClass(OString(), sal_True) << ", pTypeName,\n";
767
		  << getTypeClass(OString(), sal_True) << ", pTypeName,\n";
768
768
769
		if (superType.getLength() > 0)
769
		if ( !superType.isEmpty() )
770
			o << indent() << "pSuperType,\n";
770
			o << indent() << "pSuperType,\n";
771
		else
771
		else
772
			o << indent() << "0,\n";
772
			o << indent() << "0,\n";
Lines 868-874 Link Here
868
868
869
	sal_uInt32 count = 0;
869
	sal_uInt32 count = 0;
870
	OString superType(pReader->getSuperTypeName());
870
	OString superType(pReader->getSuperTypeName());
871
	if (superType.getLength() > 0)
871
	if ( !superType.isEmpty() )
872
	{
872
	{
873
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
873
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
874
		if ( aSuperReader.isValid() )
874
		if ( aSuperReader.isValid() )
Lines 911-917 Link Here
911
	TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
911
	TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
912
912
913
	OString baseType(aSuperReader.getSuperTypeName());
913
	OString baseType(aSuperReader.getSuperTypeName());
914
	if (baseType.getLength() > 0)
914
	if ( !baseType.isEmpty() )
915
	{
915
	{
916
		dumpInheritedMembers(o, baseType);
916
		dumpInheritedMembers(o, baseType);
917
	}
917
	}
Lines 938-947 Link Here
938
938
939
OString	CunoType::getTypeClass(const OString& type, sal_Bool bCStyle)
939
OString	CunoType::getTypeClass(const OString& type, sal_Bool bCStyle)
940
{
940
{
941
	OString 	typeName = (type.getLength() > 0 ? type : m_typeName);
941
	OString 	typeName = ( !type.isEmpty() ? type : m_typeName );
942
	RTTypeClass	rtTypeClass = RT_TYPE_INVALID;
942
	RTTypeClass	rtTypeClass = RT_TYPE_INVALID;
943
943
944
	if (type.getLength() > 0)
944
	if ( !type.isEmpty() )
945
	{
945
	{
946
		typeName = type;
946
		typeName = type;
947
		rtTypeClass = m_typeMgr.getTypeClass(typeName);
947
		rtTypeClass = m_typeMgr.getTypeClass(typeName);
Lines 1059-1065 Link Here
1059
		case RT_TYPE_INVALID:
1059
		case RT_TYPE_INVALID:
1060
			{
1060
			{
1061
				OString tmp(getBaseType(relType));
1061
				OString tmp(getBaseType(relType));
1062
				if (tmp.getLength() > 0)
1062
				if ( !tmp.isEmpty() )
1063
				{
1063
				{
1064
					o << tmp.getStr();
1064
					o << tmp.getStr();
1065
					if ( bParam && !bPointer && relType.equals("any") )
1065
					if ( bParam && !bPointer && relType.equals("any") )
Lines 1389-1395 Link Here
1389
1389
1390
	if ( bResolveTypeOnly )
1390
	if ( bResolveTypeOnly )
1391
	{
1391
	{
1392
		if ( completePrefix.getLength() > 0 )
1392
		if ( !completePrefix.isEmpty() )
1393
		{
1393
		{
1394
			baseType = bSeqType ? (completePrefix + baseType) : ( baseType + completePrefix);
1394
			baseType = bSeqType ? (completePrefix + baseType) : ( baseType + completePrefix);
1395
		}
1395
		}
Lines 1575-1581 Link Here
1575
	TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
1575
	TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
1576
1576
1577
	OString baseType(aSuperReader.getSuperTypeName());
1577
	OString baseType(aSuperReader.getSuperTypeName());
1578
	if (baseType.getLength() > 0)
1578
	if ( !baseType.isEmpty() )
1579
	{
1579
	{
1580
		dumpInheritedFunctions(o, baseType);
1580
		dumpInheritedFunctions(o, baseType);
1581
	}
1581
	}
Lines 1591-1597 Link Here
1591
	inc();
1591
	inc();
1592
1592
1593
	OString superType(m_reader.getSuperTypeName());
1593
	OString superType(m_reader.getSuperTypeName());
1594
	if (superType.getLength() > 0)
1594
	if ( !superType.isEmpty() )
1595
		dumpInheritedFunctions(o, superType);
1595
		dumpInheritedFunctions(o, superType);
1596
/*
1596
/*
1597
	if (getNestedTypeNames().getLength() > 0)
1597
	if (getNestedTypeNames().getLength() > 0)
Lines 1915-1921 Link Here
1915
		inc();
1915
		inc();
1916
		OString superType(m_reader.getSuperTypeName());
1916
		OString superType(m_reader.getSuperTypeName());
1917
		sal_Bool bWithBase = sal_False;
1917
		sal_Bool bWithBase = sal_False;
1918
		if (superType.getLength() > 0 && !superType.equals("com/sun/star/uno/XInterface"))
1918
		if ( !superType.isEmpty() && !superType.equals("com/sun/star/uno/XInterface"))
1919
		{
1919
		{
1920
			bWithBase = sal_True;
1920
			bWithBase = sal_True;
1921
			o << indent() << "typelib_TypeDescriptionReference * pSuperType = 0;\n"
1921
			o << indent() << "typelib_TypeDescriptionReference * pSuperType = 0;\n"
Lines 1975-1981 Link Here
1975
	OString superType(m_reader.getSuperTypeName());
1975
	OString superType(m_reader.getSuperTypeName());
1976
	sal_uInt32 count = getMemberCount();
1976
	sal_uInt32 count = getMemberCount();
1977
1977
1978
	if (superType.getLength() > 0)
1978
	if ( !superType.isEmpty() )
1979
		o << indent() << "typelib_TypeDescriptionReference * pSuperType = 0;\n";
1979
		o << indent() << "typelib_TypeDescriptionReference * pSuperType = 0;\n";
1980
1980
1981
	if (count)
1981
	if (count)
Lines 1996-2002 Link Here
1996
1996
1997
	o << indent() << "rtl_uString_newFromAscii( &pTypeName, \"" << m_typeName.replace('/', '.') << "\" );\n";
1997
	o << indent() << "rtl_uString_newFromAscii( &pTypeName, \"" << m_typeName.replace('/', '.') << "\" );\n";
1998
1998
1999
	if (superType.getLength() > 0)
1999
	if ( !superType.isEmpty() )
2000
	{
2000
	{
2001
		o << indent() << "typelib_typedescriptionreference_newByAsciiName(&pSuperType, typelib_TypeClass_INTERFACE, \""
2001
		o << indent() << "typelib_typedescriptionreference_newByAsciiName(&pSuperType, typelib_TypeClass_INTERFACE, \""
2002
		  << superType.replace('/', '.') << "\" );\n";
2002
		  << superType.replace('/', '.') << "\" );\n";
Lines 2021-2027 Link Here
2021
			uik.m_Data1, uik.m_Data2, uik.m_Data3, uik.m_Data4, uik.m_Data5);
2021
			uik.m_Data1, uik.m_Data2, uik.m_Data3, uik.m_Data4, uik.m_Data5);
2022
	o << buffer;
2022
	o << buffer;
2023
2023
2024
	if (superType.getLength() > 0)
2024
	if ( !superType.isEmpty() )
2025
		o << indent() << "pSuperType,\n";
2025
		o << indent() << "pSuperType,\n";
2026
	else
2026
	else
2027
		o << indent() << "0,\n";
2027
		o << indent() << "0,\n";
Lines 2046-2052 Link Here
2046
	}
2046
	}
2047
	o << indent() << "typelib_typedescription_release( (typelib_TypeDescription*)pTD );\n";
2047
	o << indent() << "typelib_typedescription_release( (typelib_TypeDescription*)pTD );\n";
2048
2048
2049
	if (superType.getLength() > 0)
2049
	if ( !superType.isEmpty() )
2050
		o << indent() << "typelib_typedescription_release( pSuperType );\n\n";
2050
		o << indent() << "typelib_typedescription_release( pSuperType );\n\n";
2051
	else
2051
	else
2052
		o << "\n";
2052
		o << "\n";
Lines 2207-2213 Link Here
2207
2207
2208
	sal_uInt32 count = 0;
2208
	sal_uInt32 count = 0;
2209
	OString superType(pReader->getSuperTypeName());
2209
	OString superType(pReader->getSuperTypeName());
2210
	if (superType.getLength() > 0)
2210
	if ( !superType.isEmpty() )
2211
	{
2211
	{
2212
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
2212
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
2213
		if (aSuperReader.isValid())
2213
		if (aSuperReader.isValid())
Lines 2877-2883 Link Here
2877
	inc();
2877
	inc();
2878
2878
2879
	OString superType(m_reader.getSuperTypeName());
2879
	OString superType(m_reader.getSuperTypeName());
2880
	if (superType.getLength() > 0)
2880
	if ( !superType.isEmpty() )
2881
		o << indent() << superType.replace('/', '_').getStr() << " _Base;\n";
2881
		o << indent() << superType.replace('/', '_').getStr() << " _Base;\n";
2882
		//dumpInheritedMembers(o, superType);
2882
		//dumpInheritedMembers(o, superType);
2883
2883
Lines 2987-2993 Link Here
2987
	inc();
2987
	inc();
2988
2988
2989
	OString superType(m_reader.getSuperTypeName());
2989
	OString superType(m_reader.getSuperTypeName());
2990
	if (superType.getLength() > 0)
2990
	if ( !superType.isEmpty() )
2991
		o << indent() << superType.replace('/', '_').getStr() << " _Base;\n";
2991
		o << indent() << superType.replace('/', '_').getStr() << " _Base;\n";
2992
		//dumpInheritedMembers(o, superType);
2992
		//dumpInheritedMembers(o, superType);
2993
2993
(-)codemaker/source/cppumaker/includes.cxx (-1 / +1 lines)
Lines 265-271 Link Here
265
{
265
{
266
    static char const * extension[2] = { "hdl", "hpp" };
266
    static char const * extension[2] = { "hdl", "hpp" };
267
    out << "#include \"" << registryType;
267
    out << "#include \"" << registryType;
268
    if (suffix.getLength() > 0) {
268
    if ( !suffix.isEmpty() ) {
269
        out << "/" << suffix;
269
        out << "/" << suffix;
270
    }
270
    }
271
    out << "." << extension[hpp] << "\"\n";
271
    out << "." << extension[hpp] << "\"\n";
(-)codemaker/source/cppumaker/cppumaker.cxx (-1 / +1 lines)
Lines 198-204 Link Here
198
					} else
198
					} else
199
					{
199
					{
200
						tmpName = typeName.copy(0, typeName.lastIndexOf('.')).replace('.', '/');
200
						tmpName = typeName.copy(0, typeName.lastIndexOf('.')).replace('.', '/');
201
						if (tmpName.getLength() == 0) 
201
						if ( tmpName.isEmpty() )
202
							tmpName = "/";
202
							tmpName = "/";
203
						else
203
						else
204
							tmpName.replace('.', '/');
204
							tmpName.replace('.', '/');
(-)codemaker/source/cppumaker/cpputype.cxx (-23 / +23 lines)
Lines 243-249 Link Here
243
    }
243
    }
244
    
244
    
245
    OString sFileName = createFileNameFromType(sOutPath, sName, sExtension);
245
    OString sFileName = createFileNameFromType(sOutPath, sName, sExtension);
246
    if (sFileName.getLength() == 0)
246
    if ( sFileName.isEmpty() )
247
        return sal_False;
247
        return sal_False;
248
248
249
	sal_Bool bFileExists = fileExists( sFileName );
249
	sal_Bool bFileExists = fileExists( sFileName );
Lines 492-498 Link Here
492
            m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
492
            m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
493
    }
493
    }
494
    sal_Bool bIsBaseException = sal_False;
494
    sal_Bool bIsBaseException = sal_False;
495
    if (superType.getLength() > 0)
495
    if ( !superType.isEmpty() )
496
    {
496
    {
497
        if ( superType.equals("com/sun/star/uno/Exception") )
497
        if ( superType.equals("com/sun/star/uno/Exception") )
498
        {
498
        {
Lines 552-558 Link Here
552
552
553
    o << indent() << "typelib_static_compound_type_init( &the_type, "
553
    o << indent() << "typelib_static_compound_type_init( &the_type, "
554
      << getTypeClass(m_typeName, sal_True) << ", \"" << m_typeName.replace('/', '.') << "\", ";
554
      << getTypeClass(m_typeName, sal_True) << ", \"" << m_typeName.replace('/', '.') << "\", ";
555
    if ( superType.getLength() > 0 || bIsBaseException )
555
    if ( !superType.isEmpty() || bIsBaseException )
556
    {
556
    {
557
        if ( bIsBaseException )
557
        if ( bIsBaseException )
558
        {
558
        {
Lines 606-612 Link Here
606
        superType = rtl::OUStringToOString(
606
        superType = rtl::OUStringToOString(
607
            m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
607
            m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
608
    }
608
    }
609
    if (superType.getLength() > 0) {
609
    if ( !superType.isEmpty() ) {
610
        o << indent()
610
        o << indent()
611
          << "const ::com::sun::star::uno::Type& rSuperType = ::cppu::UnoType< ";
611
          << "const ::com::sun::star::uno::Type& rSuperType = ::cppu::UnoType< ";
612
        dumpType(o, superType, false, false, false, true);
612
        dumpType(o, superType, false, false, false, true);
Lines 660-666 Link Here
660
    o << indent() << "&pTD,\n" << indent() << "(typelib_TypeClass)"
660
    o << indent() << "&pTD,\n" << indent() << "(typelib_TypeClass)"
661
      << getTypeClass() << ", sTypeName.pData,\n";
661
      << getTypeClass() << ", sTypeName.pData,\n";
662
662
663
    if (superType.getLength() > 0) {
663
    if ( !superType.isEmpty() ) {
664
        o << indent() << "rSuperType.getTypeLibType(),\n";
664
        o << indent() << "rSuperType.getTypeLibType(),\n";
665
    } else {
665
    } else {
666
        o << indent() << "0,\n";
666
        o << indent() << "0,\n";
Lines 755-761 Link Here
755
        superType = rtl::OUStringToOString(
755
        superType = rtl::OUStringToOString(
756
            pReader->getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
756
            pReader->getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
757
    }
757
    }
758
	if (superType.getLength() > 0)
758
	if ( !superType.isEmpty() )
759
	{
759
	{
760
		typereg::Reader aSuperReader(m_typeMgr.getTypeReader(superType));
760
		typereg::Reader aSuperReader(m_typeMgr.getTypeReader(superType));
761
		if ( aSuperReader.isValid() )
761
		if ( aSuperReader.isValid() )
Lines 795-804 Link Here
795
795
796
OString	CppuType::getTypeClass(const OString& type, sal_Bool bCStyle)
796
OString	CppuType::getTypeClass(const OString& type, sal_Bool bCStyle)
797
{
797
{
798
	OString 	typeName = (type.getLength() > 0 ? type : m_typeName);
798
	OString 	typeName = (!type.isEmpty() ? type : m_typeName);
799
	RTTypeClass	rtTypeClass = RT_TYPE_INVALID;
799
	RTTypeClass	rtTypeClass = RT_TYPE_INVALID;
800
800
801
	if (type.getLength() > 0)
801
	if ( !type.isEmpty() )
802
	{
802
	{
803
		typeName = type;
803
		typeName = type;
804
		rtTypeClass = m_typeMgr.getTypeClass(typeName);
804
		rtTypeClass = m_typeMgr.getTypeClass(typeName);
Lines 905-911 Link Here
905
		case RT_TYPE_INVALID:
905
		case RT_TYPE_INVALID:
906
			{
906
			{
907
				OString tmp(translateSimpleUnoType(relType, cppuUnoType));
907
				OString tmp(translateSimpleUnoType(relType, cppuUnoType));
908
				if (tmp.getLength() > 0)
908
				if ( !tmp.isEmpty() )
909
				{
909
				{
910
					o << tmp;
910
					o << tmp;
911
				} else
911
				} else
Lines 2374-2382 Link Here
2374
    if (m_reader.getSuperTypeCount() != 0) {
2374
    if (m_reader.getSuperTypeCount() != 0) {
2375
        base = rtl::OUStringToOString(
2375
        base = rtl::OUStringToOString(
2376
            m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
2376
            m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
2377
        OSL_ASSERT(base.getLength() > 0); //TODO
2377
        OSL_ASSERT( !base.isEmpty() ); //TODO
2378
    }
2378
    }
2379
    if (base.getLength() > 0) {
2379
    if ( !base.isEmpty() ) {
2380
        o << ": public " << scopedCppName(base);
2380
        o << ": public " << scopedCppName(base);
2381
    }
2381
    }
2382
    o << " {\n";
2382
    o << " {\n";
Lines 2426-2432 Link Here
2426
            o << " "
2426
            o << " "
2427
                << rtl::OUStringToOString(
2427
                << rtl::OUStringToOString(
2428
                    m_reader.getFieldName(i), RTL_TEXTENCODING_UTF8);
2428
                    m_reader.getFieldName(i), RTL_TEXTENCODING_UTF8);
2429
            if (i == 0 && base.getLength() > 0 && type != "double"
2429
            if (i == 0 && !base.isEmpty() && type != "double"
2430
                && type != "hyper" && type != "unsigned hyper")
2430
                && type != "hyper" && type != "unsigned hyper")
2431
            {
2431
            {
2432
                OSL_ASSERT(!parameterized);
2432
                OSL_ASSERT(!parameterized);
Lines 2473-2479 Link Here
2473
            m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
2473
            m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
2474
    }
2474
    }
2475
	sal_Bool first = sal_True;
2475
	sal_Bool first = sal_True;
2476
	if (superType.getLength() > 0)
2476
	if ( !superType.isEmpty() )
2477
	{
2477
	{
2478
		o << indent() << ": " << scopedCppName(superType) << "()\n";
2478
		o << indent() << ": " << scopedCppName(superType) << "()\n";
2479
		first = sal_False;
2479
		first = sal_False;
Lines 2549-2555 Link Here
2549
2549
2550
		inc();
2550
		inc();
2551
        first = sal_True;
2551
        first = sal_True;
2552
		if (superType.getLength() > 0)
2552
		if ( !superType.isEmpty() )
2553
		{
2553
		{
2554
			o << indent() << ": " << scopedCppName(superType) << "(";
2554
			o << indent() << ": " << scopedCppName(superType) << "(";
2555
			dumpSuperMember(o, superType, sal_False);
2555
			dumpSuperMember(o, superType, sal_False);
Lines 2927-2933 Link Here
2927
{
2927
{
2928
	sal_Bool hasMember = sal_False;
2928
	sal_Bool hasMember = sal_False;
2929
2929
2930
	if (superType.getLength() > 0)
2930
	if ( !superType.isEmpty() )
2931
	{
2931
	{
2932
		typereg::Reader aSuperReader(m_typeMgr.getTypeReader(superType));
2932
		typereg::Reader aSuperReader(m_typeMgr.getTypeReader(superType));
2933
		
2933
		
Lines 3127-3133 Link Here
3127
        superType = rtl::OUStringToOString(
3127
        superType = rtl::OUStringToOString(
3128
            m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
3128
            m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
3129
    }
3129
    }
3130
	if (superType.getLength() > 0)
3130
	if ( !superType.isEmpty() )
3131
					o << " : public " << scopedCppName(superType);
3131
					o << " : public " << scopedCppName(superType);
3132
		
3132
		
3133
	o << "\n{\npublic:\n";
3133
	o << "\n{\npublic:\n";
Lines 3191-3197 Link Here
3191
		o << indent();
3191
		o << indent();
3192
		dumpType(o, fieldType);	
3192
		dumpType(o, fieldType);	
3193
		o << " " << fieldName;
3193
		o << " " << fieldName;
3194
        if (i == 0 && superType.getLength() &&
3194
        if (i == 0 && !superType.isEmpty() &&
3195
            !fieldType.equals("double") && !fieldType.equals("hyper") && !fieldType.equals("unsigned hyper"))
3195
            !fieldType.equals("double") && !fieldType.equals("hyper") && !fieldType.equals("unsigned hyper"))
3196
        {
3196
        {
3197
            o << " CPPU_GCC3_ALIGN( " << scopedCppName(superType) << " )";
3197
            o << " CPPU_GCC3_ALIGN( " << scopedCppName(superType) << " )";
Lines 3230-3236 Link Here
3230
            m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
3230
            m_reader.getSuperTypeName(0), RTL_TEXTENCODING_UTF8);
3231
    }
3231
    }
3232
	sal_Bool first = sal_True;
3232
	sal_Bool first = sal_True;
3233
	if (superType.getLength() > 0)
3233
	if ( !superType.isEmpty() )
3234
	{
3234
	{
3235
		o << indent() << ": " << scopedCppName(superType) << "()\n";
3235
		o << indent() << ": " << scopedCppName(superType) << "()\n";
3236
		first = sal_False;
3236
		first = sal_False;
Lines 3306-3312 Link Here
3306
3306
3307
		inc();
3307
		inc();
3308
        first = sal_True;
3308
        first = sal_True;
3309
		if (superType.getLength() > 0)
3309
		if ( !superType.isEmpty() )
3310
		{
3310
		{
3311
			o << indent() << ": " << scopedCppName(superType) << "(";
3311
			o << indent() << ": " << scopedCppName(superType) << "(";
3312
			dumpSuperMember(o, superType, sal_False);
3312
			dumpSuperMember(o, superType, sal_False);
Lines 3351-3357 Link Here
3351
    o << indent() << m_name << "::" << m_name << "(" << m_name
3351
    o << indent() << m_name << "::" << m_name << "(" << m_name
3352
      << " const & the_other)";
3352
      << " const & the_other)";
3353
    first = true;
3353
    first = true;
3354
    if (superType.getLength() > 0) {
3354
    if ( !superType.isEmpty() ) {
3355
        o << ": " << scopedCppName(superType) << "(the_other)";
3355
        o << ": " << scopedCppName(superType) << "(the_other)";
3356
        first = false;
3356
        first = false;
3357
    }
3357
    }
Lines 3370-3376 Link Here
3370
    o << indent()
3370
    o << indent()
3371
      << ("//TODO: Just like its implicitly-defined counterpart, this function"
3371
      << ("//TODO: Just like its implicitly-defined counterpart, this function"
3372
          " definition is not exception-safe\n");
3372
          " definition is not exception-safe\n");
3373
    if (superType.getLength() > 0) {
3373
    if ( !superType.isEmpty() ) {
3374
        o << indent() << scopedCppName(superType)
3374
        o << indent() << scopedCppName(superType)
3375
          << "::operator =(the_other);\n";
3375
          << "::operator =(the_other);\n";
3376
    }
3376
    }
Lines 3399-3405 Link Here
3399
{
3399
{
3400
	sal_Bool hasMember = sal_False;
3400
	sal_Bool hasMember = sal_False;
3401
3401
3402
	if (superType.getLength() > 0)
3402
	if ( !superType.isEmpty() )
3403
	{
3403
	{
3404
		typereg::Reader aSuperReader(m_typeMgr.getTypeReader(superType));
3404
		typereg::Reader aSuperReader(m_typeMgr.getTypeReader(superType));
3405
		
3405
		
Lines 4094-4100 Link Here
4094
}
4094
}
4095
4095
4096
bool ServiceType::isDefaultConstructor(sal_uInt16 ctorIndex) const {
4096
bool ServiceType::isDefaultConstructor(sal_uInt16 ctorIndex) const {
4097
    return m_reader.getMethodName(ctorIndex).getLength() == 0;
4097
    return m_reader.getMethodName(ctorIndex).isEmpty();
4098
}
4098
}
4099
4099
4100
bool ServiceType::hasRestParameter(sal_uInt16 ctorIndex) const {
4100
bool ServiceType::hasRestParameter(sal_uInt16 ctorIndex) const {
(-)codemaker/source/idlmaker/idltype.cxx (-21 / +21 lines)
Lines 127-133 Link Here
127
		if ((index = typeName.lastIndexOf(']')) > 0)
127
		if ((index = typeName.lastIndexOf(']')) > 0)
128
			typeName = typeName.copy(index + 1);
128
			typeName = typeName.copy(index + 1);
129
129
130
		if (getBaseType(typeName).getLength() == 0)
130
		if ( getBaseType(typeName).isEmpty() )
131
		{
131
		{
132
			if (!produceType(typeName,
132
			if (!produceType(typeName,
133
						   	 m_typeMgr,
133
						   	 m_typeMgr,
Lines 234-240 Link Here
234
234
235
		OString defPrefix("IDL");
235
		OString defPrefix("IDL");
236
236
237
		if (getBaseType(relType).getLength() == 0 &&
237
		if ( getBaseType(relType).isEmpty() &&
238
			m_typeName != relType)
238
			m_typeName != relType)
239
		{
239
		{
240
			if (m_typeMgr.getTypeClass(relType) == RT_TYPE_INTERFACE)
240
			if (m_typeMgr.getTypeClass(relType) == RT_TYPE_INTERFACE)
Lines 285-291 Link Here
285
{
285
{
286
	OString typeName(type);
286
	OString typeName(type);
287
	sal_Bool bOneLine = sal_True;
287
	sal_Bool bOneLine = sal_True;
288
	if (typeName.getLength() == 0)
288
	if ( typeName.isEmpty() )
289
	{
289
	{
290
		typeName = m_typeName;
290
		typeName = m_typeName;
291
		bOneLine = sal_False;
291
		bOneLine = sal_False;
Lines 356-362 Link Here
356
356
357
	sal_uInt32 count = 0;
357
	sal_uInt32 count = 0;
358
	OString superType(pReader->getSuperTypeName());
358
	OString superType(pReader->getSuperTypeName());
359
	if (superType.getLength() > 0)
359
	if ( !superType.isEmpty() )
360
	{
360
	{
361
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
361
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
362
		if ( aSuperReader.isValid() )
362
		if ( aSuperReader.isValid() )
Lines 418-424 Link Here
418
		case RT_TYPE_INVALID:
418
		case RT_TYPE_INVALID:
419
			{
419
			{
420
				OString tmp(getBaseType(relType));
420
				OString tmp(getBaseType(relType));
421
				if (tmp.getLength() > 0)
421
				if ( !tmp.isEmpty() )
422
				{
422
				{
423
					tmp = tmp.replace( ' ', '_' );
423
					tmp = tmp.replace( ' ', '_' );
424
					o << tmp;
424
					o << tmp;
Lines 776-787 Link Here
776
776
777
	// write documentation
777
	// write documentation
778
	OString aDoc = m_reader.getDoku();
778
	OString aDoc = m_reader.getDoku();
779
	if( aDoc.getLength() )
779
	if( !aDoc.isEmpty() )
780
		o << "/**\n" << aDoc << "\n*/";
780
		o << "/**\n" << aDoc << "\n*/";
781
	o << "\ninterface " << m_name;
781
	o << "\ninterface " << m_name;
782
782
783
	OString superType(m_reader.getSuperTypeName());
783
	OString superType(m_reader.getSuperTypeName());
784
	if (superType.getLength() > 0)
784
	if ( !superType.isEmpty() )
785
		o << " : " << scopedName(m_typeName, superType);
785
		o << " : " << scopedName(m_typeName, superType);
786
786
787
	o << "\n{\n";
787
	o << "\n{\n";
Lines 828-834 Link Here
828
828
829
		// write documentation
829
		// write documentation
830
		OString aDoc = m_reader.getFieldDoku(i);
830
		OString aDoc = m_reader.getFieldDoku(i);
831
		if( aDoc.getLength() )
831
		if( !aDoc.isEmpty() )
832
			o << "/**\n" << aDoc << "\n*/\n";
832
			o << "/**\n" << aDoc << "\n*/\n";
833
833
834
		if (access == RT_ACCESS_READONLY)
834
		if (access == RT_ACCESS_READONLY)
Lines 869-875 Link Here
869
869
870
		// write documentation
870
		// write documentation
871
		OString aDoc = m_reader.getMethodDoku(i);
871
		OString aDoc = m_reader.getMethodDoku(i);
872
		if( aDoc.getLength() )
872
		if( !aDoc.isEmpty() )
873
			o << "/**\n" << aDoc << "\n*/\n";
873
			o << "/**\n" << aDoc << "\n*/\n";
874
874
875
		o << indent();
875
		o << indent();
Lines 979-985 Link Here
979
979
980
	sal_uInt32 count = 0;
980
	sal_uInt32 count = 0;
981
	OString superType(pReader->getSuperTypeName());
981
	OString superType(pReader->getSuperTypeName());
982
	if (superType.getLength() > 0)
982
	if ( !superType.isEmpty() )
983
	{
983
	{
984
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
984
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
985
		if (aSuperReader.isValid())
985
		if (aSuperReader.isValid())
Lines 1258-1264 Link Here
1258
1258
1259
	// write documentation
1259
	// write documentation
1260
	OString aDoc = m_reader.getDoku();
1260
	OString aDoc = m_reader.getDoku();
1261
	if( aDoc.getLength() )
1261
	if( !aDoc.isEmpty() )
1262
		o << "/**\n" << aDoc << "\n*/";
1262
		o << "/**\n" << aDoc << "\n*/";
1263
1263
1264
	o << "\nstruct " << m_name;
1264
	o << "\nstruct " << m_name;
Lines 1266-1272 Link Here
1266
	inc();
1266
	inc();
1267
1267
1268
	OString superType(m_reader.getSuperTypeName());
1268
	OString superType(m_reader.getSuperTypeName());
1269
	if (superType.getLength() > 0)
1269
	if ( !superType.isEmpty() )
1270
		dumpSuperMember(o, superType);
1270
		dumpSuperMember(o, superType);
1271
1271
1272
	sal_uInt32 		fieldCount = m_reader.getFieldCount();
1272
	sal_uInt32 		fieldCount = m_reader.getFieldCount();
Lines 1287-1293 Link Here
1287
1287
1288
		// write documentation
1288
		// write documentation
1289
		OString aDoc = m_reader.getFieldDoku(i);
1289
		OString aDoc = m_reader.getFieldDoku(i);
1290
		if( aDoc.getLength() )
1290
		if( !aDoc.isEmpty() )
1291
			o << "/**\n" << aDoc << "\n*/";
1291
			o << "/**\n" << aDoc << "\n*/";
1292
1292
1293
		o << indent();
1293
		o << indent();
Lines 1307-1313 Link Here
1307
1307
1308
void StructureType::dumpSuperMember(FileStream& o, const OString& superType)
1308
void StructureType::dumpSuperMember(FileStream& o, const OString& superType)
1309
{
1309
{
1310
	if (superType.getLength() > 0)
1310
	if ( !superType.isEmpty() )
1311
	{
1311
	{
1312
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
1312
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
1313
1313
Lines 1331-1337 Link Here
1331
1331
1332
				// write documentation
1332
				// write documentation
1333
				OString aDoc = aSuperReader.getFieldDoku(i);
1333
				OString aDoc = aSuperReader.getFieldDoku(i);
1334
				if( aDoc.getLength() )
1334
				if( !aDoc.isEmpty() )
1335
					o << "/**\n" << aDoc << "\n*/";
1335
					o << "/**\n" << aDoc << "\n*/";
1336
1336
1337
				o << indent();
1337
				o << indent();
Lines 1374-1380 Link Here
1374
1374
1375
	// write documentation
1375
	// write documentation
1376
	OString aDoc = m_reader.getDoku();
1376
	OString aDoc = m_reader.getDoku();
1377
	if( aDoc.getLength() )
1377
	if( !aDoc.isEmpty() )
1378
		o << "/**\n" << aDoc << "\n*/";
1378
		o << "/**\n" << aDoc << "\n*/";
1379
1379
1380
	o << "\nexception " << m_name;
1380
	o << "\nexception " << m_name;
Lines 1385-1391 Link Here
1385
	o << indent() << "/*extra member to hold a derived exception */\n";
1385
	o << indent() << "/*extra member to hold a derived exception */\n";
1386
	o << indent() << "any _derivedException;\n";
1386
	o << indent() << "any _derivedException;\n";
1387
	OString superType(m_reader.getSuperTypeName());
1387
	OString superType(m_reader.getSuperTypeName());
1388
	if (superType.getLength() > 0)
1388
	if ( !superType.isEmpty() )
1389
		dumpSuperMember(o, superType);
1389
		dumpSuperMember(o, superType);
1390
1390
1391
	sal_uInt32 		fieldCount = m_reader.getFieldCount();
1391
	sal_uInt32 		fieldCount = m_reader.getFieldCount();
Lines 1406-1412 Link Here
1406
1406
1407
		// write documentation
1407
		// write documentation
1408
		OString aDoc = m_reader.getFieldDoku(i);
1408
		OString aDoc = m_reader.getFieldDoku(i);
1409
		if( aDoc.getLength() )
1409
		if( !aDoc.isEmpty() )
1410
			o << "/**\n" << aDoc << "\n*/";
1410
			o << "/**\n" << aDoc << "\n*/";
1411
1411
1412
		o << indent();
1412
		o << indent();
Lines 1427-1433 Link Here
1427
1427
1428
void ExceptionType::dumpSuperMember(FileStream& o, const OString& superType)
1428
void ExceptionType::dumpSuperMember(FileStream& o, const OString& superType)
1429
{
1429
{
1430
	if (superType.getLength() > 0)
1430
	if ( !superType.isEmpty() )
1431
	{
1431
	{
1432
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
1432
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
1433
1433
Lines 1451-1457 Link Here
1451
1451
1452
				// write documentation
1452
				// write documentation
1453
				OString aDoc = aSuperReader.getFieldDoku(i);
1453
				OString aDoc = aSuperReader.getFieldDoku(i);
1454
				if( aDoc.getLength() )
1454
				if( !aDoc.isEmpty() )
1455
					o << "/**\n" << aDoc << "\n*/";
1455
					o << "/**\n" << aDoc << "\n*/";
1456
1456
1457
				o << indent();
1457
				o << indent();
Lines 1492-1498 Link Here
1492
1492
1493
	// write documentation
1493
	// write documentation
1494
	OString aDoc = m_reader.getDoku();
1494
	OString aDoc = m_reader.getDoku();
1495
	if( aDoc.getLength() )
1495
	if( !aDoc.isEmpty() )
1496
		o << "/**\n" << aDoc << "\n*/";
1496
		o << "/**\n" << aDoc << "\n*/";
1497
1497
1498
	o << "\nenum " << m_name << "\n{\n";
1498
	o << "\nenum " << m_name << "\n{\n";
(-)codemaker/source/idlmaker/idlmaker.cxx (-1 / +1 lines)
Lines 136-142 Link Here
136
					} else
136
					} else
137
					{
137
					{
138
						tmpName = typeName.copy(0, typeName.lastIndexOf('.')).replace('.', '/');
138
						tmpName = typeName.copy(0, typeName.lastIndexOf('.')).replace('.', '/');
139
						if (tmpName.getLength() == 0) 
139
						if ( tmpName.isEmpty() )
140
							tmpName = "/";
140
							tmpName = "/";
141
						else
141
						else
142
							tmpName.replace('.', '/');
142
							tmpName.replace('.', '/');
(-)codemaker/source/codemaker/global.cxx (-4 / +4 lines)
Lines 113-119 Link Here
113
		nameBuffer.append("/", 1);
113
		nameBuffer.append("/", 1);
114
114
115
	OString tmpStr(type);
115
	OString tmpStr(type);
116
	if (prefix.getLength() > 0)
116
	if ( !prefix.isEmpty() )
117
	{
117
	{
118
		tmpStr = type.replaceAt(type.lastIndexOf('/')+1, 0, prefix);
118
		tmpStr = type.replaceAt(type.lastIndexOf('/')+1, 0, prefix);
119
	}
119
	}
Lines 295-301 Link Here
295
FileStream::FileStream(const OString& name, FileAccessMode mode)
295
FileStream::FileStream(const OString& name, FileAccessMode mode)
296
	: m_file(NULL)
296
	: m_file(NULL)
297
{
297
{
298
    if ( name.getLength() > 0 )
298
    if ( !name.isEmpty() )
299
    {
299
    {
300
        OUString sUrl(convertToFileUrl(name));
300
        OUString sUrl(convertToFileUrl(name));
301
#ifdef SAL_UNX        
301
#ifdef SAL_UNX        
Lines 335-341 Link Here
335
    OUString sTmpPath;
335
    OUString sTmpPath;
336
    OUString sTmpName;
336
    OUString sTmpName;
337
337
338
    if (sPath.getLength() > 0)
338
    if ( !sPath.isEmpty() )
339
        sTmp = sPath;
339
        sTmp = sPath;
340
340
341
    sTmpPath = convertToFileUrl(sTmp);
341
    sTmpPath = convertToFileUrl(sTmp);
Lines 361-367 Link Here
361
361
362
void FileStream::open(const OString& name, FileAccessMode mode)
362
void FileStream::open(const OString& name, FileAccessMode mode)
363
{
363
{
364
	if ( name.getLength() > 0 )
364
	if ( !name.isEmpty() )
365
	{
365
	{
366
        oslFileError ret =  osl_File_E_None;
366
        oslFileError ret =  osl_File_E_None;
367
        if ((ret = osl_openFile(convertToFileUrl(name).pData, &m_file, checkAccessMode(mode))) == osl_File_E_None)
367
        if ((ret = osl_openFile(convertToFileUrl(name).pData, &m_file, checkAccessMode(mode))) == osl_File_E_None)
(-)codemaker/source/codemaker/unotype.cxx (-1 / +1 lines)
Lines 53-59 Link Here
53
}
53
}
54
54
55
bool codemaker::UnoType::isSequenceType(rtl::OString const & type) {
55
bool codemaker::UnoType::isSequenceType(rtl::OString const & type) {
56
    return type.getLength() > 0 && type[0] == '[';
56
    return ( !type.isEmpty() && type[0] == '[' );
57
}
57
}
58
58
59
rtl::OString codemaker::UnoType::decompose(
59
rtl::OString codemaker::UnoType::decompose(
(-)codemaker/source/bonobowrappermaker/corbamaker.cxx (-1 / +1 lines)
Lines 167-173 Link Here
167
					} else
167
					} else
168
					{
168
					{
169
						tmpName = typeName.copy(0, typeName.lastIndexOf('.')).replace('.', '/');
169
						tmpName = typeName.copy(0, typeName.lastIndexOf('.')).replace('.', '/');
170
						if (tmpName.getLength() == 0) 
170
						if ( tmpName.isEmpty() )
171
							tmpName = "/";
171
							tmpName = "/";
172
						else
172
						else
173
							tmpName.replace('.', '/');
173
							tmpName.replace('.', '/');
(-)codemaker/source/bonobowrappermaker/corbatype.cxx (-20 / +20 lines)
Lines 104-110 Link Here
104
		if ((index = typeName.lastIndexOf(']')) > 0)
104
		if ((index = typeName.lastIndexOf(']')) > 0)
105
			typeName = typeName.copy(index + 1);
105
			typeName = typeName.copy(index + 1);
106
		
106
		
107
		if (getUnoBaseType(typeName).getLength() == 0)
107
		if ( getUnoBaseType(typeName).isEmpty() )
108
		{
108
		{
109
			if (!produceType(typeName,
109
			if (!produceType(typeName,
110
				m_typeMgr,
110
				m_typeMgr,
Lines 302-308 Link Here
302
					realTypeName = "";	
302
					realTypeName = "";	
303
				}
303
				}
304
			}
304
			}
305
			while (realTypeName.getLength() > 0);
305
			while ( !realTypeName.isEmpty() );
306
306
307
			o << "}; // namespace bonobobridge\n";
307
			o << "}; // namespace bonobobridge\n";
308
		}
308
		}
Lines 341-348 Link Here
341
				bSequenceDumped = sal_True;
341
				bSequenceDumped = sal_True;
342
			}
342
			}
343
			
343
			
344
			if (getUnoBaseType(relType).getLength() == 0 &&
344
			if ( getUnoBaseType(relType).isEmpty() &&
345
				m_typeName != relType)
345
				 m_typeName != relType)
346
			{
346
			{
347
				if (m_typeMgr.getTypeClass(relType) == RT_TYPE_INTERFACE
347
				if (m_typeMgr.getTypeClass(relType) == RT_TYPE_INTERFACE
348
					&& sPrefix.equals("HDL"))
348
					&& sPrefix.equals("HDL"))
Lines 377-383 Link Here
377
{
377
{
378
	OString typeName(type);
378
	OString typeName(type);
379
	sal_Bool bOneLine = sal_True; 
379
	sal_Bool bOneLine = sal_True; 
380
	if (typeName.getLength() == 0)
380
	if ( typeName.isEmpty() )
381
	{
381
	{
382
		typeName = m_typeName;
382
		typeName = m_typeName;
383
		bOneLine = sal_False;
383
		bOneLine = sal_False;
Lines 448-454 Link Here
448
448
449
	sal_uInt32 count = 0;
449
	sal_uInt32 count = 0;
450
	OString superType(pReader->getSuperTypeName());
450
	OString superType(pReader->getSuperTypeName());
451
	if (superType.getLength() > 0)
451
	if ( !superType.isEmpty() )
452
	{
452
	{
453
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
453
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
454
		if ( aSuperReader.isValid() )
454
		if ( aSuperReader.isValid() )
Lines 486-495 Link Here
486
486
487
OString	CorbaType::getTypeClass(const OString& type, sal_Bool bCStyle)
487
OString	CorbaType::getTypeClass(const OString& type, sal_Bool bCStyle)
488
{
488
{
489
	OString 	typeName = (type.getLength() > 0 ? type : m_typeName);
489
	OString 	typeName = ( !type.isEmpty() ? type : m_typeName);
490
	RTTypeClass	rtTypeClass = RT_TYPE_INVALID;
490
	RTTypeClass	rtTypeClass = RT_TYPE_INVALID;
491
491
492
	if (type.getLength() > 0)
492
	if ( !type.isEmpty() )
493
	{
493
	{
494
		typeName = type;
494
		typeName = type;
495
		rtTypeClass = m_typeMgr.getTypeClass(typeName);
495
		rtTypeClass = m_typeMgr.getTypeClass(typeName);
Lines 599-605 Link Here
599
	case RT_TYPE_INVALID:
599
	case RT_TYPE_INVALID:
600
	{
600
	{
601
		OString tmp(getUnoBaseType(relType));
601
		OString tmp(getUnoBaseType(relType));
602
		if (tmp.getLength() > 0)
602
		if ( !tmp.isEmpty() )
603
		{
603
		{
604
			ret.append(getUnoBaseType(relType));
604
			ret.append(getUnoBaseType(relType));
605
		} else
605
		} else
Lines 674-680 Link Here
674
	case RT_TYPE_INVALID:
674
	case RT_TYPE_INVALID:
675
	{
675
	{
676
		OString tmp(getUnoBaseType(relType));
676
		OString tmp(getUnoBaseType(relType));
677
		if (tmp.getLength() > 0)
677
		if ( !tmp.isEmpty() )
678
			ret.append(getCorbaBaseType(relType));
678
			ret.append(getCorbaBaseType(relType));
679
		else
679
		else
680
			throw CannotDumpException("Unknown type '" + relType + "', incomplete type library. ("+type+")");
680
			throw CannotDumpException("Unknown type '" + relType + "', incomplete type library. ("+type+")");
Lines 749-755 Link Here
749
sal_Bool CorbaType::isDerivedFromUnknown(const ::rtl::OString& typeName)
749
sal_Bool CorbaType::isDerivedFromUnknown(const ::rtl::OString& typeName)
750
{
750
{
751
	sal_Bool ret = sal_True;
751
	sal_Bool ret = sal_True;
752
	if (typeName.getLength() == 0)
752
	if ( typeName.isEmpty() )
753
		ret = sal_False;
753
		ret = sal_False;
754
	else if (typeName.equals("Bonobo/NullInterface"))
754
	else if (typeName.equals("Bonobo/NullInterface"))
755
		ret = sal_False;
755
		ret = sal_False;
Lines 839-845 Link Here
839
	case RT_TYPE_INVALID:
839
	case RT_TYPE_INVALID:
840
	{
840
	{
841
		OString tmp(getUnoBaseType(relType));
841
		OString tmp(getUnoBaseType(relType));
842
		if (tmp.getLength() > 0)
842
		if ( !tmp.isEmpty() )
843
		{
843
		{
844
			ret.append(getCorbaBaseType(relType));
844
			ret.append(getCorbaBaseType(relType));
845
		} else
845
		} else
Lines 1824-1830 Link Here
1824
1824
1825
	initBuffer.insert(0, OString("&bonobobridge_") + printCorbaType(m_typeName, sal_False, sal_False) + OString("_epv"));
1825
	initBuffer.insert(0, OString("&bonobobridge_") + printCorbaType(m_typeName, sal_False, sal_False) + OString("_epv"));
1826
1826
1827
	while(superName.getLength() != 0)
1827
	while( !superName.isEmpty() )
1828
	{
1828
	{
1829
		if (superName.equals("Bonobo/NullInterface"))
1829
		if (superName.equals("Bonobo/NullInterface"))
1830
		{
1830
		{
Lines 1996-2002 Link Here
1996
1996
1997
	sal_uInt32 count = 0;
1997
	sal_uInt32 count = 0;
1998
	OString superType(pReader->getSuperTypeName());
1998
	OString superType(pReader->getSuperTypeName());
1999
	if (superType.getLength() > 0)
1999
	if ( !superType.isEmpty() )
2000
	{
2000
	{
2001
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
2001
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
2002
		if (aSuperReader.isValid())
2002
		if (aSuperReader.isValid())
Lines 2162-2168 Link Here
2162
	}
2162
	}
2163
	else
2163
	else
2164
	{
2164
	{
2165
		if (superType.getLength() > 0)
2165
		if ( !superType.isEmpty() )
2166
		{
2166
		{
2167
			o << "  ret = bonobobridge::cpp_convert_b2u((";
2167
			o << "  ret = bonobobridge::cpp_convert_b2u((";
2168
			dumpUnoType(o, superType, sal_False, sal_False);
2168
			dumpUnoType(o, superType, sal_False, sal_False);
Lines 2210-2216 Link Here
2210
		o << "  // fix me: union !!!!\n  ret = sal_False;\n";
2210
		o << "  // fix me: union !!!!\n  ret = sal_False;\n";
2211
	else
2211
	else
2212
	{
2212
	{
2213
		if (superType.getLength() > 0)
2213
		if ( !superType.isEmpty() )
2214
		{
2214
		{
2215
			o << "  ret = bonobobridge::cpp_convert_u2b((";
2215
			o << "  ret = bonobobridge::cpp_convert_u2b((";
2216
			dumpCorbaType(o, superType, sal_False, sal_False);
2216
			dumpCorbaType(o, superType, sal_False, sal_False);
Lines 2268-2274 Link Here
2268
{
2268
{
2269
	sal_Bool hasMember = sal_False;
2269
	sal_Bool hasMember = sal_False;
2270
2270
2271
	if (superType.getLength() > 0)
2271
	if ( !superType.isEmpty() )
2272
	{
2272
	{
2273
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
2273
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
2274
		
2274
		
Lines 2359-2365 Link Here
2359
	sal_Int32    cIndex;
2359
	sal_Int32    cIndex;
2360
	OString      corbaFieldName;
2360
	OString      corbaFieldName;
2361
2361
2362
	if (superType.getLength() > 0)
2362
	if ( !superType.isEmpty() )
2363
	{
2363
	{
2364
		o << "  ret = bonobobridge::cpp_convert_b2u((";
2364
		o << "  ret = bonobobridge::cpp_convert_b2u((";
2365
		dumpUnoType(o, superType, sal_False, sal_False);
2365
		dumpUnoType(o, superType, sal_False, sal_False);
Lines 2404-2410 Link Here
2404
	dumpCorbaType(o, m_typeName, sal_False, sal_False);
2404
	dumpCorbaType(o, m_typeName, sal_False, sal_False);
2405
	o << "*) pOut;\n\n";
2405
	o << "*) pOut;\n\n";
2406
2406
2407
	if (superType.getLength() > 0)
2407
	if ( !superType.isEmpty() )
2408
	{
2408
	{
2409
		o << "  ret = bonobobridge::cpp_convert_u2b((";
2409
		o << "  ret = bonobobridge::cpp_convert_u2b((";
2410
		dumpCorbaType(o, superType, sal_False, sal_False);
2410
		dumpCorbaType(o, superType, sal_False, sal_False);
Lines 2463-2469 Link Here
2463
{
2463
{
2464
	sal_Bool hasMember = sal_False;
2464
	sal_Bool hasMember = sal_False;
2465
2465
2466
	if (superType.getLength() > 0)
2466
	if ( !superType.isEmpty() )
2467
	{
2467
	{
2468
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
2468
		TypeReader aSuperReader(m_typeMgr.getTypeReader(superType));
2469
		
2469
		

Return to issue 123862