summaryrefslogtreecommitdiff
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-07 10:32:30 +0100
commitc52bead4d4da040f0e0ddce6a1396fe2d4d85861 (patch)
treececdeb511672b3b8b6f656c71bbf049c9590268a
parent154bec102a4c25d8b3168120eee513b265ef132d (diff)
sw_redlinehide_4a: finish conversions guess.cxx,itrcrsr.cxx,porfld.cxx
... and tests. Change-Id: I847a9441b73cdfc9bd826fad2c9075a9aa1d7d2d (cherry picked from commit 23b008ee75e22cbd3c2b08b7a7968dec22257791)
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx14
-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
6 files changed, 17 insertions, 16 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index fb399694ed9d..fa698b44450d 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -4178,7 +4178,7 @@ void SwUiWriterTest::testTdf87922()
SwNodeIndex aNodeIndex(pDoc->GetNodes().GetEndOfContent(), -1);
const OUString& rText = aNodeIndex.GetNode().GetTextNode()->GetText();
sal_Int32 nLength = rText.getLength();
- SwDrawTextInfo aDrawTextInfo(pWrtShell, *pWrtShell->GetOut(), pScriptInfo, rText, 0, nLength);
+ SwDrawTextInfo aDrawTextInfo(pWrtShell, *pWrtShell->GetOut(), pScriptInfo, rText, TextFrameIndex(0), TextFrameIndex(nLength));
// Root -> page -> body -> text.
SwTextFrame* pTextFrame = static_cast<SwTextFrame*>(pWrtShell->GetLayout()->GetLower()->GetLower()->GetLower());
aDrawTextInfo.SetFrame(pTextFrame);
@@ -4222,17 +4222,17 @@ class PortionHandler : public SwPortionHandler
mPortionItems.clear();
}
- virtual void Text(sal_Int32 nLength, sal_uInt16 nType,
+ virtual void Text(TextFrameIndex nLength, sal_uInt16 nType,
sal_Int32 /*nHeight*/, sal_Int32 /*nWidth*/) override
{
- mPortionItems.emplace_back("text", nLength, nType);
+ mPortionItems.emplace_back("text", sal_Int32(nLength), nType);
}
- virtual void Special(sal_Int32 nLength, const OUString & /*rText*/,
+ virtual void Special(TextFrameIndex nLength, const OUString & /*rText*/,
sal_uInt16 nType, sal_Int32 /*nHeight*/,
sal_Int32 /*nWidth*/, const SwFont* /*pFont*/) override
{
- mPortionItems.emplace_back("special", nLength, nType);
+ mPortionItems.emplace_back("special", sal_Int32(nLength), nType);
}
virtual void LineBreak(sal_Int32 /*nWidth*/) override
@@ -4240,9 +4240,9 @@ class PortionHandler : public SwPortionHandler
mPortionItems.emplace_back("line_break", 0, 0);
}
- virtual void Skip(sal_Int32 nLength) override
+ virtual void Skip(TextFrameIndex nLength) override
{
- mPortionItems.emplace_back("skip", nLength, 0);
+ mPortionItems.emplace_back("skip", sal_Int32(nLength), 0);
}
virtual void Finish() override
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 5eadc9aa808f..7838bede5947 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 565aef74d589..45a4f3025503 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;
}