[Libreoffice-commits] core.git: sw/source

Takeshi Abe tabe at fixedpoint.jp
Fri Mar 1 15:56:27 PST 2013


 sw/source/ui/docvw/edtwin.cxx    |    6 +++---
 sw/source/ui/inc/wrtsh.hxx       |   10 +++++-----
 sw/source/ui/shells/drformsh.cxx |    2 +-
 sw/source/ui/shells/drwbassh.cxx |    2 +-
 sw/source/ui/shells/drwtxtsh.cxx |    2 +-
 sw/source/ui/web/wview.cxx       |   14 +++++++-------
 sw/source/ui/wrtsh/delete.cxx    |    2 +-
 sw/source/ui/wrtsh/move.cxx      |    4 ++--
 sw/source/ui/wrtsh/select.cxx    |    8 ++++----
 sw/source/ui/wrtsh/wrtsh1.cxx    |   37 +++++++++++++++++++------------------
 sw/source/ui/wrtsh/wrtsh4.cxx    |   12 ++++++------
 sw/source/ui/wrtsh/wrtundo.cxx   |   10 +++++-----
 12 files changed, 55 insertions(+), 54 deletions(-)

New commits:
commit ac88fccc33e322ff25f52819e9082f67e3e155ef
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date:   Fri Mar 1 15:42:53 2013 +0900

    sal_Bool to bool
    
    Change-Id: I278eeb5c61a88cc96d59adb4d9b722d4c91abd3d

diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index cd5c25d..6ea97a0 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -4729,7 +4729,7 @@ void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl)
     {
         pApplyTempl = new SwApplyTemplate( rTempl );
               SetPointer( POINTER_FILL );//@todo #i20119# maybe better a new brush pointer here in future
-              rSh.NoEdit( sal_False );
+              rSh.NoEdit( false );
               bIdle = rSh.GetViewOptions()->IsIdle();
               ((SwViewOption *)rSh.GetViewOptions())->SetIdle( sal_False );
     }
@@ -4737,7 +4737,7 @@ void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl)
     {
         pApplyTempl = new SwApplyTemplate( rTempl );
         SetPointer( POINTER_FILL );
-        rSh.NoEdit( sal_False );
+        rSh.NoEdit( false );
         bIdle = rSh.GetViewOptions()->IsIdle();
         ((SwViewOption *)rSh.GetViewOptions())->SetIdle( sal_False );
     }
@@ -4745,7 +4745,7 @@ void SwEditWin::SetApplyTemplate(const SwApplyTemplate &rTempl)
     {
         pApplyTempl = new SwApplyTemplate( rTempl );
         SetPointer( POINTER_FILL  );
-        rSh.NoEdit( sal_False );
+        rSh.NoEdit( false );
         bIdle = rSh.GetViewOptions()->IsIdle();
         ((SwViewOption *)rSh.GetViewOptions())->SetIdle( sal_False );
     }
diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx
index 38032bb..7276016 100644
--- a/sw/source/ui/inc/wrtsh.hxx
+++ b/sw/source/ui/inc/wrtsh.hxx
@@ -249,7 +249,7 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
     // update fields
     void    UpdateInputFlds( SwInputFieldList* pLst = 0, sal_Bool bOnlyInSel = sal_False );
 
-    void    NoEdit(sal_Bool bHideCrsr = sal_True);
+    void    NoEdit(bool bHideCrsr = true);
     void    Edit();
 
     sal_Bool IsRetainSelection() const { return mbRetainSelection; }
@@ -299,7 +299,7 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
     void    InsertColumnBreak();
     void    InsertFootnote(const String &, sal_Bool bEndNote = sal_False, sal_Bool bEdit = sal_True );
     void    SplitNode( sal_Bool bAutoFormat = sal_False, sal_Bool bCheckTableStart = sal_True );
-    sal_Bool    CanInsert();
+    bool    CanInsert();
 
     // indexes
     void    InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet = 0);
@@ -475,7 +475,7 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
 private:
 
     SW_DLLPRIVATE void  OpenMark();
-    SW_DLLPRIVATE void  CloseMark( sal_Bool bOkFlag );
+    SW_DLLPRIVATE void  CloseMark( bool bOkFlag );
 
     SW_DLLPRIVATE String    GetWrdDelim();
     SW_DLLPRIVATE String    GetSDelim();
@@ -537,8 +537,8 @@ private:
     SW_DLLPRIVATE sal_Bool  PopCrsr(sal_Bool bUpdate, sal_Bool bSelect = sal_False);
 
     // take END cursor along when PageUp / -Down
