diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-21 15:25:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-22 08:07:23 +0200 |
commit | 0e66c58a8e20b997097d8b8644e774701c2d68b6 (patch) | |
tree | 5f867bd17bf956ec82359a60ad25ba170d1de117 | |
parent | 700a833520396604b10c713c478d5138578a60b6 (diff) |
long->tools::Long in dbaccess..drawinglayer
Change-Id: I15760da167e7d0b4c410acccd1c8c90210e28b2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104623
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
50 files changed, 344 insertions, 343 deletions
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index aef0eaba350f..d65d5bcbc7a3 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -1189,13 +1189,13 @@ bool OPreviewWindow::ImplGetGraphicCenterRect(const vcl::RenderContext& rRenderC if ( fGrfWH < fWinWH ) { - aNewSize.setWidth( static_cast<long>( aWinSize.Height() * fGrfWH ) ); + aNewSize.setWidth( static_cast<tools::Long>( aWinSize.Height() * fGrfWH ) ); aNewSize.setHeight( aWinSize.Height() ); } else { aNewSize.setWidth( aWinSize.Width() ); - aNewSize.setHeight( static_cast<long>( aWinSize.Width() / fGrfWH) ); + aNewSize.setHeight( static_cast<tools::Long>( aWinSize.Width() / fGrfWH) ); } const Point aNewPos( ( aWinSize.Width() - aNewSize.Width() ) >> 1, diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx index ba9c4a0e6ef5..29a1c35a8d84 100644 --- a/dbaccess/source/ui/app/AppIconControl.cxx +++ b/dbaccess/source/ui/app/AppIconControl.cxx @@ -218,7 +218,7 @@ tools::Rectangle OApplicationIconControl::GetFocusRect() if (HasFocus()) { // Get the last selected item in the list - for (long i = mFilteredItemList.size() - 1; i >= 0; --i) + for (tools::Long i = mFilteredItemList.size() - 1; i >= 0; --i) { ThumbnailViewItem* pItem = mFilteredItemList[i]; if (pItem->isSelected()) diff --git a/dbaccess/source/ui/app/AppIconControl.hxx b/dbaccess/source/ui/app/AppIconControl.hxx index 9e7bf9ee42b0..7ca11cef2659 100644 --- a/dbaccess/source/ui/app/AppIconControl.hxx +++ b/dbaccess/source/ui/app/AppIconControl.hxx @@ -38,8 +38,8 @@ namespace dbaui std::unique_ptr<OApplicationIconControlDropTarget> m_xDropTarget; IControlActionListener* m_pActionListener; - long m_nMaxWidth; - long m_nMaxHeight; + tools::Long m_nMaxWidth; + tools::Long m_nMaxHeight; bool IsMnemonicChar(sal_Unicode cChar, ElementType& rType) const; diff --git a/dbaccess/source/ui/app/DocumentInfoPreview.cxx b/dbaccess/source/ui/app/DocumentInfoPreview.cxx index 450e6fba51a3..d112c7fb0427 100644 --- a/dbaccess/source/ui/app/DocumentInfoPreview.cxx +++ b/dbaccess/source/ui/app/DocumentInfoPreview.cxx @@ -136,7 +136,7 @@ void ODocumentInfoPreview::insertEntry( m_xEditEngine->QuickInsertText(value, InsertAtEnd(*m_xEditEngine)); } -void ODocumentInfoPreview::insertNonempty(long id, OUString const & value) +void ODocumentInfoPreview::insertNonempty(tools::Long id, OUString const & value) { if (!value.isEmpty()) { insertEntry(SvtDocInfoTable_Impl::GetString(id), value); @@ -144,7 +144,7 @@ void ODocumentInfoPreview::insertNonempty(long id, OUString const & value) } void ODocumentInfoPreview::insertDateTime( - long id, css::util::DateTime const & value) + tools::Long id, css::util::DateTime const & value) { DateTime aToolsDT( Date(value.Day, value.Month, value.Year), diff --git a/dbaccess/source/ui/app/DocumentInfoPreview.hxx b/dbaccess/source/ui/app/DocumentInfoPreview.hxx index 44fbbba1d3de..9fb69af4d0f3 100644 --- a/dbaccess/source/ui/app/DocumentInfoPreview.hxx +++ b/dbaccess/source/ui/app/DocumentInfoPreview.hxx @@ -46,9 +46,9 @@ public: private: void insertEntry(OUString const & title, OUString const & value); - void insertNonempty(long id, OUString const & value); + void insertNonempty(tools::Long id, OUString const & value); - void insertDateTime(long id, css::util::DateTime const & value); + void insertDateTime(tools::Long id, css::util::DateTime const & value); }; } diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index de1f9220100f..258c3966cee9 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -140,7 +140,7 @@ void UnoDataBrowserView::dispose() IMPL_LINK_NOARG( UnoDataBrowserView, SplitHdl, Splitter*, void ) { - long nYPos = m_pSplitter->GetPosPixel().Y(); + tools::Long nYPos = m_pSplitter->GetPosPixel().Y(); m_pSplitter->SetPosPixel( Point( m_pSplitter->GetSplitPosPixel(), nYPos ) ); Resize(); } diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 5d86042a92c6..5e986fbb38e6 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -658,7 +658,7 @@ VclPtr<BrowserHeader> SbaGridControl::imp_CreateHeaderBar(BrowseBox* pParent) return VclPtr<SbaGridHeader>::Create(pParent); } -CellController* SbaGridControl::GetController(long nRow, sal_uInt16 nCol) +CellController* SbaGridControl::GetController(tools::Long nRow, sal_uInt16 nCol) { if ( m_bActivatingForDrop ) return nullptr; @@ -850,7 +850,7 @@ void SbaGridControl::Select() m_pMasterListener->SelectionChanged(); } -void SbaGridControl::ActivateCell(long nRow, sal_uInt16 nCol, bool bSetCellFocus /*= sal_True*/ ) +void SbaGridControl::ActivateCell(tools::Long nRow, sal_uInt16 nCol, bool bSetCellFocus /*= sal_True*/ ) { FmGridControl::ActivateCell(nRow, nCol, bSetCellFocus); if (m_pMasterListener) @@ -937,7 +937,7 @@ bool SbaGridControl::IsReadOnlyDB() const void SbaGridControl::MouseButtonDown( const BrowserMouseEvent& rMEvt) { - long nRow = GetRowAtYPosPixel(rMEvt.GetPosPixel().Y()); + tools::Long nRow = GetRowAtYPosPixel(rMEvt.GetPosPixel().Y()); sal_uInt16 nColPos = GetColumnAtXPosPixel(rMEvt.GetPosPixel().X()); 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 ! @@ -963,7 +963,7 @@ void SbaGridControl::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) // (Yes, this is controller (not view) functionality. But collecting and evaluating all the // information necessary via UNO would be quite difficult (if not impossible) so // my laziness says 'do it here'...) - long nRow = GetRowAtYPosPixel(_rPosPixel.Y()); + tools::Long nRow = GetRowAtYPosPixel(_rPosPixel.Y()); sal_uInt16 nColPos = GetColumnAtXPosPixel(_rPosPixel.X()); 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 ! @@ -972,7 +972,7 @@ void SbaGridControl::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) // the current row doesn't really exist: the user's appending a new one and already has entered some data, // so the row contains data which has no counter part within the data source - long nCorrectRowCount = GetRowCount(); + tools::Long nCorrectRowCount = GetRowCount(); if (GetOptions() & DbGridControlOptions::Insert) --nCorrectRowCount; // there is an empty row for inserting records if (bCurrentRowVirtual) @@ -1182,10 +1182,10 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt ) // without an empty row we're not in update mode break; - const long nRow = GetRowAtYPosPixel(rEvt.maPosPixel.Y(), false); + const tools::Long nRow = GetRowAtYPosPixel(rEvt.maPosPixel.Y(), false); const sal_uInt16 nCol = GetColumnId(GetColumnAtXPosPixel(rEvt.maPosPixel.X())); - long nCorrectRowCount = GetRowCount(); + tools::Long nCorrectRowCount = GetRowCount(); if (GetOptions() & DbGridControlOptions::Insert) --nCorrectRowCount; // there is an empty row for inserting records if (IsCurrentAppending()) @@ -1275,10 +1275,10 @@ sal_Int8 SbaGridControl::ExecuteDrop( const BrowserExecuteDropEvent& rEvt ) if ( IsDropFormatSupported( SotClipboardFormatId::STRING ) ) { - long nRow = GetRowAtYPosPixel(rEvt.maPosPixel.Y(), false); + tools::Long nRow = GetRowAtYPosPixel(rEvt.maPosPixel.Y(), false); sal_uInt16 nCol = GetColumnAtXPosPixel(rEvt.maPosPixel.X()); - long nCorrectRowCount = GetRowCount(); + tools::Long nCorrectRowCount = GetRowCount(); if (GetOptions() & DbGridControlOptions::Insert) --nCorrectRowCount; // there is an empty row for inserting records if (IsCurrentAppending()) diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 2a6cbf9136b5..aa465eff620a 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -290,7 +290,7 @@ bool SbaTableQueryBrowser::Construct(vcl::Window* pParent) { // create controls and set sizes - const long nFrameWidth = getBrowserView()->LogicToPixel(::Size(3, 0), MapMode(MapUnit::MapAppFont)).Width(); + const tools::Long nFrameWidth = getBrowserView()->LogicToPixel(::Size(3, 0), MapMode(MapUnit::MapAppFont)).Width(); m_pSplitter = VclPtr<Splitter>::Create(getBrowserView(),WB_HSCROLL); m_pSplitter->SetPosSizePixel( ::Point(0,0), ::Size(nFrameWidth,0) ); @@ -1915,7 +1915,7 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue if (pSelection != nullptr) { aSelection.realloc(pSelection->GetSelectCount()); - long nIdx = pSelection->FirstSelected(); + tools::Long nIdx = pSelection->FirstSelected(); Any* pSelectionNos = aSelection.getArray(); while (nIdx != SFX_ENDOFSELECTION) { diff --git a/dbaccess/source/ui/control/ColumnControlWindow.cxx b/dbaccess/source/ui/control/ColumnControlWindow.cxx index 9b2fa25aa8d9..3665b295d9a3 100644 --- a/dbaccess/source/ui/control/ColumnControlWindow.cxx +++ b/dbaccess/source/ui/control/ColumnControlWindow.cxx @@ -89,7 +89,7 @@ void OColumnControlWindow::DeactivateAggregate( EControlType eType ) } } -void OColumnControlWindow::CellModified(long /*nRow*/, sal_uInt16 /*nColId*/ ) +void OColumnControlWindow::CellModified(tools::Long /*nRow*/, sal_uInt16 /*nColId*/ ) { saveCurrentFieldDescData(); } diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index 69f0a00cae2d..1eae87b0ea65 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -59,7 +59,7 @@ namespace dbaui VclPtr< ::svt::ListBoxControl> m_pListCell; TTableConnectionData::value_type m_pConnData; OTableListBoxControl* m_pBoxControl; - long m_nDataPos; + tools::Long m_nDataPos; Reference< XPropertySet> m_xSourceDef; Reference< XPropertySet> m_xDestDef; enum opcode { DELETE, INSERT, MODIFY }; @@ -108,12 +108,12 @@ namespace dbaui void Init(const TTableConnectionData::value_type& _pConnData); using ORelationControl_Base::Init; - virtual void InitController( ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol ) override; - virtual ::svt::CellController* GetController( long nRow, sal_uInt16 nCol ) override; + virtual void InitController( ::svt::CellControllerRef& rController, tools::Long nRow, sal_uInt16 nCol ) override; + virtual ::svt::CellController* GetController( tools::Long nRow, sal_uInt16 nCol ) override; virtual void PaintCell( OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColId ) const override; - virtual bool SeekRow( long nRow ) override; + virtual bool SeekRow( tools::Long nRow ) override; virtual bool SaveModified() override; - virtual OUString GetCellText( long nRow, sal_uInt16 nColId ) const override; + virtual OUString GetCellText( tools::Long nRow, sal_uInt16 nColId ) const override; virtual void CellModified() override; @@ -177,7 +177,7 @@ namespace dbaui void ORelationControl::Resize() { EditBrowseBox::Resize(); - long nOutputWidth = GetOutputSizePixel().Width() - 1; + tools::Long nOutputWidth = GetOutputSizePixel().Width() - 1; SetColumnWidth(1, (nOutputWidth / 2)); SetColumnWidth(2, (nOutputWidth / 2)); } @@ -204,7 +204,7 @@ namespace dbaui bool ORelationControl::IsTabAllowed(bool bForward) const { - long nRow = GetCurRow(); + tools::Long nRow = GetCurRow(); sal_uInt16 nCol = GetCurColumnId(); bool bRet = !( ( bForward && (nCol == DEST_COLUMN) && (nRow == GetRowCount() - 1)) @@ -215,7 +215,7 @@ namespace dbaui bool ORelationControl::SaveModified() { - long nRow = GetCurRow(); + tools::Long nRow = GetCurRow(); if ( nRow != BROWSER_ENDOFSELECTION ) { weld::ComboBox& rListBox = m_pListCell->get_widget(); @@ -263,7 +263,7 @@ namespace dbaui return nId; } - OUString ORelationControl::GetCellText( long nRow, sal_uInt16 nColId ) const + OUString ORelationControl::GetCellText( tools::Long nRow, sal_uInt16 nColId ) const { OUString sText; if ( m_pConnData->GetConnLineDataList().size() > o3tl::make_unsigned(nRow) ) @@ -282,7 +282,7 @@ namespace dbaui return sText; } - void ORelationControl::InitController( CellControllerRef& /*rController*/, long nRow, sal_uInt16 nColumnId ) + void ORelationControl::InitController( CellControllerRef& /*rController*/, tools::Long nRow, sal_uInt16 nColumnId ) { OString sHelpId( HID_RELATIONDIALOG_LEFTFIELDCELL ); @@ -319,12 +319,12 @@ namespace dbaui rList.set_help_id(sHelpId); } - CellController* ORelationControl::GetController( long /*nRow*/, sal_uInt16 /*nColumnId*/ ) + CellController* ORelationControl::GetController( tools::Long /*nRow*/, sal_uInt16 /*nColumnId*/ ) { return new ListBoxCellController( m_pListCell.get() ); } - bool ORelationControl::SeekRow( long nRow ) + bool ORelationControl::SeekRow( tools::Long nRow ) { m_nDataPos = nRow; return true; diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx index 6aba975d6b8a..1225a7f74c1a 100644 --- a/dbaccess/source/ui/control/TableGrantCtrl.cxx +++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx @@ -181,7 +181,7 @@ IMPL_LINK_NOARG(OTableGrantControl, AsynchDeactivate, void*, void) bool OTableGrantControl::IsTabAllowed(bool bForward) const { - long nRow = GetCurRow(); + tools::Long nRow = GetCurRow(); sal_uInt16 nCol = GetCurColumnId(); if (bForward && (nCol == 2) && (nRow == GetRowCount() - 1)) @@ -257,7 +257,7 @@ bool OTableGrantControl::SaveModified() return bErg; } -OUString OTableGrantControl::GetCellText( long nRow, sal_uInt16 nColId ) const +OUString OTableGrantControl::GetCellText( tools::Long nRow, sal_uInt16 nColId ) const { if(COL_TABLE_NAME == nColId) return m_aTableNames[nRow]; @@ -270,7 +270,7 @@ OUString OTableGrantControl::GetCellText( long nRow, sal_uInt16 nColId ) const return OUString::number(isAllowed(nColId,nPriv) ? 1 :0); } -void OTableGrantControl::InitController( CellControllerRef& /*rController*/, long nRow, sal_uInt16 nColumnId ) +void OTableGrantControl::InitController( CellControllerRef& /*rController*/, tools::Long nRow, sal_uInt16 nColumnId ) { OUString sTablename = m_aTableNames[nRow]; // special case for tablename @@ -357,7 +357,7 @@ void OTableGrantControl::setGrantUser(const Reference< XAuthorizable>& _xGrantUs m_xGrantUser = _xGrantUser; } -CellController* OTableGrantControl::GetController( long nRow, sal_uInt16 nColumnId ) +CellController* OTableGrantControl::GetController( tools::Long nRow, sal_uInt16 nColumnId ) { CellController* pController = nullptr; @@ -384,7 +384,7 @@ CellController* OTableGrantControl::GetController( long nRow, sal_uInt16 nColumn return pController; } -bool OTableGrantControl::SeekRow( long nRow ) +bool OTableGrantControl::SeekRow( tools::Long nRow ) { m_nDataPos = nRow; diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index dd959a05dda8..2f378460c924 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -89,7 +89,7 @@ constexpr auto BROWSER_STANDARD_FLAGS = BrowserMode::COLUMNSELECTION | BrowserMo ::svt::EditBrowseBox::dispose(); } - bool IndexFieldsControl::SeekRow(long nRow) + bool IndexFieldsControl::SeekRow(tools::Long nRow) { if (!EditBrowseBox::SeekRow(nRow)) return false; @@ -165,7 +165,7 @@ constexpr auto BROWSER_STANDARD_FLAGS = BrowserMode::COLUMNSELECTION | BrowserMo _rFields.resize(aDest - _rFields.begin()); } - sal_uInt32 IndexFieldsControl::GetTotalCellWidth(long _nRow, sal_uInt16 _nColId) + sal_uInt32 IndexFieldsControl::GetTotalCellWidth(tools::Long _nRow, sal_uInt16 _nColId) { if (COLUMN_ID_ORDER == _nColId) { @@ -233,7 +233,7 @@ constexpr auto BROWSER_STANDARD_FLAGS = BrowserMode::COLUMNSELECTION | BrowserMo rNameListBox.append_text(*pFields); } - CellController* IndexFieldsControl::GetController(long _nRow, sal_uInt16 _nColumnId) + CellController* IndexFieldsControl::GetController(tools::Long _nRow, sal_uInt16 _nColumnId) { if (!IsEnabled()) return nullptr; @@ -263,7 +263,7 @@ constexpr auto BROWSER_STANDARD_FLAGS = BrowserMode::COLUMNSELECTION | BrowserMo return pReturn; } - bool IndexFieldsControl::implGetFieldDesc(long _nRow, IndexFields::const_iterator& _rPos) + bool IndexFieldsControl::implGetFieldDesc(tools::Long _nRow, IndexFields::const_iterator& _rPos) { _rPos = m_aFields.end(); if ((_nRow < 0) || (_nRow >= static_cast<sal_Int32>(m_aFields.size()))) @@ -343,7 +343,7 @@ constexpr auto BROWSER_STANDARD_FLAGS = BrowserMode::COLUMNSELECTION | BrowserMo return true; } - void IndexFieldsControl::InitController(CellControllerRef& /*_rController*/, long _nRow, sal_uInt16 _nColumnId) + void IndexFieldsControl::InitController(CellControllerRef& /*_rController*/, tools::Long _nRow, sal_uInt16 _nColumnId) { IndexFields::const_iterator aFieldDescription; bool bNewField = !implGetFieldDesc(_nRow, aFieldDescription); @@ -407,7 +407,7 @@ constexpr auto BROWSER_STANDARD_FLAGS = BrowserMode::COLUMNSELECTION | BrowserMo SaveModified(); } - OUString IndexFieldsControl::GetCellText(long _nRow,sal_uInt16 nColId) const + OUString IndexFieldsControl::GetCellText(tools::Long _nRow,sal_uInt16 nColId) const { IndexFields::const_iterator aRow = m_aFields.end(); if ( _nRow >= 0 ) diff --git a/dbaccess/source/ui/inc/ColumnControlWindow.hxx b/dbaccess/source/ui/inc/ColumnControlWindow.hxx index e896b3dda808..0f0c38d9b6d2 100644 --- a/dbaccess/source/ui/inc/ColumnControlWindow.hxx +++ b/dbaccess/source/ui/inc/ColumnControlWindow.hxx @@ -50,7 +50,7 @@ namespace dbaui virtual TOTypeInfoSP getTypeInfo(sal_Int32 _nPos) override; virtual bool isAutoIncrementValueEnabled() const override; virtual OUString getAutoIncrementValue() const override; - virtual void CellModified(long nRow, sal_uInt16 nColId ) override; + virtual void CellModified(tools::Long nRow, sal_uInt16 nColId ) override; public: OColumnControlWindow(weld::Container* pParent, diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx index 2eceba60ad2a..cf8bec1c7eb2 100644 --- a/dbaccess/source/ui/inc/FieldDescControl.hxx +++ b/dbaccess/source/ui/inc/FieldDescControl.hxx @@ -136,7 +136,7 @@ namespace dbaui virtual css::lang::Locale GetLocale() const = 0; - virtual void CellModified(long nRow, sal_uInt16 nColId ) = 0; + virtual void CellModified(tools::Long nRow, sal_uInt16 nColId ) = 0; virtual void SetModified(bool bModified); // base implementation is empty virtual TOTypeInfoSP getTypeInfo(sal_Int32 _nPos) = 0; diff --git a/dbaccess/source/ui/inc/JoinController.hxx b/dbaccess/source/ui/inc/JoinController.hxx index 30743ba2fc4c..9410823222e4 100644 --- a/dbaccess/source/ui/inc/JoinController.hxx +++ b/dbaccess/source/ui/inc/JoinController.hxx @@ -105,9 +105,9 @@ namespace dbaui */ void removeConnectionData(const TTableConnectionData::value_type& _pData); - void SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabWinList, long nOffsetX, long nOffsetY ); + void SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabWinList, tools::Long nOffsetX, tools::Long nOffsetY ); - static void SaveTabWinPosSize(OTableWindow const * pTabWin, long nOffsetX, long nOffsetY); + static void SaveTabWinPosSize(OTableWindow const * pTabWin, tools::Long nOffsetX, tools::Long nOffsetY); // UNO interface overridables // XEventListener diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx index 75b6fdca7c40..5c7c6e91fcf1 100644 --- a/dbaccess/source/ui/inc/JoinTableView.hxx +++ b/dbaccess/source/ui/inc/JoinTableView.hxx @@ -162,7 +162,7 @@ namespace dbaui */ void addConnection(OTableConnection* _pConnection,bool _bAddData = true); - bool ScrollPane( long nDelta, bool bHoriz, bool bPaintScrollBars ); + bool ScrollPane( tools::Long nDelta, bool bHoriz, bool bPaintScrollBars ); sal_uLong GetTabWinCount() const; const Point& GetScrollOffset() const { return m_aScrollOffset; } diff --git a/dbaccess/source/ui/inc/TableDesignControl.hxx b/dbaccess/source/ui/inc/TableDesignControl.hxx index cb7bf92dc788..7cfcfdc23dac 100644 --- a/dbaccess/source/ui/inc/TableDesignControl.hxx +++ b/dbaccess/source/ui/inc/TableDesignControl.hxx @@ -32,8 +32,8 @@ namespace dbaui friend class OTableDesignUndoAct; protected: - long m_nDataPos; ///< currently needed row - long m_nCurrentPos; ///< current position of selected column + tools::Long m_nDataPos; ///< currently needed row + tools::Long m_nCurrentPos; ///< current position of selected column private: sal_uInt16 m_nCurUndoActId; @@ -41,10 +41,10 @@ namespace dbaui public: OTableRowView(vcl::Window* pParent); - virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0; - virtual void SetCellData( long nRow, sal_uInt16 nColId, const css::uno::Any& _rNewData ) = 0; - virtual css::uno::Any GetCellData( long nRow, sal_uInt16 nColId ) = 0; - virtual void SetControlText( long nRow, sal_uInt16 nColId, const OUString& rText ) = 0; + virtual void SetCellData( tools::Long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0; + virtual void SetCellData( tools::Long nRow, sal_uInt16 nColId, const css::uno::Any& _rNewData ) = 0; + virtual css::uno::Any GetCellData( tools::Long nRow, sal_uInt16 nColId ) = 0; + virtual void SetControlText( tools::Long nRow, sal_uInt16 nColId, const OUString& rText ) = 0; virtual OTableDesignView* GetView() const = 0; @@ -56,18 +56,18 @@ namespace dbaui virtual void paste() override; protected: - void Paste( long nRow ); + void Paste( tools::Long nRow ); virtual void CopyRows() = 0; virtual void DeleteRows() = 0; - virtual void InsertRows( long nRow ) = 0; - virtual void InsertNewRows( long nRow ) = 0; + virtual void InsertRows( tools::Long nRow ) = 0; + virtual void InsertNewRows( tools::Long nRow ) = 0; virtual bool IsPrimaryKeyAllowed() = 0; - virtual bool IsInsertNewAllowed( long nRow ) = 0; + virtual bool IsInsertNewAllowed( tools::Long nRow ) = 0; virtual bool IsDeleteAllowed() = 0; - virtual RowStatus GetRowStatus(long nRow) const override; + virtual RowStatus GetRowStatus(tools::Long nRow) const override; virtual void KeyInput(const KeyEvent& rEvt) override; virtual void Command( const CommandEvent& rEvt ) override; diff --git a/dbaccess/source/ui/inc/TableGrantCtrl.hxx b/dbaccess/source/ui/inc/TableGrantCtrl.hxx index 0fd553a9c2ff..d83a3c0615eb 100644 --- a/dbaccess/source/ui/inc/TableGrantCtrl.hxx +++ b/dbaccess/source/ui/inc/TableGrantCtrl.hxx @@ -52,7 +52,7 @@ class OTableGrantControl : public ::svt::EditBrowseBox OUString m_sUserName; VclPtr<::svt::CheckBoxControl> m_pCheckCell; VclPtr<::svt::EditControl> m_pEdit; - long m_nDataPos; + tools::Long m_nDataPos; ImplSVEvent * m_nDeactivateEvent; public: @@ -81,12 +81,12 @@ protected: virtual bool PreNotify(NotifyEvent& rNEvt ) override; virtual bool IsTabAllowed(bool bForward) const override; - virtual void InitController( ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol ) override; - virtual ::svt::CellController* GetController( long nRow, sal_uInt16 nCol ) override; + virtual void InitController( ::svt::CellControllerRef& rController, tools::Long nRow, sal_uInt16 nCol ) override; + virtual ::svt::CellController* GetController( tools::Long nRow, sal_uInt16 nCol ) override; virtual void PaintCell( OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColId ) const override; - virtual bool SeekRow( long nRow ) override; + virtual bool SeekRow( tools::Long nRow ) override; virtual bool SaveModified() override; - virtual OUString GetCellText( long nRow, sal_uInt16 nColId ) const override; + virtual OUString GetCellText( tools::Long nRow, sal_uInt16 nColId ) const override; virtual void CellModified() override; diff --git a/dbaccess/source/ui/inc/TableRow.hxx b/dbaccess/source/ui/inc/TableRow.hxx index b2ee89dbbd97..b5c12600aa8b 100644 --- a/dbaccess/source/ui/inc/TableRow.hxx +++ b/dbaccess/source/ui/inc/TableRow.hxx @@ -19,6 +19,7 @@ #pragma once #include <com/sun/star/beans/XPropertySet.hpp> +#include <tools/long.hxx> #include "TypeInfo.hxx" class SvStream; @@ -38,7 +39,7 @@ namespace dbaui public: OTableRow(); OTableRow(const css::uno::Reference< css::beans::XPropertySet >& xAffectedCol); - OTableRow( const OTableRow& rRow, long nPosition = -1 ); + OTableRow( const OTableRow& rRow, tools::Long nPosition = -1 ); ~OTableRow(); OFieldDescription* GetActFieldDescr() const { return m_pActFieldDescr; } diff --git a/dbaccess/source/ui/inc/WTypeSelect.hxx b/dbaccess/source/ui/inc/WTypeSelect.hxx index fce7fd120dce..7abc582c76b0 100644 --- a/dbaccess/source/ui/inc/WTypeSelect.hxx +++ b/dbaccess/source/ui/inc/WTypeSelect.hxx @@ -35,7 +35,7 @@ namespace dbaui virtual void ActivateAggregate( EControlType eType ) override; virtual void DeactivateAggregate( EControlType eType ) override; - virtual void CellModified(long nRow, sal_uInt16 nColId ) override; + virtual void CellModified(tools::Long nRow, sal_uInt16 nColId ) override; virtual css::lang::Locale GetLocale() const override; virtual css::uno::Reference< css::util::XNumberFormatter > GetFormatter() const override; diff --git a/dbaccess/source/ui/inc/indexfieldscontrol.hxx b/dbaccess/source/ui/inc/indexfieldscontrol.hxx index 1261db55439e..886332935786 100644 --- a/dbaccess/source/ui/inc/indexfieldscontrol.hxx +++ b/dbaccess/source/ui/inc/indexfieldscontrol.hxx @@ -64,20 +64,20 @@ namespace dbaui void SaveValue() { m_aSavedValue = m_aFields; } void SetModifyHdl(const Link<IndexFieldsControl&,void>& _rHdl) { m_aModifyHdl = _rHdl; } - virtual OUString GetCellText(long _nRow,sal_uInt16 nColId) const override; + virtual OUString GetCellText(tools::Long _nRow,sal_uInt16 nColId) const override; private: // EditBrowseBox overridables virtual void PaintCell( OutputDevice& _rDev, const tools::Rectangle& _rRect, sal_uInt16 _nColumnId ) const override; - virtual bool SeekRow(long nRow) override; - virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId) override; + virtual bool SeekRow(tools::Long nRow) override; + virtual sal_uInt32 GetTotalCellWidth(tools::Long nRow, sal_uInt16 nColId) override; virtual bool IsTabAllowed(bool bForward) const override; - ::svt::CellController* GetController(long _nRow, sal_uInt16 _nColumnId) override; - void InitController(::svt::CellControllerRef&, long _nRow, sal_uInt16 _nColumnId) override; + ::svt::CellController* GetController(tools::Long _nRow, sal_uInt16 _nColumnId) override; + void InitController(::svt::CellControllerRef&, tools::Long _nRow, sal_uInt16 _nColumnId) override; OUString GetRowCellText(const IndexFields::const_iterator& _rRow,sal_uInt16 nColId) const; - bool implGetFieldDesc(long _nRow, IndexFields::const_iterator& _rPos); + bool implGetFieldDesc(tools::Long _nRow, IndexFields::const_iterator& _rPos); bool isNewField() const { return GetCurRow() >= static_cast<sal_Int32>(m_aFields.size()); } diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx index 35ac36b2e27f..874e3c5f9c75 100644 --- a/dbaccess/source/ui/inc/sbagrid.hxx +++ b/dbaccess/source/ui/inc/sbagrid.hxx @@ -213,7 +213,7 @@ namespace dbaui void SetMasterListener(SbaGridListener* pListener) { m_pMasterListener = pListener; } - virtual void ActivateCell(long nRow, sal_uInt16 nCol, bool bSetCellFocus = true) override; + virtual void ActivateCell(tools::Long nRow, sal_uInt16 nCol, bool bSetCellFocus = true) override; virtual void DeactivateCell(bool bUpdate = true) override; using FmGridControl::ActivateCell; @@ -249,7 +249,7 @@ namespace dbaui // EditBrowseBox overridables virtual VclPtr<BrowserHeader> imp_CreateHeaderBar(BrowseBox* pParent) override; - virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol) override; + virtual ::svt::CellController* GetController(tools::Long nRow, sal_uInt16 nCol) override; // DbGridControl overridables virtual void PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu) override; diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index 3b2647fac719..44bb78b36924 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -77,7 +77,7 @@ void OWizTypeSelectControl::DeactivateAggregate( EControlType eType ) } } -void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) +void OWizTypeSelectControl::CellModified(tools::Long nRow, sal_uInt16 nColId ) { OSL_ENSURE(nRow == -1,"nRow must be -1!"); diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx index 5411e22e9457..96086d60b682 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx @@ -29,8 +29,8 @@ #include <vcl/settings.hxx> using namespace dbaui; -const long DESCRIPT_LINE_WIDTH = 15; -const long HIT_SENSITIVE_RADIUS = 5; +const tools::Long DESCRIPT_LINE_WIDTH = 15; +const tools::Long HIT_SENSITIVE_RADIUS = 5; namespace { @@ -55,7 +55,7 @@ namespace tools::Rectangle aReturn; if ( pListBox ) { - const long nRowHeight = pListBox->get_widget().get_height_rows(1); + const tools::Long nRowHeight = pListBox->get_widget().get_height_rows(1); aReturn.SetTop( _aConnPos.Y() - nRowHeight ); aReturn.SetBottom( aReturn.Top() + nRowHeight ); if (_aDescrLinePos.X() < _aConnPos.X()) @@ -105,10 +105,10 @@ namespace else { const auto nRowHeight = rTreeView.get_height_rows(1); - _rNewConPos.AdjustY( -static_cast<long>( 0.5 * nRowHeight ) ); + _rNewConPos.AdjustY( -static_cast<tools::Long>( 0.5 * nRowHeight ) ); } - long nListBoxBottom = _pWin->GetPosPixel().Y() + tools::Long nListBoxBottom = _pWin->GetPosPixel().Y() + pListBox->GetPosPixel().Y() + pListBox->GetSizePixel().Height(); if( _rNewConPos.Y() > nListBoxBottom ) @@ -232,8 +232,8 @@ bool OConnectionLine::RecalcLine() Point aSourceCenter( 0, 0 ); Point aDestCenter( 0, 0 ); - aSourceCenter.setX( pSourceWin->GetPosPixel().X() + static_cast<long>( 0.5*pSourceWin->GetSizePixel().Width() ) ); - aDestCenter.setX( pDestWin->GetPosPixel().X() + static_cast<long>( 0.5*pDestWin->GetSizePixel().Width() ) ); + aSourceCenter.setX( pSourceWin->GetPosPixel().X() + static_cast<tools::Long>( 0.5*pSourceWin->GetSizePixel().Width() ) ); + aDestCenter.setX( pDestWin->GetPosPixel().X() + static_cast<tools::Long>( 0.5*pDestWin->GetSizePixel().Width() ) ); const OTableWindow* pFirstWin = pDestWin; const OTableWindow* pSecondWin = pSourceWin; @@ -311,8 +311,8 @@ static double dist_Euklid(const Point &p1, const Point& p2,const Point& pM, Poin 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); - q.setX( long(p1.X() + a * v.X()) ); - q.setY( long(p1.Y() + a * v.Y()) ); + q.setX( tools::Long(p1.X() + a * v.X()) ); + q.setY( tools::Long(p1.Y() + a * v.Y()) ); return l; } diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index 49ad53027729..114f77d99865 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -157,7 +157,7 @@ void OJoinController::impl_onModifyChanged() InvalidateFeature( SID_RELATION_ADD_RELATION ); } -void OJoinController::SaveTabWinPosSize(OTableWindow const * pTabWin, long nOffsetX, long nOffsetY) +void OJoinController::SaveTabWinPosSize(OTableWindow const * pTabWin, tools::Long nOffsetX, tools::Long nOffsetY) { // the data for the window const TTableWindowData::value_type& pData = pTabWin->GetData(); @@ -262,7 +262,7 @@ void OJoinController::runDialogAsync() }); } -void OJoinController::SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabWinList, long nOffsetX, long nOffsetY ) +void OJoinController::SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabWinList, tools::Long nOffsetX, tools::Long nOffsetY ) { // Deletion and recreation of the old implementation with the current model is not correct anymore: // The TabWins have a pointer to their data, but they are managed by me. When I delete the old ones, the TabWins suddenly have a pointer to objects, which no longer exist. diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 5ef30e19aeda..a51c375eaf2d 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -123,8 +123,8 @@ void OScrollWindowHelper::Resize() Window::Resize(); Size aTotalOutputSize = GetOutputSizePixel(); - long nHScrollHeight = GetHScrollBar().GetSizePixel().Height(); - long nVScrollWidth = GetVScrollBar().GetSizePixel().Width(); + tools::Long nHScrollHeight = GetHScrollBar().GetSizePixel().Height(); + tools::Long nVScrollWidth = GetVScrollBar().GetSizePixel().Width(); GetHScrollBar().SetPosSizePixel( Point( 0, aTotalOutputSize.Height()-nHScrollHeight ), @@ -148,7 +148,7 @@ void OScrollWindowHelper::Resize() GetVScrollBar().SetVisibleSize( aTotalOutputSize.Height() ); // adjust the ranges of the scrollbars if necessary - long lRange = GetHScrollBar().GetRange().Max() - GetHScrollBar().GetRange().Min(); + tools::Long lRange = GetHScrollBar().GetRange().Max() - GetHScrollBar().GetRange().Min(); if (m_pTableView->GetScrollOffset().X() + aTotalOutputSize.Width() > lRange) GetHScrollBar().SetRangeMax(m_pTableView->GetScrollOffset().X() + aTotalOutputSize.Width() + GetHScrollBar().GetRange().Min()); @@ -403,13 +403,13 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin ) namespace { - bool isScrollAllowed( OJoinTableView* _pView,long nDelta, bool bHoriz) + bool isScrollAllowed( OJoinTableView* _pView,tools::Long nDelta, bool bHoriz) { // adjust ScrollBar-Positions ScrollBar& rBar = bHoriz ? _pView->GetHScrollBar() : _pView->GetVScrollBar() ; - long nOldThumbPos = rBar.GetThumbPos(); - long nNewThumbPos = nOldThumbPos + nDelta; + tools::Long nOldThumbPos = rBar.GetThumbPos(); + tools::Long nNewThumbPos = nOldThumbPos + nDelta; if( nNewThumbPos < 0 ) nNewThumbPos = 0; else if( nNewThumbPos > rBar.GetRangeMax() ) @@ -425,7 +425,7 @@ namespace return true; } - bool getMovementImpl(OJoinTableView* _pView,const Point& _rPoint,const Size& _rSize,long& _nScrollX,long& _nScrollY) + bool getMovementImpl(OJoinTableView* _pView,const Point& _rPoint,const Size& _rSize,tools::Long& _nScrollX,tools::Long& _nScrollY) { _nScrollY = _nScrollX = 0; // data about the tab win @@ -487,7 +487,7 @@ namespace bool OJoinTableView::isMovementAllowed(const Point& _rPoint,const Size& _rSize) { - long nX,nY; + tools::Long nX,nY; return getMovementImpl(this,_rPoint,_rSize,nX,nY); } @@ -501,7 +501,7 @@ void OJoinTableView::EnsureVisible(const OTableWindow* _pWin) void OJoinTableView::EnsureVisible(const Point& _rPoint,const Size& _rSize) { - long nScrollX,nScrollY; + tools::Long nScrollX,nScrollY; if ( getMovementImpl(this,_rPoint,_rSize,nScrollX,nScrollY) ) { @@ -639,7 +639,7 @@ void OJoinTableView::BeginChildSizing( OTableWindow* pTabWin, PointerStyle nPoin StartTracking(); } -bool OJoinTableView::ScrollPane( long nDelta, bool bHoriz, bool bPaintScrollBars ) +bool OJoinTableView::ScrollPane( tools::Long nDelta, bool bHoriz, bool bPaintScrollBars ) { bool bRet = true; @@ -648,8 +648,8 @@ bool OJoinTableView::ScrollPane( long nDelta, bool bHoriz, bool bPaintScrollBars { if( bHoriz ) { - long nOldThumbPos = GetHScrollBar().GetThumbPos(); - long nNewThumbPos = nOldThumbPos + nDelta; + tools::Long nOldThumbPos = GetHScrollBar().GetThumbPos(); + tools::Long nNewThumbPos = nOldThumbPos + nDelta; if( nNewThumbPos < 0 ) { nNewThumbPos = 0; @@ -665,8 +665,8 @@ bool OJoinTableView::ScrollPane( long nDelta, bool bHoriz, bool bPaintScrollBars } else { - long nOldThumbPos = GetVScrollBar().GetThumbPos(); - long nNewThumbPos = nOldThumbPos+nDelta; + tools::Long nOldThumbPos = GetVScrollBar().GetThumbPos(); + tools::Long nNewThumbPos = nOldThumbPos+nDelta; if( nNewThumbPos < 0 ) { nNewThumbPos = 0; diff --git a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx index 47be95d92c47..601d25f9c01c 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx @@ -71,12 +71,12 @@ namespace dbaui class OTabFieldSizedUndoAct final : public OQueryDesignFieldUndoAct { - long m_nNextWidth; + tools::Long m_nNextWidth; public: explicit OTabFieldSizedUndoAct(OSelectionBrowseBox* pSelBrwBox) : OQueryDesignFieldUndoAct(pSelBrwBox, STR_QUERY_UNDO_SIZE_COLUMN), m_nNextWidth(0) { } - void SetOriginalWidth(long nWidth) { m_nNextWidth = nWidth; } + void SetOriginalWidth(tools::Long nWidth) { m_nNextWidth = nWidth; } virtual void Undo() override; virtual void Redo() override { Undo(); } diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx index 6242c94fc09f..3171c8789dcb 100644 --- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx +++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx @@ -88,7 +88,7 @@ void OTabFieldSizedUndoAct::Undo() if ( m_nColumnPosition != BROWSER_INVALIDID ) { sal_uInt16 nColumnId = pOwner->GetColumnId(m_nColumnPosition); - long nNextWidth = pOwner->GetColumnWidth(nColumnId); + tools::Long nNextWidth = pOwner->GetColumnWidth(nColumnId); pOwner->SetColWidth(nColumnId, m_nNextWidth); m_nNextWidth = nNextWidth; } diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 030c8caf07e8..ccb389c2dd06 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -355,7 +355,7 @@ void OSelectionBrowseBox::Init() SetDataRowHeight(aHeight.Height()); SetTitleLines(1); // get number of visible rows - for(long i=0;i<BROW_ROW_CNT;i++) + for(tools::Long i=0;i<BROW_ROW_CNT;i++) { if(m_bVisibleRow[i]) m_nVisibleCount++; @@ -429,7 +429,7 @@ void OSelectionBrowseBox::SetReadOnly(bool bRO) } } -CellController* OSelectionBrowseBox::GetController(long nRow, sal_uInt16 nColId) +CellController* OSelectionBrowseBox::GetController(tools::Long nRow, sal_uInt16 nColId) { if ( nColId > getFields().size() ) return nullptr; @@ -442,7 +442,7 @@ CellController* OSelectionBrowseBox::GetController(long nRow, sal_uInt16 nColId) if (static_cast<OQueryController&>(getDesignView()->getController()).isReadOnly()) return nullptr; - long nCellIndex = GetRealRow(nRow); + tools::Long nCellIndex = GetRealRow(nRow); switch (nCellIndex) { case BROW_FIELD_ROW: @@ -460,7 +460,7 @@ CellController* OSelectionBrowseBox::GetController(long nRow, sal_uInt16 nColId) } } -void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, long nRow, sal_uInt16 nColId) +void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, tools::Long nRow, sal_uInt16 nColId) { OSL_ENSURE(nColId != BROWSER_INVALIDID,"An Invalid Id was set!"); if ( nColId == BROWSER_INVALIDID ) @@ -470,7 +470,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon return; OTableFieldDescRef pEntry = getFields()[nPos-1]; OSL_ENSURE(pEntry.is(), "OSelectionBrowseBox::InitController : invalid FieldDescription !"); - long nCellIndex = GetRealRow(nRow); + tools::Long nCellIndex = GetRealRow(nRow); switch (nCellIndex) { @@ -905,7 +905,7 @@ bool OSelectionBrowseBox::SaveModified() { // for the Undo-action OUString strOldCellContents,sNewValue; - long nRow = GetRealRow(GetCurRow()); + tools::Long nRow = GetRealRow(GetCurRow()); bool bAppendRow = false; switch (nRow) { @@ -1211,7 +1211,7 @@ bool OSelectionBrowseBox::SaveModified() return pEntry != nullptr && !bError; } -bool OSelectionBrowseBox::SeekRow(long nRow) +bool OSelectionBrowseBox::SeekRow(tools::Long nRow) { m_nSeekRow = nRow; return nRow < m_nVisibleCount; @@ -1229,7 +1229,7 @@ void OSelectionBrowseBox::PaintCell(OutputDevice& rDev, const tools::Rectangle& if (!pEntry.is()) return; - long nRow = GetRealRow(m_nSeekRow); + tools::Long nRow = GetRealRow(m_nSeekRow); if (nRow == BROW_VIS_ROW) PaintTristate(rRect, pEntry->IsVisible() ? TRISTATE_TRUE : TRISTATE_FALSE); else @@ -1260,7 +1260,7 @@ void OSelectionBrowseBox::RemoveColumn(sal_uInt16 _nColumnId) // ColId is synonymous to Position, and the condition should be valid sal_uInt16 nCurCol = GetCurColumnId(); - long nCurrentRow = GetCurRow(); + tools::Long nCurrentRow = GetCurRow(); DeactivateCell(); @@ -1446,7 +1446,7 @@ void OSelectionBrowseBox::DeleteFields(const OUString& rAliasName) ActivateCell(nRow , nColId); } -void OSelectionBrowseBox::SetColWidth(sal_uInt16 nColId, long nNewWidth) +void OSelectionBrowseBox::SetColWidth(sal_uInt16 nColId, tools::Long nNewWidth) { bool bWasEditing = IsEditing(); if (bWasEditing) @@ -1479,11 +1479,11 @@ 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 <= static_cast<long>(getFields().size())), "OSelectionBrowseBox::InsertColumn : invalid parameter nColId."); + OSL_ENSURE(_nColumnPosition == BROWSER_INVALIDID || (_nColumnPosition <= static_cast<tools::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(); - long nCurrentRow = GetCurRow(); + tools::Long nCurrentRow = GetCurRow(); DeactivateCell(); @@ -1857,7 +1857,7 @@ bool OSelectionBrowseBox::Save() void OSelectionBrowseBox::CellModified() { - long nRow = GetRealRow(GetCurRow()); + tools::Long nRow = GetRealRow(GetCurRow()); switch (nRow) { case BROW_VIS_ROW: @@ -1928,7 +1928,7 @@ void OSelectionBrowseBox::Command(const CommandEvent& rEvt) } sal_uInt16 nColId = GetColumnId(GetColumnAtXPosPixel( aMenuPos.X() )); - long nRow = GetRowAtYPosPixel( aMenuPos.Y() ); + tools::Long nRow = GetRowAtYPosPixel( aMenuPos.Y() ); if (nRow < 0 && nColId > HANDLE_ID ) { @@ -2018,7 +2018,7 @@ void OSelectionBrowseBox::SetRowVisible(sal_uInt16 _nWhich, bool _bVis) // do this before removing or inserting rows, as this triggers ActivateCell-calls, which rely on m_bVisibleRow m_bVisibleRow[_nWhich] = !m_bVisibleRow[_nWhich]; - long nId = GetBrowseRow(_nWhich); + tools::Long nId = GetBrowseRow(_nWhich); if (_bVis) { RowInserted(nId); @@ -2034,10 +2034,10 @@ void OSelectionBrowseBox::SetRowVisible(sal_uInt16 _nWhich, bool _bVis) ActivateCell(); } -long OSelectionBrowseBox::GetBrowseRow(long nRowId) const +tools::Long OSelectionBrowseBox::GetBrowseRow(tools::Long nRowId) const { sal_uInt16 nCount(0); - for(long i = 0 ; i < nRowId ; ++i) + for(tools::Long i = 0 ; i < nRowId ; ++i) { if ( m_bVisibleRow[i] ) ++nCount; @@ -2045,20 +2045,20 @@ long OSelectionBrowseBox::GetBrowseRow(long nRowId) const return nCount; } -long OSelectionBrowseBox::GetRealRow(long nRowId) const +tools::Long OSelectionBrowseBox::GetRealRow(tools::Long nRowId) const { - long nErg=0,i; - const long nCount = m_bVisibleRow.size(); + tools::Long nErg=0,i; + const tools::Long nCount = m_bVisibleRow.size(); for(i=0;i < nCount; ++i) { if(m_bVisibleRow[i] && nErg++ == nRowId) break; } - OSL_ENSURE(nErg <= long(m_bVisibleRow.size()),"nErg cannot be greater than BROW_ROW_CNT!"); + OSL_ENSURE(nErg <= tools::Long(m_bVisibleRow.size()),"nErg cannot be greater than BROW_ROW_CNT!"); return i; } -const long nVisibleRowMask[] = +const tools::Long nVisibleRowMask[] = { 0x0001, 0x0002, @@ -2086,7 +2086,7 @@ sal_Int32 OSelectionBrowseBox::GetNoneVisibleRows() const return nErg; } -void OSelectionBrowseBox::SetNoneVisibleRow(long nRows) +void OSelectionBrowseBox::SetNoneVisibleRow(tools::Long nRows) { // only the first 11 rows are interesting sal_Int32 const nSize = SAL_N_ELEMENTS(nVisibleRowMask); @@ -2094,7 +2094,7 @@ void OSelectionBrowseBox::SetNoneVisibleRow(long nRows) m_bVisibleRow[i] = !(nRows & nVisibleRowMask[i]); } -OUString OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const +OUString OSelectionBrowseBox::GetCellText(tools::Long nRow, sal_uInt16 nColId) const { sal_uInt16 nPos = GetColumnPos(nColId); @@ -2290,7 +2290,7 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, con pEntry->SetCriteria(sal_uInt16(nRow - BROW_CRIT1_ROW), strNewText); } - long nCellIndex = GetRealRow(nRow); + tools::Long nCellIndex = GetRealRow(nRow); if(IsRowVisible(static_cast<sal_uInt16>(nRow))) RowModified(nCellIndex, nColId); @@ -2333,7 +2333,7 @@ void OSelectionBrowseBox::ColumnResized(sal_uInt16 nColId) } } -sal_uInt32 OSelectionBrowseBox::GetTotalCellWidth(long nRowId, sal_uInt16 nColId) +sal_uInt32 OSelectionBrowseBox::GetTotalCellWidth(tools::Long nRowId, sal_uInt16 nColId) { sal_uInt16 nPos = GetColumnPos(nColId); OSL_ENSURE((nPos == 0) || (nPos <= getFields().size()), "OSelectionBrowseBox::GetTotalCellWidth : invalid parameter nColId"); @@ -2341,7 +2341,7 @@ sal_uInt32 OSelectionBrowseBox::GetTotalCellWidth(long nRowId, sal_uInt16 nColId OTableFieldDescRef pEntry = getFields()[nPos-1]; OSL_ENSURE(pEntry.is(), "OSelectionBrowseBox::GetTotalCellWidth : invalid FieldDescription !"); - long nRow = GetRealRow(nRowId); + tools::Long nRow = GetRealRow(nRowId); OUString strText(GetCellText(nRow, nColId)); return GetDataWindow().LogicToPixel(Size(GetDataWindow().GetTextWidth(strText),0)).Width(); } @@ -2349,7 +2349,7 @@ sal_uInt32 OSelectionBrowseBox::GetTotalCellWidth(long nRowId, sal_uInt16 nColId bool OSelectionBrowseBox::isCutAllowed() const { bool bCutAllowed = false; - long nRow = GetRealRow(GetCurRow()); + tools::Long nRow = GetRealRow(GetCurRow()); switch (nRow) { case BROW_VIS_ROW: @@ -2377,7 +2377,7 @@ bool OSelectionBrowseBox::isCutAllowed() const void OSelectionBrowseBox::cut() { - long nRow = GetRealRow(GetCurRow()); + tools::Long nRow = GetRealRow(GetCurRow()); switch (nRow) { case BROW_FIELD_ROW: @@ -2400,7 +2400,7 @@ void OSelectionBrowseBox::cut() void OSelectionBrowseBox::paste() { - long nRow = GetRealRow(GetCurRow()); + tools::Long nRow = GetRealRow(GetCurRow()); switch (nRow) { case BROW_FIELD_ROW: @@ -2423,7 +2423,7 @@ void OSelectionBrowseBox::paste() bool OSelectionBrowseBox::isPasteAllowed() const { bool bPasteAllowed = true; - long nRow = GetRealRow(GetCurRow()); + tools::Long nRow = GetRealRow(GetCurRow()); switch (nRow) { case BROW_VIS_ROW: @@ -2443,7 +2443,7 @@ bool OSelectionBrowseBox::isCopyAllowed() const void OSelectionBrowseBox::copy() { - long nRow = GetRealRow(GetCurRow()); + tools::Long nRow = GetRealRow(GetCurRow()); switch (nRow) { case BROW_FIELD_ROW: diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx index 99dfd424b8de..7fe01622fcbd 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx @@ -52,7 +52,7 @@ namespace dbaui std::vector<bool> m_bVisibleRow; // at pos we find the RowId Timer m_timerInvalidate; - long m_nSeekRow; + tools::Long m_nSeekRow; BrowserMode m_nMode; // remember the BrowseModes VclPtr< ::svt::EditControl> m_pTextCell; VclPtr< ::svt::CheckBoxControl> m_pVisibleCell; @@ -104,14 +104,14 @@ namespace dbaui OQueryDesignView* getDesignView() const; sal_uInt16 FieldsCount(); - void SetColWidth(sal_uInt16 nColId, long lNewWidth); + void SetColWidth(sal_uInt16 nColId, tools::Long lNewWidth); // unlike SetColumnWidth of the base class it checks an active cell in this column OUString GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId); void SetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId, const OUString& strNewText); // cell content (formatted as string) set/return sal_Int32 GetNoneVisibleRows() const; - void SetNoneVisibleRow(long nRows); + void SetNoneVisibleRow(tools::Long nRows); bool IsRowVisible(sal_uInt16 _nWhich) const; void SetRowVisible(sal_uInt16 _nWhich, bool _bVis); @@ -150,7 +150,7 @@ namespace dbaui @return the text out of the cell */ - virtual OUString GetCellText(long _nRow, sal_uInt16 _nColId) const override; + virtual OUString GetCellText(tools::Long _nRow, sal_uInt16 _nColId) const override; /** returns the description of the row. @param _nRow @@ -178,7 +178,7 @@ namespace dbaui virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnId ) override; private: - virtual bool SeekRow( long nRow ) override; + virtual bool SeekRow( tools::Long nRow ) override; virtual void PaintStatusCell(OutputDevice& rDev, const tools::Rectangle& rRect) const override; virtual void PaintCell(OutputDevice& rDev, const tools::Rectangle& rRect, @@ -191,14 +191,14 @@ namespace dbaui virtual void KeyInput( const KeyEvent& rEvt ) override; virtual void Command(const CommandEvent& rEvt) override; - virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol) override; - virtual void InitController(::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol) override; + virtual ::svt::CellController* GetController(tools::Long nRow, sal_uInt16 nCol) override; + virtual void InitController(::svt::CellControllerRef& rController, tools::Long nRow, sal_uInt16 nCol) override; virtual void CellModified() override; virtual bool SaveModified() override; virtual void Init() override; virtual void ColumnResized( sal_uInt16 nColId ) override; - virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId) override; + virtual sal_uInt32 GetTotalCellWidth(tools::Long nRow, sal_uInt16 nColId) override; // if you want to have an own header ... virtual VclPtr<BrowserHeader> imp_CreateHeaderBar(BrowseBox* pParent) override; @@ -216,8 +216,8 @@ namespace dbaui void RemoveField( sal_uInt16 nId ); tools::Rectangle GetInvalidRect( sal_uInt16 nColId ); - long GetRealRow(long nRow) const; - long GetBrowseRow(long nRowId) const; + tools::Long GetRealRow(tools::Long nRow) const; + tools::Long GetBrowseRow(tools::Long nRowId) const; bool GetFunctionName(sal_uInt32 _nFunctionTokenId, OUString& rFkt); void appendUndoAction(const OUString& _rOldValue,const OUString& _rNewValue,sal_Int32 _nRow, bool& _bListAction); void appendUndoAction(const OUString& _rOldValue,const OUString& _rNewValue,sal_Int32 _nRow); diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx index 02f45afb416f..5744f58bdb3e 100644 --- a/dbaccess/source/ui/querydesign/TableWindow.cxx +++ b/dbaccess/source/ui/querydesign/TableWindow.cxx @@ -429,12 +429,12 @@ void OTableWindow::Resize() Size aOutSize = GetOutputSizePixel(); aOutSize = Size(CalcZoom(aOutSize.Width()),CalcZoom(aOutSize.Height())); - long nTitleHeight = CalcZoom( GetTextHeight() )+ CalcZoom( 4 ); + tools::Long nTitleHeight = CalcZoom( GetTextHeight() )+ CalcZoom( 4 ); // Set the title and ListBox - long n5Pos = CalcZoom(5); - long nPositionX = n5Pos; - long nPositionY = n5Pos; + tools::Long n5Pos = CalcZoom(5); + tools::Long nPositionX = n5Pos; + tools::Long nPositionY = n5Pos; // position the image which indicates the type m_aTypeImage->SetPosPixel( Point( nPositionX, nPositionY ) ); @@ -447,7 +447,7 @@ void OTableWindow::Resize() nPositionX += aImageSize.Width() + CalcZoom( 2 ); m_xTitle->SetPosSizePixel( Point( nPositionX, nPositionY ), Size( aOutSize.Width() - nPositionX - n5Pos, nTitleHeight ) ); - long nTitleToList = CalcZoom( 3 ); + tools::Long nTitleToList = CalcZoom( 3 ); m_xListBox->SetPosSizePixel( Point( n5Pos, nPositionY + nTitleHeight + nTitleToList ), diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index 9481f6518cf5..68b4c5c86865 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -201,7 +201,7 @@ namespace dbaui Size aSize = GetOutputSizePixel(); Size aBeamer(aSize.Width(),sal_Int32(aSize.Height()*0.33)); - const long nFrameHeight = LogicToPixel(Size(0, 3), MapMode(MapUnit::MapAppFont)).Height(); + const tools::Long nFrameHeight = LogicToPixel(Size(0, 3), MapMode(MapUnit::MapAppFont)).Height(); Point aPos(0,aBeamer.Height()+nFrameHeight); m_pBeamer->SetPosSizePixel(Point(0,0),aBeamer); diff --git a/dbaccess/source/ui/relationdesign/RTableConnection.cxx b/dbaccess/source/ui/relationdesign/RTableConnection.cxx index b4bc2cfe10ab..ba60ae54661b 100644 --- a/dbaccess/source/ui/relationdesign/RTableConnection.cxx +++ b/dbaccess/source/ui/relationdesign/RTableConnection.cxx @@ -56,8 +56,8 @@ void ORelationTableConnection::Draw(vcl::RenderContext& rRenderContext, const to // search lines for top line tools::Rectangle aBoundingRect; - long nTop = GetBoundingRect().Bottom(); - long nTemp; + tools::Long nTop = GetBoundingRect().Bottom(); + tools::Long nTemp; const OConnectionLine* pTopLine = nullptr; const std::vector<std::unique_ptr<OConnectionLine>>& rConnLineList = GetConnLineList(); diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 4d42125dd241..bb05ec132f0c 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -167,7 +167,7 @@ void OTableEditorCtrl::SetReadOnly( bool bRead ) bReadOnly = bRead; // Disable active cells - long nRow(GetCurRow()); + tools::Long nRow(GetCurRow()); sal_uInt16 nCol(GetCurColumnId()); DeactivateCell(); @@ -278,19 +278,19 @@ void OTableEditorCtrl::dispose() OTableRowView::dispose(); } -bool OTableEditorCtrl::SetDataPtr( long nRow ) +bool OTableEditorCtrl::SetDataPtr( tools::Long nRow ) { if(nRow == -1) return false; - OSL_ENSURE(nRow < static_cast<long>(m_pRowList->size()),"Row is greater than size!"); - if(nRow >= static_cast<long>(m_pRowList->size())) + OSL_ENSURE(nRow < static_cast<tools::Long>(m_pRowList->size()),"Row is greater than size!"); + if(nRow >= static_cast<tools::Long>(m_pRowList->size())) return false; pActRow = (*m_pRowList)[nRow]; return pActRow != nullptr; } -bool OTableEditorCtrl::SeekRow(long _nRow) +bool OTableEditorCtrl::SeekRow(tools::Long _nRow) { // Call the Base class to remember which row must be repainted EditBrowseBox::SeekRow(_nRow); @@ -310,7 +310,7 @@ void OTableEditorCtrl::PaintCell(OutputDevice& rDev, const tools::Rectangle& rRe rDev.Pop(); } -CellController* OTableEditorCtrl::GetController(long nRow, sal_uInt16 nColumnId) +CellController* OTableEditorCtrl::GetController(tools::Long nRow, sal_uInt16 nColumnId) { // If EditorCtrl is ReadOnly, editing is forbidden Reference<XPropertySet> xTable = GetView()->getController().getTable(); @@ -348,7 +348,7 @@ CellController* OTableEditorCtrl::GetController(long nRow, sal_uInt16 nColumnId) } } -void OTableEditorCtrl::InitController(CellControllerRef&, long nRow, sal_uInt16 nColumnId) +void OTableEditorCtrl::InitController(CellControllerRef&, tools::Long nRow, sal_uInt16 nColumnId) { SeekRow( nRow == -1 ? GetCurRow() : nRow); OFieldDescription* pActFieldDescr = pActRow->GetActFieldDescr(); @@ -405,7 +405,7 @@ void OTableEditorCtrl::InitController(CellControllerRef&, long nRow, sal_uInt16 } } -EditBrowseBox::RowStatus OTableEditorCtrl::GetRowStatus(long nRow) const +EditBrowseBox::RowStatus OTableEditorCtrl::GetRowStatus(tools::Long nRow) const { const_cast<OTableEditorCtrl*>(this)->SetDataPtr( nRow ); if( !pActRow ) @@ -436,7 +436,7 @@ void OTableEditorCtrl::SaveCurRow() pDescrWin->SaveData( pActRow->GetActFieldDescr() ); } -void OTableEditorCtrl::DisplayData(long nRow) +void OTableEditorCtrl::DisplayData(tools::Long nRow) { // go to the correct cell SetDataPtr(nRow); @@ -496,7 +496,7 @@ sal_Int32 OTableEditorCtrl::HasFieldName( const OUString& rFieldName ) return nCount; } -void OTableEditorCtrl::SaveData(long nRow, sal_uInt16 nColId) +void OTableEditorCtrl::SaveData(tools::Long nRow, sal_uInt16 nColId) { // Store the cell content SetDataPtr( nRow == -1 ? GetCurRow() : nRow); @@ -602,7 +602,7 @@ bool OTableEditorCtrl::SaveModified() return true; } -bool OTableEditorCtrl::CursorMoving(long nNewRow, sal_uInt16 nNewCol) +bool OTableEditorCtrl::CursorMoving(tools::Long nNewRow, sal_uInt16 nNewCol) { if (!EditBrowseBox::CursorMoving(nNewRow, nNewCol)) @@ -633,7 +633,7 @@ IMPL_LINK_NOARG( OTableEditorCtrl, InvalidateFieldType, void*, void ) Invalidate( GetFieldRectPixel(nOldDataPos, FIELD_TYPE) ); } -void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId ) +void OTableEditorCtrl::CellModified( tools::Long nRow, sal_uInt16 nColId ) { // If the description is null, use the default @@ -723,7 +723,7 @@ void OTableEditorCtrl::CopyRows() std::vector< std::shared_ptr<OTableRow> > vClipboardList; vClipboardList.reserve(GetSelectRowCount()); - for( long nIndex=FirstSelectedRow(); nIndex != SFX_ENDOFSELECTION; nIndex=NextSelectedRow() ) + for( tools::Long nIndex=FirstSelectedRow(); nIndex != SFX_ENDOFSELECTION; nIndex=NextSelectedRow() ) { pRow = (*m_pRowList)[nIndex]; OSL_ENSURE(pRow,"OTableEditorCtrl::CopyRows: Row is NULL!"); @@ -766,7 +766,7 @@ OUString OTableEditorCtrl::GenerateName( const OUString& rName ) return aFieldName; } -void OTableEditorCtrl::InsertRows( long nRow ) +void OTableEditorCtrl::InsertRows( tools::Long nRow ) { std::vector< std::shared_ptr<OTableRow> > vInsertedUndoRedoRows; // need for undo/redo handling @@ -780,7 +780,7 @@ void OTableEditorCtrl::InsertRows( long nRow ) { aStreamRef->Seek(STREAM_SEEK_TO_BEGIN); aStreamRef->ResetError(); - long nInsertRow = nRow; + tools::Long nInsertRow = nRow; std::shared_ptr<OTableRow> pRow; sal_Int32 nSize = 0; (*aStreamRef).ReadInt32( nSize ); @@ -819,7 +819,7 @@ void OTableEditorCtrl::DeleteRows() GetUndoManager().AddUndoAction( std::make_unique<OTableEditorDelUndoAct>(this) ); // Delete all marked rows - long nIndex = FirstSelectedRow(); + tools::Long nIndex = FirstSelectedRow(); nOldDataPos = nIndex; while( nIndex != SFX_ENDOFSELECTION ) @@ -846,16 +846,16 @@ void OTableEditorCtrl::DeleteRows() InvalidateFeatures(); } -void OTableEditorCtrl::InsertNewRows( long nRow ) +void OTableEditorCtrl::InsertNewRows( tools::Long nRow ) { OSL_ENSURE(GetView()->getController().isAddAllowed(),"Call of InsertNewRows not valid here. Please check isAppendAllowed!"); // Create Undo-Action - long nInsertRows = GetSelectRowCount(); + tools::Long nInsertRows = GetSelectRowCount(); if( !nInsertRows ) nInsertRows = 1; GetUndoManager().AddUndoAction( std::make_unique<OTableEditorInsNewUndoAct>(this, nRow, nInsertRows) ); // Insert the number of selected rows - for( long i=nRow; i<(nRow+nInsertRows); i++ ) + for( tools::Long i=nRow; i<(nRow+nInsertRows); i++ ) m_pRowList->insert( m_pRowList->begin()+i ,std::make_shared<OTableRow>()); RowInserted( nRow, nInsertRows ); @@ -863,7 +863,7 @@ void OTableEditorCtrl::InsertNewRows( long nRow ) InvalidateFeatures(); } -void OTableEditorCtrl::SetControlText( long nRow, sal_uInt16 nColId, const OUString& rText ) +void OTableEditorCtrl::SetControlText( tools::Long nRow, sal_uInt16 nColId, const OUString& rText ) { // Set the Browser Controls if( nColId < FIELD_FIRST_VIRTUAL_COLUMN ) @@ -884,7 +884,7 @@ void OTableEditorCtrl::SetControlText( long nRow, sal_uInt16 nColId, const OUStr } } -void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) +void OTableEditorCtrl::SetCellData( tools::Long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) { // Relocate the current pointer if( nRow == -1 ) @@ -905,7 +905,7 @@ void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const TOTypeIn SetControlText(nRow,nColId,_pTypeInfo ? _pTypeInfo->aUIName : OUString()); } -void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const css::uno::Any& _rNewData ) +void OTableEditorCtrl::SetCellData( tools::Long nRow, sal_uInt16 nColId, const css::uno::Any& _rNewData ) { // Relocate the current pointer if( nRow == -1 ) @@ -985,7 +985,7 @@ void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const css::uno SetControlText(nRow,nColId,sValue); } -Any OTableEditorCtrl::GetCellData( long nRow, sal_uInt16 nColId ) +Any OTableEditorCtrl::GetCellData( tools::Long nRow, sal_uInt16 nColId ) { OFieldDescription* pFieldDescr = GetFieldDescr( nRow ); if( !pFieldDescr ) @@ -1054,19 +1054,19 @@ Any OTableEditorCtrl::GetCellData( long nRow, sal_uInt16 nColId ) return makeAny(sValue); } -OUString OTableEditorCtrl::GetCellText( long nRow, sal_uInt16 nColId ) const +OUString OTableEditorCtrl::GetCellText( tools::Long nRow, sal_uInt16 nColId ) const { OUString sCellText; const_cast< OTableEditorCtrl* >( this )->GetCellData( nRow, nColId ) >>= sCellText; return sCellText; } -sal_uInt32 OTableEditorCtrl::GetTotalCellWidth(long nRow, sal_uInt16 nColId) +sal_uInt32 OTableEditorCtrl::GetTotalCellWidth(tools::Long nRow, sal_uInt16 nColId) { return GetTextWidth(GetCellText(nRow, nColId)) + 2 * GetTextWidth("0"); } -OFieldDescription* OTableEditorCtrl::GetFieldDescr( long nRow ) +OFieldDescription* OTableEditorCtrl::GetFieldDescr( tools::Long nRow ) { std::vector< std::shared_ptr<OTableRow> >::size_type nListCount( m_pRowList->size()); @@ -1148,7 +1148,7 @@ bool OTableEditorCtrl::IsCopyAllowed() // If one of the selected rows is empty, Copy is not possible std::shared_ptr<OTableRow> pRow; - long nIndex = FirstSelectedRow(); + tools::Long nIndex = FirstSelectedRow(); while( nIndex != SFX_ENDOFSELECTION ) { pRow = (*m_pRowList)[nIndex]; @@ -1279,7 +1279,7 @@ bool OTableEditorCtrl::IsDeleteAllowed() return GetSelectRowCount() != 0 && GetView()->getController().isDropAllowed(); } -bool OTableEditorCtrl::IsInsertNewAllowed( long nRow ) +bool OTableEditorCtrl::IsInsertNewAllowed( tools::Long nRow ) { bool bInsertNewAllowed = GetView()->getController().isAddAllowed(); @@ -1314,7 +1314,7 @@ bool OTableEditorCtrl::IsPrimaryKeyAllowed() // - there are no empty entries in the selection // - No Memo or Image entries // - DROP is not permitted (see above) and the column is not Required (not null flag is not set). - long nIndex = FirstSelectedRow(); + tools::Long nIndex = FirstSelectedRow(); std::shared_ptr<OTableRow> pRow; while( nIndex != SFX_ENDOFSELECTION ) { @@ -1375,7 +1375,7 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt) if( !IsReadOnly() ) { sal_uInt16 nColId = GetColumnId(GetColumnAtXPosPixel(aMenuPos.X())); - long nRow = GetRowAtYPosPixel(aMenuPos.Y()); + tools::Long nRow = GetRowAtYPosPixel(aMenuPos.Y()); if ( HANDLE_ID != nColId ) { @@ -1547,7 +1547,7 @@ void OTableEditorCtrl::SetPrimaryKey( bool bSet ) aInsertedPrimKeys.SetTotalRange( Range(0,GetRowCount()) ); if( bSet ) { - long nIndex = FirstSelectedRow(); + tools::Long nIndex = FirstSelectedRow(); while( nIndex != SFX_ENDOFSELECTION ) { // Set the key @@ -1573,7 +1573,7 @@ void OTableEditorCtrl::SetPrimaryKey( bool bSet ) bool OTableEditorCtrl::IsPrimaryKey() { // Are all marked fields part of the Primary Key ? - long nPrimaryKeys = 0; + tools::Long nPrimaryKeys = 0; sal_Int32 nRow=0; for (auto const& row : *m_pRowList) { @@ -1591,13 +1591,13 @@ bool OTableEditorCtrl::IsPrimaryKey() void OTableEditorCtrl::SwitchType( const TOTypeInfoSP& _pType ) { // if there is no assigned field name - long nRow(GetCurRow()); + tools::Long nRow(GetCurRow()); OFieldDescription* pActFieldDescr = GetFieldDescr( nRow ); if( pActFieldDescr ) // Store the old description pDescrWin->SaveData( pActFieldDescr ); - if ( nRow < 0 || nRow > static_cast<long>(m_pRowList->size()) ) + if ( nRow < 0 || nRow > static_cast<tools::Long>(m_pRowList->size()) ) return; // Show the new description std::shared_ptr<OTableRow> pRow = (*m_pRowList)[nRow]; @@ -1648,7 +1648,7 @@ void OTableEditorCtrl::DeactivateCell(bool bUpdate) { OTableRowView::DeactivateCell(bUpdate); // now we have to deactivate the field description - long nRow(GetCurRow()); + tools::Long nRow(GetCurRow()); if (pDescrWin) pDescrWin->SetReadOnly(bReadOnly || !SetDataPtr(nRow) || GetActRow()->IsReadOnly()); } diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx index fc99cbd350e8..8c2608e24e2f 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.hxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx @@ -59,7 +59,7 @@ namespace dbaui ImplSVEvent * nInvalidateTypeEvent; ChildFocusState m_eChildFocus; - long nOldDataPos; + tools::Long nOldDataPos; bool bReadOnly; @@ -85,29 +85,29 @@ namespace dbaui protected: virtual void Command( const CommandEvent& rEvt ) override; - virtual bool SeekRow(long nRow) override; + virtual bool SeekRow(tools::Long nRow) override; virtual void PaintCell(OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColumnId ) const override; virtual void CursorMoved() override; - virtual RowStatus GetRowStatus(long nRow) const override; + virtual RowStatus GetRowStatus(tools::Long nRow) const override; - virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol) override; - virtual void InitController(::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol) override; + virtual ::svt::CellController* GetController(tools::Long nRow, sal_uInt16 nCol) override; + virtual void InitController(::svt::CellControllerRef& rController, tools::Long nRow, sal_uInt16 nCol) override; virtual void CellModified() override; virtual bool SaveModified() override; // is called before changing a cell (false prevents change) - virtual OUString GetCellText(long nRow, sal_uInt16 nColId) const override; - virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId) override; + virtual OUString GetCellText(tools::Long nRow, sal_uInt16 nColId) const override; + virtual sal_uInt32 GetTotalCellWidth(tools::Long nRow, sal_uInt16 nColId) override; virtual void CopyRows() override; - virtual void InsertRows( long nRow ) override; + virtual void InsertRows( tools::Long nRow ) override; virtual void DeleteRows() override; - virtual void InsertNewRows( long nRow ) override; + virtual void InsertNewRows( tools::Long nRow ) override; virtual bool IsPrimaryKeyAllowed() override; - virtual bool IsInsertNewAllowed( long nRow ) override; + virtual bool IsInsertNewAllowed( tools::Long nRow ) override; virtual bool IsDeleteAllowed() override; void ClearModified(); @@ -119,7 +119,7 @@ namespace dbaui explicit OTableEditorCtrl(vcl::Window* pParentWin, OTableDesignView* pView); virtual ~OTableEditorCtrl() override; virtual void dispose() override; - virtual bool CursorMoving(long nNewRow, sal_uInt16 nNewCol) override; + virtual bool CursorMoving(tools::Long nNewRow, sal_uInt16 nNewCol) override; SfxUndoManager& GetUndoManager() const; void SetDescrWin( OTableFieldDescWin* pWin ) @@ -132,19 +132,19 @@ namespace dbaui void SwitchType( const TOTypeInfoSP& _pType ); /// force displaying of the given row - void DisplayData( long nRow ); + void DisplayData( tools::Long nRow ); - virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) override; - virtual void SetCellData( long nRow, sal_uInt16 nColId, const css::uno::Any& _rSaveData ) override; - virtual css::uno::Any GetCellData( long nRow, sal_uInt16 nColId ) override; - virtual void SetControlText( long nRow, sal_uInt16 nColId, const OUString& rText ) override; + virtual void SetCellData( tools::Long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) override; + virtual void SetCellData( tools::Long nRow, sal_uInt16 nColId, const css::uno::Any& _rSaveData ) override; + virtual css::uno::Any GetCellData( tools::Long nRow, sal_uInt16 nColId ) override; + virtual void SetControlText( tools::Long nRow, sal_uInt16 nColId, const OUString& rText ) override; virtual OTableDesignView* GetView() const override; std::vector< std::shared_ptr<OTableRow> >* GetRowList(){ return m_pRowList; } const std::shared_ptr<OTableRow>& GetActRow() const { return pActRow; } - void CellModified( long nRow, sal_uInt16 nColId ); + void CellModified( tools::Long nRow, sal_uInt16 nColId ); void SetReadOnly( bool bRead ); virtual void Init() override; @@ -154,7 +154,7 @@ namespace dbaui bool IsCopyAllowed(); bool IsPasteAllowed() const; bool IsReadOnly() const { return bReadOnly;} - OFieldDescription* GetFieldDescr( long nRow ); + OFieldDescription* GetFieldDescr( tools::Long nRow ); // Window overrides virtual bool PreNotify( NotifyEvent& rNEvt ) override; @@ -178,9 +178,9 @@ namespace dbaui void InitCellController(); sal_Int32 HasFieldName( const OUString& rFieldName ); OUString GenerateName( const OUString& rName ); - bool SetDataPtr( long nRow ); + bool SetDataPtr( tools::Long nRow ); - void SaveData(long nRow, sal_uInt16 nColumnId); + void SaveData(tools::Long nRow, sal_uInt16 nColumnId); /** AdjustFieldDescription set the needed values for the description @param _pFieldDesc the field description where to set the values @param _rMultiSel contains the positions which changed for undo/redo diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx index a11b0ce9a222..fd91b310a8af 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx @@ -105,13 +105,13 @@ void OTableRowView::Command(const CommandEvent& rEvt) } sal_uInt16 nColId = GetColumnId(GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X())); - long nRow = GetRowAtYPosPixel(rEvt.GetMousePosPixel().Y()); + tools::Long nRow = GetRowAtYPosPixel(rEvt.GetMousePosPixel().Y()); if ( nColId == HANDLE_ID ) { VclBuilder aBuilder(nullptr, AllSettings::GetUIRootDir(), "dbaccess/ui/querycolmenu.ui", ""); VclPtr<PopupMenu> aContextMenu(aBuilder.get_menu("menu")); - long nSelectRowCount = GetSelectRowCount(); + tools::Long nSelectRowCount = GetSelectRowCount(); aContextMenu->EnableItem(aContextMenu->GetItemId("cut"), nSelectRowCount != 0); aContextMenu->EnableItem(aContextMenu->GetItemId("copy"), nSelectRowCount != 0); aContextMenu->EnableItem(aContextMenu->GetItemId("paste"), false); @@ -166,12 +166,12 @@ void OTableRowView::paste() OSL_FAIL("OTableRowView::Paste : (pseudo-) abstract method called !"); } -void OTableRowView::Paste( long nRow ) +void OTableRowView::Paste( tools::Long nRow ) { InsertRows( nRow ); } -EditBrowseBox::RowStatus OTableRowView::GetRowStatus(long nRow) const +EditBrowseBox::RowStatus OTableRowView::GetRowStatus(tools::Long nRow) const { if (nRow >= 0 && m_nDataPos == nRow) return CURRENT; diff --git a/dbaccess/source/ui/tabledesign/TableFieldControl.cxx b/dbaccess/source/ui/tabledesign/TableFieldControl.cxx index b384dab2738e..01e25d75d05a 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldControl.cxx +++ b/dbaccess/source/ui/tabledesign/TableFieldControl.cxx @@ -49,7 +49,7 @@ OTableFieldControl::~OTableFieldControl() dispose(); } -void OTableFieldControl::CellModified(long nRow, sal_uInt16 nColId ) +void OTableFieldControl::CellModified(tools::Long nRow, sal_uInt16 nColId ) { GetCtrl()->CellModified(nRow,nColId); } diff --git a/dbaccess/source/ui/tabledesign/TableFieldControl.hxx b/dbaccess/source/ui/tabledesign/TableFieldControl.hxx index c86be18fb072..4dd53a24dd7d 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldControl.hxx +++ b/dbaccess/source/ui/tabledesign/TableFieldControl.hxx @@ -39,7 +39,7 @@ namespace dbaui virtual void ActivateAggregate( EControlType eType ) override; virtual void DeactivateAggregate( EControlType eType ) override; // are to be implemented by the derived classes - virtual void CellModified(long nRow, sal_uInt16 nColId ) override; + virtual void CellModified(tools::Long nRow, sal_uInt16 nColId ) override; virtual bool IsReadOnly() override; virtual void SetModified(bool bModified) override; virtual css::uno::Reference< css::util::XNumberFormatter > GetFormatter() const override; diff --git a/dbaccess/source/ui/tabledesign/TableRow.cxx b/dbaccess/source/ui/tabledesign/TableRow.cxx index c84ebc834410..8b91f11b287c 100644 --- a/dbaccess/source/ui/tabledesign/TableRow.cxx +++ b/dbaccess/source/ui/tabledesign/TableRow.cxx @@ -44,7 +44,7 @@ OTableRow::OTableRow(const Reference< XPropertySet >& xAffectedCol) m_pActFieldDescr = new OFieldDescription(xAffectedCol); } -OTableRow::OTableRow( const OTableRow& rRow, long nPosition ) +OTableRow::OTableRow( const OTableRow& rRow, tools::Long nPosition ) :m_pActFieldDescr(nullptr) ,m_nPos( nPosition ) ,m_bReadOnly(rRow.IsReadOnly()) diff --git a/dbaccess/source/ui/tabledesign/TableUndo.cxx b/dbaccess/source/ui/tabledesign/TableUndo.cxx index 6cb71bc9502c..0edd32436918 100644 --- a/dbaccess/source/ui/tabledesign/TableUndo.cxx +++ b/dbaccess/source/ui/tabledesign/TableUndo.cxx @@ -65,7 +65,7 @@ void OTableDesignUndoAct::Redo() } } -OTableDesignCellUndoAct::OTableDesignCellUndoAct( OTableRowView* pOwner, long nRowID, sal_uInt16 nColumn ) : +OTableDesignCellUndoAct::OTableDesignCellUndoAct( OTableRowView* pOwner, tools::Long nRowID, sal_uInt16 nColumn ) : OTableDesignUndoAct( pOwner ,STR_TABED_UNDO_CELLMODIFIED) ,m_nCol( nColumn ) ,m_nRow( nRowID ) @@ -116,7 +116,7 @@ OTableEditorUndoAct::~OTableEditorUndoAct() { } -OTableEditorTypeSelUndoAct::OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, long nRowID, sal_uInt16 nColumn, const TOTypeInfoSP& _pOldType ) +OTableEditorTypeSelUndoAct::OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, tools::Long nRowID, sal_uInt16 nColumn, const TOTypeInfoSP& _pOldType ) :OTableEditorUndoAct( pOwner ,STR_TABED_UNDO_TYPE_CHANGED) ,m_nCol( nColumn ) ,m_nRow( nRowID ) @@ -212,7 +212,7 @@ void OTableEditorDelUndoAct::Redo() } OTableEditorInsUndoAct::OTableEditorInsUndoAct( OTableEditorCtrl* pOwner, - long nInsertPosition , + tools::Long nInsertPosition , const std::vector< std::shared_ptr<OTableRow> >& _vInsertedRows) :OTableEditorUndoAct( pOwner,STR_TABED_UNDO_ROWINSERTED ) ,m_vInsertedRows(_vInsertedRows) @@ -240,7 +240,7 @@ void OTableEditorInsUndoAct::Undo() void OTableEditorInsUndoAct::Redo() { // insert lines again - long nInsertRow = m_nInsPos; + tools::Long nInsertRow = m_nInsPos; std::shared_ptr<OTableRow> pRow; std::vector< std::shared_ptr<OTableRow> >* pRowList = pTabEdCtrl->GetRowList(); for (auto const& insertedRow : m_vInsertedRows) @@ -256,7 +256,7 @@ void OTableEditorInsUndoAct::Redo() OTableEditorUndoAct::Redo(); } -OTableEditorInsNewUndoAct::OTableEditorInsNewUndoAct( OTableEditorCtrl* pOwner, long nInsertPosition, long nInsertedRows ) : +OTableEditorInsNewUndoAct::OTableEditorInsNewUndoAct( OTableEditorCtrl* pOwner, tools::Long nInsertPosition, tools::Long nInsertedRows ) : OTableEditorUndoAct( pOwner ,STR_TABED_UNDO_NEWROWINSERTED) ,m_nInsPos( nInsertPosition ) ,m_nInsRows( nInsertedRows ) @@ -285,7 +285,7 @@ void OTableEditorInsNewUndoAct::Redo() // insert lines again std::vector< std::shared_ptr<OTableRow> >* pRowList = pTabEdCtrl->GetRowList(); - for( long i=m_nInsPos; i<(m_nInsPos+m_nInsRows); i++ ) + for( tools::Long i=m_nInsPos; i<(m_nInsPos+m_nInsRows); i++ ) pRowList->insert( pRowList->begin()+i,std::make_shared<OTableRow>() ); pTabEdCtrl->RowInserted( m_nInsPos, m_nInsRows ); @@ -310,20 +310,20 @@ void OPrimKeyUndoAct::Undo() { std::vector< std::shared_ptr<OTableRow> >* pRowList = pTabEdCtrl->GetRowList(); std::shared_ptr<OTableRow> pRow; - long nIndex; + tools::Long nIndex; // delete inserted keys - for( nIndex = m_aInsKeys.FirstSelected(); nIndex != long(SFX_ENDOFSELECTION); nIndex=m_aInsKeys.NextSelected() ) + for( nIndex = m_aInsKeys.FirstSelected(); nIndex != tools::Long(SFX_ENDOFSELECTION); nIndex=m_aInsKeys.NextSelected() ) { - OSL_ENSURE(nIndex <= static_cast<long>(pRowList->size()),"Index for undo isn't valid!"); + OSL_ENSURE(nIndex <= static_cast<tools::Long>(pRowList->size()),"Index for undo isn't valid!"); pRow = (*pRowList)[nIndex]; pRow->SetPrimaryKey( false ); } // restore deleted keys - for( nIndex = m_aDelKeys.FirstSelected(); nIndex != long(SFX_ENDOFSELECTION); nIndex=m_aDelKeys.NextSelected() ) + for( nIndex = m_aDelKeys.FirstSelected(); nIndex != tools::Long(SFX_ENDOFSELECTION); nIndex=m_aDelKeys.NextSelected() ) { - OSL_ENSURE(nIndex <= static_cast<long>(pRowList->size()),"Index for undo isn't valid!"); + OSL_ENSURE(nIndex <= static_cast<tools::Long>(pRowList->size()),"Index for undo isn't valid!"); pRow = (*pRowList)[nIndex]; pRow->SetPrimaryKey( true ); } @@ -335,14 +335,14 @@ void OPrimKeyUndoAct::Undo() void OPrimKeyUndoAct::Redo() { std::vector< std::shared_ptr<OTableRow> >* pRowList = pTabEdCtrl->GetRowList(); - long nIndex; + tools::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 != tools::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 != tools::Long(SFX_ENDOFSELECTION); nIndex=m_aInsKeys.NextSelected() ) (*pRowList)[nIndex]->SetPrimaryKey( true ); m_pEditorCtrl->InvalidateHandleColumn(); diff --git a/dbaccess/source/ui/tabledesign/TableUndo.hxx b/dbaccess/source/ui/tabledesign/TableUndo.hxx index 39a0f664d7c0..f7f8d0f56d57 100644 --- a/dbaccess/source/ui/tabledesign/TableUndo.hxx +++ b/dbaccess/source/ui/tabledesign/TableUndo.hxx @@ -57,28 +57,28 @@ namespace dbaui class OTableDesignCellUndoAct final : public OTableDesignUndoAct { sal_uInt16 m_nCol; - long m_nRow; + tools::Long m_nRow; css::uno::Any m_sOldText; css::uno::Any m_sNewText; virtual void Undo() override; virtual void Redo() override; public: - OTableDesignCellUndoAct( OTableRowView* pOwner, long nRowID, sal_uInt16 nColumn ); + OTableDesignCellUndoAct( OTableRowView* pOwner, tools::Long nRowID, sal_uInt16 nColumn ); virtual ~OTableDesignCellUndoAct() override; }; class OTableEditorTypeSelUndoAct final : public OTableEditorUndoAct { sal_uInt16 m_nCol; - long m_nRow; + tools::Long m_nRow; TOTypeInfoSP m_pOldType; TOTypeInfoSP m_pNewType; virtual void Undo() override; virtual void Redo() override; public: - OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, long nRowID, sal_uInt16 nColumn, const TOTypeInfoSP& _pOldType ); + OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, tools::Long nRowID, sal_uInt16 nColumn, const TOTypeInfoSP& _pOldType ); virtual ~OTableEditorTypeSelUndoAct() override; }; @@ -96,26 +96,26 @@ namespace dbaui class OTableEditorInsUndoAct final : public OTableEditorUndoAct { std::vector< std::shared_ptr<OTableRow> > m_vInsertedRows; - long m_nInsPos; + tools::Long m_nInsPos; virtual void Undo() override; virtual void Redo() override; public: OTableEditorInsUndoAct( OTableEditorCtrl* pOwner, - long nInsertPosition, + tools::Long nInsertPosition, const std::vector< std::shared_ptr<OTableRow> >& _vInsertedRows); virtual ~OTableEditorInsUndoAct() override; }; class OTableEditorInsNewUndoAct final : public OTableEditorUndoAct { - long m_nInsPos; - long m_nInsRows; + tools::Long m_nInsPos; + tools::Long m_nInsRows; virtual void Undo() override; virtual void Redo() override; public: - OTableEditorInsNewUndoAct( OTableEditorCtrl* pOwner, long nInsertPosition, long nInsertedRows ); + OTableEditorInsNewUndoAct( OTableEditorCtrl* pOwner, tools::Long nInsertPosition, tools::Long nInsertedRows ); virtual ~OTableEditorInsNewUndoAct() override; }; diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 68f6add5139c..858548d6b569 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -703,11 +703,11 @@ void DesktopLOKTest::testRowColumnHeaders() pDocument->pClass->initializeForRendering(pDocument, nullptr); - long nWidth = 0; - long nHeight = 0; + tools::Long nWidth = 0; + tools::Long nHeight = 0; pDocument->m_pDocumentClass->getDocumentSize(pDocument, &nWidth, &nHeight); - long nX = rtl::math::round(nWidth / 4.0); - long nY = rtl::math::round(nHeight / 4.0); + tools::Long nX = rtl::math::round(nWidth / 4.0); + tools::Long nY = rtl::math::round(nHeight / 4.0); nWidth = rtl::math::round(nWidth / 2.0); nHeight = rtl::math::round(nHeight / 2.0); @@ -786,10 +786,10 @@ void DesktopLOKTest::testHiddenRowHeaders() pDocument->pClass->initializeForRendering(pDocument, nullptr); - long const nX = 0; - long const nY = 0; - long nWidth = 0; - long nHeight = 0; + tools::Long const nX = 0; + tools::Long const nY = 0; + tools::Long nWidth = 0; + tools::Long nHeight = 0; pDocument->m_pDocumentClass->getDocumentSize(pDocument, &nWidth, &nHeight); std::stringstream aPayload; @@ -2032,7 +2032,7 @@ void DesktopLOKTest::testCommentsWriter() LibLODocument_Impl* pDocument = loadDoc("comments.odt"); pDocument->m_pDocumentClass->initializeForRendering(pDocument, nullptr); - long nWidth, nHeight; + tools::Long nWidth, nHeight; pDocument->m_pDocumentClass->getDocumentSize(pDocument, &nWidth, &nHeight); // Document width alongwith without sidebar comes to be < 13000 diff --git a/desktop/source/app/cmdlineargs.cxx b/desktop/source/app/cmdlineargs.cxx index e58ee2f6e2e4..4d5a3bb78396 100644 --- a/desktop/source/app/cmdlineargs.cxx +++ b/desktop/source/app/cmdlineargs.cxx @@ -125,7 +125,7 @@ CommandLineEvent CheckOfficeURI(/* in,out */ OUString& arg, CommandLineEvent cur return curEvt; OUString rest2; - long nURIlen = -1; + tools::Long nURIlen = -1; // URL might be encoded OUString decoded_rest = rest1.replaceAll("%7C", "|").replaceAll("%7c", "|"); diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index de01830fb9fe..da8106bcc3e3 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -100,7 +100,7 @@ class ExtBoxWithBtns_Impl : public ExtensionBox_Impl ExtMgrDialog* m_pParent; void SetButtonStatus( const TEntry_Impl& rEntry ); - OString ShowPopupMenu( const Point &rPos, const long nPos ); + OString ShowPopupMenu( const Point &rPos, const tools::Long nPos ); public: explicit ExtBoxWithBtns_Impl(std::unique_ptr<weld::ScrolledWindow> xScroll); @@ -111,7 +111,7 @@ public: virtual bool Command( const CommandEvent& rCEvt ) override; virtual void RecalcAll() override; - virtual void selectEntry( const long nPos ) override; + virtual void selectEntry( const tools::Long nPos ) override; void enableButtons( bool bEnable ); }; @@ -150,7 +150,7 @@ void ExtBoxWithBtns_Impl::RecalcAll() //This function may be called with nPos < 0 -void ExtBoxWithBtns_Impl::selectEntry( const long nPos ) +void ExtBoxWithBtns_Impl::selectEntry( const tools::Long nPos ) { if ( HasActive() && ( nPos == getSelIndex() ) ) return; @@ -233,9 +233,9 @@ bool ExtBoxWithBtns_Impl::Command(const CommandEvent& rCEvt) return true; } -OString ExtBoxWithBtns_Impl::ShowPopupMenu( const Point & rPos, const long nPos ) +OString ExtBoxWithBtns_Impl::ShowPopupMenu( const Point & rPos, const tools::Long nPos ) { - if ( nPos >= static_cast<long>(getItemCount()) ) + if ( nPos >= static_cast<tools::Long>(getItemCount()) ) return "CMD_NONE"; std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(nullptr, "desktop/ui/extensionmenu.ui")); @@ -827,7 +827,7 @@ void ExtMgrDialog::showProgress( bool _bStart ) } -void ExtMgrDialog::updateProgress( const long nProgress ) +void ExtMgrDialog::updateProgress( const tools::Long nProgress ) { if ( m_nProgress != nProgress ) { @@ -1115,7 +1115,7 @@ void UpdateRequiredDialog::showProgress( bool _bStart ) } -void UpdateRequiredDialog::updateProgress( const long nProgress ) +void UpdateRequiredDialog::updateProgress( const tools::Long nProgress ) { if ( m_nProgress != nProgress ) { @@ -1292,8 +1292,8 @@ bool UpdateRequiredDialog::hasActiveEntries() ::osl::MutexGuard aGuard( m_aMutex ); bool bRet = false; - long nCount = m_xExtensionBox->GetEntryCount(); - for ( long nIndex = 0; nIndex < nCount; nIndex++ ) + tools::Long nCount = m_xExtensionBox->GetEntryCount(); + for ( tools::Long nIndex = 0; nIndex < nCount; nIndex++ ) { TEntry_Impl pEntry = m_xExtensionBox->GetEntryData( nIndex ); @@ -1314,8 +1314,8 @@ void UpdateRequiredDialog::disableAllEntries() incBusy(); - long nCount = m_xExtensionBox->GetEntryCount(); - for ( long nIndex = 0; nIndex < nCount; nIndex++ ) + tools::Long nCount = m_xExtensionBox->GetEntryCount(); + for ( tools::Long nIndex = 0; nIndex < nCount; nIndex++ ) { TEntry_Impl pEntry = m_xExtensionBox->GetEntryData( nIndex ); m_pManager->getCmdQueue()->enableExtension( pEntry->m_xPackage, false ); diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx index e7e262a3add3..09f2a2e42a9f 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx @@ -64,7 +64,7 @@ public: virtual void showProgress( bool bStart ) = 0; virtual void updateProgress( const OUString &rText, const css::uno::Reference< css::task::XAbortChannel > &xAbortChannel) = 0; - virtual void updateProgress( const long nProgress ) = 0; + virtual void updateProgress( const tools::Long nProgress ) = 0; virtual void updatePackageInfo( const css::uno::Reference< css::deployment::XPackage > &xPackage ) = 0; virtual void addPackageToList( const css::uno::Reference< css::deployment::XPackage > &xPackage, @@ -101,7 +101,7 @@ class ExtMgrDialog : public weld::GenericDialogController bool m_bDisableWarning; bool m_bDeleteWarning; bool m_bClosed; - long m_nProgress; + tools::Long m_nProgress; Idle m_aIdle; TheExtensionManager *m_pManager; @@ -143,7 +143,7 @@ public: virtual void showProgress( bool bStart ) override; virtual void updateProgress( const OUString &rText, const css::uno::Reference< css::task::XAbortChannel > &xAbortChannel) override; - virtual void updateProgress( const long nProgress ) override; + virtual void updateProgress( const tools::Long nProgress ) override; virtual void updatePackageInfo( const css::uno::Reference< css::deployment::XPackage > &xPackage ) override; @@ -187,7 +187,7 @@ class UpdateRequiredDialog : public weld::GenericDialogController bool m_bStartProgress; bool m_bStopProgress; bool m_bHasLockedEntries; - long m_nProgress; + tools::Long m_nProgress; Idle m_aIdle; TheExtensionManager *m_pManager; @@ -222,7 +222,7 @@ public: virtual void showProgress( bool bStart ) override; virtual void updateProgress( const OUString &rText, const css::uno::Reference< css::task::XAbortChannel > &xAbortChannel) override; - virtual void updateProgress( const long nProgress ) override; + virtual void updateProgress( const tools::Long nProgress ) override; virtual void updatePackageInfo( const css::uno::Reference< css::deployment::XPackage > &xPackage ) override; diff --git a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx index ad03a9a7d66f..d2fca9d95e03 100644 --- a/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensioncmdqueue.cxx @@ -286,7 +286,7 @@ void ProgressCmdEnv::progressSection( const OUString &rText, void ProgressCmdEnv::updateProgress() { - long nProgress = ((m_nCurrentProgress*5) % 100) + 5; + tools::Long nProgress = ((m_nCurrentProgress*5) % 100) + 5; if ( m_pDialogHelper ) m_pDialogHelper->updateProgress( nProgress ); } diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 3000a29a91c0..ed6ed79fd256 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -260,14 +260,14 @@ sal_Int32 ExtensionBox_Impl::getSelIndex() const // Title + description -void ExtensionBox_Impl::CalcActiveHeight( const long nPos ) +void ExtensionBox_Impl::CalcActiveHeight( const tools::Long nPos ) { const ::osl::MutexGuard aGuard( m_entriesMutex ); // get title height - long aTextHeight; - long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE; - long nTitleHeight = 2*TOP_OFFSET + GetTextHeight(); + tools::Long aTextHeight; + tools::Long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE; + tools::Long nTitleHeight = 2*TOP_OFFSET + GetTextHeight(); if ( nIconHeight < nTitleHeight ) aTextHeight = nTitleHeight; else @@ -297,7 +297,7 @@ void ExtensionBox_Impl::CalcActiveHeight( const long nPos ) m_nActiveHeight += 2; } -tools::Rectangle ExtensionBox_Impl::GetEntryRect( const long nPos ) const +tools::Rectangle ExtensionBox_Impl::GetEntryRect( const tools::Long nPos ) const { const ::osl::MutexGuard aGuard( m_entriesMutex ); @@ -329,7 +329,7 @@ void ExtensionBox_Impl::DeleteRemoved() //This function may be called with nPos < 0 -void ExtensionBox_Impl::selectEntry( const long nPos ) +void ExtensionBox_Impl::selectEntry( const tools::Long nPos ) { bool invalidate = false; { @@ -353,7 +353,7 @@ void ExtensionBox_Impl::selectEntry( const long nPos ) m_vEntries[ m_nActive ]->m_bActive = false; } - if ( ( nPos >= 0 ) && ( nPos < static_cast<long>(m_vEntries.size()) ) ) + if ( ( nPos >= 0 ) && ( nPos < static_cast<tools::Long>(m_vEntries.size()) ) ) { m_bHasActive = true; m_nActive = nPos; @@ -434,18 +434,18 @@ void ExtensionBox_Impl::DrawRow(vcl::RenderContext& rRenderContext, const tools: auto nMaxTitleWidth = rRect.GetWidth() - ICON_OFFSET; nMaxTitleWidth -= (2 * SMALL_ICON_SIZE) + (4 * SPACE_BETWEEN); rRenderContext.SetFont(aStdFont); - long nLinkWidth = 0; + tools::Long nLinkWidth = 0; if (!rEntry->m_sPublisher.isEmpty()) { nLinkWidth = rRenderContext.GetTextWidth(rEntry->m_sPublisher); nMaxTitleWidth -= nLinkWidth + (2 * SPACE_BETWEEN); } - long aVersionWidth = rRenderContext.GetTextWidth(rEntry->m_sVersion); + tools::Long aVersionWidth = rRenderContext.GetTextWidth(rEntry->m_sVersion); aPos = rRect.TopLeft() + Point(ICON_OFFSET, TOP_OFFSET); rRenderContext.SetFont(aBoldFont); - long aTitleWidth = rRenderContext.GetTextWidth(rEntry->m_sTitle) + (aTextHeight / 3); + tools::Long aTitleWidth = rRenderContext.GetTextWidth(rEntry->m_sTitle) + (aTextHeight / 3); if (aTitleWidth > nMaxTitleWidth - aVersionWidth) { aTitleWidth = nMaxTitleWidth - aVersionWidth - (aTextHeight / 3); @@ -459,8 +459,8 @@ void ExtensionBox_Impl::DrawRow(vcl::RenderContext& rRenderContext, const tools: rRenderContext.SetFont(aStdFont); rRenderContext.DrawText(Point(aPos.X() + aTitleWidth, aPos.Y()), rEntry->m_sVersion); - long nIconHeight = TOP_OFFSET + SMALL_ICON_SIZE; - long nTitleHeight = TOP_OFFSET + GetTextHeight(); + tools::Long nIconHeight = TOP_OFFSET + SMALL_ICON_SIZE; + tools::Long nTitleHeight = TOP_OFFSET + GetTextHeight(); if ( nIconHeight < nTitleHeight ) aTextHeight = nTitleHeight; else @@ -481,7 +481,7 @@ void ExtensionBox_Impl::DrawRow(vcl::RenderContext& rRenderContext, const tools: aPos.AdjustY(aTextHeight ); if (rEntry->m_bActive) { - long nExtraHeight = 0; + tools::Long nExtraHeight = 0; if (rEntry->m_bHasButtons) nExtraHeight = 2; @@ -493,7 +493,7 @@ void ExtensionBox_Impl::DrawRow(vcl::RenderContext& rRenderContext, const tools: { //replace LF to space, so words do not stick together in one line view sDescription = sDescription.replace(0x000A, ' '); - const long nWidth = rRenderContext.GetTextWidth( sDescription ); + const tools::Long nWidth = rRenderContext.GetTextWidth( sDescription ); if (nWidth > rRect.GetWidth() - aPos.X()) sDescription = rRenderContext.GetEllipsisString(sDescription, rRect.GetWidth() - aPos.X()); rRenderContext.DrawText(aPos, sDescription); @@ -569,10 +569,10 @@ void ExtensionBox_Impl::RecalcAll() // If there is unused space below the last entry but all entries don't fit into the box, // move the content down to use the whole space - const long nTotalHeight = GetTotalHeight(); + const tools::Long nTotalHeight = GetTotalHeight(); if ( m_bHasScrollBar && ( aOutputSize.Height() + m_nTopIndex > nTotalHeight ) ) { - long nOffset = m_nTopIndex; + tools::Long nOffset = m_nTopIndex; m_nTopIndex = nTotalHeight - aOutputSize.Height(); nOffset -= m_nTopIndex; aEntryRect.Move( 0, nOffset ); @@ -592,11 +592,11 @@ bool ExtensionBox_Impl::HandleCursorKey( sal_uInt16 nKeyCode ) if ( m_vEntries.empty() ) return true; - long nSelect = 0; + tools::Long nSelect = 0; if ( m_bHasActive ) { - long nPageSize = GetOutputSizePixel().Height() / m_nStdHeight; + tools::Long nPageSize = GetOutputSizePixel().Height() / m_nStdHeight; if ( nPageSize < 2 ) nPageSize = 2; @@ -623,7 +623,7 @@ bool ExtensionBox_Impl::HandleCursorKey( sal_uInt16 nKeyCode ) if ( nSelect < 0 ) nSelect = 0; - if ( nSelect >= static_cast<long>(m_vEntries.size()) ) + if ( nSelect >= static_cast<tools::Long>(m_vEntries.size()) ) nSelect = m_vEntries.size() - 1; selectEntry( nSelect ); @@ -655,9 +655,9 @@ void ExtensionBox_Impl::Paint(vcl::RenderContext& rRenderContext, const tools::R } -long ExtensionBox_Impl::GetTotalHeight() const +tools::Long ExtensionBox_Impl::GetTotalHeight() const { - long nHeight = m_vEntries.size() * m_nStdHeight; + tools::Long nHeight = m_vEntries.size() * m_nStdHeight; if ( m_bHasActive ) { @@ -712,9 +712,9 @@ void ExtensionBox_Impl::SetDrawingArea(weld::DrawingArea* pDrawingArea) Init(); } -long ExtensionBox_Impl::PointToPos( const Point& rPos ) +tools::Long ExtensionBox_Impl::PointToPos( const Point& rPos ) { - long nPos = ( rPos.Y() + m_nTopIndex ) / m_nStdHeight; + tools::Long nPos = ( rPos.Y() + m_nTopIndex ) / m_nStdHeight; if ( m_bHasActive && ( nPos > m_nActive ) ) { @@ -732,7 +732,7 @@ bool ExtensionBox_Impl::MouseMove( const MouseEvent& rMEvt ) bool bOverHyperlink = false; auto nPos = PointToPos( rMEvt.GetPosPixel() ); - if ( ( nPos >= 0 ) && ( nPos < static_cast<long>(m_vEntries.size()) ) ) + if ( ( nPos >= 0 ) && ( nPos < static_cast<tools::Long>(m_vEntries.size()) ) ) { const auto& rEntry = m_vEntries[nPos]; bOverHyperlink = !rEntry->m_sPublisher.isEmpty() && rEntry->m_aLinkRect.IsInside(rMEvt.GetPosPixel()); @@ -749,7 +749,7 @@ bool ExtensionBox_Impl::MouseMove( const MouseEvent& rMEvt ) OUString ExtensionBox_Impl::RequestHelp(tools::Rectangle& rRect) { auto nPos = PointToPos( rRect.TopLeft() ); - if ( ( nPos >= 0 ) && ( nPos < static_cast<long>(m_vEntries.size()) ) ) + if ( ( nPos >= 0 ) && ( nPos < static_cast<tools::Long>(m_vEntries.size()) ) ) { const auto& rEntry = m_vEntries[nPos]; bool bOverHyperlink = !rEntry->m_sPublisher.isEmpty() && rEntry->m_aLinkRect.IsInside(rRect); @@ -773,7 +773,7 @@ bool ExtensionBox_Impl::MouseButtonDown( const MouseEvent& rMEvt ) { auto nPos = PointToPos( rMEvt.GetPosPixel() ); - if ( ( nPos >= 0 ) && ( nPos < static_cast<long>(m_vEntries.size()) ) ) + if ( ( nPos >= 0 ) && ( nPos < static_cast<tools::Long>(m_vEntries.size()) ) ) { const auto& rEntry = m_vEntries[nPos]; if (!rEntry->m_sPublisher.isEmpty() && rEntry->m_aLinkRect.IsInside(rMEvt.GetPosPixel())) @@ -815,8 +815,8 @@ bool ExtensionBox_Impl::KeyInput(const KeyEvent& rKEvt) return bHandled; } -bool ExtensionBox_Impl::FindEntryPos( const TEntry_Impl& rEntry, const long nStart, - const long nEnd, long &nPos ) +bool ExtensionBox_Impl::FindEntryPos( const TEntry_Impl& rEntry, const tools::Long nStart, + const tools::Long nEnd, tools::Long &nPos ) { nPos = nStart; if ( nStart > nEnd ) @@ -846,7 +846,7 @@ bool ExtensionBox_Impl::FindEntryPos( const TEntry_Impl& rEntry, const long nSta } } - const long nMid = nStart + ( ( nEnd - nStart ) / 2 ); + const tools::Long nMid = nStart + ( ( nEnd - nStart ) / 2 ); eCompare = rEntry->CompareTo( m_pCollator.get(), m_vEntries[ nMid ] ); if ( eCompare < 0 ) @@ -904,7 +904,7 @@ void ExtensionBox_Impl::addEntry( const uno::Reference< deployment::XPackage > & { osl::MutexGuard guard(m_entriesMutex); - long nPos = 0; + tools::Long nPos = 0; if (m_vEntries.empty()) { addEventListenerOnce(xPackage); @@ -989,7 +989,7 @@ void ExtensionBox_Impl::removeEntry( const uno::Reference< deployment::XPackage [&xPackage](const TEntry_Impl& rxEntry) { return rxEntry->m_xPackage == xPackage; }); if (iIndex != m_vEntries.end()) { - long nPos = iIndex - m_vEntries.begin(); + tools::Long nPos = iIndex - m_vEntries.begin(); // Entries mustn't be removed here, because they contain a hyperlink control // which can only be deleted when the thread has the solar mutex. Therefore @@ -1009,7 +1009,7 @@ void ExtensionBox_Impl::removeEntry( const uno::Reference< deployment::XPackage if ( nPos < m_nActive ) m_nActive -= 1; else if ( ( nPos == m_nActive ) && - ( nPos == static_cast<long>(m_vEntries.size()) ) ) + ( nPos == static_cast<tools::Long>(m_vEntries.size()) ) ) m_nActive -= 1; m_bHasActive = false; @@ -1066,9 +1066,9 @@ void ExtensionBox_Impl::prepareChecking() void ExtensionBox_Impl::checkEntries() { - long nNewPos = -1; - long nChangedActivePos = -1; - long nPos = 0; + tools::Long nNewPos = -1; + tools::Long nChangedActivePos = -1; + tools::Long nPos = 0; bool bNeedsUpdate = false; { diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx index 7a1eeb46b443..d706975dcdfd 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx @@ -113,10 +113,10 @@ class ExtensionBox_Impl : public weld::CustomWidgetController bool m_bInDelete : 1; //Must be guarded together with m_vEntries to ensure a valid index at all times. //Use m_entriesMutex as guard. - long m_nActive; - long m_nTopIndex; - long m_nStdHeight; - long m_nActiveHeight; + tools::Long m_nActive; + tools::Long m_nTopIndex; + tools::Long m_nStdHeight; + tools::Long m_nActiveHeight; Image m_aSharedImage; Image m_aLockedImage; Image m_aWarningImage; @@ -149,12 +149,12 @@ class ExtensionBox_Impl : public weld::CustomWidgetController void cleanVecListenerAdded(); void addEventListenerOnce(css::uno::Reference<css::deployment::XPackage> const & extension); - void CalcActiveHeight( const long nPos ); - long GetTotalHeight() const; + void CalcActiveHeight( const tools::Long nPos ); + tools::Long GetTotalHeight() const; void SetupScrollBar(); void DrawRow(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect, const TEntry_Impl& rEntry); bool HandleCursorKey( sal_uInt16 nKeyCode ); - bool FindEntryPos( const TEntry_Impl& rEntry, long nStart, long nEnd, long &nFound ); + bool FindEntryPos( const TEntry_Impl& rEntry, tools::Long nStart, tools::Long nEnd, tools::Long &nFound ); void DeleteRemoved(); DECL_LINK( ScrollHdl, weld::ScrolledWindow&, void ); @@ -173,16 +173,16 @@ public: virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; - TEntry_Impl const & GetEntryData( long nPos ) { return m_vEntries[ nPos ]; } - long GetEntryCount() const { return static_cast<long>(m_vEntries.size()); } - tools::Rectangle GetEntryRect( const long nPos ) const; + TEntry_Impl const & GetEntryData( tools::Long nPos ) { return m_vEntries[ nPos ]; } + tools::Long GetEntryCount() const { return static_cast<tools::Long>(m_vEntries.size()); } + tools::Rectangle GetEntryRect( const tools::Long nPos ) const; bool HasActive() const { return m_bHasActive; } - long PointToPos( const Point& rPos ); + tools::Long PointToPos( const Point& rPos ); virtual void RecalcAll(); void RemoveUnlocked(); - virtual void selectEntry( const long nPos ); + virtual void selectEntry( const tools::Long nPos ); void addEntry(const css::uno::Reference<css::deployment::XPackage> &xPackage, bool bLicenseMissing = false ); void updateEntry(const css::uno::Reference<css::deployment::XPackage> &xPackage ); diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 34a9893bb134..1acdbd58841b 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -506,8 +506,8 @@ RectangleAndPart RectangleAndPart::Create(const std::string& rPayload) } std::istringstream aStream(rPayload); - long nLeft, nTop, nWidth, nHeight; - long nPart = INT_MIN; + tools::Long nLeft, nTop, nWidth, nHeight; + tools::Long nPart = INT_MIN; char nComma; if (comphelper::LibreOfficeKit::isPartInInvalidation()) { @@ -755,8 +755,8 @@ css::uno::Reference< css::document::XUndoManager > getUndoManager( const css::un // Adjusts page margins for Writer doc. Needed by ToggleOrientation void ExecuteMarginLRChange( - const long nPageLeftMargin, - const long nPageRightMargin, + const tools::Long nPageLeftMargin, + const tools::Long nPageRightMargin, SvxLongLRSpaceItem* pPageLRMarginItem) { pPageLRMarginItem->SetLeft( nPageLeftMargin ); @@ -767,8 +767,8 @@ void ExecuteMarginLRChange( // Adjusts page margins for Writer doc. Needed by ToggleOrientation void ExecuteMarginULChange( - const long nPageTopMargin, - const long nPageBottomMargin, + const tools::Long nPageTopMargin, + const tools::Long nPageBottomMargin, SvxLongULSpaceItem* pPageULMarginItem) { pPageULMarginItem->SetUpper( nPageTopMargin ); @@ -786,7 +786,7 @@ void ExecuteOrientationChange() std::unique_ptr<SvxLongULSpaceItem> pPageULMarginItem(new SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE )); // 1mm in twips rounded // This should be in sync with MINBODY in sw/source/uibase/sidebar/PageMarginControl.hxx - constexpr long MINBODY = 56; + constexpr tools::Long MINBODY = 56; css::uno::Reference< css::document::XUndoManager > mxUndoManager( getUndoManager( SfxViewFrame::Current()->GetFrame().GetFrameInterface() ) ); @@ -822,8 +822,8 @@ void ExecuteOrientationChange() // swap the width and height of the page size - const long nRotatedWidth = pPageSizeItem->GetSize().Height(); - const long nRotatedHeight = pPageSizeItem->GetSize().Width(); + const tools::Long nRotatedWidth = pPageSizeItem->GetSize().Height(); + const tools::Long nRotatedHeight = pPageSizeItem->GetSize().Width(); pPageSizeItem->SetSize(Size(nRotatedWidth, nRotatedHeight)); @@ -839,11 +839,11 @@ void ExecuteOrientationChange() // check, if margin values still fit to the changed page size. // if not, adjust margin values { - const long nML = pPageLRMarginItem->GetLeft(); - const long nMR = pPageLRMarginItem->GetRight(); - const long nTmpPW = nML + nMR + MINBODY; + const tools::Long nML = pPageLRMarginItem->GetLeft(); + const tools::Long nMR = pPageLRMarginItem->GetRight(); + const tools::Long nTmpPW = nML + nMR + MINBODY; - const long nPW = pPageSizeItem->GetSize().Width(); + const tools::Long nPW = pPageSizeItem->GetSize().Width(); if ( nTmpPW > nPW ) { @@ -857,11 +857,11 @@ void ExecuteOrientationChange() } } - const long nMT = pPageULMarginItem->GetUpper(); - const long nMB = pPageULMarginItem->GetLower(); - const long nTmpPH = nMT + nMB + MINBODY; + const tools::Long nMT = pPageULMarginItem->GetUpper(); + const tools::Long nMB = pPageULMarginItem->GetLower(); + const tools::Long nTmpPH = nMT + nMB + MINBODY; - const long nPH = pPageSizeItem->GetSize().Height(); + const tools::Long nPH = pPageSizeItem->GetSize().Height(); if ( nTmpPH > nPH ) { @@ -1037,8 +1037,8 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, const int nTileWidth, const int nTileHeight); static int doc_getTileMode(LibreOfficeKitDocument* pThis); static void doc_getDocumentSize(LibreOfficeKitDocument* pThis, - long* pWidth, - long* pHeight); + tools::Long* pWidth, + tools::Long* pHeight); static void doc_initializeForRendering(LibreOfficeKitDocument* pThis, const char* pArguments); @@ -1819,7 +1819,7 @@ bool CallbackFlushHandler::processWindowEvent(CallbackData& aCallbackData) } std::istringstream aRectStream(aRectStr); - long nLeft, nTop, nWidth, nHeight; + tools::Long nLeft, nTop, nWidth, nHeight; char nComma; aRectStream >> nLeft >> nComma >> nTop >> nComma >> nWidth >> nComma >> nHeight; tools::Rectangle aNewRect(nLeft, nTop, nLeft + nWidth, nTop + nHeight); @@ -1834,7 +1834,7 @@ bool CallbackFlushHandler::processWindowEvent(CallbackData& aCallbackData) { // Not possible that we encounter an empty rectangle here; we already handled this case above. std::istringstream aOldRectStream(aOldTree.get<std::string>("rectangle", "")); - long nOldLeft, nOldTop, nOldWidth, nOldHeight; + tools::Long nOldLeft, nOldTop, nOldWidth, nOldHeight; char nOldComma; aOldRectStream >> nOldLeft >> nOldComma >> nOldTop >> nOldComma >> nOldWidth >> nOldComma >> nOldHeight; @@ -3314,8 +3314,8 @@ static int doc_getTileMode(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis* } static void doc_getDocumentSize(LibreOfficeKitDocument* pThis, - long* pWidth, - long* pHeight) + tools::Long* pWidth, + tools::Long* pHeight) { comphelper::ProfileZone aZone("doc_getDocumentSize"); diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index a71224b985af..a354b2960942 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -34,7 +34,7 @@ #include <vcl/introwin.hxx> #include <vcl/virdev.hxx> -#define NOT_LOADED (long(-1)) +#define NOT_LOADED (tools::Long(-1)) #define NOT_LOADED_COLOR (Color(0xffffffff)) using namespace ::com::sun::star::lang; @@ -90,11 +90,11 @@ private: bool _bShowLogo; bool _bFullScreenSplash; bool _bProgressEnd; - long _height, _width, _tlx, _tly, _barwidth; - long _barheight, _barspace, _textBaseline; + tools::Long _height, _width, _tlx, _tly, _barwidth; + tools::Long _barheight, _barspace, _textBaseline; double _fXPos, _fYPos; double _fWidth, _fHeight; - static constexpr long _xoffset = 12, _yoffset = 18; + static constexpr tools::Long _xoffset = 12, _yoffset = 18; public: SplashScreen(); @@ -579,7 +579,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const tools:: ControlState::ENABLED, aValue, aNativeControlRegion, aNativeContentRegion)) { - long nProgressHeight = aNativeControlRegion.GetHeight(); + tools::Long nProgressHeight = aNativeControlRegion.GetHeight(); aDrawRect.AdjustTop( -((nProgressHeight - pSpl->_barheight)/2) ); aDrawRect.AdjustBottom((nProgressHeight - pSpl->_barheight)/2 ); } @@ -597,7 +597,7 @@ void SplashScreenWindow::Paint(vcl::RenderContext& rRenderContext, const tools:: if (pSpl->_bPaintProgress) { // draw progress... - long length = (pSpl->_iProgress * pSpl->_barwidth / pSpl->_iMax) - (2 * pSpl->_barspace); + tools::Long length = (pSpl->_iProgress * pSpl->_barwidth / pSpl->_iMax) - (2 * pSpl->_barspace); if (length < 0) length = 0; // border |