Kaydet (Commit) d6ee3e33 authored tarafından Xisco Fauli's avatar Xisco Fauli

pywizards: Simplify textElement and move it to text folder

Change-Id: I1f9cde45c693de5bad091272f015e5cd7fb6beeb
üst a434b93b
......@@ -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):
......
......@@ -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):
......
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment