[Libreoffice-commits] .: 3 commits - editeng/source

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Apr 19 15:52:34 PDT 2012


 editeng/source/editeng/eehtml.hxx   |    3 +++
 editeng/source/editeng/eertfpar.hxx |    4 ++++
 editeng/source/editeng/impedit.hxx  |    6 +++---
 editeng/source/editeng/impedit2.cxx |   26 +++++++++++++-------------
 editeng/source/editeng/impedit4.cxx |    5 ++---
 5 files changed, 25 insertions(+), 19 deletions(-)

New commits:
commit 4327d4973b572ed749803007d90574919da31f04
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Apr 19 15:59:45 2012 -0400

    Revert "Use boost::scoped_ptr for this."
    
    This reverts commit a4bc804627b8b21506e9b86fa54d2f7d2525e43e.

diff --git a/editeng/source/editeng/eertfpar.hxx b/editeng/source/editeng/eertfpar.hxx
index 5b69074..df27f20 100644
--- a/editeng/source/editeng/eertfpar.hxx
+++ b/editeng/source/editeng/eertfpar.hxx
@@ -120,6 +120,10 @@ public:
     EditPaM     GetCurPaM() const                   { return aCurSel.Max(); }
 };
 
+SV_DECL_REF( EditRTFParser )
+SV_IMPL_REF( EditRTFParser );
+
+
 #endif  //_EERTFPAR_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index b142a98..7316d7e 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -86,7 +86,6 @@
 #include <editeng/edtdlg.hxx>
 
 #include <vector>
-#include <boost/scoped_ptr.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -179,7 +178,7 @@ EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, EditSelection aSel )
     DBG_ASSERT(pPool && pPool->GetName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EditEngineItemPool")),
         "ReadRTF: no EditEnginePool!");
 
-    boost::scoped_ptr<EditRTFParser> xPrsr(new EditRTFParser(rInput, aSel, *pPool, pEditEngine));
+    EditRTFParserRef xPrsr = new EditRTFParser(rInput, aSel, *pPool, pEditEngine);
     SvParserState eState = xPrsr->CallParser();
     if ( ( eState != SVPAR_ACCEPTED ) && ( !rInput.GetError() ) )
     {
commit 81a1386656622ddb7c453e473f559103ea1f9fd9
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Apr 19 15:59:08 2012 -0400

    Revert "Let's use boost::scoped_ptr for this."
    
    This reverts commit e1520a9d6a9f9bcfcaa332d54892040fe54776c2.

diff --git a/editeng/source/editeng/eehtml.hxx b/editeng/source/editeng/eehtml.hxx
index c74f91e..71f61c8 100644
--- a/editeng/source/editeng/eehtml.hxx
+++ b/editeng/source/editeng/eehtml.hxx
@@ -92,6 +92,9 @@ public:
     const EditSelection&    GetCurSelection() const { return aCurSel; }
 };
 
+SV_DECL_REF( EditHTMLParser )
+SV_IMPL_REF( EditHTMLParser );
+
 #endif // _EEHTML_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 89dce47..b142a98 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -194,7 +194,7 @@ EditPaM ImpEditEngine::ReadHTML( SvStream& rInput, const String& rBaseURL, EditS
     if ( aSel.HasRange() )
         aSel = ImpDeleteSelection( aSel );
 
-    boost::scoped_ptr<EditHTMLParser> xPrsr(new EditHTMLParser(rInput, rBaseURL, pHTTPHeaderAttrs));
+    EditHTMLParserRef xPrsr = new EditHTMLParser( rInput, rBaseURL, pHTTPHeaderAttrs );
     SvParserState eState = xPrsr->CallParser(pEditEngine, aSel.Max());
     if ( ( eState != SVPAR_ACCEPTED ) && ( !rInput.GetError() ) )
     {
commit 3fdd8667d8876a6661f1c900116e6d4681f43334
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Wed Apr 18 16:14:39 2012 -0400

    Pass const reference.

diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 4edfee5..a662dab 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 e4ec620..246ad29 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()


More information about the Libreoffice-commits mailing list