--- a/webengine/osswebengine/WebKit/s60/webview/WebTextFormatMask.cpp Tue Aug 31 16:17:46 2010 +0300
+++ b/webengine/osswebengine/WebKit/s60/webview/WebTextFormatMask.cpp Wed Sep 01 12:28:30 2010 +0100
@@ -22,9 +22,9 @@
#include "Frame.h"
#include "Editor.h"
-#include "string.h"
-#include "HTMLNames.h"
-#include "HTMLInputElement.h"
+#include "String.h"
+#include "HtmlNames.h"
+#include "HtmlInputElement.h"
#include "Text.h"
#include "CString.h"
@@ -61,7 +61,7 @@
void WebTextFormatMask::buildMaskList(const String& str)
{
// *M or *m
- if (str.isEmpty() || str=="*M" || str=="*m") {
+ if (str.isEmpty() || str=="*m") {
m_acceptAll = true;
return;
}
@@ -192,9 +192,15 @@
m_currentMask = m_currentMask->nextMask();
}
- // did we use up all the masks?
- if(m_currentMask && m_currentMask->multitude() != kInfinite)
- return false;
+ // this check doesn't seem to be proper as the check is done for
+ // the partial text.Because the checkText() is called for every character input by user,
+ // there are remaining masks after complete text length has been checked,
+ // that is valid case and it should not return false.
+ // If text length is bigger than mask length then that case is handled within for loop
+ //before this condition check. So it is redundant in current implementation
+ // did we use up all the masks?
+ /* if(m_currentMask && m_currentMask->multitude() != kInfinite)
+ return false;*/
return (eb.m_start == -1);
}
@@ -215,17 +221,22 @@
int WebTextFormatMask::getMultitude()
{
+ int length = 0;
int count = 0;
MaskBase* m = m_masks;
while (m) {
-
- if (m->multitude() == kInfinite){
- return kInfinite;
- }
- else {
- count += m->multitude();
- }
- m = m->nextMask();
+ length = m->multitude();
+ if (length == kInfinite){
+ return kInfinite;
+ }
+ else if(length > 1){
+ count += length;
+ break;
+ }
+ else{
+ count += length;
+ }
+ m = m->nextMask();
}
return (count)?count:kInfinite;
@@ -276,6 +287,11 @@
return true;
}
+bool WebTextFormatMask::acceptAll()
+ {
+ return m_acceptAll;
+ }
+
MaskComposite::MaskComposite(TInputFormatMaskType t, int mul)
: MaskSingle(t), m_offset(0), m_length(mul)
{