summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2013-11-22 20:29:26 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2013-11-23 14:20:38 +0100
commitd3cb483e7fa127886877dba08c285f47093c27d8 (patch)
tree030eae05c2346442074e0a8ff5b99d04e73ee045 /sw
parent4963072118a37ade94430ce08592680e11484593 (diff)
xub_StrLen to sal_Int32
Change-Id: I7f30e122a44eda7ee1c93595029ec15b6b426d6c
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/inc/msfilter.hxx6
-rw-r--r--sw/source/filter/ww8/docxexport.cxx2
-rw-r--r--sw/source/filter/ww8/docxexport.hxx2
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx2
-rw-r--r--sw/source/filter/ww8/rtfexport.hxx2
-rw-r--r--sw/source/filter/ww8/writerwordglue.cxx10
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx40
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx9
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx19
9 files changed, 45 insertions, 47 deletions
diff --git a/sw/source/filter/inc/msfilter.hxx b/sw/source/filter/inc/msfilter.hxx
index 30a5997ac6a1..08975dab388a 100644
--- a/sw/source/filter/inc/msfilter.hxx
+++ b/sw/source/filter/inc/msfilter.hxx
@@ -430,11 +430,11 @@ namespace sw
struct CharRunEntry
{
- xub_StrLen mnEndPos;
+ sal_Int32 mnEndPos;
sal_uInt16 mnScript;
rtl_TextEncoding meCharSet;
bool mbRTL;
- CharRunEntry(xub_StrLen nEndPos, sal_uInt16 nScript,
+ CharRunEntry(sal_Int32 nEndPos, sal_uInt16 nScript,
rtl_TextEncoding eCharSet, bool bRTL)
: mnEndPos(nEndPos), mnScript(nScript), meCharSet(eCharSet),
mbRTL(bRTL)
@@ -475,7 +475,7 @@ namespace sw
@see #i22537# for example
*/
CharRuns GetPseudoCharRuns(const SwTxtNode& rTxtNd,
- xub_StrLen nStart = 0, bool bSplitOnCharSet = false);
+ sal_Int32 nStart = 0, bool bSplitOnCharSet = false);
}
}
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 58b681e33c31..b6d91c917d8a 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -120,7 +120,7 @@ bool DocxExport::CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich
return true;
}
-void DocxExport::AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen )
+void DocxExport::AppendBookmarks( const SwTxtNode& rNode, sal_Int32 nAktPos, sal_Int32 nLen )
{
std::vector< OUString > aStarts;
std::vector< OUString > aEnds;
diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx
index 38154595a8ff..080c507b18ee 100644
--- a/sw/source/filter/ww8/docxexport.hxx
+++ b/sw/source/filter/ww8/docxexport.hxx
@@ -106,7 +106,7 @@ public:
/// Guess the script (asian/western).
virtual bool CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich );
- virtual void AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen );
+ virtual void AppendBookmarks( const SwTxtNode& rNode, sal_Int32 nAktPos, sal_Int32 nLen );
virtual void AppendBookmark( const OUString& rName, bool bSkip = false );
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 05647b99eb2d..a711ec8b0efe 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -122,7 +122,7 @@ bool RtfExport::CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich
return true;
}
-void RtfExport::AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen )
+void RtfExport::AppendBookmarks( const SwTxtNode& rNode, sal_Int32 nAktPos, sal_Int32 nLen )
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC);
diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx
index e77adf9d4331..886322f61996 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -69,7 +69,7 @@ public:
/// Guess the script (asian/western).
virtual bool CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich );
- virtual void AppendBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen );
+ virtual void AppendBookmarks( const SwTxtNode& rNode, sal_Int32 nAktPos, sal_Int32 nLen );
virtual void AppendBookmark( const OUString& rName, bool bSkip = false );
diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx
index 7fc60611ea1f..c02dbea45904 100644
--- a/sw/source/filter/ww8/writerwordglue.cxx
+++ b/sw/source/filter/ww8/writerwordglue.cxx
@@ -324,9 +324,9 @@ namespace myImplHelpers
: public std::unary_function<const sw::util::CharRunEntry&, bool>
{
private:
- xub_StrLen mnStart;
+ sal_Int32 mnStart;
public:
- IfBeforeStart(xub_StrLen nStart) : mnStart(nStart) {}
+ IfBeforeStart(sal_Int32 nStart) : mnStart(nStart) {}
bool operator()(const sw::util::CharRunEntry &rEntry) const
{
return rEntry.mnEndPos < mnStart;
@@ -502,7 +502,7 @@ namespace sw
}
CharRuns GetPseudoCharRuns(const SwTxtNode& rTxtNd,
- xub_StrLen nTxtStart, bool bSplitOnCharSet)
+ sal_Int32 nTxtStart, bool bSplitOnCharSet)
{
const OUString &rTxt = rTxtNd.GetTxt();
@@ -540,11 +540,11 @@ namespace sw
typedef std::vector<DirEntry> DirChanges;
typedef DirChanges::const_iterator cDirIter;
- typedef std::pair<xub_StrLen, sal_Int16> CharSetEntry;
+ typedef std::pair<sal_Int32, sal_Int16> CharSetEntry;
typedef std::vector<CharSetEntry> CharSetChanges;
typedef CharSetChanges::const_iterator cCharSetIter;
- typedef std::pair<xub_StrLen, sal_uInt16> ScriptEntry;
+ typedef std::pair<sal_Int32, sal_uInt16> ScriptEntry;
typedef std::vector<ScriptEntry> ScriptChanges;
typedef ScriptChanges::const_iterator cScriptIter;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 26ab20ea7bb5..0122fe303e80 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -224,7 +224,7 @@ SwWW8AttrIter::SwWW8AttrIter(MSWordExportBase& rWr, const SwTxtNode& rTxtNd) :
sal_Int32 lcl_getMinPos( sal_Int32 pos1, sal_Int32 pos2 )
{
- xub_StrLen min = -1;
+ sal_Int32 min = -1;
if ( pos1 == -1 && pos2 != -1 )
min = pos2;
else if ( pos2 == -1 && pos1 != -1 )
@@ -595,7 +595,7 @@ const SfxPoolItem* SwWW8AttrIter::HasTextItem( sal_uInt16 nWhich ) const
const SwpHints* pTxtAttrs = rNd.GetpSwpHints();
if (pTxtAttrs && !m_rExport.m_aCurrentCharPropStarts.empty())
{
- xub_StrLen nTmpSwPos = m_rExport.m_aCurrentCharPropStarts.top();
+ const sal_Int32 nTmpSwPos = m_rExport.m_aCurrentCharPropStarts.top();
for (sal_uInt16 i = 0; i < pTxtAttrs->Count(); ++i)
{
const SwTxtAttr* pHt = (*pTxtAttrs)[i];
@@ -1591,11 +1591,11 @@ void WW8AttributeOutput::FormatDrop( const SwTxtNode& rNode, const SwFmtDrop &rS
m_rWW8Export.pO->clear();
}
-xub_StrLen MSWordExportBase::GetNextPos( SwWW8AttrIter* aAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos )
+sal_Int32 MSWordExportBase::GetNextPos( SwWW8AttrIter* aAttrIter, const SwTxtNode& rNode, sal_Int32 nAktPos )
{
// Get the bookmarks for the normal run
- xub_StrLen nNextPos = aAttrIter->WhereNext();
- xub_StrLen nNextBookmark = nNextPos;
+ const sal_Int32 nNextPos = aAttrIter->WhereNext();
+ sal_Int32 nNextBookmark = nNextPos;
if( nNextBookmark > nAktPos ) //no need to search for bookmarks otherwise (checked in UpdatePosition())
{
@@ -1605,9 +1605,9 @@ xub_StrLen MSWordExportBase::GetNextPos( SwWW8AttrIter* aAttrIter, const SwTxtNo
return std::min( nNextPos, nNextBookmark );
}
-void MSWordExportBase::UpdatePosition( SwWW8AttrIter* aAttrIter, xub_StrLen nAktPos, xub_StrLen /*nEnd*/ )
+void MSWordExportBase::UpdatePosition( SwWW8AttrIter* aAttrIter, sal_Int32 nAktPos, sal_Int32 /*nEnd*/ )
{
- xub_StrLen nNextPos;
+ sal_Int32 nNextPos;
// go to next attribute if no bookmark is found or if the bookmark is behind the next attribute position
// It may happened that the WhereNext() wasn't used in the previous increment because there was a
@@ -1617,8 +1617,8 @@ void MSWordExportBase::UpdatePosition( SwWW8AttrIter* aAttrIter, xub_StrLen nAkt
aAttrIter->NextPos();
}
-bool MSWordExportBase::GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt,
- xub_StrLen nEnd, IMarkVector& rArr )
+bool MSWordExportBase::GetBookmarks( const SwTxtNode& rNd, sal_Int32 nStt,
+ sal_Int32 nEnd, IMarkVector& rArr )
{
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
sal_uLong nNd = rNd.GetIndex( );
@@ -1632,8 +1632,8 @@ bool MSWordExportBase::GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt,
if ( pMark->GetMarkStart().nNode == nNd ||
pMark->GetMarkEnd().nNode == nNd )
{
- xub_StrLen nBStart = pMark->GetMarkStart().nContent.GetIndex();
- xub_StrLen nBEnd = pMark->GetMarkEnd().nContent.GetIndex();
+ const sal_Int32 nBStart = pMark->GetMarkStart().nContent.GetIndex();
+ const sal_Int32 nBEnd = pMark->GetMarkEnd().nContent.GetIndex();
// Keep only the bookmars starting or ending in the snippet
bool bIsStartOk = ( pMark->GetMarkStart().nNode == nNd ) && ( nBStart >= nStt ) && ( nBStart <= nEnd );
@@ -1662,14 +1662,14 @@ public:
}
};
-bool MSWordExportBase::NearestBookmark( xub_StrLen& rNearest, const xub_StrLen nAktPos, bool bNextPositionOnly )
+bool MSWordExportBase::NearestBookmark( sal_Int32& rNearest, const sal_Int32 nAktPos, bool bNextPositionOnly )
{
bool bHasBookmark = false;
if ( !m_rSortedMarksStart.empty() )
{
IMark* pMarkStart = m_rSortedMarksStart.front();
- xub_StrLen nNext = pMarkStart->GetMarkStart().nContent.GetIndex();
+ const sal_Int32 nNext = pMarkStart->GetMarkStart().nContent.GetIndex();
if( !bNextPositionOnly || (nNext > nAktPos ))
{
rNearest = nNext;
@@ -1680,7 +1680,7 @@ bool MSWordExportBase::NearestBookmark( xub_StrLen& rNearest, const xub_StrLen n
if ( !m_rSortedMarksEnd.empty() )
{
IMark* pMarkEnd = m_rSortedMarksEnd[0];
- xub_StrLen nNext = pMarkEnd->GetMarkEnd().nContent.GetIndex();
+ const sal_Int32 nNext = pMarkEnd->GetMarkEnd().nContent.GetIndex();
if( !bNextPositionOnly || nNext > nAktPos )
{
if ( !bHasBookmark )
@@ -1694,7 +1694,7 @@ bool MSWordExportBase::NearestBookmark( xub_StrLen& rNearest, const xub_StrLen n
return bHasBookmark;
}
-void MSWordExportBase::GetSortedBookmarks( const SwTxtNode& rNode, xub_StrLen nAktPos, xub_StrLen nLen )
+void MSWordExportBase::GetSortedBookmarks( const SwTxtNode& rNode, sal_Int32 nAktPos, sal_Int32 nLen )
{
IMarkVector aMarksStart;
if ( GetBookmarks( rNode, nAktPos, nAktPos + nLen, aMarksStart ) )
@@ -1810,7 +1810,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
do {
const SwRedlineData* pRedlineData = aAttrIter.GetRedline( nAktPos );
- xub_StrLen nNextAttr = GetNextPos( &aAttrIter, rNode, nAktPos );
+ sal_Int32 nNextAttr = GetNextPos( &aAttrIter, rNode, nAktPos );
// Is this the only run in this paragraph and it's empty?
bool bSingleEmptyRun = nAktPos == 0 && nNextAttr == 0;
AttrOutput().StartRun( pRedlineData, bSingleEmptyRun );
@@ -1827,11 +1827,11 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
bool bTxtAtr = aAttrIter.IsTxtAttr( nAktPos );
nOpenAttrWithRange += aAttrIter.OutAttrWithRange(nAktPos);
- xub_StrLen nLen = nNextAttr - nAktPos;
+ sal_Int32 nLen = nNextAttr - nAktPos;
if ( !bTxtAtr && nLen )
{
sal_Unicode ch = aStr[nAktPos];
- int ofs = ( ch == CH_TXT_ATR_FIELDSTART || ch == CH_TXT_ATR_FIELDEND || ch == CH_TXT_ATR_FORMELEMENT? 1: 0 );
+ const sal_Int32 ofs = ( ch == CH_TXT_ATR_FIELDSTART || ch == CH_TXT_ATR_FIELDEND || ch == CH_TXT_ATR_FORMELEMENT? 1 : 0 );
IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
if ( ch == CH_TXT_ATR_FIELDSTART )
@@ -1935,9 +1935,9 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
if ( isDropdownOrCheckbox )
AppendBookmark( pFieldmark->GetName(), false );
}
- nLen -= static_cast< sal_Int32 >( ofs );
+ nLen -= ofs;
- OUString aSnippet( aAttrIter.GetSnippet( aStr, nAktPos + static_cast< sal_Int32 >( ofs ), nLen ) );
+ OUString aSnippet( aAttrIter.GetSnippet( aStr, nAktPos + ofs, nLen ) );
if ( ( nTxtTyp == TXT_EDN || nTxtTyp == TXT_FTN ) && nAktPos == 0 && nLen > 0 )
{
// Insert tab for aesthetic puposes #i24762#
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index e6f7ea197c4f..1a4e65841d7a 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1344,12 +1344,11 @@ WW8_CP WW8_WrPct::Fc2Cp( sal_uLong nFc ) const
return nFc + aPcts.back().GetStartCp();
}
-void WW8Export::AppendBookmarks( const SwTxtNode& rNd,
- xub_StrLen nAktPos, xub_StrLen nLen )
+void WW8Export::AppendBookmarks( const SwTxtNode& rNd, sal_Int32 nAktPos, sal_Int32 nLen )
{
std::vector< const ::sw::mark::IMark* > aArr;
sal_uInt16 nCntnt;
- xub_StrLen nAktEnd = nAktPos + nLen;
+ const sal_Int32 nAktEnd = nAktPos + nLen;
if( GetWriter().GetBookmarks( rNd, nAktPos, nAktEnd, aArr ))
{
sal_uLong nNd = rNd.GetIndex(), nSttCP = Fc2Cp( Strm().Tell() );
@@ -1748,8 +1747,8 @@ void MSWordExportBase::WriteSpecialText( sal_uLong nStart, sal_uLong nEnd, sal_u
nTxtTyp = nOldTyp;
}
-void WW8Export::OutSwString(const OUString& rStr, xub_StrLen nStt,
- xub_StrLen nLen, bool bUnicode, rtl_TextEncoding eChrSet)
+void WW8Export::OutSwString(const OUString& rStr, sal_Int32 nStt,
+ sal_Int32 nLen, bool bUnicode, rtl_TextEncoding eChrSet)
{
SAL_INFO( "sw.ww8.level2", "<OutSwString>" );
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 212b274fc7d1..23a964fcc4bb 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -455,7 +455,7 @@ public:
SwNumRuleTbl* pUsedNumTbl; // alle used NumRules
const SwTxtNode *mpTopNodeOfHdFtPage; ///< Top node of host page when in hd/ft
std::map< sal_uInt16, sal_uInt16 > aRuleDuplicates; //map to Duplicated numrules
- std::stack< xub_StrLen > m_aCurrentCharPropStarts; ///< To remember the position in a run.
+ std::stack< sal_Int32 > m_aCurrentCharPropStarts; ///< To remember the position in a run.
WW8_WrtBookmarks* pBkmks;
WW8_WrtRedlineAuthor* pRedlAuthors;
BitmapPalette* pBmpPal;
@@ -644,7 +644,7 @@ public:
/// has two
virtual bool CollapseScriptsforWordOk( sal_uInt16 nScript, sal_uInt16 nWhich ) = 0;
- virtual void AppendBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos, xub_StrLen nLen ) = 0;
+ virtual void AppendBookmarks( const SwTxtNode& rNd, sal_Int32 nAktPos, sal_Int32 nLen ) = 0;
virtual void AppendBookmark( const OUString& rName, bool bSkip = false ) = 0;
//For i120928,add this interface to export graphic of bullet
@@ -756,10 +756,10 @@ protected:
virtual void ExportDocument_Impl() = 0;
/// Get the next position in the text node to output
- virtual xub_StrLen GetNextPos( SwWW8AttrIter* pAttrIter, const SwTxtNode& rNode, xub_StrLen nAktPos );
+ virtual sal_Int32 GetNextPos( SwWW8AttrIter* pAttrIter, const SwTxtNode& rNode, sal_Int32 nAktPos );
/// Update the information for GetNextPos().
- virtual void UpdatePosition( SwWW8AttrIter* pAttrIter, xub_StrLen nAktPos, xub_StrLen nEnd );
+ virtual void UpdatePosition( SwWW8AttrIter* pAttrIter, sal_Int32 nAktPos, sal_Int32 nEnd );
/// Output SwTxtNode
virtual void OutputTextNode( const SwTxtNode& );
@@ -815,12 +815,11 @@ protected:
/// Find the nearest bookmark from the current position.
///
/// Returns false when there is no bookmark.
- bool NearestBookmark( xub_StrLen& rNearest, const xub_StrLen nAktPos, bool bNextPositionOnly );
+ bool NearestBookmark( sal_Int32& rNearest, const sal_Int32 nAktPos, bool bNextPositionOnly );
- void GetSortedBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos,
- xub_StrLen nLen );
+ void GetSortedBookmarks( const SwTxtNode& rNd, sal_Int32 nAktPos, sal_Int32 nLen );
- bool GetBookmarks( const SwTxtNode& rNd, xub_StrLen nStt, xub_StrLen nEnd,
+ bool GetBookmarks( const SwTxtNode& rNd, sal_Int32 nStt, sal_Int32 nEnd,
IMarkVector& rArr );
const NfKeywordTable & GetNfKeywordTable();
@@ -1015,7 +1014,7 @@ public:
bool TestOleNeedsGraphic(const SwAttrSet& rSet, SvStorageRef xOleStg,
SvStorageRef xObjStg, OUString &rStorageName, SwOLENode *pOLENd);
- virtual void AppendBookmarks( const SwTxtNode& rNd, xub_StrLen nAktPos, xub_StrLen nLen );
+ virtual void AppendBookmarks( const SwTxtNode& rNd, sal_Int32 nAktPos, sal_Int32 nLen );
virtual void AppendBookmark( const OUString& rName, bool bSkip = false );
virtual void ExportGrfBullet(const SwTxtNode& rNd);
@@ -1031,7 +1030,7 @@ public:
virtual void WriteCR( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner = ww8::WW8TableNodeInfoInner::Pointer_t() );
void WriteChar( sal_Unicode c );
- void OutSwString(const OUString&, xub_StrLen nStt, xub_StrLen nLen,
+ void OutSwString(const OUString&, sal_Int32 nStt, sal_Int32 nLen,
bool bUnicode, rtl_TextEncoding eChrSet);
WW8_CP Fc2Cp( sal_uLong nFc ) const { return pPiece->Fc2Cp( nFc ); }