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

(-)comphelper/source/xml/ofopxmlhelper.cxx (-8 / +8 lines)
Lines 303-309 Link Here
303
			m_aResultSeq[nNewEntryNum-1].realloc( 4 ); // the maximal expected number of arguments is 4
303
			m_aResultSeq[nNewEntryNum-1].realloc( 4 ); // the maximal expected number of arguments is 4
304
304
305
			::rtl::OUString aIDValue = xAttribs->getValueByName( m_aIDAttr );
305
			::rtl::OUString aIDValue = xAttribs->getValueByName( m_aIDAttr );
306
			if ( !aIDValue.getLength() )
306
			if ( aIDValue.isEmpty() )
307
				throw xml::sax::SAXException(); // TODO: the ID value must present
307
				throw xml::sax::SAXException(); // TODO: the ID value must present
308
308
309
			::rtl::OUString aTypeValue = xAttribs->getValueByName( m_aTypeAttr );
309
			::rtl::OUString aTypeValue = xAttribs->getValueByName( m_aTypeAttr );
Lines 313-331 Link Here
313
			m_aResultSeq[nNewEntryNum-1][++nAttrNum - 1].First = m_aIDAttr;
313
			m_aResultSeq[nNewEntryNum-1][++nAttrNum - 1].First = m_aIDAttr;
314
			m_aResultSeq[nNewEntryNum-1][nAttrNum - 1].Second = aIDValue;
314
			m_aResultSeq[nNewEntryNum-1][nAttrNum - 1].Second = aIDValue;
315
315
316
			if ( aTypeValue.getLength() )
316
			if ( !aTypeValue.isEmpty() )
317
			{
317
			{
318
				m_aResultSeq[nNewEntryNum-1][++nAttrNum - 1].First = m_aTypeAttr;
318
				m_aResultSeq[nNewEntryNum-1][++nAttrNum - 1].First = m_aTypeAttr;
319
				m_aResultSeq[nNewEntryNum-1][nAttrNum - 1].Second = aTypeValue;
319
				m_aResultSeq[nNewEntryNum-1][nAttrNum - 1].Second = aTypeValue;
320
			}
320
			}
321
321
322
			if ( aTargetValue.getLength() )
322
			if ( !aTargetValue.isEmpty() )
323
			{
323
			{
324
				m_aResultSeq[nNewEntryNum-1][++nAttrNum - 1].First = m_aTargetAttr;
324
				m_aResultSeq[nNewEntryNum-1][++nAttrNum - 1].First = m_aTargetAttr;
325
				m_aResultSeq[nNewEntryNum-1][nAttrNum - 1].Second = aTargetValue;
325
				m_aResultSeq[nNewEntryNum-1][nAttrNum - 1].Second = aTargetValue;
326
			}
326
			}
327
327
328
			if ( aTargetModeValue.getLength() )
328
			if ( !aTargetModeValue.isEmpty() )
