Kaydet (Commit) 1339e208 authored tarafından Matteo Casalin's avatar Matteo Casalin Kaydeden (comit) Caolán McNamara

This member function can return just a bool

Change-Id: Iba6661eca670c83d27630c1918f4b5421bbbf08f
Reviewed-on: https://gerrit.libreoffice.org/5735Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 520130db
...@@ -103,7 +103,7 @@ public: ...@@ -103,7 +103,7 @@ public:
WW8ReadFieldParams( const OUString& rData ); WW8ReadFieldParams( const OUString& rData );
~WW8ReadFieldParams(); ~WW8ReadFieldParams();
sal_Int32 GoToTokenParam(); bool GoToTokenParam();
sal_Int32 SkipToNextToken(); sal_Int32 SkipToNextToken();
sal_Int32 GetTokenSttPtr() const { return nFnd; } sal_Int32 GetTokenSttPtr() const { return nFnd; }
...@@ -156,13 +156,13 @@ OUString WW8ReadFieldParams::GetResult() const ...@@ -156,13 +156,13 @@ OUString WW8ReadFieldParams::GetResult() const
} }
sal_Int32 WW8ReadFieldParams::GoToTokenParam() bool WW8ReadFieldParams::GoToTokenParam()
{ {
const sal_Int32 nOld = nNext; const sal_Int32 nOld = nNext;
if( -2 == SkipToNextToken() ) if( -2 == SkipToNextToken() )
return GetTokenSttPtr(); return GetTokenSttPtr()>=0;
nNext = nOld; nNext = nOld;
return -1; return false;
} }
// ret: -2: NOT a '\' parameter but normal Text // ret: -2: NOT a '\' parameter but normal Text
...@@ -270,7 +270,7 @@ bool WW8ReadFieldParams::GetTokenSttFromTo(sal_Int32* pFrom, sal_Int32* pTo, sal ...@@ -270,7 +270,7 @@ bool WW8ReadFieldParams::GetTokenSttFromTo(sal_Int32* pFrom, sal_Int32* pTo, sal
{ {
sal_Int32 nStart = 0; sal_Int32 nStart = 0;
sal_Int32 nEnd = 0; sal_Int32 nEnd = 0;
if ( GoToTokenParam()>=0 ) if ( GoToTokenParam() )
{ {
const OUString sParams( GetResult() ); const OUString sParams( GetResult() );
...@@ -1276,7 +1276,7 @@ eF_ResT SwWW8ImplReader::Read_F_Input( WW8FieldDesc* pF, String& rStr ) ...@@ -1276,7 +1276,7 @@ eF_ResT SwWW8ImplReader::Read_F_Input( WW8FieldDesc* pF, String& rStr )
break; break;
case 'd': case 'd':
case 'D': case 'D':
if ( aReadParam.GoToTokenParam()>=0 ) if ( aReadParam.GoToTokenParam() )
aDef = aReadParam.GetResult(); aDef = aReadParam.GetResult();
break; break;
} }
...@@ -1462,7 +1462,7 @@ eF_ResT SwWW8ImplReader::Read_F_InputVar( WW8FieldDesc* pF, String& rStr ) ...@@ -1462,7 +1462,7 @@ eF_ResT SwWW8ImplReader::Read_F_InputVar( WW8FieldDesc* pF, String& rStr )
break; break;
case 'd': case 'd':
case 'D': case 'D':
if ( aReadParam.GoToTokenParam()>=0 ) if ( aReadParam.GoToTokenParam() )
aDef = aReadParam.GetResult(); aDef = aReadParam.GetResult();
break; break;
} }
...@@ -1966,12 +1966,12 @@ eF_ResT SwWW8ImplReader::Read_F_Symbol( WW8FieldDesc*, String& rStr ) ...@@ -1966,12 +1966,12 @@ eF_ResT SwWW8ImplReader::Read_F_Symbol( WW8FieldDesc*, String& rStr )
break; break;
case 'f': case 'f':
case 'F': case 'F':
if ( aReadParam.GoToTokenParam()>=0 ) if ( aReadParam.GoToTokenParam() )
aName = aReadParam.GetResult(); aName = aReadParam.GetResult();
break; break;
case 's': case 's':
case 'S': case 'S':
if ( aReadParam.GoToTokenParam()>=0 ) if ( aReadParam.GoToTokenParam() )
{ {
const OUString aSiz = aReadParam.GetResult(); const OUString aSiz = aReadParam.GetResult();
if ( !aSiz.isEmpty() ) if ( !aSiz.isEmpty() )
...@@ -2852,7 +2852,7 @@ static void lcl_toxMatchACSwitch( SwWW8ImplReader& /*rReader*/, ...@@ -2852,7 +2852,7 @@ static void lcl_toxMatchACSwitch( SwWW8ImplReader& /*rReader*/,
WW8ReadFieldParams& rParam, WW8ReadFieldParams& rParam,
SwCaptionDisplay eCaptionType) SwCaptionDisplay eCaptionType)
{ {
if ( rParam.GoToTokenParam()>=0 ) if ( rParam.GoToTokenParam() )
{ {
SwTOXType* pType = (SwTOXType*)rDoc.GetTOXType( TOX_ILLUSTRATIONS, 0); SwTOXType* pType = (SwTOXType*)rDoc.GetTOXType( TOX_ILLUSTRATIONS, 0);
rBase.RegisterToTOXType( *pType ); rBase.RegisterToTOXType( *pType );
...@@ -2920,7 +2920,7 @@ static void EnsureMaxLevelForTemplates(SwTOXBase& rBase) ...@@ -2920,7 +2920,7 @@ static void EnsureMaxLevelForTemplates(SwTOXBase& rBase)
static void lcl_toxMatchTSwitch(SwWW8ImplReader& rReader, SwTOXBase& rBase, static void lcl_toxMatchTSwitch(SwWW8ImplReader& rReader, SwTOXBase& rBase,
WW8ReadFieldParams& rParam) WW8ReadFieldParams& rParam)
{ {
if ( rParam.GoToTokenParam()>=0 ) if ( rParam.GoToTokenParam() )
{ {
String sParams( rParam.GetResult() ); String sParams( rParam.GetResult() );
if( sParams.Len() ) if( sParams.Len() )
...@@ -3073,7 +3073,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr ) ...@@ -3073,7 +3073,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr )
switch( nRet ) switch( nRet )
{ {
case 'c': case 'c':
if ( aReadParam.GoToTokenParam()>=0 ) if ( aReadParam.GoToTokenParam() )
{ {
const OUString sParams( aReadParam.GetResult() ); const OUString sParams( aReadParam.GetResult() );
// if NO String just ignore the \c // if NO String just ignore the \c
...@@ -3085,7 +3085,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr ) ...@@ -3085,7 +3085,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr )
break; break;
case 'e': case 'e':
{ {
if ( aReadParam.GoToTokenParam()>=0 ) // if NO String just ignore the \e if ( aReadParam.GoToTokenParam() ) // if NO String just ignore the \e
{ {
String sDelimiter( aReadParam.GetResult() ); String sDelimiter( aReadParam.GetResult() );
SwForm aForm( pBase->GetTOXForm() ); SwForm aForm( pBase->GetTOXForm() );
...@@ -3209,7 +3209,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr ) ...@@ -3209,7 +3209,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, String& rStr )
break; break;
case 'p': case 'p':
{ {
if ( aReadParam.GoToTokenParam()>=0 ) // if NO String just ignore the \p if ( aReadParam.GoToTokenParam() ) // if NO String just ignore the \p
{ {
String sDelimiter( aReadParam.GetResult() ); String sDelimiter( aReadParam.GetResult() );
SwForm aForm( pBase->GetTOXForm() ); SwForm aForm( pBase->GetTOXForm() );
...@@ -3634,7 +3634,7 @@ static void lcl_ImportTox(SwDoc &rDoc, SwPaM &rPaM, const String &rStr, bool bId ...@@ -3634,7 +3634,7 @@ static void lcl_ImportTox(SwDoc &rDoc, SwPaM &rPaM, const String &rStr, bool bId
break; break;
case 'f': case 'f':
if ( aReadParam.GoToTokenParam()>=0 ) if ( aReadParam.GoToTokenParam() )
{ {
const OUString sParams( aReadParam.GetResult() ); const OUString sParams( aReadParam.GetResult() );
if( sParams[0]!='C' && sParams[0]!='c' ) if( sParams[0]!='C' && sParams[0]!='c' )
...@@ -3643,7 +3643,7 @@ static void lcl_ImportTox(SwDoc &rDoc, SwPaM &rPaM, const String &rStr, bool bId ...@@ -3643,7 +3643,7 @@ static void lcl_ImportTox(SwDoc &rDoc, SwPaM &rPaM, const String &rStr, bool bId
break; break;
case 'l': case 'l':
if ( aReadParam.GoToTokenParam()>=0 ) if ( aReadParam.GoToTokenParam() )
{ {
const OUString sParams( aReadParam.GetResult() ); const OUString sParams( aReadParam.GetResult() );
// if NO String just ignore the \l // if NO String just ignore the \l
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment