Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
openpyxl
openpyxl
Commits
f93b9befd58a
Commit
630d6bf6
authored
Jul 22, 2020
by
CharlieC
Browse files
Create copies of hyperlinks when working with ranges
Resolves
#1502
--HG-- branch : 3.0
parent
3b8c78939a77
Changes
3
Show whitespace changes
Inline
Side-by-side
openpyxl/worksheet/_reader.py
View file @
f93b9bef
# Copyright (c) 2010-2020 openpyxl
"""Reader for a single worksheet."""
import
traceback
from
copy
import
copy
from
warnings
import
warn
# compatibility imports
...
...
@@ -384,7 +384,7 @@ class WorksheetReader(object):
for
row
in
self
.
ws
[
link
.
ref
]:
for
cell
in
row
:
try
:
cell
.
hyperlink
=
link
cell
.
hyperlink
=
copy
(
link
)
except
AttributeError
:
pass
else
:
...
...
openpyxl/worksheet/hyperlink.py
View file @
f93b9bef
...
...
@@ -49,7 +49,6 @@ class HyperlinkList(Serialisable):
return
bool
(
self
.
hyperlink
)
def
__len__
(
self
):
return
len
(
self
.
hyperlink
)
...
...
openpyxl/worksheet/tests/test_reader.py
View file @
f93b9bef
...
...
@@ -865,6 +865,7 @@ class TestWorksheetReader:
reader
.
bind_hyperlinks
()
assert
ws
[
'B4'
].
hyperlink
.
location
==
"'STP nn000TL-10, PKG 2.52'!A1"
assert
ws
[
'B4'
].
hyperlink
.
ref
==
"B4"
def
test_merged_hyperlinks
(
self
,
PrimedWorksheetReader
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment