summaryrefslogtreecommitdiffstats
path: root/editeng
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-04-02 21:53:46 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-04-03 10:20:09 -0400
commit33fadf7b0d6505ff2859b8d26c8db762e04d86b9 (patch)
treec965eb3f05ffb7f91fc65244c936cb2dd015649d /editeng
parentThis ought to be private... (diff)
downloadcore-33fadf7b0d6505ff2859b8d26c8db762e04d86b9.tar.gz
core-33fadf7b0d6505ff2859b8d26c8db762e04d86b9.zip
Bool cleanup.
Diffstat (limited to 'editeng')
-rw-r--r--editeng/inc/editeng/editeng.hxx2
-rw-r--r--editeng/source/editeng/editeng.cxx2
-rw-r--r--editeng/source/editeng/impedit.cxx4
-rw-r--r--editeng/source/editeng/impedit.hxx75
-rw-r--r--editeng/source/editeng/impedit2.cxx48
-rw-r--r--editeng/source/editeng/impedit3.cxx6
-rw-r--r--editeng/source/editeng/impedit4.cxx6
-rw-r--r--editeng/source/editeng/impedit5.cxx12
8 files changed, 77 insertions, 78 deletions
diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index c17b15b07529..6b6ea94ce0c3 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -263,7 +263,7 @@ public:
/** returns the value last used for bTryMerge while calling ImpEditEngine::InsertUndo
This is currently used in a bad but needed hack to get undo actions merged in the
OutlineView in impress. Do not use it unless you want to sell your soul too! */
- sal_Bool HasTriedMergeOnLastAddUndo() const;
+ bool HasTriedMergeOnLastAddUndo() const;
void ClearModifyFlag();
void SetModified();
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 4f9184f462d3..b6189d1876f4 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -161,7 +161,7 @@ void EditEngine::UndoActionEnd( sal_uInt16 nId )
pImpEditEngine->UndoActionEnd( nId );
}
-sal_Bool EditEngine::HasTriedMergeOnLastAddUndo() const
+bool EditEngine::HasTriedMergeOnLastAddUndo() const
{
return pImpEditEngine->mbLastTryMerge;
}
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 062622e2975b..62d32e095e91 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1372,13 +1372,13 @@ sal_Bool ImpEditView::IsInSelection( const EditPaM& rPaM )
void ImpEditView::CreateAnchor()
{
- pEditEngine->pImpEditEngine->bInSelection = sal_True;
+ pEditEngine->pImpEditEngine->bInSelection = true;
GetEditSelection().Min() = GetEditSelection().Max();
}
void ImpEditView::DeselectAll()
{
- pEditEngine->pImpEditEngine->bInSelection = sal_False;
+ pEditEngine->pImpEditEngine->bInSelection = false;
DrawSelection();
GetEditSelection().Min() = GetEditSelection().Max();
}
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 5329322d8b60..297bef58fd8a 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -450,8 +450,6 @@ private:
sal_uInt16 nStretchY;
sal_uInt16 nAsianCompressionMode;
- sal_Bool bKernAsianPunctuation;
- sal_Bool bAddExtLeading;
EEHorizontalTextDirection eDefaultHorizontalTextDirection;
@@ -475,20 +473,22 @@ private:
OnDemandLocaleDataWrapper xLocaleDataWrapper;
OnDemandTransliterationWrapper xTransliterationWrapper;
- sal_Bool bIsFormatting;
- sal_Bool bFormatted;
- sal_Bool bInSelection;
- sal_Bool bIsInUndo;
- sal_Bool bUpdate;
- sal_Bool bUndoEnabled;
- sal_Bool bOwnerOfRefDev;
- sal_Bool bDowning;
- sal_Bool bUseAutoColor;
- sal_Bool bForceAutoColor;
- sal_Bool bCallParaInsertedOrDeleted;
- sal_Bool bImpConvertFirstCall; // specifies if ImpConvert is called the very first time after Convert was called
- sal_Bool bFirstWordCapitalization; // specifies if auto-correction should capitalize the first word or not
- sal_Bool mbLastTryMerge;
+ bool bKernAsianPunctuation:1;
+ bool bAddExtLeading:1;
+ bool bIsFormatting:1;
+ bool bFormatted:1;
+ bool bInSelection:1;
+ bool bIsInUndo:1;
+ bool bUpdate:1;
+ bool bUndoEnabled:1;
+ bool bOwnerOfRefDev:1;
+ bool bDowning:1;
+ bool bUseAutoColor:1;
+ bool bForceAutoColor:1;
+ bool bCallParaInsertedOrDeleted:1;
+ bool bImpConvertFirstCall:1; // specifies if ImpConvert is called the very first time after Convert was called
+ bool bFirstWordCapitalization:1; // specifies if auto-correction should capitalize the first word or not
+ bool mbLastTryMerge:1;
// For Formatting / Update ....
boost::ptr_vector<DeletedNodeInfo> aDeletedNodes;
@@ -527,8 +527,7 @@ private:
void TextModified();
void CalcHeight( ParaPortion* pPortion );
- // may prefer in-line, but so few ...
- void InsertUndo( EditUndo* pUndo, sal_Bool bTryMerge = sal_False );
+ void InsertUndo( EditUndo* pUndo, bool bTryMerge = false );
void ResetUndoManager();
sal_Bool HasUndoManager() const { return pUndoManager ? sal_True : sal_False; }
@@ -664,10 +663,10 @@ private:
long CalcVertLineSpacing(Point& rStartPos) const;
Color GetAutoColor() const;
- void EnableAutoColor( sal_Bool b ) { bUseAutoColor = b; }
- sal_Bool IsAutoColorEnabled() const { return bUseAutoColor; }
- void ForceAutoColor( sal_Bool b ) { bForceAutoColor = b; }
- sal_Bool IsForceAutoColor() const { return bForceAutoColor; }
+ void EnableAutoColor( bool b ) { bUseAutoColor = b; }
+ bool IsAutoColorEnabled() const { return bUseAutoColor; }
+ void ForceAutoColor( bool b ) { bForceAutoColor = b; }
+ bool IsForceAutoColor() const { return bForceAutoColor; }
inline VirtualDevice* GetVirtualDevice( const MapMode& rMapMode, sal_uLong nDrawMode );
inline void EraseVirtualDevice();
@@ -705,7 +704,7 @@ public:
inline EditUndoManager& GetUndoManager();
void SetUpdateMode( sal_Bool bUp, EditView* pCurView = 0, sal_Bool bForceUpdate = sal_False );
- sal_Bool GetUpdateMode() const { return bUpdate; }
+ bool GetUpdateMode() const { return bUpdate; }
const ParaPortionList& GetParaPortions() const { return aParaPortionList; }
ParaPortionList& GetParaPortions() { return aParaPortionList; }
@@ -756,16 +755,16 @@ public:
void UpdateSelections();
- void EnableUndo( sal_Bool bEnable );
- sal_Bool IsUndoEnabled() { return bUndoEnabled; }
- void SetUndoMode( sal_Bool b ) { bIsInUndo = b; }
- sal_Bool IsInUndo() { return bIsInUndo; }
+ void EnableUndo( bool bEnable );
+ bool IsUndoEnabled() { return bUndoEnabled; }
+ void SetUndoMode( bool b ) { bIsInUndo = b; }
+ bool IsInUndo() { return bIsInUndo; }
- void SetCallParaInsertedOrDeleted( sal_Bool b ) { bCallParaInsertedOrDeleted = b; }
- sal_Bool IsCallParaInsertedOrDeleted() const { return bCallParaInsertedOrDeleted; }
+ void SetCallParaInsertedOrDeleted( bool b ) { bCallParaInsertedOrDeleted = b; }
+ bool IsCallParaInsertedOrDeleted() const { return bCallParaInsertedOrDeleted; }
- sal_Bool IsFormatted() const { return bFormatted; }
- sal_Bool IsFormatting() const { return bIsFormatting; }
+ bool IsFormatted() const { return bFormatted; }
+ bool IsFormatting() const { return bIsFormatting; }
void SetText( const String& rText );
EditPaM DeleteSelected( EditSelection aEditSelection);
@@ -825,7 +824,7 @@ public:
Link GetModifyHdl() const { return aModifyHdl; }
- sal_Bool IsInSelectionMode() { return bInSelection; }
+ bool IsInSelectionMode() { return bInSelection; }
void IndentBlock( EditView* pView, sal_Bool bRight );
@@ -995,11 +994,11 @@ public:
void SetAsianCompressionMode( sal_uInt16 n );
sal_uInt16 GetAsianCompressionMode() const { return nAsianCompressionMode; }
- void SetKernAsianPunctuation( sal_Bool b );
- sal_Bool IsKernAsianPunctuation() const { return bKernAsianPunctuation; }
+ void SetKernAsianPunctuation( bool b );
+ bool IsKernAsianPunctuation() const { return bKernAsianPunctuation; }
- void SetAddExtLeading( sal_Bool b );
- sal_Bool IsAddExtLeading() const { return bAddExtLeading; }
+ void SetAddExtLeading( bool b );
+ bool IsAddExtLeading() const { return bAddExtLeading; }
rtl::Reference<SvxForbiddenCharactersTable> GetForbiddenCharsTable( sal_Bool bGetInternal = sal_True ) const;
void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars );
@@ -1013,8 +1012,8 @@ public:
Link GetEndDropHdl() const { return maEndDropHdl; }
/// specifies if auto-correction should capitalize the first word or not (default is on)
- void SetFirstWordCapitalization( sal_Bool bCapitalize ) { bFirstWordCapitalization = bCapitalize; }
- sal_Bool IsFirstWordCapitalization() const { return bFirstWordCapitalization; }
+ void SetFirstWordCapitalization( bool bCapitalize ) { bFirstWordCapitalization = bCapitalize; }
+ bool IsFirstWordCapitalization() const { return bFirstWordCapitalization; }
};
inline EPaM ImpEditEngine::CreateEPaM( const EditPaM& rPaM )
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 406f2eba0b47..5743dc33fc5f 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -120,26 +120,26 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) :
nStretchX = 100;
nStretchY = 100;
- bInSelection = sal_False;
- bOwnerOfRefDev = sal_False;
- bDowning = sal_False;
- bIsInUndo = sal_False;
- bIsFormatting = sal_False;
- bFormatted = sal_False;
- bUpdate = sal_True;
- bUseAutoColor = sal_True;
- bForceAutoColor = sal_False;
- bAddExtLeading = sal_False;
- bUndoEnabled = sal_True;
- bCallParaInsertedOrDeleted = sal_False;
- bImpConvertFirstCall= sal_False;
- bFirstWordCapitalization = sal_True;
+ bInSelection = false;
+ bOwnerOfRefDev = false;
+ bDowning = false;
+ bIsInUndo = false;
+ bIsFormatting = false;
+ bFormatted = false;
+ bUpdate = true;
+ bUseAutoColor = true;
+ bForceAutoColor = false;
+ bAddExtLeading = false;
+ bUndoEnabled = true;
+ bCallParaInsertedOrDeleted = false;
+ bImpConvertFirstCall= false;
+ bFirstWordCapitalization = true;
eDefLanguage = LANGUAGE_DONTKNOW;
maBackgroundColor = COL_AUTO;
nAsianCompressionMode = text::CharacterCompressionType::NONE;
- bKernAsianPunctuation = sal_False;
+ bKernAsianPunctuation = false;
eDefaultHorizontalTextDirection = EE_HTEXTDIR_DEFAULT;
@@ -166,11 +166,11 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) :
SetRefDevice( pRefDev );
InitDoc( sal_False );
- bCallParaInsertedOrDeleted = sal_True;
+ bCallParaInsertedOrDeleted = true;
aEditDoc.SetModifyHdl( LINK( this, ImpEditEngine, DocModified ) );
- mbLastTryMerge = sal_False;
+ mbLastTryMerge = false;
}
ImpEditEngine::~ImpEditEngine()
@@ -182,7 +182,7 @@ ImpEditEngine::~ImpEditEngine()
// Destroying templates may otherwise cause unnecessary formatting,
// when a parent template is destroyed.
// And this after the destruction of the data!
- bDowning = sal_True;
+ bDowning = true;
SetUpdateMode( sal_False );
delete pVirtDev;
@@ -203,7 +203,7 @@ void ImpEditEngine::SetRefDevice( OutputDevice* pRef )
delete pRefDev;
pRefDev = pRef;
- bOwnerOfRefDev = sal_False;
+ bOwnerOfRefDev = false;
if ( !pRef )
pRefDev = EE_DLL().GetGlobalData()->GetStdRefDevice();
@@ -228,7 +228,7 @@ void ImpEditEngine::SetRefMapMode( const MapMode& rMapMode )
pRefDev = new VirtualDevice;
pRefDev->SetMapMode( MAP_TWIP );
SetRefDevice( pRefDev );
- bOwnerOfRefDev = sal_True;
+ bOwnerOfRefDev = true;
}
pRefDev->SetMapMode( rMapMode );
nOnePixelInRef = (sal_uInt16)pRefDev->PixelToLogic( Size( 1, 0 ) ).Width();
@@ -258,7 +258,7 @@ void ImpEditEngine::InitDoc( sal_Bool bKeepParaAttribs )
ParaPortion* pIniPortion = new ParaPortion( aEditDoc[0] );
GetParaPortions().Insert(0, pIniPortion);
- bFormatted = sal_False;
+ bFormatted = false;
if ( IsCallParaInsertedOrDeleted() )
{
@@ -660,7 +660,7 @@ sal_Bool ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView
{
GetSelEngine().SetCurView( pView );
GetSelEngine().SelMouseButtonUp( rMEvt );
- bInSelection = sal_False;
+ bInSelection = false;
// Special treatments
EditSelection aCurSel( pView->pImpEditView->GetEditSelection() );
if ( !aCurSel.HasRange() )
@@ -794,7 +794,7 @@ void ImpEditEngine::CursorMoved( ContentNode* pPrevNode )
void ImpEditEngine::TextModified()
{
- bFormatted = sal_False;
+ bFormatted = false;
if ( GetNotifyHdl().IsSet() )
{
@@ -810,7 +810,7 @@ void ImpEditEngine::ParaAttribsChanged( ContentNode* pNode )
OSL_ENSURE( pNode, "ParaAttribsChanged: Which one?" );
aEditDoc.SetModified( sal_True );
- bFormatted = sal_False;
+ bFormatted = false;
ParaPortion* pPortion = FindParaPortion( pNode );
OSL_ENSURE( pPortion, "ParaAttribsChanged: Portion?" );
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 7806bce635f6..c1c7aea01763 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -370,7 +370,7 @@ void ImpEditEngine::FormatDoc()
EnterBlockNotifications();
- bIsFormatting = sal_True;
+ bIsFormatting = true;
// Then I can also start the spell-timer ...
if ( GetStatus().DoOnlineSpelling() )
@@ -487,8 +487,8 @@ void ImpEditEngine::FormatDoc()
if ( aStatus.DoRestoreFont() )
GetRefDevice()->SetFont( aOldFont );
- bIsFormatting = sal_False;
- bFormatted = sal_True;
+ bIsFormatting = false;
+ bFormatted = true;
if ( bMapChanged )
GetRefDevice()->Pop();
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 4863e4840b25..3d353309e959 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1572,7 +1572,7 @@ void ImpEditEngine::Convert( EditView* pEditView,
else if ( CreateEPaM( aEditDoc.GetStartPaM() ) == pConvInfo->aConvStart )
bIsStart = sal_True;
- bImpConvertFirstCall = sal_True; // next ImpConvert call is the very first in this conversion turn
+ bImpConvertFirstCall = true; // next ImpConvert call is the very first in this conversion turn
Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
TextConvWrapper aWrp( Application::GetDefDialogParent(), xMSF,
@@ -3061,7 +3061,7 @@ void ImpEditEngine::SetAsianCompressionMode( sal_uInt16 n )
}
}
-void ImpEditEngine::SetKernAsianPunctuation( sal_Bool b )
+void ImpEditEngine::SetKernAsianPunctuation( bool b )
{
if ( b != bKernAsianPunctuation )
{
@@ -3074,7 +3074,7 @@ void ImpEditEngine::SetKernAsianPunctuation( sal_Bool b )
}
}
-void ImpEditEngine::SetAddExtLeading( sal_Bool bExtLeading )
+void ImpEditEngine::SetAddExtLeading( bool bExtLeading )
{
if ( IsAddExtLeading() != bExtLeading )
{
diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx
index 46fab2cf55c9..2dd9328912dd 100644
--- a/editeng/source/editeng/impedit5.cxx
+++ b/editeng/source/editeng/impedit5.cxx
@@ -263,13 +263,13 @@ void ImpEditEngine::UndoActionEnd( sal_uInt16 )
}
}
-void ImpEditEngine::InsertUndo( EditUndo* pUndo, sal_Bool bTryMerge )
+void ImpEditEngine::InsertUndo( EditUndo* pUndo, bool bTryMerge )
{
DBG_ASSERT( !IsInUndo(), "InsertUndo in Undomodus!" );
if ( pUndoMarkSelection )
{
EditUndoMarkSelection* pU = new EditUndoMarkSelection( this, *pUndoMarkSelection );
- GetUndoManager().AddUndoAction( pU, sal_False );
+ GetUndoManager().AddUndoAction( pU, false );
delete pUndoMarkSelection;
pUndoMarkSelection = NULL;
}
@@ -284,7 +284,7 @@ void ImpEditEngine::ResetUndoManager()
GetUndoManager().Clear();
}
-void ImpEditEngine::EnableUndo( sal_Bool bEnable )
+void ImpEditEngine::EnableUndo( bool bEnable )
{
// When switching the mode Delete list:
if ( bEnable != IsUndoEnabled() )
@@ -586,7 +586,7 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_
}
else if ( bCharAttribFound )
{
- bFormatted = sal_False;
+ bFormatted = false;
if ( !pNode->Len() || ( nStartPos != nEndPos ) )
{
pPortion->MarkSelectionInvalid( nStartPos, nEndPos-nStartPos );
@@ -657,7 +657,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaA
if ( bChanged && !bRemoveParaAttribs )
{
- bFormatted = sal_False;
+ bFormatted = false;
pPortion->MarkSelectionInvalid( nStartPos, nEndPos-nStartPos );
}
}
@@ -794,7 +794,7 @@ void ImpEditEngine::ParaAttribsToCharAttribs( ContentNode* pNode )
aEditDoc.InsertAttrib( pNode, nLastEnd, nEndPos, rItem );
}
}
- bFormatted = sal_False;
+ bFormatted = false;
// Portion does not need to be invalidated here, happens elsewhere.
}