diff options
author | Noel Grandin <noel@peralex.com> | 2014-04-09 11:03:42 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-04-15 09:02:32 +0200 |
commit | 3edb4611b2314fa5c03e1b4f70c425d92c95ed16 (patch) | |
tree | 77d7c9c28b3f427ccd842378d9160a40092fea88 | |
parent | 8a81f542a6ca566661305c53899b7e422cbaa432 (diff) |
editeng: sal_Bool->bool
Change-Id: I71ea2f0e48a6252832180872945b96a120f21907
46 files changed, 801 insertions, 801 deletions
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index 0c1c867456a1..31885e2c0e88 100644 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -1292,11 +1292,11 @@ namespace accessibility for (sal_Int32 i = 0; i < nRes; ++i) { beans::PropertyValue &rRes = pRes[i]; - sal_Bool bIsDirectVal = sal_False; + bool bIsDirectVal = false; for (sal_Int32 k = 0; k < nRunAttribs && !bIsDirectVal; ++k) { if (rRes.Name == pRunAttrib[k].Name) - bIsDirectVal = sal_True; + bIsDirectVal = true; } rRes.Handle = -1; rRes.State = bIsDirectVal ? PropertyState_DIRECT_VALUE : PropertyState_DEFAULT_VALUE; @@ -1670,7 +1670,7 @@ namespace accessibility if (rRes.Name == "NumberingRules") { SfxItemSet aAttribs = rCacheTF.GetParaAttribs( static_cast< sal_uInt16 >(GetParagraphIndex()) ); - sal_Bool bVis = ((const SfxUInt16Item&)aAttribs.Get( EE_PARA_BULLETSTATE )).GetValue() ? sal_True : sal_False; + bool bVis = ((const SfxUInt16Item&)aAttribs.Get( EE_PARA_BULLETSTATE )).GetValue() ? sal_True : sal_False; if(bVis) { rRes.Value <<= (sal_Int16)-1; @@ -2038,7 +2038,7 @@ namespace accessibility // get previous word - sal_Bool bWord = sal_False; + bool bWord = false; //while ( preWordStart > 0 && aBoundary.startPos == curWordStart) while ( (preWordStart >= 0 && !bWord ) || ( aBoundary.endPos > curWordStart ) ) @@ -2156,7 +2156,7 @@ namespace accessibility sal_Int32 nLength = sText.getLength(); // get word at index - sal_Bool bWord = implGetWordBoundary( aBoundary, nIndex ); + bool bWord = implGetWordBoundary( aBoundary, nIndex ); // real current world sal_Int32 nextWord = nIndex; @@ -2210,7 +2210,7 @@ namespace accessibility GetTextForwarder(); // MUST be after GetEditViewForwarder(), see method docs #endif - sal_Bool aRetVal; + bool aRetVal; DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX, "AccessibleEditableTextPara::copyText: index value overflow"); @@ -2341,7 +2341,7 @@ namespace accessibility return sal_False; // non-editable area selected //sal_Bool bRet = rCacheTF.Delete( MakeSelection(nStartIndex, nEndIndex) ); - sal_Bool bRet = rCacheTF.Delete( aSelection ); + bool bRet = rCacheTF.Delete( aSelection ); GetEditSource().UpdateData(); @@ -2380,7 +2380,7 @@ namespace accessibility return sal_False; // non-editable area selected // #104400# insert given text at empty selection (=> cursor) - sal_Bool bRet = rCacheTF.InsertText( sText, MakeCursor(nIndex + nBulletLen) ); + bool bRet = rCacheTF.InsertText( sText, MakeCursor(nIndex + nBulletLen) ); rCacheTF.QuickFormatDoc(); GetEditSource().UpdateData(); @@ -2423,7 +2423,7 @@ namespace accessibility // insert given text into given range => replace //sal_Bool bRet = rCacheTF.InsertText( sReplacement, MakeSelection(nStartIndex, nEndIndex) ); - sal_Bool bRet = rCacheTF.InsertText( sReplacement, aSelection ); + bool bRet = rCacheTF.InsertText( sReplacement, aSelection ); rCacheTF.QuickFormatDoc(); GetEditSource().UpdateData(); diff --git a/editeng/source/accessibility/AccessibleHyperlink.cxx b/editeng/source/accessibility/AccessibleHyperlink.cxx index fe71634ed514..f313cb3915bd 100644 --- a/editeng/source/accessibility/AccessibleHyperlink.cxx +++ b/editeng/source/accessibility/AccessibleHyperlink.cxx @@ -63,11 +63,11 @@ namespace accessibility sal_Bool SAL_CALL AccessibleHyperlink::doAccessibleAction( sal_Int32 nIndex ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception) { - sal_Bool bRet = sal_False; + bool bRet = false; if ( isValid() && ( nIndex == 0 ) ) { rTA.FieldClicked( *pFld, nPara, nRealIdx ); - bRet = sal_True; + bRet = true; } return bRet; } diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx index a671dabb3c6d..340e8d2446d3 100644 --- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx +++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx @@ -175,13 +175,13 @@ namespace accessibility void CorrectTextSegment( TextSegment& aTextSegment, int nPara ) const; - sal_Bool SetSelection( sal_Int32 nStartPara, sal_Int32 nStartIndex, + bool SetSelection( sal_Int32 nStartPara, sal_Int32 nStartIndex, sal_Int32 nEndPara, sal_Int32 nEndIndex ); - sal_Bool CopyText( sal_Int32 nStartPara, sal_Int32 nStartIndex, + bool CopyText( sal_Int32 nStartPara, sal_Int32 nStartIndex, sal_Int32 nEndPara, sal_Int32 nEndIndex ); Rectangle GetParagraphBoundingBox() const; - sal_Bool RemoveLineBreakCount( sal_Int32& rIndex ); + bool RemoveLineBreakCount( sal_Int32& rIndex ); private: @@ -380,12 +380,12 @@ namespace accessibility mxThis); } - sal_Bool AccessibleStaticTextBase_Impl::SetSelection( sal_Int32 nStartPara, sal_Int32 nStartIndex, + bool AccessibleStaticTextBase_Impl::SetSelection( sal_Int32 nStartPara, sal_Int32 nStartIndex, sal_Int32 nEndPara, sal_Int32 nEndIndex ) { if( !mpTextParagraph ) - return sal_False; + return false; try { @@ -394,22 +394,22 @@ namespace accessibility } catch( const uno::RuntimeException& ) { - return sal_False; + return false; } } - sal_Bool AccessibleStaticTextBase_Impl::CopyText( sal_Int32 nStartPara, sal_Int32 nStartIndex, + bool AccessibleStaticTextBase_Impl::CopyText( sal_Int32 nStartPara, sal_Int32 nStartIndex, sal_Int32 nEndPara, sal_Int32 nEndIndex ) { if( !mpTextParagraph ) - return sal_False; + return false; try { SvxEditViewForwarder& rCacheVF = mpTextParagraph->GetEditViewForwarder( true ); mpTextParagraph->GetTextForwarder(); // MUST be after GetEditViewForwarder(), see method docs - sal_Bool aRetVal; + bool aRetVal; // save current selection ESelection aOldSelection; @@ -423,7 +423,7 @@ namespace accessibility } catch( const uno::RuntimeException& ) { - return sal_False; + return false; } } @@ -444,14 +444,14 @@ namespace accessibility //the input argument is the index(including "\n" ) in the string. //the function will calculate the actual index(not including "\n") in the string. //and return true if the index is just at a "\n" - sal_Bool AccessibleStaticTextBase_Impl::RemoveLineBreakCount( sal_Int32& rIndex ) + bool AccessibleStaticTextBase_Impl::RemoveLineBreakCount( sal_Int32& rIndex ) { // get the total char number inside the cell. sal_Int32 i, nCount, nParas; for( i=0, nCount=0, nParas=GetParagraphCount(); i<nParas; ++i ) nCount += GetParagraph(i).getCharacterCount(); nCount = nCount + (nParas-1); - if( nCount == 0 && rIndex == 0) return sal_False; + if( nCount == 0 && rIndex == 0) return false; sal_Int32 nCurrPara, nCurrCount; @@ -473,24 +473,24 @@ namespace accessibility if ( (nCurrPara+1) == nParaCount ) { rIndex++; - return sal_False; + return false; } else { - return sal_True; + return true; } } else if ( rIndex < nLineBreakPos ) { rIndex -= nLineBreakCount; - return sal_False; + return false; } else { nLineBreakCount++; } } - return sal_False; + return false; } @@ -827,7 +827,7 @@ namespace accessibility { return OUString(); } - sal_Bool bStart = mpImpl->RemoveLineBreakCount( nStartIndex ); + bool bStart = mpImpl->RemoveLineBreakCount( nStartIndex ); //if the start index is just at a "\n", we need to begin from the next char if ( bStart ) { @@ -836,13 +836,13 @@ namespace accessibility //we need to find out whether the previous position of the current endindex is at "\n" or not //if yes we need to mark it and add "\n" at the end of the result sal_Int32 nTemp = nEndIndex - 1; - sal_Bool bEnd = mpImpl->RemoveLineBreakCount( nTemp ); - sal_Bool bTemp = mpImpl->RemoveLineBreakCount( nEndIndex ); + bool bEnd = mpImpl->RemoveLineBreakCount( nTemp ); + bool bTemp = mpImpl->RemoveLineBreakCount( nEndIndex ); //if the below condition is true it indicates an empty paragraph with just a "\n" //so we need to set one "\n" flag to avoid duplication. if ( bStart && bEnd && ( nStartIndex == nEndIndex) ) { - bEnd = sal_False; + bEnd = false; } //if the current endindex is at a "\n", we need to increase endindex by 1 to make sure //the char before "\n" is included. Because string returned by this function will not include @@ -903,7 +903,7 @@ namespace accessibility { SolarMutexGuard aGuard; - sal_Bool bLineBreak = mpImpl->RemoveLineBreakCount( nIndex ); + bool bLineBreak = mpImpl->RemoveLineBreakCount( nIndex ); EPosition aPos( mpImpl->Range2Internal(nIndex) ); ::com::sun::star::accessibility::TextSegment aResult; @@ -955,7 +955,7 @@ namespace accessibility SolarMutexGuard aGuard; sal_Int32 nOldIdx = nIndex; - sal_Bool bLineBreak = mpImpl->RemoveLineBreakCount( nIndex ); + bool bLineBreak = mpImpl->RemoveLineBreakCount( nIndex ); EPosition aPos( mpImpl->Range2Internal(nIndex) ); ::com::sun::star::accessibility::TextSegment aResult; @@ -1001,7 +1001,7 @@ namespace accessibility SolarMutexGuard aGuard; sal_Int32 nTemp = nIndex+1; - sal_Bool bLineBreak = mpImpl->RemoveLineBreakCount( nTemp ); + bool bLineBreak = mpImpl->RemoveLineBreakCount( nTemp ); mpImpl->RemoveLineBreakCount( nIndex ); EPosition aPos( mpImpl->Range2Internal(nIndex) ); diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx index 9091bca7d7c2..33c823d915b7 100644 --- a/editeng/source/editeng/editattr.cxx +++ b/editeng/source/editeng/editattr.cxx @@ -290,7 +290,7 @@ void EditCharAttribOutline::SetFont( SvxFont& rFont, OutputDevice* ) EditCharAttribTab::EditCharAttribTab( const SfxVoidItem& rAttr, sal_uInt16 nPos ) : EditCharAttrib( rAttr, nPos, nPos+1 ) { - SetFeature( sal_True ); + SetFeature( true ); } void EditCharAttribTab::SetFont( SvxFont&, OutputDevice* ) @@ -303,7 +303,7 @@ void EditCharAttribTab::SetFont( SvxFont&, OutputDevice* ) EditCharAttribLineBreak::EditCharAttribLineBreak( const SfxVoidItem& rAttr, sal_uInt16 nPos ) : EditCharAttrib( rAttr, nPos, nPos+1 ) { - SetFeature( sal_True ); + SetFeature( true ); } void EditCharAttribLineBreak::SetFont( SvxFont&, OutputDevice* ) @@ -316,7 +316,7 @@ void EditCharAttribLineBreak::SetFont( SvxFont&, OutputDevice* ) EditCharAttribField::EditCharAttribField( const SvxFieldItem& rAttr, sal_uInt16 nPos ) : EditCharAttrib( rAttr, nPos, nPos+1 ) { - SetFeature( sal_True ); // !!! + SetFeature( true ); // !!! pTxtColor = 0; pFldColor = 0; } diff --git a/editeng/source/editeng/editattr.hxx b/editeng/source/editeng/editattr.hxx index 36360635bf6f..505d6876917f 100644 --- a/editeng/source/editeng/editattr.hxx +++ b/editeng/source/editeng/editattr.hxx @@ -70,8 +70,8 @@ protected: sal_uInt16 nStart; sal_uInt16 nEnd; - sal_Bool bFeature :1; - sal_Bool bEdge :1; + bool bFeature :1; + bool bEdge :1; public: EditCharAttrib( const SfxPoolItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); @@ -96,18 +96,18 @@ public: virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); - sal_Bool IsIn( sal_uInt16 nIndex ) const + bool IsIn( sal_uInt16 nIndex ) const { return ( ( nStart <= nIndex ) && ( nEnd >= nIndex ) ); } - sal_Bool IsInside( sal_uInt16 nIndex ) const + bool IsInside( sal_uInt16 nIndex ) const { return ( ( nStart < nIndex ) && ( nEnd > nIndex ) ); } bool IsEmpty() const { return nStart == nEnd; } bool IsFeature() const { return bFeature; } - void SetFeature( sal_Bool b) { bFeature = b; } + void SetFeature( bool b) { bFeature = b; } - sal_Bool IsEdge() const { return bEdge; } - void SetEdge( sal_Bool b ) { bEdge = b; } + bool IsEdge() const { return bEdge; } + void SetEdge( bool b ) { bEdge = b; } }; inline sal_uInt16 EditCharAttrib::GetLen() const diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index 8c68431dfeb2..442bda24c81e 100644 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -284,7 +284,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem) return aDebStr.makeStringAndClear(); } -void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, sal_Bool bSearchInParent, sal_Bool bShowALL ) +void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, bool bSearchInParent, bool bShowALL ) { for ( sal_uInt16 nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) { @@ -305,7 +305,7 @@ void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, sal_Bool bSearchInParent, } } -void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool bInfoBox ) +void EditDbg::ShowEditEngineData( EditEngine* pEE, bool bInfoBox ) { #if defined UNX FILE* fp = fopen( "/tmp/debug.log", "w" ); @@ -334,10 +334,10 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool bInfoBox ) if ( pStyle ) fprintf( fp, " %s", OUStringToOString( pStyle->GetName(), RTL_TEXTENCODING_UTF8).getStr() ); fprintf( fp, "\nParagraph attribute:" ); - DbgOutItemSet( fp, pPPortion->GetNode()->GetContentAttribs().GetItems(), sal_False, sal_False ); + DbgOutItemSet( fp, pPPortion->GetNode()->GetContentAttribs().GetItems(), false, false ); fprintf( fp, "\nCharacter attribute:" ); - sal_Bool bZeroAttr = sal_False; + bool bZeroAttr = false; sal_uInt16 z; for ( z = 0; z < pPPortion->GetNode()->GetCharAttribs().Count(); z++ ) { @@ -352,7 +352,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool bInfoBox ) aCharAttribs.append('\t'); aCharAttribs.append(static_cast<sal_Int32>(rAttr.GetEnd())); if ( rAttr.IsEmpty() ) - bZeroAttr = sal_True; + bZeroAttr = true; fprintf(fp, "%s => ", aCharAttribs.getStr()); OString aDebStr = DbgOutItem( rPool, *rAttr.GetItem() ); @@ -429,7 +429,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool bInfoBox ) fprintf( fp, "\nTemplate: %s", OUStringToOString( pStyle->GetName(), RTL_TEXTENCODING_ASCII_US ).getStr() ); fprintf( fp, "\nParent: %s", OUStringToOString( pStyle->GetParent(), RTL_TEXTENCODING_ASCII_US ).getStr() ); fprintf( fp, "\nFollow: %s", OUStringToOString( pStyle->GetFollow(), RTL_TEXTENCODING_ASCII_US ).getStr() ); - DbgOutItemSet( fp, pStyle->GetItemSet(), sal_False, sal_False ); + DbgOutItemSet( fp, pStyle->GetItemSet(), false, false ); fprintf( fp, "\n----------------------------------" ); pStyle = aIter.Next(); @@ -439,7 +439,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool bInfoBox ) fprintf( fp, "\n\n================================================================================" ); fprintf( fp, "\n================== Defaults ================================================" ); fprintf( fp, "\n================================================================================" ); - DbgOutItemSet( fp, pEE->pImpEditEngine->GetEmptyItemSet(), sal_True, sal_True ); + DbgOutItemSet( fp, pEE->pImpEditEngine->GetEmptyItemSet(), true, true ); fprintf( fp, "\n\n================================================================================" ); fprintf( fp, "\n================== EditEngine & Views ======================================" ); @@ -468,7 +468,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool bInfoBox ) fprintf( fp, "\n\n================================================================================" ); fprintf( fp, "\n================== Current View ===========================================" ); fprintf( fp, "\n================================================================================" ); - DbgOutItemSet( fp, pEE->GetActiveView()->GetAttribs(), sal_True, sal_False ); + DbgOutItemSet( fp, pEE->GetActiveView()->GetAttribs(), true, false ); } fclose( fp ); if ( bInfoBox ) diff --git a/editeng/source/editeng/editdbg.hxx b/editeng/source/editeng/editdbg.hxx index 3f7a4e1cfbec..f9698b1898eb 100644 --- a/editeng/source/editeng/editdbg.hxx +++ b/editeng/source/editeng/editdbg.hxx @@ -29,12 +29,12 @@ class SfxItemPool; class SfxPoolItem; OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem); -void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, sal_Bool bSearchInParent, sal_Bool bShowALL ); +void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, bool bSearchInParent, bool bShowALL ); class EditDbg { public: - static void ShowEditEngineData( EditEngine* pEditEngine, sal_Bool bInfoBox = sal_True ); + static void ShowEditEngineData( EditEngine* pEditEngine, bool bInfoBox = true ); }; #endif // INCLUDED_EDITENG_SOURCE_EDITENG_EDITDBG_HXX diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index fc2d35f019bb..2eeaeba663ce 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -103,9 +103,9 @@ sal_uInt16 GetScriptItemId( sal_uInt16 nItemId, short nScriptType ) return nId; } -sal_Bool IsScriptItemValid( sal_uInt16 nItemId, short nScriptType ) +bool IsScriptItemValid( sal_uInt16 nItemId, short nScriptType ) { - sal_Bool bValid = sal_True; + bool bValid = true; switch ( nItemId ) { @@ -531,8 +531,8 @@ ExtraPortionInfo::ExtraPortionInfo() , nPortionOffsetX(0) , nMaxCompression100thPercent(0) , nAsianCompressionTypes(0) -, bFirstCharIsRightPunktuation(sal_False) -, bCompressed(sal_False) +, bFirstCharIsRightPunktuation(false) +, bCompressed(false) , pOrgDXArray(NULL) , lineBreaksList() { @@ -555,10 +555,10 @@ ParaPortion::ParaPortion( ContentNode* pN ) { pNode = pN; - bInvalid = sal_True; - bVisible = sal_True; - bSimple = sal_False; - bForceRepaint = sal_False; + bInvalid = true; + bVisible = true; + bSimple = false; + bForceRepaint = false; nInvalidPosStart = 0; nInvalidDiff = 0; nHeight = 0; @@ -572,7 +572,7 @@ ParaPortion::~ParaPortion() void ParaPortion::MarkInvalid( sal_Int32 nStart, sal_Int32 nDiff ) { - if ( bInvalid == sal_False ) + if ( bInvalid == false ) { // nInvalidPosEnd = nStart; // ??? => CreateLines nInvalidPosStart = ( nDiff >= 0 ) ? nStart : ( nStart + nDiff ); @@ -598,17 +598,17 @@ void ParaPortion::MarkInvalid( sal_Int32 nStart, sal_Int32 nDiff ) DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" ); nInvalidPosStart = std::min( nInvalidPosStart, ( nDiff < 0 ? nStart+nDiff : nDiff ) ); nInvalidDiff = 0; - bSimple = sal_False; + bSimple = false; } } - bInvalid = sal_True; + bInvalid = true; aScriptInfos.clear(); aWritingDirectionInfos.clear(); } void ParaPortion::MarkSelectionInvalid( sal_Int32 nStart, sal_Int32 /* nEnd */ ) { - if ( bInvalid == sal_False ) + if ( bInvalid == false ) { nInvalidPosStart = nStart; // nInvalidPosEnd = nEnd; @@ -619,8 +619,8 @@ void ParaPortion::MarkSelectionInvalid( sal_Int32 nStart, sal_Int32 /* nEnd */ ) // nInvalidPosEnd = pNode->Len(); } nInvalidDiff = 0; - bInvalid = sal_True; - bSimple = sal_False; + bInvalid = true; + bSimple = false; aScriptInfos.clear(); aWritingDirectionInfos.clear(); } @@ -641,7 +641,7 @@ sal_Int32 ParaPortion::GetLineNumber( sal_Int32 nIndex ) const return (aLineList.Count()-1); } -void ParaPortion::SetVisible( sal_Bool bMakeVisible ) +void ParaPortion::SetVisible( bool bMakeVisible ) { bVisible = bMakeVisible; } @@ -1026,21 +1026,21 @@ EditLine* EditLine::Clone() const return pL; } -sal_Bool operator == ( const EditLine& r1, const EditLine& r2 ) +bool operator == ( const EditLine& r1, const EditLine& r2 ) { if ( r1.nStart != r2.nStart ) - return sal_False; + return false; if ( r1.nEnd != r2.nEnd ) - return sal_False; + return false; if ( r1.nStartPortion != r2.nStartPortion ) - return sal_False; + return false; if ( r1.nEndPortion != r2.nEndPortion ) - return sal_False; + return false; - return sal_True; + return true; } EditLine& EditLine::operator = ( const EditLine& r ) @@ -1053,7 +1053,7 @@ EditLine& EditLine::operator = ( const EditLine& r ) } -sal_Bool operator != ( const EditLine& r1, const EditLine& r2 ) +bool operator != ( const EditLine& r1, const EditLine& r2 ) { return !( r1 == r2 ); } @@ -1510,7 +1510,7 @@ void ContentNode::CollapsAttribs( sal_Int32 nIndex, sal_Int32 nDeleted, SfxItemP #endif } -void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, sal_Bool bKeepEndingAttribs ) +void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, bool bKeepEndingAttribs ) { DBG_ASSERT( pPrevNode, "Copy of attributes to a null pointer?" ); @@ -1640,7 +1640,7 @@ void ContentNode::SetStyleSheet( SfxStyleSheet* pS, const SvxFont& rFontFromStyl GetContentAttribs().GetItems(), pS == NULL ); } -void ContentNode::SetStyleSheet( SfxStyleSheet* pS, sal_Bool bRecalcFont ) +void ContentNode::SetStyleSheet( SfxStyleSheet* pS, bool bRecalcFont ) { aContentAttribs.SetStyleSheet( pS ); if ( bRecalcFont ) @@ -1770,7 +1770,7 @@ SvxTabStop ContentAttribs::FindTabStop( sal_Int32 nCurPos, sal_uInt16 nDefTab ) void ContentAttribs::SetStyleSheet( SfxStyleSheet* pS ) { - sal_Bool bStyleChanged = ( pStyle != pS ); + bool bStyleChanged = ( pStyle != pS ); pStyle = pS; // Only when other style sheet, not when current style sheet modified if ( pStyle && bStyleChanged ) @@ -1969,7 +1969,7 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, s rFont = aPrevFont; // => The same ImpPointer for IsSameInstance } -void EditDoc::CreateDefFont( sal_Bool bUseStyles ) +void EditDoc::CreateDefFont( bool bUseStyles ) { SfxItemSet aTmpSet( GetItemPool(), EE_PARA_START, EE_CHAR_END ); CreateFont( aDefFont, aTmpSet ); @@ -2234,7 +2234,7 @@ EditPaM EditDoc::InsertText( EditPaM aPaM, const OUString& rStr ) return aPaM; } -EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, sal_Bool bKeepEndingAttribs ) +EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, bool bKeepEndingAttribs ) { DBG_ASSERT( aPaM.GetNode(), "Blinder PaM in EditDoc::InsertParaBreak" ); ContentNode* pCurNode = aPaM.GetNode(); @@ -2361,14 +2361,14 @@ void EditDoc::InsertAttribInSelection( ContentNode* pNode, sal_Int32 nStart, sal SetModified(true); } -sal_Bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt16 nWhich ) +bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt16 nWhich ) { EditCharAttrib* pStarting; EditCharAttrib* pEnding; return RemoveAttribs( pNode, nStart, nEnd, pStarting, pEnding, nWhich ); } -sal_Bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, sal_uInt16 nWhich ) +bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, sal_uInt16 nWhich ) { DBG_ASSERT( pNode, "What to do with the attribute?" ); @@ -2993,7 +2993,7 @@ SvxColorItem* SvxColorList::GetObject( sal_Int32 nIndex ) return ( nIndex >= (sal_Int32)aColorList.size() ) ? NULL : aColorList[ nIndex ]; } -EditEngineItemPool::EditEngineItemPool( sal_Bool bPersistenRefCounts ) +EditEngineItemPool::EditEngineItemPool( bool bPersistenRefCounts ) : SfxItemPool( "EditEngineItemPool", EE_ITEMS_START, EE_ITEMS_END, aItemInfos, 0, bPersistenRefCounts ) { @@ -3021,7 +3021,7 @@ SvStream& EditEngineItemPool::Store( SvStream& rStream ) const // stored until then... long nVersion = rStream.GetVersion(); - sal_Bool b31Format = ( nVersion && ( nVersion <= SOFFICE_FILEFORMAT_31 ) ) + bool b31Format = ( nVersion && ( nVersion <= SOFFICE_FILEFORMAT_31 ) ) ? sal_True : sal_False; EditEngineItemPool* pThis = (EditEngineItemPool*)this; diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index bf5ba05357a9..a939241dbf6d 100644 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -46,7 +46,7 @@ class SvxTabStop; void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent = true, short nScriptType = 0 ); sal_uInt16 GetScriptItemId( sal_uInt16 nItemId, short nScriptType ); -sal_Bool IsScriptItemValid( sal_uInt16 nItemId, short nScriptType ); +bool IsScriptItemValid( sal_uInt16 nItemId, short nScriptType ); EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, sal_Int32 nS, sal_Int32 nE ); @@ -62,17 +62,17 @@ struct EPaM EPaM( sal_Int32 nP, sal_Int32 nI ) : nPara(nP), nIndex(nI) {} EPaM( const EPaM& r) : nPara(r.nPara), nIndex(r.nIndex) {} EPaM& operator = ( const EPaM& r ) { nPara = r.nPara; nIndex = r.nIndex; return *this; } - inline sal_Bool operator == ( const EPaM& r ) const; - inline sal_Bool operator < ( const EPaM& r ) const; + inline bool operator == ( const EPaM& r ) const; + inline bool operator < ( const EPaM& r ) const; }; -inline sal_Bool EPaM::operator < ( const EPaM& r ) const +inline bool EPaM::operator < ( const EPaM& r ) const { return ( ( nPara < r.nPara ) || ( ( nPara == r.nPara ) && nIndex < r.nIndex ) ) ? sal_True : sal_False; } -inline sal_Bool EPaM::operator == ( const EPaM& r ) const +inline bool EPaM::operator == ( const EPaM& r ) const { return ( ( nPara == r.nPara ) && ( nIndex == r.nIndex ) ) ? sal_True : sal_False; } @@ -274,9 +274,9 @@ public: void ExpandAttribs( sal_Int32 nIndex, sal_Int32 nNewChars, SfxItemPool& rItemPool ); void CollapsAttribs( sal_Int32 nIndex, sal_Int32 nDelChars, SfxItemPool& rItemPool ); void AppendAttribs( ContentNode* pNextNode ); - void CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, sal_Bool bKeepEndingAttribs ); + void CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, bool bKeepEndingAttribs ); - void SetStyleSheet( SfxStyleSheet* pS, sal_Bool bRecalcFont = sal_True ); + void SetStyleSheet( SfxStyleSheet* pS, bool bRecalcFont = true ); void SetStyleSheet( SfxStyleSheet* pS, const SvxFont& rFontFromStyle ); SfxStyleSheet* GetStyleSheet() { return aContentAttribs.GetStyleSheet(); } const SfxStyleSheet* GetStyleSheet() const { return aContentAttribs.GetStyleSheet(); } @@ -363,8 +363,8 @@ struct ExtraPortionInfo sal_uInt16 nMaxCompression100thPercent; sal_uInt8 nAsianCompressionTypes; - sal_Bool bFirstCharIsRightPunktuation; - sal_Bool bCompressed; + bool bFirstCharIsRightPunktuation; + bool bCompressed; sal_Int32* pOrgDXArray; ::std::vector< sal_Int32 > lineBreaksList; @@ -434,12 +434,12 @@ public: void SetRightToLeft( sal_uInt8 b ) { nRightToLeft = b; } sal_uInt8 GetRightToLeft() const { return nRightToLeft; } - sal_Bool IsRightToLeft() const { return (nRightToLeft&1); } + bool IsRightToLeft() const { return (nRightToLeft&1); } sal_Unicode GetExtraValue() const { return nExtraValue; } void SetExtraValue( sal_Unicode n ) { nExtraValue = n; } - sal_Bool HasValidSize() const { return aOutSz.Width() != (-1); } + bool HasValidSize() const { return aOutSz.Width() != (-1); } ExtraPortionInfo* GetExtraInfos() const { return pExtraInfos; } void SetExtraInfos( ExtraPortionInfo* p ) { delete pExtraInfos; pExtraInfos = p; } @@ -502,10 +502,10 @@ public: EditLine( const EditLine& ); ~EditLine(); - sal_Bool IsIn( sal_Int32 nIndex ) const + bool IsIn( sal_Int32 nIndex ) const { return ( (nIndex >= nStart ) && ( nIndex < nEnd ) ); } - sal_Bool IsIn( sal_Int32 nIndex, sal_Bool bInclEnd ) const + bool IsIn( sal_Int32 nIndex, bool bInclEnd ) const { return ( ( nIndex >= nStart ) && ( bInclEnd ? ( nIndex <= nEnd ) : ( nIndex < nEnd ) ) ); } void SetStart( sal_Int32 n ) { nStart = n; } @@ -549,7 +549,7 @@ public: void SetInvalid() { bInvalid = true; } void SetValid() { bInvalid = false; } - sal_Bool IsEmpty() const { return (nEnd > nStart) ? sal_False : sal_True; } + bool IsEmpty() const { return (nEnd > nStart) ? sal_False : sal_True; } CharPosArrayType& GetCharPosArray(); const CharPosArrayType& GetCharPosArray() const; @@ -557,8 +557,8 @@ public: EditLine* Clone() const; EditLine& operator = ( const EditLine& rLine ); - friend sal_Bool operator == ( const EditLine& r1, const EditLine& r2 ); - friend sal_Bool operator != ( const EditLine& r1, const EditLine& r2 ); + friend bool operator == ( const EditLine& r1, const EditLine& r2 ); + friend bool operator != ( const EditLine& r1, const EditLine& r2 ); }; @@ -605,10 +605,10 @@ private: sal_uInt16 nBulletX; sal_Int32 nInvalidDiff; - sal_Bool bInvalid : 1; - sal_Bool bSimple : 1; // only linear Tap - sal_Bool bVisible : 1; // Belongs to the node! - sal_Bool bForceRepaint : 1; + bool bInvalid : 1; + bool bSimple : 1; // only linear Tap + bool bVisible : 1; // Belongs to the node! + bool bForceRepaint : 1; ParaPortion( const ParaPortion& ); @@ -621,12 +621,12 @@ public: EditLineList& GetLines() { return aLineList; } const EditLineList& GetLines() const { return aLineList; } - sal_Bool IsInvalid() const { return bInvalid; } - sal_Bool IsSimpleInvalid() const { return bSimple; } - void SetValid() { bInvalid = sal_False; bSimple = sal_True;} + bool IsInvalid() const { return bInvalid; } + bool IsSimpleInvalid() const { return bSimple; } + void SetValid() { bInvalid = false; bSimple = true;} - sal_Bool MustRepaint() const { return bForceRepaint; } - void SetMustRepaint( sal_Bool bRP ) { bForceRepaint = bRP; } + bool MustRepaint() const { return bForceRepaint; } + void SetMustRepaint( bool bRP ) { bForceRepaint = bRP; } sal_uInt16 GetBulletX() const { return nBulletX; } void SetBulletX( sal_uInt16 n ) { nBulletX = n; } @@ -634,10 +634,10 @@ public: void MarkInvalid( sal_Int32 nStart, sal_Int32 nDiff); void MarkSelectionInvalid( sal_Int32 nStart, sal_Int32 nEnd ); - void SetVisible( sal_Bool bVisible ); + void SetVisible( bool bVisible ); bool IsVisible() const { return bVisible; } - sal_Bool IsEmpty() { return GetTextPortions().Count() == 1 && GetTextPortions()[0]->GetLen() == 0; } + bool IsEmpty() { return GetTextPortions().Count() == 1 && GetTextPortions()[0]->GetLen() == 0; } long GetHeight() const { return ( bVisible ? nHeight : 0 ); } sal_Int32 GetFirstLineOffset() const { return ( bVisible ? nFirstLineOffset : 0 ); } @@ -778,7 +778,7 @@ public: void SetModifyHdl( const Link& rLink ) { aModifyHdl = rLink; } Link GetModifyHdl() const { return aModifyHdl; } - void CreateDefFont( sal_Bool bUseStyles ); + void CreateDefFont( bool bUseStyles ); const SvxFont& GetDefFont() { return aDefFont; } void SetDefTab( sal_uInt16 nTab ) { nDefTab = nTab ? nTab : DEFTAB; } @@ -794,7 +794,7 @@ public: EditPaM RemoveText(); EditPaM RemoveChars( EditPaM aPaM, sal_Int32 nChars ); EditPaM InsertText( EditPaM aPaM, const OUString& rStr ); - EditPaM InsertParaBreak( EditPaM aPaM, sal_Bool bKeepEndingAttribs ); + EditPaM InsertParaBreak( EditPaM aPaM, bool bKeepEndingAttribs ); EditPaM InsertFeature( EditPaM aPaM, const SfxPoolItem& rItem ); EditPaM ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight ); @@ -815,8 +815,8 @@ public: void InsertAttrib( const SfxPoolItem& rItem, ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd ); void InsertAttrib( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, const SfxPoolItem& rPoolItem ); void InsertAttribInSelection( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, const SfxPoolItem& rPoolItem ); - sal_Bool RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt16 nWhich = 0 ); - sal_Bool RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, sal_uInt16 nWhich = 0 ); + bool RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt16 nWhich = 0 ); + bool RemoveAttribs( ContentNode* pNode, sal_Int32 nStart, sal_Int32 nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, sal_uInt16 nWhich = 0 ); void FindAttribs( ContentNode* pNode, sal_Int32 nStartPos, sal_Int32 nEndPos, SfxItemSet& rCurSet ); sal_Int32 GetPos(const ContentNode* pNode) const; @@ -847,7 +847,7 @@ bool CheckOrderedList(const CharAttribList::AttribsType& rAttribs, bool bStart); class EditEngineItemPool : public SfxItemPool { public: - EditEngineItemPool( sal_Bool bPersistenRefCounts ); + EditEngineItemPool( bool bPersistenRefCounts ); protected: virtual ~EditEngineItemPool(); public: diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index f1961ec908b5..901d77f9de14 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -225,7 +225,7 @@ void EditEngine::Draw( OutputDevice* pOutDev, const Point& rStartPos, short nOri aStartPos.X() += GetPaperSize().Width(); aStartPos = Rotate( aStartPos, nOrientation, rStartPos ); } - pImpEditEngine->Paint( pOutDev, aBigRect, aStartPos, sal_False, nOrientation ); + pImpEditEngine->Paint( pOutDev, aBigRect, aStartPos, false, nOrientation ); if( pOutDev->GetConnectMetaFile() ) pOutDev->Pop(); } @@ -240,7 +240,7 @@ void EditEngine::Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const P #if defined( DBG_UTIL ) || (OSL_DEBUG_LEVEL > 1) if ( bDebugPaint ) - EditDbg::ShowEditEngineData( this, sal_False ); + EditDbg::ShowEditEngineData( this, false ); #endif // Align to the pixel boundary, so that it becomes exactly the same @@ -1092,7 +1092,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, W if ( aCurSel.HasRange() ) { Reference<com::sun::star::datatransfer::clipboard::XClipboard> aSelection(pEditView->GetWindow()->GetPrimarySelection()); - pEditView->pImpEditView->CutCopy( aSelection, sal_False ); + pEditView->pImpEditView->CutCopy( aSelection, false ); } bMoved = true; @@ -1280,7 +1280,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, W } else { - aCurSel = pImpEditEngine->InsertText( (const EditSelection&)aCurSel, nCharCode, !pEditView->IsInsertMode(), sal_True ); + aCurSel = pImpEditEngine->InsertText( (const EditSelection&)aCurSel, nCharCode, !pEditView->IsInsertMode(), true ); } // AutoComplete ??? if ( pImpEditEngine->GetStatus().DoAutoComplete() && ( nCharCode != ' ' ) ) @@ -1392,7 +1392,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, W else if ( bMoved ) { bool bGotoCursor = pEditView->pImpEditView->DoAutoScroll(); - pEditView->pImpEditView->ShowCursor( bGotoCursor, sal_True ); + pEditView->pImpEditView->ShowCursor( bGotoCursor, true ); pImpEditEngine->CallStatusHdl(); } @@ -1414,7 +1414,7 @@ sal_uInt32 EditEngine::GetTextHeight() const if ( !pImpEditEngine->IsFormatted() ) pImpEditEngine->FormatDoc(); - sal_uInt32 nHeight = !IsVertical() ? pImpEditEngine->GetTextHeight() : pImpEditEngine->CalcTextWidth( sal_True ); + sal_uInt32 nHeight = !IsVertical() ? pImpEditEngine->GetTextHeight() : pImpEditEngine->CalcTextWidth( true ); return nHeight; } @@ -1425,7 +1425,7 @@ sal_uInt32 EditEngine::GetTextHeightNTP() const pImpEditEngine->FormatDoc(); if ( IsVertical() ) - return pImpEditEngine->CalcTextWidth( sal_True ); + return pImpEditEngine->CalcTextWidth( true ); return pImpEditEngine->GetTextHeightNTP(); } @@ -1436,7 +1436,7 @@ sal_uInt32 EditEngine::CalcTextWidth() if ( !pImpEditEngine->IsFormatted() ) pImpEditEngine->FormatDoc(); - sal_uInt32 nWidth = !IsVertical() ? pImpEditEngine->CalcTextWidth( sal_True ) : pImpEditEngine->GetTextHeight(); + sal_uInt32 nWidth = !IsVertical() ? pImpEditEngine->CalcTextWidth( true ) : pImpEditEngine->GetTextHeight(); return nWidth; } @@ -1627,12 +1627,12 @@ Link EditEngine::GetModifyHdl() const void EditEngine::ClearModifyFlag() { - pImpEditEngine->SetModifyFlag( sal_False ); + pImpEditEngine->SetModifyFlag( false ); } void EditEngine::SetModified() { - pImpEditEngine->SetModifyFlag( sal_True ); + pImpEditEngine->SetModifyFlag( true ); } bool EditEngine::IsModified() const @@ -1767,7 +1767,7 @@ void EditEngine::StripPortions() aBigRect.Right() = 0; aBigRect.Left() = -0x7FFFFFFF; } - pImpEditEngine->Paint( &aTmpDev, aBigRect, Point(), sal_True ); + pImpEditEngine->Paint( &aTmpDev, aBigRect, Point(), true ); } void EditEngine::GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) @@ -1966,7 +1966,7 @@ bool EditEngine::IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder ) if ( ( aDocPos.Y() > 0 ) && ( aDocPos.Y() < (long)pImpEditEngine->GetTextHeight() ) ) { - EditPaM aPaM = pImpEditEngine->GetPaM( aDocPos, sal_False ); + EditPaM aPaM = pImpEditEngine->GetPaM( aDocPos, false ); if ( aPaM.GetNode() ) { const ParaPortion* pParaPortion = pImpEditEngine->FindParaPortion( aPaM.GetNode() ); @@ -2038,7 +2038,7 @@ void EditEngine::QuickMarkToBeRepainted( sal_Int32 nPara ) { ParaPortion* pPortion = pImpEditEngine->GetParaPortions().SafeGetObject( nPara ); if ( pPortion ) - pPortion->SetMustRepaint( sal_True ); + pPortion->SetMustRepaint( true ); } void EditEngine::QuickInsertLineBreak( const ESelection& rSel ) @@ -2359,7 +2359,7 @@ EPosition EditEngine::FindDocPosition( const Point& rDocPos ) const { EPosition aPos; // From the point of the API, this is const.... - EditPaM aPaM = ((EditEngine*)this)->pImpEditEngine->GetPaM( rDocPos, sal_False ); + EditPaM aPaM = ((EditEngine*)this)->pImpEditEngine->GetPaM( rDocPos, false ); if ( aPaM.GetNode() ) { aPos.nPara = pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() ); diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 10c0004ce261..41fddb0b363f 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -1055,7 +1055,7 @@ bool EditTextObjectImpl::ChangeStyleSheets( const OUString& rOldName, SfxStyleFamily eOldFamily, const OUString& rNewName, SfxStyleFamily eNewFamily) { - sal_Bool bChanges = ImpChangeStyleSheets( rOldName, eOldFamily, rNewName, eNewFamily ); + bool bChanges = ImpChangeStyleSheets( rOldName, eOldFamily, rNewName, eNewFamily ); if ( bChanges ) ClearPortionInfo(); @@ -1094,7 +1094,7 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const sal_uInt16 nVer = 602; rOStream.WriteUInt16( nVer ); - rOStream.WriteUChar( static_cast<sal_Bool>(bOwnerOfPool) ); + rOStream.WriteUChar( bOwnerOfPool ); // First store the pool, later only the Surregate if ( bOwnerOfPool ) @@ -1237,10 +1237,10 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const rOStream.WriteUInt16( nUserType ); rOStream.WriteUInt32( nObjSettings ); - rOStream.WriteUChar( static_cast<sal_Bool>(bVertical) ); + rOStream.WriteUChar( bVertical ); rOStream.WriteUInt16( nScriptType ); - rOStream.WriteUChar( static_cast<sal_Bool>(bStoreUnicodeStrings) ); + rOStream.WriteUChar( bStoreUnicodeStrings ); if ( bStoreUnicodeStrings ) { for ( size_t nPara = 0; nPara < nParagraphs_Stream; nPara++ ) @@ -1266,9 +1266,9 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) // The text object was first created with the current setting of // pTextObjectPool. - sal_Bool bOwnerOfCurrent = bOwnerOfPool; - sal_Bool b; - rIStream.ReadUChar( b ); + bool bOwnerOfCurrent = bOwnerOfPool; + bool b; + rIStream.ReadCharAsBool( b ); bOwnerOfPool = b; if ( bOwnerOfCurrent && !bOwnerOfPool ) @@ -1361,7 +1361,7 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) // But check for paragraph and character symbol attribs here, // FinishLoad will not be called in OpenOffice Calc, no StyleSheets... - sal_Bool bSymbolPara = false; + bool bSymbolPara = false; if ( pC->GetParaAttribs().GetItemState( EE_CHAR_FONTINFO ) == SFX_ITEM_ON ) { const SvxFontItem& rFontItem = (const SvxFontItem&)pC->GetParaAttribs().Get( EE_CHAR_FONTINFO ); @@ -1473,8 +1473,8 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) if ( nVersion >= 601 ) { - sal_Bool bTmp; - rIStream.ReadUChar( bTmp ); + bool bTmp; + rIStream.ReadCharAsBool( bTmp ); bVertical = bTmp; } @@ -1482,8 +1482,8 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream ) { rIStream.ReadUInt16( nScriptType ); - sal_Bool bUnicodeStrings; - rIStream.ReadUChar( bUnicodeStrings ); + bool bUnicodeStrings; + rIStream.ReadCharAsBool( bUnicodeStrings ); if ( bUnicodeStrings ) { for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) diff --git a/editeng/source/editeng/editstt2.hxx b/editeng/source/editeng/editstt2.hxx index 234ebee30fd5..2d8be5857ec4 100644 --- a/editeng/source/editeng/editstt2.hxx +++ b/editeng/source/editeng/editstt2.hxx @@ -41,80 +41,80 @@ public: { nStatusBits &= ~nBits; } - sal_Bool UseCharAttribs() const + bool UseCharAttribs() const { return ( ( nControlBits & EE_CNTRL_USECHARATTRIBS ) != 0 ); } - sal_Bool NotifyCursorMovements() const + bool NotifyCursorMovements() const { return ( ( nControlBits & EE_CNTRL_CRSRLEFTPARA ) != 0 ); } - sal_Bool UseIdleFormatter() const + bool UseIdleFormatter() const { return ( ( nControlBits & EE_CNTRL_DOIDLEFORMAT) != 0 ); } - sal_Bool AllowPasteSpecial() const + bool AllowPasteSpecial() const { return ( ( nControlBits & EE_CNTRL_PASTESPECIAL ) != 0 ); } - sal_Bool DoAutoIndenting() const + bool DoAutoIndenting() const { return ( ( nControlBits & EE_CNTRL_AUTOINDENTING ) != 0 ); } - sal_Bool DoUndoAttribs() const + bool DoUndoAttribs() const { return ( ( nControlBits & EE_CNTRL_UNDOATTRIBS ) != 0 ); } - sal_Bool OneCharPerLine() const + bool OneCharPerLine() const { return ( ( nControlBits & EE_CNTRL_ONECHARPERLINE ) != 0 ); } - sal_Bool IsOutliner() const + bool IsOutliner() const { return ( ( nControlBits & EE_CNTRL_OUTLINER ) != 0 ); } - sal_Bool IsOutliner2() const + bool IsOutliner2() const { return ( ( nControlBits & EE_CNTRL_OUTLINER2 ) != 0 ); } - sal_Bool IsAnyOutliner() const + bool IsAnyOutliner() const { return IsOutliner() || IsOutliner2(); } - sal_Bool DoNotUseColors() const + bool DoNotUseColors() const { return ( ( nControlBits & EE_CNTRL_NOCOLORS ) != 0 ); } - sal_Bool AllowBigObjects() const + bool AllowBigObjects() const { return ( ( nControlBits & EE_CNTRL_ALLOWBIGOBJS ) != 0 ); } - sal_Bool DoOnlineSpelling() const + bool DoOnlineSpelling() const { return ( ( nControlBits & EE_CNTRL_ONLINESPELLING ) != 0 ); } - sal_Bool DoStretch() const + bool DoStretch() const { return ( ( nControlBits & EE_CNTRL_STRETCHING ) != 0 ); } - sal_Bool AutoPageSize() const + bool AutoPageSize() const { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZE ) != 0 ); } - sal_Bool AutoPageWidth() const + bool AutoPageWidth() const { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZEX ) != 0 ); } - sal_Bool AutoPageHeight() const + bool AutoPageHeight() const { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZEY ) != 0 ); } - sal_Bool MarkFields() const + bool MarkFields() const { return ( ( nControlBits & EE_CNTRL_MARKFIELDS ) != 0 ); } - sal_Bool DoRestoreFont() const + bool DoRestoreFont() const { return ( ( nControlBits & EE_CNTRL_RESTOREFONT ) != 0 ); } - sal_Bool DoImportRTFStyleSheets() const + bool DoImportRTFStyleSheets() const { return ( ( nControlBits & EE_CNTRL_RTFSTYLESHEETS ) != 0 ); } - sal_Bool DoAutoCorrect() const + bool DoAutoCorrect() const { return ( ( nControlBits & EE_CNTRL_AUTOCORRECT ) != 0 ); } - sal_Bool DoAutoComplete() const + bool DoAutoComplete() const { return ( ( nControlBits & EE_CNTRL_AUTOCOMPLETE ) != 0 ); } - sal_Bool DoTabIndenting() const + bool DoTabIndenting() const { return ( ( nControlBits & EE_CNTRL_TABINDENTING ) != 0 ); } - sal_Bool DoFormat100() const + bool DoFormat100() const { return ( ( nControlBits & EE_CNTRL_FORMAT100 ) != 0 ); } - sal_Bool ULSpaceSummation() const + bool ULSpaceSummation() const { return ( ( nControlBits & EE_CNTRL_ULSPACESUMMATION ) != 0 ); } - sal_Bool ULSpaceFirstParagraph() const + bool ULSpaceFirstParagraph() const { return ( ( nControlBits & EE_CNTRL_ULSPACEFIRSTPARA ) != 0 ); } }; diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index 853fd13550e6..14fb303fcdc9 100644 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -241,7 +241,7 @@ void EditUndoConnectParas::Undo() // For SplitContent ParagraphInserted can not be called yet because the // Outliner relies on the attributes to initialize the depth - sal_Bool bCall = GetEditEngine()->IsCallParaInsertedOrDeleted(); + bool bCall = GetEditEngine()->IsCallParaInsertedOrDeleted(); GetEditEngine()->SetCallParaInsertedOrDeleted(false); EditPaM aPaM = GetEditEngine()->SplitContent(nNode, nSepPos); @@ -495,8 +495,8 @@ EditUndoSetAttribs::EditUndoSetAttribs(EditEngine* pEE, const ESelection& rESel, // When EditUndoSetAttribs actually is a RemoveAttribs this could be // /recognize by the empty itemset, but then it would have to be caught in // its own place, which possible a setAttribs does with an empty itemset. - bSetIsRemove = sal_False; - bRemoveParaAttribs = sal_False; + bSetIsRemove = false; + bRemoveParaAttribs = false; nRemoveWhich = 0; nSpecial = 0; } diff --git a/editeng/source/editeng/editundo.hxx b/editeng/source/editeng/editundo.hxx index c15d8c9491ee..a31261a38ee8 100644 --- a/editeng/source/editeng/editundo.hxx +++ b/editeng/source/editeng/editundo.hxx @@ -221,8 +221,8 @@ private: InfoArrayType aPrevAttribs; sal_uInt8 nSpecial; - sal_Bool bSetIsRemove; - sal_Bool bRemoveParaAttribs; + bool bSetIsRemove; + bool bRemoveParaAttribs; sal_uInt16 nRemoveWhich; void ImpSetSelection( EditView* pView ); @@ -235,8 +235,8 @@ public: SfxItemSet& GetNewAttribs() { return aNewAttribs; } void SetSpecial( sal_uInt8 n ) { nSpecial = n; } - void SetRemoveAttribs( sal_Bool b ) { bSetIsRemove = b; } - void SetRemoveParaAttribs( sal_Bool b ) { bRemoveParaAttribs = b; } + void SetRemoveAttribs( bool b ) { bSetIsRemove = b; } + void SetRemoveParaAttribs( bool b ) { bRemoveParaAttribs = b; } void SetRemoveWhich( sal_uInt16 n ) { nRemoveWhich = n; } virtual void Undo() SAL_OVERRIDE; diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 48984473a1bc..9a4cd2c80dcd 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -309,7 +309,7 @@ void EditView::SetOutputArea( const Rectangle& rRect ) pImpEditView->CalcAnchorPoint(); if ( PIMPEE->GetStatus().AutoPageSize() ) pImpEditView->RecalcOutputArea(); - pImpEditView->ShowCursor( sal_False, sal_False ); + pImpEditView->ShowCursor( false, false ); } const Rectangle& EditView::GetOutputArea() const @@ -495,7 +495,7 @@ sal_uInt32 EditView::Read( SvStream& rInput, const OUString& rBaseURL, EETextFor void EditView::Cut() { Reference<com::sun::star::datatransfer::clipboard::XClipboard> aClipBoard(GetWindow()->GetClipboard()); - pImpEditView->CutCopy( aClipBoard, sal_True ); + pImpEditView->CutCopy( aClipBoard, true ); } ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > EditView::GetTransferable() @@ -508,19 +508,19 @@ void EditView::Cut() void EditView::Copy() { Reference<com::sun::star::datatransfer::clipboard::XClipboard> aClipBoard(GetWindow()->GetClipboard()); - pImpEditView->CutCopy( aClipBoard, sal_False ); + pImpEditView->CutCopy( aClipBoard, false ); } void EditView::Paste() { Reference<com::sun::star::datatransfer::clipboard::XClipboard> aClipBoard(GetWindow()->GetClipboard()); - pImpEditView->Paste( aClipBoard, sal_False ); + pImpEditView->Paste( aClipBoard, false ); } void EditView::PasteSpecial() { Reference<com::sun::star::datatransfer::clipboard::XClipboard> aClipBoard(GetWindow()->GetClipboard()); - pImpEditView->Paste(aClipBoard, sal_True ); + pImpEditView->Paste(aClipBoard, true ); } Point EditView::GetWindowPosTopLeft( sal_Int32 nParagraph ) @@ -616,7 +616,7 @@ void EditView::SetEditEngineUpdateMode( bool bUpdate ) void EditView::ForceUpdate() { - PIMPEE->SetUpdateMode( true, this, sal_True ); + PIMPEE->SetUpdateMode( true, this, true ); } SfxStyleSheet* EditView::GetStyleSheet() @@ -744,7 +744,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) EditPaM aPaM = pImpEditView->pEditEngine->GetPaM(aPos, false); Reference< linguistic2::XSpellChecker1 > xSpeller( PIMPEE->GetSpeller() ); ESelection aOldSel = GetSelection(); - if ( xSpeller.is() && pImpEditView->IsWrongSpelledWord( aPaM, sal_True ) ) + if ( xSpeller.is() && pImpEditView->IsWrongSpelledWord( aPaM, true ) ) { PopupMenu aPopupMenu( EditResId( RID_MENU_SPELL ) ); PopupMenu *pAutoMenu = aPopupMenu.GetPopupMenu( MN_AUTOCORR ); @@ -910,7 +910,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) sal_uInt16 nId = aPopupMenu.Execute( pImpEditView->GetWindow(), aTempRect, POPUPMENU_NOMOUSEUPCLOSE ); if ( nId == MN_IGNORE ) { - OUString aWord = pImpEditView->SpellIgnoreOrAddWord( sal_False ); + OUString aWord = pImpEditView->SpellIgnoreOrAddWord( false ); if ( pCallBack ) { SpellCallbackInfo aInf( SPELLCMD_IGNOREWORD, aWord ); @@ -957,7 +957,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) pImpEditView->SetEditSelection( EditSelection( aCursor, aCursor ) ); pImpEditView->DrawSelection(); // Crashes when no SfxApp - PIMPEE->Spell( this, sal_False ); + PIMPEE->Spell( this, false ); } else { diff --git a/editeng/source/editeng/eeobj.cxx b/editeng/source/editeng/eeobj.cxx index 3699cbb00ef7..e56eb1c5ac8d 100644 --- a/editeng/source/editeng/eeobj.cxx +++ b/editeng/source/editeng/eeobj.cxx @@ -92,11 +92,11 @@ uno::Sequence< datatransfer::DataFlavor > EditDataObject::getTransferDataFlavors sal_Bool EditDataObject::isDataFlavorSupported( const datatransfer::DataFlavor& rFlavor ) throw(uno::RuntimeException, std::exception) { - sal_Bool bSupported = sal_False; + bool bSupported = false; sal_uLong nT = SotExchange::GetFormat( rFlavor ); if ( ( nT == SOT_FORMAT_STRING ) || ( nT == SOT_FORMAT_RTF ) || ( nT == SOT_FORMATSTR_ID_EDITENGINE ) ) - bSupported = sal_True; + bSupported = true; return bSupported; } diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index 80ed9b0f1117..611295a6d5f1 100644 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -122,12 +122,12 @@ SvParserState EditRTFParser::CallParser() } EditPaM aEnd2PaM( aCurSel.Max() ); //AddRTFDefaultValues( aStart2PaM, aEnd2PaM ); - sal_Bool bOnlyOnePara = ( aEnd2PaM.GetNode() == aStart2PaM.GetNode() ); + bool bOnlyOnePara = ( aEnd2PaM.GetNode() == aStart2PaM.GetNode() ); // Paste the chunk again ... // Problem: Paragraph attributes may not possibly be taken over // => Do Character attributes. - sal_Bool bSpecialBackward = aStart1PaM.GetNode()->Len() ? sal_False : sal_True; + bool bSpecialBackward = aStart1PaM.GetNode()->Len() ? sal_False : sal_True; if ( bOnlyOnePara || aStart1PaM.GetNode()->Len() ) mpEditEngine->ParaAttribsToCharAttribs( aStart2PaM.GetNode() ); aCurSel.Min() = mpEditEngine->ConnectParagraphs( @@ -500,8 +500,8 @@ void EditRTFParser::ReadField() { // From SwRTFParser::ReadField() int _nOpenBrakets = 1; // the first was already detected earlier - sal_Bool bFldInst = sal_False; - sal_Bool bFldRslt = sal_False; + bool bFldInst = false; + bool bFldRslt = false; OUString aFldInst; OUString aFldRslt; @@ -514,8 +514,8 @@ void EditRTFParser::ReadField() _nOpenBrakets--; if ( _nOpenBrakets == 1 ) { - bFldInst = sal_False; - bFldRslt = sal_False; + bFldInst = false; + bFldRslt = false; } } break; @@ -526,10 +526,10 @@ void EditRTFParser::ReadField() case RTF_FIELD: SkipGroup(); break; - case RTF_FLDINST: bFldInst = sal_True; + case RTF_FLDINST: bFldInst = true; break; - case RTF_FLDRSLT: bFldRslt = sal_True; + case RTF_FLDRSLT: bFldRslt = true; break; case RTF_TEXTTOKEN: diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index b616404fb0dd..8a484fe06244 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -80,14 +80,14 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, Window* pWindow ) : nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW; pCursor = NULL; pDragAndDropInfo = NULL; - bReadOnly = sal_False; - bClickedInSelection = sal_False; + bReadOnly = false; + bClickedInSelection = false; eSelectionMode = EE_SELMODE_TXTONLY; eAnchorMode = ANCHOR_TOP_LEFT; nInvMore = 1; nTravelXPos = TRAVEL_X_DONTKNOW; nControl = EV_CNTRL_AUTOSCROLL | EV_CNTRL_ENABLEPASTE; - bActiveDragAndDropListener = sal_False; + bActiveDragAndDropListener = false; aEditSelection.Min() = pEng->GetEditDoc().GetStartPaM(); aEditSelection.Max() = pEng->GetEditDoc().GetEndPaM(); @@ -158,7 +158,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion, OutputD pPolyPoly = new PolyPolygon; OutputDevice* pTarget = pTargetDevice ? pTargetDevice : pOutWin; - sal_Bool bClipRegion = pTarget->IsClipRegion(); + bool bClipRegion = pTarget->IsClipRegion(); Region aOldRegion = pTarget->GetClipRegion(); if ( !pRegion ) @@ -216,18 +216,18 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion, OutputD const EditLine* pLine = pTmpPortion->GetLines()[nLine]; DBG_ASSERT( pLine, "Line not found: DrawSelection()" ); - sal_Bool bPartOfLine = sal_False; + bool bPartOfLine = false; sal_Int32 nStartIndex = pLine->GetStart(); sal_Int32 nEndIndex = pLine->GetEnd(); if ( ( nPara == nStartPara ) && ( nLine == nStartLine ) && ( nStartIndex != aTmpSel.Min().GetIndex() ) ) { nStartIndex = aTmpSel.Min().GetIndex(); - bPartOfLine = sal_True; + bPartOfLine = true; } if ( ( nPara == nEndPara ) && ( nLine == nEndLine ) && ( nEndIndex != aTmpSel.Max().GetIndex() ) ) { nEndIndex = aTmpSel.Max().GetIndex(); - bPartOfLine = sal_True; + bPartOfLine = true; } // Can happen if at the beginning of a wrapped line. @@ -305,7 +305,7 @@ void ImpEditView::ImplDrawHighlightRect( OutputDevice* _pTarget, const Point& rD { if ( rDocPosTopLeft.X() != rDocPosBottomRight.X() ) { - sal_Bool bPixelMode = _pTarget->GetMapMode() == MAP_PIXEL; + bool bPixelMode = _pTarget->GetMapMode() == MAP_PIXEL; Point aPnt1( GetWindowPos( rDocPosTopLeft ) ); Point aPnt2( GetWindowPos( rDocPosBottomRight ) ); @@ -353,7 +353,7 @@ void ImpEditView::ImplDrawHighlightRect( OutputDevice* _pTarget, const Point& rD } -sal_Bool ImpEditView::IsVertical() const +bool ImpEditView::IsVertical() const { return pEditEngine->pImpEditEngine->IsVertical(); } @@ -630,7 +630,7 @@ void ImpEditView::CalcAnchorPoint() } } -void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_uInt16 nShowCursorFlags ) +void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor, sal_uInt16 nShowCursorFlags ) { // No ShowCursor in an empty View ... if ( ( aOutArea.Left() >= aOutArea.Right() ) && ( aOutArea.Top() >= aOutArea.Bottom() ) ) @@ -926,9 +926,9 @@ Pair ImpEditView::Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck ) aNewVisArea.Left() -= ndY; aNewVisArea.Right() -= ndY; } - if ( ( nRangeCheck == RGCHK_PAPERSZ1 ) && ( aNewVisArea.Right() > (long)pEditEngine->pImpEditEngine->CalcTextWidth( sal_False ) ) ) + if ( ( nRangeCheck == RGCHK_PAPERSZ1 ) && ( aNewVisArea.Right() > (long)pEditEngine->pImpEditEngine->CalcTextWidth( false ) ) ) { - long nDiff = pEditEngine->pImpEditEngine->CalcTextWidth( sal_False ) - aNewVisArea.Right(); // negative + long nDiff = pEditEngine->pImpEditEngine->CalcTextWidth( false ) - aNewVisArea.Right(); // negative aNewVisArea.Move( nDiff, 0 ); // could end up in the negative area... } if ( ( aNewVisArea.Left() < 0 ) && ( nRangeCheck != RGCHK_NONE ) ) @@ -949,7 +949,7 @@ Pair ImpEditView::Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck ) if ( nRealDiffX || nRealDiffY ) { Cursor* pCrsr = GetCursor(); - sal_Bool bVisCursor = pCrsr->IsVisible(); + bool bVisCursor = pCrsr->IsVisible(); pCrsr->Hide(); pOutWin->Update(); if ( !IsVertical() ) @@ -985,9 +985,9 @@ Pair ImpEditView::Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck ) return Pair( nRealDiffX, nRealDiffY ); } -sal_Bool ImpEditView::PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin ) +bool ImpEditView::PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin ) { - sal_Bool bDone = sal_False; + bool bDone = false; KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction(); if ( eFunc != KEYFUNC_DONTKNOW ) @@ -999,16 +999,16 @@ sal_Bool ImpEditView::PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin if ( !bReadOnly ) { Reference<com::sun::star::datatransfer::clipboard::XClipboard> aClipBoard(GetWindow()->GetClipboard()); - CutCopy( aClipBoard, sal_True ); - bDone = sal_True; + CutCopy( aClipBoard, true ); + bDone = true; } } break; case KEYFUNC_COPY: { Reference<com::sun::star::datatransfer::clipboard::XClipboard> aClipBoard(GetWindow()->GetClipboard()); - CutCopy( aClipBoard, sal_False ); - bDone = sal_True; + CutCopy( aClipBoard, false ); + bDone = true; } break; case KEYFUNC_PASTE: @@ -1019,7 +1019,7 @@ sal_Bool ImpEditView::PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin Reference<com::sun::star::datatransfer::clipboard::XClipboard> aClipBoard(GetWindow()->GetClipboard()); Paste( aClipBoard, pEditEngine->pImpEditEngine->GetStatus().AllowPasteSpecial() ); pEditEngine->pImpEditEngine->UndoActionEnd( EDITUNDO_PASTE ); - bDone = sal_True; + bDone = true; } } break; @@ -1034,7 +1034,7 @@ sal_Bool ImpEditView::PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin return bDone; } -sal_Bool ImpEditView::MouseButtonUp( const MouseEvent& rMouseEvent ) +bool ImpEditView::MouseButtonUp( const MouseEvent& rMouseEvent ) { if ( pEditEngine->GetInternalEditStatus().NotifyCursorMovements() ) { @@ -1047,7 +1047,7 @@ sal_Bool ImpEditView::MouseButtonUp( const MouseEvent& rMouseEvent ) nTravelXPos = TRAVEL_X_DONTKNOW; nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW; nExtraCursorFlags = 0; - bClickedInSelection = sal_False; + bClickedInSelection = false; if ( rMouseEvent.IsMiddle() && !bReadOnly && ( GetWindow()->GetSettings().GetMouseSettings().GetMiddleButtonAction() == MOUSE_MIDDLE_PASTESELECTION ) ) @@ -1058,13 +1058,13 @@ sal_Bool ImpEditView::MouseButtonUp( const MouseEvent& rMouseEvent ) else if ( rMouseEvent.IsLeft() && GetEditSelection().HasRange() ) { Reference<com::sun::star::datatransfer::clipboard::XClipboard> aClipBoard(GetWindow()->GetPrimarySelection()); - CutCopy( aClipBoard, sal_False ); + CutCopy( aClipBoard, false ); } return pEditEngine->pImpEditEngine->MouseButtonUp( rMouseEvent, GetEditViewPtr() ); } -sal_Bool ImpEditView::MouseButtonDown( const MouseEvent& rMouseEvent ) +bool ImpEditView::MouseButtonDown( const MouseEvent& rMouseEvent ) { pEditEngine->CheckIdleFormatter(); // If fast typing and mouse button downs if ( pEditEngine->GetInternalEditStatus().NotifyCursorMovements() ) @@ -1076,7 +1076,7 @@ sal_Bool ImpEditView::MouseButtonDown( const MouseEvent& rMouseEvent ) return pEditEngine->pImpEditEngine->MouseButtonDown( rMouseEvent, GetEditViewPtr() ); } -sal_Bool ImpEditView::MouseMove( const MouseEvent& rMouseEvent ) +bool ImpEditView::MouseMove( const MouseEvent& rMouseEvent ) { return pEditEngine->pImpEditEngine->MouseMove( rMouseEvent, GetEditViewPtr() ); } @@ -1088,16 +1088,16 @@ void ImpEditView::Command( const CommandEvent& rCEvt ) } -void ImpEditView::SetInsertMode( sal_Bool bInsert ) +void ImpEditView::SetInsertMode( bool bInsert ) { if ( bInsert != IsInsertMode() ) { SetFlags( nControl, EV_CNTRL_OVERWRITE, !bInsert ); - ShowCursor( DoAutoScroll(), sal_False ); + ShowCursor( DoAutoScroll(), false ); } } -sal_Bool ImpEditView::IsWrongSpelledWord( const EditPaM& rPaM, sal_Bool bMarkIfWrong ) +bool ImpEditView::IsWrongSpelledWord( const EditPaM& rPaM, bool bMarkIfWrong ) { bool bIsWrong = false; if ( rPaM.GetNode()->GetWrongList() ) @@ -1114,7 +1114,7 @@ sal_Bool ImpEditView::IsWrongSpelledWord( const EditPaM& rPaM, sal_Bool bMarkIfW return bIsWrong; } -OUString ImpEditView::SpellIgnoreOrAddWord( sal_Bool bAdd ) +OUString ImpEditView::SpellIgnoreOrAddWord( bool bAdd ) { OUString aWord; if ( pEditEngine->pImpEditEngine->GetSpeller().is() ) @@ -1172,7 +1172,7 @@ void ImpEditView::DeleteSelected() SetEditSelection( EditSelection( aPaM, aPaM ) ); pEditEngine->pImpEditEngine->FormatAndUpdate( GetEditViewPtr() ); - ShowCursor( DoAutoScroll(), sal_True ); + ShowCursor( DoAutoScroll(), true ); } const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_Int32* pPara, sal_Int32* pPos ) const @@ -1210,13 +1210,13 @@ const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_Int32* pPara, return NULL; } -sal_Bool ImpEditView::IsBulletArea( const Point& rPos, sal_Int32* pPara ) +bool ImpEditView::IsBulletArea( const Point& rPos, sal_Int32* pPara ) { if ( pPara ) *pPara = EE_PARA_NOT_FOUND; if( !GetOutputArea().IsInside( rPos ) ) - return sal_False; + return false; Point aDocPos( GetDocPos( rPos ) ); EditPaM aPaM = pEditEngine->GetPaM(aDocPos, false); @@ -1235,14 +1235,14 @@ sal_Bool ImpEditView::IsBulletArea( const Point& rPos, sal_Int32* pPara ) { if ( pPara ) *pPara = nPara; - return sal_True; + return true; } } - return sal_False; + return false; } -void ImpEditView::CutCopy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, sal_Bool bCut ) +void ImpEditView::CutCopy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, bool bCut ) { if ( rxClipboard.is() && GetEditSelection().HasRange() ) { @@ -1275,7 +1275,7 @@ void ImpEditView::CutCopy( ::com::sun::star::uno::Reference< ::com::sun::star::d } } -void ImpEditView::Paste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, sal_Bool bUseSpecial ) +void ImpEditView::Paste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, bool bUseSpecial ) { if ( rxClipboard.is() ) { @@ -1344,17 +1344,17 @@ void ImpEditView::Paste( ::com::sun::star::uno::Reference< ::com::sun::star::dat SetEditSelection( aSel ); pEditEngine->pImpEditEngine->UpdateSelections(); pEditEngine->pImpEditEngine->FormatAndUpdate( GetEditViewPtr() ); - ShowCursor( DoAutoScroll(), sal_True ); + ShowCursor( DoAutoScroll(), true ); } } } -sal_Bool ImpEditView::IsInSelection( const EditPaM& rPaM ) +bool ImpEditView::IsInSelection( const EditPaM& rPaM ) { EditSelection aSel = GetEditSelection(); if ( !aSel.HasRange() ) - return sal_False; + return false; aSel.Adjust( pEditEngine->GetEditDoc() ); @@ -1363,20 +1363,20 @@ sal_Bool ImpEditView::IsInSelection( const EditPaM& rPaM ) sal_Int32 nCurNode = pEditEngine->GetEditDoc().GetPos( rPaM.GetNode() ); if ( ( nCurNode > nStartNode ) && ( nCurNode < nEndNode ) ) - return sal_True; + return true; if ( nStartNode == nEndNode ) { if ( nCurNode == nStartNode ) if ( ( rPaM.GetIndex() >= aSel.Min().GetIndex() ) && ( rPaM.GetIndex() < aSel.Max().GetIndex() ) ) - return sal_True; + return true; } else if ( ( nCurNode == nStartNode ) && ( rPaM.GetIndex() >= aSel.Min().GetIndex() ) ) - return sal_True; + return true; else if ( ( nCurNode == nEndNode ) && ( rPaM.GetIndex() < aSel.Max().GetIndex() ) ) - return sal_True; + return true; - return sal_False; + return false; } void ImpEditView::CreateAnchor() @@ -1392,10 +1392,10 @@ void ImpEditView::DeselectAll() GetEditSelection().Min() = GetEditSelection().Max(); } -sal_Bool ImpEditView::IsSelectionAtPoint( const Point& rPosPixel ) +bool ImpEditView::IsSelectionAtPoint( const Point& rPosPixel ) { if ( pDragAndDropInfo && pDragAndDropInfo->pField ) - return sal_True; + return true; Point aMousePos( rPosPixel ); @@ -1404,7 +1404,7 @@ sal_Bool ImpEditView::IsSelectionAtPoint( const Point& rPosPixel ) if ( ( !GetOutputArea().IsInside( aMousePos ) ) && !pEditEngine->pImpEditEngine->IsInSelectionMode() ) { - return sal_False; + return false; } Point aDocPos( GetDocPos( aMousePos ) ); @@ -1412,7 +1412,7 @@ sal_Bool ImpEditView::IsSelectionAtPoint( const Point& rPosPixel ) return IsInSelection( aPaM ); } -sal_Bool ImpEditView::SetCursorAtPoint( const Point& rPointPixel ) +bool ImpEditView::SetCursorAtPoint( const Point& rPointPixel ) { pEditEngine->CheckIdleFormatter(); @@ -1423,7 +1423,7 @@ sal_Bool ImpEditView::SetCursorAtPoint( const Point& rPointPixel ) if ( ( !GetOutputArea().IsInside( aMousePos ) ) && !pEditEngine->pImpEditEngine->IsInSelectionMode() ) { - return sal_False; + return false; } Point aDocPos( GetDocPos( aMousePos ) ); @@ -1432,7 +1432,7 @@ sal_Bool ImpEditView::SetCursorAtPoint( const Point& rPointPixel ) // then again with the PaM for the Rect, even though the line is already // known .... This must not be, though! EditPaM aPaM = pEditEngine->GetPaM(aDocPos); - sal_Bool bGotoCursor = DoAutoScroll(); + bool bGotoCursor = DoAutoScroll(); // aTmpNewSel: Diff between old and new, not the new selection EditSelection aTmpNewSel( GetEditSelection().Max(), aPaM ); @@ -1459,9 +1459,9 @@ sal_Bool ImpEditView::SetCursorAtPoint( const Point& rPointPixel ) SetEditSelection( aNewEditSelection ); } - sal_Bool bForceCursor = ( pDragAndDropInfo ? sal_False : sal_True ) && !pEditEngine->pImpEditEngine->IsInSelectionMode(); + bool bForceCursor = ( pDragAndDropInfo ? sal_False : sal_True ) && !pEditEngine->pImpEditEngine->IsInSelectionMode(); ShowCursor( bGotoCursor, bForceCursor ); - return sal_True; + return true; } @@ -1471,7 +1471,7 @@ void ImpEditView::HideDDCursor() { GetWindow()->DrawOutDev( pDragAndDropInfo->aCurSavedCursor.TopLeft(), pDragAndDropInfo->aCurSavedCursor.GetSize(), Point(0,0), pDragAndDropInfo->aCurSavedCursor.GetSize(),*pDragAndDropInfo->pBackground ); - pDragAndDropInfo->bVisCursor = sal_False; + pDragAndDropInfo->bVisCursor = false; } } @@ -1507,7 +1507,7 @@ void ImpEditView::ShowDDCursor( const Rectangle& rRect ) Size aCurSzPx( pDragAndDropInfo->pBackground->GetOutputSizePixel() ); if ( ( aCurSzPx.Width() < aNewSzPx.Width() ) ||( aCurSzPx.Height() < aNewSzPx.Height() ) ) { - sal_Bool bDone = pDragAndDropInfo->pBackground->SetOutputSizePixel( aNewSzPx ); + bool bDone = pDragAndDropInfo->pBackground->SetOutputSizePixel( aNewSzPx ); DBG_ASSERT( bDone, "Virtual Device broken?" ); } #endif @@ -1521,7 +1521,7 @@ void ImpEditView::ShowDDCursor( const Rectangle& rRect ) // Draw Cursor... GetWindow()->DrawRect( rRect ); - pDragAndDropInfo->bVisCursor = sal_True; + pDragAndDropInfo->bVisCursor = true; pDragAndDropInfo->aCurCursor = rRect; GetWindow()->SetFillColor( aOldFillColor ); @@ -1562,13 +1562,13 @@ void ImpEditView::dragGestureRecognized(const ::com::sun::star::datatransfer::dn aCopySel = EditSelection( EditPaM( pNode, nPos ), EditPaM( pNode, nPos+1 ) ); GetEditSelection() = aCopySel; DrawSelection(); - sal_Bool bGotoCursor = DoAutoScroll(); - ShowCursor( bGotoCursor, /*bForceCursor=*/sal_False ); + bool bGotoCursor = DoAutoScroll(); + ShowCursor( bGotoCursor, /*bForceCursor=*/false ); } else if ( IsBulletArea( aMousePos, &nPara ) ) { pDragAndDropInfo = new DragAndDropInfo(); - pDragAndDropInfo->bOutlinerMode = sal_True; + pDragAndDropInfo->bOutlinerMode = true; EditPaM aStartPaM( pEditEngine->GetEditDoc().GetObject( nPara ), 0 ); EditPaM aEndPaM( aStartPaM ); const SfxInt16Item& rLevel = (const SfxInt16Item&) pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL ); @@ -1592,7 +1592,7 @@ void ImpEditView::dragGestureRecognized(const ::com::sun::star::datatransfer::dn if ( pDragAndDropInfo ) { - pDragAndDropInfo->bStarterOfDD = sal_True; + pDragAndDropInfo->bStarterOfDD = true; // Sensitive area to be scrolled. Size aSz( 5, 0 ); @@ -1632,7 +1632,7 @@ void ImpEditView::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSo ESelection aToBeDelSel = pDragAndDropInfo->aBeginDragSel; ESelection aNewSel( pDragAndDropInfo->aDropSel.nEndPara, pDragAndDropInfo->aDropSel.nEndPos, pDragAndDropInfo->aDropSel.nEndPara, pDragAndDropInfo->aDropSel.nEndPos ); - sal_Bool bBeforeSelection = aDropPos.IsLess( pDragAndDropInfo->aBeginDragSel ); + bool bBeforeSelection = aDropPos.IsLess( pDragAndDropInfo->aBeginDragSel ); sal_Int32 nParaDiff = pDragAndDropInfo->aBeginDragSel.nEndPara - pDragAndDropInfo->aBeginDragSel.nStartPara; if ( bBeforeSelection ) { @@ -1700,7 +1700,7 @@ void ImpEditView::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSo pEditEngine->pImpEditEngine->UndoActionEnd( EDITUNDO_DRAGANDDROP ); HideDDCursor(); - ShowCursor( DoAutoScroll(), sal_True ); + ShowCursor( DoAutoScroll(), true ); delete pDragAndDropInfo; pDragAndDropInfo = NULL; pEditEngine->GetEndDropHdl().Call(GetEditViewPtr()); @@ -1718,19 +1718,19 @@ void ImpEditView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDro if ( pDragAndDropInfo && pDragAndDropInfo->bDragAccepted ) { pEditEngine->GetBeginDropHdl().Call(GetEditViewPtr()); - sal_Bool bChanges = sal_False; + bool bChanges = false; HideDDCursor(); if ( pDragAndDropInfo->bStarterOfDD ) { pEditEngine->pImpEditEngine->UndoActionStart( EDITUNDO_DRAGANDDROP ); - pDragAndDropInfo->bUndoAction = sal_True; + pDragAndDropInfo->bUndoAction = true; } if ( pDragAndDropInfo->bOutlinerMode ) { - bChanges = sal_True; + bChanges = true; GetEditViewPtr()->MoveParagraphs( Range( pDragAndDropInfo->aBeginDragSel.nStartPara, pDragAndDropInfo->aBeginDragSel.nEndPara ), pDragAndDropInfo->nOutlinerDropDest ); } else @@ -1763,7 +1763,7 @@ void ImpEditView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDro pDragAndDropInfo->aDropSel.nStartPos = aPaM.GetIndex(); pDragAndDropInfo->aDropSel.nEndPara = pEditEngine->GetEditDoc().GetPos( aNewSel.Max().GetNode() ); pDragAndDropInfo->aDropSel.nEndPos = aNewSel.Max().GetIndex(); - pDragAndDropInfo->bDroppedInMe = sal_True; + pDragAndDropInfo->bDroppedInMe = true; } } } @@ -1790,7 +1790,7 @@ void ImpEditView::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTarg if ( !pDragAndDropInfo ) pDragAndDropInfo = new DragAndDropInfo( ); - pDragAndDropInfo->bHasValidData = sal_False; + pDragAndDropInfo->bHasValidData = false; // Check for supported format... // Only check for text, will also be there if bin or rtf @@ -1802,7 +1802,7 @@ void ImpEditView::dragEnter( const ::com::sun::star::datatransfer::dnd::DropTarg { if( TransferableDataHelper::IsEqual( pFlavors[n], aTextFlavor ) ) { - pDragAndDropInfo->bHasValidData = sal_True; + pDragAndDropInfo->bHasValidData = true; break; } } @@ -1832,15 +1832,15 @@ void ImpEditView::dragOver(const ::com::sun::star::datatransfer::dnd::DropTarget Point aMousePos( rDTDE.LocationX, rDTDE.LocationY ); aMousePos = GetWindow()->PixelToLogic( aMousePos ); - sal_Bool bAccept = sal_False; + bool bAccept = false; if ( GetOutputArea().IsInside( aMousePos ) && !bReadOnly ) { if ( pDragAndDropInfo && pDragAndDropInfo->bHasValidData ) { - bAccept = sal_True; + bAccept = true; - sal_Bool bAllowScroll = DoAutoScroll(); + bool bAllowScroll = DoAutoScroll(); if ( bAllowScroll ) { long nScrollX = 0; @@ -1884,7 +1884,7 @@ void ImpEditView::dragOver(const ::com::sun::star::datatransfer::dnd::DropTarget if( ( pDragAndDropInfo->nOutlinerDropDest >= pDragAndDropInfo->aBeginDragSel.nStartPara ) && ( pDragAndDropInfo->nOutlinerDropDest <= (pDragAndDropInfo->aBeginDragSel.nEndPara+1) ) ) { - bAccept = sal_False; + bAccept = false; } } else if ( HasSelection() ) @@ -1896,7 +1896,7 @@ void ImpEditView::dragOver(const ::com::sun::star::datatransfer::dnd::DropTarget aCurSel.Adjust(); if ( !aDestSel.IsLess( aCurSel ) && !aDestSel.IsGreater( aCurSel ) ) { - bAccept = sal_False; + bAccept = false; } } if ( bAccept ) @@ -1941,13 +1941,13 @@ void ImpEditView::dragOver(const ::com::sun::star::datatransfer::dnd::DropTarget aEditCursor = GetWindow()->PixelToLogic( aEditCursor ); } - sal_Bool bCursorChanged = !pDragAndDropInfo->bVisCursor || ( pDragAndDropInfo->aCurCursor != aEditCursor ); + bool bCursorChanged = !pDragAndDropInfo->bVisCursor || ( pDragAndDropInfo->aCurCursor != aEditCursor ); if ( bCursorChanged ) { HideDDCursor(); ShowDDCursor(aEditCursor ); } - pDragAndDropInfo->bDragAccepted = sal_True; + pDragAndDropInfo->bDragAccepted = true; rDTDE.Context->acceptDrag( rDTDE.DropAction ); } } @@ -1957,7 +1957,7 @@ void ImpEditView::dragOver(const ::com::sun::star::datatransfer::dnd::DropTarget { HideDDCursor(); if (pDragAndDropInfo) - pDragAndDropInfo->bDragAccepted = sal_False; + pDragAndDropInfo->bDragAccepted = false; rDTDE.Context->rejectDrag(); } } @@ -1977,7 +1977,7 @@ void ImpEditView::AddDragAndDropListeners() pWindow->GetDropTarget()->setActive( sal_True ); pWindow->GetDropTarget()->setDefaultActions( datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE ); - bActiveDragAndDropListener = sal_True; + bActiveDragAndDropListener = true; } } @@ -1997,7 +1997,7 @@ void ImpEditView::RemoveDragAndDropListeners() mxDnDListener.clear(); } - bActiveDragAndDropListener = sal_False; + bActiveDragAndDropListener = false; } } diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 5be394786ac0..b225ac661a44 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -114,19 +114,19 @@ struct DragAndDropInfo ESelection aDropSel; VirtualDevice* pBackground; const SvxFieldItem* pField; - sal_Bool bVisCursor : 1; - sal_Bool bDroppedInMe : 1; - sal_Bool bStarterOfDD : 1; - sal_Bool bHasValidData : 1; - sal_Bool bUndoAction : 1; - sal_Bool bOutlinerMode : 1; - sal_Bool bDragAccepted : 1; + bool bVisCursor : 1; + bool bDroppedInMe : 1; + bool bStarterOfDD : 1; + bool bHasValidData : 1; + bool bUndoAction : 1; + bool bOutlinerMode : 1; + bool bDragAccepted : 1; DragAndDropInfo() { - pBackground = NULL; bVisCursor = sal_False; bDroppedInMe = sal_False; bStarterOfDD = sal_False; - bHasValidData = sal_False; bUndoAction = sal_False; bOutlinerMode = sal_False; - nSensibleRange = 0; nCursorWidth = 0; pField = 0; nOutlinerDropDest = 0; bDragAccepted = sal_False; + pBackground = NULL; bVisCursor = false; bDroppedInMe = false; bStarterOfDD = false; + bHasValidData = false; bUndoAction = false; bOutlinerMode = false; + nSensibleRange = 0; nCursorWidth = 0; pField = 0; nOutlinerDropDest = 0; bDragAccepted = false; } }; @@ -136,8 +136,8 @@ struct ImplIMEInfos sal_uInt16* pAttribs; EditPaM aPos; sal_Int32 nLen; - sal_Bool bCursor; - sal_Bool bWasCursorOverwrite; + bool bCursor; + bool bWasCursorOverwrite; ImplIMEInfos( const EditPaM& rPos, const OUString& rOldTextAfterStartPos ); ~ImplIMEInfos(); @@ -156,12 +156,12 @@ struct SpellInfo EPaM aSpellStart; EPaM aSpellTo; EditPaM aCurSentenceStart; - sal_Bool bSpellToEnd; - sal_Bool bMultipleDoc; + bool bSpellToEnd; + bool bMultipleDoc; ::svx::SpellPortions aLastSpellPortions; SpellContentSelections aLastSpellContentSelections; SpellInfo() - { bSpellToEnd = sal_True; eState = EE_SPELL_OK; bMultipleDoc = sal_False; } + { bSpellToEnd = true; eState = EE_SPELL_OK; bMultipleDoc = false; } }; // used for text conversion @@ -231,9 +231,9 @@ private: sal_uInt16 nExtraCursorFlags; sal_uInt16 nCursorBidiLevel; sal_uInt16 nScrollDiffX; - sal_Bool bReadOnly; - sal_Bool bClickedInSelection; - sal_Bool bActiveDragAndDropListener; + bool bReadOnly; + bool bClickedInSelection; + bool bActiveDragAndDropListener; Point aAnchorPoint; Rectangle aOutArea; @@ -285,17 +285,17 @@ public: void ResetOutputArea( const Rectangle& rRect ); const Rectangle& GetOutputArea() const { return aOutArea; } - sal_Bool IsVertical() const; + bool IsVertical() const; - sal_Bool PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin = NULL ); + bool PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin = NULL ); - sal_Bool MouseButtonUp( const MouseEvent& rMouseEvent ); - sal_Bool MouseButtonDown( const MouseEvent& rMouseEvent ); - sal_Bool MouseMove( const MouseEvent& rMouseEvent ); + bool MouseButtonUp( const MouseEvent& rMouseEvent ); + bool MouseButtonDown( const MouseEvent& rMouseEvent ); + bool MouseMove( const MouseEvent& rMouseEvent ); void Command( const CommandEvent& rCEvt ); - void CutCopy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, sal_Bool bCut ); - void Paste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, sal_Bool bUseSpecial = sal_False ); + void CutCopy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, bool bCut ); + void Paste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, bool bUseSpecial = false ); void SetVisDocStartPos( const Point& rPos ) { aVisDocStartPos = rPos; } const Point& GetVisDocStartPos() const { return aVisDocStartPos; } @@ -308,7 +308,7 @@ public: EditSelection& GetEditSelection() { return aEditSelection; } void SetEditSelection( const EditSelection& rEditSelection ); - sal_Bool HasSelection() const { return aEditSelection.HasRange(); } + bool HasSelection() const { return aEditSelection.HasRange(); } void DrawSelection() { DrawSelection( aEditSelection ); } void DrawSelection( EditSelection, Region* pRegion = NULL, OutputDevice* pTargetDevice = NULL ); @@ -327,14 +327,14 @@ public: void AddDragAndDropListeners(); void RemoveDragAndDropListeners(); - sal_Bool IsBulletArea( const Point& rPos, sal_Int32* pPara ); + bool IsBulletArea( const Point& rPos, sal_Int32* pPara ); // For the Selection Engine... void CreateAnchor(); void DeselectAll(); - sal_Bool SetCursorAtPoint( const Point& rPointPixel ); - sal_Bool IsSelectionAtPoint( const Point& rPosPixel ); - sal_Bool IsInSelection( const EditPaM& rPaM ); + bool SetCursorAtPoint( const Point& rPointPixel ); + bool IsSelectionAtPoint( const Point& rPosPixel ); + bool IsInSelection( const EditPaM& rPaM ); void SetAnchorMode( EVAnchorMode eMode ); @@ -342,30 +342,30 @@ public: void CalcAnchorPoint(); void RecalcOutputArea(); - void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_Bool test ); - void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_uInt16 nShowCursorFlags = 0 ); + void ShowCursor( bool bGotoCursor, bool bForceVisCursor, bool test ); + void ShowCursor( bool bGotoCursor, bool bForceVisCursor, sal_uInt16 nShowCursorFlags = 0 ); Pair Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck = RGCHK_NEG ); - void SetInsertMode( sal_Bool bInsert ); - sal_Bool IsInsertMode() const { return ( ( nControl & EV_CNTRL_OVERWRITE ) == 0 ); } + void SetInsertMode( bool bInsert ); + bool IsInsertMode() const { return ( ( nControl & EV_CNTRL_OVERWRITE ) == 0 ); } - void EnablePaste( sal_Bool bEnable ) { SetFlags( nControl, EV_CNTRL_ENABLEPASTE, bEnable ); } - sal_Bool IsPasteEnabled() const { return ( ( nControl & EV_CNTRL_ENABLEPASTE ) != 0 ); } + void EnablePaste( bool bEnable ) { SetFlags( nControl, EV_CNTRL_ENABLEPASTE, bEnable ); } + bool IsPasteEnabled() const { return ( ( nControl & EV_CNTRL_ENABLEPASTE ) != 0 ); } - sal_Bool DoSingleLinePaste() const { return ( ( nControl & EV_CNTRL_SINGLELINEPASTE ) != 0 ); } - sal_Bool DoAutoScroll() const { return ( ( nControl & EV_CNTRL_AUTOSCROLL ) != 0 ); } - sal_Bool DoBigScroll() const { return ( ( nControl & EV_CNTRL_BIGSCROLL ) != 0 ); } - sal_Bool DoAutoSize() const { return ( ( nControl & EV_CNTRL_AUTOSIZE ) != 0 ); } - sal_Bool DoAutoWidth() const { return ( ( nControl & EV_CNTRL_AUTOSIZEX) != 0 ); } - sal_Bool DoAutoHeight() const { return ( ( nControl & EV_CNTRL_AUTOSIZEY) != 0 ); } - sal_Bool DoInvalidateMore() const { return ( ( nControl & EV_CNTRL_INVONEMORE ) != 0 ); } + bool DoSingleLinePaste() const { return ( ( nControl & EV_CNTRL_SINGLELINEPASTE ) != 0 ); } + bool DoAutoScroll() const { return ( ( nControl & EV_CNTRL_AUTOSCROLL ) != 0 ); } + bool DoBigScroll() const { return ( ( nControl & EV_CNTRL_BIGSCROLL ) != 0 ); } + bool DoAutoSize() const { return ( ( nControl & EV_CNTRL_AUTOSIZE ) != 0 ); } + bool DoAutoWidth() const { return ( ( nControl & EV_CNTRL_AUTOSIZEX) != 0 ); } + bool DoAutoHeight() const { return ( ( nControl & EV_CNTRL_AUTOSIZEY) != 0 ); } + bool DoInvalidateMore() const { return ( ( nControl & EV_CNTRL_INVONEMORE ) != 0 ); } void SetBackgroundColor( const Color& rColor ); const Color& GetBackgroundColor() const { return ( pBackgroundColor ? *pBackgroundColor : pOutWin->GetBackground().GetColor() ); } - sal_Bool IsWrongSpelledWord( const EditPaM& rPaM, sal_Bool bMarkIfWrong ); - OUString SpellIgnoreOrAddWord( sal_Bool bAdd ); + bool IsWrongSpelledWord( const EditPaM& rPaM, bool bMarkIfWrong ); + OUString SpellIgnoreOrAddWord( bool bAdd ); const SvxFieldItem* GetField( const Point& rPos, sal_Int32* pPara, sal_Int32* pPos ) const; void DeleteSelected(); @@ -512,12 +512,12 @@ private: void InsertUndo( EditUndo* pUndo, bool bTryMerge = false ); void ResetUndoManager(); - sal_Bool HasUndoManager() const { return pUndoManager ? sal_True : sal_False; } + bool HasUndoManager() const { return pUndoManager ? sal_True : sal_False; } EditUndoSetAttribs* CreateAttribUndo( EditSelection aSel, const SfxItemSet& rSet ); - EditPaM GetPaM( Point aDocPos, sal_Bool bSmart = sal_True ); - EditPaM GetPaM( ParaPortion* pPortion, Point aPos, sal_Bool bSmart = sal_True ); + EditPaM GetPaM( Point aDocPos, bool bSmart = true ); + EditPaM GetPaM( ParaPortion* pPortion, Point aPos, bool bSmart = true ); long GetXPos(const ParaPortion* pParaPortion, const EditLine* pLine, sal_Int32 nIndex, bool bPreferPortionStart = false) const; long GetPortionXOffset(const ParaPortion* pParaPortion, const EditLine* pLine, sal_Int32 nTextPortion) const; sal_Int32 GetChar(const ParaPortion* pParaPortion, const EditLine* pLine, long nX, bool bSmart = true); @@ -530,16 +530,16 @@ private: void ParaAttribsToCharAttribs( ContentNode* pNode ); void GetCharAttribs( sal_Int32 nPara, std::vector<EECharAttrib>& rLst ) const; - EditTextObject* CreateTextObject( EditSelection aSelection, SfxItemPool*, sal_Bool bAllowBigObjects = sal_False, sal_Int32 nBigObjStart = 0 ); + EditTextObject* CreateTextObject( EditSelection aSelection, SfxItemPool*, bool bAllowBigObjects = false, sal_Int32 nBigObjStart = 0 ); EditSelection InsertTextObject( const EditTextObject&, EditPaM aPaM ); - EditSelection InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxDataObj, const OUString& rBaseURL, const EditPaM& rPaM, sal_Bool bUseSpecial ); + EditSelection InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxDataObj, const OUString& rBaseURL, const EditPaM& rPaM, bool bUseSpecial ); EditPaM Clear(); EditPaM RemoveText(); EditPaM RemoveText( EditSelection aEditSelection ); - sal_Bool CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ); + bool CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ); void CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uInt32 nStartPosY ); - sal_Bool FinishCreateLines( ParaPortion* pParaPortion ); + bool FinishCreateLines( ParaPortion* pParaPortion ); void CalcCharPositions( ParaPortion* pParaPortion ); void CreateTextPortions( ParaPortion* pParaPortion, sal_Int32& rStartPos /*, sal_Bool bCreateBlockPortions */ ); void RecalcTextPortion( ParaPortion* pParaPortion, sal_Int32 nStartPos, sal_Int32 nNewChars ); @@ -548,9 +548,9 @@ private: void RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics, SvxFont& rFont ); void CheckAutoPageSize(); - void ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, TextPortion* pPortion, sal_Int32 nPortionStart, long nRemainingWidth, sal_Bool bCanHyphenate ); + void ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, TextPortion* pPortion, sal_Int32 nPortionStart, long nRemainingWidth, bool bCanHyphenate ); void ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, long nRemainingSpace ); - EditPaM ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, sal_Bool bBackward = sal_False ); + EditPaM ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, bool bBackward = false ); EditPaM ImpDeleteSelection(const EditSelection& rCurSel); EditPaM ImpInsertParaBreak( EditPaM& rPaM, bool bKeepEndingAttribs = true ); EditPaM ImpInsertParaBreak( const EditSelection& rEditSelection, bool bKeepEndingAttribs = true ); @@ -571,7 +571,7 @@ private: void InsertContent( ContentNode* pNode, sal_Int32 nPos ); EditPaM SplitContent( sal_Int32 nNode, sal_Int32 nSepPos ); - EditPaM ConnectContents( sal_Int32 nLeftNode, sal_Bool bBackward ); + EditPaM ConnectContents( sal_Int32 nLeftNode, bool bBackward ); void ShowParagraph( sal_Int32 nParagraph, bool bShow ); @@ -591,19 +591,19 @@ private: EditPaM WordRight( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); EditPaM StartOfWord( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); EditPaM EndOfWord( const EditPaM& rPaM, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES ); - EditSelection SelectWord( const EditSelection& rCurSelection, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_Bool bAcceptStartOfWord = sal_True ); + EditSelection SelectWord( const EditSelection& rCurSelection, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, bool bAcceptStartOfWord = true ); EditSelection SelectSentence( const EditSelection& rCurSel ) const; - EditPaM CursorVisualLeftRight( EditView* pEditView, const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode, sal_Bool bToLeft ); - EditPaM CursorVisualStartEnd( EditView* pEditView, const EditPaM& rPaM, sal_Bool bStart ); + EditPaM CursorVisualLeftRight( EditView* pEditView, const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode, bool bToLeft ); + EditPaM CursorVisualStartEnd( EditView* pEditView, const EditPaM& rPaM, bool bStart ); void InitScriptTypes( sal_Int32 nPara ); sal_uInt16 GetI18NScriptType( const EditPaM& rPaM, sal_Int32* pEndPos = NULL ) const; sal_uInt16 GetItemScriptType( const EditSelection& rSel ) const; - sal_Bool IsScriptChange( const EditPaM& rPaM ) const; - sal_Bool HasScriptType( sal_Int32 nPara, sal_uInt16 nType ) const; + bool IsScriptChange( const EditPaM& rPaM ) const; + bool HasScriptType( sal_Int32 nPara, sal_uInt16 nType ) const; - bool ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, sal_Int32 nStartPos, sal_Int32* pDXArray, sal_uInt16 n100thPercentFromMax, sal_Bool bManipulateDXArray ); + bool ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, sal_Int32 nStartPos, sal_Int32* pDXArray, sal_uInt16 n100thPercentFromMax, bool bManipulateDXArray ); void ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, long nRemainingWidth ); void ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara, sal_Int32 nIndex ); @@ -624,7 +624,7 @@ private: void WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, sal_Int32 nPara, sal_Int32 nPos, std::vector<SvxFontItem*>& rFontTable, SvxColorList& rColorList ); - sal_Bool WriteItemListAsRTF( ItemList& rLst, SvStream& rOutput, sal_Int32 nPara, sal_Int32 nPos, + bool WriteItemListAsRTF( ItemList& rLst, SvStream& rOutput, sal_Int32 nPara, sal_Int32 nPos, std::vector<SvxFontItem*>& rFontTable, SvxColorList& rColorList ); sal_Int32 LogicToTwips( sal_Int32 n ); @@ -692,7 +692,7 @@ public: inline EditUndoManager& GetUndoManager(); inline ::svl::IUndoManager* SetUndoManager(::svl::IUndoManager* pNew); - void SetUpdateMode( bool bUp, EditView* pCurView = 0, sal_Bool bForceUpdate = sal_False ); + void SetUpdateMode( bool bUp, EditView* pCurView = 0, bool bForceUpdate = false ); bool GetUpdateMode() const { return bUpdate; } ViewsType& GetEditViews() { return aEditViews; } @@ -701,20 +701,20 @@ public: const Size& GetPaperSize() const { return aPaperSize; } void SetPaperSize( const Size& rSz ) { aPaperSize = rSz; } - void SetVertical( sal_Bool bVertical ); - sal_Bool IsVertical() const { return GetEditDoc().IsVertical(); } + void SetVertical( bool bVertical ); + bool IsVertical() const { return GetEditDoc().IsVertical(); } - void SetFixedCellHeight( sal_Bool bUseFixedCellHeight ); - sal_Bool IsFixedCellHeight() const { return GetEditDoc().IsFixedCellHeight(); } + void SetFixedCellHeight( bool bUseFixedCellHeight ); + bool IsFixedCellHeight() const { return GetEditDoc().IsFixedCellHeight(); } void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir ) { eDefaultHorizontalTextDirection = eHTextDir; } EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const { return eDefaultHorizontalTextDirection; } void InitWritingDirections( sal_Int32 nPara ); - sal_Bool IsRightToLeft( sal_Int32 nPara ) const; + bool IsRightToLeft( sal_Int32 nPara ) const; sal_uInt8 GetRightToLeft( sal_Int32 nPara, sal_Int32 nChar, sal_Int32* pStart = NULL, sal_Int32* pEnd = NULL ); - sal_Bool HasDifferentRTLLevels( const ContentNode* pNode ); + bool HasDifferentRTLLevels( const ContentNode* pNode ); void SetTextRanger( TextRanger* pRanger ); TextRanger* GetTextRanger() const { return pTextRanger; } @@ -728,12 +728,12 @@ public: void FormatDoc(); void FormatFullDoc(); void UpdateViews( EditView* pCurView = 0 ); - void Paint( ImpEditView* pView, const Rectangle& rRect, OutputDevice* pTargetDevice = 0, sal_Bool bUseVirtDev = sal_False ); - void Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aStartPos, sal_Bool bStripOnly = sal_False, short nOrientation = 0 ); + void Paint( ImpEditView* pView, const Rectangle& rRect, OutputDevice* pTargetDevice = 0, bool bUseVirtDev = false ); + void Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aStartPos, bool bStripOnly = false, short nOrientation = 0 ); - sal_Bool MouseButtonUp( const MouseEvent& rMouseEvent, EditView* pView ); - sal_Bool MouseButtonDown( const MouseEvent& rMouseEvent, EditView* pView ); - sal_Bool MouseMove( const MouseEvent& rMouseEvent, EditView* pView ); + bool MouseButtonUp( const MouseEvent& rMouseEvent, EditView* pView ); + bool MouseButtonDown( const MouseEvent& rMouseEvent, EditView* pView ); + bool MouseMove( const MouseEvent& rMouseEvent, EditView* pView ); void Command( const CommandEvent& rCEvt, EditView* pView ); EditSelectionEngine& GetSelEngine() { return aSelEngine; } @@ -763,15 +763,15 @@ public: void SetText(const OUString& rText); EditPaM DeleteSelected( EditSelection aEditSelection); - EditPaM InsertText( const EditSelection& rCurEditSelection, sal_Unicode c, sal_Bool bOverwrite, sal_Bool bIsUserInput = sal_False ); + EditPaM InsertText( const EditSelection& rCurEditSelection, sal_Unicode c, bool bOverwrite, bool bIsUserInput = false ); EditPaM InsertText(const EditSelection& aCurEditSelection, const OUString& rStr); - EditPaM AutoCorrect( const EditSelection& rCurEditSelection, sal_Unicode c, sal_Bool bOverwrite, Window* pFrameWin = NULL ); + EditPaM AutoCorrect( const EditSelection& rCurEditSelection, sal_Unicode c, bool bOverwrite, Window* pFrameWin = NULL ); EditPaM DeleteLeftOrRight( const EditSelection& rEditSelection, sal_uInt8 nMode, sal_uInt8 nDelMode = DELMODE_SIMPLE ); EditPaM InsertParaBreak( EditSelection aEditSelection ); EditPaM InsertLineBreak(const EditSelection& aEditSelection); EditPaM InsertTab( EditSelection aEditSelection ); EditPaM InsertField(const EditSelection& rCurSel, const SvxFieldItem& rFld); - sal_Bool UpdateFields(); + bool UpdateFields(); EditPaM Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat, EditSelection aSel, SvKeyValueIterator* pHTTPHeaderAttrs = NULL ); void Write( SvStream& rOutput, EETextFormat eFormat, EditSelection aSel ); @@ -788,8 +788,8 @@ public: sal_uInt32 CalcTextHeight( sal_uInt32* pHeightNTP ); sal_uInt32 GetTextHeight() const; sal_uInt32 GetTextHeightNTP() const; - sal_uInt32 CalcTextWidth( sal_Bool bIgnoreExtraSpace ); - sal_uInt32 CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, sal_Bool bIgnoreExtraSpace ); + sal_uInt32 CalcTextWidth( bool bIgnoreExtraSpace ); + sal_uInt32 CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, bool bIgnoreExtraSpace ); sal_Int32 GetLineCount( sal_Int32 nParagraph ) const; sal_Int32 GetLineLen( sal_Int32 nParagraph, sal_Int32 nLine ) const; void GetLineBoundaries( /*out*/sal_Int32& rStart, /*out*/sal_Int32& rEnd, sal_Int32 nParagraph, sal_Int32 nLine ) const; @@ -800,9 +800,9 @@ public: SfxItemSet GetAttribs( sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, sal_uInt8 nFlags = 0xFF ) const; SfxItemSet GetAttribs( EditSelection aSel, EditEngineAttribs nOnlyHardAttrib = EditEngineAttribs_All ); void SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_uInt8 nSpecial = 0 ); - void RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich = 0 ); - void RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich = 0, sal_Bool bRemoveFeatures = sal_False ); - void SetFlatMode( sal_Bool bFlat ); + void RemoveCharAttribs( EditSelection aSel, bool bRemoveParaAttribs, sal_uInt16 nWhich = 0 ); + void RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich = 0, bool bRemoveFeatures = false ); + void SetFlatMode( bool bFlat ); void SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ); const SfxItemSet& GetParaAttribs( sal_Int32 nPara ) const; @@ -813,19 +813,19 @@ public: Rectangle PaMtoEditCursor( EditPaM aPaM, sal_uInt16 nFlags = 0 ); Rectangle GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex, sal_uInt16 nFlags = 0 ); - sal_Bool IsModified() const { return aEditDoc.IsModified(); } - void SetModifyFlag( sal_Bool b ) { aEditDoc.SetModified( b ); } + bool IsModified() const { return aEditDoc.IsModified(); } + void SetModifyFlag( bool b ) { aEditDoc.SetModified( b ); } void SetModifyHdl( const Link& rLink ) { aModifyHdl = rLink; } Link GetModifyHdl() const { return aModifyHdl; } bool IsInSelectionMode() { return bInSelection; } - void IndentBlock( EditView* pView, sal_Bool bRight ); + void IndentBlock( EditView* pView, bool bRight ); // For Undo/Redo - sal_Bool Undo( EditView* pView ); - sal_Bool Redo( EditView* pView ); + bool Undo( EditView* pView ); + bool Redo( EditView* pView ); // OV-Special void InvalidateFromParagraph( sal_Int32 nFirstInvPara ); @@ -842,8 +842,8 @@ public: inline void IdleFormatAndUpdate( EditView* pCurView = 0 ); svtools::ColorConfig& GetColorConfig(); - sal_Bool IsVisualCursorTravelingEnabled(); - sal_Bool DoVisualCursorTraveling( const ContentNode* pNode ); + bool IsVisualCursorTravelingEnabled(); + bool DoVisualCursorTraveling( const ContentNode* pNode ); EditSelection ConvertSelection( sal_Int32 nStartPara, sal_Int32 nStartPos, sal_Int32 nEndPara, sal_Int32 nEndPos ); inline EPaM CreateEPaM( const EditPaM& rPaM ); @@ -911,7 +911,7 @@ public: ::com::sun::star::lang::Locale GetLocale( const EditPaM& rPaM ) const; void DoOnlineSpelling( ContentNode* pThisNodeOnly = 0, bool bSpellAtCursorPos = false, bool bInteruptable = true ); - EESpellState Spell( EditView* pEditView, sal_Bool bMultipleDoc ); + EESpellState Spell( EditView* pEditView, bool bMultipleDoc ); EESpellState HasSpellErrors(); void ClearSpellErrors(); EESpellState StartThesaurus( EditView* pEditView ); @@ -924,20 +924,20 @@ public: void ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, EditView* pEditView, LanguageType nSrcLang, const ESelection &rConvRange, bool bAllowImplicitChangesForNotConvertibleText, LanguageType nTargetLang, const Font *pTargetFont ); ConvInfo * GetConvInfo() const { return pConvInfo; } - sal_Bool HasConvertibleTextPortion( LanguageType nLang ); + bool HasConvertibleTextPortion( LanguageType nLang ); void SetLanguageAndFont( const ESelection &rESel, LanguageType nLang, sal_uInt16 nLangWhichId, const Font *pFont, sal_uInt16 nFontWhichId ); // returns true if input sequence checking should be applied - sal_Bool IsInputSequenceCheckingRequired( sal_Unicode nChar, const EditSelection& rCurSel ) const; + bool IsInputSequenceCheckingRequired( sal_Unicode nChar, const EditSelection& rCurSel ) const; //find the next error within the given selection - forward only! ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellAlternatives > ImpFindNextError(EditSelection& rSelection); //initialize sentence spelling - void StartSpelling(EditView& rEditView, sal_Bool bMultipleDoc); + void StartSpelling(EditView& rEditView, bool bMultipleDoc); //spell and return a sentence bool SpellSentence(EditView& rView, ::svx::SpellPortions& rToFill, bool bIsGrammarChecking ); //put spelling back to start of current sentence - needed after switch of grammar support @@ -957,10 +957,10 @@ public: ::svx::SpellPortions& rToFill, bool bIsField ); - sal_Bool Search( const SvxSearchItem& rSearchItem, EditView* pView ); - sal_Bool ImpSearch( const SvxSearchItem& rSearchItem, const EditSelection& rSearchSelection, const EditPaM& rStartPos, EditSelection& rFoundSel ); + bool Search( const SvxSearchItem& rSearchItem, EditView* pView ); + bool ImpSearch( const SvxSearchItem& rSearchItem, const EditSelection& rSearchSelection, const EditPaM& rStartPos, EditSelection& rFoundSel ); sal_Int32 StartSearchAndReplace( EditView* pEditView, const SvxSearchItem& rSearchItem ); - sal_Bool HasText( const SvxSearchItem& rSearchItem ); + bool HasText( const SvxSearchItem& rSearchItem ); void SetEditTextObjectPool( SfxItemPool* pP ) { pTextObjectPool = pP; } SfxItemPool* GetEditTextObjectPool() const { return pTextObjectPool; } @@ -1000,7 +1000,7 @@ public: void SetAddExtLeading( bool b ); bool IsAddExtLeading() const { return bAddExtLeading; } - rtl::Reference<SvxForbiddenCharactersTable> GetForbiddenCharsTable( sal_Bool bGetInternal = sal_True ) const; + rtl::Reference<SvxForbiddenCharactersTable> GetForbiddenCharsTable( bool bGetInternal = true ) const; void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars ); /** sets a link that is called at the beginning of a drag operation at an edit view */ diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 18528800f685..d17b138b6e2a 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -301,7 +301,7 @@ OUString ImpEditEngine::GetSelected( const EditSelection& rSel, const LineEnd eE return aText; } -sal_Bool ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pView ) +bool ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pView ) { GetSelEngine().SetCurView( pView ); SetActiveView( pView ); @@ -339,7 +339,7 @@ sal_Bool ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pVie pView->ShowCursor( true, true ); } } - return sal_True; + return true; } void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) @@ -388,7 +388,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) ParaPortion* pPortion = FindParaPortion( mpIMEInfos->aPos.GetNode() ); pPortion->MarkSelectionInvalid( mpIMEInfos->aPos.GetIndex(), 0 ); - sal_Bool bWasCursorOverwrite = mpIMEInfos->bWasCursorOverwrite; + bool bWasCursorOverwrite = mpIMEInfos->bWasCursorOverwrite; delete mpIMEInfos; mpIMEInfos = NULL; @@ -563,7 +563,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) GetSelEngine().Command( rCEvt ); } -sal_Bool ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView ) +bool ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView ) { GetSelEngine().SetCurView( pView ); GetSelEngine().SelMouseButtonUp( rMEvt ); @@ -583,15 +583,15 @@ sal_Bool ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView } } } - return sal_True; + return true; } -sal_Bool ImpEditEngine::MouseMove( const MouseEvent& rMEvt, EditView* pView ) +bool ImpEditEngine::MouseMove( const MouseEvent& rMEvt, EditView* pView ) { // MouseMove is called directly after ShowQuickHelp()! GetSelEngine().SetCurView( pView ); GetSelEngine().SelMouseMove( rMEvt ); - return sal_True; + return true; } EditPaM ImpEditEngine::InsertText(const EditSelection& aSel, const OUString& rStr) @@ -641,7 +641,7 @@ void ImpEditEngine::SetText(const OUString& rText) { // RemoveText deletes the undo list! EditPaM aStartPaM = RemoveText(); - sal_Bool bUndoCurrentlyEnabled = IsUndoEnabled(); + bool bUndoCurrentlyEnabled = IsUndoEnabled(); // The text inserted manually can not be made reversable by the user EnableUndo( false ); @@ -750,7 +750,7 @@ EditSelection ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, EditView* pE KeyEvent aTranslatedKeyEvent = rKeyEvent.LogicalTextDirectionality( eTextDirection ); - sal_Bool bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? sal_True : sal_False; + bool bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? sal_True : sal_False; sal_uInt16 nCode = aTranslatedKeyEvent.GetKeyCode().GetCode(); if ( DoVisualCursorTraveling( aPaM.GetNode() ) ) @@ -905,7 +905,7 @@ EditSelection ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, EditView* pE return pEditView->pImpEditView->GetEditSelection(); } -EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM& rPaM, sal_Bool bStart ) +EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM& rPaM, bool bStart ) { EditPaM aPaM( rPaM ); @@ -941,7 +941,7 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM& sal_Int32 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTmp, true ); const TextPortion* pTextPortion = pParaPortion->GetTextPortions()[nTextPortion]; sal_Int32 nRTLLevel = pTextPortion->GetRightToLeft(); - sal_Bool bPortionRTL = (nRTLLevel%2) ? sal_True : sal_False; + bool bPortionRTL = (nRTLLevel%2) ? sal_True : sal_False; if ( bStart ) { @@ -961,7 +961,7 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM& return aPaM; } -EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode, sal_Bool bVisualToLeft ) +EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode, bool bVisualToLeft ) { EditPaM aPaM( rPaM ); @@ -974,9 +974,9 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM pEditView->pImpEditView->nExtraCursorFlags = 0; - sal_Bool bParaRTL = IsRightToLeft( nPara ); + bool bParaRTL = IsRightToLeft( nPara ); - sal_Bool bDone = sal_False; + bool bDone = false; if ( bEmptyLine ) { @@ -984,19 +984,19 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM { aPaM = CursorUp( aPaM, pEditView ); if ( aPaM != rPaM ) - aPaM = CursorVisualStartEnd( pEditView, aPaM, sal_False ); + aPaM = CursorVisualStartEnd( pEditView, aPaM, false ); } else { aPaM = CursorDown( aPaM, pEditView ); if ( aPaM != rPaM ) - aPaM = CursorVisualStartEnd( pEditView, aPaM, sal_True ); + aPaM = CursorVisualStartEnd( pEditView, aPaM, true ); } - bDone = sal_True; + bDone = true; } - sal_Bool bLogicalBackward = bParaRTL ? !bVisualToLeft : bVisualToLeft; + bool bLogicalBackward = bParaRTL ? !bVisualToLeft : bVisualToLeft; if ( !bDone && pEditView->IsInsertMode() ) { @@ -1005,7 +1005,7 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM sal_Int32 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nPortionStart, false ); const TextPortion* pTextPortion = pParaPortion->GetTextPortions()[nTextPortion]; - sal_Bool bPortionBoundary = ( aPaM.GetIndex() == nPortionStart ) || ( aPaM.GetIndex() == (nPortionStart+pTextPortion->GetLen()) ); + bool bPortionBoundary = ( aPaM.GetIndex() == nPortionStart ) || ( aPaM.GetIndex() == (nPortionStart+pTextPortion->GetLen()) ); sal_uInt16 nRTLLevel = pTextPortion->GetRightToLeft(); // Portion boundary doesn't matter if both have same RTL level @@ -1030,14 +1030,14 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM aPaM = CursorRight( aPaM, nCharacterIteratorMode ); pEditView->pImpEditView->SetCursorBidiLevel( 0 ); } - bDone = sal_True; + bDone = true; } } if ( !bDone ) { - sal_Bool bGotoStartOfNextLine = sal_False; - sal_Bool bGotoEndOfPrevLine = sal_False; + bool bGotoStartOfNextLine = false; + bool bGotoEndOfPrevLine = false; OUString aLine = aPaM.GetNode()->GetString().copy(pLine->GetStart(), pLine->GetEnd() - pLine->GetStart()); const sal_Int32 nPosInLine = aPaM.GetIndex() - pLine->GetStart(); @@ -1052,7 +1052,7 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM if ( !pEditView->IsInsertMode() ) { - sal_Bool bEndOfLine = nPosInLine == aLine.getLength(); + bool bEndOfLine = nPosInLine == aLine.getLength(); sal_Int32 nVisPos = ubidi_getVisualIndex( pBidi, !bEndOfLine ? nPosInLine : nPosInLine-1, &nError ); if ( bVisualToLeft ) { @@ -1075,15 +1075,15 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM } else { - sal_Bool bWasBehind = sal_False; - sal_Bool bBeforePortion = !nPosInLine || pEditView->pImpEditView->GetCursorBidiLevel() == 1; + bool bWasBehind = false; + bool bBeforePortion = !nPosInLine || pEditView->pImpEditView->GetCursorBidiLevel() == 1; if ( nPosInLine && ( !bBeforePortion ) ) // before the next portion - bWasBehind = sal_True; // step one back, otherwise visual will be unusable when rtl portion follows. + bWasBehind = true; // step one back, otherwise visual will be unusable when rtl portion follows. sal_Int32 nPortionStart; sal_Int32 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nPortionStart, bBeforePortion ); const TextPortion* pTextPortion = pParaPortion->GetTextPortions()[nTextPortion]; - sal_Bool bRTLPortion = (pTextPortion->GetRightToLeft() % 2) != 0; + bool bRTLPortion = (pTextPortion->GetRightToLeft() % 2) != 0; // -1: We are 'behind' the character long nVisPos = (long)ubidi_getVisualIndex( pBidi, bWasBehind ? nPosInLine-1 : nPosInLine, &nError ); @@ -1125,13 +1125,13 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM { aPaM = CursorUp( aPaM, pEditView ); if ( aPaM != rPaM ) - aPaM = CursorVisualStartEnd( pEditView, aPaM, sal_False ); + aPaM = CursorVisualStartEnd( pEditView, aPaM, false ); } else if ( bGotoStartOfNextLine ) { aPaM = CursorDown( aPaM, pEditView ); if ( aPaM != rPaM ) - aPaM = CursorVisualStartEnd( pEditView, aPaM, sal_True ); + aPaM = CursorVisualStartEnd( pEditView, aPaM, true ); } } return aPaM; @@ -1497,7 +1497,7 @@ EditPaM ImpEditEngine::EndOfWord( const EditPaM& rPaM, sal_Int16 nWordType ) return aNewPaM; } -EditSelection ImpEditEngine::SelectWord( const EditSelection& rCurSel, sal_Int16 nWordType, sal_Bool bAcceptStartOfWord ) +EditSelection ImpEditEngine::SelectWord( const EditSelection& rCurSel, sal_Int16 nWordType, bool bAcceptStartOfWord ) { EditSelection aNewSel( rCurSel ); EditPaM aPaM( rCurSel.Max() ); @@ -1553,7 +1553,7 @@ EditSelection ImpEditEngine::SelectSentence( const EditSelection& rCurSel ) return aNewSel; } -sal_Bool ImpEditEngine::IsInputSequenceCheckingRequired( sal_Unicode nChar, const EditSelection& rCurSel ) const +bool ImpEditEngine::IsInputSequenceCheckingRequired( sal_Unicode nChar, const EditSelection& rCurSel ) const { uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() ); if (!pCTLOptions) @@ -1562,7 +1562,7 @@ sal_Bool ImpEditEngine::IsInputSequenceCheckingRequired( sal_Unicode nChar, cons // get the index that really is first const sal_Int32 nFirstPos = std::min(rCurSel.Min().GetIndex(), rCurSel.Max().GetIndex()); - sal_Bool bIsSequenceChecking = + bool bIsSequenceChecking = pCTLOptions->IsCTLFontEnabled() && pCTLOptions->IsCTLSequenceChecking() && nFirstPos != 0 && /* first char needs not to be checked */ @@ -1815,7 +1815,7 @@ sal_uInt16 ImpEditEngine::GetItemScriptType( const EditSelection& rSel ) const return nScriptType ? nScriptType : SvtLanguageOptions::GetScriptTypeOfLanguage( GetDefaultLanguage() ); } -sal_Bool ImpEditEngine::IsScriptChange( const EditPaM& rPaM ) const +bool ImpEditEngine::IsScriptChange( const EditPaM& rPaM ) const { bool bScriptChange = false; @@ -1840,7 +1840,7 @@ sal_Bool ImpEditEngine::IsScriptChange( const EditPaM& rPaM ) const return bScriptChange; } -sal_Bool ImpEditEngine::HasScriptType( sal_Int32 nPara, sal_uInt16 nType ) const +bool ImpEditEngine::HasScriptType( sal_Int32 nPara, sal_uInt16 nType ) const { bool bTypeFound = false; @@ -1863,13 +1863,13 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara ) WritingDirectionInfos& rInfos = pParaPortion->aWritingDirectionInfos; rInfos.clear(); - sal_Bool bCTL = sal_False; + bool bCTL = false; ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos; for ( size_t n = 0; n < rTypes.size(); n++ ) { if ( rTypes[n].nScriptType == i18n::ScriptType::COMPLEX ) { - bCTL = sal_True; + bCTL = true; break; } } @@ -1916,9 +1916,9 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara ) } -sal_Bool ImpEditEngine::IsRightToLeft( sal_Int32 nPara ) const +bool ImpEditEngine::IsRightToLeft( sal_Int32 nPara ) const { - sal_Bool bR2L = sal_False; + bool bR2L = false; const SvxFrameDirectionItem* pFrameDirItem = NULL; if ( !IsVertical() ) @@ -1946,12 +1946,12 @@ sal_Bool ImpEditEngine::IsRightToLeft( sal_Int32 nPara ) const return bR2L; } -sal_Bool ImpEditEngine::HasDifferentRTLLevels( const ContentNode* pNode ) +bool ImpEditEngine::HasDifferentRTLLevels( const ContentNode* pNode ) { sal_Int32 nPara = GetEditDoc().GetPos( (ContentNode*)pNode ); ParaPortion* pParaPortion = GetParaPortions().SafeGetObject( nPara ); - sal_Bool bHasDifferentRTLLevels = sal_False; + bool bHasDifferentRTLLevels = false; sal_uInt16 nRTLLevel = IsRightToLeft( nPara ) ? 1 : 0; for ( sal_Int32 n = 0; n < (sal_Int32)pParaPortion->GetTextPortions().Count(); n++ ) @@ -1959,7 +1959,7 @@ sal_Bool ImpEditEngine::HasDifferentRTLLevels( const ContentNode* pNode ) const TextPortion* pTextPortion = pParaPortion->GetTextPortions()[n]; if ( pTextPortion->GetRightToLeft() != nRTLLevel ) { - bHasDifferentRTLLevels = sal_True; + bHasDifferentRTLLevels = true; break; } } @@ -2067,7 +2067,7 @@ void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, sal_Int32 nChars, EditU EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 nNewPos ) { aOldPositions.Justify(); - sal_Bool bValidAction = ( (long)nNewPos < aOldPositions.Min() ) || ( (long)nNewPos > aOldPositions.Max() ); + bool bValidAction = ( (long)nNewPos < aOldPositions.Min() ) || ( (long)nNewPos > aOldPositions.Max() ); OSL_ENSURE( bValidAction, "Move in itself?" ); OSL_ENSURE( aOldPositions.Max() <= (long)GetParaPortions().Count(), "totally over it: MoveParagraphs" ); @@ -2182,7 +2182,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n } -EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, sal_Bool bBackward ) +EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, bool bBackward ) { OSL_ENSURE( pLeft != pRight, "Join together the same paragraph ?" ); OSL_ENSURE( aEditDoc.GetPos( pLeft ) != EE_PARA_NOT_FOUND, "Inserted node not found (1)" ); @@ -2214,7 +2214,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR if ( bBackward ) { - pLeft->SetStyleSheet( pRight->GetStyleSheet(), sal_True ); + pLeft->SetStyleSheet( pRight->GetStyleSheet(), true ); pLeft->GetContentAttribs().GetItems().Set( pRight->GetContentAttribs().GetItems() ); pLeft->GetCharAttribs().GetDefFont() = pRight->GetCharAttribs().GetDefFont(); } @@ -2364,10 +2364,10 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 n return ImpDeleteSelection( EditSelection( aDelStart, aDelEnd ) ); // Decide now if to delete selection (RESTOFCONTENTS) - sal_Bool bSpecialBackward = ( ( nMode == DEL_LEFT ) && ( nDelMode == DELMODE_SIMPLE ) ) + bool bSpecialBackward = ( ( nMode == DEL_LEFT ) && ( nDelMode == DELMODE_SIMPLE ) ) ? sal_True : sal_False; if ( aStatus.IsAnyOutliner() ) - bSpecialBackward = sal_False; + bSpecialBackward = false; return ImpConnectParagraphs( aDelStart.GetNode(), aDelEnd.GetNode(), bSpecialBackward ); } @@ -2469,7 +2469,7 @@ void ImpEditEngine::ImpRemoveParagraph( sal_Int32 nPara ) } EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, sal_Unicode c, - sal_Bool bOverwrite, Window* pFrameWin ) + bool bOverwrite, Window* pFrameWin ) { EditSelection aSel( rCurSel ); SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect(); @@ -2481,7 +2481,7 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, sal_Unicode c, // #i78661 allow application to turn off capitalization of // start sentence explicitly. // (This is done by setting IsFirstWordCapitalization to sal_False.) - sal_Bool bOldCptlSttSntnc = pAutoCorrect->IsAutoCorrFlag( CptlSttSntnc ); + bool bOldCptlSttSntnc = pAutoCorrect->IsAutoCorrFlag( CptlSttSntnc ); if (!IsFirstWordCapitalization()) { ESelection aESel( CreateESel(aSel) ); @@ -2507,7 +2507,7 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, sal_Unicode c, EditPaM aRight2Word( WordRight( aFirstWordSel.Max(), 1 ) ); aSecondWordSel = SelectWord( EditSelection( aRight2Word ) ); } - sal_Bool bIsFirstWordInFirstPara = aESel.nEndPara == 0 && + bool bIsFirstWordInFirstPara = aESel.nEndPara == 0 && aFirstWordSel.Max().GetIndex() <= aSel.Max().GetIndex() && aSel.Max().GetIndex() <= aSecondWordSel.Min().GetIndex(); @@ -2533,17 +2533,17 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, sal_Unicode c, EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel, - sal_Unicode c, sal_Bool bOverwrite, sal_Bool bIsUserInput ) + sal_Unicode c, bool bOverwrite, bool bIsUserInput ) { OSL_ENSURE( c != '\t', "Tab for InsertText ?" ); OSL_ENSURE( c != '\n', "Word wrapping for InsertText ?"); EditPaM aPaM( rCurSel.Min() ); - sal_Bool bDoOverwrite = ( bOverwrite && + bool bDoOverwrite = ( bOverwrite && ( aPaM.GetIndex() < aPaM.GetNode()->Len() ) ) ? sal_True : sal_False; - sal_Bool bUndoAction = ( rCurSel.HasRange() || bDoOverwrite ); + bool bUndoAction = ( rCurSel.HasRange() || bDoOverwrite ); if ( bUndoAction ) UndoActionStart( EDITUNDO_INSERT ); @@ -2617,7 +2617,7 @@ EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel, if ( IsUndoEnabled() && !IsInUndo() ) { EditUndoInsertChars* pNewUndo = new EditUndoInsertChars(pEditEngine, CreateEPaM(aPaM), OUString(c)); - sal_Bool bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? sal_True : sal_False; + bool bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? sal_True : sal_False; InsertUndo( pNewUndo, bTryMerge ); } @@ -2914,7 +2914,7 @@ EditPaM ImpEditEngine::InsertField(const EditSelection& rCurSel, const SvxFieldI return ImpInsertFeature(rCurSel, rFld); } -sal_Bool ImpEditEngine::UpdateFields() +bool ImpEditEngine::UpdateFields() { bool bChanges = false; sal_Int32 nParas = GetEditDoc().Count(); @@ -2996,7 +2996,7 @@ Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, sal_uInt16 nFlags ) return aEditCursor; } -EditPaM ImpEditEngine::GetPaM( Point aDocPos, sal_Bool bSmart ) +EditPaM ImpEditEngine::GetPaM( Point aDocPos, bool bSmart ) { OSL_ENSURE( GetUpdateMode(), "Must not be reached when Update=FALSE: GetPaM" ); @@ -3044,7 +3044,7 @@ sal_uInt32 ImpEditEngine::GetTextHeight() const return nCurTextHeight; } -sal_uInt32 ImpEditEngine::CalcTextWidth( sal_Bool bIgnoreExtraSpace ) +sal_uInt32 ImpEditEngine::CalcTextWidth( bool bIgnoreExtraSpace ) { // If still not formatted and not in the process. // Will be brought in the formatting for AutoPageSize. @@ -3109,7 +3109,7 @@ sal_uInt32 ImpEditEngine::CalcTextWidth( sal_Bool bIgnoreExtraSpace ) return (sal_uInt32)nMaxWidth; } -sal_uInt32 ImpEditEngine::CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, sal_Bool bIgnoreExtraSpace ) +sal_uInt32 ImpEditEngine::CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, bool bIgnoreExtraSpace ) { sal_Int32 nPara = GetEditDoc().GetPos( pPortion->GetNode() ); @@ -3462,14 +3462,14 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable( return xDataObj; } -EditSelection ImpEditEngine::InsertText( uno::Reference< datatransfer::XTransferable >& rxDataObj, const OUString& rBaseURL, const EditPaM& rPaM, sal_Bool bUseSpecial ) +EditSelection ImpEditEngine::InsertText( uno::Reference< datatransfer::XTransferable >& rxDataObj, const OUString& rBaseURL, const EditPaM& rPaM, bool bUseSpecial ) { EditSelection aNewSelection( rPaM ); if ( rxDataObj.is() ) { datatransfer::DataFlavor aFlavor; - sal_Bool bDone = sal_False; + bool bDone = false; if ( bUseSpecial ) { @@ -3486,7 +3486,7 @@ EditSelection ImpEditEngine::InsertText( uno::Reference< datatransfer::XTransfer SvMemoryStream aBinStream( aSeq.getArray(), aSeq.getLength(), STREAM_READ ); aNewSelection = Read( aBinStream, rBaseURL, EE_FORMAT_BIN, rPaM ); } - bDone = sal_True; + bDone = true; } catch( const ::com::sun::star::uno::Exception& ) { @@ -3508,7 +3508,7 @@ EditSelection ImpEditEngine::InsertText( uno::Reference< datatransfer::XTransfer SvMemoryStream aRTFStream( aSeq.getArray(), aSeq.getLength(), STREAM_READ ); aNewSelection = Read( aRTFStream, rBaseURL, EE_FORMAT_RTF, rPaM ); } - bDone = sal_True; + bDone = true; } catch( const ::com::sun::star::uno::Exception& ) { @@ -3532,7 +3532,7 @@ EditSelection ImpEditEngine::InsertText( uno::Reference< datatransfer::XTransfer OUString aText; aData >>= aText; aNewSelection = ImpInsertText( rPaM, aText ); - bDone = sal_True; + bDone = true; } catch( ... ) { @@ -3613,7 +3613,7 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion ) return aRange; } -EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, sal_Bool bSmart ) +EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, bool bSmart ) { OSL_ENSURE( pPortion->IsVisible(), "Why GetPaM() for an invisible paragraph?" ); OSL_ENSURE( IsFormatted(), "GetPaM: Not formatted" ); @@ -3824,7 +3824,7 @@ long ImpEditEngine::GetPortionXOffset( } sal_Int32 nPara = GetEditDoc().GetPos( pParaPortion->GetNode() ); - sal_Bool bR2LPara = IsRightToLeft( nPara ); + bool bR2LPara = IsRightToLeft( nPara ); const TextPortion* pDestPortion = pParaPortion->GetTextPortions()[nTextPortion]; if ( pDestPortion->GetKind() != PORTIONKIND_TAB ) @@ -3898,12 +3898,12 @@ long ImpEditEngine::GetXPos( OSL_ENSURE( pLine, "No line received: GetXPos" ); OSL_ENSURE( ( nIndex >= pLine->GetStart() ) && ( nIndex <= pLine->GetEnd() ) , "GetXPos has to be called properly!" ); - sal_Bool bDoPreferPortionStart = bPreferPortionStart; + bool bDoPreferPortionStart = bPreferPortionStart; // Assure that the portion belongs to this line: if ( nIndex == pLine->GetStart() ) - bDoPreferPortionStart = sal_True; + bDoPreferPortionStart = true; else if ( nIndex == pLine->GetEnd() ) - bDoPreferPortionStart = sal_False; + bDoPreferPortionStart = false; sal_Int32 nTextPortionStart = 0; sal_Int32 nTextPortion = pParaPortion->GetTextPortions().FindPortion( nIndex, nTextPortionStart, bDoPreferPortionStart ); @@ -4145,7 +4145,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_Int32 nIndex, if (nLineCount == 0) return Rectangle(); const EditLine* pLine = NULL; - sal_Bool bEOL = ( nFlags & GETCRSR_ENDOFLINE ) ? sal_True : sal_False; + bool bEOL = ( nFlags & GETCRSR_ENDOFLINE ) ? sal_True : sal_False; for (sal_Int32 nLine = 0; nLine < nLineCount; ++nLine) { const EditLine* pTmpLine = pPortion->GetLines()[nLine]; @@ -4228,7 +4228,7 @@ void ImpEditEngine::SetValidPaperSize( const Size& rNewSz ) aPaperSize.Height() = nMaxHeight; } -void ImpEditEngine::IndentBlock( EditView* pEditView, sal_Bool bRight ) +void ImpEditEngine::IndentBlock( EditView* pEditView, bool bRight ) { ESelection aESel( CreateESel( pEditView->pImpEditView->GetEditSelection() ) ); aESel.Adjust(); @@ -4283,11 +4283,11 @@ void ImpEditEngine::IndentBlock( EditView* pEditView, sal_Bool bRight ) aNewSel.nEndPos = pLastNode->Len(); pEditView->pImpEditView->SetEditSelection( CreateSel( aNewSel ) ); pEditView->pImpEditView->DrawSelection(); - pEditView->pImpEditView->ShowCursor( sal_False, sal_True ); + pEditView->pImpEditView->ShowCursor( false, true ); } } -rtl::Reference<SvxForbiddenCharactersTable> ImpEditEngine::GetForbiddenCharsTable( sal_Bool bGetInternal ) const +rtl::Reference<SvxForbiddenCharactersTable> ImpEditEngine::GetForbiddenCharsTable( bool bGetInternal ) const { rtl::Reference<SvxForbiddenCharactersTable> xF = xForbiddenCharsTable; if ( !xF.is() && bGetInternal ) @@ -4308,23 +4308,23 @@ svtools::ColorConfig& ImpEditEngine::GetColorConfig() return *pColorConfig; } -sal_Bool ImpEditEngine::IsVisualCursorTravelingEnabled() +bool ImpEditEngine::IsVisualCursorTravelingEnabled() { - sal_Bool bVisualCursorTravaling = sal_False; + bool bVisualCursorTravaling = false; if( !pCTLOptions ) pCTLOptions = new SvtCTLOptions; if ( pCTLOptions->IsCTLFontEnabled() && ( pCTLOptions->GetCTLCursorMovement() == SvtCTLOptions::MOVEMENT_VISUAL ) ) { - bVisualCursorTravaling = sal_True; + bVisualCursorTravaling = true; } return bVisualCursorTravaling; } -sal_Bool ImpEditEngine::DoVisualCursorTraveling( const ContentNode* ) +bool ImpEditEngine::DoVisualCursorTraveling( const ContentNode* ) { // Don't check if it's necessary, because we also need it when leaving the paragraph return IsVisualCursorTravelingEnabled(); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 51fe1fa203bc..81026b4b4082 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -161,8 +161,8 @@ static void lcl_DrawRedLines( WrongList* pWrongs, short nOrientation, const Point& rOrigin, - sal_Bool bVertical, - sal_Bool bIsRightToLeft ) + bool bVertical, + bool bIsRightToLeft ) { // But only if font is not too small ... long nHght = pOutDev->LogicToPixel( Size( 0, nFontHeight ) ).Height(); @@ -292,7 +292,7 @@ void ImpEditEngine::UpdateViews( EditView* pCurView ) aClipRect = pView->pImpEditView->GetWindowPos( aClipRect ); if ( pView == pCurView ) - Paint( pView->pImpEditView, aClipRect, 0, sal_True ); + Paint( pView->pImpEditView, aClipRect, 0, true ); else pView->GetWindow()->Invalidate( aClipRect ); } @@ -300,7 +300,7 @@ void ImpEditEngine::UpdateViews( EditView* pCurView ) if ( pCurView ) { - sal_Bool bGotoCursor = pCurView->pImpEditView->DoAutoScroll(); + bool bGotoCursor = pCurView->pImpEditView->DoAutoScroll(); pCurView->ShowCursor( bGotoCursor ); } @@ -382,7 +382,7 @@ void ImpEditEngine::FormatDoc() { if ( pParaPortion->IsInvalid() ) { - sal_Bool bChangedByDerivedClass = GetEditEnginePtr()->FormattingParagraph( nPara ); + bool bChangedByDerivedClass = GetEditEnginePtr()->FormattingParagraph( nPara ); if ( bChangedByDerivedClass ) { pParaPortion->GetTextPortions().Reset(); @@ -406,7 +406,7 @@ void ImpEditEngine::FormatDoc() bGrow = true; if ( IsCallParaInsertedOrDeleted() ) GetEditEnginePtr()->ParagraphHeightChanged( nPara ); - pParaPortion->SetMustRepaint( sal_False ); + pParaPortion->SetMustRepaint( false ); } // InvalidRect set only once... @@ -517,9 +517,9 @@ void ImpEditEngine::CheckAutoPageSize() { Size aPrevPaperSize( GetPaperSize() ); if ( GetStatus().AutoPageWidth() ) - aPaperSize.Width() = !IsVertical() ? CalcTextWidth( sal_True ) : GetTextHeight(); + aPaperSize.Width() = !IsVertical() ? CalcTextWidth( true ) : GetTextHeight(); if ( GetStatus().AutoPageHeight() ) - aPaperSize.Height() = !IsVertical() ? GetTextHeight() : CalcTextWidth( sal_True ); + aPaperSize.Height() = !IsVertical() ? GetTextHeight() : CalcTextWidth( true ); SetValidPaperSize( aPaperSize ); // consider Min, Max @@ -573,7 +573,7 @@ static sal_Int32 ImplCalculateFontIndependentLineSpacing( const sal_Int32 nFontH return ( nFontHeight * 12 ) / 10; // + 20% } -sal_Bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) +bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) { ParaPortion* pParaPortion = GetParaPortions()[nPara]; @@ -617,16 +617,16 @@ sal_Bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) ContentNode* const pNode = pParaPortion->GetNode(); - sal_Bool bRightToLeftPara = IsRightToLeft( nPara ); + bool bRightToLeftPara = IsRightToLeft( nPara ); SvxAdjust eJustification = GetJustification( nPara ); - sal_Bool bHyphenatePara = ((const SfxBoolItem&)pNode->GetContentAttribs().GetItem( EE_PARA_HYPHENATE )).GetValue(); + bool bHyphenatePara = ((const SfxBoolItem&)pNode->GetContentAttribs().GetItem( EE_PARA_HYPHENATE )).GetValue(); sal_Int32 nSpaceBefore = 0; sal_Int32 nMinLabelWidth = 0; sal_Int32 nSpaceBeforeAndMinLabelWidth = GetSpaceBeforeAndMinLabelWidth( pNode, &nSpaceBefore, &nMinLabelWidth ); const SvxLRSpaceItem& rLRItem = GetLRSpaceItem( pNode ); const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&) pNode->GetContentAttribs().GetItem( EE_PARA_SBL ); - const sal_Bool bScriptSpace = ((const SvxScriptSpaceItem&) pNode->GetContentAttribs().GetItem( EE_PARA_ASIANCJKSPACING )).GetValue(); + const bool bScriptSpace = ((const SvxScriptSpaceItem&) pNode->GetContentAttribs().GetItem( EE_PARA_ASIANCJKSPACING )).GetValue(); const short nInvalidDiff = pParaPortion->GetInvalidDiff(); const sal_Int32 nInvalidStart = pParaPortion->GetInvalidPosStart(); @@ -732,10 +732,10 @@ sal_Bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) EditLine aSaveLine( *pLine ); SvxFont aTmpFont( pNode->GetCharAttribs().GetDefFont() ); - sal_Bool bCalcCharPositions = sal_True; + bool bCalcCharPositions = true; boost::scoped_array<sal_Int32> pBuf(new sal_Int32[ pNode->Len() ]); - sal_Bool bSameLineAgain = sal_False; // For TextRanger, if the height changes. + bool bSameLineAgain = false; // For TextRanger, if the height changes. TabInfo aCurrentTab; bool bForceOneRun = bEmptyNodeWithPolygon; @@ -1309,11 +1309,11 @@ sal_Bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) pLine->SetHeight( nLineHeight ); pLine->SetMaxAscent( aFormatterMetrics.nMaxAscent ); - bSameLineAgain = sal_False; + bSameLineAgain = false; if ( GetTextRanger() && ( pLine->GetHeight() > nTextLineHeight ) ) { // put down with the other size! - bSameLineAgain = sal_True; + bSameLineAgain = true; } @@ -1484,7 +1484,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) pLine->SetValid(); if ( bCalcCharPositions && bQuickFormat ) { - bCalcCharPositions = sal_False; + bCalcCharPositions = false; bLineBreak = false; pParaPortion->CorrectValuesBehindLastFormattedLine( nLine ); break; @@ -1498,7 +1498,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) // then the text width does not have to be determined anew: if ( nEnd == ( aSaveLine.GetEnd() + nInvalidDiff ) ) { - bCalcCharPositions = sal_False; + bCalcCharPositions = false; bLineBreak = false; pParaPortion->CorrectValuesBehindLastFormattedLine( nLine ); break; @@ -1563,7 +1563,7 @@ sal_Bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) pBuf.reset(); - sal_Bool bHeightChanged = FinishCreateLines( pParaPortion ); + bool bHeightChanged = FinishCreateLines( pParaPortion ); if ( bMapChanged ) GetRefDevice()->Pop(); @@ -1716,7 +1716,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn } } -sal_Bool ImpEditEngine::FinishCreateLines( ParaPortion* pParaPortion ) +bool ImpEditEngine::FinishCreateLines( ParaPortion* pParaPortion ) { // CalcCharPositions( pParaPortion ); pParaPortion->SetValid(); @@ -1724,11 +1724,11 @@ sal_Bool ImpEditEngine::FinishCreateLines( ParaPortion* pParaPortion ) CalcHeight( pParaPortion ); DBG_ASSERT( pParaPortion->GetTextPortions().Count(), "FinishCreateLines: No Text-Portion?" ); - sal_Bool bRet = ( pParaPortion->GetHeight() != nOldHeight ); + bool bRet = ( pParaPortion->GetHeight() != nOldHeight ); return bRet; } -void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, TextPortion* pPortion, sal_Int32 nPortionStart, long nRemainingWidth, sal_Bool bCanHyphenate ) +void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, TextPortion* pPortion, sal_Int32 nPortionStart, long nRemainingWidth, bool bCanHyphenate ) { ContentNode* const pNode = pParaPortion->GetNode(); @@ -1740,20 +1740,20 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te sal_Int32 nMaxBreakPos = nBreakInLine + pLine->GetStart(); sal_Int32 nBreakPos = SAL_MAX_INT32; - sal_Bool bCompressBlank = sal_False; - sal_Bool bHyphenated = sal_False; - sal_Bool bHangingPunctuation = sal_False; + bool bCompressBlank = false; + bool bHyphenated = false; + bool bHangingPunctuation = false; sal_Unicode cAlternateReplChar = 0; sal_Unicode cAlternateExtraChar = 0; - sal_Bool bAltFullLeft = sal_False; - sal_Bool bAltFullRight = sal_False; + bool bAltFullLeft = false; + bool bAltFullRight = false; sal_uInt32 nAltDelChar = 0; if ( ( nMaxBreakPos < ( nMax + pLine->GetStart() ) ) && ( pNode->GetChar( nMaxBreakPos ) == ' ' ) ) { // Break behind the blank, blank will be compressed... nBreakPos = nMaxBreakPos + 1; - bCompressBlank = sal_True; + bCompressBlank = true; } else { @@ -1840,14 +1840,14 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te xHyphWord = xHyphenator->hyphenate( aWord, aLocale, aWord.getLength() - nMinTrail, Sequence< PropertyValue >() ); if (xHyphWord.is()) { - sal_Bool bAlternate = xHyphWord->isAlternativeSpelling(); + bool bAlternate = xHyphWord->isAlternativeSpelling(); sal_Int32 _nWordLen = 1 + xHyphWord->getHyphenPos(); if ( ( _nWordLen >= 2 ) && ( (nWordStart+_nWordLen) >= (pLine->GetStart() + 2 ) ) ) { if ( !bAlternate ) { - bHyphenated = sal_True; + bHyphenated = true; nBreakPos = nWordStart + _nWordLen; } else @@ -1859,7 +1859,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te OUString aAltRight(aAlt.copy(_nWordLen)); bAltFullLeft = aWord2.startsWith(aAltLeft); bAltFullRight = aWord2.endsWith(aAltRight); - nAltDelChar = aWord2.getLength() - aAlt.getLength() + (1 - bAltFullLeft) + (1 - bAltFullRight); + nAltDelChar = aWord2.getLength() - aAlt.getLength() + static_cast<int>(!bAltFullLeft) + static_cast<int>(!bAltFullRight); // NOTE: improved for other cases, see fdo#63711 @@ -1905,7 +1905,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te else cAlternateExtraChar = aAlt[nAltStart]; - bHyphenated = sal_True; + bHyphenated = true; nBreakPos = nWordStart + nTxtStart; if ( cAlternateReplChar || aAlt.getLength() < aWord2.getLength() || !bAltFullRight) // also for "oma-tje", "re-eel" nBreakPos++; @@ -1937,7 +1937,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te // Don't check for SVX_ADJUST_LEFT, doesn't matter to compress in this case too... DBG_ASSERT( nBreakPos > pLine->GetStart(), "ImpBreakLines - BreakPos not expected!" ); if ( pNode->GetChar( nBreakPos-1 ) == ' ' ) - bCompressBlank = sal_True; + bCompressBlank = true; } if ( bCompressBlank || bHangingPunctuation ) @@ -2516,12 +2516,12 @@ void ImpEditEngine::SetTextRanger( TextRanger* pRanger ) } } -void ImpEditEngine::SetVertical( sal_Bool bVertical ) +void ImpEditEngine::SetVertical( bool bVertical ) { if ( IsVertical() != bVertical ) { GetEditDoc().SetVertical( bVertical ); - sal_Bool bUseCharAttribs = ( aStatus.GetControlWord() & EE_CNTRL_USECHARATTRIBS ) ? sal_True : sal_False; + bool bUseCharAttribs = ( aStatus.GetControlWord() & EE_CNTRL_USECHARATTRIBS ) ? sal_True : sal_False; GetEditDoc().CreateDefFont( bUseCharAttribs ); if ( IsFormatted() ) { @@ -2531,7 +2531,7 @@ void ImpEditEngine::SetVertical( sal_Bool bVertical ) } } -void ImpEditEngine::SetFixedCellHeight( sal_Bool bUseFixedCellHeight ) +void ImpEditEngine::SetFixedCellHeight( bool bUseFixedCellHeight ) { if ( IsFixedCellHeight() != bUseFixedCellHeight ) { @@ -2831,7 +2831,7 @@ void ImpEditEngine::RecalcFormatterFontMetrics( FormatterFontMetric& rCurMetrics } } -void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aStartPos, sal_Bool bStripOnly, short nOrientation ) +void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aStartPos, bool bStripOnly, short nOrientation ) { if ( !GetUpdateMode() && !bStripOnly ) return; @@ -3640,7 +3640,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt pOutDev->SetFont( aOldFont ); } -void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRect, OutputDevice* pTargetDevice, sal_Bool bUseVirtDev ) +void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRect, OutputDevice* pTargetDevice, bool bUseVirtDev ) { DBG_ASSERT( pView, "No View - No Paint!" ); @@ -3701,7 +3701,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRect, OutputDev pVDev->SetBackground( aBackgroundColor ); } - sal_Bool bVDevValid = sal_True; + bool bVDevValid = true; Size aOutSz( pVDev->GetOutputSizePixel() ); if ( ( aOutSz.Width() < aClipRecPixel.GetWidth() ) || ( aOutSz.Height() < aClipRecPixel.GetHeight() ) ) @@ -3725,7 +3725,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRect, OutputDev DBG_ASSERT( bVDevValid, "VDef could not be enlarged!" ); if ( !bVDevValid ) { - Paint( pView, rRect, 0, sal_False /* ohne VDev */ ); + Paint( pView, rRect, 0, false /* ohne VDev */ ); return; } @@ -3752,7 +3752,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRect, OutputDev Paint( pVDev, aTmpRect, aStartPos ); - sal_Bool bClipRegion = sal_False; + bool bClipRegion = false; Region aOldRegion; MapMode aOldMapMode; if ( GetTextRanger() ) @@ -3820,7 +3820,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRect, OutputDev aClipRect.Right() = nMaxX; } - sal_Bool bClipRegion = pTarget->IsClipRegion(); + bool bClipRegion = pTarget->IsClipRegion(); Region aOldRegion = pTarget->GetClipRegion(); pTarget->IntersectClipRegion( aClipRect ); @@ -3857,7 +3857,7 @@ EditPaM ImpEditEngine::SplitContent( sal_Int32 nNode, sal_Int32 nSepPos ) return ImpInsertParaBreak( aPaM ); } -EditPaM ImpEditEngine::ConnectContents( sal_Int32 nLeftNode, sal_Bool bBackward ) +EditPaM ImpEditEngine::ConnectContents( sal_Int32 nLeftNode, bool bBackward ) { ContentNode* pLeftNode = aEditDoc.GetObject( nLeftNode ); ContentNode* pRightNode = aEditDoc.GetObject( nLeftNode+1 ); @@ -3867,7 +3867,7 @@ EditPaM ImpEditEngine::ConnectContents( sal_Int32 nLeftNode, sal_Bool bBackward return ImpConnectParagraphs( pLeftNode, pRightNode, bBackward ); } -void ImpEditEngine::SetUpdateMode( bool bUp, EditView* pCurView, sal_Bool bForceUpdate ) +void ImpEditEngine::SetUpdateMode( bool bUp, EditView* pCurView, bool bForceUpdate ) { bool bChanged = ( GetUpdateMode() != bUp ); @@ -3924,7 +3924,7 @@ void ImpEditEngine::ShowParagraph( sal_Int32 nParagraph, bool bShow ) } } - pPPortion->SetMustRepaint( sal_True ); + pPPortion->SetMustRepaint( true ); if ( GetUpdateMode() && !IsInUndo() && !GetTextRanger() ) { aInvalidRect = Rectangle( Point( 0, GetParaPortions().GetYOffset( pPPortion ) ), @@ -4149,7 +4149,7 @@ void ImpEditEngine::FormatAndUpdate( EditView* pCurView ) } } -void ImpEditEngine::SetFlatMode( sal_Bool bFlat ) +void ImpEditEngine::SetFlatMode( bool bFlat ) { if ( bFlat != aStatus.UseCharAttribs() ) return; @@ -4291,8 +4291,8 @@ void ImpEditEngine::ImplInitDigitMode(OutputDevice* pOutDev, LanguageType eCurLa void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara, sal_Int32 nIndex ) { - sal_Bool bCTL = sal_False; - sal_Bool bR2L = sal_False; + bool bCTL = false; + bool bR2L = false; if ( nIndex == -1 ) { bCTL = HasScriptType( nPara, i18n::ScriptType::COMPLEX ); @@ -4374,7 +4374,7 @@ Color ImpEditEngine::GetAutoColor() const bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode, TextPortion* pTextPortion, sal_Int32 nStartPos, sal_Int32* pDXArray, - sal_uInt16 n100thPercentFromMax, sal_Bool bManipulateDXArray) + sal_uInt16 n100thPercentFromMax, bool bManipulateDXArray) { DBG_ASSERT( GetAsianCompressionMode(), "ImplCalcAsianCompression - Why?" ); DBG_ASSERT( pTextPortion->GetLen(), "ImplCalcAsianCompression - Empty Portion?" ); @@ -4393,8 +4393,8 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode, { sal_uInt8 nType = GetCharTypeForCompression( pNode->GetChar( n+nStartPos ) ); - sal_Bool bCompressPunctuation = ( nType == CHAR_PUNCTUATIONLEFT ) || ( nType == CHAR_PUNCTUATIONRIGHT ); - sal_Bool bCompressKana = ( nType == CHAR_KANA ) && ( GetAsianCompressionMode() == text::CharacterCompressionType::PUNCTUATION_AND_KANA ); + bool bCompressPunctuation = ( nType == CHAR_PUNCTUATIONLEFT ) || ( nType == CHAR_PUNCTUATIONRIGHT ); + bool bCompressKana = ( nType == CHAR_KANA ) && ( GetAsianCompressionMode() == text::CharacterCompressionType::PUNCTUATION_AND_KANA ); // create Extra infos only if needed... if ( bCompressPunctuation || bCompressKana ) @@ -4444,7 +4444,7 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode, { bCompressed = true; nNewPortionWidth -= nCompress; - pTextPortion->GetExtraInfos()->bCompressed = sal_True; + pTextPortion->GetExtraInfos()->bCompressed = true; // Special handling for rightpunctuation: For the 'compression' we must @@ -4465,7 +4465,7 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode, } else { - pTextPortion->GetExtraInfos()->bFirstCharIsRightPunktuation = sal_True; + pTextPortion->GetExtraInfos()->bFirstCharIsRightPunktuation = true; pTextPortion->GetExtraInfos()->nPortionOffsetX = -nCompress; } } @@ -4502,7 +4502,7 @@ bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode, void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, long nRemainingWidth ) { - sal_Bool bFoundCompressedPortion = sal_False; + bool bFoundCompressedPortion = false; long nCompressed = 0; std::vector<TextPortion*> aCompressedPortions; @@ -4512,7 +4512,7 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* { if ( pTP->GetExtraInfos() && pTP->GetExtraInfos()->bCompressed ) { - bFoundCompressedPortion = sal_True; + bFoundCompressedPortion = true; nCompressed += pTP->GetExtraInfos()->nOrgWidth - pTP->GetSize().Width(); aCompressedPortions.push_back(pTP); } @@ -4533,7 +4533,7 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* for (size_t i = 0, n = aCompressedPortions.size(); i < n; ++i) { pTP = aCompressedPortions[i]; - pTP->GetExtraInfos()->bCompressed = sal_False; + pTP->GetExtraInfos()->bCompressed = false; pTP->GetSize().Width() = pTP->GetExtraInfos()->nOrgWidth; if ( nCompressPercent ) { @@ -4545,7 +4545,7 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pDXArray = &pLine->GetCharPosArray()[0]+( nTxtPortionStart-pLine->GetStart() ); if ( pTP->GetExtraInfos()->pOrgDXArray ) memcpy( pDXArray, pTP->GetExtraInfos()->pOrgDXArray, (pTP->GetLen()-1)*sizeof(sal_Int32) ); - ImplCalcAsianCompression( pParaPortion->GetNode(), pTP, nTxtPortionStart, pDXArray, (sal_uInt16)nCompressPercent, sal_True ); + ImplCalcAsianCompression( pParaPortion->GetNode(), pTP, nTxtPortionStart, pDXArray, (sal_uInt16)nCompressPercent, true ); } } } diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 86058772bc1e..138c888f0aa9 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -89,7 +89,7 @@ using namespace ::com::sun::star::linguistic2; EditPaM ImpEditEngine::Read( SvStream& rInput, const OUString& rBaseURL, EETextFormat eFormat, EditSelection aSel, SvKeyValueIterator* pHTTPHeaderAttrs ) { - sal_Bool _bUpdate = GetUpdateMode(); + bool _bUpdate = GetUpdateMode(); SetUpdateMode( false ); EditPaM aPaM; if ( eFormat == EE_FORMAT_TEXT ) @@ -228,7 +228,7 @@ void ImpEditEngine::Write( SvStream& rOutput, EETextFormat eFormat, EditSelectio sal_uInt32 ImpEditEngine::WriteText( SvStream& rOutput, EditSelection aSel ) { sal_Int32 nStartNode, nEndNode; - sal_Bool bRange = aSel.HasRange(); + bool bRange = aSel.HasRange(); if ( bRange ) { aSel.Adjust( aEditDoc ); @@ -263,7 +263,7 @@ sal_uInt32 ImpEditEngine::WriteText( SvStream& rOutput, EditSelection aSel ) return rOutput.GetError(); } -sal_Bool ImpEditEngine::WriteItemListAsRTF( ItemList& rLst, SvStream& rOutput, sal_Int32 nPara, sal_Int32 nPos, +bool ImpEditEngine::WriteItemListAsRTF( ItemList& rLst, SvStream& rOutput, sal_Int32 nPara, sal_Int32 nPos, std::vector<SvxFontItem*>& rFontTable, SvxColorList& rColorList ) { const SfxPoolItem* pAttrItem = rLst.First(); @@ -542,7 +542,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) DBG_ASSERT( pNode, "Node not found: Search&Replace" ); // The paragraph attributes in advance ... - sal_Bool bAttr = sal_False; + bool bAttr = false; // Template? if ( pNode->GetStyleSheet() ) @@ -560,7 +560,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) { const SfxPoolItem& rItem = pNode->GetStyleSheet()->GetItemSet().Get( nParAttr ); WriteItemAsRTF( rItem, rOutput, nNode, 0, aFontTable, aColorList ); - bAttr = sal_True; + bAttr = true; } } } @@ -572,7 +572,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) { const SfxPoolItem& rItem = pNode->GetContentAttribs().GetItems().Get( nParAttr ); WriteItemAsRTF( rItem, rOutput, nNode, 0, aFontTable, aColorList ); - bAttr = sal_True; + bAttr = true; } } if ( bAttr ) @@ -587,7 +587,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) sal_Int32 nEndPos = pNode->Len(); sal_Int32 nStartPortion = 0; sal_Int32 nEndPortion = pParaPortion->GetTextPortions().Count() - 1; - sal_Bool bFinishPortion = sal_False; + bool bFinishPortion = false; sal_Int32 nPortionStart; if ( nNode == nStartNode ) @@ -603,7 +603,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) // These attributes may not apply to the entire paragraph: rOutput.WriteChar( '{' ); WriteItemListAsRTF( aAttribItems, rOutput, nNode, nStartPos, aFontTable, aColorList ); - bFinishPortion = sal_True; + bFinishPortion = true; } aAttribItems.Clear(); } @@ -664,7 +664,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) if ( bFinishPortion ) { rOutput.WriteChar( '}' ); - bFinishPortion = sal_False; + bFinishPortion = false; } nIndex = nIndex + pTextPortion->GetLen(); @@ -1006,7 +1006,7 @@ EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel ) return CreateTextObject( aSel, GetEditTextObjectPool(), aStatus.AllowBigObjects(), nBigTextObjectStart ); } -EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel, SfxItemPool* pPool, sal_Bool bAllowBigObjects, sal_Int32 nBigObjectStart ) +EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel, SfxItemPool* pPool, bool bAllowBigObjects, sal_Int32 nBigObjectStart ) { EditTextObject* pTxtObj = new EditTextObject(pPool); pTxtObj->SetVertical( IsVertical() ); @@ -1022,7 +1022,7 @@ EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel, SfxItemPool nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); - sal_Bool bOnlyFullParagraphs = ( aSel.Min().GetIndex() || + bool bOnlyFullParagraphs = ( aSel.Min().GetIndex() || ( aSel.Max().GetIndex() < aSel.Max().GetNode()->Len() ) ) ? sal_False : sal_True; @@ -1046,7 +1046,7 @@ EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel, SfxItemPool sal_Int32 nStartPos = 0; sal_Int32 nEndPos = pNode->Len(); - sal_Bool bEmptyPara = nEndPos ? sal_False : sal_True; + bool bEmptyPara = nEndPos ? sal_False : sal_True; if ( ( nNode == nStartNode ) && !bOnlyFullParagraphs ) nStartPos = aSel.Min().GetIndex(); @@ -1158,8 +1158,8 @@ void ImpEditEngine::SetText( const EditTextObject& rTextObject ) { // Since setting a text object is not undo-able! ResetUndoManager(); - sal_Bool _bUpdate = GetUpdateMode(); - sal_Bool _bUndo = IsUndoEnabled(); + bool _bUpdate = GetUpdateMode(); + bool _bUndo = IsUndoEnabled(); SetText( OUString() ); EditPaM aPaM = aEditDoc.GetStartPaM(); @@ -1192,7 +1192,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject EditSelection aSel( aPaM, aPaM ); DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "InsertBibTextObject: Selection broken!(1)" ); - sal_Bool bUsePortionInfo = sal_False; + bool bUsePortionInfo = false; XParaPortionList* pPortionInfo = rTextObject.mpImpl->GetPortionInfo(); if ( pPortionInfo && ( (long)pPortionInfo->GetPaperWidth() == aPaperSize.Width() ) @@ -1203,17 +1203,17 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject if ( ( pPortionInfo->GetRefDevPtr() == (sal_uIntPtr)GetRefDevice() ) || ( ( pPortionInfo->GetRefDevType() == OUTDEV_VIRDEV ) && ( GetRefDevice()->GetOutDevType() == OUTDEV_VIRDEV ) ) ) - bUsePortionInfo = sal_True; + bUsePortionInfo = true; } - sal_Bool bConvertItems = sal_False; + bool bConvertItems = false; MapUnit eSourceUnit = MapUnit(), eDestUnit = MapUnit(); if (rTextObject.mpImpl->HasMetric()) { eSourceUnit = (MapUnit)rTextObject.mpImpl->GetMetric(); eDestUnit = (MapUnit)aEditDoc.GetItemPool().GetMetric( DEF_METRIC ); if ( eSourceUnit != eDestUnit ) - bConvertItems = sal_True; + bConvertItems = true; } // Before, paragraph count was of type sal_uInt16 so if nContents exceeded @@ -1226,7 +1226,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject for (sal_Int32 n = 0; n < nContents; ++n, ++nPara) { const ContentInfo* pC = &rTextObject.mpImpl->GetContents()[n]; - sal_Bool bNewContent = aPaM.GetNode()->Len() ? sal_False: sal_True; + bool bNewContent = aPaM.GetNode()->Len() ? sal_False: sal_True; const sal_Int32 nStartPos = aPaM.GetIndex(); aPaM = ImpFastInsertText( aPaM, pC->GetText() ); @@ -1236,11 +1236,11 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject pPortion->MarkInvalid( nStartPos, pC->GetText().getLength() ); // Character attributes ... - sal_Bool bAllreadyHasAttribs = aPaM.GetNode()->GetCharAttribs().Count() ? sal_True : sal_False; + bool bAllreadyHasAttribs = aPaM.GetNode()->GetCharAttribs().Count() ? sal_True : sal_False; size_t nNewAttribs = pC->GetAttribs().size(); if ( nNewAttribs ) { - sal_Bool bUpdateFields = sal_False; + bool bUpdateFields = false; for (size_t nAttr = 0; nAttr < nNewAttribs; ++nAttr) { const XEditAttribute& rX = pC->GetAttribs()[nAttr]; @@ -1267,7 +1267,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject DBG_ASSERT( pAttr->GetEnd() <= aPaM.GetNode()->Len(), "InsertBinTextObject: Attribute does not fit! (1)" ); aPaM.GetNode()->GetCharAttribs().InsertAttrib( pAttr ); if ( pAttr->Which() == EE_FEATURE_FIELD ) - bUpdateFields = sal_True; + bUpdateFields = true; } else { @@ -1286,10 +1286,10 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject DBG_ASSERT( CheckOrderedList( aPaM.GetNode()->GetCharAttribs().GetAttribs(), true ), "InsertBinTextObject: Start-Liste distorted" ); - sal_Bool bParaAttribs = sal_False; + bool bParaAttribs = false; if ( bNewContent || ( ( n > 0 ) && ( n < (nContents-1) ) ) ) { - bParaAttribs = sal_False; + bParaAttribs = false; { // only style and ParaAttribs when new paragraph, or // completely internal ... @@ -1316,7 +1316,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject DBG_ASSERT( pParaPortion, "InsertBinTextObject: ParaPortion?" ); pParaPortion->nHeight = rXP.nHeight; pParaPortion->nFirstLineOffset = rXP.nFirstLineOffset; - pParaPortion->bForceRepaint = sal_True; + pParaPortion->bForceRepaint = true; pParaPortion->SetValid(); // Do not format // The Text Portions @@ -1456,7 +1456,7 @@ SpellInfo * ImpEditEngine::CreateSpellInfo( bool bMultipleDocs ) } -EESpellState ImpEditEngine::Spell( EditView* pEditView, sal_Bool bMultipleDoc ) +EESpellState ImpEditEngine::Spell( EditView* pEditView, bool bMultipleDoc ) { DBG_ASSERTWARNING( xSpeller.is(), "No Spell checker set!" ); @@ -1474,11 +1474,11 @@ EESpellState ImpEditEngine::Spell( EditView* pEditView, sal_Bool bMultipleDoc ) EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() ); pSpellInfo = CreateSpellInfo( bMultipleDoc ); - sal_Bool bIsStart = sal_False; + bool bIsStart = false; if ( bMultipleDoc ) - bIsStart = sal_True; // Accessible from the front or from behind ... + bIsStart = true; // Accessible from the front or from behind ... else if ( ( CreateEPaM( aEditDoc.GetStartPaM() ) == pSpellInfo->aSpellStart ) ) - bIsStart = sal_True; + bIsStart = true; EditSpellWrapper* pWrp = new EditSpellWrapper( Application::GetDefDialogParent(), xSpeller, bIsStart, false, pEditView ); @@ -1502,9 +1502,9 @@ EESpellState ImpEditEngine::Spell( EditView* pEditView, sal_Bool bMultipleDoc ) } -sal_Bool ImpEditEngine::HasConvertibleTextPortion( LanguageType nSrcLang ) +bool ImpEditEngine::HasConvertibleTextPortion( LanguageType nSrcLang ) { - sal_Bool bHasConvTxt = sal_False; + bool bHasConvTxt = false; sal_Int32 nParas = pEditEngine->GetParagraphCount(); for (sal_Int32 k = 0; k < nParas; ++k) @@ -1716,7 +1716,7 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, #ifdef DEBUG lang::Locale aLocale( LanguageTag::convertToLocale( nLangFound ) ); #endif - sal_Bool bLangOk = (nLangFound == nSrcLang) || + bool bLangOk = (nLangFound == nSrcLang) || (editeng::HangulHanjaConversion::IsChinese( nLangFound ) && editeng::HangulHanjaConversion::IsChinese( nSrcLang )); @@ -1748,7 +1748,7 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, // check script type to the right of the start of the current portion EditPaM aPaM( CreateEditPaM( EPaM(aCurStart.nPara, nLangIdx) ) ); - sal_Bool bIsAsianScript = (i18n::ScriptType::ASIAN == GetI18NScriptType( aPaM )); + bool bIsAsianScript = (i18n::ScriptType::ASIAN == GetI18NScriptType( aPaM )); // not yet processed text part with for conversion // not suitable language found that needs to be changed? if (bAllowImplicitChangesForNotConvertibleText && @@ -1894,7 +1894,7 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView ) return xSpellAlt; } -void ImpEditEngine::StartSpelling(EditView& rEditView, sal_Bool bMultipleDoc) +void ImpEditEngine::StartSpelling(EditView& rEditView, bool bMultipleDoc) { DBG_ASSERT(!pSpellInfo, "pSpellInfo already set?"); rEditView.pImpEditView->SetEditSelection( aEditDoc.GetStartPaM() ); @@ -2537,7 +2537,7 @@ sal_Int32 ImpEditEngine::StartSearchAndReplace( EditView* pEditView, const SvxSe aCurSel.Adjust( aEditDoc ); EditPaM aStartPaM = aTmpItem.GetSelection() ? aCurSel.Min() : aEditDoc.GetStartPaM(); EditSelection aFoundSel( aCurSel.Max() ); - sal_Bool bFound = ImpSearch( aTmpItem, aCurSel, aStartPaM, aFoundSel ); + bool bFound = ImpSearch( aTmpItem, aCurSel, aStartPaM, aFoundSel ); if ( bFound ) UndoActionStart( EDITUNDO_REPLACEALL ); while ( bFound ) @@ -2564,7 +2564,7 @@ sal_Int32 ImpEditEngine::StartSearchAndReplace( EditView* pEditView, const SvxSe return nFound; } -sal_Bool ImpEditEngine::Search( const SvxSearchItem& rSearchItem, EditView* pEditView ) +bool ImpEditEngine::Search( const SvxSearchItem& rSearchItem, EditView* pEditView ) { EditSelection aSel( pEditView->pImpEditView->GetEditSelection() ); aSel.Adjust( aEditDoc ); @@ -2573,7 +2573,7 @@ sal_Bool ImpEditEngine::Search( const SvxSearchItem& rSearchItem, EditView* pEdi aStartPaM = aSel.Min(); EditSelection aFoundSel; - sal_Bool bFound = ImpSearch( rSearchItem, aSel, aStartPaM, aFoundSel ); + bool bFound = ImpSearch( rSearchItem, aSel, aStartPaM, aFoundSel ); if ( bFound && ( aFoundSel == aSel ) ) // For backwards-search { aStartPaM = aSel.Min(); @@ -2596,14 +2596,14 @@ sal_Bool ImpEditEngine::Search( const SvxSearchItem& rSearchItem, EditView* pEdi return bFound; } -sal_Bool ImpEditEngine::ImpSearch( const SvxSearchItem& rSearchItem, +bool ImpEditEngine::ImpSearch( const SvxSearchItem& rSearchItem, const EditSelection& rSearchSelection, const EditPaM& rStartPos, EditSelection& rFoundSel ) { util::SearchOptions aSearchOptions( rSearchItem.GetSearchOptions() ); aSearchOptions.Locale = GetLocale( rStartPos ); - sal_Bool bBack = rSearchItem.GetBackward(); - sal_Bool bSearchInSelection = rSearchItem.GetSelection(); + bool bBack = rSearchItem.GetBackward(); + bool bSearchInSelection = rSearchItem.GetSelection(); sal_Int32 nStartNode = aEditDoc.GetPos( rStartPos.GetNode() ); sal_Int32 nEndNode; if ( bSearchInSelection ) @@ -2624,7 +2624,7 @@ sal_Bool ImpEditEngine::ImpSearch( const SvxSearchItem& rSearchItem, { // For backwards-search if nEndNode = 0: if ( nNode < 0 ) - return sal_False; + return false; ContentNode* pNode = aEditDoc.GetObject( nNode ); @@ -2667,13 +2667,13 @@ sal_Bool ImpEditEngine::ImpSearch( const SvxSearchItem& rSearchItem, rFoundSel.Min().SetIndex( nStartPos ); rFoundSel.Max().SetNode( pNode ); rFoundSel.Max().SetIndex( nEndPos ); - return sal_True; + return true; } } - return sal_False; + return false; } -sal_Bool ImpEditEngine::HasText( const SvxSearchItem& rSearchItem ) +bool ImpEditEngine::HasText( const SvxSearchItem& rSearchItem ) { SvxSearchItem aTmpItem( rSearchItem ); aTmpItem.SetBackward( false ); @@ -2721,12 +2721,12 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, const sal_Int32 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); const sal_Int32 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); - sal_Bool bChanges = sal_False; - sal_Bool bLenChanged = sal_False; + bool bChanges = false; + bool bLenChanged = false; EditUndoTransliteration* pUndo = NULL; utl::TransliterationWrapper aTranslitarationWrapper( ::comphelper::getProcessComponentContext(), nTransliterationMode ); - sal_Bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode(); + bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode(); for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { @@ -2978,9 +2978,9 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, { eeTransliterationChgData& rData = aChanges[ aChanges.size() - 1 - i ]; - bChanges = sal_True; + bChanges = true; if (rData.nLen != rData.aNewText.getLength()) - bLenChanged = sal_True; + bLenChanged = true; // Change text without loosing the attributes const sal_Int32 nDiffs = @@ -3010,7 +3010,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, if ( bChanges ) { TextModified(); - SetModifyFlag( sal_True ); + SetModifyFlag( true ); if ( bLenChanged ) UpdateSelections(); FormatAndUpdate(); diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index 37996a43a0a3..fe9cf60359e5 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -54,7 +54,7 @@ void ImpEditEngine::SetStyleSheet( EditSelection aSel, SfxStyleSheet* pStyle ) sal_Int32 nStartPara = aEditDoc.GetPos( aSel.Min().GetNode() ); sal_Int32 nEndPara = aEditDoc.GetPos( aSel.Max().GetNode() ); - sal_Bool _bUpdate = GetUpdateMode(); + bool _bUpdate = GetUpdateMode(); SetUpdateMode( false ); for ( sal_Int32 n = nStartPara; n <= nEndPara; n++ ) @@ -101,17 +101,17 @@ void ImpEditEngine::UpdateParagraphsWithStyleSheet( SfxStyleSheet* pStyle ) SvxFont aFontFromStyle; CreateFont( aFontFromStyle, pStyle->GetItemSet() ); - sal_Bool bUsed = sal_False; + bool bUsed = false; for ( sal_Int32 nNode = 0; nNode < aEditDoc.Count(); nNode++ ) { ContentNode* pNode = aEditDoc.GetObject( nNode ); if ( pNode->GetStyleSheet() == pStyle ) { - bUsed = sal_True; + bUsed = true; if ( aStatus.UseCharAttribs() ) pNode->SetStyleSheet( pStyle, aFontFromStyle ); else - pNode->SetStyleSheet( pStyle, sal_False ); + pNode->SetStyleSheet( pStyle, false ); ParaAttribsChanged( pNode ); } @@ -281,26 +281,26 @@ void ImpEditEngine::EnableUndo( bool bEnable ) bUndoEnabled = bEnable; } -sal_Bool ImpEditEngine::Undo( EditView* pView ) +bool ImpEditEngine::Undo( EditView* pView ) { if ( HasUndoManager() && GetUndoManager().GetUndoActionCount() ) { SetActiveView( pView ); GetUndoManager().Undo(); - return sal_True; + return true; } - return sal_False; + return false; } -sal_Bool ImpEditEngine::Redo( EditView* pView ) +bool ImpEditEngine::Redo( EditView* pView ) { if ( HasUndoManager() && GetUndoManager().GetRedoActionCount() ) { SetActiveView( pView ); GetUndoManager().Redo(); - return sal_True; + return true; } - return sal_False; + return false; } SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, EditEngineAttribs nOnlyHardAttrib ) @@ -489,7 +489,7 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_ // When no selection => use the Attribute on the word. // ( the RTF-parser should actually never call the Method without a Range ) if ( ( nSpecial == ATTRSPECIAL_WHOLEWORD ) && !aSel.HasRange() ) - aSel = SelectWord( aSel, ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_False ); + aSel = SelectWord( aSel, ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, false ); sal_Int32 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); sal_Int32 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); @@ -501,7 +501,7 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_ InsertUndo( pUndo ); } - sal_Bool bCheckLanguage = sal_False; + bool bCheckLanguage = false; if ( GetStatus().DoOnlineSpelling() ) { bCheckLanguage = ( rSet.GetItemState( EE_CHAR_LANGUAGE ) == SFX_ITEM_ON ) || @@ -512,8 +512,8 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_ // iterate over the paragraphs ... for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { - sal_Bool bParaAttribFound = sal_False; - sal_Bool bCharAttribFound = sal_False; + bool bParaAttribFound = false; + bool bCharAttribFound = false; DBG_ASSERT( aEditDoc.GetObject( nNode ), "Node not founden: SetAttribs" ); DBG_ASSERT( GetParaPortions().SafeGetObject( nNode ), "Portion not found: SetAttribs" ); @@ -533,12 +533,12 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_ if ( nWhich <= EE_PARA_END ) { pNode->GetContentAttribs().GetItems().Put( rItem ); - bParaAttribFound = sal_True; + bParaAttribFound = true; } else { aEditDoc.InsertAttrib( pNode, nStartPos, nEndPos, rItem ); - bCharAttribFound = sal_True; + bCharAttribFound = true; if ( nSpecial == ATTRSPECIAL_EDGE ) { CharAttribList::AttribsType& rAttribs = pNode->GetCharAttribs().GetAttribs(); @@ -576,7 +576,7 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_ } } -void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ) +void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, bool bRemoveParaAttribs, sal_uInt16 nWhich ) { aSel.Adjust( aEditDoc ); @@ -589,7 +589,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaA { // Possibly a special Undo, or itemset* EditUndoSetAttribs* pUndo = CreateAttribUndo( aSel, GetEmptyItemSet() ); - pUndo->SetRemoveAttribs( sal_True ); + pUndo->SetRemoveAttribs( true ); pUndo->SetRemoveParaAttribs( bRemoveParaAttribs ); pUndo->SetRemoveWhich( nWhich ); InsertUndo( pUndo ); @@ -608,7 +608,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaA const sal_Int32 nEndPos = nNode==nEndNode ? aSel.Max().GetIndex() : pNode->Len(); // can also be == nStart! // Optimize: If whole paragraph, then RemoveCharAttribs (nPara)? - sal_Bool bChanged = aEditDoc.RemoveAttribs( pNode, nStartPos, nEndPos, nWhich ); + bool bChanged = aEditDoc.RemoveAttribs( pNode, nStartPos, nEndPos, nWhich ); if ( bRemoveParaAttribs ) { SetParaAttribs( nNode, *_pEmptyItemSet ); // Invalidated @@ -638,7 +638,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaA } } -void ImpEditEngine::RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich, sal_Bool bRemoveFeatures ) +void ImpEditEngine::RemoveCharAttribs( sal_Int32 nPara, sal_uInt16 nWhich, bool bRemoveFeatures ) { ContentNode* pNode = aEditDoc.GetObject( nPara ); ParaPortion* pPortion = GetParaPortions().SafeGetObject( nPara ); @@ -809,9 +809,9 @@ ImplIMEInfos::ImplIMEInfos( const EditPaM& rPos, const OUString& rOldTextAfterSt { aPos = rPos; nLen = 0; - bCursor = sal_True; + bCursor = true; pAttribs = NULL; - bWasCursorOverwrite = sal_False; + bWasCursorOverwrite = false; } ImplIMEInfos::~ImplIMEInfos() diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx index 391b84e499c4..a6bf7a37eb88 100644 --- a/editeng/source/items/bulitem.cxx +++ b/editeng/source/items/bulitem.cxx @@ -92,10 +92,10 @@ Font SvxBulletItem::CreateFont( SvStream& rStream, sal_uInt16 nVer ) aFont.SetSize( aSize ); } - sal_Bool bTemp; - rStream.ReadUChar( bTemp ); aFont.SetOutline( bTemp ); - rStream.ReadUChar( bTemp ); aFont.SetShadow( bTemp ); - rStream.ReadUChar( bTemp ); aFont.SetTransparent( bTemp ); + bool bTemp; + rStream.ReadCharAsBool( bTemp ); aFont.SetOutline( bTemp ); + rStream.ReadCharAsBool( bTemp ); aFont.SetShadow( bTemp ); + rStream.ReadCharAsBool( bTemp ); aFont.SetTransparent( bTemp ); return aFont; } @@ -127,7 +127,7 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) const sal_Size nOldPos = rStrm.Tell(); // Ignore Errorcode when reading Bitmap, // see comment in SvxBulletItem::Store() - sal_Bool bOldError = rStrm.GetError() ? sal_True : sal_False; + bool bOldError = rStrm.GetError() ? sal_True : sal_False; ReadDIB(aBmp, rStrm, true); if ( !bOldError && rStrm.GetError() ) diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index 432f204e295f..33fc1e77ce2d 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -59,14 +59,14 @@ SvxFieldData* SvxFieldData::Create(const uno::Reference<text::XTextContent>& xTe case text::textfield::Type::EXTENDED_TIME: case text::textfield::Type::DATE: { - sal_Bool bIsDate = false; + bool bIsDate = false; xPropSet->getPropertyValue(UNO_TC_PROP_IS_DATE) >>= bIsDate; if (bIsDate) { util::DateTime aDateTime = xPropSet->getPropertyValue(UNO_TC_PROP_DATE_TIME).get<util::DateTime>(); Date aDate(aDateTime.Day, aDateTime.Month, aDateTime.Year); - sal_Bool bIsFixed = false; + bool bIsFixed = false; xPropSet->getPropertyValue(UNO_TC_PROP_IS_FIXED) >>= bIsFixed; SvxDateField* pData = new SvxDateField(aDate, bIsFixed ? SVXDATETYPE_FIX : SVXDATETYPE_VAR); @@ -83,7 +83,7 @@ SvxFieldData* SvxFieldData::Create(const uno::Reference<text::XTextContent>& xTe util::DateTime aDateTime = xPropSet->getPropertyValue(UNO_TC_PROP_DATE_TIME).get<util::DateTime>(); Time aTime(aDateTime.Hours, aDateTime.Minutes, aDateTime.Seconds, aDateTime.NanoSeconds); - sal_Bool bIsFixed = false; + bool bIsFixed = false; xPropSet->getPropertyValue(UNO_TC_PROP_IS_FIXED) >>= bIsFixed; SvxExtTimeField* pData = new SvxExtTimeField(aTime, bIsFixed ? SVXTIMETYPE_FIX : SVXTIMETYPE_VAR); @@ -128,7 +128,7 @@ SvxFieldData* SvxFieldData::Create(const uno::Reference<text::XTextContent>& xTe case text::textfield::Type::EXTENDED_FILE: { OUString aPresentation; - sal_Bool bIsFixed = false; + bool bIsFixed = false; sal_Int16 nFmt = text::FilenameDisplayFormat::FULL; xPropSet->getPropertyValue(UNO_TC_PROP_IS_FIXED) >>= bIsFixed; xPropSet->getPropertyValue(UNO_TC_PROP_CURRENT_PRESENTATION) >>= aPresentation; @@ -149,8 +149,8 @@ SvxFieldData* SvxFieldData::Create(const uno::Reference<text::XTextContent>& xTe } case text::textfield::Type::AUTHOR: { - sal_Bool bIsFixed = false; - sal_Bool bFullName = false; + bool bIsFixed = false; + bool bFullName = false; sal_Int16 nFmt = -1; OUString aPresentation, aContent, aFirstName, aLastName; xPropSet->getPropertyValue(UNO_TC_PROP_IS_FIXED) >>= bIsFixed; diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 398c9ed7de04..55f642c3a3c0 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -229,7 +229,7 @@ SvxSizeItem::SvxSizeItem( const sal_uInt16 nId, const Size& rSize ) : bool SvxSizeItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; awt::Size aTmp(aSize.Width(), aSize.Height()); @@ -252,7 +252,7 @@ bool SvxSizeItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxSizeItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) @@ -446,7 +446,7 @@ SvxLRSpaceItem::SvxLRSpaceItem( const long nLeft, const long nRight, bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { bool bRet = true; - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { @@ -490,7 +490,7 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0 != (nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; sal_Int32 nVal = 0; if( nMemberId != MID_FIRST_AUTO && @@ -501,15 +501,15 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) switch( nMemberId ) { case MID_L_MARGIN: - SetLeft((sal_Int32)bConvert ? convertMm100ToTwip(nVal) : nVal); + SetLeft( bConvert ? convertMm100ToTwip(nVal) : nVal ); break; case MID_TXT_LMARGIN : - SetTxtLeft((sal_Int32)bConvert ? convertMm100ToTwip(nVal) : nVal); + SetTxtLeft( bConvert ? convertMm100ToTwip(nVal) : nVal ); break; case MID_R_MARGIN: - SetRight((sal_Int32) bConvert ? convertMm100ToTwip(nVal) : nVal); + SetRight(bConvert ? convertMm100ToTwip(nVal) : nVal); break; case MID_L_REL_MARGIN: case MID_R_REL_MARGIN: @@ -876,10 +876,10 @@ bool SvxULSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxULSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; sal_Int32 nVal = 0; - sal_Bool bVal = 0; + bool bVal = false; switch( nMemberId ) { case 0: @@ -1204,7 +1204,7 @@ bool SvxProtectItem::operator==( const SfxPoolItem& rAttr ) const bool SvxProtectItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; - sal_Bool bValue; + bool bValue; switch(nMemberId) { case MID_PROTECT_CONTENT : bValue = bCntnt; break; @@ -1222,7 +1222,7 @@ bool SvxProtectItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxProtectItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; - sal_Bool bVal( Any2Bool(rVal) ); + bool bVal( Any2Bool(rVal) ); switch(nMemberId) { case MID_PROTECT_CONTENT : bCntnt = bVal; break; @@ -1325,7 +1325,7 @@ SvxShadowItem::SvxShadowItem( const sal_uInt16 nId, bool SvxShadowItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; table::ShadowFormat aShadow; @@ -1361,7 +1361,7 @@ bool SvxShadowItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; table::ShadowFormat aShadow; @@ -1536,7 +1536,7 @@ SvStream& SvxShadowItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) { rStrm.WriteSChar( (sal_Int8) GetLocation() ) .WriteUInt16( (sal_uInt16) GetWidth() ) - .WriteUChar( (sal_Bool)(aShadowColor.GetTransparency() > 0) ); + .WriteUChar( (aShadowColor.GetTransparency() > 0) ); WriteColor( rStrm, GetColor() ); WriteColor( rStrm, GetColor() ); rStrm.WriteSChar( (sal_Int8)(aShadowColor.GetTransparency() > 0 ? 0 : 1) ); //BRUSH_NULL : BRUSH_SOLID @@ -1564,12 +1564,12 @@ SfxPoolItem* SvxShadowItem::Create( SvStream& rStrm, sal_uInt16 ) const { sal_Int8 cLoc; sal_uInt16 _nWidth; - sal_Bool bTrans; + bool bTrans; Color aColor; Color aFillColor; sal_Int8 nStyle; rStrm.ReadSChar( cLoc ).ReadUInt16( _nWidth ) - .ReadUChar( bTrans ); + .ReadCharAsBool( bTrans ); ReadColor( rStrm, aColor ); ReadColor( rStrm, aFillColor ).ReadSChar( nStyle ); aColor.SetTransparency(bTrans ? 0xff : 0); @@ -1666,14 +1666,14 @@ SvxBoxItem& SvxBoxItem::operator=( const SvxBoxItem& rBox ) -inline sal_Bool CmpBrdLn( const SvxBorderLine* pBrd1, const SvxBorderLine* pBrd2 ) +inline bool CmpBrdLn( const SvxBorderLine* pBrd1, const SvxBorderLine* pBrd2 ) { - sal_Bool bRet; + bool bRet; if( 0 != pBrd1 ? 0 == pBrd2 : 0 != pBrd2 ) - bRet = sal_False; + bRet = false; else if( !pBrd1 ) - bRet = sal_True; + bRet = true; else bRet = (*pBrd1 == *pBrd2); return bRet; @@ -1716,10 +1716,10 @@ table::BorderLine2 SvxBoxItem::SvxLineToLine(const SvxBorderLine* pLine, bool bC bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); table::BorderLine2 aRetLine; sal_uInt16 nDist = 0; - sal_Bool bDistMember = sal_False; + bool bDistMember = false; nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -1757,23 +1757,23 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const break; case BORDER_DISTANCE: nDist = GetDistance(); - bDistMember = sal_True; + bDistMember = true; break; case TOP_BORDER_DISTANCE: nDist = nTopDist; - bDistMember = sal_True; + bDistMember = true; break; case BOTTOM_BORDER_DISTANCE: nDist = nBottomDist; - bDistMember = sal_True; + bDistMember = true; break; case LEFT_BORDER_DISTANCE: nDist = nLeftDist; - bDistMember = sal_True; + bDistMember = true; break; case RIGHT_BORDER_DISTANCE: nDist = nRightDist; - bDistMember = sal_True; + bDistMember = true; break; } @@ -1788,8 +1788,8 @@ bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const namespace { -sal_Bool -lcl_lineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLine, sal_Bool bConvert, sal_Bool bGuessWidth) +bool +lcl_lineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLine, bool bConvert, bool bGuessWidth) { rSvxLine.SetColor( Color(rLine.Color)); if ( bGuessWidth ) @@ -1800,7 +1800,7 @@ lcl_lineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLine, sal_B sal_uInt16( bConvert ? convertMm100ToTwip(rLine.LineDistance ) : rLine.LineDistance )); } - sal_Bool bRet = !rSvxLine.isEmpty(); + bool bRet = !rSvxLine.isEmpty(); return bRet; } @@ -1809,7 +1809,7 @@ lcl_lineToSvxLine(const table::BorderLine& rLine, SvxBorderLine& rSvxLine, sal_B bool SvxBoxItem::LineToSvxLine(const ::com::sun::star::table::BorderLine& rLine, SvxBorderLine& rSvxLine, bool bConvert) { - return lcl_lineToSvxLine(rLine, rSvxLine, bConvert, sal_True); + return lcl_lineToSvxLine(rLine, rSvxLine, bConvert, true); } bool @@ -1822,7 +1822,7 @@ SvxBoxItem::LineToSvxLine(const ::com::sun::star::table::BorderLine2& rLine, Svx rSvxLine.SetBorderLineStyle( nStyle ); - sal_Bool bGuessWidth = sal_True; + bool bGuessWidth = true; if ( rLine.LineWidth ) { rSvxLine.SetWidth( bConvert? convertMm100ToTwip( rLine.LineWidth ) : rLine.LineWidth ); @@ -1882,7 +1882,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); sal_uInt16 nLine = BOX_LINE_TOP; - sal_Bool bDistMember = sal_False; + bool bDistMember = false; nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -1923,25 +1923,25 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) return false; } case LEFT_BORDER_DISTANCE: - bDistMember = sal_True; + bDistMember = true; case LEFT_BORDER: case MID_LEFT_BORDER: nLine = BOX_LINE_LEFT; break; case RIGHT_BORDER_DISTANCE: - bDistMember = sal_True; + bDistMember = true; case RIGHT_BORDER: case MID_RIGHT_BORDER: nLine = BOX_LINE_RIGHT; break; case BOTTOM_BORDER_DISTANCE: - bDistMember = sal_True; + bDistMember = true; case BOTTOM_BORDER: case MID_BOTTOM_BORDER: nLine = BOX_LINE_BOTTOM; break; case TOP_BORDER_DISTANCE: - bDistMember = sal_True; + bDistMember = true; case TOP_BORDER: case MID_TOP_BORDER: nLine = BOX_LINE_TOP; @@ -2065,7 +2065,7 @@ bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) else return false; - sal_Bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert); + bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert); SetLine(bSet ? &aLine : 0, nLine); } @@ -2712,10 +2712,10 @@ void SvxBoxInfoItem::ResetFlags() bool SvxBoxInfoItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0 != (nMemberId & CONVERT_TWIPS); table::BorderLine2 aRetLine; sal_Int16 nVal=0; - sal_Bool bIntMember = sal_False; + bool bIntMember = false; nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -2746,7 +2746,7 @@ bool SvxBoxInfoItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const aRetLine = SvxBoxItem::SvxLineToLine( pVert, bConvert); break; case MID_FLAGS: - bIntMember = sal_True; + bIntMember = true; if ( IsTable() ) nVal |= 0x01; if ( IsDist() ) @@ -2756,12 +2756,12 @@ bool SvxBoxInfoItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const rVal <<= nVal; break; case MID_VALIDFLAGS: - bIntMember = sal_True; + bIntMember = true; nVal = nValidFlags; rVal <<= nVal; break; case MID_DISTANCE: - bIntMember = sal_True; + bIntMember = true; rVal <<= (sal_Int32)(bConvert ? convertTwipToMm100(GetDefDist()) : GetDefDist()); break; default: OSL_FAIL("Wrong MemberId!"); return false; @@ -2777,9 +2777,9 @@ bool SvxBoxInfoItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; - sal_Bool bRet; + bool bRet; switch(nMemberId) { case 0: @@ -2894,7 +2894,7 @@ bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) return false; SvxBorderLine aLine; - sal_Bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert); + bool bSet = SvxBoxItem::LineToSvxLine(aBorderLine, aLine, bConvert); if ( bSet ) SetLine( &aLine, nMemberId == MID_HORIZONTAL ? BOXINFO_LINE_HORI : BOXINFO_LINE_VERT ); break; @@ -3182,7 +3182,7 @@ SfxPoolItem* SvxLineItem::Clone( SfxItemPool* ) const bool SvxLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemId ) const { - sal_Bool bConvert = 0!=(nMemId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemId&CONVERT_TWIPS); nMemId &= ~CONVERT_TWIPS; if ( nMemId == 0 ) { @@ -3210,7 +3210,7 @@ bool SvxLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemId ) const bool SvxLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemId ) { - sal_Bool bConvert = 0!=(nMemId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemId&CONVERT_TWIPS); nMemId &= ~CONVERT_TWIPS; sal_Int32 nVal = 0; if ( nMemId == 0 ) @@ -3469,12 +3469,12 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion, , eGraphicPos ( GPOS_NONE ) , bLoadAgain (false) { - sal_Bool bTrans; + bool bTrans; Color aTempColor; Color aTempFillColor; sal_Int8 nStyle; - rStream.ReadUChar( bTrans ); + rStream.ReadCharAsBool( bTrans ); ReadColor( rStream, aTempColor ); ReadColor( rStream, aTempFillColor ); rStream.ReadSChar( nStyle ); @@ -3873,7 +3873,7 @@ bool SvxBrushItem::operator==( const SfxPoolItem& rAttr ) const DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" ); SvxBrushItem& rCmp = (SvxBrushItem&)rAttr; - sal_Bool bEqual = ( aColor == rCmp.aColor && eGraphicPos == rCmp.eGraphicPos && + bool bEqual = ( aColor == rCmp.aColor && eGraphicPos == rCmp.eGraphicPos && pImpl->nGraphicTransparency == rCmp.pImpl->nGraphicTransparency); if ( bEqual ) @@ -3924,7 +3924,7 @@ SfxPoolItem* SvxBrushItem::Create( SvStream& rStream, sal_uInt16 nVersion ) cons SvStream& SvxBrushItem::Store( SvStream& rStream , sal_uInt16 /*nItemVersion*/ ) const { - rStream.WriteUChar( (sal_Bool)sal_False ); + rStream.WriteUChar( false ); WriteColor( rStream, aColor ); WriteColor( rStream, aColor ); rStream.WriteSChar( (sal_Int8)(aColor.GetTransparency() > 0 ? 0 : 1) ); //BRUSH_NULL : BRUSH_SOLID @@ -4271,7 +4271,7 @@ bool SvxFrameDirectionItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { sal_Int16 nVal = sal_Int16(); - sal_Bool bRet = ( rVal >>= nVal ); + bool bRet = ( rVal >>= nVal ); if( bRet ) { // translate WritingDirection2 constants into SvxFrameDirection diff --git a/editeng/source/items/itemtype.cxx b/editeng/source/items/itemtype.cxx index 8b32cb02ae45..c743afc58c46 100644 --- a/editeng/source/items/itemtype.cxx +++ b/editeng/source/items/itemtype.cxx @@ -29,12 +29,12 @@ OUString GetMetricText( long nVal, SfxMapUnit eSrcUnit, SfxMapUnit eDestUnit, const IntlWrapper* pIntl ) { - sal_Bool bNeg = sal_False; + bool bNeg = false; sal_Int32 nRet = 0; if ( nVal < 0 ) { - bNeg = sal_True; + bNeg = true; nVal *= -1; } diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index 61cc688716c0..0f144d10c274 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -683,7 +683,7 @@ SvxNumRule::SvxNumRule( SvStream &rStream ) for (sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) { rStream.ReadUInt16( nTmp16 ); - sal_Bool hasNumberingFormat = nTmp16 & 1; + bool hasNumberingFormat = nTmp16 & 1; aFmtsSet[i] = nTmp16 & 2; // fdo#68648 reset flag if ( hasNumberingFormat ){ aFmts[i] = new SvxNumberFormat( rStream ); @@ -708,7 +708,7 @@ SvStream& SvxNumRule::Store( SvStream &rStream ) rStream.WriteUInt16( (sal_uInt16)eNumberingType ); FontToSubsFontConverter pConverter = 0; - sal_Bool bConvertBulletFont = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_50 ) && ( rStream.GetVersion() ); + bool bConvertBulletFont = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_50 ) && ( rStream.GetVersion() ); for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) { sal_uInt16 nSetFlag(aFmtsSet[i] ? 2 : 0); // fdo#68648 store that too @@ -879,13 +879,13 @@ OUString SvxNumRule::MakeNumString( const SvxNodeNum& rNum, bool bInclStrings ) continue; } - sal_Bool bDot = sal_True; + bool bDot = true; if( rNum.GetLevelVal()[ i ] ) { if(SVX_NUM_BITMAP != rNFmt.GetNumberingType()) aStr += rNFmt.GetNumStr( rNum.GetLevelVal()[ i ], aLocale ); else - bDot = sal_False; + bDot = false; } else aStr += "0"; // all 0-levels are a 0 @@ -905,7 +905,7 @@ OUString SvxNumRule::MakeNumString( const SvxNodeNum& rNum, bool bInclStrings ) // changes linked to embedded bitmaps bool SvxNumRule::UnLinkGraphics() { - sal_Bool bRet = sal_False; + bool bRet = false; for(sal_uInt16 i = 0; i < GetLevelCount(); i++) { SvxNumberFormat aFmt(GetLevel(i)); @@ -922,7 +922,7 @@ bool SvxNumRule::UnLinkGraphics() aTempItem.SetGraphic(*pGraphic); sal_Int16 eOrient = aFmt.GetVertOrient(); aFmt.SetGraphicBrush( &aTempItem, &aFmt.GetGraphicSize(), &eOrient ); - bRet = sal_True; + bRet = true; } } else if((SVX_NUM_BITMAP|LINK_TOKEN) == aFmt.GetNumberingType()) diff --git a/editeng/source/items/paperinf.cxx b/editeng/source/items/paperinf.cxx index ebce024c6bc0..71540dc5eaf7 100644 --- a/editeng/source/items/paperinf.cxx +++ b/editeng/source/items/paperinf.cxx @@ -28,7 +28,7 @@ Description: Is the printer valid --------------------------------------------------------------------*/ -inline sal_Bool IsValidPrinter( const Printer* pPtr ) +inline bool IsValidPrinter( const Printer* pPtr ) { return pPtr->GetName().isEmpty() ? sal_False : sal_True; } diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index 4f3d598f107f..bba14684afec 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -111,7 +111,7 @@ bool SvxLineSpacingItem::operator==( const SfxPoolItem& rAttr ) const */ bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; style::LineSpacing aLSp; @@ -156,13 +156,13 @@ bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; // fill with current data style::LineSpacing aLSp; uno::Any aAny; - sal_Bool bRet = QueryValue( aAny, bConvert ? CONVERT_TWIPS : 0 ) && ( aAny >>= aLSp ); + bool bRet = QueryValue( aAny, bConvert ? CONVERT_TWIPS : 0 ) && ( aAny >>= aLSp ); // get new data switch ( nMemberId ) @@ -932,7 +932,7 @@ SvxTabStopItem& SvxTabStopItem::operator=( const SvxTabStopItem& rTSI ) bool SvxTabStopItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) { @@ -973,7 +973,7 @@ bool SvxTabStopItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxTabStopItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) { @@ -1103,7 +1103,7 @@ SfxItemPresentation SvxTabStopItem::GetPresentation if ( ePres > SFX_ITEM_PRESENTATION_NONE ) { - sal_Bool bComma = sal_False; + bool bComma = false; for ( sal_uInt16 i = 0; i < Count(); ++i ) { @@ -1117,7 +1117,7 @@ SfxItemPresentation SvxTabStopItem::GetPresentation { rText += " " + EE_RESSTR(GetMetricId(ePresUnit)); } - bComma = sal_True; + bComma = true; } } } @@ -1302,7 +1302,7 @@ bool SvxPageModelItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMe switch ( nMemberId ) { - case MID_AUTO: rVal <<= (sal_Bool) bAuto; break; + case MID_AUTO: rVal <<= bAuto; break; case MID_NAME: rVal <<= OUString( GetValue() ); break; default: OSL_FAIL("Wrong MemberId!"); return false; } @@ -1313,7 +1313,7 @@ bool SvxPageModelItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMe bool SvxPageModelItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; - sal_Bool bRet; + bool bRet; OUString aStr; switch ( nMemberId ) { @@ -1371,8 +1371,8 @@ SfxPoolItem* SvxScriptSpaceItem::Clone( SfxItemPool * ) const SfxPoolItem* SvxScriptSpaceItem::Create(SvStream & rStrm, sal_uInt16) const { - sal_Bool bFlag; - rStrm.ReadUChar( bFlag ); + bool bFlag; + rStrm.ReadCharAsBool( bFlag ); return new SvxScriptSpaceItem( bFlag, Which() ); } @@ -1424,8 +1424,8 @@ SfxPoolItem* SvxHangingPunctuationItem::Clone( SfxItemPool * ) const SfxPoolItem* SvxHangingPunctuationItem::Create(SvStream & rStrm, sal_uInt16) const { - sal_Bool nValue; - rStrm.ReadUChar( nValue ); + bool nValue; + rStrm.ReadCharAsBool( nValue ); return new SvxHangingPunctuationItem( nValue, Which() ); } @@ -1477,8 +1477,8 @@ SfxPoolItem* SvxForbiddenRuleItem::Clone( SfxItemPool * ) const SfxPoolItem* SvxForbiddenRuleItem::Create(SvStream & rStrm, sal_uInt16) const { - sal_Bool nValue; - rStrm.ReadUChar( nValue ); + bool nValue; + rStrm.ReadCharAsBool( nValue ); return new SvxForbiddenRuleItem( nValue, Which() ); } @@ -1619,8 +1619,8 @@ SfxPoolItem* SvxParaGridItem::Clone( SfxItemPool * ) const SfxPoolItem* SvxParaGridItem::Create(SvStream & rStrm, sal_uInt16) const { - sal_Bool bFlag; - rStrm.ReadUChar( bFlag ); + bool bFlag; + rStrm.ReadCharAsBool( bFlag ); return new SvxParaGridItem( bFlag, Which() ); } diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx index 19acc72ad310..7feb70e196ed 100644 --- a/editeng/source/items/svxfont.cxx +++ b/editeng/source/items/svxfont.cxx @@ -210,7 +210,7 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo) const // #108210# // Test if string length differ between original and CaseMapped - sal_Bool bCaseMapLengthDiffers(aTxt.getLength() != rTxt.getLength()); + bool bCaseMapLengthDiffers(aTxt.getLength() != rTxt.getLength()); const LanguageType eLang = LANGUAGE_DONTKNOW == GetLanguage() ? LANGUAGE_SYSTEM : GetLanguage(); @@ -360,7 +360,7 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const OUString &rTxt, { // #108210# const OUString aNewText = CalcCaseMap(rTxt); - sal_Bool bCaseMapLengthDiffers(aNewText.getLength() != rTxt.getLength()); + bool bCaseMapLengthDiffers(aNewText.getLength() != rTxt.getLength()); sal_Int32 nWidth(0L); if(bCaseMapLengthDiffers) @@ -543,7 +543,7 @@ void SvxFont::DrawPrev( OutputDevice *pOut, Printer* pPrinter, { // #108210# const OUString aNewText = CalcCaseMap(rTxt); - sal_Bool bCaseMapLengthDiffers(aNewText.getLength() != rTxt.getLength()); + bool bCaseMapLengthDiffers(aNewText.getLength() != rTxt.getLength()); if(bCaseMapLengthDiffers) { @@ -675,8 +675,8 @@ void SvxDoDrawCapital::DoSpace( const sal_Bool bDraw ) sal_uLong nDiff = (sal_uLong)(aPos.X() - aSpacePos.X()); if ( nDiff ) { - sal_Bool bWordWise = pFont->IsWordLineMode(); - sal_Bool bTrans = pFont->IsTransparent(); + bool bWordWise = pFont->IsWordLineMode(); + bool bTrans = pFont->IsTransparent(); pFont->SetWordLineMode( false ); pFont->SetTransparent( true ); pFont->SetPhysFont( pOut ); diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 5cc4929d6d04..b9767122d95a 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -368,7 +368,7 @@ SfxPoolItem* SvxFontItem::Clone( SfxItemPool * ) const SvStream& SvxFontItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - sal_Bool bToBats = IsStarSymbol( GetFamilyName() ); + bool bToBats = IsStarSymbol( GetFamilyName() ); rStrm.WriteUChar( (sal_uInt8) GetFamily() ).WriteUChar( (sal_uInt8) GetPitch() ) .WriteUChar( (sal_uInt8)(bToBats ? RTL_TEXTENCODING_SYMBOL : GetSOStoreTextEncoding(GetCharSet())) ); @@ -820,7 +820,7 @@ bool SvxFontHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const // In StarOne is the uno::Any always 1/100mm. Through the MemberId it is // controlled if the value in the Item should be 1/100mm or Twips. - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { @@ -916,7 +916,7 @@ bool SvxFontHeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const } // Calculate the relative deviation from the expected height. -static sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, SfxMapUnit eProp, sal_Bool bCoreInTwip) +static sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, SfxMapUnit eProp, bool bCoreInTwip) { sal_uInt32 nRet = nHeight; short nDiff = 0; @@ -951,7 +951,7 @@ static sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, S bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { - sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); + bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { @@ -1384,7 +1384,7 @@ bool SvxTextLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxTextLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; - sal_Bool bRet = sal_True; + bool bRet = true; switch(nMemberId) { case MID_TEXTLINED: @@ -1394,7 +1394,7 @@ bool SvxTextLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Int32 nValue = 0; if(!(rVal >>= nValue)) - bRet = sal_False; + bRet = false; else SetValue((sal_Int16)nValue); } @@ -1403,7 +1403,7 @@ bool SvxTextLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Int32 nCol = 0; if( !( rVal >>= nCol ) ) - bRet = sal_False; + bRet = false; else { // Keep transparence, because it contains the information @@ -1760,7 +1760,7 @@ SfxPoolItem* SvxWordLineModeItem::Clone( SfxItemPool * ) const SvStream& SvxWordLineModeItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm.WriteUChar( (sal_Bool) GetValue() ); + rStrm.WriteUChar( GetValue() ); return rStrm; } @@ -1768,8 +1768,8 @@ SvStream& SvxWordLineModeItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersio SfxPoolItem* SvxWordLineModeItem::Create(SvStream& rStrm, sal_uInt16) const { - sal_Bool bValue; - rStrm.ReadUChar( bValue ); + bool bValue; + rStrm.ReadCharAsBool( bValue ); return new SvxWordLineModeItem( bValue, Which() ); } @@ -1821,7 +1821,7 @@ SfxPoolItem* SvxContourItem::Clone( SfxItemPool * ) const SvStream& SvxContourItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm.WriteUChar( (sal_Bool) GetValue() ); + rStrm.WriteUChar( GetValue() ); return rStrm; } @@ -1829,8 +1829,8 @@ SvStream& SvxContourItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) SfxPoolItem* SvxContourItem::Create(SvStream& rStrm, sal_uInt16) const { - sal_Bool bValue; - rStrm.ReadUChar( bValue ); + bool bValue; + rStrm.ReadCharAsBool( bValue ); return new SvxContourItem( bValue, Which() ); } @@ -2503,7 +2503,7 @@ bool SvxEscapementItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) break; case MID_AUTO_ESC: { - sal_Bool bVal = Any2Bool(rVal); + bool bVal = Any2Bool(rVal); if(bVal) { if(nEsc < 0) @@ -2652,7 +2652,7 @@ SfxPoolItem* SvxNoLinebreakItem::Clone( SfxItemPool* ) const SvStream& SvxNoLinebreakItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm.WriteUChar( (sal_Bool)GetValue() ); + rStrm.WriteUChar( GetValue() ); return rStrm; } @@ -2660,8 +2660,8 @@ SvStream& SvxNoLinebreakItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion SfxPoolItem* SvxNoLinebreakItem::Create(SvStream& rStrm, sal_uInt16) const { - sal_Bool bValue; - rStrm.ReadUChar( bValue ); + bool bValue; + rStrm.ReadCharAsBool( bValue ); return new SvxNoLinebreakItem( bValue, Which() ); } @@ -2697,7 +2697,7 @@ SfxPoolItem* SvxNoHyphenItem::Clone( SfxItemPool* ) const SvStream& SvxNoHyphenItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm.WriteUChar( (sal_Bool) GetValue() ); + rStrm.WriteUChar( GetValue() ); return rStrm; } @@ -2705,8 +2705,8 @@ SvStream& SvxNoHyphenItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ SfxPoolItem* SvxNoHyphenItem::Create( SvStream& rStrm, sal_uInt16 ) const { - sal_Bool bValue; - rStrm.ReadUChar( bValue ); + bool bValue; + rStrm.ReadCharAsBool( bValue ); return new SvxNoHyphenItem( bValue, Which() ); } @@ -2928,7 +2928,7 @@ bool SvxEmphasisMarkItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) cons bool SvxEmphasisMarkItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; - sal_Bool bRet = true; + bool bRet = true; switch( nMemberId ) { case MID_EMPHASIS: @@ -3006,7 +3006,7 @@ bool SvxTwoLinesItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; - sal_Bool bRet = true; + bool bRet = true; switch( nMemberId ) { case MID_TWOLINES: @@ -3039,26 +3039,26 @@ bool SvxTwoLinesItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; - sal_Bool bRet = sal_False; + bool bRet = false; OUString s; switch( nMemberId ) { case MID_TWOLINES: bOn = Any2Bool( rVal ); - bRet = sal_True; + bRet = true; break; case MID_START_BRACKET: if( rVal >>= s ) { cStartBracket = s.isEmpty() ? 0 : s[ 0 ]; - bRet = sal_True; + bRet = true; } break; case MID_END_BRACKET: if( rVal >>= s ) { cEndBracket = s.isEmpty() ? 0 : s[ 0 ]; - bRet = sal_True; + bRet = true; } break; } @@ -3097,9 +3097,9 @@ SfxItemPresentation SvxTwoLinesItem::GetPresentation( SfxItemPresentation ePres, SfxPoolItem* SvxTwoLinesItem::Create( SvStream & rStrm, sal_uInt16 /*nVer*/) const { - sal_Bool _bOn; + bool _bOn; sal_Unicode cStart, cEnd; - rStrm.ReadUChar( _bOn ).ReadUInt16( cStart ).ReadUInt16( cEnd ); + rStrm.ReadCharAsBool( _bOn ).ReadUInt16( cStart ).ReadUInt16( cEnd ); return new SvxTwoLinesItem( _bOn, cStart, cEnd, Which() ); } @@ -3139,14 +3139,14 @@ SfxPoolItem* SvxCharRotateItem::Clone( SfxItemPool* ) const SfxPoolItem* SvxCharRotateItem::Create( SvStream& rStrm, sal_uInt16 ) const { sal_uInt16 nVal; - sal_Bool b; - rStrm.ReadUInt16( nVal ).ReadUChar( b ); + bool b; + rStrm.ReadUInt16( nVal ).ReadCharAsBool( b ); return new SvxCharRotateItem( nVal, b, Which() ); } SvStream& SvxCharRotateItem::Store( SvStream & rStrm, sal_uInt16 ) const { - sal_Bool bFlag = IsFitToLine(); + bool bFlag = IsFitToLine(); rStrm.WriteUInt16( GetValue() ).WriteUChar( bFlag ); return rStrm; } diff --git a/editeng/source/misc/SvXMLAutoCorrectImport.cxx b/editeng/source/misc/SvXMLAutoCorrectImport.cxx index 28b65c1f1311..fcc47f12f093 100644 --- a/editeng/source/misc/SvXMLAutoCorrectImport.cxx +++ b/editeng/source/misc/SvXMLAutoCorrectImport.cxx @@ -125,7 +125,7 @@ SvXMLWordContext::SvXMLWordContext( if (sWrong.isEmpty() || sRight.isEmpty()) return; - sal_Bool bOnlyTxt = sRight != sWrong; + bool bOnlyTxt = sRight != sWrong; if( !bOnlyTxt ) { const OUString sLongSave( sRight ); @@ -133,7 +133,7 @@ SvXMLWordContext::SvXMLWordContext( !sLongSave.isEmpty() ) { sRight = sLongSave; - bOnlyTxt = sal_True; + bOnlyTxt = true; } } rLocalRef.pAutocorr_List->LoadEntry( sWrong, sRight, bOnlyTxt ); diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index f6c935e6e417..6d0fd5113478 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -2386,7 +2386,7 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl() try { ::ucbhelper::Content aContent ( aDest.GetMainURL( INetURLObject::DECODE_TO_IURI ), uno::Reference < XCommandEnvironment >(), comphelper::getProcessComponentContext() ); - aContent.executeCommand ( OUString( "delete" ), makeAny ( sal_Bool (sal_True ) ) ); + aContent.executeCommand ( OUString( "delete" ), makeAny ( true ) ); } catch (...) { diff --git a/editeng/source/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx index 29ec0a698015..6a201b6b6d95 100644 --- a/editeng/source/misc/txtrange.cxx +++ b/editeng/source/misc/txtrange.cxx @@ -112,11 +112,11 @@ class SvxBoundArgs sal_uInt16 nNext; sal_uInt8 nAct; sal_uInt8 nFirst; - sal_Bool bClosed : 1; - sal_Bool bInner : 1; - sal_Bool bMultiple : 1; - sal_Bool bConcat : 1; - sal_Bool bRotate : 1; + bool bClosed : 1; + bool bInner : 1; + bool bMultiple : 1; + bool bConcat : 1; + bool bRotate : 1; void NoteRange( bool bToggle ); long Cut( long nY, const Point& rPt1, const Point& rPt2 ); void Add(); @@ -138,10 +138,10 @@ public: void Concat( const PolyPolygon* pPoly ); // inlines void NoteLast() { if( bMultiple ) NoteRange( nAct == nFirst ); } - void SetClosed( const sal_Bool bNew ){ bClosed = bNew; } - sal_Bool IsClosed() const { return bClosed; } - void SetConcat( const sal_Bool bNew ){ bConcat = bNew; } - sal_Bool IsConcat() const { return bConcat; } + void SetClosed( const bool bNew ){ bClosed = bNew; } + bool IsClosed() const { return bClosed; } + void SetConcat( const bool bNew ){ bConcat = bNew; } + bool IsConcat() const { return bConcat; } }; SvxBoundArgs::SvxBoundArgs( TextRanger* pRanger, LongDqPtr pLong, @@ -149,7 +149,7 @@ SvxBoundArgs::SvxBoundArgs( TextRanger* pRanger, LongDqPtr pLong, : pLongArr( pLong ), pTextRanger( pRanger ), nTop( rRange.Min() ), nBottom( rRange.Max() ), bInner( pRanger->IsInner() ), bMultiple( bInner || !pRanger->IsSimple() ), - bConcat( sal_False ), bRotate( pRanger->IsVertical() ) + bConcat( false ), bRotate( pRanger->IsVertical() ) { if( bRotate ) { @@ -186,7 +186,7 @@ long SvxBoundArgs::CalcMax( const Point& rPt1, const Point& rPt2, nB += nDa * nDa; nB = nRange + nDa * ( nFarRange - nRange ) / sqrt( nB ); - sal_Bool bNote; + bool bNote; if( nB < B(rPt2) ) bNote = nB > B(rPt1); else @@ -244,7 +244,7 @@ void SvxBoundArgs::NoteRange( bool bToggle ) DBG_ASSERT( nCount == 2 * aBoolArr.size(), "NoteRange: Incompatible Sizes" ); while( nIdx < nCount && (*pLongArr)[ nIdx ] < nMin ) ++nIdx; - sal_Bool bOdd = (nIdx % 2) ? sal_True : sal_False; + bool bOdd = (nIdx % 2) ? sal_True : sal_False; // No overlap with existing intervals? if( nIdx == nCount || ( !bOdd && nMax < (*pLongArr)[ nIdx ] ) ) { // Then a new one is inserted ... @@ -426,7 +426,7 @@ void SvxBoundArgs::Add() size_t nCount = aBoolArr.size(); if( nCount && ( !bInner || !pTextRanger->IsSimple() ) ) { - sal_Bool bDelete = aBoolArr.front(); + bool bDelete = aBoolArr.front(); if( bInner ) bDelete = !bDelete; sal_uInt16 nLongIdx = 1; @@ -477,17 +477,17 @@ void SvxBoundArgs::Add() void SvxBoundArgs::Concat( const PolyPolygon* pPoly ) { - SetConcat( sal_True ); + SetConcat( true ); DBG_ASSERT( pPoly, "Nothing to do?" ); LongDqPtr pOld = pLongArr; pLongArr = new std::deque<long>(); aBoolArr.clear(); - bInner = sal_False; + bInner = false; Calc( *pPoly ); // Note that this updates pLongArr, which is why we swapped it out earlier. sal_uInt16 nCount = pLongArr->size(); sal_uInt16 nIdx = 0; sal_uInt16 i = 0; - sal_Bool bSubtract = pTextRanger->IsInner(); + bool bSubtract = pTextRanger->IsInner(); while( i < nCount ) { sal_uLong nOldCount = pOld->size(); diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx index 0b5a5d085ad1..c98718b44c4f 100644 --- a/editeng/source/misc/unolingu.cxx +++ b/editeng/source/misc/unolingu.cxx @@ -170,7 +170,7 @@ sal_Bool SAL_CALL return xThes->hasLocale( rLocale ); else if (!pLocaleSeq) // if not already loaded save startup time by avoiding loading them now GetCfgLocales(); - sal_Bool bFound = sal_False; + bool bFound = false; sal_Int32 nLen = pLocaleSeq->getLength(); const Locale *pLocale = pLocaleSeq->getConstArray(); const Locale *pEnd = pLocale + nLen; @@ -263,7 +263,7 @@ sal_Bool SAL_CALL throw(uno::RuntimeException, std::exception) { GetSpell_Impl(); - sal_Bool bRes = sal_False; + bool bRes = false; if (xSpell.is()) bRes = xSpell->hasLanguage( nLanguage ); return bRes; @@ -277,7 +277,7 @@ sal_Bool SAL_CALL uno::RuntimeException, std::exception) { GetSpell_Impl(); - sal_Bool bRes = sal_True; + bool bRes = true; if (xSpell.is()) bRes = xSpell->isValid( rWord, nLanguage, rProperties ); return bRes; @@ -374,7 +374,7 @@ sal_Bool SAL_CALL throw(uno::RuntimeException, std::exception) { GetHyph_Impl(); - sal_Bool bRes = sal_False; + bool bRes = false; if (xHyph.is()) bRes = xHyph->hasLocale( rLocale ); return bRes; diff --git a/editeng/source/outliner/outlundo.cxx b/editeng/source/outliner/outlundo.cxx index f350cac557ce..e0fb6e33d6d8 100644 --- a/editeng/source/outliner/outlundo.cxx +++ b/editeng/source/outliner/outlundo.cxx @@ -72,7 +72,7 @@ void OutlinerUndoChangeParaFlags::ImplChangeFlags( sal_uInt16 nFlags ) OutlinerUndoChangeParaNumberingRestart::OutlinerUndoChangeParaNumberingRestart( Outliner* pOutliner, sal_Int32 nPara, sal_Int16 nOldNumberingStartValue, sal_Int16 nNewNumberingStartValue, - sal_Bool bOldParaIsNumberingRestart, sal_Bool bNewParaIsNumberingRestart ) + bool bOldParaIsNumberingRestart, bool bNewParaIsNumberingRestart ) : OutlinerUndoBase( OLUNDO_DEPTH, pOutliner ) { mnPara = nPara; @@ -166,16 +166,16 @@ OLUndoExpand::~OLUndoExpand() } -void OLUndoExpand::Restore( sal_Bool bUndo ) +void OLUndoExpand::Restore( bool bUndo ) { DBG_ASSERT(pOutliner,"Undo:No Outliner"); DBG_ASSERT(pOutliner->pEditEngine,"Outliner already deleted"); Paragraph* pPara; - sal_Bool bExpand = sal_False; + bool bExpand = false; sal_uInt16 _nId = GetId(); if((_nId == OLUNDO_EXPAND && !bUndo) || (_nId == OLUNDO_COLLAPSE && bUndo)) - bExpand = sal_True; + bExpand = true; if( !pParas ) { pPara = pOutliner->GetParagraph( nCount ); @@ -200,13 +200,13 @@ void OLUndoExpand::Restore( sal_Bool bUndo ) void OLUndoExpand::Undo() { - Restore( sal_True ); + Restore( true ); } void OLUndoExpand::Redo() { - Restore( sal_False ); + Restore( false ); } diff --git a/editeng/source/outliner/outlundo.hxx b/editeng/source/outliner/outlundo.hxx index 4d43adf744c9..277f1421368f 100644 --- a/editeng/source/outliner/outlundo.hxx +++ b/editeng/source/outliner/outlundo.hxx @@ -59,7 +59,7 @@ private: struct ParaRestartData { sal_Int16 mnNumberingStartValue; - sal_Bool mbParaIsNumberingRestart; + bool mbParaIsNumberingRestart; }; ParaRestartData maUndoData; @@ -69,7 +69,7 @@ private: public: OutlinerUndoChangeParaNumberingRestart( Outliner* pOutliner, sal_Int32 nPara, sal_Int16 nOldNumberingStartValue, sal_Int16 mnNewNumberingStartValue, - sal_Bool nOldbParaIsNumberingRestart, sal_Bool nbNewParaIsNumberingRestart ); + bool nOldbParaIsNumberingRestart, bool nbNewParaIsNumberingRestart ); virtual void Undo() SAL_OVERRIDE; virtual void Redo() SAL_OVERRIDE; @@ -116,7 +116,7 @@ public: class OLUndoExpand : public EditUndo { using SfxUndoAction::Repeat; - void Restore( sal_Bool bUndo ); + void Restore( bool bUndo ); public: OLUndoExpand( Outliner* pOut, sal_uInt16 nId ); virtual ~OLUndoExpand(); diff --git a/editeng/source/outliner/paralist.cxx b/editeng/source/outliner/paralist.cxx index 9d5cf42f844a..b17f74e1bd19 100644 --- a/editeng/source/outliner/paralist.cxx +++ b/editeng/source/outliner/paralist.cxx @@ -105,7 +105,7 @@ void Paragraph::SetParaIsNumberingRestart( bool bParaIsNumberingRestart ) mnNumberingStartValue = -1; } -void ParagraphList::Clear( sal_Bool bDestroyParagraphs ) +void ParagraphList::Clear( bool bDestroyParagraphs ) { if ( bDestroyParagraphs ) { @@ -173,21 +173,21 @@ void ParagraphList::MoveParagraphs( sal_Int32 nStart, sal_Int32 nDest, sal_Int32 } } -sal_Bool ParagraphList::HasChildren( Paragraph* pParagraph ) const +bool ParagraphList::HasChildren( Paragraph* pParagraph ) const { sal_Int32 n = GetAbsPos( pParagraph ); Paragraph* pNext = GetParagraph( ++n ); return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) ) ? sal_True : sal_False; } -sal_Bool ParagraphList::HasHiddenChildren( Paragraph* pParagraph ) const +bool ParagraphList::HasHiddenChildren( Paragraph* pParagraph ) const { sal_Int32 n = GetAbsPos( pParagraph ); Paragraph* pNext = GetParagraph( ++n ); return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && !pNext->IsVisible() ) ? sal_True : sal_False; } -sal_Bool ParagraphList::HasVisibleChildren( Paragraph* pParagraph ) const +bool ParagraphList::HasVisibleChildren( Paragraph* pParagraph ) const { sal_Int32 n = GetAbsPos( pParagraph ); Paragraph* pNext = GetParagraph( ++n ); diff --git a/editeng/source/outliner/paralist.hxx b/editeng/source/outliner/paralist.hxx index 8641e955e8aa..a19e42233bdb 100644 --- a/editeng/source/outliner/paralist.hxx +++ b/editeng/source/outliner/paralist.hxx @@ -32,7 +32,7 @@ class Paragraph; class ParagraphList { public: - void Clear( sal_Bool bDestroyParagraphs ); + void Clear( bool bDestroyParagraphs ); sal_Int32 GetParagraphCount() const { @@ -58,9 +58,9 @@ public: void MoveParagraphs( sal_Int32 nStart, sal_Int32 nDest, sal_Int32 nCount ); Paragraph* GetParent( Paragraph* pParagraph /*, sal_uInt16& rRelPos */ ) const; - sal_Bool HasChildren( Paragraph* pParagraph ) const; - sal_Bool HasHiddenChildren( Paragraph* pParagraph ) const; - sal_Bool HasVisibleChildren( Paragraph* pParagraph ) const; + bool HasChildren( Paragraph* pParagraph ) const; + bool HasHiddenChildren( Paragraph* pParagraph ) const; + bool HasVisibleChildren( Paragraph* pParagraph ) const; sal_Int32 GetChildCount( Paragraph* pParagraph ) const; void Expand( Paragraph* pParent ); diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index fcabc8605430..1f2f6d053b02 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -89,14 +89,14 @@ using namespace editeng; // Some helper functions // char -inline const SvxEscapementItem& GetEscapement(const SfxItemSet& rSet,sal_uInt16 nId,sal_Bool bInP=sal_True) +inline const SvxEscapementItem& GetEscapement(const SfxItemSet& rSet,sal_uInt16 nId,bool bInP=true) { return (const SvxEscapementItem&)rSet.Get( nId,bInP); } -inline const SvxLineSpacingItem& GetLineSpacing(const SfxItemSet& rSet,sal_uInt16 nId,sal_Bool bInP=sal_True) +inline const SvxLineSpacingItem& GetLineSpacing(const SfxItemSet& rSet,sal_uInt16 nId,bool bInP=true) { return (const SvxLineSpacingItem&)rSet.Get( nId,bInP); } // frm -inline const SvxLRSpaceItem& GetLRSpace(const SfxItemSet& rSet,sal_uInt16 nId,sal_Bool bInP=sal_True) +inline const SvxLRSpaceItem& GetLRSpace(const SfxItemSet& rSet,sal_uInt16 nId,bool bInP=true) { return (const SvxLRSpaceItem&)rSet.Get( nId,bInP); } -inline const SvxULSpaceItem& GetULSpace(const SfxItemSet& rSet,sal_uInt16 nId,sal_Bool bInP=sal_True) +inline const SvxULSpaceItem& GetULSpace(const SfxItemSet& rSet,sal_uInt16 nId,bool bInP=true) { return (const SvxULSpaceItem&)rSet.Get( nId,bInP); } #define PARDID ((RTFPardAttrMapIds*)&aPardMap[0]) @@ -438,7 +438,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) { // then switches to multi-line! SvxLineSpacingItem aLSpace( GetLineSpacing( *pSet, - PARDID->nLinespacing, sal_False )); + PARDID->nLinespacing, false )); // how much do you get from the line height value? @@ -580,7 +580,7 @@ SET_FONTALIGNMENT: nTokenValue = 6; if( IsCalcValue() ) CalcValue(); - const SvxEscapementItem& rOld = GetEscapement( *pSet, nEsc, sal_False ); + const SvxEscapementItem& rOld = GetEscapement( *pSet, nEsc, false ); short nEs; sal_uInt8 nProp; if( DFLT_ESC_AUTO_SUPER == rOld.GetEsc() ) @@ -927,7 +927,7 @@ ATTR_SETOVERLINE: nTokenValue = 6; if( IsCalcValue() ) CalcValue(); - const SvxEscapementItem& rOld = GetEscapement( *pSet, nEsc, sal_False ); + const SvxEscapementItem& rOld = GetEscapement( *pSet, nEsc, false ); short nEs; sal_uInt8 nProp; if( DFLT_ESC_AUTO_SUB == rOld.GetEsc() ) @@ -1820,7 +1820,7 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) return; SfxItemSet aTmp( *pAttrPool, &aWhichMap[0] ); - sal_Bool bOldFlag = bIsLeftToRightDef; + bool bOldFlag = bIsLeftToRightDef; bIsLeftToRightDef = true; switch( nToken ) { diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx index 1a2a13dea7d8..8a3eb5677d18 100644 --- a/editeng/source/uno/unoedprx.cxx +++ b/editeng/source/uno/unoedprx.cxx @@ -59,10 +59,10 @@ public: mnEEIndex(0), mnFieldOffset(0), mnFieldLen(0), - mbInField(sal_False), + mbInField(false), mnBulletOffset(0), mnBulletLen(0), - mbInBullet(sal_False) {}; + mbInBullet(false) {}; ~SvxAccessibleTextIndex() {}; // Get/Set current paragraph @@ -102,17 +102,17 @@ public: void SetFieldOffset( sal_Int32 nOffset, sal_Int32 nLen ) { mnFieldOffset = nOffset; mnFieldLen = nLen; } sal_Int32 GetFieldOffset() const { return mnFieldOffset; } sal_Int32 GetFieldLen() const { return mnFieldLen; } - void AreInField( sal_Bool bInField = sal_True ) { mbInField = bInField; } - sal_Bool InField() const { return mbInField; } + void AreInField( bool bInField = true ) { mbInField = bInField; } + bool InField() const { return mbInField; } void SetBulletOffset( sal_Int32 nOffset, sal_Int32 nLen ) { mnBulletOffset = nOffset; mnBulletLen = nLen; } sal_Int32 GetBulletOffset() const { return mnBulletOffset; } sal_Int32 GetBulletLen() const { return mnBulletLen; } - void AreInBullet( sal_Bool bInBullet = sal_True ) { mbInBullet = bInBullet; } - sal_Bool InBullet() const { return mbInBullet; } + void AreInBullet( bool bInBullet = true ) { mbInBullet = bInBullet; } + bool InBullet() const { return mbInBullet; } /// returns false if the given range is non-editable (e.g. contains bullets or _parts_ of fields) - sal_Bool IsEditableRange( const SvxAccessibleTextIndex& rEnd ) const; + bool IsEditableRange( const SvxAccessibleTextIndex& rEnd ) const; private: sal_Int32 mnPara; @@ -120,10 +120,10 @@ private: sal_Int32 mnEEIndex; sal_Int32 mnFieldOffset; sal_Int32 mnFieldLen; - sal_Bool mbInField; + bool mbInField; sal_Int32 mnBulletOffset; sal_Int32 mnBulletLen; - sal_Bool mbInBullet; + bool mbInBullet; }; ESelection MakeEESelection( const SvxAccessibleTextIndex& rStart, const SvxAccessibleTextIndex& rEnd ) @@ -177,10 +177,10 @@ void SvxAccessibleTextIndex::SetEEIndex( sal_uInt16 nEEIndex, const SvxTextForwa { // reset mnFieldOffset = 0; - mbInField = sal_False; + mbInField = false; mnFieldLen = 0; mnBulletOffset = 0; - mbInBullet = sal_False; + mbInBullet = false; mnBulletLen = 0; // set known values @@ -223,10 +223,10 @@ void SvxAccessibleTextIndex::SetIndex( sal_Int32 nIndex, const SvxTextForwarder& { // reset mnFieldOffset = 0; - mbInField = sal_False; + mbInField = false; mnFieldLen = 0; mnBulletOffset = 0; - mbInBullet = sal_False; + mbInBullet = false; mnBulletLen = 0; // set known values @@ -283,21 +283,21 @@ void SvxAccessibleTextIndex::SetIndex( sal_Int32 nIndex, const SvxTextForwarder& } } -sal_Bool SvxAccessibleTextIndex::IsEditableRange( const SvxAccessibleTextIndex& rEnd ) const +bool SvxAccessibleTextIndex::IsEditableRange( const SvxAccessibleTextIndex& rEnd ) const { if( GetIndex() > rEnd.GetIndex() ) return rEnd.IsEditableRange( *this ); if( InBullet() || rEnd.InBullet() ) - return sal_False; + return false; if( InField() && GetFieldOffset() ) - return sal_False; // within field + return false; // within field if( rEnd.InField() && rEnd.GetFieldOffset() >= rEnd.GetFieldLen() - 1 ) - return sal_False; // within field + return false; // within field - return sal_True; + return true; } diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index f20cddae10d4..6e14f3c496d2 100644 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -55,8 +55,8 @@ using namespace ::com::sun::star; class SvxUnoFieldData_Impl { public: - sal_Bool mbBoolean1; - sal_Bool mbBoolean2; + bool mbBoolean1; + bool mbBoolean2; sal_Int32 mnInt32; sal_Int16 mnInt16; OUString msString1; @@ -252,15 +252,15 @@ SvxUnoTextField::SvxUnoTextField( sal_Int32 nServiceId ) throw() switch( nServiceId ) { case text::textfield::Type::DATE: - mpImpl->mbBoolean2 = sal_True; + mpImpl->mbBoolean2 = true; mpImpl->mnInt32 = SVXDATEFORMAT_STDSMALL; - mpImpl->mbBoolean1 = sal_False; + mpImpl->mbBoolean1 = false; break; case text::textfield::Type::EXTENDED_TIME: case text::textfield::Type::TIME: - mpImpl->mbBoolean2 = sal_False; - mpImpl->mbBoolean1 = sal_False; + mpImpl->mbBoolean2 = false; + mpImpl->mbBoolean1 = false; mpImpl->mnInt32 = SVXTIMEFORMAT_STANDARD; break; @@ -269,14 +269,14 @@ SvxUnoTextField::SvxUnoTextField( sal_Int32 nServiceId ) throw() break; case text::textfield::Type::EXTENDED_FILE: - mpImpl->mbBoolean1 = sal_False; + mpImpl->mbBoolean1 = false; mpImpl->mnInt16 = text::FilenameDisplayFormat::FULL; break; case text::textfield::Type::AUTHOR: mpImpl->mnInt16 = SVXAUTHORFORMAT_FULLNAME; - mpImpl->mbBoolean1 = sal_False; - mpImpl->mbBoolean2 = sal_True; + mpImpl->mbBoolean1 = false; + mpImpl->mbBoolean2 = true; break; case text::textfield::Type::MEASURE: @@ -284,8 +284,8 @@ SvxUnoTextField::SvxUnoTextField( sal_Int32 nServiceId ) throw() break; default: - mpImpl->mbBoolean1 = sal_False; - mpImpl->mbBoolean2 = sal_False; + mpImpl->mbBoolean1 = false; + mpImpl->mbBoolean2 = false; mpImpl->mnInt32 = 0; mpImpl->mnInt16 = 0; @@ -314,10 +314,10 @@ SvxUnoTextField::SvxUnoTextField( uno::Reference< text::XTextRange > xAnchor, co { case text::textfield::Type::DATE: { - mpImpl->mbBoolean2 = sal_True; + mpImpl->mbBoolean2 = true; // #i35416# for variable date field, don't use invalid "0000-00-00" date, // use current date instead - sal_Bool bFixed = ((SvxDateField*)pData)->GetType() == SVXDATETYPE_FIX; + bool bFixed = ((SvxDateField*)pData)->GetType() == SVXDATETYPE_FIX; mpImpl->maDateTime = getDate( bFixed ? ((SvxDateField*)pData)->GetFixDate() : Date( Date::SYSTEM ).GetDate() ); @@ -327,13 +327,13 @@ SvxUnoTextField::SvxUnoTextField( uno::Reference< text::XTextRange > xAnchor, co break; case text::textfield::Type::TIME: - mpImpl->mbBoolean2 = sal_False; - mpImpl->mbBoolean1 = sal_False; + mpImpl->mbBoolean2 = false; + mpImpl->mbBoolean1 = false; mpImpl->mnInt32 = SVXTIMEFORMAT_STANDARD; break; case text::textfield::Type::EXTENDED_TIME: - mpImpl->mbBoolean2 = sal_False; + mpImpl->mbBoolean2 = false; mpImpl->maDateTime = getTime( ((SvxExtTimeField*)pData)->GetFixTime() ); mpImpl->mbBoolean1 = ((SvxExtTimeField*)pData)->GetType() == SVXTIMETYPE_FIX; mpImpl->mnInt32 = ((SvxExtTimeField*)pData)->GetFormat(); diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx index f667432e05d5..32b0f9eeba31 100644 --- a/editeng/source/uno/unofored.cxx +++ b/editeng/source/uno/unofored.cxx @@ -190,8 +190,8 @@ sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& // get list of char attribs rEditEngine.GetCharAttribs( nPara, aAttribs ); - sal_Bool bEmpty = sal_True; // we found no item inside the selection of this paragraph - sal_Bool bGaps = sal_False; // we found items but theire gaps between them + bool bEmpty = true; // we found no item inside the selection of this paragraph + bool bGaps = false; // we found items but theire gaps between them sal_Int32 nLastEnd = nPos; const SfxPoolItem* pParaItem = NULL; @@ -200,7 +200,7 @@ sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& { DBG_ASSERT(i->pAttr, "GetCharAttribs gives corrupt data"); - const sal_Bool bEmptyPortion = i->nStart == i->nEnd; + const bool bEmptyPortion = i->nStart == i->nEnd; if((!bEmptyPortion && i->nStart >= nEndPos) || (bEmptyPortion && i->nStart > nEndPos)) break; // break if we are already behind our selection @@ -223,16 +223,16 @@ sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& pParaItem = i->pAttr; if( bEmpty ) - bEmpty = sal_False; + bEmpty = false; if(!bGaps && i->nStart > nLastEnd) - bGaps = sal_True; + bGaps = true; nLastEnd = i->nEnd; } if( !bEmpty && !bGaps && nLastEnd < ( nEndPos - 1 ) ) - bGaps = sal_True; + bGaps = true; if( bEmpty ) eParaState = SFX_ITEM_DEFAULT; diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx index a051997c328e..84915f0b59f7 100644 --- a/editeng/source/uno/unoipset.cxx +++ b/editeng/source/uno/unoipset.cxx @@ -85,9 +85,9 @@ void SvxItemPropertySet::ClearAllUsrAny() -sal_Bool SvxUnoCheckForPositiveValue( const uno::Any& rVal ) +bool SvxUnoCheckForPositiveValue( const uno::Any& rVal ) { - sal_Bool bConvert = sal_True; // the default is that all metric items must be converted + bool bConvert = true; // the default is that all metric items must be converted sal_Int32 nValue = 0; if( rVal >>= nValue ) bConvert = (nValue > 0); diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 1c62b37d6ef0..659baec88cf4 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -444,7 +444,7 @@ void SAL_CALL SvxUnoTextRangeBase::_setPropertyValue( const OUString& PropertyNa if ( pMap ) { ESelection aSel( GetSelection() ); - sal_Bool bParaAttrib = (pMap->nWID >= EE_PARA_START) && ( pMap->nWID <= EE_PARA_END ); + bool bParaAttrib = (pMap->nWID >= EE_PARA_START) && ( pMap->nWID <= EE_PARA_END ); if( nPara == -1 && !bParaAttrib ) { @@ -561,7 +561,7 @@ bool SvxUnoTextRangeBase::SetPropertyValueHelper( const SfxItemSet&, const SfxIt SvxTextForwarder* pForwarder = pEditSource? pEditSource->GetTextForwarder() : NULL; if(pForwarder && pSelection) { - sal_Bool bParaIsNumberingRestart = sal_False; + bool bParaIsNumberingRestart = false; if( aValue >>= bParaIsNumberingRestart ) { pForwarder->SetParaIsNumberingRestart( pSelection->nStartPara, bParaIsNumberingRestart ); @@ -572,7 +572,7 @@ bool SvxUnoTextRangeBase::SetPropertyValueHelper( const SfxItemSet&, const SfxIt break; case EE_PARA_BULLETSTATE: { - sal_Bool bBullet = sal_True; + bool bBullet = true; if( aValue >>= bBullet ) { SfxBoolItem aItem( EE_PARA_BULLETSTATE, bBullet ); @@ -738,7 +738,7 @@ bool SvxUnoTextRangeBase::GetPropertyValueHelper( SfxItemSet& rSet, const SfxIt case EE_PARA_BULLETSTATE: { - sal_Bool bState = sal_False; + bool bState = false; if( rSet.GetItemState( EE_PARA_BULLETSTATE, true ) & (SFX_ITEM_SET|SFX_ITEM_DEFAULT)) { SfxBoolItem* pItem = (SfxBoolItem*)rSet.GetItem( EE_PARA_BULLETSTATE, true ); @@ -804,7 +804,7 @@ void SAL_CALL SvxUnoTextRangeBase::_setPropertyValues( const uno::Sequence< OUSt if( pMap ) { - sal_Bool bParaAttrib = (pMap->nWID >= EE_PARA_START) && ( pMap->nWID <= EE_PARA_END ); + bool bParaAttrib = (pMap->nWID >= EE_PARA_START) && ( pMap->nWID <= EE_PARA_END ); if( (nPara == -1) && !bParaAttrib ) { @@ -850,7 +850,7 @@ void SAL_CALL SvxUnoTextRangeBase::_setPropertyValues( const uno::Sequence< OUSt } } - sal_Bool bNeedsUpdate = sal_False; + bool bNeedsUpdate = false; if( pNewParaSet ) { @@ -863,7 +863,7 @@ void SAL_CALL SvxUnoTextRangeBase::_setPropertyValues( const uno::Sequence< OUSt pForwarder->SetParaAttribs( nTempPara, aSet ); nTempPara++; } - bNeedsUpdate = sal_True; + bNeedsUpdate = true; } delete pNewParaSet; @@ -875,7 +875,7 @@ void SAL_CALL SvxUnoTextRangeBase::_setPropertyValues( const uno::Sequence< OUSt if( pNewAttrSet->Count() ) { pForwarder->QuickSetAttribs( *pNewAttrSet, GetSelection() ); - bNeedsUpdate = sal_True; + bNeedsUpdate = true; } delete pNewAttrSet; delete pOldAttrSet; @@ -1083,13 +1083,13 @@ uno::Sequence< beans::PropertyState > SvxUnoTextRangeBase::_getPropertyStates(co pSet = new SfxItemSet( pForwarder->GetAttribs( aSel, EditEngineAttribs_OnlyHard ) ); } - sal_Bool bUnknownPropertyFound = sal_False; + bool bUnknownPropertyFound = false; for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++ ) { const SfxItemPropertySimpleEntry* pMap = mpPropSet->getPropertyMapEntry( *pNames++ ); if( NULL == pMap ) { - bUnknownPropertyFound = sal_True; + bUnknownPropertyFound = true; break; } bUnknownPropertyFound = !_getOnePropertyStates(pSet, pMap, *pState++); @@ -1287,7 +1287,7 @@ uno::Any SAL_CALL SvxUnoTextRangeBase::getPropertyDefault( const OUString& aProp return uno::Any( (sal_Int16)-1 ); case WID_PARAISNUMBERINGRESTART: - return uno::Any( (sal_Bool)sal_False ); + return uno::Any( false ); default: { @@ -2104,7 +2104,7 @@ void SvxPropertyValuesToItemSet( { if( pForwarder ) { - sal_Bool bParaIsNumberingRestart = sal_False; + bool bParaIsNumberingRestart = false; if( !(pProps[i].Value >>= bParaIsNumberingRestart) ) throw lang::IllegalArgumentException(); |