summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8
diff options
context:
space:
mode:
authorRavindra Vidhate <ravindra.vidhate@synerzip.com>2014-04-21 16:32:58 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-04-30 07:58:40 +0000
commit74126c42c309d3166235748980ee5e1e4a5fecb0 (patch)
treefc5a052d348835f76e9eff9ea761d127f6c6ad6a /sw/source/filter/ww8
parent76715b105fcfeffa140b03fb54d5c0846db1fba2 (diff)
fdo#77725 LO not able to open/save file when exported multiple times.
Problem description: The LO is not able to save the file if exported multiple times and the exported file is used as input. The main root cause is Extra Line breaks getting added even though there is no text available. Change-Id: I0afb52380912cae140d7ded694cb7cae9a8362a9 Reviewed-on: https://gerrit.libreoffice.org/9112 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/ww8')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 1bc6305d33c3..7fd9a37eba7d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1610,7 +1610,7 @@ void DocxAttributeOutput::FootnoteEndnoteRefTag()
1, meaning that it skips one character after the text. This is to make
the switch in DocxAttributeOutput::RunText() nicer ;-)
*/
-static void impl_WriteRunText( FSHelperPtr pSerializer, sal_Int32 nTextToken,
+static bool impl_WriteRunText( FSHelperPtr pSerializer, sal_Int32 nTextToken,
const sal_Unicode* &rBegin, const sal_Unicode* pEnd, bool bMove = true )
{
const sal_Unicode *pBegin = rBegin;
@@ -1620,7 +1620,7 @@ static void impl_WriteRunText( FSHelperPtr pSerializer, sal_Int32 nTextToken,
rBegin = pEnd + 1;
if ( pBegin >= pEnd )
- return; // we want to write at least one character
+ return false; // we want to write at least one character
// we have to add 'preserve' when starting/ending with space
if ( *pBegin == ' ' || *( pEnd - 1 ) == ' ' )
@@ -1633,6 +1633,8 @@ static void impl_WriteRunText( FSHelperPtr pSerializer, sal_Int32 nTextToken,
pSerializer->writeEscaped( OUString( pBegin, pEnd - pBegin ) );
pSerializer->endElementNS( XML_w, nTextToken );
+
+ return true;
}
void DocxAttributeOutput::RunText( const OUString& rText, rtl_TextEncoding /*eCharSet*/ )
@@ -1660,8 +1662,10 @@ void DocxAttributeOutput::RunText( const OUString& rText, rtl_TextEncoding /*eCh
m_pSerializer->singleElementNS( XML_w, XML_tab, FSEND );
break;
case 0x0b: // line break
- impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt );
- m_pSerializer->singleElementNS( XML_w, XML_br, FSEND );
+ {
+ if (impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt ))
+ m_pSerializer->singleElementNS( XML_w, XML_br, FSEND );
+ }
break;
case 0x1E: //non-breaking hyphen
impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt );