[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - 2 commits - scripting/examples wizards/com
Xisco Fauli
anistenis at gmail.com
Sun Feb 17 06:28:38 PST 2013
scripting/examples/python/HelloWorld.py | 7 ++++++-
wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py | 3 ++-
2 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 3e8af168ca227529b752abb9c7aecc42be4a2290
Author: Xisco Fauli <anistenis at gmail.com>
Date: Fri Feb 15 20:19:16 2013 +0100
fdo#38451: Disable Sender and Recipient step
Change-Id: I5ab0989ed4e5e30b97170cbba0d516eff4befc59
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
index 466cd61..23d2f77 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
@@ -287,10 +287,11 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.xDialogModel.lstPrivateStyle.Enabled = False
self.lstPrivOfficialStyleItemChanged()
self.disableBusinessPaper()
- self.enableSenderReceiver()
+ self.disableSenderReceiver()
self.setPossibleFooter(True)
if self.myPathSelection.xSaveTextBox.Text.lower():
self.myPathSelection.initializePath()
+ self.myLetterDoc.fillSenderWithUserData()
def optPrivateLetterItemChanged(self):
self.lstBusinessStylePos = None
commit 70b6d7510d6910e046342114a79321ae8654764a
Author: Xisco Fauli <anistenis at gmail.com>
Date: Sun Feb 17 14:59:45 2013 +0100
fdo#60670: Create a new document in case there's none
Change-Id: I7e03481beb1d4e60601fd93d787bc7354495e41f
diff --git a/scripting/examples/python/HelloWorld.py b/scripting/examples/python/HelloWorld.py
index 48e7786..4cad8a8 100644
--- a/scripting/examples/python/HelloWorld.py
+++ b/scripting/examples/python/HelloWorld.py
@@ -21,7 +21,12 @@
def HelloWorldPython( ):
"""Prints the string 'Hello World(in Python)' into the current document"""
#get the doc from the scripting context which is made available to all scripts
- model = XSCRIPTCONTEXT.getDocument()
+ desktop = XSCRIPTCONTEXT.getDesktop()
+ model = desktop.getCurrentComponent()
+#check whether there's already an opened document. Otherwise, create a new one
+ if not hasattr(model, "Text"):
+ model = desktop.loadComponentFromURL(
+ "private:factory/swriter","_blank", 0, () )
#get the XText interface
text = model.Text
#create an XTextRange at the end of the document
More information about the Libreoffice-commits
mailing list