diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-03-02 21:43:52 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-03-03 00:05:30 +0100 |
commit | 6be1128916b9c9441969d9a37a4b6694ac26eb8b (patch) | |
tree | d8b3eeccec31cf23a62163b7fb9651c4f7294d82 /sw | |
parent | unofield.cxx: fix indentation a little (diff) | |
download | core-6be1128916b9c9441969d9a37a4b6694ac26eb8b.tar.gz core-6be1128916b9c9441969d9a37a4b6694ac26eb8b.zip |
SwXTextField::setPropertyValue: simplify a bit:
It looks like the second call to PutValue() was accidentally inserted
in f462a51fcc8e50f3255d2d8c98a4c6408dce725e.
Also, pDoc is valid when pField is.
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unofield.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index db452a4f6cf6..bb6bef83fa2c 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -1893,18 +1893,14 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An else { SwDoc * pDoc = GetDoc(); - - if (NULL != pDoc) - { - const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld(); - if(!pTxtFld) - throw uno::RuntimeException(); - SwPosition aPosition( pTxtFld->GetTxtNode() ); - aPosition.nContent = *pTxtFld->GetStart(); - pDoc->PutValueToField( aPosition, rValue, pEntry->nWID); - } + assert(pDoc); + const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld(); + if(!pTxtFld) + throw uno::RuntimeException(); + SwPosition aPosition( pTxtFld->GetTxtNode() ); + aPosition.nContent = *pTxtFld->GetStart(); + pDoc->PutValueToField( aPosition, rValue, pEntry->nWID); } - pField->PutValue( rValue, pEntry->nWID ); //#i100374# notify SwPostIt about new field content if (RES_POSTITFLD== nWhich && pFmtFld) |