From a5b909ac6d6dd41559eba271d27140ebc21c72fc Mon Sep 17 00:00:00 2001 From: Rafael Dominguez Date: Sat, 14 Apr 2012 23:03:08 -0430 Subject: Return by value instead of passing by reference to get data. --- sd/inc/sdabstdlg.hxx | 2 +- sd/source/ui/dlg/inspagob.cxx | 6 +++--- sd/source/ui/dlg/sddlgfact.cxx | 4 ++-- sd/source/ui/dlg/sddlgfact.hxx | 2 +- sd/source/ui/dlg/sdtreelb.cxx | 7 +++++-- sd/source/ui/func/fuinsfil.cxx | 9 ++++----- sd/source/ui/inc/inspagob.hxx | 2 +- sd/source/ui/inc/sdtreelb.hxx | 2 +- 8 files changed, 18 insertions(+), 16 deletions(-) (limited to 'sd') diff --git a/sd/inc/sdabstdlg.hxx b/sd/inc/sdabstdlg.hxx index 8e01fbc58cde..95ae85d799e3 100644 --- a/sd/inc/sdabstdlg.hxx +++ b/sd/inc/sdabstdlg.hxx @@ -139,7 +139,7 @@ class AbstractSdInsertPagesObjsDlg : public VclAbstractDialog //add for SdInser { public: virtual ::Window* GetWindow() = 0; //this method is added for return a ::Window type pointer - virtual void GetList ( const sal_uInt16 nType, std::vector &rEntries ) = 0; + virtual std::vector GetList ( const sal_uInt16 nType ) = 0; virtual sal_Bool IsLink() = 0; virtual sal_Bool IsRemoveUnnessesaryMasterPages() const = 0; }; diff --git a/sd/source/ui/dlg/inspagob.cxx b/sd/source/ui/dlg/inspagob.cxx index 90e41a996998..d433ee5ee01e 100644 --- a/sd/source/ui/dlg/inspagob.cxx +++ b/sd/source/ui/dlg/inspagob.cxx @@ -115,7 +115,7 @@ void SdInsertPagesObjsDlg::Reset() aCbxMasters.Check( sal_True ); } -void SdInsertPagesObjsDlg::GetList( const sal_uInt16 nType, std::vector &rEntries ) +std::vector SdInsertPagesObjsDlg::GetList( const sal_uInt16 nType ) { // Bei Draw-Dokumenten muss bei der Selektion des Dokumentes NULL // zurueckgegeben werden @@ -129,10 +129,10 @@ void SdInsertPagesObjsDlg::GetList( const sal_uInt16 nType, std::vector(); } - aLbTree.GetSelectEntryList( nType,rEntries ); + return aLbTree.GetSelectEntryList( nType ); } /************************************************************************* diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx index fb08787f4ac9..6eb279550d1e 100644 --- a/sd/source/ui/dlg/sddlgfact.cxx +++ b/sd/source/ui/dlg/sddlgfact.cxx @@ -283,9 +283,9 @@ sal_Bool AbstractSdInsertPasteDlg_Impl::IsInsertBefore() const return (::Window*)pDlg; } -void AbstractSdInsertPagesObjsDlg_Impl::GetList (const sal_uInt16 nType, std::vector &rEntries) +std::vector AbstractSdInsertPagesObjsDlg_Impl::GetList(const sal_uInt16 nType) { - pDlg->GetList(nType,rEntries); + return pDlg->GetList(nType); } sal_Bool AbstractSdInsertPagesObjsDlg_Impl::IsLink() diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx index 34d9a6cbfd77..c06200edaabb 100644 --- a/sd/source/ui/dlg/sddlgfact.hxx +++ b/sd/source/ui/dlg/sddlgfact.hxx @@ -187,7 +187,7 @@ class AbstractSdInsertPagesObjsDlg_Impl : public AbstractSdInsertPagesObjsDlg { DECL_ABSTDLG_BASE(AbstractSdInsertPagesObjsDlg_Impl,SdInsertPagesObjsDlg) virtual ::Window * GetWindow(); //this method is added for return a Window type pointer - virtual void GetList ( const sal_uInt16 nType, std::vector &rEntries); + virtual std::vector GetList ( const sal_uInt16 nType ); virtual sal_Bool IsLink(); virtual sal_Bool IsRemoveUnnessesaryMasterPages() const; }; diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 1ce334a4b0d8..49623690f928 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -661,8 +661,9 @@ String SdPageObjsTLB::GetSelectEntry() return( GetEntryText( GetCurEntry() ) ); } -void SdPageObjsTLB::GetSelectEntryList( sal_uInt16 nDepth, std::vector &rEntries ) const +std::vector SdPageObjsTLB::GetSelectEntryList( const sal_uInt16 nDepth ) const { + std::vector aEntries; SvLBoxEntry* pEntry = FirstSelected(); while( pEntry ) @@ -670,10 +671,12 @@ void SdPageObjsTLB::GetSelectEntryList( sal_uInt16 nDepth, std::vectorGetDepth( pEntry ); if( nListDepth == nDepth ) - rEntries.push_back(GetEntryText(pEntry)); + aEntries.push_back(GetEntryText(pEntry)); pEntry = NextSelected( pEntry ); } + + return aEntries; } /************************************************************************* diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 624f309ccbdb..260d6cbfc2fd 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -354,10 +354,9 @@ sal_Bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium) if( nRet == RET_OK ) { - std::vector aBookmarkList; // Liste mit Seitennamen (wenn NULL, dann alle Seiten) - + // Liste mit Seitennamen (wenn NULL, dann alle Seiten) // Zuerst Seiten einfuegen - pDlg->GetList( 1, aBookmarkList ); // Seiten + std::vector aBookmarkList = pDlg->GetList( 1 ); // Seiten sal_Bool bLink = pDlg->IsLink(); sal_Bool bReplace = sal_False; SdPage* pPage = NULL; @@ -387,8 +386,8 @@ sal_Bool FuInsertFile::InsSDDinDrMode(SfxMedium* pMedium) } sal_Bool bNameOK; - std::vector aObjectBookmarkList, aExchangeList; - pDlg->GetList( 2, aObjectBookmarkList ); // Objekte + std::vector aExchangeList; + std::vector aObjectBookmarkList = pDlg->GetList( 2 ); // Objekte // Es werden ausgewaehlte Seiten und/oder ausgewaehlte Objekte oder // alles eingefuegt, wenn pBookmarkList NULL ist! diff --git a/sd/source/ui/inc/inspagob.hxx b/sd/source/ui/inc/inspagob.hxx index deea96c87687..651979ba0876 100644 --- a/sd/source/ui/inc/inspagob.hxx +++ b/sd/source/ui/inc/inspagob.hxx @@ -69,7 +69,7 @@ public: |* \************************************************************************/ - void GetList ( const sal_uInt16 nType, std::vector &rEntries); + std::vector GetList ( const sal_uInt16 nType ) ; sal_Bool IsLink(); sal_Bool IsRemoveUnnessesaryMasterPages() const; diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx index 5a26745b0d1e..63ac738498e5 100644 --- a/sd/source/ui/inc/sdtreelb.hxx +++ b/sd/source/ui/inc/sdtreelb.hxx @@ -215,7 +215,7 @@ public: |* \************************************************************************/ - void GetSelectEntryList (sal_uInt16 nDepth, std::vector &rEntries) const; + std::vector GetSelectEntryList (const sal_uInt16 nDepth) const; SdDrawDocument* GetBookmarkDoc(SfxMedium* pMedium = NULL); ::sd::DrawDocShell* GetDropDocSh() { return(mpDropDocSh); } -- cgit