From 76562e6f4ff9dcbe71f8fdddd3b986e1484c0315 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Mon, 15 Apr 2013 20:35:22 +1000 Subject: Existing code fills 0 length ranges and ranges after document end so simply return instead of throwing exceptions. --- src/RunStyles.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/RunStyles.cxx b/src/RunStyles.cxx index b74053e75..82d924a23 100644 --- a/src/RunStyles.cxx +++ b/src/RunStyles.cxx @@ -116,11 +116,11 @@ int RunStyles::EndRun(int position) { bool RunStyles::FillRange(int &position, int value, int &fillLength) { if (fillLength <= 0) { - throw std::invalid_argument("RunStyles::FillRange <= 0 length."); + return false; } int end = position + fillLength; if (end > Length()) { - throw std::invalid_argument("RunStyles::FillRange length goes past end."); + return false; } int runEnd = RunFromPosition(end); if (styles->ValueAt(runEnd) == value) { -- cgit v1.2.3