summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-04-22 14:49:41 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-04-22 15:08:48 +0200
commit55c832d86e6cb06e9d6423ce5e6245189bc80da1 (patch)
treee9ab7eb07320462856c2c8167e03fb4c04a0e58a /sw/source/filter/ww8
parent5c6b74f24494a0426067dfcb54b7b8fb0e01c821 (diff)
fdo#77600 RTF export: always close URL's before the end of run
In case the URL text has multiple portions, then MSWordExportBase generates multiple URL's anyway, and this helps to avoid loosing some direct formatting of the remaining portions of the paragraph. Change-Id: Ifd72741de610ce69b9ae0978aa8f9a532a3aeed2
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx9
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.hxx2
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 0185a015425b..862b1283e458 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -413,6 +413,8 @@ void RtfAttributeOutput::StartRun( const SwRedlineData* pRedlineData, bool bSing
void RtfAttributeOutput::EndRun()
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
+ if (m_bInURL)
+ EndURL();
m_aRun->append(SAL_NEWLINE_STRING);
m_aRun.appendAndClear(m_aRunText);
if (!m_bSingleEmptyRun && m_bInRun)
@@ -493,6 +495,7 @@ bool RtfAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarget
m_aStyles.append("}");
m_bHadFieldResult = false;
+ m_bInURL = true;
return true;
}
@@ -500,6 +503,11 @@ bool RtfAttributeOutput::EndURL()
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
+ if (m_bInURL)
+ m_bInURL = false;
+ else
+ return true;
+
// close the fldrslt group
if (m_bHadFieldResult)
m_aRunText->append('}');
@@ -3361,6 +3369,7 @@ RtfAttributeOutput::RtfAttributeOutput( RtfExport &rExport )
m_aCells(),
m_bSingleEmptyRun(false),
m_bInRun(false),
+ m_bInURL(false),
m_pFlyFrameSize(0),
m_pPrevPageDesc(0)
{
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index 0d00506b2ede..fbb191a49e91 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -586,6 +586,8 @@ private:
bool m_bInRun;
+ bool m_bInURL;
+
/// Maps ID's to postit fields, used in atrfstart/end and atnref.
std::map<sal_uInt16, const SwPostItField*> m_aPostitFields;