summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2012-11-07 22:41:15 +0100
committerXisco Fauli <anistenis@gmail.com>2012-11-08 07:42:28 +0100
commitd6ee3e33c9bbd485d7685a790ec0ad97f8c5c05f (patch)
treeecf0b370fcfd8b1b5279f124fe9a0f894171cc7a /wizards/com/sun/star/wizards
parenta434b93b25c6aa652b925a8aaba1e3e0ec6986a9 (diff)
pywizards: Simplify textElement and move it to text folder
Change-Id: I1f9cde45c693de5bad091272f015e5cd7fb6beeb
Diffstat (limited to 'wizards/com/sun/star/wizards')
-rw-r--r--wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py5
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py5
-rw-r--r--wizards/com/sun/star/wizards/text/TextElement.py (renamed from wizards/com/sun/star/wizards/common/TextElement.py)19
3 files changed, 7 insertions, 22 deletions
diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
index 0bae71ab56cc..51d689447b2b 100644
--- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
@@ -25,13 +25,13 @@ from ..ui.event.RadioDataAware import RadioDataAware
from ..text.TextFieldHandler import TextFieldHandler
from ..text.TextDocument import TextDocument
from ..text.ViewHandler import ViewHandler
+from ..text.TextElement import TextElement
from ..common.Configuration import Configuration
from ..common.SystemDialog import SystemDialog
from ..common.NoValidPathException import NoValidPathException
from ..common.HelpIds import HelpIds
from ..common.FileAccess import FileAccess
from ..common.Desktop import Desktop
-from ..common.TextElement import TextElement
from ..document.OfficeDocument import OfficeDocument
from com.sun.star.awt.VclWindowPeerAttribute import YES_NO, DEF_NO
@@ -235,8 +235,7 @@ class FaxWizardDialogImpl(FaxWizardDialog):
for i in constRangeList:
text = i.String.lower()
- aux = TextElement(i, self.resources.dictConstants[text],
- "hint", self.xMSF)
+ aux = TextElement(i, self.resources.dictConstants[text])
aux.write()
def insertRoadmap(self):
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
index 18fefbe24230..8f294771603a 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
@@ -25,10 +25,10 @@ from ..common.FileAccess import FileAccess
from ..common.Configuration import Configuration
from ..common.SystemDialog import SystemDialog
from ..common.Desktop import Desktop
-from ..common.TextElement import TextElement
from ..ui.PathSelection import PathSelection
from ..ui.event.UnoDataAware import UnoDataAware
from ..ui.event.RadioDataAware import RadioDataAware
+from ..text.TextElement import TextElement
from ..text.TextDocument import TextDocument
from ..text.ViewHandler import ViewHandler
from ..text.TextFieldHandler import TextFieldHandler
@@ -991,8 +991,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
for i in constRangeList:
text = i.String.lower()
- aux = TextElement(i, self.resources.dictConstants[text],
- "hint", self.xMSF)
+ aux = TextElement(i, self.resources.dictConstants[text])
aux.write()
def insertRoadmap(self):
diff --git a/wizards/com/sun/star/wizards/common/TextElement.py b/wizards/com/sun/star/wizards/text/TextElement.py
index f035808c4892..840c70e55af1 100644
--- a/wizards/com/sun/star/wizards/common/TextElement.py
+++ b/wizards/com/sun/star/wizards/text/TextElement.py
@@ -16,26 +16,13 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
import traceback
-from .Helper import Helper
-from com.sun.star.text.PlaceholderType import TEXT
class TextElement(object):
- def __init__(self, item, placeHolderText, hint, xmsf):
+ def __init__(self, item, placeHolderText):
self.item = item
self.placeHolderText = placeHolderText
- self.xmsf = xmsf
- self.paraStyle = Helper.getUnoPropertyValue(
- item.Start, "ParaStyleName")
def write(self):
- try:
- if self.item is not None:
- self.item.String = ""
- cursor = self.item.Text.createTextCursorByRange(
- self.item.Start)
- cursor.String = self.placeHolderText
- Helper.setUnoPropertyValue(
- cursor, "ParaStyleName", self.paraStyle)
- except Exception, e:
- traceback.print_exc()
+ if self.item is not None:
+ self.item.String = self.placeHolderText