-    SW_DLLPRIVATE sal_Bool _SttWrd();
-    SW_DLLPRIVATE sal_Bool _EndWrd();
+    SW_DLLPRIVATE bool _SttWrd();
+    SW_DLLPRIVATE bool _EndWrd();
     SW_DLLPRIVATE sal_Bool _NxtWrd();
     SW_DLLPRIVATE sal_Bool _PrvWrd();
     // #i92468#
diff --git a/sw/source/ui/shells/drformsh.cxx b/sw/source/ui/shells/drformsh.cxx
index 4c6d6d5..b92a3d7 100644
--- a/sw/source/ui/shells/drformsh.cxx
+++ b/sw/source/ui/shells/drformsh.cxx
@@ -251,7 +251,7 @@ SwDrawFormShell::SwDrawFormShell(SwView &_rView) :
     SwDrawBaseShell(_rView)
 {
     SetHelpId(SW_DRAWFORMSHELL);
-    GetShell().NoEdit(sal_True);
+    GetShell().NoEdit(true);
     SetName(rtl::OUString("DrawForm"));
 }
 
diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx
index 979b439..16fa1b6 100644
--- a/sw/source/ui/shells/drwbassh.cxx
+++ b/sw/source/ui/shells/drwbassh.cxx
@@ -76,7 +76,7 @@ TYPEINIT1(SwDrawBaseShell,SwBaseShell)
 SwDrawBaseShell::SwDrawBaseShell(SwView &_rView):
     SwBaseShell( _rView )
 {
-    GetShell().NoEdit(sal_True);
+    GetShell().NoEdit(true);
 
     SwEditWin& rWin = GetView().GetEditWin();
 
diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx
index 6c714431b..367464e 100644
--- a/sw/source/ui/shells/drwtxtsh.cxx
+++ b/sw/source/ui/shells/drwtxtsh.cxx
@@ -128,7 +128,7 @@ SwDrawTextShell::SwDrawTextShell(SwView &rV) :
 
     Init();
 
-    rSh.NoEdit(sal_True);
+    rSh.NoEdit(true);
     SetName(rtl::OUString("ObjectText"));
     SetHelpId(SW_DRWTXTSHELL);
 }
diff --git a/sw/source/ui/web/wview.cxx b/sw/source/ui/web/wview.cxx
index f9af40c..707e128 100644
--- a/sw/source/ui/web/wview.cxx
+++ b/sw/source/ui/web/wview.cxx
@@ -105,11 +105,11 @@ SwWebView::~SwWebView()
 void SwWebView::SelectShell()
 {
     // Entscheidung, ob UpdateTable gerufen werden muss
-    sal_Bool bUpdateTable = sal_False;
+    bool bUpdateTable = false;
     const SwFrmFmt* pCurTableFmt = GetWrtShell().GetTableFmt();
     if(pCurTableFmt && pCurTableFmt != GetLastTblFrmFmt())
     {
-        bUpdateTable = sal_True; // kann erst spaeter ausgefuehrt werden
+        bUpdateTable = true; // kann erst spaeter ausgefuehrt werden
     }
     SetLastTblFrmFmt(pCurTableFmt);
     //SEL_TBL und SEL_TBL_CELLS koennen verodert sein!
@@ -153,15 +153,15 @@ void SwWebView::SelectShell()
             rDispatcher.Pop( *pSfxShell, SFX_SHELL_POP_UNTIL | SFX_SHELL_POP_DELETE);
         }
 
-        sal_Bool bInitFormShell = sal_False;
+        bool bInitFormShell = false;
         if( !GetFormShell() )
         {
-            bInitFormShell = sal_True;
+            bInitFormShell = true;
             SetFormShell( new FmFormShell( this ) );
             rDispatcher.Push( *GetFormShell() );
         }
 
-        sal_Bool bSetExtInpCntxt = sal_False;
+        bool bSetExtInpCntxt = false;
         _nSelectionType = nNewSelectionType;
         SetSelectionType( _nSelectionType );
         ShellModes eShellMode;
