[Libreoffice-commits] core.git: cui/source include/sfx2 sc/source sfx2/source sw/source

2018-09-13 Thread Libreoffice Gerrit user
 cui/source/tabpages/chardlg.cxx  |4 ++--
 cui/source/tabpages/grfpage.cxx  |2 +-
 cui/source/tabpages/numpages.cxx |   12 ++--
 include/sfx2/tabdlg.hxx  |2 ++
 sc/source/ui/dbgui/tpsort.cxx|   14 +++---
 sc/source/ui/dbgui/tpsubt.cxx|   14 ++
 sfx2/source/dialog/dinfdlg.cxx   |   26 ++
 sfx2/source/dialog/tabdlg.cxx|9 +
 sw/source/ui/envelp/label1.cxx   |4 ++--
 sw/source/ui/frmdlg/frmpage.cxx  |6 +++---
 sw/source/ui/misc/num.cxx|2 +-
 sw/source/ui/misc/pggrid.cxx |2 +-
 12 files changed, 50 insertions(+), 47 deletions(-)

New commits:
commit 88f7ac5ccd358069e356c544888386b745c82732
Author: Caolán McNamara 
AuthorDate: Thu Sep 13 12:40:17 2018 +0100
Commit: Caolán McNamara 
CommitDate: Thu Sep 13 18:05:03 2018 +0200

add GetDialogExampleSet rather than guess at it

Change-Id: I8d7fc780c77e7f410ce78eb07bcb92dcd71f6c13
Reviewed-on: https://gerrit.libreoffice.org/60434
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 1bb2f41b4f82..e8183ecc0ba9 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -937,7 +937,7 @@ bool SvxCharNamePage::FillItemSet_Impl( SfxItemSet& rSet, 
LanguageGroup eLangGrp
 const SfxItemSet& rOldSet = GetItemSet();
 const SfxPoolItem* pOld = nullptr;
 
-const SfxItemSet* pExampleSet = GetTabDialog() ? 
GetTabDialog()->GetExampleSet() : nullptr;
+const SfxItemSet* pExampleSet = GetDialogExampleSet();
 
 bool bChanged = true;
 const OUString& rFontName  = pNameBox->GetText();
@@ -2361,7 +2361,7 @@ bool SvxCharEffectsPage::FillItemSet( SfxItemSet* rSet )
 }
 
 // Outline
-const SfxItemSet* pExampleSet = GetTabDialog() ? 
GetTabDialog()->GetExampleSet() : nullptr;
+const SfxItemSet* pExampleSet = GetDialogExampleSet();
 nWhich = GetWhich( SID_ATTR_CHAR_CONTOUR );
 pOld = GetOldItem( *rSet, SID_ATTR_CHAR_CONTOUR );
 TriState eState = m_xOutlineBtn->get_state();
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 0d1b9c8af88c..abcddd4b5af3 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -271,7 +271,7 @@ bool SvxGrfCropPage::FillItemSet(SfxItemSet *rSet)
 SvxSizeItem aSz( nW );
 
 // size could already have been set from another page
-const SfxItemSet* pExSet = GetTabDialog() ? 
GetTabDialog()->GetExampleSet() : nullptr;
+const SfxItemSet* pExSet = GetDialogExampleSet();
 const SfxPoolItem* pItem = nullptr;
 if( pExSet && SfxItemState::SET ==
 pExSet->GetItemState( nW, false, &pItem ) )
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 8863e5fa968c..9edbc09a02bc 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -247,7 +247,7 @@ void  SvxSingleNumPickTabPage::ActivatePage(const 
SfxItemSet& rSet)
 const SfxPoolItem* pItem;
 bPreset = false;
 bool bIsPreset = false;
