Remove some useless codes

Closes #3472
pull/3431/merge
SinghRajenM 2017-07-03 00:49:19 +05:30 committed by Don HO
parent ee69531823
commit a9adc4835d
5 changed files with 26 additions and 39 deletions

View File

@ -539,7 +539,7 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy)
TCHAR nppFullPath[MAX_PATH]; TCHAR nppFullPath[MAX_PATH];
::GetModuleFileName(NULL, nppFullPath, MAX_PATH); ::GetModuleFileName(NULL, nppFullPath, MAX_PATH);
BufferID bufferID = bufferID = _pEditView->getCurrentBufferID(); BufferID bufferID = _pEditView->getCurrentBufferID();
Buffer * buf = MainFileManager->getBufferByID(bufferID); Buffer * buf = MainFileManager->getBufferByID(bufferID);
//process the fileNamePath into LRF //process the fileNamePath into LRF

View File

@ -977,36 +977,14 @@ struct Lang final
class UserLangContainer final class UserLangContainer final
{ {
public: public:
UserLangContainer() UserLangContainer() :_name(TEXT("new user define")), _ext(TEXT("")), _udlVersion(TEXT(""))
{ {
_name = TEXT("new user define"); init();
_ext = TEXT("");
_udlVersion = TEXT("");
_allowFoldOfComments = false;
_forcePureLC = PURE_LC_NONE;
_decimalSeparator = DECSEP_DOT;
_foldCompact = false;
_isCaseIgnored = false;
for (int i = 0 ; i < SCE_USER_KWLIST_TOTAL ; ++i)
*_keywordLists[i] = '\0';
for (int i = 0 ; i < SCE_USER_TOTAL_KEYWORD_GROUPS ; ++i)
_isPrefix[i] = false;
} }
UserLangContainer(const TCHAR *name, const TCHAR *ext, const TCHAR *udlVer) : _name(name), _ext(ext), _udlVersion(udlVer) UserLangContainer(const TCHAR *name, const TCHAR *ext, const TCHAR *udlVer) : _name(name), _ext(ext), _udlVersion(udlVer)
{ {
_allowFoldOfComments = false; init();
_forcePureLC = PURE_LC_NONE;
_decimalSeparator = DECSEP_DOT;
_foldCompact = false;
for (int i = 0 ; i < SCE_USER_KWLIST_TOTAL ; ++i)
*_keywordLists[i] = '\0';
for (int i = 0 ; i < SCE_USER_TOTAL_KEYWORD_GROUPS ; ++i)
_isPrefix[i] = false;
} }
UserLangContainer & operator = (const UserLangContainer & ulc) UserLangContainer & operator = (const UserLangContainer & ulc)
@ -1072,6 +1050,21 @@ private:
friend class SymbolsStyleDialog; friend class SymbolsStyleDialog;
friend class UserDefineDialog; friend class UserDefineDialog;
friend class StylerDlg; friend class StylerDlg;
void init()
{
_forcePureLC = PURE_LC_NONE;
_decimalSeparator = DECSEP_DOT;
_foldCompact = false;
_isCaseIgnored = false;
_allowFoldOfComments = false;
for (int i = 0; i < SCE_USER_KWLIST_TOTAL; ++i)
*_keywordLists[i] = '\0';
for (int i = 0; i < SCE_USER_TOTAL_KEYWORD_GROUPS; ++i)
_isPrefix[i] = false;
}
}; };
#define MAX_EXTERNAL_LEXER_NAME_LEN 16 #define MAX_EXTERNAL_LEXER_NAME_LEN 16

View File

@ -950,13 +950,10 @@ void ScintillaEditView::setJsLexer()
LexerStyler *pNewStyler = (_pParameter->getLStylerArray()).getLexerStylerByName(newLexerName); LexerStyler *pNewStyler = (_pParameter->getLStylerArray()).getLexerStylerByName(newLexerName);
if (pNewStyler) // New js styler is available, so we can use it do more modern styling if (pNewStyler) // New js styler is available, so we can use it do more modern styling
{ {
if (pNewStyler) for (int i = 0, nb = pNewStyler->getNbStyler(); i < nb; ++i)
{ {
for (int i = 0, nb = pNewStyler->getNbStyler(); i < nb; ++i) Style & style = pNewStyler->getStyler(i);
{ setStyle(style);
Style & style = pNewStyler->getStyler(i);
setStyle(style);
}
} }
basic_string<char> keywordListInstruction(""); basic_string<char> keywordListInstruction("");

View File

@ -1028,9 +1028,8 @@ vector<generic_string> FileBrowser::getRoots() const
{ {
vector<generic_string> roots; vector<generic_string> roots;
HTREEITEM node = nullptr;
for (HTREEITEM hItemNode = _treeView.getRoot(); for (HTREEITEM hItemNode = _treeView.getRoot();
hItemNode != nullptr && node == nullptr; hItemNode != nullptr;
hItemNode = _treeView.getNextSibling(hItemNode)) hItemNode = _treeView.getNextSibling(hItemNode))
{ {
TVITEM tvItem; TVITEM tvItem;
@ -1088,9 +1087,8 @@ bool FileBrowser::addInTree(generic_string rootPath, generic_string addItemFullP
} }
else else
{ {
HTREEITEM childNodeFound = nullptr;
for (HTREEITEM hItemNode = _treeView.getChildFrom(node); for (HTREEITEM hItemNode = _treeView.getChildFrom(node);
hItemNode != NULL && childNodeFound == nullptr; hItemNode != NULL ;
hItemNode = _treeView.getNextSibling(hItemNode)) hItemNode = _treeView.getNextSibling(hItemNode))
{ {
TCHAR textBuffer[MAX_PATH]; TCHAR textBuffer[MAX_PATH];
@ -1128,9 +1126,8 @@ HTREEITEM FileBrowser::findInTree(generic_string rootPath, HTREEITEM node, std::
} }
else else
{ {
HTREEITEM childNodeFound = nullptr;
for (HTREEITEM hItemNode = _treeView.getChildFrom(node); for (HTREEITEM hItemNode = _treeView.getChildFrom(node);
hItemNode != NULL && childNodeFound == nullptr; hItemNode != NULL;
hItemNode = _treeView.getNextSibling(hItemNode)) hItemNode = _treeView.getNextSibling(hItemNode))
{ {
TCHAR textBuffer[MAX_PATH]; TCHAR textBuffer[MAX_PATH];

View File

@ -84,7 +84,7 @@ public:
// prober has a hard-coded call to FilterWithoutEnglishLetters which gets rid // prober has a hard-coded call to FilterWithoutEnglishLetters which gets rid
// of the English letters. // of the English letters.
PRBool KeepEnglishLetters() {return mModel->keepEnglishLetter;} // (not implemented) PRBool KeepEnglishLetters() {return mModel->keepEnglishLetter;} // (not implemented)
nsSingleByteCharSetProber operator=(const nsSingleByteCharSetProber&){}; nsSingleByteCharSetProber operator=(const nsSingleByteCharSetProber&) = delete;
#ifdef DEBUG_chardet #ifdef DEBUG_chardet
virtual void DumpStatus(); virtual void DumpStatus();