summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unodraw.cxx
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-10-22 17:29:01 +0200
committerArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-10-22 17:29:01 +0200
commit44d4c2c3acee48f2f9419ab5a4334aa5440f8779 (patch)
treecae3c7a74a45964642bc8a089915a22294a31951 /sw/source/core/unocore/unodraw.cxx
parentb0a85159e5f99baee901adad447a157f65e507b4 (diff)
parentf71bb16fc284f022a844b575a8db75be7a4aafb1 (diff)
commit after rebase to DEV300m62
Diffstat (limited to 'sw/source/core/unocore/unodraw.cxx')
-rw-r--r--sw/source/core/unocore/unodraw.cxx39
1 files changed, 25 insertions, 14 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index c75e4b691b51..f0addeed003f 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1290,20 +1290,25 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
const xub_StrLen nIdx = pPos->nContent.GetIndex();
- SwTxtAttr * pHnt = pTxtNode->GetTxtAttr( nIdx, RES_TXTATR_FLYCNT );
+ SwTxtAttr * const pHnt =
+ pTxtNode->GetTxtAttrForCharAt(
+ nIdx, RES_TXTATR_FLYCNT );
DBG_ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
"Missing FlyInCnt-Hint." );
DBG_ASSERT( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFmt,
"Wrong TxtFlyCnt-Hint." );
- ((SwFmtFlyCnt&)pHnt->GetFlyCnt()).SetFlyFmt();
+ const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt())
+ .SetFlyFmt();
//The connection is removed now the attribute can be deleted.
- pTxtNode->Delete( RES_TXTATR_FLYCNT, nIdx, nIdx );
+ pTxtNode->DeleteAttributes(
+ RES_TXTATR_FLYCNT, nIdx );
//create a new one
SwTxtNode *pNd = pInternalPam->GetNode()->GetTxtNode();
- DBG_ASSERT( pNd, "Crsr steht nicht auf TxtNode." );
- pNd->InsertItem( SwFmtFlyCnt( pFmt ),
- pInternalPam->GetPoint()->nContent.GetIndex(), 0 );
+ DBG_ASSERT( pNd, "Cursor not at TxtNode." );
+ SwFmtFlyCnt aFmt( pFmt );
+ pNd->InsertItem(aFmt, pInternalPam->GetPoint()
+ ->nContent.GetIndex(), 0 );
}
else
{
@@ -1372,15 +1377,18 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode();
ASSERT( pTxtNode->HasHints(), "Missing FlyInCnt-Hint." );
const xub_StrLen nIdx = pPos->nContent.GetIndex();
- SwTxtAttr * pHnt = pTxtNode->GetTxtAttr( nIdx, RES_TXTATR_FLYCNT );
+ SwTxtAttr * const pHnt =
+ pTxtNode->GetTxtAttrForCharAt(
+ nIdx, RES_TXTATR_FLYCNT );
DBG_ASSERT( pHnt && pHnt->Which() == RES_TXTATR_FLYCNT,
"Missing FlyInCnt-Hint." );
DBG_ASSERT( pHnt && pHnt->GetFlyCnt().GetFrmFmt() == pFlyFmt,
"Wrong TxtFlyCnt-Hint." );
- ((SwFmtFlyCnt&)pHnt->GetFlyCnt()).SetFlyFmt();
+ const_cast<SwFmtFlyCnt&>(pHnt->GetFlyCnt())
+ .SetFlyFmt();
//The connection is removed now the attribute can be deleted.
- pTxtNode->Delete( RES_TXTATR_FLYCNT, nIdx, nIdx );
+ pTxtNode->DeleteAttributes(RES_TXTATR_FLYCNT, nIdx);
}
else if( text::TextContentAnchorType_AT_PAGE != eNewAnchor &&
FLY_PAGE == eOldAnchorId )
@@ -1411,8 +1419,9 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A
//the RES_TXTATR_FLYCNT needs to be added now
SwTxtNode *pNd = aPam.GetNode()->GetTxtNode();
DBG_ASSERT( pNd, "Crsr is not in a TxtNode." );
- pNd->InsertItem( SwFmtFlyCnt( pFlyFmt ),
- aPam.GetPoint()->nContent.GetIndex(), 0 );
+ SwFmtFlyCnt aFmt( pFlyFmt );
+ pNd->InsertItem(aFmt,
+ aPam.GetPoint()->nContent.GetIndex(), 0 );
//aPam.GetPoint()->nContent--;
}
@@ -2117,8 +2126,10 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange)
pDoc = pText->GetDoc();
else if (!pDoc && pCursor)
pDoc = pCursor->GetDoc();
- else if ( !pDoc && pPortion && pPortion->GetCrsr() )
- pDoc = pPortion->GetCrsr()->GetDoc();
+ else if ( !pDoc && pPortion && pPortion->GetCursor() )
+ {
+ pDoc = pPortion->GetCursor()->GetDoc();
+ }
}
@@ -2206,7 +2217,7 @@ void SwXShape::dispose(void) throw( uno::RuntimeException )
const SwPosition &rPos = *(pFmt->GetAnchor().GetCntntAnchor());
SwTxtNode *pTxtNode = rPos.nNode.GetNode().GetTxtNode();
const xub_StrLen nIdx = rPos.nContent.GetIndex();
- pTxtNode->Delete( RES_TXTATR_FLYCNT, nIdx, nIdx );
+ pTxtNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx );
}
else
pFmt->GetDoc()->DelLayoutFmt( pFmt );