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/ui/dbui | |
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/ui/dbui')
-rw-r--r-- | sw/source/ui/dbui/createaddresslistdialog.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbinsdlg.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmaddressblockpage.cxx | 22 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmlayoutpage.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmoutputtypepage.cxx | 2 |
5 files changed, 17 insertions, 17 deletions
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index 0f61460b4261..6fe3228c63eb 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -673,7 +673,7 @@ IMPL_LINK(SwCreateAddressListDialog, DBCursorHdl_Impl, Button*, pButton, void) } else if(pButton == m_pNextPB) { - if(nValue < (sal_uInt32)m_pSetNoNF->GetMax()) + if(nValue < static_cast<sal_uInt32>(m_pSetNoNF->GetMax())) ++nValue; } else //m_aEndPB @@ -694,7 +694,7 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, DBNumCursorHdl_Impl, Edit&, void) void SwCreateAddressListDialog::UpdateButtons() { sal_uInt32 nCurrent = static_cast< sal_uInt32 >(m_pSetNoNF->GetValue() ); - sal_uInt32 nSize = (sal_uInt32 )m_pCSVData->aDBData.size(); + sal_uInt32 nSize = static_cast<sal_uInt32>(m_pCSVData->aDBData.size()); m_pStartPB->Enable(nCurrent != 1); m_pPrevPB->Enable(nCurrent != 1); m_pNextPB->Enable(nCurrent != nSize); @@ -718,7 +718,7 @@ void SwCreateAddressListDialog::Find(const OUString& rSearch, sal_Int32 nColumn) { std::vector< OUString> const & aData = m_pCSVData->aDBData[nPos]; if(nColumn >=0) - bFound = -1 != aData[(sal_uInt32)nColumn].toAsciiLowerCase().indexOf(sSearch); + bFound = -1 != aData[static_cast<sal_uInt32>(nColumn)].toAsciiLowerCase().indexOf(sSearch); else { for( nElement = 0; nElement < aData.size(); ++nElement) diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 5833e0ff14a6..45eaf435c4ea 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -709,7 +709,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TableFormatHdl, Button*, pButton, void ) { const SwColumn* pCol = &rCols[i]; nStart1 = pCol->GetLeft() + nWidth1; - nWidth1 += (long)rCol.CalcColWidth( i, (sal_uInt16)nWidth ); + nWidth1 += static_cast<long>(rCol.CalcColWidth( i, static_cast<sal_uInt16>(nWidth) )); nEnd1 = nWidth1 - pCol->GetRight(); } if(nStart1 || nEnd1 != nWidth) diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index 084819ca76d9..68b6adde88f7 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -147,7 +147,7 @@ void SwMailMergeAddressBlockPage::ActivatePage() m_pWizard->GetConfigItem().GetAddressBlocks(); for(sal_Int32 nAddress = 0; nAddress < aBlocks.getLength(); ++nAddress) m_pSettingsWIN->AddAddress(aBlocks[nAddress]); - m_pSettingsWIN->SelectAddress((sal_uInt16)rConfigItem.GetCurrentAddressBlockIndex()); + m_pSettingsWIN->SelectAddress(static_cast<sal_uInt16>(rConfigItem.GetCurrentAddressBlockIndex())); m_pAddressCB->Check(rConfigItem.IsAddressBlock()); AddressBlockHdl_Impl(m_pAddressCB); m_pSettingsWIN->SetLayout(1, 2); @@ -515,11 +515,11 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog( m_pFieldFT->Show(); m_pFieldCB->Show(); SvTreeListEntry* pEntry = m_pAddressElementsLB->InsertEntry(SwResId(ST_SALUTATION)); - pEntry->SetUserData(reinterpret_cast<void*>((sal_Int32)USER_DATA_SALUTATION) ); + pEntry->SetUserData(reinterpret_cast<void*>(sal_Int32(USER_DATA_SALUTATION)) ); pEntry = m_pAddressElementsLB->InsertEntry(SwResId(ST_PUNCTUATION)); - pEntry->SetUserData(reinterpret_cast<void*>((sal_Int32)USER_DATA_PUNCTUATION) ); + pEntry->SetUserData(reinterpret_cast<void*>(sal_Int32(USER_DATA_PUNCTUATION)) ); pEntry = m_pAddressElementsLB->InsertEntry(SwResId(ST_TEXT)); - pEntry->SetUserData(reinterpret_cast<void*>((sal_Int32)USER_DATA_TEXT) ); + pEntry->SetUserData(reinterpret_cast<void*>(sal_Int32(USER_DATA_TEXT)) ); for (size_t i = 0; i < SAL_N_ELEMENTS(RA_SALUTATION); ++i) m_aSalutations.push_back(SwResId(RA_SALUTATION[i])); for (size_t i = 0; i < SAL_N_ELEMENTS(RA_PUNCTUATION); ++i) @@ -552,7 +552,7 @@ SwCustomizeAddressBlockDialog::SwCustomizeAddressBlockDialog( for (size_t i = 0; i < rHeaders.size(); ++i) { SvTreeListEntry* pEntry = m_pAddressElementsLB->InsertEntry(rHeaders[i].first); - pEntry->SetUserData(reinterpret_cast<void*>((sal_IntPtr)i)); + pEntry->SetUserData(reinterpret_cast<void*>(static_cast<sal_IntPtr>(i))); } m_pOK->SetClickHdl(LINK(this, SwCustomizeAddressBlockDialog, OKHdl_Impl)); m_pAddressElementsLB->SetSelectHdl(LINK(this, SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl )); @@ -602,7 +602,7 @@ IMPL_LINK_NOARG(SwCustomizeAddressBlockDialog, OKHdl_Impl, Button*, void) IMPL_LINK(SwCustomizeAddressBlockDialog, ListBoxSelectHdl_Impl, SvTreeListBox*, pBox, void) { - sal_Int32 nUserData = (sal_Int32)reinterpret_cast<sal_IntPtr>(pBox->FirstSelected()->GetUserData()); + sal_Int32 nUserData = static_cast<sal_Int32>(reinterpret_cast<sal_IntPtr>(pBox->FirstSelected()->GetUserData())); // Check if the selected entry is already in the address and then forbid inserting m_pInsertFieldIB->Enable(nUserData >= 0 || !HasItem_Impl(nUserData)); } @@ -652,7 +652,7 @@ sal_Int32 SwCustomizeAddressBlockDialog::GetSelectedItem_Impl() const OUString sEntry = m_pAddressElementsLB->GetEntryText(pEntry); if( sEntry == sSelected.copy( 1, sSelected.getLength() - 2 ) ) { - nRet = (sal_Int32)reinterpret_cast<sal_IntPtr>(pEntry->GetUserData()); + nRet = static_cast<sal_Int32>(reinterpret_cast<sal_IntPtr>(pEntry->GetUserData())); break; } } @@ -666,7 +666,7 @@ bool SwCustomizeAddressBlockDialog::HasItem_Impl(sal_Int32 nUserData) for(sal_uLong i = 0; i < m_pAddressElementsLB->GetEntryCount(); ++i) { SvTreeListEntry* pEntry = m_pAddressElementsLB->GetEntry(i); - if((sal_Int32)reinterpret_cast<sal_IntPtr>(pEntry->GetUserData()) == nUserData) + if(static_cast<sal_Int32>(reinterpret_cast<sal_IntPtr>(pEntry->GetUserData())) == nUserData) { sEntry = m_pAddressElementsLB->GetEntryText(pEntry); break; @@ -763,7 +763,7 @@ void SwCustomizeAddressBlockDialog::UpdateImageButtons_Impl() m_pRemoveFieldIB->Enable(m_pDragED->HasCurrentItem()); SvTreeListEntry* pEntry = m_pAddressElementsLB->GetCurEntry(); m_pInsertFieldIB->Enable( pEntry && - (0 < (sal_Int32)reinterpret_cast<sal_IntPtr>(pEntry->GetUserData()) || !m_pFieldCB->GetText().isEmpty())); + (0 < static_cast<sal_Int32>(reinterpret_cast<sal_IntPtr>(pEntry->GetUserData())) || !m_pFieldCB->GetText().isEmpty())); } void SwCustomizeAddressBlockDialog::SetAddress(const OUString& rAddress) @@ -783,7 +783,7 @@ OUString SwCustomizeAddressBlockDialog::GetAddress() { SvTreeListEntry* pEntry = m_pAddressElementsLB->GetEntry(i); const OUString sEntry = "<" + m_pAddressElementsLB->GetEntryText(pEntry) + ">"; - sal_Int32 nUserData = (sal_Int32)reinterpret_cast<sal_IntPtr>(pEntry->GetUserData()); + sal_Int32 nUserData = static_cast<sal_Int32>(reinterpret_cast<sal_IntPtr>(pEntry->GetUserData())); switch(nUserData) { case USER_DATA_SALUTATION: @@ -1294,7 +1294,7 @@ void DDListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ ) rtl::Reference<TransferDataContainer> pContainer = new TransferDataContainer; - sal_Int32 nUserData = (sal_Int32)reinterpret_cast<sal_IntPtr>(pEntry->GetUserData()); + sal_Int32 nUserData = static_cast<sal_Int32>(reinterpret_cast<sal_IntPtr>(pEntry->GetUserData())); //special entries can only be once in the address / greeting if(nUserData >= 0 || !m_pParentDialog->HasItem_Impl(nUserData)) { diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index c37570d6d038..4627abbbac44 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -650,7 +650,7 @@ IMPL_LINK_NOARG(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, SwOneExampleFrame& } Any aZoom; - aZoom <<= (sal_Int16)DocumentZoomType::ENTIRE_PAGE; + aZoom <<= sal_Int16(DocumentZoomType::ENTIRE_PAGE); m_xViewProperties->setPropertyValue(UNO_NAME_ZOOM_TYPE, aZoom); const SwFormatFrameSize& rPageSize = m_pExampleWrtShell->GetPageDesc( diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index 0dd9bedcc917..4fe3d8ea6369 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -573,7 +573,7 @@ void SwSendMailDialog::UpdateTransferStatus() m_pErrorStatus->SetText(sStatus); if(m_pImpl->aDescriptors.size()) - m_pProgressBar->SetValue((sal_uInt16)(m_nSendCount * 100 / m_pImpl->aDescriptors.size())); + m_pProgressBar->SetValue(static_cast<sal_uInt16>(m_nSendCount * 100 / m_pImpl->aDescriptors.size())); else m_pProgressBar->SetValue(0); } |