diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-13 15:22:36 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-13 23:35:50 -0400 |
commit | ff887e882164ed8b5c8f08b4db48c99146c15b9c (patch) | |
tree | cd34c0a3820a0fc4f70a386ae608d09fce76d2b2 | |
parent | UniString to rtl::OUString. (diff) | |
download | core-ff887e882164ed8b5c8f08b4db48c99146c15b9c.tar.gz core-ff887e882164ed8b5c8f08b4db48c99146c15b9c.zip |
SafeGetObject() no longer needed since GetObject() does the same thing.
-rw-r--r-- | editeng/source/editeng/editdoc.cxx | 12 | ||||
-rw-r--r-- | editeng/source/editeng/editdoc.hxx | 3 | ||||
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 18 | ||||
-rw-r--r-- | editeng/source/editeng/editundo.cxx | 8 | ||||
-rw-r--r-- | editeng/source/editeng/eertfpar.cxx | 10 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 26 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 18 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 16 | ||||
-rw-r--r-- | editeng/source/editeng/impedit5.cxx | 20 |
9 files changed, 59 insertions, 72 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index d2aca617e45c..3b8244a73c5c 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -1969,16 +1969,6 @@ static const sal_Unicode aCR[] = { 0x0d, 0x00 }; static const sal_Unicode aLF[] = { 0x0a, 0x00 }; static const sal_Unicode aCRLF[] = { 0x0d, 0x0a, 0x00 }; -const ContentNode* EditDoc::SafeGetObject(size_t nPos) const -{ - return ( nPos < Count() ) ? GetObject( nPos ) : 0; -} - -ContentNode* EditDoc::SafeGetObject(size_t nPos) -{ - return ( nPos < Count() ) ? GetObject( nPos ) : 0; -} - size_t EditDoc::GetPos(const ContentNode* p) const { return FastGetPos(maContents, p, nLastCache); @@ -2081,7 +2071,7 @@ XubString EditDoc::GetText( LineEnd eEnd ) const XubString EditDoc::GetParaAsString( sal_uInt16 nNode ) const { - return GetParaAsString( SafeGetObject( nNode ) ); + return GetParaAsString( GetObject( nNode ) ); } XubString EditDoc::GetParaAsString( diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index 3e17f74493e8..531652c6aa7f 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -811,9 +811,6 @@ public: sal_Bool RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, sal_uInt16 nWhich = 0 ); void FindAttribs( ContentNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet ); - const ContentNode* SafeGetObject(size_t nPos) const; - ContentNode* SafeGetObject(size_t nPos); - size_t GetPos(const ContentNode* pNode) const; const ContentNode* GetObject(size_t nPos) const; ContentNode* GetObject(size_t nPos); diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 1d5fe3a1aa82..558852f50791 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -503,7 +503,7 @@ sal_uInt16 EditEngine::GetScriptType( const ESelection& rSelection ) const LanguageType EditEngine::GetLanguage( sal_uInt16 nPara, sal_uInt16 nPos ) const { DBG_CHKTHIS( EditEngine, 0 ); - ContentNode* pNode = pImpEditEngine->GetEditDoc().SafeGetObject( nPara ); + ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara ); DBG_ASSERT( pNode, "GetLanguage - nPara is invalid!" ); return pNode ? pImpEditEngine->GetLanguage( EditPaM( pNode, nPos ) ) : LANGUAGE_DONTKNOW; } @@ -1322,8 +1322,8 @@ EditTextObject* EditEngine::CreateTextObject( sal_uInt16 nPara, sal_uInt16 nPara DBG_ASSERT( nPara < pImpEditEngine->GetEditDoc().Count(), "CreateTextObject: Startpara out of Range" ); DBG_ASSERT( nParas <= pImpEditEngine->GetEditDoc().Count() - nPara, "CreateTextObject: Endpara out of Range" ); - ContentNode* pStartNode = pImpEditEngine->GetEditDoc().SafeGetObject( nPara ); - ContentNode* pEndNode = pImpEditEngine->GetEditDoc().SafeGetObject( nPara+nParas-1 ); + ContentNode* pStartNode = pImpEditEngine->GetEditDoc().GetObject( nPara ); + ContentNode* pEndNode = pImpEditEngine->GetEditDoc().GetObject( nPara+nParas-1 ); DBG_ASSERT( pStartNode, "Start-Paragraph does not exist: CreateTextObject" ); DBG_ASSERT( pEndNode, "End-Paragraph does not exist: CreateTextObject" ); @@ -1344,7 +1344,7 @@ void EditEngine::RemoveParagraph( sal_uInt16 nPara ) if( pImpEditEngine->GetEditDoc().Count() <= 1 ) return; - ContentNode* pNode = pImpEditEngine->GetEditDoc().SafeGetObject( nPara ); + ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara ); const ParaPortion* pPortion = pImpEditEngine->GetParaPortions().SafeGetObject( nPara ); DBG_ASSERT( pPortion && pNode, "Paragraph not found: RemoveParagraph" ); if ( pNode && pPortion ) @@ -1360,7 +1360,7 @@ void EditEngine::RemoveParagraph( sal_uInt16 nPara ) sal_uInt16 EditEngine::GetTextLen( sal_uInt16 nPara ) const { DBG_CHKTHIS( EditEngine, 0 ); - ContentNode* pNode = pImpEditEngine->GetEditDoc().SafeGetObject( nPara ); + ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara ); DBG_ASSERT( pNode, "Paragraph not found: GetTextLen" ); if ( pNode ) return pNode->Len(); @@ -1535,7 +1535,7 @@ Font EditEngine::GetStandardFont( sal_uInt16 nPara ) SvxFont EditEngine::GetStandardSvxFont( sal_uInt16 nPara ) { DBG_CHKTHIS( EditEngine, 0 ); - ContentNode* pNode = pImpEditEngine->GetEditDoc().SafeGetObject( nPara ); + ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara ); return pNode->GetCharAttribs().GetDefFont(); } @@ -2046,7 +2046,7 @@ sal_Bool EditEngine::ShouldCreateBigTextObject() const sal_uInt16 EditEngine::GetFieldCount( sal_uInt16 nPara ) const { sal_uInt16 nFields = 0; - ContentNode* pNode = pImpEditEngine->GetEditDoc().SafeGetObject( nPara ); + ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara ); if ( pNode ) { const CharAttribList::AttribsType& rAttrs = pNode->GetCharAttribs().GetAttribs(); @@ -2063,7 +2063,7 @@ sal_uInt16 EditEngine::GetFieldCount( sal_uInt16 nPara ) const EFieldInfo EditEngine::GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const { - ContentNode* pNode = pImpEditEngine->GetEditDoc().SafeGetObject( nPara ); + ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara ); if ( pNode ) { sal_uInt16 nCurrentField = 0; @@ -2176,7 +2176,7 @@ EPosition EditEngine::FindDocPosition( const Point& rDocPos ) const Rectangle EditEngine::GetCharacterBounds( const EPosition& rPos ) const { Rectangle aBounds; - ContentNode* pNode = pImpEditEngine->GetEditDoc().SafeGetObject( rPos.nPara ); + ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( rPos.nPara ); // Check against index, not paragraph if ( pNode && ( rPos.nIndex < pNode->Len() ) ) diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index d1f65b91dcbf..6fae46c4d3b8 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -205,7 +205,7 @@ void EditUndoDelContent::Redo() // pNode is no longer correct, if the paragraphs where merged // in between Undos - pContentNode = _pImpEE->GetEditDoc().SafeGetObject( nNode ); + pContentNode = _pImpEE->GetEditDoc().GetObject( nNode ); DBG_ASSERT( pContentNode, "EditUndoDelContent::Redo(): Node?!" ); _pImpEE->GetParaPortions().Remove( nNode ); @@ -220,8 +220,8 @@ void EditUndoDelContent::Redo() _pImpEE->UpdateSelections(); ContentNode* pN = ( nNode < _pImpEE->GetEditDoc().Count() ) - ? _pImpEE->GetEditDoc().SafeGetObject( nNode ) - : _pImpEE->GetEditDoc().SafeGetObject( nNode-1 ); + ? _pImpEE->GetEditDoc().GetObject( nNode ) + : _pImpEE->GetEditDoc().GetObject( nNode-1 ); DBG_ASSERT( pN && ( pN != pContentNode ), "?! RemoveContent !? " ); EditPaM aPaM( pN, pN->Len() ); @@ -576,7 +576,7 @@ void EditUndoSetAttribs::Undo() // Then the character attributes ... // Remove all attributes including features, are later re-established. _pImpEE->RemoveCharAttribs(nPara, 0, true); - DBG_ASSERT( _pImpEE->GetEditDoc().SafeGetObject( nPara ), "Undo (SetAttribs): pNode = NULL!" ); + DBG_ASSERT( _pImpEE->GetEditDoc().GetObject( nPara ), "Undo (SetAttribs): pNode = NULL!" ); ContentNode* pNode = _pImpEE->GetEditDoc().GetObject( nPara ); for (size_t nAttr = 0; nAttr < rInf.GetPrevCharAttribs().size(); ++nAttr) { diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index 262459ac90d7..9749706b72a6 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -132,7 +132,7 @@ SvParserState EditRTFParser::CallParser() { ContentNode* pCurNode = aCurSel.Max().GetNode(); sal_uInt16 nPara = pImpEditEngine->GetEditDoc().GetPos( pCurNode ); - ContentNode* pPrevNode = pImpEditEngine->GetEditDoc().SafeGetObject( nPara-1 ); + ContentNode* pPrevNode = pImpEditEngine->GetEditDoc().GetObject( nPara-1 ); DBG_ASSERT( pPrevNode, "Invalid RTF-Document?!" ); EditSelection aSel; aSel.Min() = EditPaM( pPrevNode, pPrevNode->Len() ); @@ -178,7 +178,7 @@ void EditRTFParser::AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& r sal_uInt16 nEndPara = pImpEditEngine->GetEditDoc().GetPos( rEnd.GetNode() ); for ( sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++ ) { - ContentNode* pNode = pImpEditEngine->GetEditDoc().SafeGetObject( nPara ); + ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( nPara ); DBG_ASSERT( pNode, "AddRTFDefaultValues - No paragraph?!" ); if ( !pNode->GetContentAttribs().HasItem( EE_CHAR_FONTINFO ) ) pNode->GetContentAttribs().GetItems().Put( aFontItem ); @@ -296,7 +296,7 @@ void EditRTFParser::SetEndPrevPara( SvxNodeIdx*& rpNodePos, DBG_ASSERT( nCurPara != 0, "Paragraph equal to 0: SetEnfPrevPara" ); if ( nCurPara ) nCurPara--; - ContentNode* pPrevNode = pImpEditEngine->GetEditDoc().SafeGetObject( nCurPara ); + ContentNode* pPrevNode = pImpEditEngine->GetEditDoc().GetObject( nCurPara ); DBG_ASSERT( pPrevNode, "pPrevNode = 0!" ); rpNodePos = new EditNodeIdx( pImpEditEngine, pPrevNode ); rCntPos = pPrevNode->Len(); @@ -388,7 +388,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) // All Complete paragraphs are paragraph attributes ... for ( sal_uInt16 z = nStartNode+1; z < nEndNode; z++ ) { - DBG_ASSERT( pImpEditEngine->GetEditDoc().SafeGetObject( z ), "Node does not exist yet(RTF)" ); + DBG_ASSERT( pImpEditEngine->GetEditDoc().GetObject( z ), "Node does not exist yet(RTF)" ); pImpEditEngine->SetParaAttribs( z, rSet.GetAttrSet() ); } @@ -426,7 +426,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) { for ( sal_uInt16 n = nStartNode; n <= nEndNode; n++ ) { - ContentNode* pNode = pImpEditEngine->GetEditDoc().SafeGetObject( n ); + ContentNode* pNode = pImpEditEngine->GetEditDoc().GetObject( n ); pNode->GetContentAttribs().GetItems().Put( SfxInt16Item( EE_PARA_OUTLLEVEL, nOutlLevel ) ); } } diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 56a8b39ca6a4..dff770679a3f 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -294,7 +294,7 @@ XubString ImpEditEngine::GetSelected( const EditSelection& rSel, const LineEnd e // iterate over the paragraphs ... for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { - OSL_ENSURE( aEditDoc.SafeGetObject( nNode ), "Node not found: GetSelected" ); + OSL_ENSURE( aEditDoc.GetObject( nNode ), "Node not found: GetSelected" ); const ContentNode* pNode = aEditDoc.GetObject( nNode ); xub_StrLen nStartPos = 0; @@ -1438,13 +1438,13 @@ EditPaM ImpEditEngine::CursorEndOfParagraph( const EditPaM& rPaM ) EditPaM ImpEditEngine::CursorStartOfDoc() { - EditPaM aPaM( aEditDoc.SafeGetObject( 0 ), 0 ); + EditPaM aPaM( aEditDoc.GetObject( 0 ), 0 ); return aPaM; } EditPaM ImpEditEngine::CursorEndOfDoc() { - ContentNode* pLastNode = aEditDoc.SafeGetObject( aEditDoc.Count()-1 ); + ContentNode* pLastNode = aEditDoc.GetObject( aEditDoc.Count()-1 ); ParaPortion* pLastPortion = GetParaPortions().SafeGetObject( aEditDoc.Count()-1 ); OSL_ENSURE( pLastNode && pLastPortion, "CursorEndOfDoc: Node or Portion not found" ); @@ -1453,7 +1453,7 @@ EditPaM ImpEditEngine::CursorEndOfDoc() pLastNode = GetPrevVisNode( pLastPortion->GetNode() ); OSL_ENSURE( pLastNode, "Kein sichtbarer Absatz?" ); if ( !pLastNode ) - pLastNode = aEditDoc.SafeGetObject( aEditDoc.Count()-1 ); + pLastNode = aEditDoc.GetObject( aEditDoc.Count()-1 ); } EditPaM aPaM( pLastNode, pLastNode->Len() ); @@ -1495,7 +1495,7 @@ EditPaM ImpEditEngine::WordLeft( const EditPaM& rPaM, sal_Int16 nWordType ) { // Previous paragraph... sal_uInt16 nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() ); - ContentNode* pPrevNode = aEditDoc.SafeGetObject( --nCurPara ); + ContentNode* pPrevNode = aEditDoc.GetObject( --nCurPara ); if ( pPrevNode ) { aNewPaM.SetNode( pPrevNode ); @@ -1546,7 +1546,7 @@ EditPaM ImpEditEngine::WordRight( const EditPaM& rPaM, sal_Int16 nWordType ) { // Next paragraph ... sal_uInt16 nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() ); - ContentNode* pNextNode = aEditDoc.SafeGetObject( ++nCurPara ); + ContentNode* pNextNode = aEditDoc.GetObject( ++nCurPara ); if ( pNextNode ) { aNewPaM.SetNode( pNextNode ); @@ -2050,7 +2050,7 @@ sal_uInt8 ImpEditEngine::GetRightToLeft( sal_uInt16 nPara, sal_uInt16 nPos, sal_ { sal_uInt8 nRightToLeft = 0; - ContentNode* pNode = aEditDoc.SafeGetObject( nPara ); + ContentNode* pNode = aEditDoc.GetObject( nPara ); if ( pNode && pNode->Len() ) { ParaPortion* pParaPortion = GetParaPortions().SafeGetObject( nPara ); @@ -2490,8 +2490,8 @@ EditPaM ImpEditEngine::ImpDeleteSelection( EditSelection aSel ) void ImpEditEngine::ImpRemoveParagraph( sal_uInt16 nPara ) { - ContentNode* pNode = aEditDoc.SafeGetObject( nPara ); - ContentNode* pNextNode = aEditDoc.SafeGetObject( nPara+1 ); + ContentNode* pNode = aEditDoc.GetObject( nPara ); + ContentNode* pNextNode = aEditDoc.GetObject( nPara+1 ); OSL_ENSURE( pNode, "Blind Node in ImpRemoveParagraph" ); @@ -2913,7 +2913,7 @@ EditPaM ImpEditEngine::ImpFastInsertParagraph( sal_uInt16 nPara ) { if ( nPara ) { - OSL_ENSURE( aEditDoc.SafeGetObject( nPara-1 ), "FastInsertParagraph: Prev does not exist" ); + OSL_ENSURE( aEditDoc.GetObject( nPara-1 ), "FastInsertParagraph: Prev does not exist" ); InsertUndo( new EditUndoSplitPara( this, nPara-1, aEditDoc.GetObject( nPara-1 )->Len() ) ); } else @@ -3293,7 +3293,7 @@ void ImpEditEngine::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uIn sal_uInt16 ImpEditEngine::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const { sal_uInt16 nLineNo = 0xFFFF; - const ContentNode* pNode = GetEditDoc().SafeGetObject( nPara ); + const ContentNode* pNode = GetEditDoc().GetObject( nPara ); OSL_ENSURE( pNode, "GetLineNumberAtIndex: invalid paragraph index" ); if (pNode) { @@ -3416,7 +3416,7 @@ EditSelection ImpEditEngine::ConvertSelection( EditSelection aNewSelection; // Start... - ContentNode* pNode = aEditDoc.SafeGetObject( nStartPara ); + ContentNode* pNode = aEditDoc.GetObject( nStartPara ); sal_uInt16 nIndex = nStartPos; if ( !pNode ) { @@ -3430,7 +3430,7 @@ EditSelection ImpEditEngine::ConvertSelection( aNewSelection.Min().SetIndex( nIndex ); // End... - pNode = aEditDoc.SafeGetObject( nEndPara ); + pNode = aEditDoc.GetObject( nEndPara ); nIndex = nEndPos; if ( !pNode ) { diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 46cfe041d1b0..3d6ed7194cec 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -3574,7 +3574,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool b Color aBackgroundColor( pView->GetBackgroundColor() ); // #i47161# Check if text is visible on background SvxFont aTmpFont; - ContentNode* pNode = GetEditDoc().SafeGetObject( 0 ); + ContentNode* pNode = GetEditDoc().GetObject( 0 ); SeekCursor( pNode, 1, aTmpFont ); Color aFontColor( aTmpFont.GetColor() ); if( (aFontColor == COL_AUTO) || IsForceAutoColor() ) @@ -3744,7 +3744,7 @@ void ImpEditEngine::InsertContent( ContentNode* pNode, sal_uInt16 nPos ) EditPaM ImpEditEngine::SplitContent( sal_uInt16 nNode, sal_uInt16 nSepPos ) { - ContentNode* pNode = aEditDoc.SafeGetObject( nNode ); + ContentNode* pNode = aEditDoc.GetObject( nNode ); DBG_ASSERT( pNode, "Invalid Node in SplitContent" ); DBG_ASSERT( IsInUndo(), "SplitContent only for Undo()!" ); DBG_ASSERT( nSepPos <= pNode->Len(), "Index out of range: SplitContent" ); @@ -3754,8 +3754,8 @@ EditPaM ImpEditEngine::SplitContent( sal_uInt16 nNode, sal_uInt16 nSepPos ) EditPaM ImpEditEngine::ConnectContents( sal_uInt16 nLeftNode, sal_Bool bBackward ) { - ContentNode* pLeftNode = aEditDoc.SafeGetObject( nLeftNode ); - ContentNode* pRightNode = aEditDoc.SafeGetObject( nLeftNode+1 ); + ContentNode* pLeftNode = aEditDoc.GetObject( nLeftNode ); + ContentNode* pRightNode = aEditDoc.GetObject( nLeftNode+1 ); DBG_ASSERT( pLeftNode, "Invalid left node in ConnectContents "); DBG_ASSERT( pRightNode, "Invalid right node in ConnectContents "); DBG_ASSERT( IsInUndo(), "ConnectContent only for Undo()!" ); @@ -4004,15 +4004,15 @@ EditPaM ImpEditEngine::InsertParagraph( sal_uInt16 nPara ) EditPaM aPaM; if ( nPara != 0 ) { - ContentNode* pNode = GetEditDoc().SafeGetObject( nPara-1 ); + ContentNode* pNode = GetEditDoc().GetObject( nPara-1 ); if ( !pNode ) - pNode = GetEditDoc().SafeGetObject( GetEditDoc().Count() - 1 ); + pNode = GetEditDoc().GetObject( GetEditDoc().Count() - 1 ); DBG_ASSERT( pNode, "Not a single paragraph in InsertParagraph ?" ); aPaM = EditPaM( pNode, pNode->Len() ); } else { - ContentNode* pNode = GetEditDoc().SafeGetObject( 0 ); + ContentNode* pNode = GetEditDoc().GetObject( 0 ); aPaM = EditPaM( pNode, 0 ); } @@ -4022,7 +4022,7 @@ EditPaM ImpEditEngine::InsertParagraph( sal_uInt16 nPara ) EditSelection* ImpEditEngine::SelectParagraph( sal_uInt16 nPara ) { EditSelection* pSel = 0; - ContentNode* pNode = GetEditDoc().SafeGetObject( nPara ); + ContentNode* pNode = GetEditDoc().GetObject( nPara ); DBG_ASSERTWARNING( pNode, "Paragraph does not exist: SelectParagraph" ); if ( pNode ) pSel = new EditSelection( EditPaM( pNode, 0 ), EditPaM( pNode, pNode->Len() ) ); @@ -4209,7 +4209,7 @@ void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_uInt16 nPara, } else { - ContentNode* pNode = GetEditDoc().SafeGetObject( nPara ); + ContentNode* pNode = GetEditDoc().GetObject( nPara ); short nScriptType = GetScriptType( EditPaM( pNode, nIndex+1 ) ); bCTL = nScriptType == i18n::ScriptType::COMPLEX; bR2L = GetRightToLeft( nPara, nIndex + 1); // this change was discussed in issue 37190 diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 61bbc39c74c5..25608f8a4301 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -551,7 +551,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) rOutput << '{' << endl; for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { - ContentNode* pNode = aEditDoc.SafeGetObject( nNode ); + ContentNode* pNode = aEditDoc.GetObject( nNode ); DBG_ASSERT( pNode, "Node not found: Search&Replace" ); // The paragraph attributes in advance ... @@ -1057,7 +1057,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP sal_uInt16 nNode; for ( nNode = nStartNode; nNode <= nEndNode; nNode++ ) { - ContentNode* pNode = aEditDoc.SafeGetObject( nNode ); + ContentNode* pNode = aEditDoc.GetObject( nNode ); DBG_ASSERT( pNode, "Node not found: Search&Replace" ); if ( bOnlyFullParagraphs ) @@ -1658,7 +1658,7 @@ void ImpEditEngine::ImpConvert( rtl::OUString &rConvTxt, LanguageType &rConvTxtL String aRes; LanguageType nResLang = LANGUAGE_NONE; - /* ContentNode* pLastNode = */ aEditDoc.SafeGetObject( aEditDoc.Count()-1 ); + /* ContentNode* pLastNode = */ aEditDoc.GetObject( aEditDoc.Count()-1 ); EditPaM aPos( CreateEditPaM( pConvInfo->aConvContinue ) ); EditSelection aCurSel = EditSelection( aPos, aPos ); @@ -1820,7 +1820,7 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView ) { DBG_ASSERT( xSpeller.is(), "No spell checker set!" ); - ContentNode* pLastNode = aEditDoc.SafeGetObject( (aEditDoc.Count()-1) ); + ContentNode* pLastNode = aEditDoc.GetObject( (aEditDoc.Count()-1) ); EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() ); aCurSel.Min() = aCurSel.Max(); @@ -1892,7 +1892,7 @@ void ImpEditEngine::StartSpelling(EditView& rEditView, sal_Bool bMultipleDoc) Reference< XSpellAlternatives > ImpEditEngine::ImpFindNextError(EditSelection& rSelection) { - /* ContentNode* pLastNode = */ aEditDoc.SafeGetObject( (aEditDoc.Count()-1) ); + aEditDoc.GetObject( (aEditDoc.Count()-1) ); EditSelection aCurSel( rSelection.Min() ); String aWord; @@ -1952,7 +1952,7 @@ bool ImpEditEngine::SpellSentence(EditView& rEditView, //if no selection previously exists the range is extended to the end of the object if(aCurSel.Min() == aCurSel.Max()) { - ContentNode* pLastNode = aEditDoc.SafeGetObject( aEditDoc.Count()-1); + ContentNode* pLastNode = aEditDoc.GetObject( aEditDoc.Count()-1); aCurSel.Max() = EditPaM(pLastNode, pLastNode->Len()); } // check for next error in aCurSel and set aCurSel to that one if any was found @@ -2248,7 +2248,7 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel } sal_Bool bRestartTimer = sal_False; - ContentNode* pLastNode = aEditDoc.SafeGetObject( aEditDoc.Count() - 1 ); + ContentNode* pLastNode = aEditDoc.GetObject( aEditDoc.Count() - 1 ); sal_uInt16 nNodes = GetEditDoc().Count(); sal_uInt16 nInvalids = 0; Sequence< PropertyValue > aEmptySeq; @@ -2432,7 +2432,7 @@ EESpellState ImpEditEngine::HasSpellErrors() { DBG_ASSERT( xSpeller.is(), "No spell checker set!" ); - ContentNode* pLastNode = aEditDoc.SafeGetObject( aEditDoc.Count() - 1 ); + ContentNode* pLastNode = aEditDoc.GetObject( aEditDoc.Count() - 1 ); EditSelection aCurSel( aEditDoc.GetStartPaM() ); String aWord; diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index 2dd9328912dd..a8e8601b4eab 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -48,13 +48,13 @@ void ImpEditEngine::SetStyleSheetPool( SfxStyleSheetPool* pSPool ) const SfxStyleSheet* ImpEditEngine::GetStyleSheet( sal_uInt16 nPara ) const { - const ContentNode* pNode = aEditDoc.SafeGetObject( nPara ); + const ContentNode* pNode = aEditDoc.GetObject( nPara ); return pNode ? pNode->GetContentAttribs().GetStyleSheet() : NULL; } SfxStyleSheet* ImpEditEngine::GetStyleSheet( sal_uInt16 nPara ) { - ContentNode* pNode = aEditDoc.SafeGetObject( nPara ); + ContentNode* pNode = aEditDoc.GetObject( nPara ); return pNode ? pNode->GetContentAttribs().GetStyleSheet() : NULL; } @@ -77,7 +77,7 @@ void ImpEditEngine::SetStyleSheet( EditSelection aSel, SfxStyleSheet* pStyle ) void ImpEditEngine::SetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle ) { DBG_ASSERT( GetStyleSheetPool() || !pStyle, "SetStyleSheet: No StyleSheetPool registered!" ); - ContentNode* pNode = aEditDoc.SafeGetObject( nPara ); + ContentNode* pNode = aEditDoc.GetObject( nPara ); SfxStyleSheet* pCurStyle = pNode->GetStyleSheet(); if ( pStyle != pCurStyle ) { @@ -217,7 +217,7 @@ EditUndoSetAttribs* ImpEditEngine::CreateAttribUndo( EditSelection aSel, const S for ( sal_uInt16 nPara = nStartNode; nPara <= nEndNode; nPara++ ) { ContentNode* pNode = aEditDoc.GetObject( nPara ); - DBG_ASSERT( aEditDoc.SafeGetObject( nPara ), "Node not found: CreateAttribUndo" ); + DBG_ASSERT( aEditDoc.GetObject( nPara ), "Node not found: CreateAttribUndo" ); ContentAttribsInfo* pInf = new ContentAttribsInfo( pNode->GetContentAttribs().GetItems() ); pUndo->AppendContentInfo(pInf); @@ -330,7 +330,7 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, sal_Bool bOnlyHardAttr for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { ContentNode* pNode = aEditDoc.GetObject( nNode ); - DBG_ASSERT( aEditDoc.SafeGetObject( nNode ), "Node not found: GetAttrib" ); + DBG_ASSERT( aEditDoc.GetObject( nNode ), "Node not found: GetAttrib" ); xub_StrLen nStartPos = 0; xub_StrLen nEndPos = pNode->Len(); @@ -415,7 +415,7 @@ SfxItemSet ImpEditEngine::GetAttribs( sal_uInt16 nPara, sal_uInt16 nStart, sal_u DBG_CHKOBJ( GetEditEnginePtr(), EditEngine, 0 ); - ContentNode* pNode = const_cast<ContentNode*>(aEditDoc.SafeGetObject(nPara)); + ContentNode* pNode = const_cast<ContentNode*>(aEditDoc.GetObject(nPara)); DBG_ASSERT( pNode, "GetAttribs - unknown paragraph!" ); DBG_ASSERT( nStart <= nEnd, "getAttribs: Start > End not supported!" ); @@ -532,7 +532,7 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_ sal_Bool bParaAttribFound = sal_False; sal_Bool bCharAttribFound = sal_False; - DBG_ASSERT( aEditDoc.SafeGetObject( nNode ), "Node not founden: SetAttribs" ); + DBG_ASSERT( aEditDoc.GetObject( nNode ), "Node not founden: SetAttribs" ); DBG_ASSERT( GetParaPortions().SafeGetObject( nNode ), "Portion not found: SetAttribs" ); ContentNode* pNode = aEditDoc.GetObject( nNode ); @@ -622,7 +622,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaA ContentNode* pNode = aEditDoc.GetObject( nNode ); ParaPortion* pPortion = GetParaPortions()[nNode]; - DBG_ASSERT( aEditDoc.SafeGetObject( nNode ), "Node not found: SetAttribs" ); + DBG_ASSERT( aEditDoc.GetObject( nNode ), "Node not found: SetAttribs" ); DBG_ASSERT( GetParaPortions().SafeGetObject( nNode ), "Portion not found: SetAttribs" ); xub_StrLen nStartPos = 0; @@ -667,7 +667,7 @@ typedef EditCharAttrib* EditCharAttribPtr; void ImpEditEngine::RemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich, sal_Bool bRemoveFeatures ) { - ContentNode* pNode = aEditDoc.SafeGetObject( nPara ); + ContentNode* pNode = aEditDoc.GetObject( nPara ); ParaPortion* pPortion = GetParaPortions().SafeGetObject( nPara ); DBG_ASSERT( pNode, "Node not found: RemoveCharAttribs" ); @@ -696,7 +696,7 @@ void ImpEditEngine::RemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich, sal_ void ImpEditEngine::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ) { - ContentNode* pNode = aEditDoc.SafeGetObject( nPara ); + ContentNode* pNode = aEditDoc.GetObject( nPara ); if ( !pNode ) return; |