diff options
Diffstat (limited to 'editeng/source')
120 files changed, 4490 insertions, 4825 deletions
diff --git a/editeng/source/accessibility/AccessibleComponentBase.cxx b/editeng/source/accessibility/AccessibleComponentBase.cxx index 472ca07424c0..472ca07424c0 100644..100755 --- a/editeng/source/accessibility/AccessibleComponentBase.cxx +++ b/editeng/source/accessibility/AccessibleComponentBase.cxx diff --git a/editeng/source/accessibility/AccessibleContextBase.cxx b/editeng/source/accessibility/AccessibleContextBase.cxx index 881db48448dc..881db48448dc 100644..100755 --- a/editeng/source/accessibility/AccessibleContextBase.cxx +++ b/editeng/source/accessibility/AccessibleContextBase.cxx diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx index e7289ffcabf1..cbc7da65dd4a 100644..100755 --- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx +++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx @@ -191,14 +191,14 @@ namespace accessibility "AccessibleEditableTextPara::getLocale: paragraph index value overflow"); // return locale of first character in the paragraph - return SvxLanguageToLocale(aLocale, GetTextForwarder().GetLanguage( static_cast< USHORT >( GetParagraphIndex() ), 0 )); + return SvxLanguageToLocale(aLocale, GetTextForwarder().GetLanguage( static_cast< sal_uInt16 >( GetParagraphIndex() ), 0 )); } void AccessibleEditableTextPara::implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) { DBG_CHKTHIS( AccessibleEditableTextPara, NULL ); - USHORT nStart, nEnd; + sal_uInt16 nStart, nEnd; if( GetSelection( nStart, nEnd ) ) { @@ -232,13 +232,13 @@ namespace accessibility DBG_ASSERT(nParaIndex >= 0 && nParaIndex <= USHRT_MAX, "AccessibleEditableTextPara::implGetLineBoundary: paragraph index value overflow"); - const sal_Int32 nTextLen = rCacheTF.GetTextLen( static_cast< USHORT >( nParaIndex ) ); + const sal_Int32 nTextLen = rCacheTF.GetTextLen( static_cast< sal_uInt16 >( nParaIndex ) ); CheckPosition(nIndex); rBoundary.startPos = rBoundary.endPos = -1; - const USHORT nLineCount=rCacheTF.GetLineCount( static_cast< USHORT >( nParaIndex ) ); + const sal_uInt16 nLineCount=rCacheTF.GetLineCount( static_cast< sal_uInt16 >( nParaIndex ) ); if( nIndex == nTextLen ) { @@ -246,7 +246,7 @@ namespace accessibility if( nLineCount <= 1 ) rBoundary.startPos = 0; else - rBoundary.startPos = nTextLen - rCacheTF.GetLineLen( static_cast< USHORT >( nParaIndex ), + rBoundary.startPos = nTextLen - rCacheTF.GetLineLen( static_cast< sal_uInt16 >( nParaIndex ), nLineCount-1 ); rBoundary.endPos = nTextLen; @@ -254,15 +254,15 @@ namespace accessibility else { // normal line search - USHORT nLine; + sal_uInt16 nLine; sal_Int32 nCurIndex; for( nLine=0, nCurIndex=0; nLine<nLineCount; ++nLine ) { - nCurIndex += rCacheTF.GetLineLen( static_cast< USHORT >( nParaIndex ), nLine); + nCurIndex += rCacheTF.GetLineLen( static_cast< sal_uInt16 >( nParaIndex ), nLine); if( nCurIndex > nIndex ) { - rBoundary.startPos = nCurIndex - rCacheTF.GetLineLen(static_cast< USHORT >( nParaIndex ), nLine); + rBoundary.startPos = nCurIndex - rCacheTF.GetLineLen(static_cast< sal_uInt16 >( nParaIndex ), nLine); rBoundary.endPos = nCurIndex; break; } @@ -398,9 +398,9 @@ namespace accessibility GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX, "AccessibleEditableTextPara::MakeSelection: index value overflow"); - USHORT nParaIndex = static_cast< USHORT >( GetParagraphIndex() ); - return ESelection( nParaIndex, static_cast< USHORT >( nStartEEIndex ), - nParaIndex, static_cast< USHORT >( nEndEEIndex ) ); + sal_uInt16 nParaIndex = static_cast< sal_uInt16 >( GetParagraphIndex() ); + return ESelection( nParaIndex, static_cast< sal_uInt16 >( nStartEEIndex ), + nParaIndex, static_cast< sal_uInt16 >( nEndEEIndex ) ); } ESelection AccessibleEditableTextPara::MakeSelection( sal_Int32 nEEIndex ) @@ -445,12 +445,12 @@ namespace accessibility CheckPosition( nEnd ); } - sal_Bool AccessibleEditableTextPara::GetSelection( USHORT& nStartPos, USHORT& nEndPos ) SAL_THROW((uno::RuntimeException)) + sal_Bool AccessibleEditableTextPara::GetSelection( sal_uInt16& nStartPos, sal_uInt16& nEndPos ) SAL_THROW((uno::RuntimeException)) { DBG_CHKTHIS( AccessibleEditableTextPara, NULL ); ESelection aSelection; - USHORT nPara = static_cast< USHORT > ( GetParagraphIndex() ); + sal_uInt16 nPara = static_cast< sal_uInt16 > ( GetParagraphIndex() ); if( !GetEditViewForwarder().GetSelection( aSelection ) ) return sal_False; @@ -504,11 +504,11 @@ namespace accessibility return GetTextForwarder().GetText( MakeSelection(nStartIndex, nEndIndex) ); } - USHORT AccessibleEditableTextPara::GetTextLen() const SAL_THROW((uno::RuntimeException)) + sal_uInt16 AccessibleEditableTextPara::GetTextLen() const SAL_THROW((uno::RuntimeException)) { DBG_CHKTHIS( AccessibleEditableTextPara, NULL ); - return GetTextForwarder().GetTextLen( static_cast< USHORT >( GetParagraphIndex() ) ); + return GetTextForwarder().GetTextLen( static_cast< sal_uInt16 >( GetParagraphIndex() ) ); } sal_Bool AccessibleEditableTextPara::IsVisible() const @@ -659,7 +659,7 @@ namespace accessibility DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX, "AccessibleEditableTextPara::HaveChildren: paragraph index value overflow"); - return GetTextForwarder().HaveImageBullet( static_cast< USHORT >(GetParagraphIndex()) ); + return GetTextForwarder().HaveImageBullet( static_cast< sal_uInt16 >(GetParagraphIndex()) ); } sal_Bool AccessibleEditableTextPara::IsActive() const SAL_THROW((uno::RuntimeException)) @@ -785,7 +785,7 @@ namespace accessibility } } - sal_Bool AccessibleEditableTextPara::GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, sal_Int32 nIndex ) + sal_Bool AccessibleEditableTextPara::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_Int32 nIndex ) { DBG_CHKTHIS( AccessibleEditableTextPara, NULL ); @@ -797,8 +797,8 @@ namespace accessibility return GetTextForwarder().GetAttributeRun( nStartIndex, nEndIndex, - static_cast< USHORT >(GetParagraphIndex()), - static_cast< USHORT >(nIndex) ); + static_cast< sal_uInt16 >(GetParagraphIndex()), + static_cast< sal_uInt16 >(nIndex) ); } uno::Any SAL_CALL AccessibleEditableTextPara::queryInterface (const uno::Type & rType) throw (uno::RuntimeException) @@ -1054,7 +1054,7 @@ namespace accessibility SvxTextForwarder& rCacheTF = GetTextForwarder(); Point aLogPoint( GetViewForwarder().PixelToLogic( aPoint, rCacheTF.GetMapMode() ) ); - EBulletInfo aBulletInfo = rCacheTF.GetBulletInfo( static_cast< USHORT > (GetParagraphIndex()) ); + EBulletInfo aBulletInfo = rCacheTF.GetBulletInfo( static_cast< sal_uInt16 > (GetParagraphIndex()) ); if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && aBulletInfo.bVisible && @@ -1081,7 +1081,7 @@ namespace accessibility "AccessibleEditableTextPara::getBounds: index value overflow"); SvxTextForwarder& rCacheTF = GetTextForwarder(); - Rectangle aRect = rCacheTF.GetParaBounds( static_cast< USHORT >( GetParagraphIndex() ) ); + Rectangle aRect = rCacheTF.GetParaBounds( static_cast< sal_uInt16 >( GetParagraphIndex() ) ); // convert to screen coordinates Rectangle aScreenRect = AccessibleEditableTextPara::LogicToPixel( aRect, @@ -1179,7 +1179,7 @@ namespace accessibility // #104444# Added to XAccessibleComponent interface svtools::ColorConfig aColorConfig; - UINT32 nColor = aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor; + sal_uInt32 nColor = aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor; return static_cast<sal_Int32>(nColor); } @@ -1296,7 +1296,7 @@ namespace accessibility CheckPosition( nIndex ); SvxTextForwarder& rCacheTF = GetTextForwarder(); - Rectangle aRect = rCacheTF.GetCharBounds( static_cast< USHORT >( GetParagraphIndex() ), static_cast< USHORT >( nIndex ) ); + Rectangle aRect = rCacheTF.GetCharBounds( static_cast< sal_uInt16 >( GetParagraphIndex() ), static_cast< sal_uInt16 >( nIndex ) ); // convert to screen Rectangle aScreenRect = AccessibleEditableTextPara::LogicToPixel( aRect, @@ -1335,7 +1335,7 @@ namespace accessibility SolarMutexGuard aGuard; - USHORT nPara, nIndex; + sal_uInt16 nPara, nIndex; // offset from surrounding cell/shape Point aOffset( GetEEOffset() ); @@ -1346,7 +1346,7 @@ namespace accessibility Point aLogPoint( GetViewForwarder().PixelToLogic( aPoint, rCacheTF.GetMapMode() ) ); // re-offset to parent (paragraph) - Rectangle aParaRect = rCacheTF.GetParaBounds( static_cast< USHORT >( GetParagraphIndex() ) ); + Rectangle aParaRect = rCacheTF.GetParaBounds( static_cast< sal_uInt16 >( GetParagraphIndex() ) ); aLogPoint.Move( aParaRect.Left(), aParaRect.Top() ); if( rCacheTF.GetIndexAtPoint( aLogPoint, nPara, nIndex ) && @@ -1486,7 +1486,7 @@ namespace accessibility // implGetAttributeRunBoundary() method there case AccessibleTextType::ATTRIBUTE_RUN: { - const sal_Int32 nTextLen = GetTextForwarder().GetTextLen( static_cast< USHORT >( GetParagraphIndex() ) ); + const sal_Int32 nTextLen = GetTextForwarder().GetTextLen( static_cast< sal_uInt16 >( GetParagraphIndex() ) ); if( nIndex == nTextLen ) { @@ -1495,7 +1495,7 @@ namespace accessibility } else { - USHORT nStartIndex, nEndIndex; + sal_uInt16 nStartIndex, nEndIndex; if( GetAttributeRun(nStartIndex, nEndIndex, nIndex) ) { @@ -1534,8 +1534,8 @@ namespace accessibility // implGetAttributeRunBoundary() method there case AccessibleTextType::ATTRIBUTE_RUN: { - const sal_Int32 nTextLen = GetTextForwarder().GetTextLen( static_cast< USHORT >( GetParagraphIndex() ) ); - USHORT nStartIndex, nEndIndex; + const sal_Int32 nTextLen = GetTextForwarder().GetTextLen( static_cast< sal_uInt16 >( GetParagraphIndex() ) ); + sal_uInt16 nStartIndex, nEndIndex; if( nIndex == nTextLen ) { @@ -1591,7 +1591,7 @@ namespace accessibility { case AccessibleTextType::ATTRIBUTE_RUN: { - USHORT nStartIndex, nEndIndex; + sal_uInt16 nStartIndex, nEndIndex; if( GetAttributeRun(nStartIndex, nEndIndex, nIndex) ) { @@ -1832,7 +1832,7 @@ namespace accessibility // AccessibleEmptyEditSource relies on this behaviour GetEditViewForwarder( sal_True ); SvxAccessibleTextAdapter& rCacheTF = GetTextForwarder(); // MUST be after GetEditViewForwarder(), see method docs - USHORT nPara = static_cast< USHORT >( GetParagraphIndex() ); + sal_uInt16 nPara = static_cast< sal_uInt16 >( GetParagraphIndex() ); DBG_ASSERT(GetParagraphIndex() >= 0 && GetParagraphIndex() <= USHRT_MAX, "AccessibleEditableTextPara::setAttributes: index value overflow"); @@ -2081,9 +2081,9 @@ namespace accessibility SvxAccessibleTextAdapter& rT = GetTextForwarder(); const sal_Int32 nPara = GetParagraphIndex(); - USHORT nHyperLinks = 0; - USHORT nFields = rT.GetFieldCount( nPara ); - for ( USHORT n = 0; n < nFields; n++ ) + sal_uInt16 nHyperLinks = 0; + sal_uInt16 nFields = rT.GetFieldCount( nPara ); + for ( sal_uInt16 n = 0; n < nFields; n++ ) { EFieldInfo aField = rT.GetFieldInfo( nPara, n ); if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) ) @@ -2099,20 +2099,20 @@ namespace accessibility SvxAccessibleTextAdapter& rT = GetTextForwarder(); const sal_Int32 nPara = GetParagraphIndex(); - USHORT nHyperLink = 0; - USHORT nFields = rT.GetFieldCount( nPara ); - for ( USHORT n = 0; n < nFields; n++ ) + sal_uInt16 nHyperLink = 0; + sal_uInt16 nFields = rT.GetFieldCount( nPara ); + for ( sal_uInt16 n = 0; n < nFields; n++ ) { EFieldInfo aField = rT.GetFieldInfo( nPara, n ); if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) ) { if ( nHyperLink == nLinkIndex ) { - USHORT nEEStart = aField.aPosition.nIndex; + sal_uInt16 nEEStart = aField.aPosition.nIndex; // Translate EE Index to accessible index - USHORT nStart = rT.CalcEditEngineIndex( nPara, nEEStart ); - USHORT nEnd = nStart + aField.aCurrentText.Len(); + sal_uInt16 nStart = rT.CalcEditEngineIndex( nPara, nEEStart ); + sal_uInt16 nEnd = nStart + aField.aCurrentText.Len(); xRef = new AccessibleHyperlink( rT, new SvxFieldItem( *aField.pFieldItem ), nPara, nEEStart, nStart, nEnd, aField.aCurrentText ); break; } @@ -2130,13 +2130,13 @@ namespace accessibility // SvxAccessibleTextIndex aIndex; // aIndex.SetIndex(nPara, nCharIndex, rT); -// const USHORT nEEIndex = aIndex.GetEEIndex(); +// const sal_uInt16 nEEIndex = aIndex.GetEEIndex(); - const USHORT nEEIndex = rT.CalcEditEngineIndex( nPara, nCharIndex ); + const sal_uInt16 nEEIndex = rT.CalcEditEngineIndex( nPara, nCharIndex ); sal_Int32 nHLIndex = 0; - USHORT nHyperLink = 0; - USHORT nFields = rT.GetFieldCount( nPara ); - for ( USHORT n = 0; n < nFields; n++ ) + sal_uInt16 nHyperLink = 0; + sal_uInt16 nFields = rT.GetFieldCount( nPara ); + for ( sal_uInt16 n = 0; n < nFields; n++ ) { EFieldInfo aField = rT.GetFieldInfo( nPara, n ); if ( aField.pFieldItem->GetField()->ISA( SvxURLField ) ) @@ -2167,8 +2167,8 @@ namespace accessibility if (bValidPara) { // we explicitly allow for the index to point at the character right behind the text - if (0 <= nIndex && nIndex <= rCacheTF.GetTextLen( static_cast< USHORT >(nPara) )) - nRes = rCacheTF.GetLineNumberAtIndex( static_cast< USHORT >(nPara), static_cast< USHORT >(nIndex) ); + if (0 <= nIndex && nIndex <= rCacheTF.GetTextLen( static_cast< sal_uInt16 >(nPara) )) + nRes = rCacheTF.GetLineNumberAtIndex( static_cast< sal_uInt16 >(nPara), static_cast< sal_uInt16 >(nIndex) ); else throw lang::IndexOutOfBoundsException(); } @@ -2187,10 +2187,10 @@ namespace accessibility DBG_ASSERT( bValidPara, "getTextAtLineNumber: current paragraph index out of range" ); if (bValidPara) { - if (0 <= nLineNo && nLineNo < rCacheTF.GetLineCount( static_cast< USHORT >(nPara) )) + if (0 <= nLineNo && nLineNo < rCacheTF.GetLineCount( static_cast< sal_uInt16 >(nPara) )) { - USHORT nStart = 0, nEnd = 0; - rCacheTF.GetLineBoundaries( nStart, nEnd, static_cast< USHORT >(nPara), static_cast< USHORT >(nLineNo) ); + sal_uInt16 nStart = 0, nEnd = 0; + rCacheTF.GetLineBoundaries( nStart, nEnd, static_cast< sal_uInt16 >(nPara), static_cast< sal_uInt16 >(nLineNo) ); if (nStart != 0xFFFF && nEnd != 0xFFFF) { try diff --git a/editeng/source/accessibility/AccessibleHyperlink.cxx b/editeng/source/accessibility/AccessibleHyperlink.cxx index 8dd4be5b425f..5e83fe7bfedb 100644..100755 --- a/editeng/source/accessibility/AccessibleHyperlink.cxx +++ b/editeng/source/accessibility/AccessibleHyperlink.cxx @@ -50,7 +50,7 @@ using namespace ::com::sun::star; namespace accessibility { - AccessibleHyperlink::AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, USHORT nP, USHORT nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD ) + AccessibleHyperlink::AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, sal_uInt16 nP, sal_uInt16 nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD ) : rTA( r ) { pFld = p; diff --git a/editeng/source/accessibility/AccessibleHyperlink.hxx b/editeng/source/accessibility/AccessibleHyperlink.hxx index 7700be1e1c23..e974358052d5 100644..100755 --- a/editeng/source/accessibility/AccessibleHyperlink.hxx +++ b/editeng/source/accessibility/AccessibleHyperlink.hxx @@ -52,12 +52,12 @@ namespace accessibility SvxAccessibleTextAdapter& rTA; SvxFieldItem* pFld; - USHORT nPara, nRealIdx; // EE values + sal_uInt16 nPara, nRealIdx; // EE values sal_Int32 nStartIdx, nEndIdx; // translated values ::rtl::OUString aDescription; public: - AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, USHORT nP, USHORT nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD ); + AccessibleHyperlink( SvxAccessibleTextAdapter& r, SvxFieldItem* p, sal_uInt16 nP, sal_uInt16 nR, sal_Int32 nStt, sal_Int32 nEnd, const ::rtl::OUString& rD ); ~AccessibleHyperlink(); // XAccessibleAction diff --git a/editeng/source/accessibility/AccessibleImageBullet.cxx b/editeng/source/accessibility/AccessibleImageBullet.cxx index 7400004bd132..1a4bd5603307 100644..100755 --- a/editeng/source/accessibility/AccessibleImageBullet.cxx +++ b/editeng/source/accessibility/AccessibleImageBullet.cxx @@ -219,7 +219,7 @@ namespace accessibility "AccessibleImageBullet::getLocale: paragraph index value overflow"); // return locale of first character in the paragraph - return SvxLanguageToLocale(aLocale, GetTextForwarder().GetLanguage( static_cast< USHORT >( GetParagraphIndex() ), 0 )); + return SvxLanguageToLocale(aLocale, GetTextForwarder().GetLanguage( static_cast< sal_uInt16 >( GetParagraphIndex() ), 0 )); } void SAL_CALL AccessibleImageBullet::addEventListener( const uno::Reference< XAccessibleEventListener >& xListener ) throw (uno::RuntimeException) @@ -272,8 +272,8 @@ namespace accessibility "AccessibleEditableTextPara::getBounds: index value overflow"); SvxTextForwarder& rCacheTF = GetTextForwarder(); - EBulletInfo aBulletInfo = rCacheTF.GetBulletInfo( static_cast< USHORT > (GetParagraphIndex()) ); - Rectangle aParentRect = rCacheTF.GetParaBounds( static_cast< USHORT >( GetParagraphIndex() ) ); + EBulletInfo aBulletInfo = rCacheTF.GetBulletInfo( static_cast< sal_uInt16 > (GetParagraphIndex()) ); + Rectangle aParentRect = rCacheTF.GetParaBounds( static_cast< sal_uInt16 >( GetParagraphIndex() ) ); if( aBulletInfo.nParagraph != EE_PARA_NOT_FOUND && aBulletInfo.bVisible && @@ -365,7 +365,7 @@ namespace accessibility // #104444# Added to XAccessibleComponent interface svtools::ColorConfig aColorConfig; - UINT32 nColor = aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor; + sal_uInt32 nColor = aColorConfig.GetColorValue( svtools::FONTCOLOR ).nColor; return static_cast<sal_Int32>(nColor); } diff --git a/editeng/source/accessibility/AccessibleParaManager.cxx b/editeng/source/accessibility/AccessibleParaManager.cxx index c0b95ef6b5a6..c0b95ef6b5a6 100644..100755 --- a/editeng/source/accessibility/AccessibleParaManager.cxx +++ b/editeng/source/accessibility/AccessibleParaManager.cxx diff --git a/editeng/source/accessibility/AccessibleSelectionBase.cxx b/editeng/source/accessibility/AccessibleSelectionBase.cxx index c86d4fc23a74..c86d4fc23a74 100644..100755 --- a/editeng/source/accessibility/AccessibleSelectionBase.cxx +++ b/editeng/source/accessibility/AccessibleSelectionBase.cxx diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx index 41ec49fb2dd1..fe5bab90f099 100644..100755 --- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx +++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx @@ -103,8 +103,8 @@ namespace accessibility nEndIndex >= 0 && nEndIndex <= USHRT_MAX , "AccessibleStaticTextBase_Impl::MakeSelection: index value overflow"); - return ESelection( static_cast< USHORT >(nStartPara), static_cast< USHORT >(nStartIndex), - static_cast< USHORT >(nEndPara), static_cast< USHORT >(nEndIndex) ); + return ESelection( static_cast< sal_uInt16 >(nStartPara), static_cast< sal_uInt16 >(nStartIndex), + static_cast< sal_uInt16 >(nEndPara), static_cast< sal_uInt16 >(nEndIndex) ); } //------------------------------------------------------------------------ @@ -345,7 +345,7 @@ namespace accessibility sal_Int32 nIndex = 0; if( mpTextParagraph ) - nIndex = mpTextParagraph->GetTextForwarder().GetLineCount( static_cast< USHORT >(nParagraph) ); + nIndex = mpTextParagraph->GetTextForwarder().GetLineCount( static_cast< sal_uInt16 >(nParagraph) ); return nIndex; } @@ -399,7 +399,7 @@ namespace accessibility nFlatIndex - nCurrIndex + nCurrCount >= 0 && nFlatIndex - nCurrIndex + nCurrCount <= USHRT_MAX , "AccessibleStaticTextBase_Impl::Index2Internal: index value overflow"); - return EPosition( static_cast< USHORT >(nCurrPara), static_cast< USHORT >(nFlatIndex - nCurrIndex + nCurrCount) ); + return EPosition( static_cast< sal_uInt16 >(nCurrPara), static_cast< sal_uInt16 >(nFlatIndex - nCurrIndex + nCurrCount) ); } } @@ -411,7 +411,7 @@ namespace accessibility nFlatIndex - nCurrIndex + nCurrCount >= 0 && nFlatIndex - nCurrIndex + nCurrCount <= USHRT_MAX , "AccessibleStaticTextBase_Impl::Index2Internal: index value overflow"); - return EPosition( static_cast< USHORT >(nCurrPara-1), static_cast< USHORT >(nFlatIndex - nCurrIndex + nCurrCount) ); + return EPosition( static_cast< sal_uInt16 >(nCurrPara-1), static_cast< sal_uInt16 >(nFlatIndex - nCurrIndex + nCurrCount) ); } // not found? Out of bounds @@ -727,8 +727,8 @@ namespace accessibility // #112814# Use correct index offset if ( ( nIndex = rPara.getIndexAtPoint( aPoint ) ) != -1 ) - return mpImpl->Internal2Index( EPosition(sal::static_int_cast<USHORT>(i), - sal::static_int_cast<USHORT>(nIndex)) ); + return mpImpl->Internal2Index( EPosition(sal::static_int_cast<sal_uInt16>(i), + sal::static_int_cast<sal_uInt16>(nIndex)) ); } return -1; diff --git a/editeng/source/accessibility/AccessibleStringWrap.cxx b/editeng/source/accessibility/AccessibleStringWrap.cxx index adec29371cae..b6eeb4ab1245 100644..100755 --- a/editeng/source/accessibility/AccessibleStringWrap.cxx +++ b/editeng/source/accessibility/AccessibleStringWrap.cxx @@ -68,7 +68,7 @@ sal_Bool AccessibleStringWrap::GetCharacterBounds( sal_Int32 nIndex, Rectangle& else { sal_Int32 aXArray[2]; - mrDev.GetCaretPositions( maText, aXArray, static_cast< USHORT >(nIndex), 1 ); + mrDev.GetCaretPositions( maText, aXArray, static_cast< sal_uInt16 >(nIndex), 1 ); rRect.Left() = 0; rRect.Top() = 0; rRect.SetSize( Size(mrDev.GetTextHeight(), labs(aXArray[0] - aXArray[1])) ); diff --git a/editeng/source/accessibility/accessibility.src b/editeng/source/accessibility/accessibility.src index a02b29212290..a02b29212290 100644..100755 --- a/editeng/source/accessibility/accessibility.src +++ b/editeng/source/accessibility/accessibility.src diff --git a/editeng/source/accessibility/makefile.mk b/editeng/source/accessibility/makefile.mk deleted file mode 100644 index 530b6cac8b50..000000000000 --- a/editeng/source/accessibility/makefile.mk +++ /dev/null @@ -1,55 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=editeng -TARGET=accessibility -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/AccessibleStringWrap.obj \ - $(SLO)$/AccessibleContextBase.obj \ - $(SLO)$/AccessibleComponentBase.obj \ - $(SLO)$/AccessibleSelectionBase.obj \ - $(SLO)$/AccessibleStaticTextBase.obj \ - $(SLO)$/AccessibleParaManager.obj \ - $(SLO)$/AccessibleEditableTextPara.obj \ - $(SLO)$/AccessibleHyperlink.obj \ - $(SLO)$/AccessibleImageBullet.obj - -# --- Tagets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx index 1eedb045c262..39051f2af181 100644..100755 --- a/editeng/source/editeng/editattr.cxx +++ b/editeng/source/editeng/editattr.cxx @@ -76,13 +76,13 @@ EditAttrib::~EditAttrib() // ------------------------------------------------------------------------- // class EditCharAttrib // ------------------------------------------------------------------------- -EditCharAttrib::EditCharAttrib( const SfxPoolItem& rAttr, USHORT nS, USHORT nE ) +EditCharAttrib::EditCharAttrib( const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE ) : EditAttrib( rAttr ) { nStart = nS; nEnd = nE; - bFeature = FALSE; - bEdge = FALSE; + bFeature = sal_False; + bEdge = sal_False; DBG_ASSERT( ( rAttr.Which() >= EE_ITEMS_START ) && ( rAttr.Which() <= EE_ITEMS_END ), "EditCharAttrib CTOR: Invalid id!" ); DBG_ASSERT( ( rAttr.Which() < EE_FEATURE_START ) || ( rAttr.Which() > EE_FEATURE_END ) || ( nE == (nS+1) ), "EditCharAttrib CTOR: Invalid feature!" ); @@ -96,7 +96,7 @@ void EditCharAttrib::SetFont( SvxFont&, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribFont // ------------------------------------------------------------------------- -EditCharAttribFont::EditCharAttribFont( const SvxFontItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribFont::EditCharAttribFont( const SvxFontItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTINFO || rAttr.Which() == EE_CHAR_FONTINFO_CJK || rAttr.Which() == EE_CHAR_FONTINFO_CTL, "Not a Font attribute!" ); @@ -115,7 +115,7 @@ void EditCharAttribFont::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribItalic // ------------------------------------------------------------------------- -EditCharAttribItalic::EditCharAttribItalic( const SvxPostureItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribItalic::EditCharAttribItalic( const SvxPostureItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_ITALIC || rAttr.Which() == EE_CHAR_ITALIC_CJK || rAttr.Which() == EE_CHAR_ITALIC_CTL, "Not a Italic attribute!" ); @@ -129,7 +129,7 @@ void EditCharAttribItalic::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribWeight // ------------------------------------------------------------------------- -EditCharAttribWeight::EditCharAttribWeight( const SvxWeightItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribWeight::EditCharAttribWeight( const SvxWeightItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_WEIGHT || rAttr.Which() == EE_CHAR_WEIGHT_CJK || rAttr.Which() == EE_CHAR_WEIGHT_CTL, "Not a Weight attribute!" ); @@ -143,7 +143,7 @@ void EditCharAttribWeight::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribUnderline // ------------------------------------------------------------------------- -EditCharAttribUnderline::EditCharAttribUnderline( const SvxUnderlineItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribUnderline::EditCharAttribUnderline( const SvxUnderlineItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_UNDERLINE, "Not a Underline attribute!" ); @@ -159,7 +159,7 @@ void EditCharAttribUnderline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) // ------------------------------------------------------------------------- // class EditCharAttribOverline // ------------------------------------------------------------------------- -EditCharAttribOverline::EditCharAttribOverline( const SvxOverlineItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribOverline::EditCharAttribOverline( const SvxOverlineItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_OVERLINE, "Not a overline attribute!" ); @@ -175,7 +175,7 @@ void EditCharAttribOverline::SetFont( SvxFont& rFont, OutputDevice* pOutDev ) // ------------------------------------------------------------------------- // class EditCharAttribFontHeight // ------------------------------------------------------------------------- -EditCharAttribFontHeight::EditCharAttribFontHeight( const SvxFontHeightItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribFontHeight::EditCharAttribFontHeight( const SvxFontHeightItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTHEIGHT || rAttr.Which() == EE_CHAR_FONTHEIGHT_CJK || rAttr.Which() == EE_CHAR_FONTHEIGHT_CTL, "Not a Height attribute!" ); @@ -190,7 +190,7 @@ void EditCharAttribFontHeight::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribFontWidth // ------------------------------------------------------------------------- -EditCharAttribFontWidth::EditCharAttribFontWidth( const SvxCharScaleWidthItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribFontWidth::EditCharAttribFontWidth( const SvxCharScaleWidthItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_FONTWIDTH, "Not a Width attribute!" ); @@ -204,7 +204,7 @@ void EditCharAttribFontWidth::SetFont( SvxFont& /*rFont*/, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribStrikeout // ------------------------------------------------------------------------- -EditCharAttribStrikeout::EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribStrikeout::EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_STRIKEOUT, "Not a Size attribute!" ); @@ -218,7 +218,7 @@ void EditCharAttribStrikeout::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribColor // ------------------------------------------------------------------------- -EditCharAttribColor::EditCharAttribColor( const SvxColorItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribColor::EditCharAttribColor( const SvxColorItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_COLOR, "Not a Color attribute!" ); @@ -232,7 +232,7 @@ void EditCharAttribColor::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribLanguage // ------------------------------------------------------------------------- -EditCharAttribLanguage::EditCharAttribLanguage( const SvxLanguageItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribLanguage::EditCharAttribLanguage( const SvxLanguageItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( ( rAttr.Which() == EE_CHAR_LANGUAGE ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CJK ) || ( rAttr.Which() == EE_CHAR_LANGUAGE_CTL ), "Not a Language attribute!" ); @@ -246,7 +246,7 @@ void EditCharAttribLanguage::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribShadow // ------------------------------------------------------------------------- -EditCharAttribShadow::EditCharAttribShadow( const SvxShadowedItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribShadow::EditCharAttribShadow( const SvxShadowedItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_SHADOW, "Not a Shadow attribute!" ); @@ -254,26 +254,22 @@ EditCharAttribShadow::EditCharAttribShadow( const SvxShadowedItem& rAttr, USHORT void EditCharAttribShadow::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetShadow( (BOOL)((const SvxShadowedItem*)GetItem())->GetValue() ); + rFont.SetShadow( (sal_Bool)((const SvxShadowedItem*)GetItem())->GetValue() ); } // ------------------------------------------------------------------------- // class EditCharAttribEscapement // ------------------------------------------------------------------------- -EditCharAttribEscapement::EditCharAttribEscapement( const SvxEscapementItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribEscapement::EditCharAttribEscapement( const SvxEscapementItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_ESCAPEMENT, "Not a escapement attribute!" ); } -#if defined( WIN ) && !defined( WNT ) -#pragma optimize ("", off) -#endif - void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* ) { - USHORT nProp = ((const SvxEscapementItem*)GetItem())->GetProp(); - rFont.SetPropr( (BYTE)nProp ); + sal_uInt16 nProp = ((const SvxEscapementItem*)GetItem())->GetProp(); + rFont.SetPropr( (sal_uInt8)nProp ); short nEsc = ((const SvxEscapementItem*)GetItem())->GetEsc(); if ( nEsc == DFLT_ESC_AUTO_SUPER ) @@ -283,15 +279,10 @@ void EditCharAttribEscapement::SetFont( SvxFont& rFont, OutputDevice* ) rFont.SetEscapement( nEsc ); } -#if defined( WIN ) && !defined( WNT ) -#pragma optimize ("", on) -#endif - - // ------------------------------------------------------------------------- // class EditCharAttribOutline // ------------------------------------------------------------------------- -EditCharAttribOutline::EditCharAttribOutline( const SvxContourItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribOutline::EditCharAttribOutline( const SvxContourItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_OUTLINE, "Not a Outline attribute!" ); @@ -299,16 +290,16 @@ EditCharAttribOutline::EditCharAttribOutline( const SvxContourItem& rAttr, USHOR void EditCharAttribOutline::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetOutline( (BOOL)((const SvxContourItem*)GetItem())->GetValue() ); + rFont.SetOutline( (sal_Bool)((const SvxContourItem*)GetItem())->GetValue() ); } // ------------------------------------------------------------------------- // class EditCharAttribTab // ------------------------------------------------------------------------- -EditCharAttribTab::EditCharAttribTab( const SfxVoidItem& rAttr, USHORT nPos ) +EditCharAttribTab::EditCharAttribTab( const SfxVoidItem& rAttr, sal_uInt16 nPos ) : EditCharAttrib( rAttr, nPos, nPos+1 ) { - SetFeature( TRUE ); + SetFeature( sal_True ); } void EditCharAttribTab::SetFont( SvxFont&, OutputDevice* ) @@ -318,10 +309,10 @@ void EditCharAttribTab::SetFont( SvxFont&, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribLineBreak // ------------------------------------------------------------------------- -EditCharAttribLineBreak::EditCharAttribLineBreak( const SfxVoidItem& rAttr, USHORT nPos ) +EditCharAttribLineBreak::EditCharAttribLineBreak( const SfxVoidItem& rAttr, sal_uInt16 nPos ) : EditCharAttrib( rAttr, nPos, nPos+1 ) { - SetFeature( TRUE ); + SetFeature( sal_True ); } void EditCharAttribLineBreak::SetFont( SvxFont&, OutputDevice* ) @@ -331,10 +322,10 @@ void EditCharAttribLineBreak::SetFont( SvxFont&, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribField // ------------------------------------------------------------------------- -EditCharAttribField::EditCharAttribField( const SvxFieldItem& rAttr, USHORT nPos ) +EditCharAttribField::EditCharAttribField( const SvxFieldItem& rAttr, sal_uInt16 nPos ) : EditCharAttrib( rAttr, nPos, nPos+1 ) { - SetFeature( TRUE ); // !!! + SetFeature( sal_True ); // !!! pTxtColor = 0; pFldColor = 0; } @@ -344,7 +335,7 @@ void EditCharAttribField::SetFont( SvxFont& rFont, OutputDevice* ) if ( pFldColor ) { rFont.SetFillColor( *pFldColor ); - rFont.SetTransparent( FALSE ); + rFont.SetTransparent( sal_False ); } if ( pTxtColor ) rFont.SetColor( *pTxtColor ); @@ -364,28 +355,28 @@ EditCharAttribField::~EditCharAttribField() Reset(); } -BOOL EditCharAttribField::operator == ( const EditCharAttribField& rAttr ) const +sal_Bool EditCharAttribField::operator == ( const EditCharAttribField& rAttr ) const { if ( aFieldValue != rAttr.aFieldValue ) - return FALSE; + return sal_False; if ( ( pTxtColor && !rAttr.pTxtColor ) || ( !pTxtColor && rAttr.pTxtColor ) ) - return FALSE; + return sal_False; if ( ( pTxtColor && rAttr.pTxtColor ) && ( *pTxtColor != *rAttr.pTxtColor ) ) - return FALSE; + return sal_False; if ( ( pFldColor && !rAttr.pFldColor ) || ( !pFldColor && rAttr.pFldColor ) ) - return FALSE; + return sal_False; if ( ( pFldColor && rAttr.pFldColor ) && ( *pFldColor != *rAttr.pFldColor ) ) - return FALSE; + return sal_False; - return TRUE; + return sal_True; } // ------------------------------------------------------------------------- // class EditCharAttribPairKerning // ------------------------------------------------------------------------- -EditCharAttribPairKerning::EditCharAttribPairKerning( const SvxAutoKernItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribPairKerning::EditCharAttribPairKerning( const SvxAutoKernItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_PAIRKERNING, "Not a Pair Kerning!" ); @@ -399,7 +390,7 @@ void EditCharAttribPairKerning::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribKerning // ------------------------------------------------------------------------- -EditCharAttribKerning::EditCharAttribKerning( const SvxKerningItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribKerning::EditCharAttribKerning( const SvxKerningItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_KERNING, "Not a Kerning!" ); @@ -413,7 +404,7 @@ void EditCharAttribKerning::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribWordLineMode // ------------------------------------------------------------------------- -EditCharAttribWordLineMode::EditCharAttribWordLineMode( const SvxWordLineModeItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribWordLineMode::EditCharAttribWordLineMode( const SvxWordLineModeItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_WLM, "Not a Kerning!" ); @@ -427,7 +418,7 @@ void EditCharAttribWordLineMode::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribEmphasisMark // ------------------------------------------------------------------------- -EditCharAttribEmphasisMark::EditCharAttribEmphasisMark( const SvxEmphasisMarkItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribEmphasisMark::EditCharAttribEmphasisMark( const SvxEmphasisMarkItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_EMPHASISMARK, "Not a Emphasis attribute!" ); @@ -441,7 +432,7 @@ void EditCharAttribEmphasisMark::SetFont( SvxFont& rFont, OutputDevice* ) // ------------------------------------------------------------------------- // class EditCharAttribRelief // ------------------------------------------------------------------------- -EditCharAttribRelief::EditCharAttribRelief( const SvxCharReliefItem& rAttr, USHORT _nStart, USHORT _nEnd ) +EditCharAttribRelief::EditCharAttribRelief( const SvxCharReliefItem& rAttr, sal_uInt16 _nStart, sal_uInt16 _nEnd ) : EditCharAttrib( rAttr, _nStart, _nEnd ) { DBG_ASSERT( rAttr.Which() == EE_CHAR_RELIEF, "Not a relief attribute!" ); diff --git a/editeng/source/editeng/editattr.hxx b/editeng/source/editeng/editattr.hxx index a84a7a7f2f18..2d4cc9602ad5 100644..100755 --- a/editeng/source/editeng/editattr.hxx +++ b/editeng/source/editeng/editattr.hxx @@ -57,7 +57,7 @@ class SvxCharReliefItem; class SfxVoidItem; -#define CH_FEATURE_OLD (BYTE) 0xFF +#define CH_FEATURE_OLD (sal_uInt8) 0xFF #define CH_FEATURE (sal_Unicode) 0x01 // DEF_METRIC: For my pool, the DefMetric should always appear when @@ -84,7 +84,7 @@ public: // RemoveFromPool must always be called before the destructor!! void RemoveFromPool( SfxItemPool& rPool ); - USHORT Which() const { return pItem->Which(); } + sal_uInt16 Which() const { return pItem->Which(); } const SfxPoolItem* GetItem() const { return pItem; } }; @@ -97,72 +97,72 @@ class EditCharAttrib : public EditAttrib { protected: - USHORT nStart; - USHORT nEnd; - BOOL bFeature :1; - BOOL bEdge :1; + sal_uInt16 nStart; + sal_uInt16 nEnd; + sal_Bool bFeature :1; + sal_Bool bEdge :1; public: - EditCharAttrib( const SfxPoolItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttrib( const SfxPoolItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); - USHORT& GetStart() { return nStart; } - USHORT& GetEnd() { return nEnd; } + sal_uInt16& GetStart() { return nStart; } + sal_uInt16& GetEnd() { return nEnd; } - USHORT GetStart() const { return nStart; } - USHORT GetEnd() const { return nEnd; } + sal_uInt16 GetStart() const { return nStart; } + sal_uInt16 GetEnd() const { return nEnd; } - inline USHORT GetLen() const; + inline sal_uInt16 GetLen() const; - inline void MoveForward( USHORT nDiff ); - inline void MoveBackward( USHORT nDiff ); + inline void MoveForward( sal_uInt16 nDiff ); + inline void MoveBackward( sal_uInt16 nDiff ); - inline void Expand( USHORT nDiff ); - inline void Collaps( USHORT nDiff ); + inline void Expand( sal_uInt16 nDiff ); + inline void Collaps( sal_uInt16 nDiff ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); - BOOL IsIn( USHORT nIndex ) + sal_Bool IsIn( sal_uInt16 nIndex ) { return ( ( nStart <= nIndex ) && ( nEnd >= nIndex ) ); } - BOOL IsInside( USHORT nIndex ) + sal_Bool IsInside( sal_uInt16 nIndex ) { return ( ( nStart < nIndex ) && ( nEnd > nIndex ) ); } - BOOL IsEmpty() + sal_Bool IsEmpty() { return nStart == nEnd; } - BOOL IsFeature() const { return bFeature; } - void SetFeature( BOOL b) { bFeature = b; } + sal_Bool IsFeature() const { return bFeature; } + void SetFeature( sal_Bool b) { bFeature = b; } - BOOL IsEdge() const { return bEdge; } - void SetEdge( BOOL b ) { bEdge = b; } + sal_Bool IsEdge() const { return bEdge; } + void SetEdge( sal_Bool b ) { bEdge = b; } }; -inline USHORT EditCharAttrib::GetLen() const +inline sal_uInt16 EditCharAttrib::GetLen() const { DBG_ASSERT( nEnd >= nStart, "EditCharAttrib: nEnd < nStart!" ); return nEnd-nStart; } -inline void EditCharAttrib::MoveForward( USHORT nDiff ) +inline void EditCharAttrib::MoveForward( sal_uInt16 nDiff ) { DBG_ASSERT( ((long)nEnd + nDiff) <= 0xFFFF, "EditCharAttrib: MoveForward?!" ); nStart = nStart + nDiff; nEnd = nEnd + nDiff; } -inline void EditCharAttrib::MoveBackward( USHORT nDiff ) +inline void EditCharAttrib::MoveBackward( sal_uInt16 nDiff ) { DBG_ASSERT( ((long)nStart - nDiff) >= 0, "EditCharAttrib: MoveBackward?!" ); nStart = nStart - nDiff; nEnd = nEnd - nDiff; } -inline void EditCharAttrib::Expand( USHORT nDiff ) +inline void EditCharAttrib::Expand( sal_uInt16 nDiff ) { DBG_ASSERT( ( ((long)nEnd + nDiff) <= (long)0xFFFF ), "EditCharAttrib: Expand?!" ); DBG_ASSERT( !bFeature, "Please do not expand any features!" ); nEnd = nEnd + nDiff; } -inline void EditCharAttrib::Collaps( USHORT nDiff ) +inline void EditCharAttrib::Collaps( sal_uInt16 nDiff ) { DBG_ASSERT( (long)nEnd - nDiff >= (long)nStart, "EditCharAttrib: Collaps?!" ); DBG_ASSERT( !bFeature, "Please do not shrink any Features!" ); @@ -175,7 +175,7 @@ inline void EditCharAttrib::Collaps( USHORT nDiff ) class EditCharAttribFont: public EditCharAttrib { public: - EditCharAttribFont( const SvxFontItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribFont( const SvxFontItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -186,7 +186,7 @@ public: class EditCharAttribWeight : public EditCharAttrib { public: - EditCharAttribWeight( const SvxWeightItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribWeight( const SvxWeightItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -196,7 +196,7 @@ public: class EditCharAttribItalic : public EditCharAttrib { public: - EditCharAttribItalic( const SvxPostureItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribItalic( const SvxPostureItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -207,7 +207,7 @@ public: class EditCharAttribShadow : public EditCharAttrib { public: - EditCharAttribShadow( const SvxShadowedItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribShadow( const SvxShadowedItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -218,7 +218,7 @@ public: class EditCharAttribEscapement : public EditCharAttrib { public: - EditCharAttribEscapement( const SvxEscapementItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribEscapement( const SvxEscapementItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -229,7 +229,7 @@ public: class EditCharAttribOutline : public EditCharAttrib { public: - EditCharAttribOutline( const SvxContourItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribOutline( const SvxContourItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -240,7 +240,7 @@ public: class EditCharAttribStrikeout : public EditCharAttrib { public: - EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribStrikeout( const SvxCrossedOutItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -251,7 +251,7 @@ public: class EditCharAttribUnderline : public EditCharAttrib { public: - EditCharAttribUnderline( const SvxUnderlineItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribUnderline( const SvxUnderlineItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -262,7 +262,7 @@ public: class EditCharAttribOverline : public EditCharAttrib { public: - EditCharAttribOverline( const SvxOverlineItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribOverline( const SvxOverlineItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -273,7 +273,7 @@ public: class EditCharAttribEmphasisMark : public EditCharAttrib { public: - EditCharAttribEmphasisMark( const SvxEmphasisMarkItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribEmphasisMark( const SvxEmphasisMarkItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -284,7 +284,7 @@ public: class EditCharAttribRelief : public EditCharAttrib { public: - EditCharAttribRelief( const SvxCharReliefItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribRelief( const SvxCharReliefItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -295,7 +295,7 @@ public: class EditCharAttribFontHeight : public EditCharAttrib { public: - EditCharAttribFontHeight( const SvxFontHeightItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribFontHeight( const SvxFontHeightItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -306,7 +306,7 @@ public: class EditCharAttribFontWidth : public EditCharAttrib { public: - EditCharAttribFontWidth( const SvxCharScaleWidthItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribFontWidth( const SvxCharScaleWidthItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -317,7 +317,7 @@ public: class EditCharAttribColor : public EditCharAttrib { public: - EditCharAttribColor( const SvxColorItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribColor( const SvxColorItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -328,7 +328,7 @@ public: class EditCharAttribLanguage : public EditCharAttrib { public: - EditCharAttribLanguage( const SvxLanguageItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribLanguage( const SvxLanguageItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -339,7 +339,7 @@ public: class EditCharAttribTab : public EditCharAttrib { public: - EditCharAttribTab( const SfxVoidItem& rAttr, USHORT nPos ); + EditCharAttribTab( const SfxVoidItem& rAttr, sal_uInt16 nPos ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -350,7 +350,7 @@ public: class EditCharAttribLineBreak : public EditCharAttrib { public: - EditCharAttribLineBreak( const SfxVoidItem& rAttr, USHORT nPos ); + EditCharAttribLineBreak( const SfxVoidItem& rAttr, sal_uInt16 nPos ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -367,12 +367,12 @@ class EditCharAttribField: public EditCharAttrib EditCharAttribField& operator = ( const EditCharAttribField& rAttr ) const; public: - EditCharAttribField( const SvxFieldItem& rAttr, USHORT nPos ); + EditCharAttribField( const SvxFieldItem& rAttr, sal_uInt16 nPos ); EditCharAttribField( const EditCharAttribField& rAttr ); ~EditCharAttribField(); - BOOL operator == ( const EditCharAttribField& rAttr ) const; - BOOL operator != ( const EditCharAttribField& rAttr ) const + sal_Bool operator == ( const EditCharAttribField& rAttr ) const; + sal_Bool operator != ( const EditCharAttribField& rAttr ) const { return !(operator == ( rAttr ) ); } virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); @@ -396,7 +396,7 @@ public: class EditCharAttribPairKerning : public EditCharAttrib { public: - EditCharAttribPairKerning( const SvxAutoKernItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribPairKerning( const SvxAutoKernItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -407,7 +407,7 @@ public: class EditCharAttribKerning : public EditCharAttrib { public: - EditCharAttribKerning( const SvxKerningItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribKerning( const SvxKerningItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; @@ -418,7 +418,7 @@ public: class EditCharAttribWordLineMode: public EditCharAttrib { public: - EditCharAttribWordLineMode( const SvxWordLineModeItem& rAttr, USHORT nStart, USHORT nEnd ); + EditCharAttribWordLineMode( const SvxWordLineModeItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); virtual void SetFont( SvxFont& rFont, OutputDevice* pOutDev ); }; diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx index 73c2ab29571b..5286318f53eb 100644..100755 --- a/editeng/source/editeng/editdbg.cxx +++ b/editeng/source/editeng/editdbg.cxx @@ -88,7 +88,7 @@ ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ) case EE_PARA_NUMBULLET: { aDebStr += "NumItem "; - for ( USHORT nLevel = 0; nLevel < 3; nLevel++ ) + for ( sal_uInt16 nLevel = 0; nLevel < 3; nLevel++ ) { aDebStr += "Level"; aDebStr += ByteString::CreateFromInt32( nLevel ); @@ -148,14 +148,14 @@ ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ) else if ( ((SvxLineSpacingItem&)rItem).GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) { aDebStr += "Prop: "; - aDebStr += ByteString::CreateFromInt32( (ULONG)((SvxLineSpacingItem&)rItem).GetPropLineSpace() ); + aDebStr += ByteString::CreateFromInt32( (sal_uLong)((SvxLineSpacingItem&)rItem).GetPropLineSpace() ); } else aDebStr += "Unsupported Type!"; break; case EE_PARA_JUST: aDebStr += "SvxAdust="; - aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxAdjustItem&)rItem).GetAdjust() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)((SvxAdjustItem&)rItem).GetAdjust() ); break; case EE_PARA_TABS: { @@ -165,7 +165,7 @@ ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ) if ( rTabs.Count() ) { aDebStr += "( "; - for ( USHORT i = 0; i < rTabs.Count(); i++ ) + for ( sal_uInt16 i = 0; i < rTabs.Count(); i++ ) { const SvxTabStop& rTab = rTabs[i]; aDebStr += ByteString::CreateFromInt32( rTab.GetTabPos() ); @@ -179,17 +179,17 @@ ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ) case EE_CHAR_LANGUAGE_CJK: case EE_CHAR_LANGUAGE_CTL: aDebStr += "Language="; - aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxLanguageItem&)rItem).GetLanguage() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)((SvxLanguageItem&)rItem).GetLanguage() ); break; case EE_CHAR_COLOR: { aDebStr += "Color= "; Color aColor( ((SvxColorItem&)rItem).GetValue() ); - aDebStr += ByteString::CreateFromInt32( (USHORT)aColor.GetRed() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)aColor.GetRed() ); aDebStr += ", "; - aDebStr += ByteString::CreateFromInt32( (USHORT)aColor.GetGreen() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)aColor.GetGreen() ); aDebStr += ", "; - aDebStr += ByteString::CreateFromInt32( (USHORT)aColor.GetBlue() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)aColor.GetBlue() ); } break; case EE_CHAR_FONTINFO: @@ -199,7 +199,7 @@ ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ) aDebStr += "Font="; aDebStr += ByteString( ((SvxFontItem&)rItem).GetFamilyName(), RTL_TEXTENCODING_ASCII_US ); aDebStr += " (CharSet: "; - aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxFontItem&)rItem).GetCharSet() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)((SvxFontItem&)rItem).GetCharSet() ); aDebStr += ')'; } break; @@ -229,41 +229,41 @@ ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ) case EE_CHAR_WEIGHT_CJK: case EE_CHAR_WEIGHT_CTL: aDebStr += "FontWeight="; - aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxWeightItem&)rItem).GetWeight() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)((SvxWeightItem&)rItem).GetWeight() ); break; case EE_CHAR_UNDERLINE: aDebStr += "FontUnderline="; - aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxUnderlineItem&)rItem).GetLineStyle() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)((SvxUnderlineItem&)rItem).GetLineStyle() ); break; case EE_CHAR_OVERLINE: aDebStr += "FontOverline="; - aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxOverlineItem&)rItem).GetLineStyle() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)((SvxOverlineItem&)rItem).GetLineStyle() ); break; case EE_CHAR_EMPHASISMARK: aDebStr += "FontUnderline="; - aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxEmphasisMarkItem&)rItem).GetEmphasisMark() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)((SvxEmphasisMarkItem&)rItem).GetEmphasisMark() ); break; case EE_CHAR_RELIEF: aDebStr += "FontRelief="; - aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxCharReliefItem&)rItem).GetValue() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)((SvxCharReliefItem&)rItem).GetValue() ); break; case EE_CHAR_STRIKEOUT: aDebStr += "FontStrikeout="; - aDebStr +=ByteString::CreateFromInt32( (USHORT)((SvxCrossedOutItem&)rItem).GetStrikeout() ); + aDebStr +=ByteString::CreateFromInt32( (sal_uInt16)((SvxCrossedOutItem&)rItem).GetStrikeout() ); break; case EE_CHAR_ITALIC: case EE_CHAR_ITALIC_CJK: case EE_CHAR_ITALIC_CTL: aDebStr += "FontPosture="; - aDebStr +=ByteString::CreateFromInt32( (USHORT)((SvxPostureItem&)rItem).GetPosture() ); + aDebStr +=ByteString::CreateFromInt32( (sal_uInt16)((SvxPostureItem&)rItem).GetPosture() ); break; case EE_CHAR_OUTLINE: aDebStr += "FontOutline="; - aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxContourItem&)rItem).GetValue() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)((SvxContourItem&)rItem).GetValue() ); break; case EE_CHAR_SHADOW: aDebStr += "FontShadowed="; - aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxShadowedItem&)rItem).GetValue() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)((SvxShadowedItem&)rItem).GetValue() ); break; case EE_CHAR_ESCAPEMENT: aDebStr += "Escape="; @@ -273,7 +273,7 @@ ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ) break; case EE_CHAR_PAIRKERNING: aDebStr += "PairKerning="; - aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxAutoKernItem&)rItem).GetValue() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)((SvxAutoKernItem&)rItem).GetValue() ); break; case EE_CHAR_KERNING: { @@ -290,7 +290,7 @@ ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ) break; case EE_CHAR_WLM: aDebStr += "WordLineMode="; - aDebStr += ByteString::CreateFromInt32( (USHORT)((SvxWordLineModeItem&)rItem).GetValue() ); + aDebStr += ByteString::CreateFromInt32( (sal_uInt16)((SvxWordLineModeItem&)rItem).GetValue() ); break; case EE_CHAR_XMLATTRIBS: aDebStr += "XMLAttribs=..."; @@ -299,9 +299,9 @@ ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ) return aDebStr; } -void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, BOOL bSearchInParent, BOOL bShowALL ) +void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, sal_Bool bSearchInParent, sal_Bool bShowALL ) { - for ( USHORT nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) + for ( sal_uInt16 nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) { fprintf( fp, "\nWhich: %i\t", nWhich ); if ( rSet.GetItemState( nWhich, bSearchInParent ) == SFX_ITEM_OFF ) @@ -320,7 +320,7 @@ void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, BOOL bSearchInParent, BOOL } } -void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) +void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool bInfoBox ) { #if defined UNX FILE* fp = fopen( "/tmp/debug.log", "w" ); @@ -338,7 +338,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "================================================================================" ); fprintf( fp, "\n================== Document ================================================" ); fprintf( fp, "\n================================================================================" ); - for ( USHORT nPortion = 0; nPortion < pEE->pImpEditEngine->GetParaPortions(). Count(); nPortion++) + for ( sal_uInt16 nPortion = 0; nPortion < pEE->pImpEditEngine->GetParaPortions(). Count(); nPortion++) { ParaPortion* pPPortion = pEE->pImpEditEngine->GetParaPortions().GetObject(nPortion ); @@ -348,11 +348,11 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) if ( pStyle ) fprintf( fp, " %s", ByteString( pStyle->GetName(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); fprintf( fp, "\nParagraph attribute:" ); - DbgOutItemSet( fp, pPPortion->GetNode()->GetContentAttribs().GetItems(), FALSE, FALSE ); + DbgOutItemSet( fp, pPPortion->GetNode()->GetContentAttribs().GetItems(), sal_False, sal_False ); fprintf( fp, "\nCharacter attribute:" ); - BOOL bZeroAttr = FALSE; - USHORT z; + sal_Bool bZeroAttr = sal_False; + sal_uInt16 z; for ( z = 0; z < pPPortion->GetNode()->GetCharAttribs().Count(); z++ ) { EditCharAttrib* pAttr = pPPortion->GetNode()->GetCharAttribs().GetAttribs().GetObject( z ); @@ -366,7 +366,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) aCharAttribs += '\t'; aCharAttribs += ByteString::CreateFromInt32( pAttr->GetEnd() ); if ( pAttr->IsEmpty() ) - bZeroAttr = TRUE; + bZeroAttr = sal_True; fprintf( fp, "%s => ", aCharAttribs.GetBuffer() ); ByteString aDebStr = DbgOutItem( rPool, *pAttr->GetItem() ); @@ -375,7 +375,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) if ( bZeroAttr ) fprintf( fp, "\nNULL-Attribute!" ); - USHORT nTextPortions = pPPortion->GetTextPortions().Count(); + sal_uInt16 nTextPortions = pPPortion->GetTextPortions().Count(); ByteString aPortionStr("\nText portions: #"); aPortionStr += ByteString::CreateFromInt32( nTextPortions ); aPortionStr += " \nA"; @@ -385,7 +385,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) aPortionStr += "\nA"; aPortionStr += ByteString::CreateFromInt32( nPortion ); aPortionStr += ": "; - ULONG n = 0; + sal_uLong n = 0; for ( z = 0; z < nTextPortions; z++ ) { TextPortion* pPortion = pPPortion->GetTextPortions().GetObject( z ); @@ -395,7 +395,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) aPortionStr += ByteString::CreateFromInt32( pPortion->GetSize().Width() ); aPortionStr += ")"; aPortionStr += "["; - aPortionStr += ByteString::CreateFromInt32( (USHORT)pPortion->GetKind() ); + aPortionStr += ByteString::CreateFromInt32( (sal_uInt16)pPortion->GetKind() ); aPortionStr += "]"; aPortionStr += ";"; n += pPortion->GetLen(); @@ -411,7 +411,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "\n\nLines:" ); // First the content ... - USHORT nLine; + sal_uInt16 nLine; for ( nLine = 0; nLine < pPPortion->GetLines().Count(); nLine++ ) { EditLine* pLine = pPPortion->GetLines().GetObject( nLine ); @@ -432,8 +432,8 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) if ( pEE->pImpEditEngine->GetStyleSheetPool() ) { - ULONG nStyles = pEE->pImpEditEngine->GetStyleSheetPool() ? pEE->pImpEditEngine->GetStyleSheetPool()->Count() : 0; - fprintf( fp, "\n\n================================================================================" ); + sal_uLong nStyles = pEE->pImpEditEngine->GetStyleSheetPool() ? pEE->pImpEditEngine->GetStyleSheetPool()->Count() : 0; + fprintf( fp, "\n\n================================================================================" ); fprintf( fp, "\n================== Stylesheets =============================================" ); fprintf( fp, "\n================================================================================" ); fprintf( fp, "\n#Template: %lu\n", nStyles ); @@ -444,7 +444,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "\nTemplate: %s", ByteString( pStyle->GetName(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); fprintf( fp, "\nParent: %s", ByteString( pStyle->GetParent(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); fprintf( fp, "\nFollow: %s", ByteString( pStyle->GetFollow(), RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); - DbgOutItemSet( fp, pStyle->GetItemSet(), FALSE, FALSE ); + DbgOutItemSet( fp, pStyle->GetItemSet(), sal_False, sal_False ); fprintf( fp, "\n----------------------------------" ); pStyle = aIter.Next(); @@ -454,7 +454,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "\n\n================================================================================" ); fprintf( fp, "\n================== Defaults ================================================" ); fprintf( fp, "\n================================================================================" ); - DbgOutItemSet( fp, pEE->pImpEditEngine->GetEmptyItemSet(), TRUE, TRUE ); + DbgOutItemSet( fp, pEE->pImpEditEngine->GetEmptyItemSet(), sal_True, sal_True ); fprintf( fp, "\n\n================================================================================" ); fprintf( fp, "\n================== EditEngine & Views ======================================" ); @@ -466,7 +466,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "\nMinAutoPaperSize: %li x %li", pEE->GetMinAutoPaperSize().Width(), pEE->GetMinAutoPaperSize().Height() ); fprintf( fp, "\nUpdate: %i", pEE->GetUpdateMode() ); fprintf( fp, "\nNumber of Views: %i", pEE->GetViewCount() ); - for ( USHORT nView = 0; nView < pEE->GetViewCount(); nView++ ) + for ( sal_uInt16 nView = 0; nView < pEE->GetViewCount(); nView++ ) { EditView* pV = pEE->GetView( nView ); DBG_ASSERT( pV, "View not found!" ); @@ -483,7 +483,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) fprintf( fp, "\n\n================================================================================" ); fprintf( fp, "\n================== Current View ===========================================" ); fprintf( fp, "\n================================================================================" ); - DbgOutItemSet( fp, pEE->GetActiveView()->GetAttribs(), TRUE, FALSE ); + DbgOutItemSet( fp, pEE->GetActiveView()->GetAttribs(), sal_True, sal_False ); } fclose( fp ); if ( bInfoBox ) @@ -492,7 +492,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, BOOL bInfoBox ) ByteString EditDbg::GetPortionInfo( ParaPortion* pPPortion ) { - USHORT z; + sal_uInt16 z; ByteString aDebStr( "Paragraph Length = " ); aDebStr += ByteString::CreateFromInt32( pPPortion->GetNode()->Len() ); @@ -510,7 +510,7 @@ ByteString EditDbg::GetPortionInfo( ParaPortion* pPPortion ) } aDebStr += "\nText portions:"; - USHORT n = 0; + sal_uInt16 n = 0; for ( z = 0; z < pPPortion->GetTextPortions().Count(); z++ ) { TextPortion* pPortion = pPPortion->GetTextPortions().GetObject( z ); @@ -525,7 +525,7 @@ ByteString EditDbg::GetPortionInfo( ParaPortion* pPPortion ) aDebStr += "\nTotal length: "; aDebStr += ByteString::CreateFromInt32( n ); aDebStr += "\nSorted after Start:"; - for ( USHORT x = 0; x < pPPortion->GetNode()->GetCharAttribs().Count(); x++ ) + for ( sal_uInt16 x = 0; x < pPPortion->GetNode()->GetCharAttribs().Count(); x++ ) { EditCharAttrib* pCurAttrib = pPPortion->GetNode()->GetCharAttribs().GetAttribs().GetObject( x ); aDebStr += "\nStart: "; @@ -539,7 +539,7 @@ ByteString EditDbg::GetPortionInfo( ParaPortion* pPPortion ) ByteString EditDbg::GetTextPortionInfo( TextPortionList& rPortions ) { ByteString aDebStr; - for ( USHORT z = 0; z < rPortions.Count(); z++ ) + for ( sal_uInt16 z = 0; z < rPortions.Count(); z++ ) { TextPortion* pPortion = rPortions.GetObject( z ); aDebStr += " "; @@ -559,28 +559,28 @@ void EditDbg::ShowPortionData( ParaPortion* pPortion ) } -BOOL ParaPortion::DbgCheckTextPortions() +sal_Bool ParaPortion::DbgCheckTextPortions() { // check, if Portion length ok: - USHORT nXLen = 0; - for ( USHORT nPortion = 0; nPortion < aTextPortionList.Count(); nPortion++ ) + sal_uInt16 nXLen = 0; + for ( sal_uInt16 nPortion = 0; nPortion < aTextPortionList.Count(); nPortion++ ) nXLen = nXLen + aTextPortionList[nPortion]->GetLen(); - return nXLen == pNode->Len() ? TRUE : FALSE; + return nXLen == pNode->Len() ? sal_True : sal_False; } -BOOL CheckOrderedList( CharAttribArray& rAttribs, BOOL bStart ) +sal_Bool CheckOrderedList( CharAttribArray& rAttribs, sal_Bool bStart ) { - USHORT nPrev = 0; - for ( USHORT nAttr = 0; nAttr < rAttribs.Count(); nAttr++ ) + sal_uInt16 nPrev = 0; + for ( sal_uInt16 nAttr = 0; nAttr < rAttribs.Count(); nAttr++ ) { EditCharAttrib* pAttr = rAttribs[nAttr]; - USHORT nCur = bStart ? pAttr->GetStart() : pAttr->GetEnd(); + sal_uInt16 nCur = bStart ? pAttr->GetStart() : pAttr->GetEnd(); if ( nCur < nPrev ) - return FALSE; + return sal_False; nPrev = nCur; } - return TRUE; + return sal_True; } #endif diff --git a/editeng/source/editeng/editdbg.hxx b/editeng/source/editeng/editdbg.hxx index 03b78ff3a0d4..e8e2e1f6385c 100644..100755 --- a/editeng/source/editeng/editdbg.hxx +++ b/editeng/source/editeng/editdbg.hxx @@ -42,12 +42,12 @@ class SfxItemPool; class SfxPoolItem; ByteString DbgOutItem( const SfxItemPool& rPool, const SfxPoolItem& rItem ); -void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, BOOL bSearchInParent, BOOL bShowALL ); +void DbgOutItemSet( FILE* fp, const SfxItemSet& rSet, sal_Bool bSearchInParent, sal_Bool bShowALL ); class EditDbg { public: - static void ShowEditEngineData( EditEngine* pEditEngine, BOOL bInfoBox = TRUE ); + static void ShowEditEngineData( EditEngine* pEditEngine, sal_Bool bInfoBox = sal_True ); static void ShowPortionData( ParaPortion* pPortion ); static ByteString GetPortionInfo( ParaPortion* pPPortion ); static ByteString GetTextPortionInfo( TextPortionList& rPortions ); diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 1782a264b8fb..c745d50db675 100644..100755 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -72,9 +72,9 @@ using namespace ::com::sun::star; // ------------------------------------------------------------ -USHORT GetScriptItemId( USHORT nItemId, short nScriptType ) +sal_uInt16 GetScriptItemId( sal_uInt16 nItemId, short nScriptType ) { - USHORT nId = nItemId; + sal_uInt16 nId = nItemId; if ( ( nScriptType == i18n::ScriptType::ASIAN ) || ( nScriptType == i18n::ScriptType::COMPLEX ) ) @@ -102,9 +102,9 @@ USHORT GetScriptItemId( USHORT nItemId, short nScriptType ) return nId; } -BOOL IsScriptItemValid( USHORT nItemId, short nScriptType ) +sal_Bool IsScriptItemValid( sal_uInt16 nItemId, short nScriptType ) { - BOOL bValid = TRUE; + sal_Bool bValid = sal_True; switch ( nItemId ) { @@ -224,23 +224,23 @@ SfxItemInfo aItemInfos[EDITITEMCOUNT] = { { SID_FIELD, SFX_ITEM_POOLABLE } }; -USHORT aV1Map[] = { +sal_uInt16 aV1Map[] = { 3999, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4017, 4018, 4019 // MI: 4019? }; -USHORT aV2Map[] = { +sal_uInt16 aV2Map[] = { 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4018, 4019, 4020 }; -USHORT aV3Map[] = { +sal_uInt16 aV3Map[] = { 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021 }; -USHORT aV4Map[] = { +sal_uInt16 aV4Map[] = { 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, @@ -248,7 +248,7 @@ USHORT aV4Map[] = { 4034, 4035, 4036, 4037 }; -USHORT aV5Map[] = { +sal_uInt16 aV5Map[] = { 3994, 3995, 3996, 3997, 3998, 3999, 4000, 4001, 4002, 4003, 4004, 4005, 4006, 4007, 4008, 4009, 4010, 4011, 4012, 4013, 4014, 4015, 4016, 4017, 4018, 4019, 4020, 4021, 4022, 4023, @@ -258,10 +258,6 @@ USHORT aV5Map[] = { }; SV_IMPL_PTRARR( DummyContentList, ContentNode* ); -SV_IMPL_VARARR( ScriptTypePosInfos, ScriptTypePosInfo ); -SV_IMPL_VARARR( WritingDirectionInfos, WritingDirectionInfo ); -// SV_IMPL_VARARR( ExtraCharInfos, ExtraCharInfo ); - int SAL_CALL CompareStart( const void* pFirst, const void* pSecond ) { @@ -272,7 +268,7 @@ int SAL_CALL CompareStart( const void* pFirst, const void* pSecond ) return 0; } -EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, USHORT nS, USHORT nE ) +EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE ) { // Create a new attribute in the pool const SfxPoolItem& rNew = rPool.Put( rAttr ); @@ -422,8 +418,8 @@ EditLine::EditLine() nTxtWidth = 0; nCrsrHeight = 0; nMaxAscent = 0; - bHangingPunctuation = FALSE; - bInvalid = TRUE; + bHangingPunctuation = sal_False; + bInvalid = sal_True; } EditLine::EditLine( const EditLine& r ) @@ -442,7 +438,7 @@ EditLine::EditLine( const EditLine& r ) nTxtWidth = 0; nCrsrHeight = 0; nMaxAscent = 0; - bInvalid = TRUE; + bInvalid = sal_True; } EditLine::~EditLine() @@ -471,21 +467,21 @@ EditLine* EditLine::Clone() const return pL; } -BOOL operator == ( const EditLine& r1, const EditLine& r2 ) +sal_Bool operator == ( const EditLine& r1, const EditLine& r2 ) { if ( r1.nStart != r2.nStart ) - return FALSE; + return sal_False; if ( r1.nEnd != r2.nEnd ) - return FALSE; + return sal_False; if ( r1.nStartPortion != r2.nStartPortion ) - return FALSE; + return sal_False; if ( r1.nEndPortion != r2.nEndPortion ) - return FALSE; + return sal_False; - return TRUE; + return sal_True; } EditLine& EditLine::operator = ( const EditLine& r ) @@ -498,7 +494,7 @@ EditLine& EditLine::operator = ( const EditLine& r ) } -BOOL operator != ( const EditLine& r1, const EditLine& r2 ) +sal_Bool operator != ( const EditLine& r1, const EditLine& r2 ) { return !( r1 == r2 ); } @@ -509,11 +505,11 @@ Size EditLine::CalcTextSize( ParaPortion& rParaPortion ) Size aTmpSz; TextPortion* pPortion; - USHORT nIndex = GetStart(); + sal_uInt16 nIndex = GetStart(); DBG_ASSERT( rParaPortion.GetTextPortions().Count(), "GetTextSize before CreatePortions !" ); - for ( USHORT n = nStartPortion; n <= nEndPortion; n++ ) + for ( sal_uInt16 n = nStartPortion; n <= nEndPortion; n++ ) { pPortion = rParaPortion.GetTextPortions().GetObject(n); switch ( pPortion->GetKind() ) @@ -538,7 +534,7 @@ Size EditLine::CalcTextSize( ParaPortion& rParaPortion ) nIndex = nIndex + pPortion->GetLen(); } - SetHeight( (USHORT)aSz.Height() ); + SetHeight( (sal_uInt16)aSz.Height() ); return aSz; } @@ -553,22 +549,22 @@ EditLineList::~EditLineList() void EditLineList::Reset() { - for ( USHORT nLine = 0; nLine < Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < Count(); nLine++ ) delete GetObject(nLine); Remove( 0, Count() ); } -void EditLineList::DeleteFromLine( USHORT nDelFrom ) +void EditLineList::DeleteFromLine( sal_uInt16 nDelFrom ) { DBG_ASSERT( nDelFrom <= (Count() - 1), "DeleteFromLine: Out of range" ); - for ( USHORT nL = nDelFrom; nL < Count(); nL++ ) + for ( sal_uInt16 nL = nDelFrom; nL < Count(); nL++ ) delete GetObject(nL); Remove( nDelFrom, Count()-nDelFrom ); } -USHORT EditLineList::FindLine( USHORT nChar, BOOL bInclEnd ) +sal_uInt16 EditLineList::FindLine( sal_uInt16 nChar, sal_Bool bInclEnd ) { - for ( USHORT nLine = 0; nLine < Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < Count(); nLine++ ) { EditLine* pLine = GetObject( nLine ); if ( ( bInclEnd && ( pLine->GetEnd() >= nChar ) ) || @@ -582,26 +578,26 @@ USHORT EditLineList::FindLine( USHORT nChar, BOOL bInclEnd ) return ( Count() - 1 ); } -BOOL EditPaM::DbgIsBuggy( EditDoc& rDoc ) +sal_Bool EditPaM::DbgIsBuggy( EditDoc& rDoc ) { if ( !pNode ) - return TRUE; + return sal_True; if ( rDoc.GetPos( pNode ) >= rDoc.Count() ) - return TRUE; + return sal_True; if ( nIndex > pNode->Len() ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } -BOOL EditSelection::DbgIsBuggy( EditDoc& rDoc ) +sal_Bool EditSelection::DbgIsBuggy( EditDoc& rDoc ) { if ( aStartPaM.DbgIsBuggy( rDoc ) ) - return TRUE; + return sal_True; if ( aEndPaM.DbgIsBuggy( rDoc ) ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } EditSelection::EditSelection() @@ -630,20 +626,20 @@ EditSelection& EditSelection::operator = ( const EditPaM& rPaM ) return *this; } -BOOL EditSelection::IsInvalid() const +sal_Bool EditSelection::IsInvalid() const { EditPaM aEmptyPaM; if ( aStartPaM == aEmptyPaM ) - return TRUE; + return sal_True; if ( aEndPaM == aEmptyPaM ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } -BOOL EditSelection::Adjust( const ContentList& rNodes ) +sal_Bool EditSelection::Adjust( const ContentList& rNodes ) { DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index out of range in Adjust(1)" ); DBG_ASSERT( aEndPaM.GetIndex() <= aEndPaM.GetNode()->Len(), "Index out of range in Adjust(2)" ); @@ -651,17 +647,17 @@ BOOL EditSelection::Adjust( const ContentList& rNodes ) ContentNode* pStartNode = aStartPaM.GetNode(); ContentNode* pEndNode = aEndPaM.GetNode(); - USHORT nStartNode = rNodes.GetPos( pStartNode ); - USHORT nEndNode = rNodes.GetPos( pEndNode ); + sal_uInt16 nStartNode = rNodes.GetPos( pStartNode ); + sal_uInt16 nEndNode = rNodes.GetPos( pEndNode ); DBG_ASSERT( nStartNode != USHRT_MAX, "Node out of range in Adjust(1)" ); DBG_ASSERT( nEndNode != USHRT_MAX, "Node out of range in Adjust(2)" ); - BOOL bSwap = FALSE; + sal_Bool bSwap = sal_False; if ( nStartNode > nEndNode ) - bSwap = TRUE; + bSwap = sal_True; else if ( ( nStartNode == nEndNode ) && ( aStartPaM.GetIndex() > aEndPaM.GetIndex() ) ) - bSwap = TRUE; + bSwap = sal_True; if ( bSwap ) { @@ -673,15 +669,15 @@ BOOL EditSelection::Adjust( const ContentList& rNodes ) return bSwap; } -BOOL operator == ( const EditPaM& r1, const EditPaM& r2 ) +sal_Bool operator == ( const EditPaM& r1, const EditPaM& r2 ) { if ( r1.GetNode() != r2.GetNode() ) - return FALSE; + return sal_False; if ( r1.GetIndex() != r2.GetIndex() ) - return FALSE; + return sal_False; - return TRUE; + return sal_True; } EditPaM& EditPaM::operator = ( const EditPaM& rPaM ) @@ -691,7 +687,7 @@ EditPaM& EditPaM::operator = ( const EditPaM& rPaM ) return *this; } -BOOL operator != ( const EditPaM& r1, const EditPaM& r2 ) +sal_Bool operator != ( const EditPaM& r1, const EditPaM& r2 ) { return !( r1 == r2 ); } @@ -717,7 +713,7 @@ ContentNode::~ContentNode() #endif } -void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemPool ) +void ContentNode::ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNew, SfxItemPool& rItemPool ) { if ( !nNew ) return; @@ -728,10 +724,10 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP // an existing special case, must (n-1) opportunities be provided with // bResort. The most likely possibility receives no bResort, so that is // not sorted anew when all attributes are the same. - BOOL bResort = FALSE; - BOOL bExpandedEmptyAtIndexNull = FALSE; + sal_Bool bResort = sal_False; + sal_Bool bExpandedEmptyAtIndexNull = sal_False; - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttrib = GetAttrib( aCharAttribList.GetAttribs(), nAttr ); while ( pAttrib ) { @@ -753,7 +749,7 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP // if ( pAttrib->GetStart() == nIndex ) pAttrib->Expand( nNew ); if ( pAttrib->GetStart() == 0 ) - bExpandedEmptyAtIndexNull = TRUE; + bExpandedEmptyAtIndexNull = sal_True; } // 1: Attribute starts before, goes to index ... else if ( pAttrib->GetEnd() == nIndex ) // Start must be before @@ -768,7 +764,7 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP pAttrib->Expand( nNew ); } else - bResort = TRUE; + bResort = sal_True; } // 2: Attribute starts before, goes past the Index... else if ( ( pAttrib->GetStart() < nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) @@ -782,24 +778,24 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP if ( pAttrib->IsFeature() ) { pAttrib->MoveForward( nNew ); - bResort = TRUE; + bResort = sal_True; } else { - BOOL bExpand = FALSE; + sal_Bool bExpand = sal_False; if ( nIndex == 0 ) { - bExpand = TRUE; + bExpand = sal_True; if( bExpandedEmptyAtIndexNull ) { // Check if this kind of attribut was empty and expanded here... - USHORT nW = pAttrib->GetItem()->Which(); - for ( USHORT nA = 0; nA < nAttr; nA++ ) + sal_uInt16 nW = pAttrib->GetItem()->Which(); + for ( sal_uInt16 nA = 0; nA < nAttr; nA++ ) { EditCharAttrib* pA = aCharAttribList.GetAttribs()[nA]; if ( ( pA->GetStart() == 0 ) && ( pA->GetItem()->Which() == nW ) ) { - bExpand = FALSE; + bExpand = sal_False; break; } } @@ -809,7 +805,7 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP if ( bExpand ) { pAttrib->Expand( nNew ); - bResort = TRUE; + bResort = sal_True; } else { @@ -820,7 +816,7 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP } if ( pAttrib->IsEdge() ) - pAttrib->SetEdge( FALSE ); + pAttrib->SetEdge( sal_False ); DBG_ASSERT( !pAttrib->IsFeature() || ( pAttrib->GetLen() == 1 ), "Expand: FeaturesLen != 1" ); @@ -829,7 +825,7 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP if ( pAttrib->IsEmpty() ) { OSL_FAIL( "Empty Attribute after ExpandAttribs?" ); - bResort = TRUE; + bResort = sal_True; aCharAttribList.GetAttribs().Remove( nAttr ); rItemPool.Remove( *pAttrib->GetItem() ); delete pAttrib; @@ -845,32 +841,32 @@ void ContentNode::ExpandAttribs( USHORT nIndex, USHORT nNew, SfxItemPool& rItemP #ifndef SVX_LIGHT if ( pWrongList ) { - BOOL bSep = ( GetChar( nIndex ) == ' ' ) || IsFeature( nIndex ); + sal_Bool bSep = ( GetChar( nIndex ) == ' ' ) || IsFeature( nIndex ); pWrongList->TextInserted( nIndex, nNew, bSep ); } #endif // !SVX_LIGHT #ifdef EDITDEBUG - DBG_ASSERT( CheckOrderedList( aCharAttribList.GetAttribs(), TRUE ), "Expand: Start List distorted" ); + DBG_ASSERT( CheckOrderedList( aCharAttribList.GetAttribs(), sal_True ), "Expand: Start List distorted" ); #endif } -void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& rItemPool ) +void ContentNode::CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDeleted, SfxItemPool& rItemPool ) { if ( !nDeleted ) return; // Since features are treated differently than normal character attributes, // can also the order of the start list be change! - BOOL bResort = FALSE; - BOOL bDelAttr = FALSE; - USHORT nEndChanges = nIndex+nDeleted; + sal_Bool bResort = sal_False; + sal_Bool bDelAttr = sal_False; + sal_uInt16 nEndChanges = nIndex+nDeleted; - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttrib = GetAttrib( aCharAttribList.GetAttribs(), nAttr ); while ( pAttrib ) { - bDelAttr = FALSE; + bDelAttr = sal_False; if ( pAttrib->GetEnd() >= nIndex ) { // Move all Attribute behind the insert point... @@ -886,7 +882,7 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r if ( !pAttrib->IsFeature() && ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) ) pAttrib->GetEnd() = nIndex; // empty else - bDelAttr = TRUE; + bDelAttr = sal_True; } // 2. Attribute starts earlier, ends inside or behind it ... else if ( ( pAttrib->GetStart() <= nIndex ) && ( pAttrib->GetEnd() > nIndex ) ) @@ -904,7 +900,7 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r if ( pAttrib->IsFeature() ) { pAttrib->MoveBackward( nDeleted ); - bResort = TRUE; + bResort = sal_True; } else { @@ -919,14 +915,14 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r DBG_ASSERT( ( pAttrib->GetEnd() <= Len()) || bDelAttr, "Collaps: Attribute larger than paragraph!" ); if ( bDelAttr ) { - bResort = TRUE; + bResort = sal_True; aCharAttribList.GetAttribs().Remove( nAttr ); rItemPool.Remove( *pAttrib->GetItem() ); delete pAttrib; nAttr--; } else if ( pAttrib->IsEmpty() ) - aCharAttribList.HasEmptyAttribs() = TRUE; + aCharAttribList.HasEmptyAttribs() = sal_True; nAttr++; pAttrib = GetAttrib( aCharAttribList.GetAttribs(), nAttr ); @@ -941,17 +937,17 @@ void ContentNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted, SfxItemPool& r #endif // !SVX_LIGHT #ifdef EDITDEBUG - DBG_ASSERT( CheckOrderedList( aCharAttribList.GetAttribs(), TRUE ), "Collaps: Start list distorted" ); + DBG_ASSERT( CheckOrderedList( aCharAttribList.GetAttribs(), sal_True ), "Collaps: Start list distorted" ); #endif } -void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, BOOL bKeepEndingAttribs ) +void ContentNode::CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, sal_Bool bKeepEndingAttribs ) { DBG_ASSERT( pPrevNode, "Copy of attributes to a null pointer?" ); xub_StrLen nCut = pPrevNode->Len(); - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttrib = GetAttrib( pPrevNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttrib ) { @@ -1000,22 +996,22 @@ void ContentNode::AppendAttribs( ContentNode* pNextNode ) { DBG_ASSERT( pNextNode, "Copy of attributes to a null pointer?" ); - USHORT nNewStart = Len(); + sal_uInt16 nNewStart = Len(); #ifdef EDITDEBUG DBG_ASSERT( aCharAttribList.DbgCheckAttribs(), "Attribute before AppendAttribs broken" ); #endif - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttrib = GetAttrib( pNextNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttrib ) { // Move all attributes in the current node (this) - BOOL bMelted = FALSE; + sal_Bool bMelted = sal_False; if ( ( pAttrib->GetStart() == 0 ) && ( !pAttrib->IsFeature() ) ) { // Attributes can possibly be summarized as: - USHORT nTmpAttr = 0; + sal_uInt16 nTmpAttr = 0; EditCharAttrib* pTmpAttrib = GetAttrib( aCharAttribList.GetAttribs(), nTmpAttr ); while ( !bMelted && pTmpAttrib ) { @@ -1029,7 +1025,7 @@ void ContentNode::AppendAttribs( ContentNode* pNextNode ) pNextNode->GetCharAttribs().GetAttribs().Remove( nAttr ); // Unsubscribe from the pool?! delete pAttrib; - bMelted = TRUE; + bMelted = sal_True; } } ++nTmpAttr; @@ -1078,7 +1074,7 @@ void ContentNode::SetStyleSheet( SfxStyleSheet* pS, const SvxFont& rFontFromStyl GetContentAttribs().GetItems(), pS == NULL ); } -void ContentNode::SetStyleSheet( SfxStyleSheet* pS, BOOL bRecalcFont ) +void ContentNode::SetStyleSheet( SfxStyleSheet* pS, sal_Bool bRecalcFont ) { aContentAttribs.SetStyleSheet( pS ); if ( bRecalcFont ) @@ -1123,10 +1119,10 @@ ContentAttribs::~ContentAttribs() { } -SvxTabStop ContentAttribs::FindTabStop( long nCurPos, USHORT nDefTab ) +SvxTabStop ContentAttribs::FindTabStop( long nCurPos, sal_uInt16 nDefTab ) { const SvxTabStopItem& rTabs = (const SvxTabStopItem&) GetItem( EE_PARA_TABS ); - for ( USHORT i = 0; i < rTabs.Count(); i++ ) + for ( sal_uInt16 i = 0; i < rTabs.Count(); i++ ) { const SvxTabStop& rTab = rTabs[i]; if ( rTab.GetTabPos() > nCurPos ) @@ -1142,7 +1138,7 @@ SvxTabStop ContentAttribs::FindTabStop( long nCurPos, USHORT nDefTab ) void ContentAttribs::SetStyleSheet( SfxStyleSheet* pS ) { - BOOL bStyleChanged = ( pStyle != pS ); + sal_Bool bStyleChanged = ( pStyle != pS ); pStyle = pS; // Only when other style sheet, not when current style sheet modified if ( pStyle && bStyleChanged ) @@ -1151,7 +1147,7 @@ void ContentAttribs::SetStyleSheet( SfxStyleSheet* pS ) // which are specified in the style, so that the attributes of the // style can have an affect. const SfxItemSet& rStyleAttribs = pStyle->GetItemSet(); - for ( USHORT nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) + for ( sal_uInt16 nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) { // Don't change bullet on/off if ( ( nWhich != EE_PARA_BULLETSTATE ) && ( rStyleAttribs.GetItemState( nWhich ) == SFX_ITEM_ON ) ) @@ -1160,23 +1156,23 @@ void ContentAttribs::SetStyleSheet( SfxStyleSheet* pS ) } } -const SfxPoolItem& ContentAttribs::GetItem( USHORT nWhich ) +const SfxPoolItem& ContentAttribs::GetItem( sal_uInt16 nWhich ) { // Hard paragraph attributes take precedence! SfxItemSet* pTakeFrom = &aAttribSet; - if ( pStyle && ( aAttribSet.GetItemState( nWhich, FALSE ) != SFX_ITEM_ON ) ) + if ( pStyle && ( aAttribSet.GetItemState( nWhich, sal_False ) != SFX_ITEM_ON ) ) pTakeFrom = &pStyle->GetItemSet(); return pTakeFrom->Get( nWhich ); } -BOOL ContentAttribs::HasItem( USHORT nWhich ) +sal_Bool ContentAttribs::HasItem( sal_uInt16 nWhich ) { - BOOL bHasItem = FALSE; - if ( aAttribSet.GetItemState( nWhich, FALSE ) == SFX_ITEM_ON ) - bHasItem = TRUE; + sal_Bool bHasItem = sal_False; + if ( aAttribSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_ON ) + bHasItem = sal_True; else if ( pStyle && pStyle->GetItemSet().GetItemState( nWhich ) == SFX_ITEM_ON ) - bHasItem = TRUE; + bHasItem = sal_True; return bHasItem; } @@ -1186,7 +1182,7 @@ ItemList::ItemList() : CurrentItem( 0 ) { } -const SfxPoolItem* ItemList::FindAttrib( USHORT nWhich ) +const SfxPoolItem* ItemList::FindAttrib( sal_uInt16 nWhich ) { for ( size_t i = 0, n = aItemPool.size(); i < n; ++i ) if ( aItemPool[ i ]->Which() == nWhich ) @@ -1222,21 +1218,21 @@ EditDoc::EditDoc( SfxItemPool* pPool ) if ( pPool ) { pItemPool = pPool; - bOwnerOfPool = FALSE; + bOwnerOfPool = sal_False; } else { - pItemPool = new EditEngineItemPool( FALSE ); - bOwnerOfPool = TRUE; + pItemPool = new EditEngineItemPool( sal_False ); + bOwnerOfPool = sal_True; } nDefTab = DEFTAB; - bIsVertical = FALSE; - bIsFixedCellHeight = FALSE; + bIsVertical = sal_False; + bIsFixedCellHeight = sal_False; // Don't create a empty node, Clear() will be called in EditEngine-CTOR - SetModified( FALSE ); + SetModified( sal_False ); }; EditDoc::~EditDoc() @@ -1248,14 +1244,14 @@ EditDoc::~EditDoc() void EditDoc::ImplDestroyContents() { - for ( USHORT nNode = Count(); nNode; ) + for ( sal_uInt16 nNode = Count(); nNode; ) RemoveItemsFromPool( GetObject( --nNode ) ); DeleteAndDestroy( 0, Count() ); } void EditDoc::RemoveItemsFromPool( ContentNode* pNode ) { - for ( USHORT nAttr = 0; nAttr < pNode->GetCharAttribs().Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < pNode->GetCharAttribs().Count(); nAttr++ ) { EditCharAttrib* pAttr = pNode->GetCharAttribs().GetAttribs()[nAttr]; GetItemPool().Remove( *pAttr->GetItem() ); @@ -1266,13 +1262,13 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, s { Font aPrevFont( rFont ); rFont.SetAlign( ALIGN_BASELINE ); - rFont.SetTransparent( TRUE ); + rFont.SetTransparent( sal_True ); - USHORT nWhich_FontInfo = GetScriptItemId( EE_CHAR_FONTINFO, nScriptType ); - USHORT nWhich_Language = GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ); - USHORT nWhich_FontHeight = GetScriptItemId( EE_CHAR_FONTHEIGHT, nScriptType ); - USHORT nWhich_Weight = GetScriptItemId( EE_CHAR_WEIGHT, nScriptType ); - USHORT nWhich_Italic = GetScriptItemId( EE_CHAR_ITALIC, nScriptType ); + sal_uInt16 nWhich_FontInfo = GetScriptItemId( EE_CHAR_FONTINFO, nScriptType ); + sal_uInt16 nWhich_Language = GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ); + sal_uInt16 nWhich_FontHeight = GetScriptItemId( EE_CHAR_FONTHEIGHT, nScriptType ); + sal_uInt16 nWhich_Weight = GetScriptItemId( EE_CHAR_WEIGHT, nScriptType ); + sal_uInt16 nWhich_Italic = GetScriptItemId( EE_CHAR_ITALIC, nScriptType ); if ( bSearchInParent || ( rSet.GetItemState( nWhich_FontInfo ) == SFX_ITEM_ON ) ) { @@ -1306,8 +1302,8 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, s { const SvxEscapementItem& rEsc = (const SvxEscapementItem&) rSet.Get( EE_CHAR_ESCAPEMENT ); - USHORT nProp = rEsc.GetProp(); - rFont.SetPropr( (BYTE)nProp ); + sal_uInt16 nProp = rEsc.GetProp(); + rFont.SetPropr( (sal_uInt8)nProp ); short nEsc = rEsc.GetEsc(); if ( nEsc == DFLT_ESC_AUTO_SUPER ) @@ -1335,14 +1331,14 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, s rFont = aPrevFont; // => The same ImpPointer for IsSameInstance } -void EditDoc::CreateDefFont( BOOL bUseStyles ) +void EditDoc::CreateDefFont( sal_Bool bUseStyles ) { SfxItemSet aTmpSet( GetItemPool(), EE_PARA_START, EE_CHAR_END ); CreateFont( aDefFont, aTmpSet ); aDefFont.SetVertical( IsVertical() ); aDefFont.SetOrientation( IsVertical() ? 2700 : 0 ); - for ( USHORT nNode = 0; nNode < Count(); nNode++ ) + for ( sal_uInt16 nNode = 0; nNode < Count(); nNode++ ) { ContentNode* pNode = GetObject( nNode ); pNode->GetCharAttribs().GetDefFont() = aDefFont; @@ -1369,11 +1365,11 @@ XubString EditDoc::GetSepStr( LineEnd eEnd ) XubString EditDoc::GetText( LineEnd eEnd ) const { - ULONG nLen = GetTextLen(); - USHORT nNodes = Count(); + sal_uLong nLen = GetTextLen(); + sal_uInt16 nNodes = Count(); String aSep = EditDoc::GetSepStr( eEnd ); - USHORT nSepSize = aSep.Len(); + sal_uInt16 nSepSize = aSep.Len(); if ( nSepSize ) nLen += nNodes * nSepSize; @@ -1384,8 +1380,8 @@ XubString EditDoc::GetText( LineEnd eEnd ) const } xub_Unicode* pStr = new xub_Unicode[nLen+1]; xub_Unicode* pCur = pStr; - USHORT nLastNode = nNodes-1; - for ( USHORT nNode = 0; nNode < nNodes; nNode++ ) + sal_uInt16 nLastNode = nNodes-1; + for ( sal_uInt16 nNode = 0; nNode < nNodes; nNode++ ) { XubString aTmp( GetParaAsString( GetObject(nNode) ) ); memcpy( pCur, aTmp.GetBuffer(), aTmp.Len()*sizeof(sal_Unicode) ); @@ -1402,24 +1398,24 @@ XubString EditDoc::GetText( LineEnd eEnd ) const return aASCIIText; } -XubString EditDoc::GetParaAsString( USHORT nNode ) const +XubString EditDoc::GetParaAsString( sal_uInt16 nNode ) const { return GetParaAsString( SaveGetObject( nNode ) ); } -XubString EditDoc::GetParaAsString( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, BOOL bResolveFields ) const +XubString EditDoc::GetParaAsString( ContentNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, sal_Bool bResolveFields ) const { if ( nEndPos > pNode->Len() ) nEndPos = pNode->Len(); DBG_ASSERT( nStartPos <= nEndPos, "Start and End reversed?" ); - USHORT nIndex = nStartPos; + sal_uInt16 nIndex = nStartPos; XubString aStr; EditCharAttrib* pNextFeature = pNode->GetCharAttribs().FindFeature( nIndex ); while ( nIndex < nEndPos ) { - USHORT nEnd = nEndPos; + sal_uInt16 nEnd = nEndPos; if ( pNextFeature && ( pNextFeature->GetStart() < nEnd ) ) nEnd = pNextFeature->GetStart(); else @@ -1451,21 +1447,21 @@ XubString EditDoc::GetParaAsString( ContentNode* pNode, USHORT nStartPos, USHORT return aStr; } -ULONG EditDoc::GetTextLen() const +sal_uLong EditDoc::GetTextLen() const { - ULONG nLen = 0; - for ( USHORT nNode = 0; nNode < Count(); nNode++ ) + sal_uLong nLen = 0; + for ( sal_uInt16 nNode = 0; nNode < Count(); nNode++ ) { ContentNode* pNode = GetObject( nNode ); nLen += pNode->Len(); // Fields can be longer than the placeholder in the Node const CharAttribArray& rAttrs = pNode->GetCharAttribs().GetAttribs(); - for ( USHORT nAttr = rAttrs.Count(); nAttr; ) + for ( sal_uInt16 nAttr = rAttrs.Count(); nAttr; ) { EditCharAttrib* pAttr = rAttrs[--nAttr]; if ( pAttr->Which() == EE_FEATURE_FIELD ) { - USHORT nFieldLen = ((EditCharAttribField*)pAttr)->GetFieldValue().Len(); + sal_uInt16 nFieldLen = ((EditCharAttribField*)pAttr)->GetFieldValue().Len(); if ( !nFieldLen ) nLen--; else @@ -1483,15 +1479,15 @@ EditPaM EditDoc::Clear() ContentNode* pNode = new ContentNode( GetItemPool() ); Insert( pNode, 0 ); - CreateDefFont( FALSE ); + CreateDefFont( sal_False ); - SetModified( FALSE ); + SetModified( sal_False ); EditPaM aPaM( pNode, 0 ); return aPaM; } -void EditDoc::SetModified( BOOL b ) +void EditDoc::SetModified( sal_Bool b ) { bModified = b; if ( bModified ) @@ -1513,11 +1509,11 @@ EditPaM EditDoc::RemoveText() ContentNode* pNode = new ContentNode( GetItemPool() ); Insert( pNode, 0 ); - pNode->SetStyleSheet( pPrevStyle, FALSE ); + pNode->SetStyleSheet( pPrevStyle, sal_False ); pNode->GetContentAttribs().GetItems().Set( aPrevSet ); pNode->GetCharAttribs().GetDefFont() = aPrevFont; - SetModified( TRUE ); + SetModified( sal_True ); EditPaM aPaM( pNode, 0 ); return aPaM; @@ -1532,7 +1528,7 @@ void EditDoc::InsertText( const EditPaM& rPaM, xub_Unicode c ) rPaM.GetNode()->Insert( c, rPaM.GetIndex() ); rPaM.GetNode()->ExpandAttribs( rPaM.GetIndex(), 1, GetItemPool() ); - SetModified( TRUE ); + SetModified( sal_True ); } EditPaM EditDoc::InsertText( EditPaM aPaM, const XubString& rStr ) @@ -1546,16 +1542,16 @@ EditPaM EditDoc::InsertText( EditPaM aPaM, const XubString& rStr ) aPaM.GetNode()->ExpandAttribs( aPaM.GetIndex(), rStr.Len(), GetItemPool() ); aPaM.GetIndex() = aPaM.GetIndex() + rStr.Len(); - SetModified( TRUE ); + SetModified( sal_True ); return aPaM; } -EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, BOOL bKeepEndingAttribs ) +EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, sal_Bool bKeepEndingAttribs ) { DBG_ASSERT( aPaM.GetNode(), "Blinder PaM in EditDoc::InsertParaBreak" ); ContentNode* pCurNode = aPaM.GetNode(); - USHORT nPos = GetPos( pCurNode ); + sal_uInt16 nPos = GetPos( pCurNode ); XubString aStr = aPaM.GetNode()->Copy( aPaM.GetIndex() ); aPaM.GetNode()->Erase( aPaM.GetIndex() ); @@ -1563,7 +1559,7 @@ EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, BOOL bKeepEndingAttribs ) ContentAttribs aContentAttribs( aPaM.GetNode()->GetContentAttribs() ); // for a new paragraph we like to have the bullet/numbering visible by default - aContentAttribs.GetItems().Put( SfxBoolItem( EE_PARA_BULLETSTATE, TRUE), EE_PARA_BULLETSTATE ); + aContentAttribs.GetItems().Put( SfxBoolItem( EE_PARA_BULLETSTATE, sal_True), EE_PARA_BULLETSTATE ); // ContenNode constructor copies also the paragraph attributes ContentNode* pNode = new ContentNode( aStr, aContentAttribs ); @@ -1586,7 +1582,7 @@ EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, BOOL bKeepEndingAttribs ) Insert( pNode, nPos+1 ); - SetModified( TRUE ); + SetModified( sal_True ); aPaM.SetNode( pNode ); aPaM.SetIndex( 0 ); @@ -1605,7 +1601,7 @@ EditPaM EditDoc::InsertFeature( EditPaM aPaM, const SfxPoolItem& rItem ) DBG_ASSERT( pAttrib, "Why can not the feature be created?" ); aPaM.GetNode()->GetCharAttribs().InsertAttrib( pAttrib ); - SetModified( TRUE ); + SetModified( sal_True ); aPaM.GetIndex()++; return aPaM; @@ -1622,27 +1618,27 @@ EditPaM EditDoc::ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight ) // the one to the right disappears. RemoveItemsFromPool( pRight ); - USHORT nRight = GetPos( pRight ); + sal_uInt16 nRight = GetPos( pRight ); Remove( nRight ); delete pRight; - SetModified( TRUE ); + SetModified( sal_True ); return aPaM; } -EditPaM EditDoc::RemoveChars( EditPaM aPaM, USHORT nChars ) +EditPaM EditDoc::RemoveChars( EditPaM aPaM, sal_uInt16 nChars ) { // Maybe remove Features! aPaM.GetNode()->Erase( aPaM.GetIndex(), nChars ); aPaM.GetNode()->CollapsAttribs( aPaM.GetIndex(), nChars, GetItemPool() ); - SetModified( TRUE ); + SetModified( sal_True ); return aPaM; } -void EditDoc::InsertAttribInSelection( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ) +void EditDoc::InsertAttribInSelection( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem ) { DBG_ASSERT( pNode, "What to do with the attribute?" ); DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribute to large!" ); @@ -1677,17 +1673,17 @@ void EditDoc::InsertAttribInSelection( ContentNode* pNode, USHORT nStart, USHORT if ( pStartingAttrib ) pNode->GetCharAttribs().ResortAttribs(); - SetModified( TRUE ); + SetModified( sal_True ); } -BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, USHORT nWhich ) +sal_Bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt16 nWhich ) { EditCharAttrib* pStarting; EditCharAttrib* pEnding; return RemoveAttribs( pNode, nStart, nEnd, pStarting, pEnding, nWhich ); } -BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, USHORT nWhich ) +sal_Bool EditDoc::RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, sal_uInt16 nWhich ) { DBG_ASSERT( pNode, "What to do with the attribute?" ); @@ -1698,23 +1694,23 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi // This starts at the end of the selection => can be expanded rpStarting = 0; - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; DBG_ASSERT( nStart <= nEnd, "Small miscalculations in InsertAttribInSelection" ); // iterate over the attributes ... - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttr ) { - BOOL bRemoveAttrib = FALSE; - USHORT nAttrWhich = pAttr->Which(); + sal_Bool bRemoveAttrib = sal_False; + sal_uInt16 nAttrWhich = pAttr->Which(); if ( ( nAttrWhich < EE_FEATURE_START ) && ( !nWhich || ( nAttrWhich == nWhich ) ) ) { // Attribute starts in Selection if ( ( pAttr->GetStart() >= nStart ) && ( pAttr->GetStart() <= nEnd ) ) { - bChanged = TRUE; + bChanged = sal_True; if ( pAttr->GetEnd() > nEnd ) { pAttr->GetStart() = nEnd; // then it starts after this @@ -1725,14 +1721,14 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) ) { // Delete feature only if on the exact spot - bRemoveAttrib = TRUE; + bRemoveAttrib = sal_True; } } // Attribute ends in Selection else if ( ( pAttr->GetEnd() >= nStart ) && ( pAttr->GetEnd() <= nEnd ) ) { - bChanged = TRUE; + bChanged = sal_True; if ( ( pAttr->GetStart() < nStart ) && !pAttr->IsFeature() ) { pAttr->GetEnd() = nStart; // then it ends here @@ -1741,13 +1737,13 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) ) { // Delete feature only if on the exact spot - bRemoveAttrib = TRUE; + bRemoveAttrib = sal_True; } } // Attribute overlaps the selection else if ( ( pAttr->GetStart() <= nStart ) && ( pAttr->GetEnd() >= nEnd ) ) { - bChanged = TRUE; + bChanged = sal_True; if ( pAttr->GetStart() == nStart ) { pAttr->GetStart() = nEnd; @@ -1764,7 +1760,7 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi } else // Attribute must be split ... { - USHORT nOldEnd = pAttr->GetEnd(); + sal_uInt16 nOldEnd = pAttr->GetEnd(); pAttr->GetEnd() = nStart; rpEnding = pAttr; InsertAttrib( *pAttr->GetItem(), pNode, nEnd, nOldEnd ); @@ -1791,13 +1787,13 @@ BOOL EditDoc::RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, Edi // char attributes need to be sorted by start again pNode->GetCharAttribs().ResortAttribs(); - SetModified( TRUE ); + SetModified( sal_True ); } return bChanged; } -void EditDoc::InsertAttrib( const SfxPoolItem& rPoolItem, ContentNode* pNode, USHORT nStart, USHORT nEnd ) +void EditDoc::InsertAttrib( const SfxPoolItem& rPoolItem, ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd ) { // This method no longer checks whether a corresponding attribute already // exists at this place! @@ -1805,10 +1801,10 @@ void EditDoc::InsertAttrib( const SfxPoolItem& rPoolItem, ContentNode* pNode, US DBG_ASSERT( pAttrib, "MakeCharAttrib failed!" ); pNode->GetCharAttribs().InsertAttrib( pAttrib ); - SetModified( TRUE ); + SetModified( sal_True ); } -void EditDoc::InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ) +void EditDoc::InsertAttrib( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem ) { if ( nStart != nEnd ) { @@ -1832,7 +1828,7 @@ void EditDoc::InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, cons if ( pAttr->IsInside( nStart ) ) // split { // check again if really splitting, or return ! - USHORT nOldEnd = pAttr->GetEnd(); + sal_uInt16 nOldEnd = pAttr->GetEnd(); pAttr->GetEnd() = nStart; pAttr = MakeCharAttrib( GetItemPool(), *(pAttr->GetItem()), nStart, nOldEnd ); pNode->GetCharAttribs().InsertAttrib( pAttr ); @@ -1848,15 +1844,15 @@ void EditDoc::InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, cons InsertAttrib( rPoolItem, pNode, nStart, nStart ); } - SetModified( TRUE ); + SetModified( sal_True ); } -void EditDoc::FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet ) +void EditDoc::FindAttribs( ContentNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet ) { DBG_ASSERT( pNode, "Where to search?" ); DBG_ASSERT( nStartPos <= nEndPos, "Invalid region!" ); - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); // No Selection... if ( nStartPos == nEndPos ) @@ -1887,7 +1883,7 @@ void EditDoc::FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, if ( pItem ) { - USHORT nWhich = pItem->Which(); + sal_uInt16 nWhich = pItem->Which(); if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF ) { rCurSet.Put( *pItem ); @@ -1937,7 +1933,7 @@ void EditDoc::FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, if ( pItem ) { - USHORT nWhich = pItem->Which(); + sal_uInt16 nWhich = pItem->Which(); if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF ) { rCurSet.Put( *pItem ); @@ -1961,14 +1957,14 @@ void EditDoc::FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, CharAttribList::CharAttribList() { DBG_CTOR( EE_CharAttribList, 0 ); - bHasEmptyAttribs = FALSE; + bHasEmptyAttribs = sal_False; } CharAttribList::~CharAttribList() { DBG_DTOR( EE_CharAttribList, 0 ); - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttr = GetAttrib( aAttribs, nAttr ); while ( pAttr ) { @@ -1990,20 +1986,20 @@ void CharAttribList::InsertAttrib( EditCharAttrib* pAttrib ) // (InsertBinTextObject!) binary search would not be optimal here. // => Would bring something! - const USHORT nCount = Count(); - const USHORT nStart = pAttrib->GetStart(); // may be better for Comp.Opt. + const sal_uInt16 nCount = Count(); + const sal_uInt16 nStart = pAttrib->GetStart(); // may be better for Comp.Opt. if ( pAttrib->IsEmpty() ) - bHasEmptyAttribs = TRUE; + bHasEmptyAttribs = sal_True; - BOOL bInserted = FALSE; - for ( USHORT x = 0; x < nCount; x++ ) + sal_Bool bInserted = sal_False; + for ( sal_uInt16 x = 0; x < nCount; x++ ) { EditCharAttribPtr pCurAttrib = aAttribs[x]; if ( pCurAttrib->GetStart() > nStart ) { aAttribs.Insert( pAttrib, x ); - bInserted = TRUE; + bInserted = sal_True; break; } } @@ -2027,10 +2023,10 @@ void CharAttribList::ResortAttribs() void CharAttribList::OptimizeRanges( SfxItemPool& rItemPool ) { - for ( USHORT n = 0; n < aAttribs.Count(); n++ ) + for ( sal_uInt16 n = 0; n < aAttribs.Count(); n++ ) { EditCharAttrib* pAttr = aAttribs.GetObject( n ); - for ( USHORT nNext = n+1; nNext < aAttribs.Count(); nNext++ ) + for ( sal_uInt16 nNext = n+1; nNext < aAttribs.Count(); nNext++ ) { EditCharAttrib* p = aAttribs.GetObject( nNext ); if ( !pAttr->IsFeature() && ( p->GetStart() == pAttr->GetEnd() ) && ( p->Which() == pAttr->Which() ) ) @@ -2052,11 +2048,11 @@ void CharAttribList::OptimizeRanges( SfxItemPool& rItemPool ) } } -EditCharAttrib* CharAttribList::FindAttrib( USHORT nWhich, USHORT nPos ) +EditCharAttrib* CharAttribList::FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) { // Backwards, if one ends where the next starts. // => The starting one is the valid one ... - USHORT nAttr = aAttribs.Count()-1; + sal_uInt16 nAttr = aAttribs.Count()-1; EditCharAttrib* pAttr = GetAttrib( aAttribs, nAttr ); while ( pAttr ) { @@ -2067,11 +2063,11 @@ EditCharAttrib* CharAttribList::FindAttrib( USHORT nWhich, USHORT nPos ) return 0; } -EditCharAttrib* CharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromPos ) const +EditCharAttrib* CharAttribList::FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos ) const { DBG_ASSERT( nWhich, "FindNextAttrib: Which?" ); - const USHORT nAttribs = aAttribs.Count(); - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + const sal_uInt16 nAttribs = aAttribs.Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { EditCharAttrib* pAttr = aAttribs[ nAttr ]; if ( ( pAttr->GetStart() >= nFromPos ) && ( pAttr->Which() == nWhich ) ) @@ -2080,50 +2076,50 @@ EditCharAttrib* CharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromPos ) return 0; } -BOOL CharAttribList::HasAttrib( USHORT nWhich ) const +sal_Bool CharAttribList::HasAttrib( sal_uInt16 nWhich ) const { - for ( USHORT nAttr = aAttribs.Count(); nAttr; ) + for ( sal_uInt16 nAttr = aAttribs.Count(); nAttr; ) { const EditCharAttrib* pAttr = aAttribs[--nAttr]; if ( pAttr->Which() == nWhich ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL CharAttribList::HasAttrib( USHORT nStartPos, USHORT nEndPos ) const +sal_Bool CharAttribList::HasAttrib( sal_uInt16 nStartPos, sal_uInt16 nEndPos ) const { - BOOL bAttr = FALSE; - for ( USHORT nAttr = aAttribs.Count(); nAttr && !bAttr; ) + sal_Bool bAttr = sal_False; + for ( sal_uInt16 nAttr = aAttribs.Count(); nAttr && !bAttr; ) { const EditCharAttrib* pAttr = aAttribs[--nAttr]; if ( ( pAttr->GetStart() < nEndPos ) && ( pAttr->GetEnd() > nStartPos ) ) - return bAttr = TRUE; + return bAttr = sal_True; } return bAttr; } -BOOL CharAttribList::HasBoundingAttrib( USHORT nBound ) +sal_Bool CharAttribList::HasBoundingAttrib( sal_uInt16 nBound ) { // Backwards, if one ends where the next starts. // => The starting one is the valid one ... - USHORT nAttr = aAttribs.Count()-1; + sal_uInt16 nAttr = aAttribs.Count()-1; EditCharAttrib* pAttr = GetAttrib( aAttribs, nAttr ); while ( pAttr && ( pAttr->GetEnd() >= nBound ) ) { if ( ( pAttr->GetStart() == nBound ) || ( pAttr->GetEnd() == nBound ) ) - return TRUE; + return sal_True; pAttr = GetAttrib( aAttribs, --nAttr ); } - return FALSE; + return sal_False; } -EditCharAttrib* CharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos ) +EditCharAttrib* CharAttribList::FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ) { if ( !bHasEmptyAttribs ) return 0; - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pAttr = GetAttrib( aAttribs, nAttr ); while ( pAttr && ( pAttr->GetStart() <= nPos ) ) { @@ -2135,10 +2131,10 @@ EditCharAttrib* CharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos ) return 0; } -EditCharAttrib* CharAttribList::FindFeature( USHORT nPos ) const +EditCharAttrib* CharAttribList::FindFeature( sal_uInt16 nPos ) const { - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttrib* pNextAttrib = GetAttrib( aAttribs, nAttr ); // first to the desired position ... @@ -2161,7 +2157,7 @@ EditCharAttrib* CharAttribList::FindFeature( USHORT nPos ) const void CharAttribList::DeleteEmptyAttribs( SfxItemPool& rItemPool ) { - for ( USHORT nAttr = 0; nAttr < aAttribs.Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < aAttribs.Count(); nAttr++ ) { EditCharAttrib* pAttr = aAttribs[nAttr]; if ( pAttr->IsEmpty() ) @@ -2172,30 +2168,30 @@ void CharAttribList::DeleteEmptyAttribs( SfxItemPool& rItemPool ) nAttr--; } } - bHasEmptyAttribs = FALSE; + bHasEmptyAttribs = sal_False; } -BOOL CharAttribList::DbgCheckAttribs() +sal_Bool CharAttribList::DbgCheckAttribs() { #ifdef DBG_UTIL - BOOL bOK = TRUE; - for ( USHORT nAttr = 0; nAttr < aAttribs.Count(); nAttr++ ) + sal_Bool bOK = sal_True; + for ( sal_uInt16 nAttr = 0; nAttr < aAttribs.Count(); nAttr++ ) { EditCharAttrib* pAttr = aAttribs[nAttr]; if ( pAttr->GetStart() > pAttr->GetEnd() ) { - bOK = FALSE; + bOK = sal_False; OSL_FAIL( "Attribute is distorted" ); } else if ( pAttr->IsFeature() && ( pAttr->GetLen() != 1 ) ) { - bOK = FALSE; + bOK = sal_False; OSL_FAIL( "Feature, Len != 1" ); } } return bOK; #else - return TRUE; + return sal_True; #endif } @@ -2215,7 +2211,7 @@ SvxFontTable::~SvxFontTable() } } -ULONG SvxFontTable::GetId( const SvxFontItem& rFontItem ) +sal_uLong SvxFontTable::GetId( const SvxFontItem& rFontItem ) { SvxFontItem* pItem = First(); while ( pItem ) @@ -2267,7 +2263,7 @@ SvxColorItem* SvxColorList::GetObject( size_t nIndex ) return ( nIndex >= aColorList.size() ) ? NULL : aColorList[ nIndex ]; } -EditEngineItemPool::EditEngineItemPool( BOOL bPersistenRefCounts ) +EditEngineItemPool::EditEngineItemPool( sal_Bool bPersistenRefCounts ) : SfxItemPool( String( "EditEngineItemPool", RTL_TEXTENCODING_ASCII_US ), EE_ITEMS_START, EE_ITEMS_END, aItemInfos, 0, bPersistenRefCounts ) { @@ -2295,8 +2291,8 @@ SvStream& EditEngineItemPool::Store( SvStream& rStream ) const // stored until then... long nVersion = rStream.GetVersion(); - BOOL b31Format = ( nVersion && ( nVersion <= SOFFICE_FILEFORMAT_31 ) ) - ? TRUE : FALSE; + sal_Bool b31Format = ( nVersion && ( nVersion <= SOFFICE_FILEFORMAT_31 ) ) + ? sal_True : sal_False; EditEngineItemPool* pThis = (EditEngineItemPool*)this; if ( b31Format ) diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx index aa31b8ec489a..e0a8ea6ffb26 100644..100755 --- a/editeng/source/editeng/editdoc.hxx +++ b/editeng/source/editeng/editdoc.hxx @@ -40,6 +40,8 @@ #include <tools/table.hxx> #include <vector> +#include <deque> + class ImpEditEngine; class SvxTabStop; class SvtCTLOptions; @@ -50,45 +52,45 @@ DBG_NAMEEX( EE_TextPortion ) #define DEFTAB 720 void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent = true, short nScriptType = 0 ); -USHORT GetScriptItemId( USHORT nItemId, short nScriptType ); -BOOL IsScriptItemValid( USHORT nItemId, short nScriptType ); +sal_uInt16 GetScriptItemId( sal_uInt16 nItemId, short nScriptType ); +sal_Bool IsScriptItemValid( sal_uInt16 nItemId, short nScriptType ); -EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, USHORT nS, USHORT nE ); +EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE ); class ContentNode; class EditDoc; struct EPaM { - USHORT nPara; - USHORT nIndex; + sal_uInt16 nPara; + sal_uInt16 nIndex; EPaM() { nPara = 0; nIndex = 0; } - EPaM( USHORT nP, USHORT nI ) { nPara = nP; nIndex = nI; } + EPaM( sal_uInt16 nP, sal_uInt16 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 BOOL operator == ( const EPaM& r ) const; - inline BOOL operator < ( const EPaM& r ) const; + inline sal_Bool operator == ( const EPaM& r ) const; + inline sal_Bool operator < ( const EPaM& r ) const; }; -inline BOOL EPaM::operator < ( const EPaM& r ) const +inline sal_Bool EPaM::operator < ( const EPaM& r ) const { return ( ( nPara < r.nPara ) || - ( ( nPara == r.nPara ) && nIndex < r.nIndex ) ) ? TRUE : FALSE; + ( ( nPara == r.nPara ) && nIndex < r.nIndex ) ) ? sal_True : sal_False; } -inline BOOL EPaM::operator == ( const EPaM& r ) const +inline sal_Bool EPaM::operator == ( const EPaM& r ) const { - return ( ( nPara == r.nPara ) && ( nIndex == r.nIndex ) ) ? TRUE : FALSE; + return ( ( nPara == r.nPara ) && ( nIndex == r.nIndex ) ) ? sal_True : sal_False; } struct ScriptTypePosInfo { short nScriptType; - USHORT nStartPos; - USHORT nEndPos; + sal_uInt16 nStartPos; + sal_uInt16 nEndPos; - ScriptTypePosInfo( short _Type, USHORT _Start, USHORT _End ) + ScriptTypePosInfo( short _Type, sal_uInt16 _Start, sal_uInt16 _End ) { nScriptType = _Type; nStartPos = _Start; @@ -96,15 +98,15 @@ struct ScriptTypePosInfo } }; -SV_DECL_VARARR( ScriptTypePosInfos, ScriptTypePosInfo, 0, 4 ) +typedef std::deque< ScriptTypePosInfo > ScriptTypePosInfos; struct WritingDirectionInfo { - BYTE nType; - USHORT nStartPos; - USHORT nEndPos; + sal_uInt8 nType; + sal_uInt16 nStartPos; + sal_uInt16 nEndPos; - WritingDirectionInfo( BYTE _Type, USHORT _Start, USHORT _End ) + WritingDirectionInfo( sal_uInt8 _Type, sal_uInt16 _Start, sal_uInt16 _End ) { nType = _Type; nStartPos = _Start; @@ -112,7 +114,8 @@ struct WritingDirectionInfo } }; -SV_DECL_VARARR( WritingDirectionInfos, WritingDirectionInfo, 0, 4 ) + +typedef std::deque< WritingDirectionInfo > WritingDirectionInfos; typedef EditCharAttrib* EditCharAttribPtr; SV_DECL_PTRARR( CharAttribArray, EditCharAttribPtr, 0, 4 ) @@ -146,7 +149,7 @@ public: SvxFontTable(); ~SvxFontTable(); - ULONG GetId( const SvxFontItem& rFont ); + sal_uLong GetId( const SvxFontItem& rFont ); }; // ---------------------------------------------------------------------- @@ -206,13 +209,13 @@ public: ContentAttribs( const ContentAttribs& ); ~ContentAttribs(); // only for larger Tabs - SvxTabStop FindTabStop( long nCurPos, USHORT nDefTab ); + SvxTabStop FindTabStop( long nCurPos, sal_uInt16 nDefTab ); SfxItemSet& GetItems() { return aAttribSet; } SfxStyleSheet* GetStyleSheet() const { return pStyle; } void SetStyleSheet( SfxStyleSheet* pS ); - const SfxPoolItem& GetItem( USHORT nWhich ); - BOOL HasItem( USHORT nWhich ); + const SfxPoolItem& GetItem( sal_uInt16 nWhich ); + sal_Bool HasItem( sal_uInt16 nWhich ); }; // ------------------------------------------------------------------------- @@ -223,7 +226,7 @@ class CharAttribList private: CharAttribArray aAttribs; SvxFont aDefFont; // faster than ever from the pool! - BOOL bHasEmptyAttribs; + sal_Bool bHasEmptyAttribs; CharAttribList( const CharAttribList& ) {;} @@ -234,32 +237,32 @@ public: void DeleteEmptyAttribs( SfxItemPool& rItemPool ); void RemoveItemsFromPool( SfxItemPool* pItemPool ); - EditCharAttrib* FindAttrib( USHORT nWhich, USHORT nPos ); - EditCharAttrib* FindNextAttrib( USHORT nWhich, USHORT nFromPos ) const; - EditCharAttrib* FindEmptyAttrib( USHORT nWhich, USHORT nPos ); - EditCharAttrib* FindFeature( USHORT nPos ) const; + EditCharAttrib* FindAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ); + EditCharAttrib* FindNextAttrib( sal_uInt16 nWhich, sal_uInt16 nFromPos ) const; + EditCharAttrib* FindEmptyAttrib( sal_uInt16 nWhich, sal_uInt16 nPos ); + EditCharAttrib* FindFeature( sal_uInt16 nPos ) const; void ResortAttribs(); void OptimizeRanges( SfxItemPool& rItemPool ); - USHORT Count() { return aAttribs.Count(); } + sal_uInt16 Count() { return aAttribs.Count(); } void Clear() { aAttribs.Remove( 0, aAttribs.Count()); } void InsertAttrib( EditCharAttrib* pAttrib ); SvxFont& GetDefFont() { return aDefFont; } - BOOL HasEmptyAttribs() const { return bHasEmptyAttribs; } - BOOL& HasEmptyAttribs() { return bHasEmptyAttribs; } - BOOL HasBoundingAttrib( USHORT nBound ); - BOOL HasAttrib( USHORT nWhich ) const; - BOOL HasAttrib( USHORT nStartPos, USHORT nEndPos ) const; + sal_Bool HasEmptyAttribs() const { return bHasEmptyAttribs; } + sal_Bool& HasEmptyAttribs() { return bHasEmptyAttribs; } + sal_Bool HasBoundingAttrib( sal_uInt16 nBound ); + sal_Bool HasAttrib( sal_uInt16 nWhich ) const; + sal_Bool HasAttrib( sal_uInt16 nStartPos, sal_uInt16 nEndPos ) const; CharAttribArray& GetAttribs() { return aAttribs; } const CharAttribArray& GetAttribs() const { return aAttribs; } // Debug: - BOOL DbgCheckAttribs(); + sal_Bool DbgCheckAttribs(); }; // ------------------------------------------------------------------------- @@ -280,12 +283,12 @@ public: ContentAttribs& GetContentAttribs() { return aContentAttribs; } CharAttribList& GetCharAttribs() { return aCharAttribList; } - void ExpandAttribs( USHORT nIndex, USHORT nNewChars, SfxItemPool& rItemPool ); - void CollapsAttribs( USHORT nIndex, USHORT nDelChars, SfxItemPool& rItemPool ); + void ExpandAttribs( sal_uInt16 nIndex, sal_uInt16 nNewChars, SfxItemPool& rItemPool ); + void CollapsAttribs( sal_uInt16 nIndex, sal_uInt16 nDelChars, SfxItemPool& rItemPool ); void AppendAttribs( ContentNode* pNextNode ); - void CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, BOOL bKeepEndingAttribs ); + void CopyAndCutAttribs( ContentNode* pPrevNode, SfxItemPool& rPool, sal_Bool bKeepEndingAttribs ); - void SetStyleSheet( SfxStyleSheet* pS, BOOL bRecalcFont = TRUE ); + void SetStyleSheet( SfxStyleSheet* pS, sal_Bool bRecalcFont = sal_True ); void SetStyleSheet( SfxStyleSheet* pS, const SvxFont& rFontFromStyle ); SfxStyleSheet* GetStyleSheet() { return aContentAttribs.GetStyleSheet(); } @@ -297,7 +300,7 @@ public: void CreateWrongList(); void DestroyWrongList(); - BOOL IsFeature( USHORT nPos ) const { return ( GetChar( nPos ) == CH_FEATURE ); } + sal_Bool IsFeature( sal_uInt16 nPos ) const { return ( GetChar( nPos ) == CH_FEATURE ); } }; typedef ContentNode* ContentNodePtr; @@ -305,10 +308,10 @@ SV_DECL_PTRARR( DummyContentList, ContentNodePtr, 0, 4 ) class ContentList : public DummyContentList { - USHORT nLastCache; + sal_uInt16 nLastCache; public: ContentList() : DummyContentList( 0, 4 ), nLastCache(0) {} - USHORT GetPos( const ContentNodePtr &rPtr ) const; + sal_uInt16 GetPos( const ContentNodePtr &rPtr ) const; }; // ------------------------------------------------------------------------- @@ -318,27 +321,27 @@ class EditPaM { private: ContentNode* pNode; - USHORT nIndex; + sal_uInt16 nIndex; public: EditPaM() { pNode = NULL; nIndex = 0; } - EditPaM( ContentNode* p, USHORT n ) { pNode = p; nIndex = n; } + EditPaM( ContentNode* p, sal_uInt16 n ) { pNode = p; nIndex = n; } ContentNode* GetNode() const { return pNode; } void SetNode( ContentNode* p) { pNode = p; } - USHORT GetIndex() const { return nIndex; } - USHORT& GetIndex() { return nIndex; } - void SetIndex( USHORT n ) { nIndex = n; } + sal_uInt16 GetIndex() const { return nIndex; } + sal_uInt16& GetIndex() { return nIndex; } + void SetIndex( sal_uInt16 n ) { nIndex = n; } - BOOL IsParaStart() const { return nIndex == 0; } - BOOL IsParaEnd() const { return nIndex == pNode->Len(); } + sal_Bool IsParaStart() const { return nIndex == 0; } + sal_Bool IsParaEnd() const { return nIndex == pNode->Len(); } - BOOL DbgIsBuggy( EditDoc& rDoc ); + sal_Bool DbgIsBuggy( EditDoc& rDoc ); EditPaM& operator = ( const EditPaM& rPaM ); - friend BOOL operator == ( const EditPaM& r1, const EditPaM& r2 ); - friend BOOL operator != ( const EditPaM& r1, const EditPaM& r2 ); + friend sal_Bool operator == ( const EditPaM& r1, const EditPaM& r2 ); + friend sal_Bool operator != ( const EditPaM& r1, const EditPaM& r2 ); }; #define PORTIONKIND_TEXT 0 @@ -367,11 +370,11 @@ struct ExtraPortionInfo long nPortionOffsetX; - USHORT nMaxCompression100thPercent; + sal_uInt16 nMaxCompression100thPercent; - BYTE nAsianCompressionTypes; - BOOL bFirstCharIsRightPunktuation; - BOOL bCompressed; + sal_uInt8 nAsianCompressionTypes; + sal_Bool bFirstCharIsRightPunktuation; + sal_Bool bCompressed; sal_Int32* pOrgDXArray; @@ -379,7 +382,7 @@ struct ExtraPortionInfo ExtraPortionInfo(); ~ExtraPortionInfo(); - void SaveOrgDXArray( const sal_Int32* pDXArray, USHORT nLen ); + void SaveOrgDXArray( const sal_Int32* pDXArray, sal_uInt16 nLen ); void DestroyOrgDXArray(); }; @@ -391,44 +394,44 @@ class TextPortion { private: ExtraPortionInfo* pExtraInfos; - USHORT nLen; + sal_uInt16 nLen; Size aOutSz; - BYTE nKind; - BYTE nRightToLeft; + sal_uInt8 nKind; + sal_uInt8 nRightToLeft; sal_Unicode nExtraValue; TextPortion() { DBG_CTOR( EE_TextPortion, 0 ); - pExtraInfos = NULL; nLen = 0; nKind = PORTIONKIND_TEXT; nExtraValue = 0; nRightToLeft = FALSE;} + pExtraInfos = NULL; nLen = 0; nKind = PORTIONKIND_TEXT; nExtraValue = 0; nRightToLeft = sal_False;} public: - TextPortion( USHORT nL ) : aOutSz( -1, -1 ) + TextPortion( sal_uInt16 nL ) : aOutSz( -1, -1 ) { DBG_CTOR( EE_TextPortion, 0 ); - pExtraInfos = NULL; nLen = nL; nKind = PORTIONKIND_TEXT; nExtraValue = 0; nRightToLeft = FALSE;} + pExtraInfos = NULL; nLen = nL; nKind = PORTIONKIND_TEXT; nExtraValue = 0; nRightToLeft = sal_False;} TextPortion( const TextPortion& r ) : aOutSz( r.aOutSz ) { DBG_CTOR( EE_TextPortion, 0 ); pExtraInfos = NULL; nLen = r.nLen; nKind = r.nKind; nExtraValue = r.nExtraValue; nRightToLeft = r.nRightToLeft; } ~TextPortion() { DBG_DTOR( EE_TextPortion, 0 ); delete pExtraInfos; } - USHORT GetLen() const { return nLen; } - USHORT& GetLen() { return nLen; } - void SetLen( USHORT nL ) { nLen = nL; } + sal_uInt16 GetLen() const { return nLen; } + sal_uInt16& GetLen() { return nLen; } + void SetLen( sal_uInt16 nL ) { nLen = nL; } Size& GetSize() { return aOutSz; } Size GetSize() const { return aOutSz; } - BYTE& GetKind() { return nKind; } - BYTE GetKind() const { return nKind; } + sal_uInt8& GetKind() { return nKind; } + sal_uInt8 GetKind() const { return nKind; } - void SetRightToLeft( BYTE b ) { nRightToLeft = b; } - BYTE GetRightToLeft() const { return nRightToLeft; } - BOOL IsRightToLeft() const { return (nRightToLeft&1); } + void SetRightToLeft( sal_uInt8 b ) { nRightToLeft = b; } + sal_uInt8 GetRightToLeft() const { return nRightToLeft; } + sal_Bool IsRightToLeft() const { return (nRightToLeft&1); } sal_Unicode GetExtraValue() const { return nExtraValue; } void SetExtraValue( sal_Unicode n ) { nExtraValue = n; } - BOOL HasValidSize() const { return aOutSz.Width() != (-1); } + sal_Bool HasValidSize() const { return aOutSz.Width() != (-1); } ExtraPortionInfo* GetExtraInfos() const { return pExtraInfos; } void SetExtraInfos( ExtraPortionInfo* p ) { delete pExtraInfos; pExtraInfos = p; } @@ -447,9 +450,9 @@ public: ~TextPortionList(); void Reset(); - USHORT FindPortion( USHORT nCharPos, USHORT& rPortionStart, BOOL bPreferStartingPortion = FALSE ); - USHORT GetStartPos( USHORT nPortion ); - void DeleteFromPortion( USHORT nDelFrom ); + sal_uInt16 FindPortion( sal_uInt16 nCharPos, sal_uInt16& rPortionStart, sal_Bool bPreferStartingPortion = sal_False ); + sal_uInt16 GetStartPos( sal_uInt16 nPortion ); + void DeleteFromPortion( sal_uInt16 nDelFrom ); }; class ParaPortion; @@ -464,84 +467,84 @@ class EditLine private: CharPosArray aPositions; long nTxtWidth; - USHORT nStartPosX; - USHORT nStart; // could be replaced by nStartPortion - USHORT nEnd; // could be replaced by nEndPortion - USHORT nStartPortion; - USHORT nEndPortion; - USHORT nHeight; // Total height of the line - USHORT nTxtHeight; // Pure Text height - USHORT nCrsrHeight; // For contour flow high lines => cursor is large. - USHORT nMaxAscent; - BOOL bHangingPunctuation; - BOOL bInvalid; // for skillful formatting + sal_uInt16 nStartPosX; + sal_uInt16 nStart; // could be replaced by nStartPortion + sal_uInt16 nEnd; // could be replaced by nEndPortion + sal_uInt16 nStartPortion; + sal_uInt16 nEndPortion; + sal_uInt16 nHeight; // Total height of the line + sal_uInt16 nTxtHeight; // Pure Text height + sal_uInt16 nCrsrHeight; // For contour flow high lines => cursor is large. + sal_uInt16 nMaxAscent; + sal_Bool bHangingPunctuation; + sal_Bool bInvalid; // for skillful formatting public: EditLine(); EditLine( const EditLine& ); ~EditLine(); - BOOL IsIn( USHORT nIndex ) const + sal_Bool IsIn( sal_uInt16 nIndex ) const { return ( (nIndex >= nStart ) && ( nIndex < nEnd ) ); } - BOOL IsIn( USHORT nIndex, BOOL bInclEnd ) const + sal_Bool IsIn( sal_uInt16 nIndex, sal_Bool bInclEnd ) const { return ( ( nIndex >= nStart ) && ( bInclEnd ? ( nIndex <= nEnd ) : ( nIndex < nEnd ) ) ); } - void SetStart( USHORT n ) { nStart = n; } - USHORT GetStart() const { return nStart; } - USHORT& GetStart() { return nStart; } + void SetStart( sal_uInt16 n ) { nStart = n; } + sal_uInt16 GetStart() const { return nStart; } + sal_uInt16& GetStart() { return nStart; } - void SetEnd( USHORT n ) { nEnd = n; } - USHORT GetEnd() const { return nEnd; } - USHORT& GetEnd() { return nEnd; } + void SetEnd( sal_uInt16 n ) { nEnd = n; } + sal_uInt16 GetEnd() const { return nEnd; } + sal_uInt16& GetEnd() { return nEnd; } - void SetStartPortion( USHORT n ) { nStartPortion = n; } - USHORT GetStartPortion() const { return nStartPortion; } - USHORT& GetStartPortion() { return nStartPortion; } + void SetStartPortion( sal_uInt16 n ) { nStartPortion = n; } + sal_uInt16 GetStartPortion() const { return nStartPortion; } + sal_uInt16& GetStartPortion() { return nStartPortion; } - void SetEndPortion( USHORT n ) { nEndPortion = n; } - USHORT GetEndPortion() const { return nEndPortion; } - USHORT& GetEndPortion() { return nEndPortion; } + void SetEndPortion( sal_uInt16 n ) { nEndPortion = n; } + sal_uInt16 GetEndPortion() const { return nEndPortion; } + sal_uInt16& GetEndPortion() { return nEndPortion; } - void SetHeight( USHORT nH, USHORT nTxtH = 0, USHORT nCrsrH = 0 ) + void SetHeight( sal_uInt16 nH, sal_uInt16 nTxtH = 0, sal_uInt16 nCrsrH = 0 ) { nHeight = nH; nTxtHeight = ( nTxtH ? nTxtH : nH ); nCrsrHeight = ( nCrsrH ? nCrsrH : nTxtHeight ); } - USHORT GetHeight() const { return nHeight; } - USHORT GetTxtHeight() const { return nTxtHeight; } - USHORT GetCrsrHeight() const { return nCrsrHeight; } + sal_uInt16 GetHeight() const { return nHeight; } + sal_uInt16 GetTxtHeight() const { return nTxtHeight; } + sal_uInt16 GetCrsrHeight() const { return nCrsrHeight; } void SetTextWidth( long n ) { nTxtWidth = n; } long GetTextWidth() const { return nTxtWidth; } - void SetMaxAscent( USHORT n ) { nMaxAscent = n; } - USHORT GetMaxAscent() const { return nMaxAscent; } + void SetMaxAscent( sal_uInt16 n ) { nMaxAscent = n; } + sal_uInt16 GetMaxAscent() const { return nMaxAscent; } - void SetHangingPunctuation( BOOL b ) { bHangingPunctuation = b; } - BOOL IsHangingPunctuation() const { return bHangingPunctuation; } + void SetHangingPunctuation( sal_Bool b ) { bHangingPunctuation = b; } + sal_Bool IsHangingPunctuation() const { return bHangingPunctuation; } - USHORT GetLen() const { return nEnd - nStart; } + sal_uInt16 GetLen() const { return nEnd - nStart; } - USHORT GetStartPosX() const { return nStartPosX; } - void SetStartPosX( USHORT start ) { nStartPosX = start; } + sal_uInt16 GetStartPosX() const { return nStartPosX; } + void SetStartPosX( sal_uInt16 start ) { nStartPosX = start; } Size CalcTextSize( ParaPortion& rParaPortion ); - BOOL IsInvalid() const { return bInvalid; } - BOOL IsValid() const { return !bInvalid; } - void SetInvalid() { bInvalid = TRUE; } - void SetValid() { bInvalid = FALSE; } + sal_Bool IsInvalid() const { return bInvalid; } + sal_Bool IsValid() const { return !bInvalid; } + void SetInvalid() { bInvalid = sal_True; } + void SetValid() { bInvalid = sal_False; } - BOOL IsEmpty() const { return (nEnd > nStart) ? FALSE : TRUE; } + sal_Bool IsEmpty() const { return (nEnd > nStart) ? sal_False : sal_True; } CharPosArray& GetCharPosArray() { return aPositions; } EditLine* Clone() const; EditLine& operator = ( const EditLine& rLine ); - friend BOOL operator == ( const EditLine& r1, const EditLine& r2 ); - friend BOOL operator != ( const EditLine& r1, const EditLine& r2 ); + friend sal_Bool operator == ( const EditLine& r1, const EditLine& r2 ); + friend sal_Bool operator != ( const EditLine& r1, const EditLine& r2 ); }; @@ -558,8 +561,8 @@ public: ~EditLineList(); void Reset(); - void DeleteFromLine( USHORT nDelFrom ); - USHORT FindLine( USHORT nChar, BOOL bInclEnd ); + void DeleteFromLine( sal_uInt16 nDelFrom ); + sal_uInt16 FindLine( sal_uInt16 nChar, sal_Bool bInclEnd ); }; // ------------------------------------------------------------------------- @@ -577,15 +580,15 @@ private: ScriptTypePosInfos aScriptInfos; WritingDirectionInfos aWritingDirectionInfos; - USHORT nInvalidPosStart; - USHORT nFirstLineOffset; // For Writer-LineSpacing-Interpretation - USHORT nBulletX; - short nInvalidDiff; + sal_uInt16 nInvalidPosStart; + sal_uInt16 nFirstLineOffset; // For Writer-LineSpacing-Interpretation + sal_uInt16 nBulletX; + short nInvalidDiff; - BOOL bInvalid : 1; - BOOL bSimple : 1; // only linear Tap - BOOL bVisible : 1; // Belongs to the node! - BOOL bForceRepaint : 1; + sal_Bool bInvalid : 1; + sal_Bool bSimple : 1; // only linear Tap + sal_Bool bVisible : 1; // Belongs to the node! + sal_Bool bForceRepaint : 1; ParaPortion( const ParaPortion& ); @@ -593,39 +596,39 @@ public: ParaPortion( ContentNode* pNode ); ~ParaPortion(); - USHORT GetLineNumber( USHORT nIndex ); + sal_uInt16 GetLineNumber( sal_uInt16 nIndex ); EditLineList& GetLines() { return aLineList; } - BOOL IsInvalid() const { return bInvalid; } - BOOL IsSimpleInvalid() const { return bSimple; } - void SetValid() { bInvalid = FALSE; bSimple = TRUE;} + sal_Bool IsInvalid() const { return bInvalid; } + sal_Bool IsSimpleInvalid() const { return bSimple; } + void SetValid() { bInvalid = sal_False; bSimple = sal_True;} - BOOL MustRepaint() const { return bForceRepaint; } - void SetMustRepaint( BOOL bRP ) { bForceRepaint = bRP; } + sal_Bool MustRepaint() const { return bForceRepaint; } + void SetMustRepaint( sal_Bool bRP ) { bForceRepaint = bRP; } - USHORT GetBulletX() const { return nBulletX; } - void SetBulletX( USHORT n ) { nBulletX = n; } + sal_uInt16 GetBulletX() const { return nBulletX; } + void SetBulletX( sal_uInt16 n ) { nBulletX = n; } - void MarkInvalid( USHORT nStart, short nDiff); - void MarkSelectionInvalid( USHORT nStart, USHORT nEnd ); + void MarkInvalid( sal_uInt16 nStart, short nDiff); + void MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 nEnd ); - void SetVisible( BOOL bVisible ); - BOOL IsVisible() { return bVisible; } + void SetVisible( sal_Bool bVisible ); + sal_Bool IsVisible() { return bVisible; } long GetHeight() const { return ( bVisible ? nHeight : 0 ); } - USHORT GetFirstLineOffset() const { return ( bVisible ? nFirstLineOffset : 0 ); } + sal_uInt16 GetFirstLineOffset() const { return ( bVisible ? nFirstLineOffset : 0 ); } void ResetHeight() { nHeight = 0; nFirstLineOffset = 0; } ContentNode* GetNode() const { return pNode; } TextPortionList& GetTextPortions() { return aTextPortionList; } - USHORT GetInvalidPosStart() const { return nInvalidPosStart; } + sal_uInt16 GetInvalidPosStart() const { return nInvalidPosStart; } short GetInvalidDiff() const { return nInvalidDiff; } - void CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ); + void CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine ); - BOOL DbgCheckTextPortions(); + sal_Bool DbgCheckTextPortions(); }; typedef ParaPortion* ParaPortionPtr; @@ -636,19 +639,19 @@ SV_DECL_PTRARR( DummyParaPortionList, ParaPortionPtr, 0, 4 ) // ------------------------------------------------------------------------- class ParaPortionList : public DummyParaPortionList { - USHORT nLastCache; + sal_uInt16 nLastCache; public: ParaPortionList(); ~ParaPortionList(); void Reset(); long GetYOffset( ParaPortion* pPPortion ); - USHORT FindParagraph( long nYOffset ); + sal_uInt16 FindParagraph( long nYOffset ); - inline ParaPortion* SaveGetObject( USHORT nPos ) const + inline ParaPortion* SaveGetObject( sal_uInt16 nPos ) const { return ( nPos < Count() ) ? GetObject( nPos ) : 0; } - USHORT GetPos( const ParaPortionPtr &rPtr ) const; + sal_uInt16 GetPos( const ParaPortionPtr &rPtr ) const; // temporary: void DbgCheck( EditDoc& rDoc ); @@ -675,17 +678,17 @@ public: const EditPaM& Min() const { return aStartPaM; } const EditPaM& Max() const { return aEndPaM; } - BOOL HasRange() const { return aStartPaM != aEndPaM; } - BOOL IsInvalid() const; - BOOL DbgIsBuggy( EditDoc& rDoc ); + sal_Bool HasRange() const { return aStartPaM != aEndPaM; } + sal_Bool IsInvalid() const; + sal_Bool DbgIsBuggy( EditDoc& rDoc ); - BOOL Adjust( const ContentList& rNodes ); + sal_Bool Adjust( const ContentList& rNodes ); EditSelection& operator = ( const EditPaM& r ); - BOOL operator == ( const EditSelection& r ) const + sal_Bool operator == ( const EditSelection& r ) const { return ( ( aStartPaM == r.aStartPaM ) && ( aEndPaM == r.aEndPaM ) ) - ? TRUE : FALSE; } - BOOL operator != ( const EditSelection& r ) const { return !( r == *this ); } + ? sal_True : sal_False; } + sal_Bool operator != ( const EditSelection& r ) const { return !( r == *this ); } }; // ------------------------------------------------------------------------- @@ -694,16 +697,16 @@ public: class DeletedNodeInfo { private: - ULONG nInvalidAdressPtr; - USHORT nInvalidParagraph; + sal_uIntPtr nInvalidAdressPtr; + sal_uInt16 nInvalidParagraph; public: - DeletedNodeInfo( ULONG nInvAdr, USHORT nPos ) + DeletedNodeInfo( sal_uIntPtr nInvAdr, sal_uInt16 nPos ) { nInvalidAdressPtr = nInvAdr; nInvalidParagraph = nPos; } - ULONG GetInvalidAdress() { return nInvalidAdressPtr; } - USHORT GetPosition() { return nInvalidParagraph; } + sal_uIntPtr GetInvalidAdress() { return nInvalidAdressPtr; } + sal_uInt16 GetPosition() { return nInvalidParagraph; } }; typedef DeletedNodeInfo* DeletedNodeInfoPtr; @@ -719,12 +722,12 @@ private: Link aModifyHdl; SvxFont aDefFont; //faster than ever from the pool!! - USHORT nDefTab; - BOOL bIsVertical; - BOOL bIsFixedCellHeight; + sal_uInt16 nDefTab; + sal_Bool bIsVertical; + sal_Bool bIsFixedCellHeight; - BOOL bOwnerOfPool; - BOOL bModified; + sal_Bool bOwnerOfPool; + sal_Bool bModified; protected: void ImplDestroyContents(); @@ -733,38 +736,38 @@ public: EditDoc( SfxItemPool* pItemPool ); ~EditDoc(); - BOOL IsModified() const { return bModified; } - void SetModified( BOOL b ); + sal_Bool IsModified() const { return bModified; } + void SetModified( sal_Bool b ); void SetModifyHdl( const Link& rLink ) { aModifyHdl = rLink; } Link GetModifyHdl() const { return aModifyHdl; } - void CreateDefFont( BOOL bUseStyles ); + void CreateDefFont( sal_Bool bUseStyles ); const SvxFont& GetDefFont() { return aDefFont; } - void SetDefTab( USHORT nTab ) { nDefTab = nTab ? nTab : DEFTAB; } - USHORT GetDefTab() const { return nDefTab; } + void SetDefTab( sal_uInt16 nTab ) { nDefTab = nTab ? nTab : DEFTAB; } + sal_uInt16 GetDefTab() const { return nDefTab; } - void SetVertical( BOOL bVertical ) { bIsVertical = bVertical; } - BOOL IsVertical() const { return bIsVertical; } + void SetVertical( sal_Bool bVertical ) { bIsVertical = bVertical; } + sal_Bool IsVertical() const { return bIsVertical; } - void SetFixedCellHeight( BOOL bUseFixedCellHeight ) { bIsFixedCellHeight = bUseFixedCellHeight; } - BOOL IsFixedCellHeight() const { return bIsFixedCellHeight; } + void SetFixedCellHeight( sal_Bool bUseFixedCellHeight ) { bIsFixedCellHeight = bUseFixedCellHeight; } + sal_Bool IsFixedCellHeight() const { return bIsFixedCellHeight; } EditPaM Clear(); EditPaM RemoveText(); - EditPaM RemoveChars( EditPaM aPaM, USHORT nChars ); + EditPaM RemoveChars( EditPaM aPaM, sal_uInt16 nChars ); void InsertText( const EditPaM& rPaM, xub_Unicode c ); EditPaM InsertText( EditPaM aPaM, const XubString& rStr ); - EditPaM InsertParaBreak( EditPaM aPaM, BOOL bKeepEndingAttribs ); + EditPaM InsertParaBreak( EditPaM aPaM, sal_Bool bKeepEndingAttribs ); EditPaM InsertFeature( EditPaM aPaM, const SfxPoolItem& rItem ); EditPaM ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight ); String GetText( LineEnd eEnd ) const; - ULONG GetTextLen() const; + sal_uLong GetTextLen() const; - XubString GetParaAsString( USHORT nNode ) const; - XubString GetParaAsString( ContentNode* pNode, USHORT nStartPos = 0, USHORT nEndPos = 0xFFFF, BOOL bResolveFields = TRUE ) const; + XubString GetParaAsString( sal_uInt16 nNode ) const; + XubString GetParaAsString( ContentNode* pNode, sal_uInt16 nStartPos = 0, sal_uInt16 nEndPos = 0xFFFF, sal_Bool bResolveFields = sal_True ) const; inline EditPaM GetStartPaM() const; inline EditPaM GetEndPaM() const; @@ -774,15 +777,15 @@ public: void RemoveItemsFromPool( ContentNode* pNode ); - void InsertAttrib( const SfxPoolItem& rItem, ContentNode* pNode, USHORT nStart, USHORT nEnd ); - void InsertAttrib( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ); - void InsertAttribInSelection( ContentNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem ); - BOOL RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, USHORT nWhich = 0 ); - BOOL RemoveAttribs( ContentNode* pNode, USHORT nStart, USHORT nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, USHORT nWhich = 0 ); - void FindAttribs( ContentNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet ); + void InsertAttrib( const SfxPoolItem& rItem, ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd ); + void InsertAttrib( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem ); + void InsertAttribInSelection( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, const SfxPoolItem& rPoolItem ); + sal_Bool RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt16 nWhich = 0 ); + sal_Bool RemoveAttribs( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, EditCharAttrib*& rpStarting, EditCharAttrib*& rpEnding, sal_uInt16 nWhich = 0 ); + void FindAttribs( ContentNode* pNode, sal_uInt16 nStartPos, sal_uInt16 nEndPos, SfxItemSet& rCurSet ); - USHORT GetPos( ContentNode* pNode ) const { return ContentList::GetPos(pNode); } - ContentNode* SaveGetObject( USHORT nPos ) const { return ( nPos < Count() ) ? GetObject( nPos ) : 0; } + sal_uInt16 GetPos( ContentNode* pNode ) const { return ContentList::GetPos(pNode); } + ContentNode* SaveGetObject( sal_uInt16 nPos ) const { return ( nPos < Count() ) ? GetObject( nPos ) : 0; } static XubString GetSepStr( LineEnd eEnd ); }; @@ -798,12 +801,12 @@ inline EditPaM EditDoc::GetEndPaM() const return EditPaM( pLastNode, pLastNode->Len() ); } -inline EditCharAttrib* GetAttrib( const CharAttribArray& rAttribs, USHORT nAttr ) +inline EditCharAttrib* GetAttrib( const CharAttribArray& rAttribs, sal_uInt16 nAttr ) { return ( nAttr < rAttribs.Count() ) ? rAttribs[nAttr] : 0; } -BOOL CheckOrderedList( CharAttribArray& rAttribs, BOOL bStart ); +sal_Bool CheckOrderedList( CharAttribArray& rAttribs, sal_Bool bStart ); // ------------------------------------------------------------------------- // class EditEngineItemPool @@ -811,7 +814,7 @@ BOOL CheckOrderedList( CharAttribArray& rAttribs, BOOL bStart ); class EditEngineItemPool : public SfxItemPool { public: - EditEngineItemPool( BOOL bPersistenRefCounts ); + EditEngineItemPool( sal_Bool bPersistenRefCounts ); protected: virtual ~EditEngineItemPool(); public: diff --git a/editeng/source/editeng/editdoc2.cxx b/editeng/source/editeng/editdoc2.cxx index c3e238d3b695..8eee45722ef5 100644..100755 --- a/editeng/source/editeng/editdoc2.cxx +++ b/editeng/source/editeng/editdoc2.cxx @@ -81,24 +81,24 @@ TextPortionList::~TextPortionList() void TextPortionList::Reset() { - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) delete GetObject( nPortion ); Remove( 0, Count() ); } -void TextPortionList::DeleteFromPortion( USHORT nDelFrom ) +void TextPortionList::DeleteFromPortion( sal_uInt16 nDelFrom ) { DBG_ASSERT( ( nDelFrom < Count() ) || ( (nDelFrom == 0) && (Count() == 0) ), "DeleteFromPortion: Out of range" ); - for ( USHORT nP = nDelFrom; nP < Count(); nP++ ) + for ( sal_uInt16 nP = nDelFrom; nP < Count(); nP++ ) delete GetObject( nP ); Remove( nDelFrom, Count()-nDelFrom ); } -USHORT TextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, BOOL bPreferStartingPortion ) +sal_uInt16 TextPortionList::FindPortion( sal_uInt16 nCharPos, sal_uInt16& nPortionStart, sal_Bool bPreferStartingPortion ) { // When nCharPos at portion limit, the left portion is found - USHORT nTmpPos = 0; - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + sal_uInt16 nTmpPos = 0; + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) { TextPortion* pPortion = GetObject( nPortion ); nTmpPos = nTmpPos + pPortion->GetLen(); @@ -116,10 +116,10 @@ USHORT TextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart, BOO return ( Count() - 1 ); } -USHORT TextPortionList::GetStartPos( USHORT nPortion ) +sal_uInt16 TextPortionList::GetStartPos( sal_uInt16 nPortion ) { - USHORT nPos = 0; - for ( USHORT n = 0; n < nPortion; n++ ) + sal_uInt16 nPos = 0; + for ( sal_uInt16 n = 0; n < nPortion; n++ ) { TextPortion* pPortion = GetObject( n ); nPos = nPos + pPortion->GetLen(); @@ -135,8 +135,8 @@ ExtraPortionInfo::ExtraPortionInfo() nMaxCompression100thPercent = 0; nAsianCompressionTypes = 0; nPortionOffsetX = 0; - bFirstCharIsRightPunktuation = FALSE; - bCompressed = FALSE; + bFirstCharIsRightPunktuation = sal_False; + bCompressed = sal_False; pOrgDXArray = NULL; } @@ -145,7 +145,7 @@ ExtraPortionInfo::~ExtraPortionInfo() delete[] pOrgDXArray; } -void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, USHORT nLen ) +void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, sal_uInt16 nLen ) { delete[] pOrgDXArray; pOrgDXArray = new sal_Int32[nLen]; @@ -164,10 +164,10 @@ ParaPortion::ParaPortion( ContentNode* pN ) DBG_CTOR( EE_ParaPortion, 0 ); pNode = pN; - bInvalid = TRUE; - bVisible = TRUE; - bSimple = FALSE; - bForceRepaint = FALSE; + bInvalid = sal_True; + bVisible = sal_True; + bSimple = sal_False; + bForceRepaint = sal_False; nInvalidPosStart = 0; nInvalidDiff = 0; nHeight = 0; @@ -180,9 +180,9 @@ ParaPortion::~ParaPortion() DBG_DTOR( EE_ParaPortion, 0 ); } -void ParaPortion::MarkInvalid( USHORT nStart, short nDiff ) +void ParaPortion::MarkInvalid( sal_uInt16 nStart, short nDiff ) { - if ( bInvalid == FALSE ) + if ( bInvalid == sal_False ) { // nInvalidPosEnd = nStart; // ??? => CreateLines nInvalidPosStart = ( nDiff >= 0 ) ? nStart : ( nStart + nDiff ); @@ -206,20 +206,19 @@ void ParaPortion::MarkInvalid( USHORT nStart, short nDiff ) { // nInvalidPosEnd = pNode->Len(); DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" ); - nInvalidPosStart = Min( nInvalidPosStart, (USHORT) ( nDiff < 0 ? nStart+nDiff : nDiff ) ); + nInvalidPosStart = Min( nInvalidPosStart, (sal_uInt16) ( nDiff < 0 ? nStart+nDiff : nDiff ) ); nInvalidDiff = 0; - bSimple = FALSE; + bSimple = sal_False; } } - bInvalid = TRUE; - aScriptInfos.Remove( 0, aScriptInfos.Count() ); - aWritingDirectionInfos.Remove( 0, aWritingDirectionInfos.Count() ); -// aExtraCharInfos.Remove( 0, aExtraCharInfos.Count() ); + bInvalid = sal_True; + aScriptInfos.clear(); + aWritingDirectionInfos.clear(); } -void ParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /* nEnd */ ) +void ParaPortion::MarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 /* nEnd */ ) { - if ( bInvalid == FALSE ) + if ( bInvalid == sal_False ) { nInvalidPosStart = nStart; // nInvalidPosEnd = nEnd; @@ -230,19 +229,18 @@ void ParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT /* nEnd */ ) // nInvalidPosEnd = pNode->Len(); } nInvalidDiff = 0; - bInvalid = TRUE; - bSimple = FALSE; - aScriptInfos.Remove( 0, aScriptInfos.Count() ); - aWritingDirectionInfos.Remove( 0, aWritingDirectionInfos.Count() ); -// aExtraCharInfos.Remove( 0, aExtraCharInfos.Count() ); + bInvalid = sal_True; + bSimple = sal_False; + aScriptInfos.clear(); + aWritingDirectionInfos.clear(); } -USHORT ParaPortion::GetLineNumber( USHORT nIndex ) +sal_uInt16 ParaPortion::GetLineNumber( sal_uInt16 nIndex ) { DBG_ASSERTWARNING( aLineList.Count(), "Empty ParaPortion in GetLine!" ); DBG_ASSERT( bVisible, "Why GetLine() on an invisible paragraph?" ); - for ( USHORT nLine = 0; nLine < aLineList.Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < aLineList.Count(); nLine++ ) { if ( aLineList[nLine]->IsIn( nIndex ) ) return nLine; @@ -253,14 +251,14 @@ USHORT ParaPortion::GetLineNumber( USHORT nIndex ) return (aLineList.Count()-1); } -void ParaPortion::SetVisible( BOOL bMakeVisible ) +void ParaPortion::SetVisible( sal_Bool bMakeVisible ) { bVisible = bMakeVisible; } -void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine ) +void ParaPortion::CorrectValuesBehindLastFormattedLine( sal_uInt16 nLastFormattedLine ) { - USHORT nLines = aLineList.Count(); + sal_uInt16 nLines = aLineList.Count(); DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Empty Portion?" ); if ( nLastFormattedLine < ( nLines - 1 ) ) { @@ -278,18 +276,18 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLin int nTDiff = -( nTextDiff-1 ); if ( nPDiff || nTDiff ) { - for ( USHORT nL = nLastFormattedLine+1; nL < nLines; nL++ ) + for ( sal_uInt16 nL = nLastFormattedLine+1; nL < nLines; nL++ ) { EditLine* pLine = aLineList[ nL ]; - pLine->GetStartPortion() = sal::static_int_cast< USHORT >( + pLine->GetStartPortion() = sal::static_int_cast< sal_uInt16 >( pLine->GetStartPortion() + nPDiff); - pLine->GetEndPortion() = sal::static_int_cast< USHORT >( + pLine->GetEndPortion() = sal::static_int_cast< sal_uInt16 >( pLine->GetEndPortion() + nPDiff); - pLine->GetStart() = sal::static_int_cast< USHORT >( + pLine->GetStart() = sal::static_int_cast< sal_uInt16 >( pLine->GetStart() + nTDiff); - pLine->GetEnd() = sal::static_int_cast< USHORT >( + pLine->GetEnd() = sal::static_int_cast< sal_uInt16 >( pLine->GetEnd() + nTDiff); pLine->SetValid(); @@ -301,21 +299,21 @@ void ParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLin // Shared reverse lookup acceleration pieces ... -static USHORT FastGetPos( const VoidPtr *pPtrArray, USHORT nPtrArrayLen, - VoidPtr pPtr, USHORT &rLastPos ) +static sal_uInt16 FastGetPos( const VoidPtr *pPtrArray, sal_uInt16 nPtrArrayLen, + VoidPtr pPtr, sal_uInt16 &rLastPos ) { // Through certain filter code-paths we do a lot of appends, which in // turn call GetPos - creating some N^2 nightmares. If we have a // non-trivially large list, do a few checks from the end first. if( rLastPos > 16 ) { - USHORT nEnd; + sal_uInt16 nEnd; if (rLastPos > nPtrArrayLen - 2) nEnd = nPtrArrayLen; else nEnd = rLastPos + 2; - for( USHORT nIdx = rLastPos - 2; nIdx < nEnd; nIdx++ ) + for( sal_uInt16 nIdx = rLastPos - 2; nIdx < nEnd; nIdx++ ) { if( pPtrArray[ nIdx ] == pPtr ) { @@ -325,7 +323,7 @@ static USHORT FastGetPos( const VoidPtr *pPtrArray, USHORT nPtrArrayLen, } } // The world's lamest linear search from svarray ... - for( USHORT nIdx = 0; nIdx < nPtrArrayLen; nIdx++ ) + for( sal_uInt16 nIdx = 0; nIdx < nPtrArrayLen; nIdx++ ) if (pPtrArray[ nIdx ] == pPtr ) return rLastPos = nIdx; return USHRT_MAX; @@ -340,14 +338,14 @@ ParaPortionList::~ParaPortionList() Reset(); } -USHORT ParaPortionList::GetPos( const ParaPortionPtr &rPtr ) const +sal_uInt16 ParaPortionList::GetPos( const ParaPortionPtr &rPtr ) const { return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ), Count(), static_cast<VoidPtr>( rPtr ), ((ParaPortionList *)this)->nLastCache ); } -USHORT ContentList::GetPos( const ContentNodePtr &rPtr ) const +sal_uInt16 ContentList::GetPos( const ContentNodePtr &rPtr ) const { return FastGetPos( reinterpret_cast<const VoidPtr *>( GetData() ), Count(), static_cast<VoidPtr>( rPtr ), @@ -356,7 +354,7 @@ USHORT ContentList::GetPos( const ContentNodePtr &rPtr ) const void ParaPortionList::Reset() { - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) delete GetObject( nPortion ); Remove( 0, Count() ); } @@ -364,7 +362,7 @@ void ParaPortionList::Reset() long ParaPortionList::GetYOffset( ParaPortion* pPPortion ) { long nHeight = 0; - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) { ParaPortion* pTmpPortion = GetObject(nPortion); if ( pTmpPortion == pPPortion ) @@ -375,10 +373,10 @@ long ParaPortionList::GetYOffset( ParaPortion* pPPortion ) return nHeight; } -USHORT ParaPortionList::FindParagraph( long nYOffset ) +sal_uInt16 ParaPortionList::FindParagraph( long nYOffset ) { long nY = 0; - for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < Count(); nPortion++ ) { nY += GetObject(nPortion)->GetHeight(); // should also be correct even in bVisible! if ( nY > nYOffset ) @@ -395,7 +393,7 @@ void ParaPortionList::DbgCheck( EditDoc& { #ifdef DBG_UTIL DBG_ASSERT( Count() == rDoc.Count(), "ParaPortionList::DbgCheck() - Count() unequal!" ); - for ( USHORT i = 0; i < Count(); i++ ) + for ( sal_uInt16 i = 0; i < Count(); i++ ) { DBG_ASSERT( SaveGetObject(i), "ParaPortionList::DbgCheck() - Null-Pointer in List!" ); DBG_ASSERT( GetObject(i)->GetNode(), "ParaPortionList::DbgCheck() - Null-Pointer in List(2)!" ); @@ -430,8 +428,8 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit { DBG_ASSERT( rPoolItem.IsA( TYPE( SvxULSpaceItem ) ), "ConvertItem: Invalid Item!" ); SvxULSpaceItem& rItem = (SvxULSpaceItem&)rPoolItem; - rItem.SetUpper( sal::static_int_cast< USHORT >( OutputDevice::LogicToLogic( rItem.GetUpper(), eSourceUnit, eDestUnit ) ) ); - rItem.SetLower( sal::static_int_cast< USHORT >( OutputDevice::LogicToLogic( rItem.GetLower(), eSourceUnit, eDestUnit ) ) ); + rItem.SetUpper( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetUpper(), eSourceUnit, eDestUnit ) ) ); + rItem.SetLower( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetLower(), eSourceUnit, eDestUnit ) ) ); } break; case EE_PARA_SBL: @@ -440,7 +438,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit SvxLineSpacingItem& rItem = (SvxLineSpacingItem&)rPoolItem; // SetLineHeight changes also eLineSpace! if ( rItem.GetLineSpaceRule() == SVX_LINE_SPACE_MIN ) - rItem.SetLineHeight( sal::static_int_cast< USHORT >( OutputDevice::LogicToLogic( rItem.GetLineHeight(), eSourceUnit, eDestUnit ) ) ); + rItem.SetLineHeight( sal::static_int_cast< sal_uInt16 >( OutputDevice::LogicToLogic( rItem.GetLineHeight(), eSourceUnit, eDestUnit ) ) ); } break; case EE_PARA_TABS: @@ -448,7 +446,7 @@ void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit DBG_ASSERT( rPoolItem.IsA( TYPE( SvxTabStopItem ) ), "ConvertItem: Invalid Item!" ); SvxTabStopItem& rItem = (SvxTabStopItem&)rPoolItem; SvxTabStopItem aNewItem( EE_PARA_TABS ); - for ( USHORT i = 0; i < rItem.Count(); i++ ) + for ( sal_uInt16 i = 0; i < rItem.Count(); i++ ) { const SvxTabStop& rTab = rItem[i]; SvxTabStop aNewStop( OutputDevice::LogicToLogic( rTab.GetTabPos(), eSourceUnit, eDestUnit ), rTab.GetAdjustment(), rTab.GetDecimal(), rTab.GetFill() ); @@ -474,20 +472,20 @@ void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const Map const SfxItemPool* pSourcePool = rSource.GetPool(); const SfxItemPool* pDestPool = rDest.GetPool(); - for ( USHORT nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) + for ( sal_uInt16 nWhich = EE_PARA_START; nWhich <= EE_CHAR_END; nWhich++ ) { // If possible go through SlotID ... - USHORT nSourceWhich = nWhich; - USHORT nSlot = pDestPool->GetTrueSlotId( nWhich ); + sal_uInt16 nSourceWhich = nWhich; + sal_uInt16 nSlot = pDestPool->GetTrueSlotId( nWhich ); if ( nSlot ) { - USHORT nW = pSourcePool->GetTrueWhich( nSlot ); + sal_uInt16 nW = pSourcePool->GetTrueWhich( nSlot ); if ( nW ) nSourceWhich = nW; } - if ( rSource.GetItemState( nSourceWhich, FALSE ) == SFX_ITEM_ON ) + if ( rSource.GetItemState( nSourceWhich, sal_False ) == SFX_ITEM_ON ) { MapUnit eSourceUnit = pSourceUnit ? *pSourceUnit : (MapUnit)pSourcePool->GetMetric( nSourceWhich ); MapUnit eDestUnit = pDestUnit ? *pDestUnit : (MapUnit)pDestPool->GetMetric( nWhich ); diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 291af06787a5..08459be67d71 100644..100755 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -36,7 +36,7 @@ #define USE_SVXFONT -#define _SVSTDARR_USHORTS +#define _SVSTDARR_sal_uInt16S #include <svl/svstdarr.hxx> #include <svl/ctloptions.hxx> #include <svtools/ctrltool.hxx> @@ -146,7 +146,7 @@ sal_Bool EditEngine::IsInUndo() return pImpEditEngine->IsInUndo(); } -SfxUndoManager& EditEngine::GetUndoManager() +::svl::IUndoManager& EditEngine::GetUndoManager() { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->GetUndoManager(); @@ -168,7 +168,7 @@ void EditEngine::UndoActionEnd( sal_uInt16 nId ) pImpEditEngine->UndoActionEnd( nId ); } -BOOL EditEngine::HasTriedMergeOnLastAddUndo() const +sal_Bool EditEngine::HasTriedMergeOnLastAddUndo() const { return pImpEditEngine->mbLastTryMerge; } @@ -215,25 +215,25 @@ Color EditEngine::GetAutoColor() const return pImpEditEngine->GetAutoColor(); } -void EditEngine::EnableAutoColor( BOOL b ) +void EditEngine::EnableAutoColor( sal_Bool b ) { DBG_CHKTHIS( EditEngine, 0 ); pImpEditEngine->EnableAutoColor( b ); } -BOOL EditEngine::IsAutoColorEnabled() const +sal_Bool EditEngine::IsAutoColorEnabled() const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->IsAutoColorEnabled(); } -void EditEngine::ForceAutoColor( BOOL b ) +void EditEngine::ForceAutoColor( sal_Bool b ) { DBG_CHKTHIS( EditEngine, 0 ); pImpEditEngine->ForceAutoColor( b ); } -BOOL EditEngine::IsForceAutoColor() const +sal_Bool EditEngine::IsForceAutoColor() const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->IsForceAutoColor(); @@ -318,7 +318,7 @@ void EditEngine::Draw( OutputDevice* pOutDev, const Rectangle& rOutRect, const P ( rOutRect.GetHeight() >= (long)GetTextHeight() ) && ( rOutRect.GetWidth() >= (long)CalcTextWidth() ) ) { - bClip = FALSE; + bClip = sal_False; } else { @@ -492,25 +492,25 @@ const Size& EditEngine::GetPaperSize() const return pImpEditEngine->GetPaperSize(); } -void EditEngine::SetVertical( BOOL bVertical ) +void EditEngine::SetVertical( sal_Bool bVertical ) { DBG_CHKTHIS( EditEngine, 0 ); pImpEditEngine->SetVertical( bVertical ); } -BOOL EditEngine::IsVertical() const +sal_Bool EditEngine::IsVertical() const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->IsVertical(); } -void EditEngine::SetFixedCellHeight( BOOL bUseFixedCellHeight ) +void EditEngine::SetFixedCellHeight( sal_Bool bUseFixedCellHeight ) { DBG_CHKTHIS( EditEngine, 0 ); pImpEditEngine->SetFixedCellHeight( bUseFixedCellHeight ); } -BOOL EditEngine::IsFixedCellHeight() const +sal_Bool EditEngine::IsFixedCellHeight() const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->IsFixedCellHeight(); @@ -528,14 +528,14 @@ EEHorizontalTextDirection EditEngine::GetDefaultHorizontalTextDirection() const return pImpEditEngine->GetDefaultHorizontalTextDirection(); } -USHORT EditEngine::GetScriptType( const ESelection& rSelection ) const +sal_uInt16 EditEngine::GetScriptType( const ESelection& rSelection ) const { DBG_CHKTHIS( EditEngine, 0 ); EditSelection aSel( pImpEditEngine->CreateSel( rSelection ) ); return pImpEditEngine->GetScriptType( aSel ); } -LanguageType EditEngine::GetLanguage( USHORT nPara, USHORT nPos ) const +LanguageType EditEngine::GetLanguage( sal_uInt16 nPara, sal_uInt16 nPos ) const { DBG_CHKTHIS( EditEngine, 0 ); ContentNode* pNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara ); @@ -550,37 +550,37 @@ void EditEngine::TransliterateText( const ESelection& rSelection, sal_Int32 nTra pImpEditEngine->TransliterateText( pImpEditEngine->CreateSel( rSelection ), nTransliterationMode ); } -void EditEngine::SetAsianCompressionMode( USHORT n ) +void EditEngine::SetAsianCompressionMode( sal_uInt16 n ) { DBG_CHKTHIS( EditView, 0 ); pImpEditEngine->SetAsianCompressionMode( n ); } -USHORT EditEngine::GetAsianCompressionMode() const +sal_uInt16 EditEngine::GetAsianCompressionMode() const { DBG_CHKTHIS( EditView, 0 ); return pImpEditEngine->GetAsianCompressionMode(); } -void EditEngine::SetKernAsianPunctuation( BOOL b ) +void EditEngine::SetKernAsianPunctuation( sal_Bool b ) { DBG_CHKTHIS( EditView, 0 ); pImpEditEngine->SetKernAsianPunctuation( b ); } -BOOL EditEngine::IsKernAsianPunctuation() const +sal_Bool EditEngine::IsKernAsianPunctuation() const { DBG_CHKTHIS( EditView, 0 ); return pImpEditEngine->IsKernAsianPunctuation(); } -void EditEngine::SetAddExtLeading( BOOL b ) +void EditEngine::SetAddExtLeading( sal_Bool b ) { DBG_CHKTHIS( EditEngine, 0 ); pImpEditEngine->SetAddExtLeading( b ); } -BOOL EditEngine::IsAddExtLeading() const +sal_Bool EditEngine::IsAddExtLeading() const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->IsAddExtLeading(); @@ -689,7 +689,7 @@ sal_uInt16 EditEngine::GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) con return pImpEditEngine->GetLineLen( nParagraph, nLine ); } -void EditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const +void EditEngine::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const { DBG_CHKTHIS( EditEngine, 0 ); if ( !pImpEditEngine->IsFormatted() ) @@ -697,7 +697,7 @@ void EditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, return pImpEditEngine->GetLineBoundaries( rStart, rEnd, nParagraph, nLine ); } -USHORT EditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const +sal_uInt16 EditEngine::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const { DBG_CHKTHIS( EditEngine, 0 ); if ( !pImpEditEngine->IsFormatted() ) @@ -742,7 +742,7 @@ XubString EditEngine::GetWord( sal_uInt16 nPara, sal_uInt16 nIndex ) return pImpEditEngine->GetSelected( aSel ); } -ESelection EditEngine::GetWord( const ESelection& rSelection, USHORT nWordType ) const +ESelection EditEngine::GetWord( const ESelection& rSelection, sal_uInt16 nWordType ) const { // ImpEditEngine-Iteration-Methods should be const! EditEngine* pE = (EditEngine*)this; @@ -752,7 +752,7 @@ ESelection EditEngine::GetWord( const ESelection& rSelection, USHORT nWordType return pE->pImpEditEngine->CreateESel( aSel ); } -ESelection EditEngine::WordLeft( const ESelection& rSelection, USHORT nWordType ) const +ESelection EditEngine::WordLeft( const ESelection& rSelection, sal_uInt16 nWordType ) const { // ImpEditEngine-Iteration-Methods should be const! EditEngine* pE = (EditEngine*)this; @@ -762,7 +762,7 @@ ESelection EditEngine::WordLeft( const ESelection& rSelection, USHORT nWordType return pE->pImpEditEngine->CreateESel( aSel ); } -ESelection EditEngine::WordRight( const ESelection& rSelection, USHORT nWordType ) const +ESelection EditEngine::WordRight( const ESelection& rSelection, sal_uInt16 nWordType ) const { // ImpEditEngine-Iteration-Methods should be const! EditEngine* pE = (EditEngine*)this; @@ -772,7 +772,7 @@ ESelection EditEngine::WordRight( const ESelection& rSelection, USHORT nWordType return pE->pImpEditEngine->CreateESel( aSel ); } -ESelection EditEngine::CursorLeft( const ESelection& rSelection, USHORT nCharacterIteratorMode ) const +ESelection EditEngine::CursorLeft( const ESelection& rSelection, sal_uInt16 nCharacterIteratorMode ) const { // ImpEditEngine-Iteration-Methods should be const! EditEngine* pE = (EditEngine*)this; @@ -782,7 +782,7 @@ ESelection EditEngine::CursorLeft( const ESelection& rSelection, USHORT nCharact return pE->pImpEditEngine->CreateESel( aSel ); } -ESelection EditEngine::CursorRight( const ESelection& rSelection, USHORT nCharacterIteratorMode ) const +ESelection EditEngine::CursorRight( const ESelection& rSelection, sal_uInt16 nCharacterIteratorMode ) const { // ImpEditEngine-Iteration-Methods should be const! EditEngine* pE = (EditEngine*)this; @@ -813,8 +813,8 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie sal_Bool bAllowIdle = sal_True; sal_Bool bReadOnly = pEditView->IsReadOnly(); - USHORT nNewCursorFlags = 0; - BOOL bSetCursorFlags = TRUE; + sal_uInt16 nNewCursorFlags = 0; + sal_Bool bSetCursorFlags = sal_True; EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() ); DBG_ASSERT( !aCurSel.IsInvalid(), "Blinde Selection in EditEngine::PostKeyEvent" ); @@ -867,11 +867,11 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie { if ( rKeyEvent.GetKeyCode().IsMod1() && rKeyEvent.GetKeyCode().IsMod2() ) { - USHORT nParas = GetParagraphCount(); + sal_uInt16 nParas = GetParagraphCount(); Point aPos; Point aViewStart( pEditView->GetOutputArea().TopLeft() ); long n20 = 40 * pImpEditEngine->nOnePixelInRef; - for ( USHORT n = 0; n < nParas; n++ ) + for ( sal_uInt16 n = 0; n < nParas; n++ ) { long nH = GetTextHeight( n ); Point P1( aViewStart.X() + n20 + n20*(n%2), aViewStart.Y() + aPos.Y() ); @@ -884,7 +884,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie aPos.Y() += nH; } } - bDone = FALSE; + bDone = sal_False; } break; case KEY_F11: @@ -896,7 +896,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie aInfo += bDebugPaint ? "On" : "Off"; InfoBox( NULL, String( aInfo, RTL_TEXTENCODING_ASCII_US ) ).Execute(); } - bDone = FALSE; + bDone = sal_False; } break; case KEY_F12: @@ -905,7 +905,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie { EditDbg::ShowEditEngineData( this ); } - bDone = FALSE; + bDone = sal_False; } break; #endif @@ -937,13 +937,13 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie if ( !rKeyEvent.GetKeyCode().IsMod2() || ( nCode == KEY_LEFT ) || ( nCode == KEY_RIGHT ) ) { if ( pImpEditEngine->DoVisualCursorTraveling( aCurSel.Max().GetNode() ) && ( ( nCode == KEY_LEFT ) || ( nCode == KEY_RIGHT ) /* || ( nCode == KEY_HOME ) || ( nCode == KEY_END ) */ ) ) - bSetCursorFlags = FALSE; // Will be manipulated within visual cursor move + bSetCursorFlags = sal_False; // Will be manipulated within visual cursor move aCurSel = pImpEditEngine->MoveCursor( rKeyEvent, pEditView ); if ( aCurSel.HasRange() ) { Reference<com::sun::star::datatransfer::clipboard::XClipboard> aSelection(pEditView->GetWindow()->GetPrimarySelection()); - pEditView->pImpEditView->CutCopy( aSelection, FALSE ); + pEditView->pImpEditView->CutCopy( aSelection, sal_False ); } bMoved = sal_True; @@ -977,7 +977,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie // now on and that will be all. Otherwise continue as usual. // ... - USHORT nPara = pImpEditEngine->GetEditDoc().GetPos( pNode ); + sal_uInt16 nPara = pImpEditEngine->GetEditDoc().GetPos( pNode ); SfxBoolItem aBulletState( (const SfxBoolItem&) pImpEditEngine->GetParaAttrib( nPara, EE_PARA_BULLETSTATE ) ); bool bBulletIsVisible = aBulletState.GetValue() ? true : false; @@ -997,7 +997,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie break; } - BYTE nDel = 0, nMode = 0; + sal_uInt8 nDel = 0, nMode = 0; switch( nCode ) { case com::sun::star::awt::Key::DELETE_WORD_BACKWARD: @@ -1266,7 +1266,7 @@ sal_uInt32 EditEngine::GetTextHeight() const if ( !pImpEditEngine->IsFormatted() ) pImpEditEngine->FormatDoc(); - sal_uInt32 nHeight = !IsVertical() ? pImpEditEngine->GetTextHeight() : pImpEditEngine->CalcTextWidth( TRUE ); + sal_uInt32 nHeight = !IsVertical() ? pImpEditEngine->GetTextHeight() : pImpEditEngine->CalcTextWidth( sal_True ); return nHeight; } @@ -1277,7 +1277,7 @@ sal_uInt32 EditEngine::CalcTextWidth() if ( !pImpEditEngine->IsFormatted() ) pImpEditEngine->FormatDoc(); - sal_uInt32 nWidth = !IsVertical() ? pImpEditEngine->CalcTextWidth( TRUE ) : pImpEditEngine->GetTextHeight(); + sal_uInt32 nWidth = !IsVertical() ? pImpEditEngine->CalcTextWidth( sal_True ) : pImpEditEngine->GetTextHeight(); return nWidth; } @@ -1309,7 +1309,7 @@ void EditEngine::SetText( const XubString& rText ) pImpEditEngine->FormatAndUpdate(); } -ULONG EditEngine::Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, SvKeyValueIterator* pHTTPHeaderAttrs /* = NULL */ ) +sal_uLong EditEngine::Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, SvKeyValueIterator* pHTTPHeaderAttrs /* = NULL */ ) { DBG_CHKTHIS( EditEngine, 0 ); sal_Bool bUndoEnabled = pImpEditEngine->IsUndoEnabled(); @@ -1321,7 +1321,7 @@ ULONG EditEngine::Read( SvStream& rInput, const String& rBaseURL, EETextFormat e return rInput.GetError(); } -ULONG EditEngine::Write( SvStream& rOutput, EETextFormat eFormat ) +sal_uLong EditEngine::Write( SvStream& rOutput, EETextFormat eFormat ) { DBG_CHKTHIS( EditEngine, 0 ); EditPaM aStartPaM( pImpEditEngine->GetEditDoc().GetStartPaM() ); @@ -1630,7 +1630,7 @@ void EditEngine::GetCharAttribs( sal_uInt16 nPara, EECharAttribArray& rLst ) con pImpEditEngine->GetCharAttribs( nPara, rLst ); } -SfxItemSet EditEngine::GetAttribs( const ESelection& rSel, BOOL bOnlyHardAttrib ) +SfxItemSet EditEngine::GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib ) { DBG_CHKTHIS( EditEngine, 0 ); EditSelection aSel( pImpEditEngine-> @@ -1638,7 +1638,7 @@ SfxItemSet EditEngine::GetAttribs( const ESelection& rSel, BOOL bOnlyHardAttrib return pImpEditEngine->GetAttribs( aSel, bOnlyHardAttrib ); } -SfxItemSet EditEngine::GetAttribs( USHORT nPara, USHORT nStart, USHORT nEnd, sal_uInt8 nFlags ) const +SfxItemSet EditEngine::GetAttribs( sal_uInt16 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags ) const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->GetAttribs( nPara, nStart, nEnd, nFlags ); @@ -1857,7 +1857,7 @@ Point EditEngine::GetDocPosTopLeft( sal_uInt16 nParagraph ) return aPoint; } -const SvxNumberFormat* EditEngine::GetNumberFormat( USHORT nPara ) const +const SvxNumberFormat* EditEngine::GetNumberFormat( sal_uInt16 nPara ) const { // derived objects may overload this function to give access to // bullet information (see Outliner) @@ -1865,7 +1865,7 @@ const SvxNumberFormat* EditEngine::GetNumberFormat( USHORT nPara ) const return 0; } -BOOL EditEngine::IsRightToLeft( USHORT nPara ) const +sal_Bool EditEngine::IsRightToLeft( sal_uInt16 nPara ) const { DBG_CHKTHIS( EditEngine, 0 ); return pImpEditEngine->IsRightToLeft( nPara ); @@ -2122,7 +2122,7 @@ void EditEngine::SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTa rtl::Reference<SvxForbiddenCharactersTable> EditEngine::GetForbiddenCharsTable() const { DBG_CHKTHIS( EditEngine, 0 ); - return pImpEditEngine->GetForbiddenCharsTable( FALSE ); + return pImpEditEngine->GetForbiddenCharsTable( sal_False ); } @@ -2244,9 +2244,9 @@ sal_Bool EditEngine::ShouldCreateBigTextObject() const return ( nTextPortions >= pImpEditEngine->GetBigTextObjectStart() ) ? sal_True : sal_False; } -USHORT EditEngine::GetFieldCount( USHORT nPara ) const +sal_uInt16 EditEngine::GetFieldCount( sal_uInt16 nPara ) const { - USHORT nFields = 0; + sal_uInt16 nFields = 0; ContentNode* pNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara ); if ( pNode ) { @@ -2262,12 +2262,12 @@ USHORT EditEngine::GetFieldCount( USHORT nPara ) const return nFields; } -EFieldInfo EditEngine::GetFieldInfo( USHORT nPara, USHORT nField ) const +EFieldInfo EditEngine::GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const { ContentNode* pNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara ); if ( pNode ) { - USHORT nCurrentField = 0; + sal_uInt16 nCurrentField = 0; const CharAttribArray& rAttrs = pNode->GetCharAttribs().GetAttribs(); for ( sal_uInt16 nAttr = 0; nAttr < rAttrs.Count(); nAttr++ ) { @@ -2354,7 +2354,7 @@ void EditEngine::CompleteOnlineSpelling() } } -USHORT EditEngine::FindParagraph( long nDocPosY ) +sal_uInt16 EditEngine::FindParagraph( long nDocPosY ) { return pImpEditEngine->GetParaPortions().FindParagraph( nDocPosY ); } @@ -2363,7 +2363,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, FALSE ); + EditPaM aPaM = ((EditEngine*)this)->pImpEditEngine->GetPaM( rDocPos, sal_False ); if ( aPaM.GetNode() ) { aPos.nPara = pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() ); @@ -2406,7 +2406,7 @@ ParagraphInfos EditEngine::GetParagraphInfos( sal_uInt16 nPara ) DBG_ASSERT( pParaPortion && pLine, "GetParagraphInfos - Paragraph out of range" ); if ( pParaPortion && pLine ) { - aInfos.nParaHeight = (USHORT)pParaPortion->GetHeight(); + aInfos.nParaHeight = (sal_uInt16)pParaPortion->GetHeight(); aInfos.nLines = pParaPortion->GetLines().Count(); aInfos.nFirstLineStartX = pLine->GetStartPosX(); aInfos.nFirstLineOffset = pParaPortion->GetFirstLineOffset(); @@ -2429,8 +2429,8 @@ ParagraphInfos EditEngine::GetParagraphInfos( sal_uInt16 nPara ) // ===================================================================== // ====================== Virtual Methods ======================== // ===================================================================== -void EditEngine::DrawingText( const Point&, const XubString&, USHORT, USHORT, - const sal_Int32*, const SvxFont&, sal_uInt16, sal_uInt16, BYTE, +void EditEngine::DrawingText( const Point&, const XubString&, sal_uInt16, sal_uInt16, + const sal_Int32*, const SvxFont&, sal_uInt16, sal_uInt16, sal_uInt8, const EEngineData::WrongSpellVector*, const SvxFieldData*, bool, bool, bool, const ::com::sun::star::lang::Locale*, const Color&, const Color&) @@ -2478,7 +2478,7 @@ void EditEngine::ParagraphDeleted( sal_uInt16 nPara ) pImpEditEngine->CallNotify( aNotify ); } } -void EditEngine::ParagraphConnected( USHORT /*nLeftParagraph*/, USHORT /*nRightParagraph*/ ) +void EditEngine::ParagraphConnected( sal_uInt16 /*nLeftParagraph*/, sal_uInt16 /*nRightParagraph*/ ) { DBG_CHKTHIS( EditEngine, 0 ); } @@ -2648,7 +2648,7 @@ void EditEngine::SetFontInfoInItemSet( SfxItemSet& rSet, const SvxFont& rFont ) rSet.Put( SvxCharReliefItem( rFont.GetRelief(), EE_CHAR_RELIEF ) ); } -Font EditEngine::CreateFontFromItemSet( const SfxItemSet& rItemSet, USHORT nScriptType ) +Font EditEngine::CreateFontFromItemSet( const SfxItemSet& rItemSet, sal_uInt16 nScriptType ) { SvxFont aFont; CreateFont( aFont, rItemSet, true, nScriptType ); @@ -2749,9 +2749,9 @@ void EditEngine::ImportBulletItem( SvxNumBulletItem& /*rNumBullet*/, sal_uInt16 { } -BOOL EditEngine::HasValidData( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rTransferable ) +sal_Bool EditEngine::HasValidData( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rTransferable ) { - BOOL bValidData = FALSE; + sal_Bool bValidData = sal_False; if ( rTransferable.is() ) { @@ -2786,12 +2786,12 @@ Link EditEngine::GetEndDropHdl() const return pImpEditEngine->GetEndDropHdl(); } -void EditEngine::SetFirstWordCapitalization( BOOL bCapitalize ) +void EditEngine::SetFirstWordCapitalization( sal_Bool bCapitalize ) { pImpEditEngine->SetFirstWordCapitalization( bCapitalize ); } -BOOL EditEngine::IsFirstWordCapitalization() const +sal_Bool EditEngine::IsFirstWordCapitalization() const { return pImpEditEngine->IsFirstWordCapitalization(); } @@ -2803,7 +2803,7 @@ EFieldInfo::EFieldInfo() } -EFieldInfo::EFieldInfo( const SvxFieldItem& rFieldItem, USHORT nPara, USHORT nPos ) : aPosition( nPara, nPos ) +EFieldInfo::EFieldInfo( const SvxFieldItem& rFieldItem, sal_uInt16 nPara, sal_uInt16 nPos ) : aPosition( nPara, nPos ) { pFieldItem = new SvxFieldItem( rFieldItem ); } diff --git a/editeng/source/editeng/editeng.src b/editeng/source/editeng/editeng.src index b65f20c36583..b65f20c36583 100644..100755 --- a/editeng/source/editeng/editeng.src +++ b/editeng/source/editeng/editeng.src diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index fc3e4ef7ed38..3e7f7332dab2 100644..100755 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -59,7 +59,7 @@ DBG_NAME( XEditAttribute ) //-------------------------------------------------------------- -BOOL lcl_CreateBulletItem( const SvxNumBulletItem& rNumBullet, USHORT nLevel, SvxBulletItem& rBullet ) +sal_Bool lcl_CreateBulletItem( const SvxNumBulletItem& rNumBullet, sal_uInt16 nLevel, SvxBulletItem& rBullet ) { const SvxNumberFormat* pFmt = rNumBullet.GetNumRule()->Get( nLevel ); if ( pFmt ) @@ -136,11 +136,11 @@ BOOL lcl_CreateBulletItem( const SvxNumBulletItem& rNumBullet, USHORT nLevel, Sv OSL_FAIL( "Unknown or invalid NumAdjust" ); } } - return pFmt ? TRUE : FALSE; + return pFmt ? sal_True : sal_False; } -XEditAttribute* MakeXEditAttribute( SfxItemPool& rPool, const SfxPoolItem& rItem, USHORT nStart, USHORT nEnd ) +XEditAttribute* MakeXEditAttribute( SfxItemPool& rPool, const SfxPoolItem& rItem, sal_uInt16 nStart, sal_uInt16 nEnd ) { // Create thw new attribute in the pool const SfxPoolItem& rNew = rPool.Put( rItem ); @@ -158,7 +158,7 @@ XEditAttribute::XEditAttribute( const SfxPoolItem& rAttr ) nEnd = 0; } -XEditAttribute::XEditAttribute( const SfxPoolItem& rAttr, USHORT nS, USHORT nE ) +XEditAttribute::XEditAttribute( const SfxPoolItem& rAttr, sal_uInt16 nS, sal_uInt16 nE ) { DBG_CTOR( XEditAttribute, 0 ); pItem = &rAttr; @@ -172,9 +172,9 @@ XEditAttribute::~XEditAttribute() pItem = 0; // belongs to the Pool. } -XEditAttribute* XEditAttributeList::FindAttrib( USHORT _nWhich, USHORT nChar ) const +XEditAttribute* XEditAttributeList::FindAttrib( sal_uInt16 _nWhich, sal_uInt16 nChar ) const { - for ( USHORT n = Count(); n; ) + for ( sal_uInt16 n = Count(); n; ) { XEditAttribute* pAttr = GetObject( --n ); if( ( pAttr->GetItem()->Which() == _nWhich ) && ( pAttr->GetStart() <= nChar ) && ( pAttr->GetEnd() > nChar ) ) @@ -203,7 +203,7 @@ ContentInfo::ContentInfo( const ContentInfo& rCopyFrom, SfxItemPool& rPoolToUse aStyle = rCopyFrom.GetStyle(); eFamily = rCopyFrom.GetFamily(); - for ( USHORT n = 0; n < rCopyFrom.GetAttribs().Count(); n++ ) + for ( sal_uInt16 n = 0; n < rCopyFrom.GetAttribs().Count(); n++ ) { XEditAttribute* pAttr = rCopyFrom.GetAttribs().GetObject( n ); XEditAttribute* pMyAttr = MakeXEditAttribute( rPoolToUse, *pAttr->GetItem(), pAttr->GetStart(), pAttr->GetEnd() ); @@ -219,7 +219,7 @@ ContentInfo::ContentInfo( const ContentInfo& rCopyFrom, SfxItemPool& rPoolToUse ContentInfo::~ContentInfo() { - for ( USHORT nAttr = 0; nAttr < aAttribs.Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < aAttribs.Count(); nAttr++ ) { XEditAttribute* pAttr = aAttribs.GetObject(nAttr); aParaAttribs.GetPool()->Remove( *pAttr->GetItem() ); @@ -251,10 +251,10 @@ bool ContentInfo::operator==( const ContentInfo& rCompare ) const (eFamily == rCompare.eFamily ) && (aParaAttribs == rCompare.aParaAttribs ) ) { - const USHORT nCount = aAttribs.Count(); + const sal_uInt16 nCount = aAttribs.Count(); if( nCount == rCompare.aAttribs.Count() ) { - USHORT n; + sal_uInt16 n; for( n = 0; n < nCount; n++ ) { if( !(*aAttribs.GetObject(n) == *rCompare.aAttribs.GetObject(n)) ) @@ -268,7 +268,7 @@ bool ContentInfo::operator==( const ContentInfo& rCompare ) const return false; } -EditTextObject::EditTextObject( USHORT n) +EditTextObject::EditTextObject( sal_uInt16 n) { DBG_CTOR( EE_EditTextObject, 0 ); nWhich = n; @@ -285,38 +285,38 @@ EditTextObject::~EditTextObject() DBG_DTOR( EE_EditTextObject, 0 ); } -USHORT EditTextObject::GetParagraphCount() const +sal_uInt16 EditTextObject::GetParagraphCount() const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); return 0; } -XubString EditTextObject::GetText( USHORT /* nParagraph */ ) const +XubString EditTextObject::GetText( sal_uInt16 /* nParagraph */ ) const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); return XubString(); } -void EditTextObject::Insert( const EditTextObject& /* rObj */, USHORT /* nPara */) +void EditTextObject::Insert( const EditTextObject& /* rObj */, sal_uInt16 /* nPara */) { OSL_FAIL( "Virtual method direct from EditTextObject!" ); } -EditTextObject* EditTextObject::CreateTextObject( USHORT /*nPara*/, USHORT /*nParas*/ ) const +EditTextObject* EditTextObject::CreateTextObject( sal_uInt16 /*nPara*/, sal_uInt16 /*nParas*/ ) const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); return 0; } -void EditTextObject::RemoveParagraph( USHORT /*nPara*/ ) +void EditTextObject::RemoveParagraph( sal_uInt16 /*nPara*/ ) { OSL_FAIL( "Virtual method direct from EditTextObject!" ); } -BOOL EditTextObject::HasPortionInfo() const +sal_Bool EditTextObject::HasPortionInfo() const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); - return FALSE; + return sal_False; } void EditTextObject::ClearPortionInfo() @@ -324,32 +324,32 @@ void EditTextObject::ClearPortionInfo() OSL_FAIL( "Virtual method direct from EditTextObject!" ); } -BOOL EditTextObject::HasOnlineSpellErrors() const +sal_Bool EditTextObject::HasOnlineSpellErrors() const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); - return FALSE; + return sal_False; } -BOOL EditTextObject::HasCharAttribs( USHORT ) const +sal_Bool EditTextObject::HasCharAttribs( sal_uInt16 ) const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); - return FALSE; + return sal_False; } -void EditTextObject::GetCharAttribs( USHORT /*nPara*/, EECharAttribArray& /*rLst*/ ) const +void EditTextObject::GetCharAttribs( sal_uInt16 /*nPara*/, EECharAttribArray& /*rLst*/ ) const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); } -void EditTextObject::MergeParaAttribs( const SfxItemSet& /*rAttribs*/, USHORT /*nStart*/, USHORT /*nEnd*/ ) +void EditTextObject::MergeParaAttribs( const SfxItemSet& /*rAttribs*/, sal_uInt16 /*nStart*/, sal_uInt16 /*nEnd*/ ) { OSL_FAIL( "Virtual method direct from EditTextObject!" ); } -BOOL EditTextObject::IsFieldObject() const +sal_Bool EditTextObject::IsFieldObject() const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); - return FALSE; + return sal_False; } const SvxFieldItem* EditTextObject::GetField() const @@ -358,56 +358,56 @@ const SvxFieldItem* EditTextObject::GetField() const return 0; } -BOOL EditTextObject::HasField( TypeId /*aType*/ ) const +sal_Bool EditTextObject::HasField( TypeId /*aType*/ ) const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); - return FALSE; + return sal_False; } -SfxItemSet EditTextObject::GetParaAttribs( USHORT /*nPara*/ ) const +SfxItemSet EditTextObject::GetParaAttribs( sal_uInt16 /*nPara*/ ) const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); return SfxItemSet( *(SfxItemPool*)NULL ); } -void EditTextObject::SetParaAttribs( USHORT /*nPara*/, const SfxItemSet& /*rAttribs*/ ) +void EditTextObject::SetParaAttribs( sal_uInt16 /*nPara*/, const SfxItemSet& /*rAttribs*/ ) { OSL_FAIL( "Virtual method direct from EditTextObject!" ); } -BOOL EditTextObject::RemoveCharAttribs( USHORT /*nWhich*/ ) +sal_Bool EditTextObject::RemoveCharAttribs( sal_uInt16 /*nWhich*/ ) { OSL_FAIL( "Virtual method direct from EditTextObject!" ); - return FALSE; + return sal_False; } -BOOL EditTextObject::RemoveParaAttribs( USHORT /*nWhich*/ ) +sal_Bool EditTextObject::RemoveParaAttribs( sal_uInt16 /*nWhich*/ ) { OSL_FAIL( "Virtual method direct from EditTextObject!" ); - return FALSE; + return sal_False; } -BOOL EditTextObject::HasStyleSheet( const XubString& /*rName*/, SfxStyleFamily /*eFamily*/ ) const +sal_Bool EditTextObject::HasStyleSheet( const XubString& /*rName*/, SfxStyleFamily /*eFamily*/ ) const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); - return FALSE; + return sal_False; } -void EditTextObject::GetStyleSheet( USHORT /*nPara*/, XubString& /*rName*/, SfxStyleFamily& /*eFamily*/ ) const +void EditTextObject::GetStyleSheet( sal_uInt16 /*nPara*/, XubString& /*rName*/, SfxStyleFamily& /*eFamily*/ ) const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); } -void EditTextObject::SetStyleSheet( USHORT /*nPara*/, const XubString& /*rName*/, const SfxStyleFamily& /*eFamily*/ ) +void EditTextObject::SetStyleSheet( sal_uInt16 /*nPara*/, const XubString& /*rName*/, const SfxStyleFamily& /*eFamily*/ ) { OSL_FAIL( "Virtual method direct from EditTextObject!" ); } -BOOL EditTextObject::ChangeStyleSheets( const XubString&, SfxStyleFamily, +sal_Bool EditTextObject::ChangeStyleSheets( const XubString&, SfxStyleFamily, const XubString&, SfxStyleFamily ) { OSL_FAIL( "Virtual method direct from EditTextObject!" ); - return FALSE; + return sal_False; } void EditTextObject::ChangeStyleSheetName( SfxStyleFamily /*eFamily*/, @@ -416,55 +416,55 @@ void EditTextObject::ChangeStyleSheetName( SfxStyleFamily /*eFamily*/, OSL_FAIL( "Virtual method direct from EditTextObject!" ); } -USHORT EditTextObject::GetUserType() const +sal_uInt16 EditTextObject::GetUserType() const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); return 0; } -void EditTextObject::SetUserType( USHORT ) +void EditTextObject::SetUserType( sal_uInt16 ) { OSL_FAIL( "Virtual method direct from EditTextObject!" ); } -ULONG EditTextObject::GetObjectSettings() const +sal_uLong EditTextObject::GetObjectSettings() const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); return 0; } -void EditTextObject::SetObjectSettings( ULONG ) +void EditTextObject::SetObjectSettings( sal_uLong ) { OSL_FAIL( "Virtual method direct from EditTextObject!" ); } -BOOL EditTextObject::IsVertical() const +sal_Bool EditTextObject::IsVertical() const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); - return FALSE; + return sal_False; } -void EditTextObject::SetVertical( BOOL bVertical ) +void EditTextObject::SetVertical( sal_Bool bVertical ) { OSL_FAIL( "Virtual method direct from EditTextObject!" ); ((BinTextObject*)this)->SetVertical( bVertical ); } -USHORT EditTextObject::GetScriptType() const +sal_uInt16 EditTextObject::GetScriptType() const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); return ((const BinTextObject*)this)->GetScriptType(); } -BOOL EditTextObject::Store( SvStream& rOStream ) const +sal_Bool EditTextObject::Store( SvStream& rOStream ) const { if ( rOStream.GetError() ) - return FALSE; + return sal_False; sal_Size nStartPos = rOStream.Tell(); - rOStream << (USHORT)Which(); + rOStream << (sal_uInt16)Which(); sal_uInt32 nStructSz = 0; rOStream << nStructSz; @@ -477,15 +477,15 @@ BOOL EditTextObject::Store( SvStream& rOStream ) const rOStream << nStructSz; rOStream.Seek( nEndPos ); - return rOStream.GetError() ? FALSE : TRUE; + return rOStream.GetError() ? sal_False : sal_True; } EditTextObject* EditTextObject::Create( SvStream& rIStream, SfxItemPool* pGlobalTextObjectPool ) { - ULONG nStartPos = rIStream.Tell(); + sal_uLong nStartPos = rIStream.Tell(); // First check what type of Object... - USHORT nWhich; + sal_uInt16 nWhich; rIStream >> nWhich; sal_uInt32 nStructSz; @@ -522,7 +522,7 @@ void EditTextObject::Skip( SvStream& rIStream ) { sal_Size nStartPos = rIStream.Tell(); - USHORT _nWhich; + sal_uInt16 _nWhich; rIStream >> _nWhich; sal_uInt32 nStructSz; @@ -542,7 +542,7 @@ void EditTextObject::CreateData( SvStream& ) OSL_FAIL( "CreateData: Base class!" ); } -USHORT EditTextObject::GetVersion() const +sal_uInt16 EditTextObject::GetVersion() const { OSL_FAIL( "Virtual method direct from EditTextObject!" ); return 0; @@ -588,7 +588,7 @@ void BinTextObject::ObjectInDestruction(const SfxItemPool& rSfxItemPool) // set local variables pPool = pNewPool; - bOwnerOfPool = TRUE; + bOwnerOfPool = sal_True; } } @@ -629,12 +629,12 @@ BinTextObject::BinTextObject( SfxItemPool* pP ) : if ( pPool ) { - bOwnerOfPool = FALSE; + bOwnerOfPool = sal_False; } else { pPool = EditEngine::CreatePool(); - bOwnerOfPool = TRUE; + bOwnerOfPool = sal_True; } if(!bOwnerOfPool && pPool) @@ -643,8 +643,8 @@ BinTextObject::BinTextObject( SfxItemPool* pP ) : pPool->AddSfxItemPoolUser(*this); } - bVertical = FALSE; - bStoreUnicodeStrings = FALSE; + bVertical = sal_False; + bStoreUnicodeStrings = sal_False; nScriptType = 0; } @@ -659,7 +659,7 @@ BinTextObject::BinTextObject( const BinTextObject& r ) : bVertical = r.bVertical; nScriptType = r.nScriptType; pPortionInfo = NULL; // Do not copy PortionInfo - bStoreUnicodeStrings = FALSE; + bStoreUnicodeStrings = sal_False; if ( !r.bOwnerOfPool ) { @@ -667,12 +667,12 @@ BinTextObject::BinTextObject( const BinTextObject& r ) : // since there is no other way to construct a BinTextObject // than it's regular constructor where that is ensured pPool = r.pPool; - bOwnerOfPool = FALSE; + bOwnerOfPool = sal_False; } else { pPool = EditEngine::CreatePool(); - bOwnerOfPool = TRUE; + bOwnerOfPool = sal_True; } @@ -685,7 +685,7 @@ BinTextObject::BinTextObject( const BinTextObject& r ) : if ( bOwnerOfPool && pPool && r.pPool ) pPool->SetDefaultMetric( r.pPool->GetMetric( DEF_METRIC ) ); - for ( USHORT n = 0; n < r.aContents.Count(); n++ ) + for ( sal_uInt16 n = 0; n < r.aContents.Count(); n++ ) { ContentInfo* pOrg = r.aContents.GetObject( n ); DBG_ASSERT( pOrg, "NULL-Pointer in ContentList!" ); @@ -709,32 +709,32 @@ BinTextObject::~BinTextObject() } } -USHORT BinTextObject::GetUserType() const +sal_uInt16 BinTextObject::GetUserType() const { return nUserType; } -void BinTextObject::SetUserType( USHORT n ) +void BinTextObject::SetUserType( sal_uInt16 n ) { nUserType = n; } -ULONG BinTextObject::GetObjectSettings() const +sal_uLong BinTextObject::GetObjectSettings() const { return nObjSettings; } -void BinTextObject::SetObjectSettings( ULONG n ) +void BinTextObject::SetObjectSettings( sal_uLong n ) { nObjSettings = n; } -BOOL BinTextObject::IsVertical() const +sal_Bool BinTextObject::IsVertical() const { return bVertical; } -void BinTextObject::SetVertical( BOOL b ) +void BinTextObject::SetVertical( sal_Bool b ) { if ( b != bVertical ) { @@ -743,12 +743,12 @@ void BinTextObject::SetVertical( BOOL b ) } } -USHORT BinTextObject::GetScriptType() const +sal_uInt16 BinTextObject::GetScriptType() const { return nScriptType; } -void BinTextObject::SetScriptType( USHORT nType ) +void BinTextObject::SetScriptType( sal_uInt16 nType ) { nScriptType = nType; } @@ -756,7 +756,7 @@ void BinTextObject::SetScriptType( USHORT nType ) void BinTextObject::DeleteContents() { - for ( USHORT n = 0; n < aContents.Count(); n++ ) + for ( sal_uInt16 n = 0; n < aContents.Count(); n++ ) { ContentInfo* p = aContents.GetObject( n ); DBG_ASSERT( p, "NULL-Pointer in ContentList!" ); @@ -770,7 +770,7 @@ EditTextObject* BinTextObject::Clone() const return new BinTextObject( *this ); } -XEditAttribute* BinTextObject::CreateAttrib( const SfxPoolItem& rItem, USHORT nStart, USHORT nEnd ) +XEditAttribute* BinTextObject::CreateAttrib( const SfxPoolItem& rItem, sal_uInt16 nStart, sal_uInt16 nEnd ) { return MakeXEditAttribute( *pPool, rItem, nStart, nEnd ); } @@ -788,12 +788,12 @@ ContentInfo* BinTextObject::CreateAndInsertContent() return pC; } -USHORT BinTextObject::GetParagraphCount() const +sal_uInt16 BinTextObject::GetParagraphCount() const { return aContents.Count(); } -XubString BinTextObject::GetText( USHORT nPara ) const +XubString BinTextObject::GetText( sal_uInt16 nPara ) const { DBG_ASSERT( nPara < aContents.Count(), "BinTextObject::GetText: Paragraph does not exist!" ); if ( nPara < aContents.Count() ) @@ -804,7 +804,7 @@ XubString BinTextObject::GetText( USHORT nPara ) const return XubString(); } -void BinTextObject::Insert( const EditTextObject& rObj, USHORT nDestPara ) +void BinTextObject::Insert( const EditTextObject& rObj, sal_uInt16 nDestPara ) { DBG_ASSERT( rObj.Which() == EE_FORMAT_BIN, "UTO: unknown Textobjekt" ); @@ -813,8 +813,8 @@ void BinTextObject::Insert( const EditTextObject& rObj, USHORT nDestPara ) if ( nDestPara > aContents.Count() ) nDestPara = aContents.Count(); - const USHORT nParas = rBinObj.GetContents().Count(); - for ( USHORT nP = 0; nP < nParas; nP++ ) + const sal_uInt16 nParas = rBinObj.GetContents().Count(); + for ( sal_uInt16 nP = 0; nP < nParas; nP++ ) { ContentInfo* pC = rBinObj.GetContents()[ nP ]; ContentInfo* pNew = new ContentInfo( *pC, *GetPool() ); @@ -823,7 +823,7 @@ void BinTextObject::Insert( const EditTextObject& rObj, USHORT nDestPara ) ClearPortionInfo(); } -EditTextObject* BinTextObject::CreateTextObject( USHORT nPara, USHORT nParas ) const +EditTextObject* BinTextObject::CreateTextObject( sal_uInt16 nPara, sal_uInt16 nParas ) const { if ( ( nPara >= aContents.Count() ) || !nParas ) return NULL; @@ -837,8 +837,8 @@ EditTextObject* BinTextObject::CreateTextObject( USHORT nPara, USHORT nParas ) c // If text contains different ScriptTypes, this shouldn't be a problem... pObj->nScriptType = nScriptType; - const USHORT nEndPara = nPara+nParas-1; - for ( USHORT nP = nPara; nP <= nEndPara; nP++ ) + const sal_uInt16 nEndPara = nPara+nParas-1; + for ( sal_uInt16 nP = nPara; nP <= nEndPara; nP++ ) { ContentInfo* pC = aContents[ nP ]; ContentInfo* pNew = new ContentInfo( *pC, *pObj->GetPool() ); @@ -847,7 +847,7 @@ EditTextObject* BinTextObject::CreateTextObject( USHORT nPara, USHORT nParas ) c return pObj; } -void BinTextObject::RemoveParagraph( USHORT nPara ) +void BinTextObject::RemoveParagraph( sal_uInt16 nPara ) { DBG_ASSERT( nPara < aContents.Count(), "BinTextObject::GetText: Paragraph does not exist!" ); if ( nPara < aContents.Count() ) @@ -859,63 +859,63 @@ void BinTextObject::RemoveParagraph( USHORT nPara ) } } -BOOL BinTextObject::HasPortionInfo() const +sal_Bool BinTextObject::HasPortionInfo() const { - return pPortionInfo ? TRUE : FALSE; + return pPortionInfo ? sal_True : sal_False; } void BinTextObject::ClearPortionInfo() { if ( pPortionInfo ) { - for ( USHORT n = pPortionInfo->Count(); n; ) + for ( sal_uInt16 n = pPortionInfo->Count(); n; ) delete pPortionInfo->GetObject( --n ); delete pPortionInfo; pPortionInfo = NULL; } } -BOOL BinTextObject::HasOnlineSpellErrors() const +sal_Bool BinTextObject::HasOnlineSpellErrors() const { #ifndef SVX_LIGHT - for ( USHORT n = 0; n < aContents.Count(); n++ ) + for ( sal_uInt16 n = 0; n < aContents.Count(); n++ ) { ContentInfo* p = aContents.GetObject( n ); if ( p->GetWrongList() && p->GetWrongList()->Count() ) - return TRUE; + return sal_True; } #endif // !SVX_LIGHT - return FALSE; + return sal_False; } -BOOL BinTextObject::HasCharAttribs( USHORT _nWhich ) const +sal_Bool BinTextObject::HasCharAttribs( sal_uInt16 _nWhich ) const { - for ( USHORT nPara = GetContents().Count(); nPara; ) + for ( sal_uInt16 nPara = GetContents().Count(); nPara; ) { ContentInfo* pC = GetContents().GetObject( --nPara ); - USHORT nAttribs = pC->GetAttribs().Count(); + sal_uInt16 nAttribs = pC->GetAttribs().Count(); if ( nAttribs && !_nWhich ) - return TRUE; + return sal_True; - for ( USHORT nAttr = nAttribs; nAttr; ) + for ( sal_uInt16 nAttr = nAttribs; nAttr; ) { XEditAttribute* pX = pC->GetAttribs().GetObject( --nAttr ); if ( pX->GetItem()->Which() == _nWhich ) - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } -void BinTextObject::GetCharAttribs( USHORT nPara, EECharAttribArray& rLst ) const +void BinTextObject::GetCharAttribs( sal_uInt16 nPara, EECharAttribArray& rLst ) const { rLst.Remove( 0, rLst.Count() ); ContentInfo* pC = GetContents().GetObject( nPara ); if ( pC ) { - for ( USHORT nAttr = 0; nAttr < pC->GetAttribs().Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < pC->GetAttribs().Count(); nAttr++ ) { XEditAttribute* pAttr = pC->GetAttribs().GetObject( nAttr ); EECharAttrib aEEAttr; @@ -928,21 +928,21 @@ void BinTextObject::GetCharAttribs( USHORT nPara, EECharAttribArray& rLst ) cons } } -void BinTextObject::MergeParaAttribs( const SfxItemSet& rAttribs, USHORT nStart, USHORT nEnd ) +void BinTextObject::MergeParaAttribs( const SfxItemSet& rAttribs, sal_uInt16 nStart, sal_uInt16 nEnd ) { - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; - for ( USHORT nPara = GetContents().Count(); nPara; ) + for ( sal_uInt16 nPara = GetContents().Count(); nPara; ) { ContentInfo* pC = GetContents().GetObject( --nPara ); - for ( USHORT nW = nStart; nW <= nEnd; nW++ ) + for ( sal_uInt16 nW = nStart; nW <= nEnd; nW++ ) { - if ( ( pC->GetParaAttribs().GetItemState( nW, FALSE ) != SFX_ITEM_ON ) - && ( rAttribs.GetItemState( nW, FALSE ) == SFX_ITEM_ON ) ) + if ( ( pC->GetParaAttribs().GetItemState( nW, sal_False ) != SFX_ITEM_ON ) + && ( rAttribs.GetItemState( nW, sal_False ) == SFX_ITEM_ON ) ) { pC->GetParaAttribs().Put( rAttribs.Get( nW ) ); - bChanged = TRUE; + bChanged = sal_True; } } } @@ -951,9 +951,9 @@ void BinTextObject::MergeParaAttribs( const SfxItemSet& rAttribs, USHORT nStart, ClearPortionInfo(); } -BOOL BinTextObject::IsFieldObject() const +sal_Bool BinTextObject::IsFieldObject() const { - return BinTextObject::GetField() ? TRUE : FALSE; + return BinTextObject::GetField() ? sal_True : sal_False; } const SvxFieldItem* BinTextObject::GetField() const @@ -963,8 +963,8 @@ const SvxFieldItem* BinTextObject::GetField() const ContentInfo* pC = GetContents()[0]; if ( pC->GetText().Len() == 1 ) { - USHORT nAttribs = pC->GetAttribs().Count(); - for ( USHORT nAttr = nAttribs; nAttr; ) + sal_uInt16 nAttribs = pC->GetAttribs().Count(); + for ( sal_uInt16 nAttr = nAttribs; nAttr; ) { XEditAttribute* pX = pC->GetAttribs().GetObject( --nAttr ); if ( pX->GetItem()->Which() == EE_FEATURE_FIELD ) @@ -975,59 +975,59 @@ const SvxFieldItem* BinTextObject::GetField() const return 0; } -BOOL BinTextObject::HasField( TypeId aType ) const +sal_Bool BinTextObject::HasField( TypeId aType ) const { - USHORT nParagraphs = GetContents().Count(); - for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) + sal_uInt16 nParagraphs = GetContents().Count(); + for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = GetContents().GetObject( nPara ); - USHORT nAttrs = pC->GetAttribs().Count(); - for ( USHORT nAttr = 0; nAttr < nAttrs; nAttr++ ) + sal_uInt16 nAttrs = pC->GetAttribs().Count(); + for ( sal_uInt16 nAttr = 0; nAttr < nAttrs; nAttr++ ) { XEditAttribute* pAttr = pC->GetAttribs()[nAttr]; if ( pAttr->GetItem()->Which() == EE_FEATURE_FIELD ) { if ( !aType ) - return TRUE; + return sal_True; const SvxFieldData* pFldData = ((const SvxFieldItem*)pAttr->GetItem())->GetField(); if ( pFldData && pFldData->IsA( aType ) ) - return TRUE; + return sal_True; } } } - return FALSE; + return sal_False; } -SfxItemSet BinTextObject::GetParaAttribs( USHORT nPara ) const +SfxItemSet BinTextObject::GetParaAttribs( sal_uInt16 nPara ) const { ContentInfo* pC = GetContents().GetObject( nPara ); return pC->GetParaAttribs(); } -void BinTextObject::SetParaAttribs( USHORT nPara, const SfxItemSet& rAttribs ) +void BinTextObject::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rAttribs ) { ContentInfo* pC = GetContents().GetObject( nPara ); pC->GetParaAttribs().Set( rAttribs ); ClearPortionInfo(); } -BOOL BinTextObject::RemoveCharAttribs( USHORT _nWhich ) +sal_Bool BinTextObject::RemoveCharAttribs( sal_uInt16 _nWhich ) { - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; - for ( USHORT nPara = GetContents().Count(); nPara; ) + for ( sal_uInt16 nPara = GetContents().Count(); nPara; ) { ContentInfo* pC = GetContents().GetObject( --nPara ); - for ( USHORT nAttr = pC->GetAttribs().Count(); nAttr; ) + for ( sal_uInt16 nAttr = pC->GetAttribs().Count(); nAttr; ) { XEditAttribute* pAttr = pC->GetAttribs().GetObject( --nAttr ); if ( !_nWhich || ( pAttr->GetItem()->Which() == _nWhich ) ) { pC->GetAttribs().Remove( nAttr ); DestroyAttrib( pAttr ); - bChanged = TRUE; + bChanged = sal_True; } } } @@ -1038,18 +1038,18 @@ BOOL BinTextObject::RemoveCharAttribs( USHORT _nWhich ) return bChanged; } -BOOL BinTextObject::RemoveParaAttribs( USHORT _nWhich ) +sal_Bool BinTextObject::RemoveParaAttribs( sal_uInt16 _nWhich ) { - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; - for ( USHORT nPara = GetContents().Count(); nPara; ) + for ( sal_uInt16 nPara = GetContents().Count(); nPara; ) { ContentInfo* pC = GetContents().GetObject( --nPara ); if ( !_nWhich ) { if( pC->GetParaAttribs().Count() ) - bChanged = TRUE; + bChanged = sal_True; pC->GetParaAttribs().ClearItem(); } else @@ -1057,7 +1057,7 @@ BOOL BinTextObject::RemoveParaAttribs( USHORT _nWhich ) if ( pC->GetParaAttribs().GetItemState( _nWhich ) == SFX_ITEM_ON ) { pC->GetParaAttribs().ClearItem( _nWhich ); - bChanged = TRUE; + bChanged = sal_True; } } } @@ -1068,19 +1068,19 @@ BOOL BinTextObject::RemoveParaAttribs( USHORT _nWhich ) return bChanged; } -BOOL BinTextObject::HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const +sal_Bool BinTextObject::HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const { - USHORT nParagraphs = GetContents().Count(); - for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) + sal_uInt16 nParagraphs = GetContents().Count(); + for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = GetContents().GetObject( nPara ); if ( ( pC->GetFamily() == eFamily ) && ( pC->GetStyle() == rName ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -void BinTextObject::GetStyleSheet( USHORT nPara, XubString& rName, SfxStyleFamily& rFamily ) const +void BinTextObject::GetStyleSheet( sal_uInt16 nPara, XubString& rName, SfxStyleFamily& rFamily ) const { if ( nPara < aContents.Count() ) { @@ -1090,7 +1090,7 @@ void BinTextObject::GetStyleSheet( USHORT nPara, XubString& rName, SfxStyleFamil } } -void BinTextObject::SetStyleSheet( USHORT nPara, const XubString& rName, const SfxStyleFamily& rFamily ) +void BinTextObject::SetStyleSheet( sal_uInt16 nPara, const XubString& rName, const SfxStyleFamily& rFamily ) { if ( nPara < aContents.Count() ) { @@ -1100,14 +1100,14 @@ void BinTextObject::SetStyleSheet( USHORT nPara, const XubString& rName, const S } } -BOOL BinTextObject::ImpChangeStyleSheets( +sal_Bool BinTextObject::ImpChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily, const XubString& rNewName, SfxStyleFamily eNewFamily ) { - const USHORT nParagraphs = GetContents().Count(); - BOOL bChanges = FALSE; + const sal_uInt16 nParagraphs = GetContents().Count(); + sal_Bool bChanges = sal_False; - for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) + for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = GetContents().GetObject( nPara ); if ( pC->GetFamily() == eOldFamily ) @@ -1116,18 +1116,18 @@ BOOL BinTextObject::ImpChangeStyleSheets( { pC->GetStyle() = rNewName; pC->GetFamily() = eNewFamily; - bChanges = TRUE; + bChanges = sal_True; } } } return bChanges; } -BOOL BinTextObject::ChangeStyleSheets( +sal_Bool BinTextObject::ChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily, const XubString& rNewName, SfxStyleFamily eNewFamily ) { - BOOL bChanges = ImpChangeStyleSheets( rOldName, eOldFamily, rNewName, eNewFamily ); + sal_Bool bChanges = ImpChangeStyleSheets( rOldName, eOldFamily, rNewName, eNewFamily ); if ( bChanges ) ClearPortionInfo(); @@ -1142,7 +1142,7 @@ void BinTextObject::ChangeStyleSheetName( SfxStyleFamily eFamily, void BinTextObject::StoreData( SvStream& rOStream ) const { - USHORT nVer = 602; + sal_uInt16 nVer = 602; rOStream << nVer; rOStream << bOwnerOfPool; @@ -1155,17 +1155,17 @@ void BinTextObject::StoreData( SvStream& rOStream ) const } // Store Current text encoding ... - rtl_TextEncoding eEncoding = GetSOStoreTextEncoding( gsl_getSystemTextEncoding(), (USHORT) rOStream.GetVersion() ); - rOStream << (USHORT) eEncoding; + rtl_TextEncoding eEncoding = GetSOStoreTextEncoding( gsl_getSystemTextEncoding(), (sal_uInt16) rOStream.GetVersion() ); + rOStream << (sal_uInt16) eEncoding; // The number of paragraphs ... - USHORT nParagraphs = GetContents().Count(); + sal_uInt16 nParagraphs = GetContents().Count(); rOStream << nParagraphs; char cFeatureConverted = ByteString( CH_FEATURE, eEncoding ).GetChar(0); // The individual paragraphs ... - for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) + for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = GetContents().GetObject( nPara ); @@ -1173,17 +1173,17 @@ void BinTextObject::StoreData( SvStream& rOStream ) const ByteString aText( pC->GetText(), eEncoding ); // Symbols? - BOOL bSymbolPara = FALSE; + sal_Bool bSymbolPara = sal_False; if ( pC->GetParaAttribs().GetItemState( EE_CHAR_FONTINFO ) == SFX_ITEM_ON ) { const SvxFontItem& rFontItem = (const SvxFontItem&)pC->GetParaAttribs().Get( EE_CHAR_FONTINFO ); if ( rFontItem.GetCharSet() == RTL_TEXTENCODING_SYMBOL ) { aText = ByteString( pC->GetText(), RTL_TEXTENCODING_SYMBOL ); - bSymbolPara = TRUE; + bSymbolPara = sal_True; } } - for ( USHORT nA = 0; nA < pC->GetAttribs().Count(); nA++ ) + for ( sal_uInt16 nA = 0; nA < pC->GetAttribs().Count(); nA++ ) { XEditAttribute* pAttr = pC->GetAttribs().GetObject( nA ); @@ -1206,7 +1206,7 @@ void BinTextObject::StoreData( SvStream& rOStream ) const { // Don't create a new Attrib with StarBats font, MBR changed the // SvxFontItem::Store() to store StarBats instead of StarSymbol! - for ( USHORT nChar = pAttr->GetStart(); nChar < pAttr->GetEnd(); nChar++ ) + for ( sal_uInt16 nChar = pAttr->GetStart(); nChar < pAttr->GetEnd(); nChar++ ) { sal_Unicode cOld = pC->GetText().GetChar( nChar ); char cConv = ByteString::ConvertFromUnicode( ConvertFontToSubsFontChar( hConv, cOld ), RTL_TEXTENCODING_SYMBOL ); @@ -1229,7 +1229,7 @@ void BinTextObject::StoreData( SvStream& rOStream ) const } if ( hConv ) { - for ( USHORT nChar = 0; nChar < pC->GetText().Len(); nChar++ ) + for ( sal_uInt16 nChar = 0; nChar < pC->GetText().Len(); nChar++ ) { if ( !pC->GetAttribs().FindAttrib( EE_CHAR_FONTINFO, nChar ) ) { @@ -1251,19 +1251,19 @@ void BinTextObject::StoreData( SvStream& rOStream ) const // StyleName and Family... rOStream.WriteByteString( ByteString( pC->GetStyle(), eEncoding ) ); - rOStream << (USHORT)pC->GetFamily(); + rOStream << (sal_uInt16)pC->GetFamily(); // Paragraph attributes ... pC->GetParaAttribs().Store( rOStream ); // The number of attributes ... - USHORT nAttribs = pC->GetAttribs().Count(); + sal_uInt16 nAttribs = pC->GetAttribs().Count(); rOStream << nAttribs; // And the individual attributes // Items as Surregate => always 8 bytes per Attribute // Which = 2; Surregat = 2; Start = 2; End = 2; - for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < nAttribs; nAttr++ ) { XEditAttribute* pX = pC->GetAttribs().GetObject( nAttr ); @@ -1285,16 +1285,16 @@ void BinTextObject::StoreData( SvStream& rOStream ) const rOStream << bStoreUnicodeStrings; if ( bStoreUnicodeStrings ) { - for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) + for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = GetContents().GetObject( nPara ); - USHORT nL = pC->GetText().Len(); + sal_uInt16 nL = pC->GetText().Len(); rOStream << nL; rOStream.Write( pC->GetText().GetBuffer(), nL*sizeof(sal_Unicode) ); // StyleSheetName must be Unicode too! // Copy/Paste from EA3 to BETA or from BETA to EA3 not possible, not needed... - // If needed, change nL back to ULONG and increase version... + // If needed, change nL back to sal_uLong and increase version... nL = pC->GetStyle().Len(); rOStream << nL; rOStream.Write( pC->GetStyle().GetBuffer(), nL*sizeof(sal_Unicode) ); @@ -1308,7 +1308,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) // The text object was first created with the current setting of // pTextObjectPool. - BOOL bOwnerOfCurrent = bOwnerOfPool; + sal_Bool bOwnerOfCurrent = bOwnerOfPool; rIStream >> bOwnerOfPool; if ( bOwnerOfCurrent && !bOwnerOfPool ) @@ -1327,17 +1327,17 @@ void BinTextObject::CreateData( SvStream& rIStream ) GetPool()->Load( rIStream ); // CharSet, in which it was saved: - USHORT nCharSet; + sal_uInt16 nCharSet; rIStream >> nCharSet; - rtl_TextEncoding eSrcEncoding = GetSOLoadTextEncoding( (rtl_TextEncoding)nCharSet, (USHORT)rIStream.GetVersion() ); + rtl_TextEncoding eSrcEncoding = GetSOLoadTextEncoding( (rtl_TextEncoding)nCharSet, (sal_uInt16)rIStream.GetVersion() ); // The number of paragraphs ... - USHORT nParagraphs; + sal_uInt16 nParagraphs; rIStream >> nParagraphs; // The individual paragraphs ... - for ( ULONG nPara = 0; nPara < nParagraphs; nPara++ ) + for ( sal_uLong nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = CreateAndInsertContent(); @@ -1348,7 +1348,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) // StyleName and Family... rIStream.ReadByteString( pC->GetStyle(), eSrcEncoding ); - USHORT nStyleFamily; + sal_uInt16 nStyleFamily; rIStream >> nStyleFamily; pC->GetFamily() = (SfxStyleFamily)nStyleFamily; @@ -1356,16 +1356,16 @@ void BinTextObject::CreateData( SvStream& rIStream ) pC->GetParaAttribs().Load( rIStream ); // The number of attributes ... - USHORT nAttribs; + sal_uInt16 nAttribs; rIStream >> nAttribs; // And the individual attributes // Items as Surregate => always 8 bytes per Attributes // Which = 2; Surregat = 2; Start = 2; End = 2; - USHORT nAttr; + sal_uInt16 nAttr; for ( nAttr = 0; nAttr < nAttribs; nAttr++ ) { - USHORT _nWhich, nStart, nEnd; + sal_uInt16 _nWhich, nStart, nEnd; const SfxPoolItem* pItem; rIStream >> _nWhich; @@ -1387,8 +1387,8 @@ void BinTextObject::CreateData( SvStream& rIStream ) if ( ( _nWhich >= EE_FEATURE_START ) && ( _nWhich <= EE_FEATURE_END ) ) { // Convert CH_FEATURE to CH_FEATURE_OLD - DBG_ASSERT( (BYTE) aByteString.GetChar( nStart ) == CH_FEATURE_OLD, "CreateData: CH_FEATURE expected!" ); - if ( (BYTE) aByteString.GetChar( nStart ) == CH_FEATURE_OLD ) + DBG_ASSERT( (sal_uInt8) aByteString.GetChar( nStart ) == CH_FEATURE_OLD, "CreateData: CH_FEATURE expected!" ); + if ( (sal_uInt8) aByteString.GetChar( nStart ) == CH_FEATURE_OLD ) pC->GetText().SetChar( nStart, CH_FEATURE ); } } @@ -1398,14 +1398,14 @@ void BinTextObject::CreateData( SvStream& rIStream ) // But check for paragraph and character symbol attribs here, // FinishLoad will not be called in OpenOffice Calc, no StyleSheets... - BOOL bSymbolPara = FALSE; + sal_Bool bSymbolPara = sal_False; if ( pC->GetParaAttribs().GetItemState( EE_CHAR_FONTINFO ) == SFX_ITEM_ON ) { const SvxFontItem& rFontItem = (const SvxFontItem&)pC->GetParaAttribs().Get( EE_CHAR_FONTINFO ); if ( rFontItem.GetCharSet() == RTL_TEXTENCODING_SYMBOL ) { pC->GetText() = String( aByteString, RTL_TEXTENCODING_SYMBOL ); - bSymbolPara = TRUE; + bSymbolPara = sal_True; } } @@ -1437,7 +1437,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) pC->GetAttribs().Insert( pNewAttr, nAttr ); DestroyAttrib( pAttr ); - for ( USHORT nChar = pNewAttr->GetStart(); nChar < pNewAttr->GetEnd(); nChar++ ) + for ( sal_uInt16 nChar = pNewAttr->GetStart(); nChar < pNewAttr->GetEnd(); nChar++ ) { sal_Unicode cOld = pC->GetText().GetChar( nChar ); DBG_ASSERT( cOld >= 0xF000, "cOld not converted?!" ); @@ -1464,7 +1464,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) aNewFontItem.GetFamilyName() = GetFontToSubsFontName( hConv ); pC->GetParaAttribs().Put( aNewFontItem ); - for ( USHORT nChar = 0; nChar < pC->GetText().Len(); nChar++ ) + for ( sal_uInt16 nChar = 0; nChar < pC->GetText().Len(); nChar++ ) { if ( !pC->GetAttribs().FindAttrib( EE_CHAR_FONTINFO, nChar ) ) { @@ -1484,7 +1484,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) // From 400 also the DefMetric: if ( nVersion >= 400 ) { - USHORT nTmpMetric; + sal_uInt16 nTmpMetric; rIStream >> nTmpMetric; if ( nVersion >= 401 ) { @@ -1511,14 +1511,14 @@ void BinTextObject::CreateData( SvStream& rIStream ) { rIStream >> nScriptType; - BOOL bUnicodeStrings; + sal_Bool bUnicodeStrings; rIStream >> bUnicodeStrings; if ( bUnicodeStrings ) { - for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) + for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = GetContents().GetObject( nPara ); - USHORT nL; + sal_uInt16 nL; // Text rIStream >> nL; @@ -1526,7 +1526,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) { pC->GetText().AllocBuffer( nL ); rIStream.Read( pC->GetText().GetBufferAccess(), nL*sizeof(sal_Unicode) ); - pC->GetText().ReleaseBufferAccess( (USHORT)nL ); + pC->GetText().ReleaseBufferAccess( (sal_uInt16)nL ); } // StyleSheetName @@ -1535,7 +1535,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) { pC->GetStyle().AllocBuffer( nL ); rIStream.Read( pC->GetStyle().GetBufferAccess(), nL*sizeof(sal_Unicode) ); - pC->GetStyle().ReleaseBufferAccess( (USHORT)nL ); + pC->GetStyle().ReleaseBufferAccess( (sal_uInt16)nL ); } } } @@ -1546,7 +1546,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) // Works only if tab positions are set, not when DefTab. if ( nVersion < 500 ) { - for ( USHORT n = 0; n < aContents.Count(); n++ ) + for ( sal_uInt16 n = 0; n < aContents.Count(); n++ ) { ContentInfo* pC = aContents.GetObject( n ); const SvxLRSpaceItem& rLRSpace = (const SvxLRSpaceItem&) pC->GetParaAttribs().Get( EE_PARA_LRSPACE ); @@ -1554,7 +1554,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) { const SvxTabStopItem& rTabs = (const SvxTabStopItem&) pC->GetParaAttribs().Get( EE_PARA_TABS ); SvxTabStopItem aNewTabs( 0, 0, SVX_TAB_ADJUST_LEFT, EE_PARA_TABS ); - for ( USHORT t = 0; t < rTabs.Count(); t++ ) + for ( sal_uInt16 t = 0; t < rTabs.Count(); t++ ) { const SvxTabStop& rT = rTabs[ t ]; aNewTabs.Insert( SvxTabStop( rT.GetTabPos() - rLRSpace.GetTxtLeft(), @@ -1566,7 +1566,7 @@ void BinTextObject::CreateData( SvStream& rIStream ) } } -USHORT BinTextObject::GetVersion() const +sal_uInt16 BinTextObject::GetVersion() const { return nVersion; } @@ -1584,7 +1584,7 @@ bool BinTextObject::operator==( const BinTextObject& rCompare ) const ( bVertical != rCompare.bVertical ) ) return false; - USHORT n; + sal_uInt16 n; for( n = 0; n < aContents.Count(); n++ ) { if( !( *aContents.GetObject( n ) == *rCompare.aContents.GetObject( n ) ) ) @@ -1602,7 +1602,7 @@ bool BinTextObject::isWrongListEqual(const BinTextObject& rCompare) const return false; } - for(USHORT a(0); a < GetContents().Count(); a++) + for(sal_uInt16 a(0); a < GetContents().Count(); a++) { const ContentInfo& rCandA(*GetContents().GetObject(a)); const ContentInfo& rCandB(*rCompare.GetContents().GetObject(a)); @@ -1631,7 +1631,7 @@ void BinTextObject::CreateData300( SvStream& rIStream ) rIStream >> nParagraphs; // The individual paragraphs... - for ( ULONG nPara = 0; nPara < nParagraphs; nPara++ ) + for ( sal_uLong nPara = 0; nPara < nParagraphs; nPara++ ) { ContentInfo* pC = CreateAndInsertContent(); @@ -1640,7 +1640,7 @@ void BinTextObject::CreateData300( SvStream& rIStream ) // StyleName and Family... rIStream.ReadByteString( pC->GetStyle() ); - USHORT nStyleFamily; + sal_uInt16 nStyleFamily; rIStream >> nStyleFamily; pC->GetFamily() = (SfxStyleFamily)nStyleFamily; @@ -1654,9 +1654,9 @@ void BinTextObject::CreateData300( SvStream& rIStream ) // And the individual attributes // Items as Surregate => always 8 bytes per Attribute // Which = 2; Surregat = 2; Start = 2; End = 2; - for ( ULONG nAttr = 0; nAttr < nAttribs; nAttr++ ) + for ( sal_uLong nAttr = 0; nAttr < nAttribs; nAttr++ ) { - USHORT _nWhich, nStart, nEnd; + sal_uInt16 _nWhich, nStart, nEnd; const SfxPoolItem* pItem; rIStream >> _nWhich; @@ -1673,11 +1673,11 @@ void BinTextObject::CreateData300( SvStream& rIStream ) } // Check whether a font was saved - USHORT nCharSetMarker; + sal_uInt16 nCharSetMarker; rIStream >> nCharSetMarker; if ( nCharSetMarker == CHARSETMARKER ) { - USHORT nCharSet; + sal_uInt16 nCharSet; rIStream >> nCharSet; } } diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx index bc431ed0632f..38b530005302 100644..100755 --- a/editeng/source/editeng/editobj2.hxx +++ b/editeng/source/editeng/editobj2.hxx @@ -44,8 +44,8 @@ class XEditAttribute private: const SfxPoolItem* pItem; - USHORT nStart; - USHORT nEnd; + sal_uInt16 nStart; + sal_uInt16 nEnd; XEditAttribute(); XEditAttribute( const XEditAttribute& rCopyFrom ); @@ -54,19 +54,19 @@ private: public: XEditAttribute( const SfxPoolItem& rAttr ); - XEditAttribute( const SfxPoolItem& rAttr, USHORT nStart, USHORT nEnd ); + XEditAttribute( const SfxPoolItem& rAttr, sal_uInt16 nStart, sal_uInt16 nEnd ); const SfxPoolItem* GetItem() const { return pItem; } - USHORT& GetStart() { return nStart; } - USHORT& GetEnd() { return nEnd; } + sal_uInt16& GetStart() { return nStart; } + sal_uInt16& GetEnd() { return nEnd; } - USHORT GetStart() const { return nStart; } - USHORT GetEnd() const { return nEnd; } + sal_uInt16 GetStart() const { return nStart; } + sal_uInt16 GetEnd() const { return nEnd; } - USHORT GetLen() const { return nEnd-nStart; } + sal_uInt16 GetLen() const { return nEnd-nStart; } - inline BOOL IsFeature(); + inline sal_Bool IsFeature(); inline bool operator==( const XEditAttribute& rCompare ); }; @@ -80,9 +80,9 @@ inline bool XEditAttribute::operator==( const XEditAttribute& rCompare ) (*pItem == *rCompare.pItem)); } -inline BOOL XEditAttribute::IsFeature() +inline sal_Bool XEditAttribute::IsFeature() { - USHORT nWhich = pItem->Which(); + sal_uInt16 nWhich = pItem->Which(); return ( ( nWhich >= EE_FEATURE_START ) && ( nWhich <= EE_FEATURE_END ) ); } @@ -93,13 +93,13 @@ SV_DECL_PTRARR( XEditAttributeListImpl, XEditAttributePtr, 0, 4 ) class XEditAttributeList : public XEditAttributeListImpl { public: - XEditAttribute* FindAttrib( USHORT nWhich, USHORT nChar ) const; + XEditAttribute* FindAttrib( sal_uInt16 nWhich, sal_uInt16 nChar ) const; }; struct XParaPortion { long nHeight; - USHORT nFirstLineOffset; + sal_uInt16 nFirstLineOffset; EditLineList aLines; TextPortionList aTextPortions; @@ -110,26 +110,26 @@ SV_DECL_PTRARR( XBaseParaPortionList, XParaPortionPtr, 0, 4 ) class XParaPortionList : public XBaseParaPortionList { - ULONG nRefDevPtr; + sal_uIntPtr nRefDevPtr; OutDevType eRefDevType; MapMode aRefMapMode; sal_uInt16 nStretchX; sal_uInt16 nStretchY; - ULONG nPaperWidth; + sal_uLong nPaperWidth; public: - XParaPortionList( OutputDevice* pRefDev, ULONG nPW, sal_uInt16 _nStretchX, sal_uInt16 _nStretchY ) : + XParaPortionList( OutputDevice* pRefDev, sal_uLong nPW, sal_uInt16 _nStretchX, sal_uInt16 _nStretchY ) : aRefMapMode( pRefDev->GetMapMode() ), nStretchX(_nStretchX), nStretchY(_nStretchY) { - nRefDevPtr = (ULONG)pRefDev; nPaperWidth = nPW; + nRefDevPtr = (sal_uIntPtr)pRefDev; nPaperWidth = nPW; eRefDevType = pRefDev->GetOutDevType(); } - ULONG GetRefDevPtr() const { return nRefDevPtr; } - ULONG GetPaperWidth() const { return nPaperWidth; } + sal_uIntPtr GetRefDevPtr() const { return nRefDevPtr; } + sal_uLong GetPaperWidth() const { return nPaperWidth; } OutDevType GetRefDevType() const { return eRefDevType; } const MapMode& GetRefMapMode() const { return aRefMapMode; } sal_uInt16 GetStretchX() const { return nStretchX; } @@ -142,10 +142,10 @@ struct LoadStoreTempInfos ByteString aOrgString_Load; FontToSubsFontConverter hOldSymbolConv_Store; - BOOL bSymbolParagraph_Store; + sal_Bool bSymbolParagraph_Store; - LoadStoreTempInfos() { bSymbolParagraph_Store = FALSE; hOldSymbolConv_Store = NULL; } + LoadStoreTempInfos() { bSymbolParagraph_Store = sal_False; hOldSymbolConv_Store = NULL; } }; */ @@ -198,23 +198,23 @@ class BinTextObject : public EditTextObject, public SfxItemPoolUser private: ContentInfoList aContents; SfxItemPool* pPool; - BOOL bOwnerOfPool; + sal_Bool bOwnerOfPool; XParaPortionList* pPortionInfo; sal_uInt32 nObjSettings; - USHORT nMetric; - USHORT nVersion; - USHORT nUserType; - USHORT nScriptType; + sal_uInt16 nMetric; + sal_uInt16 nVersion; + sal_uInt16 nUserType; + sal_uInt16 nScriptType; - BOOL bVertical; - BOOL bStoreUnicodeStrings; + sal_Bool bVertical; + sal_Bool bStoreUnicodeStrings; protected: void DeleteContents(); virtual void StoreData( SvStream& rOStream ) const; virtual void CreateData( SvStream& rIStream ); - BOOL ImpChangeStyleSheets( const String& rOldName, SfxStyleFamily eOldFamily, + sal_Bool ImpChangeStyleSheets( const String& rOldName, SfxStyleFamily eOldFamily, const String& rNewName, SfxStyleFamily eNewFamily ); public: @@ -224,22 +224,22 @@ public: virtual EditTextObject* Clone() const; - USHORT GetUserType() const; - void SetUserType( USHORT n ); + sal_uInt16 GetUserType() const; + void SetUserType( sal_uInt16 n ); - ULONG GetObjectSettings() const; - void SetObjectSettings( ULONG n ); + sal_uLong GetObjectSettings() const; + void SetObjectSettings( sal_uLong n ); - BOOL IsVertical() const; - void SetVertical( BOOL b ); + sal_Bool IsVertical() const; + void SetVertical( sal_Bool b ); - USHORT GetScriptType() const; - void SetScriptType( USHORT nType ); + sal_uInt16 GetScriptType() const; + void SetScriptType( sal_uInt16 nType ); - USHORT GetVersion() const; // As long as the outliner does not store any record length + sal_uInt16 GetVersion() const; // As long as the outliner does not store any record length ContentInfo* CreateAndInsertContent(); - XEditAttribute* CreateAttrib( const SfxPoolItem& rItem, USHORT nStart, USHORT nEnd ); + XEditAttribute* CreateAttrib( const SfxPoolItem& rItem, sal_uInt16 nStart, sal_uInt16 nEnd ); void DestroyAttrib( XEditAttribute* pAttr ); ContentInfoList& GetContents() { return aContents; } @@ -249,47 +249,48 @@ public: void SetPortionInfo( XParaPortionList* pP ) { pPortionInfo = pP; } - virtual USHORT GetParagraphCount() const; - virtual String GetText( USHORT nParagraph ) const; - virtual void Insert( const EditTextObject& rObj, USHORT nPara ); - virtual EditTextObject* CreateTextObject( USHORT nPara, USHORT nParas = 1 ) const; - virtual void RemoveParagraph( USHORT nPara ); + virtual sal_uInt16 GetParagraphCount() const; + virtual String GetText( sal_uInt16 nParagraph ) const; + virtual void Insert( const EditTextObject& rObj, sal_uInt16 nPara ); + virtual EditTextObject* CreateTextObject( sal_uInt16 nPara, sal_uInt16 nParas = 1 ) const; + virtual void RemoveParagraph( sal_uInt16 nPara ); - virtual BOOL HasPortionInfo() const; + virtual sal_Bool HasPortionInfo() const; virtual void ClearPortionInfo(); - virtual BOOL HasOnlineSpellErrors() const; + virtual sal_Bool HasOnlineSpellErrors() const; - virtual BOOL HasCharAttribs( USHORT nWhich = 0 ) const; - virtual void GetCharAttribs( USHORT nPara, EECharAttribArray& rLst ) const; + virtual sal_Bool HasCharAttribs( sal_uInt16 nWhich = 0 ) const; + virtual void GetCharAttribs( sal_uInt16 nPara, EECharAttribArray& rLst ) const; - virtual BOOL RemoveCharAttribs( USHORT nWhich = 0 ); - virtual BOOL RemoveParaAttribs( USHORT nWhich = 0 ); + virtual sal_Bool RemoveCharAttribs( sal_uInt16 nWhich = 0 ); + virtual sal_Bool RemoveParaAttribs( sal_uInt16 nWhich = 0 ); - virtual void MergeParaAttribs( const SfxItemSet& rAttribs, USHORT nStart, USHORT nEnd ); + virtual void MergeParaAttribs( const SfxItemSet& rAttribs, sal_uInt16 nStart, sal_uInt16 nEnd ); - virtual BOOL IsFieldObject() const; + virtual sal_Bool IsFieldObject() const; virtual const SvxFieldItem* GetField() const; - virtual BOOL HasField( TypeId Type = NULL ) const; + virtual sal_Bool HasField( TypeId Type = NULL ) const; - SfxItemSet GetParaAttribs( USHORT nPara ) const; - void SetParaAttribs( USHORT nPara, const SfxItemSet& rAttribs ); + SfxItemSet GetParaAttribs( sal_uInt16 nPara ) const; + void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rAttribs ); - virtual BOOL HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const; - virtual void GetStyleSheet( USHORT nPara, XubString& rName, SfxStyleFamily& eFamily ) const; - virtual void SetStyleSheet( USHORT nPara, const XubString& rName, const SfxStyleFamily& eFamily ); - virtual BOOL ChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily, + virtual sal_Bool HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const; + virtual void GetStyleSheet( sal_uInt16 nPara, XubString& rName, SfxStyleFamily& eFamily ) const; + virtual void SetStyleSheet( sal_uInt16 nPara, const XubString& rName, const SfxStyleFamily& eFamily ); + virtual sal_Bool ChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily, const String& rNewName, SfxStyleFamily eNewFamily ); virtual void ChangeStyleSheetName( SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName ); void CreateData300( SvStream& rIStream ); - BOOL HasMetric() const { return nMetric != 0xFFFF; } - USHORT GetMetric() const { return nMetric; } - void SetMetric( USHORT n ) { nMetric = n; } + sal_Bool HasMetric() const { return nMetric != 0xFFFF; } + sal_uInt16 GetMetric() const { return nMetric; } + void SetMetric( sal_uInt16 n ) { nMetric = n; } + + sal_Bool IsOwnerOfPool() const { return bOwnerOfPool; } + void StoreUnicodeStrings( sal_Bool b ) { bStoreUnicodeStrings = b; } - BOOL IsOwnerOfPool() const { return bOwnerOfPool; } - void StoreUnicodeStrings( BOOL b ) { bStoreUnicodeStrings = b; } bool operator==( const BinTextObject& rCompare ) const; // #i102062# diff --git a/editeng/source/editeng/editsel.cxx b/editeng/source/editeng/editsel.cxx index 6de19ea87320..e7f0fc82f05b 100644..100755 --- a/editeng/source/editeng/editsel.cxx +++ b/editeng/source/editeng/editsel.cxx @@ -54,20 +54,20 @@ void EditSelFunctionSet::DestroyAnchor() // Only with multiple selection } -BOOL EditSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, BOOL ) +sal_Bool EditSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, sal_Bool ) { if ( pCurView ) return pCurView->pImpEditView->SetCursorAtPoint( rPointPixel ); - return FALSE; + return sal_False; } -BOOL EditSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel ) +sal_Bool EditSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel ) { if ( pCurView ) return pCurView->pImpEditView->IsSelectionAtPoint( rPointPixel ); - return FALSE; + return sal_False; } void EditSelFunctionSet::DeselectAtPoint( const Point& ) @@ -95,7 +95,7 @@ void EditSelFunctionSet::DeselectAll() EditSelectionEngine::EditSelectionEngine() : SelectionEngine( (Window*)0 ) { SetSelectionMode( RANGE_SELECTION ); - EnableDrag( TRUE ); + EnableDrag( sal_True ); } void EditSelectionEngine::SetCurView( EditView* pNewView ) diff --git a/editeng/source/editeng/editsel.hxx b/editeng/source/editeng/editsel.hxx index 0b6835871cda..12e9131d2ffa 100644..100755 --- a/editeng/source/editeng/editsel.hxx +++ b/editeng/source/editeng/editsel.hxx @@ -46,9 +46,9 @@ public: virtual void CreateAnchor(); virtual void DestroyAnchor(); - virtual BOOL SetCursorAtPoint( const Point& rPointPixel, BOOL bDontSelectAtCursor = FALSE ); + virtual sal_Bool SetCursorAtPoint( const Point& rPointPixel, sal_Bool bDontSelectAtCursor = sal_False ); - virtual BOOL IsSelectionAtPoint( const Point& rPointPixel ); + virtual sal_Bool IsSelectionAtPoint( const Point& rPointPixel ); virtual void DeselectAtPoint( const Point& rPointPixel ); virtual void DeselectAll(); diff --git a/editeng/source/editeng/editstt2.hxx b/editeng/source/editeng/editstt2.hxx index 123c175e6a47..201442a8e781 100644..100755 --- a/editeng/source/editeng/editstt2.hxx +++ b/editeng/source/editeng/editstt2.hxx @@ -37,93 +37,93 @@ class InternalEditStatus : public EditStatus public: InternalEditStatus() { ; } - void TurnOnFlags( ULONG nFlags ) + void TurnOnFlags( sal_uLong nFlags ) { nControlBits |= nFlags; } - void TurnOffFlags( ULONG nFlags ) + void TurnOffFlags( sal_uLong nFlags ) { nControlBits &= ~nFlags; } - void TurnOnStatusBits( ULONG nBits ) + void TurnOnStatusBits( sal_uLong nBits ) { nStatusBits |= nBits; } - void TurnOffStatusBits( ULONG nBits ) + void TurnOffStatusBits( sal_uLong nBits ) { nStatusBits &= ~nBits; } - BOOL UseCharAttribs() const + sal_Bool UseCharAttribs() const { return ( ( nControlBits & EE_CNTRL_USECHARATTRIBS ) != 0 ); } - BOOL NotifyCursorMovements() const + sal_Bool NotifyCursorMovements() const { return ( ( nControlBits & EE_CNTRL_CRSRLEFTPARA ) != 0 ); } - BOOL UseIdleFormatter() const + sal_Bool UseIdleFormatter() const { return ( ( nControlBits & EE_CNTRL_DOIDLEFORMAT) != 0 ); } - BOOL AllowPasteSpecial() const + sal_Bool AllowPasteSpecial() const { return ( ( nControlBits & EE_CNTRL_PASTESPECIAL ) != 0 ); } - BOOL DoAutoIndenting() const + sal_Bool DoAutoIndenting() const { return ( ( nControlBits & EE_CNTRL_AUTOINDENTING ) != 0 ); } - BOOL DoUndoAttribs() const + sal_Bool DoUndoAttribs() const { return ( ( nControlBits & EE_CNTRL_UNDOATTRIBS ) != 0 ); } - BOOL OneCharPerLine() const + sal_Bool OneCharPerLine() const { return ( ( nControlBits & EE_CNTRL_ONECHARPERLINE ) != 0 ); } - BOOL IsOutliner() const + sal_Bool IsOutliner() const { return ( ( nControlBits & EE_CNTRL_OUTLINER ) != 0 ); } - BOOL IsOutliner2() const + sal_Bool IsOutliner2() const { return ( ( nControlBits & EE_CNTRL_OUTLINER2 ) != 0 ); } - BOOL IsAnyOutliner() const + sal_Bool IsAnyOutliner() const { return IsOutliner() || IsOutliner2(); } - BOOL DoNotUseColors() const + sal_Bool DoNotUseColors() const { return ( ( nControlBits & EE_CNTRL_NOCOLORS ) != 0 ); } - BOOL AllowBigObjects() const + sal_Bool AllowBigObjects() const { return ( ( nControlBits & EE_CNTRL_ALLOWBIGOBJS ) != 0 ); } - BOOL DoOnlineSpelling() const + sal_Bool DoOnlineSpelling() const { return ( ( nControlBits & EE_CNTRL_ONLINESPELLING ) != 0 ); } - BOOL DoStretch() const + sal_Bool DoStretch() const { return ( ( nControlBits & EE_CNTRL_STRETCHING ) != 0 ); } - BOOL AutoPageSize() const + sal_Bool AutoPageSize() const { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZE ) != 0 ); } - BOOL AutoPageWidth() const + sal_Bool AutoPageWidth() const { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZEX ) != 0 ); } - BOOL AutoPageHeight() const + sal_Bool AutoPageHeight() const { return ( ( nControlBits & EE_CNTRL_AUTOPAGESIZEY ) != 0 ); } - BOOL MarkFields() const + sal_Bool MarkFields() const { return ( ( nControlBits & EE_CNTRL_MARKFIELDS ) != 0 ); } - BOOL DoRestoreFont() const + sal_Bool DoRestoreFont() const { return ( ( nControlBits & EE_CNTRL_RESTOREFONT ) != 0 ); } - BOOL DoImportRTFStyleSheets() const + sal_Bool DoImportRTFStyleSheets() const { return ( ( nControlBits & EE_CNTRL_RTFSTYLESHEETS ) != 0 ); } - BOOL DoAutoCorrect() const + sal_Bool DoAutoCorrect() const { return ( ( nControlBits & EE_CNTRL_AUTOCORRECT ) != 0 ); } - BOOL DoAutoComplete() const + sal_Bool DoAutoComplete() const { return ( ( nControlBits & EE_CNTRL_AUTOCOMPLETE ) != 0 ); } - BOOL DoTabIndenting() const + sal_Bool DoTabIndenting() const { return ( ( nControlBits & EE_CNTRL_TABINDENTING ) != 0 ); } - BOOL DoFormat100() const + sal_Bool DoFormat100() const { return ( ( nControlBits & EE_CNTRL_FORMAT100 ) != 0 ); } - BOOL ULSpaceSummation() const + sal_Bool ULSpaceSummation() const { return ( ( nControlBits & EE_CNTRL_ULSPACESUMMATION ) != 0 ); } - BOOL ULSpaceFirstParagraph() const + sal_Bool ULSpaceFirstParagraph() const { return ( ( nControlBits & EE_CNTRL_ULSPACEFIRSTPARA ) != 0 ); } }; diff --git a/editeng/source/editeng/editundo.cxx b/editeng/source/editeng/editundo.cxx index 46fee225030f..46f547d1aa15 100644..100755 --- a/editeng/source/editeng/editundo.cxx +++ b/editeng/source/editeng/editundo.cxx @@ -58,7 +58,7 @@ TYPEINIT1( EditUndoSetAttribs, EditUndo ); TYPEINIT1( EditUndoTransliteration, EditUndo ); TYPEINIT1( EditUndoMarkSelection, EditUndo ); -void lcl_DoSetSelection( EditView* pView, USHORT nPara ) +void lcl_DoSetSelection( EditView* pView, sal_uInt16 nPara ) { EPaM aEPaM( nPara, 0 ); EditPaM aPaM( pView->GetImpEditEngine()->CreateEditPaM( aEPaM ) ); @@ -72,10 +72,10 @@ EditUndoManager::EditUndoManager( ImpEditEngine* p ) pImpEE = p; } -BOOL EditUndoManager::Undo( USHORT nCount ) +sal_Bool EditUndoManager::Undo() { if ( GetUndoActionCount() == 0 ) - return FALSE; + return sal_False; DBG_ASSERT( pImpEE->GetActiveView(), "Active View?" ); @@ -86,15 +86,15 @@ BOOL EditUndoManager::Undo( USHORT nCount ) else { OSL_FAIL("Undo in engine is not possible without a View! "); - return FALSE; + return sal_False; } } pImpEE->GetActiveView()->GetImpEditView()->DrawSelection(); // Remove the old selection - pImpEE->SetUndoMode( TRUE ); - BOOL bDone = SfxUndoManager::Undo( nCount ); - pImpEE->SetUndoMode( FALSE ); + pImpEE->SetUndoMode( sal_True ); + sal_Bool bDone = SfxUndoManager::Undo(); + pImpEE->SetUndoMode( sal_False ); EditSelection aNewSel( pImpEE->GetActiveView()->GetImpEditView()->GetEditSelection() ); DBG_ASSERT( !aNewSel.IsInvalid(), "Invalid selection after Undo () "); @@ -107,10 +107,10 @@ BOOL EditUndoManager::Undo( USHORT nCount ) return bDone; } -BOOL EditUndoManager::Redo( USHORT nCount ) +sal_Bool EditUndoManager::Redo() { if ( GetRedoActionCount() == 0 ) - return FALSE; + return sal_False; DBG_ASSERT( pImpEE->GetActiveView(), "Active View?" ); @@ -121,15 +121,15 @@ BOOL EditUndoManager::Redo( USHORT nCount ) else { OSL_FAIL( "Redo in Engine ohne View nicht moeglich!" ); - return FALSE; + return sal_False; } } pImpEE->GetActiveView()->GetImpEditView()->DrawSelection(); // Remove the old selection - pImpEE->SetUndoMode( TRUE ); - BOOL bDone = SfxUndoManager::Redo( nCount ); - pImpEE->SetUndoMode( FALSE ); + pImpEE->SetUndoMode( sal_True ); + sal_Bool bDone = SfxUndoManager::Redo(); + pImpEE->SetUndoMode( sal_False ); EditSelection aNewSel( pImpEE->GetActiveView()->GetImpEditView()->GetEditSelection() ); DBG_ASSERT( !aNewSel.IsInvalid(), "Invalid selection after Undo () "); @@ -142,7 +142,7 @@ BOOL EditUndoManager::Redo( USHORT nCount ) return bDone; } -EditUndo::EditUndo( USHORT nI, ImpEditEngine* p ) +EditUndo::EditUndo( sal_uInt16 nI, ImpEditEngine* p ) { DBG_CTOR( EditUndo, 0 ); nId = nI; @@ -154,15 +154,15 @@ EditUndo::~EditUndo() DBG_DTOR( EditUndo, 0 ); } -USHORT EditUndo::GetId() const +sal_uInt16 EditUndo::GetId() const { DBG_CHKTHIS( EditUndo, 0 ); return nId; } -BOOL EditUndo::CanRepeat(SfxRepeatTarget&) const +sal_Bool EditUndo::CanRepeat(SfxRepeatTarget&) const { - return FALSE; + return sal_False; } XubString EditUndo::GetComment() const @@ -176,12 +176,12 @@ XubString EditUndo::GetComment() const return aComment; } -EditUndoDelContent::EditUndoDelContent( ImpEditEngine* _pImpEE, ContentNode* pNode, USHORT n ) +EditUndoDelContent::EditUndoDelContent( ImpEditEngine* _pImpEE, ContentNode* pNode, sal_uInt16 n ) : EditUndo( EDITUNDO_DELCONTENT, _pImpEE ) { pContentNode = pNode; nNode = n; - bDelObject = TRUE; + bDelObject = sal_True; } EditUndoDelContent::~EditUndoDelContent() @@ -194,7 +194,7 @@ void EditUndoDelContent::Undo() { DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); GetImpEditEngine()->InsertContent( pContentNode, nNode ); - bDelObject = FALSE; // belongs to the Engine again + bDelObject = sal_False; // belongs to the Engine again EditSelection aSel( EditPaM( pContentNode, 0 ), EditPaM( pContentNode, pContentNode->Len() ) ); GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( aSel ); } @@ -218,7 +218,7 @@ void EditUndoDelContent::Redo() if( _pImpEE->IsCallParaInsertedOrDeleted() ) _pImpEE->GetEditEnginePtr()->ParagraphDeleted( nNode ); - DeletedNodeInfo* pInf = new DeletedNodeInfo( (ULONG)pContentNode, nNode ); + DeletedNodeInfo* pInf = new DeletedNodeInfo( (sal_uLong)pContentNode, nNode ); _pImpEE->aDeletedNodes.Insert( pInf, _pImpEE->aDeletedNodes.Count() ); _pImpEE->UpdateSelections(); @@ -228,14 +228,14 @@ void EditUndoDelContent::Redo() DBG_ASSERT( pN && ( pN != pContentNode ), "?! RemoveContent !? " ); EditPaM aPaM( pN, pN->Len() ); - bDelObject = TRUE; // belongs to the Engine again + bDelObject = sal_True; // belongs to the Engine again _pImpEE->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aPaM ) ); } -EditUndoConnectParas::EditUndoConnectParas( ImpEditEngine* _pImpEE, USHORT nN, USHORT nSP, +EditUndoConnectParas::EditUndoConnectParas( ImpEditEngine* _pImpEE, sal_uInt16 nN, sal_uInt16 nSP, const SfxItemSet& rLeftParaAttribs, const SfxItemSet& rRightParaAttribs, - const SfxStyleSheet* pLeftStyle, const SfxStyleSheet* pRightStyle, BOOL bBkwrd ) + const SfxStyleSheet* pLeftStyle, const SfxStyleSheet* pRightStyle, sal_Bool bBkwrd ) : EditUndo( EDITUNDO_CONNECTPARAS, _pImpEE ), aLeftParaAttribs( rLeftParaAttribs ), aRightParaAttribs( rRightParaAttribs ) @@ -268,8 +268,8 @@ void EditUndoConnectParas::Undo() // For SplitContent ParagraphInserted can not be called yet because the // Outliner relies on the attributes to initialize the depth - BOOL bCall = GetImpEditEngine()->IsCallParaInsertedOrDeleted(); - GetImpEditEngine()->SetCallParaInsertedOrDeleted( FALSE ); + sal_Bool bCall = GetImpEditEngine()->IsCallParaInsertedOrDeleted(); + GetImpEditEngine()->SetCallParaInsertedOrDeleted( sal_False ); EditPaM aPaM = GetImpEditEngine()->SplitContent( nNode, nSepPos ); GetImpEditEngine()->SetParaAttribs( nNode, aLeftParaAttribs ); @@ -282,7 +282,7 @@ void EditUndoConnectParas::Undo() if ( GetImpEditEngine()->GetStyleSheetPool() ) { if ( aLeftStyleName.Len() ) - GetImpEditEngine()->SetStyleSheet( (USHORT)nNode, (SfxStyleSheet*)GetImpEditEngine()->GetStyleSheetPool()->Find( aLeftStyleName, eLeftStyleFamily ) ); + GetImpEditEngine()->SetStyleSheet( (sal_uInt16)nNode, (SfxStyleSheet*)GetImpEditEngine()->GetStyleSheetPool()->Find( aLeftStyleName, eLeftStyleFamily ) ); if ( aRightStyleName.Len() ) GetImpEditEngine()->SetStyleSheet( nNode+1, (SfxStyleSheet*)GetImpEditEngine()->GetStyleSheetPool()->Find( aRightStyleName, eRightStyleFamily ) ); } @@ -298,7 +298,7 @@ void EditUndoConnectParas::Redo() GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aPaM ) ); } -EditUndoSplitPara::EditUndoSplitPara( ImpEditEngine* _pImpEE, USHORT nN, USHORT nSP ) +EditUndoSplitPara::EditUndoSplitPara( ImpEditEngine* _pImpEE, sal_uInt16 nN, sal_uInt16 nSP ) : EditUndo( EDITUNDO_SPLITPARA, _pImpEE ) { nNode = nN; @@ -312,7 +312,7 @@ EditUndoSplitPara::~EditUndoSplitPara() void EditUndoSplitPara::Undo() { DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); - EditPaM aPaM = GetImpEditEngine()->ConnectContents( nNode, FALSE ); + EditPaM aPaM = GetImpEditEngine()->ConnectContents( nNode, sal_False ); GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aPaM ) ); } @@ -349,22 +349,22 @@ void EditUndoInsertChars::Redo() GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( EditSelection( aPaM, aNewPaM ) ); } -BOOL EditUndoInsertChars::Merge( SfxUndoAction* pNextAction ) +sal_Bool EditUndoInsertChars::Merge( SfxUndoAction* pNextAction ) { if ( !pNextAction->ISA( EditUndoInsertChars ) ) - return FALSE; + return sal_False; EditUndoInsertChars* pNext = (EditUndoInsertChars*)pNextAction; if ( aEPaM.nPara != pNext->aEPaM.nPara ) - return FALSE; + return sal_False; if ( ( aEPaM.nIndex + aText.Len() ) == pNext->aEPaM.nIndex ) { aText += pNext->aText; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } EditUndoRemoveChars::EditUndoRemoveChars( ImpEditEngine* _pImpEE, const EPaM& rEPaM, const XubString& rStr ) @@ -430,7 +430,7 @@ void EditUndoInsertFeature::Redo() } EditUndoMoveParagraphs::EditUndoMoveParagraphs - ( ImpEditEngine* _pImpEE, const Range& rParas, USHORT n ) + ( ImpEditEngine* _pImpEE, const Range& rParas, sal_uInt16 n ) : EditUndo( EDITUNDO_MOVEPARAGRAPHS, _pImpEE ), nParagraphs( rParas ) { @@ -460,7 +460,7 @@ void EditUndoMoveParagraphs::Undo() else nTmpDest += aTmpRange.Len(); - EditSelection aNewSel( GetImpEditEngine()->MoveParagraphs( aTmpRange, (USHORT)nTmpDest, 0 ) ); + EditSelection aNewSel( GetImpEditEngine()->MoveParagraphs( aTmpRange, (sal_uInt16)nTmpDest, 0 ) ); GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( aNewSel ); } @@ -471,7 +471,7 @@ void EditUndoMoveParagraphs::Redo() GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( aNewSel ); } -EditUndoSetStyleSheet::EditUndoSetStyleSheet( ImpEditEngine* _pImpEE, USHORT nP, +EditUndoSetStyleSheet::EditUndoSetStyleSheet( ImpEditEngine* _pImpEE, sal_uInt16 nP, const XubString& rPrevName, SfxStyleFamily ePrevFam, const XubString& rNewName, SfxStyleFamily eNewFam, const SfxItemSet& rPrevParaAttribs ) @@ -502,7 +502,7 @@ void EditUndoSetStyleSheet::Redo() lcl_DoSetSelection( GetImpEditEngine()->GetActiveView(), nPara ); } -EditUndoSetParaAttribs::EditUndoSetParaAttribs( ImpEditEngine* _pImpEE, USHORT nP, const SfxItemSet& rPrevItems, const SfxItemSet& rNewItems ) +EditUndoSetParaAttribs::EditUndoSetParaAttribs( ImpEditEngine* _pImpEE, sal_uInt16 nP, const SfxItemSet& rPrevItems, const SfxItemSet& rNewItems ) : EditUndo( EDITUNDO_PARAATTRIBS, _pImpEE ), aPrevItems( rPrevItems ), aNewItems(rNewItems ) @@ -536,8 +536,8 @@ EditUndoSetAttribs::EditUndoSetAttribs( ImpEditEngine* _pImpEE, const ESelection // 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 = FALSE; - bRemoveParaAttribs = FALSE; + bSetIsRemove = sal_False; + bRemoveParaAttribs = sal_False; nRemoveWhich = 0; nSpecial = 0; } @@ -546,12 +546,12 @@ EditUndoSetAttribs::~EditUndoSetAttribs() { // Get Items from Pool... SfxItemPool* pPool = aNewAttribs.GetPool(); - USHORT nContents = aPrevAttribs.Count(); - for ( USHORT n = 0; n < nContents; n++ ) + sal_uInt16 nContents = aPrevAttribs.Count(); + for ( sal_uInt16 n = 0; n < nContents; n++ ) { ContentAttribsInfo* pInf = aPrevAttribs[n]; DBG_ASSERT( pInf, "Undo_DTOR (SetAttribs): pInf = NULL!" ); - for ( USHORT nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ ) { EditCharAttrib* pX = pInf->GetPrevCharAttribs()[nAttr]; DBG_ASSERT( pX, "Undo_DTOR (SetAttribs): pX = NULL!" ); @@ -566,10 +566,10 @@ void EditUndoSetAttribs::Undo() { DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" ); ImpEditEngine* _pImpEE = GetImpEditEngine(); - BOOL bFields = FALSE; - for ( USHORT nPara = aESel.nStartPara; nPara <= aESel.nEndPara; nPara++ ) + sal_Bool bFields = sal_False; + for ( sal_uInt16 nPara = aESel.nStartPara; nPara <= aESel.nEndPara; nPara++ ) { - ContentAttribsInfo* pInf = aPrevAttribs[ (USHORT)(nPara-aESel.nStartPara) ]; + ContentAttribsInfo* pInf = aPrevAttribs[ (sal_uInt16)(nPara-aESel.nStartPara) ]; DBG_ASSERT( pInf, "Undo (SetAttribs): pInf = NULL!" ); // first the paragraph attributes ... @@ -577,17 +577,17 @@ void EditUndoSetAttribs::Undo() // Then the character attributes ... // Remove all attributes including features, are later re-established. - _pImpEE->RemoveCharAttribs( nPara, 0, TRUE ); + _pImpEE->RemoveCharAttribs( nPara, 0, sal_True ); DBG_ASSERT( _pImpEE->GetEditDoc().SaveGetObject( nPara ), "Undo (SetAttribs): pNode = NULL!" ); ContentNode* pNode = _pImpEE->GetEditDoc().GetObject( nPara ); - for ( USHORT nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ ) { EditCharAttrib* pX = pInf->GetPrevCharAttribs()[nAttr]; DBG_ASSERT( pX, "Redo (SetAttribs): pX = NULL!" ); // is automatically "poolsized" _pImpEE->GetEditDoc().InsertAttrib( pNode, pX->GetStart(), pX->GetEnd(), *pX->GetItem() ); if ( pX->Which() == EE_FEATURE_FIELD ) - bFields = TRUE; + bFields = sal_True; } } if ( bFields ) diff --git a/editeng/source/editeng/editundo.hxx b/editeng/source/editeng/editundo.hxx index 3ac483a12021..0479d1fe74b8 100644..100755 --- a/editeng/source/editeng/editundo.hxx +++ b/editeng/source/editeng/editundo.hxx @@ -48,14 +48,14 @@ class EditView; class EditUndoDelContent : public EditUndo { private: - BOOL bDelObject; - USHORT nNode; + sal_Bool bDelObject; + sal_uInt16 nNode; ContentNode* pContentNode; // Points to the valid, // undestroyed object! public: TYPEINFO(); - EditUndoDelContent( ImpEditEngine* pImpEE, ContentNode* pNode, USHORT nPortio ); + EditUndoDelContent( ImpEditEngine* pImpEE, ContentNode* pNode, sal_uInt16 nPortio ); ~EditUndoDelContent(); virtual void Undo(); @@ -68,8 +68,8 @@ public: class EditUndoConnectParas : public EditUndo { private: - USHORT nNode; - USHORT nSepPos; + sal_uInt16 nNode; + sal_uInt16 nSepPos; SfxItemSet aLeftParaAttribs; SfxItemSet aRightParaAttribs; @@ -79,13 +79,13 @@ private: SfxStyleFamily eLeftStyleFamily; SfxStyleFamily eRightStyleFamily; - BOOL bBackward; + sal_Bool bBackward; public: TYPEINFO(); - EditUndoConnectParas( ImpEditEngine* pImpEE, USHORT nNode, USHORT nSepPos, + EditUndoConnectParas( ImpEditEngine* pImpEE, sal_uInt16 nNode, sal_uInt16 nSepPos, const SfxItemSet& rLeftParaAttribs, const SfxItemSet& rRightParaAttribs, - const SfxStyleSheet* pLeftStyle, const SfxStyleSheet* pRightStyle, BOOL bBackward ); + const SfxStyleSheet* pLeftStyle, const SfxStyleSheet* pRightStyle, sal_Bool bBackward ); ~EditUndoConnectParas(); virtual void Undo(); @@ -98,12 +98,12 @@ public: class EditUndoSplitPara : public EditUndo { private: - USHORT nNode; - USHORT nSepPos; + sal_uInt16 nNode; + sal_uInt16 nSepPos; public: TYPEINFO(); - EditUndoSplitPara( ImpEditEngine* pImpEE, USHORT nNode, USHORT nSepPos ); + EditUndoSplitPara( ImpEditEngine* pImpEE, sal_uInt16 nNode, sal_uInt16 nSepPos ); ~EditUndoSplitPara(); virtual void Undo(); @@ -129,7 +129,7 @@ public: virtual void Undo(); virtual void Redo(); - virtual BOOL Merge( SfxUndoAction *pNextAction ); + virtual sal_Bool Merge( SfxUndoAction *pNextAction ); }; // ----------------------------------------------------------------------- @@ -178,11 +178,11 @@ class EditUndoMoveParagraphs: public EditUndo { private: Range nParagraphs; - USHORT nDest; + sal_uInt16 nDest; public: TYPEINFO(); - EditUndoMoveParagraphs( ImpEditEngine* pImpEE, const Range& rParas, USHORT nDest ); + EditUndoMoveParagraphs( ImpEditEngine* pImpEE, const Range& rParas, sal_uInt16 nDest ); ~EditUndoMoveParagraphs(); virtual void Undo(); @@ -195,7 +195,7 @@ public: class EditUndoSetStyleSheet: public EditUndo { private: - USHORT nPara; + sal_uInt16 nPara; XubString aPrevName; XubString aNewName; SfxStyleFamily ePrevFamily; @@ -205,7 +205,7 @@ private: public: TYPEINFO(); - EditUndoSetStyleSheet( ImpEditEngine* pImpEE, USHORT nPara, + EditUndoSetStyleSheet( ImpEditEngine* pImpEE, sal_uInt16 nPara, const XubString& rPrevName, SfxStyleFamily ePrevFamily, const XubString& rNewName, SfxStyleFamily eNewFamily, const SfxItemSet& rPrevParaAttribs ); @@ -221,13 +221,13 @@ public: class EditUndoSetParaAttribs: public EditUndo { private: - USHORT nPara; + sal_uInt16 nPara; SfxItemSet aPrevItems; SfxItemSet aNewItems; public: TYPEINFO(); - EditUndoSetParaAttribs( ImpEditEngine* pImpEE, USHORT nPara, const SfxItemSet& rPrevItems, const SfxItemSet& rNewItems ); + EditUndoSetParaAttribs( ImpEditEngine* pImpEE, sal_uInt16 nPara, const SfxItemSet& rPrevItems, const SfxItemSet& rNewItems ); ~EditUndoSetParaAttribs(); virtual void Undo(); @@ -244,10 +244,10 @@ private: SfxItemSet aNewAttribs; ContentInfoArray aPrevAttribs; - BYTE nSpecial; - BOOL bSetIsRemove; - BOOL bRemoveParaAttribs; - USHORT nRemoveWhich; + sal_uInt8 nSpecial; + sal_Bool bSetIsRemove; + sal_Bool bRemoveParaAttribs; + sal_uInt16 nRemoveWhich; void ImpSetSelection( EditView* pView ); @@ -260,10 +260,10 @@ public: ContentInfoArray& GetContentInfos() { return aPrevAttribs; } SfxItemSet& GetNewAttribs() { return aNewAttribs; } - void SetSpecial( BYTE n ) { nSpecial = n; } - void SetRemoveAttribs( BOOL b ) { bSetIsRemove = b; } - void SetRemoveParaAttribs( BOOL b ) { bRemoveParaAttribs = b; } - void SetRemoveWhich( USHORT n ) { nRemoveWhich = n; } + void SetSpecial( sal_uInt8 n ) { nSpecial = n; } + void SetRemoveAttribs( sal_Bool b ) { bSetIsRemove = b; } + void SetRemoveParaAttribs( sal_Bool b ) { bRemoveParaAttribs = b; } + void SetRemoveWhich( sal_uInt16 n ) { nRemoveWhich = n; } virtual void Undo(); virtual void Redo(); diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index ad67a7d35fdd..e7f6089d0c86 100644..100755 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -46,7 +46,7 @@ #include <svl/srchitem.hxx> -#define _SVSTDARR_USHORTS +#define _SVSTDARR_sal_uIt16S #include <svl/svstdarr.hxx> #include <impedit.hxx> @@ -150,10 +150,10 @@ LanguageType lcl_CheckLanguage( lang::Locale a3( SvxCreateLocale( aLangList[3] ) ); #endif - INT32 nCount = SAL_N_ELEMENTS(aLangList); - for (INT32 i = 0; i < nCount; i++) + sal_Int32 nCount = SAL_N_ELEMENTS(aLangList); + for (sal_Int32 i = 0; i < nCount; i++) { - INT16 nTmpLang = aLangList[i]; + sal_Int16 nTmpLang = aLangList[i]; if (nTmpLang != LANGUAGE_NONE && nTmpLang != LANGUAGE_DONTKNOW) { if (xSpell->hasLanguage( nTmpLang ) && @@ -297,7 +297,7 @@ void EditView::DeleteSelected() pImpEditView->DeleteSelected(); } -USHORT EditView::GetSelectedScriptType() const +sal_uInt16 EditView::GetSelectedScriptType() const { DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); @@ -478,7 +478,7 @@ void EditView::HideCursor() pImpEditView->GetCursor()->Hide(); } -Pair EditView::Scroll( long ndX, long ndY, BYTE nRangeCheck ) +Pair EditView::Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck ) { DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); @@ -578,7 +578,7 @@ void EditView::Redo() PIMPEE->Redo( this ); } -ULONG EditView::Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, sal_Bool bSelect, SvKeyValueIterator* pHTTPHeaderAttrs ) +sal_uLong EditView::Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, sal_Bool bSelect, SvKeyValueIterator* pHTTPHeaderAttrs ) { DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); @@ -602,7 +602,7 @@ ULONG EditView::Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFo } #ifndef SVX_LIGHT -ULONG EditView::Write( SvStream& rOutput, EETextFormat eFormat ) +sal_uLong EditView::Write( SvStream& rOutput, EETextFormat eFormat ) { DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); @@ -735,7 +735,7 @@ void EditView::MoveParagraphs( long nDiff ) nDest++; DBG_ASSERT( ( nDest >= 0 ) && ( nDest <= pImpEditView->pEditEngine->GetParagraphCount() ), "MoveParagraphs - wrong Parameters!" ); MoveParagraphs( aRange, - sal::static_int_cast< USHORT >( nDest ) ); + sal::static_int_cast< sal_uInt16 >( nDest ) ); } void EditView::SetBackgroundColor( const Color& rColor ) @@ -786,7 +786,7 @@ void EditView::InsertText( const EditTextObject& rTextObject ) PIMPEE->FormatAndUpdate( this ); } -void EditView::InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xDataObj, const String& rBaseURL, BOOL bUseSpecial ) +void EditView::InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > xDataObj, const String& rBaseURL, sal_Bool bUseSpecial ) { DBG_CHKTHIS( EditView, 0 ); DBG_CHKOBJ( pImpEditView->pEditEngine, EditEngine, 0 ); @@ -803,7 +803,7 @@ void EditView::InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::d sal_Bool EditView::Drop( const DropEvent& ) { - return FALSE; + return sal_False; } ESelection EditView::GetDropPos() @@ -814,7 +814,7 @@ ESelection EditView::GetDropPos() sal_Bool EditView::QueryDrop( DropEvent& ) { - return FALSE; + return sal_False; } void EditView::SetEditEngineUpdateMode( sal_Bool bUpdate ) @@ -965,7 +965,7 @@ EESpellState EditView::StartThesaurus() void EditView::StartTextConversion( LanguageType nSrcLang, LanguageType nDestLang, const Font *pDestFont, - INT32 nOptions, BOOL bIsInteractive, BOOL bMultipleDoc ) + sal_Int32 nOptions, sal_Bool bIsInteractive, sal_Bool bMultipleDoc ) { #ifdef SVX_LIGHT #else @@ -1063,7 +1063,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) Sequence< PropertyValue > aPropVals(1); PropertyValue &rVal = aPropVals.getArray()[0]; rVal.Name = OUString(RTL_CONSTASCII_USTRINGPARAM( UPN_MAX_NUMBER_OF_SUGGESTIONS )); - rVal.Value <<= (INT16) 7; + rVal.Value <<= (sal_Int16) 7; // // Are there any replace suggestions? Reference< XSpellAlternatives > xSpellAlt = @@ -1123,7 +1123,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) if (xSpellAlt.is()) aAlt = xSpellAlt->getAlternatives(); const OUString *pAlt = aAlt.getConstArray(); - sal_uInt16 nWords = (USHORT) aAlt.getLength(); + sal_uInt16 nWords = (sal_uInt16) aAlt.getLength(); if ( nWords ) { for ( sal_uInt16 nW = 0; nW < nWords; nW++ ) @@ -1154,7 +1154,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) aDics = xDicList->getDictionaries(); pDic = aDics.getConstArray(); sal_uInt16 nCheckedLanguage = PIMPEE->GetLanguage( aPaM2 ); - sal_uInt16 nDicCount = (USHORT)aDics.getLength(); + sal_uInt16 nDicCount = (sal_uInt16)aDics.getLength(); for (sal_uInt16 i = 0; i < nDicCount; i++) { uno::Reference< linguistic2::XDictionary > xDicTmp( pDic[i], uno::UNO_QUERY ); @@ -1170,7 +1170,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack ) { // the extra 1 is because of the (possible) external // linguistic entry above - USHORT nPos = MN_DICTSTART + i; + sal_uInt16 nPos = MN_DICTSTART + i; pInsertMenu->InsertItem( nPos, xDicTmp->getName() ); uno::Reference< lang::XServiceInfo > xSvcInfo( xDicTmp, uno::UNO_QUERY ); @@ -1477,7 +1477,7 @@ void EditView::ChangeFontSize( bool bGrow, const FontList* pFontList ) if( aSel.HasRange() ) { - for( USHORT nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) + for( sal_uInt16 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) { SvUShorts aPortions; rEditEngine.GetPortions( nPara, aPortions ); @@ -1485,13 +1485,13 @@ void EditView::ChangeFontSize( bool bGrow, const FontList* pFontList ) if( aPortions.Count() == 0 ) aPortions.Insert( rEditEngine.GetTextLen(nPara), 0 ); - const USHORT nBeginPos = (nPara == aSel.nStartPara) ? aSel.nStartPos : 0; - const USHORT nEndPos = (nPara == aSel.nEndPara) ? aSel.nEndPos : 0xffff; + const sal_uInt16 nBeginPos = (nPara == aSel.nStartPara) ? aSel.nStartPos : 0; + const sal_uInt16 nEndPos = (nPara == aSel.nEndPara) ? aSel.nEndPos : 0xffff; - for ( USHORT nPos = 0; nPos < aPortions.Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < aPortions.Count(); ++nPos ) { - USHORT nPortionEnd = aPortions.GetObject( nPos ); - USHORT nPortionStart = nPos > 0 ? aPortions.GetObject( nPos - 1 ) : 0; + sal_uInt16 nPortionEnd = aPortions.GetObject( nPos ); + sal_uInt16 nPortionStart = nPos > 0 ? aPortions.GetObject( nPos - 1 ) : 0; if( (nPortionEnd < nBeginPos) || (nPortionStart > nEndPos) ) continue; diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx index 2e9f786db07d..772e61f0e30c 100644..100755 --- a/editeng/source/editeng/edtspell.cxx +++ b/editeng/source/editeng/edtspell.cxx @@ -224,7 +224,7 @@ WrongList::~WrongList() { } -void WrongList::MarkInvalid( USHORT nS, USHORT nE ) +void WrongList::MarkInvalid( sal_uInt16 nS, sal_uInt16 nE ) { if ( ( nInvalidStart == NOT_INVALID ) || ( nInvalidStart > nS ) ) nInvalidStart = nS; @@ -499,7 +499,7 @@ bool WrongList::operator==(const WrongList& rCompare) const return false; } - for(USHORT a(0); a < Count(); a++) + for(sal_uInt16 a(0); a < Count(); a++) { const WrongRange& rCandA(GetObject(a)); const WrongRange& rCandB(rCompare.GetObject(a)); @@ -650,8 +650,8 @@ sal_Bool EdtAutoCorrDoc::SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, sal_Bool EdtAutoCorrDoc::HasSymbolChars( sal_uInt16 nStt, sal_uInt16 nEnd ) { - USHORT nScriptType = pImpEE->GetScriptType( EditPaM( pCurNode, nStt ) ); - USHORT nScriptFontInfoItemId = GetScriptItemId( EE_CHAR_FONTINFO, nScriptType ); + sal_uInt16 nScriptType = pImpEE->GetScriptType( EditPaM( pCurNode, nStt ) ); + sal_uInt16 nScriptFontInfoItemId = GetScriptItemId( EE_CHAR_FONTINFO, nScriptType ); CharAttribArray& rAttribs = pCurNode->GetCharAttribs().GetAttribs(); sal_uInt16 nAttrs = rAttribs.Count(); diff --git a/editeng/source/editeng/edtspell.hxx b/editeng/source/editeng/edtspell.hxx index bdfa09edcdcb..ad490ecd737a 100644..100755 --- a/editeng/source/editeng/edtspell.hxx +++ b/editeng/source/editeng/edtspell.hxx @@ -53,13 +53,13 @@ private: protected: virtual void SpellStart( SvxSpellArea eArea ); - virtual BOOL SpellContinue(); // Check area - virtual void ReplaceAll( const String &rNewText, INT16 nLanguage ); + virtual sal_Bool SpellContinue(); // Check area + virtual void ReplaceAll( const String &rNewText, sal_Int16 nLanguage ); virtual void SpellEnd(); - virtual BOOL SpellMore(); - virtual BOOL HasOtherCnt(); + virtual sal_Bool SpellMore(); + virtual sal_Bool HasOtherCnt(); virtual void ScrollArea(); - virtual void ChangeWord( const String& rNewWord, const USHORT nLang ); + virtual void ChangeWord( const String& rNewWord, const sal_uInt16 nLang ); virtual void ChangeThesWord( const String& rNewWord ); virtual void AutoCorrect( const String& rOldWord, const String& rNewWord ); @@ -67,18 +67,18 @@ public: EditSpellWrapper( Window* pWin, ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XSpellChecker1 > &xChecker, - BOOL bIsStart, - BOOL bIsAllRight, EditView* pView ); + sal_Bool bIsStart, + sal_Bool bIsAllRight, EditView* pView ); }; struct WrongRange { - USHORT nStart; - USHORT nEnd; + sal_uInt16 nStart; + sal_uInt16 nEnd; - WrongRange( USHORT nS, USHORT nE ) { nStart = nS; nEnd = nE; } + WrongRange( sal_uInt16 nS, sal_uInt16 nE ) { nStart = nS; nEnd = nE; } }; SV_DECL_VARARR( WrongRanges, WrongRange, 4, 4 ) @@ -87,41 +87,41 @@ SV_DECL_VARARR( WrongRanges, WrongRange, 4, 4 ) class WrongList : private WrongRanges { private: - USHORT nInvalidStart; - USHORT nInvalidEnd; + sal_uInt16 nInvalidStart; + sal_uInt16 nInvalidEnd; - BOOL DbgIsBuggy() const; + sal_Bool DbgIsBuggy() const; public: WrongList(); ~WrongList(); - BOOL IsInvalid() const { return nInvalidStart != NOT_INVALID; } + sal_Bool IsInvalid() const { return nInvalidStart != NOT_INVALID; } void SetValid() { nInvalidStart = NOT_INVALID; nInvalidEnd = 0; } - void MarkInvalid( USHORT nS, USHORT nE ); + void MarkInvalid( sal_uInt16 nS, sal_uInt16 nE ); - USHORT Count() const { return WrongRanges::Count(); } + sal_uInt16 Count() const { return WrongRanges::Count(); } - // When one knos what to do: - WrongRange& GetObject( USHORT n ) const { return WrongRanges::GetObject( n ); } - void InsertWrong( const WrongRange& rWrong, USHORT nPos ); + // When one knows what to do: + WrongRange& GetObject( sal_uInt16 n ) const { return WrongRanges::GetObject( n ); } + void InsertWrong( const WrongRange& rWrong, sal_uInt16 nPos ); - USHORT GetInvalidStart() const { return nInvalidStart; } - USHORT& GetInvalidStart() { return nInvalidStart; } + sal_uInt16 GetInvalidStart() const { return nInvalidStart; } + sal_uInt16& GetInvalidStart() { return nInvalidStart; } - USHORT GetInvalidEnd() const { return nInvalidEnd; } - USHORT& GetInvalidEnd() { return nInvalidEnd; } + sal_uInt16 GetInvalidEnd() const { return nInvalidEnd; } + sal_uInt16& GetInvalidEnd() { return nInvalidEnd; } - void TextInserted( USHORT nPos, USHORT nChars, BOOL bPosIsSep ); - void TextDeleted( USHORT nPos, USHORT nChars ); + void TextInserted( sal_uInt16 nPos, sal_uInt16 nChars, sal_Bool bPosIsSep ); + void TextDeleted( sal_uInt16 nPos, sal_uInt16 nChars ); void ResetRanges() { Remove( 0, Count() ); } - BOOL HasWrongs() const { return Count() != 0; } - void InsertWrong( USHORT nStart, USHORT nEnd, BOOL bClearRange ); - BOOL NextWrong( USHORT& rnStart, USHORT& rnEnd ) const; - BOOL HasWrong( USHORT nStart, USHORT nEnd ) const; - BOOL HasAnyWrong( USHORT nStart, USHORT nEnd ) const; - void ClearWrongs( USHORT nStart, USHORT nEnd, const ContentNode* pNode ); + sal_Bool HasWrongs() const { return Count() != 0; } + void InsertWrong( sal_uInt16 nStart, sal_uInt16 nEnd, sal_Bool bClearRange ); + sal_Bool NextWrong( sal_uInt16& rnStart, sal_uInt16& rnEnd ) const; + sal_Bool HasWrong( sal_uInt16 nStart, sal_uInt16 nEnd ) const; + sal_Bool HasAnyWrong( sal_uInt16 nStart, sal_uInt16 nEnd ) const; + void ClearWrongs( sal_uInt16 nStart, sal_uInt16 nEnd, const ContentNode* pNode ); void MarkWrongsInvalid(); WrongList* Clone() const; @@ -130,7 +130,7 @@ public: bool operator==(const WrongList& rCompare) const; }; -inline void WrongList::InsertWrong( const WrongRange& rWrong, USHORT nPos ) +inline void WrongList::InsertWrong( const WrongRange& rWrong, sal_uInt16 nPos ) { WrongRanges::Insert( rWrong, nPos ); #ifdef DBG_UTIL @@ -144,35 +144,35 @@ class EdtAutoCorrDoc : public SvxAutoCorrDoc { ImpEditEngine* pImpEE; ContentNode* pCurNode; - USHORT nCursor; + sal_uInt16 nCursor; - BOOL bAllowUndoAction; - BOOL bUndoAction; + sal_Bool bAllowUndoAction; + sal_Bool bUndoAction; protected: void ImplStartUndoAction(); public: - EdtAutoCorrDoc( ImpEditEngine* pImpEE, ContentNode* pCurNode, USHORT nCrsr, xub_Unicode cIns ); + EdtAutoCorrDoc( ImpEditEngine* pImpEE, ContentNode* pCurNode, sal_uInt16 nCrsr, xub_Unicode cIns ); ~EdtAutoCorrDoc(); - virtual BOOL Delete( USHORT nStt, USHORT nEnd ); - virtual BOOL Insert( USHORT nPos, const String& rTxt ); - virtual BOOL Replace( USHORT nPos, const String& rTxt ); + virtual sal_Bool Delete( sal_uInt16 nStt, sal_uInt16 nEnd ); + virtual sal_Bool Insert( sal_uInt16 nPos, const String& rTxt ); + virtual sal_Bool Replace( sal_uInt16 nPos, const String& rTxt ); - virtual BOOL SetAttr( USHORT nStt, USHORT nEnd, USHORT nSlotId, SfxPoolItem& ); - virtual BOOL SetINetAttr( USHORT nStt, USHORT nEnd, const String& rURL ); + virtual sal_Bool SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, sal_uInt16 nSlotId, SfxPoolItem& ); + virtual sal_Bool SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd, const String& rURL ); - virtual BOOL HasSymbolChars( USHORT nStt, USHORT nEnd ); + virtual sal_Bool HasSymbolChars( sal_uInt16 nStt, sal_uInt16 nEnd ); - virtual const String* GetPrevPara( BOOL bAtNormalPos ); + virtual const String* GetPrevPara( sal_Bool bAtNormalPos ); - virtual BOOL ChgAutoCorrWord( USHORT& rSttPos, USHORT nEndPos, + virtual sal_Bool ChgAutoCorrWord( sal_uInt16& rSttPos, sal_uInt16 nEndPos, SvxAutoCorrect& rACorrect, const String** ppPara ); - virtual LanguageType GetLanguage( USHORT nPos, BOOL bPrevPara = FALSE ) const; + virtual LanguageType GetLanguage( sal_uInt16 nPos, sal_Bool bPrevPara = sal_False ) const; - USHORT GetCursor() const { return nCursor; } + sal_uInt16 GetCursor() const { return nCursor; } }; diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx index 3ce262f44b01..2a59819202c8 100644..100755 --- a/editeng/source/editeng/eehtml.cxx +++ b/editeng/source/editeng/eehtml.cxx @@ -57,15 +57,15 @@ EditHTMLParser::EditHTMLParser( SvStream& rIn, const String& rBaseURL, SvKeyValu { pImpEditEngine = 0; pCurAnchor = 0; - bInPara = FALSE; - bWasInPara = FALSE; + bInPara = sal_False; + bWasInPara = sal_False; nInTable = 0; nInCell = 0; - bInTitle = FALSE; + bInTitle = sal_False; nDefListLevel = 0; nBulletLevel = 0; nNumberingLevel = 0; - bFieldsInserted = FALSE; + bFieldsInserted = sal_False; DBG_ASSERT( RTL_TEXTENCODING_DONTKNOW == GetSrcEncoding( ), "EditHTMLParser::EditHTMLParser: Where does the encoding come from?" ); DBG_ASSERT( !IsSwitchToUCS2(), "EditHTMLParser::::EditHTMLParser: Switch to UCS2?" ); @@ -75,7 +75,7 @@ EditHTMLParser::EditHTMLParser( SvStream& rIn, const String& rBaseURL, SvKeyValu SetSrcEncoding( GetExtendedCompatibilityTextEncoding( RTL_TEXTENCODING_ISO_8859_1 ) ); // If the file starts with a BOM, switch to UCS2. - SetSwitchToUCS2( TRUE ); + SetSwitchToUCS2( sal_True ); if ( pHTTPHeaderAttrs ) SetEncodingByHTTPHeader( pHTTPHeaderAttrs ); @@ -129,16 +129,16 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_META: { const HTMLOptions *_pOptions = GetOptions(); - USHORT nArrLen = _pOptions->Count(); - BOOL bEquiv = FALSE; - for ( USHORT i = 0; i < nArrLen; i++ ) + sal_uInt16 nArrLen = _pOptions->Count(); + sal_Bool bEquiv = sal_False; + for ( sal_uInt16 i = 0; i < nArrLen; i++ ) { const HTMLOption *pOption = (*_pOptions)[i]; switch( pOption->GetToken() ) { case HTML_O_HTTPEQUIV: { - bEquiv = TRUE; + bEquiv = sal_True; } break; case HTML_O_CONTENT: @@ -158,11 +158,11 @@ void EditHTMLParser::NextToken( int nToken ) break; case HTML_PLAINTEXT_ON: case HTML_PLAINTEXT2_ON: - bInPara = TRUE; + bInPara = sal_True; break; case HTML_PLAINTEXT_OFF: case HTML_PLAINTEXT2_OFF: - bInPara = FALSE; + bInPara = sal_False; break; case HTML_LINEBREAK: @@ -195,7 +195,7 @@ void EditHTMLParser::NextToken( int nToken ) if (!bInTitle) { if ( !bInPara ) - StartPara( FALSE ); + StartPara( sal_False ); // if ( bInPara || pCurAnchor ) @@ -213,7 +213,7 @@ void EditHTMLParser::NextToken( int nToken ) // Only written until HTML with 319? if ( IsReadPRE() ) { - USHORT nTabPos = aText.Search( '\t', 0 ); + sal_uInt16 nTabPos = aText.Search( '\t', 0 ); while ( nTabPos != STRING_NOTFOUND ) { aText.Erase( nTabPos, 1 ); @@ -230,7 +230,7 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_CENTER_ON: case HTML_CENTER_OFF: { - USHORT nNode = pImpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() ); + sal_uInt16 nNode = pImpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() ); SfxItemSet aItems( aCurSel.Max().GetNode()->GetContentAttribs().GetItems() ); aItems.ClearItem( EE_PARA_JUST ); if ( nToken == HTML_CENTER_ON ) @@ -246,13 +246,13 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_PARABREAK_ON: if( bInPara && HasTextInCurrentPara() ) - EndPara( TRUE ); - StartPara( TRUE ); + EndPara( sal_True ); + StartPara( sal_True ); break; case HTML_PARABREAK_OFF: if( bInPara ) - EndPara( TRUE ); + EndPara( sal_True ); break; case HTML_HEAD1_ON: @@ -281,7 +281,7 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_XMP_ON: case HTML_LISTING_ON: { - StartPara( TRUE ); + StartPara( sal_True ); ImpSetStyleSheet( STYLE_PRE ); } break; @@ -320,10 +320,10 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_ORDERLIST_ON: case HTML_UNORDERLIST_ON: { - BOOL bHasText = HasTextInCurrentPara(); + sal_Bool bHasText = HasTextInCurrentPara(); if ( bHasText ) ImpInsertParaBreak(); - StartPara( FALSE ); + StartPara( sal_False ); } break; @@ -339,7 +339,7 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_DD_OFF: case HTML_DT_OFF: case HTML_ORDERLIST_OFF: - case HTML_UNORDERLIST_OFF: EndPara( FALSE ); + case HTML_UNORDERLIST_OFF: EndPara( sal_False ); break; case HTML_TABLEROW_ON: @@ -355,10 +355,10 @@ void EditHTMLParser::NextToken( int nToken ) break; case HTML_TITLE_ON: - bInTitle = TRUE; + bInTitle = sal_True; break; case HTML_TITLE_OFF: - bInTitle = FALSE; + bInTitle = sal_False; break; // globals @@ -553,7 +553,7 @@ void EditHTMLParser::ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSe } ContentNode* pSN = aStartPaM.GetNode(); - USHORT nStartNode = pImpEditEngine->GetEditDoc().GetPos( pSN ); + sal_uInt16 nStartNode = pImpEditEngine->GetEditDoc().GetPos( pSN ); // If an attribute goes from 0 to current Paragraph length, // then it should be a paragraph attribute! @@ -564,7 +564,7 @@ void EditHTMLParser::ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSe // not really HTML: #ifdef DBG_UTIL ContentNode* pEN = aEndPaM.GetNode(); - USHORT nEndNode = pImpEditEngine->GetEditDoc().GetPos( pEN ); + sal_uInt16 nEndNode = pImpEditEngine->GetEditDoc().GetPos( pEN ); DBG_ASSERT( nStartNode == nEndNode, "ImpSetAttribs: Several paragraphs?" ); #endif if ( ( aStartPaM.GetIndex() == 0 ) && ( aEndPaM.GetIndex() == aEndPaM.GetNode()->Len() ) ) @@ -578,7 +578,7 @@ void EditHTMLParser::ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSe pImpEditEngine->SetAttribs( EditSelection( aStartPaM, aEndPaM ), rItems ); } -void EditHTMLParser::ImpSetStyleSheet( USHORT nHLevel ) +void EditHTMLParser::ImpSetStyleSheet( sal_uInt16 nHLevel ) { /* nHLevel: 0: Turn off @@ -589,8 +589,7 @@ void EditHTMLParser::ImpSetStyleSheet( USHORT nHLevel ) // Enough for Calc, would have to be clarified with StyleSheets // that they should also be in the app so that when they are feed // in a different engine still are here ... - - USHORT nNode = pImpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() ); + sal_uInt16 nNode = pImpEditEngine->GetEditDoc().GetPos( aCurSel.Max().GetNode() ); SfxItemSet aItems( aCurSel.Max().GetNode()->GetContentAttribs().GetItems() ); @@ -693,7 +692,7 @@ void EditHTMLParser::SkipGroup( int nEndToken ) // groups in cells are closed upon leaving the cell, because those // ******* web authors don't know their job // for example: <td><form></td> lacks a closing </form> - BYTE nCellLevel = nInCell; + sal_uInt8 nCellLevel = nInCell; int nToken; while( nCellLevel <= nInCell && ( (nToken = GetNextToken() ) != nEndToken ) && nToken ) { @@ -712,14 +711,14 @@ void EditHTMLParser::SkipGroup( int nEndToken ) } } -void EditHTMLParser::StartPara( BOOL bReal ) +void EditHTMLParser::StartPara( sal_Bool bReal ) { if ( bReal ) { const HTMLOptions *_pOptions = GetOptions(); - USHORT nArrLen = _pOptions->Count(); + sal_uInt16 nArrLen = _pOptions->Count(); SvxAdjust eAdjust = SVX_ADJUST_LEFT; - for ( USHORT i = 0; i < nArrLen; i++ ) + for ( sal_uInt16 i = 0; i < nArrLen; i++ ) { const HTMLOption *pOption = (*_pOptions)[i]; switch( pOption->GetToken() ) @@ -742,33 +741,33 @@ void EditHTMLParser::StartPara( BOOL bReal ) aItemSet.Put( SvxAdjustItem( eAdjust, EE_PARA_JUST ) ); ImpSetAttribs( aItemSet ); } - bInPara = TRUE; + bInPara = sal_True; } -void EditHTMLParser::EndPara( BOOL ) +void EditHTMLParser::EndPara( sal_Bool ) { if ( bInPara ) { - BOOL bHasText = HasTextInCurrentPara(); + sal_Bool bHasText = HasTextInCurrentPara(); if ( bHasText ) ImpInsertParaBreak(); } - bInPara = FALSE; + bInPara = sal_False; } -BOOL EditHTMLParser::ThrowAwayBlank() +sal_Bool EditHTMLParser::ThrowAwayBlank() { // A blank must be thrown away if the new text begins with a Blank and // if the current paragraph is empty or ends with a Blank... ContentNode* pNode = aCurSel.Max().GetNode(); if ( pNode->Len() && ( pNode->GetChar( pNode->Len()-1 ) != ' ' ) ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } -BOOL EditHTMLParser::HasTextInCurrentPara() +sal_Bool EditHTMLParser::HasTextInCurrentPara() { - return aCurSel.Max().GetNode()->Len() ? TRUE : FALSE; + return aCurSel.Max().GetNode()->Len() ? sal_True : sal_False; } void EditHTMLParser::AnchorStart() @@ -777,11 +776,11 @@ void EditHTMLParser::AnchorStart() if ( !pCurAnchor ) { const HTMLOptions* _pOptions = GetOptions(); - USHORT nArrLen = _pOptions->Count(); + sal_uInt16 nArrLen = _pOptions->Count(); String aRef; - for ( USHORT i = 0; i < nArrLen; i++ ) + for ( sal_uInt16 i = 0; i < nArrLen; i++ ) { const HTMLOption* pOption = (*_pOptions)[i]; switch( pOption->GetToken() ) @@ -815,7 +814,7 @@ void EditHTMLParser::AnchorEnd() // Insert as URL-Field... SvxFieldItem aFld( SvxURLField( pCurAnchor->aHRef, pCurAnchor->aText, SVXURLFORMAT_REPR ), EE_FEATURE_FIELD ); aCurSel = pImpEditEngine->InsertField( aCurSel, aFld ); - bFieldsInserted = TRUE; + bFieldsInserted = sal_True; delete pCurAnchor; pCurAnchor = 0; @@ -830,12 +829,12 @@ void EditHTMLParser::AnchorEnd() void EditHTMLParser::HeadingStart( int nToken ) { bWasInPara = bInPara; - StartPara( FALSE ); + StartPara( sal_False ); if ( bWasInPara && HasTextInCurrentPara() ) ImpInsertParaBreak(); - USHORT nId = sal::static_int_cast< USHORT >( + sal_uInt16 nId = sal::static_int_cast< sal_uInt16 >( 1 + ( ( nToken - HTML_HEAD1_ON ) / 2 ) ); DBG_ASSERT( (nId >= 1) && (nId <= 9), "HeadingStart: ID can not be correct!" ); ImpSetStyleSheet( nId ); @@ -843,13 +842,13 @@ void EditHTMLParser::HeadingStart( int nToken ) void EditHTMLParser::HeadingEnd( int ) { - EndPara( FALSE ); + EndPara( sal_False ); ImpSetStyleSheet( 0 ); if ( bWasInPara ) { - bInPara = TRUE; - bWasInPara = FALSE; + bInPara = sal_True; + bWasInPara = sal_False; } } diff --git a/editeng/source/editeng/eehtml.hxx b/editeng/source/editeng/eehtml.hxx index f464ac4863e8..94d386ff71cb 100644..100755 --- a/editeng/source/editeng/eehtml.hxx +++ b/editeng/source/editeng/eehtml.hxx @@ -53,34 +53,34 @@ private: ImpEditEngine* pImpEditEngine; AnchorInfo* pCurAnchor; - BOOL bInPara; - BOOL bWasInPara; // Remember bInPara before HeadingStart, because afterwards it will be gone. - BOOL bFieldsInserted; - BYTE nInTable; - BYTE nInCell; - BOOL bInTitle; + sal_Bool bInPara; + sal_Bool bWasInPara; // Remember bInPara before HeadingStart, because afterwards it will be gone. + sal_Bool bFieldsInserted; + sal_uInt8 nInTable; + sal_uInt8 nInCell; + sal_Bool bInTitle; - BYTE nDefListLevel; - BYTE nBulletLevel; - BYTE nNumberingLevel; + sal_uInt8 nDefListLevel; + sal_uInt8 nBulletLevel; + sal_uInt8 nNumberingLevel; - BYTE nLastAction; + sal_uInt8 nLastAction; - void StartPara( BOOL bReal ); - void EndPara( BOOL bReal ); + void StartPara( sal_Bool bReal ); + void EndPara( sal_Bool bReal ); void AnchorStart(); void AnchorEnd(); void HeadingStart( int nToken ); void HeadingEnd( int nToken ); void SkipGroup( int nEndToken ); - BOOL ThrowAwayBlank(); - BOOL HasTextInCurrentPara(); - void ProcessUnknownControl( BOOL bOn ); + sal_Bool ThrowAwayBlank(); + sal_Bool HasTextInCurrentPara(); + void ProcessUnknownControl( sal_Bool bOn ); void ImpInsertParaBreak(); void ImpInsertText( const String& rText ); void ImpSetAttribs( const SfxItemSet& rItems, EditSelection* pSel = 0 ); - void ImpSetStyleSheet( USHORT nHeadingLevel ); + void ImpSetStyleSheet( sal_uInt16 nHeadingLevel ); protected: virtual void NextToken( int nToken ); diff --git a/editeng/source/editeng/eeng_pch.cxx b/editeng/source/editeng/eeng_pch.cxx index 45216b37b7b9..45216b37b7b9 100644..100755 --- a/editeng/source/editeng/eeng_pch.cxx +++ b/editeng/source/editeng/eeng_pch.cxx diff --git a/editeng/source/editeng/eeng_pch.hxx b/editeng/source/editeng/eeng_pch.hxx index 7f80ed57005f..7f80ed57005f 100644..100755 --- a/editeng/source/editeng/eeng_pch.hxx +++ b/editeng/source/editeng/eeng_pch.hxx diff --git a/editeng/source/editeng/eeobj.cxx b/editeng/source/editeng/eeobj.cxx index f96f8e2825eb..5c2981d86b7c 100644..100755 --- a/editeng/source/editeng/eeobj.cxx +++ b/editeng/source/editeng/eeobj.cxx @@ -62,7 +62,7 @@ uno::Any EditDataObject::getTransferData( const datatransfer::DataFlavor& rFlavo { uno::Any aAny; - ULONG nT = SotExchange::GetFormat( rFlavor ); + sal_uLong nT = SotExchange::GetFormat( rFlavor ); if ( nT == SOT_FORMAT_STRING ) { aAny <<= (::rtl::OUString)GetString(); @@ -75,7 +75,7 @@ uno::Any EditDataObject::getTransferData( const datatransfer::DataFlavor& rFlavo SvMemoryStream* pStream = ( nT == SOT_FORMATSTR_ID_EDITENGINE ) ? &GetStream() : &GetRTFStream(); pStream->Seek( STREAM_SEEK_TO_END ); - ULONG nLen = pStream->Tell(); + sal_uLong nLen = pStream->Tell(); pStream->Seek(0); uno::Sequence< sal_Int8 > aSeq( nLen ); @@ -105,7 +105,7 @@ sal_Bool EditDataObject::isDataFlavorSupported( const datatransfer::DataFlavor& { sal_Bool bSupported = sal_False; - ULONG nT = SotExchange::GetFormat( rFlavor ); + sal_uLong nT = SotExchange::GetFormat( rFlavor ); if ( ( nT == SOT_FORMAT_STRING ) || ( nT == SOT_FORMAT_RTF ) || ( nT == SOT_FORMATSTR_ID_EDITENGINE ) ) bSupported = sal_True; diff --git a/editeng/source/editeng/eeobj.hxx b/editeng/source/editeng/eeobj.hxx index 5eed40f9f936..5eed40f9f936 100644..100755 --- a/editeng/source/editeng/eeobj.hxx +++ b/editeng/source/editeng/eeobj.hxx diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index 150d8127dc57..afd13a6b38aa 100644..100755 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -99,7 +99,7 @@ GlobalEditData::~GlobalEditData() // Destroy DefItems... // Or simply keep them, since at end of excecution?! if ( ppDefItems ) - SfxItemPool::ReleaseDefaults( ppDefItems, EDITITEMCOUNT, TRUE ); + SfxItemPool::ReleaseDefaults( ppDefItems, EDITITEMCOUNT, sal_True ); delete pStdRefDevice; } @@ -110,56 +110,54 @@ SfxPoolItem** GlobalEditData::GetDefItems() ppDefItems = new SfxPoolItem*[EDITITEMCOUNT]; // Paragraph attributes: - SvxNumRule aTmpNumRule( 0, 0, FALSE ); + SvxNumRule aTmpNumRule( 0, 0, sal_False ); ppDefItems[0] = new SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ); ppDefItems[1] = new SvXMLAttrContainerItem( EE_PARA_XMLATTRIBS ); - ppDefItems[2] = new SfxBoolItem( EE_PARA_HANGINGPUNCTUATION, FALSE ); - ppDefItems[3] = new SfxBoolItem( EE_PARA_FORBIDDENRULES, TRUE ); - ppDefItems[4] = new SvxScriptSpaceItem( TRUE, EE_PARA_ASIANCJKSPACING ); + ppDefItems[2] = new SfxBoolItem( EE_PARA_HANGINGPUNCTUATION, sal_False ); + ppDefItems[3] = new SfxBoolItem( EE_PARA_FORBIDDENRULES, sal_True ); + ppDefItems[4] = new SvxScriptSpaceItem( sal_True, EE_PARA_ASIANCJKSPACING ); ppDefItems[5] = new SvxNumBulletItem( aTmpNumRule, EE_PARA_NUMBULLET ); - ppDefItems[6] = new SfxBoolItem( EE_PARA_HYPHENATE, FALSE ); - ppDefItems[7] = new SfxBoolItem( EE_PARA_BULLETSTATE, TRUE ); + ppDefItems[6] = new SfxBoolItem( EE_PARA_HYPHENATE, sal_False ); + ppDefItems[7] = new SfxBoolItem( EE_PARA_BULLETSTATE, sal_True ); ppDefItems[8] = new SvxLRSpaceItem( EE_PARA_OUTLLRSPACE ); ppDefItems[9] = new SfxInt16Item( EE_PARA_OUTLLEVEL, -1 ); - ppDefItems[10] = new SvxBulletItem( EE_PARA_BULLET ); - ppDefItems[11] = new SvxLRSpaceItem( EE_PARA_LRSPACE ); - ppDefItems[12] = new SvxULSpaceItem( EE_PARA_ULSPACE ); - ppDefItems[13] = new SvxLineSpacingItem( 0, EE_PARA_SBL ); - ppDefItems[14] = new SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ); - ppDefItems[15] = new SvxTabStopItem( 0, 0, SVX_TAB_ADJUST_LEFT, EE_PARA_TABS ); - ppDefItems[16] = new SvxJustifyMethodItem( SVX_JUSTIFY_METHOD_AUTO, EE_PARA_JUST_METHOD ); - ppDefItems[17] = new SvxVerJustifyItem( SVX_VER_JUSTIFY_STANDARD, EE_PARA_VER_JUST ); + ppDefItems[10] = new SvxBulletItem( EE_PARA_BULLET ); + ppDefItems[11] = new SvxLRSpaceItem( EE_PARA_LRSPACE ); + ppDefItems[12] = new SvxULSpaceItem( EE_PARA_ULSPACE ); + ppDefItems[13] = new SvxLineSpacingItem( 0, EE_PARA_SBL ); + ppDefItems[14] = new SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ); + ppDefItems[15] = new SvxTabStopItem( 0, 0, SVX_TAB_ADJUST_LEFT, EE_PARA_TABS ); // Character attributes: - ppDefItems[18] = new SvxColorItem( Color( COL_AUTO ), EE_CHAR_COLOR ); - ppDefItems[19] = new SvxFontItem( EE_CHAR_FONTINFO ); - ppDefItems[20] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT ); - ppDefItems[21] = new SvxCharScaleWidthItem( 100, EE_CHAR_FONTWIDTH ); - ppDefItems[22] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT ); - ppDefItems[23] = new SvxUnderlineItem( UNDERLINE_NONE, EE_CHAR_UNDERLINE ); - ppDefItems[24] = new SvxCrossedOutItem( STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ); - ppDefItems[25] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC ); - ppDefItems[26] = new SvxContourItem( FALSE, EE_CHAR_OUTLINE ); - ppDefItems[27] = new SvxShadowedItem( FALSE, EE_CHAR_SHADOW ); - ppDefItems[28] = new SvxEscapementItem( 0, 100, EE_CHAR_ESCAPEMENT ); - ppDefItems[29] = new SvxAutoKernItem( FALSE, EE_CHAR_PAIRKERNING ); - ppDefItems[30] = new SvxKerningItem( 0, EE_CHAR_KERNING ); - ppDefItems[31] = new SvxWordLineModeItem( FALSE, EE_CHAR_WLM ); - ppDefItems[32] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE ); - ppDefItems[33] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CJK ); - ppDefItems[34] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CTL ); - ppDefItems[35] = new SvxFontItem( EE_CHAR_FONTINFO_CJK ); - ppDefItems[36] = new SvxFontItem( EE_CHAR_FONTINFO_CTL ); - ppDefItems[37] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CJK ); - ppDefItems[38] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CTL ); - ppDefItems[39] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK ); - ppDefItems[40] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL ); - ppDefItems[41] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ); - ppDefItems[42] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ); - ppDefItems[43] = new SvxEmphasisMarkItem( EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK ); - ppDefItems[44] = new SvxCharReliefItem( RELIEF_NONE, EE_CHAR_RELIEF ); - ppDefItems[45] = new SfxVoidItem( EE_CHAR_RUBI_DUMMY ); + ppDefItems[16] = new SvxColorItem( Color( COL_AUTO ), EE_CHAR_COLOR ); + ppDefItems[17] = new SvxFontItem( EE_CHAR_FONTINFO ); + ppDefItems[18] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT ); + ppDefItems[19] = new SvxCharScaleWidthItem( 100, EE_CHAR_FONTWIDTH ); + ppDefItems[20] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT ); + ppDefItems[21] = new SvxUnderlineItem( UNDERLINE_NONE, EE_CHAR_UNDERLINE ); + ppDefItems[22] = new SvxCrossedOutItem( STRIKEOUT_NONE, EE_CHAR_STRIKEOUT ); + ppDefItems[23] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC ); + ppDefItems[24] = new SvxContourItem( sal_False, EE_CHAR_OUTLINE ); + ppDefItems[25] = new SvxShadowedItem( sal_False, EE_CHAR_SHADOW ); + ppDefItems[26] = new SvxEscapementItem( 0, 100, EE_CHAR_ESCAPEMENT ); + ppDefItems[27] = new SvxAutoKernItem( sal_False, EE_CHAR_PAIRKERNING ); + ppDefItems[28] = new SvxKerningItem( 0, EE_CHAR_KERNING ); + ppDefItems[29] = new SvxWordLineModeItem( sal_False, EE_CHAR_WLM ); + ppDefItems[30] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE ); + ppDefItems[31] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CJK ); + ppDefItems[32] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CTL ); + ppDefItems[33] = new SvxFontItem( EE_CHAR_FONTINFO_CJK ); + ppDefItems[34] = new SvxFontItem( EE_CHAR_FONTINFO_CTL ); + ppDefItems[35] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CJK ); + ppDefItems[36] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CTL ); + ppDefItems[37] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK ); + ppDefItems[38] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL ); + ppDefItems[39] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK ); + ppDefItems[40] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL ); + ppDefItems[41] = new SvxEmphasisMarkItem( EMPHASISMARK_NONE, EE_CHAR_EMPHASISMARK ); + ppDefItems[42] = new SvxCharReliefItem( RELIEF_NONE, EE_CHAR_RELIEF ); + ppDefItems[43] = new SfxVoidItem( EE_CHAR_RUBI_DUMMY ); #ifndef SVX_LIGHT ppDefItems[46] = new SvXMLAttrContainerItem( EE_CHAR_XMLATTRIBS ); #else @@ -221,7 +219,7 @@ OutputDevice* GlobalEditData::GetStdRefDevice() return pStdRefDevice; } -EditResId::EditResId( USHORT nId ): +EditResId::EditResId( sal_uInt16 nId ): ResId( nId, *EE_DLL()->GetResMgr() ) { } diff --git a/editeng/source/editeng/eerdll2.hxx b/editeng/source/editeng/eerdll2.hxx index baf2a1d8c5bf..baf2a1d8c5bf 100644..100755 --- a/editeng/source/editeng/eerdll2.hxx +++ b/editeng/source/editeng/eerdll2.hxx diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx index 1587e8012f68..b65ffe52c547 100644..100755 --- a/editeng/source/editeng/eertfpar.cxx +++ b/editeng/source/editeng/eertfpar.cxx @@ -88,9 +88,9 @@ EditRTFParser::EditRTFParser( SvStream& rIn, EditSelection aSel, SfxItemPool& rA SetInsPos( EditPosition( pImpEditEngine, &aCurSel ) ); // Convert the twips values ... - SetCalcValue( TRUE ); + SetCalcValue( sal_True ); SetChkStyleAttr( pImpEE->GetStatus().DoImportRTFStyleSheets() ); - SetNewDoc( FALSE ); // So that the Pool-Defaults are not overwritten... + SetNewDoc( sal_False ); // So that the Pool-Defaults are not overwritten... aEditMapMode = MapMode( pImpEE->GetRefDevice()->GetMapMode().GetMapUnit() ); } @@ -133,7 +133,7 @@ SvParserState EditRTFParser::CallParser() if ( nLastAction == ACTION_INSERTPARABRK ) { ContentNode* pCurNode = aCurSel.Max().GetNode(); - USHORT nPara = pImpEditEngine->GetEditDoc().GetPos( pCurNode ); + sal_uInt16 nPara = pImpEditEngine->GetEditDoc().GetPos( pCurNode ); ContentNode* pPrevNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara-1 ); DBG_ASSERT( pPrevNode, "Invalid RTF-Document?!" ); EditSelection aSel; @@ -143,17 +143,17 @@ SvParserState EditRTFParser::CallParser() } EditPaM aEnd2PaM( aCurSel.Max() ); //AddRTFDefaultValues( aStart2PaM, aEnd2PaM ); - BOOL bOnlyOnePara = ( aEnd2PaM.GetNode() == aStart2PaM.GetNode() ); + sal_Bool bOnlyOnePara = ( aEnd2PaM.GetNode() == aStart2PaM.GetNode() ); // Paste the chunk again ... // Problem: Paragraph attributes may not possibly be taken over // => Do Character attributes. - BOOL bSpecialBackward = aStart1PaM.GetNode()->Len() ? FALSE : TRUE; + sal_Bool bSpecialBackward = aStart1PaM.GetNode()->Len() ? sal_False : sal_True; if ( bOnlyOnePara || aStart1PaM.GetNode()->Len() ) pImpEditEngine->ParaAttribsToCharAttribs( aStart2PaM.GetNode() ); aCurSel.Min() = pImpEditEngine->ImpConnectParagraphs( aStart1PaM.GetNode(), aStart2PaM.GetNode(), bSpecialBackward ); - bSpecialBackward = aEnd1PaM.GetNode()->Len() ? TRUE : FALSE; + bSpecialBackward = aEnd1PaM.GetNode()->Len() ? sal_True : sal_False; // when bOnlyOnePara, then the node is gone on Connect. if ( !bOnlyOnePara && aEnd1PaM.GetNode()->Len() ) pImpEditEngine->ParaAttribsToCharAttribs( aEnd2PaM.GetNode() ); @@ -176,9 +176,9 @@ void EditRTFParser::AddRTFDefaultValues( const EditPaM& rStart, const EditPaM& r SvxFontItem aFontItem( aDefFont.GetFamily(), aDefFont.GetName(), aDefFont.GetStyleName(), aDefFont.GetPitch(), aDefFont.GetCharSet(), EE_CHAR_FONTINFO ); - USHORT nStartPara = pImpEditEngine->GetEditDoc().GetPos( rStart.GetNode() ); - USHORT nEndPara = pImpEditEngine->GetEditDoc().GetPos( rEnd.GetNode() ); - for ( USHORT nPara = nStartPara; nPara <= nEndPara; nPara++ ) + sal_uInt16 nStartPara = pImpEditEngine->GetEditDoc().GetPos( rStart.GetNode() ); + sal_uInt16 nEndPara = pImpEditEngine->GetEditDoc().GetPos( rEnd.GetNode() ); + for ( sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++ ) { ContentNode* pNode = pImpEditEngine->GetEditDoc().SaveGetObject( nPara ); DBG_ASSERT( pNode, "AddRTFDefaultValues - No paragraph?!" ); @@ -195,12 +195,12 @@ void EditRTFParser::NextToken( int nToken ) { case RTF_DEFF: { - nDefFont = USHORT(nTokenValue); + nDefFont = sal_uInt16(nTokenValue); } break; case RTF_DEFTAB: { - nDefTab = USHORT(nTokenValue); + nDefTab = sal_uInt16(nTokenValue); } break; case RTF_CELL: @@ -287,14 +287,14 @@ void EditRTFParser::MovePos( int bForward ) } void EditRTFParser::SetEndPrevPara( SvxNodeIdx*& rpNodePos, - USHORT& rCntPos ) + sal_uInt16& rCntPos ) { // The Intention is to: determine the current insert position of the // previous paragraph and set the end from this. // This "\pard" always apply on the right paragraph. ContentNode* pN = aCurSel.Max().GetNode(); - USHORT nCurPara = pImpEditEngine->GetEditDoc().GetPos( pN ); + sal_uInt16 nCurPara = pImpEditEngine->GetEditDoc().GetPos( pN ); DBG_ASSERT( nCurPara != 0, "Paragraph equal to 0: SetEnfPrevPara" ); if ( nCurPara ) nCurPara--; @@ -304,7 +304,7 @@ void EditRTFParser::SetEndPrevPara( SvxNodeIdx*& rpNodePos, rCntPos = pPrevNode->Len(); } -int EditRTFParser::IsEndPara( SvxNodeIdx* pNd, USHORT nCnt ) const +int EditRTFParser::IsEndPara( SvxNodeIdx* pNd, sal_uInt16 nCnt ) const { return ( nCnt == ( ((EditNodeIdx*)pNd)->GetNode()->Len()) ); } @@ -325,12 +325,12 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) const MapUnit eSrcUnit = aRTFMapMode.GetMapUnit(); if (eDestUnit != eSrcUnit) { - USHORT aFntHeightIems[3] = { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, EE_CHAR_FONTHEIGHT_CTL }; + sal_uInt16 aFntHeightIems[3] = { EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT_CJK, EE_CHAR_FONTHEIGHT_CTL }; for (int i = 0; i < 2; ++i) { - if (SFX_ITEM_SET == rSet.GetAttrSet().GetItemState( aFntHeightIems[i], FALSE, &pItem )) + if (SFX_ITEM_SET == rSet.GetAttrSet().GetItemState( aFntHeightIems[i], sal_False, &pItem )) { - UINT32 nHeight = ((SvxFontHeightItem*)pItem)->GetHeight(); + sal_uInt32 nHeight = ((SvxFontHeightItem*)pItem)->GetHeight(); long nNewHeight; nNewHeight = pImpEditEngine->GetRefDevice()->LogicToLogic( (long)nHeight, eSrcUnit, eDestUnit ); @@ -340,7 +340,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) } } - if( SFX_ITEM_SET == rSet.GetAttrSet().GetItemState( EE_CHAR_ESCAPEMENT, FALSE, &pItem )) + if( SFX_ITEM_SET == rSet.GetAttrSet().GetItemState( EE_CHAR_ESCAPEMENT, sal_False, &pItem )) { // die richtige long nEsc = ((SvxEscapementItem*)pItem)->GetEsc(); @@ -367,8 +367,8 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) ContentNode* pSN = aStartPaM.GetNode(); ContentNode* pEN = aEndPaM.GetNode(); - USHORT nStartNode = pImpEditEngine->GetEditDoc().GetPos( pSN ); - USHORT nEndNode = pImpEditEngine->GetEditDoc().GetPos( pEN ); + sal_uInt16 nStartNode = pImpEditEngine->GetEditDoc().GetPos( pSN ); + sal_uInt16 nEndNode = pImpEditEngine->GetEditDoc().GetPos( pEN ); sal_Int16 nOutlLevel = 0xff; if ( rSet.StyleNo() && pImpEditEngine->GetStyleSheetPool() && pImpEditEngine->GetStatus().DoImportRTFStyleSheets() ) @@ -387,7 +387,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) // Note: Selection can reach over several paragraphs. // All Complete paragraphs are paragraph attributes ... - for ( USHORT z = nStartNode+1; z < nEndNode; z++ ) + for ( sal_uInt16 z = nStartNode+1; z < nEndNode; z++ ) { DBG_ASSERT( pImpEditEngine->GetEditDoc().SaveGetObject( z ), "Node does not exist yet(RTF)" ); pImpEditEngine->SetParaAttribs( z, rSet.GetAttrSet() ); @@ -425,7 +425,7 @@ void EditRTFParser::SetAttrInDoc( SvxRTFItemStackType &rSet ) // OutlLevel... if ( nOutlLevel != 0xff ) { - for ( USHORT n = nStartNode; n <= nEndNode; n++ ) + for ( sal_uInt16 n = nStartNode; n <= nEndNode; n++ ) { ContentNode* pNode = pImpEditEngine->GetEditDoc().SaveGetObject( n ); pNode->GetContentAttribs().GetItems().Put( SfxInt16Item( EE_PARA_OUTLLEVEL, nOutlLevel ) ); @@ -508,8 +508,8 @@ void EditRTFParser::ReadField() { // From SwRTFParser::ReadField() int _nOpenBrakets = 1; // the first was already detected earlier - BOOL bFldInst = FALSE; - BOOL bFldRslt = FALSE; + sal_Bool bFldInst = sal_False; + sal_Bool bFldRslt = sal_False; String aFldInst; String aFldRslt; @@ -522,8 +522,8 @@ void EditRTFParser::ReadField() _nOpenBrakets--; if ( _nOpenBrakets == 1 ) { - bFldInst = FALSE; - bFldRslt = FALSE; + bFldInst = sal_False; + bFldRslt = sal_False; } } break; @@ -534,10 +534,10 @@ void EditRTFParser::ReadField() case RTF_FIELD: SkipGroup(); break; - case RTF_FLDINST: bFldInst = TRUE; + case RTF_FLDINST: bFldInst = sal_True; break; - case RTF_FLDRSLT: bFldRslt = TRUE; + case RTF_FLDRSLT: bFldRslt = sal_True; break; case RTF_TEXTTOKEN: @@ -599,7 +599,7 @@ void EditRTFParser::SkipGroup() SkipToken( -1 ); // the closing brace is evaluated "above" } -ULONG EditNodeIdx::GetIdx() const +sal_uLong EditNodeIdx::GetIdx() const { return pImpEditEngine->GetEditDoc().GetPos( pNode ); } @@ -619,13 +619,13 @@ SvxNodeIdx* EditPosition::MakeNodeIdx() const return new EditNodeIdx( pImpEditEngine, pCurSel->Max().GetNode() ); } -ULONG EditPosition::GetNodeIdx() const +sal_uLong EditPosition::GetNodeIdx() const { ContentNode* pN = pCurSel->Max().GetNode(); return pImpEditEngine->GetEditDoc().GetPos( pN ); } -USHORT EditPosition::GetCntIdx() const +sal_uInt16 EditPosition::GetCntIdx() const { return pCurSel->Max().GetIndex(); } diff --git a/editeng/source/editeng/eertfpar.hxx b/editeng/source/editeng/eertfpar.hxx index f7e048388229..5f8ced33df60 100644..100755 --- a/editeng/source/editeng/eertfpar.hxx +++ b/editeng/source/editeng/eertfpar.hxx @@ -44,7 +44,7 @@ private: public: EditNodeIdx( ImpEditEngine* pIEE, ContentNode* pNd = 0) { pImpEditEngine = pIEE; pNode = pNd; } - virtual ULONG GetIdx() const; + virtual sal_uLong GetIdx() const; virtual SvxNodeIdx* Clone() const; ContentNode* GetNode() { return pNode; } }; @@ -59,8 +59,8 @@ public: EditPosition( ImpEditEngine* pIEE, EditSelection* pSel ) { pImpEditEngine = pIEE; pCurSel = pSel; } - virtual ULONG GetNodeIdx() const; - virtual USHORT GetCntIdx() const; + virtual sal_uLong GetNodeIdx() const; + virtual sal_uInt16 GetCntIdx() const; // clone virtual SvxPosition* Clone() const; @@ -81,22 +81,22 @@ private: MapMode aRTFMapMode; MapMode aEditMapMode; - USHORT nDefFont; - USHORT nDefTab; - USHORT nDefFontHeight; - BYTE nLastAction; + sal_uInt16 nDefFont; + sal_uInt16 nDefTab; + sal_uInt16 nDefFontHeight; + sal_uInt8 nLastAction; protected: virtual void InsertPara(); virtual void InsertText(); - virtual void MovePos( int bForward = TRUE ); + virtual void MovePos( int bForward = sal_True ); virtual void SetEndPrevPara( SvxNodeIdx*& rpNodePos, - USHORT& rCntPos ); + sal_uInt16& rCntPos ); virtual void UnknownAttrToken( int nToken, SfxItemSet* pSet ); virtual void NextToken( int nToken ); virtual void SetAttrInDoc( SvxRTFItemStackType &rSet ); - virtual int IsEndPara( SvxNodeIdx* pNd, USHORT nCnt ) const; + virtual int IsEndPara( SvxNodeIdx* pNd, sal_uInt16 nCnt ) const; virtual void CalcValue(); void CreateStyleSheets(); SfxStyleSheet* CreateStyleSheet( SvxRTFStyleType* pRTFStyle ); @@ -115,7 +115,7 @@ public: void SetDestCharSet( CharSet eCharSet ) { eDestCharSet = eCharSet; } CharSet GetDestCharSet() const { return eDestCharSet; } - USHORT GetDefTab() const { return nDefTab; } + sal_uInt16 GetDefTab() const { return nDefTab; } Font GetDefFont() { return GetFont( nDefFont ); } EditPaM GetCurPaM() const { return aCurSel.Max(); } diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index ca64a2cc278d..f6f57a9176a9 100644..100755 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -96,7 +96,7 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, Window* pWindow ) : nInvMore = 1; nTravelXPos = TRAVEL_X_DONTKNOW; nControl = EV_CNTRL_AUTOSCROLL | EV_CNTRL_ENABLEPASTE; - bActiveDragAndDropListener = FALSE; + bActiveDragAndDropListener = sal_False; aEditSelection.Min() = pEng->pImpEditEngine->GetEditDoc().GetStartPaM(); aEditSelection.Max() = pEng->pImpEditEngine->GetEditDoc().GetEndPaM(); @@ -210,18 +210,18 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion ) EditLine* pLine = pTmpPortion->GetLines().GetObject( nLine ); DBG_ASSERT( pLine, "Line not found: DrawSelection()" ); - BOOL bPartOfLine = FALSE; + sal_Bool bPartOfLine = sal_False; sal_uInt16 nStartIndex = pLine->GetStart(); sal_uInt16 nEndIndex = pLine->GetEnd(); if ( ( nPara == nStartPara ) && ( nLine == nStartLine ) && ( nStartIndex != aTmpSel.Min().GetIndex() ) ) { nStartIndex = aTmpSel.Min().GetIndex(); - bPartOfLine = TRUE; + bPartOfLine = sal_True; } if ( ( nPara == nEndPara ) && ( nLine == nEndLine ) && ( nEndIndex != aTmpSel.Max().GetIndex() ) ) { nEndIndex = aTmpSel.Max().GetIndex(); - bPartOfLine = TRUE; + bPartOfLine = sal_True; } // Can happen if at the beginning of a wrapped line. @@ -252,8 +252,8 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion ) } else { - USHORT nTmpStartIndex = nStartIndex; - USHORT nWritingDirStart, nTmpEndIndex; + sal_uInt16 nTmpStartIndex = nStartIndex; + sal_uInt16 nWritingDirStart, nTmpEndIndex; while ( nTmpStartIndex < nEndIndex ) { @@ -263,7 +263,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion ) DBG_ASSERT( nTmpEndIndex > nTmpStartIndex, "DrawSelection, Start >= End?" ); - long nX1 = pEditEngine->pImpEditEngine->GetXPos( pTmpPortion, pLine, nTmpStartIndex, TRUE ); + long nX1 = pEditEngine->pImpEditEngine->GetXPos( pTmpPortion, pLine, nTmpStartIndex, sal_True ); long nX2 = pEditEngine->pImpEditEngine->GetXPos( pTmpPortion, pLine, nTmpEndIndex ); Point aPt1( Min( nX1, nX2 ), aTopLeft.Y() ); @@ -333,7 +333,7 @@ void ImpEditView::ImplDrawHighlightRect( Window* _pOutWin, const Point& rDocPosT } -BOOL ImpEditView::IsVertical() const +sal_Bool ImpEditView::IsVertical() const { return pEditEngine->pImpEditEngine->IsVertical(); } @@ -632,7 +632,7 @@ void ImpEditView::CalcAnchorPoint() } } -void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, USHORT nShowCursorFlags ) +void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_uInt16 nShowCursorFlags ) { // No ShowCursor in an empty View ... if ( ( aOutArea.Left() >= aOutArea.Right() ) && ( aOutArea.Top() >= aOutArea.Bottom() ) ) @@ -656,8 +656,8 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US EditPaM aPaM( aEditSelection.Max() ); - USHORT nTextPortionStart = 0; - USHORT nPara = pEditEngine->pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() ); + sal_uInt16 nTextPortionStart = 0; + sal_uInt16 nPara = pEditEngine->pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() ); if (nPara == USHRT_MAX) // #i94322 return; ParaPortion* pParaPortion = pEditEngine->pImpEditEngine->GetParaPortions().GetObject( nPara ); @@ -683,7 +683,7 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US // If we are behind a portion, and the next portion has other direction, we must change position... aEditCursor.Left() = aEditCursor.Right() = pEditEngine->pImpEditEngine->PaMtoEditCursor( aPaM, GETCRSR_TXTONLY|GETCRSR_PREFERPORTIONSTART ).Left(); - USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, TRUE ); + sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, sal_True ); TextPortion* pTextPortion = pParaPortion->GetTextPortions().GetObject( nTextPortion ); if ( pTextPortion->GetKind() == PORTIONKIND_TAB ) { @@ -691,7 +691,7 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US } else { - EditPaM aNext = pEditEngine->pImpEditEngine->CursorRight( aPaM, (USHORT)i18n::CharacterIteratorMode::SKIPCELL ); + EditPaM aNext = pEditEngine->pImpEditEngine->CursorRight( aPaM, (sal_uInt16)i18n::CharacterIteratorMode::SKIPCELL ); Rectangle aTmpRect = pEditEngine->pImpEditEngine->PaMtoEditCursor( aNext, GETCRSR_TXTONLY ); if ( aTmpRect.Top() != aEditCursor.Top() ) aTmpRect = pEditEngine->pImpEditEngine->PaMtoEditCursor( aNext, GETCRSR_TXTONLY|GETCRSR_ENDOFLINE ); @@ -852,9 +852,9 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US unsigned char nCursorDir = CURSOR_DIRECTION_NONE; if ( IsInsertMode() && !aEditSelection.HasRange() && ( pEditEngine->pImpEditEngine->HasDifferentRTLLevels( aPaM.GetNode() ) ) ) { - USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, nShowCursorFlags & GETCRSR_PREFERPORTIONSTART ? TRUE : FALSE ); + sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, nShowCursorFlags & GETCRSR_PREFERPORTIONSTART ? sal_True : sal_False ); TextPortion* pTextPortion = pParaPortion->GetTextPortions().GetObject( nTextPortion ); - USHORT nRTLLevel = pTextPortion->GetRightToLeft(); + sal_uInt16 nRTLLevel = pTextPortion->GetRightToLeft(); if ( nRTLLevel%2 ) nCursorDir = CURSOR_DIRECTION_RTL; else @@ -868,7 +868,7 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US { SvxFont aFont; pEditEngine->pImpEditEngine->SeekCursor( aPaM.GetNode(), aPaM.GetIndex()+1, aFont ); - ULONG nContextFlags = INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT; + sal_uLong nContextFlags = INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT; GetWindow()->SetInputContext( InputContext( aFont, nContextFlags ) ); } } @@ -881,7 +881,7 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, US } } -Pair ImpEditView::Scroll( long ndX, long ndY, BYTE nRangeCheck ) +Pair ImpEditView::Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck ) { DBG_ASSERT( pEditEngine->pImpEditEngine->IsFormatted(), "Scroll: Not formatted!" ); if ( !ndX && !ndY ) @@ -928,9 +928,9 @@ Pair ImpEditView::Scroll( long ndX, long ndY, BYTE nRangeCheck ) aNewVisArea.Left() -= ndY; aNewVisArea.Right() -= ndY; } - if ( ( nRangeCheck == RGCHK_PAPERSZ1 ) && ( aNewVisArea.Right() > (long)pEditEngine->pImpEditEngine->CalcTextWidth( FALSE ) ) ) + if ( ( nRangeCheck == RGCHK_PAPERSZ1 ) && ( aNewVisArea.Right() > (long)pEditEngine->pImpEditEngine->CalcTextWidth( sal_False ) ) ) { - long nDiff = pEditEngine->pImpEditEngine->CalcTextWidth( FALSE ) - aNewVisArea.Right(); // negative + long nDiff = pEditEngine->pImpEditEngine->CalcTextWidth( sal_False ) - aNewVisArea.Right(); // negative aNewVisArea.Move( nDiff, 0 ); // could end up in the negative area... } if ( ( aNewVisArea.Left() < 0 ) && ( nRangeCheck != RGCHK_NONE ) ) @@ -989,7 +989,7 @@ Pair ImpEditView::Scroll( long ndX, long ndY, BYTE nRangeCheck ) sal_Bool ImpEditView::PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin ) { - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction(); if ( eFunc != KEYFUNC_DONTKNOW ) @@ -1010,7 +1010,7 @@ sal_Bool ImpEditView::PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin { Reference<com::sun::star::datatransfer::clipboard::XClipboard> aClipBoard(GetWindow()->GetClipboard()); CutCopy( aClipBoard, sal_False ); - bDone = TRUE; + bDone = sal_True; } break; case KEYFUNC_PASTE: @@ -1060,7 +1060,7 @@ 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, FALSE ); + CutCopy( aClipBoard, sal_False ); } return pEditEngine->pImpEditEngine->MouseButtonUp( rMouseEvent, GetEditViewPtr() ); @@ -1178,7 +1178,7 @@ void ImpEditView::DeleteSelected() SetEditSelection( EditSelection( aPaM, aPaM ) ); pEditEngine->pImpEditEngine->FormatAndUpdate( GetEditViewPtr() ); - ShowCursor( DoAutoScroll(), TRUE ); + ShowCursor( DoAutoScroll(), sal_True ); } const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_uInt16* pPara, sal_uInt16* pPos ) const @@ -1214,20 +1214,20 @@ const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_uInt16* pPara, return NULL; } -BOOL ImpEditView::IsBulletArea( const Point& rPos, sal_uInt16* pPara ) +sal_Bool ImpEditView::IsBulletArea( const Point& rPos, sal_uInt16* pPara ) { if ( pPara ) *pPara = 0xFFFF; if( !GetOutputArea().IsInside( rPos ) ) - return FALSE; + return sal_False; Point aDocPos( GetDocPos( rPos ) ); EditPaM aPaM = pEditEngine->pImpEditEngine->GetPaM( aDocPos, sal_False ); if ( aPaM.GetIndex() == 0 ) { - USHORT nPara = pEditEngine->pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() ); + sal_uInt16 nPara = pEditEngine->pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() ); Rectangle aBulletArea = pEditEngine->GetBulletArea( nPara ); long nY = pEditEngine->GetDocPosTopLeft( nPara ).Y(); ParaPortion* pParaPortion = pEditEngine->pImpEditEngine->GetParaPortions().GetObject( nPara ); @@ -1239,14 +1239,14 @@ BOOL ImpEditView::IsBulletArea( const Point& rPos, sal_uInt16* pPara ) { if ( pPara ) *pPara = nPara; - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } -void ImpEditView::CutCopy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, BOOL bCut ) +void ImpEditView::CutCopy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, sal_Bool bCut ) { if ( rxClipboard.is() && GetEditSelection().HasRange() ) { @@ -1279,7 +1279,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, BOOL bUseSpecial ) +void ImpEditView::Paste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard, sal_Bool bUseSpecial ) { if ( rxClipboard.is() ) { @@ -1347,58 +1347,58 @@ void ImpEditView::Paste( ::com::sun::star::uno::Reference< ::com::sun::star::dat SetEditSelection( aSel ); pEditEngine->pImpEditEngine->UpdateSelections(); pEditEngine->pImpEditEngine->FormatAndUpdate( GetEditViewPtr() ); - ShowCursor( DoAutoScroll(), TRUE ); + ShowCursor( DoAutoScroll(), sal_True ); } } } -BOOL ImpEditView::IsInSelection( const EditPaM& rPaM ) +sal_Bool ImpEditView::IsInSelection( const EditPaM& rPaM ) { EditSelection aSel = GetEditSelection(); if ( !aSel.HasRange() ) - return FALSE; + return sal_False; aSel.Adjust( pEditEngine->pImpEditEngine->GetEditDoc() ); - USHORT nStartNode = pEditEngine->pImpEditEngine->GetEditDoc().GetPos( aSel.Min().GetNode() ); - USHORT nEndNode = pEditEngine->pImpEditEngine->GetEditDoc().GetPos( aSel.Max().GetNode() ); - USHORT nCurNode = pEditEngine->pImpEditEngine->GetEditDoc().GetPos( rPaM.GetNode() ); + sal_uInt16 nStartNode = pEditEngine->pImpEditEngine->GetEditDoc().GetPos( aSel.Min().GetNode() ); + sal_uInt16 nEndNode = pEditEngine->pImpEditEngine->GetEditDoc().GetPos( aSel.Max().GetNode() ); + sal_uInt16 nCurNode = pEditEngine->pImpEditEngine->GetEditDoc().GetPos( rPaM.GetNode() ); if ( ( nCurNode > nStartNode ) && ( nCurNode < nEndNode ) ) - return TRUE; + return sal_True; if ( nStartNode == nEndNode ) { if ( nCurNode == nStartNode ) if ( ( rPaM.GetIndex() >= aSel.Min().GetIndex() ) && ( rPaM.GetIndex() < aSel.Max().GetIndex() ) ) - return TRUE; + return sal_True; } else if ( ( nCurNode == nStartNode ) && ( rPaM.GetIndex() >= aSel.Min().GetIndex() ) ) - return TRUE; + return sal_True; else if ( ( nCurNode == nEndNode ) && ( rPaM.GetIndex() < aSel.Max().GetIndex() ) ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } void ImpEditView::CreateAnchor() { - pEditEngine->pImpEditEngine->bInSelection = TRUE; + pEditEngine->pImpEditEngine->bInSelection = sal_True; GetEditSelection().Min() = GetEditSelection().Max(); } void ImpEditView::DeselectAll() { - pEditEngine->pImpEditEngine->bInSelection = FALSE; + pEditEngine->pImpEditEngine->bInSelection = sal_False; DrawSelection(); GetEditSelection().Min() = GetEditSelection().Max(); } -BOOL ImpEditView::IsSelectionAtPoint( const Point& rPosPixel ) +sal_Bool ImpEditView::IsSelectionAtPoint( const Point& rPosPixel ) { if ( pDragAndDropInfo && pDragAndDropInfo->pField ) - return TRUE; + return sal_True; Point aMousePos( rPosPixel ); @@ -1407,15 +1407,15 @@ BOOL ImpEditView::IsSelectionAtPoint( const Point& rPosPixel ) if ( ( !GetOutputArea().IsInside( aMousePos ) ) && !pEditEngine->pImpEditEngine->IsInSelectionMode() ) { - return FALSE; + return sal_False; } Point aDocPos( GetDocPos( aMousePos ) ); - EditPaM aPaM = pEditEngine->pImpEditEngine->GetPaM( aDocPos, FALSE ); + EditPaM aPaM = pEditEngine->pImpEditEngine->GetPaM( aDocPos, sal_False ); return IsInSelection( aPaM ); } -BOOL ImpEditView::SetCursorAtPoint( const Point& rPointPixel ) +sal_Bool ImpEditView::SetCursorAtPoint( const Point& rPointPixel ) { pEditEngine->pImpEditEngine->CheckIdleFormatter(); @@ -1426,7 +1426,7 @@ BOOL ImpEditView::SetCursorAtPoint( const Point& rPointPixel ) if ( ( !GetOutputArea().IsInside( aMousePos ) ) && !pEditEngine->pImpEditEngine->IsInSelectionMode() ) { - return FALSE; + return sal_False; } Point aDocPos( GetDocPos( aMousePos ) ); @@ -1435,7 +1435,7 @@ BOOL ImpEditView::SetCursorAtPoint( const Point& rPointPixel ) // then again wiht the PaM for the Rect, even though the line is already // known .... This must not be, though! EditPaM aPaM = pEditEngine->pImpEditEngine->GetPaM( aDocPos ); - BOOL bGotoCursor = DoAutoScroll(); + sal_Bool bGotoCursor = DoAutoScroll(); // aTmpNewSel: Diff between old and new, not the new selection EditSelection aTmpNewSel( GetEditSelection().Max(), aPaM ); @@ -1462,9 +1462,9 @@ BOOL ImpEditView::SetCursorAtPoint( const Point& rPointPixel ) SetEditSelection( aNewEditSelection ); } - BOOL bForceCursor = ( pDragAndDropInfo ? FALSE : TRUE ) && !pEditEngine->pImpEditEngine->IsInSelectionMode(); + sal_Bool bForceCursor = ( pDragAndDropInfo ? sal_False : sal_True ) && !pEditEngine->pImpEditEngine->IsInSelectionMode(); ShowCursor( bGotoCursor, bForceCursor ); - return TRUE; + return sal_True; } @@ -1549,7 +1549,7 @@ void ImpEditView::dragGestureRecognized( const ::com::sun::star::datatransfer::d else { // Field?! - USHORT nPara, nPos; + sal_uInt16 nPara, nPos; Point aMousePos = GetWindow()->PixelToLogic( aMousePosPixel ); const SvxFieldItem* pField = GetField( aMousePos, &nPara, &nPos ); if ( pField ) @@ -1560,18 +1560,18 @@ void ImpEditView::dragGestureRecognized( const ::com::sun::star::datatransfer::d aCopySel = EditSelection( EditPaM( pNode, nPos ), EditPaM( pNode, nPos+1 ) ); GetEditSelection() = aCopySel; DrawSelection(); - BOOL bGotoCursor = DoAutoScroll(); - BOOL bForceCursor = ( pDragAndDropInfo ? FALSE : TRUE ) && !pEditEngine->pImpEditEngine->IsInSelectionMode(); + sal_Bool bGotoCursor = DoAutoScroll(); + sal_Bool bForceCursor = ( pDragAndDropInfo ? sal_False : sal_True ) && !pEditEngine->pImpEditEngine->IsInSelectionMode(); ShowCursor( bGotoCursor, bForceCursor ); } else if ( IsBulletArea( aMousePos, &nPara ) ) { pDragAndDropInfo = new DragAndDropInfo(); - pDragAndDropInfo->bOutlinerMode = TRUE; + pDragAndDropInfo->bOutlinerMode = sal_True; EditPaM aStartPaM( pEditEngine->pImpEditEngine->GetEditDoc().GetObject( nPara ), 0 ); EditPaM aEndPaM( aStartPaM ); const SfxInt16Item& rLevel = (const SfxInt16Item&) pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL ); - for ( USHORT n = nPara +1; n < pEditEngine->pImpEditEngine->GetEditDoc().Count(); n++ ) + for ( sal_uInt16 n = nPara +1; n < pEditEngine->pImpEditEngine->GetEditDoc().Count(); n++ ) { const SfxInt16Item& rL = (const SfxInt16Item&) pEditEngine->GetParaAttrib( n, EE_PARA_OUTLLEVEL ); if ( rL.GetValue() > rLevel.GetValue() ) @@ -1697,7 +1697,7 @@ void ImpEditView::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSo pEditEngine->pImpEditEngine->UndoActionEnd( EDITUNDO_DRAGANDDROP ); HideDDCursor(); - ShowCursor( DoAutoScroll(), TRUE ); + ShowCursor( DoAutoScroll(), sal_True ); delete pDragAndDropInfo; pDragAndDropInfo = NULL; pEditEngine->GetEndDropHdl().Call(GetEditViewPtr()); @@ -1713,19 +1713,19 @@ void ImpEditView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDro if ( pDragAndDropInfo && pDragAndDropInfo->bDragAccepted ) { pEditEngine->GetBeginDropHdl().Call(GetEditViewPtr()); - BOOL bChanges = FALSE; + sal_Bool bChanges = sal_False; HideDDCursor(); if ( pDragAndDropInfo->bStarterOfDD ) { pEditEngine->pImpEditEngine->UndoActionStart( EDITUNDO_DRAGANDDROP ); - pDragAndDropInfo->bUndoAction = TRUE; + pDragAndDropInfo->bUndoAction = sal_True; } if ( pDragAndDropInfo->bOutlinerMode ) { - bChanges = TRUE; + bChanges = sal_True; GetEditViewPtr()->MoveParagraphs( Range( pDragAndDropInfo->aBeginDragSel.nStartPara, pDragAndDropInfo->aBeginDragSel.nEndPara ), pDragAndDropInfo->nOutlinerDropDest ); } else @@ -1733,7 +1733,7 @@ void ImpEditView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDro uno::Reference< datatransfer::XTransferable > xDataObj = rDTDE.Transferable; if ( xDataObj.is() ) { - bChanges = TRUE; + bChanges = sal_True; // remove Selection ... DrawSelection(); EditPaM aPaM( pDragAndDropInfo->aDropDest ); @@ -1860,7 +1860,7 @@ void ImpEditView::dragOver( const ::com::sun::star::datatransfer::dnd::DropTarge pDragAndDropInfo->aDropDest = aPaM; if ( pDragAndDropInfo->bOutlinerMode ) { - USHORT nPara = pEditEngine->pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() ); + sal_uInt16 nPara = pEditEngine->pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() ); ParaPortion* pPPortion = pEditEngine->pImpEditEngine->GetParaPortions().SaveGetObject( nPara ); long nDestParaStartY = pEditEngine->pImpEditEngine->GetParaPortions().GetYOffset( pPPortion ); long nRel = aDocPos.Y() - nDestParaStartY; @@ -1876,7 +1876,7 @@ void ImpEditView::dragOver( const ::com::sun::star::datatransfer::dnd::DropTarge if( ( pDragAndDropInfo->nOutlinerDropDest >= pDragAndDropInfo->aBeginDragSel.nStartPara ) && ( pDragAndDropInfo->nOutlinerDropDest <= (pDragAndDropInfo->aBeginDragSel.nEndPara+1) ) ) { - bAccept = FALSE; + bAccept = sal_False; } } else if ( HasSelection() ) @@ -1888,7 +1888,7 @@ void ImpEditView::dragOver( const ::com::sun::star::datatransfer::dnd::DropTarge aCurSel.Adjust(); if ( !aDestSel.IsLess( aCurSel ) && !aDestSel.IsGreater( aCurSel ) ) { - bAccept = FALSE; + bAccept = sal_False; } } if ( bAccept ) @@ -1939,7 +1939,7 @@ void ImpEditView::dragOver( const ::com::sun::star::datatransfer::dnd::DropTarge HideDDCursor(); ShowDDCursor(aEditCursor ); } - pDragAndDropInfo->bDragAccepted = TRUE; + pDragAndDropInfo->bDragAccepted = sal_True; rDTDE.Context->acceptDrag( rDTDE.DropAction ); } } @@ -1949,7 +1949,7 @@ void ImpEditView::dragOver( const ::com::sun::star::datatransfer::dnd::DropTarge { HideDDCursor(); if (pDragAndDropInfo) - pDragAndDropInfo->bDragAccepted = FALSE; + pDragAndDropInfo->bDragAccepted = sal_False; rDTDE.Context->rejectDrag(); } } @@ -1969,7 +1969,7 @@ void ImpEditView::AddDragAndDropListeners() pWindow->GetDropTarget()->setActive( sal_True ); pWindow->GetDropTarget()->setDefaultActions( datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE ); - bActiveDragAndDropListener = TRUE; + bActiveDragAndDropListener = sal_True; } } @@ -1989,7 +1989,7 @@ void ImpEditView::RemoveDragAndDropListeners() mxDnDListener.clear(); } - bActiveDragAndDropListener = FALSE; + bActiveDragAndDropListener = sal_False; } } diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index e3b0de909f4d..3e4982e6c140 100644..100755 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -123,7 +123,7 @@ struct DragAndDropInfo sal_uInt16 nCursorWidth; ESelection aBeginDragSel; EditPaM aDropDest; - USHORT nOutlinerDropDest; + sal_uInt16 nOutlinerDropDest; ESelection aDropSel; VirtualDevice* pBackground; const SvxFieldItem* pField; @@ -239,7 +239,7 @@ private: long nInvMore; - ULONG nControl; + sal_uLong nControl; sal_uInt32 nTravelXPos; sal_uInt16 nExtraCursorFlags; sal_uInt16 nCursorBidiLevel; @@ -290,13 +290,13 @@ public: void ResetOutputArea( const Rectangle& rRec ); const Rectangle& GetOutputArea() const { return aOutArea; } - BOOL IsVertical() const; + sal_Bool IsVertical() const; - BOOL PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin = NULL ); + sal_Bool PostKeyEvent( const KeyEvent& rKeyEvent, Window* pFrameWin = NULL ); - BOOL MouseButtonUp( const MouseEvent& rMouseEvent ); - BOOL MouseButtonDown( const MouseEvent& rMouseEvent ); - BOOL MouseMove( const MouseEvent& rMouseEvent ); + sal_Bool MouseButtonUp( const MouseEvent& rMouseEvent ); + sal_Bool MouseButtonDown( const MouseEvent& rMouseEvent ); + sal_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 ); @@ -333,7 +333,7 @@ public: void AddDragAndDropListeners(); void RemoveDragAndDropListeners(); - BOOL IsBulletArea( const Point& rPos, sal_uInt16* pPara ); + sal_Bool IsBulletArea( const Point& rPos, sal_uInt16* pPara ); // For the Selection Engine... void CreateAnchor(); @@ -348,9 +348,9 @@ public: void CalcAnchorPoint(); void RecalcOutputArea(); - void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, BOOL test ); - void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, USHORT nShowCursorFlags = 0 ); - Pair Scroll( long ndX, long ndY, BYTE nRangeCheck = RGCHK_NEG ); + void ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sal_Bool test ); + void ShowCursor( sal_Bool bGotoCursor, sal_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 ); } @@ -456,9 +456,9 @@ private: sal_uInt16 nStretchX; sal_uInt16 nStretchY; - USHORT nAsianCompressionMode; - BOOL bKernAsianPunctuation; - BOOL bAddExtLeading; + sal_uInt16 nAsianCompressionMode; + sal_Bool bKernAsianPunctuation; + sal_Bool bAddExtLeading; EEHorizontalTextDirection eDefaultHorizontalTextDirection; @@ -541,14 +541,14 @@ private: EditPaM GetPaM( Point aDocPos, sal_Bool bSmart = sal_True ); EditPaM GetPaM( ParaPortion* pPortion, Point aPos, sal_Bool bSmart = sal_True ); - long GetXPos( ParaPortion* pParaPortion, EditLine* pLine, USHORT nIndex, BOOL bPreferPortionStart = FALSE ); - long GetPortionXOffset( ParaPortion* pParaPortion, EditLine* pLine, USHORT nTextPortion ); - USHORT GetChar( ParaPortion* pParaPortion, EditLine* pLine, long nX, BOOL bSmart = TRUE ); + long GetXPos( ParaPortion* pParaPortion, EditLine* pLine, sal_uInt16 nIndex, sal_Bool bPreferPortionStart = sal_False ); + long GetPortionXOffset( ParaPortion* pParaPortion, EditLine* pLine, sal_uInt16 nTextPortion ); + sal_uInt16 GetChar( ParaPortion* pParaPortion, EditLine* pLine, long nX, sal_Bool bSmart = sal_True ); Range GetInvalidYOffsets( ParaPortion* pPortion ); Range GetLineXPosStartEnd( ParaPortion* pParaPortion, EditLine* pLine ); - void SetParaAttrib( BYTE nFunc, EditSelection aSel, sal_uInt16 nValue ); - sal_uInt16 GetParaAttrib( BYTE nFunc, EditSelection aSel ); + void SetParaAttrib( sal_uInt8 nFunc, EditSelection aSel, sal_uInt16 nValue ); + sal_uInt16 GetParaAttrib( sal_uInt8 nFunc, EditSelection aSel ); void SetCharAttrib( EditSelection aSel, const SfxPoolItem& rItem ); void ParaAttribsToCharAttribs( ContentNode* pNode ); void GetCharAttribs( sal_uInt16 nPara, EECharAttribArray& rLst ) const; @@ -556,12 +556,12 @@ private: EditTextObject* CreateBinTextObject( EditSelection aSelection, SfxItemPool*, sal_Bool bAllowBigObjects = sal_False, sal_uInt16 nBigObjStart = 0 ) const; void StoreBinTextObject( SvStream& rOStream, BinTextObject& rTextObject ); EditSelection InsertBinTextObject( BinTextObject&, EditPaM aPaM ); - EditSelection InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxDataObj, const String& rBaseURL, const EditPaM& rPaM, BOOL bUseSpecial ); + EditSelection InsertText( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& rxDataObj, const String& rBaseURL, const EditPaM& rPaM, sal_Bool bUseSpecial ); EditPaM Clear(); EditPaM RemoveText(); EditPaM RemoveText( EditSelection aEditSelection ); - sal_Bool CreateLines( USHORT nPara, sal_uInt32 nStartPosY ); + sal_Bool CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY ); void CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uInt32 nStartPosY ); sal_Bool FinishCreateLines( ParaPortion* pParaPortion ); void CalcCharPositions( ParaPortion* pParaPortion ); @@ -589,9 +589,9 @@ private: sal_Bool ImpCheckRefMapMode(); - BOOL ImplHasText() const; + sal_Bool ImplHasText() const; - void ImpFindKashidas( ContentNode* pNode, USHORT nStart, USHORT nEnd, SvUShorts& rArray ); + void ImpFindKashidas( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, SvUShorts& rArray ); void InsertContent( ContentNode* pNode, sal_uInt16 nPos ); EditPaM SplitContent( sal_uInt16 nNode, sal_uInt16 nSepPos ); @@ -604,8 +604,8 @@ private: EditPaM PageDown( const EditPaM& rPaM, EditView* pView); EditPaM CursorUp( const EditPaM& rPaM, EditView* pEditView ); EditPaM CursorDown( const EditPaM& rPaM, EditView* pEditView ); - EditPaM CursorLeft( const EditPaM& rPaM, USHORT nCharacterIteratorMode = ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL ); - EditPaM CursorRight( const EditPaM& rPaM, USHORT nCharacterIteratorMode = ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL ); + EditPaM CursorLeft( const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL ); + EditPaM CursorRight( const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode = ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL ); EditPaM CursorStartOfLine( const EditPaM& rPaM ); EditPaM CursorEndOfLine( const EditPaM& rPaM ); EditPaM CursorStartOfParagraph( const EditPaM& rPaM ); @@ -616,22 +616,22 @@ 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, BOOL bAcceptStartOfWord = TRUE ); + EditSelection SelectWord( const EditSelection& rCurSelection, sal_Int16 nWordType = ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_Bool bAcceptStartOfWord = sal_True ); EditSelection SelectSentence( const EditSelection& rCurSel ); - EditPaM CursorVisualLeftRight( EditView* pEditView, const EditPaM& rPaM, USHORT nCharacterIteratorMode, BOOL bToLeft ); - EditPaM CursorVisualStartEnd( EditView* pEditView, const EditPaM& rPaM, BOOL bStart ); + EditPaM CursorVisualLeftRight( EditView* pEditView, const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode, sal_Bool bToLeft ); + EditPaM CursorVisualStartEnd( EditView* pEditView, const EditPaM& rPaM, sal_Bool bStart ); - void InitScriptTypes( USHORT nPara ); - USHORT GetScriptType( const EditPaM& rPaM, USHORT* pEndPos = NULL ) const; - USHORT GetScriptType( const EditSelection& rSel ) const; - BOOL IsScriptChange( const EditPaM& rPaM ) const; - BOOL HasScriptType( USHORT nPara, USHORT nType ) const; + void InitScriptTypes( sal_uInt16 nPara ); + sal_uInt16 GetScriptType( const EditPaM& rPaM, sal_uInt16* pEndPos = NULL ) const; + sal_uInt16 GetScriptType( const EditSelection& rSel ) const; + sal_Bool IsScriptChange( const EditPaM& rPaM ) const; + sal_Bool HasScriptType( sal_uInt16 nPara, sal_uInt16 nType ) const; - BOOL ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, USHORT nStartPos, sal_Int32* pDXArray, USHORT n100thPercentFromMax, BOOL bManipulateDXArray ); + sal_Bool ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, sal_uInt16 nStartPos, sal_Int32* pDXArray, sal_uInt16 n100thPercentFromMax, sal_Bool bManipulateDXArray ); void ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, long nRemainingWidth ); - void ImplInitLayoutMode( OutputDevice* pOutDev, USHORT nPara, USHORT nIndex ); + void ImplInitLayoutMode( OutputDevice* pOutDev, sal_uInt16 nPara, sal_uInt16 nIndex ); void ImplInitDigitMode( OutputDevice* pOutDev, String* pString, xub_StrLen nStt, xub_StrLen nLen, LanguageType eLang ); EditPaM ReadText( SvStream& rInput, EditSelection aSel ); @@ -643,7 +643,7 @@ private: sal_uInt32 WriteRTF( SvStream& rOutput, EditSelection aSel ); sal_uInt32 WriteXML( SvStream& rOutput, EditSelection aSel ); sal_uInt32 WriteHTML( SvStream& rOutput, EditSelection aSel ); - sal_uInt32 WriteBin( SvStream& rOutput, EditSelection aSel, BOOL bStoreUnicode = FALSE ) const; + sal_uInt32 WriteBin( SvStream& rOutput, EditSelection aSel, sal_Bool bStoreUnicode = sal_False ) const; void WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, sal_uInt16 nPara, sal_uInt16 nPos, SvxFontTable& rFontTable, SvxColorList& rColorList ); @@ -670,12 +670,12 @@ private: long CalcVertLineSpacing(Point& rStartPos) const; Color GetAutoColor() const; - void EnableAutoColor( BOOL b ) { bUseAutoColor = b; } - BOOL IsAutoColorEnabled() const { return bUseAutoColor; } - void ForceAutoColor( BOOL b ) { bForceAutoColor = b; } - BOOL IsForceAutoColor() const { return bForceAutoColor; } + void EnableAutoColor( sal_Bool b ) { bUseAutoColor = b; } + sal_Bool IsAutoColorEnabled() const { return bUseAutoColor; } + void ForceAutoColor( sal_Bool b ) { bForceAutoColor = b; } + sal_Bool IsForceAutoColor() const { return bForceAutoColor; } - inline VirtualDevice* GetVirtualDevice( const MapMode& rMapMode, ULONG nDrawMode ); + inline VirtualDevice* GetVirtualDevice( const MapMode& rMapMode, sal_uLong nDrawMode ); inline void EraseVirtualDevice(); DECL_LINK( StatusTimerHdl, Timer * ); @@ -702,7 +702,7 @@ private: the output string at hand. This is necessary for slideshow text effects. */ - void ImplFillTextMarkingVector(const ::com::sun::star::lang::Locale& rLocale, EEngineData::TextMarkingVector& rTextMarkingVector, const String& rTxt, const USHORT nIdx, const USHORT nLen) const; + void ImplFillTextMarkingVector(const ::com::sun::star::lang::Locale& rLocale, EEngineData::TextMarkingVector& rTextMarkingVector, const String& rTxt, const sal_uInt16 nIdx, const sal_uInt16 nLen) const; SpellInfo * CreateSpellInfo( const EditSelection &rSel, bool bMultipleDocs ); @@ -713,7 +713,7 @@ public: ImpEditEngine( EditEngine* pEditEngine, SfxItemPool* pPool ); ~ImpEditEngine(); - void InitDoc( BOOL bKeepParaAttribs ); + void InitDoc( sal_Bool bKeepParaAttribs ); EditDoc& GetEditDoc() { return aEditDoc; } const EditDoc& GetEditDoc() const { return aEditDoc; } @@ -729,20 +729,20 @@ public: const Size& GetPaperSize() const { return aPaperSize; } void SetPaperSize( const Size& rSz ) { aPaperSize = rSz; } - void SetVertical( BOOL bVertical ); - BOOL IsVertical() const { return GetEditDoc().IsVertical(); } + void SetVertical( sal_Bool bVertical ); + sal_Bool IsVertical() const { return GetEditDoc().IsVertical(); } - void SetFixedCellHeight( BOOL bUseFixedCellHeight ); - BOOL IsFixedCellHeight() const { return GetEditDoc().IsFixedCellHeight(); } + void SetFixedCellHeight( sal_Bool bUseFixedCellHeight ); + sal_Bool IsFixedCellHeight() const { return GetEditDoc().IsFixedCellHeight(); } void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir ) { eDefaultHorizontalTextDirection = eHTextDir; } EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const { return eDefaultHorizontalTextDirection; } - void InitWritingDirections( USHORT nPara ); - BOOL IsRightToLeft( USHORT nPara ) const; - BYTE GetRightToLeft( USHORT nPara, USHORT nChar, USHORT* pStart = NULL, USHORT* pEnd = NULL ); - BOOL HasDifferentRTLLevels( const ContentNode* pNode ); + void InitWritingDirections( sal_uInt16 nPara ); + sal_Bool IsRightToLeft( sal_uInt16 nPara ) const; + sal_uInt8 GetRightToLeft( sal_uInt16 nPara, sal_uInt16 nChar, sal_uInt16* pStart = NULL, sal_uInt16* pEnd = NULL ); + sal_Bool HasDifferentRTLLevels( const ContentNode* pNode ); void SetTextRanger( TextRanger* pRanger ); TextRanger* GetTextRanger() const { return pTextRanger; } @@ -786,8 +786,8 @@ public: EditPaM DeleteSelected( EditSelection aEditSelection); EditPaM InsertText( const EditSelection& rCurEditSelection, sal_Unicode c, sal_Bool bOverwrite, sal_Bool bIsUserInput = sal_False ); EditPaM InsertText( EditSelection aCurEditSelection, const String& rStr ); - EditPaM AutoCorrect( const EditSelection& rCurEditSelection, sal_Unicode c, bool bOverwrite, Window* pFrameWin = NULL ); - EditPaM DeleteLeftOrRight( const EditSelection& rEditSelection, BYTE nMode, BYTE nDelMode = DELMODE_SIMPLE ); + EditPaM AutoCorrect( const EditSelection& rCurEditSelection, sal_Unicode c, sal_Bool bOverwrite, Window* pFrameWin = NULL ); + EditPaM DeleteLeftOrRight( const EditSelection& rEditSelection, sal_uInt8 nMode, sal_uInt8 nDelMode = DELMODE_SIMPLE ); EditPaM InsertParaBreak( EditSelection aEditSelection ); EditPaM InsertLineBreak( EditSelection aEditSelection ); EditPaM InsertTab( EditSelection aEditSelection ); @@ -808,18 +808,18 @@ public: sal_uInt32 CalcTextHeight(); sal_uInt32 GetTextHeight() const; - sal_uInt32 CalcTextWidth( BOOL bIgnoreExtraSpace ); - sal_uInt32 CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, BOOL bIgnoreExtraSpace ); + sal_uInt32 CalcTextWidth( sal_Bool bIgnoreExtraSpace ); + sal_uInt32 CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, sal_Bool bIgnoreExtraSpace ); sal_uInt16 GetLineCount( sal_uInt16 nParagraph ) const; sal_uInt16 GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const; - void GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const; - USHORT GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const; + void GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const; + sal_uInt16 GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const; sal_uInt16 GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine ); sal_uInt32 GetParaHeight( sal_uInt16 nParagraph ); - SfxItemSet GetAttribs( USHORT nPara, USHORT nStart, USHORT nEnd, sal_uInt8 nFlags = 0xFF ) const; - SfxItemSet GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib = FALSE ); - void SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE nSpecial = 0 ); + SfxItemSet GetAttribs( sal_uInt16 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags = 0xFF ) const; + SfxItemSet GetAttribs( EditSelection aSel, sal_Bool bOnlyHardAttrib = sal_False ); + 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_uInt16 nPara, sal_uInt16 nWhich = 0, sal_Bool bRemoveFeatures = sal_False ); void SetFlatMode( sal_Bool bFlat ); @@ -864,8 +864,8 @@ public: inline void IdleFormatAndUpdate( EditView* pCurView = 0 ); svtools::ColorConfig& GetColorConfig(); - BOOL IsVisualCursorTravelingEnabled(); - BOOL DoVisualCursorTraveling( const ContentNode* pNode ); + sal_Bool IsVisualCursorTravelingEnabled(); + sal_Bool DoVisualCursorTraveling( const ContentNode* pNode ); EditSelection ConvertSelection( sal_uInt16 nStartPara, sal_uInt16 nStartPos, sal_uInt16 nEndPara, sal_uInt16 nEndPos ) const; inline EPaM CreateEPaM( const EditPaM& rPaM ); @@ -927,7 +927,7 @@ public: LanguageType GetLanguage( const EditSelection rSelection ) const; - LanguageType GetLanguage( const EditPaM& rPaM, USHORT* pEndPos = NULL ) const; + LanguageType GetLanguage( const EditPaM& rPaM, sal_uInt16* pEndPos = NULL ) const; ::com::sun::star::lang::Locale GetLocale( const EditPaM& rPaM ) const; void DoOnlineSpelling( ContentNode* pThisNodeOnly = 0, sal_Bool bSpellAtCursorPos = sal_False, sal_Bool bInteruptable = sal_True ); @@ -939,14 +939,14 @@ public: ImpSpell( EditView* pEditView ); // text conversion functions - void Convert( EditView* pEditView, LanguageType nSrcLang, LanguageType nDestLang, const Font *pDestFont, INT32 nOptions, sal_Bool bIsInteractive, sal_Bool bMultipleDoc ); + void Convert( EditView* pEditView, LanguageType nSrcLang, LanguageType nDestLang, const Font *pDestFont, sal_Int32 nOptions, sal_Bool bIsInteractive, sal_Bool bMultipleDoc ); void ImpConvert( rtl::OUString &rConvTxt, LanguageType &rConvTxtLang, EditView* pEditView, LanguageType nSrcLang, const ESelection &rConvRange, sal_Bool bAllowImplicitChangesForNotConvertibleText, LanguageType nTargetLang, const Font *pTargetFont ); ConvInfo * GetConvInfo() const { return pConvInfo; } sal_Bool HasConvertibleTextPortion( LanguageType nLang ); void SetLanguageAndFont( const ESelection &rESel, - LanguageType nLang, USHORT nLangWhichId, - const Font *pFont, USHORT nFontWhichId ); + 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; @@ -991,8 +991,8 @@ public: const SvxLRSpaceItem& GetLRSpaceItem( ContentNode* pNode ); SvxAdjust GetJustification( USHORT nPara ) const; - SvxCellJustifyMethod GetJustifyMethod( USHORT nPara ) const; - SvxCellVerJustify GetVerJustification( USHORT nPara ) const; + SvxCellJustifyMethod GetJustifyMethod( sal_uInt16 nPara ) const; + SvxCellVerJustify GetVerJustification( sal_uInt16 nPara ) const; void SetCharStretching( sal_uInt16 nX, sal_uInt16 nY ); inline void GetCharStretching( sal_uInt16& rX, sal_uInt16& rY ); @@ -1010,22 +1010,22 @@ public: void SetAutoCompleteText( const String& rStr, sal_Bool bUpdateTipWindow ); EditSelection TransliterateText( const EditSelection& rSelection, sal_Int32 nTransliterationMode ); - short ReplaceTextOnly( ContentNode* pNode, USHORT nCurrentStart, xub_StrLen nLen, const String& rText, const ::com::sun::star::uno::Sequence< sal_Int32 >& rOffsets ); + short ReplaceTextOnly( ContentNode* pNode, sal_uInt16 nCurrentStart, xub_StrLen nLen, const String& rText, const ::com::sun::star::uno::Sequence< sal_Int32 >& rOffsets ); - void SetAsianCompressionMode( USHORT n ); - USHORT GetAsianCompressionMode() const { return nAsianCompressionMode; } + void SetAsianCompressionMode( sal_uInt16 n ); + sal_uInt16 GetAsianCompressionMode() const { return nAsianCompressionMode; } - void SetKernAsianPunctuation( BOOL b ); - BOOL IsKernAsianPunctuation() const { return bKernAsianPunctuation; } + void SetKernAsianPunctuation( sal_Bool b ); + sal_Bool IsKernAsianPunctuation() const { return bKernAsianPunctuation; } - void SetAddExtLeading( BOOL b ); - BOOL IsAddExtLeading() const { return bAddExtLeading; } + void SetAddExtLeading( sal_Bool b ); + sal_Bool IsAddExtLeading() const { return bAddExtLeading; } - rtl::Reference<SvxForbiddenCharactersTable> GetForbiddenCharsTable( BOOL bGetInternal = TRUE ) const; + rtl::Reference<SvxForbiddenCharactersTable> GetForbiddenCharsTable( sal_Bool bGetInternal = sal_True ) const; void SetForbiddenCharsTable( rtl::Reference<SvxForbiddenCharactersTable> xForbiddenChars ); - BOOL mbLastTryMerge; + sal_Bool mbLastTryMerge; /** sets a link that is called at the beginning of a drag operation at an edit view */ void SetBeginDropHdl( const Link& rLink ) { maBeginDropHdl = rLink; } @@ -1036,8 +1036,8 @@ public: Link GetEndDropHdl() const { return maEndDropHdl; } /// specifies if auto-correction should capitalize the first word or not (default is on) - void SetFirstWordCapitalization( BOOL bCapitalize ) { bFirstWordCapitalization = bCapitalize; } - BOOL IsFirstWordCapitalization() const { return bFirstWordCapitalization; } + void SetFirstWordCapitalization( sal_Bool bCapitalize ) { bFirstWordCapitalization = bCapitalize; } + sal_Bool IsFirstWordCapitalization() const { return bFirstWordCapitalization; } }; inline EPaM ImpEditEngine::CreateEPaM( const EditPaM& rPaM ) @@ -1078,7 +1078,7 @@ inline EditSelection ImpEditEngine::CreateSel( const ESelection& rSel ) return aSel; } -inline VirtualDevice* ImpEditEngine::GetVirtualDevice( const MapMode& rMapMode, ULONG nDrawMode ) +inline VirtualDevice* ImpEditEngine::GetVirtualDevice( const MapMode& rMapMode, sal_uLong nDrawMode ) { if ( !pVirtDev ) pVirtDev = new VirtualDevice; @@ -1213,7 +1213,7 @@ inline Cursor* ImpEditView::GetCursor() void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit ); void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const MapUnit* pSourceUnit = NULL, const MapUnit* pDestUnit = NULL ); -BYTE GetCharTypeForCompression( xub_Unicode cChar ); +sal_uInt8 GetCharTypeForCompression( xub_Unicode cChar ); Point Rotate( const Point& rPoint, short nOrientation, const Point& rOrigin ); #endif // _IMPEDIT_HXX diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index da6cd539533d..dbd36e4e1632 100644..100755 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -77,9 +77,9 @@ using namespace ::com::sun::star; -USHORT lcl_CalcExtraSpace( ParaPortion*, const SvxLineSpacingItem& rLSItem ) +sal_uInt16 lcl_CalcExtraSpace( ParaPortion*, const SvxLineSpacingItem& rLSItem ) { - USHORT nExtra = 0; + sal_uInt16 nExtra = 0; if ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) { nExtra = rLSItem.GetInterLineSpace(); @@ -119,26 +119,26 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : nStretchX = 100; nStretchY = 100; - bInSelection = FALSE; - bOwnerOfRefDev = FALSE; - bDowning = FALSE; - bIsInUndo = FALSE; - bIsFormatting = FALSE; - bFormatted = FALSE; - bUpdate = TRUE; - bUseAutoColor = TRUE; - bForceAutoColor = FALSE; - bAddExtLeading = FALSE; - bUndoEnabled = TRUE; - bCallParaInsertedOrDeleted = FALSE; - bImpConvertFirstCall= FALSE; - bFirstWordCapitalization = TRUE; + bInSelection = sal_False; + bOwnerOfRefDev = sal_False; + bDowning = sal_False; + bIsInUndo = sal_False; + bIsFormatting = sal_False; + bFormatted = sal_False; + bUpdate = sal_True; + bUseAutoColor = sal_True; + bForceAutoColor = sal_False; + bAddExtLeading = sal_False; + bUndoEnabled = sal_True; + bCallParaInsertedOrDeleted = sal_False; + bImpConvertFirstCall= sal_False; + bFirstWordCapitalization = sal_True; eDefLanguage = LANGUAGE_DONTKNOW; maBackgroundColor = COL_AUTO; nAsianCompressionMode = text::CharacterCompressionType::NONE; - bKernAsianPunctuation = FALSE; + bKernAsianPunctuation = sal_False; eDefaultHorizontalTextDirection = EE_HTEXTDIR_DEFAULT; @@ -163,13 +163,13 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : // Access data already from here on! SetRefDevice( pRefDev ); - InitDoc( FALSE ); + InitDoc( sal_False ); - bCallParaInsertedOrDeleted = TRUE; + bCallParaInsertedOrDeleted = sal_True; aEditDoc.SetModifyHdl( LINK( this, ImpEditEngine, DocModified ) ); - mbLastTryMerge = FALSE; + mbLastTryMerge = sal_False; } ImpEditEngine::~ImpEditEngine() @@ -181,8 +181,8 @@ ImpEditEngine::~ImpEditEngine() // Destroying templates may otherwise cause unnecessary formatting, // when a parent template is destroyed. // And this after the destruction of the data! - bDowning = TRUE; - SetUpdateMode( FALSE ); + bDowning = sal_True; + SetUpdateMode( sal_False ); delete pVirtDev; delete pEmptyItemSet; @@ -202,12 +202,12 @@ void ImpEditEngine::SetRefDevice( OutputDevice* pRef ) delete pRefDev; pRefDev = pRef; - bOwnerOfRefDev = FALSE; + bOwnerOfRefDev = sal_False; if ( !pRef ) pRefDev = EE_DLL()->GetGlobalData()->GetStdRefDevice(); - nOnePixelInRef = (USHORT)pRefDev->PixelToLogic( Size( 1, 0 ) ).Width(); + nOnePixelInRef = (sal_uInt16)pRefDev->PixelToLogic( Size( 1, 0 ) ).Width(); if ( IsFormatted() ) { @@ -227,10 +227,10 @@ void ImpEditEngine::SetRefMapMode( const MapMode& rMapMode ) pRefDev = new VirtualDevice; pRefDev->SetMapMode( MAP_TWIP ); SetRefDevice( pRefDev ); - bOwnerOfRefDev = TRUE; + bOwnerOfRefDev = sal_True; } pRefDev->SetMapMode( rMapMode ); - nOnePixelInRef = (USHORT)pRefDev->PixelToLogic( Size( 1, 0 ) ).Width(); + nOnePixelInRef = (sal_uInt16)pRefDev->PixelToLogic( Size( 1, 0 ) ).Width(); if ( IsFormatted() ) { FormatFullDoc(); @@ -238,13 +238,13 @@ void ImpEditEngine::SetRefMapMode( const MapMode& rMapMode ) } } -void ImpEditEngine::InitDoc( BOOL bKeepParaAttribs ) +void ImpEditEngine::InitDoc( sal_Bool bKeepParaAttribs ) { - USHORT nParas = aEditDoc.Count(); - for ( USHORT n = bKeepParaAttribs ? 1 : 0; n < nParas; n++ ) + sal_uInt16 nParas = aEditDoc.Count(); + for ( sal_uInt16 n = bKeepParaAttribs ? 1 : 0; n < nParas; n++ ) { if ( aEditDoc[n]->GetStyleSheet() ) - EndListening( *aEditDoc[n]->GetStyleSheet(), FALSE ); + EndListening( *aEditDoc[n]->GetStyleSheet(), sal_False ); } if ( bKeepParaAttribs ) @@ -257,7 +257,7 @@ void ImpEditEngine::InitDoc( BOOL bKeepParaAttribs ) ParaPortion* pIniPortion = new ParaPortion( aEditDoc[0] ); GetParaPortions().Insert( pIniPortion, 0 ); - bFormatted = FALSE; + bFormatted = sal_False; if ( IsCallParaInsertedOrDeleted() ) { @@ -290,13 +290,13 @@ XubString ImpEditEngine::GetSelected( const EditSelection& rSel, const LineEnd e ContentNode* pStartNode = aSel.Min().GetNode(); ContentNode* pEndNode = aSel.Max().GetNode(); - USHORT nStartNode = aEditDoc.GetPos( pStartNode ); - USHORT nEndNode = aEditDoc.GetPos( pEndNode ); + sal_uInt16 nStartNode = aEditDoc.GetPos( pStartNode ); + sal_uInt16 nEndNode = aEditDoc.GetPos( pEndNode ); DBG_ASSERT( nStartNode <= nEndNode, "Selection not sorted ?" ); // iterate over the paragraphs ... - for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) + for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { DBG_ASSERT( aEditDoc.SaveGetObject( nNode ), "Node not found: GetSelected" ); ContentNode* pNode = aEditDoc.GetObject( nNode ); @@ -315,13 +315,13 @@ XubString ImpEditEngine::GetSelected( const EditSelection& rSel, const LineEnd e return aText; } -BOOL ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pView ) +sal_Bool ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pView ) { GetSelEngine().SetCurView( pView ); SetActiveView( pView ); if ( GetAutoCompleteText().Len() ) - SetAutoCompleteText( String(), TRUE ); + SetAutoCompleteText( String(), sal_True ); GetSelEngine().SelMouseButtonDown( rMEvt ); // Special treatment @@ -331,18 +331,18 @@ BOOL ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pView ) if ( rMEvt.GetClicks() == 2 ) { // So that the SelectionEngine knows about the anchor. - aSelEngine.CursorPosChanging( TRUE, FALSE ); + aSelEngine.CursorPosChanging( sal_True, sal_False ); EditSelection aNewSelection( SelectWord( aCurSel ) ); pView->pImpEditView->DrawSelection(); pView->pImpEditView->SetEditSelection( aNewSelection ); pView->pImpEditView->DrawSelection(); - pView->ShowCursor( TRUE, TRUE ); + pView->ShowCursor( sal_True, sal_True ); } else if ( rMEvt.GetClicks() == 3 ) { // So that the SelectionEngine knows about the anchor. - aSelEngine.CursorPosChanging( TRUE, FALSE ); + aSelEngine.CursorPosChanging( sal_True, sal_False ); EditSelection aNewSelection( aCurSel ); aNewSelection.Min().SetIndex( 0 ); @@ -350,10 +350,10 @@ BOOL ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pView ) pView->pImpEditView->DrawSelection(); pView->pImpEditView->SetEditSelection( aNewSelection ); pView->pImpEditView->DrawSelection(); - pView->ShowCursor( TRUE, TRUE ); + pView->ShowCursor( sal_True, sal_True ); } } - return TRUE; + return sal_True; } void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) @@ -469,7 +469,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) delete mpIMEInfos; EditPaM aPaM = pView->GetImpEditView()->GetEditSelection().Max(); String aOldTextAfterStartPos = aPaM.GetNode()->Copy( aPaM.GetIndex() ); - USHORT nMax = aOldTextAfterStartPos.Search( CH_FEATURE ); + sal_uInt16 nMax = aOldTextAfterStartPos.Search( CH_FEATURE ); if ( nMax != STRING_NOTFOUND ) // don't overwrite features! aOldTextAfterStartPos.Erase( nMax ); mpIMEInfos = new ImplIMEInfos( aPaM, aOldTextAfterStartPos ); @@ -506,7 +506,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) ParaPortion* pPortion = FindParaPortion( mpIMEInfos->aPos.GetNode() ); pPortion->MarkSelectionInvalid( mpIMEInfos->aPos.GetIndex(), 0 ); - BOOL bWasCursorOverwrite = mpIMEInfos->bWasCursorOverwrite; + sal_Bool bWasCursorOverwrite = mpIMEInfos->bWasCursorOverwrite; delete mpIMEInfos; mpIMEInfos = NULL; @@ -534,14 +534,14 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) if ( mpIMEInfos->bWasCursorOverwrite ) { - USHORT nOldIMETextLen = mpIMEInfos->nLen; - USHORT nNewIMETextLen = pData->GetText().Len(); + sal_uInt16 nOldIMETextLen = mpIMEInfos->nLen; + sal_uInt16 nNewIMETextLen = pData->GetText().Len(); if ( ( nOldIMETextLen > nNewIMETextLen ) && ( nNewIMETextLen < mpIMEInfos->aOldTextAfterStartPos.Len() ) ) { // restore old characters - USHORT nRestore = nOldIMETextLen - nNewIMETextLen; + sal_uInt16 nRestore = nOldIMETextLen - nNewIMETextLen; EditPaM aPaM( mpIMEInfos->aPos ); aPaM.GetIndex() = aPaM.GetIndex() + nNewIMETextLen; ImpInsertText( aPaM, mpIMEInfos->aOldTextAfterStartPos.Copy( nNewIMETextLen, nRestore ) ); @@ -550,7 +550,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) ( nOldIMETextLen < mpIMEInfos->aOldTextAfterStartPos.Len() ) ) { // overwrite - USHORT nOverwrite = nNewIMETextLen - nOldIMETextLen; + sal_uInt16 nOverwrite = nNewIMETextLen - nOldIMETextLen; if ( ( nOldIMETextLen + nOverwrite ) > mpIMEInfos->aOldTextAfterStartPos.Len() ) nOverwrite = mpIMEInfos->aOldTextAfterStartPos.Len() - nOldIMETextLen; DBG_ASSERT( nOverwrite && (nOverwrite < 0xFF00), "IME Overwrite?!" ); @@ -598,13 +598,13 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) EditPaM aPaM( pView->pImpEditView->GetEditSelection().Max() ); Rectangle aR1 = PaMtoEditCursor( aPaM, 0 ); - USHORT nInputEnd = mpIMEInfos->aPos.GetIndex() + mpIMEInfos->nLen; + sal_uInt16 nInputEnd = mpIMEInfos->aPos.GetIndex() + mpIMEInfos->nLen; if ( !IsFormatted() ) FormatDoc(); ParaPortion* pParaPortion = GetParaPortions().SaveGetObject( GetEditDoc().GetPos( aPaM.GetNode() ) ); - USHORT nLine = pParaPortion->GetLines().FindLine( aPaM.GetIndex(), sal_True ); + sal_uInt16 nLine = pParaPortion->GetLines().FindLine( aPaM.GetIndex(), sal_True ); EditLine* pLine = pParaPortion->GetLines().GetObject( nLine ); if ( pLine && ( nInputEnd > pLine->GetEnd() ) ) nInputEnd = pLine->GetEnd(); @@ -657,11 +657,11 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) GetSelEngine().Command( rCEvt ); } -BOOL ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView ) +sal_Bool ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView ) { GetSelEngine().SetCurView( pView ); GetSelEngine().SelMouseButtonUp( rMEvt ); - bInSelection = FALSE; + bInSelection = sal_False; // Special treatments EditSelection aCurSel( pView->pImpEditView->GetEditSelection() ); if ( !aCurSel.HasRange() ) @@ -672,20 +672,20 @@ BOOL ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView ) if ( pFld ) { EditPaM aPaM( aCurSel.Max() ); - USHORT nPara = GetEditDoc().GetPos( aPaM.GetNode() ); + sal_uInt16 nPara = GetEditDoc().GetPos( aPaM.GetNode() ); GetEditEnginePtr()->FieldClicked( *pFld, nPara, aPaM.GetIndex() ); } } } - return TRUE; + return sal_True; } -BOOL ImpEditEngine::MouseMove( const MouseEvent& rMEvt, EditView* pView ) +sal_Bool ImpEditEngine::MouseMove( const MouseEvent& rMEvt, EditView* pView ) { // MouseMove is called directly after ShowQuickHelp()! GetSelEngine().SetCurView( pView ); GetSelEngine().SelMouseMove( rMEvt ); - return TRUE; + return sal_True; } EditPaM ImpEditEngine::InsertText( EditSelection aSel, const XubString& rStr ) @@ -696,7 +696,7 @@ EditPaM ImpEditEngine::InsertText( EditSelection aSel, const XubString& rStr ) EditPaM ImpEditEngine::Clear() { - InitDoc( FALSE ); + InitDoc( sal_False ); EditPaM aPaM = aEditDoc.GetStartPaM(); EditSelection aSel( aPaM ); @@ -705,7 +705,7 @@ EditPaM ImpEditEngine::Clear() ResetUndoManager(); - for ( USHORT nView = aEditViews.Count(); nView; ) + for ( sal_uInt16 nView = aEditViews.Count(); nView; ) { EditView* pView = aEditViews[--nView]; DBG_CHKOBJ( pView, EditView, 0 ); @@ -717,11 +717,11 @@ EditPaM ImpEditEngine::Clear() EditPaM ImpEditEngine::RemoveText() { - InitDoc( TRUE ); + InitDoc( sal_True ); EditPaM aStartPaM = aEditDoc.GetStartPaM(); EditSelection aEmptySel( aStartPaM, aStartPaM ); - for ( USHORT nView = 0; nView < aEditViews.Count(); nView++ ) + for ( sal_uInt16 nView = 0; nView < aEditViews.Count(); nView++ ) { EditView* pView = aEditViews.GetObject(nView); DBG_CHKOBJ( pView, EditView, 0 ); @@ -736,16 +736,16 @@ void ImpEditEngine::SetText( const XubString& rText ) { // RemoveText deletes the undo list! EditPaM aStartPaM = RemoveText(); - BOOL bUndoCurrentlyEnabled = IsUndoEnabled(); + sal_Bool bUndoCurrentlyEnabled = IsUndoEnabled(); // The text inserted manually can not be made reversable by the user - EnableUndo( FALSE ); + EnableUndo( sal_False ); EditSelection aEmptySel( aStartPaM, aStartPaM ); EditPaM aPaM = aStartPaM; if ( rText.Len() ) aPaM = ImpInsertText( aEmptySel, rText ); - for ( USHORT nView = 0; nView < aEditViews.Count(); nView++ ) + for ( sal_uInt16 nView = 0; nView < aEditViews.Count(); nView++ ) { EditView* pView = aEditViews[nView]; DBG_CHKOBJ( pView, EditView, 0 ); @@ -774,7 +774,7 @@ const SfxItemSet& ImpEditEngine::GetEmptyItemSet() if ( !pEmptyItemSet ) { pEmptyItemSet = new SfxItemSet( aEditDoc.GetItemPool(), EE_ITEMS_START, EE_ITEMS_END ); - for ( USHORT nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++) + for ( sal_uInt16 nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++) { pEmptyItemSet->ClearItem( nWhich ); } @@ -794,7 +794,7 @@ void ImpEditEngine::CursorMoved( ContentNode* pPrevNode ) void ImpEditEngine::TextModified() { - bFormatted = FALSE; + bFormatted = sal_False; if ( GetNotifyHdl().IsSet() ) { @@ -809,14 +809,14 @@ void ImpEditEngine::ParaAttribsChanged( ContentNode* pNode ) { DBG_ASSERT( pNode, "ParaAttribsChanged: Which one?" ); - aEditDoc.SetModified( TRUE ); - bFormatted = FALSE; + aEditDoc.SetModified( sal_True ); + bFormatted = sal_False; ParaPortion* pPortion = FindParaPortion( pNode ); DBG_ASSERT( pPortion, "ParaAttribsChanged: Portion?" ); pPortion->MarkSelectionInvalid( 0, pNode->Len() ); - USHORT nPara = aEditDoc.GetPos( pNode ); + sal_uInt16 nPara = aEditDoc.GetPos( pNode ); pEditEngine->ParaAttribsChanged( nPara ); ParaPortion* pNextPortion = GetParaPortions().SaveGetObject( nPara+1 ); @@ -846,8 +846,8 @@ EditSelection ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, EditView* pE KeyEvent aTranslatedKeyEvent = rKeyEvent.LogicalTextDirectionality( eTextDirection ); - BOOL bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? TRUE : FALSE; - USHORT nCode = aTranslatedKeyEvent.GetKeyCode().GetCode(); + sal_Bool bCtrl = aTranslatedKeyEvent.GetKeyCode().IsMod1() ? sal_True : sal_False; + sal_uInt16 nCode = aTranslatedKeyEvent.GetKeyCode().GetCode(); if ( DoVisualCursorTraveling( aPaM.GetNode() ) ) { @@ -1001,16 +1001,16 @@ EditSelection ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, EditView* pE return pEditView->pImpEditView->GetEditSelection(); } -EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM& rPaM, BOOL bStart ) +EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM& rPaM, sal_Bool bStart ) { EditPaM aPaM( rPaM ); - USHORT nPara = GetEditDoc().GetPos( aPaM.GetNode() ); + sal_uInt16 nPara = GetEditDoc().GetPos( aPaM.GetNode() ); ParaPortion* pParaPortion = GetParaPortions().SaveGetObject( nPara ); - USHORT nLine = pParaPortion->GetLines().FindLine( aPaM.GetIndex(), sal_False ); + sal_uInt16 nLine = pParaPortion->GetLines().FindLine( aPaM.GetIndex(), sal_False ); EditLine* pLine = pParaPortion->GetLines().GetObject( nLine ); - BOOL bEmptyLine = pLine->GetStart() == pLine->GetEnd(); + sal_Bool bEmptyLine = pLine->GetStart() == pLine->GetEnd(); pEditView->pImpEditView->nExtraCursorFlags = 0; @@ -1026,19 +1026,18 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM& const UBiDiLevel nBidiLevel = IsRightToLeft( nPara ) ? 1 /*RTL*/ : 0 /*LTR*/; ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(pLineString), aLine.Len(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW - USHORT nVisPos = bStart ? 0 : aLine.Len()-1; - USHORT nLogPos = (USHORT)ubidi_getLogicalIndex( pBidi, nVisPos, &nError ); + sal_uInt16 nVisPos = bStart ? 0 : aLine.Len()-1; + sal_uInt16 nLogPos = (sal_uInt16)ubidi_getLogicalIndex( pBidi, nVisPos, &nError ); ubidi_close( pBidi ); aPaM.GetIndex() = nLogPos + pLine->GetStart(); - USHORT nTmp; - USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTmp, TRUE ); + sal_uInt16 nTmp; + sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nTmp, sal_True ); TextPortion* pTextPortion = pParaPortion->GetTextPortions().GetObject( nTextPortion ); - USHORT nRTLLevel = pTextPortion->GetRightToLeft(); - - BOOL bPortionRTL = nRTLLevel%2 ? TRUE : FALSE; + sal_uInt16 nRTLLevel = pTextPortion->GetRightToLeft(); + sal_Bool bPortionRTL = nRTLLevel%2 ? sal_True : sal_False; if ( bStart ) { @@ -1058,22 +1057,22 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM& return aPaM; } -EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM& rPaM, USHORT nCharacterIteratorMode, BOOL bVisualToLeft ) +EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode, sal_Bool bVisualToLeft ) { EditPaM aPaM( rPaM ); - USHORT nPara = GetEditDoc().GetPos( aPaM.GetNode() ); + sal_uInt16 nPara = GetEditDoc().GetPos( aPaM.GetNode() ); ParaPortion* pParaPortion = GetParaPortions().SaveGetObject( nPara ); - USHORT nLine = pParaPortion->GetLines().FindLine( aPaM.GetIndex(), sal_False ); + sal_uInt16 nLine = pParaPortion->GetLines().FindLine( aPaM.GetIndex(), sal_False ); EditLine* pLine = pParaPortion->GetLines().GetObject( nLine ); - BOOL bEmptyLine = pLine->GetStart() == pLine->GetEnd(); + sal_Bool bEmptyLine = pLine->GetStart() == pLine->GetEnd(); pEditView->pImpEditView->nExtraCursorFlags = 0; - BOOL bParaRTL = IsRightToLeft( nPara ); + sal_Bool bParaRTL = IsRightToLeft( nPara ); - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if ( bEmptyLine ) { @@ -1081,36 +1080,36 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM { aPaM = CursorUp( aPaM, pEditView ); if ( aPaM != rPaM ) - aPaM = CursorVisualStartEnd( pEditView, aPaM, FALSE ); + aPaM = CursorVisualStartEnd( pEditView, aPaM, sal_False ); } else { aPaM = CursorDown( aPaM, pEditView ); if ( aPaM != rPaM ) - aPaM = CursorVisualStartEnd( pEditView, aPaM, TRUE ); + aPaM = CursorVisualStartEnd( pEditView, aPaM, sal_True ); } - bDone = TRUE; + bDone = sal_True; } - BOOL bLogicalBackward = bParaRTL ? !bVisualToLeft : bVisualToLeft; + sal_Bool bLogicalBackward = bParaRTL ? !bVisualToLeft : bVisualToLeft; if ( !bDone && pEditView->IsInsertMode() ) { // Check if we are within a portion and don't have overwrite mode, then it's easy... - USHORT nPortionStart; - USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nPortionStart, FALSE ); + sal_uInt16 nPortionStart; + sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nPortionStart, sal_False ); TextPortion* pTextPortion = pParaPortion->GetTextPortions().GetObject( nTextPortion ); - BOOL bPortionBoundary = ( aPaM.GetIndex() == nPortionStart ) || ( aPaM.GetIndex() == (nPortionStart+pTextPortion->GetLen()) ); - USHORT nRTLLevel = pTextPortion->GetRightToLeft(); + sal_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 - USHORT nRTLLevelNextPortion = 0xFFFF; + sal_uInt16 nRTLLevelNextPortion = 0xFFFF; if ( bPortionBoundary && aPaM.GetIndex() && ( aPaM.GetIndex() < aPaM.GetNode()->Len() ) ) { - USHORT nTmp; - USHORT nNextTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex()+1, nTmp, bLogicalBackward ? FALSE : TRUE ); + sal_uInt16 nTmp; + sal_uInt16 nNextTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex()+1, nTmp, bLogicalBackward ? sal_False : sal_True ); TextPortion* pNextTextPortion = pParaPortion->GetTextPortions().GetObject( nNextTextPortion ); nRTLLevelNextPortion = pNextTextPortion->GetRightToLeft(); } @@ -1127,17 +1126,17 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM aPaM = CursorRight( aPaM, nCharacterIteratorMode ); pEditView->pImpEditView->SetCursorBidiLevel( 0 ); } - bDone = TRUE; + bDone = sal_True; } } if ( !bDone ) { - BOOL bGotoStartOfNextLine = FALSE; - BOOL bGotoEndOfPrevLine = FALSE; + sal_Bool bGotoStartOfNextLine = sal_False; + sal_Bool bGotoEndOfPrevLine = sal_False; String aLine( *aPaM.GetNode(), pLine->GetStart(), pLine->GetEnd() - pLine->GetStart() ); - USHORT nPosInLine = aPaM.GetIndex() - pLine->GetStart(); + sal_uInt16 nPosInLine = aPaM.GetIndex() - pLine->GetStart(); const sal_Unicode* pLineString = aLine.GetBuffer(); @@ -1149,8 +1148,8 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM if ( !pEditView->IsInsertMode() ) { - BOOL bEndOfLine = nPosInLine == aLine.Len(); - USHORT nVisPos = (USHORT)ubidi_getVisualIndex( pBidi, !bEndOfLine ? nPosInLine : nPosInLine-1, &nError ); + sal_Bool bEndOfLine = nPosInLine == aLine.Len(); + sal_uInt16 nVisPos = (sal_uInt16)ubidi_getVisualIndex( pBidi, !bEndOfLine ? nPosInLine : nPosInLine-1, &nError ); if ( bVisualToLeft ) { bGotoEndOfPrevLine = nVisPos == 0; @@ -1166,22 +1165,22 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM if ( !bGotoEndOfPrevLine && !bGotoStartOfNextLine ) { - USHORT nLogPos = (USHORT)ubidi_getLogicalIndex( pBidi, nVisPos, &nError ); + sal_uInt16 nLogPos = (sal_uInt16)ubidi_getLogicalIndex( pBidi, nVisPos, &nError ); aPaM.GetIndex() = pLine->GetStart() + nLogPos; pEditView->pImpEditView->SetCursorBidiLevel( 0 ); } } else { - BOOL bWasBehind = FALSE; - BOOL bBeforePortion = !nPosInLine || pEditView->pImpEditView->GetCursorBidiLevel() == 1; + sal_Bool bWasBehind = sal_False; + sal_Bool bBeforePortion = !nPosInLine || pEditView->pImpEditView->GetCursorBidiLevel() == 1; if ( nPosInLine && ( !bBeforePortion ) ) // before the next portion - bWasBehind = TRUE; // step one back, otherwise visual will be unusable when rtl portion follows. + bWasBehind = sal_True; // step one back, otherwise visual will be unusable when rtl portion follows. - USHORT nPortionStart; - USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nPortionStart, bBeforePortion ); + sal_uInt16 nPortionStart; + sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nPortionStart, bBeforePortion ); TextPortion* pTextPortion = pParaPortion->GetTextPortions().GetObject( nTextPortion ); - BOOL bRTLPortion = (pTextPortion->GetRightToLeft() % 2) != 0; + sal_Bool bRTLPortion = (pTextPortion->GetRightToLeft() % 2) != 0; // -1: We are 'behind' the character long nVisPos = (long)ubidi_getVisualIndex( pBidi, bWasBehind ? nPosInLine-1 : nPosInLine, &nError ); @@ -1201,14 +1200,14 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM if ( !bGotoEndOfPrevLine && !bGotoStartOfNextLine ) { - USHORT nLogPos = (USHORT)ubidi_getLogicalIndex( pBidi, nVisPos, &nError ); + sal_uInt16 nLogPos = (sal_uInt16)ubidi_getLogicalIndex( pBidi, nVisPos, &nError ); aPaM.GetIndex() = pLine->GetStart() + nLogPos; // RTL portion, stay visually on the left side. - USHORT _nPortionStart; - - USHORT _nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), _nPortionStart, TRUE ); + sal_uInt16 _nPortionStart; + // sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), nPortionStart, !bRTLPortion ); + sal_uInt16 _nTextPortion = pParaPortion->GetTextPortions().FindPortion( aPaM.GetIndex(), _nPortionStart, sal_True ); TextPortion* _pTextPortion = pParaPortion->GetTextPortions().GetObject( _nTextPortion ); if ( bVisualToLeft && !bRTLPortion && ( _pTextPortion->GetRightToLeft() % 2 ) ) aPaM.GetIndex()++; @@ -1225,20 +1224,20 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM { aPaM = CursorUp( aPaM, pEditView ); if ( aPaM != rPaM ) - aPaM = CursorVisualStartEnd( pEditView, aPaM, FALSE ); + aPaM = CursorVisualStartEnd( pEditView, aPaM, sal_False ); } else if ( bGotoStartOfNextLine ) { aPaM = CursorDown( aPaM, pEditView ); if ( aPaM != rPaM ) - aPaM = CursorVisualStartEnd( pEditView, aPaM, TRUE ); + aPaM = CursorVisualStartEnd( pEditView, aPaM, sal_True ); } } return aPaM; } -EditPaM ImpEditEngine::CursorLeft( const EditPaM& rPaM, USHORT nCharacterIteratorMode ) +EditPaM ImpEditEngine::CursorLeft( const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode ) { EditPaM aCurPaM( rPaM ); EditPaM aNewPaM( aCurPaM ); @@ -1247,7 +1246,7 @@ EditPaM ImpEditEngine::CursorLeft( const EditPaM& rPaM, USHORT nCharacterIterato { sal_Int32 nCount = 1; uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() ); - aNewPaM.SetIndex( (USHORT)_xBI->previousCharacters( *aNewPaM.GetNode(), aNewPaM.GetIndex(), GetLocale( aNewPaM ), nCharacterIteratorMode, nCount, nCount ) ); + aNewPaM.SetIndex( (sal_uInt16)_xBI->previousCharacters( *aNewPaM.GetNode(), aNewPaM.GetIndex(), GetLocale( aNewPaM ), nCharacterIteratorMode, nCount, nCount ) ); } else { @@ -1263,7 +1262,7 @@ EditPaM ImpEditEngine::CursorLeft( const EditPaM& rPaM, USHORT nCharacterIterato return aNewPaM; } -EditPaM ImpEditEngine::CursorRight( const EditPaM& rPaM, USHORT nCharacterIteratorMode ) +EditPaM ImpEditEngine::CursorRight( const EditPaM& rPaM, sal_uInt16 nCharacterIteratorMode ) { EditPaM aCurPaM( rPaM ); EditPaM aNewPaM( aCurPaM ); @@ -1272,7 +1271,7 @@ EditPaM ImpEditEngine::CursorRight( const EditPaM& rPaM, USHORT nCharacterIterat { uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() ); sal_Int32 nCount = 1; - aNewPaM.SetIndex( (USHORT)_xBI->nextCharacters( *aNewPaM.GetNode(), aNewPaM.GetIndex(), GetLocale( aNewPaM ), nCharacterIteratorMode, nCount, nCount ) ); + aNewPaM.SetIndex( (sal_uInt16)_xBI->nextCharacters( *aNewPaM.GetNode(), aNewPaM.GetIndex(), GetLocale( aNewPaM ), nCharacterIteratorMode, nCount, nCount ) ); } else { @@ -1294,7 +1293,7 @@ EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, EditView* pView ) ParaPortion* pPPortion = FindParaPortion( rPaM.GetNode() ); DBG_ASSERT( pPPortion, "No matching portion found: CursorUp "); - USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex() ); + sal_uInt16 nLine = pPPortion->GetLineNumber( rPaM.GetIndex() ); EditLine* pLine = pPPortion->GetLines().GetObject( nLine ); long nX; @@ -1339,7 +1338,7 @@ EditPaM ImpEditEngine::CursorDown( const EditPaM& rPaM, EditView* pView ) ParaPortion* pPPortion = FindParaPortion( rPaM.GetNode() ); DBG_ASSERT( pPPortion, "No matching portion found: CursorDown" ); - USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex() ); + sal_uInt16 nLine = pPPortion->GetLineNumber( rPaM.GetIndex() ); long nX; if ( pView->pImpEditView->nTravelXPos == TRAVEL_X_DONTKNOW ) @@ -1383,7 +1382,7 @@ EditPaM ImpEditEngine::CursorStartOfLine( const EditPaM& rPaM ) { ParaPortion* pCurPortion = FindParaPortion( rPaM.GetNode() ); DBG_ASSERT( pCurPortion, "No Portion for the PaM ?" ); - USHORT nLine = pCurPortion->GetLineNumber( rPaM.GetIndex() ); + sal_uInt16 nLine = pCurPortion->GetLineNumber( rPaM.GetIndex() ); EditLine* pLine = pCurPortion->GetLines().GetObject(nLine); DBG_ASSERT( pLine, "Current line not found ?!" ); @@ -1396,7 +1395,7 @@ EditPaM ImpEditEngine::CursorEndOfLine( const EditPaM& rPaM ) { ParaPortion* pCurPortion = FindParaPortion( rPaM.GetNode() ); DBG_ASSERT( pCurPortion, "No Portion for the PaM ?" ); - USHORT nLine = pCurPortion->GetLineNumber( rPaM.GetIndex() ); + sal_uInt16 nLine = pCurPortion->GetLineNumber( rPaM.GetIndex() ); EditLine* pLine = pCurPortion->GetLines().GetObject(nLine); DBG_ASSERT( pLine, "Current line not found ?!" ); @@ -1487,12 +1486,12 @@ EditPaM ImpEditEngine::PageDown( const EditPaM& rPaM, EditView* pView ) EditPaM ImpEditEngine::WordLeft( const EditPaM& rPaM, sal_Int16 nWordType ) { - USHORT nCurrentPos = rPaM.GetIndex(); + sal_uInt16 nCurrentPos = rPaM.GetIndex(); EditPaM aNewPaM( rPaM ); if ( nCurrentPos == 0 ) { // Previous paragraph... - USHORT nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() ); + sal_uInt16 nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() ); ContentNode* pPrevNode = aEditDoc.SaveGetObject( --nCurPara ); if ( pPrevNode ) { @@ -1514,7 +1513,7 @@ EditPaM ImpEditEngine::WordLeft( const EditPaM& rPaM, sal_Int16 nWordType ) i18n::Boundary aBoundary = _xBI->getWordBoundary( *aNewPaM.GetNode(), nCurrentPos, aLocale, nWordType, sal_True ); if ( aBoundary.startPos >= nCurrentPos ) aBoundary = _xBI->previousWord( *aNewPaM.GetNode(), nCurrentPos, aLocale, nWordType ); - aNewPaM.SetIndex( ( aBoundary.startPos != (-1) ) ? (USHORT)aBoundary.startPos : 0 ); + aNewPaM.SetIndex( ( aBoundary.startPos != (-1) ) ? (sal_uInt16)aBoundary.startPos : 0 ); } return aNewPaM; @@ -1534,13 +1533,13 @@ EditPaM ImpEditEngine::WordRight( const EditPaM& rPaM, sal_Int16 nWordType ) uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() ); i18n::Boundary aBoundary = _xBI->nextWord( *aNewPaM.GetNode(), aNewPaM.GetIndex(), aLocale, nWordType ); - aNewPaM.SetIndex( (USHORT)aBoundary.startPos ); + aNewPaM.SetIndex( (sal_uInt16)aBoundary.startPos ); } // not 'else', maybe the index reached nMax now... if ( aNewPaM.GetIndex() >= nMax ) { // Next paragraph ... - USHORT nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() ); + sal_uInt16 nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() ); ContentNode* pNextNode = aEditDoc.SaveGetObject( ++nCurPara ); if ( pNextNode ) { @@ -1565,7 +1564,7 @@ EditPaM ImpEditEngine::StartOfWord( const EditPaM& rPaM, sal_Int16 nWordType ) uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() ); i18n::Boundary aBoundary = _xBI->getWordBoundary( *rPaM.GetNode(), rPaM.GetIndex(), aLocale, nWordType, sal_True ); - aNewPaM.SetIndex( (USHORT)aBoundary.startPos ); + aNewPaM.SetIndex( (sal_uInt16)aBoundary.startPos ); return aNewPaM; } @@ -1583,11 +1582,11 @@ EditPaM ImpEditEngine::EndOfWord( const EditPaM& rPaM, sal_Int16 nWordType ) uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() ); i18n::Boundary aBoundary = _xBI->getWordBoundary( *rPaM.GetNode(), rPaM.GetIndex(), aLocale, nWordType, sal_True ); - aNewPaM.SetIndex( (USHORT)aBoundary.endPos ); + aNewPaM.SetIndex( (sal_uInt16)aBoundary.endPos ); return aNewPaM; } -EditSelection ImpEditEngine::SelectWord( const EditSelection& rCurSel, sal_Int16 nWordType, BOOL bAcceptStartOfWord ) +EditSelection ImpEditEngine::SelectWord( const EditSelection& rCurSel, sal_Int16 nWordType, sal_Bool bAcceptStartOfWord ) { EditSelection aNewSel( rCurSel ); EditPaM aPaM( rCurSel.Max() ); @@ -1609,8 +1608,8 @@ EditSelection ImpEditEngine::SelectWord( const EditSelection& rCurSel, sal_Int16 if ( ( aBoundary.endPos > aPaM.GetIndex() ) && ( ( aBoundary.startPos < aPaM.GetIndex() ) || ( bAcceptStartOfWord && ( aBoundary.startPos == aPaM.GetIndex() ) ) ) ) { - aNewSel.Min().SetIndex( (USHORT)aBoundary.startPos ); - aNewSel.Max().SetIndex( (USHORT)aBoundary.endPos ); + aNewSel.Min().SetIndex( (sal_uInt16)aBoundary.startPos ); + aNewSel.Max().SetIndex( (sal_uInt16)aBoundary.endPos ); } } @@ -1631,8 +1630,8 @@ EditSelection ImpEditEngine::SelectSentence( const EditSelection& rCurSel ) long nEnd = _xBI->endOfSentence( *pNode, rPaM.GetIndex(), GetLocale( rPaM ) ); EditSelection aNewSel( rCurSel ); DBG_ASSERT(nStart < pNode->Len() && nEnd <= pNode->Len(), "sentence indices out of range"); - aNewSel.Min().SetIndex( (USHORT)nStart ); - aNewSel.Max().SetIndex( (USHORT)nEnd ); + aNewSel.Min().SetIndex( (sal_uInt16)nStart ); + aNewSel.Max().SetIndex( (sal_uInt16)nEnd ); return aNewSel; } @@ -1643,8 +1642,8 @@ sal_Bool ImpEditEngine::IsInputSequenceCheckingRequired( sal_Unicode nChar, cons pCTLOptions = new SvtCTLOptions; // get the index that really is first - USHORT nFirstPos = rCurSel.Min().GetIndex(); - USHORT nMaxPos = rCurSel.Max().GetIndex(); + sal_uInt16 nFirstPos = rCurSel.Min().GetIndex(); + sal_uInt16 nMaxPos = rCurSel.Max().GetIndex(); if (nMaxPos < nFirstPos) nFirstPos = nMaxPos; @@ -1672,7 +1671,7 @@ sal_Bool ImpEditEngine::IsInputSequenceCheckingRequired( sal_Unicode nChar, cons -void ImpEditEngine::InitScriptTypes( USHORT nPara ) +void ImpEditEngine::InitScriptTypes( sal_uInt16 nPara ) { ParaPortion* pParaPortion = GetParaPortions().SaveGetObject( nPara ); ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos; @@ -1696,7 +1695,7 @@ void ImpEditEngine::InitScriptTypes( USHORT nPara ) aText.SetChar( pField->GetStart(), aFldText.getStr()[0] ); short nFldScriptType = _xBI->getScriptType( aFldText, 0 ); - for ( USHORT nCharInField = 1; nCharInField < aFldText.getLength(); nCharInField++ ) + for ( sal_uInt16 nCharInField = 1; nCharInField < aFldText.getLength(); nCharInField++ ) { short nTmpType = _xBI->getScriptType( aFldText, nCharInField ); @@ -1721,23 +1720,23 @@ void ImpEditEngine::InitScriptTypes( USHORT nPara ) } ::rtl::OUString aOUText( aText ); - USHORT nTextLen = (USHORT)aOUText.getLength(); + sal_uInt16 nTextLen = (sal_uInt16)aOUText.getLength(); sal_Int32 nPos = 0; short nScriptType = _xBI->getScriptType( aOUText, nPos ); - rTypes.Insert( ScriptTypePosInfo( nScriptType, (USHORT)nPos, nTextLen ), rTypes.Count() ); + rTypes.push_back( ScriptTypePosInfo( nScriptType, (sal_uInt16)nPos, nTextLen ) ); nPos = _xBI->endOfScript( aOUText, nPos, nScriptType ); while ( ( nPos != (-1) ) && ( nPos < nTextLen ) ) { - rTypes[rTypes.Count()-1].nEndPos = (USHORT)nPos; + rTypes.back().nEndPos = (sal_uInt16)nPos; nScriptType = _xBI->getScriptType( aOUText, nPos ); long nEndPos = _xBI->endOfScript( aOUText, nPos, nScriptType ); - if ( ( nScriptType == i18n::ScriptType::WEAK ) || ( nScriptType == rTypes[rTypes.Count()-1].nScriptType ) ) + if ( ( nScriptType == i18n::ScriptType::WEAK ) || ( nScriptType == rTypes.back().nScriptType ) ) { // Expand last ScriptTypePosInfo, don't create weak or unecessary portions - rTypes[rTypes.Count()-1].nEndPos = (USHORT)nEndPos; + rTypes.back().nEndPos = (sal_uInt16)nEndPos; } else { @@ -1748,67 +1747,67 @@ void ImpEditEngine::InitScriptTypes( USHORT nPara ) case U_ENCLOSING_MARK: case U_COMBINING_SPACING_MARK: --nPos; - rTypes[rTypes.Count()-1].nEndPos--; + rTypes.back().nEndPos--; break; } } - rTypes.Insert( ScriptTypePosInfo( nScriptType, (USHORT)nPos, nTextLen ), rTypes.Count() ); + rTypes.push_back( ScriptTypePosInfo( nScriptType, (sal_uInt16)nPos, nTextLen ) ); } nPos = nEndPos; } if ( rTypes[0].nScriptType == i18n::ScriptType::WEAK ) - rTypes[0].nScriptType = ( rTypes.Count() > 1 ) ? rTypes[1].nScriptType : GetI18NScriptTypeOfLanguage( GetDefaultLanguage() ); + rTypes[0].nScriptType = ( rTypes.size() > 1 ) ? rTypes[1].nScriptType : GetI18NScriptTypeOfLanguage( GetDefaultLanguage() ); // create writing direction information: - if ( !pParaPortion->aWritingDirectionInfos.Count() ) + if ( pParaPortion->aWritingDirectionInfos.empty() ) InitWritingDirections( nPara ); // i89825: Use CTL font for numbers embedded into an RTL run: WritingDirectionInfos& rDirInfos = pParaPortion->aWritingDirectionInfos; - for ( USHORT n = 0; n < rDirInfos.Count(); ++n ) + for ( size_t n = 0; n < rDirInfos.size(); ++n ) { const xub_StrLen nStart = rDirInfos[n].nStartPos; const xub_StrLen nEnd = rDirInfos[n].nEndPos; - const BYTE nCurrDirType = rDirInfos[n].nType; + const sal_uInt8 nCurrDirType = rDirInfos[n].nType; if ( nCurrDirType % 2 == UBIDI_RTL || // text in RTL run ( nCurrDirType > UBIDI_LTR && !lcl_HasStrongLTR( aText, nStart, nEnd ) ) ) // non-strong text in embedded LTR run { - USHORT nIdx = 0; + size_t nIdx = 0; // Skip entries in ScriptArray which are not inside the RTL run: - while ( nIdx < rTypes.Count() && rTypes[nIdx].nStartPos < nStart ) + while ( nIdx < rTypes.size() && rTypes[nIdx].nStartPos < nStart ) ++nIdx; // Remove any entries *inside* the current run: - while ( nIdx < rTypes.Count() && rTypes[nIdx].nEndPos <= nEnd ) - rTypes.Remove( nIdx ); + while ( nIdx < rTypes.size() && rTypes[nIdx].nEndPos <= nEnd ) + rTypes.erase( rTypes.begin()+nIdx ); // special case: - if(nIdx < rTypes.Count() && rTypes[nIdx].nStartPos < nStart && rTypes[nIdx].nEndPos > nEnd) + if(nIdx < rTypes.size() && rTypes[nIdx].nStartPos < nStart && rTypes[nIdx].nEndPos > nEnd) { - rTypes.Insert( ScriptTypePosInfo( rTypes[nIdx].nScriptType, (USHORT)nEnd, rTypes[nIdx].nEndPos ), nIdx ); + rTypes.insert( rTypes.begin()+nIdx, ScriptTypePosInfo( rTypes[nIdx].nScriptType, (sal_uInt16)nEnd, rTypes[nIdx].nEndPos ) ); rTypes[nIdx].nEndPos = nStart; } if( nIdx ) rTypes[nIdx - 1].nEndPos = nStart; - rTypes.Insert( ScriptTypePosInfo( i18n::ScriptType::COMPLEX, (USHORT)nStart, (USHORT)nEnd), nIdx ); + rTypes.insert( rTypes.begin()+nIdx, ScriptTypePosInfo( i18n::ScriptType::COMPLEX, (sal_uInt16)nStart, (sal_uInt16)nEnd) ); ++nIdx; - if( nIdx < rTypes.Count() ) + if( nIdx < rTypes.size() ) rTypes[nIdx].nStartPos = nEnd; } } #if OSL_DEBUG_LEVEL > 1 - USHORT nDebugStt = 0; - USHORT nDebugEnd = 0; + sal_uInt16 nDebugStt = 0; + sal_uInt16 nDebugEnd = 0; short nDebugType = 0; - for ( USHORT n = 0; n < rTypes.Count(); ++n ) + for ( size_t n = 0; n < rTypes.size(); ++n ) { nDebugStt = rTypes[n].nStartPos; nDebugEnd = rTypes[n].nEndPos; @@ -1818,23 +1817,23 @@ void ImpEditEngine::InitScriptTypes( USHORT nPara ) } } -USHORT ImpEditEngine::GetScriptType( const EditPaM& rPaM, USHORT* pEndPos ) const +sal_uInt16 ImpEditEngine::GetScriptType( const EditPaM& rPaM, sal_uInt16* pEndPos ) const { - USHORT nScriptType = 0; + sal_uInt16 nScriptType = 0; if ( pEndPos ) *pEndPos = rPaM.GetNode()->Len(); if ( rPaM.GetNode()->Len() ) { - USHORT nPara = GetEditDoc().GetPos( rPaM.GetNode() ); + sal_uInt16 nPara = GetEditDoc().GetPos( rPaM.GetNode() ); ParaPortion* pParaPortion = GetParaPortions().SaveGetObject( nPara ); - if ( !pParaPortion->aScriptInfos.Count() ) + if ( pParaPortion->aScriptInfos.empty() ) ((ImpEditEngine*)this)->InitScriptTypes( nPara ); ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos; - USHORT nPos = rPaM.GetIndex(); - for ( USHORT n = 0; n < rTypes.Count(); n++ ) + sal_uInt16 nPos = rPaM.GetIndex(); + for ( size_t n = 0; n < rTypes.size(); n++ ) { if ( ( rTypes[n].nStartPos <= nPos ) && ( rTypes[n].nEndPos >= nPos ) ) { @@ -1848,20 +1847,20 @@ USHORT ImpEditEngine::GetScriptType( const EditPaM& rPaM, USHORT* pEndPos ) cons return nScriptType ? nScriptType : GetI18NScriptTypeOfLanguage( GetDefaultLanguage() ); } -USHORT ImpEditEngine::GetScriptType( const EditSelection& rSel ) const +sal_uInt16 ImpEditEngine::GetScriptType( const EditSelection& rSel ) const { EditSelection aSel( rSel ); aSel.Adjust( aEditDoc ); short nScriptType = 0; - USHORT nStartPara = GetEditDoc().GetPos( aSel.Min().GetNode() ); - USHORT nEndPara = GetEditDoc().GetPos( aSel.Max().GetNode() ); + sal_uInt16 nStartPara = GetEditDoc().GetPos( aSel.Min().GetNode() ); + sal_uInt16 nEndPara = GetEditDoc().GetPos( aSel.Max().GetNode() ); - for ( USHORT nPara = nStartPara; nPara <= nEndPara; nPara++ ) + for ( sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++ ) { ParaPortion* pParaPortion = GetParaPortions().SaveGetObject( nPara ); - if ( !pParaPortion->aScriptInfos.Count() ) + if ( pParaPortion->aScriptInfos.empty() ) ((ImpEditEngine*)this)->InitScriptTypes( nPara ); ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos; @@ -1869,9 +1868,9 @@ USHORT ImpEditEngine::GetScriptType( const EditSelection& rSel ) const // find the first(!) script type position that holds the // complete selection. Thus it will work for selections as // well as with just moving the cursor from char to char. - USHORT nS = ( nPara == nStartPara ) ? aSel.Min().GetIndex() : 0; - USHORT nE = ( nPara == nEndPara ) ? aSel.Max().GetIndex() : pParaPortion->GetNode()->Len(); - for ( USHORT n = 0; n < rTypes.Count(); n++ ) + sal_uInt16 nS = ( nPara == nStartPara ) ? aSel.Min().GetIndex() : 0; + sal_uInt16 nE = ( nPara == nEndPara ) ? aSel.Max().GetIndex() : pParaPortion->GetNode()->Len(); + for ( size_t n = 0; n < rTypes.size(); n++ ) { if (rTypes[n].nStartPos <= nS && nE <= rTypes[n].nEndPos) { @@ -1894,24 +1893,24 @@ USHORT ImpEditEngine::GetScriptType( const EditSelection& rSel ) const return nScriptType ? nScriptType : GetI18NScriptTypeOfLanguage( GetDefaultLanguage() ); } -BOOL ImpEditEngine::IsScriptChange( const EditPaM& rPaM ) const +sal_Bool ImpEditEngine::IsScriptChange( const EditPaM& rPaM ) const { - BOOL bScriptChange = FALSE; + sal_Bool bScriptChange = sal_False; if ( rPaM.GetNode()->Len() ) { - USHORT nPara = GetEditDoc().GetPos( rPaM.GetNode() ); + sal_uInt16 nPara = GetEditDoc().GetPos( rPaM.GetNode() ); ParaPortion* pParaPortion = GetParaPortions().SaveGetObject( nPara ); - if ( !pParaPortion->aScriptInfos.Count() ) + if ( pParaPortion->aScriptInfos.empty() ) ((ImpEditEngine*)this)->InitScriptTypes( nPara ); ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos; - USHORT nPos = rPaM.GetIndex(); - for ( USHORT n = 0; n < rTypes.Count(); n++ ) + sal_uInt16 nPos = rPaM.GetIndex(); + for ( size_t n = 0; n < rTypes.size(); n++ ) { if ( rTypes[n].nStartPos == nPos ) { - bScriptChange = TRUE; + bScriptChange = sal_True; break; } } @@ -1919,36 +1918,36 @@ BOOL ImpEditEngine::IsScriptChange( const EditPaM& rPaM ) const return bScriptChange; } -BOOL ImpEditEngine::HasScriptType( USHORT nPara, USHORT nType ) const +sal_Bool ImpEditEngine::HasScriptType( sal_uInt16 nPara, sal_uInt16 nType ) const { - BOOL bTypeFound = FALSE; + sal_Bool bTypeFound = sal_False; ParaPortion* pParaPortion = GetParaPortions().SaveGetObject( nPara ); - if ( !pParaPortion->aScriptInfos.Count() ) + if ( pParaPortion->aScriptInfos.empty() ) ((ImpEditEngine*)this)->InitScriptTypes( nPara ); ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos; - for ( USHORT n = rTypes.Count(); n && !bTypeFound; ) + for ( size_t n = rTypes.size(); n && !bTypeFound; ) { if ( rTypes[--n].nScriptType == nType ) - bTypeFound = TRUE; + bTypeFound = sal_True; } return bTypeFound; } -void ImpEditEngine::InitWritingDirections( USHORT nPara ) +void ImpEditEngine::InitWritingDirections( sal_uInt16 nPara ) { ParaPortion* pParaPortion = GetParaPortions().SaveGetObject( nPara ); WritingDirectionInfos& rInfos = pParaPortion->aWritingDirectionInfos; - rInfos.Remove( 0, rInfos.Count() ); + rInfos.clear(); - BOOL bCTL = FALSE; + sal_Bool bCTL = sal_False; ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos; - for ( USHORT n = 0; n < rTypes.Count(); n++ ) + for ( size_t n = 0; n < rTypes.size(); n++ ) { if ( rTypes[n].nScriptType == i18n::ScriptType::COMPLEX ) { - bCTL = TRUE; + bCTL = sal_True; break; } } @@ -1969,16 +1968,16 @@ void ImpEditEngine::InitWritingDirections( USHORT nPara ) ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(aText.GetBuffer()), aText.Len(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW nError = U_ZERO_ERROR; - long nCount = ubidi_countRuns( pBidi, &nError ); + size_t nCount = ubidi_countRuns( pBidi, &nError ); int32_t nStart = 0; int32_t nEnd; UBiDiLevel nCurrDir; - for ( USHORT nIdx = 0; nIdx < nCount; ++nIdx ) + for ( size_t nIdx = 0; nIdx < nCount; ++nIdx ) { ubidi_getLogicalRun( pBidi, nStart, &nEnd, &nCurrDir ); - rInfos.Insert( WritingDirectionInfo( nCurrDir, (USHORT)nStart, (USHORT)nEnd ), rInfos.Count() ); + rInfos.push_back( WritingDirectionInfo( nCurrDir, (sal_uInt16)nStart, (sal_uInt16)nEnd ) ); nStart = nEnd; } @@ -1986,14 +1985,14 @@ void ImpEditEngine::InitWritingDirections( USHORT nPara ) } // No infos mean no CTL and default dir is L2R... - if ( !rInfos.Count() ) - rInfos.Insert( WritingDirectionInfo( 0, 0, (USHORT)pParaPortion->GetNode()->Len() ), rInfos.Count() ); + if ( rInfos.empty() ) + rInfos.push_back( WritingDirectionInfo( 0, 0, (sal_uInt16)pParaPortion->GetNode()->Len() ) ); } -BOOL ImpEditEngine::IsRightToLeft( USHORT nPara ) const +sal_Bool ImpEditEngine::IsRightToLeft( sal_uInt16 nPara ) const { - BOOL bR2L = FALSE; + sal_Bool bR2L = sal_False; const SvxFrameDirectionItem* pFrameDirItem = NULL; if ( !IsVertical() ) @@ -2021,20 +2020,20 @@ BOOL ImpEditEngine::IsRightToLeft( USHORT nPara ) const return bR2L; } -BOOL ImpEditEngine::HasDifferentRTLLevels( const ContentNode* pNode ) +sal_Bool ImpEditEngine::HasDifferentRTLLevels( const ContentNode* pNode ) { - USHORT nPara = GetEditDoc().GetPos( (ContentNode*)pNode ); + sal_uInt16 nPara = GetEditDoc().GetPos( (ContentNode*)pNode ); ParaPortion* pParaPortion = GetParaPortions().SaveGetObject( nPara ); - BOOL bHasDifferentRTLLevels = FALSE; + sal_Bool bHasDifferentRTLLevels = sal_False; - USHORT nRTLLevel = IsRightToLeft( nPara ) ? 1 : 0; - for ( USHORT n = 0; n < pParaPortion->GetTextPortions().Count(); n++ ) + sal_uInt16 nRTLLevel = IsRightToLeft( nPara ) ? 1 : 0; + for ( sal_uInt16 n = 0; n < pParaPortion->GetTextPortions().Count(); n++ ) { TextPortion* pTextPortion = pParaPortion->GetTextPortions().GetObject( n ); if ( pTextPortion->GetRightToLeft() != nRTLLevel ) { - bHasDifferentRTLLevels = TRUE; + bHasDifferentRTLLevels = sal_True; break; } } @@ -2042,19 +2041,19 @@ BOOL ImpEditEngine::HasDifferentRTLLevels( const ContentNode* pNode ) } -BYTE ImpEditEngine::GetRightToLeft( USHORT nPara, USHORT nPos, USHORT* pStart, USHORT* pEnd ) +sal_uInt8 ImpEditEngine::GetRightToLeft( sal_uInt16 nPara, sal_uInt16 nPos, sal_uInt16* pStart, sal_uInt16* pEnd ) { - BYTE nRightToLeft = 0; + sal_uInt8 nRightToLeft = 0; ContentNode* pNode = aEditDoc.SaveGetObject( nPara ); if ( pNode && pNode->Len() ) { ParaPortion* pParaPortion = GetParaPortions().SaveGetObject( nPara ); - if ( !pParaPortion->aWritingDirectionInfos.Count() ) + if ( pParaPortion->aWritingDirectionInfos.empty() ) InitWritingDirections( nPara ); WritingDirectionInfos& rDirInfos = pParaPortion->aWritingDirectionInfos; - for ( USHORT n = 0; n < rDirInfos.Count(); n++ ) + for ( size_t n = 0; n < rDirInfos.size(); n++ ) { if ( ( rDirInfos[n].nStartPos <= nPos ) && ( rDirInfos[n].nEndPos >= nPos ) ) { @@ -2070,7 +2069,7 @@ BYTE ImpEditEngine::GetRightToLeft( USHORT nPara, USHORT nPos, USHORT* pStart, U return nRightToLeft; } -SvxAdjust ImpEditEngine::GetJustification( USHORT nPara ) const +SvxAdjust ImpEditEngine::GetJustification( sal_uInt16 nPara ) const { SvxAdjust eJustification = SVX_ADJUST_LEFT; @@ -2107,18 +2106,17 @@ SvxCellVerJustify ImpEditEngine::GetVerJustification( USHORT nPara ) const // Text changes // ---------------------------------------------------------------------- -void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, USHORT nChars, EditUndoRemoveChars* pCurUndo ) +void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, sal_uInt16 nChars, EditUndoRemoveChars* pCurUndo ) { if ( IsUndoEnabled() && !IsInUndo() ) { XubString aStr( rPaM.GetNode()->Copy( rPaM.GetIndex(), nChars ) ); // Check whether attributes are deleted or changed: - USHORT nStart = rPaM.GetIndex(); - USHORT nEnd = nStart + nChars; + sal_uInt16 nStart = rPaM.GetIndex(); + sal_uInt16 nEnd = nStart + nChars; CharAttribArray& rAttribs = rPaM.GetNode()->GetCharAttribs().GetAttribs(); - - for ( USHORT nAttr = 0; nAttr < rAttribs.Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < rAttribs.Count(); nAttr++ ) { EditCharAttrib* pAttr = rAttribs[nAttr]; if ( ( pAttr->GetEnd() >= nStart ) && ( pAttr->GetStart() < nEnd ) ) @@ -2144,10 +2142,10 @@ void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, USHORT nChars, EditUndo TextModified(); } -EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNewPos ) +EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_uInt16 nNewPos ) { aOldPositions.Justify(); - BOOL bValidAction = ( (long)nNewPos < aOldPositions.Min() ) || ( (long)nNewPos > aOldPositions.Max() ); + sal_Bool bValidAction = ( (long)nNewPos < aOldPositions.Min() ) || ( (long)nNewPos > aOldPositions.Max() ); DBG_ASSERT( bValidAction, "Move in itself?" ); DBG_ASSERT( aOldPositions.Max() <= (long)GetParaPortions().Count(), "totally over it: MoveParagraphs" ); @@ -2159,7 +2157,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNew return aSelection; } - ULONG nParaCount = GetParaPortions().Count(); + sal_uLong nParaCount = GetParaPortions().Count(); if ( nNewPos >= nParaCount ) nNewPos = GetParaPortions().Count(); @@ -2173,28 +2171,28 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNew if ( nNewPos == 0 ) // Move to Start { pRecalc1 = GetParaPortions().GetObject( 0 ); - pRecalc2 = GetParaPortions().GetObject( (USHORT)aOldPositions.Min() ); + pRecalc2 = GetParaPortions().GetObject( (sal_uInt16)aOldPositions.Min() ); } else if ( nNewPos == nParaCount ) { - pRecalc1 = GetParaPortions().GetObject( (USHORT)(nParaCount-1) ); - pRecalc2 = GetParaPortions().GetObject( (USHORT)aOldPositions.Max() ); + pRecalc1 = GetParaPortions().GetObject( (sal_uInt16)(nParaCount-1) ); + pRecalc2 = GetParaPortions().GetObject( (sal_uInt16)aOldPositions.Max() ); } if ( aOldPositions.Min() == 0 ) // Move from Start { pRecalc3 = GetParaPortions().GetObject( 0 ); pRecalc4 = GetParaPortions().GetObject( - sal::static_int_cast< USHORT >( aOldPositions.Max()+1 ) ); + sal::static_int_cast< sal_uInt16 >( aOldPositions.Max()+1 ) ); } - else if ( (USHORT)aOldPositions.Max() == (nParaCount-1) ) + else if ( (sal_uInt16)aOldPositions.Max() == (nParaCount-1) ) { - pRecalc3 = GetParaPortions().GetObject( (USHORT)aOldPositions.Max() ); - pRecalc4 = GetParaPortions().GetObject( (USHORT)(aOldPositions.Min()-1) ); + pRecalc3 = GetParaPortions().GetObject( (sal_uInt16)aOldPositions.Max() ); + pRecalc4 = GetParaPortions().GetObject( (sal_uInt16)(aOldPositions.Min()-1) ); } - MoveParagraphsInfo aMoveParagraphsInfo( sal::static_int_cast< USHORT >(aOldPositions.Min()), sal::static_int_cast< USHORT >(aOldPositions.Max()), nNewPos ); + MoveParagraphsInfo aMoveParagraphsInfo( sal::static_int_cast< sal_uInt16 >(aOldPositions.Min()), sal::static_int_cast< sal_uInt16 >(aOldPositions.Max()), nNewPos ); aBeginMovingParagraphsHdl.Call( &aMoveParagraphsInfo ); if ( IsUndoEnabled() && !IsInUndo()) @@ -2204,20 +2202,20 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNew ParaPortion* pDestPortion = GetParaPortions().SaveGetObject( nNewPos ); ParaPortionList aTmpPortionList; - USHORT i; - for ( i = (USHORT)aOldPositions.Min(); i <= (USHORT)aOldPositions.Max(); i++ ) + sal_uInt16 i; + for ( i = (sal_uInt16)aOldPositions.Min(); i <= (sal_uInt16)aOldPositions.Max(); i++ ) { // always aOldPositions.Min(), since Remove(). - ParaPortion* pTmpPortion = GetParaPortions().GetObject( (USHORT)aOldPositions.Min() ); - GetParaPortions().Remove( (USHORT)aOldPositions.Min() ); - aEditDoc.Remove( (USHORT)aOldPositions.Min() ); + ParaPortion* pTmpPortion = GetParaPortions().GetObject( (sal_uInt16)aOldPositions.Min() ); + GetParaPortions().Remove( (sal_uInt16)aOldPositions.Min() ); + aEditDoc.Remove( (sal_uInt16)aOldPositions.Min() ); aTmpPortionList.Insert( pTmpPortion, aTmpPortionList.Count() ); } - USHORT nRealNewPos = pDestPortion ? GetParaPortions().GetPos( pDestPortion ) : GetParaPortions().Count(); + sal_uInt16 nRealNewPos = pDestPortion ? GetParaPortions().GetPos( pDestPortion ) : GetParaPortions().Count(); DBG_ASSERT( nRealNewPos != USHRT_MAX, "ImpMoveParagraphs: Invalid Position!" ); - for ( i = 0; i < (USHORT)aTmpPortionList.Count(); i++ ) + for ( i = 0; i < (sal_uInt16)aTmpPortionList.Count(); i++ ) { ParaPortion* pTmpPortion = aTmpPortionList.GetObject( i ); if ( i == 0 ) @@ -2239,12 +2237,12 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNew EENotify aNotify( EE_NOTIFY_PARAGRAPHSMOVED ); aNotify.pEditEngine = GetEditEnginePtr(); aNotify.nParagraph = nNewPos; - aNotify.nParam1 = sal::static_int_cast< USHORT >(aOldPositions.Min()); - aNotify.nParam2 = sal::static_int_cast< USHORT >(aOldPositions.Max()); + aNotify.nParam1 = sal::static_int_cast< sal_uInt16 >(aOldPositions.Min()); + aNotify.nParam2 = sal::static_int_cast< sal_uInt16 >(aOldPositions.Max()); CallNotify( aNotify ); } - aEditDoc.SetModified( TRUE ); + aEditDoc.SetModified( sal_True ); if ( pRecalc1 ) CalcHeight( pRecalc1 ); @@ -2264,14 +2262,14 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, USHORT nNew } -EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, BOOL bBackward ) +EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, sal_Bool bBackward ) { DBG_ASSERT( pLeft != pRight, "Join together the same paragraph ?" ); DBG_ASSERT( aEditDoc.GetPos( pLeft ) != USHRT_MAX, "Inserted node not found (1)" ); DBG_ASSERT( aEditDoc.GetPos( pRight ) != USHRT_MAX, "Inserted node not found (2)" ); - USHORT nParagraphTobeDeleted = aEditDoc.GetPos( pRight ); - DeletedNodeInfo* pInf = new DeletedNodeInfo( (ULONG)pRight, nParagraphTobeDeleted ); + sal_uInt16 nParagraphTobeDeleted = aEditDoc.GetPos( pRight ); + DeletedNodeInfo* pInf = new DeletedNodeInfo( (sal_uLong)pRight, nParagraphTobeDeleted ); aDeletedNodes.Insert( pInf, aDeletedNodes.Count() ); GetEditEnginePtr()->ParagraphConnected( aEditDoc.GetPos( pLeft ), aEditDoc.GetPos( pRight ) ); @@ -2288,7 +2286,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR if ( bBackward ) { - pLeft->SetStyleSheet( pRight->GetStyleSheet(), TRUE ); + pLeft->SetStyleSheet( pRight->GetStyleSheet(), sal_True ); pLeft->GetContentAttribs().GetItems().Set( pRight->GetContentAttribs().GetItems() ); pLeft->GetCharAttribs().GetDefFont() = pRight->GetCharAttribs().GetDefFont(); } @@ -2310,8 +2308,8 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR pLeft->GetWrongList()->ClearWrongs( nInv, 0xFFFF, pLeft ); // Possibly remove one pLeft->GetWrongList()->MarkInvalid( nInv, nEnd+1 ); // Take over misspelled words - USHORT nRWrongs = pRight->GetWrongList()->Count(); - for ( USHORT nW = 0; nW < nRWrongs; nW++ ) + sal_uInt16 nRWrongs = pRight->GetWrongList()->Count(); + for ( sal_uInt16 nW = 0; nW < nRWrongs; nW++ ) { WrongRange aWrong = pRight->GetWrongList()->GetObject( nW ); if ( aWrong.nStart != 0 ) // Not a subsequent @@ -2339,7 +2337,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR // By joining together the two, the left is although reformatted, // however if its height does not change then the formatting receives // the change of the total text hight too late... - for ( USHORT n = nParagraphTobeDeleted; n < GetParaPortions().Count(); n++ ) + for ( sal_uInt16 n = nParagraphTobeDeleted; n < GetParaPortions().Count(); n++ ) { ParaPortion* pPP = GetParaPortions().GetObject( n ); pPP->MarkSelectionInvalid( 0, pPP->GetNode()->Len() ); @@ -2352,7 +2350,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR return aPaM; } -EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, BYTE nMode, BYTE nDelMode ) +EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 nMode, sal_uInt8 nDelMode ) { DBG_ASSERT( !EditSelection( rSel ).DbgIsBuggy( aEditDoc ), "Index out of range in DeleteLeftOrRight" ); @@ -2429,10 +2427,10 @@ EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, BYTE nMode, return ImpDeleteSelection( EditSelection( aDelStart, aDelEnd ) ); // Decide now if to delete selection (RESTOFCONTENTS) - BOOL bSpecialBackward = ( ( nMode == DEL_LEFT ) && ( nDelMode == DELMODE_SIMPLE ) ) - ? TRUE : FALSE; + sal_Bool bSpecialBackward = ( ( nMode == DEL_LEFT ) && ( nDelMode == DELMODE_SIMPLE ) ) + ? sal_True : sal_False; if ( aStatus.IsAnyOutliner() ) - bSpecialBackward = FALSE; + bSpecialBackward = sal_False; return ImpConnectParagraphs( aDelStart.GetNode(), aDelEnd.GetNode(), bSpecialBackward ); } @@ -2452,14 +2450,14 @@ EditPaM ImpEditEngine::ImpDeleteSelection( EditSelection aSel ) DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index out of range in ImpDeleteSelection" ); DBG_ASSERT( aEndPaM.GetIndex() <= aEndPaM.GetNode()->Len(), "Index out of range in ImpDeleteSelection" ); - USHORT nStartNode = aEditDoc.GetPos( aStartPaM.GetNode() ); - USHORT nEndNode = aEditDoc.GetPos( aEndPaM.GetNode() ); + sal_uInt16 nStartNode = aEditDoc.GetPos( aStartPaM.GetNode() ); + sal_uInt16 nEndNode = aEditDoc.GetPos( aEndPaM.GetNode() ); DBG_ASSERT( nEndNode != USHRT_MAX, "Start > End ?!" ); DBG_ASSERT( nStartNode <= nEndNode, "Start > End ?!" ); // Remove all nodes in between .... - for ( ULONG z = nStartNode+1; z < nEndNode; z++ ) + for ( sal_uLong z = nStartNode+1; z < nEndNode; z++ ) { // Always nStartNode+1, due to Remove()! ImpRemoveParagraph( nStartNode+1 ); @@ -2468,7 +2466,7 @@ EditPaM ImpEditEngine::ImpDeleteSelection( EditSelection aSel ) if ( aStartPaM.GetNode() != aEndPaM.GetNode() ) { // The Rest of the StartNodes... - USHORT nChars; + sal_uInt16 nChars; nChars = aStartPaM.GetNode()->Len() - aStartPaM.GetIndex(); ImpRemoveChars( aStartPaM, nChars ); ParaPortion* pPortion = FindParaPortion( aStartPaM.GetNode() ); @@ -2487,7 +2485,7 @@ EditPaM ImpEditEngine::ImpDeleteSelection( EditSelection aSel ) } else { - USHORT nChars; + sal_uInt16 nChars; nChars = aEndPaM.GetIndex() - aStartPaM.GetIndex(); ImpRemoveChars( aStartPaM, nChars ); ParaPortion* pPortion = FindParaPortion( aStartPaM.GetNode() ); @@ -2500,7 +2498,7 @@ EditPaM ImpEditEngine::ImpDeleteSelection( EditSelection aSel ) return aStartPaM; } -void ImpEditEngine::ImpRemoveParagraph( USHORT nPara ) +void ImpEditEngine::ImpRemoveParagraph( sal_uInt16 nPara ) { ContentNode* pNode = aEditDoc.SaveGetObject( nPara ); ContentNode* pNextNode = aEditDoc.SaveGetObject( nPara+1 ); @@ -2509,7 +2507,7 @@ void ImpEditEngine::ImpRemoveParagraph( USHORT nPara ) DBG_ASSERT( pNode, "Blind Node in ImpRemoveParagraph" ); DBG_ASSERT( pPortion, "Blind Portion in ImpRemoveParagraph(2)" ); - DeletedNodeInfo* pInf = new DeletedNodeInfo( (ULONG)pNode, nPara ); + DeletedNodeInfo* pInf = new DeletedNodeInfo( (sal_uLong)pNode, nPara ); aDeletedNodes.Insert( pInf, aDeletedNodes.Count() ); // The node is managed by the undo and possibly destroyed! @@ -2536,7 +2534,7 @@ void ImpEditEngine::ImpRemoveParagraph( USHORT nPara ) { aEditDoc.RemoveItemsFromPool( pNode ); if ( pNode->GetStyleSheet() ) - EndListening( *pNode->GetStyleSheet(), FALSE ); + EndListening( *pNode->GetStyleSheet(), sal_False ); delete pNode; } } @@ -2554,8 +2552,8 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, xub_Unicode c, // #i78661 allow application to turn off capitalization of // start sentence explicitly. - // (This is done by setting IsFirstWordCapitalization to FALSE.) - BOOL bOldCptlSttSntnc = pAutoCorrect->IsAutoCorrFlag( CptlSttSntnc ); + // (This is done by setting IsFirstWordCapitalization to sal_False.) + sal_Bool bOldCptlSttSntnc = pAutoCorrect->IsAutoCorrFlag( CptlSttSntnc ); if (!IsFirstWordCapitalization()) { ESelection aESel( CreateESel(aSel) ); @@ -2581,7 +2579,7 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, xub_Unicode c, EditPaM aRight2Word( WordRight( aFirstWordSel.Max(), 1 ) ); aSecondWordSel = SelectWord( EditSelection( aRight2Word ) ); } - BOOL bIsFirstWordInFirstPara = aESel.nEndPara == 0 && + sal_Bool bIsFirstWordInFirstPara = aESel.nEndPara == 0 && aFirstWordSel.Max().GetIndex() <= aSel.Max().GetIndex() && aSel.Max().GetIndex() <= aSecondWordSel.Min().GetIndex(); @@ -2590,7 +2588,7 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, xub_Unicode c, } ContentNode* pNode = aSel.Max().GetNode(); - USHORT nIndex = aSel.Max().GetIndex(); + sal_uInt16 nIndex = aSel.Max().GetIndex(); EdtAutoCorrDoc aAuto( this, pNode, nIndex, c ); pAutoCorrect->AutoCorrect( aAuto, *pNode, nIndex, c, !bOverwrite, pFrameWin ); aSel.Max().SetIndex( aAuto.GetCursor() ); @@ -2605,17 +2603,17 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, xub_Unicode c, EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel, - xub_Unicode c, BOOL bOverwrite, sal_Bool bIsUserInput ) + xub_Unicode c, sal_Bool bOverwrite, sal_Bool bIsUserInput ) { DBG_ASSERT( c != '\t', "Tab for InsertText ?" ); DBG_ASSERT( c != '\n', "Word wrapping for InsertText ?"); EditPaM aPaM( rCurSel.Min() ); - BOOL bDoOverwrite = ( bOverwrite && - ( aPaM.GetIndex() < aPaM.GetNode()->Len() ) ) ? TRUE : FALSE; + sal_Bool bDoOverwrite = ( bOverwrite && + ( aPaM.GetIndex() < aPaM.GetNode()->Len() ) ) ? sal_True : sal_False; - BOOL bUndoAction = ( rCurSel.HasRange() || bDoOverwrite ); + sal_Bool bUndoAction = ( rCurSel.HasRange() || bDoOverwrite ); if ( bUndoAction ) UndoActionStart( EDITUNDO_INSERT ); @@ -2669,7 +2667,7 @@ EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel, String aChgText( aNewText.copy( nChgPos ), nChgLen ); // select text from first pos to be changed to current pos - EditSelection aSel( EditPaM( aPaM.GetNode(), (USHORT) nChgPos ), aPaM ); + EditSelection aSel( EditPaM( aPaM.GetNode(), (sal_uInt16) nChgPos ), aPaM ); if (aChgText.Len()) return InsertText( aSel, aChgText ); // implicitly handles undo @@ -2690,7 +2688,7 @@ EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel, if ( IsUndoEnabled() && !IsInUndo() ) { EditUndoInsertChars* pNewUndo = new EditUndoInsertChars( this, CreateEPaM( aPaM ), c ); - BOOL bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? TRUE : FALSE; + sal_Bool bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? sal_True : sal_False; InsertUndo( pNewUndo, bTryMerge ); } @@ -2734,10 +2732,10 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS // Token LINE_SEP query, // since the MAC-Compiler makes something else from \n ! - USHORT nStart = 0; + sal_uInt16 nStart = 0; while ( nStart < aText.Len() ) { - USHORT nEnd = aText.Search( LINE_SEP, nStart ); + sal_uInt16 nEnd = aText.Search( LINE_SEP, nStart ); if ( nEnd == STRING_NOTFOUND ) nEnd = aText.Len(); // not dereference! @@ -2748,7 +2746,7 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS xub_StrLen nChars = aPaM.GetNode()->Len() + aLine.Len(); if ( nChars > MAXCHARSINPARA ) { - USHORT nMaxNewChars = MAXCHARSINPARA-aPaM.GetNode()->Len(); + sal_uInt16 nMaxNewChars = MAXCHARSINPARA-aPaM.GetNode()->Len(); nEnd -= ( aLine.Len() - nMaxNewChars ); // Then the characters end up in the next paragraph. aLine.Erase( nMaxNewChars ); // Delete the Rest... } @@ -2761,10 +2759,10 @@ EditPaM ImpEditEngine::ImpInsertText( EditSelection aCurSel, const XubString& rS aPaM = aEditDoc.InsertText( aPaM, aLine ); else { - USHORT nStart2 = 0; + sal_uInt16 nStart2 = 0; while ( nStart2 < aLine.Len() ) { - USHORT nEnd2 = aLine.Search( '\t', nStart2 ); + sal_uInt16 nEnd2 = aLine.Search( '\t', nStart2 ); if ( nEnd2 == STRING_NOTFOUND ) nEnd2 = aLine.Len(); // not dereference! @@ -2849,7 +2847,7 @@ EditPaM ImpEditEngine::ImpInsertFeature( EditSelection aCurSel, const SfxPoolIte return aPaM; } -EditPaM ImpEditEngine::ImpInsertParaBreak( const EditSelection& rCurSel, BOOL bKeepEndingAttribs ) +EditPaM ImpEditEngine::ImpInsertParaBreak( const EditSelection& rCurSel, sal_Bool bKeepEndingAttribs ) { EditPaM aPaM; if ( rCurSel.HasRange() ) @@ -2860,7 +2858,7 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( const EditSelection& rCurSel, BOOL bK return ImpInsertParaBreak( aPaM, bKeepEndingAttribs ); } -EditPaM ImpEditEngine::ImpInsertParaBreak( const EditPaM& rPaM, BOOL bKeepEndingAttribs ) +EditPaM ImpEditEngine::ImpInsertParaBreak( const EditPaM& rPaM, sal_Bool bKeepEndingAttribs ) { if ( aEditDoc.Count() >= 0xFFFE ) { @@ -2883,8 +2881,8 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( const EditPaM& rPaM, BOOL bKeepEnding WrongList* pLWrongs = rPaM.GetNode()->GetWrongList(); WrongList* pRWrongs = aPaM.GetNode()->GetWrongList(); // take over misspelled words: - USHORT nLWrongs = pLWrongs->Count(); - for ( USHORT nW = 0; nW < nLWrongs; nW++ ) + sal_uInt16 nLWrongs = pLWrongs->Count(); + for ( sal_uInt16 nW = 0; nW < nLWrongs; nW++ ) { WrongRange& rWrong = pLWrongs->GetObject( nW ); // Correct only if really a word gets overlapped in the process of @@ -2899,7 +2897,7 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( const EditPaM& rPaM, BOOL bKeepEnding else if ( ( rWrong.nStart < nEnd ) && ( rWrong.nEnd > nEnd ) ) rWrong.nEnd = nEnd; } - USHORT nInv = nEnd ? nEnd-1 : nEnd; + sal_uInt16 nInv = nEnd ? nEnd-1 : nEnd; if ( nEnd ) pLWrongs->MarkInvalid( nInv, nEnd ); else @@ -2916,7 +2914,7 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( const EditPaM& rPaM, BOOL bKeepEnding // Optimization: Do not place unnecessarily many getPos to Listen! // Here, as in undo, but also in all other methods. - USHORT nPos = GetParaPortions().GetPos( pPortion ); + sal_uInt16 nPos = GetParaPortions().GetPos( pPortion ); ParaPortion* pNewPortion = new ParaPortion( aPaM.GetNode() ); GetParaPortions().Insert( pNewPortion, nPos + 1 ); ParaAttribsChanged( pNewPortion->GetNode() ); @@ -2928,7 +2926,7 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( const EditPaM& rPaM, BOOL bKeepEnding return aPaM; } -EditPaM ImpEditEngine::ImpFastInsertParagraph( USHORT nPara ) +EditPaM ImpEditEngine::ImpFastInsertParagraph( sal_uInt16 nPara ) { #ifndef SVX_LIGHT if ( IsUndoEnabled() && !IsInUndo() ) @@ -2967,10 +2965,10 @@ EditPaM ImpEditEngine::InsertParaBreak( EditSelection aCurSel ) EditPaM aPaM( ImpInsertParaBreak( aCurSel ) ); if ( aStatus.DoAutoIndenting() ) { - USHORT nPara = aEditDoc.GetPos( aPaM.GetNode() ); + sal_uInt16 nPara = aEditDoc.GetPos( aPaM.GetNode() ); DBG_ASSERT( nPara > 0, "AutoIndenting: Error!" ); XubString aPrevParaText( GetEditDoc().GetParaAsString( nPara-1 ) ); - USHORT n = 0; + sal_uInt16 n = 0; while ( ( n < aPrevParaText.Len() ) && ( ( aPrevParaText.GetChar(n) == ' ' ) || ( aPrevParaText.GetChar(n) == '\t' ) ) ) { @@ -2997,17 +2995,17 @@ EditPaM ImpEditEngine::InsertField( EditSelection aCurSel, const SvxFieldItem& r return aPaM; } -BOOL ImpEditEngine::UpdateFields() +sal_Bool ImpEditEngine::UpdateFields() { - BOOL bChanges = FALSE; - USHORT nParas = GetEditDoc().Count(); - for ( USHORT nPara = 0; nPara < nParas; nPara++ ) + sal_Bool bChanges = sal_False; + sal_uInt16 nParas = GetEditDoc().Count(); + for ( sal_uInt16 nPara = 0; nPara < nParas; nPara++ ) { - BOOL bChangesInPara = FALSE; + sal_Bool bChangesInPara = sal_False; ContentNode* pNode = GetEditDoc().GetObject( nPara ); DBG_ASSERT( pNode, "NULL-Pointer in Doc" ); CharAttribArray& rAttribs = pNode->GetCharAttribs().GetAttribs(); - for ( USHORT nAttr = 0; nAttr < rAttribs.Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < rAttribs.Count(); nAttr++ ) { EditCharAttrib* pAttr = rAttribs[nAttr]; if ( pAttr->Which() == EE_FEATURE_FIELD ) @@ -3026,8 +3024,8 @@ BOOL ImpEditEngine::UpdateFields() pField->GetFieldValue() = aFldValue; if ( *pField != *pCurrent ) { - bChanges = TRUE; - bChangesInPara = TRUE; + bChanges = sal_True; + bChangesInPara = sal_True; } delete pCurrent; } @@ -3052,13 +3050,13 @@ EditPaM ImpEditEngine::InsertLineBreak( EditSelection aCurSel ) // ---------------------------------------------------------------------- // Helper functions // ---------------------------------------------------------------------- -Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, USHORT nFlags ) +Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, sal_uInt16 nFlags ) { DBG_ASSERT( GetUpdateMode(), "Must not be reached when Update=FALSE: PaMtoEditCursor" ); Rectangle aEditCursor; long nY = 0; - for ( USHORT nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ ) { ParaPortion* pPortion = GetParaPortions().GetObject(nPortion); ContentNode* pNode = pPortion->GetNode(); @@ -3079,14 +3077,14 @@ Rectangle ImpEditEngine::PaMtoEditCursor( EditPaM aPaM, USHORT nFlags ) return aEditCursor; } -EditPaM ImpEditEngine::GetPaM( Point aDocPos, BOOL bSmart ) +EditPaM ImpEditEngine::GetPaM( Point aDocPos, sal_Bool bSmart ) { DBG_ASSERT( GetUpdateMode(), "Must not be reached when Update=FALSE: GetPaM" ); long nY = 0; long nTmpHeight; EditPaM aPaM; - USHORT nPortion; + sal_uInt16 nPortion; for ( nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ ) { ParaPortion* pPortion = GetParaPortions().GetObject(nPortion); @@ -3126,7 +3124,7 @@ sal_uInt32 ImpEditEngine::GetTextHeight() const return nCurTextHeight; } -sal_uInt32 ImpEditEngine::CalcTextWidth( BOOL bIgnoreExtraSpace ) +sal_uInt32 ImpEditEngine::CalcTextWidth( sal_Bool bIgnoreExtraSpace ) { // If still not formatted and not in the process. // Will be brought in the formatting for AutoPageSize. @@ -3141,8 +3139,8 @@ sal_uInt32 ImpEditEngine::CalcTextWidth( BOOL bIgnoreExtraSpace ) // -------------------------------------------------- // Over all the paragraphs ... // -------------------------------------------------- - USHORT nParas = GetParaPortions().Count(); - for ( USHORT nPara = 0; nPara < nParas; nPara++ ) + sal_uInt16 nParas = GetParaPortions().Count(); + for ( sal_uInt16 nPara = 0; nPara < nParas; nPara++ ) { ParaPortion* pPortion = GetParaPortions().GetObject( nPara ); if ( pPortion->IsVisible() ) @@ -3153,8 +3151,8 @@ sal_uInt32 ImpEditEngine::CalcTextWidth( BOOL bIgnoreExtraSpace ) // -------------------------------------------------- // On the lines of the paragraph ... // -------------------------------------------------- - ULONG nLines = pPortion->GetLines().Count(); - for ( USHORT nLine = 0; nLine < nLines; nLine++ ) + sal_uLong nLines = pPortion->GetLines().Count(); + for ( sal_uInt16 nLine = 0; nLine < nLines; nLine++ ) { pLine = pPortion->GetLines().GetObject( nLine ); DBG_ASSERT( pLine, "NULL-Pointer in the line iterator in CalcWidth" ); @@ -3191,9 +3189,9 @@ sal_uInt32 ImpEditEngine::CalcTextWidth( BOOL bIgnoreExtraSpace ) return (sal_uInt32)nMaxWidth; } -sal_uInt32 ImpEditEngine::CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, BOOL bIgnoreExtraSpace ) +sal_uInt32 ImpEditEngine::CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, sal_Bool bIgnoreExtraSpace ) { - USHORT nPara = GetEditDoc().GetPos( pPortion->GetNode() ); + sal_uInt16 nPara = GetEditDoc().GetPos( pPortion->GetNode() ); // #114278# Saving both layout mode and language (since I'm // potentially changing both) @@ -3205,8 +3203,8 @@ sal_uInt32 ImpEditEngine::CalcLineWidth( ParaPortion* pPortion, EditLine* pLine, // Calculation of the width without the Indents ... sal_uInt32 nWidth = 0; - USHORT nPos = pLine->GetStart(); - for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ ) + sal_uInt16 nPos = pLine->GetStart(); + for ( sal_uInt16 nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ ) { TextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( nTP ); switch ( pTextPortion->GetKind() ) @@ -3247,12 +3245,12 @@ sal_uInt32 ImpEditEngine::CalcTextHeight() { DBG_ASSERT( GetUpdateMode(), "Should not be used when Update=FALSE: CalcTextHeight" ); sal_uInt32 nY = 0; - for ( USHORT nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ ) + for ( sal_uInt16 nPortion = 0; nPortion < GetParaPortions().Count(); nPortion++ ) nY += GetParaPortions()[nPortion]->GetHeight(); return nY; } -USHORT ImpEditEngine::GetLineCount( USHORT nParagraph ) const +sal_uInt16 ImpEditEngine::GetLineCount( sal_uInt16 nParagraph ) const { DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" ); ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph ); @@ -3263,7 +3261,7 @@ USHORT ImpEditEngine::GetLineCount( USHORT nParagraph ) const return 0xFFFF; } -xub_StrLen ImpEditEngine::GetLineLen( USHORT nParagraph, USHORT nLine ) const +xub_StrLen ImpEditEngine::GetLineLen( sal_uInt16 nParagraph, sal_uInt16 nLine ) const { DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineLen: Out of range" ); ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph ); @@ -3278,7 +3276,7 @@ xub_StrLen ImpEditEngine::GetLineLen( USHORT nParagraph, USHORT nLine ) const return 0xFFFF; } -void ImpEditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const +void ImpEditEngine::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const { DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" ); ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph ); @@ -3293,9 +3291,9 @@ void ImpEditEngine::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEn } } -USHORT ImpEditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const +sal_uInt16 ImpEditEngine::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const { - USHORT nLineNo = 0xFFFF; + sal_uInt16 nLineNo = 0xFFFF; ContentNode* pNode = GetEditDoc().SaveGetObject( nPara ); DBG_ASSERT( pNode, "GetLineNumberAtIndex: invalid paragraph index" ); if (pNode) @@ -3303,13 +3301,13 @@ USHORT ImpEditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const // we explicitly allow for the index to point at the character right behind the text const bool bValidIndex = /*0 <= nIndex &&*/ nIndex <= pNode->Len(); DBG_ASSERT( bValidIndex, "GetLineNumberAtIndex: invalid index" ); - const USHORT nLineCount = GetLineCount( nPara ); + const sal_uInt16 nLineCount = GetLineCount( nPara ); if (nIndex == pNode->Len()) nLineNo = nLineCount > 0 ? nLineCount - 1 : 0; else if (bValidIndex) // nIndex < pNode->Len() { - USHORT nStart = USHRT_MAX, nEnd = USHRT_MAX; - for (USHORT i = 0; i < nLineCount && nLineNo == 0xFFFF; ++i) + sal_uInt16 nStart = USHRT_MAX, nEnd = USHRT_MAX; + for (sal_uInt16 i = 0; i < nLineCount && nLineNo == 0xFFFF; ++i) { GetLineBoundaries( nStart, nEnd, nPara, i ); if (nStart <= nIndex && nIndex < nEnd) @@ -3320,7 +3318,7 @@ USHORT ImpEditEngine::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const return nLineNo; } -USHORT ImpEditEngine::GetLineHeight( USHORT nParagraph, USHORT nLine ) +sal_uInt16 ImpEditEngine::GetLineHeight( sal_uInt16 nParagraph, sal_uInt16 nLine ) { DBG_ASSERT( nParagraph < GetParaPortions().Count(), "GetLineCount: Out of range" ); ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nParagraph ); @@ -3335,7 +3333,7 @@ USHORT ImpEditEngine::GetLineHeight( USHORT nParagraph, USHORT nLine ) return 0xFFFF; } -sal_uInt32 ImpEditEngine::GetParaHeight( USHORT nParagraph ) +sal_uInt32 ImpEditEngine::GetParaHeight( sal_uInt16 nParagraph ) { sal_uInt32 nHeight = 0; @@ -3350,25 +3348,25 @@ sal_uInt32 ImpEditEngine::GetParaHeight( USHORT nParagraph ) void ImpEditEngine::UpdateSelections() { - USHORT nInvNodes = aDeletedNodes.Count(); + sal_uInt16 nInvNodes = aDeletedNodes.Count(); // Check whether one of the selections is at a deleted node... // If the node is valid, the index has yet to be examined! - for ( USHORT nView = 0; nView < aEditViews.Count(); nView++ ) + for ( sal_uInt16 nView = 0; nView < aEditViews.Count(); nView++ ) { EditView* pView = aEditViews.GetObject(nView); DBG_CHKOBJ( pView, EditView, 0 ); EditSelection aCurSel( pView->pImpEditView->GetEditSelection() ); - BOOL bChanged = FALSE; - for ( USHORT n = 0; n < nInvNodes; n++ ) + sal_Bool bChanged = sal_False; + for ( sal_uInt16 n = 0; n < nInvNodes; n++ ) { DeletedNodeInfo* pInf = aDeletedNodes.GetObject( n ); - if ( ( ( ULONG )(aCurSel.Min().GetNode()) == pInf->GetInvalidAdress() ) || - ( ( ULONG )(aCurSel.Max().GetNode()) == pInf->GetInvalidAdress() ) ) + if ( ( ( sal_uLong )(aCurSel.Min().GetNode()) == pInf->GetInvalidAdress() ) || + ( ( sal_uLong )(aCurSel.Max().GetNode()) == pInf->GetInvalidAdress() ) ) { // Use ParaPortions, as now also hidden paragraphs have to be // taken into account! - USHORT nPara = pInf->GetPosition(); + sal_uInt16 nPara = pInf->GetPosition(); ParaPortion* pPPortion = GetParaPortions().SaveGetObject( nPara ); if ( !pPPortion ) // Last paragraph { @@ -3377,8 +3375,8 @@ void ImpEditEngine::UpdateSelections() } DBG_ASSERT( pPPortion, "Empty Document in UpdateSelections ?" ); // Do not end up from a hidden paragraph: - USHORT nCurPara = nPara; - USHORT nLastPara = GetParaPortions().Count()-1; + sal_uInt16 nCurPara = nPara; + sal_uInt16 nLastPara = GetParaPortions().Count()-1; while ( nPara <= nLastPara && !GetParaPortions()[nPara]->IsVisible() ) nPara++; if ( nPara > nLastPara ) // then also backwards ... @@ -3392,7 +3390,7 @@ void ImpEditEngine::UpdateSelections() ParaPortion* pParaPortion = GetParaPortions()[nPara]; EditSelection aTmpSelection( EditPaM( pParaPortion->GetNode(), 0 ) ); pView->pImpEditView->SetEditSelection( aTmpSelection ); - bChanged=TRUE; + bChanged=sal_True; break; // for loop } } @@ -3413,7 +3411,7 @@ void ImpEditEngine::UpdateSelections() } // Delete ... - for ( USHORT n = 0; n < nInvNodes; n++ ) + for ( sal_uInt16 n = 0; n < nInvNodes; n++ ) { DeletedNodeInfo* pInf = aDeletedNodes.GetObject( n ); delete pInf; @@ -3421,14 +3419,14 @@ void ImpEditEngine::UpdateSelections() aDeletedNodes.Remove( 0, aDeletedNodes.Count() ); } -EditSelection ImpEditEngine::ConvertSelection( USHORT nStartPara, USHORT nStartPos, - USHORT nEndPara, USHORT nEndPos ) const +EditSelection ImpEditEngine::ConvertSelection( sal_uInt16 nStartPara, sal_uInt16 nStartPos, + sal_uInt16 nEndPara, sal_uInt16 nEndPos ) const { EditSelection aNewSelection; // Start... ContentNode* pNode = aEditDoc.SaveGetObject( nStartPara ); - USHORT nIndex = nStartPos; + sal_uInt16 nIndex = nStartPos; if ( !pNode ) { pNode = aEditDoc[ aEditDoc.Count()-1 ]; @@ -3468,15 +3466,15 @@ EditSelection ImpEditEngine::MatchGroup( const EditSelection& rSel ) return aMatchSel; } - USHORT nPos = aTmpSel.Min().GetIndex(); + sal_uInt16 nPos = aTmpSel.Min().GetIndex(); ContentNode* pNode = aTmpSel.Min().GetNode(); if ( nPos >= pNode->Len() ) return aMatchSel; - USHORT nMatchChar = aGroupChars.Search( pNode->GetChar( nPos ) ); + sal_uInt16 nMatchChar = aGroupChars.Search( pNode->GetChar( nPos ) ); if ( nMatchChar != STRING_NOTFOUND ) { - USHORT nNode = aEditDoc.GetPos( pNode ); + sal_uInt16 nNode = aEditDoc.GetPos( pNode ); if ( ( nMatchChar % 2 ) == 0 ) { // Search forward... @@ -3484,8 +3482,8 @@ EditSelection ImpEditEngine::MatchGroup( const EditSelection& rSel ) DBG_ASSERT( aGroupChars.Len() > (nMatchChar+1), "Invalid group of MatchChars!" ); xub_Unicode nEC = aGroupChars.GetChar( nMatchChar+1 ); - USHORT nCur = aTmpSel.Min().GetIndex()+1; - USHORT nLevel = 1; + sal_uInt16 nCur = aTmpSel.Min().GetIndex()+1; + sal_uInt16 nLevel = 1; while ( pNode && nLevel ) { XubString& rStr = *pNode; @@ -3521,8 +3519,8 @@ EditSelection ImpEditEngine::MatchGroup( const EditSelection& rSel ) xub_Unicode nEC = aGroupChars.GetChar( nMatchChar ); xub_Unicode nSC = aGroupChars.GetChar( nMatchChar-1 ); - USHORT nCur = aTmpSel.Min().GetIndex()-1; - USHORT nLevel = 1; + sal_uInt16 nCur = aTmpSel.Min().GetIndex()-1; + sal_uInt16 nLevel = 1; while ( pNode && nLevel ) { if ( pNode->Len() ) @@ -3572,7 +3570,7 @@ void ImpEditEngine::StopSelectionMode() pActiveView->pImpEditView->SetEditSelection( aSel ); pActiveView->ShowCursor(); aSelEngine.Reset(); - bInSelection = FALSE; + bInSelection = sal_False; } } @@ -3621,10 +3619,10 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable( aText.ConvertLineEnd(); // System specific pDataObj->GetString() = aText; - SvxFontItem::EnableStoreUnicodeNames( TRUE ); - WriteBin( pDataObj->GetStream(), aSelection, TRUE ); + SvxFontItem::EnableStoreUnicodeNames( sal_True ); + WriteBin( pDataObj->GetStream(), aSelection, sal_True ); pDataObj->GetStream().Seek( 0 ); - SvxFontItem::EnableStoreUnicodeNames( FALSE ); + SvxFontItem::EnableStoreUnicodeNames( sal_False ); ((ImpEditEngine*)this)->WriteRTF( pDataObj->GetRTFStream(), aSelection ); pDataObj->GetRTFStream().Seek( 0 ); @@ -3656,14 +3654,14 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable( #endif } -EditSelection ImpEditEngine::InsertText( uno::Reference< datatransfer::XTransferable >& rxDataObj, const String& rBaseURL, const EditPaM& rPaM, BOOL bUseSpecial ) +EditSelection ImpEditEngine::InsertText( uno::Reference< datatransfer::XTransferable >& rxDataObj, const String& rBaseURL, const EditPaM& rPaM, sal_Bool bUseSpecial ) { EditSelection aNewSelection( rPaM ); if ( rxDataObj.is() ) { datatransfer::DataFlavor aFlavor; - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if ( bUseSpecial ) { @@ -3680,7 +3678,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 = TRUE; + bDone = sal_True; } catch( const ::com::sun::star::uno::Exception& ) { @@ -3702,7 +3700,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 = TRUE; + bDone = sal_True; } catch( const ::com::sun::star::uno::Exception& ) { @@ -3726,7 +3724,7 @@ EditSelection ImpEditEngine::InsertText( uno::Reference< datatransfer::XTransfer ::rtl::OUString aText; aData >>= aText; aNewSelection = ImpInsertText( rPaM, aText ); - bDone = TRUE; + bDone = sal_True; } catch( ... ) { @@ -3747,12 +3745,12 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion ) { const SvxULSpaceItem& rULSpace = (const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE ); const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL ); - USHORT nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) + sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; // only from the top ... - USHORT nFirstInvalid = 0xFFFF; - USHORT nLine; + sal_uInt16 nFirstInvalid = 0xFFFF; + sal_uInt16 nLine; for ( nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) { EditLine* pL = pPortion->GetLines().GetObject( nLine ); @@ -3774,7 +3772,7 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion ) if ( nFirstInvalid != 0 ) // Only if the first line is invalid aRange.Min() = aRange.Max(); - USHORT nLastInvalid = pPortion->GetLines().Count()-1; + sal_uInt16 nLastInvalid = pPortion->GetLines().Count()-1; for ( nLine = nFirstInvalid; nLine < pPortion->GetLines().Count(); nLine++ ) { EditLine* pL = pPortion->GetLines().GetObject( nLine ); @@ -3805,17 +3803,17 @@ Range ImpEditEngine::GetInvalidYOffsets( ParaPortion* pPortion ) return aRange; } -EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, BOOL bSmart ) +EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, sal_Bool bSmart ) { DBG_ASSERT( pPortion->IsVisible(), "Why GetPaM() for an invisible paragraph?" ); DBG_ASSERT( IsFormatted(), "GetPaM: Not formatted" ); - USHORT nCurIndex = 0; + sal_uInt16 nCurIndex = 0; EditPaM aPaM; aPaM.SetNode( pPortion->GetNode() ); const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL ); - USHORT nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) + sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; long nY = pPortion->GetFirstLineOffset(); @@ -3823,7 +3821,7 @@ EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, BOOL bSmart DBG_ASSERT( pPortion->GetLines().Count(), "Empty ParaPortion in GetPaM!" ); EditLine* pLine = 0; - for ( USHORT nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) { EditLine* pTmpLine = pPortion->GetLines().GetObject( nLine ); nY += pTmpLine->GetHeight(); @@ -3861,16 +3859,16 @@ EditPaM ImpEditEngine::GetPaM( ParaPortion* pPortion, Point aDocPos, BOOL bSmart return aPaM; } -USHORT ImpEditEngine::GetChar( ParaPortion* pParaPortion, EditLine* pLine, long nXPos, BOOL bSmart ) +sal_uInt16 ImpEditEngine::GetChar( ParaPortion* pParaPortion, EditLine* pLine, long nXPos, sal_Bool bSmart ) { DBG_ASSERT( pLine, "No line received: GetChar" ); - USHORT nChar = 0xFFFF; - USHORT nCurIndex = pLine->GetStart(); + sal_uInt16 nChar = 0xFFFF; + sal_uInt16 nCurIndex = pLine->GetStart(); // Search best matching portion with GetPortionXOffset() - for ( USHORT i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ ) + for ( sal_uInt16 i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ ) { TextPortion* pPortion = pParaPortion->GetTextPortions().GetObject( i ); long nXLeft = GetPortionXOffset( pParaPortion, pLine, i ); @@ -3895,16 +3893,16 @@ USHORT ImpEditEngine::GetChar( ParaPortion* pParaPortion, EditLine* pLine, long } else { - USHORT nMax = pPortion->GetLen(); - USHORT nOffset = 0xFFFF; - USHORT nTmpCurIndex = nChar - pLine->GetStart(); + sal_uInt16 nMax = pPortion->GetLen(); + sal_uInt16 nOffset = 0xFFFF; + sal_uInt16 nTmpCurIndex = nChar - pLine->GetStart(); long nXInPortion = nXPos - nXLeft; if ( pPortion->IsRightToLeft() ) nXInPortion = nXRight - nXPos; // Search in Array... - for ( USHORT x = 0; x < nMax; x++ ) + for ( sal_uInt16 x = 0; x < nMax; x++ ) { long nTmpPosMax = pLine->GetCharPosArray().GetObject( nTmpCurIndex+x ); if ( nTmpPosMax > nXInPortion ) @@ -3943,14 +3941,14 @@ USHORT ImpEditEngine::GetChar( ParaPortion* pParaPortion, EditLine* pLine, long if ( nChar && ( nChar < pParaPortion->GetNode()->Len() ) ) { EditPaM aPaM( pParaPortion->GetNode(), nChar+1 ); - USHORT nScriptType = GetScriptType( aPaM ); + sal_uInt16 nScriptType = GetScriptType( aPaM ); if ( nScriptType == i18n::ScriptType::COMPLEX ) { uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() ); sal_Int32 nCount = 1; lang::Locale aLocale = GetLocale( aPaM ); - USHORT nRight = (USHORT)_xBI->nextCharacters( *pParaPortion->GetNode(), nChar, aLocale, ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount ); - USHORT nLeft = (USHORT)_xBI->previousCharacters( *pParaPortion->GetNode(), nRight, aLocale, ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount ); + sal_uInt16 nRight = (sal_uInt16)_xBI->nextCharacters( *pParaPortion->GetNode(), nChar, aLocale, ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount ); + sal_uInt16 nLeft = (sal_uInt16)_xBI->previousCharacters( *pParaPortion->GetNode(), nRight, aLocale, ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL, nCount, nCount ); if ( ( nLeft != nChar ) && ( nRight != nChar ) ) { nChar = ( Abs( nRight - nChar ) < Abs( nLeft - nChar ) ) ? nRight : nLeft; @@ -3975,7 +3973,7 @@ Range ImpEditEngine::GetLineXPosStartEnd( ParaPortion* pParaPortion, EditLine* p { Range aLineXPosStartEnd; - USHORT nPara = GetEditDoc().GetPos( pParaPortion->GetNode() ); + sal_uInt16 nPara = GetEditDoc().GetPos( pParaPortion->GetNode() ); if ( !IsRightToLeft( nPara ) ) { aLineXPosStartEnd.Min() = pLine->GetStartPosX(); @@ -3991,11 +3989,11 @@ Range ImpEditEngine::GetLineXPosStartEnd( ParaPortion* pParaPortion, EditLine* p return aLineXPosStartEnd; } -long ImpEditEngine::GetPortionXOffset( ParaPortion* pParaPortion, EditLine* pLine, USHORT nTextPortion ) +long ImpEditEngine::GetPortionXOffset( ParaPortion* pParaPortion, EditLine* pLine, sal_uInt16 nTextPortion ) { long nX = pLine->GetStartPosX(); - for ( USHORT i = pLine->GetStartPortion(); i < nTextPortion; i++ ) + for ( sal_uInt16 i = pLine->GetStartPortion(); i < nTextPortion; i++ ) { TextPortion* pPortion = pParaPortion->GetTextPortions().GetObject( i ); switch ( pPortion->GetKind() ) @@ -4011,8 +4009,8 @@ long ImpEditEngine::GetPortionXOffset( ParaPortion* pParaPortion, EditLine* pLin } } - USHORT nPara = GetEditDoc().GetPos( pParaPortion->GetNode() ); - BOOL bR2LPara = IsRightToLeft( nPara ); + sal_uInt16 nPara = GetEditDoc().GetPos( pParaPortion->GetNode() ); + sal_Bool bR2LPara = IsRightToLeft( nPara ); TextPortion* pDestPortion = pParaPortion->GetTextPortions().GetObject( nTextPortion ); if ( pDestPortion->GetKind() != PORTIONKIND_TAB ) @@ -4080,20 +4078,20 @@ long ImpEditEngine::GetPortionXOffset( ParaPortion* pParaPortion, EditLine* pLin return nX; } -long ImpEditEngine::GetXPos( ParaPortion* pParaPortion, EditLine* pLine, USHORT nIndex, BOOL bPreferPortionStart ) +long ImpEditEngine::GetXPos( ParaPortion* pParaPortion, EditLine* pLine, sal_uInt16 nIndex, sal_Bool bPreferPortionStart ) { DBG_ASSERT( pLine, "No line received: GetXPos" ); DBG_ASSERT( ( nIndex >= pLine->GetStart() ) && ( nIndex <= pLine->GetEnd() ) , "GetXPos has to be called properly!" ); - BOOL bDoPreferPortionStart = bPreferPortionStart; + sal_Bool bDoPreferPortionStart = bPreferPortionStart; // Assure that the portion belongs to this line: if ( nIndex == pLine->GetStart() ) - bDoPreferPortionStart = TRUE; + bDoPreferPortionStart = sal_True; else if ( nIndex == pLine->GetEnd() ) - bDoPreferPortionStart = FALSE; + bDoPreferPortionStart = sal_False; - USHORT nTextPortionStart = 0; - USHORT nTextPortion = pParaPortion->GetTextPortions().FindPortion( nIndex, nTextPortionStart, bDoPreferPortionStart ); + sal_uInt16 nTextPortionStart = 0; + sal_uInt16 nTextPortion = pParaPortion->GetTextPortions().FindPortion( nIndex, nTextPortionStart, bDoPreferPortionStart ); DBG_ASSERT( ( nTextPortion >= pLine->GetStartPortion() ) && ( nTextPortion <= pLine->GetEndPortion() ), "GetXPos: Portion not in current line! " ); @@ -4121,7 +4119,7 @@ long ImpEditEngine::GetXPos( ParaPortion* pParaPortion, EditLine* pLine, USHORT if ( pNextPortion->GetKind() != PORTIONKIND_TAB ) { if ( !bPreferPortionStart ) - nX = GetXPos( pParaPortion, pLine, nIndex, TRUE ); + nX = GetXPos( pParaPortion, pLine, nIndex, sal_True ); else if ( !IsRightToLeft( GetEditDoc().GetPos( pParaPortion->GetNode() ) ) ) nX += nPortionTextWidth; } @@ -4143,7 +4141,7 @@ long ImpEditEngine::GetXPos( ParaPortion* pParaPortion, EditLine* pLine, USHORT if( pLine->GetCharPosArray().Count() ) { - USHORT nPos = nIndex - 1 - pLine->GetStart(); + sal_uInt16 nPos = nIndex - 1 - pLine->GetStart(); if( nPos >= pLine->GetCharPosArray().Count() ) { nPos = pLine->GetCharPosArray().Count()-1; @@ -4167,10 +4165,10 @@ long ImpEditEngine::GetXPos( ParaPortion* pParaPortion, EditLine* pLine, USHORT nX += pPortion->GetExtraInfos()->nPortionOffsetX; if ( pPortion->GetExtraInfos()->nAsianCompressionTypes & CHAR_PUNCTUATIONRIGHT ) { - BYTE nType = GetCharTypeForCompression( pParaPortion->GetNode()->GetChar( nIndex ) ); + sal_uInt8 nType = GetCharTypeForCompression( pParaPortion->GetNode()->GetChar( nIndex ) ); if ( nType == CHAR_PUNCTUATIONRIGHT ) { - USHORT n = nIndex - nTextPortionStart; + sal_uInt16 n = nIndex - nTextPortionStart; const sal_Int32* pDXArray = pLine->GetCharPosArray().GetData()+( nTextPortionStart-pLine->GetStart() ); sal_Int32 nCharWidth = ( ( (n+1) < pPortion->GetLen() ) ? pDXArray[n] : pPortion->GetSize().Width() ) - ( n ? pDXArray[n-1] : 0 ); @@ -4218,14 +4216,14 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) if ( pPortion->IsVisible() ) { DBG_ASSERT( pPortion->GetLines().Count(), "Paragraph with no lines in ParaPortion::CalcHeight" ); - for ( USHORT nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) + for ( sal_uInt16 nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) pPortion->nHeight += pPortion->GetLines().GetObject( nLine )->GetHeight(); if ( !aStatus.IsOutliner() ) { const SvxULSpaceItem& rULItem = (const SvxULSpaceItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE ); const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL ); - USHORT nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; + sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; if ( nSBL ) { @@ -4235,10 +4233,10 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) pPortion->nHeight += nSBL; } - USHORT nPortion = GetParaPortions().GetPos( pPortion ); + sal_uInt16 nPortion = GetParaPortions().GetPos( pPortion ); if ( nPortion || aStatus.ULSpaceFirstParagraph() ) { - USHORT nUpper = GetYValue( rULItem.GetUpper() ); + sal_uInt16 nUpper = GetYValue( rULItem.GetUpper() ); pPortion->nHeight += nUpper; pPortion->nFirstLineOffset = nUpper; } @@ -4261,7 +4259,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) // Only Writer3: Do not add up, but minimum distance. // check if distance by LineSpacing > Upper: - USHORT nExtraSpace = GetYValue( lcl_CalcExtraSpace( pPortion, rLSItem ) ); + sal_uInt16 nExtraSpace = GetYValue( lcl_CalcExtraSpace( pPortion, rLSItem ) ); if ( nExtraSpace > pPortion->nFirstLineOffset ) { // Paragraph becomes 'bigger': @@ -4270,7 +4268,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) } // Determine nFirstLineOffset now f(pNode) => now f(pNode, pPrev): - USHORT nPrevLower = GetYValue( rPrevULItem.GetLower() ); + sal_uInt16 nPrevLower = GetYValue( rPrevULItem.GetLower() ); // This PrevLower is still in the height of PrevPortion ... if ( nPrevLower > pPortion->nFirstLineOffset ) @@ -4294,7 +4292,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) nExtraSpace = GetYValue( lcl_CalcExtraSpace( pPrev, rPrevLSItem ) ); if ( nExtraSpace > nPrevLower ) { - USHORT nMoreLower = nExtraSpace - nPrevLower; + sal_uInt16 nMoreLower = nExtraSpace - nPrevLower; // Paragraph becomes 'bigger', 'grows' downwards: if ( nMoreLower > pPortion->nFirstLineOffset ) { @@ -4308,7 +4306,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) } } -Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, USHORT nIndex, USHORT nFlags ) +Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, sal_uInt16 nIndex, sal_uInt16 nFlags ) { DBG_ASSERT( pPortion->IsVisible(), "Why GetEditCursor() for an invisible paragraph?" ); DBG_ASSERT( IsFormatted() || GetTextRanger(), "GetEditCursor: Not formatted" ); @@ -4323,14 +4321,14 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, USHORT nIndex, US long nY = pPortion->GetFirstLineOffset(); const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&)pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_SBL ); - USHORT nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) + sal_uInt16 nSBL = ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_FIX ) ? GetYValue( rLSItem.GetInterLineSpace() ) : 0; - USHORT nCurIndex = 0; + sal_uInt16 nCurIndex = 0; DBG_ASSERT( pPortion->GetLines().Count(), "Empty ParaPortion in GetEditCursor!" ); EditLine* pLine = 0; - BOOL bEOL = ( nFlags & GETCRSR_ENDOFLINE ) ? TRUE : FALSE; - for ( USHORT nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) + sal_Bool bEOL = ( nFlags & GETCRSR_ENDOFLINE ) ? sal_True : sal_False; + for ( sal_uInt16 nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ ) { EditLine* pTmpLine = pPortion->GetLines().GetObject( nLine ); if ( ( pTmpLine->GetStart() == nIndex ) || ( pTmpLine->IsIn( nIndex, bEOL ) ) ) @@ -4377,7 +4375,7 @@ Rectangle ImpEditEngine::GetEditCursor( ParaPortion* pPortion, USHORT nIndex, US } else { - nX = GetXPos( pPortion, pLine, nIndex, ( nFlags & GETCRSR_PREFERPORTIONSTART ) ? TRUE : FALSE ); + nX = GetXPos( pPortion, pLine, nIndex, ( nFlags & GETCRSR_PREFERPORTIONSTART ) ? sal_True : sal_False ); } aEditCursor.Left() = aEditCursor.Right() = nX; @@ -4412,7 +4410,7 @@ void ImpEditEngine::SetValidPaperSize( const Size& rNewSz ) aPaperSize.Height() = nMaxHeight; } -void ImpEditEngine::IndentBlock( EditView* pEditView, BOOL bRight ) +void ImpEditEngine::IndentBlock( EditView* pEditView, sal_Bool bRight ) { ESelection aESel( CreateESel( pEditView->pImpEditView->GetEditSelection() ) ); aESel.Adjust(); @@ -4435,7 +4433,7 @@ void ImpEditEngine::IndentBlock( EditView* pEditView, BOOL bRight ) pEditView->pImpEditView->GetEditSelection().Max() ); UndoActionStart( bRight ? EDITUNDO_INDENTBLOCK : EDITUNDO_UNINDENTBLOCK ); - for ( USHORT nPara = aESel.nStartPara; nPara <= aESel.nEndPara; nPara++ ) + for ( sal_uInt16 nPara = aESel.nStartPara; nPara <= aESel.nEndPara; nPara++ ) { ContentNode* pNode = GetEditDoc().GetObject( nPara ); if ( bRight ) @@ -4467,11 +4465,11 @@ void ImpEditEngine::IndentBlock( EditView* pEditView, BOOL bRight ) aNewSel.nEndPos = pLastNode->Len(); pEditView->pImpEditView->SetEditSelection( CreateSel( aNewSel ) ); pEditView->pImpEditView->DrawSelection(); - pEditView->pImpEditView->ShowCursor( FALSE, TRUE ); + pEditView->pImpEditView->ShowCursor( sal_False, sal_True ); } } -rtl::Reference<SvxForbiddenCharactersTable> ImpEditEngine::GetForbiddenCharsTable( BOOL bGetInternal ) const +rtl::Reference<SvxForbiddenCharactersTable> ImpEditEngine::GetForbiddenCharsTable( sal_Bool bGetInternal ) const { rtl::Reference<SvxForbiddenCharactersTable> xF = xForbiddenCharsTable; if ( !xF.is() && bGetInternal ) @@ -4492,23 +4490,23 @@ svtools::ColorConfig& ImpEditEngine::GetColorConfig() return *pColorConfig; } -BOOL ImpEditEngine::IsVisualCursorTravelingEnabled() +sal_Bool ImpEditEngine::IsVisualCursorTravelingEnabled() { - BOOL bVisualCursorTravaling = FALSE; + sal_Bool bVisualCursorTravaling = sal_False; if( !pCTLOptions ) pCTLOptions = new SvtCTLOptions; if ( pCTLOptions->IsCTLFontEnabled() && ( pCTLOptions->GetCTLCursorMovement() == SvtCTLOptions::MOVEMENT_VISUAL ) ) { - bVisualCursorTravaling = TRUE; + bVisualCursorTravaling = sal_True; } return bVisualCursorTravaling; } -BOOL ImpEditEngine::DoVisualCursorTraveling( const ContentNode* ) +sal_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 03c3bc57d54d..9816971a6eeb 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -36,7 +36,7 @@ #include <vcl/metaact.hxx> #include <vcl/gdimtf.hxx> -#define _SVSTDARR_USHORTS +#define _SVSTDARR_sal_uIt16S #include <svl/svstdarr.hxx> #include <vcl/wrkwin.hxx> @@ -102,15 +102,15 @@ SV_IMPL_VARARR_SORT( SortedPositions, sal_uInt32 ); struct TabInfo { - BOOL bValid; + sal_Bool bValid; SvxTabStop aTabStop; xub_StrLen nCharPos; - USHORT nTabPortion; + sal_uInt16 nTabPortion; long nStartPosX; long nTabPos; - TabInfo() { bValid = FALSE; } + TabInfo() { bValid = sal_False; } }; Point Rotate( const Point& rPoint, short nOrientation, const Point& rOrigin ) @@ -135,7 +135,7 @@ Point Rotate( const Point& rPoint, short nOrientation, const Point& rOrigin ) return aTranslatedPos; } -BYTE GetCharTypeForCompression( xub_Unicode cChar ) +sal_uInt8 GetCharTypeForCompression( xub_Unicode cChar ) { switch ( cChar ) { @@ -169,8 +169,8 @@ void lcl_DrawRedLines( WrongList* pWrongs, short nOrientation, const Point& rOrigin, - BOOL bVertical, - BOOL bIsRightToLeft ) + sal_Bool bVertical, + sal_Bool bIsRightToLeft ) { #ifndef SVX_LIGHT // Aber nur, wenn Font nicht zu klein... @@ -539,9 +539,9 @@ void ImpEditEngine::CheckAutoPageSize() { Size aPrevPaperSize( GetPaperSize() ); if ( GetStatus().AutoPageWidth() ) - aPaperSize.Width() = (long) !IsVertical() ? CalcTextWidth( TRUE ) : GetTextHeight(); + aPaperSize.Width() = (long) !IsVertical() ? CalcTextWidth( sal_True ) : GetTextHeight(); if ( GetStatus().AutoPageHeight() ) - aPaperSize.Height() = (long) !IsVertical() ? GetTextHeight() : CalcTextWidth( TRUE ); + aPaperSize.Height() = (long) !IsVertical() ? GetTextHeight() : CalcTextWidth( sal_True ); SetValidPaperSize( aPaperSize ); //Min, Max beruecksichtigen @@ -596,7 +596,7 @@ static sal_Int32 ImplCalculateFontIndependentLineSpacing( const sal_Int32 nFontH return ( nFontHeight * 12 ) / 10; // + 20% } -sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) +sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, sal_uInt32 nStartPosY ) { ParaPortion* pParaPortion = GetParaPortions().GetObject( nPara ); @@ -605,8 +605,8 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) DBG_ASSERT( pParaPortion->IsVisible(), "Unsichtbare Absaetze nicht formatieren!" ); DBG_ASSERT( pParaPortion->IsInvalid(), "CreateLines: Portion nicht invalid!" ); - BOOL bProcessingEmptyLine = ( pParaPortion->GetNode()->Len() == 0 ); - BOOL bEmptyNodeWithPolygon = ( pParaPortion->GetNode()->Len() == 0 ) && GetTextRanger(); + sal_Bool bProcessingEmptyLine = ( pParaPortion->GetNode()->Len() == 0 ); + sal_Bool bEmptyNodeWithPolygon = ( pParaPortion->GetNode()->Len() == 0 ) && GetTextRanger(); // --------------------------------------------------------------- // Schnelle Sonderbehandlung fuer leere Absaetze... @@ -640,7 +640,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) // --------------------------------------------------------------- ContentNode* const pNode = pParaPortion->GetNode(); - BOOL bRightToLeftPara = IsRightToLeft( nPara ); + sal_Bool bRightToLeftPara = IsRightToLeft( nPara ); SvxAdjust eJustification = GetJustification( nPara ); sal_Bool bHyphenatePara = ((const SfxBoolItem&)pNode->GetContentAttribs().GetItem( EE_PARA_HYPHENATE )).GetValue(); @@ -649,7 +649,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) sal_Int32 nSpaceBeforeAndMinLabelWidth = GetSpaceBeforeAndMinLabelWidth( pNode, &nSpaceBefore, &nMinLabelWidth ); const SvxLRSpaceItem& rLRItem = GetLRSpaceItem( pNode ); const SvxLineSpacingItem& rLSItem = (const SvxLineSpacingItem&) pNode->GetContentAttribs().GetItem( EE_PARA_SBL ); - const BOOL bScriptSpace = ((const SvxScriptSpaceItem&) pNode->GetContentAttribs().GetItem( EE_PARA_ASIANCJKSPACING )).GetValue(); + const sal_Bool bScriptSpace = ((const SvxScriptSpaceItem&) pNode->GetContentAttribs().GetItem( EE_PARA_ASIANCJKSPACING )).GetValue(); // const sal_uInt16 nInvalidEnd = ( pParaPortion->GetInvalidDiff() > 0 ) // ? pParaPortion->GetInvalidPosStart() + pParaPortion->GetInvalidDiff() @@ -766,12 +766,12 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) sal_Bool bSameLineAgain = sal_False; // Fuer TextRanger, wenn sich die Hoehe aendert. TabInfo aCurrentTab; - BOOL bForceOneRun = bEmptyNodeWithPolygon; - BOOL bCompressedChars = FALSE; + sal_Bool bForceOneRun = bEmptyNodeWithPolygon; + sal_Bool bCompressedChars = sal_False; while ( ( nIndex < pNode->Len() ) || bForceOneRun ) { - bForceOneRun = FALSE; + bForceOneRun = sal_False; sal_Bool bEOL = sal_False; sal_Bool bEOC = sal_False; @@ -954,7 +954,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) short nAllSpaceBeforeText = static_cast< short >(rLRItem.GetTxtLeft()/* + rLRItem.GetTxtLeft()*/ + nSpaceBeforeAndMinLabelWidth); aCurrentTab.aTabStop = pNode->GetContentAttribs().FindTabStop( nCurPos - nAllSpaceBeforeText /*rLRItem.GetTxtLeft()*/, aEditDoc.GetDefTab() ); aCurrentTab.nTabPos = GetXValue( (long) ( aCurrentTab.aTabStop.GetTabPos() + nAllSpaceBeforeText /*rLRItem.GetTxtLeft()*/ ) ); - aCurrentTab.bValid = FALSE; + aCurrentTab.bValid = sal_False; // Switch direction in R2L para... if ( bRightToLeftPara ) @@ -970,7 +970,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) ( aCurrentTab.aTabStop.GetAdjustment() == SVX_TAB_ADJUST_DECIMAL ) ) { // Bei LEFT/DEFAULT wird dieses Tab nicht mehr betrachtet. - aCurrentTab.bValid = TRUE; + aCurrentTab.bValid = sal_True; aCurrentTab.nStartPosX = nTmpWidth; aCurrentTab.nCharPos = nTmpPos; aCurrentTab.nTabPortion = nTmpPortion; @@ -1001,7 +1001,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) bBrokenLine = sal_True; } pLine->GetCharPosArray().Insert( pPortion->GetSize().Width(), nTmpPos-pLine->GetStart() ); - bCompressedChars = FALSE; + bCompressedChars = sal_False; } break; case EE_FEATURE_LINEBR: @@ -1011,7 +1011,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) bEOL = sal_True; bLineBreak = sal_True; pPortion->GetKind() = PORTIONKIND_LINEBREAK; - bCompressedChars = FALSE; + bCompressedChars = sal_False; pLine->GetCharPosArray().Insert( pPortion->GetSize().Width(), nTmpPos-pLine->GetStart() ); } break; @@ -1045,7 +1045,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) } // Compression in Fields???? // I think this could be a little bit difficult and is not very usefull - bCompressedChars = FALSE; + bCompressedChars = sal_False; } break; default: OSL_FAIL( "Was fuer ein Feature ?" ); @@ -1081,20 +1081,20 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) // And now check for Compression: if ( pPortion->GetLen() && GetAsianCompressionMode() ) - bCompressedChars |= ImplCalcAsianCompression( pNode, pPortion, nTmpPos, (sal_Int32*)pLine->GetCharPosArray().GetData() + (nTmpPos-pLine->GetStart()), 10000, FALSE ); + bCompressedChars |= ImplCalcAsianCompression( pNode, pPortion, nTmpPos, (sal_Int32*)pLine->GetCharPosArray().GetData() + (nTmpPos-pLine->GetStart()), 10000, sal_False ); nTmpWidth += pPortion->GetSize().Width(); pPortion->SetRightToLeft( GetRightToLeft( nPara, nTmpPos+1 ) ); - USHORT _nPortionEnd = nTmpPos + pPortion->GetLen(); + sal_uInt16 _nPortionEnd = nTmpPos + pPortion->GetLen(); if( bScriptSpace && ( _nPortionEnd < pNode->Len() ) && ( nTmpWidth < nXWidth ) && IsScriptChange( EditPaM( pNode, _nPortionEnd ) ) ) { - BOOL bAllow = FALSE; - USHORT nScriptTypeLeft = GetScriptType( EditPaM( pNode, _nPortionEnd ) ); - USHORT nScriptTypeRight = GetScriptType( EditPaM( pNode, _nPortionEnd+1 ) ); + sal_Bool bAllow = sal_False; + sal_uInt16 nScriptTypeLeft = GetScriptType( EditPaM( pNode, _nPortionEnd ) ); + sal_uInt16 nScriptTypeRight = GetScriptType( EditPaM( pNode, _nPortionEnd+1 ) ); if ( ( nScriptTypeLeft == i18n::ScriptType::ASIAN ) || ( nScriptTypeRight == i18n::ScriptType::ASIAN ) ) - bAllow = TRUE; + bAllow = sal_True; // No spacing within L2R/R2L nesting if ( bAllow ) @@ -1110,7 +1110,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) if ( aCurrentTab.bValid && ( nTmpPortion != aCurrentTab.nTabPortion ) ) { long nWidthAfterTab = 0; - for ( USHORT n = aCurrentTab.nTabPortion+1; n <= nTmpPortion; n++ ) + for ( sal_uInt16 n = aCurrentTab.nTabPortion+1; n <= nTmpPortion; n++ ) { TextPortion* pTP = pParaPortion->GetTextPortions().GetObject( n ); nWidthAfterTab += pTP->GetSize().Width(); @@ -1129,12 +1129,12 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) // nW = nWidthAfterTab; String aText = GetSelected( EditSelection( EditPaM( pParaPortion->GetNode(), nTmpPos ), EditPaM( pParaPortion->GetNode(), nTmpPos + pPortion->GetLen() ) ) ); - USHORT nDecPos = aText.Search( aCurrentTab.aTabStop.GetDecimal() ); + sal_uInt16 nDecPos = aText.Search( aCurrentTab.aTabStop.GetDecimal() ); if ( nDecPos != STRING_NOTFOUND ) { nW -= pParaPortion->GetTextPortions().GetObject( nTmpPortion )->GetSize().Width(); nW += aTmpFont.QuickGetTextSize( GetRefDevice(), *pParaPortion->GetNode(), nTmpPos, nDecPos, NULL ).Width(); - aCurrentTab.bValid = FALSE; + aCurrentTab.bValid = sal_False; } } else @@ -1145,7 +1145,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) if ( nW >= nMaxW ) { nW = nMaxW; - aCurrentTab.bValid = FALSE; + aCurrentTab.bValid = sal_False; } TextPortion* pTabPortion = pParaPortion->GetTextPortions().GetObject( aCurrentTab.nTabPortion ); pTabPortion->GetSize().Width() = aCurrentTab.nTabPos - aCurrentTab.nStartPosX - nW - nStartX; @@ -1161,7 +1161,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) DBG_ASSERT( pPortion, "no portion!?" ); - aCurrentTab.bValid = FALSE; + aCurrentTab.bValid = sal_False; // das war evtl. eine Portion zu weit: sal_Bool bFixedEnd = sal_False; @@ -1256,7 +1256,7 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) if ( bCompressedChars && pPortion && ( pPortion->GetLen() > 1 ) && pPortion->GetExtraInfos() && pPortion->GetExtraInfos()->bCompressed ) { // I need the manipulated DXArray for determining the break postion... - ImplCalcAsianCompression( pNode, pPortion, nPortionStart, const_cast<sal_Int32*>(( pLine->GetCharPosArray().GetData() + (nPortionStart-pLine->GetStart()) )), 10000, TRUE ); + ImplCalcAsianCompression( pNode, pPortion, nPortionStart, const_cast<sal_Int32*>(( pLine->GetCharPosArray().GetData() + (nPortionStart-pLine->GetStart()) )), 10000, sal_True ); } if( pPortion ) ImpBreakLine( pParaPortion, pLine, pPortion, nPortionStart, @@ -1554,8 +1554,8 @@ sal_Bool ImpEditEngine::CreateLines( USHORT nPara, sal_uInt32 nStartPosY ) pParaPortion->GetTextPortions().Insert( pDummyPortion, pParaPortion->GetTextPortions().Count() ); pLine = new EditLine; pParaPortion->GetLines().Insert( pLine, ++nLine ); - bForceOneRun = TRUE; - bProcessingEmptyLine = TRUE; + bForceOneRun = sal_True; + bProcessingEmptyLine = sal_True; } } if ( pLine ) @@ -1644,7 +1644,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn if ( !aStatus.IsOutliner() ) { - USHORT nPara = GetParaPortions().GetPos( pParaPortion ); + sal_uInt16 nPara = GetParaPortions().GetPos( pParaPortion ); SvxAdjust eJustification = GetJustification( nPara ); long nMaxLineWidth = !IsVertical() ? aPaperSize.Width() : aPaperSize.Height(); nMaxLineWidth -= GetXValue( rLRItem.GetRight() ); @@ -1677,7 +1677,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion, sal_uIn } else if ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP ) { - USHORT nPara = GetParaPortions().GetPos( pParaPortion ); + sal_uInt16 nPara = GetParaPortions().GetPos( pParaPortion ); if ( nPara || IsFixedCellHeight() || pTmpLine->GetStartPortion() ) // Nicht die aller erste Zeile { // #100508# There are documents with PropLineSpace 0, why? @@ -1768,8 +1768,8 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te else { sal_uInt16 nMinBreakPos = pLine->GetStart(); - USHORT nAttrs = pNode->GetCharAttribs().GetAttribs().Count(); - for ( USHORT nAttr = nAttrs; nAttr; ) + sal_uInt16 nAttrs = pNode->GetCharAttribs().GetAttribs().Count(); + for ( sal_uInt16 nAttr = nAttrs; nAttr; ) { EditCharAttrib* pAttr = pNode->GetCharAttribs().GetAttribs()[--nAttr]; if ( pAttr->IsFeature() && ( pAttr->GetEnd() > nMinBreakPos ) && ( pAttr->GetEnd() <= nMaxBreakPos ) ) @@ -1789,15 +1789,15 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te i18n::LineBreakHyphenationOptions aHyphOptions( xHyph, Sequence< PropertyValue >(), 1 ); i18n::LineBreakUserOptions aUserOptions; - const i18n::ForbiddenCharacters* pForbidden = GetForbiddenCharsTable()->GetForbiddenCharacters( SvxLocaleToLanguage( aLocale ), TRUE ); + const i18n::ForbiddenCharacters* pForbidden = GetForbiddenCharsTable()->GetForbiddenCharacters( SvxLocaleToLanguage( aLocale ), sal_True ); aUserOptions.forbiddenBeginCharacters = pForbidden->beginLine; aUserOptions.forbiddenEndCharacters = pForbidden->endLine; aUserOptions.applyForbiddenRules = ((const SfxBoolItem&)pNode->GetContentAttribs().GetItem( EE_PARA_FORBIDDENRULES )).GetValue(); aUserOptions.allowPunctuationOutsideMargin = ((const SfxBoolItem&)pNode->GetContentAttribs().GetItem( EE_PARA_HANGINGPUNCTUATION )).GetValue(); - aUserOptions.allowHyphenateEnglish = FALSE; + aUserOptions.allowHyphenateEnglish = sal_False; i18n::LineBreakResults aLBR = _xBI->getLineBreak( *pNode, nMaxBreakPos, aLocale, nMinBreakPos, aHyphOptions, aUserOptions ); - nBreakPos = (USHORT)aLBR.breakIndex; + nBreakPos = (sal_uInt16)aLBR.breakIndex; // BUG in I18N - under special condition (break behind field, #87327#) breakIndex is < nMinBreakPos if ( nBreakPos < nMinBreakPos ) @@ -1839,10 +1839,10 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te // sal_uInt16 nWordStart = nBreakPos; // sal_uInt16 nBreakPos_OLD = nBreakPos; sal_uInt16 nWordStart = nBreakPos; - sal_uInt16 nWordEnd = (USHORT) aBoundary.endPos; + sal_uInt16 nWordEnd = (sal_uInt16) aBoundary.endPos; DBG_ASSERT( nWordEnd > nWordStart, "ImpBreakLine: Start >= End?" ); - USHORT nWordLen = nWordEnd - nWordStart; + sal_uInt16 nWordLen = nWordEnd - nWordStart; if ( ( nWordEnd >= nMaxBreakPos ) && ( nWordLen > 3 ) ) { // #104415# May happen, because getLineBreak may differ from getWordBoudary with DICTIONARY_WORD @@ -2000,16 +2000,16 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, if ( ( nRemainingSpace < 0 ) || pLine->IsEmpty() ) return ; - const USHORT nFirstChar = pLine->GetStart(); - const USHORT nLastChar = pLine->GetEnd() -1; // Last zeigt dahinter + const sal_uInt16 nFirstChar = pLine->GetStart(); + const sal_uInt16 nLastChar = pLine->GetEnd() -1; // Last zeigt dahinter ContentNode* pNode = pParaPortion->GetNode(); DBG_ASSERT( nLastChar < pNode->Len(), "AdjustBlocks: Out of range!" ); // Search blanks or Kashidas... SvUShorts aPositions; - USHORT nLastScript = i18n::ScriptType::LATIN; - for ( USHORT nChar = nFirstChar; nChar <= nLastChar; nChar++ ) + sal_uInt16 nLastScript = i18n::ScriptType::LATIN; + for ( sal_uInt16 nChar = nFirstChar; nChar <= nLastChar; nChar++ ) { EditPaM aPaM( pNode, nChar+1 ); LanguageType eLang = GetLanguage(aPaM); @@ -2053,7 +2053,7 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, if ( ( pNode->GetChar( nLastChar ) == ' ' ) && ( aPositions.Count() > 1 ) && ( MsLangId::getPrimaryLanguage( GetLanguage( EditPaM( pNode, nLastChar ) ) ) != LANGUAGE_ARABIC_PRIMARY_ONLY ) ) { aPositions.Remove( aPositions.Count()-1, 1 ); - USHORT nPortionStart, nPortion; + sal_uInt16 nPortionStart, nPortion; nPortion = pParaPortion->GetTextPortions().FindPortion( nLastChar+1, nPortionStart ); TextPortion* pLastPortion = pParaPortion->GetTextPortions()[ nPortion ]; long nRealWidth = pLine->GetCharPosArray()[nLastChar-nFirstChar]; @@ -2072,7 +2072,7 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, pLine->GetCharPosArray()[nLastChar-nFirstChar] -= nBlankWidth; } - USHORT nGaps = aPositions.Count(); + sal_uInt16 nGaps = aPositions.Count(); const long nMore4Everyone = nRemainingSpace / nGaps; long nSomeExtraSpace = nRemainingSpace - nMore4Everyone*nGaps; @@ -2081,12 +2081,12 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, // Die Positionen im Array und die Portion-Breiten korrigieren: // Letztes Zeichen wird schon nicht mehr beachtet... - for ( USHORT n = 0; n < aPositions.Count(); n++ ) + for ( sal_uInt16 n = 0; n < aPositions.Count(); n++ ) { USHORT nChar = aPositions[n]; if ( nChar < nLastChar ) { - USHORT nPortionStart, nPortion; + sal_uInt16 nPortionStart, nPortion; nPortion = pParaPortion->GetTextPortions().FindPortion( nChar, nPortionStart, true ); TextPortion* pLastPortion = pParaPortion->GetTextPortions()[ nPortion ]; USHORT nPortionEnd = nPortionStart + pLastPortion->GetLen(); @@ -2098,8 +2098,8 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, // Correct positions in array // Even for kashidas just change positions, VCL will then draw the kashida automaticly - - for ( USHORT _n = nChar; _n < nPortionEnd; _n++ ) + sal_uInt16 nPortionEnd = nPortionStart + pLastPortion->GetLen(); + for ( sal_uInt16 _n = nChar; _n < nPortionEnd; _n++ ) { pLine->GetCharPosArray()[_n-nFirstChar] += nMore4Everyone; if ( nSomeExtraSpace ) @@ -2115,7 +2115,7 @@ void ImpEditEngine::ImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* pLine, pLine->SetTextWidth( pLine->GetTextWidth() + nRemainingSpace ); } -void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, USHORT nStart, USHORT nEnd, SvUShorts& rArray ) +void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, sal_uInt16 nStart, sal_uInt16 nEnd, SvUShorts& rArray ) { // the search has to be performed on a per word base @@ -2126,7 +2126,7 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, USHORT nStart, USHORT n while ( ( aWordSel.Min().GetNode() == pNode ) && ( aWordSel.Min().GetIndex() < nEnd ) ) { - USHORT nSavPos = aWordSel.Max().GetIndex(); + sal_uInt16 nSavPos = aWordSel.Max().GetIndex(); if ( aWordSel.Max().GetIndex() > nEnd ) aWordSel.Max().GetIndex() = nEnd; @@ -2281,7 +2281,7 @@ sal_uInt16 ImpEditEngine::SplitTextPortion( ParaPortion* pPortion, sal_uInt16 nP if ( pTextPortion->GetExtraInfos() && pTextPortion->GetExtraInfos()->bCompressed ) { // We need the original size from the portion - USHORT nTxtPortionStart = pPortion->GetTextPortions().GetStartPos( nSplitPortion ); + sal_uInt16 nTxtPortionStart = pPortion->GetTextPortions().GetStartPos( nSplitPortion ); SvxFont aTmpFont( pPortion->GetNode()->GetCharAttribs().GetDefFont() ); SeekCursor( pPortion->GetNode(), nTxtPortionStart+1, aTmpFont ); aTmpFont.SetPhysFont( GetRefDevice() ); @@ -2320,15 +2320,15 @@ void ImpEditEngine::CreateTextPortions( ParaPortion* pParaPortion, sal_uInt16& r } aPositions.Insert( pNode->Len() ); - if ( !pParaPortion->aScriptInfos.Count() ) + if ( pParaPortion->aScriptInfos.empty() ) ((ImpEditEngine*)this)->InitScriptTypes( GetParaPortions().GetPos( pParaPortion ) ); const ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos; - for ( USHORT nT = 0; nT < rTypes.Count(); nT++ ) + for ( size_t nT = 0; nT < rTypes.size(); nT++ ) aPositions.Insert( rTypes[nT].nStartPos ); const WritingDirectionInfos& rWritingDirections = pParaPortion->aWritingDirectionInfos; - for ( USHORT nD = 0; nD < rWritingDirections.Count(); nD++ ) + for ( size_t nD = 0; nD < rWritingDirections.size(); nD++ ) aPositions.Insert( rWritingDirections[nD].nStartPos ); if ( mpIMEInfos && mpIMEInfos->nLen && mpIMEInfos->pAttribs && ( mpIMEInfos->aPos.GetNode() == pNode ) ) @@ -2419,7 +2419,7 @@ void ImpEditEngine::RecalcTextPortion( ParaPortion* pParaPortion, sal_uInt16 nSt !pParaPortion->GetTextPortions()[nNewPortionPos]->GetLen() ) { DBG_ASSERT( pParaPortion->GetTextPortions()[nNewPortionPos]->GetKind() == PORTIONKIND_TEXT, "Leere Portion war keine TextPortion!" ); - USHORT & r = + sal_uInt16 & r = pParaPortion->GetTextPortions()[nNewPortionPos]->GetLen(); r = r + nNewChars; } @@ -2468,7 +2468,7 @@ void ImpEditEngine::RecalcTextPortion( ParaPortion* pParaPortion, sal_uInt16 nSt if ( ( nPos == nStartPos ) && ( (nPos+pTP->GetLen()) == nEnd ) ) { // Portion entfernen; - BYTE nType = pTP->GetKind(); + sal_uInt8 nType = pTP->GetKind(); pParaPortion->GetTextPortions().Remove( nPortion ); delete pTP; if ( nType == PORTIONKIND_LINEBREAK ) @@ -2533,7 +2533,7 @@ void ImpEditEngine::SetTextRanger( TextRanger* pRanger ) } } -void ImpEditEngine::SetVertical( BOOL bVertical ) +void ImpEditEngine::SetVertical( sal_Bool bVertical ) { if ( IsVertical() != bVertical ) { @@ -2548,7 +2548,7 @@ void ImpEditEngine::SetVertical( BOOL bVertical ) } } -void ImpEditEngine::SetFixedCellHeight( BOOL bUseFixedCellHeight ) +void ImpEditEngine::SetFixedCellHeight( sal_Bool bUseFixedCellHeight ) { if ( IsFixedCellHeight() != bUseFixedCellHeight ) { @@ -2773,7 +2773,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_uInt16 nPos, SvxFont& rF const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); rFont.SetColor( rStyleSettings.GetHighlightTextColor() ); rFont.SetFillColor( rStyleSettings.GetHighlightColor() ); - rFont.SetTransparent( FALSE ); + rFont.SetTransparent( sal_False ); } else if ( nAttr & EXTTEXTINPUT_ATTR_GRAYWAVELINE ) { @@ -3028,16 +3028,16 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta { SeekCursor( pPortion->GetNode(), nIndex+1, aTmpFont, pOutDev ); - BOOL bDrawFrame = FALSE; + sal_Bool bDrawFrame = sal_False; if ( ( pTextPortion->GetKind() == PORTIONKIND_FIELD ) && !aTmpFont.IsTransparent() && ( GetBackgroundColor() != COL_AUTO ) && GetBackgroundColor().IsDark() && ( IsAutoColorEnabled() && ( pOutDev->GetOutDevType() != OUTDEV_PRINTER ) ) ) { - aTmpFont.SetTransparent( TRUE ); + aTmpFont.SetTransparent( sal_True ); pOutDev->SetFillColor(); pOutDev->SetLineColor( GetAutoColor() ); - bDrawFrame = TRUE; + bDrawFrame = sal_True; } #ifdef EDITDEBUG @@ -3066,8 +3066,8 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta ImplInitDigitMode( pOutDev, 0, 0, 0, aTmpFont.GetLanguage() ); XubString aText; - USHORT nTextStart = 0; - USHORT nTextLen = 0; + sal_uInt16 nTextStart = 0; + sal_uInt16 nTextLen = 0; const sal_Int32* pDXArray = 0; sal_Int32* pTmpDXArray = 0; @@ -3139,7 +3139,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta { const String aSlash( '/' ); const short nOldEscapement = aTmpFont.GetEscapement(); - const BYTE nOldPropr = aTmpFont.GetPropr(); + const sal_uInt8 nOldPropr = aTmpFont.GetPropr(); aTmpFont.SetEscapement( -20 ); aTmpFont.SetPropr( 25 ); @@ -3390,7 +3390,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta if ( bSpecialUnderline ) { Size aSz = aTmpFont.GetPhysTxtSize( pOutDev, aText, nTextStart, nTextLen ); - BYTE nProp = aTmpFont.GetPropr(); + sal_uInt8 nProp = aTmpFont.GetPropr(); aTmpFont.SetEscapement( 0 ); aTmpFont.SetPropr( 100 ); aTmpFont.SetPhysFont( pOutDev ); @@ -3553,7 +3553,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRec, Point aSta nChars = 3; // sieht besser aus String aText; - aText.Fill( (USHORT)nChars, pTextPortion->GetExtraValue() ); + aText.Fill( (sal_uInt16)nChars, pTextPortion->GetExtraValue() ); aTmpFont.QuickDrawText( pOutDev, aTmpPos, aText, 0, aText.Len(), NULL ); pOutDev->DrawStretchText( aTmpPos, pTextPortion->GetSize().Width(), aText ); @@ -3684,7 +3684,7 @@ void ImpEditEngine::Paint( ImpEditView* pView, const Rectangle& rRec, sal_Bool b } } - UINT8 nColorDiff = aFontColor.GetColorError( aBackgroundColor ); + sal_uInt8 nColorDiff = aFontColor.GetColorError( aBackgroundColor ); if( nColorDiff < 8 ) aBackgroundColor = aFontColor.IsDark() ? COL_WHITE : COL_BLACK; pVDev->SetBackground( aBackgroundColor ); @@ -4252,7 +4252,7 @@ void ImpEditEngine::DoStretchChars( sal_uInt16 nX, sal_uInt16 nY ) // Fonthoehe for ( int nItem = 0; nItem < 3; nItem++ ) { - USHORT nItemId = EE_CHAR_FONTHEIGHT; + sal_uInt16 nItemId = EE_CHAR_FONTHEIGHT; if ( nItem == 1 ) nItemId = EE_CHAR_FONTHEIGHT_CJK; else if ( nItem == 2 ) @@ -4360,7 +4360,7 @@ const SvxNumberFormat* ImpEditEngine::GetNumberFormat( const ContentNode *pNode if (pNode) { // get index of paragraph - USHORT nPara = GetEditDoc().GetPos( const_cast< ContentNode * >(pNode) ); + sal_uInt16 nPara = GetEditDoc().GetPos( const_cast< ContentNode * >(pNode) ); DBG_ASSERT( nPara < USHRT_MAX, "node not found in array" ); if (nPara < USHRT_MAX) { @@ -4464,10 +4464,10 @@ void ImpEditEngine::ImplInitDigitMode( OutputDevice* pOutDev, String* pString, x } } -void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, USHORT nPara, USHORT nIndex ) +void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_uInt16 nPara, sal_uInt16 nIndex ) { - BOOL bCTL = FALSE; - BYTE bR2L = FALSE; + sal_Bool bCTL = sal_False; + sal_uInt8 bR2L = sal_False; if ( nIndex == 0xFFFF ) { bCTL = HasScriptType( nPara, i18n::ScriptType::COMPLEX ); @@ -4482,7 +4482,7 @@ void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, USHORT nPara, USH // it also works for issue 55927 } - ULONG nLayoutMode = pOutDev->GetLayoutMode(); + sal_uLong nLayoutMode = pOutDev->GetLayoutMode(); // We always use the left postion for DrawText() nLayoutMode &= ~(TEXT_LAYOUT_BIDI_RTL); @@ -4562,7 +4562,7 @@ Color ImpEditEngine::GetAutoColor() const } -BOOL ImpEditEngine::ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, USHORT nStartPos, sal_Int32* pDXArray, USHORT n100thPercentFromMax, BOOL bManipulateDXArray ) +sal_Bool ImpEditEngine::ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, sal_uInt16 nStartPos, sal_Int32* pDXArray, sal_uInt16 n100thPercentFromMax, sal_Bool bManipulateDXArray ) { DBG_ASSERT( GetAsianCompressionMode(), "ImplCalcAsianCompression - Why?" ); DBG_ASSERT( pTextPortion->GetLen(), "ImplCalcAsianCompression - Empty Portion?" ); @@ -4572,18 +4572,18 @@ BOOL ImpEditEngine::ImplCalcAsianCompression( ContentNode* pNode, TextPortion* p if ( n100thPercentFromMax == 10000 ) pTextPortion->SetExtraInfos( NULL ); - BOOL bCompressed = FALSE; + sal_Bool bCompressed = sal_False; if ( GetScriptType( EditPaM( pNode, nStartPos+1 ) ) == i18n::ScriptType::ASIAN ) { long nNewPortionWidth = pTextPortion->GetSize().Width(); - USHORT nPortionLen = pTextPortion->GetLen(); - for ( USHORT n = 0; n < nPortionLen; n++ ) + sal_uInt16 nPortionLen = pTextPortion->GetLen(); + for ( sal_uInt16 n = 0; n < nPortionLen; n++ ) { - BYTE nType = GetCharTypeForCompression( pNode->GetChar( n+nStartPos ) ); + sal_uInt8 nType = GetCharTypeForCompression( pNode->GetChar( n+nStartPos ) ); - BOOL bCompressPunctuation = ( nType == CHAR_PUNCTUATIONLEFT ) || ( nType == CHAR_PUNCTUATIONRIGHT ); - BOOL bCompressKana = ( nType == CHAR_KANA ) && ( GetAsianCompressionMode() == text::CharacterCompressionType::PUNCTUATION_AND_KANA ); + sal_Bool bCompressPunctuation = ( nType == CHAR_PUNCTUATIONLEFT ) || ( nType == CHAR_PUNCTUATIONRIGHT ); + sal_Bool bCompressKana = ( nType == CHAR_KANA ) && ( GetAsianCompressionMode() == text::CharacterCompressionType::PUNCTUATION_AND_KANA ); // create Extra infos only if needed... if ( bCompressPunctuation || bCompressKana ) @@ -4634,9 +4634,9 @@ BOOL ImpEditEngine::ImplCalcAsianCompression( ContentNode* pNode, TextPortion* p if ( nCompress ) { - bCompressed = TRUE; + bCompressed = sal_True; nNewPortionWidth -= nCompress; - pTextPortion->GetExtraInfos()->bCompressed = TRUE; + pTextPortion->GetExtraInfos()->bCompressed = sal_True; // Special handling for rightpunctuation: For the 'compression' we must @@ -4652,19 +4652,19 @@ BOOL ImpEditEngine::ImplCalcAsianCompression( ContentNode* pNode, TextPortion* p if ( n ) { // -1: No entry for the last character - for ( USHORT i = n-1; i < (nPortionLen-1); i++ ) + for ( sal_uInt16 i = n-1; i < (nPortionLen-1); i++ ) pDXArray[i] -= nCompress; } else { - pTextPortion->GetExtraInfos()->bFirstCharIsRightPunktuation = TRUE; + pTextPortion->GetExtraInfos()->bFirstCharIsRightPunktuation = sal_True; pTextPortion->GetExtraInfos()->nPortionOffsetX = -nCompress; } } else { // -1: No entry for the last character - for ( USHORT i = n; i < (nPortionLen-1); i++ ) + for ( sal_uInt16 i = n; i < (nPortionLen-1); i++ ) pDXArray[i] -= nCompress; } } @@ -4694,18 +4694,18 @@ BOOL ImpEditEngine::ImplCalcAsianCompression( ContentNode* pNode, TextPortion* p void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, long nRemainingWidth ) { - BOOL bFoundCompressedPortion = FALSE; + sal_Bool bFoundCompressedPortion = sal_False; long nCompressed = 0; // long nCompressWeight = 0; TextPortionList aCompressedPortions; - USHORT nPortion = pLine->GetEndPortion(); + sal_uInt16 nPortion = pLine->GetEndPortion(); TextPortion* pTP = pParaPortion->GetTextPortions()[ nPortion ]; while ( pTP && ( pTP->GetKind() == PORTIONKIND_TEXT ) ) { if ( pTP->GetExtraInfos() && pTP->GetExtraInfos()->bCompressed ) { - bFoundCompressedPortion = TRUE; + bFoundCompressedPortion = sal_True; nCompressed += pTP->GetExtraInfos()->nOrgWidth - pTP->GetSize().Width(); aCompressedPortions.Insert( pTP, aCompressedPortions.Count() ); } @@ -4723,20 +4723,20 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* nCompressPercent /= nCompressed; } - for ( USHORT n = 0; n < aCompressedPortions.Count(); n++ ) + for ( sal_uInt16 n = 0; n < aCompressedPortions.Count(); n++ ) { pTP = aCompressedPortions[n]; - pTP->GetExtraInfos()->bCompressed = FALSE; + pTP->GetExtraInfos()->bCompressed = sal_False; pTP->GetSize().Width() = pTP->GetExtraInfos()->nOrgWidth; if ( nCompressPercent ) { - USHORT nTxtPortion = pParaPortion->GetTextPortions().GetPos( pTP ); - USHORT nTxtPortionStart = pParaPortion->GetTextPortions().GetStartPos( nTxtPortion ); + sal_uInt16 nTxtPortion = pParaPortion->GetTextPortions().GetPos( pTP ); + sal_uInt16 nTxtPortionStart = pParaPortion->GetTextPortions().GetStartPos( nTxtPortion ); DBG_ASSERT( nTxtPortionStart >= pLine->GetStart(), "Portion doesn't belong to the line!!!" ); sal_Int32* pDXArray = const_cast< sal_Int32* >( pLine->GetCharPosArray().GetData()+( nTxtPortionStart-pLine->GetStart() ) ); if ( pTP->GetExtraInfos()->pOrgDXArray ) memcpy( pDXArray, pTP->GetExtraInfos()->pOrgDXArray, (pTP->GetLen()-1)*sizeof(sal_Int32) ); - ImplCalcAsianCompression( pParaPortion->GetNode(), pTP, nTxtPortionStart, pDXArray, (USHORT)nCompressPercent, TRUE ); + ImplCalcAsianCompression( pParaPortion->GetNode(), pTP, nTxtPortionStart, pDXArray, (sal_uInt16)nCompressPercent, sal_True ); } } } @@ -4745,7 +4745,7 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* } // redesigned to work with TextMarkingVector -void ImpEditEngine::ImplFillTextMarkingVector(const lang::Locale& rLocale, EEngineData::TextMarkingVector& rTextMarkingVector, const String& rTxt, const USHORT nIdx, const USHORT nLen) const +void ImpEditEngine::ImplFillTextMarkingVector(const lang::Locale& rLocale, EEngineData::TextMarkingVector& rTextMarkingVector, const String& rTxt, const sal_uInt16 nIdx, const sal_uInt16 nLen) const { // determine relevant logical text elements for the just-rendered // string of characters. diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 277cf4fb8de6..2cd3e5e7d114 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -94,7 +94,7 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::linguistic2; -void SwapUSHORTs( sal_uInt16& rX, sal_uInt16& rY ) +void Swapsal_uIt16s( sal_uInt16& rX, sal_uInt16& rY ) { sal_uInt16 n = rX; rX = rY; @@ -306,7 +306,7 @@ sal_Bool ImpEditEngine::WriteItemListAsRTF( ItemList& rLst, SvStream& rOutput, s return ( rLst.Count() ? sal_True : sal_False ); } -void lcl_FindValidAttribs( ItemList& rLst, ContentNode* pNode, sal_uInt16 nIndex, USHORT nScriptType ) +void lcl_FindValidAttribs( ItemList& rLst, ContentNode* pNode, sal_uInt16 nIndex, sal_uInt16 nScriptType ) { sal_uInt16 nAttr = 0; EditCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); @@ -323,7 +323,7 @@ void lcl_FindValidAttribs( ItemList& rLst, ContentNode* pNode, sal_uInt16 nIndex } } -sal_uInt32 ImpEditEngine::WriteBin( SvStream& rOutput, EditSelection aSel, BOOL bStoreUnicodeStrings ) const +sal_uInt32 ImpEditEngine::WriteBin( SvStream& rOutput, EditSelection aSel, sal_Bool bStoreUnicodeStrings ) const { BinTextObject* pObj = (BinTextObject*)CreateBinTextObject( aSel, NULL ); pObj->StoreUnicodeStrings( bStoreUnicodeStrings ); @@ -384,21 +384,21 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) aFontTable.Insert( 0, new SvxFontItem( (const SvxFontItem&)aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO ) ) ); aFontTable.Insert( 1, new SvxFontItem( (const SvxFontItem&)aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO_CJK ) ) ); aFontTable.Insert( 2, new SvxFontItem( (const SvxFontItem&)aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO_CTL ) ) ); - for ( USHORT nScriptType = 0; nScriptType < 3; nScriptType++ ) + for ( sal_uInt16 nScriptType = 0; nScriptType < 3; nScriptType++ ) { - USHORT nWhich = EE_CHAR_FONTINFO; + sal_uInt16 nWhich = EE_CHAR_FONTINFO; if ( nScriptType == 1 ) nWhich = EE_CHAR_FONTINFO_CJK; else if ( nScriptType == 2 ) nWhich = EE_CHAR_FONTINFO_CTL; - sal_uInt16 i = 0; - SvxFontItem* pFontItem = (SvxFontItem*)aEditDoc.GetItemPool().GetItem( nWhich, i ); + sal_uInt32 i = 0; + SvxFontItem* pFontItem = (SvxFontItem*)aEditDoc.GetItemPool().GetItem2( nWhich, i ); while ( pFontItem ) { bool bAlreadyExist = false; - ULONG nTestMax = nScriptType ? aFontTable.Count() : 1; - for ( ULONG nTest = 0; !bAlreadyExist && ( nTest < nTestMax ); nTest++ ) + sal_uLong nTestMax = nScriptType ? aFontTable.Count() : 1; + for ( sal_uLong nTest = 0; !bAlreadyExist && ( nTest < nTestMax ); nTest++ ) { bAlreadyExist = *aFontTable.Get( nTest ) == *pFontItem; } @@ -406,7 +406,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) if ( !bAlreadyExist ) aFontTable.Insert( aFontTable.Count(), new SvxFontItem( *pFontItem ) ); - pFontItem = (SvxFontItem*)aEditDoc.GetItemPool().GetItem( nWhich, ++i ); + pFontItem = (SvxFontItem*)aEditDoc.GetItemPool().GetItem2( nWhich, ++i ); } } @@ -462,17 +462,17 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) // Write out ColorList ... SvxColorList aColorList; - sal_uInt16 i = 0; - SvxColorItem* pColorItem = (SvxColorItem*)aEditDoc.GetItemPool().GetItem( EE_CHAR_COLOR, i ); + sal_uInt32 i = 0; + SvxColorItem* pColorItem = (SvxColorItem*)aEditDoc.GetItemPool().GetItem2( EE_CHAR_COLOR, i ); while ( pColorItem ) { - USHORT nPos = i; + sal_uInt32 nPos = i; if ( pColorItem->GetValue() == COL_AUTO ) nPos = 0; aColorList.Insert( new SvxColorItem( *pColorItem ), nPos ); - pColorItem = (SvxColorItem*)aEditDoc.GetItemPool().GetItem( EE_CHAR_COLOR, ++i ); + pColorItem = (SvxColorItem*)aEditDoc.GetItemPool().GetItem2( EE_CHAR_COLOR, ++i ); } - aColorList.Insert( new SvxColorItem( (const SvxColorItem&)aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_COLOR) ), (sal_uInt32)i ); + aColorList.Insert( new SvxColorItem( (const SvxColorItem&)aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_COLOR) ), i ); rOutput << '{' << OOO_STRING_SVTOOLS_RTF_COLORTBL; for ( j = 0; j < aColorList.Count(); j++ ) @@ -665,7 +665,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) else { aAttribItems.Clear(); - USHORT nScriptType = GetScriptType( EditPaM( pNode, nIndex+1 ) ); + sal_uInt16 nScriptType = GetScriptType( EditPaM( pNode, nIndex+1 ) ); if ( !n || IsScriptChange( EditPaM( pNode, nIndex ) ) ) { SfxItemSet aAttribs = GetAttribs( nNode, nIndex+1, nIndex+1 ); @@ -682,8 +682,8 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) if ( WriteItemListAsRTF( aAttribItems, rOutput, nNode, nIndex, aFontTable, aColorList ) ) rOutput << ' '; - USHORT nS = nIndex; - USHORT nE = nIndex + pTextPortion->GetLen(); + sal_uInt16 nS = nIndex; + sal_uInt16 nE = nIndex + pTextPortion->GetLen(); if ( n == nStartPortion ) nS = nStartPos; if ( n == nEndPortion ) @@ -712,7 +712,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) #if defined (EDITDEBUG) && !defined( UNX ) { SvFileStream aStream( String( RTL_CONSTASCII_USTRINGPARAM ( "d:\\rtf_out.rtf" ) ), STREAM_WRITE|STREAM_TRUNC ); - ULONG nP = rOutput.Tell(); + sal_uLong nP = rOutput.Tell(); rOutput.Seek( 0 ); aStream << rOutput; rOutput.Seek( nP ); @@ -930,7 +930,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, break; case EE_CHAR_RELIEF: { - USHORT nRelief = ((const SvxCharReliefItem&)rItem).GetValue(); + sal_uInt16 nRelief = ((const SvxCharReliefItem&)rItem).GetValue(); if ( nRelief == RELIEF_EMBOSSED ) rOutput << OOO_STRING_SVTOOLS_RTF_EMBO; if ( nRelief == RELIEF_ENGRAVED ) @@ -939,7 +939,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, break; case EE_CHAR_EMPHASISMARK: { - USHORT nMark = ((const SvxEmphasisMarkItem&)rItem).GetValue(); + sal_uInt16 nMark = ((const SvxEmphasisMarkItem&)rItem).GetValue(); if ( nMark == EMPHASISMARK_NONE ) rOutput << OOO_STRING_SVTOOLS_RTF_ACCNONE; else if ( nMark == EMPHASISMARK_SIDE_DOTS ) @@ -1171,7 +1171,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP pX->aLines.Insert( pNew, pX->aLines.Count() ); } #ifdef DBG_UTIL - USHORT nTest; + sal_uInt16 nTest; int nTPLen = 0, nTxtLen = 0; for ( nTest = pParaPortion->GetTextPortions().Count(); nTest; ) nTPLen += pParaPortion->GetTextPortions().GetObject( --nTest )->GetLen(); @@ -1268,7 +1268,7 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed sal_uInt16 nNewAttribs = pC->GetAttribs().Count(); if ( nNewAttribs ) { - BOOL bUpdateFields = FALSE; + sal_Bool bUpdateFields = sal_False; for ( sal_uInt16 nAttr = 0; nAttr < nNewAttribs; nAttr++ ) { XEditAttribute* pX = pC->GetAttribs().GetObject( nAttr ); @@ -1295,7 +1295,7 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed 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 = TRUE; + bUpdateFields = sal_True; } else { @@ -1369,7 +1369,7 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed pParaPortion->GetLines().Insert( pNew, m ); } #ifdef DBG_UTIL - USHORT nTest; + sal_uInt16 nTest; int nTPLen = 0, nTxtLen = 0; for ( nTest = pParaPortion->GetTextPortions().Count(); nTest; ) nTPLen += pParaPortion->GetTextPortions().GetObject( --nTest )->GetLen(); @@ -1409,10 +1409,10 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed return aSel; } -LanguageType ImpEditEngine::GetLanguage( const EditPaM& rPaM, USHORT* pEndPos ) const +LanguageType ImpEditEngine::GetLanguage( const EditPaM& rPaM, sal_uInt16* pEndPos ) const { short nScriptType = GetScriptType( rPaM, pEndPos ); // pEndPos will be valid now, pointing to ScriptChange or NodeLen - USHORT nLangId = GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ); + sal_uInt16 nLangId = GetScriptItemId( EE_CHAR_LANGUAGE, nScriptType ); const SvxLanguageItem* pLangItem = &(const SvxLanguageItem&)rPaM.GetNode()->GetContentAttribs().GetItem( nLangId ); EditCharAttrib* pAttr = rPaM.GetNode()->GetCharAttribs().FindAttrib( nLangId, rPaM.GetIndex() ); if ( pAttr ) @@ -1515,15 +1515,15 @@ sal_Bool ImpEditEngine::HasConvertibleTextPortion( LanguageType nSrcLang ) #else sal_Bool bHasConvTxt = sal_False; - USHORT nParas = pEditEngine->GetParagraphCount(); - for (USHORT k = 0; k < nParas; ++k) + sal_uInt16 nParas = pEditEngine->GetParagraphCount(); + for (sal_uInt16 k = 0; k < nParas; ++k) { SvUShorts aPortions; pEditEngine->GetPortions( k, aPortions ); - for ( USHORT nPos = 0; nPos < aPortions.Count(); ++nPos ) + for ( sal_uInt16 nPos = 0; nPos < aPortions.Count(); ++nPos ) { - USHORT nEnd = aPortions.GetObject( nPos ); - USHORT nStart = nPos > 0 ? aPortions.GetObject( nPos - 1 ) : 0; + sal_uInt16 nEnd = aPortions.GetObject( nPos ); + sal_uInt16 nStart = nPos > 0 ? aPortions.GetObject( nPos - 1 ) : 0; // if the paragraph is not empty we need to increase the index // by one since the attribute of the character left to the @@ -1549,7 +1549,7 @@ sal_Bool ImpEditEngine::HasConvertibleTextPortion( LanguageType nSrcLang ) void ImpEditEngine::Convert( EditView* pEditView, LanguageType nSrcLang, LanguageType nDestLang, const Font *pDestFont, - INT32 nOptions, sal_Bool bIsInteractive, sal_Bool bMultipleDoc ) + sal_Int32 nOptions, sal_Bool bIsInteractive, sal_Bool bMultipleDoc ) { // modified version of ImpEditEngine::Spell @@ -1584,7 +1584,7 @@ void ImpEditEngine::Convert( EditView* pEditView, // not work. Thus since chinese conversion is not interactive we start // at the begin of the paragraph to solve the problem, i.e. have the // TextConversion service get those characters together in the same call. - USHORT nStartIdx = ( editeng::HangulHanjaConversion::IsChinese( nSrcLang ) ) ? + sal_uInt16 nStartIdx = ( editeng::HangulHanjaConversion::IsChinese( nSrcLang ) ) ? 0 : aWordStartPaM.GetIndex(); pConvInfo->aConvStart.nIndex = nStartIdx; } @@ -1616,12 +1616,12 @@ void ImpEditEngine::Convert( EditView* pEditView, // disallow formatting, updating the view, ... while // non-interactively converting the document. (saves time) //if (!bIsInteractive) - // SetUpdateMode( FALSE ); + // SetUpdateMode( sal_False ); aWrp.Convert(); //if (!bIsInteractive) - //SetUpdateMode( TRUE, 0, TRUE ); + //SetUpdateMode( sal_True, 0, sal_True ); if ( !bMultipleDoc ) { @@ -1641,8 +1641,8 @@ void ImpEditEngine::Convert( EditView* pEditView, void ImpEditEngine::SetLanguageAndFont( const ESelection &rESel, - LanguageType nLang, USHORT nLangWhichId, - const Font *pFont, USHORT nFontWhichId ) + LanguageType nLang, sal_uInt16 nLangWhichId, + const Font *pFont, sal_uInt16 nFontWhichId ) { ESelection aOldSel = pActiveView->GetSelection(); pActiveView->SetSelection( rESel ); @@ -1702,7 +1702,7 @@ void ImpEditEngine::ImpConvert( rtl::OUString &rConvTxt, LanguageType &rConvTxtL if (bAllowImplicitChangesForNotConvertibleText && !pEditEngine->GetText( pConvInfo->aConvContinue.nPara ).Len()) { - USHORT nPara = pConvInfo->aConvContinue.nPara; + sal_uInt16 nPara = pConvInfo->aConvContinue.nPara; ESelection aESel( nPara, 0, nPara, 0 ); // see comment for below same function call SetLanguageAndFont( aESel, @@ -1715,22 +1715,22 @@ void ImpEditEngine::ImpConvert( rtl::OUString &rConvTxt, LanguageType &rConvTxtL pConvInfo->aConvContinue.nIndex >= pConvInfo->aConvTo.nIndex) break; - USHORT nAttribStart = USHRT_MAX; - USHORT nAttribEnd = USHRT_MAX; - USHORT nCurPos = USHRT_MAX; + sal_uInt16 nAttribStart = USHRT_MAX; + sal_uInt16 nAttribEnd = USHRT_MAX; + sal_uInt16 nCurPos = USHRT_MAX; EPaM aCurStart = CreateEPaM( aCurSel.Min() ); SvUShorts aPortions; - pEditEngine->GetPortions( (USHORT)aCurStart.nPara, aPortions ); - for ( USHORT nPos = 0; nPos < aPortions.Count(); ++nPos ) + pEditEngine->GetPortions( (sal_uInt16)aCurStart.nPara, aPortions ); + for ( sal_uInt16 nPos = 0; nPos < aPortions.Count(); ++nPos ) { - USHORT nEnd = aPortions.GetObject( nPos ); - USHORT nStart = nPos > 0 ? aPortions.GetObject( nPos - 1 ) : 0; + sal_uInt16 nEnd = aPortions.GetObject( nPos ); + sal_uInt16 nStart = nPos > 0 ? aPortions.GetObject( nPos - 1 ) : 0; // the language attribute is obtained from the left character // (like usually all other attributes) // thus we usually have to add 1 in order to get the language // of the text right to the cursor position - USHORT nLangIdx = nEnd > nStart ? nStart + 1 : nStart; + sal_uInt16 nLangIdx = nEnd > nStart ? nStart + 1 : nStart; LanguageType nLangFound = pEditEngine->GetLanguage( aCurStart.nPara, nLangIdx ); #ifdef DEBUG lang::Locale aLocale( SvxCreateLocale( nLangFound ) ); @@ -2102,7 +2102,7 @@ void ImpEditEngine::AddPortionIterated( pFieldAttr->GetStart() == aCursor.GetIndex() && pFieldAttr->GetStart() != pFieldAttr->GetEnd() && pFieldAttr->Which() == EE_FEATURE_FIELD; - USHORT nEndField = bIsField ? pFieldAttr->GetEnd() : USHRT_MAX; + sal_uInt16 nEndField = bIsField ? pFieldAttr->GetEnd() : USHRT_MAX; bool bIsEndField = false; do { @@ -2184,8 +2184,8 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, rEditView.pImpEditView->SetEditSelection( aCurrentOldPosition->Max() ); } - USHORT nScriptType = GetI18NScriptTypeOfLanguage( aCurrentNewPortion->eLanguage ); - USHORT nLangWhichId = EE_CHAR_LANGUAGE; + sal_uInt16 nScriptType = GetI18NScriptTypeOfLanguage( aCurrentNewPortion->eLanguage ); + sal_uInt16 nLangWhichId = EE_CHAR_LANGUAGE; switch(nScriptType) { case SCRIPTTYPE_ASIAN : nLangWhichId = EE_CHAR_LANGUAGE_CJK; break; @@ -2231,8 +2231,8 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, LanguageType eCurLanguage = GetLanguage( aCurrentPaM ); if(eCurLanguage != aCurrentNewPortion->eLanguage) { - USHORT nScriptType = GetI18NScriptTypeOfLanguage( aCurrentNewPortion->eLanguage ); - USHORT nLangWhichId = EE_CHAR_LANGUAGE; + sal_uInt16 nScriptType = GetI18NScriptTypeOfLanguage( aCurrentNewPortion->eLanguage ); + sal_uInt16 nLangWhichId = EE_CHAR_LANGUAGE; switch(nScriptType) { case SCRIPTTYPE_ASIAN : nLangWhichId = EE_CHAR_LANGUAGE_CJK; break; @@ -2264,7 +2264,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView, rEditView.pImpEditView->SetEditSelection( aNext ); FormatAndUpdate(); - aEditDoc.SetModified(TRUE); + aEditDoc.SetModified(sal_True); } #endif } @@ -2619,7 +2619,7 @@ sal_uInt16 ImpEditEngine::StartSearchAndReplace( EditView* pEditView, const SvxS return nFound; } -BOOL ImpEditEngine::Search( const SvxSearchItem& rSearchItem, EditView* pEditView ) +sal_Bool ImpEditEngine::Search( const SvxSearchItem& rSearchItem, EditView* pEditView ) { EditSelection aSel( pEditView->pImpEditView->GetEditSelection() ); aSel.Adjust( aEditDoc ); @@ -2628,7 +2628,7 @@ BOOL ImpEditEngine::Search( const SvxSearchItem& rSearchItem, EditView* pEditVie aStartPaM = aSel.Min(); EditSelection aFoundSel; - BOOL bFound = ImpSearch( rSearchItem, aSel, aStartPaM, aFoundSel ); + sal_Bool bFound = ImpSearch( rSearchItem, aSel, aStartPaM, aFoundSel ); if ( bFound && ( aFoundSel == aSel ) ) // For backwards-search { aStartPaM = aSel.Min(); @@ -2640,14 +2640,14 @@ BOOL ImpEditEngine::Search( const SvxSearchItem& rSearchItem, EditView* pEditVie { // First, set the minimum, so the whole word is in the visible range. pEditView->pImpEditView->SetEditSelection( aFoundSel.Min() ); - pEditView->ShowCursor( TRUE, FALSE ); + pEditView->ShowCursor( sal_True, sal_False ); pEditView->pImpEditView->SetEditSelection( aFoundSel ); } else pEditView->pImpEditView->SetEditSelection( aSel.Max() ); pEditView->pImpEditView->DrawSelection(); - pEditView->ShowCursor( TRUE, FALSE ); + pEditView->ShowCursor( sal_True, sal_False ); return bFound; } @@ -2706,7 +2706,7 @@ sal_Bool ImpEditEngine::ImpSearch( const SvxSearchItem& rSearchItem, bool bFound = false; if ( bBack ) { - SwapUSHORTs( nStartPos, nEndPos ); + Swapsal_uIt16s( nStartPos, nEndPos ); bFound = aSearcher.SearchBkwrd( aParaStr, &nStartPos, &nEndPos); } else @@ -2753,7 +2753,7 @@ void ImpEditEngine::SetAutoCompleteText( const String& rStr, sal_Bool bClearTipW struct TransliterationChgData { - USHORT nStart; + sal_uInt16 nStart; xub_StrLen nLen; EditSelection aSelection; String aNewText; @@ -2775,17 +2775,17 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, EditSelection aNewSel( aSel ); - const USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); - const USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); + const sal_uInt16 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); + const sal_uInt16 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); - BOOL bChanges = FALSE; - BOOL bLenChanged = FALSE; + sal_Bool bChanges = sal_False; + sal_Bool bLenChanged = sal_False; EditUndoTransliteration* pUndo = NULL; utl::TransliterationWrapper aTranslitarationWrapper( ::comphelper::getProcessServiceFactory(), nTransliterationMode ); - BOOL bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode(); + sal_Bool bConsiderLanguage = aTranslitarationWrapper.needLanguageForTheMode(); - for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) + for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { ContentNode* pNode = aEditDoc.GetObject( nNode ); xub_StrLen nStartPos = 0; @@ -2795,8 +2795,8 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, if ( nNode == nEndNode ) // can also be == nStart! nEndPos = aSel.Max().GetIndex(); - USHORT nCurrentStart = nStartPos; - USHORT nCurrentEnd = nEndPos; + sal_uInt16 nCurrentStart = nStartPos; + sal_uInt16 nCurrentEnd = nEndPos; sal_uInt16 nLanguage = LANGUAGE_SYSTEM; // since we don't use Hiragana/Katakana or half-width/full-width transliterations here @@ -2824,11 +2824,11 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, aSttBndry = _xBI->getWordBoundary( *pNode, nStartPos, SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ), - nWordType, TRUE /*prefer forward direction*/); + nWordType, sal_True /*prefer forward direction*/); aEndBndry = _xBI->getWordBoundary( *pNode, nEndPos, SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ), - nWordType, FALSE /*prefer backward direction*/); + nWordType, sal_False /*prefer backward direction*/); // prevent backtracking to the previous word if selection is at word boundary if (aSttBndry.endPos <= nStartPos) @@ -3040,22 +3040,22 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, { const TransliterationChgData &rData = aChanges[ aChanges.size() - 1 - i ]; - bChanges = TRUE; + bChanges = sal_True; if (rData.nLen != rData.aNewText.Len()) - bLenChanged = TRUE; + bLenChanged = sal_True; // Change text without loosing the attributes - USHORT nDiffs = ReplaceTextOnly( rData.aSelection.Min().GetNode(), + sal_uInt16 nDiffs = ReplaceTextOnly( rData.aSelection.Min().GetNode(), rData.nStart, rData.nLen, rData.aNewText, rData.aOffsets ); // adjust selection in end node to possibly changed size if (aSel.Max().GetNode() == rData.aSelection.Max().GetNode()) aNewSel.Max().GetIndex() = aNewSel.Max().GetIndex() + nDiffs; - USHORT nSelNode = aEditDoc.GetPos( rData.aSelection.Min().GetNode() ); + sal_uInt16 nSelNode = aEditDoc.GetPos( rData.aSelection.Min().GetNode() ); ParaPortion* pParaPortion = GetParaPortions()[nSelNode]; pParaPortion->MarkSelectionInvalid( rData.nStart, - std::max< USHORT >( rData.nStart + rData.nLen, + std::max< sal_uInt16 >( rData.nStart + rData.nLen, rData.nStart + rData.aNewText.Len() ) ); } } @@ -3085,20 +3085,20 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, short ImpEditEngine::ReplaceTextOnly( ContentNode* pNode, - USHORT nCurrentStart, xub_StrLen nLen, + sal_uInt16 nCurrentStart, xub_StrLen nLen, const String& rNewText, const uno::Sequence< sal_Int32 >& rOffsets ) { (void) nLen; // Change text without loosing the attributes - USHORT nCharsAfterTransliteration = - sal::static_int_cast< USHORT >(rOffsets.getLength()); + sal_uInt16 nCharsAfterTransliteration = + sal::static_int_cast< sal_uInt16 >(rOffsets.getLength()); const sal_Int32* pOffsets = rOffsets.getConstArray(); short nDiffs = 0; - for ( USHORT n = 0; n < nCharsAfterTransliteration; n++ ) + for ( sal_uInt16 n = 0; n < nCharsAfterTransliteration; n++ ) { - USHORT nCurrentPos = nCurrentStart+n; + sal_uInt16 nCurrentPos = nCurrentStart+n; sal_Int32 nDiff = (nCurrentPos-nDiffs) - pOffsets[n]; if ( !nDiff ) @@ -3113,7 +3113,7 @@ short ImpEditEngine::ReplaceTextOnly( pNode->SetChar( nCurrentPos, rNewText.GetChar(n) ); DBG_ASSERT( (nCurrentPos+1) < pNode->Len(), "TransliterateText - String smaller than expected!" ); - GetEditDoc().RemoveChars( EditPaM( pNode, nCurrentPos+1 ), sal::static_int_cast< USHORT >(-nDiff) ); + GetEditDoc().RemoveChars( EditPaM( pNode, nCurrentPos+1 ), sal::static_int_cast< sal_uInt16 >(-nDiff) ); } else { @@ -3128,7 +3128,7 @@ short ImpEditEngine::ReplaceTextOnly( } -void ImpEditEngine::SetAsianCompressionMode( USHORT n ) +void ImpEditEngine::SetAsianCompressionMode( sal_uInt16 n ) { if ( n != nAsianCompressionMode ) { @@ -3141,7 +3141,7 @@ void ImpEditEngine::SetAsianCompressionMode( USHORT n ) } } -void ImpEditEngine::SetKernAsianPunctuation( BOOL b ) +void ImpEditEngine::SetKernAsianPunctuation( sal_Bool b ) { if ( b != bKernAsianPunctuation ) { @@ -3154,7 +3154,7 @@ void ImpEditEngine::SetKernAsianPunctuation( BOOL b ) } } -void ImpEditEngine::SetAddExtLeading( BOOL bExtLeading ) +void ImpEditEngine::SetAddExtLeading( sal_Bool bExtLeading ) { if ( IsAddExtLeading() != bExtLeading ) { @@ -3169,7 +3169,7 @@ void ImpEditEngine::SetAddExtLeading( BOOL bExtLeading ) -BOOL ImpEditEngine::ImplHasText() const +sal_Bool ImpEditEngine::ImplHasText() const { return ( ( GetEditDoc().Count() > 1 ) || GetEditDoc().GetObject(0)->Len() ); } diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index 82d27a54bf0b..01484b7cfd5e 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -48,7 +48,7 @@ void ImpEditEngine::SetStyleSheetPool( SfxStyleSheetPool* pSPool ) } } -SfxStyleSheet* ImpEditEngine::GetStyleSheet( USHORT nPara ) const +SfxStyleSheet* ImpEditEngine::GetStyleSheet( sal_uInt16 nPara ) const { ContentNode* pNode = aEditDoc.SaveGetObject( nPara ); return pNode ? pNode->GetContentAttribs().GetStyleSheet() : NULL; @@ -58,19 +58,19 @@ void ImpEditEngine::SetStyleSheet( EditSelection aSel, SfxStyleSheet* pStyle ) { aSel.Adjust( aEditDoc ); - USHORT nStartPara = aEditDoc.GetPos( aSel.Min().GetNode() ); - USHORT nEndPara = aEditDoc.GetPos( aSel.Max().GetNode() ); + sal_uInt16 nStartPara = aEditDoc.GetPos( aSel.Min().GetNode() ); + sal_uInt16 nEndPara = aEditDoc.GetPos( aSel.Max().GetNode() ); - BOOL _bUpdate = GetUpdateMode(); - SetUpdateMode( FALSE ); + sal_Bool _bUpdate = GetUpdateMode(); + SetUpdateMode( sal_False ); - for ( USHORT n = nStartPara; n <= nEndPara; n++ ) + for ( sal_uInt16 n = nStartPara; n <= nEndPara; n++ ) SetStyleSheet( n, pStyle ); SetUpdateMode( _bUpdate, 0 ); } -void ImpEditEngine::SetStyleSheet( USHORT nPara, SfxStyleSheet* pStyle ) +void ImpEditEngine::SetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle ) { DBG_ASSERT( GetStyleSheetPool() || !pStyle, "SetStyleSheet: No StyleSheetPool registered!" ); ContentNode* pNode = aEditDoc.SaveGetObject( nPara ); @@ -94,10 +94,10 @@ void ImpEditEngine::SetStyleSheet( USHORT nPara, SfxStyleSheet* pStyle ) pNode->GetContentAttribs().GetItems() ) ); } if ( pCurStyle ) - EndListening( *pCurStyle, FALSE ); + EndListening( *pCurStyle, sal_False ); pNode->SetStyleSheet( pStyle, aStatus.UseCharAttribs() ); if ( pStyle ) - StartListening( *pStyle, FALSE ); + StartListening( *pStyle, sal_False ); ParaAttribsChanged( pNode ); } FormatAndUpdate(); @@ -108,17 +108,17 @@ void ImpEditEngine::UpdateParagraphsWithStyleSheet( SfxStyleSheet* pStyle ) SvxFont aFontFromStyle; CreateFont( aFontFromStyle, pStyle->GetItemSet() ); - BOOL bUsed = FALSE; - for ( USHORT nNode = 0; nNode < aEditDoc.Count(); nNode++ ) + sal_Bool bUsed = sal_False; + for ( sal_uInt16 nNode = 0; nNode < aEditDoc.Count(); nNode++ ) { ContentNode* pNode = aEditDoc.GetObject( nNode ); if ( pNode->GetStyleSheet() == pStyle ) { - bUsed = TRUE; + bUsed = sal_True; if ( aStatus.UseCharAttribs() ) pNode->SetStyleSheet( pStyle, aFontFromStyle ); else - pNode->SetStyleSheet( pStyle, FALSE ); + pNode->SetStyleSheet( pStyle, sal_False ); ParaAttribsChanged( pNode ); } @@ -132,7 +132,7 @@ void ImpEditEngine::UpdateParagraphsWithStyleSheet( SfxStyleSheet* pStyle ) void ImpEditEngine::RemoveStyleFromParagraphs( SfxStyleSheet* pStyle ) { - for ( USHORT nNode = 0; nNode < aEditDoc.Count(); nNode++ ) + for ( sal_uInt16 nNode = 0; nNode < aEditDoc.Count(); nNode++ ) { ContentNode* pNode = aEditDoc.GetObject(nNode); if ( pNode->GetStyleSheet() == pStyle ) @@ -152,7 +152,7 @@ void ImpEditEngine::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) DBG_CHKOBJ( GetEditEnginePtr(), EditEngine, 0 ); SfxStyleSheet* pStyle = NULL; - ULONG nId = 0; + sal_uLong nId = 0; if ( rHint.ISA( SfxStyleSheetHint ) ) { @@ -191,8 +191,8 @@ EditUndoSetAttribs* ImpEditEngine::CreateAttribUndo( EditSelection aSel, const S ESelection aESel( CreateESel( aSel ) ); - USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); - USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); + sal_uInt16 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); + sal_uInt16 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); DBG_ASSERT( nStartNode <= nEndNode, "CreateAttribUndo: Start > End ?!" ); @@ -210,14 +210,14 @@ EditUndoSetAttribs* ImpEditEngine::CreateAttribUndo( EditSelection aSel, const S SfxItemPool* pPool = pUndo->GetNewAttribs().GetPool(); - for ( USHORT nPara = nStartNode; nPara <= nEndNode; nPara++ ) + for ( sal_uInt16 nPara = nStartNode; nPara <= nEndNode; nPara++ ) { ContentNode* pNode = aEditDoc.GetObject( nPara ); DBG_ASSERT( aEditDoc.SaveGetObject( nPara ), "Node not found: CreateAttribUndo" ); ContentAttribsInfo* pInf = new ContentAttribsInfo( pNode->GetContentAttribs().GetItems() ); pUndo->GetContentInfos().Insert( pInf, pUndo->GetContentInfos().Count() ); - for ( USHORT nAttr = 0; nAttr < pNode->GetCharAttribs().Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < pNode->GetCharAttribs().Count(); nAttr++ ) { EditCharAttribPtr pAttr = pNode->GetCharAttribs().GetAttribs()[ nAttr ]; if ( pAttr->GetLen() ) @@ -230,7 +230,7 @@ EditUndoSetAttribs* ImpEditEngine::CreateAttribUndo( EditSelection aSel, const S return pUndo; } -void ImpEditEngine::UndoActionStart( USHORT nId, const ESelection& aSel ) +void ImpEditEngine::UndoActionStart( sal_uInt16 nId, const ESelection& aSel ) { if ( IsUndoEnabled() && !IsInUndo() ) { @@ -240,7 +240,7 @@ void ImpEditEngine::UndoActionStart( USHORT nId, const ESelection& aSel ) } } -void ImpEditEngine::UndoActionStart( USHORT nId ) +void ImpEditEngine::UndoActionStart( sal_uInt16 nId ) { if ( IsUndoEnabled() && !IsInUndo() ) { @@ -249,7 +249,7 @@ void ImpEditEngine::UndoActionStart( USHORT nId ) } } -void ImpEditEngine::UndoActionEnd( USHORT ) +void ImpEditEngine::UndoActionEnd( sal_uInt16 ) { if ( IsUndoEnabled() && !IsInUndo() ) { @@ -259,13 +259,13 @@ void ImpEditEngine::UndoActionEnd( USHORT ) } } -void ImpEditEngine::InsertUndo( EditUndo* pUndo, BOOL bTryMerge ) +void ImpEditEngine::InsertUndo( EditUndo* pUndo, sal_Bool bTryMerge ) { DBG_ASSERT( !IsInUndo(), "InsertUndo in Undomodus!" ); if ( pUndoMarkSelection ) { EditUndoMarkSelection* pU = new EditUndoMarkSelection( this, *pUndoMarkSelection ); - GetUndoManager().AddUndoAction( pU, FALSE ); + GetUndoManager().AddUndoAction( pU, sal_False ); delete pUndoMarkSelection; pUndoMarkSelection = NULL; } @@ -280,7 +280,7 @@ void ImpEditEngine::ResetUndoManager() GetUndoManager().Clear(); } -void ImpEditEngine::EnableUndo( BOOL bEnable ) +void ImpEditEngine::EnableUndo( sal_Bool bEnable ) { // When switching the mode Delete list: if ( bEnable != IsUndoEnabled() ) @@ -289,39 +289,39 @@ void ImpEditEngine::EnableUndo( BOOL bEnable ) bUndoEnabled = bEnable; } -BOOL ImpEditEngine::Undo( EditView* pView ) +sal_Bool ImpEditEngine::Undo( EditView* pView ) { if ( HasUndoManager() && GetUndoManager().GetUndoActionCount() ) { SetActiveView( pView ); - GetUndoManager().Undo( 1 ); - return TRUE; + GetUndoManager().Undo(); + return sal_True; } - return FALSE; + return sal_False; } -BOOL ImpEditEngine::Redo( EditView* pView ) +sal_Bool ImpEditEngine::Redo( EditView* pView ) { if ( HasUndoManager() && GetUndoManager().GetRedoActionCount() ) { SetActiveView( pView ); - GetUndoManager().Redo( 0 ); - return TRUE; + GetUndoManager().Redo(); + return sal_True; } - return FALSE; + return sal_False; } -BOOL ImpEditEngine::Repeat( EditView* /* pView */ ) +sal_Bool ImpEditEngine::Repeat( EditView* /* pView */ ) { if ( HasUndoManager() && GetUndoManager().GetRepeatActionCount() ) { DBG_WARNING( "Repeat not implemented!" ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib ) +SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, sal_Bool bOnlyHardAttrib ) { DBG_CHKOBJ( GetEditEnginePtr(), EditEngine, 0 ); @@ -329,11 +329,11 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib ) SfxItemSet aCurSet( GetEmptyItemSet() ); - USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); - USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); + sal_uInt16 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); + sal_uInt16 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); // iterate over the paragraphs ... - for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) + for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { ContentNode* pNode = aEditDoc.GetObject( nNode ); DBG_ASSERT( aEditDoc.SaveGetObject( nNode ), "Node not found: GetAttrib" ); @@ -356,7 +356,7 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib ) if( bOnlyHardAttrib != EditEngineAttribs_OnlyHard ) { // and then paragraph formatting and template... - for ( USHORT nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++) + for ( sal_uInt16 nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++) { if ( aCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF ) { @@ -402,7 +402,7 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib ) // fill empty slots with defaults ... if ( bOnlyHardAttrib == EditEngineAttribs_All ) { - for ( USHORT nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++ ) + for ( sal_uInt16 nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++ ) { if ( aCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF ) { @@ -414,7 +414,7 @@ SfxItemSet ImpEditEngine::GetAttribs( EditSelection aSel, BOOL bOnlyHardAttrib ) } -SfxItemSet ImpEditEngine::GetAttribs( USHORT nPara, USHORT nStart, USHORT nEnd, sal_uInt8 nFlags ) const +SfxItemSet ImpEditEngine::GetAttribs( sal_uInt16 nPara, sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt8 nFlags ) const { // Optimized function with less Puts(), which cause unnecessary cloning from default items. // If this works, change GetAttribs( EditSelection ) to use this for each paragraph and merge the results! @@ -438,7 +438,7 @@ SfxItemSet ImpEditEngine::GetAttribs( USHORT nPara, USHORT nStart, USHORT nEnd, // StyleSheet / Parattribs... if ( pNode->GetStyleSheet() && ( nFlags & GETATTRIBS_STYLESHEET ) ) - aAttribs.Set( pNode->GetStyleSheet()->GetItemSet(), TRUE ); + aAttribs.Set( pNode->GetStyleSheet()->GetItemSet(), sal_True ); if ( nFlags & GETATTRIBS_PARAATTRIBS ) aAttribs.Put( pNode->GetContentAttribs().GetItems() ); @@ -451,13 +451,13 @@ SfxItemSet ImpEditEngine::GetAttribs( USHORT nPara, USHORT nStart, USHORT nEnd, pNode->GetCharAttribs().OptimizeRanges( ((ImpEditEngine*)this)->GetEditDoc().GetItemPool() ); const CharAttribArray& rAttrs = pNode->GetCharAttribs().GetAttribs(); - for ( USHORT nAttr = 0; nAttr < rAttrs.Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < rAttrs.Count(); nAttr++ ) { EditCharAttrib* pAttr = rAttrs.GetObject( nAttr ); if ( nStart == nEnd ) { - USHORT nCursorPos = nStart; + sal_uInt16 nCursorPos = nStart; if ( ( pAttr->GetStart() <= nCursorPos ) && ( pAttr->GetEnd() >= nCursorPos ) ) { // To be used the attribute has to start BEFORE the position, or it must be a @@ -505,17 +505,17 @@ SfxItemSet ImpEditEngine::GetAttribs( USHORT nPara, USHORT nStart, USHORT nEnd, } -void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE nSpecial ) +void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, sal_uInt8 nSpecial ) { aSel.Adjust( aEditDoc ); // When no selection => use the Attribute on the word. // ( the RTF-parser should actually never call the Method whithout a Range ) if ( ( nSpecial == ATTRSPECIAL_WHOLEWORD ) && !aSel.HasRange() ) - aSel = SelectWord( aSel, ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, FALSE ); + aSel = SelectWord( aSel, ::com::sun::star::i18n::WordType::ANYWORD_IGNOREWHITESPACES, sal_False ); - USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); - USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); + sal_uInt16 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); + sal_uInt16 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); if ( IsUndoEnabled() && !IsInUndo() && aStatus.DoUndoAttribs() ) { @@ -524,7 +524,7 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE InsertUndo( pUndo ); } - BOOL bCheckLanguage = FALSE; + sal_Bool bCheckLanguage = sal_False; if ( GetStatus().DoOnlineSpelling() ) { bCheckLanguage = ( rSet.GetItemState( EE_CHAR_LANGUAGE ) == SFX_ITEM_ON ) || @@ -533,10 +533,10 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE } // iterate over the paragraphs ... - for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) + for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { - BOOL bParaAttribFound = FALSE; - BOOL bCharAttribFound = FALSE; + sal_Bool bParaAttribFound = sal_False; + sal_Bool bCharAttribFound = sal_False; ContentNode* pNode = aEditDoc.GetObject( nNode ); ParaPortion* pPortion = GetParaPortions().GetObject( nNode ); @@ -557,12 +557,12 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE // if ( fp ) // { // fprintf( fp, "\n\n=> Character-Attribute: Paragraph %i, %i-%i\n", nNode, nStartPos, nEndPos ); -// DbgOutItemSet( fp, rSet, TRUE, FALSE ); +// DbgOutItemSet( fp, rSet, sal_True, sal_False ); // fclose( fp ); // } #endif - for ( USHORT nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++) + for ( sal_uInt16 nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++) { if ( rSet.GetItemState( nWhich ) == SFX_ITEM_ON ) { @@ -570,17 +570,17 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE if ( nWhich <= EE_PARA_END ) { pNode->GetContentAttribs().GetItems().Put( rItem ); - bParaAttribFound = TRUE; + bParaAttribFound = sal_True; } else { aEditDoc.InsertAttrib( pNode, nStartPos, nEndPos, rItem ); - bCharAttribFound = TRUE; + bCharAttribFound = sal_True; if ( nSpecial == ATTRSPECIAL_EDGE ) { CharAttribArray& rAttribs = pNode->GetCharAttribs().GetAttribs(); - USHORT nAttrs = rAttribs.Count(); - for ( USHORT n = 0; n < nAttrs; n++ ) + sal_uInt16 nAttrs = rAttribs.Count(); + for ( sal_uInt16 n = 0; n < nAttrs; n++ ) { EditCharAttrib* pAttr = rAttribs.GetObject( n ); if ( pAttr->GetStart() > nEndPos ) @@ -588,7 +588,7 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE if ( ( pAttr->GetEnd() == nEndPos ) && ( pAttr->Which() == nWhich ) ) { - pAttr->SetEdge( TRUE ); + pAttr->SetEdge( sal_True ); break; } } @@ -603,7 +603,7 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE } else if ( bCharAttribFound ) { - bFormatted = FALSE; + bFormatted = sal_False; if ( !pNode->Len() || ( nStartPos != nEndPos ) ) { pPortion->MarkSelectionInvalid( nStartPos, nEndPos-nStartPos ); @@ -614,12 +614,12 @@ void ImpEditEngine::SetAttribs( EditSelection aSel, const SfxItemSet& rSet, BYTE } } -void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, BOOL bRemoveParaAttribs, USHORT nWhich ) +void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich ) { aSel.Adjust( aEditDoc ); - USHORT nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); - USHORT nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); + sal_uInt16 nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); + sal_uInt16 nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); const SfxItemSet* _pEmptyItemSet = bRemoveParaAttribs ? &GetEmptyItemSet() : 0; @@ -627,14 +627,14 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, BOOL bRemoveParaAttri { // Possibly a special Undo, or itemset* EditUndoSetAttribs* pUndo = CreateAttribUndo( aSel, GetEmptyItemSet() ); - pUndo->SetRemoveAttribs( TRUE ); + pUndo->SetRemoveAttribs( sal_True ); pUndo->SetRemoveParaAttribs( bRemoveParaAttribs ); pUndo->SetRemoveWhich( nWhich ); InsertUndo( pUndo ); } // iterate over the paragraphs ... - for ( USHORT nNode = nStartNode; nNode <= nEndNode; nNode++ ) + for ( sal_uInt16 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { ContentNode* pNode = aEditDoc.GetObject( nNode ); ParaPortion* pPortion = GetParaPortions().GetObject( nNode ); @@ -650,7 +650,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, BOOL bRemoveParaAttri nEndPos = aSel.Max().GetIndex(); // Optimize: If whole paragraph, then RemoveCharAttribs (nPara)? - BOOL bChanged = aEditDoc.RemoveAttribs( pNode, nStartPos, nEndPos, nWhich ); + sal_Bool bChanged = aEditDoc.RemoveAttribs( pNode, nStartPos, nEndPos, nWhich ); if ( bRemoveParaAttribs ) { SetParaAttribs( nNode, *_pEmptyItemSet ); // Invalidated @@ -666,7 +666,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, BOOL bRemoveParaAttri if ( !nWhich ) { SfxItemSet aAttribs( GetParaAttribs( nNode ) ); - for ( USHORT nW = EE_CHAR_START; nW <= EE_CHAR_END; nW++ ) + for ( sal_uInt16 nW = EE_CHAR_START; nW <= EE_CHAR_END; nW++ ) aAttribs.ClearItem( nW ); SetParaAttribs( nNode, aAttribs ); } @@ -674,7 +674,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, BOOL bRemoveParaAttri if ( bChanged && !bRemoveParaAttribs ) { - bFormatted = FALSE; + bFormatted = sal_False; pPortion->MarkSelectionInvalid( nStartPos, nEndPos-nStartPos ); } } @@ -682,7 +682,7 @@ void ImpEditEngine::RemoveCharAttribs( EditSelection aSel, BOOL bRemoveParaAttri typedef EditCharAttrib* EditCharAttribPtr; -void ImpEditEngine::RemoveCharAttribs( USHORT nPara, USHORT nWhich, BOOL bRemoveFeatures ) +void ImpEditEngine::RemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich, sal_Bool bRemoveFeatures ) { ContentNode* pNode = aEditDoc.SaveGetObject( nPara ); ParaPortion* pPortion = GetParaPortions().SaveGetObject( nPara ); @@ -693,7 +693,7 @@ void ImpEditEngine::RemoveCharAttribs( USHORT nPara, USHORT nWhich, BOOL bRemove if ( !pNode ) return; - USHORT nAttr = 0; + sal_uInt16 nAttr = 0; EditCharAttribPtr pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr ); while ( pAttr ) { @@ -711,7 +711,7 @@ void ImpEditEngine::RemoveCharAttribs( USHORT nPara, USHORT nWhich, BOOL bRemove pPortion->MarkSelectionInvalid( 0, pNode->Len() ); } -void ImpEditEngine::SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) +void ImpEditEngine::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ) { ContentNode* pNode = aEditDoc.SaveGetObject( nPara ); @@ -723,7 +723,7 @@ void ImpEditEngine::SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) // if ( fp ) // { // fprintf( fp, "\n\n=> Paragraph-Attribute: Paragraph %i\n", nPara ); -// DbgOutItemSet( fp, rSet, TRUE, FALSE ); +// DbgOutItemSet( fp, rSet, sal_True, sal_False ); // fclose( fp ); // } #endif @@ -751,14 +751,14 @@ void ImpEditEngine::SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) } } -const SfxItemSet& ImpEditEngine::GetParaAttribs( USHORT nPara ) const +const SfxItemSet& ImpEditEngine::GetParaAttribs( sal_uInt16 nPara ) const { ContentNode* pNode = aEditDoc.GetObject( nPara ); DBG_ASSERT( pNode, "Node not found: GetParaAttribs" ); return pNode->GetContentAttribs().GetItems(); } -BOOL ImpEditEngine::HasParaAttrib( USHORT nPara, USHORT nWhich ) const +sal_Bool ImpEditEngine::HasParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const { ContentNode* pNode = aEditDoc.GetObject( nPara ); DBG_ASSERT( pNode, "Node not found: HasParaAttrib" ); @@ -766,7 +766,7 @@ BOOL ImpEditEngine::HasParaAttrib( USHORT nPara, USHORT nWhich ) const return pNode->GetContentAttribs().HasItem( nWhich ); } -const SfxPoolItem& ImpEditEngine::GetParaAttrib( USHORT nPara, USHORT nWhich ) const +const SfxPoolItem& ImpEditEngine::GetParaAttrib( sal_uInt16 nPara, sal_uInt16 nWhich ) const { ContentNode* pNode = aEditDoc.GetObject( nPara ); DBG_ASSERT( pNode, "Node not found: GetParaAttrib" ); @@ -774,13 +774,13 @@ const SfxPoolItem& ImpEditEngine::GetParaAttrib( USHORT nPara, USHORT nWhich ) c return pNode->GetContentAttribs().GetItem( nWhich ); } -void ImpEditEngine::GetCharAttribs( USHORT nPara, EECharAttribArray& rLst ) const +void ImpEditEngine::GetCharAttribs( sal_uInt16 nPara, EECharAttribArray& rLst ) const { rLst.Remove( 0, rLst.Count() ); ContentNode* pNode = aEditDoc.GetObject( nPara ); if ( pNode ) { - for ( USHORT nAttr = 0; nAttr < pNode->GetCharAttribs().Count(); nAttr++ ) + for ( sal_uInt16 nAttr = 0; nAttr < pNode->GetCharAttribs().Count(); nAttr++ ) { EditCharAttribPtr pAttr = pNode->GetCharAttribs().GetAttribs()[ nAttr ]; EECharAttrib aEEAttr; @@ -797,13 +797,13 @@ void ImpEditEngine::ParaAttribsToCharAttribs( ContentNode* pNode ) { pNode->GetCharAttribs().DeleteEmptyAttribs( GetEditDoc().GetItemPool() ); xub_StrLen nEndPos = pNode->Len(); - for ( USHORT nWhich = EE_CHAR_START; nWhich <= EE_CHAR_END; nWhich++ ) + for ( sal_uInt16 nWhich = EE_CHAR_START; nWhich <= EE_CHAR_END; nWhich++ ) { if ( pNode->GetContentAttribs().HasItem( nWhich ) ) { const SfxPoolItem& rItem = pNode->GetContentAttribs().GetItem( nWhich ); // Fill the gap: - USHORT nLastEnd = 0; + sal_uInt16 nLastEnd = 0; EditCharAttrib* pAttr = pNode->GetCharAttribs().FindNextAttrib( nWhich, nLastEnd ); while ( pAttr ) { @@ -819,7 +819,7 @@ void ImpEditEngine::ParaAttribsToCharAttribs( ContentNode* pNode ) aEditDoc.InsertAttrib( pNode, nLastEnd, nEndPos, rItem ); } } - bFormatted = FALSE; + bFormatted = sal_False; // Portion does not need to be invalidated here, happens elsewhere. } @@ -861,9 +861,9 @@ ImplIMEInfos::ImplIMEInfos( const EditPaM& rPos, const String& rOldTextAfterStar { aPos = rPos; nLen = 0; - bCursor = TRUE; + bCursor = sal_True; pAttribs = NULL; - bWasCursorOverwrite = FALSE; + bWasCursorOverwrite = sal_False; } ImplIMEInfos::~ImplIMEInfos() @@ -871,12 +871,12 @@ ImplIMEInfos::~ImplIMEInfos() delete[] pAttribs; } -void ImplIMEInfos::CopyAttribs( const USHORT* pA, USHORT nL ) +void ImplIMEInfos::CopyAttribs( const sal_uInt16* pA, sal_uInt16 nL ) { nLen = nL; delete[] pAttribs; - pAttribs = new USHORT[ nL ]; - memcpy( pAttribs, pA, nL*sizeof(USHORT) ); + pAttribs = new sal_uInt16[ nL ]; + memcpy( pAttribs, pA, nL*sizeof(sal_uInt16) ); } void ImplIMEInfos::DestroyAttribs() diff --git a/editeng/source/editeng/textconv.cxx b/editeng/source/editeng/textconv.cxx index 8d09f6f17215..931c58214fbd 100644..100755 --- a/editeng/source/editeng/textconv.cxx +++ b/editeng/source/editeng/textconv.cxx @@ -63,7 +63,7 @@ TextConvWrapper::TextConvWrapper( Window* pWindow, const Font* pTargetFont, sal_Int32 nOptions, sal_Bool bIsInteractive, - BOOL bIsStart, + sal_Bool bIsStart, EditView* pView ) : HangulHanjaConversion( pWindow, rxMSF, rSourceLocale, rTargetLocale, pTargetFont, nOptions, bIsInteractive ) { @@ -259,8 +259,8 @@ sal_Bool TextConvWrapper::ConvContinue_impl() void TextConvWrapper::SetLanguageAndFont( const ESelection &rESel, - LanguageType nLang, USHORT nLangWhichId, - const Font *pFont, USHORT nFontWhichId ) + LanguageType nLang, sal_uInt16 nLangWhichId, + const Font *pFont, sal_uInt16 nFontWhichId ) { ESelection aOldSel = pEditView->GetSelection(); pEditView->SetSelection( rESel ); @@ -294,7 +294,7 @@ void TextConvWrapper::SelectNewUnit_impl( const sal_Int32 nUnitStart, const sal_Int32 nUnitEnd ) { - BOOL bOK = 0 <= nUnitStart && 0 <= nUnitEnd && nUnitStart <= nUnitEnd; + sal_Bool bOK = 0 <= nUnitStart && 0 <= nUnitEnd && nUnitStart <= nUnitEnd; DBG_ASSERT( bOK, "invalid arguments" ); if (!bOK) return; @@ -302,8 +302,8 @@ void TextConvWrapper::SelectNewUnit_impl( ESelection aSelection = pEditView->GetSelection(); DBG_ASSERT( aSelection.nStartPara == aSelection.nEndPara, "paragraph mismatch in selection" ); - aSelection.nStartPos = (USHORT) (nLastPos + nUnitOffset + nUnitStart); - aSelection.nEndPos = (USHORT) (nLastPos + nUnitOffset + nUnitEnd); + aSelection.nStartPos = (sal_uInt16) (nLastPos + nUnitOffset + nUnitStart); + aSelection.nEndPos = (sal_uInt16) (nLastPos + nUnitOffset + nUnitEnd); pEditView->SetSelection( aSelection ); } @@ -345,7 +345,7 @@ void TextConvWrapper::ReplaceUnit( ReplacementAction eAction, LanguageType *pNewUnitLanguage ) { - BOOL bOK = 0 <= nUnitStart && 0 <= nUnitEnd && nUnitStart <= nUnitEnd; + sal_Bool bOK = 0 <= nUnitStart && 0 <= nUnitEnd && nUnitStart <= nUnitEnd; DBG_ASSERT( bOK, "invalid arguments" ); if (!bOK) return; @@ -378,7 +378,7 @@ void TextConvWrapper::ReplaceUnit( default: OSL_FAIL( "unexpected case" ); } - nUnitOffset = sal::static_int_cast< USHORT >( + nUnitOffset = sal::static_int_cast< sal_uInt16 >( nUnitOffset + nUnitStart + aNewTxt.getLength()); // remember current original language for kater use @@ -431,13 +431,13 @@ void TextConvWrapper::ReplaceUnit( { // Note: replacement is always done in the current paragraph // which is the one ConvContinue points to - pConvInfo->aConvContinue.nIndex = sal::static_int_cast< USHORT >( + pConvInfo->aConvContinue.nIndex = sal::static_int_cast< sal_uInt16 >( pConvInfo->aConvContinue.nIndex + nDelta); // if that is the same as the one where the conversions ends // the end needs to be updated also if (pConvInfo->aConvTo.nPara == pConvInfo->aConvContinue.nPara) - pConvInfo->aConvTo.nIndex = sal::static_int_cast< USHORT >( + pConvInfo->aConvTo.nIndex = sal::static_int_cast< sal_uInt16 >( pConvInfo->aConvTo.nIndex + nDelta); } } diff --git a/editeng/source/editeng/textconv.hxx b/editeng/source/editeng/textconv.hxx index 770fcd92ba64..440ffd8038e5 100644..100755 --- a/editeng/source/editeng/textconv.hxx +++ b/editeng/source/editeng/textconv.hxx @@ -42,8 +42,8 @@ class TextConvWrapper : public editeng::HangulHanjaConversion { rtl::OUString aConvText; // convertible text part found last time LanguageType nConvTextLang; // language of aConvText - USHORT nLastPos; // starting position of the last found text portion (word) - USHORT nUnitOffset; // offset of current unit in the current text portion (word) + sal_uInt16 nLastPos; // starting position of the last found text portion (word) + sal_uInt16 nUnitOffset; // offset of current unit in the current text portion (word) ESelection aConvSel; // selection to be converted if // 'HasRange' is true, other conversion @@ -100,8 +100,8 @@ protected: virtual sal_Bool HasRubySupport() const; void SetLanguageAndFont( const ESelection &rESel, - LanguageType nLang, USHORT nLangWhichId, - const Font *pFont, USHORT nFontWhichId ); + LanguageType nLang, sal_uInt16 nLangWhichId, + const Font *pFont, sal_uInt16 nFontWhichId ); public: @@ -110,9 +110,9 @@ public: const ::com::sun::star::lang::Locale& rSourceLocale, const ::com::sun::star::lang::Locale& rTargetLocale, const Font* pTargetFont, - INT32 nOptions, + sal_Int32 nOptions, sal_Bool bIsInteractive, - BOOL bIsStart, EditView* pView ); + sal_Bool bIsStart, EditView* pView ); virtual ~TextConvWrapper(); diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx index 5b792d4bb7f0..abfc77c2792d 100644 --- a/editeng/source/items/bulitem.cxx +++ b/editeng/source/items/bulitem.cxx @@ -40,7 +40,7 @@ #include <tools/tenccvt.hxx> -#define BULITEM_VERSION ((USHORT)2) +#define BULITEM_VERSION ((sal_uInt16)2) // ----------------------------------------------------------------------- @@ -50,20 +50,20 @@ TYPEINIT1(SvxBulletItem,SfxPoolItem); void SvxBulletItem::StoreFont( SvStream& rStream, const Font& rFont ) { - USHORT nTemp; + sal_uInt16 nTemp; rStream << rFont.GetColor(); - nTemp = (USHORT)rFont.GetFamily(); rStream << nTemp; + nTemp = (sal_uInt16)rFont.GetFamily(); rStream << nTemp; - nTemp = (USHORT)GetSOStoreTextEncoding((rtl_TextEncoding)rFont.GetCharSet(), (sal_uInt16)rStream.GetVersion()); + nTemp = (sal_uInt16)GetSOStoreTextEncoding((rtl_TextEncoding)rFont.GetCharSet(), (sal_uInt16)rStream.GetVersion()); rStream << nTemp; - nTemp = (USHORT)rFont.GetPitch(); rStream << nTemp; - nTemp = (USHORT)rFont.GetAlign(); rStream << nTemp; - nTemp = (USHORT)rFont.GetWeight(); rStream << nTemp; - nTemp = (USHORT)rFont.GetUnderline(); rStream << nTemp; - nTemp = (USHORT)rFont.GetStrikeout(); rStream << nTemp; - nTemp = (USHORT)rFont.GetItalic(); rStream << nTemp; + nTemp = (sal_uInt16)rFont.GetPitch(); rStream << nTemp; + nTemp = (sal_uInt16)rFont.GetAlign(); rStream << nTemp; + nTemp = (sal_uInt16)rFont.GetWeight(); rStream << nTemp; + nTemp = (sal_uInt16)rFont.GetUnderline(); rStream << nTemp; + nTemp = (sal_uInt16)rFont.GetStrikeout(); rStream << nTemp; + nTemp = (sal_uInt16)rFont.GetItalic(); rStream << nTemp; // UNICODE: rStream << rFont.GetName(); rStream.WriteByteString(rFont.GetName()); @@ -75,12 +75,12 @@ void SvxBulletItem::StoreFont( SvStream& rStream, const Font& rFont ) // ----------------------------------------------------------------------- -Font SvxBulletItem::CreateFont( SvStream& rStream, USHORT nVer ) +Font SvxBulletItem::CreateFont( SvStream& rStream, sal_uInt16 nVer ) { Font aFont; Color aColor; rStream >> aColor; aFont.SetColor( aColor ); - USHORT nTemp; + sal_uInt16 nTemp; rStream >> nTemp; aFont.SetFamily((FontFamily)nTemp); rStream >> nTemp; @@ -106,7 +106,7 @@ Font SvxBulletItem::CreateFont( SvStream& rStream, USHORT nVer ) aFont.SetSize( aSize ); } - BOOL bTemp; + sal_Bool bTemp; rStream >> bTemp; aFont.SetOutline( bTemp ); rStream >> bTemp; aFont.SetShadow( bTemp ); rStream >> bTemp; aFont.SetTransparent( bTemp ); @@ -116,7 +116,7 @@ Font SvxBulletItem::CreateFont( SvStream& rStream, USHORT nVer ) // ----------------------------------------------------------------------- -SvxBulletItem::SvxBulletItem( USHORT _nWhich ) : SfxPoolItem( _nWhich ) +SvxBulletItem::SvxBulletItem( sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich ) { SetDefaultFont_Impl(); SetDefaults_Impl(); @@ -125,7 +125,7 @@ SvxBulletItem::SvxBulletItem( USHORT _nWhich ) : SfxPoolItem( _nWhich ) // ----------------------------------------------------------------------- -SvxBulletItem::SvxBulletItem( BYTE nNewStyle, const Font& rFont, USHORT /*nStart*/, USHORT _nWhich ) : SfxPoolItem( _nWhich ) +SvxBulletItem::SvxBulletItem( sal_uInt8 nNewStyle, const Font& rFont, sal_uInt16 /*nStart*/, sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich ) { SetDefaults_Impl(); nStyle = nNewStyle; @@ -135,7 +135,7 @@ SvxBulletItem::SvxBulletItem( BYTE nNewStyle, const Font& rFont, USHORT /*nStart // ----------------------------------------------------------------------- -SvxBulletItem::SvxBulletItem( const Font& rFont, xub_Unicode cSymb, USHORT _nWhich ) : SfxPoolItem( _nWhich ) +SvxBulletItem::SvxBulletItem( const Font& rFont, xub_Unicode cSymb, sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich ) { SetDefaults_Impl(); aFont = rFont; @@ -146,7 +146,7 @@ SvxBulletItem::SvxBulletItem( const Font& rFont, xub_Unicode cSymb, USHORT _nWhi // ----------------------------------------------------------------------- -SvxBulletItem::SvxBulletItem( const Bitmap& rBmp, USHORT _nWhich ) : SfxPoolItem( _nWhich ) +SvxBulletItem::SvxBulletItem( const Bitmap& rBmp, sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich ) { SetDefaults_Impl(); @@ -161,7 +161,7 @@ SvxBulletItem::SvxBulletItem( const Bitmap& rBmp, USHORT _nWhich ) : SfxPoolItem // ----------------------------------------------------------------------- -SvxBulletItem::SvxBulletItem( const GraphicObject& rGraphicObject, USHORT _nWhich ) : SfxPoolItem( _nWhich ) +SvxBulletItem::SvxBulletItem( const GraphicObject& rGraphicObject, sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich ) { SetDefaults_Impl(); @@ -176,7 +176,7 @@ SvxBulletItem::SvxBulletItem( const GraphicObject& rGraphicObject, USHORT _nWhic // ----------------------------------------------------------------------- -SvxBulletItem::SvxBulletItem( SvStream& rStrm, USHORT _nWhich ) : +SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich ), pGraphicObject( NULL ) { @@ -188,10 +188,10 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, USHORT _nWhich ) : { // Safe Load with Test on empty Bitmap Bitmap aBmp; - const UINT32 nOldPos = rStrm.Tell(); + const sal_uInt32 nOldPos = rStrm.Tell(); // Ignore Errorcode when reading Bitmap, // see comment in SvxBulletItem::Store() - BOOL bOldError = rStrm.GetError() ? TRUE : FALSE; + sal_Bool bOldError = rStrm.GetError() ? sal_True : sal_False; rStrm >> aBmp; if ( !bOldError && rStrm.GetError() ) { @@ -260,7 +260,7 @@ SfxPoolItem* SvxBulletItem::Clone( SfxItemPool * /*pPool*/ ) const // ----------------------------------------------------------------------- -SfxPoolItem* SvxBulletItem::Create( SvStream& rStrm, USHORT /*nVersion*/ ) const +SfxPoolItem* SvxBulletItem::Create( SvStream& rStrm, sal_uInt16 /*nVersion*/ ) const { return new SvxBulletItem( rStrm, Which() ); } @@ -271,7 +271,7 @@ void SvxBulletItem::SetDefaultFont_Impl() { aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_FIXED, LANGUAGE_SYSTEM, 0 ); aFont.SetAlign( ALIGN_BOTTOM); - aFont.SetTransparent( TRUE ); + aFont.SetTransparent( sal_True ); } // ----------------------------------------------------------------------- @@ -289,7 +289,7 @@ void SvxBulletItem::SetDefaults_Impl() // ----------------------------------------------------------------------- -USHORT SvxBulletItem::GetVersion( USHORT /*nVersion*/ ) const +sal_uInt16 SvxBulletItem::GetVersion( sal_uInt16 /*nVersion*/ ) const { return BULITEM_VERSION; } @@ -367,7 +367,7 @@ int SvxBulletItem::operator==( const SfxPoolItem& rItem ) const // ----------------------------------------------------------------------- -SvStream& SvxBulletItem::Store( SvStream& rStrm, USHORT /*nItemVersion*/ ) const +SvStream& SvxBulletItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) const { // Correction for empty bitmap if( ( nStyle == BS_BMP ) && @@ -388,16 +388,16 @@ SvStream& SvxBulletItem::Store( SvStream& rStrm, USHORT /*nItemVersion*/ ) const StoreFont( rStrm, aFont ); else { - ULONG _nStart = rStrm.Tell(); + sal_uLong _nStart = rStrm.Tell(); // Small preliminary estimate of the size ... - USHORT nFac = ( rStrm.GetCompressMode() != COMPRESSMODE_NONE ) ? 3 : 1; + sal_uInt16 nFac = ( rStrm.GetCompressMode() != COMPRESSMODE_NONE ) ? 3 : 1; const Bitmap aBmp( pGraphicObject->GetGraphic().GetBitmap() ); - ULONG nBytes = aBmp.GetSizeBytes(); - if ( nBytes < ULONG(0xFF00*nFac) ) + sal_uLong nBytes = aBmp.GetSizeBytes(); + if ( nBytes < sal_uLong(0xFF00*nFac) ) rStrm << aBmp; - ULONG nEnd = rStrm.Tell(); + sal_uLong nEnd = rStrm.Tell(); // Item can not write with an overhead more than 64K or SfxMultiRecord // will crash. Then prefer to forego on the bitmap, it is only // important for the outliner and only for <= 5.0. diff --git a/editeng/source/items/charhiddenitem.cxx b/editeng/source/items/charhiddenitem.cxx index 2c4d4586585e..3f21e4562f3b 100644 --- a/editeng/source/items/charhiddenitem.cxx +++ b/editeng/source/items/charhiddenitem.cxx @@ -36,7 +36,7 @@ TYPEINIT1_FACTORY(SvxCharHiddenItem, SfxBoolItem, new SvxCharHiddenItem(sal_False, 0)); -SvxCharHiddenItem::SvxCharHiddenItem( const sal_Bool bHidden, const USHORT nId ) : +SvxCharHiddenItem::SvxCharHiddenItem( const sal_Bool bHidden, const sal_uInt16 nId ) : SfxBoolItem( nId, bHidden ) { } @@ -62,7 +62,7 @@ SfxItemPresentation SvxCharHiddenItem::GetPresentation case SFX_ITEM_PRESENTATION_NAMELESS: case SFX_ITEM_PRESENTATION_COMPLETE: { - USHORT nId = RID_SVXITEMS_CHARHIDDEN_FALSE; + sal_uInt16 nId = RID_SVXITEMS_CHARHIDDEN_FALSE; if ( GetValue() ) nId = RID_SVXITEMS_CHARHIDDEN_TRUE; diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx index edfe7921f88a..4a3621f7f584 100644 --- a/editeng/source/items/flditem.cxx +++ b/editeng/source/items/flditem.cxx @@ -75,7 +75,7 @@ int SvxFieldData::operator==( const SvxFieldData& rFld ) const { DBG_ASSERT( Type() == rFld.Type(), "==: Different Types" ); (void)rFld; - return TRUE; // Basic class is always the same. + return sal_True; // Basic class is always the same. } // ----------------------------------------------------------------------- @@ -103,7 +103,7 @@ MetaAction* SvxFieldData::createEndComment() const // ----------------------------------------------------------------------- -SvxFieldItem::SvxFieldItem( SvxFieldData* pFld, const USHORT nId ) : +SvxFieldItem::SvxFieldItem( SvxFieldData* pFld, const sal_uInt16 nId ) : SfxPoolItem( nId ) { pField = pFld; // belongs directly to the item @@ -111,7 +111,7 @@ SvxFieldItem::SvxFieldItem( SvxFieldData* pFld, const USHORT nId ) : // ----------------------------------------------------------------------- -SvxFieldItem::SvxFieldItem( const SvxFieldData& rField, const USHORT nId ) : +SvxFieldItem::SvxFieldItem( const SvxFieldData& rField, const sal_uInt16 nId ) : SfxPoolItem( nId ) { pField = rField.Clone(); @@ -141,7 +141,7 @@ SfxPoolItem* SvxFieldItem::Clone( SfxItemPool* ) const // ----------------------------------------------------------------------- -SfxPoolItem* SvxFieldItem::Create( SvStream& rStrm, USHORT ) const +SfxPoolItem* SvxFieldItem::Create( SvStream& rStrm, sal_uInt16 ) const { SvxFieldData* pData = 0; SvPersistStream aPStrm( GetClassManager(), &rStrm ); @@ -158,7 +158,7 @@ SfxPoolItem* SvxFieldItem::Create( SvStream& rStrm, USHORT ) const // ----------------------------------------------------------------------- -SvStream& SvxFieldItem::Store( SvStream& rStrm, USHORT /*nItemVersion*/ ) const +SvStream& SvxFieldItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) const { DBG_ASSERT( pField, "SvxFieldItem::Store: Field?!" ); SvPersistStream aPStrm( GetClassManager(), &rStrm ); @@ -185,10 +185,10 @@ int SvxFieldItem::operator==( const SfxPoolItem& rItem ) const const SvxFieldData* pOtherFld = ((const SvxFieldItem&)rItem).GetField(); if ( !pField && !pOtherFld ) - return TRUE; + return sal_True; if ( ( !pField && pOtherFld ) || ( pField && !pOtherFld ) ) - return FALSE; + return sal_False; return ( ( pField->Type() == pOtherFld->Type() ) && ( *pField == *pOtherFld ) ); @@ -230,7 +230,7 @@ SvxFieldData* SvxDateField::Clone() const int SvxDateField::operator==( const SvxFieldData& rOther ) const { if ( rOther.Type() != Type() ) - return FALSE; + return sal_False; const SvxDateField& rOtherFld = (const SvxDateField&) rOther; return ( ( nFixDate == rOtherFld.nFixDate ) && @@ -242,7 +242,7 @@ int SvxDateField::operator==( const SvxFieldData& rOther ) const void SvxDateField::Load( SvPersistStream & rStm ) { - USHORT nType, nFormat; + sal_uInt16 nType, nFormat; rStm >> nFixDate; rStm >> nType; @@ -257,8 +257,8 @@ void SvxDateField::Load( SvPersistStream & rStm ) void SvxDateField::Save( SvPersistStream & rStm ) { rStm << nFixDate; - rStm << (USHORT)eType; - rStm << (USHORT)eFormat; + rStm << (sal_uInt16)eType; + rStm << (sal_uInt16)eFormat; } // ----------------------------------------------------------------------- @@ -285,7 +285,7 @@ String SvxDateField::GetFormatted( Date& aDate, SvxDateFormat eFormat, SvNumberF eFormat = SVXDATEFORMAT_STDSMALL; } - ULONG nFormatKey; + sal_uLong nFormatKey; switch( eFormat ) { @@ -366,7 +366,7 @@ SvxFieldData* SvxURLField::Clone() const int SvxURLField::operator==( const SvxFieldData& rOther ) const { if ( rOther.Type() != Type() ) - return FALSE; + return sal_False; const SvxURLField& rOtherFld = (const SvxURLField&) rOther; return ( ( eFormat == rOtherFld.eFormat ) && @@ -377,83 +377,46 @@ int SvxURLField::operator==( const SvxFieldData& rOther ) const // ----------------------------------------------------------------------- -void SvxURLField::Load( SvPersistStream & rStm ) +static void write_unicode( SvPersistStream & rStm, const String& rString ) { - USHORT nFormat; - sal_uInt32 nFrameMarker, nCharSetMarker; - long nUlongSize = (long)sizeof(sal_uInt32); - String aTmpURL; - - rStm >> nFormat; - - // UNICODE: rStm >> aTmpURL; - rStm.ReadByteString(aTmpURL); - - // UNICODE: rStm >> aRepresentation; - // read to a temp string first, read text encoding and - // convert later to stay compatible to fileformat - ByteString aTempString; - rtl_TextEncoding aTempEncoding = RTL_TEXTENCODING_MS_1252; // Init for old documents - rStm.ReadByteString(aTempString); + sal_uInt16 nL = rString.Len(); + rStm << nL; + rStm.Write( rString.GetBuffer(), nL*sizeof(sal_Unicode) ); +} - rStm >> nFrameMarker; - if ( nFrameMarker == FRAME_MARKER ) +static void read_unicode( SvPersistStream & rStm, String& rString ) +{ + sal_uInt16 nL = 0; + rStm >> nL; + if ( nL ) { - // UNICODE: rStm >> aTargetFrame; - rStm.ReadByteString(aTargetFrame); - - rStm >> nCharSetMarker; - if ( nCharSetMarker == CHARSET_MARKER ) - { - USHORT nCharSet; - rStm >> nCharSet; - - // remember encoding - aTempEncoding = (rtl_TextEncoding)nCharSet; - } - else - rStm.SeekRel( -nUlongSize ); + rString.AllocBuffer( nL ); + rStm.Read( rString.GetBufferAccess(), nL*sizeof(sal_Unicode) ); + rString.ReleaseBufferAccess( nL ); } - else - rStm.SeekRel( -nUlongSize ); +} - // now build representation string due to known encoding - aRepresentation = String(aTempString, aTempEncoding); +void SvxURLField::Load( SvPersistStream & rStm ) +{ + sal_uInt16 nFormat = 0; + rStm >> nFormat; eFormat= (SvxURLFormat)nFormat; - // Relative save => make it absolute for loading - OSL_FAIL("No BaseURL!"); - // TODO/MBA: no BaseURL - aURL = INetURLObject::GetAbsURL( String(), aTmpURL ); + read_unicode( rStm, aURL ); + read_unicode( rStm, aRepresentation ); + read_unicode( rStm, aTargetFrame ); } // ----------------------------------------------------------------------- void SvxURLField::Save( SvPersistStream & rStm ) { - // Relative save of the URL - OSL_FAIL("No BaseURL!"); - // TODO/MBA: no BaseURL - String aTmpURL = INetURLObject::GetRelURL( String(), aURL ); - - rStm << (USHORT)eFormat; - - // UNICODE: rStm << aTmpURL; - rStm.WriteByteString(aTmpURL); - - // UNICODE: rStm << aRepresentation; - rStm.WriteByteString(aRepresentation); - - rStm << FRAME_MARKER; + rStm << (sal_uInt16)eFormat; - // UNICODE: rStm << aTargetFrame; - rStm.WriteByteString(aTargetFrame); - - rStm << CHARSET_MARKER; - - // #90477# rStm << (USHORT)GetStoreCharSet(gsl_getSystemTextEncoding(), rStm.GetVersion()); - rStm << (USHORT)GetSOStoreTextEncoding(gsl_getSystemTextEncoding(), (sal_uInt16)rStm.GetVersion()); + write_unicode( rStm, aURL ); + write_unicode( rStm, aRepresentation ); + write_unicode( rStm, aTargetFrame ); } MetaAction* SvxURLField::createBeginComment() const @@ -461,7 +424,7 @@ MetaAction* SvxURLField::createBeginComment() const // #i46618# Adding target URL to metafile comment return new MetaCommentAction( "FIELD_SEQ_BEGIN", 0, - reinterpret_cast<const BYTE*>(aURL.GetBuffer()), + reinterpret_cast<const sal_uInt8*>(aURL.GetBuffer()), 2*aURL.Len() ); } @@ -616,7 +579,7 @@ SvxFieldData* SvxExtTimeField::Clone() const int SvxExtTimeField::operator==( const SvxFieldData& rOther ) const { if ( rOther.Type() != Type() ) - return FALSE; + return sal_False; const SvxExtTimeField& rOtherFld = (const SvxExtTimeField&) rOther; return ( ( nFixTime == rOtherFld.nFixTime ) && @@ -628,7 +591,7 @@ int SvxExtTimeField::operator==( const SvxFieldData& rOther ) const void SvxExtTimeField::Load( SvPersistStream & rStm ) { - USHORT nType, nFormat; + sal_uInt16 nType, nFormat; rStm >> nFixTime; rStm >> nType; @@ -643,8 +606,8 @@ void SvxExtTimeField::Load( SvPersistStream & rStm ) void SvxExtTimeField::Save( SvPersistStream & rStm ) { rStm << nFixTime; - rStm << (USHORT) eType; - rStm << (USHORT) eFormat; + rStm << (sal_uInt16) eType; + rStm << (sal_uInt16) eFormat; } //---------------------------------------------------------------------------- @@ -684,7 +647,7 @@ String SvxExtTimeField::GetFormatted( Time& aTime, SvxTimeFormat eFormat, SvNumb String aFormatCode( RTL_CONSTASCII_USTRINGPARAM( "HH:MM:SS.00 AM/PM" ) ); xub_StrLen nCheckPos; short nType; - /*BOOL bInserted = */rFormatter.PutandConvertEntry( aFormatCode, + /*sal_Bool bInserted = */rFormatter.PutandConvertEntry( aFormatCode, nCheckPos, nType, nFormatKey, LANGUAGE_ENGLISH_US, eLang ); DBG_ASSERT( nCheckPos == 0, "SVXTIMEFORMAT_12_HMSH: could not insert format code" ); if ( nCheckPos ) @@ -755,7 +718,7 @@ SvxFieldData* SvxExtFileField::Clone() const int SvxExtFileField::operator==( const SvxFieldData& rOther ) const { if ( rOther.Type() != Type() ) - return FALSE; + return sal_False; const SvxExtFileField& rOtherFld = (const SvxExtFileField&) rOther; return ( ( aFile == rOtherFld.aFile ) && @@ -767,7 +730,7 @@ int SvxExtFileField::operator==( const SvxFieldData& rOther ) const void SvxExtFileField::Load( SvPersistStream & rStm ) { - USHORT nType, nFormat; + sal_uInt16 nType, nFormat; // UNICODE: rStm >> aFile; rStm.ReadByteString(aFile); @@ -786,8 +749,8 @@ void SvxExtFileField::Save( SvPersistStream & rStm ) // UNICODE: rStm << aFile; rStm.WriteByteString(aFile); - rStm << (USHORT) eType; - rStm << (USHORT) eFormat; + rStm << (sal_uInt16) eType; + rStm << (sal_uInt16) eFormat; } //---------------------------------------------------------------------------- @@ -907,7 +870,7 @@ SvxFieldData* SvxAuthorField::Clone() const int SvxAuthorField::operator==( const SvxFieldData& rOther ) const { if ( rOther.Type() != Type() ) - return FALSE; + return sal_False; const SvxAuthorField& rOtherFld = (const SvxAuthorField&) rOther; return ( ( aName == rOtherFld.aName ) && @@ -921,16 +884,11 @@ int SvxAuthorField::operator==( const SvxFieldData& rOther ) const void SvxAuthorField::Load( SvPersistStream & rStm ) { - USHORT nType, nFormat; - - // UNICODE: rStm >> aName; - rStm.ReadByteString(aName); + sal_uInt16 nType = 0, nFormat = 0; - // UNICODE: rStm >> aFirstName; - rStm.ReadByteString(aFirstName); - - // UNICODE: rStm >> aShortName; - rStm.ReadByteString(aShortName); + read_unicode( rStm, aName ); + read_unicode( rStm, aFirstName ); + read_unicode( rStm, aShortName ); rStm >> nType; rStm >> nFormat; @@ -943,17 +901,12 @@ void SvxAuthorField::Load( SvPersistStream & rStm ) void SvxAuthorField::Save( SvPersistStream & rStm ) { - // UNICODE: rStm << aName; - rStm.WriteByteString(aName); - - // UNICODE: rStm << aFirstName; - rStm.WriteByteString(aFirstName); - - // UNICODE: rStm << aShortName; - rStm.WriteByteString(aShortName); + write_unicode( rStm, aName ); + write_unicode( rStm, aFirstName ); + write_unicode( rStm, aShortName ); - rStm << (USHORT) eType; - rStm << (USHORT) eFormat; + rStm << (sal_uInt16) eType; + rStm << (sal_uInt16) eFormat; } //---------------------------------------------------------------------------- diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 45fd0b5759d7..286ed8c556ad 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -189,7 +189,7 @@ SfxItemPresentation SvxPaperBinItem::GetPresentation case SFX_ITEM_PRESENTATION_COMPLETE: { - BYTE nValue = GetValue(); + sal_uInt8 nValue = GetValue(); if ( PAPERBIN_PRINTER_SETTINGS == nValue ) rText = EE_RESSTR(RID_SVXSTR_PAPERBIN_SETTINGS); @@ -219,7 +219,7 @@ SvxSizeItem::SvxSizeItem( const sal_uInt16 nId, const Size& rSize ) : } // ----------------------------------------------------------------------- -bool SvxSizeItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxSizeItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -242,7 +242,7 @@ bool SvxSizeItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } // ----------------------------------------------------------------------- -bool SvxSizeItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxSizeItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -431,7 +431,7 @@ SvxLRSpaceItem::SvxLRSpaceItem( const long nLeft, const long nRight, } // ----------------------------------------------------------------------- -bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { bool bRet = true; sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); @@ -476,7 +476,7 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const } // ----------------------------------------------------------------------- -bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -506,9 +506,9 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) if((rVal >>= nRel) && nRel >= 0 && nRel < USHRT_MAX) { if(MID_L_REL_MARGIN== nMemberId) - nPropLeftMargin = (USHORT)nRel; + nPropLeftMargin = (sal_uInt16)nRel; else - nPropRightMargin = (USHORT)nRel; + nPropRightMargin = (sal_uInt16)nRel; } else return false; @@ -519,7 +519,7 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) break; case MID_FIRST_LINE_REL_INDENT: - SetPropTxtFirstLineOfst ( (USHORT)nVal ); + SetPropTxtFirstLineOfst ( (sal_uInt16)nVal ); break; case MID_FIRST_AUTO: @@ -824,7 +824,7 @@ SvxULSpaceItem::SvxULSpaceItem( const sal_uInt16 nUp, const sal_uInt16 nLow, } // ----------------------------------------------------------------------- -bool SvxULSpaceItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxULSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -850,7 +850,7 @@ bool SvxULSpaceItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const } // ----------------------------------------------------------------------- -bool SvxULSpaceItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxULSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -875,12 +875,12 @@ bool SvxULSpaceItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) case MID_UP_MARGIN : if(!(rVal >>= nVal) || nVal < 0) return false; - SetUpper((USHORT)(bConvert ? MM100_TO_TWIP(nVal) : nVal)); + SetUpper((sal_uInt16)(bConvert ? MM100_TO_TWIP(nVal) : nVal)); break; case MID_LO_MARGIN : if(!(rVal >>= nVal) || nVal < 0) return false; - SetLower((USHORT)(bConvert ? MM100_TO_TWIP(nVal) : nVal)); + SetLower((sal_uInt16)(bConvert ? MM100_TO_TWIP(nVal) : nVal)); break; case MID_UP_REL_MARGIN: case MID_LO_REL_MARGIN: @@ -889,9 +889,9 @@ bool SvxULSpaceItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) if((rVal >>= nRel) && nRel > 1 ) { if(MID_UP_REL_MARGIN == nMemberId) - nPropUpper = (USHORT)nRel; + nPropUpper = (sal_uInt16)nRel; else - nPropLower = (USHORT)nRel; + nPropLower = (sal_uInt16)nRel; } else return false; @@ -1165,7 +1165,7 @@ int SvxProtectItem::operator==( const SfxPoolItem& rAttr ) const bPos == ( (SvxProtectItem&)rAttr ).bPos ); } -bool SvxProtectItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxProtectItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; sal_Bool bValue; @@ -1183,7 +1183,7 @@ bool SvxProtectItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool SvxProtectItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxProtectItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; sal_Bool bVal( Any2Bool(rVal) ); @@ -1278,8 +1278,8 @@ SfxPoolItem* SvxProtectItem::Create( SvStream& rStrm, sal_uInt16 ) const // class SvxShadowItem --------------------------------------------------- -SvxShadowItem::SvxShadowItem( const USHORT nId, - const Color *pColor, const USHORT nW, +SvxShadowItem::SvxShadowItem( const sal_uInt16 nId, + const Color *pColor, const sal_uInt16 nW, const SvxShadowLocation eLoc ) : SfxEnumItemInterface( nId ), aShadowColor(COL_GRAY), @@ -1291,7 +1291,7 @@ SvxShadowItem::SvxShadowItem( const USHORT nId, } // ----------------------------------------------------------------------- -bool SvxShadowItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxShadowItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1324,7 +1324,7 @@ bool SvxShadowItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } // ----------------------------------------------------------------------- -bool SvxShadowItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1705,8 +1705,8 @@ XubString SvxBorderLine::GetValueString( SfxMapUnit eSrcUnit, bool SvxBorderLine::HasPriority( const SvxBorderLine& rOtherLine ) const { - const USHORT nThisSize = GetOutWidth() + GetDistance() + GetInWidth(); - const USHORT nOtherSize = rOtherLine.GetOutWidth() + rOtherLine.GetDistance() + rOtherLine.GetInWidth(); + const sal_uInt16 nThisSize = GetOutWidth() + GetDistance() + GetInWidth(); + const sal_uInt16 nOtherSize = rOtherLine.GetOutWidth() + rOtherLine.GetDistance() + rOtherLine.GetInWidth(); if (nThisSize > nOtherSize) { @@ -1841,7 +1841,7 @@ table::BorderLine2 SvxBoxItem::SvxLineToLine(const SvxBorderLine* pLine, sal_Boo return aLine; } // ----------------------------------------------------------------------- -bool SvxBoxItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxBoxItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); table::BorderLine2 aRetLine; @@ -1935,8 +1935,7 @@ sal_Bool SvxBoxItem::LineToSvxLine(const ::com::sun::star::table::BorderLine& rL return lcl_lineToSvxLine(rLine, rSvxLine, bConvert); } -sal_Bool -SvxBoxItem::LineToSvxLine(const ::com::sun::star::table::BorderLine2& rLine, SvxBorderLine& rSvxLine, sal_Bool bConvert) +bool SvxBoxItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { const bool bRet(lcl_lineToSvxLine(rLine, rSvxLine, bConvert)); @@ -2776,7 +2775,7 @@ void SvxBoxInfoItem::ResetFlags() nValidFlags = 0x7F; // all valid except Disable } -bool SvxBoxInfoItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxBoxInfoItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); table::BorderLine2 aRetLine; @@ -2841,7 +2840,7 @@ bool SvxBoxInfoItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const // ----------------------------------------------------------------------- -bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -2870,14 +2869,14 @@ bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) else return sal_False; if ( aSeq[3] >>= nFlags ) - nValidFlags = (BYTE)nFlags; + nValidFlags = (sal_uInt8)nFlags; else return sal_False; if (( aSeq[4] >>= nVal ) && ( nVal >= 0 )) { if( bConvert ) nVal = MM100_TO_TWIP(nVal); - SetDefDist( (USHORT)nVal ); + SetDefDist( (sal_uInt16)nVal ); } } return sal_True; @@ -2962,7 +2961,7 @@ bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) sal_Int16 nFlags = sal_Int16(); bRet = (rVal >>= nFlags); if ( bRet ) - nValidFlags = (BYTE)nFlags; + nValidFlags = (sal_uInt8)nFlags; break; } case MID_DISTANCE: @@ -2973,7 +2972,7 @@ bool SvxBoxInfoItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) { if( bConvert ) nVal = MM100_TO_TWIP(nVal); - SetDefDist( (USHORT)nVal ); + SetDefDist( (sal_uInt16)nVal ); } break; } @@ -3029,7 +3028,7 @@ XubString SvxFmtBreakItem::GetValueTextByPos( sal_uInt16 nPos ) const } // ----------------------------------------------------------------------- -bool SvxFmtBreakItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const +bool SvxFmtBreakItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { style::BreakType eBreak = style::BreakType_NONE; switch ( (SvxBreak)GetValue() ) @@ -3046,7 +3045,7 @@ bool SvxFmtBreakItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const return true; } // ----------------------------------------------------------------------- -bool SvxFmtBreakItem::PutValue( const uno::Any& rVal, BYTE /*nMemberId*/ ) +bool SvxFmtBreakItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { style::BreakType nBreak; @@ -3231,7 +3230,7 @@ SfxPoolItem* SvxLineItem::Clone( SfxItemPool* ) const return new SvxLineItem( *this ); } -bool SvxLineItem::QueryValue( uno::Any& rVal, BYTE nMemId ) const +bool SvxLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemId ) const { sal_Bool bConvert = 0!=(nMemId&CONVERT_TWIPS); nMemId &= ~CONVERT_TWIPS; @@ -3259,7 +3258,7 @@ bool SvxLineItem::QueryValue( uno::Any& rVal, BYTE nMemId ) const // ----------------------------------------------------------------------- -bool SvxLineItem::PutValue( const uno::Any& rVal, BYTE nMemId ) +bool SvxLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemId ) { sal_Bool bConvert = 0!=(nMemId&CONVERT_TWIPS); nMemId &= ~CONVERT_TWIPS; @@ -3285,9 +3284,9 @@ bool SvxLineItem::PutValue( const uno::Any& rVal, BYTE nMemId ) switch ( nMemId ) { case MID_FG_COLOR: pLine->SetColor( Color(nVal) ); break; - case MID_OUTER_WIDTH: pLine->SetOutWidth((USHORT)nVal); break; - case MID_INNER_WIDTH: pLine->SetInWidth((USHORT)nVal); break; - case MID_DISTANCE: pLine->SetDistance((USHORT)nVal); break; + case MID_OUTER_WIDTH: pLine->SetOutWidth((sal_uInt16)nVal); break; + case MID_INNER_WIDTH: pLine->SetInWidth((sal_uInt16)nVal); break; + case MID_DISTANCE: pLine->SetDistance((sal_uInt16)nVal); break; case MID_LINE_STYLE: pLine->SetStyle((SvxBorderStyle)nVal); break; default: OSL_FAIL( "Wrong MemberId" ); @@ -3667,7 +3666,7 @@ inline sal_Int8 lcl_TransparencyToPercent(sal_Int32 nTrans) return (sal_Int8)((nTrans * 100 + 127) / 254); } -bool SvxBrushItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch( nMemberId) @@ -3728,7 +3727,7 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const // ----------------------------------------------------------------------- -bool SvxBrushItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxBrushItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; switch( nMemberId) @@ -4235,7 +4234,7 @@ CntWallpaperItem* SvxBrushItem::CreateCntWallpaperItem() const { CntWallpaperItem* pItem = new CntWallpaperItem( 0 ); pItem->SetColor( aColor.GetColor() ); - pItem->SetStyle( (USHORT)GraphicPos2WallpaperStyle( GetGraphicPos() ) ); + pItem->SetStyle( (sal_uInt16)GraphicPos2WallpaperStyle( GetGraphicPos() ) ); sal_Bool bLink = (pStrLink != 0); if( bLink ) { @@ -4267,14 +4266,14 @@ void SvxBrushItem::ApplyGraphicTransparency_Impl() } // class SvxFrameDirectionItem ---------------------------------------------- -SvxFrameDirectionItem::SvxFrameDirectionItem( USHORT _nWhich ) - : SfxUInt16Item( _nWhich, (UINT16)FRMDIR_HORI_LEFT_TOP ) +SvxFrameDirectionItem::SvxFrameDirectionItem( sal_uInt16 _nWhich ) + : SfxUInt16Item( _nWhich, (sal_uInt16)FRMDIR_HORI_LEFT_TOP ) { } SvxFrameDirectionItem::SvxFrameDirectionItem( SvxFrameDirection nValue , - USHORT _nWhich ) - : SfxUInt16Item( _nWhich, (UINT16)nValue ) + sal_uInt16 _nWhich ) + : SfxUInt16Item( _nWhich, (sal_uInt16)nValue ) { } @@ -4294,21 +4293,21 @@ SfxPoolItem* SvxFrameDirectionItem::Clone( SfxItemPool * ) const return new SvxFrameDirectionItem( *this ); } -SfxPoolItem* SvxFrameDirectionItem::Create( SvStream & rStrm, USHORT /*nVer*/ ) const +SfxPoolItem* SvxFrameDirectionItem::Create( SvStream & rStrm, sal_uInt16 /*nVer*/ ) const { sal_uInt16 nValue; rStrm >> nValue; return new SvxFrameDirectionItem( (SvxFrameDirection)nValue, Which() ); } -SvStream& SvxFrameDirectionItem::Store( SvStream & rStrm, USHORT /*nIVer*/ ) const +SvStream& SvxFrameDirectionItem::Store( SvStream & rStrm, sal_uInt16 /*nIVer*/ ) const { sal_uInt16 nValue = GetValue(); rStrm << nValue; return rStrm; } -USHORT SvxFrameDirectionItem::GetVersion( USHORT nFVer ) const +sal_uInt16 SvxFrameDirectionItem::GetVersion( sal_uInt16 nFVer ) const { return SOFFICE_FILEFORMAT_50 > nFVer ? USHRT_MAX : 0; } @@ -4338,7 +4337,7 @@ SfxItemPresentation SvxFrameDirectionItem::GetPresentation( } bool SvxFrameDirectionItem::PutValue( const com::sun::star::uno::Any& rVal, - BYTE ) + sal_uInt8 ) { sal_Int16 nVal = sal_Int16(); sal_Bool bRet = ( rVal >>= nVal ); @@ -4372,7 +4371,7 @@ bool SvxFrameDirectionItem::PutValue( const com::sun::star::uno::Any& rVal, } bool SvxFrameDirectionItem::QueryValue( com::sun::star::uno::Any& rVal, - BYTE ) const + sal_uInt8 ) const { // translate SvxFrameDirection into WritingDirection2 sal_Int16 nVal; diff --git a/editeng/source/items/itemtype.cxx b/editeng/source/items/itemtype.cxx index 0d169e4b0b00..0d169e4b0b00 100644..100755 --- a/editeng/source/items/itemtype.cxx +++ b/editeng/source/items/itemtype.cxx diff --git a/editeng/source/items/justifyitem.cxx b/editeng/source/items/justifyitem.cxx index abe83500c106..d1e31d250e2f 100644..100755 --- a/editeng/source/items/justifyitem.cxx +++ b/editeng/source/items/justifyitem.cxx @@ -86,7 +86,7 @@ SfxItemPresentation SvxHorJustifyItem::GetPresentation } -bool SvxHorJustifyItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxHorJustifyItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) @@ -129,7 +129,7 @@ bool SvxHorJustifyItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool SvxHorJustifyItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxHorJustifyItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) @@ -244,7 +244,7 @@ SfxItemPresentation SvxVerJustifyItem::GetPresentation } -bool SvxVerJustifyItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxVerJustifyItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) @@ -281,7 +281,7 @@ bool SvxVerJustifyItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool SvxVerJustifyItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxVerJustifyItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; switch ( nMemberId ) @@ -391,7 +391,7 @@ SfxItemPresentation SvxJustifyMethodItem::GetPresentation } -bool SvxJustifyMethodItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const +bool SvxJustifyMethodItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { sal_Int32 nUno = table::CellJustifyMethod::AUTO; switch (static_cast<SvxCellJustifyMethod>(GetValue())) @@ -404,7 +404,7 @@ bool SvxJustifyMethodItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) cons return true; } -bool SvxJustifyMethodItem::PutValue( const uno::Any& rVal, BYTE /*nMemberId*/ ) +bool SvxJustifyMethodItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { sal_Int32 nVal = table::CellJustifyMethod::AUTO; if (!(rVal >>= nVal)) diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index 812b8e02d5ae..23a3ce8f3c80 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -110,14 +110,14 @@ SvxNumberType::~SvxNumberType() xFormatter = 0; } -String SvxNumberType::GetNumStr( ULONG nNo ) const +String SvxNumberType::GetNumStr( sal_uLong nNo ) const { LanguageType eLang = Application::GetSettings().GetLanguage(); Locale aLocale = SvxCreateLocale(eLang); return GetNumStr( nNo, aLocale ); } -String SvxNumberType::GetNumStr( ULONG nNo, const Locale& rLocale ) const +String SvxNumberType::GetNumStr( sal_uLong nNo, const Locale& rLocale ) const { lcl_getFormatter(xFormatter); String aTmpStr; @@ -206,16 +206,16 @@ SvxNumberFormat::SvxNumberFormat(SvStream &rStream) mnIndentAt( 0 ) { - USHORT nVersion; + sal_uInt16 nVersion; rStream >> nVersion; - USHORT nUSHORT; + sal_uInt16 nUSHORT; rStream >> nUSHORT; SetNumberingType((sal_Int16)nUSHORT); rStream >> nUSHORT; eNumAdjust = (SvxAdjust)nUSHORT; rStream >> nUSHORT; - nInclUpperLevels = (BYTE)nUSHORT; + nInclUpperLevels = (sal_uInt8)nUSHORT; rStream >> nUSHORT; nStart = nUSHORT; rStream >> nUSHORT; @@ -263,7 +263,7 @@ SvxNumberFormat::SvxNumberFormat(SvStream &rStream) rStream >> nUSHORT; nBulletRelSize = nUSHORT; rStream >> nUSHORT; - SetShowSymbol((BOOL)nUSHORT); + SetShowSymbol((sal_Bool)nUSHORT); if( nVersion < NUMITEM_VERSION_03 ) cBullet = ByteString::ConvertToUnicode( (sal_Char)cBullet, @@ -271,7 +271,7 @@ SvxNumberFormat::SvxNumberFormat(SvStream &rStream) : RTL_TEXTENCODING_SYMBOL ); if(pBulletFont) { - BOOL bConvertBulletFont = rStream.GetVersion() <= SOFFICE_FILEFORMAT_50; + sal_Bool bConvertBulletFont = rStream.GetVersion() <= SOFFICE_FILEFORMAT_50; if(bConvertBulletFont) { @@ -313,13 +313,13 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC pBulletFont->SetName(sFontName); } - rStream << (USHORT)NUMITEM_VERSION_04; + rStream << (sal_uInt16)NUMITEM_VERSION_04; - rStream << (USHORT)GetNumberingType(); - rStream << (USHORT)eNumAdjust; - rStream << (USHORT)nInclUpperLevels; + rStream << (sal_uInt16)GetNumberingType(); + rStream << (sal_uInt16)eNumAdjust; + rStream << (sal_uInt16)nInclUpperLevels; rStream << nStart; - rStream << (USHORT)cBullet; + rStream << (sal_uInt16)cBullet; rStream << nFirstLineOffset; rStream << nAbsLSpace; @@ -332,7 +332,7 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC rStream.WriteByteString(sCharStyleName, eEnc); if(pGraphicBrush) { - rStream << (USHORT)1; + rStream << (sal_uInt16)1; // in SD or SI force bullet itself to be stored, // for that purpose throw away link when link and graphic @@ -346,16 +346,16 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC pGraphicBrush->Store(rStream, BRUSH_GRAPHIC_VERSION); } else - rStream << (USHORT)0; + rStream << (sal_uInt16)0; - rStream << (USHORT)eVertOrient; + rStream << (sal_uInt16)eVertOrient; if(pBulletFont) { - rStream << (USHORT)1; + rStream << (sal_uInt16)1; rStream << *pBulletFont; } else - rStream << (USHORT)0; + rStream << (sal_uInt16)0; rStream << aGraphicSize; Color nTempColor = nBulletColor; @@ -363,10 +363,10 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC nTempColor = COL_BLACK; rStream << nTempColor; rStream << nBulletRelSize; - rStream << (USHORT)IsShowSymbol(); + rStream << (sal_uInt16)IsShowSymbol(); - rStream << ( USHORT ) mePositionAndSpaceMode; - rStream << ( USHORT ) meLabelFollowedBy; + rStream << ( sal_uInt16 ) mePositionAndSpaceMode; + rStream << ( sal_uInt16 ) meLabelFollowedBy; rStream << ( long ) mnListtabPos; rStream << ( long ) mnFirstLineIndent; rStream << ( long ) mnIndentAt; @@ -410,7 +410,7 @@ SvxNumberFormat& SvxNumberFormat::operator=( const SvxNumberFormat& rFormat ) return *this; } -BOOL SvxNumberFormat::operator==( const SvxNumberFormat& rFormat) const +sal_Bool SvxNumberFormat::operator==( const SvxNumberFormat& rFormat) const { if( GetNumberingType() != rFormat.GetNumberingType() || eNumAdjust != rFormat.eNumAdjust || @@ -435,14 +435,14 @@ BOOL SvxNumberFormat::operator==( const SvxNumberFormat& rFormat) const IsShowSymbol() != rFormat.IsShowSymbol() || sCharStyleName != rFormat.sCharStyleName ) - return FALSE; + return sal_False; if ( (pGraphicBrush && !rFormat.pGraphicBrush) || (!pGraphicBrush && rFormat.pGraphicBrush) || (pGraphicBrush && *pGraphicBrush != *rFormat.pGraphicBrush) ) { - return FALSE; + return sal_False; } if ( (pBulletFont && !rFormat.pBulletFont) || @@ -450,9 +450,9 @@ BOOL SvxNumberFormat::operator==( const SvxNumberFormat& rFormat) const (pBulletFont && *pBulletFont != *rFormat.pBulletFont) ) { - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } void SvxNumberFormat::SetGraphicBrush( const SvxBrushItem* pBrushItem, @@ -612,7 +612,7 @@ Size SvxNumberFormat::GetGraphicSizeMM100(const Graphic* pGraphic) return aRetSize; } -String SvxNumberFormat::CreateRomanString( ULONG nNo, BOOL bUpper ) +String SvxNumberFormat::CreateRomanString( sal_uLong nNo, sal_Bool bUpper ) { nNo %= 4000; // more can not be displayed // i, ii, iii, iv, v, vi, vii, vii, viii, ix @@ -622,11 +622,11 @@ String SvxNumberFormat::CreateRomanString( ULONG nNo, BOOL bUpper ) : "mdclxvi--"; // +2 Dummy entries! String sRet; - USHORT nMask = 1000; + sal_uInt16 nMask = 1000; while( nMask ) { - BYTE nZahl = BYTE(nNo / nMask); - BYTE nDiff = 1; + sal_uInt8 nZahl = sal_uInt8(nNo / nMask); + sal_uInt8 nDiff = 1; nNo %= nMask; if( 5 < nZahl ) @@ -666,9 +666,9 @@ const String& SvxNumberFormat::GetCharFmtName()const sal_Int32 SvxNumRule::nRefCount = 0; static SvxNumberFormat* pStdNumFmt = 0; static SvxNumberFormat* pStdOutlineNumFmt = 0; -SvxNumRule::SvxNumRule( ULONG nFeatures, - USHORT nLevels, - BOOL bCont, +SvxNumRule::SvxNumRule( sal_uLong nFeatures, + sal_uInt16 nLevels, + sal_Bool bCont, SvxNumRuleType eType, SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode ) @@ -680,7 +680,7 @@ SvxNumRule::SvxNumRule( ULONG nFeatures, ++nRefCount; LanguageType eLang = Application::GetSettings().GetLanguage(); aLocale = SvxCreateLocale(eLang); - for(USHORT i = 0; i < SVX_MAX_NUM; i++) + for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) { if(i < nLevels) { @@ -719,7 +719,7 @@ SvxNumRule::SvxNumRule( ULONG nFeatures, } else aFmts[i] = 0; - aFmtsSet[i] = FALSE; + aFmtsSet[i] = sal_False; } } @@ -732,7 +732,7 @@ SvxNumRule::SvxNumRule(const SvxNumRule& rCopy) bContinuousNumbering = rCopy.bContinuousNumbering; eNumberingType = rCopy.eNumberingType; memset( aFmts, 0, sizeof( aFmts )); - for(USHORT i = 0; i < SVX_MAX_NUM; i++) + for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) { if(rCopy.aFmts[i]) aFmts[i] = new SvxNumberFormat(*rCopy.aFmts[i]); @@ -747,31 +747,31 @@ SvxNumRule::SvxNumRule(SvStream &rStream) ++nRefCount; LanguageType eLang = Application::GetSettings().GetLanguage(); aLocale = SvxCreateLocale(eLang); - USHORT nVersion; - USHORT nTemp; + sal_uInt16 nVersion; + sal_uInt16 nTemp; rStream >> nVersion; rStream >> nLevelCount; rStream >> nTemp; nFeatureFlags = nTemp; rStream >> nTemp; - bContinuousNumbering = (BOOL)nTemp; + bContinuousNumbering = (sal_Bool)nTemp; rStream >> nTemp; eNumberingType = (SvxNumRuleType)nTemp; memset( aFmts, 0, sizeof( aFmts )); - for(USHORT i = 0; i < SVX_MAX_NUM; i++) + for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) { - USHORT nSet; + sal_uInt16 nSet; rStream >> nSet; if(nSet) aFmts[i] = new SvxNumberFormat(rStream); else aFmts[i] = 0; - aFmtsSet[i] = aFmts[i] ? TRUE : FALSE; + aFmtsSet[i] = aFmts[i] ? sal_True : sal_False; } if(NUMITEM_VERSION_02 <= nVersion) { - USHORT nShort; + sal_uInt16 nShort; rStream >> nShort; nFeatureFlags = nShort; } @@ -779,20 +779,20 @@ SvxNumRule::SvxNumRule(SvStream &rStream) SvStream& SvxNumRule::Store(SvStream &rStream) { - rStream<<(USHORT)NUMITEM_VERSION_03; + rStream<<(sal_uInt16)NUMITEM_VERSION_03; rStream<<nLevelCount; //first save of nFeatureFlags for old versions - rStream<<(USHORT)nFeatureFlags; - rStream<<(USHORT)bContinuousNumbering; - rStream<<(USHORT)eNumberingType; + rStream<<(sal_uInt16)nFeatureFlags; + rStream<<(sal_uInt16)bContinuousNumbering; + rStream<<(sal_uInt16)eNumberingType; FontToSubsFontConverter pConverter = 0; - BOOL bConvertBulletFont = rStream.GetVersion() <= SOFFICE_FILEFORMAT_50; - for(USHORT i = 0; i < SVX_MAX_NUM; i++) + sal_Bool bConvertBulletFont = rStream.GetVersion() <= SOFFICE_FILEFORMAT_50; + for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) { if(aFmts[i]) { - rStream << USHORT(1); + rStream << sal_uInt16(1); if(bConvertBulletFont && aFmts[i]->GetBulletFont()) { if(!pConverter) @@ -803,10 +803,10 @@ SvStream& SvxNumRule::Store(SvStream &rStream) aFmts[i]->Store(rStream, pConverter); } else - rStream << USHORT(0); + rStream << sal_uInt16(0); } //second save of nFeatureFlags for new versions - rStream<<(USHORT)nFeatureFlags; + rStream<<(sal_uInt16)nFeatureFlags; if(pConverter) DestroyFontToSubsFontConverter(pConverter); @@ -815,7 +815,7 @@ SvStream& SvxNumRule::Store(SvStream &rStream) SvxNumRule::~SvxNumRule() { - for(USHORT i = 0; i < SVX_MAX_NUM; i++) + for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) delete aFmts[i]; if(!--nRefCount) { @@ -830,7 +830,7 @@ SvxNumRule& SvxNumRule::operator=( const SvxNumRule& rCopy ) nFeatureFlags = rCopy.nFeatureFlags; bContinuousNumbering = rCopy.bContinuousNumbering; eNumberingType = rCopy.eNumberingType; - for(USHORT i = 0; i < SVX_MAX_NUM; i++) + for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) { delete aFmts[i]; if(rCopy.aFmts[i]) @@ -848,8 +848,8 @@ int SvxNumRule::operator==( const SvxNumRule& rCopy) const nFeatureFlags != rCopy.nFeatureFlags || bContinuousNumbering != rCopy.bContinuousNumbering || eNumberingType != rCopy.eNumberingType) - return FALSE; - for(USHORT i = 0; i < nLevelCount; i++) + return sal_False; + for(sal_uInt16 i = 0; i < nLevelCount; i++) { if ( (aFmtsSet[i] != rCopy.aFmtsSet[i]) || @@ -858,13 +858,13 @@ int SvxNumRule::operator==( const SvxNumRule& rCopy) const (aFmts[i] && *aFmts[i] != *rCopy.aFmts[i]) ) { - return FALSE; + return sal_False; } } - return TRUE; + return sal_True; } -const SvxNumberFormat* SvxNumRule::Get(USHORT nLevel)const +const SvxNumberFormat* SvxNumRule::Get(sal_uInt16 nLevel)const { DBG_ASSERT(nLevel < SVX_MAX_NUM, "Wrong Level" ); if( nLevel < SVX_MAX_NUM ) @@ -873,7 +873,7 @@ const SvxNumberFormat* SvxNumRule::Get(USHORT nLevel)const return 0; } -const SvxNumberFormat& SvxNumRule::GetLevel(USHORT nLevel)const +const SvxNumberFormat& SvxNumRule::GetLevel(sal_uInt16 nLevel)const { if(!pStdNumFmt) { @@ -888,8 +888,7 @@ const SvxNumberFormat& SvxNumRule::GetLevel(USHORT nLevel)const *pStdNumFmt : *pStdOutlineNumFmt; } - -void SvxNumRule::SetLevel( USHORT i, const SvxNumberFormat& rNumFmt, BOOL bIsValid ) +void SvxNumRule::SetLevel( sal_uInt16 i, const SvxNumberFormat& rNumFmt, sal_Bool bIsValid ) { DBG_ASSERT(i < SVX_MAX_NUM, "Wrong Level" ); @@ -901,7 +900,7 @@ void SvxNumRule::SetLevel( USHORT i, const SvxNumberFormat& rNumFmt, BOOL bIsVal } } -void SvxNumRule::SetLevel(USHORT nLevel, const SvxNumberFormat* pFmt) +void SvxNumRule::SetLevel(sal_uInt16 nLevel, const SvxNumberFormat* pFmt) { DBG_ASSERT(nLevel < SVX_MAX_NUM, "Wrong Level" ); @@ -918,7 +917,7 @@ void SvxNumRule::SetLevel(USHORT nLevel, const SvxNumberFormat* pFmt) } } -String SvxNumRule::MakeNumString( const SvxNodeNum& rNum, BOOL bInclStrings ) const +String SvxNumRule::MakeNumString( const SvxNodeNum& rNum, sal_Bool bInclStrings ) const { String aStr; if( SVX_NO_NUM > rNum.GetLevel() && !( SVX_NO_NUMLEVEL & rNum.GetLevel() ) ) @@ -926,12 +925,12 @@ String SvxNumRule::MakeNumString( const SvxNodeNum& rNum, BOOL bInclStrings ) c const SvxNumberFormat& rMyNFmt = GetLevel( rNum.GetLevel() ); if( SVX_NUM_NUMBER_NONE != rMyNFmt.GetNumberingType() ) { - BYTE i = rNum.GetLevel(); + sal_uInt8 i = rNum.GetLevel(); if( !IsContinuousNumbering() && 1 < rMyNFmt.GetIncludeUpperLevels() ) // only on own level? { - BYTE n = rMyNFmt.GetIncludeUpperLevels(); + sal_uInt8 n = rMyNFmt.GetIncludeUpperLevels(); if( 1 < n ) { if( i+1 >= n ) @@ -974,10 +973,10 @@ String SvxNumRule::MakeNumString( const SvxNodeNum& rNum, BOOL bInclStrings ) c } // changes linked to embedded bitmaps -BOOL SvxNumRule::UnLinkGraphics() +sal_Bool SvxNumRule::UnLinkGraphics() { - BOOL bRet = FALSE; - for(USHORT i = 0; i < GetLevelCount(); i++) + sal_Bool bRet = sal_False; + for(sal_uInt16 i = 0; i < GetLevelCount(); i++) { SvxNumberFormat aFmt(GetLevel(i)); const SvxBrushItem* pBrush = aFmt.GetBrush(); @@ -995,7 +994,7 @@ BOOL SvxNumRule::UnLinkGraphics() aTempItem.SetGraphic(*pGraphic); sal_Int16 eOrient = aFmt.GetVertOrient(); aFmt.SetGraphicBrush( &aTempItem, &aFmt.GetGraphicSize(), &eOrient ); - bRet = TRUE; + bRet = sal_True; } } else if((SVX_NUM_BITMAP|LINK_TOKEN) == aFmt.GetNumberingType()) @@ -1011,13 +1010,13 @@ SvxNumBulletItem::SvxNumBulletItem(SvxNumRule& rRule) : { } -SvxNumBulletItem::SvxNumBulletItem(SvxNumRule& rRule, USHORT _nWhich ) : +SvxNumBulletItem::SvxNumBulletItem(SvxNumRule& rRule, sal_uInt16 _nWhich ) : SfxPoolItem(_nWhich), pNumRule(new SvxNumRule(rRule)) { } -SfxPoolItem* SvxNumBulletItem::Create(SvStream &s, USHORT n) const +SfxPoolItem* SvxNumBulletItem::Create(SvStream &s, sal_uInt16 n) const { return SfxPoolItem::Create(s, n ); } @@ -1043,24 +1042,24 @@ SfxPoolItem* SvxNumBulletItem::Clone( SfxItemPool * ) const return new SvxNumBulletItem(*this); } -USHORT SvxNumBulletItem::GetVersion( USHORT /*nFileVersion*/ ) const +sal_uInt16 SvxNumBulletItem::GetVersion( sal_uInt16 /*nFileVersion*/ ) const { return NUMITEM_VERSION_03; } -SvStream& SvxNumBulletItem::Store(SvStream &rStream, USHORT /*nItemVersion*/ )const +SvStream& SvxNumBulletItem::Store(SvStream &rStream, sal_uInt16 /*nItemVersion*/ )const { pNumRule->Store(rStream); return rStream; } -bool SvxNumBulletItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const +bool SvxNumBulletItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { rVal <<= SvxCreateNumRule( pNumRule ); return true; } -bool SvxNumBulletItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) +bool SvxNumBulletItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { uno::Reference< container::XIndexReplace > xRule; if( rVal >>= xRule ) @@ -1086,12 +1085,12 @@ bool SvxNumBulletItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*nM return false; } -SvxNumRule* SvxConvertNumRule( const SvxNumRule* pRule, USHORT nLevels, SvxNumRuleType eType ) +SvxNumRule* SvxConvertNumRule( const SvxNumRule* pRule, sal_uInt16 nLevels, SvxNumRuleType eType ) { - const USHORT nSrcLevels = pRule->GetLevelCount(); + const sal_uInt16 nSrcLevels = pRule->GetLevelCount(); SvxNumRule* pNewRule = new SvxNumRule( pRule->GetFeatureFlags(), nLevels, pRule->IsContinuousNumbering(), eType ); - for( USHORT nLevel = 0; (nLevel < nLevels) && (nLevel < nSrcLevels); nLevel++ ) + for( sal_uInt16 nLevel = 0; (nLevel < nLevels) && (nLevel < nSrcLevels); nLevel++ ) pNewRule->SetLevel( nLevel, pRule->GetLevel( nLevel ) ); return pNewRule; diff --git a/editeng/source/items/optitems.cxx b/editeng/source/items/optitems.cxx index 260191080088..260191080088 100644..100755 --- a/editeng/source/items/optitems.cxx +++ b/editeng/source/items/optitems.cxx diff --git a/editeng/source/items/page.src b/editeng/source/items/page.src index 9fe7f3013ce6..c528dc8b0bd0 100644..100755 --- a/editeng/source/items/page.src +++ b/editeng/source/items/page.src @@ -29,154 +29,6 @@ #include <editeng/editrids.hrc> -String RID_SVXSTR_PAPER_A0 -{ - Text = "A0" ; -}; -String RID_SVXSTR_PAPER_A1 -{ - Text = "A1" ; -}; -String RID_SVXSTR_PAPER_A2 -{ - Text = "A2" ; -}; -String RID_SVXSTR_PAPER_A3 -{ - Text = "A3" ; -}; -String RID_SVXSTR_PAPER_A4 -{ - Text = "A4" ; -}; -String RID_SVXSTR_PAPER_A5 -{ - Text = "A5" ; -}; -String RID_SVXSTR_PAPER_B4_ISO -{ - Text = "B4 (ISO)" ; -}; -String RID_SVXSTR_PAPER_B5_ISO -{ - Text = "B5 (ISO)" ; -}; -String RID_SVXSTR_PAPER_LETTER -{ - Text = "Letter" ; -}; -String RID_SVXSTR_PAPER_LEGAL -{ - Text = "Legal" ; -}; -String RID_SVXSTR_PAPER_TABLOID -{ - Text = "Tabloid" ; -}; -String RID_SVXSTR_PAPER_USER -{ - Text [ en-US ] = "User Defined" ; -}; -String RID_SVXSTR_PAPER_B6_ISO -{ - Text = "B6 (ISO)" ; -}; -String RID_SVXSTR_PAPER_C4 -{ - Text = "C4 Envelope" ; -}; -String RID_SVXSTR_PAPER_C5 -{ - Text = "C5 Envelope" ; -}; -String RID_SVXSTR_PAPER_C6 -{ - Text = "C6 Envelope" ; -}; -String RID_SVXSTR_PAPER_C65 -{ - Text = "C6/5 Envelope" ; -}; -String RID_SVXSTR_PAPER_DL -{ - Text = "DL Envelope" ; -}; -String RID_SVXSTR_PAPER_DIA -{ - Text = "Dia Slide" ; -}; -String RID_SVXSTR_PAPER_SCREEN -{ - Text [ en-US ] = "Screen" ; -}; -String RID_SVXSTR_PAPER_C -{ - Text = "C" ; -}; -String RID_SVXSTR_PAPER_D -{ - Text = "D" ; -}; -String RID_SVXSTR_PAPER_E -{ - Text = "E" ; -}; -String RID_SVXSTR_PAPER_EXECUTIVE -{ - Text = "Executive" ; -}; -String RID_SVXSTR_PAPER_LEGAL2 -{ - Text = "Long Bond" ; -}; -String RID_SVXSTR_PAPER_MONARCH -{ - Text = "#8 (Monarch) Envelope" ; -}; -String RID_SVXSTR_PAPER_COM675 -{ - Text = "#6 3/4 (Personal) Envelope" ; -}; -String RID_SVXSTR_PAPER_COM9 -{ - Text = "#9 Envelope" ; -}; -String RID_SVXSTR_PAPER_COM10 -{ - Text = "#10 Envelope" ; -}; -String RID_SVXSTR_PAPER_COM11 -{ - Text = "#11 Envelope" ; -}; -String RID_SVXSTR_PAPER_COM12 -{ - Text = "#12 Envelope" ; -}; -String RID_SVXSTR_PAPER_KAI16 -{ - Text = "16 Kai" ; -}; -String RID_SVXSTR_PAPER_KAI32 -{ - Text = "32 Kai" ; -}; -String RID_SVXSTR_PAPER_KAI32BIG -{ - Text = "Big 32 Kai" ; -}; -String RID_SVXSTR_PAPER_B4_JIS -{ - Text = "B4 (JIS)" ; -}; -String RID_SVXSTR_PAPER_B5_JIS -{ - Text = "B5 (JIS)" ; -}; -String RID_SVXSTR_PAPER_B6_JIS -{ - Text = "B6 (JIS)" ; -}; String RID_SVXSTR_PAPERBIN { Text [ en-US ] = "Paper tray" ; diff --git a/editeng/source/items/paperinf.cxx b/editeng/source/items/paperinf.cxx index 7881c069c797..9d48831776b0 100644..100755 --- a/editeng/source/items/paperinf.cxx +++ b/editeng/source/items/paperinf.cxx @@ -43,9 +43,9 @@ Description: Is the printer valid --------------------------------------------------------------------*/ -inline BOOL IsValidPrinter( const Printer* pPtr ) +inline sal_Bool IsValidPrinter( const Printer* pPtr ) { - return pPtr->GetName().Len() ? TRUE : FALSE; + return pPtr->GetName().Len() ? sal_True : sal_False; } //------------------------------------------------------------------------ @@ -134,51 +134,7 @@ Size SvxPaperInfo::GetDefaultPaperSize( MapUnit eUnit ) String SvxPaperInfo::GetName( Paper ePaper ) { - USHORT nResId = 0; - - switch ( ePaper ) - { - case PAPER_A0: nResId = RID_SVXSTR_PAPER_A0; break; - case PAPER_A1: nResId = RID_SVXSTR_PAPER_A1; break; - case PAPER_A2: nResId = RID_SVXSTR_PAPER_A2; break; - case PAPER_A3: nResId = RID_SVXSTR_PAPER_A3; break; - case PAPER_A4: nResId = RID_SVXSTR_PAPER_A4; break; - case PAPER_A5: nResId = RID_SVXSTR_PAPER_A5; break; - case PAPER_B4_ISO: nResId = RID_SVXSTR_PAPER_B4_ISO; break; - case PAPER_B5_ISO: nResId = RID_SVXSTR_PAPER_B5_ISO; break; - case PAPER_LETTER: nResId = RID_SVXSTR_PAPER_LETTER; break; - case PAPER_LEGAL: nResId = RID_SVXSTR_PAPER_LEGAL; break; - case PAPER_TABLOID: nResId = RID_SVXSTR_PAPER_TABLOID; break; - case PAPER_USER: nResId = RID_SVXSTR_PAPER_USER; break; - case PAPER_B6_ISO: nResId = RID_SVXSTR_PAPER_B6_ISO; break; - case PAPER_ENV_C4: nResId = RID_SVXSTR_PAPER_C4; break; - case PAPER_ENV_C5: nResId = RID_SVXSTR_PAPER_C5; break; - case PAPER_ENV_C6: nResId = RID_SVXSTR_PAPER_C6; break; - case PAPER_ENV_C65: nResId = RID_SVXSTR_PAPER_C65; break; - case PAPER_ENV_DL: nResId = RID_SVXSTR_PAPER_DL; break; - case PAPER_SLIDE_DIA: nResId = RID_SVXSTR_PAPER_DIA; break; - case PAPER_SCREEN: nResId = RID_SVXSTR_PAPER_SCREEN; break; - case PAPER_C: nResId = RID_SVXSTR_PAPER_C; break; - case PAPER_D: nResId = RID_SVXSTR_PAPER_D; break; - case PAPER_E: nResId = RID_SVXSTR_PAPER_E; break; - case PAPER_EXECUTIVE: nResId = RID_SVXSTR_PAPER_EXECUTIVE;break; - case PAPER_FANFOLD_LEGAL_DE: nResId = RID_SVXSTR_PAPER_LEGAL2; break; - case PAPER_ENV_MONARCH: nResId = RID_SVXSTR_PAPER_MONARCH; break; - case PAPER_ENV_PERSONAL: nResId = RID_SVXSTR_PAPER_COM675; break; - case PAPER_ENV_9: nResId = RID_SVXSTR_PAPER_COM9; break; - case PAPER_ENV_10: nResId = RID_SVXSTR_PAPER_COM10; break; - case PAPER_ENV_11: nResId = RID_SVXSTR_PAPER_COM11; break; - case PAPER_ENV_12: nResId = RID_SVXSTR_PAPER_COM12; break; - case PAPER_KAI16: nResId = RID_SVXSTR_PAPER_KAI16; break; - case PAPER_KAI32: nResId = RID_SVXSTR_PAPER_KAI32; break; - case PAPER_KAI32BIG: nResId = RID_SVXSTR_PAPER_KAI32BIG; break; - case PAPER_B4_JIS: nResId = RID_SVXSTR_PAPER_B4_JIS; break; - case PAPER_B5_JIS: nResId = RID_SVXSTR_PAPER_B5_JIS; break; - case PAPER_B6_JIS: nResId = RID_SVXSTR_PAPER_B6_JIS; break; - default: DBG_ERRORFILE( "unknown papersize" ); - } - - return ( nResId > 0 ) ? String( EditResId( nResId ) ) : String(); + return String( Printer::GetPaperName( ePaper ) ); } diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index d8807301872b..7e1bfa4843fb 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -145,7 +145,7 @@ int SvxLineSpacingItem::operator==( const SfxPoolItem& rAttr ) const - ein sal_uInt16 for the mode - ein sal_uInt32 for all values (distance, height, rel. detail) */ -bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -190,7 +190,7 @@ bool SvxLineSpacingItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -241,7 +241,7 @@ bool SvxLineSpacingItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) eLineSpace = aLSp.Mode == style::LineSpacingMode::FIX ? SVX_LINE_SPACE_FIX : SVX_LINE_SPACE_MIN; nLineHeight = aLSp.Height; if(bConvert) - nLineHeight = (USHORT)MM100_TO_TWIP_UNSIGNED(nLineHeight); + nLineHeight = (sal_uInt16)MM100_TO_TWIP_UNSIGNED(nLineHeight); } break; } @@ -382,7 +382,7 @@ int SvxAdjustItem::operator==( const SfxPoolItem& rAttr ) const ? 1 : 0 ); } -bool SvxAdjustItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) @@ -400,7 +400,7 @@ bool SvxAdjustItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool SvxAdjustItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) @@ -420,7 +420,7 @@ bool SvxAdjustItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) eVal != SVX_ADJUST_LEFT && eVal != SVX_ADJUST_BLOCK && eVal != SVX_ADJUST_CENTER) - return FALSE; + return sal_False; if(eVal < (sal_uInt16)SVX_ADJUST_END) nMemberId == MID_PARA_ADJUST ? SetAdjust((SvxAdjust)eVal) : @@ -542,7 +542,7 @@ SvStream& SvxAdjustItem::Store( SvStream& rStrm, sal_uInt16 nItemVersion ) const // class SvxWidowsItem --------------------------------------------------- -SvxWidowsItem::SvxWidowsItem(const BYTE nL, const USHORT nId ) : +SvxWidowsItem::SvxWidowsItem(const sal_uInt8 nL, const sal_uInt16 nId ) : SfxByteItem( nId, nL ) { } @@ -614,7 +614,7 @@ SfxItemPresentation SvxWidowsItem::GetPresentation // class SvxOrphansItem -------------------------------------------------- -SvxOrphansItem::SvxOrphansItem(const BYTE nL, const USHORT nId ) : +SvxOrphansItem::SvxOrphansItem(const sal_uInt8 nL, const sal_uInt16 nId ) : SfxByteItem( nId, nL ) { } @@ -696,7 +696,7 @@ SvxHyphenZoneItem::SvxHyphenZoneItem( const sal_Bool bHyph, const sal_uInt16 nId } // ----------------------------------------------------------------------- -bool SvxHyphenZoneItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxHyphenZoneItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) @@ -717,7 +717,7 @@ bool SvxHyphenZoneItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } // ----------------------------------------------------------------------- -bool SvxHyphenZoneItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxHyphenZoneItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; sal_Int16 nNewVal = 0; @@ -732,13 +732,13 @@ bool SvxHyphenZoneItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) bHyphen = Any2Bool(rVal); break; case MID_HYPHEN_MIN_LEAD: - nMinLead = (BYTE)nNewVal; + nMinLead = (sal_uInt8)nNewVal; break; case MID_HYPHEN_MIN_TRAIL: - nMinTrail = (BYTE)nNewVal; + nMinTrail = (sal_uInt8)nNewVal; break; case MID_HYPHEN_MAX_HYPHENS: - nMaxHyphens = (BYTE)nNewVal; + nMaxHyphens = (sal_uInt8)nNewVal; break; } return true; @@ -976,7 +976,7 @@ SvxTabStopItem& SvxTabStopItem::operator=( const SvxTabStopItem& rTSI ) return *this; } -bool SvxTabStopItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxTabStopItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1017,7 +1017,7 @@ bool SvxTabStopItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return sal_True; } -bool SvxTabStopItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxTabStopItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1339,7 +1339,7 @@ SfxPoolItem* SvxPageModelItem::Clone( SfxItemPool* ) const //------------------------------------------------------------------------ -bool SvxPageModelItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberId ) const +bool SvxPageModelItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; @@ -1353,7 +1353,7 @@ bool SvxPageModelItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE nMemberI return sal_True; } -bool SvxPageModelItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE nMemberId ) +bool SvxPageModelItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; sal_Bool bRet; @@ -1413,14 +1413,14 @@ SfxPoolItem* SvxScriptSpaceItem::Clone( SfxItemPool * ) const return new SvxScriptSpaceItem( GetValue(), Which() ); } -SfxPoolItem* SvxScriptSpaceItem::Create(SvStream & rStrm, USHORT) const +SfxPoolItem* SvxScriptSpaceItem::Create(SvStream & rStrm, sal_uInt16) const { sal_Bool bFlag; rStrm >> bFlag; return new SvxScriptSpaceItem( bFlag, Which() ); } -USHORT SvxScriptSpaceItem::GetVersion( USHORT nFFVer ) const +sal_uInt16 SvxScriptSpaceItem::GetVersion( sal_uInt16 nFFVer ) const { DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || @@ -1466,14 +1466,14 @@ SfxPoolItem* SvxHangingPunctuationItem::Clone( SfxItemPool * ) const return new SvxHangingPunctuationItem( GetValue(), Which() ); } -SfxPoolItem* SvxHangingPunctuationItem::Create(SvStream & rStrm, USHORT) const +SfxPoolItem* SvxHangingPunctuationItem::Create(SvStream & rStrm, sal_uInt16) const { sal_Bool nValue; rStrm >> nValue; return new SvxHangingPunctuationItem( nValue, Which() ); } -USHORT SvxHangingPunctuationItem::GetVersion( USHORT nFFVer ) const +sal_uInt16 SvxHangingPunctuationItem::GetVersion( sal_uInt16 nFFVer ) const { DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || @@ -1519,14 +1519,14 @@ SfxPoolItem* SvxForbiddenRuleItem::Clone( SfxItemPool * ) const return new SvxForbiddenRuleItem( GetValue(), Which() ); } -SfxPoolItem* SvxForbiddenRuleItem::Create(SvStream & rStrm, USHORT) const +SfxPoolItem* SvxForbiddenRuleItem::Create(SvStream & rStrm, sal_uInt16) const { sal_Bool nValue; rStrm >> nValue; return new SvxForbiddenRuleItem( nValue, Which() ); } -USHORT SvxForbiddenRuleItem::GetVersion( USHORT nFFVer ) const +sal_uInt16 SvxForbiddenRuleItem::GetVersion( sal_uInt16 nFFVer ) const { DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || @@ -1575,20 +1575,20 @@ SfxPoolItem* SvxParaVertAlignItem::Clone( SfxItemPool* ) const return new SvxParaVertAlignItem( GetValue(), Which() ); } -SfxPoolItem* SvxParaVertAlignItem::Create( SvStream& rStrm, USHORT ) const +SfxPoolItem* SvxParaVertAlignItem::Create( SvStream& rStrm, sal_uInt16 ) const { sal_uInt16 nVal; rStrm >> nVal; return new SvxParaVertAlignItem( nVal, Which() ); } -SvStream& SvxParaVertAlignItem::Store( SvStream & rStrm, USHORT ) const +SvStream& SvxParaVertAlignItem::Store( SvStream & rStrm, sal_uInt16 ) const { rStrm << GetValue(); return rStrm; } -USHORT SvxParaVertAlignItem::GetVersion( USHORT nFFVer ) const +sal_uInt16 SvxParaVertAlignItem::GetVersion( sal_uInt16 nFFVer ) const { return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0; } @@ -1606,7 +1606,7 @@ SfxItemPresentation SvxParaVertAlignItem::GetPresentation( case SFX_ITEM_PRESENTATION_NAMELESS: case SFX_ITEM_PRESENTATION_COMPLETE: { - USHORT nTmp; + sal_uInt16 nTmp; switch( GetValue() ) { case AUTOMATIC: nTmp = RID_SVXITEMS_PARAVERTALIGN_AUTO; break; @@ -1625,19 +1625,19 @@ SfxItemPresentation SvxParaVertAlignItem::GetPresentation( } bool SvxParaVertAlignItem::QueryValue( com::sun::star::uno::Any& rVal, - BYTE /*nMemberId*/ ) const + sal_uInt8 /*nMemberId*/ ) const { rVal <<= (sal_Int16)GetValue(); return sal_True; } bool SvxParaVertAlignItem::PutValue( const com::sun::star::uno::Any& rVal, - BYTE /*nMemberId*/ ) + sal_uInt8 /*nMemberId*/ ) { sal_Int16 nVal = sal_Int16(); if((rVal >>= nVal) && nVal >=0 && nVal <= BOTTOM ) { - SetValue( (USHORT)nVal ); + SetValue( (sal_uInt16)nVal ); return sal_True; } else @@ -1661,14 +1661,14 @@ SfxPoolItem* SvxParaGridItem::Clone( SfxItemPool * ) const return new SvxParaGridItem( GetValue(), Which() ); } -SfxPoolItem* SvxParaGridItem::Create(SvStream & rStrm, USHORT) const +SfxPoolItem* SvxParaGridItem::Create(SvStream & rStrm, sal_uInt16) const { sal_Bool bFlag; rStrm >> bFlag; return new SvxParaGridItem( bFlag, Which() ); } -USHORT SvxParaGridItem::GetVersion( USHORT nFFVer ) const +sal_uInt16 SvxParaGridItem::GetVersion( sal_uInt16 nFFVer ) const { DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || diff --git a/editeng/source/items/svdfield.cxx b/editeng/source/items/svdfield.cxx index d530406956e9..41f0bc8faae1 100644..100755 --- a/editeng/source/items/svdfield.cxx +++ b/editeng/source/items/svdfield.cxx @@ -49,14 +49,14 @@ int SdrMeasureField::operator==(const SvxFieldData& rSrc) const void SdrMeasureField::Load(SvPersistStream& rIn) { - UINT16 nFieldKind; + sal_uInt16 nFieldKind; rIn>>nFieldKind; eMeasureFieldKind=(SdrMeasureFieldKind)nFieldKind; } void SdrMeasureField::Save(SvPersistStream& rOut) { - rOut<<(UINT16)eMeasureFieldKind; + rOut<<(sal_uInt16)eMeasureFieldKind; } ////////////////////////////////////////////////////////////////////////////// diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx index 62227cc40676..e7062bfbf5dc 100644 --- a/editeng/source/items/svxfont.cxx +++ b/editeng/source/items/svxfont.cxx @@ -81,7 +81,7 @@ SvxFont::SvxFont( const SvxFont &rFont ) void SvxFont::DrawArrow( OutputDevice &rOut, const Rectangle& rRect, - const Size& rSize, const Color& rCol, BOOL bLeft ) + const Size& rSize, const Color& rCol, sal_Bool bLeft ) { long nLeft = ( rRect.Left() + rRect.Right() - rSize.Width() )/ 2; long nRight = nLeft + rSize.Width(); @@ -146,12 +146,12 @@ XubString SvxFont::CalcCaseMap( const XubString &rTxt ) const // Every beginning of a word is capitalized, the rest of the word // is taken over as is. // Bug: if the attribute starts in the middle of the word. - BOOL bBlank = TRUE; + sal_Bool bBlank = sal_True; - for( USHORT i = 0; i < aTxt.Len(); ++i ) + for( sal_uInt16 i = 0; i < aTxt.Len(); ++i ) { if( sal_Unicode(' ') == aTxt.GetChar(i) || sal_Unicode('\t') == aTxt.GetChar(i) ) - bBlank = TRUE; + bBlank = sal_True; else { if( bBlank ) @@ -160,7 +160,7 @@ XubString SvxFont::CalcCaseMap( const XubString &rTxt ) const aCharClass.toUpper( aTemp ); aTxt.Replace( i, 1, aTemp ); } - bBlank = FALSE; + bBlank = sal_False; } } break; @@ -201,11 +201,11 @@ public: : pOut(_pOut), rTxt(_rTxt), nIdx(_nIdx), nLen(_nLen) { } - virtual void DoSpace( const BOOL bDraw ); + virtual void DoSpace( const sal_Bool bDraw ); virtual void SetSpace(); virtual void Do( const XubString &rTxt, const xub_StrLen nIdx, const xub_StrLen nLen, - const BOOL bUpper ) = 0; + const sal_Bool bUpper ) = 0; inline OutputDevice *GetOut() { return pOut; } inline const XubString &GetTxt() const { return rTxt; } @@ -213,12 +213,12 @@ public: xub_StrLen GetLen() const { return nLen; } }; -void SvxDoCapitals::DoSpace( const BOOL /*bDraw*/ ) { } +void SvxDoCapitals::DoSpace( const sal_Bool /*bDraw*/ ) { } void SvxDoCapitals::SetSpace() { } void SvxDoCapitals::Do( const XubString &/*_rTxt*/, const xub_StrLen /*_nIdx*/, - const xub_StrLen /*_nLen*/, const BOOL /*bUpper*/ ) { } + const xub_StrLen /*_nLen*/, const sal_Bool /*bUpper*/ ) { } /************************************************************************* * SvxFont::DoOnCapitals() const @@ -233,9 +233,9 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const const xub_StrLen nLen = STRING_LEN == nPartLen ? rDo.GetLen() : nPartLen; const XubString aTxt( CalcCaseMap( rTxt ) ); - const USHORT nTxtLen = Min( rTxt.Len(), nLen ); - USHORT nPos = 0; - USHORT nOldPos = nPos; + const sal_uInt16 nTxtLen = Min( rTxt.Len(), nLen ); + sal_uInt16 nPos = 0; + sal_uInt16 nOldPos = nPos; // #108210# // Test if string length differ between original and CaseMapped @@ -275,11 +275,11 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const const XubString aSnippet(rTxt, nIdx + nOldPos, nPos-nOldPos); XubString aNewText = CalcCaseMap(aSnippet); - rDo.Do( aNewText, 0, aNewText.Len(), TRUE ); + rDo.Do( aNewText, 0, aNewText.Len(), sal_True ); } else { - rDo.Do( aTxt, nIdx + nOldPos, nPos-nOldPos, TRUE ); + rDo.Do( aTxt, nIdx + nOldPos, nPos-nOldPos, sal_True ); } nOldPos = nPos; @@ -305,11 +305,11 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const const XubString aSnippet(rTxt, nIdx + nOldPos, nPos - nOldPos); XubString aNewText = CalcCaseMap(aSnippet); - rDo.Do( aNewText, 0, aNewText.Len(), FALSE ); + rDo.Do( aNewText, 0, aNewText.Len(), sal_False ); } else { - rDo.Do( aTxt, nIdx + nOldPos, nPos-nOldPos, FALSE ); + rDo.Do( aTxt, nIdx + nOldPos, nPos-nOldPos, sal_False ); } nOldPos = nPos; @@ -320,7 +320,7 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const if( nOldPos != nPos ) { - rDo.DoSpace( FALSE ); + rDo.DoSpace( sal_False ); if(bCaseMapLengthDiffers) { @@ -330,18 +330,18 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const const XubString aSnippet(rTxt, nIdx + nOldPos, nPos - nOldPos); XubString aNewText = CalcCaseMap(aSnippet); - rDo.Do( aNewText, 0, aNewText.Len(), FALSE ); + rDo.Do( aNewText, 0, aNewText.Len(), sal_False ); } else { - rDo.Do( aTxt, nIdx + nOldPos, nPos - nOldPos, FALSE ); + rDo.Do( aTxt, nIdx + nOldPos, nPos - nOldPos, sal_False ); } nOldPos = nPos; rDo.SetSpace(); } } - rDo.DoSpace( TRUE ); + rDo.DoSpace( sal_True ); } @@ -432,7 +432,7 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const XubString &rTxt ) } Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const XubString &rTxt, - const USHORT nIdx, const USHORT nLen, sal_Int32* pDXArray ) const + const sal_uInt16 nIdx, const sal_uInt16 nLen, sal_Int32* pDXArray ) const { if ( !IsCaseMap() && !IsKern() ) return Size( pOut->GetTextArray( rTxt, pDXArray, nIdx, nLen ), @@ -657,18 +657,18 @@ public: { } virtual void Do( const XubString &rTxt, const xub_StrLen nIdx, - const xub_StrLen nLen, const BOOL bUpper ); + const xub_StrLen nLen, const sal_Bool bUpper ); inline const Size &GetSize() const { return aTxtSize; }; }; void SvxDoGetCapitalSize::Do( const XubString &_rTxt, const xub_StrLen _nIdx, - const xub_StrLen _nLen, const BOOL bUpper ) + const xub_StrLen _nLen, const sal_Bool bUpper ) { Size aPartSize; if ( !bUpper ) { - BYTE nProp = pFont->GetPropr(); + sal_uInt8 nProp = pFont->GetPropr(); pFont->SetProprRel( SMALL_CAPS_PERCENTAGE ); pFont->SetPhysFont( pOut ); aPartSize.setWidth( pOut->GetTextWidth( _rTxt, _nIdx, _nLen ) ); @@ -720,23 +720,23 @@ public: aSpacePos( rPos ), nKern( nKrn ) { } - virtual void DoSpace( const BOOL bDraw ); + virtual void DoSpace( const sal_Bool bDraw ); virtual void SetSpace(); virtual void Do( const XubString &rTxt, const xub_StrLen nIdx, - const xub_StrLen nLen, const BOOL bUpper ); + const xub_StrLen nLen, const sal_Bool bUpper ); }; -void SvxDoDrawCapital::DoSpace( const BOOL bDraw ) +void SvxDoDrawCapital::DoSpace( const sal_Bool bDraw ) { if ( bDraw || pFont->IsWordLineMode() ) { - USHORT nDiff = (USHORT)(aPos.X() - aSpacePos.X()); + sal_uInt16 nDiff = (sal_uInt16)(aPos.X() - aSpacePos.X()); if ( nDiff ) { - BOOL bWordWise = pFont->IsWordLineMode(); - BOOL bTrans = pFont->IsTransparent(); - pFont->SetWordLineMode( FALSE ); - pFont->SetTransparent( TRUE ); + sal_Bool bWordWise = pFont->IsWordLineMode(); + sal_Bool bTrans = pFont->IsTransparent(); + pFont->SetWordLineMode( sal_False ); + pFont->SetTransparent( sal_True ); pFont->SetPhysFont( pOut ); pOut->DrawStretchText( aSpacePos, nDiff, XubString( sDoubleSpace, RTL_TEXTENCODING_MS_1252 ), 0, 2 ); @@ -754,9 +754,9 @@ void SvxDoDrawCapital::SetSpace() } void SvxDoDrawCapital::Do( const XubString &_rTxt, const xub_StrLen _nIdx, - const xub_StrLen _nLen, const BOOL bUpper) + const xub_StrLen _nLen, const sal_Bool bUpper) { - BYTE nProp = 0; + sal_uInt8 nProp = 0; Size aPartSize; // Set the desired font diff --git a/editeng/source/items/svxitems.src b/editeng/source/items/svxitems.src index 5b9d01660286..5b9d01660286 100644..100755 --- a/editeng/source/items/svxitems.src +++ b/editeng/source/items/svxitems.src diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 0d172cf481bf..bfac7ca12c7b 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -124,7 +124,7 @@ using namespace ::com::sun::star::text; #define TWIP_TO_MM100_UNSIGNED(TWIP) ((((TWIP)*127L+36L)/72L)) #define MM100_TO_TWIP_UNSIGNED(MM100) ((((MM100)*72L+63L)/127L)) -BOOL SvxFontItem::bEnableStoreUnicodeNames = FALSE; +sal_Bool SvxFontItem::bEnableStoreUnicodeNames = sal_False; // STATIC DATA ----------------------------------------------------------- @@ -169,7 +169,7 @@ TYPEINIT1(SvxScriptSetItem, SfxSetItem ); // class SvxFontListItem ------------------------------------------------- SvxFontListItem::SvxFontListItem( const FontList* pFontLst, - const USHORT nId ) : + const sal_uInt16 nId ) : SfxPoolItem( nId ), pFontList( pFontLst ) { @@ -178,7 +178,7 @@ SvxFontListItem::SvxFontListItem( const FontList* pFontLst, sal_Int32 nCount = pFontList->GetFontNameCount(); aFontNameSeq.realloc( nCount ); - for ( USHORT i = 0; i < nCount; i++ ) + for ( sal_uInt16 i = 0; i < nCount; i++ ) aFontNameSeq[i] = pFontList->GetFontName(i).GetName(); } } @@ -209,7 +209,7 @@ int SvxFontListItem::operator==( const SfxPoolItem& rAttr ) const return( pFontList == ((SvxFontListItem&)rAttr).pFontList ); } -bool SvxFontListItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const +bool SvxFontListItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { rVal <<= aFontNameSeq; return true; @@ -231,7 +231,7 @@ SfxItemPresentation SvxFontListItem::GetPresentation // class SvxFontItem ----------------------------------------------------- -SvxFontItem::SvxFontItem( const USHORT nId ) : +SvxFontItem::SvxFontItem( const sal_uInt16 nId ) : SfxPoolItem( nId ) { eFamily = FAMILY_SWISS; @@ -243,7 +243,7 @@ SvxFontItem::SvxFontItem( const USHORT nId ) : SvxFontItem::SvxFontItem( const FontFamily eFam, const XubString& aName, const XubString& aStName, const FontPitch eFontPitch, - const rtl_TextEncoding eFontTextEncoding, const USHORT nId ) : + const rtl_TextEncoding eFontTextEncoding, const sal_uInt16 nId ) : SfxPoolItem( nId ), @@ -257,7 +257,7 @@ SvxFontItem::SvxFontItem( const FontFamily eFam, const XubString& aName, // ----------------------------------------------------------------------- -bool SvxFontItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxFontItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) @@ -286,7 +286,7 @@ bool SvxFontItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } // ----------------------------------------------------------------------- -bool SvxFontItem::PutValue( const uno::Any& rVal, BYTE nMemberId) +bool SvxFontItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId) { nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) @@ -380,14 +380,14 @@ SfxPoolItem* SvxFontItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxFontItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxFontItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - BOOL bToBats = + sal_Bool bToBats = GetFamilyName().EqualsAscii( "StarSymbol", 0, sizeof("StarSymbol")-1 ) || GetFamilyName().EqualsAscii( "OpenSymbol", 0, sizeof("OpenSymbol")-1 ); - rStrm << (BYTE) GetFamily() << (BYTE) GetPitch() - << (BYTE)(bToBats ? RTL_TEXTENCODING_SYMBOL : GetSOStoreTextEncoding(GetCharSet(), (sal_uInt16)rStrm.GetVersion())); + rStrm << (sal_uInt8) GetFamily() << (sal_uInt8) GetPitch() + << (sal_uInt8)(bToBats ? RTL_TEXTENCODING_SYMBOL : GetSOStoreTextEncoding(GetCharSet(), (sal_uInt16)rStrm.GetVersion())); String aStoreFamilyName( GetFamilyName() ); if( bToBats ) @@ -409,9 +409,9 @@ SvStream& SvxFontItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const // ----------------------------------------------------------------------- -SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const { - BYTE _eFamily, eFontPitch, eFontTextEncoding; + sal_uInt8 _eFamily, eFontPitch, eFontTextEncoding; String aName, aStyle; rStrm >> _eFamily; rStrm >> eFontPitch; @@ -424,7 +424,7 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, USHORT) const rStrm.ReadByteString(aStyle); // Set the "correct" textencoding - eFontTextEncoding = (BYTE)GetSOLoadTextEncoding( eFontTextEncoding, (USHORT)rStrm.GetVersion() ); + eFontTextEncoding = (sal_uInt8)GetSOLoadTextEncoding( eFontTextEncoding, (sal_uInt16)rStrm.GetVersion() ); // at some point, the StarBats changes from ANSI font to SYMBOL font if ( RTL_TEXTENCODING_SYMBOL != eFontTextEncoding && aName.EqualsAscii("StarBats") ) @@ -476,15 +476,15 @@ SfxItemPresentation SvxFontItem::GetPresentation //------------------------------------------------------------------------ -void SvxFontItem::EnableStoreUnicodeNames( BOOL bEnable ) +void SvxFontItem::EnableStoreUnicodeNames( sal_Bool bEnable ) { bEnableStoreUnicodeNames = bEnable; } // class SvxPostureItem -------------------------------------------------- -SvxPostureItem::SvxPostureItem( const FontItalic ePosture, const USHORT nId ) : - SfxEnumItem( nId, (USHORT)ePosture ) +SvxPostureItem::SvxPostureItem( const FontItalic ePosture, const sal_uInt16 nId ) : + SfxEnumItem( nId, (sal_uInt16)ePosture ) { } @@ -497,24 +497,24 @@ SfxPoolItem* SvxPostureItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -USHORT SvxPostureItem::GetValueCount() const +sal_uInt16 SvxPostureItem::GetValueCount() const { return ITALIC_NORMAL + 1; // ITALIC_NONE also belongs here } // ----------------------------------------------------------------------- -SvStream& SvxPostureItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxPostureItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm << (BYTE)GetValue(); + rStrm << (sal_uInt8)GetValue(); return rStrm; } // ----------------------------------------------------------------------- -SfxPoolItem* SvxPostureItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxPostureItem::Create(SvStream& rStrm, sal_uInt16) const { - BYTE nPosture; + sal_uInt8 nPosture; rStrm >> nPosture; return new SvxPostureItem( (const FontItalic)nPosture, Which() ); } @@ -545,13 +545,13 @@ SfxItemPresentation SvxPostureItem::GetPresentation // ----------------------------------------------------------------------- -XubString SvxPostureItem::GetValueTextByPos( USHORT nPos ) const +XubString SvxPostureItem::GetValueTextByPos( sal_uInt16 nPos ) const { - DBG_ASSERT( nPos <= (USHORT)ITALIC_NORMAL, "enum overflow!" ); + DBG_ASSERT( nPos <= (sal_uInt16)ITALIC_NORMAL, "enum overflow!" ); XubString sTxt; FontItalic eItalic = (FontItalic)nPos; - USHORT nId = 0; + sal_uInt16 nId = 0; switch ( eItalic ) { @@ -566,7 +566,7 @@ XubString SvxPostureItem::GetValueTextByPos( USHORT nPos ) const return sTxt; } -bool SvxPostureItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxPostureItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) @@ -581,7 +581,7 @@ bool SvxPostureItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool SvxPostureItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxPostureItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) @@ -600,7 +600,7 @@ bool SvxPostureItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) eSlant = (awt::FontSlant)nValue; } - SetValue((USHORT)eSlant); + SetValue((sal_uInt16)eSlant); } } return true; @@ -623,13 +623,13 @@ BOOL SvxPostureItem::GetBoolValue() const void SvxPostureItem::SetBoolValue( sal_Bool bVal ) { - SetValue( (USHORT)(bVal ? ITALIC_NORMAL : ITALIC_NONE) ); + SetValue( (sal_uInt16)(bVal ? ITALIC_NORMAL : ITALIC_NONE) ); } // class SvxWeightItem --------------------------------------------------- -SvxWeightItem::SvxWeightItem( const FontWeight eWght, const USHORT nId ) : - SfxEnumItem( nId, (USHORT)eWght ) +SvxWeightItem::SvxWeightItem( const FontWeight eWght, const sal_uInt16 nId ) : + SfxEnumItem( nId, (sal_uInt16)eWght ) { } @@ -653,12 +653,12 @@ sal_Bool SvxWeightItem::GetBoolValue() const void SvxWeightItem::SetBoolValue( sal_Bool bVal ) { - SetValue( (USHORT)(bVal ? WEIGHT_BOLD : WEIGHT_NORMAL) ); + SetValue( (sal_uInt16)(bVal ? WEIGHT_BOLD : WEIGHT_NORMAL) ); } // ----------------------------------------------------------------------- -USHORT SvxWeightItem::GetValueCount() const +sal_uInt16 SvxWeightItem::GetValueCount() const { return WEIGHT_BLACK; // WEIGHT_DONTKNOW does not belong } @@ -672,17 +672,17 @@ SfxPoolItem* SvxWeightItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxWeightItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxWeightItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm << (BYTE)GetValue(); + rStrm << (sal_uInt8)GetValue(); return rStrm; } // ----------------------------------------------------------------------- -SfxPoolItem* SvxWeightItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxWeightItem::Create(SvStream& rStrm, sal_uInt16) const { - BYTE nWeight; + sal_uInt8 nWeight; rStrm >> nWeight; return new SvxWeightItem( (FontWeight)nWeight, Which() ); } @@ -713,13 +713,13 @@ SfxItemPresentation SvxWeightItem::GetPresentation // ----------------------------------------------------------------------- -XubString SvxWeightItem::GetValueTextByPos( USHORT nPos ) const +XubString SvxWeightItem::GetValueTextByPos( sal_uInt16 nPos ) const { - DBG_ASSERT( nPos <= (USHORT)WEIGHT_BLACK, "enum overflow!" ); + DBG_ASSERT( nPos <= (sal_uInt16)WEIGHT_BLACK, "enum overflow!" ); return EE_RESSTR( RID_SVXITEMS_WEIGHT_BEGIN + nPos ); } -bool SvxWeightItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxWeightItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) @@ -736,7 +736,7 @@ bool SvxWeightItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool SvxWeightItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxWeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) @@ -754,7 +754,7 @@ bool SvxWeightItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) return sal_False; fValue = (float)nValue; } - SetValue( (USHORT)VCLUnoHelper::ConvertFontWeight((float)fValue) ); + SetValue( (sal_uInt16)VCLUnoHelper::ConvertFontWeight((float)fValue) ); } break; } @@ -763,9 +763,9 @@ bool SvxWeightItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) // class SvxFontHeightItem ----------------------------------------------- -SvxFontHeightItem::SvxFontHeightItem( const ULONG nSz, - const USHORT nPrp, - const USHORT nId ) : +SvxFontHeightItem::SvxFontHeightItem( const sal_uLong nSz, + const sal_uInt16 nPrp, + const sal_uInt16 nId ) : SfxPoolItem( nId ) { SetHeight( nSz,nPrp ); // calculate in percentage @@ -780,17 +780,17 @@ SfxPoolItem* SvxFontHeightItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxFontHeightItem::Store( SvStream& rStrm , USHORT nItemVersion ) const +SvStream& SvxFontHeightItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const { - rStrm << (USHORT)GetHeight(); + rStrm << (sal_uInt16)GetHeight(); if( FONTHEIGHT_UNIT_VERSION <= nItemVersion ) - rStrm << GetProp() << (USHORT)GetPropUnit(); + rStrm << GetProp() << (sal_uInt16)GetPropUnit(); else { // When exporting to the old versions the relative information is lost // when there is no percentage - USHORT _nProp = GetProp(); + sal_uInt16 _nProp = GetProp(); if( SFX_MAPUNIT_RELATIVE != GetPropUnit() ) _nProp = 100; rStrm << _nProp; @@ -801,9 +801,9 @@ SvStream& SvxFontHeightItem::Store( SvStream& rStrm , USHORT nItemVersion ) cons // ----------------------------------------------------------------------- SfxPoolItem* SvxFontHeightItem::Create( SvStream& rStrm, - USHORT nVersion ) const + sal_uInt16 nVersion ) const { - USHORT nsize, nprop = 0, nPropUnit = SFX_MAPUNIT_RELATIVE; + sal_uInt16 nsize, nprop = 0, nPropUnit = SFX_MAPUNIT_RELATIVE; rStrm >> nsize; @@ -811,9 +811,9 @@ SfxPoolItem* SvxFontHeightItem::Create( SvStream& rStrm, rStrm >> nprop; else { - BYTE nP; + sal_uInt8 nP; rStrm >> nP; - nprop = (USHORT)nP; + nprop = (sal_uInt16)nP; } if( FONTHEIGHT_UNIT_VERSION <= nVersion ) @@ -834,7 +834,7 @@ int SvxFontHeightItem::operator==( const SfxPoolItem& rItem ) const GetPropUnit() == ((SvxFontHeightItem&)rItem).GetPropUnit(); } -bool SvxFontHeightItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +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. @@ -968,7 +968,7 @@ sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, SfxMapUn return nRet; } -bool SvxFontHeightItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1095,7 +1095,7 @@ SfxItemPresentation SvxFontHeightItem::GetPresentation // ----------------------------------------------------------------------- -USHORT SvxFontHeightItem::GetVersion(USHORT nFileVersion) const +sal_uInt16 SvxFontHeightItem::GetVersion(sal_uInt16 nFileVersion) const { return (nFileVersion <= SOFFICE_FILEFORMAT_40) ? FONTHEIGHT_16_VERSION @@ -1117,7 +1117,7 @@ bool SvxFontHeightItem::HasMetrics() const return true; } -void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, const USHORT nNewProp, +void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, const sal_uInt16 nNewProp, SfxMapUnit eUnit ) { DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); @@ -1137,7 +1137,7 @@ void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, const USHORT nNewProp, ePropUnit = eUnit; } -void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, USHORT nNewProp, +void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, sal_uInt16 nNewProp, SfxMapUnit eMetric, SfxMapUnit eCoreMetric ) { DBG_ASSERT( GetRefCount() == 0, "SetValue() with pooled item" ); @@ -1161,7 +1161,7 @@ void SvxFontHeightItem::SetHeight( sal_uInt32 nNewHeight, USHORT nNewProp, // class SvxFontWidthItem ----------------------------------------------- -SvxFontWidthItem::SvxFontWidthItem( const USHORT nSz, const USHORT nPrp, const USHORT nId ) : +SvxFontWidthItem::SvxFontWidthItem( const sal_uInt16 nSz, const sal_uInt16 nPrp, const sal_uInt16 nId ) : SfxPoolItem( nId ) { nWidth = nSz; @@ -1177,7 +1177,7 @@ SfxPoolItem* SvxFontWidthItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxFontWidthItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxFontWidthItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { rStrm << GetWidth() << GetProp(); return rStrm; @@ -1187,7 +1187,7 @@ SvStream& SvxFontWidthItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) c bool SvxFontWidthItem::ScaleMetrics( long nMult, long nDiv ) { - nWidth = (USHORT)Scale( nWidth, nMult, nDiv ); + nWidth = (sal_uInt16)Scale( nWidth, nMult, nDiv ); return true; } @@ -1201,10 +1201,10 @@ bool SvxFontWidthItem::HasMetrics() const // ----------------------------------------------------------------------- SfxPoolItem* SvxFontWidthItem::Create( SvStream& rStrm, - USHORT /*nVersion*/ ) const + sal_uInt16 /*nVersion*/ ) const { - USHORT nS; - USHORT nP; + sal_uInt16 nS; + sal_uInt16 nP; rStrm >> nS; rStrm >> nP; @@ -1222,7 +1222,7 @@ int SvxFontWidthItem::operator==( const SfxPoolItem& rItem ) const GetProp() == ((SvxFontWidthItem&)rItem).GetProp(); } -bool SvxFontWidthItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxFontWidthItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1238,7 +1238,7 @@ bool SvxFontWidthItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool SvxFontWidthItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxFontWidthItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { // sal_Bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1295,8 +1295,8 @@ SfxItemPresentation SvxFontWidthItem::GetPresentation // class SvxTextLineItem ------------------------------------------------ -SvxTextLineItem::SvxTextLineItem( const FontUnderline eSt, const USHORT nId ) - : SfxEnumItem( nId, (USHORT)eSt ), mColor( COL_TRANSPARENT ) +SvxTextLineItem::SvxTextLineItem( const FontUnderline eSt, const sal_uInt16 nId ) + : SfxEnumItem( nId, (sal_uInt16)eSt ), mColor( COL_TRANSPARENT ) { } @@ -1318,7 +1318,7 @@ sal_Bool SvxTextLineItem::GetBoolValue() const void SvxTextLineItem::SetBoolValue( sal_Bool bVal ) { - SetValue( (USHORT)(bVal ? UNDERLINE_SINGLE : UNDERLINE_NONE) ); + SetValue( (sal_uInt16)(bVal ? UNDERLINE_SINGLE : UNDERLINE_NONE) ); } // ----------------------------------------------------------------------- @@ -1332,24 +1332,24 @@ SfxPoolItem* SvxTextLineItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -USHORT SvxTextLineItem::GetValueCount() const +sal_uInt16 SvxTextLineItem::GetValueCount() const { return UNDERLINE_DOTTED + 1; // UNDERLINE_NONE also belongs here } // ----------------------------------------------------------------------- -SvStream& SvxTextLineItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxTextLineItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm << (BYTE)GetValue(); + rStrm << (sal_uInt8)GetValue(); return rStrm; } // ----------------------------------------------------------------------- -SfxPoolItem* SvxTextLineItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxTextLineItem::Create(SvStream& rStrm, sal_uInt16) const { - BYTE nState; + sal_uInt8 nState; rStrm >> nState; return new SvxTextLineItem( (FontUnderline)nState, Which() ); } @@ -1384,13 +1384,13 @@ SfxItemPresentation SvxTextLineItem::GetPresentation // ----------------------------------------------------------------------- -XubString SvxTextLineItem::GetValueTextByPos( USHORT /*nPos*/ ) const +XubString SvxTextLineItem::GetValueTextByPos( sal_uInt16 /*nPos*/ ) const { OSL_FAIL("SvxTextLineItem::GetValueTextByPos: Pure virtual method"); return XubString(); } -bool SvxTextLineItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxTextLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) @@ -1412,7 +1412,7 @@ bool SvxTextLineItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const } -bool SvxTextLineItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxTextLineItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; sal_Bool bRet = sal_True; @@ -1461,7 +1461,7 @@ int SvxTextLineItem::operator==( const SfxPoolItem& rItem ) const // class SvxUnderlineItem ------------------------------------------------ -SvxUnderlineItem::SvxUnderlineItem( const FontUnderline eSt, const USHORT nId ) +SvxUnderlineItem::SvxUnderlineItem( const FontUnderline eSt, const sal_uInt16 nId ) : SvxTextLineItem( eSt, nId ) { } @@ -1477,24 +1477,24 @@ SfxPoolItem* SvxUnderlineItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SfxPoolItem* SvxUnderlineItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxUnderlineItem::Create(SvStream& rStrm, sal_uInt16) const { - BYTE nState; + sal_uInt8 nState; rStrm >> nState; return new SvxUnderlineItem( (FontUnderline)nState, Which() ); } // ----------------------------------------------------------------------- -XubString SvxUnderlineItem::GetValueTextByPos( USHORT nPos ) const +XubString SvxUnderlineItem::GetValueTextByPos( sal_uInt16 nPos ) const { - DBG_ASSERT( nPos <= (USHORT)UNDERLINE_BOLDWAVE, "enum overflow!" ); + DBG_ASSERT( nPos <= (sal_uInt16)UNDERLINE_BOLDWAVE, "enum overflow!" ); return EE_RESSTR( RID_SVXITEMS_UL_BEGIN + nPos ); } // class SvxOverlineItem ------------------------------------------------ -SvxOverlineItem::SvxOverlineItem( const FontUnderline eSt, const USHORT nId ) +SvxOverlineItem::SvxOverlineItem( const FontUnderline eSt, const sal_uInt16 nId ) : SvxTextLineItem( eSt, nId ) { } @@ -1510,25 +1510,25 @@ SfxPoolItem* SvxOverlineItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SfxPoolItem* SvxOverlineItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxOverlineItem::Create(SvStream& rStrm, sal_uInt16) const { - BYTE nState; + sal_uInt8 nState; rStrm >> nState; return new SvxOverlineItem( (FontUnderline)nState, Which() ); } // ----------------------------------------------------------------------- -XubString SvxOverlineItem::GetValueTextByPos( USHORT nPos ) const +XubString SvxOverlineItem::GetValueTextByPos( sal_uInt16 nPos ) const { - DBG_ASSERT( nPos <= (USHORT)UNDERLINE_BOLDWAVE, "enum overflow!" ); + DBG_ASSERT( nPos <= (sal_uInt16)UNDERLINE_BOLDWAVE, "enum overflow!" ); return EE_RESSTR( RID_SVXITEMS_OL_BEGIN + nPos ); } // class SvxCrossedOutItem ----------------------------------------------- -SvxCrossedOutItem::SvxCrossedOutItem( const FontStrikeout eSt, const USHORT nId ) - : SfxEnumItem( nId, (USHORT)eSt ) +SvxCrossedOutItem::SvxCrossedOutItem( const FontStrikeout eSt, const sal_uInt16 nId ) + : SfxEnumItem( nId, (sal_uInt16)eSt ) { } @@ -1550,12 +1550,12 @@ sal_Bool SvxCrossedOutItem::GetBoolValue() const void SvxCrossedOutItem::SetBoolValue( sal_Bool bVal ) { - SetValue( (USHORT)(bVal ? STRIKEOUT_SINGLE : STRIKEOUT_NONE) ); + SetValue( (sal_uInt16)(bVal ? STRIKEOUT_SINGLE : STRIKEOUT_NONE) ); } // ----------------------------------------------------------------------- -USHORT SvxCrossedOutItem::GetValueCount() const +sal_uInt16 SvxCrossedOutItem::GetValueCount() const { return STRIKEOUT_DOUBLE + 1; // STRIKEOUT_NONE belongs also here } @@ -1569,17 +1569,17 @@ SfxPoolItem* SvxCrossedOutItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxCrossedOutItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxCrossedOutItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm << (BYTE)GetValue(); + rStrm << (sal_uInt8)GetValue(); return rStrm; } // ----------------------------------------------------------------------- -SfxPoolItem* SvxCrossedOutItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxCrossedOutItem::Create(SvStream& rStrm, sal_uInt16) const { - BYTE eCross; + sal_uInt8 eCross; rStrm >> eCross; return new SvxCrossedOutItem( (FontStrikeout)eCross, Which() ); } @@ -1610,13 +1610,13 @@ SfxItemPresentation SvxCrossedOutItem::GetPresentation // ----------------------------------------------------------------------- -XubString SvxCrossedOutItem::GetValueTextByPos( USHORT nPos ) const +XubString SvxCrossedOutItem::GetValueTextByPos( sal_uInt16 nPos ) const { - DBG_ASSERT( nPos <= (USHORT)STRIKEOUT_X, "enum overflow!" ); + DBG_ASSERT( nPos <= (sal_uInt16)STRIKEOUT_X, "enum overflow!" ); return EE_RESSTR( RID_SVXITEMS_STRIKEOUT_BEGIN + nPos ); } -bool SvxCrossedOutItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxCrossedOutItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) @@ -1631,7 +1631,7 @@ bool SvxCrossedOutItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool SvxCrossedOutItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxCrossedOutItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) @@ -1652,7 +1652,7 @@ bool SvxCrossedOutItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) } // class SvxShadowedItem ------------------------------------------------- -SvxShadowedItem::SvxShadowedItem( const sal_Bool bShadowed, const USHORT nId ) : +SvxShadowedItem::SvxShadowedItem( const sal_Bool bShadowed, const sal_uInt16 nId ) : SfxBoolItem( nId, bShadowed ) { } @@ -1666,17 +1666,17 @@ SfxPoolItem* SvxShadowedItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxShadowedItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxShadowedItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm << (BYTE) GetValue(); + rStrm << (sal_uInt8) GetValue(); return rStrm; } // ----------------------------------------------------------------------- -SfxPoolItem* SvxShadowedItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxShadowedItem::Create(SvStream& rStrm, sal_uInt16) const { - BYTE nState; + sal_uInt8 nState; rStrm >> nState; return new SvxShadowedItem( nState, Which() ); } @@ -1699,7 +1699,7 @@ SfxItemPresentation SvxShadowedItem::GetPresentation case SFX_ITEM_PRESENTATION_NAMELESS: case SFX_ITEM_PRESENTATION_COMPLETE: { - USHORT nId = RID_SVXITEMS_SHADOWED_FALSE; + sal_uInt16 nId = RID_SVXITEMS_SHADOWED_FALSE; if ( GetValue() ) nId = RID_SVXITEMS_SHADOWED_TRUE; @@ -1713,7 +1713,7 @@ SfxItemPresentation SvxShadowedItem::GetPresentation // class SvxAutoKernItem ------------------------------------------------- -SvxAutoKernItem::SvxAutoKernItem( const sal_Bool bAutoKern, const USHORT nId ) : +SvxAutoKernItem::SvxAutoKernItem( const sal_Bool bAutoKern, const sal_uInt16 nId ) : SfxBoolItem( nId, bAutoKern ) { } @@ -1727,17 +1727,17 @@ SfxPoolItem* SvxAutoKernItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxAutoKernItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxAutoKernItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm << (BYTE) GetValue(); + rStrm << (sal_uInt8) GetValue(); return rStrm; } // ----------------------------------------------------------------------- -SfxPoolItem* SvxAutoKernItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxAutoKernItem::Create(SvStream& rStrm, sal_uInt16) const { - BYTE nState; + sal_uInt8 nState; rStrm >> nState; return new SvxAutoKernItem( nState, Which() ); } @@ -1760,7 +1760,7 @@ SfxItemPresentation SvxAutoKernItem::GetPresentation case SFX_ITEM_PRESENTATION_NAMELESS: case SFX_ITEM_PRESENTATION_COMPLETE: { - USHORT nId = RID_SVXITEMS_AUTOKERN_FALSE; + sal_uInt16 nId = RID_SVXITEMS_AUTOKERN_FALSE; if ( GetValue() ) nId = RID_SVXITEMS_AUTOKERN_TRUE; @@ -1775,7 +1775,7 @@ SfxItemPresentation SvxAutoKernItem::GetPresentation // class SvxWordLineModeItem --------------------------------------------- SvxWordLineModeItem::SvxWordLineModeItem( const sal_Bool bWordLineMode, - const USHORT nId ) : + const sal_uInt16 nId ) : SfxBoolItem( nId, bWordLineMode ) { } @@ -1789,7 +1789,7 @@ SfxPoolItem* SvxWordLineModeItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxWordLineModeItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxWordLineModeItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { rStrm << (sal_Bool) GetValue(); return rStrm; @@ -1797,7 +1797,7 @@ SvStream& SvxWordLineModeItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ // ----------------------------------------------------------------------- -SfxPoolItem* SvxWordLineModeItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxWordLineModeItem::Create(SvStream& rStrm, sal_uInt16) const { sal_Bool bValue; rStrm >> bValue; @@ -1822,7 +1822,7 @@ SfxItemPresentation SvxWordLineModeItem::GetPresentation case SFX_ITEM_PRESENTATION_NAMELESS: case SFX_ITEM_PRESENTATION_COMPLETE: { - USHORT nId = RID_SVXITEMS_WORDLINE_FALSE; + sal_uInt16 nId = RID_SVXITEMS_WORDLINE_FALSE; if ( GetValue() ) nId = RID_SVXITEMS_WORDLINE_TRUE; @@ -1836,7 +1836,7 @@ SfxItemPresentation SvxWordLineModeItem::GetPresentation // class SvxContourItem -------------------------------------------------- -SvxContourItem::SvxContourItem( const sal_Bool bContoured, const USHORT nId ) : +SvxContourItem::SvxContourItem( const sal_Bool bContoured, const sal_uInt16 nId ) : SfxBoolItem( nId, bContoured ) { } @@ -1850,7 +1850,7 @@ SfxPoolItem* SvxContourItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxContourItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxContourItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { rStrm << (sal_Bool) GetValue(); return rStrm; @@ -1858,7 +1858,7 @@ SvStream& SvxContourItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) con // ----------------------------------------------------------------------- -SfxPoolItem* SvxContourItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxContourItem::Create(SvStream& rStrm, sal_uInt16) const { sal_Bool bValue; rStrm >> bValue; @@ -1883,7 +1883,7 @@ SfxItemPresentation SvxContourItem::GetPresentation case SFX_ITEM_PRESENTATION_NAMELESS: case SFX_ITEM_PRESENTATION_COMPLETE: { - USHORT nId = RID_SVXITEMS_CONTOUR_FALSE; + sal_uInt16 nId = RID_SVXITEMS_CONTOUR_FALSE; if ( GetValue() ) nId = RID_SVXITEMS_CONTOUR_TRUE; @@ -1897,7 +1897,7 @@ SfxItemPresentation SvxContourItem::GetPresentation // class SvxPropSizeItem ------------------------------------------------- -SvxPropSizeItem::SvxPropSizeItem( const USHORT nPercent, const USHORT nId ) : +SvxPropSizeItem::SvxPropSizeItem( const sal_uInt16 nPercent, const sal_uInt16 nId ) : SfxUInt16Item( nId, nPercent ) { } @@ -1911,17 +1911,17 @@ SfxPoolItem* SvxPropSizeItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxPropSizeItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxPropSizeItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm << (USHORT) GetValue(); + rStrm << (sal_uInt16) GetValue(); return rStrm; } // ----------------------------------------------------------------------- -SfxPoolItem* SvxPropSizeItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxPropSizeItem::Create(SvStream& rStrm, sal_uInt16) const { - USHORT nSize; + sal_uInt16 nSize; rStrm >> nSize; return new SvxPropSizeItem( nSize, Which() ); } @@ -1942,7 +1942,7 @@ SfxItemPresentation SvxPropSizeItem::GetPresentation // class SvxColorItem ---------------------------------------------------- -SvxColorItem::SvxColorItem( const USHORT nId ) : +SvxColorItem::SvxColorItem( const sal_uInt16 nId ) : SfxPoolItem( nId ), mColor( COL_BLACK ) { @@ -1950,7 +1950,7 @@ SvxColorItem::SvxColorItem( const USHORT nId ) : // ----------------------------------------------------------------------- -SvxColorItem::SvxColorItem( const Color& rCol, const USHORT nId ) : +SvxColorItem::SvxColorItem( const Color& rCol, const sal_uInt16 nId ) : SfxPoolItem( nId ), mColor( rCol ) { @@ -1958,7 +1958,7 @@ SvxColorItem::SvxColorItem( const Color& rCol, const USHORT nId ) : // ----------------------------------------------------------------------- -SvxColorItem::SvxColorItem( SvStream &rStrm, const USHORT nId ) : +SvxColorItem::SvxColorItem( SvStream &rStrm, const sal_uInt16 nId ) : SfxPoolItem( nId ) { Color aColor; @@ -1981,7 +1981,7 @@ SvxColorItem::~SvxColorItem() } // ----------------------------------------------------------------------- -USHORT SvxColorItem::GetVersion( USHORT nFFVer ) const +sal_uInt16 SvxColorItem::GetVersion( sal_uInt16 nFFVer ) const { DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || @@ -2001,7 +2001,7 @@ int SvxColorItem::operator==( const SfxPoolItem& rAttr ) const // ----------------------------------------------------------------------- -bool SvxColorItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const +bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { rVal <<= (sal_Int32)(mColor.GetColor()); return true; @@ -2009,7 +2009,7 @@ bool SvxColorItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const // ----------------------------------------------------------------------- -bool SvxColorItem::PutValue( const uno::Any& rVal, BYTE /*nMemberId*/ ) +bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { sal_Int32 nColor = 0; if(!(rVal >>= nColor)) @@ -2028,7 +2028,7 @@ SfxPoolItem* SvxColorItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxColorItem::Store( SvStream& rStrm , USHORT nItemVersion ) const +SvStream& SvxColorItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const { if( VERSION_USEAUTOCOLOR == nItemVersion && COL_AUTO == mColor.GetColor() ) @@ -2040,7 +2040,7 @@ SvStream& SvxColorItem::Store( SvStream& rStrm , USHORT nItemVersion ) const // ----------------------------------------------------------------------- -SfxPoolItem* SvxColorItem::Create(SvStream& rStrm, USHORT /*nVer*/ ) const +SfxPoolItem* SvxColorItem::Create(SvStream& rStrm, sal_uInt16 /*nVer*/ ) const { return new SvxColorItem( rStrm, Which() ); } @@ -2080,7 +2080,7 @@ void SvxColorItem::SetValue( const Color& rNewCol ) // class SvxCharSetColorItem --------------------------------------------- -SvxCharSetColorItem::SvxCharSetColorItem( const USHORT nId ) : +SvxCharSetColorItem::SvxCharSetColorItem( const sal_uInt16 nId ) : SvxColorItem( nId ), eFrom( RTL_TEXTENCODING_DONTKNOW ) @@ -2091,7 +2091,7 @@ SvxCharSetColorItem::SvxCharSetColorItem( const USHORT nId ) : SvxCharSetColorItem::SvxCharSetColorItem( const Color& rCol, const rtl_TextEncoding _eFrom, - const USHORT nId ) : + const sal_uInt16 nId ) : SvxColorItem( rCol, nId ), eFrom( _eFrom ) @@ -2108,18 +2108,18 @@ SfxPoolItem* SvxCharSetColorItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxCharSetColorItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxCharSetColorItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm << (BYTE)GetSOStoreTextEncoding(GetCharSet(), (sal_uInt16)rStrm.GetVersion()) + rStrm << (sal_uInt8)GetSOStoreTextEncoding(GetCharSet(), (sal_uInt16)rStrm.GetVersion()) << GetValue(); return rStrm; } // ----------------------------------------------------------------------- -SfxPoolItem* SvxCharSetColorItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxCharSetColorItem::Create(SvStream& rStrm, sal_uInt16) const { - BYTE cSet; + sal_uInt8 cSet; Color aColor; rStrm >> cSet >> aColor; return new SvxCharSetColorItem( aColor, (rtl_TextEncoding)cSet, Which() ); @@ -2141,7 +2141,7 @@ SfxItemPresentation SvxCharSetColorItem::GetPresentation // class SvxKerningItem -------------------------------------------------- -SvxKerningItem::SvxKerningItem( const short nKern, const USHORT nId ) : +SvxKerningItem::SvxKerningItem( const short nKern, const sal_uInt16 nId ) : SfxInt16Item( nId, nKern ) { } @@ -2155,7 +2155,7 @@ SfxPoolItem* SvxKerningItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxKerningItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxKerningItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { rStrm << (short) GetValue(); return rStrm; @@ -2178,7 +2178,7 @@ bool SvxKerningItem::HasMetrics() const // ----------------------------------------------------------------------- -SfxPoolItem* SvxKerningItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxKerningItem::Create(SvStream& rStrm, sal_uInt16) const { short nValue; rStrm >> nValue; @@ -2208,7 +2208,7 @@ SfxItemPresentation SvxKerningItem::GetPresentation case SFX_ITEM_PRESENTATION_COMPLETE: { rText = EE_RESSTR(RID_SVXITEMS_KERNING_COMPLETE); - USHORT nId = 0; + sal_uInt16 nId = 0; if ( GetValue() > 0 ) nId = RID_SVXITEMS_KERNING_EXPANDED; @@ -2227,7 +2227,7 @@ SfxItemPresentation SvxKerningItem::GetPresentation return SFX_ITEM_PRESENTATION_NONE; } -bool SvxKerningItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxKerningItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { sal_Int16 nVal = GetValue(); if(nMemberId & CONVERT_TWIPS) @@ -2236,7 +2236,7 @@ bool SvxKerningItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } // ----------------------------------------------------------------------- -bool SvxKerningItem::PutValue( const uno::Any& rVal, BYTE nMemberId) +bool SvxKerningItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId) { sal_Int16 nVal = sal_Int16(); if(!(rVal >>= nVal)) @@ -2249,14 +2249,14 @@ bool SvxKerningItem::PutValue( const uno::Any& rVal, BYTE nMemberId) // class SvxCaseMapItem -------------------------------------------------- -SvxCaseMapItem::SvxCaseMapItem( const SvxCaseMap eMap, const USHORT nId ) : - SfxEnumItem( nId, (USHORT)eMap ) +SvxCaseMapItem::SvxCaseMapItem( const SvxCaseMap eMap, const sal_uInt16 nId ) : + SfxEnumItem( nId, (sal_uInt16)eMap ) { } // ----------------------------------------------------------------------- -USHORT SvxCaseMapItem::GetValueCount() const +sal_uInt16 SvxCaseMapItem::GetValueCount() const { return SVX_CASEMAP_END; // SVX_CASEMAP_KAPITAELCHEN + 1 } @@ -2270,17 +2270,17 @@ SfxPoolItem* SvxCaseMapItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxCaseMapItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxCaseMapItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm << (BYTE) GetValue(); + rStrm << (sal_uInt8) GetValue(); return rStrm; } // ----------------------------------------------------------------------- -SfxPoolItem* SvxCaseMapItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxCaseMapItem::Create(SvStream& rStrm, sal_uInt16) const { - BYTE cMap; + sal_uInt8 cMap; rStrm >> cMap; return new SvxCaseMapItem( (const SvxCaseMap)cMap, Which() ); } @@ -2311,13 +2311,13 @@ SfxItemPresentation SvxCaseMapItem::GetPresentation // ----------------------------------------------------------------------- -XubString SvxCaseMapItem::GetValueTextByPos( USHORT nPos ) const +XubString SvxCaseMapItem::GetValueTextByPos( sal_uInt16 nPos ) const { - DBG_ASSERT( nPos < (USHORT)SVX_CASEMAP_END, "enum overflow!" ); + DBG_ASSERT( nPos < (sal_uInt16)SVX_CASEMAP_END, "enum overflow!" ); return EE_RESSTR( RID_SVXITEMS_CASEMAP_BEGIN + nPos ); } -bool SvxCaseMapItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const +bool SvxCaseMapItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { sal_Int16 nRet = style::CaseMap::NONE; switch( GetValue() ) @@ -2331,7 +2331,7 @@ bool SvxCaseMapItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const return true; } -bool SvxCaseMapItem::PutValue( const uno::Any& rVal, BYTE /*nMemberId*/ ) +bool SvxCaseMapItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { sal_uInt16 nVal = sal_uInt16(); if(!(rVal >>= nVal)) @@ -2351,7 +2351,7 @@ bool SvxCaseMapItem::PutValue( const uno::Any& rVal, BYTE /*nMemberId*/ ) // class SvxEscapementItem ----------------------------------------------- -SvxEscapementItem::SvxEscapementItem( const USHORT nId ) : +SvxEscapementItem::SvxEscapementItem( const sal_uInt16 nId ) : SfxEnumItemInterface( nId ), nEsc ( 0 ), @@ -2362,7 +2362,7 @@ SvxEscapementItem::SvxEscapementItem( const USHORT nId ) : // ----------------------------------------------------------------------- SvxEscapementItem::SvxEscapementItem( const SvxEscapement eEscape, - const USHORT nId ) : + const sal_uInt16 nId ) : SfxEnumItemInterface( nId ), nProp( 100 ) { @@ -2374,8 +2374,8 @@ SvxEscapementItem::SvxEscapementItem( const SvxEscapement eEscape, // ----------------------------------------------------------------------- SvxEscapementItem::SvxEscapementItem( const short _nEsc, - const BYTE _nProp, - const USHORT nId ) : + const sal_uInt8 _nProp, + const sal_uInt16 nId ) : SfxEnumItemInterface( nId ), nEsc ( _nEsc ), nProp ( _nProp ) @@ -2401,7 +2401,7 @@ SfxPoolItem* SvxEscapementItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxEscapementItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxEscapementItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { short _nEsc = GetEsc(); if( SOFFICE_FILEFORMAT_31 == rStrm.GetVersion() ) @@ -2411,16 +2411,16 @@ SvStream& SvxEscapementItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) else if( DFLT_ESC_AUTO_SUB == _nEsc ) _nEsc = DFLT_ESC_SUB; } - rStrm << (BYTE) GetProp() + rStrm << (sal_uInt8) GetProp() << (short) _nEsc; return rStrm; } // ----------------------------------------------------------------------- -SfxPoolItem* SvxEscapementItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxEscapementItem::Create(SvStream& rStrm, sal_uInt16) const { - BYTE _nProp; + sal_uInt8 _nProp; short _nEsc; rStrm >> _nProp >> _nEsc; return new SvxEscapementItem( _nEsc, _nProp, Which() ); @@ -2428,7 +2428,7 @@ SfxPoolItem* SvxEscapementItem::Create(SvStream& rStrm, USHORT) const // ----------------------------------------------------------------------- -USHORT SvxEscapementItem::GetValueCount() const +sal_uInt16 SvxEscapementItem::GetValueCount() const { return SVX_ESCAPEMENT_END; // SVX_ESCAPEMENT_SUBSCRIPT + 1 } @@ -2469,15 +2469,15 @@ SfxItemPresentation SvxEscapementItem::GetPresentation // ----------------------------------------------------------------------- -XubString SvxEscapementItem::GetValueTextByPos( USHORT nPos ) const +XubString SvxEscapementItem::GetValueTextByPos( sal_uInt16 nPos ) const { - DBG_ASSERT( nPos < (USHORT)SVX_ESCAPEMENT_END, "enum overflow!" ); + DBG_ASSERT( nPos < (sal_uInt16)SVX_ESCAPEMENT_END, "enum overflow!" ); return EE_RESSTR(RID_SVXITEMS_ESCAPEMENT_BEGIN + nPos); } // ----------------------------------------------------------------------- -USHORT SvxEscapementItem::GetEnumValue() const +sal_uInt16 SvxEscapementItem::GetEnumValue() const { if ( nEsc < 0 ) return SVX_ESCAPEMENT_SUBSCRIPT; @@ -2488,12 +2488,12 @@ USHORT SvxEscapementItem::GetEnumValue() const // ----------------------------------------------------------------------- -void SvxEscapementItem::SetEnumValue( USHORT nVal ) +void SvxEscapementItem::SetEnumValue( sal_uInt16 nVal ) { SetEscapement( (const SvxEscapement)nVal ); } -bool SvxEscapementItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxEscapementItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) @@ -2511,7 +2511,7 @@ bool SvxEscapementItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool SvxEscapementItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxEscapementItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) @@ -2536,7 +2536,7 @@ bool SvxEscapementItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) break; case MID_AUTO_ESC: { - BOOL bVal = Any2Bool(rVal); + sal_Bool bVal = Any2Bool(rVal); if(bVal) { if(nEsc < 0) @@ -2557,14 +2557,14 @@ bool SvxEscapementItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) // class SvxLanguageItem ------------------------------------------------- -SvxLanguageItem::SvxLanguageItem( const LanguageType eLang, const USHORT nId ) +SvxLanguageItem::SvxLanguageItem( const LanguageType eLang, const sal_uInt16 nId ) : SfxEnumItem( nId , eLang ) { } // ----------------------------------------------------------------------- -USHORT SvxLanguageItem::GetValueCount() const +sal_uInt16 SvxLanguageItem::GetValueCount() const { // #i50205# got rid of class International DBG_ERRORFILE("SvxLanguageItem::GetValueCount: supposed to return a count of what?"); @@ -2583,17 +2583,17 @@ SfxPoolItem* SvxLanguageItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxLanguageItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxLanguageItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm << (USHORT) GetValue(); + rStrm << (sal_uInt16) GetValue(); return rStrm; } // ----------------------------------------------------------------------- -SfxPoolItem* SvxLanguageItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxLanguageItem::Create(SvStream& rStrm, sal_uInt16) const { - USHORT nValue; + sal_uInt16 nValue; rStrm >> nValue; return new SvxLanguageItem( (LanguageType)nValue, Which() ); } @@ -2627,7 +2627,7 @@ SfxItemPresentation SvxLanguageItem::GetPresentation return SFX_ITEM_PRESENTATION_NONE; } -bool SvxLanguageItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxLanguageItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) @@ -2643,7 +2643,7 @@ bool SvxLanguageItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool SvxLanguageItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxLanguageItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) @@ -2674,7 +2674,7 @@ bool SvxLanguageItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) } // class SvxNoLinebreakItem ---------------------------------------------- -SvxNoLinebreakItem::SvxNoLinebreakItem( const BOOL bBreak, const USHORT nId ) : +SvxNoLinebreakItem::SvxNoLinebreakItem( const sal_Bool bBreak, const sal_uInt16 nId ) : SfxBoolItem( nId, bBreak ) { } @@ -2688,7 +2688,7 @@ SfxPoolItem* SvxNoLinebreakItem::Clone( SfxItemPool* ) const // ----------------------------------------------------------------------- -SvStream& SvxNoLinebreakItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxNoLinebreakItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { rStrm << (sal_Bool)GetValue(); return rStrm; @@ -2696,7 +2696,7 @@ SvStream& SvxNoLinebreakItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) // ----------------------------------------------------------------------- -SfxPoolItem* SvxNoLinebreakItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxNoLinebreakItem::Create(SvStream& rStrm, sal_uInt16) const { sal_Bool bValue; rStrm >> bValue; @@ -2719,7 +2719,7 @@ SfxItemPresentation SvxNoLinebreakItem::GetPresentation // class SvxNoHyphenItem ------------------------------------------------- -SvxNoHyphenItem::SvxNoHyphenItem( const sal_Bool bHyphen, const USHORT nId ) : +SvxNoHyphenItem::SvxNoHyphenItem( const sal_Bool bHyphen, const sal_uInt16 nId ) : SfxBoolItem( nId , bHyphen ) { } @@ -2733,7 +2733,7 @@ SfxPoolItem* SvxNoHyphenItem::Clone( SfxItemPool* ) const // ----------------------------------------------------------------------- -SvStream& SvxNoHyphenItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxNoHyphenItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { rStrm << (sal_Bool) GetValue(); return rStrm; @@ -2741,7 +2741,7 @@ SvStream& SvxNoHyphenItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) co // ----------------------------------------------------------------------- -SfxPoolItem* SvxNoHyphenItem::Create( SvStream& rStrm, USHORT ) const +SfxPoolItem* SvxNoHyphenItem::Create( SvStream& rStrm, sal_uInt16 ) const { sal_Bool bValue; rStrm >> bValue; @@ -2771,21 +2771,21 @@ SfxItemPresentation SvxNoHyphenItem::GetPresentation // class SvxLineColorItem (== SvxColorItem) // ----------------------------------------------------------------------- -SvxLineColorItem::SvxLineColorItem( const USHORT nId ) : +SvxLineColorItem::SvxLineColorItem( const sal_uInt16 nId ) : SvxColorItem( nId ) { } // ----------------------------------------------------------------------- -SvxLineColorItem::SvxLineColorItem( const Color& rCol, const USHORT nId ) : +SvxLineColorItem::SvxLineColorItem( const Color& rCol, const sal_uInt16 nId ) : SvxColorItem( rCol, nId ) { } // ----------------------------------------------------------------------- -SvxLineColorItem::SvxLineColorItem( SvStream &rStrm, const USHORT nId ) : +SvxLineColorItem::SvxLineColorItem( SvStream &rStrm, const sal_uInt16 nId ) : SvxColorItem( rStrm, nId ) { } @@ -2821,7 +2821,7 @@ SfxItemPresentation SvxLineColorItem::GetPresentation // class SvxBlinkItem ------------------------------------------------- -SvxBlinkItem::SvxBlinkItem( const sal_Bool bBlink, const USHORT nId ) : +SvxBlinkItem::SvxBlinkItem( const sal_Bool bBlink, const sal_uInt16 nId ) : SfxBoolItem( nId, bBlink ) { } @@ -2835,17 +2835,17 @@ SfxPoolItem* SvxBlinkItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- -SvStream& SvxBlinkItem::Store( SvStream& rStrm , USHORT /*nItemVersion*/ ) const +SvStream& SvxBlinkItem::Store( SvStream& rStrm , sal_uInt16 /*nItemVersion*/ ) const { - rStrm << (BYTE) GetValue(); + rStrm << (sal_uInt8) GetValue(); return rStrm; } // ----------------------------------------------------------------------- -SfxPoolItem* SvxBlinkItem::Create(SvStream& rStrm, USHORT) const +SfxPoolItem* SvxBlinkItem::Create(SvStream& rStrm, sal_uInt16) const { - BYTE nState; + sal_uInt8 nState; rStrm >> nState; return new SvxBlinkItem( nState, Which() ); } @@ -2868,7 +2868,7 @@ SfxItemPresentation SvxBlinkItem::GetPresentation case SFX_ITEM_PRESENTATION_NAMELESS: case SFX_ITEM_PRESENTATION_COMPLETE: { - USHORT nId = RID_SVXITEMS_BLINK_FALSE; + sal_uInt16 nId = RID_SVXITEMS_BLINK_FALSE; if ( GetValue() ) nId = RID_SVXITEMS_BLINK_TRUE; @@ -2883,7 +2883,7 @@ SfxItemPresentation SvxBlinkItem::GetPresentation // class SvxEmphaisMarkItem --------------------------------------------------- SvxEmphasisMarkItem::SvxEmphasisMarkItem( const FontEmphasisMark nValue, - const USHORT nId ) + const sal_uInt16 nId ) : SfxUInt16Item( nId, nValue ) { } @@ -2898,7 +2898,7 @@ SfxPoolItem* SvxEmphasisMarkItem::Clone( SfxItemPool * ) const // ----------------------------------------------------------------------- SvStream& SvxEmphasisMarkItem::Store( SvStream& rStrm, - USHORT /*nItemVersion*/ ) const + sal_uInt16 /*nItemVersion*/ ) const { rStrm << (sal_uInt16)GetValue(); return rStrm; @@ -2906,7 +2906,7 @@ SvStream& SvxEmphasisMarkItem::Store( SvStream& rStrm, // ----------------------------------------------------------------------- -SfxPoolItem* SvxEmphasisMarkItem::Create( SvStream& rStrm, USHORT ) const +SfxPoolItem* SvxEmphasisMarkItem::Create( SvStream& rStrm, sal_uInt16 ) const { sal_uInt16 nValue; rStrm >> nValue; @@ -2935,7 +2935,7 @@ SfxItemPresentation SvxEmphasisMarkItem::GetPresentation sal_uInt16 nVal = GetValue(); rText = EE_RESSTR( RID_SVXITEMS_EMPHASIS_BEGIN_STYLE + ( EMPHASISMARK_STYLE & nVal )); - USHORT nId = ( EMPHASISMARK_POS_ABOVE & nVal ) + sal_uInt16 nId = ( EMPHASISMARK_POS_ABOVE & nVal ) ? RID_SVXITEMS_EMPHASIS_ABOVE_POS : ( EMPHASISMARK_POS_BELOW & nVal ) ? RID_SVXITEMS_EMPHASIS_BELOW_POS @@ -2951,7 +2951,7 @@ SfxItemPresentation SvxEmphasisMarkItem::GetPresentation // ----------------------------------------------------------------------- -bool SvxEmphasisMarkItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const +bool SvxEmphasisMarkItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) @@ -2977,7 +2977,7 @@ bool SvxEmphasisMarkItem::QueryValue( uno::Any& rVal, BYTE nMemberId ) const return true; } -bool SvxEmphasisMarkItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) +bool SvxEmphasisMarkItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; sal_Bool bRet = true; @@ -3007,7 +3007,7 @@ bool SvxEmphasisMarkItem::PutValue( const uno::Any& rVal, BYTE nMemberId ) return bRet; } -USHORT SvxEmphasisMarkItem::GetVersion( USHORT nFFVer ) const +sal_uInt16 SvxEmphasisMarkItem::GetVersion( sal_uInt16 nFFVer ) const { DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || @@ -3055,7 +3055,7 @@ SfxPoolItem* SvxTwoLinesItem::Clone( SfxItemPool* ) const } bool SvxTwoLinesItem::QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId ) const + sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; sal_Bool bRet = true; @@ -3088,7 +3088,7 @@ bool SvxTwoLinesItem::QueryValue( com::sun::star::uno::Any& rVal, } bool SvxTwoLinesItem::PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId ) + sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; sal_Bool bRet = sal_False; @@ -3147,7 +3147,7 @@ SfxItemPresentation SvxTwoLinesItem::GetPresentation( SfxItemPresentation ePres, } -SfxPoolItem* SvxTwoLinesItem::Create( SvStream & rStrm, USHORT /*nVer*/) const +SfxPoolItem* SvxTwoLinesItem::Create( SvStream & rStrm, sal_uInt16 /*nVer*/) const { sal_Bool _bOn; sal_Unicode cStart, cEnd; @@ -3155,13 +3155,13 @@ SfxPoolItem* SvxTwoLinesItem::Create( SvStream & rStrm, USHORT /*nVer*/) const return new SvxTwoLinesItem( _bOn, cStart, cEnd, Which() ); } -SvStream& SvxTwoLinesItem::Store(SvStream & rStrm, USHORT /*nIVer*/) const +SvStream& SvxTwoLinesItem::Store(SvStream & rStrm, sal_uInt16 /*nIVer*/) const { rStrm << GetValue() << GetStartBracket() << GetEndBracket(); return rStrm; } -USHORT SvxTwoLinesItem::GetVersion( USHORT nFFVer ) const +sal_uInt16 SvxTwoLinesItem::GetVersion( sal_uInt16 nFFVer ) const { DBG_ASSERT( SOFFICE_FILEFORMAT_31==nFFVer || SOFFICE_FILEFORMAT_40==nFFVer || @@ -3188,7 +3188,7 @@ SfxPoolItem* SvxCharRotateItem::Clone( SfxItemPool* ) const return new SvxCharRotateItem( GetValue(), IsFitToLine(), Which() ); } -SfxPoolItem* SvxCharRotateItem::Create( SvStream& rStrm, USHORT ) const +SfxPoolItem* SvxCharRotateItem::Create( SvStream& rStrm, sal_uInt16 ) const { sal_uInt16 nVal; sal_Bool b; @@ -3196,14 +3196,14 @@ SfxPoolItem* SvxCharRotateItem::Create( SvStream& rStrm, USHORT ) const return new SvxCharRotateItem( nVal, b, Which() ); } -SvStream& SvxCharRotateItem::Store( SvStream & rStrm, USHORT ) const +SvStream& SvxCharRotateItem::Store( SvStream & rStrm, sal_uInt16 ) const { sal_Bool bFlag = IsFitToLine(); rStrm << GetValue() << bFlag; return rStrm; } -USHORT SvxCharRotateItem::GetVersion( USHORT nFFVer ) const +sal_uInt16 SvxCharRotateItem::GetVersion( sal_uInt16 nFFVer ) const { return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0; } @@ -3239,7 +3239,7 @@ SfxItemPresentation SvxCharRotateItem::GetPresentation( } bool SvxCharRotateItem::QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId ) const + sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; bool bRet = true; @@ -3259,7 +3259,7 @@ bool SvxCharRotateItem::QueryValue( com::sun::star::uno::Any& rVal, } bool SvxCharRotateItem::PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId ) + sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; bool bRet = true; @@ -3269,7 +3269,7 @@ bool SvxCharRotateItem::PutValue( const com::sun::star::uno::Any& rVal, { sal_Int16 nVal = 0; if((rVal >>= nVal) && (0 == nVal || 900 == nVal || 2700 == nVal)) - SetValue( (USHORT)nVal ); + SetValue( (sal_uInt16)nVal ); else bRet = sal_False; break; @@ -3307,7 +3307,7 @@ SfxPoolItem* SvxCharScaleWidthItem::Clone( SfxItemPool* ) const return new SvxCharScaleWidthItem( GetValue(), Which() ); } -SfxPoolItem* SvxCharScaleWidthItem::Create( SvStream& rStrm, USHORT ) const +SfxPoolItem* SvxCharScaleWidthItem::Create( SvStream& rStrm, sal_uInt16 ) const { sal_uInt16 nVal; rStrm >> nVal; @@ -3319,7 +3319,7 @@ SfxPoolItem* SvxCharScaleWidthItem::Create( SvStream& rStrm, USHORT ) const // USHORT nFixWidth, USHORT nPropWidth. // nFixWidth has never been used... rStrm >> nVal; - USHORT nTest; + sal_uInt16 nTest; rStrm >> nTest; if ( nTest == 0x1234 ) pItem->SetValue( nVal ); @@ -3330,23 +3330,23 @@ SfxPoolItem* SvxCharScaleWidthItem::Create( SvStream& rStrm, USHORT ) const return pItem; } -SvStream& SvxCharScaleWidthItem::Store( SvStream& rStream, USHORT nVer ) const +SvStream& SvxCharScaleWidthItem::Store( SvStream& rStream, sal_uInt16 nVer ) const { SvStream& rRet = SfxUInt16Item::Store( rStream, nVer ); if ( Which() == EE_CHAR_FONTWIDTH ) { // see comment in Create().... - rRet.SeekRel( -1*(long)sizeof(USHORT) ); - rRet << (USHORT)0; + rRet.SeekRel( -1*(long)sizeof(sal_uInt16) ); + rRet << (sal_uInt16)0; rRet << GetValue(); // Really ugly, but not a problem for reading the doc in 5.2 - rRet << (USHORT)0x1234; + rRet << (sal_uInt16)0x1234; } return rRet; } -USHORT SvxCharScaleWidthItem::GetVersion( USHORT nFFVer ) const +sal_uInt16 SvxCharScaleWidthItem::GetVersion( sal_uInt16 nFFVer ) const { return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0; } @@ -3379,22 +3379,22 @@ SfxItemPresentation SvxCharScaleWidthItem::GetPresentation( return SFX_ITEM_PRESENTATION_NONE; } -bool SvxCharScaleWidthItem::PutValue( const uno::Any& rVal, BYTE /*nMemberId*/ ) +bool SvxCharScaleWidthItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { // SfxUInt16Item::QueryValue returns sal_Int32 in Any now... (srx642w) // where we still want this to be a sal_Int16 sal_Int16 nValue = sal_Int16(); if (rVal >>= nValue) { - SetValue( (UINT16) nValue ); + SetValue( (sal_uInt16) nValue ); return true; } - OSL_FAIL( "SvxCharScaleWidthItem::PutValue - Wrong type!" ); + DBG_ERROR( "SvxCharScaleWidthItem::PutValue - Wrong type!" ); return false; } -bool SvxCharScaleWidthItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) const +bool SvxCharScaleWidthItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { // SfxUInt16Item::QueryValue returns sal_Int32 in Any now... (srx642w) // where we still want this to be a sal_Int16 @@ -3408,7 +3408,7 @@ bool SvxCharScaleWidthItem::QueryValue( uno::Any& rVal, BYTE /*nMemberId*/ ) con SvxCharReliefItem::SvxCharReliefItem( FontRelief eValue, const sal_uInt16 nId ) - : SfxEnumItem( nId, (USHORT)eValue ) + : SfxEnumItem( nId, (sal_uInt16)eValue ) { } @@ -3417,33 +3417,33 @@ SfxPoolItem* SvxCharReliefItem::Clone( SfxItemPool * ) const return new SvxCharReliefItem( *this ); } -SfxPoolItem* SvxCharReliefItem::Create(SvStream & rStrm, USHORT) const +SfxPoolItem* SvxCharReliefItem::Create(SvStream & rStrm, sal_uInt16) const { sal_uInt16 nVal; rStrm >> nVal; return new SvxCharReliefItem( (FontRelief)nVal, Which() ); } -SvStream& SvxCharReliefItem::Store(SvStream & rStrm, USHORT /*nIVer*/) const +SvStream& SvxCharReliefItem::Store(SvStream & rStrm, sal_uInt16 /*nIVer*/) const { sal_uInt16 nVal = GetValue(); rStrm << nVal; return rStrm; } -USHORT SvxCharReliefItem::GetVersion( USHORT nFFVer ) const +sal_uInt16 SvxCharReliefItem::GetVersion( sal_uInt16 nFFVer ) const { return SOFFICE_FILEFORMAT_50 > nFFVer ? USHRT_MAX : 0; } -String SvxCharReliefItem::GetValueTextByPos( USHORT nPos ) const +String SvxCharReliefItem::GetValueTextByPos( sal_uInt16 nPos ) const { DBG_ASSERT( RID_SVXITEMS_RELIEF_ENGRAVED - RID_SVXITEMS_RELIEF_NONE, "enum overflow" ); return String( EditResId( RID_SVXITEMS_RELIEF_BEGIN + nPos )); } -USHORT SvxCharReliefItem::GetValueCount() const +sal_uInt16 SvxCharReliefItem::GetValueCount() const { return RID_SVXITEMS_RELIEF_ENGRAVED - RID_SVXITEMS_RELIEF_NONE; } @@ -3475,7 +3475,7 @@ SfxItemPresentation SvxCharReliefItem::GetPresentation } bool SvxCharReliefItem::PutValue( const com::sun::star::uno::Any& rVal, - BYTE nMemberId ) + sal_uInt8 nMemberId ) { nMemberId &= ~CONVERT_TWIPS; bool bRet = true; @@ -3486,7 +3486,7 @@ bool SvxCharReliefItem::PutValue( const com::sun::star::uno::Any& rVal, sal_Int16 nVal = -1; rVal >>= nVal; if(nVal >= 0 && nVal <= RELIEF_ENGRAVED) - SetValue( (USHORT)nVal ); + SetValue( (sal_uInt16)nVal ); else bRet = false; } @@ -3499,7 +3499,7 @@ bool SvxCharReliefItem::PutValue( const com::sun::star::uno::Any& rVal, } bool SvxCharReliefItem::QueryValue( com::sun::star::uno::Any& rVal, - BYTE nMemberId ) const + sal_uInt8 nMemberId ) const { nMemberId &= ~CONVERT_TWIPS; bool bRet = true; @@ -3532,14 +3532,14 @@ SfxPoolItem* SvxScriptTypeItem::Clone( SfxItemPool * ) const |* class SvxScriptSetItem *************************************************************************/ -SvxScriptSetItem::SvxScriptSetItem( USHORT nSlotId, SfxItemPool& rPool ) +SvxScriptSetItem::SvxScriptSetItem( sal_uInt16 nSlotId, SfxItemPool& rPool ) : SfxSetItem( nSlotId, new SfxItemSet( rPool, SID_ATTR_CHAR_FONT, SID_ATTR_CHAR_FONT )) { - USHORT nLatin, nAsian, nComplex; + sal_uInt16 nLatin, nAsian, nComplex; GetWhichIds( nLatin, nAsian, nComplex ); - USHORT aIds[ 9 ] = { 0 }; + sal_uInt16 aIds[ 9 ] = { 0 }; aIds[ 0 ] = aIds[ 1 ] = nLatin; aIds[ 2 ] = aIds[ 3 ] = nAsian; aIds[ 4 ] = aIds[ 5 ] = nComplex; @@ -3552,28 +3552,28 @@ SvxScriptSetItem::SvxScriptSetItem( USHORT nSlotId, SfxItemPool& rPool ) SfxPoolItem* SvxScriptSetItem::Clone( SfxItemPool * ) const { SvxScriptSetItem* p = new SvxScriptSetItem( Which(), *GetItemSet().GetPool() ); - p->GetItemSet().Put( GetItemSet(), FALSE ); + p->GetItemSet().Put( GetItemSet(), sal_False ); return p; } -SfxPoolItem* SvxScriptSetItem::Create( SvStream &, USHORT ) const +SfxPoolItem* SvxScriptSetItem::Create( SvStream &, sal_uInt16 ) const { return 0; } const SfxPoolItem* SvxScriptSetItem::GetItemOfScriptSet( - const SfxItemSet& rSet, USHORT nId ) + const SfxItemSet& rSet, sal_uInt16 nId ) { const SfxPoolItem* pI; - SfxItemState eSt = rSet.GetItemState( nId, FALSE, &pI ); + SfxItemState eSt = rSet.GetItemState( nId, sal_False, &pI ); if( SFX_ITEM_SET != eSt ) pI = SFX_ITEM_DEFAULT == eSt ? &rSet.Get( nId ) : 0; return pI; } -const SfxPoolItem* SvxScriptSetItem::GetItemOfScript( USHORT nSlotId, const SfxItemSet& rSet, USHORT nScript ) +const SfxPoolItem* SvxScriptSetItem::GetItemOfScript( sal_uInt16 nSlotId, const SfxItemSet& rSet, sal_uInt16 nScript ) { - USHORT nLatin, nAsian, nComplex; + sal_uInt16 nLatin, nAsian, nComplex; GetWhichIds( nSlotId, rSet, nLatin, nAsian, nComplex ); const SfxPoolItem *pRet, *pAsn, *pCmplx; @@ -3622,15 +3622,15 @@ const SfxPoolItem* SvxScriptSetItem::GetItemOfScript( USHORT nSlotId, const SfxI return pRet; } -const SfxPoolItem* SvxScriptSetItem::GetItemOfScript( USHORT nScript ) const +const SfxPoolItem* SvxScriptSetItem::GetItemOfScript( sal_uInt16 nScript ) const { return GetItemOfScript( Which(), GetItemSet(), nScript ); } -void SvxScriptSetItem::PutItemForScriptType( USHORT nScriptType, +void SvxScriptSetItem::PutItemForScriptType( sal_uInt16 nScriptType, const SfxPoolItem& rItem ) { - USHORT nLatin, nAsian, nComplex; + sal_uInt16 nLatin, nAsian, nComplex; GetWhichIds( nLatin, nAsian, nComplex ); SfxPoolItem* pCpy = rItem.Clone(); @@ -3652,7 +3652,7 @@ void SvxScriptSetItem::PutItemForScriptType( USHORT nScriptType, delete pCpy; } -void SvxScriptSetItem::GetWhichIds( USHORT nSlotId, const SfxItemSet& rSet, USHORT& rLatin, USHORT& rAsian, USHORT& rComplex ) +void SvxScriptSetItem::GetWhichIds( sal_uInt16 nSlotId, const SfxItemSet& rSet, sal_uInt16& rLatin, sal_uInt16& rAsian, sal_uInt16& rComplex ) { const SfxItemPool& rPool = *rSet.GetPool(); GetSlotIds( nSlotId, rLatin, rAsian, rComplex ); @@ -3661,19 +3661,19 @@ void SvxScriptSetItem::GetWhichIds( USHORT nSlotId, const SfxItemSet& rSet, USHO rComplex = rPool.GetWhich( rComplex ); } -void SvxScriptSetItem::GetWhichIds( USHORT& rLatin, USHORT& rAsian, - USHORT& rComplex ) const +void SvxScriptSetItem::GetWhichIds( sal_uInt16& rLatin, sal_uInt16& rAsian, + sal_uInt16& rComplex ) const { GetWhichIds( Which(), GetItemSet(), rLatin, rAsian, rComplex ); } -void SvxScriptSetItem::GetSlotIds( USHORT nSlotId, USHORT& rLatin, - USHORT& rAsian, USHORT& rComplex ) +void SvxScriptSetItem::GetSlotIds( sal_uInt16 nSlotId, sal_uInt16& rLatin, + sal_uInt16& rAsian, sal_uInt16& rComplex ) { switch( nSlotId ) { default: - DBG_ASSERT( FALSE, "wrong SlotId for class SvxScriptSetItem" ); + DBG_ASSERT( sal_False, "wrong SlotId for class SvxScriptSetItem" ); // no break - default to font - Id Range !! case SID_ATTR_CHAR_FONT: @@ -3706,12 +3706,12 @@ void SvxScriptSetItem::GetSlotIds( USHORT nSlotId, USHORT& rLatin, void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rComplex ) { - const USHORT nItemCnt = 3; + const sal_uInt16 nItemCnt = 3; static struct { - USHORT nFontType; - USHORT nLanguage; + sal_uInt16 nFontType; + sal_uInt16 nLanguage; } aOutTypeArr[ nItemCnt ] = { @@ -3722,7 +3722,7 @@ void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rCo SvxFontItem* aItemArr[ nItemCnt ] = { &rLatin, &rAsian, &rComplex }; - for ( USHORT n = 0; n < nItemCnt; ++n ) + for ( sal_uInt16 n = 0; n < nItemCnt; ++n ) { Font aFont( OutputDevice::GetDefaultFont( aOutTypeArr[ n ].nFontType, aOutTypeArr[ n ].nLanguage, @@ -3737,12 +3737,12 @@ void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rCo } -USHORT GetI18NScriptTypeOfLanguage( USHORT nLang ) +sal_uInt16 GetI18NScriptTypeOfLanguage( sal_uInt16 nLang ) { return GetI18NScriptType( SvtLanguageOptions::GetScriptTypeOfLanguage( nLang ) ); } -USHORT GetItemScriptType( short nI18NType ) +sal_uInt16 GetItemScriptType( short nI18NType ) { switch ( nI18NType ) { @@ -3753,7 +3753,7 @@ USHORT GetItemScriptType( short nI18NType ) return 0; } -short GetI18NScriptType( USHORT nItemType ) +short GetI18NScriptType( sal_uInt16 nItemType ) { switch ( nItemType ) { diff --git a/editeng/source/items/writingmodeitem.cxx b/editeng/source/items/writingmodeitem.cxx index bcf47dd222f7..2d546e1c9ebc 100644 --- a/editeng/source/items/writingmodeitem.cxx +++ b/editeng/source/items/writingmodeitem.cxx @@ -42,7 +42,7 @@ using namespace ::com::sun::star::text; TYPEINIT1_FACTORY(SvxWritingModeItem, SfxUInt16Item, new SvxWritingModeItem(com::sun::star::text::WritingMode_LR_TB, 0)); -SvxWritingModeItem::SvxWritingModeItem( WritingMode eValue, USHORT _nWhich ) +SvxWritingModeItem::SvxWritingModeItem( WritingMode eValue, sal_uInt16 _nWhich ) : SfxUInt16Item( _nWhich, (sal_uInt16)eValue ) { } @@ -63,19 +63,19 @@ SfxPoolItem* SvxWritingModeItem::Clone( SfxItemPool * ) const return new SvxWritingModeItem( *this ); } -SfxPoolItem* SvxWritingModeItem::Create( SvStream & , USHORT ) const +SfxPoolItem* SvxWritingModeItem::Create( SvStream & , sal_uInt16 ) const { OSL_FAIL("SvxWritingModeItem should not be streamed!"); return NULL; } -SvStream& SvxWritingModeItem::Store( SvStream & rStrm, USHORT ) const +SvStream& SvxWritingModeItem::Store( SvStream & rStrm, sal_uInt16 ) const { OSL_FAIL("SvxWritingModeItem should not be streamed!"); return rStrm; } -USHORT SvxWritingModeItem::GetVersion( USHORT /*nFVer*/ ) const +sal_uInt16 SvxWritingModeItem::GetVersion( sal_uInt16 /*nFVer*/ ) const { return USHRT_MAX; } @@ -104,7 +104,7 @@ SfxItemPresentation SvxWritingModeItem::GetPresentation( SfxItemPresentation ePr return eRet; } -bool SvxWritingModeItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) +bool SvxWritingModeItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 ) { sal_Int32 nVal = 0; bool bRet = ( rVal >>= nVal ); @@ -140,7 +140,7 @@ bool SvxWritingModeItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE ) } bool SvxWritingModeItem::QueryValue( com::sun::star::uno::Any& rVal, - BYTE ) const + sal_uInt8 ) const { rVal <<= (WritingMode)GetValue(); return true; diff --git a/editeng/source/items/xmlcnitm.cxx b/editeng/source/items/xmlcnitm.cxx index 9c43dd5b2535..f672845ca486 100644 --- a/editeng/source/items/xmlcnitm.cxx +++ b/editeng/source/items/xmlcnitm.cxx @@ -42,7 +42,7 @@ using namespace ::com::sun::star::xml; TYPEINIT1(SvXMLAttrContainerItem, SfxPoolItem); -SvXMLAttrContainerItem::SvXMLAttrContainerItem( USHORT _nWhich ) : +SvXMLAttrContainerItem::SvXMLAttrContainerItem( sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich ) { pImpl = new SvXMLAttrContainerData; @@ -84,13 +84,13 @@ SfxItemPresentation SvXMLAttrContainerItem::GetPresentation( return SFX_ITEM_PRESENTATION_NONE; } -USHORT SvXMLAttrContainerItem::GetVersion( USHORT /*nFileFormatVersion*/ ) const +sal_uInt16 SvXMLAttrContainerItem::GetVersion( sal_uInt16 /*nFileFormatVersion*/ ) const { // This item should never be stored return USHRT_MAX; } -bool SvXMLAttrContainerItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) const +bool SvXMLAttrContainerItem::QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const { Reference<XNameContainer> xContainer = new SvUnoAttributeContainer( new SvXMLAttrContainerData( *pImpl ) ); @@ -99,7 +99,7 @@ bool SvXMLAttrContainerItem::QueryValue( com::sun::star::uno::Any& rVal, BYTE / return true; } -bool SvXMLAttrContainerItem::PutValue( const com::sun::star::uno::Any& rVal, BYTE /*nMemberId*/ ) +bool SvXMLAttrContainerItem::PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { Reference<XInterface> xRef; SvUnoAttributeContainer* pContainer = NULL; @@ -109,7 +109,7 @@ bool SvXMLAttrContainerItem::PutValue( const com::sun::star::uno::Any& rVal, BYT xRef = *(Reference<XInterface>*)rVal.getValue(); Reference<XUnoTunnel> xTunnel(xRef, UNO_QUERY); if( xTunnel.is() ) - pContainer = (SvUnoAttributeContainer*)(ULONG)xTunnel->getSomething(SvUnoAttributeContainer::getUnoTunnelId()); + pContainer = (SvUnoAttributeContainer*)(sal_uLong)xTunnel->getSomething(SvUnoAttributeContainer::getUnoTunnelId()); } if( pContainer ) @@ -125,14 +125,14 @@ bool SvXMLAttrContainerItem::PutValue( const com::sun::star::uno::Any& rVal, BYT { Reference<XNameContainer> xContainer( xRef, UNO_QUERY ); if( !xContainer.is() ) - return FALSE; + return sal_False; const Sequence< ::rtl::OUString > aNameSequence( xContainer->getElementNames() ); const ::rtl::OUString* pNames = aNameSequence.getConstArray(); - const INT32 nCount = aNameSequence.getLength(); + const sal_Int32 nCount = aNameSequence.getLength(); Any aAny; AttributeData* pData; - INT32 nAttr; + sal_Int32 nAttr; for( nAttr = 0; nAttr < nCount; nAttr++ ) { @@ -140,7 +140,7 @@ bool SvXMLAttrContainerItem::PutValue( const com::sun::star::uno::Any& rVal, BYT aAny = xContainer->getByName( aName ); if( aAny.getValue() == NULL || aAny.getValueType() != ::getCppuType((AttributeData*)0) ) - return FALSE; + return sal_False; pData = (AttributeData*)aAny.getValue(); sal_Int32 pos = aName.indexOf( sal_Unicode(':') ); @@ -188,61 +188,61 @@ bool SvXMLAttrContainerItem::PutValue( const com::sun::star::uno::Any& rVal, BYT } -BOOL SvXMLAttrContainerItem::AddAttr( const ::rtl::OUString& rLName, +sal_Bool SvXMLAttrContainerItem::AddAttr( const ::rtl::OUString& rLName, const ::rtl::OUString& rValue ) { return pImpl->AddAttr( rLName, rValue ); } -BOOL SvXMLAttrContainerItem::AddAttr( const ::rtl::OUString& rPrefix, +sal_Bool SvXMLAttrContainerItem::AddAttr( const ::rtl::OUString& rPrefix, const ::rtl::OUString& rNamespace, const ::rtl::OUString& rLName, const ::rtl::OUString& rValue ) { return pImpl->AddAttr( rPrefix, rNamespace, rLName, rValue ); } -USHORT SvXMLAttrContainerItem::GetAttrCount() const +sal_uInt16 SvXMLAttrContainerItem::GetAttrCount() const { - return (USHORT)pImpl->GetAttrCount(); + return (sal_uInt16)pImpl->GetAttrCount(); } -::rtl::OUString SvXMLAttrContainerItem::GetAttrNamespace( USHORT i ) const +::rtl::OUString SvXMLAttrContainerItem::GetAttrNamespace( sal_uInt16 i ) const { return pImpl->GetAttrNamespace( i ); } -::rtl::OUString SvXMLAttrContainerItem::GetAttrPrefix( USHORT i ) const +::rtl::OUString SvXMLAttrContainerItem::GetAttrPrefix( sal_uInt16 i ) const { return pImpl->GetAttrPrefix( i ); } -const ::rtl::OUString& SvXMLAttrContainerItem::GetAttrLName( USHORT i ) const +const ::rtl::OUString& SvXMLAttrContainerItem::GetAttrLName( sal_uInt16 i ) const { return pImpl->GetAttrLName( i ); } -const ::rtl::OUString& SvXMLAttrContainerItem::GetAttrValue( USHORT i ) const +const ::rtl::OUString& SvXMLAttrContainerItem::GetAttrValue( sal_uInt16 i ) const { return pImpl->GetAttrValue( i ); } -USHORT SvXMLAttrContainerItem::GetFirstNamespaceIndex() const +sal_uInt16 SvXMLAttrContainerItem::GetFirstNamespaceIndex() const { return pImpl->GetFirstNamespaceIndex(); } -USHORT SvXMLAttrContainerItem::GetNextNamespaceIndex( USHORT nIdx ) const +sal_uInt16 SvXMLAttrContainerItem::GetNextNamespaceIndex( sal_uInt16 nIdx ) const { return pImpl->GetNextNamespaceIndex( nIdx ); } -const ::rtl::OUString& SvXMLAttrContainerItem::GetNamespace( USHORT i ) const +const ::rtl::OUString& SvXMLAttrContainerItem::GetNamespace( sal_uInt16 i ) const { return pImpl->GetNamespace( i ); } -const ::rtl::OUString& SvXMLAttrContainerItem::GetPrefix( USHORT i ) const +const ::rtl::OUString& SvXMLAttrContainerItem::GetPrefix( sal_uInt16 i ) const { return pImpl->GetPrefix( i ); } diff --git a/editeng/source/misc/SvXMLAutoCorrectExport.cxx b/editeng/source/misc/SvXMLAutoCorrectExport.cxx index ceada8ae745b..ceada8ae745b 100644..100755 --- a/editeng/source/misc/SvXMLAutoCorrectExport.cxx +++ b/editeng/source/misc/SvXMLAutoCorrectExport.cxx diff --git a/editeng/source/misc/SvXMLAutoCorrectExport.hxx b/editeng/source/misc/SvXMLAutoCorrectExport.hxx index 937ef9543f29..937ef9543f29 100644..100755 --- a/editeng/source/misc/SvXMLAutoCorrectExport.hxx +++ b/editeng/source/misc/SvXMLAutoCorrectExport.hxx diff --git a/editeng/source/misc/SvXMLAutoCorrectImport.cxx b/editeng/source/misc/SvXMLAutoCorrectImport.cxx index bd9711cabbbe..2d7d9227a60e 100644 --- a/editeng/source/misc/SvXMLAutoCorrectImport.cxx +++ b/editeng/source/misc/SvXMLAutoCorrectImport.cxx @@ -140,7 +140,7 @@ SvXMLWordContext::SvXMLWordContext( if (!sWrong.Len() || !sRight.Len() ) return; - BOOL bOnlyTxt = sRight != sWrong; + sal_Bool bOnlyTxt = sRight != sWrong; if( !bOnlyTxt ) { String sLongSave( sRight ); @@ -148,7 +148,7 @@ SvXMLWordContext::SvXMLWordContext( sLongSave.Len() ) { sRight = sLongSave; - bOnlyTxt = TRUE; + bOnlyTxt = sal_True; } } SvxAutocorrWordPtr pNew = new SvxAutocorrWord( sWrong, sRight, bOnlyTxt ); diff --git a/editeng/source/misc/SvXMLAutoCorrectImport.hxx b/editeng/source/misc/SvXMLAutoCorrectImport.hxx index fa7a28d0d9dc..fa7a28d0d9dc 100644..100755 --- a/editeng/source/misc/SvXMLAutoCorrectImport.hxx +++ b/editeng/source/misc/SvXMLAutoCorrectImport.hxx diff --git a/editeng/source/misc/acorrcfg.cxx b/editeng/source/misc/acorrcfg.cxx index 3e02bea7f63a..15a3ddfb2d09 100644..100755 --- a/editeng/source/misc/acorrcfg.cxx +++ b/editeng/source/misc/acorrcfg.cxx @@ -51,18 +51,18 @@ static SvxAutoCorrCfg* pAutoCorrCfg = 0; SvxAutoCorrCfg::SvxAutoCorrCfg() : aBaseConfig(*this), aSwConfig(*this), - bFileRel(TRUE), - bNetRel(TRUE), - bAutoTextTip(TRUE), - bAutoTextPreview(FALSE), - bAutoFmtByInput(TRUE), - bSearchInAllCategories(FALSE) + bFileRel(sal_True), + bNetRel(sal_True), + bAutoTextTip(sal_True), + bAutoTextPreview(sal_False), + bAutoFmtByInput(sal_True), + bSearchInAllCategories(sal_False) { SvtPathOptions aPathOpt; String sSharePath, sUserPath, sAutoPath( aPathOpt.GetAutoCorrectPath() ); String* pS = &sSharePath; - for( USHORT n = 0; n < 2; ++n, pS = &sUserPath ) + for( sal_uInt16 n = 0; n < 2; ++n, pS = &sUserPath ) { *pS = sAutoPath.GetToken( n, ';' ); INetURLObject aPath( *pS ); @@ -223,8 +223,8 @@ void SvxBaseAutoCorrCfg::Load(sal_Bool bInit) } } if( nFlags ) - rParent.pAutoCorrect->SetAutoCorrFlag( nFlags, TRUE ); - rParent.pAutoCorrect->SetAutoCorrFlag( ( 0xffff & ~nFlags ), FALSE ); + rParent.pAutoCorrect->SetAutoCorrFlag( nFlags, sal_True ); + rParent.pAutoCorrect->SetAutoCorrFlag( ( 0xffff & ~nFlags ), sal_False ); } } @@ -247,7 +247,7 @@ void SvxBaseAutoCorrCfg::Commit() Any* pValues = aValues.getArray(); const Type& rType = ::getBooleanCppuType(); - BOOL bVal; + sal_Bool bVal; const long nFlags = rParent.pAutoCorrect->GetFlags(); for(int nProp = 0; nProp < aNames.getLength(); nProp++) { @@ -461,7 +461,7 @@ void SvxSwAutoCorrCfg::Load(sal_Bool bInit) { sal_Int32 nVal = 0; pValues[nProp] >>= nVal; rSwFlags.nRightMargin = - sal::static_int_cast< BYTE >(nVal); + sal::static_int_cast< sal_uInt8 >(nVal); } break; // "Format/Option/CombineValue", case 23: rSwFlags.bAFmtDelSpacesAtSttEnd = *(sal_Bool*)pValues[nProp].getValue(); break; // "Format/Option/DelSpacesAtStartEnd", @@ -479,14 +479,14 @@ void SvxSwAutoCorrCfg::Load(sal_Bool bInit) { sal_Int32 nVal = 0; pValues[nProp] >>= nVal; rSwFlags.nAutoCmpltWordLen = - sal::static_int_cast< USHORT >(nVal); + sal::static_int_cast< sal_uInt16 >(nVal); } break; // "Completion/MinWordLen", case 35: { sal_Int32 nVal = 0; pValues[nProp] >>= nVal; rSwFlags.nAutoCmpltListLen = - sal::static_int_cast< USHORT >(nVal); + sal::static_int_cast< sal_uInt16 >(nVal); } break; // "Completion/MaxListLen", case 36: rSwFlags.bAutoCmpltCollectWords = *(sal_Bool*)pValues[nProp].getValue(); break; // "Completion/CollectWords", @@ -497,7 +497,7 @@ void SvxSwAutoCorrCfg::Load(sal_Bool bInit) { sal_Int32 nVal = 0; pValues[nProp] >>= nVal; rSwFlags.nAutoCmpltExpandKey = - sal::static_int_cast< USHORT >(nVal); + sal::static_int_cast< sal_uInt16 >(nVal); } break; // "Completion/AcceptKey" case 41 :rSwFlags.bAutoCmpltKeepList = *(sal_Bool*)pValues[nProp].getValue(); break;//"Completion/KeepList" @@ -556,7 +556,7 @@ void SvxSwAutoCorrCfg::Commit() Any* pValues = aValues.getArray(); const Type& rType = ::getBooleanCppuType(); - BOOL bVal; + sal_Bool bVal; SvxSwAutoFmtFlags& rSwFlags = rParent.pAutoCorrect->GetSwFlags(); for(int nProp = 0; nProp < aNames.getLength(); nProp++) { diff --git a/editeng/source/misc/edtdlg.cxx b/editeng/source/misc/edtdlg.cxx index feecbb5919fb..feecbb5919fb 100644..100755 --- a/editeng/source/misc/edtdlg.cxx +++ b/editeng/source/misc/edtdlg.cxx diff --git a/editeng/source/misc/forbiddencharacterstable.cxx b/editeng/source/misc/forbiddencharacterstable.cxx index 59b5dc60aa20..a1376f86560c 100644..100755 --- a/editeng/source/misc/forbiddencharacterstable.cxx +++ b/editeng/source/misc/forbiddencharacterstable.cxx @@ -36,7 +36,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> -SvxForbiddenCharactersTable::SvxForbiddenCharactersTable( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF, USHORT nISize, USHORT nGrow ) +SvxForbiddenCharactersTable::SvxForbiddenCharactersTable( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF, sal_uInt16 nISize, sal_uInt16 nGrow ) : SvxForbiddenCharactersTableImpl( nISize, nGrow ) { mxMSF = xMSF; @@ -45,13 +45,13 @@ SvxForbiddenCharactersTable::SvxForbiddenCharactersTable( ::com::sun::star::uno: SvxForbiddenCharactersTable::~SvxForbiddenCharactersTable() { - for ( ULONG n = Count(); n; ) + for ( sal_uLong n = Count(); n; ) delete GetObject( --n ); } -const com::sun::star::i18n::ForbiddenCharacters* SvxForbiddenCharactersTable::GetForbiddenCharacters( USHORT nLanguage, BOOL bGetDefault ) const +const com::sun::star::i18n::ForbiddenCharacters* SvxForbiddenCharactersTable::GetForbiddenCharacters( sal_uInt16 nLanguage, sal_Bool bGetDefault ) const { ForbiddenCharactersInfo* pInf = Get( nLanguage ); if ( !pInf && bGetDefault && mxMSF.is() ) @@ -61,7 +61,7 @@ const com::sun::star::i18n::ForbiddenCharacters* SvxForbiddenCharactersTable::Ge pInf = new ForbiddenCharactersInfo; pImpl->Insert( nLanguage, pInf ); - pInf->bTemporary = TRUE; + pInf->bTemporary = sal_True; LocaleDataWrapper aWrapper( mxMSF, SvxCreateLocale( nLanguage ) ); pInf->aForbiddenChars = aWrapper.getForbiddenCharacters(); } @@ -70,7 +70,7 @@ const com::sun::star::i18n::ForbiddenCharacters* SvxForbiddenCharactersTable::Ge -void SvxForbiddenCharactersTable::SetForbiddenCharacters( USHORT nLanguage, const com::sun::star::i18n::ForbiddenCharacters& rForbiddenChars ) +void SvxForbiddenCharactersTable::SetForbiddenCharacters( sal_uInt16 nLanguage, const com::sun::star::i18n::ForbiddenCharacters& rForbiddenChars ) { ForbiddenCharactersInfo* pInf = Get( nLanguage ); if ( !pInf ) @@ -78,11 +78,11 @@ void SvxForbiddenCharactersTable::SetForbiddenCharacters( USHORT nLanguage, cons pInf = new ForbiddenCharactersInfo; Insert( nLanguage, pInf ); } - pInf->bTemporary = FALSE; + pInf->bTemporary = sal_False; pInf->aForbiddenChars = rForbiddenChars; } -void SvxForbiddenCharactersTable::ClearForbiddenCharacters( USHORT nLanguage ) +void SvxForbiddenCharactersTable::ClearForbiddenCharacters( sal_uInt16 nLanguage ) { ForbiddenCharactersInfo* pInf = Get( nLanguage ); if ( pInf ) diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx index ec0a91166ebc..0cd36782a47d 100644..100755 --- a/editeng/source/misc/hangulhanja.cxx +++ b/editeng/source/misc/hangulhanja.cxx @@ -633,7 +633,7 @@ namespace editeng // determine if it's Hangul CharClass aCharClassificaton( m_xORB, m_aSourceLocale ); - sal_Int16 nScript = aCharClassificaton.getScript( m_sCurrentPortion, sal::static_int_cast< USHORT >(nNextAsianScript) ); + sal_Int16 nScript = aCharClassificaton.getScript( m_sCurrentPortion, sal::static_int_cast< sal_uInt16 >(nNextAsianScript) ); if ( ( UnicodeScript_kHangulJamo == nScript ) || ( UnicodeScript_kHangulCompatibilityJamo == nScript ) || ( UnicodeScript_kHangulSyllable == nScript ) diff --git a/editeng/source/misc/lingu.src b/editeng/source/misc/lingu.src index fa3ef76f99fa..fa3ef76f99fa 100644..100755 --- a/editeng/source/misc/lingu.src +++ b/editeng/source/misc/lingu.src diff --git a/editeng/source/misc/makefile.mk b/editeng/source/misc/makefile.mk deleted file mode 100644 index 0b4dbbecf265..000000000000 --- a/editeng/source/misc/makefile.mk +++ /dev/null @@ -1,63 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* -PRJ=..$/.. - -PRJNAME=editeng -TARGET=misc - -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- General ---------------------------------------------------------- - -.IF "$(editdebug)" != "" || "$(EDITDEBUG)" != "" -CDEFS+=-DEDITDEBUG -.ENDIF - -SLOFILES = \ - $(SLO)$/edtdlg.obj \ - $(SLO)$/unolingu.obj \ - $(SLO)$/acorrcfg.obj \ - $(SLO)$/forbiddencharacterstable.obj \ - $(SLO)$/hangulhanja.obj \ - $(SLO)$/splwrap.obj \ - $(SLO)$/svxacorr.obj \ - $(SLO)$/SvXMLAutoCorrectExport.obj \ - $(SLO)$/SvXMLAutoCorrectImport.obj \ - $(SLO)$/swafopt.obj \ - $(SLO)$/txtrange.obj - -SRS1NAME=misc -SRC1FILES = \ - lingu.src - -.INCLUDE : target.mk - diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx index 2d7599cb251a..c7dec39046d7 100644..100755 --- a/editeng/source/misc/splwrap.cxx +++ b/editeng/source/misc/splwrap.cxx @@ -104,7 +104,7 @@ struct lt_LanguageType } }; -typedef std::map< LanguageType, USHORT, lt_LanguageType > LangCheckState_map_t; +typedef std::map< LanguageType, sal_uInt16, lt_LanguageType > LangCheckState_map_t; static LangCheckState_map_t & GetLangCheckState() { diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 5e0a8b3f32f4..ecaf3918ff57 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -141,7 +141,7 @@ inline int IsUpperLetter( sal_Int32 nCharType ) 0 == ( ::com::sun::star::i18n::KCharacterType::LOWER & nCharType); } -BOOL lcl_IsSymbolChar( CharClass& rCC, const String& rTxt, +sal_Bool lcl_IsSymbolChar( CharClass& rCC, const String& rTxt, xub_StrLen nStt, xub_StrLen nEnd ) { for( ; nStt < nEnd; ++nStt ) @@ -154,19 +154,19 @@ BOOL lcl_IsSymbolChar( CharClass& rCC, const String& rTxt, #endif if( ::com::sun::star::i18n::UnicodeType::PRIVATE_USE == rCC.getType( rTxt, nStt )) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -static BOOL lcl_IsInAsciiArr( const sal_Char* pArr, const sal_Unicode c ) +static sal_Bool lcl_IsInAsciiArr( const sal_Char* pArr, const sal_Unicode c ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; for( ; *pArr; ++pArr ) if( *pArr == c ) { - bRet = TRUE; + bRet = sal_True; break; } return bRet; @@ -180,12 +180,12 @@ SvxAutoCorrDoc::~SvxAutoCorrDoc() // - FnCptlSttSntnc // after the exchange of characters. then the words can maybe be inserted // into the exception list. -void SvxAutoCorrDoc::SaveCpltSttWord( ULONG, xub_StrLen, const String&, +void SvxAutoCorrDoc::SaveCpltSttWord( sal_uLong, xub_StrLen, const String&, sal_Unicode ) { } -LanguageType SvxAutoCorrDoc::GetLanguage( xub_StrLen , BOOL ) const +LanguageType SvxAutoCorrDoc::GetLanguage( xub_StrLen , sal_Bool ) const { return LANGUAGE_SYSTEM; } @@ -199,11 +199,11 @@ static ::com::sun::star::uno::Reference< return xMSF; } -static USHORT GetAppLang() +static sal_uInt16 GetAppLang() { return Application::GetSettings().GetLanguage(); } -static LocaleDataWrapper& GetLocaleDataWrapper( USHORT nLang ) +static LocaleDataWrapper& GetLocaleDataWrapper( sal_uInt16 nLang ) { static LocaleDataWrapper aLclDtWrp( GetProcessFact(), SvxCreateLocale( GetAppLang() ) ); @@ -241,21 +241,21 @@ static CollatorWrapper& GetCollatorWrapper() } -void SvxAutocorrWordList::DeleteAndDestroy( USHORT nP, USHORT nL ) +void SvxAutocorrWordList::DeleteAndDestroy( sal_uInt16 nP, sal_uInt16 nL ) { if( nL ) { DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" ); - for( USHORT n=nP; n < nP + nL; n++ ) + for( sal_uInt16 n=nP; n < nP + nL; n++ ) delete *((SvxAutocorrWordPtr*)pData+n); SvPtrarr::Remove( nP, nL ); } } -BOOL SvxAutocorrWordList::Seek_Entry( const SvxAutocorrWordPtr aE, USHORT* pP ) const +sal_Bool SvxAutocorrWordList::Seek_Entry( const SvxAutocorrWordPtr aE, sal_uInt16* pP ) const { - register USHORT nO = SvxAutocorrWordList_SAR::Count(), + register sal_uInt16 nO = SvxAutocorrWordList_SAR::Count(), nM, nU = 0; if( nO > 0 ) @@ -270,21 +270,21 @@ BOOL SvxAutocorrWordList::Seek_Entry( const SvxAutocorrWordPtr aE, USHORT* pP ) if( 0 == nCmp ) { if( pP ) *pP = nM; - return TRUE; + return sal_True; } else if( 0 < nCmp ) nU = nM + 1; else if( nM == 0 ) { if( pP ) *pP = nU; - return FALSE; + return sal_False; } else nO = nM - 1; } } if( pP ) *pP = nU; - return FALSE; + return sal_False; } void lcl_ClearTable(SvxAutoCorrLanguageTable_Impl& rLangTable) @@ -395,7 +395,7 @@ void SvxAutoCorrect::_GetCharClass( LanguageType eLang ) eCharClassLang = eLang; } -void SvxAutoCorrect::SetAutoCorrFlag( long nFlag, BOOL bOn ) +void SvxAutoCorrect::SetAutoCorrFlag( long nFlag, sal_Bool bOn ) { long nOld = nFlags; nFlags = bOn ? nFlags | nFlag @@ -414,11 +414,11 @@ void SvxAutoCorrect::SetAutoCorrFlag( long nFlag, BOOL bOn ) // Two capital letters at the beginning of word? -BOOL SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt, +sal_Bool SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt, xub_StrLen nSttPos, xub_StrLen nEndPos, LanguageType eLang ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; CharClass& rCC = GetCharClass( eLang ); // Delete all non alphanumeric. Test the characters at the beginning/end of @@ -459,7 +459,7 @@ BOOL SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt, { if( SaveWordWrdSttLst & nFlags ) rDoc.SaveCpltSttWord( CptlSttWrd, nSttPos, sWord, cSave ); - bRet = TRUE; + bRet = sal_True; } } } @@ -468,7 +468,7 @@ BOOL SvxAutoCorrect::FnCptlSttWrd( SvxAutoCorrDoc& rDoc, const String& rTxt, } -BOOL SvxAutoCorrect::FnChgOrdinalNumber( +sal_Bool SvxAutoCorrect::FnChgOrdinalNumber( SvxAutoCorrDoc& rDoc, const String& rTxt, xub_StrLen nSttPos, xub_StrLen nEndPos, LanguageType eLang ) @@ -477,7 +477,7 @@ BOOL SvxAutoCorrect::FnChgOrdinalNumber( // 201th or 201st // 12th or 12nd CharClass& rCC = GetCharClass( eLang ); - BOOL bChg = FALSE; + sal_Bool bChg = sal_False; for( ; nSttPos < nEndPos; ++nSttPos ) if( !lcl_IsInAsciiArr( sImplSttSkipChars, rTxt.GetChar( nSttPos ) )) @@ -536,12 +536,12 @@ BOOL SvxAutoCorrect::FnChgOrdinalNumber( } -BOOL SvxAutoCorrect::FnChgToEnEmDash( +sal_Bool SvxAutoCorrect::FnChgToEnEmDash( SvxAutoCorrDoc& rDoc, const String& rTxt, xub_StrLen nSttPos, xub_StrLen nEndPos, LanguageType eLang ) { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; CharClass& rCC = GetCharClass( eLang ); if (eLang == LANGUAGE_SYSTEM) eLang = GetAppLang(); @@ -574,7 +574,7 @@ BOOL SvxAutoCorrect::FnChgToEnEmDash( { rDoc.Delete( nSttPos, nSttPos + 2 ); rDoc.Insert( nSttPos, bAlwaysUseEmDash ? cEmDash : cEnDash ); - bRet = TRUE; + bRet = sal_True; } } } @@ -609,7 +609,7 @@ BOOL SvxAutoCorrect::FnChgToEnEmDash( { rDoc.Delete( nTmpPos, nTmpPos + nLen ); rDoc.Insert( nTmpPos, bAlwaysUseEmDash ? cEmDash : cEnDash ); - bRet = TRUE; + bRet = sal_True; } } } @@ -633,13 +633,13 @@ BOOL SvxAutoCorrect::FnChgToEnEmDash( nSttPos = nSttPos + nFndPos; rDoc.Delete( nSttPos, nSttPos + 2 ); rDoc.Insert( nSttPos, (bEnDash ? cEnDash : cEmDash) ); - bRet = TRUE; + bRet = sal_True; } } return bRet; } -BOOL SvxAutoCorrect::FnAddNonBrkSpace( +sal_Bool SvxAutoCorrect::FnAddNonBrkSpace( SvxAutoCorrDoc& rDoc, const String& rTxt, xub_StrLen, xub_StrLen nEndPos, LanguageType eLang ) @@ -720,20 +720,20 @@ BOOL SvxAutoCorrect::FnAddNonBrkSpace( return bRet; } -BOOL SvxAutoCorrect::FnSetINetAttr( SvxAutoCorrDoc& rDoc, const String& rTxt, +sal_Bool SvxAutoCorrect::FnSetINetAttr( SvxAutoCorrDoc& rDoc, const String& rTxt, xub_StrLen nSttPos, xub_StrLen nEndPos, LanguageType eLang ) { String sURL( URIHelper::FindFirstURLInText( rTxt, nSttPos, nEndPos, GetCharClass( eLang ) )); - BOOL bRet = 0 != sURL.Len(); + sal_Bool bRet = 0 != sURL.Len(); if( bRet ) // also Attribut setzen: rDoc.SetINetAttr( nSttPos, nEndPos, sURL ); return bRet; } -BOOL SvxAutoCorrect::FnChgWeightUnderl( SvxAutoCorrDoc& rDoc, const String& rTxt, +sal_Bool SvxAutoCorrect::FnChgWeightUnderl( SvxAutoCorrDoc& rDoc, const String& rTxt, xub_StrLen, xub_StrLen nEndPos, LanguageType eLang ) { @@ -744,11 +744,11 @@ BOOL SvxAutoCorrect::FnChgWeightUnderl( SvxAutoCorrDoc& rDoc, const String& rTxt sal_Unicode c, cInsChar = rTxt.GetChar( nEndPos ); // underline or bold if( ++nEndPos != rTxt.Len() && !IsWordDelim( rTxt.GetChar( nEndPos ) ) ) - return FALSE; + return sal_False; --nEndPos; - BOOL bAlphaNum = FALSE; + sal_Bool bAlphaNum = sal_False; xub_StrLen nPos = nEndPos, nFndPos = STRING_NOTFOUND; CharClass& rCC = GetCharClass( eLang ); @@ -802,14 +802,14 @@ BOOL SvxAutoCorrect::FnChgWeightUnderl( SvxAutoCorrDoc& rDoc, const String& rTxt } -BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, - const String& rTxt, BOOL bNormalPos, +sal_Bool SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, + const String& rTxt, sal_Bool bNormalPos, xub_StrLen nSttPos, xub_StrLen nEndPos, LanguageType eLang ) { if( !rTxt.Len() || nEndPos <= nSttPos ) - return FALSE; + return sal_False; CharClass& rCC = GetCharClass( eLang ); String aText( rTxt ); @@ -818,7 +818,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, *pWordStt = 0, *pDelim = 0; - BOOL bAtStart = FALSE; + sal_Bool bAtStart = sal_False; do { --pStr; if( rCC.isLetter( @@ -855,11 +855,11 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, sal::static_int_cast< xub_StrLen >( pWordStt - pStart ) ) ) || INetURLObject::CompareProtocolScheme(rTxt.Copy(pWordStt - pStart, pDelim - pWordStt + 1)) != INET_PROT_NOT_VALID || 0x1 == *pWordStt || 0x2 == *pWordStt ) - return FALSE; // no character to be replaced, or already ok + return sal_False; // no character to be replaced, or already ok if( *pDelim && 2 >= pDelim - pWordStt && lcl_IsInAsciiArr( ".-)>", *pDelim ) ) - return FALSE; + return sal_False; if( !bAtStart ) // Still no beginning of a paragraph? { @@ -872,7 +872,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, // and full width question marks are treated as word delimiters else if ( 0x3002 != *pStr && 0xFF0E != *pStr && 0xFF01 != *pStr && 0xFF1F != *pStr ) - return FALSE; // no valid separator -> no replacement + return sal_False; // no valid separator -> no replacement } if( bAtStart ) // at the beginning of a paragraph? @@ -890,7 +890,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, } aText = *pPrevPara; - bAtStart = FALSE; + bAtStart = sal_False; pStart = aText.GetBuffer(); pStr = pStart + aText.Len(); @@ -901,7 +901,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, } while( 0 == ( bAtStart = (pStart == pStr)) ); if( bAtStart ) - return FALSE; // no valid separator -> no replacement + return sal_False; // no valid separator -> no replacement } // Found [ \t]+[A-Z0-9]+ until here. Test now on the paragraph separator. @@ -909,7 +909,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, const sal_Unicode* pExceptStt = 0; if( !bAtStart ) { - BOOL bWeiter = TRUE; + sal_Bool bWeiter = sal_True; int nFlag = C_NONE; do { switch( *pStr ) @@ -920,7 +920,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, case 0xFF0E : { if( nFlag & C_FULL_STOP ) - return FALSE; // no valid separator -> no replacement + return sal_False; // no valid separator -> no replacement nFlag |= C_FULL_STOP; pExceptStt = pStr; } @@ -929,7 +929,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, case 0xFF01 : { if( nFlag & C_EXCLAMATION_MARK ) - return FALSE; // no valid separator -> no replacement + return sal_False; // no valid separator -> no replacement nFlag |= C_EXCLAMATION_MARK; } break; @@ -937,21 +937,21 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, case 0xFF1F : { if( nFlag & C_QUESTION_MARK) - return FALSE; // no valid separator -> no replacement + return sal_False; // no valid separator -> no replacement nFlag |= C_QUESTION_MARK; } break; default: if( !nFlag ) - return FALSE; // no valid separator -> no replacement + return sal_False; // no valid separator -> no replacement else - bWeiter = FALSE; + bWeiter = sal_False; break; } if( bWeiter && pStr-- == pStart ) { - return FALSE; // no valid separator -> no replacement + return sal_False; // no valid separator -> no replacement } } while( bWeiter ); if( C_FULL_STOP != nFlag ) @@ -959,12 +959,12 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, } if( 2 > ( pStr - pStart ) ) - return FALSE; + return sal_False; if( !rCC.isLetterNumeric( aText, sal::static_int_cast< xub_StrLen >( pStr-- - pStart ) ) ) { - BOOL bValid = FALSE, bAlphaFnd = FALSE; + sal_Bool bValid = sal_False, bAlphaFnd = sal_False; const sal_Unicode* pTmpStr = pStr; while( !bValid ) { @@ -972,7 +972,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, aText, sal::static_int_cast< xub_StrLen >( pTmpStr - pStart ) ) ) { - bValid = TRUE; + bValid = sal_True; pStr = pTmpStr - 1; } else if( rCC.isLetter( @@ -982,11 +982,11 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, { if( bAlphaFnd ) { - bValid = TRUE; + bValid = sal_True; pStr = pTmpStr; } else - bAlphaFnd = TRUE; + bAlphaFnd = sal_True; } else if( bAlphaFnd || IsWordDelim( *pTmpStr ) ) break; @@ -998,10 +998,10 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, } if( !bValid ) - return FALSE; // no valid separator -> no replacement + return sal_False; // no valid separator -> no replacement } - BOOL bNumericOnly = '0' <= *(pStr+1) && *(pStr+1) <= '9'; + sal_Bool bNumericOnly = '0' <= *(pStr+1) && *(pStr+1) <= '9'; // Search for the beginning of the word while( !IsWordDelim( *pStr )) @@ -1009,7 +1009,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, if( bNumericOnly && rCC.isLetter( aText, sal::static_int_cast< xub_StrLen >( pStr - pStart ) ) ) - bNumericOnly = FALSE; + bNumericOnly = sal_False; if( pStart == pStr ) break; @@ -1018,7 +1018,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, } if( bNumericOnly ) // consists of only numbers, then not - return FALSE; + return sal_False; if( IsWordDelim( *pStr )) ++pStr; @@ -1031,7 +1031,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, sWord = String( pStr, sal::static_int_cast< xub_StrLen >( pExceptStt - pStr + 1 ) ); if( FindInCplSttExceptList(eLang, sWord) ) - return FALSE; + return sal_False; // Delete all non alphanumeric. Test the characters at the // beginning/end of the word ( recognizes: "(min.", "/min.", and so on.) @@ -1050,10 +1050,10 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, if( sTmp.Len() && sTmp.Len() != sWord.Len() && FindInCplSttExceptList(eLang, sTmp)) - return FALSE; + return sal_False; - if(FindInCplSttExceptList(eLang, sWord, TRUE)) - return FALSE; + if(FindInCplSttExceptList(eLang, sWord, sal_True)) + return sal_False; } // Ok, then replace @@ -1061,7 +1061,7 @@ BOOL SvxAutoCorrect::FnCptlSttSntnc( SvxAutoCorrDoc& rDoc, nSttPos = sal::static_int_cast< xub_StrLen >( pWordStt - rTxt.GetBuffer() ); String sChar( cSave ); rCC.toUpper( sChar ); - BOOL bRet = sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar ); + sal_Bool bRet = sChar.GetChar(0) != cSave && rDoc.Replace( nSttPos, sChar ); // Parahaps someone wants to have the word if( bRet && SaveWordCplSttLst & nFlags ) @@ -1113,7 +1113,7 @@ bool SvxAutoCorrect::FnCorrectCapsLock( SvxAutoCorrDoc& rDoc, const String& rTxt } -sal_Unicode SvxAutoCorrect::GetQuote( sal_Unicode cInsChar, BOOL bSttQuote, +sal_Unicode SvxAutoCorrect::GetQuote( sal_Unicode cInsChar, sal_Bool bSttQuote, LanguageType eLang ) const { sal_Unicode cRet = bSttQuote ? ( '\"' == cInsChar @@ -1144,10 +1144,10 @@ sal_Unicode SvxAutoCorrect::GetQuote( sal_Unicode cInsChar, BOOL bSttQuote, } void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, - sal_Unicode cInsChar, BOOL bSttQuote, - BOOL bIns ) + sal_Unicode cInsChar, sal_Bool bSttQuote, + sal_Bool bIns ) { - LanguageType eLang = rDoc.GetLanguage( nInsPos, FALSE ); + LanguageType eLang = rDoc.GetLanguage( nInsPos, sal_False ); sal_Unicode cRet = GetQuote( cInsChar, bSttQuote, eLang ); String sChg( cInsChar ); @@ -1186,9 +1186,9 @@ void SvxAutoCorrect::InsertQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, } String SvxAutoCorrect::GetQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, - sal_Unicode cInsChar, BOOL bSttQuote ) + sal_Unicode cInsChar, sal_Bool bSttQuote ) { - LanguageType eLang = rDoc.GetLanguage( nInsPos, FALSE ); + LanguageType eLang = rDoc.GetLanguage( nInsPos, sal_False ); sal_Unicode cRet = GetQuote( cInsChar, bSttQuote, eLang ); String sRet( cRet ); @@ -1214,11 +1214,11 @@ String SvxAutoCorrect::GetQuote( SvxAutoCorrDoc& rDoc, xub_StrLen nInsPos, return sRet; } -ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, +sal_uLong SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, xub_StrLen nInsPos, sal_Unicode cChar, - BOOL bInsert, Window* pFrameWin ) + sal_Bool bInsert, Window* pFrameWin ) { - ULONG nRet = 0; + sal_uLong nRet = 0; bool bIsNextRun = bRunNext; bRunNext = false; // if it was set, then it has to be turned off @@ -1234,14 +1234,14 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, break; } - BOOL bSingle = '\'' == cChar; - BOOL bIsReplaceQuote = + sal_Bool bSingle = '\'' == cChar; + sal_Bool bIsReplaceQuote = (IsAutoCorrFlag( ChgQuotes ) && ('\"' == cChar )) || (IsAutoCorrFlag( ChgSglQuotes ) && bSingle ); if( bIsReplaceQuote ) { sal_Unicode cPrev; - BOOL bSttQuote = !nInsPos || + sal_Bool bSttQuote = !nInsPos || IsWordDelim( ( cPrev = rTxt.GetChar( nInsPos-1 ))) || lcl_IsInAsciiArr( "([{", cPrev ) || ( cEmDash && cEmDash == cPrev ) || @@ -1261,7 +1261,7 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, if ( IsAutoCorrFlag( AddNonBrkSpace ) ) { if ( NeedsHardspaceAutocorr( cChar ) && - FnAddNonBrkSpace( rDoc, rTxt, 0, nInsPos, rDoc.GetLanguage( nInsPos, FALSE ) ) ) + FnAddNonBrkSpace( rDoc, rTxt, 0, nInsPos, rDoc.GetLanguage( nInsPos, sal_False ) ) ) { nRet = AddNonBrkSpace; } @@ -1318,7 +1318,7 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, if( !nPos && !IsWordDelim( rTxt.GetChar( 0 ))) --nCapLttrPos; // Absatz Anfang und kein Blank ! - LanguageType eLang = rDoc.GetLanguage( nCapLttrPos, FALSE ); + LanguageType eLang = rDoc.GetLanguage( nCapLttrPos, sal_False ); if( LANGUAGE_SYSTEM == eLang ) eLang = MsLangId::getSystemLanguage(); CharClass& rCC = GetCharClass( eLang ); @@ -1331,7 +1331,7 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, const String* pPara = 0; const String** ppPara = IsAutoCorrFlag(CptlSttSntnc) ? &pPara : 0; - BOOL bChgWord = rDoc.ChgAutoCorrWord( nCapLttrPos, nInsPos, + sal_Bool bChgWord = rDoc.ChgAutoCorrWord( nCapLttrPos, nInsPos, *this, ppPara ); if( !bChgWord ) { @@ -1349,7 +1349,7 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, nCapLttrPos1 < nInsPos1 && rDoc.ChgAutoCorrWord( nCapLttrPos1, nInsPos1, *this, ppPara )) { - bChgWord = TRUE; + bChgWord = sal_True; nCapLttrPos = nCapLttrPos1; } } @@ -1366,7 +1366,7 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, // Capital letter at beginning of paragraph? if( IsAutoCorrFlag( CptlSttSntnc ) && - FnCptlSttSntnc( rDoc, *pPara, FALSE, + FnCptlSttSntnc( rDoc, *pPara, sal_False, nCapLttrPos, nEnd, eLang ) ) nRet |= CptlSttSntnc; @@ -1401,7 +1401,7 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, // Capital letter at beginning of paragraph ? if( IsAutoCorrFlag( CptlSttSntnc ) && - FnCptlSttSntnc( rDoc, rTxt, TRUE, nCapLttrPos, nInsPos, eLang ) ) + FnCptlSttSntnc( rDoc, rTxt, sal_True, nCapLttrPos, nInsPos, eLang ) ) nRet |= CptlSttSntnc; // Two capital letters at beginning of word ?? @@ -1414,11 +1414,37 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, nRet |= ChgToEnEmDash; } - } while( FALSE ); + } while( sal_False ); if( nRet ) { - ULONG nHelpId = 0; + const char* aHelpIds[] = + { + HID_AUTOCORR_HELP_WORD, + HID_AUTOCORR_HELP_SENT, + HID_AUTOCORR_HELP_SENTWORD, + HID_AUTOCORR_HELP_ACORWORD, + "", + HID_AUTOCORR_HELP_ACORSENTWORD, + "", + HID_AUTOCORR_HELP_CHGTOENEMDASH, + HID_AUTOCORR_HELP_WORDENEMDASH, + HID_AUTOCORR_HELP_SENTENEMDASH, + HID_AUTOCORR_HELP_SENTWORDENEMDASH, + HID_AUTOCORR_HELP_ACORWORDENEMDASH, + "", + HID_AUTOCORR_HELP_ACORSENTWORDENEMDASH, + "", + HID_AUTOCORR_HELP_CHGQUOTES, + HID_AUTOCORR_HELP_CHGSGLQUOTES, + HID_AUTOCORR_HELP_SETINETATTR, + HID_AUTOCORR_HELP_INGNOREDOUBLESPACE, + HID_AUTOCORR_HELP_CHGWEIGHTUNDERL, + HID_AUTOCORR_HELP_CHGFRACTIONSYMBOL, + HID_AUTOCORR_HELP_CHGORDINALNUMBER + }; + + sal_uLong nHelpId = 0; if( nRet & ( Autocorrect|CptlSttSntnc|CptlSttWrd|ChgToEnEmDash ) ) { // from 0 - 15 @@ -1444,8 +1470,8 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, if( nHelpId ) { - nHelpId += HID_AUTOCORR_HELP_START - 1; - Application::GetHelp()->OpenHelpAgent( nHelpId ); + nHelpId -= 1; + Application::GetHelp()->OpenHelpAgent( aHelpIds[nHelpId] ); } } @@ -1456,16 +1482,16 @@ ULONG SvxAutoCorrect::AutoCorrect( SvxAutoCorrDoc& rDoc, const String& rTxt, SvxAutoCorrectLanguageLists& SvxAutoCorrect::_GetLanguageList( LanguageType eLang ) { - if( !pLangTable->IsKeyValid( ULONG( eLang ))) - CreateLanguageFile( eLang, TRUE); - return *pLangTable->Seek( ULONG( eLang ) ); + if( !pLangTable->IsKeyValid( sal_uLong( eLang ))) + CreateLanguageFile( eLang, sal_True); + return *pLangTable->Seek( sal_uLong( eLang ) ); } void SvxAutoCorrect::SaveCplSttExceptList( LanguageType eLang ) { - if( pLangTable->IsKeyValid( ULONG( eLang ))) + if( pLangTable->IsKeyValid( sal_uLong( eLang ))) { - SvxAutoCorrectLanguageListsPtr pLists = pLangTable->Seek(ULONG(eLang)); + SvxAutoCorrectLanguageListsPtr pLists = pLangTable->Seek(sal_uLong(eLang)); if( pLists ) pLists->SaveCplSttExceptList(); } @@ -1479,9 +1505,9 @@ void SvxAutoCorrect::SaveCplSttExceptList( LanguageType eLang ) void SvxAutoCorrect::SaveWrdSttExceptList(LanguageType eLang) { - if(pLangTable->IsKeyValid(ULONG(eLang))) + if(pLangTable->IsKeyValid(sal_uLong(eLang))) { - SvxAutoCorrectLanguageListsPtr pLists = pLangTable->Seek(ULONG(eLang)); + SvxAutoCorrectLanguageListsPtr pLists = pLangTable->Seek(sal_uLong(eLang)); if(pLists) pLists->SaveWrdSttExceptList(); } @@ -1494,17 +1520,17 @@ void SvxAutoCorrect::SaveWrdSttExceptList(LanguageType eLang) } // Adds a single word. The list will immediately be written to the file! -BOOL SvxAutoCorrect::AddCplSttException( const String& rNew, +sal_Bool SvxAutoCorrect::AddCplSttException( const String& rNew, LanguageType eLang ) { SvxAutoCorrectLanguageListsPtr pLists = 0; // either the right language is present or it will be this in the general list - if( pLangTable->IsKeyValid(ULONG(eLang))) - pLists = pLangTable->Seek(ULONG(eLang)); - else if(pLangTable->IsKeyValid(ULONG(LANGUAGE_DONTKNOW))|| - CreateLanguageFile(LANGUAGE_DONTKNOW, TRUE)) + if( pLangTable->IsKeyValid(sal_uLong(eLang))) + pLists = pLangTable->Seek(sal_uLong(eLang)); + else if(pLangTable->IsKeyValid(sal_uLong(LANGUAGE_DONTKNOW))|| + CreateLanguageFile(LANGUAGE_DONTKNOW, sal_True)) { - pLists = pLangTable->Seek(ULONG(LANGUAGE_DONTKNOW)); + pLists = pLangTable->Seek(sal_uLong(LANGUAGE_DONTKNOW)); } DBG_ASSERT(pLists, "No auto correction data"); return pLists->AddToCplSttExceptList(rNew); @@ -1512,17 +1538,17 @@ BOOL SvxAutoCorrect::AddCplSttException( const String& rNew, // Adds a single word. The list will immediately be written to the file! -BOOL SvxAutoCorrect::AddWrtSttException( const String& rNew, +sal_Bool SvxAutoCorrect::AddWrtSttException( const String& rNew, LanguageType eLang ) { SvxAutoCorrectLanguageListsPtr pLists = 0; //either the right language is present or it is set in the general list - if(pLangTable->IsKeyValid(ULONG(eLang))) - pLists = pLangTable->Seek(ULONG(eLang)); - else if(pLangTable->IsKeyValid(ULONG(LANGUAGE_DONTKNOW))|| - CreateLanguageFile(LANGUAGE_DONTKNOW, TRUE)) - pLists = pLangTable->Seek(ULONG(LANGUAGE_DONTKNOW)); - DBG_ASSERT(pLists, "No auto correction data"); + if(pLangTable->IsKeyValid(sal_uLong(eLang))) + pLists = pLangTable->Seek(sal_uLong(eLang)); + else if(pLangTable->IsKeyValid(sal_uLong(LANGUAGE_DONTKNOW))|| + CreateLanguageFile(LANGUAGE_DONTKNOW, sal_True)) + pLists = pLangTable->Seek(sal_uLong(LANGUAGE_DONTKNOW)); + DBG_ASSERT(pLists, "keine Autokorrekturdatei"); return pLists->AddToWrdSttExceptList(rNew); } @@ -1554,12 +1580,12 @@ void SvxAutoCorrect::SetShareAutoCorrFileName( const String& rNew ) } -BOOL SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc, +sal_Bool SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc, const String& rTxt, xub_StrLen nPos, String& rWord ) const { if( !nPos ) - return FALSE; + return sal_False; xub_StrLen nEnde = nPos; @@ -1567,7 +1593,7 @@ BOOL SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc, if( ( nPos < rTxt.Len() && !IsWordDelim( rTxt.GetChar( nPos ))) || IsWordDelim( rTxt.GetChar( --nPos ))) - return FALSE; + return sal_False; while( nPos && !IsWordDelim( rTxt.GetChar( --nPos ))) ; @@ -1580,12 +1606,12 @@ BOOL SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc, while( lcl_IsInAsciiArr( sImplSttSkipChars, rTxt.GetChar( nCapLttrPos )) ) if( ++nCapLttrPos >= nEnde ) - return FALSE; + return sal_False; if( 3 > nEnde - nCapLttrPos ) - return FALSE; + return sal_False; - LanguageType eLang = rDoc.GetLanguage( nCapLttrPos, FALSE ); + LanguageType eLang = rDoc.GetLanguage( nCapLttrPos, sal_False ); if( LANGUAGE_SYSTEM == eLang ) eLang = MsLangId::getSystemLanguage(); @@ -1593,24 +1619,24 @@ BOOL SvxAutoCorrect::GetPrevAutoCorrWord( SvxAutoCorrDoc& rDoc, CharClass& rCC = pThis->GetCharClass( eLang ); if( lcl_IsSymbolChar( rCC, rTxt, nCapLttrPos, nEnde )) - return FALSE; + return sal_False; rWord = rTxt.Copy( nCapLttrPos, nEnde - nCapLttrPos ); - return TRUE; + return sal_True; } -BOOL SvxAutoCorrect::CreateLanguageFile( LanguageType eLang, BOOL bNewFile ) +sal_Bool SvxAutoCorrect::CreateLanguageFile( LanguageType eLang, sal_Bool bNewFile ) { - DBG_ASSERT(!pLangTable->IsKeyValid(ULONG(eLang)), "Language already exists "); + DBG_ASSERT(!pLangTable->IsKeyValid(sal_uLong(eLang)), "Language already exists "); - String sUserDirFile( GetAutoCorrFileName( eLang, TRUE, FALSE )), + String sUserDirFile( GetAutoCorrFileName( eLang, sal_True, sal_False )), sShareDirFile( sUserDirFile ); SvxAutoCorrectLanguageListsPtr pLists = 0; Time nMinTime( 0, 2 ), nAktTime, nLastCheckTime; - ULONG nFndPos; + sal_uLong nFndPos; if( TABLE_ENTRY_NOTFOUND != - pLastFileTable->SearchKey( ULONG( eLang ), &nFndPos ) && + pLastFileTable->SearchKey( sal_uLong( eLang ), &nFndPos ) && ( nLastCheckTime.SetTime( pLastFileTable->GetObject( nFndPos )), nLastCheckTime < nAktTime ) && ( nAktTime - nLastCheckTime ) < nMinTime ) @@ -1622,60 +1648,60 @@ BOOL SvxAutoCorrect::CreateLanguageFile( LanguageType eLang, BOOL bNewFile ) sShareDirFile = sUserDirFile; pLists = new SvxAutoCorrectLanguageLists( *this, sShareDirFile, sUserDirFile, eLang ); - pLangTable->Insert( ULONG(eLang), pLists ); - pLastFileTable->Remove( ULONG( eLang ) ); + pLangTable->Insert( sal_uLong(eLang), pLists ); + pLastFileTable->Remove( sal_uLong( eLang ) ); } } else if( ( FStatHelper::IsDocument( sUserDirFile ) || FStatHelper::IsDocument( sShareDirFile = - GetAutoCorrFileName( eLang, FALSE, FALSE ) ) ) || + GetAutoCorrFileName( eLang, sal_False, sal_False ) ) ) || ( sShareDirFile = sUserDirFile, bNewFile )) { pLists = new SvxAutoCorrectLanguageLists( *this, sShareDirFile, sUserDirFile, eLang ); - pLangTable->Insert( ULONG(eLang), pLists ); - pLastFileTable->Remove( ULONG( eLang ) ); + pLangTable->Insert( sal_uLong(eLang), pLists ); + pLastFileTable->Remove( sal_uLong( eLang ) ); } else if( !bNewFile ) { - if( !pLastFileTable->Insert( ULONG( eLang ), nAktTime.GetTime() )) - pLastFileTable->Replace( ULONG( eLang ), nAktTime.GetTime() ); + if( !pLastFileTable->Insert( sal_uLong( eLang ), nAktTime.GetTime() )) + pLastFileTable->Replace( sal_uLong( eLang ), nAktTime.GetTime() ); } return pLists != 0; } -BOOL SvxAutoCorrect::PutText( const String& rShort, const String& rLong, +sal_Bool SvxAutoCorrect::PutText( const String& rShort, const String& rLong, LanguageType eLang ) { - BOOL bRet = FALSE; - if( pLangTable->IsKeyValid( ULONG(eLang)) || CreateLanguageFile(eLang) ) - bRet = pLangTable->Seek( ULONG(eLang) )->PutText(rShort, rLong); + sal_Bool bRet = sal_False; + if( pLangTable->IsKeyValid( sal_uLong(eLang)) || CreateLanguageFile(eLang) ) + bRet = pLangTable->Seek( sal_uLong(eLang) )->PutText(rShort, rLong); return bRet; } // - Delete an entry -BOOL SvxAutoCorrect::DeleteText( const String& rShort, LanguageType eLang ) +sal_Bool SvxAutoCorrect::DeleteText( const String& rShort, LanguageType eLang ) { - BOOL bRet = FALSE; - if( pLangTable->IsKeyValid( ULONG( eLang )) ) - bRet = pLangTable->Seek( ULONG( eLang ))->DeleteText( rShort ); + sal_Bool bRet = sal_False; + if( pLangTable->IsKeyValid( sal_uLong( eLang )) ) + bRet = pLangTable->Seek( sal_uLong( eLang ))->DeleteText( rShort ); return bRet; } // - return the replacement text (only for SWG-Format, all other // can be taken from the word list!) -BOOL SvxAutoCorrect::GetLongText( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, const String&, const String& , String& ) +sal_Bool SvxAutoCorrect::GetLongText( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, const String&, const String& , String& ) { - return FALSE; + return sal_False; } // Text with attribution (only the SWG - SWG format!) -BOOL SvxAutoCorrect::PutText( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, const String&, const String&, SfxObjectShell&, +sal_Bool SvxAutoCorrect::PutText( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, const String&, const String&, SfxObjectShell&, String& ) { - return FALSE; + return sal_False; } void EncryptBlockName_Imp( String& rName ) @@ -1766,11 +1792,11 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList( // First search for eLang, then US-English -> English // and last in LANGUAGE_DONTKNOW - if( pLangTable->IsKeyValid( ULONG( eLang ) ) || - CreateLanguageFile( eLang, FALSE )) + if( pLangTable->IsKeyValid( sal_uLong( eLang ) ) || + CreateLanguageFile( eLang, sal_False )) { //the language is available - so bring it on - SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(ULONG(eLang)); + SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(sal_uLong(eLang)); pRet = lcl_SearchWordsInList( pList, rTxt, rStt, nEndPos, rDoc ); if( pRet ) { @@ -1781,16 +1807,16 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList( // If it still could not be found here, then keep on searching - ULONG nTmpKey1 = eLang & 0x7ff, // the main language in many cases DE + sal_uLong nTmpKey1 = eLang & 0x7ff, // the main language in many cases DE nTmpKey2 = eLang & 0x3ff, // otherwise for example EN nTmp; - if( ((nTmp = nTmpKey1) != (ULONG)eLang && + if( ((nTmp = nTmpKey1) != (sal_uLong)eLang && ( pLangTable->IsKeyValid( nTmpKey1 ) || - CreateLanguageFile( LanguageType( nTmpKey1 ), FALSE ) )) || - (( nTmp = nTmpKey2) != (ULONG)eLang && + CreateLanguageFile( LanguageType( nTmpKey1 ), sal_False ) )) || + (( nTmp = nTmpKey2) != (sal_uLong)eLang && ( pLangTable->IsKeyValid( nTmpKey2 ) || - CreateLanguageFile( LanguageType( nTmpKey2 ), FALSE ) )) ) + CreateLanguageFile( LanguageType( nTmpKey2 ), sal_False ) )) ) { //the language is available - so bring it on SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek( nTmp ); @@ -1801,11 +1827,11 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList( return pRet; } } - if( pLangTable->IsKeyValid( ULONG( LANGUAGE_DONTKNOW ) ) || - CreateLanguageFile( LANGUAGE_DONTKNOW, FALSE ) ) + if( pLangTable->IsKeyValid( sal_uLong( LANGUAGE_DONTKNOW ) ) || + CreateLanguageFile( LANGUAGE_DONTKNOW, sal_False ) ) { //the language is available - so bring it on - SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(ULONG(LANGUAGE_DONTKNOW)); + SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(sal_uLong(LANGUAGE_DONTKNOW)); pRet = lcl_SearchWordsInList( pList, rTxt, rStt, nEndPos, rDoc); if( pRet ) { @@ -1816,58 +1842,58 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList( return 0; } -BOOL SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang, +sal_Bool SvxAutoCorrect::FindInWrdSttExceptList( LanguageType eLang, const String& sWord ) { // First search for eLang, then US-English -> English // and last in LANGUAGE_DONTKNOW - ULONG nTmpKey1 = eLang & 0x7ff; // the main language in many cases DE - ULONG nTmpKey2 = eLang & 0x3ff; // otherwise for example EN + sal_uLong nTmpKey1 = eLang & 0x7ff; // the main language in many cases DE + sal_uLong nTmpKey2 = eLang & 0x3ff; // otherwise for example EN String sTemp(sWord); - if( pLangTable->IsKeyValid( ULONG( eLang )) || - CreateLanguageFile( eLang, FALSE ) ) + if( pLangTable->IsKeyValid( sal_uLong( eLang )) || + CreateLanguageFile( eLang, sal_False ) ) { //the language is available - so bring it on - SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(ULONG(eLang)); + SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(sal_uLong(eLang)); String _sTemp(sWord); if(pList->GetWrdSttExceptList()->Seek_Entry(&_sTemp)) - return TRUE; + return sal_True; } // If it still could not be found here, then keep on searching - ULONG nTmp; - if( ((nTmp = nTmpKey1) != (ULONG)eLang && + sal_uLong nTmp; + if( ((nTmp = nTmpKey1) != (sal_uLong)eLang && ( pLangTable->IsKeyValid( nTmpKey1 ) || - CreateLanguageFile( LanguageType( nTmpKey1 ), FALSE ) )) || - (( nTmp = nTmpKey2) != (ULONG)eLang && + CreateLanguageFile( LanguageType( nTmpKey1 ), sal_False ) )) || + (( nTmp = nTmpKey2) != (sal_uLong)eLang && ( pLangTable->IsKeyValid( nTmpKey2 ) || - CreateLanguageFile( LanguageType( nTmpKey2 ), FALSE ) )) ) + CreateLanguageFile( LanguageType( nTmpKey2 ), sal_False ) )) ) { //the language is available - so bring it on SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(nTmp); if(pList->GetWrdSttExceptList()->Seek_Entry(&sTemp)) - return TRUE; + return sal_True; } - if(pLangTable->IsKeyValid(ULONG(LANGUAGE_DONTKNOW))|| CreateLanguageFile(LANGUAGE_DONTKNOW, FALSE)) + if(pLangTable->IsKeyValid(sal_uLong(LANGUAGE_DONTKNOW))|| CreateLanguageFile(LANGUAGE_DONTKNOW, sal_False)) { //the language is available - so bring it on - SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(ULONG(LANGUAGE_DONTKNOW)); + SvxAutoCorrectLanguageListsPtr pList = pLangTable->Seek(sal_uLong(LANGUAGE_DONTKNOW)); if(pList->GetWrdSttExceptList()->Seek_Entry(&sTemp)) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL lcl_FindAbbreviation( const SvStringsISortDtor* pList, const String& sWord) +sal_Bool lcl_FindAbbreviation( const SvStringsISortDtor* pList, const String& sWord) { String sAbk( '~' ); - USHORT nPos; + sal_uInt16 nPos; pList->Seek_Entry( &sAbk, &nPos ); if( nPos < pList->Count() ) { String sLowerWord( sWord ); sLowerWord.ToLowerAscii(); const String* pAbk; - for( USHORT n = nPos; + for( sal_uInt16 n = nPos; n < pList->Count() && '~' == ( pAbk = (*pList)[ n ])->GetChar( 0 ); ++n ) @@ -1879,7 +1905,7 @@ BOOL lcl_FindAbbreviation( const SvStringsISortDtor* pList, const String& sWord) for( xub_StrLen i = sLowerAbk.Len(), ii = sLowerWord.Len(); i; ) { if( !--i ) // agrees - return TRUE; + return sal_True; if( sLowerAbk.GetChar( i ) != sLowerWord.GetChar( --ii )) break; @@ -1889,59 +1915,59 @@ BOOL lcl_FindAbbreviation( const SvStringsISortDtor* pList, const String& sWord) } DBG_ASSERT( !(nPos && '~' == (*pList)[ --nPos ]->GetChar( 0 ) ), "Wrongly sorted exception list?" ); - return FALSE; + return sal_False; } -BOOL SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang, - const String& sWord, BOOL bAbbreviation) +sal_Bool SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang, + const String& sWord, sal_Bool bAbbreviation) { // First search for eLang, then US-English -> English // and last in LANGUAGE_DONTKNOW - ULONG nTmpKey1 = eLang & 0x7ff; // the main language in many cases DE - ULONG nTmpKey2 = eLang & 0x3ff; // otherwise for example EN + sal_uLong nTmpKey1 = eLang & 0x7ff; // the main language in many cases DE + sal_uLong nTmpKey2 = eLang & 0x3ff; // otherwise for example EN String sTemp( sWord ); - if( pLangTable->IsKeyValid( ULONG( eLang )) || - CreateLanguageFile( eLang, FALSE )) + if( pLangTable->IsKeyValid( sal_uLong( eLang )) || + CreateLanguageFile( eLang, sal_False )) { //the language is available - so bring it on - SvxAutoCorrectLanguageListsPtr pLists = pLangTable->Seek(ULONG(eLang)); + SvxAutoCorrectLanguageListsPtr pLists = pLangTable->Seek(sal_uLong(eLang)); const SvStringsISortDtor* pList = pLists->GetCplSttExceptList(); if(bAbbreviation ? lcl_FindAbbreviation( pList, sWord) : pList->Seek_Entry( &sTemp ) ) - return TRUE; + return sal_True; } // If it still could not be found here, then keep on searching - ULONG nTmp; + sal_uLong nTmp; - if( ((nTmp = nTmpKey1) != (ULONG)eLang && + if( ((nTmp = nTmpKey1) != (sal_uLong)eLang && ( pLangTable->IsKeyValid( nTmpKey1 ) || - CreateLanguageFile( LanguageType( nTmpKey1 ), FALSE ) )) || - (( nTmp = nTmpKey2) != (ULONG)eLang && + CreateLanguageFile( LanguageType( nTmpKey1 ), sal_False ) )) || + (( nTmp = nTmpKey2) != (sal_uLong)eLang && ( pLangTable->IsKeyValid( nTmpKey2 ) || - CreateLanguageFile( LanguageType( nTmpKey2 ), FALSE ) )) ) + CreateLanguageFile( LanguageType( nTmpKey2 ), sal_False ) )) ) { //the language is available - so bring it on SvxAutoCorrectLanguageListsPtr pLists = pLangTable->Seek(nTmp); const SvStringsISortDtor* pList = pLists->GetCplSttExceptList(); if(bAbbreviation ? lcl_FindAbbreviation( pList, sWord) : pList->Seek_Entry( &sTemp ) ) - return TRUE; + return sal_True; } - if(pLangTable->IsKeyValid(ULONG(LANGUAGE_DONTKNOW))|| CreateLanguageFile(LANGUAGE_DONTKNOW, FALSE)) + if(pLangTable->IsKeyValid(sal_uLong(LANGUAGE_DONTKNOW))|| CreateLanguageFile(LANGUAGE_DONTKNOW, sal_False)) { //the language is available - so bring it on SvxAutoCorrectLanguageListsPtr pLists = pLangTable->Seek(LANGUAGE_DONTKNOW); const SvStringsISortDtor* pList = pLists->GetCplSttExceptList(); if(bAbbreviation ? lcl_FindAbbreviation( pList, sWord) : pList->Seek_Entry( &sTemp ) ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } String SvxAutoCorrect::GetAutoCorrFileName( LanguageType eLang, - BOOL bNewFile, BOOL bTst ) const + sal_Bool bNewFile, sal_Bool bTst ) const { String sRet, sExt( MsLangId::convertLanguageToIsoString( eLang ) ); sExt.Insert('_', 0); @@ -1983,10 +2009,10 @@ SvxAutoCorrectLanguageLists::~SvxAutoCorrectLanguageLists() delete pAutocorr_List; } -BOOL SvxAutoCorrectLanguageLists::IsFileChanged_Imp() +sal_Bool SvxAutoCorrectLanguageLists::IsFileChanged_Imp() { // Access the file system only every 2 minutes to check the date stamp - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; Time nMinTime( 0, 2 ); Time nAktTime; @@ -1998,7 +2024,7 @@ BOOL SvxAutoCorrectLanguageLists::IsFileChanged_Imp() &aTstDate, &aTstTime ) && ( aModifiedDate != aTstDate || aModifiedTime != aTstTime )) { - bRet = TRUE; + bRet = sal_True; // then remove all the lists fast! if( CplSttLstLoad & nFlags && pCplStt_ExcptLst ) delete pCplStt_ExcptLst, pCplStt_ExcptLst = 0; @@ -2104,7 +2130,7 @@ void SvxAutoCorrectLanguageLists::SaveExceptList_Imp( const SvStringsISortDtor& rLst, const sal_Char* pStrmName, SotStorageRef &rStg, - BOOL bConvert ) + sal_Bool bConvert ) { if( rStg.Is() ) { @@ -2243,13 +2269,13 @@ SvStringsISortDtor* SvxAutoCorrectLanguageLists::GetCplSttExceptList() return pCplStt_ExcptLst; } -BOOL SvxAutoCorrectLanguageLists::AddToCplSttExceptList(const String& rNew) +sal_Bool SvxAutoCorrectLanguageLists::AddToCplSttExceptList(const String& rNew) { String* pNew = new String( rNew ); if( rNew.Len() && GetCplSttExceptList()->Insert( pNew ) ) { MakeUserStorage_Impl(); - SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, TRUE ); + SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, sal_True ); SaveExceptList_Imp( *pCplStt_ExcptLst, pXMLImplCplStt_ExcptLstStr, xStg ); @@ -2264,14 +2290,14 @@ BOOL SvxAutoCorrectLanguageLists::AddToCplSttExceptList(const String& rNew) return 0 != pNew; } -BOOL SvxAutoCorrectLanguageLists::AddToWrdSttExceptList(const String& rNew) +sal_Bool SvxAutoCorrectLanguageLists::AddToWrdSttExceptList(const String& rNew) { String* pNew = new String( rNew ); SvStringsISortDtor* pExceptList = LoadWrdSttExceptList(); if( rNew.Len() && pExceptList && pExceptList->Insert( pNew ) ) { MakeUserStorage_Impl(); - SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, TRUE ); + SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, sal_True ); SaveExceptList_Imp( *pWrdStt_ExcptLst, pXMLImplWrdStt_ExcptLstStr, xStg ); @@ -2288,7 +2314,7 @@ BOOL SvxAutoCorrectLanguageLists::AddToWrdSttExceptList(const String& rNew) SvStringsISortDtor* SvxAutoCorrectLanguageLists::LoadCplSttExceptList() { - SotStorageRef xStg = new SotStorage( sShareAutoCorrFile, STREAM_READ | STREAM_SHARE_DENYNONE, TRUE ); + SotStorageRef xStg = new SotStorage( sShareAutoCorrFile, STREAM_READ | STREAM_SHARE_DENYNONE, sal_True ); String sTemp ( RTL_CONSTASCII_USTRINGPARAM ( pXMLImplCplStt_ExcptLstStr ) ); if( xStg.Is() && xStg->IsContained( sTemp ) ) LoadXMLExceptList_Imp( pCplStt_ExcptLst, pXMLImplCplStt_ExcptLstStr, xStg ); @@ -2299,7 +2325,7 @@ SvStringsISortDtor* SvxAutoCorrectLanguageLists::LoadCplSttExceptList() void SvxAutoCorrectLanguageLists::SaveCplSttExceptList() { MakeUserStorage_Impl(); - SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, TRUE ); + SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, sal_True ); SaveExceptList_Imp( *pCplStt_ExcptLst, pXMLImplCplStt_ExcptLstStr, xStg ); @@ -2327,7 +2353,7 @@ void SvxAutoCorrectLanguageLists::SetCplSttExceptList( SvStringsISortDtor* pList SvStringsISortDtor* SvxAutoCorrectLanguageLists::LoadWrdSttExceptList() { - SotStorageRef xStg = new SotStorage( sShareAutoCorrFile, STREAM_READ | STREAM_SHARE_DENYNONE, TRUE ); + SotStorageRef xStg = new SotStorage( sShareAutoCorrFile, STREAM_READ | STREAM_SHARE_DENYNONE, sal_True ); String sTemp ( RTL_CONSTASCII_USTRINGPARAM ( pXMLImplWrdStt_ExcptLstStr ) ); if( xStg.Is() && xStg->IsContained( sTemp ) ) LoadXMLExceptList_Imp( pWrdStt_ExcptLst, pXMLImplWrdStt_ExcptLstStr, xStg ); @@ -2337,7 +2363,7 @@ SvStringsISortDtor* SvxAutoCorrectLanguageLists::LoadWrdSttExceptList() void SvxAutoCorrectLanguageLists::SaveWrdSttExceptList() { MakeUserStorage_Impl(); - SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, TRUE ); + SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, sal_True ); SaveExceptList_Imp( *pWrdStt_ExcptLst, pXMLImplWrdStt_ExcptLstStr, xStg ); @@ -2372,7 +2398,7 @@ void SvxAutoCorrectLanguageLists::RemoveStream_Imp( const String& rName ) { if( sShareAutoCorrFile != sUserAutoCorrFile ) { - SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, TRUE ); + SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, sal_True ); if( xStg.Is() && SVSTREAM_OK == xStg->GetError() && xStg->IsStream( rName ) ) { @@ -2426,7 +2452,7 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl() aInfo.NameClash = NameClash::OVERWRITE; aInfo.NewTitle = aDest.GetName(); aInfo.SourceURL = aSource.GetMainURL( INetURLObject::DECODE_TO_IURI ); - aInfo.MoveData = FALSE; + aInfo.MoveData = sal_False; aAny <<= aInfo; aNewContent.executeCommand( OUString ( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), aAny); } @@ -2437,8 +2463,8 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl() } if (bConvert && !bError) { - SotStorageRef xSrcStg = new SotStorage( aDest.GetMainURL( INetURLObject::DECODE_TO_IURI ), STREAM_READ, TRUE ); - SotStorageRef xDstStg = new SotStorage( sUserAutoCorrFile, STREAM_WRITE, TRUE ); + SotStorageRef xSrcStg = new SotStorage( aDest.GetMainURL( INetURLObject::DECODE_TO_IURI ), STREAM_READ, sal_True ); + SotStorageRef xDstStg = new SotStorage( sUserAutoCorrFile, STREAM_WRITE, sal_True ); if( xSrcStg.Is() && xDstStg.Is() ) { @@ -2453,7 +2479,7 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl() if (pTmpWordList) { - SaveExceptList_Imp( *pTmpWordList, pXMLImplWrdStt_ExcptLstStr, xDstStg, TRUE ); + SaveExceptList_Imp( *pTmpWordList, pXMLImplWrdStt_ExcptLstStr, xDstStg, sal_True ); pTmpWordList->DeleteAndDestroy( 0, pTmpWordList->Count() ); pTmpWordList = NULL; } @@ -2464,7 +2490,7 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl() if (pTmpWordList) { - SaveExceptList_Imp( *pTmpWordList, pXMLImplCplStt_ExcptLstStr, xDstStg, TRUE ); + SaveExceptList_Imp( *pTmpWordList, pXMLImplCplStt_ExcptLstStr, xDstStg, sal_True ); pTmpWordList->DeleteAndDestroy( 0, pTmpWordList->Count() ); } @@ -2486,10 +2512,10 @@ void SvxAutoCorrectLanguageLists::MakeUserStorage_Impl() sShareAutoCorrFile = sUserAutoCorrFile; } -BOOL SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SvStorage& rStg ) +sal_Bool SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SvStorage& rStg ) { String sStrmName( pXMLImplAutocorr_ListStr, RTL_TEXTENCODING_MS_1252 ); - BOOL bRet = TRUE, bRemove = !pAutocorr_List || !pAutocorr_List->Count(); + sal_Bool bRet = sal_True, bRemove = !pAutocorr_List || !pAutocorr_List->Count(); if( !bRemove ) { SvStorageStreamRef refList = rStg.OpenSotStream( sStrmName, @@ -2534,14 +2560,13 @@ BOOL SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SvStorage& rStg ) rStg.Commit(); if( SVSTREAM_OK != rStg.GetError() ) { - bRemove = TRUE; - bRet = FALSE; + bRemove = sal_True; + bRet = sal_False; } } - } else - bRet = FALSE; + bRet = sal_False; } if( bRemove ) @@ -2553,22 +2578,22 @@ BOOL SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SvStorage& rStg ) return bRet; } -BOOL SvxAutoCorrectLanguageLists::PutText( const String& rShort, +sal_Bool SvxAutoCorrectLanguageLists::PutText( const String& rShort, const String& rLong ) { // First get the current list! GetAutocorrWordList(); MakeUserStorage_Impl(); - SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, TRUE ); + SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, sal_True ); - BOOL bRet = xStg.Is() && SVSTREAM_OK == xStg->GetError(); + sal_Bool bRet = xStg.Is() && SVSTREAM_OK == xStg->GetError(); // Update the word list if( bRet ) { - USHORT nPos; - SvxAutocorrWord* pNew = new SvxAutocorrWord( rShort, rLong, TRUE ); + sal_uInt16 nPos; + SvxAutocorrWord* pNew = new SvxAutocorrWord( rShort, rLong, sal_True ); if( pAutocorr_List->Seek_Entry( pNew, &nPos ) ) { if( !(*pAutocorr_List)[ nPos ]->IsTextOnly() ) @@ -2594,14 +2619,13 @@ BOOL SvxAutoCorrectLanguageLists::PutText( const String& rShort, else { delete pNew; - bRet = FALSE; + bRet = sal_False; } } return bRet; } -// Text with attribution (only the SWG - SWG format!) -BOOL SvxAutoCorrectLanguageLists::PutText( const String& rShort, +sal_Bool SvxAutoCorrectLanguageLists::PutText( const String& rShort, SfxObjectShell& rShell ) { // First get the current list! @@ -2609,7 +2633,7 @@ BOOL SvxAutoCorrectLanguageLists::PutText( const String& rShort, MakeUserStorage_Impl(); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; String sLong; try { @@ -2620,10 +2644,10 @@ BOOL SvxAutoCorrectLanguageLists::PutText( const String& rShort, // Update the word list if( bRet ) { - SvxAutocorrWord* pNew = new SvxAutocorrWord( rShort, sLong, FALSE ); + SvxAutocorrWord* pNew = new SvxAutocorrWord( rShort, sLong, sal_False ); if( pAutocorr_List->Insert( pNew ) ) { - SotStorageRef xStor = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, TRUE ); + SotStorageRef xStor = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, sal_True ); MakeBlocklist_Imp( *xStor ); } else @@ -2638,18 +2662,18 @@ BOOL SvxAutoCorrectLanguageLists::PutText( const String& rShort, } // Delete an entry -BOOL SvxAutoCorrectLanguageLists::DeleteText( const String& rShort ) +sal_Bool SvxAutoCorrectLanguageLists::DeleteText( const String& rShort ) { // First get the current list! GetAutocorrWordList(); MakeUserStorage_Impl(); - SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, TRUE ); - BOOL bRet = xStg.Is() && SVSTREAM_OK == xStg->GetError(); + SotStorageRef xStg = new SotStorage( sUserAutoCorrFile, STREAM_READWRITE, sal_True ); + sal_Bool bRet = xStg.Is() && SVSTREAM_OK == xStg->GetError(); if( bRet ) { - USHORT nPos; + sal_uInt16 nPos; SvxAutocorrWord aTmp( rShort, rShort ); if( pAutocorr_List->Seek_Entry( &aTmp, &nPos ) ) { @@ -2674,7 +2698,7 @@ BOOL SvxAutoCorrectLanguageLists::DeleteText( const String& rShort ) xStg = 0; } else - bRet = FALSE; + bRet = sal_False; } return bRet; } diff --git a/editeng/source/misc/swafopt.cxx b/editeng/source/misc/swafopt.cxx index 9baae476f365..f92d06535b19 100644..100755 --- a/editeng/source/misc/swafopt.cxx +++ b/editeng/source/misc/swafopt.cxx @@ -53,14 +53,14 @@ SvxSwAutoFmtFlags::SvxSwAutoFmtFlags() bAFmtDelSpacesBetweenLines = bAFmtByInpDelSpacesAtSttEnd = bAFmtByInpDelSpacesBetweenLines = - bDummy = TRUE; + bDummy = sal_True; bReplaceStyles = bDelEmptyNode = bWithRedlining = bAutoCmpltEndless = bAutoCmpltAppendBlanc = - bAutoCmpltShowAsTip = FALSE; + bAutoCmpltShowAsTip = sal_False; bSetBorder = bCreateTable = @@ -69,10 +69,10 @@ SvxSwAutoFmtFlags::SvxSwAutoFmtFlags() bRightMargin = bAutoCompleteWords = bAutoCmpltCollectWords = - bAutoCmpltKeepList = TRUE; + bAutoCmpltKeepList = sal_True; bDummy6 = bDummy7 = bDummy8 = - FALSE; + sal_False; nRightMargin = 50; // dflt. 50 % nAutoCmpltExpandKey = KEY_RETURN; @@ -81,7 +81,7 @@ SvxSwAutoFmtFlags::SvxSwAutoFmtFlags() aBulletFont.SetFamily( FAMILY_DONTKNOW ); aBulletFont.SetPitch( PITCH_DONTKNOW ); aBulletFont.SetWeight( WEIGHT_DONTKNOW ); - aBulletFont.SetTransparent( TRUE ); + aBulletFont.SetTransparent( sal_True ); cBullet = 0x2022; cByInputBullet = cBullet; diff --git a/editeng/source/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx index e52a53f04170..a8361f4eb64d 100644 --- a/editeng/source/misc/txtrange.cxx +++ b/editeng/source/misc/txtrange.cxx @@ -38,13 +38,9 @@ #include <vector> -#ifdef WIN -#pragma optimize ( "", off ) -#endif - TextRanger::TextRanger( const basegfx::B2DPolyPolygon& rPolyPolygon, const basegfx::B2DPolyPolygon* pLinePolyPolygon, - USHORT nCacheSz, USHORT nLft, USHORT nRght, BOOL bSimpl, BOOL bInnr, - BOOL bVert ) : + sal_uInt16 nCacheSz, sal_uInt16 nLft, sal_uInt16 nRght, sal_Bool bSimpl, sal_Bool bInnr, + sal_Bool bVert ) : pBound( NULL ), nCacheSize( nCacheSz ), nCacheIdx( 0 ), @@ -58,7 +54,7 @@ TextRanger::TextRanger( const basegfx::B2DPolyPolygon& rPolyPolygon, const baseg bVertical( bVert ) { #ifdef DBG_UTIL - bFlag3 = bFlag4 = bFlag5 = bFlag6 = bFlag7 = FALSE; + bFlag3 = bFlag4 = bFlag5 = bFlag6 = bFlag7 = sal_False; #endif pRangeArr = new Range[ nCacheSize ]; pCache = new SvLongsPtr[ nCacheSize ]; @@ -90,13 +86,10 @@ TextRanger::TextRanger( const basegfx::B2DPolyPolygon& rPolyPolygon, const baseg mpLinePolyPolygon = NULL; } -#ifdef WIN -#pragma optimize ( "", on ) -#endif TextRanger::~TextRanger() { - for( USHORT i = 0; i < nCacheSize; ++i ) + for( sal_uInt16 i = 0; i < nCacheSize; ++i ) delete pCache[i]; delete[] pCache; delete[] pRangeArr; @@ -108,12 +101,12 @@ TextRanger::~TextRanger() If there's is a change in the writing direction, the cache has to be cleared. */ -void TextRanger::SetVertical( BOOL bNew ) +void TextRanger::SetVertical( sal_Bool bNew ) { if( IsVertical() != bNew ) { bVertical = bNew; - for( USHORT i = 0; i < nCacheSize; ++i ) + for( sal_uInt16 i = 0; i < nCacheSize; ++i ) delete pCache[i]; memset( pRangeArr, 0, nCacheSize * sizeof( Range ) ); memset( pCache, 0, nCacheSize * sizeof( SvLongsPtr ) ); @@ -135,17 +128,17 @@ class SvxBoundArgs long nLower; long nStart; long nEnd; - USHORT nCut; - USHORT nLast; - USHORT nNext; - BYTE nAct; - BYTE nFirst; - BOOL bClosed : 1; - BOOL bInner : 1; - BOOL bMultiple : 1; - BOOL bConcat : 1; - BOOL bRotate : 1; - void NoteRange( BOOL bToggle ); + sal_uInt16 nCut; + sal_uInt16 nLast; + 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; + void NoteRange( sal_Bool bToggle ); long Cut( long nY, const Point& rPt1, const Point& rPt2 ); void Add(); void _NoteFarPoint( long nPx, long nPyDiff, long nDiff ); @@ -160,17 +153,17 @@ public: void NotePoint( const long nA ) { NoteMargin( nA - nStart, nA + nEnd ); } void NoteMargin( const long nL, const long nR ) { if( nMin > nL ) nMin = nL; if( nMax < nR ) nMax = nR; } - USHORT Area( const Point& rPt ); - void NoteUpLow( long nA, const BYTE nArea ); + sal_uInt16 Area( const Point& rPt ); + void NoteUpLow( long nA, const sal_uInt8 nArea ); void Calc( const PolyPolygon& rPoly ); void Concat( const PolyPolygon* pPoly ); // inlines void NoteLast() { if( bMultiple ) NoteRange( nAct == nFirst ); } - void SetClosed( const BOOL bNew ){ bClosed = bNew; } - BOOL IsClosed() const { return bClosed; } - void SetConcat( const BOOL bNew ){ bConcat = bNew; } - BOOL IsConcat() const { return bConcat; } - BYTE GetAct() const { return nAct; } + 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; } + sal_uInt8 GetAct() const { return nAct; } }; SvxBoundArgs::SvxBoundArgs( TextRanger* pRanger, SvLongs *pLong, @@ -178,7 +171,7 @@ SvxBoundArgs::SvxBoundArgs( TextRanger* pRanger, SvLongs *pLong, : pLongArr( pLong ), pTextRanger( pRanger ), nTop( rRange.Min() ), nBottom( rRange.Max() ), bInner( pRanger->IsInner() ), bMultiple( bInner || !pRanger->IsSimple() ), - bConcat( FALSE ), bRotate( pRanger->IsVertical() ) + bConcat( sal_False ), bRotate( pRanger->IsVertical() ) { if( bRotate ) { @@ -215,7 +208,7 @@ long SvxBoundArgs::CalcMax( const Point& rPt1, const Point& rPt2, nB += nDa * nDa; nB = nRange + nDa * ( nFarRange - nRange ) / sqrt( nB ); - BOOL bNote; + sal_Bool bNote; if( nB < B(rPt2) ) bNote = nB > B(rPt1); else @@ -261,29 +254,29 @@ void SvxBoundArgs::_NoteFarPoint( long nPa, long nPbDiff, long nDiff ) NoteMargin( nTmpA, nPbDiff ); } -void SvxBoundArgs::NoteRange( BOOL bToggle ) +void SvxBoundArgs::NoteRange( sal_Bool bToggle ) { DBG_ASSERT( nMax >= nMin || bInner, "NoteRange: Min > Max?"); if( nMax < nMin ) return; if( !bClosed ) - bToggle = FALSE; - USHORT nIdx = 0; - USHORT nCount = pLongArr->Count(); + bToggle = sal_False; + sal_uInt16 nIdx = 0; + sal_uInt16 nCount = pLongArr->Count(); DBG_ASSERT( nCount == 2 * aBoolArr.size(), "NoteRange: Incompatible Sizes" ); while( nIdx < nCount && (*pLongArr)[ nIdx ] < nMin ) ++nIdx; - BOOL bOdd = nIdx % 2 ? TRUE : FALSE; + sal_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 ... pLongArr->Insert( nMin, nIdx ); pLongArr->Insert( nMax, nIdx + 1 ); - aBoolArr.insert( aBoolArr.begin() + (nIdx/2), bToggle ); + aBoolArr.insert( aBoolArr.begin() + nIdx / 2, bToggle ); } else { // expand an existing interval ... - USHORT nMaxIdx = nIdx; + sal_uInt16 nMaxIdx = nIdx; // If we end up on a left interval boundary, it must be reduced to nMin. if( bOdd ) --nIdx; @@ -300,27 +293,27 @@ void SvxBoundArgs::NoteRange( BOOL bToggle ) if( nMaxIdx % 2 ) (*pLongArr)[ nMaxIdx-- ] = nMax; // Possible merge of intervals. - USHORT nDiff = nMaxIdx - nIdx; + sal_uInt16 nDiff = nMaxIdx - nIdx; nMaxIdx = nIdx / 2; // From here on is nMaxIdx the Index in BoolArray. if( nDiff ) { (*pLongArr).Remove( nIdx + 1, nDiff ); nDiff /= 2; - USHORT nStop = nMaxIdx + nDiff; - for( USHORT i = nMaxIdx; i < nStop; ++i ) + sal_uInt16 nStop = nMaxIdx + nDiff; + for( sal_uInt16 i = nMaxIdx; i < nStop; ++i ) bToggle ^= aBoolArr[ i ]; - aBoolArr.erase(aBoolArr.begin() + nMaxIdx, aBoolArr.begin() + nMaxIdx + nDiff); + aBoolArr.erase( aBoolArr.begin() + nMaxIdx, aBoolArr.begin() + (nMaxIdx + nDiff) ); } DBG_ASSERT( nMaxIdx < aBoolArr.size(), "NoteRange: Too much deleted" ); - aBoolArr[ nMaxIdx ] = aBoolArr[ nMaxIdx ] ^ bToggle; + aBoolArr[ nMaxIdx ] ^= bToggle; } } void SvxBoundArgs::Calc( const PolyPolygon& rPoly ) { - USHORT nCount; + sal_uInt16 nCount; nAct = 0; - for( USHORT i = 0; i < rPoly.Count(); ++i ) + for( sal_uInt16 i = 0; i < rPoly.Count(); ++i ) { const Polygon& rPol = rPoly[ i ]; nCount = rPol.GetSize(); @@ -366,8 +359,8 @@ void SvxBoundArgs::Calc( const PolyPolygon& rPoly ) } if( nCount > 1 ) { - USHORT nIdx = 1; - while( TRUE ) + sal_uInt16 nIdx = 1; + while( sal_True ) { const Point& rLast = rPol[ nIdx - 1 ]; if( nIdx == nCount ) @@ -375,7 +368,7 @@ void SvxBoundArgs::Calc( const PolyPolygon& rPoly ) const Point& rNext = rPol[ nIdx ]; nNext = Area( rNext ); nCut = nNext ^ nLast; - USHORT nOldAct = nAct; + sal_uInt16 nOldAct = nAct; if( nAct ) CheckCut( rLast, rNext ); if( nCut & 4 ) @@ -455,18 +448,18 @@ void SvxBoundArgs::Calc( const PolyPolygon& rPoly ) void SvxBoundArgs::Add() { - ULONG nLongIdx = 1; - ULONG nCount = aBoolArr.size(); + sal_uInt16 nLongIdx = 1; + size_t nCount = aBoolArr.size(); if( nCount && ( !bInner || !pTextRanger->IsSimple() ) ) { - BOOL bDelete = aBoolArr[ 0 ]; + sal_Bool bDelete = aBoolArr.front(); if( bInner ) bDelete = !bDelete; - for( ULONG nBoolIdx = 1; nBoolIdx < nCount; ++nBoolIdx ) + for( size_t nBoolIdx = 1; nBoolIdx < nCount; ++nBoolIdx ) { if( bDelete ) { - ULONG next = 2; + sal_uInt16 next = 2; while( nBoolIdx < nCount && !aBoolArr[ nBoolIdx++ ] && (!bInner || nBoolIdx < nCount ) ) next += 2; @@ -474,9 +467,9 @@ void SvxBoundArgs::Add() next /= 2; nBoolIdx = nBoolIdx - next; nCount = nCount - next; - aBoolArr.erase( aBoolArr.begin() + nBoolIdx, aBoolArr.begin() + nBoolIdx + next ); + aBoolArr.erase( aBoolArr.begin() + nBoolIdx, aBoolArr.begin() + (nBoolIdx + next) ); if( nBoolIdx ) - aBoolArr[ nBoolIdx - 1 ] = FALSE; + aBoolArr[ nBoolIdx - 1 ] = sal_False; #if OSL_DEBUG_LEVEL > 1 else ++next; @@ -509,20 +502,20 @@ void SvxBoundArgs::Add() void SvxBoundArgs::Concat( const PolyPolygon* pPoly ) { - SetConcat( TRUE ); + SetConcat( sal_True ); DBG_ASSERT( pPoly, "Nothing to do?" ); SvLongs *pOld = pLongArr; pLongArr = new SvLongs( 2, 8 ); aBoolArr.clear(); - bInner = FALSE; + bInner = sal_False; Calc( *pPoly ); - USHORT nCount = pLongArr->Count(); - USHORT nIdx = 0; - USHORT i = 0; - BOOL bSubtract = pTextRanger->IsInner(); + sal_uInt16 nCount = pLongArr->Count(); + sal_uInt16 nIdx = 0; + sal_uInt16 i = 0; + sal_Bool bSubtract = pTextRanger->IsInner(); while( i < nCount ) { - USHORT nOldCount = pOld->Count(); + sal_uInt16 nOldCount = pOld->Count(); if( nIdx == nOldCount ) { // Reached the end of the old Array... if( !bSubtract ) @@ -531,7 +524,7 @@ void SvxBoundArgs::Concat( const PolyPolygon* pPoly ) } long nLeft = (*pLongArr)[ i++ ]; long nRight = (*pLongArr)[ i++ ]; - USHORT nLeftPos = nIdx + 1; + sal_uInt16 nLeftPos = nIdx + 1; while( nLeftPos < nOldCount && nLeft > (*pOld)[ nLeftPos ] ) nLeftPos += 2; if( nLeftPos >= nOldCount ) @@ -540,7 +533,7 @@ void SvxBoundArgs::Concat( const PolyPolygon* pPoly ) pOld->Insert( pLongArr, nOldCount, i - 2, USHRT_MAX ); break; } - USHORT nRightPos = nLeftPos - 1; + sal_uInt16 nRightPos = nLeftPos - 1; while( nRightPos < nOldCount && nRight >= (*pOld)[ nRightPos ] ) nRightPos += 2; if( nRightPos < nLeftPos ) @@ -593,7 +586,7 @@ void SvxBoundArgs::Concat( const PolyPolygon* pPoly ) *10 = above the lower edge *************************************************************************/ -USHORT SvxBoundArgs::Area( const Point& rPt ) +sal_uInt16 SvxBoundArgs::Area( const Point& rPt ) { long nB = B( rPt ); if( nB >= nBottom ) @@ -633,7 +626,7 @@ long SvxBoundArgs::Cut( long nB, const Point& rPt1, const Point& rPt2 ) return long( rPt1.X() + nQuot ); } -void SvxBoundArgs::NoteUpLow( long nA, const BYTE nArea ) +void SvxBoundArgs::NoteUpLow( long nA, const sal_uInt8 nArea ) { if( nAct ) { @@ -657,7 +650,7 @@ void SvxBoundArgs::NoteUpLow( long nA, const BYTE nArea ) SvLongsPtr TextRanger::GetTextRanges( const Range& rRange ) { DBG_ASSERT( rRange.Min() || rRange.Max(), "Zero-Range not allowed, Bye Bye" ); - USHORT nIndex = 0; + sal_uInt16 nIndex = 0; while( nIndex < nCacheSize && rRange != pRangeArr[ nIndex ] ) ++nIndex; if( nIndex >= nCacheSize ) diff --git a/editeng/source/misc/unolingu.cxx b/editeng/source/misc/unolingu.cxx index 3a2f8720a8b0..0302c7c930dd 100644 --- a/editeng/source/misc/unolingu.cxx +++ b/editeng/source/misc/unolingu.cxx @@ -93,12 +93,12 @@ static uno::Reference< XLinguServiceManager > GetLngSvcMgr_Impl() return xRes; } -BOOL lcl_FindEntry( const OUString &rEntry, const Sequence< OUString > &rCfgSvcs ) +sal_Bool lcl_FindEntry( const OUString &rEntry, const Sequence< OUString > &rCfgSvcs ) { - INT32 nRes = -1; - INT32 nEntries = rCfgSvcs.getLength(); + sal_Int32 nRes = -1; + sal_Int32 nEntries = rCfgSvcs.getLength(); const OUString *pEntry = rCfgSvcs.getConstArray(); - for (INT32 i = 0; i < nEntries && nRes == -1; ++i) + for (sal_Int32 i = 0; i < nEntries && nRes == -1; ++i) { if (rEntry == pEntry[i]) nRes = i; @@ -113,11 +113,11 @@ Sequence< OUString > lcl_RemoveMissingEntries( { Sequence< OUString > aRes( rCfgSvcs.getLength() ); OUString *pRes = aRes.getArray(); - INT32 nCnt = 0; + sal_Int32 nCnt = 0; - INT32 nEntries = rCfgSvcs.getLength(); + sal_Int32 nEntries = rCfgSvcs.getLength(); const OUString *pEntry = rCfgSvcs.getConstArray(); - for (INT32 i = 0; i < nEntries; ++i) + for (sal_Int32 i = 0; i < nEntries; ++i) { if (pEntry[i].getLength() && lcl_FindEntry( pEntry[i], rAvailSvcs )) pRes[ nCnt++ ] = pEntry[i]; @@ -139,7 +139,7 @@ Sequence< OUString > lcl_GetLastFoundSvcs( SvxLocaleToLanguage( rAvailLocale ) ) ); Sequence< OUString > aNodeNames( rCfg.GetNodeNames(rLastFoundList) ); - BOOL bFound = lcl_FindEntry( aCfgLocaleStr, aNodeNames); + sal_Bool bFound = lcl_FindEntry( aCfgLocaleStr, aNodeNames); if (bFound) { @@ -174,13 +174,13 @@ Sequence< OUString > lcl_GetNewEntries( const Sequence< OUString > &rLastFoundSvcs, const Sequence< OUString > &rAvailSvcs ) { - INT32 nLen = rAvailSvcs.getLength(); + sal_Int32 nLen = rAvailSvcs.getLength(); Sequence< OUString > aRes( nLen ); OUString *pRes = aRes.getArray(); - INT32 nCnt = 0; + sal_Int32 nCnt = 0; const OUString *pEntry = rAvailSvcs.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { if (pEntry[i].getLength() && !lcl_FindEntry( pEntry[i], rLastFoundSvcs )) pRes[ nCnt++ ] = pEntry[i]; @@ -197,17 +197,17 @@ Sequence< OUString > lcl_MergeSeq( { Sequence< OUString > aRes( rCfgSvcs.getLength() + rNewSvcs.getLength() ); OUString *pRes = aRes.getArray(); - INT32 nCnt = 0; + sal_Int32 nCnt = 0; - for (INT32 k = 0; k < 2; ++k) + for (sal_Int32 k = 0; k < 2; ++k) { // add previously configuerd service first and append // new found services at the end const Sequence< OUString > &rSeq = k == 0 ? rCfgSvcs : rNewSvcs; - INT32 nLen = rSeq.getLength(); + sal_Int32 nLen = rSeq.getLength(); const OUString *pEntry = rSeq.getConstArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { if (pEntry[i].getLength() && !lcl_FindEntry( pEntry[i], aRes )) pRes[ nCnt++ ] = pEntry[i]; @@ -218,8 +218,8 @@ Sequence< OUString > lcl_MergeSeq( return aRes; } -INT16 SvxLinguConfigUpdate::nNeedUpdating = -1; -INT32 SvxLinguConfigUpdate::nCurrentDataFilesChangedCheckValue = -1; +sal_Int16 SvxLinguConfigUpdate::nNeedUpdating = -1; +sal_Int32 SvxLinguConfigUpdate::nCurrentDataFilesChangedCheckValue = -1; void SvxLinguConfigUpdate::UpdateAll( sal_Bool bForceCheck ) { @@ -259,13 +259,13 @@ void SvxLinguConfigUpdate::UpdateAll( sal_Bool bForceCheck ) OUString aService( ::rtl::OUString::createFromAscii( apServices[k] ) ); OUString aActiveList( ::rtl::OUString::createFromAscii( apCurLists[k] ) ); OUString aLastFoundList( ::rtl::OUString::createFromAscii( apLastFoundLists[k] ) ); - INT32 i; + sal_Int32 i; // // remove configured but not available language/services entries // Sequence< OUString > aNodeNames( aCfg.GetNodeNames( aActiveList ) ); // list of configured locales - INT32 nNodeNames = aNodeNames.getLength(); + sal_Int32 nNodeNames = aNodeNames.getLength(); const OUString *pNodeName = aNodeNames.getConstArray(); for (i = 0; i < nNodeNames; ++i) { @@ -290,7 +290,7 @@ void SvxLinguConfigUpdate::UpdateAll( sal_Bool bForceCheck ) // uno::Reference< XAvailableLocales > xAvail( xLngSvcMgr, UNO_QUERY ); Sequence< Locale > aAvailLocales( xAvail->getAvailableLocales(aService) ); - INT32 nAvailLocales = aAvailLocales.getLength(); + sal_Int32 nAvailLocales = aAvailLocales.getLength(); const Locale *pAvailLocale = aAvailLocales.getConstArray(); for (i = 0; i < nAvailLocales; ++i) { @@ -334,9 +334,9 @@ void SvxLinguConfigUpdate::UpdateAll( sal_Bool bForceCheck ) xLngSvcMgr->getAvailableServices( aService, pAvailLocale[i] ) ); #if OSL_DEBUG_LEVEL > 1 - INT32 nSvcs = aSvcImplNames.getLength(); + sal_Int32 nSvcs = aSvcImplNames.getLength(); const OUString *pSvcImplName = aSvcImplNames.getConstArray(); - for (INT32 j = 0; j < nSvcs; ++j) + for (sal_Int32 j = 0; j < nSvcs; ++j) { OUString aImplName( pSvcImplName[j] ); } @@ -371,9 +371,9 @@ void SvxLinguConfigUpdate::UpdateAll( sal_Bool bForceCheck ) #if OSL_DEBUG_LEVEL > 1 Sequence< OUString > aSvcImplNames( (*aIt).second ); - INT32 nSvcs = aSvcImplNames.getLength(); + sal_Int32 nSvcs = aSvcImplNames.getLength(); const OUString *pSvcImplName = aSvcImplNames.getConstArray(); - for (INT32 j = 0; j < nSvcs; ++j) + for (sal_Int32 j = 0; j < nSvcs; ++j) { OUString aImplName( pSvcImplName[j] ); } @@ -389,7 +389,7 @@ void SvxLinguConfigUpdate::UpdateAll( sal_Bool bForceCheck ) { RTL_LOGFILE_CONTEXT( aLog, "svx: SvxLinguConfigUpdate::UpdateAll - ReplaceSetProperties" ); // add new or replace existing entries. - BOOL bRes = aCfg.ReplaceSetProperties( aSubNodeName, aNewValues ); + sal_Bool bRes = aCfg.ReplaceSetProperties( aSubNodeName, aNewValues ); if (!bRes) { #if OSL_DEBUG_LEVEL > 1 @@ -411,7 +411,7 @@ void SvxLinguConfigUpdate::UpdateAll( sal_Bool bForceCheck ) // not be too troublesome. // In OOo 3.0 we will not need the respective code anymore at all. // aAny <<= nCurrentDataFilesChangedCheckValue; - aAny <<= (INT32) -1; // keep the value set to 'need to check' + aAny <<= (sal_Int32) -1; // keep the value set to 'need to check' aCfg.SetProperty( A2OU( "DataFilesChangedCheckValue" ), aAny ); @@ -428,17 +428,17 @@ void SvxLinguConfigUpdate::UpdateAll( sal_Bool bForceCheck ) } -INT32 SvxLinguConfigUpdate::CalcDataFilesChangedCheckValue() +sal_Int32 SvxLinguConfigUpdate::CalcDataFilesChangedCheckValue() { RTL_LOGFILE_CONTEXT( aLog, "svx: SvxLinguConfigUpdate::CalcDataFilesChangedCheckValue" ); - INT32 nHashVal = 0; + sal_Int32 nHashVal = 0; // nothing to be checked anymore since those old directory paths are gone by now return nHashVal; } -BOOL SvxLinguConfigUpdate::IsNeedUpdateAll( sal_Bool bForceCheck ) +sal_Bool SvxLinguConfigUpdate::IsNeedUpdateAll( sal_Bool bForceCheck ) { RTL_LOGFILE_CONTEXT( aLog, "svx: SvxLinguConfigUpdate::IsNeedUpdateAll" ); if (nNeedUpdating == -1 || bForceCheck ) // need to check if updating is necessary @@ -513,10 +513,10 @@ void ThesDummy_Impl::GetCfgLocales() String aNode( A2OU( "ServiceManager/ThesaurusList" ) ); Sequence < OUString > aNodeNames( aCfg.GetNodeNames( aNode ) ); const OUString *pNodeNames = aNodeNames.getConstArray(); - INT32 nLen = aNodeNames.getLength(); + sal_Int32 nLen = aNodeNames.getLength(); pLocaleSeq = new Sequence< Locale >( nLen ); Locale *pLocale = pLocaleSeq->getArray(); - for (INT32 i = 0; i < nLen; ++i) + for (sal_Int32 i = 0; i < nLen; ++i) { pLocale[i] = SvxCreateLocale( MsLangId::convertIsoStringToLanguage( pNodeNames[i] ) ); @@ -571,8 +571,8 @@ sal_Bool SAL_CALL else if (!pLocaleSeq) // if not already loaded save startup time by avoiding loading them now GetCfgLocales(); GetCfgLocales(); - BOOL bFound = FALSE; - INT32 nLen = pLocaleSeq->getLength(); + sal_Bool bFound = sal_False; + sal_Int32 nLen = pLocaleSeq->getLength(); const Locale *pLocale = pLocaleSeq->getConstArray(); const Locale *pEnd = pLocale + nLen; for ( ; pLocale < pEnd && !bFound; ++pLocale) @@ -669,7 +669,7 @@ sal_Bool SAL_CALL throw(uno::RuntimeException) { GetSpell_Impl(); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (xSpell.is()) bRes = xSpell->hasLanguage( nLanguage ); return bRes; @@ -683,7 +683,7 @@ sal_Bool SAL_CALL uno::RuntimeException) { GetSpell_Impl(); - BOOL bRes = TRUE; + sal_Bool bRes = sal_True; if (xSpell.is()) bRes = xSpell->isValid( rWord, nLanguage, rProperties ); return bRes; @@ -785,7 +785,7 @@ sal_Bool SAL_CALL throw(uno::RuntimeException) { GetHyph_Impl(); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if (xHyph.is()) bRes = xHyph->hasLocale( rLocale ); return bRes; @@ -1215,32 +1215,32 @@ SvxAlternativeSpelling SvxGetAltSpelling( { OUString aWord( rHyphWord->getWord() ), aAltWord( rHyphWord->getHyphenatedWord() ); - INT16 nHyphenationPos = rHyphWord->getHyphenationPos(), + sal_Int16 nHyphenationPos = rHyphWord->getHyphenationPos(), nHyphenPos = rHyphWord->getHyphenPos(); - INT16 nLen = (INT16)aWord.getLength(); - INT16 nAltLen = (INT16)aAltWord.getLength(); + sal_Int16 nLen = (sal_Int16)aWord.getLength(); + sal_Int16 nAltLen = (sal_Int16)aAltWord.getLength(); const sal_Unicode *pWord = aWord.getStr(), *pAltWord = aAltWord.getStr(); // count number of chars from the left to the // hyphenation pos / hyphen pos that are equal - INT16 nL = 0; + sal_Int16 nL = 0; while (nL <= nHyphenationPos && nL <= nHyphenPos && pWord[ nL ] == pAltWord[ nL ]) ++nL; // count number of chars from the right to the // hyphenation pos / hyphen pos that are equal - INT16 nR = 0; - INT32 nIdx = nLen - 1; - INT32 nAltIdx = nAltLen - 1; + sal_Int16 nR = 0; + sal_Int32 nIdx = nLen - 1; + sal_Int32 nAltIdx = nAltLen - 1; while (nIdx > nHyphenationPos && nAltIdx > nHyphenPos && pWord[ nIdx-- ] == pAltWord[ nAltIdx-- ]) ++nR; aRes.aReplacement = OUString( aAltWord.copy( nL, nAltLen - nL - nR ) ); - aRes.nChangedPos = (INT16) nL; + aRes.nChangedPos = (sal_Int16) nL; aRes.nChangedLength = nLen - nL - nR; - aRes.bIsAltSpelling = TRUE; + aRes.bIsAltSpelling = sal_True; aRes.xHyphWord = rHyphWord; } return aRes; diff --git a/editeng/source/outliner/makefile.mk b/editeng/source/outliner/makefile.mk deleted file mode 100644 index df1c795801ae..000000000000 --- a/editeng/source/outliner/makefile.mk +++ /dev/null @@ -1,60 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=editeng -TARGET=outliner -AUTOSEG=true -ENABLE_EXCEPTIONS=TRUE - -PROJECTPCH4DLL=TRUE -PROJECTPCH=outl_pch -PROJECTPCHSOURCE=outl_pch - - -# --- Settings ----------------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Allgemein ---------------------------------------------------------- - -SLOFILES= \ - $(SLO)$/outlundo.obj \ - $(SLO)$/outliner.obj \ - $(SLO)$/outlin2.obj \ - $(SLO)$/paralist.obj \ - $(SLO)$/outlvw.obj \ - $(SLO)$/outleeng.obj \ - $(SLO)$/outlobj.obj - -SRS1NAME=$(TARGET) -SRC1FILES= outliner.src - -.INCLUDE : target.mk - diff --git a/editeng/source/outliner/outl_pch.cxx b/editeng/source/outliner/outl_pch.cxx index 22522eb0369d..22522eb0369d 100644..100755 --- a/editeng/source/outliner/outl_pch.cxx +++ b/editeng/source/outliner/outl_pch.cxx diff --git a/editeng/source/outliner/outl_pch.hxx b/editeng/source/outliner/outl_pch.hxx index 06f1f29760a7..06f1f29760a7 100644..100755 --- a/editeng/source/outliner/outl_pch.hxx +++ b/editeng/source/outliner/outl_pch.hxx diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx index 751c7f2e32a4..1e49a67a027e 100644 --- a/editeng/source/outliner/outleeng.cxx +++ b/editeng/source/outliner/outleeng.cxx @@ -56,7 +56,7 @@ OutlinerEditEng::~OutlinerEditEng() { } -void OutlinerEditEng::PaintingFirstLine( USHORT nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev ) +void OutlinerEditEng::PaintingFirstLine( sal_uInt16 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev ) { if( GetControlWord() && EE_CNTRL_OUTLINER ) { @@ -67,7 +67,7 @@ void OutlinerEditEng::PaintingFirstLine( USHORT nPara, const Point& rStartPos, l pOwner->PaintBullet( nPara, rStartPos, rOrigin, nOrientation, pOutDev ); } -const SvxNumberFormat* OutlinerEditEng::GetNumberFormat( USHORT nPara ) const +const SvxNumberFormat* OutlinerEditEng::GetNumberFormat( sal_uInt16 nPara ) const { const SvxNumberFormat* pFmt = NULL; if (pOwner) @@ -76,32 +76,32 @@ const SvxNumberFormat* OutlinerEditEng::GetNumberFormat( USHORT nPara ) const } -Rectangle OutlinerEditEng::GetBulletArea( USHORT nPara ) +Rectangle OutlinerEditEng::GetBulletArea( sal_uInt16 nPara ) { Rectangle aBulletArea = Rectangle( Point(), Point() ); if ( nPara < pOwner->pParaList->GetParagraphCount() ) { if ( pOwner->ImplHasBullet( nPara ) ) - aBulletArea = pOwner->ImpCalcBulletArea( nPara, FALSE, FALSE ); + aBulletArea = pOwner->ImpCalcBulletArea( nPara, sal_False, sal_False ); } return aBulletArea; } -void OutlinerEditEng::ParagraphInserted( USHORT nNewParagraph ) +void OutlinerEditEng::ParagraphInserted( sal_uInt16 nNewParagraph ) { pOwner->ParagraphInserted( nNewParagraph ); EditEngine::ParagraphInserted( nNewParagraph ); } -void OutlinerEditEng::ParagraphDeleted( USHORT nDeletedParagraph ) +void OutlinerEditEng::ParagraphDeleted( sal_uInt16 nDeletedParagraph ) { pOwner->ParagraphDeleted( nDeletedParagraph ); EditEngine::ParagraphDeleted( nDeletedParagraph ); } -void OutlinerEditEng::ParagraphConnected( USHORT /*nLeftParagraph*/, USHORT nRightParagraph ) +void OutlinerEditEng::ParagraphConnected( sal_uInt16 /*nLeftParagraph*/, sal_uInt16 nRightParagraph ) { if( pOwner && pOwner->IsUndoEnabled() && !const_cast<EditEngine&>(pOwner->GetEditEngine()).IsInUndo() ) { @@ -119,22 +119,22 @@ void OutlinerEditEng::StyleSheetChanged( SfxStyleSheet* pStyle ) pOwner->StyleSheetChanged( pStyle ); } -void OutlinerEditEng::ParaAttribsChanged( USHORT nPara ) +void OutlinerEditEng::ParaAttribsChanged( sal_uInt16 nPara ) { pOwner->ParaAttribsChanged( nPara ); } -BOOL OutlinerEditEng::SpellNextDocument() +sal_Bool OutlinerEditEng::SpellNextDocument() { return pOwner->SpellNextDocument(); } -BOOL OutlinerEditEng::ConvertNextDocument() +sal_Bool OutlinerEditEng::ConvertNextDocument() { return pOwner->ConvertNextDocument(); } -XubString OutlinerEditEng::GetUndoComment( USHORT nUndoId ) const +XubString OutlinerEditEng::GetUndoComment( sal_uInt16 nUndoId ) const { switch( nUndoId ) { @@ -158,8 +158,8 @@ XubString OutlinerEditEng::GetUndoComment( USHORT nUndoId ) const } } -void OutlinerEditEng::DrawingText( const Point& rStartPos, const XubString& rText, USHORT nTextStart, USHORT nTextLen, - const sal_Int32* pDXArray, const SvxFont& rFont, USHORT nPara, USHORT nIndex, BYTE nRightToLeft, +void OutlinerEditEng::DrawingText( const Point& rStartPos, const XubString& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen, + const sal_Int32* pDXArray, const SvxFont& rFont, sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt8 nRightToLeft, const EEngineData::WrongSpellVector* pWrongSpellVector, const SvxFieldData* pFieldData, bool bEndOfLine, @@ -174,7 +174,7 @@ void OutlinerEditEng::DrawingText( const Point& rStartPos, const XubString& rTex } void OutlinerEditEng::DrawingTab( const Point& rStartPos, long nWidth, const String& rChar, - const SvxFont& rFont, USHORT nPara, xub_StrLen nIndex, BYTE nRightToLeft, + const SvxFont& rFont, sal_uInt16 nPara, xub_StrLen nIndex, sal_uInt8 nRightToLeft, bool bEndOfLine, bool bEndOfParagraph, const Color& rOverlineColor, const Color& rTextLineColor) { @@ -182,23 +182,23 @@ void OutlinerEditEng::DrawingTab( const Point& rStartPos, long nWidth, const Str bEndOfLine, bEndOfParagraph, rOverlineColor, rTextLineColor ); } -void OutlinerEditEng::FieldClicked( const SvxFieldItem& rField, USHORT nPara, USHORT nPos ) +void OutlinerEditEng::FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos ) { EditEngine::FieldClicked( rField, nPara, nPos ); // If URL pOwner->FieldClicked( rField, nPara, nPos ); } -void OutlinerEditEng::FieldSelected( const SvxFieldItem& rField, USHORT nPara, USHORT nPos ) +void OutlinerEditEng::FieldSelected( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos ) { pOwner->FieldSelected( rField, nPara, nPos ); } -XubString OutlinerEditEng::CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor ) +XubString OutlinerEditEng::CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ) { return pOwner->CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor ); } -void OutlinerEditEng::SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) +void OutlinerEditEng::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ) { Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); if( pPara ) @@ -206,13 +206,13 @@ void OutlinerEditEng::SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) if ( !IsInUndo() && IsUndoEnabled() ) pOwner->UndoActionStart( OLUNDO_ATTR ); - EditEngine::SetParaAttribs( (USHORT)nPara, rSet ); + EditEngine::SetParaAttribs( (sal_uInt16)nPara, rSet ); - pOwner->ImplCheckNumBulletItem( (USHORT)nPara ); + pOwner->ImplCheckNumBulletItem( (sal_uInt16)nPara ); // #i100014# // It is not a good idea to substract 1 from a count and cast the result // to USHORT without check, if the count is 0. - pOwner->ImplCheckParagraphs( (USHORT)nPara, (USHORT) (pOwner->pParaList->GetParagraphCount()) ); + pOwner->ImplCheckParagraphs( (sal_uInt16)nPara, (sal_uInt16) (pOwner->pParaList->GetParagraphCount()) ); if ( !IsInUndo() && IsUndoEnabled() ) pOwner->UndoActionEnd( OLUNDO_ATTR ); diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx index 085aadc12b97..63ee538e2e42 100644..100755 --- a/editeng/source/outliner/outleeng.hxx +++ b/editeng/source/outliner/outleeng.hxx @@ -42,21 +42,21 @@ protected: // derived from EditEngine. Allows Outliner objetcs to provide // bullet access to the EditEngine. - virtual const SvxNumberFormat* GetNumberFormat( USHORT nPara ) const; + virtual const SvxNumberFormat* GetNumberFormat( sal_uInt16 nPara ) const; public: OutlinerEditEng( Outliner* pOwner, SfxItemPool* pPool ); ~OutlinerEditEng(); - virtual void PaintingFirstLine( USHORT nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev ); + virtual void PaintingFirstLine( sal_uInt16 nPara, const Point& rStartPos, long nBaseLineY, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev ); - virtual void ParagraphInserted( USHORT nNewParagraph ); - virtual void ParagraphDeleted( USHORT nDeletedParagraph ); - virtual void ParagraphConnected( USHORT nLeftParagraph, USHORT nRightParagraph ); + virtual void ParagraphInserted( sal_uInt16 nNewParagraph ); + virtual void ParagraphDeleted( sal_uInt16 nDeletedParagraph ); + virtual void ParagraphConnected( sal_uInt16 nLeftParagraph, sal_uInt16 nRightParagraph ); virtual void DrawingText( - const Point& rStartPos, const XubString& rText, USHORT nTextStart, USHORT nTextLen, const sal_Int32* pDXArray, const SvxFont& rFont, - USHORT nPara, USHORT nIndex, BYTE nRightToLeft, + const Point& rStartPos, const XubString& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen, const sal_Int32* pDXArray, const SvxFont& rFont, + sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt8 nRightToLeft, const EEngineData::WrongSpellVector* pWrongSpellVector, const SvxFieldData* pFieldData, bool bEndOfLine, @@ -75,20 +75,20 @@ public: const Color& rTextLineColor); virtual void StyleSheetChanged( SfxStyleSheet* pStyle ); - virtual void ParaAttribsChanged( USHORT nPara ); - virtual BOOL SpellNextDocument(); - virtual XubString GetUndoComment( USHORT nUndoId ) const; + virtual void ParaAttribsChanged( sal_uInt16 nPara ); + virtual sal_Bool SpellNextDocument(); + virtual XubString GetUndoComment( sal_uInt16 nUndoId ) const; // for text conversion - virtual BOOL ConvertNextDocument(); + virtual sal_Bool ConvertNextDocument(); - virtual void FieldClicked( const SvxFieldItem& rField, USHORT nPara, USHORT nPos ); - virtual void FieldSelected( const SvxFieldItem& rField, USHORT nPara, USHORT nPos ); - virtual XubString CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rTxtColor, Color*& rFldColor ); + virtual void FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos ); + virtual void FieldSelected( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos ); + virtual XubString CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rTxtColor, Color*& rFldColor ); - virtual Rectangle GetBulletArea( USHORT nPara ); + virtual Rectangle GetBulletArea( sal_uInt16 nPara ); - virtual void SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ); + virtual void SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ); // belongs into class Outliner, move there before incompatible update! Link aOutlinerNotifyHdl; diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx index 96d92e6bcf83..ede47dc2b6e1 100644..100755 --- a/editeng/source/outliner/outlin2.cxx +++ b/editeng/source/outliner/outlin2.cxx @@ -60,14 +60,14 @@ using namespace ::com::sun::star::linguistic2; // ====================== Simple pass-through ======================= // ====================================================================== -void Outliner::SetUpdateMode( BOOL bUpdate ) +void Outliner::SetUpdateMode( sal_Bool bUpdate ) { DBG_CHKTHIS(Outliner,0); pEditEngine->SetUpdateMode( bUpdate ); } -BOOL Outliner::GetUpdateMode() const +sal_Bool Outliner::GetUpdateMode() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->GetUpdateMode(); @@ -79,13 +79,13 @@ const SfxItemSet& Outliner::GetEmptyItemSet() const return pEditEngine->GetEmptyItemSet(); } -void Outliner::EnableUndo( BOOL bEnable ) +void Outliner::EnableUndo( sal_Bool bEnable ) { DBG_CHKTHIS(Outliner,0); pEditEngine->EnableUndo( bEnable ); } -BOOL Outliner::IsUndoEnabled() const +sal_Bool Outliner::IsUndoEnabled() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->IsUndoEnabled(); @@ -122,13 +122,13 @@ void Outliner::ClearModifyFlag() pEditEngine->ClearModifyFlag(); } -BOOL Outliner::IsModified() const +sal_Bool Outliner::IsModified() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->IsModified(); } -ULONG Outliner::GetTextHeight() const +sal_uLong Outliner::GetTextHeight() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->GetTextHeight(); @@ -176,31 +176,31 @@ Link Outliner::GetStatusEventHdl() const return pEditEngine->GetStatusEventHdl(); } -void Outliner::SetDefTab( USHORT nTab ) +void Outliner::SetDefTab( sal_uInt16 nTab ) { DBG_CHKTHIS(Outliner,0); pEditEngine->SetDefTab( nTab ); } -USHORT Outliner::GetDefTab() const +sal_uInt16 Outliner::GetDefTab() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->GetDefTab(); } -BOOL Outliner::IsFlatMode() const +sal_Bool Outliner::IsFlatMode() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->IsFlatMode(); } -BOOL Outliner::UpdateFields() +sal_Bool Outliner::UpdateFields() { DBG_CHKTHIS(Outliner,0); return pEditEngine->UpdateFields(); } -void Outliner::RemoveFields( BOOL bKeepFieldText, TypeId aType ) +void Outliner::RemoveFields( sal_Bool bKeepFieldText, TypeId aType ) { DBG_CHKTHIS(Outliner,0); pEditEngine->RemoveFields( bKeepFieldText, aType ); @@ -218,7 +218,7 @@ String Outliner::GetWordDelimiters() const return pEditEngine->GetWordDelimiters(); } -String Outliner::GetWord( USHORT nPara, USHORT nIndex ) +String Outliner::GetWord( sal_uInt16 nPara, sal_uInt16 nIndex ) { DBG_CHKTHIS(Outliner,0); return pEditEngine->GetWord( nPara, nIndex ); @@ -303,7 +303,7 @@ void Outliner::SetMaxAutoPaperSize( const Size& rSz ) pEditEngine->SetMaxAutoPaperSize( rSz ); } -BOOL Outliner::IsExpanded( Paragraph* pPara ) const +sal_Bool Outliner::IsExpanded( Paragraph* pPara ) const { DBG_CHKTHIS(Outliner,0); return pParaList->HasVisibleChilds( pPara ); @@ -315,7 +315,7 @@ Paragraph* Outliner::GetParent( Paragraph* pParagraph ) const return pParaList->GetParent( pParagraph ); } -ULONG Outliner::GetChildCount( Paragraph* pParent ) const +sal_uLong Outliner::GetChildCount( Paragraph* pParent ) const { DBG_CHKTHIS(Outliner,0); return pParaList->GetChildCount( pParent ); @@ -330,7 +330,7 @@ Size Outliner::CalcTextSize() Point Outliner::GetDocPos( Paragraph* pPara ) { DBG_CHKTHIS(Outliner,0); - return pEditEngine->GetDocPosTopLeft( (USHORT)pParaList->GetAbsPos( pPara ) ); + return pEditEngine->GetDocPosTopLeft( (sal_uInt16)pParaList->GetAbsPos( pPara ) ); } void Outliner::SetStyleSheetPool( SfxStyleSheetPool* pSPool ) @@ -345,73 +345,73 @@ SfxStyleSheetPool* Outliner::GetStyleSheetPool() return pEditEngine->GetStyleSheetPool(); } -SfxStyleSheet* Outliner::GetStyleSheet( ULONG nPara ) +SfxStyleSheet* Outliner::GetStyleSheet( sal_uLong nPara ) { DBG_CHKTHIS(Outliner,0); - return pEditEngine->GetStyleSheet( (USHORT)nPara ); + return pEditEngine->GetStyleSheet( (sal_uInt16)nPara ); } -BOOL Outliner::IsInSelectionMode() const +sal_Bool Outliner::IsInSelectionMode() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->IsInSelectionMode(); } -void Outliner::SetControlWord( ULONG nWord ) +void Outliner::SetControlWord( sal_uLong nWord ) { DBG_CHKTHIS(Outliner,0); pEditEngine->SetControlWord( nWord ); } -ULONG Outliner::GetControlWord() const +sal_uLong Outliner::GetControlWord() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->GetControlWord(); } -void Outliner::SetAsianCompressionMode( USHORT n ) +void Outliner::SetAsianCompressionMode( sal_uInt16 n ) { DBG_CHKTHIS(Outliner,0); pEditEngine->SetAsianCompressionMode( n ); } -USHORT Outliner::GetAsianCompressionMode() const +sal_uInt16 Outliner::GetAsianCompressionMode() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->GetAsianCompressionMode(); } -void Outliner::SetKernAsianPunctuation( BOOL b ) +void Outliner::SetKernAsianPunctuation( sal_Bool b ) { DBG_CHKTHIS(Outliner,0); pEditEngine->SetKernAsianPunctuation( b ); } -BOOL Outliner::IsKernAsianPunctuation() const +sal_Bool Outliner::IsKernAsianPunctuation() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->IsKernAsianPunctuation(); } -void Outliner::SetAddExtLeading( BOOL bExtLeading ) +void Outliner::SetAddExtLeading( sal_Bool bExtLeading ) { DBG_CHKTHIS(Outliner,0); pEditEngine->SetAddExtLeading( bExtLeading ); } -BOOL Outliner::IsAddExtLeading() const +sal_Bool Outliner::IsAddExtLeading() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->IsAddExtLeading(); } -void Outliner::UndoActionStart( USHORT nId ) +void Outliner::UndoActionStart( sal_uInt16 nId ) { DBG_CHKTHIS(Outliner,0); pEditEngine->UndoActionStart( nId ); } -void Outliner::UndoActionEnd( USHORT nId ) +void Outliner::UndoActionEnd( sal_uInt16 nId ) { DBG_CHKTHIS(Outliner,0); pEditEngine->UndoActionEnd( nId ); @@ -421,35 +421,35 @@ void Outliner::InsertUndo( EditUndo* pUndo ) { #ifndef SVX_LIGHT DBG_CHKTHIS(Outliner,0); - pEditEngine->GetUndoManager().AddUndoAction( pUndo, FALSE ); + pEditEngine->GetUndoManager().AddUndoAction( pUndo, sal_False ); #endif } -BOOL Outliner::IsInUndo() +sal_Bool Outliner::IsInUndo() { DBG_CHKTHIS(Outliner,0); return pEditEngine->IsInUndo(); } -ULONG Outliner::GetLineCount( ULONG nParagraph ) const +sal_uLong Outliner::GetLineCount( sal_uLong nParagraph ) const { DBG_CHKTHIS(Outliner,0); - return pEditEngine->GetLineCount( (USHORT)nParagraph ); + return pEditEngine->GetLineCount( (sal_uInt16)nParagraph ); } -USHORT Outliner::GetLineLen( ULONG nParagraph, USHORT nLine ) const +sal_uInt16 Outliner::GetLineLen( sal_uLong nParagraph, sal_uInt16 nLine ) const { DBG_CHKTHIS(Outliner,0); - return pEditEngine->GetLineLen( (USHORT)nParagraph, nLine ); + return pEditEngine->GetLineLen( (sal_uInt16)nParagraph, nLine ); } -ULONG Outliner::GetLineHeight( ULONG nParagraph, ULONG nLine ) +sal_uLong Outliner::GetLineHeight( sal_uLong nParagraph, sal_uLong nLine ) { DBG_CHKTHIS(Outliner,0); - return pEditEngine->GetLineHeight( (USHORT)nParagraph, (USHORT)nLine ); + return pEditEngine->GetLineHeight( (sal_uInt16)nParagraph, (sal_uInt16)nLine ); } -void Outliner::QuickRemoveCharAttribs( USHORT nPara, USHORT nWhich ) +void Outliner::QuickRemoveCharAttribs( sal_uInt16 nPara, sal_uInt16 nWhich ) { DBG_CHKTHIS(Outliner,0); pEditEngine->QuickRemoveCharAttribs( nPara, nWhich ); @@ -467,10 +467,10 @@ sal_Bool Outliner::HasConvertibleTextPortion( LanguageType nLang ) return pEditEngine->HasConvertibleTextPortion( nLang ); } -BOOL Outliner::ConvertNextDocument() +sal_Bool Outliner::ConvertNextDocument() { DBG_CHKTHIS(Outliner,0); - return FALSE; + return sal_False; } void Outliner::SetDefaultLanguage( LanguageType eLang ) @@ -485,7 +485,7 @@ LanguageType Outliner::GetDefaultLanguage() const return pEditEngine->GetDefaultLanguage(); } -BOOL Outliner::HasOnlineSpellErrors() const +sal_Bool Outliner::HasOnlineSpellErrors() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->HasOnlineSpellErrors(); @@ -497,7 +497,7 @@ void Outliner::CompleteOnlineSpelling() pEditEngine->CompleteOnlineSpelling(); } -BOOL Outliner::HasText( const SvxSearchItem& rSearchItem ) +sal_Bool Outliner::HasText( const SvxSearchItem& rSearchItem ) { DBG_CHKTHIS(Outliner,0); return pEditEngine->HasText( rSearchItem ); @@ -515,10 +515,10 @@ SfxItemPool* Outliner::GetEditTextObjectPool() const return pEditEngine->GetEditTextObjectPool(); } -BOOL Outliner::SpellNextDocument() +sal_Bool Outliner::SpellNextDocument() { DBG_CHKTHIS(Outliner,0); - return FALSE; + return sal_False; } @@ -564,16 +564,16 @@ OutputDevice* Outliner::GetRefDevice() const return pEditEngine->GetRefDevice(); } -USHORT Outliner::GetFirstLineOffset( ULONG nParagraph ) +sal_uInt16 Outliner::GetFirstLineOffset( sal_uLong nParagraph ) { DBG_CHKTHIS(Outliner,0); - return pEditEngine->GetFirstLineOffset( (USHORT)nParagraph ); + return pEditEngine->GetFirstLineOffset( (sal_uInt16)nParagraph ); } -ULONG Outliner::GetTextHeight( ULONG nParagraph ) const +sal_uLong Outliner::GetTextHeight( sal_uLong nParagraph ) const { DBG_CHKTHIS(Outliner,0); - return pEditEngine->GetTextHeight((USHORT)nParagraph ); + return pEditEngine->GetTextHeight((sal_uInt16)nParagraph ); } Point Outliner::GetDocPos( const Point& rPaperPos ) const @@ -582,35 +582,35 @@ Point Outliner::GetDocPos( const Point& rPaperPos ) const return pEditEngine->GetDocPos( rPaperPos ); } -Point Outliner::GetDocPosTopLeft( ULONG nParagraph ) +Point Outliner::GetDocPosTopLeft( sal_uLong nParagraph ) { DBG_CHKTHIS(Outliner,0); - return pEditEngine->GetDocPosTopLeft( (USHORT)nParagraph ); + return pEditEngine->GetDocPosTopLeft( (sal_uInt16)nParagraph ); } -BOOL Outliner::IsTextPos( const Point& rPaperPos, USHORT nBorder ) +sal_Bool Outliner::IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder ) { return IsTextPos( rPaperPos, nBorder, NULL ); } -BOOL Outliner::IsTextPos( const Point& rPaperPos, USHORT nBorder, BOOL* pbBullet ) +sal_Bool Outliner::IsTextPos( const Point& rPaperPos, sal_uInt16 nBorder, sal_Bool* pbBullet ) { DBG_CHKTHIS(Outliner,0); if ( pbBullet) - *pbBullet = FALSE; - BOOL bTextPos = pEditEngine->IsTextPos( rPaperPos, nBorder ); + *pbBullet = sal_False; + sal_Bool bTextPos = pEditEngine->IsTextPos( rPaperPos, nBorder ); if ( !bTextPos ) { Point aDocPos = GetDocPos( rPaperPos ); - USHORT nPara = pEditEngine->FindParagraph( aDocPos.Y() ); + sal_uInt16 nPara = pEditEngine->FindParagraph( aDocPos.Y() ); if ( ( nPara != EE_PARA_NOT_FOUND ) && ImplHasBullet( nPara ) ) { - Rectangle aBulArea = ImpCalcBulletArea( nPara, TRUE, TRUE ); + Rectangle aBulArea = ImpCalcBulletArea( nPara, sal_True, sal_True ); if ( aBulArea.IsInside( rPaperPos ) ) { - bTextPos = TRUE; + bTextPos = sal_True; if ( pbBullet) - *pbBullet = TRUE; + *pbBullet = sal_True; } } } @@ -626,50 +626,50 @@ void Outliner::QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel ) void Outliner::QuickInsertText( const XubString& rText, const ESelection& rSel ) { - bFirstParaIsEmpty = FALSE; + bFirstParaIsEmpty = sal_False; pEditEngine->QuickInsertText( rText, rSel ); } void Outliner::QuickDelete( const ESelection& rSel ) { - bFirstParaIsEmpty = FALSE; + bFirstParaIsEmpty = sal_False; pEditEngine->QuickDelete( rSel ); } void Outliner::QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel ) { DBG_CHKTHIS(Outliner,0); - bFirstParaIsEmpty = FALSE; + bFirstParaIsEmpty = sal_False; pEditEngine->QuickInsertField( rFld, rSel ); } void Outliner::QuickInsertLineBreak( const ESelection& rSel ) { DBG_CHKTHIS(Outliner,0); - bFirstParaIsEmpty = FALSE; + bFirstParaIsEmpty = sal_False; pEditEngine->QuickInsertLineBreak( rSel ); } -void Outliner::QuickFormatDoc( BOOL bFull ) +void Outliner::QuickFormatDoc( sal_Bool bFull ) { DBG_CHKTHIS(Outliner,0); pEditEngine->QuickFormatDoc( bFull ); } -void Outliner::SetGlobalCharStretching( USHORT nX, USHORT nY ) +void Outliner::SetGlobalCharStretching( sal_uInt16 nX, sal_uInt16 nY ) { DBG_CHKTHIS(Outliner,0); pEditEngine->SetGlobalCharStretching( nX, nY ); } -void Outliner::GetGlobalCharStretching( USHORT& rX, USHORT& rY ) +void Outliner::GetGlobalCharStretching( sal_uInt16& rX, sal_uInt16& rY ) { DBG_CHKTHIS(Outliner,0); pEditEngine->GetGlobalCharStretching( rX, rY ); } -void Outliner::DoStretchChars( USHORT nX, USHORT nY ) +void Outliner::DoStretchChars( sal_uInt16 nX, sal_uInt16 nY ) { DBG_CHKTHIS(Outliner,0); pEditEngine->DoStretchChars( nX, nY ); @@ -681,43 +681,43 @@ void Outliner::EraseVirtualDevice() pEditEngine->EraseVirtualDevice(); } -void Outliner::SetBigTextObjectStart( USHORT nStartAtPortionCount ) +void Outliner::SetBigTextObjectStart( sal_uInt16 nStartAtPortionCount ) { DBG_CHKTHIS(Outliner,0); pEditEngine->SetBigTextObjectStart( nStartAtPortionCount ); } -USHORT Outliner::GetBigTextObjectStart() const +sal_uInt16 Outliner::GetBigTextObjectStart() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->GetBigTextObjectStart(); } -BOOL Outliner::ShouldCreateBigTextObject() const +sal_Bool Outliner::ShouldCreateBigTextObject() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->ShouldCreateBigTextObject(); } -void Outliner::SetVertical( BOOL b ) +void Outliner::SetVertical( sal_Bool b ) { DBG_CHKTHIS(Outliner,0); pEditEngine->SetVertical( b ); } -BOOL Outliner::IsVertical() const +sal_Bool Outliner::IsVertical() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->IsVertical(); } -void Outliner::SetFixedCellHeight( BOOL bUseFixedCellHeight ) +void Outliner::SetFixedCellHeight( sal_Bool bUseFixedCellHeight ) { DBG_CHKTHIS(Outliner,0); pEditEngine->SetFixedCellHeight( bUseFixedCellHeight ); } -BOOL Outliner::IsFixedCellHeight() const +sal_Bool Outliner::IsFixedCellHeight() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->IsFixedCellHeight(); @@ -735,13 +735,13 @@ EEHorizontalTextDirection Outliner::GetDefaultHorizontalTextDirection() const return pEditEngine->GetDefaultHorizontalTextDirection(); } -USHORT Outliner::GetScriptType( const ESelection& rSelection ) const +sal_uInt16 Outliner::GetScriptType( const ESelection& rSelection ) const { DBG_CHKTHIS(Outliner,0); return pEditEngine->GetScriptType( rSelection ); } -LanguageType Outliner::GetLanguage( USHORT nPara, USHORT nPos ) const +LanguageType Outliner::GetLanguage( sal_uInt16 nPara, sal_uInt16 nPos ) const { DBG_CHKTHIS(Outliner,0); return pEditEngine->GetLanguage( nPara, nPos ); @@ -753,25 +753,25 @@ void Outliner::RemoveAttribs( const ESelection& rSelection, sal_Bool bRemovePara pEditEngine->RemoveAttribs( rSelection, bRemoveParaAttribs, nWhich ); } -void Outliner::EnableAutoColor( BOOL b ) +void Outliner::EnableAutoColor( sal_Bool b ) { DBG_CHKTHIS(Outliner,0); pEditEngine->EnableAutoColor( b ); } -BOOL Outliner::IsAutoColorEnabled() const +sal_Bool Outliner::IsAutoColorEnabled() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->IsAutoColorEnabled(); } -void Outliner::ForceAutoColor( BOOL b ) +void Outliner::ForceAutoColor( sal_Bool b ) { DBG_CHKTHIS(Outliner,0); pEditEngine->ForceAutoColor( b ); } -BOOL Outliner::IsForceAutoColor() const +sal_Bool Outliner::IsForceAutoColor() const { DBG_CHKTHIS(Outliner,0); return pEditEngine->IsForceAutoColor(); diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 20b9f4ddd406..1e1a5d39c804 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -70,20 +70,20 @@ using ::std::advance; #define DEFAULT_SCALE 75 -static const USHORT nDefStyles = 3; // Special treatment for the first 3 levels -static const USHORT nDefBulletIndent = 800; -static const USHORT nDefBulletWidth = 700; -static const USHORT pDefBulletIndents[nDefStyles]= { 1400, 800, 800 }; -static const USHORT pDefBulletWidths[nDefStyles] = { 1000, 850, 700 }; +static const sal_uInt16 nDefStyles = 3; // Special treatment for the first 3 levels +static const sal_uInt16 nDefBulletIndent = 800; +static const sal_uInt16 nDefBulletWidth = 700; +static const sal_uInt16 pDefBulletIndents[nDefStyles]= { 1400, 800, 800 }; +static const sal_uInt16 pDefBulletWidths[nDefStyles] = { 1000, 850, 700 }; -USHORT lcl_ImplGetDefBulletWidth( sal_Int16 nDepth ) +sal_uInt16 lcl_ImplGetDefBulletWidth( sal_Int16 nDepth ) { return ( nDepth < nDefStyles ) ? pDefBulletWidths[nDepth] : nDefBulletWidth; } -USHORT lcl_ImplGetDefBulletIndent( sal_Int16 nDepth ) +sal_uInt16 lcl_ImplGetDefBulletIndent( sal_Int16 nDepth ) { - USHORT nI = 0; + sal_uInt16 nI = 0; if( nDepth >= 0 ) { @@ -108,7 +108,7 @@ void Outliner::ImplCheckDepth( sal_Int16& rnDepth ) const rnDepth = nMaxDepth; } -Paragraph* Outliner::Insert(const XubString& rText, ULONG nAbsPos, sal_Int16 nDepth) +Paragraph* Outliner::Insert(const XubString& rText, sal_uLong nAbsPos, sal_Int16 nDepth) { DBG_CHKTHIS(Outliner,0); DBG_ASSERT(pParaList->GetParagraphCount(),"Insert:No Paras"); @@ -117,7 +117,7 @@ Paragraph* Outliner::Insert(const XubString& rText, ULONG nAbsPos, sal_Int16 nDe ImplCheckDepth( nDepth ); - ULONG nParagraphCount = pParaList->GetParagraphCount(); + sal_uLong nParagraphCount = pParaList->GetParagraphCount(); if( nAbsPos > nParagraphCount ) nAbsPos = nParagraphCount; @@ -137,28 +137,28 @@ Paragraph* Outliner::Insert(const XubString& rText, ULONG nAbsPos, sal_Int16 nDe } else { - BOOL bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( FALSE ); - ImplBlockInsertionCallbacks( TRUE ); + sal_Bool bUpdate = pEditEngine->GetUpdateMode(); + pEditEngine->SetUpdateMode( sal_False ); + ImplBlockInsertionCallbacks( sal_True ); pPara = new Paragraph( nDepth ); pParaList->Insert( pPara, nAbsPos ); - pEditEngine->InsertParagraph( (USHORT)nAbsPos, String() ); + pEditEngine->InsertParagraph( (sal_uInt16)nAbsPos, String() ); DBG_ASSERT(pPara==pParaList->GetParagraph(nAbsPos),"Insert:Failed"); - ImplInitDepth( (USHORT)nAbsPos, nDepth, FALSE ); + ImplInitDepth( (sal_uInt16)nAbsPos, nDepth, sal_False ); pHdlParagraph = pPara; ParagraphInsertedHdl(); pPara->nFlags |= PARAFLAG_HOLDDEPTH; SetText( rText, pPara ); - ImplBlockInsertionCallbacks( FALSE ); + ImplBlockInsertionCallbacks( sal_False ); pEditEngine->SetUpdateMode( bUpdate ); } - bFirstParaIsEmpty = FALSE; + bFirstParaIsEmpty = sal_False; DBG_ASSERT(pEditEngine->GetParagraphCount()==pParaList->GetParagraphCount(),"SetText failed"); return pPara; } -void Outliner::ParagraphInserted( USHORT nPara ) +void Outliner::ParagraphInserted( sal_uInt16 nPara ) { DBG_CHKTHIS(Outliner,0); @@ -172,7 +172,7 @@ void Outliner::ParagraphInserted( USHORT nPara ) if( pEditEngine->IsInUndo() ) { pPara->nFlags = PARAFLAG_SETBULLETTEXT; - pPara->bVisible = TRUE; + pPara->bVisible = sal_True; const SfxInt16Item& rLevel = (const SfxInt16Item&) pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL ); pPara->SetDepth( rLevel.GetValue() ); } @@ -189,14 +189,14 @@ void Outliner::ParagraphInserted( USHORT nPara ) if( !pEditEngine->IsInUndo() ) { - ImplCalcBulletText( nPara, TRUE, FALSE ); + ImplCalcBulletText( nPara, sal_True, sal_False ); pHdlParagraph = pPara; ParagraphInsertedHdl(); } } } -void Outliner::ParagraphDeleted( USHORT nPara ) +void Outliner::ParagraphDeleted( sal_uInt16 nPara ) { DBG_CHKTHIS(Outliner,0); @@ -223,24 +223,24 @@ void Outliner::ParagraphDeleted( USHORT nPara ) pPara = pParaList->GetParagraph( nPara ); if ( pPara && ( pPara->GetDepth() > nDepth ) ) { - ImplCalcBulletText( nPara, TRUE, FALSE ); + ImplCalcBulletText( nPara, sal_True, sal_False ); // Search for next on the this level ... while ( pPara && pPara->GetDepth() > nDepth ) pPara = pParaList->GetParagraph( ++nPara ); } if ( pPara && ( pPara->GetDepth() == nDepth ) ) - ImplCalcBulletText( nPara, TRUE, FALSE ); + ImplCalcBulletText( nPara, sal_True, sal_False ); } } -void Outliner::Init( USHORT nMode ) +void Outliner::Init( sal_uInt16 nMode ) { nOutlinerMode = nMode; Clear(); - ULONG nCtrl = pEditEngine->GetControlWord(); + sal_uLong nCtrl = pEditEngine->GetControlWord(); nCtrl &= ~(EE_CNTRL_OUTLINER|EE_CNTRL_OUTLINER2); SetMaxDepth( 9 ); @@ -263,12 +263,12 @@ void Outliner::Init( USHORT nMode ) pEditEngine->SetControlWord( nCtrl ); - ImplInitDepth( 0, GetMinDepth(), FALSE ); + ImplInitDepth( 0, GetMinDepth(), sal_False ); GetUndoManager().Clear(); } -void Outliner::SetMaxDepth( sal_Int16 nDepth, BOOL bCheckParagraphs ) +void Outliner::SetMaxDepth( sal_Int16 nDepth, sal_Bool bCheckParagraphs ) { if( nMaxDepth != nDepth ) { @@ -276,8 +276,8 @@ void Outliner::SetMaxDepth( sal_Int16 nDepth, BOOL bCheckParagraphs ) if( bCheckParagraphs ) { - USHORT nParagraphs = (USHORT)pParaList->GetParagraphCount(); - for ( USHORT nPara = 0; nPara < nParagraphs; nPara++ ) + sal_uInt16 nParagraphs = (sal_uInt16)pParaList->GetParagraphCount(); + for ( sal_uInt16 nPara = 0; nPara < nParagraphs; nPara++ ) { Paragraph* pPara = pParaList->GetParagraph( nPara ); if( pPara && pPara->GetDepth() > nMaxDepth ) @@ -289,7 +289,7 @@ void Outliner::SetMaxDepth( sal_Int16 nDepth, BOOL bCheckParagraphs ) } } -sal_Int16 Outliner::GetDepth( ULONG nPara ) const +sal_Int16 Outliner::GetDepth( sal_uLong nPara ) const { Paragraph* pPara = pParaList->GetParagraph( nPara ); DBG_ASSERT( pPara, "Outliner::GetDepth - Paragraph not found!" ); @@ -308,9 +308,9 @@ void Outliner::SetDepth( Paragraph* pPara, sal_Int16 nNewDepth ) mnDepthChangeHdlPrevFlags = pPara->nFlags; pHdlParagraph = pPara; - USHORT nPara = (USHORT)GetAbsPos( pPara ); - ImplInitDepth( nPara, nNewDepth, TRUE ); - ImplCalcBulletText( nPara, FALSE, FALSE ); + sal_uInt16 nPara = (sal_uInt16)GetAbsPos( pPara ); + ImplInitDepth( nPara, nNewDepth, sal_True ); + ImplCalcBulletText( nPara, sal_False, sal_False ); if ( ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT ) ImplSetLevelDependendStyleSheet( nPara ); @@ -341,7 +341,7 @@ void Outliner::SetNumberingStartValue( sal_uInt16 nPara, sal_Int16 nNumberingSta // #i100014# // It is not a good idea to substract 1 from a count and cast the result // to USHORT without check, if the count is 0. - ImplCheckParagraphs( nPara, (USHORT) (pParaList->GetParagraphCount()) ); + ImplCheckParagraphs( nPara, (sal_uInt16) (pParaList->GetParagraphCount()) ); pEditEngine->SetModified(); } } @@ -368,18 +368,18 @@ void Outliner::SetParaIsNumberingRestart( sal_uInt16 nPara, sal_Bool bParaIsNumb // #i100014# // It is not a good idea to substract 1 from a count and cast the result // to USHORT without check, if the count is 0. - ImplCheckParagraphs( nPara, (USHORT) (pParaList->GetParagraphCount()) ); + ImplCheckParagraphs( nPara, (sal_uInt16) (pParaList->GetParagraphCount()) ); pEditEngine->SetModified(); } } -OutlinerParaObject* Outliner::CreateParaObject( USHORT nStartPara, USHORT nCount ) const +OutlinerParaObject* Outliner::CreateParaObject( sal_uInt16 nStartPara, sal_uInt16 nCount ) const { DBG_CHKTHIS(Outliner,0); - if ( sal::static_int_cast< ULONG >( nStartPara + nCount ) > + if ( sal::static_int_cast< sal_uLong >( nStartPara + nCount ) > pParaList->GetParagraphCount() ) - nCount = sal::static_int_cast< USHORT >( + nCount = sal::static_int_cast< sal_uInt16 >( pParaList->GetParagraphCount() - nStartPara ); // When a new OutlinerParaObject is created because a paragraph is just beeing deleted, @@ -412,16 +412,16 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara ) DBG_CHKTHIS(Outliner,0); DBG_ASSERT(pPara,"SetText:No Para"); - BOOL bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( FALSE ); - ImplBlockInsertionCallbacks( TRUE ); + sal_Bool bUpdate = pEditEngine->GetUpdateMode(); + pEditEngine->SetUpdateMode( sal_False ); + ImplBlockInsertionCallbacks( sal_True ); - USHORT nPara = (USHORT)pParaList->GetAbsPos( pPara ); + sal_uInt16 nPara = (sal_uInt16)pParaList->GetAbsPos( pPara ); if( !rText.Len() ) { pEditEngine->SetText( nPara, rText ); - ImplInitDepth( nPara, pPara->GetDepth(), FALSE ); + ImplInitDepth( nPara, pPara->GetDepth(), sal_False ); } else { @@ -431,9 +431,9 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara ) if( aText.GetChar( aText.Len()-1 ) == '\x0A' ) aText.Erase( aText.Len()-1, 1 ); // Delete the last break - USHORT nCount = aText.GetTokenCount( '\x0A' ); - USHORT nPos = 0; - USHORT nInsPos = nPara+1; + sal_uInt16 nCount = aText.GetTokenCount( '\x0A' ); + sal_uInt16 nPos = 0; + sal_uInt16 nInsPos = nPara+1; while( nCount > nPos ) { XubString aStr = aText.GetToken( nPos, '\x0A' ); @@ -453,7 +453,7 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara ) ( ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEVIEW ) ) { // Extract Tabs - USHORT nTabs = 0; + sal_uInt16 nTabs = 0; while ( ( nTabs < aStr.Len() ) && ( aStr.GetChar( nTabs ) == '\t' ) ) nTabs++; if ( nTabs ) @@ -480,15 +480,15 @@ void Outliner::SetText( const XubString& rText, Paragraph* pPara ) nInsPos--; pEditEngine->SetText( nInsPos, aStr ); } - ImplInitDepth( nInsPos, nCurDepth, FALSE ); + ImplInitDepth( nInsPos, nCurDepth, sal_False ); nInsPos++; nPos++; } } DBG_ASSERT(pParaList->GetParagraphCount()==pEditEngine->GetParagraphCount(),"SetText failed!"); - bFirstParaIsEmpty = FALSE; - ImplBlockInsertionCallbacks( FALSE ); + bFirstParaIsEmpty = sal_False; + ImplBlockInsertionCallbacks( sal_False ); pEditEngine->SetUpdateMode( bUpdate ); } @@ -499,7 +499,7 @@ bool Outliner::ImpConvertEdtToOut( sal_uInt32 nPara,EditView* pView) DBG_CHKTHIS(Outliner,0); bool bConverted = false; - USHORT nTabs = 0; + sal_uInt16 nTabs = 0; ESelection aDelSel; // const SfxItemSet& rAttrs = pEditEngine->GetParaAttribs( (sal_uInt16)nPara ); @@ -509,16 +509,16 @@ bool Outliner::ImpConvertEdtToOut( sal_uInt32 nPara,EditView* pView) XubString aHeading_US( RTL_CONSTASCII_USTRINGPARAM( "heading" ) ); XubString aNumber_US( RTL_CONSTASCII_USTRINGPARAM( "Numbering" ) ); - XubString aStr( pEditEngine->GetText( (USHORT)nPara ) ); + XubString aStr( pEditEngine->GetText( (sal_uInt16)nPara ) ); xub_Unicode* pPtr = (xub_Unicode*)aStr.GetBuffer(); - USHORT nHeadingNumberStart = 0; - USHORT nNumberingNumberStart = 0; - SfxStyleSheet* pStyle= pEditEngine->GetStyleSheet( (USHORT)nPara ); + sal_uInt16 nHeadingNumberStart = 0; + sal_uInt16 nNumberingNumberStart = 0; + SfxStyleSheet* pStyle= pEditEngine->GetStyleSheet( (sal_uInt16)nPara ); if( pStyle ) { aName = pStyle->GetName(); - USHORT nSearch; + sal_uInt16 nSearch; if ( ( nSearch = aName.Search( aHeading_US ) ) != STRING_NOTFOUND ) nHeadingNumberStart = nSearch + aHeading_US.Len(); else if ( ( nSearch = aName.Search( aNumber_US ) ) != STRING_NOTFOUND ) @@ -532,16 +532,16 @@ bool Outliner::ImpConvertEdtToOut( sal_uInt32 nPara,EditView* pView) ( pPtr[0] != '\t' ) && ( pPtr[1] == '\t' ) ) { // Extract Bullet and Tab - aDelSel = ESelection( (USHORT)nPara, 0, (USHORT)nPara, 2 ); + aDelSel = ESelection( (sal_uInt16)nPara, 0, (sal_uInt16)nPara, 2 ); } - USHORT nPos = nHeadingNumberStart ? nHeadingNumberStart : nNumberingNumberStart; + sal_uInt16 nPos = nHeadingNumberStart ? nHeadingNumberStart : nNumberingNumberStart; String aLevel = aName.Copy( nPos ); aLevel.EraseLeadingChars( ' ' ); - nTabs = sal::static_int_cast< USHORT >(aLevel.ToInt32()); + nTabs = sal::static_int_cast< sal_uInt16 >(aLevel.ToInt32()); if( nTabs ) nTabs--; // Level 0 = "heading 1" - bConverted = TRUE; + bConverted = sal_True; } else { @@ -553,7 +553,7 @@ bool Outliner::ImpConvertEdtToOut( sal_uInt32 nPara,EditView* pView) } // Remove tabs from the text if( nTabs ) - aDelSel = ESelection( (USHORT)nPara, 0, (USHORT)nPara, nTabs ); + aDelSel = ESelection( (sal_uInt16)nPara, 0, (sal_uInt16)nPara, nTabs ); } if ( aDelSel.HasRange() ) @@ -571,7 +571,7 @@ bool Outliner::ImpConvertEdtToOut( sal_uInt32 nPara,EditView* pView) sal_Int16 nOutlLevel = rLevel.GetValue(); ImplCheckDepth( nOutlLevel ); - ImplInitDepth( sal::static_int_cast< sal_uInt16 >(nPara), nOutlLevel, FALSE ); + ImplInitDepth( sal::static_int_cast< sal_uInt16 >(nPara), nOutlLevel, sal_False ); return bConverted; } @@ -580,25 +580,25 @@ void Outliner::SetText( const OutlinerParaObject& rPObj ) { DBG_CHKTHIS(Outliner,0); - BOOL bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( FALSE ); + sal_Bool bUpdate = pEditEngine->GetUpdateMode(); + pEditEngine->SetUpdateMode( sal_False ); - BOOL bUndo = pEditEngine->IsUndoEnabled(); - EnableUndo( FALSE ); + sal_Bool bUndo = pEditEngine->IsUndoEnabled(); + EnableUndo( sal_False ); Init( rPObj.GetOutlinerMode() ); - ImplBlockInsertionCallbacks( TRUE ); + ImplBlockInsertionCallbacks( sal_True ); pEditEngine->SetText(rPObj.GetTextObject()); if( rPObj.Count() != pEditEngine->GetParagraphCount() ) { int nop=0;nop++; } - bFirstParaIsEmpty = FALSE; + bFirstParaIsEmpty = sal_False; - pParaList->Clear( TRUE ); - for( USHORT nCurPara = 0; nCurPara < rPObj.Count(); nCurPara++ ) + pParaList->Clear( sal_True ); + for( sal_uInt16 nCurPara = 0; nCurPara < rPObj.Count(); nCurPara++ ) { Paragraph* pPara = new Paragraph( rPObj.GetParagraphData(nCurPara)); ImplCheckDepth( pPara->nDepth ); @@ -610,10 +610,10 @@ void Outliner::SetText( const OutlinerParaObject& rPObj ) // #i100014# // It is not a good idea to substract 1 from a count and cast the result // to USHORT without check, if the count is 0. - ImplCheckParagraphs( 0, (USHORT) (pParaList->GetParagraphCount()) ); + ImplCheckParagraphs( 0, (sal_uInt16) (pParaList->GetParagraphCount()) ); EnableUndo( bUndo ); - ImplBlockInsertionCallbacks( FALSE ); + ImplBlockInsertionCallbacks( sal_False ); pEditEngine->SetUpdateMode( bUpdate ); DBG_ASSERT( pParaList->GetParagraphCount()==rPObj.Count(),"SetText failed"); @@ -625,14 +625,14 @@ void Outliner::AddText( const OutlinerParaObject& rPObj ) DBG_CHKTHIS(Outliner,0); Paragraph* pPara; - BOOL bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( FALSE ); + sal_Bool bUpdate = pEditEngine->GetUpdateMode(); + pEditEngine->SetUpdateMode( sal_False ); - ImplBlockInsertionCallbacks( TRUE ); - ULONG nPara; + ImplBlockInsertionCallbacks( sal_True ); + sal_uLong nPara; if( bFirstParaIsEmpty ) { - pParaList->Clear( TRUE ); + pParaList->Clear( sal_True ); pEditEngine->SetText(rPObj.GetTextObject()); nPara = 0; } @@ -641,53 +641,53 @@ void Outliner::AddText( const OutlinerParaObject& rPObj ) nPara = pParaList->GetParagraphCount(); pEditEngine->InsertParagraph( EE_PARA_APPEND, rPObj.GetTextObject() ); } - bFirstParaIsEmpty = FALSE; + bFirstParaIsEmpty = sal_False; - for( USHORT n = 0; n < rPObj.Count(); n++ ) + for( sal_uInt16 n = 0; n < rPObj.Count(); n++ ) { pPara = new Paragraph( rPObj.GetParagraphData(n) ); pParaList->Append(pPara); - USHORT nP = sal::static_int_cast< USHORT >(nPara+n); + sal_uInt16 nP = sal::static_int_cast< sal_uInt16 >(nPara+n); DBG_ASSERT(pParaList->GetAbsPos(pPara)==nP,"AddText:Out of sync"); - ImplInitDepth( nP, pPara->GetDepth(), FALSE ); + ImplInitDepth( nP, pPara->GetDepth(), sal_False ); } DBG_ASSERT( pEditEngine->GetParagraphCount()==pParaList->GetParagraphCount(), "SetText: OutOfSync" ); // #i100014# // It is not a good idea to substract 1 from a count and cast the result // to USHORT without check, if the count is 0. - ImplCheckParagraphs( (USHORT)nPara, (USHORT) (pParaList->GetParagraphCount()) ); + ImplCheckParagraphs( (sal_uInt16)nPara, (sal_uInt16) (pParaList->GetParagraphCount()) ); - ImplBlockInsertionCallbacks( FALSE ); + ImplBlockInsertionCallbacks( sal_False ); pEditEngine->SetUpdateMode( bUpdate ); } -void Outliner::FieldClicked( const SvxFieldItem& rField, USHORT nPara, USHORT nPos ) +void Outliner::FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos ) { DBG_CHKTHIS(Outliner,0); if ( aFieldClickedHdl.IsSet() ) { EditFieldInfo aFldInfo( this, rField, nPara, nPos ); - aFldInfo.SetSimpleClick( TRUE ); + aFldInfo.SetSimpleClick( sal_True ); aFieldClickedHdl.Call( &aFldInfo ); } } -void Outliner::FieldSelected( const SvxFieldItem& rField, USHORT nPara, USHORT nPos ) +void Outliner::FieldSelected( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos ) { DBG_CHKTHIS(Outliner,0); if ( !aFieldClickedHdl.IsSet() ) return; EditFieldInfo aFldInfo( this, rField, nPara, nPos ); - aFldInfo.SetSimpleClick( FALSE ); + aFldInfo.SetSimpleClick( sal_False ); aFieldClickedHdl.Call( &aFldInfo ); } -XubString Outliner::CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor ) +XubString Outliner::CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ) { DBG_CHKTHIS(Outliner,0); if ( !aCalcFieldValueHdl.IsSet() ) @@ -711,19 +711,19 @@ XubString Outliner::CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, US return aFldInfo.GetRepresentation(); } -void Outliner::SetStyleSheet( ULONG nPara, SfxStyleSheet* pStyle ) +void Outliner::SetStyleSheet( sal_uLong nPara, SfxStyleSheet* pStyle ) { DBG_CHKTHIS(Outliner,0); Paragraph* pPara = pParaList->GetParagraph( nPara ); if (pPara) { - pEditEngine->SetStyleSheet( (USHORT)nPara, pStyle ); + pEditEngine->SetStyleSheet( (sal_uInt16)nPara, pStyle ); pPara->nFlags |= PARAFLAG_SETBULLETTEXT; - ImplCheckNumBulletItem( (USHORT) nPara ); + ImplCheckNumBulletItem( (sal_uInt16) nPara ); } } -void Outliner::SetVisible( Paragraph* pPara, BOOL bVisible ) +void Outliner::SetVisible( Paragraph* pPara, sal_Bool bVisible ) { DBG_CHKTHIS(Outliner,0); DBG_ASSERT( pPara, "SetVisible: pPara = NULL" ); @@ -731,19 +731,19 @@ void Outliner::SetVisible( Paragraph* pPara, BOOL bVisible ) if (pPara) { pPara->bVisible = bVisible; - ULONG nPara = pParaList->GetAbsPos( pPara ); - pEditEngine->ShowParagraph( (USHORT)nPara, bVisible ); + sal_uLong nPara = pParaList->GetAbsPos( pPara ); + pEditEngine->ShowParagraph( (sal_uInt16)nPara, bVisible ); } } -void Outliner::ImplCheckNumBulletItem( USHORT nPara ) +void Outliner::ImplCheckNumBulletItem( sal_uInt16 nPara ) { Paragraph* pPara = pParaList->GetParagraph( nPara ); if (pPara) pPara->aBulSize.Width() = -1; } -void Outliner::ImplSetLevelDependendStyleSheet( USHORT nPara, SfxStyleSheet* pLevelStyle ) +void Outliner::ImplSetLevelDependendStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pLevelStyle ) { DBG_CHKTHIS(Outliner,0); @@ -778,7 +778,7 @@ void Outliner::ImplSetLevelDependendStyleSheet( USHORT nPara, SfxStyleSheet* pLe } } -void Outliner::ImplInitDepth( USHORT nPara, sal_Int16 nDepth, BOOL bCreateUndo, BOOL bUndoAction ) +void Outliner::ImplInitDepth( sal_uInt16 nPara, sal_Int16 nDepth, sal_Bool bCreateUndo, sal_Bool bUndoAction ) { DBG_CHKTHIS(Outliner,0); @@ -794,10 +794,10 @@ void Outliner::ImplInitDepth( USHORT nPara, sal_Int16 nDepth, BOOL bCreateUndo, // the old values are restored by the EditEngine. if( !IsInUndo() ) { - BOOL bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( FALSE ); + sal_Bool bUpdate = pEditEngine->GetUpdateMode(); + pEditEngine->SetUpdateMode( sal_False ); - BOOL bUndo = bCreateUndo && IsUndoEnabled(); + sal_Bool bUndo = bCreateUndo && IsUndoEnabled(); if ( bUndo && bUndoAction ) UndoActionStart( OLUNDO_DEPTH ); @@ -805,7 +805,7 @@ void Outliner::ImplInitDepth( USHORT nPara, sal_Int16 nDepth, BOOL bCreateUndo, aAttrs.Put( SfxInt16Item( EE_PARA_OUTLLEVEL, nDepth ) ); pEditEngine->SetParaAttribs( nPara, aAttrs ); ImplCheckNumBulletItem( nPara ); - ImplCalcBulletText( nPara, FALSE, FALSE ); + ImplCalcBulletText( nPara, sal_False, sal_False ); if ( bUndo ) { @@ -818,30 +818,30 @@ void Outliner::ImplInitDepth( USHORT nPara, sal_Int16 nDepth, BOOL bCreateUndo, } } -void Outliner::SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) +void Outliner::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ) { DBG_CHKTHIS(Outliner,0); pEditEngine->SetParaAttribs( nPara, rSet ); } -BOOL Outliner::Expand( Paragraph* pPara ) +sal_Bool Outliner::Expand( Paragraph* pPara ) { DBG_CHKTHIS(Outliner,0); if ( pParaList->HasHiddenChilds( pPara ) ) { OLUndoExpand* pUndo = 0; - BOOL bUndo = IsUndoEnabled() && !IsInUndo(); + sal_Bool bUndo = IsUndoEnabled() && !IsInUndo(); if( bUndo ) { UndoActionStart( OLUNDO_EXPAND ); pUndo = new OLUndoExpand( this, OLUNDO_EXPAND ); pUndo->pParas = 0; - pUndo->nCount = (USHORT)pParaList->GetAbsPos( pPara ); + pUndo->nCount = (sal_uInt16)pParaList->GetAbsPos( pPara ); } pHdlParagraph = pPara; - bIsExpanding = TRUE; + bIsExpanding = sal_True; pParaList->Expand( pPara ); ExpandHdl(); InvalidateBullet( pPara, pParaList->GetAbsPos(pPara) ); @@ -850,32 +850,32 @@ BOOL Outliner::Expand( Paragraph* pPara ) InsertUndo( pUndo ); UndoActionEnd( OLUNDO_EXPAND ); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL Outliner::Collapse( Paragraph* pPara ) +sal_Bool Outliner::Collapse( Paragraph* pPara ) { DBG_CHKTHIS(Outliner,0); if ( pParaList->HasVisibleChilds( pPara ) ) // expanded { OLUndoExpand* pUndo = 0; - BOOL bUndo = FALSE; + sal_Bool bUndo = sal_False; if( !IsInUndo() && IsUndoEnabled() ) - bUndo = TRUE; + bUndo = sal_True; if( bUndo ) { UndoActionStart( OLUNDO_COLLAPSE ); pUndo = new OLUndoExpand( this, OLUNDO_COLLAPSE ); pUndo->pParas = 0; - pUndo->nCount = (USHORT)pParaList->GetAbsPos( pPara ); + pUndo->nCount = (sal_uInt16)pParaList->GetAbsPos( pPara ); } pHdlParagraph = pPara; - bIsExpanding = FALSE; + bIsExpanding = sal_False; pParaList->Collapse( pPara ); ExpandHdl(); InvalidateBullet( pPara, pParaList->GetAbsPos(pPara) ); @@ -884,13 +884,13 @@ BOOL Outliner::Collapse( Paragraph* pPara ) InsertUndo( pUndo ); UndoActionEnd( OLUNDO_COLLAPSE ); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -Font Outliner::ImpCalcBulletFont( USHORT nPara ) const +Font Outliner::ImpCalcBulletFont( sal_uInt16 nPara ) const { const SvxNumberFormat* pFmt = GetNumberFormat( nPara ); DBG_ASSERT( pFmt && ( pFmt->GetNumberingType() != SVX_NUM_BITMAP ) && ( pFmt->GetNumberingType() != SVX_NUM_NUMBER_NONE ), "ImpCalcBulletFont: Missing or BitmapBullet!" ); @@ -925,14 +925,14 @@ Font Outliner::ImpCalcBulletFont( USHORT nPara ) const USHORT nStretchX, nStretchY; const_cast<Outliner*>(this)->GetGlobalCharStretching(nStretchX, nStretchY); - USHORT nScale = pFmt->GetBulletRelSize() * nStretchY / 100; - ULONG nScaledLineHeight = aStdFont.GetSize().Height(); + sal_uInt16 nScale = pFmt->GetBulletRelSize() * nStretchY / 100; + sal_uLong nScaledLineHeight = aStdFont.GetSize().Height(); nScaledLineHeight *= nScale*10; nScaledLineHeight /= 1000; aBulletFont.SetAlign( ALIGN_BOTTOM ); aBulletFont.SetSize( Size( 0, nScaledLineHeight ) ); - BOOL bVertical = IsVertical(); + sal_Bool bVertical = IsVertical(); aBulletFont.SetVertical( bVertical ); aBulletFont.SetOrientation( bVertical ? 2700 : 0 ); @@ -949,7 +949,7 @@ Font Outliner::ImpCalcBulletFont( USHORT nPara ) const return aBulletFont; } -void Outliner::PaintBullet( USHORT nPara, const Point& rStartPos, +void Outliner::PaintBullet( sal_uInt16 nPara, const Point& rStartPos, const Point& rOrigin, short nOrientation, OutputDevice* pOutDev ) { DBG_CHKTHIS(Outliner,0); @@ -963,12 +963,12 @@ void Outliner::PaintBullet( USHORT nPara, const Point& rStartPos, if ( ImplHasBullet( nPara ) && bDrawBullet) { - BOOL bVertical = IsVertical(); + sal_Bool bVertical = IsVertical(); - BOOL bRightToLeftPara = pEditEngine->IsRightToLeft( nPara ); + sal_Bool bRightToLeftPara = pEditEngine->IsRightToLeft( nPara ); - Rectangle aBulletArea( ImpCalcBulletArea( nPara, TRUE, FALSE ) ); - USHORT nStretchX, nStretchY; + Rectangle aBulletArea( ImpCalcBulletArea( nPara, sal_True, sal_False ) ); + sal_uInt16 nStretchX, nStretchY; GetGlobalCharStretching(nStretchX, nStretchY); aBulletArea = Rectangle( Point(aBulletArea.Left()*nStretchX/100, aBulletArea.Top()), @@ -983,7 +983,7 @@ void Outliner::PaintBullet( USHORT nPara, const Point& rStartPos, { Font aBulletFont( ImpCalcBulletFont( nPara ) ); // Use baseline - BOOL bSymbol = pFmt->GetNumberingType() == SVX_NUM_CHAR_SPECIAL; + sal_Bool bSymbol = pFmt->GetNumberingType() == SVX_NUM_CHAR_SPECIAL; aBulletFont.SetAlign( bSymbol ? ALIGN_BOTTOM : ALIGN_BASELINE ); Font aOldFont = pOutDev->GetFont(); pOutDev->SetFont( aBulletFont ); @@ -1028,7 +1028,7 @@ void Outliner::PaintBullet( USHORT nPara, const Point& rStartPos, } // VCL will take care of brackets and so on... - ULONG nLayoutMode = pOutDev->GetLayoutMode(); + sal_uLong nLayoutMode = pOutDev->GetLayoutMode(); nLayoutMode &= ~(TEXT_LAYOUT_BIDI_RTL|TEXT_LAYOUT_COMPLEX_DISABLED|TEXT_LAYOUT_BIDI_STRONG); if ( bRightToLeftPara ) nLayoutMode |= TEXT_LAYOUT_BIDI_RTL; @@ -1136,11 +1136,11 @@ void Outliner::PaintBullet( USHORT nPara, const Point& rStartPos, } } -void Outliner::InvalidateBullet( Paragraph* /*pPara*/, ULONG nPara ) +void Outliner::InvalidateBullet( Paragraph* /*pPara*/, sal_uLong nPara ) { DBG_CHKTHIS(Outliner,0); - long nLineHeight = (long)pEditEngine->GetLineHeight((USHORT)nPara ); + long nLineHeight = (long)pEditEngine->GetLineHeight((sal_uInt16)nPara ); for ( size_t i = 0, n = aViewList.size(); i < n; ++i ) { OutlinerView* pView = aViewList[ i ]; @@ -1155,26 +1155,26 @@ void Outliner::InvalidateBullet( Paragraph* /*pPara*/, ULONG nPara ) } } -ULONG Outliner::Read( SvStream& rInput, const String& rBaseURL, USHORT eFormat, SvKeyValueIterator* pHTTPHeaderAttrs ) +sal_uLong Outliner::Read( SvStream& rInput, const String& rBaseURL, sal_uInt16 eFormat, SvKeyValueIterator* pHTTPHeaderAttrs ) { DBG_CHKTHIS(Outliner,0); - BOOL bOldUndo = pEditEngine->IsUndoEnabled(); - EnableUndo( FALSE ); + sal_Bool bOldUndo = pEditEngine->IsUndoEnabled(); + EnableUndo( sal_False ); - BOOL bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( FALSE ); + sal_Bool bUpdate = pEditEngine->GetUpdateMode(); + pEditEngine->SetUpdateMode( sal_False ); Clear(); - ImplBlockInsertionCallbacks( TRUE ); - ULONG nRet = pEditEngine->Read( rInput, rBaseURL, (EETextFormat)eFormat, pHTTPHeaderAttrs ); + ImplBlockInsertionCallbacks( sal_True ); + sal_uLong nRet = pEditEngine->Read( rInput, rBaseURL, (EETextFormat)eFormat, pHTTPHeaderAttrs ); - bFirstParaIsEmpty = FALSE; + bFirstParaIsEmpty = sal_False; - USHORT nParas = pEditEngine->GetParagraphCount(); - pParaList->Clear( TRUE ); - USHORT n; + sal_uInt16 nParas = pEditEngine->GetParagraphCount(); + pParaList->Clear( sal_True ); + sal_uInt16 n; for ( n = 0; n < nParas; n++ ) { Paragraph* pPara = new Paragraph( 0 ); @@ -1185,7 +1185,7 @@ ULONG Outliner::Read( SvStream& rInput, const String& rBaseURL, USHORT eFormat, const SfxItemSet& rAttrs = pEditEngine->GetParaAttribs( n ); const SfxInt16Item& rLevel = (const SfxInt16Item&) rAttrs.Get( EE_PARA_OUTLLEVEL ); sal_Int16 nDepth = rLevel.GetValue(); - ImplInitDepth( n, nDepth, FALSE ); + ImplInitDepth( n, nDepth, sal_False ); } } @@ -1194,7 +1194,7 @@ ULONG Outliner::Read( SvStream& rInput, const String& rBaseURL, USHORT eFormat, ImpFilterIndents( 0, nParas-1 ); } - ImplBlockInsertionCallbacks( FALSE ); + ImplBlockInsertionCallbacks( sal_False ); pEditEngine->SetUpdateMode( bUpdate ); EnableUndo( bOldUndo ); @@ -1202,15 +1202,15 @@ ULONG Outliner::Read( SvStream& rInput, const String& rBaseURL, USHORT eFormat, } -void Outliner::ImpFilterIndents( ULONG nFirstPara, ULONG nLastPara ) +void Outliner::ImpFilterIndents( sal_uLong nFirstPara, sal_uLong nLastPara ) { DBG_CHKTHIS(Outliner,0); - BOOL bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( FALSE ); + sal_Bool bUpdate = pEditEngine->GetUpdateMode(); + pEditEngine->SetUpdateMode( sal_False ); Paragraph* pLastConverted = NULL; - for( ULONG nPara = nFirstPara; nPara <= nLastPara; nPara++ ) + for( sal_uLong nPara = nFirstPara; nPara <= nLastPara; nPara++ ) { Paragraph* pPara = pParaList->GetParagraph( nPara ); if (pPara) @@ -1225,27 +1225,27 @@ void Outliner::ImpFilterIndents( ULONG nFirstPara, ULONG nLastPara ) pPara->SetDepth( pLastConverted->GetDepth() ); } - ImplInitDepth( (USHORT)nPara, pPara->GetDepth(), FALSE ); + ImplInitDepth( (sal_uInt16)nPara, pPara->GetDepth(), sal_False ); } } pEditEngine->SetUpdateMode( bUpdate ); } -SfxUndoManager& Outliner::GetUndoManager() +::svl::IUndoManager& Outliner::GetUndoManager() { DBG_CHKTHIS(Outliner,0); return pEditEngine->GetUndoManager(); } -void Outliner::ImpTextPasted( ULONG nStartPara, USHORT nCount ) +void Outliner::ImpTextPasted( sal_uLong nStartPara, sal_uInt16 nCount ) { DBG_CHKTHIS(Outliner,0); - BOOL bUpdate = pEditEngine->GetUpdateMode(); - pEditEngine->SetUpdateMode( FALSE ); + sal_Bool bUpdate = pEditEngine->GetUpdateMode(); + pEditEngine->SetUpdateMode( sal_False ); - const ULONG nStart = nStartPara; + const sal_uLong nStart = nStartPara; Paragraph* pPara = pParaList->GetParagraph( nStartPara ); @@ -1270,14 +1270,14 @@ void Outliner::ImpTextPasted( ULONG nStartPara, USHORT nCount ) else // EditEngine mode { sal_Int16 nDepth = -1; - const SfxItemSet& rAttrs = pEditEngine->GetParaAttribs( (USHORT)nStartPara ); + const SfxItemSet& rAttrs = pEditEngine->GetParaAttribs( (sal_uInt16)nStartPara ); if ( rAttrs.GetItemState( EE_PARA_OUTLLEVEL ) == SFX_ITEM_ON ) { const SfxInt16Item& rLevel = (const SfxInt16Item&) rAttrs.Get( EE_PARA_OUTLLEVEL ); nDepth = rLevel.GetValue(); } if ( nDepth != GetDepth( nStartPara ) ) - ImplInitDepth( (USHORT)nStartPara, nDepth, FALSE ); + ImplInitDepth( (sal_uInt16)nStartPara, nDepth, sal_False ); } nCount--; @@ -1298,7 +1298,7 @@ long Outliner::IndentingPagesHdl( OutlinerView* pView ) return aIndentingPagesHdl.Call( pView ); } -BOOL Outliner::ImpCanIndentSelectedPages( OutlinerView* pCurView ) +sal_Bool Outliner::ImpCanIndentSelectedPages( OutlinerView* pCurView ) { DBG_CHKTHIS(Outliner,0); // The selected pages must already be set in advance through @@ -1309,32 +1309,32 @@ BOOL Outliner::ImpCanIndentSelectedPages( OutlinerView* pCurView ) if ( ( mnFirstSelPage == 0 ) && ( ImplGetOutlinerMode() != OUTLINERMODE_TEXTOBJECT ) ) { if ( nDepthChangedHdlPrevDepth == 1 ) // is the only page - return FALSE; + return sal_False; else - pCurView->ImpCalcSelectedPages( FALSE ); // without the first + pCurView->ImpCalcSelectedPages( sal_False ); // without the first } - return (BOOL)IndentingPagesHdl( pCurView ); + return (sal_Bool)IndentingPagesHdl( pCurView ); } -BOOL Outliner::ImpCanDeleteSelectedPages( OutlinerView* pCurView ) +sal_Bool Outliner::ImpCanDeleteSelectedPages( OutlinerView* pCurView ) { DBG_CHKTHIS(Outliner,0); // The selected pages must already be set in advance through // ImpCalcSelectedPages - return (BOOL)RemovingPagesHdl( pCurView ); + return (sal_Bool)RemovingPagesHdl( pCurView ); } -Outliner::Outliner( SfxItemPool* pPool, USHORT nMode ) +Outliner::Outliner( SfxItemPool* pPool, sal_uInt16 nMode ) : nMinDepth( -1 ) { DBG_CTOR( Outliner, 0 ); - bStrippingPortions = FALSE; - bPasting = FALSE; + bStrippingPortions = sal_False; + bPasting = sal_False; nFirstPage = 1; - bBlockInsCallback = FALSE; + bBlockInsCallback = sal_False; nMaxDepth = 9; @@ -1342,7 +1342,7 @@ Outliner::Outliner( SfxItemPool* pPool, USHORT nMode ) pParaList->SetVisibleStateChangedHdl( LINK( this, Outliner, ParaVisibleStateChangedHdl ) ); Paragraph* pPara = new Paragraph( 0 ); pParaList->Append(pPara); - bFirstParaIsEmpty = TRUE; + bFirstParaIsEmpty = sal_True; pEditEngine = new OutlinerEditEng( this, pPool ); pEditEngine->SetBeginMovingParagraphsHdl( LINK( this, Outliner, BeginMovingParagraphsHdl ) ); @@ -1357,7 +1357,7 @@ Outliner::~Outliner() { DBG_DTOR(Outliner,0); - pParaList->Clear( TRUE ); + pParaList->Clear( sal_True ); delete pParaList; delete pEditEngine; } @@ -1378,7 +1378,7 @@ size_t Outliner::InsertView( OutlinerView* pView, size_t nIndex ) advance( it, nIndex ); ActualIndex = nIndex; } - pEditEngine->InsertView( pView->pEditView, (USHORT)nIndex ); + pEditEngine->InsertView( pView->pEditView, (sal_uInt16)nIndex ); return ActualIndex; } @@ -1403,10 +1403,10 @@ OutlinerView* Outliner::RemoveView( size_t nIndex ) { DBG_CHKTHIS(Outliner,0); - EditView* pEditView = pEditEngine->GetView( (USHORT)nIndex ); + EditView* pEditView = pEditEngine->GetView( (sal_uInt16)nIndex ); pEditView->HideCursor(); // HACK - pEditEngine->RemoveView( (USHORT)nIndex ); + pEditEngine->RemoveView( (sal_uInt16)nIndex ); { ViewList::iterator it = aViewList.begin(); @@ -1454,37 +1454,37 @@ void Outliner::DepthChangedHdl() } -ULONG Outliner::GetAbsPos( Paragraph* pPara ) +sal_uLong Outliner::GetAbsPos( Paragraph* pPara ) { DBG_CHKTHIS(Outliner,0); DBG_ASSERT(pPara,"GetAbsPos:No Para"); return pParaList->GetAbsPos( pPara ); } -ULONG Outliner::GetParagraphCount() const +sal_uLong Outliner::GetParagraphCount() const { DBG_CHKTHIS(Outliner,0); return pParaList->GetParagraphCount(); } -Paragraph* Outliner::GetParagraph( ULONG nAbsPos ) const +Paragraph* Outliner::GetParagraph( sal_uLong nAbsPos ) const { DBG_CHKTHIS(Outliner,0); return pParaList->GetParagraph( nAbsPos ); } -BOOL Outliner::HasChilds( Paragraph* pParagraph ) const +sal_Bool Outliner::HasChilds( Paragraph* pParagraph ) const { DBG_CHKTHIS(Outliner,0); return pParaList->HasChilds( pParagraph ); } -BOOL Outliner::ImplHasBullet( USHORT nPara ) const +sal_Bool Outliner::ImplHasBullet( sal_uInt16 nPara ) const { return GetNumberFormat(nPara) != 0; } -const SvxNumberFormat* Outliner::GetNumberFormat( USHORT nPara ) const +const SvxNumberFormat* Outliner::GetNumberFormat( sal_uInt16 nPara ) const { const SvxNumberFormat* pFmt = NULL; @@ -1504,7 +1504,7 @@ const SvxNumberFormat* Outliner::GetNumberFormat( USHORT nPara ) const return pFmt; } -Size Outliner::ImplGetBulletSize( USHORT nPara ) +Size Outliner::ImplGetBulletSize( sal_uInt16 nPara ) { Paragraph* pPara = pParaList->GetParagraph( nPara ); if (!pPara) @@ -1539,19 +1539,19 @@ Size Outliner::ImplGetBulletSize( USHORT nPara ) return pPara->aBulSize; } -void Outliner::ImplCheckParagraphs( USHORT nStart, USHORT nEnd ) +void Outliner::ImplCheckParagraphs( sal_uInt16 nStart, sal_uInt16 nEnd ) { DBG_CHKTHIS( Outliner, 0 ); // i100014# // assure that the following for-loop does not loop forever - for ( USHORT n = nStart; n < nEnd; n++ ) + for ( sal_uInt16 n = nStart; n < nEnd; n++ ) { Paragraph* pPara = pParaList->GetParagraph( n ); if (pPara) { pPara->Invalidate(); - ImplCalcBulletText( n, FALSE, FALSE ); + ImplCalcBulletText( n, sal_False, sal_False ); } } } @@ -1560,14 +1560,14 @@ void Outliner::SetRefDevice( OutputDevice* pRefDev ) { DBG_CHKTHIS(Outliner,0); pEditEngine->SetRefDevice( pRefDev ); - for ( USHORT n = (USHORT) pParaList->GetParagraphCount(); n; ) + for ( sal_uInt16 n = (sal_uInt16) pParaList->GetParagraphCount(); n; ) { Paragraph* pPara = pParaList->GetParagraph( --n ); pPara->Invalidate(); } } -void Outliner::ParaAttribsChanged( USHORT nPara ) +void Outliner::ParaAttribsChanged( sal_uInt16 nPara ) { DBG_CHKTHIS(Outliner,0); @@ -1584,7 +1584,7 @@ void Outliner::ParaAttribsChanged( USHORT nPara ) if ( pPara && pPara->GetDepth() != rLevel.GetValue() ) { pPara->SetDepth( rLevel.GetValue() ); - ImplCalcBulletText( nPara, TRUE, TRUE ); + ImplCalcBulletText( nPara, sal_True, sal_True ); } } } @@ -1598,13 +1598,13 @@ void Outliner::StyleSheetChanged( SfxStyleSheet* pStyle ) // Here all the paragraphs, which had the said template, used to be // hunted by a ImpRecalcParaAttribs, why? // => only the Bullet-representation can really change... - USHORT nParas = (USHORT)pParaList->GetParagraphCount(); - for( USHORT nPara = 0; nPara < nParas; nPara++ ) + sal_uInt16 nParas = (sal_uInt16)pParaList->GetParagraphCount(); + for( sal_uInt16 nPara = 0; nPara < nParas; nPara++ ) { if ( pEditEngine->GetStyleSheet( nPara ) == pStyle ) { ImplCheckNumBulletItem( nPara ); - ImplCalcBulletText( nPara, FALSE, FALSE ); + ImplCalcBulletText( nPara, sal_False, sal_False ); // EditEngine formats changed paragraphs before calling this method, // so they are not reformatted now and use wrong bullet indent pEditEngine->QuickMarkInvalid( ESelection( nPara, 0, nPara, 0 ) ); @@ -1612,7 +1612,7 @@ void Outliner::StyleSheetChanged( SfxStyleSheet* pStyle ) } } -Rectangle Outliner::ImpCalcBulletArea( USHORT nPara, BOOL bAdjust, BOOL bReturnPaperPos ) +Rectangle Outliner::ImpCalcBulletArea( sal_uInt16 nPara, sal_Bool bAdjust, sal_Bool bReturnPaperPos ) { // Bullet area within the paragraph ... Rectangle aBulletArea; @@ -1623,7 +1623,7 @@ Rectangle Outliner::ImpCalcBulletArea( USHORT nPara, BOOL bAdjust, BOOL bReturnP Point aTopLeft; Size aBulletSize( ImplGetBulletSize( nPara ) ); - BOOL bOutlineMode = ( pEditEngine->GetControlWord() & EE_CNTRL_OUTLINER ) != 0; + sal_Bool bOutlineMode = ( pEditEngine->GetControlWord() & EE_CNTRL_OUTLINER ) != 0; // the ODF attribut text:space-before which holds the spacing to add to the left of the label const short nSpaceBefore = pFmt->GetAbsLSpace() + pFmt->GetFirstLineOffset(); @@ -1720,7 +1720,7 @@ void Outliner::ExpandHdl() aExpandHdl.Call( this ); } -EBulletInfo Outliner::GetBulletInfo( USHORT nPara ) +EBulletInfo Outliner::GetBulletInfo( sal_uInt16 nPara ) { EBulletInfo aInfo; @@ -1747,53 +1747,53 @@ EBulletInfo Outliner::GetBulletInfo( USHORT nPara ) if ( aInfo.bVisible ) { - aInfo.aBounds = ImpCalcBulletArea( nPara, TRUE, TRUE ); + aInfo.aBounds = ImpCalcBulletArea( nPara, sal_True, sal_True ); } return aInfo; } -XubString Outliner::GetText( Paragraph* pParagraph, ULONG nCount ) const +XubString Outliner::GetText( Paragraph* pParagraph, sal_uLong nCount ) const { DBG_CHKTHIS(Outliner,0); XubString aText; - USHORT nStartPara = (USHORT) pParaList->GetAbsPos( pParagraph ); - for ( USHORT n = 0; n < nCount; n++ ) + sal_uInt16 nStartPara = (sal_uInt16) pParaList->GetAbsPos( pParagraph ); + for ( sal_uInt16 n = 0; n < nCount; n++ ) { aText += pEditEngine->GetText( nStartPara + n ); - if ( (n+1) < (USHORT)nCount ) + if ( (n+1) < (sal_uInt16)nCount ) aText += '\n'; } return aText; } -void Outliner::Remove( Paragraph* pPara, ULONG nParaCount ) +void Outliner::Remove( Paragraph* pPara, sal_uLong nParaCount ) { DBG_CHKTHIS(Outliner,0); - ULONG nPos = pParaList->GetAbsPos( pPara ); + sal_uLong nPos = pParaList->GetAbsPos( pPara ); if( !nPos && ( nParaCount >= pParaList->GetParagraphCount() ) ) { Clear(); } else { - for( USHORT n = 0; n < (USHORT)nParaCount; n++ ) - pEditEngine->RemoveParagraph( (USHORT) nPos ); + for( sal_uInt16 n = 0; n < (sal_uInt16)nParaCount; n++ ) + pEditEngine->RemoveParagraph( (sal_uInt16) nPos ); } } void Outliner::StripPortions() { DBG_CHKTHIS(Outliner,0); - bStrippingPortions = TRUE; + bStrippingPortions = sal_True; pEditEngine->StripPortions(); - bStrippingPortions = FALSE; + bStrippingPortions = sal_False; } -void Outliner::DrawingText( const Point& rStartPos, const XubString& rText, USHORT nTextStart, USHORT nTextLen, const sal_Int32* pDXArray,const SvxFont& rFont, - USHORT nPara, USHORT nIndex, BYTE nRightToLeft, +void Outliner::DrawingText( const Point& rStartPos, const XubString& rText, sal_uInt16 nTextStart, sal_uInt16 nTextLen, const sal_Int32* pDXArray,const SvxFont& rFont, + sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt8 nRightToLeft, const EEngineData::WrongSpellVector* pWrongSpellVector, const SvxFieldData* pFieldData, bool bEndOfLine, @@ -1830,20 +1830,20 @@ void Outliner::DrawingTab( const Point& rStartPos, long nWidth, const String& rC long Outliner::RemovingPagesHdl( OutlinerView* pView ) { DBG_CHKTHIS(Outliner,0); - return aRemovingPagesHdl.IsSet() ? aRemovingPagesHdl.Call( pView ) : TRUE; + return aRemovingPagesHdl.IsSet() ? aRemovingPagesHdl.Call( pView ) : sal_True; } -BOOL Outliner::ImpCanDeleteSelectedPages( OutlinerView* pCurView, USHORT _nFirstPage, USHORT nPages ) +sal_Bool Outliner::ImpCanDeleteSelectedPages( OutlinerView* pCurView, sal_uInt16 _nFirstPage, sal_uInt16 nPages ) { DBG_CHKTHIS(Outliner,0); nDepthChangedHdlPrevDepth = nPages; mnFirstSelPage = _nFirstPage; pHdlParagraph = 0; - return (BOOL)RemovingPagesHdl( pCurView ); + return (sal_Bool)RemovingPagesHdl( pCurView ); } -SfxItemSet Outliner::GetParaAttribs( USHORT nPara ) +SfxItemSet Outliner::GetParaAttribs( sal_uInt16 nPara ) { DBG_CHKTHIS(Outliner,0); return pEditEngine->GetParaAttribs( nPara ); @@ -1853,8 +1853,8 @@ IMPL_LINK( Outliner, ParaVisibleStateChangedHdl, Paragraph*, pPara ) { DBG_CHKTHIS(Outliner,0); - ULONG nPara = pParaList->GetAbsPos( pPara ); - pEditEngine->ShowParagraph( (USHORT)nPara, pPara->IsVisible() ); + sal_uLong nPara = pParaList->GetAbsPos( pPara ); + pEditEngine->ShowParagraph( (sal_uInt16)nPara, pPara->IsVisible() ); return 0; } @@ -1878,7 +1878,7 @@ IMPL_LINK( Outliner, BeginPasteOrDropHdl, PasteOrDropInfos*, pInfos ) IMPL_LINK( Outliner, EndPasteOrDropHdl, PasteOrDropInfos*, pInfos ) { - bPasting = FALSE; + bPasting = sal_False; ImpTextPasted( pInfos->nStartPara, pInfos->nEndPara - pInfos->nStartPara + 1 ); maEndPasteOrDropHdl.Call( pInfos ); UndoActionEnd( EDITUNDO_DRAGANDDROP ); @@ -1890,10 +1890,10 @@ IMPL_LINK( Outliner, EndMovingParagraphsHdl, MoveParagraphsInfo*, pInfos ) DBG_CHKTHIS(Outliner,0); pParaList->MoveParagraphs( pInfos->nStartPara, pInfos->nDestPara, pInfos->nEndPara - pInfos->nStartPara + 1 ); - USHORT nChangesStart = Min( pInfos->nStartPara, pInfos->nDestPara ); - USHORT nParas = (USHORT)pParaList->GetParagraphCount(); - for ( USHORT n = nChangesStart; n < nParas; n++ ) - ImplCalcBulletText( n, FALSE, FALSE ); + sal_uInt16 nChangesStart = Min( pInfos->nStartPara, pInfos->nDestPara ); + sal_uInt16 nParas = (sal_uInt16)pParaList->GetParagraphCount(); + for ( sal_uInt16 n = nChangesStart; n < nParas; n++ ) + ImplCalcBulletText( n, sal_False, sal_False ); if( !IsInUndo() ) aEndMovingHdl.Call( this ); @@ -1915,7 +1915,7 @@ static bool isSameNumbering( const SvxNumberFormat& rN1, const SvxNumberFormat& return true; } -sal_uInt16 Outliner::ImplGetNumbering( USHORT nPara, const SvxNumberFormat* pParaFmt ) +sal_uInt16 Outliner::ImplGetNumbering( sal_uInt16 nPara, const SvxNumberFormat* pParaFmt ) { sal_uInt16 nNumber = pParaFmt->GetStart() - 1; @@ -1963,12 +1963,12 @@ sal_uInt16 Outliner::ImplGetNumbering( USHORT nPara, const SvxNumberFormat* pPar return nNumber; } -void Outliner::ImplCalcBulletText( USHORT nPara, BOOL bRecalcLevel, BOOL bRecalcChilds ) +void Outliner::ImplCalcBulletText( sal_uInt16 nPara, sal_Bool bRecalcLevel, sal_Bool bRecalcChilds ) { DBG_CHKTHIS(Outliner,0); Paragraph* pPara = pParaList->GetParagraph( nPara ); - USHORT nRelPos = 0xFFFF; + sal_uInt16 nRelPos = 0xFFFF; while ( pPara ) { @@ -2022,12 +2022,12 @@ void Outliner::Clear() if( !bFirstParaIsEmpty ) { - ImplBlockInsertionCallbacks( TRUE ); + ImplBlockInsertionCallbacks( sal_True ); pEditEngine->Clear(); - pParaList->Clear( TRUE ); + pParaList->Clear( sal_True ); pParaList->Append( new Paragraph( nMinDepth )); - bFirstParaIsEmpty = TRUE; - ImplBlockInsertionCallbacks( FALSE ); + bFirstParaIsEmpty = sal_True; + ImplBlockInsertionCallbacks( sal_False ); } else { @@ -2037,20 +2037,20 @@ void Outliner::Clear() } } -void Outliner::SetFlatMode( BOOL bFlat ) +void Outliner::SetFlatMode( sal_Bool bFlat ) { DBG_CHKTHIS(Outliner,0); if( bFlat != pEditEngine->IsFlatMode() ) { - for ( USHORT nPara = (USHORT)pParaList->GetParagraphCount(); nPara; ) + for ( sal_uInt16 nPara = (sal_uInt16)pParaList->GetParagraphCount(); nPara; ) pParaList->GetParagraph( --nPara )->aBulSize.Width() = -1; pEditEngine->SetFlatMode( bFlat ); } } -String Outliner::ImplGetBulletText( USHORT nPara ) +String Outliner::ImplGetBulletText( sal_uInt16 nPara ) { String aRes; Paragraph* pPara = pParaList->GetParagraph( nPara ); @@ -2058,14 +2058,14 @@ String Outliner::ImplGetBulletText( USHORT nPara ) { // Enable optimization again ... // if( pPara->nFlags & PARAFLAG_SETBULLETTEXT ) - ImplCalcBulletText( nPara, FALSE, FALSE ); + ImplCalcBulletText( nPara, sal_False, sal_False ); aRes = pPara->GetText(); } return aRes; } // this is needed for StarOffice Api -void Outliner::SetLevelDependendStyleSheet( USHORT nPara ) +void Outliner::SetLevelDependendStyleSheet( sal_uInt16 nPara ) { SfxItemSet aOldAttrs( pEditEngine->GetParaAttribs( nPara ) ); ImplSetLevelDependendStyleSheet( nPara ); @@ -2074,7 +2074,7 @@ void Outliner::SetLevelDependendStyleSheet( USHORT nPara ) SV_IMPL_PTRARR( NotifyList, EENotifyPtr ); -void Outliner::ImplBlockInsertionCallbacks( BOOL b ) +void Outliner::ImplBlockInsertionCallbacks( sal_Bool b ) { if ( b ) { @@ -2187,7 +2187,7 @@ sal_Bool DrawPortionInfo::IsRTL() const nError = U_ZERO_ERROR; // I do not have this info here. Is it necessary? I'll have to ask MT. - const BYTE nDefaultDir = UBIDI_LTR; //IsRightToLeft( nPara ) ? UBIDI_RTL : UBIDI_LTR; + const sal_uInt8 nDefaultDir = UBIDI_LTR; //IsRightToLeft( nPara ) ? UBIDI_RTL : UBIDI_LTR; ubidi_setPara(pBidi, reinterpret_cast<const UChar *>(mrText.GetBuffer()), mrText.Len(), nDefaultDir, NULL, &nError); // UChar != sal_Unicode in MinGW nError = U_ZERO_ERROR; diff --git a/editeng/source/outliner/outliner.src b/editeng/source/outliner/outliner.src index 42f8195407bd..42f8195407bd 100644..100755 --- a/editeng/source/outliner/outliner.src +++ b/editeng/source/outliner/outliner.src diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx index b57ec1be337f..b57ec1be337f 100644..100755 --- a/editeng/source/outliner/outlobj.cxx +++ b/editeng/source/outliner/outlobj.cxx diff --git a/editeng/source/outliner/outlundo.cxx b/editeng/source/outliner/outlundo.cxx index 9b3c720d11ec..3767d9ac68d6 100644..100755 --- a/editeng/source/outliner/outlundo.cxx +++ b/editeng/source/outliner/outlundo.cxx @@ -42,7 +42,7 @@ #include <outlundo.hxx> -OutlinerUndoBase::OutlinerUndoBase( USHORT _nId, Outliner* pOutliner ) +OutlinerUndoBase::OutlinerUndoBase( sal_uInt16 _nId, Outliner* pOutliner ) : EditUndo( _nId, NULL ) { DBG_ASSERT( pOutliner, "Undo: Outliner?!" ); @@ -112,7 +112,7 @@ void OutlinerUndoChangeParaNumberingRestart::ImplApplyData( const ParaRestartDat pOutliner->SetParaIsNumberingRestart( mnPara, rData.mbParaIsNumberingRestart ); } -OutlinerUndoChangeDepth::OutlinerUndoChangeDepth( Outliner* pOutliner, USHORT nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth ) +OutlinerUndoChangeDepth::OutlinerUndoChangeDepth( Outliner* pOutliner, sal_uInt16 nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth ) : OutlinerUndoBase( OLUNDO_DEPTH, pOutliner ) { mnPara = nPara; @@ -122,12 +122,12 @@ OutlinerUndoChangeDepth::OutlinerUndoChangeDepth( Outliner* pOutliner, USHORT nP void OutlinerUndoChangeDepth::Undo() { - GetOutliner()->ImplInitDepth( mnPara, mnOldDepth, FALSE ); + GetOutliner()->ImplInitDepth( mnPara, mnOldDepth, sal_False ); } void OutlinerUndoChangeDepth::Redo() { - GetOutliner()->ImplInitDepth( mnPara, mnNewDepth, FALSE ); + GetOutliner()->ImplInitDepth( mnPara, mnNewDepth, sal_False ); } void OutlinerUndoChangeDepth::Repeat() @@ -136,7 +136,7 @@ void OutlinerUndoChangeDepth::Repeat() } -OutlinerUndoCheckPara::OutlinerUndoCheckPara( Outliner* pOutliner, USHORT nPara ) +OutlinerUndoCheckPara::OutlinerUndoCheckPara( Outliner* pOutliner, sal_uInt16 nPara ) : OutlinerUndoBase( OLUNDO_DEPTH, pOutliner ) { mnPara = nPara; @@ -146,14 +146,14 @@ void OutlinerUndoCheckPara::Undo() { Paragraph* pPara = GetOutliner()->GetParagraph( mnPara ); pPara->Invalidate(); - GetOutliner()->ImplCalcBulletText( mnPara, FALSE, FALSE ); + GetOutliner()->ImplCalcBulletText( mnPara, sal_False, sal_False ); } void OutlinerUndoCheckPara::Redo() { Paragraph* pPara = GetOutliner()->GetParagraph( mnPara ); pPara->Invalidate(); - GetOutliner()->ImplCalcBulletText( mnPara, FALSE, FALSE ); + GetOutliner()->ImplCalcBulletText( mnPara, sal_False, sal_False ); } void OutlinerUndoCheckPara::Repeat() @@ -163,7 +163,7 @@ void OutlinerUndoCheckPara::Repeat() DBG_NAME(OLUndoExpand); -OLUndoExpand::OLUndoExpand(Outliner* pOut, USHORT _nId ) +OLUndoExpand::OLUndoExpand(Outliner* pOut, sal_uInt16 _nId ) : EditUndo( _nId, 0 ) { DBG_CTOR(OLUndoExpand,0); @@ -181,20 +181,20 @@ OLUndoExpand::~OLUndoExpand() } -void OLUndoExpand::Restore( BOOL bUndo ) +void OLUndoExpand::Restore( sal_Bool bUndo ) { DBG_CHKTHIS(OLUndoExpand,0); DBG_ASSERT(pOutliner,"Undo:No Outliner"); DBG_ASSERT(pOutliner->pEditEngine,"Outliner already deleted"); Paragraph* pPara; - BOOL bExpand = FALSE; - USHORT _nId = GetId(); + sal_Bool bExpand = sal_False; + sal_uInt16 _nId = GetId(); if((_nId == OLUNDO_EXPAND && !bUndo) || (_nId == OLUNDO_COLLAPSE && bUndo)) - bExpand = TRUE; + bExpand = sal_True; if( !pParas ) { - pPara = pOutliner->GetParagraph( (ULONG)nCount ); + pPara = pOutliner->GetParagraph( (sal_uLong)nCount ); if( bExpand ) pOutliner->Expand( pPara ); else @@ -202,9 +202,9 @@ void OLUndoExpand::Restore( BOOL bUndo ) } else { - for( USHORT nIdx = 0; nIdx < nCount; nIdx++ ) + for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++ ) { - pPara = pOutliner->GetParagraph( (ULONG)(pParas[nIdx]) ); + pPara = pOutliner->GetParagraph( (sal_uLong)(pParas[nIdx]) ); if( bExpand ) pOutliner->Expand( pPara ); else @@ -217,14 +217,14 @@ void OLUndoExpand::Restore( BOOL bUndo ) void OLUndoExpand::Undo() { DBG_CHKTHIS(OLUndoExpand,0); - Restore( TRUE ); + Restore( sal_True ); } void OLUndoExpand::Redo() { DBG_CHKTHIS(OLUndoExpand,0); - Restore( FALSE ); + Restore( sal_False ); } diff --git a/editeng/source/outliner/outlundo.hxx b/editeng/source/outliner/outlundo.hxx index a6c04490abc0..5b49b0f64bde 100644 --- a/editeng/source/outliner/outlundo.hxx +++ b/editeng/source/outliner/outlundo.hxx @@ -39,7 +39,7 @@ private: Outliner* mpOutliner; public: - OutlinerUndoBase( USHORT nId, Outliner* pOutliner ); + OutlinerUndoBase( sal_uInt16 nId, Outliner* pOutliner ); Outliner* GetOutliner() const { return mpOutliner; } }; @@ -88,12 +88,12 @@ class OutlinerUndoChangeDepth : public OutlinerUndoBase { using SfxUndoAction::Repeat; private: - USHORT mnPara; + sal_uInt16 mnPara; sal_Int16 mnOldDepth; sal_Int16 mnNewDepth; public: - OutlinerUndoChangeDepth( Outliner* pOutliner, USHORT nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth ); + OutlinerUndoChangeDepth( Outliner* pOutliner, sal_uInt16 nPara, sal_Int16 nOldDepth, sal_Int16 nNewDepth ); virtual void Undo(); virtual void Redo(); @@ -107,10 +107,10 @@ class OutlinerUndoCheckPara : public OutlinerUndoBase { using SfxUndoAction::Repeat; private: - USHORT mnPara; + sal_uInt16 mnPara; public: - OutlinerUndoCheckPara( Outliner* pOutliner, USHORT nPara ); + OutlinerUndoCheckPara( Outliner* pOutliner, sal_uInt16 nPara ); virtual void Undo(); virtual void Redo(); @@ -125,17 +125,17 @@ public: class OLUndoExpand : public EditUndo { using SfxUndoAction::Repeat; - void Restore( BOOL bUndo ); + void Restore( sal_Bool bUndo ); public: - OLUndoExpand( Outliner* pOut, USHORT nId ); + OLUndoExpand( Outliner* pOut, sal_uInt16 nId ); ~OLUndoExpand(); virtual void Undo(); virtual void Redo(); virtual void Repeat(); - USHORT* pParas; // 0 == nCount contains paragraph number + sal_uInt16* pParas; // 0 == nCount contains paragraph number Outliner* pOutliner; - USHORT nCount; + sal_uInt16 nCount; }; #endif diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index ff66af048c18..fed48c72ec66 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -76,8 +76,8 @@ OutlinerView::OutlinerView( Outliner* pOut, Window* pWin ) DBG_CTOR( OutlinerView, 0 ); pOwner = pOut; - bDDCursorVisible = FALSE; - bInDragMode = FALSE; + bDDCursorVisible = sal_False; + bInDragMode = sal_False; nDDScrollLRBorderWidthWin = 0; nDDScrollTBBorderWidthWin = 0; pHorTabArrDoc = 0; @@ -104,7 +104,7 @@ void OutlinerView::Paint( const Rectangle& rRect ) pEditView->Paint( rRect ); } -BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) +sal_Bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) { DBG_CHKTHIS( OutlinerView, 0 ); @@ -114,18 +114,18 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) pOwner->Insert( String() ); - BOOL bKeyProcessed = FALSE; + sal_Bool bKeyProcessed = sal_False; ESelection aSel( pEditView->GetSelection() ); - BOOL bSelection = aSel.HasRange(); + sal_Bool bSelection = aSel.HasRange(); KeyCode aKeyCode = rKEvt.GetKeyCode(); KeyFuncType eFunc = aKeyCode.GetFunction(); - USHORT nCode = aKeyCode.GetCode(); - BOOL bReadOnly = IsReadOnly(); + sal_uInt16 nCode = aKeyCode.GetCode(); + sal_Bool bReadOnly = IsReadOnly(); if( bSelection && ( nCode != KEY_TAB ) && EditEngine::DoesKeyChangeText( rKEvt ) ) { - if ( ImpCalcSelectedPages( FALSE ) && !pOwner->ImpCanDeleteSelectedPages( this ) ) - return TRUE; + if ( ImpCalcSelectedPages( sal_False ) && !pOwner->ImpCanDeleteSelectedPages( this ) ) + return sal_True; } if ( eFunc != KEYFUNC_DONTKNOW ) @@ -137,14 +137,14 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) if ( !bReadOnly ) { Cut(); - bKeyProcessed = TRUE; + bKeyProcessed = sal_True; } } break; case KEYFUNC_COPY: { Copy(); - bKeyProcessed = TRUE; + bKeyProcessed = sal_True; } break; case KEYFUNC_PASTE: @@ -152,7 +152,7 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) if ( !bReadOnly ) { PasteSpecial(); - bKeyProcessed = TRUE; + bKeyProcessed = sal_True; } } break; @@ -166,7 +166,7 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) if( pNext && pNext->HasFlag(PARAFLAG_ISPAGE) ) { if( !pOwner->ImpCanDeleteSelectedPages( this, aSel.nEndPara, 1 ) ) - return FALSE; + return sal_False; } } } @@ -189,13 +189,13 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) ( bSelection || !aSel.nStartPos ) ) { Indent( aKeyCode.IsShift() ? (-1) : (+1) ); - bKeyProcessed = TRUE; + bKeyProcessed = sal_True; } else if ( ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_TEXTOBJECT ) && !bSelection && !aSel.nEndPos && pOwner->ImplHasBullet( aSel.nEndPara ) ) { Indent( aKeyCode.IsShift() ? (-1) : (+1) ); - bKeyProcessed = TRUE; + bKeyProcessed = sal_True; } } } @@ -207,11 +207,11 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) Paragraph* pPara = pOwner->pParaList->GetParagraph( aSel.nEndPara ); Paragraph* pPrev = pOwner->pParaList->GetParagraph( aSel.nEndPara-1 ); if( !pPrev->IsVisible() ) - return TRUE; + return sal_True; if( !pPara->GetDepth() ) { if(!pOwner->ImpCanDeleteSelectedPages(this, aSel.nEndPara , 1 ) ) - return TRUE; + return sal_True; } } } @@ -230,20 +230,20 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) if( !bSelection && aSel.nEndPos == pOwner->pEditEngine->GetTextLen( aSel.nEndPara ) ) { - ULONG nChilds = pOwner->pParaList->GetChildCount(pPara); + sal_uLong nChilds = pOwner->pParaList->GetChildCount(pPara); if( nChilds && !pOwner->pParaList->HasVisibleChilds(pPara)) { pOwner->UndoActionStart( OLUNDO_INSERT ); - ULONG nTemp = aSel.nEndPara; + sal_uLong nTemp = aSel.nEndPara; nTemp += nChilds; nTemp++; // insert above next Non-Child pOwner->Insert( String(),nTemp,pPara->GetDepth()); // Position the cursor - ESelection aTmpSel((USHORT)nTemp,0,(USHORT)nTemp,0); + ESelection aTmpSel((sal_uInt16)nTemp,0,(sal_uInt16)nTemp,0); pEditView->SetSelection( aTmpSel ); - pEditView->ShowCursor( TRUE, TRUE ); + pEditView->ShowCursor( sal_True, sal_True ); pOwner->UndoActionEnd( OLUNDO_INSERT ); - bKeyProcessed = TRUE; + bKeyProcessed = sal_True; } } } @@ -252,16 +252,16 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) ( aSel.nEndPos == pOwner->pEditEngine->GetTextLen(aSel.nEndPara) ) ) { pOwner->UndoActionStart( OLUNDO_INSERT ); - ULONG nTemp = aSel.nEndPara; + sal_uLong nTemp = aSel.nEndPara; nTemp++; pOwner->Insert( String(), nTemp, pPara->GetDepth()+1 ); // Position the cursor - ESelection aTmpSel((USHORT)nTemp,0,(USHORT)nTemp,0); + ESelection aTmpSel((sal_uInt16)nTemp,0,(sal_uInt16)nTemp,0); pEditView->SetSelection( aTmpSel ); - pEditView->ShowCursor( TRUE, TRUE ); + pEditView->ShowCursor( sal_True, sal_True ); pOwner->UndoActionEnd( OLUNDO_INSERT ); - bKeyProcessed = TRUE; + bKeyProcessed = sal_True; } } } @@ -269,14 +269,18 @@ BOOL OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin ) } } +<<<<<<< HEAD return bKeyProcessed ? TRUE : pEditView->PostKeyEvent( rKEvt, pFrameWin ); +======= + return bKeyProcessed ? sal_True : pEditView->PostKeyEvent( rKEvt ); +>>>>>>> ooo/DEV300_m101 } -ULONG OutlinerView::ImpCheckMousePos(const Point& rPosPix, MouseTarget& reTarget) +sal_uLong OutlinerView::ImpCheckMousePos(const Point& rPosPix, MouseTarget& reTarget) { DBG_CHKTHIS(OutlinerView,0); - ULONG nPara = EE_PARA_NOT_FOUND; + sal_uLong nPara = EE_PARA_NOT_FOUND; Point aMousePosWin = pEditView->GetWindow()->PixelToLogic( rPosPix ); if( !pEditView->GetOutputArea().IsInside( aMousePosWin ) ) @@ -295,7 +299,7 @@ ULONG OutlinerView::ImpCheckMousePos(const Point& rPosPix, MouseTarget& reTarget aPaperPos.Y() -= aOutArea.Top(); aPaperPos.Y() += aVisArea.Top(); - BOOL bBullet; + sal_Bool bBullet; if ( pOwner->IsTextPos( aPaperPos, 0, &bBullet ) ) { Point aDocPos = pOwner->GetDocPos( aPaperPos ); @@ -317,7 +321,11 @@ ULONG OutlinerView::ImpCheckMousePos(const Point& rPosPix, MouseTarget& reTarget return nPara; } +<<<<<<< HEAD BOOL OutlinerView::MouseMove( const MouseEvent& rMEvt ) +======= +sal_Bool __EXPORT OutlinerView::MouseMove( const MouseEvent& rMEvt ) +>>>>>>> ooo/DEV300_m101 { DBG_CHKTHIS(OutlinerView,0); @@ -326,7 +334,7 @@ BOOL OutlinerView::MouseMove( const MouseEvent& rMEvt ) Point aMousePosWin( pEditView->GetWindow()->PixelToLogic( rMEvt.GetPosPixel() ) ); if( !pEditView->GetOutputArea().IsInside( aMousePosWin ) ) - return FALSE; + return sal_False; Pointer aPointer = GetPointer( rMEvt.GetPosPixel() ); pEditView->GetWindow()->SetPointer( aPointer ); @@ -334,7 +342,11 @@ BOOL OutlinerView::MouseMove( const MouseEvent& rMEvt ) } +<<<<<<< HEAD BOOL OutlinerView::MouseButtonDown( const MouseEvent& rMEvt ) +======= +sal_Bool __EXPORT OutlinerView::MouseButtonDown( const MouseEvent& rMEvt ) +>>>>>>> ooo/DEV300_m101 { DBG_CHKTHIS(OutlinerView,0); if ( ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_TEXTOBJECT ) || pEditView->GetEditEngine()->IsInSelectionMode() ) @@ -342,24 +354,29 @@ BOOL OutlinerView::MouseButtonDown( const MouseEvent& rMEvt ) Point aMousePosWin( pEditView->GetWindow()->PixelToLogic( rMEvt.GetPosPixel() ) ); if( !pEditView->GetOutputArea().IsInside( aMousePosWin ) ) - return FALSE; + return sal_False; Pointer aPointer = GetPointer( rMEvt.GetPosPixel() ); pEditView->GetWindow()->SetPointer( aPointer ); MouseTarget eTarget; - ULONG nPara = ImpCheckMousePos( rMEvt.GetPosPixel(), eTarget ); + sal_uLong nPara = ImpCheckMousePos( rMEvt.GetPosPixel(), eTarget ); if ( eTarget == MouseBullet ) { Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); - BOOL bHasChilds = (pPara && pOwner->pParaList->HasChilds(pPara)); + sal_Bool bHasChilds = (pPara && pOwner->pParaList->HasChilds(pPara)); if( rMEvt.GetClicks() == 1 ) { - ULONG nEndPara = nPara; + sal_uLong nEndPara = nPara; if ( bHasChilds && pOwner->pParaList->HasVisibleChilds(pPara) ) nEndPara += pOwner->pParaList->GetChildCount( pPara ); +<<<<<<< HEAD // The selection is inverted, so that EditEngine does not scroll ESelection aSel((USHORT)nEndPara, 0xffff,(USHORT)nPara, 0 ); +======= + // umgekehrt rum selektieren, damit EditEngine nicht scrollt + ESelection aSel((sal_uInt16)nEndPara, 0xffff,(sal_uInt16)nPara, 0 ); +>>>>>>> ooo/DEV300_m101 pEditView->SetSelection( aSel ); } else if( rMEvt.GetClicks() == 2 && bHasChilds ) @@ -367,7 +384,7 @@ BOOL OutlinerView::MouseButtonDown( const MouseEvent& rMEvt ) aDDStartPosPix = rMEvt.GetPosPixel(); aDDStartPosRef=pEditView->GetWindow()->PixelToLogic( aDDStartPosPix,pOwner->GetRefMapMode()); - return TRUE; + return sal_True; } // special case for outliner view in impress, check if double click hits the page icon for toggle @@ -385,7 +402,11 @@ BOOL OutlinerView::MouseButtonDown( const MouseEvent& rMEvt ) } +<<<<<<< HEAD BOOL OutlinerView::MouseButtonUp( const MouseEvent& rMEvt ) +======= +sal_Bool __EXPORT OutlinerView::MouseButtonUp( const MouseEvent& rMEvt ) +>>>>>>> ooo/DEV300_m101 { DBG_CHKTHIS(OutlinerView,0); if ( ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_TEXTOBJECT ) || pEditView->GetEditEngine()->IsInSelectionMode() ) @@ -393,7 +414,7 @@ BOOL OutlinerView::MouseButtonUp( const MouseEvent& rMEvt ) Point aMousePosWin( pEditView->GetWindow()->PixelToLogic( rMEvt.GetPosPixel() ) ); if( !pEditView->GetOutputArea().IsInside( aMousePosWin ) ) - return FALSE; + return sal_False; Pointer aPointer = GetPointer( rMEvt.GetPosPixel() ); pEditView->GetWindow()->SetPointer( aPointer ); @@ -406,7 +427,7 @@ void OutlinerView::ImpHideDDCursor() DBG_CHKTHIS(OutlinerView,0); if ( bDDCursorVisible ) { - bDDCursorVisible = FALSE; + bDDCursorVisible = sal_False; ImpPaintDDCursor(); } } @@ -416,7 +437,7 @@ void OutlinerView::ImpShowDDCursor() DBG_CHKTHIS(OutlinerView,0); if ( !bDDCursorVisible ) { - bDDCursorVisible = TRUE; + bDDCursorVisible = sal_True; ImpPaintDDCursor(); } } @@ -445,16 +466,16 @@ void OutlinerView::ImpPaintDDCursor() } else { - ULONG nPara = nDDCurPara; + sal_uLong nPara = nDDCurPara; if ( nDDCurPara == LIST_APPEND ) { Paragraph* pTemp = pOwner->pParaList->LastVisible(); nPara = pOwner->pParaList->GetAbsPos( pTemp ); } - aStartPointWin = pEditView->GetWindowPosTopLeft((USHORT) nPara ); + aStartPointWin = pEditView->GetWindowPosTopLeft((sal_uInt16) nPara ); if ( nDDCurPara == LIST_APPEND ) { - long nHeight = pOwner->pEditEngine->GetTextHeight((USHORT)nPara ); + long nHeight = pOwner->pEditEngine->GetTextHeight((sal_uInt16)nPara ); aStartPointWin.Y() += nHeight; } aStartPointWin.X() = aOutputArWin.Left(); @@ -469,10 +490,10 @@ void OutlinerView::ImpPaintDDCursor() // Calculates above which paragraph must it must be inserted -ULONG OutlinerView::ImpGetInsertionPara( const Point& rPosPixel ) +sal_uLong OutlinerView::ImpGetInsertionPara( const Point& rPosPixel ) { DBG_CHKTHIS(OutlinerView,0); - ULONG nCurPara = pEditView->GetParagraph( rPosPixel ); + sal_uLong nCurPara = pEditView->GetParagraph( rPosPixel ); ParagraphList* pParaList = pOwner->pParaList; if ( nCurPara == EE_PARA_NOT_FOUND ) @@ -480,8 +501,8 @@ ULONG OutlinerView::ImpGetInsertionPara( const Point& rPosPixel ) else { Point aPosWin = pEditView->GetWindow()->PixelToLogic( rPosPixel ); - Point aParaPosWin = pEditView->GetWindowPosTopLeft((USHORT)nCurPara); - long nHeightRef = pOwner->pEditEngine->GetTextHeight((USHORT)nCurPara); + Point aParaPosWin = pEditView->GetWindowPosTopLeft((sal_uInt16)nCurPara); + long nHeightRef = pOwner->pEditEngine->GetTextHeight((sal_uInt16)nCurPara); long nParaYOffs = aPosWin.Y() - aParaPosWin.Y(); if ( nParaYOffs > nHeightRef / 2 ) @@ -499,7 +520,7 @@ void OutlinerView::ImpToggleExpand( Paragraph* pPara ) { DBG_CHKTHIS(OutlinerView,0); - USHORT nPara = (USHORT) pOwner->pParaList->GetAbsPos( pPara ); + sal_uInt16 nPara = (sal_uInt16) pOwner->pParaList->GetAbsPos( pPara ); pEditView->SetSelection( ESelection( nPara, 0, nPara, 0 ) ); ImplExpandOrCollaps( nPara, nPara, !pOwner->pParaList->HasVisibleChilds( pPara ) ); pEditView->ShowCursor(); @@ -515,21 +536,21 @@ void OutlinerView::SetOutliner( Outliner* pOutliner ) -ULONG OutlinerView::Select( Paragraph* pParagraph, BOOL bSelect, - BOOL bWithChilds ) +sal_uLong OutlinerView::Select( Paragraph* pParagraph, sal_Bool bSelect, + sal_Bool bWithChilds ) { DBG_CHKTHIS(OutlinerView,0); - ULONG nPara = pOwner->pParaList->GetAbsPos( pParagraph ); - USHORT nEnd = 0; + sal_uLong nPara = pOwner->pParaList->GetAbsPos( pParagraph ); + sal_uInt16 nEnd = 0; if ( bSelect ) nEnd = 0xffff; - ULONG nChildCount = 0; + sal_uLong nChildCount = 0; if ( bWithChilds ) nChildCount = pOwner->pParaList->GetChildCount( pParagraph ); - ESelection aSel( (USHORT)nPara, 0,(USHORT)(nPara+nChildCount), nEnd ); + ESelection aSel( (sal_uInt16)nPara, 0,(sal_uInt16)(nPara+nChildCount), nEnd ); pEditView->SetSelection( aSel ); return nChildCount+1; } @@ -539,16 +560,17 @@ void OutlinerView::SetAttribs( const SfxItemSet& rAttrs ) { DBG_CHKTHIS(OutlinerView,0); - BOOL bUpdate = pOwner->pEditEngine->GetUpdateMode(); - pOwner->pEditEngine->SetUpdateMode( FALSE ); + sal_Bool bUpdate = pOwner->pEditEngine->GetUpdateMode(); + pOwner->pEditEngine->SetUpdateMode( sal_False ); if( !pOwner->IsInUndo() && pOwner->IsUndoEnabled() ) pOwner->UndoActionStart( OLUNDO_ATTR ); - ParaRange aSel = ImpGetSelectedParagraphs( FALSE ); + ParaRange aSel = ImpGetSelectedParagraphs( sal_False ); pEditView->SetAttribs( rAttrs ); +<<<<<<< HEAD // Update Bullet text for( USHORT nPara= aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) { @@ -556,6 +578,13 @@ void OutlinerView::SetAttribs( const SfxItemSet& rAttrs ) // update following paras as well, numbering depends on // previous paras pOwner->ImplCalcBulletText( nPara, TRUE, FALSE ); +======= + // Bullet-Texte aktualisieren + for( sal_uInt16 nPara= aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) + { + pOwner->ImplCheckNumBulletItem( nPara ); + pOwner->ImplCalcBulletText( nPara, sal_False, sal_False ); +>>>>>>> ooo/DEV300_m101 if( !pOwner->IsInUndo() && pOwner->IsUndoEnabled() ) pOwner->InsertUndo( new OutlinerUndoCheckPara( pOwner, nPara ) ); @@ -567,7 +596,7 @@ void OutlinerView::SetAttribs( const SfxItemSet& rAttrs ) pEditView->SetEditEngineUpdateMode( bUpdate ); } -ParaRange OutlinerView::ImpGetSelectedParagraphs( BOOL bIncludeHiddenChilds ) +ParaRange OutlinerView::ImpGetSelectedParagraphs( sal_Bool bIncludeHiddenChilds ) { DBG_CHKTHIS( OutlinerView, 0 ); @@ -581,7 +610,7 @@ ParaRange OutlinerView::ImpGetSelectedParagraphs( BOOL bIncludeHiddenChilds ) Paragraph* pLast = pOwner->pParaList->GetParagraph( aParas.nEndPara ); if ( pOwner->pParaList->HasHiddenChilds( pLast ) ) aParas.nEndPara = - sal::static_int_cast< USHORT >( + sal::static_int_cast< sal_uInt16 >( aParas.nEndPara + pOwner->pParaList->GetChildCount( pLast ) ); } @@ -598,22 +627,22 @@ void OutlinerView::Indent( short nDiff ) { DBG_CHKTHIS( OutlinerView, 0 ); - if( !nDiff || ( ( nDiff > 0 ) && ImpCalcSelectedPages( TRUE ) && !pOwner->ImpCanIndentSelectedPages( this ) ) ) + if( !nDiff || ( ( nDiff > 0 ) && ImpCalcSelectedPages( sal_True ) && !pOwner->ImpCanIndentSelectedPages( this ) ) ) return; const bool bOutlinerView = pOwner->pEditEngine->GetControlWord() & EE_CNTRL_OUTLINER; - BOOL bUpdate = pOwner->pEditEngine->GetUpdateMode(); - pOwner->pEditEngine->SetUpdateMode( FALSE ); + sal_Bool bUpdate = pOwner->pEditEngine->GetUpdateMode(); + pOwner->pEditEngine->SetUpdateMode( sal_False ); - BOOL bUndo = !pOwner->IsInUndo() && pOwner->IsUndoEnabled(); + sal_Bool bUndo = !pOwner->IsInUndo() && pOwner->IsUndoEnabled(); if( bUndo ) pOwner->UndoActionStart( OLUNDO_DEPTH ); sal_Int16 nMinDepth = -1; // Optimization: Not to recalculate to manny parargaphs when not really needed. - ParaRange aSel = ImpGetSelectedParagraphs( TRUE ); - for ( USHORT nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) + ParaRange aSel = ImpGetSelectedParagraphs( sal_True ); + for ( sal_uInt16 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) { Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); @@ -694,8 +723,8 @@ void OutlinerView::Indent( short nDiff ) pOwner->mnDepthChangeHdlPrevFlags = pPara->nFlags; pOwner->pHdlParagraph = pPara; - pOwner->ImplInitDepth( nPara, nNewDepth, TRUE, FALSE ); - pOwner->ImplCalcBulletText( nPara, FALSE, FALSE ); + pOwner->ImplInitDepth( nPara, nNewDepth, sal_True, sal_False ); + pOwner->ImplCalcBulletText( nPara, sal_False, sal_False ); if ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT ) pOwner->ImplSetLevelDependendStyleSheet( nPara ); @@ -710,18 +739,29 @@ void OutlinerView::Indent( short nDiff ) } } +<<<<<<< HEAD USHORT nParas = (USHORT)pOwner->pParaList->GetParagraphCount(); for ( USHORT n = aSel.nEndPara+1; n < nParas; n++ ) +======= + // MT 19.08.99: War mal fuer Optimierung (outliner.cxx#1.193), + // hat aber zu zuviel Wartungsaufwand / doppelten Funktionen gefuehrt + // und zu wenig gebracht: + // pOwner->ImpSetBulletTextsFrom( aSel.nStartPara+1, nMinDepth ); + // Wird jetzt direkt in Schleife mit ImplCalcBulletText() erledigt. + // Jetzt fehlen nur noch die folgenden Ansaetze, die davon betroffen sind. + sal_uInt16 nParas = (sal_uInt16)pOwner->pParaList->GetParagraphCount(); + for ( sal_uInt16 n = aSel.nEndPara+1; n < nParas; n++ ) +>>>>>>> ooo/DEV300_m101 { Paragraph* pPara = pOwner->pParaList->GetParagraph( n ); if ( pPara->GetDepth() < nMinDepth ) break; - pOwner->ImplCalcBulletText( n, FALSE, FALSE ); + pOwner->ImplCalcBulletText( n, sal_False, sal_False ); } if ( bUpdate ) { - pEditView->SetEditEngineUpdateMode( TRUE ); + pEditView->SetEditEngineUpdateMode( sal_True ); pEditView->ShowCursor(); } @@ -729,33 +769,33 @@ void OutlinerView::Indent( short nDiff ) pOwner->UndoActionEnd( OLUNDO_DEPTH ); } -BOOL OutlinerView::AdjustHeight( long nDY ) +sal_Bool OutlinerView::AdjustHeight( long nDY ) { DBG_CHKTHIS(OutlinerView,0); pEditView->MoveParagraphs( nDY ); - return TRUE; // remove return value... + return sal_True; // remove return value... } -void OutlinerView::AdjustDepth( Paragraph* pPara, short nDX, BOOL bWithChilds) +void OutlinerView::AdjustDepth( Paragraph* pPara, short nDX, sal_Bool bWithChilds) { DBG_CHKTHIS(OutlinerView,0); - ULONG nStartPara = pOwner->pParaList->GetAbsPos( pPara ); - ULONG nEndPara = nStartPara; + sal_uLong nStartPara = pOwner->pParaList->GetAbsPos( pPara ); + sal_uLong nEndPara = nStartPara; if ( bWithChilds ) nEndPara += pOwner->pParaList->GetChildCount( pPara ); - ESelection aSel((USHORT)nStartPara, 0,(USHORT)nEndPara, 0xffff ); + ESelection aSel((sal_uInt16)nStartPara, 0,(sal_uInt16)nEndPara, 0xffff ); pEditView->SetSelection( aSel ); AdjustDepth( nDX ); } -void OutlinerView::AdjustHeight( Paragraph* pPara, long nDY, BOOL bWithChilds ) +void OutlinerView::AdjustHeight( Paragraph* pPara, long nDY, sal_Bool bWithChilds ) { DBG_CHKTHIS(OutlinerView,0); - ULONG nStartPara = pOwner->pParaList->GetAbsPos( pPara ); - ULONG nEndPara = nStartPara; + sal_uLong nStartPara = pOwner->pParaList->GetAbsPos( pPara ); + sal_uLong nEndPara = nStartPara; if ( bWithChilds ) nEndPara += pOwner->pParaList->GetChildCount( pPara ); - ESelection aSel( (USHORT)nStartPara, 0, (USHORT)nEndPara, 0xffff ); + ESelection aSel( (sal_uInt16)nStartPara, 0, (sal_uInt16)nEndPara, 0xffff ); pEditView->SetSelection( aSel ); AdjustHeight( nDY ); } @@ -896,47 +936,47 @@ void OutlinerView::ImpScrollUp() void OutlinerView::Expand() { DBG_CHKTHIS( OutlinerView, 0 ); - ParaRange aParas = ImpGetSelectedParagraphs( FALSE ); - ImplExpandOrCollaps( aParas.nStartPara, aParas.nEndPara, TRUE ); + ParaRange aParas = ImpGetSelectedParagraphs( sal_False ); + ImplExpandOrCollaps( aParas.nStartPara, aParas.nEndPara, sal_True ); } void OutlinerView::Collapse() { DBG_CHKTHIS( OutlinerView, 0 ); - ParaRange aParas = ImpGetSelectedParagraphs( FALSE ); - ImplExpandOrCollaps( aParas.nStartPara, aParas.nEndPara, FALSE ); + ParaRange aParas = ImpGetSelectedParagraphs( sal_False ); + ImplExpandOrCollaps( aParas.nStartPara, aParas.nEndPara, sal_False ); } void OutlinerView::ExpandAll() { DBG_CHKTHIS( OutlinerView, 0 ); - ImplExpandOrCollaps( 0, (USHORT)(pOwner->pParaList->GetParagraphCount()-1), TRUE ); + ImplExpandOrCollaps( 0, (sal_uInt16)(pOwner->pParaList->GetParagraphCount()-1), sal_True ); } void OutlinerView::CollapseAll() { DBG_CHKTHIS(OutlinerView,0); - ImplExpandOrCollaps( 0, (USHORT)(pOwner->pParaList->GetParagraphCount()-1), FALSE ); + ImplExpandOrCollaps( 0, (sal_uInt16)(pOwner->pParaList->GetParagraphCount()-1), sal_False ); } -void OutlinerView::ImplExpandOrCollaps( USHORT nStartPara, USHORT nEndPara, BOOL bExpand ) +void OutlinerView::ImplExpandOrCollaps( sal_uInt16 nStartPara, sal_uInt16 nEndPara, sal_Bool bExpand ) { DBG_CHKTHIS( OutlinerView, 0 ); - BOOL bUpdate = pOwner->GetUpdateMode(); - pOwner->SetUpdateMode( FALSE ); + sal_Bool bUpdate = pOwner->GetUpdateMode(); + pOwner->SetUpdateMode( sal_False ); - BOOL bUndo = !pOwner->IsInUndo() && pOwner->IsUndoEnabled(); + sal_Bool bUndo = !pOwner->IsInUndo() && pOwner->IsUndoEnabled(); if( bUndo ) pOwner->UndoActionStart( bExpand ? OLUNDO_EXPAND : OLUNDO_COLLAPSE ); - for ( USHORT nPara = nStartPara; nPara <= nEndPara; nPara++ ) + for ( sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++ ) { Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); - BOOL bDone = bExpand ? pOwner->Expand( pPara ) : pOwner->Collapse( pPara ); + sal_Bool bDone = bExpand ? pOwner->Expand( pPara ) : pOwner->Collapse( pPara ); if( bDone ) { // The line under the paragraph should disappear ... @@ -949,7 +989,7 @@ void OutlinerView::ImplExpandOrCollaps( USHORT nStartPara, USHORT nEndPara, BOOL if ( bUpdate ) { - pOwner->SetUpdateMode( TRUE ); + pOwner->SetUpdateMode( sal_True ); pEditView->ShowCursor(); } } @@ -981,22 +1021,22 @@ void OutlinerView::InsertText( const OutlinerParaObject& rParaObj ) DBG_CHKTHIS(OutlinerView,0); - if ( ImpCalcSelectedPages( FALSE ) && !pOwner->ImpCanDeleteSelectedPages( this ) ) + if ( ImpCalcSelectedPages( sal_False ) && !pOwner->ImpCanDeleteSelectedPages( this ) ) return; pOwner->UndoActionStart( OLUNDO_INSERT ); - pOwner->pEditEngine->SetUpdateMode( FALSE ); - ULONG nStart, nParaCount; + pOwner->pEditEngine->SetUpdateMode( sal_False ); + sal_uLong nStart, nParaCount; nParaCount = pOwner->pEditEngine->GetParagraphCount(); - USHORT nSize = ImpInitPaste( nStart ); + sal_uInt16 nSize = ImpInitPaste( nStart ); pEditView->InsertText( rParaObj.GetTextObject() ); ImpPasted( nStart, nParaCount, nSize); - pEditView->SetEditEngineUpdateMode( TRUE ); + pEditView->SetEditEngineUpdateMode( sal_True ); pOwner->UndoActionEnd( OLUNDO_INSERT ); - pEditView->ShowCursor( TRUE, TRUE ); + pEditView->ShowCursor( sal_True, sal_True ); } @@ -1004,7 +1044,7 @@ void OutlinerView::InsertText( const OutlinerParaObject& rParaObj ) void OutlinerView::Cut() { DBG_CHKTHIS(OutlinerView,0); - if ( !ImpCalcSelectedPages( FALSE ) || pOwner->ImpCanDeleteSelectedPages( this ) ) + if ( !ImpCalcSelectedPages( sal_False ) || pOwner->ImpCanDeleteSelectedPages( this ) ) pEditView->Cut(); } @@ -1017,25 +1057,25 @@ void OutlinerView::Paste() void OutlinerView::PasteSpecial() { DBG_CHKTHIS(OutlinerView,0); - if ( !ImpCalcSelectedPages( FALSE ) || pOwner->ImpCanDeleteSelectedPages( this ) ) + if ( !ImpCalcSelectedPages( sal_False ) || pOwner->ImpCanDeleteSelectedPages( this ) ) { pOwner->UndoActionStart( OLUNDO_INSERT ); - pOwner->pEditEngine->SetUpdateMode( FALSE ); - pOwner->bPasting = TRUE; + pOwner->pEditEngine->SetUpdateMode( sal_False ); + pOwner->bPasting = sal_True; pEditView->PasteSpecial(); if ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT ) { - const USHORT nParaCount = pOwner->pEditEngine->GetParagraphCount(); + const sal_uInt16 nParaCount = pOwner->pEditEngine->GetParagraphCount(); - for( USHORT nPara = 0; nPara < nParaCount; nPara++ ) + for( sal_uInt16 nPara = 0; nPara < nParaCount; nPara++ ) pOwner->ImplSetLevelDependendStyleSheet( nPara ); } - pEditView->SetEditEngineUpdateMode( TRUE ); + pEditView->SetEditEngineUpdateMode( sal_True ); pOwner->UndoActionEnd( OLUNDO_INSERT ); - pEditView->ShowCursor( TRUE, TRUE ); + pEditView->ShowCursor( sal_True, sal_True ); } } @@ -1043,9 +1083,9 @@ List* OutlinerView::CreateSelectionList() { DBG_CHKTHIS( OutlinerView, 0 ); - ParaRange aParas = ImpGetSelectedParagraphs( TRUE ); + ParaRange aParas = ImpGetSelectedParagraphs( sal_True ); List* pSelList = new List; - for ( USHORT nPara = aParas.nStartPara; nPara <= aParas.nEndPara; nPara++ ) + for ( sal_uInt16 nPara = aParas.nStartPara; nPara <= aParas.nEndPara; nPara++ ) { Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); pSelList->Insert( pPara, LIST_APPEND ); @@ -1064,11 +1104,11 @@ void OutlinerView::SetStyleSheet( SfxStyleSheet* pStyle ) DBG_CHKTHIS(OutlinerView,0); pEditView->SetStyleSheet( pStyle ); - ParaRange aSel = ImpGetSelectedParagraphs( TRUE ); - for( USHORT nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) + ParaRange aSel = ImpGetSelectedParagraphs( sal_True ); + for( sal_uInt16 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) { pOwner->ImplCheckNumBulletItem( nPara ); - pOwner->ImplCalcBulletText( nPara, FALSE, FALSE ); + pOwner->ImplCalcBulletText( nPara, sal_False, sal_False ); } } @@ -1097,28 +1137,28 @@ Pointer OutlinerView::GetPointer( const Point& rPosPixel ) } -USHORT OutlinerView::ImpInitPaste( ULONG& rStart ) +sal_uInt16 OutlinerView::ImpInitPaste( sal_uLong& rStart ) { DBG_CHKTHIS(OutlinerView,0); - pOwner->bPasting = TRUE; + pOwner->bPasting = sal_True; ESelection aSelection( pEditView->GetSelection() ); aSelection.Adjust(); rStart = aSelection.nStartPara; - USHORT nSize = aSelection.nEndPara - aSelection.nStartPara + 1; + sal_uInt16 nSize = aSelection.nEndPara - aSelection.nStartPara + 1; return nSize; } -void OutlinerView::ImpPasted( ULONG nStart, ULONG nPrevParaCount, USHORT nSize) +void OutlinerView::ImpPasted( sal_uLong nStart, sal_uLong nPrevParaCount, sal_uInt16 nSize) { DBG_CHKTHIS(OutlinerView,0); - pOwner->bPasting = FALSE; - ULONG nCurParaCount = (ULONG)pOwner->pEditEngine->GetParagraphCount(); + pOwner->bPasting = sal_False; + sal_uLong nCurParaCount = (sal_uLong)pOwner->pEditEngine->GetParagraphCount(); if( nCurParaCount < nPrevParaCount ) - nSize = sal::static_int_cast< USHORT >( + nSize = sal::static_int_cast< sal_uInt16 >( nSize - ( nPrevParaCount - nCurParaCount ) ); else - nSize = sal::static_int_cast< USHORT >( + nSize = sal::static_int_cast< sal_uInt16 >( nSize + ( nCurParaCount - nPrevParaCount ) ); pOwner->ImpTextPasted( nStart, nSize ); } @@ -1131,31 +1171,36 @@ void OutlinerView::Command( const CommandEvent& rCEvt ) } -void OutlinerView::SelectRange( ULONG nFirst, USHORT nCount ) +void OutlinerView::SelectRange( sal_uLong nFirst, sal_uInt16 nCount ) { DBG_CHKTHIS(OutlinerView,0); - ULONG nLast = nFirst+nCount; - nCount = (USHORT)pOwner->pParaList->GetParagraphCount(); + sal_uLong nLast = nFirst+nCount; + nCount = (sal_uInt16)pOwner->pParaList->GetParagraphCount(); if( nLast <= nCount ) nLast = nCount - 1; - ESelection aSel( (USHORT)nFirst, 0, (USHORT)nLast, 0xffff ); + ESelection aSel( (sal_uInt16)nFirst, 0, (sal_uInt16)nLast, 0xffff ); pEditView->SetSelection( aSel ); } -USHORT OutlinerView::ImpCalcSelectedPages( BOOL bIncludeFirstSelected ) +sal_uInt16 OutlinerView::ImpCalcSelectedPages( sal_Bool bIncludeFirstSelected ) { DBG_CHKTHIS(OutlinerView,0); ESelection aSel( pEditView->GetSelection() ); aSel.Adjust(); - USHORT nPages = 0; - USHORT nFirstPage = 0xFFFF; - USHORT nStartPara = aSel.nStartPara; + sal_uInt16 nPages = 0; + sal_uInt16 nFirstPage = 0xFFFF; + sal_uInt16 nStartPara = aSel.nStartPara; if ( !bIncludeFirstSelected ) +<<<<<<< HEAD nStartPara++; // All paragraphs after StartPara will be deleted for ( USHORT nPara = nStartPara; nPara <= aSel.nEndPara; nPara++ ) +======= + nStartPara++; // alle nach StartPara kommenden Absaetze werden geloescht + for ( sal_uInt16 nPara = nStartPara; nPara <= aSel.nEndPara; nPara++ ) +>>>>>>> ooo/DEV300_m101 { Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); DBG_ASSERT(pPara, "ImpCalcSelectedPages: invalid Selection? "); @@ -1186,11 +1231,11 @@ void OutlinerView::ToggleBullets() aSel.Adjust(); const bool bUpdate = pOwner->pEditEngine->GetUpdateMode(); - pOwner->pEditEngine->SetUpdateMode( FALSE ); + pOwner->pEditEngine->SetUpdateMode( sal_False ); sal_Int16 nDepth = -2; - for ( USHORT nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) + for ( sal_uInt16 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) { Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); DBG_ASSERT(pPara, "OutlinerView::ToggleBullets(), illegal selection?"); @@ -1217,8 +1262,14 @@ void OutlinerView::ToggleBullets() // #i100014# // It is not a good idea to substract 1 from a count and cast the result +<<<<<<< HEAD // to USHORT without check, if the count is 0. USHORT nParaCount = (USHORT) (pOwner->pParaList->GetParagraphCount()); +======= + // to sal_uInt16 without check, if the count is 0. + sal_uInt16 nParaCount = (sal_uInt16) (pOwner->pParaList->GetParagraphCount()); + // <-- +>>>>>>> ooo/DEV300_m101 pOwner->ImplCheckParagraphs( aSel.nStartPara, nParaCount ); pOwner->pEditEngine->QuickMarkInvalid( ESelection( aSel.nStartPara, 0, nParaCount, 0 ) ); @@ -1235,9 +1286,9 @@ void OutlinerView::EnableBullets() aSel.Adjust(); const bool bUpdate = pOwner->pEditEngine->GetUpdateMode(); - pOwner->pEditEngine->SetUpdateMode( FALSE ); + pOwner->pEditEngine->SetUpdateMode( sal_False ); - for ( USHORT nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) + for ( sal_uInt16 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) { Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); DBG_ASSERT(pPara, "OutlinerView::ToggleBullets(), illegal selection?"); @@ -1250,8 +1301,14 @@ void OutlinerView::EnableBullets() // #i100014# // It is not a good idea to substract 1 from a count and cast the result +<<<<<<< HEAD // to USHORT without check, if the count is 0. USHORT nParaCount = (USHORT) (pOwner->pParaList->GetParagraphCount()); +======= + // to sal_uInt16 without check, if the count is 0. + sal_uInt16 nParaCount = (sal_uInt16) (pOwner->pParaList->GetParagraphCount()); + // <-- +>>>>>>> ooo/DEV300_m101 pOwner->ImplCheckParagraphs( aSel.nStartPara, nParaCount ); pOwner->pEditEngine->QuickMarkInvalid( ESelection( aSel.nStartPara, 0, nParaCount, 0 ) ); @@ -1261,16 +1318,16 @@ void OutlinerView::EnableBullets() } -void OutlinerView::RemoveAttribsKeepLanguages( BOOL bRemoveParaAttribs ) +void OutlinerView::RemoveAttribsKeepLanguages( sal_Bool bRemoveParaAttribs ) { - RemoveAttribs( bRemoveParaAttribs, 0, TRUE /*keep language attribs*/ ); + RemoveAttribs( bRemoveParaAttribs, 0, sal_True /*keep language attribs*/ ); } -void OutlinerView::RemoveAttribs( BOOL bRemoveParaAttribs, USHORT nWhich, BOOL bKeepLanguages ) +void OutlinerView::RemoveAttribs( sal_Bool bRemoveParaAttribs, sal_uInt16 nWhich, sal_Bool bKeepLanguages ) { DBG_CHKTHIS(OutlinerView,0); - BOOL bUpdate = pOwner->GetUpdateMode(); - pOwner->SetUpdateMode( FALSE ); + sal_Bool bUpdate = pOwner->GetUpdateMode(); + pOwner->SetUpdateMode( sal_False ); pOwner->UndoActionStart( OLUNDO_ATTR ); if (bKeepLanguages) pEditView->RemoveAttribsKeepLanguages( bRemoveParaAttribs ); @@ -1281,10 +1338,10 @@ void OutlinerView::RemoveAttribs( BOOL bRemoveParaAttribs, USHORT nWhich, BOOL b // Loop through all paragraphs and set indentation and level ESelection aSel = pEditView->GetSelection(); aSel.Adjust(); - for ( USHORT nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) + for ( sal_uInt16 nPara = aSel.nStartPara; nPara <= aSel.nEndPara; nPara++ ) { Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); - pOwner->ImplInitDepth( nPara, pPara->GetDepth(), FALSE, FALSE ); + pOwner->ImplInitDepth( nPara, pPara->GetDepth(), sal_False, sal_False ); } } pOwner->UndoActionEnd( OLUNDO_ATTR ); @@ -1298,7 +1355,7 @@ void OutlinerView::RemoveAttribs( BOOL bRemoveParaAttribs, USHORT nWhich, BOOL b // ====================================================================== -void OutlinerView::InsertText( const XubString& rNew, BOOL bSelect ) +void OutlinerView::InsertText( const XubString& rNew, sal_Bool bSelect ) { DBG_CHKTHIS(OutlinerView,0); if( pOwner->bFirstParaIsEmpty ) @@ -1319,26 +1376,26 @@ void OutlinerView::SetSelection( const ESelection& rSel ) pEditView->SetSelection( rSel ); } -void OutlinerView::SetReadOnly( BOOL bReadOnly ) +void OutlinerView::SetReadOnly( sal_Bool bReadOnly ) { DBG_CHKTHIS(OutlinerView,0); pEditView->SetReadOnly( bReadOnly ); } -BOOL OutlinerView::IsReadOnly() const +sal_Bool OutlinerView::IsReadOnly() const { DBG_CHKTHIS(OutlinerView,0); return pEditView->IsReadOnly(); } -BOOL OutlinerView::HasSelection() const +sal_Bool OutlinerView::HasSelection() const { DBG_CHKTHIS(OutlinerView,0); return pEditView->HasSelection(); } -void OutlinerView::ShowCursor( BOOL bGotoCursor ) +void OutlinerView::ShowCursor( sal_Bool bGotoCursor ) { DBG_CHKTHIS(OutlinerView,0); pEditView->ShowCursor( bGotoCursor ); @@ -1387,10 +1444,10 @@ XubString OutlinerView::GetSelected() const } -void OutlinerView::RemoveCharAttribs( ULONG nPara, USHORT nWhich) +void OutlinerView::RemoveCharAttribs( sal_uLong nPara, sal_uInt16 nWhich) { DBG_CHKTHIS(OutlinerView,0); - pEditView->RemoveCharAttribs( (USHORT)nPara, nWhich); + pEditView->RemoveCharAttribs( (sal_uInt16)nPara, nWhich); } @@ -1401,7 +1458,7 @@ void OutlinerView::CompleteAutoCorrect() } -EESpellState OutlinerView::StartSpeller( BOOL bMultiDoc ) +EESpellState OutlinerView::StartSpeller( sal_Bool bMultiDoc ) { DBG_CHKTHIS(OutlinerView,0); return pEditView->StartSpeller( bMultiDoc ); @@ -1417,7 +1474,7 @@ EESpellState OutlinerView::StartThesaurus() void OutlinerView::StartTextConversion( LanguageType nSrcLang, LanguageType nDestLang, const Font *pDestFont, - INT32 nOptions, BOOL bIsInteractive, BOOL bMultipleDoc ) + sal_Int32 nOptions, sal_Bool bIsInteractive, sal_Bool bMultipleDoc ) { DBG_CHKTHIS(OutlinerView,0); if ( @@ -1435,7 +1492,7 @@ void OutlinerView::StartTextConversion( } -USHORT OutlinerView::StartSearchAndReplace( const SvxSearchItem& rSearchItem ) +sal_uInt16 OutlinerView::StartSearchAndReplace( const SvxSearchItem& rSearchItem ) { DBG_CHKTHIS(OutlinerView,0); return pEditView->StartSearchAndReplace( rSearchItem ); @@ -1463,14 +1520,14 @@ void OutlinerView::Scroll( long nHorzScroll, long nVertScroll ) } -void OutlinerView::SetControlWord( ULONG nWord ) +void OutlinerView::SetControlWord( sal_uLong nWord ) { DBG_CHKTHIS(OutlinerView,0); pEditView->SetControlWord( nWord ); } -ULONG OutlinerView::GetControlWord() const +sal_uLong OutlinerView::GetControlWord() const { DBG_CHKTHIS(OutlinerView,0); return pEditView->GetControlWord(); @@ -1505,7 +1562,7 @@ void OutlinerView::Redo() } -void OutlinerView::EnablePaste( BOOL bEnable ) +void OutlinerView::EnablePaste( sal_Bool bEnable ) { DBG_CHKTHIS(OutlinerView,0); pEditView->EnablePaste( bEnable ); @@ -1533,7 +1590,7 @@ const SvxFieldItem* OutlinerView::GetFieldUnderMousePointer() const } -const SvxFieldItem* OutlinerView::GetFieldUnderMousePointer( USHORT& nPara, USHORT& nPos ) const +const SvxFieldItem* OutlinerView::GetFieldUnderMousePointer( sal_uInt16& nPara, sal_uInt16& nPos ) const { DBG_CHKTHIS(OutlinerView,0); return pEditView->GetFieldUnderMousePointer( nPara, nPos ); @@ -1546,28 +1603,28 @@ const SvxFieldItem* OutlinerView::GetFieldAtSelection() const return pEditView->GetFieldAtSelection(); } -void OutlinerView::SetInvalidateMore( USHORT nPixel ) +void OutlinerView::SetInvalidateMore( sal_uInt16 nPixel ) { DBG_CHKTHIS(OutlinerView,0); pEditView->SetInvalidateMore( nPixel ); } -USHORT OutlinerView::GetInvalidateMore() const +sal_uInt16 OutlinerView::GetInvalidateMore() const { DBG_CHKTHIS(OutlinerView,0); return pEditView->GetInvalidateMore(); } -BOOL OutlinerView::IsCursorAtWrongSpelledWord( BOOL bMarkIfWrong ) +sal_Bool OutlinerView::IsCursorAtWrongSpelledWord( sal_Bool bMarkIfWrong ) { DBG_CHKTHIS(OutlinerView,0); return pEditView->IsCursorAtWrongSpelledWord( bMarkIfWrong ); } -BOOL OutlinerView::IsWrongSpelledWordAtPos( const Point& rPosPixel, BOOL bMarkIfWrong ) +sal_Bool OutlinerView::IsWrongSpelledWordAtPos( const Point& rPosPixel, sal_Bool bMarkIfWrong ) { DBG_CHKTHIS(OutlinerView,0); return pEditView->IsWrongSpelledWordAtPos( rPosPixel, bMarkIfWrong ); @@ -1587,28 +1644,28 @@ void OutlinerView::ExecuteSpellPopup( const Point& rPosPixel, Link* pStartDlg ) pEditView->ExecuteSpellPopup( rPosPixel, pStartDlg ); } -ULONG OutlinerView::Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, BOOL bSelect, SvKeyValueIterator* pHTTPHeaderAttrs ) +sal_uLong OutlinerView::Read( SvStream& rInput, const String& rBaseURL, EETextFormat eFormat, sal_Bool bSelect, SvKeyValueIterator* pHTTPHeaderAttrs ) { DBG_CHKTHIS(OutlinerView,0); - USHORT nOldParaCount = pEditView->GetEditEngine()->GetParagraphCount(); + sal_uInt16 nOldParaCount = pEditView->GetEditEngine()->GetParagraphCount(); ESelection aOldSel = pEditView->GetSelection(); aOldSel.Adjust(); - ULONG nRet = pEditView->Read( rInput, rBaseURL, eFormat, bSelect, pHTTPHeaderAttrs ); + sal_uLong nRet = pEditView->Read( rInput, rBaseURL, eFormat, bSelect, pHTTPHeaderAttrs ); long nParaDiff = pEditView->GetEditEngine()->GetParagraphCount() - nOldParaCount; - USHORT nChangesStart = aOldSel.nStartPara; - USHORT nChangesEnd = sal::static_int_cast< USHORT >(nChangesStart + nParaDiff + (aOldSel.nEndPara-aOldSel.nStartPara)); + sal_uInt16 nChangesStart = aOldSel.nStartPara; + sal_uInt16 nChangesEnd = sal::static_int_cast< sal_uInt16 >(nChangesStart + nParaDiff + (aOldSel.nEndPara-aOldSel.nStartPara)); - for ( USHORT n = nChangesStart; n <= nChangesEnd; n++ ) + for ( sal_uInt16 n = nChangesStart; n <= nChangesEnd; n++ ) { if ( eFormat == EE_FORMAT_BIN ) { - USHORT nDepth = 0; + sal_uInt16 nDepth = 0; const SfxItemSet& rAttrs = pOwner->GetParaAttribs( n ); const SfxInt16Item& rLevel = (const SfxInt16Item&) rAttrs.Get( EE_PARA_OUTLLEVEL ); nDepth = rLevel.GetValue(); - pOwner->ImplInitDepth( n, nDepth, FALSE ); + pOwner->ImplInitDepth( n, nDepth, sal_False ); } if ( pOwner->ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEOBJECT ) @@ -1623,7 +1680,7 @@ ULONG OutlinerView::Read( SvStream& rInput, const String& rBaseURL, EETextForma return nRet; } -ULONG OutlinerView::Write( SvStream& rOutput, EETextFormat eFormat ) +sal_uLong OutlinerView::Write( SvStream& rOutput, EETextFormat eFormat ) { DBG_CHKTHIS(OutlinerView,0); return pEditView->Write( rOutput, eFormat ); @@ -1648,7 +1705,7 @@ SfxItemSet OutlinerView::GetAttribs() return pEditView->GetAttribs(); } -USHORT OutlinerView::GetSelectedScriptType() const +sal_uInt16 OutlinerView::GetSelectedScriptType() const { DBG_CHKTHIS(OutlinerView,0); return pEditView->GetSelectedScriptType(); diff --git a/editeng/source/outliner/paralist.cxx b/editeng/source/outliner/paralist.cxx index ee7d518b4137..f8ac32e115e4 100644 --- a/editeng/source/outliner/paralist.cxx +++ b/editeng/source/outliner/paralist.cxx @@ -76,7 +76,7 @@ Paragraph::Paragraph( sal_Int16 nDDepth ) nDepth = nDDepth; nFlags = 0; - bVisible = TRUE; + bVisible = sal_True; } Paragraph::Paragraph( const Paragraph& rPara ) @@ -94,7 +94,7 @@ Paragraph::Paragraph( const Paragraph& rPara ) Paragraph::Paragraph( const ParagraphData& rData ) : nFlags( 0 ) , aBulSize( -1, -1) -, bVisible( TRUE ) +, bVisible( sal_True ) { DBG_CTOR( Paragraph, 0 ); @@ -122,7 +122,7 @@ void Paragraph::SetParaIsNumberingRestart( sal_Bool bParaIsNumberingRestart ) mnNumberingStartValue = -1; } -void ParagraphList::Clear( BOOL bDestroyParagraphs ) +void ParagraphList::Clear( sal_Bool bDestroyParagraphs ) { if ( bDestroyParagraphs ) { @@ -153,7 +153,7 @@ void ParagraphList::Remove( ULONG nPara ) maEntries.erase(maEntries.begin() + nPara ); } -void ParagraphList::MoveParagraphs( ULONG nStart, ULONG nDest, ULONG _nCount ) +void ParagraphList::MoveParagraphs( sal_uLong nStart, sal_uLong nDest, sal_uLong _nCount ) { OSL_ASSERT(nStart < maEntries.size() && nDest < maEntries.size()); @@ -185,7 +185,6 @@ Paragraph* ParagraphList::NextVisible( Paragraph* pPara ) const std::vector<Paragraph*>::const_iterator iter = std::find(maEntries.begin(), maEntries.end(), pPara); - for (; iter != maEntries.end(); ++iter) { if ((*iter)->IsVisible()) @@ -200,7 +199,6 @@ Paragraph* ParagraphList::PrevVisible( Paragraph* pPara ) const std::vector<Paragraph*>::const_reverse_iterator iter = std::find(maEntries.rbegin(), maEntries.rend(), pPara); - for (; iter != maEntries.rend(); ++iter) { if ((*iter)->IsVisible()) @@ -222,31 +220,31 @@ Paragraph* ParagraphList::LastVisible() const return iter != maEntries.rend() ? *iter : NULL; } -BOOL ParagraphList::HasChilds( Paragraph* pParagraph ) const +sal_Bool ParagraphList::HasChilds( Paragraph* pParagraph ) const { - ULONG n = GetAbsPos( pParagraph ); + sal_uLong n = GetAbsPos( pParagraph ); Paragraph* pNext = GetParagraph( ++n ); - return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) ) ? TRUE : FALSE; + return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) ) ? sal_True : sal_False; } -BOOL ParagraphList::HasHiddenChilds( Paragraph* pParagraph ) const +sal_Bool ParagraphList::HasHiddenChilds( Paragraph* pParagraph ) const { - ULONG n = GetAbsPos( pParagraph ); + sal_uLong n = GetAbsPos( pParagraph ); Paragraph* pNext = GetParagraph( ++n ); - return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && !pNext->IsVisible() ) ? TRUE : FALSE; + return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && !pNext->IsVisible() ) ? sal_True : sal_False; } -BOOL ParagraphList::HasVisibleChilds( Paragraph* pParagraph ) const +sal_Bool ParagraphList::HasVisibleChilds( Paragraph* pParagraph ) const { - ULONG n = GetAbsPos( pParagraph ); + sal_uLong n = GetAbsPos( pParagraph ); Paragraph* pNext = GetParagraph( ++n ); - return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && pNext->IsVisible() ) ? TRUE : FALSE; + return ( pNext && ( pNext->GetDepth() > pParagraph->GetDepth() ) && pNext->IsVisible() ) ? sal_True : sal_False; } -ULONG ParagraphList::GetChildCount( Paragraph* pParent ) const +sal_uLong ParagraphList::GetChildCount( Paragraph* pParent ) const { - ULONG nChildCount = 0; - ULONG n = GetAbsPos( pParent ); + sal_uLong nChildCount = 0; + sal_uLong n = GetAbsPos( pParent ); Paragraph* pPara = GetParagraph( ++n ); while ( pPara && ( pPara->GetDepth() > pParent->GetDepth() ) ) { @@ -256,10 +254,10 @@ ULONG ParagraphList::GetChildCount( Paragraph* pParent ) const return nChildCount; } -Paragraph* ParagraphList::GetParent( Paragraph* pParagraph /*, USHORT& rRelPos */ ) const +Paragraph* ParagraphList::GetParent( Paragraph* pParagraph /*, sal_uInt16& rRelPos */ ) const { /* rRelPos = 0 */; - ULONG n = GetAbsPos( pParagraph ); + sal_uLong n = GetAbsPos( pParagraph ); Paragraph* pPrev = GetParagraph( --n ); while ( pPrev && ( pPrev->GetDepth() >= pParagraph->GetDepth() ) ) { @@ -273,15 +271,15 @@ Paragraph* ParagraphList::GetParent( Paragraph* pParagraph /*, USHORT& rRelPos * void ParagraphList::Expand( Paragraph* pParent ) { - ULONG nChildCount = GetChildCount( pParent ); - ULONG nPos = GetAbsPos( pParent ); + sal_uLong nChildCount = GetChildCount( pParent ); + sal_uLong nPos = GetAbsPos( pParent ); - for ( ULONG n = 1; n <= nChildCount; n++ ) + for ( sal_uLong n = 1; n <= nChildCount; n++ ) { Paragraph* pPara = GetParagraph( nPos+n ); if ( !( pPara->IsVisible() ) ) { - pPara->bVisible = TRUE; + pPara->bVisible = sal_True; aVisibleStateChangedHdl.Call( pPara ); } } @@ -289,23 +287,23 @@ void ParagraphList::Expand( Paragraph* pParent ) void ParagraphList::Collapse( Paragraph* pParent ) { - ULONG nChildCount = GetChildCount( pParent ); - ULONG nPos = GetAbsPos( pParent ); + sal_uLong nChildCount = GetChildCount( pParent ); + sal_uLong nPos = GetAbsPos( pParent ); - for ( ULONG n = 1; n <= nChildCount; n++ ) + for ( sal_uLong n = 1; n <= nChildCount; n++ ) { Paragraph* pPara = GetParagraph( nPos+n ); if ( pPara->IsVisible() ) { - pPara->bVisible = FALSE; + pPara->bVisible = sal_False; aVisibleStateChangedHdl.Call( pPara ); } } } -ULONG ParagraphList::GetAbsPos( Paragraph* pParent ) const +sal_uLong ParagraphList::GetAbsPos( Paragraph* pParent ) const { - ULONG pos = 0; + sal_uLong pos = 0; std::vector<Paragraph*>::const_iterator iter; for (iter = maEntries.begin(); iter != maEntries.end(); ++iter, ++pos) { @@ -316,9 +314,9 @@ ULONG ParagraphList::GetAbsPos( Paragraph* pParent ) const return ~0; } -ULONG ParagraphList::GetVisPos( Paragraph* pPara ) const +sal_uLong ParagraphList::GetVisPos( Paragraph* pPara ) const { - ULONG nVisPos = 0; + sal_uLong nVisPos = 0; std::vector<Paragraph*>::const_iterator iter; for (iter = maEntries.begin(); iter != maEntries.end(); ++iter, ++nVisPos) { diff --git a/editeng/source/outliner/paralist.hxx b/editeng/source/outliner/paralist.hxx index f751c97aea9d..b693a9e5fc62 100644 --- a/editeng/source/outliner/paralist.hxx +++ b/editeng/source/outliner/paralist.hxx @@ -38,7 +38,7 @@ class Paragraph; class ParagraphList { public: - void Clear( BOOL bDestroyParagraphs ); + void Clear( sal_Bool bDestroyParagraphs ); sal_uInt32 GetParagraphCount() const { @@ -50,8 +50,8 @@ public: return nPos < maEntries.size() ? maEntries[nPos] : NULL; } - ULONG GetAbsPos( Paragraph* pParent ) const; - ULONG GetVisPos( Paragraph* pParagraph ) const; + sal_uLong GetAbsPos( Paragraph* pParent ) const; + sal_uLong GetVisPos( Paragraph* pParagraph ) const; void Append( Paragraph *pPara); void Insert( Paragraph* pPara, ULONG nAbsPos); @@ -62,11 +62,11 @@ public: Paragraph* PrevVisible( Paragraph* ) const; Paragraph* LastVisible() const; - Paragraph* GetParent( Paragraph* pParagraph /*, USHORT& rRelPos */ ) const; - BOOL HasChilds( Paragraph* pParagraph ) const; - BOOL HasHiddenChilds( Paragraph* pParagraph ) const; - BOOL HasVisibleChilds( Paragraph* pParagraph ) const; - ULONG GetChildCount( Paragraph* pParagraph ) const; + Paragraph* GetParent( Paragraph* pParagraph /*, sal_uInt16& rRelPos */ ) const; + sal_Bool HasChilds( Paragraph* pParagraph ) const; + sal_Bool HasHiddenChilds( Paragraph* pParagraph ) const; + sal_Bool HasVisibleChilds( Paragraph* pParagraph ) const; + sal_uLong GetChildCount( Paragraph* pParagraph ) const; void Expand( Paragraph* pParent ); void Collapse( Paragraph* pParent ); diff --git a/editeng/source/rtf/makefile.mk b/editeng/source/rtf/makefile.mk deleted file mode 100644 index 1af1f0c026cc..000000000000 --- a/editeng/source/rtf/makefile.mk +++ /dev/null @@ -1,47 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=editeng -TARGET=rtf -ENABLE_EXCEPTIONS=TRUE -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk -# --- Files -------------------------------------------------------- - -SLOFILES= \ - $(SLO)$/svxrtf.obj \ - $(SLO)$/rtfgrf.obj \ - $(SLO)$/rtfitem.obj - -# ========================================================================== - -.INCLUDE : target.mk - diff --git a/editeng/source/rtf/rtfgrf.cxx b/editeng/source/rtf/rtfgrf.cxx index f0fa5eb39d5e..85f398fbc529 100644 --- a/editeng/source/rtf/rtfgrf.cxx +++ b/editeng/source/rtf/rtfgrf.cxx @@ -41,12 +41,12 @@ using namespace ::rtl; -static BYTE aPal1[ 2 * 4 ] = { +static sal_uInt8 aPal1[ 2 * 4 ] = { 0x00, 0x00, 0x00, 0x00, // Black 0xFF, 0xFF, 0xFF, 0x00 // White }; -static BYTE aPal4[ 16 * 4 ] = { +static sal_uInt8 aPal4[ 16 * 4 ] = { 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, @@ -65,7 +65,7 @@ static BYTE aPal4[ 16 * 4 ] = { 0xFF, 0xFF, 0xFF, 0x00 }; -static BYTE aPal8[ 256 * 4 ] = +static sal_uInt8 aPal8[ 256 * 4 ] = { 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x80, 0x92, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x00, 0x80, 0x00, 0xAA, 0x00, @@ -181,14 +181,14 @@ inline short SwapShort( short n ) static void WriteBMPHeader( SvStream& rStream, const SvxRTFPictureType& rPicType ) { - ULONG n4Width = rPicType.nWidth; - ULONG n4Height = rPicType.nHeight; - USHORT n4ColBits = rPicType.nBitsPerPixel; + sal_uInt32 n4Width = rPicType.nWidth; + sal_uInt32 n4Height = rPicType.nHeight; + sal_uInt16 n4ColBits = rPicType.nBitsPerPixel; - USHORT nColors = (1 << n4ColBits); // Number of colors (1, 16, 256) - USHORT nWdtOut = rPicType.nWidthBytes; + sal_uInt16 nColors = (1 << n4ColBits); // Number of colors (1, 16, 256) + sal_uInt16 nWdtOut = rPicType.nWidthBytes; if( !nWdtOut ) - nWdtOut = (USHORT)((( n4Width * n4ColBits + 31 ) / 32 ) * 4 ); + nWdtOut = (sal_uInt16)((( n4Width * n4ColBits + 31 ) / 32 ) * 4 ); long nOffset = 14 + 40; // BMP_FILE_HD_SIZ + sizeof(*pBmpInfo); if( 256 >= nColors ) @@ -203,7 +203,7 @@ static void WriteBMPHeader( SvStream& rStream, rStream << SwapLong(40) // sizeof( BmpInfo ) << SwapLong(n4Width) << SwapLong(n4Height) - << (USHORT)1 + << (sal_uInt16)1 << n4ColBits << SwapLong(0) << SwapLong(0) @@ -237,7 +237,7 @@ xub_StrLen SvxRTFParser::HexToBin( String& rToken ) xub_StrLen n, nLen; sal_Unicode nVal; - BOOL bValidData = TRUE; + sal_Bool bValidData = sal_True; const sal_Unicode* pStr = rToken.GetBufferAccess(); sal_Char* pData = (sal_Char*)pStr; for( n = 0, nLen = rToken.Len(); n < nLen; ++n, ++pStr ) @@ -251,7 +251,7 @@ xub_StrLen SvxRTFParser::HexToBin( String& rToken ) else { DBG_ASSERT( !this, "invalid Hex value" ); - bValidData = FALSE; + bValidData = sal_False; break; } @@ -264,7 +264,7 @@ xub_StrLen SvxRTFParser::HexToBin( String& rToken ) return bValidData ? nLen / 2 : STRING_NOTFOUND; } -BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) +sal_Bool SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) { // Delete the old data rGrf.Clear(); @@ -287,7 +287,7 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) while( _nOpenBrakets && IsParserWorking() && bValidBmp ) { nToken = GetNextToken(); - USHORT nVal = USHORT( nTokenValue ); + sal_uInt16 nVal = sal_uInt16( nTokenValue ); switch( nToken ) { case '}': @@ -390,7 +390,7 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) { rStrm.SeekRel(-1); sal_uInt8 aData[4096]; - ULONG nSize = sizeof(aData); + sal_uInt32 nSize = sizeof(aData); while (rPicType.uPicLen > 0) { @@ -447,14 +447,14 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) default: break; } - bFirstTextToken = FALSE; + bFirstTextToken = sal_False; } if( pTmpFile && SvxRTFPictureType::HEX_MODE == rPicType.nMode ) { xub_StrLen nTokenLen = HexToBin( aToken ); if( STRING_NOTFOUND == nTokenLen ) - bValidBmp = FALSE; + bValidBmp = sal_False; else { pTmpFile->Write( (sal_Char*)aToken.GetBuffer(), @@ -475,12 +475,12 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) if( bValidBmp ) { GraphicFilter* pGF = GraphicFilter::GetGraphicFilter(); - USHORT nImportFilter = GRFILTER_FORMAT_DONTKNOW; + sal_uInt16 nImportFilter = GRFILTER_FORMAT_DONTKNOW; if( pFilterNm ) { String sTmp; - for( USHORT n = pGF->GetImportFormatCount(); n; ) + for( sal_uInt16 n = pGF->GetImportFormatCount(); n; ) { sTmp = pGF->GetImportFormatShortName( --n ); if( sTmp.EqualsAscii( pFilterNm )) @@ -523,8 +523,8 @@ BOOL SvxRTFParser::ReadBmpData( Graphic& rGrf, SvxRTFPictureType& rPicType ) else aSize = OutputDevice::LogicToLogic( aSize, rGrf.GetPrefMapMode(), aMap ); - rPicType.nWidth = sal::static_int_cast< USHORT >(aSize.Width()); - rPicType.nHeight = sal::static_int_cast< USHORT >( + rPicType.nWidth = sal::static_int_cast< sal_uInt16 >(aSize.Width()); + rPicType.nHeight = sal::static_int_cast< sal_uInt16 >( aSize.Height()); } break; diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index 26c69457b28a..611d4907504e 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -98,14 +98,14 @@ // Some helper functions // char -inline const SvxEscapementItem& GetEscapement(const SfxItemSet& rSet,USHORT nId,BOOL bInP=TRUE) +inline const SvxEscapementItem& GetEscapement(const SfxItemSet& rSet,sal_uInt16 nId,sal_Bool bInP=sal_True) { return (const SvxEscapementItem&)rSet.Get( nId,bInP); } -inline const SvxLineSpacingItem& GetLineSpacing(const SfxItemSet& rSet,USHORT nId,BOOL bInP=TRUE) +inline const SvxLineSpacingItem& GetLineSpacing(const SfxItemSet& rSet,sal_uInt16 nId,sal_Bool bInP=sal_True) { return (const SvxLineSpacingItem&)rSet.Get( nId,bInP); } // frm -inline const SvxLRSpaceItem& GetLRSpace(const SfxItemSet& rSet,USHORT nId,BOOL bInP=TRUE) +inline const SvxLRSpaceItem& GetLRSpace(const SfxItemSet& rSet,sal_uInt16 nId,sal_Bool bInP=sal_True) { return (const SvxLRSpaceItem&)rSet.Get( nId,bInP); } -inline const SvxULSpaceItem& GetULSpace(const SfxItemSet& rSet,USHORT nId,BOOL bInP=TRUE) +inline const SvxULSpaceItem& GetULSpace(const SfxItemSet& rSet,sal_uInt16 nId,sal_Bool bInP=sal_True) { return (const SvxULSpaceItem&)rSet.Get( nId,bInP); } #define PARDID ((RTFPardAttrMapIds*)aPardMap.GetData()) @@ -114,7 +114,7 @@ inline const SvxULSpaceItem& GetULSpace(const SfxItemSet& rSet,USHORT nId,BOOL b void SvxRTFParser::SetScriptAttr( RTF_CharTypeDef eType, SfxItemSet& rSet, SfxPoolItem& rItem ) { - const USHORT *pNormal = 0, *pCJK = 0, *pCTL = 0; + const sal_uInt16 *pNormal = 0, *pCJK = 0, *pCTL = 0; const RTFPlainAttrMapIds* pIds = (RTFPlainAttrMapIds*)aPlainMap.GetData(); switch( rItem.Which() ) { @@ -217,31 +217,37 @@ void SvxRTFParser::SetScriptAttr( RTF_CharTypeDef eType, SfxItemSet& rSet, void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) { +<<<<<<< HEAD DBG_ASSERT( pSet, "A SfxItemSet has to be provided as argument!" ); int bFirstToken = TRUE, bWeiter = TRUE; USHORT nStyleNo = 0; // default +======= + DBG_ASSERT( pSet, "Es muss ein SfxItemSet uebergeben werden!" ); + int bFirstToken = sal_True, bWeiter = sal_True; + sal_uInt16 nStyleNo = 0; // default +>>>>>>> ooo/DEV300_m101 FontUnderline eUnderline; FontUnderline eOverline; FontEmphasisMark eEmphasis; - bPardTokenRead = FALSE; + bPardTokenRead = sal_False; RTF_CharTypeDef eCharType = NOTDEF_CHARTYPE; - USHORT nFontAlign; + sal_uInt16 nFontAlign; - int bChkStkPos = !bNewGroup && aAttrStack.Top(); + int bChkStkPos = !bNewGroup && !aAttrStack.empty(); while( bWeiter && IsParserWorking() ) // as long as known Attribute are recognized { switch( nToken ) { case RTF_PARD: - RTFPardPlain( TRUE, &pSet ); + RTFPardPlain( sal_True, &pSet ); ResetPard(); nStyleNo = 0; - bPardTokenRead = TRUE; + bPardTokenRead = sal_True; break; case RTF_PLAIN: - RTFPardPlain( FALSE, &pSet ); + RTFPardPlain( sal_False, &pSet ); break; default: @@ -249,7 +255,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) if( !bChkStkPos ) break; - SvxRTFItemStackType* pAkt = aAttrStack.Top(); + SvxRTFItemStackType* pAkt = aAttrStack.empty() ? 0 : aAttrStack.back(); if( !pAkt || (pAkt->pSttNd->GetIdx() == pInsPos->GetNodeIdx() && pAkt->nSttCnt == pInsPos->GetCntIdx() )) break; @@ -263,15 +269,15 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) { // Open a new Group SvxRTFItemStackType* pNew = new SvxRTFItemStackType( - *pAkt, *pInsPos, TRUE ); + *pAkt, *pInsPos, sal_True ); pNew->SetRTFDefaults( GetRTFDefaults() ); // "Set" all valid attributes up until this point AttrGroupEnd(); - pAkt = aAttrStack.Top(); // can be changed after AttrGroupEnd! + pAkt = aAttrStack.empty() ? 0 : aAttrStack.back(); // can be changed after AttrGroupEnd! pNew->aAttrSet.SetParent( pAkt ? &pAkt->aAttrSet : 0 ); - aAttrStack.Push( pNew ); + aAttrStack.push_back( pNew ); pAkt = pNew; } else @@ -279,7 +285,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) pAkt->SetStartPos( *pInsPos ); pSet = &pAkt->aAttrSet; - } while( FALSE ); + } while( sal_False ); switch( nToken ) { @@ -297,33 +303,71 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) { if( !bFirstToken ) SkipToken( -1 ); - bWeiter = FALSE; + bWeiter = sal_False; } else { +<<<<<<< HEAD nStyleNo = -1 == nTokenValue ? 0 : USHORT(nTokenValue); // Set the StyleNumber for the current style on // the attribute stack SvxRTFItemStackType* pAkt = aAttrStack.Top(); +======= + nStyleNo = -1 == nTokenValue ? 0 : sal_uInt16(nTokenValue); + // setze am akt. auf dem AttrStack stehenden Style die + // StyleNummer + SvxRTFItemStackType* pAkt = aAttrStack.empty() ? 0 : aAttrStack.back(); +>>>>>>> ooo/DEV300_m101 if( !pAkt ) break; - pAkt->nStyleNo = USHORT( nStyleNo ); + pAkt->nStyleNo = sal_uInt16( nStyleNo ); + +<<<<<<< HEAD +======= +#if 0 +// JP 05.09.95: zuruecksetzen der Style-Attribute fuehrt nur zu Problemen. +// Es muss reichen, wenn das ueber pard/plain erfolgt +// ansonsten Bugdoc 15304.rtf - nach nur "\pard" falscher Font !! + SvxRTFStyleType* pStyle = aStyleTbl.Get( pAkt->nStyleNo ); + if( pStyle && pStyle->aAttrSet.Count() ) + { + //JP 07.07.95: + // alle Attribute, die in der Vorlage gesetzt werden + // auf defaults setzen. In RTF werden die Attribute + // der Vorlage danach ja wiederholt. + // WICHTIG: Attribute die in der Vorlage definiert + // sind, werden zurueckgesetzt !!!! + // pAkt->aAttrSet.Put( pStyle->aAttrSet ); + + SfxItemIter aIter( pStyle->aAttrSet ); + SfxItemPool* pPool = pStyle->aAttrSet.GetPool(); + sal_uInt16 nWh = aIter.GetCurItem()->Which(); + while( sal_True ) + { + pAkt->aAttrSet.Put( pPool->GetDefaultItem( nWh )); + if( aIter.IsAtEnd() ) + break; + nWh = aIter.NextItem()->Which(); + } + } +#endif +>>>>>>> ooo/DEV300_m101 } break; case RTF_KEEP: if( PARDID->nSplit ) { - pSet->Put( SvxFmtSplitItem( FALSE, PARDID->nSplit )); + pSet->Put( SvxFmtSplitItem( sal_False, PARDID->nSplit )); } break; case RTF_KEEPN: if( PARDID->nKeep ) { - pSet->Put( SvxFmtKeepItem( TRUE, PARDID->nKeep )); + pSet->Put( SvxFmtKeepItem( sal_True, PARDID->nKeep )); } break; @@ -331,7 +375,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) if( PARDID->nOutlineLvl ) { pSet->Put( SfxUInt16Item( PARDID->nOutlineLvl, - (UINT16)nTokenValue )); + (sal_uInt16)nTokenValue )); } break; @@ -364,12 +408,12 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) if( PARDID->nLRSpace ) { SvxLRSpaceItem aLR( GetLRSpace(*pSet, PARDID->nLRSpace )); - USHORT nSz = 0; + sal_uInt16 nSz = 0; if( -1 != nTokenValue ) { if( IsCalcValue() ) CalcValue(); - nSz = USHORT(nTokenValue); + nSz = sal_uInt16(nTokenValue); } aLR.SetTxtFirstLineOfst( nSz ); pSet->Put( aLR ); @@ -381,12 +425,12 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) if( PARDID->nLRSpace ) { SvxLRSpaceItem aLR( GetLRSpace(*pSet, PARDID->nLRSpace )); - USHORT nSz = 0; + sal_uInt16 nSz = 0; if( 0 < nTokenValue ) { if( IsCalcValue() ) CalcValue(); - nSz = USHORT(nTokenValue); + nSz = sal_uInt16(nTokenValue); } aLR.SetTxtLeft( nSz ); pSet->Put( aLR ); @@ -398,12 +442,12 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) if( PARDID->nLRSpace ) { SvxLRSpaceItem aLR( GetLRSpace(*pSet, PARDID->nLRSpace )); - USHORT nSz = 0; + sal_uInt16 nSz = 0; if( 0 < nTokenValue ) { if( IsCalcValue() ) CalcValue(); - nSz = USHORT(nTokenValue); + nSz = sal_uInt16(nTokenValue); } aLR.SetRight( nSz ); pSet->Put( aLR ); @@ -414,12 +458,12 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) if( PARDID->nULSpace ) { SvxULSpaceItem aUL( GetULSpace(*pSet, PARDID->nULSpace )); - USHORT nSz = 0; + sal_uInt16 nSz = 0; if( 0 < nTokenValue ) { if( IsCalcValue() ) CalcValue(); - nSz = USHORT(nTokenValue); + nSz = sal_uInt16(nTokenValue); } aUL.SetUpper( nSz ); pSet->Put( aUL ); @@ -430,12 +474,12 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) if( PARDID->nULSpace ) { SvxULSpaceItem aUL( GetULSpace(*pSet, PARDID->nULSpace )); - USHORT nSz = 0; + sal_uInt16 nSz = 0; if( 0 < nTokenValue ) { if( IsCalcValue() ) CalcValue(); - nSz = USHORT(nTokenValue); + nSz = sal_uInt16(nTokenValue); } aUL.SetLower( nSz ); pSet->Put( aUL ); @@ -447,7 +491,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) { // then switches to multi-line! SvxLineSpacingItem aLSpace( GetLineSpacing( *pSet, - PARDID->nLinespacing, FALSE )); + PARDID->nLinespacing, sal_False )); // how much do you get from the line height value? @@ -461,10 +505,15 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) nTokenValue = short( 100L * aLSpace.GetLineHeight() / long( nTokenValue ) ); +<<<<<<< HEAD if( nTokenValue > 200 ) // Data value for PropLnSp nTokenValue = 200; // is one BYTE !!! +======= + if( nTokenValue > 200 ) // Datenwert fuer PropLnSp + nTokenValue = 200; // ist ein sal_uInt8 !!! +>>>>>>> ooo/DEV300_m101 - aLSpace.SetPropLineSpace( (const BYTE)nTokenValue ); + aLSpace.SetPropLineSpace( (const sal_uInt8)nTokenValue ); aLSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO; pSet->Put( aLSpace ); @@ -502,7 +551,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) CalcValue(); if (eLnSpc != SVX_LINE_SPACE_AUTO) - aLSpace.SetLineHeight( (const USHORT)nTokenValue ); + aLSpace.SetLineHeight( (const sal_uInt16)nTokenValue ); aLSpace.GetLineSpaceRule() = eLnSpc; pSet->Put(aLSpace); @@ -512,14 +561,14 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) case RTF_NOCWRAP: if( PARDID->nForbRule ) { - pSet->Put( SvxForbiddenRuleItem( FALSE, + pSet->Put( SvxForbiddenRuleItem( sal_False, PARDID->nForbRule )); } break; case RTF_NOOVERFLOW: if( PARDID->nHangPunct ) { - pSet->Put( SvxHangingPunctuationItem( FALSE, + pSet->Put( SvxHangingPunctuationItem( sal_False, PARDID->nHangPunct )); } break; @@ -527,7 +576,7 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) case RTF_ASPALPHA: if( PARDID->nScriptSpace ) { - pSet->Put( SvxScriptSpaceItem( TRUE, + pSet->Put( SvxScriptSpaceItem( sal_True, PARDID->nScriptSpace )); } break; @@ -584,14 +633,14 @@ SET_FONTALIGNMENT: case RTF_SUB: if( PLAINID->nEscapement ) { - const USHORT nEsc = PLAINID->nEscapement; + const sal_uInt16 nEsc = PLAINID->nEscapement; if( -1 == nTokenValue || RTF_SUB == nToken ) nTokenValue = 6; if( IsCalcValue() ) CalcValue(); - const SvxEscapementItem& rOld = GetEscapement( *pSet, nEsc, FALSE ); + const SvxEscapementItem& rOld = GetEscapement( *pSet, nEsc, sal_False ); short nEs; - BYTE nProp; + sal_uInt8 nProp; if( DFLT_ESC_AUTO_SUPER == rOld.GetEsc() ) { nEs = DFLT_ESC_AUTO_SUB; @@ -609,7 +658,7 @@ SET_FONTALIGNMENT: case RTF_NOSUPERSUB: if( PLAINID->nEscapement ) { - const USHORT nEsc = PLAINID->nEscapement; + const sal_uInt16 nEsc = PLAINID->nEscapement; pSet->Put( SvxEscapementItem( nEsc )); } break; @@ -655,7 +704,7 @@ SET_FONTALIGNMENT: case RTF_F: case RTF_AF: { - const Font& rSVFont = GetFont( USHORT(nTokenValue) ); + const Font& rSVFont = GetFont( sal_uInt16(nTokenValue) ); SvxFontItem aTmpItem( rSVFont.GetFamily(), rSVFont.GetName(), rSVFont.GetStyleName(), rSVFont.GetPitch(), rSVFont.GetCharSet(), @@ -683,7 +732,7 @@ SET_FONTALIGNMENT: // if( IsCalcValue() ) // CalcValue(); SvxFontHeightItem aTmpItem( - (const USHORT)nTokenValue, 100, + (const sal_uInt16)nTokenValue, 100, SID_ATTR_CHAR_FONTHEIGHT ); SetScriptAttr( eCharType, *pSet, aTmpItem ); } @@ -704,7 +753,7 @@ SET_FONTALIGNMENT: if( PLAINID->nContour && IsAttrSttPos() ) // not in the text flow? { - pSet->Put( SvxContourItem( nTokenValue ? TRUE : FALSE, + pSet->Put( SvxContourItem( nTokenValue ? sal_True : sal_False, PLAINID->nContour )); } break; @@ -713,7 +762,7 @@ SET_FONTALIGNMENT: if( PLAINID->nShadowed && IsAttrSttPos() ) // not in the text flow? { - pSet->Put( SvxShadowedItem( nTokenValue ? TRUE : FALSE, + pSet->Put( SvxShadowedItem( nTokenValue ? sal_True : sal_False, PLAINID->nShadowed )); } break; @@ -797,7 +846,7 @@ SET_FONTALIGNMENT: if( PLAINID->nWordlineMode ) { - pSet->Put( SvxWordLineModeItem( TRUE, PLAINID->nWordlineMode )); + pSet->Put( SvxWordLineModeItem( sal_True, PLAINID->nWordlineMode )); } goto ATTR_SETUNDERLINE; @@ -814,7 +863,7 @@ ATTR_SETUNDERLINE: SvxUnderlineItem aUL( UNDERLINE_SINGLE, PLAINID->nUnderline ); const SfxPoolItem* pItem; if( SFX_ITEM_SET == pSet->GetItemState( - PLAINID->nUnderline, FALSE, &pItem ) ) + PLAINID->nUnderline, sal_False, &pItem ) ) { // is switched off ? if( UNDERLINE_NONE == @@ -823,11 +872,11 @@ ATTR_SETUNDERLINE: aUL = *(SvxUnderlineItem*)pItem; } else - aUL = (const SvxUnderlineItem&)pSet->Get( PLAINID->nUnderline, FALSE ); + aUL = (const SvxUnderlineItem&)pSet->Get( PLAINID->nUnderline, sal_False ); if( UNDERLINE_NONE == aUL.GetLineStyle() ) aUL.SetLineStyle( UNDERLINE_SINGLE ); - aUL.SetColor( GetColor( USHORT(nTokenValue) )); + aUL.SetColor( GetColor( sal_uInt16(nTokenValue) )); pSet->Put( aUL ); } break; @@ -892,7 +941,7 @@ ATTR_SETUNDERLINE: if( PLAINID->nWordlineMode ) { - pSet->Put( SvxWordLineModeItem( TRUE, PLAINID->nWordlineMode )); + pSet->Put( SvxWordLineModeItem( sal_True, PLAINID->nWordlineMode )); } goto ATTR_SETOVERLINE; @@ -909,7 +958,7 @@ ATTR_SETOVERLINE: SvxOverlineItem aOL( UNDERLINE_SINGLE, PLAINID->nOverline ); const SfxPoolItem* pItem; if( SFX_ITEM_SET == pSet->GetItemState( - PLAINID->nOverline, FALSE, &pItem ) ) + PLAINID->nOverline, sal_False, &pItem ) ) { // is switched off ? if( UNDERLINE_NONE == @@ -918,11 +967,11 @@ ATTR_SETOVERLINE: aOL = *(SvxOverlineItem*)pItem; } else - aOL = (const SvxOverlineItem&)pSet->Get( PLAINID->nUnderline, FALSE ); + aOL = (const SvxOverlineItem&)pSet->Get( PLAINID->nUnderline, sal_False ); if( UNDERLINE_NONE == aOL.GetLineStyle() ) aOL.SetLineStyle( UNDERLINE_SINGLE ); - aOL.SetColor( GetColor( USHORT(nTokenValue) )); + aOL.SetColor( GetColor( sal_uInt16(nTokenValue) )); pSet->Put( aOL ); } break; @@ -931,14 +980,14 @@ ATTR_SETOVERLINE: case RTF_SUPER: if( PLAINID->nEscapement ) { - const USHORT nEsc = PLAINID->nEscapement; + const sal_uInt16 nEsc = PLAINID->nEscapement; if( -1 == nTokenValue || RTF_SUPER == nToken ) nTokenValue = 6; if( IsCalcValue() ) CalcValue(); - const SvxEscapementItem& rOld = GetEscapement( *pSet, nEsc, FALSE ); + const SvxEscapementItem& rOld = GetEscapement( *pSet, nEsc, sal_False ); short nEs; - BYTE nProp; + sal_uInt8 nProp; if( DFLT_ESC_AUTO_SUB == rOld.GetEsc() ) { nEs = DFLT_ESC_AUTO_SUPER; @@ -956,13 +1005,24 @@ ATTR_SETOVERLINE: case RTF_CF: if( PLAINID->nColor ) { - pSet->Put( SvxColorItem( GetColor( USHORT(nTokenValue) ), + pSet->Put( SvxColorItem( GetColor( sal_uInt16(nTokenValue) ), PLAINID->nColor )); } break; //#i12501# While cb is clearly documented in the rtf spec, word //doesn't accept it at all +<<<<<<< HEAD +======= + case RTF_CB: + if( PLAINID->nBgColor ) + { + pSet->Put( SvxBrushItem( GetColor( sal_uInt16(nTokenValue) ), + PLAINID->nBgColor )); + } + break; +#endif +>>>>>>> ooo/DEV300_m101 case RTF_LANG: if( PLAINID->nLanguage ) { @@ -987,10 +1047,10 @@ ATTR_SETOVERLINE: break; case RTF_RTLCH: - bIsLeftToRightDef = FALSE; + bIsLeftToRightDef = sal_False; break; case RTF_LTRCH: - bIsLeftToRightDef = TRUE; + bIsLeftToRightDef = sal_True; break; case RTF_RTLPAR: if (PARDID->nDirection) @@ -1041,7 +1101,7 @@ ATTR_SETEMPHASIS: default: cStt = 0, cEnd = 0; break; } - pSet->Put( SvxTwoLinesItem( TRUE, cStt, cEnd, + pSet->Put( SvxTwoLinesItem( sal_True, cStt, cEnd, PLAINID->nTwoLines )); } break; @@ -1052,7 +1112,7 @@ ATTR_SETEMPHASIS: //i21372 if (nTokenValue < 1 || nTokenValue > 600) nTokenValue = 100; - pSet->Put( SvxCharScaleWidthItem( USHORT(nTokenValue), + pSet->Put( SvxCharScaleWidthItem( sal_uInt16(nTokenValue), PLAINID->nCharScaleX )); } break; @@ -1127,8 +1187,13 @@ ATTR_SETEMPHASIS: case RTF_SWG_ESCPROP: { +<<<<<<< HEAD // Store percentage change! BYTE nProp = BYTE( nTokenValue / 100 ); +======= + // prozentuale Veraenderung speichern ! + sal_uInt8 nProp = sal_uInt8( nTokenValue / 100 ); +>>>>>>> ooo/DEV300_m101 short nEsc = 0; if( 1 == ( nTokenValue % 100 )) // Recognize own auto-flags! @@ -1143,10 +1208,10 @@ ATTR_SETEMPHASIS: case RTF_HYPHEN: { SvxHyphenZoneItem aHypenZone( - (nTokenValue & 1) ? TRUE : FALSE, + (nTokenValue & 1) ? sal_True : sal_False, PARDID->nHyphenzone ); aHypenZone.SetPageEnd( - (nTokenValue & 2) ? TRUE : FALSE ); + (nTokenValue & 2) ? sal_True : sal_False ); if( PARDID->nHyphenzone && RTF_HYPHLEAD == GetNextToken() && @@ -1154,11 +1219,11 @@ ATTR_SETEMPHASIS: RTF_HYPHMAX == GetNextToken() ) { aHypenZone.GetMinLead() = - BYTE(GetStackPtr( -2 )->nTokenValue); + sal_uInt8(GetStackPtr( -2 )->nTokenValue); aHypenZone.GetMinTrail() = - BYTE(GetStackPtr( -1 )->nTokenValue); + sal_uInt8(GetStackPtr( -1 )->nTokenValue); aHypenZone.GetMaxHyphens() = - BYTE(nTokenValue); + sal_uInt8(nTokenValue); pSet->Put( aHypenZone ); } @@ -1169,22 +1234,26 @@ ATTR_SETEMPHASIS: case RTF_SHADOW: { - int bSkip = TRUE; + int bSkip = sal_True; do { // middle check loop SvxShadowLocation eSL = SvxShadowLocation( nTokenValue ); if( RTF_SHDW_DIST != GetNextToken() ) break; - USHORT nDist = USHORT( nTokenValue ); + sal_uInt16 nDist = sal_uInt16( nTokenValue ); if( RTF_SHDW_STYLE != GetNextToken() ) break; if( RTF_SHDW_COL != GetNextToken() ) break; - USHORT nCol = USHORT( nTokenValue ); + sal_uInt16 nCol = sal_uInt16( nTokenValue ); if( RTF_SHDW_FCOL != GetNextToken() ) break; +<<<<<<< HEAD +======= +// sal_uInt16 nFillCol = sal_uInt16( nTokenValue ); +>>>>>>> ooo/DEV300_m101 Color aColor = GetColor( nCol ); @@ -1192,8 +1261,8 @@ ATTR_SETEMPHASIS: pSet->Put( SvxShadowItem( PARDID->nShadow, &aColor, nDist, eSL ) ); - bSkip = FALSE; - } while( FALSE ); + bSkip = sal_False; + } while( sal_False ); if( bSkip ) SkipGroup(); // at the end of the group @@ -1256,7 +1325,7 @@ ATTR_SETEMPHASIS: if (!bFirstToken) --nSkip; // BRACELEFT: is the next token SkipToken( nSkip ); - bWeiter = FALSE; + bWeiter = sal_False; } } break; @@ -1272,7 +1341,7 @@ ATTR_SETEMPHASIS: // unknown token, so token "returned in Parser" if( !bFirstToken ) SkipToken( -1 ); - bWeiter = FALSE; + bWeiter = sal_False; } } } @@ -1280,8 +1349,37 @@ ATTR_SETEMPHASIS: { nToken = GetNextToken(); } - bFirstToken = FALSE; + bFirstToken = sal_False; } +<<<<<<< HEAD +======= + +/* + // teste Attribute gegen ihre Styles + if( IsChkStyleAttr() && pSet->Count() && !pInsPos->GetCntIdx() ) + { + SvxRTFStyleType* pStyle = aStyleTbl.Get( nStyleNo ); + if( pStyle && pStyle->aAttrSet.Count() ) + { + // alle Attribute, die schon vom Style definiert sind, aus dem + // akt. Set entfernen + const SfxPoolItem* pItem; + SfxItemIter aIter( *pSet ); + sal_uInt16 nWhich = aIter.GetCurItem()->Which(); + while( sal_True ) + { + if( SFX_ITEM_SET == pStyle->aAttrSet.GetItemState( + nWhich, sal_False, &pItem ) && *pItem == *aIter.GetCurItem()) + pSet->ClearItem( nWhich ); // loeschen + + if( aIter.IsAtEnd() ) + break; + nWhich = aIter.NextItem()->Which(); + } + } + } +*/ +>>>>>>> ooo/DEV300_m101 } void SvxRTFParser::ReadTabAttr( int nToken, SfxItemSet& rSet ) @@ -1290,7 +1388,7 @@ void SvxRTFParser::ReadTabAttr( int nToken, SfxItemSet& rSet ) // then read all the TabStops SvxTabStop aTabStop; SvxTabStopItem aAttr( 0, 0, SVX_TAB_ADJUST_DEFAULT, PARDID->nTabStop ); - int bWeiter = TRUE; + int bWeiter = sal_True; do { switch( nToken ) { @@ -1334,22 +1432,33 @@ void SvxRTFParser::ReadTabAttr( int nToken, SfxItemSet& rSet ) nSkip = -2; else { +<<<<<<< HEAD aTabStop.GetDecimal() = BYTE(nTokenValue & 0xff); aTabStop.GetFill() = BYTE((nTokenValue >> 8) & 0xff); // overwrite the closing parenthesis +======= + aTabStop.GetDecimal() = sal_uInt8(nTokenValue & 0xff); + aTabStop.GetFill() = sal_uInt8((nTokenValue >> 8) & 0xff); + // ueberlese noch die schliessende Klammer +>>>>>>> ooo/DEV300_m101 if (bMethodOwnsToken) GetNextToken(); } if( nSkip ) { +<<<<<<< HEAD SkipToken( nSkip ); // Ignore back again bWeiter = FALSE; +======= + SkipToken( nSkip ); // Ignore wieder zurueck + bWeiter = sal_False; +>>>>>>> ooo/DEV300_m101 } } break; default: - bWeiter = FALSE; + bWeiter = sal_False; } if( bWeiter ) { @@ -1398,11 +1507,16 @@ void SvxRTFParser::ReadBorderAttr( int nToken, SfxItemSet& rSet, // then read the border attribute SvxBoxItem aAttr( PARDID->nBox ); const SfxPoolItem* pItem; - if( SFX_ITEM_SET == rSet.GetItemState( PARDID->nBox, FALSE, &pItem ) ) + if( SFX_ITEM_SET == rSet.GetItemState( PARDID->nBox, sal_False, &pItem ) ) aAttr = *(SvxBoxItem*)pItem; +<<<<<<< HEAD SvxBorderLine aBrd( 0, DEF_LINE_WIDTH_0, 0, 0 ); // simple lines int bWeiter = TRUE, nBorderTyp = 0; +======= + SvxBorderLine aBrd( 0, DEF_LINE_WIDTH_0, 0, 0 ); // einfache Linien + int bWeiter = sal_True, nBorderTyp = 0; +>>>>>>> ooo/DEV300_m101 do { switch( nToken ) @@ -1453,23 +1567,23 @@ SETBORDER: switch( nBorderTyp ) { case RTF_BRDRB: - aAttr.SetDistance( (USHORT)nTokenValue, BOX_LINE_BOTTOM ); + aAttr.SetDistance( (sal_uInt16)nTokenValue, BOX_LINE_BOTTOM ); break; case RTF_BRDRT: - aAttr.SetDistance( (USHORT)nTokenValue, BOX_LINE_TOP ); + aAttr.SetDistance( (sal_uInt16)nTokenValue, BOX_LINE_TOP ); break; case RTF_BRDRL: - aAttr.SetDistance( (USHORT)nTokenValue, BOX_LINE_LEFT ); + aAttr.SetDistance( (sal_uInt16)nTokenValue, BOX_LINE_LEFT ); break; case RTF_BRDRR: - aAttr.SetDistance( (USHORT)nTokenValue, BOX_LINE_RIGHT ); + aAttr.SetDistance( (sal_uInt16)nTokenValue, BOX_LINE_RIGHT ); break; case RTF_BOX: - aAttr.SetDistance( (USHORT)nTokenValue ); + aAttr.SetDistance( (sal_uInt16)nTokenValue ); break; } } @@ -1481,7 +1595,7 @@ case RTF_BRDRBAR: break; case RTF_BRDRCF: { - aBrd.SetColor( GetColor( USHORT(nTokenValue) ) ); + aBrd.SetColor( GetColor( sal_uInt16(nTokenValue) ) ); SetBorderLine( nBorderTyp, aAttr, aBrd ); } break; @@ -1577,13 +1691,13 @@ SETBORDERLINE: nSkip = -1; else { - int bSwgControl = TRUE, bFirstToken = TRUE; + int bSwgControl = sal_True, bFirstToken = sal_True; nToken = GetNextToken(); do { switch( nToken ) { case RTF_BRDBOX: - aAttr.SetDistance( USHORT(nTokenValue) ); + aAttr.SetDistance( sal_uInt16(nTokenValue) ); break; case RTF_BRDRT: @@ -1591,46 +1705,46 @@ SETBORDERLINE: case RTF_BRDRR: case RTF_BRDRL: nBorderTyp = nToken; - bFirstToken = FALSE; + bFirstToken = sal_False; if( RTF_BRDLINE_COL != GetNextToken() ) { - bSwgControl = FALSE; + bSwgControl = sal_False; break; } - aBrd.SetColor( GetColor( USHORT(nTokenValue) )); + aBrd.SetColor( GetColor( sal_uInt16(nTokenValue) )); if( RTF_BRDLINE_IN != GetNextToken() ) { - bSwgControl = FALSE; + bSwgControl = sal_False; break; } - aBrd.SetInWidth( USHORT(nTokenValue)); + aBrd.SetInWidth( sal_uInt16(nTokenValue)); if( RTF_BRDLINE_OUT != GetNextToken() ) { - bSwgControl = FALSE; + bSwgControl = sal_False; break; } - aBrd.SetOutWidth( USHORT(nTokenValue)); + aBrd.SetOutWidth( sal_uInt16(nTokenValue)); if( RTF_BRDLINE_DIST != GetNextToken() ) { - bSwgControl = FALSE; + bSwgControl = sal_False; break; } - aBrd.SetDistance( USHORT(nTokenValue)); + aBrd.SetDistance( sal_uInt16(nTokenValue)); SetBorderLine( nBorderTyp, aAttr, aBrd ); break; default: - bSwgControl = FALSE; + bSwgControl = sal_False; break; } if( bSwgControl ) { nToken = GetNextToken(); - bFirstToken = FALSE; + bFirstToken = sal_False; } } while( bSwgControl ); @@ -1651,8 +1765,13 @@ SETBORDERLINE: if( nSkip ) { +<<<<<<< HEAD SkipToken( nSkip ); // Ignore back again bWeiter = FALSE; +======= + SkipToken( nSkip ); // Ignore wieder zurueck + bWeiter = sal_False; +>>>>>>> ooo/DEV300_m101 } } break; @@ -1667,7 +1786,7 @@ SETBORDERLINE: SkipToken( -1 ); } -inline ULONG CalcShading( ULONG nColor, ULONG nFillColor, BYTE nShading ) +inline sal_uInt32 CalcShading( sal_uInt32 nColor, sal_uInt32 nFillColor, sal_uInt8 nShading ) { nColor = (nColor * nShading) / 100; nFillColor = (nFillColor * ( 100 - nShading )) / 100; @@ -1677,12 +1796,19 @@ inline ULONG CalcShading( ULONG nColor, ULONG nFillColor, BYTE nShading ) void SvxRTFParser::ReadBackgroundAttr( int nToken, SfxItemSet& rSet, int bTableDef ) { +<<<<<<< HEAD // then read the border attribute int bWeiter = TRUE; USHORT nColor = USHRT_MAX, nFillColor = USHRT_MAX; BYTE nFillValue = 0; - - USHORT nWh = ( nToken & ~0xff ) == RTF_CHRFMT +======= + // dann lese doch mal das BoderAttribut ein + int bWeiter = sal_True; + sal_uInt16 nColor = USHRT_MAX, nFillColor = USHRT_MAX; + sal_uInt8 nFillValue = 0; +>>>>>>> ooo/DEV300_m101 + + sal_uInt16 nWh = ( nToken & ~0xff ) == RTF_CHRFMT ? PLAINID->nBgColor : PARDID->nBrush; @@ -1692,19 +1818,19 @@ void SvxRTFParser::ReadBackgroundAttr( int nToken, SfxItemSet& rSet, case RTF_CLCBPAT: case RTF_CHCBPAT: case RTF_CBPAT: - nFillColor = USHORT( nTokenValue ); + nFillColor = sal_uInt16( nTokenValue ); break; case RTF_CLCFPAT: case RTF_CHCFPAT: case RTF_CFPAT: - nColor = USHORT( nTokenValue ); + nColor = sal_uInt16( nTokenValue ); break; case RTF_CLSHDNG: case RTF_CHSHDNG: case RTF_SHADING: - nFillValue = (BYTE)( nTokenValue / 100 ); + nFillValue = (sal_uInt8)( nTokenValue / 100 ); break; case RTF_CLBGDKHOR: @@ -1791,9 +1917,9 @@ void SvxRTFParser::ReadBackgroundAttr( int nToken, SfxItemSet& rSet, aColor = aCol; else aColor = Color( - (BYTE)CalcShading( aCol.GetRed(), aFCol.GetRed(), nFillValue ), - (BYTE)CalcShading( aCol.GetGreen(), aFCol.GetGreen(), nFillValue ), - (BYTE)CalcShading( aCol.GetBlue(), aFCol.GetBlue(), nFillValue ) ); + (sal_uInt8)CalcShading( aCol.GetRed(), aFCol.GetRed(), nFillValue ), + (sal_uInt8)CalcShading( aCol.GetGreen(), aFCol.GetGreen(), nFillValue ), + (sal_uInt8)CalcShading( aCol.GetBlue(), aFCol.GetBlue(), nFillValue ) ); rSet.Put( SvxBrushItem( aColor, nWh ) ); SkipToken( -1 ); @@ -1803,34 +1929,43 @@ void SvxRTFParser::ReadBackgroundAttr( int nToken, SfxItemSet& rSet, // pard / plain abarbeiten void SvxRTFParser::RTFPardPlain( int bPard, SfxItemSet** ppSet ) { +<<<<<<< HEAD if( !bNewGroup && aAttrStack.Top() ) // not at the beginning of a new group +======= + if( !bNewGroup && !aAttrStack.empty() ) // not at the beginning of a new group +>>>>>>> ooo/DEV300_m101 { - SvxRTFItemStackType* pAkt = aAttrStack.Top(); + SvxRTFItemStackType* pAkt = aAttrStack.back(); int nLastToken = GetStackPtr(-1)->nTokenId; - int bNewStkEntry = TRUE; + int bNewStkEntry = sal_True; if( RTF_PARD != nLastToken && RTF_PLAIN != nLastToken && BRACELEFT != nLastToken ) { if( pAkt->aAttrSet.Count() || pAkt->pChildList || pAkt->nStyleNo ) { +<<<<<<< HEAD // open a new group SvxRTFItemStackType* pNew = new SvxRTFItemStackType( *pAkt, *pInsPos, TRUE ); +======= + // eine neue Gruppe aufmachen + SvxRTFItemStackType* pNew = new SvxRTFItemStackType( *pAkt, *pInsPos, sal_True ); +>>>>>>> ooo/DEV300_m101 pNew->SetRTFDefaults( GetRTFDefaults() ); // Set all until here valid attributes AttrGroupEnd(); - pAkt = aAttrStack.Top(); // can be changed after AttrGroupEnd! + pAkt = aAttrStack.empty() ? 0 : aAttrStack.back(); // can be changed after AttrGroupEnd! pNew->aAttrSet.SetParent( pAkt ? &pAkt->aAttrSet : 0 ); - aAttrStack.Push( pNew ); + aAttrStack.push_back( pNew ); pAkt = pNew; } else { // continue to use this entry as new pAkt->SetStartPos( *pInsPos ); - bNewStkEntry = FALSE; + bNewStkEntry = sal_False; } } @@ -1839,8 +1974,8 @@ void SvxRTFParser::RTFPardPlain( int bPard, SfxItemSet** ppSet ) ( pAkt->aAttrSet.GetParent() || pAkt->aAttrSet.Count() )) { const SfxPoolItem *pItem, *pDef; - const USHORT* pPtr; - USHORT nCnt; + const sal_uInt16* pPtr; + sal_uInt16 nCnt; const SfxItemSet* pDfltSet = &GetRTFDefaults(); if( bPard ) { @@ -1854,7 +1989,7 @@ void SvxRTFParser::RTFPardPlain( int bPard, SfxItemSet** ppSet ) nCnt = aPlainMap.Count(); } - for( USHORT n = 0; n < nCnt; ++n, ++pPtr ) + for( sal_uInt16 n = 0; n < nCnt; ++n, ++pPtr ) { // Item set and different -> Set the Default Pool if( !*pPtr ) @@ -1866,19 +2001,19 @@ void SvxRTFParser::RTFPardPlain( int bPard, SfxItemSet** ppSet ) else if( !pAkt->aAttrSet.GetParent() ) { if( SFX_ITEM_SET == - pDfltSet->GetItemState( *pPtr, FALSE, &pDef )) + pDfltSet->GetItemState( *pPtr, sal_False, &pDef )) pAkt->aAttrSet.Put( *pDef ); else pAkt->aAttrSet.ClearItem( *pPtr ); } else if( SFX_ITEM_SET == pAkt->aAttrSet.GetParent()-> - GetItemState( *pPtr, TRUE, &pItem ) && + GetItemState( *pPtr, sal_True, &pItem ) && *( pDef = &pDfltSet->Get( *pPtr )) != *pItem ) pAkt->aAttrSet.Put( *pDef ); else { if( SFX_ITEM_SET == - pDfltSet->GetItemState( *pPtr, FALSE, &pDef )) + pDfltSet->GetItemState( *pPtr, sal_False, &pDef )) pAkt->aAttrSet.Put( *pDef ); else pAkt->aAttrSet.ClearItem( *pPtr ); @@ -1897,7 +2032,7 @@ void SvxRTFParser::RTFPardPlain( int bPard, SfxItemSet** ppSet ) //we can fall back to the ansicpg set codeset if (nDfltFont != -1) { - const Font& rSVFont = GetFont(USHORT(nDfltFont)); + const Font& rSVFont = GetFont(sal_uInt16(nDfltFont)); SetEncoding(rSVFont.GetCharSet()); } else @@ -1912,16 +2047,16 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) return; SfxItemSet aTmp( *pAttrPool, aWhichMap.GetData() ); - BOOL bOldFlag = bIsLeftToRightDef; - bIsLeftToRightDef = TRUE; + sal_Bool bOldFlag = bIsLeftToRightDef; + bIsLeftToRightDef = sal_True; switch( nToken ) { - case RTF_ADEFF: bIsLeftToRightDef = FALSE; // no break! + case RTF_ADEFF: bIsLeftToRightDef = sal_False; // no break! case RTF_DEFF: { if( -1 == nValue ) nValue = 0; - const Font& rSVFont = GetFont( USHORT(nValue) ); + const Font& rSVFont = GetFont( sal_uInt16(nValue) ); SvxFontItem aTmpItem( rSVFont.GetFamily(), rSVFont.GetName(), rSVFont.GetStyleName(), rSVFont.GetPitch(), @@ -1930,7 +2065,7 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) } break; - case RTF_ADEFLANG: bIsLeftToRightDef = FALSE; // no break! + case RTF_ADEFLANG: bIsLeftToRightDef = sal_False; // no break! case RTF_DEFLANG: // store default Language if( -1 != nValue ) @@ -1944,8 +2079,13 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) case RTF_DEFTAB: if( PARDID->nTabStop ) { +<<<<<<< HEAD // RTF defines 720 twips as default bIsSetDfltTab = TRUE; +======= + // RTF definiert 720 twips als default + bIsSetDfltTab = sal_True; +>>>>>>> ooo/DEV300_m101 if( -1 == nValue || !nValue ) nValue = 720; @@ -1956,11 +2096,44 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) CalcValue(); nValue = nTokenValue; } +<<<<<<< HEAD // Calculate the ratio of default TabWidth / Tabs and // calculate the corresponding new number. // ?? how did one come up with 13 ?? USHORT nAnzTabs = (SVX_TAB_DEFDIST * 13 ) / USHORT(nValue); +======= +#if 1 + /* + cmc: + This stuff looks a little hairy indeed, this should be totally + unnecessary where default tabstops are understood. Just make one + tabstop and stick the value in there, the first one is all that + matters. + + e.g. + + SvxTabStopItem aNewTab(1, sal_uInt16(nValue), SVX_TAB_ADJUST_DEFAULT, + PARDID->nTabStop); + ((SvxTabStop&)aNewTab[0]).GetAdjustment() = SVX_TAB_ADJUST_DEFAULT; + + + It must exist as a foul hack to support somebody that does not + have a true concept of default tabstops by making a tabsetting + result from the default tabstop, creating a lot of them all at + the default locations to give the effect of the first real + default tabstop being in use just in case the receiving + application doesn't do that for itself. + */ +#endif + + // Verhaeltnis der def. TabWidth / Tabs errechnen und + // enstsprechend die neue Anzahl errechnen. +/*-----------------14.12.94 19:32------------------- + ?? wie kommt man auf die 13 ?? +--------------------------------------------------*/ + sal_uInt16 nAnzTabs = (SVX_TAB_DEFDIST * 13 ) / sal_uInt16(nValue); +>>>>>>> ooo/DEV300_m101 /* cmc, make sure we have at least one, or all hell breaks loose in everybodies exporters, #i8247# @@ -1968,8 +2141,13 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) if (nAnzTabs < 1) nAnzTabs = 1; +<<<<<<< HEAD // we want Defaulttabs SvxTabStopItem aNewTab( nAnzTabs, USHORT(nValue), +======= + // wir wollen Defaulttabs + SvxTabStopItem aNewTab( nAnzTabs, sal_uInt16(nValue), +>>>>>>> ooo/DEV300_m101 SVX_TAB_ADJUST_DEFAULT, PARDID->nTabStop ); while( nAnzTabs ) ((SvxTabStop&)aNewTab[ --nAnzTabs ]).GetAdjustment() = SVX_TAB_ADJUST_DEFAULT; @@ -1984,7 +2162,7 @@ void SvxRTFParser::SetDefault( int nToken, int nValue ) { SfxItemIter aIter( aTmp ); const SfxPoolItem* pItem = aIter.GetCurItem(); - while( TRUE ) + while( sal_True ) { pAttrPool->SetPoolDefaultItem( *pItem ); if( aIter.IsAtEnd() ) diff --git a/editeng/source/rtf/segincr.asm b/editeng/source/rtf/segincr.asm index 27575f74ad8e..27575f74ad8e 100644..100755 --- a/editeng/source/rtf/segincr.asm +++ b/editeng/source/rtf/segincr.asm diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx index 95a71bf2d826..4d882a797671 100644 --- a/editeng/source/rtf/svxrtf.cxx +++ b/editeng/source/rtf/svxrtf.cxx @@ -53,7 +53,6 @@ using namespace ::com::sun::star; -SV_IMPL_PTRARR( SvxRTFColorTbl, ColorPtr ) SV_IMPL_PTRARR( SvxRTFItemStackList, SvxRTFItemStackType* ) CharSet lcl_GetDefaultTextEncodingForRTF() @@ -81,7 +80,6 @@ SvxRTFParser::SvxRTFParser( SfxItemPool& rPool, SvStream& rIn, int bReadNewDoc ) : SvRTFParser( rIn, 5 ), rStrm(rIn), - aColorTbl( 16, 4 ), aFontTbl( 16, 4 ), pInsPos( 0 ), pAttrPool( &rPool ), @@ -91,18 +89,18 @@ SvxRTFParser::SvxRTFParser( SfxItemPool& rPool, SvStream& rIn, { bNewDoc = bReadNewDoc; - bChkStyleAttr = bCalcValue = bReadDocInfo = bIsInReadStyleTab = FALSE; - bIsLeftToRightDef = TRUE; + bChkStyleAttr = bCalcValue = bReadDocInfo = bIsInReadStyleTab = sal_False; + bIsLeftToRightDef = sal_True; { RTFPlainAttrMapIds aTmp( rPool ); - aPlainMap.Insert( (USHORT*)&aTmp, - sizeof( RTFPlainAttrMapIds ) / sizeof(USHORT), 0 ); + aPlainMap.Insert( (sal_uInt16*)&aTmp, + sizeof( RTFPlainAttrMapIds ) / sizeof(sal_uInt16), 0 ); } { RTFPardAttrMapIds aTmp( rPool ); - aPardMap.Insert( (USHORT*)&aTmp, - sizeof( RTFPardAttrMapIds ) / sizeof(USHORT), 0 ); + aPardMap.Insert( (sal_uInt16*)&aTmp, + sizeof( RTFPardAttrMapIds ) / sizeof(sal_uInt16), 0 ); } pDfltFont = new Font; pDfltColor = new Color; @@ -122,13 +120,13 @@ void SvxRTFParser::ResetPard() SvxRTFParser::~SvxRTFParser() { - if( aColorTbl.Count() ) + if( !aColorTbl.empty() ) ClearColorTbl(); if( aFontTbl.Count() ) ClearFontTbl(); if( aStyleTbl.Count() ) ClearStyleTbl(); - if( aAttrStack.Count() ) + if( !aAttrStack.empty() ) ClearAttrStack(); delete pRTFDefaults; @@ -152,17 +150,17 @@ SvParserState SvxRTFParser::CallParser() if( !pInsPos ) return SVPAR_ERROR; - if( aColorTbl.Count() ) + if( !aColorTbl.empty() ) ClearColorTbl(); if( aFontTbl.Count() ) ClearFontTbl(); if( aStyleTbl.Count() ) ClearStyleTbl(); - if( aAttrStack.Count() ) + if( !aAttrStack.empty() ) ClearAttrStack(); - bIsSetDfltTab = FALSE; - bNewGroup = FALSE; + bIsSetDfltTab = sal_False; + bNewGroup = sal_False; nDfltFont = 0; sBaseURL.Erase(); @@ -237,7 +235,7 @@ INSINGLECHAR: { InsertText(); // all collected Attributes are set - for( USHORT n = aAttrSetList.Count(); n; ) + for( sal_uInt16 n = aAttrSetList.Count(); n; ) { SvxRTFItemStackType* pStkSet = aAttrSetList[--n]; SetAttrSet( *pStkSet ); @@ -349,8 +347,8 @@ void SvxRTFParser::ReadStyleTable() SvxRTFStyleType* pStyle = new SvxRTFStyleType( *pAttrPool, aWhichMap.GetData() ); pStyle->aAttrSet.Put( GetRTFDefaults() ); - bIsInReadStyleTab = TRUE; - bChkStyleAttr = FALSE; // Do not check Attribute against the Styles + bIsInReadStyleTab = sal_True; + bChkStyleAttr = sal_False; // Do not check Attribute against the Styles while( _nOpenBrakets && IsParserWorking() ) { @@ -381,13 +379,13 @@ void SvxRTFParser::ReadStyleTable() } break; - case RTF_SBASEDON: pStyle->nBasedOn = USHORT(nTokenValue); pStyle->bBasedOnIsSet=TRUE; break; - case RTF_SNEXT: pStyle->nNext = USHORT(nTokenValue); break; + case RTF_SBASEDON: pStyle->nBasedOn = sal_uInt16(nTokenValue); pStyle->bBasedOnIsSet=sal_True; break; + case RTF_SNEXT: pStyle->nNext = sal_uInt16(nTokenValue); break; case RTF_OUTLINELEVEL: - case RTF_SOUTLVL: pStyle->nOutlineNo = BYTE(nTokenValue); break; + case RTF_SOUTLVL: pStyle->nOutlineNo = sal_uInt8(nTokenValue); break; case RTF_S: nStyleNo = (short)nTokenValue; break; case RTF_CS: nStyleNo = (short)nTokenValue; - pStyle->bIsCharFmt = TRUE; + pStyle->bIsCharFmt = sal_True; break; case RTF_TEXTTOKEN: @@ -439,21 +437,21 @@ void SvxRTFParser::ReadStyleTable() // Flag back to old state bChkStyleAttr = bSaveChkStyleAttr; - bIsInReadStyleTab = FALSE; + bIsInReadStyleTab = sal_False; } void SvxRTFParser::ReadColorTable() { int nToken; - BYTE nRed = 0xff, nGreen = 0xff, nBlue = 0xff; + sal_uInt8 nRed = 0xff, nGreen = 0xff, nBlue = 0xff; while( '}' != ( nToken = GetNextToken() ) && IsParserWorking() ) { switch( nToken ) { - case RTF_RED: nRed = BYTE(nTokenValue); break; - case RTF_GREEN: nGreen = BYTE(nTokenValue); break; - case RTF_BLUE: nBlue = BYTE(nTokenValue); break; + case RTF_RED: nRed = sal_uInt8(nTokenValue); break; + case RTF_GREEN: nGreen = sal_uInt8(nTokenValue); break; + case RTF_BLUE: nBlue = sal_uInt8(nTokenValue); break; case RTF_TEXTTOKEN: if( 1 == aToken.Len() @@ -469,10 +467,10 @@ void SvxRTFParser::ReadColorTable() // one color is finished, fill in the table // try to map the values to SV internal names ColorPtr pColor = new Color( nRed, nGreen, nBlue ); - if( !aColorTbl.Count() && - BYTE(-1) == nRed && BYTE(-1) == nGreen && BYTE(-1) == nBlue ) + if( aColorTbl.empty() && + sal_uInt8(-1) == nRed && sal_uInt8(-1) == nGreen && sal_uInt8(-1) == nBlue ) pColor->SetColor( COL_AUTO ); - aColorTbl.Insert( pColor, aColorTbl.Count() ); + aColorTbl.push_back( pColor ); nRed = 0, nGreen = 0, nBlue = 0; // Color has been completely read, @@ -492,7 +490,7 @@ void SvxRTFParser::ReadFontTable() Font* pFont = new Font(); short nFontNo(0), nInsFontNo (0); String sAltNm, sFntNm; - BOOL bIsAltFntNm = FALSE, bCheckNewFont; + sal_Bool bIsAltFntNm = sal_False, bCheckNewFont; CharSet nSystemChar = lcl_GetDefaultTextEncodingForRTF(); pFont->SetCharSet( nSystemChar ); @@ -500,16 +498,16 @@ void SvxRTFParser::ReadFontTable() while( _nOpenBrakets && IsParserWorking() ) { - bCheckNewFont = FALSE; + bCheckNewFont = sal_False; switch( ( nToken = GetNextToken() )) { case '}': - bIsAltFntNm = FALSE; + bIsAltFntNm = sal_False; // Style has been completely read, // so this is still a stable status if( --_nOpenBrakets <= 1 && IsParserWorking() ) SaveState( RTF_FONTTBL ); - bCheckNewFont = TRUE; + bCheckNewFont = sal_True; nInsFontNo = nFontNo; break; case '{': @@ -558,7 +556,7 @@ void SvxRTFParser::ReadFontTable() if (-1 != nTokenValue) { CharSet nCharSet = rtl_getTextEncodingFromWindowsCharset( - (BYTE)nTokenValue); + (sal_uInt8)nTokenValue); pFont->SetCharSet(nCharSet); //When we're in a font, the fontname is in the font //charset, except for symbol fonts I believe @@ -579,12 +577,12 @@ void SvxRTFParser::ReadFontTable() } break; case RTF_F: - bCheckNewFont = TRUE; + bCheckNewFont = sal_True; nInsFontNo = nFontNo; nFontNo = (short)nTokenValue; break; case RTF_FALT: - bIsAltFntNm = TRUE; + bIsAltFntNm = sal_True; break; case RTF_TEXTTOKEN: DelCharAtEnd( aToken, ';' ); @@ -672,19 +670,19 @@ String& SvxRTFParser::GetTextToEndGroup( String& rStr ) util::DateTime SvxRTFParser::GetDateTimeStamp( ) { util::DateTime aDT; - BOOL bWeiter = TRUE; + sal_Bool bWeiter = sal_True; int nToken; while( bWeiter && IsParserWorking() ) { switch( nToken = GetNextToken() ) { - case RTF_YR: aDT.Year = (USHORT)nTokenValue; break; - case RTF_MO: aDT.Month = (USHORT)nTokenValue; break; - case RTF_DY: aDT.Day = (USHORT)nTokenValue; break; - case RTF_HR: aDT.Hours = (USHORT)nTokenValue; break; - case RTF_MIN: aDT.Minutes = (USHORT)nTokenValue; break; + case RTF_YR: aDT.Year = (sal_uInt16)nTokenValue; break; + case RTF_MO: aDT.Month = (sal_uInt16)nTokenValue; break; + case RTF_DY: aDT.Day = (sal_uInt16)nTokenValue; break; + case RTF_HR: aDT.Hours = (sal_uInt16)nTokenValue; break; + case RTF_MIN: aDT.Minutes = (sal_uInt16)nTokenValue; break; default: - bWeiter = FALSE; + bWeiter = sal_False; } } SkipToken( -1 ); // the closing brace is evaluated "above" @@ -799,27 +797,32 @@ void SvxRTFParser::ReadInfo( const sal_Char* pChkForVerNo ) void SvxRTFParser::ClearColorTbl() { - aColorTbl.DeleteAndDestroy( 0, aColorTbl.Count() ); + while ( !aColorTbl.empty() ) + { + delete aColorTbl.back(); + aColorTbl.pop_back(); + } } void SvxRTFParser::ClearFontTbl() { - for( ULONG nCnt = aFontTbl.Count(); nCnt; ) + for( sal_uInt32 nCnt = aFontTbl.Count(); nCnt; ) delete aFontTbl.GetObject( --nCnt ); } void SvxRTFParser::ClearStyleTbl() { - for( ULONG nCnt = aStyleTbl.Count(); nCnt; ) + for( sal_uInt32 nCnt = aStyleTbl.Count(); nCnt; ) delete aStyleTbl.GetObject( --nCnt ); } void SvxRTFParser::ClearAttrStack() { SvxRTFItemStackType* pTmp; - for( ULONG nCnt = aAttrStack.Count(); nCnt; --nCnt ) + for( size_t nCnt = aAttrStack.size(); nCnt; --nCnt ) { - pTmp = aAttrStack.Pop(); + pTmp = aAttrStack.back(); + aAttrStack.pop_back(); delete pTmp; } } @@ -836,7 +839,7 @@ String& SvxRTFParser::DelCharAtEnd( String& rStr, const sal_Unicode cDel ) } -const Font& SvxRTFParser::GetFont( USHORT nId ) +const Font& SvxRTFParser::GetFont( sal_uInt16 nId ) { const Font* pFont = aFontTbl.Get( nId ); if( !pFont ) @@ -853,7 +856,7 @@ const Font& SvxRTFParser::GetFont( USHORT nId ) SvxRTFItemStackType* SvxRTFParser::_GetAttrSet( int bCopyAttr ) { - SvxRTFItemStackType* pAkt = aAttrStack.Top(); + SvxRTFItemStackType* pAkt = aAttrStack.empty() ? 0 : aAttrStack.back(); SvxRTFItemStackType* pNew; if( pAkt ) pNew = new SvxRTFItemStackType( *pAkt, *pInsPos, bCopyAttr ); @@ -862,8 +865,8 @@ SvxRTFItemStackType* SvxRTFParser::_GetAttrSet( int bCopyAttr ) *pInsPos ); pNew->SetRTFDefaults( GetRTFDefaults() ); - aAttrStack.Push( pNew ); - bNewGroup = FALSE; + aAttrStack.push_back( pNew ); + bNewGroup = sal_False; return pNew; } @@ -882,10 +885,10 @@ void SvxRTFParser::_ClearStyleAttr( SvxRTFItemStackType& rStkType ) !rStkType.GetAttrSet().Count() || 0 == ( pStyle = aStyleTbl.Get( rStkType.nStyleNo ) )) { - for( USHORT nWhich = aIter.GetCurWhich(); nWhich; nWhich = aIter.NextWhich() ) + for( sal_uInt16 nWhich = aIter.GetCurWhich(); nWhich; nWhich = aIter.NextWhich() ) { if( SFX_WHICH_MAX > nWhich && - SFX_ITEM_SET == rSet.GetItemState( nWhich, FALSE, &pItem ) && + SFX_ITEM_SET == rSet.GetItemState( nWhich, sal_False, &pItem ) && rPool.GetDefaultItem( nWhich ) == *pItem ) rSet.ClearItem( nWhich ); // delete } @@ -896,16 +899,16 @@ void SvxRTFParser::_ClearStyleAttr( SvxRTFItemStackType& rStkType ) // from the current AttrSet. SfxItemSet &rStyleSet = pStyle->aAttrSet; const SfxPoolItem* pSItem; - for( USHORT nWhich = aIter.GetCurWhich(); nWhich; nWhich = aIter.NextWhich() ) + for( sal_uInt16 nWhich = aIter.GetCurWhich(); nWhich; nWhich = aIter.NextWhich() ) { - if( SFX_ITEM_SET == rStyleSet.GetItemState( nWhich, TRUE, &pSItem )) + if( SFX_ITEM_SET == rStyleSet.GetItemState( nWhich, sal_True, &pSItem )) { - if( SFX_ITEM_SET == rSet.GetItemState( nWhich, FALSE, &pItem ) + if( SFX_ITEM_SET == rSet.GetItemState( nWhich, sal_False, &pItem ) && *pItem == *pSItem ) rSet.ClearItem( nWhich ); // delete } else if( SFX_WHICH_MAX > nWhich && - SFX_ITEM_SET == rSet.GetItemState( nWhich, FALSE, &pItem ) && + SFX_ITEM_SET == rSet.GetItemState( nWhich, sal_False, &pItem ) && rPool.GetDefaultItem( nWhich ) == *pItem ) rSet.ClearItem( nWhich ); // delete } @@ -914,13 +917,14 @@ void SvxRTFParser::_ClearStyleAttr( SvxRTFItemStackType& rStkType ) void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack { - if( aAttrStack.Count() ) + if( !aAttrStack.empty() ) { - SvxRTFItemStackType *pOld = aAttrStack.Pop(); - SvxRTFItemStackType *pAkt = aAttrStack.Top(); + SvxRTFItemStackType *pOld = aAttrStack.empty() ? 0 : aAttrStack.back(); + aAttrStack.pop_back(); + SvxRTFItemStackType *pAkt = aAttrStack.empty() ? 0 : aAttrStack.back(); do { // middle check loop - ULONG nOldSttNdIdx = pOld->pSttNd->GetIdx(); + sal_uLong nOldSttNdIdx = pOld->pSttNd->GetIdx(); if( !pOld->pChildList && ((!pOld->aAttrSet.Count() && !pOld->nStyleNo ) || (nOldSttNdIdx == pInsPos->GetNodeIdx() && @@ -932,10 +936,10 @@ void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack { SfxItemIter aIter( pOld->aAttrSet ); const SfxPoolItem* pItem = aIter.GetCurItem(), *pGet; - while( TRUE ) + while( sal_True ) { if( SFX_ITEM_SET == pAkt->aAttrSet.GetItemState( - pItem->Which(), FALSE, &pGet ) && + pItem->Which(), sal_False, &pGet ) && *pItem == *pGet ) pOld->aAttrSet.ClearItem( pItem->Which() ); @@ -954,8 +958,8 @@ void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack if( bCrsrBack ) { // at the beginning of a paragraph? Move back one position - ULONG nNd = pInsPos->GetNodeIdx(); - MovePos( FALSE ); + sal_uLong nNd = pInsPos->GetNodeIdx(); + MovePos( sal_False ); // if can not move backward then later dont move forward ! bCrsrBack = nNd != pInsPos->GetNodeIdx(); } @@ -979,11 +983,11 @@ void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack // - all paragraph attributes to get the area // up to the previous paragraph SvxRTFItemStackType* pNew = new SvxRTFItemStackType( - *pOld, *pInsPos, TRUE ); + *pOld, *pInsPos, sal_True ); pNew->aAttrSet.SetParent( pOld->aAttrSet.GetParent() ); // Delete all paragraph attributes from pNew - for( USHORT n = 0; n < aPardMap.Count() && + for( sal_uInt16 n = 0; n < aPardMap.Count() && pNew->aAttrSet.Count(); ++n ) if( aPardMap[n] ) pNew->aAttrSet.ClearItem( aPardMap[n] ); @@ -1049,19 +1053,19 @@ void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack if( bCrsrBack && 50 < pAkt->pChildList->Count() ) { // at the beginning of a paragraph? Move back one position - MovePos( TRUE ); - bCrsrBack = FALSE; + MovePos( sal_True ); + bCrsrBack = sal_False; // Open a new Group. SvxRTFItemStackType* pNew = new SvxRTFItemStackType( - *pAkt, *pInsPos, TRUE ); + *pAkt, *pInsPos, sal_True ); pNew->SetRTFDefaults( GetRTFDefaults() ); // Set all until here valid Attributes AttrGroupEnd(); - pAkt = aAttrStack.Top(); // can be changed after AttrGroupEnd! + pAkt = aAttrStack.empty() ? 0 : aAttrStack.back(); // can be changed after AttrGroupEnd! pNew->aAttrSet.SetParent( pAkt ? &pAkt->aAttrSet : 0 ); - aAttrStack.Push( pNew ); + aAttrStack.push_back( pNew ); pAkt = pNew; } } @@ -1075,24 +1079,24 @@ void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack if( bCrsrBack ) // at the beginning of a paragraph? Move back one position - MovePos( TRUE ); + MovePos( sal_True ); - } while( FALSE ); + } while( sal_False ); if( pOld ) delete pOld; - bNewGroup = FALSE; + bNewGroup = sal_False; } } void SvxRTFParser::SetAllAttrOfStk() // end all Attr. and set it into doc { - // Yet to get all Attrbutes from the stack! - while( aAttrStack.Count() ) + // repeat until all attributes will be taken from stack + while( !aAttrStack.empty() ) AttrGroupEnd(); - for( USHORT n = aAttrSetList.Count(); n; ) + for( sal_uInt16 n = aAttrSetList.Count(); n; ) { SvxRTFItemStackType* pStkSet = aAttrSetList[--n]; SetAttrSet( *pStkSet ); @@ -1114,14 +1118,14 @@ void SvxRTFParser::SetAttrSet( SvxRTFItemStackType &rSet ) // then process all the children if( rSet.pChildList ) - for( USHORT n = 0; n < rSet.pChildList->Count(); ++n ) + for( sal_uInt16 n = 0; n < rSet.pChildList->Count(); ++n ) SetAttrSet( *(*rSet.pChildList)[ n ] ); } // Has no Text been inserted yet? (SttPos from the top Stack entry!) int SvxRTFParser::IsAttrSttPos() { - SvxRTFItemStackType* pAkt = aAttrStack.Top(); + SvxRTFItemStackType* pAkt = aAttrStack.empty() ? 0 : aAttrStack.back(); return !pAkt || (pAkt->pSttNd->GetIdx() == pInsPos->GetNodeIdx() && pAkt->nSttCnt == pInsPos->GetCntIdx()); } @@ -1135,13 +1139,13 @@ void SvxRTFParser::BuildWhichTbl() { if( aWhichMap.Count() ) aWhichMap.Remove( 0, aWhichMap.Count() ); - aWhichMap.Insert( (USHORT)0, (USHORT)0 ); + aWhichMap.Insert( (sal_uInt16)0, (sal_uInt16)0 ); // Building a Which-Map 'rWhichMap' from an Array of // 'pWhichIds' frm Which-Ids. It has the long 'nWhichIds'. // The Which-Map is not going to be deleted. - SvParser::BuildWhichTbl( aWhichMap, (USHORT*)aPardMap.GetData(), aPardMap.Count() ); - SvParser::BuildWhichTbl( aWhichMap, (USHORT*)aPlainMap.GetData(), aPlainMap.Count() ); + SvParser::BuildWhichTbl( aWhichMap, (sal_uInt16*)aPardMap.GetData(), aPardMap.Count() ); + SvParser::BuildWhichTbl( aWhichMap, (sal_uInt16*)aPlainMap.GetData(), aPlainMap.Count() ); } const SfxItemSet& SvxRTFParser::GetRTFDefaults() @@ -1149,10 +1153,10 @@ const SfxItemSet& SvxRTFParser::GetRTFDefaults() if( !pRTFDefaults ) { pRTFDefaults = new SfxItemSet( *pAttrPool, aWhichMap.GetData() ); - USHORT nId; + sal_uInt16 nId; if( 0 != ( nId = ((RTFPardAttrMapIds*)aPardMap.GetData())->nScriptSpace )) { - SvxScriptSpaceItem aItem( FALSE, nId ); + SvxScriptSpaceItem aItem( sal_False, nId ); if( bNewDoc ) pAttrPool->SetPoolDefaultItem( aItem ); else @@ -1164,19 +1168,19 @@ const SfxItemSet& SvxRTFParser::GetRTFDefaults() /**/ -SvxRTFStyleType::SvxRTFStyleType( SfxItemPool& rPool, const USHORT* pWhichRange ) +SvxRTFStyleType::SvxRTFStyleType( SfxItemPool& rPool, const sal_uInt16* pWhichRange ) : aAttrSet( rPool, pWhichRange ) { - nOutlineNo = BYTE(-1); // not set + nOutlineNo = sal_uInt8(-1); // not set nBasedOn = 0; - bBasedOnIsSet = FALSE; + bBasedOnIsSet = sal_False; //$flr #117411# nNext = 0; - bIsCharFmt = FALSE; + bIsCharFmt = sal_False; } SvxRTFItemStackType::SvxRTFItemStackType( - SfxItemPool& rPool, const USHORT* pWhichRange, + SfxItemPool& rPool, const sal_uInt16* pWhichRange, const SvxPosition& rPos ) : aAttrSet( rPool, pWhichRange ), pChildList( 0 ), @@ -1252,8 +1256,8 @@ void SvxRTFItemStackType::MoveFullNode(const SvxNodeIdx &rOldNode, } //And the same for all the children - USHORT nCount = pChildList ? pChildList->Count() : 0; - for (USHORT i = 0; i < nCount; ++i) + sal_uInt16 nCount = pChildList ? pChildList->Count() : 0; + for (sal_uInt16 i = 0; i < nCount; ++i) { SvxRTFItemStackType* pStk = (*pChildList)[i]; pStk->MoveFullNode(rOldNode, rNewNode); @@ -1269,7 +1273,7 @@ void SvxRTFItemStackType::Compress( const SvxRTFParser& rParser ) { DBG_ASSERT( pChildList, "There is no child list" ); - USHORT n; + sal_uInt16 n; SvxRTFItemStackType* pTmp = (*pChildList)[0]; if( !pTmp->aAttrSet.Count() || @@ -1308,15 +1312,15 @@ void SvxRTFItemStackType::Compress( const SvxRTFParser& rParser ) SfxItemIter aIter( aMrgSet ); const SfxPoolItem* pItem; do { - USHORT nWhich = aIter.GetCurItem()->Which(); + sal_uInt16 nWhich = aIter.GetCurItem()->Which(); if( SFX_ITEM_SET != pTmp->aAttrSet.GetItemState( nWhich, - FALSE, &pItem ) || *pItem != *aIter.GetCurItem() ) + sal_False, &pItem ) || *pItem != *aIter.GetCurItem() ) aMrgSet.ClearItem( nWhich ); if( aIter.IsAtEnd() ) break; aIter.NextItem(); - } while( TRUE ); + } while( sal_True ); if( !aMrgSet.Count() ) return; @@ -1357,14 +1361,14 @@ void SvxRTFItemStackType::SetRTFDefaults( const SfxItemSet& rDefaults ) { SfxItemIter aIter( rDefaults ); do { - USHORT nWhich = aIter.GetCurItem()->Which(); - if( SFX_ITEM_SET != aAttrSet.GetItemState( nWhich, FALSE )) + sal_uInt16 nWhich = aIter.GetCurItem()->Which(); + if( SFX_ITEM_SET != aAttrSet.GetItemState( nWhich, sal_False )) aAttrSet.Put( *aIter.GetCurItem() ); if( aIter.IsAtEnd() ) break; aIter.NextItem(); - } while( TRUE ); + } while( sal_True ); } } @@ -1372,62 +1376,62 @@ void SvxRTFItemStackType::SetRTFDefaults( const SfxItemSet& rDefaults ) RTFPlainAttrMapIds::RTFPlainAttrMapIds( const SfxItemPool& rPool ) { - nCaseMap = rPool.GetTrueWhich( SID_ATTR_CHAR_CASEMAP, FALSE ); - nBgColor = rPool.GetTrueWhich( SID_ATTR_BRUSH_CHAR, FALSE ); - nColor = rPool.GetTrueWhich( SID_ATTR_CHAR_COLOR, FALSE ); - nContour = rPool.GetTrueWhich( SID_ATTR_CHAR_CONTOUR, FALSE ); - nCrossedOut = rPool.GetTrueWhich( SID_ATTR_CHAR_STRIKEOUT, FALSE ); - nEscapement = rPool.GetTrueWhich( SID_ATTR_CHAR_ESCAPEMENT, FALSE ); - nFont = rPool.GetTrueWhich( SID_ATTR_CHAR_FONT, FALSE ); - nFontHeight = rPool.GetTrueWhich( SID_ATTR_CHAR_FONTHEIGHT, FALSE ); - nKering = rPool.GetTrueWhich( SID_ATTR_CHAR_KERNING, FALSE ); - nLanguage = rPool.GetTrueWhich( SID_ATTR_CHAR_LANGUAGE, FALSE ); - nPosture = rPool.GetTrueWhich( SID_ATTR_CHAR_POSTURE, FALSE ); - nShadowed = rPool.GetTrueWhich( SID_ATTR_CHAR_SHADOWED, FALSE ); - nUnderline = rPool.GetTrueWhich( SID_ATTR_CHAR_UNDERLINE, FALSE ); - nOverline = rPool.GetTrueWhich( SID_ATTR_CHAR_OVERLINE, FALSE ); - nWeight = rPool.GetTrueWhich( SID_ATTR_CHAR_WEIGHT, FALSE ); - nWordlineMode = rPool.GetTrueWhich( SID_ATTR_CHAR_WORDLINEMODE, FALSE ); - nAutoKerning = rPool.GetTrueWhich( SID_ATTR_CHAR_AUTOKERN, FALSE ); - - nCJKFont = rPool.GetTrueWhich( SID_ATTR_CHAR_CJK_FONT, FALSE ); - nCJKFontHeight = rPool.GetTrueWhich( SID_ATTR_CHAR_CJK_FONTHEIGHT, FALSE ); - nCJKLanguage = rPool.GetTrueWhich( SID_ATTR_CHAR_CJK_LANGUAGE, FALSE ); - nCJKPosture = rPool.GetTrueWhich( SID_ATTR_CHAR_CJK_POSTURE, FALSE ); - nCJKWeight = rPool.GetTrueWhich( SID_ATTR_CHAR_CJK_WEIGHT, FALSE ); - nCTLFont = rPool.GetTrueWhich( SID_ATTR_CHAR_CTL_FONT, FALSE ); - nCTLFontHeight = rPool.GetTrueWhich( SID_ATTR_CHAR_CTL_FONTHEIGHT, FALSE ); - nCTLLanguage = rPool.GetTrueWhich( SID_ATTR_CHAR_CTL_LANGUAGE, FALSE ); - nCTLPosture = rPool.GetTrueWhich( SID_ATTR_CHAR_CTL_POSTURE, FALSE ); - nCTLWeight = rPool.GetTrueWhich( SID_ATTR_CHAR_CTL_WEIGHT, FALSE ); - nEmphasis = rPool.GetTrueWhich( SID_ATTR_CHAR_EMPHASISMARK, FALSE ); - nTwoLines = rPool.GetTrueWhich( SID_ATTR_CHAR_TWO_LINES, FALSE ); - nRuby = 0; //rPool.GetTrueWhich( SID_ATTR_CHAR_CJK_RUBY, FALSE ); - nCharScaleX = rPool.GetTrueWhich( SID_ATTR_CHAR_SCALEWIDTH, FALSE ); - nHorzVert = rPool.GetTrueWhich( SID_ATTR_CHAR_ROTATED, FALSE ); - nRelief = rPool.GetTrueWhich( SID_ATTR_CHAR_RELIEF, FALSE ); - nHidden = rPool.GetTrueWhich( SID_ATTR_CHAR_HIDDEN, FALSE ); + nCaseMap = rPool.GetTrueWhich( SID_ATTR_CHAR_CASEMAP, sal_False ); + nBgColor = rPool.GetTrueWhich( SID_ATTR_BRUSH_CHAR, sal_False ); + nColor = rPool.GetTrueWhich( SID_ATTR_CHAR_COLOR, sal_False ); + nContour = rPool.GetTrueWhich( SID_ATTR_CHAR_CONTOUR, sal_False ); + nCrossedOut = rPool.GetTrueWhich( SID_ATTR_CHAR_STRIKEOUT, sal_False ); + nEscapement = rPool.GetTrueWhich( SID_ATTR_CHAR_ESCAPEMENT, sal_False ); + nFont = rPool.GetTrueWhich( SID_ATTR_CHAR_FONT, sal_False ); + nFontHeight = rPool.GetTrueWhich( SID_ATTR_CHAR_FONTHEIGHT, sal_False ); + nKering = rPool.GetTrueWhich( SID_ATTR_CHAR_KERNING, sal_False ); + nLanguage = rPool.GetTrueWhich( SID_ATTR_CHAR_LANGUAGE, sal_False ); + nPosture = rPool.GetTrueWhich( SID_ATTR_CHAR_POSTURE, sal_False ); + nShadowed = rPool.GetTrueWhich( SID_ATTR_CHAR_SHADOWED, sal_False ); + nUnderline = rPool.GetTrueWhich( SID_ATTR_CHAR_UNDERLINE, sal_False ); + nOverline = rPool.GetTrueWhich( SID_ATTR_CHAR_OVERLINE, sal_False ); + nWeight = rPool.GetTrueWhich( SID_ATTR_CHAR_WEIGHT, sal_False ); + nWordlineMode = rPool.GetTrueWhich( SID_ATTR_CHAR_WORDLINEMODE, sal_False ); + nAutoKerning = rPool.GetTrueWhich( SID_ATTR_CHAR_AUTOKERN, sal_False ); + + nCJKFont = rPool.GetTrueWhich( SID_ATTR_CHAR_CJK_FONT, sal_False ); + nCJKFontHeight = rPool.GetTrueWhich( SID_ATTR_CHAR_CJK_FONTHEIGHT, sal_False ); + nCJKLanguage = rPool.GetTrueWhich( SID_ATTR_CHAR_CJK_LANGUAGE, sal_False ); + nCJKPosture = rPool.GetTrueWhich( SID_ATTR_CHAR_CJK_POSTURE, sal_False ); + nCJKWeight = rPool.GetTrueWhich( SID_ATTR_CHAR_CJK_WEIGHT, sal_False ); + nCTLFont = rPool.GetTrueWhich( SID_ATTR_CHAR_CTL_FONT, sal_False ); + nCTLFontHeight = rPool.GetTrueWhich( SID_ATTR_CHAR_CTL_FONTHEIGHT, sal_False ); + nCTLLanguage = rPool.GetTrueWhich( SID_ATTR_CHAR_CTL_LANGUAGE, sal_False ); + nCTLPosture = rPool.GetTrueWhich( SID_ATTR_CHAR_CTL_POSTURE, sal_False ); + nCTLWeight = rPool.GetTrueWhich( SID_ATTR_CHAR_CTL_WEIGHT, sal_False ); + nEmphasis = rPool.GetTrueWhich( SID_ATTR_CHAR_EMPHASISMARK, sal_False ); + nTwoLines = rPool.GetTrueWhich( SID_ATTR_CHAR_TWO_LINES, sal_False ); + nRuby = 0; //rPool.GetTrueWhich( SID_ATTR_CHAR_CJK_RUBY, sal_False ); + nCharScaleX = rPool.GetTrueWhich( SID_ATTR_CHAR_SCALEWIDTH, sal_False ); + nHorzVert = rPool.GetTrueWhich( SID_ATTR_CHAR_ROTATED, sal_False ); + nRelief = rPool.GetTrueWhich( SID_ATTR_CHAR_RELIEF, sal_False ); + nHidden = rPool.GetTrueWhich( SID_ATTR_CHAR_HIDDEN, sal_False ); } RTFPardAttrMapIds ::RTFPardAttrMapIds ( const SfxItemPool& rPool ) { - nLinespacing = rPool.GetTrueWhich( SID_ATTR_PARA_LINESPACE, FALSE ); - nAdjust = rPool.GetTrueWhich( SID_ATTR_PARA_ADJUST, FALSE ); - nTabStop = rPool.GetTrueWhich( SID_ATTR_TABSTOP, FALSE ); - nHyphenzone = rPool.GetTrueWhich( SID_ATTR_PARA_HYPHENZONE, FALSE ); - nLRSpace = rPool.GetTrueWhich( SID_ATTR_LRSPACE, FALSE ); - nULSpace = rPool.GetTrueWhich( SID_ATTR_ULSPACE, FALSE ); - nBrush = rPool.GetTrueWhich( SID_ATTR_BRUSH, FALSE ); - nBox = rPool.GetTrueWhich( SID_ATTR_BORDER_OUTER, FALSE ); - nShadow = rPool.GetTrueWhich( SID_ATTR_BORDER_SHADOW, FALSE ); - nOutlineLvl = rPool.GetTrueWhich( SID_ATTR_PARA_OUTLLEVEL, FALSE ); - nSplit = rPool.GetTrueWhich( SID_ATTR_PARA_SPLIT, FALSE ); - nKeep = rPool.GetTrueWhich( SID_ATTR_PARA_KEEP, FALSE ); - nFontAlign = rPool.GetTrueWhich( SID_PARA_VERTALIGN, FALSE ); - nScriptSpace = rPool.GetTrueWhich( SID_ATTR_PARA_SCRIPTSPACE, FALSE ); - nHangPunct = rPool.GetTrueWhich( SID_ATTR_PARA_HANGPUNCTUATION, FALSE ); - nForbRule = rPool.GetTrueWhich( SID_ATTR_PARA_FORBIDDEN_RULES, FALSE ); - nDirection = rPool.GetTrueWhich( SID_ATTR_FRAMEDIRECTION, FALSE ); + nLinespacing = rPool.GetTrueWhich( SID_ATTR_PARA_LINESPACE, sal_False ); + nAdjust = rPool.GetTrueWhich( SID_ATTR_PARA_ADJUST, sal_False ); + nTabStop = rPool.GetTrueWhich( SID_ATTR_TABSTOP, sal_False ); + nHyphenzone = rPool.GetTrueWhich( SID_ATTR_PARA_HYPHENZONE, sal_False ); + nLRSpace = rPool.GetTrueWhich( SID_ATTR_LRSPACE, sal_False ); + nULSpace = rPool.GetTrueWhich( SID_ATTR_ULSPACE, sal_False ); + nBrush = rPool.GetTrueWhich( SID_ATTR_BRUSH, sal_False ); + nBox = rPool.GetTrueWhich( SID_ATTR_BORDER_OUTER, sal_False ); + nShadow = rPool.GetTrueWhich( SID_ATTR_BORDER_SHADOW, sal_False ); + nOutlineLvl = rPool.GetTrueWhich( SID_ATTR_PARA_OUTLLEVEL, sal_False ); + nSplit = rPool.GetTrueWhich( SID_ATTR_PARA_SPLIT, sal_False ); + nKeep = rPool.GetTrueWhich( SID_ATTR_PARA_KEEP, sal_False ); + nFontAlign = rPool.GetTrueWhich( SID_PARA_VERTALIGN, sal_False ); + nScriptSpace = rPool.GetTrueWhich( SID_ATTR_PARA_SCRIPTSPACE, sal_False ); + nHangPunct = rPool.GetTrueWhich( SID_ATTR_PARA_HANGPUNCTUATION, sal_False ); + nForbRule = rPool.GetTrueWhich( SID_ATTR_PARA_FORBIDDEN_RULES, sal_False ); + nDirection = rPool.GetTrueWhich( SID_ATTR_FRAMEDIRECTION, sal_False ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/source/uno/UnoForbiddenCharsTable.cxx b/editeng/source/uno/UnoForbiddenCharsTable.cxx index 3e1a5f9143ad..c17a8ca556da 100644..100755 --- a/editeng/source/uno/UnoForbiddenCharsTable.cxx +++ b/editeng/source/uno/UnoForbiddenCharsTable.cxx @@ -64,7 +64,7 @@ ForbiddenCharacters SvxUnoForbiddenCharsTable::getForbiddenCharacters( const Loc throw RuntimeException(); const LanguageType eLang = SvxLocaleToLanguage( rLocale ); - const ForbiddenCharacters* pForbidden = mxForbiddenChars->GetForbiddenCharacters( eLang, FALSE ); + const ForbiddenCharacters* pForbidden = mxForbiddenChars->GetForbiddenCharacters( eLang, sal_False ); if(!pForbidden) throw NoSuchElementException(); @@ -80,7 +80,7 @@ sal_Bool SvxUnoForbiddenCharsTable::hasForbiddenCharacters( const Locale& rLocal return sal_False; const LanguageType eLang = SvxLocaleToLanguage( rLocale ); - const ForbiddenCharacters* pForbidden = mxForbiddenChars->GetForbiddenCharacters( eLang, FALSE ); + const ForbiddenCharacters* pForbidden = mxForbiddenChars->GetForbiddenCharacters( eLang, sal_False ); return NULL != pForbidden; } @@ -128,7 +128,7 @@ Sequence< Locale > SAL_CALL SvxUnoForbiddenCharsTable::getLocales() for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ ) { - const ULONG nLanguage = mxForbiddenChars->GetObjectKey( nIndex ); + const sal_uLong nLanguage = mxForbiddenChars->GetObjectKey( nIndex ); SvxLanguageToLocale ( *pLocales++, static_cast < LanguageType > (nLanguage) ); } } diff --git a/editeng/source/uno/makefile.mk b/editeng/source/uno/makefile.mk deleted file mode 100644 index 573dd21508a2..000000000000 --- a/editeng/source/uno/makefile.mk +++ /dev/null @@ -1,61 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2000, 2010 Oracle and/or its affiliates. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=editeng -TARGET=uno -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES= \ - $(SLO)$/unonrule.obj \ - $(SLO)$/unoedsrc.obj \ - $(SLO)$/unoedhlp.obj \ - $(SLO)$/unofdesc.obj \ - $(SLO)$/unoviwou.obj \ - $(SLO)$/unofored.obj \ - $(SLO)$/unoforou.obj \ - $(SLO)$/unoipset.obj \ - $(SLO)$/unotext.obj \ - $(SLO)$/unotext2.obj \ - $(SLO)$/unofield.obj \ - $(SLO)$/UnoForbiddenCharsTable.obj \ - $(SLO)$/unopracc.obj \ - $(SLO)$/unoedprx.obj \ - $(SLO)$/unoviwed.obj - -# --- Tagets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/editeng/source/uno/unoedhlp.cxx b/editeng/source/uno/unoedhlp.cxx index fc7dc6e64c34..01dd6dfee54e 100644..100755 --- a/editeng/source/uno/unoedhlp.cxx +++ b/editeng/source/uno/unoedhlp.cxx @@ -38,46 +38,46 @@ TYPEINIT1( SvxEditSourceHint, TextHint ); -SvxEditSourceHint::SvxEditSourceHint( ULONG _nId ) : +SvxEditSourceHint::SvxEditSourceHint( sal_uLong _nId ) : TextHint( _nId ), mnStart( 0 ), mnEnd( 0 ) { } -SvxEditSourceHint::SvxEditSourceHint( ULONG _nId, ULONG nValue, ULONG nStart, ULONG nEnd ) : +SvxEditSourceHint::SvxEditSourceHint( sal_uLong _nId, sal_uLong nValue, sal_uLong nStart, sal_uLong nEnd ) : TextHint( _nId, nValue ), mnStart( nStart), mnEnd( nEnd ) { } -ULONG SvxEditSourceHint::GetValue() const +sal_uLong SvxEditSourceHint::GetValue() const { return TextHint::GetValue(); } -ULONG SvxEditSourceHint::GetStartValue() const +sal_uLong SvxEditSourceHint::GetStartValue() const { return mnStart; } -ULONG SvxEditSourceHint::GetEndValue() const +sal_uLong SvxEditSourceHint::GetEndValue() const { return mnEnd; } -void SvxEditSourceHint::SetValue( ULONG n ) +void SvxEditSourceHint::SetValue( sal_uLong n ) { TextHint::SetValue( n ); } -void SvxEditSourceHint::SetStartValue( ULONG n ) +void SvxEditSourceHint::SetStartValue( sal_uLong n ) { mnStart = n; } -void SvxEditSourceHint::SetEndValue( ULONG n ) +void SvxEditSourceHint::SetEndValue( sal_uLong n ) { mnEnd = n; } @@ -132,14 +132,14 @@ void SvxEditSourceHint::SetEndValue( ULONG n ) return ::std::auto_ptr<SfxHint>( new SfxHint() ); } -sal_Bool SvxEditSourceHelper::GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, const EditEngine& rEE, USHORT nPara, USHORT nIndex ) +sal_Bool SvxEditSourceHelper::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, const EditEngine& rEE, sal_uInt16 nPara, sal_uInt16 nIndex ) { EECharAttribArray aCharAttribs; rEE.GetCharAttribs( nPara, aCharAttribs ); // find closest index in front of nIndex - USHORT nAttr, nCurrIndex; + sal_uInt16 nAttr, nCurrIndex; sal_Int32 nClosestStartIndex; for( nAttr=0, nClosestStartIndex=0; nAttr<aCharAttribs.Count(); ++nAttr ) { @@ -167,8 +167,8 @@ sal_Bool SvxEditSourceHelper::GetAttributeRun( USHORT& nStartIndex, USHORT& nEnd } } - nStartIndex = static_cast<USHORT>( nClosestStartIndex ); - nEndIndex = static_cast<USHORT>( nClosestEndIndex ); + nStartIndex = static_cast<sal_uInt16>( nClosestStartIndex ); + nEndIndex = static_cast<sal_uInt16>( nClosestEndIndex ); return sal_True; } diff --git a/editeng/source/uno/unoedprx.cxx b/editeng/source/uno/unoedprx.cxx index 1d1917d6765d..45abc3f4a459 100644..100755 --- a/editeng/source/uno/unoedprx.cxx +++ b/editeng/source/uno/unoedprx.cxx @@ -77,11 +77,11 @@ public: ~SvxAccessibleTextIndex() {}; // Get/Set current paragraph - void SetParagraph( USHORT nPara ) + void SetParagraph( sal_uInt16 nPara ) { mnPara = nPara; } - USHORT GetParagraph() const { return mnPara; } + sal_uInt16 GetParagraph() const { return mnPara; } /** Set the index in the UAA semantic @@ -92,7 +92,7 @@ public: The text forwarder to use in the calculations */ void SetIndex( sal_Int32 nIndex, const SvxTextForwarder& rTF ); - void SetIndex( USHORT nPara, sal_Int32 nIndex, const SvxTextForwarder& rTF ) { SetParagraph(nPara); SetIndex(nIndex, rTF); } + void SetIndex( sal_uInt16 nPara, sal_Int32 nIndex, const SvxTextForwarder& rTF ) { SetParagraph(nPara); SetIndex(nIndex, rTF); } sal_Int32 GetIndex() const { return mnIndex; } /** Set the index in the edit engine semantic @@ -106,9 +106,9 @@ public: @param rTF The text forwarder to use in the calculations */ - void SetEEIndex( USHORT nEEIndex, const SvxTextForwarder& rTF ); - void SetEEIndex( USHORT nPara, USHORT nEEIndex, const SvxTextForwarder& rTF ) { SetParagraph(nPara); SetEEIndex(nEEIndex, rTF); } - USHORT GetEEIndex() const; + void SetEEIndex( sal_uInt16 nEEIndex, const SvxTextForwarder& rTF ); + void SetEEIndex( sal_uInt16 nPara, sal_uInt16 nEEIndex, const SvxTextForwarder& rTF ) { SetParagraph(nPara); SetEEIndex(nEEIndex, rTF); } + sal_uInt16 GetEEIndex() const; void SetFieldOffset( sal_Int32 nOffset, sal_Int32 nLen ) { mnFieldOffset = nOffset; mnFieldLen = nLen; } sal_Int32 GetFieldOffset() const { return mnFieldOffset; } @@ -129,7 +129,7 @@ public: sal_Bool IsEditableRange( const SvxAccessibleTextIndex& rEnd ) const; private: - USHORT mnPara; + sal_uInt16 mnPara; sal_Int32 mnIndex; sal_Int32 mnEEIndex; sal_Int32 mnFieldOffset; @@ -179,15 +179,15 @@ ESelection MakeEESelection( const SvxAccessibleTextIndex& rIndex ) rIndex.GetParagraph(), rIndex.GetEEIndex() + 1 ); } -USHORT SvxAccessibleTextIndex::GetEEIndex() const +sal_uInt16 SvxAccessibleTextIndex::GetEEIndex() const { DBG_ASSERT(mnEEIndex >= 0 && mnEEIndex <= USHRT_MAX, "SvxAccessibleTextIndex::GetEEIndex: index value overflow"); - return static_cast< USHORT > (mnEEIndex); + return static_cast< sal_uInt16 > (mnEEIndex); } -void SvxAccessibleTextIndex::SetEEIndex( USHORT nEEIndex, const SvxTextForwarder& rTF ) +void SvxAccessibleTextIndex::SetEEIndex( sal_uInt16 nEEIndex, const SvxTextForwarder& rTF ) { // reset mnFieldOffset = 0; @@ -201,7 +201,7 @@ void SvxAccessibleTextIndex::SetEEIndex( USHORT nEEIndex, const SvxTextForwarder mnEEIndex = nEEIndex; // calculate unknowns - USHORT nCurrField, nFieldCount = rTF.GetFieldCount( GetParagraph() ); + sal_uInt16 nCurrField, nFieldCount = rTF.GetFieldCount( GetParagraph() ); mnIndex = nEEIndex; @@ -247,7 +247,7 @@ void SvxAccessibleTextIndex::SetIndex( sal_Int32 nIndex, const SvxTextForwarder& mnIndex = nIndex; // calculate unknowns - USHORT nCurrField, nFieldCount = rTF.GetFieldCount( GetParagraph() ); + sal_uInt16 nCurrField, nFieldCount = rTF.GetFieldCount( GetParagraph() ); DBG_ASSERT(nIndex >= 0 && nIndex <= USHRT_MAX, "SvxAccessibleTextIndex::SetIndex: index value overflow"); @@ -456,21 +456,21 @@ SvxAccessibleTextAdapter::~SvxAccessibleTextAdapter() { } -USHORT SvxAccessibleTextAdapter::GetParagraphCount() const +sal_uInt16 SvxAccessibleTextAdapter::GetParagraphCount() const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); return mrTextForwarder->GetParagraphCount(); } -USHORT SvxAccessibleTextAdapter::GetTextLen( USHORT nParagraph ) const +sal_uInt16 SvxAccessibleTextAdapter::GetTextLen( sal_uInt16 nParagraph ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aIndex; aIndex.SetEEIndex( nParagraph, mrTextForwarder->GetTextLen( nParagraph ), *this ); - return static_cast< USHORT >(aIndex.GetIndex()); + return static_cast< sal_uInt16 >(aIndex.GetIndex()); } String SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const @@ -499,7 +499,7 @@ String SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const aStartIndex.GetFieldOffset() <= USHRT_MAX, "SvxAccessibleTextIndex::GetText: index value overflow"); - sStr.Erase(0, static_cast< USHORT > (aStartIndex.GetFieldOffset()) ); + sStr.Erase(0, static_cast< sal_uInt16 > (aStartIndex.GetFieldOffset()) ); } if( aEndIndex.InField() && aEndIndex.GetFieldOffset() ) { @@ -507,11 +507,11 @@ String SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const sStr.Len() - (aEndIndex.GetFieldLen() - aEndIndex.GetFieldOffset()) <= USHRT_MAX, "SvxAccessibleTextIndex::GetText: index value overflow"); - sStr = sStr.Copy(0, static_cast< USHORT > (sStr.Len() - (aEndIndex.GetFieldLen() - aEndIndex.GetFieldOffset())) ); + sStr = sStr.Copy(0, static_cast< sal_uInt16 > (sStr.Len() - (aEndIndex.GetFieldLen() - aEndIndex.GetFieldOffset())) ); } - EBulletInfo aBulletInfo1 = GetBulletInfo( static_cast< USHORT >(aStartIndex.GetParagraph()) ); - EBulletInfo aBulletInfo2 = GetBulletInfo( static_cast< USHORT >(aEndIndex.GetParagraph()) ); + EBulletInfo aBulletInfo1 = GetBulletInfo( static_cast< sal_uInt16 >(aStartIndex.GetParagraph()) ); + EBulletInfo aBulletInfo2 = GetBulletInfo( static_cast< sal_uInt16 >(aEndIndex.GetParagraph()) ); if( aStartIndex.InBullet() ) { @@ -522,7 +522,7 @@ String SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const aStartIndex.GetBulletOffset() <= USHRT_MAX, "SvxAccessibleTextIndex::GetText: index value overflow"); - sBullet.Erase(0, static_cast< USHORT > (aStartIndex.GetBulletOffset()) ); + sBullet.Erase(0, static_cast< sal_uInt16 > (aStartIndex.GetBulletOffset()) ); sBullet += sStr; sStr = sBullet; @@ -537,7 +537,7 @@ String SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const sStr.Len() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) <= USHRT_MAX, "SvxAccessibleTextIndex::GetText: index value overflow"); - sStr = sStr.Copy(0, static_cast< USHORT > (sStr.Len() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset())) ); + sStr = sStr.Copy(0, static_cast< sal_uInt16 > (sStr.Len() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset())) ); } else if( aStartIndex.GetParagraph() != aEndIndex.GetParagraph() && HaveTextBullet( aEndIndex.GetParagraph() ) ) @@ -548,17 +548,17 @@ String SvxAccessibleTextAdapter::GetText( const ESelection& rSel ) const sBullet.Len() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset()) <= USHRT_MAX, "SvxAccessibleTextIndex::GetText: index value overflow"); - sBullet = sBullet.Copy(0, static_cast< USHORT > (sBullet.Len() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset())) ); + sBullet = sBullet.Copy(0, static_cast< sal_uInt16 > (sBullet.Len() - (aEndIndex.GetBulletLen() - aEndIndex.GetBulletOffset())) ); // insert bullet sStr.Insert( sBullet, - static_cast< USHORT > (GetTextLen(aStartIndex.GetParagraph()) - aStartIndex.GetIndex()) ); + static_cast< sal_uInt16 > (GetTextLen(aStartIndex.GetParagraph()) - aStartIndex.GetIndex()) ); } return sStr; } -SfxItemSet SvxAccessibleTextAdapter::GetAttribs( const ESelection& rSel, BOOL bOnlyHardAttrib ) const +SfxItemSet SvxAccessibleTextAdapter::GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -572,14 +572,14 @@ SfxItemSet SvxAccessibleTextAdapter::GetAttribs( const ESelection& rSel, BOOL bO bOnlyHardAttrib ); } -SfxItemSet SvxAccessibleTextAdapter::GetParaAttribs( USHORT nPara ) const +SfxItemSet SvxAccessibleTextAdapter::GetParaAttribs( sal_uInt16 nPara ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); return mrTextForwarder->GetParaAttribs( nPara ); } -void SvxAccessibleTextAdapter::SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) +void SvxAccessibleTextAdapter::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ) { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -591,14 +591,14 @@ void SvxAccessibleTextAdapter::RemoveAttribs( const ESelection& , sal_Bool , sal DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); } -void SvxAccessibleTextAdapter::GetPortions( USHORT nPara, SvUShorts& rList ) const +void SvxAccessibleTextAdapter::GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); mrTextForwarder->GetPortions( nPara, rList ); } -USHORT SvxAccessibleTextAdapter::GetItemState( const ESelection& rSel, USHORT nWhich ) const +sal_uInt16 SvxAccessibleTextAdapter::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -612,7 +612,7 @@ USHORT SvxAccessibleTextAdapter::GetItemState( const ESelection& rSel, USHORT nW nWhich ); } -USHORT SvxAccessibleTextAdapter::GetItemState( USHORT nPara, USHORT nWhich ) const +sal_uInt16 SvxAccessibleTextAdapter::GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -681,21 +681,21 @@ SfxItemPool* SvxAccessibleTextAdapter::GetPool() const return mrTextForwarder->GetPool(); } -XubString SvxAccessibleTextAdapter::CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor ) +XubString SvxAccessibleTextAdapter::CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ) { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); return mrTextForwarder->CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor ); } -void SvxAccessibleTextAdapter::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ) +void SvxAccessibleTextAdapter::FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos ) { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); mrTextForwarder->FieldClicked( rField, nPara, nPos ); } -sal_Int32 SvxAccessibleTextAdapter::CalcLogicalIndex( USHORT nPara, USHORT nEEIndex ) +sal_Int32 SvxAccessibleTextAdapter::CalcLogicalIndex( sal_uInt16 nPara, sal_uInt16 nEEIndex ) { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -704,7 +704,7 @@ sal_Int32 SvxAccessibleTextAdapter::CalcLogicalIndex( USHORT nPara, USHORT nEEIn return aIndex.GetIndex(); } -USHORT SvxAccessibleTextAdapter::CalcEditEngineIndex( USHORT nPara, sal_Int32 nLogicalIndex ) +sal_uInt16 SvxAccessibleTextAdapter::CalcEditEngineIndex( sal_uInt16 nPara, sal_Int32 nLogicalIndex ) { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -715,7 +715,7 @@ USHORT SvxAccessibleTextAdapter::CalcEditEngineIndex( USHORT nPara, sal_Int32 nL -BOOL SvxAccessibleTextAdapter::IsValid() const +sal_Bool SvxAccessibleTextAdapter::IsValid() const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -725,7 +725,7 @@ BOOL SvxAccessibleTextAdapter::IsValid() const return sal_False; } -LanguageType SvxAccessibleTextAdapter::GetLanguage( USHORT nPara, USHORT nPos ) const +LanguageType SvxAccessibleTextAdapter::GetLanguage( sal_uInt16 nPara, sal_uInt16 nPos ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -736,28 +736,28 @@ LanguageType SvxAccessibleTextAdapter::GetLanguage( USHORT nPara, USHORT nPos ) return mrTextForwarder->GetLanguage( nPara, aIndex.GetEEIndex() ); } -USHORT SvxAccessibleTextAdapter::GetFieldCount( USHORT nPara ) const +sal_uInt16 SvxAccessibleTextAdapter::GetFieldCount( sal_uInt16 nPara ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); return mrTextForwarder->GetFieldCount( nPara ); } -EFieldInfo SvxAccessibleTextAdapter::GetFieldInfo( USHORT nPara, USHORT nField ) const +EFieldInfo SvxAccessibleTextAdapter::GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); return mrTextForwarder->GetFieldInfo( nPara, nField ); } -EBulletInfo SvxAccessibleTextAdapter::GetBulletInfo( USHORT nPara ) const +EBulletInfo SvxAccessibleTextAdapter::GetBulletInfo( sal_uInt16 nPara ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); return mrTextForwarder->GetBulletInfo( nPara ); } -Rectangle SvxAccessibleTextAdapter::GetCharBounds( USHORT nPara, USHORT nIndex ) const +Rectangle SvxAccessibleTextAdapter::GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -766,7 +766,7 @@ Rectangle SvxAccessibleTextAdapter::GetCharBounds( USHORT nPara, USHORT nIndex ) // preset if anything goes wrong below // n-th char in GetParagraphIndex's paragraph - Rectangle aRect = mrTextForwarder->GetCharBounds( nPara, static_cast< USHORT >( aIndex.GetEEIndex() ) ); + Rectangle aRect = mrTextForwarder->GetCharBounds( nPara, static_cast< sal_uInt16 >( aIndex.GetEEIndex() ) ); if( aIndex.InBullet() ) { @@ -804,7 +804,7 @@ Rectangle SvxAccessibleTextAdapter::GetCharBounds( USHORT nPara, USHORT nIndex ) aFont, mrTextForwarder->GetText( aSel ) ); - Rectangle aStartRect = mrTextForwarder->GetCharBounds( nPara, static_cast< USHORT >( aIndex.GetEEIndex() ) ); + Rectangle aStartRect = mrTextForwarder->GetCharBounds( nPara, static_cast< sal_uInt16 >( aIndex.GetEEIndex() ) ); if( !aStringWrap.GetCharacterBounds( aIndex.GetFieldOffset(), aRect ) ) aRect = aStartRect; @@ -817,7 +817,7 @@ Rectangle SvxAccessibleTextAdapter::GetCharBounds( USHORT nPara, USHORT nIndex ) return aRect; } -Rectangle SvxAccessibleTextAdapter::GetParaBounds( USHORT nPara ) const +Rectangle SvxAccessibleTextAdapter::GetParaBounds( sal_uInt16 nPara ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -852,7 +852,7 @@ OutputDevice* SvxAccessibleTextAdapter::GetRefDevice() const return mrTextForwarder->GetRefDevice(); } -sal_Bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, USHORT& nPara, USHORT& nIndex ) const +sal_Bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, sal_uInt16& nPara, sal_uInt16& nIndex ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -865,7 +865,7 @@ sal_Bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, USHORT& DBG_ASSERT(aIndex.GetIndex() >= 0 && aIndex.GetIndex() <= USHRT_MAX, "SvxAccessibleTextIndex::SetIndex: index value overflow"); - nIndex = static_cast< USHORT > (aIndex.GetIndex()); + nIndex = static_cast< sal_uInt16 > (aIndex.GetIndex()); EBulletInfo aBulletInfo = GetBulletInfo( nPara ); @@ -892,7 +892,7 @@ sal_Bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, USHORT& aStringWrap.GetIndexAtPoint( aPoint ) <= USHRT_MAX, "SvxAccessibleTextIndex::SetIndex: index value overflow"); - nIndex = static_cast< USHORT > (aStringWrap.GetIndexAtPoint( aPoint )); + nIndex = static_cast< sal_uInt16 > (aStringWrap.GetIndexAtPoint( aPoint )); return sal_True; } } @@ -920,14 +920,14 @@ sal_Bool SvxAccessibleTextAdapter::GetIndexAtPoint( const Point& rPoint, USHORT& aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( rPoint ) <= USHRT_MAX, "SvxAccessibleTextIndex::SetIndex: index value overflow"); - nIndex = static_cast< USHORT >(aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( aPoint )); + nIndex = static_cast< sal_uInt16 >(aIndex.GetIndex() + aStringWrap.GetIndexAtPoint( aPoint )); return sal_True; } return sal_True; } -sal_Bool SvxAccessibleTextAdapter::GetWordIndices( USHORT nPara, USHORT nIndex, USHORT& nStart, USHORT& nEnd ) const +sal_Bool SvxAccessibleTextAdapter::GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -943,7 +943,7 @@ sal_Bool SvxAccessibleTextAdapter::GetWordIndices( USHORT nPara, USHORT nIndex, // always treat bullet as separate word nStart = 0; - nEnd = static_cast< USHORT > (aIndex.GetBulletLen()); + nEnd = static_cast< sal_uInt16 > (aIndex.GetBulletLen()); return sal_True; } @@ -958,8 +958,8 @@ sal_Bool SvxAccessibleTextAdapter::GetWordIndices( USHORT nPara, USHORT nIndex, // always treat field as separate word // TODO: to circumvent this, _we_ would have to do the break iterator stuff! - nStart = static_cast< USHORT > (aIndex.GetIndex() - aIndex.GetFieldOffset()); - nEnd = static_cast< USHORT > (nStart + aIndex.GetFieldLen()); + nStart = static_cast< sal_uInt16 > (aIndex.GetIndex() - aIndex.GetFieldOffset()); + nEnd = static_cast< sal_uInt16 > (nStart + aIndex.GetFieldLen()); return sal_True; } @@ -971,18 +971,18 @@ sal_Bool SvxAccessibleTextAdapter::GetWordIndices( USHORT nPara, USHORT nIndex, DBG_ASSERT(aIndex.GetIndex() >= 0 && aIndex.GetIndex() <= USHRT_MAX, "SvxAccessibleTextIndex::SetIndex: index value overflow"); - nStart = static_cast< USHORT > (aIndex.GetIndex()); + nStart = static_cast< sal_uInt16 > (aIndex.GetIndex()); aIndex.SetEEIndex( nPara, nEnd, *this ); DBG_ASSERT(aIndex.GetIndex() >= 0 && aIndex.GetIndex() <= USHRT_MAX, "SvxAccessibleTextIndex::SetIndex: index value overflow"); - nEnd = static_cast< USHORT > (aIndex.GetIndex()); + nEnd = static_cast< sal_uInt16 > (aIndex.GetIndex()); return sal_True; } -sal_Bool SvxAccessibleTextAdapter::GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const +sal_Bool SvxAccessibleTextAdapter::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -998,7 +998,7 @@ sal_Bool SvxAccessibleTextAdapter::GetAttributeRun( USHORT& nStartIndex, USHORT& // always treat bullet as distinct attribute nStartIndex = 0; - nEndIndex = static_cast< USHORT > (aIndex.GetBulletLen()); + nEndIndex = static_cast< sal_uInt16 > (aIndex.GetBulletLen()); return sal_True; } @@ -1010,8 +1010,8 @@ sal_Bool SvxAccessibleTextAdapter::GetAttributeRun( USHORT& nStartIndex, USHORT& "SvxAccessibleTextIndex::SetIndex: index value overflow"); // always treat field as distinct attribute - nStartIndex = static_cast< USHORT > (aIndex.GetIndex() - aIndex.GetFieldOffset()); - nEndIndex = static_cast< USHORT > (nStartIndex + aIndex.GetFieldLen()); + nStartIndex = static_cast< sal_uInt16 > (aIndex.GetIndex() - aIndex.GetFieldOffset()); + nEndIndex = static_cast< sal_uInt16 > (nStartIndex + aIndex.GetFieldLen()); return sal_True; } @@ -1023,32 +1023,32 @@ sal_Bool SvxAccessibleTextAdapter::GetAttributeRun( USHORT& nStartIndex, USHORT& DBG_ASSERT(aIndex.GetIndex() >= 0 && aIndex.GetIndex() <= USHRT_MAX, "SvxAccessibleTextIndex::SetIndex: index value overflow"); - nStartIndex = static_cast< USHORT > (aIndex.GetIndex()); + nStartIndex = static_cast< sal_uInt16 > (aIndex.GetIndex()); aIndex.SetEEIndex( nPara, nEndIndex, *this ); DBG_ASSERT(aIndex.GetIndex() >= 0 && aIndex.GetIndex() <= USHRT_MAX, "SvxAccessibleTextIndex::SetIndex: index value overflow"); - nEndIndex = static_cast< USHORT > (aIndex.GetIndex()); + nEndIndex = static_cast< sal_uInt16 > (aIndex.GetIndex()); return sal_True; } -USHORT SvxAccessibleTextAdapter::GetLineCount( USHORT nPara ) const +sal_uInt16 SvxAccessibleTextAdapter::GetLineCount( sal_uInt16 nPara ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); return mrTextForwarder->GetLineCount( nPara ); } -USHORT SvxAccessibleTextAdapter::GetLineLen( USHORT nPara, USHORT nLine ) const +sal_uInt16 SvxAccessibleTextAdapter::GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); SvxAccessibleTextIndex aStartIndex; SvxAccessibleTextIndex aEndIndex; - USHORT nCurrLine; - USHORT nCurrIndex, nLastIndex; + sal_uInt16 nCurrLine; + sal_uInt16 nCurrIndex, nLastIndex; for( nCurrLine=0, nCurrIndex=0, nLastIndex=0; nCurrLine<=nLine; ++nCurrLine ) { nLastIndex = nCurrIndex; @@ -1061,18 +1061,18 @@ USHORT SvxAccessibleTextAdapter::GetLineLen( USHORT nPara, USHORT nLine ) const { aStartIndex.SetEEIndex( nPara, nLastIndex, *this ); - return static_cast< USHORT >(aEndIndex.GetIndex() - aStartIndex.GetIndex()); + return static_cast< sal_uInt16 >(aEndIndex.GetIndex() - aStartIndex.GetIndex()); } else - return static_cast< USHORT >(aEndIndex.GetIndex()); + return static_cast< sal_uInt16 >(aEndIndex.GetIndex()); } -void SvxAccessibleTextAdapter::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nParagraph, USHORT nLine ) const +void SvxAccessibleTextAdapter::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nParagraph, sal_uInt16 nLine ) const { mrTextForwarder->GetLineBoundaries( rStart, rEnd, nParagraph, nLine ); } -USHORT SvxAccessibleTextAdapter::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const +sal_uInt16 SvxAccessibleTextAdapter::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const { return mrTextForwarder->GetLineNumberAtIndex( nPara, nIndex ); } @@ -1103,21 +1103,21 @@ sal_Bool SvxAccessibleTextAdapter::InsertText( const String& rStr, const ESelect return mrTextForwarder->InsertText( rStr, MakeEESelection(aStartIndex, aEndIndex) ); } -sal_Bool SvxAccessibleTextAdapter::QuickFormatDoc( BOOL bFull ) +sal_Bool SvxAccessibleTextAdapter::QuickFormatDoc( sal_Bool bFull ) { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); return mrTextForwarder->QuickFormatDoc( bFull ); } -sal_Int16 SvxAccessibleTextAdapter::GetDepth( USHORT nPara ) const +sal_Int16 SvxAccessibleTextAdapter::GetDepth( sal_uInt16 nPara ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); return mrTextForwarder->GetDepth( nPara ); } -sal_Bool SvxAccessibleTextAdapter::SetDepth( USHORT nPara, sal_Int16 nNewDepth ) +sal_Bool SvxAccessibleTextAdapter::SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth ) { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -1129,7 +1129,7 @@ void SvxAccessibleTextAdapter::SetForwarder( SvxTextForwarder& rForwarder ) mrTextForwarder = &rForwarder; } -sal_Bool SvxAccessibleTextAdapter::HaveImageBullet( USHORT nPara ) const +sal_Bool SvxAccessibleTextAdapter::HaveImageBullet( sal_uInt16 nPara ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -1147,7 +1147,7 @@ sal_Bool SvxAccessibleTextAdapter::HaveImageBullet( USHORT nPara ) const } } -sal_Bool SvxAccessibleTextAdapter::HaveTextBullet( USHORT nPara ) const +sal_Bool SvxAccessibleTextAdapter::HaveTextBullet( sal_uInt16 nPara ) const { DBG_ASSERT(mrTextForwarder, "SvxAccessibleTextAdapter: no forwarder"); @@ -1196,7 +1196,7 @@ void SvxAccessibleTextAdapter::AppendParagraph() OSL_FAIL( "not implemented" ); } -xub_StrLen SvxAccessibleTextAdapter::AppendTextPortion( USHORT, const String &, const SfxItemSet & ) +xub_StrLen SvxAccessibleTextAdapter::AppendTextPortion( sal_uInt16, const String &, const SfxItemSet & ) { OSL_FAIL( "not implemented" ); return 0; @@ -1218,7 +1218,7 @@ SvxAccessibleTextEditViewAdapter::~SvxAccessibleTextEditViewAdapter() { } -BOOL SvxAccessibleTextEditViewAdapter::IsValid() const +sal_Bool SvxAccessibleTextEditViewAdapter::IsValid() const { DBG_ASSERT(mrViewForwarder, "SvxAccessibleTextEditViewAdapter: no forwarder"); @@ -1268,8 +1268,8 @@ sal_Bool SvxAccessibleTextEditViewAdapter::GetSelection( ESelection& rSel ) cons aEndIndex.GetIndex() >= 0 && aEndIndex.GetIndex() <= USHRT_MAX, "SvxAccessibleTextEditViewAdapter::GetSelection: index value overflow"); - rSel = ESelection( aStartIndex.GetParagraph(), static_cast< USHORT > (aStartIndex.GetIndex()), - aEndIndex.GetParagraph(), static_cast< USHORT > (aEndIndex.GetIndex()) ); + rSel = ESelection( aStartIndex.GetParagraph(), static_cast< sal_uInt16 > (aStartIndex.GetIndex()), + aEndIndex.GetParagraph(), static_cast< sal_uInt16 > (aEndIndex.GetIndex()) ); return sal_True; } diff --git a/editeng/source/uno/unoedsrc.cxx b/editeng/source/uno/unoedsrc.cxx index b245cc4d6c32..b245cc4d6c32 100644..100755 --- a/editeng/source/uno/unoedsrc.cxx +++ b/editeng/source/uno/unoedsrc.cxx diff --git a/editeng/source/uno/unofdesc.cxx b/editeng/source/uno/unofdesc.cxx index 7ae4e31700ec..cdd528d44900 100644..100755 --- a/editeng/source/uno/unofdesc.cxx +++ b/editeng/source/uno/unofdesc.cxx @@ -143,7 +143,7 @@ void SvxUnoFontDescriptor::FillFromItemSet( const SfxItemSet& rSet, awt::FontDes { const SfxPoolItem* pItem = NULL; { - SvxFontItem* pFontItem = (SvxFontItem*)&rSet.Get( EE_CHAR_FONTINFO, TRUE ); + SvxFontItem* pFontItem = (SvxFontItem*)&rSet.Get( EE_CHAR_FONTINFO, sal_True ); rDesc.Name = pFontItem->GetFamilyName(); rDesc.StyleName = pFontItem->GetStyleName(); rDesc.Family = sal::static_int_cast< sal_Int16 >( @@ -153,37 +153,37 @@ void SvxUnoFontDescriptor::FillFromItemSet( const SfxItemSet& rSet, awt::FontDes pFontItem->GetPitch()); } { - pItem = &rSet.Get( EE_CHAR_FONTHEIGHT, TRUE ); + pItem = &rSet.Get( EE_CHAR_FONTHEIGHT, sal_True ); uno::Any aHeight; if( pItem->QueryValue( aHeight, MID_FONTHEIGHT ) ) aHeight >>= rDesc.Height; } { - pItem = &rSet.Get( EE_CHAR_ITALIC, TRUE ); + pItem = &rSet.Get( EE_CHAR_ITALIC, sal_True ); uno::Any aFontSlant; if(pItem->QueryValue( aFontSlant, MID_POSTURE )) aFontSlant >>= rDesc.Slant; } { - pItem = &rSet.Get( EE_CHAR_UNDERLINE, TRUE ); + pItem = &rSet.Get( EE_CHAR_UNDERLINE, sal_True ); uno::Any aUnderline; if(pItem->QueryValue( aUnderline, MID_TL_STYLE )) aUnderline >>= rDesc.Underline; } { - pItem = &rSet.Get( EE_CHAR_WEIGHT, TRUE ); + pItem = &rSet.Get( EE_CHAR_WEIGHT, sal_True ); uno::Any aWeight; if(pItem->QueryValue( aWeight, MID_WEIGHT )) aWeight >>= rDesc.Weight; } { - pItem = &rSet.Get( EE_CHAR_STRIKEOUT, TRUE ); + pItem = &rSet.Get( EE_CHAR_STRIKEOUT, sal_True ); uno::Any aStrikeOut; if(pItem->QueryValue( aStrikeOut, MID_CROSS_OUT )) aStrikeOut >>= rDesc.Strikeout; } { - SvxWordLineModeItem* pWLMItem = (SvxWordLineModeItem*)&rSet.Get( EE_CHAR_WLM, TRUE ); + SvxWordLineModeItem* pWLMItem = (SvxWordLineModeItem*)&rSet.Get( EE_CHAR_WLM, sal_True ); rDesc.WordLineMode = pWLMItem->GetValue(); } } @@ -201,13 +201,13 @@ void SvxUnoFontDescriptor::FillFromItemSet( const SfxItemSet& rSet, awt::FontDes beans::PropertyState SvxUnoFontDescriptor::getPropertyState( const SfxItemSet& rSet ) { - CheckState(rSet.GetItemState( EE_CHAR_FONTINFO, FALSE )); - CheckState(rSet.GetItemState( EE_CHAR_FONTHEIGHT, FALSE )); - CheckState(rSet.GetItemState( EE_CHAR_ITALIC, FALSE )); - CheckState(rSet.GetItemState( EE_CHAR_UNDERLINE, FALSE )); - CheckState(rSet.GetItemState( EE_CHAR_WEIGHT, FALSE )); - CheckState(rSet.GetItemState( EE_CHAR_STRIKEOUT, FALSE )); - CheckState(rSet.GetItemState( EE_CHAR_WLM, FALSE )); + CheckState(rSet.GetItemState( EE_CHAR_FONTINFO, sal_False )); + CheckState(rSet.GetItemState( EE_CHAR_FONTHEIGHT, sal_False )); + CheckState(rSet.GetItemState( EE_CHAR_ITALIC, sal_False )); + CheckState(rSet.GetItemState( EE_CHAR_UNDERLINE, sal_False )); + CheckState(rSet.GetItemState( EE_CHAR_WEIGHT, sal_False )); + CheckState(rSet.GetItemState( EE_CHAR_STRIKEOUT, sal_False )); + CheckState(rSet.GetItemState( EE_CHAR_WLM, sal_False )); return beans::PropertyState_DEFAULT_VALUE; } diff --git a/editeng/source/uno/unofield.cxx b/editeng/source/uno/unofield.cxx index 782830467404..83e7f14a5b21 100644..100755 --- a/editeng/source/uno/unofield.cxx +++ b/editeng/source/uno/unofield.cxx @@ -216,7 +216,7 @@ static SvxFileFormat setFileNameDisplayFormat( sal_Int16 nFormat ) } } -static util::DateTime getDate( ULONG nDate ) +static util::DateTime getDate( sal_uLong nDate ) { util::DateTime aDate; memset( &aDate, 0, sizeof( util::DateTime ) ); diff --git a/editeng/source/uno/unofored.cxx b/editeng/source/uno/unofored.cxx index 8888a3553f12..b994e46c404d 100644..100755 --- a/editeng/source/uno/unofored.cxx +++ b/editeng/source/uno/unofored.cxx @@ -57,12 +57,12 @@ SvxEditEngineForwarder::~SvxEditEngineForwarder() // the EditEngine may need to be deleted from the outside } -USHORT SvxEditEngineForwarder::GetParagraphCount() const +sal_uInt16 SvxEditEngineForwarder::GetParagraphCount() const { return rEditEngine.GetParagraphCount(); } -USHORT SvxEditEngineForwarder::GetTextLen( USHORT nParagraph ) const +sal_uInt16 SvxEditEngineForwarder::GetTextLen( sal_uInt16 nParagraph ) const { return rEditEngine.GetTextLen( nParagraph ); } @@ -74,7 +74,7 @@ String SvxEditEngineForwarder::GetText( const ESelection& rSel ) const return aRet; } -SfxItemSet SvxEditEngineForwarder::GetAttribs( const ESelection& rSel, BOOL bOnlyHardAttrib ) const +SfxItemSet SvxEditEngineForwarder::GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib ) const { if( rSel.nStartPara == rSel.nEndPara ) { @@ -102,14 +102,14 @@ SfxItemSet SvxEditEngineForwarder::GetAttribs( const ESelection& rSel, BOOL bOnl } } -SfxItemSet SvxEditEngineForwarder::GetParaAttribs( USHORT nPara ) const +SfxItemSet SvxEditEngineForwarder::GetParaAttribs( sal_uInt16 nPara ) const { SfxItemSet aSet( rEditEngine.GetParaAttribs( nPara ) ); - USHORT nWhich = EE_PARA_START; + sal_uInt16 nWhich = EE_PARA_START; while( nWhich <= EE_PARA_END ) { - if( aSet.GetItemState( nWhich, TRUE ) != SFX_ITEM_ON ) + if( aSet.GetItemState( nWhich, sal_True ) != SFX_ITEM_ON ) { if( rEditEngine.HasParaAttrib( nPara, nWhich ) ) aSet.Put( rEditEngine.GetParaAttrib( nPara, nWhich ) ); @@ -120,7 +120,7 @@ SfxItemSet SvxEditEngineForwarder::GetParaAttribs( USHORT nPara ) const return aSet; } -void SvxEditEngineForwarder::SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) +void SvxEditEngineForwarder::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ) { rEditEngine.SetParaAttribs( nPara, rSet ); } @@ -135,7 +135,7 @@ SfxItemPool* SvxEditEngineForwarder::GetPool() const return rEditEngine.GetEmptyItemSet().GetPool(); } -void SvxEditEngineForwarder::GetPortions( USHORT nPara, SvUShorts& rList ) const +void SvxEditEngineForwarder::GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const { rEditEngine.GetPortions( nPara, rList ); } @@ -160,24 +160,24 @@ void SvxEditEngineForwarder::QuickSetAttribs( const SfxItemSet& rSet, const ESel rEditEngine.QuickSetAttribs( rSet, rSel ); } -BOOL SvxEditEngineForwarder::IsValid() const +sal_Bool SvxEditEngineForwarder::IsValid() const { // cannot reliably query EditEngine state // while in the middle of an update return rEditEngine.GetUpdateMode(); } -XubString SvxEditEngineForwarder::CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor ) +XubString SvxEditEngineForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ) { return rEditEngine.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor ); } -void SvxEditEngineForwarder::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ) +void SvxEditEngineForwarder::FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos ) { rEditEngine.FieldClicked( rField, nPara, nPos ); } -USHORT GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, USHORT nWhich ) +sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, sal_uInt16 nWhich ) { EECharAttribArray aAttribs; @@ -186,16 +186,16 @@ USHORT GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSe SfxItemState eState = SFX_ITEM_DEFAULT; // check all paragraphs inside the selection - for( USHORT nPara = rSel.nStartPara; nPara <= rSel.nEndPara; nPara++ ) + for( sal_uInt16 nPara = rSel.nStartPara; nPara <= rSel.nEndPara; nPara++ ) { SfxItemState eParaState = SFX_ITEM_DEFAULT; // calculate start and endpos for this paragraph - USHORT nPos = 0; + sal_uInt16 nPos = 0; if( rSel.nStartPara == nPara ) nPos = rSel.nStartPos; - USHORT nEndPos = rSel.nEndPos; + sal_uInt16 nEndPos = rSel.nEndPos; if( rSel.nEndPara != nPara ) nEndPos = rEditEngine.GetTextLen( nPara ); @@ -203,13 +203,13 @@ USHORT GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSe // get list of char attribs rEditEngine.GetCharAttribs( nPara, aAttribs ); - BOOL bEmpty = TRUE; // we found no item inside the selektion of this paragraph - BOOL bGaps = FALSE; // we found items but theire gaps between them - USHORT nLastEnd = nPos; + sal_Bool bEmpty = sal_True; // we found no item inside the selektion of this paragraph + sal_Bool bGaps = sal_False; // we found items but theire gaps between them + sal_uInt16 nLastEnd = nPos; const SfxPoolItem* pParaItem = NULL; - for( USHORT nAttrib = 0; nAttrib < aAttribs.Count(); nAttrib++ ) + for( sal_uInt16 nAttrib = 0; nAttrib < aAttribs.Count(); nAttrib++ ) { struct EECharAttrib aAttrib = aAttribs.GetObject( nAttrib ); DBG_ASSERT( aAttrib.pAttr, "GetCharAttribs gives corrupt data" ); @@ -237,16 +237,16 @@ USHORT GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSe } if( bEmpty ) - bEmpty = FALSE; + bEmpty = sal_False; if( !bGaps && aAttrib.nStart > nLastEnd ) - bGaps = TRUE; + bGaps = sal_True; nLastEnd = aAttrib.nEnd; } if( !bEmpty && !bGaps && nLastEnd < ( nEndPos - 1 ) ) - bGaps = TRUE; + bGaps = sal_True; /* // since we have no portion with our item or if there were gaps if( bEmpty || bGaps ) @@ -309,45 +309,45 @@ USHORT GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSe return eState; } -USHORT SvxEditEngineForwarder::GetItemState( const ESelection& rSel, USHORT nWhich ) const +sal_uInt16 SvxEditEngineForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const { return GetSvxEditEngineItemState( rEditEngine, rSel, nWhich ); } -USHORT SvxEditEngineForwarder::GetItemState( USHORT nPara, USHORT nWhich ) const +sal_uInt16 SvxEditEngineForwarder::GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const { const SfxItemSet& rSet = rEditEngine.GetParaAttribs( nPara ); return rSet.GetItemState( nWhich ); } -LanguageType SvxEditEngineForwarder::GetLanguage( USHORT nPara, USHORT nIndex ) const +LanguageType SvxEditEngineForwarder::GetLanguage( sal_uInt16 nPara, sal_uInt16 nIndex ) const { return rEditEngine.GetLanguage(nPara, nIndex); } -USHORT SvxEditEngineForwarder::GetFieldCount( USHORT nPara ) const +sal_uInt16 SvxEditEngineForwarder::GetFieldCount( sal_uInt16 nPara ) const { return rEditEngine.GetFieldCount(nPara); } -EFieldInfo SvxEditEngineForwarder::GetFieldInfo( USHORT nPara, USHORT nField ) const +EFieldInfo SvxEditEngineForwarder::GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const { return rEditEngine.GetFieldInfo( nPara, nField ); } -EBulletInfo SvxEditEngineForwarder::GetBulletInfo( USHORT ) const +EBulletInfo SvxEditEngineForwarder::GetBulletInfo( sal_uInt16 ) const { return EBulletInfo(); } -Rectangle SvxEditEngineForwarder::GetCharBounds( USHORT nPara, USHORT nIndex ) const +Rectangle SvxEditEngineForwarder::GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const { // #101701# // EditEngine's 'internal' methods like GetCharacterBounds() // don't rotate for vertical text. Size aSize( rEditEngine.CalcTextWidth(), rEditEngine.GetTextHeight() ); ::std::swap( aSize.Width(), aSize.Height() ); - bool bIsVertical( rEditEngine.IsVertical() == TRUE ); + bool bIsVertical( rEditEngine.IsVertical() == sal_True ); // #108900# Handle virtual position one-past-the end of the string if( nIndex >= rEditEngine.GetTextLen(nPara) ) @@ -388,12 +388,12 @@ Rectangle SvxEditEngineForwarder::GetCharBounds( USHORT nPara, USHORT nIndex ) c } } -Rectangle SvxEditEngineForwarder::GetParaBounds( USHORT nPara ) const +Rectangle SvxEditEngineForwarder::GetParaBounds( sal_uInt16 nPara ) const { const Point aPnt = rEditEngine.GetDocPosTopLeft( nPara ); - ULONG nWidth; - ULONG nHeight; - ULONG nTextWidth; + sal_uLong nWidth; + sal_uLong nHeight; + sal_uLong nTextWidth; if( rEditEngine.IsVertical() ) { @@ -426,13 +426,13 @@ OutputDevice* SvxEditEngineForwarder::GetRefDevice() const return rEditEngine.GetRefDevice(); } -sal_Bool SvxEditEngineForwarder::GetIndexAtPoint( const Point& rPos, USHORT& nPara, USHORT& nIndex ) const +sal_Bool SvxEditEngineForwarder::GetIndexAtPoint( const Point& rPos, sal_uInt16& nPara, sal_uInt16& nIndex ) const { Size aSize( rEditEngine.CalcTextWidth(), rEditEngine.GetTextHeight() ); ::std::swap( aSize.Width(), aSize.Height() ); Point aEEPos( SvxEditSourceHelper::UserSpaceToEE( rPos, aSize, - rEditEngine.IsVertical() == TRUE )); + rEditEngine.IsVertical() == sal_True )); EPosition aDocPos = rEditEngine.FindDocPosition( aEEPos ); @@ -442,7 +442,7 @@ sal_Bool SvxEditEngineForwarder::GetIndexAtPoint( const Point& rPos, USHORT& nPa return sal_True; } -sal_Bool SvxEditEngineForwarder::GetWordIndices( USHORT nPara, USHORT nIndex, USHORT& nStart, USHORT& nEnd ) const +sal_Bool SvxEditEngineForwarder::GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const { ESelection aRes = rEditEngine.GetWord( ESelection(nPara, nIndex, nPara, nIndex), com::sun::star::i18n::WordType::DICTIONARY_WORD ); @@ -458,33 +458,33 @@ sal_Bool SvxEditEngineForwarder::GetWordIndices( USHORT nPara, USHORT nIndex, US return sal_False; } -sal_Bool SvxEditEngineForwarder::GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const +sal_Bool SvxEditEngineForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const { return SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rEditEngine, nPara, nIndex ); } -USHORT SvxEditEngineForwarder::GetLineCount( USHORT nPara ) const +sal_uInt16 SvxEditEngineForwarder::GetLineCount( sal_uInt16 nPara ) const { return rEditEngine.GetLineCount(nPara); } -USHORT SvxEditEngineForwarder::GetLineLen( USHORT nPara, USHORT nLine ) const +sal_uInt16 SvxEditEngineForwarder::GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const { return rEditEngine.GetLineLen(nPara, nLine); } -void SvxEditEngineForwarder::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const +void SvxEditEngineForwarder::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nPara, sal_uInt16 nLine ) const { rEditEngine.GetLineBoundaries(rStart, rEnd, nPara, nLine); } -USHORT SvxEditEngineForwarder::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const +sal_uInt16 SvxEditEngineForwarder::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const { return rEditEngine.GetLineNumberAtIndex(nPara, nIndex); } -sal_Bool SvxEditEngineForwarder::QuickFormatDoc( BOOL ) +sal_Bool SvxEditEngineForwarder::QuickFormatDoc( sal_Bool ) { rEditEngine.QuickFormatDoc(); @@ -507,13 +507,13 @@ sal_Bool SvxEditEngineForwarder::InsertText( const String& rStr, const ESelectio return sal_True; } -sal_Int16 SvxEditEngineForwarder::GetDepth( USHORT ) const +sal_Int16 SvxEditEngineForwarder::GetDepth( sal_uInt16 ) const { // EditEngine does not support outline depth return -1; } -sal_Bool SvxEditEngineForwarder::SetDepth( USHORT, sal_Int16 nNewDepth ) +sal_Bool SvxEditEngineForwarder::SetDepth( sal_uInt16, sal_Int16 nNewDepth ) { // EditEngine does not support outline depth return nNewDepth == -1 ? sal_True : sal_False; @@ -529,11 +529,11 @@ void SvxEditEngineForwarder::AppendParagraph() rEditEngine.InsertParagraph( rEditEngine.GetParagraphCount(), String::EmptyString() ); } -xub_StrLen SvxEditEngineForwarder::AppendTextPortion( USHORT nPara, const String &rText, const SfxItemSet & /*rSet*/ ) +xub_StrLen SvxEditEngineForwarder::AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet & /*rSet*/ ) { xub_StrLen nLen = 0; - USHORT nParaCount = rEditEngine.GetParagraphCount(); + sal_uInt16 nParaCount = rEditEngine.GetParagraphCount(); DBG_ASSERT( nPara < nParaCount, "paragraph index out of bounds" ); if (/*0 <= nPara && */nPara < nParaCount) { diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx index feb5cdc166f2..8f3d7593efca 100644..100755 --- a/editeng/source/uno/unoforou.cxx +++ b/editeng/source/uno/unoforou.cxx @@ -50,7 +50,7 @@ using namespace ::com::sun::star; //------------------------------------------------------------------------ -SvxOutlinerForwarder::SvxOutlinerForwarder( Outliner& rOutl, BOOL bOutlText /* = FALSE */ ) : +SvxOutlinerForwarder::SvxOutlinerForwarder( Outliner& rOutl, sal_Bool bOutlText /* = sal_False */ ) : rOutliner( rOutl ), bOutlinerText( bOutlText ), mpAttribsCache( NULL ), @@ -64,12 +64,12 @@ SvxOutlinerForwarder::~SvxOutlinerForwarder() flushCache(); } -USHORT SvxOutlinerForwarder::GetParagraphCount() const +sal_uInt16 SvxOutlinerForwarder::GetParagraphCount() const { - return (USHORT)rOutliner.GetParagraphCount(); + return (sal_uInt16)rOutliner.GetParagraphCount(); } -USHORT SvxOutlinerForwarder::GetTextLen( USHORT nParagraph ) const +sal_uInt16 SvxOutlinerForwarder::GetTextLen( sal_uInt16 nParagraph ) const { return rOutliner.GetEditEngine().GetTextLen( nParagraph ); } @@ -82,7 +82,7 @@ String SvxOutlinerForwarder::GetText( const ESelection& rSel ) const return pEditEngine->GetText( rSel, LINEEND_LF ); } -static SfxItemSet ImplOutlinerForwarderGetAttribs( const ESelection& rSel, BOOL bOnlyHardAttrib, EditEngine& rEditEngine ) +static SfxItemSet ImplOutlinerForwarderGetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib, EditEngine& rEditEngine ) { if( rSel.nStartPara == rSel.nEndPara ) { @@ -110,7 +110,7 @@ static SfxItemSet ImplOutlinerForwarderGetAttribs( const ESelection& rSel, BOOL } } -SfxItemSet SvxOutlinerForwarder::GetAttribs( const ESelection& rSel, BOOL bOnlyHardAttrib ) const +SfxItemSet SvxOutlinerForwarder::GetAttribs( const ESelection& rSel, sal_Bool bOnlyHardAttrib ) const { if( mpAttribsCache && ( 0 == bOnlyHardAttrib ) ) { @@ -147,7 +147,7 @@ SfxItemSet SvxOutlinerForwarder::GetAttribs( const ESelection& rSel, BOOL bOnlyH return aSet; } -SfxItemSet SvxOutlinerForwarder::GetParaAttribs( USHORT nPara ) const +SfxItemSet SvxOutlinerForwarder::GetParaAttribs( sal_uInt16 nPara ) const { if( mpParaAttribsCache ) { @@ -177,7 +177,7 @@ SfxItemSet SvxOutlinerForwarder::GetParaAttribs( USHORT nPara ) const return *mpParaAttribsCache; } -void SvxOutlinerForwarder::SetParaAttribs( USHORT nPara, const SfxItemSet& rSet ) +void SvxOutlinerForwarder::SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rSet ) { flushCache(); @@ -201,7 +201,7 @@ SfxItemPool* SvxOutlinerForwarder::GetPool() const return rOutliner.GetEmptyItemSet().GetPool(); } -void SvxOutlinerForwarder::GetPortions( USHORT nPara, SvUShorts& rList ) const +void SvxOutlinerForwarder::GetPortions( sal_uInt16 nPara, SvUShorts& rList ) const { ((EditEngine&)rOutliner.GetEditEngine()).GetPortions( nPara, rList ); } @@ -237,31 +237,31 @@ void SvxOutlinerForwarder::QuickSetAttribs( const SfxItemSet& rSet, const ESelec rOutliner.QuickSetAttribs( rSet, rSel ); } -XubString SvxOutlinerForwarder::CalcFieldValue( const SvxFieldItem& rField, USHORT nPara, USHORT nPos, Color*& rpTxtColor, Color*& rpFldColor ) +XubString SvxOutlinerForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos, Color*& rpTxtColor, Color*& rpFldColor ) { return rOutliner.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor ); } -void SvxOutlinerForwarder::FieldClicked( const SvxFieldItem& rField, USHORT nPara, xub_StrLen nPos ) +void SvxOutlinerForwarder::FieldClicked( const SvxFieldItem& rField, sal_uInt16 nPara, xub_StrLen nPos ) { rOutliner.FieldClicked( rField, nPara, nPos ); } -BOOL SvxOutlinerForwarder::IsValid() const +sal_Bool SvxOutlinerForwarder::IsValid() const { // cannot reliably query outliner state // while in the middle of an update return rOutliner.GetUpdateMode(); } -extern USHORT GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, USHORT nWhich ); +extern sal_uInt16 GetSvxEditEngineItemState( EditEngine& rEditEngine, const ESelection& rSel, sal_uInt16 nWhich ); -USHORT SvxOutlinerForwarder::GetItemState( const ESelection& rSel, USHORT nWhich ) const +sal_uInt16 SvxOutlinerForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const { return GetSvxEditEngineItemState( (EditEngine&)rOutliner.GetEditEngine(), rSel, nWhich ); } -USHORT SvxOutlinerForwarder::GetItemState( USHORT nPara, USHORT nWhich ) const +sal_uInt16 SvxOutlinerForwarder::GetItemState( sal_uInt16 nPara, sal_uInt16 nWhich ) const { const SfxItemSet& rSet = rOutliner.GetParaAttribs( nPara ); return rSet.GetItemState( nWhich ); @@ -283,33 +283,33 @@ void SvxOutlinerForwarder::flushCache() } } -LanguageType SvxOutlinerForwarder::GetLanguage( USHORT nPara, USHORT nIndex ) const +LanguageType SvxOutlinerForwarder::GetLanguage( sal_uInt16 nPara, sal_uInt16 nIndex ) const { return rOutliner.GetLanguage(nPara, nIndex); } -USHORT SvxOutlinerForwarder::GetFieldCount( USHORT nPara ) const +sal_uInt16 SvxOutlinerForwarder::GetFieldCount( sal_uInt16 nPara ) const { return rOutliner.GetEditEngine().GetFieldCount(nPara); } -EFieldInfo SvxOutlinerForwarder::GetFieldInfo( USHORT nPara, USHORT nField ) const +EFieldInfo SvxOutlinerForwarder::GetFieldInfo( sal_uInt16 nPara, sal_uInt16 nField ) const { return rOutliner.GetEditEngine().GetFieldInfo( nPara, nField ); } -EBulletInfo SvxOutlinerForwarder::GetBulletInfo( USHORT nPara ) const +EBulletInfo SvxOutlinerForwarder::GetBulletInfo( sal_uInt16 nPara ) const { return rOutliner.GetBulletInfo( nPara ); } -Rectangle SvxOutlinerForwarder::GetCharBounds( USHORT nPara, USHORT nIndex ) const +Rectangle SvxOutlinerForwarder::GetCharBounds( sal_uInt16 nPara, sal_uInt16 nIndex ) const { // EditEngine's 'internal' methods like GetCharacterBounds() // don't rotate for vertical text. Size aSize( rOutliner.CalcTextSize() ); ::std::swap( aSize.Width(), aSize.Height() ); - bool bIsVertical( rOutliner.IsVertical() == TRUE ); + bool bIsVertical( rOutliner.IsVertical() == sal_True ); // #108900# Handle virtual position one-past-the end of the string if( nIndex >= GetTextLen(nPara) ) @@ -350,7 +350,7 @@ Rectangle SvxOutlinerForwarder::GetCharBounds( USHORT nPara, USHORT nIndex ) con } } -Rectangle SvxOutlinerForwarder::GetParaBounds( USHORT nPara ) const +Rectangle SvxOutlinerForwarder::GetParaBounds( sal_uInt16 nPara ) const { Point aPnt = rOutliner.GetDocPosTopLeft( nPara ); Size aSize = rOutliner.CalcTextSize(); @@ -360,13 +360,13 @@ Rectangle SvxOutlinerForwarder::GetParaBounds( USHORT nPara ) const // Hargl. Outliner's 'external' methods return the rotated // dimensions, 'internal' methods like GetTextHeight( n ) // don't rotate. - ULONG nWidth = rOutliner.GetTextHeight( nPara ); + sal_uLong nWidth = rOutliner.GetTextHeight( nPara ); return Rectangle( aSize.Width() - aPnt.Y() - nWidth, 0, aSize.Width() - aPnt.Y(), aSize.Height() ); } else { - ULONG nHeight = rOutliner.GetTextHeight( nPara ); + sal_uLong nHeight = rOutliner.GetTextHeight( nPara ); return Rectangle( 0, aPnt.Y(), aSize.Width(), aPnt.Y() + nHeight ); } @@ -382,13 +382,13 @@ OutputDevice* SvxOutlinerForwarder::GetRefDevice() const return rOutliner.GetRefDevice(); } -sal_Bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, USHORT& nPara, USHORT& nIndex ) const +sal_Bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, sal_uInt16& nPara, sal_uInt16& nIndex ) const { Size aSize( rOutliner.CalcTextSize() ); ::std::swap( aSize.Width(), aSize.Height() ); Point aEEPos( SvxEditSourceHelper::UserSpaceToEE( rPos, aSize, - rOutliner.IsVertical() == TRUE )); + rOutliner.IsVertical() == sal_True )); EPosition aDocPos = rOutliner.GetEditEngine().FindDocPosition( aEEPos ); @@ -398,7 +398,7 @@ sal_Bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, USHORT& nPara return sal_True; } -sal_Bool SvxOutlinerForwarder::GetWordIndices( USHORT nPara, USHORT nIndex, USHORT& nStart, USHORT& nEnd ) const +sal_Bool SvxOutlinerForwarder::GetWordIndices( sal_uInt16 nPara, sal_uInt16 nIndex, sal_uInt16& nStart, sal_uInt16& nEnd ) const { ESelection aRes = rOutliner.GetEditEngine().GetWord( ESelection(nPara, nIndex, nPara, nIndex), com::sun::star::i18n::WordType::DICTIONARY_WORD ); @@ -414,32 +414,32 @@ sal_Bool SvxOutlinerForwarder::GetWordIndices( USHORT nPara, USHORT nIndex, USHO return sal_False; } -sal_Bool SvxOutlinerForwarder::GetAttributeRun( USHORT& nStartIndex, USHORT& nEndIndex, USHORT nPara, USHORT nIndex ) const +sal_Bool SvxOutlinerForwarder::GetAttributeRun( sal_uInt16& nStartIndex, sal_uInt16& nEndIndex, sal_uInt16 nPara, sal_uInt16 nIndex ) const { return SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rOutliner.GetEditEngine(), nPara, nIndex ); } -USHORT SvxOutlinerForwarder::GetLineCount( USHORT nPara ) const +sal_uInt16 SvxOutlinerForwarder::GetLineCount( sal_uInt16 nPara ) const { - return static_cast < USHORT >( rOutliner.GetLineCount(nPara) ); + return static_cast < sal_uInt16 >( rOutliner.GetLineCount(nPara) ); } -USHORT SvxOutlinerForwarder::GetLineLen( USHORT nPara, USHORT nLine ) const +sal_uInt16 SvxOutlinerForwarder::GetLineLen( sal_uInt16 nPara, sal_uInt16 nLine ) const { return rOutliner.GetLineLen(nPara, nLine); } -void SvxOutlinerForwarder::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT nPara, USHORT nLine ) const +void SvxOutlinerForwarder::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 nPara, sal_uInt16 nLine ) const { return rOutliner.GetEditEngine().GetLineBoundaries( rStart, rEnd, nPara, nLine ); } -USHORT SvxOutlinerForwarder::GetLineNumberAtIndex( USHORT nPara, USHORT nIndex ) const +sal_uInt16 SvxOutlinerForwarder::GetLineNumberAtIndex( sal_uInt16 nPara, sal_uInt16 nIndex ) const { return rOutliner.GetEditEngine().GetLineNumberAtIndex( nPara, nIndex ); } -sal_Bool SvxOutlinerForwarder::QuickFormatDoc( BOOL ) +sal_Bool SvxOutlinerForwarder::QuickFormatDoc( sal_Bool ) { rOutliner.QuickFormatDoc(); @@ -464,7 +464,7 @@ sal_Bool SvxOutlinerForwarder::InsertText( const String& rStr, const ESelection& return sal_True; } -sal_Int16 SvxOutlinerForwarder::GetDepth( USHORT nPara ) const +sal_Int16 SvxOutlinerForwarder::GetDepth( sal_uInt16 nPara ) const { DBG_ASSERT( nPara < GetParagraphCount(), "SvxOutlinerForwarder::GetDepth: Invalid paragraph index"); @@ -478,7 +478,7 @@ sal_Int16 SvxOutlinerForwarder::GetDepth( USHORT nPara ) const return nLevel; } -sal_Bool SvxOutlinerForwarder::SetDepth( USHORT nPara, sal_Int16 nNewDepth ) +sal_Bool SvxOutlinerForwarder::SetDepth( sal_uInt16 nPara, sal_Int16 nNewDepth ) { DBG_ASSERT( nPara < GetParagraphCount(), "SvxOutlinerForwarder::SetDepth: Invalid paragraph index"); @@ -562,12 +562,12 @@ void SvxOutlinerForwarder::AppendParagraph() rEditEngine.InsertParagraph( rEditEngine.GetParagraphCount(), String::EmptyString() ); } -xub_StrLen SvxOutlinerForwarder::AppendTextPortion( USHORT nPara, const String &rText, const SfxItemSet & /*rSet*/ ) +xub_StrLen SvxOutlinerForwarder::AppendTextPortion( sal_uInt16 nPara, const String &rText, const SfxItemSet & /*rSet*/ ) { xub_StrLen nLen = 0; EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() ); - USHORT nParaCount = rEditEngine.GetParagraphCount(); + sal_uInt16 nParaCount = rEditEngine.GetParagraphCount(); DBG_ASSERT( nPara < nParaCount, "paragraph index out of bounds" ); if (/*0 <= nPara && */nPara < nParaCount) { diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx index 2802b87afb6f..ff3fec8fcbf5 100644 --- a/editeng/source/uno/unoipset.cxx +++ b/editeng/source/uno/unoipset.cxx @@ -128,8 +128,8 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* if( NULL == pItem && pPool ) pItem = &(pPool->GetDefaultItem( pMap->nWID )); - const SfxMapUnit eMapUnit = pPool ? pPool->GetMetric((USHORT)pMap->nWID) : SFX_MAPUNIT_100TH_MM; - BYTE nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM); + const SfxMapUnit eMapUnit = pPool ? pPool->GetMetric((sal_uInt16)pMap->nWID) : SFX_MAPUNIT_100TH_MM; + sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM); if( eMapUnit == SFX_MAPUNIT_100TH_MM ) nMemberId &= (~CONVERT_TWIPS); @@ -190,7 +190,7 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa { uno::Any aValue( rVal ); - const SfxMapUnit eMapUnit = pPool ? pPool->GetMetric((USHORT)pMap->nWID) : SFX_MAPUNIT_100TH_MM; + const SfxMapUnit eMapUnit = pPool ? pPool->GetMetric((sal_uInt16)pMap->nWID) : SFX_MAPUNIT_100TH_MM; // check for needed metric translation if( (pMap->nMemberId & SFX_METRIC_ITEM) && eMapUnit != SFX_MAPUNIT_100TH_MM ) @@ -201,7 +201,7 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa pNewItem = pItem->Clone(); - BYTE nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM); + sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM); if( eMapUnit == SFX_MAPUNIT_100TH_MM ) nMemberId &= (~CONVERT_TWIPS); @@ -223,8 +223,8 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry* return *pUsrAny; // No UsrAny detected yet, generate Default entry and return this - const SfxMapUnit eMapUnit = mrItemPool.GetMetric((USHORT)pMap->nWID); - BYTE nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM); + const SfxMapUnit eMapUnit = mrItemPool.GetMetric((sal_uInt16)pMap->nWID); + sal_uInt8 nMemberId = pMap->nMemberId & (~SFX_METRIC_ITEM); if( eMapUnit == SFX_MAPUNIT_100TH_MM ) nMemberId &= (~CONVERT_TWIPS); uno::Any aVal; diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx index 70781878fa6b..b2d3ff1e45a7 100644..100755 --- a/editeng/source/uno/unonrule.cxx +++ b/editeng/source/uno/unonrule.cxx @@ -548,7 +548,7 @@ com::sun::star::uno::Reference< com::sun::star::container::XIndexReplace > SvxCr } else { - SvxNumRule aDefaultRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10 , FALSE); + SvxNumRule aDefaultRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, 10 , sal_False); return new SvxUnoNumberingRules( aDefaultRule ); } } @@ -584,13 +584,13 @@ sal_Int16 SvxUnoNumberingRules::Compare( const Any& Any1, const Any& Any2 ) const SvxNumRule& rRule1 = pRule1->getNumRule(); const SvxNumRule& rRule2 = pRule2->getNumRule(); - const USHORT nLevelCount1 = rRule1.GetLevelCount(); - const USHORT nLevelCount2 = rRule2.GetLevelCount(); + const sal_uInt16 nLevelCount1 = rRule1.GetLevelCount(); + const sal_uInt16 nLevelCount2 = rRule2.GetLevelCount(); if( nLevelCount1 == 0 || nLevelCount2 == 0 ) return -1; - for( USHORT i = 0; (i < nLevelCount1) && (i < nLevelCount2); i++ ) + for( sal_uInt16 i = 0; (i < nLevelCount1) && (i < nLevelCount2); i++ ) { if( rRule1.GetLevel(i) != rRule2.GetLevel(i) ) return -1; diff --git a/editeng/source/uno/unopracc.cxx b/editeng/source/uno/unopracc.cxx index 6a0ebeede6a0..6a0ebeede6a0 100644..100755 --- a/editeng/source/uno/unopracc.cxx +++ b/editeng/source/uno/unopracc.cxx diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index fa4db1bec37c..624345ac99ef 100644..100755 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -454,9 +454,9 @@ void SAL_CALL SvxUnoTextRangeBase::_setPropertyValue( const OUString& PropertyNa while( nPara <= nEndPara ) { // we have a paragraph - SfxItemSet aSet( pForwarder->GetParaAttribs( (USHORT)nPara ) ); + SfxItemSet aSet( pForwarder->GetParaAttribs( (sal_uInt16)nPara ) ); setPropertyValue( pMap, aValue, maSelection, aSet, aSet ); - pForwarder->SetParaAttribs( (USHORT)nPara, aSet ); + pForwarder->SetParaAttribs( (sal_uInt16)nPara, aSet ); nPara++; } } @@ -589,7 +589,7 @@ uno::Any SAL_CALL SvxUnoTextRangeBase::_getPropertyValue(const OUString& Propert { SfxItemSet* pAttribs = NULL; if( nPara != -1 ) - pAttribs = pForwarder->GetParaAttribs( (USHORT)nPara ).Clone(); + pAttribs = pForwarder->GetParaAttribs( (sal_uInt16)nPara ).Clone(); else pAttribs = pForwarder->GetAttribs( GetSelection() ).Clone(); @@ -798,7 +798,7 @@ void SAL_CALL SvxUnoTextRangeBase::_setPropertyValues( const uno::Sequence< ::rt { if( NULL == pNewParaSet ) { - const SfxItemSet aSet( pForwarder->GetParaAttribs( (USHORT)nTempPara ) ); + const SfxItemSet aSet( pForwarder->GetParaAttribs( (sal_uInt16)nTempPara ) ); pOldParaSet = new SfxItemSet( aSet ); pNewParaSet = new SfxItemSet( *pOldParaSet->GetPool(), pOldParaSet->GetRanges() ); } @@ -826,9 +826,9 @@ void SAL_CALL SvxUnoTextRangeBase::_setPropertyValues( const uno::Sequence< ::rt { while( nTempPara <= nEndPara ) { - SfxItemSet aSet( pForwarder->GetParaAttribs( (USHORT)nTempPara ) ); + SfxItemSet aSet( pForwarder->GetParaAttribs( (sal_uInt16)nTempPara ) ); aSet.Put( *pNewParaSet ); - pForwarder->SetParaAttribs( (USHORT)nTempPara, aSet ); + pForwarder->SetParaAttribs( (sal_uInt16)nTempPara, aSet ); nTempPara++; } bNeedsUpdate = sal_True; @@ -874,7 +874,7 @@ uno::Sequence< uno::Any > SAL_CALL SvxUnoTextRangeBase::_getPropertyValues( cons { SfxItemSet* pAttribs = NULL; if( nPara != -1 ) - pAttribs = pForwarder->GetParaAttribs( (USHORT)nPara ).Clone(); + pAttribs = pForwarder->GetParaAttribs( (sal_uInt16)nPara ).Clone(); else pAttribs = pForwarder->GetAttribs( GetSelection() ).Clone(); @@ -942,7 +942,7 @@ beans::PropertyState SAL_CALL SvxUnoTextRangeBase::_getPropertyState(const SfxIt while( *pWhichId ) { if(nPara != -1) - eTempItemState = pForwarder->GetItemState( (USHORT)nPara, *pWhichId ); + eTempItemState = pForwarder->GetItemState( (sal_uInt16)nPara, *pWhichId ); else eTempItemState = pForwarder->GetItemState( GetSelection(), *pWhichId ); @@ -991,7 +991,7 @@ beans::PropertyState SAL_CALL SvxUnoTextRangeBase::_getPropertyState(const SfxIt if( nWID != 0 ) { if( nPara != -1 ) - eItemState = pForwarder->GetItemState( (USHORT)nPara, nWID ); + eItemState = pForwarder->GetItemState( (sal_uInt16)nPara, nWID ); else eItemState = pForwarder->GetItemState( GetSelection(), nWID ); } @@ -1042,7 +1042,7 @@ uno::Sequence< beans::PropertyState > SvxUnoTextRangeBase::_getPropertyStates(co SfxItemSet* pSet = NULL; if( nPara != -1 ) { - pSet = new SfxItemSet( pForwarder->GetParaAttribs( (USHORT)nPara ) ); + pSet = new SfxItemSet( pForwarder->GetParaAttribs( (sal_uInt16)nPara ) ); } else { @@ -1190,7 +1190,7 @@ void SvxUnoTextRangeBase::_setPropertyToDefault(SvxTextForwarder* pForwarder, co { do { - SfxItemSet aSet( *pForwarder->GetPool(), TRUE ); + SfxItemSet aSet( *pForwarder->GetPool(), sal_True ); if( pMap->nWID == WID_FONTDESC ) { @@ -1216,7 +1216,7 @@ void SvxUnoTextRangeBase::_setPropertyToDefault(SvxTextForwarder* pForwarder, co } if(nPara != -1) - pForwarder->SetParaAttribs( (USHORT)nPara, aSet ); + pForwarder->SetParaAttribs( (sal_uInt16)nPara, aSet ); else pForwarder->QuickSetAttribs( aSet, GetSelection() ); @@ -2057,7 +2057,7 @@ void SvxPropertyValuesToItemSet( const uno::Sequence< beans::PropertyValue > rPropertyVaules, const SfxItemPropertySet *pPropSet, SvxTextForwarder *pForwarder /*needed for WID_NUMLEVEL*/, - USHORT nPara /*needed for WID_NUMLEVEL*/) + sal_uInt16 nPara /*needed for WID_NUMLEVEL*/) throw(lang::IllegalArgumentException, beans::UnknownPropertyException, uno::RuntimeException) { sal_Int32 nProps = rPropertyVaules.getLength(); @@ -2136,7 +2136,7 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextBase::appendParagraph( SvxTextForwarder *pTextForwarder = pEditSource ? pEditSource->GetTextForwarder() : 0; if (pTextForwarder) { - USHORT nParaCount = pTextForwarder->GetParagraphCount(); + sal_uInt16 nParaCount = pTextForwarder->GetParagraphCount(); DBG_ASSERT( nParaCount > 0, "paragraph count is 0 or negative" ); pTextForwarder->AppendParagraph(); @@ -2167,12 +2167,12 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextBase::finishParagraph( SvxTextForwarder *pTextForwarder = pEditSource ? pEditSource->GetTextForwarder() : 0; if (pTextForwarder) { - USHORT nParaCount = pTextForwarder->GetParagraphCount(); + sal_uInt16 nParaCount = pTextForwarder->GetParagraphCount(); DBG_ASSERT( nParaCount > 0, "paragraph count is 0 or negative" ); pTextForwarder->AppendParagraph(); // set properties for the previously last paragraph - USHORT nPara = nParaCount - 1; + sal_uInt16 nPara = nParaCount - 1; ESelection aSel( nPara, 0, nPara, 0 ); SfxItemSet aItemSet( *pTextForwarder->GetEmptyItemSetPtr() ); SvxPropertyValuesToItemSet( aItemSet, rCharAndParaProps, @@ -2199,9 +2199,9 @@ uno::Reference< text::XTextRange > SAL_CALL SvxUnoTextBase::appendTextPortion( uno::Reference< text::XTextRange > xRet; if (pTextForwarder) { - USHORT nParaCount = pTextForwarder->GetParagraphCount(); + sal_uInt16 nParaCount = pTextForwarder->GetParagraphCount(); DBG_ASSERT( nParaCount > 0, "paragraph count is 0 or negative" ); - USHORT nPara = nParaCount - 1; + sal_uInt16 nPara = nParaCount - 1; SfxItemSet aSet( pTextForwarder->GetParaAttribs( nPara ) ); xub_StrLen nStart = pTextForwarder->AppendTextPortion( nPara, rText, aSet ); pEditSource->UpdateData(); @@ -2463,7 +2463,7 @@ String SvxDummyTextSource::GetText( const ESelection& ) const return String(); } -SfxItemSet SvxDummyTextSource::GetAttribs( const ESelection&, BOOL ) const +SfxItemSet SvxDummyTextSource::GetAttribs( const ESelection&, sal_Bool ) const { // Very dangerous: The former implementation used a SfxItemPool created on the // fly which of course was deleted again ASAP. Thus, the returned SfxItemSet was using @@ -2524,7 +2524,7 @@ XubString SvxDummyTextSource::CalcFieldValue( const SvxFieldItem&, sal_uInt16, s return XubString(); } -void SvxDummyTextSource::FieldClicked( const SvxFieldItem&, USHORT, xub_StrLen ) +void SvxDummyTextSource::FieldClicked( const SvxFieldItem&, sal_uInt16, xub_StrLen ) { } @@ -2537,32 +2537,32 @@ void SvxDummyTextSource::SetNotifyHdl( const Link& ) { } -LanguageType SvxDummyTextSource::GetLanguage( USHORT, USHORT ) const +LanguageType SvxDummyTextSource::GetLanguage( sal_uInt16, sal_uInt16 ) const { return LANGUAGE_DONTKNOW; } -USHORT SvxDummyTextSource::GetFieldCount( USHORT ) const +sal_uInt16 SvxDummyTextSource::GetFieldCount( sal_uInt16 ) const { return 0; } -EFieldInfo SvxDummyTextSource::GetFieldInfo( USHORT, USHORT ) const +EFieldInfo SvxDummyTextSource::GetFieldInfo( sal_uInt16, sal_uInt16 ) const { return EFieldInfo(); } -EBulletInfo SvxDummyTextSource::GetBulletInfo( USHORT ) const +EBulletInfo SvxDummyTextSource::GetBulletInfo( sal_uInt16 ) const { return EBulletInfo(); } -Rectangle SvxDummyTextSource::GetCharBounds( USHORT, USHORT ) const +Rectangle SvxDummyTextSource::GetCharBounds( sal_uInt16, sal_uInt16 ) const { return Rectangle(); } -Rectangle SvxDummyTextSource::GetParaBounds( USHORT ) const +Rectangle SvxDummyTextSource::GetParaBounds( sal_uInt16 ) const { return Rectangle(); } @@ -2577,52 +2577,52 @@ OutputDevice* SvxDummyTextSource::GetRefDevice() const return NULL; } -sal_Bool SvxDummyTextSource::GetIndexAtPoint( const Point&, USHORT&, USHORT& ) const +sal_Bool SvxDummyTextSource::GetIndexAtPoint( const Point&, sal_uInt16&, sal_uInt16& ) const { return sal_False; } -sal_Bool SvxDummyTextSource::GetWordIndices( USHORT, USHORT, USHORT&, USHORT& ) const +sal_Bool SvxDummyTextSource::GetWordIndices( sal_uInt16, sal_uInt16, sal_uInt16&, sal_uInt16& ) const { return sal_False; } -sal_Bool SvxDummyTextSource::GetAttributeRun( USHORT&, USHORT&, USHORT, USHORT ) const +sal_Bool SvxDummyTextSource::GetAttributeRun( sal_uInt16&, sal_uInt16&, sal_uInt16, sal_uInt16 ) const { return sal_False; } -USHORT SvxDummyTextSource::GetLineCount( USHORT ) const +sal_uInt16 SvxDummyTextSource::GetLineCount( sal_uInt16 ) const { return 0; } -USHORT SvxDummyTextSource::GetLineLen( USHORT, USHORT ) const +sal_uInt16 SvxDummyTextSource::GetLineLen( sal_uInt16, sal_uInt16 ) const { return 0; } -void SvxDummyTextSource::GetLineBoundaries( /*out*/USHORT &rStart, /*out*/USHORT &rEnd, USHORT /*nParagraph*/, USHORT /*nLine*/ ) const +void SvxDummyTextSource::GetLineBoundaries( /*out*/sal_uInt16 &rStart, /*out*/sal_uInt16 &rEnd, sal_uInt16 /*nParagraph*/, sal_uInt16 /*nLine*/ ) const { rStart = rEnd = 0; } -USHORT SvxDummyTextSource::GetLineNumberAtIndex( USHORT /*nPara*/, USHORT /*nIndex*/ ) const +sal_uInt16 SvxDummyTextSource::GetLineNumberAtIndex( sal_uInt16 /*nPara*/, sal_uInt16 /*nIndex*/ ) const { return 0; } -sal_Bool SvxDummyTextSource::QuickFormatDoc( BOOL ) +sal_Bool SvxDummyTextSource::QuickFormatDoc( sal_Bool ) { return sal_False; } -sal_Int16 SvxDummyTextSource::GetDepth( USHORT ) const +sal_Int16 SvxDummyTextSource::GetDepth( sal_uInt16 ) const { return -1; } -sal_Bool SvxDummyTextSource::SetDepth( USHORT, sal_Int16 nNewDepth ) +sal_Bool SvxDummyTextSource::SetDepth( sal_uInt16, sal_Int16 nNewDepth ) { return nNewDepth == 0 ? sal_True : sal_False; } @@ -2646,7 +2646,7 @@ void SvxDummyTextSource::AppendParagraph() { } -xub_StrLen SvxDummyTextSource::AppendTextPortion( USHORT, const String &, const SfxItemSet & ) +xub_StrLen SvxDummyTextSource::AppendTextPortion( sal_uInt16, const String &, const SfxItemSet & ) { return 0; } diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index aa269cece0f2..afadbe1404dc 100644..100755 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -31,7 +31,7 @@ #include <vcl/svapp.hxx> #include <osl/mutex.hxx> -#define _SVSTDARR_USHORTS +#define _SVSTDARR_sal_uIt16S #include <svl/svstdarr.hxx> #include <rtl/uuid.h> diff --git a/editeng/source/uno/unoviwed.cxx b/editeng/source/uno/unoviwed.cxx index bdc6ada90c86..5a7d8591389a 100644..100755 --- a/editeng/source/uno/unoviwed.cxx +++ b/editeng/source/uno/unoviwed.cxx @@ -44,7 +44,7 @@ SvxEditEngineViewForwarder::~SvxEditEngineViewForwarder() { } -BOOL SvxEditEngineViewForwarder::IsValid() const +sal_Bool SvxEditEngineViewForwarder::IsValid() const { return sal_True; } diff --git a/editeng/source/uno/unoviwou.cxx b/editeng/source/uno/unoviwou.cxx index bceab8ad0a41..7184095ae575 100644..100755 --- a/editeng/source/uno/unoviwou.cxx +++ b/editeng/source/uno/unoviwou.cxx @@ -57,7 +57,7 @@ Point SvxDrawOutlinerViewForwarder::GetTextOffset() const return aOutputRect.TopLeft() - maTextShapeTopLeft; } -BOOL SvxDrawOutlinerViewForwarder::IsValid() const +sal_Bool SvxDrawOutlinerViewForwarder::IsValid() const { return sal_True; } diff --git a/editeng/source/xml/editsource.hxx b/editeng/source/xml/editsource.hxx index 4141bca34935..4141bca34935 100644..100755 --- a/editeng/source/xml/editsource.hxx +++ b/editeng/source/xml/editsource.hxx diff --git a/editeng/source/xml/makefile.mk b/editeng/source/xml/makefile.mk deleted file mode 100644 index a1c530cb00d6..000000000000 --- a/editeng/source/xml/makefile.mk +++ /dev/null @@ -1,46 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# This file is part of OpenOffice.org. -# -# OpenOffice.org is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 3 -# only, as published by the Free Software Foundation. -# -# OpenOffice.org is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License version 3 for more details -# (a copy is included in the LICENSE file that accompanied this code). -# -# You should have received a copy of the GNU Lesser General Public License -# version 3 along with OpenOffice.org. If not, see -# <http://www.openoffice.org/license.html> -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=..$/.. -PRJNAME=editeng -TARGET=xml - -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk - -# --- Files -------------------------------------------------------- -SLOFILES = \ - $(SLO)$/xmltxtimp.obj \ - $(SLO)$/xmltxtexp.obj - -# --- Targets -------------------------------------------------------------- - -.INCLUDE : target.mk diff --git a/editeng/source/xml/xmltxtexp.cxx b/editeng/source/xml/xmltxtexp.cxx index f62f4054fd0c..255a69c3df7b 100644..100755 --- a/editeng/source/xml/xmltxtexp.cxx +++ b/editeng/source/xml/xmltxtexp.cxx @@ -449,7 +449,7 @@ void SvxWriteXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& /* testcode const OUString aURL( RTL_CONSTASCII_USTRINGPARAM( "file:///e:/test.xml" ) ); - SfxMedium aMedium( aURL, STREAM_WRITE | STREAM_TRUNC, TRUE ); + SfxMedium aMedium( aURL, STREAM_WRITE | STREAM_TRUNC, sal_True ); aMedium.IsRemote(); uno::Reference<io::XOutputStream> xOut( new utl::OOutputStreamWrapper( *aMedium.GetOutStream() ) ); */ diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx index a09c125fe0ff..9596c2503979 100644..100755 --- a/editeng/source/xml/xmltxtimp.cxx +++ b/editeng/source/xml/xmltxtimp.cxx @@ -68,10 +68,10 @@ using namespace xmloff::token; class SvxXMLTextImportContext : public SvXMLImportContext { public: - SvxXMLTextImportContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLName, const uno::Reference< XAttributeList >& xAttrList, const uno::Reference< XText >& xText ); + SvxXMLTextImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference< XAttributeList >& xAttrList, const uno::Reference< XText >& xText ); virtual ~SvxXMLTextImportContext(); - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList ); + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList ); // SvxXMLXTableImport& getImport() const { return *(SvxXMLXTableImport*)&GetImport(); } @@ -81,7 +81,7 @@ private: /////////////////////////////////////////////////////////////////////// -SvxXMLTextImportContext::SvxXMLTextImportContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLName, const uno::Reference< XAttributeList >&, const uno::Reference< XText >& xText ) +SvxXMLTextImportContext::SvxXMLTextImportContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const OUString& rLName, const uno::Reference< XAttributeList >&, const uno::Reference< XText >& xText ) : SvXMLImportContext( rImport, nPrfx, rLName ), mxText( xText ) { } @@ -90,7 +90,7 @@ SvxXMLTextImportContext::~SvxXMLTextImportContext() { } -SvXMLImportContext *SvxXMLTextImportContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList ) +SvXMLImportContext *SvxXMLTextImportContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList ) { SvXMLImportContext* pContext = NULL; if(XML_NAMESPACE_OFFICE == nPrefix && IsXMLToken( rLocalName, XML_BODY ) ) @@ -127,7 +127,7 @@ public: static sal_Bool load( const rtl::OUString& rUrl, const com::sun::star::uno::Reference< com::sun::star::container::XNameContainer >& xTable ) throw(); protected: - virtual SvXMLImportContext *CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList ); + virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList ); private: const uno::Reference< XText > mxText; @@ -189,7 +189,7 @@ void SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& r /* testcode const OUString aURL( RTL_CONSTASCII_USTRINGPARAM( "file:///e:/test.xml" ) ); - SfxMedium aMedium( aURL, STREAM_READ | STREAM_NOCREATE, TRUE ); + SfxMedium aMedium( aURL, STREAM_READ | STREAM_NOCREATE, sal_True ); aMedium.IsRemote(); uno::Reference<io::XOutputStream> xOut( new utl::OOutputStreamWrapper( *aMedium.GetOutStream() ) ); @@ -242,7 +242,7 @@ void SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection& r } } -SvXMLImportContext *SvxXMLXTextImportComponent::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList ) +SvXMLImportContext *SvxXMLXTextImportComponent::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< XAttributeList >& xAttrList ) { SvXMLImportContext* pContext; if(XML_NAMESPACE_OFFICE == nPrefix && ( IsXMLToken( rLocalName, XML_DOCUMENT ) || IsXMLToken( rLocalName, XML_DOCUMENT_CONTENT ) ) ) |