@@ -1394,8 +1394,8 @@ void Notepad_plus::command(int id)
13941394 }
13951395
13961396 auto str = _pEditView->getSelectedTextToWChar (false );
1397- if (str) // the selected text is not empty, then use it
1398- _incrementFindDlg.setSearchText (str, _pEditView->getCurrentBuffer ()->getUnicodeMode () != uni8Bit);
1397+ if (! str. empty () ) // the selected text is not empty, then use it
1398+ _incrementFindDlg.setSearchText (str. c_str () , _pEditView->getCurrentBuffer ()->getUnicodeMode () != uni8Bit);
13991399
14001400 _incrementFindDlg.display ();
14011401 }
@@ -1497,7 +1497,7 @@ void Notepad_plus::command(int id)
14971497 case IDM_SEARCH_VOLATILE_FINDPREV :
14981498 {
14991499 auto str = _pEditView->getSelectedTextToWChar ();
1500- if (! str) return ;
1500+ if (str. empty () ) return ;
15011501
15021502 FindOption op;
15031503 op._isMatchCase = false ;
@@ -1507,7 +1507,7 @@ void Notepad_plus::command(int id)
15071507 op._whichDirection = (id == IDM_SEARCH_VOLATILE_FINDNEXT ? DIR_DOWN : DIR_UP);
15081508
15091509 FindStatus status = FSNoMessage;
1510- _findReplaceDlg.processFindNext (str, &op, &status);
1510+ _findReplaceDlg.processFindNext (str. c_str () , &op, &status);
15111511 if (status == FSEndReached)
15121512 {
15131513 wstring msg = _nativeLangSpeaker.getLocalizedStrFromID (" find-status-end-reached" , FIND_STATUS_END_REACHED_TEXT);
@@ -1541,9 +1541,9 @@ void Notepad_plus::command(int id)
15411541
15421542 auto selectedText = _pEditView->getSelectedTextToWChar (true );
15431543
1544- if (selectedText)
1544+ if (! selectedText. empty () )
15451545 {
1546- _findReplaceDlg.markAll (selectedText, styleID);
1546+ _findReplaceDlg.markAll (selectedText. c_str () , styleID);
15471547 }
15481548 }
15491549 break ;
@@ -3510,8 +3510,8 @@ void Notepad_plus::command(int id)
35103510 {
35113511 int iQuote = -1 ;
35123512 auto authorW = _pEditView->getSelectedTextToWChar ();
3513- if (authorW)
3514- iQuote = getQuoteIndexFrom (authorW);
3513+ if (! authorW. empty () )
3514+ iQuote = getQuoteIndexFrom (authorW. c_str () );
35153515
35163516 if (iQuote == -1 )
35173517 {
0 commit comments