[Libreoffice-commits] .: 3 commits - sw/source vcl/source

Michael Stahl mst at kemper.freedesktop.org
Wed Feb 22 15:05:09 PST 2012


 sw/source/core/doc/doclay.cxx         |    3 +++
 sw/source/core/docnode/ndcopy.cxx     |    2 +-
 sw/source/core/unocore/unotext.cxx    |    6 ------
 vcl/source/glyphs/graphite_layout.cxx |    2 +-
 4 files changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 91fab30f3b1617024ee2eadf3c7ad1ea84d7f6dd
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Feb 22 23:58:04 2012 +0100

    fdo#46482: prevent duplication of frames:
    
    SwDoc::MakeFlySection: abuse the SwDoc::mbRedlineMove flag, which
    (with the fix for fdo#40599) does exactly what is necessary to prevent
    the spurious copies.
    Also, remove the ugly hack to work around this problem from
    SwXText::convertToTextFrame.

diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 17264ca..c184135 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -840,8 +840,10 @@ if( GetIDocumentUndoRedo().DoesUndo() )
                 SwPaM* pTmp = (SwPaM*)&rPam;
                 sal_Bool bOldFlag = mbCopyIsMove;
                 bool const bOldUndo = GetIDocumentUndoRedo().DoesUndo();
+                bool const bOldRedlineMove(IsRedlineMove());
                 mbCopyIsMove = sal_True;
                 GetIDocumentUndoRedo().DoUndo(false);
+                SetRedlineMove(true);
                 do {
                     if( pTmp->HasMark() &&
                         *pTmp->GetPoint() != *pTmp->GetMark() )
@@ -850,6 +852,7 @@ if( GetIDocumentUndoRedo().DoesUndo() )
                     }
                     pTmp = static_cast<SwPaM*>(pTmp->GetNext());
                 } while ( &rPam != pTmp );
+                SetRedlineMove(bOldRedlineMove);
                 mbCopyIsMove = bOldFlag;
                 GetIDocumentUndoRedo().DoUndo(bOldUndo);
 
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 2c25700..c83d243 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1720,12 +1720,6 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
                         SwFmtAnchor aAnchor((*i)->GetAnchor());
                         aAnchor.SetAnchor(aMovePam.Start());
                         m_pImpl->m_pDoc->SetAttr(aAnchor, *(*i));
-
-                        // delete the old anchor
-                        SwSpzFrmFmts* pFrmFmts = m_pImpl->m_pDoc->GetSpzFrmFmts();
-                        // here we rely on that fact that this is a sorted list, where the last element is the newly created frame
-                        SwFrmFmt *pFrmFmt = (*pFrmFmts)[pFrmFmts->Count()-1];
-                        m_pImpl->m_pDoc->DelLayoutFmt(pFrmFmt);
                     }
                 }
             }
commit 23e52c207760c596cc2f841ef59f3100c110d591
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Feb 22 23:48:57 2012 +0100

    fdo#40599 i#112763: fix frame duplication:
    
    SwDoc::CopyFlyInFlyImpl: When called from SwRedline::CopyToSection, do not
    copy frames that are anchored at the redline end node by checking
    IsRedlineMove(); these frames are not deleted by DelCopyOfSection and were
    thus duplicated on every Show/Hide redlines.
    (regression from 62ebbb006b4a11974e14dd61d3c453a98336f951 (CWS os131))

diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 07bf4a4..2461505 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -1431,7 +1431,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg,
             bool bAdd = false;
             if( pAPos->nNode < rRg.aEnd )
                 bAdd = true;
-            if( !bAdd )
+            if (!bAdd && !IsRedlineMove()) // fdo#40599: not for redline move
             {
                 bool bEmptyNode = false;
                 bool bLastNode = false;
commit d066f7e4afb3c9e395932ba7bf8715ad0770bcdd
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Feb 22 23:48:52 2012 +0100

    vcl: crash in GraphiteLayout::expandOrCondense:
    
    When printing the bugdoc from i#103958:
    
        error: attempt to subscript container with out-of-bounds index 5, but
        container only holds 5 elements.
    
    #4  0x00007fd37902be5e in GraphiteLayout::expandOrCondense (this=0x35296a8, rArgs=...) at vcl/source/glyphs/graphite_layout.cxx:848
    #5  0x00007fd37902bc54 in GraphiteLayout::AdjustLayout (this=0x35296a8, rArgs=...) at vcl/source/glyphs/graphite_layout.cxx:812
    #6  0x00007fd3790345c8 in GraphiteServerFontLayout::AdjustLayout (this=0x3529640, rArgs=...) at vcl/inc/graphite_serverfont.hxx:76
    #7  0x00007fd378d5c91d in OutputDevice::forceFallbackFontToFit (this=0x35022c0, rFallback=..., rFallbackFont=..., rFontSelData=..., nFallbackLevel=1, rLayoutArgs=..., rOrigMetric=...) at vcl/source/gdi/outdev3.cxx:6094
    #8  0x00007fd378d5cece in OutputDevice::ImplGlyphFallbackLayout (this=0x35022c0, pSalLayout=0x36136c0, rLayoutArgs=...) at vcl/source/gdi/outdev3.cxx:6206
    #9  0x00007fd378d5c6fe in OutputDevice::ImplLayout (this=0x35022c0, rOrigStr="\327\252\327\220\327\250\327\231\327\232:__________", nMinIndex=0, nLen=5, rLogicalPos=..., nLogicalWidth=570, pDXArray=0x0, bFilter=true) at vcl/source/gdi/outdev3.cxx:6065
    #10 0x00007fd378d5b9da in OutputDevice::DrawStretchText (this=0x35022c0, rStartPt=..., nWidth=570, rStr="\327\252\327\220\327\250\327\231\327\232:__________", nIndex=0, nLen=5) at vcl/source/gdi/outdev3.cxx:5840
    #11 0x00007fd378d27f1e in MetaStretchTextAction::Execute (this=0x3588880, pOut=0x35022c0) at vcl/source/gdi/metaact.cxx:1482
    #12 0x00007fd378cdbea5 in GDIMetaFile::Play (this=0x7ffff63e7da0, pOut=0x35022c0, nPos=1283) at vcl/source/gdi/gdimtf.cxx:424
    #13 0x00007fd378ea1c6f in vcl::PrinterController::printFilteredPage (this=0x34ff550, i_nPage=10) at vcl/source/gdi/print3.cxx:1207

diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index ce6c051..a755749 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -843,7 +843,7 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs)
                     assert(nCharIndex > -1);
                     mvCharDxs[nCharIndex-mnMinCharPos] += nOffset;
                     // adjust char dxs for rest of characters in cluster
-                    while (++nCharIndex < static_cast<int>(mvGlyph2Char.size()))
+                    while (++nCharIndex < static_cast<int>(mvChar2BaseGlyph.size()))
                     {
                         int nChar2Base = mvChar2BaseGlyph[nCharIndex-mnMinCharPos];
                         if (nChar2Base == -1 || nChar2Base == static_cast<int>(i))


More information about the Libreoffice-commits mailing list