From b3df7ae1d27b0613acbda65908a513a1462e7a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sat, 10 Jun 2017 09:10:12 +0800 Subject: [PATCH] Fixed the problem with localized formula function names, for Deutsch translation. --- PokemonGoIV/2Report.vb | 31 +++++++++++++++++++++---------- oxt/PokemonGoIV/2Report.xba | 23 +++++++++++++++++++++-- 2 files changed, 42 insertions(+), 12 deletions(-) diff --git a/PokemonGoIV/2Report.vb b/PokemonGoIV/2Report.vb index 6ed4095..9635aff 100644 --- a/PokemonGoIV/2Report.vb +++ b/PokemonGoIV/2Report.vb @@ -59,7 +59,7 @@ Sub subCreateReport ( _ aBaseStats As aStats, aQuery As aFindIVParam, maIVs () As aIV) Dim oDoc As Object, oSheet As Object Dim oRange As Object, oColumns As Object, oRows As Object - Dim oCell As Object, sFormula As String + Dim oCell As Object, sFormula As String, sFormulaLocal As String Dim nI As Integer, nJ As Integer, nCol As Integer Dim nLeadCols As Integer, nTotalCols As Integer Dim nEvolved As Integer, fMaxLevel As Double @@ -180,8 +180,10 @@ Sub subCreateReport ( _ sFormula = "=(" & sColIVAttack & "+" & sColIVDefense _ & "+" & sColIVStamina & ")/45" oCell.setFormula (sFormula) - sFormula = oCell.getPropertyValue ("FormulaLocal") - oCell.setPropertyValue ("FormulaLocal", sFormula) + sFormulaLocal = oCell.getPropertyValue ("FormulaLocal") + If sFormulaLocal <> sFormula Then + oCell.setPropertyValue ("FormulaLocal", sFormulaLocal) + End If nCol = nLeadCols If aBaseStats.bIsLastForm Then @@ -189,8 +191,10 @@ Sub subCreateReport ( _ sFormula = fnGetCPFormula (aBaseStats, _ sColIVAttack, sColIVDefense, sColIVStamina, sMaxCPM) oCell.setFormula (sFormula) - sFormula = oCell.getPropertyValue ("FormulaLocal") - oCell.setPropertyValue ("FormulaLocal", sFormula) + sFormulaLocal = oCell.getPropertyValue ("FormulaLocal") + If sFormulaLocal <> sFormula Then + oCell.setPropertyValue ("FormulaLocal", sFormulaLocal) + End If nCol = nCol + 1 End If For nJ = 0 To nEvolved - 1 @@ -198,16 +202,23 @@ Sub subCreateReport ( _ sFormula = fnGetCPFormula (maEvBaseStats (nJ), _ sColIVAttack, sColIVDefense, sColIVStamina, sCPM) oCell.setFormula (sFormula) - sFormula = oCell.getPropertyValue ("FormulaLocal") - oCell.setPropertyValue ("FormulaLocal", sFormula) + sFormulaLocal = oCell.getPropertyValue ("FormulaLocal") + If sFormulaLocal <> sFormula Then + oCell.setPropertyValue ("FormulaLocal", sFormulaLocal) + End If nCol = nCol + 1 If maEvBaseStats (nJ).bIsLastForm Then oCell = oSheet.getCellByPosition (nCol, nI + 1) sFormula = fnGetCPFormula (maEvBaseStats (nJ), _ - sColIVAttack, sColIVDefense, sColIVStamina, sMaxCPM) + sColIVAttack, sColIVDefense, _ + sColIVStamina, sMaxCPM) oCell.setFormula (sFormula) - sFormula = oCell.getPropertyValue ("FormulaLocal") - oCell.setPropertyValue ("FormulaLocal", sFormula) + sFormulaLocal = oCell.getPropertyValue ( _ + "FormulaLocal") + If sFormulaLocal <> sFormula Then + oCell.setPropertyValue ( _ + "FormulaLocal", sFormulaLocal) + End If nCol = nCol + 1 End If Next nJ diff --git a/oxt/PokemonGoIV/2Report.xba b/oxt/PokemonGoIV/2Report.xba index 32e0d18..b6caf95 100644 --- a/oxt/PokemonGoIV/2Report.xba +++ b/oxt/PokemonGoIV/2Report.xba @@ -61,7 +61,7 @@ Sub subCreateReport ( _ aBaseStats As aStats, aQuery As aFindIVParam, maIVs () As aIV) Dim oDoc As Object, oSheet As Object Dim oRange As Object, oColumns As Object, oRows As Object - Dim oCell As Object, sFormula As String + Dim oCell As Object, sFormula As String, sFormulaLocal As String Dim nI As Integer, nJ As Integer, nCol As Integer Dim nLeadCols As Integer, nTotalCols As Integer Dim nEvolved As Integer, fMaxLevel As Double @@ -182,6 +182,10 @@ Sub subCreateReport ( _ sFormula = "=(" & sColIVAttack & "+" & sColIVDefense _ & "+" & sColIVStamina & ")/45" oCell.setFormula (sFormula) + sFormulaLocal = oCell.getPropertyValue ("FormulaLocal") + If sFormulaLocal <> sFormula Then + oCell.setPropertyValue ("FormulaLocal", sFormulaLocal) + End If nCol = nLeadCols If aBaseStats.bIsLastForm Then @@ -189,6 +193,10 @@ Sub subCreateReport ( _ sFormula = fnGetCPFormula (aBaseStats, _ sColIVAttack, sColIVDefense, sColIVStamina, sMaxCPM) oCell.setFormula (sFormula) + sFormulaLocal = oCell.getPropertyValue ("FormulaLocal") + If sFormulaLocal <> sFormula Then + oCell.setPropertyValue ("FormulaLocal", sFormulaLocal) + End If nCol = nCol + 1 End If For nJ = 0 To nEvolved - 1 @@ -196,12 +204,23 @@ Sub subCreateReport ( _ sFormula = fnGetCPFormula (maEvBaseStats (nJ), _ sColIVAttack, sColIVDefense, sColIVStamina, sCPM) oCell.setFormula (sFormula) + sFormulaLocal = oCell.getPropertyValue ("FormulaLocal") + If sFormulaLocal <> sFormula Then + oCell.setPropertyValue ("FormulaLocal", sFormulaLocal) + End If nCol = nCol + 1 If maEvBaseStats (nJ).bIsLastForm Then oCell = oSheet.getCellByPosition (nCol, nI + 1) sFormula = fnGetCPFormula (maEvBaseStats (nJ), _ - sColIVAttack, sColIVDefense, sColIVStamina, sMaxCPM) + sColIVAttack, sColIVDefense, _ + sColIVStamina, sMaxCPM) oCell.setFormula (sFormula) + sFormulaLocal = oCell.getPropertyValue ( _ + "FormulaLocal") + If sFormulaLocal <> sFormula Then + oCell.setPropertyValue ( _ + "FormulaLocal", sFormulaLocal) + End If nCol = nCol + 1 End If Next nJ