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
f13b1b61
Kaydet (Commit)
f13b1b61
authored
Eki 16, 2002
tarafından
Behrend Cornelius
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#104114# creation of new document modified
üst
005ffe4c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
115 additions
and
110 deletions
+115
-110
AutoText.xba
wizards/source/gimmicks/AutoText.xba
+53
-51
GetTexts.xba
wizards/source/gimmicks/GetTexts.xba
+46
-45
ReadDir.xba
wizards/source/gimmicks/ReadDir.xba
+16
-14
No files found.
wizards/source/gimmicks/AutoText.xba
Dosyayı görüntüle @
f13b1b61
...
@@ -23,66 +23,68 @@ Dim n, m, iAutoCount as Integer
...
@@ -23,66 +23,68 @@ Dim n, m, iAutoCount as Integer
sDocumentTitle =
"
Installed AutoTexts
"
sDocumentTitle =
"
Installed AutoTexts
"
'
Open a new empty document
'
Open a new empty document
oDocument = StarDesktop.LoadComponentFromURL(
"
private:factory/swriter
"
,
"
_blank
"
,0,NoArgs)
oDocument = CreateNewDocument(
"
swriter
"
)
oDocument.DocumentInfo.Title = sDocumentTitle
If Not IsNull(oDocument) Then
oDocuText = oDocument.Text
oDocument.DocumentInfo.Title = sDocumentTitle
oDocuText = oDocument.Text
'
Create The Character-templates
'
Create The Character-templates
oCharStyles = oDocument.StyleFamilies.GetByName(
"
CharacterStyles
"
)
oCharStyles = oDocument.StyleFamilies.GetByName(
"
CharacterStyles
"
)
'
The Characterstyle for the Header that describes the Title of Autotextgroups
'
The Characterstyle for the Header that describes the Title of Autotextgroups
oGroupTitleStyle = oDocument.createInstance(
"
com.sun.star.style.CharacterStyle
"
)
oGroupTitleStyle = oDocument.createInstance(
"
com.sun.star.style.CharacterStyle
"
)
oCharStyles.InsertbyName(
"
AutoTextGroupTitle
"
, oGroupTitleStyle)
oCharStyles.InsertbyName(
"
AutoTextGroupTitle
"
, oGroupTitleStyle)
oGroupTitleStyle.CharWeight = com.sun.star.awt.FontWeight.BOLD
oGroupTitleStyle.CharWeight = com.sun.star.awt.FontWeight.BOLD
oGroupTitleStyle.CharHeight = 14
oGroupTitleStyle.CharHeight = 14
'
The Characterstyle for the Header that describes the Title of Autotextgroups
'
The Characterstyle for the Header that describes the Title of Autotextgroups
oHeaderStyle = oDocument.createInstance(
"
com.sun.star.style.CharacterStyle
"
)
oHeaderStyle = oDocument.createInstance(
"
com.sun.star.style.CharacterStyle
"
)
oCharStyles.InsertbyName(
"
AutoTextHeading
"
, oHeaderStyle)
oCharStyles.InsertbyName(
"
AutoTextHeading
"
, oHeaderStyle)
oHeaderStyle.CharWeight = com.sun.star.awt.FontWeight.BOLD
oHeaderStyle.CharWeight = com.sun.star.awt.FontWeight.BOLD
'
"
Ordinary
"
Table Content
'
"
Ordinary
"
Table Content
oContentStyle = oDocument.createInstance(
"
com.sun.star.style.CharacterStyle
"
)
oContentStyle = oDocument.createInstance(
"
com.sun.star.style.CharacterStyle
"
)
oCharStyles.InsertbyName(
"
TableContent
"
, oContentStyle)
oCharStyles.InsertbyName(
"
TableContent
"
, oContentStyle)
oAutoTextContainer = CreateUnoService(
"
com.sun.star.text.AutoTextContainer
"
)
oAutoTextContainer = CreateUnoService(
"
com.sun.star.text.AutoTextContainer
"
)
oAutoTextCursor = oDocuText.CreateTextCursor()
oAutoTextCursor = oDocuText.CreateTextCursor()
oAutoTextCursor.CharStyleName =
"
AutoTextGroupTitle
"
oAutoTextCursor.CharStyleName =
"
AutoTextGroupTitle
"
'
Link the Title with the following table
'
Link the Title with the following table
oAutoTextCursor.ParaKeepTogether = True
oAutoTextCursor.ParaKeepTogether = True
For n = 0 To oAutoTextContainer.Count - 1
For n = 0 To oAutoTextContainer.Count - 1
oAutoGroup = oAutoTextContainer.GetByIndex(n)
oAutoGroup = oAutoTextContainer.GetByIndex(n)
oAutoTextCursor.SetString(oAutoGroup.Title)
oAutoTextCursor.SetString(oAutoGroup.Title)
oAutoTextCursor.CollapseToEnd()
oAutoTextCursor.CollapseToEnd()
oDocuText.insertControlCharacter(oAutoTextCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
oDocuText.insertControlCharacter(oAutoTextCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
oTable = oDocument.CreateInstance(
"
com.sun.star.text.TextTable
"
)
oTable = oDocument.CreateInstance(
"
com.sun.star.text.TextTable
"
)
'
Divide the table if necessary
'
Divide the table if necessary
oTable.Split = True
oTable.Split = True
'
oTable.KeepTogether = False
'
oTable.KeepTogether = False
oTable.RepeatHeadLine = True
oTable.RepeatHeadLine = True
oAutoTextCursor.Text.InsertTextContent(oAutoTextCursor,oTable,False)
oAutoTextCursor.Text.InsertTextContent(oAutoTextCursor,oTable,False)
InsertStringToCell(
"
AutoText Name
"
,oTable.GetCellbyPosition(0,0),
"
AutoTextHeading
"
)
InsertStringToCell(
"
AutoText Name
"
,oTable.GetCellbyPosition(0,0),
"
AutoTextHeading
"
)
InsertStringToCell(
"
AutoText Shortcut
"
,oTable.GetCellbyPosition(1,0),
"
AutoTextHeading
"
)
InsertStringToCell(
"
AutoText Shortcut
"
,oTable.GetCellbyPosition(1,0),
"
AutoTextHeading
"
)
'
Insert one row at the bottom of the table
'
Insert one row at the bottom of the table
oRows = oTable.Rows
oRows = oTable.Rows
iAutoCount = oAutoGroup.Count
iAutoCount = oAutoGroup.Count
For m = 0 To iAutoCount-1
For m = 0 To iAutoCount-1
'
Insert the name and the title of all Autotexts
'
Insert the name and the title of all Autotexts
oAutoText = oAutoGroup.GetByIndex(m)
oAutoText = oAutoGroup.GetByIndex(m)
InsertStringToCell(oAutoGroup.Titles(m), oTable.GetCellbyPosition(0, m + 1),
"
TableContent
"
)
InsertStringToCell(oAutoGroup.Titles(m), oTable.GetCellbyPosition(0, m + 1),
"
TableContent
"
)
InsertStringToCell(oAutoGroup.ElementNames(m), oTable.GetCellbyPosition(1, m + 1),
"
TableContent
"
)
InsertStringToCell(oAutoGroup.ElementNames(m), oTable.GetCellbyPosition(1, m + 1),
"
TableContent
"
)
If m
<
iAutoCount-1 Then
If m
<
iAutoCount-1 Then
oRows.InsertbyIndex(m + 2,1)
oRows.InsertbyIndex(m + 2,1)
End If
End If
Next m
Next m
oDocuText.insertControlCharacter(oAutoTextCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
oDocuText.insertControlCharacter(oAutoTextCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
oAutoTextCursor.CollapseToEnd()
oAutoTextCursor.CollapseToEnd()
Next n
Next n
End If
End Sub
End Sub
...
...
wizards/source/gimmicks/GetTexts.xba
Dosyayı görüntüle @
f13b1b61
...
@@ -31,52 +31,53 @@ Dim oCharStyles as Object
...
@@ -31,52 +31,53 @@ Dim oCharStyles as Object
On Local Error Goto 0
On Local Error Goto 0
'
Open a new document where all the texts are inserted
'
Open a new document where all the texts are inserted
oLogDocument = StarDesktop.LoadComponentFromURL(
"
private:factory/swriter
"
,
"
_blank
"
,0,NoArgs())
oLogDocument = CreateNewDocument(
"
swriter
"
)
oLogText = oLogDocument.Text
If Not IsNull(oLogDocument) Then
oLogText = oLogDocument.Text
'
create and define the character styles of the Log-document
oCharStyles = oLogDocument.StyleFamilies.GetByName(
"
CharacterStyles
"
)
'
create and define the character styles of the Log-document
oLogHeaderStyle = oLogDocument.createInstance(
"
com.sun.star.style.CharacterStyle
"
)
oCharStyles = oLogDocument.StyleFamilies.GetByName(
"
CharacterStyles
"
)
oCharStyles.InsertbyName(
"
Log Header
"
, oLogHeaderStyle)
oLogHeaderStyle = oLogDocument.createInstance(
"
com.sun.star.style.CharacterStyle
"
)
oCharStyles.InsertbyName(
"
Log Header
"
, oLogHeaderStyle)
oLogHeaderStyle.charWeight = com.sun.star.awt.FontWeight.BOLD
oLogBodyTextStyle = oLogDocument.createInstance(
"
com.sun.star.style.CharacterStyle
"
)
oLogHeaderStyle.charWeight = com.sun.star.awt.FontWeight.BOLD
oCharStyles.InsertbyName(
"
Log Body
"
, oLogBodyTextStyle)
oLogBodyTextStyle = oLogDocument.createInstance(
"
com.sun.star.style.CharacterStyle
"
)
oCharStyles.InsertbyName(
"
Log Body
"
, oLogBodyTextStyle)
'
Insert the title of the activated document as a hyperlink
oHyperCursor = oLogText.createTextCursor()
'
Insert the title of the activated document as a hyperlink
oHyperCursor.CharWeight = com.sun.star.awt.FontWeight.BOLD
oHyperCursor = oLogText.createTextCursor()
oHyperCursor.gotoStart(False)
oHyperCursor.CharWeight = com.sun.star.awt.FontWeight.BOLD
oHyperCursor.HyperLinkURL = oDocument.URL
oHyperCursor.gotoStart(False)
oHyperCursor.HyperLinkTarget = oDocument.URL
oHyperCursor.HyperLinkURL = oDocument.URL
If oDocument.DocumentInfo.Title
<>
""
Then
oHyperCursor.HyperLinkTarget = oDocument.URL
oHyperCursor.HyperlinkName = oDocument.DocumentInfo.Title
If oDocument.DocumentInfo.Title
<>
""
Then
oHyperCursor.HyperlinkName = oDocument.DocumentInfo.Title
End If
oLogText.insertString(oHyperCursor, oDocument.DocumentInfo.Title, False)
oLogText.insertControlCharacter(oHyperCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
oLogCursor = oLogText.createTextCursor()
oLogCursor.GotoEnd(False)
'
"
Switch off
"
the Hyperlink - Properties
oLogCursor.SetPropertyToDefault(
"
HyperLinkURL
"
)
oLogCursor.SetPropertyToDefault(
"
HyperLinkTarget
"
)
oLogCursor.SetPropertyToDefault(
"
HyperLinkName
"
)
LogIndex = 0
'
Get the Properties of the document Info
GetDocumentInfo()
Select Case sDocType
Case
"
swriter
"
GetWriterStrings()
Case
"
scalc
"
GetCalcStrings()
Case
"
sdraw
"
GetDrawStrings()
Case Else
Msgbox(
"
This macro only works with a Writer, Calc or Draw/Impress document.
"
, 16, GetProductName())
End Select
End If
End If
oLogText.insertString(oHyperCursor, oDocument.DocumentInfo.Title, False)
oLogText.insertControlCharacter(oHyperCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
oLogCursor = oLogText.createTextCursor()
oLogCursor.GotoEnd(False)
'
"
Switch off
"
the Hyperlink - Properties
oLogCursor.SetPropertyToDefault(
"
HyperLinkURL
"
)
oLogCursor.SetPropertyToDefault(
"
HyperLinkTarget
"
)
oLogCursor.SetPropertyToDefault(
"
HyperLinkName
"
)
LogIndex = 0
'
Get the Properties of the document Info
GetDocumentInfo()
Select Case sDocType
Case
"
swriter
"
GetWriterStrings()
Case
"
scalc
"
GetCalcStrings()
Case
"
sdraw
"
GetDrawStrings()
Case Else
Msgbox(
"
This macro only works with a Writer, Calc or Draw/Impress document.
"
, 16, GetProductName())
End Select
End Sub
End Sub
...
...
wizards/source/gimmicks/ReadDir.xba
Dosyayı görüntüle @
f13b1b61
...
@@ -39,20 +39,22 @@ Dim oPage As Object
...
@@ -39,20 +39,22 @@ Dim oPage As Object
Sub Main()
Sub Main()
Dim oStandardTemplate as Object
Dim oStandardTemplate as Object
BasicLibraries.LoadLibrary(
"
Tools
"
)
BasicLibraries.LoadLibrary(
"
Tools
"
)
oDocument = StarDesktop.LoadComponentFromURL(
"
private:factory/sdraw
"
,
"
_blank
"
,0, NoArgs())
oDocument = CreateNewDocument(
"
sdraw
"
)
oPage = oDocument.DrawPages(0)
If Not IsNull(oDocument) Then
oStandardTemplate = oDocument.StyleFamilies.GetByName(
"
graphics
"
).GetByName(
"
standard
"
)
oPage = oDocument.DrawPages(0)
oStandardTemplate.CharHeight = 10
oStandardTemplate = oDocument.StyleFamilies.GetByName(
"
graphics
"
).GetByName(
"
standard
"
)
oStandardTemplate.TextLeftDistance = 100
oStandardTemplate.CharHeight = 10
oStandardTemplate.TextRightDistance = 100
oStandardTemplate.TextLeftDistance = 100
oStandardTemplate.TextUpperDistance = 50
oStandardTemplate.TextRightDistance = 100
oStandardTemplate.TextLowerDistance = 50
oStandardTemplate.TextUpperDistance = 50
DlgReadDir = LoadDialog(
"
Gimmicks
"
,
"
ReadFolderDlg
"
)
oStandardTemplate.TextLowerDistance = 50
oProgressBar = DlgReadDir.Model.ProgressBar1
DlgReadDir = LoadDialog(
"
Gimmicks
"
,
"
ReadFolderDlg
"
)
DlgReadDir.Model.TextField1.Text = ConvertFromUrl(GetPathSettings(
"
Work
"
))
oProgressBar = DlgReadDir.Model.ProgressBar1
DlgReadDir.Model.cmdGoOn.DefaultButton = True
DlgReadDir.Model.TextField1.Text = ConvertFromUrl(GetPathSettings(
"
Work
"
))
DlgReadDir.GetControl(
"
TextField1
"
).SetFocus()
DlgReadDir.Model.cmdGoOn.DefaultButton = True
DlgReadDir.Execute
DlgReadDir.GetControl(
"
TextField1
"
).SetFocus()
DlgReadDir.Execute
End If
End Sub
End Sub
...
...
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