* 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:
依瑪貓 2017-11-29 17:35:54 +08:00
parent cfefc23df1
commit a17ddfab0a
4 changed files with 7 additions and 7 deletions

View File

@ -464,7 +464,7 @@ Function fnFindPokemonGOIVSheet (sPokemon As String) As Object
If IsNull (oDoc) Then
oDoc = StarDesktop.loadComponentFromURL ( _
"private:factory/scalc", "_default", 0, mProps)
oDoc.setTitle (sDocTitle)
oDoc.getDocumentProperties.Title = sDocTitle
oSheets = oDoc.getSheets
mNames = oSheets.getElementNames
oSheets.insertNewByName (sPokemon, 0)
@ -494,7 +494,7 @@ Function fnFindDocByTitle (sTitle) As Object
oDoc = oEnum.nextElement
If oDoc.supportsService ( _
"com.sun.star.sheet.SpreadsheetDocument") Then
If oDoc.getTitle = sTitle Then
If oDoc.getDocumentProperties.Title = sTitle Then
fnFindDocByTitle = oDoc
Exit Function
End If

View File

@ -1 +1 @@
0.8.1
0.8.2

View File

@ -2,8 +2,8 @@
<description xmlns="http://openoffice.org/extensions/update/2006"
xmlns:xlink="http://www.w3.org/1999/xlink">
<identifier value="tw.idv.imacat.office.pokemongoiv" />
<version value="0.8.1" />
<version value="0.8.2" />
<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>
</description>

View File

@ -466,7 +466,7 @@ Function fnFindPokemonGOIVSheet (sPokemon As String) As Object
If IsNull (oDoc) Then
oDoc = StarDesktop.loadComponentFromURL ( _
&quot;private:factory/scalc&quot;, &quot;_default&quot;, 0, mProps)
oDoc.setTitle (sDocTitle)
oDoc.getDocumentProperties.Title = sDocTitle
oSheets = oDoc.getSheets
mNames = oSheets.getElementNames
oSheets.insertNewByName (sPokemon, 0)
@ -496,7 +496,7 @@ Function fnFindDocByTitle (sTitle) As Object
oDoc = oEnum.nextElement
If oDoc.supportsService ( _
&quot;com.sun.star.sheet.SpreadsheetDocument&quot;) Then
If oDoc.getTitle = sTitle Then
If oDoc.getDocumentProperties.Title = sTitle Then
fnFindDocByTitle = oDoc
Exit Function
End If