summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-12-15 22:01:09 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-12-16 20:31:02 +0000
commit7f2ed29e1ca7782358f8dcc14f8c773c9bba3544 (patch)
treedca223c5340b6daf2b83647ef2c33a2141d3a892
parentf9c9517cae3441d2cc9aa5d09fcd8dbb042e48e7 (diff)
fdo#85876: sw: fix attributes when splitting paragraph
fdo#74981: sw: fix input field handling when splitting paragraphs The SwInputFld is copied because it doesn't have HasDummyChar() set although it has 2 dummy characters; TODO why is that... Change-Id: Iee91c1d0cf7a7a928e7383c1839f8192e8d4d5b0 (cherry picked from commit a1718045bd6218e07caebda7c4cacdcb853eabd3) fdo#85876: Revert "fdo#74981: cutting nothing should do nothing, ... ... should fix field dupes" This reverts commit f384598d8eec91c3c0f84a07ff3e59b8e3e13b3f. The attributes have to be copied in case splitting a paragraph creates an empty paragraph. Change-Id: Icd5730dd9ab8a68f737492645988a4d2f07af7a0 (cherry picked from commit 0f78ae1ca33f83737553ad204c869a63498b7d2d) Reviewed-on: https://gerrit.libreoffice.org/13486 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 0fbcf4617ecf..0c1d094304b8 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1491,11 +1491,12 @@ void SwTxtNode::CopyAttr( SwTxtNode *pDest, const sal_Int32 nTxtStartIdx,
const sal_Int32 *const pEndIdx = pHt->GetEnd();
if ( pEndIdx && !pHt->HasDummyChar() )
{
- if ( ( *pEndIdx > nTxtStartIdx
- || ( *pEndIdx == nTxtStartIdx
- && nAttrStartIdx == nTxtStartIdx ) ) )
+ sal_uInt16 const nWhich = pHt->Which();
+ if (RES_TXTATR_INPUTFIELD != nWhich // fdo#74981 skip fields
+ && ( *pEndIdx > nTxtStartIdx
+ || (*pEndIdx == nTxtStartIdx
+ && nAttrStartIdx == nTxtStartIdx)))
{
- sal_uInt16 const nWhich = pHt->Which();
if ( RES_TXTATR_REFMARK != nWhich )
{
// attribute in the area => copy
@@ -1926,8 +1927,6 @@ OUString SwTxtNode::InsertText( const OUString & rStr, const SwIndex & rIdx,
void SwTxtNode::CutText( SwTxtNode * const pDest,
const SwIndex & rStart, const sal_Int32 nLen )
{
- if(nLen == 0)
- return;
if(pDest)
{
SwIndex aDestStt(pDest, pDest->GetTxt().getLength());