* Updated to check and set the title in the DocumentProperties instead of the document title. This prevents error and preserves the document to be reuse even after saving to the disk. The title of the document itself should not be messed-up.
* Advanced to version 0.8.2.
This commit is contained in:
parent
cfefc23df1
commit
a17ddfab0a
@ -464,7 +464,7 @@ Function fnFindPokemonGOIVSheet (sPokemon As String) As Object
|
|||||||
If IsNull (oDoc) Then
|
If IsNull (oDoc) Then
|
||||||
oDoc = StarDesktop.loadComponentFromURL ( _
|
oDoc = StarDesktop.loadComponentFromURL ( _
|
||||||
"private:factory/scalc", "_default", 0, mProps)
|
"private:factory/scalc", "_default", 0, mProps)
|
||||||
oDoc.setTitle (sDocTitle)
|
oDoc.getDocumentProperties.Title = sDocTitle
|
||||||
oSheets = oDoc.getSheets
|
oSheets = oDoc.getSheets
|
||||||
mNames = oSheets.getElementNames
|
mNames = oSheets.getElementNames
|
||||||
oSheets.insertNewByName (sPokemon, 0)
|
oSheets.insertNewByName (sPokemon, 0)
|
||||||
@ -494,7 +494,7 @@ Function fnFindDocByTitle (sTitle) As Object
|
|||||||
oDoc = oEnum.nextElement
|
oDoc = oEnum.nextElement
|
||||||
If oDoc.supportsService ( _
|
If oDoc.supportsService ( _
|
||||||
"com.sun.star.sheet.SpreadsheetDocument") Then
|
"com.sun.star.sheet.SpreadsheetDocument") Then
|
||||||
If oDoc.getTitle = sTitle Then
|
If oDoc.getDocumentProperties.Title = sTitle Then
|
||||||
fnFindDocByTitle = oDoc
|
fnFindDocByTitle = oDoc
|
||||||
Exit Function
|
Exit Function
|
||||||
End If
|
End If
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
<description xmlns="http://openoffice.org/extensions/update/2006"
|
<description xmlns="http://openoffice.org/extensions/update/2006"
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
<identifier value="tw.idv.imacat.office.pokemongoiv" />
|
<identifier value="tw.idv.imacat.office.pokemongoiv" />
|
||||||
<version value="0.8.1" />
|
<version value="0.8.2" />
|
||||||
<update-download>
|
<update-download>
|
||||||
<src xlink:href="https://sourceforge.net/projects/aoo-extensions/files/18585/29/pokemongoiv.oxt" />
|
<src xlink:href="https://sourceforge.net/projects/aoo-extensions/files/18585/30/pokemongoiv.oxt" />
|
||||||
</update-download>
|
</update-download>
|
||||||
</description>
|
</description>
|
||||||
|
@ -466,7 +466,7 @@ Function fnFindPokemonGOIVSheet (sPokemon As String) As Object
|
|||||||
If IsNull (oDoc) Then
|
If IsNull (oDoc) Then
|
||||||
oDoc = StarDesktop.loadComponentFromURL ( _
|
oDoc = StarDesktop.loadComponentFromURL ( _
|
||||||
"private:factory/scalc", "_default", 0, mProps)
|
"private:factory/scalc", "_default", 0, mProps)
|
||||||
oDoc.setTitle (sDocTitle)
|
oDoc.getDocumentProperties.Title = sDocTitle
|
||||||
oSheets = oDoc.getSheets
|
oSheets = oDoc.getSheets
|
||||||
mNames = oSheets.getElementNames
|
mNames = oSheets.getElementNames
|
||||||
oSheets.insertNewByName (sPokemon, 0)
|
oSheets.insertNewByName (sPokemon, 0)
|
||||||
@ -496,7 +496,7 @@ Function fnFindDocByTitle (sTitle) As Object
|
|||||||
oDoc = oEnum.nextElement
|
oDoc = oEnum.nextElement
|
||||||
If oDoc.supportsService ( _
|
If oDoc.supportsService ( _
|
||||||
"com.sun.star.sheet.SpreadsheetDocument") Then
|
"com.sun.star.sheet.SpreadsheetDocument") Then
|
||||||
If oDoc.getTitle = sTitle Then
|
If oDoc.getDocumentProperties.Title = sTitle Then
|
||||||
fnFindDocByTitle = oDoc
|
fnFindDocByTitle = oDoc
|
||||||
Exit Function
|
Exit Function
|
||||||
End If
|
End If
|
||||||
|
Loading…
Reference in New Issue
Block a user