Skip to content

Commit

Permalink
Merge branch 'i3683' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
jcsteh committed Feb 19, 2016
2 parents 0feb4fe + b2c5c8c commit f3dfee5
Show file tree
Hide file tree
Showing 7 changed files with 1,109 additions and 435 deletions.
106 changes: 104 additions & 2 deletions source/NVDAObjects/window/excel.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,98 @@
xlCellTypeSameValidation =-4175 # from enum XlCellType
xlCellTypeVisible =12 # from enum XlCellType

#Excel Cell Patterns (from enum XlPattern)
xlPatternAutomatic = -4105
xlPatternChecker = 9
xlPatternCrissCross = 16
xlPatternDown = -4121
xlPatternGray16 = 17
xlPatternGray25 = -4124
xlPatternGray50 = -4125
xlPatternGray75 = -4126
xlPatternGray8 = 18
xlPatternGrid = 15
xlPatternHorizontal = -4128
xlPatternLightDown = 13
xlPatternLightHorizontal = 11
xlPatternLightUp = 14
xlPatternLightVertical = 12
xlPatternNone = -4142
xlPatternSemiGray75 = 10
xlPatternSolid = 1
xlPatternUp = -4162
xlPatternVertical = -4166
xlPatternLinearGradient = 4000
xlPatternRectangularGradient = 4001

backgroundPatternLabels={
# See https://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.xlpattern.aspx
# Translators: A type of background pattern in Microsoft Excel.
# Excel controls the pattern.
xlPatternAutomatic:_("automatic"),
# Translators: A type of background pattern in Microsoft Excel.
# Checkerboard
xlPatternChecker:_("checker"),
# Translators: A type of background pattern in Microsoft Excel.
# Criss-cross lines
xlPatternCrissCross:_("crisscross"),
# Translators: A type of background pattern in Microsoft Excel.
# Dark diagonal lines running from the upper left to the lower right
xlPatternDown:_("down"),
# Translators: A type of background pattern in Microsoft Excel.
# 16% gray
xlPatternGray16:_("gray16"),
# Translators: A type of background pattern in Microsoft Excel.
# 25% gray
xlPatternGray25:_("gray25"),
# Translators: A type of background pattern in Microsoft Excel.
# 50% gray
xlPatternGray50:_("gray50"),
# Translators: A type of background pattern in Microsoft Excel.
# 75% gray
xlPatternGray75:_("gray75"),
# Translators: A type of background pattern in Microsoft Excel.
# 8% gray
xlPatternGray8:_("gray8"),
# Translators: A type of background pattern in Microsoft Excel.
# Grid
xlPatternGrid:_("grid"),
# Translators: A type of background pattern in Microsoft Excel.
# Dark horizontal lines
xlPatternHorizontal:_("horizontal"),
# Translators: A type of background pattern in Microsoft Excel.
# Light diagonal lines running from the upper left to the lower right
xlPatternLightDown:_("light down"),
# Translators: A type of background pattern in Microsoft Excel.
# Light horizontal lines
xlPatternLightHorizontal:_("light horizontal"),
# Translators: A type of background pattern in Microsoft Excel.
# Light diagonal lines running from the lower left to the upper right
xlPatternLightUp:_("light up"),
# Translators: A type of background pattern in Microsoft Excel.
# Light vertical bars
xlPatternLightVertical:_("light vertical"),
# Translators: A type of background pattern in Microsoft Excel.
# No pattern
xlPatternNone:_("none"),
# Translators: A type of background pattern in Microsoft Excel.
# 75% dark moire
xlPatternSemiGray75:_("semi gray75"),
# Translators: A type of background pattern in Microsoft Excel.
# Solid color
xlPatternSolid:_("solid"),
# Translators: A type of background pattern in Microsoft Excel.
# Dark diagonal lines running from the lower left to the upper right
xlPatternUp:_("up"),
# Translators: A type of background pattern in Microsoft Excel.
# Dark vertical bars
xlPatternVertical:_("vertical"),
# Translators: A type of background pattern in Microsoft Excel.
xlPatternLinearGradient:_("linear gradient"),
# Translators: A type of background pattern in Microsoft Excel.
xlPatternRectangularGradient:_("rectangular gradient"),
}

