[Libreoffice-commits] core.git: sw/qa sw/source

Mike Kaganski mike.kaganski at collabora.com
Tue Nov 10 04:35:05 PST 2015


 sw/qa/extras/uiwriter/uiwriter.cxx          |    2 ++
 sw/source/filter/ww8/rtfattributeoutput.cxx |    6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit a6ae84cc296d4d28e9a48a57406e955138c87a80
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Sun Nov 1 10:03:50 2015 +1000

    tdf#70318: Prevent extra empty paragraph in clipboard RTF content
    
    Change-Id: Icbd163bac65cbb9e4ad59697b87f6c979ecb41cc
    Reviewed-on: https://gerrit.libreoffice.org/19718
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index b9b3e93..3049531 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -527,6 +527,8 @@ void SwUiWriterTest::testExportRTF()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aData.indexOf("aaa"));
     CPPUNIT_ASSERT(aData.indexOf("bbb") != -1);
     CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), aData.indexOf("ccc"));
+    // Ensure there's no extra newline
+    CPPUNIT_ASSERT(aData.endsWith(OString("bbb}") + OString(SAL_NEWLINE_STRING) + OString("}")));
 }
 
 void SwUiWriterTest::testFdo74981()
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 52cdf24..47f63db 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -273,9 +273,9 @@ void RtfAttributeOutput::StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNo
 void RtfAttributeOutput::EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner)
 {
     bool bLastPara = false;
-    if (m_rExport.m_nTextTyp == TXT_FTN || m_rExport.m_nTextTyp == TXT_EDN)
+    if (m_rExport.m_nTextTyp == TXT_FTN || m_rExport.m_nTextTyp == TXT_EDN || m_rExport.m_pDoc->IsClipBoard())
     {
-        // We're ending a paragraph that is the last paragraph of a footnote or endnote.
+        // We're ending a paragraph that is the last paragraph of a footnote or endnote, or of clipboard.
         bLastPara = m_rExport.m_nCurrentNodeIndex && m_rExport.m_nCurrentNodeIndex == m_rExport.m_pCurPam->End()->nNode.GetIndex();
     }
 
@@ -290,7 +290,7 @@ void RtfAttributeOutput::EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t pTex
     else
     {
         aParagraph->append(SAL_NEWLINE_STRING);
-        // RTF_PAR at the end of the footnote would cause an additional empty paragraph.
+        // RTF_PAR at the end of the footnote or clipboard, would cause an additional empty paragraph.
         if (!bLastPara)
         {
             aParagraph->append(OOO_STRING_SVTOOLS_RTF_PAR);


More information about the Libreoffice-commits mailing list