diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-30 10:37:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-31 11:56:36 +0200 |
commit | e42166098b13d1bf4f66291550ab326b750bcbed (patch) | |
tree | eba3259fbc143867cf342ad5579619733b861b94 /sw/source/filter/ww8/ww8par5.cxx | |
parent | 0024c48b4822062995effed7db4f1281196384bb (diff) |
loplugin:flatten in sw/filter/ww8
Change-Id: Ia296fc6e6c8f78edf533dedf52996560ae62d143
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99853
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/ww8/ww8par5.cxx')
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 2836ca22dc29..1cc60c27a8af 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2844,66 +2844,66 @@ static void EnsureMaxLevelForTemplates(SwTOXBase& rBase) static void lcl_toxMatchTSwitch(SwWW8ImplReader const & rReader, SwTOXBase& rBase, WW8ReadFieldParams& rParam) { - if ( rParam.GoToTokenParam() ) - { - OUString sParams( rParam.GetResult() ); - if( !sParams.isEmpty() ) - { - sal_Int32 nIndex = 0; + if ( !rParam.GoToTokenParam() ) + return; - // Delimiters between styles and style levels appears to allow both ; and , + OUString sParams( rParam.GetResult() ); + if( sParams.isEmpty() ) + return; - OUString sTemplate( sParams.getToken(0, ';', nIndex) ); - if( -1 == nIndex ) - { - nIndex=0; - sTemplate = sParams.getToken(0, ',', nIndex); - } - if( -1 == nIndex ) - { - const SwFormat* pStyle = rReader.GetStyleWithOrgWWName(sTemplate); - if( pStyle ) - sTemplate = pStyle->GetName(); - // Store Style for Level 0 into TOXBase - rBase.SetStyleNames( sTemplate, 0 ); - } - else while( -1 != nIndex ) - { - sal_Int32 nOldIndex=nIndex; - sal_uInt16 nLevel = static_cast<sal_uInt16>( - sParams.getToken(0, ';', nIndex).toInt32()); - if( -1 == nIndex ) - { - nIndex = nOldIndex; - nLevel = static_cast<sal_uInt16>( - sParams.getToken(0, ',', nIndex).toInt32()); - } + sal_Int32 nIndex = 0; - if( (0 < nLevel) && (MAXLEVEL >= nLevel) ) - { - nLevel--; - // Store Style and Level into TOXBase - const SwFormat* pStyle - = rReader.GetStyleWithOrgWWName( sTemplate ); - - if( pStyle ) - sTemplate = pStyle->GetName(); - - OUString sStyles( rBase.GetStyleNames( nLevel ) ); - if( !sStyles.isEmpty() ) - sStyles += OUStringChar(TOX_STYLE_DELIMITER); - sStyles += sTemplate; - rBase.SetStyleNames( sStyles, nLevel ); - } - // read next style name... - nOldIndex = nIndex; - sTemplate = sParams.getToken(0, ';', nIndex); - if( -1 == nIndex ) - { - nIndex=nOldIndex; - sTemplate = sParams.getToken(0, ',', nIndex); - } - } + // Delimiters between styles and style levels appears to allow both ; and , + + OUString sTemplate( sParams.getToken(0, ';', nIndex) ); + if( -1 == nIndex ) + { + nIndex=0; + sTemplate = sParams.getToken(0, ',', nIndex); + } + if( -1 == nIndex ) + { + const SwFormat* pStyle = rReader.GetStyleWithOrgWWName(sTemplate); + if( pStyle ) + sTemplate = pStyle->GetName(); + // Store Style for Level 0 into TOXBase + rBase.SetStyleNames( sTemplate, 0 ); + } + else while( -1 != nIndex ) + { + sal_Int32 nOldIndex=nIndex; + sal_uInt16 nLevel = static_cast<sal_uInt16>( + sParams.getToken(0, ';', nIndex).toInt32()); + if( -1 == nIndex ) + { + nIndex = nOldIndex; + nLevel = static_cast<sal_uInt16>( + sParams.getToken(0, ',', nIndex).toInt32()); + } + + if( (0 < nLevel) && (MAXLEVEL >= nLevel) ) + { + nLevel--; + // Store Style and Level into TOXBase + const SwFormat* pStyle + = rReader.GetStyleWithOrgWWName( sTemplate ); + + if( pStyle ) + sTemplate = pStyle->GetName(); + + OUString sStyles( rBase.GetStyleNames( nLevel ) ); + if( !sStyles.isEmpty() ) + sStyles += OUStringChar(TOX_STYLE_DELIMITER); + sStyles += sTemplate; + rBase.SetStyleNames( sStyles, nLevel ); + } + // read next style name... + nOldIndex = nIndex; + sTemplate = sParams.getToken(0, ';', nIndex); + if( -1 == nIndex ) + { + nIndex=nOldIndex; + sTemplate = sParams.getToken(0, ',', nIndex); } } } |