diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2013-12-01 18:04:38 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2013-12-02 23:11:42 +0100 |
commit | 5170b4e49afd113567d4bbdd8f7b6be9eaa66888 (patch) | |
tree | d2a2c7f68903f3b5eb6617356deeffa852bc046c /sw | |
parent | e40fd5b9f1a544aa3d1f8a254682d403c4ce4b7c (diff) |
Move functions to right file, prefer sal_Int32 to sal_uInt32 as index
Change-Id: Ie5dca349acf2e163fdb6a47b0ba7af27220f2b2d
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/modeltoviewhelper.hxx | 12 | ||||
-rw-r--r-- | sw/source/core/doc/docedt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/txtnode/modeltoviewhelper.cxx | 183 | ||||
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 136 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/unocore/unotextmarkup.cxx | 12 |
7 files changed, 185 insertions, 180 deletions
diff --git a/sw/inc/modeltoviewhelper.hxx b/sw/inc/modeltoviewhelper.hxx index b22262bad05a..d67110a9157d 100644 --- a/sw/inc/modeltoviewhelper.hxx +++ b/sw/inc/modeltoviewhelper.hxx @@ -74,7 +74,7 @@ class ModelToViewHelper position in the view string. The last entry in the conversion map denotes the lengths of the model resp. view string. */ - typedef std::pair< sal_uInt32 , sal_uInt32 > ConversionMapEntry; + typedef std::pair< sal_Int32 , sal_Int32 > ConversionMapEntry; typedef std::vector< ConversionMapEntry > ConversionMap; ConversionMap m_aMap; @@ -91,14 +91,14 @@ public: */ struct ModelPosition { - sal_uInt32 mnPos; - sal_uInt32 mnSubPos; + sal_Int32 mnPos; + sal_Int32 mnSubPos; bool mbIsField; ModelPosition() : mnPos(0), mnSubPos(0), mbIsField(false) {} }; - ModelToViewHelper(const SwTxtNode &rNode, int eMode = EXPANDFIELDS); + ModelToViewHelper(const SwTxtNode &rNode, sal_uInt16 eMode = EXPANDFIELDS); ModelToViewHelper() //pass through filter, view == model { } @@ -116,7 +116,7 @@ public: nPos is behind the last entry in the conversion map) nPos will be returned. */ - sal_uInt32 ConvertToViewPosition( sal_uInt32 nModelPos ) const; + sal_Int32 ConvertToViewPosition( sal_Int32 nModelPos ) const; /** Converts a view position into a model position @@ -131,7 +131,7 @@ public: model position with mnPos = nPos and mnIsField = false will be returned. */ - ModelPosition ConvertToModelPosition( sal_uInt32 nViewPos ) const; + ModelPosition ConvertToModelPosition( sal_Int32 nViewPos ) const; OUString getViewText() const { return m_aRetText; } }; diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 35d62913382e..79fbd4390bd0 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -1799,8 +1799,8 @@ static void lcl_syncGrammarError( SwTxtNode &rTxtNode, linguistic2::Proofreading for( i = 0; i < rResult.aErrors.getLength(); ++i ) { const linguistic2::SingleProofreadingError &rError = rResult.aErrors[i]; - xub_StrLen nStart = (xub_StrLen)rConversionMap.ConvertToModelPosition( rError.nErrorStart ).mnPos; - xub_StrLen nEnd = (xub_StrLen)rConversionMap.ConvertToModelPosition( rError.nErrorStart + rError.nErrorLength ).mnPos; + const sal_Int32 nStart = rConversionMap.ConvertToModelPosition( rError.nErrorStart ).mnPos; + const sal_Int32 nEnd = rConversionMap.ConvertToModelPosition( rError.nErrorStart + rError.nErrorLength ).mnPos; if( i != j ) pArray[j] = pArray[i]; if( pWrong->LookForEntry( nStart, nEnd ) ) diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index c9f9b5643742..93d036f39dea 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -1427,8 +1427,8 @@ bool SwSpellIter::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammar { const ModelToViewHelper aConversionMap(*(SwTxtNode*)pCrsr->GetNode()); OUString aExpandText = aConversionMap.getViewText(); - sal_Int32 nSentenceEnd = static_cast<sal_Int32>( - aConversionMap.ConvertToViewPosition( aGrammarResult.nBehindEndOfSentencePosition )); + sal_Int32 nSentenceEnd = + aConversionMap.ConvertToViewPosition( aGrammarResult.nBehindEndOfSentencePosition ); // remove trailing space if( aExpandText[nSentenceEnd - 1] == ' ' ) --nSentenceEnd; diff --git a/sw/source/core/txtnode/modeltoviewhelper.cxx b/sw/source/core/txtnode/modeltoviewhelper.cxx index 861583dab70b..db370489943b 100644 --- a/sw/source/core/txtnode/modeltoviewhelper.cxx +++ b/sw/source/core/txtnode/modeltoviewhelper.cxx @@ -18,35 +18,178 @@ */ #include <modeltoviewhelper.hxx> +#include <fldbas.hxx> +#include <fmtfld.hxx> +#include <fmtftn.hxx> +#include <ndtxt.hxx> +#include <txatbase.hxx> +#include <txtfld.hxx> +#include <txtftn.hxx> + +#include <tools/multisel.hxx> + +#include <scriptinfo.hxx> + +struct block +{ + sal_Int32 m_nStart; + sal_Int32 m_nLen; + bool m_bVisible; + std::vector<const SwTxtAttr*> m_aAttrs; + block(sal_Int32 nStart, sal_Int32 nLen, bool bVisible) + : m_nStart(nStart), m_nLen(nLen), m_bVisible(bVisible) + { + } +}; + +struct containsPos +{ + const sal_Int32 m_nPos; + containsPos(const sal_Int32 nPos) + : m_nPos(nPos) + { + } + bool operator() (const block& rIn) const + { + return m_nPos >= rIn.m_nStart && m_nPos < rIn.m_nStart + rIn.m_nLen; + } +}; + +ModelToViewHelper::ModelToViewHelper(const SwTxtNode &rNode, sal_uInt16 eMode) +{ + const OUString& rNodeText = rNode.GetTxt(); + m_aRetText = rNodeText; + + if (eMode == PASSTHROUGH) + return; + + Range aRange( 0, rNodeText.isEmpty() ? 0 : rNodeText.getLength() - 1); + MultiSelection aHiddenMulti(aRange); + + if (eMode & HIDEINVISIBLE) + SwScriptInfo::selectHiddenTextProperty(rNode, aHiddenMulti); + + if (eMode & HIDEREDLINED) + SwScriptInfo::selectRedLineDeleted(rNode, aHiddenMulti); + + std::vector<block> aBlocks; + + sal_Int32 nShownStart = 0; + for (size_t i = 0; i < aHiddenMulti.GetRangeCount(); ++i) + { + const Range& rRange = aHiddenMulti.GetRange(i); + const sal_Int32 nHiddenStart = rRange.Min(); + const sal_Int32 nHiddenEnd = rRange.Max() + 1; + const sal_Int32 nHiddenLen = nHiddenEnd - nHiddenStart; + + const sal_Int32 nShownEnd = nHiddenStart; + const sal_Int32 nShownLen = nShownEnd - nShownStart; + + if (nShownLen) + aBlocks.push_back(block(nShownStart, nShownLen, true)); + + if (nHiddenLen) + aBlocks.push_back(block(nHiddenStart, nHiddenLen, false)); + + nShownStart = nHiddenEnd; + } + + sal_Int32 nTrailingShownLen = rNodeText.getLength() - nShownStart; + if (nTrailingShownLen) + aBlocks.push_back(block(nShownStart, nTrailingShownLen, true)); + + if (eMode & EXPANDFIELDS) + { + const SwpHints* pSwpHints2 = rNode.GetpSwpHints(); + for ( sal_uInt16 i = 0; pSwpHints2 && i < pSwpHints2->Count(); ++i ) + { + const SwTxtAttr* pAttr = (*pSwpHints2)[i]; + if (pAttr->HasDummyChar()) + { + const sal_Int32 nDummyCharPos = *pAttr->GetStart(); + if (aHiddenMulti.IsSelected(nDummyCharPos)) + continue; + std::vector<block>::iterator aFind = std::find_if(aBlocks.begin(), aBlocks.end(), containsPos(nDummyCharPos)); + if (aFind != aBlocks.end()) + { + aFind->m_aAttrs.push_back(pAttr); + } + } + } + } + + sal_Int32 nOffset = 0; + for (std::vector<block>::iterator i = aBlocks.begin(); i != aBlocks.end(); ++i) + { + if (!i->m_bVisible) + { + const sal_Int32 nHiddenStart = i->m_nStart; + const sal_Int32 nHiddenLen = i->m_nLen; + + m_aRetText = m_aRetText.replaceAt( nOffset + nHiddenStart, nHiddenLen, OUString() ); + m_aMap.push_back( ConversionMapEntry( nHiddenStart, nOffset + nHiddenStart ) ); + nOffset -= nHiddenLen; + } + else + { + for (std::vector<const SwTxtAttr*>::iterator j = i->m_aAttrs.begin(); j != i->m_aAttrs.end(); ++j) + { + const SwTxtAttr* pAttr = *j; + const sal_Int32 nFieldPos = *pAttr->GetStart(); + OUString aExpand; + switch (pAttr->Which()) + { + case RES_TXTATR_FIELD: + aExpand = + static_cast<SwTxtFld const*>(pAttr)->GetFmtFld().GetField() + ->ExpandField(true); + break; + case RES_TXTATR_FTN: + { + const SwFmtFtn& rFtn = static_cast<SwTxtFtn const*>(pAttr)->GetFtn(); + const SwDoc *pDoc = rNode.GetDoc(); + aExpand = rFtn.GetViewNumStr(*pDoc); + } + break; + default: + break; + } + m_aRetText = m_aRetText.replaceAt( nOffset + nFieldPos, 1, aExpand ); + m_aMap.push_back( ConversionMapEntry( nFieldPos, nOffset + nFieldPos ) ); + nOffset += aExpand.getLength() - 1; + } + } + } + + if ( !m_aMap.empty() ) + m_aMap.push_back( ConversionMapEntry( rNodeText.getLength()+1, m_aRetText.getLength()+1 ) ); +} /** Converts a model position into a view position */ -sal_uInt32 ModelToViewHelper::ConvertToViewPosition( sal_uInt32 nModelPos ) const +sal_Int32 ModelToViewHelper::ConvertToViewPosition( sal_Int32 nModelPos ) const { - sal_uInt32 nRet = nModelPos; - // Search for entry after nPos: ConversionMap::const_iterator aIter; for ( aIter = m_aMap.begin(); aIter != m_aMap.end(); ++aIter ) { if ( (*aIter).first >= nModelPos ) { - const sal_uInt32 nPosModel = (*aIter).first; - const sal_uInt32 nPosExpand = (*aIter).second; + const sal_Int32 nPosModel = (*aIter).first; + const sal_Int32 nPosExpand = (*aIter).second; - const sal_uInt32 nDistToNextModel = nPosModel - nModelPos; - nRet = nPosExpand - nDistToNextModel; - break; + const sal_Int32 nDistToNextModel = nPosModel - nModelPos; + return nPosExpand - nDistToNextModel; } } - return nRet; + return nModelPos; } /** Converts a view position into a model position */ -ModelToViewHelper::ModelPosition ModelToViewHelper::ConvertToModelPosition( sal_uInt32 nViewPos ) const +ModelToViewHelper::ModelPosition ModelToViewHelper::ConvertToModelPosition( sal_Int32 nViewPos ) const { ModelPosition aRet; aRet.mnPos = nViewPos; @@ -57,8 +200,8 @@ ModelToViewHelper::ModelPosition ModelToViewHelper::ConvertToModelPosition( sal_ { if ( (*aIter).second > nViewPos ) { - const sal_uInt32 nPosModel = (*aIter).first; - const sal_uInt32 nPosExpand = (*aIter).second; + const sal_Int32 nPosModel = (*aIter).first; + const sal_Int32 nPosExpand = (*aIter).second; // If nViewPos is in front of first field, we are finished. if ( aIter == m_aMap.begin() ) @@ -67,21 +210,21 @@ ModelToViewHelper::ModelPosition ModelToViewHelper::ConvertToModelPosition( sal_ --aIter; // nPrevPosModel is the field position - const sal_uInt32 nPrevPosModel = (*aIter).first; - const sal_uInt32 nPrevPosExpand = (*aIter).second; + const sal_Int32 nPrevPosModel = (*aIter).first; + const sal_Int32 nPrevPosExpand = (*aIter).second; - const sal_uInt32 nLengthModel = nPosModel - nPrevPosModel; - const sal_uInt32 nLengthExpand = nPosExpand - nPrevPosExpand; + const sal_Int32 nLengthModel = nPosModel - nPrevPosModel; + const sal_Int32 nLengthExpand = nPosExpand - nPrevPosExpand; - const sal_uInt32 nFieldLengthExpand = nLengthExpand - nLengthModel + 1; - const sal_uInt32 nFieldEndExpand = nPrevPosExpand + nFieldLengthExpand; + const sal_Int32 nFieldLengthExpand = nLengthExpand - nLengthModel + 1; + const sal_Int32 nFieldEndExpand = nPrevPosExpand + nFieldLengthExpand; // Check if nPos is outside of field: if ( nFieldEndExpand <= nViewPos ) { // nPos is outside of field: - const sal_uInt32 nDistToField = nViewPos - nFieldEndExpand + 1; - aRet.mnPos = nPrevPosModel + nDistToField; + const sal_Int32 nDistToField = nViewPos - nFieldEndExpand + 1; + aRet.mnPos = nPrevPosModel + nDistToField; } else { diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index cc2b5de49059..8f1a89299a17 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -29,7 +29,6 @@ #include <editeng/tstpitem.hxx> #include <svl/urihelper.hxx> #include <svl/ctloptions.hxx> -#include <tools/multisel.hxx> #include <swmodule.hxx> #include <txtfld.hxx> #include <txtinet.hxx> @@ -3309,141 +3308,6 @@ bool SwTxtNode::GetExpandTxt( SwTxtNode& rDestNd, const SwIndex* pDestIdx, return true; } -struct block -{ - sal_Int32 m_nStart; - sal_Int32 m_nLen; - bool m_bVisible; - std::vector<const SwTxtAttr*> m_aAttrs; - block(sal_Int32 nStart, sal_Int32 nLen, bool bVisible) - : m_nStart(nStart), m_nLen(nLen), m_bVisible(bVisible) - { - } -}; - -struct containsPos -{ - const sal_Int32 m_nPos; - containsPos(const sal_Int32 nPos) - : m_nPos(nPos) - { - } - bool operator() (const block& rIn) const - { - return m_nPos >= rIn.m_nStart && m_nPos < rIn.m_nStart + rIn.m_nLen; - } -}; - -ModelToViewHelper::ModelToViewHelper(const SwTxtNode &rNode, int eMode) -{ - const OUString& rNodeText = rNode.GetTxt(); - m_aRetText = rNodeText; - - if (eMode == PASSTHROUGH) - return; - - Range aRange( 0, rNodeText.isEmpty() ? 0 : rNodeText.getLength() - 1); - MultiSelection aHiddenMulti(aRange); - - if (eMode & HIDEINVISIBLE) - SwScriptInfo::selectHiddenTextProperty(rNode, aHiddenMulti); - - if (eMode & HIDEREDLINED) - SwScriptInfo::selectRedLineDeleted(rNode, aHiddenMulti); - - std::vector<block> aBlocks; - - sal_Int32 nShownStart = 0; - for (size_t i = 0; i < aHiddenMulti.GetRangeCount(); ++i) - { - const Range& rRange = aHiddenMulti.GetRange(i); - sal_Int32 nHiddenStart = rRange.Min(); - sal_Int32 nHiddenEnd = rRange.Max() + 1; - sal_Int32 nHiddenLen = nHiddenEnd - nHiddenStart; - - sal_Int32 nShownEnd = nHiddenStart; - sal_Int32 nShownLen = nShownEnd - nShownStart; - - if (nShownLen) - aBlocks.push_back(block(nShownStart, nShownLen, true)); - - if (nHiddenLen) - aBlocks.push_back(block(nHiddenStart, nHiddenLen, false)); - - nShownStart = nHiddenEnd; - } - - sal_Int32 nTrailingShownLen = rNodeText.getLength() - nShownStart; - if (nTrailingShownLen) - aBlocks.push_back(block(nShownStart, nTrailingShownLen, true)); - - if (eMode & EXPANDFIELDS) - { - const SwpHints* pSwpHints2 = rNode.GetpSwpHints(); - for ( sal_uInt16 i = 0; pSwpHints2 && i < pSwpHints2->Count(); ++i ) - { - const SwTxtAttr* pAttr = (*pSwpHints2)[i]; - if (pAttr->HasDummyChar()) - { - const sal_Int32 nDummyCharPos = *pAttr->GetStart(); - if (aHiddenMulti.IsSelected(nDummyCharPos)) - continue; - std::vector<block>::iterator aFind = std::find_if(aBlocks.begin(), aBlocks.end(), containsPos(nDummyCharPos)); - if (aFind != aBlocks.end()) - { - aFind->m_aAttrs.push_back(pAttr); - } - } - } - } - - sal_Int32 nOffset = 0; - for (std::vector<block>::iterator i = aBlocks.begin(); i != aBlocks.end(); ++i) - { - if (!i->m_bVisible) - { - const sal_Int32 nHiddenStart = i->m_nStart; - const sal_Int32 nHiddenLen = i->m_nLen; - - m_aRetText = m_aRetText.replaceAt( nOffset + nHiddenStart, nHiddenLen, OUString() ); - m_aMap.push_back( ConversionMapEntry( nHiddenStart, nOffset + nHiddenStart ) ); - nOffset -= nHiddenLen; - } - else - { - for (std::vector<const SwTxtAttr*>::iterator j = i->m_aAttrs.begin(); j != i->m_aAttrs.end(); ++j) - { - const SwTxtAttr* pAttr = *j; - const sal_Int32 nFieldPos = *pAttr->GetStart(); - OUString aExpand; - switch (pAttr->Which()) - { - case RES_TXTATR_FIELD: - aExpand = - static_cast<SwTxtFld const*>(pAttr)->GetFmtFld().GetField() - ->ExpandField(true); - break; - case RES_TXTATR_FTN: - { - const SwFmtFtn& rFtn = static_cast<SwTxtFtn const*>(pAttr)->GetFtn(); - const SwDoc *pDoc = rNode.GetDoc(); - aExpand = rFtn.GetViewNumStr(*pDoc); - } - break; - default: - break; - } - m_aRetText = m_aRetText.replaceAt( nOffset + nFieldPos, 1, aExpand ); - m_aMap.push_back( ConversionMapEntry( nFieldPos, nOffset + nFieldPos ) ); - nOffset += ( aExpand.getLength() - 1 ); - } - } - } - - if ( !m_aMap.empty() ) - m_aMap.push_back( ConversionMapEntry( rNodeText.getLength()+1, m_aRetText.getLength()+1 ) ); -} - OUString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, xub_StrLen nLen, sal_Bool bExpandFlds, sal_Bool bWithNum ) const { diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index e1eb5c3378e9..4a31aef47c5e 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -741,8 +741,7 @@ SwScanner::SwScanner( const SwTxtNode& rNd, const OUString& rTxt, else { ModelToViewHelper::ModelPosition aModelBeginPos = rConversionMap.ConvertToModelPosition( nBegin ); - const sal_Int32 nModelBeginPos = aModelBeginPos.mnPos; - aCurrLang = rNd.GetLang( nModelBeginPos ); + aCurrLang = rNd.GetLang( aModelBeginPos.mnPos ); } } @@ -803,8 +802,7 @@ sal_Bool SwScanner::NextWord() { const sal_uInt16 nNextScriptType = g_pBreakIt->GetBreakIter()->getScriptType( aText, nBegin ); ModelToViewHelper::ModelPosition aModelBeginPos = rConversionMap.ConvertToModelPosition( nBegin ); - const sal_Int32 nBeginModelPos = aModelBeginPos.mnPos; - aCurrLang = rNode.GetLang( nBeginModelPos, 1, nNextScriptType ); + aCurrLang = rNode.GetLang( aModelBeginPos.mnPos, 1, nNextScriptType ); } if ( nWordType != i18n::WordType::WORD_COUNT ) @@ -1480,8 +1478,8 @@ SwRect SwTxtFrm::SmartTagScan( SwCntntNode* /*pActNode*/, xub_StrLen /*nActPos*/ const com::sun::star::lang::Locale aLocale = g_pBreakIt->GetLocale( nLang ); nLangEnd = std::min( nEnd, aIter.GetChgPos() ); - const sal_uInt32 nExpandBegin = aConversionMap.ConvertToViewPosition( nLangBegin ); - const sal_uInt32 nExpandEnd = aConversionMap.ConvertToViewPosition( nLangEnd ); + const sal_Int32 nExpandBegin = aConversionMap.ConvertToViewPosition( nLangBegin ); + const sal_Int32 nExpandEnd = aConversionMap.ConvertToViewPosition( nLangEnd ); rSmartTagMgr.RecognizeString(aExpandText, xTextMarkup, xController, aLocale, nExpandBegin, nExpandEnd - nExpandBegin ); @@ -1983,8 +1981,8 @@ bool SwTxtNode::CountWords( SwDocStat& rStat, OUString aExpandText = aConversionMap.getViewText(); // map start and end points onto the ConversionMap - const sal_uInt32 nExpandBegin = aConversionMap.ConvertToViewPosition( nStt ); - const sal_uInt32 nExpandEnd = aConversionMap.ConvertToViewPosition( nEnd ); + const sal_Int32 nExpandBegin = aConversionMap.ConvertToViewPosition( nStt ); + const sal_Int32 nExpandEnd = aConversionMap.ConvertToViewPosition( nEnd ); if (aExpandText.isEmpty() && !bCountNumbering) { diff --git a/sw/source/core/unocore/unotextmarkup.cxx b/sw/source/core/unocore/unotextmarkup.cxx index 8976a65784b0..dc7b04be3a35 100644 --- a/sw/source/core/unocore/unotextmarkup.cxx +++ b/sw/source/core/unocore/unotextmarkup.cxx @@ -225,8 +225,8 @@ void SAL_CALL SwXTextMarkup::commitStringMarkup( pSubList = new SwGrammarMarkUp(); pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList ); } - const sal_uInt32 nTmpStart = maConversionMap.ConvertToViewPosition( aStartPos.mnPos ); - const sal_uInt32 nTmpLen = maConversionMap.ConvertToViewPosition( aStartPos.mnPos + 1 ) + const sal_Int32 nTmpStart = maConversionMap.ConvertToViewPosition( aStartPos.mnPos ); + const sal_Int32 nTmpLen = maConversionMap.ConvertToViewPosition( aStartPos.mnPos + 1 ) - nTmpStart - aStartPos.mnSubPos; if( nTmpLen > 0 ) { @@ -251,7 +251,7 @@ void SAL_CALL SwXTextMarkup::commitStringMarkup( pSubList = new SwGrammarMarkUp(); pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList ); } - const sal_uInt32 nTmpLen = aEndPos.mnSubPos + 1; + const sal_Int32 nTmpLen = aEndPos.mnSubPos + 1; pSubList->Insert( rIdentifier, xMarkupInfoContainer, 0, static_cast< xub_StrLen >(nTmpLen) ); } else @@ -332,8 +332,8 @@ static void lcl_commitGrammarMarkUp( pSubList = new SwGrammarMarkUp(); pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList ); } - const sal_uInt32 nTmpStart = rConversionMap.ConvertToViewPosition( aStartPos.mnPos ); - const sal_uInt32 nTmpLen = rConversionMap.ConvertToViewPosition( aStartPos.mnPos + 1 ) + const sal_Int32 nTmpStart = rConversionMap.ConvertToViewPosition( aStartPos.mnPos ); + const sal_Int32 nTmpLen = rConversionMap.ConvertToViewPosition( aStartPos.mnPos + 1 ) - nTmpStart - aStartPos.mnSubPos; if( nTmpLen > 0 ) pSubList->Insert( rIdentifier, xMarkupInfoContainer, @@ -350,7 +350,7 @@ static void lcl_commitGrammarMarkUp( pSubList = new SwGrammarMarkUp(); pWList->InsertSubList( nFieldPosModel, 1, nInsertPos, pSubList ); } - const sal_uInt32 nTmpLen = aEndPos.mnSubPos + 1; + const sal_Int32 nTmpLen = aEndPos.mnSubPos + 1; pSubList->Insert( rIdentifier, xMarkupInfoContainer, 0, static_cast< xub_StrLen >(nTmpLen) ); } else |