summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/browser
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/browser
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/browser')
-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
4 files changed, 25 insertions, 25 deletions
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