Commits

Kitty Barnett committed c0e853a

STORM-276 Insert braces around if/for/while loops

  • Participants
  • Parent commits c8e09e8

Comments (0)

Files changed (6)

indra/llui/lllineeditor.cpp

 	for (std::list<std::pair<U32, U32> >::const_iterator it = mMisspellRanges.begin(); it != mMisspellRanges.end(); ++it)
 	{
 		if ( (it->first <= pos) && (it->second >= pos) )
+		{
 			return wstring_to_utf8str(mText.getWString().substr(it->first, it->second - it->first));
+		}
 	}
 	return LLStringUtil::null;
 }
 	for (std::list<std::pair<U32, U32> >::const_iterator it = mMisspellRanges.begin(); it != mMisspellRanges.end(); ++it)
 	{
 		if ( (it->first <= pos) && (it->second >= pos) )
+		{
 			return true;
+		}
 	}
 	return false;
 }
 			// Find the start of the first word
 			U32 word_start = 0, word_end = 0;
 			while ( (word_start < text.length()) && (!LLStringOps::isAlpha(text[word_start])) )
+			{
 				word_start++;
+			}
 
 			// Iterate over all words in the text block and check them one by one
 			mMisspellRanges.clear();
 					word_end++;
 				}
 				if (word_end > text.length())
+				{
 					break;
+				}
 
 				// Don't process words shorter than 3 characters
 				std::string word = wstring_to_utf8str(text.substr(word_start, word_end - word_start));
 				if ( (word.length() >= 3) && (!LLSpellChecker::instance().checkSpelling(word)) )
+				{
 					mMisspellRanges.push_back(std::pair<U32, U32>(start + word_start, start + word_end));
+				}
 
 				// Find the start of the next word
 				word_start = word_end + 1;
 				while ( (word_start < text.length()) && (!LLWStringUtil::isPartOfWord(text[word_start])) )
+				{
 					word_start++;
+				}
 			}
 
 			mSpellCheckStart = start;
 		{
 			// Skip over words that aren't (partially) visible
 			if ( ((it->first < start) && (it->second < start)) || (it->first > end) )
+			{
 				continue;
+			}
 
 			// Skip the current word if the user is still busy editing it
 			if ( (!mSpellCheckTimer.hasExpired()) && (it->first <= (U32)mCursorPos) && (it->second >= (U32)mCursorPos) )
+			{
  				continue;
+			}
 
 			S32 pxWidth = getRect().getWidth();
 			S32 pxStart = findPixelNearestPos(it->first - getCursor());
 			if (pxStart > pxWidth)
+			{
 				continue;
+			}
 			S32 pxEnd = findPixelNearestPos(it->second - getCursor());
 			if (pxEnd > pxWidth)
+			{
 				pxEnd = pxWidth;
+			}
 
 			S32 pxBottom = (S32)(text_bottom + mGLFont->getDescenderHeight());
 
 			{
 				gl_line_2d(pxStart, pxBottom, pxStart + 2, pxBottom - 2);
 				if (pxStart + 3 < pxEnd)
+				{
 					gl_line_2d(pxStart + 2, pxBottom - 3, pxStart + 4, pxBottom - 1);
+				}
 				pxStart += 4;
 			}
 		}
 		if (hasSelection())
 		{
 			if ( (mCursorPos < llmin(mSelectionStart, mSelectionEnd)) || (mCursorPos > llmax(mSelectionStart, mSelectionEnd)) )
+			{
 				deselect();
+			}
 			else
+			{
 				setCursor(llmax(mSelectionStart, mSelectionEnd));
+			}
 		}
 
 		bool use_spellcheck = getSpellCheck(), is_misspelled = false;

indra/llui/llmenugl.cpp

 	arrange();
 
 	if (spawning_view)
+	{
 		mSpawningViewHandle = spawning_view->getHandle();
+	}
 	else
+	{
 		mSpawningViewHandle.markDead();
+	}
 	LLView::setVisible(TRUE);
 }
 