-const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
+const SfxItemSet* pExampleSet = GetDialogExampleSet();
 if(pExampleSet)
 {
 if(SfxItemState::SET == 
pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
@@ -404,7 +404,7 @@ void  SvxBulletPickTabPage::ActivatePage(const SfxItemSet& 
rSet)
 const SfxPoolItem* pItem;
 bPreset = false;
 bool bIsPreset = false;
-const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
+const SfxItemSet* pExampleSet = GetDialogExampleSet();
 if(pExampleSet)
 {
 if(SfxItemState::SET == 
pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
@@ -593,7 +593,7 @@ void  SvxNumPickTabPage::ActivatePage(const SfxItemSet& 
rSet)
 const SfxPoolItem* pItem;
 bPreset = false;
 bool bIsPreset = false;
-const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
+const SfxItemSet* pExampleSet = GetDialogExampleSet();
 if(pExampleSet)
 {
 if(SfxItemState::SET == 
pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
@@ -826,7 +826,7 @@ void  SvxBitmapPickTabPage::ActivatePage(const SfxItemSet& 
rSet)
 const SfxPoolItem* pItem;
 bPreset = false;
 bool bIsPreset = false;
-const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
+const SfxItemSet* pExampleSet = GetDialogExampleSet();
 if(pExampleSet)
 {
 if(SfxItemState::SET == 
pExampleSet->GetItemState(SID_PARAM_NUM_PRESET, false, &pItem))
@@ -1217,7 +1217,7 @@ VclPtr SvxNumOptionsTabPage::Create( 
TabPageParent pParent,
 voidSvxNumOptionsTabPage::ActivatePage(const SfxItemSet& rSet)
 {
 const SfxPoolItem* pItem;
-const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
+const SfxI

[Libreoffice-commits] core.git: cui/source include/sfx2 sc/source sfx2/source sw/source

2018-06-12 Thread Noel Grandin
 cui/source/inc/numfmt.hxx |2 +-
 include/sfx2/app.hxx  |6 +++---
 sc/source/ui/attrdlg/attrdlg.cxx  |2 +-
 sc/source/ui/inc/attrdlg.hxx  |2 +-
 sfx2/source/appl/appopen.cxx  |3 +--
 sw/source/uibase/inc/navipi.hxx   |2 +-
 sw/source/uibase/utlui/navipi.cxx |4 ++--
 7 files changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 59935c314945cdc365878a898317bfaa366fc36e
Author: Noel Grandin 
Date:   Tue Jun 12 12:00:54 2018 +0200

fix leak in SfxApplication::OpenDocExec_Impl

when calling Link on SfxLinkItem, none of the callee sites free the
memory associated with the Clone()'ed SfxPoolItem, so just skip the
cloning, and make the Link take a const pointer to make this more
obvious.

Change-Id: Icd187e9d8d3ace9bf2e6ff18348b105708e4
Reviewed-on: https://gerrit.libreoffice.org/55671
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/cui/source/inc/numfmt.hxx b/cui/source/inc/numfmt.hxx
index 56e0fb8b8c92..80a3f296cba2 100644
--- a/cui/source/inc/numfmt.hxx
+++ b/cui/source/inc/numfmt.hxx
@@ -118,7 +118,7 @@ private:
 SvxNumberInfoItem*  pNumItem;
 SvxNumberFormatShell*   pNumFmtShell;
 sal_uLong   nInitFormat;
-Link fnOkHdl;
+Link fnOkHdl;
 
 boolbNumItemFlag; ///< for handling with DocShell
 boolbOneAreaFlag;
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx
index b4d31614917b..a3299e9cde73 100644
--- a/include/sfx2/app.hxx
+++ b/include/sfx2/app.hxx
@@ -99,16 +99,16 @@ enum class SfxToolsModule
 
 class SFX2_DLLPUBLIC SfxLinkItem : public SfxPoolItem
 {
-Link aLink;
+Link aLink;
 public:
-SfxLinkItem( sal_uInt16 nWhichId, const Link& rValue ) 
: SfxPoolItem( nWhichId )
+SfxLinkItem( sal_uInt16 nWhichId, const Link& 
rValue ) : SfxPoolItem( nWhichId )
 {   aLink = rValue; }
 
 virtual SfxPoolItem* Clone( SfxItemPool* = nullptr ) const override
 {   return new SfxLinkItem( *this ); }
 virtual bool operator==( const SfxPoolItem& rL) const override
 {   return static_cast(rL).aLink == aLink; }
-const Link&
+const Link&
  GetValue() const { return aLink; }
 };
 
diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx
index 9a4cfdba6155..3ad3c86f8747 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -86,7 +86,7 @@ void ScAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& 
rTabPage )
 }
 }
 
-IMPL_LINK_NOARG(ScAttrDlg, OkHandler, SfxPoolItem*, void)
+IMPL_LINK_NOARG(ScAttrDlg, OkHandler, SfxPoolItem const *, void)
 {
 GetOKButton().GetClickHdl().Call( nullptr );
 }
diff --git a/sc/source/ui/inc/attrdlg.hxx b/sc/source/ui/inc/attrdlg.hxx
index d32ff75ddeff..8d978def7738 100644
--- a/sc/source/ui/inc/attrdlg.hxx
+++ b/sc/source/ui/inc/attrdlg.hxx
@@ -37,7 +37,7 @@ protected:
 virtual voidPageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) 
override;
 
 private:
-DECL_LINK( OkHandler, SfxPoolItem*, void ); // for closing by double 
clicking in TabPages
+DECL_LINK( OkHandler, SfxPoolItem const *, void ); // for closing by 
double clicking in TabPages
 sal_uInt16 m_nNumberPageId;
 sal_uInt16 m_nFontPageId;
 };
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 47ba55e34947..60f2c508ebbb 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -1122,8 +1122,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
 const SfxPoolItem* pRetValue = rReq.GetReturnValue();
 if (pRetValue)
 {
-SfxPoolItem* pClone = pRetValue->Clone();
-pLinkItem->GetValue().Call(pClone);
+pLinkItem->GetValue().Call(pRetValue);
 }
 delete pLinkItem;
 }
diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx
index 590867472bcc..6bf64aac0675 100644
--- a/sw/source/uibase/inc/navipi.hxx
+++ b/sw/source/uibase/inc/navipi.hxx
@@ -111,7 +111,7 @@ class SwNavigationPI : public PanelLayout,
 DECL_LINK( ToolBoxDropdownClickHdl, ToolBox*, void );
 DECL_LINK( EditAction, NumEditAction&, void );
 DECL_LINK( EditGetFocus, Control&, void );
-DECL_LINK( DoneLink, SfxPoolItem *, void );
+DECL_LINK( DoneLink, SfxPoolItem const *, void );
 DECL_LINK( MenuSelectHdl, Menu *, bool );
 DECL_LINK( ChangePageHdl, Timer*, void );
 DECL_LINK( PageEditModifyHdl, SpinField&, void );
diff --git a/sw/source/uibase/utlui/navipi.cxx 
b/sw/source/uibase/utlui/navipi.cxx
index fe6f3dddafa9..7f265fda712e 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -1014,9 +1014,9 @@ void SwNavigationPI::UpdateListBox()
 m_aDocListBox->SetUpdateMode(true);
 }
 
-IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolItem *, pItem, void)
+IMPL_LINK(SwNavigationPI, DoneLink, SfxPoolIte