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

Kohei Yoshida kohei at kemper.freedesktop.org
Fri Jul 22 11:05:22 PDT 2011


 editeng/source/editeng/eehtml.cxx |   59 ++++++++++++++++++--------------------
 editeng/source/editeng/eehtml.hxx |   17 ++++------
 2 files changed, 35 insertions(+), 41 deletions(-)

New commits:
commit 654ed4c19c15356b52fbdaa17af750d80aa91b3f
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Jul 22 13:55:24 2011 -0400

    Method declared by never defined and never used.

diff --git a/editeng/source/editeng/eehtml.hxx b/editeng/source/editeng/eehtml.hxx
index ba704e6..4bc4853 100644
--- a/editeng/source/editeng/eehtml.hxx
+++ b/editeng/source/editeng/eehtml.hxx
@@ -73,7 +73,6 @@ private:
     void					SkipGroup( int nEndToken );
     bool                    ThrowAwayBlank();
     bool                    HasTextInCurrentPara();
-    void					ProcessUnknownControl( sal_Bool bOn );
 
     void					ImpInsertParaBreak();
     void 					ImpInsertText( const String& rText );
commit 26cc8b59b68f30a466b8d0cd9d6a71065858db9e
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Jul 22 13:54:15 2011 -0400

    nLastAction value assigned but never used. Remove it.

diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index 41a07a9..8d7ba8e 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -523,7 +523,6 @@ void EditHTMLParser::ImpInsertParaBreak()
         pImpEditEngine->aImportHdl.Call( &aImportInfo );
     }
     aCurSel = pImpEditEngine->ImpInsertParaBreak( aCurSel );
-    nLastAction = ACTION_INSERTPARABRK;
 }
 
 void EditHTMLParser::ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSel )
@@ -682,7 +681,6 @@ void EditHTMLParser::ImpInsertText( const String& rText )
     }
 
     aCurSel = pImpEditEngine->ImpInsertText( aCurSel, aText );
-    nLastAction = ACTION_INSERTTEXT;
 }
 
 void EditHTMLParser::SkipGroup( int nEndToken )
diff --git a/editeng/source/editeng/eehtml.hxx b/editeng/source/editeng/eehtml.hxx
index a0d3a2e..ba704e6 100644
--- a/editeng/source/editeng/eehtml.hxx
+++ b/editeng/source/editeng/eehtml.hxx
@@ -64,8 +64,6 @@ private:
     sal_uInt8					nBulletLevel;
     sal_uInt8					nNumberingLevel;
 
-    sal_uInt8					nLastAction;
-
     void					StartPara( sal_Bool bReal );
     void					EndPara( sal_Bool bReal );
     void					AnchorStart();
commit e570706e878c4eea5418787312e71804008c3b2e
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Jul 22 13:53:08 2011 -0400

    Some cleanups: sal_Bool to bool, use of initializer in ctor etc.

diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index 3516276..41a07a9 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -52,21 +52,20 @@
 #define STYLE_PRE		  		101
 
 EditHTMLParser::EditHTMLParser( SvStream& rIn, const String& rBaseURL, SvKeyValueIterator* pHTTPHeaderAttrs )
-    : HTMLParser( rIn, true )
-    , aBaseURL( rBaseURL )
+    : HTMLParser( rIn, true ),
+    aBaseURL( rBaseURL ),
+    pImpEditEngine(NULL),
+    pCurAnchor(NULL),
+    bInPara(false),
+    bWasInPara(false),
+    bFieldsInserted(false),
+    bInTitle(false),
+    nInTable(0),
+    nInCell(0),
+    nDefListLevel(0),
+    nBulletLevel(0),
+    nNumberingLevel(0)
 {
-    pImpEditEngine = 0;
-    pCurAnchor = 0;
-    bInPara = sal_False;
-    bWasInPara = sal_False;
-    nInTable = 0;
-    nInCell = 0;
-    bInTitle = sal_False;
-    nDefListLevel = 0;
-    nBulletLevel = 0;
-    nNumberingLevel = 0;
-    bFieldsInserted = sal_False;
-
     DBG_ASSERT( RTL_TEXTENCODING_DONTKNOW == GetSrcEncoding( ), "EditHTMLParser::EditHTMLParser: Where does the encoding come from?" );
     DBG_ASSERT( !IsSwitchToUCS2(), "EditHTMLParser::::EditHTMLParser: Switch to UCS2?" );
 
@@ -158,11 +157,11 @@ void EditHTMLParser::NextToken( int nToken )
     break;
     case HTML_PLAINTEXT_ON:
     case HTML_PLAINTEXT2_ON:
-        bInPara = sal_True;
+        bInPara = true;
     break;
     case HTML_PLAINTEXT_OFF:
     case HTML_PLAINTEXT2_OFF:
-        bInPara = sal_False;
+        bInPara = false;
     break;
 
     case HTML_LINEBREAK:
@@ -353,10 +352,10 @@ void EditHTMLParser::NextToken( int nToken )
                             break;
 
     case HTML_TITLE_ON:
-        bInTitle = sal_True;
+        bInTitle = true;
         break;
     case HTML_TITLE_OFF:
-        bInTitle = sal_False;
+        bInTitle = false;
         break;
 
     // globals
@@ -740,7 +739,7 @@ void EditHTMLParser::StartPara( sal_Bool bReal )
         aItemSet.Put( SvxAdjustItem( eAdjust, EE_PARA_JUST ) );
         ImpSetAttribs( aItemSet );
     }
