diff options
author | Tibor Nagy <nagy.tibor2@nisz.hu> | 2022-06-01 16:10:42 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2022-06-23 16:20:43 +0200 |
commit | 4142d728f003166ebe520bfdaf672505e585b807 (patch) | |
tree | e38448c2049625d604ce68ed41b6329278d0938a /oox/source | |
parent | 05299b4205fa0960c3b2ed55a8c4963ee76238be (diff) |
tdf#149314 PPTX import: fix internal hyperlink in editor
Hyperlinks on text weren't imported correctly if the linked
slides have default slide name, resulting broken links
in the editor (hyperlinks work well in slide shows without
this fix, too).
Change-Id: I797fa94134c1346bc83729c713e65b2a268a14c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135245
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/helper/ooxresid.cxx | 1 | ||||
-rw-r--r-- | oox/source/ppt/presentationfragmenthandler.cxx | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/oox/source/helper/ooxresid.cxx b/oox/source/helper/ooxresid.cxx index 58e0e8cb33e0..6ad02a70b056 100644 --- a/oox/source/helper/ooxresid.cxx +++ b/oox/source/helper/ooxresid.cxx @@ -12,5 +12,6 @@ #include <unotools/resmgr.hxx> OUString OoxResId(TranslateId aId) { return Translate::get(aId, Translate::Create("oox")); } +OUString URLResId(TranslateId aId) { return Translate::get(aId, Translate::Create("sd")); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 43b7f105a1c4..ac1e32e533ec 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -60,6 +60,8 @@ #include <com/sun/star/office/XAnnotation.hpp> #include <com/sun/star/office/XAnnotationAccess.hpp> +#include <ooxresid.hxx> +#include <strings.hrc> using namespace ::com::sun::star; using namespace ::oox::core; @@ -197,7 +199,10 @@ static void ResolveTextFields( XmlFilterBase const & rFilter ) xDrawPage = xPresentationPage->getNotesPage(); } Reference< container::XNamed > xNamed( xDrawPage, UNO_QUERY_THROW ); - aURL = "#" + xNamed->getName(); + if (!xNamed->getName().startsWith("page")) + aURL = "#" + xNamed->getName(); + else + aURL = "#" + URLResId(STR_SLIDE_NAME) + " " + OUString::number(nPageNumber); xPropSet->setPropertyValue( sURL, Any( aURL ) ); Reference< text::XTextContent > xContent( rTextField.xTextField); Reference< text::XTextRange > xTextRange = rTextField.xTextCursor; |