From 1e6268e50d94eac41743ee23efc1b5dc4bd176bd Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 24 Apr 2012 10:39:03 -0400 Subject: Simplified the constructors. --- sc/inc/editsrc.hxx | 3 +-- sc/source/ui/unoobj/editsrc.cxx | 8 ++------ sc/source/ui/unoobj/fielduno.cxx | 6 +++--- sc/source/ui/unoobj/textuno.cxx | 3 +-- 4 files changed, 7 insertions(+), 13 deletions(-) (limited to 'sc') diff --git a/sc/inc/editsrc.hxx b/sc/inc/editsrc.hxx index 12e47af8743f..150e83ddba21 100644 --- a/sc/inc/editsrc.hxx +++ b/sc/inc/editsrc.hxx @@ -68,8 +68,7 @@ private: ScHeaderFooterTextData* pTextData; public: - ScHeaderFooterEditSource(ScHeaderFooterTextData* pData); - ScHeaderFooterEditSource(ScHeaderFooterContentObj* pContent, sal_uInt16 nP); + ScHeaderFooterEditSource(const ScHeaderFooterTextData& rData); ScHeaderFooterEditSource(ScHeaderFooterContentObj& rContent, sal_uInt16 nP); virtual ~ScHeaderFooterEditSource(); diff --git a/sc/source/ui/unoobj/editsrc.cxx b/sc/source/ui/unoobj/editsrc.cxx index 4cea0fb4933d..af6bad4d4d06 100644 --- a/sc/source/ui/unoobj/editsrc.cxx +++ b/sc/source/ui/unoobj/editsrc.cxx @@ -67,12 +67,8 @@ ScHeaderFooterChangedHint::~ScHeaderFooterChangedHint() // each ScHeaderFooterEditSource object has its own ScHeaderFooterTextData -ScHeaderFooterEditSource::ScHeaderFooterEditSource(ScHeaderFooterTextData* pData) : - pTextData(pData) {} - -ScHeaderFooterEditSource::ScHeaderFooterEditSource( - ScHeaderFooterContentObj* pContent, sal_uInt16 nP) : - pTextData(new ScHeaderFooterTextData(*pContent, nP)) {} +ScHeaderFooterEditSource::ScHeaderFooterEditSource(const ScHeaderFooterTextData& rData) : + pTextData(new ScHeaderFooterTextData(rData.GetContentObj(), rData.GetPart())) {} ScHeaderFooterEditSource::ScHeaderFooterEditSource( ScHeaderFooterContentObj& rContent, sal_uInt16 nP) : diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index 3297842c9e2a..b0cc5bccdb5f 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -859,7 +859,7 @@ ScHeaderFieldsObj::ScHeaderFieldsObj(ScHeaderFooterContentObj* pContent, sal_uIn if (pContentObj) { pContentObj->acquire(); // darf nicht wegkommen - pEditSource = new ScHeaderFooterEditSource( pContentObj, nPart ); + pEditSource = new ScHeaderFooterEditSource(*pContentObj, nPart); } else pEditSource = NULL; @@ -1118,7 +1118,7 @@ ScHeaderFieldObj::ScHeaderFieldObj( if (pContentObj) { pContentObj->acquire(); // darf nicht wegkommen - pEditSource = new ScHeaderFooterEditSource( pContentObj, nPart ); + pEditSource = new ScHeaderFooterEditSource(*pContentObj, nPart); } else pEditSource = NULL; @@ -1199,7 +1199,7 @@ void ScHeaderFieldObj::InitDoc( mpContent = rContent; pContentObj->acquire(); // darf nicht wegkommen - pEditSource = new ScHeaderFooterEditSource( pContentObj, nPart ); + pEditSource = new ScHeaderFooterEditSource(*pContentObj, nPart); } } diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 499e92f6a73a..1fb1f522b29f 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -335,8 +335,7 @@ void ScHeaderFooterTextObj::CreateUnoText_Impl() if ( !pUnoText ) { // can't be aggregated because getString/setString is handled here - ScHeaderFooterEditSource aEditSource( - new ScHeaderFooterTextData(aTextData.GetContentObj(), aTextData.GetPart())); + ScHeaderFooterEditSource aEditSource(aTextData); pUnoText = new SvxUnoText( &aEditSource, lcl_GetHdFtPropertySet(), uno::Reference() ); pUnoText->acquire(); } -- cgit