[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/source

Michael Stahl mstahl at redhat.com
Tue Dec 16 12:31:33 PST 2014


 sw/source/core/txtnode/ndtxt.cxx |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 7f2ed29e1ca7782358f8dcc14f8c773c9bba3544
Author: Michael Stahl <mstahl at redhat.com>
Date:   Mon Dec 15 22:01:09 2014 +0100

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 0fbcf46..0c1d094 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());


More information about the Libreoffice-commits mailing list