[Libreoffice-commits] core.git: include/svtools svtools/inc svtools/source
Noel (via logerrit)
logerrit at kemper.freedesktop.org
Mon Oct 19 19:35:05 UTC 2020
include/svtools/borderline.hxx | 9 -
include/svtools/brwbox.hxx | 116 +++++++--------
include/svtools/ctrlbox.hxx | 22 +-
include/svtools/editbrowsebox.hxx | 26 +--
include/svtools/ruler.hxx | 98 ++++++------
include/svtools/svparser.hxx | 7
include/svtools/tabbar.hxx | 16 +-
include/svtools/unitconv.hxx | 15 +
include/svtools/valueset.hxx | 18 +-
svtools/inc/table/tablecontrol.hxx | 4
svtools/inc/table/tablecontrolinterface.hxx | 8 -
svtools/source/brwbox/brwbox1.cxx | 140 +++++++++---------
svtools/source/brwbox/brwbox2.cxx | 100 ++++++-------
svtools/source/brwbox/brwbox3.cxx | 6
svtools/source/brwbox/brwhead.cxx | 2
svtools/source/brwbox/datwin.cxx | 32 ++--
svtools/source/brwbox/editbrowsebox.cxx | 28 +--
svtools/source/brwbox/editbrowsebox2.cxx | 4
svtools/source/config/printoptions.cxx | 2
svtools/source/control/ctrlbox.cxx | 68 ++++----
svtools/source/control/ctrltool.cxx | 8 -
svtools/source/control/ruler.cxx | 206 +++++++++++++--------------
svtools/source/control/tabbar.cxx | 60 +++----
svtools/source/control/valueset.cxx | 54 +++----
svtools/source/dialogs/addresstemplate.cxx | 4
svtools/source/misc/embedhlp.cxx | 8 -
svtools/source/misc/unitconv.cxx | 142 +++++++++---------
svtools/source/svhtml/htmlout.cxx | 2
svtools/source/svrtf/svparser.cxx | 2
svtools/source/table/cellvalueconversion.cxx | 7
svtools/source/table/gridtablerenderer.cxx | 20 +-
svtools/source/table/mousefunction.cxx | 14 -
svtools/source/table/tablecontrol.cxx | 4
svtools/source/table/tablecontrol_impl.cxx | 88 +++++------
svtools/source/table/tablecontrol_impl.hxx | 26 +--
35 files changed, 685 insertions(+), 681 deletions(-)
New commits:
commit 5afba3e12c8d4eb1ebb8e087134eb87593bb017a
Author: Noel <noelgrandin at gmail.com>
AuthorDate: Mon Oct 19 10:46:41 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Oct 19 21:34:15 2020 +0200
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 at collabora.co.uk>
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
diff --git a/svtools/inc/table/tablecontrol.hxx b/svtools/inc/table/tablecontrol.hxx
index 1e780440a05a..7af537b9c19c 100644
--- a/svtools/inc/table/tablecontrol.hxx
+++ b/svtools/inc/table/tablecontrol.hxx
@@ -135,8 +135,8 @@ namespace svt::table
virtual vcl::Window* GetWindowInstance() override;
virtual sal_Int32 GetAccessibleControlCount() const override;
virtual bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint ) override;
- virtual long GetRowCount() const override;
- virtual long GetColumnCount() const override;
+ virtual tools::Long GetRowCount() const override;
+ virtual tools::Long GetColumnCount() const override;
virtual bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint ) override;
virtual tools::Rectangle calcHeaderRect( bool _bIsColumnBar ) override;
virtual tools::Rectangle calcHeaderCellRect( bool _bIsColumnBar, sal_Int32 nPos) override;
diff --git a/svtools/inc/table/tablecontrolinterface.hxx b/svtools/inc/table/tablecontrolinterface.hxx
index 69670d2bdaa6..5314b2952381 100644
--- a/svtools/inc/table/tablecontrolinterface.hxx
+++ b/svtools/inc/table/tablecontrolinterface.hxx
@@ -107,7 +107,7 @@ namespace svt::table
/** the start of the column, in pixels. Might be negative, in case the column is scrolled out of the visible
area. Note: see below.
*/
- long nStartPixel;
+ tools::Long nStartPixel;
/** the end of the column, in pixels, plus 1. Effectively, this is the accumulated width of all columns
up to the current one.
@@ -120,7 +120,7 @@ namespace svt::table
gap. So these doc comments are inconsistent. How
surprising.
*/
- long nEndPixel;
+ tools::Long nEndPixel;
ColumnMetrics()
:nStartPixel(0)
@@ -128,7 +128,7 @@ namespace svt::table
{
}
- ColumnMetrics( long const i_start, long const i_end )
+ ColumnMetrics( tools::Long const i_start, tools::Long const i_end )
:nStartPixel( i_start )
,nEndPixel( i_end )
{
@@ -215,7 +215,7 @@ namespace svt::table
virtual void invalidate( TableArea const i_what ) = 0;
/// calculates a width, given in pixels, into an AppFont-based width
- virtual long pixelWidthToAppFont( long const i_pixels ) const = 0;
+ virtual tools::Long pixelWidthToAppFont( tools::Long const i_pixels ) const = 0;
/// shows a tracking rectangle
virtual void showTracking( tools::Rectangle const & i_location, ShowTrackFlags const i_flags ) = 0;
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 943e888385e8..5eac20c1514e 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -141,7 +141,7 @@ public:
}
};
-long BrowseBox::GetBarHeight() const
+tools::Long BrowseBox::GetBarHeight() const
{
// tdf#115941 because some platforms have things like overlay scrollbars, take a max
// of a statusbar height and a scrollbar height as the control area height
@@ -289,7 +289,7 @@ void BrowseBox::InsertHandleColumn( sal_uLong nWidth )
void BrowseBox::InsertDataColumn( sal_uInt16 nItemId, const OUString& rText,
- long nWidth, HeaderBarItemBits nBits, sal_uInt16 nPos )
+ tools::Long nWidth, HeaderBarItemBits nBits, sal_uInt16 nPos )
{
OSL_ENSURE( nItemId != HandleColumnId, "BrowseBox::InsertDataColumn: nItemId is HandleColumnId" );
@@ -332,8 +332,8 @@ sal_uInt16 BrowseBox::ToggleSelectedColumn()
{
DoHideCursor( "ToggleSelectedColumn" );
ToggleSelection();
- long nSelected = pColSel->FirstSelected();
- if (nSelected != static_cast<long>(SFX_ENDOFSELECTION))
+ tools::Long nSelected = pColSel->FirstSelected();
+ if (nSelected != static_cast<tools::Long>(SFX_ENDOFSELECTION))
nSelectedColId = mvCols[nSelected]->GetId();
pColSel->SelectAll(false);
}
@@ -444,11 +444,11 @@ void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos )
// do scroll, let redraw
if( pDataWin->GetBackground().IsScrollable() )
{
- long nScroll = -aFromRect.GetWidth();
+ tools::Long nScroll = -aFromRect.GetWidth();
tools::Rectangle aScrollArea;
if ( nOldPos > nPos )
{
- long nFrozenWidth = GetFrozenWidth();
+ tools::Long nFrozenWidth = GetFrozenWidth();
if ( aToRect.Left() < nFrozenWidth )
aToRect.SetLeft( nFrozenWidth );
aScrollArea = tools::Rectangle(Point(aToRect.Left(),0),
@@ -565,12 +565,12 @@ void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth )
if ( nWidth < LONG_MAX && mvCols[ nItemPos ]->Width() == nWidth )
return;
- long nOldWidth = mvCols[ nItemPos ]->Width();
+ tools::Long nOldWidth = mvCols[ nItemPos ]->Width();
// adjust last column, if necessary
if ( IsVisible() && nItemPos == mvCols.size() - 1 )
{
- long nMaxWidth = pDataWin->GetSizePixel().Width();
+ tools::Long nMaxWidth = pDataWin->GetSizePixel().Width();
nMaxWidth -= pDataWin->bAutoSizeLastCol
? GetFieldRect(nItemId).Left()
: GetFrozenWidth();
@@ -606,7 +606,7 @@ void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth )
if ( bUpdate )
{
// get X-Pos of the column changed
- long nX = 0;
+ tools::Long nX = 0;
for ( size_t nCol = 0; nCol < nItemPos; ++nCol )
{
BrowserColumn *pCol = mvCols[ nCol ].get();
@@ -824,7 +824,7 @@ OUString BrowseBox::GetColumnTitle( sal_uInt16 nId ) const
return mvCols[ nItemPos ]->Title();
}
-long BrowseBox::GetRowCount() const
+tools::Long BrowseBox::GetRowCount() const
{
return nRowCount;
}
@@ -834,7 +834,7 @@ sal_uInt16 BrowseBox::ColCount() const
return static_cast<sal_uInt16>(mvCols.size());
}
-long BrowseBox::ImpGetDataRowHeight() const
+tools::Long BrowseBox::ImpGetDataRowHeight() const
{
BrowseBox *pThis = const_cast<BrowseBox*>(this);
pThis->nDataRowHeight = pThis->CalcReverseZoom(pDataWin->GetTextHeight() + 4);
@@ -843,7 +843,7 @@ long BrowseBox::ImpGetDataRowHeight() const
return nDataRowHeight;
}
-void BrowseBox::SetDataRowHeight( long nPixel )
+void BrowseBox::SetDataRowHeight( tools::Long nPixel )
{
nDataRowHeight = CalcReverseZoom(nPixel);
@@ -857,11 +857,11 @@ void BrowseBox::SetTitleLines( sal_uInt16 nLines )
nTitleLines = nLines;
}
-long BrowseBox::ScrollColumns( long nCols )
+tools::Long BrowseBox::ScrollColumns( tools::Long nCols )
{
if ( nFirstCol + nCols < 0 ||
- nFirstCol + nCols >= static_cast<long>(mvCols.size()) )
+ nFirstCol + nCols >= static_cast<tools::Long>(mvCols.size()) )
return 0;
// implicitly hides cursor while scrolling
@@ -883,8 +883,8 @@ long BrowseBox::ScrollColumns( long nCols )
}
else
{
- long nDelta = mvCols[ nFirstCol-1 ]->Width();
- long nFrozenWidth = GetFrozenWidth();
+ tools::Long nDelta = mvCols[ nFirstCol-1 ]->Width();
+ tools::Long nFrozenWidth = GetFrozenWidth();
tools::Rectangle aScrollRect( Point( nFrozenWidth + nDelta, 0 ),
Size ( GetOutputSizePixel().Width() - nFrozenWidth - nDelta,
@@ -929,8 +929,8 @@ long BrowseBox::ScrollColumns( long nCols )
}
else
{
- long nDelta = mvCols[ nFirstCol ]->Width();
- long nFrozenWidth = GetFrozenWidth();
+ tools::Long nDelta = mvCols[ nFirstCol ]->Width();
+ tools::Long nFrozenWidth = GetFrozenWidth();
tools::Rectangle aScrollRect( Point( nFrozenWidth, 0 ),
Size ( GetOutputSizePixel().Width() - nFrozenWidth,
@@ -967,7 +967,7 @@ long BrowseBox::ScrollColumns( long nCols )
// adjust external headerbar, if necessary
if ( pDataWin->pHeaderBar )
{
- long nWidth = 0;
+ tools::Long nWidth = 0;
for ( size_t nCol = 0;
nCol < mvCols.size() && nCol < nFirstCol;
++nCol )
@@ -999,12 +999,12 @@ long BrowseBox::ScrollColumns( long nCols )
}
-long BrowseBox::ScrollRows( long nRows )
+tools::Long BrowseBox::ScrollRows( tools::Long nRows )
{
// compute new top row
- long nTmpMin = std::min( static_cast<long>(nTopRow + nRows), static_cast<long>(nRowCount - 1) );
+ tools::Long nTmpMin = std::min( static_cast<tools::Long>(nTopRow + nRows), static_cast<tools::Long>(nRowCount - 1) );
- long nNewTopRow = std::max<long>( nTmpMin, 0 );
+ tools::Long nNewTopRow = std::max<long>( nTmpMin, 0 );
if ( nNewTopRow == nTopRow )
return 0;
@@ -1015,15 +1015,15 @@ long BrowseBox::ScrollRows( long nRows )
VisibleRowsChanged(nNewTopRow, nVisibleRows);
// compute new top row again (nTopRow might have changed!)
- nTmpMin = std::min( static_cast<long>(nTopRow + nRows), static_cast<long>(nRowCount - 1) );
+ nTmpMin = std::min( static_cast<tools::Long>(nTopRow + nRows), static_cast<tools::Long>(nRowCount - 1) );
nNewTopRow = std::max<long>( nTmpMin, 0 );
StartScroll();
// scroll area on screen and/or repaint
- long nDeltaY = GetDataRowHeight() * ( nNewTopRow - nTopRow );
- long nOldTopRow = nTopRow;
+ tools::Long nDeltaY = GetDataRowHeight() * ( nNewTopRow - nTopRow );
+ tools::Long nOldTopRow = nTopRow;
nTopRow = nNewTopRow;
if ( GetUpdateMode() )
@@ -1050,7 +1050,7 @@ long BrowseBox::ScrollRows( long nRows )
}
-void BrowseBox::RowModified( long nRow, sal_uInt16 nColId )
+void BrowseBox::RowModified( tools::Long nRow, sal_uInt16 nColId )
{
if ( !GetUpdateMode() )
@@ -1075,7 +1075,7 @@ void BrowseBox::Clear()
// adjust the total number of rows
DoHideCursor( "Clear" );
- long nOldRowCount = nRowCount;
+ tools::Long nOldRowCount = nRowCount;
nRowCount = 0;
if(bMultiSelection)
{
@@ -1134,7 +1134,7 @@ void BrowseBox::Clear()
);
}
-void BrowseBox::RowInserted( long nRow, long nNumRows, bool bDoPaint, bool bKeepSelection )
+void BrowseBox::RowInserted( tools::Long nRow, tools::Long nNumRows, bool bDoPaint, bool bKeepSelection )
{
if (nRow < 0)
@@ -1152,12 +1152,12 @@ void BrowseBox::RowInserted( long nRow, long nNumRows, bool bDoPaint, bool bKeep
DoHideCursor( "RowInserted" );
// must we paint the new rows?
- long nOldCurRow = nCurRow;
+ tools::Long nOldCurRow = nCurRow;
Size aSz = pDataWin->GetOutputSizePixel();
if ( bDoPaint && nRow >= nTopRow &&
nRow <= nTopRow + aSz.Height() / GetDataRowHeight() )
{
- long nY = (nRow-nTopRow) * GetDataRowHeight();
+ tools::Long nY = (nRow-nTopRow) * GetDataRowHeight();
if ( !bLastRow )
{
// scroll down the rows behind the new row
@@ -1221,7 +1221,7 @@ void BrowseBox::RowInserted( long nRow, long nNumRows, bool bDoPaint, bool bKeep
Any()
);
- for (long i = nRow+1 ; i <= nRowCount ; ++i)
+ for (tools::Long i = nRow+1 ; i <= nRowCount ; ++i)
{
commitHeaderBarEvent(
CHILD,
@@ -1241,7 +1241,7 @@ void BrowseBox::RowInserted( long nRow, long nNumRows, bool bDoPaint, bool bKeep
}
-void BrowseBox::RowRemoved( long nRow, long nNumRows, bool bDoPaint )
+void BrowseBox::RowRemoved( tools::Long nRow, tools::Long nNumRows, bool bDoPaint )
{
if ( nRow < 0 )
@@ -1266,12 +1266,12 @@ void BrowseBox::RowRemoved( long nRow, long nNumRows, bool bDoPaint )
// adjust total row count
nRowCount -= nNumRows;
if (nRowCount < 0) nRowCount = 0;
- long nOldCurRow = nCurRow;
+ tools::Long nOldCurRow = nCurRow;
// adjust the selection
if ( bMultiSelection )
// uRow.pSel->Remove( nRow, nNumRows );
- for ( long i = 0; i < nNumRows; i++ )
+ for ( tools::Long i = 0; i < nNumRows; i++ )
uRow.pSel->Remove( nRow );
else if ( nRow < uRow.nSel && uRow.nSel >= nNumRows )
uRow.nSel -= nNumRows;
@@ -1306,7 +1306,7 @@ void BrowseBox::RowRemoved( long nRow, long nNumRows, bool bDoPaint )
// if there are Rows behind
if (nRow < nRowCount)
{
- long nY = (nRow-nTopRow) * GetDataRowHeight();
+ tools::Long nY = (nRow-nTopRow) * GetDataRowHeight();
pDataWin->SetClipRegion();
if( pDataWin->GetBackground().IsScrollable() )
{
@@ -1391,7 +1391,7 @@ void BrowseBox::RowRemoved( long nRow, long nNumRows, bool bDoPaint )
Any()
);
- for (long i = nRow+1 ; i <= (nRow+nNumRows) ; ++i)
+ for (tools::Long i = nRow+1 ; i <= (nRow+nNumRows) ; ++i)
{
commitHeaderBarEvent(
CHILD,
@@ -1412,16 +1412,16 @@ void BrowseBox::RowRemoved( long nRow, long nNumRows, bool bDoPaint )
}
-bool BrowseBox::GoToRow( long nRow)
+bool BrowseBox::GoToRow( tools::Long nRow)
{
return GoToRow(nRow, false);
}
-bool BrowseBox::GoToRow( long nRow, bool bRowColMove, bool bKeepSelection )
+bool BrowseBox::GoToRow( tools::Long nRow, bool bRowColMove, bool bKeepSelection )
{
- long nOldCurRow = nCurRow;
+ tools::Long nOldCurRow = nCurRow;
// nothing to do?
if ( nRow == nCurRow && ( bMultiSelection || uRow.nSel == nRow ) )
@@ -1438,7 +1438,7 @@ bool BrowseBox::GoToRow( long nRow, bool bRowColMove, bool bKeepSelection )
// compute the last visible row
Size aSz( pDataWin->GetSizePixel() );
sal_uInt16 nVisibleRows = sal_uInt16( aSz.Height() / GetDataRowHeight() - 1 );
- long nLastRow = nTopRow + nVisibleRows;
+ tools::Long nLastRow = nTopRow + nVisibleRows;
// suspend Updates
pDataWin->EnterUpdateLock();
@@ -1566,7 +1566,7 @@ bool BrowseBox::GoToColumnId( sal_uInt16 nColId, bool bMakeVisible, bool bRowCol
}
-bool BrowseBox::GoToRowColumnId( long nRow, sal_uInt16 nColId )
+bool BrowseBox::GoToRowColumnId( tools::Long nRow, sal_uInt16 nColId )
{
// out of range?
@@ -1651,7 +1651,7 @@ void BrowseBox::SelectAll()
// don't highlight handle column
BrowserColumn *pFirstCol = mvCols[ 0 ].get();
- long nOfsX = pFirstCol->GetId() ? 0 : pFirstCol->Width();
+ tools::Long nOfsX = pFirstCol->GetId() ? 0 : pFirstCol->Width();
// highlight the row selection
if ( !bHideSelect )
@@ -1659,7 +1659,7 @@ void BrowseBox::SelectAll()
tools::Rectangle aHighlightRect;
sal_uInt16 nVisibleRows =
static_cast<sal_uInt16>(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
- for ( long nRow = std::max<long>( nTopRow, uRow.pSel->FirstSelected() );
+ for ( tools::Long nRow = std::max<long>( nTopRow, uRow.pSel->FirstSelected() );
nRow != BROWSER_ENDOFSELECTION && nRow < nTopRow + nVisibleRows;
nRow = uRow.pSel->NextSelected() )
aHighlightRect.Union( tools::Rectangle(
@@ -1700,7 +1700,7 @@ void BrowseBox::SelectAll()
}
-void BrowseBox::SelectRow( long nRow, bool _bSelect, bool bExpand )
+void BrowseBox::SelectRow( tools::Long nRow, bool _bSelect, bool bExpand )
{
if ( !bMultiSelection )
@@ -1738,7 +1738,7 @@ void BrowseBox::SelectRow( long nRow, bool _bSelect, bool bExpand )
{
// don't highlight handle column
BrowserColumn *pFirstCol = mvCols[ 0 ].get();
- long nOfsX = pFirstCol->GetId() ? 0 : pFirstCol->Width();
+ tools::Long nOfsX = pFirstCol->GetId() ? 0 : pFirstCol->Width();
// highlight only newly selected part
tools::Rectangle aRect(
@@ -1772,7 +1772,7 @@ void BrowseBox::SelectRow( long nRow, bool _bSelect, bool bExpand )
}
-long BrowseBox::GetSelectRowCount() const
+tools::Long BrowseBox::GetSelectRowCount() const
{
return bMultiSelection ? uRow.pSel->GetSelectCount() :
@@ -1853,34 +1853,34 @@ sal_uInt16 BrowseBox::GetSelectColumnCount() const
}
-long BrowseBox::FirstSelectedColumn( ) const
+tools::Long BrowseBox::FirstSelectedColumn( ) const
{
return pColSel ? pColSel->FirstSelected() : BROWSER_ENDOFSELECTION;
}
-long BrowseBox::FirstSelectedRow()
+tools::Long BrowseBox::FirstSelectedRow()
{
return bMultiSelection ? uRow.pSel->FirstSelected() : uRow.nSel;
}
-long BrowseBox::NextSelectedRow()
+tools::Long BrowseBox::NextSelectedRow()
{
return bMultiSelection ? uRow.pSel->NextSelected() : BROWSER_ENDOFSELECTION;
}
-long BrowseBox::LastSelectedRow()
+tools::Long BrowseBox::LastSelectedRow()
{
return bMultiSelection ? uRow.pSel->LastSelected() : uRow.nSel;
}
-bool BrowseBox::IsRowSelected( long nRow ) const
+bool BrowseBox::IsRowSelected( tools::Long nRow ) const
{
return bMultiSelection ? uRow.pSel->IsSelected(nRow) : nRow == uRow.nSel;
@@ -1897,7 +1897,7 @@ bool BrowseBox::IsColumnSelected( sal_uInt16 nColumnId ) const
void BrowseBox::MakeFieldVisible
(
- long nRow, // line number of the field (starting with 0)
+ tools::Long nRow, // line number of the field (starting with 0)
sal_uInt16 nColId // column ID of the field
)
@@ -1948,7 +1948,7 @@ void BrowseBox::MakeFieldVisible
ScrollRows( nRow - nTopRow );
// positioned outside below?
- long nBottomRow = nTopRow + GetVisibleRows();
+ tools::Long nBottomRow = nTopRow + GetVisibleRows();
// decrement nBottomRow to make it the number of the last visible line
// (count starts with 0!).
// Example: BrowseBox contains exactly one entry. nBottomRow := 0 + 1 - 1
@@ -1961,7 +1961,7 @@ void BrowseBox::MakeFieldVisible
}
-bool BrowseBox::IsFieldVisible( long nRow, sal_uInt16 nColumnId,
+bool BrowseBox::IsFieldVisible( tools::Long nRow, sal_uInt16 nColumnId,
bool bCompletely ) const
{
@@ -1986,7 +1986,7 @@ bool BrowseBox::IsFieldVisible( long nRow, sal_uInt16 nColumnId,
}
-tools::Rectangle BrowseBox::GetFieldRectPixel( long nRow, sal_uInt16 nColumnId,
+tools::Rectangle BrowseBox::GetFieldRectPixel( tools::Long nRow, sal_uInt16 nColumnId,
bool bRelToBrowser) const
{
@@ -2007,7 +2007,7 @@ tools::Rectangle BrowseBox::GetFieldRectPixel( long nRow, sal_uInt16 nColumnId,
}
-tools::Rectangle BrowseBox::GetRowRectPixel( long nRow ) const
+tools::Rectangle BrowseBox::GetRowRectPixel( tools::Long nRow ) const
{
// get the rectangle relative to DataWin
@@ -2031,11 +2031,11 @@ tools::Rectangle BrowseBox::GetRowRectPixel( long nRow ) const
}
-tools::Rectangle BrowseBox::ImplFieldRectPixel( long nRow, sal_uInt16 nColumnId ) const
+tools::Rectangle BrowseBox::ImplFieldRectPixel( tools::Long nRow, sal_uInt16 nColumnId ) const
{
// compute the X-coordinate relative to DataWin by accumulation
- long nColX = 0;
+ tools::Long nColX = 0;
sal_uInt16 nFrozenCols = FrozenColCount();
size_t nCol;
for ( nCol = 0;
@@ -2048,7 +2048,7 @@ tools::Rectangle BrowseBox::ImplFieldRectPixel( long nRow, sal_uInt16 nColumnId
return tools::Rectangle();
// compute the Y-coordinate relative to DataWin
- long nRowY = GetDataRowHeight();
+ tools::Long nRowY = GetDataRowHeight();
if ( nRow != BROWSER_ENDOFSELECTION ) // #105497# OJ
nRowY = ( nRow - nTopRow ) * GetDataRowHeight();
@@ -2061,7 +2061,7 @@ tools::Rectangle BrowseBox::ImplFieldRectPixel( long nRow, sal_uInt16 nColumnId
}
-long BrowseBox::GetRowAtYPosPixel( long nY, bool bRelToBrowser ) const
+tools::Long BrowseBox::GetRowAtYPosPixel( tools::Long nY, bool bRelToBrowser ) const
{
// compute the Y-coordinate
@@ -2087,11 +2087,11 @@ tools::Rectangle BrowseBox::GetFieldRect( sal_uInt16 nColumnId ) const
}
-sal_uInt16 BrowseBox::GetColumnAtXPosPixel( long nX ) const
+sal_uInt16 BrowseBox::GetColumnAtXPosPixel( tools::Long nX ) const
{
// accumulate the widths of the visible columns
- long nColX = 0;
+ tools::Long nColX = 0;
for ( size_t nCol = 0; nCol < mvCols.size(); ++nCol )
{
BrowserColumn *pCol = mvCols[ nCol ].get();
@@ -2149,7 +2149,7 @@ void BrowseBox::SetMode( BrowserMode nMode )
nControlAreaWidth = USHRT_MAX;
- long nOldRowSel = bMultiSelection ? uRow.pSel->FirstSelected() : uRow.nSel;
+ tools::Long nOldRowSel = bMultiSelection ? uRow.pSel->FirstSelected() : uRow.nSel;
MultiSelection *pOldRowSel = bMultiSelection ? uRow.pSel : nullptr;
pVScroll.disposeAndClear();
@@ -2238,7 +2238,7 @@ void BrowseBox::SetMode( BrowserMode nMode )
}
-void BrowseBox::VisibleRowsChanged( long, sal_uInt16 )
+void BrowseBox::VisibleRowsChanged( tools::Long, sal_uInt16 )
{
// old behavior: automatically correct NumRows:
@@ -2253,7 +2253,7 @@ void BrowseBox::VisibleRowsChanged( long, sal_uInt16 )
}
-bool BrowseBox::IsCursorMoveAllowed( long, sal_uInt16 ) const
+bool BrowseBox::IsCursorMoveAllowed( tools::Long, sal_uInt16 ) const
/* [Description]
@@ -2272,7 +2272,7 @@ bool BrowseBox::IsCursorMoveAllowed( long, sal_uInt16 ) const
}
-long BrowseBox::GetDataRowHeight() const
+tools::Long BrowseBox::GetDataRowHeight() const
{
return CalcZoom(nDataRowHeight ? nDataRowHeight : ImpGetDataRowHeight());
}
@@ -2292,9 +2292,9 @@ void BrowseBox::SetHeaderBar( BrowserHeader* pHeaderBar )
pDataWin->pHeaderBar->SetStartDragHdl( LINK( this, BrowseBox, StartDragHdl ) );
}
-long BrowseBox::GetTitleHeight() const
+tools::Long BrowseBox::GetTitleHeight() const
{
- long nHeight;
+ tools::Long nHeight;
// ask the header bar for the text height (if possible), as the header bar's font is adjusted with
// our (and the header's) zoom factor
HeaderBar* pHeaderBar = pDataWin->pHeaderBar;
@@ -2306,7 +2306,7 @@ long BrowseBox::GetTitleHeight() const
return nTitleLines ? nTitleLines * nHeight + 4 : 0;
}
-long BrowseBox::CalcReverseZoom(long nVal)
+tools::Long BrowseBox::CalcReverseZoom(tools::Long nVal)
{
if (IsZoom())
{
@@ -2316,7 +2316,7 @@ long BrowseBox::CalcReverseZoom(long nVal)
if (!rZoom.GetNumerator())
throw o3tl::divide_by_zero();
n /= static_cast<double>(rZoom.GetNumerator());
- nVal = n>0 ? static_cast<long>(n + 0.5) : -static_cast<long>(-n + 0.5);
+ nVal = n>0 ? static_cast<tools::Long>(n + 0.5) : -static_cast<tools::Long>(-n + 0.5);
}
return nVal;
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 298a61a31c80..268bfb262ca3 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -183,7 +183,7 @@ void BrowseBox::DoubleClick( const BrowserMouseEvent & )
}
-long BrowseBox::QueryMinimumRowHeight()
+tools::Long BrowseBox::QueryMinimumRowHeight()
{
return CalcZoom( 5 );
}
@@ -242,18 +242,18 @@ void BrowseBox::ToggleSelection()
// accumulate areas of rows to highlight
std::vector<tools::Rectangle> aHighlightList;
- long nLastRowInRect = 0; // for the CFront
+ tools::Long nLastRowInRect = 0; // for the CFront
// don't highlight handle column
BrowserColumn *pFirstCol = mvCols.empty() ? nullptr : mvCols[ 0 ].get();
- long nOfsX = (!pFirstCol || pFirstCol->GetId()) ? 0 : pFirstCol->Width();
+ tools::Long nOfsX = (!pFirstCol || pFirstCol->GetId()) ? 0 : pFirstCol->Width();
// accumulate old row selection
- long nBottomRow = nTopRow +
+ tools::Long nBottomRow = nTopRow +
pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight();
if ( nBottomRow > GetRowCount() && GetRowCount() )
nBottomRow = GetRowCount();
- for ( long nRow = bMultiSelection ? uRow.pSel->FirstSelected() : uRow.nSel;
+ for ( tools::Long nRow = bMultiSelection ? uRow.pSel->FirstSelected() : uRow.nSel;
nRow != BROWSER_ENDOFSELECTION && nRow <= nBottomRow;
nRow = bMultiSelection ? uRow.pSel->NextSelected() : BROWSER_ENDOFSELECTION )
{
@@ -278,7 +278,7 @@ void BrowseBox::ToggleSelection()
}
// unhighlight old column selection (if any)
- for ( long nColId = pColSel ? pColSel->FirstSelected() : BROWSER_ENDOFSELECTION;
+ for ( tools::Long nColId = pColSel ? pColSel->FirstSelected() : BROWSER_ENDOFSELECTION;
nColId != BROWSER_ENDOFSELECTION;
nColId = pColSel->NextSelected() )
{
@@ -496,11 +496,11 @@ void BrowseBox::Resize()
aHScroll->Hide();
// calculate the size of the data window
- long nDataHeight = GetOutputSizePixel().Height() - GetTitleHeight();
+ tools::Long nDataHeight = GetOutputSizePixel().Height() - GetTitleHeight();
if ( aHScroll->IsVisible() || ( nControlAreaWidth != USHRT_MAX ) )
nDataHeight -= nSBSize;
- long nDataWidth = GetOutputSizePixel().Width();
+ tools::Long nDataWidth = GetOutputSizePixel().Width();
if ( pVScroll->IsVisible() )
nDataWidth -= nSBSize;
@@ -532,7 +532,7 @@ void BrowseBox::Resize()
{
// take the handle column into account
BrowserColumn *pFirstCol = mvCols[ 0 ].get();
- long nOfsX = pFirstCol->GetId() ? 0 : pFirstCol->Width();
+ tools::Long nOfsX = pFirstCol->GetId() ? 0 : pFirstCol->Width();
pHeaderBar->SetPosSizePixel( Point( nOfsX, 0 ), Size( GetOutputSizePixel().Width() - nOfsX, GetTitleHeight() ) );
}
@@ -581,7 +581,7 @@ void BrowseBox::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle
return;
// iterate through columns to redraw
- long nX = 0;
+ tools::Long nX = 0;
size_t nCol;
for (nCol = 0; nCol < mvCols.size() && nX < rRect.Right(); ++nCol)
{
@@ -668,10 +668,10 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags )
// (as it is based on the settings of our data window, not the foreign device)
if (!nDataRowHeight)
ImpGetDataRowHeight();
- long nHeightLogic = PixelToLogic(Size(0, nDataRowHeight), MapMode(MapUnit::Map10thMM)).Height();
- long nForeignHeightPixel = pDev->LogicToPixel(Size(0, nHeightLogic), MapMode(MapUnit::Map10thMM)).Height();
+ tools::Long nHeightLogic = PixelToLogic(Size(0, nDataRowHeight), MapMode(MapUnit::Map10thMM)).Height();
+ tools::Long nForeignHeightPixel = pDev->LogicToPixel(Size(0, nHeightLogic), MapMode(MapUnit::Map10thMM)).Height();
- long nOriginalHeight = nDataRowHeight;
+ tools::Long nOriginalHeight = nDataRowHeight;
nDataRowHeight = nForeignHeightPixel;
// this counts for the column widths, too
@@ -680,8 +680,8 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags )
{
BrowserColumn* pCurrent = mvCols[ nPos ].get();
- long nWidthLogic = PixelToLogic(Size(pCurrent->Width(), 0), MapMode(MapUnit::Map10thMM)).Width();
- long nForeignWidthPixel = pDev->LogicToPixel(Size(nWidthLogic, 0), MapMode(MapUnit::Map10thMM)).Width();
+ tools::Long nWidthLogic = PixelToLogic(Size(pCurrent->Width(), 0), MapMode(MapUnit::Map10thMM)).Width();
+ tools::Long nForeignWidthPixel = pDev->LogicToPixel(Size(nWidthLogic, 0), MapMode(MapUnit::Map10thMM)).Width();
pCurrent->SetWidth(nForeignWidthPixel, GetZoom());
if ( pBar )
@@ -698,7 +698,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags )
if ( pBar )
{
// the title height with respect to the font set for the given device
- long nTitleHeight = PixelToLogic(Size(0, GetTitleHeight()), MapMode(MapUnit::Map10thMM)).Height();
+ tools::Long nTitleHeight = PixelToLogic(Size(0, GetTitleHeight()), MapMode(MapUnit::Map10thMM)).Height();
nTitleHeight = pDev->LogicToPixel(Size(0, nTitleHeight), MapMode(MapUnit::Map10thMM)).Height();
BrowserColumn* pFirstCol = !mvCols.empty() ? mvCols[ 0 ].get() : nullptr;
@@ -761,8 +761,8 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags )
{
BrowserColumn* pCurrent = mvCols[ nPos ].get();
- long nForeignWidthLogic = pDev->PixelToLogic(Size(pCurrent->Width(), 0), MapMode(MapUnit::Map10thMM)).Width();
- long nWidthPixel = LogicToPixel(Size(nForeignWidthLogic, 0), MapMode(MapUnit::Map10thMM)).Width();
+ tools::Long nForeignWidthLogic = pDev->PixelToLogic(Size(pCurrent->Width(), 0), MapMode(MapUnit::Map10thMM)).Width();
+ tools::Long nWidthPixel = LogicToPixel(Size(nForeignWidthLogic, 0), MapMode(MapUnit::Map10thMM)).Width();
pCurrent->SetWidth(nWidthPixel, GetZoom());
if ( pBar )
@@ -778,7 +778,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec
Size aOverallAreaSize = _bForeignDevice ? _rRect.GetSize() : pDataWin->GetOutputSizePixel();
Point aOverallAreaBRPos = _bForeignDevice ? _rRect.BottomRight() : Point( aOverallAreaSize.Width(), aOverallAreaSize.Height() );
- long nDataRowHeigt = GetDataRowHeight();
+ tools::Long nDataRowHeigt = GetDataRowHeight();
// compute relative rows to redraw
sal_uLong nRelTopRow = 0;
@@ -799,7 +799,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec
Color aOldTextColor = _rOut.GetTextColor();
Color aOldFillColor = _rOut.GetFillColor();
Color aOldLineColor = _rOut.GetLineColor();
- long nHLineX = 0 == mvCols[ 0 ]->GetId() ? mvCols[ 0 ]->Width() : 0;
+ tools::Long nHLineX = 0 == mvCols[ 0 ]->GetId() ? mvCols[ 0 ]->Width() : 0;
nHLineX += aOverallAreaPos.X();
Color aDelimiterLineColor( ::svtools::ColorConfig().GetColorValue( ::svtools::CALCGRID ).nColor );
@@ -812,7 +812,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec
// get row
// check valid area, to be on the safe side:
DBG_ASSERT( static_cast<sal_uInt16>(nTopRow+nRelRow) < nRowCount, "BrowseBox::ImplPaintData: invalid seek" );
- if ( (nTopRow+long(nRelRow)) < 0 || static_cast<sal_uInt16>(nTopRow+nRelRow) >= nRowCount )
+ if ( (nTopRow+tools::Long(nRelRow)) < 0 || static_cast<sal_uInt16>(nTopRow+nRelRow) >= nRowCount )
continue;
// prepare row
@@ -935,11 +935,11 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec
_rOut.SetClipRegion();
_rOut.Push( PushFlags::LINECOLOR );
_rOut.SetLineColor( aDelimiterLineColor );
- long nY = aPos.Y() + nDataRowHeigt - 1;
+ tools::Long nY = aPos.Y() + nDataRowHeigt - 1;
if (nY <= aOverallAreaBRPos.Y())
_rOut.DrawLine( Point( nHLineX, nY ),
Point( bVLines
- ? std::min(long(aPos.X() - 1), aOverallAreaBRPos.X())
+ ? std::min(tools::Long(aPos.X() - 1), aOverallAreaBRPos.X())
: aOverallAreaBRPos.X(),
nY ) );
_rOut.Pop();
@@ -969,7 +969,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec
// draw vertical delimitational line between frozen and scrollable cols
_rOut.SetLineColor( COL_BLACK );
- long nFrozenWidth = GetFrozenWidth()-1;
+ tools::Long nFrozenWidth = GetFrozenWidth()-1;
_rOut.DrawLine( Point( aOverallAreaPos.X() + nFrozenWidth, aPos.Y() ),
Point( aOverallAreaPos.X() + nFrozenWidth, bHLines
? aPos.Y() - 1
@@ -980,7 +980,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec
{
_rOut.SetLineColor( aDelimiterLineColor );
Point aVertPos( aOverallAreaPos.X() - 1, aOverallAreaPos.Y() );
- long nDeltaY = aOverallAreaBRPos.Y();
+ tools::Long nDeltaY = aOverallAreaBRPos.Y();
for ( size_t nCol = 0; nCol < mvCols.size(); ++nCol )
{
// get column
@@ -1049,7 +1049,7 @@ void BrowseBox::UpdateScrollbars()
nCornerSize = static_cast<sal_uLong>(nCornerSize * static_cast<double>(GetZoom()));
bool bNeedsVScroll = false;
- long nMaxRows = 0;
+ tools::Long nMaxRows = 0;
if (GetDataRowHeight())
{
// needs VScroll?
@@ -1134,14 +1134,14 @@ void BrowseBox::UpdateScrollbars()
if ( pVScroll->GetThumbPos() != nTopRow )
pVScroll->SetThumbPos( nTopRow );
- long nVisibleSize = std::min( std::min( nRowCount, nMaxRows ), long(nRowCount-nTopRow) );
+ tools::Long nVisibleSize = std::min( std::min( nRowCount, nMaxRows ), tools::Long(nRowCount-nTopRow) );
pVScroll->SetVisibleSize( nVisibleSize ? nVisibleSize : 1 );
pVScroll->SetRange( Range( 0, nRowCount ) );
pVScroll->SetPosSizePixel(
Point( aDataWinSize.Width(), GetTitleHeight() ),
Size( nCornerSize, aDataWinSize.Height()) );
- long nLclDataRowHeight = GetDataRowHeight();
- if ( nLclDataRowHeight > 0 && nRowCount < long( aDataWinSize.Height() / nLclDataRowHeight ) )
+ tools::Long nLclDataRowHeight = GetDataRowHeight();
+ if ( nLclDataRowHeight > 0 && nRowCount < tools::Long( aDataWinSize.Height() / nLclDataRowHeight ) )
ScrollRows( -nTopRow );
if ( bNeedsVScroll && !pVScroll->IsVisible() )
pVScroll->Show();
@@ -1179,7 +1179,7 @@ void BrowseBox::UpdateScrollbars()
// scroll headerbar, if necessary
if ( pDataWin->pHeaderBar )
{
- long nWidth = 0;
+ tools::Long nWidth = 0;
for ( size_t nCol = 0;
nCol < mvCols.size() && nCol < nFirstCol;
++nCol )
@@ -1237,10 +1237,10 @@ bool BrowseBox::GetUpdateMode() const
}
-long BrowseBox::GetFrozenWidth() const
+tools::Long BrowseBox::GetFrozenWidth() const
{
- long nWidth = 0;
+ tools::Long nWidth = 0;
for ( size_t nCol = 0;
nCol < mvCols.size() && mvCols[ nCol ]->IsFrozen();
++nCol )
@@ -1298,8 +1298,8 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt )
if ( rEvtPos.Y() >= GetTitleHeight() )
return;
- long nX = 0;
- long nWidth = GetOutputSizePixel().Width();
+ tools::Long nX = 0;
+ tools::Long nWidth = GetOutputSizePixel().Width();
for ( size_t nCol = 0; nCol < mvCols.size() && nX < nWidth; ++nCol )
{
// is this column visible?
@@ -1307,7 +1307,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt )
if ( pCol->IsFrozen() || nCol >= nFirstCol )
{
// compute right end of column
- long nR = nX + pCol->Width() - 1;
+ tools::Long nR = nX + pCol->Width() - 1;
// at the end of a column (and not handle column)?
if ( pCol->GetId() && std::abs( nR - rEvtPos.X() ) < 2 )
@@ -1362,7 +1362,7 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt )
// show resize-pointer?
if ( bResizing || ( pCol->GetId() &&
- std::abs( static_cast<long>(nR) - rEvt.GetPosPixel().X() ) < MIN_COLUMNWIDTH ) )
+ std::abs( static_cast<tools::Long>(nR) - rEvt.GetPosPixel().X() ) < MIN_COLUMNWIDTH ) )
{
aNewPointer = PointerStyle::HSplit;
if ( bResizing )
@@ -1372,7 +1372,7 @@ void BrowseBox::MouseMove( const MouseEvent& rEvt )
// check allowed width and new delta
nDragX = std::max( rEvt.GetPosPixel().X(), nMinResizeX );
- long nDeltaX = nDragX - nResizeX;
+ tools::Long nDeltaX = nDragX - nResizeX;
sal_uInt16 nId = GetColumnId(nResizeCol);
sal_uLong nOldWidth = GetColumnWidth(nId);
nDragX = nOldWidth + nDeltaX + nResizeX - nOldWidth;
@@ -1402,12 +1402,12 @@ void BrowseBox::MouseButtonUp( const MouseEvent & rEvt )
// width changed?
nDragX = std::max( rEvt.GetPosPixel().X(), nMinResizeX );
- if ( (nDragX - nResizeX) != static_cast<long>(mvCols[ nResizeCol ]->Width()) )
+ if ( (nDragX - nResizeX) != static_cast<tools::Long>(mvCols[ nResizeCol ]->Width()) )
{
// resize column
- long nMaxX = pDataWin->GetSizePixel().Width();
+ tools::Long nMaxX = pDataWin->GetSizePixel().Width();
nDragX = std::min( nDragX, nMaxX );
- long nDeltaX = nDragX - nResizeX;
+ tools::Long nDeltaX = nDragX - nResizeX;
sal_uInt16 nId = GetColumnId(nResizeCol);
SetColumnWidth( GetColumnId(nResizeCol), GetColumnWidth(nId) + nDeltaX );
ColumnResized( nId );
@@ -1691,7 +1691,7 @@ bool BrowseBox::ProcessKey( const KeyEvent& rEvt )
void BrowseBox::Dispatch( sal_uInt16 nId )
{
- long nRowsOnPage = pDataWin->GetSizePixel().Height() / GetDataRowHeight();
+ tools::Long nRowsOnPage = pDataWin->GetSizePixel().Height() / GetDataRowHeight();
switch ( nId )
{
@@ -1712,7 +1712,7 @@ void BrowseBox::Dispatch( sal_uInt16 nId )
if ( GetRowCount() )
{
DoHideCursor( "BROWSER_SELECTHOME" );
- for ( long nRow = GetCurRow(); nRow >= 0; --nRow )
+ for ( tools::Long nRow = GetCurRow(); nRow >= 0; --nRow )
SelectRow( nRow );
GoToRow( 0, true );
DoShowCursor( "BROWSER_SELECTHOME" );
@@ -1722,8 +1722,8 @@ void BrowseBox::Dispatch( sal_uInt16 nId )
if ( GetRowCount() )
{
DoHideCursor( "BROWSER_SELECTEND" );
- long nRows = GetRowCount();
- for ( long nRow = GetCurRow(); nRow < nRows; ++nRow )
+ tools::Long nRows = GetRowCount();
+ for ( tools::Long nRow = GetCurRow(); nRow < nRows; ++nRow )
SelectRow( nRow );
GoToRow( GetRowCount() - 1, true );
DoShowCursor( "BROWSER_SELECTEND" );
@@ -1735,7 +1735,7 @@ void BrowseBox::Dispatch( sal_uInt16 nId )
{
// deselect the current row, if it isn't the first
// and there is no other selected row above
- long nRow = GetCurRow();
+ tools::Long nRow = GetCurRow();
bool bLocalSelect = ( !IsRowSelected( nRow ) ||
GetSelectRowCount() == 1 || IsRowSelected( nRow - 1 ) );
SelectRow( nRow, bLocalSelect );
@@ -1752,7 +1752,7 @@ void BrowseBox::Dispatch( sal_uInt16 nId )
{
// deselect the current row, if it isn't the first
// and there is no other selected row under
- long nRow = GetCurRow();
+ tools::Long nRow = GetCurRow();
bool bLocalSelect = ( !IsRowSelected( nRow ) ||
GetSelectRowCount() == 1 || IsRowSelected( nRow + 1 ) );
SelectRow( nCurRow, bLocalSelect );
@@ -1909,8 +1909,8 @@ tools::Rectangle BrowseBox::calcHeaderRect(bool _bIsColumnBar, bool _bOnScreen)
pParent = GetAccessibleParentWindow();
Point aTopLeft;
- long nWidth;
- long nHeight;
+ tools::Long nWidth;
+ tools::Long nHeight;
if ( _bIsColumnBar )
{
nWidth = pDataWin->GetOutputSizePixel().Width();
@@ -1935,8 +1935,8 @@ tools::Rectangle BrowseBox::calcTableRect(bool _bOnScreen)
tools::Rectangle aRect( GetWindowExtentsRelative( pParent ) );
tools::Rectangle aRowBar = calcHeaderRect(false, pParent == nullptr);
- long nX = aRowBar.Right() - aRect.Left();
- long nY = aRowBar.Top() - aRect.Top();
+ tools::Long nX = aRowBar.Right() - aRect.Left();
+ tools::Long nY = aRowBar.Top() - aRect.Top();
Size aSize(aRect.GetSize());
return tools::Rectangle(aRowBar.TopRight(), Size(aSize.Width() - nX, aSize.Height() - nY - GetBarHeight()) );
diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx
index e6148aa217ce..9227c0f8570a 100644
--- a/svtools/source/brwbox/brwbox3.cxx
+++ b/svtools/source/brwbox/brwbox3.cxx
@@ -395,7 +395,7 @@ void BrowseBox::GrabTableFocus()
GrabFocus();
}
-OUString BrowseBox::GetCellText(long, sal_uInt16 ) const
+OUString BrowseBox::GetCellText(tools::Long, sal_uInt16 ) const
{
SAL_WARN("svtools", "This method has to be implemented by the derived classes! BUG!!");
return OUString();
@@ -459,7 +459,7 @@ void BrowseBox::SelectColumn( sal_uInt16 _nColumn, bool _bSelect )
SelectColumnPos( _nColumn, _bSelect );
}
-bool BrowseBox::IsColumnSelected( long _nColumn ) const
+bool BrowseBox::IsColumnSelected( tools::Long _nColumn ) const
{
return ( pColSel && (0 <= _nColumn) && (_nColumn <= 0xFFF) ) &&
pColSel->IsSelected( static_cast< sal_uInt16 >( _nColumn ) );
@@ -520,7 +520,7 @@ bool BrowseBox::IsCellVisible( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const
return IsFieldVisible( _nRow, GetColumnId( _nColumnPos ) );
}
-OUString BrowseBox::GetAccessibleCellText(long _nRow, sal_uInt16 _nColPos) const
+OUString BrowseBox::GetAccessibleCellText(tools::Long _nRow, sal_uInt16 _nColPos) const
{
return GetCellText( _nRow, GetColumnId( _nColPos ) );
}
diff --git a/svtools/source/brwbox/brwhead.cxx b/svtools/source/brwbox/brwhead.cxx
index fa42bfe293c3..86ed55d0dfce 100644
--- a/svtools/source/brwbox/brwhead.cxx
+++ b/svtools/source/brwbox/brwhead.cxx
@@ -27,7 +27,7 @@ BrowserHeader::BrowserHeader( BrowseBox* pParent, WinBits nWinBits )
:HeaderBar( pParent, nWinBits )
,_pBrowseBox( pParent )
{
- long nHeight = pParent->IsZoom() ? pParent->CalcZoom(pParent->GetTitleHeight()) : pParent->GetTitleHeight();
+ tools::Long nHeight = pParent->IsZoom() ? pParent->CalcZoom(pParent->GetTitleHeight()) : pParent->GetTitleHeight();
SetPosSizePixel( Point( 0, 0),
Size( pParent->GetOutputSizePixel().Width(),
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index 80350e4a31cb..f4cc3a7ce65c 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -99,7 +99,7 @@ BrowserColumn::BrowserColumn( sal_uInt16 nItemId,
if (!rCurrentZoom.GetNumerator())
throw o3tl::divide_by_zero();
n /= static_cast<double>(rCurrentZoom.GetNumerator());
- _nOriginalWidth = n>0 ? static_cast<long>(n+0.5) : -static_cast<long>(-n+0.5);
+ _nOriginalWidth = n>0 ? static_cast<tools::Long>(n+0.5) : -static_cast<tools::Long>(-n+0.5);
}
BrowserColumn::~BrowserColumn()
@@ -122,7 +122,7 @@ void BrowserColumn::SetWidth(sal_uLong nNewWidthPixel, const Fraction& rCurrentZ
if (!rCurrentZoom.GetNumerator())
throw o3tl::divide_by_zero();
n /= static_cast<double>(rCurrentZoom.GetNumerator());
- _nOriginalWidth = n>0 ? static_cast<long>(n+0.5) : -static_cast<long>(-n+0.5);
+ _nOriginalWidth = n>0 ? static_cast<tools::Long>(n+0.5) : -static_cast<tools::Long>(-n+0.5);
}
}
@@ -153,7 +153,7 @@ void BrowserColumn::Draw( BrowseBox const & rBox, OutputDevice& rDev, const Poin
else
{
// paint data column
- long nWidth = Width() == LONG_MAX ? rBox.GetDataWindow().GetSizePixel().Width() : Width();
+ tools::Long nWidth = Width() == LONG_MAX ? rBox.GetDataWindow().GetSizePixel().Width() : Width();
rBox.DoPaintField( rDev,
tools::Rectangle(
@@ -168,7 +168,7 @@ void BrowserColumn::Draw( BrowseBox const & rBox, OutputDevice& rDev, const Poin
void BrowserColumn::ZoomChanged(const Fraction& rNewZoom)
{
double n(_nOriginalWidth * rNewZoom);
- _nWidth = n>0 ? static_cast<long>(n+0.5) : -static_cast<long>(-n+0.5);
+ _nWidth = n>0 ? static_cast<tools::Long>(n+0.5) : -static_cast<tools::Long>(-n+0.5);
}
@@ -298,14 +298,14 @@ BrowseEvent BrowserDataWin::CreateBrowseEvent( const Point& rPosPixel )
BrowseBox *pBox = GetParent();
// seek to row under mouse
- long nRelRow = rPosPixel.Y() < 0
+ tools::Long nRelRow = rPosPixel.Y() < 0
? -1
: rPosPixel.Y() / pBox->GetDataRowHeight();
- long nRow = nRelRow < 0 ? -1 : nRelRow + pBox->nTopRow;
+ tools::Long nRow = nRelRow < 0 ? -1 : nRelRow + pBox->nTopRow;
// find column under mouse
- long nMouseX = rPosPixel.X();
- long nColX = 0;
+ tools::Long nMouseX = rPosPixel.X();
+ tools::Long nColX = 0;
size_t nCol;
for ( nCol = 0;
nCol < pBox->mvCols.size() && nColX < GetSizePixel().Width();
@@ -376,7 +376,7 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
return;
Point aEventPos( rEvt.GetMousePosPixel() );
- long nRow = pBox->GetRowAtYPosPixel( aEventPos.Y(), false);
+ tools::Long nRow = pBox->GetRowAtYPosPixel( aEventPos.Y(), false);
MouseEvent aMouseEvt( aEventPos, 1, MouseEventModifiers::SELECT, MOUSE_LEFT );
if ( CommandEventId::ContextMenu == rEvt.GetCommand() && rEvt.IsMouseEvent() &&
nRow < pBox->GetRowCount() && !pBox->IsRowSelected(nRow) )
@@ -417,7 +417,7 @@ bool BrowserDataWin::ImplRowDividerHitTest( const BrowserMouseEvent& _rEvent )
)
return false;
- long nDividerDistance = GetParent()->GetDataRowHeight() - ( _rEvent.GetPosPixel().Y() % GetParent()->GetDataRowHeight() );
+ tools::Long nDividerDistance = GetParent()->GetDataRowHeight() - ( _rEvent.GetPosPixel().Y() % GetParent()->GetDataRowHeight() );
return ( nDividerDistance <= 4 );
}
@@ -495,9 +495,9 @@ void BrowserDataWin::MouseButtonUp( const MouseEvent& rEvt )
void BrowserDataWin::StartRowDividerDrag( const Point& _rStartPos )
{
- long nDataRowHeight = GetParent()->GetDataRowHeight();
+ tools::Long nDataRowHeight = GetParent()->GetDataRowHeight();
// the exact separation pos of the two rows
- long nDragRowDividerCurrentPos = _rStartPos.Y();
+ tools::Long nDragRowDividerCurrentPos = _rStartPos.Y();
if ( ( nDragRowDividerCurrentPos % nDataRowHeight ) > nDataRowHeight / 2 )
nDragRowDividerCurrentPos += nDataRowHeight;
nDragRowDividerCurrentPos /= nDataRowHeight;
@@ -535,7 +535,7 @@ void BrowserDataWin::Tracking( const TrackingEvent& rTEvt )
if ( !rTEvt.IsTrackingCanceled() )
{
- long nNewRowHeight = aMousePos.Y() + m_nDragRowDividerOffset - m_nDragRowDividerLimit;
+ tools::Long nNewRowHeight = aMousePos.Y() + m_nDragRowDividerOffset - m_nDragRowDividerLimit;
// care for minimum row height
if ( nNewRowHeight < GetParent()->QueryMinimumRowHeight() )
@@ -547,7 +547,7 @@ void BrowserDataWin::Tracking( const TrackingEvent& rTEvt )
}
else
{
- long nDragRowDividerCurrentPos = aMousePos.Y() + m_nDragRowDividerOffset;
+ tools::Long nDragRowDividerCurrentPos = aMousePos.Y() + m_nDragRowDividerOffset;
// care for minimum row height
if ( nDragRowDividerCurrentPos < m_nDragRowDividerLimit + GetParent()->QueryMinimumRowHeight() )
@@ -574,7 +574,7 @@ void BrowserDataWin::RequestHelp( const HelpEvent& rHEvt )
BrowseEvent::BrowseEvent( vcl::Window* pWindow,
- long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
+ tools::Long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
const tools::Rectangle& rRect ):
pWin(pWindow),
nRow(nAbsRow),
@@ -594,7 +594,7 @@ BrowserMouseEvent::BrowserMouseEvent( BrowserDataWin *pWindow,
BrowserMouseEvent::BrowserMouseEvent( vcl::Window *pWindow, const MouseEvent& rEvt,
- long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
+ tools::Long nAbsRow, sal_uInt16 nColumn, sal_uInt16 nColumnId,
const tools::Rectangle& rRect ):
MouseEvent(rEvt),
BrowseEvent( pWindow, nAbsRow, nColumn, nColumnId, rRect )
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index 996b68b4b194..1c451fa95943 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -196,7 +196,7 @@ namespace svt
}
- bool EditBrowseBox::SeekRow(long nRow)
+ bool EditBrowseBox::SeekRow(tools::Long nRow)
{
nPaintRow = nRow;
return true;
@@ -364,7 +364,7 @@ namespace svt
}
- EditBrowseBox::RowStatus EditBrowseBox::GetRowStatus(long) const
+ EditBrowseBox::RowStatus EditBrowseBox::GetRowStatus(tools::Long) const
{
return CLEAN;
}
@@ -770,7 +770,7 @@ namespace svt
}
- bool EditBrowseBox::IsCursorMoveAllowed(long nNewRow, sal_uInt16 nNewColId) const
+ bool EditBrowseBox::IsCursorMoveAllowed(tools::Long nNewRow, sal_uInt16 nNewColId) const
{
sal_uInt16 nInfo = 0;
@@ -874,7 +874,7 @@ namespace svt
}
- bool EditBrowseBox::CursorMoving(long, sal_uInt16)
+ bool EditBrowseBox::CursorMoving(tools::Long, sal_uInt16)
{
DeactivateCell(false);
return true;
@@ -883,7 +883,7 @@ namespace svt
void EditBrowseBox::CursorMoved()
{
- long nNewRow = GetCurRow();
+ tools::Long nNewRow = GetCurRow();
if (nEditRow != nNewRow)
{
if (!(GetBrowserFlags() & EditBrowseBoxFlags::NO_HANDLE_COLUMN_CONTENT))
@@ -909,7 +909,7 @@ namespace svt
}
- void EditBrowseBox::ActivateCell(long nRow, sal_uInt16 nCol, bool bCellFocus)
+ void EditBrowseBox::ActivateCell(tools::Long nRow, sal_uInt16 nCol, bool bCellFocus)
{
if (IsEditing())
return;
@@ -992,7 +992,7 @@ namespace svt
}
- tools::Rectangle EditBrowseBox::GetCellRect(long nRow, sal_uInt16 nColId, bool bRel) const
+ tools::Rectangle EditBrowseBox::GetCellRect(tools::Long nRow, sal_uInt16 nColId, bool bRel) const
{
tools::Rectangle aRect( GetFieldRectPixel(nRow, nColId, bRel));
if ((GetMode() & BrowserMode::CURSOR_WO_FOCUS) == BrowserMode::CURSOR_WO_FOCUS)
@@ -1060,7 +1060,7 @@ namespace svt
DBG_ASSERT(nId, "EditBrowseBox::AppendColumn: invalid id!");
- long w = nWidth;
+ tools::Long w = nWidth;
if (!w)
w = GetDefaultColumnWidth(rName);
@@ -1102,7 +1102,7 @@ namespace svt
{
}
- CellController* EditBrowseBox::GetController(long, sal_uInt16)
+ CellController* EditBrowseBox::GetController(tools::Long, sal_uInt16)
{
return nullptr;
}
@@ -1122,7 +1122,7 @@ namespace svt
rControl.SetPosSizePixel(aPoint, aSize);
}
- void EditBrowseBox::InitController(CellControllerRef&, long, sal_uInt16)
+ void EditBrowseBox::InitController(CellControllerRef&, tools::Long, sal_uInt16)
{
}
@@ -1152,12 +1152,12 @@ namespace svt
sal_uInt32 nCurColWidth = GetColumnWidth(nColId);
sal_uInt32 nMinColWidth = CalcZoom(20); // minimum
sal_uInt32 nNewColWidth = nMinColWidth;
- long nMaxRows = std::min(long(GetVisibleRows()), GetRowCount());
- long nLastVisRow = GetTopRow() + nMaxRows - 1;
+ tools::Long nMaxRows = std::min(tools::Long(GetVisibleRows()), GetRowCount());
+ tools::Long nLastVisRow = GetTopRow() + nMaxRows - 1;
if (GetTopRow() <= nLastVisRow) // calc the column with using the cell contents
{
- for (long i = GetTopRow(); i <= nLastVisRow; ++i)
+ for (tools::Long i = GetTopRow(); i <= nLastVisRow; ++i)
nNewColWidth = std::max(nNewColWidth,GetTotalCellWidth(i,nColId) + 12);
if (nNewColWidth == nCurColWidth) // size has not changed
@@ -1168,7 +1168,7 @@ namespace svt
return nNewColWidth;
}
- sal_uInt32 EditBrowseBox::GetTotalCellWidth(long, sal_uInt16)
+ sal_uInt32 EditBrowseBox::GetTotalCellWidth(tools::Long, sal_uInt16)
{
return 0;
}
diff --git a/svtools/source/brwbox/editbrowsebox2.cxx b/svtools/source/brwbox/editbrowsebox2.cxx
index 51f58e320703..fece6c6dc0a0 100644
--- a/svtools/source/brwbox/editbrowsebox2.cxx
+++ b/svtools/source/brwbox/editbrowsebox2.cxx
@@ -35,7 +35,7 @@ namespace svt
using namespace ::com::sun::star::accessibility::AccessibleEventId;
-Reference< XAccessible > EditBrowseBox::CreateAccessibleCheckBoxCell(long _nRow, sal_uInt16 _nColumnPos,const TriState& eState)
+Reference< XAccessible > EditBrowseBox::CreateAccessibleCheckBoxCell(tools::Long _nRow, sal_uInt16 _nColumnPos,const TriState& eState)
{
Reference< XAccessible > xAccessible( GetAccessible() );
Reference< XAccessibleContext > xAccContext;
@@ -143,7 +143,7 @@ void EditBrowseBox::DetermineFocus( const GetFocusFlags _nGetFocusFlags )
)
return;
- long nRows = GetRowCount();
+ tools::Long nRows = GetRowCount();
sal_uInt16 nCols = ColCount();
if (( nRows <= 0 ) || ( nCols <= 0 ))
diff --git a/svtools/source/config/printoptions.cxx b/svtools/source/config/printoptions.cxx
index afcd07108e6c..e7d7ce991429 100644
--- a/svtools/source/config/printoptions.cxx
+++ b/svtools/source/config/printoptions.cxx
@@ -424,7 +424,7 @@ void SvtBasePrintOptions::SetPrinterOptions( const PrinterOptions& rOptions )
SetReducedBitmapResolution( 0 );
else
{
- for( long i = DPI_COUNT - 1; i >= 0; i-- )
+ for( tools::Long i = DPI_COUNT - 1; i >= 0; i-- )
{
if( nDPI >= aDPIArray[ i ] )
{
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index 7a5d73e3135c..180fe6a9661b 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -84,15 +84,15 @@ bool BorderWidthImpl::operator== ( const BorderWidthImpl& r ) const
( m_nRateGap == r.m_nRateGap );
}
-long BorderWidthImpl::GetLine1( long nWidth ) const
+tools::Long BorderWidthImpl::GetLine1( tools::Long nWidth ) const
{
- long result = static_cast<long>(m_nRate1);
+ tools::Long result = static_cast<tools::Long>(m_nRate1);
if ( m_nFlags & BorderWidthImplFlags::CHANGE_LINE1 )
{
- long const nConstant2 = (m_nFlags & BorderWidthImplFlags::CHANGE_LINE2) ? 0 : m_nRate2;
- long const nConstantD = (m_nFlags & BorderWidthImplFlags::CHANGE_DIST ) ? 0 : m_nRateGap;
+ tools::Long const nConstant2 = (m_nFlags & BorderWidthImplFlags::CHANGE_LINE2) ? 0 : m_nRate2;
+ tools::Long const nConstantD = (m_nFlags & BorderWidthImplFlags::CHANGE_DIST ) ? 0 : m_nRateGap;
result = std::max<long>(0,
- static_cast<long>((m_nRate1 * nWidth) + 0.5)
+ static_cast<tools::Long>((m_nRate1 * nWidth) + 0.5)
- (nConstant2 + nConstantD));
if (result == 0 && m_nRate1 > 0.0 && nWidth > 0)
{ // fdo#51777: hack to essentially treat 1 twip DOUBLE border
@@ -102,29 +102,29 @@ long BorderWidthImpl::GetLine1( long nWidth ) const
return result;
}
-long BorderWidthImpl::GetLine2( long nWidth ) const
+tools::Long BorderWidthImpl::GetLine2( tools::Long nWidth ) const
{
- long result = static_cast<long>(m_nRate2);
+ tools::Long result = static_cast<tools::Long>(m_nRate2);
if ( m_nFlags & BorderWidthImplFlags::CHANGE_LINE2)
{
- long const nConstant1 = (m_nFlags & BorderWidthImplFlags::CHANGE_LINE1) ? 0 : m_nRate1;
- long const nConstantD = (m_nFlags & BorderWidthImplFlags::CHANGE_DIST ) ? 0 : m_nRateGap;
+ tools::Long const nConstant1 = (m_nFlags & BorderWidthImplFlags::CHANGE_LINE1) ? 0 : m_nRate1;
+ tools::Long const nConstantD = (m_nFlags & BorderWidthImplFlags::CHANGE_DIST ) ? 0 : m_nRateGap;
result = std::max<long>(0,
- static_cast<long>((m_nRate2 * nWidth) + 0.5)
+ static_cast<tools::Long>((m_nRate2 * nWidth) + 0.5)
- (nConstant1 + nConstantD));
}
return result;
}
-long BorderWidthImpl::GetGap( long nWidth ) const
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list