indra/llui/llspellcheck.cpp

 {
 	suggestions.clear();
 	if ( (!mHunspell) || (word.length() < 3) )
+	{
 		return 0;
+	}
 
 	char** suggestion_list; int suggestion_cnt = 0;
 	if ( (suggestion_cnt = mHunspell->suggest(&suggestion_list, word.c_str())) != 0 )
 	{
 		for (int suggestion_index = 0; suggestion_index < suggestion_cnt; suggestion_index++)
+		{
 			suggestions.push_back(suggestion_list[suggestion_index]);
+		}
 		mHunspell->free_list(&suggestion_list, suggestion_cnt);	
 	}
 	return suggestions.size();
 	{
 		const LLSD& dict_entry = *it;
 		if (dict_language == dict_entry["language"].asString())
+		{
 			return dict_entry;
+		}
 	}
 	return LLSD();
 }
 {
 	const std::string dict_language = dict_info["language"].asString();
 	if (dict_language.empty())
+	{
 		return;
+	}
 
 	for (LLSD::array_iterator it = sDictMap.beginArray(); it != sDictMap.endArray(); ++it)
 	{
 	{
 		llifstream app_file(app_path + "dictionaries.xml", std::ios::binary);
 		if ( (!app_file.is_open()) || (0 == LLSDSerialize::fromXMLDocument(sDictMap, app_file)) || (0 == sDictMap.size()) )
+		{
 			return;
+		}
 	}
 
 	// Load user installed dictionary information
 		LLSD custom_dict_map;
 		LLSDSerialize::fromXMLDocument(custom_dict_map, custom_file);
 		for (LLSD::array_const_iterator it = custom_dict_map.beginArray(); it != custom_dict_map.endArray(); ++it)
+		{
 			setDictionaryData(*it);
+		}
 		custom_file.close();
 	}
 
 			{
 				// Skip over the first line since that's just a line count
 				if (0 != line_num)
+				{
 					word_list.push_back(word);
+				}
 				line_num++;
 			}
 		}
 	{
 		file_out << word_list.size() << std::endl;
 		for (std::vector<std::string>::const_iterator itWord = word_list.begin(); itWord != word_list.end(); ++itWord)
+		{
 			file_out << *itWord << std::endl;
+		}
 		file_out.close();
 	}
 }
 		{
 			const LLSD dict_entry = getDictionaryData(*it_added);
 			if ( (!dict_entry.isDefined()) || (!dict_entry["installed"].asBoolean()) )
+			{
 				continue;
+			}
 
 			const std::string strFileDic = dict_entry["name"].asString() + ".dic";
 			if (gDirUtilp->fileExists(user_path + strFileDic))
+			{
 				mHunspell->add_dic((user_path + strFileDic).c_str());
+			}
 			else if (gDirUtilp->fileExists(app_path + strFileDic))
+			{
 				mHunspell->add_dic((app_path + strFileDic).c_str());
+			}
 		}
 		mDictSecondary = dict_list;
 		sSettingsChangeSignal();
 		const std::string filename_aff = dict_entry["name"].asString() + ".aff";
 		const std::string filename_dic = dict_entry["name"].asString() + ".dic";
 		if ( (gDirUtilp->fileExists(user_path + filename_aff)) && (gDirUtilp->fileExists(user_path + filename_dic)) )
+		{
 			mHunspell = new Hunspell((user_path + filename_aff).c_str(), (user_path + filename_dic).c_str());
+		}
 		else if ( (gDirUtilp->fileExists(app_path + filename_aff)) && (gDirUtilp->fileExists(app_path + filename_dic)) )
+		{
 			mHunspell = new Hunspell((app_path + filename_aff).c_str(), (app_path + filename_dic).c_str());
+		}
 		if (!mHunspell)
+		{
 			return;
+		}
 
 		mDictName = dict_name;
 		mDictFile = dict_entry["name"].asString();
 		{
 			const LLSD dict_entry = getDictionaryData(*it);
 			if ( (!dict_entry.isDefined()) || (!dict_entry["installed"].asBoolean()) )
+			{
 				continue;
+			}
 
 			const std::string filename_dic = dict_entry["name"].asString() + ".dic";
 			if (gDirUtilp->fileExists(user_path + filename_dic))
+			{
 				mHunspell->add_dic((user_path + filename_dic).c_str());
+			}
 			else if (gDirUtilp->fileExists(app_path + filename_dic))
+			{
 				mHunspell->add_dic((app_path + filename_dic).c_str());
+			}
 		}
 	}
 
 void LLSpellChecker::initClass()
 {
 	if (sDictMap.isUndefined())
+	{
 		refreshDictionaryMap();
+	}
 }

indra/llui/lltextbase.cpp

 				// Find the start of the first word
 				U32 word_start = seg_start, word_end = -1;
 				while ( (word_start < wstrText.length()) && (!LLStringOps::isAlpha(wstrText[word_start])) )
