[Libreoffice-commits] .: editeng/source
Caolán McNamara
caolan at kemper.freedesktop.org
Mon Jun 13 07:41:12 PDT 2011
editeng/source/editeng/impedit4.cxx | 94 ++++++++++++++++++------------------
1 file changed, 47 insertions(+), 47 deletions(-)
New commits:
commit 825b0cbd4de072c70c1b3416d411bf26ee0e71e1
Author: Joseph Powers <jpowers27 at cox.net>
Date: Mon Jun 13 07:16:53 2011 -0700
Cleanup so compiler errors caused by stream.hxx cleanup
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index f9c1510..04d6131 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -168,7 +168,7 @@ EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, EditSelection aSel )
if ( aSel.HasRange() )
aSel = ImpDeleteSelection( aSel );
- // The SvRTF parser expects the Which-mapping passed on in the pool, not
+ // The SvRTF parser expects the Which-mapping passed on in the pool, not
// dependant on a secondary.
SfxItemPool* pPool = &aEditDoc.GetItemPool();
while ( pPool->GetSecondaryPool() && !pPool->GetName().EqualsAscii( "EditEngineItemPool" ) )
@@ -398,7 +398,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
SvxFontItem* pFontItem = aFontTable.Get( j );
rOutput << '{';
rOutput << OOO_STRING_SVTOOLS_RTF_F;
- rOutput.WriteNumber( j );
+ rOutput.WriteNumber( static_cast<sal_uInt32>( j ) );
switch ( pFontItem->GetFamily() )
{
case FAMILY_DONTKNOW: rOutput << OOO_STRING_SVTOOLS_RTF_FNIL;
@@ -425,14 +425,14 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
default:
break;
}
- rOutput.WriteNumber( nVal );
+ rOutput.WriteNumber( static_cast<sal_uInt32>( nVal ) );
CharSet eChrSet = pFontItem->GetCharSet();
DBG_ASSERT( eChrSet != 9, "SystemCharSet?!" );
if( RTL_TEXTENCODING_DONTKNOW == eChrSet )
eChrSet = gsl_getSystemTextEncoding();
rOutput << OOO_STRING_SVTOOLS_RTF_FCHARSET;
- rOutput.WriteNumber( rtl_getBestWindowsCharsetFromTextEncoding( eChrSet ) );
+ rOutput.WriteNumber( static_cast<sal_uInt32>( rtl_getBestWindowsCharsetFromTextEncoding( eChrSet ) ) );
rOutput << ' ';
RTFOutFuncs::Out_String( rOutput, pFontItem->GetFamilyName(), eDestEnc );
@@ -487,7 +487,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
SfxStyleSheet* pStyle = (SfxStyleSheet*)GetStyleSheetPool()->GetStyles()[ nStyle ].get();
rOutput << endl << '{' << OOO_STRING_SVTOOLS_RTF_S;
- sal_uInt16 nNumber = (sal_uInt16) (nStyle + 1);
+ sal_uInt32 nNumber = nStyle + 1;
rOutput.WriteNumber( nNumber );
// Attribute, alos from Parent!
@@ -506,7 +506,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
SfxStyleSheet* pParent = (SfxStyleSheet*)GetStyleSheetPool()->Find( pStyle->GetParent(), pStyle->GetFamily() );
DBG_ASSERT( pParent, "Parent not found!" );
rOutput << OOO_STRING_SVTOOLS_RTF_SBASEDON;
- nNumber = (sal_uInt16) getStylePos( GetStyleSheetPool()->GetStyles(), pParent ) + 1;
+ nNumber = getStylePos( GetStyleSheetPool()->GetStyles(), pParent ) + 1;
rOutput.WriteNumber( nNumber );
}
@@ -517,7 +517,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
DBG_ASSERT( pNext, "Next ot found!" );
rOutput << OOO_STRING_SVTOOLS_RTF_SNEXT;
- nNumber = (sal_uInt16) getStylePos( GetStyleSheetPool()->GetStyles(), pNext ) + 1;
+ nNumber = getStylePos( GetStyleSheetPool()->GetStyles(), pNext ) + 1;
rOutput.WriteNumber( nNumber );
// Name of the template ...
@@ -544,7 +544,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
Point( aEditDoc.GetDefTab(), 0 ),
&GetRefMapMode(), &aTwpMode ).X();
rOutput << OOO_STRING_SVTOOLS_RTF_DEFTAB;
- rOutput.WriteNumber( nDefTabTwps );
+ rOutput.WriteNumber( static_cast<sal_uInt32>( nDefTabTwps ) );
rOutput << endl;
// iterate over the paragraphs ...
@@ -562,7 +562,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
{
// Number of template
rOutput << OOO_STRING_SVTOOLS_RTF_S;
- sal_uInt16 nNumber = (sal_uInt16) getStylePos( GetStyleSheetPool()->GetStyles(), pNode->GetStyleSheet() ) + 1;
+ sal_uInt32 nNumber = getStylePos( GetStyleSheetPool()->GetStyles(), pNode->GetStyleSheet() ) + 1;
rOutput.WriteNumber( nNumber );
// All Attribute
@@ -721,7 +721,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
break;
case EE_PARA_OUTLLEVEL:
{
- sal_Int16 nLevel = ((const SfxInt16Item&)rItem).GetValue();
+ sal_Int32 nLevel = ((const SfxInt16Item&)rItem).GetValue();
if( nLevel >= 0 )
{
rOutput << "\\level";
@@ -733,12 +733,12 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
case EE_PARA_LRSPACE:
{
rOutput << OOO_STRING_SVTOOLS_RTF_FI;
- short nTxtFirst = ((const SvxLRSpaceItem&)rItem).GetTxtFirstLineOfst();
- nTxtFirst = (short)LogicToTwips( nTxtFirst );
+ sal_Int32 nTxtFirst = ((const SvxLRSpaceItem&)rItem).GetTxtFirstLineOfst();
+ nTxtFirst = LogicToTwips( nTxtFirst );
rOutput.WriteNumber( nTxtFirst );
rOutput << OOO_STRING_SVTOOLS_RTF_LI;
- sal_uInt16 nTxtLeft = static_cast< sal_uInt16 >(((const SvxLRSpaceItem&)rItem).GetTxtLeft());
- nTxtLeft = (sal_uInt16)LogicToTwips( nTxtLeft );
+ sal_uInt32 nTxtLeft = static_cast< sal_uInt32 >(((const SvxLRSpaceItem&)rItem).GetTxtLeft());
+ nTxtLeft = (sal_uInt32)LogicToTwips( nTxtLeft );
rOutput.WriteNumber( nTxtLeft );
rOutput << OOO_STRING_SVTOOLS_RTF_RI;
sal_uInt32 nTxtRight = ((const SvxLRSpaceItem&)rItem).GetRight();
@@ -749,12 +749,12 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
case EE_PARA_ULSPACE:
{
rOutput << OOO_STRING_SVTOOLS_RTF_SB;
- sal_uInt16 nUpper = ((const SvxULSpaceItem&)rItem).GetUpper();
- nUpper = (sal_uInt16)LogicToTwips( nUpper );
+ sal_uInt32 nUpper = ((const SvxULSpaceItem&)rItem).GetUpper();
+ nUpper = (sal_uInt32)LogicToTwips( nUpper );
rOutput.WriteNumber( nUpper );
rOutput << OOO_STRING_SVTOOLS_RTF_SA;
- sal_uInt16 nLower = ((const SvxULSpaceItem&)rItem).GetLower();
- nLower = (sal_uInt16)LogicToTwips( nLower );
+ sal_uInt32 nLower = ((const SvxULSpaceItem&)rItem).GetLower();
+ nLower = LogicToTwips( nLower );
rOutput.WriteNumber( nLower );
}
break;
@@ -765,7 +765,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
char cMult = '0';
if ( ((const SvxLineSpacingItem&)rItem).GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP )
{
- // From where do I get the value now?
+ // From where do I get the value now?
// The SwRTF parser is based on a 240 Font!
nVal = ((const SvxLineSpacingItem&)rItem).GetPropLineSpace();
nVal *= 240;
@@ -843,7 +843,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
break;
case EE_CHAR_UNDERLINE:
{
- // Must underlined if in WordLineMode, but the information is
+ // Must underlined if in WordLineMode, but the information is
// missing here
FontUnderline e = ((const SvxUnderlineItem&)rItem).GetLineStyle();
switch ( e )
@@ -953,7 +953,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
case EE_CHAR_PAIRKERNING:
{
rOutput << OOO_STRING_SVTOOLS_RTF_KERNING;
- rOutput.WriteNumber( ((const SvxAutoKernItem&)rItem).GetValue() ? 1 : 0 );
+ rOutput.WriteNumber( static_cast<sal_uInt32>(((const SvxAutoKernItem&)rItem).GetValue() ? 1 : 0 ));
}
break;
case EE_CHAR_ESCAPEMENT:
@@ -1032,7 +1032,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
( aSel.Max().GetIndex() < aSel.Max().GetNode()->Len() ) ) ?
sal_False : sal_True;
- // Templates are not saved!
+ // Templates are not saved!
// (Only the name and family, template itself must be in App!)
pTxtObj->SetScriptType( GetScriptType( aSel ) );
@@ -1113,7 +1113,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
}
- // Remember the portions info in case of large text objects:
+ // Remember the portions info in case of large text objects:
// sleeper set up when Olli paragraphs not hacked!
if ( bAllowBigObjects && bOnlyFullParagraphs && IsFormatted() && GetUpdateMode() && ( nTextPortions >= nBigObjectStart ) )
{
@@ -1251,8 +1251,8 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed
{
if ( !bAllreadyHasAttribs || pX->IsFeature() )
{
- // Normal attributes then go faster ...
- // Features shall not be inserted through
+ // Normal attributes then go faster ...
+ // Features shall not be inserted through
// EditDoc:: InsertAttrib, using FastInsertText they are
// already in the flow
DBG_ASSERT( pX->GetEnd() <= aPaM.GetNode()->Len(), "InsertBinTextObject: Attribute too large!" );
@@ -1293,7 +1293,7 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed
{
bParaAttribs = sal_False;
{
- // only style and ParaAttribs when new paragraph, or
+ // only style and ParaAttribs when new paragraph, or
// completely internal ...
bParaAttribs = pC->GetParaAttribs().Count() ? sal_True : sal_False;
if ( GetStyleSheetPool() && pC->GetStyle().Len() )
@@ -1353,7 +1353,7 @@ EditSelection ImpEditEngine::InsertBinTextObject( BinTextObject& rTextObject, Ed
#endif
}
}
- if ( !bParaAttribs ) // DefFont is not calculated for FastInsertParagraph
+ if ( !bParaAttribs ) // DefFont is not calculated for FastInsertParagraph
{
aPaM.GetNode()->GetCharAttribs().GetDefFont() = aEditDoc.GetDefFont();
if ( aStatus.UseCharAttribs() )
@@ -1812,7 +1812,7 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView )
Sequence< PropertyValue > aEmptySeq;
while (!xSpellAlt.is())
{
- // Known (most likely) bug: If SpellToCurrent, the current has to be
+ // Known (most likely) bug: If SpellToCurrent, the current has to be
// corrected at each replacement, otherwise it may not fit exactly in
// the end ...
if ( pSpellInfo->bSpellToEnd || pSpellInfo->bMultipleDoc )
@@ -1833,7 +1833,7 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView )
aCurSel = SelectWord( aCurSel, ::com::sun::star::i18n::WordType::DICTIONARY_WORD );
aWord = GetSelected( aCurSel );
- // If afterwards a dot, this must be handed over!
+ // If afterwards a dot, this must be handed over!
// If an abbreviation ...
if ( aWord.Len() && ( aCurSel.Max().GetIndex() < aCurSel.Max().GetNode()->Len() ) )
{
@@ -1898,7 +1898,7 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpFindNextError(EditSelection& r
aCurSel = SelectWord( aCurSel, ::com::sun::star::i18n::WordType::DICTIONARY_WORD );
aWord = GetSelected( aCurSel );
- // If afterwards a dot, this must be handed over!
+ // If afterwards a dot, this must be handed over!
// If an abbreviation ...
if ( aWord.Len() && ( aCurSel.Max().GetIndex() < aCurSel.Max().GetNode()->Len() ) )
{
@@ -2197,7 +2197,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView,
aNext = EditPaM( aOldSel.Max().GetNode(), nEndOfSentence );
}
rEditView.pImpEditView->SetEditSelection( aNext );
-
+
FormatAndUpdate();
aEditDoc.SetModified(sal_True);
}
@@ -2215,12 +2215,12 @@ void ImpEditEngine::PutSpellingToSentenceStart( EditView& rEditView )
void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpellAtCursorPos, sal_Bool bInteruptable )
{
/*
- It will iterate over all the paragraphs, paragraphs with only
+ It will iterate over all the paragraphs, paragraphs with only
invalidated wrong list will be checked ...
- All the words are checked in the invalidated region. Is a word wrong,
+ All the words are checked in the invalidated region. Is a word wrong,
but not in the wrong list, or vice versa, the range of the word will be
- invalidated
+ invalidated
(no Invalidate, but if only transitions wrong from right =>, simple Paint,
even out properly with VDev on transitions from wrong => right)
*/
@@ -2268,7 +2268,7 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel
aSel = SelectWord( aSel, ::com::sun::star::i18n::WordType::DICTIONARY_WORD );
String aWord( GetSelected( aSel ) );
- // If afterwards a dot, this must be handed over!
+ // If afterwards a dot, this must be handed over!
// If an abbreviation ...
sal_Bool bDottAdded = sal_False;
if ( aSel.Max().GetIndex() < aSel.Max().GetNode()->Len() )
@@ -2313,8 +2313,8 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel
else
{
// It may be that the Wrongs in the list ar not
- // spanning exactly over words because the
- // WordDelimiters during expansion are not
+ // spanning exactly over words because the
+ // WordDelimiters during expansion are not
// evaluated.
pWrongList->InsertWrong( nWStart, nXEnd, sal_True );
bChanged = sal_True;
@@ -2344,9 +2344,9 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel
if ( bChanged && ( aSel.Min().GetNode() == pNode ) &&
( ( aSel.Min().GetIndex()-aLastEnd.GetIndex() > 1 ) ) )
{
- // If two words are separated by more than one blank, it
- // can happen that when splitting a Wrongs the start of
- // the second word is before the actually word
+ // If two words are separated by more than one blank, it
+ // can happen that when splitting a Wrongs the start of
+ // the second word is before the actually word
pWrongList->ClearWrongs( aLastEnd.GetIndex(), aSel.Min().GetIndex(), pNode );
}
}
@@ -2359,7 +2359,7 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, sal_Bool bSpel
if ( aEditViews.Count() )
{
- // For SimpleRepaint one was painted over a range without
+ // For SimpleRepaint one was painted over a range without
// reaching VDEV, but then one would have to intersect, c
// clipping, ... over all views. Probably not worthwhile.
EditPaM aStartPaM( pNode, nPaintFrom );
@@ -2481,7 +2481,7 @@ sal_uInt16 ImpEditEngine::StartSearchAndReplace( EditView* pEditView, const SvxS
EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() );
- // FIND_ALL is not possible without multiple selection.
+ // FIND_ALL is not possible without multiple selection.
if ( ( rSearchItem.GetCommand() == SVX_SEARCHCMD_FIND ) ||
( rSearchItem.GetCommand() == SVX_SEARCHCMD_FIND_ALL ) )
{
@@ -2735,11 +2735,11 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
i18n::Boundary aEndBndry;
aSttBndry = _xBI->getWordBoundary(
*pNode, nStartPos,
- SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ),
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nStartPos + 1 ) ) ),
nWordType, sal_True /*prefer forward direction*/);
aEndBndry = _xBI->getWordBoundary(
*pNode, nEndPos,
- SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ),
+ SvxCreateLocale( GetLanguage( EditPaM( pNode, nEndPos + 1 ) ) ),
nWordType, sal_False /*prefer backward direction*/);
// prevent backtracking to the previous word if selection is at word boundary
@@ -2964,11 +2964,11 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
sal_uInt16 nSelNode = aEditDoc.GetPos( rData.aSelection.Min().GetNode() );
ParaPortion* pParaPortion = GetParaPortions()[nSelNode];
- pParaPortion->MarkSelectionInvalid( rData.nStart,
- std::max< sal_uInt16 >( rData.nStart + rData.nLen,
+ pParaPortion->MarkSelectionInvalid( rData.nStart,
+ std::max< sal_uInt16 >( rData.nStart + rData.nLen,
rData.nStart + rData.aNewText.Len() ) );
}
- }
+ }
}
if ( pUndo )
More information about the Libreoffice-commits
mailing list