ODPresentation Writer : Fixed a link to another slide - #908
Merged
Conversation
dkulyk
force-pushed
the
fix/odp-slide-link
branch
from
August 22, 2026 10:47
a130016 to
bbcd87b
Compare
…ders A hyperlink created with `setSlideNumber()` stores the PowerPoint action string `ppaction://hlinksldjump`, which the ODPresentation Writer wrote verbatim into `xlink:href`. ODF has never heard of it, so the link opened nothing: the reader resolved it as an unknown URI. ODF addresses a slide by the name of its page, so the Writer now writes `#<page name>` and every page carries a `draw:name`. A slide with no name of its own is named after its position, as `Slide N` -- not as `pageN`, the form LibreOffice generates for its own exported pages and refuses to resolve a link to. Neither Reader recognised such a link either, so the slide number never survived a round trip. The PowerPoint2007 Reader returned the raw part name, `slide2.xml`, and the ODPresentation Reader the raw `#Name`. Both now resolve the target back to its number.
dkulyk
force-pushed
the
fix/odp-slide-link
branch
from
August 23, 2026 19:21
bbcd87b to
514a008
Compare
Progi1984
approved these changes
Aug 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A hyperlink created with
setSlideNumber()stores the PowerPoint action stringppaction://hlinksldjump, and the ODPresentation Writer wrote it verbatim intoxlink:href. ODF has never heard of that string, so the link opened nothing -- converted to PDF it comes out as/A<</Type/Action/S/URI/URI(ppaction://hlinksldjump)>>, an unresolvable URI rather than a jump.ODF addresses a slide by the name of its page, so the Writer now writes
#<page name>, and everydraw:pagecarries adraw:nameso that a link can reach it. A slide with no name of its own is named after its position, asSlide N. Not aspageN: LibreOffice generates exactly that form for the pages it exports and treats it as its own, so a link to#page3is left unresolved -- I probed the three forms and only the non-pageNones produce a real destination. With the fix both#Milestone Overviewand#Slide 3come out as/Dest[9 0 R/FitR 0 0 720 541.417].If the slide number points outside the deck there is nothing to address, so the value is left as it was rather than pointing nowhere.
Neither Reader recognised such a link either, so the number never survived a round trip and the fixed Writer alone could not carry a link across a format conversion. The PowerPoint2007 Reader stored the raw part name,
slide2.xml, as the URL; the ODPresentation Reader stored the raw#Name. Both now resolve the target back to its number -- the PowerPoint2007 Reader from thesliderelationship plus theactionattribute, the ODPresentation Reader from a pre-pass over the page names, collected before any slide is read because a link can point forwards.One existing expectation changed as a consequence:
ContentTest::testSlideNameasserted that an unnamed slide gets nodraw:name, and now every page has one. A save/load round trip therefore gives a previously unnamed slide the nameSlide N-- the same thing that already happens with any ODP produced by LibreOffice.Checklist: