aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/RunStyles.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-03-27 19:35:55 +1100
committerNeil <nyamatongwe@gmail.com>2018-03-27 19:35:55 +1100
commite93a47975d317f59df0fdcca7cee95b6ab4ff33f (patch)
tree852d09d665ca8cb76fa919805db7fcfa0028ea39 /src/RunStyles.h
parentfb9f493960b075b034b18d61036d36f384f2e3f8 (diff)
downloadscintilla-mirror-e93a47975d317f59df0fdcca7cee95b6ab4ff33f.tar.gz
Return a FillResult struct from RunStyles::FillRange instead of modifying
arguments as that is clumsy when converting types.
Diffstat (limited to 'src/RunStyles.h')
-rw-r--r--src/RunStyles.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/RunStyles.h b/src/RunStyles.h
index c28621334..af2eb3ec6 100644
--- a/src/RunStyles.h
+++ b/src/RunStyles.h
@@ -12,6 +12,16 @@
namespace Scintilla {
+// Return for RunStyles::FillRange reports if anything was changed and the
+// range that was changed. This may be trimmed from the requested range
+// when some of the requested range already had the requested value.
+template <typename DISTANCE>
+struct FillResult {
+ bool changed;
+ DISTANCE position;
+ DISTANCE fillLength;
+};
+
template <typename DISTANCE, typename STYLE>
class RunStyles {
private:
@@ -33,8 +43,8 @@ public:
DISTANCE FindNextChange(DISTANCE position, DISTANCE end) const;
DISTANCE StartRun(DISTANCE position) const;
DISTANCE EndRun(DISTANCE position) const;
- // Returns true if some values may have changed
- bool FillRange(DISTANCE &position, STYLE value, DISTANCE &fillLength);
+ // Returns changed=true if some values may have changed
+ FillResult<DISTANCE> FillRange(DISTANCE position, STYLE value, DISTANCE fillLength);
void SetValueAt(DISTANCE position, STYLE value);
void InsertSpace(DISTANCE position, DISTANCE insertLength);
void DeleteAll();