[Libreoffice-commits] core.git: sw/source
Stephan Bergmann
sbergman at redhat.com
Mon Aug 25 05:30:49 PDT 2014
sw/source/core/inc/unofield.hxx | 2 +-
sw/source/core/unocore/unocoll.cxx | 4 ++--
sw/source/core/unocore/unofield.cxx | 10 +++++-----
3 files changed, 8 insertions(+), 8 deletions(-)
New commits:
commit 2406562733f62b96dd8e6537e1bf4bef147ef50c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Aug 25 14:30:12 2014 +0200
Avoid unnecessary dereferencing of potential null pointers
Change-Id: Iba21dd394010a162a52bb576400cbbb9a9aad537
diff --git a/sw/source/core/inc/unofield.hxx b/sw/source/core/inc/unofield.hxx
index c3e0088..fb8582c 100644
--- a/sw/source/core/inc/unofield.hxx
+++ b/sw/source/core/inc/unofield.hxx
@@ -65,7 +65,7 @@ public:
static ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet>
- CreateXFieldMaster(SwDoc & rDoc, SwFieldType * pType,
+ CreateXFieldMaster(SwDoc * pDoc, SwFieldType * pType,
sal_uInt16 nResId = 0xFFFF);
static OUString GetProgrammaticName(const SwFieldType& rType, SwDoc& rDoc);
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx
index d08e8b9..c320cfa 100644
--- a/sw/source/core/unocore/unocoll.cxx
+++ b/sw/source/core/unocore/unocoll.cxx
@@ -774,7 +774,7 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16
case SW_SERVICE_FIELDMASTER_SET_EXP : nResId = RES_SETEXPFLD; break;
case SW_SERVICE_FIELDMASTER_DATABASE: nResId = RES_DBFLD; break;
}
- xRet = SwXFieldMaster::CreateXFieldMaster(*pDoc, 0, nResId);
+ xRet = SwXFieldMaster::CreateXFieldMaster(pDoc, 0, nResId);
}
break;
case SW_SERVICE_FIELDMASTER_BIBLIOGRAPHY:
@@ -785,7 +785,7 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16
SwAuthorityFieldType aType(pDoc);
pType = pDoc->getIDocumentFieldsAccess().InsertFldType(aType);
}
- xRet = SwXFieldMaster::CreateXFieldMaster(*pDoc, pType);
+ xRet = SwXFieldMaster::CreateXFieldMaster(pDoc, pType);
}
break;
case SW_SERVICE_PARAGRAPH :
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 566381e..70efab2 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -540,7 +540,7 @@ SwXFieldMaster::~SwXFieldMaster()
}
uno::Reference<beans::XPropertySet>
-SwXFieldMaster::CreateXFieldMaster(SwDoc & rDoc, SwFieldType *const pType,
+SwXFieldMaster::CreateXFieldMaster(SwDoc * pDoc, SwFieldType *const pType,
sal_uInt16 nResId)
{
// re-use existing SwXFieldMaster
@@ -552,8 +552,8 @@ SwXFieldMaster::CreateXFieldMaster(SwDoc & rDoc, SwFieldType *const pType,
if (!xFM.is())
{
SwXFieldMaster *const pFM( (pType)
- ? new SwXFieldMaster(*pType, rDoc)
- : new SwXFieldMaster(& rDoc, nResId));
+ ? new SwXFieldMaster(*pType, *pDoc)
+ : new SwXFieldMaster(pDoc, nResId));
xFM.set(pFM);
if (pType)
{
@@ -1309,7 +1309,7 @@ SwXTextField::getTextFieldMaster() throw (uno::RuntimeException, std::exception)
}
uno::Reference<beans::XPropertySet> const xRet(
- SwXFieldMaster::CreateXFieldMaster(*m_pImpl->m_pDoc, pType));
+ SwXFieldMaster::CreateXFieldMaster(m_pImpl->m_pDoc, pType));
return xRet;
}
@@ -2758,7 +2758,7 @@ uno::Any SwXTextFieldMasters::getByName(const OUString& rName)
css::uno::Reference<css::uno::XInterface>());
uno::Reference<beans::XPropertySet> const xRet(
- SwXFieldMaster::CreateXFieldMaster(*GetDoc(), pType));
+ SwXFieldMaster::CreateXFieldMaster(GetDoc(), pType));
return uno::makeAny(xRet);
}
More information about the Libreoffice-commits
mailing list