+				{
 					word_start++;
+				}
 
 				// Iterate over all words in the text block and check them one by one
 				while (word_start < seg_end)
 						word_end++;
 					}
 					if (word_end > seg_end)
+					{
 						break;
+					}
 
 					// Don't process words shorter than 3 characters
 					std::string word = wstring_to_utf8str(wstrText.substr(word_start, word_end - word_start));
 					// Find the start of the next word
 					word_start = word_end + 1;
 					while ( (word_start < seg_end) && (!LLWStringUtil::isPartOfWord(wstrText[word_start])) )
+					{
 						word_start++;
+					}
 				}
 			}
 
 				{
 					gl_line_2d(squiggle_start, squiggle_bottom, squiggle_start + 2, squiggle_bottom - 2);
 					if (squiggle_start + 3 < squiggle_end)
+					{
 						gl_line_2d(squiggle_start + 2, squiggle_bottom - 3, squiggle_start + 4, squiggle_bottom - 1);
+					}
 					squiggle_start += 4;
 				}
 
 				if (misspell_it->second > seg_end)
+				{
 					break;
+				}
 				++misspell_it;
 			}
 
 	for (std::list<std::pair<U32, U32> >::const_iterator it = mMisspellRanges.begin(); it != mMisspellRanges.end(); ++it)
 	{
 		if ( (it->first <= pos) && (it->second >= pos) )
+		{
 			return wstring_to_utf8str(getWText().substr(it->first, it->second - it->first));
+		}
 	}
 	return LLStringUtil::null;
 }
 	for (std::list<std::pair<U32, U32> >::const_iterator it = mMisspellRanges.begin(); it != mMisspellRanges.end(); ++it)
 	{
 		if ( (it->first <= pos) && (it->second >= pos) )
+		{
 			return true;
+		}
 	}
 	return false;
 }

indra/llui/lltexteditor.cpp

 	if (hasSelection())
 	{
 		if ( (mCursorPos < llmin(mSelectionStart, mSelectionEnd)) || (mCursorPos > llmax(mSelectionStart, mSelectionEnd)) )
+		{
 			deselect();
+		}
 		else
+		{
 			setCursorPos(llmax(mSelectionStart, mSelectionEnd));
+		}
 	}
 
 	bool use_spellcheck = getSpellCheck(), is_misspelled = false;

indra/newview/llfloaterspellchecksettings.cpp

 		LLScrollListCtrl* list_ctrl = findChild<LLScrollListCtrl>("spellcheck_active_list");
 		std::vector<LLScrollListItem*> list_items = list_ctrl->getAllData();
 		for (std::vector<LLScrollListItem*>::const_iterator item_it = list_items.begin(); item_it != list_items.end(); ++item_it)
+		{
 			list_dict.push_back((*item_it)->getColumn(0)->getValue().asString());
+		}
 	}
 	gSavedSettings.setString("SpellCheckDictionary", boost::join(list_dict, ","));
 
 	LLComboBox* dict_combo = findChild<LLComboBox>("spellcheck_main_combo");
 	std::string dict_cur = dict_combo->getSelectedItemLabel();
 	if ((dict_cur.empty() || from_settings) && (LLSpellChecker::getUseSpellCheck()))
+	{
 		dict_cur = LLSpellChecker::instance().getActiveDictionary();
+	}
 	dict_combo->clearRows();
 	dict_combo->setEnabled(enabled);
 
 		{
 			const LLSD& dict = *dict_it;
 			if ( (dict["installed"].asBoolean()) && (dict["is_primary"].asBoolean()) && (dict.has("language")) )
+			{
 				dict_combo->add(dict["language"].asString());
+			}
 		}
 		if (!dict_combo->selectByValue(dict_cur))
+		{
 			dict_combo->clear();
+		}
 	}
 
 	// Populate the available and active dictionary list
 	if ( ((!avail_ctrl->getItemCount()) && (!active_ctrl->getItemCount())) || (from_settings) )
 	{
 		if (LLSpellChecker::getUseSpellCheck())
+		{
 			active_list = LLSpellChecker::instance().getSecondaryDictionaries();
+		}
 	}
 	else
 	{
 		{
 			std::string dict = (*item_it)->getColumn(0)->getValue().asString();
 			if (dict_cur != dict)
+			{
 				active_list.push_back(dict);
+			}
 		}
 	}