void CTDLFindTaskExpressionListCtrl::MoveSelectedRuleDown() { if (CanMoveSelectedRuleDown()) { int nRow, nCol; GetCurSel(nRow, nCol); // save off rule SEARCHPARAM sp = m_aSearchParams[nRow]; // delete rule m_aSearchParams.RemoveAt(nRow); DeleteItem(nRow); // reinsert rule nRow = InsertRule(nRow + 1, sp); // sanity check ValidateListData(); // restore selection SetCurSel(nRow, nCol); EnsureVisible(nRow, FALSE); } }
NS_IMETHODIMP StyleSheet::InsertRule(const nsAString& aRule, uint32_t aIndex, uint32_t* aReturn) { ErrorResult rv; *aReturn = InsertRule(aRule, aIndex, *nsContentUtils::SubjectPrincipal(), rv); return rv.StealNSResult(); }
void BranchingUserFunction::DeclareRule(LispInt aPrecedence, LispPtr& aBody) { // New branching rule. BranchRule* newRule = NEW BranchRuleTruePredicate(aPrecedence,aBody); if (!newRule) throw LispErrCreatingRule(); InsertRule(aPrecedence,newRule); }
BOOL CTDLFindTaskExpressionListCtrl::AddRule() { SEARCHPARAM sp(TDCA_TASKNAMEORCOMMENTS, FOP_INCLUDES); int nRow = InsertRule(GetRuleCount(), sp); // make sure the 'and/or' text of the preceding rule is set RefreshAndOrColumnText(); SetCurSel(nRow, ATTRIB); EnsureVisible(nRow, FALSE); return TRUE; }
BOOL CTDLFindTaskExpressionListCtrl::AddRule() { SEARCHPARAM sp(TDCA_TASKNAMEORCOMMENTS, FO_INCLUDES); int nRow = InsertRule(GetRuleCount(), sp); // make sure the 'and/or' text of the preceding rule is set if (nRow > 0) { SEARCHPARAM& spPrev = m_aSearchParams[nRow - 1]; CEnString sAndOr(spPrev.GetAnd() ? IDS_FP_AND : IDS_FP_OR); SetItemText(nRow - 1, ANDOR, sAndOr); } SetCurSel(nRow, ATTRIB); EnsureVisible(nRow, FALSE); return TRUE; }