GetHistoryCountWithTimeRange(todayStart, todayEnd, todaysCount);
GetHistoryWithTimeRange(todayStart, todayEnd, 0, todaysCount, *pTodaysList);
- for(int count = 0; count < todaysCount; count++)
+ for (int count = 0; count < todaysCount; count++)
{
History *pHistoryItem = dynamic_cast<History*>(pTodaysList->GetAt(count));
- //AppLog("HistoryPresentationModel::saveHistory pHistoryItem id is %ls",pHistoryItem->GetHistoryId().GetPointer());
- AppLog("SaveHistory pHistoryItem url is %ls",pHistoryItem->GetHistoryUrl().GetPointer());
- AppLog("SaveHistory history url is %ls",history.GetHistoryUrl().GetPointer());
- if(pHistoryItem != null && pHistoryItem->GetHistoryUrl().CompareTo(history.GetHistoryUrl()) == 0)
+ if (pHistoryItem != null && pHistoryItem->GetHistoryUrl().CompareTo(history.GetHistoryUrl()) == 0)
{
+ AppLog("SaveHistory pHistoryItem url is %ls",pHistoryItem->GetHistoryUrl().GetPointer());
+ AppLog("SaveHistory history url is %ls",history.GetHistoryUrl().GetPointer());
history.SetHistoryId(pHistoryItem->GetHistoryId());
AppLog("HistoryPresentationModel::saveHistory pHistoryItem history is %ls",pHistoryItem->GetHistoryId().GetPointer());
break;
Tizen::Base::ByteBuffer* pFavBuffer = pImage->EncodeToBufferN(favIconImage, IMG_FORMAT_PNG);
// added because conversion may fail
- if(GetLastResult() != E_SUCCESS)
+ if (GetLastResult() != E_SUCCESS)
+ {
+ delete pImage;
return;
+ }
delete pFavBuffer;
history.SetFavIconBitmap(favIconImage);
for (int counter = 0 ; counter < count; counter++)
{
History *pHistory = dynamic_cast<History*>(__pDataList->GetAt(counter));
- AppLog("vinayhistorytimecomparison %d, %d",pHistory->GetVisitedTime().CompareTo(startTime),pHistory->GetVisitedTime().CompareTo(endTime));
+
if(pHistory != null && pHistory->GetVisitedTime().CompareTo(startTime) > 0 && pHistory->GetVisitedTime().CompareTo(endTime) < 0)
{
historyCount++;
str.Append(nameElement);
str.Append("').length");
String* pCount = __pWebViewer->EvaluateJavascriptN(str);
- AppLog("pCount %ls",pCount->GetPointer());
-
String script;
if(idElement.GetLength() != 0)
script.Append(*pString);
script.Append("\");");
}
-
-
else if (nameElement.GetLength() != 0 && pCount->Equals("1",false) == true)
{
script = L"function insertAtCursor(myField, myValue) { if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = myValue; } else if (myField.selectionStart || myField.selectionStart == '0'){ var startPos = myField.selectionStart; var endPos = myField.selectionEnd; myField.value = myField.value.substring(0, startPos)+ myValue + myField.value.substring(endPos, myField.value.length); } else { myField.value += myValue; } } ";
AppLog("MainForm::OnTouchLongPressed script is %ls",script.GetPointer());
String* pStr = __pWebViewer->EvaluateJavascriptN(script);
delete pStr;
+ delete pCount;
}
delete pItem;
}
__pFindWordPrev->SetEnabled(false);
String *pCountStr = null;
- result r = __pWebViewer->SearchTextAllAsync(__currentSearchStr, false);
- AppLog("Search Result %s",GetErrorMessage(r));
+ if (__pWebViewer)
+ {
+ result r = __pWebViewer->SearchTextAllAsync(__currentSearchStr, false);
+ AppLog("Search Result %s",GetErrorMessage(r));
+ }
+
/*__pWebViewer->EvaluateJavascriptN(L"document.body.textContent.match(/" + __currentSearchStr + "/gi).length;");
if (pCountStr != null)
{
if(totalCount == -1 || totalCount == 0)
{
- __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),84,__pFindWordCountLabel->GetHeight());
- __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),214+80,__pFindWordEditField->GetHeight());
-// return;
+ if (__pFindWordCountLabel)
+ {
+ __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),84,__pFindWordCountLabel->GetHeight());
+ }
+ if (__pFindWordEditField)
+ {
+ __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),214+80,__pFindWordEditField->GetHeight());
+ }
}
else if(totalCount > 100)
{
- __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),124,__pFindWordCountLabel->GetHeight());
- __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),174,__pFindWordEditField->GetHeight());
+ if (__pFindWordCountLabel)
+ {
+ __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),124,__pFindWordCountLabel->GetHeight());
+ }
+ if (__pFindWordEditField)
+ {
+ __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),174,__pFindWordEditField->GetHeight());
+ }
}
else
{
- __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),124,__pFindWordCountLabel->GetHeight());
- __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),174,__pFindWordEditField->GetHeight());
+ if (__pFindWordCountLabel)
+ {
+ __pFindWordCountLabel->SetBounds(__pFindWordCountLabel->GetX(),__pFindWordCountLabel->GetY(),124,__pFindWordCountLabel->GetHeight());
+ }
+ if (__pFindWordEditField)
+ {
+ __pFindWordEditField->SetBounds(__pFindWordEditField->GetX(),__pFindWordEditField->GetY(),174,__pFindWordEditField->GetHeight());
+ }
}
__maxOccurrances = totalCount;
__pFindWordCountLabel->Invalidate(false);
__pFindWordCountLabel->Invalidate(false);
}
- else if(__pFindWordCountLabelRightToLeft && __pFindWordCountLabelRightToLeft->GetShowState() == true)
+ else if (__pFindWordCountLabelRightToLeft && __pFindWordCountLabelRightToLeft->GetShowState() == true)
{
__pFindWordCountLabelRightToLeft->SetText(countStr);
__pFindWordCountLabelRightToLeft->Invalidate(false);
__pFindWordCountLabelRightToLeft->Invalidate(false);
}
- //FindNextWord(true);
- //Update the controls
- __pFindWordNext->Invalidate(false);
- __pFindWordPrev->Invalidate(false);
+ if (__pFindWordNext)
+ {
+ __pFindWordNext->Invalidate(false);
+ }
+ if (__pFindWordPrev)
+ {
+ __pFindWordPrev->Invalidate(false);
+ }
}
Point p(0,0);
Point q(0,0);
__pWebViewer->GetBlockRange(p,q);
+ if (p == Point(0,0) && q == Point(0,0))
+ return;
+
__pImageMenu->SetAnchorPosition(p);
__pImageMenu->Show();
Invalidate(true);
void MainForm::OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo)
{
AppLog("abcde::MainForm::OnTouchLongPressed %d, %d" ,currentPosition.x,currentPosition.y);
- if(TouchEventManager::GetInstance()->GetTouchInfoListN()->GetCount() >1)
+ if(TouchEventManager::GetInstance() && TouchEventManager::GetInstance()->GetTouchInfoListN() && TouchEventManager::GetInstance()->GetTouchInfoListN()->GetCount() >1)
{
AppLog("Returning because of more than one touch point.");
return;