Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
be3b55d5
Kaydet (Commit)
be3b55d5
authored
Kas 24, 2012
tarafından
Xisco Fauli
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
pywizards: fix textfields
Change-Id: I6609c554ef161a0abafbdfa65f8076a42eec93b2
üst
a615abcd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
22 deletions
+23
-22
FaxDocument.py
wizards/com/sun/star/wizards/fax/FaxDocument.py
+1
-2
TextFieldHandler.py
wizards/com/sun/star/wizards/text/TextFieldHandler.py
+22
-20
No files found.
wizards/com/sun/star/wizards/fax/FaxDocument.py
Dosyayı görüntüle @
be3b55d5
...
...
@@ -95,8 +95,7 @@ class FaxDocument(TextDocument):
return
False
def
switchUserField
(
self
,
sFieldName
,
sNewContent
,
bState
):
myFieldHandler
=
TextFieldHandler
(
self
.
xMSF
,
self
.
xTextDocument
)
myFieldHandler
=
TextFieldHandler
(
self
.
xMSF
,
self
.
xTextDocument
)
if
bState
:
myFieldHandler
.
changeUserFieldContent
(
sFieldName
,
sNewContent
)
else
:
...
...
wizards/com/sun/star/wizards/text/TextFieldHandler.py
Dosyayı görüntüle @
be3b55d5
...
...
@@ -21,21 +21,17 @@ import unicodedata
from
..common.PropertyNames
import
PropertyNames
from
com.sun.star.util
import
DateTime
from
com.sun.star.uno
import
RuntimeException
class
TextFieldHandler
(
object
):
'''
Creates a new instance of TextFieldHandler
@param xMSF
@param xTextDocument
'''
xTextFieldsSupplierAux
=
None
arrayTextFields
=
[]
dictTextFields
=
{}
def
__init__
(
self
,
xMSF
,
xTextDocument
):
self
.
xMSFDoc
=
xMSF
self
.
xTextFieldsSupplier
=
xTextDocument
self
.
arrayTextFields
=
[]
self
.
dictTextFields
=
{}
if
TextFieldHandler
.
xTextFieldsSupplierAux
is
not
\
self
.
xTextFieldsSupplier
:
self
.
__getTextFields
()
...
...
@@ -93,10 +89,10 @@ class TextFieldHandler(object):
self
.
xTextFieldsSupplier
.
TextFields
.
createEnumeration
()
while
xEnum
.
hasMoreElements
():
oTextField
=
xEnum
.
nextElement
()
self
.
arrayTextFields
.
append
(
oTextField
)
TextFieldHandler
.
arrayTextFields
.
append
(
oTextField
)
xPropertySet
=
oTextField
.
TextFieldMaster
if
xPropertySet
.
Name
:
self
.
dictTextFields
[
xPropertySet
.
Name
]
=
\
TextFieldHandler
.
dictTextFields
[
xPropertySet
.
Name
]
=
\
oTextField
except
Exception
:
traceback
.
print_exc
()
...
...
@@ -104,7 +100,7 @@ class TextFieldHandler(object):
def
__getTextFieldsByProperty
(
self
,
_PropertyName
,
_aPropertyValue
):
try
:
xProperty
=
self
.
dictTextFields
[
_aPropertyValue
]
xProperty
=
TextFieldHandler
.
dictTextFields
[
_aPropertyValue
]
xPropertySet
=
xProperty
.
TextFieldMaster
if
xPropertySet
.
PropertySetInfo
.
hasPropertyByName
(
_PropertyName
):
...
...
@@ -118,15 +114,18 @@ class TextFieldHandler(object):
return
None
def
changeUserFieldContent
(
self
,
_FieldName
,
_FieldContent
):
DependentTextFields
=
self
.
__getTextFieldsByProperty
(
PropertyNames
.
PROPERTY_NAME
,
_FieldName
)
if
DependentTextFields
is
not
None
:
DependentTextFields
.
TextFieldMaster
.
setPropertyValue
(
"Content"
,
_FieldContent
)
self
.
refreshTextFields
()
try
:
DependentTextFields
=
self
.
__getTextFieldsByProperty
(
PropertyNames
.
PROPERTY_NAME
,
_FieldName
)
if
DependentTextFields
is
not
None
:
DependentTextFields
.
TextFieldMaster
.
setPropertyValue
(
"Content"
,
_FieldContent
)
self
.
refreshTextFields
()
except
Exception
:
traceback
.
print_exc
()
def
updateDocInfoFields
(
self
):
try
:
for
i
in
self
.
arrayTextFields
:
for
i
in
TextFieldHandler
.
arrayTextFields
:
if
i
.
supportsService
(
"com.sun.star.text.TextField.ExtendedUser"
):
i
.
update
()
...
...
@@ -146,18 +145,21 @@ class TextFieldHandler(object):
dt
.
Year
=
time
.
strftime
(
"
%
Y"
,
now
)
dt
.
Month
=
time
.
strftime
(
"
%
m"
,
now
)
dt
.
Month
+=
1
for
i
in
self
.
arrayTextFields
:
for
i
in
TextFieldHandler
.
arrayTextFields
:
if
i
.
supportsService
(
"com.sun.star.text.TextField.DateTime"
):
i
.
setPropertyValue
(
"IsFixed"
,
False
)
i
.
setPropertyValue
(
"DateTimeValue"
,
dt
)
try
:
i
.
setPropertyValue
(
"IsFixed"
,
False
)
i
.
setPropertyValue
(
"DateTimeValue"
,
dt
)
except
RuntimeException
:
pass
except
Exception
:
traceback
.
print_exc
()
def
fixDateFields
(
self
,
_bSetFixed
):
try
:
for
i
in
self
.
arrayTextFields
:
for
i
in
TextFieldHandler
.
arrayTextFields
:
if
i
.
supportsService
(
"com.sun.star.text.TextField.DateTime"
):
i
.
setPropertyValue
(
"IsFixed"
,
_bSetFixed
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment