summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-11-21 16:53:30 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2018-12-01 08:43:01 +0100
commit61368264f1156250c4fd14088954930daa9840ad (patch)
treecdab45c06f5a7400652da8b9a499fa4d96b11b15 /sw/source
parent949fd0a9abb57c48b75e6fbb4c14b84e0e084160 (diff)
sw_redlinehide_4a: finish conversions guess.cxx,itrcrsr.cxx,porfld.cxx
... and tests. Change-Id: I847a9441b73cdfc9bd826fad2c9075a9aa1d7d2d
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/text/guess.cxx7
-rw-r--r--sw/source/core/text/itrcrsr.cxx2
-rw-r--r--sw/source/core/text/porfld.cxx2
-rw-r--r--sw/source/core/text/porlay.cxx2
-rw-r--r--sw/source/core/text/xmldump.cxx6
5 files changed, 10 insertions, 9 deletions
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index f24fdef51094..3d225c139105 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -156,7 +156,7 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf,
.getIDocumentSettingAccess().get(DocumentSettingId::UNBREAKABLE_NUMBERINGS);
// first check if everything fits to line
- if ( ( nLineWidth * 2 > SwTwips(nMaxLen) * nPorHeight ) ||
+ if ( ( nLineWidth * 2 > SwTwips(sal_Int32(nMaxLen)) * nPorHeight ) ||
( bUnbreakableNumberings && rPor.IsNumberPortion() ) )
{
// call GetTextSize with maximum compression (for kanas)
@@ -314,8 +314,9 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf,
aDebugString = rInf.GetText();
#endif
+ // this is pretty nutso... reverted at the end...
OUString& rOldText = const_cast<OUString&> (rInf.GetText());
- rOldText = rOldText.replaceAt( rInf.GetIdx() - 1, 1, aText );
+ rOldText = rOldText.replaceAt(sal_Int32(rInf.GetIdx()) - 1, 1, aText);
rInf.SetIdx( rInf.GetIdx() + nFieldDiff );
}
else
@@ -518,7 +519,7 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf,
OUString& rOldText = const_cast<OUString&> (rInf.GetText());
OUString aReplacement( cFieldChr );
- rOldText = rOldText.replaceAt( nOldIdx - 1, nFieldDiff + 1, aReplacement);
+ rOldText = rOldText.replaceAt(sal_Int32(nOldIdx) - 1, sal_Int32(nFieldDiff) + 1, aReplacement);
rInf.SetIdx( nOldIdx );
#if OSL_DEBUG_LEVEL > 0
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index eeca36566455..1aa6a311fc6d 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1670,7 +1670,7 @@ TextFrameIndex SwTextCursor::GetCursorOfst( SwPosition *pPos, const Point &rPoin
// get position inside field portion?
if ( pPor->InFieldGrp() && pCMS && pCMS->m_pSpecialPos )
{
- pCMS->m_pSpecialPos->nCharOfst = nLength;
+ pCMS->m_pSpecialPos->nCharOfst = sal_Int32(nLength);
nLength = TextFrameIndex(0);
}
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index 4027834b7a98..be4bf770dd59 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -171,7 +171,7 @@ SwFieldSlot::SwFieldSlot( const SwTextFormatInfo* pNew, const SwFieldPortion *pP
pInf->SetFakeLineStart( nIdx > pInf->GetLineStart() );
pInf->SetIdx(TextFrameIndex(0));
}
- else if(nIdx < pOldText->getLength())
+ else if (nIdx < TextFrameIndex(pOldText->getLength()))
{
aText = (*pOldText).replaceAt(sal_Int32(nIdx), 1, aText);
}
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index c309f6c3fe1d..02900e9e5d79 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1476,7 +1476,7 @@ sal_uInt8 SwScriptInfo::DirType(const TextFrameIndex nPos) const
TextFrameIndex SwScriptInfo::NextHiddenChg(TextFrameIndex const nPos) const
{
- for (auto const it : m_HiddenChg)
+ for (auto const& it : m_HiddenChg)
{
if (nPos < it)
{
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 90d73c75dab5..b17078e195d7 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -125,7 +125,7 @@ class XmlPortionDumper:public SwPortionHandler
xmlTextWriterStartElement( writer, BAD_CAST( "Text" ) );
xmlTextWriterWriteFormatAttribute( writer,
BAD_CAST( "nLength" ),
- "%i", static_cast<int>(nLength) );
+ "%i", static_cast<int>(static_cast<sal_Int32>(nLength)) );
xmlTextWriterWriteFormatAttribute( writer,
BAD_CAST( "nType" ),
"%s", getTypeName( nType ) );
@@ -162,7 +162,7 @@ class XmlPortionDumper:public SwPortionHandler
xmlTextWriterStartElement( writer, BAD_CAST( "Special" ) );
xmlTextWriterWriteFormatAttribute( writer,
BAD_CAST( "nLength" ),
- "%i", static_cast<int>(nLength) );
+ "%i", static_cast<int>(static_cast<sal_Int32>(nLength)) );
xmlTextWriterWriteFormatAttribute( writer,
BAD_CAST( "nType" ),
"%s", getTypeName( nType ) );
@@ -209,7 +209,7 @@ class XmlPortionDumper:public SwPortionHandler
xmlTextWriterStartElement( writer, BAD_CAST( "Skip" ) );
xmlTextWriterWriteFormatAttribute( writer,
BAD_CAST( "nLength" ),
- "%i", static_cast<int>(nLength) );
+ "%i", static_cast<int>(static_cast<sal_Int32>(nLength)) );
xmlTextWriterEndElement( writer );
ofs += nLength;
}