@@ -232,7 +232,7 @@ void SwWebView::SelectShell()
         }
         else
         {
-            bSetExtInpCntxt = sal_True;
+            bSetExtInpCntxt = true;
             eShellMode = SHELL_MODE_TEXT;
             if ( _nSelectionType & nsSelectionType::SEL_NUM )
             {
@@ -256,7 +256,7 @@ void SwWebView::SelectShell()
         if( !GetDocShell()->IsReadOnly() )
         {
             if( bSetExtInpCntxt && GetWrtShell().HasReadonlySel() )
-                bSetExtInpCntxt = sal_False;
+                bSetExtInpCntxt = false;
 
             InputContext aCntxt( GetEditWin().GetInputContext() );
             aCntxt.SetOptions( bSetExtInpCntxt
diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx
index d858742..f4d4d3b 100644
--- a/sw/source/ui/wrtsh/delete.cxx
+++ b/sw/source/ui/wrtsh/delete.cxx
@@ -33,7 +33,7 @@ inline void SwWrtShell::OpenMark()
     SetMark();
 }
 
-inline void SwWrtShell::CloseMark( sal_Bool bOkFlag )
+inline void SwWrtShell::CloseMark( bool bOkFlag )
 {
     if( bOkFlag )
         UpdateAttr();
diff --git a/sw/source/ui/wrtsh/move.cxx b/sw/source/ui/wrtsh/move.cxx
index bcae465..e717dbd 100644
--- a/sw/source/ui/wrtsh/move.cxx
+++ b/sw/source/ui/wrtsh/move.cxx
@@ -40,7 +40,7 @@ const long nReadOnlyScrollOfst = 10;
 class ShellMoveCrsr
 {
     SwWrtShell* pSh;
-    sal_Bool bAct;
+    bool bAct;
 public:
     inline ShellMoveCrsr( SwWrtShell* pWrtSh, sal_Bool bSel )
     {
@@ -472,7 +472,7 @@ sal_Bool SwWrtShell::PushCrsr(SwTwips lOffset, sal_Bool bSelect)
     //auf dem Stack gemerkt werden.
     sal_Bool bIsFrmSel = sal_False;
 
-    sal_Bool bIsObjSel = sal_False;
+    bool bIsObjSel = false;
 
     //Zielposition liegt jetzt innerhalb des sichtbaren Bereiches -->
     //Cursor an die Zielposition setzen; merken, dass keine Ziel-
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index 0679106..dfa8f06 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -48,7 +48,7 @@ using namespace ::com::sun::star::util;
 
 
 static long nStartDragX = 0, nStartDragY = 0;
-static sal_Bool  bStartDrag = sal_False;
+static bool  bStartDrag = false;
 
 void SwWrtShell::Invalidate()
 {
@@ -429,7 +429,7 @@ void SwWrtShell::EndSelect()
  * zu erweitern.
  */
 
-inline sal_Bool operator<(const Point &rP1,const Point &rP2)
+inline bool operator<(const Point &rP1,const Point &rP2)
 {
     return rP1.Y() < rP2.Y() || (rP1.Y() == rP2.Y() && rP1.X() < rP2.X());
 }
@@ -735,7 +735,7 @@ void SwWrtShell::EnterSelFrmMode(const Point *pPos)
     {
         nStartDragX = pPos->X();
         nStartDragY = pPos->Y();
-        bStartDrag = sal_True;
+        bStartDrag = true;
     }
     bLayoutMode = sal_True;
     HideCrsr();
@@ -754,7 +754,7 @@ void SwWrtShell::LeaveSelFrmMode()
     fnDrag          = &SwWrtShell::BeginDrag;
     fnEndDrag       = &SwWrtShell::EndDrag;
     bLayoutMode = sal_False;
-    bStartDrag = sal_False;
+    bStartDrag = false;
     Edit();
     SwBaseShell::SetFrmMode( FLY_DRAG_END, this );
     Invalidate();
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 16fcede..0f3ec52 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -144,7 +144,7 @@ static SvxAutoCorrect* lcl_IsAutoCorr()
     return pACorr;
 }
 
-void SwWrtShell::NoEdit(sal_Bool bHideCrsr)
+void SwWrtShell::NoEdit(bool bHideCrsr)
 {
     if(bHideCrsr)
         HideCrsr();
@@ -203,7 +203,8 @@ void SwWrtShell::Insert( const String &rStr )
     if( !CanInsert() )
         return;
 
-    sal_Bool bStarted = sal_False, bHasSel = HasSelection(),
+    bool bStarted = false;
+    sal_Bool bHasSel = HasSelection(),
         bCallIns = bIns /*|| bHasSel*/;
     bool bDeleted = false;
 
@@ -228,7 +229,7 @@ void SwWrtShell::Insert( const String &rStr )
         }
 
         StartUndo(UNDO_REPLACE, &aRewriter);
-        bStarted = sal_True;
+        bStarted = true;
         bDeleted = DelRight() != 0;
     }
 
@@ -272,12 +273,12 @@ void SwWrtShell::Insert( const String &rPath, const String &rFilter,
 
     EnterSelFrmMode();
 
-    sal_Bool bSetGrfSize = sal_True;
-    sal_Bool bOwnMgr     = sal_False;
+    bool bSetGrfSize = true;
+    bool bOwnMgr     = false;
 
     if ( !pFrmMgr )
     {
-        bOwnMgr = sal_True;
+        bOwnMgr = true;
         pFrmMgr = new SwFlyFrmAttrMgr( sal_True, this, FRMMGR_TYPE_GRF );
 
         // VORSICHT
@@ -296,7 +297,7 @@ void SwWrtShell::Insert( const String &rPath, const String &rFilter,
             pFrmMgr->SetSize( aSz );
         }
         else if ( aSz.Width() != DFLT_WIDTH && aSz.Height() != DFLT_HEIGHT )
-            bSetGrfSize = sal_False;
+            bSetGrfSize = false;
 
         pFrmMgr->SetHeightSizeType(ATT_FIX_SIZE);
 
@@ -474,7 +475,7 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF
     //   no break should be inserted.
     //3. If an selektion is passed to a StarMath object, this object should
     //   not be activated. sal_False should be returned then.
-    sal_Bool bStarMath = sal_True;
+    bool bStarMath = true;
     sal_Bool bActivate = sal_True;
 
     // set parent to get correct VisArea(in case of object needing parent printer)
@@ -652,7 +653,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
         return; // the replacement image is completely controlled by container in this case
 
     sal_Int64 nMisc = 0;
-    sal_Bool bLinkingChart = sal_False;
+    bool bLinkingChart = false;
 
     try
     {
@@ -761,7 +762,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
     Fraction aScaleWidth( 1, 1 );
     Fraction aScaleHeight( 1, 1 );
 
-    sal_Bool bUseObjectSize = sal_False;
+    bool bUseObjectSize = false;
 
     // solange keine vernuenftige Size vom Object kommt, kann nichts
     // skaliert werden
@@ -812,7 +813,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
             if ( nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE )
             {
                 // the object must not be scaled, the size stored in object must be used for restoring
-                bUseObjectSize = sal_True;
+                bUseObjectSize = true;
             }
             else
             {
@@ -1611,7 +1612,7 @@ void SwWrtShell::AutoUpdatePara(SwTxtFmtColl* pColl, const SfxItemSet& rStyleSet
             SID_ATTR_PARA_PAGENUM,      SID_ATTR_PARA_PAGENUM,
             0   );
     GetPaMAttr( pCrsr, aCoreSet );
-    sal_Bool bReset = sal_False;
+    bool bReset = false;
     SfxItemIter aParaIter( aCoreSet );
     const SfxPoolItem* pParaItem = aParaIter.FirstItem();
     while( pParaItem )
@@ -1623,7 +1624,7 @@ void SwWrtShell::AutoUpdatePara(SwTxtFmtColl* pColl, const SfxItemSet& rStyleSet
                SFX_ITEM_SET == rStyleSet.GetItemState(nWhich))
             {
                 aCoreSet.ClearItem(nWhich);
-                bReset = sal_True;
+                bReset = true;
             }
         }
         pParaItem = aParaIter.NextItem();
@@ -1654,14 +1655,14 @@ void SwWrtShell::AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar )
     ResetCursorStack();
     if(CanInsert())
     {
-        sal_Bool bStarted = sal_False;
+        bool bStarted = false;
         if(HasSelection())
         {
                 // nur hier klammern, da das normale Insert schon an der
                 // Editshell geklammert ist
             StartAllAction();
             StartUndo(UNDO_INSERT);
-            bStarted = sal_True;
+            bStarted = true;
             DelRight();
         }
         SwEditShell::AutoCorrect( rACorr, IsInsMode(), cChar );
@@ -1741,7 +1742,7 @@ sal_Bool SwWrtShell::Pop( sal_Bool bOldCrsr )
     return bRet;
 }
 
-sal_Bool SwWrtShell::CanInsert()
+bool SwWrtShell::CanInsert()
 {
     return (!(IsSelFrmMode() | IsObjSelected() | (GetView().GetDrawFuncPtr() != NULL) | (GetView().GetPostItMgr()->GetActiveSidebarWin()!= NULL)));
 }
@@ -1810,7 +1811,7 @@ void SwWrtShell::ChangeHeaderOrFooter(
     addCurrentPosition();
     StartAllAction();
     StartUndo( UNDO_HEADER_FOOTER ); // #i7983#
-    sal_Bool bExecute = sal_True;
+    bool bExecute = true;
     sal_Bool bCrsrSet = sal_False;
     for( sal_uInt16 nFrom = 0, nTo = GetPageDescCnt();
             nFrom < nTo; ++nFrom )
@@ -1829,7 +1830,7 @@ void SwWrtShell::ChangeHeaderOrFooter(
                 EndAllAction();
 
                 Window* pParent = &GetView().GetViewFrame()->GetWindow();
-                sal_Bool bRet = RET_YES == QueryBox( pParent, ResId( RID_SVXQBX_DELETE_HEADFOOT,
+                bool bRet = RET_YES == QueryBox( pParent, ResId( RID_SVXQBX_DELETE_HEADFOOT,
                                         DIALOG_MGR() ) ).Execute();
                 bExecute = bRet;
                 StartAllAction();
diff --git a/sw/source/ui/wrtsh/wrtsh4.cxx b/sw/source/ui/wrtsh/wrtsh4.cxx
index 8fdc55d..3f0576f 100644
--- a/sw/source/ui/wrtsh/wrtsh4.cxx
+++ b/sw/source/ui/wrtsh/wrtsh4.cxx
@@ -34,10 +34,10 @@
 */
 
 
-sal_Bool SwWrtShell::_SttWrd()
+bool SwWrtShell::_SttWrd()
 {
     if ( IsSttPara() )
-        return 1;
+        return true;
         /*
             * temporaeren Cursor ohne Selektion erzeugen
             */
@@ -49,7 +49,7 @@ sal_Bool SwWrtShell::_SttWrd()
     ClearMark();
         // falls vorher Mark gesetzt war, zusammenfassen
     Combine();
-    return 1;
+    return true;
 }
 /*
  * Das Ende eines Wortes ist das Folgen von Trennzeichen auf
@@ -60,10 +60,10 @@ sal_Bool SwWrtShell::_SttWrd()
 
 
 
-sal_Bool SwWrtShell::_EndWrd()
+bool SwWrtShell::_EndWrd()
 {
     if ( IsEndWrd() )
-        return 1;
+        return true;
         // temporaeren Cursor ohne Selektion erzeugen
     Push();
     ClearMark();
@@ -73,7 +73,7 @@ sal_Bool SwWrtShell::_EndWrd()
     ClearMark();
         // falls vorher Mark gesetzt war, zusammenfassen
     Combine();
-    return 1;
+    return true;
 }
 
 
diff --git a/sw/source/ui/wrtsh/wrtundo.cxx b/sw/source/ui/wrtsh/wrtundo.cxx
index 82d262a..7760525 100644
--- a/sw/source/ui/wrtsh/wrtundo.cxx
+++ b/sw/source/ui/wrtsh/wrtundo.cxx
@@ -63,8 +63,8 @@ void SwWrtShell::Do( DoType eDoType, sal_uInt16 nCnt )
     // #105332# restore undo state
     DoUndo(bSaveDoesUndo);
 
-    sal_Bool bCreateXSelection = sal_False;
-    const sal_Bool bFrmSelected = IsFrmSelected() || IsObjSelected();
+    bool bCreateXSelection = false;
+    const bool bFrmSelected = IsFrmSelected() || IsObjSelected();
     if ( IsSelection() )
     {
         if ( bFrmSelected )
@@ -74,18 +74,18 @@ void SwWrtShell::Do( DoType eDoType, sal_uInt16 nCnt )
         // bei Cursor setzen
         fnKillSel = &SwWrtShell::ResetSelect;
         fnSetCrsr = &SwWrtShell::SetCrsrKillSel;
-        bCreateXSelection = sal_True;
+        bCreateXSelection = true;
     }
     else if ( bFrmSelected )
     {
         EnterSelFrmMode();
-        bCreateXSelection = sal_True;
+        bCreateXSelection = true;
     }
     else if( (CNT_GRF | CNT_OLE ) & GetCntType() )
     {
         SelectObj( GetCharRect().Pos() );
         EnterSelFrmMode();
-        bCreateXSelection = sal_True;
+        bCreateXSelection = true;
     }
 
     if( bCreateXSelection )


More information about the Libreoffice-commits mailing list