summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2013-02-01 18:48:08 +0100
committerXisco Fauli <anistenis@gmail.com>2013-02-03 00:43:36 +0100
commit270a8259bf86ea5a338f57abd02d747756c0c43a (patch)
treee57ae0cab7463f4ea96c92efbd0f37df016257e5 /wizards
parent4fd910a096532fed2552c67bceabe237a9e3c7d6 (diff)
pyagenda: Fix finish action
Change-Id: I89b2b8b8a3f5988d6a53fe2a743fbf191e04ff58
Diffstat (limited to 'wizards')
-rw-r--r--wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py23
-rw-r--r--wizards/com/sun/star/wizards/text/TextSectionHandler.py2
2 files changed, 12 insertions, 13 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
index 5d641c6ff8b4..e40442beca38 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialogImpl.py
@@ -16,6 +16,7 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
import traceback
+import os.path
from .AgendaWizardDialog import AgendaWizardDialog, uno
from .AgendaWizardDialogConst import HID
from .AgendaDocument import AgendaDocument
@@ -330,24 +331,22 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
try:
fileAccess = FileAccess(self.xMSF)
self.sPath = self.myPathSelection.getSelectedPath()
- if not self.sPath:
+ if not self.sPath or not os.path.exists(self.sPath):
self.myPathSelection.triggerPathPicker()
self.sPath = self.myPathSelection.getSelectedPath()
- self.sPath = fileAccess.getURL(self.sPath)
#first, if the filename was not changed, thus
#it is coming from a saved session, check if the
# file exists and warn the user.
if not self.filenameChanged:
- if fileAccess.exists(self.sPath, True):
- answer = SystemDialog.showMessageBox(
- self.xMSF, "MessBox", YES_NO + DEF_NO,
- self.resources.resOverwriteWarning,
- self.xUnoDialog.Peer)
- if answer == 3:
- # user said: no, do not overwrite
- endWizard = False
- return False
+ answer = SystemDialog.showMessageBox(
+ self.xMSF, "MessBox", YES_NO + DEF_NO,
+ self.resources.resOverwriteWarning,
+ self.xUnoDialog.Peer)
+ if answer == 3:
+ # user said: no, do not overwrite
+ endWizard = False
+ return False
xDocProps = self.agendaTemplate.xTextDocument.DocumentProperties
xDocProps.Title = self.txtTemplateName.Text
@@ -363,7 +362,7 @@ class AgendaWizardDialogImpl(AgendaWizardDialog):
self.agendaTemplate.finish(self.topicsControl.scrollfields)
- loadValues = range(2)
+ loadValues = list(range(2))
loadValues[0] = uno.createUnoStruct( \
'com.sun.star.beans.PropertyValue')
loadValues[0].Name = "AsTemplate"
diff --git a/wizards/com/sun/star/wizards/text/TextSectionHandler.py b/wizards/com/sun/star/wizards/text/TextSectionHandler.py
index 8896539b08c5..c9ec437e87a7 100644
--- a/wizards/com/sun/star/wizards/text/TextSectionHandler.py
+++ b/wizards/com/sun/star/wizards/text/TextSectionHandler.py
@@ -74,7 +74,7 @@ class TextSectionHandler(object):
try:
TextSectionCount = self.xTextDocument.TextSections.Count
xAllTextSections = self.xTextDocument.TextSections
- for i in xrange(TextSectionCount - 1, -1, -1):
+ for i in range(TextSectionCount - 1, -1, -1):
xTextContentTextSection = xAllTextSections.getByIndex(i)
self.xText.removeTextContent(xTextContentTextSection)
except Exception: