| Summary: | Loops in Python Listener macro does not execute | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Onyeibo Oku <twohotis> | ||||
| Component: | libreoffice | Assignee: | Caolan McNamara <caolanm> | ||||
| Status: | CLOSED NOTABUG | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | urgent | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 15 | CC: | caolanm, dtardon, ltinkl | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2011-08-01 06:22:37 UTC | Type: | --- | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
|
Description
Onyeibo Oku
2011-07-30 18:14:55 UTC
Created attachment 515983 [details]
a python listener macro that monitors A1 and adds/removes sheets based on its values
It works fine with the following change:
@@ -19,7 +19,7 @@ class myListener(XModifyListener, unohel
self.formerVal = numOfSheets-1
def modified(self, oEv):
- currentVal = oEv.Source.Value
+ currentVal = int(oEv.Source.Value)
self.diff = currentVal - self.formerVal
if (self.formerVal < self.minSheets) and (currentVal < self.minSheets):
sheetManager("Reserve", "") #pass
It seems that the type of oEv.Source.Value changed from int to float and range() does not like that. That is actually not an error, as the description of method com.sun.star.sheet.XCell.getValue is "returns the floating point value of the cell." It is even possible that the change was in Python, as the tarball from openoffice.org site contains bundled python 2.3, which might allow floats as arguments to range().
Btw, I do think you should use instance variables for diff and formerVal.
|