[Libreoffice-commits] .: sw/source

Miklos Vajna vmiklos at kemper.freedesktop.org
Sat Dec 17 17:34:44 PST 2011


 sw/source/filter/ww8/rtfattributeoutput.cxx |    8 ++++++--
 sw/source/filter/ww8/rtfattributeoutput.hxx |    4 ++++
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 6ab183533ef543ea96e15fcc5155321298c758a8
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Sun Dec 18 02:33:54 2011 +0100

    fdo#37498 RTF export: handle url fields without a field result

diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 2cd6033..17b2de3 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -460,6 +460,7 @@ bool RtfAttributeOutput::StartURL( const String& rUrl, const String& rTarget )
     }
 
     m_aStyles.append("}");
+    m_bHadFieldResult = false;
     return true;
 }
 
@@ -468,7 +469,8 @@ bool RtfAttributeOutput::EndURL()
     OSL_TRACE("%s", OSL_THIS_FUNC);
 
     // close the fldrslt group
-    m_aRunText.append('}');
+    if (m_bHadFieldResult)
+        m_aRunText.append('}');
     // close the field group
     m_aRunText.append('}');
     return true;
@@ -2249,6 +2251,7 @@ void RtfAttributeOutput::TextINetFormat( const SwFmtINetFmt& rURL )
         const SwTxtINetFmt* pTxtAtr = rURL.GetTxtINetFmt();
 
         m_aStyles.append("{" OOO_STRING_SVTOOLS_RTF_FLDRSLT " ");
+        m_bHadFieldResult = true;
         if( pTxtAtr && 0 != ( pFmt = pTxtAtr->GetCharFmt() ))
         {
             sal_uInt16 nStyle = m_rExport.GetId( *pFmt );
@@ -2989,7 +2992,8 @@ RtfAttributeOutput::RtfAttributeOutput( RtfExport &rExport )
     m_bBufferSectionBreaks( false ),
     m_bBufferSectionHeaders( false ),
     m_bLastTable( true ),
-    m_bWroteCellInfo( false )
+    m_bWroteCellInfo( false ),
+    m_bHadFieldResult( false )
 {
     OSL_TRACE("%s", OSL_THIS_FUNC);
 }
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index 856b14f..c96de2c 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -529,6 +529,10 @@ private:
      */
     bool m_bWroteCellInfo;
 
+    /*
+     * If we had a field result in the URL.
+     */
+    bool m_bHadFieldResult;
 public:
     RtfAttributeOutput( RtfExport &rExport );
 


More information about the Libreoffice-commits mailing list