diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-19 10:46:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-19 21:34:15 +0200 |
commit | 5afba3e12c8d4eb1ebb8e087134eb87593bb017a (patch) | |
tree | 065feaadfc8b8da456d0707358bb706c9f90e1e0 /include/svtools | |
parent | 73933ed0a207f1cf210cc4a7d329755bd885f871 (diff) |
use tools::Long in svtools
Change-Id: I2b26da23e625e643dc2bb5393abff3671c457884
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104518
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svtools')
-rw-r--r-- | include/svtools/borderline.hxx | 9 | ||||
-rw-r--r-- | include/svtools/brwbox.hxx | 116 | ||||
-rw-r--r-- | include/svtools/ctrlbox.hxx | 22 | ||||
-rw-r--r-- | include/svtools/editbrowsebox.hxx | 26 | ||||
-rw-r--r-- | include/svtools/ruler.hxx | 98 | ||||
-rw-r--r-- | include/svtools/svparser.hxx | 7 | ||||
-rw-r--r-- | include/svtools/tabbar.hxx | 16 | ||||
-rw-r--r-- | include/svtools/unitconv.hxx | 15 | ||||
-rw-r--r-- | include/svtools/valueset.hxx | 18 |
9 files changed, 165 insertions, 162 deletions
diff --git a/include/svtools/borderline.hxx b/include/svtools/borderline.hxx index 1d7d9f1cd2f7..efd233dd87ac 100644 --- a/include/svtools/borderline.hxx +++ b/include/svtools/borderline.hxx @@ -22,6 +22,7 @@ #include <svtools/svtdllapi.h> #include <o3tl/typed_flags_set.hxx> +#include <tools/long.hxx> /** Class computing border widths shared between Line style listbox and the @@ -65,11 +66,11 @@ public: bool operator== ( const BorderWidthImpl& r ) const; - long GetLine1 ( long nWidth ) const; - long GetLine2( long nWidth ) const; - long GetGap( long nWidth ) const; + tools::Long GetLine1 ( tools::Long nWidth ) const; + tools::Long GetLine2( tools::Long nWidth ) const; + tools::Long GetGap( tools::Long nWidth ) const; - long GuessWidth( long nLine1, long nLine2, long nGap ); + tools::Long GuessWidth( tools::Long nLine1, tools::Long nLine2, tools::Long nGap ); bool IsEmpty( ) const { return (0 == m_nRate1) && (0 == m_nRate2); } bool IsDouble( ) const { return (0 != m_nRate1) && (0 != m_nRate2); } diff --git a/include/svtools/brwbox.hxx b/include/svtools/brwbox.hxx index e466a89d4d14..b5c64abed6aa 100644 --- a/include/svtools/brwbox.hxx +++ b/include/svtools/brwbox.hxx @@ -54,7 +54,7 @@ namespace vcl { } #define BROWSER_INVALIDID SAL_MAX_UINT16 -#define BROWSER_ENDOFSELECTION (static_cast<long>(SFX_ENDOFSELECTION)) +#define BROWSER_ENDOFSELECTION (static_cast<tools::Long>(SFX_ENDOFSELECTION)) enum class BrowserMode { @@ -119,19 +119,19 @@ namespace o3tl class BrowseEvent { VclPtr<vcl::Window> pWin; - long nRow; + tools::Long nRow; tools::Rectangle aRect; sal_uInt16 nCol; sal_uInt16 nColId; public: BrowseEvent( vcl::Window* pWindow, - long nAbsRow, + tools::Long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId, const tools::Rectangle& rRect ); vcl::Window* GetWindow() const { return pWin; } - long GetRow() const { return nRow; } + tools::Long GetRow() const { return nRow; } sal_uInt16 GetColumn() const { return nCol; } sal_uInt16 GetColumnId() const { return nColId; } const tools::Rectangle& GetRect() const { return aRect; } @@ -173,8 +173,8 @@ public: sal_uInt16 nUpdateLock; // lock count, don't call Control::Update()! short nCursorHidden; // new counter for DoHide/ShowCursor - long m_nDragRowDividerLimit; - long m_nDragRowDividerOffset; + tools::Long m_nDragRowDividerLimit; + tools::Long m_nDragRowDividerOffset; public: explicit BrowserDataWin( BrowseBox* pParent ); @@ -225,7 +225,7 @@ class BrowserMouseEvent: public MouseEvent, public BrowseEvent public: BrowserMouseEvent( BrowserDataWin* pWin, const MouseEvent& rEvt ); BrowserMouseEvent( vcl::Window* pWin, const MouseEvent& rEvt, - long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId, + tools::Long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId, const tools::Rectangle& rRect ); }; @@ -277,7 +277,7 @@ private: VclPtr<ScrollBar> aHScroll; // horizontal scrollbar VclPtr<MeasureStatusBar> aStatusBarHeight; // statusbar, just to measure its height - long nDataRowHeight; // height of a single data-row + tools::Long nDataRowHeight; // height of a single data-row sal_uInt16 nTitleLines; // number of lines in title row sal_uLong nControlAreaWidth; // width of fixed area beneath hscroll bool bColumnCursor; // single columns and fields selectable @@ -287,9 +287,9 @@ private: bool bHLines; // draw lines between rows bool bVLines; // draw lines between columns bool bBootstrapped; // child windows resized etc. - long nTopRow; // no. of first visible row (0...) - long nCurRow; // no. of row with cursor - long nRowCount; // total number of rows in model + tools::Long nTopRow; // no. of first visible row (0...) + tools::Long nCurRow; // no. of row with cursor + tools::Long nRowCount; // total number of rows in model sal_uInt16 nFirstCol; // no. of first visible scrollable column sal_uInt16 nCurColId; // column id of cursor @@ -298,9 +298,9 @@ private: bool bHit; bool mbInteractiveRowHeight; - long nResizeX; // mouse position at start of resizing - long nMinResizeX; // never drag more left - long nDragX; // last dragged column (MouseMove) + tools::Long nResizeX; // mouse position at start of resizing + tools::Long nMinResizeX; // never drag more left + tools::Long nDragX; // last dragged column (MouseMove) sal_uInt16 nResizeCol; // resize this column in MouseMove bool bResizing; // mouse captured for column resizing @@ -317,17 +317,17 @@ private: union { MultiSelection* pSel; // selected rows for multi-selection - long nSel; // selected row for single-selection + tools::Long nSel; // selected row for single-selection } uRow; std::unique_ptr<MultiSelection> pColSel; // selected column-ids // fdo#83943, detect if making the cursor position visible is impossible to achieve struct CursorMoveAttempt { - long m_nCol; - long m_nRow; + tools::Long m_nCol; + tools::Long m_nRow; bool m_bScrolledToReachCell; - CursorMoveAttempt(long nCol, long nRow, bool bScrolledToReachCell) + CursorMoveAttempt(tools::Long nCol, tools::Long nRow, bool bScrolledToReachCell) : m_nCol(nCol) , m_nRow(nRow) , m_bScrolledToReachCell(bScrolledToReachCell) @@ -358,8 +358,8 @@ private: SVT_DLLPRIVATE void UpdateScrollbars(); SVT_DLLPRIVATE void AutoSizeLastColumn(); - SVT_DLLPRIVATE long ImpGetDataRowHeight() const; - SVT_DLLPRIVATE tools::Rectangle ImplFieldRectPixel( long nRow, sal_uInt16 nColId ) const; + SVT_DLLPRIVATE tools::Long ImpGetDataRowHeight() const; + SVT_DLLPRIVATE tools::Rectangle ImplFieldRectPixel( tools::Long nRow, sal_uInt16 nColId ) const; SVT_DLLPRIVATE sal_uInt16 FrozenColCount() const; SVT_DLLPRIVATE void ColumnInserted( sal_uInt16 nPos ); @@ -367,11 +367,11 @@ private: DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar*, void ); DECL_DLLPRIVATE_LINK( StartDragHdl, HeaderBar*, void ); - SVT_DLLPRIVATE long GetFrozenWidth() const; + SVT_DLLPRIVATE tools::Long GetFrozenWidth() const; - SVT_DLLPRIVATE long GetBarHeight() const; + SVT_DLLPRIVATE tools::Long GetBarHeight() const; - bool GoToRow(long nRow, bool bRowColMove, bool bDoNotModifySelection = false ); + bool GoToRow(tools::Long nRow, bool bRowColMove, bool bDoNotModifySelection = false ); bool GoToColumnId( sal_uInt16 nColId, bool bMakeVisible, bool bRowColMove = false); void SelectColumnPos( sal_uInt16 nCol, bool _bSelect, bool bMakeVisible); @@ -395,7 +395,7 @@ protected: // (with the help of RowInserted and RowRemoved), so overriding of // the method is needless public: - virtual long GetRowCount() const override; + virtual tools::Long GetRowCount() const override; protected: // for display in VScrollBar set it e.g. on "?" @@ -408,7 +408,7 @@ protected: @param nRow nRow starts at 0 */ - virtual bool SeekRow( long nRow ) = 0; + virtual bool SeekRow( tools::Long nRow ) = 0; void DrawCursor(); void PaintData(vcl::Window const & rWin, vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect); virtual void PaintField(vcl::RenderContext& rDev, const tools::Rectangle& rRect, sal_uInt16 nColumnId) const = 0; @@ -426,11 +426,11 @@ protected: // numbering of the visible scope has changed // - Scrolling (and thereof resulting in another first visible row) // - Resize the window - virtual void VisibleRowsChanged( long nNewTopRow, sal_uInt16 nNumRows); + virtual void VisibleRowsChanged( tools::Long nNewTopRow, sal_uInt16 nNumRows); // number of visible rows in the window (incl. "truncated" rows) sal_uInt16 GetVisibleRows() const; - long GetTopRow() const { return nTopRow; } + tools::Long GetTopRow() const { return nTopRow; } sal_uInt16 GetFirstVisibleColNumber() const { return nFirstCol; } // Focus-Rect enable / disable @@ -443,7 +443,7 @@ protected: // HACK(virtual create is not called in Ctor) void SetHeaderBar( BrowserHeader* ); - long CalcReverseZoom(long nVal); + tools::Long CalcReverseZoom(tools::Long nVal); const DataFlavorExVector& GetDataFlavors() const; @@ -488,13 +488,13 @@ public: virtual void EndScroll(); virtual void Select(); virtual void DoubleClick( const BrowserMouseEvent& rEvt ); - virtual bool IsCursorMoveAllowed( long nNewRow, sal_uInt16 nNewColId ) const; + virtual bool IsCursorMoveAllowed( tools::Long nNewRow, sal_uInt16 nNewColId ) const; virtual void CursorMoved(); virtual void ColumnMoved( sal_uInt16 nColId ); virtual void ColumnResized( sal_uInt16 nColId ); /// called when the row height has been changed interactively virtual void RowHeightChanged(); - virtual long QueryMinimumRowHeight(); + virtual tools::Long QueryMinimumRowHeight(); // Window-Control (pass to DataWindow) void SetUpdateMode( bool bUpdate ); @@ -509,7 +509,7 @@ public: // inserting, changing, removing and freezing of columns void InsertHandleColumn( sal_uLong nWidth ); void InsertDataColumn( sal_uInt16 nItemId, const OUString& rText, - long nSize, HeaderBarItemBits nBits = HeaderBarItemBits::STDSTYLE, + tools::Long nSize, HeaderBarItemBits nBits = HeaderBarItemBits::STDSTYLE, sal_uInt16 nPos = HEADERBAR_APPEND ); void SetColumnTitle( sal_uInt16 nColumnId, const OUString &rTitle ); void SetColumnWidth( sal_uInt16 nColumnId, sal_uLong nWidth ); @@ -519,10 +519,10 @@ public: void RemoveColumns(); // control of title and data row height - void SetDataRowHeight( long nPixel ); - long GetDataRowHeight() const; + void SetDataRowHeight( tools::Long nPixel ); + tools::Long GetDataRowHeight() const; void SetTitleLines( sal_uInt16 nLines ); - long GetTitleHeight() const; + tools::Long GetTitleHeight() const; // access to dynamic values of cursor row OUString GetColumnTitle( sal_uInt16 nColumnId ) const; @@ -533,56 +533,56 @@ public: bool IsFrozen( sal_uInt16 nColumnId ) const; // movement of visible area - long ScrollColumns( long nColumns ); - long ScrollRows( long nRows ); - void MakeFieldVisible( long nRow, sal_uInt16 nColId ); + tools::Long ScrollColumns( tools::Long nColumns ); + tools::Long ScrollRows( tools::Long nRows ); + void MakeFieldVisible( tools::Long nRow, sal_uInt16 nColId ); // access and movement of cursor - long GetCurRow() const { return nCurRow; } + tools::Long GetCurRow() const { return nCurRow; } sal_uInt16 GetCurColumnId() const { return nCurColId; } - bool GoToRow( long nRow ); + bool GoToRow( tools::Long nRow ); bool GoToColumnId( sal_uInt16 nColId ); - bool GoToRowColumnId( long nRow, sal_uInt16 nColId ); + bool GoToRowColumnId( tools::Long nRow, sal_uInt16 nColId ); // selections virtual void SetNoSelection() override; virtual void SelectAll() override; - virtual void SelectRow( long nRow, bool _bSelect = true, bool bExpand = true ) override; + virtual void SelectRow( tools::Long nRow, bool _bSelect = true, bool bExpand = true ) override; void SelectColumnPos( sal_uInt16 nCol, bool _bSelect = true ) { SelectColumnPos( nCol, _bSelect, true); } void SelectColumnId( sal_uInt16 nColId ) { SelectColumnPos( GetColumnPos(nColId), true, true); } - long GetSelectRowCount() const; + tools::Long GetSelectRowCount() const; sal_uInt16 GetSelectColumnCount() const; - virtual bool IsRowSelected( long nRow ) const override; + virtual bool IsRowSelected( tools::Long nRow ) const override; bool IsColumnSelected( sal_uInt16 nColumnId ) const; - long FirstSelectedRow(); - long LastSelectedRow(); - long NextSelectedRow(); + tools::Long FirstSelectedRow(); + tools::Long LastSelectedRow(); + tools::Long NextSelectedRow(); const MultiSelection* GetColumnSelection() const { return pColSel.get(); } const MultiSelection* GetSelection() const { return bMultiSelection ? uRow.pSel : nullptr; } - long FirstSelectedColumn( ) const; + tools::Long FirstSelectedColumn( ) const; bool IsResizing() const { return bResizing; } // access to positions of fields, column and rows BrowserDataWin& GetDataWindow() const; - tools::Rectangle GetRowRectPixel( long nRow ) const; - tools::Rectangle GetFieldRectPixel( long nRow, sal_uInt16 nColId, + tools::Rectangle GetRowRectPixel( tools::Long nRow ) const; + tools::Rectangle GetFieldRectPixel( tools::Long nRow, sal_uInt16 nColId, bool bRelToBrowser = true) const; - bool IsFieldVisible( long nRow, sal_uInt16 nColId, + bool IsFieldVisible( tools::Long nRow, sal_uInt16 nColId, bool bComplete = false ) const; - long GetRowAtYPosPixel( long nY, + tools::Long GetRowAtYPosPixel( tools::Long nY, bool bRelToBrowser = true ) const; - sal_uInt16 GetColumnAtXPosPixel( long nX ) const; + sal_uInt16 GetColumnAtXPosPixel( tools::Long nX ) const; // invalidations void Clear(); - void RowRemoved( long nRow, long nNumRows = 1, bool bDoPaint = true ); - void RowModified( long nRow, sal_uInt16 nColId = BROWSER_INVALIDID ); - void RowInserted( long nRow, long nNumRows = 1, bool bDoPaint = true, bool bKeepSelection = false ); + void RowRemoved( tools::Long nRow, tools::Long nNumRows = 1, bool bDoPaint = true ); + void RowModified( tools::Long nRow, sal_uInt16 nColId = BROWSER_INVALIDID ); + void RowInserted( tools::Long nRow, tools::Long nNumRows = 1, bool bDoPaint = true, bool bKeepSelection = false ); // miscellaneous bool ReserveControlArea(sal_uInt16 nWidth = USHRT_MAX); @@ -624,7 +624,7 @@ public: @return the text out of the cell */ - virtual OUString GetCellText(long _nRow, sal_uInt16 _nColId) const; + virtual OUString GetCellText(tools::Long _nRow, sal_uInt16 _nColId) const; /** @return the current column count @@ -818,13 +818,13 @@ public: virtual bool HasRowHeader() const override; virtual bool GoToCell( sal_Int32 _nRow, sal_uInt16 _nColumn ) override; virtual void SelectColumn( sal_uInt16 _nColumn, bool _bSelect = true ) override; - virtual bool IsColumnSelected( long _nColumn ) const override; + virtual bool IsColumnSelected( tools::Long _nColumn ) const override; virtual sal_Int32 GetSelectedRowCount() const override; virtual sal_Int32 GetSelectedColumnCount() const override; virtual void GetAllSelectedRows( css::uno::Sequence< sal_Int32 >& _rRows ) const override; virtual void GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumns ) const override; virtual bool IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumn ) const override; - virtual OUString GetAccessibleCellText(long _nRow, sal_uInt16 _nColPos) const override; + virtual OUString GetAccessibleCellText(tools::Long _nRow, sal_uInt16 _nColPos) const override; virtual bool GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr, int nIndex, int nLen, MetricVector& rVector ) override; virtual tools::Rectangle GetWindowExtentsRelative(const vcl::Window *pRelativeWindow) const override; virtual void GrabFocus() override; diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index 68631f7f0d20..be530e97f5e5 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -48,12 +48,12 @@ private: Color ( * m_pColor2Fn )( Color ); Color ( * m_pColorDistFn )( Color, Color ); - long m_nMinWidth; + tools::Long m_nMinWidth; SvxBorderLineStyle m_nStyle; public: ImpLineListData( BorderWidthImpl aWidthImpl, - SvxBorderLineStyle nStyle, long nMinWidth, Color ( *pColor1Fn )( Color ), + SvxBorderLineStyle nStyle, tools::Long nMinWidth, Color ( *pColor1Fn )( Color ), Color ( *pColor2Fn )( Color ), Color ( *pColorDistFn )( Color, Color ) ) : m_aWidthImpl( aWidthImpl ), m_pColor1Fn( pColor1Fn ), @@ -65,13 +65,13 @@ public: } /** Returns the computed width of the line 1 in twips. */ - long GetLine1ForWidth( long nWidth ) { return m_aWidthImpl.GetLine1( nWidth ); } + tools::Long GetLine1ForWidth( tools::Long nWidth ) { return m_aWidthImpl.GetLine1( nWidth ); } /** Returns the computed width of the line 2 in twips. */ - long GetLine2ForWidth( long nWidth ) { return m_aWidthImpl.GetLine2( nWidth ); } + tools::Long GetLine2ForWidth( tools::Long nWidth ) { return m_aWidthImpl.GetLine2( nWidth ); } /** Returns the computed width of the gap in twips. */ - long GetDistForWidth( long nWidth ) { return m_aWidthImpl.GetGap( nWidth ); } + tools::Long GetDistForWidth( tools::Long nWidth ) { return m_aWidthImpl.GetGap( nWidth ); } Color GetColorLine1( const Color& rMain ) { @@ -89,7 +89,7 @@ public: } /** Returns the minimum width in twips */ - long GetMinWidth( ) const { return m_nMinWidth;} + tools::Long GetMinWidth( ) const { return m_nMinWidth;} SvxBorderLineStyle GetStyle( ) const { return m_nStyle;} }; @@ -209,18 +209,18 @@ public: ~SvtLineListBox(); /** Set the width in Twips */ - void SetWidth(long nWidth) + void SetWidth(tools::Long nWidth) { m_nWidth = nWidth; UpdateEntries(); UpdatePreview(); } - long GetWidth() const { return m_nWidth; } + tools::Long GetWidth() const { return m_nWidth; } /** Insert a listbox entry with all widths in Twips. */ void InsertEntry(const BorderWidthImpl& rWidthImpl, - SvxBorderLineStyle nStyle, long nMinWidth = 0, + SvxBorderLineStyle nStyle, tools::Long nMinWidth = 0, ColorFunc pColor1Fn = &sameColor, ColorFunc pColor2Fn = &sameColor, ColorDistFunc pColorDistFn = &sameDistColor); @@ -245,7 +245,7 @@ public: private: - SVT_DLLPRIVATE void ImpGetLine( long nLine1, long nLine2, long nDistance, + SVT_DLLPRIVATE void ImpGetLine( tools::Long nLine1, tools::Long nLine2, tools::Long nDistance, Color nColor1, Color nColor2, Color nColorDist, SvxBorderLineStyle nStyle, BitmapEx& rBmp ); @@ -279,7 +279,7 @@ private: std::unique_ptr<weld::CustomWeld> m_xLineSetWin; std::vector<std::unique_ptr<ImpLineListData>> m_vLineList; - long m_nWidth; + tools::Long m_nWidth; ScopedVclPtr<VirtualDevice> aVirDev; Color aColor; Color maPaintCol; diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx index a4a4ee182ee0..1ba2817a4ed9 100644 --- a/include/svtools/editbrowsebox.hxx +++ b/include/svtools/editbrowsebox.hxx @@ -837,8 +837,8 @@ namespace svt // In ActivateCell, we grab the focus asynchronously, but if between requesting activation // and the asynchronous event the focus has changed, we won't grab it for ourself. - long nPaintRow; // row being painted - long nEditRow; + tools::Long nPaintRow; // row being painted + tools::Long nEditRow; sal_uInt16 nEditCol; bool bHasFocus : 1; @@ -867,7 +867,7 @@ namespace svt virtual void ColumnResized(sal_uInt16 nColId) override; virtual void Resize() override; virtual void ArrangeControls(sal_uInt16& nX, sal_uInt16 nY); - virtual bool SeekRow(long nRow) override; + virtual bool SeekRow(tools::Long nRow) override; virtual void GetFocus() override; virtual void LoseFocus() override; @@ -886,14 +886,14 @@ namespace svt virtual void EndScroll() override; // should be used instead of GetFieldRectPixel, 'cause this method here takes into account the borders - tools::Rectangle GetCellRect(long nRow, sal_uInt16 nColId, bool bRelToBrowser = true) const; - virtual sal_uInt32 GetTotalCellWidth(long nRow, sal_uInt16 nColId); + tools::Rectangle GetCellRect(tools::Long nRow, sal_uInt16 nColId, bool bRelToBrowser = true) const; + virtual sal_uInt32 GetTotalCellWidth(tools::Long nRow, sal_uInt16 nColId); sal_uInt32 GetAutoColumnWidth(sal_uInt16 nColId); virtual void PaintStatusCell(OutputDevice& rDev, const tools::Rectangle& rRect) const; virtual void PaintCell(OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColId) const = 0; - virtual RowStatus GetRowStatus(long nRow) const; + virtual RowStatus GetRowStatus(tools::Long nRow) const; virtual void RowHeightChanged() override; @@ -903,7 +903,7 @@ namespace svt // when changing a row: // CursorMoving: cursor is being moved, but GetCurRow() still provides the old row - virtual bool CursorMoving(long nNewRow, sal_uInt16 nNewCol); + virtual bool CursorMoving(tools::Long nNewRow, sal_uInt16 nNewCol); // cursor has been moved virtual void CursorMoved() override; @@ -915,8 +915,8 @@ namespace svt virtual bool IsModified() const {return aController.is() && aController->IsValueChangedFromSaved();} - virtual CellController* GetController(long nRow, sal_uInt16 nCol); - virtual void InitController(CellControllerRef& rController, long nRow, sal_uInt16 nCol); + virtual CellController* GetController(tools::Long nRow, sal_uInt16 nCol); + virtual void InitController(CellControllerRef& rController, tools::Long nRow, sal_uInt16 nCol); static void ResizeController(CellControllerRef const & rController, const tools::Rectangle&); virtual void DoubleClick(const BrowserMouseEvent&) override; @@ -934,7 +934,7 @@ namespace svt // result in traveling to the next or to th previous cell virtual bool IsTabAllowed(bool bForward) const; - virtual bool IsCursorMoveAllowed(long nNewRow, sal_uInt16 nNewColId) const override; + virtual bool IsCursorMoveAllowed(tools::Long nNewRow, sal_uInt16 nNewColId) const override; void PaintTristate(const tools::Rectangle& rRect, const TriState& eState, bool _bEnabled=true) const; @@ -947,7 +947,7 @@ namespace svt virtual void dispose() override; bool IsEditing() const {return aController.is();} - void InvalidateStatusCell(long nRow) {RowModified(nRow, 0);} + void InvalidateStatusCell(tools::Long nRow) {RowModified(nRow, 0);} void InvalidateHandleColumn(); // late construction @@ -959,7 +959,7 @@ namespace svt EditBrowseBoxFlags GetBrowserFlags() const { return m_nBrowserFlags; } void SetBrowserFlags(EditBrowseBoxFlags nFlags); - virtual void ActivateCell(long nRow, sal_uInt16 nCol, bool bSetCellFocus = true); + virtual void ActivateCell(tools::Long nRow, sal_uInt16 nCol, bool bSetCellFocus = true); virtual void DeactivateCell(bool bUpdate = true); // Children --------------------------------------------------------------- @@ -982,7 +982,7 @@ namespace svt virtual bool ProcessKey(const KeyEvent& rEvt) override; - css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCheckBoxCell(long _nRow, sal_uInt16 _nColumnPos,const TriState& eState); + css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleCheckBoxCell(tools::Long _nRow, sal_uInt16 _nColumnPos,const TriState& eState); bool ControlHasFocus() const; protected: // creates the accessible which wraps the active cell diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx index 686b50a96d48..7ea4771d5f53 100644 --- a/include/svtools/ruler.hxx +++ b/include/svtools/ruler.hxx @@ -508,11 +508,11 @@ namespace o3tl { struct RulerBorder { - long nPos; - long nWidth; + tools::Long nPos; + tools::Long nWidth; RulerBorderStyle nStyle; - long nMinPos; //minimum/maximum position, supported for table borders/rows - long nMaxPos; + tools::Long nMinPos; //minimum/maximum position, supported for table borders/rows + tools::Long nMaxPos; }; enum class RulerIndentStyle { @@ -521,7 +521,7 @@ enum class RulerIndentStyle { struct RulerIndent { - long nPos; + tools::Long nPos; RulerIndentStyle nStyle; bool bInvisible; }; @@ -537,20 +537,20 @@ constexpr sal_uInt16 RULER_TAB_RTL = 0x0010; struct RulerTab { - long nPos; + tools::Long nPos; sal_uInt16 nStyle; }; struct RulerLine { - long nPos; + tools::Long nPos; }; struct RulerSelection { - long nPos; + tools::Long nPos; RulerType eType; sal_uInt16 nAryPos; RulerDragSize mnDragSize; @@ -573,7 +573,7 @@ struct RulerSelection struct RulerUnitData { MapUnit eMapUnit; // MAP_UNIT for calculation - long nTickUnit; // Unit divider + tools::Long nTickUnit; // Unit divider double nTick1; // Minimal step double nTick2; // Tick quarter unit double nTick3; // Tick half unit @@ -611,17 +611,17 @@ class SVT_DLLPUBLIC Ruler : public vcl::Window private: ScopedVclPtr<VirtualDevice> maVirDev; MapMode maMapMode; - long mnBorderOff; - long mnWinOff; - long mnWinWidth; - long mnWidth; - long mnHeight; - long mnVirOff; - long mnVirWidth; - long mnVirHeight; - long mnBorderWidth; - long mnStartDragPos; - long mnDragPos; + tools::Long mnBorderOff; + tools::Long mnWinOff; + tools::Long mnWinWidth; + tools::Long mnWidth; + tools::Long mnHeight; + tools::Long mnVirOff; + tools::Long mnVirWidth; + tools::Long mnVirHeight; + tools::Long mnBorderWidth; + tools::Long mnStartDragPos; + tools::Long mnDragPos; std::unique_ptr<ImplRulerData> mpSaveData; ImplRulerData* mpData; std::unique_ptr<ImplRulerData> mpDragData; @@ -632,8 +632,8 @@ private: RulerDragSize mnDragSize; sal_uInt16 mnDragModifier; sal_uInt16 mnExtraStyle; - long mnCharWidth; - long mnLineHeight; + tools::Long mnCharWidth; + tools::Long mnLineHeight; RulerExtra meExtraType; RulerType meDragType; @@ -659,22 +659,22 @@ private: std::map<OUString, SalLayoutGlyphs> maTextGlyphs; - SVT_DLLPRIVATE void ImplVDrawLine(vcl::RenderContext& rRenderContext, long nX1, long nY1, long nX2, long nY2 ); - SVT_DLLPRIVATE void ImplVDrawRect(vcl::RenderContext& rRenderContext, long nX1, long nY1, long nX2, long nY2 ); - SVT_DLLPRIVATE void ImplVDrawText(vcl::RenderContext& rRenderContext, long nX, long nY, const OUString& rText, - long nMin = LONG_MIN, long nMax = LONG_MAX ); + SVT_DLLPRIVATE void ImplVDrawLine(vcl::RenderContext& rRenderContext, tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2 ); + SVT_DLLPRIVATE void ImplVDrawRect(vcl::RenderContext& rRenderContext, tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2 ); + SVT_DLLPRIVATE void ImplVDrawText(vcl::RenderContext& rRenderContext, tools::Long nX, tools::Long nY, const OUString& rText, + tools::Long nMin = LONG_MIN, tools::Long nMax = LONG_MAX ); SVT_DLLPRIVATE void ImplDrawTicks(vcl::RenderContext& rRenderContext, - long nMin, long nMax, long nStart, long nVirTop, long nVirBottom); + tools::Long nMin, tools::Long nMax, tools::Long nStart, tools::Long nVirTop, tools::Long nVirBottom); SVT_DLLPRIVATE void ImplDrawBorders(vcl::RenderContext& rRenderContext, - long nMin, long nMax, long nVirTop, long nVirBottom); + tools::Long nMin, tools::Long nMax, tools::Long nVirTop, tools::Long nVirBottom); SVT_DLLPRIVATE static void ImplDrawIndent(vcl::RenderContext& rRenderContext, const tools::Polygon& rPoly, bool bIsHit); SVT_DLLPRIVATE void ImplDrawIndents(vcl::RenderContext& rRenderContext, - long nMin, long nMax, long nVirTop, long nVirBottom); + tools::Long nMin, tools::Long nMax, tools::Long nVirTop, tools::Long nVirBottom); SVT_DLLPRIVATE void ImplDrawTab(vcl::RenderContext& rRenderContext, const Point& rPos, sal_uInt16 nStyle); SVT_DLLPRIVATE void ImplDrawTabs(vcl::RenderContext& rRenderContext, - long nMin, long nMax, long nVirTop, long nVirBottom); + tools::Long nMin, tools::Long nMax, tools::Long nVirTop, tools::Long nVirBottom); using Window::ImplInit; SVT_DLLPRIVATE void ImplInit( WinBits nWinBits ); @@ -703,7 +703,7 @@ private: Ruler& operator= (const Ruler &) = delete; protected: - long GetRulerVirHeight() const { return mnVirHeight;} + tools::Long GetRulerVirHeight() const { return mnVirHeight;} const MapMode& GetCurrentMapMode() const { return maMapMode; } const RulerUnitData& GetCurrentRulerUnit() const; @@ -730,12 +730,12 @@ public: void Activate() override; void Deactivate() override; - void SetWinPos( long nOff, long nWidth = 0 ); - long GetWinOffset() const { return mnWinOff; } - void SetPagePos( long nOff = 0, long nWidth = 0 ); - long GetPageOffset() const; - void SetBorderPos( long nOff = 0 ); - long GetBorderOffset() const { return mnBorderOff; } + void SetWinPos( tools::Long nOff, tools::Long nWidth = 0 ); + tools::Long GetWinOffset() const { return mnWinOff; } + void SetPagePos( tools::Long nOff = 0, tools::Long nWidth = 0 ); + tools::Long GetPageOffset() const; + void SetBorderPos( tools::Long nOff = 0 ); + tools::Long GetBorderOffset() const { return mnBorderOff; } const tools::Rectangle& GetExtraRect() const { return maExtraRect; } void SetUnit( FieldUnit eNewUnit ); @@ -747,7 +747,7 @@ public: bool StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType ); RulerType GetDragType() const { return meDragType; } - long GetDragPos() const { return mnDragPos; } + tools::Long GetDragPos() const { return mnDragPos; } sal_uInt16 GetDragAryPos() const { return mnDragAryPos; } RulerDragSize GetDragSize() const { return mnDragSize; } bool IsDragDelete() const { return mbDragDelete; } @@ -755,7 +755,7 @@ public: sal_uInt16 GetDragModifier() const { return mnDragModifier; } bool IsDrag() const { return mbDrag; } void CancelDrag(); - long GetClickPos() const { return mnDragPos; } + tools::Long GetClickPos() const { return mnDragPos; } RulerType GetClickType() const { return meDragType; } const RulerSelection& GetHoverSelection() const { return maHoverSelection; } @@ -763,17 +763,17 @@ public: using Window::GetType; RulerType GetType( const Point& rPos, sal_uInt16* pAryPos = nullptr ); - void SetNullOffset( long nPos ); - long GetNullOffset() const; + void SetNullOffset( tools::Long nPos ); + tools::Long GetNullOffset() const; void SetMargin1() { SetMargin1( 0, RulerMarginStyle::Invisible ); } - void SetMargin1( long nPos, RulerMarginStyle nMarginStyle = RulerMarginStyle::Sizeable ); - long GetMargin1() const; + void SetMargin1( tools::Long nPos, RulerMarginStyle nMarginStyle = RulerMarginStyle::Sizeable ); + tools::Long GetMargin1() const; void SetMargin2() { SetMargin2( 0, RulerMarginStyle::Invisible ); } - void SetMargin2( long nPos, RulerMarginStyle nMarginStyle = RulerMarginStyle::Sizeable ); - long GetMargin2() const; + void SetMargin2( tools::Long nPos, RulerMarginStyle nMarginStyle = RulerMarginStyle::Sizeable ); + tools::Long GetMargin2() const; - void SetLeftFrameMargin( long nPos ); - void SetRightFrameMargin( long nPos ); + void SetLeftFrameMargin( tools::Long nPos ); + void SetRightFrameMargin( tools::Long nPos ); void SetLines( sal_uInt32 n = 0, const RulerLine* pLineAry = nullptr ); void SetBorders( sal_uInt32 n = 0, const RulerBorder* pBrdAry = nullptr ); void SetIndents( sal_uInt32 n = 0, const RulerIndent* pIndentAry = nullptr ); @@ -791,8 +791,8 @@ public: void SetTextRTL(bool bRTL); bool GetTextRTL() const; - void SetCharWidth( long nWidth ) { mnCharWidth = nWidth ; } - void SetLineHeight( long nHeight ) { mnLineHeight = nHeight ; } + void SetCharWidth( tools::Long nWidth ) { mnCharWidth = nWidth ; } + void SetLineHeight( tools::Long nHeight ) { mnLineHeight = nHeight ; } void DrawTicks(); diff --git a/include/svtools/svparser.hxx b/include/svtools/svparser.hxx index 7acd05b5a70c..22185ad5dee2 100644 --- a/include/svtools/svparser.hxx +++ b/include/svtools/svparser.hxx @@ -24,6 +24,7 @@ #include <tools/link.hxx> #include <tools/ref.hxx> #include <tools/solar.h> +#include <tools/long.hxx> #include <rtl/textenc.h> #include <rtl/ustring.hxx> #include <vector> @@ -53,8 +54,8 @@ protected: sal_uLong nlLinePos; // current column number std::unique_ptr<SvParser_Impl<T>> pImplData; // internal data - long m_nTokenIndex; // current token index to detect loops for seeking backwards - long nTokenValue; // additional value (RTF) + tools::Long m_nTokenIndex; // current token index to detect loops for seeking backwards + tools::Long nTokenValue; // additional value (RTF) bool bTokenHasValue; // indicates whether nTokenValue is valid SvParserState eState; // status also in derived classes @@ -70,7 +71,7 @@ protected: struct TokenStackType { OUString sToken; - long nTokenValue; + tools::Long nTokenValue; bool bTokenHasValue; T nTokenId; diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx index bccdbb55d3ed..0fb815dac40f 100644 --- a/include/svtools/tabbar.hxx +++ b/include/svtools/tabbar.hxx @@ -317,12 +317,12 @@ private: OUString maEditText; Size maWinSize; - long mnMaxPageWidth; - long mnCurMaxWidth; - long mnOffX; - long mnOffY; - long mnLastOffX; - long mnSplitSize; + tools::Long mnMaxPageWidth; + tools::Long mnCurMaxWidth; + tools::Long mnOffX; + tools::Long mnOffY; + tools::Long mnLastOffX; + tools::Long mnSplitSize; sal_uInt64 mnSwitchTime; WinBits mnWinStyle; sal_uInt16 mnCurPageId; @@ -441,7 +441,7 @@ public: bool IsPageSelected( sal_uInt16 nPageId ) const; void SetProtectionSymbol( sal_uInt16 nPageId, bool bProtection ); - void SetMaxPageWidth( long nMaxWidth ); + void SetMaxPageWidth( tools::Long nMaxWidth ); void EnableEditMode() { mbAutoEditMode = true; } bool StartEditMode( sal_uInt16 nPageId ); @@ -478,7 +478,7 @@ public: OUString GetPageText( sal_uInt16 nPageId ) const; OUString GetHelpText( sal_uInt16 nPageId ) const; - long GetSplitSize() const { return mnSplitSize; } + tools::Long GetSplitSize() const { return mnSplitSize; } using Window::SetHelpText; using Window::GetHelpText; diff --git a/include/svtools/unitconv.hxx b/include/svtools/unitconv.hxx index 2edf1ade815b..d269037578ac 100644 --- a/include/svtools/unitconv.hxx +++ b/include/svtools/unitconv.hxx @@ -22,6 +22,7 @@ #include <svtools/svtdllapi.h> #include <tools/mapunit.hxx> #include <tools/fldunit.hxx> +#include <tools/long.hxx> namespace weld { class MetricSpinButton; } @@ -29,26 +30,26 @@ namespace weld { class MetricSpinButton; } // typedef --------------------------------------------------------------- -typedef long (*FUNC_CONVERT)(long); +typedef long (*FUNC_CONVERT)(tools::Long); // Functions ------------------------------------------------------------- SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton& rCtrl, FieldUnit eUnit, bool bAll = false); -SVT_DLLPUBLIC long CalcToUnit( float nIn, MapUnit eUnit ); -SVT_DLLPUBLIC long CalcToPoint( long nIn, MapUnit eUnit, sal_uInt16 nFactor ); +SVT_DLLPUBLIC tools::Long CalcToUnit( float nIn, MapUnit eUnit ); +SVT_DLLPUBLIC tools::Long CalcToPoint( tools::Long nIn, MapUnit eUnit, sal_uInt16 nFactor ); -SVT_DLLPUBLIC long ItemToControl( long nIn, MapUnit eItem, FieldUnit eCtrl ); -SVT_DLLPUBLIC long ControlToItem( long nIn, FieldUnit eCtrl, MapUnit eItem ); +SVT_DLLPUBLIC tools::Long ItemToControl( tools::Long nIn, MapUnit eItem, FieldUnit eCtrl ); +SVT_DLLPUBLIC tools::Long ControlToItem( tools::Long nIn, FieldUnit eCtrl, MapUnit eItem ); SVT_DLLPUBLIC FieldUnit MapToFieldUnit( const MapUnit eUnit ); SVT_DLLPUBLIC void SetMetricValue(weld::MetricSpinButton& rField, int lCoreValue, MapUnit eUnit); SVT_DLLPUBLIC int GetCoreValue(const weld::MetricSpinButton& rField, MapUnit eUnit); -SVT_DLLPUBLIC long PointToTwips( long nIn ); +SVT_DLLPUBLIC tools::Long PointToTwips( tools::Long nIn ); -SVT_DLLPUBLIC long TransformMetric( long nVal, FieldUnit aOld, FieldUnit aNew ); +SVT_DLLPUBLIC tools::Long TransformMetric( tools::Long nVal, FieldUnit aOld, FieldUnit aNew ); #endif diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx index d0320fdd5d02..70065b1f281c 100644 --- a/include/svtools/valueset.hxx +++ b/include/svtools/valueset.hxx @@ -199,13 +199,13 @@ private: std::unique_ptr<weld::ScrolledWindow> mxScrolledWindow; tools::Rectangle maNoneItemRect; tools::Rectangle maItemListRect; - long mnItemWidth; - long mnItemHeight; - long mnTextOffset; - long mnVisLines; - long mnLines; - long mnUserItemWidth; - long mnUserItemHeight; + tools::Long mnItemWidth; + tools::Long mnItemHeight; + tools::Long mnTextOffset; + tools::Long mnVisLines; + tools::Long mnLines; + tools::Long mnUserItemWidth; + tools::Long mnUserItemHeight; sal_uInt16 mnSelItemId; int mnSavedItemId; sal_uInt16 mnHighItemId; @@ -330,8 +330,8 @@ public: { return mnUserVisLines; } - void SetItemWidth( long nItemWidth ); - void SetItemHeight( long nLineHeight ); + void SetItemWidth( tools::Long nItemWidth ); + void SetItemHeight( tools::Long nLineHeight ); void SelectItem( sal_uInt16 nItemId ); sal_uInt16 GetSelectedItemId() const |