summaryrefslogtreecommitdiff
path: root/sw/source/core/fields/authfld.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/fields/authfld.cxx')
-rw-r--r--sw/source/core/fields/authfld.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index f57603509fd2..934f06f1243b 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -25,6 +25,7 @@
#include <i18nlangtag/languagetag.hxx>
#include <o3tl/any.hxx>
#include <osl/diagnose.h>
+#include <tools/urlobj.hxx>
#include <swtypes.hxx>
#include <strings.hrc>
#include <authfld.hxx>
@@ -42,6 +43,7 @@
#include <IDocumentLayoutAccess.hxx>
#include <unofldmid.h>
#include <unoprnms.hxx>
+#include <docsh.hxx>
#include <com/sun/star/beans/PropertyValues.hpp>
@@ -610,6 +612,16 @@ bool SwAuthorityField::HasURL() const
return !rURL.isEmpty();
}
+OUString SwAuthorityField::GetAbsoluteURL() const
+{
+ const OUString& rURL = GetAuthEntry()->GetAuthorField(AUTH_FIELD_URL);
+ SwDoc* pDoc = static_cast<SwAuthorityFieldType*>(GetTyp())->GetDoc();
+ SwDocShell* pDocShell = pDoc->GetDocShell();
+ OUString aBasePath = pDocShell->getDocumentBaseURL();
+ return INetURLObject::GetAbsURL(aBasePath, rURL, INetURLObject::EncodeMechanism::WasEncoded,
+ INetURLObject::DecodeMechanism::WithCharset);
+}
+
void SwAuthorityField::dumpAsXml(xmlTextWriterPtr pWriter) const
{
(void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwAuthorityField"));