summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx12
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.hxx2
2 files changed, 10 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index f1a6da4f3f47..5440afbed3aa 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -538,7 +538,7 @@ void RtfAttributeOutput::EndRuby(const SwTextNode& /*rNode*/, sal_Int32 /*nPos*/
bool RtfAttributeOutput::StartURL(const OUString& rUrl, const OUString& rTarget)
{
- m_sURL = rUrl;
+ m_aURLs.push(rUrl);
// Ignore hyperlink without a URL.
if (!rUrl.isEmpty())
{
@@ -568,7 +568,13 @@ bool RtfAttributeOutput::StartURL(const OUString& rUrl, const OUString& rTarget)
bool RtfAttributeOutput::EndURL(bool const isAtEndOfParagraph)
{
- if (!m_sURL.isEmpty())
+ if (m_aURLs.empty())
+ {
+ return true;
+ }
+
+ const OUString& rURL = m_aURLs.top();
+ if (!rURL.isEmpty())
{
// UGLY: usually EndRun is called earlier, but there is an extra
// call to OutAttrWithRange() when at the end of the paragraph,
@@ -588,8 +594,8 @@ bool RtfAttributeOutput::EndURL(bool const isAtEndOfParagraph)
// close the field group
m_aRun->append('}');
}
- m_sURL.clear();
}
+ m_aURLs.pop();
return true;
}
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index a7f95813c2c0..6c1ccdf135fd 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -623,7 +623,7 @@ private:
std::optional<css::drawing::FillStyle> m_oFillStyle;
/// If we're in the process of exporting a hyperlink, then its URL.
- OUString m_sURL;
+ std::stack<OUString> m_aURLs;
/// If original file had \sbauto.
bool m_bParaBeforeAutoSpacing;