| 1692 | } |
| 1693 | |
| 1694 | bool SCI_METHOD Document::SetStyles(int length, const char *styles) { |
| 1695 | if (enteredStyling != 0) { |
| 1696 | return false; |
| 1697 | } else { |
| 1698 | enteredStyling++; |
| 1699 | bool didChange = false; |
| 1700 | int startMod = 0; |
| 1701 | int endMod = 0; |
| 1702 | for (int iPos = 0; iPos < length; iPos++, endStyled++) { |
| 1703 | PLATFORM_ASSERT(endStyled < Length()); |
| 1704 | if (cb.SetStyleAt(endStyled, styles[iPos], stylingMask)) { |
| 1705 | if (!didChange) { |
| 1706 | startMod = endStyled; |
| 1707 | } |
| 1708 | didChange = true; |
| 1709 | endMod = endStyled; |
| 1710 | } |
| 1711 | } |
| 1712 | if (didChange) { |
| 1713 | DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER, |
| 1714 | startMod, endMod - startMod + 1); |
| 1715 | NotifyModified(mh); |
| 1716 | } |
| 1717 | enteredStyling--; |
| 1718 | return true; |
| 1719 | } |
| 1720 | } |
| 1721 | |
| 1722 | void Document::EnsureStyledTo(int pos) { |
| 1723 | if ((enteredStyling == 0) && (pos > GetEndStyled())) { |
no test coverage detected