diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:13:41 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:13:41 +0100 |
commit | 0ae2d98d1f6d29c80bd1ee830db4c333e4ee1e1d (patch) | |
tree | d9b77eece17b7b144a4ea50592b639b9f7c87095 /sw/source/uibase/dochdl/gloshdl.cxx | |
parent | 506856ca50e676520bcc80a8b498355663d0388f (diff) |
More loplugin:cstylecast: sw
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files
Change-Id: I0f49d21dfdf82742f11b27709f74294feb1e419e
Diffstat (limited to 'sw/source/uibase/dochdl/gloshdl.cxx')
-rw-r--r-- | sw/source/uibase/dochdl/gloshdl.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx index 2fa820fea16f..494c348a6465 100644 --- a/sw/source/uibase/dochdl/gloshdl.cxx +++ b/sw/source/uibase/dochdl/gloshdl.cxx @@ -126,7 +126,7 @@ void SwGlossaryHdl::SetCurGroup(const OUString &rGrp, bool bApi, bool bAlwaysCre } } const OUString sPath = sGroup.getToken(1, GLOS_DELIM); - sal_uInt16 nComparePath = (sal_uInt16)sPath.toInt32(); + sal_uInt16 nComparePath = static_cast<sal_uInt16>(sPath.toInt32()); if(nCurrentPath == nComparePath && sGroup.getToken(0, GLOS_DELIM) == sCurBase) bPathEqual = true; @@ -277,7 +277,7 @@ OUString SwGlossaryHdl::GetGlossaryShortName(const OUString &rName) if(pTmp) { sal_uInt16 nIdx = pTmp->GetLongIndex( rName ); - if( nIdx != (sal_uInt16) -1 ) + if( nIdx != sal_uInt16(-1) ) sReturn = pTmp->GetShortName( nIdx ); if( !pCurGrp ) delete pTmp; @@ -290,7 +290,7 @@ bool SwGlossaryHdl::HasShortName(const OUString& rShortName) const { SwTextBlocks *pBlock = pCurGrp ? pCurGrp.get() : rStatGlossaries.GetGroupDoc( aCurGrp ); - bool bRet = pBlock->GetIndex( rShortName ) != (sal_uInt16) -1; + bool bRet = pBlock->GetIndex( rShortName ) != sal_uInt16(-1); if( !pCurGrp ) delete pBlock; return bRet; @@ -319,13 +319,13 @@ bool SwGlossaryHdl::NewGlossary(const OUString& rName, const OUString& rShortNam const sal_uInt16 nSuccess = pWrtShell->MakeGlossary( *pTmp, rName, rShortName, rCfg.IsSaveRelFile(), pOnlyText ); - if(nSuccess == (sal_uInt16) -1 ) + if(nSuccess == sal_uInt16(-1) ) { ScopedVclPtrInstance<MessageDialog>(pWrtShell->GetView().GetWindow(), SwResId(STR_ERR_INSERT_GLOS), VclMessageType::Info)->Execute(); } if( !pCurGrp ) delete pTmp; - return nSuccess != (sal_uInt16) -1; + return nSuccess != sal_uInt16(-1); } // Delete a autotext @@ -338,7 +338,7 @@ bool SwGlossaryHdl::DelGlossary(const OUString &rShortName) return false; sal_uInt16 nIdx = pGlossary->GetIndex( rShortName ); - if( nIdx != (sal_uInt16) -1 ) + if( nIdx != sal_uInt16(-1) ) pGlossary->Delete( nIdx ); if( !pCurGrp ) delete pGlossary; @@ -395,7 +395,7 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName, const SvxAutoCorrCfg& rCfg = SvxAutoCorrCfg::Get(); sal_uInt16 nFound = !rCfg.IsSearchInAllCategories() ? pGlossary->GetIndex( aShortName ) : -1; // if not found then search in all groups - if( nFound == (sal_uInt16) -1 ) + if( nFound == sal_uInt16(-1) ) { const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore(); SwGlossaryList* pGlossaryList = ::GetGlossaryList(); @@ -454,7 +454,7 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName, } else { - nFound = (sal_uInt16) -1; + nFound = sal_uInt16(-1); bCancel = true; } } @@ -462,7 +462,7 @@ bool SwGlossaryHdl::Expand( const OUString& rShortName, } // not found - if( nFound == (sal_uInt16) -1 ) + if( nFound == sal_uInt16(-1) ) { if( !bCancel ) { |