diff options
author | Xisco Fauli <anistenis@gmail.com> | 2012-12-18 20:06:51 +0100 |
---|---|---|
committer | Xisco Fauli <anistenis@gmail.com> | 2012-12-18 20:11:35 +0100 |
commit | 8347fa7f8ed75a341e22733e53e7d64e7a930db2 (patch) | |
tree | 6fdc5620d66504664ae3c8041a0eee1ea73e184f | |
parent | 87bfd731cbb9610252b39e9ef1d0d3d6c6c71f09 (diff) |
pywizards: Delete all empty TextFields after finishing
Change-Id: Ic1c0c6e6f6174d4337abf06f32d9fd8072c2511d
-rw-r--r-- | wizards/com/sun/star/wizards/text/TextFieldHandler.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/wizards/com/sun/star/wizards/text/TextFieldHandler.py b/wizards/com/sun/star/wizards/text/TextFieldHandler.py index 379abb1ff8f2..0037f2b7782c 100644 --- a/wizards/com/sun/star/wizards/text/TextFieldHandler.py +++ b/wizards/com/sun/star/wizards/text/TextFieldHandler.py @@ -154,14 +154,12 @@ class TextFieldHandler(object): def removeUserFieldByContent(self): #Remove userfield when its text is empty - try: - xDependentTextFields = TextFieldHandler.dictTextFields.values() - for i in xDependentTextFields: - try: - if not i.TextFieldMaster.Content: - i.dispose() - except UnknownPropertyException: - pass - - except Exception: - traceback.print_exc() + xDependentTextFields = TextFieldHandler.arrayTextFields + for i in xDependentTextFields: + try: + if not i.TextFieldMaster.Content: + i.dispose() + except Exception: + #TextField doesn't even have the attribute Content, + #so it's empty + i.dispose() |