Revision: 6361
Author: nogu.dev
Date: Sun May 2 07:29:57 2010
Log: * qt4/immodule/qtextutil.cpp
- (QUimTextUtil::acquireSelectionTextInQTextEdit,
QUimTextUtil::deleteSelectionTextInQTextEdit):
Don't call Qt3 support member functions if possible.
* Replace QString::find() with QString::indexOf().
* Replace QString::findRev() with QString::lastIndexOf().
http://code.google.com/p/uim/source/detail?r=6361
Modified:
/trunk/qt4/immodule/qtextutil.cpp
=======================================
--- /trunk/qt4/immodule/qtextutil.cpp Sun May 2 07:29:50 2010
+++ /trunk/qt4/immodule/qtextutil.cpp Sun May 2 07:29:57 2010
@@ -529,7 +529,7 @@
return -1;
}
- if ( latter_req_len == UTextExtent_Line && ( ( newline =
text.find( '\n' ) ) != -1 ) )
+ if ( latter_req_len == UTextExtent_Line && ( ( newline =
text.indexOf( '\n' ) ) != -1 ) )
offset = len - newline;
}
*latter = strdup( text.left( len - offset ).toUtf8().data() );
@@ -545,7 +545,7 @@
return -1;
}
- if ( former_req_len == UTextExtent_Line && ( ( newline =
text.findRev( '\n' ) ) != -1 ) )
+ if ( former_req_len == UTextExtent_Line && ( ( newline =
text.lastIndexOf( '\n' ) ) != -1 ) )
offset = newline + 1;
}
*former = strdup( text.mid( offset, len - offset ).toUtf8().data()
);
@@ -956,7 +956,7 @@
if (! ( ~latter_req_len & ( ~UTextExtent_Line |
~UTextExtent_Full ) ) )
return -1;
- if ( latter_req_len == UTextExtent_Line && ( ( newline =
text.find('\n') ) != -1 ) ) {
+ if ( latter_req_len == UTextExtent_Line && ( ( newline =
text.indexOf('\n') ) != -1 ) ) {
end_para = sel_para_from;
end_index = sel_index_from + newline;
}
@@ -974,7 +974,7 @@
if (! ( ~former_req_len & ( ~UTextExtent_Line |
~UTextExtent_Full ) ) )
return -1;
- if ( former_req_len == UTextExtent_Line && ( ( newline =
text.findRev( '\n' ) ) != -1 ) ) {
+ if ( former_req_len == UTextExtent_Line && ( ( newline =
text.lastIndexOf( '\n' ) ) != -1 ) ) {
start_para = sel_para_to;
start_index = 0;
}