summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unofield.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/unocore/unofield.cxx')
-rw-r--r--sw/source/core/unocore/unofield.cxx38
1 files changed, 10 insertions, 28 deletions
diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx
index 29ce23c129..778b48294c 100644
--- a/sw/source/core/unocore/unofield.cxx
+++ b/sw/source/core/unocore/unofield.cxx
@@ -1971,12 +1971,12 @@ void SwXTextField::setPropertyValue(const OUString& rPropertyName, const uno::An
if (NULL != pDoc)
{
- SwPosition * pPos = GetPosition();
-
- ASSERT(pPos, "no position");
- pDoc->PutValueToField( *pPos, rValue, pEntry->nWID);
-
- delete pPos;
+ const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld();
+ if(!pTxtFld)
+ throw uno::RuntimeException();
+ SwPosition aPosition( pTxtFld->GetTxtNode() );
+ aPosition.nContent = *pTxtFld->GetStart();
+ pDoc->PutValueToField( aPosition, rValue, pEntry->nWID);
}
// <- #111840#
}
@@ -2172,12 +2172,11 @@ uno::Any SwXTextField::getPropertyValue(const OUString& rPropertyName)
xub_StrLen nHiddenStart;
xub_StrLen nHiddenEnd;
- SwPosition *pPos = pTxtFld->GetPosition();
- if (!pPos)
- throw uno::RuntimeException();
+ SwPosition aPosition( pTxtFld->GetTxtNode() );
+ aPosition.nContent = *pTxtFld->GetStart();
- bHidden = SwScriptInfo::GetBoundsOfHiddenRange( rTxtNode,
- pPos->nContent.GetIndex(),
+ bHidden = SwScriptInfo::GetBoundsOfHiddenRange( pTxtFld->GetTxtNode(),
+ *pTxtFld->GetStart(),
nHiddenStart, nHiddenEnd );
}
@@ -2477,23 +2476,6 @@ const SwField* SwXTextField::GetField() const
return 0;
}
-// #111840#
-SwPosition * SwXTextField::GetPosition()
-{
- SwPosition * pResult = NULL;
- const SwFmtFld * pFmtFld2 = GetFldFmt();
-
- if (pFmtFld2)
- {
- const SwTxtFld * pTxtFld = pFmtFld2->GetTxtFld();
-
- if (pTxtFld)
- pResult = pTxtFld->GetPosition();
- }
-
- return pResult;
-}
-
/******************************************************************
*
******************************************************************/