-rw-r--r-- | kaddressbook/xxport/csvimportdialog.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kaddressbook/xxport/csvimportdialog.cpp b/kaddressbook/xxport/csvimportdialog.cpp index 41e2612..4044fa8 100644 --- a/kaddressbook/xxport/csvimportdialog.cpp +++ b/kaddressbook/xxport/csvimportdialog.cpp @@ -337,49 +337,49 @@ KABC::AddresseeList CSVImportDialog::contacts() const case BusinessAddressLocality: addrWork.setLocality( value ); break; case BusinessAddressRegion: addrWork.setRegion( value ); break; case BusinessAddressPostalCode: addrWork.setPostalCode( value ); break; case BusinessAddressCountry: addrWork.setCountry( value ); break; case BusinessAddressLabel: addrWork.setLabel( value ); break; default: KABC::Field::List fields = mAddressBook->fields( KABC::Field::CustomCategory ); KABC::Field::List::Iterator it; int counter = 0; for ( it = fields.begin(); it != fields.end(); ++it ) { if ( counter == (int)( posToType( item->currentItem() ) - mCustomCounter ) ) { (*it)->setValue( a, value ); - continue; + break; } ++counter; } break; } } if ( !addrHome.isEmpty() ) a.insertAddress( addrHome ); if ( !addrWork.isEmpty() ) a.insertAddress( addrWork ); if ( !emptyRow && !a.isEmpty() ) contacts.append( a ); } return contacts; } void CSVImportDialog::initGUI() { QWidget* page = plainPage(); QGridLayout *layout = new QGridLayout( page, 1, 1, marginHintSmall(), @@ -520,49 +520,49 @@ void CSVImportDialog::fillTable() while ( !inputStream.atEnd() ) { inputStream >> x; // read one char if ( x == '\r' ) inputStream >> x; // eat '\r', to handle DOS/LOSEDOWS files correctly switch ( state ) { case S_START : if ( x == mTextQuote ) { state = S_QUOTED_FIELD; } else if ( x == mDelimiter ) { if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) ++column; lastCharDelimiter = true; } else if ( x == '\n' ) { ++row; column = 1; } else { field += x; state = S_MAYBE_NORMAL_FIELD; } break; case S_QUOTED_FIELD : if ( x == mTextQuote ) { state = S_MAYBE_END_OF_QUOTED_FIELD; - } else if ( x == '\n' ) { + } else if ( x == '\n' && mTextQuote.isNull() ) { setText( row - mStartLine + 1, column, field ); field = ""; if ( x == '\n' ) { ++row; column = 1; } else { if ( ( ignoreDups == false ) || ( lastCharDelimiter == false ) ) ++column; lastCharDelimiter = true; } state = S_START; } else { field += x; } break; case S_MAYBE_END_OF_QUOTED_FIELD : if ( x == mTextQuote ) { field += x; state = S_QUOTED_FIELD; } else if ( x == mDelimiter || x == '\n' ) { setText( row - mStartLine + 1, column, field ); field = ""; if ( x == '\n' ) { ++row; |