[Libreoffice-commits] core.git: 5 commits - include/svx svx/source sw/source vcl/source
include/svx/xbtmpit.hxx |2 ++ svx/source/xoutdev/xattrbmp.cxx | 26 -- sw/source/filter/ww8/ww8par2.hxx |4 ++-- sw/source/filter/ww8/ww8par6.cxx | 17 - vcl/source/gdi/bitmapex.cxx | 15 +-- 5 files changed, 41 insertions(+), 23 deletions(-) New commits: commit 03e750a73273239e238d8dd8f6f01aa59a8f6cca Author: Caolán McNamaraDate: Thu Jun 15 12:41:14 2017 +0100 ofz: fix another leak Change-Id: I488ee070ab781011e357db6858188d2b706cb348 diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx index d532a580634e..a097b62ba774 100644 --- a/sw/source/filter/ww8/ww8par2.hxx +++ b/sw/source/filter/ww8/ww8par2.hxx @@ -67,7 +67,7 @@ struct WW8SwFlyPara // part 2: changes found during reading long nNewNetWidth; -SwPosition* pMainTextPos; // to return to main text after apo +std::unique_ptr xMainTextPos; // to return to main text after apo sal_uInt16 nLineSpace; // line space in tw for graf apos bool bAutoWidth; bool bToggelPos; diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 67282c3a1150..508245c17fc2 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2399,7 +2399,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults , const WW8_TablePos *p } // remember Pos in body text -m_xSFlyPara->pMainTextPos = new SwPosition( *m_pPaM->GetPoint() ); +m_xSFlyPara->xMainTextPos.reset(new SwPosition(*m_pPaM->GetPoint())); //remove fltanchors, otherwise they will be closed inside the //frame, which makes no sense, restore them after the frame is @@ -2488,9 +2488,9 @@ void SwWW8ImplReader::StopApo() } else { -if (!m_xSFlyPara->pMainTextPos) +if (!m_xSFlyPara->xMainTextPos) { -OSL_ENSURE( m_xSFlyPara->pMainTextPos, "StopApo: pMainTextPos is 0" ); +OSL_ENSURE(m_xSFlyPara->xMainTextPos.get(), "StopApo: xMainTextPos is nullptr"); return; } @@ -2511,7 +2511,7 @@ void SwWW8ImplReader::StopApo() SwNodeIndex aPref(m_pPaM->GetPoint()->nNode, -1); SwTwips nNewWidth = -MoveOutsideFly(m_xSFlyPara->pFlyFormat, *m_xSFlyPara->pMainTextPos); +MoveOutsideFly(m_xSFlyPara->pFlyFormat, *m_xSFlyPara->xMainTextPos); if (nNewWidth) m_xSFlyPara->BoxUpWidth(nNewWidth); @@ -2584,7 +2584,7 @@ void SwWW8ImplReader::StopApo() aFlySet.ClearItem(RES_FRM_SIZE); -CalculateFlySize(aFlySet, m_xSFlyPara->pMainTextPos->nNode, +CalculateFlySize(aFlySet, m_xSFlyPara->xMainTextPos->nNode, m_xSFlyPara->nWidth); nNewWidth = ItemGet(aFlySet, RES_FRM_SIZE).GetWidth(); @@ -2595,8 +2595,7 @@ void SwWW8ImplReader::StopApo() m_xSFlyPara->pFlyFormat->SetFormatAttr(aSize); } -delete m_xSFlyPara->pMainTextPos; -m_xSFlyPara->pMainTextPos = nullptr; +m_xSFlyPara->xMainTextPos.reset(); // To create the SwFrames when inserting into an existing document, fltshell.cxx // will call pFlyFrame->MakeFrames() when setting the FltAnchor attribute commit d47719a7a8558db9502b84e3e64c4a1bb7af3e7c Author: Caolán McNamara Date: Thu Jun 15 12:39:47 2017 +0100 ofz: fix a leak Change-Id: Ifd730a0f162ab5032665926d66debe716b0579df diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx index f2c98070d24e..d532a580634e 100644 --- a/sw/source/filter/ww8/ww8par2.hxx +++ b/sw/source/filter/ww8/ww8par2.hxx @@ -83,7 +83,7 @@ struct WW8SwFlyPara const sal_Int32 nIniFlyDy ); void BoxUpWidth( long nWidth ); -SwWW8FltAnchorStack *pOldAnchorStck; +std::unique_ptr xOldAnchorStck; }; class WW8RStyle: public WW8Style diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 3c05190a8c17..67282c3a1150 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2404,7 +2404,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults , const WW8_TablePos *p //remove fltanchors, otherwise they will be closed inside the //frame, which makes no sense, restore them after the frame is //closed -m_xSFlyPara->pOldAnchorStck = m_pAnchorStck; +m_xSFlyPara->xOldAnchorStck.reset(m_pAnchorStck); m_pAnchorStck = new SwWW8FltAnchorStack(_rDoc, m_nFieldFlags); if (m_xSFlyPara->pFlyFormat) @@ -2554,7 +2554,7 @@ void SwWW8ImplReader::StopApo() m_xSFlyPara->pFlyFormat->SetFormatAttr(SvxBrushItem(aBg, RES_BACKGROUND)); DeleteAnchorStack(); -m_pAnchorStck = m_xSFlyPara->pOldAnchorStck; +m_pAnchorStck = m_xSFlyPara->xOldAnchorStck.release(); // When
[Libreoffice-commits] core.git: 5 commits - include/svx svx/source sw/source vcl/source
include/svx/sdrundomanager.hxx |3 + svx/source/svdraw/sdrundomanager.cxx | 19 sw/source/core/swg/swblocks.cxx |3 + sw/source/core/text/porfld.cxx |5 ++- sw/source/filter/html/swhtml.cxx |5 +++ vcl/source/window/menu.cxx | 55 --- 6 files changed, 72 insertions(+), 18 deletions(-) New commits: commit bfeabd965c4ed4cc78975dbedafb586e2fac8c48 Author: Armin Le Grand a...@apache.org Date: Tue Oct 8 12:38:03 2013 + Resolves: #i123350# Added Clear() implementation to SdrUndoManager... to only delete text edit part of the undo stack (cherry picked from commit 81e916525fa63b188b2a3b9bb7030e4d451a4808) Conflicts: svx/inc/svx/sdrundomanager.hxx Change-Id: I19594e4cfa52a24dbcb95639ac3c6b9f39908cc7 diff --git a/include/svx/sdrundomanager.hxx b/include/svx/sdrundomanager.hxx old mode 100644 new mode 100755 index f71f115..9c88f06 --- a/include/svx/sdrundomanager.hxx +++ b/include/svx/sdrundomanager.hxx @@ -48,6 +48,9 @@ public: virtual bool Undo(); virtual bool Redo(); +// #i123350# +virtual void Clear(); + // Call for the view which starts the interactive text edit. Use link to // activate (start text edit) and empty link to reset (end text edit). On // reset all text edit actions will be removed from this undo manager to diff --git a/svx/source/svdraw/sdrundomanager.cxx b/svx/source/svdraw/sdrundomanager.cxx index 4f97225..f2a00c5 100644 --- a/svx/source/svdraw/sdrundomanager.cxx +++ b/svx/source/svdraw/sdrundomanager.cxx @@ -80,6 +80,25 @@ bool SdrUndoManager::Redo() return bRetval; } +void SdrUndoManager::Clear() +{ +if(isTextEditActive()) +{ +while(GetUndoActionCount() mpLastUndoActionBeforeTextEdit != GetUndoAction(0)) +{ +RemoveLastUndoAction(); +} + +// urgently needed: RemoveLastUndoAction does NOT correct the Redo stack by itself (!) +ClearRedo(); +} +else +{ +// call parent +EditUndoManager::Clear(); +} +} + void SdrUndoManager::SetEndTextEditHdl(const Link rLink) { maEndTextEditHdl = rLink; commit 8d1a172121ab29c70de89c59945b60f462a89fa4 Author: Caolán McNamara caol...@redhat.com Date: Tue Oct 8 15:42:03 2013 +0100 CID#1079272 uninitialized member variable Change-Id: Iff12fd9f9fbd1dac3f56dd733d967d8ba251d6b4 diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx index 2193ea0..aaf0aea 100644 --- a/sw/source/core/swg/swblocks.cxx +++ b/sw/source/core/swg/swblocks.cxx @@ -94,7 +94,8 @@ SwImpBlocks::SwImpBlocks( const OUString rFile, sal_Bool ) aDateModified( Date::EMPTY ), aTimeModified( Time::EMPTY ), pDoc( 0 ), nCur( (sal_uInt16)-1 ), -bReadOnly( sal_True ), bInPutMuchBlocks( sal_False ) +bReadOnly( sal_True ), bInPutMuchBlocks( sal_False ), +bInfoChanged(false) { FStatHelper::GetModifiedDateTimeOfFile( rFile, aDateModified, aTimeModified ); commit 609c35d943b001cb1d598709289cfa0b2bb48f01 Author: Caolán McNamara caol...@redhat.com Date: Tue Oct 8 15:40:43 2013 +0100 CID#1079271 uninitialized member variables Change-Id: I4bf9e0c7a548c0f22ce670803bc8334277f80c9e diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index c51d7e5..ab693ea 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -135,22 +135,45 @@ struct MenuItemData SalMenuItem*pSalMenuItem; // access to native menu -MenuItemData() : -pSubMenu(NULL), pAutoSubMenu(NULL), nItemImageAngle(0), pSalMenuItem ( NULL ) -{} -MenuItemData( const OUString rStr, const Image rImage ) : -pSubMenu(NULL), -pAutoSubMenu(NULL), -aText( rStr ), -aImage( rImage ), -nItemImageAngle(0), -pSalMenuItem ( NULL ) -{} -~MenuItemData(); -bool HasCheck() const -{ -return bChecked || ( nBits ( MIB_RADIOCHECK | MIB_CHECKABLE | MIB_AUTOCHECK ) ); -} +MenuItemData() +: nId(0) +, eType(MENUITEM_DONTKNOW) +, nBits(0) +, pSubMenu(NULL) +, pAutoSubMenu(NULL) +, nUserValue(0) +, bChecked(false) +, bEnabled(false) +, bVisible(false) +, bIsTemporary(false) +, bMirrorMode(false) +, nItemImageAngle(0) +, pSalMenuItem(NULL) +{ +} +MenuItemData( const OUString rStr, const Image rImage ) +: nId(0) +, eType(MENUITEM_DONTKNOW) +, nBits(0) +, pSubMenu(NULL) +, pAutoSubMenu(NULL) +, aText(rStr) +, nUserValue(0) +,