-    bInPara = sal_True;
+    bInPara = true;
 }
 
 void EditHTMLParser::EndPara( sal_Bool )
@@ -751,22 +750,22 @@ void EditHTMLParser::EndPara( sal_Bool )
         if ( bHasText )
             ImpInsertParaBreak();
     }
-    bInPara = sal_False;
+    bInPara = false;
 }
 
-sal_Bool EditHTMLParser::ThrowAwayBlank()
+bool EditHTMLParser::ThrowAwayBlank()
 {
     // A blank must be thrown away if the new text begins with a Blank and 
     // if the current paragraph is empty or ends with a Blank...
     ContentNode* pNode = aCurSel.Max().GetNode();
     if ( pNode->Len() && ( pNode->GetChar( pNode->Len()-1 ) != ' ' ) )
-        return sal_False;
-    return sal_True;
+        return false;
+    return true;
 }
 
-sal_Bool EditHTMLParser::HasTextInCurrentPara()
+bool EditHTMLParser::HasTextInCurrentPara()
 {
-    return aCurSel.Max().GetNode()->Len() ? sal_True : sal_False;
+    return aCurSel.Max().GetNode()->Len() ? true : false;
 }
 
 void EditHTMLParser::AnchorStart()
@@ -813,9 +812,9 @@ void EditHTMLParser::AnchorEnd()
         // Insert as URL-Field...
         SvxFieldItem aFld( SvxURLField( pCurAnchor->aHRef, pCurAnchor->aText, SVXURLFORMAT_REPR ), EE_FEATURE_FIELD  );
         aCurSel = pImpEditEngine->InsertField( aCurSel, aFld );
-        bFieldsInserted = sal_True;
+        bFieldsInserted = true;
         delete pCurAnchor;
-        pCurAnchor = 0;
+        pCurAnchor = NULL;
 
         if ( pImpEditEngine->aImportHdl.IsSet() )
         {
@@ -846,8 +845,8 @@ void EditHTMLParser::HeadingEnd( int )
 
     if ( bWasInPara )
     {
-        bInPara = sal_True;
-        bWasInPara = sal_False;
+        bInPara = true;
+        bWasInPara = false;
     }
 }
 
diff --git a/editeng/source/editeng/eehtml.hxx b/editeng/source/editeng/eehtml.hxx
index 43d55cd..a0d3a2e 100644
--- a/editeng/source/editeng/eehtml.hxx
+++ b/editeng/source/editeng/eehtml.hxx
@@ -53,13 +53,13 @@ private:
     ImpEditEngine* 			pImpEditEngine;
     AnchorInfo*				pCurAnchor;
 
-    sal_Bool					bInPara;
-    sal_Bool					bWasInPara;	// Remember bInPara before HeadingStart, because afterwards it will be gone.
-    sal_Bool					bFieldsInserted;
+    bool                    bInPara:1;
+    bool                    bWasInPara:1; // Remember bInPara before HeadingStart, because afterwards it will be gone.
+    bool                    bFieldsInserted:1;
+    bool                    bInTitle:1;
+
     sal_uInt8					nInTable;
     sal_uInt8					nInCell;
-    sal_Bool                    bInTitle;
-
     sal_uInt8					nDefListLevel;
     sal_uInt8					nBulletLevel;
     sal_uInt8					nNumberingLevel;
@@ -73,8 +73,8 @@ private:
     void					HeadingStart( int nToken );
     void					HeadingEnd( int nToken );
     void					SkipGroup( int nEndToken );
-    sal_Bool					ThrowAwayBlank();
-    sal_Bool					HasTextInCurrentPara();
+    bool                    ThrowAwayBlank();
+    bool                    HasTextInCurrentPara();
     void					ProcessUnknownControl( sal_Bool bOn );
 
     void					ImpInsertParaBreak();


More information about the Libreoffice-commits mailing list