[Libreoffice-commits] core.git: chart2/source cui/source include/svx sc/source sd/source sw/source
Noel Grandin
noelgrandin at gmail.com
Fri Sep 25 11:22:02 PDT 2015
chart2/source/controller/main/ShapeController.cxx | 12 +++++-------
chart2/source/controller/main/ShapeController.hxx | 4 ++--
cui/source/factory/dlgfact.cxx | 4 ++--
cui/source/factory/dlgfact.hxx | 4 ++--
include/svx/svxdlg.hxx | 2 +-
sc/source/ui/drawfunc/drawsh5.cxx | 10 ++++------
sc/source/ui/inc/drawsh.hxx | 4 ++--
sd/source/ui/inc/DrawViewShell.hxx | 3 ++-
sd/source/ui/view/drviewsc.cxx | 9 +++------
sw/source/uibase/inc/drwbassh.hxx | 4 ++--
sw/source/uibase/shells/drwbassh.cxx | 12 ++++++------
11 files changed, 31 insertions(+), 37 deletions(-)
New commits:
commit f8a7c031f1ff872f9566b7bfce0321c0b89d45f9
Author: Noel Grandin <noelgrandin at gmail.com>
Date: Fri Sep 25 10:27:15 2015 +0200
convert Link<> to typed
Change-Id: Ic39135b39f1389fdf94fb16746100209ee63f492
Reviewed-on: https://gerrit.libreoffice.org/18856
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index 6897a29..7fc856e3 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -229,22 +229,20 @@ void ShapeController::describeSupportedFeatures()
implDescribeSupportedFeature( ".uno:ParagraphDialog", COMMAND_ID_PARAGRAPH_DIALOG, CommandGroup::EDIT );
}
-IMPL_LINK( ShapeController, CheckNameHdl, AbstractSvxNameDialog*, pDialog )
+IMPL_LINK_TYPED( ShapeController, CheckNameHdl, AbstractSvxObjectNameDialog&, rDialog, bool )
{
OUString aName;
- if ( pDialog )
- {
- pDialog->GetName( aName );
- }
+ rDialog.GetName( aName );
+
if ( !aName.isEmpty() )
{
DrawViewWrapper* pDrawViewWrapper = ( m_pChartController ? m_pChartController->GetDrawViewWrapper() : NULL );
if ( pDrawViewWrapper && pDrawViewWrapper->getNamedSdrObject( aName ) )
{
- return 0;
+ return false;
}
}
- return 1;
+ return true;
}
void ShapeController::executeDispatch_FormatLine()
diff --git a/chart2/source/controller/main/ShapeController.hxx b/chart2/source/controller/main/ShapeController.hxx
index b160189..93c701e 100644
--- a/chart2/source/controller/main/ShapeController.hxx
+++ b/chart2/source/controller/main/ShapeController.hxx
@@ -22,7 +22,7 @@
#include "FeatureCommandDispatchBase.hxx"
#include <tools/link.hxx>
-class AbstractSvxNameDialog;
+class AbstractSvxObjectNameDialog;
class SdrObject;
namespace chart
@@ -62,7 +62,7 @@ protected:
virtual void describeSupportedFeatures() SAL_OVERRIDE;
private:
- DECL_LINK( CheckNameHdl, AbstractSvxNameDialog* );
+ DECL_LINK_TYPED( CheckNameHdl, AbstractSvxObjectNameDialog&, bool);
void executeDispatch_FormatLine();
void executeDispatch_FormatArea();
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 0961103..426fe28 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -619,7 +619,7 @@ void AbstractSvxObjectNameDialog_Impl::GetName(OUString& rName)
pDlg->GetName(rName);
}
-void AbstractSvxObjectNameDialog_Impl::SetCheckNameHdl(const Link<>& rLink, bool bCheckImmediately)
+void AbstractSvxObjectNameDialog_Impl::SetCheckNameHdl(const Link<AbstractSvxObjectNameDialog&,bool>& rLink, bool bCheckImmediately)
{
aCheckNameHdl = rLink;
@@ -637,7 +637,7 @@ IMPL_LINK_NOARG_TYPED(AbstractSvxObjectNameDialog_Impl, CheckNameHdl, SvxObjectN
{
if(aCheckNameHdl.IsSet())
{
- return aCheckNameHdl.Call(this);
+ return aCheckNameHdl.Call(*this);
}
return false;
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index e4e9621..f7d9e6b 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -342,10 +342,10 @@ class AbstractSvxObjectNameDialog_Impl :public AbstractSvxObjectNameDialog
{
DECL_ABSTDLG_BASE(AbstractSvxObjectNameDialog_Impl, SvxObjectNameDialog)
virtual void GetName(OUString& rName) SAL_OVERRIDE ;
- virtual void SetCheckNameHdl(const Link<>& rLink, bool bCheckImmediately = false) SAL_OVERRIDE;
+ virtual void SetCheckNameHdl(const Link<AbstractSvxObjectNameDialog&,bool>& rLink, bool bCheckImmediately = false) SAL_OVERRIDE;
private:
- Link<> aCheckNameHdl;
+ Link<AbstractSvxObjectNameDialog&,bool> aCheckNameHdl;
DECL_LINK_TYPED(CheckNameHdl, SvxObjectNameDialog&, bool);
};
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 1ec6814..0fb8845 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -169,7 +169,7 @@ class AbstractSvxObjectNameDialog :public VclAbstractDialog
{
public:
virtual void GetName(OUString& rName) = 0;
- virtual void SetCheckNameHdl(const Link<>& rLink, bool bCheckImmediately = false) = 0;
+ virtual void SetCheckNameHdl(const Link<AbstractSvxObjectNameDialog&,bool>& rLink, bool bCheckImmediately = false) = 0;
};
class AbstractSvxObjectTitleDescDialog :public VclAbstractDialog
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index d3f2dad..cdb6999 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -617,12 +617,10 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
}
}
-IMPL_LINK( ScDrawShell, NameObjectHdl, AbstractSvxNameDialog*, pDialog )
+IMPL_LINK_TYPED( ScDrawShell, NameObjectHdl, AbstractSvxObjectNameDialog&, rDialog, bool )
{
OUString aName;
-
- if( pDialog )
- pDialog->GetName( aName );
+ rDialog.GetName( aName );
ScDrawLayer* pModel = pViewData->GetDocument()->GetDrawLayer();
if ( !aName.isEmpty() && pModel )
@@ -631,11 +629,11 @@ IMPL_LINK( ScDrawShell, NameObjectHdl, AbstractSvxNameDialog*, pDialog )
if ( pModel->GetNamedObject( aName, 0, nDummyTab ) )
{
// existing object found -> name invalid
- return 0;
+ return false;
}
}
- return 1; // name is valid
+ return true; // name is valid
}
void ScDrawShell::ExecFormText(SfxRequest& rReq)
diff --git a/sc/source/ui/inc/drawsh.hxx b/sc/source/ui/inc/drawsh.hxx
index ec203b2..e32652c 100644
--- a/sc/source/ui/inc/drawsh.hxx
+++ b/sc/source/ui/inc/drawsh.hxx
@@ -27,7 +27,7 @@
#include <tools/link.hxx>
#include <rtl/ref.hxx>
-class AbstractSvxNameDialog;
+class AbstractSvxObjectNameDialog;
class ScViewData;
class ScDrawView;
namespace svx { namespace sidebar {
@@ -39,7 +39,7 @@ class ScDrawShell : public SfxShell
ScViewData* pViewData;
::rtl::Reference<svx::sidebar::SelectionChangeHandler> mpSelectionChangeHandler;
- DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* );
+ DECL_LINK_TYPED( NameObjectHdl, AbstractSvxObjectNameDialog&, bool );
void SetHlinkForObject( SdrObject* pObj, const OUString& rHlnk );
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index 1970900..6205ef3 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -44,6 +44,7 @@ class AbstractSvxNameDialog;
class SdrLayer;
class SvxClipboardFormatItem;
struct ESelection;
+class AbstractSvxObjectNameDialog;
namespace sd {
@@ -405,7 +406,7 @@ protected:
DECL_LINK_TYPED( ClipboardChanged, TransferableDataHelper*, void );
DECL_LINK_TYPED( TabSplitHdl, TabBar *, void );
- DECL_LINK( NameObjectHdl, AbstractSvxNameDialog* );
+ DECL_LINK_TYPED( NameObjectHdl, AbstractSvxObjectNameDialog&, bool );
DECL_LINK_TYPED( RenameSlideHdl, AbstractSvxNameDialog&, bool );
void DeleteActualPage();
diff --git a/sd/source/ui/view/drviewsc.cxx b/sd/source/ui/view/drviewsc.cxx
index 6195735..72e50e7 100644
--- a/sd/source/ui/view/drviewsc.cxx
+++ b/sd/source/ui/view/drviewsc.cxx
@@ -83,14 +83,11 @@ void DrawViewShell::UpdateIMapDlg( SdrObject* pObj )
}
}
-IMPL_LINK( DrawViewShell, NameObjectHdl, AbstractSvxNameDialog*, pDialog )
+IMPL_LINK_TYPED( DrawViewShell, NameObjectHdl, AbstractSvxObjectNameDialog&, rDialog, bool )
{
OUString aName;
-
- if( pDialog )
- pDialog->GetName( aName );
-
- return ( aName.isEmpty() || ( GetDoc() && !GetDoc()->GetObj( aName ) ) ) ? 1 : 0;
+ rDialog.GetName( aName );
+ return aName.isEmpty() || ( GetDoc() && !GetDoc()->GetObj( aName ) );
}
} // end of namespace sd
diff --git a/sw/source/uibase/inc/drwbassh.hxx b/sw/source/uibase/inc/drwbassh.hxx
index e588695..95254b2 100644
--- a/sw/source/uibase/inc/drwbassh.hxx
+++ b/sw/source/uibase/inc/drwbassh.hxx
@@ -25,12 +25,12 @@
class SwView;
class SfxItemSet;
class SwDrawBase;
-class AbstractSvxNameDialog;
+class AbstractSvxObjectNameDialog;
struct SvxSwFrameValidation;
class SwDrawBaseShell: public SwBaseShell
{
- DECL_LINK( CheckGroupShapeNameHdl, AbstractSvxNameDialog* );
+ DECL_LINK_TYPED( CheckGroupShapeNameHdl, AbstractSvxObjectNameDialog&, bool );
DECL_LINK_TYPED(ValidatePosition, SvxSwFrameValidation&, void );
public:
SwDrawBaseShell(SwView &rShell);
diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx
index 71a4fa9..196d1af 100644
--- a/sw/source/uibase/shells/drwbassh.cxx
+++ b/sw/source/uibase/shells/drwbassh.cxx
@@ -588,7 +588,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq)
// Checks whether a given name is allowed for a group shape
-IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNameDialog )
+IMPL_LINK_TYPED( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxObjectNameDialog&, rNameDialog, bool )
{
SwWrtShell &rSh = GetShell();
SdrView *pSdrView = rSh.GetDrawView();
@@ -597,13 +597,13 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
const OUString sCurrentName = pObj->GetName();
OUString sNewName;
- pNameDialog->GetName(sNewName);
- long nRet = 0;
+ rNameDialog.GetName(sNewName);
+ bool nRet = false;
if (sNewName.isEmpty() || sCurrentName == sNewName)
- nRet = 1;
+ nRet = true;
else
{
- nRet = 1;
+ nRet = true;
SwDrawModel* pModel = rSh.getIDocumentDrawModelAccess().GetDrawModel();
SdrObjListIter aIter( *(pModel->GetPage(0)), IM_DEEPWITHGROUPS );
while( aIter.IsMore() )
@@ -611,7 +611,7 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam
SdrObject* pTempObj = aIter.Next();
if ( pObj != pTempObj && pTempObj->GetName().equals(sNewName) )
{
- nRet = 0;
+ nRet = false;
break;
}
}
More information about the Libreoffice-commits
mailing list