Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style hashes incomplete, causing loss of styles. #46

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyexcelerate/Alignment.py
Expand Up @@ -80,7 +80,7 @@ def __eq__(self, other):
return self._vertical == other._vertical and self._rotation == other._rotation and self._horizontal == other._horizontal and self._wrap_text == other._wrap_text

def __hash__(self):
return hash((self._horizontal))
return hash((self._horizontal, self._vertical, self._rotation, self._wrap_text))

def __str__(self):
return "Align: %s %s %s" % (self._horizontal, self._vertical, self._rotation)
Expand Down
2 changes: 1 addition & 1 deletion pyexcelerate/Border.py
Expand Up @@ -60,4 +60,4 @@ def __eq__(self, other):
return self._color == other._color and self._style == other._style

def __hash__(self):
return hash(self._style)
return hash((self._color, self._style))
2 changes: 1 addition & 1 deletion pyexcelerate/Borders.py
Expand Up @@ -92,4 +92,4 @@ def __eq__(self, other):
return self._right == other._right and self._bottom == other._bottom and self._top == other._top and self._left == other._left

def __hash__(self):
return hash((self._top, self._left))
return hash((self._top, self._left, self._bottom, self._right))
2 changes: 1 addition & 1 deletion pyexcelerate/Font.py
Expand Up @@ -68,7 +68,7 @@ def __eq__(self, other):
return self._to_tuple() == other._to_tuple()

def __hash__(self):
return hash((self.bold, self.italic, self.underline, self.strikethrough))
return hash((self.bold, self.italic, self.underline, self.strikethrough, self.family, self.size, self._color))

def _to_tuple(self):
return (self.bold, self.italic, self.underline, self.strikethrough, self.family, self.size, self._color)
Expand Down
2 changes: 1 addition & 1 deletion pyexcelerate/Style.py
Expand Up @@ -78,7 +78,7 @@ def get_xml_string(self):
return "<xf xfId=\"0\" %s applyAlignment=\"1\">%s</xf>" % (" ".join(tag), self._alignment.get_xml_string())

def __hash__(self):
return hash((self._font, self._fill))
return hash((self._font, self._fill, self._format, self._alignment, self._borders, self._size))

def __eq__(self, other):
if other is None:
Expand Down