diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-18 16:14:39 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-04-19 18:53:08 -0400 |
commit | 3fdd8667d8876a6661f1c900116e6d4681f43334 (patch) | |
tree | 486618b9f2d2db634d031eaf2fddca45f27d23ed /editeng/source | |
parent | 8be33aa1df252e25d8cd4e46fc65cf054479d5ce (diff) |
Pass const reference.
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 6 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 26 |
2 files changed, 16 insertions, 16 deletions
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 4edfee58b6a3..a662dab59683 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -551,11 +551,11 @@ private: void ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, TextPortion* pPortion, sal_uInt16 nPortionStart, long nRemainingWidth, sal_Bool bCanHyphenate ); void ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, long nRemainingSpace ); EditPaM ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, sal_Bool bBackward = sal_False ); - EditPaM ImpDeleteSelection( EditSelection aEditSelection); + EditPaM ImpDeleteSelection(const EditSelection& rCurSel); EditPaM ImpInsertParaBreak( EditPaM& rPaM, bool bKeepEndingAttribs = true ); EditPaM ImpInsertParaBreak( const EditSelection& rEditSelection, bool bKeepEndingAttribs = true ); EditPaM ImpInsertText(const EditSelection& aCurEditSelection, const String& rStr); - EditPaM ImpInsertFeature( EditSelection aEditSelection, const SfxPoolItem& rItem ); + EditPaM ImpInsertFeature(const EditSelection& rCurSel, const SfxPoolItem& rItem); void ImpRemoveChars( const EditPaM& rPaM, sal_uInt16 nChars, EditUndoRemoveChars* pCurUndo = 0 ); void ImpRemoveParagraph( sal_uInt16 nPara ); EditSelection ImpMoveParagraphs( Range aParagraphs, sal_uInt16 nNewPos ); @@ -760,7 +760,7 @@ public: EditPaM InsertParaBreak( EditSelection aEditSelection ); EditPaM InsertLineBreak(const EditSelection& aEditSelection); EditPaM InsertTab( EditSelection aEditSelection ); - EditPaM InsertField( EditSelection aEditSelection, const SvxFieldItem& rFld ); + EditPaM InsertField(const EditSelection& rCurSel, const SvxFieldItem& rFld); sal_Bool UpdateFields(); EditPaM Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, EditSelection aSel, SvKeyValueIterator* pHTTPHeaderAttrs = NULL ); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index e4ec62078a35..246ad290bc08 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -2425,14 +2425,15 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 n return ImpConnectParagraphs( aDelStart.GetNode(), aDelEnd.GetNode(), bSpecialBackward ); } -EditPaM ImpEditEngine::ImpDeleteSelection( EditSelection aSel ) +EditPaM ImpEditEngine::ImpDeleteSelection(const EditSelection& rCurSel) { - if ( !aSel.HasRange() ) - return aSel.Min(); + if ( !rCurSel.HasRange() ) + return rCurSel.Min(); - aSel.Adjust( aEditDoc ); - EditPaM aStartPaM( aSel.Min() ); - EditPaM aEndPaM( aSel.Max() ); + EditSelection aCurSel(rCurSel); + aCurSel.Adjust( aEditDoc ); + EditPaM aStartPaM(aCurSel.Min()); + EditPaM aEndPaM(aCurSel.Max()); CursorMoved( aStartPaM.GetNode() ); // only so that newly set Attributes dissapear... CursorMoved( aEndPaM.GetNode() ); // only so that newly set Attributes dissapear... @@ -2811,13 +2812,13 @@ EditPaM ImpEditEngine::ImpFastInsertText( EditPaM aPaM, const XubString& rStr ) return aPaM; } -EditPaM ImpEditEngine::ImpInsertFeature( EditSelection aCurSel, const SfxPoolItem& rItem ) +EditPaM ImpEditEngine::ImpInsertFeature(const EditSelection& rCurSel, const SfxPoolItem& rItem) { EditPaM aPaM; - if ( aCurSel.HasRange() ) - aPaM = ImpDeleteSelection( aCurSel ); + if ( rCurSel.HasRange() ) + aPaM = ImpDeleteSelection( rCurSel ); else - aPaM = aCurSel.Max(); + aPaM = rCurSel.Max(); if ( aPaM.GetIndex() >= 0xfffe ) return aPaM; @@ -2966,10 +2967,9 @@ EditPaM ImpEditEngine::InsertTab( EditSelection aCurSel ) return aPaM; } -EditPaM ImpEditEngine::InsertField( EditSelection aCurSel, const SvxFieldItem& rFld ) +EditPaM ImpEditEngine::InsertField(const EditSelection& rCurSel, const SvxFieldItem& rFld) { - EditPaM aPaM( ImpInsertFeature( aCurSel, rFld ) ); - return aPaM; + return ImpInsertFeature(rCurSel, rFld); } sal_Bool ImpEditEngine::UpdateFields() |