summaryrefslogtreecommitdiff
path: root/libopie2/opiepim
authordrw <drw>2005-02-16 19:45:54 (UTC)
committer drw <drw>2005-02-16 19:45:54 (UTC)
commit28feca2d605de0bd5a1ccf2217dfef2a17466307 (patch) (side-by-side diff)
tree0badbaa8bbbecfbe0541f1686572e12c2b8f383a /libopie2/opiepim
parent5ad21664e5db417a18682903a660f4651c68ff12 (diff)
downloadopie-28feca2d605de0bd5a1ccf2217dfef2a17466307.zip
opie-28feca2d605de0bd5a1ccf2217dfef2a17466307.tar.gz
opie-28feca2d605de0bd5a1ccf2217dfef2a17466307.tar.bz2
Fix for bug #1542 - todo crashes when priority < 1 or > 5
Diffstat (limited to 'libopie2/opiepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimtodo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/libopie2/opiepim/core/opimtodo.cpp b/libopie2/opiepim/core/opimtodo.cpp
index 16ca987..5bdc648 100644
--- a/libopie2/opiepim/core/opimtodo.cpp
+++ b/libopie2/opiepim/core/opimtodo.cpp
@@ -119,2 +119,6 @@ OPimTodo::OPimTodo( bool completed, int priority,
data->hasDate = hasDate;
+ if ( priority < 1 )
+ priority = 1;
+ else if ( priority > 5 )
+ priority = 5;
data->priority = priority;
@@ -141,2 +145,6 @@ OPimTodo::OPimTodo( bool completed, int priority,
data->hasDate = hasDate;
+ if ( priority < 1 )
+ priority = 1;
+ else if ( priority > 5 )
+ priority = 5;
data->priority = priority;
@@ -341,2 +349,6 @@ void OPimTodo::setPriority( int prio )
changeOrModify();
+ if ( prio < 1 )
+ prio = 1;
+ else if ( prio > 5 )
+ prio = 5;
data->priority = prio;