summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-04-18 10:17:56 +0000
committerStephan Bergmann <sbergman@redhat.com>2016-04-19 07:08:47 +0000
commit75dcd65a8630c531d3b240b139749faa2e190d9c (patch)
tree91f28d22c68cde9c9778e39c9645bdb374941e0d /sw
parent0d7eb3ed98ebb21bc77f5cbe4997acb6988ddd6e (diff)
cppcheck: silence known condition warning in sw ww8
remove variable bDataImport and if clause correct indentation Change-Id: Ib7dd7b91cecbe9c47a50f7487be055b1247423a1 Reviewed-on: https://gerrit.libreoffice.org/24211 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx98
1 files changed, 47 insertions, 51 deletions
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 957006cec5cb..5d0939d4b49e 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -3424,68 +3424,64 @@ eF_ResT SwWW8ImplReader::Read_F_Shape(WW8FieldDesc* /*pF*/, OUString& /*rStr*/)
eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, OUString& rStr )
{
OUString sURL, sTarget, sMark;
- bool bDataImport = false;
- //HYPERLINK "filename" [switches]
+ //HYPERLINK "filename" [switches]
rStr = comphelper::string::stripEnd(rStr, 1);
- if (!bDataImport)
+ bool bOptions = false;
+ WW8ReadFieldParams aReadParam( rStr );
+ for (;;)
{
- bool bOptions = false;
- WW8ReadFieldParams aReadParam( rStr );
- for (;;)
+ const sal_Int32 nRet = aReadParam.SkipToNextToken();
+ if ( nRet==-1 )
+ break;
+ switch( nRet )
{
- const sal_Int32 nRet = aReadParam.SkipToNextToken();
- if ( nRet==-1 )
+ case -2:
+ if (sURL.isEmpty() && !bOptions)
+ sURL = ConvertFFileName(aReadParam.GetResult());
break;
- switch( nRet )
- {
- case -2:
- if (sURL.isEmpty() && !bOptions)
- sURL = ConvertFFileName(aReadParam.GetResult());
- break;
- case 'n':
- sTarget = "_blank";
- bOptions = true;
- break;
+ case 'n':
+ sTarget = "_blank";
+ bOptions = true;
+ break;
- case 'l':
- bOptions = true;
- if ( aReadParam.SkipToNextToken()==-2 )
+ case 'l':
+ bOptions = true;
+ if ( aReadParam.SkipToNextToken()==-2 )
+ {
+ sMark = aReadParam.GetResult();
+ if( sMark.endsWith("\""))
{
- sMark = aReadParam.GetResult();
- if( sMark.endsWith("\""))
- {
- sMark = sMark.copy( 0, sMark.getLength() - 1 );
- }
- // #120879# add cross reference bookmark name prefix, if it matches internal TOC bookmark naming convention
- if ( IsTOCBookmarkName( sMark ) )
- {
- sMark = EnsureTOCBookmarkName(sMark);
- // track <sMark> as referenced TOC bookmark.
- m_pReffedStck->aReferencedTOCBookmarks.insert( sMark );
- }
+ sMark = sMark.copy( 0, sMark.getLength() - 1 );
+ }
+ // #120879# add cross reference bookmark name prefix, if it matches internal TOC bookmark naming convention
+ if ( IsTOCBookmarkName( sMark ) )
+ {
+ sMark = EnsureTOCBookmarkName(sMark);
+ // track <sMark> as referenced TOC bookmark.
+ m_pReffedStck->aReferencedTOCBookmarks.insert( sMark );
+ }
- if (m_bLoadingTOXCache)
- {
- m_bLoadingTOXHyperlink = true; //on loading a TOC field nested hyperlink field
- }
+ if (m_bLoadingTOXCache)
+ {
+ m_bLoadingTOXHyperlink = true; //on loading a TOC field nested hyperlink field
}
- break;
- case 't':
- bOptions = true;
- if ( aReadParam.SkipToNextToken()==-2 )
- sTarget = aReadParam.GetResult();
- break;
- case 'h':
- case 'm':
- OSL_ENSURE( false, "Auswertung fehlt noch - Daten unbekannt" );
- //fall-through
- case 's': //worthless fake anchor option
- bOptions = true;
- break;
- }
+ }
+ break;
+ case 't':
+ bOptions = true;
+ if ( aReadParam.SkipToNextToken()==-2 )
+ sTarget = aReadParam.GetResult();
+ break;
+ case 'h':
+ case 'm':
+ OSL_ENSURE( false, "Auswertung fehlt noch - Daten unbekannt" );
+ //fall-through
+ case 's': //worthless fake anchor option
+ bOptions = true;
+ break;
}
}