[Libreoffice-commits] core.git: 2 commits - svx/source sw/source

Michael Stahl mstahl at redhat.com
Fri May 16 15:48:02 PDT 2014


 svx/source/sdr/contact/objectcontactofpageview.cxx |    4 +++-
 sw/source/core/text/txtfrm.cxx                     |    2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

New commits:
commit aa68e1309450f79d1b40545ad6c340a49eff51c6
Author: Michael Stahl <mstahl at redhat.com>
Date:   Sat May 17 00:08:34 2014 +0200

    fdo#78149: set the ViewPort even when painting to a MetaFile
    
    ObjectContactOfPageView::DoProcessDisplay() has a special case for
    painting to MetaFiles, and does not set the ViewPort from the passed-in
    RedrawArea unless it's a printing or PDF export, with the result
    that for a plain MetaFile all fly-frames in a Writer document
    are painted, whether visible or not.
    
    Since e2eda70f2746f08376d8cdf5e5360df217335aef now calls
    GetPreviewMetaFile() after every document load, this issue is more
    visible.
    
    Since there is no obvious reason to ever ignore a passed RedrawArea,
    simply always use it for the ViewPort, not just when printing.
    
    Change-Id: I256710f1476181f567069b45a2a494b0d2064d6b

diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index cefbd96..864e730 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -175,12 +175,14 @@ namespace sdr
             // create ViewRange
             if(isOutputToRecordingMetaFile())
             {
-                if(isOutputToPDFFile() || isOutputToPrinter())
+                if (!rDisplayInfo.GetRedrawArea().IsEmpty())
                 {
                     // #i98402# if it's a PDF export, set the ClipRegion as ViewRange. This is
                     // mainly because SW does not use DrawingLayer Page-Oriented and if not doing this,
                     // all existing objects will be collected as primitives and processed.
                     // OD 2009-03-05 #i99876# perform the same also for SW on printing.
+                    // fdo#78149 same thing also needed for plain MetaFile
+                    //           export, so why not do it always
                     const Rectangle aLogicClipRectangle(rDisplayInfo.GetRedrawArea().GetBoundRect());
 
                     aViewRange = basegfx::B2DRange(
commit 44c81ce21825554aad8dcebd58388cb5c0f81df8
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri May 16 17:58:12 2014 +0200

    sw: try to fix a valgrind warning
    
    Invalid read of size 1
       at SwParaPortion::SetPrep(bool) (porlay.hxx:299)
       by SwTxtFrm::Prepare(PrepareHint, void const*, bool) (txtfrm.cxx:1756)
       by SwTxtFrm::Prepare(PrepareHint, void const*, bool) (txtfrm.cxx:1663)
       by SwCntntFrm::MakeAll() (calcmove.cxx:1310)
       by SwFrm::OptPrepareMake() (calcmove.cxx:356)
       by SwFrm::OptCalc() const (frame.hxx:1037)
       by SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (layact.cxx:1829)
       by SwLayAction::FormatCntnt(SwPageFrm const*) (layact.cxx:1660)
       by SwLayAction::InternalAction() (layact.cxx:597)
       by SwLayAction::Action() (layact.cxx:376)
       by SwLayIdle::SwLayIdle(SwRootFrm*, SwViewImp*) (layact.cxx:2179)
     Address 0x1f9507e0 is 832 bytes inside a block of size 840 free'd
       by FixedMemPool::Free(void*) (mempool.cxx:48)
       by SwParaPortion::operator delete(void*, unsigned long) (in /work/lo/master/instdir/program/libswlo.so)
       by SwParaPortion::~SwParaPortion() (porlay.cxx:1972)
       by SwTxtFrm::ClearPara() (txtcache.cxx:102)
       by SwTxtFrm::Init() (txtfrm.cxx:329)
       by SwTxtFrm::CalcLineSpace() (txtfrm.cxx:746)
       by SwTxtFrm::Prepare(PrepareHint, void const*, bool) (txtfrm.cxx:1680)
       by SwTxtFrm::Prepare(PrepareHint, void const*, bool) (txtfrm.cxx:1663)
       by SwCntntFrm::MakeAll() (calcmove.cxx:1310)
       by SwFrm::OptPrepareMake() (calcmove.cxx:356)
       by SwFrm::OptCalc() const (frame.hxx:1037)
       by SwLayAction::_FormatCntnt(SwCntntFrm const*, SwPageFrm const*) (layact.cxx:1829)
       by SwLayAction::FormatCntnt(SwPageFrm const*) (layact.cxx:1660)
       by SwLayAction::InternalAction() (layact.cxx:597)
       by SwLayAction::Action() (layact.cxx:376)
       by SwLayIdle::SwLayIdle(SwRootFrm*, SwViewImp*) (layact.cxx:2179)
    
    Change-Id: I64a1cc6ea301b653af951ba0e00e28d4655d2d97

diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index bd4fc8c..ab0d613 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1678,6 +1678,8 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid,
             {
                 pPara->SetPrepAdjust();
                 CalcLineSpace();
+                // possible that pPara was deleted above; retrieve it again
+                pPara = aAccess.GetPara();
                 InvalidateSize();
                 _InvalidatePrt();
                 SwFrm* pNxt;


More information about the Libreoffice-commits mailing list