329
			{
329
			{
330
				m_aResultSeq[nNewEntryNum-1][++nAttrNum - 1].First = m_aTargetModeAttr;
330
				m_aResultSeq[nNewEntryNum-1][++nAttrNum - 1].First = m_aTargetModeAttr;
331
				m_aResultSeq[nNewEntryNum-1][nAttrNum - 1].Second = aTargetModeValue;
331
				m_aResultSeq[nNewEntryNum-1][nAttrNum - 1].Second = aTargetModeValue;
Lines 369-379 Link Here
369
				throw uno::RuntimeException();
369
				throw uno::RuntimeException();
370
370
371
			::rtl::OUString aExtensionValue = xAttribs->getValueByName( m_aExtensionAttr );
371
			::rtl::OUString aExtensionValue = xAttribs->getValueByName( m_aExtensionAttr );
372
			if ( !aExtensionValue.getLength() )
372
			if ( aExtensionValue.isEmpty() )
373
				throw xml::sax::SAXException(); // TODO: the Extension value must present
373
				throw xml::sax::SAXException(); // TODO: the Extension value must present
374
374
375
			::rtl::OUString aContentTypeValue = xAttribs->getValueByName( m_aContentTypeAttr );
375
			::rtl::OUString aContentTypeValue = xAttribs->getValueByName( m_aContentTypeAttr );
376
			if ( !aContentTypeValue.getLength() )
376
			if ( aContentTypeValue.isEmpty() )
377
				throw xml::sax::SAXException(); // TODO: the ContentType value must present
377
				throw xml::sax::SAXException(); // TODO: the ContentType value must present
378
378
379
			sal_Int32 nNewResultLen = m_aResultSeq[0].getLength() + 1;
379
			sal_Int32 nNewResultLen = m_aResultSeq[0].getLength() + 1;
Lines 398-408 Link Here
398
				throw uno::RuntimeException();
398
				throw uno::RuntimeException();
399
399
400
			::rtl::OUString aPartNameValue = xAttribs->getValueByName( m_aPartNameAttr );
400
			::rtl::OUString aPartNameValue = xAttribs->getValueByName( m_aPartNameAttr );
401
			if ( !aPartNameValue.getLength() )
401
			if ( aPartNameValue.isEmpty() )
402
				throw xml::sax::SAXException(); // TODO: the PartName value must present
402
				throw xml::sax::SAXException(); // TODO: the PartName value must present
403
403
404
			::rtl::OUString aContentTypeValue = xAttribs->getValueByName( m_aContentTypeAttr );
404
			::rtl::OUString aContentTypeValue = xAttribs->getValueByName( m_aContentTypeAttr );
405
			if ( !aContentTypeValue.getLength() )
405
			if ( aContentTypeValue.isEmpty() )
406
				throw xml::sax::SAXException(); // TODO: the ContentType value must present
406
				throw xml::sax::SAXException(); // TODO: the ContentType value must present
407
407
408
			sal_Int32 nNewResultLen = m_aResultSeq[1].getLength() + 1;
408
			sal_Int32 nNewResultLen = m_aResultSeq[1].getLength() + 1;
(-)comphelper/source/container/embeddedobjectcontainer.cxx (-16 / +16 lines)
Lines 321-327 Link Here
321
{
321
{
322
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::GetEmbeddedObject" );
322
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::GetEmbeddedObject" );
323
323
324
    OSL_ENSURE( rName.getLength(), "Empty object name!");
324
    OSL_ENSURE( !rName.isEmpty(), "Empty object name!");
325
325
326
    uno::Reference < embed::XEmbeddedObject > xObj;
326
    uno::Reference < embed::XEmbeddedObject > xObj;
327
    EmbeddedObjectContainerNameMap::iterator aIt = pImpl->maObjectContainer.find( rName );
327
    EmbeddedObjectContainerNameMap::iterator aIt = pImpl->maObjectContainer.find( rName );
Lines 399-405 Link Here
399
{
399
{
400
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::CreateEmbeddedObject" );
400
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::CreateEmbeddedObject" );
401
401
402
    if ( !rNewName.getLength() )
402
    if ( rNewName.isEmpty() )
403
        rNewName = CreateUniqueObjectName();
403
        rNewName = CreateUniqueObjectName();
404
404
405
    OSL_ENSURE( !HasEmbeddedObject(rNewName), "Object to create already exists!");
405
    OSL_ENSURE( !HasEmbeddedObject(rNewName), "Object to create already exists!");
Lines 441-447 Link Here
441
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::AddEmbeddedObject" );
441
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::AddEmbeddedObject" );
442
442
443
#if OSL_DEBUG_LEVEL > 1
443
#if OSL_DEBUG_LEVEL > 1
444
    OSL_ENSURE( rName.getLength(), "Added object doesn't have a name!");
444
    OSL_ENSURE( !rName.isEmpty(), "Added object doesn't have a name!");
445
    uno::Reference < container::XNameAccess > xAccess( pImpl->mxStorage, uno::UNO_QUERY );
445
    uno::Reference < container::XNameAccess > xAccess( pImpl->mxStorage, uno::UNO_QUERY );
446
    uno::Reference < embed::XEmbedPersist > xEmb( xObj, uno::UNO_QUERY );
446
    uno::Reference < embed::XEmbedPersist > xEmb( xObj, uno::UNO_QUERY );
447
	uno::Reference < embed::XLinkageSupport > xLink( xEmb, uno::UNO_QUERY );
447
	uno::Reference < embed::XLinkageSupport > xLink( xEmb, uno::UNO_QUERY );
Lines 505-511 Link Here
505
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::StoreEmbeddedObject" );
505
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::StoreEmbeddedObject" );
506
506
507
    uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY );
507
    uno::Reference < embed::XEmbedPersist > xPersist( xObj, uno::UNO_QUERY );
508
    if ( !rName.getLength() )
508
    if ( rName.isEmpty() )
509
        rName = CreateUniqueObjectName();
509
        rName = CreateUniqueObjectName();
510
510
511
#if OSL_DEBUG_LEVEL > 1
511
#if OSL_DEBUG_LEVEL > 1
Lines 558-564 Link Here
558
{
558
{
559
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::InsertEmbeddedObject( InputStream )" );
559
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::InsertEmbeddedObject( InputStream )" );
560
560
561
    if ( !rNewName.getLength() )
561
    if ( rNewName.isEmpty() )
562
        rNewName = CreateUniqueObjectName();
562
        rNewName = CreateUniqueObjectName();
563
563
564
    // store it into the container storage
564
    // store it into the container storage
Lines 620-626 Link Here
620
{
620
{
621
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::InsertEmbeddedObject( MediaDescriptor )" );
621
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::InsertEmbeddedObject( MediaDescriptor )" );
622
622
623
    if ( !rNewName.getLength() )
623
    if ( rNewName.isEmpty() )
624
        rNewName = CreateUniqueObjectName();
624
        rNewName = CreateUniqueObjectName();
625
625
626
    uno::Reference < embed::XEmbeddedObject > xObj;
626
    uno::Reference < embed::XEmbeddedObject > xObj;
Lines 655-661 Link Here
655
{
655
{
656
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::InsertEmbeddedLink" );
656
	RTL_LOGFILE_CONTEXT( aLog, "comphelper (mv76033) comphelper::EmbeddedObjectContainer::InsertEmbeddedLink" );
657
657
658
    if ( !rNewName.getLength() )
658
    if ( rNewName.isEmpty() )
659
        rNewName = CreateUniqueObjectName();
659
        rNewName = CreateUniqueObjectName();
660
660
661
    uno::Reference < embed::XEmbeddedObject > xObj;
661
    uno::Reference < embed::XEmbeddedObject > xObj;
Lines 695-701 Link Here
695
695
696
	sal_Bool bResult = sal_False;
696
	sal_Bool bResult = sal_False;
697
697
698
	if ( ( &rSrc != this || !aOrigName.equals( aTargetName ) ) && aOrigName.getLength() && aTargetName.getLength() )
698
	if ( ( &rSrc != this || !aOrigName.equals( aTargetName ) ) && !aOrigName.isEmpty() && !aTargetName.isEmpty() )
699
	{
699
	{
700
		::rtl::OUString aMediaType;
700
		::rtl::OUString aMediaType;
701
		uno::Reference < io::XInputStream > xGrStream = rSrc.GetGraphicStream( aOrigName, &aMediaType );
701
		uno::Reference < io::XInputStream > xGrStream = rSrc.GetGraphicStream( aOrigName, &aMediaType );
Lines 719-725 Link Here
719
    if ( xPersist.is() )
719
    if ( xPersist.is() )
720
        aOrigName = xPersist->getEntryName();
720
        aOrigName = xPersist->getEntryName();
721
721
722
    if ( !rName.getLength() )
722
    if ( rName.isEmpty() )
723
        rName = CreateUniqueObjectName();
723
        rName = CreateUniqueObjectName();
724
724
725
    if ( StoreEmbeddedObject( xObj, rName, sal_True ) )
725
    if ( StoreEmbeddedObject( xObj, rName, sal_True ) )
Lines 748-754 Link Here
748
	catch( uno::Exception& )
748
	catch( uno::Exception& )
749
	{}
749
	{}
750
750
751
    if ( !rName.getLength() )
751
    if ( rName.isEmpty() )
752
        rName = CreateUniqueObjectName();
752
        rName = CreateUniqueObjectName();
753
753
754
	// objects without persistance are not really stored by the method
754
	// objects without persistance are not really stored by the method
Lines 766-772 Link Here
766
				{
766
				{
767
					// this is a OOo link, it has no persistence
767
					// this is a OOo link, it has no persistence
768
					::rtl::OUString aURL = xOrigLinkage->getLinkURL();
768
					::rtl::OUString aURL = xOrigLinkage->getLinkURL();
769
					if ( !aURL.getLength() )
769
					if ( aURL.isEmpty() )
770
						throw uno::RuntimeException();
770
						throw uno::RuntimeException();
771
771
772
					// create new linked object from the URL the link is based on
772
					// create new linked object from the URL the link is based on
Lines 868-874 Link Here
868
	if ( xResult.is() )
868
	if ( xResult.is() )
869
	{
869
	{
870
		// the object is successfully copied, try to copy graphical replacement
870
		// the object is successfully copied, try to copy graphical replacement
871
		if ( aOrigName.getLength() )
871
		if ( !aOrigName.isEmpty() )
872
			TryToCopyGraphReplacement( rSrc, aOrigName, rName );
872
			TryToCopyGraphReplacement( rSrc, aOrigName, rName );
873
873
874
		// the object might need the size to be set
874
		// the object might need the size to be set
Lines 1086-1092 Link Here
1086
                        static const ::rtl::OUString s_sMediaType(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
1086
                        static const ::rtl::OUString s_sMediaType(RTL_CONSTASCII_USTRINGPARAM("MediaType"));
1087
						xStorProps->getPropertyValue( s_sMediaType ) >>= aOrigStorMediaType;
1087
						xStorProps->getPropertyValue( s_sMediaType ) >>= aOrigStorMediaType;
1088
1088
1089
						OSL_ENSURE( aOrigStorMediaType.getLength(), "No valuable media type in the storage!\n" );
1089
						OSL_ENSURE( !aOrigStorMediaType.isEmpty(), "No valuable media type in the storage!\n" );
1090
1090
1091
						uno::Reference< beans::XPropertySet > xTargetStorProps(
1091
						uno::Reference< beans::XPropertySet > xTargetStorProps(
1092
																	pImpl->mpTempObjectContainer->pImpl->mxStorage,
1092
																	pImpl->mpTempObjectContainer->pImpl->mxStorage,
Lines 1206-1213 Link Here
1206
1206
1207
    uno::Reference < io::XInputStream > xStream;
1207
    uno::Reference < io::XInputStream > xStream;
1208
1208
1209
    OSL_ENSURE( aName.getLength(), "Retrieving graphic for unknown object!" );
1209
    OSL_ENSURE( !aName.isEmpty(), "Retrieving graphic for unknown object!" );
1210
	if ( aName.getLength() )
1210
	if ( !aName.isEmpty() )
1211
	{
1211
	{
1212
    	try
1212
    	try
1213
    	{
1213
    	{
Lines 1344-1350 Link Here
1344
											const uno::Reference< io::XInputStream >& xInStream,
1344
											const uno::Reference< io::XInputStream >& xInStream,
1345
											const ::rtl::OUString& aStreamName )
1345
											const ::rtl::OUString& aStreamName )
1346
    {
1346
    {
1347
	    OSL_ENSURE( aStreamName.getLength() && xInStream.is() && xDocStor.is(), "Misuse of the method!\n" );
1347
	    OSL_ENSURE( !aStreamName.isEmpty() && xInStream.is() && xDocStor.is(), "Misuse of the method!\n" );
1348
1348
1349
	    try
1349
	    try
1350
	    {
1350
	    {
(-)comphelper/source/eventattachermgr/eventattachermgr.cxx (-1 / +1 lines)
Lines 342-348 Link Here
342
342
343
                case TypeClass_STRING:
343
                case TypeClass_STRING:
344
                    // none empty string -> return
344
                    // none empty string -> return
345
                    if( ((OUString*)aRet.getValue())->getLength() > 0 )
345
                    if( ((OUString*)aRet.getValue())->isEmpty() == false )
346
                        return aRet;
346
                        return aRet;
347
                    break;
347
                    break;
348
348
(-)comphelper/source/property/genericpropertyset.cxx (-2 / +2 lines)
Lines 114-120 Link Here
114
    Reference < XPropertySetInfo > xInfo = getPropertySetInfo(  );
114
    Reference < XPropertySetInfo > xInfo = getPropertySetInfo(  );
115
    if ( xInfo.is() )
115
    if ( xInfo.is() )
116
    {
116
    {
117
        if ( !aPropertyName.getLength() )
117
        if ( aPropertyName.isEmpty() )
118
        {
118
        {
119
            Sequence< Property> aSeq = xInfo->getProperties();
119
            Sequence< Property> aSeq = xInfo->getProperties();
120
            const Property* pIter = aSeq.getConstArray();
120
            const Property* pIter = aSeq.getConstArray();
Lines 138-144 Link Here
138
    aGuard.clear();
138
    aGuard.clear();
139
    if ( xInfo.is() )
139
    if ( xInfo.is() )
140
    {
140
    {
141
        if ( !aPropertyName.getLength() )
141
        if ( aPropertyName.isEmpty() )
142
        {
142
        {
143
            Sequence< Property> aSeq = xInfo->getProperties();
143
            Sequence< Property> aSeq = xInfo->getProperties();
144
            const Property* pIter = aSeq.getConstArray();
144
            const Property* pIter = aSeq.getConstArray();
(-)comphelper/source/property/propertybag.cxx (-1 / +1 lines)
Lines 88-94 Link Here
88
    {
88
    {
89
        void    lcl_checkForEmptyName( const bool _allowEmpty, const ::rtl::OUString& _name )
89
        void    lcl_checkForEmptyName( const bool _allowEmpty, const ::rtl::OUString& _name )
90
        {
90
        {
91
            if ( !_allowEmpty && !_name.getLength() )
91
            if ( !_allowEmpty && _name.isEmpty() )
92
                throw IllegalArgumentException(
92
                throw IllegalArgumentException(
93
                        ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The property name must not be empty." ) ),
93
                        ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The property name must not be empty." ) ),
94
                        // TODO: resource
94
                        // TODO: resource
(-)comphelper/source/property/propagg.cxx (-1 / +1 lines)
Lines 509-515 Link Here
509
	if (1 == nLen)
509
	if (1 == nLen)
510
	{
510
	{
511
		const  ::com::sun::star::beans::PropertyChangeEvent& evt = _rEvents.getConstArray()[0];
511
		const  ::com::sun::star::beans::PropertyChangeEvent& evt = _rEvents.getConstArray()[0];
512
		OSL_ENSURE(evt.PropertyName.getLength() > 0, "OPropertySetAggregationHelper::propertiesChange : invalid event !");
512
		OSL_ENSURE( !evt.PropertyName.isEmpty(), "OPropertySetAggregationHelper::propertiesChange : invalid event !");
513
			// we had a bug where this assertion would have us saved a whole day :) (72514)
513
			// we had a bug where this assertion would have us saved a whole day :) (72514)
514
		sal_Int32 nHandle = rPH.getHandleByName( evt.PropertyName );
514
		sal_Int32 nHandle = rPH.getHandleByName( evt.PropertyName );
515
515
(-)comphelper/source/officeinstdir/officeinstallationdirectories.cxx (-5 / +5 lines)
Lines 69-75 Link Here
69
            {
69
            {
70
                aNormalizedURL = aFileStatus.getFileURL();
70
                aNormalizedURL = aFileStatus.getFileURL();
71
71
72
                if ( aNormalizedURL.getLength() > 0 )
72
                if ( !aNormalizedURL.isEmpty() )
73
                {
73
                {
74
                    if ( aNormalizedURL
74
                    if ( aNormalizedURL
75
                            .getStr()[ aNormalizedURL.getLength() - 1 ]
75
                            .getStr()[ aNormalizedURL.getLength() - 1 ]
Lines 146-152 Link Here
146
OfficeInstallationDirectories::makeRelocatableURL( const rtl::OUString& URL )
146
OfficeInstallationDirectories::makeRelocatableURL( const rtl::OUString& URL )
147
    throw ( uno::RuntimeException )
147
    throw ( uno::RuntimeException )
148
{
148
{
149
    if ( URL.getLength() > 0 )
149
    if ( !URL.isEmpty() )
150
    {
150
    {
151
        initDirs();
151
        initDirs();
152
152
Lines 193-199 Link Here
193
OfficeInstallationDirectories::makeAbsoluteURL( const rtl::OUString& URL )
193
OfficeInstallationDirectories::makeAbsoluteURL( const rtl::OUString& URL )
194
    throw ( uno::RuntimeException )
194
    throw ( uno::RuntimeException )
195
{
195
{
196
    if ( URL.getLength() > 0 )
196
    if ( !URL.isEmpty() )
197
    {
197
    {
198
        sal_Int32 nIndex = URL.indexOf( m_aOfficeBrandDirMacro );
198
        sal_Int32 nIndex = URL.indexOf( m_aOfficeBrandDirMacro );
199
        if ( nIndex != -1 )
199
        if ( nIndex != -1 )
Lines 345-351 Link Here
345
                    xExpander->expandMacros(
345
                    xExpander->expandMacros(
346
                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "$OOO_BASE_DIR" ) ) );
346
                         rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "$OOO_BASE_DIR" ) ) );
347
347
348
                OSL_ENSURE( m_pOfficeBrandDir->getLength() > 0,
348
                OSL_ENSURE( !m_pOfficeBrandDir->isEmpty(),
349
                            "Unable to obtain office brand installation directory!" );
349
                            "Unable to obtain office brand installation directory!" );
350
350
351
                makeCanonicalFileURL( *m_pOfficeBrandDir );
351
                makeCanonicalFileURL( *m_pOfficeBrandDir );
Lines 365-371 Link Here
365
                        rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
365
                        rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
366
                            "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE( "bootstrap" ) ":UserInstallation}" ) ) );
366
                            "${$OOO_BASE_DIR/program/" SAL_CONFIGFILE( "bootstrap" ) ":UserInstallation}" ) ) );
367
367
368
                OSL_ENSURE( m_pUserDir->getLength() > 0,
368
                OSL_ENSURE( !m_pUserDir->isEmpty(),
369
                            "Unable to obtain office user data directory!" );
369
                            "Unable to obtain office user data directory!" );
370
370
371
                makeCanonicalFileURL( *m_pUserDir );
371
                makeCanonicalFileURL( *m_pUserDir );
(-)comphelper/source/streaming/otransactedfilestream.cxx (-1 / +1 lines)
Lines 219-225 Link Here
219
		delete m_pStreamData;
219
		delete m_pStreamData;
220
		m_pStreamData = NULL;
220
		m_pStreamData = NULL;
221
221
222
		if ( bDelete && xFileAccess.is() && aURL.getLength() )
222
		if ( bDelete && xFileAccess.is() && !aURL.isEmpty() )
223
		{
223
		{
224
			// delete the file
224
			// delete the file
225
			try
225
			try
(-)comphelper/source/misc/numbers.cxx (-1 / +1 lines)
Lines 115-121 Link Here
115
{
115
{
116
	Any aReturn;
116
	Any aReturn;
117
117
118
	OSL_ENSURE( _rxFormatter.is() && _rPropertyName.getLength(), "getNumberFormatProperty: invalid arguments!" );
118
	OSL_ENSURE( _rxFormatter.is() && !_rPropertyName.isEmpty(), "getNumberFormatProperty: invalid arguments!" );
119
	try
119
	try
120
	{
120
	{
121
		Reference< XNumberFormatsSupplier > xSupplier;
121
		Reference< XNumberFormatsSupplier > xSupplier;
(-)comphelper/source/misc/logging.cxx (-2 / +2 lines)
Lines 91-97 Link Here
91
        try
91
        try
92
        {
92
        {
93
            Reference< XLoggerPool > xPool( LoggerPool::get( m_aContext.getUNOContext() ), UNO_QUERY_THROW );
93
            Reference< XLoggerPool > xPool( LoggerPool::get( m_aContext.getUNOContext() ), UNO_QUERY_THROW );
94
            if ( m_sLoggerName.getLength() )
94
            if ( !m_sLoggerName.isEmpty() )
95
                m_xLogger = xPool->getNamedLogger( m_sLoggerName );
95
                m_xLogger = xPool->getNamedLogger( m_sLoggerName );
96
            else
96
            else
97
                m_xLogger = xPool->getDefaultLogger();
97
                m_xLogger = xPool->getDefaultLogger();
Lines 383-389 Link Here
383
        ::rtl::OUString sMessage;
383
        ::rtl::OUString sMessage;
384
        if ( lcl_loadBundle_nothrow( m_pImpl->getContext(), *m_pData ) )
384
        if ( lcl_loadBundle_nothrow( m_pImpl->getContext(), *m_pData ) )
385
            sMessage = lcl_loadString_nothrow( m_pData->xBundle, _nMessageResID );
385
            sMessage = lcl_loadString_nothrow( m_pData->xBundle, _nMessageResID );
386
        if ( sMessage.getLength() == 0 )
386
        if ( sMessage.isEmpty() )
387
        {
387
        {
388
            ::rtl::OUStringBuffer aBuffer;
388
            ::rtl::OUStringBuffer aBuffer;
389
            aBuffer.appendAscii( "<invalid event resource: '" );
389
            aBuffer.appendAscii( "<invalid event resource: '" );
(-)comphelper/source/misc/docpasswordhelper.cxx (-8 / +8 lines)
Lines 53-59 Link Here
53
{
53
{
54
    uno::Sequence< sal_Int8 > aResult;
54
    uno::Sequence< sal_Int8 > aResult;
55
    
55
    
56
    if ( aPassword.getLength() && aSalt.getLength() && nCount && nHashLength )
56
    if ( !aPassword.isEmpty() && aSalt.getLength() && nCount && nHashLength )
57
    {
57
    {
58
        ::rtl::OString aBytePass = ::rtl::OUStringToOString( aPassword, RTL_TEXTENCODING_UTF8 );
58
        ::rtl::OString aBytePass = ::rtl::OUStringToOString( aPassword, RTL_TEXTENCODING_UTF8 );
59
        aResult.realloc( 16 );
59
        aResult.realloc( 16 );
Lines 104-110 Link Here
104
sal_Bool DocPasswordHelper::IsModifyPasswordCorrect( const ::rtl::OUString& aPassword, const uno::Sequence< beans::PropertyValue >& aInfo )
104
sal_Bool DocPasswordHelper::IsModifyPasswordCorrect( const ::rtl::OUString& aPassword, const uno::Sequence< beans::PropertyValue >& aInfo )
105
{
105
{
106
    sal_Bool bResult = sal_False;
106
    sal_Bool bResult = sal_False;
107
    if ( aPassword.getLength() && aInfo.getLength() )
107
    if ( !aPassword.isEmpty() && aInfo.getLength() )
108
    {
108
    {
109
        ::rtl::OUString sAlgorithm;
109
        ::rtl::OUString sAlgorithm;
110
        uno::Sequence< sal_Int8 > aSalt;
110
        uno::Sequence< sal_Int8 > aSalt;
Lines 238-244 Link Here
238
238
239
    ::rtl::OString aString = ::rtl::OUStringToOString( aUString, nEnc );
239
    ::rtl::OString aString = ::rtl::OUStringToOString( aUString, nEnc );
240
240
241
    if ( aString.getLength() && aString.getLength() <= SAL_MAX_UINT16 )
241
    if ( !aString.isEmpty() && aString.getLength() <= SAL_MAX_UINT16 )
242
    {
242
    {
243
        for ( sal_Int32 nInd = aString.getLength() - 1; nInd >= 0; nInd-- )
243
        for ( sal_Int32 nInd = aString.getLength() - 1; nInd >= 0; nInd-- )
244
        {
244
        {
Lines 287-293 Link Here
287
/*static*/ uno::Sequence< sal_Int8 > DocPasswordHelper::GenerateStd97Key( const ::rtl::OUString& aPassword, const uno::Sequence< sal_Int8 >& aDocId )
287
/*static*/ uno::Sequence< sal_Int8 > DocPasswordHelper::GenerateStd97Key( const ::rtl::OUString& aPassword, const uno::Sequence< sal_Int8 >& aDocId )
288
{
288
{
289
    uno::Sequence< sal_Int8 > aResultKey;
289
    uno::Sequence< sal_Int8 > aResultKey;
290
    if ( aPassword.getLength() && aDocId.getLength() == 16 )
290
    if ( !aPassword.isEmpty() && aDocId.getLength() == 16 )
291
    {
291
    {
292
        sal_uInt16 pPassData[16];
292
        sal_uInt16 pPassData[16];
293
        rtl_zeroMemory( pPassData, sizeof(pPassData) );
293
        rtl_zeroMemory( pPassData, sizeof(pPassData) );
Lines 377-384 Link Here
377
    {
377
    {
378
        for( ::std::vector< OUString >::const_iterator aIt = pDefaultPasswords->begin(), aEnd = pDefaultPasswords->end(); (eResult == DocPasswordVerifierResult_WRONG_PASSWORD) && (aIt != aEnd); ++aIt )
378
        for( ::std::vector< OUString >::const_iterator aIt = pDefaultPasswords->begin(), aEnd = pDefaultPasswords->end(); (eResult == DocPasswordVerifierResult_WRONG_PASSWORD) && (aIt != aEnd); ++aIt )
379
        {
379
        {
380
            OSL_ENSURE( aIt->getLength() > 0, "DocPasswordHelper::requestAndVerifyDocPassword - unexpected empty default password" );
380
            OSL_ENSURE( !aIt->isEmpty(), "DocPasswordHelper::requestAndVerifyDocPassword - unexpected empty default password" );
381
            if( aIt->getLength() > 0 )
381
            if( !aIt->isEmpty() )
382
            {
382
            {
383
                eResult = rVerifier.verifyPassword( *aIt, aEncData );
383
                eResult = rVerifier.verifyPassword( *aIt, aEncData );
384
                if( pbIsDefaultPassword )
384
                if( pbIsDefaultPassword )
Lines 401-407 Link Here
401
    // try media password (skip, if result is OK or ABORT)
401
    // try media password (skip, if result is OK or ABORT)
402
    if( eResult == DocPasswordVerifierResult_WRONG_PASSWORD )
402
    if( eResult == DocPasswordVerifierResult_WRONG_PASSWORD )
403
    {
403
    {
404
        if( rMediaPassword.getLength() > 0 )
404
        if( !rMediaPassword.isEmpty() )
405
            eResult = rVerifier.verifyPassword( rMediaPassword, aEncData );
405
            eResult = rVerifier.verifyPassword( rMediaPassword, aEncData );
406
    }
406
    }
407
407
Lines 416-422 Link Here
416
            rxInteractHandler->handle( xRequest );
416
            rxInteractHandler->handle( xRequest );
417
            if( pRequest->isPassword() )
417
            if( pRequest->isPassword() )
418
            {
418
            {
419
                if( pRequest->getPassword().getLength() > 0 )
419
                if( !pRequest->getPassword().isEmpty() )
420
                    eResult = rVerifier.verifyPassword( pRequest->getPassword(), aEncData );
420
                    eResult = rVerifier.verifyPassword( pRequest->getPassword(), aEncData );
421
            }
421
            }
422
            else
422
            else
(-)comphelper/source/misc/documentinfo.cxx (-9 / +9 lines)
Lines 95-106 Link Here
95
	    {
95
	    {
96
            // 1. ask the model and the controller for their XTitle::getTitle
96
            // 1. ask the model and the controller for their XTitle::getTitle
97
            sTitle = lcl_getTitle( _rxDocument );
97
            sTitle = lcl_getTitle( _rxDocument );
98
            if ( sTitle.getLength() )
98
            if ( !sTitle.isEmpty() )
99
                return sTitle;
99
                return sTitle;
100
100
101
            Reference< XController > xController( _rxDocument->getCurrentController() );
101
            Reference< XController > xController( _rxDocument->getCurrentController() );
102
            sTitle = lcl_getTitle( xController );
102
            sTitle = lcl_getTitle( xController );
103
            if ( sTitle.getLength() )
103
            if ( !sTitle.isEmpty() )
104
                return sTitle;
104
                return sTitle;
105
105
106
            // work around a problem with embedded objects, which sometimes return
106
            // work around a problem with embedded objects, which sometimes return
Lines 110-122 Link Here
110
                sDocURL = ::rtl::OUString();
110
                sDocURL = ::rtl::OUString();
111
111
112
            // 2. if the document is not saved, yet, check the frame title
112
            // 2. if the document is not saved, yet, check the frame title
113
            if ( sDocURL.getLength() == 0 )
113
            if ( sDocURL.isEmpty() )
114
            {
114
            {
115
                Reference< XFrame > xFrame;
115
                Reference< XFrame > xFrame;
116
                if ( xController.is() )
116
                if ( xController.is() )
117
                    xFrame.set( xController->getFrame() );
117
                    xFrame.set( xController->getFrame() );
118
                sTitle = lcl_getTitle( xFrame );
118
                sTitle = lcl_getTitle( xFrame );
119
                if ( sTitle.getLength() )
119
                if ( !sTitle.isEmpty() )
120
                    return sTitle;
120
                    return sTitle;
121
            }
121
            }
122
122
Lines 128-141 Link Here
128
                    xDPS->getDocumentProperties(), UNO_QUERY_THROW );
128
                    xDPS->getDocumentProperties(), UNO_QUERY_THROW );
129
                OSL_ENSURE(xDocProps.is(), "no DocumentProperties");
129
                OSL_ENSURE(xDocProps.is(), "no DocumentProperties");
130
                sTitle = xDocProps->getTitle();
130
                sTitle = xDocProps->getTitle();
131
                if ( sTitle.getLength() )
131
                if ( !sTitle.isEmpty() )
132
                    return sTitle;
132
                    return sTitle;
133
			}
133
			}
134
134
135
            // 4. try model arguments
135
            // 4. try model arguments
136
            NamedValueCollection aModelArgs( _rxDocument->getArgs() );
136
            NamedValueCollection aModelArgs( _rxDocument->getArgs() );
137
            sTitle = aModelArgs.getOrDefault( "Title", sTitle );
137
            sTitle = aModelArgs.getOrDefault( "Title", sTitle );
138
            if ( sTitle.getLength() )
138
            if ( !sTitle.isEmpty() )
139
                return sTitle;
139
                return sTitle;
140
140
141
            // 5. try the last segment of the document URL
141
            // 5. try the last segment of the document URL
Lines 143-149 Link Here
143
            // but since we moved this code to comphelper, we do not have access to an INetURLObject anymore
143
            // but since we moved this code to comphelper, we do not have access to an INetURLObject anymore
144
            // This heuristics here should be sufficient - finally, we will get an UNO title API in a not
144
            // This heuristics here should be sufficient - finally, we will get an UNO title API in a not
145
            // too distant future (hopefully), then  this complete class is superfluous)
145
            // too distant future (hopefully), then  this complete class is superfluous)
146
            if ( sDocURL.getLength() == 0 )
146
            if ( sDocURL.isEmpty() )
147
            {
147
            {
148
                Reference< XStorable > xDocStorable( _rxDocument, UNO_QUERY_THROW );
148
                Reference< XStorable > xDocStorable( _rxDocument, UNO_QUERY_THROW );
149
                sDocURL = xDocStorable->getLocation();
149
                sDocURL = xDocStorable->getLocation();
Lines 156-162 Link Here
156
            }
156
            }
157
            sTitle = sDocURL.copy( nLastSepPos + 1 );
157
            sTitle = sDocURL.copy( nLastSepPos + 1 );
158
158
159
			if ( sTitle.getLength() != 0 )
159
			if ( !sTitle.isEmpty() )
160
                return sTitle;
160
                return sTitle;
161
161
162
			// 5.
162
			// 5.
Lines 165-171 Link Here
165
		    Reference< XTitle > xTitle( _rxDocument, UNO_QUERY );
165
		    Reference< XTitle > xTitle( _rxDocument, UNO_QUERY );
166
			if ( xTitle.is() )
166
			if ( xTitle.is() )
167
			{
167
			{
168
				if ( xTitle->getTitle().getLength() != 0 )
168
				if ( !xTitle->getTitle().isEmpty() )
169
					return xTitle->getTitle();
169
					return xTitle->getTitle();
170
			}
170
			}
171
	    }
171
	    }
(-)comphelper/source/misc/regpathhelper.cxx (-4 / +4 lines)
Lines 103-109 Link Here
103
	
103
	
104
	if ( bIsPortalUser )
104
	if ( bIsPortalUser )
105
   	{
105
   	{
106
		if(  portalUserDir.getLength() )
106
		if( !portalUserDir.isEmpty() )
107
		{
107
		{
108
			FileBase::getFileURLFromSystemPath( portalUserDir , portalUserDir );
108
			FileBase::getFileURLFromSystemPath( portalUserDir , portalUserDir );
109
			userRegistryName = portalUserDir;
109
			userRegistryName = portalUserDir;
Lines 157-163 Link Here
157
	
157
	
158
	// search the environment STAR_USER_REGISTRY
158
	// search the environment STAR_USER_REGISTRY
159
	OString sBuffer( getenv(USER_REGISTRY_NAME_ENV) );
159
	OString sBuffer( getenv(USER_REGISTRY_NAME_ENV) );
160
	if ( sBuffer.getLength() > 0 )
160
	if ( !sBuffer.isEmpty() )
161
	{
161
	{
162
		f = fopen( sBuffer.getStr(), "r" );
162
		f = fopen( sBuffer.getStr(), "r" );
163
163
Lines 168-174 Link Here
168
		}
168
		}
169
	}
169
	}
170
170
171
	if ( !userRegistryName.getLength() )
171
	if ( userRegistryName.isEmpty() )
172
	{
172
	{
173
		userRegistryName = getDefaultLocalRegistry();
173
		userRegistryName = getDefaultLocalRegistry();
174
	}
174
	}
Lines 206-212 Link Here
206
	{
206
	{
207
		// search the environment STAR_REGISTRY
207
		// search the environment STAR_REGISTRY
208
		OString tmpStr( getenv(SYSTEM_REGISTRY_NAME_ENV) );
208
		OString tmpStr( getenv(SYSTEM_REGISTRY_NAME_ENV) );
209
		if ( tmpStr.getLength() > 0 )
209
		if ( !tmpStr.isEmpty() )
210
		{
210
		{
211
			f = fopen(tmpStr.getStr(), "r");
211
			f = fopen(tmpStr.getStr(), "r");
212
		
212
		
(-)comphelper/source/misc/storagehelper.cxx (-1 / +1 lines)
Lines 426-432 Link Here
426
    // TODO/LATER: Should not the method be part of DocPasswordHelper?
426
    // TODO/LATER: Should not the method be part of DocPasswordHelper?
427
    uno::Sequence< beans::NamedValue > aEncryptionData;
427
    uno::Sequence< beans::NamedValue > aEncryptionData;
428
    sal_Int32 nSha1Ind = 0;
428
    sal_Int32 nSha1Ind = 0;
429
    if ( aPassword.getLength() )
429
    if ( !aPassword.isEmpty() )
430
    {
430
    {
431
        // generate SHA256 start key
431
        // generate SHA256 start key
432
        try
432
        try
(-)comphelper/source/misc/string.cxx (-1 / +1 lines)
Lines 109-115 Link Here
109
      ::rtl::OUString kw =
109
      ::rtl::OUString kw =
110
        i_rString.getToken(0, static_cast<sal_Unicode> (','), idx);
110
        i_rString.getToken(0, static_cast<sal_Unicode> (','), idx);
111
      kw = kw.trim();
111
      kw = kw.trim();
112
      if (kw.getLength() > 0) {
112
      if ( !kw.isEmpty() ) {
113
          vec.push_back(kw);
113
          vec.push_back(kw);
114
      }
114
      }
115
    } while (idx >= 0);
115
    } while (idx >= 0);
(-)comphelper/source/misc/mimeconfighelper.cxx (-21 / +21 lines)
Lines 204-210 Link Here
204
    sal_Int32 nFlags = 0;
204
    sal_Int32 nFlags = 0;
205
    try
205
    try
206
    {
206
    {
207
        if ( aFilterName.getLength() )
207
        if ( !aFilterName.isEmpty() )
208
        {
208
        {
209
            uno::Reference< container::XNameAccess > xFilterFactory(
209
            uno::Reference< container::XNameAccess > xFilterFactory(
210
                GetFilterFactory(),
210
                GetFilterFactory(),
Lines 277-286 Link Here
277
                    {
277
                    {
278
                        ::rtl::OUString aFilterName;
278
                        ::rtl::OUString aFilterName;
279
                        if ( aType[nInd].Name.equalsAscii( "PreferredFilter" )
279
                        if ( aType[nInd].Name.equalsAscii( "PreferredFilter" )
280
                          && ( aType[nInd].Value >>= aFilterName ) && aFilterName.getLength() )
280
                          && ( aType[nInd].Value >>= aFilterName ) && !aFilterName.isEmpty() )
281
                        {
281
                        {
282
                            ::rtl::OUString aDocumentName = GetDocServiceNameFromFilter( aFilterName );
282
                            ::rtl::OUString aDocumentName = GetDocServiceNameFromFilter( aFilterName );
283
                            if ( aDocumentName.getLength() )
283
                            if ( !aDocumentName.isEmpty() )
284
                                return aDocumentName;
284
                                return aDocumentName;
285
                        }
285
                        }
286
                    }
286
                    }
Lines 442-448 Link Here
442
    }
442
    }
443
443
444
    ::rtl::OUString aStringClassID = GetStringClassIDRepresentation( aClassID );
444
    ::rtl::OUString aStringClassID = GetStringClassIDRepresentation( aClassID );
445
    if ( aStringClassID.getLength() )
445
    if ( !aStringClassID.isEmpty() )
446
    {
446
    {
447
        uno::Reference< container::XNameAccess > xObjConfig = GetObjConfiguration();
447
        uno::Reference< container::XNameAccess > xObjConfig = GetObjConfiguration();
448
        uno::Reference< container::XNameAccess > xObjectProps;
448
        uno::Reference< container::XNameAccess > xObjectProps;
Lines 468-474 Link Here
468
        return aObject;
468
        return aObject;
469
469
470
    ::rtl::OUString aDocumentName = GetDocServiceNameFromMediaType( aMediaType );
470
    ::rtl::OUString aDocumentName = GetDocServiceNameFromMediaType( aMediaType );
471
    if ( aDocumentName.getLength() )
471
    if ( !aDocumentName.isEmpty() )
472
        return GetObjectPropsByDocumentName( aDocumentName );
472
        return GetObjectPropsByDocumentName( aDocumentName );
473
473
474
    return uno::Sequence< beans::NamedValue >();
474
    return uno::Sequence< beans::NamedValue >();
Lines 478-484 Link Here
478
uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByFilter( const ::rtl::OUString& aFilterName )
478
uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByFilter( const ::rtl::OUString& aFilterName )
479
{
479
{
480
    ::rtl::OUString aDocumentName = GetDocServiceNameFromFilter( aFilterName );
480
    ::rtl::OUString aDocumentName = GetDocServiceNameFromFilter( aFilterName );
481
    if ( aDocumentName.getLength() )
481
    if ( !aDocumentName.isEmpty() )
482
        return GetObjectPropsByDocumentName( aDocumentName );
482
        return GetObjectPropsByDocumentName( aDocumentName );
483
483
484
    return uno::Sequence< beans::NamedValue >();
484
    return uno::Sequence< beans::NamedValue >();
Lines 487-493 Link Here
487
//-----------------------------------------------------------------------
487
//-----------------------------------------------------------------------
488
uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocumentName( const ::rtl::OUString& aDocName )
488
uno::Sequence< beans::NamedValue > MimeConfigurationHelper::GetObjectPropsByDocumentName( const ::rtl::OUString& aDocName )
489
{
489
{
490
    if ( aDocName.getLength() )
490
    if ( !aDocName.isEmpty() )
491
    {
491
    {
492
        uno::Reference< container::XNameAccess > xObjConfig = GetObjConfiguration();
492
        uno::Reference< container::XNameAccess > xObjConfig = GetObjConfiguration();
493
        if ( xObjConfig.is() )
493
        if ( xObjConfig.is() )
Lines 529-535 Link Here
529
{
529
{
530
    ::rtl::OUString aResult;
530
    ::rtl::OUString aResult;
531
531
532
    if ( aStringClassID.getLength() )
532
    if ( !aStringClassID.isEmpty() )
533
    {
533
    {
534
        uno::Reference< container::XNameAccess > xObjConfig = GetObjConfiguration();
534
        uno::Reference< container::XNameAccess > xObjConfig = GetObjConfiguration();
535
        uno::Reference< container::XNameAccess > xObjectProps;
535
        uno::Reference< container::XNameAccess > xObjectProps;
Lines 554-560 Link Here
554
{
554
{
555
    ::rtl::OUString aResult;
555
    ::rtl::OUString aResult;
556
556
557
    if ( aDocName.getLength() )
557
    if ( !aDocName.isEmpty() )
558
    {
558
    {
559
        uno::Reference< container::XNameAccess > xObjConfig = GetObjConfiguration();
559
        uno::Reference< container::XNameAccess > xObjConfig = GetObjConfiguration();
560
        if ( xObjConfig.is() )
560
        if ( xObjConfig.is() )
Lines 591-600 Link Here
591
{
591
{
592
    ::rtl::OUString aResult = GetFactoryNameByStringClassID( GetExplicitlyRegisteredObjClassID( aMediaType ) );
592
    ::rtl::OUString aResult = GetFactoryNameByStringClassID( GetExplicitlyRegisteredObjClassID( aMediaType ) );
593
593
594
    if ( !aResult.getLength() )
594
    if ( aResult.isEmpty() )
595
    {
595
    {
596
        ::rtl::OUString aDocumentName = GetDocServiceNameFromMediaType( aMediaType );
596
        ::rtl::OUString aDocumentName = GetDocServiceNameFromMediaType( aMediaType );
597
        if ( aDocumentName.getLength() )
597
        if ( !aDocumentName.isEmpty() )
598
            aResult = GetFactoryNameByDocumentName( aDocumentName );
598
            aResult = GetFactoryNameByDocumentName( aDocumentName );
599
    }
599
    }
600
600
Lines 612-618 Link Here
612
        if ( aMediaDescr[nInd].Name.equalsAscii( "FilterName" ) )
612
        if ( aMediaDescr[nInd].Name.equalsAscii( "FilterName" ) )
613
            aMediaDescr[nInd].Value >>= aFilterName;
613
            aMediaDescr[nInd].Value >>= aFilterName;
614
614
615
    if ( !aFilterName.getLength() )
615
    if ( aFilterName.isEmpty() )
616
    {
616
    {
617
        // filter name is not specified, so type detection should be done
617
        // filter name is not specified, so type detection should be done
618
618
Lines 634-640 Link Here
634
            if ( aTempMD[nInd].Name.equalsAscii( "FilterName" ) )
634
            if ( aTempMD[nInd].Name.equalsAscii( "FilterName" ) )
635
                aTempMD[nInd].Value >>= aFilterName;
635
                aTempMD[nInd].Value >>= aFilterName;
636
636
637
        if ( aFilterName.getLength() )
637
        if ( !aFilterName.isEmpty() )
638
        {
638
        {
639
            sal_Int32 nOldLen = aMediaDescr.getLength();
639
            sal_Int32 nOldLen = aMediaDescr.getLength();
640
            aMediaDescr.realloc( nOldLen + 1 );
640
            aMediaDescr.realloc( nOldLen + 1 );
Lines 642-648 Link Here
642
            aMediaDescr[ nOldLen ].Value <<= aFilterName;
642
            aMediaDescr[ nOldLen ].Value <<= aFilterName;
643
643
644
        }
644
        }
645
        else if ( aTypeName.getLength() && !bIgnoreType )
645
        else if ( !aTypeName.isEmpty() && !bIgnoreType )
646
        {
646
        {
647
            uno::Reference< container::XNameAccess > xNameAccess( xTypeDetection, uno::UNO_QUERY );
647
            uno::Reference< container::XNameAccess > xNameAccess( xTypeDetection, uno::UNO_QUERY );
648
            uno::Sequence< beans::PropertyValue > aTypes;
648
            uno::Sequence< beans::PropertyValue > aTypes;
Lines 679-685 Link Here
679
            break;
679
            break;
680
        }
680
        }
681
681
682
    OSL_ENSURE( aDocName.getLength(), "The name must exist at this point!\n" );
682
    OSL_ENSURE( !aDocName.isEmpty(), "The name must exist at this point!\n" );
683
683
684
684
685
    sal_Bool bNeedsAddition = sal_True;
685
    sal_Bool bNeedsAddition = sal_True;
Lines 708-714 Link Here
708
    sal_Bool bResult = sal_False;
708
    sal_Bool bResult = sal_False;
709
709
710
    ::rtl::OUString aFilterName = UpdateMediaDescriptorWithFilterName( aMediaDescr, sal_False );
710
    ::rtl::OUString aFilterName = UpdateMediaDescriptorWithFilterName( aMediaDescr, sal_False );
711
    if ( aFilterName.getLength() )
711
    if ( !aFilterName.isEmpty() )
712
    {
712
    {
713
        sal_Int32 nFlags = GetFilterFlags( aFilterName );
713
        sal_Int32 nFlags = GetFilterFlags( aFilterName );
714
        // check the OWN flag
714
        // check the OWN flag
Lines 723-729 Link Here
723
{
723
{
724
    rtl::OUString aResult;
724
    rtl::OUString aResult;
725
725
726
    if ( aServiceName.getLength() && nVersion )
726
    if ( !aServiceName.isEmpty() && nVersion )
727
        try
727
        try
728
        {
728
        {
729
            uno::Reference< container::XContainerQuery > xFilterQuery(
729
            uno::Reference< container::XContainerQuery > xFilterQuery(
Lines 757-763 Link Here
757
                        {
757
                        {
758
                            // if there are more than one filter the preffered one should be used
758
                            // if there are more than one filter the preffered one should be used
759
                            // if there is no preffered filter the first one will be used
759
                            // if there is no preffered filter the first one will be used
760
                            if ( !aResult.getLength() || ( nFlags & SFX_FILTER_PREFERED ) )
760
                            if ( aResult.isEmpty() || ( nFlags & SFX_FILTER_PREFERED ) )
761
                                aResult = aPropsHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Name" ),
761
                                aResult = aPropsHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Name" ),
762
                                                                                ::rtl::OUString() );
762
                                                                                ::rtl::OUString() );
763
                            if ( nFlags & SFX_FILTER_PREFERED )
763
                            if ( nFlags & SFX_FILTER_PREFERED )
Lines 779-785 Link Here
779
779
780
    try
780
    try
781
    {
781
    {
782
        if ( aImportFilterName.getLength() )
782
        if ( !aImportFilterName.isEmpty() )
783
        {
783
        {
784
            uno::Reference< container::XNameAccess > xFilterFactory(
784
            uno::Reference< container::XNameAccess > xFilterFactory(
785
                GetFilterFactory(),
785
                GetFilterFactory(),
Lines 808-815 Link Here
808
                    ::rtl::OUString aDocumentServiceName = aImpFilterHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "DocumentService" ), ::rtl::OUString() );
808
                    ::rtl::OUString aDocumentServiceName = aImpFilterHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "DocumentService" ), ::rtl::OUString() );
809
                    ::rtl::OUString aTypeName = aImpFilterHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Type" ), ::rtl::OUString() );
809
                    ::rtl::OUString aTypeName = aImpFilterHM.getUnpackedValueOrDefault( ::rtl::OUString::createFromAscii( "Type" ), ::rtl::OUString() );
810
810
811
                    OSL_ENSURE( aDocumentServiceName.getLength() && aTypeName.getLength(), "Incomplete filter data!" );
811
                    OSL_ENSURE( !aDocumentServiceName.isEmpty() && !aTypeName.isEmpty(), "Incomplete filter data!" );
812
                    if ( aDocumentServiceName.getLength() && aTypeName.getLength() )
812
                    if ( !aDocumentServiceName.isEmpty() && !aTypeName.isEmpty() )
813
                    {
813
                    {
814
                        uno::Sequence< beans::NamedValue > aSearchRequest( 2 );
814
                        uno::Sequence< beans::NamedValue > aSearchRequest( 2 );
815
                        aSearchRequest[0].Name = ::rtl::OUString::createFromAscii( "Type" );
815
                        aSearchRequest[0].Name = ::rtl::OUString::createFromAscii( "Type" );
(-)comphelper/source/misc/mediadescriptor.cxx (-2 / +2 lines)
Lines 596-602 Link Here
596
596
597
		// b) ... or we must get it from the given URL
597
		// b) ... or we must get it from the given URL
598
		::rtl::OUString sURL = getUnpackedValueOrDefault(MediaDescriptor::PROP_URL(), ::rtl::OUString());
598
		::rtl::OUString sURL = getUnpackedValueOrDefault(MediaDescriptor::PROP_URL(), ::rtl::OUString());
599
		if (!sURL.getLength())
599
		if ( sURL.isEmpty() )
600
			throw css::uno::Exception(
600
			throw css::uno::Exception(
601
					::rtl::OUString::createFromAscii("Found no URL."),
601
					::rtl::OUString::createFromAscii("Found no URL."),
602
					css::uno::Reference< css::uno::XInterface >());
602
					css::uno::Reference< css::uno::XInterface >());
Lines 645-651 Link Here
645
645
646
    // media type
646
    // media type
647
	::rtl::OUString sMediaType = getUnpackedValueOrDefault(MediaDescriptor::PROP_MEDIATYPE(), ::rtl::OUString());
647
	::rtl::OUString sMediaType = getUnpackedValueOrDefault(MediaDescriptor::PROP_MEDIATYPE(), ::rtl::OUString());
648
    if (!sMediaType.getLength())
648
    if ( sMediaType.isEmpty() )
649
    {
649
    {
650
        sMediaType = ::rtl::OUString::createFromAscii("application/x-www-form-urlencoded");
650
        sMediaType = ::rtl::OUString::createFromAscii("application/x-www-form-urlencoded");
651
        (*this)[MediaDescriptor::PROP_MEDIATYPE()] <<= sMediaType;
651
        (*this)[MediaDescriptor::PROP_MEDIATYPE()] <<= sMediaType;
(-)comphelper/source/misc/sequenceashashmap.cxx (-2 / +2 lines)
Lines 126-132 Link Here
126
        if (lSource[i] >>= lP)
126
        if (lSource[i] >>= lP)
127
        {
127
        {
128
            if (
128
            if (
129
                (!lP.Name.getLength()) ||
129
                (lP.Name.isEmpty()) ||
130
                (!lP.Value.hasValue())
130
                (!lP.Value.hasValue())
131
               )
131
               )
132
                throw css::beans::IllegalTypeException(
132
                throw css::beans::IllegalTypeException(
Lines 140-146 Link Here
140
        if (lSource[i] >>= lN)
140
        if (lSource[i] >>= lN)
141
        {
141
        {
142
            if (
142
            if (
143
                (!lN.Name.getLength()) ||
143
                (lN.Name.isEmpty()) ||
144
                (!lN.Value.hasValue())
144
                (!lN.Value.hasValue())
145
               )
145
               )
146
                throw css::beans::IllegalTypeException(
146
                throw css::beans::IllegalTypeException(
(-)comphelper/source/misc/locale.cxx (-3 / +3 lines)
Lines 472-483 Link Here
472
    ::rtl::OUStringBuffer sISO(64);
472
    ::rtl::OUStringBuffer sISO(64);
473
    
473
    
474
    sISO.append(m_sLanguage);
474
    sISO.append(m_sLanguage);
475
    if (m_sCountry.getLength())
475
    if ( !m_sCountry.isEmpty() )
476
    {
476
    {
477
        sISO.append(SEPERATOR_LC);
477
        sISO.append(SEPERATOR_LC);
478
        sISO.append(m_sCountry);
478
        sISO.append(m_sCountry);
479
479
480
        if (m_sVariant.getLength())
480
        if ( !m_sVariant.isEmpty() )
481
        {
481
        {
482
            sISO.append(SEPERATOR_CV);
482
            sISO.append(SEPERATOR_CV);
483
            sISO.append(m_sVariant);
483
            sISO.append(m_sVariant);
Lines 635-641 Link Here
635
635
636
    // d) remove country from incoming locale
636
    // d) remove country from incoming locale
637
    //    e.g. "de-DE" => "de" or "en-US" => "en"!
637
    //    e.g. "de-DE" => "de" or "en-US" => "en"!
638
    if (aLocale.getCountry().getLength())
638
    if ( !aLocale.getCountry().isEmpty())
639
    {
639
    {
640
        aLocale.setCountry(::rtl::OUString());
640
        aLocale.setCountry(::rtl::OUString());
641
        return sal_True;
641
        return sal_True;

Return to issue 123862