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

Miklos Vajna vmiklos at suse.cz
Mon Jul 15 02:21:34 PDT 2013


 sw/source/ui/uiview/formatclipboard.cxx |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

New commits:
commit 09b20c794a6647d3dd364e0f12d139532a1689bd
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Jul 12 16:02:43 2013 +0200

    bnc#828598 fdo#59643 SwFormatClipboard: fix undo of paragraph attributes
    
    Paragraph attributes were set directly on the SwTxtNodes, instead of
    going through SwWrtShell::SetAttr(), which handles undo/redo.
    
    Regression from 357fac9713875302d30185feabaf5c165e040ca4.
    
    (cherry picked from commit b1cd73d3e62c5192bc3d77f5ecd1036ff42bde61)
    
    Change-Id: I5dc86e20e3c006dab60a075355ce9ad1f1b67bb6
    Reviewed-on: https://gerrit.libreoffice.org/4868
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit 5156749cde88c5274b36a22dab7b561d59b93cf1)
    Reviewed-on: https://gerrit.libreoffice.org/4871
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Reviewed-by: Petr Mladek <pmladek at suse.cz>
    Tested-by: Petr Mladek <pmladek at suse.cz>

diff --git a/sw/source/ui/uiview/formatclipboard.cxx b/sw/source/ui/uiview/formatclipboard.cxx
index 5dd7ef2..f7e41a6 100644
--- a/sw/source/ui/uiview/formatclipboard.cxx
+++ b/sw/source/ui/uiview/formatclipboard.cxx
@@ -538,19 +538,8 @@ void SwFormatClipboard::Paste( SwWrtShell& rWrtShell, SfxStyleSheetBasePool* pPo
             // remove attribute that were applied by named text and paragraph formatting
             lcl_RemoveEqualItems( *pTemplateItemSet, aItemVector );
 
-            // it can't be a multiple selection
-            SwPaM* pCrsr = rWrtShell.GetCrsr();
-
             // apply the paragraph automatic attributes to all the nodes in the selection
-            for (SwNodeIndex pNodeIndexIterator = pCrsr->Start()->nNode,
-                             pNodeIndexEnd = pCrsr->End()->nNode;
-                    pNodeIndexIterator != pNodeIndexEnd;
-                    ++pNodeIndexIterator )
-            {
-                pNodeIndexIterator.GetNode().GetCntntNode()->SetAttr( *pTemplateItemSet );
-            }
-            // same as pCrsr->End()->nNode.GetNode().GetCntntNode()->SetAttr
-            pCrsr->GetCntntNode()->SetAttr( *pTemplateItemSet );
+            rWrtShell.SetAttr(*pTemplateItemSet);
 
             // store the attributes in aItemVector in order not to apply them as
             // text automatic formating attributes later in the code


More information about the Libreoffice-commits mailing list