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
commit386d275a0a0ea5b2725ff872fe8811cebecd2422 (patch)
tree7a80b7e42a9f007e760815a845520b7d66129fcb /src/RunStyles.h
parent5dc15089ae075bd105fc2b81f3b5e4fd3c03bf9f (diff)
downloadscintilla-mirror-386d275a0a0ea5b2725ff872fe8811cebecd2422.tar.gz
Backport: Return a FillResult struct from RunStyles::FillRange instead of modifying
arguments as that is clumsy when converting types. Backport of changeset 6657:43515e7709c6.
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();