diff options
Diffstat (limited to 'sw/source/core/unocore/unotextmarkup.cxx')
-rw-r--r-- | sw/source/core/unocore/unotextmarkup.cxx | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/sw/source/core/unocore/unotextmarkup.cxx b/sw/source/core/unocore/unotextmarkup.cxx index a4260ed63d19..e4cfb912fbd5 100644 --- a/sw/source/core/unocore/unotextmarkup.cxx +++ b/sw/source/core/unocore/unotextmarkup.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -65,12 +65,12 @@ uno::Reference< container::XStringKeyMap > SAL_CALL SwXTextMarkup::getMarkupInfo return xProp; } -void SAL_CALL SwXTextMarkup::commitTextMarkup( - ::sal_Int32 nType, - const ::rtl::OUString & rIdentifier, - ::sal_Int32 nStart, - ::sal_Int32 nLength, - const uno::Reference< container::XStringKeyMap > & xMarkupInfoContainer) +void SAL_CALL SwXTextMarkup::commitTextMarkup( + ::sal_Int32 nType, + const ::rtl::OUString & rIdentifier, + ::sal_Int32 nStart, + ::sal_Int32 nLength, + const uno::Reference< container::XStringKeyMap > & xMarkupInfoContainer) throw (uno::RuntimeException) { SolarMutexGuard aGuard; @@ -94,7 +94,7 @@ void SAL_CALL SwXTextMarkup::commitTextMarkup( pWList = new SwWrongList( WRONGLIST_SPELL ); mpTxtNode->SetWrong( pWList ); } - } + } else if ( nType == text::TextMarkupType::PROOFREADING || nType == text::TextMarkupType::SENTENCE ) { IGrammarContact *pGrammarContact = getGrammarContact( *mpTxtNode ); @@ -223,7 +223,7 @@ void SAL_CALL SwXTextMarkup::commitTextMarkup( if( nType == text::TextMarkupType::SENTENCE ) ((SwGrammarMarkUp*)pWList)->setSentence( static_cast< xub_StrLen >(nStart) ); else - pWList->Insert( rIdentifier, xMarkupInfoContainer, + pWList->Insert( rIdentifier, xMarkupInfoContainer, static_cast< xub_StrLen >(nStart), static_cast< xub_StrLen >(nLength) ); } @@ -232,14 +232,14 @@ void SAL_CALL SwXTextMarkup::commitTextMarkup( } -void lcl_commitGrammarMarkUp( +void lcl_commitGrammarMarkUp( const ModelToViewHelper::ConversionMap* pConversionMap, SwGrammarMarkUp* pWList, - ::sal_Int32 nType, - const ::rtl::OUString & rIdentifier, - ::sal_Int32 nStart, - ::sal_Int32 nLength, - const uno::Reference< container::XStringKeyMap > & xMarkupInfoContainer) + ::sal_Int32 nType, + const ::rtl::OUString & rIdentifier, + ::sal_Int32 nStart, + ::sal_Int32 nLength, + const uno::Reference< container::XStringKeyMap > & xMarkupInfoContainer) { OSL_ENSURE( nType == text::TextMarkupType::PROOFREADING || nType == text::TextMarkupType::SENTENCE, "Wrong mark-up type" ); const ModelToViewHelper::ModelPosition aStartPos = @@ -322,14 +322,14 @@ void lcl_commitGrammarMarkUp( if( nType == text::TextMarkupType::SENTENCE ) ((SwGrammarMarkUp*)pWList)->setSentence( static_cast< xub_StrLen >(nStart+nLength) ); else - pWList->Insert( rIdentifier, xMarkupInfoContainer, + pWList->Insert( rIdentifier, xMarkupInfoContainer, static_cast< xub_StrLen >(nStart), static_cast< xub_StrLen >(nLength) ); } } void SAL_CALL SwXTextMarkup::commitMultiTextMarkup( - const uno::Sequence< text::TextMarkupDescriptor > &rMarkups ) + const uno::Sequence< text::TextMarkupDescriptor > &rMarkups ) throw (lang::IllegalArgumentException, uno::RuntimeException) { SolarMutexGuard aGuard; @@ -358,11 +358,11 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) nSentenceMarkUpIndex = i; else // there is already one sentence markup throw lang::IllegalArgumentException(); - } + } else if( pMarkups[i].nType != text::TextMarkupType::PROOFREADING ) return; } - + if( nSentenceMarkUpIndex == -1 ) return; @@ -391,18 +391,18 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) if( pWList->GetBeginInv() < STRING_LEN ) { const ModelToViewHelper::ModelPosition aSentenceEnd = - ModelToViewHelper::ConvertToModelPosition( mpConversionMap, + ModelToViewHelper::ConvertToModelPosition( mpConversionMap, pMarkups[nSentenceMarkUpIndex].nOffset + pMarkups[nSentenceMarkUpIndex].nLength ); bAcceptGrammarError = (xub_StrLen)aSentenceEnd.mnPos > pWList->GetBeginInv(); pWList->ClearGrammarList( (xub_StrLen)aSentenceEnd.mnPos ); } - + if( bAcceptGrammarError ) { for( i = 0; i < nLen; ++i ) { const text::TextMarkupDescriptor &rDesc = pMarkups[i]; - lcl_commitGrammarMarkUp( mpConversionMap, pWList, rDesc.nType, + lcl_commitGrammarMarkUp( mpConversionMap, pWList, rDesc.nType, rDesc.aIdentifier, rDesc.nOffset, rDesc.nLength, rDesc.xMarkupInfoContainer ); } } @@ -411,7 +411,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) bRepaint = false; i = nSentenceMarkUpIndex; const text::TextMarkupDescriptor &rDesc = pMarkups[i]; - lcl_commitGrammarMarkUp( mpConversionMap, pWList, rDesc.nType, + lcl_commitGrammarMarkUp( mpConversionMap, pWList, rDesc.nType, rDesc.aIdentifier, rDesc.nOffset, rDesc.nLength, rDesc.xMarkupInfoContainer ); } @@ -419,7 +419,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) finishGrammarCheck( *mpTxtNode ); return; -} +} void SwXTextMarkup::Modify( SfxPoolItem* /*pOld*/, SfxPoolItem* /*pNew*/ ) @@ -429,7 +429,7 @@ void SwXTextMarkup::Modify( SfxPoolItem* /*pOld*/, SfxPoolItem* /*pNew*/ ) if ( pRegisteredIn ) pRegisteredIn->Remove( this ); // <-- - + SolarMutexGuard aGuard; mpTxtNode = 0; } |