re_RC=re.compile(r'R(?:\[(\d+)\])?C(?:\[(\d+)\])?')
re_absRC=re.compile(r'^R(\d+)C(\d+)(?::R(\d+)C(\d+))?$')

Expand Down Expand Up @@ -779,7 +871,11 @@ class ExcelCellTextInfo(NVDAObjectTextInfo):

def _getFormatFieldAndOffsets(self,offset,formatConfig,calculateOffsets=True):
formatField=textInfos.FormatField()
fontObj=self.obj.excelCellObject.font
if (self.obj.excelCellObject.Application.Version > "12.0"):
cellObj=self.obj.excelCellObject.DisplayFormat
else:
cellObj=self.obj.excelCellObject
fontObj=cellObj.font
if formatConfig['reportAlignment']:
value=alignmentLabels.get(self.obj.excelCellObject.horizontalAlignment)
if value:
Expand Down Expand Up @@ -809,7 +905,13 @@ def _getFormatFieldAndOffsets(self,offset,formatConfig,calculateOffsets=True):
except COMError:
pass
try:
formatField['background-color']=colors.RGB.fromCOLORREF(int(self.obj.excelCellObject.interior.color))
pattern = cellObj.Interior.Pattern
formatField['background-pattern'] = backgroundPatternLabels.get(pattern)
if pattern in (xlPatternLinearGradient, xlPatternRectangularGradient):
formatField['background-color']=(colors.RGB.fromCOLORREF(int(cellObj.Interior.Gradient.ColorStops(1).Color)))
formatField['background-color2']=(colors.RGB.fromCOLORREF(int(cellObj.Interior.Gradient.ColorStops(2).Color)))
else:
formatField['background-color']=colors.RGB.fromCOLORREF(int(cellObj.interior.color))
except COMError:
pass
return formatField,(self._startOffset,self._endOffset)
Expand Down
4 changes: 2 additions & 2 deletions source/locale/fa/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: NVDA master-9280,3350d74\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-02-05 00:10+1000\n"
"PO-Revision-Date: 2016-02-12 15:06+0330\n"
"PO-Revision-Date: 2016-02-14 19:32+0330\n"
"Last-Translator: Mohammadreza Rashad <mohammadreza5712@gmail.com>\n"
"Language-Team: NVDA Translation Team <nvda-translations@freelists.org>\n"
"Language: fa\n"
Expand Down Expand Up @@ -6327,7 +6327,7 @@ msgstr "&حذف کردن"

#. Translators: The label of a button in Add-ons Manager to open the Add-ons website and get more add-ons.
msgid "&Get add-ons..."
msgstr "&دریافتِ افزونه های بیشتر..."
msgstr "دریافتِ افزونه های بی&شتر..."

#. Translators: The message displayed in the dialog that allows you to choose an add-on package for installation.
msgid "Choose Add-on Package File"
Expand Down
8 changes: 4 additions & 4 deletions source/locale/fr/LC_MESSAGES/nvda.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ msgstr ""
"Project-Id-Version: NVDA bzr main:11331\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-02-05 00:10+1000\n"
"PO-Revision-Date: 2016-02-03 19:16+0100\n"
"PO-Revision-Date: 2016-02-15 12:09+0100\n"
"Last-Translator: Bachir BENANOU <ben_bach@yahoo.fr>\n"
"Language-Team: fra <LL@li.org>\n"
"Language: fr_FR\n"
Expand Down Expand Up @@ -2942,8 +2942,8 @@ msgid ""
"Cycles through audio ducking modes which determine when NVDA lowers the "
"volume of other sounds"
msgstr ""
"Bascule des modes d'atténuation audio pour déterminer comment NVDA "
"atténue le volume des autres sons"
"Bascule des modes d'atténuation audio pour déterminer comment NVDA atténue "
"le volume des autres sons"

#. Translators: This will be presented when the input help is toggled.
msgid "input help on"
Expand Down Expand Up @@ -5077,7 +5077,7 @@ msgstr "Hauteur"

#. Translators: Label for a setting in voice settings dialog.
msgid "&Inflection"
msgstr "&inflexion"
msgstr "&Inflexion"

#. Translators: Label for a setting in synth settings ring.
msgctxt "synth setting"
Expand Down
Loading

0 comments on commit f3dfee5

Please sign in to comment.