summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-02-18 18:36:45 +0100
committerMichael Stahl <mstahl@redhat.com>2013-02-18 20:16:07 +0100
commit0295c8a34e39326414c1b98cf4da905802f061b0 (patch)
tree0595896589edc155fae7775fe586403c59842379 /sw/source/filter
parent24eae2b75c201292990122e69954072f36b6f218 (diff)
sw: let SwTxtNode::GetTxt() return OUString
Change-Id: I36e777b2f623429773277e092284f7d2ba61e6ef
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/ascii/wrtasc.cxx3
-rw-r--r--sw/source/filter/html/htmlfld.cxx2
-rw-r--r--sw/source/filter/html/htmlgrin.cxx2
-rw-r--r--sw/source/filter/html/htmltab.cxx6
-rw-r--r--sw/source/filter/html/swhtml.cxx10
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx4
-rw-r--r--sw/source/filter/ww1/fltshell.cxx5
-rw-r--r--sw/source/filter/ww8/ww8par.cxx15
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx8
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx4
-rw-r--r--sw/source/filter/xml/xmlimp.cxx10
-rw-r--r--sw/source/filter/xml/xmltbli.cxx3
12 files changed, 37 insertions, 35 deletions
diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx
index 3f6847a57be0..42a0b21f8620 100644
--- a/sw/source/filter/ascii/wrtasc.cxx
+++ b/sw/source/filter/ascii/wrtasc.cxx
@@ -131,8 +131,7 @@ sal_uLong SwASCWriter::WriteStream()
// Should we have frames only?
// That's possible, if we put a frame selection into the clipboard
if( bTstFly && bWriteAll &&
- // No length
- !pNd->GetTxt().Len() &&
+ pNd->GetTxt().isEmpty() &&
// Frame exists
pDoc->GetSpzFrmFmts()->size() &&
// Only one node in the array
diff --git a/sw/source/filter/html/htmlfld.cxx b/sw/source/filter/html/htmlfld.cxx
index 53bf7e94c85b..3213bfc30517 100644
--- a/sw/source/filter/html/htmlfld.cxx
+++ b/sw/source/filter/html/htmlfld.cxx
@@ -619,7 +619,7 @@ void SwHTMLParser::InsertComment( const String& rComment, const sal_Char *pTag )
xub_StrLen nPos = pPam->GetPoint()->nContent.GetIndex();
SwTxtNode *pTxtNd = pPam->GetNode()->GetTxtNode();
sal_Bool bMoveFwd = sal_False;
- if( nPos>0 && pTxtNd && ' '==pTxtNd->GetTxt().GetChar(nPos-1) )
+ if (nPos>0 && pTxtNd && (' ' == pTxtNd->GetTxt()[nPos-1]))
{
bMoveFwd = sal_True;
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 41e740f014ab..636f626e3e84 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -1396,7 +1396,7 @@ void SwHTMLParser::StripTrailingPara()
{
--nPos;
bSetSmallFont =
- (CH_TXTATR_BREAKWORD == pTxtNd->GetTxt().GetChar( nPos )) &&
+ (CH_TXTATR_BREAKWORD == pTxtNd->GetTxt()[nPos]) &&
(0 != pTxtNd->GetTxtAttrForCharAt( nPos, RES_TXTATR_FLYCNT ));
}
}
diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx
index 9097bd9b32d2..b0b96f240461 100644
--- a/sw/source/filter/html/htmltab.cxx
+++ b/sw/source/filter/html/htmltab.cxx
@@ -2951,7 +2951,7 @@ xub_StrLen SwHTMLParser::StripTrailingLF()
{
xub_StrLen nPos = nLen;
xub_StrLen nLFCount = 0;
- while( nPos && '\x0a' == (pTxtNd->GetTxt()).GetChar(--nPos) )
+ while (nPos && ('\x0a' == pTxtNd->GetTxt()[--nPos]))
nLFCount++;
if( nLFCount )
@@ -3426,8 +3426,8 @@ void _CellSaveStruct::CheckNoBreak( const SwPosition& rPos, SwDoc * /*pDoc*/ )
SwTxtNode const*const pTxtNd(rPos.nNode.GetNode().GetTxtNode());
if( pTxtNd )
{
- sal_Unicode cLast =
- pTxtNd->GetTxt().GetChar(nNoBreakEndCntntPos);
+ sal_Unicode const cLast =
+ pTxtNd->GetTxt()[nNoBreakEndCntntPos];
if( ' '==cLast || '\x0a'==cLast )
{
// Zwischem dem </NOBR> und dem Zellen-Ende gibt es nur
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index e15229d5d421..4322e9815752 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -696,7 +696,7 @@ void SwHTMLParser::Continue( int nToken )
SwNodeIndex aNxtIdx( *pSttNdIdx );
if( pTxtNode && pTxtNode->CanJoinNext( &aNxtIdx ))
{
- xub_StrLen nStt = pTxtNode->GetTxt().Len();
+ xub_StrLen nStt = pTxtNode->GetTxt().getLength();
// wenn der Cursor noch in dem Node steht, dann setze in an das Ende
if( pPam->GetPoint()->nNode == aNxtIdx )
{
@@ -715,18 +715,18 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( sal_True ).nNode.GetIndex() )
{
xub_StrLen nCntPos = pPam->GetBound( sal_True ).nContent.GetIndex();
pPam->GetBound( sal_True ).nContent.Assign( pTxtNode,
- pTxtNode->GetTxt().Len() + nCntPos );
+ pTxtNode->GetTxt().getLength() + nCntPos );
}
if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( sal_False ).nNode.GetIndex() )
{
xub_StrLen nCntPos = pPam->GetBound( sal_False ).nContent.GetIndex();
pPam->GetBound( sal_False ).nContent.Assign( pTxtNode,
- pTxtNode->GetTxt().Len() + nCntPos );
+ pTxtNode->GetTxt().getLength() + nCntPos );
}
#endif
// Zeichen Attribute beibehalten!
SwTxtNode* pDelNd = aNxtIdx.GetNode().GetTxtNode();
- if( pTxtNode->GetTxt().Len() )
+ if (pTxtNode->GetTxt().getLength())
pDelNd->FmtToTxtAttr( pTxtNode );
else
pTxtNode->ChgFmtColl( pDelNd->GetTxtColl() );
@@ -793,7 +793,7 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( sal_False ).nNode.GetIndex() )
pPam->SetMark(); pPam->DeleteMark();
pNextNd->JoinPrev();
}
- else if( !pAktNd->GetTxt().Len() )
+ else if (pAktNd->GetTxt().isEmpty())
{
pPos->nContent.Assign( 0, 0 );
pPam->SetMark(); pPam->DeleteMark();
diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx
index cae9fe2d25fd..ad43cc9879fb 100644
--- a/sw/source/filter/rtf/swparrtf.cxx
+++ b/sw/source/filter/rtf/swparrtf.cxx
@@ -120,13 +120,13 @@ sal_uLong SwRTFReader::Read( SwDoc &rDoc, const String& /*rBaseURL*/, SwPaM& rPa
{
aPam.GetPoint()->nNode = *pSttNdIdx;
aPam.GetPoint()->nContent.Assign( pTxtNode,
- pTxtNode->GetTxt().Len() );
+ pTxtNode->GetTxt().getLength() );
}
// If the first new node isn't empty, convert the node's text
// attributes into hints. Otherwise, set the new node's
// paragraph style at the previous (empty) node.
SwTxtNode* pDelNd = aNxtIdx.GetNode().GetTxtNode();
- if( pTxtNode->GetTxt().Len() )
+ if (pTxtNode->GetTxt().getLength())
pDelNd->FmtToTxtAttr( pTxtNode );
else
pTxtNode->ChgFmtColl( pDelNd->GetTxtColl() );
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index 13c997adc675..99b332de3bf2 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -951,10 +951,11 @@ SwFltShell::SwFltShell(SwDoc* pDoc, SwPaM& rPaM, const String& rBaseURL, sal_Boo
const SwPosition* pPos = pPaM->GetPoint();
const SwTxtNode* pSttNd = pPos->nNode.GetNode().GetTxtNode();
sal_uInt16 nCntPos = pPos->nContent.GetIndex();
- if( nCntPos && pSttNd->GetTxt().Len() )
+ if (nCntPos && !pSttNd->GetTxt().isEmpty())
// EinfuegePos nicht in leerer Zeile
pDoc->SplitNode( *pPos, false ); // neue Zeile erzeugen
- if( pSttNd->GetTxt().Len() ){ // EinfuegePos nicht am Ende der Zeile
+ if (!pSttNd->GetTxt().isEmpty())
+ { // InsertPos not on empty line
pDoc->SplitNode( *pPos, false ); // neue Zeile
pPaM->Move( fnMoveBackward ); // gehe in leere Zeile
}
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index d19e26052fac..9d3994fe308e 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2950,17 +2950,17 @@ void SwWW8ImplReader::simpleAddTextToParagraph(const String& rAddString)
if (!pNd)
return;
- if ((pNd->GetTxt().Len() + rAddString.Len()) < STRING_MAXLEN-1)
+ if ((pNd->GetTxt().getLength() + rAddString.Len()) < STRING_MAXLEN-1)
{
rDoc.InsertString(*pPaM, rAddString);
}
else
{
- if (pNd->GetTxt().Len()< STRING_MAXLEN -1)
+ if (pNd->GetTxt().getLength() < STRING_MAXLEN -1)
{
String sTempStr (rAddString,0,
- STRING_MAXLEN - pNd->GetTxt().Len() -1);
+ STRING_MAXLEN - pNd->GetTxt().getLength() -1);
rDoc.InsertString(*pPaM, sTempStr);
sTempStr = rAddString.Copy(sTempStr.Len(),
rAddString.Len() - sTempStr.Len());
@@ -3022,7 +3022,8 @@ bool SwWW8ImplReader::HandlePageBreakChar()
//xushanchuan add for issue106569
bool IsTemp=true;
SwTxtNode* pTemp = pPaM->GetNode()->GetTxtNode();
- if ( pTemp && !( pTemp->GetTxt().Len() ) && ( bFirstPara || bFirstParaOfPage ) )
+ if (pTemp && pTemp->GetTxt().isEmpty()
+ && (bFirstPara || bFirstParaOfPage))
{
IsTemp = false;
AppendTxtNode(*pPaM->GetPoint());
@@ -3479,7 +3480,7 @@ bool SwWW8ImplReader::ReadText(long nStartCp, long nTextLen, ManTypes nType)
if (pPreviousNode && bStartLine)
{
SwTxtNode* pEndNd = pPaM->GetNode()->GetTxtNode();
- const xub_StrLen nDropCapLen = pPreviousNode->GetTxt().Len();
+ const xub_StrLen nDropCapLen = pPreviousNode->GetTxt().getLength();
// Need to reset the font size and text position for the dropcap
{
@@ -4509,10 +4510,10 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss, const SwPosition &rPos)
sal_uInt16 nCntPos = pPos->nContent.GetIndex();
// EinfuegePos nicht in leerer Zeile
- if( nCntPos && pSttNd->GetTxt().Len() )
+ if (nCntPos && pSttNd->GetTxt().getLength())
rDoc.SplitNode( *pPos, false ); // neue Zeile erzeugen
- if( pSttNd->GetTxt().Len() )
+ if (pSttNd->GetTxt().getLength())
{ // EinfuegePos nicht am Ende der Zeile
rDoc.SplitNode( *pPos, false ); // neue Zeile
pPaM->Move( fnMoveBackward ); // gehe in leere Zeile
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index bc8dd2e1fe48..e5dc94e5f45a 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -354,7 +354,7 @@ sal_uInt16 SwWW8ImplReader::End_Ftn()
//There should have been a footnote char, we will replace this.
if (pTxt && nPos)
{
- sChar.Append(pTxt->GetTxt().GetChar(--nPos));
+ sChar.Append(pTxt->GetTxt()[--nPos]);
pPaM->SetMark();
pPaM->GetMark()->nContent--;
rDoc.DeleteRange( *pPaM );
@@ -400,14 +400,14 @@ sal_uInt16 SwWW8ImplReader::End_Ftn()
SwNodeIndex& rNIdx = pPaM->GetPoint()->nNode;
rNIdx = pSttIdx->GetIndex() + 1;
SwTxtNode* pTNd = rNIdx.GetNode().GetTxtNode();
- if (pTNd && pTNd->GetTxt().Len() && sChar.Len())
+ if (pTNd && !pTNd->GetTxt().isEmpty() && sChar.Len())
{
- if (pTNd->GetTxt().GetChar(0) == sChar.GetChar(0))
+ if (pTNd->GetTxt()[0] == sChar.GetChar(0))
{
pPaM->GetPoint()->nContent.Assign( pTNd, 0 );
pPaM->SetMark();
// Strip out tabs we may have inserted on export #i24762#
- if (pTNd->GetTxt().GetChar(1) == 0x09)
+ if (pTNd->GetTxt()[1] == 0x09)
pPaM->GetMark()->nContent++;
pPaM->GetMark()->nContent++;
pReffingStck->Delete(*pPaM);
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 658a0f069425..39c8939b2f25 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2190,7 +2190,7 @@ SwTwips SwWW8ImplReader::MoveOutsideFly(SwFrmFmt *pFlyFmt,
{
SwTxtNode *pNd = aIdx.GetNode().GetTxtNode();
++aIdx;
- if (aIdx == aEnd && pNd && !pNd->GetTxt().Len())
+ if (aIdx == aEnd && pNd && pNd->GetTxt().isEmpty())
{
//An extra pre-created by writer unused paragraph
//
@@ -2367,7 +2367,7 @@ bool SwWW8ImplReader::JoinNode(SwPaM &rPam, bool bStealAttr)
{
maSectionManager.JoinNode(*rPam.GetPoint(), aPref.GetNode());
rPam.GetPoint()->nNode = aPref;
- rPam.GetPoint()->nContent.Assign(pNode, pNode->GetTxt().Len());
+ rPam.GetPoint()->nContent.Assign(pNode, pNode->GetTxt().getLength());
if (bStealAttr)
pCtrlStck->StealAttr(rPam.GetPoint()->nNode);
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index e45dc1cc82d2..558fbb70ab2f 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -765,7 +765,7 @@ void SwXMLImport::endDocument( void )
{
pPaM->GetPoint()->nNode = *pSttNdIdx;
pPaM->GetPoint()->nContent.Assign( pTxtNode,
- pTxtNode->GetTxt().Len() );
+ pTxtNode->GetTxt().getLength());
}
#if OSL_DEBUG_LEVEL > 0
@@ -783,7 +783,7 @@ void SwXMLImport::endDocument( void )
sal_uInt16 nCntPos =
pPaM->GetBound( sal_True ).nContent.GetIndex();
pPaM->GetBound( sal_True ).nContent.Assign( pTxtNode,
- pTxtNode->GetTxt().Len() + nCntPos );
+ pTxtNode->GetTxt().getLength() + nCntPos );
}
if( pSttNdIdx->GetIndex()+1 ==
pPaM->GetBound( sal_False ).nNode.GetIndex() )
@@ -791,14 +791,14 @@ void SwXMLImport::endDocument( void )
sal_uInt16 nCntPos =
pPaM->GetBound( sal_False ).nContent.GetIndex();
pPaM->GetBound( sal_False ).nContent.Assign( pTxtNode,
- pTxtNode->GetTxt().Len() + nCntPos );
+ pTxtNode->GetTxt().getLength() + nCntPos );
}
#endif
// If the first new node isn't empty, convert the node's text
// attributes into hints. Otherwise, set the new node's
// paragraph style at the previous (empty) node.
SwTxtNode* pDelNd = aNxtIdx.GetNode().GetTxtNode();
- if( pTxtNode->GetTxt().Len() )
+ if (!pTxtNode->GetTxt().isEmpty())
pDelNd->FmtToTxtAttr( pTxtNode );
else
pTxtNode->ChgFmtColl( pDelNd->GetTxtColl() );
@@ -853,7 +853,7 @@ void SwXMLImport::endDocument( void )
pNextNd->JoinPrev();
}
}
- else if( !pCurrNd->GetTxt().Len() )
+ else if (pCurrNd->GetTxt().isEmpty())
{
pPos->nContent.Assign( 0, 0 );
pPaM->SetMark(); pPaM->DeleteMark();
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index d35254d0c7fb..66d3402c17d7 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -2114,7 +2114,8 @@ SwTableBox *SwXMLTableContext::MakeTableBox(
SAL_WARN_IF(!pTxtNode, "sw", "Should have a text node in cell?");
if (pTxtNode)
{
- SAL_WARN_IF(pTxtNode->GetTxt().Len(), "sw", "why text here?");
+ SAL_WARN_IF(!pTxtNode->GetTxt().isEmpty(), "sw",
+ "why text here?");
pTxtNode->InsertText(*pCell->GetStringValue(),
SwIndex(pTxtNode, 0));
}