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
93bed66a
Kaydet (Commit)
93bed66a
authored
Ock 19, 2013
tarafından
Xisco Fauli
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
pyagenda: Fix a problem with template's sections
Change-Id: Ifbd5ba9800c1b52b2f0ed929b8919ff60fc48120
üst
c71a811b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
24 deletions
+44
-24
AgendaDocument.py
wizards/com/sun/star/wizards/agenda/AgendaDocument.py
+21
-9
FileAccess.py
wizards/com/sun/star/wizards/common/FileAccess.py
+10
-0
TextSectionHandler.py
wizards/com/sun/star/wizards/text/TextSectionHandler.py
+6
-5
ControlScroller.py
wizards/com/sun/star/wizards/ui/ControlScroller.py
+7
-10
No files found.
wizards/com/sun/star/wizards/agenda/AgendaDocument.py
Dosyayı görüntüle @
93bed66a
...
...
@@ -20,6 +20,7 @@ import traceback
from
..text.TextElement
import
TextElement
from
..text.TextDocument
import
TextDocument
from
..text.TextSectionHandler
import
TextSectionHandler
from
..common.FileAccess
import
FileAccess
from
datetime
import
date
as
dateTimeObject
...
...
@@ -87,6 +88,9 @@ class AgendaDocument(TextDocument):
self
.
allItems
=
[]
def
load
(
self
,
templateURL
,
topics
):
#Each template is duplicated. aw-XXX.ott is the template itself
#and XXX.ott is a section link.
self
.
template
=
self
.
calcTemplateName
(
templateURL
)
self
.
loadAsPreview
(
templateURL
,
False
)
self
.
xFrame
.
ComponentWindow
.
Enable
=
False
self
.
xTextDocument
.
lockControllers
()
...
...
@@ -94,6 +98,16 @@ class AgendaDocument(TextDocument):
self
.
initializeData
(
topics
)
self
.
xTextDocument
.
unlockControllers
()
'''
The agenda templates are in format of aw-XXX.ott
the templates name is then XXX.ott.
This method calculates it.
'''
def
calcTemplateName
(
self
,
url
):
return
FileAccess
.
connectURLs
(
FileAccess
.
getParentDir
(
url
),
FileAccess
.
getFilename
(
url
)[
3
:])
'''synchronize the document to the model.<br/>
this method rewrites all titles, item tables , and the topics table-
thus synchronizing the document to the data model (CGAgenda).
...
...
@@ -104,7 +118,7 @@ class AgendaDocument(TextDocument):
def
initializeData
(
self
,
topicsData
):
for
i
in
self
.
itemsTables
:
try
:
i
.
write
(
""
)
i
.
write
()
except
Exception
:
traceback
.
print_exc
()
...
...
@@ -125,7 +139,7 @@ class AgendaDocument(TextDocument):
# get the table in which the item is...
itemsTable
=
self
.
itemsMap
[
itemName
]
# rewrite the table.
itemsTable
.
write
(
None
)
itemsTable
.
write
()
except
Exception
:
traceback
.
print_exc
()
self
.
xTextDocument
.
unlockControllers
()
...
...
@@ -346,10 +360,10 @@ class AgendaDocument(TextDocument):
return
self
.
getNamesWhichStartWith
(
allSections
,
s
)
def
getSection
(
self
,
name
):
return
getattr
(
self
.
xTextDocument
.
TextSections
,
name
)
return
self
.
xTextDocument
.
TextSections
.
getByName
(
name
)
def
getTable
(
self
,
name
):
return
getattr
(
self
.
xTextDocument
.
TextTables
,
name
)
return
self
.
xTextDocument
.
TextTables
.
getByName
(
name
)
def
redrawTitle
(
self
,
controlName
):
try
:
...
...
@@ -652,19 +666,17 @@ class ItemsTable(object):
then, starting at cell one, write all items that should be visible.
then clear the rest and remove obsolete rows.
If no items are visible, hide the section.
@param dummy we need a param to make this an Implementation
of AgendaElement.
@throws Exception
'''
def
write
(
self
,
dummy
):
def
write
(
self
):
name
=
self
.
section
.
Name
# link and unlink the section to the template.
self
.
agenda
.
textSectionHandler
.
linkSectiontoTemplate
(
self
.
agenda
.
template
,
name
,
self
.
section
)
self
.
agenda
.
textSectionHandler
.
breakLinkOfTextSection
(
self
.
section
)
# we need to get a instance after linking.
# we need to get a instance after linking
ItemsTable
.
table
=
self
.
agenda
.
getTable
(
name
)
self
.
section
=
self
.
agenda
.
getSection
(
name
)
cursor
=
ItemsTable
.
table
.
createCursorByCellName
(
"A1"
)
...
...
wizards/com/sun/star/wizards/common/FileAccess.py
Dosyayı görüntüle @
93bed66a
...
...
@@ -251,3 +251,13 @@ class FileAccess(object):
while
url
[
-
1
]
==
"/"
:
url
=
hello
[:
-
1
]
return
url
[:
url
.
rfind
(
"/"
)]
@classmethod
def
connectURLs
(
self
,
urlFolder
,
urlFilename
):
stringFolder
=
""
stringFileName
=
urlFilename
if
not
urlFolder
.
endswith
(
"/"
):
stringFolder
=
"/"
if
urlFilename
.
startswith
(
"/"
):
stringFileName
=
urlFilename
[
1
:]
return
urlFolder
+
stringFolder
+
stringFileName
wizards/com/sun/star/wizards/text/TextSectionHandler.py
Dosyayı görüntüle @
93bed66a
...
...
@@ -85,22 +85,23 @@ class TextSectionHandler(object):
oSectionLink
=
\
uno
.
createUnoStruct
(
'com.sun.star.text.SectionFileLink'
)
oSectionLink
.
FileURL
=
""
oTextSection
.
FileLink
=
oSectionLink
oTextSection
.
LinkRegion
=
""
uno
.
invoke
(
oTextSection
,
"setPropertyValues"
,
((
"FileLink"
,
"LinkRegion"
),
(
oSectionLink
,
""
)))
except
Exception
:
traceback
.
print_exc
()
def
linkSectiontoTemplate
(
self
,
TemplateName
,
SectionName
,
oTextSection
=
None
):
try
:
if
oTextSection
is
not
None
:
if
not
oTextSection
:
oTextSection
=
self
.
xTextDocument
.
TextSections
.
getByName
(
SectionName
)
oSectionLink
=
\
uno
.
createUnoStruct
(
'com.sun.star.text.SectionFileLink'
)
oSectionLink
.
FileURL
=
TemplateName
oTextSection
.
FileLink
=
oSectionLink
oTextSection
.
LinkRegion
=
SectionName
uno
.
invoke
(
oTextSection
,
"setPropertyValues"
,
((
"FileLink"
,
"LinkRegion"
),
(
oSectionLink
,
SectionName
)))
NewSectionName
=
oTextSection
.
Name
if
NewSectionName
is
not
SectionName
:
oTextSection
.
Name
=
SectionName
...
...
wizards/com/sun/star/wizards/ui/ControlScroller.py
Dosyayı görüntüle @
93bed66a
...
...
@@ -139,8 +139,7 @@ class ControlScroller(object):
def
toggleComponent
(
self
,
_bdoenable
):
bdoenable
=
_bdoenable
and
\
(
self
.
ntotfieldcount
>
ControlScroller
.
nblockincrement
)
ControlScroller
.
CurUnoDialog
.
setControlProperty
(
"TitleScrollBar"
+
self
.
sincSuffix
,
setattr
(
"TitleScrollBar"
+
self
.
sincSuffix
,
PropertyNames
.
PROPERTY_ENABLED
,
bdoenable
)
def
toggleControls
(
self
,
_bdoenable
):
...
...
@@ -150,8 +149,8 @@ class ControlScroller(object):
m
=
0
while
m
<
curproperties
.
length
:
curproperty
=
curproperties
[
m
]
ControlScroller
.
CurUnoDialog
.
setControlProperty
(
curproperty
.
Name
,
PropertyNames
.
PROPERTY_ENABLED
,
_bdoenable
)
setattr
(
curproperty
.
Name
,
PropertyNames
.
PROPERTY_ENABLED
,
_bdoenable
)
m
+=
1
n
+=
1
...
...
@@ -209,18 +208,16 @@ class ControlScroller(object):
oControlModel
=
ControlScroller
.
CurUnoDialog
.
xUnoDialog
.
getControl
(
controlname
)
.
Model
propertyname
=
UnoDialog
.
getDisplayProperty
(
oControlModel
)
if
propertyname
!=
""
:
ControlScroller
.
CurUnoDialog
.
setControlProperty
(
controlname
,
propertyname
,
newvalue
)
if
propertyname
:
setattr
(
controlname
,
propertyname
,
newvalue
)
@classmethod
def
getControlData
(
self
,
controlname
):
oControlModel
=
ControlScroller
.
CurUnoDialog
.
xUnoDialog
.
getControl
(
controlname
)
.
Model
propertyname
=
UnoDialog
.
getDisplayProperty
(
oControlModel
)
if
propertyname
!=
""
:
return
ControlScroller
.
CurUnoDialog
.
getControlProperty
(
controlname
,
propertyname
)
if
propertyname
:
return
getattr
(
controlname
,
propertyname
)
else
:
return
None
...
...
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