summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-04-24 10:39:03 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-04-26 09:58:00 -0400
commit1e6268e50d94eac41743ee23efc1b5dc4bd176bd (patch)
treedb5d1d588878948fdace3e37ab6cc73a013531e3 /sc
parent8cd07281370a51023e1fe65100809f68e6489d6e (diff)
Simplified the constructors.
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/editsrc.hxx3
-rw-r--r--sc/source/ui/unoobj/editsrc.cxx8
-rw-r--r--sc/source/ui/unoobj/fielduno.cxx6
-rw-r--r--sc/source/ui/unoobj/textuno.cxx3
4 files changed, 7 insertions, 13 deletions
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<text::XText>() );
pUnoText->acquire();
}