summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2013-11-22 15:37:32 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2013-11-23 14:20:37 +0100
commitb8411d40587b9eb4b666d2394708dfaf8f06ab99 (patch)
treebd24f3b78736df16ea77eb46c5a71f4c69a66f5d /sw
parentace51a616c3fc6abdb0df6ed4b0686eb6525848a (diff)
xub_StrLen to sal_Int32 and some optimizations
Change-Id: I49d398ab9f086c769941767bb4431bbbb96f56b0
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/attributeoutputbase.hxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx10
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx2
-rw-r--r--sw/source/filter/ww8/docxexport.cxx9
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.hxx2
-rw-r--r--sw/source/filter/ww8/rtfsdrexport.cxx11
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx21
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx28
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx40
-rw-r--r--sw/source/filter/ww8/ww8attributeoutput.hxx2
-rw-r--r--sw/source/filter/ww8/ww8par3.cxx17
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx2
13 files changed, 71 insertions, 77 deletions
diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx
index 34e62eec4b66..f37ebff1fa1c 100644
--- a/sw/source/filter/ww8/attributeoutputbase.hxx
+++ b/sw/source/filter/ww8/attributeoutputbase.hxx
@@ -199,7 +199,7 @@ public:
virtual void RawText( const OUString& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ) = 0;
/// Output ruby start.
- virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby ) = 0;
+ virtual void StartRuby( const SwTxtNode& rNode, sal_Int32 nPos, const SwFmtRuby& rRuby ) = 0;
/// Output ruby end.
virtual void EndRuby() = 0;
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 054e946aaefe..6b02a078938b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -121,6 +121,8 @@
#include <com/sun/star/xml/sax/XSAXSerializable.hpp>
#include <com/sun/star/text/GraphicCrop.hpp>
+#include <algorithm>
+
#if OSL_DEBUG_LEVEL > 1
#include <stdio.h>
#endif
@@ -1281,7 +1283,7 @@ void DocxAttributeOutput::RawText( const OUString& /*rText*/, bool /*bForceUnico
OSL_TRACE("TODO DocxAttributeOutput::RawText( const String& rText, bool bForceUnicode, rtl_TextEncoding eCharSet )" );
}
-void DocxAttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby )
+void DocxAttributeOutput::StartRuby( const SwTxtNode& rNode, sal_Int32 nPos, const SwFmtRuby& rRuby )
{
OSL_TRACE("TODO DocxAttributeOutput::StartRuby( const SwTxtNode& rNode, const SwFmtRuby& rRuby )" );
m_pSerializer->startElementNS( XML_w, XML_ruby, FSEND );
@@ -3622,7 +3624,7 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj)
aAttrIter.NextPara( n );
OUString aStr( rEditObj.GetText( n ));
- xub_StrLen nAktPos = 0;
+ sal_Int32 nAktPos = 0;
sal_Int32 nEnd = aStr.getLength();
m_pSerializer->startElementNS( XML_w, XML_p, FSEND );
@@ -3633,9 +3635,7 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj)
m_pSerializer->endElementNS(XML_w, XML_pPr);
do {
- xub_StrLen nNextAttr = aAttrIter.WhereNext();
- if( nNextAttr > nEnd )
- nNextAttr = nEnd;
+ const sal_Int32 nNextAttr = std::min(aAttrIter.WhereNext(), nEnd);
m_pSerializer->startElementNS( XML_w, XML_r, FSEND );
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 20991164b4d4..8ddfc14eb9e5 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -153,7 +153,7 @@ public:
virtual void RawText( const OUString& rText, bool bForceUnicode, rtl_TextEncoding eCharSet );
/// Output ruby start.
- virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby );
+ virtual void StartRuby( const SwTxtNode& rNode, sal_Int32 nPos, const SwFmtRuby& rRuby );
/// Output ruby end.
virtual void EndRuby();
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index e29cd64f0b8c..58b681e33c31 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1038,16 +1038,13 @@ void DocxExport::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 nTy
AttrOutput().StartParagraph( ww8::WW8TableNodeInfo::Pointer_t());
rtl_TextEncoding eChrSet = aAttrIter.GetNodeCharSet();
OUString aStr( rEditObj.GetText( n ));
- xub_StrLen nAktPos = 0;
- sal_Int32 nEnd = aStr.getLength();
+ sal_Int32 nAktPos = 0;
+ const sal_Int32 nEnd = aStr.getLength();
do {
AttrOutput().StartRun( NULL );
- xub_StrLen nNextAttr = aAttrIter.WhereNext();
+ const sal_Int32 nNextAttr = std::min(aAttrIter.WhereNext(), nEnd);
rtl_TextEncoding eNextChrSet = aAttrIter.GetNextCharSet();
- if( nNextAttr > nEnd )
- nNextAttr = nEnd;
-
bool bTxtAtr = aAttrIter.IsTxtAttr( nAktPos );
if( !bTxtAtr )
{
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 3415be73901c..16f6174e5598 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -455,7 +455,7 @@ void RtfAttributeOutput::RawText( const OUString& rText, bool /*bForceUnicode*/,
m_aRunText->append(msfilter::rtfutil::OutString(rText, eCharSet));
}
-void RtfAttributeOutput::StartRuby( const SwTxtNode& /*rNode*/, xub_StrLen /*nPos*/, const SwFmtRuby& /*rRuby*/ )
+void RtfAttributeOutput::StartRuby( const SwTxtNode& /*rNode*/, sal_Int32 /*nPos*/, const SwFmtRuby& /*rRuby*/ )
{
SAL_INFO("sw.rtf", "TODO: " << OSL_THIS_FUNC);
}
diff --git a/sw/source/filter/ww8/rtfattributeoutput.hxx b/sw/source/filter/ww8/rtfattributeoutput.hxx
index 60de3e4febaf..e92388f86b9c 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.hxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.hxx
@@ -86,7 +86,7 @@ public:
virtual void RawText( const OUString& rText, bool bForceUnicode, rtl_TextEncoding eCharSet );
/// Output ruby start.
- virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby );
+ virtual void StartRuby( const SwTxtNode& rNode, sal_Int32 nPos, const SwFmtRuby& rRuby );
/// Output ruby end.
virtual void EndRuby();
diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx
index 5218e3b2e9ce..a1bb87285f0c 100644
--- a/sw/source/filter/ww8/rtfsdrexport.cxx
+++ b/sw/source/filter/ww8/rtfsdrexport.cxx
@@ -28,6 +28,8 @@
#include <svx/unoapi.hxx>
#include <vcl/cvtgrf.hxx>
+#include <algorithm>
+
using namespace sw::util;
using namespace css;
@@ -540,19 +542,16 @@ void RtfSdrExport::WriteOutliner(const OutlinerParaObject& rParaObj)
rtl_TextEncoding eChrSet = aAttrIter.GetNodeCharSet();
OUString aStr( rEditObj.GetText( n ));
- xub_StrLen nAktPos = 0;
- sal_Int32 nEnd = aStr.getLength();
+ sal_Int32 nAktPos = 0;
+ const sal_Int32 nEnd = aStr.getLength();
aAttrIter.OutParaAttr(false);
m_rAttrOutput.RunText().append(m_rAttrOutput.Styles().makeStringAndClear());
do {
- xub_StrLen nNextAttr = aAttrIter.WhereNext();
+ const sal_Int32 nNextAttr = std::min(aAttrIter.WhereNext(), nEnd);
rtl_TextEncoding eNextChrSet = aAttrIter.GetNextCharSet();
- if( nNextAttr > nEnd )
- nNextAttr = nEnd;
-
aAttrIter.OutAttr( nAktPos );
m_rAttrOutput.RunText().append('{').append(m_rAttrOutput.Styles().makeStringAndClear()).append(SAL_NEWLINE_STRING);
bool bTxtAtr = aAttrIter.IsTxtAttr( nAktPos );
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 599e0ad349a2..10b97cc05341 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -101,6 +101,8 @@
#include <svl/urihelper.hxx>
#include <unotools/saveopt.hxx>
+#include <algorithm>
+
using ::editeng::SvxBorderLine;
using namespace com::sun::star;
using namespace sw::util;
@@ -1103,12 +1105,12 @@ rtl_TextEncoding MSWord_SdrAttrIter::GetNextCharSet() const
}
// der erste Parameter in SearchNext() liefert zurueck, ob es ein TxtAtr ist.
-xub_StrLen MSWord_SdrAttrIter::SearchNext( xub_StrLen nStartPos )
+sal_Int32 MSWord_SdrAttrIter::SearchNext( sal_Int32 nStartPos )
{
- xub_StrLen nMinPos = STRING_MAXLEN;
+ sal_Int32 nMinPos = SAL_MAX_INT32;
for(std::vector<EECharAttrib>::const_iterator i = aTxtAtrArr.begin(); i < aTxtAtrArr.end(); ++i)
{
- xub_StrLen nPos = i->nStart; // gibt erstes Attr-Zeichen
+ sal_Int32 nPos = i->nStart; // gibt erstes Attr-Zeichen
if( nPos >= nStartPos && nPos <= nMinPos )
{
nMinPos = nPos;
@@ -1170,7 +1172,7 @@ void MSWord_SdrAttrIter::OutEEField(const SfxPoolItem& rHt)
}
}
-void MSWord_SdrAttrIter::OutAttr( xub_StrLen nSwPos )
+void MSWord_SdrAttrIter::OutAttr( sal_Int32 nSwPos )
{
OutParaAttr(true);
@@ -1226,7 +1228,7 @@ void MSWord_SdrAttrIter::OutAttr( xub_StrLen nSwPos )
}
}
-bool MSWord_SdrAttrIter::IsTxtAttr(xub_StrLen nSwPos)
+bool MSWord_SdrAttrIter::IsTxtAttr(sal_Int32 nSwPos)
{
for (std::vector<EECharAttrib>::const_iterator i = aTxtAtrArr.begin(); i < aTxtAtrArr.end(); ++i)
{
@@ -1364,15 +1366,12 @@ void WW8Export::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 nTyp
OSL_ENSURE( pO->empty(), " pO ist am Zeilenanfang nicht leer" );
OUString aStr( rEditObj.GetText( n ));
- xub_StrLen nAktPos = 0;
- sal_Int32 nEnd = aStr.getLength();
+ sal_Int32 nAktPos = 0;
+ const sal_Int32 nEnd = aStr.getLength();
do {
- xub_StrLen nNextAttr = aAttrIter.WhereNext();
+ const sal_Int32 nNextAttr = std::min(aAttrIter.WhereNext(), nEnd);
rtl_TextEncoding eNextChrSet = aAttrIter.GetNextCharSet();
- if( nNextAttr > nEnd )
- nNextAttr = nEnd;
-
bool bTxtAtr = aAttrIter.IsTxtAttr( nAktPos );
if( !bTxtAtr )
OutSwString( aStr, nAktPos, nNextAttr - nAktPos,
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 72ad2fea72da..26ab20ea7bb5 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -240,11 +240,11 @@ sal_Int32 lcl_getMinPos( sal_Int32 pos1, sal_Int32 pos2 )
return min;
}
-xub_StrLen SwWW8AttrIter::SearchNext( xub_StrLen nStartPos )
+sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos )
{
- xub_StrLen nPos;
- xub_StrLen nMinPos = STRING_MAXLEN;
- xub_StrLen i=0;
+ sal_Int32 nPos;
+ sal_Int32 nMinPos = SAL_MAX_INT32;
+ sal_Int32 i=0;
const OUString aTxt = rNd.GetTxt();
sal_Int32 fieldEndPos = aTxt.indexOf(CH_TXT_ATR_FIELDEND, nStartPos);
@@ -379,7 +379,7 @@ static bool lcl_isFontsizeItem( const SfxPoolItem& rItem )
rItem.Which( ) == RES_CHRATR_CTL_FONTSIZE );
}
-void SwWW8AttrIter::OutAttr( xub_StrLen nSwPos, bool bRuby )
+void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby )
{
m_rExport.AttrOutput().RTLAndCJKState( IsCharRTL(), GetScript() );
@@ -512,7 +512,7 @@ void SwWW8AttrIter::OutAttr( xub_StrLen nSwPos, bool bRuby )
}
}
-void SwWW8AttrIter::OutFlys(xub_StrLen nSwPos)
+void SwWW8AttrIter::OutFlys(sal_Int32 nSwPos)
{
/*
#i2916#
@@ -534,7 +534,7 @@ void SwWW8AttrIter::OutFlys(xub_StrLen nSwPos)
}
}
-bool SwWW8AttrIter::IsTxtAttr( xub_StrLen nSwPos )
+bool SwWW8AttrIter::IsTxtAttr( sal_Int32 nSwPos )
{
// search for attrs with dummy character or content
if (const SwpHints* pTxtAttrs = rNd.GetpSwpHints())
@@ -641,7 +641,7 @@ const SfxPoolItem& SwWW8AttrIter::GetItem(sal_uInt16 nWhich) const
return pRet ? *pRet : rNd.SwCntntNode::GetAttr(nWhich);
}
-void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, xub_StrLen /*nPos*/, const SwFmtRuby& rRuby )
+void WW8AttributeOutput::StartRuby( const SwTxtNode& rNode, sal_Int32 /*nPos*/, const SwFmtRuby& rRuby )
{
OUString aStr( FieldString( ww::eEQ ) );
aStr += "\\* jc";
@@ -1119,7 +1119,7 @@ void AttributeOutputBase::TOXMark( const SwTxtNode& rNode, const SwTOXMark& rAtt
FieldVanish( sTxt, eType );
}
-int SwWW8AttrIter::OutAttrWithRange(xub_StrLen nPos)
+int SwWW8AttrIter::OutAttrWithRange(sal_Int32 nPos)
{
int nRet = 0;
if ( const SwpHints* pTxtAttrs = rNd.GetpSwpHints() )
@@ -1180,7 +1180,7 @@ int SwWW8AttrIter::OutAttrWithRange(xub_StrLen nPos)
return nRet;
}
-bool SwWW8AttrIter::IsRedlineAtEnd( xub_StrLen nEnd ) const
+bool SwWW8AttrIter::IsRedlineAtEnd( sal_Int32 nEnd ) const
{
bool bRet = false;
// search next Redline
@@ -1202,7 +1202,7 @@ bool SwWW8AttrIter::IsRedlineAtEnd( xub_StrLen nEnd ) const
return bRet;
}
-const SwRedlineData* SwWW8AttrIter::GetRedline( xub_StrLen nPos )
+const SwRedlineData* SwWW8AttrIter::GetRedline( sal_Int32 nPos )
{
if( pCurRedline )
{
@@ -1396,8 +1396,8 @@ Convert characters that need to be converted, the basic replacements and the
ridicously complicated title case attribute mapping to hardcoded upper case
because word doesn't have the feature
*/
-OUString SwWW8AttrIter::GetSnippet(const OUString &rStr, xub_StrLen nAktPos,
- xub_StrLen nLen) const
+OUString SwWW8AttrIter::GetSnippet(const OUString &rStr, sal_Int32 nAktPos,
+ sal_Int32 nLen) const
{
if (!nLen)
return OUString();
@@ -1801,7 +1801,7 @@ void MSWordExportBase::OutputTextNode( const SwTxtNode& rNode )
sal_Int32 nAktPos = 0;
sal_Int32 const nEnd = aStr.getLength();
bool bRedlineAtEnd = false;
- int nOpenAttrWithRange = 0;
+ sal_Int32 nOpenAttrWithRange = 0;
ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner;
if ( pTextNodeInfo.get() != NULL )
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 3e2dbff096c2..212b274fc7d1 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -1406,13 +1406,13 @@ private:
std::vector<const EECharAttrib*> aChrTxtAtrArr;
std::vector<rtl_TextEncoding> aChrSetArr;
sal_Int32 nPara;
- xub_StrLen nAktSwPos;
- xub_StrLen nTmpSwPos; // for HasItem()
+ sal_Int32 nAktSwPos;
+ sal_Int32 nTmpSwPos; // for HasItem()
rtl_TextEncoding eNdChrSet;
sal_uInt16 nScript;
sal_uInt8 mnTyp;
- xub_StrLen SearchNext( xub_StrLen nStartPos );
+ sal_Int32 SearchNext( sal_Int32 nStartPos );
void SetCharSet(const EECharAttrib& rTxtAttr, bool bStart);
//No copying
@@ -1425,15 +1425,15 @@ public:
void OutParaAttr(bool bCharAttr);
void OutEEField(const SfxPoolItem& rHt);
- bool IsTxtAttr(xub_StrLen nSwPos);
+ bool IsTxtAttr(sal_Int32 nSwPos);
- void NextPos() { if ( nAktSwPos < STRING_NOTFOUND ) nAktSwPos = SearchNext( nAktSwPos + 1 ); }
+ void NextPos() { if ( nAktSwPos < SAL_MAX_INT32 ) nAktSwPos = SearchNext( nAktSwPos + 1 ); }
- void OutAttr( xub_StrLen nSwPos );
+ void OutAttr( sal_Int32 nSwPos );
virtual const SfxPoolItem* HasTextItem( sal_uInt16 nWhich ) const;
virtual const SfxPoolItem& GetItem( sal_uInt16 nWhich ) const;
- bool OutAttrWithRange(xub_StrLen nPos);
- xub_StrLen WhereNext() const { return nAktSwPos; }
+ bool OutAttrWithRange(sal_Int32 nPos);
+ sal_Int32 WhereNext() const { return nAktSwPos; }
rtl_TextEncoding GetNextCharSet() const;
rtl_TextEncoding GetNodeCharSet() const { return eNdChrSet; }
};
@@ -1459,7 +1459,7 @@ private:
bool mbCharIsRTL;
const SwRedline* pCurRedline;
- xub_StrLen nAktSwPos;
+ sal_Int32 nAktSwPos;
sal_uInt16 nCurRedlinePos;
bool mbParaIsRTL;
@@ -1469,7 +1469,7 @@ private:
sw::Frames maFlyFrms; // #i2916#
sw::FrameIter maFlyIter;
- xub_StrLen SearchNext( xub_StrLen nStartPos );
+ sal_Int32 SearchNext( sal_Int32 nStartPos );
void FieldVanish( const OUString& rTxt );
void OutSwFmtRefMark(const SwFmtRefMark& rAttr, bool bStart);
@@ -1482,27 +1482,27 @@ private:
public:
SwWW8AttrIter( MSWordExportBase& rWr, const SwTxtNode& rNd );
- bool IsTxtAttr( xub_StrLen nSwPos );
- bool IsRedlineAtEnd( xub_StrLen nPos ) const;
+ bool IsTxtAttr( sal_Int32 nSwPos );
+ bool IsRedlineAtEnd( sal_Int32 nPos ) const;
bool IsDropCap( int nSwPos );
bool RequiresImplicitBookmark();
- void NextPos() { if ( nAktSwPos < STRING_NOTFOUND ) nAktSwPos = SearchNext( nAktSwPos + 1 ); }
+ void NextPos() { if ( nAktSwPos < SAL_MAX_INT32 ) nAktSwPos = SearchNext( nAktSwPos + 1 ); }
- void OutAttr( xub_StrLen nSwPos, bool bRuby = false );
+ void OutAttr( sal_Int32 nSwPos, bool bRuby = false );
virtual const SfxPoolItem* HasTextItem( sal_uInt16 nWhich ) const;
virtual const SfxPoolItem& GetItem( sal_uInt16 nWhich ) const;
- int OutAttrWithRange(xub_StrLen nPos);
- const SwRedlineData* GetRedline( xub_StrLen nPos );
- void OutFlys(xub_StrLen nSwPos);
+ int OutAttrWithRange(sal_Int32 nPos);
+ const SwRedlineData* GetRedline( sal_Int32 nPos );
+ void OutFlys(sal_Int32 nSwPos);
- xub_StrLen WhereNext() const { return nAktSwPos; }
+ sal_Int32 WhereNext() const { return nAktSwPos; }
sal_uInt16 GetScript() const { return mnScript; }
bool IsCharRTL() const { return mbCharIsRTL; }
bool IsParaRTL() const { return mbParaIsRTL; }
rtl_TextEncoding GetCharSet() const { return meChrSet; }
- OUString GetSnippet(const OUString &rStr, xub_StrLen nAktPos,
- xub_StrLen nLen) const;
+ OUString GetSnippet(const OUString &rStr, sal_Int32 nAktPos,
+ sal_Int32 nLen) const;
const SwFmtDrop& GetSwFmtDrop() const { return mrSwFmtDrop; }
};
diff --git a/sw/source/filter/ww8/ww8attributeoutput.hxx b/sw/source/filter/ww8/ww8attributeoutput.hxx
index 1a3f14bd0b00..cea26ef2147b 100644
--- a/sw/source/filter/ww8/ww8attributeoutput.hxx
+++ b/sw/source/filter/ww8/ww8attributeoutput.hxx
@@ -71,7 +71,7 @@ public:
virtual void RawText( const OUString& rText, bool bForceUnicode, rtl_TextEncoding eCharSet );
/// Output ruby start.
- virtual void StartRuby( const SwTxtNode& rNode, xub_StrLen nPos, const SwFmtRuby& rRuby );
+ virtual void StartRuby( const SwTxtNode& rNode, sal_Int32 nPos, const SwFmtRuby& rRuby );
/// Output ruby end.
virtual void EndRuby();
diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx
index 25da90283bca..a63a4c1ac183 100644
--- a/sw/source/filter/ww8/ww8par3.cxx
+++ b/sw/source/filter/ww8/ww8par3.cxx
@@ -491,11 +491,10 @@ WW8LSTInfo* WW8ListManager::GetLSTByListId( sal_uInt32 nIdLst ) const
}
static void lcl_CopyGreaterEight(OUString &rDest, OUString &rSrc,
- sal_Int32 nStart, sal_Int32 nLen = STRING_LEN)
+ sal_Int32 nStart, sal_Int32 nLen = SAL_MAX_INT32)
{
- if (nLen > rSrc.getLength() || nLen == STRING_LEN)
- nLen = rSrc.getLength();
- for( sal_Int32 nI = nStart; nI < nLen; ++nI)
+ const sal_Int32 nMaxLen = std::min(rSrc.getLength(), nLen);
+ for( sal_Int32 nI = nStart; nI < nMaxLen; ++nI)
{
sal_Unicode nChar = rSrc[nI];
if (nChar > WW8ListManager::nMaxLevel)
@@ -840,17 +839,17 @@ bool WW8ListManager::ReadLVL(SwNumFmt& rNumFmt, SfxItemSet*& rpItemSet,
*/
//First number appears at
sal_uInt8 nOneBasedFirstNoIndex = aOfsNumsXCH[0];
- xub_StrLen nFirstNoIndex =
- nOneBasedFirstNoIndex > 0 ? nOneBasedFirstNoIndex -1 : STRING_LEN;
+ const sal_Int32 nFirstNoIndex =
+ nOneBasedFirstNoIndex > 0 ? nOneBasedFirstNoIndex -1 : SAL_MAX_INT32;
lcl_CopyGreaterEight(sPrefix, sNumString, 0, nFirstNoIndex);
//Next number appears at
if (nUpperLevel)
{
sal_uInt8 nOneBasedNextNoIndex = aOfsNumsXCH[nUpperLevel-1];
- xub_StrLen nNextNoIndex =
- nOneBasedNextNoIndex > 0 ? nOneBasedNextNoIndex -1 : STRING_LEN;
- if (nNextNoIndex != STRING_LEN)
+ sal_Int32 nNextNoIndex =
+ nOneBasedNextNoIndex > 0 ? nOneBasedNextNoIndex -1 : SAL_MAX_INT32;
+ if (nNextNoIndex != SAL_MAX_INT32)
++nNextNoIndex;
if (sNumString.getLength() > nNextNoIndex)
lcl_CopyGreaterEight(sPostfix, sNumString, nNextNoIndex);
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 9a4b5db7776c..f0eaf85b2a3c 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2144,7 +2144,7 @@ eF_ResT SwWW8ImplReader::Read_F_Macro( WW8FieldDesc*, OUString& rStr)
bool bBracket = false;
WW8ReadFieldParams aReadParam( rStr );
- xub_StrLen nOffset = 0;
+ sal_Int32 nOffset = 0;
for (;;)
{