Fix inadvertent "TQ" changes.

pull/1/head
Darrell Anderson 12 years ago
parent 1b40827812
commit 80056d7ae2

@ -122,7 +122,7 @@ bool OOOHandler::Interface::connect(const std::string& host_, int port_, const s
} }
// Query for the XUnoUrlResolver interface // Query for the XUnoUrlResolver interface
Reference<bridge::XUnoUrlResolver> rResolver(rInstance, UNO_TQUERY); Reference<bridge::XUnoUrlResolver> rResolver(rInstance, UNO_QUERY);
if(!rResolver.is()) { if(!rResolver.is()) {
DEBUG("Error: Couldn't instantiate com.sun.star.bridge.UnoUrlResolver service"); DEBUG("Error: Couldn't instantiate com.sun.star.bridge.UnoUrlResolver service");
return false; return false;
@ -145,7 +145,7 @@ bool OOOHandler::Interface::connect(const std::string& host_, int port_, const s
return false; return false;
} }
m_gsmgr = Reference<lang::XMultiServiceFactory>(rInstance, UNO_TQUERY); m_gsmgr = Reference<lang::XMultiServiceFactory>(rInstance, UNO_QUERY);
if(m_gsmgr.is()) { if(m_gsmgr.is()) {
DEBUG("Connected successfully to office"); DEBUG("Connected successfully to office");
} else { } else {
@ -180,16 +180,16 @@ bool OOOHandler::Interface::createDocument() {
// get the desktop service using createInstance, returns an XInterface type // get the desktop service using createInstance, returns an XInterface type
Reference<uno::XInterface> xInstance = m_gsmgr->createInstance(OUString::createFromAscii("com.sun.star.frame.Desktop")); Reference<uno::XInterface> xInstance = m_gsmgr->createInstance(OUString::createFromAscii("com.sun.star.frame.Desktop"));
Reference<frame::XDesktop> desktop(xInstance, UNO_TQUERY); Reference<frame::XDesktop> desktop(xInstance, UNO_QUERY);
Reference<lang::XComponent> writer = desktop->getCurrentComponent(); Reference<lang::XComponent> writer = desktop->getCurrentComponent();
Reference<lang::XServiceInfo> info(writer, UNO_TQUERY); Reference<lang::XServiceInfo> info(writer, UNO_QUERY);
if(info.is() && info->getImplementationName() == OUString::createFromAscii("SwXTextDocument")) { if(info.is() && info->getImplementationName() == OUString::createFromAscii("SwXTextDocument")) {
DEBUG("Document already open"); DEBUG("Document already open");
} else { } else {
DEBUG("Opening a new document"); DEBUG("Opening a new document");
//query for the XComponentLoader interface //query for the XComponentLoader interface
Reference<frame::XComponentLoader> rComponentLoader(desktop, UNO_TQUERY); Reference<frame::XComponentLoader> rComponentLoader(desktop, UNO_QUERY);
if(!rComponentLoader.is()){ if(!rComponentLoader.is()){
DEBUG("XComponentloader failed to instantiate"); DEBUG("XComponentloader failed to instantiate");
return 0; return 0;
@ -203,16 +203,16 @@ bool OOOHandler::Interface::createDocument() {
} }
//Manage many events with EventListener //Manage many events with EventListener
Reference<document::XEventBroadcaster> eventBroadcast(writer, UNO_TQUERY); Reference<document::XEventBroadcaster> eventBroadcast(writer, UNO_QUERY);
m_listener = new EventListener(this); m_listener = new EventListener(this);
Reference<document::XEventListener> xEventListener = static_cast<document::XEventListener*>(m_listener); Reference<document::XEventListener> xEventListener = static_cast<document::XEventListener*>(m_listener);
eventBroadcast->addEventListener(xEventListener); eventBroadcast->addEventListener(xEventListener);
Reference<frame::XController> controller = Reference<frame::XModel>(writer, UNO_TQUERY)->getCurrentController(); Reference<frame::XController> controller = Reference<frame::XModel>(writer, UNO_QUERY)->getCurrentController();
m_cursor = Reference<text::XTextViewCursorSupplier>(controller, UNO_TQUERY)->getViewCursor(); m_cursor = Reference<text::XTextViewCursorSupplier>(controller, UNO_QUERY)->getViewCursor();
m_doc = Reference<text::XTextDocument>(writer, UNO_TQUERY); m_doc = Reference<text::XTextDocument>(writer, UNO_QUERY);
if(m_doc.is()) { if(m_doc.is()) {
m_dsmgr = Reference<lang::XMultiServiceFactory>(m_doc, UNO_TQUERY); m_dsmgr = Reference<lang::XMultiServiceFactory>(m_doc, UNO_QUERY);
} }
return m_doc.is(); return m_doc.is();
} }
@ -231,12 +231,12 @@ bool OOOHandler::Interface::updateBibliography() {
} }
void OOOHandler::Interface::createBibliography() { void OOOHandler::Interface::createBibliography() {
Reference<container::XIndexAccess> indexes(Reference<text::XDocumentIndexesSupplier>(m_doc, UNO_TQUERY)->getDocumentIndexes(), UNO_TQUERY); Reference<container::XIndexAccess> indexes(Reference<text::XDocumentIndexesSupplier>(m_doc, UNO_QUERY)->getDocumentIndexes(), UNO_QUERY);
for(int i = 0; i < indexes->getCount(); ++i) { for(int i = 0; i < indexes->getCount(); ++i) {
Reference<lang::XServiceInfo> info(indexes->getByIndex(i), UNO_TQUERY); Reference<lang::XServiceInfo> info(indexes->getByIndex(i), UNO_QUERY);
if(info->supportsService(OUSTR("com.sun.star.text.Bibliography"))) { if(info->supportsService(OUSTR("com.sun.star.text.Bibliography"))) {
DEBUG("Found existing bibliography..."); DEBUG("Found existing bibliography...");
m_bib = Reference<text::XDocumentIndex>(indexes->getByIndex(i), UNO_TQUERY); m_bib = Reference<text::XDocumentIndex>(indexes->getByIndex(i), UNO_QUERY);
break; break;
} }
} }
@ -244,18 +244,18 @@ void OOOHandler::Interface::createBibliography() {
if(!m_bib.is()) { if(!m_bib.is()) {
DEBUG("Creating new bibliography..."); DEBUG("Creating new bibliography...");
Reference<text::XText> text = m_doc->getText(); Reference<text::XText> text = m_doc->getText();
Reference<text::XTextRange> textRange(text->createTextCursor(), UNO_TQUERY); Reference<text::XTextRange> textRange(text->createTextCursor(), UNO_QUERY);
Reference<text::XTextCursor> cursor(textRange, UNO_TQUERY); Reference<text::XTextCursor> cursor(textRange, UNO_QUERY);
cursor->gotoEnd(false); cursor->gotoEnd(false);
text->insertControlCharacter(textRange, text::ControlCharacter::PARAGRAPH_BREAK, false); text->insertControlCharacter(textRange, text::ControlCharacter::PARAGRAPH_BREAK, false);
m_bib = Reference<text::XDocumentIndex>(m_dsmgr->createInstance(OUSTR("com.sun.star.text.Bibliography")), UNO_TQUERY); m_bib = Reference<text::XDocumentIndex>(m_dsmgr->createInstance(OUSTR("com.sun.star.text.Bibliography")), UNO_QUERY);
Reference<text::XTextContent> textContent(m_bib, UNO_TQUERY); Reference<text::XTextContent> textContent(m_bib, UNO_QUERY);
text->insertTextContent(textRange, textContent, false); text->insertTextContent(textRange, textContent, false);
} }
} }
bool OOOHandler::Interface::insertCitations(Cite::Map& fields) { bool OOOHandler::Interface::insertCitations(Cite::Map& fields) {
Reference<text::XTextField> entry(m_dsmgr->createInstance(OUString::createFromAscii("com.sun.star.text.TextField.Bibliography")), UNO_TQUERY); Reference<text::XTextField> entry(m_dsmgr->createInstance(OUString::createFromAscii("com.sun.star.text.TextField.Bibliography")), UNO_QUERY);
if(!entry.is()) { if(!entry.is()) {
DEBUG("Interface::insertCitation - can't create TextField"); DEBUG("Interface::insertCitation - can't create TextField");
return false; return false;
@ -266,12 +266,12 @@ bool OOOHandler::Interface::insertCitations(Cite::Map& fields) {
values[i] = propValue(it->first, it->second); values[i] = propValue(it->first, it->second);
std::cout << "Setting " << OU2O(values[i].Name) << " = " << it->second << std::endl; std::cout << "Setting " << OU2O(values[i].Name) << " = " << it->second << std::endl;
} }
Reference<beans::XPropertySet>(entry, UNO_TQUERY)->setPropertyValue(OUSTR("Fields"), Any(values)); Reference<beans::XPropertySet>(entry, UNO_QUERY)->setPropertyValue(OUSTR("Fields"), Any(values));
Reference<text::XText> text = m_doc->getText(); Reference<text::XText> text = m_doc->getText();
Reference<text::XTextCursor> cursor = text->createTextCursorByRange(Reference<text::XTextRange>(m_cursor, UNO_TQUERY)); Reference<text::XTextCursor> cursor = text->createTextCursorByRange(Reference<text::XTextRange>(m_cursor, UNO_QUERY));
Reference<text::XTextRange> textRange(cursor, UNO_TQUERY); Reference<text::XTextRange> textRange(cursor, UNO_QUERY);
Reference<text::XTextContent> textContent(entry, UNO_TQUERY); Reference<text::XTextContent> textContent(entry, UNO_QUERY);
text->insertTextContent(textRange, textContent, false); text->insertTextContent(textRange, textContent, false);
return true; return true;
} }
@ -336,13 +336,13 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
return false; return false;
} }
Reference<sdbc::XRowSet> rowSet(interface, UNO_TQUERY); Reference<sdbc::XRowSet> rowSet(interface, UNO_QUERY);
if(!rowSet.is()) { if(!rowSet.is()) {
DEBUG("Could not create rowset interface"); DEBUG("Could not create rowset interface");
return false; return false;
} }
Reference<beans::XPropertySet> props(rowSet, UNO_TQUERY); Reference<beans::XPropertySet> props(rowSet, UNO_QUERY);
props->setPropertyValue(OUSTR("DataSourceName"), Any(OUSTR("Bibliography"))); props->setPropertyValue(OUSTR("DataSourceName"), Any(OUSTR("Bibliography")));
props->setPropertyValue(OUSTR("CommandType"), Any(sdb::CommandType::COMMAND)); props->setPropertyValue(OUSTR("CommandType"), Any(sdb::CommandType::COMMAND));
OUString s = OUSTR("SELECT COUNT(*) FROM \"biblio\" WHERE identifier='") + O2OU(fields["Identifier"]) + OUSTR("'"); OUString s = OUSTR("SELECT COUNT(*) FROM \"biblio\" WHERE identifier='") + O2OU(fields["Identifier"]) + OUSTR("'");
@ -360,7 +360,7 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
return false; return false;
} }
Reference<sdbc::XRow> row(rowSet, UNO_TQUERY); Reference<sdbc::XRow> row(rowSet, UNO_QUERY);
int count = 0; int count = 0;
if(rowSet->next()) { if(rowSet->next()) {
count = row->getString(1).toInt32(); count = row->getString(1).toInt32();
@ -390,12 +390,12 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
return false; return false;
} }
Reference<sdbc::XResultSet> resultSet(rowSet, UNO_TQUERY); Reference<sdbc::XResultSet> resultSet(rowSet, UNO_QUERY);
Reference<sdbc::XResultSetMetaDataSupplier> mdSupplier(resultSet, UNO_TQUERY); Reference<sdbc::XResultSetMetaDataSupplier> mdSupplier(resultSet, UNO_QUERY);
Reference<sdbc::XResultSetMetaData> metaData = mdSupplier->getMetaData(); Reference<sdbc::XResultSetMetaData> metaData = mdSupplier->getMetaData();
Reference<sdbc::XRowUpdate> rowUpdate(rowSet, UNO_TQUERY); Reference<sdbc::XRowUpdate> rowUpdate(rowSet, UNO_QUERY);
Reference<sdbc::XResultSetUpdate> update(rowSet, UNO_TQUERY); Reference<sdbc::XResultSetUpdate> update(rowSet, UNO_QUERY);
if(count > 0) { if(count > 0) {
resultSet->last(); resultSet->last();
} else { } else {
@ -425,6 +425,6 @@ bool OOOHandler::Interface::insertRecords(Cite::Map& fields) {
update->insertRow(); update->insertRow();
} }
Reference<lang::XComponent>(rowSet, UNO_TQUERY)->dispose(); Reference<lang::XComponent>(rowSet, UNO_QUERY)->dispose();
return true; return true;
} }

@ -88,11 +88,11 @@ TQChar Iso6937Converter::getChar(uchar c) {
case 0xA8: case 0xA8:
return 0x00A4; // 10/08 CURRENCY SIGN return 0x00A4; // 10/08 CURRENCY SIGN
case 0xA9: case 0xA9:
return 0x2018; // 10/09 LEFT SINGLE TQUOTATION MARK return 0x2018; // 10/09 LEFT SINGLE QUOTATION MARK
case 0xAA: case 0xAA:
return 0x201C; // 10/10 LEFT DOUBLE TQUOTATION MARK return 0x201C; // 10/10 LEFT DOUBLE QUOTATION MARK
case 0xAB: case 0xAB:
return 0x00AB; // 10/11 LEFT-POINTING DOUBLE ANGLE TQUOTATION MARK return 0x00AB; // 10/11 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
case 0xAC: case 0xAC:
return 0x2190; // 10/12 LEFTWARDS ARROW return 0x2190; // 10/12 LEFTWARDS ARROW
case 0xAD: case 0xAD:
@ -121,17 +121,17 @@ TQChar Iso6937Converter::getChar(uchar c) {
case 0xB8: case 0xB8:
return 0x00F7; // 11/08 DIVISION SIGN return 0x00F7; // 11/08 DIVISION SIGN
case 0xB9: case 0xB9:
return 0x2019; // 11/09 RIGHT SINGLE TQUOTATION MARK return 0x2019; // 11/09 RIGHT SINGLE QUOTATION MARK
case 0xBA: case 0xBA:
return 0x201D; // 11/10 RIGHT DOUBLE TQUOTATION MARK return 0x201D; // 11/10 RIGHT DOUBLE QUOTATION MARK
case 0xBB: case 0xBB:
return 0x00BB; // 11/11 RIGHT-POINTING DOUBLE ANGLE TQUOTATION MARK return 0x00BB; // 11/11 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
case 0xBC: case 0xBC:
return 0x00BC; // 11/12 VULGAR FRACTION ONE TQUARTER return 0x00BC; // 11/12 VULGAR FRACTION ONE QUARTER
case 0xBD: case 0xBD:
return 0x00BD; // 11/13 VULGAR FRACTION ONE HALF return 0x00BD; // 11/13 VULGAR FRACTION ONE HALF
case 0xBE: case 0xBE:
return 0x00BE; // 11/14 VULGAR FRACTION THREE TQUARTERS return 0x00BE; // 11/14 VULGAR FRACTION THREE QUARTERS
case 0xBF: case 0xBF:
return 0x00BF; // 11/15 INVERTED QUESTION MARK return 0x00BF; // 11/15 INVERTED QUESTION MARK

@ -1039,7 +1039,7 @@ void MainWindow::readOptions() {
if(useBraces) { if(useBraces) {
BibtexHandler::s_quoteStyle = BibtexHandler::BRACES; BibtexHandler::s_quoteStyle = BibtexHandler::BRACES;
} else { } else {
BibtexHandler::s_quoteStyle = BibtexHandler::TQUOTES; BibtexHandler::s_quoteStyle = BibtexHandler::QUOTES;
} }
// Don't read any options for the edit dialog here, since it's not yet initialized. // Don't read any options for the edit dialog here, since it's not yet initialized.

@ -244,7 +244,7 @@ void BibtexExporter::readOptions(KConfig* config_) {
if(group.readBoolEntry("Use Braces", true)) { if(group.readBoolEntry("Use Braces", true)) {
BibtexHandler::s_quoteStyle = BibtexHandler::BRACES; BibtexHandler::s_quoteStyle = BibtexHandler::BRACES;
} else { } else {
BibtexHandler::s_quoteStyle = BibtexHandler::TQUOTES; BibtexHandler::s_quoteStyle = BibtexHandler::QUOTES;
} }
} }
@ -262,7 +262,7 @@ void BibtexExporter::saveOptions(KConfig* config_) {
if(useBraces) { if(useBraces) {
BibtexHandler::s_quoteStyle = BibtexHandler::BRACES; BibtexHandler::s_quoteStyle = BibtexHandler::BRACES;
} else { } else {
BibtexHandler::s_quoteStyle = BibtexHandler::TQUOTES; BibtexHandler::s_quoteStyle = BibtexHandler::QUOTES;
} }
} }

@ -182,7 +182,7 @@ TQString BibtexHandler::exportText(const TQString& text_, const TQStringList& ma
lquote = '{'; lquote = '{';
rquote = '}'; rquote = '}';
break; break;
case TQUOTES: case QUOTES:
lquote = '"'; lquote = '"';
rquote = '"'; rquote = '"';
break; break;

@ -29,7 +29,7 @@ namespace Tellico {
*/ */
class BibtexHandler { class BibtexHandler {
public: public:
enum QuoteStyle { BRACES=0, TQUOTES=1 }; enum QuoteStyle { BRACES=0, QUOTES=1 };
static TQStringList bibtexKeys(const Data::EntryVec& entries); static TQStringList bibtexKeys(const Data::EntryVec& entries);
static TQString bibtexKey(Data::ConstEntryPtr entry); static TQString bibtexKey(Data::ConstEntryPtr entry);
static TQString importText(char* text); static TQString importText(char* text);

@ -55,9 +55,9 @@ typedef struct _ast {
#else #else
#ifdef zzAST_DOUBLE #ifdef zzAST_DOUBLE
#define AST_RETQUIRED_FIELDS struct _ast *right, *down, *left, *up; #define AST_REQUIRED_FIELDS struct _ast *right, *down, *left, *up;
#else #else
#define AST_RETQUIRED_FIELDS struct _ast *right, *down; #define AST_REQUIRED_FIELDS struct _ast *right, *down;
#endif #endif
#endif #endif

@ -226,7 +226,7 @@ field(AST**_root)
zzastArg(1)->nodetype = BTAST_FIELD; check_field_name (zzastArg(1)); zzastArg(1)->nodetype = BTAST_FIELD; check_field_name (zzastArg(1));
zzCONSUME; zzCONSUME;
zzmatch(ETQUALS); zzCONSUME; zzmatch(EQUALS); zzCONSUME;
value(zzSTR); zzlink(_root, &_sibling, &_tail); value(zzSTR); zzlink(_root, &_sibling, &_tail);
#if DEBUG > 1 #if DEBUG > 1

@ -47,7 +47,7 @@ const ANTLRChar *zztokens[27]={
/* 12 */ "RBRACE", /* 12 */ "RBRACE",
/* 13 */ "ENTRY_OPEN", /* 13 */ "ENTRY_OPEN",
/* 14 */ "ENTRY_CLOSE", /* 14 */ "ENTRY_CLOSE",
/* 15 */ "ETQUALS", /* 15 */ "EQUALS",
/* 16 */ "HASH", /* 16 */ "HASH",
/* 17 */ "COMMA", /* 17 */ "COMMA",
/* 18 */ "\"", /* 18 */ "\"",

@ -54,7 +54,7 @@ static struct
{ RBRACE, "right brace (\"}\")" }, { RBRACE, "right brace (\"}\")" },
{ ENTRY_OPEN, "start of entry (\"{\" or \"(\")" }, { ENTRY_OPEN, "start of entry (\"{\" or \"(\")" },
{ ENTRY_CLOSE,"end of entry (\"}\" or \")\")" }, { ENTRY_CLOSE,"end of entry (\"}\" or \")\")" },
{ ETQUALS, "\"=\"" }, { EQUALS, "\"=\"" },
{ HASH, "\"#\"" }, { HASH, "\"#\"" },
{ COMMA, "\",\"" }, { COMMA, "\",\"" },
{ NUMBER, "number" }, { NUMBER, "number" },

@ -188,7 +188,7 @@ static void act16()
static void act17() static void act17()
{ {
NLA = ETQUALS; NLA = EQUALS;
} }

@ -17,7 +17,7 @@
#define RBRACE 12 #define RBRACE 12
#define ENTRY_OPEN 13 #define ENTRY_OPEN 13
#define ENTRY_CLOSE 14 #define ENTRY_CLOSE 14
#define ETQUALS 15 #define EQUALS 15
#define HASH 16 #define HASH 16
#define COMMA 17 #define COMMA 17
#define STRING 25 #define STRING 25

@ -114,7 +114,7 @@ csv_init(struct csv_parser **p, unsigned char options)
(*p)->entry_size = MEM_BLK_SIZE; (*p)->entry_size = MEM_BLK_SIZE;
(*p)->status = 0; (*p)->status = 0;
(*p)->options = options; (*p)->options = options;
(*p)->quote_char = CSV_TQUOTE; (*p)->quote_char = CSV_QUOTE;
(*p)->delim_char = CSV_COMMA; (*p)->delim_char = CSV_COMMA;
(*p)->is_space = NULL; (*p)->is_space = NULL;
(*p)->is_term = NULL; (*p)->is_term = NULL;

@ -46,7 +46,7 @@ Copyright (C) 2007 Robert Gamble
#define CSV_CR 0x0d #define CSV_CR 0x0d
#define CSV_LF 0x0a #define CSV_LF 0x0a
#define CSV_COMMA 0x2c #define CSV_COMMA 0x2c
#define CSV_TQUOTE 0x22 #define CSV_QUOTE 0x22
struct csv_parser { struct csv_parser {
int pstate; /* Parser state */ int pstate; /* Parser state */

@ -167,7 +167,7 @@ std::string StrOps::strip_front(const std::string& str,const std::string& what)
StrOps::string_list_t StrOps::csv_to_array(const std::string& str, char delim, bool quoted_string) StrOps::string_list_t StrOps::csv_to_array(const std::string& str, char delim, bool quoted_string)
{ {
enum { STATE_NORMAL, STATE_TQUOTES } state; enum { STATE_NORMAL, STATE_QUOTES } state;
StrOps::string_list_t result; StrOps::string_list_t result;
std::string elem; std::string elem;
@ -176,7 +176,7 @@ StrOps::string_list_t StrOps::csv_to_array(const std::string& str, char delim, b
switch (state) { switch (state) {
case STATE_NORMAL: case STATE_NORMAL:
if (quoted_string && *p == '"') { if (quoted_string && *p == '"') {
state = STATE_TQUOTES; state = STATE_QUOTES;
} else if (*p == delim) { } else if (*p == delim) {
result.push_back(elem); result.push_back(elem);
elem = ""; elem = "";
@ -185,7 +185,7 @@ StrOps::string_list_t StrOps::csv_to_array(const std::string& str, char delim, b
} }
break; break;
case STATE_TQUOTES: case STATE_QUOTES:
if (quoted_string && *p == '"') { if (quoted_string && *p == '"') {
if ((p + 1) != str.end() && *(p+1) == '"') { if ((p + 1) != str.end() && *(p+1) == '"') {
++p; ++p;
@ -204,7 +204,7 @@ StrOps::string_list_t StrOps::csv_to_array(const std::string& str, char delim, b
case STATE_NORMAL: case STATE_NORMAL:
result.push_back(elem); result.push_back(elem);
break; break;
case STATE_TQUOTES: case STATE_QUOTES:
kdDebug() << "unterminated quotes" << endl; kdDebug() << "unterminated quotes" << endl;
break; break;
} }
@ -216,8 +216,8 @@ StrOps::string_list_t
StrOps::str_to_array(const std::string& str, const std::string& delim, StrOps::str_to_array(const std::string& str, const std::string& delim,
bool multiple_delim, bool handle_comments) bool multiple_delim, bool handle_comments)
{ {
enum { STATE_NORMAL, STATE_COMMENT, STATE_TQUOTE_DOUBLE, STATE_TQUOTE_SINGLE, enum { STATE_NORMAL, STATE_COMMENT, STATE_QUOTE_DOUBLE, STATE_QUOTE_SINGLE,
STATE_BACKSLASH, STATE_BACKSLASH_DOUBLETQUOTE } state; STATE_BACKSLASH, STATE_BACKSLASH_DOUBLEQUOTE } state;
StrOps::string_list_t result; StrOps::string_list_t result;
std::string elem; std::string elem;
@ -226,9 +226,9 @@ StrOps::str_to_array(const std::string& str, const std::string& delim,
switch (state) { switch (state) {
case STATE_NORMAL: case STATE_NORMAL:
if (*p == '"') { if (*p == '"') {
state = STATE_TQUOTE_DOUBLE; state = STATE_QUOTE_DOUBLE;
} else if (*p == '\'') { } else if (*p == '\'') {
state = STATE_TQUOTE_SINGLE; state = STATE_QUOTE_SINGLE;
} else if (std::find(delim.begin(), delim.end(), *p) != delim.end()) { } else if (std::find(delim.begin(), delim.end(), *p) != delim.end()) {
if (multiple_delim) { if (multiple_delim) {
++p; ++p;
@ -252,16 +252,16 @@ StrOps::str_to_array(const std::string& str, const std::string& delim,
case STATE_COMMENT: case STATE_COMMENT:
break; break;
case STATE_TQUOTE_DOUBLE: case STATE_QUOTE_DOUBLE:
if (*p == '"') if (*p == '"')
state = STATE_NORMAL; state = STATE_NORMAL;
else if (*p == '\\') else if (*p == '\\')
state = STATE_BACKSLASH_DOUBLETQUOTE; state = STATE_BACKSLASH_DOUBLEQUOTE;
else else
elem += *p; elem += *p;
break; break;
case STATE_TQUOTE_SINGLE: case STATE_QUOTE_SINGLE:
if (*p == '\'') if (*p == '\'')
state = STATE_NORMAL; state = STATE_NORMAL;
else else
@ -273,7 +273,7 @@ StrOps::str_to_array(const std::string& str, const std::string& delim,
state = STATE_NORMAL; state = STATE_NORMAL;
break; break;
case STATE_BACKSLASH_DOUBLETQUOTE: case STATE_BACKSLASH_DOUBLEQUOTE:
switch (*p) { switch (*p) {
case '\\': case '\\':
elem += '\\'; elem += '\\';
@ -329,7 +329,7 @@ StrOps::str_to_array(const std::string& str, const std::string& delim,
} }
// Escape is done. Go back to the normal double quote state. // Escape is done. Go back to the normal double quote state.
state = STATE_TQUOTE_DOUBLE; state = STATE_QUOTE_DOUBLE;
break; break;
} }
} }
@ -339,16 +339,16 @@ StrOps::str_to_array(const std::string& str, const std::string& delim,
result.push_back(elem); result.push_back(elem);
break; break;
case STATE_TQUOTE_DOUBLE: case STATE_QUOTE_DOUBLE:
kdDebug() << "unterminated double quotes" << endl; kdDebug() << "unterminated double quotes" << endl;
break; break;
case STATE_TQUOTE_SINGLE: case STATE_QUOTE_SINGLE:
kdDebug() << "unterminated single quotes" << endl; kdDebug() << "unterminated single quotes" << endl;
break; break;
case STATE_BACKSLASH: case STATE_BACKSLASH:
case STATE_BACKSLASH_DOUBLETQUOTE: case STATE_BACKSLASH_DOUBLEQUOTE:
kdDebug() << "an escape character must follow a backslash" << endl; kdDebug() << "an escape character must follow a backslash" << endl;
break; break;

Loading…
Cancel
Save