summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-12 20:25:56 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-12 20:25:56 +0100
commitd597bb77b271a0e9f2c3f4789517435f6b63f170 (patch)
treececc96dcd43d96a3a56b9ec28d55a2f844af0476 /dbaccess/source/ui
parent029149e9b7aa8ad66dca2972e26385c831153c80 (diff)
More loplugin:cstylecast: dbaccess
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: I96df8923f7791288bbd350d75582a9220006ece6
Diffstat (limited to 'dbaccess/source/ui')
-rw-r--r--dbaccess/source/ui/app/AppController.cxx2
-rw-r--r--dbaccess/source/ui/app/AppControllerDnD.cxx2
-rw-r--r--dbaccess/source/ui/app/AppDetailPageHelper.cxx8
-rw-r--r--dbaccess/source/ui/browser/brwctrlr.cxx6
-rw-r--r--dbaccess/source/ui/browser/formadapter.cxx8
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx22
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx14
-rw-r--r--dbaccess/source/ui/dlg/CollectionView.cxx4
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx4
-rw-r--r--dbaccess/source/ui/dlg/TextConnectionHelper.hxx8
-rw-r--r--dbaccess/source/ui/dlg/dbadmin.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dbfindex.cxx6
-rw-r--r--dbaccess/source/ui/dlg/dbwizsetup.cxx2
-rw-r--r--dbaccess/source/ui/dlg/directsql.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dlgattr.cxx2
-rw-r--r--dbaccess/source/ui/dlg/dlgsize.cxx2
-rw-r--r--dbaccess/source/ui/dlg/indexfieldscontrol.cxx6
-rw-r--r--dbaccess/source/ui/dlg/queryfilter.cxx2
-rw-r--r--dbaccess/source/ui/inc/DExport.hxx2
-rw-r--r--dbaccess/source/ui/inc/indexfieldscontrol.hxx2
-rw-r--r--dbaccess/source/ui/misc/DExport.cxx8
-rw-r--r--dbaccess/source/ui/misc/HtmlReader.cxx6
-rw-r--r--dbaccess/source/ui/misc/RtfReader.cxx6
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx10
-rw-r--r--dbaccess/source/ui/querydesign/ConnectionLine.cxx10
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx6
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx6
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx12
-rw-r--r--dbaccess/source/ui/querydesign/TableFieldDescription.cxx8
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx4
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx4
-rw-r--r--dbaccess/source/ui/tabledesign/TableUndo.cxx8
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.cxx2
33 files changed, 98 insertions, 98 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx
index 099ec1bef8d1..c589a2a8803c 100644
--- a/dbaccess/source/ui/app/AppController.cxx
+++ b/dbaccess/source/ui/app/AppController.cxx
@@ -2628,7 +2628,7 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel >
::comphelper::NamedValueCollection aLayoutInfo( m_xDataSource->getPropertyValue( PROPERTY_LAYOUTINFORMATION ) );
if ( aLayoutInfo.has( OUString(INFO_PREVIEW) ) )
{
- const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( INFO_PREVIEW, (sal_Int32)0 ) );
+ const sal_Int32 nPreviewMode( aLayoutInfo.getOrDefault( INFO_PREVIEW, sal_Int32(0) ) );
m_ePreviewMode = static_cast< PreviewMode >( nPreviewMode );
if ( getView() )
getContainer()->switchPreview( m_ePreviewMode );
diff --git a/dbaccess/source/ui/app/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx
index 4cd533fb2b46..940ca99e81ee 100644
--- a/dbaccess/source/ui/app/AppControllerDnD.cxx
+++ b/dbaccess/source/ui/app/AppControllerDnD.cxx
@@ -250,7 +250,7 @@ void OApplicationController::deleteObjects( ElementType _eType, const std::vecto
// #i33353#
OSL_ENSURE( aThisRound->getLength() - 1 >= 0, "OApplicationController::deleteObjects: empty name?" );
OUStringBuffer sSmallestSiblingName( *aThisRound );
- sSmallestSiblingName.append( (sal_Unicode)( '/' + 1) );
+ sSmallestSiblingName.append( sal_Unicode( '/' + 1) );
std::set< OUString >::const_iterator aUpperChildrenBound = aDeleteNames.lower_bound( sSmallestSiblingName.makeStringAndClear() );
for ( std::set< OUString >::const_iterator aObsolete = aThisRound;
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 4dab814aa753..8e4d3931ecc7 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -1263,18 +1263,18 @@ bool OPreviewWindow::ImplGetGraphicCenterRect( const Graphic& rGraphic, tools::R
if( aNewSize.Width() && aNewSize.Height() )
{
// scale to fit window
- const double fGrfWH = (double) aNewSize.Width() / aNewSize.Height();
- const double fWinWH = (double) aWinSize.Width() / aWinSize.Height();
+ const double fGrfWH = static_cast<double>(aNewSize.Width()) / aNewSize.Height();
+ const double fWinWH = static_cast<double>(aWinSize.Width()) / aWinSize.Height();
if ( fGrfWH < fWinWH )
{
- aNewSize.Width() = (long) ( aWinSize.Height() * fGrfWH );
+ aNewSize.Width() = static_cast<long>( aWinSize.Height() * fGrfWH );
aNewSize.Height()= aWinSize.Height();
}
else
{
aNewSize.Width() = aWinSize.Width();
- aNewSize.Height()= (long) ( aWinSize.Width() / fGrfWH);
+ aNewSize.Height()= static_cast<long>( aWinSize.Width() / fGrfWH);
}
const Point aNewPos( ( aWinSize.Width() - aNewSize.Width() ) >> 1,
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index a4d634bf97d7..d917d79333c2 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -746,7 +746,7 @@ bool SbaXDataBrowserController::Construct(vcl::Window* pParent)
// we want to have a grid with a "flat" border
Reference< XPropertySet > xGridSet(m_xGridModel, UNO_QUERY);
if ( xGridSet.is() )
- xGridSet->setPropertyValue(PROPERTY_BORDER, makeAny((sal_Int16)2));
+ xGridSet->setPropertyValue(PROPERTY_BORDER, makeAny(sal_Int16(2)));
// marry them
@@ -2281,7 +2281,7 @@ Reference< XPropertySet > SbaXDataBrowserController::getBoundField() const
return xEmptyReturn;
sal_uInt16 nViewPos = xGrid->getCurrentColumnPosition();
sal_uInt16 nCurrentCol = getBrowserView()->View2ModelPos(nViewPos);
- if (nCurrentCol == (sal_uInt16)-1)
+ if (nCurrentCol == sal_uInt16(-1))
return xEmptyReturn;
// get the according column from the model
@@ -2315,7 +2315,7 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext&, r
if (!IsSearchableControl(xCurrentColumn))
continue;
- sal_uInt16 nModelPos = getBrowserView()->View2ModelPos((sal_uInt16)nViewPos);
+ sal_uInt16 nModelPos = getBrowserView()->View2ModelPos(static_cast<sal_uInt16>(nViewPos));
Reference< XPropertySet > xCurrentColModel(xModelColumns->getByIndex(nModelPos),UNO_QUERY);
OUString aName = ::comphelper::getString(xCurrentColModel->getPropertyValue(PROPERTY_CONTROLSOURCE));
diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx
index 4660111c2c01..52c2b944659b 100644
--- a/dbaccess/source/ui/browser/formadapter.cxx
+++ b/dbaccess/source/ui/browser/formadapter.cxx
@@ -1491,14 +1491,14 @@ sal_Bool SAL_CALL SbaXFormAdapter::hasElements()
// css::container::XIndexContainer
void SAL_CALL SbaXFormAdapter::insertByIndex(sal_Int32 _rIndex, const Any& Element)
{
- if ( ( _rIndex < 0 ) || ( (size_t)_rIndex >= m_aChildren.size() ) )
+ if ( ( _rIndex < 0 ) || ( static_cast<size_t>(_rIndex) >= m_aChildren.size() ) )
throw css::lang::IndexOutOfBoundsException();
implInsert(Element, _rIndex);
}
void SAL_CALL SbaXFormAdapter::removeByIndex(sal_Int32 _rIndex)
{
- if ( ( _rIndex < 0 ) || ( (size_t)_rIndex >= m_aChildren.size() ) )
+ if ( ( _rIndex < 0 ) || ( static_cast<size_t>(_rIndex) >= m_aChildren.size() ) )
throw css::lang::IndexOutOfBoundsException();
Reference< css::form::XFormComponent > xAffected = *(m_aChildren.begin() + _rIndex);
@@ -1527,7 +1527,7 @@ void SAL_CALL SbaXFormAdapter::removeByIndex(sal_Int32 _rIndex)
// css::container::XIndexReplace
void SAL_CALL SbaXFormAdapter::replaceByIndex(sal_Int32 _rIndex, const Any& Element)
{
- if ( ( _rIndex < 0 ) || ( (size_t)_rIndex >= m_aChildren.size() ) )
+ if ( ( _rIndex < 0 ) || ( static_cast<size_t>(_rIndex) >= m_aChildren.size() ) )
throw css::lang::IndexOutOfBoundsException();
// extract the form component
@@ -1594,7 +1594,7 @@ sal_Int32 SAL_CALL SbaXFormAdapter::getCount()
Any SAL_CALL SbaXFormAdapter::getByIndex(sal_Int32 _rIndex)
{
- if ( ( _rIndex < 0 ) || ( (size_t)_rIndex >= m_aChildren.size() ) )
+ if ( ( _rIndex < 0 ) || ( static_cast<size_t>(_rIndex) >= m_aChildren.size() ) )
throw css::lang::IndexOutOfBoundsException();
Reference< css::form::XFormComponent > xElement = *(m_aChildren.begin() + _rIndex);
diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 3d0e8a75aa46..5fe3ed5315af 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -646,7 +646,7 @@ void SbaGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rM
}
// prepend some new items
- bool bColAttrs = (nColId != (sal_uInt16)-1) && (nColId != 0);
+ bool bColAttrs = (nColId != sal_uInt16(-1)) && (nColId != 0);
if ( bColAttrs && !bDBIsReadOnly)
{
sal_uInt16 nPos = 0;
@@ -785,7 +785,7 @@ void SbaGridControl::SetColWidth(sal_uInt16 nColId)
sal_uInt16 nModelPos = GetModelColumnPos(nColId);
Reference< XIndexAccess > xCols(GetPeer()->getColumns(), UNO_QUERY);
Reference< XPropertySet > xAffectedCol;
- if (xCols.is() && (nModelPos != (sal_uInt16)-1))
+ if (xCols.is() && (nModelPos != sal_uInt16(-1)))
xAffectedCol.set(xCols->getByIndex(nModelPos), css::uno::UNO_QUERY);
if (xAffectedCol.is())
@@ -827,7 +827,7 @@ void SbaGridControl::SetRowHeight()
{
sal_Int32 nValue = aDlgRowHeight->GetValue();
Any aNewHeight;
- if ((sal_Int16)-1 == nValue)
+ if (sal_Int16(-1) == nValue)
{ // set to default
Reference< XPropertyState > xPropState(xCols, UNO_QUERY);
if (xPropState.is())
@@ -864,7 +864,7 @@ void SbaGridControl::SetColAttrs(sal_uInt16 nColId)
// get the (UNO) column model
Reference< XIndexAccess > xCols(GetPeer()->getColumns(), UNO_QUERY);
Reference< XPropertySet > xAffectedCol;
- if (xCols.is() && (nModelPos != (sal_uInt16)-1))
+ if (xCols.is() && (nModelPos != sal_uInt16(-1)))
xAffectedCol.set(xCols->getByIndex(nModelPos), css::uno::UNO_QUERY);
// get the field the column is bound to
@@ -1008,10 +1008,10 @@ void SbaGridControl::MouseButtonDown( const BrowserMouseEvent& rMEvt)
{
long nRow = GetRowAtYPosPixel(rMEvt.GetPosPixel().Y());
sal_uInt16 nColPos = GetColumnAtXPosPixel(rMEvt.GetPosPixel().X());
- sal_uInt16 nViewPos = (nColPos == BROWSER_INVALIDID) ? (sal_uInt16)-1 : nColPos-1;
+ sal_uInt16 nViewPos = (nColPos == BROWSER_INVALIDID) ? sal_uInt16(-1) : nColPos-1;
// 'the handle column' and 'no valid column' will both result in a view position of -1 !
- bool bHitEmptySpace = (nRow > GetRowCount()) || (nViewPos == (sal_uInt16)-1);
+ bool bHitEmptySpace = (nRow > GetRowCount()) || (nViewPos == sal_uInt16(-1));
if (bHitEmptySpace && (rMEvt.GetClicks() == 2) && rMEvt.IsMod1())
Control::MouseButtonDown(rMEvt);
@@ -1034,7 +1034,7 @@ void SbaGridControl::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel )
// my laziness says 'do it here'...)
long nRow = GetRowAtYPosPixel(_rPosPixel.Y());
sal_uInt16 nColPos = GetColumnAtXPosPixel(_rPosPixel.X());
- sal_uInt16 nViewPos = (nColPos == BROWSER_INVALIDID) ? (sal_uInt16)-1 : nColPos-1;
+ sal_uInt16 nViewPos = (nColPos == BROWSER_INVALIDID) ? sal_uInt16(-1) : nColPos-1;
// 'the handle column' and 'no valid column' will both result in a view position of -1 !
bool bCurrentRowVirtual = IsCurrentAppending() && IsModified();
@@ -1076,7 +1076,7 @@ void SbaGridControl::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel )
SelectAll();
getMouseEvent().Clear();
- implTransferSelectedRows((sal_Int16)nRow, false);
+ implTransferSelectedRows(static_cast<sal_Int16>(nRow), false);
bHandled = true;
}
@@ -1101,7 +1101,7 @@ void SbaGridControl::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel )
GetDataWindow().ReleaseMouse();
getMouseEvent().Clear();
- DoFieldDrag(nViewPos, (sal_Int16)nRow);
+ DoFieldDrag(nViewPos, static_cast<sal_Int16>(nRow));
bHandled = true;
}
@@ -1150,7 +1150,7 @@ void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos)
void SbaGridControl::CopySelectedRowsToClipboard()
{
OSL_ENSURE( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" );
- implTransferSelectedRows( (sal_Int16)FirstSelectedRow(), true );
+ implTransferSelectedRows( static_cast<sal_Int16>(FirstSelectedRow()), true );
}
void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag )
@@ -1166,7 +1166,7 @@ void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfC
if ((GetSelectRowCount() == 0) && (nRowPos >= 0))
{
aSelectedRows.realloc( 1 );
- aSelectedRows[0] <<= (sal_Int32)(nRowPos + 1);
+ aSelectedRows[0] <<= static_cast<sal_Int32>(nRowPos + 1);
bSelectionBookmarks = false;
}
else if ( !IsAllSelected() && GetSelectRowCount() )
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index 689c4d2fc480..a66d68ff612b 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -697,7 +697,7 @@ bool SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm
makeAny( ColumnValue::NO_NULLS != nNullable )
);
if ( ColumnValue::NO_NULLS == nNullable )
- aDefault <<= (sal_Int16)TRISTATE_FALSE;
+ aDefault <<= sal_Int16(TRISTATE_FALSE);
}
break;
@@ -746,9 +746,9 @@ bool SbaTableQueryBrowser::InitializeGridModel(const Reference< css::form::XForm
if ( nType == DataType::BIT || nType == DataType::BOOLEAN )
{
if ( aDefault.hasValue() )
- aDefault <<= (comphelper::getString(aDefault).toInt32() == 0) ? (sal_Int16)TRISTATE_FALSE : (sal_Int16)TRISTATE_TRUE;
+ aDefault <<= (comphelper::getString(aDefault).toInt32() == 0) ? sal_Int16(TRISTATE_FALSE) : sal_Int16(TRISTATE_TRUE);
else
- aDefault <<= (sal_Int16)TRISTATE_INDET;
+ aDefault <<= sal_Int16(TRISTATE_INDET);
}
}
@@ -856,7 +856,7 @@ void SbaTableQueryBrowser::propertyChange(const PropertyChangeEvent& evt)
if(xProp.is())
{
if(!evt.NewValue.hasValue())
- xProp->setPropertyValue(PROPERTY_WIDTH,makeAny((sal_Int32)227));
+ xProp->setPropertyValue(PROPERTY_WIDTH,makeAny(sal_Int32(227)));
else
xProp->setPropertyValue(PROPERTY_WIDTH,evt.NewValue);
}
@@ -918,7 +918,7 @@ void SbaTableQueryBrowser::propertyChange(const PropertyChangeEvent& evt)
bool bDefault = !evt.NewValue.hasValue();
if (bDefault)
- pData->xObjectProperties->setPropertyValue(PROPERTY_ROW_HEIGHT,makeAny((sal_Int32)45));
+ pData->xObjectProperties->setPropertyValue(PROPERTY_ROW_HEIGHT,makeAny(sal_Int32(45)));
else
pData->xObjectProperties->setPropertyValue(PROPERTY_ROW_HEIGHT,evt.NewValue);
}
@@ -1935,7 +1935,7 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue
Any* pSelectionNos = aSelection.getArray();
while (nIdx >= 0)
{
- *pSelectionNos++ <<= (sal_Int32)(nIdx + 1);
+ *pSelectionNos++ <<= static_cast<sal_Int32>(nIdx + 1);
nIdx = pSelection->NextSelected();
}
}
@@ -2747,7 +2747,7 @@ void SAL_CALL SbaTableQueryBrowser::elementInserted( const ContainerEvent& _rEve
}
else
{
- if ((sal_Int32)m_pTreeView->getListBox().GetChildCount(pEntry) < ( xNames->getElementNames().getLength() - 1 ) )
+ if (static_cast<sal_Int32>(m_pTreeView->getListBox().GetChildCount(pEntry)) < ( xNames->getElementNames().getLength() - 1 ) )
{
// the item inserts its children on demand, but it has not been expanded yet. So ensure here and
// now that it has all items
diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx
index 94d38e3a76f9..372a65f79598 100644
--- a/dbaccess/source/ui/dlg/CollectionView.cxx
+++ b/dbaccess/source/ui/dlg/CollectionView.cxx
@@ -275,9 +275,9 @@ void OCollectionView::initCurrentPath()
static const char s_sReportsCID[] = "private:reports";
m_bCreateForm = s_sFormsCID == sCID;
OUString sPath("/");
- if ( m_bCreateForm && sCID.getLength() != (sal_Int32)strlen(s_sFormsCID))
+ if ( m_bCreateForm && sCID.getLength() != static_cast<sal_Int32>(strlen(s_sFormsCID)))
sPath = sCID.copy(strlen(s_sFormsCID));
- else if ( !m_bCreateForm && sCID.getLength() != (sal_Int32)strlen(s_sReportsCID) )
+ else if ( !m_bCreateForm && sCID.getLength() != static_cast<sal_Int32>(strlen(s_sReportsCID)) )
sPath = sCID.copy(strlen(s_sReportsCID) - 2);
m_pFTCurrentPath->SetText(sPath);
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 78249cacf006..1ff255712dd4 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -653,7 +653,7 @@ void ODbDataSourceAdministrationHelper::translateProperties(const SfxItemSet& _r
++aDirect
)
{
- const SfxPoolItem* pCurrentItem = _rSource.GetItem((sal_uInt16)aDirect->first);
+ const SfxPoolItem* pCurrentItem = _rSource.GetItem(static_cast<sal_uInt16>(aDirect->first));
if (pCurrentItem)
{
sal_Int16 nAttributes = PropertyAttribute::READONLY;
@@ -709,7 +709,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS
std::vector< sal_Int32>::const_iterator aDetailsEnd = aDetailIds.end();
for (std::vector< sal_Int32>::const_iterator aIter = aDetailIds.begin();aIter != aDetailsEnd ; ++aIter)
{
- const SfxPoolItem* pCurrent = _rSource.GetItem((sal_uInt16)*aIter);
+ const SfxPoolItem* pCurrent = _rSource.GetItem(static_cast<sal_uInt16>(*aIter));
aTranslation = m_aIndirectPropTranslator.find(*aIter);
if ( pCurrent && (m_aIndirectPropTranslator.end() != aTranslation) )
{
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx
index 8a134b5c84f7..a05b95107716 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.hxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.hxx
@@ -34,10 +34,10 @@ namespace dbaui
{
- #define TC_EXTENSION ((short)0x01) // a section specifying the extension of the files to connect to
- #define TC_SEPARATORS ((short)0x02) // a section specifying the various separators
- #define TC_HEADER ((short)0x04) // a section containing the "Text contains header" check box only
- #define TC_CHARSET ((short)0x08) // not yet implemented
+ #define TC_EXTENSION (short(0x01)) // a section specifying the extension of the files to connect to
+ #define TC_SEPARATORS (short(0x02)) // a section specifying the various separators
+ #define TC_HEADER (short(0x04)) // a section containing the "Text contains header" check box only
+ #define TC_CHARSET (short(0x08)) // not yet implemented
// OTextConnectionPage
class OTextConnectionHelper final : public TabPage
diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx
index 6c92062ef60e..5d55c2b1cf6a 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -189,7 +189,7 @@ void ODbAdminDialog::impl_resetPages(const Reference< XPropertySet >& _rxDatasou
aIndirect != rMap.end();
++aIndirect
)
- GetInputSetImpl()->ClearItem( (sal_uInt16)aIndirect->first );
+ GetInputSetImpl()->ClearItem( static_cast<sal_uInt16>(aIndirect->first) );
// extract all relevant data from the property set of the data source
m_pImpl->translateProperties(_rxDatasource, *GetInputSetImpl());
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx
index 0a496280ba2f..0c644aab2f2d 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -124,10 +124,10 @@ OTableIndex ODbaseIndexDialog::implRemoveIndex(const OUString& _rName, TableInde
_rDisplay.RemoveEntry( _rName );
// adjust selection if necessary
- if ((sal_uInt32)nPos == _rList.size())
- _rDisplay.SelectEntryPos((sal_uInt16)nPos-1);
+ if (static_cast<sal_uInt32>(nPos) == _rList.size())
+ _rDisplay.SelectEntryPos(static_cast<sal_uInt16>(nPos)-1);
else
- _rDisplay.SelectEntryPos((sal_uInt16)nPos);
+ _rDisplay.SelectEntryPos(static_cast<sal_uInt16>(nPos));
break;
}
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index 5392fc408700..b0df0e5fbbda 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -387,7 +387,7 @@ void ODbTypeWizDialogSetup::resetPages(const Reference< XPropertySet >& _rxDatas
aIndirect != rMap.end();
++aIndirect
)
- getWriteOutputSet()->ClearItem( (sal_uInt16)aIndirect->first );
+ getWriteOutputSet()->ClearItem( static_cast<sal_uInt16>(aIndirect->first) );
// extract all relevant data from the property set of the data source
m_pImpl->translateProperties(_rxDatasource, *getWriteOutputSet());
diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx
index 8ea220d90d8e..c5adf93792b2 100644
--- a/dbaccess/source/ui/dlg/directsql.cxx
+++ b/dbaccess/source/ui/dlg/directsql.cxx
@@ -135,7 +135,7 @@ namespace dbaui
{
m_aStatementHistory.pop_front();
m_aNormalizedHistory.pop_front();
- m_pSQLHistory->RemoveEntry((sal_uInt16)0);
+ m_pSQLHistory->RemoveEntry(sal_uInt16(0));
}
}
diff --git a/dbaccess/source/ui/dlg/dlgattr.cxx b/dbaccess/source/ui/dlg/dlgattr.cxx
index 9562f4bab3dd..e370b53b32ec 100644
--- a/dbaccess/source/ui/dlg/dlgattr.cxx
+++ b/dbaccess/source/ui/dlg/dlgattr.cxx
@@ -64,7 +64,7 @@ void SbaSbAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
if (nPageId == m_nNumberFormatId)
{
- aSet.Put (SvxNumberInfoItem( pNumberInfoItem->GetNumberFormatter(), (sal_uInt16)SID_ATTR_NUMBERFORMAT_INFO));
+ aSet.Put (SvxNumberInfoItem( pNumberInfoItem->GetNumberFormatter(), static_cast<sal_uInt16>(SID_ATTR_NUMBERFORMAT_INFO)));
rTabPage.PageCreated(aSet);
}
}
diff --git a/dbaccess/source/ui/dlg/dlgsize.cxx b/dbaccess/source/ui/dlg/dlgsize.cxx
index b1b1df3b20f5..e7480552f3e3 100644
--- a/dbaccess/source/ui/dlg/dlgsize.cxx
+++ b/dbaccess/source/ui/dlg/dlgsize.cxx
@@ -73,7 +73,7 @@ sal_Int32 DlgSize::GetValue()
{
if (m_pCB_STANDARD->IsChecked())
return -1;
- return (sal_Int32)m_pMF_VALUE->GetValue( FUNIT_CM );
+ return static_cast<sal_Int32>(m_pMF_VALUE->GetValue( FUNIT_CM ));
}
IMPL_LINK( DlgSize, CbClickHdl, Button *, pButton, void )
diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
index a717e0b069cc..75119429fc9c 100644
--- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
+++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx
@@ -277,7 +277,7 @@ namespace dbaui
bool IndexFieldsControl::implGetFieldDesc(long _nRow, IndexFields::const_iterator& _rPos)
{
_rPos = m_aFields.end();
- if ((_nRow < 0) || (_nRow >= (sal_Int32)m_aFields.size()))
+ if ((_nRow < 0) || (_nRow >= static_cast<sal_Int32>(m_aFields.size())))
return false;
_rPos = m_aFields.begin() + _nRow;
return true;
@@ -308,7 +308,7 @@ namespace dbaui
else
{
sal_Int32 nRow = GetCurRow();
- OSL_ENSURE(nRow < (sal_Int32)m_aFields.size(), "IndexFieldsControl::SaveModified: invalid current row!");
+ OSL_ENSURE(nRow < static_cast<sal_Int32>(m_aFields.size()), "IndexFieldsControl::SaveModified: invalid current row!");
if (nRow >= 0) // may be -1 in case the control was empty
{
// remove the field from the selection
@@ -388,7 +388,7 @@ namespace dbaui
sal_Int32 nCurrentRow = GetCurRow();
sal_Int32 rowCount = GetRowCount();
- OSL_ENSURE(((sal_Int32)(m_aFields.size() + 1)) == rowCount, "IndexFieldsControl::OnListEntrySelected: inconsistence!");
+ OSL_ENSURE((static_cast<sal_Int32>(m_aFields.size() + 1)) == rowCount, "IndexFieldsControl::OnListEntrySelected: inconsistence!");
if (!sSelectedEntry.isEmpty() && (nCurrentRow == rowCount - 1) /*&& (!m_nMaxColumnsInIndex || rowCount < m_nMaxColumnsInIndex )*/ )
{ // in the last row, an non-empty string has been selected
diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx
index 4e94ca5e1166..5a2a7ba3e33c 100644
--- a/dbaccess/source/ui/dlg/queryfilter.cxx
+++ b/dbaccess/source/ui/dlg/queryfilter.cxx
@@ -518,7 +518,7 @@ void DlgFilterCrit::SetLine( int nIdx, const PropertyValue& _rItem, bool _bOr )
ListSelectHdl( *pColumnListControl );
// select the appropriate condition
- pPredicateListControl->SelectEntryPos( GetSelectionPos( (sal_Int32)_rItem.Handle, *pPredicateListControl ) );
+ pPredicateListControl->SelectEntryPos( GetSelectionPos( static_cast<sal_Int32>(_rItem.Handle), *pPredicateListControl ) );
// initially normalize this value
OUString aString( aStr );
diff --git a/dbaccess/source/ui/inc/DExport.hxx b/dbaccess/source/ui/inc/DExport.hxx
index 5cc28b790f0d..0224943fbd53 100644
--- a/dbaccess/source/ui/inc/DExport.hxx
+++ b/dbaccess/source/ui/inc/DExport.hxx
@@ -50,7 +50,7 @@ namespace com { namespace sun { namespace star {
}
}}}
-#define COLUMN_POSITION_NOT_FOUND ((sal_Int32)-1)
+#define COLUMN_POSITION_NOT_FOUND (sal_Int32(-1))
class SvNumberFormatter;
namespace dbaui
diff --git a/dbaccess/source/ui/inc/indexfieldscontrol.hxx b/dbaccess/source/ui/inc/indexfieldscontrol.hxx
index 4ec3f9906227..33b5ebc41c87 100644
--- a/dbaccess/source/ui/inc/indexfieldscontrol.hxx
+++ b/dbaccess/source/ui/inc/indexfieldscontrol.hxx
@@ -80,7 +80,7 @@ namespace dbaui
OUString GetRowCellText(const IndexFields::const_iterator& _rRow,sal_uInt16 nColId) const;
bool implGetFieldDesc(long _nRow, IndexFields::const_iterator& _rPos);
- bool isNewField() const { return GetCurRow() >= (sal_Int32)m_aFields.size(); }
+ bool isNewField() const { return GetCurRow() >= static_cast<sal_Int32>(m_aFields.size()); }
DECL_LINK( OnListEntrySelected, DbaMouseDownListBoxController&, void );
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index b9c7998a8d4c..6780a35fd4cc 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -232,7 +232,7 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection,
m_pTypeInfo->aCreateParams = aValue;
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- m_pTypeInfo->bNullable = (sal_Int32)aValue == ColumnValue::NULLABLE;
+ m_pTypeInfo->bNullable = static_cast<sal_Int32>(aValue) == ColumnValue::NULLABLE;
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
// bCaseSensitive
@@ -653,7 +653,7 @@ void ODatabaseExport::CreateDefaultColumn(const OUString& _rColumnName)
OFieldDescription* pField = new OFieldDescription();
pField->SetType(m_pTypeInfo);
pField->SetName(aAlias);
- pField->SetPrecision(std::min<sal_Int32>((sal_Int32)255,m_pTypeInfo->nPrecision));
+ pField->SetPrecision(std::min<sal_Int32>(sal_Int32(255),m_pTypeInfo->nPrecision));
pField->SetScale(0);
pField->SetIsNullable(ColumnValue::NULLABLE);
pField->SetAutoIncrement(false);
@@ -772,7 +772,7 @@ void ODatabaseExport::adjustFormat()
OSL_ENSURE((nColPos) < static_cast<sal_Int32>(m_vNumberFormat.size()),"m_vFormatKey: Illegal index for vector");
OSL_ENSURE((nColPos) < static_cast<sal_Int32>(m_vColumnSize.size()),"m_vColumnSize: Illegal index for vector");
m_vNumberFormat[nColPos] = CheckString(m_sTextToken,m_vNumberFormat[nColPos]);
- m_vColumnSize[nColPos] = std::max<sal_Int32>((sal_Int32)m_vColumnSize[nColPos], m_sTextToken.getLength());
+ m_vColumnSize[nColPos] = std::max<sal_Int32>(static_cast<sal_Int32>(m_vColumnSize[nColPos]), m_sTextToken.getLength());
}
}
eraseTokens();
@@ -831,7 +831,7 @@ Reference< XPreparedStatement > ODatabaseExport::createPreparedStatment( const R
{
ODatabaseExport::TPositions::const_iterator aFind = std::find_if(_rvColumns.begin(),_rvColumns.end(),
[j] (const ODatabaseExport::TPositions::value_type& tPos)
- { return tPos.second == (sal_Int32)(j+1); });
+ { return tPos.second == static_cast<sal_Int32>(j+1); });
if ( _rvColumns.end() != aFind && aFind->second != COLUMN_POSITION_NOT_FOUND && aFind->first != COLUMN_POSITION_NOT_FOUND )
{
OSL_ENSURE((aFind->first) < static_cast<sal_Int32>(aInsertList.size()),"aInsertList: Illegal index for vector");
diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx
index 9493af953f17..2892205962e1 100644
--- a/dbaccess/source/ui/misc/HtmlReader.cxx
+++ b/dbaccess/source/ui/misc/HtmlReader.cxx
@@ -354,7 +354,7 @@ void OHTMLReader::TableFontOn(FontDescriptor& _rFont,sal_Int32 &_rTextColor)
break;
case HtmlOptionId::SIZE :
{
- sal_Int16 nSize = (sal_Int16) rOption.GetNumber();
+ sal_Int16 nSize = static_cast<sal_Int16>(rOption.GetNumber());
if ( nSize == 0 )
nSize = 1;
else if ( nSize < DBAUI_HTML_FONTSIZES )
@@ -374,7 +374,7 @@ sal_Int16 OHTMLReader::GetWidthPixel( const HTMLOption& rOption )
if ( rOptVal.indexOf('%') != -1 )
{ // percentage
OSL_ENSURE( m_nColumnWidth, "WIDTH Option: m_nColumnWidth==0 and Width%" );
- return (sal_Int16)((rOption.GetNumber() * m_nColumnWidth) / 100);
+ return static_cast<sal_Int16>((rOption.GetNumber() * m_nColumnWidth) / 100);
}
else
{
@@ -384,7 +384,7 @@ sal_Int16 OHTMLReader::GetWidthPixel( const HTMLOption& rOption )
return 0;
}
else
- return (sal_Int16)rOption.GetNumber(); // pixel
+ return static_cast<sal_Int16>(rOption.GetNumber()); // pixel
}
}
diff --git a/dbaccess/source/ui/misc/RtfReader.cxx b/dbaccess/source/ui/misc/RtfReader.cxx
index 86cc730bd126..0c0d6d6edc65 100644
--- a/dbaccess/source/ui/misc/RtfReader.cxx
+++ b/dbaccess/source/ui/misc/RtfReader.cxx
@@ -114,9 +114,9 @@ void ORTFReader::NextToken( int nToken )
{
switch(nTmpToken2)
{
- case RTF_RED: aColor.SetRed((sal_uInt8)nTokenValue); break;
- case RTF_BLUE: aColor.SetBlue((sal_uInt8)nTokenValue); break;
- case RTF_GREEN: aColor.SetGreen((sal_uInt8)nTokenValue); break;
+ case RTF_RED: aColor.SetRed(static_cast<sal_uInt8>(nTokenValue)); break;
+ case RTF_BLUE: aColor.SetBlue(static_cast<sal_uInt8>(nTokenValue)); break;
+ case RTF_GREEN: aColor.SetGreen(static_cast<sal_uInt8>(nTokenValue)); break;
default: break;
}
nTmpToken2 = GetNextToken();
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index ee94235457fb..ca8f0ef4c2fd 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -478,7 +478,7 @@ void fillTypeInfo( const Reference< css::sdbc::XConnection>& _rxConnection,
pInfo->aCreateParams = aValue;
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->bNullable = (sal_Int32)aValue == ColumnValue::NULLABLE;
+ pInfo->bNullable = static_cast<sal_Int32>(aValue) == ColumnValue::NULLABLE;
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
// bCaseSensitive
@@ -490,10 +490,10 @@ void fillTypeInfo( const Reference< css::sdbc::XConnection>& _rxConnection,
// bUnsigned
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->bCurrency = (bool)aValue;
+ pInfo->bCurrency = static_cast<bool>(aValue);
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
- pInfo->bAutoIncrement = (bool)aValue;
+ pInfo->bAutoIncrement = static_cast<bool>(aValue);
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
pInfo->aLocalTypeName = aValue;
@@ -769,7 +769,7 @@ void callColumnFormatDialog(const Reference<XPropertySet>& xAffectedCol,
if(callColumnFormatDialog(_pParent,_pFormatter,nDataType,nFormatKey,eJustify,bHasFormat))
{
- xAffectedCol->setPropertyValue(PROPERTY_ALIGN, makeAny((sal_Int16)dbaui::mapTextAllign(eJustify)));
+ xAffectedCol->setPropertyValue(PROPERTY_ALIGN, makeAny(static_cast<sal_Int16>(dbaui::mapTextAllign(eJustify))));
if (bHasFormat)
xAffectedCol->setPropertyValue(PROPERTY_FORMATKEY, makeAny(nFormatKey));
@@ -865,7 +865,7 @@ bool callColumnFormatDialog(vcl::Window* _pParent,
if (_bHasFormat)
{
const SfxUInt32Item* pFormat = pSet->GetItem<SfxUInt32Item>(SBA_DEF_FMTVALUE);
- _nFormatKey = (sal_Int32)pFormat->GetValue();
+ _nFormatKey = static_cast<sal_Int32>(pFormat->GetValue());
}
bRet = true;
}
diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx
index 2809c4d761e1..9c276b804bec 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx
@@ -91,10 +91,10 @@ namespace
if( nEntryPos >= 0 )
{
_rNewConPos.Y() += nEntryPos;
- _rNewConPos.Y() += (long)( 0.5 * nRowHeight );
+ _rNewConPos.Y() += static_cast<long>( 0.5 * nRowHeight );
}
else
- _rNewConPos.Y() -= (long)( 0.5 * nRowHeight );
+ _rNewConPos.Y() -= static_cast<long>( 0.5 * nRowHeight );
long nListBoxBottom = _pWin->GetPosPixel().Y()
+ pListBox->GetPosPixel().Y()
@@ -221,8 +221,8 @@ bool OConnectionLine::RecalcLine()
Point aSourceCenter( 0, 0 );
Point aDestCenter( 0, 0 );
- aSourceCenter.X() = pSourceWin->GetPosPixel().X() + (long)( 0.5*pSourceWin->GetSizePixel().Width() );
- aDestCenter.X() = pDestWin->GetPosPixel().X() + (long)( 0.5*pDestWin->GetSizePixel().Width() );
+ aSourceCenter.X() = pSourceWin->GetPosPixel().X() + static_cast<long>( 0.5*pSourceWin->GetSizePixel().Width() );
+ aDestCenter.X() = pDestWin->GetPosPixel().X() + static_cast<long>( 0.5*pDestWin->GetSizePixel().Width() );
const OTableWindow* pFirstWin = pDestWin;
const OTableWindow* pSecondWin = pSourceWin;
@@ -296,7 +296,7 @@ double dist_Euklid(const Point &p1, const Point& p2,const Point& pM, Point& q)
{
Point v(p2 - p1);
Point w(pM - p1);
- double a = sqrt((double)(v.X()*v.X() + v.Y()*v.Y()));
+ double a = sqrt(static_cast<double>(v.X()*v.X() + v.Y()*v.Y()));
double l = (v.X() * w.Y() - v.Y() * w.X()) / a;
double a2 = w.X()*v.X()+w.Y()*v.Y();
a = a2 / (a * a);
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 26fe97d7423a..f218e2ba0c6a 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -397,7 +397,7 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin )
pTabWin->disposeOnce();
}
- if ( (sal_Int32)m_vTableConnection.size() < (nCount-1) ) // if some connections could be removed
+ if ( static_cast<sal_Int32>(m_vTableConnection.size()) < (nCount-1) ) // if some connections could be removed
modified();
}
@@ -1116,7 +1116,7 @@ bool OJoinTableView::IsAddAllowed()
Reference < XDatabaseMetaData > xMetaData( xConnection->getMetaData() );
sal_Int32 nMax = xMetaData.is() ? xMetaData->getMaxTablesInSelect() : 0;
- if (nMax && nMax <= (sal_Int32)m_aTableMap.size())
+ if (nMax && nMax <= static_cast<sal_Int32>(m_aTableMap.size()))
return false;
}
catch(SQLException&)
@@ -1335,7 +1335,7 @@ bool OJoinTableView::PreNotify(NotifyEvent& rNEvt)
DeselectConn(GetSelectedConn());
else
// no win for any reason -> select the next or previous conn
- if (i < (sal_Int32)m_vTableConnection.size())
+ if (i < static_cast<sal_Int32>(m_vTableConnection.size()))
// there is a currently active conn
pNextConn = m_vTableConnection[(i + (bForward ? 1 : m_vTableConnection.size() - 1)) % m_vTableConnection.size()].get();
else
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 482133b88553..d8f7489a13ca 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -721,7 +721,7 @@ namespace
OTableFields::const_iterator aEnd = _rFieldList.end();
for(;aIter != aEnd;++aIter)
{
- nMaxCriteria = std::max<sal_uInt16>(nMaxCriteria,(sal_uInt16)(*aIter)->GetCriteria().size());
+ nMaxCriteria = std::max<sal_uInt16>(nMaxCriteria,static_cast<sal_uInt16>((*aIter)->GetCriteria().size()));
}
try
{
@@ -936,7 +936,7 @@ namespace
{
aWorkStr += quoteTableAlias(bMulti,pEntryField->GetAlias(),aQuote) + ::dbtools::quoteName(aQuote, aColumnName);
}
- aWorkStr += " " + OUString( ";ASC;DESC" ).getToken( (sal_uInt16)eOrder, ';' ) + ",";
+ aWorkStr += " " + OUString( ";ASC;DESC" ).getToken( static_cast<sal_uInt16>(eOrder), ';' ) + ",";
}
}
@@ -1945,7 +1945,7 @@ namespace
try
{
sal_Int32 nMax = xMetaData->getMaxTablesInSelect();
- if ( nMax && nMax < (sal_Int32)aMap.size() )
+ if ( nMax && nMax < static_cast<sal_Int32>(aMap.size()) )
{
eErrorCode = eTooManyTables;
break;
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 514a4bbe3f97..07d27d06147c 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -1010,7 +1010,7 @@ bool OSelectionBrowseBox::SaveModified()
case BROW_ORDER_ROW:
{
- strOldCellContents = OUString::number((sal_uInt16)pEntry->GetOrderDir());
+ strOldCellContents = OUString::number(static_cast<sal_uInt16>(pEntry->GetOrderDir()));
sal_Int32 nIdx = m_pOrderCell->GetSelectedEntryPos();
if (nIdx == LISTBOX_ENTRY_NOTFOUND)
nIdx = 0;
@@ -1021,7 +1021,7 @@ bool OSelectionBrowseBox::SaveModified()
m_pVisibleCell->GetBox().Check();
RowModified(GetBrowseRow(BROW_VIS_ROW), GetCurColumnId());
}
- sNewValue = OUString::number((sal_uInt16)pEntry->GetOrderDir());
+ sNewValue = OUString::number(static_cast<sal_uInt16>(pEntry->GetOrderDir()));
} break;
case BROW_COLUMNALIAS_ROW:
@@ -1280,8 +1280,8 @@ void OSelectionBrowseBox::RemoveField(sal_uInt16 nColumnId )
sal_uInt16 nPos = GetColumnPos(nColumnId);
OSL_ENSURE(getFields().size() > sal_uInt16(nPos-1),"ID is to great!");
- OTableFieldDescRef pDesc = getEntry((sal_uInt32)(nPos - 1)) ;
- pDesc->SetColWidth( (sal_uInt16)GetColumnWidth(nColumnId) ); // was not stored this before
+ OTableFieldDescRef pDesc = getEntry(static_cast<sal_uInt32>(nPos - 1)) ;
+ pDesc->SetColWidth( static_cast<sal_uInt16>(GetColumnWidth(nColumnId)) ); // was not stored this before
// trigger UndoAction
if ( !m_bInUndoMode )
@@ -1474,7 +1474,7 @@ tools::Rectangle OSelectionBrowseBox::GetInvalidRect( sal_uInt16 nColId )
void OSelectionBrowseBox::InsertColumn(const OTableFieldDescRef& pEntry, sal_uInt16& _nColumnPosition)
{
// the control should have exactly one more column: the HandleColumn
- OSL_ENSURE(_nColumnPosition == BROWSER_INVALIDID || (_nColumnPosition <= (long)getFields().size()), "OSelectionBrowseBox::InsertColumn : invalid parameter nColId.");
+ OSL_ENSURE(_nColumnPosition == BROWSER_INVALIDID || (_nColumnPosition <= static_cast<long>(getFields().size())), "OSelectionBrowseBox::InsertColumn : invalid parameter nColId.");
// -1 means at the end. Count means at the end, others denotes a correct position
sal_uInt16 nCurCol = GetCurColumnId();
@@ -2266,7 +2266,7 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, con
break;
case BROW_ORDER_ROW:
{
- sal_uInt16 nIdx = (sal_uInt16)strNewText.toInt32();
+ sal_uInt16 nIdx = static_cast<sal_uInt16>(strNewText.toInt32());
pEntry->SetOrderDir(EOrderDir(nIdx));
} break;
case BROW_COLUMNALIAS_ROW:
diff --git a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx
index f46efb890195..9c09c4b7e076 100644
--- a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx
+++ b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx
@@ -38,7 +38,7 @@ OTableFieldDesc::OTableFieldDesc()
,m_eOrderDir( ORDER_NONE )
,m_nIndex(0)
,m_nColWidth(0)
- ,m_nColumnId((sal_uInt16)-1)
+ ,m_nColumnId(sal_uInt16(-1))
,m_bGroupBy(false)
,m_bVisible(false)
{
@@ -59,7 +59,7 @@ OTableFieldDesc::OTableFieldDesc(const OUString& rT, const OUString& rF )
,m_eOrderDir( ORDER_NONE )
,m_nIndex(0)
,m_nColWidth(0)
- ,m_nColumnId((sal_uInt16)-1)
+ ,m_nColumnId(sal_uInt16(-1))
,m_bGroupBy(false)
,m_bVisible(false)
{
@@ -169,8 +169,8 @@ void OTableFieldDesc::Save( ::comphelper::NamedValueCollection& o_rSettings, con
o_rSettings.put( "FunctionName", m_aFunctionName );
o_rSettings.put( "DataType", m_eDataType );
o_rSettings.put( "FunctionType", m_eFunctionType );
- o_rSettings.put( "FieldType", (sal_Int32)m_eFieldType );
- o_rSettings.put( "OrderDir", (sal_Int32)m_eOrderDir );
+ o_rSettings.put( "FieldType", static_cast<sal_Int32>(m_eFieldType) );
+ o_rSettings.put( "OrderDir", static_cast<sal_Int32>(m_eOrderDir) );
o_rSettings.put( "ColWidth", m_nColWidth );
o_rSettings.put( "GroupBy", m_bGroupBy );
o_rSettings.put( "Visible", m_bVisible );
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index 32bf474fad65..94ffa557bcad 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -148,7 +148,7 @@ namespace dbaui
if (!_pNode->isToken())
{
// rule name as rule: ...
- rString = "RULE_ID: " + OUString::number( (sal_Int32)_pNode->getRuleID() ) +
+ rString = "RULE_ID: " + OUString::number( static_cast<sal_Int32>(_pNode->getRuleID()) ) +
"(" + OSQLParser::RuleIDToStr(_pNode->getRuleID()) + ")";
_pParent = _pBox->InsertEntry(rString,_pParent);
@@ -1922,7 +1922,7 @@ bool OQueryController::allowQueries() const
return false;
const NamedValueCollection& rArguments( getInitParams() );
- sal_Int32 nCommandType = rArguments.getOrDefault( PROPERTY_COMMAND_TYPE, (sal_Int32)CommandType::QUERY );
+ sal_Int32 nCommandType = rArguments.getOrDefault( PROPERTY_COMMAND_TYPE, sal_Int32(CommandType::QUERY) );
bool bCreatingView = ( nCommandType == CommandType::TABLE );
return !bCreatingView;
}
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 65be68236e2d..1126b11fe4be 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -286,8 +286,8 @@ bool OTableEditorCtrl::SetDataPtr( long nRow )
if(nRow == -1)
return false;
- OSL_ENSURE(nRow < (long)m_pRowList->size(),"Row is greater than size!");
- if(nRow >= (long)m_pRowList->size())
+ OSL_ENSURE(nRow < static_cast<long>(m_pRowList->size()),"Row is greater than size!");
+ if(nRow >= static_cast<long>(m_pRowList->size()))
return false;
pActRow = (*m_pRowList)[nRow];
return pActRow != nullptr;
diff --git a/dbaccess/source/ui/tabledesign/TableUndo.cxx b/dbaccess/source/ui/tabledesign/TableUndo.cxx
index 76564b18569d..d11d53f48ad1 100644
--- a/dbaccess/source/ui/tabledesign/TableUndo.cxx
+++ b/dbaccess/source/ui/tabledesign/TableUndo.cxx
@@ -328,7 +328,7 @@ void OPrimKeyUndoAct::Undo()
long nIndex;
// delete inserted keys
- for( nIndex = m_aInsKeys.FirstSelected(); nIndex != (long)SFX_ENDOFSELECTION; nIndex=m_aInsKeys.NextSelected() )
+ for( nIndex = m_aInsKeys.FirstSelected(); nIndex != long(SFX_ENDOFSELECTION); nIndex=m_aInsKeys.NextSelected() )
{
OSL_ENSURE(nIndex <= static_cast<long>(pRowList->size()),"Index for undo isn't valid!");
pRow = (*pRowList)[nIndex];
@@ -336,7 +336,7 @@ void OPrimKeyUndoAct::Undo()
}
// restore deleted keys
- for( nIndex = m_aDelKeys.FirstSelected(); nIndex != (long)SFX_ENDOFSELECTION; nIndex=m_aDelKeys.NextSelected() )
+ for( nIndex = m_aDelKeys.FirstSelected(); nIndex != long(SFX_ENDOFSELECTION); nIndex=m_aDelKeys.NextSelected() )
{
OSL_ENSURE(nIndex <= static_cast<long>(pRowList->size()),"Index for undo isn't valid!");
pRow = (*pRowList)[nIndex];
@@ -353,11 +353,11 @@ void OPrimKeyUndoAct::Redo()
long nIndex;
// delete the deleted keys
- for( nIndex = m_aDelKeys.FirstSelected(); nIndex != (long)SFX_ENDOFSELECTION; nIndex=m_aDelKeys.NextSelected() )
+ for( nIndex = m_aDelKeys.FirstSelected(); nIndex != long(SFX_ENDOFSELECTION); nIndex=m_aDelKeys.NextSelected() )
(*pRowList)[nIndex]->SetPrimaryKey( false );
// restore the inserted keys
- for( nIndex = m_aInsKeys.FirstSelected(); nIndex != (long)SFX_ENDOFSELECTION; nIndex=m_aInsKeys.NextSelected() )
+ for( nIndex = m_aInsKeys.FirstSelected(); nIndex != long(SFX_ENDOFSELECTION); nIndex=m_aInsKeys.NextSelected() )
(*pRowList)[nIndex]->SetPrimaryKey( true );
m_pEditorCtrl->InvalidateHandleColumn();
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index 2cf9f2c3c2b0..caad6d6ba42e 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1195,7 +1195,7 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou
continue;
}
- if ( ( nSourceColumn < 1 ) || ( nSourceColumn >= (sal_Int32)aSourceColTypes.size() ) )
+ if ( ( nSourceColumn < 1 ) || ( nSourceColumn >= static_cast<sal_Int32>(aSourceColTypes.size()) ) )
{ // ( we have to check here against 1 because the parameters are 1 based)
::dbtools::throwSQLException("Internal error: invalid column type index.",
::dbtools::StandardSQLState::INVALID_DESCRIPTOR_INDEX, *this);